ARM; OMAP2+: hwmod and SERIAL: Remove sysc handling from driver
Subsystems (6)
v2 cover ARM; OMAP2+: hwmod and SERIAL: Remove sysc handling from driver
changes in v2:
---
1. Addressed the concerns from Paul Wamsley around cleanups in _enable_wakeup()/_disable_wakeup(), and left them intact
2. Updates in changelogs in the serial patch about changes needed when dma support is added back for serial
3. Dropped 1/8 from v1 since its already pulled in
The patches are based of 'fixes-non-critical' branch of 'git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap' tree since patch 1/8 from v1 was pulled in here.
Patches can be found here:git://github.com/rrnayak/linux.git sysc-cleanups
---
OMAP UART IP needs manual idle modes based on functional state of the IP. Currently this is handled by the driver with function pointers implemented in platform code.
This however breaks in case of device tree because of missing idle handling.
The series tries to address the issue and tries to remove complete sysc handling from serial driver.
Patches has been tested on OMAP4430 SDP and OMAP5 EVM where the console sluggishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.
Thanks to Vaibhav Bedia for testing on Beaglebone(AM33XX) with suspend and also the UART async wakeup from suspend.
Thanks to Sourav Poddar for Beagle XM(OMAP3630) devices testing with retention and offmode in Idle and suspend for non-DT builds.
Serial driver platform code still has one more function pointer left which is used to trigger io_ring(). This one needs some discussion with pincontrol driver folks on how to implement such a feature with generic pincontrol driver.
Rajendra Nayak (2):
ARM: OMAP2+: hwmod: Fix sidle programming in
_enable_sysc()/_idle_sysc()
ARM: OMAP2+: hwmod: Add a new flag to handle SIDLE in SWSUP only in
active
Santosh Shilimkar (4):
ARM: OMAP2+: hwmod-data: UART IP needs software control to manage
sidle modes
SERIAL: OMAP: Remove the slave idle handling from the driver
ARM: OMAP2+: serial: Remove the un-used slave idle hooks
ARM: OMAP2+: hwmod: Remove sysc slave idle and auto idle apis
arch/arm/mach-omap2/omap_hwmod.c | 111 +++++--------------- arch/arm/mach-omap2/omap_hwmod.h | 7 +- arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 3 + arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 6 ++ arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 4 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 +- arch/arm/mach-omap2/serial.c | 31 ------ drivers/tty/serial/omap-serial.c | 23 ---- include/linux/platform_data/serial-omap.h | 2 - 9 files changed, 48 insertions(+), 145 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/6 ARM: OMAP2+: hwmod: Fix sidle programming in _enable_sysc()/_idle_sysc()
_enable_sysc() and _idle_sysc() handle the midle mode programming correctly and program HWMOD_IDLEMODE_SMART or HWMOD_IDLEMODE_SMART_WKUP respectively for supported IPs (The ones which support hardware controlled midle modes)
However the same programming logic is missing when it comes to sidle mode programming. Here they seem to just set HWMOD_IDLEMODE_SMART (Again for the ones which support hardware controlled sidle modes)
This problem was hidden due to the fact that a call to _enable_wakeup() in those same functions would overwrite the idlemodes and program them correctly (to HWMOD_IDLEMODE_SMART_WKUP in the supported cases)
So fix the sidlemode handling correctly in these functions and handle the _enable_wakeup() for SIDLEMODE supported IPs same as the way its handled for MIDLEMODE supported ones.
--- arch/arm/mach-omap2/omap_hwmod.c | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +25 -17
@@ -1353,13 +1353,26 @@ static void _enable_sysc(struct omap_hwmod *oh) clkdm =_get_clkdm (oh);if (sf &SYSC_HAS_SIDLEMODE ) { +if (oh->flags &HWMOD_SWSUP_SIDLE ) { + idlemode =HWMOD_IDLEMODE_NO ; + }else { +if (sf &SYSC_HAS_ENAWAKEUP ) +_enable_wakeup (oh, &v); +if (oh->class->sysc->idlemodes &SIDLE_SMART_WKUP ) + idlemode =HWMOD_IDLEMODE_SMART_WKUP ; +else + idlemode =HWMOD_IDLEMODE_SMART ; + } + +/* +* This is special handling for some IPs like +* 32k sync timer. Force them to idle! +*/ clkdm_act = (clkdm && clkdm->flags &CLKDM_ACTIVE_WITH_MPU );if (clkdm_act && !(oh->class->sysc->idlemodes & (SIDLE_SMART |SIDLE_SMART_WKUP ))) idlemode =HWMOD_IDLEMODE_FORCE ; -else - idlemode = (oh->flags &HWMOD_SWSUP_SIDLE ) ? -HWMOD_IDLEMODE_NO :HWMOD_IDLEMODE_SMART ; +_set_slave_idlemode (oh, idlemode, &v); }
@@ -1386,10 +1399,6 @@ static void _enable_sysc(struct omap_hwmod *oh) (sf & SYSC_HAS_CLOCKACTIVITY))_set_clockactivity (oh, oh->class->sysc->clockact, &v); -/* If slave is in SMARTIDLE, also enable wakeup */ -if ((sf &SYSC_HAS_SIDLEMODE ) && !(oh->flags &HWMOD_SWSUP_SIDLE )) -_enable_wakeup (oh, &v); -_write_sysconfig (v, oh);/*
@@ -1425,13 +1434,16 @@ static void _idle_sysc(struct omap_hwmod *oh) sf = oh->class->sysc->sysc_flags;if (sf &SYSC_HAS_SIDLEMODE ) { -/* XXX What about HWMOD_IDLEMODE_SMART_WKUP? */ -if (oh->flags &HWMOD_SWSUP_SIDLE || - !(oh->class->sysc->idlemodes & - (SIDLE_SMART |SIDLE_SMART_WKUP ))) +if (oh->flags &HWMOD_SWSUP_SIDLE ) { idlemode =HWMOD_IDLEMODE_FORCE ; -else - idlemode =HWMOD_IDLEMODE_SMART ; + }else { +if (sf &SYSC_HAS_ENAWAKEUP ) +_enable_wakeup (oh, &v); +if (oh->class->sysc->idlemodes &SIDLE_SMART_WKUP ) + idlemode =HWMOD_IDLEMODE_SMART_WKUP ; +else + idlemode =HWMOD_IDLEMODE_SMART ; + }_set_slave_idlemode (oh, idlemode, &v); }
@@ -1449,10 +1461,6 @@ static void _idle_sysc(struct omap_hwmod *oh)_set_master_standbymode (oh, idlemode, &v); } -/* If slave is in SMARTIDLE, also enable wakeup */ -if ((sf &SYSC_HAS_SIDLEMODE ) && !(oh->flags &HWMOD_SWSUP_SIDLE )) -_enable_wakeup (oh, &v); -_write_sysconfig (v, oh); }
Signature · 1 line
1.7.9.5
PATCH v2 2/6 ARM: OMAP2+: hwmod: Add a new flag to handle SIDLE in SWSUP only in active
In reply to Rajendra NayakSome IPs (like UART) need the sidle mode to be controlled in SW only while they are active. Once they go inactive, they need the IP to be put back in HW control so they are also wakeup capable.
The flag HWMOD_SWSUP_SIDLE takes care of IPs which need the sidle mode to be *always* controlled in SWSUP. We now have a need to control IPs sidle mode in SWSUP only while its active.
So define a new flag 'HWMOD_SWSUP_SIDLE_ACT' to help the framework know about these new IP requirements.
--- arch/arm/mach-omap2/omap_hwmod.c | 3 ++- arch/arm/mach-omap2/omap_hwmod.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod.c +2 -1
@@ -1353,7 +1353,8 @@ static void _enable_sysc(struct omap_hwmod *oh) clkdm =_get_clkdm (oh);if (sf &SYSC_HAS_SIDLEMODE ) { -if (oh->flags &HWMOD_SWSUP_SIDLE ) { +if (oh->flags &HWMOD_SWSUP_SIDLE || + oh->flags &HWMOD_SWSUP_SIDLE_ACT ) { idlemode =HWMOD_IDLEMODE_NO ; }else {if (sf &SYSC_HAS_ENAWAKEUP )
arch/arm/mach-omap2/omap_hwmod.h +4 -0
@@ -459,6 +459,9 @@ struct omap_hwmod_omap4_prcm {* correctly, or this is being abused to deal with some PM latency * issues -- but we're currently suffering from a shortage of * folks who are able to track these issues down properly. +* HWMOD_SWSUP_SIDLE_ACT: omap_hwmod code should manually bring the module +* out of idle, but rely on smart-idle to the put it back in idle, +* so the wakeups are still functional (Only known case for now is UART) */ #define HWMOD_SWSUP_SIDLE (1 << 0)#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -471,6 +474,7 @@ struct omap_hwmod_omap4_prcm {#define HWMOD_16BIT_REG (1 << 8)#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)#define HWMOD_BLOCK_WFI (1 << 10) +#define HWMOD_SWSUP_SIDLE_ACT (1 << 11)/* * omap_hwmod._int_flags definitions
Signature · 1 line
1.7.9.5
PATCH v2 3/6 ARM: OMAP2+: hwmod-data: UART IP needs software control to manage sidle modes
In reply to Rajendra NayakFrom: Santosh Shilimkar <[email protected]>
OMAP UART IP needs software control for slave idle modes based on functional state of the IP. i.e The IP slave idle settings should be set to 'noidle' when being used and then put back to 'smart_idle' when unused. Currently this is handled by the driver with function pointers implemented in platform code. This however breaks in case of device tree because of missing idle handling APIs.
Previous patches in this series added a flag HWMOD_SWSUP_SIDLE_ACTIVE which takes care of the mentioned requirement. Hence add the flag for all UART IPs to take advantage of feature supported by framework.
Subsequent patches removes the slave idle handling from driver code.
--- arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 3 +++ arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 6 ++++++ arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 4 ++++ arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 +++++- 4 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +3 -0
@@ -512,6 +512,7 @@ struct omap_hwmod omap2xxx_uart1_hwmod = { .mpu_irqs = omap2_uart1_mpu_irqs, .sdma_reqs = omap2_uart1_sdma_reqs, .main_clk = "uart1_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = CORE_MOD,
@@ -531,6 +532,7 @@ struct omap_hwmod omap2xxx_uart2_hwmod = { .mpu_irqs = omap2_uart2_mpu_irqs, .sdma_reqs = omap2_uart2_sdma_reqs, .main_clk = "uart2_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = CORE_MOD,
@@ -550,6 +552,7 @@ struct omap_hwmod omap2xxx_uart3_hwmod = { .mpu_irqs = omap2_uart3_mpu_irqs, .sdma_reqs = omap2_uart3_sdma_reqs, .main_clk = "uart3_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = CORE_MOD,
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +6 -0
@@ -1969,6 +1969,7 @@ static struct omap_hwmod am33xx_uart1_hwmod = { .name = "uart1", .class = &uart_class, .clkdm_name = "l4_wkup_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart1_irqs, .sdma_reqs = uart1_edma_reqs, .main_clk = "dpll_per_m2_div4_wkupdm_ck",
@@ -1989,6 +1990,7 @@ static struct omap_hwmod am33xx_uart2_hwmod = { .name = "uart2", .class = &uart_class, .clkdm_name = "l4ls_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart2_irqs, .sdma_reqs = uart1_edma_reqs, .main_clk = "dpll_per_m2_div4_ck",
@@ -2016,6 +2018,7 @@ static struct omap_hwmod am33xx_uart3_hwmod = { .name = "uart3", .class = &uart_class, .clkdm_name = "l4ls_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart3_irqs, .sdma_reqs = uart3_edma_reqs, .main_clk = "dpll_per_m2_div4_ck",
@@ -2036,6 +2039,7 @@ static struct omap_hwmod am33xx_uart4_hwmod = { .name = "uart4", .class = &uart_class, .clkdm_name = "l4ls_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart4_irqs, .sdma_reqs = uart1_edma_reqs, .main_clk = "dpll_per_m2_div4_ck",
@@ -2056,6 +2060,7 @@ static struct omap_hwmod am33xx_uart5_hwmod = { .name = "uart5", .class = &uart_class, .clkdm_name = "l4ls_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart5_irqs, .sdma_reqs = uart1_edma_reqs, .main_clk = "dpll_per_m2_div4_ck",
@@ -2076,6 +2081,7 @@ static struct omap_hwmod am33xx_uart6_hwmod = { .name = "uart6", .class = &uart_class, .clkdm_name = "l4ls_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = am33xx_uart6_irqs, .sdma_reqs = uart1_edma_reqs, .main_clk = "dpll_per_m2_div4_ck",
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -0
@@ -490,6 +490,7 @@ static struct omap_hwmod omap3xxx_uart1_hwmod = { .mpu_irqs = omap2_uart1_mpu_irqs, .sdma_reqs = omap2_uart1_sdma_reqs, .main_clk = "uart1_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = CORE_MOD,
@@ -508,6 +509,7 @@ static struct omap_hwmod omap3xxx_uart2_hwmod = { .mpu_irqs = omap2_uart2_mpu_irqs, .sdma_reqs = omap2_uart2_sdma_reqs, .main_clk = "uart2_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = CORE_MOD,
@@ -526,6 +528,7 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = { .mpu_irqs = omap2_uart3_mpu_irqs, .sdma_reqs = omap2_uart3_sdma_reqs, .main_clk = "uart3_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = OMAP3430_PER_MOD,
@@ -555,6 +558,7 @@ static struct omap_hwmod omap36xx_uart4_hwmod = { .mpu_irqs = uart4_mpu_irqs, .sdma_reqs = uart4_sdma_reqs, .main_clk = "uart4_fck", + .flags = HWMOD_SWSUP_SIDLE_ACT, .prcm = { .omap2 = { .module_offs = OMAP3430_PER_MOD,
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -1
@@ -3424,6 +3424,7 @@ static struct omap_hwmod omap44xx_uart1_hwmod = { .name = "uart1", .class = &omap44xx_uart_hwmod_class, .clkdm_name = "l4_per_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = omap44xx_uart1_irqs, .sdma_reqs = omap44xx_uart1_sdma_reqs, .main_clk = "func_48m_fclk",
@@ -3452,6 +3453,7 @@ static struct omap_hwmod omap44xx_uart2_hwmod = { .name = "uart2", .class = &omap44xx_uart_hwmod_class, .clkdm_name = "l4_per_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = omap44xx_uart2_irqs, .sdma_reqs = omap44xx_uart2_sdma_reqs, .main_clk = "func_48m_fclk",
@@ -3480,7 +3482,8 @@ static struct omap_hwmod omap44xx_uart3_hwmod = { .name = "uart3", .class = &omap44xx_uart_hwmod_class, .clkdm_name = "l4_per_clkdm", - .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, + .flags =HWMOD_INIT_NO_IDLE |HWMOD_INIT_NO_RESET | + HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = omap44xx_uart3_irqs, .sdma_reqs = omap44xx_uart3_sdma_reqs, .main_clk = "func_48m_fclk",
@@ -3509,6 +3512,7 @@ static struct omap_hwmod omap44xx_uart4_hwmod = { .name = "uart4", .class = &omap44xx_uart_hwmod_class, .clkdm_name = "l4_per_clkdm", + .flags = HWMOD_SWSUP_SIDLE_ACT, .mpu_irqs = omap44xx_uart4_irqs, .sdma_reqs = omap44xx_uart4_sdma_reqs, .main_clk = "func_48m_fclk",
Signature · 1 line
1.7.9.5
PATCH v2 4/6 SERIAL: OMAP: Remove the slave idle handling from the driver
In reply to Rajendra NayakFrom: Santosh Shilimkar <[email protected]>
UART IP slave idle handling now taken care by runtime pm backend(hwmod layer) so remove the hackery from the driver.
As discussed on the list, in future if dma mode needs to be brought back to this driver, UART sysc handling needs to be updated in framework such a way that no-idle/force idle profile can be supported. Given the broken dma mode for OMAP uarts, its very unlikely.
--- drivers/tty/serial/omap-serial.c | 23 ----------------------- include/linux/platform_data/serial-omap.h | 2 -- 2 files changed, 25 deletions(-)
drivers/tty/serial/omap-serial.c +0 -23
@@ -202,26 +202,6 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)return pdata->get_context_loss_count (up->dev); } -static void serial_omap_set_forceidle (struct uart_omap_port *up) -{ -struct omap_uart_port_info *pdata = up->dev->platform_data; - -if (!pdata || !pdata->set_forceidle) -return ; - - pdata->set_forceidle (up->dev); -} - -static void serial_omap_set_noidle (struct uart_omap_port *up) -{ -struct omap_uart_port_info *pdata = up->dev->platform_data; - -if (!pdata || !pdata->set_noidle) -return ; - - pdata->set_noidle (up->dev); -} -static void serial_omap_enable_wakeup (struct uart_omap_port *up,bool enable) {struct omap_uart_port_info *pdata = up->dev->platform_data;
@@ -298,8 +278,6 @@ static void serial_omap_stop_tx(struct uart_port *port)serial_out (up,UART_IER , up->ier); } -serial_omap_set_forceidle (up); -pm_runtime_mark_last_busy (up->dev);pm_runtime_put_autosuspend (up->dev); }
@@ -364,7 +342,6 @@ static void serial_omap_start_tx(struct uart_port *port)pm_runtime_get_sync (up->dev);serial_omap_enable_ier_thri (up); -serial_omap_set_noidle (up);pm_runtime_mark_last_busy (up->dev);pm_runtime_put_autosuspend (up->dev); }
include/linux/platform_data/serial-omap.h +0 -2
@@ -43,8 +43,6 @@ struct omap_uart_port_info {int DTR_present;int (*get_context_loss_count)(struct device *); -void (*set_forceidle)(struct device *); -void (*set_noidle)(struct device *);void (*enable_wakeup)(struct device *,bool ); };
Signature · 1 line
1.7.9.5
PATCH v2 4/6 SERIAL: OMAP: Remove the slave idle handling from the driver
Quoted 10 lines · Rajendra Nayak
From: Santosh Shilimkar <[email protected]>
UART IP slave idle handling now taken care by runtime pm backend(hwmod layer) so remove the hackery from the driver.
As discussed on the list, in future if dma mode needs to be brought back to this driver, UART sysc handling needs to be updated in framework such a way that no-idle/force idle profile can be supported. Given the broken dma mode for OMAP uarts, its very unlikely.
Quoted 5 lines
Tested-by Vaibhav Bedia <[email protected]>Tested-by Sourav Poddar <[email protected]>Signed-off-by Rajendra nayak <[email protected]>Signed-off-by Santosh Shilimkar <[email protected]>
nit: the ordering of this patch with the following one will break bisect.
IOW, with this patch applied, but not the following one, compilation will be broken because the func pointers are removed from the header, but still used in omap-serial.c.
A simple fix is to just apply the other one first.
Kevin
Quoted 65 lines
--- drivers/tty/serial/omap-serial.c | 23 ----------------------- include/linux/platform_data/serial-omap.h | 2 -- 2 files changed, 25 deletions(-)drivers/tty/serial/omap-serial.c +0
-23@@ -202,26 +202,6 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)return pdata->get_context_loss_count (up->dev); } -static void serial_omap_set_forceidle (struct uart_omap_port *up) -{ -struct omap_uart_port_info *pdata = up->dev->platform_data; - -if (!pdata || !pdata->set_forceidle) -return ; - - pdata->set_forceidle (up->dev); -} - -static void serial_omap_set_noidle (struct uart_omap_port *up) -{ -struct omap_uart_port_info *pdata = up->dev->platform_data; - -if (!pdata || !pdata->set_noidle) -return ; - - pdata->set_noidle (up->dev); -} -static void serial_omap_enable_wakeup (struct uart_omap_port *up,bool enable) {struct omap_uart_port_info *pdata = up->dev->platform_data;@@ -298,8 +278,6 @@ static void serial_omap_stop_tx(struct uart_port *port)serial_out (up,UART_IER , up->ier); } -serial_omap_set_forceidle (up); -pm_runtime_mark_last_busy (up->dev);pm_runtime_put_autosuspend (up->dev); }@@ -364,7 +342,6 @@ static void serial_omap_start_tx(struct uart_port *port)pm_runtime_get_sync (up->dev);serial_omap_enable_ier_thri (up); -serial_omap_set_noidle (up);pm_runtime_mark_last_busy (up->dev);pm_runtime_put_autosuspend (up->dev); }include/linux/platform_data/serial-omap.h +0
-2@@ -43,8 +43,6 @@ struct omap_uart_port_info {int DTR_present;int (*get_context_loss_count)(struct device *); -void (*set_forceidle)(struct device *); -void (*set_noidle)(struct device *);void (*enable_wakeup)(struct device *,bool ); };
PATCH v2 5/6 ARM: OMAP2+: serial: Remove the un-used slave idle hooks
In reply to Rajendra NayakFrom: Santosh Shilimkar <[email protected]>
UART IP idle handling now taken care by runtime pm backend(hwmod) indirectly and OMAP serial driver is also cleaned up accordingly.
So remove the un-used slave idle platforms hooks now.
--- arch/arm/mach-omap2/serial.c | 31 ------------------------------- 1 file changed, 31 deletions(-)
arch/arm/mach-omap2/serial.c +0 -31
@@ -95,38 +95,9 @@ static void omap_uart_enable_wakeup(struct device *dev, bool enable) omap_hwmod_disable_wakeup(od->hwmods[0]); } -/* -* Errata i291: [UART]:Cannot Acknowledge Idle Requests -* in Smartidle Mode When Configured for DMA Operations. -* WA: configure uart in force idle mode. -*/ -static void omap_uart_set_noidle (struct device *dev) -{ -struct platform_device *pdev =to_platform_device (dev); -struct omap_device *od =to_omap_device (pdev); - -omap_hwmod_set_slave_idlemode (od->hwmods[0 ],HWMOD_IDLEMODE_NO ); -} - -static void omap_uart_set_smartidle (struct device *dev) -{ -struct platform_device *pdev =to_platform_device (dev); -struct omap_device *od =to_omap_device (pdev); -u8 idlemode; - -if (od->hwmods[0 ]->class->sysc->idlemodes &SIDLE_SMART_WKUP ) - idlemode =HWMOD_IDLEMODE_SMART_WKUP ; -else - idlemode =HWMOD_IDLEMODE_SMART ; - -omap_hwmod_set_slave_idlemode (od->hwmods[0 ], idlemode); -} -#else static void omap_uart_enable_wakeup (struct device *dev,bool enable) {} -static void omap_uart_set_noidle (struct device *dev) {} -static void omap_uart_set_smartidle (struct device *dev) {}#endif /* CONFIG_PM */ #ifdef CONFIG_OMAP_MUX
@@ -299,8 +270,6 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, omap_up.uartclk =OMAP24XX_BASE_BAUD *16 ; omap_up.flags =UPF_BOOT_AUTOCONF ; omap_up.get_context_loss_count = omap_pm_get_dev_context_loss_count; - omap_up.set_forceidle = omap_uart_set_smartidle; - omap_up.set_noidle = omap_uart_set_noidle; omap_up.enable_wakeup = omap_uart_enable_wakeup; omap_up.dma_rx_buf_size = info->dma_rx_buf_size; omap_up.dma_rx_timeout = info->dma_rx_timeout;
Signature · 1 line
1.7.9.5
PATCH v2 6/6 ARM: OMAP2+: hwmod: Remove sysc slave idle and auto idle apis
In reply to Rajendra NayakFrom: Santosh Shilimkar <[email protected]>
With the OMAP serial driver sysc cleanup patches in this series, we can now remove the hwmod external apis for sysc fiddling.
While at this, also remove unused sysc auto idle api from hwmod code.
--- arch/arm/mach-omap2/omap_hwmod.c | 68 -------------------------------------- arch/arm/mach-omap2/omap_hwmod.h | 3 -- 2 files changed, 71 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +0 -68
@@ -2249,42 +2249,6 @@ static int _idle(struct omap_hwmod *oh) }/** -* omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit -* @oh: struct omap_hwmod * -* @autoidle: desired AUTOIDLE bitfield value (0 or 1) -* -* Sets the IP block's OCP autoidle bit in hardware, and updates our -* local copy. Intended to be used by drivers that require -* direct manipulation of the AUTOIDLE bits. -* Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes -* along the return value from _set_module_autoidle(). -* -* Any users of this function should be scrutinized carefully. -*/ -int omap_hwmod_set_ocp_autoidle (struct omap_hwmod *oh,u8 autoidle) -{ -u32 v; -int retval =0 ; -unsigned long flags; - -if (!oh || oh->_state != _HWMOD_STATE_ENABLED) -return -EINVAL ; - -spin_lock_irqsave (&oh->_lock, flags); - - v = oh->_sysc_cache; - - retval =_set_module_autoidle (oh, autoidle, &v); - -if (!retval) -_write_sysconfig (v, oh); - -spin_unlock_irqrestore (&oh->_lock, flags); - -return retval; -} - -/** * _shutdown - shutdown an omap_hwmod * @oh: struct omap_hwmod * *
@@ -3145,38 +3109,6 @@ error: }/** -* omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode -* @oh: struct omap_hwmod * -* @idlemode: SIDLEMODE field bits (shifted to bit 0) -* -* Sets the IP block's OCP slave idlemode in hardware, and updates our -* local copy. Intended to be used by drivers that have some erratum -* that requires direct manipulation of the SIDLEMODE bits. Returns -* -EINVAL if @oh is null, or passes along the return value from -* _set_slave_idlemode(). -* -* XXX Does this function have any current users? If not, we should -* remove it; it is better to let the rest of the hwmod code handle this. -* Any users of this function should be scrutinized carefully. -*/ -int omap_hwmod_set_slave_idlemode (struct omap_hwmod *oh,u8 idlemode) -{ -u32 v; -int retval =0 ; - -if (!oh) -return -EINVAL ; - - v = oh->_sysc_cache; - - retval =_set_slave_idlemode (oh, idlemode, &v); -if (!retval) -_write_sysconfig (v, oh); - -return retval; -} - -/** * omap_hwmod_lookup - look up a registered omap_hwmod by name * @name: name of the omap_hwmod to look up *
arch/arm/mach-omap2/omap_hwmod.h +0 -3
@@ -640,9 +640,6 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);int omap_hwmod_enable_clocks (struct omap_hwmod *oh);int omap_hwmod_disable_clocks (struct omap_hwmod *oh); -int omap_hwmod_set_slave_idlemode (struct omap_hwmod *oh,u8 idlemode); -int omap_hwmod_set_ocp_autoidle (struct omap_hwmod *oh,u8 autoidle); -int omap_hwmod_reset (struct omap_hwmod *oh);void omap_hwmod_ocp_barrier (struct omap_hwmod *oh);
Signature · 1 line
1.7.9.5
v2 cover ARM; OMAP2+: hwmod and SERIAL: Remove sysc handling from driver
In reply to Rajendra NayakRajendra Nayak <[email protected]> writes:
[...]
Quoted 9 lines
OMAP UART IP needs manual idle modes based on functional state of the IP. Currently this is handled by the driver with function pointers implemented in platform code.
This however breaks in case of device tree because of missing idle handling.
The series tries to address the issue and tries to remove complete sysc handling from serial driver.
Other than the minor nit about the order of the series for bisect,
Also tested this on OMAP4/Panda where I was having the sluggish console issues using DT boot, and and can confirm that this fixes the problem:
Kevin
v2 cover ARM; OMAP2+: hwmod and SERIAL: Remove sysc handling from driver
Quoted 14 lines · Kevin Hilman
Rajendra Nayak <[email protected]> writes:
[...]
Quoted 9 lines
OMAP UART IP needs manual idle modes based on functional state of the IP. Currently this is handled by the driver with function pointers implemented in platform code.
This however breaks in case of device tree because of missing idle handling.
The series tries to address the issue and tries to remove complete sysc handling from serial driver.
Quoted 9 lines
Other than the minor nit about the order of the series for bisect,
Reviewed-by Kevin Hilman <[email protected]>Also tested this on OMAP4/Panda where I was having the sluggish console issues using DT boot, and and can confirm that this fixes the problem:
I saw the same let of console sluggishness on SDP4430, Panda, Panda-ES as well on latest linus master.
For reference, I have rebased the series to latest master and fixes the
sequencing:
https://github.com/nmenon/linux-2.6-playground/commits/push/uart-fixes-sidle-3.10
based on:
master 70eba42 Merge tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Rajendra,
Would you be able to repost this series so that we can get this into 3.10-rc2+?
Signature · 2 lines
Regards, Nishanth Menon
v2 cover ARM; OMAP2+: hwmod and SERIAL: Remove sysc handling from driver
Quoted 33 lines · Nishanth Menon
Quoted 14 lines · Kevin Hilman
Rajendra Nayak <[email protected]> writes:
[...]
Quoted 9 lines
OMAP UART IP needs manual idle modes based on functional state of the IP. Currently this is handled by the driver with function pointers implemented in platform code.
This however breaks in case of device tree because of missing idle handling.
The series tries to address the issue and tries to remove complete sysc handling from serial driver.
Quoted 9 lines
Other than the minor nit about the order of the series for bisect,
Reviewed-by Kevin Hilman <[email protected]>Also tested this on OMAP4/Panda where I was having the sluggish console issues using DT boot, and and can confirm that this fixes the problem:
I saw the same let of console sluggishness on SDP4430, Panda, Panda-ES as well on latest linus master.
For reference, I have rebased the series to latest master and fixes the
sequencing:
https://github.com/nmenon/linux-2.6-playground/commits/push/uart-fixes-sidle-3.10
based on:
master 70eba42 Merge tag 'please-pull-pstore' ofgit://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Quoted 3 lines
Rajendra,
Would you be able to repost this series so that we can get this into 3.10-rc2+?
Tony/Paul,
I just posted the v3 of these out [1] based off 3.10-rc1. Can we pull these in into -rc since these actually fix the console sluggishness introduced in this merge window (we always had issues with UART sidle handling with DT but never saw issues in mainline because of some static deps which got removed this merge window I guess which would otherwise hide the issue).
regards,
Rajendra
[1] http://marc.info/?l=linux-omap&m=136862939928398&w=2