#9925 NORM 1.5-sof: rfkill vs SD bus rescan on resume issues
Zarro Boogs per Child
bugtracker at laptop.org
Wed Jan 20 13:36:52 EST 2010
#9925: rfkill vs SD bus rescan on resume issues
------------------------------+---------------------------------------------
Reporter: dsd | Owner: dsaxena
Type: defect | Status: assigned
Priority: normal | Milestone: 1.5-software-update
Component: kernel | Version: not specified
Resolution: | Keywords:
Next_action: code | Verified: 0
Deployment_affected: | Blockedby:
Blocking: |
------------------------------+---------------------------------------------
Changes (by dsaxena):
* status: new => assigned
Comment:
I believe the following patch should solve this. Will test and report
back.
{{{
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 216f1c4..b37cea9 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1022,6 +1022,9 @@ EXPORT_SYMBOL(mmc_suspend_host);
int mmc_resume_host(struct mmc_host *host)
{
int err = 0;
+#ifdef CONFIG_OLPC_RFKILL_XO_1_5
+ extern bool olpc_rfkill_state;
+#endif
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
@@ -1050,8 +1053,15 @@ int mmc_resume_host(struct mmc_host *host)
* We add a slight delay here so that resume can progress
* in parallel.
*/
+#ifdef CONFIG_OLPC_RFKILL_XO_1_5
+ /* Only rescan if not SW-blocked */
+ if (!olpc_rfkill_state) {
+ printk("RESCAN HOST!\n");
+#endif
mmc_detect_change(host, 1);
-
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 216f1c4..b37cea9 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1022,6 +1022,9 @@ EXPORT_SYMBOL(mmc_suspend_host);
int mmc_resume_host(struct mmc_host *host)
{
int err = 0;
+#ifdef CONFIG_OLPC_RFKILL_XO_1_5
+ extern bool olpc_rfkill_state;
+#endif
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
@@ -1050,8 +1053,15 @@ int mmc_resume_host(struct mmc_host *host)
* We add a slight delay here so that resume can progress
* in parallel.
*/
+#ifdef CONFIG_OLPC_RFKILL_XO_1_5
+ /* Only rescan if not SW-blocked */
+ if (!olpc_rfkill_state) {
+ printk("RESCAN HOST!\n");
+#endif
mmc_detect_change(host, 1);
-
+#ifdef CONFIG_OLPC_RFKILL_XO_1_5
+ }
+#endif
return err;
}
diff --git a/drivers/platform/x86/olpc-rfkill.c b/drivers/platform/x86
/olpc-rfkill.c
index 0f3d96d..1ea4195 100644
--- a/drivers/platform/x86/olpc-rfkill.c
+++ b/drivers/platform/x86/olpc-rfkill.c
@@ -38,7 +38,7 @@
#include "../../mmc/host/sdhci.h"
-static bool current_state;
+bool olpc_rfkill_state;
static int olpc_rfkill_set_block(void *data, bool blocked)
{
@@ -46,12 +46,12 @@ static int olpc_rfkill_set_block(void *data, bool
blocked)
extern void mmc_start_host(struct mmc_host *);
struct sdhci_host *olpc_rfkill_host = (struct sdhci_host *)data;
- if (blocked && !current_state)
+ if (blocked && !olpc_rfkill_state)
mmc_stop_host(olpc_rfkill_host->mmc);
- else if (!blocked && current_state)
+ else if (!blocked && olpc_rfkill_state)
mmc_start_host(olpc_rfkill_host->mmc);
- current_state = blocked;
+ olpc_rfkill_state = blocked;
return 0;
}
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/9925#comment:1>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list