public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Vivian Wang <wangruikang@iscas.ac.cn>,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org
Cc: tglx@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
	npiggin@gmail.com, chleroy@kernel.org, gjoyce@ibm.com
Subject: Re: [PATCH] powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices
Date: Thu, 19 Feb 2026 23:02:57 +0530	[thread overview]
Message-ID: <20554bdb-68b4-4ff2-96de-af6c3a434290@linux.ibm.com> (raw)
In-Reply-To: <6f02c046-1ff6-4086-8fd0-a276eabece10@iscas.ac.cn>



On 2/19/26 12:52 PM, Vivian Wang wrote:
> On 2/18/26 01:45, Nilay Shroff wrote:
> 
>> Recent changes [1] replaced the use of no_64bit_msi with msi_addr_mask.
>> As a result, msi_addr_mask is now expected to be initialized to
>> DMA_BIT_MASK(64) when a pci_dev is set up. However, this initialization
>> was missed on powerpc due to differences in the device initialization
>> path compared to other architectures. Due to this, now pci device probe
>> method fails on powerpc system.
>>
>> On powerpc systems, struct pci_dev instances are created from device
>> tree nodes via of_create_pci_dev(). Because msi_addr_mask was not
>> initialized there, it remained zero. Later, during MSI setup,
>> msi_verify_entries() validates the programmed MSI address against
>> pdev->msi_addr_mask. Since the mask was not set correctly, the
>> validation fails, causing PCI driver probe failures for devices on
>> powerpc systems.
> 
> Thanks for catching this. I had naively assumed that pci_setup_device()
> was the right place for adding this initialization, and didn't think of
> other possibilities.
> 
> I grep'd for pci_alloc_dev() and found these uses:
> 
>   * of_create_pci_dev() in arch/powerpc/kernel/pci_of_scan.c (this patch)
>   * of_create_pci_dev() in arch/sparc/kernel/pci.c (*same missed init*)
>   * drivers/char/agp/{alpha,parisc}-agp.c (fake pci_dev, should be fine)
>   * drivers/scsi/megaraid.c (copying from existing pci_dev, should be fine)
> 
> So, while we're at it, can we fix the SPARC one as well in v2? The code
> seems similar to what we do for powerpc.

Yes I can do that but I don't have access to SPARC machine so I can't validate 
it. However I'd add SPARC maintainers and mailing list for review and so someone
might help.

> 
>> Initialize pdev->msi_addr_mask to DMA_BIT_MASK(64) in
>> of_create_pci_dev() so that MSI address validation succeeds and device
>> probe works as expected.
>>
>> [1] https://lore.kernel.org/all/20260129-pci-msi-addr-mask-v4-0-70da998f2750@iscas.ac.cn/
> 
> Nit: Link seems redundant given the Fixes tag below.
> 
Ack

Thanks,
--Nilay



  reply	other threads:[~2026-02-19 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 17:45 [PATCH] powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices Nilay Shroff
2026-02-19  7:22 ` Vivian Wang
2026-02-19 17:32   ` Nilay Shroff [this message]
2026-02-19 17:31 ` Bjorn Helgaas
2026-02-19 17:36   ` Nilay Shroff

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=20554bdb-68b4-4ff2-96de-af6c3a434290@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=gjoyce@ibm.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=tglx@kernel.org \
    --cc=wangruikang@iscas.ac.cn \
    /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