All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Rob Herring <robh+dt@kernel.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
	Krzysztof Wilczy??ski <kw@linux.com>,
	Stanimir Varbanov <svarbanov@mm-sol.com>,
	linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	vidyas@nvidia.com
Subject: Re: [PATCH v2 1/2] PCI: dwc: Perform host_init() before registering msi
Date: Fri, 8 Oct 2021 18:48:03 +0100	[thread overview]
Message-ID: <20211008174803.GA32277@lpieralisi> (raw)
In-Reply-To: <YSVjQgDmatkkCxtn@ripper>

[+Vidya]

On Tue, Aug 24, 2021 at 02:23:14PM -0700, Bjorn Andersson wrote:
> On Tue 24 Aug 13:29 PDT 2021, Bjorn Helgaas wrote:
> 
> > On Tue, Aug 24, 2021 at 01:15:49PM -0700, Bjorn Andersson wrote:
> > > On Tue 24 Aug 12:05 PDT 2021, Bjorn Helgaas wrote:
> > > 
> > > > On Mon, Aug 23, 2021 at 08:49:57AM -0700, Bjorn Andersson wrote:
> > > > > On the Qualcomm sc8180x platform the bootloader does something related
> > > > > to PCI that leaves a pending "msi" interrupt, which with the current
> > > > > ordering often fires before init has a chance to enable the clocks that
> > > > > are necessary for the interrupt handler to access the hardware.
> > > > > 
> > > > > Move the host_init() call before the registration of the "msi" interrupt
> > > > > handler to ensure the host driver has a chance to enable the clocks.
> > > > 
> > > > Did you audit other drivers for similar issues?  If they do, we should
> > > > fix them all at once.
> > > 
> > > I only looked at the DesignWware drivers, in an attempt to find any
> > > issues the proposed reordering.
> > > 
> > > The set of bugs causes by drivers registering interrupts before critical
> > > resources tends to be rather visible and I don't know if there's much
> > > value in speculatively "fixing" drivers.
> > > 
> > > E.g. a quick look through the drivers I see a similar pattern in
> > > pci-tegra.c, but it's unlikely that they have the similar problem in
> > > practice and I have no way to validate that a change to the order would
> > > have a positive effect - or any side effects.
> > > 
> > > Or am I misunderstanding your request?
> > 
> > That is exactly my request.
> 
> Okay.
> 
> > I'm not sure if the potential issue you
> > noticed in pci-tegra.c is similar to the one I mentioned here:
> > 
> >   https://lore.kernel.org/linux-pci/20210624224040.GA3567297@bjorn-Precision-5520/
> > 
> 
> As I still have the tegra driver open, I share your concern about the
> use of potentially uninitialized variables.
> 
> The problem I was concerned about was however the same as in my patch
> and the rockchip one, that if the tegra hardware isn't clocked the
> pm_runtime_get_sync() (which would turn on power and clock) happens
> after setting up the msi chain handler...
> 
> > but I am actually in favor of speculatively fixing drivers even though
> > they're hard to test.  Code like this tends to get copied to other
> > places, and fixing several drivers sometimes exposes opportunities for
> > refactoring and sharing code.
> > 
> 
> Looking through the other cases mentioned in your reply above certainly
> gives a feeling that this problem has been inherited from driver to
> driver...
> 
> I've added a ticket to my backlog to take a deeper look at this.

Vidya, can you look into this please ? In the meantime I would merge
this series.

Thanks,
Lorenzo

> 
> Regards,
> Bjorn

  reply	other threads:[~2021-10-08 17:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 15:49 [PATCH v2 1/2] PCI: dwc: Perform host_init() before registering msi Bjorn Andersson
2021-08-23 15:49 ` [PATCH v2 2/2] PCI: qcom: Add sc8180x compatible Bjorn Andersson
2021-08-23 17:47   ` Rob Herring
2021-08-23 17:46 ` [PATCH v2 1/2] PCI: dwc: Perform host_init() before registering msi Rob Herring
2021-08-24 19:05 ` Bjorn Helgaas
2021-08-24 20:15   ` Bjorn Andersson
2021-08-24 20:29     ` Bjorn Helgaas
2021-08-24 21:23       ` Bjorn Andersson
2021-10-08 17:48         ` Lorenzo Pieralisi [this message]
2021-10-08 19:08           ` Bjorn Andersson
2021-10-12 12:47 ` Lorenzo Pieralisi

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=20211008174803.GA32277@lpieralisi \
    --to=lorenzo.pieralisi@arm.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=svarbanov@mm-sol.com \
    --cc=vidyas@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.