linux-2.6-microblaze.git
3 years agoscsi: message: fusion: Remove unused local variable 'vtarget'
Jiapeng Chong [Mon, 12 Apr 2021 05:59:06 +0000 (13:59 +0800)]
scsi: message: fusion: Remove unused local variable 'vtarget'

Fix the following gcc warning:

drivers/message/fusion/mptsas.c:783:14: warning: variable ‘vtarget’ set
but not used [-Wunused-but-set-variable].

Link: https://lore.kernel.org/r/1618207146-96542-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Remove unused local variable 'status'
Jiapeng Chong [Thu, 8 Apr 2021 09:06:20 +0000 (17:06 +0800)]
scsi: message: fusion: Remove unused local variable 'status'

Fix the following gcc warning:

drivers/message/fusion/mptbase.c:3087:9: warning: variable ‘status’ set
but not used [-Wunused-but-set-variable].

Link: https://lore.kernel.org/r/1617872780-126448-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Remove unused local variable 'port'
Zhen Lei [Thu, 8 Apr 2021 06:18:50 +0000 (14:18 +0800)]
scsi: message: fusion: Remove unused local variable 'port'

Fixes the following W=1 kernel build warning:

drivers/message/fusion/mptctl.c: In function ‘mptctl_gettargetinfo
drivers/message/fusion/mptctl.c:1372:7: warning: variable ‘port’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20210408061851.3089-3-thunder.leizhen@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Remove unused local variable 'time_count'
Zhen Lei [Thu, 8 Apr 2021 06:18:49 +0000 (14:18 +0800)]
scsi: message: fusion: Remove unused local variable 'time_count'

Fixes the following W=1 kernel build warning:

drivers/message/fusion/mptctl.c: In function ‘mptctl_do_taskmgmt:
drivers/message/fusion/mptctl.c:324:17: warning: variable ‘time_count’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20210408061851.3089-2-thunder.leizhen@huawei.com
Fixes: 7d757f185540 ("[SCSI] mptfusion: Updated SCSI IO IOCTL error handling.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qla4xxx: Remove unneeded if-null-free check
Qiheng Lin [Fri, 9 Apr 2021 12:03:45 +0000 (20:03 +0800)]
scsi: qla4xxx: Remove unneeded if-null-free check

Eliminate the following coccicheck warning:

drivers/scsi/qla4xxx/ql4_os.c:4175:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4196:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4215:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6400:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6402:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6555:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6557:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7838:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7840:2-7: WARNING:
 NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/r/20210409120345.6447-1-linqiheng@huawei.com
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qla2xxx: Reuse existing error handling path
Christophe JAILLET [Sun, 11 Apr 2021 09:21:40 +0000 (11:21 +0200)]
scsi: qla2xxx: Reuse existing error handling path

There is no need to duplicate code, use the existing error handling path to
free resources. This is more future-proof.

Link: https://lore.kernel.org/r/6973844a1532ec2dc8e86f3533362e79d78ed774.1618132821.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qla2xxx: Remove unneeded if-null-free check
Qiheng Lin [Fri, 9 Apr 2021 12:09:25 +0000 (20:09 +0800)]
scsi: qla2xxx: Remove unneeded if-null-free check

Eliminate the following coccicheck warning:

drivers/scsi/qla2xxx/qla_os.c:4622:2-7:
 WARNING: NULL check before some freeing functions is not needed.
drivers/scsi/qla2xxx/qla_os.c:4637:3-8:
 WARNING: NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/r/20210409120925.7122-1-linqiheng@huawei.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: mpt3sas: Fix out-of-bounds warnings in _ctl_addnl_diag_query
Gustavo A. R. Silva [Thu, 1 Apr 2021 16:20:54 +0000 (11:20 -0500)]
scsi: mpt3sas: Fix out-of-bounds warnings in _ctl_addnl_diag_query

Fix the following out-of-bounds warnings by embedding existing struct
htb_rel_query into struct mpt3_addnl_diag_query, instead of duplicating its
members:

include/linux/fortify-string.h:20:29: warning: '__builtin_memcpy' offset [19, 32] from the object at 'karg' is out of the bounds of referenced subobject 'buffer_rel_condition' with type 'short unsigned int' at offset 16 [-Warray-bounds]
include/linux/fortify-string.h:22:29: warning: '__builtin_memset' offset [19, 32] from the object at 'karg' is out of the bounds of referenced subobject 'buffer_rel_condition' with type 'short unsigned int' at offset 16 [-Warray-bounds]

The problem is that the original code is trying to copy data into a bunch
of struct members adjacent to each other in a single call to memcpy(). All
those members are exactly the same contained in struct htb_rel_query, so
instead of duplicating them into struct mpt3_addnl_diag_query, replace them
with new member rel_query of type struct htb_rel_query. So, now that this
new object is introduced, memcpy() doesn't overrun the length of
&karg.buffer_rel_condition, because the address of the new struct object
_rel_query_ is used as destination, instead. The same issue is present when
calling memset(), and it is fixed with this same approach.

Below is a comparison of struct mpt3_addnl_diag_query, before and after
this change (the size and cachelines remain the same):

$ pahole -C mpt3_addnl_diag_query drivers/scsi/mpt3sas/mpt3sas_ctl.o
struct mpt3_addnl_diag_query {
struct mpt3_ioctl_header   hdr;                  /*     0    12 */
uint32_t                   unique_id;            /*    12     4 */
uint16_t                   buffer_rel_condition; /*    16     2 */
uint16_t                   reserved1;            /*    18     2 */
uint32_t                   trigger_type;         /*    20     4 */
uint32_t                   trigger_info_dwords[2]; /*    24     8 */
uint32_t                   reserved2[2];         /*    32     8 */

/* size: 40, cachelines: 1, members: 7 */
/* last cacheline: 40 bytes */
};

$ pahole -C mpt3_addnl_diag_query drivers/scsi/mpt3sas/mpt3sas_ctl.o
struct mpt3_addnl_diag_query {
struct mpt3_ioctl_header   hdr;                  /*     0    12 */
uint32_t                   unique_id;            /*    12     4 */
struct htb_rel_query       rel_query;            /*    16    16 */
uint32_t                   reserved2[2];         /*    32     8 */

/* size: 40, cachelines: 1, members: 4 */
/* last cacheline: 40 bytes */
};

Also, this helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines on
memcpy().

Link: https://github.com/KSPP/linux/issues/109
Link: https://lore.kernel.org/lkml/60659889.bJJILx2THu3hlpxW%25lkp@intel.com/
Link: https://lore.kernel.org/r/20210401162054.GA397186@embeddedor
Build-tested-by: kernel test robot <lkp@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qedf: Use devlink to report errors and recovery
Javed Hasan [Wed, 31 Mar 2021 16:49:17 +0000 (09:49 -0700)]
scsi: qedf: Use devlink to report errors and recovery

Use devlink_health_report() to push error indications.

Implement this in qede via a callback function to make it possible to reuse
it for other drivers sitting on top of qed in future. Also remove forcible
recovery trigger and put it as a normal devlink callback in qed module.

This allows user to enable/disable it via:

    devlink health set pci/xxxx:xx:xx.x reporter fw_fatal auto_recover false

Link: https://lore.kernel.org/r/20210331164917.24662-3-jhasan@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qedf: Enable devlink support
Javed Hasan [Wed, 31 Mar 2021 16:49:16 +0000 (09:49 -0700)]
scsi: qedf: Enable devlink support

Devlink instance lifetime was linked to qed_dev object. That caused devlink
to be recreated on each recovery.

Change it by making higher level driver (qede) responsible for lifetime
management. This way devlink survives recoveries.

qede now stores devlink structure pointer as a part of its device object,
devlink private data contains a linkage structure, qed_devlink.

Link: https://lore.kernel.org/r/20210331164917.24662-2-jhasan@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: sni_53c710: Add IRQ check
Sergey Shtylyov [Tue, 30 Mar 2021 17:45:12 +0000 (20:45 +0300)]
scsi: sni_53c710: Add IRQ check

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_irq() (which takes
*unsigned* IRQ #s), causing it to fail with -EINVAL (overridden by -ENODEV
further below).  Stop calling request_irq() with the invalid IRQ #s.

Link: https://lore.kernel.org/r/8f4b8fa5-8251-b977-70a1-9099bcb4bb17@omprussia.ru
Fixes: c27d85f3f3c5 ("[SCSI] SNI RM 53c710 driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: sun3x_esp: Add IRQ check
Sergey Shtylyov [Tue, 30 Mar 2021 17:44:08 +0000 (20:44 +0300)]
scsi: sun3x_esp: Add IRQ check

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding the real
error code.  Stop calling request_irq() with the invalid IRQ #s.

Link: https://lore.kernel.org/r/363eb4c8-a3bf-4dc9-2a9e-90f349030a15@omprussia.ru
Fixes: 0bb67f181834 ("[SCSI] sun3x_esp: convert to esp_scsi")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: jazz_esp: Add IRQ check
Sergey Shtylyov [Tue, 30 Mar 2021 17:43:23 +0000 (20:43 +0300)]
scsi: jazz_esp: Add IRQ check

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding the real
error code.  Stop calling request_irq() with the invalid IRQ #s.

Link: https://lore.kernel.org/r/594aa9ae-2215-49f6-f73c-33bd38989912@omprussia.ru
Fixes: 352e921f0dd4 ("[SCSI] jazz_esp: converted to use esp_core")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Fix IRQ checks
Sergey Shtylyov [Sat, 3 Apr 2021 20:43:55 +0000 (23:43 +0300)]
scsi: hisi_sas: Fix IRQ checks

Commit df2d8213d9e3 ("hisi_sas: use platform_get_irq()") failed to take
into account that irq_of_parse_and_map() and platform_get_irq() have a
different way of indicating an error: the former returns 0 and the latter
returns a negative error code. Fix up the IRQ checks!

Link: https://lore.kernel.org/r/810f26d3-908b-1d6b-dc5c-40019726baca@omprussia.ru
Fixes: df2d8213d9e3 ("hisi_sas: use platform_get_irq()")
Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: ufs: ufshcd-pltfrm: Fix deferred probing
Sergey Shtylyov [Mon, 29 Mar 2021 20:50:58 +0000 (23:50 +0300)]
scsi: ufs: ufshcd-pltfrm: Fix deferred probing

The driver overrides the error codes returned by platform_get_irq() to
-ENODEV, so if it returns -EPROBE_DEFER, the driver would fail the probe
permanently instead of the deferred probing.  Propagate the error code
upstream as it should have been done from the start...

Link: https://lore.kernel.org/r/420364ca-614a-45e3-4e35-0e0653c7bc53@omprussia.ru
Fixes: 2953f850c3b8 ("[SCSI] ufs: use devres functions for ufshcd")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE()
dingsenjie [Wed, 31 Mar 2021 06:53:25 +0000 (14:53 +0800)]
scsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE()

Use DEFINE_SHOW_ATTRIBUTE() macro to simplify the code.

Link: https://lore.kernel.org/r/20210331065326.18804-1-dingsenjie@163.com
Signed-off-by: dingsenjie <dingsenjie@yulong.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: ufs: ufs-qcom: Remove redundant dev_err() call in ufs_qcom_init()
Ye Bin [Fri, 9 Apr 2021 07:55:22 +0000 (15:55 +0800)]
scsi: ufs: ufs-qcom: Remove redundant dev_err() call in ufs_qcom_init()

There is a error message within devm_ioremap_resource() already, so remove
the dev_err() call to avoid redundant error message.

Link: https://lore.kernel.org/r/20210409075522.2111083-1-yebin10@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Print SATA device SAS address for soft reset failure
Luo Jiaxing [Tue, 6 Apr 2021 11:48:31 +0000 (19:48 +0800)]
scsi: hisi_sas: Print SATA device SAS address for soft reset failure

Add (pseudo) SAS address for ATA software reset failure log to assist in
debugging.

Link: https://lore.kernel.org/r/1617709711-195853-7-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Warn in v3 hw channel interrupt handler when status reg cleared
Luo Jiaxing [Tue, 6 Apr 2021 11:48:30 +0000 (19:48 +0800)]
scsi: hisi_sas: Warn in v3 hw channel interrupt handler when status reg cleared

If a channel interrupt occurs without any status bit set, the handler will
return directly. However, if such redundant interrupts are received, it's
better to check what happen, so add logs for this.

Link: https://lore.kernel.org/r/1617709711-195853-6-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Yihang Li <liyihang6@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Directly snapshot registers when executing a reset
Jianqin Xie [Tue, 6 Apr 2021 11:48:29 +0000 (19:48 +0800)]
scsi: hisi_sas: Directly snapshot registers when executing a reset

The debugfs snapshot should be executed before the reset occurs to ensure
that the register contents are saved properly.

As such, it is incorrect to queue the debugfs dump when running a reset as
the reset will occur prior to the snapshot work item is handler.

Therefore, directly snapshot registers in the reset work handler.

Link: https://lore.kernel.org/r/1617709711-195853-5-git-send-email-john.garry@huawei.com
Signed-off-by: Jianqin Xie <xiejianqin@hisilicon.com>
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Call sas_unregister_ha() to roll back if .hw_init() fails
Xiang Chen [Tue, 6 Apr 2021 11:48:28 +0000 (19:48 +0800)]
scsi: hisi_sas: Call sas_unregister_ha() to roll back if .hw_init() fails

Function sas_unregister_ha() needs to be called to roll back if
hisi_hba->hw->hw_init() fails in function hisi_sas_probe() or
hisi_sas_v3_probe(). Make that change.

Link: https://lore.kernel.org/r/1617709711-195853-4-git-send-email-john.garry@huawei.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Print SAS address for v3 hw erroneous completion print
Luo Jiaxing [Tue, 6 Apr 2021 11:48:27 +0000 (19:48 +0800)]
scsi: hisi_sas: Print SAS address for v3 hw erroneous completion print

To help debugging efforts, print the device SAS address for v3 hw erroneous
completion log.

Here is an example print:

hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=2193 task=000000002b0c13f8 dev id=17 addr=570fd45f9d17b001

Link: https://lore.kernel.org/r/1617709711-195853-3-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hisi_sas: Delete some unused callbacks
Luo Jiaxing [Tue, 6 Apr 2021 11:48:26 +0000 (19:48 +0800)]
scsi: hisi_sas: Delete some unused callbacks

The debugfs code has been relocated to v3 hw driver, so delete unused
struct hisi_sas_hw function pointers snapshot_{prepare, restore}.

Link: https://lore.kernel.org/r/1617709711-195853-2-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm8001: Clean up open braces
Luo Jiaxing [Thu, 8 Apr 2021 12:56:33 +0000 (20:56 +0800)]
scsi: pm8001: Clean up open braces

checkpatch reports the following:

    ERROR: that open brace { should be on the previous line
    +static struct error_fw flash_error_table[] =
    +{

Fix a couple of instances of misplaced open bracket.

Link: https://lore.kernel.org/r/1617886593-36421-3-git-send-email-luojiaxing@huawei.com
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Jianqin Xie <xiejianqin@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm8001: Clean up white space
Luo Jiaxing [Thu, 8 Apr 2021 12:56:32 +0000 (20:56 +0800)]
scsi: pm8001: Clean up white space

checkpatch reports the following:

    ERROR: space prohibited before that ',' (ctx:WxW)
    +int pm8001_mpi_general_event(struct pm8001_hba_info *pm8001_ha , void *piomb);

Remove unnecessary whitespace.

Link: https://lore.kernel.org/r/1617886593-36421-2-git-send-email-luojiaxing@huawei.com
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Jianqin Xie <xiejianqin@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm80xx: Fix potential infinite loop
Colin Ian King [Wed, 7 Apr 2021 13:58:40 +0000 (14:58 +0100)]
scsi: pm80xx: Fix potential infinite loop

The for-loop iterates with a u8 loop counter i and compares this with the
loop upper limit of pm8001_ha->max_q_num which is a u32 type.  There is a
potential infinite loop if pm8001_ha->max_q_num is larger than the u8 loop
counter. Fix this by making the loop counter the same type as
pm8001_ha->max_q_num.

[mkp: this is purely theoretical, max_q_num is currently limited to 64]

Link: https://lore.kernel.org/r/20210407135840.494747-1-colin.king@canonical.com
Fixes: 65df7d1986a1 ("scsi: pm80xx: Fix chip initialization failure")
Addresses-Coverity: ("Infinite loop")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm80xx: Remove busy wait from mpi_uninit_check()
Igor Pylypiv [Tue, 6 Apr 2021 18:05:34 +0000 (11:05 -0700)]
scsi: pm80xx: Remove busy wait from mpi_uninit_check()

mpi_uninit_check() is not being called in an atomic context.  The only
caller of mpi_uninit_check() is pm80xx_chip_soft_rst().

Callers of pm80xx_chip_soft_rst():

 - pm8001_ioctl_soft_reset()
 - pm8001_pci_probe()
 - pm8001_pci_remove()
 - pm8001_pci_suspend()
 - pm8001_pci_resume()

There was a similar fix for mpi_init_check() in commit
d71023af4bec ("scsi: pm80xx: Do not busy wait in MPI init check")

Link: https://lore.kernel.org/r/20210406180534.1924345-3-ipylypiv@google.com
Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm80xx: Increase timeout for pm80xx mpi_uninit_check()
Igor Pylypiv [Tue, 6 Apr 2021 18:05:33 +0000 (11:05 -0700)]
scsi: pm80xx: Increase timeout for pm80xx mpi_uninit_check()

The mpi_uninit_check() takes longer for inbound doorbell register to be
cleared. Increase the timeout substantially so that the driver does not
fail to load.

Previously, the inbound doorbell wait time was mistakenly increased in the
mpi_init_check() instead of mpi_uninit_check(). It is okay to leave the
mpi_init_check() wait time as-is as these are timeout values and if there
is a failure, waiting longer is not an issue.

Link: https://lore.kernel.org/r/20210406180534.1924345-2-ipylypiv@google.com
Fixes: e90e236250e9 ("scsi: pm80xx: Increase timeout for pm80xx mpi_uninit_check")
Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Make data_pages_per_blk changeable via configfs
Bodo Stroesser [Wed, 24 Mar 2021 19:57:58 +0000 (20:57 +0100)]
scsi: target: tcmu: Make data_pages_per_blk changeable via configfs

Make data_pages_per_blk changeable similar to the way it is done for
max_data_area_mb. One can change the value by typing:

  echo "data_pages_per_blk=N" >control

The value is printed when doing:

  cat info

In addition, a new readonly attribute 'data_pages_per_blk' returns the
value on read.

Link: https://lore.kernel.org/r/20210324195758.2021-7-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Replace block size definitions with new udev members
Bodo Stroesser [Wed, 24 Mar 2021 19:57:57 +0000 (20:57 +0100)]
scsi: target: tcmu: Replace block size definitions with new udev members

Replace DATA_PAGES_PER_BLK and DATA_BLOCK_SIZE with new struct elements
tcmu_dev->data_pages_per_blk and tcmu_dev->data_blk_size.  These new
variables are still loaded with constant definition DATA_PAGES_PER_BLK_DEF
(= 1) and DATA_PAGES_PER_BLK_DEF * PAGE_SIZE.

There is no way yet to set the values via configfs.

Link: https://lore.kernel.org/r/20210324195758.2021-6-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Remove function tcmu_get_block_page()
Bodo Stroesser [Wed, 24 Mar 2021 19:57:56 +0000 (20:57 +0100)]
scsi: target: tcmu: Remove function tcmu_get_block_page()

There is only one caller of tcmu_get_block_page left. Since it is a
one-liner, we can remove the function.

Link: https://lore.kernel.org/r/20210324195758.2021-5-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE
Bodo Stroesser [Wed, 24 Mar 2021 19:57:55 +0000 (20:57 +0100)]
scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE

Change tcmu to support DATA_BLOCK_SIZE being a multiple of PAGE_SIZE. There
are two reasons why one would like to have a bigger DATA_BLOCK_SIZE:

 1) If userspace - e.g. due to data compression, encryption or
    deduplication - needs to have receive or transmit data in a consecutive
    buffer, we can define DATA_BLOCK_SIZE to the maximum size of a SCSI
    READ/WRITE to enforce that userspace sees just one consecutive
    buffer. That way we can avoid the need for doing data copy in
    userspace.

 2) Using a bigger data block size can speed up command processing in
    tcmu. The number of free data blocks to look up in bitmap is reduced
    substantially. The lookup for data pages in radix_tree can be done more
    efficiently if there are multiple pages in a data block. The maximum
    number of IOVs to set up is lower so cmd entries in the ring become
    smaller.

Link: https://lore.kernel.org/r/20210324195758.2021-4-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Prepare for PAGE_SIZE != DATA_BLOCK_SIZE
Bodo Stroesser [Wed, 24 Mar 2021 19:57:54 +0000 (20:57 +0100)]
scsi: target: tcmu: Prepare for PAGE_SIZE != DATA_BLOCK_SIZE

Rename some variables and definitions as a first preparation for
DATA_BLOCK_SIZE != PAGE_SIZE and add the new DATA_PAGES_PER_BLK definition
containing the number of pages per data block.

Rename tcmu_try_get_block_page() to tcmu_try_get_data_page(). Keep name
tcmu_get_block_page() since it will go away in a following commit when
there is only one caller left.  Subsequent commits will then add full
support for DATA_PAGES_PER_BLK != 1, which also means DATA_BLOCK_SIZE =
DATA_PAGES_PER_BLK * PAGE_SIZE

Link: https://lore.kernel.org/r/20210324195758.2021-3-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: tcmu: Adjust names of variables and definitions
Bodo Stroesser [Wed, 24 Mar 2021 19:57:53 +0000 (20:57 +0100)]
scsi: target: tcmu: Adjust names of variables and definitions

Some definitions and members of struct tcmu_dev had misleading
names. Examples:

 - ring_size was used for the size of mailbox + cmd ring + data area

 - CMDR_SIZE was used for size of mailbox + cmd ring

I added the new definition MB_CMDR_SIZE (mailbox + command ring), changed
CMDR_SIZE to hold the size of the command ring only and replaced in struct
tcmu_dev the member ring_size with mmap_pages, because the member is now
used in tcmu_mmap() only, where we need page count, not size.

I also added the new struct tcmu_dev member 'cmdr' which is used to replace
some occurences of '(void *)mb + CMDR_OFF' with 'udev->cmdr' for better
readability.

Link: https://lore.kernel.org/r/20210324195758.2021-2-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoMerge branch '5.12/scsi-fixes' into 5.13/scsi-staging
Martin K. Petersen [Tue, 13 Apr 2021 01:41:54 +0000 (21:41 -0400)]
Merge branch '5.12/scsi-fixes' into 5.13/scsi-staging

Resolve a couple of conflicts between the 5.12 fixes branch and the
5.13 staging tree (iSCSI target and UFS).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: libsas: Clean up whitespace
Luo Jiaxing [Thu, 25 Mar 2021 12:29:56 +0000 (20:29 +0800)]
scsi: libsas: Clean up whitespace

checkpatch reported several whitespace errors. Fix them all.

Link: https://lore.kernel.org/r/1616675396-6108-3-git-send-email-luojiaxing@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: libsas: Correctly indent statements in sas_to_ata_err()
Luo Jiaxing [Thu, 25 Mar 2021 12:29:55 +0000 (20:29 +0800)]
scsi: libsas: Correctly indent statements in sas_to_ata_err()

checkpatch reported an error in sas_to_ata_err(). switch and case
statements are incorrectly indented.

Link: https://lore.kernel.org/r/1616675396-6108-2-git-send-email-luojiaxing@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: qedf: Remove unused include of linux/version.h
Tian Tao [Thu, 1 Apr 2021 13:26:58 +0000 (21:26 +0800)]
scsi: qedf: Remove unused include of linux/version.h

Remove unnecessary include of linux/version.h.

Link: https://lore.kernel.org/r/1617283618-19346-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: bfa: Remove unnecessary struct declarations
Wan Jiabing [Thu, 1 Apr 2021 06:35:34 +0000 (14:35 +0800)]
scsi: bfa: Remove unnecessary struct declarations

struct bfa_fcs_s is declared twice. First is declared at line 50, remove
the duplicate.

struct bfa_fcs_fabric_s is defined at line 175, remove unnecessary
declaration.

Link: https://lore.kernel.org/r/20210401063535.992487-1-wanjiabing@vivo.com
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: ufs: core: Fix out-of-bounds warnings in ufshcd_exec_raw_upiu_cmd()
Gustavo A. R. Silva [Wed, 31 Mar 2021 22:43:38 +0000 (17:43 -0500)]
scsi: ufs: core: Fix out-of-bounds warnings in ufshcd_exec_raw_upiu_cmd()

Fix the following out-of-bounds warnings by enclosing some structure
members into new structure objects upiu_req and upiu_rsp:

include/linux/fortify-string.h:20:29: warning: '__builtin_memcpy' offset [29, 48] from the object at 'treq' is out of the bounds of referenced subobject 'req_header' with type 'struct utp_upiu_header' at offset 16 [-Warray-bounds]
include/linux/fortify-string.h:20:29: warning: '__builtin_memcpy' offset [61, 80] from the object at 'treq' is out of the bounds of referenced subobject 'rsp_header' with type 'struct utp_upiu_header' at offset 48 [-Warray-bounds]
arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [29, 48] from the object at 'treq' is out of the bounds of referenced subobject 'req_header' with type 'struct utp_upiu_header' at offset 16 [-Warray-bounds]
arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [61, 80] from the object at 'treq' is out of the bounds of referenced subobject 'rsp_header' with type 'struct utp_upiu_header' at offset 48 [-Warray-bounds]

Refactor the code by making it more structured.

The problem is that the original code is trying to copy data into a bunch
of struct members adjacent to each other in a single call to memcpy(). Now
that a new struct _upiu_req_ enclosing all those adjacent members is
introduced, memcpy() doesn't overrun the length of &treq.req_header,
because the address of the new struct object _upiu_req_ is used as the
destination, instead. The same problem is present when memcpy() overruns
the length of the source &treq.rsp_header; in this case the address of the
new struct object _upiu_rsp_ is used, instead.

Also, this helps with the ongoing efforts to enable -Warray-bounds and
avoid confusing the compiler.

Link: https://github.com/KSPP/linux/issues/109
Link: https://lore.kernel.org/lkml/60640558.lsAxiK6otPwTo9rv%25lkp@intel.com/
Link: https://lore.kernel.org/r/20210331224338.GA347171@embeddedor
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Build-tested-by: kernel test robot <lkp@intel.com>
3 years agoscsi: fnic: Remove unnecessary spin_lock_init() and INIT_LIST_HEAD()
Yang Yingliang [Tue, 30 Mar 2021 12:59:11 +0000 (20:59 +0800)]
scsi: fnic: Remove unnecessary spin_lock_init() and INIT_LIST_HEAD()

The spinlock and list head of fnic_list are initialized statically.  It is
unnecessary to initialize them.

Link: https://lore.kernel.org/r/20210330125911.1050879-1-yangyingliang@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Use BUG_ON instead of if condition followed by BUG
zhouchuangao [Tue, 30 Mar 2021 12:46:01 +0000 (05:46 -0700)]
scsi: message: fusion: Use BUG_ON instead of if condition followed by BUG

BUG_ON() uses unlikely in if() which can be optimized at compile time.

Link: https://lore.kernel.org/r/1617108361-6870-1-git-send-email-zhouchuangao@vivo.com
Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: mpt3sas: Block PCI config access from userspace during reset
Sreekanth Reddy [Tue, 30 Mar 2021 10:51:37 +0000 (16:21 +0530)]
scsi: mpt3sas: Block PCI config access from userspace during reset

While diag reset is in progress there is short duration where all access to
controller's PCI config space from the host needs to be blocked. This is
due to a hardware limitation of the IOC controllers.

Block all access to controller's config space from userland applications by
calling pci_cfg_access_lock() while diag reset is in progress and unlocking
it again after the controller comes back to ready state.

Link: https://lore.kernel.org/r/20210330105137.20728-1-sreekanth.reddy@broadcom.com
Cc: stable@vger.kernel.org #v5.4.108+
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: mpt3sas: Fix endianness for ActiveCablePowerRequirement
Sreekanth Reddy [Tue, 30 Mar 2021 10:51:06 +0000 (16:21 +0530)]
scsi: mpt3sas: Fix endianness for ActiveCablePowerRequirement

Covert ActiveCablePowerRequirement's value to target CPU endian before
displaying it.

Link: https://lore.kernel.org/r/20210330105106.20569-1-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: mpt3sas: Only one vSES is present even when IOC has multi vSES
Sreekanth Reddy [Tue, 30 Mar 2021 10:50:04 +0000 (16:20 +0530)]
scsi: mpt3sas: Only one vSES is present even when IOC has multi vSES

Whenever the driver is adding a vSES to virtual-phys list it is
reinitializing the list head. Hence those vSES devices which were added
previously are lost.

Stop reinitializing the list every time a new vSES device is added.

Link: https://lore.kernel.org/r/20210330105004.20413-1-sreekanth.reddy@broadcom.com
Cc: stable@vger.kernel.org #v5.11.10+
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: Make the virtual LUN 0 device
Konstantin Shelekhin [Mon, 22 Mar 2021 20:09:38 +0000 (23:09 +0300)]
scsi: target: Make the virtual LUN 0 device

Create the device for the virtual LUN 0 using the DUMMY flag. This change
makes it possible to remove some special-casing in the INQUIRY code.

Link: https://lore.kernel.org/r/20210322200938.53300-3-k.shelekhin@yadro.com
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Konstantin Shelekhin <k.shelekhin@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: Add the DUMMY flag to rd_mcp
Konstantin Shelekhin [Mon, 22 Mar 2021 20:09:37 +0000 (23:09 +0300)]
scsi: target: Add the DUMMY flag to rd_mcp

This commit adds the DUMMY flag to the rd_mcp backend that forces a logical
unit to report itself as not connected device of an unknown type.
Essentially this allows users to create devices identical to the device for
the virtual LUN 0, making it possible to explicitly create a LUN 0 device
and configure its WWNs (e.g. vendor or product name).

Link: https://lore.kernel.org/r/20210322200938.53300-2-k.shelekhin@yadro.com
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Konstantin Shelekhin <k.shelekhin@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg()
Ewan D. Milne [Wed, 31 Mar 2021 20:11:54 +0000 (16:11 -0400)]
scsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg()

Some arrays return ILLEGAL_REQUEST with ASC 00h if they don't support the
RTPG extended header so remove the check for INVALID FIELD IN CDB.

Link: https://lore.kernel.org/r/20210331201154.20348-1-emilne@redhat.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: scsi_dh_alua: Prevent duplicate pg info print in alua_rtpg()
John Pittman [Wed, 31 Mar 2021 18:16:56 +0000 (14:16 -0400)]
scsi: scsi_dh_alua: Prevent duplicate pg info print in alua_rtpg()

Due to the frequency that alua_rtpg() is called, the path group info print
within can print the same info multiple times in the logs, subsequent
prints adding no new information or value.

To reproduce:

    # modprobe scsi_debug vpd_use_hostno=0
    # systemctl start multipathd.service

To fix, check stored values, only printing at alua attach/activate and if
any of the values change.

Link: https://lore.kernel.org/r/20210331181656.5046-1-jpittman@redhat.com
Reviewed-by: David Jeffery <djeffery@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state
Martin Wilck [Thu, 1 Apr 2021 09:11:05 +0000 (11:11 +0200)]
scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state

rport_dev_loss_timedout() sets the rport state to SRP_PORT_LOST and the
SCSI target state to SDEV_TRANSPORT_OFFLINE. If this races with
srp_reconnect_work(), a warning is printed:

Mar 27 18:48:07 ictm1604s01h4 kernel: dev_loss_tmo expired for SRP port-18:1 / host18.
Mar 27 18:48:07 ictm1604s01h4 kernel: ------------[ cut here ]------------
Mar 27 18:48:07 ictm1604s01h4 kernel: scsi_internal_device_block(18:0:0:100) failed: ret = -22
Mar 27 18:48:07 ictm1604s01h4 kernel: Call Trace:
Mar 27 18:48:07 ictm1604s01h4 kernel:  ? scsi_target_unblock+0x50/0x50 [scsi_mod]
Mar 27 18:48:07 ictm1604s01h4 kernel:  starget_for_each_device+0x80/0xb0 [scsi_mod]
Mar 27 18:48:07 ictm1604s01h4 kernel:  target_block+0x24/0x30 [scsi_mod]
Mar 27 18:48:07 ictm1604s01h4 kernel:  device_for_each_child+0x57/0x90
Mar 27 18:48:07 ictm1604s01h4 kernel:  srp_reconnect_rport+0xe4/0x230 [scsi_transport_srp]
Mar 27 18:48:07 ictm1604s01h4 kernel:  srp_reconnect_work+0x40/0xc0 [scsi_transport_srp]

Avoid this by not trying to block targets for rports in SRP_PORT_LOST
state.

Link: https://lore.kernel.org/r/20210401091105.8046-1-mwilck@suse.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: target: iscsi: Fix zero tag inside a trace event
Roman Bolshakov [Sat, 3 Apr 2021 21:54:15 +0000 (00:54 +0300)]
scsi: target: iscsi: Fix zero tag inside a trace event

target_sequencer_start event is triggered inside target_cmd_init_cdb().
se_cmd.tag is not initialized with ITT at the moment so the event always
prints zero tag.

Link: https://lore.kernel.org/r/20210403215415.95077-1-r.bolshakov@yadro.com
Cc: stable@vger.kernel.org # 5.10+
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: pm80xx: Fix chip initialization failure
Viswas G [Fri, 2 Apr 2021 05:42:12 +0000 (11:12 +0530)]
scsi: pm80xx: Fix chip initialization failure

Inbound and outbound queues were not properly configured and that lead to
MPI configuration failure.

Fixes: 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues")
Cc: stable@vger.kernel.org # 5.10+
Link: https://lore.kernel.org/r/20210402054212.17834-1-Viswas.G@microchip.com.com
Reported-and-tested-by: Ash Izat <ash@ai0.uk>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update version to 2.1.8-045
Don Brace [Thu, 11 Mar 2021 20:17:54 +0000 (14:17 -0600)]
scsi: smartpqi: Update version to 2.1.8-045

Update version.

Link: https://lore.kernel.org/r/161549387469.25025.12859568843576080076.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Gerry Morong <gerry.morong@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add new PCI IDs
Kevin Barnett [Thu, 11 Mar 2021 20:17:48 +0000 (14:17 -0600)]
scsi: smartpqi: Add new PCI IDs

Add support for newer hardware.

Link: https://lore.kernel.org/r/161549386882.25025.2594251735886014958.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Acked-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Correct system hangs when resuming from hibernation
Kevin Barnett [Thu, 11 Mar 2021 20:17:42 +0000 (14:17 -0600)]
scsi: smartpqi: Correct system hangs when resuming from hibernation

Correct system hangs when resuming from hibernation after first successful
hibernation/resume cycle. Rare condition involving OFA.

Note: Suspend/resume is not supported on many platforms. It was originally
intended for workstations.

Link: https://lore.kernel.org/r/161549386295.25025.14555840632114761610.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update enclosure identifier in sysfs
Murthy Bhat [Thu, 11 Mar 2021 20:17:37 +0000 (14:17 -0600)]
scsi: smartpqi: Update enclosure identifier in sysfs

Update enclosure identifier field corresponding to physical devices in
lsscsi/sysfs.

During device add the SCSI devtype is filled in during slave_configure().
However, when pqi_scsi_update_device() runs (REGNEWD) the firmware returns
zero for the SCSI devtype field, and valid devtype is overwritten by
zero. Due to this, lsscsi output shows wrong values.

Link: https://lore.kernel.org/r/161549385708.25025.17234953506918043750.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add additional logging for LUN resets
Kevin Barnett [Thu, 11 Mar 2021 20:17:31 +0000 (14:17 -0600)]
scsi: smartpqi: Add additional logging for LUN resets

LUN resets can take longer to complete. Adding in more driver logging helps
show where the driver is in the reset process.

Add a timeout in pqi_device_wait_for_pending_io() to cap how long the
driver will wait for outstanding commands.

Link: https://lore.kernel.org/r/161549385119.25025.10366493975709358647.stgit@brunhilda
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update SAS initiator_port_protocols and target_port_protocols
Murthy Bhat [Thu, 11 Mar 2021 20:17:25 +0000 (14:17 -0600)]
scsi: smartpqi: Update SAS initiator_port_protocols and target_port_protocols

Export valid sas initiator_port_protocols and target_port_protocols to
sysfs. Needed for lsscsi to show correct values.

Link: https://lore.kernel.org/r/161549384532.25025.1469409935400845385.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add phy ID support for the physical drives
Murthy Bhat [Thu, 11 Mar 2021 20:17:19 +0000 (14:17 -0600)]
scsi: smartpqi: Add phy ID support for the physical drives

Display topology using PHY numbers. PHY (both local and remote) numbers
corresponding to physical drives are read from
BMIC_IDENTIFY_PHYSICAL_DEVICE.

Link: https://lore.kernel.org/r/161549383947.25025.16977895345376485056.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Convert snprintf() to scnprintf()
Kevin Barnett [Thu, 11 Mar 2021 20:17:13 +0000 (14:17 -0600)]
scsi: smartpqi: Convert snprintf() to scnprintf()

The entire Linux kernel has been slowly migrating from snprintf() to
scnprintf(), so we are doing our part. This article explains the rationale
for this change:

   https: //lwn.net/Articles/69419/

Link: https://lore.kernel.org/r/161549383357.25025.12363435617789964291.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Fix driver synchronization issues
Kevin Barnett [Thu, 11 Mar 2021 20:17:07 +0000 (14:17 -0600)]
scsi: smartpqi: Fix driver synchronization issues

 - Synchronize OFA and controller offline events. Prevent I/O during the
   above conditions.

 - Cleanup pqi_device_wait_for_pending_io() by checking the
   device->scsi_cmds_outstanding instead of walking the device's list of
   commands.

 - Stop failing all I/O for all devices. This was causing OS to retry them,
   delaying OFA.

 - Clean up cache flush. The controller is checked for offline status in
   lower level functions.

Link: https://lore.kernel.org/r/161549382770.25025.789855864026860170.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update device scan operations
Kevin Barnett [Thu, 11 Mar 2021 20:17:01 +0000 (14:17 -0600)]
scsi: smartpqi: Update device scan operations

Change return type from EINPROGRESS to EBUSY to signal applications to
retry a REGNEWD if the driver cannot process the REGNEWD. Events such as
OFA, suspend, and shutdown return EINPROGRESS if a scan is currently
running. This prevents applications from immediately retrying REGNEWD.

Schedule a new REGNEWD if system low on memory.

Link: https://lore.kernel.org/r/161549382157.25025.16054784597622125373.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update OFA management
Kevin Barnett [Thu, 11 Mar 2021 20:16:55 +0000 (14:16 -0600)]
scsi: smartpqi: Update OFA management

OFA, Online Firmware Activation, allows users to update firmware without a
reboot.

 - Change OFA setup to a worker thread

 - Delay soft resets

 - Add OFA event handler to allow FW to initiate OFA

 - Add in-memory allocation to OFA events

 - Update OFA buffer size calculations

 - Add ability to cancel OFA events

 - Update OFA quiesce/un-quiesce

 - Prevent Kernel crashes while issuing ioctl during OFA

 - Returned EBUSY for pass-through IOCTLs throughout all stages of OFA

 - Add mutex to prevent parallel OFA updates.

Link: https://lore.kernel.org/r/161549381563.25025.2647205502550052197.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update RAID bypass handling
Kevin Barnett [Thu, 11 Mar 2021 20:16:49 +0000 (14:16 -0600)]
scsi: smartpqi: Update RAID bypass handling

Simplify AIO retry management by removing retry list and list
management. Need to retry is already set in the response status. Also
remove the bypass worker thread.

Accelerated I/O requests bypass the RAID engine and go directly to either
an HBA disk or to a physical component of a RAID volume.

Link: https://lore.kernel.org/r/161549380976.25025.11776487034357231156.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update suspend/resume and shutdown
Kevin Barnett [Thu, 11 Mar 2021 20:16:44 +0000 (14:16 -0600)]
scsi: smartpqi: Update suspend/resume and shutdown

For suspend/resume and shutdown prevent: Controller events, any new I/O
requests, controller requests, REGNEWD, and reset operations.

Wait for any pending completions from the controller to complete to avoid
controller NMI events.

Link: https://lore.kernel.org/r/161549380398.25025.12266769502766103580.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Synchronize device resets with mutex
Kevin Barnett [Thu, 11 Mar 2021 20:16:38 +0000 (14:16 -0600)]
scsi: smartpqi: Synchronize device resets with mutex

Remove some flags used to check for device resets already in
progress. Allow only 1 reset operation at a time for the host.

Link: https://lore.kernel.org/r/161549379810.25025.10194117431886743795.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update soft reset management for OFA
Kevin Barnett [Thu, 11 Mar 2021 20:16:32 +0000 (14:16 -0600)]
scsi: smartpqi: Update soft reset management for OFA

Cleanup soft reset code for Online Firmware Activation (OFA). OFA allows
controller firmware updates without a reboot.

OFA updates require an on-line controller reset to activate the updated
firmware. There were some missing actions for some of the reset cases. The
controller is first set back to sis mode before returning to pqi mode.
Check to ensure the controller is in sis mode.

Release QRM memory (OFA buffer) on OFA error conditions. Clean up
controller state which can cause a kernel panic upon reboot after an
unsuccessful OFA.

Link: https://lore.kernel.org/r/161549379215.25025.10654441314249183621.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Update event handler
Kevin Barnett [Thu, 11 Mar 2021 20:16:26 +0000 (14:16 -0600)]
scsi: smartpqi: Update event handler

Change the data types for event_id and additional_event_id.

Link: https://lore.kernel.org/r/161549378628.25025.14338046567871170916.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for wwid
Kevin Barnett [Thu, 11 Mar 2021 20:16:20 +0000 (14:16 -0600)]
scsi: smartpqi: Add support for wwid

WWID has been added to Report Physical LUNs in newer controller
firmware. The presence of this field is detected by a feature bit. Add
detection of this new feature and store the WWID when set.

Link: https://lore.kernel.org/r/161549378041.25025.3869709982357729841.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Remove timeouts from internal cmds
Kevin Barnett [Thu, 11 Mar 2021 20:16:14 +0000 (14:16 -0600)]
scsi: smartpqi: Remove timeouts from internal cmds

Remove timeouts for driver-initiated commands. Responses to internal
requests can take longer than hard coded timeout values and the driver will
still have an outstanding request that may complete in the future with no
context.

Link: https://lore.kernel.org/r/161549377451.25025.12306492868851801623.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Disable WRITE SAME for HBA NVMe disks
Kevin Barnett [Thu, 11 Mar 2021 20:16:08 +0000 (14:16 -0600)]
scsi: smartpqi: Disable WRITE SAME for HBA NVMe disks

Controller does not support SCSI WRITE SAME for NVMe drives in HBA mode

Link: https://lore.kernel.org/r/161549376866.25025.5961694654342018260.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add host level stream detection enable
Don Brace [Thu, 11 Mar 2021 20:16:02 +0000 (14:16 -0600)]
scsi: smartpqi: Add host level stream detection enable

Allow R5/R6 stream detection to be disabled/enabled using sysfs entry
enable_stream_detection.

Example usage:

lsscsi
[2:2:0:0]    storage Adaptec  3258P-32i /e     0010
 ^
 |
 +---- NOTE: here host is host2

find /sys -name \*enable_stream\*
/sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection
/sys/devices/pci0000:5b/0000:5b:00.0/0000:5c:00.0/host3/scsi_host/host3/enable_stream_detection

Current stream detection:
cat /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection
1

Turn off stream detection:
echo 0 > /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection

Turn on stream detection:
echo 1 > /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection

Link: https://lore.kernel.org/r/161549376281.25025.1132304698441513738.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add stream detection
Don Brace [Thu, 11 Mar 2021 20:15:56 +0000 (14:15 -0600)]
scsi: smartpqi: Add stream detection

Enhance performance by adding sequential stream detection for RAID5/RAID6
sequential write requests. Reduce stripe lock contention with full-stripe
write operations.

There is one common stripe lock for each RAID volume that can be set by
either the RAID engine or the AIO engine. The AIO path has I/O request
sizes well below the stripe size resulting in many Read-Modify-Write
operations.

Sending the request to the RAID engine allows for coalescing requests into
full stripe operations resulting in reduced Read-Modify-Write operations.

Link: https://lore.kernel.org/r/161549375693.25025.2962141451773219796.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Align code with oob driver
Kevin Barnett [Thu, 11 Mar 2021 20:15:50 +0000 (14:15 -0600)]
scsi: smartpqi: Align code with oob driver

Reduce differences between out-of-box driver and kernel.org driver. No
functional changes.

Link: https://lore.kernel.org/r/161549375094.25025.9268879575316758510.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for long firmware version
Kevin Barnett [Thu, 11 Mar 2021 20:15:45 +0000 (14:15 -0600)]
scsi: smartpqi: Add support for long firmware version

Add support for new "long" firmware version which requires minor driver
changes to expose.

Link: https://lore.kernel.org/r/161549374508.25025.15467221395888158022.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for BMIC sense feature cmd and feature bits
Kevin Barnett [Thu, 11 Mar 2021 20:15:39 +0000 (14:15 -0600)]
scsi: smartpqi: Add support for BMIC sense feature cmd and feature bits

Determine support for supported features from BMIC sense feature command
instead of config table. Enable features such as: RAID 1/5/6 write
support, SATA wwid, and encryption.

Link: https://lore.kernel.org/r/161549373914.25025.7999816178098103135.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for RAID1 writes
Don Brace [Thu, 11 Mar 2021 20:15:33 +0000 (14:15 -0600)]
scsi: smartpqi: Add support for RAID1 writes

Add RAID1 write IU and implement RAID1 write support. Change brand names
ADM/ADG to TRIPLE/RAID-6.

Link: https://lore.kernel.org/r/161549373324.25025.2441592111049564780.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for RAID5 and RAID6 writes
Don Brace [Thu, 11 Mar 2021 20:15:27 +0000 (14:15 -0600)]
scsi: smartpqi: Add support for RAID5 and RAID6 writes

Add in new IU definition and implement support for RAID5 and RAID6 writes.

Link: https://lore.kernel.org/r/161549372734.25025.963261942897080281.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Refactor scatterlist code
Don Brace [Thu, 11 Mar 2021 20:15:21 +0000 (14:15 -0600)]
scsi: smartpqi: Refactor scatterlist code

Factor out code common to all scatter-gather list building to prepare for
new AIO functionality. AIO (Accelerated I/O) requests go directly to disk

No functional changes.

Link: https://lore.kernel.org/r/161549372147.25025.9706613054649682229.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Refactor aio submission code
Don Brace [Thu, 11 Mar 2021 20:15:15 +0000 (14:15 -0600)]
scsi: smartpqi: Refactor aio submission code

Refactor aio submission code:

    1. Break up function pqi_raid_bypass_submit_scsi_cmd()
       into smaller functions.

    2. Add common block (rmd - raid_map_data) to carry around into newly
       added functions.

    3. Prepare for new AIO functionality.

No functional changes.

Link: https://lore.kernel.org/r/161549371553.25025.8840958689316611074.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Add support for new product ids
Kevin Barnett [Thu, 11 Mar 2021 20:15:09 +0000 (14:15 -0600)]
scsi: smartpqi: Add support for new product ids

Add support for newer hardware by adding in a product identifier. This
identifier can then be used to check for the hardware generation.

Link: https://lore.kernel.org/r/161549370966.25025.2968242206975557607.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Correct request leakage during reset operations
Murthy Bhat [Thu, 11 Mar 2021 20:15:03 +0000 (14:15 -0600)]
scsi: smartpqi: Correct request leakage during reset operations

While failing queued I/Os in TMF path, there was a request leak and hence
stale entries in request pool with ref count being non-zero. In shutdown
path we have a BUG_ON to catch stuck I/O either in firmware or in the
driver. The stale requests caused a system crash. The I/O request pool
leakage also lead to a significant performance drop.

Link: https://lore.kernel.org/r/161549370379.25025.12793264112620796062.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: smartpqi: Use host-wide tag space
Don Brace [Thu, 11 Mar 2021 20:14:57 +0000 (14:14 -0600)]
scsi: smartpqi: Use host-wide tag space

Correct SCSI midlayer sending more requests than exposed host queue depth
causing firmware ASSERT and lockup issues by enabling host-wide tags.

Note: This also results in better performance.

Link: https://lore.kernel.org/r/161549369787.25025.8975999483518581619.stgit@brunhilda
Suggested-by: Ming Lei <ming.lei@redhat.com>
Suggested-by: John Garry <john.garry@huawei.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoMerge branch '5.12/scsi-fixes' into 5.13/scsi-staging
Martin K. Petersen [Tue, 6 Apr 2021 02:57:29 +0000 (22:57 -0400)]
Merge branch '5.12/scsi-fixes' into 5.13/scsi-staging

Pull 5.12/scsi-fixes into the 5.13 SCSI tree to provide a baseline for
some UFS changes that would otherwise cause conflicts during the
merge.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs
Can Guo [Thu, 1 Apr 2021 07:39:09 +0000 (00:39 -0700)]
scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs

In __ufshcd_issue_tm_cmd(), it is not correct to use hba->nutrs + req->tag
as the Task Tag in a TMR UPIU. Directly use req->tag as the Task Tag.

Fixes: e293313262d3 ("scsi: ufs: Fix broken task management command implementation")
Link: https://lore.kernel.org/r/1617262750-4864-3-git-send-email-cang@codeaurora.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: ufs: core: Fix task management request completion timeout
Can Guo [Thu, 1 Apr 2021 07:39:08 +0000 (00:39 -0700)]
scsi: ufs: core: Fix task management request completion timeout

ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = ufshcd_compl_tm()),
but since blk_mq_tagset_busy_iter() only iterates over all reserved tags
and requests which are not in IDLE state, ufshcd_compl_tm() never gets a
chance to run. Thus, TMR always ends up with completion timeout. Fix it by
calling blk_mq_start_request() in __ufshcd_issue_tm_cmd().

Link: https://lore.kernel.org/r/1617262750-4864-2-git-send-email-cang@codeaurora.org
Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: mptlan: Replace one-element array with flexible-array member
Gustavo A. R. Silva [Wed, 24 Mar 2021 23:33:44 +0000 (18:33 -0500)]
scsi: message: mptlan: Replace one-element array with flexible-array member

There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code
should always use "flexible array members"[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].

Refactor the code according to the use of a flexible-array member in struct
_SGE_TRANSACTION32 instead of one-element array.

Also, this helps with the ongoing efforts to enable -Warray-bounds by
fixing the following warning:

  CC [M]  drivers/message/fusion/mptlan.o
drivers/message/fusion/mptlan.c: In function ‘mpt_lan_sdu_send’:
drivers/message/fusion/mptlan.c:759:28: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
  759 |  pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) |
      |  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/109
Link: https://lore.kernel.org/r/20210324233344.GA99059@embeddedor
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Replace one-element array with flexible-array member
Gustavo A. R. Silva [Wed, 24 Mar 2021 23:00:36 +0000 (18:00 -0500)]
scsi: message: fusion: Replace one-element array with flexible-array member

There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code
should always use "flexible array members"[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].

Also, this helps with the ongoing efforts to enable -Warray-bounds by
fixing the following warning:

drivers/message/fusion/mptbase.c: In function ‘mptbase_reply’:
drivers/message/fusion/mptbase.c:7747:62: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
 7747 |     ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]);
./include/uapi/linux/byteorder/little_endian.h:34:51: note: in definition of macro ‘__le32_to_cpu’
   34 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
      |                                                   ^
drivers/message/fusion/mptbase.c:7747:33: note: in expansion of macro ‘le32_to_cpu’
 7747 |     ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]);
      |

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/109
Link: https://lore.kernel.org/r/20210324230036.GA67851@embeddedor
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: fcoe: Fix mismatched fcoe_wwn_from_mac declaration
Arnd Bergmann [Mon, 22 Mar 2021 16:46:59 +0000 (17:46 +0100)]
scsi: fcoe: Fix mismatched fcoe_wwn_from_mac declaration

An old cleanup changed the array size from MAX_ADDR_LEN to unspecified in
the declaration, but now gcc-11 warns about this:

drivers/scsi/fcoe/fcoe_ctlr.c:1972:37: error: argument 1 of type ‘unsigned char[32]’ with mismatched bound [-Werror=array-parameter=]
 1972 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
      |                       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /git/arm-soc/drivers/scsi/fcoe/fcoe_ctlr.c:33:
include/scsi/libfcoe.h:252:37: note: previously declared as ‘unsigned char[]’
  252 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int);
      |                       ~~~~~~~~~~~~~~^~~~~

Change the type back to what the function definition uses.

Link: https://lore.kernel.org/r/20210322164702.957810-1-arnd@kernel.org
Fixes: fdd78027fd47 ("[SCSI] fcoe: cleans up libfcoe.h and adds fcoe.h for fcoe module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: lpfc: Fix gcc -Wstringop-overread warning
Arnd Bergmann [Mon, 22 Mar 2021 16:02:47 +0000 (17:02 +0100)]
scsi: lpfc: Fix gcc -Wstringop-overread warning

gcc-11 warns about an strnlen with a length larger than the size of the
passed buffer:

drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_nvme_info_show':
drivers/scsi/lpfc/lpfc_attr.c:518:25: error: 'strnlen' specified bound 4095 exceeds source size 24 [-Werror=stringop-overread]
  518 |                         strnlen(LPFC_NVME_INFO_MORE_STR, PAGE_SIZE - 1)
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this case, the code is entirely valid, as the string is properly
terminated, and the size argument is only there out of extra caution in
case it exceeds a page.

This cannot really happen here, so just simplify it to a sizeof().

Link: https://lore.kernel.org/r/20210322160253.4032422-10-arnd@kernel.org
Fixes: afff0d2321ea ("scsi: lpfc: Add Buffer overflow check, when nvme_info larger than PAGE_SIZE")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: mvsas: Avoid -Wempty-body warning
Arnd Bergmann [Mon, 22 Mar 2021 10:33:09 +0000 (11:33 +0100)]
scsi: mvsas: Avoid -Wempty-body warning

Building with 'make W=1' shows a few harmless -Wempty-body warning for the
mvsas driver:

drivers/scsi/mvsas/mv_94xx.c: In function 'mvs_94xx_phy_reset':
drivers/scsi/mvsas/mv_94xx.c:278:63: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  278 |                         mv_dprintk("phy hard reset failed.\n");
      |                                                               ^
drivers/scsi/mvsas/mv_sas.c: In function 'mvs_task_prep':
drivers/scsi/mvsas/mv_sas.c:723:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
  723 |                                 SAS_ADDR(dev->sas_addr));
      |                                                         ^

Change the empty dprintk() macros to no_printk(), which avoids this warning
and adds format string checking.

Link: https://lore.kernel.org/r/20210322103316.620694-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: message: fusion: Avoid -Wempty-body warnings
Arnd Bergmann [Mon, 22 Mar 2021 10:25:44 +0000 (11:25 +0100)]
scsi: message: fusion: Avoid -Wempty-body warnings

There are a couple of warnings in this driver when building with W=1:

drivers/message/fusion/mptbase.c: In function 'PrimeIocFifos':
drivers/message/fusion/mptbase.c:4608:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 4608 |                     "restoring 64 bit addressing\n", ioc->name));
      |                                                                 ^
drivers/message/fusion/mptbase.c:4633:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 4633 |                     "restoring 64 bit addressing\n", ioc->name));

The macros are slightly suboptimal since are not proper statements.
Change both versions to the usual "do { ... } while (0)" style to
make them more robust and avoid the warning.

Link: https://lore.kernel.org/r/20210322102549.278661-2-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: aic94xx: Avoid -Wempty-body warning
Arnd Bergmann [Mon, 22 Mar 2021 10:25:43 +0000 (11:25 +0100)]
scsi: aic94xx: Avoid -Wempty-body warning

Building with 'make W=1' shows a harmless -Wempty-body warning:

drivers/scsi/aic94xx/aic94xx_init.c: In function 'asd_free_queues':
drivers/scsi/aic94xx/aic94xx_init.c:858:62: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  858 |                 ASD_DPRINTK("Uh-oh! Pending is not empty!\n");

Change the empty ASD_DPRINTK() macro to no_printk(), which avoids this
warning and adds format string checking.

Link: https://lore.kernel.org/r/20210322102549.278661-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hpsa: Add an assert to prevent __packed reintroduction
Sergei Trofimovich [Tue, 30 Mar 2021 07:19:58 +0000 (08:19 +0100)]
scsi: hpsa: Add an assert to prevent __packed reintroduction

Link: https://lore.kernel.org/r/20210330071958.3788214-3-slyfox@gentoo.org
Fixes: f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried cmds")
CC: linux-ia64@vger.kernel.org
CC: storagedev@microchip.com
CC: linux-scsi@vger.kernel.org
CC: Joe Szczypek <jszczype@redhat.com>
CC: Scott Benesh <scott.benesh@microchip.com>
CC: Scott Teel <scott.teel@microchip.com>
CC: Tomas Henzl <thenzl@redhat.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Don Brace <don.brace@microchip.com>
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Suggested-by: Don Brace <don.brace@microchip.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hpsa: Fix boot on ia64 (atomic_t alignment)
Sergei Trofimovich [Tue, 30 Mar 2021 07:19:57 +0000 (08:19 +0100)]
scsi: hpsa: Fix boot on ia64 (atomic_t alignment)

Boot failure was observed on an HP rx3600 ia64 machine with RAID bus
controller: Hewlett-Packard Company Smart Array P600:

    kernel unaligned access to 0xe000000105dd8b95, ip=0xa000000100b87551
    kernel unaligned access to 0xe000000105dd8e95, ip=0xa000000100b87551
    hpsa 0000:14:01.0: Controller reports max supported commands of 0 Using 16 instead. Ensure that firmware is up to date.
    swapper/0[1]: error during unaligned kernel access

The unaligned access comes from 'struct CommandList' that happens to be
packed. Commit f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for
retried cmds") introduced unexpected padding and unaligned atomic_t from
natural alignment to something else.

This change removes packing annotation from a struct not intended to be
sent to controller as is. This restores natural `atomic_t` alignment.

The change was tested on the same rx3600 machine.

Link: https://lore.kernel.org/r/20210330071958.3788214-2-slyfox@gentoo.org
Fixes: f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried cmds")
CC: linux-ia64@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: storagedev@microchip.com
CC: linux-scsi@vger.kernel.org
CC: Joe Szczypek <jszczype@redhat.com>
CC: Scott Benesh <scott.benesh@microchip.com>
CC: Scott Teel <scott.teel@microchip.com>
CC: Tomas Henzl <thenzl@redhat.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Don Brace <don.brace@microchip.com>
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Suggested-by: Don Brace <don.brace@microchip.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: hpsa: Use __packed on individual structs, not header-wide
Sergei Trofimovich [Tue, 30 Mar 2021 07:19:56 +0000 (08:19 +0100)]
scsi: hpsa: Use __packed on individual structs, not header-wide

The hpsa driver uses data structures which contain a combination of driver
internals and commands sent directly to the hardware. To manage alignment
for the hardware portions the driver used #pragma pack(1).

Commit f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried
cmds") switched an existing variable from int to bool. Due to the pragma an
atomic_t in the same data structure ended up being misaligned and broke
boot on ia64.

Add __packed to every struct and union in the header file. Subsequent
commits will address the actual atomic_t misalignment regression.

The commit is a no-op at least on ia64:
    $ diff -u <(objdump -d -r old.o) <(objdump -d -r new.o)

Link: https://lore.kernel.org/r/20210330071958.3788214-1-slyfox@gentoo.org
Fixes: f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried cmds")
CC: linux-ia64@vger.kernel.org
CC: storagedev@microchip.com
CC: linux-scsi@vger.kernel.org
CC: Joe Szczypek <jszczype@redhat.com>
CC: Scott Benesh <scott.benesh@microchip.com>
CC: Scott Teel <scott.teel@microchip.com>
CC: Tomas Henzl <thenzl@redhat.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Don Brace <don.brace@microchip.com>
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Suggested-by: Don Brace <don.brace@microchip.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: myrs: Make symbols DAC960_{GEM/BA/LP}_privdata static
Shixin Liu [Sat, 27 Mar 2021 07:31:57 +0000 (15:31 +0800)]
scsi: myrs: Make symbols DAC960_{GEM/BA/LP}_privdata static

This symbol is not used outside of myrs.c, so we can mark it static.

Link: https://lore.kernel.org/r/20210327073157.1786772-1-liushixin2@huawei.com
Signed-off-by: Shixin Liu <liushixin2@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: myrb: Make symbols DAC960_{LA/PG/PD/P}_privdata static
Shixin Liu [Sat, 27 Mar 2021 07:31:56 +0000 (15:31 +0800)]
scsi: myrb: Make symbols DAC960_{LA/PG/PD/P}_privdata static

This symbol is not used outside of myrb.c, so we can mark it static.

Link: https://lore.kernel.org/r/20210327073156.1786722-1-liushixin2@huawei.com
Signed-off-by: Shixin Liu <liushixin2@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: advansys: Fix spelling of 'is'
ganjisheng [Fri, 26 Mar 2021 03:04:12 +0000 (11:04 +0800)]
scsi: advansys: Fix spelling of 'is'

s/isi/is/

Link: https://lore.kernel.org/r/20210326030412.1656-1-qiumibaozi_1@163.com
Signed-off-by: ganjisheng <ganjisheng@yulong.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3 years agoscsi: a100u2w: Remove unused variable biosaddr
Colin Ian King [Thu, 25 Mar 2021 17:07:31 +0000 (17:07 +0000)]
scsi: a100u2w: Remove unused variable biosaddr

The variable biosaddr is being assigned a value that is never read, the
variable is redundant and can be safely removed.

Link: https://lore.kernel.org/r/20210325170731.484651-1-colin.king@canonical.com
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>