login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
February
»
5
Re: [PATCH] MMC: fix hang if card was removed during suspend and unsafe resume was enabled
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Adrian Hunter
Subject:
Re: [PATCH] MMC: fix hang if card was removed during suspend and unsafe resume was enabled
Date: Friday, February 5, 2010 - 3:17 am
ext Andrew Morton wrote:
quoted text
> On Fri, 5 Feb 2010 01:18:15 +0200 Maxim Levitsky <maximlevitsky@gmail.com> wrote: > >> Currently removal of the card leads to del_disk called indirectly by mmc core. >> This function expects userspace to be running, which isn't when .resume is called >> >> Fix that by removing the code that did that in mmc_resume_host. It is possible >> because card detection logic will kick it later and remove the card. > > I don't really understand. The above implies that to trigger this bug, > one needs to physically remove the card during a resume operation. ie: > a human-vs-computer race. Sounds unlikely? > > So... exactly what steps does the user need to take to trigger this > bug? > >> Also make mtd workqueue freezeable, so it won't attempt to add/remove the card >> while userspace is frozen. >> >> >> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c >> index 30acd52..879d48d 100644 >> --- a/drivers/mmc/core/core.c >> +++ b/drivers/mmc/core/core.c >> @@ -1257,7 +1257,6 @@ int mmc_suspend_host(struct mmc_host *host, pm_message_t state) >> if (host->caps & MMC_CAP_DISABLE) >> cancel_delayed_work(&host->disable); >> cancel_delayed_work(&host->detect); >> - mmc_flush_scheduled_work(); >> >> mmc_bus_get(host); >> if (host->bus_ops && !host->bus_dead) { >> @@ -1300,15 +1299,11 @@ int mmc_resume_host(struct mmc_host *host) >> mmc_select_voltage(host, host->ocr); >> BUG_ON(!host->bus_ops->resume); >> err = host->bus_ops->resume(host); >> + >> if (err) { >> printk(KERN_WARNING "%s: error %d during resume " >> "(card was removed?)\n", >> mmc_hostname(host), err); >> - if (host->bus_ops->remove) >> - host->bus_ops->remove(host); >> - mmc_claim_host(host); >> - mmc_detach_bus(host); >> - mmc_release_host(host); > > afacit that code's been there since March 2009. I'd have thought that > someone would have noticed "kernel hangs on resume" before now. > > Do you think the patch should be backported into 2.6.32.x and eariler?
It looks like the code was introduced in 2.6.32.x by commit 95cdfb72b9bc568803f395c266152c71b034b461 cc'ing the author Nicolas Pitre
quoted text
> >> /* no need to bother upper layers */ >> err = 0; >> } >> @@ -1332,7 +1327,7 @@ static int __init mmc_init(void) >> { >> int ret; >> >> - workqueue = create_singlethread_workqueue("kmmcd"); >> + workqueue = create_freezeable_workqueue("kmmcd"); >> if (!workqueue) >> return -ENOMEM; > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to
majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
>
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Hand on resume if sd/mmc card was removed while system was ...
, Maxim Levitsky
, (Wed Feb 3, 10:47 am)
[PATCH] MMC: fix hang if card was removed during suspend a ...
, Maxim Levitsky
, (Thu Feb 4, 4:18 pm)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Andrew Morton
, (Thu Feb 4, 5:09 pm)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 1:31 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Adrian Hunter
, (Fri Feb 5, 3:17 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 6:42 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Andrew Morton
, (Fri Feb 5, 7:13 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 7:19 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Andrew Morton
, (Fri Feb 5, 7:39 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 8:52 am)
RE: [PATCH] MMC: fix hang if card was removed during suspe ...
, Madhusudhan
, (Fri Feb 5, 9:19 am)
RE: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 9:32 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Andrew Morton
, (Fri Feb 5, 11:26 am)
Re: [PATCH] MMC: fix hang if card was removed during suspe ...
, Maxim Levitsky
, (Fri Feb 5, 12:58 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Trenton D. Adams
Re: Flash IO slow 1.5 MB/s
Alan Cox
Re: Please add ZFS support (from GPL sources)
S K
Re: cpufreq doesn't seem to work in Intel Q9300
Bart Van Assche
Re: Is gcc thread-unsafe?
Con Kolivas
Re: [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2
git
:
Junio C Hamano
Re: git-svnimport
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Junio C Hamano
Re: [PATCH] Detached HEAD (experimental)
Mark Burton
Re: Sporadic BSOD with msys git?
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
sm501: add power control callback
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
V4L/DVB (8976): af9015: Add USB ID for AVerMedia A309
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
linux-netdev
:
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Ingo Molnar
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Jeff Kirsher
[net-2.6 PATCH 2/5] e1000e: increase swflag acquisition timeout for ICHx/PCH
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
openbsd-misc
:
daniele.pilenga
snmpd hangs on 4.1 looking up hrSWRunTable
Christophe Rioux
Implementation example of snmp
Nick Holland
Re: booting openbsd on eee without cd-rom
Bryan Irvine
Re: OpenBSD 4.7 Released, May 19 2010
Cabillot Julien
Re: OpenBSD isakmpd and pf vs Cisco PIX or ASA
Colocation donated by:
Syndicate