[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b1bda1a712b64785ad4a3c1a083ca839@realtek.com>
Date: Fri, 18 Jul 2025 10:28:40 +0000
From: Ricky WU <ricky_wu@...ltek.com>
To: Gwendal Grignou <gwendal@...gle.com>, Ulf Hansson <ulf.hansson@...aro.org>
CC: Arnd Bergmann <arnd@...db.de>, "gfl3162@...il.com" <gfl3162@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"kai.heng.feng@...onical.com" <kai.heng.feng@...onical.com>,
Linux Kernel
<linux-kernel@...r.kernel.org>,
"mingo@...nel.org" <mingo@...nel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH] misc: rtsx: usb: Ensure mmc child device is active when card is present
> > ---
> > drivers/misc/cardreader/rtsx_usb.c | 16 +++++++++-------
> > 1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/misc/cardreader/rtsx_usb.c
> b/drivers/misc/cardreader/rtsx_usb.c
> > index 148107a4547c..d007a4455ce5 100644
> > --- a/drivers/misc/cardreader/rtsx_usb.c
> > +++ b/drivers/misc/cardreader/rtsx_usb.c
> > @@ -698,6 +698,12 @@ static void rtsx_usb_disconnect(struct usb_interface
> *intf)
> > }
> >
> > #ifdef CONFIG_PM
> > +static int rtsx_usb_resume_child(struct device *dev, void *data)
> > +{
> > + pm_request_resume(dev);
> > + return 0;
> > +}
> > +
> > static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t
> message)
> > {
> > struct rtsx_ucr *ucr =
> > @@ -713,8 +719,10 @@ static int rtsx_usb_suspend(struct usb_interface
> *intf, pm_message_t message)
> > mutex_unlock(&ucr->dev_mutex);
> >
> > /* Defer the autosuspend if card exists */
> > - if (val & (SD_CD | MS_CD))
> > + if (val & (SD_CD | MS_CD)) {
> > + device_for_each_child(&intf->dev,
> NULL, rtsx_usb_resume_child);
> Why not calling rtsx_usb_resume() here?
Because in this time rtsx_usb is not in runtime_suspend, only need to make sure child is not in suspend
Actually when the program came here this suspend will be rejected because return -EAGAIN
> > return -EAGAIN;
> > + }
> > } else {
> > /* There is an ongoing operation*/
> > return -EAGAIN;
> > @@ -724,12 +732,6 @@ static int rtsx_usb_suspend(struct usb_interface
> *intf, pm_message_t message)
> > return 0;
> > }
> >
> > -static int rtsx_usb_resume_child(struct device *dev, void *data)
> > -{
> > - pm_request_resume(dev);
> > - return 0;
> > -}
> > -
> > static int rtsx_usb_resume(struct usb_interface *intf)
> > {
> > device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child);
> > --
> > 2.25.1
> >
Powered by blists - more mailing lists