lede/target/linux/generic/pending-5.10/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch
Beginner a9c5c7aa6b
kernel: bump 5.10 to 5.10.70 (#7976)
* kernel: bump 5.10 to 5.10.65

Manually refreshed:
generic/pending-5.10/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch
bcm27xx/patches-5.10/950-0053-firmware-bcm2835-Support-ARCH_BCM270x.patch
bcm27xx/patches-5.10/950-0087-firmware-raspberrypi-Add-backward-compatible-get_thr.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

* kernel: bump 5.10 to 5.10.66

No patches refreshed.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

* kernel: bump 5.10 to 5.10.67

Deleted (upstreamed):
bcm27xx/patches-5.10/950-0312-vc4_hdmi-Set-HD_CTL_WHOLSMP-and-HD_CTL_CHALIGN_SET.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

* kernel: bump 5.10 to 5.10.68

Deleted (upstreamed):
generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
generic/backport-5.10/792-v5.15-0001-net-dsa-b53-Fix-calculating-number-of-switch-ports.patch
generic/backport-5.10/792-v5.15-0002-net-dsa-b53-Set-correct-number-of-ports-in-the-DSA-s.patch
generic/backport-5.10/792-v5.15-0003-net-dsa-b53-Fix-IMP-port-setup-on-BCM5301x.patch
generic/backport-5.10/840-0001-PCI-of-Don-t-fail-devm_pci_alloc_host_bridge-on-miss.patch
generic/backport-5.10/840-0002-PCI-iproc-Fix-BCMA-probe-resource-handling.patch
generic/pending-5.10/498-mtd-mtdconcat-select-readwrite-function.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

* kernel: bump 5.10 to 5.10.69

Patches automatically refreshed.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

* kernel: bump 5.10 to 5.10.70

Deleted (upstreamed):
bcm53xx/patches-5.10/181-Revert-USB-bcma-Add-a-check-for-devm_gpiod_get.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

Co-authored-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-04 22:25:52 +08:00

65 lines
2.4 KiB
Diff

From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Subject: [PATCH] bcma: get SoC device struct & copy its DMA params to the
subdevices
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For bus devices to be fully usable it's required to set their DMA
parameters.
For years it has been missing and remained unnoticed because of
mips_dma_alloc_coherent() silently handling the empty coherent_dma_mask.
Kernel 4.19 came with a lot of DMA changes and caused a regression on
the bcm47xx. Starting with the commit f8c55dc6e828 ("MIPS: use generic
dma noncoherent ops for simple noncoherent platforms") DMA coherent
allocations just fail. Example:
[ 1.114914] bgmac_bcma bcma0:2: Allocation of TX ring 0x200 failed
[ 1.121215] bgmac_bcma bcma0:2: Unable to alloc memory for DMA
[ 1.127626] bgmac_bcma: probe of bcma0:2 failed with error -12
[ 1.133838] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
This change fixes above regression in addition to the MIPS bcm47xx
commit 321c46b91550 ("MIPS: BCM47XX: Setup struct device for the SoC").
It also fixes another *old* GPIO regression caused by a parent pointing
to the NULL:
[ 0.157054] missing gpiochip .dev parent pointer
[ 0.157287] bcma: bus0: Error registering GPIO driver: -22
introduced by the commit 74f4e0cc6108 ("bcma: switch GPIO portions to
use GPIOLIB_IRQCHIP").
Fixes: f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms")
Fixes: 74f4e0cc6108 ("bcma: switch GPIO portions to use GPIOLIB_IRQCHIP")
Cc: linux-mips@linux-mips.org
Cc: Christoph Hellwig <hch@lst.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -191,6 +191,8 @@ int __init bcma_host_soc_init(struct bcm
struct bcma_bus *bus = &soc->bus;
int err;
+ bus->dev = soc->dev;
+
/* Scan bus and initialize it */
err = bcma_bus_early_register(bus);
if (err)
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -241,8 +241,10 @@ void bcma_prepare_core(struct bcma_bus *
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
core->dev.parent = bus->dev;
- if (bus->dev)
+ if (bus->dev) {
bcma_of_fill_device(bus->dev, core);
+ dma_coerce_mask_and_coherent(&core->dev, bus->dev->coherent_dma_mask);
+ }
switch (bus->hosttype) {
case BCMA_HOSTTYPE_PCI: