Linux IOMMU Development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Lukas Wunner <lukas@wunner.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux-foundation.org,
	linux-samsung-soc@vger.kernel.org, Joerg Roedel <joro@8bytes.org>,
	Inki Dae <inki.dae@samsung.com>, Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Mark Brown <broonie@kernel.org>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Kevin Hilman <khilman@kernel.org>
Subject: Re: [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies)
Date: Sat, 24 Sep 2016 03:25:17 +0200	[thread overview]
Message-ID: <1514800.L7P1tHiLfo@vostro.rjw.lan> (raw)
In-Reply-To: <20160923135002.GB4077@wunner.de>

On Friday, September 23, 2016 03:50:02 PM Lukas Wunner wrote:
> On Fri, Sep 23, 2016 at 02:49:20PM +0200, Rafael J. Wysocki wrote:
> > On Tuesday, September 20, 2016 10:51:13 AM Marek Szyprowski wrote:
> > > On 2016-09-19 23:45, Tobias Jakobi wrote:
> > > > I did some tests with the new version today. Sadly the reboot/shutdown
> > > > issues are still present.
> > > 
> > > Thanks for the report. I've managed to reproduce this issue and it is again
> > > caused by modifying device on devices_kset list before it will be finally
> > > added by device_add(). I thought that the new patchset allows creating
> > > links to a device, which has not been yet added to system device list.
> 
> Hm, Marek, why isn't it possible to set up the links from the consumer's
> ->probe hook in this case?
> 
> 
> > > Should it be allowed to create a link to device, which
> > > has not yet been added to system device list by device_add()?
> > 
> > While it would be easy to require both the consumer and producer devices to
> > be registered for creating a link between them, that would just make it
> > harder to use links in the first place.
> > 
> > So ideally, it should be possible to create links between devices before
> > registering them, but since I didn't take that into account in the current
> > patch series, some quite substantial changes are needed to cover that.
> > 
> > Additional link states come to mind, but then the "stateless" links are
> > affected by this problem too.
> 
> device_link_add() could be changed to call device_reorder_to_tail()
> only if device_is_registered(consumer) returns true.
> 
> That's an inline function defined in <linux/device.h> which returns
> dev->kobj.state_in_sysfs, a flag which is set in kobject_add().

I know what that function is, but using it alone is not sufficient,
because dev->kobj.state_in_sysfs is set before the device is added to
dpm_list.

> Then device_add() would have to check if any links are already
> set up and reorder the consumer behind the suppliers.
> 
> Doesn't seem to be *that* complex, but probably I'm missing something,
> this is just off the cuff...

There are some cases to consider and some races to avoid AFAICS.

It all gets a lot simpler if device_link_add() is allowed to return NULL when
the supplier device passed to it has not been registered yet.  That looks like
a reasonable thing to do to me, but I wonder if someone has a use case in which
it would be a substantial limitation.

Thanks,
Rafael

  reply	other threads:[~2016-09-24  1:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160913124917eucas1p23425d2cb1c24e73ae3c2927ec141fd30@eucas1p2.samsung.com>
2016-09-13 12:48 ` [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies) Marek Szyprowski
     [not found]   ` <CGME20160913124917eucas1p2c4aa16e06cdbfa56bcd9921c6bb51e94@eucas1p2.samsung.com>
     [not found]     ` <1473770941-8337-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-09-13 12:49       ` [PATCH v3 1/2] iommu/exynos: Remove excessive, useless debug Marek Szyprowski
2016-09-13 12:49   ` [PATCH v3 2/2] iommu/exynos: Add proper runtime pm support Marek Szyprowski
2016-09-13 14:20     ` Ulf Hansson
2016-09-14  7:11       ` Marek Szyprowski
2016-09-14 10:28         ` Ulf Hansson
     [not found]           ` <CAPDyKFqtBhA6kv-DFmeCiWbn0q0g2hFR5-+9M7CgvbzNH2iOzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-14 10:50             ` Marek Szyprowski
2016-09-14 11:54               ` Ulf Hansson
     [not found]     ` <1473770941-8337-3-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-09-13 14:35       ` kbuild test robot
2016-09-19 21:45   ` [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies) Tobias Jakobi
     [not found]     ` <57E05C68.80804-o02PS0xoJP9W0yFyLvAVXMxlOr/tl8fh@public.gmane.org>
2016-09-20  8:51       ` Marek Szyprowski
     [not found]         ` <ef63bd8c-1797-cbf7-5c9e-ee2855c9e395-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-09-23 12:49           ` Rafael J. Wysocki
     [not found]             ` <6114649.EDczdxzVVo-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2016-09-23 13:50               ` Lukas Wunner
2016-09-24  1:25                 ` Rafael J. Wysocki [this message]
2016-09-26  8:15                   ` Marek Szyprowski
2016-09-26 12:34                     ` Rafael J. Wysocki

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=1514800.L7P1tHiLfo@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=inki.dae@samsung.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=m.szyprowski@samsung.com \
    --cc=mcgrof@kernel.org \
    --cc=tjakobi@math.uni-bielefeld.de \
    --cc=tomeu.vizoso@collabora.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