Merge tag 'omap-for-v5.8/fixes-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes

Fixes for omaps for v5.8

The recent display subsystem (DSS) related platform data changes caused
display related regressions for suspend and resume. Looks like I only
tested suspend and resume before dropping the legacy platform data, and
forgot to test it after dropping it. Turns out the main issue was that
we no longer have platform code calling pm_runtime_suspend for DSS like
we did for the legacy platform data case, and that fix is still being
discussed on the dri-devel list and will get merged separately. The DSS
related testing exposed a pile other other display related issues that
also need fixing though:

- Fix ti-sysc optional clock handling and reset status checks
for devices that reset automatically in idle like DSS

- Ignore ti-sysc clockactivity bit unless separately requested
to avoid unexpected performance issues

- Init ti-sysc framedonetv_irq to true and disable for am4

- Avoid duplicate DSS reset for legacy mode with dts data

- Remove LCD timings for am4 as they cause warnings now that we're
using generic panels

Then there is a pile of other fixes not related to the DSS:

- Fix omap_prm reset deassert as we still have drivers setting the
pm_runtime_irq_safe() flag

- Flush posted write for ti-sysc enable and disable

- Fix droid4 spi related errors with spi flags

- Fix am335x USB range and a typo for softreset

- Fix dra7 timer nodes for clocks for IPU and DSP

- Drop duplicate mailboxes after mismerge for dra7

* tag 'omap-for-v5.8/fixes-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
Revert "bus: ti-sysc: Increase max softreset wait"
ARM: dts: am437x-epos-evm: remove lcd timings
ARM: dts: am437x-gp-evm: remove lcd timings
ARM: dts: am437x-sk-evm: remove lcd timings
ARM: dts: dra7-evm-common: Fix duplicate mailbox nodes
ARM: dts: dra7: Fix timer nodes properly for timer_sys_ck clocks
ARM: dts: Fix am33xx.dtsi ti,sysc-mask wrong softreset flag
ARM: dts: Fix am33xx.dtsi USB ranges length
bus: ti-sysc: Increase max softreset wait
ARM: OMAP2+: Fix legacy mode dss_reset
bus: ti-sysc: Fix uninitialized framedonetv_irq
bus: ti-sysc: Ignore clockactivity unless specified as a quirk
bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit
ARM: dts: omap4-droid4: Fix spi configuration and increase rate
bus: ti-sysc: Flush posted write on enable and disable
soc: ti: omap-prm: use atomic iopoll instead of sleeping one

Link: https://lore.kernel.org/r/pull-1591889257-410830@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+2 -2
arch/arm/boot/dts/am33xx.dtsi
··· 335 335 <0x47400010 0x4>; 336 336 reg-names = "rev", "sysc"; 337 337 ti,sysc-mask = <(SYSC_OMAP4_FREEEMU | 338 - SYSC_OMAP2_SOFTRESET)>; 338 + SYSC_OMAP4_SOFTRESET)>; 339 339 ti,sysc-midle = <SYSC_IDLE_FORCE>, 340 340 <SYSC_IDLE_NO>, 341 341 <SYSC_IDLE_SMART>; ··· 347 347 clock-names = "fck"; 348 348 #address-cells = <1>; 349 349 #size-cells = <1>; 350 - ranges = <0x0 0x47400000 0x5000>; 350 + ranges = <0x0 0x47400000 0x8000>; 351 351 352 352 usb0_phy: usb-phy@1300 { 353 353 compatible = "ti,am335x-usb-phy";
-16
arch/arm/boot/dts/am437x-gp-evm.dts
··· 91 91 92 92 backlight = <&lcd_bl>; 93 93 94 - panel-timing { 95 - clock-frequency = <33000000>; 96 - hactive = <800>; 97 - vactive = <480>; 98 - hfront-porch = <210>; 99 - hback-porch = <16>; 100 - hsync-len = <30>; 101 - vback-porch = <10>; 102 - vfront-porch = <22>; 103 - vsync-len = <13>; 104 - hsync-active = <0>; 105 - vsync-active = <0>; 106 - de-active = <1>; 107 - pixelclk-active = <1>; 108 - }; 109 - 110 94 port { 111 95 lcd_in: endpoint { 112 96 remote-endpoint = <&dpi_out>;
-16
arch/arm/boot/dts/am437x-sk-evm.dts
··· 134 134 135 135 enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; 136 136 137 - panel-timing { 138 - clock-frequency = <9000000>; 139 - hactive = <480>; 140 - vactive = <272>; 141 - hfront-porch = <2>; 142 - hback-porch = <2>; 143 - hsync-len = <41>; 144 - vfront-porch = <2>; 145 - vback-porch = <2>; 146 - vsync-len = <10>; 147 - hsync-active = <0>; 148 - vsync-active = <0>; 149 - de-active = <1>; 150 - pixelclk-active = <1>; 151 - }; 152 - 153 137 port { 154 138 lcd_in: endpoint { 155 139 remote-endpoint = <&dpi_out>;
-16
arch/arm/boot/dts/am43x-epos-evm.dts
··· 47 47 48 48 backlight = <&lcd_bl>; 49 49 50 - panel-timing { 51 - clock-frequency = <33000000>; 52 - hactive = <800>; 53 - vactive = <480>; 54 - hfront-porch = <210>; 55 - hback-porch = <16>; 56 - hsync-len = <30>; 57 - vback-porch = <10>; 58 - vfront-porch = <22>; 59 - vsync-len = <13>; 60 - hsync-active = <0>; 61 - vsync-active = <0>; 62 - de-active = <1>; 63 - pixelclk-active = <1>; 64 - }; 65 - 66 50 port { 67 51 lcd_in: endpoint { 68 52 remote-endpoint = <&dpi_out>;
-20
arch/arm/boot/dts/dra7-evm-common.dtsi
··· 245 245 rx-num-evt = <32>; 246 246 }; 247 247 248 - &mailbox5 { 249 - status = "okay"; 250 - mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { 251 - status = "okay"; 252 - }; 253 - mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { 254 - status = "okay"; 255 - }; 256 - }; 257 - 258 - &mailbox6 { 259 - status = "okay"; 260 - mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { 261 - status = "okay"; 262 - }; 263 - mbox_dsp2_ipc3x: mbox_dsp2_ipc3x { 264 - status = "okay"; 265 - }; 266 - }; 267 - 268 248 &pcie1_rc { 269 249 status = "okay"; 270 250 };
+16 -18
arch/arm/boot/dts/dra7-l4.dtsi
··· 1207 1207 <SYSC_IDLE_SMART>, 1208 1208 <SYSC_IDLE_SMART_WKUP>; 1209 1209 /* Domains (P, C): l4per_pwrdm, l4per_clkdm */ 1210 - clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 0>, 1211 - <&timer_sys_clk_div>; 1212 - clock-names = "fck", "timer_sys_ck"; 1210 + clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 0>; 1211 + clock-names = "fck"; 1213 1212 #address-cells = <1>; 1214 1213 #size-cells = <1>; 1215 1214 ranges = <0x0 0x36000 0x1000>; ··· 3351 3352 <SYSC_IDLE_SMART>, 3352 3353 <SYSC_IDLE_SMART_WKUP>; 3353 3354 /* Domains (P, C): ipu_pwrdm, ipu_clkdm */ 3354 - clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 0>, <&timer_sys_clk_div>; 3355 - clock-names = "fck", "timer_sys_ck"; 3355 + clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 0>; 3356 + clock-names = "fck"; 3356 3357 #address-cells = <1>; 3357 3358 #size-cells = <1>; 3358 3359 ranges = <0x0 0x20000 0x1000>; ··· 3360 3361 timer5: timer@0 { 3361 3362 compatible = "ti,omap5430-timer"; 3362 3363 reg = <0x0 0x80>; 3363 - clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 24>; 3364 - clock-names = "fck"; 3364 + clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 24>, <&timer_sys_clk_div>; 3365 + clock-names = "fck", "timer_sys_ck"; 3365 3366 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 3366 3367 }; 3367 3368 }; ··· 3378 3379 <SYSC_IDLE_SMART>, 3379 3380 <SYSC_IDLE_SMART_WKUP>; 3380 3381 /* Domains (P, C): ipu_pwrdm, ipu_clkdm */ 3381 - clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 0>, 3382 - <&timer_sys_clk_div>; 3383 - clock-names = "fck", "timer_sys_ck"; 3382 + clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 0>; 3383 + clock-names = "fck"; 3384 3384 #address-cells = <1>; 3385 3385 #size-cells = <1>; 3386 3386 ranges = <0x0 0x22000 0x1000>; ··· 3387 3389 timer6: timer@0 { 3388 3390 compatible = "ti,omap5430-timer"; 3389 3391 reg = <0x0 0x80>; 3390 - clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 24>; 3391 - clock-names = "fck"; 3392 + clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 24>, <&timer_sys_clk_div>; 3393 + clock-names = "fck", "timer_sys_ck"; 3392 3394 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; 3393 3395 }; 3394 3396 }; ··· 3496 3498 timer14: timer@0 { 3497 3499 compatible = "ti,omap5430-timer"; 3498 3500 reg = <0x0 0x80>; 3499 - clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>; 3500 - clock-names = "fck"; 3501 + clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>, <&timer_sys_clk_div>; 3502 + clock-names = "fck", "timer_sys_ck"; 3501 3503 interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>; 3502 3504 ti,timer-pwm; 3503 3505 }; ··· 3524 3526 timer15: timer@0 { 3525 3527 compatible = "ti,omap5430-timer"; 3526 3528 reg = <0x0 0x80>; 3527 - clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>; 3528 - clock-names = "fck"; 3529 + clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>, <&timer_sys_clk_div>; 3530 + clock-names = "fck", "timer_sys_ck"; 3529 3531 interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>; 3530 3532 ti,timer-pwm; 3531 3533 }; ··· 3552 3554 timer16: timer@0 { 3553 3555 compatible = "ti,omap5430-timer"; 3554 3556 reg = <0x0 0x80>; 3555 - clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>; 3556 - clock-names = "fck"; 3557 + clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>, <&timer_sys_clk_div>; 3558 + clock-names = "fck", "timer_sys_ck"; 3557 3559 interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>; 3558 3560 ti,timer-pwm; 3559 3561 };
+3 -1
arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
··· 13 13 #interrupt-cells = <2>; 14 14 #address-cells = <1>; 15 15 #size-cells = <0>; 16 - spi-max-frequency = <3000000>; 16 + spi-max-frequency = <9600000>; 17 17 spi-cs-high; 18 + spi-cpol; 19 + spi-cpha; 18 20 19 21 cpcap_adc: adc { 20 22 compatible = "motorola,mapphone-cpcap-adc";
+1 -1
arch/arm/mach-omap2/omap_hwmod.c
··· 3489 3489 }; 3490 3490 3491 3491 static const struct omap_hwmod_reset omap_reset_quirks[] = { 3492 - { .match = "dss", .len = 3, .reset = omap_dss_reset, }, 3492 + { .match = "dss_core", .len = 8, .reset = omap_dss_reset, }, 3493 3493 { .match = "hdq1w", .len = 5, .reset = omap_hdq1w_reset, }, 3494 3494 { .match = "i2c", .len = 3, .reset = omap_i2c_reset, }, 3495 3495 { .match = "wd_timer", .len = 8, .reset = omap2_wd_timer_reset, },
+74 -24
drivers/bus/ti-sysc.c
··· 221 221 return sysc_read(ddata, offset); 222 222 } 223 223 224 + /* Poll on reset status */ 225 + static int sysc_wait_softreset(struct sysc *ddata) 226 + { 227 + u32 sysc_mask, syss_done, rstval; 228 + int syss_offset, error = 0; 229 + 230 + syss_offset = ddata->offsets[SYSC_SYSSTATUS]; 231 + sysc_mask = BIT(ddata->cap->regbits->srst_shift); 232 + 233 + if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED) 234 + syss_done = 0; 235 + else 236 + syss_done = ddata->cfg.syss_mask; 237 + 238 + if (syss_offset >= 0) { 239 + error = readx_poll_timeout(sysc_read_sysstatus, ddata, rstval, 240 + (rstval & ddata->cfg.syss_mask) == 241 + syss_done, 242 + 100, MAX_MODULE_SOFTRESET_WAIT); 243 + 244 + } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) { 245 + error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval, 246 + !(rstval & sysc_mask), 247 + 100, MAX_MODULE_SOFTRESET_WAIT); 248 + } 249 + 250 + return error; 251 + } 252 + 224 253 static int sysc_add_named_clock_from_child(struct sysc *ddata, 225 254 const char *name, 226 255 const char *optfck_name) ··· 954 925 struct sysc *ddata; 955 926 const struct sysc_regbits *regbits; 956 927 u32 reg, idlemodes, best_mode; 928 + int error; 957 929 958 930 ddata = dev_get_drvdata(dev); 931 + 932 + /* 933 + * Some modules like DSS reset automatically on idle. Enable optional 934 + * reset clocks and wait for OCP softreset to complete. 935 + */ 936 + if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) { 937 + error = sysc_enable_opt_clocks(ddata); 938 + if (error) { 939 + dev_err(ddata->dev, 940 + "Optional clocks failed for enable: %i\n", 941 + error); 942 + return error; 943 + } 944 + } 945 + error = sysc_wait_softreset(ddata); 946 + if (error) 947 + dev_warn(ddata->dev, "OCP softreset timed out\n"); 948 + if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) 949 + sysc_disable_opt_clocks(ddata); 950 + 951 + /* 952 + * Some subsystem private interconnects, like DSS top level module, 953 + * need only the automatic OCP softreset handling with no sysconfig 954 + * register bits to configure. 955 + */ 959 956 if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV) 960 957 return 0; 961 958 962 959 regbits = ddata->cap->regbits; 963 960 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); 964 961 965 - /* Set CLOCKACTIVITY, we only use it for ick */ 962 + /* 963 + * Set CLOCKACTIVITY, we only use it for ick. And we only configure it 964 + * based on the SYSC_QUIRK_USE_CLOCKACT flag, not based on the hardware 965 + * capabilities. See the old HWMOD_SET_DEFAULT_CLOCKACT flag. 966 + */ 966 967 if (regbits->clkact_shift >= 0 && 967 - (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT || 968 - ddata->cfg.sysc_val & BIT(regbits->clkact_shift))) 968 + (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT)) 969 969 reg |= SYSC_CLOCACT_ICK << regbits->clkact_shift; 970 970 971 971 /* Set SIDLE mode */ ··· 1048 990 reg |= 1 << regbits->autoidle_shift; 1049 991 sysc_write_sysconfig(ddata, reg); 1050 992 } 993 + 994 + /* Flush posted write */ 995 + sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); 1051 996 1052 997 if (ddata->module_enable_quirk) 1053 998 ddata->module_enable_quirk(ddata); ··· 1131 1070 ddata->cfg.sysc_val & BIT(regbits->autoidle_shift)) 1132 1071 reg |= 1 << regbits->autoidle_shift; 1133 1072 sysc_write_sysconfig(ddata, reg); 1073 + 1074 + /* Flush posted write */ 1075 + sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); 1134 1076 1135 1077 return 0; 1136 1078 } ··· 1552 1488 bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false; 1553 1489 const int lcd_en_mask = BIT(0), digit_en_mask = BIT(1); 1554 1490 int manager_count; 1555 - bool framedonetv_irq; 1491 + bool framedonetv_irq = true; 1556 1492 u32 val, irq_mask = 0; 1557 1493 1558 1494 switch (sysc_soc->soc) { ··· 1569 1505 break; 1570 1506 case SOC_AM4: 1571 1507 manager_count = 1; 1508 + framedonetv_irq = false; 1572 1509 break; 1573 1510 case SOC_UNKNOWN: 1574 1511 default: ··· 1887 1822 */ 1888 1823 static int sysc_reset(struct sysc *ddata) 1889 1824 { 1890 - int sysc_offset, syss_offset, sysc_val, rstval, error = 0; 1891 - u32 sysc_mask, syss_done; 1825 + int sysc_offset, sysc_val, error; 1826 + u32 sysc_mask; 1892 1827 1893 1828 sysc_offset = ddata->offsets[SYSC_SYSCONFIG]; 1894 - syss_offset = ddata->offsets[SYSC_SYSSTATUS]; 1895 1829 1896 1830 if (ddata->legacy_mode || 1897 1831 ddata->cap->regbits->srst_shift < 0 || ··· 1898 1834 return 0; 1899 1835 1900 1836 sysc_mask = BIT(ddata->cap->regbits->srst_shift); 1901 - 1902 - if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED) 1903 - syss_done = 0; 1904 - else 1905 - syss_done = ddata->cfg.syss_mask; 1906 1837 1907 1838 if (ddata->pre_reset_quirk) 1908 1839 ddata->pre_reset_quirk(ddata); ··· 1915 1856 if (ddata->post_reset_quirk) 1916 1857 ddata->post_reset_quirk(ddata); 1917 1858 1918 - /* Poll on reset status */ 1919 - if (syss_offset >= 0) { 1920 - error = readx_poll_timeout(sysc_read_sysstatus, ddata, rstval, 1921 - (rstval & ddata->cfg.syss_mask) == 1922 - syss_done, 1923 - 100, MAX_MODULE_SOFTRESET_WAIT); 1924 - 1925 - } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) { 1926 - error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval, 1927 - !(rstval & sysc_mask), 1928 - 100, MAX_MODULE_SOFTRESET_WAIT); 1929 - } 1859 + error = sysc_wait_softreset(ddata); 1860 + if (error) 1861 + dev_warn(ddata->dev, "OCP softreset timed out\n"); 1930 1862 1931 1863 if (ddata->reset_done_quirk) 1932 1864 ddata->reset_done_quirk(ddata);
+4 -4
drivers/soc/ti/omap_prm.c
··· 256 256 goto exit; 257 257 258 258 /* wait for the status to be set */ 259 - ret = readl_relaxed_poll_timeout(reset->prm->base + 260 - reset->prm->data->rstst, 261 - v, v & BIT(st_bit), 1, 262 - OMAP_RESET_MAX_WAIT); 259 + ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + 260 + reset->prm->data->rstst, 261 + v, v & BIT(st_bit), 1, 262 + OMAP_RESET_MAX_WAIT); 263 263 if (ret) 264 264 pr_err("%s: timedout waiting for %s:%lu\n", __func__, 265 265 reset->prm->data->name, id);