* [PATCH 0/2] PCI: Remove no_pci_devices
@ 2026-04-02 22:15 Heiner Kallweit
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Heiner Kallweit @ 2026-04-02 22:15 UTC (permalink / raw)
To: Dmitry Torokhov, Bjorn Helgaas
Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org
Remove the last user of no_pci_devices(), and then the function itself.
Heiner Kallweit (2):
input: pc110pad: change PCI check to get rid of orphaned
no_pci_devices
PCI: Remove no_pci_devices
drivers/input/mouse/pc110pad.c | 2 +-
drivers/pci/probe.c | 17 -----------------
include/linux/pci.h | 3 ---
3 files changed, 1 insertion(+), 21 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices
2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit
@ 2026-04-02 22:17 ` Heiner Kallweit
2026-04-06 17:23 ` Bjorn Helgaas
2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit
2026-04-07 19:48 ` [PATCH 0/2] " Bjorn Helgaas
2 siblings, 1 reply; 7+ messages in thread
From: Heiner Kallweit @ 2026-04-02 22:17 UTC (permalink / raw)
To: Dmitry Torokhov, Bjorn Helgaas
Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org
As a prerequisite for removing no_pci_devices(), replace its usage here
with an equivalent check for presence of a PCI bus.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/input/mouse/pc110pad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index efa58049f..c7a6df210 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -91,7 +91,7 @@ static int __init pc110pad_init(void)
{
int err;
- if (!no_pci_devices())
+ if (pci_find_next_bus(NULL))
return -ENODEV;
if (!request_region(pc110pad_io, 4, "pc110pad")) {
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] PCI: Remove no_pci_devices
2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
@ 2026-04-02 22:18 ` Heiner Kallweit
2026-04-07 19:48 ` [PATCH 0/2] " Bjorn Helgaas
2 siblings, 0 replies; 7+ messages in thread
From: Heiner Kallweit @ 2026-04-02 22:18 UTC (permalink / raw)
To: Dmitry Torokhov, Bjorn Helgaas
Cc: open list:HID CORE LAYER, linux-pci@vger.kernel.org
After having removed the last usage of no_pci_devices(), this function
can be removed.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/pci/probe.c | 17 -----------------
include/linux/pci.h | 3 ---
2 files changed, 20 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index bccc7a4bd..19d73f613 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -67,23 +67,6 @@ static struct resource *get_pci_domain_busn_res(int domain_nr)
return &r->res;
}
-/*
- * Some device drivers need know if PCI is initiated.
- * Basically, we think PCI is not initiated when there
- * is no device to be found on the pci_bus_type.
- */
-int no_pci_devices(void)
-{
- struct device *dev;
- int no_devices;
-
- dev = bus_find_next_device(&pci_bus_type, NULL);
- no_devices = (dev == NULL);
- put_device(dev);
- return no_devices;
-}
-EXPORT_SYMBOL(no_pci_devices);
-
/*
* PCI Bus Class
*/
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8861eeb43..cc98713e3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1201,8 +1201,6 @@ extern const struct bus_type pci_bus_type;
/* Do NOT directly access these two variables, unless you are arch-specific PCI
* code, or PCI core code. */
extern struct list_head pci_root_buses; /* List of all known PCI buses */
-/* Some device drivers need know if PCI is initiated */
-int no_pci_devices(void);
void pcibios_resource_survey_bus(struct pci_bus *bus);
void pcibios_bus_add_device(struct pci_dev *pdev);
@@ -2140,7 +2138,6 @@ static inline struct pci_dev *pci_get_base_class(unsigned int class,
static inline int pci_dev_present(const struct pci_device_id *ids)
{ return 0; }
-#define no_pci_devices() (1)
#define pci_dev_put(dev) do { } while (0)
static inline void pci_set_master(struct pci_dev *dev) { }
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
@ 2026-04-06 17:23 ` Bjorn Helgaas
2026-04-06 19:02 ` Dmitry Torokhov
0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2026-04-06 17:23 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Dmitry Torokhov, Bjorn Helgaas, open list:HID CORE LAYER,
linux-pci@vger.kernel.org
On Fri, Apr 03, 2026 at 12:17:35AM +0200, Heiner Kallweit wrote:
> As a prerequisite for removing no_pci_devices(), replace its usage here
> with an equivalent check for presence of a PCI bus.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/input/mouse/pc110pad.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
> index efa58049f..c7a6df210 100644
> --- a/drivers/input/mouse/pc110pad.c
> +++ b/drivers/input/mouse/pc110pad.c
> @@ -91,7 +91,7 @@ static int __init pc110pad_init(void)
> {
> int err;
>
> - if (!no_pci_devices())
> + if (pci_find_next_bus(NULL))
> return -ENODEV;
I'd certainly love to get rid of no_pci_devices(), although using
pci_find_next_bus() is not really much better.
I don't have much opinion about pc110pad.c change. It's essentially
still the same kludge, which has been there at least since the
beginning of git history.
Dmitry, if you want to ack this, I can take both together.
Bjorn
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices
2026-04-06 17:23 ` Bjorn Helgaas
@ 2026-04-06 19:02 ` Dmitry Torokhov
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2026-04-06 19:02 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Heiner Kallweit, Bjorn Helgaas, open list:HID CORE LAYER,
linux-pci@vger.kernel.org
On Mon, Apr 06, 2026 at 12:23:24PM -0500, Bjorn Helgaas wrote:
> On Fri, Apr 03, 2026 at 12:17:35AM +0200, Heiner Kallweit wrote:
> > As a prerequisite for removing no_pci_devices(), replace its usage here
> > with an equivalent check for presence of a PCI bus.
> >
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> > ---
> > drivers/input/mouse/pc110pad.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
> > index efa58049f..c7a6df210 100644
> > --- a/drivers/input/mouse/pc110pad.c
> > +++ b/drivers/input/mouse/pc110pad.c
> > @@ -91,7 +91,7 @@ static int __init pc110pad_init(void)
> > {
> > int err;
> >
> > - if (!no_pci_devices())
> > + if (pci_find_next_bus(NULL))
> > return -ENODEV;
>
> I'd certainly love to get rid of no_pci_devices(), although using
> pci_find_next_bus() is not really much better.
>
> I don't have much opinion about pc110pad.c change. It's essentially
> still the same kludge, which has been there at least since the
> beginning of git history.
>
> Dmitry, if you want to ack this, I can take both together.
Given "x86/cpu: Remove M486/M486SX/ELAN support" I'd just drop the
driver completely.
I tried it in 2024 but Maciej was insistent that keeping these old
drivers doe snot hurt. Now I think we can get rid of them.
You can grab the patch removing it from
https://lore.kernel.org/all/20240808172733.1194442-4-dmitry.torokhov@gmail.com/
as I think it should still apply.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] PCI: Remove no_pci_devices
2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit
@ 2026-04-07 19:48 ` Bjorn Helgaas
2026-04-10 14:13 ` Maciej W. Rozycki
2 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2026-04-07 19:48 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Dmitry Torokhov, Bjorn Helgaas, open list:HID CORE LAYER,
linux-pci@vger.kernel.org, Maciej W. Rozycki
[+cc Maciej]
On Fri, Apr 03, 2026 at 12:15:34AM +0200, Heiner Kallweit wrote:
> Remove the last user of no_pci_devices(), and then the function itself.
>
> Heiner Kallweit (2):
> input: pc110pad: change PCI check to get rid of orphaned
> no_pci_devices
> PCI: Remove no_pci_devices
Applied Dmitry's patch to remove pc110pad and your patch to remove
no_pci_devices() to pci/enumeration for v7.1, thanks!
> drivers/input/mouse/pc110pad.c | 2 +-
> drivers/pci/probe.c | 17 -----------------
> include/linux/pci.h | 3 ---
> 3 files changed, 1 insertion(+), 21 deletions(-)
>
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] PCI: Remove no_pci_devices
2026-04-07 19:48 ` [PATCH 0/2] " Bjorn Helgaas
@ 2026-04-10 14:13 ` Maciej W. Rozycki
0 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2026-04-10 14:13 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Heiner Kallweit, Dmitry Torokhov, Bjorn Helgaas,
open list:HID CORE LAYER, linux-pci@vger.kernel.org
On Tue, 7 Apr 2026, Bjorn Helgaas wrote:
> [+cc Maciej]
>
> On Fri, Apr 03, 2026 at 12:15:34AM +0200, Heiner Kallweit wrote:
> > Remove the last user of no_pci_devices(), and then the function itself.
> >
> > Heiner Kallweit (2):
> > input: pc110pad: change PCI check to get rid of orphaned
> > no_pci_devices
> > PCI: Remove no_pci_devices
>
> Applied Dmitry's patch to remove pc110pad and your patch to remove
> no_pci_devices() to pci/enumeration for v7.1, thanks!
What can I say?
This:
static int pc110pad_io = 0x15e0;
seems to be a reasonably safe location in the PC/AT architecture to poke
at blindly, especially while guarded with request_region(). Ralf Brown's
"Ports List" doesn't list anything at location 0x1e0 modulo 0x400, and for
PCI/e we never assign locations 0x100-0x300 modulo 0x400 anyway. With PCI
systems featuring a southbridge ISA is subtractively decoded, so unclaimed
accesses will simply time out.
There could be an issue though with preventing the claimed IRQ from being
used for a legitimate device, and the call to no_pci_devices() only pushes
the problem to non-PCI systems. Poking at the handshake port and checking
for it being fixed at all-ones might be a way to figure out whether there
is anything actually wired there.
Overall this seems a case for a platform device, but these are hard to
wire in arch/x86 given how the platform has evolved. I imagine there's no
way to probe for a PC-110 system, as back in the day stuff used to rely on
manual configuration, though there could be a vendor BIOS call available
for guesswork. A kernel parameter to tell the various odd systems apart
would IMHO be a reasonable approach if this part of the kernel were being
implemented now.
Then I have nothing to say as to the removal of the driver itself; if I
do manage to find time to revive 486 support via emulation as I outlined
last year, then whoever wants the driver they can bring it back too; it's
not like the most complex piece of code I've ever seen.
Thanks for looping me in.
Maciej
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-04-10 14:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02 22:15 [PATCH 0/2] PCI: Remove no_pci_devices Heiner Kallweit
2026-04-02 22:17 ` [PATCH 1/2] input: pc110pad: change PCI check to get rid of orphaned no_pci_devices Heiner Kallweit
2026-04-06 17:23 ` Bjorn Helgaas
2026-04-06 19:02 ` Dmitry Torokhov
2026-04-02 22:18 ` [PATCH 2/2] PCI: Remove no_pci_devices Heiner Kallweit
2026-04-07 19:48 ` [PATCH 0/2] " Bjorn Helgaas
2026-04-10 14:13 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox