[PATCH v2] scsi: sd: Make protection lookup tables static and relocate functions

2019-01-08 Thread John Garry
Currently the protection lookup tables in sd_prot_flag_mask() and sd_prot_op() are declared as non-static. As such, they will be rebuilt for each respective function call. Optimise by making them static. This saves ~100B object code for sd.c: Before: textdata bss dec hex filen

[PATCH AUTOSEL 4.20 109/117] scsi: megaraid: fix out-of-bound array accesses

2019-01-08 Thread Sasha Levin
From: Qian Cai [ Upstream commit c7a082e4242fd8cd21a441071e622f87c16bdacc ] UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.4

[PATCH AUTOSEL 4.19 87/97] scsi: mpt3sas: fix memory ordering on 64bit writes

2019-01-08 Thread Sasha Levin
From: Stephan Günther [ Upstream commit 23c3828aa2f84edec7020c7397a22931e7a879e1 ] With commit 09c2f95ad404 ("scsi: mpt3sas: Swap I/O memory read value back to cpu endianness"), 64bit writes in _base_writeq() were rewritten to use __raw_writeq() instad of writeq(). This introduced a bug apparen

[PATCH AUTOSEL 4.19 88/97] scsi: smartpqi: correct lun reset issues

2019-01-08 Thread Sasha Levin
From: Kevin Barnett [ Upstream commit 2ba55c9851d74eb015a554ef69ddf2ef061d5780 ] Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root

[PATCH AUTOSEL 3.18 08/19] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.4 25/28] scsi: megaraid: fix out-of-bound array accesses

2019-01-08 Thread Sasha Levin
From: Qian Cai [ Upstream commit c7a082e4242fd8cd21a441071e622f87c16bdacc ] UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.4

[PATCH AUTOSEL 4.4 13/28] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.9 32/36] scsi: smartpqi: correct lun reset issues

2019-01-08 Thread Sasha Levin
From: Kevin Barnett [ Upstream commit 2ba55c9851d74eb015a554ef69ddf2ef061d5780 ] Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root

[PATCH AUTOSEL 4.9 33/36] scsi: megaraid: fix out-of-bound array accesses

2019-01-08 Thread Sasha Levin
From: Qian Cai [ Upstream commit c7a082e4242fd8cd21a441071e622f87c16bdacc ] UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.4

[PATCH AUTOSEL 4.9 18/36] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.14 48/53] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()

2019-01-08 Thread Sasha Levin
From: Yanjiang Jin [ Upstream commit e57b2945aa654e48f85a41e8917793c64ecb9de8 ] We must free all irqs during shutdown, else kexec's 2nd kernel would hang in pqi_wait_for_completion_io() as below: Call trace: pqi_wait_for_completion_io pqi_submit_raid_request_synchronous.constprop.78+0x23c/0x

[PATCH AUTOSEL 4.14 47/53] scsi: smartpqi: correct lun reset issues

2019-01-08 Thread Sasha Levin
From: Kevin Barnett [ Upstream commit 2ba55c9851d74eb015a554ef69ddf2ef061d5780 ] Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root

[PATCH AUTOSEL 4.14 49/53] scsi: megaraid: fix out-of-bound array accesses

2019-01-08 Thread Sasha Levin
From: Qian Cai [ Upstream commit c7a082e4242fd8cd21a441071e622f87c16bdacc ] UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.4

[PATCH AUTOSEL 4.14 25/53] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.19 90/97] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()

2019-01-08 Thread Sasha Levin
From: Yanjiang Jin [ Upstream commit e57b2945aa654e48f85a41e8917793c64ecb9de8 ] We must free all irqs during shutdown, else kexec's 2nd kernel would hang in pqi_wait_for_completion_io() as below: Call trace: pqi_wait_for_completion_io pqi_submit_raid_request_synchronous.constprop.78+0x23c/0x

[PATCH AUTOSEL 4.19 91/97] scsi: megaraid: fix out-of-bound array accesses

2019-01-08 Thread Sasha Levin
From: Qian Cai [ Upstream commit c7a082e4242fd8cd21a441071e622f87c16bdacc ] UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.4

[PATCH AUTOSEL 4.19 47/97] scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough

2019-01-08 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit ad669505c4e9db9af9faeb5c51aa399326a80d91 ] A session must only be released after all code that accesses the session structure has finished. Make sure that this is the case by introducing a new command counter per session that is only decremented after the

[PATCH AUTOSEL 4.19 46/97] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.19 29/97] scsi: qedi: Check for session online before getting iSCSI TLV data.

2019-01-08 Thread Sasha Levin
From: Manish Rangankar [ Upstream commit d5632b11f0a17efa6356311e535ae135d178438d ] The kernel panic was observed after switch side perturbation, BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] strcmp+0x20/0x40 PGD 0 Oops: [#1] SMP CPU: 8 PID: 647 Comm: kwo

[PATCH AUTOSEL 4.20 104/117] scsi: smartpqi: correct lun reset issues

2019-01-08 Thread Sasha Levin
From: Kevin Barnett [ Upstream commit 2ba55c9851d74eb015a554ef69ddf2ef061d5780 ] Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root

[PATCH AUTOSEL 4.20 106/117] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()

2019-01-08 Thread Sasha Levin
From: Yanjiang Jin [ Upstream commit e57b2945aa654e48f85a41e8917793c64ecb9de8 ] We must free all irqs during shutdown, else kexec's 2nd kernel would hang in pqi_wait_for_completion_io() as below: Call trace: pqi_wait_for_completion_io pqi_submit_raid_request_synchronous.constprop.78+0x23c/0x

[PATCH AUTOSEL 4.20 103/117] scsi: mpt3sas: fix memory ordering on 64bit writes

2019-01-08 Thread Sasha Levin
From: Stephan Günther [ Upstream commit 23c3828aa2f84edec7020c7397a22931e7a879e1 ] With commit 09c2f95ad404 ("scsi: mpt3sas: Swap I/O memory read value back to cpu endianness"), 64bit writes in _base_writeq() were rewritten to use __raw_writeq() instad of writeq(). This introduced a bug apparen

[PATCH AUTOSEL 4.20 059/117] scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough

2019-01-08 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit ad669505c4e9db9af9faeb5c51aa399326a80d91 ] A session must only be released after all code that accesses the session structure has finished. Make sure that this is the case by introducing a new command counter per session that is only decremented after the

[PATCH AUTOSEL 4.20 058/117] scsi: target: use consistent left-aligned ASCII INQUIRY data

2019-01-08 Thread Sasha Levin
From: David Disseldorp [ Upstream commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b ] spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null

[PATCH AUTOSEL 4.20 037/117] scsi: qedi: Check for session online before getting iSCSI TLV data.

2019-01-08 Thread Sasha Levin
From: Manish Rangankar [ Upstream commit d5632b11f0a17efa6356311e535ae135d178438d ] The kernel panic was observed after switch side perturbation, BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] strcmp+0x20/0x40 PGD 0 Oops: [#1] SMP CPU: 8 PID: 647 Comm: kwo

[PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-08 Thread Logan Gunthorpe
scsi_mq_setup_tags(), which is called by scsi_add_host(), calculates the command size to allocate based on the prot_capabilities. In the isci driver, scsi_host_set_prot() is called after scsi_add_host() so the command size gets calculated to be smaller than it needs to be. Eventually, scsi_mq_init_

RE: [PATCH] hpsa: add module parameter to disable irq affinity

2019-01-08 Thread Don.Brace
-Original Message- From: Don Brace - C33706 Sent: Tuesday, December 18, 2018 11:57 AM To: Hannes Reinecke ; Don Brace ; Kevin Barnett - C33748 ; Scott Teel - C33730 ; Justin Lindley - C33718 ; Scott Benesh - C33703 ; bader.alisa...@microchip.com; Gerry Morong - C33720 ; Mahesh Rajashe

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-08 Thread Jeff Moyer
Logan Gunthorpe writes: > scsi_mq_setup_tags(), which is called by scsi_add_host(), calculates > the command size to allocate based on the prot_capabilities. In the > isci driver, scsi_host_set_prot() is called after scsi_add_host() > so the command size gets calculated to be smaller than it need

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-08 Thread Jens Axboe
On 1/8/19 1:50 PM, Logan Gunthorpe wrote: > scsi_mq_setup_tags(), which is called by scsi_add_host(), calculates > the command size to allocate based on the prot_capabilities. In the > isci driver, scsi_host_set_prot() is called after scsi_add_host() > so the command size gets calculated to be smal

Re: [PATCH v2] scsi: sd: Make protection lookup tables static and relocate functions

2019-01-08 Thread Bart Van Assche
On 1/8/19 7:14 AM, John Garry wrote: Currently the protection lookup tables in sd_prot_flag_mask() and sd_prot_op() are declared as non-static. As such, they will be rebuilt for each respective function call. Optimise by making them static. This saves ~100B object code for sd.c: Before: te

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-08 Thread Martin K. Petersen
Logan, > To prevent this, the calls to scsi_host_set_prot() are moved into > isci_host_alloc() before the call to scsi_add_host(). Out of caution, > also move the similar call to scsi_host_set_guard(). Applied to 5.0/scsi-fixes. Thanks much! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v2] scsi: sd: Make protection lookup tables static and relocate functions

2019-01-08 Thread Martin K. Petersen
John, > Currently the protection lookup tables in sd_prot_flag_mask() and > sd_prot_op() are declared as non-static. As such, they will be rebuilt > for each respective function call. > > Optimise by making them static. Applied to 5.1/scsi-queue, thank you! -- Martin K. Petersen Oracle L

Re: [PATCH] scsi: bnx2i: fix indentation issue, remove a tab

2019-01-08 Thread Martin K. Petersen
Colin, > The return statement is indented incorrectly, fix this by removing a > single tab. Applied to 5.1/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

[PATCH v2] scsi: avoid a double-fetch and a redundant copy

2019-01-08 Thread Kangjie Lu
What we need is only "pack_id", so do not create a heap object or copy the whole object in. The fix efficiently copies "pack_id" only and also avoids double-fetch. Signed-off-by: Kangjie Lu --- drivers/scsi/sg.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/dr