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

2016-10-28 Thread Christoph Hellwig
On Thu, Oct 27, 2016 at 11:00:56AM +0200, Hannes Reinecke wrote: > BLOCK_PC is currently used indiscriminately for all non-filesystem > commands, ie for commands where the raw cdb is passed in via req->special. > > As such, is has a dual meaning: > - A pre-filled CDB > - do not evaluate the sense

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

2016-10-27 Thread Hannes Reinecke
On 10/26/2016 07:38 PM, Brian King wrote: > On 10/26/2016 11:15 AM, Bart Van Assche wrote: >> On Wed, 2016-10-26 at 08:52 -0700, James Bottomley wrote: >>> On Wed, 2016-10-26 at 08:42 -0700, Bart Van Assche wrote: Can you elaborate on this? Since the sense buffer is available in

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

2016-10-26 Thread Brian King
On 10/26/2016 11:15 AM, Bart Van Assche wrote: > On Wed, 2016-10-26 at 08:52 -0700, James Bottomley wrote: >> On Wed, 2016-10-26 at 08:42 -0700, Bart Van Assche wrote: >>> Can you elaborate on this? Since the sense buffer is available in >>> scsi_io_completion() and since that function already

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

2016-10-26 Thread Bart Van Assche
On Wed, 2016-10-26 at 08:52 -0700, James Bottomley wrote: > On Wed, 2016-10-26 at 08:42 -0700, Bart Van Assche wrote: > > Can you elaborate on this? Since the sense buffer is available inĀ  > > scsi_io_completion() and since that function already callsĀ  > > scsi_command_normalize_sense() this

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

2016-10-26 Thread James Bottomley
On Wed, 2016-10-26 at 08:42 -0700, Bart Van Assche wrote: > On 10/25/2016 04:50 PM, James Bottomley wrote: > > On Tue, 2016-10-25 at 23:18 +, Bart Van Assche wrote: > > > Anyway, currently the following functions interpret the SCSI > > > sense buffer: > > > * scsi_io_completion() in

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

2016-10-26 Thread Bart Van Assche
On 10/25/2016 04:50 PM, James Bottomley wrote: On Tue, 2016-10-25 at 23:18 +, Bart Van Assche wrote: Anyway, currently the following functions interpret the SCSI sense buffer: * scsi_io_completion() in scsi_lib.c. * scsi_mode_sense() in scsi_lib.c. * scsi_test_unit_ready_flags() in

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

2016-10-25 Thread James Bottomley
On Tue, 2016-10-25 at 23:18 +, Bart Van Assche wrote: > On Tue, 2016-10-25 at 15:23 -0700, James Bottomley wrote: > > Because scsi_execute uses REQ_BLOCK_PC which is completed before > > you get to that code. > > Hello James, > > Do you perhaps mean that scsi_io_completion() returns early

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

2016-10-25 Thread Bart Van Assche
On Tue, 2016-10-25 at 15:23 -0700, James Bottomley wrote: > Because scsi_execute uses REQ_BLOCK_PC which is completed before you > get to that code. Hello James, Do you perhaps mean that scsi_io_completion() returns early for REQ_TYPE_BLOCK_PC requests? Can you clarify this further? Anyway,

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

2016-10-25 Thread James Bottomley
On Tue, 2016-10-25 at 15:16 -0700, Bart Van Assche wrote: > On 10/23/2016 08:20 PM, Gabriel Krisman Bertazi wrote: > > + > > /** > > * scsi_execute - insert request and wait for the result > > * @sdev: scsi device > > @@ -187,7 +197,14 @@ int scsi_execute(struct scsi_device *sdev, > > const

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

2016-10-25 Thread Bart Van Assche
On 10/23/2016 08:20 PM, Gabriel Krisman Bertazi wrote: + /** * scsi_execute - insert request and wait for the result * @sdev: scsi device @@ -187,7 +197,14 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, struct request *req; int write =

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

2016-10-25 Thread Benjamin Block
On 01:20 Mon 24 Oct , Gabriel Krisman Bertazi wrote: > James, > > I fixed the things you pointed out on the previous review. As > discussed, I didn't change the code to reuse the request yet. We can > follow up on that later. > > Thanks, > > >8 > > Usually, re-sending the SCSI command is

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

2016-10-23 Thread Gabriel Krisman Bertazi
James, I fixed the things you pointed out on the previous review. As discussed, I didn't change the code to reuse the request yet. We can follow up on that later. Thanks, >8 Usually, re-sending the SCSI command is enough to recover from a Unit Attention (UA). This adds a generic retry code