From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>, dayou5941@163.com
Cc: linux-ide@vger.kernel.org, liyouhong@kylinos.cn
Subject: Re: [PATCH v4] ata: ahci: fail probe if BAR too small for claimed ports
Date: Tue, 28 Apr 2026 06:47:41 +0900 [thread overview]
Message-ID: <b135fcde-bff7-4725-87a7-3d3126af9007@kernel.org> (raw)
In-Reply-To: <6149B806-C296-42DE-BF0E-119E8AF6129B@kernel.org>
On 2026/04/28 5:32, Niklas Cassel wrote:
> On 27 April 2026 22:23:12 CEST, Damien Le Moal <dlemoal@kernel.org> wrote:
>> On 2026/04/27 21:14, Niklas Cassel wrote:
>>>> + max_ports, last_port_end,
>>>> + (unsigned long long)bar_size);
>>>
>>> Print resource_size_t as %pa instead of casting to unsigned long long
>>> and pass bar_size by reference (&bar_size):
>>> https://docs.kernel.org/core-api/printk-formats.html#physical-address-types-phys-addr-t
>>>
>>>
>>>> + return -ENODEV;
>>>
>>> return -EIO;
>>
>> I do not agree here. We did not do any I/O. If anything, this should be EINVAL.
>> But I think that ENODEV is safer since we are in the probe context here and we
>> do not want to see that device show up.
>
>
> How about -ENXIO?
>
> No such device or address
>
>
> It is the only error code, except for -ENODEV
> that is a valid error code to fail probe():
> https://elixir.bootlin.com/linux/v7.0.1/source/drivers/base/dd.c#L653
That is my point, since we want to fail probe. So I would go with this ENODEV.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-04-27 21:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 6:05 [PATCH v4] ata: ahci: fail probe if BAR too small for claimed ports dayou5941
2026-04-27 12:14 ` Niklas Cassel
2026-04-27 20:23 ` Damien Le Moal
2026-04-27 20:32 ` Niklas Cassel
2026-04-27 21:47 ` Damien Le Moal [this message]
2026-04-27 22:10 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b135fcde-bff7-4725-87a7-3d3126af9007@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=dayou5941@163.com \
--cc=linux-ide@vger.kernel.org \
--cc=liyouhong@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox