Skip to content

Commit 2a3e487

Browse files
committed
Merge tag 'omap-for-v5.11/fixes-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes
Fixes for omaps for v5.11-rc cycle The recent changes to switch SoCs to boot with ti-sysc interconnect target module driver and genpd caused few regressions: - The omap_prm reset driver needs to clear any reset bits deasserted by the bootloader or kexec boot for the three reset bit cases. Otherwise we can have an oops with accelerators starting to boot with potentially unconfigured MMU for example - Custom kernel configs are not automatically selecting simple-pm-bus driver that we now need to probe interconnects so we need to select it always - We are not passing legacy platform data in auxdata with simple-pm-bus like we do for simple-bus. We need to pass auxdata to simple-pm-bus so it can pass it to of_platform_populate() Then recent RCU changes started causing splats for cpuidle44xx that now need RCU_NONIDLE added to the calls in several places And then we have few device specific fixes: - We need to remove legacy spi-cs-hig for gta04 display to work, and set the gpio to active low - Omap1 specific ohci-omap needs to call gpio_free() - Droid4 needs to use padconf interrupt for the slider as the edge gpio interrupts may be lost for deeper idle states * tag 'omap-for-v5.11/fixes-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4-droid4: Fix lost keypad slide interrupts for droid4 drivers: bus: simple-pm-bus: Fix compatibility with simple-bus for auxdata ARM: OMAP2+: Fix booting for am335x after moving to simple-pm-bus ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled ARM: dts; gta04: SPI panel chip select is active low soc: ti: omap-prm: Fix boot time errors for rst_map_012 bits 0 and 1 ARM: OMAP1: OSK: fix ohci-omap breakage DTS: ARM: gta04: remove legacy spi-cs-high to make display work again Link: https://lore.kernel.org/r/pull-1611818709-243493@atomide.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 0821538 + 177d8f1 commit 2a3e487

8 files changed

Lines changed: 44 additions & 25 deletions

File tree

arch/arm/boot/dts/omap3-gta04.dtsi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
gpio-sck = <&gpio1 12 GPIO_ACTIVE_HIGH>;
115115
gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>;
116116
gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>;
117-
cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
117+
cs-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
118118
num-chipselects = <1>;
119119

120120
/* lcd panel */
@@ -124,7 +124,6 @@
124124
spi-max-frequency = <100000>;
125125
spi-cpol;
126126
spi-cpha;
127-
spi-cs-high;
128127

129128
backlight= <&backlight>;
130129
label = "lcd";

arch/arm/boot/dts/omap4-droid4-xt894.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616
debounce-interval = <10>;
1717
};
1818

19+
/*
20+
* We use pad 0x4a100116 abe_dmic_din3.gpio_122 as the irq instead
21+
* of the gpio interrupt to avoid lost events in deeper idle states.
22+
*/
1923
slider {
2024
label = "Keypad Slide";
25+
interrupts-extended = <&omap4_pmx_core 0xd6>;
2126
gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */
2227
linux,input-type = <EV_SW>;
2328
linux,code = <SW_KEYPAD_SLIDE>;

arch/arm/mach-omap1/board-osk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ static int osk_tps_setup(struct i2c_client *client, void *context)
203203
*/
204204
gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en");
205205
gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);
206+
/* Free the GPIO again as the driver will request it */
207+
gpio_free(OSK_TPS_GPIO_USB_PWR_EN);
206208

207209
/* Set GPIO 2 high so LED D3 is off by default */
208210
tps65010_set_gpio_out_value(GPIO2, HIGH);

arch/arm/mach-omap2/Kconfig

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ config ARCH_OMAP3
1717
bool "TI OMAP3"
1818
depends on ARCH_MULTI_V7
1919
select ARCH_OMAP2PLUS
20-
select ARM_CPU_SUSPEND if PM
20+
select ARM_CPU_SUSPEND
2121
select OMAP_HWMOD
2222
select OMAP_INTERCONNECT
23-
select PM_OPP if PM
24-
select PM if CPU_IDLE
23+
select PM_OPP
2524
select SOC_HAS_OMAP2_SDRC
2625
select ARM_ERRATA_430973
2726

@@ -30,7 +29,7 @@ config ARCH_OMAP4
3029
depends on ARCH_MULTI_V7
3130
select ARCH_OMAP2PLUS
3231
select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
33-
select ARM_CPU_SUSPEND if PM
32+
select ARM_CPU_SUSPEND
3433
select ARM_ERRATA_720789
3534
select ARM_GIC
3635
select HAVE_ARM_SCU if SMP
@@ -40,7 +39,7 @@ config ARCH_OMAP4
4039
select OMAP_INTERCONNECT_BARRIER
4140
select PL310_ERRATA_588369 if CACHE_L2X0
4241
select PL310_ERRATA_727915 if CACHE_L2X0
43-
select PM_OPP if PM
42+
select PM_OPP
4443
select PM if CPU_IDLE
4544
select ARM_ERRATA_754322
4645
select ARM_ERRATA_775420
@@ -50,22 +49,22 @@ config SOC_OMAP5
5049
bool "TI OMAP5"
5150
depends on ARCH_MULTI_V7
5251
select ARCH_OMAP2PLUS
53-
select ARM_CPU_SUSPEND if PM
52+
select ARM_CPU_SUSPEND
5453
select ARM_GIC
5554
select HAVE_ARM_SCU if SMP
5655
select HAVE_ARM_ARCH_TIMER
5756
select ARM_ERRATA_798181 if SMP
5857
select OMAP_HWMOD
5958
select OMAP_INTERCONNECT
6059
select OMAP_INTERCONNECT_BARRIER
61-
select PM_OPP if PM
60+
select PM_OPP
6261
select ZONE_DMA if ARM_LPAE
6362

6463
config SOC_AM33XX
6564
bool "TI AM33XX"
6665
depends on ARCH_MULTI_V7
6766
select ARCH_OMAP2PLUS
68-
select ARM_CPU_SUSPEND if PM
67+
select ARM_CPU_SUSPEND
6968

7069
config SOC_AM43XX
7170
bool "TI AM43x"
@@ -79,13 +78,13 @@ config SOC_AM43XX
7978
select ARM_ERRATA_754322
8079
select ARM_ERRATA_775420
8180
select OMAP_INTERCONNECT
82-
select ARM_CPU_SUSPEND if PM
81+
select ARM_CPU_SUSPEND
8382

8483
config SOC_DRA7XX
8584
bool "TI DRA7XX"
8685
depends on ARCH_MULTI_V7
8786
select ARCH_OMAP2PLUS
88-
select ARM_CPU_SUSPEND if PM
87+
select ARM_CPU_SUSPEND
8988
select ARM_GIC
9089
select HAVE_ARM_SCU if SMP
9190
select HAVE_ARM_ARCH_TIMER
@@ -94,7 +93,7 @@ config SOC_DRA7XX
9493
select OMAP_HWMOD
9594
select OMAP_INTERCONNECT
9695
select OMAP_INTERCONNECT_BARRIER
97-
select PM_OPP if PM
96+
select PM_OPP
9897
select ZONE_DMA if ARM_LPAE
9998
select PINCTRL_TI_IODELAY if OF && PINCTRL
10099

@@ -112,9 +111,11 @@ config ARCH_OMAP2PLUS
112111
select OMAP_DM_TIMER
113112
select OMAP_GPMC
114113
select PINCTRL
115-
select PM_GENERIC_DOMAINS if PM
116-
select PM_GENERIC_DOMAINS_OF if PM
114+
select PM
115+
select PM_GENERIC_DOMAINS
116+
select PM_GENERIC_DOMAINS_OF
117117
select RESET_CONTROLLER
118+
select SIMPLE_PM_BUS
118119
select SOC_BUS
119120
select TI_SYSC
120121
select OMAP_IRQCHIP
@@ -140,7 +141,6 @@ config ARCH_OMAP2PLUS_TYPICAL
140141
select I2C_OMAP
141142
select MENELAUS if ARCH_OMAP2
142143
select NEON if CPU_V7
143-
select PM
144144
select REGULATOR
145145
select REGULATOR_FIXED_VOLTAGE
146146
select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4

arch/arm/mach-omap2/cpuidle44xx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
151151
(cx->mpu_logic_state == PWRDM_POWER_OFF);
152152

153153
/* Enter broadcast mode for periodic timers */
154-
tick_broadcast_enable();
154+
RCU_NONIDLE(tick_broadcast_enable());
155155

156156
/* Enter broadcast mode for one-shot timers */
157-
tick_broadcast_enter();
157+
RCU_NONIDLE(tick_broadcast_enter());
158158

159159
/*
160160
* Call idle CPU PM enter notifier chain so that
@@ -166,7 +166,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
166166

167167
if (dev->cpu == 0) {
168168
pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
169-
omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
169+
RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state));
170170

171171
/*
172172
* Call idle CPU cluster PM enter notifier chain
@@ -178,7 +178,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
178178
index = 0;
179179
cx = state_ptr + index;
180180
pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
181-
omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
181+
RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state));
182182
mpuss_can_lose_context = 0;
183183
}
184184
}
@@ -194,9 +194,9 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
194194
mpuss_can_lose_context)
195195
gic_dist_disable();
196196

197-
clkdm_deny_idle(cpu_clkdm[1]);
198-
omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON);
199-
clkdm_allow_idle(cpu_clkdm[1]);
197+
RCU_NONIDLE(clkdm_deny_idle(cpu_clkdm[1]));
198+
RCU_NONIDLE(omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON));
199+
RCU_NONIDLE(clkdm_allow_idle(cpu_clkdm[1]));
200200

201201
if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD) &&
202202
mpuss_can_lose_context) {
@@ -222,7 +222,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
222222
cpu_pm_exit();
223223

224224
cpu_pm_out:
225-
tick_broadcast_exit();
225+
RCU_NONIDLE(tick_broadcast_exit());
226226

227227
fail:
228228
cpuidle_coupled_parallel_barrier(dev, &abort_barrier);

arch/arm/mach-omap2/pdata-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {
522522
&dra7_ipu1_dsp_iommu_pdata),
523523
#endif
524524
/* Common auxdata */
525+
OF_DEV_AUXDATA("simple-pm-bus", 0, NULL, omap_auxdata_lookup),
525526
OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
526527
OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
527528
OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata),

drivers/bus/simple-pm-bus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
static int simple_pm_bus_probe(struct platform_device *pdev)
1818
{
19+
const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev);
1920
struct device_node *np = pdev->dev.of_node;
2021

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

2324
pm_runtime_enable(&pdev->dev);
2425

2526
if (np)
26-
of_platform_populate(np, NULL, NULL, &pdev->dev);
27+
of_platform_populate(np, NULL, lookup, &pdev->dev);
2728

2829
return 0;
2930
}

drivers/soc/ti/omap_prm.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ static int omap_prm_reset_init(struct platform_device *pdev,
860860
const struct omap_rst_map *map;
861861
struct ti_prm_platform_data *pdata = dev_get_platdata(&pdev->dev);
862862
char buf[32];
863+
u32 v;
863864

864865
/*
865866
* Check if we have controllable resets. If either rstctrl is non-zero
@@ -907,6 +908,16 @@ static int omap_prm_reset_init(struct platform_device *pdev,
907908
map++;
908909
}
909910

911+
/* Quirk handling to assert rst_map_012 bits on reset and avoid errors */
912+
if (prm->data->rstmap == rst_map_012) {
913+
v = readl_relaxed(reset->prm->base + reset->prm->data->rstctrl);
914+
if ((v & reset->mask) != reset->mask) {
915+
dev_dbg(&pdev->dev, "Asserting all resets: %08x\n", v);
916+
writel_relaxed(reset->mask, reset->prm->base +
917+
reset->prm->data->rstctrl);
918+
}
919+
}
920+
910921
return devm_reset_controller_register(&pdev->dev, &reset->rcdev);
911922
}
912923

0 commit comments

Comments
 (0)