mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rosen Penev <rosenp@gmail.com>,
	linux-kernel@vger.kernel.org,  f.fainelli@gmail.com,
	Christoph Hellwig <hch@lst.de>, Linus Walleij <linusw@kernel.org>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
	"Paul Burton" <paulburton@kernel.org>,
	"open list:BROADCOM SPECIFIC AMBA DRIVER (BCMA)"
	<linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] bcma: use the SoC device for DMA on MIPS
Date: Tue, 13 Oct 2026 14:30:43 +0200	[thread overview]
Message-ID: <58b72ce94e373266537d5c0456772db69a8fd808.camel@sipsolutions.net> (raw)
In-Reply-To: <20261009213156.109965-1-rosenp@gmail.com>

On Fri, 2026-10-09 at 14:31 -0700, Rosen Penev wrote:
> The MIPS BCM47xx code allocates a struct device for the SoC, sets a
> 32-bit DMA mask on it and passes it to bcma in struct bcma_soc. bcma
> never uses it: bus->dev stays NULL for the MIPS SoC host, so cores fall
> back to doing DMA through their own struct device, whose
> coherent_dma_mask is 0. Since
> commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms")
> coherent allocations then fail:
> 
>   bgmac_bcma bcma0:2: Allocation of TX ring 0x200 failed
>   bgmac_bcma bcma0:2: Unable to alloc memory for DMA
>   bgmac_bcma: probe of bcma0:2 failed with error -12
> 
> Set bus->dev from the SoC device and do DMA through it, as the ARM SoC
> host already does. Every SoC host now has a bus device, so drop the
> fallback that pointed a core's dma_mask at its coherent_dma_mask.
> 
> This addresses the review of the earlier postings: the cores' DMA masks
> are no longer touched at all.
> 
> Tested on an ASUS RT-N16 (BCM4718): bgmac probes and passes traffic.
> 
> Fixes: f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms")
> 

That was in a MIPS tree, so perhaps this fix should be too? I don't
really know what to do with it.

johannes

  reply	other threads:[~2026-10-13 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 21:31 Rosen Penev
2026-10-13 12:30 ` Johannes Berg [this message]
2026-10-13 22:57   ` Rosen Penev

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=58b72ce94e373266537d5c0456772db69a8fd808.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=f.fainelli@gmail.com \
    --cc=hch@lst.de \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=rosenp@gmail.com \
    --cc=zajec5@gmail.com \
    /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

all inboxes | Powered by JetHome®