From: sashiko-bot@kernel.org
To: "Devendra K Verma" <devverma@amd.com>
Cc: Frank.Li@kernel.org, dmaengine@vger.kernel.org, vkoul@kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v1 2/3] dmaengine: dw-edma: Enable Chan Separation via VSEC
Date: Wed, 22 Jul 2026 11:33:07 +0000 [thread overview]
Message-ID: <20260722113308.1F1EA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722111640.1146212-3-devverma@amd.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The parsed channel separation size (`ch_sep_sz`) is a dead store; it is never passed to the core DMA driver.
- [Medium] dw_edma_get_ch_sep_sz() silently falls back to 256 bytes for unsupported hardware channel separation values.
- [Medium] The newly added `ch_sep_sz` field is left uninitialized (implicitly 0) for statically defined devices.
--
--- Patch [2]: [PATCH v1 2/3] dmaengine: dw-edma: Enable Chan Separation via VSEC ---
commit 5d0ec977534da50b8d8937caafb8d91a21d54565
Author: Devendra K Verma <devverma@amd.com>
dmaengine: dw-edma: Enable Chan Separation via VSEC
This commit aims to enable channel separation via the VSEC capability for
DEVICE INFORMATION. It parses the channel separation size from the hardware
registers up to 4K.
> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index ec5e057a0f11b..6295d01ba2f71 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
[ ... ]
> @@ -73,6 +74,7 @@ struct dw_edma_pcie_data {
> u16 wr_ch_cnt;
> u16 rd_ch_cnt;
> u64 devmem_phys_off;
> + u32 ch_sep_sz;
> };
>
> static const struct dw_edma_pcie_data snps_edda_data = {
[Severity: Medium]
Does this leave the newly added ch_sep_sz field uninitialized (implicitly 0)
for statically defined devices like snps_edda_data?
If the core driver begins relying on this field to space out channel registers,
will preexisting devices calculate an offset of 0 for all channels and break
DMA functionality?
[ ... ]
> @@ -189,6 +191,23 @@ static int dw_edma_pcie_irq_vector(struct device *dev, unsigned int nr)
> return pci_irq_vector(to_pci_dev(dev), nr);
> }
>
> +static u32 dw_edma_get_ch_sep_sz(u32 ch_sep_val)
> +{
> + switch (ch_sep_val) {
> + default:
> + case 0:
> + return 256;
[Severity: Medium]
If a hardware device advertises a channel separation size greater than 4K
(e.g., 8K/0x5, 16K/0x6, 32K/0x7 as mentioned in the commit message), will
this switch statement silently hit the default case and return 256 bytes
instead of the actual hardware size, leading to incorrect memory offsets?
> + case 1:
> + return 512;
> + case 2:
> + return 1024;
> + case 3:
> + return 2048;
> + case 4:
> + return 4096;
> + }
> +}
[ ... ]
> @@ -324,9 +345,9 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
> struct dw_edma_pcie_data *pdata = (void *)pid->driver_data;
> struct device *dev = &pdev->dev;
> struct dw_edma_chip *chip;
> + bool non_ll = false;
> int err, nr_irqs;
> int i, mask;
> - bool non_ll = false;
>
> if (!pdata)
> return -ENODEV;
[Severity: High]
Is the parsed channel separation size actually used by the core driver?
The VSEC capability is parsed into pdata->ch_sep_sz in this patch, but it
doesn't appear to be copied to the struct dw_edma_chip or used anywhere
to calculate register offsets, leaving the feature non-functional.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260722111640.1146212-1-devverma@amd.com?part=2
next prev parent reply other threads:[~2026-07-22 11:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 11:16 [PATCH v1 0/3] CPM6 Channel Separation Support Devendra K Verma
2026-07-22 11:16 ` [PATCH v1 1/3] dmaengine: dw-edma: Make Xilinx Macros Dev Name Agnostic Devendra K Verma
2026-07-22 11:24 ` sashiko-bot
2026-07-22 14:51 ` Frank Li
2026-07-22 11:16 ` [PATCH v1 2/3] dmaengine: dw-edma: Enable Chan Separation via VSEC Devendra K Verma
2026-07-22 11:33 ` sashiko-bot [this message]
2026-07-22 15:00 ` Frank Li
2026-07-22 11:16 ` [PATCH v1 3/3] dmaengine: dw-edma: Add changes to support Channel Separation Devendra K Verma
2026-07-22 11:32 ` sashiko-bot
2026-07-22 15:22 ` Frank Li
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=20260722113308.1F1EA1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=devverma@amd.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox