Re: [PATCH] scsi: Change return type to vm_fault_t

2018-04-14 Thread Douglas Gilbert
On 2018-04-14 02:47 PM, Souptick Joarder wrote: Use new return type vm_fault_t for fault handler in struct vm_operations_struct. Signed-off-by: Souptick Joarder <jrdr.li...@gmail.com> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> Acked-by: Douglas Gilbert <dgilb.

Re: [VERY EARLY RFC 00/13] Rework SCSI results handling

2018-04-18 Thread Douglas Gilbert
On 2018-04-18 11:01 AM, Johannes Thumshirn wrote: Hey all, here's a early preview of my SCSI results rework so we can eventually discuss things next week at LSF/MM (it still has compiler errors on aic7xxx and scsi_debug). The motivation behing this is that some drivers have failed to set the

[PATCH] scsi_debug: replace SDEG_RES_IMMED_MASK with cmnd flag

2018-04-18 Thread Douglas Gilbert
still caused some confusion so a more conventional method is now used: adding an extra flag to the scsi_cmnd "host_scribble" area. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- This patch is designed to simplify part of the patchset titled: "Rework SCSI results h

Re: [PATCH v2 4/6] scsi_io_completion_action helper added

2018-03-27 Thread Douglas Gilbert
On 2018-03-26 08:13 PM, Bart Van Assche wrote: On Sun, 2018-03-18 at 21:59 +0100, Douglas Gilbert wrote: + /* sense not about current command is termed: deferred */ Do we really need comments that explain the SCSI specs? If such a comment is added I think it should be added above

[PATCH v3 5/7] scsi_io_completion_reprep helper added

2018-03-27 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 41 ++-

[PATCH v3 2/7] scsi_io_completion rename variables

2018-03-27 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 57 ++---

[PATCH v3 1/7] scsi_io_completion comment on end_request return

2018-03-27 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thu

[PATCH v3 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-27 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/driver

[PATCH v3 6/7] scsi_io_completion hints on fastpatch

2018-03-27 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[PATCH v3 3/7] scsi_io_completion_nz_result function added

2018-03-27 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- A reviewer requested the original helper function's two retu

[PATCH v3 0/7] scsi_io_completion cleanup

2018-03-27 Thread Douglas Gilbert
ct remains, this is a very complex function. This patch is against Martin Petersen's 4.17/scsi-queue branch. Douglas Gilbert (7): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_result function added scsi_io_completion_action he

[PATCH v3 4/7] scsi_io_completion_action helper added

2018-03-27 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbert <dgilb...

[PATCH v5 4/7] scsi_io_completion_action helper added

2018-03-28 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbert <dgilb...

[PATCH v5 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-28 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 1

[PATCH v5 6/7] scsi_io_completion hints on fastpatch

2018-03-28 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[PATCH v5 5/7] scsi_io_completion_reprep helper added

2018-03-28 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -

[PATCH v5 0/7] scsi_io_completion cleanup

2018-03-28 Thread Douglas Gilbert
introduce bool do_print to simplify conditionals in the case of a recovered error sense key in 2/7 rather than 3/7 ChangeLog since v3 - make use of bools sense_valid and sense_current consistent in 3/7 and 4/7 Douglas Gilbert (7): scsi_io_completion comment on end_requ

[PATCH v5 2/7] scsi_io_completion rename variables

2018-03-28 Thread Douglas Gilbert
Change and add some variable names, adjust some associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 72 ++--- 1 file changed, 39 insertions(

[PATCH v5 3/7] scsi_io_completion_nz_result function added

2018-03-28 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- A reviewer requested the original helper function's two retu

[PATCH v5 1/7] scsi_io_completion comment on end_request return

2018-03-28 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thu

Re: Multi-Actuator SAS HDD First Look

2018-03-29 Thread Douglas Gilbert
On 2018-03-26 11:08 AM, Hannes Reinecke wrote: On Fri, 23 Mar 2018 08:57:12 -0600 Tim Walker wrote: Seagate announced their split actuator SAS drive, which will probably require some kernel changes for full support. It's targeted at cloud provider JBODs and RAID.

Re: Multi-Actuator SAS HDD First Look

2018-04-02 Thread Douglas Gilbert
On 2018-04-02 11:34 AM, Tim Walker wrote: On Sat, Mar 31, 2018 at 10:52 AM, Douglas Gilbert <dgilb...@interlog.com> wrote: On 2018-03-30 04:01 PM, Bart Van Assche wrote: On Fri, 2018-03-30 at 12:36 -0600, Tim Walker wrote: Yes I will be there to discuss the multi-LUN approach. I

Re: Regarding SCSI SANITIZE command support

2018-04-03 Thread Douglas Gilbert
On 2018-04-02 07:10 AM, Mahesh Rajashekhara wrote: Hello, I am RAID HBA driver engineer here at Microsemi. We are working on linux driver development for Microsemi SAS/SATA RAID HBA controllers. As per our understanding, while a drive is processing the SANITIZE command: - The drive should

[PATCH v4 4/7] scsi_io_completion_action helper added

2018-03-28 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbert <dgilb...

[PATCH v4 3/7] scsi_io_completion_nz_result function added

2018-03-28 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- A reviewer requested the original helper function's two retu

[PATCH v4 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-28 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 1

[PATCH v4 2/7] scsi_io_completion rename variables

2018-03-28 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com> --- drivers/sc

[PATCH v4 1/7] scsi_io_completion comment on end_request return

2018-03-28 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thu

[PATCH v4 0/7] scsi_io_completion cleanup

2018-03-28 Thread Douglas Gilbert
H_RETRY, 0); and __scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY, 0); need that trailing 0 changed to 'false', prior to applying 4/7 . Douglas Gilbert (7): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_result function added scsi_io_complet

[PATCH v4 6/7] scsi_io_completion hints on fastpatch

2018-03-28 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[PATCH v4 5/7] scsi_io_completion_reprep helper added

2018-03-28 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -

Re: How to Locate drive directly attached to mpt3sas HBA

2018-03-19 Thread Douglas Gilbert
On 2018-03-19 11:40 AM, Jack Wang wrote: Hi list, Any one knows how can I locate a HDD directly attached to mpt3sas, sas3ircu only supports LOCATE commd to locates driver installed in a disk enclosure, but not directly attached. I know microsemi/PMCs supports SGPIO interface to locate drive

[PATCH v2 6/6] scsi_io_completion convert BUGs to WARNs

2018-03-18 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- This was done at a reviewer's request. This patchset did not change those BUG() lines but the git-diff suggested

[PATCH v2 2/6] scsi_io_completion rename variables

2018-03-18 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 57 ++---

[PATCH v2 0/6] scsi_io_completion cleanup

2018-03-18 Thread Douglas Gilbert
main thing to review is whether the refactoring is worthwhile and whether the logic remains the same after the refactoring. Douglas Gilbert (6): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_result function added scsi_io_completion

[PATCH v2 5/6] scsi_io_completion hints on fastpatch

2018-03-18 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[PATCH v2 1/6] scsi_io_completion comment on end_request return

2018-03-18 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Johannes Thu

[PATCH v2 4/6] scsi_io_completion_action helper added

2018-03-18 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbert <dgilb...

[PATCH v2 3/6] scsi_io_completion_nz_result function added

2018-03-18 Thread Douglas Gilbert
Break out several interwined paths when cmd->result is non zero and place them in scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- A reviewer requested the original helper function's two return values b

Re: [PATCH] scsi: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()

2018-02-26 Thread Douglas Gilbert
ert <dgilb...@interlog.com> Signed-off-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index aea5a1ae318b..11d63

Re: [PATCH v2] Make SCSI Status CONDITION MET equivalent to GOOD

2018-02-26 Thread Douglas Gilbert
On 2018-02-26 02:25 AM, Hannes Reinecke wrote: On 02/25/2018 07:29 PM, Douglas Gilbert wrote: The SCSI PRE-FETCH (10 or 16) command is present both on hard disks and some SSDs. It is useful when the address of the next block(s) to be read is known but it is not following the LBA of the current

[PATCH v2 1/2] scsi_io_completion split, fix CONDITION MET handling

2018-02-27 Thread Douglas Gilbert
The "ChangeLog for v1" section in 0/2 (the cover letter) of this patch set outlines the changes in this patch. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 297 +--- include/scsi/scsi.h

[PATCH v2 2/2] scsi_io_completion convert BUG to WARN calls

2018-02-27 Thread Douglas Gilbert
ChangeLog: - convert 3 BUG calls to WARN calls - un-invert some conditional logic to uncover the real fast path - try to improve the comments, including noting what the bool return value from scsi_end_request() means Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- d

[PATCH v2 0/2] scsi_io_completion cleanup and fix CONDITION MET handling

2018-02-27 Thread Douglas Gilbert
o) This patch is against mkp's 4.17/scsi-queue branch. It also applies to lk 4.15.x where it was tested on a SAS SSD. Douglas Gilbert (2): scsi_io_completion cleanup and fix CONDITION MET handling scsi_io_completion-change2warn drivers/scsi/scsi_lib.c | 304 +

Re: [PATCH] bsg: convert to use blk-mq

2018-10-17 Thread Douglas Gilbert
On 2018-10-17 11:55 a.m., Benjamin Block wrote: On Tue, Oct 16, 2018 at 08:43:01AM -0600, Jens Axboe wrote: Requires a few changes to the FC transport class as well. Cc: Johannes Thumshirn Cc: Benjamin Block Cc: linux-scsi@vger.kernel.org Signed-off-by: Jens Axboe --- block/bsg-lib.c

[PATCH 6/8] sg: complete locking changes on ioctl+debug

2018-10-19 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH 7/8] sg: rework ioctl handling

2018-10-19 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window. drivers/scsi/sg.c | 1225 +++-- 1 file changed, 739 insertions(+), 486 deletions

[PATCH 8/8] sg: user control for q_at_head or tail

2018-10-19 Thread Douglas Gilbert
Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Signed-off-by: Douglas Gilbert --- The user can still override this setting on a per command basis

[PATCH 1/8] sg: types and naming cleanup

2018-10-19 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

[PATCH 4/8] sg: expand request states

2018-10-19 Thread Douglas Gilbert
descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch to be a bit shorter and still compile. drivers/scsi/sg.c | 27

[PATCH 0/8] sg: major cleanup, remove max_queue limit

2018-10-19 Thread Douglas Gilbert
branch. Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct descriptions sg: expand request states sg: add free list, rework locking sg: complete locking changes on ioctl+debug sg: rework ioctl handling sg: user control

[PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file

Re: [PATCH v2 3/8] sg: split header, expand and correct descriptions

2018-10-21 Thread Douglas Gilbert
On 2018-10-20 11:21 p.m., Douglas Gilbert wrote: Split scsi/sg.h into a smaller scsi/sg.h which includes a new header: uapi/scsi/sg.h . Overall expand the twin header files with new functionality in this patchset and functionality to be added in the next patchset to implement SG_IOSUBMIT

[PATCH v2 4/8] sg: expand request states

2018-10-20 Thread Douglas Gilbert
. SG_TOT_FD_THRESHOLD is a default, per file descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch (5 of 8) to be a bit

[PATCH v2 6/8] sg: complete locking changes on ioctl+debug

2018-10-20 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH v2 0/8] sg: major cleanup, remove max_queue limit

2018-10-20 Thread Douglas Gilbert
around the 4th and 5th patches - add read_value[SG_SEIRV_*] options in SG_SET_GET_EXTENDED ioctl and increase structure size from 64 to 96 bytes Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct descriptions sg: expand

[PATCH v2 2/8] sg: introduce sg_log macro

2018-10-20 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file

[PATCH v2 3/8] sg: split header, expand and correct descriptions

2018-10-20 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH v2 7/8] sg: rework ioctl handling

2018-10-20 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH v2 8/8] sg: user controls for q_at_head, read_value

2018-10-20 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

[PATCH v2 5/8] sg: add free list, rework locking

2018-10-20 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window, or simply view the before sg.c and the after sg.c . drivers/scsi/sg.c | 1241 +++-- 1

[PATCH v2 1/8] sg: types and naming cleanup

2018-10-20 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 3:45 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: [..] +/* + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages. + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most + * information). All messages are logged

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 11:22 a.m., Bart Van Assche wrote: On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: static void -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo) +sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo, + int max_num

Re: [PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 4:31 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: +/* Alternate style type names, "..._t" variants preferred */ +typedef struct sg_io_hdr Sg_io_hdr; +typedef struct sg_io_vec Sg_io_vec; +typedef struct sg_scsi_id Sg_scsi_id; +typedef struct s

Re: [PATCH] sg: remove bad blk_end_request_all() call

2018-10-16 Thread Douglas Gilbert
a request is "in flight" and a surprise removal occurs, can the sg driver expect the block layer (or scsi mid-level) to react (and clean-up) or is it up to the sg driver to force those actions? Acked-by: Douglas Gilbert Cc: Doug Gilbert Cc: linux-scsi@vger.kernel.org Signed-off-by:

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-24 Thread Douglas Gilbert
On 2018-10-24 3:58 a.m., Martin K. Petersen wrote: Hi Doug, I'll follow what the scsi mid-level and the other ULDs do. IOW, no change. The debug messages they produce are quite helpful (to me, I use them a lot, and Tony B. has asked for more precision) and well-tuned to the SCSI subsystem

[PATCH v3 5/8] sg: add free list, rework locking

2018-10-26 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window, or simply view the before sg.c and the after sg.c . The requirement to keep the patch small enough to be reviewable

[PATCH v3 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

[PATCH v3 6/8] sg: complete locking changes on ioctl+debug

2018-10-26 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH v3 3/8] sg: split header, expand and correct descriptions

2018-10-26 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH v3 4/8] sg: expand request states

2018-10-26 Thread Douglas Gilbert
. SG_TOT_FD_THRESHOLD is a default, per file descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch (5 of 8) to be a bit

[PATCH v3 7/8] sg: rework ioctl handling

2018-10-26 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH v3 2/8] sg: introduce sg_log macro

2018-10-26 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- Reviewers want SCSI_LOG_* style logging replaced. But with what? One suggestion

[PATCH v3 1/8] sg: types and naming cleanup

2018-10-26 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

[PATCH v3 0/8] sg: major cleanup, remove max_queue limit

2018-10-26 Thread Douglas Gilbert
compile/build problem around the 4th and 5th patches - add read_value[SG_SEIRV_*] options in SG_SET_GET_EXTENDED ioctl and increase structure size from 64 to 96 bytes Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct

Re: [PATCH v3 0/8] sg: major cleanup, remove max_queue limit

2018-10-28 Thread Douglas Gilbert
For anyone thinking of testing this patchset, it also applies clean to lk 4.19 release. Doug Gilbert On 2018-10-26 12:48 p.m., Douglas Gilbert wrote: The intention is to add two new ioctls as proposed by Linus Torvalds: SG_IOSUBMIT and SG_IORECEIVE to replace the write()/read() async interface

[PATCH v3.5 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

Re: [PATCH v3 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
On 2018-10-26 12:48 p.m., Douglas Gilbert wrote: Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Also add a read_value integer the can be used by write a value from

Re: [PATCH] rescan-scsi-bus.sh: use LUN wildcard in idlist

2018-11-08 Thread Douglas Gilbert
On 2018-10-25 10:49 a.m., Martin Wilck wrote: By scanning for LUN 0 only, we may encounter a device that the kernel won't add (e.g. peripheral device type 31) and which may thus never appear in sysfs for us to use for REPORT LUNS. That causes LUN additions for such devices to be missed by

Re: [PATCH v1] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-09 Thread Douglas Gilbert
On 2018-11-09 7:18 p.m., Bean Huo (beanhuo) wrote: This patch is to convert inputted string to the integer when read data from stdin. While entering data, the data between bytes can be separated by space, or by ',' or by '.'. Could you send me this patch against sg_write_buffer.c as found in

Re: [PATCH V2] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-12 Thread Douglas Gilbert
On 2018-11-12 11:32 a.m., Bean Huo (beanhuo) wrote: This patch is to convert inputted string to the integer when read data from stdin. While entering data flow, the data between bytes can be separated by either space, or ',' (or by '.'). V1-V2: 1. Rebased the patch on the latest

<    3   4   5   6   7   8