1. 12 11月, 2019 3 次提交
  2. 05 11月, 2019 1 次提交
  3. 13 8月, 2019 6 次提交
  4. 24 7月, 2019 6 次提交
  5. 08 6月, 2019 1 次提交
  6. 31 5月, 2019 1 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 · c942fddf
      Thomas Gleixner 提交于
      Based on 3 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [kishon] [vijay] [abraham]
        [i] [kishon]@[ti] [com] this program is distributed in the hope that
        it will be useful but without any warranty without even the implied
        warranty of merchantability or fitness for a particular purpose see
        the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [graeme] [gregory]
        [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
        [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
        [hk] [hemahk]@[ti] [com] this program is distributed in the hope
        that it will be useful but without any warranty without even the
        implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1105 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Reviewed-by: NRichard Fontana <rfontana@redhat.com>
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c942fddf
  7. 28 11月, 2018 2 次提交
  8. 27 7月, 2018 6 次提交
    • A
      can: xilinx_can: add support for Xilinx CAN FD core · 9e5f1b27
      Anssi Hannula 提交于
      Add support for Xilinx CAN FD core.
      
      The major difference from the previously supported cores is that there
      are TX mailboxes instead of a TX FIFO and the RX FIFO access method is
      different.
      
      We only transmit one frame at a time to prevent the HW from reordering
      frames (it uses CAN ID priority order).
      
      Support for CAN FD protocol is not added yet.
      
      v2: Removed unnecessary "rx-mode" DT property and wrapped some long
          lines.
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      9e5f1b27
    • A
      can: xilinx_can: refactor code in preparation for CAN FD support · 1598efe5
      Anssi Hannula 提交于
      Xilinx CAN FD cores are different enough from the previous Zynq and AXI
      CAN cores that some refactoring of the driver is needed.
      
      This commit contains most of the required refactoring to existing code
      and should not alter behavior on existing supported HW.
      
      The changes are:
      
      - Reading and writing to frame registers is parametrized to allow
        reading/writing a different frame in the future.
      
      - Slightly misleading (as it did not specify *all* the interrupts
        supported by the HW) XCAN_INTR_ALL is replaced with specifying the
        interrupts inline in interrupt enabling code.
      
      - xcan_devtype_data.caps is renamed to xcan_devtype_data.flags to allow
        for flags that define alternative functionality (e.g. mailboxes vs.
        FIFO) instead of purely additive capabilities.
      
      - can_bittiming_const is added to xcan_devtype_data as CAN FD cores will
        have wider setting ranges.
      
      - bus_clk clock name is now determined through xcan_devtype_data instead
        of comparing compatible string in probe().
      
      - xcan_devtype_data is added to xcan_priv to allow flag checks after
        probe().
      
      - XCAN_CAP_WATERMARK is now XCAN_FLAG_TXFEMP. CAN FD cores have
        watermark support but no TXFEMP interrupt, which is what we are
        actually interested in.
      
      - xcan_start_xmit() is split to in two parts to prepare for TX mailboxes
        instead of FIFO in CAN FD cores.
      
      v2: Wrapped some long lines in xcan_write_frame().
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      1598efe5
    • A
      can: xilinx_can: update stats.tx_bytes after transmission · 11ee5fcd
      Anssi Hannula 提交于
      The driver updates stats.tx_bytes in start_xmit() even though it could
      do so in TX interrupt handler.
      
      Change the code to update tx_bytes in the interrupt handler, using the
      return value of can_get_echo_skb().
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      11ee5fcd
    • A
      can: xilinx_can: use can_change_state() · 6181dbc0
      Anssi Hannula 提交于
      Replace some custom code with a call to can_change_state().
      
      This subtly changes the error reporting behavior when both RX and TX
      error counters indicate the same state.
      
      Previously, if both RX and TX counters indicated the same state:
      - if overall state is PASSIVE, report CAN_ERR_CRTL_RX_PASSIVE
      - if overall state is WARNING, report CAN_ERR_CRTL_TX_WARNING or
        CAN_ERR_CRTL_RX_WARNING depending on which counter is higher,
        or CAN_ERR_CRTL_RX_WARNING if the counters have the same value.
      
      After this commit:
      - report RX_* or TX_* depending on which counter is higher, or both if
        the counters have exactly the same value.
      
      This behavior is consistent with many other CAN drivers that use this
      same code pattern.
      
      Tested with the integrated CAN on Zynq-7000 SoC.
      
      v2: Simplify resolving states as suggested by Andri Yngvason.
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      6181dbc0
    • A
      can: xilinx_can: only report warning and passive states on state changes · 7e2804aa
      Anssi Hannula 提交于
      The xilinx_can driver currently increments error-warning and
      error-passive statistics on every error interrupt regardless of whether
      the interface was already in the same state. Similarly, the error frame
      sent on error interrupts is always sent with
      CAN_ERR_CRTL_(RX|TX)_(PASSIVE|WARNING) bit set.
      
      To make the error-warning and error-passive statistics more useful, add
      a check to only set the error state when the state has actually been
      changed.
      
      Tested with the integrated CAN on Zynq-7000 SoC.
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      7e2804aa
    • L
      can: xilinx: fix xcan_start_xmit()'s return type · 97f2a589
      Luc Van Oostenryck 提交于
      The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
      which is a typedef for an enum type, but the implementation in this
      driver returns an 'int'.
      
      Fix this by returning 'netdev_tx_t' in this driver too.
      Signed-off-by: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Acked-by: NMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      97f2a589
  9. 23 7月, 2018 7 次提交
    • A
      can: xilinx_can: fix power management handling · 8ebd83bd
      Anssi Hannula 提交于
      There are several issues with the suspend/resume handling code of the
      driver:
      
      - The device is attached and detached in the runtime_suspend() and
        runtime_resume() callbacks if the interface is running. However,
        during xcan_chip_start() the interface is considered running,
        causing the resume handler to incorrectly call netif_start_queue()
        at the beginning of xcan_chip_start(), and on xcan_chip_start() error
        return the suspend handler detaches the device leaving the user
        unable to bring-up the device anymore.
      
      - The device is not brought properly up on system resume. A reset is
        done and the code tries to determine the bus state after that.
        However, after reset the device is always in Configuration mode
        (down), so the state checking code does not make sense and
        communication will also not work.
      
      - The suspend callback tries to set the device to sleep mode (low-power
        mode which monitors the bus and brings the device back to normal mode
        on activity), but then immediately disables the clocks (possibly
        before the device reaches the sleep mode), which does not make sense
        to me. If a clean shutdown is wanted before disabling clocks, we can
        just bring it down completely instead of only sleep mode.
      
      Reorganize the PM code so that only the clock logic remains in the
      runtime PM callbacks and the system PM callbacks contain the device
      bring-up/down logic. This makes calling the runtime PM callbacks during
      e.g. xcan_chip_start() safe.
      
      The system PM callbacks now simply call common code to start/stop the
      HW if the interface was running, replacing the broken code from before.
      
      xcan_chip_stop() is updated to use the common reset code so that it will
      wait for the reset to complete. Reset also disables all interrupts so do
      not do that separately.
      
      Also, the device_may_wakeup() checks are removed as the driver does not
      have wakeup support.
      
      Tested on Zynq-7000 integrated CAN.
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      8ebd83bd
    • A
      can: xilinx_can: fix incorrect clear of non-processed interrupts · 2f4f0f33
      Anssi Hannula 提交于
      xcan_interrupt() clears ERROR|RXOFLV|BSOFF|ARBLST interrupts if any of
      them is asserted. This does not take into account that some of them
      could have been asserted between interrupt status read and interrupt
      clear, therefore clearing them without handling them.
      
      Fix the code to only clear those interrupts that it knows are asserted
      and therefore going to be processed in xcan_err_interrupt().
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      2f4f0f33
    • A
      can: xilinx_can: fix RX overflow interrupt not being enabled · 83997997
      Anssi Hannula 提交于
      RX overflow interrupt (RXOFLW) is disabled even though xcan_interrupt()
      processes it. This means that an RX overflow interrupt will only be
      processed when another interrupt gets asserted (e.g. for RX/TX).
      
      Fix that by enabling the RXOFLW interrupt.
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      83997997
    • A
      can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting · 620050d9
      Anssi Hannula 提交于
      The xilinx_can driver assumes that the TXOK interrupt only clears after
      it has been acknowledged as many times as there have been successfully
      sent frames.
      
      However, the documentation does not mention such behavior, instead
      saying just that the interrupt is cleared when the clear bit is set.
      
      Similarly, testing seems to also suggest that it is immediately cleared
      regardless of the amount of frames having been sent. Performing some
      heavy TX load and then going back to idle has the tx_head drifting
      further away from tx_tail over time, steadily reducing the amount of
      frames the driver keeps in the TX FIFO (but not to zero, as the TXOK
      interrupt always frees up space for 1 frame from the driver's
      perspective, so frames continue to be sent) and delaying the local echo
      frames.
      
      The TX FIFO tracking is also otherwise buggy as it does not account for
      TX FIFO being cleared after software resets, causing
        BUG!, TX FIFO full when queue awake!
      messages to be output.
      
      There does not seem to be any way to accurately track the state of the
      TX FIFO for local echo support while using the full TX FIFO.
      
      The Zynq version of the HW (but not the soft-AXI version) has watermark
      programming support and with it an additional TX-FIFO-empty interrupt
      bit.
      
      Modify the driver to only put 1 frame into TX FIFO at a time on soft-AXI
      and 2 frames at a time on Zynq. On Zynq the TXFEMP interrupt bit is used
      to detect whether 1 or 2 frames have been sent at interrupt processing
      time.
      
      Tested with the integrated CAN on Zynq-7000 SoC. The 1-frame-FIFO mode
      was also tested.
      
      An alternative way to solve this would be to drop local echo support but
      keep using the full TX FIFO.
      
      v2: Add FIFO space check before TX queue wake with locking to
      synchronize with queue stop. This avoids waking the queue when xmit()
      had just filled it.
      
      v3: Keep local echo support and reduce the amount of frames in FIFO
      instead as suggested by Marc Kleine-Budde.
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      620050d9
    • A
      can: xilinx_can: fix recovery from error states not being propagated · 877e0b75
      Anssi Hannula 提交于
      The xilinx_can driver contains no mechanism for propagating recovery
      from CAN_STATE_ERROR_WARNING and CAN_STATE_ERROR_PASSIVE.
      
      Add such a mechanism by factoring the handling of
      XCAN_STATE_ERROR_PASSIVE and XCAN_STATE_ERROR_WARNING out of
      xcan_err_interrupt and checking for recovery after RX and TX if the
      interface is in one of those states.
      
      Tested with the integrated CAN on Zynq-7000 SoC.
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      877e0b75
    • A
      can: xilinx_can: fix RX loop if RXNEMP is asserted without RXOK · 32852c56
      Anssi Hannula 提交于
      If the device gets into a state where RXNEMP (RX FIFO not empty)
      interrupt is asserted without RXOK (new frame received successfully)
      interrupt being asserted, xcan_rx_poll() will continue to try to clear
      RXNEMP without actually reading frames from RX FIFO. If the RX FIFO is
      not empty, the interrupt will not be cleared and napi_schedule() will
      just be called again.
      
      This situation can occur when:
      
      (a) xcan_rx() returns without reading RX FIFO due to an error condition.
      The code tries to clear both RXOK and RXNEMP but RXNEMP will not clear
      due to a frame still being in the FIFO. The frame will never be read
      from the FIFO as RXOK is no longer set.
      
      (b) A frame is received between xcan_rx_poll() reading interrupt status
      and clearing RXOK. RXOK will be cleared, but RXNEMP will again remain
      set as the new message is still in the FIFO.
      
      I'm able to trigger case (b) by flooding the bus with frames under load.
      
      There does not seem to be any benefit in using both RXNEMP and RXOK in
      the way the driver does, and the polling example in the reference manual
      (UG585 v1.10 18.3.7 Read Messages from RxFIFO) also says that either
      RXOK or RXNEMP can be used for detecting incoming messages.
      
      Fix the issue and simplify the RX processing by only using RXNEMP
      without RXOK.
      
      Tested with the integrated CAN on Zynq-7000 SoC.
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      32852c56
    • A
      can: xilinx_can: fix device dropping off bus on RX overrun · 2574fe54
      Anssi Hannula 提交于
      The xilinx_can driver performs a software reset when an RX overrun is
      detected. This causes the device to enter Configuration mode where no
      messages are received or transmitted.
      
      The documentation does not mention any need to perform a reset on an RX
      overrun, and testing by inducing an RX overflow also indicated that the
      device continues to work just fine without a reset.
      
      Remove the software reset.
      
      Tested with the integrated CAN on Zynq-7000 SoC.
      
      Fixes: b1201e44 ("can: xilinx CAN controller support")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      2574fe54
  10. 31 1月, 2017 1 次提交
  11. 23 11月, 2015 3 次提交
  12. 01 5月, 2015 1 次提交
  13. 18 3月, 2015 1 次提交
  14. 19 11月, 2014 1 次提交