Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1249314 > unrolled thread

[PATCH] libata: add support for NCQ commands for SG interface

Started byvinayak.kale@gmail.com
First post2015-10-17 13:50 +0200
Last post2015-10-17 20:50 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] libata: add support for NCQ commands for SG interface vinayak.kale@gmail.com - 2015-10-17 13:50 +0200
    Re: [PATCH] libata: add support for NCQ commands for SG interface Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-17 14:10 +0200
      Re: [PATCH] libata: add support for NCQ commands for SG interface Vinayak Kale <vinayak.kale@gmail.com> - 2015-10-17 14:30 +0200
        Re: [PATCH] libata: add support for NCQ commands for SG interface Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-17 20:50 +0200

#1249314 — [PATCH] libata: add support for NCQ commands for SG interface

Fromvinayak.kale@gmail.com
Date2015-10-17 13:50 +0200
Subject[PATCH] libata: add support for NCQ commands for SG interface
Message-ID<qky9P-4G1-1@gated-at.bofh.it>
From: Vinayak Kale <vinayak.kale@seagate.com>

This patch is needed to make NCQ commands with FPDMA protocol value
(eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.

Signed-off-by: Vinayak Kale <vinayak.kale@seagate.com>
---
 drivers/ata/libata-scsi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0d7f0da..5b0a5ab 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2914,12 +2914,14 @@ ata_scsi_map_proto(u8 byte1)
 	case 5:		/* PIO Data-out */
 		return ATA_PROT_PIO;
 
+	case 12:	/* FPDMA */
+		return ATA_PROT_NCQ;
+
 	case 0:		/* Hard Reset */
 	case 1:		/* SRST */
 	case 8:		/* Device Diagnostic */
 	case 9:		/* Device Reset */
 	case 7:		/* DMA Queued */
-	case 12:	/* FPDMA */
 	case 15:	/* Return Response Info */
 	default:	/* Reserved */
 		break;
@@ -2963,7 +2965,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
 			tf->hob_lbal = cdb[7];
 			tf->hob_lbam = cdb[9];
 			tf->hob_lbah = cdb[11];
-			tf->flags |= ATA_TFLAG_LBA48;
+			tf->flags |= (ATA_TFLAG_LBA48 | ATA_TFLAG_LBA);
 		} else
 			tf->flags &= ~ATA_TFLAG_LBA48;
 
@@ -2992,6 +2994,10 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
 		tf->command = cdb[9];
 	}
 
+	/* For NCQ commands with FPDMA protocol, copy the tag value */
+	if (tf->protocol == ATA_PROT_NCQ)
+		tf->nsect = qc->tag << 3;
+
 	/* enforce correct master/slave bit */
 	tf->device = dev->devno ?
 		tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1249318

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-10-17 14:10 +0200
Message-ID<qkytc-5iD-13@gated-at.bofh.it>
In reply to#1249314
Hello.

On 10/17/2015 2:48 PM, vinayak.kale@gmail.com wrote:

> From: Vinayak Kale <vinayak.kale@seagate.com>
>
> This patch is needed to make NCQ commands with FPDMA protocol value
> (eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.
>
> Signed-off-by: Vinayak Kale <vinayak.kale@seagate.com>
> ---
>   drivers/ata/libata-scsi.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 0d7f0da..5b0a5ab 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
[...]
> @@ -2963,7 +2965,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
>   			tf->hob_lbal = cdb[7];
>   			tf->hob_lbam = cdb[9];
>   			tf->hob_lbah = cdb[11];
> -			tf->flags |= ATA_TFLAG_LBA48;
> +			tf->flags |= (ATA_TFLAG_LBA48 | ATA_TFLAG_LBA);

    Parens not needed here.

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1249323

FromVinayak Kale <vinayak.kale@gmail.com>
Date2015-10-17 14:30 +0200
Message-ID<qkyMy-5GA-19@gated-at.bofh.it>
In reply to#1249318
On Sat, Oct 17, 2015 at 5:30 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
> On 10/17/2015 2:48 PM, vinayak.kale@gmail.com wrote:
>
>> From: Vinayak Kale <vinayak.kale@seagate.com>
>>
>> This patch is needed to make NCQ commands with FPDMA protocol value
>> (eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.
>>
>> Signed-off-by: Vinayak Kale <vinayak.kale@seagate.com>
>> ---
>>   drivers/ata/libata-scsi.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>> index 0d7f0da..5b0a5ab 100644
>> --- a/drivers/ata/libata-scsi.c
>> +++ b/drivers/ata/libata-scsi.c
>
> [...]
>>
>> @@ -2963,7 +2965,7 @@ static unsigned int ata_scsi_pass_thru(struct
>> ata_queued_cmd *qc)
>>                         tf->hob_lbal = cdb[7];
>>                         tf->hob_lbam = cdb[9];
>>                         tf->hob_lbah = cdb[11];
>> -                       tf->flags |= ATA_TFLAG_LBA48;
>> +                       tf->flags |= (ATA_TFLAG_LBA48 | ATA_TFLAG_LBA);
>
>
>    Parens not needed here.
That's quite neat :-) Thanks, will change it in V2.
>
> [...]
>
> MBR, Sergei
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1249419

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-10-17 20:50 +0200
Message-ID<qkEIh-5Va-13@gated-at.bofh.it>
In reply to#1249323
On 10/17/2015 3:25 PM, Vinayak Kale wrote:

>>> From: Vinayak Kale <vinayak.kale@seagate.com>
>>>
>>> This patch is needed to make NCQ commands with FPDMA protocol value
>>> (eg READ/WRITE FPDMA) work over SCSI Generic (SG) interface.
>>>
>>> Signed-off-by: Vinayak Kale <vinayak.kale@seagate.com>
>>> ---
>>>    drivers/ata/libata-scsi.c | 10 ++++++++--
>>>    1 file changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>>> index 0d7f0da..5b0a5ab 100644
>>> --- a/drivers/ata/libata-scsi.c
>>> +++ b/drivers/ata/libata-scsi.c
>>
>> [...]
>>>
>>> @@ -2963,7 +2965,7 @@ static unsigned int ata_scsi_pass_thru(struct
>>> ata_queued_cmd *qc)
>>>                          tf->hob_lbal = cdb[7];
>>>                          tf->hob_lbam = cdb[9];
>>>                          tf->hob_lbah = cdb[11];
>>> -                       tf->flags |= ATA_TFLAG_LBA48;
>>> +                       tf->flags |= (ATA_TFLAG_LBA48 | ATA_TFLAG_LBA);
>>
>>
>>     Parens not needed here.
> That's quite neat :-) Thanks, will change it in V2.

     Looking at this hunk again, it seems an unrelated change.

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web