aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-10-01ufs: Add clock initialization supportSujit Reddy Thumma4-2/+178
Add generic clock initialization support for UFSHCD platform driver. The clock info is read from device tree using standard clock bindings. A generic max-clock-frequency-hz property is defined to save information on maximum operating clock frequency the h/w supports. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-10-01ufs: Add regulator enable supportSujit Reddy Thumma4-3/+318
UFS devices are powered by at most three external power supplies - - VCC - The flash memory core power supply, 2.7V to 3.6V or 1.70V to 1.95V - VCCQ - The controller and I/O power supply, 1.1V to 1.3V - VCCQ2 - Secondary controller and/or I/O power supply, 1.65V to 1.95V For some devices VCCQ or VCCQ2 are optional as they can be generated using internal LDO inside the UFS device. Add DT bindings for voltage regulators that can be controlled from host driver. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-10-01ufs: Allow vendor specific initializationSujit Reddy Thumma4-38/+194
Some vendor specific controller versions might need to configure vendor specific - registers, clocks, voltage regulators etc. to initialize the host controller UTP layer and Uni-Pro stack. Provide some common initialization operations that can be used to configure vendor specifics. The methods can be extended in future, for example, for power mode transitions. The operations are vendor/board specific and hence determined with the help of compatible property in device tree. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-10-01scsi: don't add scsi_device if its already visibleSubhash Jadavani1-0/+3
If LLD has added scsi device (by calling scsi_add_device) before scheduling async scsi_scan_host then scsi_finish_async_scan() will end up calling scsi_sysfs_add_sdev for scsi device which was already added by LLD. This patch fixes this issue by skipping the call to scsi_sysfs_add_sdev() if it's already visible to rest of the kernel. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-10-01scsi: fix the type for well known LUsSubhash Jadavani1-0/+13
Some devices may respond with wrong type for well-known logical units. This patch forces well-known type for devices which doesn't report it correct. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30sd: Honor block layer integrity handling flagsMartin K. Petersen3-46/+116
A set of flags introduced in the block layer enable better control over how protection information is handled. These flags are useful for both error injection and data recovery purposes. Checking can be enabled and disabled for controller and disk, and the guard tag format is now a per-I/O property. Update sd_protect_op to communicate the relevant information to the low-level device driver via a set of flags in scsi_cmnd. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-30scsi_debug: deadlock between completions and surprise module removalDouglas Gilbert1-14/+19
A deadlock has been reported when the completion of SCSI commands (simulated by a timer) was surprised by a module removal. This patch removes one half of the offending locks around timer deletions. This fix is applied both to stop_all_queued() which is were the deadlock was discovered and stop_queued_cmnd() which has very similar logic. This patch should be applied both to the lk 3.17 tree and Christoph's drivers-for-3.18 tree. Tested-and-reported-by: Milan Broz <gmazyland@gmail.com> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30be2iscsi: check ip buffer before copyingMike Christie1-5/+8
Dan Carpenter found a issue where be2iscsi would copy the ip from userspace to the driver buffer before checking the len of the data being copied: http://marc.info/?l=linux-scsi&m=140982651504251&w=2 This patch just has us only copy what we the driver buffer can support. Cc: <stable@vger.kernel.org> Tested-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30iscsi_tcp: export port being usedMike Christie2-2/+9
This just has iscsi_tcp support ISCSI_PARAM_LOCAL_PORT which exports the local port being used by the iscsi connection. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30be2iscsi : Bump the driver versionJohn Soni Jose1-1/+1
Bump the driver version Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30be2iscsi : Fix kernel panic during reboot/shutdownJohn Soni Jose1-1/+1
In the reboot/shutdown path, workqueue was destroyed after the adapter resource were freed. The task associated with workqueue was getting executed after resources were freed. This lead to kernel panic. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30libfc: Replace rcu_assign_pointer() with RCU_INIT_POINTER()Andreea-Cristina Bernat1-2/+2
The uses of "rcu_assign_pointer()" are NULLing out the pointers. According to RCU_INIT_POINTER()'s block comment: "1. This use of RCU_INIT_POINTER() is NULLing out the pointer" it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle semantic patch was used: @@ @@ - rcu_assign_pointer + RCU_INIT_POINTER (..., NULL) Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com> Acked-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-30fcoe: extend ethtool to FC port speed mappingChris Leech1-6/+33
add support for 20 Gbit and 40 Gbit links Signed-off-by: Chris Leech <cleech@redhat.com> Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-27block: Add T10 Protection Information functionsMartin K. Petersen2-222/+20
The T10 Protection Information format is also used by some devices that do not go through the SCSI layer (virtual block devices, NVMe). Relocate the relevant functions to a block layer library that can be used without involving SCSI. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Integrity checksum flagMartin K. Petersen1-2/+4
Make the choice of checksum a per-I/O property by introducing a flag that can be inspected by the SCSI layer. There are several reasons for this: 1. It allows us to switch choice of checksum without unloading and reloading the HBA driver. 2. During error recovery we need to be able to tell the HBA that checksums read from disk should not be verified and converted to IP checksums. 3. For error injection purposes we need to be able to write a bad guard tag to storage. Since the storage device only supports T10 CRC we need to be able to disable IP checksum conversion on the HBA. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Relocate bio integrity flagsMartin K. Petersen1-2/+2
Move flags affecting the integrity code out of the bio bi_flags and into the block integrity payload. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Add a disk flag to block integrity profileMartin K. Petersen1-1/+7
So far we have relied on the app tag size to determine whether a disk has been formatted with T10 protection information or not. However, not all target devices provide application tag storage. Add a flag to the block integrity profile that indicates whether the disk has been formatted with protection information. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@dev.mellanox.co.il> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Clean up the code used to generate and verify integrity metadataMartin K. Petersen1-50/+56
Instead of the "operate" parameter we pass in a seed value and a pointer to a function that can be used to process the integrity metadata. The generation function is changed to have a return value to fit into this scheme. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Deprecate the use of the term sector in the context of block integrityMartin K. Petersen1-23/+23
The protection interval is not necessarily tied to the logical block size of a block device. Stop using the terms "sector" and "sectors". Going forward we will use the term "seed" to describe the initial reference tag value for a given I/O. "Interval" will be used to describe the portion of the data buffer that a given piece of protection information is associated with. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Remove integrity tagging functionsMartin K. Petersen1-65/+0
None of the filesystems appear interested in using the integrity tagging feature. Potentially because very few storage devices actually permit using the application tag space. Remove the tagging functions. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-27block: Replace bi_integrity with bi_specialMartin K. Petersen1-4/+4
For commands like REQ_COPY we need a way to pass extra information along with each bio. Like integrity metadata this information must be available at the bottom of the stack so bi_private does not suffice. Rename the existing bi_integrity field to bi_special and make it a union so we can have different bio extensions for each class of command. We previously used bi_integrity != NULL as a way to identify whether a bio had integrity metadata or not. Introduce a REQ_INTEGRITY to be the indicator now that bi_special can contain different things. In addition, bio_integrity(bio) will now return a pointer to the integrity payload (when applicable). Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-26ipr: fix compile failureChristoph Hellwig1-1/+1
Fix a typo in the IPR_IOASC_HW_CMD_FAILED declaration. Based on a patch from Wen Xiong <wenxiong@linux.vnet.ibm.com>. Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add memory barrier before ringing doorbell.Himanshu Madhani1-0/+16
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add flags for tracing the target commands.Saurav Kashyap3-4/+74
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Fix hang due to cmd_kref not decrementingQuinn Tran2-12/+7
Signed-off-by: Quinn Tran <quinn.tran@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Do not send SS_RESIDUAL_UNDER with SAM_STAT_BUSYHimanshu Madhani1-6/+0
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add support for QFull throttling and Term Exchange retryQuinn Tran5-8/+316
Through the qla target code, the qlt_send_term_exchange() routine is used in various different places to cleanup an exchange. For the case of IOCB request queue is full, the exchange is left unhandled/ dangling. Existing code does not have re-try logic to cleanup the exchange. This patch add retry logic to cleanup the exchange before letting new commands through. For the case of FW running out of exchanges, driver need to reply SAM_STAT_BUSY to the initiators. This patch add a pending queue for the busy reply in case IOCB queue is unable to handle the cmd. Cc: <stable@vger.kernel.org> Signed-off-by: Quinn Tran <quinn.tran@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Increase the request queue size to 8K for ISP2031Saurav Kashyap2-1/+2
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Host reset handling in ABTS path.Arun Easi1-0/+2
ABTS path takes path similar to regular task management, but reset_count was not initialized when allocating mcmd causing the response to get dropped in qlt_xmit_tm_rsp. Fix this by initializing reset_count correctly. Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Handle chip reset in target mode.Arun Easi6-3/+72
A chip reset can occur after driver submits command to the stack. Abort command processing if a chip reset has occurred or in progress when you get a follow up for a command. Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add Host reset handling in target mode.Arun Easi4-1/+78
Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: fix crash due to task mgmt cmd typeHimanshu Madhani1-2/+7
tcm_qla2xxx_get_task_tag incorrectly assume command is qla_tgt_cmd. Add check to see if it's a scsi cmd or task mgmt command. Signed-off-by: Quinn Tran <quinn.tran@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add counter for messageSaurav Kashyap1-5/+5
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Enable SLER conditionally in target mode.Arun Easi1-4/+19
Sequence level error recovery (aka FC Tape) is not really required for disk devices. On heavily loaded system, with slow turn around, a bunch of status enquiries using REC puts additional burden to the target, so just turn off SLER by default. Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Remove verbose messages in target mode.Arun Easi1-138/+16
Turning logging bits for target mode ON dumps quite a lot verbose messages, remove those and change some of the IO path logging to use IO bits. Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Increase room in request queue for sending priority packetsHimanshu Madhani1-2/+2
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Use correct offset to req-q-out for reserve calculationArun Easi1-3/+1
Cc: <stable@vger.kernel.org> Signed-off-by: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: fix kernel NULL pointer accessHimanshu Madhani1-0/+1
This patch is to fix regression added by commit id 51a07f84649d2be206c4c2ad9a612956db0c2f8c. When allocating memory for new session original patch does not assign vha to op->vha resulting into NULL pointer access during qlt_create_sess_from_atio(). Cc: <stable@vger.kernel.org> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Fix sparse warnings in tcm_qla2xxx.cHimanshu Madhani1-6/+6
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Update the driver version to 8.07.00.16-k.Saurav Kashyap1-1/+1
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Fix sparse warning in qla_iocb.c file.Joe Carnuccio1-1/+1
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Move warning message to debug level.Sawan Chandak1-1/+1
Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Fail adapter initialization on load ram failure.Chad Dupuis1-2/+2
If we fail to load one of the segments of firmware fail the operation instead of trying to continue which will lead to a system crash since the pointers to the next segment will not be updated correctly. Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Disable PCI device in shutdown handler.Chad Dupuis1-0/+3
Disable the PCI device during shutdown to prevent any races with other PCI code such as the AER handling code. Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Mark port lost when we receive an RSCN for it.Chad Dupuis1-1/+16
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Restore WWPN in case of Loop Dead.Himanshu Madhani4-3/+18
For FA-WWPN capable device, ISP2031 and ISP27XX, when loop dead is detected by a driver, restore WWPN from NVRAM. Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Honor FCP_RSP retry delay timer field.Chad Dupuis5-1/+32
Parse the retry delay timer field from the FCP response data and if: - It is not zero - The SCSI status is busy or queue full return SCSI_MLQUEUE_TARGET_BUSY for the number of milliseconds specified in the retry delay timer field. Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Add missing ISP27xx checks to optrom code.Alex Vechersky2-2/+3
Signed-off-by: Alex Vechersky <alex.vechersky@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Force use of mailbox interface for flash access commands for ISP27xx.Chad Dupuis1-1/+3
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-25qla2xxx: Free sysfs attributes for ISP27xx.Nigel Kirkland1-0/+2
Signed-off-by: Nigel Kirkland <nigel.kirkland@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>