From: Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Chris Ball <chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org>
Cc: "linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Suspend of SDIO function devices
Date: Sun, 24 Jun 2018 22:46:39 +0200 [thread overview]
Message-ID: <b8a41e3a-7100-ae17-1275-d1b40a026201@zonque.org> (raw)
Hi,
I'm currently looking into the suspend callbacks of drivers of hardware
that use an SDIO interface, specifically the libertas_sdio driver:
drivers/net/wireless/marvell/libertas/if_sdio.c
The comments in if_sdio_suspend() suggest that by returning -ENOSYS due
to runtime-dependant circumstances, the MMC core will remove the card
entirely at suspend time. I then searched for the bits that do that and
failed, until I came across this old commit, which first appeared in 3.16:
573185cc7e6 mmc: core: Invoke sdio func driver's PM callbacks from
the sdio bus
Before that commit, the mmc core did in fact invoke the card's
.suspend() callback manually and if it returned a non-zero result, it
would remove the card. Now that the generic pm functions are in place,
this does no longer happen because the host and its clients are
independent entities. Consequently, systems fail to suspend when the
libertas_sdio module is loaded.
The pm notifier code in drivers/mmc/core/core.c does still handle cases
where no pm functions are provided at all (in which case it removes the
card), but it doesn't handle -ENOSYS return values at runtime.
Now I'm wondering how this is supposed to work, and which end needs
fixing. The mmc/sdio core by restoring the old logic from before
573185cc7e6, or the libertas driver.
The platform I'm working on does not retain power for the SDIO slaves,
so a complete re-init is necessary after resume.
Please advise, I'm happy to test approaches and send patches.
Thanks,
Daniel
next reply other threads:[~2018-06-24 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-24 20:46 Daniel Mack [this message]
2018-06-25 15:00 ` Suspend of SDIO function devices Ulf Hansson
2018-06-26 20:34 ` Daniel Mack
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=b8a41e3a-7100-ae17-1275-d1b40a026201@zonque.org \
--to=daniel-cyrqpvfzoowdnm+yrofe0a@public.gmane.org \
--cc=chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org \
--cc=libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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