* [PATCH v2 2/2] dmaengine: pxa: Enable compile test
2025-01-14 19:10 [PATCH v2 1/2] dmaengine: Use str_enable_disable-like helpers Krzysztof Kozlowski
@ 2025-01-14 19:13 ` Krzysztof Kozlowski
2025-03-21 14:57 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-14 19:13 UTC (permalink / raw)
To: Vinod Koul, Manivannan Sadhasivam, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Peter Ujfalusi, Michal Simek, dmaengine,
linux-kernel, imx, linux-arm-kernel, linux-sunxi
Cc: Krzysztof Kozlowski
The PXA_DMA driver does not include any asm/mach headers, so it can be
compile tested for build coverage.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v2:
1. Fix subject typo
2. Drop () in Kconfig
---
drivers/dma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 8afea2e23360..df2d2dc00a05 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -546,7 +546,7 @@ config PL330_DMA
config PXA_DMA
bool "PXA DMA support"
- depends on (ARCH_MMP || ARCH_PXA)
+ depends on ARCH_MMP || ARCH_PXA || COMPILE_TEST
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
help
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
@ 2025-01-25 13:55 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-01-25 13:55 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250114191316.857154-1-krzysztof.kozlowski@linaro.org>
References: <20250114191316.857154-1-krzysztof.kozlowski@linaro.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
Hi Krzysztof,
kernel test robot noticed the following build warnings:
[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on shawnguo/for-next sunxi/sunxi/for-next mani-mhi/mhi-next xilinx-xlnx/master linus/master v6.13 next-20250124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/dmaengine-pxa-Enable-compile-test/20250115-031547
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
patch link: https://lore.kernel.org/r/20250114191316.857154-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
:::::: branch date: 11 days ago
:::::: commit date: 11 days ago
config: parisc-randconfig-r072-20250124 (https://download.01.org/0day-ci/archive/20250125/202501252153.wCMpgWlF-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202501252153.wCMpgWlF-lkp@intel.com/
New smatch warnings:
drivers/dma/pxa_dma.c:595 clear_chan_irq() warn: variable dereferenced before check 'phy->vchan' (see line 593)
Old smatch warnings:
drivers/dma/pxa_dma.c:1266 pxad_init_phys() error: uninitialized symbol 'ret'.
vim +595 drivers/dma/pxa_dma.c
a57e16cf03339c Robert Jarzmik 2015-05-25 583
a57e16cf03339c Robert Jarzmik 2015-05-25 584 static unsigned int clear_chan_irq(struct pxad_phy *phy)
a57e16cf03339c Robert Jarzmik 2015-05-25 585 {
a57e16cf03339c Robert Jarzmik 2015-05-25 586 u32 dcsr;
a57e16cf03339c Robert Jarzmik 2015-05-25 587 u32 dint = readl(phy->base + DINT);
a57e16cf03339c Robert Jarzmik 2015-05-25 588
a57e16cf03339c Robert Jarzmik 2015-05-25 589 if (!(dint & BIT(phy->idx)))
a57e16cf03339c Robert Jarzmik 2015-05-25 590 return PXA_DCSR_RUN;
a57e16cf03339c Robert Jarzmik 2015-05-25 591
a57e16cf03339c Robert Jarzmik 2015-05-25 592 /* clear irq */
a57e16cf03339c Robert Jarzmik 2015-05-25 @593 dcsr = phy_readl_relaxed(phy, DCSR);
a57e16cf03339c Robert Jarzmik 2015-05-25 594 phy_writel(phy, dcsr, DCSR);
a57e16cf03339c Robert Jarzmik 2015-05-25 @595 if ((dcsr & PXA_DCSR_BUSERR) && (phy->vchan))
a57e16cf03339c Robert Jarzmik 2015-05-25 596 dev_warn(&phy->vchan->vc.chan.dev->device,
a57e16cf03339c Robert Jarzmik 2015-05-25 597 "%s(chan=%p): PXA_DCSR_BUSERR\n",
a57e16cf03339c Robert Jarzmik 2015-05-25 598 __func__, &phy->vchan);
a57e16cf03339c Robert Jarzmik 2015-05-25 599
a57e16cf03339c Robert Jarzmik 2015-05-25 600 return dcsr & ~PXA_DCSR_RUN;
a57e16cf03339c Robert Jarzmik 2015-05-25 601 }
a57e16cf03339c Robert Jarzmik 2015-05-25 602
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
2025-01-14 19:13 ` [PATCH v2 2/2] dmaengine: pxa: Enable compile test Krzysztof Kozlowski
@ 2025-03-21 14:57 ` Dan Carpenter
2025-03-30 16:24 ` Krzysztof Kozlowski
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-03-21 14:57 UTC (permalink / raw)
To: oe-kbuild, Krzysztof Kozlowski; +Cc: lkp, oe-kbuild-all
[ Ancient email got eaten by msmtp. Resending. -dan ]
Hi Krzysztof,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/dmaengine-pxa-Enable-compile-test/20250115-031547
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
patch link: https://lore.kernel.org/r/20250114191316.857154-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
config: parisc-randconfig-r072-20250124 (https://download.01.org/0day-ci/archive/20250125/202501252153.wCMpgWlF-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202501252153.wCMpgWlF-lkp@intel.com/
New smatch warnings:
drivers/dma/pxa_dma.c:595 clear_chan_irq() warn: variable dereferenced before check 'phy->vchan' (see line 593)
vim +595 drivers/dma/pxa_dma.c
a57e16cf03339c Robert Jarzmik 2015-05-25 584 static unsigned int clear_chan_irq(struct pxad_phy *phy)
a57e16cf03339c Robert Jarzmik 2015-05-25 585 {
a57e16cf03339c Robert Jarzmik 2015-05-25 586 u32 dcsr;
a57e16cf03339c Robert Jarzmik 2015-05-25 587 u32 dint = readl(phy->base + DINT);
a57e16cf03339c Robert Jarzmik 2015-05-25 588
a57e16cf03339c Robert Jarzmik 2015-05-25 589 if (!(dint & BIT(phy->idx)))
a57e16cf03339c Robert Jarzmik 2015-05-25 590 return PXA_DCSR_RUN;
a57e16cf03339c Robert Jarzmik 2015-05-25 591
a57e16cf03339c Robert Jarzmik 2015-05-25 592 /* clear irq */
a57e16cf03339c Robert Jarzmik 2015-05-25 @593 dcsr = phy_readl_relaxed(phy, DCSR);
^^^
if phy->vchan is NULL this will crash
a57e16cf03339c Robert Jarzmik 2015-05-25 594 phy_writel(phy, dcsr, DCSR);
a57e16cf03339c Robert Jarzmik 2015-05-25 @595 if ((dcsr & PXA_DCSR_BUSERR) && (phy->vchan))
^^^^^^^^^^
Checked too late.
a57e16cf03339c Robert Jarzmik 2015-05-25 596 dev_warn(&phy->vchan->vc.chan.dev->device,
a57e16cf03339c Robert Jarzmik 2015-05-25 597 "%s(chan=%p): PXA_DCSR_BUSERR\n",
a57e16cf03339c Robert Jarzmik 2015-05-25 598 __func__, &phy->vchan);
a57e16cf03339c Robert Jarzmik 2015-05-25 599
a57e16cf03339c Robert Jarzmik 2015-05-25 600 return dcsr & ~PXA_DCSR_RUN;
a57e16cf03339c Robert Jarzmik 2015-05-25 601 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
2025-03-21 14:57 ` Dan Carpenter
@ 2025-03-30 16:24 ` Krzysztof Kozlowski
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-30 16:24 UTC (permalink / raw)
To: Dan Carpenter, oe-kbuild; +Cc: lkp, oe-kbuild-all
On 21/03/2025 15:57, Dan Carpenter wrote:
> [ Ancient email got eaten by msmtp. Resending. -dan ]
>
> Hi Krzysztof,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/dmaengine-pxa-Enable-compile-test/20250115-031547
> base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
> patch link: https://lore.kernel.org/r/20250114191316.857154-1-krzysztof.kozlowski%40linaro.org
> patch subject: [PATCH v2 2/2] dmaengine: pxa: Enable compile test
> config: parisc-randconfig-r072-20250124 (https://download.01.org/0day-ci/archive/20250125/202501252153.wCMpgWlF-lkp@intel.com/config)
> compiler: hppa-linux-gcc (GCC) 14.2.0
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202501252153.wCMpgWlF-lkp@intel.com/
>
> New smatch warnings:
> drivers/dma/pxa_dma.c:595 clear_chan_irq() warn: variable dereferenced before check 'phy->vchan' (see line 593)
>
> vim +595 drivers/dma/pxa_dma.c
>
> a57e16cf03339c Robert Jarzmik 2015-05-25 584 static unsigned int clear_chan_irq(struct pxad_phy *phy)
> a57e16cf03339c Robert Jarzmik 2015-05-25 585 {
> a57e16cf03339c Robert Jarzmik 2015-05-25 586 u32 dcsr;
> a57e16cf03339c Robert Jarzmik 2015-05-25 587 u32 dint = readl(phy->base + DINT);
> a57e16cf03339c Robert Jarzmik 2015-05-25 588
> a57e16cf03339c Robert Jarzmik 2015-05-25 589 if (!(dint & BIT(phy->idx)))
> a57e16cf03339c Robert Jarzmik 2015-05-25 590 return PXA_DCSR_RUN;
> a57e16cf03339c Robert Jarzmik 2015-05-25 591
> a57e16cf03339c Robert Jarzmik 2015-05-25 592 /* clear irq */
> a57e16cf03339c Robert Jarzmik 2015-05-25 @593 dcsr = phy_readl_relaxed(phy, DCSR);
> ^^^
> if phy->vchan is NULL this will crash
Correct, but my commit only enabled compile testing thus allowed this to
be checked on some popular platforms. Issue was already there.
The code is called pxad_chan_handler(), which already has BUG_ON() on
this, so I expect that condition is not possible.
It would be nice to rewrite the code, but I am afraid it is way too old
platform and no one cares enough.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-30 16:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-25 13:55 [PATCH v2 2/2] dmaengine: pxa: Enable compile test kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-01-14 19:10 [PATCH v2 1/2] dmaengine: Use str_enable_disable-like helpers Krzysztof Kozlowski
2025-01-14 19:13 ` [PATCH v2 2/2] dmaengine: pxa: Enable compile test Krzysztof Kozlowski
2025-03-21 14:57 ` Dan Carpenter
2025-03-30 16:24 ` Krzysztof Kozlowski
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.