netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>, linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>,
	Mark Rutland <mark.rutland@arm.com>,
	Wolfgang Grandegger <wg@grandegger.com>
Subject: Re: [PATCH 3/4] net: can: ifi: Fix RX and TX ID mask
Date: Tue, 01 Mar 2016 22:23:28 +0100	[thread overview]
Message-ID: <56D60850.8080103@denx.de> (raw)
In-Reply-To: <56D5D635.1050005@hartkopp.net>

On 03/01/2016 06:49 PM, Oliver Hartkopp wrote:
> Hi Marek,

Hi Oliver,

> On 02/29/2016 08:59 PM, Marek Vasut wrote:
>> The RX and TX ID mask for CAN2.0 is 11 bits wide. This patch fixes
>> the incorrect mask, which caused the CAN IDs to miss the MSBit both
>> on receive and transmit.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Oliver Hartkopp <socketcan@hartkopp.net>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> ---
>>  drivers/net/can/ifi_canfd/ifi_canfd.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c
>> index 82a33bd..6704098 100644
>> --- a/drivers/net/can/ifi_canfd/ifi_canfd.c
>> +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
>> @@ -135,7 +135,7 @@
>>  
>>  #define IFI_CANFD_RXFIFO_ID			0x6c
>>  #define IFI_CANFD_RXFIFO_ID_ID_OFFSET		0
>> -#define IFI_CANFD_RXFIFO_ID_ID_STD_MASK		0x3ff
>> +#define IFI_CANFD_RXFIFO_ID_ID_STD_MASK		0x7ff
>>  #define IFI_CANFD_RXFIFO_ID_ID_XTD_MASK		0x1fffffff
> 
> You should use the CAN_SFF_MASK and CAN_EFF_MASK in your code instead of
> defining you private IFI_CANFD_RXFIFO_ID_ID_?TD_MASK definitions.
> 
> You won't have trapped into this problem then :-)

These are register bitfield definitions, so should I really ?

My OCD kicks in and tells me it'd be odd and inconsistent with the rest
of the bitfields, but if you prefer it that way, I'll just send an
updated patch.

>>  #define IFI_CANFD_RXFIFO_ID_IDE			BIT(29)
>>  
>> @@ -156,7 +156,7 @@
>>  
>>  #define IFI_CANFD_TXFIFO_ID			0xbc
>>  #define IFI_CANFD_TXFIFO_ID_ID_OFFSET		0
>> -#define IFI_CANFD_TXFIFO_ID_ID_STD_MASK		0x3ff
>> +#define IFI_CANFD_TXFIFO_ID_ID_STD_MASK		0x7ff
>>  #define IFI_CANFD_TXFIFO_ID_ID_XTD_MASK		0x1fffffff
> 
> dito.
> 
> 
> Regards,
> Oliver
> 
>>  #define IFI_CANFD_TXFIFO_ID_IDE			BIT(29)
>>  
>>


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-03-01 21:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 19:59 [PATCH 0/4] Synchronise IFI CANFD driver with real world Marek Vasut
2016-02-29 19:59 ` [PATCH 1/4] net: can: ifi: Fix clock generator configuration Marek Vasut
2016-02-29 19:59 ` [PATCH 2/4] net: can: ifi: Fix TX DLC configuration Marek Vasut
2016-03-01 18:11   ` Oliver Hartkopp
2016-03-01 21:27     ` Marek Vasut
2016-03-02  6:12       ` Oliver Hartkopp
2016-03-02 10:37         ` Marek Vasut
2016-02-29 19:59 ` [PATCH 3/4] net: can: ifi: Fix RX and TX ID mask Marek Vasut
2016-03-01 17:49   ` Oliver Hartkopp
2016-03-01 21:23     ` Marek Vasut [this message]
2016-03-02  6:10       ` Oliver Hartkopp
2016-03-02 10:28         ` Marek Vasut
2016-02-29 19:59 ` [PATCH 4/4] net: can: ifi: Add obscure bit swap for EFF frame IDs Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2016-03-02 10:42 [PATCH V2 0/4] Synchronise IFI CANFD driver with real world Marek Vasut
2016-03-02 10:42 ` [PATCH 3/4] net: can: ifi: Fix RX and TX ID mask Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D60850.8080103@denx.de \
    --to=marex@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).