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]
Message-ID: <5562C90D.8070507@redhat.com>
Date:	Mon, 25 May 2015 09:02:37 +0200
From:	Hans de Goede <hdegoede@...hat.com>
To:	Michal Suchanek <hramrach@...il.com>, linux-sunxi@...glegroups.com,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	David Lanzendörfer 
	<david.lanzendoerfer@....ch>, Chen-Yu Tsai <wens@...e.org>,
	Peter Griffin <peter.griffin@...aro.org>,
	linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mmc: sunxi: Also set SDXC_LOW_POWER_ON

Hi,

On 24-05-15 20:04, Michal Suchanek wrote:
> The function sunxi_mmc_oclk_onoff filters out the SDXC_LOW_POWER_ON flag
> but never sets it.
>
> Set SDXC_LOW_POWER_ON when oclk is disabled.

Nack, looking at the datasheet I do not thing this patch actually
does anything, according to the datasheet setting this bit to 1 results
in: "Turn off card clock when FSM in IDLE state", iow this does mmc clock
gating on idle automatically in hardware, since we completely disable the
clock on clock-off by clearing SDXC_CARD_CLOCK_ON setting this bit on
clock-off is a nop.

We could consider actually setting this to safe power when setting the clock
on, for doing that it would be good to look at the android code and see if
it ever sets this bit and if so when.

WRT CONFIG_MMC_CLKGATE we are probably better off using SDXC_LOW_POWER_ON
then that when it is enabled. So maybe we should set SDXC_LOW_POWER_ON
based on #ifdef WRT CONFIG_MMC_CLKGATE, and have some way to tell the
mmc core to not do clock gating on this host ?

Regards,

Hans



>
> Signed-off-by: Michal Suchanek <hramrach@...il.com>
> ---
>   drivers/mmc/host/sunxi-mmc.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 7cdeecd..e957888 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -603,6 +603,8 @@ static int sunxi_mmc_oclk_onoff(struct sunxi_mmc_host *host, u32 oclk_en)
>
>   	if (oclk_en)
>   		rval |= SDXC_CARD_CLOCK_ON;
> +	else
> +		rval |= SDXC_LOW_POWER_ON;
>
>   	start = jiffies;
>   	end = start + msecs_to_jiffies(750);
>
--
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