提交 a69ac324 编写于 作者: M Moore, Eric 提交者: James Bottomley

[SCSI] fusion: unloading the driver - only set asyn narrow for configured devices

This patch inhibits sending spi negotiation parameters
for non-configured devices from the slave_destroy function.
Signed-off-by: NEric Moore <Eric.Moore@lsil.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 335a9412
...@@ -158,7 +158,7 @@ static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); ...@@ -158,7 +158,7 @@ static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus);
int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
static void mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice); static void mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice);
static void mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget); static void mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice);
static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id); static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
...@@ -2308,7 +2308,7 @@ mptscsih_slave_destroy(struct scsi_device *sdev) ...@@ -2308,7 +2308,7 @@ mptscsih_slave_destroy(struct scsi_device *sdev)
vtarget->luns[0] &= ~(1 << vdevice->lun); vtarget->luns[0] &= ~(1 << vdevice->lun);
vtarget->num_luns--; vtarget->num_luns--;
if (vtarget->num_luns == 0) { if (vtarget->num_luns == 0) {
mptscsih_negotiate_to_asyn_narrow(hd, vtarget); mptscsih_negotiate_to_asyn_narrow(hd, vdevice);
if (hd->ioc->bus_type == SPI) { if (hd->ioc->bus_type == SPI) {
if (mptscsih_is_phys_disk(hd->ioc, vtarget->target_id)) { if (mptscsih_is_phys_disk(hd->ioc, vtarget->target_id)) {
hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3;
...@@ -3899,8 +3899,9 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) ...@@ -3899,8 +3899,9 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
* *
*/ */
static void static void
mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
{ {
VirtTarget *vtarget = vdevice->vtarget;
MPT_ADAPTER *ioc= hd->ioc; MPT_ADAPTER *ioc= hd->ioc;
SCSIDevicePage1_t *pcfg1Data; SCSIDevicePage1_t *pcfg1Data;
CONFIGPARMS cfg; CONFIGPARMS cfg;
...@@ -3910,7 +3911,8 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) ...@@ -3910,7 +3911,8 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget)
int requested, configuration, data,i; int requested, configuration, data,i;
u8 flags, factor; u8 flags, factor;
if (ioc->bus_type != SPI) if ((ioc->bus_type != SPI) ||
(!vdevice->configured_lun))
return; return;
if (!ioc->spi_data.sdp1length) if (!ioc->spi_data.sdp1length)
...@@ -3946,7 +3948,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) ...@@ -3946,7 +3948,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget)
} }
mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
&configuration, flags); &configuration, flags);
dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC "
"offset=0 negoFlags=%x request=%x config=%x\n", "offset=0 negoFlags=%x request=%x config=%x\n",
id, flags, requested, configuration)); id, flags, requested, configuration));
pcfg1Data->RequestedParameters = cpu_to_le32(requested); pcfg1Data->RequestedParameters = cpu_to_le32(requested);
...@@ -3959,7 +3961,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) ...@@ -3959,7 +3961,7 @@ mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget)
flags = vtarget->negoFlags; flags = vtarget->negoFlags;
mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
&configuration, flags); &configuration, flags);
dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC "
"offset=0 negoFlags=%x request=%x config=%x\n", "offset=0 negoFlags=%x request=%x config=%x\n",
vtarget->target_id, flags, requested, configuration)); vtarget->target_id, flags, requested, configuration));
pcfg1Data->RequestedParameters = cpu_to_le32(requested); pcfg1Data->RequestedParameters = cpu_to_le32(requested);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册