From 09b84bd84ad485c9f95efa314d14cf4bea544d4f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 Feb 2015 14:55:29 -0800 Subject: [PATCH] 3.18-stable patches added patches: can-c_can-end-pending-transmission-on-network-stop-ifdown.patch clocksource-arch_timer-only-use-the-virtual-counter.patch xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch --- ...-transmission-on-network-stop-ifdown.patch | 34 +++++++ ...h_timer-only-use-the-virtual-counter.patch | 44 +++++++++ queue-3.18/series | 3 + ...rm64-introduce-xen_arch_need_swiotlb.patch | 95 +++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 queue-3.18/can-c_can-end-pending-transmission-on-network-stop-ifdown.patch create mode 100644 queue-3.18/clocksource-arch_timer-only-use-the-virtual-counter.patch create mode 100644 queue-3.18/xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch diff --git a/queue-3.18/can-c_can-end-pending-transmission-on-network-stop-ifdown.patch b/queue-3.18/can-c_can-end-pending-transmission-on-network-stop-ifdown.patch new file mode 100644 index 00000000000..0c37add5d1c --- /dev/null +++ b/queue-3.18/can-c_can-end-pending-transmission-on-network-stop-ifdown.patch @@ -0,0 +1,34 @@ +From 7ffd7b4e169d619e66928fe5d997723f2c6f1056 Mon Sep 17 00:00:00 2001 +From: Viktor Babrian +Date: Sun, 18 Jan 2015 20:01:40 +0100 +Subject: can: c_can: end pending transmission on network stop (ifdown) + +From: Viktor Babrian + +commit 7ffd7b4e169d619e66928fe5d997723f2c6f1056 upstream. + +Put controller into init mode in network stop to end pending transmissions. The +issue is observed in cases when transmitted frame is not acked. + +Signed-off-by: Viktor Babrian +Cc: linux-stable +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/c_can/c_can.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/can/c_can/c_can.c ++++ b/drivers/net/can/c_can/c_can.c +@@ -611,6 +611,10 @@ static void c_can_stop(struct net_device + struct c_can_priv *priv = netdev_priv(dev); + + c_can_irq_control(priv, false); ++ ++ /* put ctrl to init on stop to end ongoing transmission */ ++ priv->write_reg(priv, C_CAN_CTRL_REG, CONTROL_INIT); ++ + priv->can.state = CAN_STATE_STOPPED; + } + diff --git a/queue-3.18/clocksource-arch_timer-only-use-the-virtual-counter.patch b/queue-3.18/clocksource-arch_timer-only-use-the-virtual-counter.patch new file mode 100644 index 00000000000..0b60f0850cc --- /dev/null +++ b/queue-3.18/clocksource-arch_timer-only-use-the-virtual-counter.patch @@ -0,0 +1,44 @@ +From d6ad36913083d683aad4e02e53580c995f1a6ede Mon Sep 17 00:00:00 2001 +From: Catalin Marinas +Date: Wed, 10 Dec 2014 11:02:09 +0000 +Subject: clocksource: arch_timer: Only use the virtual counter + (CNTVCT) on arm64 + +From: Catalin Marinas + +commit d6ad36913083d683aad4e02e53580c995f1a6ede upstream. + +Commit 0b46b8a718c6 (clocksource: arch_timer: Fix code to use physical +timers when requested) introduces the use of physical counters in the +ARM architected timer driver. However, he arm64 kernel uses CNTVCT in +VDSO. When booting in EL2, the kernel switches to the physical timers to +make things easier for KVM but it continues to use the virtual counter +both in user and kernel. While in such scenario CNTVCT == CNTPCT (since +CNTVOFF is initialised by the kernel to 0), we want to spot firmware +bugs corrupting CNTVOFF early (which would affect CNTVCT). + +Signed-off-by: Catalin Marinas +Tested-by: Yingjoe Chen +Cc: Daniel Lezcano +Signed-off-by: Arnd Bergmann +Fixes: 0b46b8a718c6 ("clocksource: arch_timer: Fix code to use physical +timers when requested") +Cc: Ian Campbell +Signed-off-by: Mark Rutland +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clocksource/arm_arch_timer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clocksource/arm_arch_timer.c ++++ b/drivers/clocksource/arm_arch_timer.c +@@ -462,7 +462,7 @@ static void __init arch_counter_register + + /* Register the CP15 based counter if we have one */ + if (type & ARCH_CP15_TIMER) { +- if (arch_timer_use_virtual) ++ if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual) + arch_timer_read_counter = arch_counter_get_cntvct; + else + arch_timer_read_counter = arch_counter_get_cntpct; diff --git a/queue-3.18/series b/queue-3.18/series index 992cd49a724..bae2ea097f6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -52,3 +52,6 @@ memcg-remove-extra-newlines-from-memcg-oom-kill-log.patch perf-x86-intel-add-model-number-for-airmont.patch perf-rapl-fix-crash-in-rapl_scale.patch hid-rmi-check-for-additional-acm-registers-appended-to-f11.patch +can-c_can-end-pending-transmission-on-network-stop-ifdown.patch +clocksource-arch_timer-only-use-the-virtual-counter.patch +xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch diff --git a/queue-3.18/xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch b/queue-3.18/xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch new file mode 100644 index 00000000000..eccbc5fd437 --- /dev/null +++ b/queue-3.18/xen-arm-arm64-introduce-xen_arch_need_swiotlb.patch @@ -0,0 +1,95 @@ +From a4dba130891271084344c12537731542ec77cb85 Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 21 Nov 2014 11:07:39 +0000 +Subject: xen/arm/arm64: introduce xen_arch_need_swiotlb + +From: Stefano Stabellini + +commit a4dba130891271084344c12537731542ec77cb85 upstream. + +Introduce an arch specific function to find out whether a particular dma +mapping operation needs to bounce on the swiotlb buffer. + +On ARM and ARM64, if the page involved is a foreign page and the device +is not coherent, we need to bounce because at unmap time we cannot +execute any required cache maintenance operations (we don't know how to +find the pfn from the mfn). + +No change of behaviour for x86. + +Signed-off-by: Stefano Stabellini +Reviewed-by: David Vrabel +Reviewed-by: Catalin Marinas +Acked-by: Ian Campbell +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/include/asm/xen/page.h | 4 ++++ + arch/arm/xen/mm.c | 7 +++++++ + arch/x86/include/asm/xen/page.h | 7 +++++++ + drivers/xen/swiotlb-xen.c | 5 ++++- + 4 files changed, 22 insertions(+), 1 deletion(-) + +--- a/arch/arm/include/asm/xen/page.h ++++ b/arch/arm/include/asm/xen/page.h +@@ -107,4 +107,8 @@ static inline bool set_phys_to_machine(u + #define xen_remap(cookie, size) ioremap_cache((cookie), (size)) + #define xen_unmap(cookie) iounmap((cookie)) + ++bool xen_arch_need_swiotlb(struct device *dev, ++ unsigned long pfn, ++ unsigned long mfn); ++ + #endif /* _ASM_ARM_XEN_PAGE_H */ +--- a/arch/arm/xen/mm.c ++++ b/arch/arm/xen/mm.c +@@ -16,6 +16,13 @@ + #include + #include + ++bool xen_arch_need_swiotlb(struct device *dev, ++ unsigned long pfn, ++ unsigned long mfn) ++{ ++ return (pfn != mfn); ++} ++ + int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, + unsigned int address_bits, + dma_addr_t *dma_handle) +--- a/arch/x86/include/asm/xen/page.h ++++ b/arch/x86/include/asm/xen/page.h +@@ -236,4 +236,11 @@ void make_lowmem_page_readwrite(void *va + #define xen_remap(cookie, size) ioremap((cookie), (size)); + #define xen_unmap(cookie) iounmap((cookie)) + ++static inline bool xen_arch_need_swiotlb(struct device *dev, ++ unsigned long pfn, ++ unsigned long mfn) ++{ ++ return false; ++} ++ + #endif /* _ASM_X86_XEN_PAGE_H */ +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -397,7 +397,9 @@ dma_addr_t xen_swiotlb_map_page(struct d + * buffering it. + */ + if (dma_capable(dev, dev_addr, size) && +- !range_straddles_page_boundary(phys, size) && !swiotlb_force) { ++ !range_straddles_page_boundary(phys, size) && ++ !xen_arch_need_swiotlb(dev, PFN_DOWN(phys), PFN_DOWN(dev_addr)) && ++ !swiotlb_force) { + /* we are not interested in the dma_addr returned by + * xen_dma_map_page, only in the potential cache flushes executed + * by the function. */ +@@ -555,6 +557,7 @@ xen_swiotlb_map_sg_attrs(struct device * + dma_addr_t dev_addr = xen_phys_to_bus(paddr); + + if (swiotlb_force || ++ xen_arch_need_swiotlb(hwdev, PFN_DOWN(paddr), PFN_DOWN(dev_addr)) || + !dma_capable(hwdev, dev_addr, sg->length) || + range_straddles_page_boundary(paddr, sg->length)) { + phys_addr_t map = swiotlb_tbl_map_single(hwdev, -- 2.47.3