- 06 Sep, 2015 15 commits
-
-
Nagarajkumar Narayanan authored
mpt2sas: setpci reset on nytro warpdrive card along with sysfs access and cli ioctl access resulted in kernel oops 1. pci_access_mutex lock added to provide synchronization between IOCTL, sysfs, PCI resource handling path 2. gioc_lock spinlock to protect list operations over multiple controllers >From c53a1cff4c07528b8b9ec7f6716e94950283e8f9 Mon Sep 17 00:00:00 2001 From: Nagarajkumar Narayanan <nagarajkumar.narayanan@seagate.com> Date: Tue, 18 Aug 2015 11:58:13 +0530 Subject: [PATCH] mpt2sas setpci reset oops fix In mpt2sas driver due to lack of synchronization between ioctl, BRM status access through sysfs, pci resource removal kernel oops happen as ioctl path and BRM status sysfs access path still tries to access the removed resources Two locks added to provide syncrhonization 1. pci_access_mutex: Mutex to synchronize ioctl,sysfs show path and pci resource handling. PCI resource freeing will lead to free vital hardware/memory resource, which might be in use by cli/sysfs path functions resulting in Null pointer reference followed by kernel crash. To avoid the above race condition we use mutex syncrhonization which ensures the syncrhonization between cli/sysfs_show path Note: pci_access_mutex is used only if nytro warpdrive cards (ioc->is_warpdrive based on device id) are used as we could not test this case with other SAS2 HBA cards We can remove this check if this behaviour confirmed from other cards. 2. spinlock on list operations over IOCs Case: when multiple warpdrive cards(IOCs) are in use Each IOC will added to the ioc list stucture on initialization. Watchdog threads run at regular intervals to check IOC for any fault conditions which will trigger the dead_ioc thread to deallocate pci resource, resulting deleting the IOC netry from list, this deletion need to protected by spinlock to enusre that ioc removal is syncrhonized, if not synchronized it might lead to list_del corruption as the ioc list is traversed in cli path Signed-off-by:
Nagarajkumar Narayanan <nagarajkumar.narayanan@seagate.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Acked-by:
Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Johannes Thumshirn authored
In case psataPayload->status has a status of IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY ts->stat gets set to SAS_OPEN_REJECT but a missing 'break' statement causes a fallthrough to the default handler of the switch statement overriding ts->stat to SAS_DEV_NO_RESPONSE. Signed-off-by:
Johannes Thumshirn <jthumshirn@suse.de> Acked-by:
Jack Wang <jinpu.wang@profitbricks.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Johannes Thumshirn authored
If the bf_get() call in lpfc_mbx_cmpl_rdp_page_a2() does succeeds, execution continues normally and mp gets kfree()d. If the subsequent call to lpfc_sli_issue_mbox() fails execution jumps to the error label where lpfc_mbuf_free() is called with mp->virt and mp->phys as function arguments. This is the use after free. Following the use after free mp gets kfree()d again which is a double free. Signed-off-by:
Johannes Thumshirn <jthumshirn@suse.de> Acked-by:
James Smart <james.smart@avagotech.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Anil Gurumurthy authored
Signed-off-by:
Anil Gurumurthy <anil.gurumurthy@qlogic.com> Tested-by:
Sudarsana Kalluru <sudarsana.kalluru@qlogic.com> Reviewed-by:
Ewan D. Milne <emilne@redhat.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Anil Gurumurthy authored
Signed-off-by:
Anil Gurumurthy <anil.gurumurthy@qlogic.com> Tested-by : Sudarasana Kalluru <sudarsana.kalluru@qlogic.com> Reviewed-by:
Ewan D. Milne <emilne@redhat.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Jordan Hargrave authored
Dell Server backplanes can report bay/enclosure IDs without an expander present. This patch allows the bay/enclosure IDs to be propagaged to sysfs.we Signed-off-by:
Jordan Hargrave <jordan_hargrave@dell.com> Reviewed-by:
Hannes Reinecke <hare@suse.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
Fixes the following warning In function ‘resp_requests’: drivers/scsi//scsi_debug.c:1432:15: warning: variable ‘want_dsense’ set but not used [-Wunused-but-set-variable] bool dsense, want_dsense; Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
The use case to report 'REPORT LUNS WLUN' described in scsi_debug documentation didn't work because: scsi_scan_host_selected() checks for: lun < shost->max_lun To fix this we set: max_lun = SCSI_W_LUN_REPORT_LUNS + 1; Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
fixes warning: warning: no previous prototype for ‘dump_sector’ Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
use SCSI_W_LUN_REPORT_LUNS from scsi.h instead of localy defined SAM2_WLUN_REPORT_LUNS Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Tomas Winkler authored
Use pr_fmt with both module name and __func__ Also drop few bare printk leftovers The log format should stay pretty much intact Signed-off-by:
Tomas Winkler <tomas.winkler@intel.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Calvin Owens authored
The fw_event_work struct is concurrently referenced at shutdown, so add a refcount to protect it, and refactor the code to use it. Additionally, refactor _scsih_fw_event_cleanup_queue() such that it no longer iterates over the list without holding the lock, since _firmware_event_work() concurrently deletes items from the list. Signed-off-by:
Calvin Owens <calvinowens@fb.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Nicholas Bellinger <nab@linux-iscsi.org> Tested-by:
Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by:
Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Calvin Owens authored
These objects can be referenced concurrently throughout the driver, we need a way to make sure threads can't delete them out from under each other. This patch adds the refcount, and refactors the code to use it. Additionally, we cannot iterate over the sas_device_list without holding the lock, or we risk corrupting random memory if items are added or deleted as we iterate. This patch refactors _scsih_probe_sas() to use the sas_device_list in a safe way. Signed-off-by:
Calvin Owens <calvinowens@fb.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Nicholas Bellinger <nab@linux-iscsi.org> Tested-by:
Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by:
Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
- 28 Aug, 2015 12 commits
-
-
Hannes Reinecke authored
When calling scsi_dh_activate() we should be returning SCSI_DH_NOTCONN if the device handler couldn't be attached. Reviewed-by:
Bart van Assche <bart.vanassche@sandisk.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
The I/O submission and completion paths call into the device handler without any synchronization agains detachment. So disallow detaching device handlers at runtime. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
And cleanup the various messy opencoded versions of this. Note that this moves the sdev_state checks outside the queue_lock coverage, but as we don't hold the lock over the activation they are only advisory anyway. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
Add a ->handler and a ->handler_data field to struct scsi_device and kill this indirection. Also move struct scsi_device_handler to scsi_dh.h so that changes to it don't require rebuilding every SCSI LLDD. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
Add a single list of devices that need non-ALUA device handlers to the core scsi_dh code so that we can autoload the modules for them at probe time. While this is a little ugly in terms of architecture it actually significantly simplifies the code in addition to the new autoloading functionality. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Acked-by:
Mike Snitzer <snitzer@redhat.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
Stop building scsi_dh as a separate module and integrate it fully into the core SCSI code with explicit callouts at bus scan time. For now the callouts are placed at the same point as the old bus notifiers were called, but in the future we will be able to look at ALUA INQUIRY data earlier on. Note that this also means that the device handler modules need to be loaded by the time we scan the bus. The next patches will add support for autoloading device handlers at bus scan time to make sure they are always loaded if they are enabled in the kernel config. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Acked-by:
Mike Snitzer <snitzer@redhat.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
Prepare for building scsi_dh.c into the core SCSI module by moving it to drivers/scsi. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
This way we can reused the same code any attachment method, not just those requested from dm-mpath. [jejb: fixup checkpatch error] Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Acked-by:
Mike Snitzer <snitzer@redhat.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Christoph Hellwig authored
While allowing dm-mpath to attach device handlers is a functionality we need for backwards compatibility reason there is no reason to reference count them and detach them if dm-mpath stops using the device for some reason. If the device handler works for the given device it can just stay attached, and we can take the retain_hw_handler codepath. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Mike Snitzer <snitzer@redhat.com> Acked-by:
Hannes Reinecke <hare@Suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Hannes Reinecke authored
If no user settings are found it's pointless trying to read them from flash. So skip that step. This also fixes a compilation warning about uninitialized variables in aic94xx. Signed-off-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Gabriel Krisman Bertazi authored
Remove unnecessary check that disabled SIS pipe commands for SIS-32 devices. This change was sufficient to enable raw mode and send SIS pipe commands for a 57B3 device. Fixes: f8ee25d7 ("ipr: AF DASD raw mode implementation in ipr driver") Signed-off-by:
Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> Reviewed-by:
Wen Xiong <wenxiong@linux.vnet.ibm.com> Acked-by:
Brian King <brking@linux.vnet.ibm.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Gabriel Krisman Bertazi authored
Disable underlength error verification based on count of bytes actually transferred for AF DASD devices when SIS pipe mode is enabled. This avoids unexpected underlength errors when issuing some commands in raw mode. Signed-off-by:
Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> Reviewed-by:
Wen Xiong <wenxiong@linux.vnet.ibm.com> Acked-by:
Brian King <brking@linux.vnet.ibm.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
- 27 Aug, 2015 13 commits
-
-
Sreekanth Reddy authored
Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Issue: When the disks are getting discovered and assigned device handles by the kernel, a device block followed by an unblock (due to broadcast primitives) issued by the driver is interspersed by the kernel changing the state of the device. Therefore the unblock by the driver results in a no operation within the kernel API. To fix this one, the below patch checks the return of the unblock API and performs a block followed by an unblock to unfreeze the block layer's I/O queue. Sufficient checks and prints are also added in the driver to identify this condition caused by the kernel. Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Added dma_mapping_error() API after mapping an address with dma_map_single() API. Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it complains about mpt3sas driver not calling dma_mapping_error after mapping an address with dma_map_single Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Created a thread using alloc_ordered_workqueue() API in order to process the works from firmware Work-queue sequentially instead of create_singlethread_workqueue() API. Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Joe Lawrence <joe.lawrence@stratus.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
"VendorID" "DeviceID" "SubsystemVendor ID" "SubsystemDevice ID" Cisco Branding String 0x1000 0x97 0x1137 0x154 Cisco 9300-8i 12Gbps SAS HBA 0x1000 0x97 0x1137 0x155 Cisco 12G Modular SAS Pass through Controller 0x1000 0x97 0x1137 0x156 UCS C3X60 12G SAS Pass through Controller Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
mpt3sas: Return host busy error status to SML when DMA mapping of scatter gather list fails for a SCSI command scsi_dma_map API will return a negative value (i.e. -ENOMEM) if DMA mapping of sg lists fails and zero if the sg list in the SCSI cmd is NULL. But drivers doesn't handled sg list DMA mapping failure case properly. So, Updated the code to return host busy error status to SCSI MID Layer(SML), when DMA mapping of scatter gather list fails for a SCSI command. So that SML will retry this SCSI cmd after some time. Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
For any SCSI command, if the driver receives IOC status = SCSI_IOC_TERMINATED and log info = 0x32010081 then that command will be completed with DID_RESET host status. The definition of this log info value is "Virtual IO has failed and has to be retried". Firmware will provide this log info value with IOC Status "SCSI_IOC_TERMINATED", whenever a drive (with is a part of a volume) is pulled and pushed back within some minimal delay. With this log info value, firmware informs the driver to retry the failed IO command infinite times, so to provide some time for the firmware to discover the reinserted drive successfully instated of just retrying failed command for five times(doesn't giving enough time for firmware to complete the drive discovery) and failing the IO permanently even though drive came back successfully. Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Below are the new changes to MPI 2.5 Rev K(2.5.6) specification and 2.00.35 header files 1) Added a minimum size requirement for target mode command buffers. 2) Added MinMSIxIndex and MaxMSIxIndex fields to CommandBufferPostBase Request. 3) For BIOS Page 1, added SSUTimeout field, and added Product Name String Format bits to the BiosOptions field Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Add the following OEM's branding to the mpt3sas driver. "VendorID" "DeviceID" "SubsystemVendor ID" "SubsystemDevice ID" Cisco Branding String 0x1000 0x97 SVID = 0x1137 0x014C Cisco 9300-8E 12G SAS HBA Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Added the following Dell branding to the mpt3sas driver. "VendorID" "DeviceID" "SubsystemVendor ID" "SubsystemDevice ID" Dell Branding String 0x1000 0x0097 0x1028 0x1F46 DELL 12Gbps HBA Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Following is the change set, 1. Added more defines for the BiosOptions field of MPI2_CONFIG_PAGE_BIOS_1. 2. Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC definition. Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-
Sreekanth Reddy authored
Signed-off-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by:
James Bottomley <JBottomley@Odin.com>
-