mbox series

[v1,0/2] Input: ads7846: reduce SPI related CPU load

Message ID 20201110085041.16303-1-o.rempel@pengutronix.de
Headers show
Series Input: ads7846: reduce SPI related CPU load | expand

Message

Oleksij Rempel Nov. 10, 2020, 8:50 a.m. UTC
changes v2:
- add back settle_delay_usecs support
- execute power down on the end of the main transfer.
- make it work with 2.5MHz SPI clock

This series is optimizing SPI transfer related CPU load.

Oleksij Rempel (2):
  Input: ads7846: convert to full duplex
  Input: ads7846: convert to one message

 drivers/input/touchscreen/ads7846.c | 456 ++++++++++++----------------
 1 file changed, 199 insertions(+), 257 deletions(-)

Comments

Dmitry Torokhov Nov. 18, 2020, 12:31 a.m. UTC | #1
On Tue, Nov 10, 2020 at 09:50:41AM +0100, Oleksij Rempel wrote:
> Convert multiple full duplex transfers in to a single transfer to reduce
> CPU load.
> 
> Current driver version support following filtering modes:
> - ads7846_no_filter() - not filtered
> - ads7846_debounce_filter() - driver specific debounce filter
> - pdata->filter - platform specific debounce filter (do any platform
> 	provides such filter?)
> 
> Without filter this HW is not really usable, since the physic of
> resistive touchscreen can provide some bounce effects. With driver internal
> filter, we have constant amount of retries + debounce retries if some anomaly
> was detected.
> 
> High amount of tiny SPI transfers is the primer reason of high CPU load
> and interrupt frequency.
> 
> This patch create one SPI transfer with all fields and not optional retires. If
> bounce anomaly was detected, we will make more transfer if needed.
> 
> Without this patch, we will get about 10% CPU load on iMX6S on pen-down event.
> For example by holding stylus on the screen.
> 
> With this patch, depending in the amount of retries, the CPU load will
> be 1% with "ti,debounce-rep = <3>".
> 
> One buffer transfer allows us to use PIO FIFO or DMA engine, depending
> on the platform.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Applied, thank you.
Oleksij Rempel Jan. 20, 2021, 7:40 a.m. UTC | #2
Hi Dmitry,

On Tue, Nov 17, 2020 at 04:31:38PM -0800, Dmitry Torokhov wrote:
> On Tue, Nov 10, 2020 at 09:50:41AM +0100, Oleksij Rempel wrote:

> > Convert multiple full duplex transfers in to a single transfer to reduce

> > CPU load.

> > 

> > Current driver version support following filtering modes:

> > - ads7846_no_filter() - not filtered

> > - ads7846_debounce_filter() - driver specific debounce filter

> > - pdata->filter - platform specific debounce filter (do any platform

> > 	provides such filter?)

> > 

> > Without filter this HW is not really usable, since the physic of

> > resistive touchscreen can provide some bounce effects. With driver internal

> > filter, we have constant amount of retries + debounce retries if some anomaly

> > was detected.

> > 

> > High amount of tiny SPI transfers is the primer reason of high CPU load

> > and interrupt frequency.

> > 

> > This patch create one SPI transfer with all fields and not optional retires. If

> > bounce anomaly was detected, we will make more transfer if needed.

> > 

> > Without this patch, we will get about 10% CPU load on iMX6S on pen-down event.

> > For example by holding stylus on the screen.

> > 

> > With this patch, depending in the amount of retries, the CPU load will

> > be 1% with "ti,debounce-rep = <3>".

> > 

> > One buffer transfer allows us to use PIO FIFO or DMA engine, depending

> > on the platform.

> > 

> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

> 

> Applied, thank you.


I can't find this patch in your git repository. Should I rebase it
against latest git and resend it?

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Dmitry Torokhov Jan. 21, 2021, 7:24 a.m. UTC | #3
On Wed, Jan 20, 2021 at 08:40:32AM +0100, Oleksij Rempel wrote:
> 
> Hi Dmitry,
> 
> On Tue, Nov 17, 2020 at 04:31:38PM -0800, Dmitry Torokhov wrote:
> > On Tue, Nov 10, 2020 at 09:50:41AM +0100, Oleksij Rempel wrote:
> > > Convert multiple full duplex transfers in to a single transfer to reduce
> > > CPU load.
> > > 
> > > Current driver version support following filtering modes:
> > > - ads7846_no_filter() - not filtered
> > > - ads7846_debounce_filter() - driver specific debounce filter
> > > - pdata->filter - platform specific debounce filter (do any platform
> > > 	provides such filter?)
> > > 
> > > Without filter this HW is not really usable, since the physic of
> > > resistive touchscreen can provide some bounce effects. With driver internal
> > > filter, we have constant amount of retries + debounce retries if some anomaly
> > > was detected.
> > > 
> > > High amount of tiny SPI transfers is the primer reason of high CPU load
> > > and interrupt frequency.
> > > 
> > > This patch create one SPI transfer with all fields and not optional retires. If
> > > bounce anomaly was detected, we will make more transfer if needed.
> > > 
> > > Without this patch, we will get about 10% CPU load on iMX6S on pen-down event.
> > > For example by holding stylus on the screen.
> > > 
> > > With this patch, depending in the amount of retries, the CPU load will
> > > be 1% with "ti,debounce-rep = <3>".
> > > 
> > > One buffer transfer allows us to use PIO FIFO or DMA engine, depending
> > > on the platform.
> > > 
> > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > 
> > Applied, thank you.
> 
> I can't find this patch in your git repository. Should I rebase it
> against latest git and resend it?

Ugh, sorry, now applied for realz.

Thanks.