Greg Kroah-Hartman
9d11b13402
USB: mark all struct bus_type as const
...
Now that the driver core can properly handle constant struct bus_type,
move all of the USB subsystem struct bus_type structures as const,
placing them into read-only memory which can not be modified at runtime.
Cc: Johan Hovold <johan@kernel.org >
Cc: Evan Green <evgreen@chromium.org >
Cc: Alan Stern <stern@rowland.harvard.edu >
Cc: linux-usb@vger.kernel.org
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-36-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:22:00 +01:00
Greg Kroah-Hartman
d492cc2573
driver core: device.h: make struct bus_type a const *
...
Now that all users who accessed the bus_type structure in struct device
are properly using it as a const *, mark it as such so that no one can
modify it going forward anymore.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-35-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:58 +01:00
Greg Kroah-Hartman
b18d0a0f92
iommu: make the pointer to struct bus_type constant
...
A number of iommu functions take a struct bus_type * and never modify
the data passed in, so make them all const * as that is what the driver
core is expecting to have passed into as well.
This is a step toward making all struct bus_type pointers constant in
the kernel.
Cc: Will Deacon <will@kernel.org >
Cc: Robin Murphy <robin.murphy@arm.com >
Cc: iommu@lists.linux.dev
Acked-by: Joerg Roedel <jroedel@suse.de >
Link: https://lore.kernel.org/r/20230313182918.1312597-34-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:54 +01:00
Greg Kroah-Hartman
a3ea9fbc82
ARM/dma-mapping: const a pointer to bus_type in arm_iommu_create_mapping()
...
Change the function arm_iommu_create_mapping() to take a pointer to a
const bus_type as the function does not modify the variable the pointer
points to at all, and the driver core bus functions it calls all expect
a const * type.
Cc: Russell King <linux@armlinux.org.uk >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Robin Murphy <robin.murphy@arm.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com >
Cc: Ben Dooks <ben-linux@fluff.org >
Cc: Linus Walleij <linus.walleij@linaro.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230313182918.1312597-33-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:51 +01:00
Greg Kroah-Hartman
790f3b60ac
dmaengine: idxd: use const struct bus_type *
...
In the functions unbind_store() and bind_store(), a struct bus_type *
should be a const one, as the driver core bus functions used by this
variable are expecting the pointer to be constant, and these functions
do not modify the pointer at all.
Cc: dmaengine@vger.kernel.org
Acked-by: Vinod Koul <vkoul@kernel.org >
Acked-by: Fenghua Yu <fenghua.yu@intel.com >
Acked-by: Dave Jiang <dave.jiang@intel.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-32-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:42 +01:00
Greg Kroah-Hartman
94a1150421
vhost-vdpa: vhost_vdpa_alloc_domain() should be using a const struct bus_type *
...
The function, vhost_vdpa_alloc_domain(), has a pointer to a struct
bus_type, but it should be constant as the function it passes it to
expects it to be const, and the vhost code does not modify it in any
way.
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Jason Wang <jasowang@redhat.com >
Cc: kvm@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Link: https://lore.kernel.org/r/20230313182918.1312597-31-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:38 +01:00
Greg Kroah-Hartman
c9a9f18d3a
drm/i915/huc: use const struct bus_type pointers
...
The struct bus_type pointers in the functions
intel_huc_register_gsc_notifier() and
intel_huc_unregister_gsc_notifier() should be a const pointer, as the
structure is not modified anywhere in the functions, and the pointer
they are passed will be a const * in the near future.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Alan Previn <alan.previn.teres.alexis@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Tony Ye <tony.ye@intel.com >
Cc: Vitaly Lubart <vitaly.lubart@intel.com >
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-30-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:30 +01:00
Greg Kroah-Hartman
550fac229e
crypto: hisilicon/qm - make struct bus_type * const
...
In the function, qm_get_qos_value(), a struct bus_type * is used, but it
really should be a const pointer as it is not modified anywhere in the
function, and the driver core function it is used in expects a constant
pointer.
Cc: Weili Qian <qianweili@huawei.com >
Cc: Zhou Wang <wangzhou1@hisilicon.com >
Cc: Herbert Xu <herbert@gondor.apana.org.au >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: linux-crypto@vger.kernel.org
Acked-by: Herbert Xu <herbert@gondor.apana.org.au >
Link: https://lore.kernel.org/r/20230313182918.1312597-29-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:28 +01:00
Greg Kroah-Hartman
c28dd08ef7
driver core: make the bus_type in struct device_driver constant
...
The pointer to struct bus_type in struct device_driver should only be
pointing to something that can never change now that the driver core has
fixed up the previously writable fields. So mark it as a constant
pointer to enforce this and move forward with the goal of moving
bus_type into read-only memory.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-28-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:26 +01:00
Greg Kroah-Hartman
38370c4e25
driver core: bus: constify bus_get()
...
It's funny to think about getting a reference count of a constant
structure pointer, but this locks into place the private data
"underneath" the struct bus_type() which is important to not go away
while we are working with the bus structure for some callbacks.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-27-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:24 +01:00
Greg Kroah-Hartman
7c06be0425
driver core: bus: constify driver_find()
...
The driver_find() function can now take a const * to bus_type, not just
a * so fix that up.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-26-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:22 +01:00
Greg Kroah-Hartman
9622b9f282
driver core: bus: constify bus_rescan_devices()
...
The bus_rescan_devices() function was missed in the previous change of
the bus_for_each* constant pointer changes, so fix it up now to take a
const * to struct bus_type.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-25-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:20 +01:00
Greg Kroah-Hartman
00c4a3c47d
driver core: bus: constantify bus_register()
...
bus_register() is now safe to take a constant * to bus_type, so make
that change and mark the subsys_private bus_type * constant as well.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-24-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:21:17 +01:00
Greg Kroah-Hartman
75cff725d9
driver core: bus: mark the struct bus_type for sysfs callbacks as constant
...
struct bus_type should never be modified in a sysfs callback as there is
nothing in the structure to modify, and frankly, the structure is almost
never used in a sysfs callback, so mark it as constant to allow struct
bus_type to be moved to read-only memory.
Cc: "David S. Miller" <davem@davemloft.net >
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "K. Y. Srinivasan" <kys@microsoft.com >
Cc: Alexander Gordeev <agordeev@linux.ibm.com >
Cc: Alexandre Bounine <alex.bou9@gmail.com >
Cc: Alison Schofield <alison.schofield@intel.com >
Cc: Ben Widawsky <bwidawsk@kernel.org >
Cc: Dexuan Cui <decui@microsoft.com >
Cc: Eric Dumazet <edumazet@google.com >
Cc: Haiyang Zhang <haiyangz@microsoft.com >
Cc: Hannes Reinecke <hare@suse.de >
Cc: Harald Freudenberger <freude@linux.ibm.com >
Cc: Heiko Carstens <hca@linux.ibm.com >
Cc: Hu Haowen <src.res@email.cn >
Cc: Jakub Kicinski <kuba@kernel.org >
Cc: Jens Axboe <axboe@kernel.dk >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com >
Cc: Matt Porter <mporter@kernel.crashing.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paolo Abeni <pabeni@redhat.com >
Cc: Stuart Yoder <stuyoder@gmail.com >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vishal Verma <vishal.l.verma@intel.com >
Cc: Yanteng Si <siyanteng@loongson.cn >
Acked-by: Ilya Dryomov <idryomov@gmail.com > # rbd
Acked-by: Ira Weiny <ira.weiny@intel.com > # cxl
Reviewed-by: Alex Shi <alexs@kernel.org >
Acked-by: Iwona Winiarska <iwona.winiarska@intel.com >
Acked-by: Dan Williams <dan.j.williams@intel.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com > # pci
Acked-by: Wei Liu <wei.liu@kernel.org >
Acked-by: Martin K. Petersen <martin.petersen@oracle.com > # scsi
Link: https://lore.kernel.org/r/20230313182918.1312597-23-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:20:40 +01:00
Greg Kroah-Hartman
9cc61e5fbd
driver core: bus: move dev_root out of struct bus_type
...
Now that all accesses of dev_root is through the bus_get_dev_root()
call, move the pointer out of struct bus_type and into the private
dynamic structure, subsys_private.
With this change, there is no modifiable portions of struct bus_type so
it can be marked as a constant structure and moved to read-only memory.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-22-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-23 13:20:36 +01:00
Greg Kroah-Hartman
bf6479dbe7
cpuidle: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
This allows us to clean up the cpuidle_add_interface() call a bit as it
was only called in one place, with the same argument so just put that
into the function itself. Note that cpuidle_remove_interface() should
also probably be removed in the future as there are no callers of it for
some reason.
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: linux-pm@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230322090557.2943479-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-22 20:25:23 +01:00
Greg Kroah-Hartman
af48ab8b39
ACPI: LPIT: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Len Brown <lenb@kernel.org >
Cc: linux-acpi@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
Link: https://lore.kernel.org/r/20230322083646.2937580-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-22 20:25:18 +01:00
Greg Kroah-Hartman
cb4a0bec0b
EDAC/sysfs: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Borislav Petkov <bp@alien8.de >
Cc: Tony Luck <tony.luck@intel.com >
Cc: James Morse <james.morse@arm.com >
Cc: Mauro Carvalho Chehab <mchehab@kernel.org >
Cc: Robert Richter <rric@kernel.org >
Cc: linux-edac@vger.kernel.org
Link: https://lore.kernel.org/r/20230313182918.1312597-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-22 09:25:49 +01:00
Harshit Mogalapalli
6b301ded45
tpm: Fix a possible dereference of ERR_PTR in tpm_init()
...
Smatch reports:
drivers/char/tpm/tpm-interface.c:470 tpm_init() error:
'tpm_class' dereferencing possible ERR_PTR()
If class_create() returns error pointer, we are dereferencing a possible
error pointer. Fix this by moving the dereference post error handling.
Fixes: a010eb8812 ("tpm: fix up the tpm_class shutdown_pre pointer when created")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com >
Link: https://lore.kernel.org/r/20230321061416.626561-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-21 09:00:08 +01:00
Greg Kroah-Hartman
fea087fc29
irqchip/mbigen: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Marc Zyngier <maz@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-21-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:30:12 +01:00
Greg Kroah-Hartman
3666062b87
cpufreq: amd-pstate: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
In doing so, remove the unneded kobject structure that was only being
created to cause a subdirectory for the attributes. The name of the
attribute group is the correct way to do this, saving code and
complexity as well as allowing the attributes to properly show up to
userspace tools (the raw kobject would not allow that.)
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Viresh Kumar <viresh.kumar@linaro.org >
Cc: linux-pm@vger.kernel.org
Acked-by: Huang Rui <ray.huang@.amd.com>
Link: https://lore.kernel.org/r/20230313182918.1312597-20-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:30:07 +01:00
Greg Kroah-Hartman
31e7c4cc7d
s390/smp: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Alexander Gordeev <agordeev@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@linux.ibm.com >
Cc: Sven Schnelle <svens@linux.ibm.com >
Cc: Ilya Leoshkevich <iii@linux.ibm.com >
Cc: linux-s390@vger.kernel.org
Acked-by: Heiko Carstens <hca@linux.ibm.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-19-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:30:03 +01:00
Greg Kroah-Hartman
9493ed19fb
s390/topology: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Alexander Gordeev <agordeev@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@linux.ibm.com >
Cc: Sven Schnelle <svens@linux.ibm.com >
Cc: linux-s390@vger.kernel.org
Acked-by: Heiko Carstens <hca@linux.ibm.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-18-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:59 +01:00
Greg Kroah-Hartman
93c42c0b03
sh: intc: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Cc: Rich Felker <dalias@libc.org >
Cc: linux-sh@vger.kernel.org
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de >
Link: https://lore.kernel.org/r/20230313182918.1312597-17-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:55 +01:00
Greg Kroah-Hartman
f6d1975cd2
sh: dma-sysfs: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Cc: Rich Felker <dalias@libc.org >
Cc: linux-sh@vger.kernel.org
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de >
Link: https://lore.kernel.org/r/20230313182918.1312597-16-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:51 +01:00
Greg Kroah-Hartman
c93bd17541
powerpc/fsl: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Nicholas Piggin <npiggin@gmail.com >
Cc: Christophe Leroy <christophe.leroy@csgroup.eu >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230313182918.1312597-15-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:47 +01:00
Greg Kroah-Hartman
2a9efef852
powerpc/pseries: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Nicholas Piggin <npiggin@gmail.com >
Cc: Christophe Leroy <christophe.leroy@csgroup.eu >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: linuxppc-dev@lists.ozlabs.org
Acked-by: Michael Ellerman <mpe@ellerman.id.au > (powerpc)
Link: https://lore.kernel.org/r/20230313182918.1312597-14-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:38 +01:00
Greg Kroah-Hartman
3bf88c4222
powerpc/powernv: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Nicholas Piggin <npiggin@gmail.com >
Cc: Christophe Leroy <christophe.leroy@csgroup.eu >
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com >
Cc: Joel Stanley <joel@jms.id.au >
Cc: Liang He <windhl@126.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230313182918.1312597-13-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:36 +01:00
Greg Kroah-Hartman
1b40189691
powerpc/sysfs: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Nicholas Piggin <npiggin@gmail.com >
Cc: Christophe Leroy <christophe.leroy@csgroup.eu >
Cc: David Hildenbrand <david@redhat.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230313182918.1312597-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:34 +01:00
Greg Kroah-Hartman
cb6b0cba1e
arm64: cpufeature: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Will Deacon <will@kernel.org >
Cc: Mark Brown <broonie@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Kristina Martsenko <kristina.martsenko@arm.com >
Cc: Marc Zyngier <maz@kernel.org >
Cc: Ard Biesheuvel <ardb@kernel.org >
Cc: Vladimir Murzin <vladimir.murzin@arm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230313182918.1312597-11-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:31 +01:00
Greg Kroah-Hartman
60260272dc
x86/umwait: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:29 +01:00
Greg Kroah-Hartman
216f58beb2
x86/microcode: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Borislav Petkov <bp@alien8.de >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:26 +01:00
Greg Kroah-Hartman
686f669780
workqueue: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Lai Jiangshan <jiangshanlai@gmail.com >
Acked-by: Tejun Heo <tj@kernel.org >
Link: https://lore.kernel.org/r/20230313182918.1312597-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:23 +01:00
Greg Kroah-Hartman
db281d59e2
cpu/hotplug: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Valentin Schneider <vschneid@redhat.com >
Cc: Phil Auld <pauld@redhat.com >
Cc: Steven Price <steven.price@arm.com >
Cc: Juri Lelli <juri.lelli@redhat.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Vincent Donnefort <vdonnefort@google.com >
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com >
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:19 +01:00
Greg Kroah-Hartman
c8e15075b2
platform/x86: intel-uncore-freq: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Mark Gross <markgross@kernel.org >
Cc: platform-driver-x86@vger.kernel.org
Acked-by: Hans de Goede <hdegoede@redhat.com >
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:12 +01:00
Greg Kroah-Hartman
6644a426eb
platform/x86: ibm_rtl: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Mark Gross <markgross@kernel.org >
Cc: platform-driver-x86@vger.kernel.org
Acked-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:06 +01:00
Greg Kroah-Hartman
2744a63c1a
cpufreq: move to use bus_get_dev_root()
...
Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.
Cc: Viresh Kumar <viresh.kumar@linaro.org >
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Cc: Len Brown <lenb@kernel.org >
Cc: linux-pm@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
Link: https://lore.kernel.org/r/20230313182918.1312597-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:29:01 +01:00
Phil Auld
34320745df
sched/debug: Put sched/domains files under the verbose flag
...
The debug files under sched/domains can take a long time to regenerate,
especially when updates are done one at a time. Move these files under
the sched verbose debug flag. Allow changes to verbose to trigger
generation of the files. This lets a user batch the updates but still
have the information available. The detailed topology printk messages
are also under verbose.
Discussion that lead to this approach can be found in the link below.
Simplified code to maintain use of debugfs bool routines suggested by
Michael Ellerman <mpe@ellerman.id.au >.
Signed-off-by: Phil Auld <pauld@redhat.com >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Reviewed-by: Valentin Schneider <vschneid@redhat.com >
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Tested-by: Vishal Chourasia <vishalc@linux.vnet.ibm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Peter Zijlstra (Intel) <peterz@infradead.org >
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Cc: Valentin Schneider <vschneid@redhat.com >
Cc: Vishal Chourasia <vishalc@linux.vnet.ibm.com >
Cc: Vincent Guittot <vincent.guittot@linaro.org >
Link: https://lore.kernel.org/all/Y01UWQL2y2r69sBX@li-05afa54c-330e-11b2-a85c-e3f3aa0db1e9.ibm.com/
Link: https://lore.kernel.org/r/20230303183754.3076321-1-pauld@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:24:19 +01:00
Greg Kroah-Hartman
2bd5c63978
driver core: device: make device_create*() take a const struct class *
...
The functions device_create() and device_create_with_groups() do not
modify the struct class passed into it, so enforce this by changing the
function parameters to be struct const class.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:50 +01:00
Greg Kroah-Hartman
9fa120fbd5
driver core: device: mark struct class in struct device as constant
...
The pointer to a struct class in a struct device should never be used to
change anything in that class. So mark it as constant to enforce this
requirement.
This requires a few minor changes to some internal driver core functions
to enforce the const * being used here now.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-11-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:48 +01:00
Greg Kroah-Hartman
a010eb8812
tpm: fix up the tpm_class shutdown_pre pointer when created
...
Do not wait until long after the struct class has been created to set
the shutdown_pre pointer for the tpm_class, assign it right away.
This is the only in-kernel offender that tries to modify the
device->class pointer contents after it has been assigned to a device,
so fix that up by doing the function pointer assignment before it is
matched with the device. Because of this, the patch should go through
the driver core tree to allow later changes to struct device to be
possible.
Cc: Peter Huewe <peterhuewe@gmx.de >
Cc: Jarkko Sakkinen <jarkko@kernel.org >
Cc: Jason Gunthorpe <jgg@ziepe.ca >
Cc: linux-integrity@vger.kernel.org
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:45 +01:00
Greg Kroah-Hartman
d2fff09656
driver core: device: make device_destroy() take a const class *
...
device_destroy() does not modify the struct class passed into it, so
mark it as const to enforce this rule.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:43 +01:00
Greg Kroah-Hartman
80842a9290
driver core: class: make class_create/remove_file*() options const
...
The class_create_file*() and class_remove_file*() functions do not
modify the struct class at all, so mark them as const * to enforce that.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:41 +01:00
Greg Kroah-Hartman
cf41015ea8
driver core: class: make class_find_device*() options const
...
The class_find_device*() functions do not modify the struct class or the
struct device passed into it, so mark them as const * to enforce that.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:39 +01:00
Greg Kroah-Hartman
69df024ebb
driver core: class: make class_for_each_device() options const
...
class_for_each_device() does not modify the struct class or the struct
device passed into it, so mark them as const * to enforce that.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-6-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:37 +01:00
Greg Kroah-Hartman
a2fd6e42e4
driver core: class: make class_dev_iter_init() options const
...
class_dev_iter_init() does not modify the struct class or the struct
device passed into it, so mark them as const * to enforce that.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:35 +01:00
Greg Kroah-Hartman
1aaba11da9
driver core: class: remove module * from class_create()
...
The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com >
Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:33 +01:00
Greg Kroah-Hartman
6e30a66433
driver core: class: remove struct module owner out of struct class
...
The module owner field for a struct class was never actually used, so
remove it as it is not doing anything at all.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:30 +01:00
Greg Kroah-Hartman
10a03c36b7
drivers: remove struct module * setting from struct class
...
There is no need to manually set the owner of a struct class, as the
registering function does it automatically, so remove all of the
explicit settings from various drivers that did so as it is unneeded.
This allows us to remove this pointer entirely from this structure going
forward.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:27 +01:00
Greg Kroah-Hartman
4a46ac9d64
driver core: class: specify the module owner in __class_register()
...
There's no need to manually have to set the module owner of a class, the
compiler should do it automatically for you, so add a module * to the
__class_register() function and allow it to set the module owner
automatically.
This will let us move the module pointer out of struct class eventually,
as it should not be embedded in there if we wish for it to be a
read-only structure eventually.
And, funny story, this module pointer isn't even being used for
anything, so while we will keep it around for now, it's not like it even
matters.
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Link: https://lore.kernel.org/r/20230313181843.1207845-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-17 15:16:24 +01:00