* [PATCH] libata: fix SCSI/ATA device association during hotplug
@ 2006-11-20 9:25 Tejun Heo
2006-11-28 9:07 ` Jeff Garzik
2006-11-28 14:12 ` Mark Lord
0 siblings, 2 replies; 7+ messages in thread
From: Tejun Heo @ 2006-11-20 9:25 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
Two subtle hotplug related bugs are found.
* SCSI didn't use to issue commands to devices in SDEV_CANCEL state
but now it does. For ATA devices, it means that SYNCHRONIZE_CACHE
is issued even after libata tells SCSI midlayer that the SCSI device
is offline now. When devices are swapped, SYNCHRONIZE_CACHE for the
previous device can be issued to the later device.
* Devices can be swapped while SCSI probing is in progress. SCSI
device used to get associated with ATA device only after probing is
complete, which means that SCSI device detaching is not performed
while probing. This can result in mismatch between SCSI device and
ATA device (e.g. sd attached to ATAPI device) if devices are
swapped after INQUIRY but before probing is complete.
This patch makes libata associate new SCSI device with ATA device
before INQUIRY is issued and check whether SCSI device issuing a
command matches dev->sdev on each command. Both bugs are fixed by
this tighter coupling between SCSI device and ATA device.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-scsi.c | 51 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 39 insertions(+), 12 deletions(-)
Index: work/drivers/ata/libata-scsi.c
===================================================================
--- work.orig/drivers/ata/libata-scsi.c
+++ work/drivers/ata/libata-scsi.c
@@ -54,9 +54,9 @@
typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd);
static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev);
+ struct scsi_device *scsidev);
static struct ata_device * ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev);
+ struct scsi_device *scsidev);
static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
unsigned int id, unsigned int lun);
@@ -877,7 +877,7 @@ void ata_scsi_slave_destroy(struct scsi_
spin_lock_irqsave(ap->lock, flags);
dev = __ata_scsi_find_dev(ap, sdev);
- if (dev && dev->sdev) {
+ if (dev) {
/* SCSI device already in CANCEL state, no need to offline it */
dev->sdev = NULL;
dev->flags |= ATA_DFLAG_DETACH;
@@ -2509,13 +2509,29 @@ static struct ata_device * ata_find_dev(
}
static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev)
+ struct scsi_device *scsidev)
{
+ struct ata_device *dev;
+
/* skip commands not addressed to targets we simulate */
if (unlikely(scsidev->channel || scsidev->lun))
return NULL;
- return ata_find_dev(ap, scsidev->id);
+ dev = ata_find_dev(ap, scsidev->id);
+
+ if (likely(dev && dev->sdev == scsidev))
+ return dev;
+
+ /* if the ATA device is avialable and SCSI device is looking
+ * for partner, match them. For details, read comment in
+ * ata_scsi_scan_host().
+ */
+ if (dev && !dev->sdev && scsidev->sdev_state == SDEV_CREATED)
+ dev->sdev = scsidev;
+ else
+ dev = NULL;
+
+ return dev;
}
/**
@@ -2565,7 +2581,7 @@ static int ata_scsi_dev_enabled(struct a
* Associated ATA device, or %NULL if not found.
*/
static struct ata_device *
-ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
+ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev)
{
struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);
@@ -2964,16 +2980,27 @@ void ata_scsi_scan_host(struct ata_port
for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i];
- struct scsi_device *sdev;
if (!ata_dev_enabled(dev) || dev->sdev)
continue;
- sdev = __scsi_add_device(ap->scsi_host, 0, i, 0, NULL);
- if (!IS_ERR(sdev)) {
- dev->sdev = sdev;
- scsi_device_put(sdev);
- }
+ /* Try to attach new SCSI device. SCSI midlayer
+ * doesn't supply separate interfaces for allocating
+ * and probing, so in this function, we can associate
+ * new SCSI device with its target ATA device only
+ * after probing is complete.
+ *
+ * However, hotplug event may occur during probing and
+ * we might have to detach a SCSI device which is in
+ * the middle of probing. So, we need to associate
+ * new SCSI device with its target ATA device before
+ * the first INQUIRY is complete.
+ *
+ * This is achieved by automatically associating sdev
+ * in SDEV_CREATED state with NULL dev->sdev in
+ * __ata_scsi_find_dev().
+ */
+ scsi_add_device(ap->scsi_host, 0, i, 0);
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] libata: fix SCSI/ATA device association during hotplug
2006-11-20 9:25 [PATCH] libata: fix SCSI/ATA device association during hotplug Tejun Heo
@ 2006-11-28 9:07 ` Jeff Garzik
2006-11-28 14:12 ` Mark Lord
1 sibling, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2006-11-28 9:07 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
Tejun Heo wrote:
> Two subtle hotplug related bugs are found.
>
> * SCSI didn't use to issue commands to devices in SDEV_CANCEL state
> but now it does. For ATA devices, it means that SYNCHRONIZE_CACHE
> is issued even after libata tells SCSI midlayer that the SCSI device
> is offline now. When devices are swapped, SYNCHRONIZE_CACHE for the
> previous device can be issued to the later device.
>
> * Devices can be swapped while SCSI probing is in progress. SCSI
> device used to get associated with ATA device only after probing is
> complete, which means that SCSI device detaching is not performed
> while probing. This can result in mismatch between SCSI device and
> ATA device (e.g. sd attached to ATAPI device) if devices are
> swapped after INQUIRY but before probing is complete.
>
> This patch makes libata associate new SCSI device with ATA device
> before INQUIRY is issued and check whether SCSI device issuing a
> command matches dev->sdev on each command. Both bugs are fixed by
> this tighter coupling between SCSI device and ATA device.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
ACK
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] libata: fix SCSI/ATA device association during hotplug
2006-11-20 9:25 [PATCH] libata: fix SCSI/ATA device association during hotplug Tejun Heo
2006-11-28 9:07 ` Jeff Garzik
@ 2006-11-28 14:12 ` Mark Lord
2006-11-28 17:14 ` Tejun Heo
1 sibling, 1 reply; 7+ messages in thread
From: Mark Lord @ 2006-11-28 14:12 UTC (permalink / raw)
To: Tejun Heo; +Cc: Jeff Garzik, linux-ide
Tejun Heo wrote:
..
> + /* Try to attach new SCSI device. SCSI midlayer
> + * doesn't supply separate interfaces for allocating
> + * and probing, so in this function, we can associate
> + * new SCSI device with its target ATA device only
> + * after probing is complete.
..
I'm not necessarily disagreeing with the code, but rather that comment.
Mmm.. isn't slave_alloc() for allocating? It gets invoked before
the INQUIRY, and then slave_configure() is invoked after a successful
device INQUIRY (otherwise slave_destroy() is invoked to clean up).
??
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] libata: fix SCSI/ATA device association during hotplug
2006-11-28 14:12 ` Mark Lord
@ 2006-11-28 17:14 ` Tejun Heo
2006-12-12 4:24 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Tejun Heo
0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2006-11-28 17:14 UTC (permalink / raw)
To: Mark Lord; +Cc: Jeff Garzik, linux-ide
Mark Lord wrote:
> Tejun Heo wrote:
> ..
>> + /* Try to attach new SCSI device. SCSI midlayer
>> + * doesn't supply separate interfaces for allocating
>> + * and probing, so in this function, we can associate
>> + * new SCSI device with its target ATA device only
>> + * after probing is complete.
> ..
>
> I'm not necessarily disagreeing with the code, but rather that comment.
>
> Mmm.. isn't slave_alloc() for allocating? It gets invoked before
> the INQUIRY, and then slave_configure() is invoked after a successful
> device INQUIRY (otherwise slave_destroy() is invoked to clean up).
Yeah, right. That will be the perfect place to attach ATA device.
Thanks for pointing out. I'll redo this patch.
--
tejun
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2
2006-11-28 17:14 ` Tejun Heo
@ 2006-12-12 4:24 ` Tejun Heo
2006-12-12 4:29 ` [PATCH] libata: use ata_scsi_find_dev() in ata_scsi_slave_config() Tejun Heo
2007-03-02 23:44 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Jeff Garzik
0 siblings, 2 replies; 7+ messages in thread
From: Tejun Heo @ 2006-12-12 4:24 UTC (permalink / raw)
To: Mark Lord; +Cc: Jeff Garzik, linux-ide
Two subtle hotplug related bugs are found.
* SCSI didn't use to issue commands to devices in SDEV_CANCEL state
but now it does. For ATA devices, it means that SYNCHRONIZE_CACHE
is issued even after libata tells SCSI midlayer that the SCSI device
is offline now. When devices are swapped, SYNCHRONIZE_CACHE for the
previous device can be issued to the later device.
* Devices can be swapped while SCSI probing is in progress. SCSI
device used to get associated with ATA device only after probing is
complete, which means that SCSI device detaching is not performed
while probing. This can result in mismatch between SCSI device and
ATA device (e.g. sd attached to ATAPI device) if devices are
swapped after INQUIRY but before probing is complete.
This patch makes libata associate new SCSI device with ATA device
before INQUIRY is issued and check whether SCSI device issuing a
command matches dev->sdev on each command. Both bugs are fixed by
this tighter coupling between SCSI device and ATA device.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
---
scsi_dev <-> ata_dev association is moved to ->slave_alloc as Mark
suggested.
drivers/ata/ahci.c | 1
drivers/ata/ata_generic.c | 1
drivers/ata/ata_piix.c | 1
drivers/ata/libata-core.c | 1
drivers/ata/libata-scsi.c | 71 +++++++++++++++++++++++++++++++++-------
drivers/ata/pata_ali.c | 1
drivers/ata/pata_amd.c | 1
drivers/ata/pata_artop.c | 1
drivers/ata/pata_atiixp.c | 1
drivers/ata/pata_cmd64x.c | 1
drivers/ata/pata_cs5520.c | 1
drivers/ata/pata_cs5530.c | 1
drivers/ata/pata_cs5535.c | 1
drivers/ata/pata_cypress.c | 1
drivers/ata/pata_efar.c | 1
drivers/ata/pata_hpt366.c | 1
drivers/ata/pata_hpt37x.c | 1
drivers/ata/pata_hpt3x2n.c | 1
drivers/ata/pata_hpt3x3.c | 1
drivers/ata/pata_isapnp.c | 1
drivers/ata/pata_it821x.c | 1
drivers/ata/pata_ixp4xx_cf.c | 1
drivers/ata/pata_jmicron.c | 1
drivers/ata/pata_legacy.c | 1
drivers/ata/pata_marvell.c | 1
drivers/ata/pata_mpiix.c | 1
drivers/ata/pata_netcell.c | 1
drivers/ata/pata_ns87410.c | 1
drivers/ata/pata_oldpiix.c | 1
drivers/ata/pata_opti.c | 1
drivers/ata/pata_optidma.c | 1
drivers/ata/pata_pcmcia.c | 1
drivers/ata/pata_pdc2027x.c | 1
drivers/ata/pata_pdc202xx_old.c | 1
drivers/ata/pata_platform.c | 1
drivers/ata/pata_qdi.c | 1
drivers/ata/pata_radisys.c | 1
drivers/ata/pata_rz1000.c | 1
drivers/ata/pata_sc1200.c | 1
drivers/ata/pata_serverworks.c | 1
drivers/ata/pata_sil680.c | 1
drivers/ata/pata_sis.c | 1
drivers/ata/pata_sl82c105.c | 1
drivers/ata/pata_triflex.c | 1
drivers/ata/pata_via.c | 1
drivers/ata/pata_winbond.c | 1
drivers/ata/pdc_adma.c | 1
drivers/ata/sata_mv.c | 1
drivers/ata/sata_nv.c | 1
drivers/ata/sata_promise.c | 1
drivers/ata/sata_qstor.c | 1
drivers/ata/sata_sil.c | 1
drivers/ata/sata_sil24.c | 1
drivers/ata/sata_sis.c | 1
drivers/ata/sata_svw.c | 1
drivers/ata/sata_sx4.c | 1
drivers/ata/sata_uli.c | 1
drivers/ata/sata_via.c | 1
drivers/ata/sata_vsc.c | 1
include/linux/libata.h | 1
60 files changed, 118 insertions(+), 12 deletions(-)
Index: work/drivers/ata/ahci.c
===================================================================
--- work.orig/drivers/ata/ahci.c
+++ work/drivers/ata/ahci.c
@@ -240,6 +240,7 @@ static struct scsi_host_template ahci_sh
.use_clustering = AHCI_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = AHCI_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/ata_generic.c
===================================================================
--- work.orig/drivers/ata/ata_generic.c
+++ work/drivers/ata/ata_generic.c
@@ -114,6 +114,7 @@ static struct scsi_host_template generic
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/ata_piix.c
===================================================================
--- work.orig/drivers/ata/ata_piix.c
+++ work/drivers/ata/ata_piix.c
@@ -260,6 +260,7 @@ static struct scsi_host_template piix_sh
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/libata-core.c
===================================================================
--- work.orig/drivers/ata/libata-core.c
+++ work/drivers/ata/libata-core.c
@@ -6446,6 +6446,7 @@ EXPORT_SYMBOL_GPL(ata_busy_sleep);
EXPORT_SYMBOL_GPL(ata_port_queue_task);
EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
+EXPORT_SYMBOL_GPL(ata_scsi_slave_alloc);
EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
EXPORT_SYMBOL_GPL(ata_scsi_slave_destroy);
EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
Index: work/drivers/ata/libata-scsi.c
===================================================================
--- work.orig/drivers/ata/libata-scsi.c
+++ work/drivers/ata/libata-scsi.c
@@ -53,10 +53,11 @@
typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd);
+static struct ata_device * ata_find_dev(struct ata_port *ap, int id);
static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev);
+ struct scsi_device *scsidev);
static struct ata_device * ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev);
+ struct scsi_device *scsidev);
static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
unsigned int id, unsigned int lun);
@@ -826,6 +827,33 @@ static void ata_scsi_dev_config(struct s
}
/**
+ * ata_scsi_slave_alloc - Associate new SCSI device with ATA device
+ * @sdev: SCSI device to examine
+ *
+ * This is called right after a sdev is allocated. Associate it
+ * with respective ATA device.
+ *
+ * LOCKING:
+ * Defined by SCSI layer. We don't really care.
+ */
+int ata_scsi_slave_alloc(struct scsi_device *sdev)
+{
+ struct ata_port *ap = ata_shost_to_port(sdev->host);
+ struct ata_device *dev;
+
+ /* this shouldn't happen, make SCSI complain */
+ if (sdev->channel || sdev->lun)
+ return -EINVAL;
+
+ dev = ata_find_dev(ap, sdev->id);
+ if (dev->sdev != NULL)
+ return -EBUSY;
+ dev->sdev = sdev;
+
+ return 0;
+}
+
+/**
* ata_scsi_slave_config - Set SCSI device attributes
* @sdev: SCSI device to examine
*
@@ -877,7 +905,7 @@ void ata_scsi_slave_destroy(struct scsi_
spin_lock_irqsave(ap->lock, flags);
dev = __ata_scsi_find_dev(ap, sdev);
- if (dev && dev->sdev) {
+ if (dev) {
/* SCSI device already in CANCEL state, no need to offline it */
dev->sdev = NULL;
dev->flags |= ATA_DFLAG_DETACH;
@@ -2410,13 +2438,22 @@ static struct ata_device * ata_find_dev(
}
static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap,
- const struct scsi_device *scsidev)
+ struct scsi_device *scsidev)
{
+ struct ata_device *dev;
+
/* skip commands not addressed to targets we simulate */
if (unlikely(scsidev->channel || scsidev->lun))
return NULL;
- return ata_find_dev(ap, scsidev->id);
+ dev = ata_find_dev(ap, scsidev->id);
+
+ /* SCSI issues commands to off-line devices. Make sure we're
+ * looking at the right device.
+ */
+ if (likely(dev && dev->sdev == scsidev))
+ return dev;
+ return NULL;
}
/**
@@ -2466,7 +2503,7 @@ static int ata_scsi_dev_enabled(struct a
* Associated ATA device, or %NULL if not found.
*/
static struct ata_device *
-ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
+ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev)
{
struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);
@@ -2865,16 +2902,26 @@ void ata_scsi_scan_host(struct ata_port
for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i];
- struct scsi_device *sdev;
if (!ata_dev_enabled(dev) || dev->sdev)
continue;
- sdev = __scsi_add_device(ap->scsi_host, 0, i, 0, NULL);
- if (!IS_ERR(sdev)) {
- dev->sdev = sdev;
- scsi_device_put(sdev);
- }
+ /* Try to attach new SCSI device. SCSI midlayer
+ * doesn't supply separate interfaces for allocating
+ * and probing, so in this function, we can associate
+ * new SCSI device with its target ATA device only
+ * after probing is complete.
+ *
+ * However, hotplug event may occur during probing and
+ * we might have to detach a SCSI device which is in
+ * the middle of probing. So, we need to associate
+ * new SCSI device with its target ATA device before
+ * the first INQUIRY is complete.
+ *
+ * This is achieved by attaching the device in
+ * ->slave_alloc().
+ */
+ scsi_add_device(ap->scsi_host, 0, i, 0);
}
}
Index: work/drivers/ata/pata_ali.c
===================================================================
--- work.orig/drivers/ata/pata_ali.c
+++ work/drivers/ata/pata_ali.c
@@ -342,6 +342,7 @@ static struct scsi_host_template ali_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_amd.c
===================================================================
--- work.orig/drivers/ata/pata_amd.c
+++ work/drivers/ata/pata_amd.c
@@ -331,6 +331,7 @@ static struct scsi_host_template amd_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_artop.c
===================================================================
--- work.orig/drivers/ata/pata_artop.c
+++ work/drivers/ata/pata_artop.c
@@ -312,6 +312,7 @@ static struct scsi_host_template artop_s
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_atiixp.c
===================================================================
--- work.orig/drivers/ata/pata_atiixp.c
+++ work/drivers/ata/pata_atiixp.c
@@ -214,6 +214,7 @@ static struct scsi_host_template atiixp_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_cmd64x.c
===================================================================
--- work.orig/drivers/ata/pata_cmd64x.c
+++ work/drivers/ata/pata_cmd64x.c
@@ -273,6 +273,7 @@ static struct scsi_host_template cmd64x_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_cs5520.c
===================================================================
--- work.orig/drivers/ata/pata_cs5520.c
+++ work/drivers/ata/pata_cs5520.c
@@ -164,6 +164,7 @@ static struct scsi_host_template cs5520_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_cs5530.c
===================================================================
--- work.orig/drivers/ata/pata_cs5530.c
+++ work/drivers/ata/pata_cs5530.c
@@ -178,6 +178,7 @@ static struct scsi_host_template cs5530_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_cs5535.c
===================================================================
--- work.orig/drivers/ata/pata_cs5535.c
+++ work/drivers/ata/pata_cs5535.c
@@ -182,6 +182,7 @@ static struct scsi_host_template cs5535_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_cypress.c
===================================================================
--- work.orig/drivers/ata/pata_cypress.c
+++ work/drivers/ata/pata_cypress.c
@@ -133,6 +133,7 @@ static struct scsi_host_template cy82c69
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_efar.c
===================================================================
--- work.orig/drivers/ata/pata_efar.c
+++ work/drivers/ata/pata_efar.c
@@ -231,6 +231,7 @@ static struct scsi_host_template efar_sh
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_hpt366.c
===================================================================
--- work.orig/drivers/ata/pata_hpt366.c
+++ work/drivers/ata/pata_hpt366.c
@@ -335,6 +335,7 @@ static struct scsi_host_template hpt36x_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_hpt37x.c
===================================================================
--- work.orig/drivers/ata/pata_hpt37x.c
+++ work/drivers/ata/pata_hpt37x.c
@@ -773,6 +773,7 @@ static struct scsi_host_template hpt37x_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_hpt3x2n.c
===================================================================
--- work.orig/drivers/ata/pata_hpt3x2n.c
+++ work/drivers/ata/pata_hpt3x2n.c
@@ -339,6 +339,7 @@ static struct scsi_host_template hpt3x2n
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_hpt3x3.c
===================================================================
--- work.orig/drivers/ata/pata_hpt3x3.c
+++ work/drivers/ata/pata_hpt3x3.c
@@ -116,6 +116,7 @@ static struct scsi_host_template hpt3x3_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_isapnp.c
===================================================================
--- work.orig/drivers/ata/pata_isapnp.c
+++ work/drivers/ata/pata_isapnp.c
@@ -32,6 +32,7 @@ static struct scsi_host_template isapnp_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_it821x.c
===================================================================
--- work.orig/drivers/ata/pata_it821x.c
+++ work/drivers/ata/pata_it821x.c
@@ -671,6 +671,7 @@ static struct scsi_host_template it821x_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_ixp4xx_cf.c
===================================================================
--- work.orig/drivers/ata/pata_ixp4xx_cf.c
+++ work/drivers/ata/pata_ixp4xx_cf.c
@@ -115,6 +115,7 @@ static struct scsi_host_template ixp4xx_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_jmicron.c
===================================================================
--- work.orig/drivers/ata/pata_jmicron.c
+++ work/drivers/ata/pata_jmicron.c
@@ -133,6 +133,7 @@ static struct scsi_host_template jmicron
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
/* Use standard CHS mapping rules */
Index: work/drivers/ata/pata_legacy.c
===================================================================
--- work.orig/drivers/ata/pata_legacy.c
+++ work/drivers/ata/pata_legacy.c
@@ -133,6 +133,7 @@ static struct scsi_host_template legacy_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_marvell.c
===================================================================
--- work.orig/drivers/ata/pata_marvell.c
+++ work/drivers/ata/pata_marvell.c
@@ -99,6 +99,7 @@ static struct scsi_host_template marvell
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
/* Use standard CHS mapping rules */
Index: work/drivers/ata/pata_mpiix.c
===================================================================
--- work.orig/drivers/ata/pata_mpiix.c
+++ work/drivers/ata/pata_mpiix.c
@@ -164,6 +164,7 @@ static struct scsi_host_template mpiix_s
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_netcell.c
===================================================================
--- work.orig/drivers/ata/pata_netcell.c
+++ work/drivers/ata/pata_netcell.c
@@ -59,6 +59,7 @@ static struct scsi_host_template netcell
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
/* Use standard CHS mapping rules */
Index: work/drivers/ata/pata_ns87410.c
===================================================================
--- work.orig/drivers/ata/pata_ns87410.c
+++ work/drivers/ata/pata_ns87410.c
@@ -154,6 +154,7 @@ static struct scsi_host_template ns87410
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_oldpiix.c
===================================================================
--- work.orig/drivers/ata/pata_oldpiix.c
+++ work/drivers/ata/pata_oldpiix.c
@@ -229,6 +229,7 @@ static struct scsi_host_template oldpiix
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_opti.c
===================================================================
--- work.orig/drivers/ata/pata_opti.c
+++ work/drivers/ata/pata_opti.c
@@ -176,6 +176,7 @@ static struct scsi_host_template opti_sh
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_optidma.c
===================================================================
--- work.orig/drivers/ata/pata_optidma.c
+++ work/drivers/ata/pata_optidma.c
@@ -357,6 +357,7 @@ static struct scsi_host_template optidma
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_pcmcia.c
===================================================================
--- work.orig/drivers/ata/pata_pcmcia.c
+++ work/drivers/ata/pata_pcmcia.c
@@ -67,6 +67,7 @@ static struct scsi_host_template pcmcia_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_pdc2027x.c
===================================================================
--- work.orig/drivers/ata/pata_pdc2027x.c
+++ work/drivers/ata/pata_pdc2027x.c
@@ -139,6 +139,7 @@ static struct scsi_host_template pdc2027
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_pdc202xx_old.c
===================================================================
--- work.orig/drivers/ata/pata_pdc202xx_old.c
+++ work/drivers/ata/pata_pdc202xx_old.c
@@ -267,6 +267,7 @@ static struct scsi_host_template pdc202x
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_platform.c
===================================================================
--- work.orig/drivers/ata/pata_platform.c
+++ work/drivers/ata/pata_platform.c
@@ -76,6 +76,7 @@ static struct scsi_host_template pata_pl
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_qdi.c
===================================================================
--- work.orig/drivers/ata/pata_qdi.c
+++ work/drivers/ata/pata_qdi.c
@@ -162,6 +162,7 @@ static struct scsi_host_template qdi_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_radisys.c
===================================================================
--- work.orig/drivers/ata/pata_radisys.c
+++ work/drivers/ata/pata_radisys.c
@@ -225,6 +225,7 @@ static struct scsi_host_template radisys
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_rz1000.c
===================================================================
--- work.orig/drivers/ata/pata_rz1000.c
+++ work/drivers/ata/pata_rz1000.c
@@ -88,6 +88,7 @@ static struct scsi_host_template rz1000_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_sc1200.c
===================================================================
--- work.orig/drivers/ata/pata_sc1200.c
+++ work/drivers/ata/pata_sc1200.c
@@ -191,6 +191,7 @@ static struct scsi_host_template sc1200_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_serverworks.c
===================================================================
--- work.orig/drivers/ata/pata_serverworks.c
+++ work/drivers/ata/pata_serverworks.c
@@ -323,6 +323,7 @@ static struct scsi_host_template serverw
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_sil680.c
===================================================================
--- work.orig/drivers/ata/pata_sil680.c
+++ work/drivers/ata/pata_sil680.c
@@ -223,6 +223,7 @@ static struct scsi_host_template sil680_
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_sis.c
===================================================================
--- work.orig/drivers/ata/pata_sis.c
+++ work/drivers/ata/pata_sis.c
@@ -543,6 +543,7 @@ static struct scsi_host_template sis_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_sl82c105.c
===================================================================
--- work.orig/drivers/ata/pata_sl82c105.c
+++ work/drivers/ata/pata_sl82c105.c
@@ -235,6 +235,7 @@ static struct scsi_host_template sl82c10
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_triflex.c
===================================================================
--- work.orig/drivers/ata/pata_triflex.c
+++ work/drivers/ata/pata_triflex.c
@@ -190,6 +190,7 @@ static struct scsi_host_template triflex
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_via.c
===================================================================
--- work.orig/drivers/ata/pata_via.c
+++ work/drivers/ata/pata_via.c
@@ -295,6 +295,7 @@ static struct scsi_host_template via_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pata_winbond.c
===================================================================
--- work.orig/drivers/ata/pata_winbond.c
+++ work/drivers/ata/pata_winbond.c
@@ -131,6 +131,7 @@ static struct scsi_host_template winbond
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/pdc_adma.c
===================================================================
--- work.orig/drivers/ata/pdc_adma.c
+++ work/drivers/ata/pdc_adma.c
@@ -150,6 +150,7 @@ static struct scsi_host_template adma_at
.use_clustering = ENABLE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ADMA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_mv.c
===================================================================
--- work.orig/drivers/ata/sata_mv.c
+++ work/drivers/ata/sata_mv.c
@@ -388,6 +388,7 @@ static struct scsi_host_template mv_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = MV_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_nv.c
===================================================================
--- work.orig/drivers/ata/sata_nv.c
+++ work/drivers/ata/sata_nv.c
@@ -308,6 +308,7 @@ static struct scsi_host_template nv_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_promise.c
===================================================================
--- work.orig/drivers/ata/sata_promise.c
+++ work/drivers/ata/sata_promise.c
@@ -127,6 +127,7 @@ static struct scsi_host_template pdc_ata
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_qstor.c
===================================================================
--- work.orig/drivers/ata/sata_qstor.c
+++ work/drivers/ata/sata_qstor.c
@@ -141,6 +141,7 @@ static struct scsi_host_template qs_ata_
.use_clustering = ENABLE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = QS_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_sil.c
===================================================================
--- work.orig/drivers/ata/sata_sil.c
+++ work/drivers/ata/sata_sil.c
@@ -178,6 +178,7 @@ static struct scsi_host_template sil_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_sil24.c
===================================================================
--- work.orig/drivers/ata/sata_sil24.c
+++ work/drivers/ata/sata_sil24.c
@@ -383,6 +383,7 @@ static struct scsi_host_template sil24_s
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_sis.c
===================================================================
--- work.orig/drivers/ata/sata_sis.c
+++ work/drivers/ata/sata_sis.c
@@ -94,6 +94,7 @@ static struct scsi_host_template sis_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_svw.c
===================================================================
--- work.orig/drivers/ata/sata_svw.c
+++ work/drivers/ata/sata_svw.c
@@ -297,6 +297,7 @@ static struct scsi_host_template k2_sata
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
#ifdef CONFIG_PPC_OF
Index: work/drivers/ata/sata_sx4.c
===================================================================
--- work.orig/drivers/ata/sata_sx4.c
+++ work/drivers/ata/sata_sx4.c
@@ -190,6 +190,7 @@ static struct scsi_host_template pdc_sat
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_uli.c
===================================================================
--- work.orig/drivers/ata/sata_uli.c
+++ work/drivers/ata/sata_uli.c
@@ -88,6 +88,7 @@ static struct scsi_host_template uli_sht
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_via.c
===================================================================
--- work.orig/drivers/ata/sata_via.c
+++ work/drivers/ata/sata_via.c
@@ -104,6 +104,7 @@ static struct scsi_host_template svia_sh
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/drivers/ata/sata_vsc.c
===================================================================
--- work.orig/drivers/ata/sata_vsc.c
+++ work/drivers/ata/sata_vsc.c
@@ -277,6 +277,7 @@ static struct scsi_host_template vsc_sat
.use_clustering = ATA_SHT_USE_CLUSTERING,
.proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY,
+ .slave_alloc = ata_scsi_slave_alloc,
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
Index: work/include/linux/libata.h
===================================================================
--- work.orig/include/linux/libata.h
+++ work/include/linux/libata.h
@@ -820,6 +820,7 @@ extern void ata_scsi_simulate(struct ata
extern int ata_std_bios_param(struct scsi_device *sdev,
struct block_device *bdev,
sector_t capacity, int geom[]);
+extern int ata_scsi_slave_alloc(struct scsi_device *sdev);
extern int ata_scsi_slave_config(struct scsi_device *sdev);
extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] libata: use ata_scsi_find_dev() in ata_scsi_slave_config()
2006-12-12 4:24 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Tejun Heo
@ 2006-12-12 4:29 ` Tejun Heo
2007-03-02 23:44 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Jeff Garzik
1 sibling, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2006-12-12 4:29 UTC (permalink / raw)
To: Mark Lord; +Cc: Jeff Garzik, linux-ide
It is wrong to configure SCSI device according to disabled ATA device.
Use regular ata_scsi_find_dev() instead of the underbarred version in
ata_scsi_slave_config().
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: work/drivers/ata/libata-scsi.c
===================================================================
--- work.orig/drivers/ata/libata-scsi.c
+++ work/drivers/ata/libata-scsi.c
@@ -868,7 +868,7 @@ int ata_scsi_slave_alloc(struct scsi_dev
int ata_scsi_slave_config(struct scsi_device *sdev)
{
struct ata_port *ap = ata_shost_to_port(sdev->host);
- struct ata_device *dev = __ata_scsi_find_dev(ap, sdev);
+ struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
ata_scsi_sdev_config(sdev);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2
2006-12-12 4:24 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Tejun Heo
2006-12-12 4:29 ` [PATCH] libata: use ata_scsi_find_dev() in ata_scsi_slave_config() Tejun Heo
@ 2007-03-02 23:44 ` Jeff Garzik
1 sibling, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2007-03-02 23:44 UTC (permalink / raw)
To: Tejun Heo; +Cc: Mark Lord, Jeff Garzik, linux-ide
Tejun Heo wrote:
> Two subtle hotplug related bugs are found.
>
> * SCSI didn't use to issue commands to devices in SDEV_CANCEL state
> but now it does. For ATA devices, it means that SYNCHRONIZE_CACHE
> is issued even after libata tells SCSI midlayer that the SCSI device
> is offline now. When devices are swapped, SYNCHRONIZE_CACHE for the
> previous device can be issued to the later device.
>
> * Devices can be swapped while SCSI probing is in progress. SCSI
> device used to get associated with ATA device only after probing is
> complete, which means that SCSI device detaching is not performed
> while probing. This can result in mismatch between SCSI device and
> ATA device (e.g. sd attached to ATAPI device) if devices are
> swapped after INQUIRY but before probing is complete.
>
> This patch makes libata associate new SCSI device with ATA device
> before INQUIRY is issued and check whether SCSI device issuing a
> command matches dev->sdev on each command. Both bugs are fixed by
> this tighter coupling between SCSI device and ATA device.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> Cc: Mark Lord <liml@rtr.ca>
> ---
>
> scsi_dev <-> ata_dev association is moved to ->slave_alloc as Mark
> suggested.
[...]
> + /* Try to attach new SCSI device. SCSI midlayer
> + * doesn't supply separate interfaces for allocating
> + * and probing, so in this function, we can associate
> + * new SCSI device with its target ATA device only
> + * after probing is complete.
> + *
> + * However, hotplug event may occur during probing and
> + * we might have to detach a SCSI device which is in
> + * the middle of probing. So, we need to associate
> + * new SCSI device with its target ATA device before
> + * the first INQUIRY is complete.
> + *
> + * This is achieved by attaching the device in
> + * ->slave_alloc().
> + */
> + scsi_add_device(ap->scsi_host, 0, i, 0);
ACK
The above quoted comment serves to reinforce that libata eventually
needs to have an ATA transport class
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-03-02 23:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-20 9:25 [PATCH] libata: fix SCSI/ATA device association during hotplug Tejun Heo
2006-11-28 9:07 ` Jeff Garzik
2006-11-28 14:12 ` Mark Lord
2006-11-28 17:14 ` Tejun Heo
2006-12-12 4:24 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Tejun Heo
2006-12-12 4:29 ` [PATCH] libata: use ata_scsi_find_dev() in ata_scsi_slave_config() Tejun Heo
2007-03-02 23:44 ` [PATCH] libata: fix SCSI/ATA device association during hotplug, take 2 Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).