Re: [PATCH v2 1/2] ata: libata-core: Skip HPA resize for locked drives

TJ Adams <[email protected]> Tue, 7 Jul 2026 10:01:51 -0700
Newsgroups org.kernel.vger.linux-ide,org.kernel.vger.linux-kernel
Message-ID <CAL54JgdpKG6VJ6GLjjs5prB7tH7mF-SCVdH-AHgCzBj2uCynfg@mail.gmail.com>
On Mon, Jul 6, 2026 at 11:02 PM Damien Le Moal <[email protected]> wrote:
>
> On 7/7/26 06:00, TJ Adams wrote:
> > Skip HPA resize in ata_hpa_resize() if the drive is security locked.
> > If the drive is locked, the command to read the native max address
> > fails with -EACCES, which currently causes the sticky quirk
> > ATA_QUIRK_BROKEN_HPA to be set on the device.
> >
> > Setting this sticky quirk causes subsequent revalidations (after the
> > drive is unlocked) to bypass HPA checks, preventing the unlocked drive
> > from exposing its full native capacity without a reboot or device removal.
> >
> > Signed-off-by: Terrence Adams <[email protected]>
>
> Doesn't this need the same fixes tag as patch 2 ?

Hey Damien,

I don't think this should have the same fixes tag as patch 2, because without
commit 91842ed844a0 ("ata: libata-core: Set capacity to zero for a security
locked drive") the problem still exists.

The quirk gets set not because of the capacity being zero but because the locked
drive returns -EACCES.

I think Fixes: 05027adccc09 ("libata: remiplement ata_hpa_resize()"), might be
better for this patch.

If you agree, I can send a v3 or if it's easier, feel free to amend the commit
message yourself.

Best Regards,
TJ Adams