2015-11-16 14:09:04

by Mark Lord

[permalink] [raw]
Subject: Re: [PATCH v2] libata: add support for NCQ commands for SG interface

On 15-10-27 01:49 AM, [email protected] wrote:
> From: Vinayak Kale <[email protected]>
>
> This patch is needed to make NCQ commands with FPDMA protocol value
> (eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.
..
> + /* For NCQ commands with FPDMA protocol, copy the tag value */
> + if (tf->protocol == ATA_PROT_NCQ)
> + tf->nsect = qc->tag << 3;
> +


What prevents the qc-tag value here from conflicting with in-flight I/O
using the exact same qc-tag ??


2015-11-16 15:31:40

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH v2] libata: add support for NCQ commands for SG interface

On Mon, Nov 16, 2015 at 08:47:19AM -0500, Mark Lord wrote:
> On 15-10-27 01:49 AM, [email protected] wrote:
> >From: Vinayak Kale <[email protected]>
> >
> >This patch is needed to make NCQ commands with FPDMA protocol value
> >(eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.
> ..
> >+ /* For NCQ commands with FPDMA protocol, copy the tag value */
> >+ if (tf->protocol == ATA_PROT_NCQ)
> >+ tf->nsect = qc->tag << 3;
> >+
>
>
> What prevents the qc-tag value here from conflicting with in-flight I/O
> using the exact same qc-tag ??

The SG command doesn't set the tag, it's being set from an allocated
qc which can't otherwise be in-flight.

Thanks.

--
tejun