Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-30 Thread Nicholas A. Bellinger
Hey MNC, On Fri, 2017-05-26 at 22:14 -0500, Mike Christie wrote: > Thanks for the patch. > Btw, after running DATERA's internal longevity and scale tests across ~20 racks on v4.1.y with this patch over the long weekend, there haven't been any additional regressions. > On 05/26/2017 12:32 AM,

[PATCH V2] qla4xxx: Fix a sleep-in-atomic bug

2017-05-30 Thread Jia-Ju Bai
The driver may sleep under a write spin lock, the function call path is: qla4_82xx_wr_32 (acquire the lock) qla4_82xx_crb_win_lock schedule or cpu_relax To fix it, the lock is released before "schedule" and "cpu_relax", and the lock is acquired again after "schedule" and "cpu_relax".

[PATCH] iscsi: Fix a sleep-in-atomic bug

2017-05-30 Thread Jia-Ju Bai
The driver may sleep under a spin lock, and the function call path is: iscsit_tpg_enable_portal_group (acquire the lock by spin_lock) iscsi_update_param_value kstrdup(GFP_KERNEL) --> may sleep To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC". Signed-off-by: Jia-Ju Bai

Re: [PATCH] [PATCH] qla4xxx: Fix a sleep-in-atomic bug

2017-05-30 Thread kbuild test robot
Hi Jia-Ju, [auto build test ERROR on scsi/for-next] [also build test ERROR on v4.12-rc3 next-20170530] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Jia-Ju-Bai/qla4xxx-Fix-a-sleep-in-atomic

[PATCH] megaraid: Fix a sleep-in-atomic bug

2017-05-30 Thread Jia-Ju Bai
The driver may sleep under a spin lock, and the function call path is: mraid_mm_attach_buf (acquire the lock by spin_lock_irqsave) pci_pool_alloc(GFP_KERNEL) --> may sleep To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC". Signed-off-by: Jia-Ju Bai ---

Re: [PATCH v2 3/8] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-30 Thread Ming Lei
On Tue, May 30, 2017 at 03:12:41PM +, Bart Van Assche wrote: > On Sat, 2017-05-27 at 22:21 +0800, Ming Lei wrote: > > --- a/drivers/scsi/scsi_lib.c > > +++ b/drivers/scsi/scsi_lib.c > > @@ -3030,7 +3030,10 @@ scsi_internal_device_unblock(struct scsi_device > > *sdev, > > return

Re: [PATCH v2 3/8] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-30 Thread Ming Lei
On Tue, May 30, 2017 at 12:04:02PM -0700, Eduardo Valentin wrote: > On Sat, May 27, 2017 at 10:21:21PM +0800, Ming Lei wrote: > > blk_mq_unquiesce_queue() is used for unquiescing the > > queue explicitly, so replace blk_mq_start_stopped_hw_queues() > > with it. > > > > Cc:

[PATCH] [PATCH] qla4xxx: Fix a sleep-in-atomic bug

2017-05-30 Thread Jia-Ju Bai
The driver may sleep under a write spin lock, the function call path is: qla4_82xx_wr_32 (acquire the lock) qla4_82xx_crb_win_lock schedule or cpu_relax To fixed it, the lock is released before "schedule" and "cpu_relax", and the lock is acquired again after "schedule" and "cpu_relax".

Re: [PATCH v2 4/5] tcmu: Make dev_config configurable

2017-05-30 Thread kbuild test robot
Hi Bryant, [auto build test ERROR on target/master] [also build test ERROR on v4.12-rc3 next-20170530] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Bryant-G-Ly/TCMU-Enable-Reconfiguration

Re: [PATCH v2 3/8] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-30 Thread Eduardo Valentin
On Sat, May 27, 2017 at 10:21:21PM +0800, Ming Lei wrote: > blk_mq_unquiesce_queue() is used for unquiescing the > queue explicitly, so replace blk_mq_start_stopped_hw_queues() > with it. > > Cc: linux-n...@lists.infradead.org > Cc: linux-scsi@vger.kernel.org > Cc: dm-de...@redhat.com >

[PATCH v2 1/5] tcmu: Support emulate_write_cache

2017-05-30 Thread Bryant G. Ly
This will enable the toggling of write_cache in tcmu through targetcli-fb Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH v2 5/5] tcmu: Add Type of reconfig into netlink

2017-05-30 Thread Bryant G. Ly
This patch adds more info about the attribute being changed, so that usersapce can easily figure out what is happening. Signed-off-by: Bryant G. Ly --- drivers/target/target_core_user.c | 27 +-- include/uapi/linux/target_core_user.h | 1

[PATCH v2 0/5] TCMU Enable Reconfiguration Patches

2017-05-30 Thread Bryant G. Ly
This patch consists of adding a netlink to allow for reconfiguration of a device in tcmu. It also changes and adds some attributes that are reconfigurable: write_cache, device size, and device path. Bryant G. Ly (5): tcmu: Support emulate_write_cache tcmu: Add netlink for device

[PATCH v2 2/5] tcmu: Add netlink for device reconfiguration

2017-05-30 Thread Bryant G. Ly
This gives tcmu the ability to handle events that can cause reconfiguration, such as resize, path changes, write_cache, etc... Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 12

[PATCH v2 4/5] tcmu: Make dev_config configurable

2017-05-30 Thread Bryant G. Ly
This allows for userspace to change the device path after it has been created. Thus giving the user the ability to change the path. The use case for this is to allow for virtual optical to have media change. Signed-off-by: Bryant G. Ly ---

[PATCH v2 3/5] tcmu: Make dev_size configurable via userspace

2017-05-30 Thread Bryant G. Ly
Allow tcmu backstores to be able to set the device size after it has been configured via set attribute. Part of support in userspace to support certain backstores changing device size. Signed-off-by: Bryant G. Ly --- drivers/target/target_core_user.c | 59

[PATCH v2 15/17] qla2xxx: Accelerate SCSI BUSY status generation in target mode

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Accelerate generation of SCSI busy to let initiators slow down when target is running low in resources. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c |

[PATCH v2 17/17] qla2xxx: Remove extra register read

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Remove extra register read in each interrupt processing to improve performance. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_iocb.c | 4 +++-

[PATCH v2 12/17] qla2xxx: Add ql2xiniexchg parameter

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Previously, the ql2xexchoffld module parameter was used to control the max number of exchanges to be offload onto host memory. Module parameter ql_dm_tgt_ex_pct was used to control the percentage of exchanges allocated to the Target side. With this

[PATCH v2 10/17] qla2xxx: Cleanup debug message IDs

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Assign unique id to all traces and logs for debug purpose. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 2 +- drivers/scsi/qla2xxx/qla_bsg.c|

[PATCH v2 11/17] qla2xxx: Turn on FW option for exchange check

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Tell FW to track exchange/cmd state to prevent driver from using stale exchange or exchange that is not meant for this command. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani ---

[PATCH v2 14/17] qla2xxx: Remove redundant wait when target is stopped.

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Current code already destroy all target sessions when target Mode is stopped. Target core would waits for all commands that belong to each session to purge. The extra wait for interrupts to settle down is not relevant. Signed-off-by: Quinn Tran

[PATCH v2 13/17] qla2xxx: Remove redundant code

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran During ABTS or Abort task, qla2xxx does a pre-search for the se_cmd, based on command's tag. The same search is performed by TCM. Remove the extra search from qla2xxx. The reason for hard coding LUN ID to 0 is that, from the FC protocol perspective, ABTS

[PATCH v2 16/17] qla2xxx: Remove unused irq_cmd_count field.

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran When driver is unloaded, all sessions are torn down, all commmands are flushed, chip is reset to ensure there is no knowledge of target mode in ISP. The irq_cmd_count field was used to make sure all commands are processed on top of that. The irq_cmd_count

[PATCH v2 05/17] qla2xxx: Fix path recovery

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran If the port is moved/changed, current code would trigger a deletion. If the port is already deleted, then do relogin. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani ---

[PATCH v2 07/17] qla2xxx: Use flag PFLG_DISCONNECTED.

2017-05-30 Thread Himanshu Madhani
From: Sawan Chandak There is already flag defined PFLG_DISCONNECTED, which is set for PCI or register disconnect error condition. There is no need to have flag PCI_ERR, which has same purpose. Remove use of PCI_ERR flag and use PFLG_DISCONNECTED flag during error

[PATCH v2 02/17] qla2xxx: Replace usage of spin_lock with spin_lock_irqsave

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Convert usage of spin_lock to spin_lock_irqsave because qla2xxx driver accesses all the data structures in an interrupt context. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani ---

[PATCH v2 00/17] qla2xxx: Cleanup and minor fixes

2017-05-30 Thread Himanshu Madhani
Hi Martin, This series contains patches that were dropped from 4.12.0-rc3 inclusion, since they can go to 4.13 merge window. Changes from v1 --> v2 o addressed 0-day kernel warning. o addressed cleanups and updates as per Bart's comments. o added Acked-by tag from Nicholas to applicable patches.

[PATCH v2 09/17] qla2xxx: Fix name server relogin

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Name server login is normally handle by FW. In some rare case where one of the switches is being updated, name server login could get affected. Trigger relogin to name server when driver detects this condition. Signed-off-by: Quinn Tran

[PATCH v2 03/17] qla2xxx: Retain loop test for fwdump length exceeding buffer length

2017-05-30 Thread Himanshu Madhani
From: Joe Carnuccio Signed-off-by: Joe Carnuccio Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 8 drivers/scsi/qla2xxx/qla_tmpl.c | 16 +--- 2 files changed, 13

[PATCH v2 06/17] tcm_qla2xxx: Do not allow aborted cmd to advance.

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran In case of hardware queue full, commands can loop between TCM stack and tcm_qla2xx shim layers for retry. While command is waiting for retry, task mgmt can get ahead and abort the cmmand that encountered queue full condition. Fix this by dropping the

[PATCH v2 01/17] qla2xxx: Allow ABTS RX, RIDA on ATIOQ for ISP83XX/27XX

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Driver added mechanism to move ABTS/PUREX/RIDA mailbox to ATIO queue as part of commit id 41dc529a4602ac737020f423f84686a81de38e6d ("qla2xxx: Improve RSCN handling in driver"). This patch addes a check to only allow ABTS/PURX/RIDA to be moved to ATIO

[PATCH v2 08/17] qla2xxx: Convert 32-bit LUN usage to 64-bit

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Acked-by: Nicholas Bellinger Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 32 +++-

[PATCH v2 04/17] qla2xxx: Include Exchange offload/Extended Login into FW dump

2017-05-30 Thread Himanshu Madhani
From: Quinn Tran Add missing memory dump of Exchange Offload and Extended login into FW dump. Cc: Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_dbg.c

[PATCH 2/3] libfc: only restart discovery after timeout if not already running

2017-05-30 Thread Hannes Reinecke
If a discovery is already running (ie if the 'pending' flags is set) there is no need to restart discovery from the timeout handler. Signed-off-by: Hannes Reinecke --- drivers/scsi/libfc/fc_disc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH 3/3] libfc: fixup locking in fc_disc_stop()

2017-05-30 Thread Hannes Reinecke
fc_disc_stop() calls fc_disc_stop_rports(), which requires the disc_mutex to be held. And we need to ensure that no fc_disc_timeout functions are queued after this function, so set the callback to NULL and ensure that all functions terminate early when the callback is not set. Signed-off-by:

[PATCH 1/3] libfc: move 'pending' and 'requested' setting

2017-05-30 Thread Hannes Reinecke
Move 'pending' and 'requested' setting out of fc_disc_gpn_fc_req() into the calling function. No functional change. Signed-off-by: Hannes Reinecke --- drivers/scsi/libfc/fc_disc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH 0/3] libfc: fix potential timer list corruption

2017-05-30 Thread Hannes Reinecke
Hi all, we've seen reports for a crash with an invalid timer_list->function, which turned out to be an unsafe usage of libfc discovery callbacks. This patchset fixes up the problem As usual, comments and reviews are welcome. Hannes Reinecke (3): libfc: move 'pending' and 'requested' setting

Re: [PATCH v2 3/8] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-30 Thread Bart Van Assche
On Sat, 2017-05-27 at 22:21 +0800, Ming Lei wrote: > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -3030,7 +3030,10 @@ scsi_internal_device_unblock(struct scsi_device *sdev, > return -EINVAL; > > if (q->mq_ops) { > -