summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-linus' of ↵Linus Torvalds2014-12-121-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree update from Jiri Kosina: "Usual stuff: documentation updates, printk() fixes, etc" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits) intel_ips: fix a type in error message cpufreq: cpufreq-dt: Move newline to end of error message ps3rom: fix error return code treewide: fix typo in printk and Kconfig ARM: dts: bcm63138: change "interupts" to "interrupts" Replace mentions of "list_struct" to "list_head" kernel: trace: fix printk message scsi: mpt2sas: fix ioctl in comment zbud, zswap: change module author email clocksource: Fix 'clcoksource' typo in comment arm: fix wording of "Crotex" in CONFIG_ARCH_EXYNOS3 help gpio: msm-v1: make boolean argument more obvious usb: Fix typo in usb-serial-simple.c PCI: Fix comment typo 'COMFIG_PM_OPS' powerpc: Fix comment typo 'CONIFG_8xx' powerpc: Fix comment typos 'CONFiG_ALTIVEC' clk: st: Spelling s/stucture/structure/ isci: Spelling s/stucture/structure/ usb: gadget: zero: Spelling s/infrastucture/infrastructure/ treewide: Fix company name in module descriptions ...
| * treewide: fix typo in printk and KconfigMasanari Iida2014-11-201-1/+1
| | | | | | | | | | | | | | | | | | This patch fix spelling typo in printk and Kconfig within various part of kernel sources. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | scsi: drop reason argument from ->change_queue_depthChristoph Hellwig2014-11-242-32/+2
| | | | | | | | | | | | | | | | | | | | | | Drop the now unused reason argument from the ->change_queue_depth method. Also add a return value to scsi_adjust_queue_depth, and rename it to scsi_change_queue_depth now that it can be used as the default ->change_queue_depth implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
* | scsi: don't allow setting of queue_depth bigger than can_queueChristoph Hellwig2014-11-242-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | We won't ever queue more commands than the host allows. Instead of letting drivers either reject or ignore this case handle it in common code. Note that various driver use internal constant or variables that are assigned to both shost->can_queue and checked in ->change_queue_depth - I did remove those checks as well. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
* | megaraid_sas: do not process IOCTLs and SCSI commands during driver removalSumit.Saxena@avagotech.com2014-11-241-4/+15
| | | | | | | | | | | | | | | | | | | | | | Do not process any SCSI and IOCTL command further (return them with appropriate return values to callers), while driver removal is in progress or PCI shutdown is invoked. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: dndinaness related bug fixesSumit.Saxena@avagotech.com2014-11-242-14/+16
| | | | | | | | | | | | | | | | | | | | This patch addresses few endianness related bug fixes. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: corrected return of wait_event from abort frame pathSumit.Saxena@avagotech.com2014-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Corrected wait_event() call which was waiting for wrong completion status (0xFF). Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: make HBA operational after LD_MAP_SYNC DCMD in OCR pathSumit.Saxena@avagotech.com2014-11-241-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | In OCR(Online Controller Reset) path, driver sets adapter state to MEGASAS_HBA_OPERATIONAL before getting new RAID map. There will be a small window where IO will come from OS with old RAID map. This patch will update adapter state to MEGASAS_HBA_OPERATIONAL, only after driver has new RAID map to avoid any IOs getting build using old RAID map. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: online Firmware upgrade support for Extended VD featureSumit.Saxena@avagotech.com2014-11-244-57/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | In OCR (Online Controller Reset) path, driver sets adapter state to MEGASAS_HBA_OPERATIONAL before getting new RAID map. There will be a small window where IO will come from OS with old RAID map. This patch will update adapter state to MEGASAS_HBA_OPERATIONAL, only after driver has new RAID map to avoid any IOs getting build using old RAID map. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: update MAINTAINERS and copyright information for megaraid driversSumit.Saxena@avagotech.com2014-11-245-40/+47
| | | | | | | | | | | | | | | | Update MAINTAINERS list and copyright information for megaraid_sas driver. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | megaraid_sas: driver version upgrade and remove some meta data of driverSumit.Saxena@avagotech.com2014-11-242-26/+2
| | | | | | | | | | | | | | | | | | Update driver version and remove some meta data (release date and extended version) about megaraid_sas driver. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* | scsi: don't set tagging state from scsi_adjust_queue_depthChristoph Hellwig2014-11-122-3/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Remove the tagged argument from scsi_adjust_queue_depth, and just let it handle the queue depth. For most drivers those two are fairly separate, given that most modern drivers don't care about the SCSI "tagged" status of a command at all, and many old drivers allow queuing of multiple untagged commands in the driver. Instead we start out with the ->simple_tags flag set before calling ->slave_configure, which is how all drivers actually looking at ->simple_tags except for one worke anyway. The one other case looks broken, but I've kept the behavior as-is for now. Except for that we only change ->simple_tags from the ->change_queue_type, and when rejecting a tag message in a single driver, so keeping this churn out of scsi_adjust_queue_depth is a clear win. Now that the usage of scsi_adjust_queue_depth is more obvious we can also remove all the trivial instances in ->slave_alloc or ->slave_configure that just set it to the cmd_per_lun default. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
* megaraid_sas: fix bug in handling return value of pci_enable_msix_range()Jiang Liu2014-11-101-1/+1
| | | | | | | | | | | | | | | | | Function pci_enable_msix_range() may return negative values for error conditions. So it's a bug by checking (pci_enable_msix_range() != 0) for success and causes failure to megaraid driver when MSI is disabled. [ 16.487267] megaraid_sas 0000:02:00.0: Controller type: iMR [ 16.487275] genirq: Flags mismatch irq 0. 00000000 (megasas) vs. 00015a00 (tii mer) [ 16.487347] megasas: Failed to register IRQ for vector 0. Fixes: 8ae80ed1734b "megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()" Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Acked-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: <stable@vger.kernel.org> # 3.17
* megaraid_sas : Driver version updateSumit.Saxena@avagotech.com2014-09-162-4/+4
| | | | | | | | | | | Resending the patch. Addressed the review comments by Tomas Henzl. Driver version upgrade patch. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : MFI MPT linked list corruption fixSumit.Saxena@avagotech.com2014-09-164-83/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Added comment for to-do work. Problem statement: MFI link list in megaraid_sas driver is used from mfi-mpt pass-through commands. This list can be corrupted due to many possible race conditions in driver and eventually we may see kernel panic. One example - MFI frame is freed from calling process as driver send command via polling method and interrupt for that command comes after driver free mfi frame (actually even after some other context reuse the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and access that MFI frame and finally in-used MFI frame’s list will be corrupted. High level description of new solution - Free MFI and MPT command from same context. Free both the command either from process (from where mfi-mpt pass-through was called) or from ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which will do MFI/MPT list corruption. Renamed the cmd_pool_lock which is used in instance as well as fusion with below name. mfi_pool_lock and mpt_pool_lock to add more code readability. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : N-drive primary raid level 1 load balancingSumit.Saxena@avagotech.com2014-09-164-68/+96
| | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Current driver does fast path read load balancing between arm and mirror disk for two Drive Raid-1 configuration only. Now, Driver support fast path read load balancing for all (any number of disk) Raid-1 configuration. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Add module parameter to disable IRQ-CPU affinity hintSumit.Saxena@avagotech.com2014-09-161-22/+38
| | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. For certain deployment, we may need to disable irq cpu affinity hint. This module parameter provides option for use to disable irq cpu affinity hint and allow irqbalancer to handle the rest. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Round down max sge supported by controller to power of twoSumit.Saxena@avagotech.com2014-09-161-2/+2
| | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Round down the max sge to power of two. Earlier max sge limit is 70 SGE, which will allow block layer to send 280K IO frame. It is optimal to provide max IO size aligned to the smallest possible stripe size. E.a Consider that we have configured RAID Volumes which does not allow Fast Path across the stripe. Raid volume with stripe size = 256K, will have peformance hit if we get io frame of size 280K. Driver will not send IO frame large than stripe size to the Fast Path. Also, FW will convert 280K frame into 256K + 24K. This is an additional overhead. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Host lock less mode to enabled asynchronous IO submissionSumit.Saxena@avagotech.com2014-09-161-7/+4
| | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Megaraid_sas driver can now work in host lock less mode. Remove host lock less as megaraid_sas driver will have safer access to raid map as described in earlier patch. We now keep Driver Raid map copy, which will make sure that driver will always have old or new map Driver raid map will be replaced safely in MR_PopulateDrvRaidMap(), so there is no issue even if IO is continue from the scsi mid layer. There is a plan to remove "host_lock" and "hba_lock" usage from megaraid_sas in future. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Extended VD supportSumit.Saxena@avagotech.com2014-09-165-185/+500
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. reserved1 field(part of union) of Raid map struct was not required so it is removed. Current MegaRAID firmware and hence the driver only supported 64VDs. E.g: If the user wants to create more than 64VD on a controller, it is not possible on current firmware/driver. New feature and requirement to support upto 256VD, firmware/driver/apps need changes. In addition to that there must be a backward compatibility of the new driver with the older firmware and vice versa. RAID map is the interface between Driver and FW to fetch all required fields(attributes) for each Virtual Drives. In the earlier design driver was using the FW copy of RAID map where as in the new design the Driver will keep the RAID map copy of its own; on which it will operate for any raid map access in fast path. Local driver raid map copy will provide ease of access through out the code and provide generic interface for future FW raid map changes. For the backward compatibility driver will notify FW that it supports 256VD to the FW in driver capability field. Based on the controller properly returned by the FW, the Driver will know whether it supports 256VD or not and will copy the RAID map accordingly. At any given time, driver will always have old or new Raid map. So with this changes, driver can also work in host lock less mode. Please see next patch which enable host lock less mode for megaraid_sas driver. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Firmware crash dump feature supportSumit.Saxena@avagotech.com2014-09-163-5/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Move buff_offset inside spinlock, corrected loop at crash dump buffer free, reset_devices check is added to disable fw crash dump feature in kdump kernel. This feature will provide similar interface as kernel crash dump feature. When megaraid firmware encounter any crash, driver will collect the firmware raw image and dump it into pre-configured location. Driver will allocate two different segment of memory. #1 Non-DMA able large buffer (will be allocated on demand) to capture actual FW crash dump. #2 DMA buffer (persistence allocation) just to do a arbitrator job. Firmware will keep writing Crash dump data in chucks of DMA buffer size into #2, which will be copy back by driver to the host memory as described in #1. Driver-Firmware interface: ================== A.) Host driver can allocate maximum 512MB Host memory to store crash dump data. This memory will be internal to the host and will not be exposed to the Firmware. Driver may not be able to allocate 512 MB. In that case, driver will do possible memory (available at run time) allocation to store crash dump data. Let’s call this buffer as Host Crash Buffer. Host Crash buffer will not be contigious as a whole, but it will have multiple chunk of contigious memory. This will be internal to driver and firmware/application are unaware of it. Partial allocation of Host Crash buffer may have valid information to debug depending upon what was collected in that buffer and depending on nature of failure. Complete Crash dump is the best case, but we do want to capture partial buffer just to grab something rather than nothing. Host Crash buffer will be allocated only when FW Crash dump data is available, and will be deallocated once application copy Host Crash buffer to the file. Host Crash buffer size can be anything between 1MB to 512MB. (It will be multiple of 1MBs) B.) Irrespective of underlying Firmware capability of crash dump support, driver will allocate DMA buffer at start of the day for each MR controllers. Let’s call this buffer as “DMA Crash Buffer”. For this feature, size of DMA crash buffer will be 1MB. (We will not gain much even if DMA buffer size is increased.) C.) Driver will now read Controller Info sending existing dcmd “MR_DCMD_CTRL_GET_INFO”. Driver should extract the information from ctrl info provided by firmware and figure out if firmware support crash dump feature or not. Driver will enable crash dump feature only if “Firmware support Crash dump” + “Driver was able to create DMA Crash Buffer”. If either one from above is not set, Crash dump feature should be disable in driver. Firmware will enable crash dump feature only if “Driver Send DCMD- MR_DCMD_SET_CRASH_BUF_PARA with MR_CRASH_BUF_TURN_ON” Helper application/script should use sysfs parameter fw_crash_xxx to actually copy data from host memory to the filesystem. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Update threshold based reply post host index registerSumit.Saxena@avagotech.com2014-09-162-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Current driver updates reply post host index to let firmware know that replies are processed, while returning from ISR function, only if there is no oustanding replies in reply queue. Driver will free the request frame immediately from ISR but reply post host index is not yet updated. It means freed request can be used by submission path and there may be a tight loop in request/reply path. In such condition, firmware may crash when it tries to post reply and there is no free reply post descriptor. Eventually two things needs to be change to avoid this issue. Increase reply queue depth (double than request queue) to accommodate worst case scenario. Update reply post host index to firmware once it reach to some pre-defined threshold value. This change will make sure that firmware will always have some buffer of reply descriptor and will never find empty reply descriptor in completion path. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Use writeq for 64bit pci write to avoid spinlock overheadSumit.Saxena@avagotech.com2014-09-161-0/+6
| | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Reduce the assingment for u64 req_data variable. Use writeq() for 64bit PCI write instead of writel() to avoid additional lock overhead. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas : Do not scan non syspd drivesSumit.Saxena@avagotech.com2014-09-161-31/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resending the patch. Addressed the review comments from Tomas Henzl. Current driver allow device scan for all the devices on channel 0 and 1. E.a If we have two single drive raid volumes, we may see prints like below. First two prints are for physical device which are used to form VD. Prints like this creates confusion as it is really not required to scan any hidden physical devices. scsi1 : LSI SAS based MegaRAID driver scsi 1:0:0:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 scsi 1:0:1:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 scsi 1:2:0:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 scsi 1:2:1:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 When slave_alloc called, sdev-type will not be set, so current code will always return "0" in slave_alloc callback. This patch make sure that driver return "-ENXIO" for non-syspd devices. After this patch, we will see prints in syslog only for devices which are exposed. For current example, below print will be available in syslog. scsi1 : LSI SAS based MegaRAID driver scsi 1:2:0:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 scsi 1:2:1:0: Direct-Access LSI MR9361-8i 4.21 PQ: 0 ANSI: 5 Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: Version and Changelog updateAdam Radford2014-09-162-4/+4
| | | | | | | | | The following patch for megaraid_sas updates the driver version and Documentation/scsi/ChangeLog.megaraid_sas. Signed-off-by: Adam Radford <aradford@gmail.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: Fix reset_mutex leakAdam Radford2014-09-161-0/+1
| | | | | | | | The following patch for megaraid_sas fixes a reset_mutex leak in megasas_reset_fusion(). Signed-off-by: Adam Radford <aradford@gmail.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: Remove unused variables in megasas_instanceAdam Radford2014-09-161-2/+0
| | | | | | | | The following patch for megaraid_sas removes some unused variables from the megasas_instance structure. Signed-off-by: Adam Radford <aradford@gmail.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: Add missing initial call to megasas_get_ld_vf_affiliation().Adam Radford2014-09-161-0/+4
| | | | | | | | | The following patch for megaraid_sas adds a missing initial call to megasas_get_ld_vf_affiliation() at the end of megasas_probe_one(). Signed-off-by: Adam Radford <aradford@gmail.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: Fix LD/VF affiliation parsingAdam Radford2014-09-162-111/+208
| | | | | | | | | | | | The following patch for megaraid_sas fixes the LD/VF affiliation policy parsing code to account for LD targetId's and Hidden LD's (not yet affiliated with any Virtual Functions). This also breaks megasas_get_ld_vf_affiliation() into 2 separate functions: megasas_get_ld_vf_affiliation_111() and megasas_get_ld_Vf_affiliation_12() to reduce indentation levels. Signed-off-by: Adam Radford <aradford@gmail.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev2014-09-161-13/+7
| | | | | | | | | | | | | | | | As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Kashyap Desai <Kashyap.desai@avagotech.com> Cc: Neela Syam Kolli <megaraidlinux@lsi.com> Cc: linux-scsi@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid: Fail resume if MSI-X re-initialization failedAlexander Gordeev2014-09-161-3/+5
| | | | | | | | | | | | | | Currently the driver fails to analize MSI-X re-enablement status on resuming and always assumes the success. This update checks the MSI-X initialization result and fails to resume if MSI-Xs re-enablement failed. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Kashyap Desai <Kashyap.desai@avagotech.com> Cc: Neela Syam Kolli <megaraidlinux@lsi.com> Cc: linux-scsi@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Christoph Hellwig <hch@lst.de>
* scsi: use pci_zalloc_consistentJoe Perches2014-08-082-14/+10
| | | | | | | | | | | | | | | Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Cc: Adam Radford <linuxraid@lsi.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Cc: Dario Ballabio <ballabio_dario@emc.com> Cc: Michael Neuffer <mike@i-Connect.Net> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com> Cc: Neela Syam Kolli <megaraidlinux@lsi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* scsi: use 64-bit LUNsHannes Reinecke2014-07-172-3/+3
| | | | | | | | | | | | | The SCSI standard defines 64-bit values for LUNs, and large arrays employing large or hierarchical LUN numbers become more and more common. So update the linux SCSI stack to use 64-bit LUN numbers. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* megaraid_sas: fix a small problem when reading state value from hwTomas Henzl2014-05-191-8/+7
| | | | | | | | | | | | | When the driver reads state values from the hw it might happen that different values are read in subsequent reads and this can cause problems, this may lead to a timeout in this function and a non working adapter. Cc: Adam Radford <aradford@gmail.com> Signed-off-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Shintaro Minemoto <fj3207hq@aa.jp.fujitsu.com> Acked-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* [SCSI] megaraid_sas: Version and Changelog updateadam radford2014-03-152-4/+4
| | | | | | | | The following patch for megaraid_sas updates the driver version to v06.803.01.00-rc1, and updates Documentation/scsi/ChangeLog.megaraid_sas. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Add Dell PowerEdge VRTX SR-IOV VF supportadam radford2014-03-154-118/+851
| | | | | | | | | | | The following patch for megaraid_sas adds Dell PowerEdge VRTS SR-IOV VF support (Device ID 0x002f). This patch has some > 80 column lines that need to be left in place for code readability purposes. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Return leaked MPT frames to MPT frame pooladam radford2014-03-151-2/+5
| | | | | | | | The following patch for megaraid_sas will return leaked MPT frames from any polled DCMD's that timeout to the MPT frame pool. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Fix megasas_ioc_init_fusionadam radford2014-03-151-10/+7
| | | | | | | | | The following patch for megaraid_sas fixes the megasas_ioc_init_fusion function to use a local stack variable for the IOCinit frame physical address instead of clobbering the first request descriptor. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Load correct raid context timeoutadam radford2014-03-151-1/+4
| | | | | | | | The following patch for megaraid_sas loads the correct raid context timeout value for multpathing and clustering. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Performance boost fixesSumit.Saxena@lsi.com2014-03-152-9/+42
| | | | | | | | | | | | | | Host lock is added back around queuecommand. Host lock removal can create race conditon between ISR path(when RAID map update interrupt is raised) and IO build path of driver, since IO build path is making use of RAID map, and in case of RAID map update interrupt, old RAID map copy is memset to zero, which some IOs may be referencing in build IO path. Changes done for performance boost- 1) Added code to set SMP IRQ affinity per CPU. 2) Pass MSI-x index, while issuing sysPD IO. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Set 32-bit DMA maskSumit.Saxena@lsi.com2014-03-151-0/+13
| | | | | | | | | | If consistent DMA mask is set to 64 bit, fall back to 32bit DMA mask and 32bit consistent DMA mask. 64bit consistent DMA mask may be set on some 64bit DMA slot, which causes DMA offset "10000000000000" and MFI_INIT and IOCTL frames will have high memory addresses, leads to firmware FAULT. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Big endian code related fixesSumit.Saxena@lsi.com2014-03-153-7/+13
| | | | | | Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: Don't wait forever for non-IOCTL DCMDsSumit.Saxena@lsi.com2014-03-152-25/+55
| | | | | | | | | | | Don't wait forever for firmware response for internal DCMDs sent from driver firmware. Such DCMDs will be posted to firmware with timeout. Timeout is also introduced for DCMD sent to abort the commands. DCMD sent via IOCTL path will still be always blocking to keep the IOCTL design intact. Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas: check return value for megasas_get_pd_list()Hannes Reinecke2014-03-151-17/+21
| | | | | | | | | | When megasas_get_pd_list() fails we cannot detect any drives, so we should be checking the return value accordingly. [jejb: checkpatch fix] Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas_fusion: Return correct error value in ↵Hannes Reinecke2014-03-151-1/+1
| | | | | | | | | | | megasas_get_ld_map_info() When no HBA is found we should be returning '-ENXIO' to be consistent with the other return values. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid_sas_fusion: correctly pass queue info pointerHannes Reinecke2014-03-151-1/+4
| | | | | | | | | | The pointer to the queue info structure is potentially a 64-bit value, so we should be using the correct macros to set the values in the init frame. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid: missing bounds check in mimd_to_kioc()Dan Carpenter2014-03-151-0/+2
| | | | | | | | | | | pthru32->dataxferlen comes from the user so we need to check that it's not too large so we don't overflow the buffer. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] megaraid: Use resource_size_t for PCI resources, not longBen Collins2013-12-192-3/+3
| | | | | | | | | | The assumption that sizeof(long) >= sizeof(resource_size_t) can lead to truncation of the PCI resource address, meaning this driver didn't work on 32-bit systems with 64-bit PCI adressing ranges. Signed-off-by: Ben Collins <ben.c@servergy.com> Acked-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] Disable WRITE SAME for RAID and virtual host adapter driversMartin K. Petersen2013-11-292-0/+2
| | | | | | | | | | | | | | | | | | Some host adapters do not pass commands through to the target disk directly. Instead they provide an emulated target which may or may not accurately report its capabilities. In some cases the physical device characteristics are reported even when the host adapter is processing commands on the device's behalf. This can lead to adapter firmware hangs or excessive I/O errors. This patch disables WRITE SAME for devices connected to host adapters that provide an emulated target. Driver writers can disable WRITE SAME by setting the no_write_same flag in the host adapter template. [jejb: fix up rejections due to eh_deadline patch] Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2013-11-152-11/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual earth-shaking, news-breaking, rocket science pile from trivial.git" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits) doc: usb: Fix typo in Documentation/usb/gadget_configs.txt doc: add missing files to timers/00-INDEX timekeeping: Fix some trivial typos in comments mm: Fix some trivial typos in comments irq: Fix some trivial typos in comments NUMA: fix typos in Kconfig help text mm: update 00-INDEX doc: Documentation/DMA-attributes.txt fix typo DRM: comment: `halve' -> `half' Docs: Kconfig: `devlopers' -> `developers' doc: typo on word accounting in kprobes.c in mutliple architectures treewide: fix "usefull" typo treewide: fix "distingush" typo mm/Kconfig: Grammar s/an/a/ kexec: Typo s/the/then/ Documentation/kvm: Update cpuid documentation for steal time and pv eoi treewide: Fix common typo in "identify" __page_to_pfn: Fix typo in comment Correct some typos for word frequency clk: fixed-factor: Fix a trivial typo ...