diff mbox

mwifiex: card reset: enable rescan of non-removable card

Message ID 1405670437-18723-1-git-send-email-afenkart@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Andreas Fenkart July 18, 2014, 8 a.m. UTC
mmc_rescan will scan for non-removable cards only once, hence the card
will not be rediscovered.

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
 drivers/net/wireless/mwifiex/sdio.c | 1 +
 1 file changed, 1 insertion(+)

Comments

James Cameron July 18, 2014, 8:12 a.m. UTC | #1
On Fri, Jul 18, 2014 at 10:00:37AM +0200, Andreas Fenkart wrote:
> mmc_rescan will scan for non-removable cards only once, hence the card
> will not be rediscovered.
> 
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> ---
>  drivers/net/wireless/mwifiex/sdio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index 4ce3d7b..eff3d6e 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -1931,6 +1931,7 @@ static void sdio_card_reset_worker(struct work_struct *work)
>  	mmc_remove_host(target);
>  	/* 20ms delay is based on experiment with sdhci controller */
>  	mdelay(20);
> +	reset_host->rescan_entered = 0; /* rescan non-removable cards */
>  	mmc_add_host(target);
>  }
>  static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);

Thanks!  Maybe that was my problem.
John W. Linville July 18, 2014, 5:59 p.m. UTC | #2
On Fri, Jul 18, 2014 at 10:00:37AM +0200, Andreas Fenkart wrote:
> mmc_rescan will scan for non-removable cards only once, hence the card
> will not be rediscovered.
> 
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> ---
>  drivers/net/wireless/mwifiex/sdio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index 4ce3d7b..eff3d6e 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -1931,6 +1931,7 @@ static void sdio_card_reset_worker(struct work_struct *work)
>  	mmc_remove_host(target);
>  	/* 20ms delay is based on experiment with sdhci controller */
>  	mdelay(20);
> +	reset_host->rescan_entered = 0; /* rescan non-removable cards */
>  	mmc_add_host(target);
>  }
>  static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);

Building wireless-next:

  CC      drivers/net/wireless/mwifiex/sdio.o
drivers/net/wireless/mwifiex/sdio.c: In function ‘mwifiex_sdio_card_reset_work’:
drivers/net/wireless/mwifiex/sdio.c:1957:2: error: ‘reset_host’ undeclared (first use in this function)
  reset_host->rescan_entered = 0; /* rescan non-removable cards */
  ^
drivers/net/wireless/mwifiex/sdio.c:1957:2: note: each undeclared identifier is reported only once for each function it appears in
Bing Zhao July 18, 2014, 7:07 p.m. UTC | #3
Hi Andreas,

> > @@ -1931,6 +1931,7 @@ static void sdio_card_reset_worker(struct work_struct *work)

> >  	mmc_remove_host(target);

> >  	/* 20ms delay is based on experiment with sdhci controller */

> >  	mdelay(20);

> > +	reset_host->rescan_entered = 0; /* rescan non-removable cards */


You meant this?

+	target->rescan_entered = 0; /* rescan non-removable cards */

Regards,
Bing

> >  	mmc_add_host(target);

> >  }

> >  static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);

> 

> Building wireless-next:

> 

>   CC      drivers/net/wireless/mwifiex/sdio.o

> drivers/net/wireless/mwifiex/sdio.c: In function ‘mwifiex_sdio_card_reset_work’:

> drivers/net/wireless/mwifiex/sdio.c:1957:2: error: ‘reset_host’ undeclared (first use in this

> function)

>   reset_host->rescan_entered = 0; /* rescan non-removable cards */

>   ^

> drivers/net/wireless/mwifiex/sdio.c:1957:2: note: each undeclared identifier is reported only once

> for each function it appears in
Andreas Fenkart July 21, 2014, 7:56 a.m. UTC | #4
Hi

2014-07-18 21:07 GMT+02:00 Bing Zhao <bzhao@marvell.com>:
>> > @@ -1931,6 +1931,7 @@ static void sdio_card_reset_worker(struct work_struct *work)
>> >     mmc_remove_host(target);
>> >     /* 20ms delay is based on experiment with sdhci controller */
>> >     mdelay(20);
>> > +   reset_host->rescan_entered = 0; /* rescan non-removable cards */

I used the global the variable,
static struct mmc_host *reset_host;

>
> You meant this?
>
> +       target->rescan_entered = 0; /* rescan non-removable cards */

of course, should be the local variable, sending out new patch.

v2
- replaced global variable by local 'target' variable

>
> Regards,
> Bing
>
>> >     mmc_add_host(target);
>> >  }
>> >  static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);
>>
>> Building wireless-next:
>>
>>   CC      drivers/net/wireless/mwifiex/sdio.o
>> drivers/net/wireless/mwifiex/sdio.c: In function ‘mwifiex_sdio_card_reset_work’:
>> drivers/net/wireless/mwifiex/sdio.c:1957:2: error: ‘reset_host’ undeclared (first use in this
>> function)
>>   reset_host->rescan_entered = 0; /* rescan non-removable cards */
>>   ^
>> drivers/net/wireless/mwifiex/sdio.c:1957:2: note: each undeclared identifier is reported only once
>> for each function it appears in
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andreas Fenkart July 21, 2014, 8:01 a.m. UTC | #5
v2
- replaced global variable by local 'target' variable

Andreas Fenkart (1):
  mwifiex: card reset: enable rescan of non-removable card

 drivers/net/wireless/mwifiex/sdio.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 4ce3d7b..eff3d6e 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1931,6 +1931,7 @@  static void sdio_card_reset_worker(struct work_struct *work)
 	mmc_remove_host(target);
 	/* 20ms delay is based on experiment with sdhci controller */
 	mdelay(20);
+	reset_host->rescan_entered = 0; /* rescan non-removable cards */
 	mmc_add_host(target);
 }
 static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);