Search Linux Wireless

Re: [PATCH 1/2] b43: read correct register on bcma bus.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



W dniu 23 lipca 2011 16:00 użytkownik Rafał Miłecki <zajec5@xxxxxxxxx> napisał:
> 2011/7/23 Hauke Mehrtens <hauke@xxxxxxxxxx>:
>> This causes an databus error on a Broadcom SoC using bcma.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
>> ---
>>  drivers/net/wireless/b43/dma.c |   20 +++++++++++++++++---
>>  1 files changed, 17 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
>> index 0953ce1..646d6ae 100644
>> --- a/drivers/net/wireless/b43/dma.c
>> +++ b/drivers/net/wireless/b43/dma.c
>> @@ -795,9 +795,23 @@ static u64 supported_dma_mask(struct b43_wldev *dev)
>>        u32 tmp;
>>        u16 mmio_base;
>>
>> -       tmp = b43_read32(dev, SSB_TMSHIGH);
>> -       if (tmp & SSB_TMSHIGH_DMA64)
>> -               return DMA_BIT_MASK(64);
>> +       switch (dev->dev->bus_type) {
>> +#ifdef CONFIG_B43_BCMA
>> +       case B43_BUS_BCMA:
>> +               tmp = bcma_aread32(dev->dev->bdev, BCMA_IOST);
>> +               if (tmp & BCMA_IOST_DMA64)
>> +                       return DMA_BIT_MASK(64);
>> +               break;
>> +#endif
>> +#ifdef CONFIG_B43_SSB
>> +       case B43_BUS_SSB:
>> +               tmp = ssb_read32(dev->dev->sdev, SSB_TMSHIGH);
>> +               if (tmp & SSB_TMSHIGH_DMA64)
>> +                       return DMA_BIT_MASK(64);
>> +               break;
>> +#endif
>> +       }
>> +
>>        mmio_base = b43_dmacontroller_base(0, 0);
>>        b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK);
>>        tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL);
>> --
>> 1.7.4.1
>
> Ack. Code was half-correctly using b43_read32 for SSB_TMSHIGH and
> that's how I missed it. Reading non-existent register on PC resulted
> in 0xFFFFFFFF, but not bus error.
>
> Thanks Hauke.

There is not support for SoC in 3.1-rc1, but reading SSB_TMSHIGH on
PC/laptop still can be dangerous, can't it? It didn't blow my machine,
but don't know what will happen on other, including notebooks.

Should we take this patch as fix for 3.1?

-- 
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux