All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Han Xu <han.xu@nxp.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	imx@lists.linux.dev, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mtd: nand: raw: gpmi: improve power management handling
Date: Mon, 7 Oct 2024 11:52:11 +0200	[thread overview]
Message-ID: <20241007115211.0ad33fda@xps-13> (raw)
In-Reply-To: <20241004092144.3e0d89b5@xps-13>

Hi Miquel,

miquel.raynal@bootlin.com wrote on Fri, 4 Oct 2024 09:21:44 +0200:

> Hi Han,
> 
> han.xu@nxp.com wrote on Thu, 3 Oct 2024 15:05:08 -0500:
> 
> > On 24/10/03 05:28PM, Miquel Raynal wrote:  
> > > Hi Han,
> > > 
> > > han.xu@nxp.com wrote on Thu, 3 Oct 2024 10:05:16 -0500:
> > >     
> > > > On 24/10/03 09:38AM, Miquel Raynal wrote:    
> > > > > Hi Han,
> > > > > 
> > > > > han.xu@nxp.com wrote on Wed,  2 Oct 2024 10:39:44 -0500:
> > > > >       
> > > > > > The commit refactors the power management handling in the gpmi nand
> > > > > > driver. It removes redundant pm_runtime calls in the probe function,
> > > > > > handles the pad control in suspend and resume, and moves the calls to
> > > > > > acquire and release DMA channels to the runtime suspend and resume
> > > > > > functions.      
> > > > > 
> > > > > May I know the motivation to acquire and release the DMA channels
> > > > > during suspend? In general it seems like a different change which I'd
> > > > > prefer to see in its own commit with a justification. The rest looks
> > > > > ok otherwise.      
> > > > 
> > > > Hi Miquel,
> > > > 
> > > > Thanks for your comments. IMHO there is no much logic changes indeed, just move
> > > > the dma channel acquire and release from system pm to the runtime pm, releasing
> > > > the unused resources as early as possible. If you think it's necessary I will
> > > > split the patch into two parts.    
> > > 
> > > Actually I don't understand why these channels are released and
> > > acquired again. Does it make sense to do that in the (runtime)
> > > suspend/resume path? I'd be in favor of avoiding this extra
> > > configuration which as a first sight does not seem required here.    
> > 
> > Our local mxs-dma driver (will upstream the changes later) implemented the runtime
> > resume/suspend in channel alloc/release functions, so I did this in the gpmi
> > nand driver suspend/resume path.  
> 
> I think it no longer makes sense. RPM takes care of the
> suppliers, at least since fw_devlink=rpm.

Just to be clear, you can send v3 addressing Frank's comment and just
keep the DMA channels handling as it is, but please work on removing
this hack of dropping/allocating DMA channels in suspend/resume path, it
is really not worth the trouble and purely useless with any recent
kernel.

Thanks,
Miquèl

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Han Xu <han.xu@nxp.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	imx@lists.linux.dev, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mtd: nand: raw: gpmi: improve power management handling
Date: Mon, 7 Oct 2024 11:52:11 +0200	[thread overview]
Message-ID: <20241007115211.0ad33fda@xps-13> (raw)
In-Reply-To: <20241004092144.3e0d89b5@xps-13>

Hi Miquel,

miquel.raynal@bootlin.com wrote on Fri, 4 Oct 2024 09:21:44 +0200:

> Hi Han,
> 
> han.xu@nxp.com wrote on Thu, 3 Oct 2024 15:05:08 -0500:
> 
> > On 24/10/03 05:28PM, Miquel Raynal wrote:  
> > > Hi Han,
> > > 
> > > han.xu@nxp.com wrote on Thu, 3 Oct 2024 10:05:16 -0500:
> > >     
> > > > On 24/10/03 09:38AM, Miquel Raynal wrote:    
> > > > > Hi Han,
> > > > > 
> > > > > han.xu@nxp.com wrote on Wed,  2 Oct 2024 10:39:44 -0500:
> > > > >       
> > > > > > The commit refactors the power management handling in the gpmi nand
> > > > > > driver. It removes redundant pm_runtime calls in the probe function,
> > > > > > handles the pad control in suspend and resume, and moves the calls to
> > > > > > acquire and release DMA channels to the runtime suspend and resume
> > > > > > functions.      
> > > > > 
> > > > > May I know the motivation to acquire and release the DMA channels
> > > > > during suspend? In general it seems like a different change which I'd
> > > > > prefer to see in its own commit with a justification. The rest looks
> > > > > ok otherwise.      
> > > > 
> > > > Hi Miquel,
> > > > 
> > > > Thanks for your comments. IMHO there is no much logic changes indeed, just move
> > > > the dma channel acquire and release from system pm to the runtime pm, releasing
> > > > the unused resources as early as possible. If you think it's necessary I will
> > > > split the patch into two parts.    
> > > 
> > > Actually I don't understand why these channels are released and
> > > acquired again. Does it make sense to do that in the (runtime)
> > > suspend/resume path? I'd be in favor of avoiding this extra
> > > configuration which as a first sight does not seem required here.    
> > 
> > Our local mxs-dma driver (will upstream the changes later) implemented the runtime
> > resume/suspend in channel alloc/release functions, so I did this in the gpmi
> > nand driver suspend/resume path.  
> 
> I think it no longer makes sense. RPM takes care of the
> suppliers, at least since fw_devlink=rpm.

Just to be clear, you can send v3 addressing Frank's comment and just
keep the DMA channels handling as it is, but please work on removing
this hack of dropping/allocating DMA channels in suspend/resume path, it
is really not worth the trouble and purely useless with any recent
kernel.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2024-10-07  9:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 15:39 [PATCH v2 1/2] mtd: nand: raw: gpmi: switch to SYSTEM_SLEEP_PM_OPS Han Xu
2024-10-02 15:39 ` Han Xu
2024-10-02 15:39 ` [PATCH v2 2/2] mtd: nand: raw: gpmi: improve power management handling Han Xu
2024-10-02 15:39   ` Han Xu
2024-10-02 16:23   ` Frank Li
2024-10-02 16:23     ` Frank Li
2024-10-03  7:38   ` Miquel Raynal
2024-10-03  7:38     ` Miquel Raynal
2024-10-03 15:05     ` Han Xu
2024-10-03 15:05       ` Han Xu
2024-10-03 15:28       ` Miquel Raynal
2024-10-03 15:28         ` Miquel Raynal
2024-10-03 20:05         ` Han Xu
2024-10-03 20:05           ` Han Xu
2024-10-04  7:21           ` Miquel Raynal
2024-10-04  7:21             ` Miquel Raynal
2024-10-07  9:52             ` Miquel Raynal [this message]
2024-10-07  9:52               ` Miquel Raynal

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=20241007115211.0ad33fda@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=han.xu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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.