Skip to content
Snippets Groups Projects
  1. Apr 24, 2014
    • Thomas Gleixner's avatar
      can: c_can: Disable rx split as workaround · 2b9aecdc
      Thomas Gleixner authored
      
      The RX buffer split causes packet loss in the hardware:
      
      What happens is:
      
      RX Packet 1 --> message buffer 1 (newdat bit is not cleared)
      RX Packet 2 --> message buffer 2 (newdat bit is not cleared)
      RX Packet 3 --> message buffer 3 (newdat bit is not cleared)
      RX Packet 4 --> message buffer 4 (newdat bit is not cleared)
      RX Packet 5 --> message buffer 5 (newdat bit is not cleared)
      RX Packet 6 --> message buffer 6 (newdat bit is not cleared)
      RX Packet 7 --> message buffer 7 (newdat bit is not cleared)
      RX Packet 8 --> message buffer 8 (newdat bit is not cleared)
      
      Clear newdat bit in message buffer 1
      Clear newdat bit in message buffer 2
      Clear newdat bit in message buffer 3
      Clear newdat bit in message buffer 4
      Clear newdat bit in message buffer 5
      Clear newdat bit in message buffer 6
      Clear newdat bit in message buffer 7
      Clear newdat bit in message buffer 8
      
      Now if during that clearing of newdat bits, a new message comes in,
      the HW gets confused and drops it.
      
      It does not matter how many of them you clear. I put a delay between
      clear of buffer 1 and buffer 2 which was long enough that the message
      should have been queued either in buffer 1 or buffer 9. But it did not
      show up anywhere. The next message ended up in buffer 1. So the
      hardware lost a packet of course without telling it via one of the
      error handlers.
      
      That does not happen on all clear newdat bit events. I see one of 10k
      packets dropped in the scenario which allows us to reproduce. But the
      trace looks always the same.
      
      Not splitting the RX Buffer avoids the packet loss but can cause
      reordering. It's hard to trigger, but it CAN happen.
      
      With that mode we use the HW as it was probably designed for. We read
      from the buffer 1 upwards and clear the buffer as we get the
      message. That's how all microcontrollers use it. So I assume that the
      way we handle the buffers was never really tested. According to the
      public documentation it should just work :)
      
      Let the user decide which evil is the lesser one.
      
      [ Oliver Hartkopp: Provided a sane config option and help text and
        made me switch to favour potential and unlikely reordering over
        packet loss ]
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      2b9aecdc
  2. Jan 26, 2013
  3. Jun 19, 2012
  4. Jun 07, 2012
    • AnilKumar Ch's avatar
      can: c_can: Add support for Bosch D_CAN controller · 69927fcc
      AnilKumar Ch authored
      This patch adds the support for D_CAN controller driver to the existing
      C_CAN driver.
      
      Bosch D_CAN controller is a full-CAN implementation which is compliant
      to CAN protocol version 2.0 part A and B. Bosch D_CAN user manual can be
      obtained from: http://www.semiconductors.bosch.de/media/en/pdf/
      
      
      ipmodules_1/can/d_can_users_manual_111.pdf
      
      A new array is added for accessing the d_can registers, according to d_can
      controller register space.
      
      Current D_CAN implementation has following limitations, this is done
      to avoid large changes to the C_CAN driver.
      1. Message objects are limited to 32, 16 for RX and 16 for TX. C_CAN IP
         supports upto 32 message objects but in case of D_CAN we can configure
         upto 128 message objects.
      2. Using two 16bit reads/writes for accessing the 32bit D_CAN registers.
      3. These patches have been tested on little endian machine, there might
         be some hidden endian-related issues due to the nature of the accesses
         (32-bit registers accessed as 2 16-bit registers). However, I do not
         have a big-endian D_CAN implementation to confirm.
      
      Signed-off-by: default avatarAnilKumar Ch <anilkumar@ti.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      69927fcc
  5. Feb 14, 2011
Loading