All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-arm-kernel@lists.infradead.org,
	Imre Kaloz <kaloz@openwrt.org>,
	Krzysztof Halasa <khalasa@piap.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	iommu@lists.linux-foundation.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 11/13 v2] ARM: ixp4xx: Drop custom DMA coherency and bouncing
Date: Fri, 11 Feb 2022 23:32:36 +0100	[thread overview]
Message-ID: <20220211223238.648934-12-linus.walleij@linaro.org> (raw)
In-Reply-To: <20220211223238.648934-1-linus.walleij@linaro.org>

The new PCI driver does not need any of this stuff, so just
drop it.

Cc: iommu@lists.linux-foundation.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Pick up Christoph's Reviewed-by and add proper CC for iommu
- Resending with the rest
---
 arch/arm/Kconfig              |  5 ---
 arch/arm/mach-ixp4xx/common.c | 57 -----------------------------------
 kernel/dma/mapping.c          |  2 --
 3 files changed, 64 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3a95203236d2..ec0dbaf73a81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -217,9 +217,6 @@ config ARCH_MAY_HAVE_PC_FDC
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
-config ARCH_HAS_DMA_SET_COHERENT_MASK
-	bool
-
 config GENERIC_ISA_DMA
 	bool
 
@@ -381,10 +378,8 @@ config ARCH_IOP32X
 config ARCH_IXP4XX
 	bool "IXP4xx-based"
 	depends on MMU
-	select ARCH_HAS_DMA_SET_COHERENT_MASK
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select CPU_XSCALE
-	select DMABOUNCE if PCI
 	select GENERIC_IRQ_MULTI_HANDLER
 	select GPIO_IXP4XX
 	select GPIOLIB
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 4e51514ace6d..310e1602fbfc 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -30,7 +30,6 @@
 #include <linux/soc/ixp4xx/cpu.h>
 #include <linux/irqchip/irq-ixp4xx.h>
 #include <linux/platform_data/timer-ixp4xx.h>
-#include <linux/dma-map-ops.h>
 #include <mach/hardware.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
@@ -330,59 +329,3 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
 		*IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
 	}
 }
-
-#ifdef CONFIG_PCI
-static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
-{
-	return (dma_addr + size) > SZ_64M;
-}
-
-static int ixp4xx_platform_notify_remove(struct device *dev)
-{
-	if (dev_is_pci(dev))
-		dmabounce_unregister_dev(dev);
-
-	return 0;
-}
-#endif
-
-/*
- * Setup DMA mask to 64MB on PCI devices and 4 GB on all other things.
- */
-static int ixp4xx_platform_notify(struct device *dev)
-{
-	dev->dma_mask = &dev->coherent_dma_mask;
-
-#ifdef CONFIG_PCI
-	if (dev_is_pci(dev)) {
-		dev->coherent_dma_mask = DMA_BIT_MASK(28); /* 64 MB */
-		dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
-		return 0;
-	}
-#endif
-
-	dev->coherent_dma_mask = DMA_BIT_MASK(32);
-	return 0;
-}
-
-int dma_set_coherent_mask(struct device *dev, u64 mask)
-{
-	if (dev_is_pci(dev))
-		mask &= DMA_BIT_MASK(28); /* 64 MB */
-
-	if ((mask & DMA_BIT_MASK(28)) == DMA_BIT_MASK(28)) {
-		dev->coherent_dma_mask = mask;
-		return 0;
-	}
-
-	return -EIO;		/* device wanted sub-64MB mask */
-}
-EXPORT_SYMBOL(dma_set_coherent_mask);
-
-void __init ixp4xx_init_early(void)
-{
-	platform_notify = ixp4xx_platform_notify;
-#ifdef CONFIG_PCI
-	platform_notify_remove = ixp4xx_platform_notify_remove;
-#endif
-}
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 9478eccd1c8e..559461a826ba 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -745,7 +745,6 @@ int dma_set_mask(struct device *dev, u64 mask)
 }
 EXPORT_SYMBOL(dma_set_mask);
 
-#ifndef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK
 int dma_set_coherent_mask(struct device *dev, u64 mask)
 {
 	/*
@@ -761,7 +760,6 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
 	return 0;
 }
 EXPORT_SYMBOL(dma_set_coherent_mask);
-#endif
 
 size_t dma_max_mapping_size(struct device *dev)
 {
-- 
2.34.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-arm-kernel@lists.infradead.org,
	Imre Kaloz <kaloz@openwrt.org>,
	Krzysztof Halasa <khalasa@piap.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	iommu@lists.linux-foundation.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 11/13 v2] ARM: ixp4xx: Drop custom DMA coherency and bouncing
Date: Fri, 11 Feb 2022 23:32:36 +0100	[thread overview]
Message-ID: <20220211223238.648934-12-linus.walleij@linaro.org> (raw)
In-Reply-To: <20220211223238.648934-1-linus.walleij@linaro.org>

The new PCI driver does not need any of this stuff, so just
drop it.

Cc: iommu@lists.linux-foundation.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Pick up Christoph's Reviewed-by and add proper CC for iommu
- Resending with the rest
---
 arch/arm/Kconfig              |  5 ---
 arch/arm/mach-ixp4xx/common.c | 57 -----------------------------------
 kernel/dma/mapping.c          |  2 --
 3 files changed, 64 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3a95203236d2..ec0dbaf73a81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -217,9 +217,6 @@ config ARCH_MAY_HAVE_PC_FDC
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
-config ARCH_HAS_DMA_SET_COHERENT_MASK
-	bool
-
 config GENERIC_ISA_DMA
 	bool
 
@@ -381,10 +378,8 @@ config ARCH_IOP32X
 config ARCH_IXP4XX
 	bool "IXP4xx-based"
 	depends on MMU
-	select ARCH_HAS_DMA_SET_COHERENT_MASK
 	select ARCH_SUPPORTS_BIG_ENDIAN
 	select CPU_XSCALE
-	select DMABOUNCE if PCI
 	select GENERIC_IRQ_MULTI_HANDLER
 	select GPIO_IXP4XX
 	select GPIOLIB
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 4e51514ace6d..310e1602fbfc 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -30,7 +30,6 @@
 #include <linux/soc/ixp4xx/cpu.h>
 #include <linux/irqchip/irq-ixp4xx.h>
 #include <linux/platform_data/timer-ixp4xx.h>
-#include <linux/dma-map-ops.h>
 #include <mach/hardware.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
@@ -330,59 +329,3 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
 		*IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
 	}
 }
-
-#ifdef CONFIG_PCI
-static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
-{
-	return (dma_addr + size) > SZ_64M;
-}
-
-static int ixp4xx_platform_notify_remove(struct device *dev)
-{
-	if (dev_is_pci(dev))
-		dmabounce_unregister_dev(dev);
-
-	return 0;
-}
-#endif
-
-/*
- * Setup DMA mask to 64MB on PCI devices and 4 GB on all other things.
- */
-static int ixp4xx_platform_notify(struct device *dev)
-{
-	dev->dma_mask = &dev->coherent_dma_mask;
-
-#ifdef CONFIG_PCI
-	if (dev_is_pci(dev)) {
-		dev->coherent_dma_mask = DMA_BIT_MASK(28); /* 64 MB */
-		dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
-		return 0;
-	}
-#endif
-
-	dev->coherent_dma_mask = DMA_BIT_MASK(32);
-	return 0;
-}
-
-int dma_set_coherent_mask(struct device *dev, u64 mask)
-{
-	if (dev_is_pci(dev))
-		mask &= DMA_BIT_MASK(28); /* 64 MB */
-
-	if ((mask & DMA_BIT_MASK(28)) == DMA_BIT_MASK(28)) {
-		dev->coherent_dma_mask = mask;
-		return 0;
-	}
-
-	return -EIO;		/* device wanted sub-64MB mask */
-}
-EXPORT_SYMBOL(dma_set_coherent_mask);
-
-void __init ixp4xx_init_early(void)
-{
-	platform_notify = ixp4xx_platform_notify;
-#ifdef CONFIG_PCI
-	platform_notify_remove = ixp4xx_platform_notify_remove;
-#endif
-}
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 9478eccd1c8e..559461a826ba 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -745,7 +745,6 @@ int dma_set_mask(struct device *dev, u64 mask)
 }
 EXPORT_SYMBOL(dma_set_mask);
 
-#ifndef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK
 int dma_set_coherent_mask(struct device *dev, u64 mask)
 {
 	/*
@@ -761,7 +760,6 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
 	return 0;
 }
 EXPORT_SYMBOL(dma_set_coherent_mask);
-#endif
 
 size_t dma_max_mapping_size(struct device *dev)
 {
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-02-11 22:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 22:32 [PATCH 00/13 v2] IXP4xx spring cleaning Linus Walleij
2022-02-11 22:32 ` [PATCH 01/13 v2] ARM: ixp4xx: Delete Gateway 7001 boardfiles Linus Walleij
2022-02-11 22:32 ` [PATCH 02/13 v2] ARM: ixp4xx: Delete the Goramo MLR boardfile Linus Walleij
2022-02-11 22:32 ` [PATCH 03/13 v2] ARM: ixp4xx: Delete old PCI driver Linus Walleij
2022-02-11 22:32 ` [PATCH 04/13 v2] ARM: ixp4xx: Drop stale Kconfig entry Linus Walleij
2022-02-11 22:32 ` [PATCH 05/13 v2] ARM: ixp4xx: Drop UDC info setting function Linus Walleij
2022-02-11 22:32 ` [PATCH 06/13 v2] soc: ixp4xx: Add features from regmap helper Linus Walleij
2022-02-11 22:32 ` [PATCH 07/13 v2] soc: ixp4xx-npe: Access syscon regs using regmap Linus Walleij
2022-02-11 22:32 ` [PATCH 08/13 v2] net: ixp4xx_eth: Drop platform data support Linus Walleij
2022-02-11 22:32   ` Linus Walleij
2022-02-12  0:37   ` Jakub Kicinski
2022-02-12  0:37     ` Jakub Kicinski
2022-02-11 22:32 ` [PATCH 09/13 v2] net: ixp4xx_hss: Check features using syscon Linus Walleij
2022-02-11 22:32   ` Linus Walleij
2022-02-12  0:38   ` Jakub Kicinski
2022-02-12  0:38     ` Jakub Kicinski
2022-02-11 22:32 ` [PATCH 10/13 v2] ARM: ixp4xx: Remove feature bit accessors Linus Walleij
2022-02-11 22:32 ` Linus Walleij [this message]
2022-02-11 22:32   ` [PATCH 11/13 v2] ARM: ixp4xx: Drop custom DMA coherency and bouncing Linus Walleij
2022-02-11 22:32 ` [PATCH 12/13 v2] ARM: ixp4xx: Drop all common code Linus Walleij
2022-02-11 22:32 ` [PATCH 13/13 v2] ARM: ixp4xx: Convert to SPARSE_IRQ and P2V Linus Walleij

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=20220211223238.648934-12-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kaloz@openwrt.org \
    --cc=khalasa@piap.pl \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.