🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Simon Horman Tue, 24 Nov 2026 11:43
Re: [PATCH net v3 1/3] tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
#21738
Author: Simon Horman
Date: Tue, 24 Nov 2026 11:43
40 lines
9689 bytes
On Wed, Nov 18, 2026 at 04:24:06PM +0530, Pavan Chebbi wrote:
> Commit 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for
> BCM57766 chipsets") lowered the coherent DMA mask to 31 bits as a
> workaround for a spurious address overflow error in the hardware.
> The result of dma_set_coherent_mask() is fatal to probe, so on
> platforms that cannot satisfy such a mask the device fails to probe:
> 
>   tg3 0000:01:00.0: Unable to obtain 64 bit DMA for consistent allocations
>   tg3 0000:01:00.0: probe with driver tg3 failed with error -5
> 
> This was reported on a Mac mini (Macmini6,2, BCM57766) running a
> kernel built without CONFIG_ZONE_DMA and with IOMMU passthrough as
> the default. Without CONFIG_ZONE_DMA, dma_direct_supported() only
> accepts a mask narrower than 32 bits if it covers the highest
> physical memory address, so with direct mapping a 31-bit coherent
> mask is rejected whenever memory extends above 2GB.
> 
> Treat the 31-bit mask as best effort.  If it is refused, warn and fall
> back to the mask used before 614f4d166eee, so that the device still
> probes.  Platforms that accept the mask are unaffected.  Where it is
> refused, 614f4d166eee never protected the device, it only stopped it
> from probing, so this restores the behaviour of kernels before that
> commit.  Warn when a status block lands at an address matching the
> pattern described in 614f4d166eee, so that a resulting TX timeout can
> be identified.

Hi Pavan,

I am not following how a BCM57766 device can be used on a system that
rejects a 31-bit mask. Is the idea that TX timeouts are infrequent
and can be lived with in such an environment?

> 
> Fixes: 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets")
> Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
> Link: https://lore.kernel.org/netdev/CALjTZvYKHWrD5m+RXimjxODvpFPw7Cq_EOEuzRi1PZT9_JxF+g@mail.gmail.com/
> Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>

...
Re: [PATCH net v3 1/3] tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
#21882
Author: Simon Horman
Date: Tue, 24 Nov 2026 15:01
55 lines
10624 bytes
On Tue, Nov 24, 2026 at 06:18:05PM +0530, Pavan Chebbi wrote:
> On Tue, Nov 24, 2026 at 5:13 PM Simon Horman <horms@kernel.org> wrote:
> >
> > On Wed, Nov 18, 2026 at 04:24:06PM +0530, Pavan Chebbi wrote:
> > > Commit 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for
> > > BCM57766 chipsets") lowered the coherent DMA mask to 31 bits as a
> > > workaround for a spurious address overflow error in the hardware.
> > > The result of dma_set_coherent_mask() is fatal to probe, so on
> > > platforms that cannot satisfy such a mask the device fails to probe:
> > >
> > >   tg3 0000:01:00.0: Unable to obtain 64 bit DMA for consistent allocations
> > >   tg3 0000:01:00.0: probe with driver tg3 failed with error -5
> > >
> > > This was reported on a Mac mini (Macmini6,2, BCM57766) running a
> > > kernel built without CONFIG_ZONE_DMA and with IOMMU passthrough as
> > > the default. Without CONFIG_ZONE_DMA, dma_direct_supported() only
> > > accepts a mask narrower than 32 bits if it covers the highest
> > > physical memory address, so with direct mapping a 31-bit coherent
> > > mask is rejected whenever memory extends above 2GB.
> > >
> > > Treat the 31-bit mask as best effort.  If it is refused, warn and fall
> > > back to the mask used before 614f4d166eee, so that the device still
> > > probes.  Platforms that accept the mask are unaffected.  Where it is
> > > refused, 614f4d166eee never protected the device, it only stopped it
> > > from probing, so this restores the behaviour of kernels before that
> > > commit.  Warn when a status block lands at an address matching the
> > > pattern described in 614f4d166eee, so that a resulting TX timeout can
> > > be identified.
> >
> > Hi Pavan,
> >
> > I am not following how a BCM57766 device can be used on a system that
> > rejects a 31-bit mask. Is the idea that TX timeouts are infrequent
> > and can be lived with in such an environment?
> >
> 
> Hi Simon, thanks for the review.  The report comes from a late-2012 Mac mini
> (Macmini6.2) with a BCM57766.  Its NIC worked until 614f4d166eee made the
> 31-bit coherent mask change, which that machine does not accept, so probe has
> failed there since.
> 
> To your question, yes,  I think it can be lived with.  The erratum is
> triggered only
> when the status block lands at a specific address, and if it does, the
> driver's reset
> logic kicks in and the warning points to the cause.  That is better
> than the device
> not probing at all.  Platforms that accept the mask are unaffected.

Hi Pravan,

Thanks for the clarification. I agree this is a reasonable trade-off.

Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads