2021-09-27 14:02:00

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: [PATCH 10/17] ABI: sysfs-bus-pci: add a alternative What fields

There are some PCI ABI that aren't shown under:

/sys/bus/pci/drivers/.../

Because they're registered with a different class. That's
the case of, for instance:

/sys/bus/i2c/drivers/CHT Whiskey Cove PMIC/unbind

This one is not present under /sys/bus/pci:

$ find /sys/bus/pci -name 'CHT Whiskey Cove PMIC'

Although clearly this is provided by a PCI driver:

/sys/devices/pci0000:00/0000:00:02.0/i2c-4/subsystem/drivers/CHT Whiskey Cove PMIC/unbind

So, add an altertate What location in order to match bind/unbind
to such devices.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---

See [PATCH 00/17] at: https://lore.kernel.org/all/[email protected]/

Documentation/ABI/testing/sysfs-bus-pci | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
index 1eeac7f59672..16afe3f59cbd 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -1,4 +1,5 @@
What: /sys/bus/pci/drivers/.../bind
+What: /sys/devices/pciX/.../bind
Date: December 2003
Contact: [email protected]
Description:
@@ -14,6 +15,7 @@ Description:
(Note: kernels before 2.6.28 may require echo -n).

What: /sys/bus/pci/drivers/.../unbind
+What: /sys/devices/pciX/.../unbind
Date: December 2003
Contact: [email protected]
Description:
@@ -29,6 +31,7 @@ Description:
(Note: kernels before 2.6.28 may require echo -n).

What: /sys/bus/pci/drivers/.../new_id
+What: /sys/devices/pciX/.../new_id
Date: December 2003
Contact: [email protected]
Description:
@@ -47,6 +50,7 @@ Description:
# echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id

What: /sys/bus/pci/drivers/.../remove_id
+What: /sys/devices/pciX/.../remove_id
Date: February 2009
Contact: Chris Wright <[email protected]>
Description:
--
2.31.1


2021-09-28 18:35:12

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 10/17] ABI: sysfs-bus-pci: add a alternative What fields

Probably already queued up, but:

s/add a alternative/add alternative/ (in subject)

On Mon, Sep 27, 2021 at 03:59:43PM +0200, Mauro Carvalho Chehab wrote:
> There are some PCI ABI that aren't shown under:
>
> /sys/bus/pci/drivers/.../
>
> Because they're registered with a different class. That's
> the case of, for instance:
>
> /sys/bus/i2c/drivers/CHT Whiskey Cove PMIC/unbind
>
> This one is not present under /sys/bus/pci:
>
> $ find /sys/bus/pci -name 'CHT Whiskey Cove PMIC'
>
> Although clearly this is provided by a PCI driver:
>
> /sys/devices/pci0000:00/0000:00:02.0/i2c-4/subsystem/drivers/CHT Whiskey Cove PMIC/unbind
>
> So, add an altertate What location in order to match bind/unbind
> to such devices.

s/altertate/alternate/

> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
>
> See [PATCH 00/17] at: https://lore.kernel.org/all/[email protected]/
>
> Documentation/ABI/testing/sysfs-bus-pci | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
> index 1eeac7f59672..16afe3f59cbd 100644
> --- a/Documentation/ABI/testing/sysfs-bus-pci
> +++ b/Documentation/ABI/testing/sysfs-bus-pci
> @@ -1,4 +1,5 @@
> What: /sys/bus/pci/drivers/.../bind
> +What: /sys/devices/pciX/.../bind

Wasn't somebody just updating these wildcard-ish items in pathnames?

Ah, it was you :)

https://lore.kernel.org/all/4ede4ec98e295f054f3e5a6f3f9393b5e3d5d2a7.1631782432.git.mchehab+huawei@kernel.org/

Changing "virtfnN" to "virtfn<N>".

Is that same sort of thing applicable here? My system has

/sys/devices/pci0000:00/...

Bjorn

2021-09-28 22:08:54

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 10/17] ABI: sysfs-bus-pci: add a alternative What fields

Em Tue, 28 Sep 2021 13:34:03 -0500
Bjorn Helgaas <[email protected]> escreveu:

> > diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
> > index 1eeac7f59672..16afe3f59cbd 100644
> > --- a/Documentation/ABI/testing/sysfs-bus-pci
> > +++ b/Documentation/ABI/testing/sysfs-bus-pci
> > @@ -1,4 +1,5 @@
> > What: /sys/bus/pci/drivers/.../bind
> > +What: /sys/devices/pciX/.../bind
>
> Wasn't somebody just updating these wildcard-ish items in pathnames?
>
> Ah, it was you :)
>
> https://lore.kernel.org/all/4ede4ec98e295f054f3e5a6f3f9393b5e3d5d2a7.1631782432.git.mchehab+huawei@kernel.org/
>
> Changing "virtfnN" to "virtfn<N>".
>
> Is that same sort of thing applicable here? My system has
>
> /sys/devices/pci0000:00/...

Yes and no ;-)

See, there are lots of places under Documentation/ABI that already use
X, Y and Z uppercase letters to identify wildcards. As there aren't any
sysfs entries that have those uppercase letters, I opted to teach the
get_abi.pl script to threat such uppercase chars as wildcards. The same
can't be done with N, because the USB subsystem (and a couple of other
ABIs) use uppercase N as valid symbols like "bNum.*".

Long term, one alternative would be to replace the What fields by a
regular expressions on ABI. That would avoid some magic inside
get_abi.pl. However, a change like that would require touching almost
all files, and has a drawback to make them more obscure - even
if we use named group regexes.

Thanks,
Mauro