Re: [PATCH 1/2] spi: Add missing pm_runtime_put_noidle() after failed get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 22, 2018 at 08:01:29PM +0200, Rafael J. Wysocki wrote:
> On 5/22/2018 11:32 AM, Mark Brown wrote:

> > That's still really confusing and surprising, it seems like if the
> > driver wants to manually call the callbacks there should be a specific
> > API that it can use to get that behaviour rather than requiring every
> > user to know that this might happen and manually handle it.

> That's a design choice made a long time a go and sorry for it turning out to
> be inconvenient.

It's not so much that it's inconvenient as that it's a really surprising
and unusual which makes it error prone - both in terms of people not
being aware of the behaviour and in terms of the expected handling
looking wrong.

> However, there are pieces of code in the kernel that don't check the return
> value of pm_runtime_get_sync() and then call pm_runtime_put() (or
> equivalent) after that unconditionally. They all would need to be changed to
> do the latter only if the preceding pm_runtime_get_sync() was successful.

This does mean that we're encouraging code that ignores errors which
doesn't seem ideal.  On the other hand trying to change anything at this
point might be more trouble than it's worth if there's too many users,
perhaps it's better to just try to document this more.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux