Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: YinFengwei <fengwei_yin@linux.alibaba.com>
Cc: will@kernel.org, mark.rutland@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	jie.li.linux@linux.alibaba.com
Subject: Re: [PATCH] perf/arm-cmn: don't claim resource during ioremap() for CMN700 with ACPI
Date: Tue, 18 Feb 2025 12:31:10 +0000	[thread overview]
Message-ID: <73af368a-52a9-4922-876b-7a6e2d32a94e@arm.com> (raw)
In-Reply-To: <hfip42i45jkumuvgdthxm2bk6qylqyqh6erzaq43yiqygvn6uu@dcui675lwtkm>

On 2025-02-18 10:58 am, YinFengwei wrote:
> On Tue, Feb 18, 2025 at 10:31:42AM +0800, Robin Murphy wrote:
>> On 2025-02-18 1:21 am, Yin Fengwei wrote:
>>> Currently, arm-cmn PMU driver assumes ACPI claim resource
>>> for CMN600 + ACPI. But with CMN700 + ACPI, the device probe
>>> failed because of resource claim failes when ioremap() is
>>> called:
>>> [   10.837300] arm-cmn ARMHC700:00: error -EBUSY: can't request region for resource [mem 0x40000000-0x4fffffff]
>>> [   10.847310] arm-cmn ARMHC700:00: probe with driver arm-cmn failed with error -16
>>> [   10.854726] arm-cmn ARMHC700:02: error -EBUSY: can't request region for resource [mem 0x40040000000-0x4004fffffff]
>>> [   10.865085] arm-cmn ARMHC700:02: probe with driver arm-cmn failed with error -16
>>>
>>> Let CMN700 + ACPI do same as CMN600 + ACPI to allow CMN700
>>> work in ACPI env.
>>
>> No, the CMN-600 routine is a special case for CMN-600 having two nested
>> memory resources of its own. CMN-700 and everything else only have one
>> memory resource, so that is not appropriate. What else is claiming the
>> region to cause a conflict?
> Sorry. Forgot the link for the new proposed fix:
> https://lore.kernel.org/all/Z7QYlUP6nfBNMXsv@U-V2QX163P-2032.local/

Yes, I saw that. It's a broken diff that won't even compile, with no 
explanation of what it's supposed to be trying to achieve or why. I'm 
not sure what you're asking me to comment on.

> My understanding is that there are two problems here:
> 1. ACPI claim the memory range and that's why we see this -EBUSY error
>     with correct code path for CMN700 + ACPI table.

No, it's fine to claim the exact *same* range that the ACPI companion 
owns; the identical requests just nest inside each other. I don't have a 
CMN-700 to hand but here's a selection of other drivers doing just that 
from /proc/iomem on my system:

12600000-12600fff : ARMH0011:00
   12600000-12600fff : ARMH0011:00 ARMH0011:00
12610000-12610fff : ARMH0011:01
   12610000-12610fff : ARMH0011:01 ARMH0011:01
126b0000-126b0fff : APMC0D0F:00
   126b0000-126b0fff : APMC0D0F:00 APMC0D0F:00
126f0000-126f0fff : APMC0D81:00
   126f0000-126f0fff : APMC0D81:00 APMC0D81:00

And I know people are using the CMN-700 PMU on other ACPI systems 
without issue, so there's nothing wrong with the binding or the driver 
in general.

The resource conflict only arises when a request overlaps an existing 
region inexactly. Either your firmware is describing the CMN 
incorrectly, or some other driver is claiming conflicting iomem regions 
for some reason.

Thanks,
Robin.

> 2. It's not correct to apply CMN600 probe method to CMN700 because
>     CMN600 has two nested memory resouces while CMN700 should only have
>     one memory resource. And you don't want to introduce trick to handle
>     incorect ACPI DSDT.
> 
> Regards
> Yin, Fengwei
> 
>>
>> Thanks,
>> Robin.



  reply	other threads:[~2025-02-18 12:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250218012111.30068-1-fengwei_yin@linux.alibaba.com_quarantine>
2025-02-18 10:31 ` [PATCH] perf/arm-cmn: don't claim resource during ioremap() for CMN700 with ACPI Robin Murphy
2025-02-18 10:35   ` YinFengwei
2025-02-18 10:58   ` YinFengwei
2025-02-18 12:31     ` Robin Murphy [this message]
2025-02-19  1:50       ` YinFengwei
2025-02-19 13:16         ` Robin Murphy
2025-02-20  1:22           ` YinFengwei
2025-02-18  1:21 Yin Fengwei
2025-02-18  1:43 ` YinFengwei

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=73af368a-52a9-4922-876b-7a6e2d32a94e@arm.com \
    --to=robin.murphy@arm.com \
    --cc=fengwei_yin@linux.alibaba.com \
    --cc=jie.li.linux@linux.alibaba.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.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