* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
[not found] ` <AANLkTinnCOEXF835yhNeJDfBdKjx_dss6TFeUmjL-Yk2@mail.gmail.com>
@ 2011-02-15 22:16 ` Jiri Slaby
2011-02-15 22:18 ` Jiri Slaby
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2011-02-15 22:16 UTC (permalink / raw)
To: Nikolay Ledovskikh
Cc: John W. Linville, linux-wireless, lrodriguez, mickflemm, me,
Ralf Baechle, linux-mips
On 02/15/2011 10:39 PM, Nikolay Ledovskikh wrote:
>> Maybe the address you got from the platform side was already ored by
>> KSEG1...
>
> I took a look at openwrt atheros platform code and suppose you are right.
> So what we should do for now? Add pointer cast (void __iomem *)?
> Because ioremap_nocache doesn't work as expected. I think it's better
> to rewrote the openwrt
> code, but not now.
So I've found:
http://www.google.com/codesearch/p?hl=en#sayuPQDVf4c/trunk/openwrt/target/linux/atheros/patches-2.6.32/100-board.patch&q=ar231x-wmac&sa=N&cd=4&ct=rc
There, the res->start may be either of the following:
AR531X_WLAN0 .. 0x18000000
AR531X_WLAN1 .. 0x18500000
AR2315_WLAN0 .. 0xB0000000
I suppose you have the 3rd otherwise it should die without ORing KSEG1?
Or maybe MIPS guys will correct me? (The problem is that ioremap of one
of the addresses above kills the box. If Nikolaj removes the ioremap and
uses the address directly, it works for him. I'm saying it will die for
the first 2 addresses if we remove ioremap completely -- from what I
found in MIPS specs.)
I _think_ there should be (instead of ioremap):
sc->iobase = (void __iomem *)KSEG1ADDR(res->start);
Then we do readl(sc->iobase) et al. in ath5k.
thanks,
--
js
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
2011-02-15 22:16 ` [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips Jiri Slaby
@ 2011-02-15 22:18 ` Jiri Slaby
2011-02-16 1:12 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2011-02-15 22:18 UTC (permalink / raw)
To: Nikolay Ledovskikh
Cc: John W. Linville, linux-wireless, lrodriguez, mickflemm, me,
Ralf Baechle, linux-mips
On 02/15/2011 11:16 PM, Jiri Slaby wrote:
> On 02/15/2011 10:39 PM, Nikolay Ledovskikh wrote:
>>> Maybe the address you got from the platform side was already ored by
>>> KSEG1...
>>
>> I took a look at openwrt atheros platform code and suppose you are right.
>> So what we should do for now? Add pointer cast (void __iomem *)?
>> Because ioremap_nocache doesn't work as expected. I think it's better
>> to rewrote the openwrt
>> code, but not now.
>
> So I've found:
> http://www.google.com/codesearch/p?hl=en#sayuPQDVf4c/trunk/openwrt/target/linux/atheros/patches-2.6.32/100-board.patch&q=ar231x-wmac&sa=N&cd=4&ct=rc
>
> There, the res->start may be either of the following:
> AR531X_WLAN0 .. 0x18000000
> AR531X_WLAN1 .. 0x18500000
> AR2315_WLAN0 .. 0xB0000000
Or maybe this should be 0x10000000 in openwrt in the first place? Then
ioremap should do the right thing, right?
> I suppose you have the 3rd otherwise it should die without ORing KSEG1?
>
> Or maybe MIPS guys will correct me? (The problem is that ioremap of one
> of the addresses above kills the box. If Nikolaj removes the ioremap and
> uses the address directly, it works for him. I'm saying it will die for
> the first 2 addresses if we remove ioremap completely -- from what I
> found in MIPS specs.)
>
> I _think_ there should be (instead of ioremap):
> sc->iobase = (void __iomem *)KSEG1ADDR(res->start);
>
> Then we do readl(sc->iobase) et al. in ath5k.
>
> thanks,
--
js
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
2011-02-15 22:18 ` Jiri Slaby
@ 2011-02-16 1:12 ` Ralf Baechle
2011-02-16 10:26 ` Nikolay Ledovskikh
0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2011-02-16 1:12 UTC (permalink / raw)
To: Jiri Slaby
Cc: Nikolay Ledovskikh, John W. Linville, linux-wireless, lrodriguez,
mickflemm, me, linux-mips
On Tue, Feb 15, 2011 at 11:18:51PM +0100, Jiri Slaby wrote:
> > There, the res->start may be either of the following:
> > AR531X_WLAN0 .. 0x18000000
> > AR531X_WLAN1 .. 0x18500000
>
>
> > AR2315_WLAN0 .. 0xB0000000
>
> Or maybe this should be 0x10000000 in openwrt in the first place? Then
> ioremap should do the right thing, right?
Yes - 0xb0000000 looks like it's a virtual address which is wrong.
Rule #1: Put physical addresses in headers and code only.
Rule #2: If using one of the KSEG address and address conversion macros,
get rid of them, use ioremap. The KSEG macros are for use by arch core
code only; for use anywhere else I reject patches these days.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
2011-02-16 1:12 ` Ralf Baechle
@ 2011-02-16 10:26 ` Nikolay Ledovskikh
0 siblings, 0 replies; 4+ messages in thread
From: Nikolay Ledovskikh @ 2011-02-16 10:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: Jiri Slaby, John W. Linville, linux-wireless, lrodriguez,
mickflemm, me, linux-mips
So, the problems are in openwrt platform patches that should be rewriten:
1. Changes needed to avoid using code like "mem=res->start" without ioremap.
2. Changes needed to avoid using NULL in first argument of
dma_alloc_coherent and others.
Without these changes ahb patch won't get into the kernel and we'll be
lack of wisoc devices support?
Is there any chance for the patch to get into the kernel and what
should be done for it?
(PS: Sorry for my english.)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-16 10:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20110215220929.1cc6e9d4.nledovskikh@gmail.com>
[not found] ` <4D5AD6A6.8090505@gmail.com>
[not found] ` <AANLkTiks9rG2CzM2LabNerK3zgJ+R+weytQgvXxDbNe7@mail.gmail.com>
[not found] ` <4D5AE52B.80002@gmail.com>
[not found] ` <AANLkTinnCOEXF835yhNeJDfBdKjx_dss6TFeUmjL-Yk2@mail.gmail.com>
2011-02-15 22:16 ` [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips Jiri Slaby
2011-02-15 22:18 ` Jiri Slaby
2011-02-16 1:12 ` Ralf Baechle
2011-02-16 10:26 ` Nikolay Ledovskikh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox