Devicetree
 help / color / mirror / Atom feed
From: Daniel Drake <dan@reactivated.net>
To: Jim Quinlan <james.quinlan@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com, conor+dt@kernel.org,
	devicetree@vger.kernel.org, florian.fainelli@broadcom.com,
	iommu@lists.linux.dev, jgg@ziepe.ca, joro@8bytes.org,
	krzk+dt@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	nick.hollinghurst@raspberrypi.com, robh@kernel.org,
	robin.murphy@arm.com, will@kernel.org
Subject: Re: [PATCH v2 4/5] iommu: Add Broadcom BCM2712 IOMMU driver
Date: Wed, 19 Aug 2026 20:22:26 +0100	[thread overview]
Message-ID: <45a31ea4-7660-44c6-980e-daec6655629e@reactivated.net> (raw)
In-Reply-To: <20260728225727.148778-1-james.quinlan@broadcom.com>

On 28/07/2026 23:57, Jim Quinlan wrote:
>> +#define MMMU_CTRL_OPERATING_FLAGS (\
>> +	MMMU_CTRL_CAP_EXCEEDED_ABORT_EN    | \
>> +	MMMU_CTRL_PT_INVALID_ABORT_EN      | \
>> +	MMMU_CTRL_PT_INVALID_EN            | \
>> +	MMMU_CTRL_WRITE_VIOLATION_ABORT_EN | \
>> +	MMMU_CTRL_STATS_ENABLE             | \
>> +	MMMU_CTRL_ENABLE)
> 
> Hello,
> 
> Why not request the MMU interrupt and use the "INT_EN" version, e.g.
> MMMU_CTRL_PT_INVALID_INT_EN?  It seems better than "ABORT", as with an
> interrupt you have a fighting chance of the handler printing out something
> helpful and shutting down gracefully.

That could indeed be useful, but the only info I have about this 
hardware is the RPi kernel's bcm2712-iommu driver which also does not 
handle this interrupt, so I don't have the required info to set up an 
interrupt handler.

Could you let me know the interrupt routing details for all of the 
bcm2712 iommu blocks? e.g. which GIC/L2 IRQ lines they connect to.
>> +	/* Shootdown register deals with 4 pages at a time */
>> +	for (page_group = iova >> (IOMMU_PAGE_SHIFT + 2);
>> +	     page_group <= iova_end >> (IOMMU_PAGE_SHIFT + 2); page_group++) {
>> +		MMU_WR(MMMU_SHOOT_DOWN_OFFSET,
>> +		       MMMU_SHOOT_DOWN_SHOOT + (page_group << 2));
>> +		readl_poll_timeout_atomic(
>> +			mmu->reg_base + MMMU_SHOOT_DOWN_OFFSET, val,
>> +			!(val & MMMU_SHOOT_DOWN_SHOOTING), 0, 1000);
> 
> I think it would be prudent to have this function return the
> readl_poll_timeout_atomic() result and then do a dev_{warn,err}() call once
> you are out of the containing spinlock.  Also, why 1ms -- seems a long
> time to have a spinlock.

I'll do that. And yeah, that is way too long. I took some measurements 
and all 3 of the TLB-related cache flush codepaths take around 100ns on 
average. So I'm reducing the timeouts to 50usec.

Thanks!

      reply	other threads:[~2026-08-19 19:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 20:43 [PATCH v2 0/5] Add support for Broadcom BCM2712 IOMMU driver (Raspberry Pi 5) Daniel Drake
2026-07-27 20:43 ` [PATCH v2 1/5] generic_pt: allow missing sw bit in DMA_INCOHERENT case Daniel Drake
2026-07-27 20:43 ` [PATCH v2 2/5] dt-bindings: iommu: Add Broadcom BCM2712 IOMMU Daniel Drake
2026-07-30  6:59   ` Krzysztof Kozlowski
2026-07-27 20:43 ` [PATCH v2 3/5] iommu/generic_pt: Add Broadcom BCM2712 page table format Daniel Drake
2026-07-27 20:43 ` [PATCH v2 4/5] iommu: Add Broadcom BCM2712 IOMMU driver Daniel Drake
2026-07-27 22:08   ` sashiko-bot
2026-07-28 10:51   ` Robin Murphy
2026-07-29  0:10     ` Jason Gunthorpe
2026-07-29 11:21       ` Robin Murphy
2026-07-31 20:22       ` Daniel Drake
2026-08-16 12:50         ` Daniel Drake
2026-08-16 16:57           ` Jason Gunthorpe
2026-07-30  7:00   ` Krzysztof Kozlowski
2026-07-31 20:34     ` Daniel Drake
2026-08-01  9:15       ` Krzysztof Kozlowski
2026-08-03 10:53         ` Nick Hollinghurst
2026-07-27 20:44 ` [PATCH v2 5/5] arm64: dts: broadcom: bcm2712: Add GPU IOMMU and IOMMU cache nodes Daniel Drake
2026-07-28 22:57 ` [PATCH v2 4/5] iommu: Add Broadcom BCM2712 IOMMU driver Jim Quinlan
2026-08-19 19:22   ` Daniel Drake [this message]

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=45a31ea4-7660-44c6-980e-daec6655629e@reactivated.net \
    --to=dan@reactivated.net \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=iommu@lists.linux.dev \
    --cc=james.quinlan@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=nick.hollinghurst@raspberrypi.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@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