public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Vaibhav Gupta <vaibhavgupta40@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mtd: rawnand: cafe: Use generic power management'
Date: Sat, 21 Feb 2026 07:53:31 +0000	[thread overview]
Message-ID: <aZlke_ij_MI9sPsi@gmail.com> (raw)
In-Reply-To: <20260217155525.GA3377374@bhelgaas>

On Tue, Feb 17, 2026 at 09:55:25AM -0600, Bjorn Helgaas wrote:
> On Mon, Feb 16, 2026 at 09:02:44AM +0000, Vaibhav Gupta wrote:
> > Switch to the generic PCI power management framework and remove legacy
> > callbacks like .resume(). With the generic framework, the standard PCI
> > related work like:
> > 	- pci_save/restore_state()
> > 	- pci_enable/disable_device()
> > 	- pci_set_power_state()
> > is handled by the PCI core.
> > 
> > This driver should implement only cafe_nand specific operations in its
> > callback function for resume.
> 
> Looks good to me, thanks for doing this!
> 
> I think the commit log is a bit overly specific since this driver
> never did any of the PCI-related work it mentions.  IMO something like
> this would be sufficient:
> 
>   Switch from PCI power management to the generic power management
>   framework so the pci_driver hooks can eventually be retired.
> 
> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
> 
Hey Bjorn,

Thanks for the review. I will send a v2, and I will add your review tag there.

Thanks!

-- Vaibhav
> > Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
> > ---
> >  drivers/mtd/nand/raw/cafe_nand.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/cafe_nand.c b/drivers/mtd/nand/raw/cafe_nand.c
> > index 66385c4fb994..af771c379ec1 100644
> > --- a/drivers/mtd/nand/raw/cafe_nand.c
> > +++ b/drivers/mtd/nand/raw/cafe_nand.c
> > @@ -837,9 +837,10 @@ static const struct pci_device_id cafe_nand_tbl[] = {
> >  
> >  MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);
> >  
> > -static int cafe_nand_resume(struct pci_dev *pdev)
> > +static int cafe_nand_resume(struct device *dev)
> >  {
> >  	uint32_t ctrl;
> > +	struct pci_dev *pdev = to_pci_dev(dev);
> >  	struct mtd_info *mtd = pci_get_drvdata(pdev);
> >  	struct nand_chip *chip = mtd_to_nand(mtd);
> >  	struct cafe_priv *cafe = nand_get_controller_data(chip);
> > @@ -877,12 +878,14 @@ static int cafe_nand_resume(struct pci_dev *pdev)
> >  	return 0;
> >  }
> >  
> > +static DEFINE_SIMPLE_DEV_PM_OPS(cafe_nand_ops, NULL, cafe_nand_resume);
> > +
> >  static struct pci_driver cafe_nand_pci_driver = {
> >  	.name = "CAFÉ NAND",
> >  	.id_table = cafe_nand_tbl,
> >  	.probe = cafe_nand_probe,
> >  	.remove = cafe_nand_remove,
> > -	.resume = cafe_nand_resume,
> > +	.driver.pm = &cafe_nand_ops,
> >  };
> >  
> >  module_pci_driver(cafe_nand_pci_driver);
> > -- 
> > 2.53.0
> > 

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

  reply	other threads:[~2026-02-21  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16  9:02 [PATCH v1] mtd: rawnand: cafe: Use generic power management Vaibhav Gupta
2026-02-17 15:55 ` [PATCH v1] mtd: rawnand: cafe: Use generic power management' Bjorn Helgaas
2026-02-21  7:53   ` Vaibhav Gupta [this message]
2026-02-21  8:11 ` [PATCH v2] mtd: rawnand: cafe: Use generic power management Vaibhav Gupta
2026-02-25 16:50   ` 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=aZlke_ij_MI9sPsi@gmail.com \
    --to=vaibhavgupta40@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox