Will update you on how it goes . Generally the only reason for me to do it , is to check how does the SATA drive acts when it receives two identical tags. (Erroneous scenario). Is there a simple way to assure that the user space application is the only one which writes to this disk ? The disk is a seperate drive , not the System one , and generally the user space is the only one touching it. Nothing is installed on it. Which other process in the system might touch it ? Will use your help. Thanks On Fri, May 22, 2009 at 2:53 AM, Gwendal Grignou <gwendal@xxxxxxxxxx> wrote: > On Wed, May 20, 2009 at 2:20 PM, Dan Porat <dan.porat@xxxxxxxxx> wrote: >> Thank plenty for your answer. >> >> So , what is the best way to send NCQ through user space ? >> Is it possible to disable the tagging mechanism by the driver and only >> rely on the tag given by the user space ? > That's one solution, but that's quite risky, it can be difficult to > guarantee nobody else access the disk. Another one is to alter > ata_scsi_pass_thru() to use qc->tag in case of FPDMA command. It is > already calculated before we enter the translation function. > Let me know how it goes, > > Gwendal. > >> >> Thanks >> >> >> On Wed, May 20, 2009 at 10:53 PM, Gwendal Grignou <gwendal@xxxxxxxxxx> wrote: >>> Hi Dan, >>> >>> tf->nsect can not be calculated from user space: the tag must be >>> calculated by the driver. >>> >>> Gwendal. >>> >>> On Tue, May 19, 2009 at 11:11 AM, Dan Porat <dan.porat@xxxxxxxxx> wrote: >>>> As I have seen sg_io does not support NCQ in ATA passthrough. >>>> will changing the mapping function libata-scsi.c (line 2745) , work? >>>> >>>> If not , how else can I check the protocol (FPDMA) ? >>>> static u8 >>>> 2725ata_scsi_map_proto(u8 byte1) >>>> 2726{ >>>> 2727 switch((byte1 & 0x1e) >> 1) { >>>> 2728 case 3: /* Non-data */ >>>> 2729 return ATA_PROT_NODATA; >>>> 2730 >>>> 2731 case 6: /* DMA */ >>>> 2732 case 10: /* UDMA Data-in */ >>>> 2733 case 11: /* UDMA Data-Out */ >>>> 2734 return ATA_PROT_DMA; >>>> 2735 >>>> 2736 case 4: /* PIO Data-in */ >>>> 2737 case 5: /* PIO Data-out */ >>>> 2738 return ATA_PROT_PIO; >>>> 2739 >>>> 2745 case 12: /* FPDMA */ >>>> return ATA_PROT_NCQ >>>> 2740 case 0: /* Hard Reset */ >>>> 2741 case 1: /* SRST */ >>>> 2742 case 8: /* Device Diagnostic */ >>>> 2743 case 9: /* Device Reset */ >>>> 2744 case 7: /* DMA Queued */ >>>> >>>> 2746 case 15: /* Return Response Info */ >>>> 2747 default: /* Reserved */ >>>> 2748 break; >>>> 2749 } >>>> 2750 >>>> 2751 return ATA_PROT_UNKNOWN; >>>> 2752} >>>> >>>> >>>> >>>> Thanks >>>> >>>> Dan Porat >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe linux-ide" in >>>> the body of a message to majordomo@xxxxxxxxxxxxxxx >>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >>> >> > -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html