[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY5PR11MB6366D892E7B6FDB112751306EDF2A@CY5PR11MB6366.namprd11.prod.outlook.com>
Date: Tue, 21 Oct 2025 12:51:30 +0000
From: "Usyskin, Alexander" <alexander.usyskin@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: Miquel Raynal <miquel.raynal@...tlin.com>, Richard Weinberger
<richard@....at>, Vignesh Raghavendra <vigneshr@...com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Abliyev,
Reuven" <reuven.abliyev@...el.com>, "De Marchi, Lucas"
<lucas.demarchi@...el.com>
Subject: RE: [PATCH] mtd: intel-dg: wake card on operations
> Subject: Re: [PATCH] mtd: intel-dg: wake card on operations
>
> On Mon, Oct 20, 2025 at 01:09:10PM +0300, Andy Shevchenko wrote:
> > On Sun, Oct 19, 2025 at 06:01:45PM +0300, Alexander Usyskin wrote:
> > > Enable runtime PM in mtd driver to notify parent graphics driver
> > > that whole card should be kept awake while nvm operations are
> > > performed through this driver.
>
> Ah, and perhaps a bit elaboration why graphics card needs that?
>
The memory power will be cut when whole card is powered down.
Intel DG card does not have separate power control for persistent memory.
Will add this in v2.
> ...
>
> > > + pm_runtime_mark_last_busy(nvm->dev);
> > > + pm_runtime_put_autosuspend(nvm->dev);
> >
> > Please, drop the second (duplicate) call.
Missed the patch where pm_runtime_put_autosuspend includes pm_runtime_mark_last_busy.
Will update in V2, thx
>
> ...
>
> > > + devm_pm_runtime_enable(device);
> >
> > Please, justify why this code is good without error checking. Before doing
> that
> > think for a moment for the cases when devm_*() might be developed in the
> future
> > and return something interesting (if not yet).
>
We should not fail the probe because of runtime pm enablement failure, I suppose.
There are other ways to keep card awake.
The pm_runtime_* functions work without runtime_enable but have no effect.
Thus, we can ignore failure here.
> ...
>
> > > err:
> > > + pm_runtime_put(device);
> > > +err_norpm:
> > > kref_put(&nvm->refcnt, intel_dg_nvm_release);
> > > return ret;
> >
> > Mixing devm with non-devm usually lead to hard to catch bugs in the error
> paths
> > / remove stages with ordering of cleaning resources up.
>
I see that this pattern is reasonably common in drivers.
There can't be devm wrappers for pm_runtime_get/put and these functions works
regardless of enable status.
> --
> With Best Regards,
> Andy Shevchenko
>
- -
Thanks,
Sasha
Powered by blists - more mailing lists