All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Dubov <oakad@yahoo.com>
To: Pierre Ossman <drzeus-mmc@drzeus.cx>
Cc: linux-kernel@vger.kernel.org
Subject: [mmc] incorrect behavior on resume
Date: Sat, 17 Feb 2007 07:16:39 -0800 (PST)	[thread overview]
Message-ID: <77095.44448.qm@web36703.mail.mud.yahoo.com> (raw)
In-Reply-To: <45CF5AB0.6080309@drzeus.cx>

And today: yet another problem with mmc.
It so happens that after resume mmc layer issues requests to the device before mmc_resume_host is
called at all. Moreover, this prevents the machine from resuming, unless worked around, because
software timer does not work at this stage of the resume and interrupts may not be delivered (if
card was removed, for example).
And here are some logs (condition: card is present when machine is suspended and removed before it
is resumed).
Normally, only this is seen in the log:
---------
Feb 18 01:42:09 mortug usbdev3.1_ep00: PM: resume from 0, parent usb3 still 2
Feb 18 01:42:09 mortug usbdev3.1_ep81: PM: resume from 0, parent 3-0:1.0 still 2
Feb 18 01:42:09 mortug tifm_sd0:3 : controller failed to reset
Feb 18 01:42:09 mortug tifm_sd tifm_sd0:3: resume initialize -19
Feb 18 01:42:09 mortug mmcblk0: unable to set block size to 512: 1
---------
Here, the controller failed to reset because card disappeared, so mmc_resume_host will not be
called - however mmc layer already complains that it can not set the block size. To get a better
log, I commented out the mmc_remove_host and left the card in place:

--------
Feb 18 01:02:58 mortug usbdev3.1_ep00: PM: resume from 0, parent usb3 still 2
Feb 18 01:02:58 mortug usbdev3.1_ep81: PM: resume from 0, parent 3-0:1.0 still 2
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: resume initialize 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x7, arg: 0xe6240000, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x7, arg: 0xe6240000, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x7, arg: 0xe6240000, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x7, arg: 0xe6240000, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: executing opcode 0x10, arg: 0x200, mask: 0x2140
Feb 18 01:02:58 mortug tifm_sd tifm_sd0:3: host event: host_status 80, flags 0
Feb 18 01:02:58 mortug mmcblk0: unable to set block size to 512: 1
-----

It appears to me that mmc_block resumes and starts issuing requests all by itself, which is
incorrect.

For reference - correct resume sequence (card remains in place, mmc_resume_host called):

------
Feb 18 01:41:34 mortug usbdev3.1_ep00: PM: resume from 0, parent usb3 still 2
Feb 18 01:41:34 mortug usbdev3.1_ep81: PM: resume from 0, parent 3-0:1.0 still 2
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: resume initialize 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: ios: clock = 0, vdd = 15, bus_mode = 1, chip_select =
0, power_mode = 1, bus_width = 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: ios: clock = 333333, vdd = 15, bus_mode = 1,
chip_select = 0, power_mode = 2, bus_width = 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: ios: clock = 333333, vdd = 15, bus_mode = 1,
chip_select = 1, power_mode = 2, bus_width = 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: executing opcode 0x0, arg: 0x0, mask: 0x40
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: host event: host_status 1, flags 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: ios: clock = 333333, vdd = 15, bus_mode = 1,
chip_select = 0, power_mode = 2, bus_width = 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: executing opcode 0x37, arg: 0x0, mask: 0x2140
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: host event: host_status 1, flags 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: executing opcode 0x29, arg: 0x0, mask: 0x1340
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: host event: host_status 1001, flags 0
Feb 18 01:41:34 mortug tifm_sd tifm_sd0:3: ios: clock = 333333, vdd = 14, bus_mode = 1,
chip_select = 0, power_mode = 2, bus_width = 0
-------

My really simple resume function:
-------
static int tifm_sd_resume(struct tifm_dev *sock)
{
        struct mmc_host *mmc = tifm_get_drvdata(sock);
        struct tifm_sd *host = mmc_priv(mmc);
        int rc;

        rc = tifm_sd_initialize_host(host);
        dev_dbg(&sock->dev, "resume initialize %d\n", rc);

        if (!rc) {
                host->eject = 0;
                rc = mmc_resume_host(mmc);
        }

        return rc;
}




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

  parent reply	other threads:[~2007-02-17 15:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 22:20 [2.6.20] tifm_7xx1/mmc not working Andreas Steinmetz
2007-02-08  5:59 ` Pierre Ossman
2007-02-08 23:35   ` Alex Dubov
2007-02-09 12:27     ` Andreas Steinmetz
2007-02-09 15:14   ` Recent and not-so problems with tifm_sd driver Alex Dubov
2007-02-09 19:10     ` Pierre Ossman
2007-02-10  9:12       ` Recent and not-so problems with tifm_sd driver - one more Alex Dubov
2007-02-10 13:01         ` Pierre Ossman
2007-02-11  6:03           ` Brad Campbell
2007-02-11 14:52             ` Fabio Comolli
2007-02-11 15:40             ` Pierre Ossman
2007-02-11 15:56               ` Brad Campbell
2007-02-11 18:04                 ` Pierre Ossman
2007-02-11 19:32                   ` Brad Campbell
2007-02-12  9:14                     ` Pierre Ossman
2007-02-12 10:50                       ` Brad Campbell
2007-02-12 13:21                     ` Andreas Steinmetz
2007-02-17 15:16                   ` Alex Dubov [this message]
2007-02-17 23:35                     ` [mmc] incorrect behavior on resume Pierre Ossman
2007-02-18  0:29                       ` Pavel Machek
2007-02-18  1:46                         ` Alex Dubov
2007-02-18  6:53                           ` Russell King
2007-02-18 12:18                             ` Alex Dubov
2007-02-11  4:47       ` Recent and not-so problems with tifm_sd driver Alex Dubov
2007-02-11 18:15         ` Pierre Ossman
2007-02-12 11:53           ` Alex Dubov
2007-02-12 13:49             ` Pierre Ossman
2007-02-13  0:44               ` Alex Dubov
2007-02-13 14:40               ` Alex Dubov
2007-02-17 23:14                 ` Pierre Ossman
2007-02-17 23:51             ` Pierre Ossman
2007-02-18  4:59               ` Alex Dubov
2007-02-18  8:13                 ` Pierre Ossman
2007-02-18 14:19                   ` Alex Dubov
2007-02-18 15:10                     ` Pierre Ossman
2007-02-18 23:48                       ` Alex Dubov
2007-02-19  7:06                         ` Pierre Ossman
2007-02-19 12:09                           ` Alex Dubov
2007-02-19 12:34                             ` Pierre Ossman
2007-02-20  1:30                               ` Alex Dubov
2007-02-20  7:03                                 ` Pierre Ossman
2007-03-14 14:44                               ` Weird MMC errors: 1 of 2 - bad ocr value Alex Dubov
2007-04-08 19:41                                 ` Pierre Ossman

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=77095.44448.qm@web36703.mail.mud.yahoo.com \
    --to=oakad@yahoo.com \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.