mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: bp@alien8.de, tony.luck@intel.com, rounakdas2025@gmail.com,
	niravkumar.l.rabara@altera.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCHv4 1/4] EDAC/altera: use flag to differentiate 64-bit platforms
Date: Mon, 30 Nov 2026 12:13:51 -0600	[thread overview]
Message-ID: <a66f3a0e-4724-4b73-9768-4b9d8305ed55@kernel.org> (raw)
In-Reply-To: <20261125203753.GP2156781@yaz-khff2.amd.com>



On 11/25/26 14:37, Yazen Ghannam wrote:
> On Mon, Nov 16, 2026 at 02:28:51PM -0600, Dinh Nguyen wrote:
>> In commit (d4486fc3098e "EDAC/altera: Use ECC manager compatible to select
>> A10/S10 IRQ layout"), it added a way to only differentiate Stratix10 from
>> a 32-bit platform. In preparation to add support for Agilex5, it needs a
>> way to make a further differentiation.
>>
>> Make use of the driver match data to hold a flag for different platforms,
>> specifically Stratix10 and Agilex5.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
>> ---
>> v4: no changes
>> v3: no changes
>> v2: use enum for altr_platform_idx
>>      use SOCFPGA_A10 for A10 platforms
> 
> The first revision had a cover letter but the follow ups don't. Is this
> intentional?

Yes, I didn't think it needed one. I'll add one to v5.>
>> ---
>>   drivers/edac/altera_edac.c | 20 +++++++++++---------
>>   drivers/edac/altera_edac.h |  8 +++++++-
>>   2 files changed, 18 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
>> index bb95dab847b3c..78f4a1b0fc64a 100644
>> --- a/drivers/edac/altera_edac.c
>> +++ b/drivers/edac/altera_edac.c
>> @@ -1489,7 +1489,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
>>   	int edac_idx, rc;
>>   	struct device_node *np;
>>   	const struct edac_device_prv_data *prv = &a10_sdmmceccb_data;
>> -	bool is_s10 = device->edac->is_s10;
>> +	unsigned long flag = (unsigned long)device->edac->flag;
> 
> Why is the cast needed? 'device->edac->flag' is already unsigned long.

Will remove.

> 
>>   
>>   	rc = altr_check_ecc_deps(device);
>>   	if (rc)
>> @@ -1538,7 +1538,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
>>   	 */
>>   

<snip>

>>   	{},
>>   };
>>   MODULE_DEVICE_TABLE(of, altr_edac_a10_of_match);
>> diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h
>> index 9387056fd65e3..4a9da28fa96ba 100644
>> --- a/drivers/edac/altera_edac.h
>> +++ b/drivers/edac/altera_edac.h
>> @@ -351,6 +351,12 @@ struct altr_sdram_mc_data {
>>   #define ECC_READ_EOVR                     0x2
>>   #define ECC_READ_EDOVR                    0x3
>>   
>> +enum altr_platform_idx {
>> +	SOCFPGA_A10,
>> +	SOCFPGA_S10,
>> +	SOCFPGA_AGILEX5
> 
> AGILEX5 isn't used yet, so it could be added in the patch that first
> uses it.
> 
> Also, consider having a comma (,) for the last entry, so that new
> entries can be added without changing multiple lines.
> 

Will do in v5.

>> +};
>> +
>>   struct altr_edac_device_dev;
>>   
>>   struct edac_device_prv_data {
>> @@ -394,7 +400,7 @@ struct altr_arria10_edac {
>>   	struct irq_chip		irq_chip;
>>   	struct list_head	a10_ecc_devices;
>>   	struct notifier_block	panic_notifier;
>> -	bool is_s10;
>> +	unsigned long		flag;
> 
> So it looks like this 'flag' is used to store the 'enum
> altr_platform_idx' values, correct?
> 
> It does not contain flags.
> 
> Consider using a more explicit name and defining the field with the enum
> type. Something like 'enum altr_platform_idx platform'.
> 
> Also, '_idx' reads as 'index', but these aren't used that way. So you
> could remove '_idx' from the enum definition above.
> 

Will address in v5.

Thanks for the review!

Dinh


      reply	other threads:[~2026-11-30 18:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 20:28 Dinh Nguyen
2026-11-16 20:28 ` [PATCHv4 2/4] dt-bindings: edac: altera: agilex5: document new edac support Dinh Nguyen
2026-11-17 17:23   ` Rob Herring (Arm)
2026-11-16 20:28 ` [PATCHv4 3/4] EDAC/altera: Add support for Agilex5 ECC manager Dinh Nguyen
2026-11-25 20:55   ` Yazen Ghannam
2026-11-30 18:04     ` Dinh Nguyen
2026-11-16 20:28 ` [PATCHv4 4/4] arm64: dts: socfpga: agilex5: add support for the " Dinh Nguyen
2026-11-25 20:37 ` [PATCHv4 1/4] EDAC/altera: use flag to differentiate 64-bit platforms Yazen Ghannam
2026-11-30 18:13   ` Dinh Nguyen [this message]

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=a66f3a0e-4724-4b73-9768-4b9d8305ed55@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=bp@alien8.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niravkumar.l.rabara@altera.com \
    --cc=robh@kernel.org \
    --cc=rounakdas2025@gmail.com \
    --cc=tony.luck@intel.com \
    --cc=yazen.ghannam@amd.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®