From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Cc: linux-edac@vger.kernel.org, git@amd.com,
shubhrajyoti.datta@gmail.com, michal.simek@amd.com,
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 05/12] EDAC/versalnet: Make dwidth per-controller
Date: Wed, 25 Nov 2026 12:44:24 -0500 [thread overview]
Message-ID: <20261125174424.GM2156781@yaz-khff2.amd.com> (raw)
In-Reply-To: <20261118142213.100581-6-shubhrajyoti.datta@amd.com>
On Wed, Nov 18, 2026 at 07:50:29PM +0530, Shubhrajyoti Datta wrote:
> Currently dwidth is a single scalar in mc_priv, so each call to
> init_one_mc() overwrites the previous controller's value.
>
> Fix this by converting dwidth to a per-controller array and passing
> the device type directly to mc_init() from the detected dt.
> This also updates the DIMM device type reported in EDAC.
>
> Fixes: d5fe2fec6c40 ("EDAC: Add a driver for the AMD Versal NET DDR controller")
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
> ---
>
> Changes in v2:
> https://sashiko.dev/#/patchset/20260724171945.2812749-1-shubhrajyoti.datta%40amd.com
> New patch to fix shashiko review comment "this is a pre-existing
> issue, but is the per-controller width overwriting the shared
> state for all controllers?".
>
> drivers/edac/versalnet_edac.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/edac/versalnet_edac.c b/drivers/edac/versalnet_edac.c
> index 0364648d91a1..ea90d3ce3e70 100644
> --- a/drivers/edac/versalnet_edac.c
> +++ b/drivers/edac/versalnet_edac.c
> @@ -140,7 +140,7 @@ struct ecc_status {
> * @stat: ECC status information.
> * @error_id: The error id.
> * @error_level: The error level.
> - * @dwidth: Width of data bus excluding ECC bits.
> + * @dwidth: Per-controller width of data bus excluding ECC bits.
> * @part_len: The support of the message received.
> * @regs: The registers sent on the rpmsg.
> * @adec: Address decode registers.
> @@ -153,7 +153,7 @@ struct mc_priv {
> struct ecc_status stat;
> u32 error_id;
> u32 error_level;
> - u32 dwidth;
> + enum dev_type dwidth[NUM_CONTROLLERS];
> u32 part_len;
> u32 regs[REG_MAX];
> u32 adec[ADEC_MAX];
> @@ -399,7 +399,7 @@ static unsigned long convert_to_physical(struct mc_priv *priv,
> else
> ilc_base_ctrl_add = ilcmem_base - low_mem_offset;
>
> - if (priv->dwidth == DEV_X16) {
> + if (priv->dwidth[controller] == DEV_X16) {
> blk = err_addr / MC5_X16_SIZE;
> rsh_req_addr = (blk << 8) + ilc_base_ctrl_add;
> err_addr = rsh_req_addr * interleave * 2;
> @@ -473,9 +473,9 @@ static void handle_error(struct mc_priv *priv, struct ecc_status *stat,
> }
> }
>
> -static void mc_init(struct mem_ctl_info *mci, struct device *dev)
> +static void mc_init(struct mem_ctl_info *mci, struct device *dev,
> + enum dev_type dtype)
> {
> - struct mc_priv *priv = mci->pvt_info;
With this change, now there are no users of mci->pvt_info.
So you could save some memory by not allocating it.
mci = edac_mc_alloc(i, ARRAY_SIZE(layers), layers, 0);
You set the last parameter to '0' ^^^
We have the same idea in amd64_edac.
Thanks,
Yazen
next prev parent reply other threads:[~2026-11-25 17:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 14:20 [PATCH v2 00/12] EDAC/versalnet: Fix error handling, teardown, and robustness Shubhrajyoti Datta
2026-11-18 14:20 ` [PATCH v2 01/12] EDAC/versalnet: Fix device_register() error handling in init_one_mc() Shubhrajyoti Datta
2026-11-20 13:38 ` Pandey, Radhey Shyam
2026-11-24 1:56 ` Borislav Petkov
2026-11-18 14:20 ` [PATCH v2 02/12] EDAC/versalnet: Use designated initializer for rpmsg_channel_info Shubhrajyoti Datta
2026-11-20 13:39 ` Pandey, Radhey Shyam
2026-11-24 2:19 ` Borislav Petkov
2026-11-18 14:20 ` [PATCH v2 03/12] EDAC/versalnet: Fix use-after-free in remove_one_mc() Shubhrajyoti Datta
2026-11-24 3:16 ` Borislav Petkov
2026-11-18 14:20 ` [PATCH v2 04/12] EDAC/versalnet: Add bounds validation in rpmsg_cb() Shubhrajyoti Datta
2026-11-20 15:43 ` Pandey, Radhey Shyam
2026-11-18 14:20 ` [PATCH v2 05/12] EDAC/versalnet: Make dwidth per-controller Shubhrajyoti Datta
2026-11-20 16:54 ` Pandey, Radhey Shyam
2026-11-25 17:44 ` Yazen Ghannam [this message]
2026-11-18 14:20 ` [PATCH v2 06/12] EDAC/versalnet: Wait for RPMsg endpoint initialization Shubhrajyoti Datta
2026-11-21 15:28 ` Pandey, Radhey Shyam
2026-11-18 14:20 ` [PATCH v2 07/12] EDAC/versalnet: Initialize MCDI before RPMsg registration Shubhrajyoti Datta
2026-11-21 15:33 ` Pandey, Radhey Shyam
2026-11-18 14:20 ` [PATCH v2 08/12] EDAC/versalnet: Guard against NULL drvdata in rpmsg_cb() Shubhrajyoti Datta
2026-11-23 17:36 ` Pandey, Radhey Shyam
2026-11-18 14:20 ` [PATCH v2 09/12] EDAC/versalnet: Move platform_set_drvdata() to mc_probe() Shubhrajyoti Datta
2026-11-18 14:20 ` [PATCH v2 10/12] dt-bindings: memory: xlnx,versal-net-ddrmc5: Add amd,num-ctrl property Shubhrajyoti Datta
2026-11-24 5:00 ` Pandey, Radhey Shyam
2026-11-24 6:35 ` Krzysztof Kozlowski
2026-11-18 14:20 ` [PATCH v2 11/12] EDAC/versalnet: use device tree property for number of controllers Shubhrajyoti Datta
2026-11-24 5:50 ` Pandey, Radhey Shyam
2026-11-18 14:20 ` [PATCH v2 12/12] EDAC/versalnet: Make get_ddr_config() return errors Shubhrajyoti Datta
2026-11-24 8:56 ` Pandey, Radhey Shyam
2026-11-25 17:22 ` Yazen Ghannam
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=20261125174424.GM2156781@yaz-khff2.amd.com \
--to=yazen.ghannam@amd.com \
--cc=bp@alien8.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=git@amd.com \
--cc=krzk@kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=robh@kernel.org \
--cc=shubhrajyoti.datta@amd.com \
--cc=shubhrajyoti.datta@gmail.com \
--cc=tony.luck@intel.com \
/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
all inboxes | Powered by JetHome®