[Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes

Peter Maydell posted 4 patches 7 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180703171044.9503-1-peter.maydell@linaro.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
include/hw/ptimer.h        |  9 +++++++++
hw/core/ptimer.c           | 22 +++++++++++++++++++++-
hw/timer/cmsdk-apb-timer.c | 20 ++++++++++++++++++--
tests/ptimer-test.c        | 25 +++++++++++++++++++------
4 files changed, 67 insertions(+), 9 deletions(-)
[Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes
Posted by Peter Maydell 7 years, 4 months ago
This patchseries includes Guenter's recent patch to suppress
warning messages from the ptimer layer that otherwise occur
from the way the Linux driver for this timer device operates.

The other patches here fix more obscure things:
 * the timer interrupt is only supposed to trigger when the
   counter counts down from 1 to 0, not if it is at 0 for
   some other reason like a direct write of 0 to the VALUE register.
   Handling this requires adding a new policy option to the ptimer
   code, which is what patch 1 does.
 * we were incorrectly setting the NO_IMMEDIATE_TRIGGER
   ptimer policy, which meant we would trigger the interrupt
   one timer clock too late (when we did the timer reload,
   rather than on the 1-to-0 counter transition)
 * if the ptimer had already disabled itself because it was
   in one-shot mode and had expired, writing to RELOAD or
   VALUE needs to cause it to start counting again

Tested with a uCLinux/mps2 kernel and buildroot initfs.

thanks
-- PMM

Guenter Roeck (1):
  hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode

Peter Maydell (3):
  ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option
  hw/timer/cmsdk-apb-timer: Correct ptimer policy settings
  hw/timer/cmsdk-apb-timer: run or stop timer on writes to RELOAD and
    VALUE

 include/hw/ptimer.h        |  9 +++++++++
 hw/core/ptimer.c           | 22 +++++++++++++++++++++-
 hw/timer/cmsdk-apb-timer.c | 20 ++++++++++++++++++--
 tests/ptimer-test.c        | 25 +++++++++++++++++++------
 4 files changed, 67 insertions(+), 9 deletions(-)

-- 
2.17.1


Re: [Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes
Posted by Richard Henderson 7 years, 4 months ago
On 07/03/2018 10:10 AM, Peter Maydell wrote:
> Guenter Roeck (1):
>   hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode
> 
> Peter Maydell (3):
>   ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option
>   hw/timer/cmsdk-apb-timer: Correct ptimer policy settings
>   hw/timer/cmsdk-apb-timer: run or stop timer on writes to RELOAD and
>     VALUE

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

Re: [Qemu-devel] [PATCH for-3.0 0/4] cmsdk-apb-timer: various bugfixes
Posted by Guenter Roeck 7 years, 4 months ago
On Tue, Jul 03, 2018 at 06:10:40PM +0100, Peter Maydell wrote:
> This patchseries includes Guenter's recent patch to suppress
> warning messages from the ptimer layer that otherwise occur
> from the way the Linux driver for this timer device operates.
> 
> The other patches here fix more obscure things:
>  * the timer interrupt is only supposed to trigger when the
>    counter counts down from 1 to 0, not if it is at 0 for
>    some other reason like a direct write of 0 to the VALUE register.
>    Handling this requires adding a new policy option to the ptimer
>    code, which is what patch 1 does.
>  * we were incorrectly setting the NO_IMMEDIATE_TRIGGER
>    ptimer policy, which meant we would trigger the interrupt
>    one timer clock too late (when we did the timer reload,
>    rather than on the 1-to-0 counter transition)
>  * if the ptimer had already disabled itself because it was
>    in one-shot mode and had expired, writing to RELOAD or
>    VALUE needs to cause it to start counting again
> 
> Tested with a uCLinux/mps2 kernel and buildroot initfs.
> 

For the series:

Tested-by: Guenter Roeck <linux@roeck-us.net>

also with uCLinux/mps2 kernel and buildroot initfs.

Thanks,
Guenter

> thanks
> -- PMM
> 
> Guenter Roeck (1):
>   hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode
> 
> Peter Maydell (3):
>   ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option
>   hw/timer/cmsdk-apb-timer: Correct ptimer policy settings
>   hw/timer/cmsdk-apb-timer: run or stop timer on writes to RELOAD and
>     VALUE
> 
>  include/hw/ptimer.h        |  9 +++++++++
>  hw/core/ptimer.c           | 22 +++++++++++++++++++++-
>  hw/timer/cmsdk-apb-timer.c | 20 ++++++++++++++++++--
>  tests/ptimer-test.c        | 25 +++++++++++++++++++------
>  4 files changed, 67 insertions(+), 9 deletions(-)
> 
> -- 
> 2.17.1
>