aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-07-05cxgb4i: Convert over to dst_neigh_lookup().David S. Miller1-1/+4
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05cxgbi: Convert over to dst_neigh_lookup().David S. Miller1-4/+8
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-29netlink: add netlink_kernel_cfg parameter to netlink_kernel_createPablo Neira Ayuso2-5/+11
This patch adds the following structure: struct netlink_kernel_cfg { unsigned int groups; void (*input)(struct sk_buff *skb); struct mutex *cb_mutex; }; That can be passed to netlink_kernel_create to set optional configurations for netlink kernel sockets. I've populated this structure by looking for NULL and zero parameters at the existing code. The remaining parameters that always need to be set are still left in the original interface. That includes optional parameters for the netlink socket creation. This allows easy extensibility of this interface in the future. This patch also adapts all callers to use this new interface. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller6-105/+67
Conflicts: drivers/net/caif/caif_hsi.c drivers/net/usb/qmi_wwan.c The qmi_wwan merge was trivial. The caif_hsi.c, on the other hand, was not. It's a conflict between 1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform device with ops structure.") in the net-next tree and commit 39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of HIS until open()") in the net tree. I did my best with that one and will ask Sjur to check it out. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27bnx2x, bnx2fc, bnx2i, cnic: Add statistics support and FCoE capabilities advertisementBarak Witkowski7-14/+194
1. When FCoE offload driver is registered, copy its capabilities to the chip scratchpad. 2. Copy FCoE/iSCSI MAC addresses in aligned manner to chip scratchpad. 3. Add FCoE/iSCSI statistics collection support Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-22SCSI & usb-storage: add try_rc_10_first flagAlan Stern1-0/+2
Several bug reports have been received recently for USB mass-storage devices that don't handle READ CAPACITY(16) commands properly. They report bogus sizes, in some cases becoming unusable as a result. The bugs were triggered by commit 09b6b51b0b6c1b9bb61815baf205e4d74c89ff04 (SCSI & usb-storage: add flags for VPD pages and REPORT LUNS), which caused usb-storage to stop overriding the SCSI level reported by devices. By default, the sd driver will try READ CAPACITY(16) first for any device whose level is above SCSI_SPC_2. It seems likely that any device large enough to require the use of READ CAPACITY(16) (i.e., 2 TB or more) would be able to handle READ CAPACITY(10) commands properly. Indeed, I don't know of any devices that don't handle READ CAPACITY(10) properly. Therefore this patch (as1559) adds a new flag telling the sd driver to try READ CAPACITY(10) before READ CAPACITY(16), and sets this flag for every USB mass-storage device. If a device really is larger than 2 TB, sd will fall back to READ CAPACITY(16) just as it used to. This fixes Bugzilla #43391. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Hans de Goede <hdegoede@redhat.com> CC: "James E.J. Bottomley" <JBottomley@parallels.com> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-15Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds2-4/+2
Pull SCSI fixes from James Bottomley: "This is a couple of minor fixes, one for a preempt warning in the mpt2sas driver and one is a config failure with the new sd async domain." * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: [SCSI] Fix sd_probe_domain config problem [SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptible
2012-06-12qla2xxx: Remove version.h header file inclusionSachin Kamat2-2/+0
version.h header file is no longer required for qla_target code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12tcm_qla2xxx: Handle malformed wwn strings properlyRoland Dreier1-1/+3
If we make a variable an unsigned int and then expect it to be < 0 on a bad character, we're going to have a bad time. Fix the tcm_qla2xxx code to actually notice if hex_to_bin() returns a negative variable. This was detected by the compiler warning: scsi/qla2xxx/tcm_qla2xxx.c: In function ‘tcm_qla2xxx_npiv_extract_wwn’: scsi/qla2xxx/tcm_qla2xxx.c:148:3: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12tcm_qla2xxx: tcm_qla2xxx_handle_tmr() can be staticRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12qla2xxx: Don't leak commands we give up on in qlt_do_work()Roland Dreier1-1/+3
If we go to the "out_term:" exit path in qlt_do_work(), we call qlt_send_term_exchange() with a NULL cmd, which means that it can't possibly free the cmd for us. Add an explicit call to free the command memory, so we don't leak the allocation. This will also fix warnings about "BUG qla_tgt_cmd_cachep: Objects remaining on kmem_cache_close" from slub when unloading the qla2xxx target module. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12qla2xxx: Don't crash if we can't find cmd for failed CTIORoland Dreier1-4/+2
In qlt_do_ctio_completion(), there's no point in calling qlt_term_ctio_exchange() with a NULL cmd -- all that it does is crash in a NULL pointer dereference, since it does qlt_send_term_exchange(vha, cmd, &cmd->atio, 1); and dereferencing &cmd->atio is a bad idea if cmd itself is NULL. If we really need to do this, we could take the values from the failed CTIO we're processing, but it's not clear if it's worth the replumbing to do that. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12tcm_qla2xxx: Don't insert nacls without sessions into the btreeRoland Dreier1-73/+0
When we create an explicit node ACL in tcm_qla2xxx_make_nodeacl(), there is a call to tcm_qla2xxx_setup_nacl_from_rport(), which puts the node ACL into the lport_fcport_map even though there is no session yet for the initiator. Since the only time we remove entries from this map is when we free a session, this means that if we later delete this node ACL without the initiator ever creating a session, we'll leave the nacl pointer in the btree pointing at freed memory. This is especially bad if that initiator later does send us a command that would cause us to create a dynamic ACL and session: we'll find the stale freed nacl pointer in the btree and end up with use-after-free. We could add more code to clear the btree entry when deleting the explicit nacl, but the original insertion is pointless: without a session attached, we'll just have to update the entry when a session appears anyway. So we can just delete tcm_qla2xxx_setup_nacl_from_rport() and the code that calls it. Signed-off-by: Roland Dreier <roland@purestorage.com> Cc: Chad Dupuis <chad.dupuis@qlogic.com> Cc: Giridhar Malavali <giridhar.malavali@qlogic.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12tcm_qla2xxx: Clear session s_id + loop_id earlier during shutdownNicholas Bellinger1-17/+31
This patch adds a new tcm_qla2xxx_clear_sess_lookup() call to clear session specific s_id + loop_id entries used for se_node_acl pointer lookup ahead of releasing se_session within the process context workqueue callback in tcm_qla2xxx_free_session(). It makes the call in existing tcm_qla2xxx_clear_nacl_from_fcport_map() code invoked from qlt_unreg_sess() in interrupt context w/ hardware_lock held, ahead of the process context callback into qlt_free_session_done() -> tcm_qla2xxx_free_session(). We are doing this to address a race between incoming ATIO or TMR packets using stale se_node_acl pointer once session shutdown has been invoked via qlt_unreg_sess() in qla_target.c LLD code, and when the entire tcm_qla2xxx endpoint has not been forced into shutdown w/ echo 0 > ../$QLA2XXX_PORT/enable Cc: Joern Engel <joern@logfs.org> Cc: Roland Dreier <roland@purestorage.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-12tcm_qla2xxx: Convert to TFO->put_session() usageJoern Engel1-1/+22
This patch converts tcm_qla2xxx code to use an internal kref_put() for se_session->sess_kref in order to ensure that qla_hw_data->hardware_lock can be held while calling qlt_unreg_sess() for the final put. Signed-off-by: Joern Engel <joern@logfs.org> Cc: Roland Dreier <roland@purestorage.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-07[SCSI] Fix sd_probe_domain config problemJames Bottomley1-3/+1
With CONFIG_BLK_DEV_SD = n and CONFIG_PM = n, you get this compile failure: (.text+0x4f6c77): undefined reference to `scsi_sd_probe_domain' This was introduced by commit a7a20d103994fd760766e6c9d494daa569cbfe06 Author: Dan Williams <dan.j.williams@intel.com> Date: Thu Mar 22 17:05:11 2012 -0700 [SCSI] sd: limit the scope of the async probe domain And happens because scsi_sd_probe_domain is conditionally defined but unconditionally used. Fix this by making the symbol unconditionally defined. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Dan Williams <dan.j.williams@intel.com> Tested-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-06-06[SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptiblenagalakshmi.nandigama@lsi.com1-1/+1
When CONFIG_DEBUG_PREEMPT is enabled, bug is observed in the smp_processor_id(). This is because smp_processor_id() is not called in preempt safe condition. To fix this issue, use raw_smp_processor_id instead of smp_processor_id. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> CC: stable@vger.kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-31Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds52-674/+11896
Pull final round of SCSI updates from James Bottomley: "This is primarily another round of driver updates (bnx2fc, qla2xxx, qla4xxx) including the target mode driver for qla2xxx. We've also got a couple of regression fixes (async scanning, broken this merge window and a fix to a long standing break in the scsi_wait_scan module)." * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (45 commits) [SCSI] fix scsi_wait_scan [SCSI] fix async probe regression [SCSI] be2iscsi: fix dma free size mismatch regression [SCSI] qla4xxx: Update driver version to 5.02.00-k17 [SCSI] qla4xxx: Capture minidump for ISP82XX on firmware failure [SCSI] qla4xxx: Add change_queue_depth API support [SCSI] qla4xxx: Fix clear ddb mbx command failure issue. [SCSI] qla4xxx: Fix kernel panic during discovery logout. [SCSI] qla4xxx: Correct early completion of pending mbox. [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs [SCSI] libfcoe: Add fcoe_sysfs [SCSI] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, not as a member [SCSI] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a member [SCSI] Fix dm-multipath starvation when scsi host is busy [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove. [SCSI] qla2xxx: don't free pool that wasn't allocated [SCSI] mptfusion: unlock on error in mpt_config() [SCSI] tcm_qla2xxx: Add >= 24xx series fabric module for target-core [SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series [SCSI] Revert "qla2xxx: During loopdown perform Diagnostic loopback." ...
2012-05-30[SCSI] fix scsi_wait_scanJames Bottomley1-1/+1
Commit c751085943362143f84346d274e0011419c84202 Author: Rafael J. Wysocki <rjw@sisk.pl> Date: Sun Apr 12 20:06:56 2009 +0200 PM/Hibernate: Wait for SCSI devices scan to complete during resume Broke the scsi_wait_scan module in 2.6.30. Apparently debian still uses it so fix it and backport to stable before removing it in 3.6. The breakage is caused because the function template in include/scsi/scsi_scan.h is defined to be a nop unless SCSI is built in. That means that in the modular case (which is every distro), the scsi_wait_scan module does a simple async_synchronize_full() instead of waiting for scans. Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] fix async probe regressionDan Williams1-2/+5
Commit a7a20d1 "[SCSI] sd: limit the scope of the async probe domain" moved sd probe work out of reach of wait_for_device_probe(). Allow it to be synced via scsi_complete_async_scans(). Reported-by: Meelis Roos <mroos@linux.ee> Tested-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] be2iscsi: fix dma free size mismatch regressionMike Christie1-3/+2
This patch should go into 3.5 fixes. The bug was added in the patches for the 3.5 feature window. As you can see from the patch I made a mistake. During development I switched from passing a struct to the size of the struct, but left the sizeof. This results in us allocating 4 bytes (sizeof(int)) but then calling pci_free_consistent with the size of the struct. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Update driver version to 5.02.00-k17Vikas Chaudhary1-1/+1
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Capture minidump for ISP82XX on firmware failureTej Parkash9-16/+1293
Added support to capture dump (Minidump) which allows us to catpure a snapshot of the firmware/hardware states at the time of firmware failure Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Add change_queue_depth API supportTej Parkash1-0/+20
change_queue_depth will adjust device queuedepth upon receiving "SAM_STAT_TASK_SET_FULL" scsi status from the target. Also added ql4xqfulltracking command line param to enable or disable queuefull tracking. One can disabling queuefull tracking to ensure user set scsi device queuedepth is not altered. Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Fix clear ddb mbx command failure issue.Manish Rangankar1-1/+35
Allow ddb state to change to DDB_DS_NO_CONNECTION_ACTIVE or DDB_DS_SESSION_FAILED before issuing clear ddb mailbox cmd, because clear ddb mailbox cmd fails if the ddb state is not equal to DDB_DS_NO_CONNECTION_ACTIVE or DDB_DS_SESSION_FAILED. Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Fix kernel panic during discovery logout.Manish Rangankar1-1/+2
Update the session and connection parameter before sending connection logged in event to iscsiadm because in some scenario logout may come in just after we send the logged in event to user, which free up session, connection and ddb, but DPC is still updating session and connect parameter which can lead to panic. Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-30[SCSI] qla4xxx: Correct early completion of pending mbox.Lalit Chandivade1-19/+19
Check for Firmware Hang (AF_FW_RECOVERY) after mailbox command has gained access to ensure that the mailbox command does not wait un-necessarily during a firmware recovery and prevent premature mailbox timeout which will lead to back to back reset's. Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23Merge branch 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linuxLinus Torvalds6-4003/+5
Pull the MCA deletion branch from Paul Gortmaker: "It was good that we could support MCA machines back in the day, but realistically, nobody is using them anymore. They were mostly limited to 386-sx 16MHz CPU and some 486 class machines and never more than 64MB of RAM. Even the enthusiast hobbyist community seems to have dried up close to ten years ago, based on what you can find searching various websites dedicated to the relatively short lived hardware. So lets remove the support relating to CONFIG_MCA. There is no point carrying this forward, wasting cycles doing routine maintenance on it; wasting allyesconfig build time on validating it, wasting I/O on git grep'ping over it, and so on." Let's see if anybody screams. It generally has compiled, and James Bottomley pointed out that there was a MCA extension from NCR that allowed for up to 4GB of memory and PPro-class machines. So in *theory* there may be users out there. But even James (technically listed as a maintainer) doesn't actually have a system, and while Alan Cox claims to have a machine in his cellar that he offered to anybody who wants to take it off his hands, he didn't argue for keeping MCA support either. So we could bring it back. But somebody had better speak up and talk about how they have actually been using said MCA hardware with modern kernels for us to do that. And David already took the patch to delete all the networking driver code (commit a5e371f61ad3: "drivers/net: delete all code/drivers depending on CONFIG_MCA"). * 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: MCA: delete all remaining traces of microchannel bus support. scsi: delete the MCA specific drivers and driver code serial: delete the MCA specific 8250 support. arm: remove ability to select CONFIG_MCA
2012-05-23[SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE SyfsRobert Love3-25/+268
This patch has the SW FCoE driver and the bnx2fc driver make use of the new fcoe_sysfs API added earlier in this patch series. After this patch a fcoe_ctlr_device is allocated with private data in this order. +------------------+ +------------------+ | fcoe_ctlr_device | | fcoe_ctlr_device | +------------------+ +------------------+ | fcoe_ctlr | | fcoe_ctlr | +------------------+ +------------------+ | fcoe_interface | | bnx2fc_interface | +------------------+ +------------------+ libfcoe also takes part in this new model since it discovers and manages fcoe_fcf instances. The memory allocation is different for FCFs. I didn't want to impact libfcoe's fcoe_fcf processing, so this patch creates fcoe_fcf_device instances for each discovered fcoe_fcf. The two are paired using a (void * priv) member of the fcoe_ctlr_device. This allows libfcoe to continue maintaining its list of fcoe_fcf instances and simply attaches and detaches them from existing or new fcoe_fcf_device instances. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] libfcoe: Add fcoe_sysfsRobert Love3-3/+844
This patch adds a 'fcoe bus' infrastructure to the kernel that is driven by changes to libfcoe which allow LLDs to present FIP (FCoE Initialization Protocol) discovered entities and their attributes to user space via sysfs. This patch adds the following APIs- fcoe_ctlr_device_add fcoe_ctlr_device_delete fcoe_fcf_device_add fcoe_fcf_device_delete They allow the LLD to expose the FCoE ENode Controller and any discovered FCFs (Fibre Channel Forwarders, e.g. FCoE switches) to the user. Each of these new devices has their own bus_type so that they are grouped together for easy lookup from a user space application. Each new class has an attribute_group to expose attributes for any created instances. The attributes are- fcoe_ctlr_device * fcf_dev_loss_tmo * lesb_link_fail * lesb_vlink_fail * lesb_miss_fka * lesb_symb_err * lesb_err_block * lesb_fcs_error fcoe_fcf_device * fabric_name * switch_name * priority * selected * fc_map * vfid * mac * fka_peroid * fabric_state * dev_loss_tmo A device loss infrastructre similar to the FC Transport's is also added by this patch. It is nice to have so that a link flapping adapter doesn't continually advance the count used to identify the discovered FCF. FCFs will exist in a "Disconnected" state until either the timer expires or the FCF is rediscovered and becomes "Connected." This patch generates a few checkpatch.pl WARNINGS that I'm not sure what to do about. They're macros modeled around the FC Transport attribute building macros, which have the same 'feature' where the caller can ommit a cast in the argument list and no cast occurs in the code. I'm not sure how to keep the code condensed while keeping the macros. Any advice would be appreciated. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, not as a memberRobert Love4-63/+101
Currently the fcoe_ctlr associated with an interface is allocated as a member of struct bnx2fc_interface. This causes problems when when later patches attempt to use the new fcoe_sysfs APIs which allow us to allocate the bnx2fc_interface as private data to a fcoe_ctlr_device instance. The problem is that libfcoe wants to be able use pointer math to find a fcoe_ctlr's fcoe_ctlr_device as well as finding a fcoe_ctlr_device's assocated fcoe_ctlr. To do this we need to allocate the fcoe_ctlr_device, with private data for the LLD. The private data will contain the fcoe_ctlr and its private data will be the bnx2fc_interface. +-------------------+ | fcoe_ctlr_device | +-------------------+ | fcoe_ctlr | +-------------------+ | bnx2fc_interface | +-------------------+ This prep work will allow us to go from a fcoe_ctlr_device instance to its fcoe_ctlr as well as from a fcoe_ctlr to its fcoe_ctlr_device once the fcoe_sysfs API is in use (later patches in this series). Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a memberRobert Love2-52/+93
Currently the fcoe_ctlr associated with an interface is allocated as a member of struct fcoe_interface. This causes problems when attempting to use the new fcoe_sysfs APIs which allow us to allocate the fcoe_interface as private data to the fcoe_ctlr_device instance. The problem is that libfcoe wants to be able use pointer math to find a fcoe_ctlr's fcoe_ctlr_device as well as finding a fcoe_ctlr_device's assocated fcoe_ctlr. To do this we need to allocate the fcoe_ctlr_device, with private data for the LLD. The private data contains the fcoe_ctlr and its private data is the fcoe_interface. This patch only allocates the fcoe_interface with the fcoe_ctlr, the fcoe_ctlr_device will be added in a later patch, which will complete the below diagram- +------------------+ | fcoe_ctlr_device | +------------------+ | fcoe_ctlr | +------------------+ | fcoe_interface | +------------------+ This prep work will allow us to go from a fcoe_ctlr_device instance to its fcoe_ctlr as well as from a fcoe_ctlr to its fcoe_ctlr_device once the fcoe_sysfs API is in use (later patches in this series). Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] Fix dm-multipath starvation when scsi host is busyJun'ichi Nomura1-4/+7
block congestion control doesn't have any concept of fairness across multiple queues. This means that if SCSI reports the host as busy in the queue congestion control it can result in an unfair starvation situation in dm-mp if there are multiple multipath devices on the same host. For example: http://www.redhat.com/archives/dm-devel/2012-May/msg00123.html The fix for this is to report only the sdev busy state (and ignore the host busy state) in the block congestion control call back. The host is still congested, but the SCSI subsystem will sort out the congestion in a fair way because it knows the relation between the queues and the host. [jejb: fixed up trailing whitespace] Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> Tested-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove.Namjae Jeon1-2/+3
Avoid dereferencing a NULL pointer if scsi_host_alloc is failed. Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds5-13/+8
Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
2012-05-22[SCSI] qla2xxx: don't free pool that wasn't allocatedDan Carpenter1-1/+1
In the original code, if dma_pool_alloc() fails then we call dma_pool_free(). It causes an error, possibly a NULL dereference. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] tcm_qla2xxx: Add >= 24xx series fabric module for target-coreNicholas Bellinger4-0/+2047
This patch adds support for tcm_qla2xxx fabric module for target-core using the new qla_target.c LLD logic. This includes support for explict NodeACLs via configfs using tcm_qla2xxx_setup_nacl_from_rport() from libfc struct fc_host->rports, and demo-mode support for virtual LUN=0 access. This patch also adds support for using tcm_qla2xxx_lport->lport_fcport_map and ->lport_loopid_map of btree_head32 to track struct se_node_acl pointers for individual 24-bit Port ID and 16-bit Loop ID values w/ qla_target_template ->find_sess_by_s_id() and ->find_sess_by_loop_id() used in a number of locations into the primary I/O dispatch logic in qla_target.c LLD code. The main piece for FC Nexus setup is in tcm_qla2xxx_check_initiator_node_acl(), which calls tcm_qla2xxx_set_sess_by_[s_id,loop_id]() to setup our lport->lport_fcport_map and lport_loopid_map pointers respectively, and register the new nexus with TCM via __transport_register_session(). (nab: Add qla_tgt_mgmt_cmd usage with TARGET_SCF_ACK_KREF during TMRs + change tcm_qla2xxx_nacl->nport_id to u32 (DanC)) (danc: tcm_qla2xxx: checking for NULL instead of IS_ERR()) (roland: Fix up v3.5 breakage for removal of transport_do_task_sg_chain + Add hook so qla_target code can shutdown sessions) (steveh: Convert FC address map from flat array to btree) (randy: fix qla2xxx printk format warnings for size_t) (joern: Make most of tcm_qla2xxx static + remove unnecessary workqueue_struct prototypes + use WWN_SIZE instead of hard-coded constants) Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx seriesNicholas Bellinger15-35/+6472
Add LLD target mode for >= 24xx series HW. This code was originally based on external qla2x00t module based on 8.02.01-k4, and has been refactored to push the bulk of code into mainline qla2xxx.ko LLD -> qla_target.c. The implementation uses internal workqueues for I/O context submission into tcm_qla2xxx code, and includes the struct qla_tgt_func_tmpl API for external interaction to allow qla2xxx LDD to function without direct target-core dependencies: It also enables qla_target.c usage within existing qla2xxx LLD code. This includes: *) Addition of target mode specific members to existing data structures in qla_def.h and struct qla_hw_data->tgt_ops using qla_target.h:struct qla_tgt_func_tmpl *) Addition of struct qla_tgt_func_tmpl and direct calls into qla_target.c logic w/ qlt_* prefixed functions. *) Addition of qla_iocb.c:qla2x00_req_pkt() for ring processing, and qla2x00_issue_marker() for handling request/response queue processing for target mode operation *) Addition of various qla_tgt_mode_enabled() logic checks in qla24xx_nvram_config(), qla2x00_initialize_adapter(), qla2x00_rff_id(), qla2x00_abort_isp(), qla24xx_modify_vp_config(), and qla2x00_vp_abort_isp(). By default the new qlini_mode module parameter is setting initiator-mode to 'enabled' in order for 'modprobe qla2xxx' to continue to function as expected in initiator only mode. Enabling target-mode operation will currently require a: modprobe qla2xxx qlini_mode="disabled" in order to explictly disabled initiator mode and allow target-mode to be enabled via tcm_qla2xxx configfs fabric callers. (nab: Convert to qlini_mode='enabled' by default in qla_target.c) (joern: Remove loop_id from qla_tgt_make_local_sess() arguments + Remove unused s_id + fix s_id endianness bug + simplify qla_tgt_abort_work) (gerard: fix section __exit mismatch in qla_tgt_exit) (arun: Capture ATIO queue during firmware dump + Send SCR in target mode + Target mode review comments) (roland: Don't create duplicate target sessions to address tearing down ACLs with IO in flight + Add missing call to qlt_fc_port_deleted call during qla2x00_schedule_rport_del timeout) Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] Revert "qla2xxx: During loopdown perform Diagnostic loopback."Chad Dupuis1-1/+0
commit 491118dff9aeb207408bd42aa4897bc2c145747f Author: Saurav Kashyap <saurav.kashyap@qlogic.com> Date: Tue Aug 16 11:31:50 2011 -0700 [SCSI] qla2xxx: During loopdown perform Diagnostic loopback. The LOOP_DOWN test is not needed. 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>
2012-05-22[SCSI] qla2xxx: Display proper firmware version when new minidump template is gathered for ISP82xx.Giridhar Malavali1-3/+3
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>
2012-05-22[SCSI] qla2xxx: Don't capture minidump for ISP82xx on flash update from application.Giridhar Malavali4-2/+15
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>
2012-05-22[SCSI] qla2xxx: Avoid losing any fc ports when loop id's are exhausted.Joe Carnuccio1-63/+20
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Log link up and link down messages to track link flops.Chad Dupuis4-21/+35
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>
2012-05-22[SCSI] qla2xxx: Corrections to log messages.Saurav Kashyap2-6/+5
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Optimize existing port name server query matching.Joe Carnuccio2-9/+8
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Remove mirrored field vp_idx from struct fc_port.Joe Carnuccio7-32/+19
The field vp_idx in struct fc_port is a redundant/mirror copy of the same field in struct scsi_qla_host; struct fc_port has a pointer vha to scsi_qla_host which allows the original copy of vp_idx to be readily accessed. Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Fixups for ISP83xx.Nigel Kirkland2-5/+5
Signed-off-by: Nigel Kirkland <nigel.kirkland@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Display proper supported speeds for 16G FC adapters.Giridhar Malavali1-0/+3
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>
2012-05-22[SCSI] qla2xxx: Fix typo in bus-reset handler.Andrew Vasquez1-1/+1
Both the target-id and LUN are munged in the original printk(). Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-22[SCSI] qla2xxx: Stats should be different from physical and virtual portsSaurav Kashyap4-18/+14
Currently stats is part of ha data structure, common for physical and virtual ports. Moved the stats to vha, each port will have its own stat. Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>