[PATCH v3] blk-mq: Fix failed allocation path when mapping queues

2016-12-14 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi In blk_mq_map_swqueue, there is a memory optimization that frees the tags of a queue that has gone unmapped. Later, if that hctx is remapped after another topology change, the tags need to be reallocated. If this allocation fails, a simple WARN_ON triggers, but

[PATCH RESEND v2 2/2] blk-mq: Avoid memory reclaim when remapping queues

2016-12-06 Thread Gabriel Krisman Bertazi
0f0160bcf0] [c030fe6c] __vfs_write+0x6c/0x1e0 [c00f0160bd90] [c0311490] vfs_write+0xd0/0x270 [c00f0160bde0] [c03131fc] SyS_write+0x6c/0x110 [c00f0160be30] [c0009204] system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: Douglas

[PATCH RESEND v2 1/2] blk-mq: Fix failed allocation path when mapping queues

2016-12-06 Thread Gabriel Krisman Bertazi
sync_range+0x78/0x130 [c00fe99ebad0] c03dd46c ext4_file_write_iter+0x35c/0x430 [c00fe99ebb90] c038c280 aio_run_iocb+0x3b0/0x450 [c00fe99ebce0] c038dc28 do_io_submit+0x368/0x730 [c00fe99ebe30] c0009404 system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertaz

Re: [PATCH v2 1/2] blk-mq: Fix failed allocation path when mapping queues

2016-12-01 Thread Gabriel Krisman Bertazi
Gabriel Krisman Bertazi writes: > My one concern about this patch is if remapping an arbitrary queue to > hctx_0 could result in outstanding requests getting submitted to the > wrong hctx. I couldn't observe this happening during tests, but I'm not > entirely sure it'

[PATCH v2 1/2] blk-mq: Fix failed allocation path when mapping queues

2016-11-22 Thread Gabriel Krisman Bertazi
n_iocb+0x3b0/0x450 [c00fe99ebce0] c038dc28 do_io_submit+0x368/0x730 [c00fe99ebe30] c0009404 system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: Douglas Miller Cc: linux-bl...@vger.kernel.org Cc: linux-scsi@vger.kernel.org --- block/blk-mq.c | 21 +

[PATCH v2 2/2] blk-mq: Avoid memory reclaim when remapping queues

2016-11-22 Thread Gabriel Krisman Bertazi
0f0160bcf0] [c030fe6c] __vfs_write+0x6c/0x1e0 [c00f0160bd90] [c0311490] vfs_write+0xd0/0x270 [c00f0160bde0] [c03131fc] SyS_write+0x6c/0x110 [c00f0160be30] [c0009204] system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: Douglas

Re: [PATCH 2/2] blk-mq: Avoid memory reclaim when remapping queues

2016-11-16 Thread Gabriel Krisman Bertazi
that aren't restricted in GFP_NOIO. For some reason, I assumed this was an issue. I'm ok with the change and can submit a v2 shortly, after more tests. in fact, this will make the change more compliant with the rest of block layer critical allocations that use GFP_NOIO. Thanks, -- Ga

[PATCH 1/2] blk-mq: Fix failed allocation path when mapping queues

2016-11-14 Thread Gabriel Krisman Bertazi
n_iocb+0x3b0/0x450 [c00fe99ebce0] c038dc28 do_io_submit+0x368/0x730 [c00fe99ebe30] c0009404 system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: Douglas Miller Cc: linux-bl...@vger.kernel.org Cc: linux-scsi@vger.kernel.org --- block/blk-mq.c | 21 +

[PATCH 2/2] blk-mq: Avoid memory reclaim when remapping queues

2016-11-14 Thread Gabriel Krisman Bertazi
0x6c/0x1e0 [c00f0160bd90] [c0311490] vfs_write+0xd0/0x270 [c00f0160bde0] [c03131fc] SyS_write+0x6c/0x110 [c00f0160be30] [c0009204] system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: Douglas Miller Cc: linux-bl...@vger.kernel.org Cc:

[PATCH v3 1/2] scsi: Handle Unit Attention when issuing SCSI command

2016-10-23 Thread Gabriel Krisman Bertazi
age 0x802 scsi 1:0:7:0: Failed to bind enclosure -19 Link: https://patchwork.kernel.org/patch/9336763/ Suggested-by: Brian King Suggested-by: James Bottomley Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/scsi_lib.c | 24 1 file changed, 24 insertions(+)

[PATCH v3 2/2] scsi: sr: Drop custom handling of unit attention

2016-10-23 Thread Gabriel Krisman Bertazi
These custom handling are no longer necessary, since we always retry UA in scsi_execute now. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/scsi_lib.c | 21 ++--- drivers/scsi/sr_ioctl.c | 6 ++ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a

Re: [PATCH v2 1/2] scsi: Handle Unit Attention when issuing SCSI command

2016-10-17 Thread Gabriel Krisman Bertazi
James Bottomley writes: > On Thu, 2016-10-13 at 15:47 -0300, Gabriel Krisman Bertazi wrote: >> @@ -210,6 +219,13 @@ int scsi_execute(struct scsi_device *sdev, const >> unsigned char *cmd, >> */ >> blk_execute_rq(req->q, NULL, req, 1); >> >>

[PATCH RFC 2/2] blk-mq: Avoid memory reclaim when remapping queues

2016-10-13 Thread Gabriel Krisman Bertazi
0x6c/0x1e0 [c00f0160bd90] [c0311490] vfs_write+0xd0/0x270 [c00f0160bde0] [c03131fc] SyS_write+0x6c/0x110 [c00f0160be30] [c0009204] system_call+0x38/0xec Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: linux-bl...@vger.kernel.org Cc: linux-scsi@vger.kernel.org ---

[PATCH v2 2/2] scsi: sr: Drop custom handling of unit attention

2016-10-13 Thread Gabriel Krisman Bertazi
These custom handling are no longer necessary, since we always retry UA in scsi_execute now. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/scsi_lib.c | 21 ++--- drivers/scsi/sr_ioctl.c | 6 ++ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a

[PATCH v2 1/2] scsi: Handle Unit Attention when issuing SCSI command

2016-10-13 Thread Gabriel Krisman Bertazi
7:0: Failed to get diagnostic page 0x802 scsi 1:0:7:0: Failed to bind enclosure -19 Link: https://patchwork.kernel.org/patch/9336763/ Suggested-by: Brian King Suggested-by: James Bottomley Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/scsi_lib.c| 27 --

[PATCH 2/2] sr: Drop custom handling of unit attention

2016-10-11 Thread Gabriel Krisman Bertazi
This is no longer necessary, since we handle it in scsi_execute. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/sr_ioctl.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index 03054c0e7689..f7724e52fd0f 100644

[PATCH 1/2] scsi: Handle Unit Attention when issuing SCSI command

2016-10-11 Thread Gabriel Krisman Bertazi
36763/ Suggested-by: Brian King Suggested-by: James Bottomley Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/scsi_lib.c| 47 +- include/scsi/scsi_common.h | 9 + 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/drivers

Re: [PATCH 5/6] genwqe: use pci_irq_allocate_vectors

2016-09-29 Thread Gabriel Krisman Bertazi
Christoph Hellwig writes: > On Thu, Sep 29, 2016 at 03:45:29PM -0300, Gabriel Krisman Bertazi wrote: >> I'm stepping up to assist with the genwqe_card driver just now, since we >> (ibm) missed some of the last patches that went in. I'll add myself to >> maintainer

Re: [PATCH 5/6] genwqe: use pci_irq_allocate_vectors

2016-09-29 Thread Gabriel Krisman Bertazi
Christoph Hellwig writes: > On Thu, Sep 29, 2016 at 03:28:02PM -0300, Gabriel Krisman Bertazi wrote: >> Christoph Hellwig writes: >> >> > Simply the interrupt setup by using the new PCI layer helpers. >> >> Good clean up. Tested and: >> >> A

Re: [PATCH 5/6] genwqe: use pci_irq_allocate_vectors

2016-09-29 Thread Gabriel Krisman Bertazi
Christoph Hellwig writes: > Simply the interrupt setup by using the new PCI layer helpers. Good clean up. Tested and: Acked-by: Gabriel Krisman Bertazi > One odd thing about this driver is that it looks like it could request > multiple MSI vectors, but it will then only ever use

Re: [PATCH 1/2] ipr: Don't log unnecessary 9084 error details

2016-09-16 Thread Gabriel Krisman Bertazi
th > useless data. > Thanks, Brian. Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] ipr: Remove redundant messages at adapter init time

2016-09-16 Thread Gabriel Krisman Bertazi
pters, which > serves little purpose. Change to just log this once. Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [RESEND] [PATCH 1/1] ses: Retry UNIT ATTENTION for receive diagnostics

2016-09-16 Thread Gabriel Krisman Bertazi
19 > > Fix this by eating unit attentions for these commands. Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: Oops when completing request on the wrong queue

2016-08-29 Thread Gabriel Krisman Bertazi
blk_mq_hctx_next_cpu from scheduling dead cpus in the first place, right.. How do you feel about the following RFC? I know it's not a complete fix, but it feels like a good improvement to me. http://www.spinics.net/lists/linux-scsi/msg98608.html -- Gabriel Krisman Bertazi -- To

Re: [PATCHv2] ipr: Add asynchronous error notification

2016-08-25 Thread Gabriel Krisman Bertazi
Brian King writes: > Looks pretty good. I noticed one issue in an error path where you > weren't removing the new sysfs file. Here is a fixed version. > The modifications look good to me. -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubsc

Re: Oops when completing request on the wrong queue

2016-08-23 Thread Gabriel Krisman Bertazi
Gabriel Krisman Bertazi writes: >> Can you share what you ran to online/offline CPUs? I can't reproduce >> this here. > > I was using the ppc64_cpu tool, which shouldn't do nothing more than > write to sysfs. but I just reproduced it with the script below. &g

Re: Oops when completing request on the wrong queue

2016-08-19 Thread Gabriel Krisman Bertazi
in $(seq 1 ${MAXCPUS}); do if (($i%8)); then echo $STATE > /sys/devices/system/cpu/cpu$i/online fi done if [[ $STATE -eq 1 ]]; then STATE=0 else STATE=1 fi done -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line

Re: Oops when completing request on the wrong queue

2016-08-19 Thread Gabriel Krisman Bertazi
Gabriel Krisman Bertazi writes: > We, IBM, have been experiencing eventual Oops when stressing IO at the > same time we add/remove processors. The Oops happens in the IRQ path, > when we try to complete a request that was apparently meant for another > queue. > > In __nv

Re: [RFC PATCH] blk-mq: Prevent round-robin from scheduling dead cpus

2016-08-12 Thread Gabriel Krisman Bertazi
Gabriel Krisman Bertazi writes: > Hi, > > I'm not completely sure I got the cause for this one completely right. > Still, it does looks like the correct fix and a good improvement in the > overall, so I'm making it an RFC for now to gather some feedback. > > L

[RFC PATCH] blk-mq: Prevent round-robin from scheduling dead cpus

2016-08-02 Thread Gabriel Krisman Bertazi
But this fixes the common case, which is the remaining batch processing time of a sudden dead cpu, which makes the issue much more unlikely to happen. Signed-off-by: Gabriel Krisman Bertazi Cc: Brian King Cc: linux-bl...@vger.kernel.org Cc: linux-scsi@vger.kernel.org --- block/blk-mq.c | 6

Re: [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized

2016-07-26 Thread Gabriel Krisman Bertazi
Brian King writes: > When performing an async scan, make sure the kthread doing scanning > doesn't start before the scsi host is fully initialized. > Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH 2/3] ipr: Increase MSIX vectors number

2016-07-12 Thread Gabriel Krisman Bertazi
wenxi...@linux.vnet.ibm.com writes: > From: Wen Xiong > > Increase MSIX vectors from 2 to 16 by default. > > Signed-off-by: Wen Xiong > --- Reviewed-by: Gabriel Krisman Bertazi Thanks, -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "uns

Re: [PATCH 1/3] ipr: Add new CCIN for new adapters support

2016-07-12 Thread Gabriel Krisman Bertazi
wenxi...@linux.vnet.ibm.com writes: > From: Wen Xiong > > Add the appropriate definitions and table entries for new > adapters support. > > Signed-off-by: Wen Xiong Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the

[PATCH] ipr: Fix regression when loading firmware

2016-02-25 Thread Gabriel Krisman Bertazi
ch re-adds that handling, so both a write terminated by a line feed or not can make it through with the update. Fixes: d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") Signed-off-by: Gabriel Krisman Bertazi Cc: Insu Yun --- drivers/scsi/ipr.c | 5 + 1 file changed, 5 inserti

[PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.

2015-11-03 Thread Gabriel Krisman Bertazi
0x0 shows support for Page 0xC4. Otherwise, assume Sync IOA Write Cache is not supported. Changes since v1: - Fix checkpatch.pl warnings. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 35 ++- drivers/scsi/ipr.h | 11 +++ 2 files c

[PATCH v2 5/5] ipr: Driver version 2.6.3.

2015-11-03 Thread Gabriel Krisman Bertazi
Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index b16bcd1..a34c7a5 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -39,8 +39,8 @@ /* * Literals

[PATCH v2 1/5] ipr: Add delay to ensure coherent dumps.

2015-11-03 Thread Gabriel Krisman Bertazi
imeout, we still force the dump, since a partial dump still might be useful. Changes since v1: - Fix checkpatch.pl warnings. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 51 +++ drivers/scsi/ipr.h | 3 +++ 2 files c

[PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.

2015-11-03 Thread Gabriel Krisman Bertazi
Some new adapters require a special Configure Cache Parameters command to enable the adapter write cache, so send this during the adapter initialization if the adapter requires it. Changes since v1: - Fix checkpatch.pl warnings. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi

[PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.

2015-11-03 Thread Gabriel Krisman Bertazi
gsci exclusive stuff in a separate block. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 238efab..6849b7f 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi

[PATCH] sd: Clear PS bit before Mode Select.

2015-10-30 Thread Gabriel Krisman Bertazi
subsequently reverted, but this changes sd.c to be more compliant with SPC-4. This patch clears the PS bit in the buffer returned by Mode Select, right before it is used in the Mode Select command. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion

[PATCH 1/5] ipr: Add delay to ensure coherent dumps.

2015-10-30 Thread Gabriel Krisman Bertazi
imeout, we still force the dump, since a partial dump still might be useful. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 51 +++ drivers/scsi/ipr.h | 3 +++ 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/dr

[PATCH 2/5] ipr: Clear NO_ULEN_CHK bit when resource is a vset.

2015-10-30 Thread Gabriel Krisman Bertazi
According to the IPR specification, Inhibit Underlength Checking bit must be disabled when sending commands to vsets. Enabling this bit for vset might cause SCSI commands to fail with an Illegal Request. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 2 +- 1 file changed, 1

[PATCH 3/5] ipr: Inquiry IOA page 0xC4 during initialization.

2015-10-30 Thread Gabriel Krisman Bertazi
0x0 shows support for Page 0xC4. Otherwise, assume Sync IOA Write Cache is not supported. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 35 ++- drivers/scsi/ipr.h | 11 +++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/dr

[PATCH 4/5] ipr: Issue Configure Cache Parameters command.

2015-10-30 Thread Gabriel Krisman Bertazi
Some new adapters require a special Configure Cache Parameters command to enable the adapter write cache, so send this during the adapter initialization if the adapter requires it. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 59

[PATCH 5/5] ipr: Driver version 2.6.3.

2015-10-30 Thread Gabriel Krisman Bertazi
Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index aab5c6d..ce49ca9 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -39,8 +39,8 @@ /* * Literals

[PATCH 2/2] ipr: Enable SIS pipe commands for SIS-32 devices.

2015-08-19 Thread Gabriel Krisman Bertazi
Remove unnecessary check that disabled SIS pipe commands for SIS-32 devices. This change was sufficient to enable raw mode and send SIS pipe commands for a 57B3 device. Fixes: f8ee25d7d239 ("ipr: AF DASD raw mode implementation in ipr driver") Signed-off-by: Gabriel Krisman Bertazi --

[PATCH 1/2] ipr: Inhibit underlength data check for AFDASD in raw mode.

2015-08-19 Thread Gabriel Krisman Bertazi
Disable underlength error verification based on count of bytes actually transferred for AF DASD devices when SIS pipe mode is enabled. This avoids unexpected underlength errors when issuing some commands in raw mode. Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 6 +- 1

Re: [PATCH 1/1] ipr: Fix incorrect trace indexing

2015-07-10 Thread Gabriel Krisman Bertazi
Brian King writes: > One more ipr patch to go on top of my previous series I sent. This one fixes > a pretty nasty bug that can cause us to go writing in memory that is not ours. > Please add: Reviewed-by: Gabriel Krisman Bertazi Thanks, -- Gabriel Krisman Bertazi -- To unsubsc

Re: [PATCHv2 1/1] ipr: Fix invalid array indexing for HRRQ

2015-07-10 Thread Gabriel Krisman Bertazi
Brian King writes: > drivers/scsi/ipr.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) Hi Brian, The changes look good to me. Please add Reviewed-by: Gabriel Krisman Bertazi Thanks, -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send th

Re: [PATCH 1/4] ipr: Fix locking for unit attention handling

2015-06-16 Thread Gabriel Krisman Bertazi
e add the tag: Reviewed-by: Gabriel Krisman Bertazi Thanks, -- Gabriel Krisman Bertazi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html