netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Jimmy Assarsson <extja@kvaser.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [net 06/11] can: kvaser_pciefd: Always disable bus load reporting
Date: Tue, 16 Mar 2021 09:20:59 +0100	[thread overview]
Message-ID: <20210316082104.4027260-7-mkl@pengutronix.de> (raw)
In-Reply-To: <20210316082104.4027260-1-mkl@pengutronix.de>

From: Jimmy Assarsson <extja@kvaser.com>

Under certain circumstances, when switching from Kvaser's linuxcan driver
(kvpciefd) to the SocketCAN driver (kvaser_pciefd), the bus load reporting
is not disabled.
This is flooding the kernel log with prints like:
[3485.574677] kvaser_pciefd 0000:02:00.0: Received unexpected packet type 0x00000009

Always put the controller in the expected state, instead of assuming that
bus load reporting is inactive.

Note: If bus load reporting is enabled when the driver is loaded, you will
      still get a number of bus load packages (and printouts), before it is
      disabled.

Fixes: 26ad340e582d ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Link: https://lore.kernel.org/r/20210309091724.31262-1-jimmyassarsson@gmail.com
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/kvaser_pciefd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/can/kvaser_pciefd.c b/drivers/net/can/kvaser_pciefd.c
index 37e05010ca91..74d9899fc904 100644
--- a/drivers/net/can/kvaser_pciefd.c
+++ b/drivers/net/can/kvaser_pciefd.c
@@ -57,6 +57,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices");
 #define KVASER_PCIEFD_KCAN_STAT_REG 0x418
 #define KVASER_PCIEFD_KCAN_MODE_REG 0x41c
 #define KVASER_PCIEFD_KCAN_BTRN_REG 0x420
+#define KVASER_PCIEFD_KCAN_BUS_LOAD_REG 0x424
 #define KVASER_PCIEFD_KCAN_BTRD_REG 0x428
 #define KVASER_PCIEFD_KCAN_PWM_REG 0x430
 /* Loopback control register */
@@ -949,6 +950,9 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie)
 		timer_setup(&can->bec_poll_timer, kvaser_pciefd_bec_poll_timer,
 			    0);
 
+		/* Disable Bus load reporting */
+		iowrite32(0, can->reg_base + KVASER_PCIEFD_KCAN_BUS_LOAD_REG);
+
 		tx_npackets = ioread32(can->reg_base +
 				       KVASER_PCIEFD_KCAN_TX_NPACKETS_REG);
 		if (((tx_npackets >> KVASER_PCIEFD_KCAN_TX_NPACKETS_MAX_SHIFT) &
-- 
2.30.1



  parent reply	other threads:[~2021-03-16  8:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  8:20 pull-request: can 2021-03-16 Marc Kleine-Budde
2021-03-16  8:20 ` [net 01/11] can: dev: Move device back to init netns on owning netns delete Marc Kleine-Budde
2021-03-16 21:16   ` Jakub Kicinski
2021-03-16  8:20 ` [net 02/11] can: isotp: isotp_setsockopt(): only allow to set low level TX flags for CAN-FD Marc Kleine-Budde
2021-03-16  8:20 ` [net 03/11] can: isotp: TX-path: ensure that CAN frame flags are initialized Marc Kleine-Budde
2021-03-18 10:11   ` Oliver Hartkopp
2021-03-16  8:20 ` [net 04/11] can: peak_usb: add forgotten supported devices Marc Kleine-Budde
2021-03-16  8:20 ` [net 05/11] can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate Marc Kleine-Budde
2021-03-16  9:02   ` Angelo Dureghello
2021-03-16  9:12     ` Marc Kleine-Budde
2021-03-16  8:20 ` Marc Kleine-Budde [this message]
2021-03-16  8:21 ` [net 07/11] can: kvaser_usb: Add support for USBcan Pro 4xHS Marc Kleine-Budde
2021-03-16  8:21 ` [net 08/11] can: c_can_pci: c_can_pci_remove(): fix use-after-free Marc Kleine-Budde
2021-03-16  8:21 ` [net 09/11] can: c_can: move runtime PM enable/disable to c_can_platform Marc Kleine-Budde
2021-03-16  8:21 ` [net 10/11] can: m_can: m_can_do_rx_poll(): fix extraneous msg loss warning Marc Kleine-Budde
2021-03-16  8:21 ` [net 11/11] can: m_can: m_can_rx_peripheral(): fix RX being blocked by errors Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210316082104.4027260-7-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=extja@kvaser.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).