From 1544d67738c864245b8a061fb72093daeea8d4f1 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 20 Feb 2007 11:17:03 -0800 Subject: [SCSI] fusion: kernel-doc warning fixes Fix kernel-doc warnings in fusion driver code. Signed-off-by: Randy Dunlap Acked-by: "Moore, Eric" Signed-off-by: James Bottomley --- drivers/message/fusion/mptbase.c | 22 +++++++--------------- drivers/message/fusion/mptscsih.c | 15 ++++++++++----- drivers/message/fusion/mptspi.c | 11 +++++------ 3 files changed, 22 insertions(+), 26 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 083acfd91d8..0a2d7db7b63 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -4739,12 +4739,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) } /** - * mpt_inactive_raid_list_free - * - * This clears this link list. - * - * @ioc - pointer to per adapter structure - * + * mpt_inactive_raid_list_free - This clears this link list. + * @ioc : pointer to per adapter structure **/ static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) @@ -4764,15 +4760,11 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) } /** - * mpt_inactive_raid_volumes - * - * This sets up link list of phy_disk_nums for devices belonging in an inactive volume - * - * @ioc - pointer to per adapter structure - * @channel - volume channel - * @id - volume target id - * + * mpt_inactive_raid_volumes - sets up link list of phy_disk_nums for devices belonging in an inactive volume * + * @ioc : pointer to per adapter structure + * @channel : volume channel + * @id : volume target id **/ static void mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) @@ -6663,7 +6655,7 @@ union loginfo_type { /** * mpt_iocstatus_info_config - IOCSTATUS information for config pages * @ioc: Pointer to MPT_ADAPTER structure - * ioc_status: U32 IOCStatus word from IOC + * @ioc_status: U32 IOCStatus word from IOC * @mf: Pointer to MPT request frame * * Refer to lsi/mpi.h. diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 2a3e9e66d4e..eef00ed139b 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -1537,21 +1537,23 @@ mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** * mptscsih_TMHandler - Generic handler for SCSI Task Management. - * Fall through to mpt_HardResetHandler if: not operational, too many - * failed TM requests or handshake failure. - * - * @ioc: Pointer to MPT_ADAPTER structure + * @hd: Pointer to MPT SCSI HOST structure * @type: Task Management type + * @channel: channel number for task management * @id: Logical Target ID for reset (if appropriate) * @lun: Logical Unit for reset (if appropriate) * @ctx2abort: Context for the task to be aborted (if appropriate) + * @timeout: timeout for task management control + * + * Fall through to mpt_HardResetHandler if: not operational, too many + * failed TM requests or handshake failure. * * Remark: Currently invoked from a non-interrupt thread (_bh). * * Remark: With old EH code, at most 1 SCSI TaskMgmt function per IOC * will be active. * - * Returns 0 for SUCCESS, or FAILED. + * Returns 0 for SUCCESS, or %FAILED. **/ int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout) @@ -1650,9 +1652,11 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int c * mptscsih_IssueTaskMgmt - Generic send Task Management function. * @hd: Pointer to MPT_SCSI_HOST structure * @type: Task Management type + * @channel: channel number for task management * @id: Logical Target ID for reset (if appropriate) * @lun: Logical Unit for reset (if appropriate) * @ctx2abort: Context for the task to be aborted (if appropriate) + * @timeout: timeout for task management control * * Remark: _HardResetHandler can be invoked from an interrupt thread (timer) * or a non-interrupt thread. In the former, must not call schedule(). @@ -2022,6 +2026,7 @@ mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd) /** * mptscsih_tm_wait_for_completion - wait for completion of TM task * @hd: Pointer to MPT host structure. + * @timeout: timeout value * * Returns {SUCCESS,FAILED}. */ diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 85f21b54cb7..755dec6b7ac 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -96,14 +96,13 @@ static int mptspiTaskCtx = -1; static int mptspiInternalCtx = -1; /* Used only for internal commands */ /** - * mptspi_setTargetNegoParms - Update the target negotiation - * parameters based on the the Inquiry data, adapter capabilities, - * and NVRAM settings - * + * mptspi_setTargetNegoParms - Update the target negotiation parameters * @hd: Pointer to a SCSI Host Structure - * @vtarget: per target private data + * @target: per target private data * @sdev: SCSI device * + * Update the target negotiation parameters based on the the Inquiry + * data, adapter capabilities, and NVRAM settings. **/ static void mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, @@ -234,7 +233,7 @@ mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, /** * mptspi_writeIOCPage4 - write IOC Page 4 * @hd: Pointer to a SCSI Host Structure - * @channel: + * @channel: channel number * @id: write IOC Page4 for this ID & Bus * * Return: -EAGAIN if unable to obtain a Message Frame -- cgit v1.2.3 From a1f9ce056a1875b6c8633f370df4fb169b925b16 Mon Sep 17 00:00:00 2001 From: Horms Date: Fri, 16 Mar 2007 16:05:22 +0900 Subject: [SCSI] fusion: remove unnecessary code in mptscsih_resume() It seems that most of the code in mptscsih_resume() doesn't do anything. This patch removes that code. Signed-off-by: Simon Horman Acked-by: "Moore, Eric" Signed-off-by: James Bottomley --- drivers/message/fusion/mptscsih.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index eef00ed139b..10927e34c2b 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -1188,19 +1188,7 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) int mptscsih_resume(struct pci_dev *pdev) { - MPT_ADAPTER *ioc = pci_get_drvdata(pdev); - struct Scsi_Host *host = ioc->sh; - MPT_SCSI_HOST *hd; - mpt_resume(pdev); - - if(!host) - return 0; - - hd = (MPT_SCSI_HOST *)host->hostdata; - if(!hd) - return 0; - return 0; } -- cgit v1.2.3 From b364fd5081b02fa8a966a29eea2da628913fd4b8 Mon Sep 17 00:00:00 2001 From: Horms Date: Mon, 19 Mar 2007 15:06:44 +0900 Subject: [SCSI] fusion: honour return value of pci_enable_device() in mpt_resume() Honour the return value of pci_enable_device(), which seems to be a desirable thing to do: 2.6.20-rc4 gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) CC [M] drivers/message/fusion/mptbase.o drivers/message/fusion/mptbase.c: In function `mpt_resume': drivers/message/fusion/mptbase.c:1541: warning: ignoring return value of `pci_enable_device', declared with attribute warn_unused_result It also in turn has mptscsih_resume() honour the return value of mpt_resume() I'm not sure about the handling of the other potential error cases in mpt_resume(), of which there appear to be many. But this does seem to be a good start. Signed-off-by: Simon Horman Acked-by: "Moore, Eric" Signed-off-by: James Bottomley --- drivers/message/fusion/mptbase.c | 5 ++++- drivers/message/fusion/mptscsih.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 0a2d7db7b63..97471af4309 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1531,6 +1531,7 @@ mpt_resume(struct pci_dev *pdev) MPT_ADAPTER *ioc = pci_get_drvdata(pdev); u32 device_state = pdev->current_state; int recovery_state; + int err; printk(MYIOC_s_INFO_FMT "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", @@ -1538,7 +1539,9 @@ mpt_resume(struct pci_dev *pdev) pci_set_power_state(pdev, 0); pci_restore_state(pdev); - pci_enable_device(pdev); + err = pci_enable_device(pdev); + if (err) + return err; /* enable interrupts */ CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 10927e34c2b..537fcc221c9 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -1188,8 +1188,7 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) int mptscsih_resume(struct pci_dev *pdev) { - mpt_resume(pdev); - return 0; + return mpt_resume(pdev); } #endif -- cgit v1.2.3 From ad8c31bb69d60c0c6bc6431bccdf67e5a96c0d31 Mon Sep 17 00:00:00 2001 From: Eric Moore Date: Mon, 19 Mar 2007 10:31:51 -0600 Subject: [SCSI] fusion: remove VMWare guest OS remounted as read only work around This address the issue of VMWare guest OS being remounted as read-only becuase the underlying device was held busy too long and at the same time address Engenio MPP driver concerns over infinite retries. This patch removes the code that snoops the SAM STATUS on busy, which would be returning DID_BUS_BUSY, instead we return the status as is. Retry hanlding seems to be properly handled in scsi_softirq_done, where a busy sam status would only occurr for the time specified by (cmd->allowed +1) * cmd->timeout_per_command. Signed-off-by: Eric Moore Signed-off-by: James Bottomley --- drivers/message/fusion/mptscsih.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 537fcc221c9..fa0f7761652 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -819,10 +819,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) sc->resid=0; case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ - if (scsi_status == MPI_SCSI_STATUS_BUSY) - sc->result = (DID_BUS_BUSY << 16) | scsi_status; - else - sc->result = (DID_OK << 16) | scsi_status; + sc->result = (DID_OK << 16) | scsi_status; if (scsi_state == 0) { ; } else if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) { -- cgit v1.2.3 From 301b01aa621305e8d59a2eb948b4ad7bf26be86e Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 26 Mar 2007 21:59:46 -0800 Subject: [SCSI] fusion: make mptspi_target_destroy() static Signed-off-by: Adrian Bunk Acked-by: Eric Moore Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- drivers/message/fusion/mptspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 755dec6b7ac..b08416f84ed 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -445,7 +445,7 @@ static int mptspi_target_alloc(struct scsi_target *starget) return 0; } -void +static void mptspi_target_destroy(struct scsi_target *starget) { if (starget->hostdata) -- cgit v1.2.3 From 7297824581755593535fc97d2c8b6c47e2dc2db6 Mon Sep 17 00:00:00 2001 From: Eric Moore Date: Wed, 7 Feb 2007 16:51:40 -0700 Subject: [SCSI] fusion: fix domain validation loops After host reset, the device are programmed to default asyn narrow nego. We need to reprogram the parameter back to previous values. If the host reset is called as a result of spi_dv_device() commands timing out, its possible to get into an infinite loop of dv to host reset. This will prevent that case, as we merely program old values. If host reset is called outside context of domain validation, then we can call spi_dv_device. Signed-off-by: Eric Moore Signed-off-by: James Bottomley --- drivers/message/fusion/mptbase.h | 1 + drivers/message/fusion/mptspi.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index e3a39272aad..d25d3be8fcd 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -994,6 +994,7 @@ typedef struct _MPT_SCSI_HOST { int scandv_wait_done; long last_queue_full; u16 tm_iocstatus; + u16 spi_pending; struct list_head target_reset_list; } MPT_SCSI_HOST; diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index b08416f84ed..d75f7ffbb02 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -676,7 +676,9 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd, return; } + hd->spi_pending |= (1 << sdev->id); spi_dv_device(sdev); + hd->spi_pending &= ~(1 << sdev->id); if (sdev->channel == 1 && mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0) @@ -1202,11 +1204,27 @@ mptspi_dv_renegotiate_work(struct work_struct *work) container_of(work, struct work_queue_wrapper, work); struct _MPT_SCSI_HOST *hd = wqw->hd; struct scsi_device *sdev; + struct scsi_target *starget; + struct _CONFIG_PAGE_SCSI_DEVICE_1 pg1; + u32 nego; kfree(wqw); - shost_for_each_device(sdev, hd->ioc->sh) - mptspi_dv_device(hd, sdev); + if (hd->spi_pending) { + shost_for_each_device(sdev, hd->ioc->sh) { + if (hd->spi_pending & (1 << sdev->id)) + continue; + starget = scsi_target(sdev); + nego = mptspi_getRP(starget); + pg1.RequestedParameters = cpu_to_le32(nego); + pg1.Reserved = 0; + pg1.Configuration = 0; + mptspi_write_spi_device_pg1(starget, &pg1); + } + } else { + shost_for_each_device(sdev, hd->ioc->sh) + mptspi_dv_device(hd, sdev); + } } static void @@ -1452,6 +1470,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) init_waitqueue_head(&hd->scandv_waitq); hd->scandv_wait_done = 0; hd->last_queue_full = 0; + hd->spi_pending = 0; /* Some versions of the firmware don't support page 0; without * that we can't get the parameters */ -- cgit v1.2.3