linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] rt2x00: remove MCU requests for SoC platforms
@ 2010-04-01 21:14 Luis Correia
  2010-04-01 21:44 ` Gertjan van Wingerde
       [not found] ` <t2qefe7343f1004030447i9d6f290fvd7dd317c63b5b61@mail.gmail.com>
  0 siblings, 2 replies; 9+ messages in thread
From: Luis Correia @ 2010-04-01 21:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: rt2x00 Users List, Ivo van Doorn, John W. Linville

The ralink SoC platforms do not have an MCU.

Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
---

--- a/drivers/net/wireless/rt2x00/rt2800lib.c   2010-03-26
18:25:50.000000000 +0000
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c   2010-04-01
13:05:18.249747122 +0100
@@ -221,9 +221,9 @@
       u32 reg;

       /*
-        * SOC devices don't support MCU requests.
+        * some devices don't support MCU requests.
        */
-       if (rt2x00_is_soc(rt2x00dev))
+       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
               return;

       mutex_lock(&rt2x00dev->csr_mutex);
--- a/drivers/net/wireless/rt2x00/rt2800pci.c   2010-03-26
18:25:50.000000000 +0000
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c   2010-04-01
13:04:42.453621607 +0100
@@ -59,6 +59,12 @@
 {
       unsigned int i;
       u32 reg;
+
+       /*
+        * some devices don't support MCU requests.
+        */
+       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
+               return;

       for (i = 0; i < 200; i++) {
               rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
@@ -1098,10 +1104,12 @@
       __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);

       /*
-        * This device requires firmware.
+        * This device requires firmware and MCU access.
        */
-       if (!rt2x00_is_soc(rt2x00dev))
+       if (!rt2x00_is_soc(rt2x00dev)) {
               __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
+               __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags);
+       }
       __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
       __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
       if (!modparam_nohwcrypt)
--- a/drivers/net/wireless/rt2x00/rt2x00.h      2010-03-26
18:25:50.000000000 +0000
+++ b/drivers/net/wireless/rt2x00/rt2x00.h      2010-04-01
13:01:26.812694036 +0100
@@ -631,6 +631,7 @@
        * Driver requirements
        */
       DRIVER_REQUIRE_FIRMWARE,
+       DRIVER_REQUIRE_MCU,
       DRIVER_REQUIRE_BEACON_GUARD,
       DRIVER_REQUIRE_ATIM_QUEUE,
       DRIVER_REQUIRE_DMA,

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V3] rt2x00: remove MCU requests for SoC platforms
  2010-04-01 21:14 [PATCH V3] rt2x00: remove MCU requests for SoC platforms Luis Correia
@ 2010-04-01 21:44 ` Gertjan van Wingerde
  2010-04-01 21:52   ` Luis Correia
  2010-04-02  6:57   ` Ivo Van Doorn
       [not found] ` <t2qefe7343f1004030447i9d6f290fvd7dd317c63b5b61@mail.gmail.com>
  1 sibling, 2 replies; 9+ messages in thread
From: Gertjan van Wingerde @ 2010-04-01 21:44 UTC (permalink / raw)
  To: Luis Correia
  Cc: linux-wireless, rt2x00 Users List, Ivo van Doorn,
	John W. Linville

Luis,

On 04/01/10 23:14, Luis Correia wrote:
> The ralink SoC platforms do not have an MCU.
> 
> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>

I know Ivo already acked the v2 version of the patch, but isn't the
addition of a driver flag a bit overkill?

We have the test on whether the platform is SOC w.r.t. MCU requests
in 2 places, and both of them are in rt2800 code. I do not really see
a need to clutter the global rt2x00 space with a rt2800 specific flag,
which is only used in rt2800 code.

> ---
> 
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c   2010-03-26
> 18:25:50.000000000 +0000
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c   2010-04-01
> 13:05:18.249747122 +0100
> @@ -221,9 +221,9 @@
>        u32 reg;
> 
>        /*
> -        * SOC devices don't support MCU requests.
> +        * some devices don't support MCU requests.
>         */
> -       if (rt2x00_is_soc(rt2x00dev))
> +       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
>                return;
> 
>        mutex_lock(&rt2x00dev->csr_mutex);
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c   2010-03-26
> 18:25:50.000000000 +0000
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c   2010-04-01
> 13:04:42.453621607 +0100
> @@ -59,6 +59,12 @@
>  {
>        unsigned int i;
>        u32 reg;
> +
> +       /*
> +        * some devices don't support MCU requests.
> +        */
> +       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
> +               return;
> 
>        for (i = 0; i < 200; i++) {
>                rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);

So, the minimal patch would be simply this change to rt2800pci, and to have it
test for SoC (via rt2x00_is_soc).

> @@ -1098,10 +1104,12 @@
>        __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);
> 
>        /*
> -        * This device requires firmware.
> +        * This device requires firmware and MCU access.
>         */
> -       if (!rt2x00_is_soc(rt2x00dev))
> +       if (!rt2x00_is_soc(rt2x00dev)) {
>                __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
> +               __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags);
> +       }
>        __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
>        __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
>        if (!modparam_nohwcrypt)
> --- a/drivers/net/wireless/rt2x00/rt2x00.h      2010-03-26
> 18:25:50.000000000 +0000
> +++ b/drivers/net/wireless/rt2x00/rt2x00.h      2010-04-01
> 13:01:26.812694036 +0100
> @@ -631,6 +631,7 @@
>         * Driver requirements
>         */
>        DRIVER_REQUIRE_FIRMWARE,
> +       DRIVER_REQUIRE_MCU,
>        DRIVER_REQUIRE_BEACON_GUARD,
>        DRIVER_REQUIRE_ATIM_QUEUE,
>        DRIVER_REQUIRE_DMA,

If we choose to have the flag anyways:
>From a naming point of view, this name is aligned with the other flags.
However, from a usage point of view it would be better to have a flag
DRIVER_NO_MCU, so we don't have to have the negative tests above, and
have no tests at all that determine if MCU is allowed.

---
Gertjan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V3] rt2x00: remove MCU requests for SoC platforms
  2010-04-01 21:44 ` Gertjan van Wingerde
@ 2010-04-01 21:52   ` Luis Correia
  2010-04-02  6:57   ` Ivo Van Doorn
  1 sibling, 0 replies; 9+ messages in thread
From: Luis Correia @ 2010-04-01 21:52 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: Luis Correia, linux-wireless, rt2x00 Users List, Ivo van Doorn,
	John W. Linville

Hi Gertjan,

On Thu, Apr 1, 2010 at 22:44, Gertjan van Wingerde <gwingerde@gmail.com> wrote:
> Luis,
>
> On 04/01/10 23:14, Luis Correia wrote:
>> The ralink SoC platforms do not have an MCU.
>>
>> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
>
> I know Ivo already acked the v2 version of the patch, but isn't the
> addition of a driver flag a bit overkill?
>
> We have the test on whether the platform is SOC w.r.t. MCU requests
> in 2 places, and both of them are in rt2800 code. I do not really see
> a need to clutter the global rt2x00 space with a rt2800 specific flag,
> which is only used in rt2800 code.
>


Well, I confess that it was really his suggestion.

For me, if a chipset needs firmware then it implicitly says there is
an MCU involved.
And I had a previously unpublished patch that just tested for SoC and
prevented MCU stuff.

But the patch itself is mostly harmless, since it doesn't add any
functionality nor makes the driver misbehave more then it already is.

I can revise it if needed.


>> ---
>>
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c   2010-03-26
>> 18:25:50.000000000 +0000
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c   2010-04-01
>> 13:05:18.249747122 +0100
>> @@ -221,9 +221,9 @@
>>        u32 reg;
>>
>>        /*
>> -        * SOC devices don't support MCU requests.
>> +        * some devices don't support MCU requests.
>>         */
>> -       if (rt2x00_is_soc(rt2x00dev))
>> +       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
>>                return;
>>
>>        mutex_lock(&rt2x00dev->csr_mutex);
>> --- a/drivers/net/wireless/rt2x00/rt2800pci.c   2010-03-26
>> 18:25:50.000000000 +0000
>> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c   2010-04-01
>> 13:04:42.453621607 +0100
>> @@ -59,6 +59,12 @@
>>  {
>>        unsigned int i;
>>        u32 reg;
>> +
>> +       /*
>> +        * some devices don't support MCU requests.
>> +        */
>> +       if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
>> +               return;
>>
>>        for (i = 0; i < 200; i++) {
>>                rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
>
> So, the minimal patch would be simply this change to rt2800pci, and to have it
> test for SoC (via rt2x00_is_soc).
>
>> @@ -1098,10 +1104,12 @@
>>        __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);
>>
>>        /*
>> -        * This device requires firmware.
>> +        * This device requires firmware and MCU access.
>>         */
>> -       if (!rt2x00_is_soc(rt2x00dev))
>> +       if (!rt2x00_is_soc(rt2x00dev)) {
>>                __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
>> +               __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags);
>> +       }
>>        __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
>>        __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
>>        if (!modparam_nohwcrypt)
>> --- a/drivers/net/wireless/rt2x00/rt2x00.h      2010-03-26
>> 18:25:50.000000000 +0000
>> +++ b/drivers/net/wireless/rt2x00/rt2x00.h      2010-04-01
>> 13:01:26.812694036 +0100
>> @@ -631,6 +631,7 @@
>>         * Driver requirements
>>         */
>>        DRIVER_REQUIRE_FIRMWARE,
>> +       DRIVER_REQUIRE_MCU,
>>        DRIVER_REQUIRE_BEACON_GUARD,
>>        DRIVER_REQUIRE_ATIM_QUEUE,
>>        DRIVER_REQUIRE_DMA,
>
> If we choose to have the flag anyways:
> From a naming point of view, this name is aligned with the other flags.
> However, from a usage point of view it would be better to have a flag
> DRIVER_NO_MCU, so we don't have to have the negative tests above, and
> have no tests at all that determine if MCU is allowed.

Good point, lets wait on the decision above to make this change.

>
> ---
> Gertjan.

As you all know, i'm not really a programmer ;)

Luis Correia
rt2x00 project admin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V3] rt2x00: remove MCU requests for SoC platforms
  2010-04-01 21:44 ` Gertjan van Wingerde
  2010-04-01 21:52   ` Luis Correia
@ 2010-04-02  6:57   ` Ivo Van Doorn
  1 sibling, 0 replies; 9+ messages in thread
From: Ivo Van Doorn @ 2010-04-02  6:57 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: Luis Correia, linux-wireless, rt2x00 Users List, John W. Linville

Hi,

On Thu, Apr 1, 2010 at 11:44 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> Luis,
>
> On 04/01/10 23:14, Luis Correia wrote:
>> The ralink SoC platforms do not have an MCU.
>>
>> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
>
> I know Ivo already acked the v2 version of the patch, but isn't the
> addition of a driver flag a bit overkill?
>
> We have the test on whether the platform is SOC w.r.t. MCU requests
> in 2 places, and both of them are in rt2800 code. I do not really see
> a need to clutter the global rt2x00 space with a rt2800 specific flag,
> which is only used in rt2800 code.

I suggested the new flag to Luis. I wonder if a case exists where the driver
has no firmware but does need MCU access. I already considered it strange
when Ralink released a chip without firmware while other revisions did need it.
If this combination would be extremely unlikely, then we can indeed remove
the flag.

Ivo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH V4] rt2x00: remove MCU requests for SoC platforms
       [not found] ` <t2qefe7343f1004030447i9d6f290fvd7dd317c63b5b61@mail.gmail.com>
@ 2010-04-03 11:49   ` Luis Correia
  2010-04-03 11:55     ` Ivo van Doorn
  2010-04-03 13:43     ` Gertjan van Wingerde
  0 siblings, 2 replies; 9+ messages in thread
From: Luis Correia @ 2010-04-03 11:49 UTC (permalink / raw)
  To: linux-wireless
  Cc: Ivo Van Doorn, Gertjan van Wingerde, rt2x00 Users List,
	John W. Linville

The ralink SoC platforms do not have an MCU.

Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
---

Removed flag usage as per Gertjan suggestion.

diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c
b/drivers/net/wireless/rt2x00/rt2800pci.c
index ce7e88e..1df2d44 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct rt2x00_dev
*rt2x00dev, const u8 token)
       unsigned int i;
       u32 reg;

+       /*
+        * SOC devices don't support MCU requests.
+        */
+       if (rt2x00_is_soc(rt2x00dev))
+               return;
+
       for (i = 0; i < 200; i++) {
               rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH V4] rt2x00: remove MCU requests for SoC platforms
  2010-04-03 11:49   ` [PATCH V4] " Luis Correia
@ 2010-04-03 11:55     ` Ivo van Doorn
  2010-04-03 13:43     ` Gertjan van Wingerde
  1 sibling, 0 replies; 9+ messages in thread
From: Ivo van Doorn @ 2010-04-03 11:55 UTC (permalink / raw)
  To: Luis Correia
  Cc: linux-wireless, Gertjan van Wingerde, rt2x00 Users List,
	John W. Linville

On Saturday 03 April 2010, Luis Correia wrote:
> The ralink SoC platforms do not have an MCU.
> 
> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>

Acked-by: Ivo van Doorn <IvDoorn@gmail.com>

> ---
> 
> Removed flag usage as per Gertjan suggestion.
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c
> b/drivers/net/wireless/rt2x00/rt2800pci.c
> index ce7e88e..1df2d44 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct rt2x00_dev
> *rt2x00dev, const u8 token)
>        unsigned int i;
>        u32 reg;
> 
> +       /*
> +        * SOC devices don't support MCU requests.
> +        */
> +       if (rt2x00_is_soc(rt2x00dev))
> +               return;
> +
>        for (i = 0; i < 200; i++) {
>                rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V4] rt2x00: remove MCU requests for SoC platforms
  2010-04-03 11:49   ` [PATCH V4] " Luis Correia
  2010-04-03 11:55     ` Ivo van Doorn
@ 2010-04-03 13:43     ` Gertjan van Wingerde
  2010-04-03 14:08       ` Gertjan van Wingerde
  1 sibling, 1 reply; 9+ messages in thread
From: Gertjan van Wingerde @ 2010-04-03 13:43 UTC (permalink / raw)
  To: Luis Correia, John W. Linville
  Cc: linux-wireless, Ivo Van Doorn, rt2x00 Users List

On 04/03/10 13:49, Luis Correia wrote:
> The ralink SoC platforms do not have an MCU.
> 
> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> ---
> 
> Removed flag usage as per Gertjan suggestion.
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c
> b/drivers/net/wireless/rt2x00/rt2800pci.c
> index ce7e88e..1df2d44 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct rt2x00_dev
> *rt2x00dev, const u8 token)
>        unsigned int i;
>        u32 reg;
> 
> +       /*
> +        * SOC devices don't support MCU requests.
> +        */
> +       if (rt2x00_is_soc(rt2x00dev))
> +               return;
> +
>        for (i = 0; i < 200; i++) {
>                rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V4] rt2x00: remove MCU requests for SoC platforms
  2010-04-03 13:43     ` Gertjan van Wingerde
@ 2010-04-03 14:08       ` Gertjan van Wingerde
  2010-04-06 20:44         ` John W. Linville
  0 siblings, 1 reply; 9+ messages in thread
From: Gertjan van Wingerde @ 2010-04-03 14:08 UTC (permalink / raw)
  To: John W. Linville
  Cc: Luis Correia, linux-wireless, Ivo Van Doorn, rt2x00 Users List

On 04/03/10 15:43, Gertjan van Wingerde wrote:
> On 04/03/10 13:49, Luis Correia wrote:
>> The ralink SoC platforms do not have an MCU.
>>
>> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
> 
> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> 
>> ---
>>
>> Removed flag usage as per Gertjan suggestion.
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c
>> b/drivers/net/wireless/rt2x00/rt2800pci.c
>> index ce7e88e..1df2d44 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
>> @@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct rt2x00_dev
>> *rt2x00dev, const u8 token)
>>        unsigned int i;
>>        u32 reg;
>>
>> +       /*
>> +        * SOC devices don't support MCU requests.
>> +        */
>> +       if (rt2x00_is_soc(rt2x00dev))
>> +               return;
>> +
>>        for (i = 0; i < 200; i++) {
>>                rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
>>

John,

This patch seems to be word-wrapped and white-space damaged. I fixed it up
and applied it to my tree.

If you want you can pull from git://git.gwingerde.nl/rt2x00-next-2.6 to
get the fixed up patch.

---
Gertjan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V4] rt2x00: remove MCU requests for SoC platforms
  2010-04-03 14:08       ` Gertjan van Wingerde
@ 2010-04-06 20:44         ` John W. Linville
  0 siblings, 0 replies; 9+ messages in thread
From: John W. Linville @ 2010-04-06 20:44 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: Luis Correia, linux-wireless, Ivo Van Doorn, rt2x00 Users List

On Sat, Apr 03, 2010 at 04:08:44PM +0200, Gertjan van Wingerde wrote:
> On 04/03/10 15:43, Gertjan van Wingerde wrote:
> > On 04/03/10 13:49, Luis Correia wrote:
> >> The ralink SoC platforms do not have an MCU.
> >>
> >> Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
> > 
> > Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> This patch seems to be word-wrapped and white-space damaged. I fixed it up
> and applied it to my tree.
> 
> If you want you can pull from git://git.gwingerde.nl/rt2x00-next-2.6 to
> get the fixed up patch.

Thanks!

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-06 20:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 21:14 [PATCH V3] rt2x00: remove MCU requests for SoC platforms Luis Correia
2010-04-01 21:44 ` Gertjan van Wingerde
2010-04-01 21:52   ` Luis Correia
2010-04-02  6:57   ` Ivo Van Doorn
     [not found] ` <t2qefe7343f1004030447i9d6f290fvd7dd317c63b5b61@mail.gmail.com>
2010-04-03 11:49   ` [PATCH V4] " Luis Correia
2010-04-03 11:55     ` Ivo van Doorn
2010-04-03 13:43     ` Gertjan van Wingerde
2010-04-03 14:08       ` Gertjan van Wingerde
2010-04-06 20:44         ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).