2013-08-03 15:28:27

by Hauke Mehrtens

[permalink] [raw]
Subject: b43: DMA errors with BCM4331 on BCM4706

Hi,

I am trying to get the BCM4331 working on the BCM4706 (Mips SoC), on a
x86 this is working. Currently the bcma bus gets initialized without any
problems and b43 starts and send beacons like excepted.

When a client wants to connect to the Access point the whole system
breaks. On the DMA core 1, which is used to send the packages I get a
Fatal DMA error:
b43-phy0 ERROR: Fatal DMA error: 0x00000000, 0x00000800, 0x00000000,
0x00000000, 0x00000000, 0x00000000

After this error the driver tries to recover, by reseting the DMA
controller, but that fails:
b43-phy0: Controller RESET (DMA error) ...
bcma: bus1: Timeout waiting for register 0x0804!
Data bus error, epc == 801ac888, ra == 801ac890

This is descried in [0] as PCIData (PD)

PCI Data Error
This field is set to 1 when a PCI bus error occurs while transferring
data to or from host memory. The PCI status register (see “Status
Register (Status, offset 0x06)” on page 184) can be read to determine
the cause of the error. This field is cleared to 0 by resetting the
channel that caused the error.

I can not find the description of the PCI status register.

I used wireshark to see what actually happens and the device send out
beacons and answers to probe requests without problems. I see the
Authentication, Association Request and Association Response frames and
then only Beacon frames and probe responses. When I do not try to
connect to this access Point there is no problem and the device stays up
for a long time, the problem is caused by the frames send or received.

I think this is a problem in the DMA controller or in the PCIe host
controller, sadly I do not have a BCM4706 SoC with a pluggable PCIe slot
to verify which part causes the problems (the card, or the PCIe controller).

Does anybody have any thought on this topic?

Hauke

[0]: http://www.broadcom.com/collateral/pg/440X-PG02-R.pdf


2013-08-03 17:48:40

by Larry Finger

[permalink] [raw]
Subject: Re: b43: DMA errors with BCM4331 on BCM4706

On 08/03/2013 11:55 AM, Michael Büsch wrote:
> On Sat, 03 Aug 2013 17:28:14 +0200
> Hauke Mehrtens <[email protected]> wrote:
>
>> I used wireshark to see what actually happens and the device send out
>> beacons and answers to probe requests without problems. I see the
>> Authentication, Association Request and Association Response frames and
>
> That suggests DMA works for some packets and then fails?
>
>> Does anybody have any thought on this topic?
>
> You should print out more of the DMA values.

Could it possibly work with short packets, but fail on longer ones?

Larry



2013-08-06 07:58:49

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: b43: DMA errors with BCM4331 on BCM4706

On 08/03/2013 07:48 PM, Larry Finger wrote:
> On 08/03/2013 11:55 AM, Michael Büsch wrote:
>> On Sat, 03 Aug 2013 17:28:14 +0200
>> Hauke Mehrtens <[email protected]> wrote:
>>
>>> I used wireshark to see what actually happens and the device send out
>>> beacons and answers to probe requests without problems. I see the
>>> Authentication, Association Request and Association Response frames and
>>
>> That suggests DMA works for some packets and then fails?
>>
>>> Does anybody have any thought on this topic?
>>
>> You should print out more of the DMA values.
>
> Could it possibly work with short packets, but fail on longer ones?
>
> Larry
Hi,

Thanks for the hints, in fact it was the size and I got my BCM4331 in
the Access Point connected to a BCM4706 working. The problem was that
the the PCIe controller used a PCIe max request size of 128, we try to
change it in driver_pci_host.c, see "MRRS 512", but that does not get
applied to the hardware, when reading it back it is not set, the Max
payload size is changed. The BCM4331 uses a max request size of 512 by
default and that causes problems. I solved the problem by setting the
max request size to 128 for the BCM4331, pcie_set_readrq(bus->host_pci,
128) and then it worked.

The patch is currently just in OpenWrt [0], I will send the patches to
the mailing list in the next days.

@Rafał If you haven't found a BCM4331, now you can use the one in your
Access Point. ;-)

Hauke

[0]: https://dev.openwrt.org/changeset/37709

2013-08-03 16:55:24

by Michael Büsch

[permalink] [raw]
Subject: Re: b43: DMA errors with BCM4331 on BCM4706

On Sat, 03 Aug 2013 17:28:14 +0200
Hauke Mehrtens <[email protected]> wrote:

> I used wireshark to see what actually happens and the device send out
> beacons and answers to probe requests without problems. I see the
> Authentication, Association Request and Association Response frames and

That suggests DMA works for some packets and then fails?

> Does anybody have any thought on this topic?

You should print out more of the DMA values.

--
Michael


Attachments:
signature.asc (836.00 B)