Thread (9 messages) 9 messages, 5 authors, 2012-06-20

Re: [PATCH] mmc: sh_mmcif: Support MMC_SLEEP_AWAKE command

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: 2012-06-20 10:51:34
Also in: linux-mmc

Hi Simon,

On Wednesday 20 June 2012 15:42:38 Simon Horman wrote:
On Wed, Jun 13, 2012 at 09:39:56AM +0200, Laurent Pinchart wrote:
quoted
On Wednesday 13 June 2012 10:12:01 Simon Horman wrote:
quoted
On Tue, Jun 12, 2012 at 10:56:09PM +0200, Laurent Pinchart wrote:
quoted
The MMC_SLEEP_AWAKE and SD_IO_SEND_OP_COND commands share the same
opcode. SD_IO_SEND_OP_COND isn't supported by the SH MMCIF, but
MMC_SLEEP_AWAKE is. Discriminate between the two commands using the
command flags, and reject SD_IO_SEND_OP_COND only.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 drivers/mmc/host/sh_mmcif.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

Not supporting the MMC_SLEEP_AWAKE command makes system suspend fail
if an MMC or eMMC device supporting sleep/wake is connected. The issue
has been first noticed on the Armadillo 800 EVA board.
Hi Laurent,

Do you have a test-case for this?
echo mem > /sys/power/state on Armadillo 800 EVA was my test case. It
failed without the patch, and succeeds with it.
I'm not having much luck with or without your patch.

# echo mem > /sys/power/state
echo: write error: No such device

I am using 3.5-rc3. With the armadillo default config + EXT3 + SUSPEND.
Perhaps I am missing some options?
You're probably missing a patch. I'll send it as a reply to this e-mail.
quoted
quoted
Also, did you check to make sure that the Mackerel still works?
Yes it still works. However, I have no way to test the MMC_SLEEP_AWAKE
command on the Mackerel board, as my MMC card doesn't support it (on the
Armadillo the eMMC chip supports the MMC_SLEEP_AWAKE command).

BTW, I wonder whether the current implementation is really the best one.
If the hardware doesn't support SD/SDIO commands, instead of intercepting
commands and rejecting the ones used by SD/SDIO at probe time, wouldn't it
be better for host drivers to tell that they don't support SD and/or SDIO
using flags in the mmc_host structure ?
I don't have any strong thoughts on this but your approach
does sound interesting.
-- 
Regards,

Laurent Pinchart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help