Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626413

Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver
Date 2017-04-19 17:50 +0200
Message-ID <ty01H-5db-15@gated-at.bofh.it> (permalink)
References <twes9-4Ay-1@gated-at.bofh.it> <twesa-4Ay-25@gated-at.bofh.it> <txF6V-rr-11@gated-at.bofh.it> <txZp1-4Zt-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 19, 2017 at 04:07:25PM +0100, Mark Rutland wrote:
> On Tue, Apr 18, 2017 at 06:21:07PM +0100, Lorenzo Pieralisi wrote:
> > On Sat, Apr 15, 2017 at 02:40:12AM +0800, fu.wei@linaro.org wrote:
 
> > If yes, why can't it simply be written like this ?
> > 
> > for (; i >= 0; i--, gtdt_frame--) {
> > 	frame = &timer_mem->frame[gtdt_frame->frame_number];
> > 
> > 	/* not sure this check is actually needed */
> > 	if (gtdt_frame->common_flags & ACPI_GTDT_GT_IS_SECURE_TIMER)
> > 		continue;
> > 
> > 	if (frame->phys_irq > 0)
> > 		acpi_unregister_gsi(gtdt_frame->timer_interrupt);
> > 	if (frame->virt_irq > 0)
> > 		acpi_unregister_gsi(gtdt_frame->virtual_timer_interrupt);
> > }
> 
> A reverse loop of this form will work.
> 
> That requires some restructuring, and care to avoid going out of bounds
> instantaneously with the gtdt_frame--, so as to not invoke nasal demons.
> 
> I've attacked this locally, and will send this out after testing. I'll
> drop the new ACPI API patch.

FWIW, I've set this up so the cleanup path is:

do {
        if (gtdt_frame->common_flags & ACPI_GTDT_GT_IS_SECURE_TIMER ||
            gtdt_frame->frame_number >= ARCH_TIMER_MEM_MAX_FRAMES)
                continue;

        frame = &timer_mem->frame[gtdt_frame->frame_number];

        if (frame->phys_irq > 0)
                acpi_unregister_gsi(gtdt_frame->timer_interrupt);
        frame->phys_irq = 0;

        if (frame->virt_irq > 0)
                acpi_unregister_gsi(gtdt_frame->virtual_timer_interrupt);
        frame->virt_irq = 0;
} while (i-- >= 0 && gtdt_frame--);

... the zeroing is to account for duplicate frames, which I now check for in
the probe path (as we do for DT).

Can I take it per your comment on the prior version that with this change I can
take your ack?

I also assume that you're happy for all of the drivers/acpi/arm64/ patches in the
series to go via the clocksource tree?

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v24 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 08/11] acpi: Introduce acpi_unregister_irq function fu.wei@linaro.org - 2017-04-14 20:50 +0200
    Re: [PATCH v24 08/11] acpi: Introduce acpi_unregister_irq function Mark Rutland <mark.rutland@arm.com> - 2017-04-18 18:00 +0200
      Re: [PATCH v24 08/11] acpi: Introduce acpi_unregister_irq function Mark Rutland <mark.rutland@arm.com> - 2017-04-19 17:20 +0200
  [PATCH v24 02/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver fu.wei@linaro.org - 2017-04-14 20:50 +0200
    Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-18 19:30 +0200
      Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-19 17:10 +0200
        Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-19 17:50 +0200
          Re: [PATCH v24 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-19 18:00 +0200
  [PATCH v24 03/11] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 07/11] clocksource: arm_arch_timer: simplify ACPI support code. fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 05/11] clocksource: arm_arch_timer: split MMIO timer probing. fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 10/11] clocksource: arm_arch_timer: add GTDT support for memory-mapped timer fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 06/11] acpi/arm64: Add GTDT table parse driver fu.wei@linaro.org - 2017-04-14 20:50 +0200
  [PATCH v24 01/11] clocksource: arm_arch_timer: split dt-only rate handling fu.wei@linaro.org - 2017-04-14 20:50 +0200

csiph-web