2010-12-29 21:09:07

by Sergey Matyukevich

[permalink] [raw]
Subject: wl1271: how to use without runtime pm

Hello Luciano,

I use omap3evm board with wl1271 extension module. Current version of
wl1271 driver works fine on upstream kernel and (with minor
modifications resulting from older mac80211) on 2.6.32 kernel with
integrated SDIO runtime PM patches from Ohad Ben-Cohen.

In the current kernel runtime PM support is always enabled for
omap2plus boards. However this is not the case for the earlier kernels.
Besides, on some other boards there might be no gpio pin to control
power supply of wl1271 card.

So the question is: what is the proper use of wl1271 driver in the case
when wl1271 card is powered all the time ?

In a simple experiment I removed all pm_runtime functions from
wl1271_sdio.c and removed MMC_CAP_POWER_OFF_CARD flag from mmc slot
settings in board file. However I can't do ifdown/ifup procedure
properly:

root@omap3evm_minimal:~# ifconfig wlan0 down
root@omap3evm_minimal:~# ifconfig wlan0 up
[ 55.313201] wl1271: ERROR timeout waiting for the hardware to
complete initialization
[ 58.813964] wl1271: ERROR timeout waiting for the hardware to
complete initialization
[ 60.648651] wl1271: ERROR sdio read failed (-110)
[ 60.653686] wl1271: ERROR sdio write failed (-110)
[ 62.057067] wl1271: ERROR sdio read failed (-110)
[ 62.062072] wl1271: ERROR chip id doesn't match after firmware boot
[ 62.068786] wl1271: ERROR firmware boot failed despite 3 retries
ifconfig: SIOCSIFFLAGS: Input/output error

It looks like init procedure of wl1271 card can not be done twice
without powering off wl1271 card.


Thanks,
Sergey


2010-12-30 22:10:14

by Sergey Matyukevich

[permalink] [raw]
Subject: Re: wl1271: how to use without runtime pm

On Wed, 29 Dec 2010 23:22:05 +0200
Ohad Ben-Cohen <[email protected]> wrote:

> On Wed, Dec 29, 2010 at 11:07 PM, Sergey Matyukevich
> <[email protected]> wrote:
> > So the question is: what is the proper use of wl1271 driver in the
> > case when  wl1271 card is powered all the time ?
>
> The wl1271 driver assumes it can control the power of the card.
>
> If your card's power is always on, you will not be able to toggle the
> interface down and up (as you have experienced).
>
> It might be possible to change the driver around this "limitation",
> but I'm not sure anyone has ever really tried.

A simple solution which comes to mind would be to perform some kind of
'complete soft reset procedure' for wl1271 card in the beginning of the
function 'wl1271_op_add_interface'. But I guess such a feature is not
available for this card. Qtherwise it would be already implemented by
Luciano and his colleagues.

Thanks,
Sergey

2010-12-29 21:22:26

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: wl1271: how to use without runtime pm

On Wed, Dec 29, 2010 at 11:07 PM, Sergey Matyukevich <[email protected]> wrote:
> So the question is: what is the proper use of wl1271 driver in the case
> when ?wl1271 card is powered all the time ?

The wl1271 driver assumes it can control the power of the card.

If your card's power is always on, you will not be able to toggle the
interface down and up (as you have experienced).

It might be possible to change the driver around this "limitation",
but I'm not sure anyone has ever really tried.

2010-12-31 08:00:21

by Luciano Coelho

[permalink] [raw]
Subject: Re: wl1271: how to use without runtime pm

On Fri, 2010-12-31 at 01:08 +0300, ext Sergey Matyukevich wrote:
> On Wed, 29 Dec 2010 23:22:05 +0200
> Ohad Ben-Cohen <[email protected]> wrote:
>
> > On Wed, Dec 29, 2010 at 11:07 PM, Sergey Matyukevich
> > <[email protected]> wrote:
> > > So the question is: what is the proper use of wl1271 driver in the
> > > case when wl1271 card is powered all the time ?
> >
> > The wl1271 driver assumes it can control the power of the card.
> >
> > If your card's power is always on, you will not be able to toggle the
> > interface down and up (as you have experienced).
> >
> > It might be possible to change the driver around this "limitation",
> > but I'm not sure anyone has ever really tried.
>
> A simple solution which comes to mind would be to perform some kind of
> 'complete soft reset procedure' for wl1271 card in the beginning of the
> function 'wl1271_op_add_interface'. But I guess such a feature is not
> available for this card. Qtherwise it would be already implemented by
> Luciano and his colleagues.

I don't know about any reset functionality in the wl1271. Maybe the
hardware recovery mechanism could be used, but I'm not sure.

In any case, the reason why we power the card on only when the interface
is brought up is because of power consumption. If the interface is
down, there's no reason to keep the chip powered on and consume
unnecessary power.

If the case of cards that really cannot power off the wl1271 chip is
really unavoidable, we could think about a solution to solve the
problem.

PS: Note that this is the last day when this email address
([email protected]) is valid, so please keep the linux-wireless
mailing list in CC so I can still read the messages. ;)


--
Cheers,
Luca.


2012-02-15 10:00:08

by Santosh Shukla

[permalink] [raw]
Subject: Re: wl1271: how to use without runtime pm

Is there any resolution for this mail thread? I too came across this problem. My
H/W has WLAN_EN bit high( a h/w Switch) and Physically can not be configured for
RUN-TIME feature. So, I will have to run wl128x compat module without RUN-TIME
support.

Could any one suggest workaround for same so that I don't see SDIO WR/RD error
for sequence of wireless node down , followed by up (referred in this mail
thread).

Appreciate your opinion.