Subject: Re: [PATCH net-2.6] can: Fix data length code handling in rx path

From: Oliver Hartkopp <[email-masked]>
Date: Sat, 12 Dec 2009 19:58:33 +0100

Wolfgang Grandegger wrote:
> Oliver Hartkopp wrote:
>> Wolfgang Grandegger wrote:

>>> Please send you patches inline next time please. For the bfin_can and
>>> the ems_usb driver your patch now masks the dlc with 0xf. Are you sure
>>> this is needed or even correct?
>> Yes. Both needed to be fixed.
>>
>> The bfin_can has an u16 value which is not reduced to 4-bits before.
> 
> The relevant bits are hardware specific.
> 

> 
> I just checked the bfin manual. The DLC value uses a 4 bit field and
> there is also written:
> 
>  "Any DLC value greater than 8 is treated the same as a value of 8."
> 
> That's exactly what this patch fixes. I didn't figure out though, if the
> masking is really required or if the higher bits are undefined (or "0").
> At least it does not harm.

The other 12 bits in the u16 dlc value of the blackfin CAN controller are
'shaded' == marked as 'reserved'. Therefore it's not really specified that
they are always '0' and the masking is indeed needed here.

Tnx for your sign-off.

Regards,
Oliver