Commit Graph

900499 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab dbfa1bceed scsi: docs: convert NinjaSCSI.txt to ReST
Link: https://lore.kernel.org/r/6385a411d000dad005b78647629e43700580ecf0.1583136624.git.mchehab+huawei@kernel.org
Acked-by: GOTO Masanori <gotom@debian.or.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:01 -04:00
Mauro Carvalho Chehab 8dca37d259 scsi: docs: convert ncr53c8xx.txt to ReST
Link: https://lore.kernel.org/r/cover.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:01 -04:00
Mauro Carvalho Chehab a756185de6 scsi: docs: convert megaraid.txt to ReST
Link: https://lore.kernel.org/r/b7ee59230c5a33ff6d60edba0d0bcf3e2aeaa88f.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab b4adb75781 scsi: docs: convert lpfc.txt to ReST
Link: https://lore.kernel.org/r/48c13184b77ba61ed4fd7c235816fdb8e7530664.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab cbbc70a8cd scsi: docs: convert link_power_management_policy.txt to ReST
Link: https://lore.kernel.org/r/c56177fdf046d80e0dec6031c4139cb4e8c39d31.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab a88dc3ec2c scsi: docs: convert libsas.txt to ReST
Link: https://lore.kernel.org/r/9022cb5551487f774cab16a828fe06b0b6b3add3.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab ac69461b60 scsi: docs: convert hptiop.txt to ReST
Link: https://lore.kernel.org/r/d189a339bb360b7b397914ee3ddeb75d9a7fd788.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab 1392de9d7a scsi: docs: convert hpsa.txt to ReST
Link: https://lore.kernel.org/r/ea58e04176d43fb7194615b145060aa04c9cf3ad.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab 3c1e681bcd scsi: docs: convert g_NCR5380.txt to ReST
Link: https://lore.kernel.org/r/a66e9ea704be6a7aa81b9864ad66a32b75ab808d.1583136624.git.mchehab+huawei@kernel.org
Acked-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:08:00 -04:00
Mauro Carvalho Chehab cc0d9d3ad7 scsi: docs: convert FlashPoint.txt to ReST
Link: https://lore.kernel.org/r/e755b9644047eed6be69fcc77eb797f0801fcb99.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab f22978400e scsi: docs: convert dpti.txt to ReST
Link: https://lore.kernel.org/r/212fd7961c134c5bd73d87cd818bcddc30270804.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab 62e3bfa4a1 scsi: docs: convert dc395x.txt to ReST
Link: https://lore.kernel.org/r/3c0876df0045695185f922a0404c497a69de36a9.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab d2ba7ca338 scsi: docs: convert cxgb3i.txt to ReST
Link: https://lore.kernel.org/r/0708b62b6ec4f0dddc581e412bb02ba6476f4523.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab 977b899ce3 scsi: docs: convert BusLogic.txt to ReST
Link: https://lore.kernel.org/r/750629b6a5233c85c5391c44d126606b8aabefc8.1583136624.git.mchehab+huawei@kernel.org
Acked-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab 1d4f8dfe2d scsi: docs: convert bnx2fc.txt to ReST
Link: https://lore.kernel.org/r/f239116bd2c36f6fc8deb62e325bb8161da04270.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:59 -04:00
Mauro Carvalho Chehab 6e5a663d8e scsi: docs: convert bfa.txt to ReST
Link: https://lore.kernel.org/r/6660d0f83ddae2ab8efb31c39f9c220fc132e9d4.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab cff7c4a596 scsi: docs: convert aic7xxx.txt to ReST
Link: https://lore.kernel.org/r/dc2b1ffe4bf64cfc4b32328740704a30e8d38a79.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab 520a44d4df scsi: docs: convert aic79xx.txt to ReST
Link: https://lore.kernel.org/r/e8a40337a2173f028c9ac569d3d71fd880f4fab5.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab 94b5530f1f scsi: docs: convert aha152x.txt to ReST
Link: https://lore.kernel.org/r/097cfcc7f25343676a1fedcefed7e3b91b41b4df.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab cb32240894 scsi: docs: convert advansys.txt to ReST
Link: https://lore.kernel.org/r/3c697a046e641c81cdfd0784f037d41d54766931.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab dd9cc1447a scsi: docs: convert aacraid.txt to ReST
Link: https://lore.kernel.org/r/67c60ad88777c91937d49771e2a3f48cbf353e4c.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab f76576777a scsi: docs: convert 53c700.txt to ReST
Link: https://lore.kernel.org/r/a2e5116b70564f36b4fc7f1f1e5da1e693d7dadb.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:58 -04:00
Mauro Carvalho Chehab 7f877908df scsi: docs: include SCSI Transport SRP diagram at the doc body
Instead of having a separate makefile, and be alone, group
it at the SCSI documentation and make it being built as part
of docs makefile.

Link: https://lore.kernel.org/r/419c455fb40c9a1e85cc9a654a7fdb07aeeccf71.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Mauro Carvalho Chehab 31df2fd54c scsi: docs: Add an empty index file for SCSI documents
In preparation for adding the SCSI documents to the documentation
body, add an empty index for it.

The next patches should be adding contents to it, as files get
converted to ReST format.

Link: https://lore.kernel.org/r/4d8c1b7ebe5898ac4a8265ca5e5a9552da3b426f.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Rajan Shanmugavelu 598a90f200 scsi: qla2xxx: add ring buffer for tracing debug logs
Having this log in a ring buffer helps to diagnose qla2xxx driver and
firmware issues instead of having to reproduce the problem with
extended_logging enabled. This saves cycles and helps when it is hard
to reproduce problem.

Link: https://lore.kernel.org/r/1581557368-32080-1-git-send-email-rajan.shanmugavelu@oracle.com
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Phong Tran 779dfcf643 scsi: aacraid: clean up warning cast-function-type
Make the aacraid driver -Wcast-function-type clean

Report by: https://github.com/KSPP/linux/issues/20

drivers/scsi/aacraid/aachba.c:813:23:
warning: cast between incompatible function types from
'int (*)(struct scsi_cmnd *)' to 'void (*)(struct scsi_cmnd *)'
[-Wcast-function-type]

Link: https://lore.kernel.org/r/20200309155319.12658-1-tranmanphong@gmail.com
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Stanley Chu 47d054580a scsi: ufs-mediatek: fix HOST_PA_TACTIVATE quirk for Samsung UFS Devices
Device quirk "UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE" is enabled for all
Samsung devices by default currently.

However MediaTek UFS host requires different host PA_TACTIVATE
configuration. Hence clear this quirk first and then apply vendor-specific
value in vops callback.

Link: https://lore.kernel.org/r/20200302135346.16797-1-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Brian King b893eb0141 scsi: ibmvfc: Fix NULL return compiler warning
Fix up a compiler warning introduced via 54b04c99d02e

Link: https://lore.kernel.org/r/1583159961-15903-1-git-send-email-brking@linux.vnet.ibm.com
Fixes: 54b04c99d02e ("scsi: ibmvfc: Avoid loss of all paths during SVC node reboot")
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Randy Dunlap 5848fe960b scsi: fusion: fix if-statement empty body warning
When driver debugging is not enabled, change the debug print macros
to use the no_printk() macro.

This fixes a gcc warning when -Wextra is set:
../drivers/message/fusion/mptlan.c:266:39: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]

I have verified that there is very little object code change (with
gcc 7.5.0). There are a few changes like:
  cmp %a,%b
  jl $1
to
  cmp %b,%a
  jg $1

Link: https://lore.kernel.org/r/ff9df31b-c4c1-c942-1cbf-18039e084c8e@infradead.org
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Frank Mayhar cc6b32ee3b scsi: iscsi: Add support for asynchronous iSCSI session destruction
iSCSI session destruction can be arbitrarily slow, since it might require
network operations and serialization inside the SCSI layer.  This patch
adds a new user event to trigger the destruction work asynchronously,
releasing the rx_queue_mutex as soon as the operation is queued and before
it is performed.  This change allows other operations to run in other
sessions in the meantime, removing one of the major iSCSI bottlenecks for
us.

To prevent the session from being used after the destruction request, we
remove it immediately from the sesslist. This simplifies the locking
required during the asynchronous removal.

Link: https://lore.kernel.org/r/20200227195945.761719-1-krisman@collabora.com
Co-developed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Co-developed-by: Khazhismel Kumykov <khazhy@google.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Sagar Biradar bef18d308a scsi: aacraid: Disabling TM path and only processing IOP reset
Fixes the occasional adapter panic when sg_reset is issued with -d, -t, -b
and -H flags.  Removal of command type HBA_IU_TYPE_SCSI_TM_REQ in
aac_hba_send since iu_type, request_id and fib_flags are not populated.
Device and target reset handlers are made to send TMF commands only when
reset_state is 0.

Link: https://lore.kernel.org/r/1581553771-25796-1-git-send-email-Sagar.Biradar@microchip.com
Reviewed-by: Sagar Biradar <Sagar.Biradar@microchip.com>
Signed-off-by: Sagar Biradar <Sagar.Biradar@microchip.com>
Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Brian King ed830385a2 scsi: ibmvfc: Avoid loss of all paths during SVC node reboot
When an SVC node goes down as part of a node reboot, its WWPNs are moved to
the remaining node. When the node is back online, its WWPNs are moved
back. The result is that the WWPN moves from one NPort_ID to another, then
back again.  The ibmvfc driver was forcing the old port to be removed, but
not sending an implicit logout. When the WWPN showed up at the new
location, the PLOGI failed as there was already a login established for the
old scsi id. The patch below fixes this by ensuring we always send an
implicit logout for any scsi id associated with an rport prior to calling
fc_remote_port_delete.

Link: https://lore.kernel.org/r/1582767943-16611-1-git-send-email-brking@linux.vnet.ibm.com
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:57 -04:00
Gustavo A. R. Silva 5febf6d6ae scsi: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension
to the C90 standard, but the preferred mechanism to declare variable-length
types such as these ones is a flexible array member[1][2], introduced in
C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning in
case the flexible array does not occur last in the structure, which will
help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by this
change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Link: https://lore.kernel.org/r/20200224161406.GA21454@embeddedor
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11 23:07:56 -04:00
Bart Van Assche 5905d4648e scsi: ufs: Simplify two tests
lrbp->cmd is set only for SCSI commands. Use this knowledge to simplify two
boolean expressions.

Link: https://lore.kernel.org/r/20200123035637.21848-4-bvanassche@acm.org
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 21:05:06 -05:00
Bart Van Assche 4d2b8d40dd scsi: ufs: Introduce ufshcd_init_lrb()
This patch does not change any functionality but makes the next patch in
this series easier to read.

Link: https://lore.kernel.org/r/20200123035637.21848-3-bvanassche@acm.org
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 21:04:57 -05:00
Bart Van Assche 65ca846a53 scsi: core: Introduce {init,exit}_cmd_priv()
The current behavior of the SCSI core is to clear driver-private data
before preparing a request for submission to the SCSI LLD. Make it possible
for SCSI LLDs to disable clearing of driver-private data.

These hooks will be used by a later patch, namely "scsi: ufs: Let the SCSI
core allocate per-command UFS data".

Link: https://lore.kernel.org/r/20200123035637.21848-2-bvanassche@acm.org
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 21:02:10 -05:00
Hannes Reinecke c5a9707672 scsi: core: Remove cmd_list functionality
Remove cmd_list functionality; no users left.  With that the
scsi_put_command() becomes empty, so remove that one, too.

Link: https://lore.kernel.org/r/20200228075318.91255-14-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:55 -05:00
Hannes Reinecke 35d2ce0b65 scsi: aacraid: use scsi_host_busy_iter() in get_num_of_incomplete_fibs()
Use the SCSI midlayer helper to traverse the number of outstanding
commands. This also eliminates the last usage for the cmd_list
functionality so we can drop it.

Link: https://lore.kernel.org/r/20200228075318.91255-13-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:53 -05:00
Hannes Reinecke f4a0c9dbc6 scsi: aacraid: use scsi_host_busy_iter() to wait for outstanding commands
Instead of traversing the list of possible commands by hands we should be
using scsi_host_busy_iter() to figure out if there are outstanding
commands.

Link: https://lore.kernel.org/r/20200228075318.91255-12-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:52 -05:00
Hannes Reinecke dcece99e86 scsi: core: add scsi_host_busy_iter()
Add an iterator scsi_host_busy_iter() to traverse all busy commands.  If
locking against concurrent command completions is required, it has to be
provided by the caller.

Link: https://lore.kernel.org/r/20200228075318.91255-11-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:52 -05:00
Hannes Reinecke 3d3ca53b16 scsi: aacraid: use scsi_host_(block,unblock) to block I/O
Use scsi_host_block() and scsi_host_unblock() instead of
scsi_block_requests()/scsi_unblock_requests() to block and unblock I/O.
This has the advantage that the block layer will stop sending I/O to the
adapter instead of having the SCSI midlayer requeueing I/O internally.

Link: https://lore.kernel.org/r/20200228075318.91255-10-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:51 -05:00
Hannes Reinecke 2bb955840c scsi: core: add scsi_host_(block,unblock) helper function
Add helper functions to call scsi_internal_device_block()/
scsi_internal_device_unblock() for all attached devices on a SCSI host.

Link: https://lore.kernel.org/r/20200228075318.91255-9-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:51 -05:00
Hannes Reinecke 5646e13a95 scsi: aacraid: move scsi_(block,unblock)_requests out of _aac_reset_adapter()
_aac_reset_adapter() only has one caller, and that one already calls
scsi_block_requests(). Move the calls out of _aac_reset_adapter() to avoid
calling scsi_block_requests() twice.

Link: https://lore.kernel.org/r/20200228075318.91255-8-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:50 -05:00
Hannes Reinecke b64f239e61 scsi: aacraid: replace aac_flush_ios() with midlayer helper
Use the midlayer helper scsi_host_complete_all_commands() to flush all
outstanding commands.

Link: https://lore.kernel.org/r/20200228075318.91255-7-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:49 -05:00
Hannes Reinecke a1855f6126 scsi: aacraid: use scsi_host_complete_all_commands() to terminate outstanding commands
Use scsi_host_complete_all_commands() to terminate all outstanding commands
and change the command result for terminated commands to the more common
'DID_RESET' instead of 'QUEUE_FULL'.

Link: https://lore.kernel.org/r/20200228075318.91255-6-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:49 -05:00
Hannes Reinecke 2c644b1d70 scsi: aacraid: Do not wait for outstanding write commands on synchronize_cache
There is no need to wait for outstanding write commands on synchronize
cache; the block layer is responsible for I/O scheduling, no need to
out-guess it in the driver layer.

Link: https://lore.kernel.org/r/20200228075318.91255-5-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P <balsundar.b@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:49 -05:00
Hannes Reinecke 84ff9532e5 scsi: dpt_i2o: use scsi_host_complete_all_commands() to abort outstanding commands
Rather than traversing all outstanding commands manually, use the
scsi_host_complete_all_commands() helper to terminate all commands during
reset.  With that we can drop the cmd_list usage from the midlayer.

Link: https://lore.kernel.org/r/20200228075318.91255-4-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:48 -05:00
Hannes Reinecke 466552b9f3 scsi: core: add scsi_host_complete_all_commands() helper
Add a helper scsi_host_complete_all_commands() to terminate all outstanding
commands on a SCSI host.

Link: https://lore.kernel.org/r/20200228075318.91255-3-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:47 -05:00
Hannes Reinecke 22f0ba4a28 scsi: dpt_i2o: rename adpt_i2o_to_scsi() to adpt_i2o_scsi_complete()
Rename the badly named function into adpt_i2o_scsi_complete(), and make it
a void function as the return value is never used.  This also fixes a
potential use-after-free as the return value might be evaluated from the
command result after the command has been freed.

Link: https://lore.kernel.org/r/20200228075318.91255-2-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:54:47 -05:00
Guosong Su 9e7bd945b9 scsi: core: use kobj_to_dev
Use kobj_to_dev to instead of open-coding it.

Link: https://lore.kernel.org/r/20200225100411.10250-1-guosongsu@gmail.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Guosong Su <suguosong@xiaomi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28 20:43:53 -05:00