mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-31 12:13:10 +00:00
- Add shim to simplify migration to the CAM-based ATA. For each new adaX
device in /dev/ create symbolic link with adY name, trying to mimic old ATA numbering. Imitation is not complete, but should be enough in most cases to mount file systems without touching /etc/fstab. - To know what behavior to mimic, restore ATA_STATIC_ID option in cases where it was present before. - Add some more details to UPDATING.
This commit is contained in:
parent
f30bc1f3b5
commit
0d307e0905
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221071
13
UPDATING
13
UPDATING
@ -30,7 +30,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
|
||||
them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY,
|
||||
where 'Y's are the sequential numbers starting from zero for each type
|
||||
in order of detection, unless configured otherwise with tunables,
|
||||
see cam(4)).
|
||||
see cam(4)). There will be symbolic links created in /dev/ to map
|
||||
old adX devices to the respective adaY. They should provide basic
|
||||
compatibility for file systems mounting in most cases, but they do
|
||||
not support old user-level APIs and do not have respective providers
|
||||
in GEOM. Consider using updated management tools with new device names.
|
||||
|
||||
It is possible to load devices ahci, ata, siis and mvs as modules,
|
||||
but option ATA_CAM should remain in kernel configuration to make ata
|
||||
module work as CAM driver supporting legacy ATA controllers. Device ata
|
||||
still can be used in modular fashion (atacore + ...). Modules atadisk
|
||||
and atapi* are not used and won't affect operation in ATA_CAM mode.
|
||||
|
||||
ataraid(4) functionality is now supported by the RAID GEOM class.
|
||||
To use it you can load geom_raid kernel module and use graid(8) tool
|
||||
@ -49,7 +59,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
|
||||
device atapicd # ATAPI CDROM drives
|
||||
device atapifd # ATAPI floppy drives
|
||||
device atapist # ATAPI tape drives
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
||||
20110423:
|
||||
The default NFS server has been changed to the new server, which
|
||||
|
@ -93,6 +93,7 @@ device fdc
|
||||
device ahci # AHCI-compatible SATA controllers
|
||||
device ata # Legacy ATA/SATA controllers
|
||||
options ATA_CAM # Handle legacy controllers with CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
|
||||
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
|
||||
|
||||
|
@ -74,6 +74,7 @@ device pci
|
||||
|
||||
device ata
|
||||
options ATA_CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
||||
device scbus # SCSI bus (required for ATA/SCSI)
|
||||
device cd # CD
|
||||
|
@ -74,6 +74,7 @@ device pci
|
||||
|
||||
device ata
|
||||
options ATA_CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
||||
device scbus # SCSI bus (required for ATA/SCSI)
|
||||
device cd # CD
|
||||
|
@ -73,6 +73,7 @@ device pci
|
||||
|
||||
device ata
|
||||
options ATA_CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
||||
device scbus # SCSI bus (required for ATA/SCSI)
|
||||
device cd # CD
|
||||
|
@ -28,6 +28,7 @@
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_ada.h"
|
||||
#include "opt_ata.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
@ -183,6 +184,14 @@ static void adashutdown(void *arg, int howto);
|
||||
static void adasuspend(void *arg);
|
||||
static void adaresume(void *arg);
|
||||
|
||||
#ifndef ADA_DEFAULT_LEGACY_ALIASES
|
||||
#ifdef ATA_CAM
|
||||
#define ADA_DEFAULT_LEGACY_ALIASES 1
|
||||
#else
|
||||
#define ADA_DEFAULT_LEGACY_ALIASES 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ADA_DEFAULT_TIMEOUT
|
||||
#define ADA_DEFAULT_TIMEOUT 30 /* Timeout in seconds */
|
||||
#endif
|
||||
@ -215,6 +224,7 @@ static void adaresume(void *arg);
|
||||
#define ata_disk_firmware_geom_adjust(disk)
|
||||
#endif
|
||||
|
||||
static int ada_legacy_aliases = ADA_DEFAULT_LEGACY_ALIASES;
|
||||
static int ada_retry_count = ADA_DEFAULT_RETRY;
|
||||
static int ada_default_timeout = ADA_DEFAULT_TIMEOUT;
|
||||
static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED;
|
||||
@ -224,6 +234,9 @@ static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE;
|
||||
|
||||
SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
|
||||
"CAM Direct Access Disk driver");
|
||||
SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW,
|
||||
&ada_legacy_aliases, 0, "Create legacy-like device aliases");
|
||||
TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases);
|
||||
SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW,
|
||||
&ada_retry_count, 0, "Normal I/O retry count");
|
||||
TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count);
|
||||
@ -723,10 +736,11 @@ adaregister(struct cam_periph *periph, void *arg)
|
||||
struct ada_softc *softc;
|
||||
struct ccb_pathinq cpi;
|
||||
struct ccb_getdev *cgd;
|
||||
char announce_buf[80];
|
||||
char announce_buf[80], buf1[32];
|
||||
struct disk_params *dp;
|
||||
caddr_t match;
|
||||
u_int maxio;
|
||||
int legacy_id;
|
||||
|
||||
cgd = (struct ccb_getdev *)arg;
|
||||
if (periph == NULL) {
|
||||
@ -861,6 +875,22 @@ adaregister(struct cam_periph *periph, void *arg)
|
||||
softc->disk->d_fwheads = softc->params.heads;
|
||||
ata_disk_firmware_geom_adjust(softc->disk);
|
||||
|
||||
if (ada_legacy_aliases) {
|
||||
#ifdef ATA_STATIC_ID
|
||||
legacy_id = xpt_path_legacy_ata_id(periph->path);
|
||||
#else
|
||||
legacy_id = softc->disk->d_unit;
|
||||
#endif
|
||||
if (legacy_id >= 0) {
|
||||
snprintf(announce_buf, sizeof(announce_buf),
|
||||
"kern.devalias.%s%d",
|
||||
softc->disk->d_name, softc->disk->d_unit);
|
||||
snprintf(buf1, sizeof(buf1),
|
||||
"ad%d", legacy_id);
|
||||
setenv(announce_buf, buf1);
|
||||
}
|
||||
} else
|
||||
legacy_id = -1;
|
||||
disk_create(softc->disk, DISK_VERSION);
|
||||
mtx_lock(periph->sim->mtx);
|
||||
cam_periph_unhold(periph);
|
||||
@ -874,6 +904,9 @@ adaregister(struct cam_periph *periph, void *arg)
|
||||
dp->secsize, dp->heads,
|
||||
dp->secs_per_track, dp->cylinders);
|
||||
xpt_announce_periph(periph, announce_buf);
|
||||
if (legacy_id >= 0)
|
||||
printf("%s%d: Previously was known as ad%d\n",
|
||||
periph->periph_name, periph->unit_number, legacy_id);
|
||||
|
||||
/*
|
||||
* Create our sysctl variables, now that we know
|
||||
|
@ -3569,6 +3569,42 @@ xpt_path_periph(struct cam_path *path)
|
||||
return (path->periph);
|
||||
}
|
||||
|
||||
int
|
||||
xpt_path_legacy_ata_id(struct cam_path *path)
|
||||
{
|
||||
struct cam_eb *bus;
|
||||
int bus_id;
|
||||
|
||||
if ((strcmp(path->bus->sim->sim_name, "ata") != 0) &&
|
||||
strcmp(path->bus->sim->sim_name, "ahcich") != 0 &&
|
||||
strcmp(path->bus->sim->sim_name, "mvsch") != 0 &&
|
||||
strcmp(path->bus->sim->sim_name, "siisch") != 0)
|
||||
return (-1);
|
||||
|
||||
if (strcmp(path->bus->sim->sim_name, "ata") == 0 &&
|
||||
path->bus->sim->unit_number < 2) {
|
||||
bus_id = path->bus->sim->unit_number;
|
||||
} else {
|
||||
bus_id = 2;
|
||||
xpt_lock_buses();
|
||||
TAILQ_FOREACH(bus, &xsoftc.xpt_busses, links) {
|
||||
if (bus == path->bus)
|
||||
break;
|
||||
if ((strcmp(bus->sim->sim_name, "ata") == 0 &&
|
||||
bus->sim->unit_number >= 2) ||
|
||||
strcmp(bus->sim->sim_name, "ahcich") == 0 ||
|
||||
strcmp(bus->sim->sim_name, "mvsch") == 0 ||
|
||||
strcmp(bus->sim->sim_name, "siisch") == 0)
|
||||
bus_id++;
|
||||
}
|
||||
xpt_unlock_buses();
|
||||
}
|
||||
if (path->target != NULL)
|
||||
return (bus_id * 2 + path->target->target_id);
|
||||
else
|
||||
return (bus_id * 2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Release a CAM control block for the caller. Remit the cost of the structure
|
||||
* to the device referenced by the path. If the this device had no 'credits'
|
||||
|
@ -113,6 +113,7 @@ int xpt_path_string(struct cam_path *path, char *str,
|
||||
path_id_t xpt_path_path_id(struct cam_path *path);
|
||||
target_id_t xpt_path_target_id(struct cam_path *path);
|
||||
lun_id_t xpt_path_lun_id(struct cam_path *path);
|
||||
int xpt_path_legacy_ata_id(struct cam_path *path);
|
||||
struct cam_sim *xpt_path_sim(struct cam_path *path);
|
||||
struct cam_periph *xpt_path_periph(struct cam_path *path);
|
||||
void xpt_async(u_int32_t async_code, struct cam_path *path,
|
||||
|
@ -1754,7 +1754,7 @@ hint.ata.1.irq="15"
|
||||
# atapifd, atapist, atapicam) and all user-level APIs.
|
||||
# cam(4) drivers and APIs will be connected instead.
|
||||
|
||||
#options ATA_STATIC_ID
|
||||
options ATA_STATIC_ID
|
||||
#options ATA_REQUEST_TIMEOUT=10
|
||||
options ATA_CAM
|
||||
|
||||
|
@ -113,8 +113,9 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
|
||||
{
|
||||
struct g_geom *gp;
|
||||
struct g_consumer *cp;
|
||||
int error;
|
||||
struct cdev *dev;
|
||||
int error, len;
|
||||
struct cdev *dev, *adev;
|
||||
char buf[64], *val;
|
||||
|
||||
g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
|
||||
g_topology_assert();
|
||||
@ -136,12 +137,35 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
|
||||
g_destroy_geom(gp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search for device alias name and create it if found. */
|
||||
adev = NULL;
|
||||
for (len = MIN(strlen(gp->name), sizeof(buf) - 15); len > 0; len--) {
|
||||
snprintf(buf, sizeof(buf), "kern.devalias.%s", gp->name);
|
||||
buf[14 + len] = 0;
|
||||
val = getenv(buf);
|
||||
if (val != NULL) {
|
||||
snprintf(buf, sizeof(buf), "%s%s",
|
||||
val, gp->name + len);
|
||||
freeenv(val);
|
||||
adev = make_dev_alias(dev, buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pp->flags & G_PF_CANDELETE)
|
||||
dev->si_flags |= SI_CANDELETE;
|
||||
dev->si_iosize_max = MAXPHYS;
|
||||
gp->softc = dev;
|
||||
dev->si_drv1 = gp;
|
||||
dev->si_drv2 = cp;
|
||||
if (adev != NULL) {
|
||||
if (pp->flags & G_PF_CANDELETE)
|
||||
adev->si_flags |= SI_CANDELETE;
|
||||
adev->si_iosize_max = MAXPHYS;
|
||||
adev->si_drv1 = gp;
|
||||
adev->si_drv2 = cp;
|
||||
}
|
||||
return (gp);
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ device fdc
|
||||
device ahci # AHCI-compatible SATA controllers
|
||||
device ata # Legacy ATA/SATA controllers
|
||||
options ATA_CAM # Handle legacy controllers with CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
|
||||
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
|
||||
|
||||
|
@ -52,6 +52,7 @@ device pci
|
||||
# ATA and ATAPI devices
|
||||
device ata
|
||||
options ATA_CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
||||
# ATA/SCSI peripherals
|
||||
device scbus # SCSI bus (required for ATA/SCSI)
|
||||
|
@ -99,6 +99,7 @@ device pci
|
||||
device ahci # AHCI-compatible SATA controllers
|
||||
device ata # Legacy ATA/SATA controllers
|
||||
options ATA_CAM # Handle legacy controllers with CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
|
||||
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
|
||||
|
||||
|
@ -58,3 +58,4 @@ device pass
|
||||
|
||||
device ata
|
||||
options ATA_CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
|
@ -9,6 +9,7 @@ KMOD= cam
|
||||
# See sys/conf/options for the flags that go into the different opt_*.h files.
|
||||
SRCS= opt_cam.h
|
||||
SRCS+= opt_ada.h
|
||||
SRCS+= opt_ata.h
|
||||
SRCS+= opt_scsi.h
|
||||
SRCS+= opt_cd.h
|
||||
SRCS+= opt_pt.h
|
||||
|
@ -91,6 +91,7 @@ device fdc
|
||||
device ahci # AHCI-compatible SATA controllers
|
||||
device ata # Legacy ATA/SATA controllers
|
||||
options ATA_CAM # Handle legacy controllers with CAM
|
||||
options ATA_STATIC_ID # Static device numbering
|
||||
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
|
||||
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user