Search Linux Wireless

Re: [PATCH 3/7] rtl818x: check for pci_map_single() success when initializing RX ring

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

 



Hello,
Honestly I'm not so expert in deep on this subject me too (and I would
like to learn more me too).
I have not a detailed example right now, but consider that this is
arch dependent thing, and we should think to wide plethora of archs..
even future ones...

AFAIK on x86 the dma error checking function will do nothing (this
arch uses nommu_dma_ops function pointers collection for implementing
those kind of DMA operations, and that structure does not even assigns
the dma error checking function pointer), but on other archs it may do
something.

Maybe in some cases for example a bounce-buffer may be needed (give a
look to /lib/swiotlb.c), and I suppose it can't be guaranteed it can
be successfully allocated.
Looking at the kernel source it seems that, for example, ARM64 may need this.

And, if I understood code right (and my flu does not help), it seems
that even on x64 arch, if our board is the "sta2x11" (that I doesn't
know what exactly is) then the dma operations are changed to the ones
in swiotlb.c ...

If someone more expert on that topic can give us better or more
complete explanation, I will appreciate it very much (in true I wrote
this mail with the purpose of trying to trigger some of them :) )

Andrea

On Tue, Feb 18, 2014 at 10:31 AM, Dan Carpenter
<dan.carpenter@xxxxxxxxxx> wrote:
> On Tue, Feb 18, 2014 at 02:10:42AM +0100, Andrea Merello wrote:
>> From: andrea merello <andrea.merello@xxxxxxxxx>
>>
>> During initialization a number of RX skbs are allocated and mapped
>> for DMA.
>> Currently if pci_map_single() fails, it will result in passing to the
>> HW a wrong DMA address (to write to!).
>>
>> This patch detects this condition, eventually it tries to get a more
>> luky skb, and if it finally fails to get things right, it makes the
>> driver not to initialize, avoiding at least dangerous DMAs.
>>
>
> In normal life then why would pci_map_single() fail even once?  (I am
> a newbie with this code so it is an honest question and not a rhetorical
> one).
>
> regards,
> dan carpenter
>
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux