From: Quanyang Wang <quanyang.w...@windriver.com>

Axm55xx which supports LPAE has a physical memory range that is larger
than 4G. And the USB controller only supports 32-bit DMA mask. This
means if block subsystem passes an address beyond 4G to USB for a DMA
operation, it will result failure unless calling swiotlb to provide the
bounce buffering functionality.

Since from the commit ad3c7b18c5b3 ("arm: use swiotlb for bounce buffering
on LPAE configs"), arm can use swiotlb to handle the case above. In arm's
arch_setup_dma_ops, a NULL pointer will be assigned to dev->dma_ops when
CONFIG_LPAE is enabled and all DMA operations will call dma_direct_map_page
which will call swiotlb_map by checking the return value of dma_capable().

But in axxia code, axxia_bus_notifier set dma-coherent device's dma_ops to
be the function arm_coherent_dma_ops forcely and this will result swiotlb
to be ineffective. Remove axxia_buf_notifier and let swiotlb take over
control.

Signed-off-by: Quanyang Wang <quanyang.w...@windriver.com>
---
 arch/arm/mach-axxia/axxia.c | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 12556247b5df..81ddd58f5766 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -157,30 +157,6 @@ static struct platform_device pmu_device = {
        .resource               = axxia_pmu_resources,
 };
 
-static int
-axxia_bus_notifier(struct notifier_block *nb, unsigned long event, void *obj)
-{
-       struct device *dev = obj;
-
-       if (event != BUS_NOTIFY_ADD_DEVICE)
-               return NOTIFY_DONE;
-
-       if (!of_property_read_bool(dev->of_node, "dma-coherent"))
-               return NOTIFY_DONE;
-
-       set_dma_ops(dev, &arm_coherent_dma_ops);
-
-       return NOTIFY_OK;
-}
-
-static struct notifier_block axxia_platform_nb = {
-       .notifier_call = axxia_bus_notifier,
-};
-
-static struct notifier_block axxia_amba_nb = {
-       .notifier_call = axxia_bus_notifier,
-};
-
 void __init axxia_dt_init(void)
 {
        base = ioremap(0x2010000000, 0x40000);
@@ -196,9 +172,6 @@ void __init axxia_dt_init(void)
        ncr_reset_active = 0;
 #endif
 
-       bus_register_notifier(&platform_bus_type, &axxia_platform_nb);
-       bus_register_notifier(&amba_bustype, &axxia_amba_nb);
-
        of_platform_populate(NULL, of_default_bus_match_table,
                             axxia_auxdata_lookup, NULL);
        pm_power_off = NULL; /* TBD */
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10525): 
https://lists.yoctoproject.org/g/linux-yocto/message/10525
Mute This Topic: https://lists.yoctoproject.org/mt/86407463/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to