aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-10scsi: ufs: Add API to execute raw upiu commandsAvri Altman3-0/+184
The UFS host software uses a combination of a host register set and Transfer Request Descriptors in system memory to communicate with host controller hardware. In its mmio space, a separate places are assigned to UTP Transfer Request Descriptor ("utrd") list, and to UTP Task Management Request Descriptor ("utmrd") list. The provided API supports utrd-typed requests: nop out and device management commands. It also supports utmrd-type requests: task management requests. Other UPIU types are not supported for now. We utilize the already existing code for tag and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed-off-by: Avri Altman <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: ufs: Use data structure size in pointer arithmeticAvri Altman2-3/+2
Use the structure size in pointer arithmetic instead of an opaque 32 bytes for the over-allocation of descriptors. Signed-off-by: Avri Altman <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: ufs: Add a bsg endpoint that supports UPIUsAvri Altman8-1/+192
For now, just provide an API to allocate and remove ufs-bsg node. We will use this framework to manage ufs devices by sending UPIU transactions. For the time being, implements an empty bsg_request() - will add some more functionality in coming patches. Nonetheless, we reveal here the protocol we are planning to use: UFS Transport Protocol Transactions. UFS transactions consist of packets called UFS Protocol Information Units (UPIU). There are UPIU’s defined for UFS SCSI commands, responses, data in and data out, task management, utility functions, vendor functions, transaction synchronization and control, and more. By using UPIUs, we get access to the most fine-grained internals of this protocol, and able to communicate with the device in ways, that are sometimes beyond the capacity of the ufs driver. Moreover and as a result, our core structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: uapi: ufs: Make utp_upiu_req visible to user spaceAvri Altman3-63/+78
in preparation to send UPIU requests via bsg. Signed-off-by: Avri Altman <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helperChristoph Hellwig1-80/+61
Add a helper that takes a utp_task_req_desc and issues it, which will be useful for UFS bsg support. Rewrite ufshcd_issue_tm_cmd0x to use this new helper. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: ufs: cleanup struct utp_task_req_descChristoph Hellwig3-89/+34
Remove the pointless task_req_upiu and task_rsp_upiu indirections, which are __le32 arrays always cast to given structures and just add the members directly. Also clean up variables names in use in the callers a bit to make the code more readable. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: snic: Replace spin_is_locked() with lockdepLance Roy1-2/+2
lockdep_assert_held() is better suited to checking locking requirements, since it won't get confused when someone else holds the lock. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy <[email protected]> Cc: Karan Tilak Kumar <[email protected]> Cc: Sesidhar Baddela <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Remove unnecessary parentheses and simplify null checksNathan Chancellor1-2/+2
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((ioc == NULL)) ~~~~^~~~~~~ drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: note: remove extraneous parentheses around the comparison to silence this warning if ((ioc == NULL)) ~ ^ ~ drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: note: use '=' to turn this equality comparison into an assignment if ((ioc == NULL)) ^~ = drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((pdev == NULL)) ~~~~~^~~~~~~ drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: note: remove extraneous parentheses around the comparison to silence this warning if ((pdev == NULL)) ~ ^ ~ drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: note: use '=' to turn this equality comparison into an assignment if ((pdev == NULL)) ^~ = 2 warnings generated. Remove them and while we're at it, simplify the NULL checks as '!var' is used more than 'var == NULL'. Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Use dma_pool_zallocSouptick Joarder1-4/+2
Replaced dma_pool_alloc + memset with dma_pool_zalloc. Signed-off-by: Brajeswar Ghosh <[email protected]> Signed-off-by: Souptick Joarder <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Remove unused macro MPT3SAS_FMTJoe Perches1-2/+0
All the uses have been removed, delete the macro. Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Convert logging uses with MPT3SAS_FMT without logging levelsJoe Perches3-31/+28
Convert these uses to ioc_<level> where appropriate. Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Remove KERN_WARNING from panic usesJoe Perches1-26/+15
Remove the logging level as panic calls stop the machine and should always be emitted regardless of requested logging level. These existing panic uses are perhaps inappropriate. Miscellanea: o Coalesce formats and convert MPT3SAS_FMT to "%s: " to improve clarity Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Convert logging uses with MPT3SAS_FMT and reply_q_name to %s:Joe Perches1-5/+5
Convert the existing 2 uses to make the format and arguments matching more obvious. Miscellanea: o Move the word "enabled" into the format to trivially reduce object size o Remove unnecessary parentheses Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Convert mlsleading uses of pr_<level> with MPT3SAS_FMTJoe Perches2-39/+29
These have misordered uses of __func__ and ioc->name that could mismatch MPT3SAS_FMT and "%s: ". Convert them to ioc_<level>. Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Convert uses of pr_<level> with MPT3SAS_FMT to ioc_<level>Joe Perches7-1982/+1533
Use a more common logging style. Done using the perl script below and some typing $ git grep --name-only -w MPT3SAS_FMT -- "*.c" | \ xargs perl -i -e 'local $/; while (<>) { s/\bpr_(info|err|notice|warn)\s*\(\s*MPT3SAS_FMT\s*("[^"]+"(?:\s*\\?\s*"[^"]+"\s*){0,5}\s*),\s*ioc->name\s*/ioc_\1(ioc, \2/g; print;}' Miscellanea for these conversions: o Coalesce formats o Realign arguments o Remove unnecessary parentheses o Use casts to u64 instead of unsigned long long where appropriate o Convert broken pr_info uses to pr_cont o Fix broken format string concatenation with line continuations and excess whitespace Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: mpt3sas: Add ioc_<level> logging macrosJoe Perches1-0/+9
These macros can help identify specific logging uses and eventually perhaps reduce object sizes. Signed-off-by: Joe Perches <[email protected]> Acked-by: Suganath Prabu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-10-10scsi: MAINTAINERS: Fix typo in cxlflash stanzaMatthew R. Ochs1-1/+1
The uapi header file listed in the cxlflash stanza has a typo. Removed the trailing 's' from the filename. Reported-by: Joe Perches <[email protected]> Signed-off-by: Matthew R. Ochs <[email protected]> Acked-by: Uma Krishnan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: qla2xxx: Return switch command on a timeoutHimanshu Madhani1-6/+5
This patch fixes commit bcc71cc3cde1 ("scsi: qla2xxx: Fix for double free of SRB structure") which placed code in wrong routines. Also updated the use of WARN_ON() to WARN_ON_ONCE() to prevent flooding log messages. Fixes: bcc71cc3cde1 ("scsi: qla2xxx: Fix for double free of SRB structure") Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Check for bus resetFinn Thain1-29/+45
The SR_RST bit isn't latched. Hence, detecting a bus reset isn't reliable. When it is detected, the right thing to do is to drop all connected and disconnected commands. The code for that is already present so refactor it and call it when SR_RST is set. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Handle BUS FREE during reselectionFinn Thain1-0/+3
The X3T9.2 specification (draft) says, under "6.1.4.2 RESELECTION time-out procedure", that a target may assert RST or go to BUS FREE phase if the initiator does not respond within 200 us. Something like this has been observed with AztecMonster II target. When it happens, all we can do is wait for the target to try again. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Don't call dsprintk() following reselection interruptFinn Thain1-2/+2
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION", ... The reselected initiator shall then assert the BSY signal within a selection abort time of its most recent detection of being reselected; this is required for correct operation of the time-out procedure. The selection abort time is only 200 us which may be insufficient time for a printk() call. Move the diagnostics to the error paths. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Don't clear busy flag when abort failsFinn Thain1-4/+10
When NCR5380_abort() returns FAILED, the driver forgets that the target is still busy. Hence, further commands may be sent to the target, which may fail during selection and produce the error message, "reselection after won arbitration?". Prevent this by leaving the busy flag set when NCR5380_abort() fails. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Check for invalid reselection targetFinn Thain1-0/+5
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION", that "the initiator shall not respond to a RESELECTION phase if other than two SCSI ID bits are on the DATA BUS." This issue (too many bits set) has been observed in the wild, so add a check. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Use DRIVER_SENSE to indicate valid sense dataFinn Thain1-5/+4
When sense data is valid, call set_driver_byte(cmd, DRIVER_SENSE). Otherwise some callers of scsi_execute() will ignore sense data. Don't set DID_ERROR or DID_RESET just because sense data is missing. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Withhold disconnect privilege for REQUEST SENSEFinn Thain1-1/+3
This is mostly needed because an AztecMonster II target has been observed disconnecting REQUEST SENSE commands and then failing to reselect properly. Suggested-by: Michael Schmitz <[email protected]> Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Have NCR5380_select() return a boolFinn Thain2-26/+22
The return value is taken to mean "retry" or "don't retry". Change it to bool to improve readability. Fix related comments. No functional change. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Reduce goto statements in NCR5380_select()Finn Thain1-9/+12
Replace a 'goto' statement with a simple 'return' where possible. This improves readability. No functional change. Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: NCR5380: Clear all unissued commands on host resetHannes Reinecke1-2/+5
When doing a host reset we should be clearing all outstanding commands, not just the command triggering the reset. [mkp: adjusted Hannes' SoB address] Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Cc: Ondrey Zary <[email protected]> Signed-off-by: Finn Thain <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: mptfusion: Remove unnecessary parenthesesNathan Chancellor1-2/+2
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/message/fusion/mptbase.c:338:11: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((ioc == NULL)) ~~~~^~~~~~~ drivers/message/fusion/mptbase.c:338:11: note: remove extraneous parentheses around the comparison to silence this warning if ((ioc == NULL)) ~ ^ ~ drivers/message/fusion/mptbase.c:338:11: note: use '=' to turn this equality comparison into an assignment if ((ioc == NULL)) ^~ = drivers/message/fusion/mptbase.c:342:12: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((pdev == NULL)) ~~~~~^~~~~~~ drivers/message/fusion/mptbase.c:342:12: note: remove extraneous parentheses around the comparison to silence this warning if ((pdev == NULL)) ~ ^ ~ drivers/message/fusion/mptbase.c:342:12: note: use '=' to turn this equality comparison into an assignment if ((pdev == NULL)) ^~ = 2 warnings generated. Remove them and while we're at it, simplify the NULL checks as '!var' is used more than 'var == NULL'. Reported-by: Nick Desaulniers <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-28scsi: qla4xxx: Remove redundant check on drvr_waitColin Ian King1-6/+4
The check for a non-zero drvr_wait is redundant as the same check is performed earlier in the outer while loop, the inner check will always be true if we reached this point inside the while loop. Remove the redundant if check. Detected by cppcheck: (warning) Identical inner 'if' condition is always true. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Manish Rangankar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Move log messages before issuing command to firmwareGiridhar Malavali2-30/+33
There is a probability that the SRB structure might have been released by the time the debug log message dereferences it. This patch moved the log messages before the command is issued to the firmware to prevent unknown behavior and kernel crash Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Cc: <[email protected]> Signed-off-by: Giridhar Malavali <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix for double free of SRB structureGiridhar Malavali2-2/+16
This patch fixes issue during switch command query where driver was freeing SRB resources multiple times Following stack trace will be seen [ 853.436234] BUG: unable to handle kernel NULL pointer dereference at 0000000000000001 [ 853.436348] IP: [<ffffffff811df514>] kmem_cache_alloc+0x74/0x1e0 [ 853.436476] PGD 0 [ 853.436601] Oops: 0000 [#1] SMP [ 853.454700] [<ffffffff81099f6a>] ? mod_timer+0x14a/0x220 [ 853.455543] [<ffffffff81185465>] mempool_alloc_slab+0x15/0x20 [ 853.456395] [<ffffffff811855a9>] mempool_alloc+0x69/0x170 [ 853.457257] [<ffffffff81098af2>] ? internal_add_timer+0x32/0x70 [ 853.458136] [<ffffffffc0092d2b>] qla2xxx_queuecommand+0x29b/0x3f0 [qla2xxx] [ 853.459024] [<ffffffff8146535a>] scsi_dispatch_cmd+0xaa/0x230 [ 853.459923] [<ffffffff8146e11f>] scsi_request_fn+0x4df/0x680 [ 853.460829] [<ffffffff81029557>] ? __switch_to+0xd7/0x510 [ 853.461747] [<ffffffff812f7113>] __blk_run_queue+0x33/0x40 [ 853.462670] [<ffffffff812f7735>] blk_delay_work+0x25/0x40 [ 853.463603] [<ffffffff810a882a>] process_one_work+0x17a/0x440 [ 853.464546] [<ffffffff810a94f6>] worker_thread+0x126/0x3c0 [ 853.465501] [<ffffffff810a93d0>] ? manage_workers.isra.24+0x2a0/0x2a0 [ 853.466447] [<ffffffff810b099f>] kthread+0xcf/0xe0 [ 853.467379] [<ffffffff810b08d0>] ? insert_kthread_work+0x40/0x40 [ 853.470172] Code: db e2 7e 49 8b 50 08 4d 8b 20 49 8b 40 10 4d 85 e4 0f 84 20 01 00 00 48 85 c0 0f 84 17 01 00 00 49 63 46 20 48 8d 4a 01 4d 8b 06 <49> 8b 1c 04 4c 89 e0 65 49 0f c7 08 0f 94 c0 84 c0 74 ba 49 63 [ 853.472072] RIP [<ffffffff811df514>] kmem_cache_alloc+0x74/0x1e0 [ 853.472971] RSP <ffff88103726fc50> Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Cc: <[email protected]> Signed-off-by: Giridhar Malavali <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix recursive mailbox timeoutQuinn Tran1-1/+1
This patch prevents user space mailbox request from doing chip reset if the mailbox timed out. The chip reset is only reserved for the DPC thread to ensure all mailbox requests are flushed properly. The DPC thread is responsible for the flushing all MBs and chip reset. Fixes: b2000805a975 ("scsi: qla2xxx: Flush mailbox commands on chip reset") Cc: <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix driver hang when FC-NVMe LUNs are configuredHimanshu Madhani1-3/+0
This patch fixes multiple call for qla_nvme_unregister_remote_port() as part of qlt_schedule_session_for_deletion(), Do not call it again during qla_nvme_delete() Fixes: e473b3074104 ("scsi: qla2xxx: Add FC-NVMe abort processing") Cc: <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix re-using LoopID when handle is in useQuinn Tran2-15/+6
This patch fixes issue where driver clears NPort ID map instead of marking handle in use. Once driver clears NPort ID from the database, it can reuse the same NPort ID resulting in a PLOGI failure. [mkp: fixed Himanshu's SoB] Fixes: a084fd68e1d2 ("scsi: qla2xxx: Fix re-login for Nport Handle in use") Cc: <[email protected]> Signed-of-by: Quinn Tran <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix duplicate switch database entriesQuinn Tran1-3/+3
The response data buffer used in switch scan is reused 4 times. (For example, for commands GPN_FT, GNN_FT for FCP and FC-NVME) Before driver reuses this buffer, clear it to prevent duplicate entries in our database. Fixes: a4239945b8ad1 ("scsi: qla2xxx: Add switch command to simplify fabric discovery" Cc: <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix NVMe Target discoveryQuinn Tran1-2/+2
This patch fixes issue when remoteport registers itself as both FCP and FC-NVMe with the switch, driver will pick FC-NVMe personality as default when scanning for targets. Driver was using comaprative operator instead of bitwise operator to check for fc4_type for both FCP and FC-NVME. Fixes: 2b5b96473efc ("scsi: qla2xxx: Fix FC-NVMe LUN discovery") Cc: <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix NVMe session hang on unloadQuinn Tran1-1/+1
Send aborts only when chip is active. Fixes: 623ee824e579 ("scsi: qla2xxx: Fix FC-NVMe IO abort during driver reset") Cc: <[email protected]> # 4.14 Signed-off-by: Quinn Tran <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: don't allow negative thresholdsDan Carpenter1-1/+1
We shouldn't allow negative thresholds. I don't know what it would do but it can't be good. Fixes: 8b4673ba3a1b ("scsi: qla2xxx: Add support for ZIO6 interrupt threshold") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-27scsi: qla2xxx: Fix comment in MODULE_PARM_DESC in qla2xxxMasanari Iida1-1/+1
Default value of ql2xasynctmfenable for qla2xxx driver was set to 1 in commit 043dc1d7e850 ("scsi: qla2xxx: Enable Async TMF processing") but comment in MODULE_PARAM_DESC was not modified. Signed-off-by: Masanari Iida <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: target: iscsi: cxgbit: fix csk leakVarun Prakash1-3/+20
csk leak can happen if a new TCP connection gets established after cxgbit_accept_np() returns, to fix this leak free remaining csk in cxgbit_free_np(). Signed-off-by: Varun Prakash <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: libsas: fix a race condition when smp task timeoutJason Yan1-5/+4
When the lldd is processing the complete sas task in interrupt and set the task stat as SAS_TASK_STATE_DONE, the smp timeout timer is able to be triggered at the same time. And smp_task_timedout() will complete the task wheter the SAS_TASK_STATE_DONE is set or not. Then the sas task may freed before lldd end the interrupt process. Thus a use-after-free will happen. Fix this by calling the complete() only when SAS_TASK_STATE_DONE is not set. And remove the check of the return value of the del_timer(). Once the LLDD sets DONE, it must call task->done(), which will call smp_task_done()->complete() and the task will be completed and freed correctly. Reported-by: chenxiang <[email protected]> Signed-off-by: Jason Yan <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> CC: Hannes Reinecke <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: libsas: check the ata device status by ata_dev_enabled()Jason Yan1-1/+1
When ata device IDENTIFY failed, the ata device status is ATA_DEV_UNKNOWN. The libata reported like: [113518.620433] ata5.00: qc timeout (cmd 0xec) [113518.653646] ata5.00: failed to IDENTIFY (I/O error, err_mask=0x4) But libsas verifies the device status by ata_dev_disabled(), which skipped ATA_DEV_UNKNOWN. This will make libsas think the ata device probing succeed the device cannot be actually brought up. And even the new bcast of this device will be considered as flutter and will not probe this device again. Change ata_dev_disabled() to !ata_dev_enabled() so that libsas can deal with this if the ata device probe failed. New bcasts can let us try to probe the device again and bring it up if it is fine to IDENTIFY. Tested-by: Zhou Yupeng <[email protected]> Signed-off-by: Jason Yan <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> CC: Hannes Reinecke <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: libsas: always unregister the old device if going to discover newJason Yan1-8/+5
If we went into sas_rediscover_dev() the attached_sas_addr was already insured not to be zero. So it's unnecessary to check if the attached_sas_addr is zero. And although if the sas address is not changed, we always have to unregister the old device when we are going to register a new one. We cannot just leave the device there and bring up the new. Signed-off-by: Jason Yan <[email protected]> CC: chenxiang <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> CC: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: libsas: make the lldd_port_deformed method optionalJason Yan2-8/+3
Now LLDDs have to implement lldd_port_deformed method otherwise NULL dereference will happen. Make it optional and remove the dummy implementation in hisi_sas. Signed-off-by: Jason Yan <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> CC: Hannes Reinecke <[email protected]> Acked-by: John Garry <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: libsas: delete dead code in scsi_transport_sas.cJason Yan1-2/+0
This code is dead and no clue implies that it will be back again. Signed-off-by: Jason Yan <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> CC: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: megaraid: fix spelling mistake "maibox" -> "mailbox"Colin Ian King2-3/+3
Trivial fix to spelling mistake in warning message and comments Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: FlashPoint: Remove unnecessary parenthesesNathan Chancellor1-3/+3
Clang warns when multiple pairs of parentheses are used for a single conditional statement. In file included from drivers/scsi/BusLogic.c:57: drivers/scsi/FlashPoint.c:2947:34: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ drivers/scsi/FlashPoint.c:2947:34: note: remove extraneous parentheses around the comparison to silence this warning if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { ~ ^ ~ drivers/scsi/FlashPoint.c:2947:34: note: use '=' to turn this equality comparison into an assignment if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { ^~ = drivers/scsi/FlashPoint.c:2956:39: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] else if ((currSCCB->Sccb_scsistat == ~~~~~~~~~~~~~~~~~~~~~~~~^~ drivers/scsi/FlashPoint.c:2956:39: note: remove extraneous parentheses around the comparison to silence this warning else if ((currSCCB->Sccb_scsistat == ~ ^ drivers/scsi/FlashPoint.c:2956:39: note: use '=' to turn this equality comparison into an assignment else if ((currSCCB->Sccb_scsistat == ^~ = 2 warnings generated. Link: https://github.com/ClangBuiltLinux/linux/issues/156 Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Khalid Aziz <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-25scsi: hpsa: Use vmemdup_user to replace the open codezhong jiang1-8/+4
vmemdup_user is better than duplicating its implementation, So just replace the open code. The issue is detected with the help of Coccinelle. Tested-by: Don Brace <[email protected]> Acked-by: Don Brace <[email protected]> Signed-off-by: zhong jiang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2018-09-20scsi: advansys: Remove unnecessary parenthesesNathan Chancellor1-1/+1
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/advansys.c:6451:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((sdtr_data == 0xFF)) { ~~~~~~~~~~^~~~~~~ drivers/scsi/advansys.c:6451:20: note: remove extraneous parentheses around the comparison to silence this warning if ((sdtr_data == 0xFF)) { ~ ^ ~ drivers/scsi/advansys.c:6451:20: note: use '=' to turn this equality comparison into an assignment if ((sdtr_data == 0xFF)) { ^~ = 1 warning generated. Link: https://github.com/ClangBuiltLinux/linux/issues/155 Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Matthew Wilcox <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>