summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid/megaraid_sas_base.c
AgeCommit message (Collapse)Author
2015-01-08megaraid_sas: corrected return of wait_event from abort frame pathSumit.Saxena@avagotech.com
commit 170c238701ec38b1829321b17c70671c101bac55 upstream. 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> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-19[SCSI] megaraid: Use resource_size_t for PCI resources, not longBen Collins
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>
2013-11-29[SCSI] Disable WRITE SAME for RAID and virtual host adapter driversMartin K. Petersen
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>
2013-11-15Merge branch 'for-linus' of ↵Linus Torvalds
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 ...
2013-10-25[SCSI] megaraid_sas: Fix synchronization problem between sysPD IO path and ↵Sumit.Saxena@lsi.com
AEN path There is syncronization problem between sysPD IO path and AEN path. Driver maintains instance->pd_list[] array, which will get updated(by calling function megasas_get_pd_list[]), whenever any of below events occurs- MR_EVT_PD_INSERTED MR_EVT_PD_REMOVED MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED MR_EVT_FOREIGN_CFG_IMPORTED At same time running sysPD IO will be accessing the same array instance->pd_list[], which is getting updated in AEN path, because of this IO may not get correct PD info from instance->pd_list[] array. Signed-off-by: Adam Radford <adam.radford@lsi.com> Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-10-25[SCSI] megaraid_sas: fixes for few endianess issuesSumit.Saxena@lsi.com
Fixed two issues in this patch- 1) In function megasas_get_pd_list(), data read(pd_addr->deviceId) from DMAed memory is converted to CPU's endianess. 2) While register AEN, removed some endianness conversion on some fields, since their endianess is already converted. Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-10-14SCSI: remove unnecessary pci_set_drvdata()Jingoo Han
Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Cc: James Bottomley <JBottomley@parallels.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-10[SCSI] megaraid_sas: addded support for big endian architectureSumit.Saxena@lsi.com
This patch will add big endian architecture support to megaraid_sas driver. The support added is for LSI MegaRAID all generation controllers- (3Gb/s, 6Gb/s and 12 Gb/s controllers). We have done basic sanity test @ppc64 arch and @x86_64. Additional testing/observations are welcome. [jejb: fix up rejections] 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>
2013-09-06[SCSI] megaraid_sas: Version and Changelog updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-09-06[SCSI] megaraid_sas: Add High Availability clustering support using shared ↵adam radford
Logical Disks Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-08-02[SCSI] megaraid_sas: megaraid_sas driver init fails in kdump kernelSumit.Saxena@lsi.com
Problem: When Hardware IOMMU is on, megaraid_sas driver initialization fails in kdump kernel with LSI MegaRAID controller(device id-0x73). Actually this issue needs fix in firmware, but for firmware running in field, this driver fix is proposed to resolve the issue. At firmware initialization time, if firmware does not come to ready state, driver will reset the adapter and retry for firmware transition to ready state unconditionally(not only executed for kdump kernel). Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Cc: stable@vger.kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-07-05[SCSI] megaraid_sas: fix memory leak if SGL has zero length entriesBjørn Mork
commit 98cb7e44 ([SCSI] megaraid_sas: Sanity check user supplied length before passing it to dma_alloc_coherent()) introduced a memory leak. Memory allocated for entries following zero length SGL entries will not be freed. Reference: http://bugs.debian.org/688198 Signed-off-by: Bjørn Mork <bjorn@mork.no> Cc: <stable@vger.kernel.org> Acked-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-06-28[SCSI] megaraid: minor cut and paste error fixed.James Georgas
This looks like a cut and paste typo to me. Both of the megasas_read_fw_status_reg_* functions involved are identical though, so there was no bad behaviour. I changed it for consistency and clarity. Signed-off-by: James Georgas <soulpa7ch@gmail.com> Acked-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-06-24[SCSI] megaraid_sas: Changelog and driver version updateSumit.Saxena@lsi.com
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>
2013-06-24[SCSI] megaraid_sas: Add support to differentiate between iMR vs MR FirmwareSumit.Saxena@lsi.com
Add support to differentiate between iMR(no external memory) and MR(with external memory) controllers. 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>
2013-06-24[SCSI] megaraid_sas: Add support for Uneven Span PRL11Sumit.Saxena@lsi.com
MegaRAID older Firmware does not support uneven span configuration for PRL11. E.g User wants to create 34 Driver PRL11 config, it was not possible using old firmware, since it was not supported configuration in old firmware Old Firmware expect even number of Drives in each span and same number of physical drives at each span. Considering above design, 17 Drives at Span-0 and 17 drives at span-1 was not possible. Now, using this new feature Firmware and Driver both required changes. New Firmware can allow user to create 16 Drives at span-0 and 18 Drives at span-1. This will allow user to create 34 Drives Uneven span PRL11. RAID map is interface between Driver and FW to fetch all required fields(attributes) for each Virtual Drives. Since legacy RAID map consider Even Span design, there was no place to keep Uneven span information in existing Raid map. Because of this limitation, for Uneven span VD, driver can not use RAID map. This patch address the changes required in Driver to support Uneven span PRL11 support. 1. Driver will find if Firmware has UnevenSpanSupport or not by reading Controller Info. 2. If Firmware has UnvenSpan PRL11 support, then Driver will inform about its capability of handling UnevenSpan PRL11 to the firmware. 3. Driver will update its copy of span info on each time Raid map update is called. 4. Follow different IO path if it is Uneven Span. (For Uneven Span, Driver uses Span Set info to find relavent fields for that particular Virtual Disk) More verbose prints will be available by setting "SPAN_DEBUG" to 1 at compilation time. 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>
2013-06-24[SCSI] megaraid_sas: Add support for Extended MSI-x vectors for 12Gb/s ↵Sumit.Saxena@lsi.com
controller This Driver will use more than 8 MSI-x support provided by Invader/Fury max upto 128 MSI-x. [jejb: fix checkpatch warning] 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>
2013-06-24[SCSI] megaraid_sas: Add support for MegaRAID Fury (device ID-0x005f) 12Gb/s ↵Sumit.Saxena@lsi.com
controllers 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>
2013-06-24[SCSI] megaraid_sas: Free event detail memory without device ID checkSumit.Saxena@lsi.com
Free event detail memory from more common place, instead of doing it for limited device types. Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com> Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-06-24[SCSI] megaraid_sas: Fix the interrupt mask for Gen2 controllerSumit.Saxena@lsi.com
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>
2013-06-24[SCSI] megaraid_sas: Return DID_ERROR for SCSI IO, when controller is in ↵Sumit.Saxena@lsi.com
critical h/w error Do not return SCSI_MLQUEUE_HOST_BUSY, but send DID_ERROR to SCSI mid-layer, if adapter is in critical error state. "SCSI_MLQUEUE_HOST_BUSY" will keep same SCSI command in loop and it is not a right return value, if controller is hardware critical error. 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>
2013-05-02[SCSI] megaraid_sas: release lock on error pathDan Carpenter
We should unlock here before returning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-04-18[SCSI] megaraid_sas: Use correct #define for MSI-X capabilityBjorn Helgaas
Previously we used PCI_MSI_FLAGS to locate a register in the MSI-X capability. This did work because the MSI and MSI-X flags happen to be at the same offsets, but was confusing. PCI_MSIX_FLAGS_ENABLE is already defined in include/uapi/linux/pci_regs.h, so no need to define it again. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Adam Radford <aradford@gmail.com>
2013-02-22[SCSI] megaraid_sas: Version and Changelog updateadam radford
This patch updates the megaraid_sas driver version and updates Documentation/scsi/ChangeLog.megaraid_sas. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-03Drivers: scsi: remove __dev* attributes.Greg Kroah-Hartman
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Adam Radford <linuxraid@lsi.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-04megaraid: fix BUG_ON() from incorrect use of delayed workXiaotian Feng
megaraid use INIT_WORK to declare a hotplug_work, but cast the hotplug_work from work_struct to delayed_work and schedule_delayed_work on it. This is very dangerous, as other part of delayed_work might be kernel memories allocated by others. With commit 8852aac ("workqueue: mod_delayed_work_on() shouldn't queue timer on 0 delay"), schedule_delayed_work() will check dwork->timer before queue_work even when @delay is 0, this causes megaraid code to hit the BUG_ON() in workqueue code. Change megaraid code to use delayed work. Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Neela Syam Kolli <megaraidlinux@lsi.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: linux-scsi@vger.kernel.org
2012-10-09[SCSI] megaraid_sas: Version, Changelog, Copyright updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-09[SCSI] megaraid_sas: Remove duplicate codeadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-09[SCSI] megaraid_sas: Add module param for configurable MSI-X vector countadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-02Merge SCSI misc branch into isci-for-3.6 tagJames Bottomley
2012-08-24[SCSI] megaraid_sas: Version and Changelog updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-08-24[SCSI] megaraid_sas: Add resetwaittime module parameteradam radford
This allows a user to adjust the wait time in seconds after I/O timeout before resetting the adapter. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-08-24[SCSI] megaraid_sas: Add throttlequeuedepth module parameteradam radford
This allows a user to adjust the queue depth of the adapter when throttled due to I/O timeout. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-08-22[SCSI] megaraid_sas: Move poll_aen_lock initializerKashyap Desai
The following patch moves the poll_aen_lock initializer from megasas_probe_one() to megasas_init(). This prevents a crash when a user loads the driver and tries to issue a poll() system call on the ioctl interface with no adapters present. Signed-off-by: Kashyap Desai <Kashyap.Desai@lsi.com> Signed-off-by: Adam Radford <aradford@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-23[SCSI] megaraid_sas: Version and Changelog updateadam radford
The following patch for megaraid_sas updates the driver version to v00.00.06.15-rc1, and updates Documentation/scsi/ChangeLog.megaraid_sas. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-01-16[SCSI] megaraid_sas: Version and Changelog updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-01-16[SCSI] megaraid_sas: remove poll_mode_io codeadam radford
This code has never worked correctly, doesn't disable interrupts when set as a module parameter, doesn't disable interrupts when set after driver load time in sysfs node, etc. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-01-16[SCSI] megaraid_sas: mask off flags in ioctl pathadam radford
Mask off flags in the ioctl path to prevent memory scribble with older MegaCLI versions. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-20[SCSI] megaraid_sas: Fix instance access in megasas_reset_timeradam radford
The following patch for megaraid_sas will fix a potential bad pointer access in megasas_reset_timer(), when a MegaRAID 9265/9285 or 9360/9380 gets a timeout. megasas_build_io_fusion() sets SCp.ptr to be a struct megasas_cmd_fusion *, but then megasas_reset_timer() was casting SCp.ptr to be a struct megasas_cmd *, then trying to access cmd->instance, which is invalid. Just loading instance from scmd->device->host->hostdata in megasas_reset_timer() fixes the issue. Signed-off-by: Adam Radford <aradford@gmail.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-16[SCSI] megaraid_sas: Changelog and version updateadam radford
The following patch for megaraid_sas updates the ChangeLog.megaraid_sas file and updates the driver version. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-16[SCSI] megaraid_sas: Add driver workaround for PERC5/1068 kdump kernel panicadam radford
The following patch for megaraid_sas adds a driver workaround for PERC5/1068 based controller FW that keeps a command from the main kernel that the driver cannot cancel which was causing a kernel panic in shutdown of the kdump kernel. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-16[SCSI] megaraid_sas: Add multiple MSI-X vector/multiple reply queue supportadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-16[SCSI] megaraid_sas: Add support for MegaRAID 9360/9380 12GB/s controllersadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-16[SCSI] megaraid_sas: Continue booting immediately if FW in FAULT at driver ↵adam radford
load time Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] megaraid_sas Version to 5.40-rc1 and Changelog updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] megaraid_sas: Add .change_queue_depth supportadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-05-24[SCSI] megaraid_sas: Version and Changelog updateadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24[SCSI] megaraid_sas: Add 1078 OCR supportadam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24[SCSI] megaraid_sas: Fix bug where AENs could be lost in probe() and resume()adam radford
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24[SCSI] megaraid_sas: Disable interrupts/free_irq() in megasas_shutdown()adam radford
The following patch for megaraid_sas disables interrupts and free_irq() in megasas_shutdown(). Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>