2011-05-10 23:33:15

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 1/2] ssb: move ssb_commit_settings and export it

Commiting settings is possible on devices without PCI core (but with CC
core). Export it for usage in drivers supporting other cores.

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/ssb/driver_pcicore.c | 26 --------------------------
drivers/ssb/main.c | 25 +++++++++++++++++++++++++
include/linux/ssb/ssb.h | 1 +
3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 8fde122..82feb34 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -21,8 +21,6 @@ static u16 ssb_pcie_mdio_read(struct ssb_pcicore *pc, u8 device, u8 address);
static void ssb_pcie_mdio_write(struct ssb_pcicore *pc, u8 device,
u8 address, u16 data);

-static void ssb_commit_settings(struct ssb_bus *bus);
-
static inline
u32 pcicore_read32(struct ssb_pcicore *pc, u16 offset)
{
@@ -659,30 +657,6 @@ static void ssb_pcie_mdio_write(struct ssb_pcicore *pc, u8 device,
pcicore_write32(pc, mdio_control, 0);
}

-static void ssb_broadcast_value(struct ssb_device *dev,
- u32 address, u32 data)
-{
- /* This is used for both, PCI and ChipCommon core, so be careful. */
- BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
- BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
-
- ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
- ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
- ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
- ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
-}
-
-static void ssb_commit_settings(struct ssb_bus *bus)
-{
- struct ssb_device *dev;
-
- dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
- if (WARN_ON(!dev))
- return;
- /* This forces an update of the cached registers. */
- ssb_broadcast_value(dev, 0xFD8, 0);
-}
-
int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
struct ssb_device *dev)
{
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index ad3da93..ee2937c 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1329,6 +1329,31 @@ error:
}
EXPORT_SYMBOL(ssb_bus_powerup);

+static void ssb_broadcast_value(struct ssb_device *dev,
+ u32 address, u32 data)
+{
+ /* This is used for both, PCI and ChipCommon core, so be careful. */
+ BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
+ BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
+
+ ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
+ ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
+ ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
+ ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
+}
+
+void ssb_commit_settings(struct ssb_bus *bus)
+{
+ struct ssb_device *dev;
+
+ dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
+ if (WARN_ON(!dev))
+ return;
+ /* This forces an update of the cached registers. */
+ ssb_broadcast_value(dev, 0xFD8, 0);
+}
+EXPORT_SYMBOL(ssb_commit_settings);
+
u32 ssb_admatch_base(u32 adm)
{
u32 base = 0;
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 7e99b34..f017b89 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -518,6 +518,7 @@ extern int ssb_bus_may_powerdown(struct ssb_bus *bus);
* Otherwise static always-on powercontrol will be used. */
extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl);

+extern void ssb_commit_settings(struct ssb_bus *bus);

/* Various helper functions */
extern u32 ssb_admatch_base(u32 adm);
--
1.7.3.4



2011-05-10 23:42:10

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
> Documented in:<[email protected]>

This reference is not correct.

Larry

>
> Signed-off-by: Rafał Miłecki<[email protected]>
> ---
> drivers/net/wireless/b43/main.c | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index fd8bd98..88bfd29 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -4213,7 +4213,18 @@ static void b43_bluetooth_coext_disable(struct b43_wldev *dev)
>
> static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev)
> {
> - /* TODO: implement 80211 core workaround here */
> + struct ssb_bus *bus = dev->dev->bus;
> + u32 tmp;
> +
> + if ((bus->chip_id == 0x4311&& bus->chip_rev == 2) ||
> + (bus->chip_id == 0x4312)) {
> + tmp = ssb_read32(dev->dev, SSB_IMCFGLO);
> + tmp&= ~SSB_IMCFGLO_REQTO;
> + tmp&= ~SSB_IMCFGLO_SERTO;
> + tmp |= 0x3;
> + ssb_write32(dev->dev, SSB_IMCFGLO, tmp);
> + ssb_commit_settings(bus);
> + }
> }
>
> static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)


2011-05-11 16:44:07

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

W dniu 11 maja 2011 02:12 użytkownik Larry Finger
<[email protected]> napisał:
> On 05/10/2011 06:56 PM, Rafał Miłecki wrote:
>>
>> W dniu 11 maja 2011 01:42 użytkownik Larry Finger
>> <[email protected]>  napisał:
>>>
>>> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
>>>>
>>>> Documented in:<[email protected]>
>>>
>>> This reference is not correct.
>>
>> Ouch, GMail seems to lie to me. Any change you can give me real message id
>> of:
>> http://www.mail-archive.com/[email protected]/msg00049.html
>
> This one is good.

Sorry, do you mean <[email protected]> is OK? Or should I
use link I posted instead of message ID? Or do you know how to get
message ID from the link above?

--
Rafał

2011-05-11 15:54:47

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

On 05/11/2011 07:31 AM, Michael Büsch wrote:
> On Wed, 2011-05-11 at 07:17 -0500, Larry Finger wrote:
>> On 05/11/2011 02:35 AM, Rafał Miłecki wrote:
>>> W dniu 11 maja 2011 02:12 użytkownik Larry Finger
>>> <[email protected]> napisał:
>>>> On 05/10/2011 06:56 PM, Rafał Miłecki wrote:
>>>>>
>>>>> W dniu 11 maja 2011 01:42 użytkownik Larry Finger
>>>>> <[email protected]> napisał:
>>>>>>
>>>>>> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
>>>>>>>
>>>>>>> Documented in:<[email protected]>
>>>>>>
>>>>>> This reference is not correct.
>>>>>
>>>>> Ouch, GMail seems to lie to me. Any change you can give me real message id
>>>>> of:
>>>>> http://www.mail-archive.com/[email protected]/msg00049.html
>>>>
>>>> This one is good.
>>>
>>> Sorry, do you mean<[email protected]> is OK? Or should I
>>> use link I posted instead of message ID? Or do you know how to get
>>> message ID from the link above?
>>>
>>
>> Use the link
>> "http://www.mail-archive.com/[email protected]/msg00049.html".
>> <[email protected]> just points to a non-existent email address on my
>> domain. I don't know how to get a message ID.
>
> It's just an email header added by your MUA.
> For example: Message-ID:<[email protected]>
>
> The advantage of this is that links change and vanish. However, message
> IDs don't. The message ID uniquely identifies a message, regardless of
> where it's stored. So even if the mail archive moves to another URL,
> it's still possible to find the actual mail by the ID.

Ahh. Yes, that Message ID is correct. I just rechecked the header in the mail
that I sent. Sorry for the confusion and noise.

Larry

2011-05-10 23:56:04

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

W dniu 11 maja 2011 01:42 użytkownik Larry Finger
<[email protected]> napisał:
> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
>>
>> Documented in:<[email protected]>
>
> This reference is not correct.

Ouch, GMail seems to lie to me. Any change you can give me real message id of:
http://www.mail-archive.com/[email protected]/msg00049.html
?

--
Rafał

2011-05-10 23:33:23

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 2/2] b43: implement timeouts workaround

Documented in: <[email protected]>

Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/main.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index fd8bd98..88bfd29 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4213,7 +4213,18 @@ static void b43_bluetooth_coext_disable(struct b43_wldev *dev)

static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev)
{
- /* TODO: implement 80211 core workaround here */
+ struct ssb_bus *bus = dev->dev->bus;
+ u32 tmp;
+
+ if ((bus->chip_id == 0x4311 && bus->chip_rev == 2) ||
+ (bus->chip_id == 0x4312)) {
+ tmp = ssb_read32(dev->dev, SSB_IMCFGLO);
+ tmp &= ~SSB_IMCFGLO_REQTO;
+ tmp &= ~SSB_IMCFGLO_SERTO;
+ tmp |= 0x3;
+ ssb_write32(dev->dev, SSB_IMCFGLO, tmp);
+ ssb_commit_settings(bus);
+ }
}

static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)
--
1.7.3.4


2011-05-11 16:06:44

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

On 05/11/2011 02:35 AM, Rafał Miłecki wrote:
> W dniu 11 maja 2011 02:12 użytkownik Larry Finger
> <[email protected]> napisał:
>> On 05/10/2011 06:56 PM, Rafał Miłecki wrote:
>>>
>>> W dniu 11 maja 2011 01:42 użytkownik Larry Finger
>>> <[email protected]> napisał:
>>>>
>>>> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
>>>>>
>>>>> Documented in:<[email protected]>
>>>>
>>>> This reference is not correct.
>>>
>>> Ouch, GMail seems to lie to me. Any change you can give me real message id
>>> of:
>>> http://www.mail-archive.com/[email protected]/msg00049.html
>>
>> This one is good.
>
> Sorry, do you mean<[email protected]> is OK? Or should I
> use link I posted instead of message ID? Or do you know how to get
> message ID from the link above?
>

Use the link
"http://www.mail-archive.com/[email protected]/msg00049.html".
<[email protected]> just points to a non-existent email address on my
domain. I don't know how to get a message ID.

Larry


2011-05-11 00:12:21

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

On 05/10/2011 06:56 PM, Rafał Miłecki wrote:
> W dniu 11 maja 2011 01:42 użytkownik Larry Finger
> <[email protected]> napisał:
>> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
>>>
>>> Documented in:<[email protected]>
>>
>> This reference is not correct.
>
> Ouch, GMail seems to lie to me. Any change you can give me real message id of:
> http://www.mail-archive.com/[email protected]/msg00049.html

This one is good.

Larry

2011-05-11 16:22:52

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 2/2] b43: implement timeouts workaround

On Wed, 2011-05-11 at 07:17 -0500, Larry Finger wrote:
> On 05/11/2011 02:35 AM, Rafał Miłecki wrote:
> > W dniu 11 maja 2011 02:12 użytkownik Larry Finger
> > <[email protected]> napisał:
> >> On 05/10/2011 06:56 PM, Rafał Miłecki wrote:
> >>>
> >>> W dniu 11 maja 2011 01:42 użytkownik Larry Finger
> >>> <[email protected]> napisał:
> >>>>
> >>>> On 05/10/2011 07:10 PM, Rafał Miłecki wrote:
> >>>>>
> >>>>> Documented in:<[email protected]>
> >>>>
> >>>> This reference is not correct.
> >>>
> >>> Ouch, GMail seems to lie to me. Any change you can give me real message id
> >>> of:
> >>> http://www.mail-archive.com/[email protected]/msg00049.html
> >>
> >> This one is good.
> >
> > Sorry, do you mean<[email protected]> is OK? Or should I
> > use link I posted instead of message ID? Or do you know how to get
> > message ID from the link above?
> >
>
> Use the link
> "http://www.mail-archive.com/[email protected]/msg00049.html".
> <[email protected]> just points to a non-existent email address on my
> domain. I don't know how to get a message ID.

It's just an email header added by your MUA.
For example: Message-ID: <[email protected]>

The advantage of this is that links change and vanish. However, message
IDs don't. The message ID uniquely identifies a message, regardless of
where it's stored. So even if the mail archive moves to another URL,
it's still possible to find the actual mail by the ID.

--
Greetings Michael.