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


Groups > linux.kernel > #1256478 > unrolled thread

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

Started byvinayak.kale@gmail.com
First post2015-10-27 07:00 +0100
Last post2015-10-27 07:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] libata: add support for NCQ commands for SG interface vinayak.kale@gmail.com - 2015-10-27 07:00 +0100
    Re: [PATCH v2] libata: add support for NCQ commands for SG interface Tejun Heo <tj@kernel.org> - 2015-10-27 07:20 +0100
      Re: [PATCH v2] libata: add support for NCQ commands for SG interface Vinayak Kale <vinayak.kale@gmail.com> - 2015-10-27 07:40 +0100

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

Fromvinayak.kale@gmail.com
Date2015-10-27 07:00 +0100
Subject[PATCH v2] libata: add support for NCQ commands for SG interface
Message-ID<qo5sB-1nr-3@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>
---
Changes in v2:
 - Decoupled tf->flags changes in ata_scsi_pass_thru() from this patch
   as per Tejun's suggestion. A separate patch will be sent for that change.

 drivers/ata/libata-scsi.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0d7f0da..c2af592 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;
@@ -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]


#1256485

FromTejun Heo <tj@kernel.org>
Date2015-10-27 07:20 +0100
Message-ID<qo5LY-1Jy-5@gated-at.bofh.it>
In reply to#1256478
On Tue, Oct 27, 2015 at 11:19:15AM +0530, 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>

Applied to libata/for-4.4.

Thanks.

-- 
tejun
--
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]


#1256501

FromVinayak Kale <vinayak.kale@gmail.com>
Date2015-10-27 07:40 +0100
Message-ID<qo65j-1PJ-5@gated-at.bofh.it>
In reply to#1256485
On Tue, Oct 27, 2015 at 11:46 AM, Tejun Heo <tj@kernel.org> wrote:
> On Tue, Oct 27, 2015 at 11:19:15AM +0530, 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>
>
> Applied to libata/for-4.4.

Thanks Tejun :-)

>
> Thanks.
>
> --
> tejun
--
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