lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Mar 2017 20:33:15 +0100
From:   Oliver Hartkopp <socketcan@...tkopp.net>
To:     Marc Kleine-Budde <mkl@...gutronix.de>,
        Wenyou Yang <wenyou.yang@...el.com>,
        Wolfgang Grandegger <wg@...ndegger.com>
Cc:     Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Quentin Schulz <quentin.schulz@...e-electrons.com>,
        Wenyou Yang <wenyou.yang@...rochip.com>,
        Nicolas Ferre <nicolas.ferre@...el.com>,
        linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] can: m_can: enable transmission of FD frame on latest
 version

Hi Marc,

On 03/06/2017 11:53 AM, Marc Kleine-Budde wrote:
> On 03/06/2017 03:21 AM, Wenyou Yang wrote:
>> Enables the transmission of CAN FD frames on M_CAN IP core >= v3.1.x
>> and with the bit rate switching.
>>
>> Tested on M_CAN IP 3.1.0 (CREL = 0x31040730) of SAMA5D2 SoC.
>
> Does this patch work still with the old version of the silicon?

The bits that were added in the TX FIFO element are 'reserved' in the 
old silicon - so it should not harm.

This code enables

  if (priv->can.ctrlmode & CAN_CTRLMODE_FD)
-	cccr |= CCCR_CME_CANFD_BRS << CCCR_CME_SHIFT;
+	cccr |= (CCCR_CME_CANFD_BRS | CCCR_CME_CANFD) << CCCR_CME_SHIFT;

the CAN FD support in the new silicon.

This register is set for the old silicon EVERY time a CAN frame is sent.
So this change should not harm the old silicon either.

In fact I was told that the v3.0.x IP core is rather seldom in the wild.
Although I don't have a v3.0.x to test it should work from the 
documentation side of view.

Reviewed-by: Oliver Hartkopp <socketcan@...tkopp.net>

If we would like to make it really better, the code in 
m_can_start_xmit() should only fiddle with the M_CAN_CCCR register when 
working with the v3.0.x silicon.

In fact I would suggest to use the

	if (m_can_read_core_rev(priv) < M_CAN_COREREL_3_1_0)

method from

	http://marc.info/?l=linux-can&m=148716783119090&w=2

to split the code in m_can_start_xmit() accordingly.

@Wenyou Yang: Can you please send a v3 which splits the tx function?

Regards,
Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ