Re: [PATCH v8 1/7] ata: libata-sata: Factor out NCQ Priority configuration helpers

Niklas Cassel
2024-03-12T15:37:08Z

On Tue, Mar 12, 2024 at 03:17:43PM +0900, Damien Le Moal wrote:
> On 2024/03/08 19:03, Niklas Cassel wrote:
> >
> > Anyway, like you said, as you are now creating helper functions:
> > ata_ncq_prio_supported(), ata_ncq_prio_enabled(), ata_ncq_prio_enable()
> > these function might no longer only be called from sysfs code,
> > so it is probably a bad idea to let these functions use spin_lock_irq().
> >
> > However, can't ata_ncq_prio_supported() and ata_ncq_prio_enabled()
> > still use a simple spin_lock(), why would they need to disable irqs?
> >
> > Damien, you are the author of ata_ncq_prio_supported_show(), thoughts?
>
> See above. The spin lock irq-disabling variant is needed because the port lock
> is taken from command completion context.

Yes of course, I don't know what I was thinking...