2024-02-13 07:50:12

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH v2 0/5] powerpc: struct bus_type cleanup

This series is part of an effort to cleanup the users of the driver
core, as can be seen in many recent patches authored by Greg across the
tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have
no dependency. They were built using bootlin's without warnings using
powerpc64le-power8--glibc--stable-2023.11-1 toolchain.

---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22

Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>

---
Changes in v2:
- Added a new patch to make macio_bus_type const.
- Improved changelogs to remove the word "Now".
- Fixed a build error: https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Ricardo B. Marliere (5):
powerpc: vio: move device attributes into a new ifdef
powerpc: vio: make vio_bus_type const
powerpc: mpic: make mpic_subsys const
powerpc: pmac: make macio_bus_type const
powerpc: ibmebus: make ibmebus_bus_type const

arch/powerpc/include/asm/ibmebus.h | 2 +-
arch/powerpc/include/asm/macio.h | 2 +-
arch/powerpc/include/asm/mpic.h | 2 +-
arch/powerpc/include/asm/vio.h | 2 +-
arch/powerpc/platforms/pseries/ibmebus.c | 4 +--
arch/powerpc/platforms/pseries/vio.c | 61 ++++++++++++++++++--------------
arch/powerpc/sysdev/mpic.c | 2 +-
drivers/macintosh/macio_asic.c | 2 +-
8 files changed, 43 insertions(+), 34 deletions(-)
---
base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
change-id: 20240209-bus_cleanup-powerpc2-498426fccb98

Best regards,
--
Ricardo B. Marliere <[email protected]>



2024-02-13 07:51:22

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH v2 4/5] powerpc: pmac: make macio_bus_type const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the macio_bus_type variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Cc: Greg Kroah-Hartman <[email protected]>
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
---
arch/powerpc/include/asm/macio.h | 2 +-
drivers/macintosh/macio_asic.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h
index 3a07c62973aa..ab9608e63e40 100644
--- a/arch/powerpc/include/asm/macio.h
+++ b/arch/powerpc/include/asm/macio.h
@@ -6,7 +6,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>

-extern struct bus_type macio_bus_type;
+extern const struct bus_type macio_bus_type;

/* MacIO device driver is defined later */
struct macio_driver;
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index a5ee8f736a8e..565f1e21ff7d 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -136,7 +136,7 @@ static int macio_device_modalias(const struct device *dev, struct kobj_uevent_en

extern const struct attribute_group *macio_dev_groups[];

-struct bus_type macio_bus_type = {
+const struct bus_type macio_bus_type = {
.name = "macio",
.match = macio_bus_match,
.uevent = macio_device_modalias,

--
2.43.0


2024-02-13 08:05:22

by Christophe Leroy

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

Hi

Le 12/02/2024 à 21:04, Ricardo B. Marliere a écrit :
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have
> no dependency. They were built using bootlin's without warnings using
> powerpc64le-power8--glibc--stable-2023.11-1 toolchain.
>
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Signed-off-by: Ricardo B. Marliere <[email protected]>
>
> ---
> Changes in v2:
> - Added a new patch to make macio_bus_type const.
> - Improved changelogs to remove the word "Now".
> - Fixed a build error: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> - Link to v1: https://lore.kernel.org/r/[email protected]

I see another series with the same name, does this v2 also superseeds it
? https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=393570

Christophe

>
> ---
> Ricardo B. Marliere (5):
> powerpc: vio: move device attributes into a new ifdef
> powerpc: vio: make vio_bus_type const
> powerpc: mpic: make mpic_subsys const
> powerpc: pmac: make macio_bus_type const
> powerpc: ibmebus: make ibmebus_bus_type const
>
> arch/powerpc/include/asm/ibmebus.h | 2 +-
> arch/powerpc/include/asm/macio.h | 2 +-
> arch/powerpc/include/asm/mpic.h | 2 +-
> arch/powerpc/include/asm/vio.h | 2 +-
> arch/powerpc/platforms/pseries/ibmebus.c | 4 +--
> arch/powerpc/platforms/pseries/vio.c | 61 ++++++++++++++++++--------------
> arch/powerpc/sysdev/mpic.c | 2 +-
> drivers/macintosh/macio_asic.c | 2 +-
> 8 files changed, 43 insertions(+), 34 deletions(-)
> ---
> base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
> change-id: 20240209-bus_cleanup-powerpc2-498426fccb98
>
> Best regards,

2024-02-13 09:38:59

by Ricardo B. Marliere

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

Hi Christophe,

On 13 Feb 08:05, Christophe Leroy wrote:
> Hi
>
> Le 12/02/2024 à 21:04, Ricardo B. Marliere a écrit :
> > This series is part of an effort to cleanup the users of the driver
> > core, as can be seen in many recent patches authored by Greg across the
> > tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have
> > no dependency. They were built using bootlin's without warnings using
> > powerpc64le-power8--glibc--stable-2023.11-1 toolchain.
> >
> > ---
> > [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Signed-off-by: Ricardo B. Marliere <[email protected]>
> >
> > ---
> > Changes in v2:
> > - Added a new patch to make macio_bus_type const.
> > - Improved changelogs to remove the word "Now".
> > - Fixed a build error: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> > - Link to v1: https://lore.kernel.org/r/[email protected]
>
> I see another series with the same name, does this v2 also superseeds it
> ? https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=393570

Yes, please disregard the other one!

Thank you,
- Ricardo.


>
> Christophe
>
> >
> > ---
> > Ricardo B. Marliere (5):
> > powerpc: vio: move device attributes into a new ifdef
> > powerpc: vio: make vio_bus_type const
> > powerpc: mpic: make mpic_subsys const
> > powerpc: pmac: make macio_bus_type const
> > powerpc: ibmebus: make ibmebus_bus_type const
> >
> > arch/powerpc/include/asm/ibmebus.h | 2 +-
> > arch/powerpc/include/asm/macio.h | 2 +-
> > arch/powerpc/include/asm/mpic.h | 2 +-
> > arch/powerpc/include/asm/vio.h | 2 +-
> > arch/powerpc/platforms/pseries/ibmebus.c | 4 +--
> > arch/powerpc/platforms/pseries/vio.c | 61 ++++++++++++++++++--------------
> > arch/powerpc/sysdev/mpic.c | 2 +-
> > drivers/macintosh/macio_asic.c | 2 +-
> > 8 files changed, 43 insertions(+), 34 deletions(-)
> > ---
> > base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
> > change-id: 20240209-bus_cleanup-powerpc2-498426fccb98
> >
> > Best regards,

2024-02-13 11:07:58

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

On Mon, Feb 12, 2024 at 05:04:58PM -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have
> no dependency. They were built using bootlin's without warnings using
> powerpc64le-power8--glibc--stable-2023.11-1 toolchain.
>
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Signed-off-by: Ricardo B. Marliere <[email protected]>

Reviewed-by: Greg Kroah-Hartman <[email protected]>

2024-02-15 13:03:35

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

On Mon, 12 Feb 2024 17:04:58 -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have
> no dependency. They were built using bootlin's without warnings using
> powerpc64le-power8--glibc--stable-2023.11-1 toolchain.
>

Applied to powerpc/next.

[1/5] powerpc: vio: move device attributes into a new ifdef
https://git.kernel.org/powerpc/c/e15d01277a8bdacf8ac485049d21d450153fa47e
[2/5] powerpc: vio: make vio_bus_type const
https://git.kernel.org/powerpc/c/565206aaa6528b30df9294e9aafac429e4bc94eb
[3/5] powerpc: mpic: make mpic_subsys const
https://git.kernel.org/powerpc/c/8e3d0b8d99d708e8262e76313e0436339add80ec
[4/5] powerpc: pmac: make macio_bus_type const
https://git.kernel.org/powerpc/c/112202f34e56cd475e26b2a461dd856ca7570ef9
[5/5] powerpc: ibmebus: make ibmebus_bus_type const
https://git.kernel.org/powerpc/c/14ce0dbb562713bc058ad16d281db355757e6ec0

cheers