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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL1qeaGkQVimrFNtGgfTJEHNemG_QUTecQwH4=nXu1_u1rWwhg@mail.gmail.com>
Date:	Wed, 19 Nov 2014 11:03:43 -0800
From:	Andrew Bresticker <abrestic@...omium.org>
To:	Doug Anderson <dianders@...omium.org>
Cc:	Jaehoon Chung <jh80.chung@...sung.com>,
	Seungwon Jeon <tgih.jun@...sung.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Alim Akhtar <alim.akhtar@...sung.com>,
	Sonny Rao <sonnyrao@...omium.org>,
	Heiko Stuebner <heiko@...ech.de>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	linux-rockchip@...ts.infradead.org, Chris Ball <chris@...ntf.net>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: dw_mmc: Turn the card clock off at suspend time

Doug,

On Wed, Nov 19, 2014 at 10:51 AM, Doug Anderson <dianders@...omium.org> wrote:
> Since the dw_mmc driver was first added to Linux it's had a TODO in it
> that we should turn off the card clock during suspend.  I have no idea
> for sure why it wasn't done originally, but if I had to guess I'd
> guess it was related to the lack of a common clock framework.  Let's
> do it now.
>
> There is no reason for the card clock to be left on during suspend and
> most systems will eventually turn it off anyway (when whole clock
> trees are disabled).  However, it's good to be explicit that it's
> disabled at the time that the MMC subsystem is disabled.

Should the bus clock (biu) be disabled as well?

> This actually fixes a bug on Rockchip rk3288 where an SDIO card wakes
> the system back up during suspend.
>
> Signed-off-by: Doug Anderson <dianders@...omium.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 5a37c33..c448159 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2825,11 +2825,10 @@ EXPORT_SYMBOL(dw_mci_remove);
>
>
>  #ifdef CONFIG_PM_SLEEP
> -/*
> - * TODO: we should probably disable the clock to the card in the suspend path.
> - */
>  int dw_mci_suspend(struct dw_mci *host)
>  {
> +       clk_disable(host->ciu_clk);

I think you need to check for IS_ERR(host->ciu_clk) since the clock is
optional.  Also, maybe disable_unprepare instead of just disable?

> @@ -2838,6 +2837,8 @@ int dw_mci_resume(struct dw_mci *host)
>  {
>         int i, ret;
>
> +       clk_enable(host->ciu_clk);

Check return value?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ