summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
Commit message (Collapse)AuthorAgeFilesLines
* [SCSI] qla2xxx: Enhanced the dump routines to capture multiple request and ↵Giridhar Malavali2012-02-193-3/+105
| | | | | | | | response queues. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] aacraid: Added Sync.mode to support series 7/8/9 controllersMahesh Rajashekhara2012-02-198-63/+338
| | | | | | | | | | Added Sync. mode to support Series 7/8/9 controller families: This is a compatibility mode for all these controller families. The Async. (Performance) mode can be changed in the future. First Async. mode version added for Series 7; Controller parameter aac_sync_mode added Signed-off-by: Mahesh Rajashekhara <aacraid@pmc-sierra.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2i: Fixed the override of the error_mask module paramEddie Wai2012-02-192-6/+10
| | | | | | | | | | | | The error_mask module param overrides has a bug which prevented the new module param values to take effect. Also changed the type attribute of the error_mask1/2 module params from int to uint to allow the MSB to be set. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2i: use kthread_create_on_node()Eric Dumazet2012-02-191-2/+3
| | | | | | | | | bnx2i_percpu_thread_create() create per cpu kthread, and should use proper NUMA aware API. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bfa: don't leak mem in bfad_im_bsg_els_ct_request()Jesper Juhl2012-02-191-2/+2
| | | | | | | | | | | | | | | If 'drv_fcxp = kzalloc(sizeof(struct bfad_fcxp), GFP_KERNEL);' fails and returns NULL, then we'll leak the memory allocated to 'bsg_fcpt' when we jump to 'out:' and the variable subsequently goes out of scope. Also remove the cast of the kzalloc() return value. kzalloc() returns a void* which is implicitly converted, so the explicit cast is pointless. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] isci: enable clock gatingMarcin Tomczak2012-02-192-2/+34
| | | | | | | | | | | | Enabling clock gating for power savings on entry to controller ready state. Disable SCU clock gating for power savings on exit from the controller ready state. The gating is fully automated by silicon after setting the mode. Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] libiscsi: fix cmd timeout/completion raceMike Christie2012-02-191-10/+10
| | | | | | | | | | | | | | | | If the driver/lib has called scsi_done and cleaned up internally but scsi layer has not yet called blk_mark_rq_complete when the command times out we hit a problem if the timeout code calls blk_mark_rq_complete first. When the time out code calls into the driver we were returning BLK_EH_RESET_TIMER and that causes the timeout code to just call us again later. We need to be calling BLK_EH_HANDLED so the timeout code can complete the completion process because it had called blk_mark_rq_complete on the command and now owns its processing. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] libiscsi_tcp: fix max_r2t manipulationMike Christie2012-02-194-24/+22
| | | | | | | | | | Problem description from Xi Wang: A large max_r2t could lead to integer overflow in subsequent call to iscsi_tcp_r2tpool_alloc(), allocating a smaller buffer than expected and leading to out-of-bounds write. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] iscsi: fix setting of pid from netlink skbMike Christie2012-02-191-2/+2
| | | | | | | | | | | NETLINK_CREDS's pid now returns 0, so I guess we are supposed to be using NETLINK_CB. This changed while the patch to export the pid was getting merged upstream, so it was not noticed until both the network and iscsi changes were in the same tree. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] iscsi: don't hang in endless loop if no targets presentSasha Levin2012-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iscsi_if_send_reply() may return -ESRCH if there were no targets to send data to. Currently we're ignoring this value and looping in attempt to do it over and over, which will usually lead in a hung task like this one: [ 4920.817298] INFO: task trinity:9074 blocked for more than 120 seconds. [ 4920.818527] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 4920.819982] trinity D 0000000000000000 5504 9074 2756 0x00000004 [ 4920.825374] ffff880003961a98 0000000000000086 ffff8800001aa000 ffff8800001aa000 [ 4920.826791] 00000000001d4340 ffff880003961fd8 ffff880003960000 00000000001d4340 [ 4920.828241] 00000000001d4340 00000000001d4340 ffff880003961fd8 00000000001d4340 [ 4920.833231] [ 4920.833519] Call Trace: [ 4920.834010] [<ffffffff826363fa>] schedule+0x3a/0x50 [ 4920.834953] [<ffffffff82634ac9>] __mutex_lock_common+0x209/0x5b0 [ 4920.836226] [<ffffffff81af805d>] ? iscsi_if_rx+0x2d/0x990 [ 4920.837281] [<ffffffff81053943>] ? sched_clock+0x13/0x20 [ 4920.838305] [<ffffffff81af805d>] ? iscsi_if_rx+0x2d/0x990 [ 4920.839336] [<ffffffff82634eb0>] mutex_lock_nested+0x40/0x50 [ 4920.840423] [<ffffffff81af805d>] iscsi_if_rx+0x2d/0x990 [ 4920.841434] [<ffffffff810dffed>] ? sub_preempt_count+0x9d/0xd0 [ 4920.842548] [<ffffffff82637bb0>] ? _raw_read_unlock+0x30/0x60 [ 4920.843666] [<ffffffff821f71de>] netlink_unicast+0x1ae/0x1f0 [ 4920.844751] [<ffffffff821f7997>] netlink_sendmsg+0x227/0x350 [ 4920.845850] [<ffffffff821857bd>] ? sock_update_netprioidx+0xdd/0x1b0 [ 4920.847060] [<ffffffff82185732>] ? sock_update_netprioidx+0x52/0x1b0 [ 4920.848276] [<ffffffff8217f226>] sock_aio_write+0x166/0x180 [ 4920.849348] [<ffffffff810dfe41>] ? get_parent_ip+0x11/0x50 [ 4920.850428] [<ffffffff811d0d9a>] do_sync_write+0xda/0x120 [ 4920.851465] [<ffffffff810dffed>] ? sub_preempt_count+0x9d/0xd0 [ 4920.852579] [<ffffffff810dfe41>] ? get_parent_ip+0x11/0x50 [ 4920.853608] [<ffffffff81791887>] ? security_file_permission+0x27/0xb0 [ 4920.854821] [<ffffffff811d0f4c>] vfs_write+0x16c/0x180 [ 4920.855781] [<ffffffff811d104f>] sys_write+0x4f/0xa0 [ 4920.856798] [<ffffffff82638e79>] system_call_fastpath+0x16/0x1b [ 4920.877487] 1 lock held by trinity/9074: [ 4920.878239] #0: (rx_queue_mutex){+.+...}, at: [<ffffffff81af805d>] iscsi_if_rx+0x2d/0x990 [ 4920.880005] Kernel panic - not syncing: hung_task: blocked tasks Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] fix the new host byte settings (DID_TARGET_FAILURE and DID_NEXUS_FAILURE)Moger, Babu2012-02-192-4/+4
| | | | | | | | | | | | | | | | | | This patch fixes the host byte settings DID_TARGET_FAILURE and DID_NEXUS_FAILURE. The function __scsi_error_from_host_byte, tries to reset the host byte to DID_OK. But that does not happen because of the OR operation. Here is the flow. scsi_softirq_done-> scsi_decide_disposition -> __scsi_error_from_host_byte Let's take an example with DID_NEXUS_FAILURE. In scsi_decide_disposition, result will be set as DID_NEXUS_FAILURE (=0x11). Then in __scsi_error_from_host_byte, when we do OR with DID_OK. Purpose is to reset it back to DID_OK. But that does not happen. This patch fixes this issue. Signed-off-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2fc: Bumped version to 1.0.10Bhanu Prakash Gollapudi2012-02-192-2/+2
| | | | | Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2fc: NPIV ports go offline when interface is brought down & upBhanu Prakash Gollapudi2012-02-192-2/+11
| | | | | | | | | | | | When there are 255 NPIV ports, and the interface is brought down & up, both physical and NPIV ports are logged off and never logged back in. Since discovery happens on single CPU, XID resources on that CPU will be limited, which when exhausted the discovery fails. Increase the XID resource range to ensure that the discovery completes successfully. Also ensure that fc_exch_mgr_alloc() doesn't fail on the system that has lower number of CPUs. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2fc: Handle LOGO flooding from the targetBhanu Prakash Gollapudi2012-02-192-2/+4
| | | | | | | | | | Host drops sessions when flood of unsolicited LOGOs are received from the target. Because of unsufficient PLOGI retries, upon exceeding the retry count of 3, the target sessions are dropped. Increased the retry count to 255 to allow sufficient retries in this scenario. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] bnx2fc: fix panic in bnx2fc_post_io_reqBhanu Prakash Gollapudi2012-02-191-2/+3
| | | | | | | | | System panics while accessing stale pointer - timer_work_queue - in the IO path before bnx2fc_stop is called. Fix is to destroy the workqueue after the destroy operation is complete. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] fcoe: Allow exposing FDMI attributes via sysfsNeerav Parikh2012-02-191-0/+8
| | | | | | | | | | Allow FDMI attributes to be exposed via the fc_host class object for the fcoe driver. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] fcoe: Add support for FDMI in fcoeNeerav Parikh2012-02-191-0/+82
| | | | | | | | | | This adds support for updating the FC-GS FDMI attributes in the fcoe driver. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] libfc: Add support for FDMINeerav Parikh2012-02-191-3/+224
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Fabric Device Management Interface as per FC-GS-4 spec. in libfc. Any driver making use of libfc can enable fdmi state machine for a given lport. If lport has enabled FDMI support the lport state machine will transition into FDMI after completing the DNS states and before entering the SCR state. The FDMI state transition is such that if there is an error, it won't stop the lport state machine from transitioning and the it will behave as if there was no FDMI support. The FDMI HBA attributes are registed with the Management server via Register HBA (RHBA) command and the port attributes are reigstered using the Register Port(RPA) command. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] libfc: Make the libfc Common Transport(CT) code genericNeerav Parikh2012-02-191-2/+1
| | | | | | | | | | | | Currently the libfc Common Transport(CT) calls assume that the CT requests are Name Server specific only. This patch makes it more flexible to allow more FC-GS services to make use of these routines. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] scsi_transport_fc: Add FDMI host attributesNeerav Parikh2012-02-191-1/+29
| | | | | | | | | | | | | This adds FC-GS Fabric Device Management Interface (FDMI) related attributes to fc_host_attr structure. This is in preparation for allowing FDMI attributes to be registered via libfc. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: use find_first_zero_bitAkinobu Mita2012-02-191-10/+8
| | | | | | | | | | | | Use find_first_zero_bit to find the first cleared bit in a memory region. This also includes the following minor changes. - Use bitmap_zero - Reduce unnecessary atomic bitops usage Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] scsi_debug: GET LBA STATUS response length correctionDouglas Gilbert2012-02-191-1/+1
| | | | | | | | | | | | | | | | | | The SCSI GET LBA STATUS command was introduced in SBC-3 revision 20 in September 2009. At that time the Parameter Data Length field in the response had an associated byte offset of 8. Then in SBC-3 revision 25 (October 2010) that byte offset was changed to 4. The sg_get_lba_status utility in sg3_utils version 1.33 (released earlier today) has been changed to calculate the newer response length. However the implementation of GET LBA STATUS command in the scsi_debug driver still uses the original byte offset. modify the Parameter Data Length field value in the GET LBA STATUS command response to comply with the change in SBC-3 revision 25 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: update device attributes when they changeScott Teel2012-02-191-3/+40
| | | | | | | | | | | | Certain types of changes to devices should not be interpreted as a device change that would cause the device to be removed and re-added. These include RAID level and Firmware revision changes. However, these attribute changes DO need to be reflected in the controller info structure's dev structure list, so that sysfs and /proc info files for the devices will reflect the new values. Signed-off-by: Scott Teel <scott.stacy.teel@hp.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: improve naming on external target device functionsScott Teel2012-02-191-21/+22
| | | | | | | | | | | | | | | | | Reduce confusion and inaccuracy caused by dated naming of vars and functions referring to external target devices. CURRENT NAMING: PROPOSED NAMING: "MSA2xxx devices" "external target devices" msa2xxx_model ext_target_model is_msa2xxx is_ext_target add_msa2xxx_enclosure add_ext_target_dev nmsa2xxx_enclosures n_ext_target_devs Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: eliminate 8 external target limitationScott Teel2012-02-192-11/+10
| | | | | | | | | | | | | | | | | | | | | Driver limits SAS external target IDs to range 1-8. Need to increase limit and clean up overlapping concepts of targets and paths in the code. There are several defined constants that control this: HPSA_MAX_TARGETS_PER_CTLR 16 MAX_MSA2XXX_ENCLOSURES 32 HPSA_MAX_PATHS 8 We can condense this to one constant: MAX_EXT_TARGETS 32 SAS switches allow for 8 connections, and there is capacity for 4 switches per enclosure in largest blade enclosure type. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: refactor hpsa_figure_bus_target_lunStephen M. Cameron2012-02-191-38/+30
| | | | | | | | It should call hpsa_set_bus_target_lun rather than individually setting bus, target and lun. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: make target and lun match what SCSI REPORT LUNs returnsStephen M. Cameron2012-02-191-20/+5
| | | | | | | | | | | | | | | | | | Some distros have a "rescan-scsi-bus.sh" script which depends on SCSI REPORT LUNs not reporting something different than what the driver tells the kernel, even if the driver uses scan_start and scan_finished methods of the SCSI host template to override the usual SCSI midlayer discovery code. Previously, 1 was added to the LUN to make room to insert the RAID controller device at LUN 0. Now, the RAID controller is moved to bus 3, and 1 is no longer added to the LUN. However, SCSI REPORT LUNS on Smart Array doesn't report physical devices like tape drives or auto-loaders as it turns out, so those particular device types still won't match. Generally the logical drives are reported first however, so at least those should match. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: Fix problem with MSA2xxx devicesStephen M. Cameron2012-02-191-19/+15
| | | | | | | | | | | | | | | Upgraded firmware on Smart Array P7xx (and some others) made them show up as SCSI revision 5 devices and this caused the driver to fail to map MSA2xxx logical drives to the correct bus/target/lun. A symptom of this would be that the target ID of the logical drives as presented by the external storage array is ignored, and all such logical drives are assigned to target zero, differentiated only by LUN. Some multipath software reportedly does not deal well with this behavior, failing to recognize different paths to the same device as such. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: factor out driver nameStephen M. Cameron2012-02-192-14/+15
| | | | | | | | | | Sometimes, for testing purposes (e.g. testing rmmod on a system that normally boots using hpsa) it's nice to rename the driver and split it into two drivers and restrict it to certain controllers. This makes that easier. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: combine hpsa_scsi_detect and hpsa_register_scsiStephen M. Cameron2012-02-191-46/+35
| | | | | | | | | hpsa_register_scsi just calls hpsa_scsi_detect. Move the guts of hpsa_scsi_detect into hpsa_register_scsi and get rid of hpsa_scsi_detect. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: removed unneeded structure member max_sg_entries and fix badly ↵Stephen M. Cameron2012-02-193-13/+12
| | | | | | | | | | | | | | | | | | | | | | | named constant MAXSGENTRIES We had both h->max_sg_entries and h->maxsgentries in the per controller structure which is terribly confusing. max_sg_entries was really just a constant, 32, which defines how big the "block fetch table" is, which is as large as the max number of SG elements embedded within a command (excluding SG elements in chain blocks). MAXSGENTRIES was the constant used to denote the max number of SG elements embedded within a command, also a poor name. So renamed MAXSGENTREIS to SG_ENTRIES_IN_CMD, and removed h->max_sg_entries and replaced it with SG_ENTRIES_IN_CMD. h->maxsgentries is unchanged, and is the maximum number of sg elements the controller will support in a command, including those in chain blocks, minus 1 for the chain block pointer.. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] hpsa: fix per device memory leak on driver unloadStephen M. Cameron2012-02-191-0/+9
| | | | | Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] qla4xxx: Update driver version to 5.02.00-k13Vikas Chaudhary2012-02-191-1/+1
| | | | | Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] qla4xxx: Added support to show port_state and port_speed in sysfsVikas Chaudhary2012-02-192-0/+51
| | | | | | Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] scsi_transport_iscsi: Added support to show port_state and port_speed ↵Vikas Chaudhary2012-02-191-0/+63
| | | | | | | | | | | | | | in sysfs sysfs patch to view port_state: /sys/class/iscsi_host/host*/port_state sysfs patch to view port_speed: /sys/class/iscsi_host/host*/port_speed Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] qla4xxx: Added support to show targetalias in sysfsVikas Chaudhary2012-02-191-0/+5
| | | | | | Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] libiscsi: Added support to show targetalias in sysfsVikas Chaudhary2012-02-191-0/+6
| | | | | | | | | sysfs patch to view target alias: /sys/class/iscsi_session/session*/targetalias Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: Update driver version to 8.3.29James Smart2012-02-191-1/+1
| | | | | | Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: Remove GFP_KERNEL allocation while lock is heldJames Smart2012-02-191-79/+57
| | | | | | | | | Note: this is a replacement patch for the issue pointed out in http://www.gossamer-threads.com/lists/linux/kernel/1477270 Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: Locking fix and Memory leak FixesJames Smart2012-02-194-5/+13
| | | | | | | | | | | Locking fix and Memory leak Fixes - Fix Locking code raises IRQ twice (NA) - Fix mailbox and vpi memory leaks (126818) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: FC Discovery state machine fixesJames Smart2012-02-193-2/+13
| | | | | | | | | | | | | FC Discovery state machine fixes. - Fix bug with driver returning the inactive ndlp (125743) - Fix discovery problem when in pt2pt by copying old ndlp state before state change (126887) - Fix ndlp nodelist not empty wait timeout during driver unloading (127052) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: T10 Diff fixes and enhancementsJames Smart2012-02-197-125/+1049
| | | | | | | | | | | | | T10 Diff fixes and enhancements: - Add SLI4 Lancer support for T10 DIF / BlockGuard (121980) - Fix SLI4 BlockGuard behavior when protection data is generated by HBA (121980) - Enhance debugfs for injecting T10 DIF errors (123966, 132966) - Fix Incorrect usage of bghm for BlockGuard errors (127022) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: SLI related fixesJames Smart2012-02-1911-34/+207
| | | | | | | | | | | | | | | | | | | | | | | | SLI related fixes: - Fix REG_RPI fails on SLI4 HBA putting NPort into NPR state (126230) - Fix ELS FDISC failing with local reject / invalid RPI. (126350) - Fix reset port when reset is needed during fw_dump (125807) - Fix unbounded firmware revision string from port cause panic (126560) - Fix driver behavior when receiving an ADISC (126654) - Fix driver not returning when bad ndlp found in abts error event handling (126209) - Add more driver logs in area of SLI4 port error attention and reset recovery (126813, 124466) - Fix failure in handling large CQ/EQ identifiers in an IOV environment (126856) - Fix for driver using duplicate RPIs after lancer port reset (126723) - Clear vport->fc_myDID in lpfc_els_issue_fdisc to guarentee a zero SID (126779, 126897) - Fix for SLI4 Port delivery for BLS ABORT ACC (126289) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: BSG and User interface fixesJames Smart2012-02-194-5/+63
| | | | | | | | | | | | | BSG and User interface fixes: - Fix driver processing an els command using 16Gb FC Adapter (126345) - Change SLI4 FC port internal loopback to inner internal (126409) - Fix bug with driver dump command type 4 using 16Gb FC Adapter (126406) - Create character device to take a reference on the driver (126082) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] pm8001: deficient responses to IO_XFER_ERROR_BREAK and ↵Mark Salyzyn2012-02-193-12/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IO_XFER_OPEN_RETRY_TIMEOUT IO_XFER_ERROR_BREAK and IO_XFER_OPEN_RETRY_TIMEOUT are deficient of the required actions as outlined in the programming manual for the pm8001. Due to the overlapping code requirements of these recovery responses, we found it necessary to bundle them together into one patch. When a break is received during the command phase (ssp_completion), this is a result of a timeout or interruption on the bus. Logic suggests that we should retry the command. When a break is received during the data-phase (ssp_event), the task must be aborted on the target or it will retain a data-phase lock turning the target reticent to all future media commands yet will successfully respond to TUR, INQUIRY and ABORT leading eventually to target failure through several abort-cycle loops. The open retry interval is exceedingly short resulting in occasional target drop-off during expander resets or when targets push-back during bad-block remapping. Increased effective timeout from 130ms to 1.5 seconds for each try so as to trigger after the administrative inquiry/tur timeout in the scsi subsystem to keep error-recovery harmonics to a minimum. When an open retry timeout event is received, the action required by the targets is to issue an abort for the outstanding command then logic suggests we retry the command as this state is usually an indication of a credit block or busy condition on the target. We hijacked the pm8001_handle_event work queue handler so that it will handle task as an argument instead of device for the workers in support of the deferred handling outlined above. Moderate to Heavy bad-path testing on a 2.6.32 vintage kernel, compile-testing on scsi-misc-2.6 kernel ... Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] pm8001: Add FUNC_GET_EVENTSMark Salyzyn2012-02-193-27/+83
| | | | | | | | | | | | | | | | Jack noticed I dropped a patch fragment associated with a flags automatic variable in mpi_set_phys_g3_with_ssc (ooops) and that the pre-emptive locking that piggy-backed this patch was not in-fact necessary because of underlying atomic accesses to the hardware. Here is the updated patch fixing these two issues. The pm8001 driver is missing the FUNC_GET_EVENTS handler in the phy control function. Since the pm8001_bar4_shift function was not designed to be called at runtime, added locking surrounding the adjustment for all accesses. Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] pm8001: fix lockup on phy_control hard reset.Mark Salyzyn2012-02-191-1/+1
| | | | | | | | | | | | pm8001_phy_control PHY_FUNC_HARD_RESET locks up on second try via smp_phy_control because response HW_EVENT_PHY_START_STATUS fails to complete previous command. The PM8001F_RUN_TIME flag is not treated as a bit, but a state in all readers, yet once we are operational or in the run time state, the flags use a bit-set operation. Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] st: implement PMOliver Neukum2012-02-191-0/+11
| | | | | | | | This implements basic power management for SCSI tapes. Signed-off-by: Oliver Neukum <oneukum@suse.de> Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] scsi_pm: Fix bug in the SCSI power management handlerAlan Stern2012-02-182-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1520) fixes a bug in the SCSI layer's power management implementation. LUN scanning can be carried out asynchronously in do_scan_async(), and sd uses an asynchronous thread for the time-consuming parts of disk probing in sd_probe_async(). Currently nothing coordinates these async threads with system sleep transitions; they can and do attempt to continue scanning/probing SCSI devices even after the host adapter has been suspended. As one might expect, the outcome is not ideal. This is what the "prepare" stage of system suspend was created for. After the prepare callback has been called for a host, target, or device, drivers are not allowed to register any children underneath them. Currently the SCSI prepare callback is not implemented; this patch rectifies that omission. For SCSI hosts, the prepare routine calls scsi_complete_async_scans() to wait until async scanning is finished. It might be slightly more efficient to wait only until the host in question has been scanned, but there's currently no way to do that. Besides, during a sleep transition we will ultimately have to wait until all the host scanning has finished anyway. For SCSI devices, the prepare routine calls async_synchronize_full() to wait until sd probing is finished. The routine does nothing for SCSI targets, because asynchronous target scanning is done only as part of host scanning. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: <stable@kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] scsi_scan: Fix 'Poison overwritten' warning caused by using freed 'shost'Huajun Li2012-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In do_scan_async(), calling scsi_autopm_put_host(shost) may reference freed shost, and cause Posison overwitten warning. Yes, this case can happen, for example, an USB is disconnected just when do_scan_async() thread starts to run, then scsi_host_put() called in scsi_finish_async_scan() will lead to shost be freed(because the refcount of shost->shost_gendev decreases to 1 after USB disconnects), at this point, if references shost again, system will show following warning msg. To make scsi_autopm_put_host(shost) always reference a valid shost, put it just before scsi_host_put() in function scsi_finish_async_scan(). [ 299.281565] ============================================================================= [ 299.281634] BUG kmalloc-4096 (Tainted: G I ): Poison overwritten [ 299.281682] ----------------------------------------------------------------------------- [ 299.281684] [ 299.281752] INFO: 0xffff880056c305d0-0xffff880056c305d0. First byte 0x6a instead of 0x6b [ 299.281816] INFO: Allocated in scsi_host_alloc+0x4a/0x490 age=1688 cpu=1 pid=2004 [ 299.281870] __slab_alloc+0x617/0x6c1 [ 299.281901] __kmalloc+0x28c/0x2e0 [ 299.281931] scsi_host_alloc+0x4a/0x490 [ 299.281966] usb_stor_probe1+0x5b/0xc40 [usb_storage] [ 299.282010] storage_probe+0xa4/0xe0 [usb_storage] [ 299.282062] usb_probe_interface+0x172/0x330 [usbcore] [ 299.282105] driver_probe_device+0x257/0x3b0 [ 299.282138] __driver_attach+0x103/0x110 [ 299.282171] bus_for_each_dev+0x8e/0xe0 [ 299.282201] driver_attach+0x26/0x30 [ 299.282230] bus_add_driver+0x1c4/0x430 [ 299.282260] driver_register+0xb6/0x230 [ 299.282298] usb_register_driver+0xe5/0x270 [usbcore] [ 299.282337] 0xffffffffa04ab03d [ 299.282364] do_one_initcall+0x47/0x230 [ 299.282396] sys_init_module+0xa0f/0x1fe0 [ 299.282429] INFO: Freed in scsi_host_dev_release+0x18a/0x1d0 age=85 cpu=0 pid=2008 [ 299.282482] __slab_free+0x3c/0x2a1 [ 299.282510] kfree+0x296/0x310 [ 299.282536] scsi_host_dev_release+0x18a/0x1d0 [ 299.282574] device_release+0x74/0x100 [ 299.282606] kobject_release+0xc7/0x2a0 [ 299.282637] kobject_put+0x54/0xa0 [ 299.282668] put_device+0x27/0x40 [ 299.282694] scsi_host_put+0x1d/0x30 [ 299.282723] do_scan_async+0x1fc/0x2b0 [ 299.282753] kthread+0xdf/0xf0 [ 299.282782] kernel_thread_helper+0x4/0x10 [ 299.282817] INFO: Slab 0xffffea00015b0c00 objects=7 used=7 fp=0x (null) flags=0x100000000004080 [ 299.282882] INFO: Object 0xffff880056c30000 @offset=0 fp=0x (null) [ 299.282884] ... Signed-off-by: Huajun Li <huajun.li.lee@gmail.com> Cc: stable@kernel.org Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
OpenPOWER on IntegriCloud