* [PATCH 5/6] mpt fusion - abort of board reset leaves port dead requiring reboot
From: Michael Reed @ 2006-05-18 20:00 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 382 bytes --]
The driver uses msleep_interruptible() in the code path responsible
for resetting the card's ports via the lsiutil command. If a
<ctrl-c> is received during the reset it can leave a port in such
a state that the only way to regain its use is to reboot the system.
Changing from msleep_interruptible() to msleep() corrects the problem.
Signed-off-by: Michael Reed <mdr@sgi.com>
[-- Attachment #2: 05-mptfc_msleep.patch --]
[-- Type: text/x-patch, Size: 3948 bytes --]
The driver uses msleep_interruptible() in the code path responsible
for resetting the card's ports via the lsiutil command. If a
<ctrl-c> is received during the reset it can leave a port in such
a state that the only way to regain its use is to reboot the system.
Changing from msleep_interruptible() to msleep() corrects the problem.
Signed-off-by: Michael Reed <mdr@sgi.com>
--- rc3c/drivers/message/fusion/mptbase.c 2006-05-08 14:55:27.276697653 -0500
+++ rc3/drivers/message/fusion/mptbase.c 2006-05-08 14:58:55.364106345 -0500
@@ -2264,7 +2264,7 @@
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1); /* 1 msec delay */
}
@@ -2652,7 +2652,7 @@
state = mpt_GetIocState(ioc, 1);
while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay(1);
}
@@ -2904,7 +2904,7 @@
/* wait 1 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1);
}
@@ -2921,7 +2921,7 @@
}
/* wait .1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3011,7 +3011,7 @@
/* wait 1 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1);
+ msleep (1);
} else {
mdelay (1);
}
@@ -3059,7 +3059,7 @@
return 0;
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (10);
+ msleep (10);
} else {
mdelay (10);
}
@@ -3110,7 +3110,7 @@
SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3132,7 +3132,7 @@
return hard_reset_done;
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (10);
+ msleep (10);
} else {
mdelay (10);
}
@@ -3203,7 +3203,7 @@
/* wait 100 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3282,7 +3282,7 @@
/* wait 1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3310,7 +3310,7 @@
/* wait 1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3344,7 +3344,7 @@
/* wait 100 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3438,7 +3438,7 @@
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1); /* 1 msec delay */
}
@@ -3878,7 +3878,7 @@
intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
break;
- msleep_interruptible (1);
+ msleep (1);
count++;
}
} else {
@@ -3927,7 +3927,7 @@
intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
break;
- msleep_interruptible(1);
+ msleep(1);
count++;
}
} else {
--- rc3c/drivers/message/fusion/mptfc.c 2006-05-08 14:55:38.828222127 -0500
+++ rc3/drivers/message/fusion/mptfc.c 2006-05-08 14:58:58.911964756 -0500
@@ -678,7 +678,7 @@
*/
if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
if (count-- > 0) {
- msleep_interruptible(100);
+ msleep(100);
goto try_again;
}
printk(MYIOC_s_INFO_FMT "Firmware discovery not"
--- rc3c/drivers/message/fusion/mptscsih.c 2006-05-08 14:55:06.453554069 -0500
+++ rc3/drivers/message/fusion/mptscsih.c 2006-05-08 14:59:04.163755105 -0500
@@ -1922,7 +1922,7 @@
break;
}
spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
- msleep_interruptible(250);
+ msleep(250);
} while (--loop_count);
return status;
^ permalink raw reply
* [PATCH 6/6] mpt fusion - change driver revision to 3.03.10
From: Michael Reed @ 2006-05-18 20:00 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 127 bytes --]
Bump driver version number to reflect addition of various
fibre channel patches.
Signed-off-by: Michael Reed <mdr@sgi.com>
[-- Attachment #2: 06-mptfc_bump_driver_version.patch --]
[-- Type: text/x-patch, Size: 650 bytes --]
Bump driver version number to reflect addition of various
fibre channel patches.
Signed-off-by: Michael Reed <mdr@sgi.com>
--- rc3c/drivers/message/fusion/mptbase.h 2006-05-08 15:05:27.972247067 -0500
+++ rc3/drivers/message/fusion/mptbase.h 2006-05-08 15:06:04.490752995 -0500
@@ -76,8 +76,8 @@
#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
#endif
-#define MPT_LINUX_VERSION_COMMON "3.03.09"
-#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.09"
+#define MPT_LINUX_VERSION_COMMON "3.03.10"
+#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.10"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
^ permalink raw reply
* Re: [RFC] printks in print_inquiry
From: Patrick Mansfield @ 2006-05-18 20:09 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-scsi
In-Reply-To: <20060518183652.GM1604@parisc-linux.org>
On Thu, May 18, 2006 at 12:36:52PM -0600, Matthew Wilcox wrote:
> I went for:
>
> scsi: 2:0:1:0: Vendor: HP 18.2G Model: ATLAS10K3_18_SCA Rev: HP05 ANSI rev: 02
That is very nice ... as is replacing print_inquiry with one line of code.
> SCSI device sda: 35566480 512-byte hdwr sectors (18210 MB)
> sda: Write Protect is off
> SCSI device sda: drive cache: write through w/ FUA
> sda: sda1 sda2 sda3
> sd 2:0:1:0: Attached scsi disk sda
> sd 2:0:1:0: Attached scsi generic sg0 type 0
>
>
> wouldn't this look better?
>
> sda: 35566480 512-byte hdwr sectors (18210 MB)
> sda: Write Protect is off
> sda: drive cache: write through w/ FUA
> sda: sda1 sda2 sda3
> sd 2:0:1:0: Attached scsi disk sda
> sd 2:0:1:0: Attached scsi generic sg0 type 0
Yes, better. I guess those should all be sdev_printk in sd.c.
Funky how loading sd after sg changes the output ... and using the driver
name as a prefix sometimes messes this up for scsi.
i.e. scan without sd_mod or sg loaded (and distro I'm using loads sg
before sd_mod via udev rules):
0:0:0:0: Attached scsi generic sg0 type 0
0:0:0:1: Attached scsi generic sg1 type 0
Then remove/add those devices, and sg lines become:
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:1: Attached scsi generic sg1 type 0
> > > And maybe use printk("%-16s") formatting? But garbage might get printed
> > > for non-ASCII (though the SCSI specs say it is not allowed ...).
>
> I think you meant %.16s, not %-16s; it's already padded, we just need a
> maximum byte count.
Yes, I was thinking it was not padded.
> Anyway, I noticed that sdev has everything I need in it, and it's
> definitely clearer than using the inquiry data directly. The one thing
> I don't do this for is scsi_level; we want what the device returned,
> not what we've mangled it to.
>
> The comment about BLIST_ISROM is a little too terse for me to know what
> to do; can anyone hazard a guess?
It is the only place that we modify the inquiry result, and I thought it
was gross and (a bit) confusing.
That is, after your patch, it could change to (and the no_uld_attach check
should not really be an "else"):
--- inq-print-linux-2.6.17-rc4-git6/drivers/scsi/o-scsi_scan.c 2006-05-18 11:57:28.000000000 -0700
+++ inq-print-linux-2.6.17-rc4-git6/drivers/scsi/scsi_scan.c 2006-05-18 12:06:05.000000000 -0700
@@ -598,18 +598,18 @@ static int scsi_add_lun(struct scsi_devi
sdev->model = (char *) (sdev->inquiry + 16);
sdev->rev = (char *) (sdev->inquiry + 32);
- if (*bflags & BLIST_ISROM) {
- /*
- * It would be better to modify sdev->type, and set
- * sdev->removable; this can now be done since
- * print_inquiry has gone away.
- */
- inq_result[0] = TYPE_ROM;
- inq_result[1] |= 0x80; /* removable */
- } else if (*bflags & BLIST_NO_ULD_ATTACH)
+ if (*bflags & BLIST_NO_ULD_ATTACH)
sdev->no_uld_attach = 1;
- switch (sdev->type = (inq_result[0] & 0x1f)) {
+ if (*bflags & BLIST_ISROM) {
+ sdev->type = TYPE_ROM;
+ sdev->removable = 1;
+ } else {
+ sdev->type = (inq_result[0] & 0x1f);
+ sdev->removable = (0x80 & inq_result[1]) >> 7;
+ }
+
+ switch (sdev->type) {
case TYPE_TAPE:
case TYPE_DISK:
case TYPE_PRINTER:
@@ -652,7 +652,6 @@ static int scsi_add_lun(struct scsi_devi
*/
sdev->inq_periph_qual = (inq_result[0] >> 5) & 7;
- sdev->removable = (0x80 & inq_result[1]) >> 7;
sdev->lockable = sdev->removable;
sdev->soft_reset = (inq_result[7] & 1) && ((inq_result[3] & 7) == 2);
-- Patrick Mansfield
^ permalink raw reply
* RE: [PATCH] fusion - mptspi - reset handler shouldn't be calledfor other bus protocals
From: Moore, Eric @ 2006-05-18 20:52 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
On Wednesday, May 17, 2006 5:07 PM, James Bottomley wrote:
> >
> > This is urgent bug fix. Pls apply this to scsi-rc-fixes-2.6,
> > as well as this patch posted yesterday:
> > http://marc.theaimsgroup.com/?l=linux-scsi&m=114782261719616&w=2
>
> That's a pretty nasty bug ... and it will bite on the other reset
> handlers, won't it as well? Shouldn't we be fixing it this
> way instead:
>
ACK
Agreed, very nasty bug.
Your implementation is much cleaner. Pls apply.
Eric Moore
^ permalink raw reply
* [REPOST][PATCH 2/6] mpt fusion - move fc event/reset handling to mptfc
From: Michael Reed @ 2006-05-18 22:14 UTC (permalink / raw)
To: Michael Reed; +Cc: linux-scsi
In-Reply-To: <446CD233.70508@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 15293 bytes --]
This patch has been respun to take into account James Bottomley's
version of the fix to the fusion reset handlers. This patch
replaces the previous patch.
http://marc.theaimsgroup.com/?l=linux-scsi&m=114790729315904&w=2
Aside from line number changes, there is a one line difference between
the two patches. The test for bus_type is no longer required with the
application of James' fix.
> --- rc4u/drivers/message/fusion/mptfc.c 2006-05-18 16:31:32.389384812 -0500
> +++ rc4/drivers/message/fusion/mptfc.c 2006-05-18 16:32:50.941453888 -0500
349c349
< + if (rc == 0 || ioc->bus_type != FC)
---
> + if (rc == 0)
Only patches two and five in the sequence required change.
Signed-off-by: Michael Reed <mdr@sgi.com>
Michael Reed wrote:
> Move fibre channel event and reset handling to mptfc. This will
> result in fewer changes over time that need to be applied to
> either mptbase.c or mptscsih.c.
>
> Signed-off-by: Michael Reed <mdr@sgi.com>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> Move fibre channel event and reset handling to mptfc. This will
> result in fewer changes over time that need to be applied to
> either mptbase.c or mptscsih.c.
>
> Signed-off-by: Michael Reed <mdr@sgi.com>
>
>
> --- rc3c/drivers/message/fusion/mptbase.c 2006-05-04 14:17:05.679710768 -0500
> +++ rc3/drivers/message/fusion/mptbase.c 2006-05-04 14:17:25.014432823 -0500
> @@ -1188,7 +1188,6 @@
> ioc->pcidev = pdev;
> ioc->diagPending = 0;
> spin_lock_init(&ioc->diagLock);
> - spin_lock_init(&ioc->fc_rescan_work_lock);
> spin_lock_init(&ioc->initializing_hba_lock);
>
> /* Initialize the event logging.
> @@ -1826,14 +1825,6 @@
> mpt_findImVolumes(ioc);
>
> } else if (ioc->bus_type == FC) {
> - /*
> - * Pre-fetch FC port WWN and stuff...
> - * (FCPortPage0_t stuff)
> - */
> - for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
> - (void) mptbase_GetFcPortPage0(ioc, ii);
> - }
> -
> if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) &&
> (ioc->lan_cnfg_page0.Header.PageLength == 0)) {
> /*
> @@ -4159,108 +4150,6 @@
>
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
> /*
> - * mptbase_GetFcPortPage0 - Fetch FCPort config Page0.
> - * @ioc: Pointer to MPT_ADAPTER structure
> - * @portnum: IOC Port number
> - *
> - * Return: 0 for success
> - * -ENOMEM if no memory available
> - * -EPERM if not allowed due to ISR context
> - * -EAGAIN if no msg frames currently available
> - * -EFAULT for non-successful reply or no reply (timeout)
> - */
> -int
> -mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
> -{
> - ConfigPageHeader_t hdr;
> - CONFIGPARMS cfg;
> - FCPortPage0_t *ppage0_alloc;
> - FCPortPage0_t *pp0dest;
> - dma_addr_t page0_dma;
> - int data_sz;
> - int copy_sz;
> - int rc;
> - int count = 400;
> -
> -
> - /* Get FCPort Page 0 header */
> - hdr.PageVersion = 0;
> - hdr.PageLength = 0;
> - hdr.PageNumber = 0;
> - hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT;
> - cfg.cfghdr.hdr = &hdr;
> - cfg.physAddr = -1;
> - cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
> - cfg.dir = 0;
> - cfg.pageAddr = portnum;
> - cfg.timeout = 0;
> -
> - if ((rc = mpt_config(ioc, &cfg)) != 0)
> - return rc;
> -
> - if (hdr.PageLength == 0)
> - return 0;
> -
> - data_sz = hdr.PageLength * 4;
> - rc = -ENOMEM;
> - ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
> - if (ppage0_alloc) {
> -
> - try_again:
> - memset((u8 *)ppage0_alloc, 0, data_sz);
> - cfg.physAddr = page0_dma;
> - cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
> -
> - if ((rc = mpt_config(ioc, &cfg)) == 0) {
> - /* save the data */
> - pp0dest = &ioc->fc_port_page0[portnum];
> - copy_sz = min_t(int, sizeof(FCPortPage0_t), data_sz);
> - memcpy(pp0dest, ppage0_alloc, copy_sz);
> -
> - /*
> - * Normalize endianness of structure data,
> - * by byte-swapping all > 1 byte fields!
> - */
> - pp0dest->Flags = le32_to_cpu(pp0dest->Flags);
> - pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier);
> - pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low);
> - pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High);
> - pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low);
> - pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High);
> - pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass);
> - pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds);
> - pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed);
> - pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize);
> - pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low);
> - pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High);
> - pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low);
> - pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High);
> - pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
> - pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
> -
> - /*
> - * if still doing discovery,
> - * hang loose a while until finished
> - */
> - if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
> - if (count-- > 0) {
> - msleep_interruptible(100);
> - goto try_again;
> - }
> - printk(MYIOC_s_INFO_FMT "Firmware discovery not"
> - " complete.\n",
> - ioc->name);
> - }
> - }
> -
> - pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
> - }
> -
> - return rc;
> -}
> -
> -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
> -/*
> * mptbase_sas_persist_operation - Perform operation on SAS Persitent Table
> * @ioc: Pointer to MPT_ADAPTER structure
> * @sas_address: 64bit SAS Address for operation.
> @@ -6468,7 +6357,6 @@
> EXPORT_SYMBOL(mpt_alloc_fw_memory);
> EXPORT_SYMBOL(mpt_free_fw_memory);
> EXPORT_SYMBOL(mptbase_sas_persist_operation);
> -EXPORT_SYMBOL(mptbase_GetFcPortPage0);
>
>
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
> --- rc3c/drivers/message/fusion/mptbase.h 2006-05-04 14:17:05.683710503 -0500
> +++ rc3/drivers/message/fusion/mptbase.h 2006-05-04 14:17:42.437284760 -0500
> @@ -1027,7 +1027,6 @@
> extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
> extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
> extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
> -extern int mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum);
>
> /*
> * Public data decl's...
> --- rc3c/drivers/message/fusion/mptfc.c 2006-05-04 14:17:05.683710503 -0500
> +++ rc3/drivers/message/fusion/mptfc.c 2006-05-04 14:17:25.018432559 -0500
> @@ -596,6 +596,110 @@
> return err;
> }
>
> +/*
> + * mptfc_GetFcPortPage0 - Fetch FCPort config Page0.
> + * @ioc: Pointer to MPT_ADAPTER structure
> + * @portnum: IOC Port number
> + *
> + * Return: 0 for success
> + * -ENOMEM if no memory available
> + * -EPERM if not allowed due to ISR context
> + * -EAGAIN if no msg frames currently available
> + * -EFAULT for non-successful reply or no reply (timeout)
> + * -EINVAL portnum arg out of range (hardwired to two elements)
> + */
> +static int
> +mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
> +{
> + ConfigPageHeader_t hdr;
> + CONFIGPARMS cfg;
> + FCPortPage0_t *ppage0_alloc;
> + FCPortPage0_t *pp0dest;
> + dma_addr_t page0_dma;
> + int data_sz;
> + int copy_sz;
> + int rc;
> + int count = 400;
> +
> + if (portnum > 1)
> + return -EINVAL;
> +
> + /* Get FCPort Page 0 header */
> + hdr.PageVersion = 0;
> + hdr.PageLength = 0;
> + hdr.PageNumber = 0;
> + hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT;
> + cfg.cfghdr.hdr = &hdr;
> + cfg.physAddr = -1;
> + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
> + cfg.dir = 0;
> + cfg.pageAddr = portnum;
> + cfg.timeout = 0;
> +
> + if ((rc = mpt_config(ioc, &cfg)) != 0)
> + return rc;
> +
> + if (hdr.PageLength == 0)
> + return 0;
> +
> + data_sz = hdr.PageLength * 4;
> + rc = -ENOMEM;
> + ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
> + if (ppage0_alloc) {
> +
> + try_again:
> + memset((u8 *)ppage0_alloc, 0, data_sz);
> + cfg.physAddr = page0_dma;
> + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
> +
> + if ((rc = mpt_config(ioc, &cfg)) == 0) {
> + /* save the data */
> + pp0dest = &ioc->fc_port_page0[portnum];
> + copy_sz = min_t(int, sizeof(FCPortPage0_t), data_sz);
> + memcpy(pp0dest, ppage0_alloc, copy_sz);
> +
> + /*
> + * Normalize endianness of structure data,
> + * by byte-swapping all > 1 byte fields!
> + */
> + pp0dest->Flags = le32_to_cpu(pp0dest->Flags);
> + pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier);
> + pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low);
> + pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High);
> + pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low);
> + pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High);
> + pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass);
> + pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds);
> + pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed);
> + pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize);
> + pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low);
> + pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High);
> + pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low);
> + pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High);
> + pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
> + pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
> +
> + /*
> + * if still doing discovery,
> + * hang loose a while until finished
> + */
> + if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
> + if (count-- > 0) {
> + msleep_interruptible(100);
> + goto try_again;
> + }
> + printk(MYIOC_s_INFO_FMT "Firmware discovery not"
> + " complete.\n",
> + ioc->name);
> + }
> + }
> +
> + pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
> + }
> +
> + return rc;
> +}
> +
> static void
> mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum)
> {
> @@ -652,7 +756,7 @@
> * will reregister existing rports
> */
> for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
> - rc = mptbase_GetFcPortPage0(ioc, ii);
> + rc = mptfc_GetFcPortPage0(ioc, ii);
> if (rc == -EAGAIN)
> break;
> mptfc_init_host_attr(ioc,ii); /* refresh */
> @@ -772,6 +876,7 @@
> goto out_mptfc_probe;
> }
>
> + spin_lock_init(&ioc->fc_rescan_work_lock);
> INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc);
>
> spin_lock_irqsave(&ioc->FreeQlock, flags);
> @@ -908,6 +1013,14 @@
> goto out_mptfc_probe;
>
> /*
> + * Pre-fetch FC port WWN and stuff...
> + * (FCPortPage0_t stuff)
> + */
> + for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
> + (void) mptfc_GetFcPortPage0(ioc, ii);
> + }
> +
> + /*
> * scan for rports -
> * by doing it via the workqueue, some locking is eliminated
> */
> @@ -936,6 +1049,74 @@
> #endif
> };
>
> +static int
> +mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
> +{
> + MPT_SCSI_HOST *hd;
> + u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
> + unsigned long flags;
> + int rc=1;
> +
> + devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
> + ioc->name, event));
> +
> + if (ioc->sh == NULL ||
> + ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL))
> + return 1;
> +
> + switch (event) {
> + case MPI_EVENT_RESCAN:
> + spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
> + if (ioc->fc_rescan_work_q) {
> + if (ioc->fc_rescan_work_count++ == 0) {
> + queue_work(ioc->fc_rescan_work_q,
> + &ioc->fc_rescan_work);
> + }
> + }
> + spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
> + break;
> + default:
> + rc = mptscsih_event_process(ioc,pEvReply);
> + break;
> + }
> + return rc;
> +}
> +
> +static int
> +mptfc_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
> +{
> + int rc;
> + unsigned long flags;
> +
> + rc = mptscsih_ioc_reset(ioc,reset_phase);
> + if (rc == 0 || ioc->bus_type != FC)
> + return rc;
> +
> +
> + dtmprintk((KERN_WARNING MYNAM
> + ": IOC %s_reset routed to FC host driver!\n",
> + reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
> + reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
> +
> + if (reset_phase == MPT_IOC_SETUP_RESET) {
> + }
> +
> + else if (reset_phase == MPT_IOC_PRE_RESET) {
> + }
> +
> + else { /* MPT_IOC_POST_RESET */
> + spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
> + if (ioc->fc_rescan_work_q) {
> + if (ioc->fc_rescan_work_count++ == 0) {
> + queue_work(ioc->fc_rescan_work_q,
> + &ioc->fc_rescan_work);
> + }
> + }
> + spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
> + }
> + return 1;
> +}
> +
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
> /**
> * mptfc_init - Register MPT adapter(s) as SCSI host(s) with
> @@ -964,12 +1145,12 @@
> mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER);
> mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER);
>
> - if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) {
> + if (mpt_event_register(mptfcDoneCtx, mptfc_event_process) == 0) {
> devtverboseprintk((KERN_INFO MYNAM
> ": Registered for IOC event notifications\n"));
> }
>
> - if (mpt_reset_register(mptfcDoneCtx, mptscsih_ioc_reset) == 0) {
> + if (mpt_reset_register(mptfcDoneCtx, mptfc_ioc_reset) == 0) {
> dprintk((KERN_INFO MYNAM
> ": Registered for IOC reset notifications\n"));
> }
> --- rc3c/drivers/message/fusion/mptscsih.c 2006-05-04 14:17:05.687710238 -0500
> +++ rc3/drivers/message/fusion/mptscsih.c 2006-05-04 14:17:25.018432559 -0500
> @@ -2521,18 +2521,6 @@
> hd->cmdPtr = NULL;
> }
>
> - /* 7. FC: Rescan for blocked rports which might have returned.
> - */
> - if (ioc->bus_type == FC) {
> - spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
> - if (ioc->fc_rescan_work_q) {
> - if (ioc->fc_rescan_work_count++ == 0) {
> - queue_work(ioc->fc_rescan_work_q,
> - &ioc->fc_rescan_work);
> - }
> - }
> - spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
> - }
> dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name));
>
> }
> @@ -2546,7 +2534,6 @@
> {
> MPT_SCSI_HOST *hd;
> u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
> - unsigned long flags;
>
> devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
> ioc->name, event));
> @@ -2569,14 +2556,6 @@
> break;
>
> case MPI_EVENT_RESCAN: /* 06 */
> - spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
> - if (ioc->fc_rescan_work_q) {
> - if (ioc->fc_rescan_work_count++ == 0) {
> - queue_work(ioc->fc_rescan_work_q,
> - &ioc->fc_rescan_work);
> - }
> - }
> - spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
> break;
>
> /*
[-- Attachment #2: 02-mptfc_event_handler.patch --]
[-- Type: text/x-patch, Size: 13327 bytes --]
Move fibre channel event and reset handling to mptfc. This will
result in fewer changes over time that need to be applied to
either mptbase.c or mptscsih.c.
Signed-off-by: Michael Reed <mdr@sgi.com>
--- rc4u/drivers/message/fusion/mptbase.c 2006-05-18 16:27:12.850372609 -0500
+++ rc4/drivers/message/fusion/mptbase.c 2006-05-18 16:32:50.941453888 -0500
@@ -1188,7 +1188,6 @@
ioc->pcidev = pdev;
ioc->diagPending = 0;
spin_lock_init(&ioc->diagLock);
- spin_lock_init(&ioc->fc_rescan_work_lock);
spin_lock_init(&ioc->initializing_hba_lock);
/* Initialize the event logging.
@@ -1841,14 +1840,6 @@
mpt_findImVolumes(ioc);
} else if (ioc->bus_type == FC) {
- /*
- * Pre-fetch FC port WWN and stuff...
- * (FCPortPage0_t stuff)
- */
- for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
- (void) mptbase_GetFcPortPage0(ioc, ii);
- }
-
if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) &&
(ioc->lan_cnfg_page0.Header.PageLength == 0)) {
/*
@@ -4174,108 +4165,6 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
- * mptbase_GetFcPortPage0 - Fetch FCPort config Page0.
- * @ioc: Pointer to MPT_ADAPTER structure
- * @portnum: IOC Port number
- *
- * Return: 0 for success
- * -ENOMEM if no memory available
- * -EPERM if not allowed due to ISR context
- * -EAGAIN if no msg frames currently available
- * -EFAULT for non-successful reply or no reply (timeout)
- */
-int
-mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
-{
- ConfigPageHeader_t hdr;
- CONFIGPARMS cfg;
- FCPortPage0_t *ppage0_alloc;
- FCPortPage0_t *pp0dest;
- dma_addr_t page0_dma;
- int data_sz;
- int copy_sz;
- int rc;
- int count = 400;
-
-
- /* Get FCPort Page 0 header */
- hdr.PageVersion = 0;
- hdr.PageLength = 0;
- hdr.PageNumber = 0;
- hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT;
- cfg.cfghdr.hdr = &hdr;
- cfg.physAddr = -1;
- cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
- cfg.dir = 0;
- cfg.pageAddr = portnum;
- cfg.timeout = 0;
-
- if ((rc = mpt_config(ioc, &cfg)) != 0)
- return rc;
-
- if (hdr.PageLength == 0)
- return 0;
-
- data_sz = hdr.PageLength * 4;
- rc = -ENOMEM;
- ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
- if (ppage0_alloc) {
-
- try_again:
- memset((u8 *)ppage0_alloc, 0, data_sz);
- cfg.physAddr = page0_dma;
- cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
-
- if ((rc = mpt_config(ioc, &cfg)) == 0) {
- /* save the data */
- pp0dest = &ioc->fc_port_page0[portnum];
- copy_sz = min_t(int, sizeof(FCPortPage0_t), data_sz);
- memcpy(pp0dest, ppage0_alloc, copy_sz);
-
- /*
- * Normalize endianness of structure data,
- * by byte-swapping all > 1 byte fields!
- */
- pp0dest->Flags = le32_to_cpu(pp0dest->Flags);
- pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier);
- pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low);
- pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High);
- pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low);
- pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High);
- pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass);
- pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds);
- pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed);
- pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize);
- pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low);
- pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High);
- pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low);
- pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High);
- pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
- pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
-
- /*
- * if still doing discovery,
- * hang loose a while until finished
- */
- if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
- if (count-- > 0) {
- msleep_interruptible(100);
- goto try_again;
- }
- printk(MYIOC_s_INFO_FMT "Firmware discovery not"
- " complete.\n",
- ioc->name);
- }
- }
-
- pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
- }
-
- return rc;
-}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
* mptbase_sas_persist_operation - Perform operation on SAS Persitent Table
* @ioc: Pointer to MPT_ADAPTER structure
* @sas_address: 64bit SAS Address for operation.
@@ -6483,7 +6372,6 @@
EXPORT_SYMBOL(mpt_alloc_fw_memory);
EXPORT_SYMBOL(mpt_free_fw_memory);
EXPORT_SYMBOL(mptbase_sas_persist_operation);
-EXPORT_SYMBOL(mptbase_GetFcPortPage0);
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
--- rc4u/drivers/message/fusion/mptbase.h 2006-05-12 00:14:15.000000000 -0500
+++ rc4/drivers/message/fusion/mptbase.h 2006-05-18 16:32:50.941453888 -0500
@@ -1027,7 +1027,6 @@
extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
-extern int mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum);
/*
* Public data decl's...
--- rc4u/drivers/message/fusion/mptfc.c 2006-05-18 16:31:32.389384812 -0500
+++ rc4/drivers/message/fusion/mptfc.c 2006-05-18 16:32:50.941453888 -0500
@@ -596,6 +596,110 @@
return err;
}
+/*
+ * mptfc_GetFcPortPage0 - Fetch FCPort config Page0.
+ * @ioc: Pointer to MPT_ADAPTER structure
+ * @portnum: IOC Port number
+ *
+ * Return: 0 for success
+ * -ENOMEM if no memory available
+ * -EPERM if not allowed due to ISR context
+ * -EAGAIN if no msg frames currently available
+ * -EFAULT for non-successful reply or no reply (timeout)
+ * -EINVAL portnum arg out of range (hardwired to two elements)
+ */
+static int
+mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
+{
+ ConfigPageHeader_t hdr;
+ CONFIGPARMS cfg;
+ FCPortPage0_t *ppage0_alloc;
+ FCPortPage0_t *pp0dest;
+ dma_addr_t page0_dma;
+ int data_sz;
+ int copy_sz;
+ int rc;
+ int count = 400;
+
+ if (portnum > 1)
+ return -EINVAL;
+
+ /* Get FCPort Page 0 header */
+ hdr.PageVersion = 0;
+ hdr.PageLength = 0;
+ hdr.PageNumber = 0;
+ hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT;
+ cfg.cfghdr.hdr = &hdr;
+ cfg.physAddr = -1;
+ cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
+ cfg.dir = 0;
+ cfg.pageAddr = portnum;
+ cfg.timeout = 0;
+
+ if ((rc = mpt_config(ioc, &cfg)) != 0)
+ return rc;
+
+ if (hdr.PageLength == 0)
+ return 0;
+
+ data_sz = hdr.PageLength * 4;
+ rc = -ENOMEM;
+ ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
+ if (ppage0_alloc) {
+
+ try_again:
+ memset((u8 *)ppage0_alloc, 0, data_sz);
+ cfg.physAddr = page0_dma;
+ cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
+
+ if ((rc = mpt_config(ioc, &cfg)) == 0) {
+ /* save the data */
+ pp0dest = &ioc->fc_port_page0[portnum];
+ copy_sz = min_t(int, sizeof(FCPortPage0_t), data_sz);
+ memcpy(pp0dest, ppage0_alloc, copy_sz);
+
+ /*
+ * Normalize endianness of structure data,
+ * by byte-swapping all > 1 byte fields!
+ */
+ pp0dest->Flags = le32_to_cpu(pp0dest->Flags);
+ pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier);
+ pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low);
+ pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High);
+ pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low);
+ pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High);
+ pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass);
+ pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds);
+ pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed);
+ pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize);
+ pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low);
+ pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High);
+ pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low);
+ pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High);
+ pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
+ pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
+
+ /*
+ * if still doing discovery,
+ * hang loose a while until finished
+ */
+ if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
+ if (count-- > 0) {
+ msleep_interruptible(100);
+ goto try_again;
+ }
+ printk(MYIOC_s_INFO_FMT "Firmware discovery not"
+ " complete.\n",
+ ioc->name);
+ }
+ }
+
+ pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
+ }
+
+ return rc;
+}
+
static void
mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum)
{
@@ -652,7 +756,7 @@
* will reregister existing rports
*/
for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
- rc = mptbase_GetFcPortPage0(ioc, ii);
+ rc = mptfc_GetFcPortPage0(ioc, ii);
if (rc == -EAGAIN)
break;
mptfc_init_host_attr(ioc,ii); /* refresh */
@@ -772,6 +876,7 @@
goto out_mptfc_probe;
}
+ spin_lock_init(&ioc->fc_rescan_work_lock);
INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc);
spin_lock_irqsave(&ioc->FreeQlock, flags);
@@ -908,6 +1013,14 @@
goto out_mptfc_probe;
/*
+ * Pre-fetch FC port WWN and stuff...
+ * (FCPortPage0_t stuff)
+ */
+ for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
+ (void) mptfc_GetFcPortPage0(ioc, ii);
+ }
+
+ /*
* scan for rports -
* by doing it via the workqueue, some locking is eliminated
*/
@@ -936,6 +1049,74 @@
#endif
};
+static int
+mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
+{
+ MPT_SCSI_HOST *hd;
+ u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
+ unsigned long flags;
+ int rc=1;
+
+ devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
+ ioc->name, event));
+
+ if (ioc->sh == NULL ||
+ ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL))
+ return 1;
+
+ switch (event) {
+ case MPI_EVENT_RESCAN:
+ spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
+ if (ioc->fc_rescan_work_q) {
+ if (ioc->fc_rescan_work_count++ == 0) {
+ queue_work(ioc->fc_rescan_work_q,
+ &ioc->fc_rescan_work);
+ }
+ }
+ spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
+ break;
+ default:
+ rc = mptscsih_event_process(ioc,pEvReply);
+ break;
+ }
+ return rc;
+}
+
+static int
+mptfc_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
+{
+ int rc;
+ unsigned long flags;
+
+ rc = mptscsih_ioc_reset(ioc,reset_phase);
+ if (rc == 0)
+ return rc;
+
+
+ dtmprintk((KERN_WARNING MYNAM
+ ": IOC %s_reset routed to FC host driver!\n",
+ reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
+ reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
+
+ if (reset_phase == MPT_IOC_SETUP_RESET) {
+ }
+
+ else if (reset_phase == MPT_IOC_PRE_RESET) {
+ }
+
+ else { /* MPT_IOC_POST_RESET */
+ spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
+ if (ioc->fc_rescan_work_q) {
+ if (ioc->fc_rescan_work_count++ == 0) {
+ queue_work(ioc->fc_rescan_work_q,
+ &ioc->fc_rescan_work);
+ }
+ }
+ spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
+ }
+ return 1;
+}
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/**
* mptfc_init - Register MPT adapter(s) as SCSI host(s) with
@@ -964,12 +1145,12 @@
mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER);
mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER);
- if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) {
+ if (mpt_event_register(mptfcDoneCtx, mptfc_event_process) == 0) {
devtverboseprintk((KERN_INFO MYNAM
": Registered for IOC event notifications\n"));
}
- if (mpt_reset_register(mptfcDoneCtx, mptscsih_ioc_reset) == 0) {
+ if (mpt_reset_register(mptfcDoneCtx, mptfc_ioc_reset) == 0) {
dprintk((KERN_INFO MYNAM
": Registered for IOC reset notifications\n"));
}
--- rc4u/drivers/message/fusion/mptscsih.c 2006-05-12 00:14:15.000000000 -0500
+++ rc4/drivers/message/fusion/mptscsih.c 2006-05-18 16:32:50.945453688 -0500
@@ -2521,18 +2521,6 @@
hd->cmdPtr = NULL;
}
- /* 7. FC: Rescan for blocked rports which might have returned.
- */
- if (ioc->bus_type == FC) {
- spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
- if (ioc->fc_rescan_work_q) {
- if (ioc->fc_rescan_work_count++ == 0) {
- queue_work(ioc->fc_rescan_work_q,
- &ioc->fc_rescan_work);
- }
- }
- spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
- }
dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name));
}
@@ -2546,7 +2534,6 @@
{
MPT_SCSI_HOST *hd;
u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
- unsigned long flags;
devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
ioc->name, event));
@@ -2569,14 +2556,6 @@
break;
case MPI_EVENT_RESCAN: /* 06 */
- spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
- if (ioc->fc_rescan_work_q) {
- if (ioc->fc_rescan_work_count++ == 0) {
- queue_work(ioc->fc_rescan_work_q,
- &ioc->fc_rescan_work);
- }
- }
- spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
break;
/*
^ permalink raw reply
* [REPOST][PATCH 5/6] mpt fusion - abort of board reset leaves port dead requiring reboot
From: Michael Reed @ 2006-05-18 22:14 UTC (permalink / raw)
To: Michael Reed; +Cc: linux-scsi
In-Reply-To: <446CD260.7040703@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 5183 bytes --]
This patch has been respun to take into account James Bottomley's
version of the fix to the fusion reset handlers. This patch
replaces the previous patch.
http://marc.theaimsgroup.com/?l=linux-scsi&m=114790729315904&w=2
Aside from line number differences, there is no content difference.
Only patches two and five in the sequence required change.
Signed-off-by: Michael Reed <mdr@sgi.com>
Michael Reed wrote:
> The driver uses msleep_interruptible() in the code path responsible
> for resetting the card's ports via the lsiutil command. If a
> <ctrl-c> is received during the reset it can leave a port in such
> a state that the only way to regain its use is to reboot the system.
> Changing from msleep_interruptible() to msleep() corrects the problem.
>
> Signed-off-by: Michael Reed <mdr@sgi.com>
>
>
>
>
> ------------------------------------------------------------------------
>
> The driver uses msleep_interruptible() in the code path responsible
> for resetting the card's ports via the lsiutil command. If a
> <ctrl-c> is received during the reset it can leave a port in such
> a state that the only way to regain its use is to reboot the system.
> Changing from msleep_interruptible() to msleep() corrects the problem.
>
> Signed-off-by: Michael Reed <mdr@sgi.com>
>
>
> --- rc3c/drivers/message/fusion/mptbase.c 2006-05-08 14:55:27.276697653 -0500
> +++ rc3/drivers/message/fusion/mptbase.c 2006-05-08 14:58:55.364106345 -0500
> @@ -2264,7 +2264,7 @@
> }
>
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible(1);
> + msleep(1);
> } else {
> mdelay (1); /* 1 msec delay */
> }
> @@ -2652,7 +2652,7 @@
> state = mpt_GetIocState(ioc, 1);
> while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible(1);
> + msleep(1);
> } else {
> mdelay(1);
> }
> @@ -2904,7 +2904,7 @@
>
> /* wait 1 msec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible(1);
> + msleep(1);
> } else {
> mdelay (1);
> }
> @@ -2921,7 +2921,7 @@
> }
> /* wait .1 sec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (100);
> + msleep (100);
> } else {
> mdelay (100);
> }
> @@ -3011,7 +3011,7 @@
>
> /* wait 1 msec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (1);
> + msleep (1);
> } else {
> mdelay (1);
> }
> @@ -3059,7 +3059,7 @@
> return 0;
> }
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (10);
> + msleep (10);
> } else {
> mdelay (10);
> }
> @@ -3110,7 +3110,7 @@
> SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
>
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (1000);
> + msleep (1000);
> } else {
> mdelay (1000);
> }
> @@ -3132,7 +3132,7 @@
> return hard_reset_done;
> }
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (10);
> + msleep (10);
> } else {
> mdelay (10);
> }
> @@ -3203,7 +3203,7 @@
>
> /* wait 100 msec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (100);
> + msleep (100);
> } else {
> mdelay (100);
> }
> @@ -3282,7 +3282,7 @@
>
> /* wait 1 sec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (1000);
> + msleep (1000);
> } else {
> mdelay (1000);
> }
> @@ -3310,7 +3310,7 @@
>
> /* wait 1 sec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (1000);
> + msleep (1000);
> } else {
> mdelay (1000);
> }
> @@ -3344,7 +3344,7 @@
>
> /* wait 100 msec */
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible (100);
> + msleep (100);
> } else {
> mdelay (100);
> }
> @@ -3438,7 +3438,7 @@
> }
>
> if (sleepFlag == CAN_SLEEP) {
> - msleep_interruptible(1);
> + msleep(1);
> } else {
> mdelay (1); /* 1 msec delay */
> }
> @@ -3878,7 +3878,7 @@
> intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
> if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
> break;
> - msleep_interruptible (1);
> + msleep (1);
> count++;
> }
> } else {
> @@ -3927,7 +3927,7 @@
> intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
> if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
> break;
> - msleep_interruptible(1);
> + msleep(1);
> count++;
> }
> } else {
> --- rc3c/drivers/message/fusion/mptfc.c 2006-05-08 14:55:38.828222127 -0500
> +++ rc3/drivers/message/fusion/mptfc.c 2006-05-08 14:58:58.911964756 -0500
> @@ -678,7 +678,7 @@
> */
> if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
> if (count-- > 0) {
> - msleep_interruptible(100);
> + msleep(100);
> goto try_again;
> }
> printk(MYIOC_s_INFO_FMT "Firmware discovery not"
> --- rc3c/drivers/message/fusion/mptscsih.c 2006-05-08 14:55:06.453554069 -0500
> +++ rc3/drivers/message/fusion/mptscsih.c 2006-05-08 14:59:04.163755105 -0500
> @@ -1922,7 +1922,7 @@
> break;
> }
> spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
> - msleep_interruptible(250);
> + msleep(250);
> } while (--loop_count);
>
> return status;
[-- Attachment #2: 05-mptfc_msleep.patch --]
[-- Type: text/x-patch, Size: 3948 bytes --]
The driver uses msleep_interruptible() in the code path responsible
for resetting the card's ports via the lsiutil command. If a
<ctrl-c> is received during the reset it can leave a port in such
a state that the only way to regain its use is to reboot the system.
Changing from msleep_interruptible() to msleep() corrects the problem.
Signed-off-by: Michael Reed <mdr@sgi.com>
--- rc4u/drivers/message/fusion/mptbase.c 2006-05-18 16:34:08.109594401 -0500
+++ rc4/drivers/message/fusion/mptbase.c 2006-05-18 16:36:24.094798383 -0500
@@ -2279,7 +2279,7 @@
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1); /* 1 msec delay */
}
@@ -2667,7 +2667,7 @@
state = mpt_GetIocState(ioc, 1);
while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay(1);
}
@@ -2919,7 +2919,7 @@
/* wait 1 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1);
}
@@ -2936,7 +2936,7 @@
}
/* wait .1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3026,7 +3026,7 @@
/* wait 1 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1);
+ msleep (1);
} else {
mdelay (1);
}
@@ -3074,7 +3074,7 @@
return 0;
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (10);
+ msleep (10);
} else {
mdelay (10);
}
@@ -3125,7 +3125,7 @@
SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3147,7 +3147,7 @@
return hard_reset_done;
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (10);
+ msleep (10);
} else {
mdelay (10);
}
@@ -3218,7 +3218,7 @@
/* wait 100 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3297,7 +3297,7 @@
/* wait 1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3325,7 +3325,7 @@
/* wait 1 sec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (1000);
+ msleep (1000);
} else {
mdelay (1000);
}
@@ -3359,7 +3359,7 @@
/* wait 100 msec */
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible (100);
+ msleep (100);
} else {
mdelay (100);
}
@@ -3453,7 +3453,7 @@
}
if (sleepFlag == CAN_SLEEP) {
- msleep_interruptible(1);
+ msleep(1);
} else {
mdelay (1); /* 1 msec delay */
}
@@ -3893,7 +3893,7 @@
intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
break;
- msleep_interruptible (1);
+ msleep (1);
count++;
}
} else {
@@ -3942,7 +3942,7 @@
intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
break;
- msleep_interruptible(1);
+ msleep(1);
count++;
}
} else {
--- rc4u/drivers/message/fusion/mptfc.c 2006-05-18 16:35:11.290436058 -0500
+++ rc4/drivers/message/fusion/mptfc.c 2006-05-18 16:36:24.094798383 -0500
@@ -678,7 +678,7 @@
*/
if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
if (count-- > 0) {
- msleep_interruptible(100);
+ msleep(100);
goto try_again;
}
printk(MYIOC_s_INFO_FMT "Firmware discovery not"
--- rc4u/drivers/message/fusion/mptscsih.c 2006-05-18 16:34:08.117594001 -0500
+++ rc4/drivers/message/fusion/mptscsih.c 2006-05-18 16:36:24.098798183 -0500
@@ -1922,7 +1922,7 @@
break;
}
spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
- msleep_interruptible(250);
+ msleep(250);
} while (--loop_count);
return status;
^ permalink raw reply
* Re: [PATCH] dpt_i2o underflow check (Was: dpt_i2o and sd driver's problem)
From: Sakurai Hiroomi @ 2006-05-19 0:54 UTC (permalink / raw)
To: Salyzyn, Mark; +Cc: linux-scsi
In-Reply-To: <547AF3BD0F3F0B4CBDC379BAC7E4189F02727AF7@otce2k03.adaptec.com>
Dear Mark,
Thank you.
I appreciate your quick response.
Best Regards
Hiroomi Sakurai
"Salyzyn, Mark" <mark_salyzyn@adaptec.com> wrote:
> I agree, the math for underflow is flawed for block sizes other than
> 512, but I leave it up to the community to decide if there is some
> history behind this decision. This math has remained this way 'forever'.
>
> The dpt_i2o driver should have the following (and more accurately
> enclosed) patch to match up with what other sections of code in this
> driver are doing with regards to the underflow check. Other drivers all
> appear to be performing the underflow check in this manner.
>
> len = cmd->request_bufflen;
>
> - if(cmd->underflow && len != cmd->underflow){
> + if(cmd->underflow && len < cmd->underflow){
> printk(KERN_WARNING"Cmd len %08X Cmd underflow %08X\n",
> len, cmd->underflow);
> }
>
> Sincerely -- Mark Salyzyn
>
^ permalink raw reply
* [PATCH 0/6] iscsi update
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
The following patches are mostly bugfixes. Among them we fix a couple
memory usage problems and fix some eh problems. We also add support for
multiple daemons to be able to hook into the class.
The patches were made against scsi-misc.
^ permalink raw reply
* [PATCH 1/6] iscsi update: dont use sendpage for iscsi headers
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
>From Zhen and ported by Mike:
Don't use sendpage for the headers. sendpage for the pdu headers
does not seem to have a performance impact, makes life harder
for mutiple data pdus to be in flight and still trips up some
network cards when it is from slab mem.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index d94038e..7c2ed7b 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -71,14 +71,6 @@ module_param_named(max_lun, iscsi_max_lu
static kmem_cache_t *taskcache;
static inline void
-iscsi_buf_init_virt(struct iscsi_buf *ibuf, char *vbuf, int size)
-{
- sg_init_one(&ibuf->sg, (u8 *)vbuf, size);
- ibuf->sent = 0;
- ibuf->use_sendmsg = 0;
-}
-
-static inline void
iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size)
{
ibuf->sg.page = virt_to_page(vbuf);
@@ -324,7 +316,7 @@ iscsi_solicit_data_init(struct iscsi_con
r2t->sent = 0;
- iscsi_buf_init_virt(&r2t->headbuf, (char*)hdr,
+ iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr));
r2t->dtask = dtask;
@@ -1208,7 +1200,7 @@ iscsi_digest_final_send(struct iscsi_con
if (final)
crypto_digest_final(tcp_conn->data_tx_tfm, (u8*)digest);
- iscsi_buf_init_virt(buf, (char*)digest, 4);
+ iscsi_buf_init_iov(buf, (char*)digest, 4);
rc = iscsi_sendpage(conn, buf, &tcp_ctask->digest_count, &sent);
if (rc) {
tcp_ctask->datadigest = *digest;
@@ -1265,7 +1257,7 @@ iscsi_solicit_data_cont(struct iscsi_con
}
conn->dataout_pdus_cnt++;
- iscsi_buf_init_virt(&r2t->headbuf, (char*)hdr,
+ iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr));
r2t->dtask = dtask;
@@ -1294,7 +1286,7 @@ iscsi_unsolicit_data_init(struct iscsi_c
iscsi_prep_unsolicit_data_pdu(ctask, &dtask->hdr,
tcp_ctask->r2t_data_count);
- iscsi_buf_init_virt(&tcp_ctask->headbuf, (char*)&dtask->hdr,
+ iscsi_buf_init_iov(&tcp_ctask->headbuf, (char*)&dtask->hdr,
sizeof(struct iscsi_hdr));
list_add(&dtask->item, &tcp_ctask->dataqueue);
@@ -1361,7 +1353,7 @@ iscsi_tcp_cmd_init(struct iscsi_cmd_task
} else
tcp_ctask->xmstate = XMSTATE_R_HDR;
- iscsi_buf_init_virt(&tcp_ctask->headbuf, (char*)ctask->hdr,
+ iscsi_buf_init_iov(&tcp_ctask->headbuf, (char*)ctask->hdr,
sizeof(struct iscsi_hdr));
}
@@ -1758,7 +1750,7 @@ handle_xmstate_w_pad(struct iscsi_conn *
int sent;
tcp_ctask->xmstate &= ~XMSTATE_W_PAD;
- iscsi_buf_init_virt(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad,
+ iscsi_buf_init_iov(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad,
tcp_ctask->pad_count);
if (iscsi_sendpage(conn, &tcp_ctask->sendbuf, &tcp_ctask->pad_count,
&sent)) {
@@ -2078,8 +2070,8 @@ iscsi_tcp_mgmt_init(struct iscsi_conn *c
{
struct iscsi_tcp_mgmt_task *tcp_mtask = mtask->dd_data;
- iscsi_buf_init_virt(&tcp_mtask->headbuf, (char*)mtask->hdr,
- sizeof(struct iscsi_hdr));
+ iscsi_buf_init_iov(&tcp_mtask->headbuf, (char*)mtask->hdr,
+ sizeof(struct iscsi_hdr));
tcp_mtask->xmstate = XMSTATE_IMM_HDR;
if (mtask->data_count)
^ permalink raw reply related
* Doctors Use This Too fOxDB
From: Randolph Curry @ 2006-05-19 2:27 UTC (permalink / raw)
To: linux-net
Suffering from short penniss?
Introduce revolution "Longz" formula which
gauranteees sizes increase or moneey baack.
Users reported:
- 2 inches extra in size
- 3x pleasurable orgasms
- 27% thicker
Why waiting?
http://maxx14.hbshop.biz
Hd
^ permalink raw reply
* [PATCH 2/6] iscsi update: only preallocate login buffer
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
We only use the mtask data buffer for login tasks so we do not
need to preallocate a buffer for every mtask. This saves
8 * 31 KB.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 4750d48..580c050 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1258,15 +1258,6 @@ iscsi_session_setup(struct iscsi_transpo
if (mgmt_task_size)
mtask->dd_data = &mtask[1];
mtask->itt = ISCSI_MGMT_ITT_OFFSET + cmd_i;
- mtask->data = kmalloc(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH,
- GFP_KERNEL);
- if (!mtask->data) {
- int j;
-
- for (j = 0; j < cmd_i; j++)
- kfree(session->mgmt_cmds[j]->data);
- goto immdata_alloc_fail;
- }
}
if (scsi_add_host(shost, NULL))
@@ -1282,9 +1273,6 @@ iscsi_session_setup(struct iscsi_transpo
cls_session_fail:
scsi_remove_host(shost);
add_host_fail:
- for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++)
- kfree(session->mgmt_cmds[cmd_i]->data);
-immdata_alloc_fail:
iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
mgmtpool_alloc_fail:
iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
@@ -1305,13 +1293,9 @@ void iscsi_session_teardown(struct iscsi
{
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
- int cmd_i;
scsi_remove_host(shost);
- for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++)
- kfree(session->mgmt_cmds[cmd_i]->data);
-
iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
@@ -1331,6 +1315,7 @@ iscsi_conn_setup(struct iscsi_cls_sessio
struct iscsi_session *session = class_to_transport_session(cls_session);
struct iscsi_conn *conn;
struct iscsi_cls_conn *cls_conn;
+ char *data;
cls_conn = iscsi_create_conn(cls_session, conn_idx);
if (!cls_conn)
@@ -1376,12 +1361,20 @@ iscsi_conn_setup(struct iscsi_cls_sessio
}
spin_unlock_bh(&session->lock);
+ data = kmalloc(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, GFP_KERNEL);
+ if (!data)
+ goto login_mtask_data_alloc_fail;
+ conn->login_mtask->data = data;
+
init_timer(&conn->tmabort_timer);
mutex_init(&conn->xmitmutex);
init_waitqueue_head(&conn->ehwait);
return cls_conn;
+login_mtask_data_alloc_fail:
+ __kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask,
+ sizeof(void*));
login_mtask_alloc_fail:
kfifo_free(conn->mgmtqueue);
mgmtqueue_alloc_fail:
@@ -1451,6 +1444,7 @@ void iscsi_conn_teardown(struct iscsi_cl
}
spin_lock_bh(&session->lock);
+ kfree(conn->login_mtask->data);
__kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask,
sizeof(void*));
list_del(&conn->item);
^ permalink raw reply related
* [PATCH 3/6] iscsi update: kill dtask mempools
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
Discovered by steven@hayter.me.uk and patch by michaelc@cs.wisc.edu
The dtask mempool is reserving 261120 items per session! Since we are now
sending headers with sendmsg there is no reason for the mempool and that
was causing us to us carzy amounts of mem. We can preallicate a header in
the r2t and task struct and reuse them
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 7c2ed7b..08357a6 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -67,9 +67,6 @@ MODULE_VERSION("0:4.445");
static unsigned int iscsi_max_lun = 512;
module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO);
-/* global data */
-static kmem_cache_t *taskcache;
-
static inline void
iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size)
{
@@ -195,16 +192,6 @@ __iscsi_ctask_cleanup(struct iscsi_conn
if (unlikely(!sc))
return;
- if (sc->sc_data_direction == DMA_TO_DEVICE) {
- struct iscsi_data_task *dtask, *n;
-
- /* WRITE: cleanup Data-Out's if any */
- list_for_each_entry_safe(dtask, n, &tcp_ctask->dataqueue,
- item) {
- list_del(&dtask->item);
- mempool_free(dtask, tcp_ctask->datapool);
- }
- }
tcp_ctask->xmstate = XMSTATE_IDLE;
tcp_ctask->r2t = NULL;
}
@@ -286,14 +273,10 @@ iscsi_solicit_data_init(struct iscsi_con
struct iscsi_r2t_info *r2t)
{
struct iscsi_data *hdr;
- struct iscsi_data_task *dtask;
struct scsi_cmnd *sc = ctask->sc;
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
- dtask = mempool_alloc(tcp_ctask->datapool, GFP_ATOMIC);
- BUG_ON(!dtask);
- INIT_LIST_HEAD(&dtask->item);
- hdr = &dtask->hdr;
+ hdr = &r2t->dtask.hdr;
memset(hdr, 0, sizeof(struct iscsi_data));
hdr->ttt = r2t->ttt;
hdr->datasn = cpu_to_be32(r2t->solicit_datasn);
@@ -319,8 +302,6 @@ iscsi_solicit_data_init(struct iscsi_con
iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr));
- r2t->dtask = dtask;
-
if (sc->use_sg) {
int i, sg_count = 0;
struct scatterlist *sg = sc->request_buffer;
@@ -352,8 +333,6 @@ iscsi_solicit_data_init(struct iscsi_con
iscsi_buf_init_iov(&tcp_ctask->sendbuf,
(char*)sc->request_buffer + r2t->data_offset,
r2t->data_count);
-
- list_add(&dtask->item, &tcp_ctask->dataqueue);
}
/**
@@ -1229,14 +1208,10 @@ iscsi_solicit_data_cont(struct iscsi_con
{
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
struct iscsi_data *hdr;
- struct iscsi_data_task *dtask;
struct scsi_cmnd *sc = ctask->sc;
int new_offset;
- dtask = mempool_alloc(tcp_ctask->datapool, GFP_ATOMIC);
- BUG_ON(!dtask);
- INIT_LIST_HEAD(&dtask->item);
- hdr = &dtask->hdr;
+ hdr = &r2t->dtask.hdr;
memset(hdr, 0, sizeof(struct iscsi_data));
hdr->ttt = r2t->ttt;
hdr->datasn = cpu_to_be32(r2t->solicit_datasn);
@@ -1260,8 +1235,6 @@ iscsi_solicit_data_cont(struct iscsi_con
iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr));
- r2t->dtask = dtask;
-
if (sc->use_sg && !iscsi_buf_left(&r2t->sendbuf)) {
BUG_ON(tcp_ctask->bad_sg == r2t->sg);
iscsi_buf_init_sg(&r2t->sendbuf, r2t->sg);
@@ -1270,8 +1243,6 @@ iscsi_solicit_data_cont(struct iscsi_con
iscsi_buf_init_iov(&tcp_ctask->sendbuf,
(char*)sc->request_buffer + new_offset,
r2t->data_count);
-
- list_add(&dtask->item, &tcp_ctask->dataqueue);
}
static void
@@ -1280,17 +1251,11 @@ iscsi_unsolicit_data_init(struct iscsi_c
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
struct iscsi_data_task *dtask;
- dtask = mempool_alloc(tcp_ctask->datapool, GFP_ATOMIC);
- BUG_ON(!dtask);
- INIT_LIST_HEAD(&dtask->item);
-
+ dtask = tcp_ctask->dtask = &tcp_ctask->unsol_dtask;
iscsi_prep_unsolicit_data_pdu(ctask, &dtask->hdr,
tcp_ctask->r2t_data_count);
iscsi_buf_init_iov(&tcp_ctask->headbuf, (char*)&dtask->hdr,
sizeof(struct iscsi_hdr));
-
- list_add(&dtask->item, &tcp_ctask->dataqueue);
- tcp_ctask->dtask = dtask;
}
/**
@@ -1534,7 +1499,6 @@ handle_xmstate_uns_hdr(struct iscsi_conn
tcp_ctask->xmstate |= XMSTATE_UNS_DATA;
if (tcp_ctask->xmstate & XMSTATE_UNS_INIT) {
iscsi_unsolicit_data_init(conn, ctask);
- BUG_ON(!tcp_ctask->dtask);
dtask = tcp_ctask->dtask;
if (conn->hdrdgst_en)
iscsi_hdr_digest(conn, &tcp_ctask->headbuf,
@@ -1643,7 +1607,7 @@ handle_xmstate_sol_data(struct iscsi_con
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
struct iscsi_r2t_info *r2t = tcp_ctask->r2t;
- struct iscsi_data_task *dtask = r2t->dtask;
+ struct iscsi_data_task *dtask = &r2t->dtask;
int left;
tcp_ctask->xmstate &= ~XMSTATE_SOL_DATA;
@@ -1857,7 +1821,7 @@ solicit_head_again:
r2t = tcp_ctask->r2t;
if (conn->hdrdgst_en)
iscsi_hdr_digest(conn, &r2t->headbuf,
- (u8*)r2t->dtask->hdrext);
+ (u8*)r2t->dtask.hdrext);
if (iscsi_sendhdr(conn, &r2t->headbuf, r2t->data_count)) {
tcp_ctask->xmstate &= ~XMSTATE_SOL_DATA;
tcp_ctask->xmstate |= XMSTATE_SOL_HDR;
@@ -2113,21 +2077,6 @@ iscsi_r2tpool_alloc(struct iscsi_session
(void**)tcp_ctask->r2ts);
goto r2t_alloc_fail;
}
-
- /*
- * number of
- * Data-Out PDU's within R2T-sequence can be quite big;
- * using mempool
- */
- tcp_ctask->datapool = mempool_create_slab_pool(ISCSI_DTASK_DEFAULT_MAX,
- taskcache);
- if (tcp_ctask->datapool == NULL) {
- kfifo_free(tcp_ctask->r2tqueue);
- iscsi_pool_free(&tcp_ctask->r2tpool,
- (void**)tcp_ctask->r2ts);
- goto r2t_alloc_fail;
- }
- INIT_LIST_HEAD(&tcp_ctask->dataqueue);
}
return 0;
@@ -2137,7 +2086,6 @@ r2t_alloc_fail:
struct iscsi_cmd_task *ctask = session->cmds[i];
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
- mempool_destroy(tcp_ctask->datapool);
kfifo_free(tcp_ctask->r2tqueue);
iscsi_pool_free(&tcp_ctask->r2tpool,
(void**)tcp_ctask->r2ts);
@@ -2154,7 +2102,6 @@ iscsi_r2tpool_free(struct iscsi_session
struct iscsi_cmd_task *ctask = session->cmds[i];
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
- mempool_destroy(tcp_ctask->datapool);
kfifo_free(tcp_ctask->r2tqueue);
iscsi_pool_free(&tcp_ctask->r2tpool,
(void**)tcp_ctask->r2ts);
@@ -2496,21 +2443,6 @@ r2tpool_alloc_fail:
static void iscsi_tcp_session_destroy(struct iscsi_cls_session *cls_session)
{
- struct iscsi_session *session = class_to_transport_session(cls_session);
- struct iscsi_data_task *dtask, *n;
- int cmd_i;
-
- for (cmd_i = 0; cmd_i < session->cmds_max; cmd_i++) {
- struct iscsi_cmd_task *ctask = session->cmds[cmd_i];
- struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
-
- list_for_each_entry_safe(dtask, n, &tcp_ctask->dataqueue,
- item) {
- list_del(&dtask->item);
- mempool_free(dtask, tcp_ctask->datapool);
- }
- }
-
iscsi_r2tpool_free(class_to_transport_session(cls_session));
iscsi_session_teardown(cls_session);
}
@@ -2592,14 +2524,8 @@ iscsi_tcp_init(void)
}
iscsi_tcp_transport.max_lun = iscsi_max_lun;
- taskcache = kmem_cache_create("iscsi_taskcache",
- sizeof(struct iscsi_data_task), 0,
- SLAB_HWCACHE_ALIGN, NULL, NULL);
- if (!taskcache)
- return -ENOMEM;
-
if (!iscsi_register_transport(&iscsi_tcp_transport))
- kmem_cache_destroy(taskcache);
+ return -ENODEV;
return 0;
}
@@ -2608,7 +2534,6 @@ static void __exit
iscsi_tcp_exit(void)
{
iscsi_unregister_transport(&iscsi_tcp_transport);
- kmem_cache_destroy(taskcache);
}
module_init(iscsi_tcp_init);
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index c591885..8083028 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -118,11 +118,9 @@ struct iscsi_buf {
struct iscsi_data_task {
struct iscsi_data hdr; /* PDU */
char hdrext[sizeof(__u32)]; /* Header-Digest */
- struct list_head item; /* data queue item */
struct iscsi_buf digestbuf; /* digest buffer */
uint32_t digest; /* data digest */
};
-#define ISCSI_DTASK_DEFAULT_MAX ISCSI_SG_TABLESIZE * PAGE_SIZE / 512
struct iscsi_tcp_mgmt_task {
struct iscsi_hdr hdr;
@@ -144,7 +142,7 @@ struct iscsi_r2t_info {
int data_count; /* DATA-Out payload progress */
struct scatterlist *sg; /* per-R2T SG list */
int solicit_datasn;
- struct iscsi_data_task *dtask; /* which data task */
+ struct iscsi_data_task dtask; /* which data task */
};
struct iscsi_tcp_cmd_task {
@@ -167,14 +165,13 @@ struct iscsi_tcp_cmd_task {
struct iscsi_queue r2tpool;
struct kfifo *r2tqueue;
struct iscsi_r2t_info **r2ts;
- struct list_head dataqueue; /* Data-Out dataqueue */
- mempool_t *datapool;
uint32_t datadigest; /* for recover digest */
int digest_count;
uint32_t immdigest; /* for imm data */
struct iscsi_buf immbuf; /* for imm data digest */
- struct iscsi_data_task *dtask; /* data task in progress*/
- int digest_offset; /* for partial buff digest */
+ struct iscsi_data_task *dtask; /* data task in progress*/
+ struct iscsi_data_task unsol_dtask; /* unsol data task */
+ int digest_offset; /* for partial buff digest */
};
#endif /* ISCSI_H */
^ permalink raw reply related
* [PATCH 4/6] iscsi update: support mutiple daemons
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
Patch from david.somayajulu@qlogic.com and cleaned up by Tomo.
qla4xxx is going to have a different daemon so this patch
just routes the events to the right daemon.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 44adafa..5569fdc 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -36,6 +36,7 @@
#define ISCSI_HOST_ATTRS 0
struct iscsi_internal {
+ int daemon_pid;
struct scsi_transport_template t;
struct iscsi_transport *iscsi_transport;
struct list_head list;
@@ -145,7 +146,6 @@ static DECLARE_TRANSPORT_CLASS(iscsi_con
NULL);
static struct sock *nls;
-static int daemon_pid;
static DEFINE_MUTEX(rx_queue_mutex);
struct mempool_zone {
@@ -572,13 +572,13 @@ mempool_zone_get_skb(struct mempool_zone
}
static int
-iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb)
+iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb, int pid)
{
unsigned long flags;
int rc;
skb_get(skb);
- rc = netlink_unicast(nls, skb, daemon_pid, MSG_DONTWAIT);
+ rc = netlink_unicast(nls, skb, pid, MSG_DONTWAIT);
if (rc < 0) {
mempool_free(skb, zone->pool);
printk(KERN_ERR "iscsi: can not unicast skb (%d)\n", rc);
@@ -600,9 +600,14 @@ int iscsi_recv_pdu(struct iscsi_cls_conn
struct sk_buff *skb;
struct iscsi_uevent *ev;
char *pdu;
+ struct iscsi_internal *priv;
int len = NLMSG_SPACE(sizeof(*ev) + sizeof(struct iscsi_hdr) +
data_size);
+ priv = iscsi_if_transport_lookup(conn->transport);
+ if (!priv)
+ return -EINVAL;
+
mempool_zone_complete(conn->z_pdu);
skb = mempool_zone_get_skb(conn->z_pdu);
@@ -613,7 +618,7 @@ int iscsi_recv_pdu(struct iscsi_cls_conn
return -ENOMEM;
}
- nlh = __nlmsg_put(skb, daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
+ nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
ev = NLMSG_DATA(nlh);
memset(ev, 0, sizeof(*ev));
ev->transport_handle = iscsi_handle(conn->transport);
@@ -626,7 +631,7 @@ int iscsi_recv_pdu(struct iscsi_cls_conn
memcpy(pdu, hdr, sizeof(struct iscsi_hdr));
memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size);
- return iscsi_unicast_skb(conn->z_pdu, skb);
+ return iscsi_unicast_skb(conn->z_pdu, skb, priv->daemon_pid);
}
EXPORT_SYMBOL_GPL(iscsi_recv_pdu);
@@ -635,8 +640,13 @@ void iscsi_conn_error(struct iscsi_cls_c
struct nlmsghdr *nlh;
struct sk_buff *skb;
struct iscsi_uevent *ev;
+ struct iscsi_internal *priv;
int len = NLMSG_SPACE(sizeof(*ev));
+ priv = iscsi_if_transport_lookup(conn->transport);
+ if (!priv)
+ return;
+
mempool_zone_complete(conn->z_error);
skb = mempool_zone_get_skb(conn->z_error);
@@ -646,7 +656,7 @@ void iscsi_conn_error(struct iscsi_cls_c
return;
}
- nlh = __nlmsg_put(skb, daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
+ nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0);
ev = NLMSG_DATA(nlh);
ev->transport_handle = iscsi_handle(conn->transport);
ev->type = ISCSI_KEVENT_CONN_ERROR;
@@ -656,7 +666,7 @@ void iscsi_conn_error(struct iscsi_cls_c
ev->r.connerror.cid = conn->cid;
ev->r.connerror.sid = iscsi_conn_get_sid(conn);
- iscsi_unicast_skb(conn->z_error, skb);
+ iscsi_unicast_skb(conn->z_error, skb, priv->daemon_pid);
dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n",
error);
@@ -686,7 +696,7 @@ iscsi_if_send_reply(int pid, int seq, in
nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0);
nlh->nlmsg_flags = flags;
memcpy(NLMSG_DATA(nlh), payload, size);
- return iscsi_unicast_skb(z_reply, skb);
+ return iscsi_unicast_skb(z_reply, skb, pid);
}
static int
@@ -698,12 +708,17 @@ iscsi_if_get_stats(struct iscsi_transpor
struct iscsi_cls_conn *conn;
struct nlmsghdr *nlhstat;
struct iscsi_uevent *evstat;
+ struct iscsi_internal *priv;
int len = NLMSG_SPACE(sizeof(*ev) +
sizeof(struct iscsi_stats) +
sizeof(struct iscsi_stats_custom) *
ISCSI_STATS_CUSTOM_MAX);
int err = 0;
+ priv = iscsi_if_transport_lookup(transport);
+ if (!priv)
+ return -EINVAL;
+
conn = iscsi_conn_lookup(ev->u.get_stats.sid, ev->u.get_stats.cid);
if (!conn)
return -EEXIST;
@@ -720,7 +735,7 @@ iscsi_if_get_stats(struct iscsi_transpor
return -ENOMEM;
}
- nlhstat = __nlmsg_put(skbstat, daemon_pid, 0, 0,
+ nlhstat = __nlmsg_put(skbstat, priv->daemon_pid, 0, 0,
(len - sizeof(*nlhstat)), 0);
evstat = NLMSG_DATA(nlhstat);
memset(evstat, 0, sizeof(*evstat));
@@ -746,7 +761,7 @@ iscsi_if_get_stats(struct iscsi_transpor
skb_trim(skbstat, NLMSG_ALIGN(actual_size));
nlhstat->nlmsg_len = actual_size;
- err = iscsi_unicast_skb(conn->z_pdu, skbstat);
+ err = iscsi_unicast_skb(conn->z_pdu, skbstat, priv->daemon_pid);
} while (err < 0 && err != -ECONNREFUSED);
return err;
@@ -981,6 +996,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, s
if (!try_module_get(transport->owner))
return -EINVAL;
+ priv->daemon_pid = NETLINK_CREDS(skb)->pid;
+
switch (nlh->nlmsg_type) {
case ISCSI_UEVENT_CREATE_SESSION:
err = iscsi_if_create_session(priv, ev);
@@ -1073,7 +1090,6 @@ iscsi_if_rx(struct sock *sk, int len)
skb_pull(skb, skb->len);
goto free_skb;
}
- daemon_pid = NETLINK_CREDS(skb)->pid;
while (skb->len >= NLMSG_SPACE(0)) {
int err;
^ permalink raw reply related
* [PATCH 5/6] iscsi update: fix command requeues during iscsi recovery
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
Do not flush queues then block session. This will cause commands
to needlessly swing around on us and remove goofy
recovery_failed field and replace with state value.
And do not start recovery from within the host reset function.
This causeis too many problems becuase open-iscsi was desinged to
call out to userspace then have userpscae decide if we should
go into recovery or kill the session.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 580c050..d810aca 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -487,6 +487,11 @@ void iscsi_conn_failure(struct iscsi_con
unsigned long flags;
spin_lock_irqsave(&session->lock, flags);
+ if (session->state == ISCSI_STATE_FAILED) {
+ spin_unlock_irqrestore(&session->lock, flags);
+ return;
+ }
+
if (session->conn_cnt == 1 || session->leadconn == conn)
session->state = ISCSI_STATE_FAILED;
spin_unlock_irqrestore(&session->lock, flags);
@@ -612,6 +617,7 @@ enum {
FAILURE_SESSION_FREED,
FAILURE_WINDOW_CLOSED,
FAILURE_SESSION_TERMINATE,
+ FAILURE_SESSION_IN_RECOVERY,
FAILURE_SESSION_RECOVERY_TIMEOUT,
};
@@ -631,18 +637,30 @@ int iscsi_queuecommand(struct scsi_cmnd
spin_lock(&session->lock);
- if (session->state != ISCSI_STATE_LOGGED_IN) {
- if (session->recovery_failed) {
- reason = FAILURE_SESSION_RECOVERY_TIMEOUT;
- goto fault;
- } else if (session->state == ISCSI_STATE_FAILED) {
- reason = FAILURE_SESSION_FAILED;
- goto reject;
- } else if (session->state == ISCSI_STATE_TERMINATE) {
- reason = FAILURE_SESSION_TERMINATE;
+ /*
+ * ISCSI_STATE_FAILED is a temp. state. The recovery
+ * code will decide what is best to do with command queued
+ * during this time
+ */
+ if (session->state != ISCSI_STATE_LOGGED_IN &&
+ session->state != ISCSI_STATE_FAILED) {
+ /*
+ * to handle the race between when we set the recovery state
+ * and block the session we requeue here (commands could
+ * be entering our queuecommand while a block is starting
+ * up because the block code is not locked)
+ */
+ if (session->state == ISCSI_STATE_IN_RECOVERY) {
+ reason = FAILURE_SESSION_IN_RECOVERY;
goto fault;
}
- reason = FAILURE_SESSION_FREED;
+
+ if (session->state == ISCSI_STATE_RECOVERY_FAILED)
+ reason = FAILURE_SESSION_RECOVERY_TIMEOUT;
+ else if (session->state == ISCSI_STATE_TERMINATE)
+ reason = FAILURE_SESSION_TERMINATE;
+ else
+ reason = FAILURE_SESSION_FREED;
goto fault;
}
@@ -728,8 +746,8 @@ iscsi_conn_send_generic(struct iscsi_con
*/
mtask = conn->login_mtask;
else {
- BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
- BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
+ BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
+ BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
nop->exp_statsn = cpu_to_be32(conn->exp_statsn);
if (!__kfifo_get(session->mgmtpool.queue,
@@ -803,7 +821,7 @@ void iscsi_session_recovery_timedout(str
spin_lock_bh(&session->lock);
if (session->state != ISCSI_STATE_LOGGED_IN) {
- session->recovery_failed = 1;
+ session->state = ISCSI_STATE_RECOVERY_FAILED;
if (conn)
wake_up(&conn->ehwait);
}
@@ -838,20 +856,14 @@ failed:
* we drop the lock here but the leadconn cannot be destoyed while
* we are in the scsi eh
*/
- if (fail_session) {
+ if (fail_session)
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
- /*
- * if userspace cannot respond then we must kick this off
- * here for it
- */
- iscsi_start_session_recovery(session, conn, STOP_CONN_RECOVER);
- }
debug_scsi("iscsi_eh_host_reset wait for relogin\n");
wait_event_interruptible(conn->ehwait,
session->state == ISCSI_STATE_TERMINATE ||
session->state == ISCSI_STATE_LOGGED_IN ||
- session->recovery_failed);
+ session->state == ISCSI_STATE_RECOVERY_FAILED);
if (signal_pending(current))
flush_signals(current);
@@ -940,8 +952,7 @@ static int iscsi_exec_abort_task(struct
wait_event_interruptible(conn->ehwait,
sc->SCp.phase != session->age ||
session->state != ISCSI_STATE_LOGGED_IN ||
- conn->tmabort_state != TMABORT_INITIAL ||
- session->recovery_failed);
+ conn->tmabort_state != TMABORT_INITIAL);
if (signal_pending(current))
flush_signals(current);
del_timer_sync(&conn->tmabort_timer);
@@ -1491,7 +1502,6 @@ int iscsi_conn_start(struct iscsi_cls_co
conn->stop_stage = 0;
conn->tmabort_state = TMABORT_INITIAL;
session->age++;
- session->recovery_failed = 0;
spin_unlock_bh(&session->lock);
iscsi_unblock_session(session_to_cls(session));
@@ -1566,8 +1576,8 @@ static void fail_all_commands(struct isc
conn->ctask = NULL;
}
-void iscsi_start_session_recovery(struct iscsi_session *session,
- struct iscsi_conn *conn, int flag)
+static void iscsi_start_session_recovery(struct iscsi_session *session,
+ struct iscsi_conn *conn, int flag)
{
int old_stop_stage;
@@ -1597,17 +1607,8 @@ void iscsi_start_session_recovery(struct
set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
if (session->conn_cnt == 0 || session->leadconn == conn)
- session->state = ISCSI_STATE_FAILED;
-
- spin_unlock_bh(&session->lock);
+ session->state = ISCSI_STATE_IN_RECOVERY;
- session->tt->terminate_conn(conn);
- /*
- * flush queues.
- */
- spin_lock_bh(&session->lock);
- fail_all_commands(conn);
- flush_control_queues(session, conn);
spin_unlock_bh(&session->lock);
/*
@@ -1619,18 +1620,26 @@ void iscsi_start_session_recovery(struct
if (flag == STOP_CONN_RECOVER) {
conn->hdrdgst_en = 0;
conn->datadgst_en = 0;
-
/*
* if this is called from the eh and and from userspace
* then we only need to block once.
*/
- if (session->state == ISCSI_STATE_FAILED &&
+ if (session->state == ISCSI_STATE_IN_RECOVERY &&
old_stop_stage != STOP_CONN_RECOVER)
iscsi_block_session(session_to_cls(session));
}
+
+ session->tt->terminate_conn(conn);
+ /*
+ * flush queues.
+ */
+ spin_lock_bh(&session->lock);
+ fail_all_commands(conn);
+ flush_control_queues(session, conn);
+ spin_unlock_bh(&session->lock);
+
mutex_unlock(&conn->xmitmutex);
}
-EXPORT_SYMBOL_GPL(iscsi_start_session_recovery);
void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
{
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 2dba929..17b28f0 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -210,7 +210,6 @@ struct iscsi_session {
* - mgmtpool, *
* - r2tpool */
int state; /* session state */
- int recovery_failed;
struct list_head item;
int conn_cnt;
int age; /* counts session re-opens */
@@ -241,8 +240,6 @@ iscsi_session_setup(struct iscsi_transpo
int, int, uint32_t, uint32_t *);
extern void iscsi_session_teardown(struct iscsi_cls_session *);
extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
-extern void iscsi_start_session_recovery(struct iscsi_session *,
- struct iscsi_conn *, int);
extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
#define session_to_cls(_sess) \
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index c9e9475..92129b9 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -173,6 +173,8 @@ struct iscsi_cls_conn {
#define ISCSI_STATE_LOGGED_IN 2
#define ISCSI_STATE_FAILED 3
#define ISCSI_STATE_TERMINATE 4
+#define ISCSI_STATE_IN_RECOVERY 5
+#define ISCSI_STATE_RECOVERY_FAILED 6
struct iscsi_cls_session {
struct list_head sess_list; /* item in session_list */
^ permalink raw reply related
* [PATCH 6/6] iscsi update: update version
From: Mike Christie @ 2006-05-19 1:31 UTC (permalink / raw)
To: linux-scsi
update version
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 08357a6..c66faee 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -43,11 +43,13 @@
#include "iscsi_tcp.h"
+#define ISCSI_TCP_VERSION "1.0-574"
+
MODULE_AUTHOR("Dmitry Yusupov <dmitry_yus@yahoo.com>, "
"Alex Aizman <itn780@yahoo.com>");
MODULE_DESCRIPTION("iSCSI/TCP data-path");
MODULE_LICENSE("GPL");
-MODULE_VERSION("0:4.445");
+MODULE_VERSION(ISCSI_TCP_VERSION);
/* #define DEBUG_TCP */
#define DEBUG_ASSERT
@@ -2448,8 +2450,8 @@ static void iscsi_tcp_session_destroy(st
}
static struct scsi_host_template iscsi_sht = {
- .name = "iSCSI Initiator over TCP/IP, v."
- ISCSI_VERSION_STR,
+ .name = "iSCSI Initiator over TCP/IP, v"
+ ISCSI_TCP_VERSION,
.queuecommand = iscsi_queuecommand,
.change_queue_depth = iscsi_change_queue_depth,
.can_queue = ISCSI_XMIT_CMDS_MAX - 1,
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 4feda05..02f6e4b 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -21,8 +21,6 @@
#ifndef ISCSI_PROTO_H
#define ISCSI_PROTO_H
-#define ISCSI_VERSION_STR "0.3"
-#define ISCSI_DATE_STR "22-Apr-2005"
#define ISCSI_DRAFT20_VERSION 0x00
/* default iSCSI listen port for incoming connections */
^ permalink raw reply related
* Re: [Fwd: [RFT] major libata update]
From: Luben Tuikov @ 2006-05-19 3:28 UTC (permalink / raw)
To: James Bottomley; +Cc: Jeff Garzik, SCSI Mailing List
In-Reply-To: <1147960665.3475.4.camel@mulgrave.il.steeleye.com>
--- James Bottomley <James.Bottomley@SteelEye.com> wrote:
> On Wed, 2006-05-17 at 19:39 -0700, Luben Tuikov wrote:
> > Apparently you have no detailed knowlege of the implementation of
> > SCSI storage stacks, for example: driver->fw->interconnect->device.
>
> Well, I'm sure I read about it in a comic book somewhere ...
And so your correspondence agrees...
> > You also fail to understand who the "I" and "T" could be in an
> > I_T_x_x nexus at each stage of an implementation.
> >
> > You also fail to understand that a SAM nexus is not necessarily
> > established
> > when queuecommand() is called.
>
> I didn't say it was. The point, which you're ignoring, is that when the
> driver knows the SAM nexus is terminated, it should call ->done() ASAP
No, I'm not saying that. Not at all. You simply don't understand.
There is no way I can explain it to you unless I educate you. And I'm not
willing to do that.
> to inform the mid-layer of this condition, so the mid-layer model of the
> device interactions follows the SAM interactions as closely as possible.
> The API you want to introduce and the implementation of it in libata lie
> to the mid-layer and pretend the nexus still exists when the driver
> knows it doesn't ... what I'm saying is that I see no reason to do that.
Stop trying to convince the world that SCSI Core has any resemblance
to SAM. It doesn't. It is a far cry from it.
There is no "mid-layer model" and there is no SAM resemblance.
Luben
^ permalink raw reply
* [ANNOUNCE] sdparm 0.98
From: Douglas Gilbert @ 2006-05-19 4:39 UTC (permalink / raw)
To: linux-scsi; +Cc: linux-kernel, tomfa, kumba
sdparm is a command line utility designed to get and set
SCSI device parameters (cf hdparm for ATA disks). The
parameters are held in mode pages. Apart from SCSI devices
(e.g. disks, tapes and enclosures) sdparm can be used on
any device that uses a SCSI command set. Virtually all CD/DVD
drives use the SCSI MMC set irrespective of the transport.
sdparm also can decode VPD pages including the device
identification page. Commands to start and stop the media;
load and unload removable media and some other housekeeping
functions are supported. sdparm supports both the lk 2.4 and
2.6 series.
For more information and downloads see:
http://www.torque.net/sg/sdparm.html
Changelog:
http://www.torque.net/sg/p/sdparm.ChangeLog
Doug Gilbert
^ permalink raw reply
* [PATCH] ppa: no highmem pages
From: Randy.Dunlap @ 2006-05-19 5:07 UTC (permalink / raw)
To: scsi; +Cc: jejb, akpm
From: Randy Dunlap <rdunlap@xenotime.net>
ppa cannot handle highmem pages, and like imm, which already has
this patch, the device is slow, so performance is not a big issue,
so just force pages to be in low memory (hence mapped).
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
drivers/scsi/ppa.c | 4 ++++
1 files changed, 4 insertions(+)
--- linux-2.6.17-rc4.orig/drivers/scsi/ppa.c
+++ linux-2.6.17-rc4/drivers/scsi/ppa.c
@@ -997,6 +997,10 @@ static struct scsi_host_template ppa_tem
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
.can_queue = 1,
+ .unchecked_isa_dma = 1, /* ppa cannot deal with highmem, so
+ * this is an easy trick to ensure
+ * all io pages for this host reside
+ * in low memory */
};
/***************************************************************************
---
^ permalink raw reply
* Newbie - Help required on SAS driver for adp94xx for FC5
From: Fo Loeng Wahidin @ 2006-05-19 8:43 UTC (permalink / raw)
To: linux-scsi
Dear All,
I am a newbie in kernel configuration.
I am posting on this m-list to get some help with an FC5 installation.
I have read some earlier discussion on
"Adaptec SAS integration notes" last December,
however I could not understand what needs to be done.
I got a IBM xseries 306m, with the Adaptec 9405 controller and
a 70 GB SAS drive, and I am trying to install FC5 on it.
I got some driver on the cdrom, however they are for Rhel4 and
it does not seems to recognize the disk during FC5 installation.
So I thought of recompiling the driver on other FC5 machine.
I installed another FC5 on a normal IDE drive machine and downloaded
the adp94xx-1.0.8-6.src.tgz from adaptec website.
I have also installed the kernel develpment rpm of the FC5.
It put the files in
/usr/src/kernels/2.6.15-1.2054_FC5-i686
I unpack the driver from adaptec and put it at
/usr/src/kernels/2.6.15-1.2054_FC5-i686/drivers/scsi/adp94xx
as instructed.
I then did a
make -C /usr/src/kernels/2.6.15-1.2054_FC5-i686 M=`pwd`
as mentioned by the readme
However I then got lots of error message.
Can somebody point me to the location a driver that I can use for FC5
please?
Thanks
Fo Loeng Wahidin
The content of the Makefile is as follow:
------------------------------------------------
#
# Makefile for the Linux adp94xx SAS driver.
#
# $Id: //depot/razor/linux/src/Makefile.2_6#10 $
#
EXTRA_CFLAGS += -Idrivers/scsi -UASD_DEBUG -DSEQUENCER_UPDATE
-DSATA_SKIP_FIX -DCONCURRENT_SUPPORT
ifeq ($(CONFIG_SCSI_ADP94XX),)
CONFIG_SCSI_ADP94XX=m
endif
obj-$(CONFIG_SCSI_ADP94XX) += adp94xx.o
# OSM and HWI Specific Files
adp94xx-y += adp94xx_osm.o \
adp94xx_hwi.o \
adp94xx_seq.o \
adp94xx_discover.o
# IOCTL Specific File
adp94xx-y += adp94xx_ioctl.o
# SATA Specific File
adp94xx-y += adp94xx_sata.o
------------------------------------------------
I have tried to do a symbolic link of
/usr/src/kernels/2.6.15-1.2054_FC5-i686 to /usr/src/linux
and re-run, and it is still giving error message.
The error message that I got is
[root@localhost /usr/src/linux/drivers/scsi/adp94xx]# make -C
/usr/src/linux M=`pwd`
make: Entering directory `/usr/src/kernels/2.6.15-1.2054_FC5-i686'
LD /usr/src/linux/drivers/scsi/adp94xx/built-in.o
CC [M] /usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.o
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:46:5: warning:
"KDB_ENABLE" is not defined
In file included from /usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:49:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:77:18: error: scsi.h:
No such file or directory
In file included from /usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:49:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:420: error: invalid
use of undefined type âstruct scsi_cmndâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:427: error: field
âscsi_cmdâ has incomplete type
In file included from /usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:49:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:597: error: expected
specifier-qualifier-list before âScsi_Deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1230: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1231: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1232: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1233: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1248: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1255: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1262: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1269: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1275: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.h:1306: error: expected
declaration specifiers or â...â before âScsi_Cmndâ
In file included from /usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:53:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h: In function
âasd_next_device_to_runâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h:773: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h: At top level:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h:904: error:
expected â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h:905: error:
expected â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h:993: error:
expected â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_inline.h:1018: error:
expected â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:59: error: expected
â=â, â,â, â;â, âasmâ or â__attribute__â before âasd_shtâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:126: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:128: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:130: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:135: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:136: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:137: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_unmap_scbâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:400: error:
âScsi_Cmndâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:400: error: (Each
undeclared identifier is reported only once
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:400: error: for each
function it appears in.)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:400: error: âcmdâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:401: warning: ISO C90
forbids mixed declarations and code
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_check_device_queueâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:429: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:432: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:705:5: warning:
"KDB_ENABLE" is not defined
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function âasd_initâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:709: warning: implicit
declaration of function âasd_detectâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:709: error: âasd_shtâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: At top level:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:956: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_register_hostâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1083: error: âasd_shtâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_alloc_deviceâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1208: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_free_deviceâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1245: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_flush_device_queueâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1360: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1373: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1398: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1400: warning:
implicit declaration of function âasd_cmd_set_host_statusâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1400: error:
âDID_NO_CONNECTâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1404: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1408: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1423: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1424: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1432: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1467: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1472: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1496: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_dev_timed_unfreezeâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1574: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1586: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_timed_run_dev_queueâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1605: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1611: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1612: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_scb_doneâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1629: error:
âScsi_Cmndâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1629: error: âcmdâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1630: warning: ISO C90
forbids mixed declarations and code
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1680: error: âDID_OKâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1699: error:
âDID_ERRORâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1709: error:
âDID_ABORTâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1729: error:
âDID_NO_CONNECTâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1734: error:
âDID_SOFT_ERRORâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1774: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_handle_sas_statusâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1875: error:
âScsi_Cmndâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1875: error: âcmdâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1882: error:
âDID_ERRORâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1896: error:
âDID_SOFT_ERRORâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1924: warning:
implicit declaration of function âasd_cmd_set_driver_statusâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1924: error:
âDRIVER_SENSEâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1930: error:
âUNIT_ATTENTIONâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1938: error: âDID_OKâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:1939: warning:
implicit declaration of function âasd_cmd_set_scsi_statusâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2022: warning:
implicit declaration of function âasd_cmd_set_retry_statusâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2041: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2041: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: At top level:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2073: error: expected
declaration specifiers or â...â before âScsi_Cmndâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_setup_dataâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2089: error: âcmdâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_build_sas_scbâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2179: error:
âScsi_Cmndâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2179: error: âcmdâ
undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2181: warning: ISO C90
forbids mixed declarations and code
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2195: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2215: warning:
implicit declaration of function âscsi_populate_tag_msgâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2216: error:
âMSG_SIMPLE_TAGâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2223: error: too many
arguments to function âasd_setup_dataâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_configure_targetâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2616: warning:
implicit declaration of function âscsi_add_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_dev_intl_times_outâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2724: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_clear_device_ioâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2769: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_destroy_deviceâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2804: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2820: error:
âDID_NO_CONNECTâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2824: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2833: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2851: warning:
implicit declaration of function âscsi_device_set_stateâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2851: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2851: error:
âSDEV_OFFLINEâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2859: warning:
implicit declaration of function âscsi_remove_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:2859: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_get_os_platform_map_from_sasaddrâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3153: error:
âScsi_Deviceâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3153: error:
âscsi_deviceâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3154: warning: ISO C90
forbids mixed declarations and code
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3170: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_get_sas_addr_from_platform_mapâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3206: warning:
comparison is always false due to limited range of data type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_find_pending_scb_by_qtagâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:3247: error:
dereferencing pointer to incomplete type
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: At top level:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:4818: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5014: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5026: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5055: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_get_user_tagdepthâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5135: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5136: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_set_device_queue_depthâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5159: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5160: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5163: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5163: error: âstruct
asd_deviceâ has no member named âtargetâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: In function
âasd_set_tagsâ:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5229: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5232: warning:
implicit declaration of function âscsi_adjust_queue_depthâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5232: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5233: error:
âMSG_SIMPLE_TAGâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5237: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5238: error:
âMSG_ORDERED_TAGâ undeclared (first use in this function)
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5248: error: âstruct
asd_deviceâ has no member named âscsi_deviceâ
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c: At top level:
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:5383: error: expected
â)â before â*â token
/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.c:6162: error: expected
â=â, â,â, â;â, âasmâ or â__attribute__â before âasd_shtâ
make[1]: *** [/usr/src/linux/drivers/scsi/adp94xx/adp94xx_osm.o] Error 1
make: *** [_module_/usr/src/linux/drivers/scsi/adp94xx] Error 2
make: Leaving directory `/usr/src/kernels/2.6.15-1.2054_FC5-i686'
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] SCSI: make scsi_implement_eh() generic API for SCSI transports
From: Tejun Heo @ 2006-05-19 12:07 UTC (permalink / raw)
To: James Bottomley
Cc: Christoph Hellwig, Jeff Garzik, SCSI Mailing List,
linux-ide@vger.kernel.org, Andrew Morton, Linus Torvalds
In-Reply-To: <446BE9B4.60605@gmail.com>
libata implemented a feature to schedule EH without an associated EH
by manipulating shost->host_eh_scheduled in ata_scsi_schedule_eh()
directly. Move this function to scsi_error.c and rename it to
scsi_schedule_eh(). It is now an exported API for SCSI transports and
exported via new header file drivers/scsi/scsi_transport_api.h
This patch also de-export scsi_eh_wakeup() which was exported
specifically for ata_scsi_schedule_eh().
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
Okay, I went with drivers/scsi/scsi_transport_api.h. I intentionally
didn't add any banner at the top of the file. Feel free to fill with
appropriate description/blurb.
drivers/scsi/libata-eh.c | 3 ++-
drivers/scsi/libata-scsi.c | 24 ------------------------
drivers/scsi/scsi_error.c | 23 ++++++++++++++++++++++-
drivers/scsi/scsi_priv.h | 1 +
drivers/scsi/scsi_transport_api.h | 6 ++++++
include/scsi/scsi_eh.h | 1 -
6 files changed, 31 insertions(+), 27 deletions(-)
create mode 100644 drivers/scsi/scsi_transport_api.h
6daec98e81a98db0dafc4846a97432746bf94f9c
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index 750e734..71b45ad 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -39,6 +39,7 @@ #include <scsi/scsi_host.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
+#include "scsi_transport_api.h"
#include <linux/libata.h>
@@ -432,7 +433,7 @@ void ata_port_schedule_eh(struct ata_por
WARN_ON(!ap->ops->error_handler);
ap->flags |= ATA_FLAG_EH_PENDING;
- ata_schedule_scsi_eh(ap->host);
+ scsi_schedule_eh(ap->host);
DPRINTK("port EH scheduled\n");
}
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index f036ae4..2007b4b 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -2745,27 +2745,3 @@ void ata_scsi_scan_host(struct ata_port
scsi_scan_target(&ap->host->shost_gendev, 0, i, 0, 0);
}
}
-
-/**
- * ata_schedule_scsi_eh - schedule EH for SCSI host
- * @shost: SCSI host to invoke error handling on.
- *
- * Schedule SCSI EH without scmd. This is a hack.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- **/
-void ata_schedule_scsi_eh(struct Scsi_Host *shost)
-{
- unsigned long flags;
-
- spin_lock_irqsave(shost->host_lock, flags);
-
- if (scsi_host_set_state(shost, SHOST_RECOVERY) == 0 ||
- scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY) == 0) {
- shost->host_eh_scheduled++;
- scsi_eh_wakeup(shost);
- }
-
- spin_unlock_irqrestore(shost->host_lock, flags);
-}
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 9ca71cb..346ab72 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -56,7 +56,28 @@ void scsi_eh_wakeup(struct Scsi_Host *sh
printk("Waking error handler thread\n"));
}
}
-EXPORT_SYMBOL_GPL(scsi_eh_wakeup);
+
+/**
+ * scsi_schedule_eh - schedule EH for SCSI host
+ * @shost: SCSI host to invoke error handling on.
+ *
+ * Schedule SCSI EH without scmd.
+ **/
+void scsi_schedule_eh(struct Scsi_Host *shost)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(shost->host_lock, flags);
+
+ if (scsi_host_set_state(shost, SHOST_RECOVERY) == 0 ||
+ scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY) == 0) {
+ shost->host_eh_scheduled++;
+ scsi_eh_wakeup(shost);
+ }
+
+ spin_unlock_irqrestore(shost->host_lock, flags);
+}
+EXPORT_SYMBOL_GPL(scsi_schedule_eh);
/**
* scsi_eh_scmd_add - add scsi cmd to error handling.
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 0b39081..27c4827 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -63,6 +63,7 @@ extern int scsi_delete_timer(struct scsi
extern void scsi_times_out(struct scsi_cmnd *cmd);
extern int scsi_error_handler(void *host);
extern int scsi_decide_disposition(struct scsi_cmnd *cmd);
+extern void scsi_eh_wakeup(struct Scsi_Host *shost);
extern int scsi_eh_scmd_add(struct scsi_cmnd *, int);
/* scsi_lib.c */
diff --git a/drivers/scsi/scsi_transport_api.h b/drivers/scsi/scsi_transport_api.h
new file mode 100644
index 0000000..934f0e6
--- /dev/null
+++ b/drivers/scsi/scsi_transport_api.h
@@ -0,0 +1,6 @@
+#ifndef _SCSI_TRANSPORT_API_H
+#define _SCSI_TRANSPORT_API_H
+
+void scsi_schedule_eh(struct Scsi_Host *shost);
+
+#endif /* _SCSI_TRANSPORT_API_H */
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 212c983..d160880 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -35,7 +35,6 @@ static inline int scsi_sense_valid(struc
}
-extern void scsi_eh_wakeup(struct Scsi_Host *shost);
extern void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
struct list_head *done_q);
extern void scsi_eh_flush_done_q(struct list_head *done_q);
--
1.3.2
^ permalink raw reply related
* scsi_transport_sas and device hotplug
From: Scott O'Connor @ 2006-05-19 13:29 UTC (permalink / raw)
To: linux-scsi
Hello,
I have a question about this transport layer and SAS Hot plugging.
With a LSI1068 (SAS) card, I'm trying to do device hotplug.
Back in the day I used the /proc calls below to hotplug a device.
scsi remove-single-device <args>
scsi add_single-device <args>
With 2.6.16-1 kernel, the "remove" call below works, the /dev/sd*
structure is removed.
echo scsi remove-single-device 0 07 00 00 > /proc/scsi/scsi
However, this does not add the device back (the /dev/sd* node
is not created):
echo scsi add-single-device 0 07 00 00 > /proc/scsi/scsi
I see the scsi_proc.c to scsi_transport_sas.c user_scan transport
layer code and it seems hooked up properly. Before I debug, has
anyone else seen a problem here?
Thanks for any help,
-Scott.
^ permalink raw reply
* Re: [PATCH] ppa: no highmem pages
From: James Bottomley @ 2006-05-19 15:00 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: scsi, akpm
In-Reply-To: <20060518220744.cb986f3f.rdunlap@xenotime.net>
On Thu, 2006-05-18 at 22:07 -0700, Randy.Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> ppa cannot handle highmem pages, and like imm, which already has
> this patch, the device is slow, so performance is not a big issue,
> so just force pages to be in low memory (hence mapped).
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> ---
> drivers/scsi/ppa.c | 4 ++++
> 1 files changed, 4 insertions(+)
>
> --- linux-2.6.17-rc4.orig/drivers/scsi/ppa.c
> +++ linux-2.6.17-rc4/drivers/scsi/ppa.c
> @@ -997,6 +997,10 @@ static struct scsi_host_template ppa_tem
> .cmd_per_lun = 1,
> .use_clustering = ENABLE_CLUSTERING,
> .can_queue = 1,
> + .unchecked_isa_dma = 1, /* ppa cannot deal with highmem, so
> + * this is an easy trick to ensure
> + * all io pages for this host reside
> + * in low memory */
This is the wrong thing to do. You'll force all allocations for this
device to go through ZONE_DMA, which is a horrifically constrained
resource at 16MB. If it can take anything in lowmem because the driver
is unconverted, then you want it to specify BLK_BOUNCE_HIGH as the queue
limit.
James
^ permalink raw reply
* [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check
From: Ju, Seokmann @ 2006-05-19 15:09 UTC (permalink / raw)
To: Vasily Averin, James Bottomley, Andrew Morton; +Cc: linux-scsi, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 6626 bytes --]
Hi,
This patch contains a fix for 64-bit DMA capability check in
megaraid_{mm,mbox} driver. With patch, the driver access PCI
configuration space with dedicated offset to read a signature. If the
signature read, it means that the controller has capability to handle
64-bit DMA. Before this patch, the driver blindly claimed the capability
without checking with controller.
The issue has been reported by Vasily Averin [vvs@sw.ru]. Thank you
Vasily for the reporting.
Thank you,
Seokmann
Signed-Off By: Seokmann Ju <seokmann.ju@lsil.com>
---
diff -Naur old/Documentation/scsi/ChangeLog.megaraid
new/Documentation/scsi/ChangeLog.megaraid
--- old/Documentation/scsi/ChangeLog.megaraid 2006-05-19
08:58:26.000000000 -0400
+++ new/Documentation/scsi/ChangeLog.megaraid 2006-05-19
09:22:48.000000000 -0400
@@ -1,3 +1,64 @@
+Release Date : Fri May 19 09:31:45 EST 2006 - Seokmann Ju
<sju@lsil.com>
+Current Version : 2.20.4.9 (scsi module), 2.20.2.6 (cmm module)
+Older Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
+
+1. Fixed a bug in megaraid_init_mbox().
+ Customer reported "garbage in file on x86_64 platform".
+ Root Cause: the driver registered controllers as 64-bit DMA
capable
+ for those which are not support it.
+ Fix: Made change in the function inserting identification
machanism
+ identifying 64-bit DMA capable controllers.
+
+ > -----Original Message-----
+ > From: Vasily Averin [mailto:vvs@sw.ru]
+ > Sent: Thursday, May 04, 2006 2:49 PM
+ > To: linux-scsi@vger.kernel.org; Kolli, Neela; Mukker, Atul;
+ > Ju, Seokmann; Bagalkote, Sreenivas;
+ > James.Bottomley@SteelEye.com; devel@openvz.org
+ > Subject: megaraid_mbox: garbage in file
+ >
+ > Hello all,
+ >
+ > I've investigated customers claim on the unstable work of
+ > their node and found a
+ > strange effect: reading from some files leads to the
+ > "attempt to access beyond end of device" messages.
+ >
+ > I've checked filesystem, memory on the node, motherboard BIOS
+ > version, but it
+ > does not help and issue still has been reproduced by simple
+ > file reading.
+ >
+ > Reproducer is simple:
+ >
+ > echo 0xffffffff >/proc/sys/dev/scsi/logging_level ;
+ > cat /vz/private/101/root/etc/ld.so.cache >/tmp/ttt ;
+ > echo 0 >/proc/sys/dev/scsi/logging
+ >
+ > It leads to the following messages in dmesg
+ >
+ > sd_init_command: disk=sda, block=871769260, count=26
+ > sda : block=871769260
+ > sda : reading 26/26 512 byte blocks.
+ > scsi_add_timer: scmd: f79ed980, time: 7500, (c02b1420)
+ > sd 0:1:0:0: send 0xf79ed980 sd 0:1:0:0:
+ > command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+ > buffer = 0xf7cfb540, bufflen = 13312, done = 0xc0366b40,
+ > queuecommand 0xc0344010
+ > leaving scsi_dispatch_cmnd()
+ > scsi_delete_timer: scmd: f79ed980, rtn: 1
+ > sd 0:1:0:0: done 0xf79ed980 SUCCESS 0 sd 0:1:0:0:
+ > command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+ > scsi host busy 1 failed 0
+ > sd 0:1:0:0: Notifying upper driver of completion (result 0)
+ > sd_rw_intr: sda: res=0x0
+ > 26 sectors total, 13312 bytes done.
+ > use_sg is 4
+ > attempt to access beyond end of device
+ > sda6: rw=0, want=1044134458, limit=951401367
+ > Buffer I/O error on device sda6, logical block 522067228
+ > attempt to access beyond end of device
+
Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju
<sju@lsil.com>
Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
diff -Naur old/drivers/scsi/megaraid/mega_common.h
new/drivers/scsi/megaraid/mega_common.h
--- old/drivers/scsi/megaraid/mega_common.h 2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/mega_common.h 2006-05-19
09:51:48.000000000 -0400
@@ -37,7 +37,8 @@
#define LSI_MAX_CHANNELS 16
#define LSI_MAX_LOGICAL_DRIVES_64LD (64+1)
-
+#define HBA_SIGNATURE_64BIT 0x0299
+#define PCI_CONF_AMISIG64 0xa4
/**
* scb_t - scsi command control block
* @param ccb : command control block for individual driver
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.c
new/drivers/scsi/megaraid/megaraid_mbox.c
--- old/drivers/scsi/megaraid/megaraid_mbox.c 2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.c 2006-05-19
10:52:11.000000000 -0400
@@ -10,7 +10,7 @@
* 2 of the License, or (at your option) any later version.
*
* FILE : megaraid_mbox.c
- * Version : v2.20.4.8 (Apr 11 2006)
+ * Version : v2.20.4.9 (May 19 2006)
*
* Authors:
* Atul Mukker <Atul.Mukker@lsil.com>
@@ -720,7 +720,7 @@
struct pci_dev *pdev;
mraid_device_t *raid_dev;
int i;
-
+ unsigned int magic64;
adapter->ito = MBOX_TIMEOUT;
pdev = adapter->pdev;
@@ -863,12 +863,25 @@
// Set the DMA mask to 64-bit. All supported controllers as
capable of
// DMA in this range
- if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+ pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64,
&magic64);
- con_log(CL_ANN, (KERN_WARNING
- "megaraid: could not set DMA mask for
64-bit.\n"));
+ if ((magic64 == HBA_SIGNATURE_64BIT) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+ adapter->pdev->device ==
PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+ adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)
||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
+ if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) !=
0) {
+ con_log(CL_ANN, (KERN_WARNING
+ "megaraid: could not set DMA mask for
64-bit.\n"));
- goto out_free_sysfs_res;
+ goto out_free_sysfs_res;
+ }
}
// setup tasklet for DPC
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.h
new/drivers/scsi/megaraid/megaraid_mbox.h
--- old/drivers/scsi/megaraid/megaraid_mbox.h 2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.h 2006-05-19
10:22:13.000000000 -0400
@@ -21,8 +21,8 @@
#include "megaraid_ioctl.h"
-#define MEGARAID_VERSION "2.20.4.8"
-#define MEGARAID_EXT_VERSION "(Release Date: Mon Apr 11 12:27:22 EST
2006)"
+#define MEGARAID_VERSION "2.20.4.9"
+#define MEGARAID_EXT_VERSION "(Release Date: Fri May 19 09:45:22 EST
2006)"
/*
---
[-- Attachment #2: megaraid_mm_mbox_64bit_dma_check.patch --]
[-- Type: application/octet-stream, Size: 5888 bytes --]
diff -Naur old/Documentation/scsi/ChangeLog.megaraid new/Documentation/scsi/ChangeLog.megaraid
--- old/Documentation/scsi/ChangeLog.megaraid 2006-05-19 08:58:26.000000000 -0400
+++ new/Documentation/scsi/ChangeLog.megaraid 2006-05-19 09:22:48.000000000 -0400
@@ -1,3 +1,64 @@
+Release Date : Fri May 19 09:31:45 EST 2006 - Seokmann Ju <sju@lsil.com>
+Current Version : 2.20.4.9 (scsi module), 2.20.2.6 (cmm module)
+Older Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
+
+1. Fixed a bug in megaraid_init_mbox().
+ Customer reported "garbage in file on x86_64 platform".
+ Root Cause: the driver registered controllers as 64-bit DMA capable
+ for those which are not support it.
+ Fix: Made change in the function inserting identification machanism
+ identifying 64-bit DMA capable controllers.
+
+ > -----Original Message-----
+ > From: Vasily Averin [mailto:vvs@sw.ru]
+ > Sent: Thursday, May 04, 2006 2:49 PM
+ > To: linux-scsi@vger.kernel.org; Kolli, Neela; Mukker, Atul;
+ > Ju, Seokmann; Bagalkote, Sreenivas;
+ > James.Bottomley@SteelEye.com; devel@openvz.org
+ > Subject: megaraid_mbox: garbage in file
+ >
+ > Hello all,
+ >
+ > I've investigated customers claim on the unstable work of
+ > their node and found a
+ > strange effect: reading from some files leads to the
+ > "attempt to access beyond end of device" messages.
+ >
+ > I've checked filesystem, memory on the node, motherboard BIOS
+ > version, but it
+ > does not help and issue still has been reproduced by simple
+ > file reading.
+ >
+ > Reproducer is simple:
+ >
+ > echo 0xffffffff >/proc/sys/dev/scsi/logging_level ;
+ > cat /vz/private/101/root/etc/ld.so.cache >/tmp/ttt ;
+ > echo 0 >/proc/sys/dev/scsi/logging
+ >
+ > It leads to the following messages in dmesg
+ >
+ > sd_init_command: disk=sda, block=871769260, count=26
+ > sda : block=871769260
+ > sda : reading 26/26 512 byte blocks.
+ > scsi_add_timer: scmd: f79ed980, time: 7500, (c02b1420)
+ > sd 0:1:0:0: send 0xf79ed980 sd 0:1:0:0:
+ > command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+ > buffer = 0xf7cfb540, bufflen = 13312, done = 0xc0366b40,
+ > queuecommand 0xc0344010
+ > leaving scsi_dispatch_cmnd()
+ > scsi_delete_timer: scmd: f79ed980, rtn: 1
+ > sd 0:1:0:0: done 0xf79ed980 SUCCESS 0 sd 0:1:0:0:
+ > command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+ > scsi host busy 1 failed 0
+ > sd 0:1:0:0: Notifying upper driver of completion (result 0)
+ > sd_rw_intr: sda: res=0x0
+ > 26 sectors total, 13312 bytes done.
+ > use_sg is 4
+ > attempt to access beyond end of device
+ > sda6: rw=0, want=1044134458, limit=951401367
+ > Buffer I/O error on device sda6, logical block 522067228
+ > attempt to access beyond end of device
+
Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com>
Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
diff -Naur old/drivers/scsi/megaraid/mega_common.h new/drivers/scsi/megaraid/mega_common.h
--- old/drivers/scsi/megaraid/mega_common.h 2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/mega_common.h 2006-05-19 09:51:48.000000000 -0400
@@ -37,7 +37,8 @@
#define LSI_MAX_CHANNELS 16
#define LSI_MAX_LOGICAL_DRIVES_64LD (64+1)
-
+#define HBA_SIGNATURE_64BIT 0x0299
+#define PCI_CONF_AMISIG64 0xa4
/**
* scb_t - scsi command control block
* @param ccb : command control block for individual driver
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.c new/drivers/scsi/megaraid/megaraid_mbox.c
--- old/drivers/scsi/megaraid/megaraid_mbox.c 2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.c 2006-05-19 10:52:11.000000000 -0400
@@ -10,7 +10,7 @@
* 2 of the License, or (at your option) any later version.
*
* FILE : megaraid_mbox.c
- * Version : v2.20.4.8 (Apr 11 2006)
+ * Version : v2.20.4.9 (May 19 2006)
*
* Authors:
* Atul Mukker <Atul.Mukker@lsil.com>
@@ -720,7 +720,7 @@
struct pci_dev *pdev;
mraid_device_t *raid_dev;
int i;
-
+ unsigned int magic64;
adapter->ito = MBOX_TIMEOUT;
pdev = adapter->pdev;
@@ -863,12 +863,25 @@
// Set the DMA mask to 64-bit. All supported controllers as capable of
// DMA in this range
- if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+ pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64, &magic64);
- con_log(CL_ANN, (KERN_WARNING
- "megaraid: could not set DMA mask for 64-bit.\n"));
+ if ((magic64 == HBA_SIGNATURE_64BIT) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+ adapter->pdev->device == PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+ adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK) ||
+ (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+ adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
+ if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+ con_log(CL_ANN, (KERN_WARNING
+ "megaraid: could not set DMA mask for 64-bit.\n"));
- goto out_free_sysfs_res;
+ goto out_free_sysfs_res;
+ }
}
// setup tasklet for DPC
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.h new/drivers/scsi/megaraid/megaraid_mbox.h
--- old/drivers/scsi/megaraid/megaraid_mbox.h 2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.h 2006-05-19 10:22:13.000000000 -0400
@@ -21,8 +21,8 @@
#include "megaraid_ioctl.h"
-#define MEGARAID_VERSION "2.20.4.8"
-#define MEGARAID_EXT_VERSION "(Release Date: Mon Apr 11 12:27:22 EST 2006)"
+#define MEGARAID_VERSION "2.20.4.9"
+#define MEGARAID_EXT_VERSION "(Release Date: Fri May 19 09:45:22 EST 2006)"
/*
^ permalink raw reply
* Re: scsi_transport_sas and device hotplug
From: James Bottomley @ 2006-05-19 15:49 UTC (permalink / raw)
To: Scott O'Connor; +Cc: linux-scsi
In-Reply-To: <446DC84B.1070203@sanblaze.com>
On Fri, 2006-05-19 at 09:29 -0400, Scott O'Connor wrote:
> With a LSI1068 (SAS) card, I'm trying to do device hotplug.
> Back in the day I used the /proc calls below to hotplug a device.
>
> scsi remove-single-device <args>
> scsi add_single-device <args>
>
> With 2.6.16-1 kernel, the "remove" call below works, the /dev/sd*
> structure is removed.
>
> echo scsi remove-single-device 0 07 00 00 > /proc/scsi/scsi
>
> However, this does not add the device back (the /dev/sd* node
> is not created):
>
> echo scsi add-single-device 0 07 00 00 > /proc/scsi/scsi
>
> I see the scsi_proc.c to scsi_transport_sas.c user_scan transport
> layer code and it seems hooked up properly. Before I debug, has
> anyone else seen a problem here?
Actually, when I try this with 2.6.17-rc4, I get a BUG triggered in the
transport class at line 579 ... it's finding the wrong device in the
user_scan callback.
Does this attached patch fix it for you?
James
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Hos
list_for_each_entry(rphy, &sas_host->rphy_list, list) {
struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
- if (rphy->scsi_target_id == -1)
+ if (rphy->identify.device_type != SAS_END_DEVICE ||
+ rphy->scsi_target_id == -1)
continue;
if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&
^ permalink raw reply
* Re: [PATCH] ppa: no highmem pages
From: Randy.Dunlap @ 2006-05-19 16:08 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, akpm
In-Reply-To: <1148050838.3410.32.camel@mulgrave.il.steeleye.com>
On Fri, 19 May 2006 10:00:38 -0500 James Bottomley wrote:
> This is the wrong thing to do. You'll force all allocations for this
> device to go through ZONE_DMA, which is a horrifically constrained
> resource at 16MB. If it can take anything in lowmem because the driver
> is unconverted, then you want it to specify BLK_BOUNCE_HIGH as the queue
> limit.
OK, I think I have ppa like imm now.
From: Randy Dunlap <rdunlap@xenotime.net>
ppa cannot handle highmem pages, and like imm, which already has
this patch, the device is slow, so performance is not a big issue,
so just force pages to be in low memory (hence mapped).
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
drivers/scsi/ppa.c | 11 +++++++++++
1 files changed, 11 insertions(+)
--- linux-2.6.17-rc4.orig/drivers/scsi/ppa.c
+++ linux-2.6.17-rc4/drivers/scsi/ppa.c
@@ -982,6 +982,12 @@ static int device_check(ppa_struct *dev)
return -ENODEV;
}
+static int ppa_adjust_queue(struct scsi_device *device)
+{
+ blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
+ return 0;
+}
+
static struct scsi_host_template ppa_template = {
.module = THIS_MODULE,
.proc_name = "ppa",
@@ -997,6 +1003,11 @@ static struct scsi_host_template ppa_tem
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
.can_queue = 1,
+ .slave_alloc = ppa_adjust_queue,
+ .unchecked_isa_dma = 1, /* ppa cannot deal with highmem, so
+ * this is an easy trick to ensure
+ * all io pages for this host reside
+ * in low memory */
};
/***************************************************************************
---
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox