* [PATCH v4] dmaengine: ppc4xx: remove dead 440SP code
@ 2026-12-03 17:36 Julian Braha
2026-12-03 17:54 ` Frank Li
0 siblings, 1 reply; 2+ messages in thread
From: Julian Braha @ 2026-12-03 17:36 UTC (permalink / raw)
To: vkoul; +Cc: Frank.Li, dave.jiang, peng.fan, rosenp, dmaengine, Julian Braha
The 440SP config option can never be enabled, making all references to it
dead code.
The only board using CONFIG_440SP was IBM LUAN, which was commented out by
commit f65573314e4e ("[POWERPC] Re-organize Kconfig code for 4xx in
arch/powerpc") then removed by commit ff5f483f3091 ("powerpc: 4xx: remove
commented out Kconfig entries").
Let's remove support for 440SP from the PPC4xx ADMA driver. Remove the
440SP cases for the RAID-6 polynomial and the DMA descriptor fields.
This dead code was found by kconfirm, a static analysis tool for Kconfig.
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
Changes since v3:
- limit changes to dmaengine-only (Vinod)
Link to v3:
https://lore.kernel.org/all/20260901152341.1219343-1-julianbraha@gmail.com/
Changes since v2:
- cleaned up preprocessor condition
Link to v2:
https://lore.kernel.org/all/20260901150645.1199097-1-julianbraha@gmail.com/
Changes since v1:
- added historic details to description
Link to v1:
https://lore.kernel.org/all/20260816125615.985387-1-julianbraha@gmail.com/
---
drivers/dma/Kconfig | 2 +-
drivers/dma/ppc4xx/adma.c | 9 ---------
drivers/dma/ppc4xx/adma.h | 2 +-
drivers/dma/ppc4xx/dma.h | 9 ---------
4 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 01f96a8257e5..01171b8106fc 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -77,7 +77,7 @@ config AMBA_PL08X
config AMCC_PPC440SPE_ADMA
tristate "AMCC PPC440SPe ADMA support"
- depends on 440SPe || 440SP
+ depends on 440SPe
select DMA_ENGINE
select DMA_ENGINE_RAID
select ARCH_HAS_ASYNC_TX_FIND_CHANNEL
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 9e8b3e2956b4..3e43d6b0f7d1 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4338,14 +4338,9 @@ static ssize_t poly_show(struct device_driver *dev, char *buf)
ssize_t size = 0;
u32 reg;
-#ifdef CONFIG_440SP
- /* 440SP has fixed polynomial */
- reg = 0x4d;
-#else
reg = dcr_read(ppc440spe_mq_dcr_host, DCRN_MQ0_CFBHL);
reg >>= MQ0_CFBHL_POLY;
reg &= 0xFF;
-#endif
size = sysfs_emit(buf, "PPC440SP(e) RAID-6 driver "
"uses 0x1%02x polynomial.\n", reg);
@@ -4357,10 +4352,6 @@ static ssize_t poly_store(struct device_driver *dev, const char *buf,
{
unsigned long reg, val;
int err;
-#ifdef CONFIG_440SP
- /* 440SP uses default 0x14D polynomial only */
- return -EINVAL;
-#endif
if (!count || count > 6)
return -EINVAL;
diff --git a/drivers/dma/ppc4xx/adma.h b/drivers/dma/ppc4xx/adma.h
index f8a5d7c1fb40..0ec35382d274 100644
--- a/drivers/dma/ppc4xx/adma.h
+++ b/drivers/dma/ppc4xx/adma.h
@@ -19,7 +19,7 @@
#define tx_to_ppc440spe_adma_slot(tx) \
container_of(tx, struct ppc440spe_adma_desc_slot, async_tx)
-/* Default polynomial (for 440SP is only available) */
+/* Default polynomial */
#define PPC440SPE_DEFAULT_POLY 0x4d
#define PPC440SPE_ADMA_ENGINES_NUM (XOR_ENGINES_NUM + DMA_ENGINES_NUM)
diff --git a/drivers/dma/ppc4xx/dma.h b/drivers/dma/ppc4xx/dma.h
index b5725481bfa6..17cbb2d1ee1c 100644
--- a/drivers/dma/ppc4xx/dma.h
+++ b/drivers/dma/ppc4xx/dma.h
@@ -70,20 +70,11 @@
#define DMA_CUED_XOR_BASE (0x10000000)
#define DMA_CUED_XOR_HB (0x00000008)
-
-#ifdef CONFIG_440SP
-#define DMA_CUED_MULT1_OFF 0
-#define DMA_CUED_MULT2_OFF 8
-#define DMA_CUED_MULT3_OFF 16
-#define DMA_CUED_REGION_OFF 24
-#define DMA_CUED_XOR_WIN_MSK (0xFC000000)
-#else
#define DMA_CUED_MULT1_OFF 2
#define DMA_CUED_MULT2_OFF 10
#define DMA_CUED_MULT3_OFF 18
#define DMA_CUED_REGION_OFF 26
#define DMA_CUED_XOR_WIN_MSK (0xF0000000)
-#endif
#define DMA_CUED_REGION_MSK 0x3
#define DMA_RXOR123 0x0
--
2.56.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v4] dmaengine: ppc4xx: remove dead 440SP code
2026-12-03 17:36 [PATCH v4] dmaengine: ppc4xx: remove dead 440SP code Julian Braha
@ 2026-12-03 17:54 ` Frank Li
0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-12-03 17:54 UTC (permalink / raw)
To: Julian Braha; +Cc: vkoul, Frank.Li, dave.jiang, peng.fan, rosenp, dmaengine
On Thu, Dec 03, 2026 at 05:36:23PM +0000, Julian Braha wrote:
> The 440SP config option can never be enabled, making all references to it
> dead code.
>
> The only board using CONFIG_440SP was IBM LUAN, which was commented out by
> commit f65573314e4e ("[POWERPC] Re-organize Kconfig code for 4xx in
> arch/powerpc") then removed by commit ff5f483f3091 ("powerpc: 4xx: remove
> commented out Kconfig entries").
>
> Let's remove support for 440SP from the PPC4xx ADMA driver. Remove the
> 440SP cases for the RAID-6 polynomial and the DMA descriptor fields.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes since v3:
> - limit changes to dmaengine-only (Vinod)
>
> Link to v3:
> https://lore.kernel.org/all/20260901152341.1219343-1-julianbraha@gmail.com/
>
> Changes since v2:
> - cleaned up preprocessor condition
>
> Link to v2:
> https://lore.kernel.org/all/20260901150645.1199097-1-julianbraha@gmail.com/
>
> Changes since v1:
> - added historic details to description
>
> Link to v1:
> https://lore.kernel.org/all/20260816125615.985387-1-julianbraha@gmail.com/
> ---
> drivers/dma/Kconfig | 2 +-
> drivers/dma/ppc4xx/adma.c | 9 ---------
> drivers/dma/ppc4xx/adma.h | 2 +-
> drivers/dma/ppc4xx/dma.h | 9 ---------
> 4 files changed, 2 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
> index 01f96a8257e5..01171b8106fc 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -77,7 +77,7 @@ config AMBA_PL08X
>
> config AMCC_PPC440SPE_ADMA
> tristate "AMCC PPC440SPe ADMA support"
> - depends on 440SPe || 440SP
> + depends on 440SPe
> select DMA_ENGINE
> select DMA_ENGINE_RAID
> select ARCH_HAS_ASYNC_TX_FIND_CHANNEL
> diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
> index 9e8b3e2956b4..3e43d6b0f7d1 100644
> --- a/drivers/dma/ppc4xx/adma.c
> +++ b/drivers/dma/ppc4xx/adma.c
> @@ -4338,14 +4338,9 @@ static ssize_t poly_show(struct device_driver *dev, char *buf)
> ssize_t size = 0;
> u32 reg;
>
> -#ifdef CONFIG_440SP
> - /* 440SP has fixed polynomial */
> - reg = 0x4d;
> -#else
> reg = dcr_read(ppc440spe_mq_dcr_host, DCRN_MQ0_CFBHL);
> reg >>= MQ0_CFBHL_POLY;
> reg &= 0xFF;
> -#endif
>
> size = sysfs_emit(buf, "PPC440SP(e) RAID-6 driver "
> "uses 0x1%02x polynomial.\n", reg);
> @@ -4357,10 +4352,6 @@ static ssize_t poly_store(struct device_driver *dev, const char *buf,
> {
> unsigned long reg, val;
> int err;
> -#ifdef CONFIG_440SP
> - /* 440SP uses default 0x14D polynomial only */
> - return -EINVAL;
> -#endif
>
> if (!count || count > 6)
> return -EINVAL;
> diff --git a/drivers/dma/ppc4xx/adma.h b/drivers/dma/ppc4xx/adma.h
> index f8a5d7c1fb40..0ec35382d274 100644
> --- a/drivers/dma/ppc4xx/adma.h
> +++ b/drivers/dma/ppc4xx/adma.h
> @@ -19,7 +19,7 @@
> #define tx_to_ppc440spe_adma_slot(tx) \
> container_of(tx, struct ppc440spe_adma_desc_slot, async_tx)
>
> -/* Default polynomial (for 440SP is only available) */
> +/* Default polynomial */
> #define PPC440SPE_DEFAULT_POLY 0x4d
>
> #define PPC440SPE_ADMA_ENGINES_NUM (XOR_ENGINES_NUM + DMA_ENGINES_NUM)
> diff --git a/drivers/dma/ppc4xx/dma.h b/drivers/dma/ppc4xx/dma.h
> index b5725481bfa6..17cbb2d1ee1c 100644
> --- a/drivers/dma/ppc4xx/dma.h
> +++ b/drivers/dma/ppc4xx/dma.h
> @@ -70,20 +70,11 @@
>
> #define DMA_CUED_XOR_BASE (0x10000000)
> #define DMA_CUED_XOR_HB (0x00000008)
> -
> -#ifdef CONFIG_440SP
> -#define DMA_CUED_MULT1_OFF 0
> -#define DMA_CUED_MULT2_OFF 8
> -#define DMA_CUED_MULT3_OFF 16
> -#define DMA_CUED_REGION_OFF 24
> -#define DMA_CUED_XOR_WIN_MSK (0xFC000000)
> -#else
> #define DMA_CUED_MULT1_OFF 2
> #define DMA_CUED_MULT2_OFF 10
> #define DMA_CUED_MULT3_OFF 18
> #define DMA_CUED_REGION_OFF 26
> #define DMA_CUED_XOR_WIN_MSK (0xF0000000)
> -#endif
>
> #define DMA_CUED_REGION_MSK 0x3
> #define DMA_RXOR123 0x0
> --
> 2.56.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-03 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:36 [PATCH v4] dmaengine: ppc4xx: remove dead 440SP code Julian Braha
2026-12-03 17:54 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox