Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+44 -25
+1 -2
arch/arm/boot/dts/omap3-gta04.dtsi
··· 114 114 gpio-sck = <&gpio1 12 GPIO_ACTIVE_HIGH>; 115 115 gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>; 116 116 gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>; 117 - cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; 117 + cs-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>; 118 118 num-chipselects = <1>; 119 119 120 120 /* lcd panel */ ··· 124 124 spi-max-frequency = <100000>; 125 125 spi-cpol; 126 126 spi-cpha; 127 - spi-cs-high; 128 127 129 128 backlight= <&backlight>; 130 129 label = "lcd";
+5
arch/arm/boot/dts/omap4-droid4-xt894.dts
··· 16 16 debounce-interval = <10>; 17 17 }; 18 18 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 + */ 19 23 slider { 20 24 label = "Keypad Slide"; 25 + interrupts-extended = <&omap4_pmx_core 0xd6>; 21 26 gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */ 22 27 linux,input-type = <EV_SW>; 23 28 linux,code = <SW_KEYPAD_SLIDE>;
+2
arch/arm/mach-omap1/board-osk.c
··· 203 203 */ 204 204 gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en"); 205 205 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); 206 208 207 209 /* Set GPIO 2 high so LED D3 is off by default */ 208 210 tps65010_set_gpio_out_value(GPIO2, HIGH);
+14 -14
arch/arm/mach-omap2/Kconfig
··· 17 17 bool "TI OMAP3" 18 18 depends on ARCH_MULTI_V7 19 19 select ARCH_OMAP2PLUS 20 - select ARM_CPU_SUSPEND if PM 20 + select ARM_CPU_SUSPEND 21 21 select OMAP_HWMOD 22 22 select OMAP_INTERCONNECT 23 - select PM_OPP if PM 24 - select PM if CPU_IDLE 23 + select PM_OPP 25 24 select SOC_HAS_OMAP2_SDRC 26 25 select ARM_ERRATA_430973 27 26 ··· 29 30 depends on ARCH_MULTI_V7 30 31 select ARCH_OMAP2PLUS 31 32 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 32 - select ARM_CPU_SUSPEND if PM 33 + select ARM_CPU_SUSPEND 33 34 select ARM_ERRATA_720789 34 35 select ARM_GIC 35 36 select HAVE_ARM_SCU if SMP ··· 39 40 select OMAP_INTERCONNECT_BARRIER 40 41 select PL310_ERRATA_588369 if CACHE_L2X0 41 42 select PL310_ERRATA_727915 if CACHE_L2X0 42 - select PM_OPP if PM 43 + select PM_OPP 43 44 select PM if CPU_IDLE 44 45 select ARM_ERRATA_754322 45 46 select ARM_ERRATA_775420 ··· 49 50 bool "TI OMAP5" 50 51 depends on ARCH_MULTI_V7 51 52 select ARCH_OMAP2PLUS 52 - select ARM_CPU_SUSPEND if PM 53 + select ARM_CPU_SUSPEND 53 54 select ARM_GIC 54 55 select HAVE_ARM_SCU if SMP 55 56 select HAVE_ARM_ARCH_TIMER ··· 57 58 select OMAP_HWMOD 58 59 select OMAP_INTERCONNECT 59 60 select OMAP_INTERCONNECT_BARRIER 60 - select PM_OPP if PM 61 + select PM_OPP 61 62 select ZONE_DMA if ARM_LPAE 62 63 63 64 config SOC_AM33XX 64 65 bool "TI AM33XX" 65 66 depends on ARCH_MULTI_V7 66 67 select ARCH_OMAP2PLUS 67 - select ARM_CPU_SUSPEND if PM 68 + select ARM_CPU_SUSPEND 68 69 69 70 config SOC_AM43XX 70 71 bool "TI AM43x" ··· 78 79 select ARM_ERRATA_754322 79 80 select ARM_ERRATA_775420 80 81 select OMAP_INTERCONNECT 81 - select ARM_CPU_SUSPEND if PM 82 + select ARM_CPU_SUSPEND 82 83 83 84 config SOC_DRA7XX 84 85 bool "TI DRA7XX" 85 86 depends on ARCH_MULTI_V7 86 87 select ARCH_OMAP2PLUS 87 - select ARM_CPU_SUSPEND if PM 88 + select ARM_CPU_SUSPEND 88 89 select ARM_GIC 89 90 select HAVE_ARM_SCU if SMP 90 91 select HAVE_ARM_ARCH_TIMER ··· 93 94 select OMAP_HWMOD 94 95 select OMAP_INTERCONNECT 95 96 select OMAP_INTERCONNECT_BARRIER 96 - select PM_OPP if PM 97 + select PM_OPP 97 98 select ZONE_DMA if ARM_LPAE 98 99 select PINCTRL_TI_IODELAY if OF && PINCTRL 99 100 ··· 111 112 select OMAP_DM_TIMER 112 113 select OMAP_GPMC 113 114 select PINCTRL 114 - select PM_GENERIC_DOMAINS if PM 115 - select PM_GENERIC_DOMAINS_OF if PM 115 + select PM 116 + select PM_GENERIC_DOMAINS 117 + select PM_GENERIC_DOMAINS_OF 116 118 select RESET_CONTROLLER 119 + select SIMPLE_PM_BUS 117 120 select SOC_BUS 118 121 select TI_SYSC 119 122 select OMAP_IRQCHIP ··· 141 140 select I2C_OMAP 142 141 select MENELAUS if ARCH_OMAP2 143 142 select NEON if CPU_V7 144 - select PM 145 143 select REGULATOR 146 144 select REGULATOR_FIXED_VOLTAGE 147 145 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
+8 -8
arch/arm/mach-omap2/cpuidle44xx.c
··· 151 151 (cx->mpu_logic_state == PWRDM_POWER_OFF); 152 152 153 153 /* Enter broadcast mode for periodic timers */ 154 - tick_broadcast_enable(); 154 + RCU_NONIDLE(tick_broadcast_enable()); 155 155 156 156 /* Enter broadcast mode for one-shot timers */ 157 - tick_broadcast_enter(); 157 + RCU_NONIDLE(tick_broadcast_enter()); 158 158 159 159 /* 160 160 * Call idle CPU PM enter notifier chain so that ··· 166 166 167 167 if (dev->cpu == 0) { 168 168 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)); 170 170 171 171 /* 172 172 * Call idle CPU cluster PM enter notifier chain ··· 178 178 index = 0; 179 179 cx = state_ptr + index; 180 180 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)); 182 182 mpuss_can_lose_context = 0; 183 183 } 184 184 } ··· 194 194 mpuss_can_lose_context) 195 195 gic_dist_disable(); 196 196 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])); 200 200 201 201 if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD) && 202 202 mpuss_can_lose_context) { ··· 222 222 cpu_pm_exit(); 223 223 224 224 cpu_pm_out: 225 - tick_broadcast_exit(); 225 + RCU_NONIDLE(tick_broadcast_exit()); 226 226 227 227 fail: 228 228 cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
+1
arch/arm/mach-omap2/pdata-quirks.c
··· 522 522 &dra7_ipu1_dsp_iommu_pdata), 523 523 #endif 524 524 /* Common auxdata */ 525 + OF_DEV_AUXDATA("simple-pm-bus", 0, NULL, omap_auxdata_lookup), 525 526 OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata), 526 527 OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata), 527 528 OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata),
+2 -1
drivers/bus/simple-pm-bus.c
··· 16 16 17 17 static int simple_pm_bus_probe(struct platform_device *pdev) 18 18 { 19 + const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev); 19 20 struct device_node *np = pdev->dev.of_node; 20 21 21 22 dev_dbg(&pdev->dev, "%s\n", __func__); ··· 24 23 pm_runtime_enable(&pdev->dev); 25 24 26 25 if (np) 27 - of_platform_populate(np, NULL, NULL, &pdev->dev); 26 + of_platform_populate(np, NULL, lookup, &pdev->dev); 28 27 29 28 return 0; 30 29 }
+11
drivers/soc/ti/omap_prm.c
··· 860 860 const struct omap_rst_map *map; 861 861 struct ti_prm_platform_data *pdata = dev_get_platdata(&pdev->dev); 862 862 char buf[32]; 863 + u32 v; 863 864 864 865 /* 865 866 * Check if we have controllable resets. If either rstctrl is non-zero ··· 906 905 while (map->rst >= 0) { 907 906 reset->mask |= BIT(map->rst); 908 907 map++; 908 + } 909 + 910 + /* Quirk handling to assert rst_map_012 bits on reset and avoid errors */ 911 + if (prm->data->rstmap == rst_map_012) { 912 + v = readl_relaxed(reset->prm->base + reset->prm->data->rstctrl); 913 + if ((v & reset->mask) != reset->mask) { 914 + dev_dbg(&pdev->dev, "Asserting all resets: %08x\n", v); 915 + writel_relaxed(reset->mask, reset->prm->base + 916 + reset->prm->data->rstctrl); 917 + } 909 918 } 910 919 911 920 return devm_reset_controller_register(&pdev->dev, &reset->rcdev);