When fixing the CAN clock frequency,
fb12797ab1fe ("can: kvaser_usb: get CAN clock frequency from device"),
I introduced a regression.
For Leaf devices based on M32C, the firmware expects bittiming parameters
calculated for 16MHz clock. Regardless of the actual clock frequency.
This regression affects M32C based Leaf devices with non-16MHz clock.
Also correct the bittiming constants in kvaser_usb_leaf.c, where the limits
are different depending on which firmware/device being used.
Once merged to mainline, I'll backport these fixes for the stable kernels.
Changes in v2:
- Add struct kvaser_usb_driver_info as suggested by Marc Kleine-Budde [1],
instead of adding dev->card_data.quirks.
[1] https://lore.kernel.org/linux-can/20220602063031.415858-1-extja@kvaser.com/…
Jimmy Assarsson (3):
can: kvaser_usb: Replace run-time checks with struct
kvaser_usb_driver_info
can: kvaser_usb: kvaser_usb_leaf: Fix CAN clock frequency regression
can: kvaser_usb: kvaser_usb_leaf: Fix bittiming limits
drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 73 ++++-
.../net/can/usb/kvaser_usb/kvaser_usb_core.c | 253 +++++++++---------
.../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 14 +-
.../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 119 ++++----
4 files changed, 255 insertions(+), 204 deletions(-)
--
2.36.1
From: Peter Zijlstra <peterz(a)infradead.org>
commit ab3e9c0b75dcb13e9254ef68caa7f15bc66b6471 upstream.
CAT has happened, WBINDV is bad (even before CAT blowing away the
entire cache on a multi-core platform wasn't nice), try not to use it
ever.
Signed-off-by: Peter Zijlstra (Intel) <peterz(a)infradead.org>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Reviewed-by: Dave Hansen <dave.hansen(a)intel.com>
Cc: Bin Yang <bin.yang(a)intel.com>
Cc: Mark Gross <mark.gross(a)intel.com>
Link: https://lkml.kernel.org/r/20180919085947.933674526@infradead.org
Cc: <stable(a)vger.kernel.org> # 4.19.x
Signed-off-by: Wen Yang <wenyang(a)linux.alibaba.com>
---
arch/x86/mm/pageattr.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 101f3ad0d6ad..ab87da7a6043 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -239,26 +239,12 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
int in_flags, struct page **pages)
{
unsigned int i, level;
-#ifdef CONFIG_PREEMPT
- /*
- * Avoid wbinvd() because it causes latencies on all CPUs,
- * regardless of any CPU isolation that may be in effect.
- *
- * This should be extended for CAT enabled systems independent of
- * PREEMPT because wbinvd() does not respect the CAT partitions and
- * this is exposed to unpriviledged users through the graphics
- * subsystem.
- */
- unsigned long do_wbinvd = 0;
-#else
- unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
-#endif
BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
- on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
+ flush_tlb_all();
- if (!cache || do_wbinvd)
+ if (!cache)
return;
/*
--
2.19.1.6.gb485710b