lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 24 Jun 2018 22:46:39 +0200
From:   Daniel Mack <daniel@...que.org>
To:     Ulf Hansson <ulf.hansson@...aro.org>, Chris Ball <chris@...ntf.net>
Cc:     "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "libertas-dev@...ts.infradead.org" <libertas-dev@...ts.infradead.org>,
        linux-wireless@...r.kernel.org,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Suspend of SDIO function devices

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ