Commit 2fc9f69e authored by Paolo Abeni's avatar Paolo Abeni

Merge tag 'linux-can-next-for-5.19-20220502' of...

Merge tag 'linux-can-next-for-5.19-20220502' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2022-05-02

this is a pull request of 9 patches for net-next/master.

The first patch is by Biju Das and documents renesas,r9a07g043-canfd
support in the renesas,rcar-canfd bindings document.

Jakub Kicinski's patch removes a copy of the NAPI_POLL_WEIGHT define
from the m_can driver.

The last 7 patches all target the ctucanfd driver. Pavel Pisa provides
2 patch which update the documentation. 2 patches by Jiapeng Chong
remove unneeded includes and error messages. And another 3 patches by
Pavel Pisa to further clean up the driver (remove inline keyword,
remove unneeded debug statements, and remove unneeded module parameters).

linux-can-next-for-5.19-20220502

* tag 'linux-can-next-for-5.19-20220502' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: ctucanfd: remove PCI module debug parameters
  can: ctucanfd: remove debug statements
  can: ctucanfd: remove inline keyword from local static functions
  can: ctucanfd: ctucan_platform_probe(): remove unnecessary print function dev_err()
  can: ctucanfd: remove unused including <linux/version.h>
  docs: networking: device drivers: can: ctucanfd: update author e-mail
  docs: networking: device drivers: can: add ctucanfd to index
  can: m_can: remove a copy of the NAPI_POLL_WEIGHT define
  dt-bindings: can: renesas,rcar-canfd: Document RZ/G2UL support
====================

Link: https://lore.kernel.org/r/20220502075914.1905039-1-mkl@pengutronix.deSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents ae664d9d 28b250e0
...@@ -33,6 +33,7 @@ properties: ...@@ -33,6 +33,7 @@ properties:
- items: - items:
- enum: - enum:
- renesas,r9a07g043-canfd # RZ/G2UL
- renesas,r9a07g044-canfd # RZ/G2{L,LC} - renesas,r9a07g044-canfd # RZ/G2{L,LC}
- renesas,r9a07g054-canfd # RZ/V2L - renesas,r9a07g054-canfd # RZ/V2L
- const: renesas,rzg2l-canfd # RZ/G2L family - const: renesas,rzg2l-canfd # RZ/G2L family
......
...@@ -536,7 +536,7 @@ CTU CAN FD Driver Sources Reference ...@@ -536,7 +536,7 @@ CTU CAN FD Driver Sources Reference
CTU CAN FD IP Core and Driver Development Acknowledgment CTU CAN FD IP Core and Driver Development Acknowledgment
--------------------------------------------------------- ---------------------------------------------------------
* Odrej Ille <illeondr@fel.cvut.cz> * Odrej Ille <ondrej.ille@gmail.com>
* started the project as student at Department of Measurement, FEE, CTU * started the project as student at Department of Measurement, FEE, CTU
* invested great amount of personal time and enthusiasm to the project over years * invested great amount of personal time and enthusiasm to the project over years
......
...@@ -10,6 +10,7 @@ Contents: ...@@ -10,6 +10,7 @@ Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
ctu/ctucanfd-driver
freescale/flexcan freescale/flexcan
.. only:: subproject and html .. only:: subproject and html
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/can/error.h> #include <linux/can/error.h>
#include <linux/can/led.h> #include <linux/can/led.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/version.h>
#include "ctucanfd.h" #include "ctucanfd.h"
#include "ctucanfd_kregs.h" #include "ctucanfd_kregs.h"
...@@ -133,13 +132,12 @@ static u32 ctucan_read32_be(struct ctucan_priv *priv, ...@@ -133,13 +132,12 @@ static u32 ctucan_read32_be(struct ctucan_priv *priv,
return ioread32be(priv->mem_base + reg); return ioread32be(priv->mem_base + reg);
} }
static inline void ctucan_write32(struct ctucan_priv *priv, enum ctu_can_fd_can_registers reg, static void ctucan_write32(struct ctucan_priv *priv, enum ctu_can_fd_can_registers reg, u32 val)
u32 val)
{ {
priv->write_reg(priv, reg, val); priv->write_reg(priv, reg, val);
} }
static inline u32 ctucan_read32(struct ctucan_priv *priv, enum ctu_can_fd_can_registers reg) static u32 ctucan_read32(struct ctucan_priv *priv, enum ctu_can_fd_can_registers reg)
{ {
return priv->read_reg(priv, reg); return priv->read_reg(priv, reg);
} }
...@@ -179,8 +177,6 @@ static int ctucan_reset(struct net_device *ndev) ...@@ -179,8 +177,6 @@ static int ctucan_reset(struct net_device *ndev)
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
int i = 100; int i = 100;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
ctucan_write32(priv, CTUCANFD_MODE, REG_MODE_RST); ctucan_write32(priv, CTUCANFD_MODE, REG_MODE_RST);
clear_bit(CTUCANFD_FLAG_RX_FFW_BUFFERED, &priv->drv_flags); clear_bit(CTUCANFD_FLAG_RX_FFW_BUFFERED, &priv->drv_flags);
...@@ -266,8 +262,6 @@ static int ctucan_set_bittiming(struct net_device *ndev) ...@@ -266,8 +262,6 @@ static int ctucan_set_bittiming(struct net_device *ndev)
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
struct can_bittiming *bt = &priv->can.bittiming; struct can_bittiming *bt = &priv->can.bittiming;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
/* Note that bt may be modified here */ /* Note that bt may be modified here */
return ctucan_set_btr(ndev, bt, true); return ctucan_set_btr(ndev, bt, true);
} }
...@@ -283,8 +277,6 @@ static int ctucan_set_data_bittiming(struct net_device *ndev) ...@@ -283,8 +277,6 @@ static int ctucan_set_data_bittiming(struct net_device *ndev)
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
struct can_bittiming *dbt = &priv->can.data_bittiming; struct can_bittiming *dbt = &priv->can.data_bittiming;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
/* Note that dbt may be modified here */ /* Note that dbt may be modified here */
return ctucan_set_btr(ndev, dbt, false); return ctucan_set_btr(ndev, dbt, false);
} }
...@@ -302,8 +294,6 @@ static int ctucan_set_secondary_sample_point(struct net_device *ndev) ...@@ -302,8 +294,6 @@ static int ctucan_set_secondary_sample_point(struct net_device *ndev)
int ssp_offset = 0; int ssp_offset = 0;
u32 ssp_cfg = 0; /* No SSP by default */ u32 ssp_cfg = 0; /* No SSP by default */
ctucan_netdev_dbg(ndev, "%s\n", __func__);
if (CTU_CAN_FD_ENABLED(priv)) { if (CTU_CAN_FD_ENABLED(priv)) {
netdev_err(ndev, "BUG! Cannot set SSP - CAN is enabled\n"); netdev_err(ndev, "BUG! Cannot set SSP - CAN is enabled\n");
return -EPERM; return -EPERM;
...@@ -390,8 +380,6 @@ static int ctucan_chip_start(struct net_device *ndev) ...@@ -390,8 +380,6 @@ static int ctucan_chip_start(struct net_device *ndev)
int err; int err;
struct can_ctrlmode mode; struct can_ctrlmode mode;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
priv->txb_prio = 0x01234567; priv->txb_prio = 0x01234567;
priv->txb_head = 0; priv->txb_head = 0;
priv->txb_tail = 0; priv->txb_tail = 0;
...@@ -457,8 +445,6 @@ static int ctucan_do_set_mode(struct net_device *ndev, enum can_mode mode) ...@@ -457,8 +445,6 @@ static int ctucan_do_set_mode(struct net_device *ndev, enum can_mode mode)
{ {
int ret; int ret;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
switch (mode) { switch (mode) {
case CAN_MODE_START: case CAN_MODE_START:
ret = ctucan_reset(ndev); ret = ctucan_reset(ndev);
...@@ -486,7 +472,7 @@ static int ctucan_do_set_mode(struct net_device *ndev, enum can_mode mode) ...@@ -486,7 +472,7 @@ static int ctucan_do_set_mode(struct net_device *ndev, enum can_mode mode)
* *
* Return: Status of TXT buffer * Return: Status of TXT buffer
*/ */
static inline enum ctucan_txtb_status ctucan_get_tx_status(struct ctucan_priv *priv, u8 buf) static enum ctucan_txtb_status ctucan_get_tx_status(struct ctucan_priv *priv, u8 buf)
{ {
u32 tx_status = ctucan_read32(priv, CTUCANFD_TX_STATUS); u32 tx_status = ctucan_read32(priv, CTUCANFD_TX_STATUS);
enum ctucan_txtb_status status = (tx_status >> (buf * 4)) & 0x7; enum ctucan_txtb_status status = (tx_status >> (buf * 4)) & 0x7;
...@@ -1123,8 +1109,6 @@ static irqreturn_t ctucan_interrupt(int irq, void *dev_id) ...@@ -1123,8 +1109,6 @@ static irqreturn_t ctucan_interrupt(int irq, void *dev_id)
u32 imask; u32 imask;
int irq_loops; int irq_loops;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
for (irq_loops = 0; irq_loops < 10000; irq_loops++) { for (irq_loops = 0; irq_loops < 10000; irq_loops++) {
/* Get the interrupt status */ /* Get the interrupt status */
isr = ctucan_read32(priv, CTUCANFD_INT_STAT); isr = ctucan_read32(priv, CTUCANFD_INT_STAT);
...@@ -1198,8 +1182,6 @@ static void ctucan_chip_stop(struct net_device *ndev) ...@@ -1198,8 +1182,6 @@ static void ctucan_chip_stop(struct net_device *ndev)
u32 mask = 0xffffffff; u32 mask = 0xffffffff;
u32 mode; u32 mode;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
/* Disable interrupts and disable CAN */ /* Disable interrupts and disable CAN */
ctucan_write32(priv, CTUCANFD_INT_ENA_CLR, mask); ctucan_write32(priv, CTUCANFD_INT_ENA_CLR, mask);
ctucan_write32(priv, CTUCANFD_INT_MASK_SET, mask); ctucan_write32(priv, CTUCANFD_INT_MASK_SET, mask);
...@@ -1222,8 +1204,6 @@ static int ctucan_open(struct net_device *ndev) ...@@ -1222,8 +1204,6 @@ static int ctucan_open(struct net_device *ndev)
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
int ret; int ret;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
ret = pm_runtime_get_sync(priv->dev); ret = pm_runtime_get_sync(priv->dev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
...@@ -1283,8 +1263,6 @@ static int ctucan_close(struct net_device *ndev) ...@@ -1283,8 +1263,6 @@ static int ctucan_close(struct net_device *ndev)
{ {
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
ctucan_netdev_dbg(ndev, "%s\n", __func__);
netif_stop_queue(ndev); netif_stop_queue(ndev);
napi_disable(&priv->napi); napi_disable(&priv->napi);
ctucan_chip_stop(ndev); ctucan_chip_stop(ndev);
...@@ -1310,8 +1288,6 @@ static int ctucan_get_berr_counter(const struct net_device *ndev, struct can_ber ...@@ -1310,8 +1288,6 @@ static int ctucan_get_berr_counter(const struct net_device *ndev, struct can_ber
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
int ret; int ret;
ctucan_netdev_dbg(ndev, "%s\n", __func__);
ret = pm_runtime_get_sync(priv->dev); ret = pm_runtime_get_sync(priv->dev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", __func__, ret); netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", __func__, ret);
...@@ -1337,8 +1313,6 @@ int ctucan_suspend(struct device *dev) ...@@ -1337,8 +1313,6 @@ int ctucan_suspend(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
ctucan_netdev_dbg(ndev, "%s\n", __func__);
if (netif_running(ndev)) { if (netif_running(ndev)) {
netif_stop_queue(ndev); netif_stop_queue(ndev);
netif_device_detach(ndev); netif_device_detach(ndev);
...@@ -1355,8 +1329,6 @@ int ctucan_resume(struct device *dev) ...@@ -1355,8 +1329,6 @@ int ctucan_resume(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
ctucan_netdev_dbg(ndev, "%s\n", __func__);
priv->can.state = CAN_STATE_ERROR_ACTIVE; priv->can.state = CAN_STATE_ERROR_ACTIVE;
if (netif_running(ndev)) { if (netif_running(ndev)) {
......
...@@ -45,14 +45,6 @@ ...@@ -45,14 +45,6 @@
#define CTUCAN_WITHOUT_CTUCAN_ID 0 #define CTUCAN_WITHOUT_CTUCAN_ID 0
#define CTUCAN_WITH_CTUCAN_ID 1 #define CTUCAN_WITH_CTUCAN_ID 1
static bool use_msi = true;
module_param(use_msi, bool, 0444);
MODULE_PARM_DESC(use_msi, "PCIe implementation use MSI interrupts. Default: 1 (yes)");
static bool pci_use_second = true;
module_param(pci_use_second, bool, 0444);
MODULE_PARM_DESC(pci_use_second, "Use the second CAN core on PCIe card. Default: 1 (yes)");
struct ctucan_pci_board_data { struct ctucan_pci_board_data {
void __iomem *bar0_base; void __iomem *bar0_base;
void __iomem *cra_base; void __iomem *cra_base;
...@@ -117,13 +109,11 @@ static int ctucan_pci_probe(struct pci_dev *pdev, ...@@ -117,13 +109,11 @@ static int ctucan_pci_probe(struct pci_dev *pdev,
goto err_disable_device; goto err_disable_device;
} }
if (use_msi) { ret = pci_enable_msi(pdev);
ret = pci_enable_msi(pdev); if (!ret) {
if (!ret) { dev_info(dev, "MSI enabled\n");
dev_info(dev, "MSI enabled\n"); pci_set_master(pdev);
pci_set_master(pdev); msi_ok = 1;
msi_ok = 1;
}
} }
dev_info(dev, "ctucan BAR0 0x%08llx 0x%08llx\n", dev_info(dev, "ctucan BAR0 0x%08llx 0x%08llx\n",
...@@ -184,7 +174,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev, ...@@ -184,7 +174,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev,
core_i++; core_i++;
while (pci_use_second && (core_i < num_cores)) { while (core_i < num_cores) {
addr += 0x4000; addr += 0x4000;
ret = ctucan_probe_common(dev, addr, irq, ntxbufs, 100000000, ret = ctucan_probe_common(dev, addr, irq, ntxbufs, 100000000,
0, ctucan_pci_set_drvdata); 0, ctucan_pci_set_drvdata);
......
...@@ -64,7 +64,6 @@ static int ctucan_platform_probe(struct platform_device *pdev) ...@@ -64,7 +64,6 @@ static int ctucan_platform_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(dev, "Cannot find interrupt.\n");
ret = irq; ret = irq;
goto err; goto err;
} }
......
...@@ -77,9 +77,6 @@ enum m_can_reg { ...@@ -77,9 +77,6 @@ enum m_can_reg {
M_CAN_TXEFA = 0xf8, M_CAN_TXEFA = 0xf8,
}; };
/* napi related */
#define M_CAN_NAPI_WEIGHT 64
/* message ram configuration data length */ /* message ram configuration data length */
#define MRAM_CFG_LEN 8 #define MRAM_CFG_LEN 8
...@@ -951,7 +948,7 @@ static int m_can_rx_peripheral(struct net_device *dev) ...@@ -951,7 +948,7 @@ static int m_can_rx_peripheral(struct net_device *dev)
struct m_can_classdev *cdev = netdev_priv(dev); struct m_can_classdev *cdev = netdev_priv(dev);
int work_done; int work_done;
work_done = m_can_rx_handler(dev, M_CAN_NAPI_WEIGHT); work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT);
/* Don't re-enable interrupts if the driver had a fatal error /* Don't re-enable interrupts if the driver had a fatal error
* (e.g., FIFO read failure). * (e.g., FIFO read failure).
...@@ -1474,7 +1471,7 @@ static int m_can_dev_setup(struct m_can_classdev *cdev) ...@@ -1474,7 +1471,7 @@ static int m_can_dev_setup(struct m_can_classdev *cdev)
if (!cdev->is_peripheral) if (!cdev->is_peripheral)
netif_napi_add(dev, &cdev->napi, netif_napi_add(dev, &cdev->napi,
m_can_poll, M_CAN_NAPI_WEIGHT); m_can_poll, NAPI_POLL_WEIGHT);
/* Shared properties of all M_CAN versions */ /* Shared properties of all M_CAN versions */
cdev->version = m_can_version; cdev->version = m_can_version;
...@@ -1994,7 +1991,7 @@ int m_can_class_register(struct m_can_classdev *cdev) ...@@ -1994,7 +1991,7 @@ int m_can_class_register(struct m_can_classdev *cdev)
if (cdev->is_peripheral) { if (cdev->is_peripheral) {
ret = can_rx_offload_add_manual(cdev->net, &cdev->offload, ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
M_CAN_NAPI_WEIGHT); NAPI_POLL_WEIGHT);
if (ret) if (ret)
goto clk_disable; goto clk_disable;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment