Re: how to "decode" SG_IO: bad/missing sense data?

2015-06-16 Thread Douglas Gilbert
On 15-06-16 01:05 PM, Tom Yan wrote: When I "ATA Secure Erase" a USB Flash Drive, I got: SG_IO: bad/missing sense data, sb[]: f0 00 01 00 50 40 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 While the erase seems to work without bricking the device (multiple tria

[Announce] sg3_utils-1.41 available

2015-07-07 Thread Douglas Gilbert
sg3_utils is a package of command line utilities for sending SCSI and some ATA commands to devices. This package targets the Linux 4, 3, 2.6 and 2.4 kernel series. It has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and MinGW). There is one new utility (sg_zone) and additions to many oth

Re: [PATCH] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip

2015-08-27 Thread Douglas Gilbert
, devip will be NULL for the INQUIRY command for the next LUN above the configured value and it will be retried indefinitely with an error message. Fix this by returning the command in the same context if no devip exists. Signed-off-by: Ewan D. Milne Acked-by: Douglas Gilbert -- To unsubscribe

Re: SG does not ignore dxferp (direct io + mmap)

2016-11-21 Thread Douglas Gilbert
b41e8989b0c2174568d4 Author: Douglas Gilbert Date: Thu Mar 3 00:31:29 2016 -0500 sg: fix dxferp in from_to case However the kernel I used has that change, and the change purposely does not clear hp->dxferp if SG_DXFER_TO_FROM_DEV is specified, which your program does not, and the behavior is c

Re: [PATCH 1/1] [SCSI] Fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeout

2014-07-18 Thread Douglas Gilbert
On 14-07-18 07:41 AM, James Bottomley wrote: On Fri, 2014-07-18 at 17:17 +, Elliott, Robert (Server Storage) wrote: From: James Bottomley [mailto:jbottom...@parallels.com] On Fri, 2014-07-18 at 00:51 +, Elliott, Robert (Server Storage) wrote: ... Also, in both sd_setup_flush_cmnd

Re: Write cache and surface error behaviour

2014-07-28 Thread Douglas Gilbert
On 14-07-28 04:57 PM, Jeremy Linton wrote: On 7/20/2014 4:54 PM, joystick wrote: So what happens when the disk tries to write it to the platter and discovers that there is a media error on that sector? (suppose relocation does not happen ; maybe sectors exhausted) Does Linux receive the write er

[PATCH 0/3] scsi_debug: review fixes for scsi-mq changes

2014-08-05 Thread Douglas Gilbert
2/3: give unit attention and other errors precedence over TSF 3/3: bump inquiry version to SPC-4, update version descriptors Signed-off-by: Douglas Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kerne

[PATCH 1/3] scsi_debug: scsi_cmnd->cmnd check and casts unnecessary

2014-08-05 Thread Douglas Gilbert
This patch removes a NULL check for the scsi_cmnd::cmnd pointer since many other instances in this driver and elsewhere assume it is valid. Also redundant casts to 'unsigned char *' are removed as the pointer has that type. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_de

[PATCH 2/3] scsi_debug: give unit attention and other errors precedence over TSF

2014-08-05 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 67 +++ 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 07d224a..693f2fa 100644 --- a/drivers/scsi/scsi_debug.c

[PATCH 3/3] scsi_debug: bump inquiry version to SPC-4, update version descriptors

2014-08-05 Thread Douglas Gilbert
Since a lot of functionality from SPC-4 is supported by this driver (e.g. LBP and PI) then bump the default INQUIRY version from SPC-3 to SPC-4. Also update the INQUIRY version descriptors. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 14 +++--- 1 file changed, 7

Re: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-06 Thread Douglas Gilbert
On 14-07-29 05:57 PM, bugzilla-dae...@bugzilla.kernel.org wrote: https://bugzilla.kernel.org/show_bug.cgi?id=80711 Alan changed: What|Removed |Added CC|

Re: [RFC PATCH -logging 00/10] scsi/constants: Output continuous error messages on trace

2014-08-08 Thread Douglas Gilbert
On 14-08-08 01:50 PM, Yoshihiro YUNOMAE wrote: Hi All, This patch set introduces new traceevents in order to output continuous error messages. Current SCSI printk messages in upstream kernel can be divided by and mixed with other messages. Even if each error message has its device id, sometimes

Re: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-21 Thread Douglas Gilbert
On 14-08-20 03:15 PM, Alan Stern wrote: On Tue, 19 Aug 2014, Christoph Hellwig wrote: On Thu, Aug 07, 2014 at 11:58:37AM -0400, Alan Stern wrote: On Wed, Aug 06, 2014 at 04:02:22PM -0400, Alan Stern wrote: I doubt either of them forces users to hack up flags for these cases. Why was this ch

Re: [RFC PATCH -logging 00/10] scsi/constants: Output continuous error messages on trace

2014-08-22 Thread Douglas Gilbert
On 14-08-12 11:13 PM, Yoshihiro YUNOMAE wrote: Hi Douglas, Thank you for your comment. (2014/08/08 22:07), Douglas Gilbert wrote: On 14-08-08 01:50 PM, Yoshihiro YUNOMAE wrote: Hi All, This patch set introduces new traceevents in order to output continuous error messages. Current SCSI

Re: [PATCH][SCSI] fix regression in SCSI_IOCTL_SEND_COMMAND

2014-08-22 Thread Douglas Gilbert
) Cc: # 3.16.x Signed-off-by: Tony Battersby Tested-by: Douglas Gilbert For inclusion in 3.17 and 3.16.x. Note: I don't have any programs that use this ioctl, so this patch is compile-tested only. To test this ioctl one option is to get the sg3_utils package and build scsi_ioctl

Re: [PATCH][SCSI] scsi-mq: fix requests that use a separate CDB buffer

2014-08-22 Thread Douglas Gilbert
On 14-08-22 03:53 PM, Tony Battersby wrote: This patch fixes code such as the following with scsi-mq enabled: rq = blk_get_request(...); blk_rq_set_block_pc(rq); rq->cmd = my_cmd_buffer; /* separate CDB buffer */ blk_execute_rq_nowait(...); Code like this appears in e.g. s

Re: [PATCH][SCSI] scsi-mq: fix requests that use a separate CDB buffer

2014-08-22 Thread Douglas Gilbert
On 14-08-22 08:52 PM, Douglas Gilbert wrote: On 14-08-22 03:53 PM, Tony Battersby wrote: This patch fixes code such as the following with scsi-mq enabled: rq = blk_get_request(...); blk_rq_set_block_pc(rq); rq->cmd = my_cmd_buffer; /* separate CDB buf

Re: Debugging scsi abort handling ?

2014-08-23 Thread Douglas Gilbert
On 14-08-23 10:52 AM, Hans de Goede wrote: Hi All, Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives. One if the issues is that there might be a number of bugs in the abort handling path, as I don't think that was ever

Re: Logging of all scsi commands to a certain target?

2014-08-23 Thread Douglas Gilbert
On 14-08-23 10:54 AM, Hans de Goede wrote: Hi, Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives. Some of these seem to be related to the scsi core and/or the sd driver sending a command the device does not like. As s

Re: [PATCH][SCSI] scsi-mq: fix requests that use a separate CDB buffer

2014-08-23 Thread Douglas Gilbert
e.g. sg_start_req() in drivers/scsi/sg.c (for large CDBs only). Without this patch, scsi_mq_prep_fn() will set rq->cmd back to rq->__cmd, causing the wrong CDB to be sent to the device. Signed-off-by: Tony Battersby Tested-by: Douglas Gilbert Patch tested on lk 3.17-rc1 with the sg dri

Re: Buffer I/O error after s2ram with usb storage

2014-08-27 Thread Douglas Gilbert
On 14-08-27 04:40 AM, Matthieu CASTET wrote: Ping I have got also a problem with a usb sdcard reader (without power cut during suspend) [ 1073.606668] PM: Entering mem sleep [ 1073.606742] Suspending console(s) (use no_console_suspend to debug) [ 1073.607146] sd 1:0:0:0: [sda] Synchronizing SCS

Re: [RFC PATCH -logging 00/10] scsi/constants: Output continuous error messages on trace

2014-08-27 Thread Douglas Gilbert
On 14-08-27 10:23 AM, Hannes Reinecke wrote: On 08/08/2014 03:07 PM, Douglas Gilbert wrote: On 14-08-08 01:50 PM, Yoshihiro YUNOMAE wrote: Hi All, This patch set introduces new traceevents in order to output continuous error messages. Current SCSI printk messages in upstream kernel can be

Re: [PATCH 00/22] scsi logging update

2014-08-28 Thread Douglas Gilbert
On 14-08-28 01:33 PM, Hannes Reinecke wrote: Hi all, here's my next round of scsi logging updates. Main feature is the update to have all logging statements in one line so that they won't be broken up even under high load. This will dramatically improve debugging. Additionally all printk() stat

Re: [PATCH 11/22] Implement scsi_opcode_sa_name

2014-08-28 Thread Douglas Gilbert
On 14-08-28 01:33 PM, Hannes Reinecke wrote: Implement a lookup array for SERVICE ACTION commands instead of hardcoding it in a large switch statement. Signed-off-by: Hannes Reinecke --- drivers/scsi/constants.c | 130 +++ 1 file changed, 53 insert

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-30 Thread Douglas Gilbert
On 14-08-30 05:15 PM, Alan Stern wrote: On Fri, 29 Aug 2014, Matthew Dharm wrote: Is there an 'easy' way to override the detected size of a storage device from userspace? If we had that, someone could write a helper application which looked for this particular fubar and try to Do The Right Thi

Re: scsi_debug module deadlock on 3.17-rc2

2014-08-30 Thread Douglas Gilbert
DEV="/dev/"$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)"1" echo "mkfs -t ext4 ${DEV}" mkfs -t ext4 ${DEV} sleep 0.1 rmmod scsi_debug Bisect tracked it to commit commit cbf67842c3d9e7af8ccc031332b79e88d9cca592 Author: Douglas Gilbert

Re: scsi_debug module deadlock on 3.17-rc2

2014-08-31 Thread Douglas Gilbert
On 14-08-31 05:49 AM, Milan Broz wrote: On 08/31/2014 01:14 AM, Douglas Gilbert wrote: On 14-08-30 04:56 PM, Milan Broz wrote: Hi, I am using scsi_debug in cryptsetup testsuite and with recent 3.17-rc kernel it deadlocks on rmmod of scsi_debug module. For me even this simple reproducer

[PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-08-31 Thread Douglas Gilbert
stop_queued_cmnd() which has very similar logic. This patch should be applied both to the lk 3.17 tree and Christoph's drivers-for-3.18 tree. Tested-and-reported-by: Milan Broz Signed-off-by: Douglas Gilbert --- a/drivers/scsi/scsi_debug.c 2014-08-26 13:24:51.646948507 -0400 +++ b/drivers

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-01 Thread Douglas Gilbert
On 14-09-01 11:36 AM, Christoph Hellwig wrote: --- a/drivers/scsi/scsi_debug.c 2014-08-26 13:24:51.646948507 -0400 +++ b/drivers/scsi/scsi_debug.c 2014-08-30 18:04:54.589226679 -0400 @@ -2743,6 +2743,13 @@ static int stop_queued_cmnd(struct scsi_ if (test_bit(k, queued_in_use_bm))

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-05 Thread Douglas Gilbert
mod LLD'. Doug Gilbert On 14-09-05 01:24 AM, Christoph Hellwig wrote: Can I get another review for this one? On Sun, Aug 31, 2014 at 07:09:59PM -0400, Douglas Gilbert wrote: A deadlock has been reported when the completion of SCSI commands (simulated by a timer) was surprised by a module

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-06 Thread Douglas Gilbert
On 14-09-05 11:25 AM, Bart Van Assche wrote: On 09/05/14 15:56, Douglas Gilbert wrote: With scsi-mq I think many LLDs probably have a new race possibility between a surprise rmmod of the LLD and another thread presenting a new command at about the same time (or another thread's co

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-08 Thread Douglas Gilbert
On 14-09-08 11:07 AM, Christoph Hellwig wrote: On Mon, Sep 08, 2014 at 11:11:23AM +0200, Bart Van Assche wrote: Hello Doug, In the scsi_debug driver scsi_remove_host() is called from inside the sdebug_driver_remove() callback function. Unless I have missed something it is not guaranteed that th

lk 3.17-rc4 blk_mq large write problems

2014-09-09 Thread Douglas Gilbert
A few days ago I was trying to create a large file (say 16 GB) of zeros on an ext4 file system: dd if=/dev/zero bs=64k count=256k of=zero_16g.bin After about 5 seconds there was a NULL de-reference that crashed the machine (shown below). This was with a clean version of lk 3.17-rc4 (from kerne

Re: Updated linux uas driver, please test

2014-09-10 Thread Douglas Gilbert
On 14-09-10 08:13 AM, Hans de Goede wrote: Hi All, I'm mailing all of you because you've reported various problems with the new uas support in kernel 3.16 and later. I've been working on making the uas driver more resilient to errors, as well as improved logging so we can easier figure out the

Re: lk 3.17-rc4 blk_mq large write problems

2014-09-10 Thread Douglas Gilbert
On 14-09-10 11:41 AM, Christoph Hellwig wrote: While it might not help with a blown stack, can you give the patch below a try? I tries to solve a problem where the timeout handler hits before we've fully set up a command. While I'd like to understand the root cause of why we're hitting it as we

Re: lk 3.17-rc4 blk_mq large write problems

2014-09-10 Thread Douglas Gilbert
development list Subject: Re: lk 3.17-rc4 blk_mq large write problems On 2014-09-10 18:58, Douglas Gilbert wrote: On 14-09-10 11:41 AM, Christoph Hellwig wrote: While it might not help with a blown stack, can you give the patch below a try? I tries to solve a problem where the timeout handler

Re: two more fixes for block/for-linus

2014-09-22 Thread Douglas Gilbert
way. That SATA disk is connected to the motherboard (Gigabyte Z97M-D3H/Z97M-D3H, BIOS F5 05/30/2014) and has a standard AHCI interface as far as I can tell. dmesg confirms that. Please add "Tested-by: Douglas Gilbert " to Christoph's "two more fixes for block/for-linus&q

Re: lk 3.17-rc4 blk_mq large write problems

2014-09-22 Thread Douglas Gilbert
On 14-09-09 11:55 PM, Douglas Gilbert wrote: A few days ago I was trying to create a large file (say 16 GB) of zeros on an ext4 file system: dd if=/dev/zero bs=64k count=256k of=zero_16g.bin After about 5 seconds there was a NULL de-reference that crashed the machine (shown below). This was

Re: [PATCH 13/38] Implement scsi_opcode_sa_name

2014-09-29 Thread Douglas Gilbert
On 14-09-29 07:58 AM, Hannes Reinecke wrote: Implement a lookup array for SERVICE ACTION commands instead of hardcoding it in a large switch statement. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/constants.c | 132 +++

Re: [PATCH 1/2] sg: fix sparse __user annotation warning

2014-09-30 Thread Douglas Gilbert
On 14-09-30 11:20 AM, Christoph Hellwig wrote: blk_trace_setup takes a __user pointer, so use the local void __user * pointer instead of casting the argument to char * for it in the sg ioctl handler. Signed-off-by: Christoph Hellwig Acked-by: Douglas Gilbert --- drivers/scsi/sg.c | 2

Re: [PATCH] scsi_debug: Error message should say scsi_host_alloc not scsi_register

2014-10-03 Thread Douglas Gilbert
On 14-10-02 09:43 PM, Finn Thain wrote: Signed-off-by: Finn Thain Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/drivers/scsi/scsi_debug.c

[PATCH] sg: fix dxferp in from_to case

2016-03-02 Thread Douglas Gilbert
given. Signed-off-by: Douglas Gilbert diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 5e82067..ae7d9bd 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -652,7 +652,8 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) else hp->dxfer_direct

Re: [PATCH] scsi: vpd pages are mandatory for SPC-2

2016-03-15 Thread Douglas Gilbert
On 16-03-15 08:42 AM, Christoph Hellwig wrote: On Tue, Mar 15, 2016 at 08:28:42AM +0100, Hannes Reinecke wrote: But it feels even sillier having to whitelist every standards-conformant device here; I certainly was when I figured that EMC Clariion won't work properly without this patch. And the

Re: [PATCHv2 3/3] scsi-trace: define ZBC_IN and ZBC_OUT

2016-03-24 Thread Douglas Gilbert
ons from zbc-r05.pdf: CLOSE ZONE 94h/01h FINISH ZONE 94h/02h OPEN ZONE 94h/03h REPORT ZONES 95h/00h RESET WRITE POINTER 94h/04h +#define ZO_FINISH_ZONE 0x03 s/0x03/0x02/ Thereafter: Reviewed-by: Douglas Gilbert +#define ZO_RESET_WRITE_POINT

Re: [Bug 115351] New: redundant pointless messages

2016-03-27 Thread Douglas Gilbert
On 16-03-27 03:48 PM, bugzilla-dae...@bugzilla.kernel.org wrote: https://bugzilla.kernel.org/show_bug.cgi?id=115351 Bug ID: 115351 Summary: redundant pointless messages Product: IO/Storage Version: 2.5 Kernel Version: All Hardware:

Re: [Lsf] LSF/MM Schedule and improving discard support

2016-04-13 Thread Douglas Gilbert
On 16-04-13 01:30 PM, Darrick J. Wong wrote: On Wed, Apr 13, 2016 at 09:51:04AM -0700, James Bottomley wrote: On Wed, 2016-04-13 at 09:29 -0700, Bart Van Assche wrote: On 04/13/2016 09:21 AM, Martin K. Petersen wrote: From a filesystem/ioctl perspective, BLKDISCARD is a hint. We should not be

EXPORT_SYMBOL(scsi_use_blk_mq);

2016-04-16 Thread Douglas Gilbert
Is there a good reason why 'bool scsi_use_blk_mq' declared as extern in scsi_hosts.h is not an exported symbol? That would allow a LLD loaded as a module to access it. Doug Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger

Re: [PATCH] SCSI: LIBSCSI: Fixed codeing style errors

2016-04-20 Thread Douglas Gilbert
On 16-04-20 03:51 AM, Bob Stlt wrote: Fixed codeing style formatting errors. Signed-off-by: Bob Stlt --- drivers/scsi/libiscsi.c | 90 - 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libi

[PATCH 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-25 Thread Douglas Gilbert
Shorten file scope static and constant names. Use more get/put_unaligned calls to hide bit banging. Introduce sdebug_verbose boolean to replace frequent masking of option bit flags. Add GPL and bump version. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 1162

[PATCH 05/12] scsi_debug: replace tasklet with work queue

2016-04-25 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 230 +++--- 1 file changed, 95 insertions(+), 135 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5ad16e6..8ee9df6 100644 --- a/drivers/scsi/scsi_debug.c

[PATCH 04/12] scsi_debug: make jiffy delay name clearer

2016-04-25 Thread Douglas Gilbert
Add 'j' to delay names to make it clearer that its unit is jiffies and to differentiate it from sdebug_ndelay whose unit is nanoseconds. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 46 +++--- 1 file changed, 23 inserti

[PATCH 02/12] scsi_debug: ignore host lock option

2016-04-25 Thread Douglas Gilbert
Remove logic to optionally hold host_lock while each command is queued. Keep module and sysfs host_lock parameters for backward compatibility. Note in module parameter description that host_lock is ignored. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 44

[PATCH 00/12] scsi_debug: multiple queue support and cleanup

2016-04-25 Thread Douglas Gilbert
. Incorporate REPORT LUNS patch from Tomas Winkler sent in Febrary 2015. Add parameter that permits LU names to use UUIDs (spc5r08.pdf). Douglas Gilbert (12): scsi_debug: cleanup naming and bit crunching scsi_debug: ignore host lock option scsi_debug: replace jiffy timers with hr timers

[PATCH 06/12] scsi_debug: re-order file scope declarations

2016-04-25 Thread Douglas Gilbert
Group most defines together first; followed by struct definitions and then table and variable definitions. Normalize all function headers. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 314 ++ 1 file changed, 151 insertions(+), 163

[PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-25 Thread Douglas Gilbert
The most common commands in normal use are the READ and WRITE SCSI commands. Use likely and unlikely hints along the path taken by these commands. Rename check_readiness() to make_ua() and remove associated dead code. Rename devInfoReg() to find_build_dev_info(). Signed-off-by: Douglas Gilbert

[PATCH 11/12] scsi_debug: uuid for lu name

2016-04-25 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to be the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 61

[PATCH 08/12] scsi_debug: rework resp_report_luns

2016-04-25 Thread Douglas Gilbert
allocation allowing up to 16383 LUNs per target. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 138 ++ 1 file changed, 91 insertions(+), 47 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index cf44ab0..eac6

[PATCH 10/12] scsi_debug: vpd and mode page work

2016-04-25 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 167 +++--- 1 file

[PATCH 12/12] scsi_debug: use locally assigned naa

2016-04-25 Thread Douglas Gilbert
Change NAA addresses used for SAS addresses from fake IEEE registered NAA (5) to locally assigned NAA (3). Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/scsi

[PATCH 09/12] scsi_debug: add multiple queue support

2016-04-25 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 662

[PATCH 03/12] scsi_debug: replace jiffy timers with hr timers

2016-04-25 Thread Douglas Gilbert
-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 56 ++- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 42e5c37..9dc0349 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers

Re: [PATCH 08/12] scsi_debug: rework resp_report_luns

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 02:26 AM, Hannes Reinecke wrote: On 04/25/2016 06:16 PM, Douglas Gilbert wrote: Based on "[PATH V2] scsi_debug: rework resp_report_luns" patch sent by Tomas Winkler on Thursday, 26 Feb 2015. His notes: 1. Remove duplicated boundary checks which simplify the fill-in

Re: [PATCH 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 02:13 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: @@ -580,8 +580,8 @@ static int sdebug_sectors_per;/* sectors per cylinder */ static unsigned int scsi_debug_lbp(void) { -return ((0 == scsi_debug_fake_rw) && -(scsi_de

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 06:14 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: -if ((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && -(lba <= (OPT_MEDIUM_ERR_ADDR + OPT_MEDIUM_ERR_NUM - 1)) && -((lba + num) > OPT_MEDIUM_ERR_

[PATCH v2 00/12] scsi_debug: multiple queue support and cleanup

2016-04-29 Thread Douglas Gilbert
both the jiffy and nanosecond delay parameters. Replace the tasklets with work items. Incorporate REPORT LUNS patch from Tomas Winkler sent in Febrary 2015. Add parameter that permits LU names to use UUIDs (spc5r08.pdf). Douglas Gilbert (12): scsi_debug: cleanup naming and bit crunching

[PATCH v2 03/12] scsi_debug: replace jiffy timers with hr timers

2016-04-29 Thread Douglas Gilbert
-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 54 +-- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 40aaaed..c3f3a84 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers

[PATCH v2 05/12] scsi_debug: replace tasklet with work queue

2016-04-29 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 228 +++--- 1 file changed, 95 insertions(+), 133 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2a50e9d..35c1ed3 100644 --- a/drivers/scsi/scsi_debug.c

[PATCH v2 02/12] scsi_debug: ignore host lock option

2016-04-29 Thread Douglas Gilbert
Remove logic to optionally hold host_lock while each command is queued. Keep module and sysfs host_lock parameters for backward compatibility. Note in module parameter description that host_lock is ignored. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 44

[PATCH v2 04/12] scsi_debug: make jiffy delay name clearer

2016-04-29 Thread Douglas Gilbert
Add 'j' to delay names to make it clearer that its unit is jiffies and to differentiate it from sdebug_ndelay whose unit is nanoseconds. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 46 +++--- 1 file changed, 23 inserti

[PATCH v2 06/12] scsi_debug: re-order file scope declarations

2016-04-29 Thread Douglas Gilbert
Group most defines together first; followed by struct definitions and then table and variable definitions. Normalize all function headers. Replace dummy DEV_READONLY(tgt) macro with comment. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 316

[PATCH v2 10/12] scsi_debug: vpd and mode page work

2016-04-29 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 187 ++ 1 file

[PATCH v2 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-29 Thread Douglas Gilbert
Shorten file scope static and constant names. Use more get/put_unaligned calls to hide bit banging. Introduce sdebug_verbose boolean to replace frequent masking of option bit flags. Add GPL and bump version. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 1187

[PATCH v2 09/12] scsi_debug: add multiple queue support

2016-04-29 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 680

[PATCH v2 11/12] scsi_debug: uuid for lu name

2016-04-29 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 61

[PATCH v2 12/12] scsi_debug: use locally assigned naa

2016-04-29 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b

[PATCH v2 07/12] scsi_debug: use likely hints on fast path

2016-04-29 Thread Douglas Gilbert
point of invocation. Introduce bool have_dif_prot to make clear when T10 protection ("dif") is active. Only print host protection summary at driver startup if there is either "dif" or "dix" to report. Signed-off-by: Douglas Gilbert --- d

[PATCH v2 08/12] scsi_debug: rework resp_report_luns

2016-04-29 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 135 +- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 8b2257

Re: [PATCH 00/12] scsi_debug: multiple queue support and cleanup

2016-04-29 Thread Douglas Gilbert
On 2016-04-29 07:53 PM, Martin K. Petersen wrote: "Doug" == Douglas Gilbert writes: Doug> Primary reason for this patch series is to add multi queue support Doug> modelled on the null_blk driver. Ignore host_lock option but keep Doug> parameter for backward compatibility.

[PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-04-30 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 680

[PATCH v2.5 6/6] scsi_debug: use locally assigned naa

2016-04-30 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b

[PATCH v2.5 2/6] scsi_debug: rework resp_report_luns

2016-04-30 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 135 +- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index fc0246

[PATCH v2.5 1/6] scsi_debug: use pdt constants

2016-04-30 Thread Douglas Gilbert
Use TYPE_* constants for SCSI peripheral device types instead of numbers. Further cleanups requested by checkpatch.pl . Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 86 +-- 1 file changed, 45 insertions(+), 41 deletions(-) diff

[PATCH v2.5 4/6] scsi_debug: vpd and mode page work

2016-04-30 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 187 ++ 1 file

[PATCH v2.5 0/6] scsi_debug: rebase second half of series

2016-04-30 Thread Douglas Gilbert
this series (1 through 7) have already been applied to the maintainers' trees. That differed slightly from my v2 series (after 7/12 was applied). So 1/6 of this series is a resync and the next 5 patches in this series correspond to v2 8/12 through 12/12 (give or take a little fuzz). Douglas Gi

[PATCH v2.5 5/6] scsi_debug: uuid for lu name

2016-04-30 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 61

Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-05-02 Thread Douglas Gilbert
On 2016-05-02 04:35 AM, Hannes Reinecke wrote: On 05/01/2016 04:44 AM, Douglas Gilbert wrote: Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is

Re: [PATCH v2.5 4/6] scsi_debug: vpd and mode page work

2016-05-02 Thread Douglas Gilbert
On 2016-05-02 04:38 AM, Hannes Reinecke wrote: On 05/01/2016 04:44 AM, Douglas Gilbert wrote: Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas

Re: [PATCH 2/3] libata-scsi: Fix SCSI INQUIRY version descriptor

2016-05-03 Thread Douglas Gilbert
On 2016-05-02 04:13 PM, tom.t...@gmail.com wrote: From: Tom Yan https://bugzilla.kernel.org/show_bug.cgi?id=106931 Signed-off-by: Tom Yan diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index cd30f11..0295c38 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-s

Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-05-05 Thread Douglas Gilbert
On 2016-05-04 06:32 PM, Bart Van Assche wrote: On 04/30/2016 07:44 PM, Douglas Gilbert wrote: +static struct sdebug_queue *get_queue(void) +{ +struct sdebug_queue *sqp = sdebug_q_arr; + +return sqp + (raw_smp_processor_id() % submit_queues); +} Does this function have the same purpose

[PATCH v3 0/6] scsi_debug: multiple queue support and cleanup

2016-05-05 Thread Douglas Gilbert
/sg/p/sdebug_mq_1st_half.patch Douglas Gilbert (6): scsi_debug: use pdt constants scsi_debug: rework resp_report_luns scsi_debug: add multiple queue support scsi_debug: vpd and mode page work scsi_debug: uuid for lu name scsi_debug: use locally assigned naa dr

[PATCH v3 1/6] scsi_debug: use pdt constants

2016-05-05 Thread Douglas Gilbert
Use TYPE_* constants for SCSI peripheral device types instead of numbers. Further cleanups requested by checkpatch.pl . Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 86

[PATCH v3 3/6] scsi_debug: add multiple queue support

2016-05-05 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default off. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 702

[PATCH v3 4/6] scsi_debug: vpd and mode page work

2016-05-05 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c

[PATCH v3 2/6] scsi_debug: rework resp_report_luns

2016-05-05 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 135 +- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/dr

[PATCH v3 6/6] scsi_debug: use locally assigned naa

2016-05-05 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions

[PATCH v3 5/6] scsi_debug: uuid for lu name

2016-05-05 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Douglas Gilbert --- drivers/scsi

Re: [PATCH v3 3/6] scsi_debug: add multiple queue support

2016-05-09 Thread Douglas Gilbert
On 2016-05-09 06:12 PM, Bart Van Assche wrote: On 05/05/2016 09:40 PM, Douglas Gilbert wrote: static bool stop_queued_cmnd(struct scsi_cmnd *cmnd) { unsigned long iflags; -int k, qmax, r_qmax; +int j, k, qmax, r_qmax; +struct sdebug_queue *sqp; struct

[PATCH] scsi_debug: fix sleep in invalid context

2016-05-30 Thread Douglas Gilbert
memory allocation for response to REPORT LUNS command. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 0f9ba41..b85c5dc 100644 --- a/drivers/scsi

Re: [PATCH] scsi_debug: fix sleep in invalid context

2016-05-31 Thread Douglas Gilbert
On 2016-05-30 03:09 PM, Christoph Hellwig wrote: On Mon, May 30, 2016 at 12:02:45PM -0700, James Bottomley wrote: This might fix the immediate warning, but won't it demand huge contiguous memory chunks in high lun configurations and thus fail randomly? Report luns is important to us because if

[PATCH v2] scsi_debug: fix sleep in invalid context

2016-05-31 Thread Douglas Gilbert
stack) and potentially multiple calls to sg_pcopy_from_buffer() to construct the 'data-in' buffer for the SCSI REPORT LUNS command. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 93 +-- 1 file changed, 66 insertions(+), 27 del

  1   2   3   4   5   6   7   8   9   10   >