summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
Commit message (Collapse)AuthorAgeFilesLines
* [SCSI] core, classes, mpt2sas: have scsi_internal_device_unblock take new stateMike Christie2012-07-202-3/+4
| | | | | | | | | | | | | | | This has scsi_internal_device_unblock/scsi_target_unblock take the new state to set the devices as an argument instead of always setting to running. The patch also converts users of these functions. This allows the FC and iSCSI class to transition devices from blocked to transport-offline, so that when fast_io_fail/replacement_timeout has fired we do not set the devices back to running. Instead, we set them to SDEV_TRANSPORT_OFFLINE. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptiblenagalakshmi.nandigama@lsi.com2012-06-061-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>
* [SCSI] mpt2sas: move the scsi_host_put to the right placeTomas Henzl2012-05-101-1/+1
| | | | | | | | When scsi_add_host fails the scsi_host_put should be called. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Bump driver vesion to 13.100.00.00nagalakshmi.nandigama@lsi.com2012-04-231-2/+2
| | | | | Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix for panic happening because of improper memory allocationnagalakshmi.nandigama@lsi.com2012-04-231-3/+3
| | | | | | | | | | | | | | | | | The ioc->pfacts member in the IOC structure is getting set to zero following a call to _base_get_ioc_facts due to the memset in that routine. So if the ioc->pfacts was read after a host reset, there would be a NULL pointer dereference. The routine _base_get_ioc_facts is called from context of host reset. The problem in _base_get_ioc_facts is the size of Mpi2IOCFactsReply is 64, whereas the sizeof "struct mpt2sas_facts" is 60, so there is a four byte overflow resulting from the memset. Also, there is memset in _base_get_port_facts using the incorrect structure, it should be "struct mpt2sas_port_facts" instead of Mpi2PortFactsReply. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> CC: stable@vger.kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix for hard drive going OFFLINE when hard reset issued and ↵nagalakshmi.nandigama@lsi.com2012-04-231-8/+10
| | | | | | | | | | | | | | | | | | | | | | | simultaneously another hard drive is hot unplugged Following the host reset, the firmware discovery is reassigning another hard drive in the topology to the same device handle as that device is getting hot removed. Until the driver device removal routine is called, there will be two hard drive with the matching device handle in the internal device link list. In the device removal routine, a separate function which moves the device from BLOCKED into OFFLINE state. Since this routine is passed with the device handle passed as input parameter, the routine will be traversing the internal device link list searching for matching device handle. This results in two devices with matching device handle, therefore both devices goes OFFLINE. To fix this issue,the input parameter is changed from device handle to SAS address, therefore only the device that is hot unplugged will be placed in OFFLINE state. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Cc: stable@vger.kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Set the phy identifier of the end device to the phy number ↵nagalakshmi.nandigama@lsi.com2012-04-231-0/+3
| | | | | | | | | | | of the parent device it is linked to The phy_identifier inside the routine _transport_set_identify() is set to sas_device_page_zero->PhyNum. This returns the phy number of the parent device this device is linked to. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas : While enabling phy, read the current port number from sas ↵nagalakshmi.nandigama@lsi.com2012-04-231-2/+59
| | | | | | | | | | | | | | | | | iounit page 0 instead of page 1 The port number is changing after disabling/enabling phys using the SysFS interface This is because the firmware behavour changed where it would read the the port number then set it to some different value even though Auto Port Config is turned on. With this change of behavour in FW, it is possible that the expanders are moved from one port to another after disabling /enabling phys. This is occuring because the port number in sas iounit page 1 is not matching up to the current port in page 0. In order to fix this the driver is modified to read the current port number from sas iounit page 0 instead of page 1. Also copy the port and phy flags over from page 0 to page 1. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix linux driver sparse errorsnagalakshmi.nandigama@lsi.com2012-04-232-4/+6
| | | | | | | Fix several endian issues found by runing sparse. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix security scan issues reported by source code analysis toolnagalakshmi.nandigama@lsi.com2012-04-233-18/+51
| | | | | | | | | | | | | | | | Modified the source code as per the findings reported by the source code analysis tool. Source code for the following functionalities has been touched. None of the driver functionalities has changed. - SMP Passthrough IOCTL - Debug messages for MPT Replies (i.e. bit 9 of Logging Level) - Task Management using sysfs - Device removal, i.e. when a target device (including any PD within a volume) is removed, and Volume Deletion. - Trace Buffer Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Improvement were made to better protect the sas_device, ↵nagalakshmi.nandigama@lsi.com2012-04-234-271/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | raid_device, and expander_device lists There were possible race conditions surrounding reading an object from the link list while from another context in the driver was removing it. The nature of this enhancement is to rearrange locking so the link lists are better protected. Change set: (1) numerous routines were rearranged so spin locks are held through the entire time a link list object is being read from or written to. (2) added new routines for object deletion from link list. Thus ensuring lock was held during the deletion of the link list object, then and memory for object freed outside the lock. The memory was freed outside the lock so driver had access to device object info which was required for notifying the scsi mid layer that a device was getting deleted. (3) added the ioc->blocking_handles parameter. This is a bitmask used to identify which devices need blocking when there is device loss. This was introduced so that lock can be held for the entire time traversing the link list objects, and the bitmask was set to indicate which device handles need blocking. Oustide the lock the ioc->blocking_handles bitmask is traversed, with the respective device handle the scsi mid layer is called for moving devices into blocking state. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas : Perform Target Reset instead of HBA reset when a ↵nagalakshmi.nandigama@lsi.com2012-04-231-1/+2
| | | | | | | SATA_PASSTHROUGH cmd timeout happens Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Added multisegment mode support for Linux BSG Drivernagalakshmi.nandigama@lsi.com2012-04-231-29/+104
| | | | | | | | | Added support for Block IO requests with multiple segments (vectors) in the SMP handler of the SAS Transport Class. This is required by the BSG driver. Multisegment support added for both, Request and Response. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Removed redundant global mutex for IOCTLsnagalakshmi.nandigama@lsi.com2012-04-231-175/+122
| | | | | | | | | | | | | | When the lock_kernel and unlock_kernel routines were removed in the 2.6.39 kernel, a global mutex was added on top of the existing mutex which already existed. With this implementation, only one IOCTL will be active at any time no matter how many ever controllers are present. This causes poor performance. Removed the global mutex so that the driver can work with the existing semaphore that was already part of the existing code. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: MPI next revision header updatenagalakshmi.nandigama@lsi.com2012-04-232-19/+56
| | | | | | | | | | | Changeset in MPI headers: 1) Bumped MPI2_HEADER_VERSION_UNIT 2) Added 4K sectors supported bit to CapabilitiesFlags field of IOC Page 6. 3) Added UEFIVersion field to BIOS Page 1 and defined additional BiosOptions bits to control UEFI behavior. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* Merge tag 'scsi-misc' of ↵Linus Torvalds2012-03-312-7/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 Pull SCSI updates from James Bottomley: "This is primarily another round of driver updates (lpfc, bfa, fcoe, ipr) plus a new ufshcd driver. There shouldn't be anything controversial in here (The final deletion of scsi proc_ops which caused some build breakage has been held over until the next merge window to give us more time to stabilise it). I'm afraid, with me moving continents at exactly the wrong time, anything submitted after the merge window opened has been held over to the next merge window." * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits) [SCSI] ipr: Driver version 2.5.3 [SCSI] ipr: Increase alignment boundary of command blocks [SCSI] ipr: Increase max concurrent oustanding commands [SCSI] ipr: Remove unnecessary memory barriers [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters [SCSI] ipr: Fix target id allocation re-use problem [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up [SCSI] bfa: Update the driver version to 3.0.23.0 [SCSI] bfa: BSG and User interface fixes. [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario. [SCSI] bfa: Move service parameter programming logic into firmware. [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation. [SCSI] bfa: Flash controller IOC pll init fixes. [SCSI] bfa: Serialize the IOC hw semaphore unlock logic. [SCSI] bfa: Modify ISR to process pending completions [SCSI] bfa: Add fc host issue lip support [SCSI] mpt2sas: remove extraneous sas_log_info messages [SCSI] libfc: fcoe_transport_create fails in single-CPU environment [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2] ...
| * [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revisionSergei Shtylyov2012-03-282-6/+2
| | | | | | | | | | | | | | | | | | commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision) converted all drivers to use pci_dev->revision. Convert these three drivers which got missed. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * [SCSI] mpt2sas: remove extraneous sas_log_info messagesSathisha Nanjappa2012-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This fix ensures that the IOP_LOGINFO_CODE_TASK_TERMINATED messages do not clutter the sas_log_info messages. Bugzilla 42142 - mpt2sas: Number specified in wrong base https://bugzilla.kernel.org/show_bug.cgi?id=42142 Signed-off-by: Sathisha Nanjappa <sathisha.nanjappa@hp.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | Merge branch 'linux-next' of ↵Linus Torvalds2012-03-231-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci Pull PCI changes (including maintainer change) from Jesse Barnes: "This pull has some good cleanups from Bjorn and Yinghai, as well as some more code from Yinghai to better handle resource re-allocation when enabled. There's also a new initcall_debug feature from Arjan which will print out quirk timing information to help identify slow quirks for fixing or refinement (Yinghai sent in a few patches to do just that once the new debug code landed). Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas. He's been a core PCI and Linux contributor for some time now, and has kindly volunteered to take over. I just don't feel I have the time for PCI review and work that it deserves lately (I've taken on some other projects), and haven't been as responsive lately as I'd like, so I approached Bjorn asking if he'd like to manage things. He's going to give it a try, and I'm confident he'll do at least as well as I have in keeping the tree managed, patches flowing, and keeping things stable." Fix up some fairly trivial conflicts due to other cleanups (mips device resource fixup cleanups clashing with list handling cleanup, ppc iseries removal clashing with pci_probe_only cleanup etc) * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits) PCI: Bjorn gets PCI hotplug too PCI: hand PCI maintenance over to Bjorn Helgaas unicore32/PCI: move <asm-generic/pci-bridge.h> include to asm/pci.h sparc/PCI: convert devtree and arch-probed bus addresses to resource powerpc/PCI: allow reallocation on PA Semi powerpc/PCI: convert devtree bus addresses to resource powerpc/PCI: compute I/O space bus-to-resource offset consistently arm/PCI: don't export pci_flags PCI: fix bridge I/O window bus-to-resource conversion x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()' PCI / PCIe: Introduce command line option to disable ARI PCI: make acpihp use __pci_remove_bus_device instead PCI: export __pci_remove_bus_device PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device PCI: print out PCI device info along with duration PCI: Move "pci reassigndev resource alignment" out of quirks.c PCI: Use class for quirk for usb host controller fixup PCI: Use class for quirk for ti816x class fixup PCI: Use class for quirk for intel e100 interrupt fixup ...
| * | PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_deviceYinghai Lu2012-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old pci_remove_bus_device actually did stop and remove. Make the name reflect that to reduce confusion. This patch is done by sed scripts and changes back some incorrect __pci_remove_bus_device changes. Suggested-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* | | Merge tag 'scsi-misc' of ↵Linus Torvalds2012-03-222-3/+8
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 SCSI updates from James Bottomley: "The update includes the usual assortment of driver updates (lpfc, qla2xxx, qla4xxx, bfa, bnx2fc, bnx2i, isci, fcoe, hpsa) plus a huge amount of infrastructure work in the SAS library and transport class as well as an iSCSI update. There's also a new SCSI based virtio driver." * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (177 commits) [SCSI] qla4xxx: Update driver version to 5.02.00-k15 [SCSI] qla4xxx: trivial cleanup [SCSI] qla4xxx: Fix sparse warning [SCSI] qla4xxx: Add support for multiple session per host. [SCSI] qla4xxx: Export CHAP index as sysfs attribute [SCSI] scsi_transport: Export CHAP index as sysfs attribute [SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry [SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry [SCSI] pm8001: fix endian issue with code optimization. [SCSI] pm8001: Fix possible racing condition. [SCSI] pm8001: Fix bogus interrupt state flag issue. [SCSI] ipr: update PCI ID definitions for new adapters [SCSI] qla2xxx: handle default case in qla2x00_request_firmware() [SCSI] isci: improvements in driver unloading routine [SCSI] isci: improve phy event warnings [SCSI] isci: debug, provide state-enum-to-string conversions [SCSI] scsi_transport_sas: 'enable' phys on reset [SCSI] libsas: don't recover end devices attached to disabled phys [SCSI] libsas: fixup target_port_protocols for expanders that don't report sata [SCSI] libsas: set attached device type and target protocols for local phys ...
| * | [SCSI] mpt2sas: spell "primitive" correctly in function prototypeAndrew Morton2012-02-191-3/+3
| | | | | | | | | | | | | | | | | | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | [SCSI] mpt2sas: add missing allocation checkTomas Henzl2012-02-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The __get_free_pages can fail, so the return value should be checked. Spotted thanks to Stanislaw. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | | Merge branch 'for-linus' of ↵Linus Torvalds2012-03-201-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree from Jiri Kosina: "It's indeed trivial -- mostly documentation updates and a bunch of typo fixes from Masanari. There are also several linux/version.h include removals from Jesper." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (101 commits) kcore: fix spelling in read_kcore() comment constify struct pci_dev * in obvious cases Revert "char: Fix typo in viotape.c" init: fix wording error in mm_init comment usb: gadget: Kconfig: fix typo for 'different' Revert "power, max8998: Include linux/module.h just once in drivers/power/max8998_charger.c" writeback: fix fn name in writeback_inodes_sb_nr_if_idle() comment header writeback: fix typo in the writeback_control comment Documentation: Fix multiple typo in Documentation tpm_tis: fix tis_lock with respect to RCU Revert "media: Fix typo in mixer_drv.c and hdmi_drv.c" Doc: Update numastat.txt qla4xxx: Add missing spaces to error messages compiler.h: Fix typo security: struct security_operations kerneldoc fix Documentation: broken URL in libata.tmpl Documentation: broken URL in filesystems.tmpl mtd: simplify return logic in do_map_probe() mm: fix comment typo of truncate_inode_pages_range power: bq27x00: Fix typos in comment ...
| * | Merge branch 'master' into for-nextJiri Kosina2012-02-0310-205/+374
| |\ \ | | |/ | | | | | | | | | Sync with Linus' tree to be able to apply patch to a newer code (namely drivers/gpu/drm/gma500/psb_intel_lvds.c)
| * | mpt2sas: Fix typo in mpt2sas_config.cMasanari Iida2012-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Correct spelling "mappping" to "mapping" in drivers/scsi/mpt2sas/mpt2sas_config.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | [SCSI] mpt2sas: Fix mismatch in mpt2sas_base_hard_reset_handler() mutex ↵Alexey Khoroshilov2012-02-121-1/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | lock-unlock If ioc->pci_error_recovery is set, goto out in mpt2sas_base_hard_reset_handler() leads to unlock unheld ioc->reset_in_progress_mutex. The patch fixes the issue by jumping afer mutex_unlock() call. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Removed redundant calling of _scsih_probe_devices() from ↵nagalakshmi.nandigama@lsi.com2011-12-152-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _scsih_probe Removed redundant calling of _scsih_probe_devices() from _scsih_probe as it is getting called from _scsih_scan_finished. Also moved the function scsi_scan_host(shost) to get called after the volumes on warp drive are reported to the OS. Otherwise by the time the (ioc->hide_drives) flags is set, the volumes on warp drive are reported to the OS already. Also modified the initialization of reply queues only in case of driver load time in the function _base_make_ioc_operational(). Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Remove unused duplicate diag_buffer_enable paramRoland Dreier2011-12-151-13/+0
| | | | | | | | | | | | | | | | | | | | | | Commit 921cd8024b90 ("[SCSI] mpt2sas: New feature - Fast Load Support") moved handling of the diag_buffer_enable module parameter from mpt2sas_base.c to mpt2sas_scsih.c, but it left an old copy of the parameter in mpt2sas_base.c. Remove the unused stub. Signed-off-by: Roland Dreier <roland@purestorage.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Fix possible integer truncation of cpu_countRoland Dreier2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When computing reply_queue_count (the number of MSI-X vectors to use), the driver does ioc->reply_queue_count = min_t(u8, ioc->cpu_count, ioc->msix_vector_count); However, on a big machine, ioc->cpu_count could be outside the range that fits in a u8; eg a system with 256 CPUs will end up reply_queue_count set to 0. Fix this by calculating the minimum as ints and then letting the assignment to reply_queue_count handle integer demotion. Signed-off-by: Roland Dreier <roland@purestorage.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Fix leak on mpt2sas_base_attach() error pathRoland Dreier2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 911ae9434f83 ("[SCSI] mpt2sas: Added NUNA IO support in driver which uses multi-reply queue support of the HBA") added new allocations to the beginning of mpt2sas_base_attach(), which means directly returning an error on failure of mpt2sas_base_map_resources() will leak those allocations. Fix this by doing "goto out_free_resources" in this place too, as the rest of the function does. Signed-off-by: Roland Dreier <roland@purestorage.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas : Bump driver vesion to 12.100.00.00nagalakshmi.nandigama@lsi.com2011-12-151-2/+2
| | | | | | | | | | | | | | Bump driver vesion to 12.100.00.00 Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas : Fix for memory allocation error for large host creditsnagalakshmi.nandigama@lsi.com2011-12-152-58/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The amount of memory required for tracking chain buffers is rather large, and when the host credit count is big, memory allocation failure occurs inside __get_free_pages. The fix is to limit the number of chains to 100,000. In addition, the number of host credits is limited to 30,000 IOs. However this limitation can be overridden this using the command line option max_queue_depth. The algorithm for calculating the reply_post_queue_depth is changed so that it is equal to (reply_free_queue_depth + 16), previously it was (reply_free_queue_depth * 2). Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Do not retry a timed out direct IO for warpdrivenagalakshmi.nandigama@lsi.com2011-12-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When an I/O request to a WarpDrive is timed out by SML and if the I/O request to the WarpDrive is sent as direct I/O then the aborted direct I/O will be retried as normal Volume I/O and which results in failure of Target Reset and results in host reset. The fix is to not retry a failed IO to volume when the original IO was sent as direct IO with an ioc status MPI2_IOCSTATUS_SCSI_TASK_TERMINATED. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Release spinlock for the raid device list before blocking itnagalakshmi.nandigama@lsi.com2011-12-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Added code to release the spinlock that is used to protect the raid device list before calling a function that can block. The blocking was causing a reschedule, and subsequently it is tried to acquire the same lock, resulting in a panic (NMI Watchdog detecting a CPU lockup). Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: MPI next revision header updatenagalakshmi.nandigama@lsi.com2011-12-154-23/+90
| | | | | | | | | | | | | | | | | | | | | | | | 1)Removed Power Management Control option for PCIe link. 2)Added RAID Action for performing a compatibility check. Added product-specific range to RAID Action values. 3)Added PhysicalPort field to SAS Device Status Change Event data. 4)Added SpinupFlags field containing a Disable Spin-up bit to the SpinupGroupParameters fields of SAS IO Unit Page 4. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Added support for customer specific brandingnagalakshmi.nandigama@lsi.com2011-12-152-0/+28
| | | | | | | | | | Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Increase max transfer support from 4MB to 16MBnagalakshmi.nandigama@lsi.com2011-12-151-5/+5
| | | | | | | | | | | | | | | | Increase max transfer support from 4MB to 16MB. This is done by changing the shost->max_sector from 8192 to 32767 Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Support for greater than 2TB capacity WarpDrivenagalakshmi.nandigama@lsi.com2011-12-152-43/+74
| | | | | | | | | | | | | | | | The driver is modified to allow access to the greater than 2TB WarpDrive and properly handle direct-io mapping for WarpDrive volumes greater than 2TB. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Bump driver version to 11.100.00.00nagalakshmi.nandigama@lsi.com2011-12-151-2/+2
| | | | | | | | | | Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Rearrange the the code so that the completion queues are ↵nagalakshmi.nandigama@lsi.com2011-12-153-11/+12
| | | | | | | | | | | | | | initialized prior to sending the request to controller firmware Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Do not set sas_device->starget to NULL from the ↵nagalakshmi.nandigama@lsi.com2011-12-151-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | slave_destroy callback when all the LUNS have been deleted If the sas_device->starget to NULL from slave_destroy callback for LUN=1 even though LUN=0 exist, results in entire target getting deleted. To resolve the issue, the driver should only set sas_device->starget to NULL when all the LUNS have been deleted from the slave_destroy. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: MPI next revision header updatenagalakshmi.nandigama@lsi.com2011-12-154-22/+36
| | | | | | | | | | | | | | | | | | | | | | | | 1) Added product specific range of ImageType macros for the Extended Image Header. 2) Added Flags field and related defines to MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST to support automatic reserve/release and page addressing. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Adding support for customer specific brandingnagalakshmi.nandigama@lsi.com2011-12-152-2/+7
| | | | | | | | | | Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: When IOs are terminated, update the result to DID_SOFT_ERROR ↵nagalakshmi.nandigama@lsi.com2011-12-151-0/+2
| | | | | | | | | | | | | | to avoid infinite resets Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] mpt2sas: Better handling DEAD IOC (PCI-E LInk down) error conditionnagalakshmi.nandigama@lsi.com2011-12-153-0/+63
|/ | | | | | | | | | | | Detection of Dead IOC has been done in fault_reset_work thread. If IOC Doorbell is 0xFFFFFFFF, it will be detected as non-operation/DEAD IOC. When a DEAD IOC is detected, the code is modified to remove that IOC and all its attached devices from OS. The PCI layer API pci_remove_bus_device() is called to remove the dead IOC. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: _scsih_smart_predicted_fault uses GFP_KERNEL in interrupt ↵Anton Blanchard2011-12-121-1/+1
| | | | | | | | | | | context _scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC. Signed-off-by: Anton Blanchard <anton@samba.org> Cc: <stable@kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: add missing allocation.Dan Carpenter2011-11-101-0/+5
| | | | | | | | | | | There was supposed to be a kzalloc() here and the compiler complained about it. mpt2sas_scsih.c: In function ‘mpt2sas_scsih_reset_handler’: mpt2sas_scsih.c:2807:21: warning: ‘fw_event’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Bump driver version to 10.100.00.00nagalakshmi.nandigama@lsi.com2011-10-301-3/+3
| | | | | | | Bump driver vesion to 10.100.00.00 Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] mpt2sas: Fix for Panic when inactive volume is tried deletingnagalakshmi.nandigama@lsi.com2011-10-302-31/+82
| | | | | | | | | | | | | | | | The driver was setting the action to MPI2_CONFIG_ACTION_PAGE_READ_CURRENT, which only returns active volumes. In order to get info on inactive volumes, the driver needs to change the action to MPI2_RAID_PGAD_FORM_GET_NEXT_CONFIGNUM, and traverse each config till the iocstatus is MPI2_IOCSTATUS_CONFIG_INVALID_PAGE returned. Added a change in the driver to remove the instance of sas_device object when the driver returns "1" from the slave_configure callback. Also fixed code to report the hot spares to the operating system with a /dev/sg assigned. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
OpenPOWER on IntegriCloud