On Thu, Jan 06, 2022 at 05:41:00PM +0000, John Garry wrote:
On 05/01/2022 19:47, Bjorn Helgaas wrote:
IMO inb() should be present but do something innocuous like return ~0, as it would if I/O port space is supported but there's no device at that address.
[1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv...
That driver would prob not be used on systems which does not support PIO, and so could have a HAS_IOPORT dependency. But it is not strictly necessary.
I don't want the path of "this driver isn't needed because the device is unlikely to be used on this arch."
Maybe it's not _always_ possible, but if the device can be plugged into the platform, I think we should be able to build the driver for it.
If the device requires I/O port space and the platform doesn't support it, the PCI core or the driver should detect that and give a useful diagnostic.
Bjorn
On 06/01/2022 18:14, Bjorn Helgaas wrote:
That driver would prob not be used on systems which does not support PIO, and so could have a HAS_IOPORT dependency. But it is not strictly necessary.
I don't want the path of "this driver isn't needed because the device is unlikely to be used on this arch."
Sure, that was just a one off example. As I mentioned before, I think that Arnd already did most of the ifdeffery work, but it was not included in this series.
Maybe it's not_always_ possible, but if the device can be plugged into the platform, I think we should be able to build the driver for it.
If the device requires I/O port space and the platform doesn't support it, the PCI core or the driver should detect that and give a useful diagnostic.
I'm not sure what the driver can say apart from -ENODEV. Or IO port management in resource.c could warn for requesting IO port region when it's unsupported.
Anyway, this same conversion was had with Linus before I got involved. If you think it is worth discussing again then I suppose the authors here need to gain consensus.
Thanks, John
dri-devel@lists.freedesktop.org