linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Siddharth Vadapalli <s-vadapalli@ti.com>
Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com,
	robh@kernel.org, vigneshr@ti.com, kishon@kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org,
	ahalaney@redhat.com, srk@ti.com
Subject: Re: [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL
Date: Fri, 26 Jul 2024 17:00:08 +0530	[thread overview]
Message-ID: <20240726113008.GE2628@thinkpad> (raw)
In-Reply-To: <4cb79826-5945-40d5-b52c-22959a5df41a@ti.com>

On Fri, Jul 26, 2024 at 03:54:17PM +0530, Siddharth Vadapalli wrote:
> On Thu, Jul 25, 2024 at 02:01:48PM +0530, Siddharth Vadapalli wrote:
> > On Thu, Jul 25, 2024 at 01:17:08PM +0530, Manivannan Sadhasivam wrote:
> > > On Thu, Jul 25, 2024 at 10:50:13AM +0530, Siddharth Vadapalli wrote:
> > > > On Wed, Jul 24, 2024 at 09:49:16PM +0530, Manivannan Sadhasivam wrote:
> > > > > On Wed, Jul 24, 2024 at 12:20:48PM +0530, Siddharth Vadapalli wrote:
> > > > > > Since the configuration of Legacy Interrupts (INTx) is not supported, set
> > > > > > the .map_irq and .swizzle_irq callbacks to NULL. This fixes the error:
> > > > > >   of_irq_parse_pci: failed with rc=-22
> > > > > > due to the absence of Legacy Interrupts in the device-tree.
> > > > > > 
> > > > > 
> > > > > Do you really need to set 'swizzle_irq' to NULL? pci_assign_irq() will bail out
> > > > > if 'map_irq' is set to NULL.
> > > > 
> > > > While 'swizzle_irq' won't be invoked if 'map_irq' is NULL, having a
> > > > non-NULL 'swizzle_irq' (pci_common_swizzle in this case) with a NULL
> > > > 'map_irq' seems inconsistent to me though the code-path may never invoke
> > > > it. Wouldn't a non-NULL 'swizzle_irq' imply that Legacy Interrupts are
> > > > supported, while a NULL 'map_irq' indicates that they aren't? Since they
> > > > are always described in pairs, whether it is in the initial commit that
> > > > added support for the Cadence PCIe Host controller (used by pci-j721e.c):
> > > > https://github.com/torvalds/linux/commit/1b79c5284439
> > > > OR the commit which moved the shared 'map_irq' and 'swizzle_irq' defaults
> > > > from all the host drivers into the common 'devm_of_pci_bridge_init()'
> > > > function:
> > > > https://github.com/torvalds/linux/commit/b64aa11eb2dd
> > > > I have set both of them to NULL for the sake of consistency.
> > > > 
> > > 
> > > Since both callbacks are populated in the pci/of driver, this consistency won't
> > > be visible in the controller drivers. From the functionality pov, setting both
> > > callbacks to NULL is *not* required to disable INTx, right?
> > 
> > Yes, setting 'swizzle_irq' to NULL isn't required. The execution sequence
> > with 'swizzle_irq' set to 'pci_common_swizzle()' is as follows:
> > 
> > pci_assign_irq()
> >   if (pin) {
> >     if (hbrg->swizzle_irq)
> >       slot = (*(hbrg->swizzle_irq))(dev, &pin);
> >         pci_common_swizzle()
> > 	  while (!pci_is_root_bus(dev->bus)) <= NOT entered
> > 	..continue execution similar to 'swizzle_irq' being NULL.
> > 
> > Having 'swizzle_irq' set to 'pci_common_swizzle()' will only result
> > in a no-op which could have been avoided by setting it to NULL. So there
> > is no difference w.r.t. functionality.
> 
> Mani,
> 
> I prefer setting 'swizzle_irq' to NULL as well unless you have an objection
> to it. Kindly let me know. I plan to post the v2 for this patch addressing
> Bjorn's feedback and collecting Andrew's "Tested-by" tag as well.
> 

Ok, fine with me.

- Mani

-- 
மணிவண்ணன் சதாசிவம்


  reply	other threads:[~2024-07-26 11:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  6:50 [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL Siddharth Vadapalli
2024-07-24 16:19 ` Manivannan Sadhasivam
2024-07-25  4:20   ` Manivannan Sadhasivam
2024-07-25  8:20     ` Siddharth Vadapalli
2024-07-26 11:56       ` Manivannan Sadhasivam
2024-08-05 16:01         ` Rob Herring
2024-08-05 16:45           ` Manivannan Sadhasivam
2024-08-05 19:05             ` Rob Herring
2024-08-05 20:40               ` Rob Herring
2024-08-08 20:56               ` Andrew Halaney
2024-08-09  5:33                 ` Manivannan Sadhasivam
2024-07-25  5:20   ` Siddharth Vadapalli
2024-07-25  7:47     ` Manivannan Sadhasivam
2024-07-25  8:31       ` Siddharth Vadapalli
2024-07-26 10:24         ` Siddharth Vadapalli
2024-07-26 11:30           ` Manivannan Sadhasivam [this message]
2024-07-26 12:06             ` Siddharth Vadapalli
2024-07-24 16:23 ` Bjorn Helgaas
2024-07-25  5:53   ` Siddharth Vadapalli
2024-07-25 21:19     ` Bjorn Helgaas
2024-07-25 22:21 ` Andrew Halaney

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=20240726113008.GE2628@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=ahalaney@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh@kernel.org \
    --cc=s-vadapalli@ti.com \
    --cc=srk@ti.com \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).