2014-07-18 08:00:56

by Andreas Fenkart

[permalink] [raw]
Subject: [PATCH] mwifiex: card reset: enable rescan of non-removable card

mmc_rescan will scan for non-removable cards only once, hence the card
will not be rediscovered.

Signed-off-by: Andreas Fenkart <[email protected]>
---
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);
--
2.0.1



2014-07-21 08:02:10

by Andreas Fenkart

[permalink] [raw]
Subject: [PATCH v2 0/1] mwifiex: card reset: enable rescan of non-removable card

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(+)

--
2.0.1


2014-07-18 18:00:12

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mwifiex: card reset: enable rescan of non-removable card

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 <[email protected]>
> ---
> 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

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2014-07-18 08:12:13

by James Cameron

[permalink] [raw]
Subject: Re: [PATCH] mwifiex: card reset: enable rescan of non-removable card

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 <[email protected]>
> ---
> 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.

--
James Cameron
http://quozl.linux.org.au/

2014-07-21 08:02:20

by Andreas Fenkart

[permalink] [raw]
Subject: [PATCH v2 1/1] mwifiex: card reset: enable rescan of non-removable card

mmc_rescan will scan for non-removable cards only once, hence the card
will not be rediscovered.

Signed-off-by: Andreas Fenkart <[email protected]>

diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 4ce3d7b..ef22d59 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);
+ target->rescan_entered = 0; /* rescan non-removable cards */
mmc_add_host(target);
}
static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);
--
2.0.1


2014-07-22 03:30:52

by Bing Zhao

[permalink] [raw]
Subject: RE: [PATCH v2 1/1] mwifiex: card reset: enable rescan of non-removable card

Hi Andreas,

> mmc_rescan will scan for non-removable cards only once, hence the card
> will not be rediscovered.
>
> Signed-off-by: Andreas Fenkart <[email protected]>

Acked-by: Bing Zhao <[email protected]>

Thanks,
Bing

>
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index 4ce3d7b..ef22d59 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);
> + target->rescan_entered = 0; /* rescan non-removable cards */
> mmc_add_host(target);
> }
> static DECLARE_WORK(card_reset_work, sdio_card_reset_worker);
> --
> 2.0.1


2014-07-21 07:56:49

by Andreas Fenkart

[permalink] [raw]
Subject: Re: [PATCH] mwifiex: card reset: enable rescan of non-removable card

Hi

2014-07-18 21:07 GMT+02:00 Bing Zhao <[email protected]>:
>> > @@ -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
>
>
>

2014-07-18 19:07:20

by Bing Zhao

[permalink] [raw]
Subject: RE: [PATCH] mwifiex: card reset: enable rescan of non-removable card

SGkgQW5kcmVhcywNCg0KPiA+IEBAIC0xOTMxLDYgKzE5MzEsNyBAQCBzdGF0aWMgdm9pZCBzZGlv
X2NhcmRfcmVzZXRfd29ya2VyKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yaykNCj4gPiAgCW1tY19y
ZW1vdmVfaG9zdCh0YXJnZXQpOw0KPiA+ICAJLyogMjBtcyBkZWxheSBpcyBiYXNlZCBvbiBleHBl
cmltZW50IHdpdGggc2RoY2kgY29udHJvbGxlciAqLw0KPiA+ICAJbWRlbGF5KDIwKTsNCj4gPiAr
CXJlc2V0X2hvc3QtPnJlc2Nhbl9lbnRlcmVkID0gMDsgLyogcmVzY2FuIG5vbi1yZW1vdmFibGUg
Y2FyZHMgKi8NCg0KWW91IG1lYW50IHRoaXM/DQoNCisJdGFyZ2V0LT5yZXNjYW5fZW50ZXJlZCA9
IDA7IC8qIHJlc2NhbiBub24tcmVtb3ZhYmxlIGNhcmRzICovDQoNClJlZ2FyZHMsDQpCaW5nDQoN
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