All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: "Marc Zyngier" <maz@kernel.org>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	"Pali Rohár" <pali@kernel.org>,
	"Johan Hovold" <johan+linaro@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Xiaowei Song" <songxiaowei@hisilicon.com>,
	"Binghui Wang" <wangbinghui@hisilicon.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Ryder Lee" <ryder.lee@mediatek.com>,
	"Jianjun Wang" <jianjun.wang@mediatek.com>,
	linux-pci@vger.kernel.org, "Krzysztof Wilczyński" <kw@linux.com>,
	"Ley Foon Tan" <ley.foon.tan@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Why set .suppress_bind_attrs even though .remove() implemented?
Date: Wed, 28 Sep 2022 08:36:15 +0200	[thread overview]
Message-ID: <YzPrX2UBfv/eXyjs@hovoldconsulting.com> (raw)
In-Reply-To: <YzMWbmWWul1AhpuR@lpieralisi>

On Tue, Sep 27, 2022 at 05:27:42PM +0200, Lorenzo Pieralisi wrote:
> On Mon, Jul 25, 2022 at 06:35:27PM +0100, Marc Zyngier wrote:
> 
> [...]
> 
> > > That is precisely the way I've been testing it and everything appears
> > > to be tore down as it should.
> > >
> > > And a PCI driver that has been unbound should have released its
> > > resources, or that's a driver bug. Right?
> > 
> > But that's the thing: you can easily remove part of the infrastructure
> > without the endpoint driver even noticing. It may not happen in your
> > particular case if removing the RC driver will also nuke the endpoints
> > in the process, but I can't see this is an absolute guarantee. The
> > crash pointed to by an earlier email is symptomatic of it.
> > 
> > > And for the OF INTx case you mentioned earlier, aren't those mapped by
> > > PCI core and could in theory be released by core as well?
> > 
> > Potentially, though I haven't tried to follow the life cycle of those.
> > The whole thing is pretty fragile, and this sort of resource is rarely
> > expected to be removed...
> 
> This made me notice that we don't undo the actions (ie bridge->map_irq())
> executed in pci_assign_irq() in pci_device_remove(); I don't think this
> can be right and that's already a candidate for a fix.

There's an inherent asymmetry here as a legacy interrupt can be used by
more than one device. It is mapped on first use as each user calls
->map_irq() but can only be disposed when the final user is gone as I
mentioned here:

	https://lore.kernel.org/all/Yt+6azfwd%2FLuMzoG@hovoldconsulting.com/

> It is not necessarily related to this thread topic, though I believe,
> in an _ideal_ world, removing a bridge should guarantee that all
> the downstream devices (ie drivers) had a chance of freeing/disposing
> the resources they allocated. This in theory; I totally understand
> Marc's point of view here and we should make up our mind about what
> we want to do on host bridge removal policy - this will take me more
> time to get to the bottom of it.

Johan

  reply	other threads:[~2022-09-28  6:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 19:54 Why set .suppress_bind_attrs even though .remove() implemented? Bjorn Helgaas
2022-07-21 20:46 ` Pali Rohár
2022-07-21 20:48   ` Conor.Dooley
2022-07-21 22:21   ` Bjorn Helgaas
2022-07-21 22:48     ` Pali Rohár
2022-07-22 13:26     ` Johan Hovold
2022-07-22 14:38       ` Bjorn Helgaas
2022-07-25 13:25         ` Johan Hovold
2022-07-25 14:43           ` Marc Zyngier
2022-07-25 15:18             ` Johan Hovold
2022-07-25 17:35               ` Marc Zyngier
2022-07-26  9:56                 ` Johan Hovold
2022-07-27 19:57                   ` Bjorn Helgaas
2022-07-28 12:17                     ` Johan Hovold
2022-09-27 15:27                 ` Lorenzo Pieralisi
2022-09-28  6:36                   ` Johan Hovold [this message]
2022-07-22 14:39     ` Bjorn Helgaas
2022-07-22 17:06       ` Marc Zyngier
2022-07-22 17:17         ` Bjorn Helgaas
2022-07-24  9:38           ` Marc Zyngier
2022-07-25 20:18             ` Florian Fainelli
2022-07-25 17:49         ` Conor.Dooley
2022-07-26  7:26           ` Marc Zyngier

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=YzPrX2UBfv/eXyjs@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=helgaas@kernel.org \
    --cc=jianjun.wang@mediatek.com \
    --cc=johan+linaro@kernel.org \
    --cc=kishon@ti.com \
    --cc=kw@linux.com \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=pali@kernel.org \
    --cc=ryder.lee@mediatek.com \
    --cc=songxiaowei@hisilicon.com \
    --cc=thierry.reding@gmail.com \
    --cc=wangbinghui@hisilicon.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.