Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-05-04 Thread Jonathan Liu
On 24 September 2016 at 00:03, Olliver Schinagl wrote: > You are welcome, but there's some work still being done in this regard, or > rather, i have to find time to grab a scope and properly check the output. > So expect the proper fix to be coming to a kernel near you soon :)

Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-05-04 Thread Jonathan Liu
On 24 September 2016 at 00:03, Olliver Schinagl wrote: > You are welcome, but there's some work still being done in this regard, or > rather, i have to find time to grab a scope and properly check the output. > So expect the proper fix to be coming to a kernel near you soon :) > > Meanwhile, it

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Thierry Reding
On Tue, Jan 03, 2017 at 05:55:54PM +0100, Alexandre Belloni wrote: > On 03/01/2017 at 16:59:57 +0100, Olliver Schinagl wrote : > > On 12-12-16 13:24, Maxime Ripard wrote: > > > On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > > > > Hey Maxime, > > > > > > > > first off, also

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Thierry Reding
On Tue, Jan 03, 2017 at 05:55:54PM +0100, Alexandre Belloni wrote: > On 03/01/2017 at 16:59:57 +0100, Olliver Schinagl wrote : > > On 12-12-16 13:24, Maxime Ripard wrote: > > > On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > > > > Hey Maxime, > > > > > > > > first off, also

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Alexandre Belloni
On 03/01/2017 at 16:59:57 +0100, Olliver Schinagl wrote : > On 12-12-16 13:24, Maxime Ripard wrote: > > On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > > > Hey Maxime, > > > > > > first off, also sorry for the slow delay :) (pun not intended) > > > > > > On 27-08-16 00:19,

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Alexandre Belloni
On 03/01/2017 at 16:59:57 +0100, Olliver Schinagl wrote : > On 12-12-16 13:24, Maxime Ripard wrote: > > On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > > > Hey Maxime, > > > > > > first off, also sorry for the slow delay :) (pun not intended) > > > > > > On 27-08-16 00:19,

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Olliver Schinagl
Hey Maxime, Happy new year! I'm sorry that I missed your previous mail! I completely looked over it. Sorry! On 12-12-16 13:24, Maxime Ripard wrote: On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: Hey Maxime, first off, also sorry for the slow delay :) (pun not intended)

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2017-01-03 Thread Olliver Schinagl
Hey Maxime, Happy new year! I'm sorry that I missed your previous mail! I completely looked over it. Sorry! On 12-12-16 13:24, Maxime Ripard wrote: On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: Hey Maxime, first off, also sorry for the slow delay :) (pun not intended)

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-12-12 Thread Maxime Ripard
On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > Hey Maxime, > > first off, also sorry for the slow delay :) (pun not intended) > > On 27-08-16 00:19, Maxime Ripard wrote: > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > When we inform the PWM block

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-12-12 Thread Maxime Ripard
On Thu, Dec 08, 2016 at 02:23:39PM +0100, Olliver Schinagl wrote: > Hey Maxime, > > first off, also sorry for the slow delay :) (pun not intended) > > On 27-08-16 00:19, Maxime Ripard wrote: > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > When we inform the PWM block

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-27 Thread Maxime Ripard
Hi, On Mon, Sep 26, 2016 at 10:46:25AM +0200, Olliver Schinagl wrote: > > For the spin_lock part, I was just comparing it to a > > spin_lock_irqsave, which is pretty expensive since it masks all the > > interrupts in the system, introducing latencies. > > so spin_lock is very expensive and we

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-27 Thread Maxime Ripard
Hi, On Mon, Sep 26, 2016 at 10:46:25AM +0200, Olliver Schinagl wrote: > > For the spin_lock part, I was just comparing it to a > > spin_lock_irqsave, which is pretty expensive since it masks all the > > interrupts in the system, introducing latencies. > > so spin_lock is very expensive and we

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-26 Thread Olliver Schinagl
On za, 2016-09-24 at 22:25 +0200, Maxime Ripard wrote: > Hi Oliver, > > Sorry for the slow answer. > > On Fri, Sep 09, 2016 at 11:01:08AM +0200, Olliver Schinagl wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > *chip, struct pwm_device *pwm) > > > > > >  

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-26 Thread Olliver Schinagl
On za, 2016-09-24 at 22:25 +0200, Maxime Ripard wrote: > Hi Oliver, > > Sorry for the slow answer. > > On Fri, Sep 09, 2016 at 11:01:08AM +0200, Olliver Schinagl wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > *chip, struct pwm_device *pwm) > > > > > >  

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-26 Thread Maxime Ripard
Hi Oliver, Sorry for the slow answer. On Fri, Sep 09, 2016 at 11:01:08AM +0200, Olliver Schinagl wrote: > > > > > *chip, struct pwm_device *pwm) > > > > >   spin_lock(_pwm->ctrl_lock); > > > > >   val = sun4i_pwm_readl(sun4i_pwm, PWM_CTRL_REG); > > > > >   val &= ~BIT_CH(PWM_EN,

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-26 Thread Maxime Ripard
Hi Oliver, Sorry for the slow answer. On Fri, Sep 09, 2016 at 11:01:08AM +0200, Olliver Schinagl wrote: > > > > > *chip, struct pwm_device *pwm) > > > > >   spin_lock(_pwm->ctrl_lock); > > > > >   val = sun4i_pwm_readl(sun4i_pwm, PWM_CTRL_REG); > > > > >   val &= ~BIT_CH(PWM_EN,

Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-23 Thread Olliver Schinagl
Hey Jonathan, On 23-09-16 16:02, Jonathan Liu wrote: On 26 August 2016 at 03:50, wrote: When we inform the PWM block to stop toggeling the output, we may end up in a state where the output is not what we would expect (e.g. not the low-pulse) but whatever the output was

Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-23 Thread Olliver Schinagl
Hey Jonathan, On 23-09-16 16:02, Jonathan Liu wrote: On 26 August 2016 at 03:50, wrote: When we inform the PWM block to stop toggeling the output, we may end up in a state where the output is not what we would expect (e.g. not the low-pulse) but whatever the output was at when the clock got

Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-23 Thread Jonathan Liu
On 26 August 2016 at 03:50, wrote: > When we inform the PWM block to stop toggeling the output, we may end up > in a state where the output is not what we would expect (e.g. not the > low-pulse) but whatever the output was at when the clock got disabled. > > To counter this

Re: [1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-23 Thread Jonathan Liu
On 26 August 2016 at 03:50, wrote: > When we inform the PWM block to stop toggeling the output, we may end up > in a state where the output is not what we would expect (e.g. not the > low-pulse) but whatever the output was at when the clock got disabled. > > To counter this we have to wait for

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-09 Thread Olliver Schinagl
On di, 2016-09-06 at 21:51 +0200, Maxime Ripard wrote: > On Tue, Sep 06, 2016 at 09:12:56AM +0200, Olliver Schinagl wrote: > > > > Hi Maxime!, > > > > On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > > > > > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > >

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-09 Thread Olliver Schinagl
On di, 2016-09-06 at 21:51 +0200, Maxime Ripard wrote: > On Tue, Sep 06, 2016 at 09:12:56AM +0200, Olliver Schinagl wrote: > > > > Hi Maxime!, > > > > On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > > > > > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > >

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-06 Thread Maxime Ripard
On Tue, Sep 06, 2016 at 09:12:56AM +0200, Olliver Schinagl wrote: > Hi Maxime!, > > On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > > > When we inform the PWM block to stop toggeling the output, we may > > > end

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-06 Thread Maxime Ripard
On Tue, Sep 06, 2016 at 09:12:56AM +0200, Olliver Schinagl wrote: > Hi Maxime!, > > On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > > > When we inform the PWM block to stop toggeling the output, we may > > > end

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-06 Thread Olliver Schinagl
Hi Maxime!, On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > When we inform the PWM block to stop toggeling the output, we may > > end up > > in a state where the output is not what we would expect (e.g. not > >

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-09-06 Thread Olliver Schinagl
Hi Maxime!, On za, 2016-08-27 at 00:19 +0200, Maxime Ripard wrote: > On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > > > > When we inform the PWM block to stop toggeling the output, we may > > end up > > in a state where the output is not what we would expect (e.g. not > >

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-08-26 Thread Maxime Ripard
On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > When we inform the PWM block to stop toggeling the output, we may end up > in a state where the output is not what we would expect (e.g. not the > low-pulse) but whatever the output was at when the clock got disabled. > > To

Re: [PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-08-26 Thread Maxime Ripard
On Thu, Aug 25, 2016 at 07:50:10PM +0200, Olliver Schinagl wrote: > When we inform the PWM block to stop toggeling the output, we may end up > in a state where the output is not what we would expect (e.g. not the > low-pulse) but whatever the output was at when the clock got disabled. > > To

[PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-08-25 Thread Olliver Schinagl
When we inform the PWM block to stop toggeling the output, we may end up in a state where the output is not what we would expect (e.g. not the low-pulse) but whatever the output was at when the clock got disabled. To counter this we have to wait for maximally the time of one whole period to

[PATCH 1/2] pwm: sunxi: allow the pwm to finish its pulse before disable

2016-08-25 Thread Olliver Schinagl
When we inform the PWM block to stop toggeling the output, we may end up in a state where the output is not what we would expect (e.g. not the low-pulse) but whatever the output was at when the clock got disabled. To counter this we have to wait for maximally the time of one whole period to