Skip to contentSkip to conversation

SERIAL: OMAP: Remove idle handling from driver

PATCH New Santosh Shilimkar 3 participants 15 messages Feb 15, 2013 – Feb 18, 2013

lore
Share & tools
lore
#0 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Santosh Shilimkar (2):
ARM: OMAP2+: hwmod-data: UART IP needs software control of sidle
modes
SERIAL: OMAP: Remove the idle handling from the driver

 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 ---------------
 6 files changed, 18 insertions(+), 55 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Hi,

Quoted 7 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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.

Quoted 8 lines

The series tries to address the issue

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Tested this series on omap3630 beagle board for:
1. Retention in idle and suspend.
2. Off mode in idle and suspend.

Quoted 13 lines

Santosh Shilimkar (2):
ARM: OMAP2+: hwmod-data: UART IP needs software control of sidle
modes
SERIAL: OMAP: Remove the idle handling from the driver

  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 ---------------
  6 files changed, 18 insertions(+), 55 deletions(-)
#2 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 15 lines · On Fri, Feb 15, 2013 at 06:33:58PM +0530, a0131647 wrote:

Hi,

Quoted 13 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Quoted 7 lines
Quoted 2 lines

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Tested this series on omap3630 beagle board for:
1. Retention in idle and suspend.
2. Off mode in idle and suspend.

try setting autosuspend_delay to -1

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130215/a6093ebf/attachment.sig>
#3 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 18 lines · Felipe Balbi
Quoted 17 lines · On Fri, Feb 15, 2013 at 06:33:58PM +0530, a0131647 wrote:

Hi,

Quoted 15 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Quoted 7 lines
Quoted 5 lines

Tested this series on omap3630 beagle board for:
1. Retention in idle and suspend.
2. Off mode in idle and suspend.

try setting autosuspend_delay to -1

Also try DT boot and try to wakeup from echo mem > /sys/power/state by sending data through UART console.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130215/096d3ebe/attachment-0001.sig>
#4 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Hi,

Quoted 19 lines · Felipe Balbi
Quoted 18 lines · Felipe Balbi
Quoted 17 lines · On Fri, Feb 15, 2013 at 06:33:58PM +0530, a0131647 wrote:

Hi,

Quoted 15 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

Tested this series on omap3630 beagle board for:
1. Retention in idle and suspend.
2. Off mode in idle and suspend.

try setting autosuspend_delay to -1

Also try DT boot and try to wakeup from echo mem> /sys/power/state by sending data through UART console.

Suspend/resume with dt is not functional with the current mainline.

~Sourav

#5 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 25 lines · On Friday 15 February 2013 07:12 PM, a0131647 wrote:

Hi,

Quoted 23 lines · Felipe Balbi
Quoted 22 lines · Felipe Balbi
Quoted 21 lines · On Fri, Feb 15, 2013 at 06:33:58PM +0530, a0131647 wrote:

Hi,

Quoted 7 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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.

Quoted 8 lines

The series tries to address the issue

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Tested this series on omap3630 beagle board for:
1. Retention in idle and suspend.
2. Off mode in idle and suspend.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

try setting autosuspend_delay to -1

Also try DT boot and try to wakeup from echo mem> /sys/power/state by sending data through UART console.

Suspend/resume with dt is not functional with the current mainline.

With DT, suspend driver itself are not getting registered. The patch is in Paul's queue [1]

regards,
Santosh

[1] https://patchwork-mail2.kernel.org/patch/2116671/

#6 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

In reply to Santosh Shilimkar
Quoted 13 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Quoted 7 lines

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Santosh Shilimkar (2):
ARM: OMAP2+: hwmod-data: UART IP needs software control of sidle
modes
SERIAL: OMAP: Remove the idle handling from the driver

HWMOD_SWSUP_SIDLE flag will is not what will help UART completely. Also considering UART also needs async wakeup enabled as it implements another such hook and attaches that through function pointer.

So some more work is needed to get that sorted out at least from sysc point of view. That way we can deal with io_ring stuff using pin control APIs.

Some patches will follow in attempt to address it. Stay tuned !!

Regards,
Santosh

#7 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Hi,

Quoted 16 lines · Santosh Shilimkar
Quoted 15 lines · Santosh Shilimkar

OMAP UART IP needs manual idle modes based on 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

Patches has been tested on OMAP4 and OMAP5 devices where the console slugishness was observed without idle mode handling. CPUIDLE and suspend tested ok on these devices.

Need help in testing on OMAP2, OMAP3 and AM3XXX devices.

Quoted 8 lines
Quoted 5 lines

Santosh Shilimkar (2):
ARM: OMAP2+: hwmod-data: UART IP needs software control of sidle
modes
SERIAL: OMAP: Remove the idle handling from the driver

HWMOD_SWSUP_SIDLE flag will is not what will help UART completely. Also considering UART also needs async wakeup enabled as it implements another such hook and attaches that through function pointer.

this is exactly what I said at [1], which I quote:

"Also, $SUBJECT isn't improving the situation regarding UART Wakeup, there is still the regression of UART never being wakeup capable.

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

Quoted 5 lines

So some more work is needed to get that sorted out at least from sysc point of view. That way we can deal with io_ring stuff using pin control APIs.

Some patches will follow in attempt to address it. Stay tuned !!

good

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130218/e4de2d46/attachment.sig>
#8 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 11 lines · Felipe Balbi
Quoted 3 lines

HWMOD_SWSUP_SIDLE flag will is not what will help UART completely. Also considering UART also needs async wakeup enabled as it implements another such hook and attaches that through function pointer.

this is exactly what I said at [1], which I quote:

"Also, $SUBJECT isn't improving the situation regarding UART Wakeup, there is still the regression of UART never being wakeup capable.

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

[1] http://marc.info/?l=linux-omap&m=136093334914275&w=2

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130218/bb90f34d/attachment.sig>
#9 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 10 lines · Felipe Balbi
Quoted 9 lines · Felipe Balbi
Quoted 3 lines

HWMOD_SWSUP_SIDLE flag will is not what will help UART completely. Also considering UART also needs async wakeup enabled as it implements another such hook and attaches that through function pointer.

this is exactly what I said at [1], which I quote:

"Also, $SUBJECT isn't improving the situation regarding UART Wakeup, there is still the regression of UART never being wakeup capable.

I also mentioned that am not touching the wakeup function pointer. The reason an alternate is needed because wakeup function pointer back-end comes in between. And the existing SW control flag isn't intended completely for the purpose what we wanted to use for uart. And I didn't expected the wakeup crap will come in between an implementation of just slave idle bits.

Quoted 5 lines
Quoted 2 lines

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

[1] http://marc.info/?l=linux-omap&m=136093334914275&w=2

The main need for uart wakeup is the io_ring() trigger and that needs to happen via generic pin control API. SYSC wakeup bit isn't something needs to be toggled so that can be decoupled. So again the idea is to make SYSC handling transparent to UART drivers and let driver toggle the io_ring() based on ->set_wake() as it is done today.

Regards,
Santosh

#10 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Hi,

Quoted 10 lines · Santosh Shilimkar
Quoted 5 lines
Quoted 2 lines

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

[1] http://marc.info/?l=linux-omap&m=136093334914275&w=2

The main need for uart wakeup is the io_ring() trigger and that needs to happen via generic pin control API. SYSC wakeup bit isn't something needs to be toggled so that can be decoupled. So again the idea is to make SYSC handling transparent to UART drivers and let driver toggle the io_ring() based on ->set_wake() as it is done today.

We're either reading different code bases or not understanding each other. Currently this is how ->set_wake() is implemented:

serial_omap_set_wake()
serial_omap_enable_wakeup()
omap_uart_enable_wakeup()
omap_hwmod_enable_wakeup()

    if (SYSC_HAS_ENAWAKEUP) {	/* true for UART */
     _enable_wakeup()
     _write_sysconfig()
    }
    set_idle_ioring_wakeup()
     if (!oh->mux || !oh->mux->enabled)
      return;

If I read the code correctly there's nothing setting oh->mux during DT boot. The only caller to omap_hwmod_mux_init() (which allocates and returns omap_hwmod_mux_info pointer) is arch/arm/mach-omap2/devices.c::omap4_keyboard_init(). This has nothing to do with UART and, even more importantly, isn't even called during a DT boot.

So, is there something else setting oh->mux to a valid pointer and actually making set_idle_ioring_wakeup() do something useful ?

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130218/7a014e89/attachment-0001.sig>
#11 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 29 lines · Felipe Balbi

Hi,

Quoted 10 lines · Santosh Shilimkar
Quoted 5 lines
Quoted 2 lines

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

[1] http://marc.info/?l=linux-omap&m=136093334914275&w=2

The main need for uart wakeup is the io_ring() trigger and that needs to happen via generic pin control API. SYSC wakeup bit isn't something needs to be toggled so that can be decoupled. So again the idea is to make SYSC handling transparent to UART drivers and let driver toggle the io_ring() based on ->set_wake() as it is done today.

We're either reading different code bases or not understanding each other. Currently this is how ->set_wake() is implemented:

serial_omap_set_wake()
serial_omap_enable_wakeup()
omap_uart_enable_wakeup()
omap_hwmod_enable_wakeup()

    if (SYSC_HAS_ENAWAKEUP) {	/* true for UART */
     _enable_wakeup()
     _write_sysconfig()
    }
    set_idle_ioring_wakeup()
     if (!oh->mux || !oh->mux->enabled)
      return;
Quoted 4 lines

If I read the code correctly there's nothing setting oh->mux during DT boot. The only caller to omap_hwmod_mux_init() (which allocates and returns omap_hwmod_mux_info pointer) is arch/arm/mach-omap2/devices.c::omap4_keyboard_init(). This has nothing

actually arch/arm/mach-omap2/serial.c::omap_serial_init_port() also calls that, but it's also not used during DT boots.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130218/9f1b7bf9/attachment.sig>
#12 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 18 lines · Felipe Balbi
Quoted 17 lines · Felipe Balbi

Hi,

Quoted 10 lines · Santosh Shilimkar
Quoted 5 lines
Quoted 2 lines

I wonder what are your ideas to sort that part out, I mean, how do you plan to implement ->set_wake() for the tty port ?"

[1] http://marc.info/?l=linux-omap&m=136093334914275&w=2

The main need for uart wakeup is the io_ring() trigger and that needs to happen via generic pin control API. SYSC wakeup bit isn't something needs to be toggled so that can be decoupled. So again the idea is to make SYSC handling transparent to UART drivers and let driver toggle the io_ring() based on ->set_wake() as it is done today.

We're either reading different code bases or not understanding each other. Currently this is how ->set_wake() is implemented:

Quoted 6 lines
Quoted 6 lines

serial_omap_set_wake()
serial_omap_enable_wakeup()
omap_uart_enable_wakeup()
omap_hwmod_enable_wakeup()
if (SYSC_HAS_ENAWAKEUP) { /* true for UART */
_enable_wakeup()

There is no need to toggle this one. It can be set once and left as is.

Quoted 3 lines
Quoted 3 lines
      _write_sysconfig()
     }
     set_idle_ioring_wakeup()

So this is the part, we need to hookup with pads.

Quoted 11 lines
Quoted 7 lines
      if (!oh->mux || !oh->mux->enabled)
       return;

If I read the code correctly there's nothing setting oh->mux during DT boot. The only caller to omap_hwmod_mux_init() (which allocates and returns omap_hwmod_mux_info pointer) is arch/arm/mach-omap2/devices.c::omap4_keyboard_init(). This has nothing

actually arch/arm/mach-omap2/serial.c::omap_serial_init_port() also calls that, but it's also not used during DT boots.

DT boot, all the function pointers are broken so wakeup as well as slave idle-mode is broken. Nothing new here. Serial file does set the pads as you noticed and this is what can be offloaded to generic pint control which can triggered from driver.

Regards,
Santosh

#13 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Hi,

Quoted 5 lines · Santosh Shilimkar
Quoted 5 lines
Quoted 4 lines

If I read the code correctly there's nothing setting oh->mux during DT boot. The only caller to omap_hwmod_mux_init() (which allocates and returns omap_hwmod_mux_info pointer) is arch/arm/mach-omap2/devices.c::omap4_keyboard_init(). This has nothing

Quoted 7 lines
Quoted 3 lines

actually arch/arm/mach-omap2/serial.c::omap_serial_init_port() also calls that, but it's also not used during DT boots.

DT boot, all the function pointers are broken so wakeup as well as slave idle-mode is broken. Nothing new here. Serial file does set the pads as you noticed and this is what can be offloaded to generic pint control which can triggered from driver.

fair enough, understood now.

cheers

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130218/10c134e7/attachment.sig>
#14 lore raw

cover SERIAL: OMAP: Remove idle handling from driver

Quoted 11 lines · Felipe Balbi

Hi,

Quoted 8 lines · Santosh Shilimkar
Quoted 8 lines
Quoted 4 lines

If I read the code correctly there's nothing setting oh->mux during DT boot. The only caller to omap_hwmod_mux_init() (which allocates and returns omap_hwmod_mux_info pointer) is arch/arm/mach-omap2/devices.c::omap4_keyboard_init(). This has nothing

actually arch/arm/mach-omap2/serial.c::omap_serial_init_port() also calls that, but it's also not used during DT boots.

Quoted 7 lines
Quoted 4 lines

DT boot, all the function pointers are broken so wakeup as well as slave idle-mode is broken. Nothing new here. Serial file does set the pads as you noticed and this is what can be offloaded to generic pint control which can triggered from driver.

fair enough, understood now.

Just keep the thread posted, the slave idle handling with *wakeup* bit is sorted out now. We are looking at the io_ring() and pad wakeup stuff now. Once we have that working, we will repost the series.

Regards,
Santosh