Re: [PATCH 1/3] ata: Allow having a port recovery callback
From: Florian Fainelli
Date: Wed Jan 10 2018 - 12:53:20 EST
On 01/10/2018 06:25 AM, Tejun Heo wrote:
> Hello,
>
> On Tue, Jan 09, 2018 at 03:04:55PM -0800, Florian Fainelli wrote:
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 3c09122bf038..921c2813af07 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -2045,6 +2045,8 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
>> if (ata_msg_warn(ap))
>> ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n",
>> reason, err_mask);
>> + if (ap->host->ops->port_recovery)
>> + ap->host->ops->port_recovery(ap);
>> return rc;
>> }
>
> This is a really weird spot to add a callback named port_recovery().
> Can't the affected driver simply implement its own
> ata_port_operations->read_id() operation which does the recovery if
> necessary?
I did not consider that, but this is actually a great idea, thanks for
the suggestion! I will respin with that being done.
--
Florian