# Re: \[PATCH v7 09/11\] libata: Introduce ncq\_prio\_supported sysfs sttribute

- From: Hannes Reinecke \<hare@suse.de\>
- Date: 2021-08-16 05:54:20 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/08/6404702
- Thread: https://ratatoskr.run/linux-ide/2021/08/6404689/t.md

```text
On 8/16/21 3:44 AM, Damien Le Moal wrote:
> Currently, the only way a user can determine if a SATA device supports
> NCQ priority is to try to enable the use of this feature using the
> ncq_prio_enable sysfs device attribute. If enabling the feature fails,
> it is because the device does not support NCQ priority. Otherwise, the
> feature is enabled and success indicates that the device supports NCQ
> priority.
>
> Improve this odd interface by introducing the read-only
> ncq_prio_supported sysfs device attribute to indicate if a SATA device
> supports NCQ priority. The value of this attribute reflects the status
> of device flag ATA_DFLAG_NCQ_PRIO, which is set only for devices
> supporting NCQ priority.
>
> Add this new sysfs attribute to the device attributes group of libahci
> and libata-sata.
>
> Signed-off-by: Damien Le Moal <redacted>
> ---
>   drivers/ata/libahci.c     |  1 +
>   drivers/ata/libata-sata.c | 25 +++++++++++++++++++++++++
>   include/linux/libata.h    |  1 +
>   3 files changed, 27 insertions(+)
> Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
```
