30 Jun, 2016

1 commit


23 Jun, 2016

6 commits

  • Silent ignorance of errors during probe procedure is a bad thing, this
    patch fixes it. Extra message added for hardware initialization
    failure. Such common issues are mostly caused by wrong wiring. Message
    about success added as well, it should be useful to debug new hardware
    configuration, especially in case of several CAN buses.

    Signed-off-by: Ed Spiridonov
    Signed-off-by: Marc Kleine-Budde

    Ed Spiridonov
     
  • As per Wolfgang G, all new drivers should support decreasing state
    transition(back-to-error-active). This patch adds this support.

    This driver configures the controller to halt on bus-off entry. Hence,
    when in error states less than bus off state, the TEC/REC counters
    are checked for lower state transition eligibility and action.

    Signed-off-by: Ramesh Shanmugasundaram
    Signed-off-by: Marc Kleine-Budde

    Ramesh Shanmugasundaram
     
  • The controller can operate in one of the two global modes
    - CAN FD only mode (default)
    - Classical CAN (CAN2.0) only mode

    This patch adds support for Classical CAN only mode. It can be enabled
    by defining the optional device tree property "renesas,no-can-fd" of this
    node.

    Note: R-Car Gen3 h/w manual v0.51E shows bit6 of RSCFDnCFDGCFG as
    reserved, which is incorrect. This bit is same as RSCFDnGCFG.

    Signed-off-by: Ramesh Shanmugasundaram
    Signed-off-by: Marc Kleine-Budde

    Ramesh Shanmugasundaram
     
  • This patch adds support for Kvaser Leaf Light HS v2 OEM, Mini PCI
    Express 2xHS and USBcan Light 2xHS.

    Signed-off-by: Jimmy Assarsson
    Signed-off-by: Marc Kleine-Budde

    Jimmy Assarsson
     
  • For 'real' hardware CAN devices the netlink interface is used to set CAN
    specific communication parameters. Real CAN hardware can not be created nor
    removed with the ip tool ...

    This patch adds a private dellink function for the CAN device driver interface
    that does just nothing.

    It's a follow up to commit 993e6f2fd ("can: fix oops caused by wrong rtnl
    newlink usage") but for dellink.

    Reported-by: ajneu
    Signed-off-by: Oliver Hartkopp
    Cc:
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     
  • With upstream commit bb208f144cf3f59 (can: fix handling of unmodifiable
    configuration options) a new can_validate() function was introduced.

    When invoking 'ip link set can0 type can' without any configuration data
    can_validate() tries to validate the content without taking into account that
    there's totally no content. This patch adds a check for missing content.

    Reported-by: ajneu
    Signed-off-by: Oliver Hartkopp
    Cc:
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     

20 Jun, 2016

3 commits


17 Jun, 2016

7 commits

  • This patch clubs the Renesas controller drivers in one rcar dir.

    Signed-off-by: Ramesh Shanmugasundaram
    Signed-off-by: Marc Kleine-Budde

    Ramesh Shanmugasundaram
     
  • This patch adds support for the CAN FD controller found in Renesas R-Car
    SoCs. The controller operates in CAN FD only mode by default.

    CAN FD mode supports both Classical CAN & CAN FD frame formats. The
    controller supports ISO 11898-1:2015 CAN FD format only.

    This controller supports two channels and the driver can enable either
    or both of the channels.

    Driver uses Rx FIFOs (one per channel) for reception & Common FIFOs (one
    per channel) for transmission. Rx filter rules are configured to the
    minimum (one per channel) and it accepts Standard, Extended, Data &
    Remote Frame combinations.

    Note: There are few documentation errors in R-Car Gen3 Hardware User
    Manual v0.5E with respect to CAN FD controller. They are listed below:

    1. CAN FD interrupt numbers 29 & 30 are listed as per channel
    interrupts. However, they are common to both channels (i.e.) they are
    global and channel interrupts respectively.

    2. CANFD clock is derived from PLL1. This is not documented.

    3. CANFD clock is further divided by (1/2) within the CAN FD controller.
    This is not documented.

    4. The minimum value of NTSEG1 in RSCFDnCFDCmNCFG register is 2 Tq. It
    is specified 4 Tq in the manual.

    5. The maximum number of message RAM area the controller can use is 3584
    bytes. It is specified 10752 bytes in the manual.

    Signed-off-by: Ramesh Shanmugasundaram
    Acked-by: Rob Herring
    Reviewed-by: Ulrich Hecht
    Signed-off-by: Marc Kleine-Budde

    Ramesh Shanmugasundaram
     
  • This patch Implements the ethtool set_phys_id callback to ease the
    locating of specific physical devices. Currently only supported on
    candleLight interfaces.

    Signed-off-by: Hubert Denkmair
    Signed-off-by: Maximilian Schneider
    [mkl: split codingstyle change sinto separate patch]
    Signed-off-by: Marc Kleine-Budde

    Maximilian Schneider
     
  • This patch converts "1 << n" by BIT(n) and fixes the indention. No
    functional change.

    Signed-off-by: Hubert Denkmair
    Signed-off-by: Maximilian Schneider
    [mkl: split codingstyle changes into separate patch]
    Signed-off-by: Marc Kleine-Budde

    Maximilian Schneider
     
  • This driver does not do anything special in module init/exit. This patch
    eliminates the module init/exit boilerplate code by utilizing the
    module_isa_driver macro.

    Signed-off-by: William Breathitt Gray
    Signed-off-by: Marc Kleine-Budde

    William Breathitt Gray
     
  • Use CAN_MTU macro instead of sizeof(struct can_frame) just like the
    other drivers do.

    Signed-off-by: Marek Vasut
    Cc: Oliver Hartkopp
    Cc: Marc Kleine-Budde
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • This patch optimizes the calculation of the sample point. To understand what it
    does have a look at the original implementation.

    If there is a combination of timing parameters where both the bitrate and
    sample point error are 0 the current implementation will find it.

    However if the reference clock doesn't allow an optimal bitrate (this means the
    bitrate error is always != 0) there might be several timing parameter
    combinations having the same bitrate error. The original implementation will
    allways choose the one with the highest brp. The actual sample point error
    isn't taken into account.

    This patch changes the algorithm to minimize the sample point error, too. Now a
    brp/tseg combination is accepted as better if one of these condition are
    fulfilled:
    1) the bit rate error must be smaller, or
    2) the bit rate error must be equal and
    the sample point error must be equal or smaller

    If a smaller bit rate error is found the sample point error is reset. This
    ensures that we first optimize for small bit rate error and then for small
    sample point errors.

    Signed-off-by: Marc Kleine-Budde

    Marc Kleine-Budde
     

09 May, 2016

12 commits

  • The updated specification for the IFI CANFD core contains description
    of more detailed error reporting capability of the core. Implement
    support for this detailed error reporting.

    Signed-off-by: Marek Vasut
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • Only increment the TX counters in the irq handler if a CAN message
    was sent. The current code incremented the counters also if the TX
    FIFO empty interrupt happened, which is incorrect.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • The CAN_CTRLMODE_FD flag is set for both ISO and BOSCH CANFD mode,
    while the CAN_CTRLMODE_FD_NON_ISO is additional flag which is only
    set for CANFD-BOSCH mode. Fix the handling of the flags to reflect
    this.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Reviewed-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • There is no distinction between bittiming constants for the slow and
    fast part of the CANFD operation on this controller, so just use one
    single bittiming constant set.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • The updated documentation regarding the IFI CANFD core from April 2016
    adds more details regarding the timing calculation. There is no longer
    any distinction in the timing calculation between CANFD and CAN2.0, but
    instead there are two timing modes -- 4_12_6_6 and 7_9_8_8 -- where the
    numbers mean the width in bits of the SJW/Prescaler/TimeA/TimeB fields.
    The code uses 7_9_8_8 mode, which allows more fine-grained control over
    the timing.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • Start the NAPI polling in case the bus warning interrupt happens,
    since it is the poll function which checks and reports the warning.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • Modified the USB device table to use only the first USB interface, as is
    the case with GS USB devices. This allows other GS USB compatible
    devices to be more flexible with their remaining interfaces.

    Signed-off-by: Maximilian Schneider
    Signed-off-by: Marc Kleine-Budde

    Maximilian Schneider
     
  • My patch of May 2015 was missing the changed handling of error
    indications. With CAL/CANopen firmware the NMTS-SlaveEventIndication
    must be used instead of CAN-EventIndication. An appropriate slave node
    must be configured to report the errors.

    In our department (about 15 development systems with Janz ICAN3-
    modules with firmware 1.48, my system also with firmware ICANOS 1.35)
    we use the driver with this patch for about one year: no known problems.

    Signed-off-by: Andreas Gröger
    Signed-off-by: Marc Kleine-Budde

    Andreas Gröger
     
  • As described in 'can: m_can: tag current CAN FD controllers as non-ISO'
    (6cfda7fbebe) it is possible to define fixed configuration options by
    setting the according bit in 'ctrlmode' and clear it in 'ctrlmode_supported'.
    This leads to the incovenience that the fixed configuration bits can not be
    passed by netlink even when they have the correct values (e.g. non-ISO, FD).

    This patch fixes that issue and not only allows fixed set bit values to be set
    again but now requires(!) to provide these fixed values at configuration time.
    A valid CAN FD configuration consists of a nominal/arbitration bittiming, a
    data bittiming and a control mode with CAN_CTRLMODE_FD set - which is now
    enforced by a new can_validate() function. This fix additionally removed the
    inconsistency that was prohibiting the support of 'CANFD-only' controller
    drivers, like the RCar CAN FD.

    For this reason a new helper can_set_static_ctrlmode() has been introduced to
    provide a proper interface to handle static enabled CAN controller options.

    Reported-by: Ramesh Shanmugasundaram
    Signed-off-by: Oliver Hartkopp
    Reviewed-by: Ramesh Shanmugasundaram
    Cc: # >= 3.18
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     
  • Replace scheduled to be removed create_freezable_workqueue with
    alloc_workqueue.

    priv->wq should be explicitly set as freezable to ensure it is frozen
    in the suspend sequence and work items are drained so that no new work
    item starts execution until thawed. Thus, use of WQ_FREEZABLE flag
    here is required.

    WQ_MEM_RECLAIM flag has been set here to ensure forward progress
    regardless of memory pressure.

    The order of execution is not important so set @max_active as 0.

    Signed-off-by: Amitoj Kaur Chawla
    Acked-by: Tejun Heo
    Signed-off-by: Marc Kleine-Budde

    Amitoj Kaur Chawla
     
  • This patch adds support for the Marathon CAN-bus-PCIe card to the
    sja1000 driver. For more information see:

    http://can.marathon.ru/page/devices/can-bus-pcie

    Signed-off-by: Nikita Edward Baruzdin
    Signed-off-by: Marc Kleine-Budde

    Nikita Edward Baruzdin
     
  • According to SJA1000 documentation the location of error is available
    regardless of an error type. Therefore it should always be forwarded to
    SocketCAN.

    Signed-off-by: Nikita Edward Baruzdin
    Signed-off-by: Alexander GQ Gerasiov
    Acked-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Alexander Gerasiov
     

05 May, 2016

1 commit

  • Replace all trans_start updates with netif_trans_update helper.
    change was done via spatch:

    struct net_device *d;
    @@
    - d->trans_start = jiffies
    + netif_trans_update(d)

    Compile tested only.

    Cc: user-mode-linux-devel@lists.sourceforge.net
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linux1394-devel@lists.sourceforge.net
    Cc: linux-rdma@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: MPT-FusionLinux.pdl@broadcom.com
    Cc: linux-scsi@vger.kernel.org
    Cc: linux-can@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-omap@vger.kernel.org
    Cc: linux-hams@vger.kernel.org
    Cc: linux-usb@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: devel@driverdev.osuosl.org
    Cc: b.a.t.m.a.n@lists.open-mesh.org
    Cc: linux-bluetooth@vger.kernel.org
    Signed-off-by: Florian Westphal
    Acked-by: Felipe Balbi
    Acked-by: Mugunthan V N
    Acked-by: Antonio Quartulli
    Signed-off-by: David S. Miller

    Florian Westphal
     

10 Mar, 2016

5 commits

  • Added r8a7795 SoC support.

    Signed-off-by: Ramesh Shanmugasundaram
    Acked-by: Rob Herring
    Signed-off-by: Marc Kleine-Budde

    Ramesh Shanmugasundaram
     
  • In case of CAN2.0 EFF frame, the controller handles frame IDs in a
    rather bizzare way. The ID is split into an extended part, IDX[28:11]
    and standard part, ID[10:0]. In the TX path, the core first sends the
    top 11 bits of the IDX, followed by ID and finally the rest of IDX.
    In the RX path, the core stores the ID the LSbit part of IDX field,
    followed by the LSbit parts of real IDX. The MSbit parts of IDX are
    stored in ID field of the register.

    This patch implements the necessary bit shuffling to mitigate this
    obscure behavior. In case two of these controllers are connected
    together, the RX and TX bit swapping nullifies itself and the issue
    does not manifest. The issue only manifests when talking to another
    different CAN controller.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Reviewed-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • 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
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Reviewed-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • The TX DLC, the transmission length information, was not written
    into the transmit configuration register. When using the CAN core
    with different CAN controller, the receiving CAN controller will
    receive only the ID part of the CAN frame, but no data at all.

    This patch adds the TX DLC into the register to fix this issue.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Reviewed-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     
  • The clock generation does not match reality when using the CAN IP
    core outside of the FPGA design. This patch fixes the computation
    of values which are programmed into the clock generator registers.

    First, there are some off-by-one errors which manifest themselves
    only when communicating with different controller, so those are
    fixed.

    Second, the bits in the clock generator registers have different
    meaning depending on whether the core is in ISO CANFD mode or any
    of the other modes (BOSCH CANFD or CAN2.0). Detect the ISO CANFD
    mode and fix handling of this special case of clock configuration.

    Finally, the CAN clock speed is in CANCLOCK register, not SYSCLOCK
    register, so fix this as well.

    Signed-off-by: Marek Vasut
    Cc: Marc Kleine-Budde
    Cc: Mark Rutland
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Reviewed-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Marek Vasut
     

09 Mar, 2016

1 commit


04 Mar, 2016

1 commit


26 Feb, 2016

3 commits

  • Add fallback compatibility string for R-Car Gen 1 and Gen2.

    In the case of Renesas R-Car hardware we know that there are generations of
    SoCs, e.g. Gen 1 and Gen 2. But beyond that its not clear what the
    relationship between IP blocks might be. For example, I believe that
    r8a7779 is older than r8a7778 but that doesn't imply that the latter is a
    descendant of the former or vice versa.

    We can, however, by examining the documentation and behaviour of the
    hardware at run-time observe that the current driver implementation appears
    to be compatible with the IP blocks on SoCs within a given generation.

    For the above reasons and convenience when enabling new SoCs a
    per-generation fallback compatibility string scheme being adopted for
    drivers for Renesas SoCs.

    Signed-off-by: Simon Horman
    Acked-by: Rob Herring
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Marc Kleine-Budde

    Simon Horman
     
  • This patch fixes the coding style issues introduced in commit:

    90cfde46586d can: ems_usb: Fix possible tx overflow

    Reported-by: Sergei Shtylyov
    Signed-off-by: Marc Kleine-Budde

    Marc Kleine-Budde
     
  • gs_destroy_candev() erroneously calls kfree() on a struct gs_can *, which is
    allocated through alloc_candev() and should instead be freed using
    free_candev() alone.

    The inappropriate use of kfree() causes the kernel to hang when
    gs_destroy_candev() is called.

    Only the struct gs_usb * which is allocated through kzalloc() should be freed
    using kfree() when the device is disconnected.

    Signed-off-by: Maximilian Schneider
    Cc: linux-stable
    Signed-off-by: Marc Kleine-Budde

    Maximilain Schneider