Skip to content

Commit cf52ad5

Browse files
committed
Merge tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here are some small driver core fixes for 5.15-rc6, all of which have been in linux-next for a while with no reported issues. They include: - kernfs negative dentry bugfix - simple pm bus fixes to resolve reported issues" * tag 'driver-core-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: drivers: bus: Delete CONFIG_SIMPLE_PM_BUS drivers: bus: simple-pm-bus: Add support for probing simple bus only devices driver core: Reject pointless SYNC_STATE_ONLY device links kernfs: don't create a negative dentry if inactive node exists
2 parents e3572df + 81967ef commit cf52ad5

11 files changed

Lines changed: 50 additions & 24 deletions

File tree

arch/arm/configs/multi_v7_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ CONFIG_PCI_EPF_TEST=m
197197
CONFIG_DEVTMPFS=y
198198
CONFIG_DEVTMPFS_MOUNT=y
199199
CONFIG_OMAP_OCP2SCP=y
200-
CONFIG_SIMPLE_PM_BUS=y
201200
CONFIG_MTD=y
202201
CONFIG_MTD_CMDLINE_PARTS=y
203202
CONFIG_MTD_BLOCK=y

arch/arm/configs/oxnas_v6_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ CONFIG_DEVTMPFS=y
4646
CONFIG_DEVTMPFS_MOUNT=y
4747
CONFIG_DMA_CMA=y
4848
CONFIG_CMA_SIZE_MBYTES=64
49-
CONFIG_SIMPLE_PM_BUS=y
5049
CONFIG_MTD=y
5150
CONFIG_MTD_CMDLINE_PARTS=y
5251
CONFIG_MTD_BLOCK=y

arch/arm/configs/shmobile_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ CONFIG_PCI_RCAR_GEN2=y
4040
CONFIG_PCIE_RCAR_HOST=y
4141
CONFIG_DEVTMPFS=y
4242
CONFIG_DEVTMPFS_MOUNT=y
43-
CONFIG_SIMPLE_PM_BUS=y
4443
CONFIG_MTD=y
4544
CONFIG_MTD_BLOCK=y
4645
CONFIG_MTD_CFI=y

arch/arm/mach-omap2/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ config ARCH_OMAP2PLUS
112112
select PM_GENERIC_DOMAINS
113113
select PM_GENERIC_DOMAINS_OF
114114
select RESET_CONTROLLER
115-
select SIMPLE_PM_BUS
116115
select SOC_BUS
117116
select TI_SYSC
118117
select OMAP_IRQCHIP

arch/arm64/configs/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ CONFIG_DEVTMPFS_MOUNT=y
245245
CONFIG_FW_LOADER_USER_HELPER=y
246246
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
247247
CONFIG_HISILICON_LPC=y
248-
CONFIG_SIMPLE_PM_BUS=y
249248
CONFIG_FSL_MC_BUS=y
250249
CONFIG_TEGRA_ACONNECT=m
251250
CONFIG_GNSS=m

drivers/base/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ struct device_link *device_link_add(struct device *consumer,
687687
{
688688
struct device_link *link;
689689

690-
if (!consumer || !supplier || flags & ~DL_ADD_VALID_FLAGS ||
690+
if (!consumer || !supplier || consumer == supplier ||
691+
flags & ~DL_ADD_VALID_FLAGS ||
691692
(flags & DL_FLAG_STATELESS && flags & DL_MANAGED_LINK_FLAGS) ||
692693
(flags & DL_FLAG_SYNC_STATE_ONLY &&
693694
(flags & ~DL_FLAG_INFERRED) != DL_FLAG_SYNC_STATE_ONLY) ||

drivers/bus/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,6 @@ config QCOM_EBI2
152152
Interface 2, which can be used to connect things like NAND Flash,
153153
SRAM, ethernet adapters, FPGAs and LCD displays.
154154

155-
config SIMPLE_PM_BUS
156-
tristate "Simple Power-Managed Bus Driver"
157-
depends on OF && PM
158-
help
159-
Driver for transparent busses that don't need a real driver, but
160-
where the bus controller is part of a PM domain, or under the control
161-
of a functional clock, and thus relies on runtime PM for managing
162-
this PM domain and/or clock.
163-
An example of such a bus controller is the Renesas Bus State
164-
Controller (BSC, sometimes called "LBSC within Bus Bridge", or
165-
"External Bus Interface") as found on several Renesas ARM SoCs.
166-
167155
config SUN50I_DE2_BUS
168156
bool "Allwinner A64 DE2 Bus Driver"
169157
default ARM64

drivers/bus/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o
2727
obj-$(CONFIG_QCOM_EBI2) += qcom-ebi2.o
2828
obj-$(CONFIG_SUN50I_DE2_BUS) += sun50i-de2.o
2929
obj-$(CONFIG_SUNXI_RSB) += sunxi-rsb.o
30-
obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o
30+
obj-$(CONFIG_OF) += simple-pm-bus.o
3131
obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o
3232
obj-$(CONFIG_TEGRA_GMI) += tegra-gmi.o
3333
obj-$(CONFIG_TI_PWMSS) += ti-pwmss.o

drivers/bus/simple-pm-bus.c

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,36 @@
1313
#include <linux/platform_device.h>
1414
#include <linux/pm_runtime.h>
1515

16-
1716
static int simple_pm_bus_probe(struct platform_device *pdev)
1817
{
19-
const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev);
20-
struct device_node *np = pdev->dev.of_node;
18+
const struct device *dev = &pdev->dev;
19+
const struct of_dev_auxdata *lookup = dev_get_platdata(dev);
20+
struct device_node *np = dev->of_node;
21+
const struct of_device_id *match;
22+
23+
/*
24+
* Allow user to use driver_override to bind this driver to a
25+
* transparent bus device which has a different compatible string
26+
* that's not listed in simple_pm_bus_of_match. We don't want to do any
27+
* of the simple-pm-bus tasks for these devices, so return early.
28+
*/
29+
if (pdev->driver_override)
30+
return 0;
31+
32+
match = of_match_device(dev->driver->of_match_table, dev);
33+
/*
34+
* These are transparent bus devices (not simple-pm-bus matches) that
35+
* have their child nodes populated automatically. So, don't need to
36+
* do anything more. We only match with the device if this driver is
37+
* the most specific match because we don't want to incorrectly bind to
38+
* a device that has a more specific driver.
39+
*/
40+
if (match && match->data) {
41+
if (of_property_match_string(np, "compatible", match->compatible) == 0)
42+
return 0;
43+
else
44+
return -ENODEV;
45+
}
2146

2247
dev_dbg(&pdev->dev, "%s\n", __func__);
2348

@@ -31,14 +56,25 @@ static int simple_pm_bus_probe(struct platform_device *pdev)
3156

3257
static int simple_pm_bus_remove(struct platform_device *pdev)
3358
{
59+
const void *data = of_device_get_match_data(&pdev->dev);
60+
61+
if (pdev->driver_override || data)
62+
return 0;
63+
3464
dev_dbg(&pdev->dev, "%s\n", __func__);
3565

3666
pm_runtime_disable(&pdev->dev);
3767
return 0;
3868
}
3969

70+
#define ONLY_BUS ((void *) 1) /* Match if the device is only a bus. */
71+
4072
static const struct of_device_id simple_pm_bus_of_match[] = {
4173
{ .compatible = "simple-pm-bus", },
74+
{ .compatible = "simple-bus", .data = ONLY_BUS },
75+
{ .compatible = "simple-mfd", .data = ONLY_BUS },
76+
{ .compatible = "isa", .data = ONLY_BUS },
77+
{ .compatible = "arm,amba-bus", .data = ONLY_BUS },
4278
{ /* sentinel */ }
4379
};
4480
MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match);

drivers/soc/canaan/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ config SOC_K210_SYSCTL
55
depends on RISCV && SOC_CANAAN && OF
66
default SOC_CANAAN
77
select PM
8-
select SIMPLE_PM_BUS
98
select SYSCON
109
select MFD_SYSCON
1110
help

0 commit comments

Comments
 (0)