From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/14] arm_pmu: ACPI support
Date: Thu, 23 Mar 2017 07:23:06 +0800 [thread overview]
Message-ID: <58D3075A.3020605@linaro.org> (raw)
In-Reply-To: <20170322121944.GB3940@red-moon>
On 03/22/2017 08:19 PM, Lorenzo Pieralisi wrote:
> On Tue, Mar 14, 2017 at 06:47:34PM +0000, Mark Rutland wrote:
>> On Tue, Mar 14, 2017 at 11:49:19AM +0000, Mark Rutland wrote:
>>> On Fri, Mar 10, 2017 at 04:14:57PM -0600, Jeremy Linton wrote:
>>>> I tried these patches on a m400 (which uses PPIs), and the kernel
>>>> fails to come up enough to login via the network (which works with
>>>> 4.11rc1 without these patches). So, I suspect there is something
>>>> wrong with them.
>>>
>>> Indeed; sorry about this. I'll see if I can get access to a board to try
>>> local debugging.
>>
>>>> About the only thing it says with any meaning when earlycon is passed is:
>>>> [ 10.965147] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
>>>> [ 11.064193] dw-apb-uart APMC0D08:00: cannot get irq
>>>>
>>>> and promptly hangs up.
>>
>> I believe that this is a latent FW bug, in a beta FW, exposed by recent
>> changes.
>>
>> I managed to get access to two APM Mustang boards. I can reproduce the
>> issue with a vanilla v4.11-rc1 defconfig on one, which has a beta FW.
>> The same kernel boots fine on the other, which has a later released FW.
>>
>> I bisected the issue down to commit:
>>
>> d44fa3d46079dc09 ("ACPI: Add support for ResourceSource/IRQ domain mapping")
>>
>> It seems the beta FW describes the UART interrupt with an Extended
>> Interrupt Descriptor with the Consumer/Producer bit clear. Per the spec,
>> this means "This device produces and consumes this resource", which
>> doesn't make sense here given the UART is not an interrupt controller.
>>
>> The (working) released FW doesn't use an Extended Interrupt Descriptor
>> for this interrupt, sidestepping the issue.
>>
>> Given that (AFAICT) this only affects a known-broken, beta FW, I don't
>> think that we care that much.
>>
>> However, I think there is a larger potential issue here.
>>
>> In acpi_irq_parse_one_cb(), we skip interrupts with an Extended
>> Interrupt Descriptor with the Consumer/Producer bit clear. It sounds
>> like devices which behave as interrupt controllers could legitimately
>> have this bit set for interrupts they generate and deliver to
>> themselves, and we'd erroneously skip these when parsing interrupts.
>>
>> It's not entirely clear to me why this bit exists at all, given that
>> it's not used as part of mapping the interrupt, and if you really want
>> to know you can map the interrupt and look at the result.
>
> It is not entirely clear to anyone (and it has been a source of major
> trouble for other descriptors - ie memory - to the point that it has been
> deprecated for *some* descriptors). IIRC (Hanjun ?) the only reason why
> Agustin added the check for that bit in drivers/acpi/resource.c
> (is_gsi()) is to prevent ACPI core code allocating IRQs for the MBIgen
> device that, _erroneously_, was using an extended interrupt descriptor
> to list IRQ lines (that I have no idea what they represent) in order to
> count how many MSI vectors it would have to allocate.
I'm not sure it's error for a interrupt producer device (such as MBIgen)
to represent its interrupt resources using Interrupt under _CRS, from
the spec, we didn't violate anything, but in the OS side we expect a
better way to count MSI vectors.
>
> The gist is: removing the check for the extended interrupt descriptor
> producer/consumer bit in ACPI code therefore ignoring that bit should
> be harmless (given that the MBIgen bindings should be changed anyway).
>
> The meaning of that bit (and how we can flag up a FW bug) it is still
> a bit fuzzy IMO.
>
> Agustin, Hanjun, comments ?
I think it's firmware bug in the first place, PRODUCER bit can't be
clear if the device itself is not an interrupt controller, as we
can see that it's UART interrupt and UART can't be a interrupt
controller right? and the default value for the Consumer/Producer bit
is 1, not 0, the spec clearly say that.
So I think we need to fix the firmware (then the code is still not
violate any platforms), and also we need to fix the spec to clarify
things (As Agustin proposed), I reported this issue to ASWG but seems
my email was blocked, I will raise an ECR for discussion.
Thanks
Hanjun
next prev parent reply other threads:[~2017-03-22 23:23 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 11:04 [PATCH 00/14] arm_pmu: ACPI support Mark Rutland
2017-03-10 11:04 ` [PATCH 01/14] drivers/perf: arm_pmu: remove pointless PMU disabling Mark Rutland
2017-03-10 11:04 ` [PATCH 02/14] drivers/perf: arm_pmu: define armpmu_init_fn Mark Rutland
2017-03-10 11:04 ` [PATCH 03/14] drivers/perf: arm_pmu: fold init into alloc Mark Rutland
2017-03-10 11:04 ` [PATCH 04/14] drivers/perf: arm_pmu: factor out pmu registration Mark Rutland
2017-03-10 11:04 ` [PATCH 05/14] drivers/perf: arm_pmu: simplify cpu_pmu_request_irqs() Mark Rutland
2017-03-10 11:04 ` [PATCH 06/14] drivers/perf: arm_pmu: handle no platform_device Mark Rutland
2017-03-10 11:04 ` [PATCH 07/14] drivers/perf: arm_pmu: rename irq request/free functions Mark Rutland
2017-03-10 11:04 ` [PATCH 08/14] drivers/perf: arm_pmu: split cpu-local irq request/free Mark Rutland
2017-03-10 11:04 ` [PATCH 09/14] drivers/perf: arm_pmu: move irq request/free into probe Mark Rutland
2017-03-10 11:04 ` [PATCH 10/14] drivers/perf: arm_pmu: split out platform device probe logic Mark Rutland
2017-03-10 11:04 ` [PATCH 11/14] arm64: add function to get a cpu's MADT GICC table Mark Rutland
2017-03-23 18:33 ` Lorenzo Pieralisi
2017-03-10 11:04 ` [PATCH 12/14] arm64: kill acpi_set_mailbox_entry() Mark Rutland
2017-03-21 18:00 ` Lorenzo Pieralisi
2017-03-21 18:15 ` Mark Rutland
2017-03-21 18:37 ` Lorenzo Pieralisi
2017-03-21 18:53 ` Mark Rutland
2017-03-22 11:38 ` Mark Rutland
2017-03-10 11:04 ` [PATCH 13/14] drivers/perf: arm_pmu: add ACPI framework Mark Rutland
2017-03-10 11:04 ` [PATCH 14/14] arm64: pmuv3: use arm_pmu " Mark Rutland
2017-03-14 6:00 ` Ganapatrao Kulkarni
2017-03-14 10:51 ` Mark Rutland
2017-03-14 12:12 ` Jayachandran C.
2017-03-17 10:24 ` Ganapatrao Kulkarni
2017-04-12 2:40 ` Hanjun Guo
2017-03-10 22:14 ` [PATCH 00/14] arm_pmu: ACPI support Jeremy Linton
2017-03-14 11:49 ` Mark Rutland
2017-03-14 18:47 ` Mark Rutland
2017-03-14 22:06 ` Agustin Vega-Frias
2017-03-15 2:49 ` Hanjun Guo
2017-03-22 12:19 ` Lorenzo Pieralisi
2017-03-22 14:06 ` Agustin Vega-Frias
2017-03-22 23:23 ` Hanjun Guo [this message]
2017-03-15 15:34 ` Mark Rutland
2017-03-16 13:00 ` Hanjun Guo
2017-03-20 18:11 ` Ganapatrao Kulkarni
2017-03-22 9:16 ` Ganapatrao Kulkarni
2017-03-22 15:59 ` Mark Rutland
2017-04-03 10:41 ` Ganapatrao Kulkarni
2017-04-03 11:12 ` Mark Rutland
2017-04-11 9:32 ` Hanjun Guo
2017-03-24 21:36 ` Jeremy Linton
2017-03-28 11:31 ` Mark Rutland
2017-03-28 14:41 ` Jeremy Linton
-- strict thread matches above, loose matches on Subject: below --
2017-03-17 2:11 Itaru Kitayama
2017-03-23 10:54 ` Mark Rutland
2017-03-25 3:18 ` Itaru Kitayama
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58D3075A.3020605@linaro.org \
--to=hanjun.guo@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).