commit 5f0dfb7a9bcc8139958f59ecb9bbd7e738ae702d Author: Chaitra P B Date: Fri May 6 14:29:31 2016 +0530 mpt3sas: Used "synchronize_irq()"API to synchronize timed-out IO & TMs Replaced mpt3sas_base_flush_reply_queues() with mpt3sas_base_sync_reply_irqs(),as mpt3sas_base_flush_reply_queues() skips over reply queues that are currently busy (i.e. being handled by interrupt processing in another core). If a reply queue is busy, then call to synchronize_irq()in mpt3sas_base_sync_reply_irqs()make sures the other core has finished flushing the queue and completed any calls to the mid-layer scsi_done() routine. Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit 6c197093847e8cdec844df39a373bfe1f9a1ac8a Author: Chaitra P B Date: Fri May 6 14:29:30 2016 +0530 mpt3sas: Set maximum transfer length per IO to 4MB for VDs Set maximum transfer length per IO on RAID volumes to 4MB by setting VD's queue's max_sector to 8192. Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit b2500d76a0dbaa8993cd6b43941d23d31a312831 Author: Chaitra P B Date: Fri May 6 14:29:29 2016 +0530 mpt3sas: Updating mpt3sas driver version to 13.100.00.00 Bump mpt3sas driver version from 12.100.00.00 to 13.100.00.00 Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit 648512ccd7d42ccf761f515b7c0cb456a48c477a Author: Chaitra P B Date: Fri May 6 14:29:28 2016 +0530 mpt3sas: Fix initial Reference tag field for 4K PI drives. Modified driver code to use scsi_prot_ref_tag() API instead of scsi_get_lba(), while initializing reference tag field in the CDB. Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit a470a51cd6481373cdf2b5934b1b9f7853688de9 Author: Chaitra P B Date: Fri May 6 14:29:27 2016 +0530 mpt3sas: Handle active cable exception event In-order to handle this 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event, driver need to follow below steps, 1. Unmask the 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event, so that FW can notify this event to host driver. 2. After receiving this event, add this event to AEN event queue, for notifying this event to applications. 3. Then Print below message in kernel logs if the event data's reason code is zero, "Currently an active cable with ReceptacleID cannot be powered and devices connected to this active cable will not be seen. This active cable requires of power" This event is only for Intruder/Cutlass HBAs. Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit 4fe6bc97efebdc5083aa749850928fad1740a60d Author: Chaitra P B Date: Fri May 6 14:29:26 2016 +0530 mpt3sas: Update MPI header to 2.00.42 Updated MPI version and MPI header files. ChangeList: * Added SATADeviceWaitTime to SAS IO Unit Page 4 * Added EEDPObservedValue added to SCSI IO Reply message * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT Signed-off-by: Chaitra P B Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit b324f6392eda4124f25017bd4633c167301ad9e3 Author: Dan Carpenter Date: Wed May 4 09:13:41 2016 +0300 eata_pio: missing break statement This missing break statement bug predates git. It's a very minor thing, it means that we print a '?' instead of a 'z' in dmesg. Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit ff615f065a48137e48985c78d8b17ce14b22fa90 Author: Petros Koutoupis Date: Mon May 9 13:44:10 2016 -0500 hpsa: Fix type ZBC conditional checks The device ID obtained from the inquiry can only be of a single type. The original code places a check for TYPE_ZBC right after the check for TYPE_DISK. Logically, if the first if statement sees a device of a TYPE_DISK and moves on to the second statement checking if not TYPE_ZBC, it will always hit the continue. [mkp: Applied by hand] Signed-off-by: Petros Koutoupis Acked-by: Don Brace Signed-off-by: Martin K. Petersen commit d230823a1c4c3e97afd4c934b86b3975d5e20249 Author: Hannes Reinecke Date: Mon May 9 09:14:29 2016 +0200 scsi_lib: Decode T10 vendor IDs Some arrays / HBAs will only present T10 vendor IDs, so we should be decoding them, too. [mkp: Fixed T10 spelling] Suggested-by: Paul Mackerras Signed-off-by: Hannes Reinecke Tested-by: Paul Mackerras Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit fe8b9534a0a0356f8a76467e2c561194bdb53c84 Author: Hannes Reinecke Date: Fri May 6 10:34:35 2016 +0200 scsi_dh_alua: do not fail for unknown VPD identification Not every device will return a useable VPD identification, but still might support ALUA. Rather than disable ALUA support we should be allowing the device identification to be empty and attach individual ALUA device handler to each devices. [mkp: Fixed typo reported by Bart] Reported-by: Paul Mackerras Signed-off-by: Hannes Reinecke Tested-by: Paul Mackerras Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1b37bd606deef0a787bdbbab6ff51dbebdeb9d3d Author: Douglas Gilbert Date: Fri May 6 00:40:29 2016 -0400 scsi_debug: use locally assigned naa For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 09ba24c18c7e0c215c39b3d92332b64132dae170 Author: Douglas Gilbert Date: Fri May 6 00:40:28 2016 -0400 scsi_debug: uuid for lu name Permit changing of a LU name from a (fake) IEEE registered NAA (5) to a locally assigned UUID. Using a UUID (RFC 4122) for a SCSI designation descriptor (e.g. a LU name) was added in spc5r08.pdf (a draft INCITS standard) on 25 January 2016. Add parameter uuid_ctl to use a separate UUID for each LU (storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 760f3b0342df19c2cfe53fffcc5ff5e2311447a6 Author: Douglas Gilbert Date: Fri May 6 00:40:27 2016 -0400 scsi_debug: vpd and mode page work Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c483739430f107c14b3fa316e9cdd3d1e065864a Author: Douglas Gilbert Date: Fri May 6 00:40:26 2016 -0400 scsi_debug: add multiple queue support Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default off. Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4e51af9ee7afa0ecf4829e7a44f7055db7968e02 Author: Dan Carpenter Date: Wed Apr 13 14:14:41 2016 +0300 bfa: fix bfa_fcb_itnim_alloc() error handling The caller assumes that "itnim" is NULL on error and non-NULL on success but really "itnim" is uninitialized on error. This function should just use normal error handling where it returns zero on success and negative on failure. Signed-off-by: Dan Carpenter Acked-by: Anil Gurumurthy Signed-off-by: Martin K. Petersen commit 13f307711b127d30fcf333a04365a217baf9ca2b Author: Andy Lutomirski Date: Tue May 3 10:24:31 2016 -0700 megaraid_sas: Downgrade two success messages to info I actually read the error messages in my logs, and successful initialization is not an error. Arguably these log lines could be deleted entirely. Signed-off-by: Andy Lutomirski Reviewed-by: Hannes Reinicke Acked-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 635f6b0893cff193a1774881ebb1e4a4b9a7fead Author: Manoj N. Kumar Date: Tue May 3 11:27:34 2016 -0500 cxlflash: Fix to resolve dead-lock during EEH recovery When a cxlflash adapter goes into EEH recovery and multiple processes (each having established its own context) are active, the EEH recovery can hang if the processes attempt to recover in parallel. The symptom logged after a couple of minutes is: INFO: task eehd:48 blocked for more than 120 seconds. Not tainted 4.5.0-491-26f710d+ #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. eehd 0 48 2 Call Trace: __switch_to+0x2f0/0x410 __schedule+0x300/0x980 schedule+0x48/0xc0 rwsem_down_write_failed+0x294/0x410 down_write+0x88/0xb0 cxlflash_pci_error_detected+0x100/0x1c0 [cxlflash] cxl_vphb_error_detected+0x88/0x110 [cxl] cxl_pci_error_detected+0xb0/0x1d0 [cxl] eeh_report_error+0xbc/0x130 eeh_pe_dev_traverse+0x94/0x160 eeh_handle_normal_event+0x17c/0x450 eeh_handle_event+0x184/0x370 eeh_event_handler+0x1c8/0x1d0 kthread+0x110/0x130 ret_from_kernel_thread+0x5c/0xa4 INFO: task blockio:33215 blocked for more than 120 seconds. Not tainted 4.5.0-491-26f710d+ #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. blockio 0 33215 33213 Call Trace: 0x1 (unreliable) __switch_to+0x2f0/0x410 __schedule+0x300/0x980 schedule+0x48/0xc0 rwsem_down_read_failed+0x124/0x1d0 down_read+0x68/0x80 cxlflash_ioctl+0x70/0x6f0 [cxlflash] scsi_ioctl+0x3b0/0x4c0 sg_ioctl+0x960/0x1010 do_vfs_ioctl+0xd8/0x8c0 SyS_ioctl+0xd4/0xf0 system_call+0x38/0xb4 INFO: task eehd:48 blocked for more than 120 seconds. The hang is because of a 3 way dead-lock: Process A holds the recovery mutex, and waits for eehd to complete. Process B holds the semaphore and waits for the recovery mutex. eehd waits for semaphore. The fix is to have Process B above release the semaphore before attempting to acquire the recovery mutex. This will allow eehd to proceed to completion. Signed-off-by: Manoj N. Kumar Reviewed-by: Matthew R. Ochs Signed-off-by: Martin K. Petersen commit 8d039e22b516c4c0ecaeb91f7566b5860fda14e7 Author: Douglas Gilbert Date: Sat Apr 30 22:44:43 2016 -0400 scsi_debug: rework resp_report_luns Based on "[PATH V2] scsi_debug: rework resp_report_luns" patch sent by Tomas Winkler on Thursday, 26 Feb 2015. His notes: 1. Remove duplicated boundary checks which simplify the fill-in loop 2. Use more of scsi generic API Replace fixed length response array a with heap allocation allowing up to 256 normal LUNs per target. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Reviewed-by: Tomas Winkler Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b01f6f8316af5226b0cada03e3b121e72dd4c17f Author: Douglas Gilbert Date: Sat Apr 30 22:44:42 2016 -0400 scsi_debug: use pdt constants Use TYPE_* constants for SCSI peripheral device types instead of numbers. Further cleanups requested by checkpatch.pl. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f46eb0e9fc763b7b66c325eb94e6aefa960146d2 Author: Douglas Gilbert Date: Mon Apr 25 12:16:34 2016 -0400 scsi_debug: use likely hints on fast path The most common commands in normal use are the READ and WRITE SCSI commands. Use likely and unlikely hints along the path taken by these commands. Rename check_readiness() to make_ua() and remove associated dead code. Rename devInfoReg() to find_build_dev_info(). Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit fd32119b0deac1af90ca3bed145f17d5ad68d5a7 Author: Douglas Gilbert Date: Mon Apr 25 12:16:33 2016 -0400 scsi_debug: re-order file scope declarations Group most defines together first; followed by struct definitions and then table and variable definitions. Normalize all function headers. [mkp: Corrected hex value in WP/DPOFUA MODE SENSE comment] Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit a10bc12af6347d2aa3a2ffbd5f8b7be260c12b85 Author: Douglas Gilbert Date: Mon Apr 25 12:16:32 2016 -0400 scsi_debug: replace tasklet with work queue When a negative value was placed in the delay parameter, a tasklet was scheduled. Change the tasklet to a work queue. Previously a delay of -1 scheduled a high priority tasklet; since there are no high priority work queues, treat -1 like other negative values in delay and schedule a work item. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit c2206098972e8ca464040897c95bdf5b2f45ac32 Author: Douglas Gilbert Date: Mon Apr 25 12:16:31 2016 -0400 scsi_debug: make jiffy delay name clearer Add 'j' to delay names to make it clearer that its unit is jiffies and to differentiate it from sdebug_ndelay whose unit is nanoseconds. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit b333a819813c756804034c93b05e43ccdd4025a5 Author: Douglas Gilbert Date: Mon Apr 25 12:16:30 2016 -0400 scsi_debug: replace jiffy timers with hr timers The driver supports two command delay interfaces, the original one whose unit is a jiffy, and a newer one whose unit is a nanosecond. Each had different implementations. Keep both interfaces but simplify the implemenation to use a single delay mechanism based on high resolution timers. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 185dd2329785981d458690c78fd56b320fef4ea7 Author: Douglas Gilbert Date: Mon Apr 25 12:16:29 2016 -0400 scsi_debug: ignore host lock option Remove logic to optionally hold host_lock while each command is queued. Keep module and sysfs host_lock parameters for backward compatibility. Note in module parameter description that host_lock is ignored. Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 773642d95b8220502555122578694deeee8af4af Author: Douglas Gilbert Date: Mon Apr 25 12:16:28 2016 -0400 scsi_debug: cleanup naming and bit crunching Shorten file scope static and constant names. Use more get/put_unaligned calls to hide bit banging. Introduce sdebug_verbose boolean to replace frequent masking of option bit flags. Add GPL and bump version. [mkp: Use logical instead of bitwise OR for LBP VPD flags] Signed-off-by: Douglas Gilbert Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ff54aee466e3ad3f5aad76c629a8bcb88fc9b348 Author: Don Brace Date: Wed Apr 27 17:14:26 2016 -0500 hpsa: update driver version Reviewed-by: Gerry Morong Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit ba74fdc411b84064d7abe4b10d0708f6dad03eb2 Author: Don Brace Date: Wed Apr 27 17:14:17 2016 -0500 hpsa: correct handling of HBA device removal Need to report HBA device removal faster than the event handler polling interval. Stop I/O to the removed disk and wait for all I/O operations to flush before removing the device. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 064d1b1d2d8e0b90f1a0a49112eca0d5c2a09b16 Author: Don Brace Date: Wed Apr 27 17:14:07 2016 -0500 hpsa: correct ioaccel2 error procecssing. set offload_to_be_enabled to 0 when an ioaccel2 error is processed. Before, an ioaccel completion error would turn of ioaccel but a rescan would turn it back on again. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 5323ed74bdf1274caabea6bfc94eef32b89c72fe Author: Don Brace Date: Wed Apr 27 17:13:59 2016 -0500 hpsa: correct ioaccel state change operation offload_to_be_enabled also needs to be set to 0 during a state change. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c448ecfa0b2e648a668a1c62286e989ab1dbf6c8 Author: Don Brace Date: Wed Apr 27 17:13:51 2016 -0500 hpsa: add timeouts for driver initiated commands faulty drives can cause the driver to hang during a scan operation. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit ded1be4ae6b8e279ab43a5fe2069dd60bb836d30 Author: Joseph T Handzik Date: Wed Apr 27 17:13:33 2016 -0500 hpsa: add sas_address to sysfs device attibute There have been companies requesting a sysfs entry to obtain the sas address of device. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit cf47723763a72354f90cd0b3e527704f4e2f7eb7 Author: Don Brace Date: Wed Apr 27 17:13:26 2016 -0500 hpsa: correct initialization order issue The driver was calling scsi_scan_host before enabling interrupts. This has gone unnoticed except for customers running in intx mode. Calling scsi_scan_host before interrupts are enabled causes "irq XX: nobody cared" messages and the driver to hang. This patch enables interrupts before the call to scsi_scan_host. Reported-by: Piotr Karbowski Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 139112fb34db6361082b992d7b5fbb9d223c2c33 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:32:44 2016 -0700 aacraid: Update driver version Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 78cbccd3bd683c295a44af8050797dc4a41376ff Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:32:37 2016 -0700 aacraid: Fix for KDUMP driver hang When KDUMP is triggered the driver first talks to the firmware in INTX mode, but the adapter firmware is still in MSIX mode. Therefore the first driver command hangs since the driver is waiting for an INTX response and firmware gives a MSIX response. If when the OS is installed on a RAID drive created by the adapter KDUMP will hang since the driver does not receive a response in sync mode. Fixed by: Change the firmware to INTX mode if it is in MSIX mode before sending the first sync command. Cc: stable@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit eef76f16295d34d7fab6994b82dda60ce002f91d Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:32:26 2016 -0700 aacraid: Remove code to needlessly complete fib Currently driver completes double completed or spurious interrupted fibs. This is not necessary and causes the SCSI mid layer to issue aborts and resets, since completing a fib prematurely might trigger a race condition resulting in the driver not calling the scsi_done callback. Fixed by removing the call to fib complete. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 9cb62fa24e0d22dbe991c315d6c454a341ea3f76 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:32:09 2016 -0700 aacraid: Log firmware AIF messages Firmware AIF messages about cache loss and data recovery are being missed by the driver since currently they are not captured but rather let go. This patch to capture those messages and log them for the user. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit fc4bf75ea300a5e62a2419f89dd0e22189dd7ab7 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:31:57 2016 -0700 aacraid: Fix for aac_command_thread hang Typically under error conditions, it is possible for aac_command_thread() to miss the wakeup from kthread_stop() and go back to sleep, causing it to hang aac_shutdown. In the observed scenario, the adapter is not functioning correctly and so aac_fib_send() never completes (or time-outs depending on how it was called). Shortly after aac_command_thread() starts it performs aac_fib_send(SendHostTime) which hangs. When aac_probe_one /aac_get_adapter_info send time outs, kthread_stop is called which breaks the command thread out of it's hang. The code will still go back to sleep in schedule_timeout() without checking kthread_should_stop() so it causes aac_probe_one to hang until the schedule_timeout() which is 30 minutes. Fixed by: Adding another kthread_should_stop() before schedule_timeout() Cc: stable@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e4d5c4e238999ba0b68618a91eec33e7079cdbd4 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:31:43 2016 -0700 aacraid: Disable MSI mode for series 6, 7, 8 cards As the firmware for series 6, 7, 8 cards does not support msi, remove it in the driver Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 07beca2be24cc710461c0b131832524c9ee08910 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:31:26 2016 -0700 aacraid: Relinquish CPU during timeout wait aac_fib_send has a special function case for initial commands during driver initialization using wait < 0(pseudo sync mode). In this case, the command does not sleep but rather spins checking for timeout.This loop is calls cpu_relax() in an attempt to allow other processes/threads to use the CPU, but this function does not relinquish the CPU and so the command will hog the processor. This was observed in a KDUMP "crashkernel" and that prevented the "command thread" (which is responsible for completing the command from being timed out) from starting because it could not get the CPU. Fixed by replacing "cpu_relax()" call with "schedule()" Cc: stable@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 116d77fea02e2a5aded7d29ba4c692774cb339f1 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:31:12 2016 -0700 aacraid: Start adapter after updating number of MSIX vectors The adapter has to be started after updating the number of MSIX Vectors Fixes: ecc479e00db8 (aacraid: Set correct MSIX count for EEH recovery) Cc: stable@vger.kernel.org Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit a6cd4549af54ee1ba70a77661499828ea5a2bb3c Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:31:03 2016 -0700 aacraid: Fix incorrectly named MACRO Suggested-by: Seymour, Shane M Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit da31df8c7285910ee8c8629d901b34a480ab0005 Author: Raghava Aditya Renukunta Date: Mon Apr 25 23:30:55 2016 -0700 aacraid: Removed unnecessary checks for NULL Current driver checks for NULL return from aac_fib_alloc_tag, but it not possible for it to return NULL. Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag Suggested-by: Tomas Henzl Signed-off-by: Raghava Aditya Renukunta Signed-off-by: Martin K. Petersen commit 1354379b13f190ae5da21c26836a16ba56566ab3 Author: Alexey Khoroshilov Date: Sat Apr 16 02:12:29 2016 +0300 mptsas: fix checks for dma mapping errors mptsas_smp_handler() checks for dma mapping errors by comparison returned address with zero, while pci_dma_mapping_error() should be used. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Sathya Prakash Veerichetty Signed-off-by: Martin K. Petersen commit 71d397581d52c24c9903d9729aae09828f956801 Author: Finn Thain Date: Sat Apr 23 12:20:07 2016 +1000 MAINTAINERS: Update the file list for the NCR 5380 entry The file atari_NCR5380.c has been removed from the tree so remove it from the MAINTAINERS file as well. While we are here, add the file dtc3x80.txt as it is only relevant to the dtc driver. Signed-off-by: Finn Thain Signed-off-by: Martin K. Petersen commit 5e4fabb6eb058f6d473e22b6db3ef299acf00f1c Author: Kai Makisara Date: Mon Apr 18 08:47:18 2016 +0300 st: clear ILI if Medium Error Some drives set the ILI flag together with MEDIUM ERROR sense code. Clear the ILI flag in this case so that the medium error will be handled. The problem was reported by Maurizio Lombardi. Signed-off-by: Kai Mäkisara Reviewed-by: Laurence Oberman Signed-off-by: Martin K. Petersen commit 718924180a6a79afa558bd978c8a3436c39691ff Author: Sebastian Herbszt Date: Sun Apr 17 13:27:27 2016 +0200 lpfc: remove incorrect lockdep assertion Remove incorrect lockdep assertion from lpfc_sli_hbqbuf_find() which acquires the hbalock itself. Fix the comment which resulted in this mistake. Fixes: 1c2ba475eb0e ("lpfc: Add lockdep assertions") Signed-off-by: Sebastian Herbszt Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 9c8a76d5f00dbfd1da6ea242a9263a47133e4053 Author: Dan Carpenter Date: Thu Apr 14 12:40:06 2016 +0300 bnx2i: silence uninitialized variable warnings Presumably it isn't possible to have empty lists here, but my static checker doesn't know that and complains that "ep" can be used uninitialized. Signed-off-by: Dan Carpenter Acked-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit aa105695732daa6604cb017ceb59a05ef34956bd Author: Dan Carpenter Date: Thu Apr 14 12:37:44 2016 +0300 hpsa: set the enclosure identifier to zero This has only called from show_sas_rphy_enclosure_identifier(). The caller expects that we set an identifier, otherwise it uses an uninitialized variable. [mkp: fixed typo] Signed-off-by: Dan Carpenter Acked-by: Don Brace Signed-off-by: Martin K. Petersen commit b8ac0cc78b56e798851f1435bc673761d3fb877e Author: Joe Lawrence Date: Mon Apr 18 10:50:12 2016 -0400 mpt3sas - remove unused fw_event_work elements Firmware events are queued up using the fw_event_work's struct work, not its delayed_work member. The initial driver for SAS2 controllers had handled firmware reset using the rescan barrier and was later redesigned through "mpt2sas: [Resend] Host Reset code cleanup". The delayed_work variables are now unused and may provoke CONFIG_DEBUG_OBJECTS_TIMERS "assert_init not available" false warnings in _scsih_fw_event_cleanup_queue. Cleanup fw_event_work's unused entries, update its kerneldoc, and update _scsih_fw_event_cleanup_queue accordingly. Fixes: 146b16c8071f (mpt3sas: Refcount fw_events and fix unsafe list usage) Signed-off-by: Joe Lawrence Acked-by: Chaitra P B Signed-off-by: Martin K. Petersen commit b2bdaf2bde16537cbdbd5376acecc555f428603f Author: John Garry Date: Fri Apr 15 21:36:38 2016 +0800 hisi_sas: add alloc_dev_quirk_v2_hw() Add custom version of function to allocate device, alloc_dev_quirk_v2_hw(). For sata devices the device id bit0 should be 0. Signed-off-by: John Garry Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 330fa7f3140481463eb4956c38b9a44dfeee52b9 Author: John Garry Date: Fri Apr 15 21:36:37 2016 +0800 hisi_sas: add slot_index_alloc_quirk_v2_hw() Add v2 hw custom function slot_index_alloc_quirk_v2_hw(). SAS devices should have IPTT bit0 equal to 1. Signed-off-by: John Garry Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 685b6d6e678705bf7ff5b7fdd9a904ec7ae9fbe3 Author: John Garry Date: Fri Apr 15 21:36:36 2016 +0800 hisi_sas: add device and slot alloc hw methods Add methods to use HW specific versions of functions to allocate slot and device. HW specific methods are permitted to workaround device id vs IPTT collision issue in v2 hw. Signed-off-by: John Garry Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 54c4042852a85713a7bdd8436cc63762049fbb39 Author: Sumit Saxena Date: Fri Apr 15 00:23:33 2016 -0700 megaraid_sas: driver version upgrade Signed-off-by: Sumit Saxena Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit bd23d4abe5edf09dfba086d44b7972cf73c14b0b Author: Sumit Saxena Date: Fri Apr 15 00:23:32 2016 -0700 megaraid_sas: task management code optimizations This patch will do code optmization for task management functions. Below are key changes: 1. Remove reset_device hook as it was not being used and driver was setting this to NULL. 2. Create wrapper functions for task abort and target reset and inside these functions adapter specific calls be made. e.g. fusion adapters support task abort and target reset so task abort and target reset should be issued to fusion adapters only and for MFI adapters, print a message saying feature not supported. Signed-off-by: Sumit Saxena Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 64d0b8e4a6f7e9a3c366c2df93ec1f003d180ca3 Author: Sumit Saxena Date: Fri Apr 15 00:23:31 2016 -0700 megaraid_sas: call ISR function to clean up pending replies in OCR path In OCR path, before calling chip reset calls function megasas_wait_for_outstanding_fusion to check reason for OCR. In case of firmware FAULT initiated OCR and DCMD timeout initiated timeout, driver will clear any outstanding reply (yet to be processed by driver) in reply queues before going for chip reset. This code is added to handle a scenario when IO timeout initiated adapter reset and management application initiated adapter reset (by sending command to FAULT firmware) happens simultaneously since adapter reset function is safe-guarded by reset_mutex so only thread will be doing controller reset. Consider IO timeout thread gets mutex and proceeds with adapter reset process after disabling interrupts and by the time management application has fired command to firmware to do adapter reset and the same command is completed by firmware but since interrupts are disabled, driver will not get completion and the same command will be in outstanding/pending commands list of driver and refires same command from IO timeout thread after chip reset which will again FAULT firmware and eventually causes kill adapter. Signed-off-by: Sumit Saxena Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit c3e385a1b985a9202ba7fbd0bdbdcb909905d00c Author: Sumit Saxena Date: Fri Apr 15 00:23:30 2016 -0700 megaraid_sas: reduce memory footprints in kdump mode This patch will reduce memory footprints of megaraid_sas driver when booted in kdump mode. Driver will not allocate memory for optional and perfromance oriented features. Below are key changes done in megaraid_sas driver to do this: 1. Limit Controller's queue depth to 100 in kdump mode. 2. Do not allocate memory for system info buffer and PD info buffer. 3. Disable performance oriented features e.g. Disable RDPQ mode, disable dual queue depth, restrict to single MSI-x vector. Signed-off-by: Sumit Saxena Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 1f275f976fdc04bf1bfd06929d10852b1b05decc Author: Bart Van Assche Date: Thu Apr 14 10:27:14 2016 -0700 scsi_dh_alua: Declare local functions static This patch avoids that building with W=1 causes gcc to report the following type of warning: no previous prototype for ... [-Wmissing-prototypes] Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinicke Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Ewan Milne Signed-off-by: Martin K. Petersen commit 23409bd4a8b051e28d0106c7a83f362617452098 Author: Tina Ruchandani Date: Wed Apr 13 00:01:40 2016 -0700 mpt3sas: Remove usage of 'struct timeval' 'struct timeval' will have its tv_sec value overflow on 32-bit systems in year 2038 and beyond. This patch replaces the use of struct timeval for computing mpi_request.TimeStamp, and instead uses ktime_t which provides 64-bit seconds value. The timestamp computed remains unaffected (milliseconds since Unix epoch). Signed-off-by: Tina Ruchandani Reviewed-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn Acked-by: Sathya Prakash Signed-off-by: Martin K. Petersen commit e83596b41cb9729837468a1c14de56a5529a2aa6 Author: David Daney Date: Wed Apr 13 14:26:56 2016 -0700 pm80xx: Remove bogus address masking in pm8001_ioremap() It is unclear what the original intent of the masking was, but it is clearly incorrect to truncate a physical address before calling ioremap(). On systems where there are valid physical address bits above bit-31 (arm64 for example) the result is an eventual OOPs when initializing the driver. Remove the bogus code to fix it. Signed-off-by: David Daney Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 5ea33eb573c9858cdebfb69626cc8621c7468f9e Author: Tina Ruchandani Date: Mon Jan 25 23:00:20 2016 +0100 qla2xxx: Remove use of 'struct timeval' struct register_host_info stores a 64-bit UTC system time timestamp. This patch removes the use of 'struct timeval' to obtain that timestamp as its tv_sec value will overflow on 32-bit systems in year 2038 beyond. The patch uses ktime_get_real_seconds() which returns a 64-bit seconds value. Signed-off-by: Tina Ruchandani Reviewed-by: Johannes Thumshirn Acked-by: Himanshu Madhani Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen commit 33e56e48ea3b3f58358d12b28f36474040325f0c Author: John Garry Date: Fri Apr 8 17:23:15 2016 +0800 hisi_sas: update driver version to 1.4 Signed-off-by: John Garry Reviewed-by: Zhangfei Gao Signed-off-by: Martin K. Petersen commit f76a0b49402b39b2d314ced52aac2f02d6a6c45d Author: John Garry Date: Fri Apr 8 17:23:14 2016 +0800 hisi_sas: for v2 hw only set ITCT qw2 for SAS device This patch fixes the ITCT table setup as it should be configured differently for SAS and SATA devices. For SATA disks there is no need to set qw2 (already zeroed). Also, link parameters for Bus inactive limit, max connection time limit, and reject to open limit timers parameters are changed to match global config register, MAX_CON_TIME_LIMIT_TIME, as recommended by hw team. Signed-off-by: John Garry Reviewed-by: Zhangfei Gao Signed-off-by: Martin K. Petersen commit 11826e5dc7b7297164dd9dd6d735c6ff6acb4b86 Author: John Garry Date: Fri Apr 8 17:23:13 2016 +0800 hisi_sas: add v2 hw support for >4 SATA phys This patch adds support for directly attaching SATA disks to phy 4-8. The problem was that only registers concerned with phy 0-3 were being considered in sata_int_v2_hw(). The issue was not detected previously as the development board only exposed phy 0-3; the new board provides access to 8 phys. Signed-off-by: John Garry Reviewed-by: Zhangfei Gao Signed-off-by: Martin K. Petersen commit 3a429d5ab60966cf75d9b99648700823c514b7ad Author: John Garry Date: Fri Apr 8 17:23:12 2016 +0800 hisi_sas: fix v2 hw multiple SATA disk issue Intermittently it is found that when multiple SATA disks are directly connected to the host that some disks are not detected. The problem is that all set bitfields in ENT_INT_SRC1 are cleared for all phys in sata_int_v2_hw() - it should clear the set bit for the phy being serviced. Also unnecessary double-write to ENT_INT_SRC1 and ENT_INT_SRC_MSK1 is removed (remaining writes are done at end label). Signed-off-by: John Garry Reviewed-by: Zhangfei Gao Signed-off-by: Martin K. Petersen commit 7524926826104b9e0665eaecd50f76889b89a72e Author: John Garry Date: Fri Apr 8 17:23:11 2016 +0800 hisi_sas: use device linkrate in MCR for v2 hw Contrary to the field name, the MCR (max connection rate) in the ITCT should hold the device linkrate (linkrate of the connected phy), and not the max linkrate. This fixes an issue seen where some SATA drives connected through an expander which would not attach. Signed-off-by: John Garry Reviewed-by: Zhangfei Gao Signed-off-by: Martin K. Petersen commit 9b1d6c8950021ab007608d455fc9c398ecd25476 Author: Ming Lin Date: Mon Apr 4 14:48:11 2016 -0700 lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c Now it's ready to move the mempool based SG chained allocator code from SCSI driver to lib/sg_pool.c, which will be compiled only based on a Kconfig symbol CONFIG_SG_POOL. SCSI selects CONFIG_SG_POOL. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin Reviewed-by: Sagi Grimberg Signed-off-by: Martin K. Petersen commit 65e8617fba17732b4c68d3369a621725838b6f28 Author: Ming Lin Date: Mon Apr 4 14:48:10 2016 -0700 scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount we fit into a single scatterlist chunk. Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. Will move these 2 generic definitions to scatterlist.h later. Reviewed-by: Christoph Hellwig Acked-by: Bart Van Assche (for ib_srp changes) Signed-off-by: Ming Lin Acked-by: Tejun Heo Reviewed-by: Sagi Grimberg Signed-off-by: Martin K. Petersen commit 001d63be61c3b5a0413a46bacafbfc60c353951a Author: Ming Lin Date: Mon Apr 4 14:48:09 2016 -0700 scsi: rename SG related struct and functions Rename SCSI specific struct and functions to more genenic names. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin Reviewed-by: Sagi Grimberg Signed-off-by: Martin K. Petersen commit 22cc3d4c6f4c529f4bf17445c60893b13e7611fb Author: Ming Lin Date: Mon Apr 4 14:48:08 2016 -0700 scsi: replace "mq" with "first_chunk" in SG functions Parameter "bool mq" is block driver specific. Change it to "first_chunk" to make it more generic. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin Reviewed-by: Sagi Grimberg Signed-off-by: Martin K. Petersen commit 91dbc08d64fba7c1426a32be4c57ebb63c4be124 Author: Ming Lin Date: Mon Apr 4 14:48:07 2016 -0700 scsi: replace "scsi_data_buffer" with "sg_table" in SG functions Replace parameter "struct scsi_data_buffer" with "struct sg_table" in SG alloc/free functions to make them generic. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin Reviewed-by: Sagi Grimberg Signed-off-by: Martin K. Petersen commit 98be565f1c19747bfc463f668310ff89beb28696 Author: Hannes Reinecke Date: Fri Apr 8 08:14:54 2016 +0200 zfcp: Revert to original scanning behaviour zfcp has its own mechanism for selective scanning, so revert to the original scanning behaviour to not confuse users. Fixes: 4e91e876e9b8b6eb4255aa0d690778a89d3f1d28 Suggested-by: Benjamin Block Signed-off-by: Hannes Reinecke Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen commit 7517b26c65eb4866ec9a02e9cc2b416c94326313 Author: Leonid Moiseichuk Date: Thu Apr 7 21:52:25 2016 +0300 mvsas: Generalize Marvell 9485 in pci_device_id Claim Marvell 9485 controllers regardless of subdevice ID. Tested on ASUS P9A-I/C2550/SAS/4L which uses vendor-specific 1043:8635. [mkp: Tweaked commit message] Signed-off-by: Leonid Moiseichuk Reviewed-by: Andy Shevchenko Signed-off-by: Martin K. Petersen commit 63f21677965ab5b888ca15be872fce294c6802d7 Author: Chad Dupuis Date: Thu Apr 7 09:08:00 2016 -0400 bnx2fc: Update version number to 2.10.3. Signed-off-by: Chad Dupuis Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d02327a863168647b9e6fde610c4730ff4837f9e Author: Chad Dupuis Date: Thu Apr 7 09:07:59 2016 -0400 bnx2fc: Check sc_cmd device and host pointer before returning the command to the mid-layer. When we are in connection recovery and the internal command timer on a request pops, either the scsi_cmnd->device or scsi_cmnd->device->host back pointers may be NULL as the device that the command that the request was submitted on may have been subsequently reaped due to the connection recovery. This can cause one or both of the pointers above to be NULL and cause a system crash if we try to return the command to the midlayer. Instead, double check the pointers before the return to the midlayer so as to prevent the crash and let the upper layers finish the session recovery and rediscover the device. Signed-off-by: Chad Dupuis Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit f72464d128efd22301ce58b204f3f1808013a536 Author: Chad Dupuis Date: Thu Apr 7 09:07:58 2016 -0400 bnx2fc: Print netdev device name when FCoE is successfully initialized. Signed-off-by: Chad Dupuis Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 3f12f76ee83b3388d2e6f97a9e8c4c642656e277 Author: Chad Dupuis Date: Thu Apr 7 09:07:57 2016 -0400 bnx2fc: Print when we send a fip keep alive. Signed-off-by: Chad Dupuis Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 10755d3f47a9b28639f2e3d29a09ff2a0969657d Author: Joe Carnuccio Date: Thu Apr 7 09:07:56 2016 -0400 bnx2fc: Add driver tunables. Per customer request, add the following driver tunables: o devloss_tmo o max_luns o queue_depth o tm_timeout tm_timeout is set per scsi_host in /sys/class/scsi_host/hostX/tm_timeout. Signed-off-by: Joe Carnuccio Signed-off-by: Chad Dupuis Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e4c36ad756ec2de36b05c66bb50ed4ff47b0fdb0 Author: Hannes Reinecke Date: Fri Apr 1 08:57:37 2016 +0200 scsi: vpd pages are mandatory for SPC-2 VPD pages 0x0 and 0x83 are mandatory even for SPC-2, so we should be lowering the restriction to avoid having to whitelist every SPC-2 compliant device. Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 305c2e71b3d733ec065cb716c76af7d554bd5571 Author: Johannes Thumshirn Date: Tue Apr 5 11:50:45 2016 +0200 Revert "scsi: fix soft lockup in scsi_remove_target() on module removal" Now that we've done a more comprehensive fix with the intermediate target state we can remove the previous hack introduced with commit 90a88d6ef88e ("scsi: fix soft lockup in scsi_remove_target() on module removal"). Signed-off-by: Johannes Thumshirn Cc: stable@vger.kernel.org Reviewed-by: Ewan D. Milne Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit f05795d3d771f30a7bdc3a138bf714b06d42aa95 Author: Johannes Thumshirn Date: Tue Apr 5 11:50:44 2016 +0200 scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Add intermediate STARGET_REMOVE state to scsi_target_state to avoid running into the BUG_ON() in scsi_target_reap(). The STARGET_REMOVE state is only valid in the path from scsi_remove_target() to scsi_target_destroy() indicating this target is going to be removed. This re-fixes the problem introduced in commits bc3f02a795d3 ("[SCSI] scsi_remove_target: fix softlockup regression on hot remove") and 40998193560d ("scsi: restart list search after unlock in scsi_remove_target") in a more comprehensive way. [mkp: Included James' fix for scsi_target_destroy()] Signed-off-by: Johannes Thumshirn Fixes: 40998193560dab6c3ce8d25f4fa58a23e252ef38 Cc: stable@vger.kernel.org Reported-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Reviewed-by: Ewan D. Milne Reviewed-by: Hannes Reinecke Reviewed-by: James Bottomley Signed-off-by: Martin K. Petersen commit be2a266d2a163a332666f396ea128a6bcc6882f7 Author: Narsimhulu Musini Date: Thu Mar 17 00:51:16 2016 -0700 snic: add scsi host after determining max IOs. scsi host is added after negotiating the max number of IOs with Firmware. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 0da8519b2b1f08113cda65af88a4c9e35157dd53 Author: Narsimhulu Musini Date: Thu Mar 17 00:51:15 2016 -0700 snic: Fixing race in the hba reset and IO/TM completion While HBA reset is in progress, if IO/TM completion is received for the same IO then IO/TM completion path releases the driver private resources associated with IO. This fix prevents releasing the resources in IO and TM completion path if HBA reset is in progress. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit c9747821f9bbff6c07fa36087b003d89d05245c8 Author: Narsimhulu Musini Date: Thu Mar 17 00:51:14 2016 -0700 snic: Fix for missing interrupts - On posting an IO to the firmware, adapter generates an interrupt. Due to hardware issues, sometimes the adapter fails to generate the interrupt. This behavior skips updating transmit queue- counters, which in turn causes the queue full condition. The fix addresses the queue full condition. - The fix also reserves a slot in transmit queue for hba reset. when queue full is observed during IO, there will always be room to post hba reset command. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 58fcf92050cdf7b499ba6169459ec43aa0838662 Author: Narsimhulu Musini Date: Thu Mar 17 00:51:13 2016 -0700 snic: target cleanup in driver unload path Fix deletes the snic targets synchronously prior to deletion of host. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 6e0ae74b5ca2826fa6c86a157ed5227c766156b9 Author: Narsimhulu Musini Date: Thu Mar 17 00:51:12 2016 -0700 snic: Handling control path queue issues Fix handles control path queue issues such as queue full and sudden removal of hardware. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit f352a0d5bafa62d1f0b044613ea42483a529f9df Author: Narsimhulu Musini Date: Thu Mar 17 00:51:11 2016 -0700 snic: LUN goes offline due to scsi cmd timeouts - LUN goes offline if there are at least two scsi command timeouts Completing the IO with scsi_done() fixes the issue. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 3f5c11a463fd87b912f16976ff0ee3d6bbd1825e Author: Narsimhulu Musini Date: Thu Mar 17 00:51:10 2016 -0700 snic: Added additional stats Adding additional stats, and fixed logging messages. - Added qdepth change stats - Added separate isr stats for each type of interrupt - Fixed race in updating active IOs - Suppressed Link event message for DAS backend. Signed-off-by: Narsimhulu Musini Signed-off-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 45cc807291d5fde7a6691a06c0ca9f472fa3fb15 Author: James Smart Date: Thu Mar 31 14:12:35 2016 -0700 lpfc: Update driver version to 11.1.0.0 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 506115777af017bfc0968ee1c6aed024cdb6e43b Author: James Smart Date: Thu Mar 31 14:12:34 2016 -0700 lpfc: Update modified file copyrights Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8663cbbe3ba0d8142faec48bbab0dc3482e3007d Author: James Smart Date: Thu Mar 31 14:12:33 2016 -0700 lpfc: Fix interaction between fdmi_on and enable_SmartSAN Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 56204984761d80b973a0a534c42566ad78303766 Author: James Smart Date: Thu Mar 31 14:12:32 2016 -0700 lpfc: Add support for SmartSAN 2.0 Revise versions to reflect SmartSAN 2.0 support RDP updated to support additional descriptors: Credit descriptor Optical Element Data descriptors for Temperature, Voltage, Bias current, TX power and TX power. Optical Product Data descriptor. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 342b59caa66240b670285d519fdfe2c44289b516 Author: James Smart Date: Thu Mar 31 14:12:31 2016 -0700 lpfc: Fix Device discovery failures during switch reboot test. When the switch is rebooted, the lpfc driver fails to log into the fabric, and Unexpected timeout message is seen. Fix: Do not issue RegVFI if the FLOGI was internally aborted. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b5c539583988b70bddea73f333c640fc93a62e88 Author: James Smart Date: Thu Mar 31 14:12:30 2016 -0700 lpfc: Utilize embedded CDB logic to minimize IO latency Pass cmd iu payloads inline to adapter job structure rather than as separate dma buffers. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a6517db9006eb618dfde54f4bf6a9a8bc21e16e7 Author: James Smart Date: Thu Mar 31 14:12:29 2016 -0700 lpfc: Fix crash when unregistering default rpi. The default rpi completion handler does back to back puts to force the removal of the ndlp. This ends up calling lpfc_unreg_rpi after the reference count is at 0. Fix: Check the reference count of the ndlp before getting the ref to make sure we are not getting a reference on a removed object. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ae09c765109293b600ba9169aa3d632e1ac1a843 Author: James Smart Date: Thu Mar 31 14:12:28 2016 -0700 lpfc: Fix DMA faults observed upon plugging loopback connector Driver didn't program the REG_VFI mailbox correctly, giving the adapter bad addresses. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit de96e9c5b82801ea17558c271730fdc2aa5e7e77 Author: James Smart Date: Thu Mar 31 14:12:27 2016 -0700 lpfc: Correct LOGO handling during login After a link bounce, when a remote port issues a LOGO while a REGLOGIN is pending on that port, the driver does not clean up the ndlp structure. May result in stack traces in the console log. Fix: Clear the NLP_REG_LOGIN_SEND flag on the ndlp in the routine Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 4c1340af8854836796bc50555de446286dce4625 Author: Bart Van Assche Date: Wed Mar 30 11:28:11 2016 -0700 scsi_transport_iscsi: Declare local symbols static Avoid that building with W=1 causes gcc to report warnings about symbols that have not been declared. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 7a15fdfab012dddc00ee2c859cf50669e3dae3df Author: Bart Van Assche Date: Wed Mar 30 11:27:47 2016 -0700 scsi_transport_iscsi: Unexport iscsi_is_flashnode_conn_dev() The output of "git grep -nHw iscsi_is_flashnode_conn_dev" shows that this function is only called from inside source file drivers/scsi/scsi_transport_iscsi.c. Hence unexport this function. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 6fe3ed88fe12aeb4ace4877ce1457993ecc196c3 Author: Bart Van Assche Date: Wed Mar 30 11:27:27 2016 -0700 scsi_transport_iscsi: Remove set-but-not-used variables Avoid that building with W=1 causes gcc to report warnings about set-but-not-used variables. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e9e410e8e8537b383b0325f3d03c522aba36fa0b Author: Bart Van Assche Date: Wed Mar 30 11:27:08 2016 -0700 libiscsi: Remove set-but-not-used variables Avoid that building with W=1 causes gcc to report warnings about set-but-not-used variables. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 3907adf67a1559d455f90b0de4c977dd456fe311 Author: Bart Van Assche Date: Wed Mar 30 11:26:46 2016 -0700 libiscsi: Unexport iscsi_eh_target_reset() Running "git grep -nHw iscsi_eh_target_reset" shows that this function is only called from inside the drivers/scsi/libiscsi.c source file. Hence unexport this function. Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 5cfe8d5b4c6f359a23738bbdc54a6007c6d6bdb1 Author: Bart Van Assche Date: Wed Mar 30 16:25:21 2016 -0700 qla2xxx: Indicate out-of-memory with -ENOMEM In the Linux kernel it is preferred to return a meaningful error code instead of -1. This patch does not change the behavior of the caller of qla82xx_pinit_from_rom(). Signed-off-by: Bart Van Assche Cc: Quinn Tran Cc: Himanshu Madhani Cc: Christoph Hellwig Reviewed-by: Johannes Thumshirn Acked-by: Quinn Tran Signed-off-by: Martin K. Petersen commit 62055172fbcd6055a10b010c6be65088fd7046b3 Author: Bart Van Assche Date: Mon Mar 28 14:37:28 2016 -0700 scsi_transport_fc: Unexport scsi_is_fc_vport() Running the command "git grep -nHw scsi_is_fc_vport" shows that this function is only called from inside scsi_transport_fc.c. Hence unexport this function. Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: James Smart Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen commit 1b6ac5e3ff354652ca59240e1ba8b2d22539df07 Author: Satish Kharat Date: Fri Mar 18 11:22:50 2016 -0700 fnic: Using rport->dd_data to check rport online instead of rport_lookup. When issuing I/O we check if rport is online through libfc rport_lookup() function which needs to be protected by mutex lock that cannot acquired in I/O context. The change is to use midlayer remote port s dd_data which is preserved until its devloss timeout and no protection is required. The the scsi_cmnd error code is expected to be in the left 16 bits of the result field. Changed to correct this. Fnic driver version changed from 1.6.0.20 to 1.6.0.21 Signed-off-by: Satish Kharat Signed-off-by: Sesidhar Baddela Reviewed-by: Ewan Milne Signed-off-by: Martin K. Petersen commit a36f5dd07dd9098d43d1137ec7a2d6b92aa6d591 Author: Satish Kharat Date: Fri Mar 18 11:22:49 2016 -0700 fnic: Cleanup the I/O pending with fw and has timed out and is used to issue LUN reset In case of LUN reset, the device reset command is issued with one of the I/Os that has timed out on that LUN. The change is to also return this I/O with error status set to DID_RESET. In case when the reset is issued using the sg_reset tool (from sg3_utils) it is a new command and new_sc is set to 1. Fnic driver version changed from 1.6.0.19 to 1.6.0.20 [mkp: Fixed checkpatch warning] Signed-off-by: Satish Kharat Signed-off-by: Sesidhar Baddela Reviewed-by: Ewan Milne Signed-off-by: Martin K. Petersen commit 691a837c20df0f4eacd49596a4d57fc566a40545 Author: Satish Kharat Date: Fri Mar 18 11:22:48 2016 -0700 fnic: Fix to cleanup aborted IO to avoid device being offlined by mid-layer If an I/O times out and an abort issued by host, if the abort is successful we need to set scsi status as DID_ABORT. Or else the mid-layer error handler which looks for this error code, will offline the device. Also if the original I/O is not found in fnic firmware, we will consider the abort as successful. The start_time assignment is moved because of the new goto. Fnic driver version changed from 1.6.0.17a to 1.6.0.19, version 1.6.0.18 has been skipped [mkp: Fixed checkpatch warning] Signed-off-by: Satish Kharat Signed-off-by: Sesidhar Baddela Reviewed-by: Ewan D. Milne Signed-off-by: Martin K. Petersen commit 0008f1e7230b16989f72042e44bc078e44a69536 Author: Hannes Reinecke Date: Thu Mar 24 17:23:56 2016 +0100 scsi-trace: define ZBC_IN and ZBC_OUT Add new trace functions for ZBC_IN and ZBC_OUT. Reviewed-by: Doug Gilbert Reviewed-by: Ewan D. Milne Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 5141f16a8a944f14e4b0348e8cd9e4dd1acb1a86 Author: Hannes Reinecke Date: Thu Mar 24 15:21:19 2016 +0100 scsi-trace: Decode MAINTENANCE_IN and MAINTENANCE_OUT commands Reviewed-by: Ewan D. Milne Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit b3bc891eab51c98ec83458e2d7f0db629169ad80 Author: Hannes Reinecke Date: Thu Mar 24 15:21:18 2016 +0100 scsi-trace: remove service action definitions scsi_opcode_name() is displaying the opcode, not the service action. Reviewed-by: Ewan D. Milne Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 1d64508810d8d15867251c75a68d7250278ce2bd Author: Hannes Reinecke Date: Thu Mar 17 08:39:45 2016 +0100 scsi: disable automatic target scan On larger installations it is useful to disable automatic LUN scanning, and only add the required LUNs via udev rules. This can speed up bootup dramatically. This patch introduces a new scan module parameter value 'manual', which works like 'none', but can be overridden by setting the 'rescan' value from scsi_scan_target to 'SCSI_SCAN_MANUAL'. And it updates all relevant callers to set the 'rescan' value to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs. Signed-off-by: Hannes Reinecke Reviewed-by: Ewan D. Milne Tested-by: Laurence Oberman Signed-off-by: Martin K. Petersen commit 216fad91387aab7c9e69fe0854d843f012968748 Author: Finn Thain Date: Wed Mar 23 21:10:32 2016 +1100 ncr5380: Call complete_cmd() for disconnected commands on bus reset I'm told that some targets are liable to disconnect a REQUEST SENSE command. Theoretically this would cause a command undergoing autosense to be moved onto the disconnected list. The bus reset handler must call complete_cmd() for these commands, otherwise the hostdata->sensing pointer will not get cleared. That would cause autosense processing to stall and a timeout or an incorrect scsi_eh_restore_cmnd() would eventually follow. Signed-off-by: Finn Thain Reported-by: Michael Schmitz Tested-by: Ondrej Zary Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 3a0f64bfa90700c4fa9db0ed2d701300edd9a0b3 Author: Finn Thain Date: Wed Mar 23 21:10:31 2016 +1100 mac_scsi: Fix pseudo DMA implementation Fix various issues: Comments about bus errors are incorrect. The PDMA asm must return the size of the memory access that faulted so the transfer count can be adjusted accordingly. A phase change may cause a bus error but should not be treated as failure. A bus error does not always imply a phase change and generally the transfer may continue. Scatter/gather doesn't seem to work with PDMA due to overruns. This is a pity because peak throughput seems to double with SG_ALL. Tested on a Mac LC III and a PowerBook 520. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ded155b5e4e735bdd654306145dff6491ce85766 Author: Finn Thain Date: Wed Mar 23 21:10:30 2016 +1100 atari_scsi: Allow can_queue to be increased for Falcon The benefit of limiting can_queue to 1 is that atari_scsi shares the ST DMA chip more fairly with other drivers (e.g. falcon-ide). Unfortunately, this can limit SCSI bus utilization. On systems without IDE, atari_scsi should issue SCSI commands whenever it can arbitrate for the bus. Make that possible by making can_queue configurable. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Signed-off-by: Martin K. Petersen commit a5217a86369083af1f9630d17e9bb9e41ae7405a Author: Finn Thain Date: Wed Mar 23 21:10:29 2016 +1100 atari_scsi: Set a reasonable default for cmd_per_lun This setting does not need to be conditional on Atari ST or TT. Signed-off-by: Finn Thain Tested-by: Michael Schmitz Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 9c41ab27e3fe0cfec16d3ac23f2067a516e337a4 Author: Finn Thain Date: Wed Mar 23 21:10:28 2016 +1100 ncr5380: Update usage documentation Update kernel parameter documentation for atari_scsi, mac_scsi and g_NCR5380 drivers. Remove duplication. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit a46865dcf1f7166808664ab096678f81d4fbb853 Author: Finn Thain Date: Wed Mar 23 21:10:27 2016 +1100 ncr5380: Remove DONT_USE_INTR and AUTOPROBE_IRQ macros Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit f0ea73a4ef4ad86cc8430b6a0463a61b90472718 Author: Finn Thain Date: Wed Mar 23 21:10:26 2016 +1100 ncr5380: Remove remaining register storage qualifiers Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 12866b99e57cf9eba809503c687fc1a25c529c4a Author: Finn Thain Date: Wed Mar 23 21:10:25 2016 +1100 ncr5380: Fix register decoding for debugging Decode all bits in the chip registers. They are all useful at times. Fix printk severity so that this output can be suppressed along with the other debugging output. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 4712bd8d473da5e99d2328654bdba565de8b43ce Author: Finn Thain Date: Wed Mar 23 21:10:24 2016 +1100 dmx3191d: Drop max_sectors limit The dmx3191d driver is not capable of DMA or PDMA so all transfers use PIO. Now that large slow PIO transfers periodically stop and call cond_resched(), the max_sectors limit can go away. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit ae5e33af42eb1f1262cfc8722072561b908bf914 Author: Finn Thain Date: Wed Mar 23 21:10:23 2016 +1100 ncr5380: Reduce max_lun limit The driver has a limit of eight LUs because of the byte-sized bitfield that is used for busy flags. That means the maximum LUN is 7. The default is 8. Signed-off-by: Finn Thain Tested-by: Michael Schmitz Tested-by: Ondrej Zary Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit c4ec6f924f0682e1f40107204152e977d6b1bd07 Author: Finn Thain Date: Wed Mar 23 21:10:22 2016 +1100 ncr5380: Remove disused atari_NCR5380.c core driver Now that atari_scsi and sun3_scsi have been converted to use the NCR5380.c core driver, remove atari_NCR5380.c. Also remove the last vestiges of its Tagged Command Queueing implementation from the wrapper drivers. The TCQ support in atari_NCR5380.c is abandoned by this patch. It is not merged into the remaining core driver because, 1) atari_scsi defines SUPPORT_TAGS but leaves FLAG_TAGGED_QUEUING disabled by default, which indicates that it is mostly undesirable. 2) I'm told that it doesn't work correctly when enabled. 3) The algorithm does not make use of block layer tags which it will have to do because scmd->tag is deprecated. 4) sun3_scsi doesn't define SUPPORT_TAGS at all, yet the the SUPPORT_TAGS macro interacts with the CONFIG_SUN3 macro in 'interesting' ways. 5) Compile-time configuration with macros like SUPPORT_TAGS caused the configuration space to explode, leading to untestable and unmaintainable code that is too hard to reason about. The merge_contiguous_buffers() code is also abandoned. This was unused by sun3_scsi. Only atari_scsi used it and then only on TT, because only TT supports scatter/gather. I suspect that the TT would work fine with ENABLE_CLUSTERING instead. If someone can benchmark the difference then perhaps the merge_contiguous_buffers() code can be be justified. Until then we are better off without the extra complexity. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit e9db3198e08b6a01e2847f732e595bb8e89153c1 Author: Finn Thain Date: Wed Mar 23 21:10:21 2016 +1100 sun3_scsi: Adopt NCR5380.c core driver Add support for the custom Sun 3 DMA logic to the NCR5380.c core driver. This code is copied from atari_NCR5380.c. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 52d3e561cb13df431364a69e783469ba8a9ea8eb Author: Finn Thain Date: Wed Mar 23 21:10:20 2016 +1100 atari_scsi: Adopt NCR5380.c core driver Add support for the Atari ST DMA chip to the NCR5380.c core driver. This code is copied from atari_NCR5380.c. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 8053b0ee79c0129e827ce8f222398ff4b332dfd7 Author: Finn Thain Date: Wed Mar 23 21:10:19 2016 +1100 ncr5380: Merge DMA implementation from atari_NCR5380 core driver Adopt the DMA implementation from atari_NCR5380.c. This means that atari_scsi and sun3_scsi can make use of the NCR5380.c core driver and the atari_NCR5380.c driver fork can be made redundant. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 438af51c642926f1c1844846bee1c3fb568dcd64 Author: Finn Thain Date: Wed Mar 23 21:10:18 2016 +1100 ncr5380: Adopt uniform DMA setup convention Standardize the DMA setup hooks so that the DMA implementation in atari_NCR5380.c can be reconciled with pseudo DMA implementation in NCR5380.c. Calls to NCR5380_dma_recv_setup() and NCR5380_dma_send_setup() return a negative value on failure, zero on PDMA transfer success and a positive byte count for DMA setup success. This convention is not entirely new, but is now applied consistently. Also remove a pointless Status Register access: the *phase assignment is redundant because after NCR5380_transfer_dma() returns control to NCR5380_information_transfer(), that routine then returns control to NCR5380_main(), which means *phase is dead. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 6c4b88ca59ba1a68f707f19dba1744ed19e89fce Author: Finn Thain Date: Wed Mar 23 21:10:17 2016 +1100 ncr5380: Use DMA hooks for PDMA Those wrapper drivers which use DMA define the REAL_DMA macro and those which use pseudo DMA define PSEUDO_DMA. These macros need to be removed for a number of reasons, not least of which is to have drivers share more code. Redefine the PDMA send and receive hooks as DMA setup hooks, so that the DMA code can be shared by all 5380 wrapper drivers. This will help to reunify the forked core driver. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit e5d55d1abcef09f7440e6211d5bd673baf547630 Author: Finn Thain Date: Wed Mar 23 21:10:16 2016 +1100 ncr5380: Remove BOARD_REQUIRES_NO_DELAY macro The io_recovery_delay macro is intended to insert a microsecond delay between the chip register accesses that begin a DMA operation. This is reportedly needed for some ISA boards. Reverse the sense of the macro test so that in the common case, where no delay is required, drivers need not define the macro. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit f825e40b235f4daf1c9017366809d34c7f5c8c7f Author: Finn Thain Date: Wed Mar 23 21:10:15 2016 +1100 ncr5380: Remove PSEUDO_DMA macro For those wrapper drivers which only implement Programmed IO, have NCR5380_dma_xfer_len() evaluate to zero. That allows PDMA to be easily disabled at run-time and so the PSEUDO_DMA macro is no longer needed. Also remove the spin counters used for debugging pseudo DMA drivers. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 1bb4600245d4d40245dd505ca17528e0b9a9ba8c Author: Finn Thain Date: Wed Mar 23 21:10:14 2016 +1100 ncr5380: Disable the DMA errata workaround flag by default The only chip that needs the workarounds enabled is an early NMOS device. That means that the common case is to disable them. Unfortunately the sense of the flag is such that it has to be set for the common case. Rename the flag so that zero can be used to mean "no errata workarounds needed". This simplifies the code. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit e63449c43a58fc185ff35ace6a842817f57ec6c8 Author: Finn Thain Date: Wed Mar 23 21:10:13 2016 +1100 atari_NCR5380: Remove DMA_MIN_SIZE macro Only the atari_scsi and sun3_scsi drivers define DMA_MIN_SIZE. Both drivers also define NCR5380_dma_xfer_len, which means DMA_MIN_SIZE can be removed from the core driver. This removes another discrepancy between the two core drivers. Signed-off-by: Finn Thain Tested-by: Michael Schmitz Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit e4dec6806aceca768b74c1c6402e6d31ecf3c960 Author: Finn Thain Date: Wed Mar 23 21:10:12 2016 +1100 ncr5380: Remove REAL_DMA and REAL_DMA_POLL macros For the NCR5380.c core driver, these macros are never used. If REAL_DMA were to be defined, compilation would fail. For the atari_NCR5380.c core driver, REAL_DMA is always defined. Hence these macros are pointless. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 7e9ec8d9cc18a85e8a4c28aef9136867b46aba42 Author: Finn Thain Date: Wed Mar 23 21:10:11 2016 +1100 ncr5380: Remove FLAG_NO_PSEUDO_DMA where possible Drivers that define PSEUDO_DMA also define NCR5380_dma_xfer_len. The core driver must call NCR5380_dma_xfer_len which means FLAG_NO_PSEUDO_DMA can be eradicated from the core driver. dmx3191d doesn't define PSEUDO_DMA and has no use for FLAG_NO_PSEUDO_DMA, so remove it there also. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit 9d376402c80cfe2356d84577d366ca790e576bd9 Author: Finn Thain Date: Wed Mar 23 21:10:10 2016 +1100 g_ncr5380: Remove CONFIG_SCSI_GENERIC_NCR53C400 This change brings a number of improvements: fewer macros, better test coverage, simpler code and sane Kconfig options. The downside is a small chance of incompatibility (which seems unavoidable). CONFIG_SCSI_GENERIC_NCR53C400 exists to enable or inhibit pseudo DMA transfers when the driver is used with 53C400-compatible cards. Thanks to Ondrej Zary's patches, PDMA now works which means it can be enabled unconditionally. Due to bad design, CONFIG_SCSI_GENERIC_NCR53C400 ties together unrelated functionality as it sets both PSEUDO_DMA and BIOSPARAM macros. This patch effectively enables PSEUDO_DMA and disables BIOSPARAM. The defconfigs and the Kconfig default leave CONFIG_SCSI_GENERIC_NCR53C400 undefined. Red Hat 9 and CentOS 2.1 were the same. This leaves both PSEUDO_DMA and BIOSPARAM disabled. The effect of this patch should be better performance from enabling PSEUDO_DMA. On the other hand, Debian 4 and SLES 10 had CONFIG_SCSI_GENERIC_NCR53C400 enabled, so both PSEUDO_DMA and BIOSPARAM were enabled. This patch might affect configurations like this by disabling BIOSPARAM. My best guess is that this could be a problem only in the vanishingly rare case that 1) the CHS values stored in the boot device partition table are wrong and 2) a 5380 card is in use (because PDMA on 53C400 used to be broken). Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Ondrej Zary Signed-off-by: Martin K. Petersen commit e1f0bce3a0db95007fec756225801e50477f32fd Author: Rasmus Villemoes Date: Tue Mar 22 20:32:05 2016 +0100 scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k On 64 bit, struct error_info has 6 bytes of padding, which amounts to over 4k of wasted space in the additional[] array. We could easily get rid of that by instead using separate arrays for the codes and the pointers. However, we can do even better than that and save an additional 6 bytes per entry: In the table, just store the sizeof() the corresponding string literal. The cumulative sum of these is then the appropriate offset into additional_text, which is built from the concatenation (with '\0's inbetween) of the strings. $ scripts/bloat-o-meter /tmp/vmlinux vmlinux add/remove: 0/0 grow/shrink: 1/1 up/down: 24/-8488 (-8464) function old new delta scsi_extd_sense_format 136 160 +24 additional 11312 2824 -8488 The Kconfig help text used to say that CONFIG_SCSI_CONSTANTS=y costs around 75 KB, but that was a little exaggerated. The actual number was closer to 44K, and 36K with this patch. Signed-off-by: Rasmus Villemoes Reviewed-by: Hannes Reinecke Tested-by: Douglas Gilbert Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 9d99a2e33a02c3290cb53013150ee06a304588ae Author: Rasmus Villemoes Date: Tue Mar 22 20:32:04 2016 +0100 scsi: move Additional Sense Codes to separate file This is a purely mechanical move of the list of additional sense codes to a separate file, in preparation for reducing the impact of choosing CONFIG_SCSI_CONSTANTS=y by about 8k. Signed-off-by: Rasmus Villemoes Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 501280f5a043ec73979b94d4c23e7aae1727f32e Author: Rasmus Villemoes Date: Tue Mar 22 20:32:03 2016 +0100 scsi: make some Additional Sense strings more grep'able There's little point in breaking these strings over multiple lines. Signed-off-by: Rasmus Villemoes Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen