From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@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: Mon, 27 Apr 2026 22:32:35 +0200 [thread overview]
Message-ID: <6149B806-C296-42DE-BF0E-119E8AF6129B@kernel.org> (raw)
In-Reply-To: <a805fa86-0fe7-4803-ad2e-45719415f263@kernel.org>
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
Kind regards,
Nikla
next prev parent reply other threads:[~2026-04-27 20:32 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 [this message]
2026-04-27 21:47 ` Damien Le Moal
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=6149B806-C296-42DE-BF0E-119E8AF6129B@kernel.org \
--to=cassel@kernel.org \
--cc=dayou5941@163.com \
--cc=dlemoal@kernel.org \
--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