[PATCH v5 1/6] ata: ahci_st: Do not ignore errors when getting the reset controls
Damien Le Moal
dlemoal at kernel.org
Tue Sep 15 01:48:06 PDT 2026
On 2026/09/15 15:41, Niklas Cassel wrote:
> st_ahci_probe_resets() treats any error from devm_reset_control_get() as
> "reset control not defined" and continues with a NULL reset control:
>
> drv_data->pwr = devm_reset_control_get(dev, "pwr-dwn");
> if (IS_ERR(drv_data->pwr)) {
> dev_info(dev, "power reset control not defined\n");
> drv_data->pwr = NULL;
> }
>
> This also swallows -EPROBE_DEFER, which is returned when the reset
> controller providing the reset has not been probed yet. probe() then
> continues as if the device tree did not specify any reset, so the resets
> of the SATA IP are never deasserted, and st_ahci_configure_oob() and
> ahci_platform_init_host() access the MMIO of an IP which is still held in
> reset and powered down, which can result in an external abort.
>
> The resets are optional in the binding, as they are not part of its
> required properties, so use devm_reset_control_get_optional(), which
> returns NULL if the reset is not specified in the device tree, and
> propagate all other errors.
>
> Note that an absent reset is now indicated by a NULL reset control
> instead of an error, so the "reset control not defined" messages are
> dropped.
>
> Fixes: 76884cb2f7da ("ahci: st: Add support for ST's SATA IP")
> Cc: stable at vger.kernel.org
> Signed-off-by: Niklas Cassel <cassel at kernel.org>
Looks good.
Reviewed-by: Damien Le Moal <dlemoal at kernel.org>
--
Damien Le Moal
Western Digital Research
More information about the linux-arm-kernel
mailing list