Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tushar Nimkar <tunimkar@amd.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Tushar Nimkar <tushar.nimkar@amd.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Michal Simek <michal.simek@amd.com>,
	"Sarangi, Anirudha" <anirudha.sarangi@amd.com>,
	git@amd.com
Subject: Re: [PATCH 2/2] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver
Date: Mon, 31 Aug 2026 17:02:07 +0530	[thread overview]
Message-ID: <53e214e8-2199-430e-8dd6-da56a91f541f@amd.com> (raw)
In-Reply-To: <41587817-c7dd-4fb2-aad7-772f85dedd6d@amd.com>

Hi Thomas,

>>> +{
>>> +     struct xilinx_smmu_csr *csr;
>>> +     int ret;
>>> +
>>> +     if (WARN_ON_ONCE(!parent))
>>> +             return -EINVAL;
>>> +
>>> +     if (irq_find_matching_fwnode(of_fwnode_handle(node),
>>> +                                  DOMAIN_BUS_ANY))
>>> +             return -ENODEV;
>>> +
>>> +     csr = kzalloc(sizeof(*csr), GFP_KERNEL);
>> devm_kzalloc()
> okay
>>
>>> +     if (!csr)
>>> +             return -ENOMEM;
>>> +
>>> +     raw_spin_lock_init(&csr->lock);
>>> +
>>> +     csr->base = of_iomap(node, 0);
>> devm_of_iomap()
> okay
>>
I realized later and thought to get a clarification on 
devm_kzalloc()/devm_of_iomap() -  both need a struct device *, but this 
driver registers via IRQCHIP_DECLARE, so xilinx_smmu_csr_init() is 
called from of_irq_init() during early boot — there's no bound struct 
device at that point. AFAIK - If I get device from 
of_find_device_by_node() it might return NULL since of_irq_init() time 
the platform bus isn't populated yet.
So I think we should keep using kzalloc()/of_iomap() -  what do you think?

Thanks,
Tushar Nimkar




      reply	other threads:[~2026-08-31 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:52 [PATCH 2/2] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver Tushar Nimkar
2026-08-19 19:33 ` Thomas Gleixner
2026-08-24  9:25   ` Tushar Nimkar
2026-08-31 11:32     ` Tushar Nimkar [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=53e214e8-2199-430e-8dd6-da56a91f541f@amd.com \
    --to=tunimkar@amd.com \
    --cc=anirudha.sarangi@amd.com \
    --cc=git@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=tglx@linutronix.de \
    --cc=tushar.nimkar@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