From: Ricky WU <ricky_wu@realtek.com>
To: Gwendal Grignou <gwendal@google.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
"gfl3162@gmail.com" <gfl3162@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"kai.heng.feng@canonical.com" <kai.heng.feng@canonical.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
"mingo@kernel.org" <mingo@kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] misc: rtsx: usb: Ensure mmc child device is active when card is present
Date: Fri, 18 Jul 2025 10:28:40 +0000 [thread overview]
Message-ID: <b1bda1a712b64785ad4a3c1a083ca839@realtek.com> (raw)
In-Reply-To: <CAMHSBOWue5bwysERvoZQjSG8h32me06wwcSQGteTN=aX=5OXYg@mail.gmail.com>
> > ---
> > 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
> >
next prev parent reply other threads:[~2025-07-18 10:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-17 18:01 Gwendal Grignou
2025-07-18 10:28 ` Ricky WU [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-18 18:19 Gwendal Grignou
2025-07-11 14:01 Ricky Wu
2025-07-16 10:39 ` Ulf Hansson
2025-07-21 2:33 ` Gavin Li
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=b1bda1a712b64785ad4a3c1a083ca839@realtek.com \
--to=ricky_wu@realtek.com \
--cc=arnd@arndb.de \
--cc=gfl3162@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gwendal@google.com \
--cc=kai.heng.feng@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/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
all inboxes | Powered by JetHome®