Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-30 Thread Mark Brown
On Wed, Mar 24, 2021 at 05:17:52PM -0700, Dmitry Torokhov wrote: > OK, I can look into it. In the meantime wills something like below a bit > easier for you to stomach? If so I'll resubmit formally. Well, it's a bit nicer for a bus level bodge so I guess, but really I'm more thinking we need some

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-24 Thread Dmitry Torokhov
On Wed, Mar 24, 2021 at 11:39:35PM +, Mark Brown wrote: > On Wed, Mar 24, 2021 at 03:27:23PM -0700, Dmitry Torokhov wrote: > > On Wed, Mar 24, 2021 at 09:32:26PM +, Mark Brown wrote: > > > > TBH that looks like a fairly standard case where you probably don't want > > > to be using devm for

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-24 Thread Mark Brown
On Wed, Mar 24, 2021 at 03:27:23PM -0700, Dmitry Torokhov wrote: > On Wed, Mar 24, 2021 at 09:32:26PM +, Mark Brown wrote: > > TBH that looks like a fairly standard case where you probably don't want > > to be using devm for the interrupts in the first place. Leaving the > > interrupts live a

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-24 Thread Dmitry Torokhov
On Wed, Mar 24, 2021 at 09:32:26PM +, Mark Brown wrote: > On Tue, Mar 23, 2021 at 12:04:34PM -0700, Dmitry Torokhov wrote: > > On Tue, Mar 23, 2021 at 05:36:06PM +, Mark Brown wrote: > > > No it is ordering issue. I do not have a proven real-life example for > > SPI, but we do have one for

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-24 Thread Mark Brown
On Tue, Mar 23, 2021 at 12:04:34PM -0700, Dmitry Torokhov wrote: > On Tue, Mar 23, 2021 at 05:36:06PM +, Mark Brown wrote: > No it is ordering issue. I do not have a proven real-life example for > SPI, but we do have one for I2C: > https://lore.kernel.org/linux-devicetree/20210305041236.3489-

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-23 Thread Dmitry Torokhov
On Tue, Mar 23, 2021 at 05:36:06PM +, Mark Brown wrote: > On Mon, Mar 22, 2021 at 12:38:15PM -0700, Dmitry Torokhov wrote: > > On Mon, Mar 22, 2021 at 12:37:07PM +, Mark Brown wrote: > > > > This feels like it might make sense to push up to the driver core level > > > then rather than doin

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-23 Thread Mark Brown
On Mon, Mar 22, 2021 at 12:38:15PM -0700, Dmitry Torokhov wrote: > On Mon, Mar 22, 2021 at 12:37:07PM +, Mark Brown wrote: > > This feels like it might make sense to push up to the driver core level > > then rather than doing in individual buses? > That is exactly the issue: we can't. Driver

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-22 Thread Dmitry Torokhov
On Mon, Mar 22, 2021 at 12:37:07PM +, Mark Brown wrote: > On Sun, Mar 21, 2021 at 06:43:32PM -0700, Dmitry Torokhov wrote: > > > Note that this is not SPI-specific issue. I already send a similar > > patch for I2C and will be sending more. > > This feels like it might make sense to push up to

Re: [PATCH] spi: ensure timely release of driver-allocated resources

2021-03-22 Thread Mark Brown
On Sun, Mar 21, 2021 at 06:43:32PM -0700, Dmitry Torokhov wrote: > Note that this is not SPI-specific issue. I already send a similar > patch for I2C and will be sending more. This feels like it might make sense to push up to the driver core level then rather than doing in individual buses? sig

[PATCH] spi: ensure timely release of driver-allocated resources

2021-03-21 Thread Dmitry Torokhov
More and more drivers rely on devres to manage their resources, however if bus' probe() and release() methods are not trivial and control some of resources as well (for example enable or disable clocks, or attach device to a power domain), we need to make sure that driver-allocated resources are re