Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3424606pxf; Mon, 29 Mar 2021 01:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+UA+0uhyWhVf6i08Uj2LK0fC0IoWZqThXPKrxzaVwEjqVlGo1Eu7y1KrneaGsdT8XTEMA X-Received: by 2002:a17:906:d797:: with SMTP id pj23mr27801728ejb.367.1617007272733; Mon, 29 Mar 2021 01:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007272; cv=none; d=google.com; s=arc-20160816; b=FOCDvX+ClmoFVvk4XOKGWMkl6f60Al4t+Zymli/GgiHfPOU3yqhMASLBAc9jYIPsup eJvZd2a9UbJTITGYduh4rhtN42kMM6lDKaGAe0wewUkrIFMKUku3ncA/vktgTsUhVurp vhudrhFzEbTl6SH5C5uWwygRcr4YbAGGg2GSflBkCOHJ8ai3vVN1n52WLeIx5W27vWHA vyxw9ZOCfcLlYi3zdEJRM0URuWHu3acVnI9mD8NSLQxLcFliVniicDewiuRAh6VblC4L uLPlUgHs9w+ylOsIxnRfA5Rqfh29+wIIZkw086N1e+spDfTwwdHBI3BLUzxxoiDSCV6m 9qag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iDJT6G9VJstrmu5OUPM0kFxo3mjGCTKstXi3U8Dt//Y=; b=N+frTAlC4re8mxkCWstOPbYtICpm3sH/x3RCKEutuiDOo4U5lOkXxVX11TpxCXgD0f SBGidaoFG6gCMe23LzRCGxBSWSMC3uAfBAouBjAbZmwEl8A0Q7KWtkDCx0yYvsVEhBdh 43rBAWrkttYV8RZ3jfhokpiazyJmk4JarJbFyLCb1CifTGhDJZ99DoC1sBbspspOtrjX TVQSOrkgN9v/x3PHfglgjOdAkEmonxIjy3E2tBJ3EjrJo71BPDc49Y0QKof8WmkP2P7R ChT5DGveFZOyDW5ak2dvzSLJZiO4pKMwG/rO+6jGbrb0r1BOSZ7YjPaDtSJzNArDd6Go 5MuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GSAVQtBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si11706392edr.255.2021.03.29.01.40.50; Mon, 29 Mar 2021 01:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GSAVQtBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234533AbhC2IgO (ORCPT + 99 others); Mon, 29 Mar 2021 04:36:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:39144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233666AbhC2IWJ (ORCPT ); Mon, 29 Mar 2021 04:22:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14E8E61601; Mon, 29 Mar 2021 08:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006128; bh=XZdW0vt0XFXg9vIcdEI77opC+PqakfdB/iYPtPi2TXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSAVQtBrdY8OscfbqNb8WO7imn8w7SlCtaBHRlSeRDBi2EQkpDsx8POC1gKLIPX5a dXqaAuHx5PYiMpvPV1gCJPR/fZxhoRGpcrWY56hDGwyJkLQL8z5LE0Lgqx1RXkZ/wq Kr+gWqnBqj1mIUcdYtVdPorfhkU0tFv6akTw0JA0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jimmy Assarsson , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.10 128/221] can: kvaser_pciefd: Always disable bus load reporting Date: Mon, 29 Mar 2021 09:57:39 +0200 Message-Id: <20210329075633.473109005@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jimmy Assarsson [ Upstream commit 7c6e6bce08f918b64459415f58061d4d6df44994 ] 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 Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- 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 43151dd6cb1c..99323c273aa5 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