* [PATCH 3.16 156/366] MIPS: io: Add barrier after register read in inX()
[not found] <lsq.1541965744.387173642@decadent.org.uk>
2018-11-11 19:49 ` [PATCH 3.16 261/366] MIPS: Fix off-by-one in pci_resource_to_user() Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 348/366] MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA Ben Hutchings
@ 2018-11-11 19:49 ` Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 183/366] time: Make sure jiffies_to_msecs() preserves non-zero time periods Ben Hutchings
4 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2018-11-11 19:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, James Hogan, Fuxin Zhang, Huacai Chen, Huacai Chen,
linux-mips, Paul Burton, Zhangjin Wu
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <chenhc@lemote.com>
commit 18f3e95b90b28318ef35910d21c39908de672331 upstream.
While a barrier is present in the outX() functions before the register
write, a similar barrier is missing in the inX() functions after the
register read. This could allow memory accesses following inX() to
observe stale data.
This patch is very similar to commit a1cc7034e33d12dc1 ("MIPS: io: Add
barrier after register read in readX()"). Because war_io_reorder_wmb()
is both used by writeX() and outX(), if readX() need a barrier then so
does inX().
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Patchwork: https://patchwork.linux-mips.org/patch/19516/
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/mips/include/asm/io.h | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -410,6 +410,8 @@ static inline type pfx##in##bwlq##p(unsi
__val = *__addr; \
slow; \
\
+ /* prevent prefetching of coherent DMA data prematurely */ \
+ rmb(); \
return pfx##ioswab##bwlq(__addr, __val); \
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3.16 348/366] MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA
[not found] <lsq.1541965744.387173642@decadent.org.uk>
2018-11-11 19:49 ` [PATCH 3.16 261/366] MIPS: Fix off-by-one in pci_resource_to_user() Ben Hutchings
@ 2018-11-11 19:49 ` Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 156/366] MIPS: io: Add barrier after register read in inX() Ben Hutchings
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2018-11-11 19:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, Ralf Baechle, Markos Chandras, Paul Burton, linux-mips,
James Hogan
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Markos Chandras <markos.chandras@imgtec.com>
commit 2bd7bc254ab1f45269db6dd7957d63b713817408 upstream.
This silences warnings like the following one when building with the
latest binutils:
arch/mips/kernel/genex.S: Assembler messages:
arch/mips/kernel/genex.S:438: Warning: the `msa' extension requires 64-bit FPRs
[ralf@linux-mips.org: Markos says binutils 2.25 and some 2.24 snapshots
are affected.]
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9745/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/mips/include/asm/asmmacro.h | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -209,9 +209,13 @@
.endm
#ifdef TOOLCHAIN_SUPPORTS_MSA
+/* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */
+#undef fp
+
.macro _cfcmsa rd, cs
.set push
.set mips32r2
+ .set fp=64
.set msa
cfcmsa \rd, $\cs
.set pop
@@ -220,6 +224,7 @@
.macro _ctcmsa cd, rs
.set push
.set mips32r2
+ .set fp=64
.set msa
ctcmsa $\cd, \rs
.set pop
@@ -228,6 +233,7 @@
.macro ld_d wd, off, base
.set push
.set mips32r2
+ .set fp=64
.set msa
ld.d $w\wd, \off(\base)
.set pop
@@ -236,6 +242,7 @@
.macro st_d wd, off, base
.set push
.set mips32r2
+ .set fp=64
.set msa
st.d $w\wd, \off(\base)
.set pop
@@ -244,6 +251,7 @@
.macro copy_u_w ws, n
.set push
.set mips32r2
+ .set fp=64
.set msa
copy_u.w $1, $w\ws[\n]
.set pop
@@ -252,6 +260,7 @@
.macro copy_u_d ws, n
.set push
.set mips64r2
+ .set fp=64
.set msa
copy_u.d $1, $w\ws[\n]
.set pop
@@ -260,6 +269,7 @@
.macro insert_w wd, n
.set push
.set mips32r2
+ .set fp=64
.set msa
insert.w $w\wd[\n], $1
.set pop
@@ -268,6 +278,7 @@
.macro insert_d wd, n
.set push
.set mips64r2
+ .set fp=64
.set msa
insert.d $w\wd[\n], $1
.set pop
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3.16 261/366] MIPS: Fix off-by-one in pci_resource_to_user()
[not found] <lsq.1541965744.387173642@decadent.org.uk>
@ 2018-11-11 19:49 ` Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 348/366] MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA Ben Hutchings
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2018-11-11 19:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, Paul Burton, Rui Wang, Ralf Baechle, James Hogan,
Wolfgang Grandegger, linux-mips
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <paul.burton@mips.com>
commit 38c0a74fe06da3be133cae3fb7bde6a9438e698b upstream.
The MIPS implementation of pci_resource_to_user() introduced in v3.12 by
commit 4c2924b725fb ("MIPS: PCI: Use pci_resource_to_user to map pci
memory space properly") incorrectly sets *end to the address of the
byte after the resource, rather than the last byte of the resource.
This results in userland seeing resources as a byte larger than they
actually are, for example a 32 byte BAR will be reported by a tool such
as lspci as being 33 bytes in size:
Region 2: I/O ports at 1000 [disabled] [size=33]
Correct this by subtracting one from the calculated end address,
reporting the correct address to userland.
Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Rui Wang <rui.wang@windriver.com>
Fixes: 4c2924b725fb ("MIPS: PCI: Use pci_resource_to_user to map pci memory space properly")
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/19829/
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/mips/include/asm/pci.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -87,7 +87,7 @@ static inline void pci_resource_to_user(
phys_t size = resource_size(rsrc);
*start = fixup_bigphys_addr(rsrc->start, size);
- *end = rsrc->start + size;
+ *end = rsrc->start + size - 1;
}
/*
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum
[not found] <lsq.1541965744.387173642@decadent.org.uk>
` (2 preceding siblings ...)
2018-11-11 19:49 ` [PATCH 3.16 156/366] MIPS: io: Add barrier after register read in inX() Ben Hutchings
@ 2018-11-11 19:49 ` Ben Hutchings
2018-11-11 20:17 ` Rafał Miłecki
2018-11-11 19:49 ` [PATCH 3.16 183/366] time: Make sure jiffies_to_msecs() preserves non-zero time periods Ben Hutchings
4 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2018-11-11 19:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, Paul Burton, Hauke Mehrtens, linux-mips,
Rafał Miłecki, Chris Packham, James Hogan,
Tokunori Ikegami
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tokunori Ikegami <ikegami@allied-telesis.co.jp>
commit 2a027b47dba6b77ab8c8e47b589ae9bbc5ac6175 upstream.
The erratum and workaround are described by BCM5300X-ES300-RDS.pdf as
below.
R10: PCIe Transactions Periodically Fail
Description: The BCM5300X PCIe does not maintain transaction ordering.
This may cause PCIe transaction failure.
Fix Comment: Add a dummy PCIe configuration read after a PCIe
configuration write to ensure PCIe configuration access
ordering. Set ES bit of CP0 configu7 register to enable
sync function so that the sync instruction is functional.
Resolution: hndpci.c: extpci_write_config()
hndmips.c: si_mips_init()
mipsinc.h CONF7_ES
This is fixed by the CFE MIPS bcmsi chipset driver also for BCM47XX.
Also the dummy PCIe configuration read is already implemented in the
Linux BCMA driver.
Enable ExternalSync in Config7 when CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y
too so that the sync instruction is externalised.
Signed-off-by: Tokunori Ikegami <ikegami@allied-telesis.co.jp>
Reviewed-by: Paul Burton <paul.burton@mips.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/19461/
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/mips/bcm47xx/setup.c | 6 ++++++
arch/mips/include/asm/mipsregs.h | 3 +++
2 files changed, 9 insertions(+)
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -253,6 +253,12 @@ static int __init bcm47xx_cpu_fixes(void
*/
if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706)
cpu_wait = NULL;
+
+ /*
+ * BCM47XX Erratum "R10: PCIe Transactions Periodically Fail"
+ * Enable ExternalSync for sync instruction to take effect
+ */
+ set_c0_config7(MIPS_CONF7_ES);
break;
#endif
}
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -674,6 +674,8 @@
#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
+/* ExternalSync */
+#define MIPS_CONF7_ES (_ULCAST_(1) << 8)
#define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
#define MIPS_CONF7_AR (_ULCAST_(1) << 16)
@@ -1817,6 +1819,7 @@ __BUILD_SET_C0(status)
__BUILD_SET_C0(cause)
__BUILD_SET_C0(config)
__BUILD_SET_C0(config5)
+__BUILD_SET_C0(config7)
__BUILD_SET_C0(intcontrol)
__BUILD_SET_C0(intctl)
__BUILD_SET_C0(srsmap)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3.16 183/366] time: Make sure jiffies_to_msecs() preserves non-zero time periods
[not found] <lsq.1541965744.387173642@decadent.org.uk>
` (3 preceding siblings ...)
2018-11-11 19:49 ` [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum Ben Hutchings
@ 2018-11-11 19:49 ` Ben Hutchings
4 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2018-11-11 19:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, Arnd Bergmann, Geert Uytterhoeven, linux-mips,
Thomas Gleixner, Stephen Boyd, John Stultz, linux-alpha
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert@linux-m68k.org>
commit abcbcb80cd09cd40f2089d912764e315459b71f7 upstream.
For the common cases where 1000 is a multiple of HZ, or HZ is a multiple of
1000, jiffies_to_msecs() never returns zero when passed a non-zero time
period.
However, if HZ > 1000 and not an integer multiple of 1000 (e.g. 1024 or
1200, as used on alpha and DECstation), jiffies_to_msecs() may return zero
for small non-zero time periods. This may break code that relies on
receiving back a non-zero value.
jiffies_to_usecs() does not need such a fix: one jiffy can only be less
than one µs if HZ > 1000000, and such large values of HZ are already
rejected at build time, twice:
- include/linux/jiffies.h does #error if HZ >= 12288,
- kernel/time/time.c has BUILD_BUG_ON(HZ > USEC_PER_SEC).
Broken since forever.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Link: https://lkml.kernel.org/r/20180622143357.7495-1-geert@linux-m68k.org
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
kernel/time.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -28,6 +28,7 @@
*/
#include <linux/export.h>
+#include <linux/kernel.h>
#include <linux/timex.h>
#include <linux/capability.h>
#include <linux/timekeeper_internal.h>
@@ -253,9 +254,10 @@ unsigned int jiffies_to_msecs(const unsi
return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
#else
# if BITS_PER_LONG == 32
- return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
+ return (HZ_TO_MSEC_MUL32 * j + (1ULL << HZ_TO_MSEC_SHR32) - 1) >>
+ HZ_TO_MSEC_SHR32;
# else
- return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
+ return DIV_ROUND_UP(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN);
# endif
#endif
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum
2018-11-11 19:49 ` [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum Ben Hutchings
@ 2018-11-11 20:17 ` Rafał Miłecki
2018-11-20 17:51 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: Rafał Miłecki @ 2018-11-11 20:17 UTC (permalink / raw)
To: Ben Hutchings
Cc: Linux Kernel Mailing List, Stable, Andrew Morton, Paul Burton,
Hauke Mehrtens, linux-mips@linux-mips.org, Chris Packham,
James Hogan, Tokunori Ikegami
On Sun, 11 Nov 2018 at 21:05, Ben Hutchings <ben@decadent.org.uk> wrote:
> 3.16.61-rc1 review patch. If anyone has any objections, please let me know.
Nack. This patch has caused a regression and had to be reverted.
Please check upstream repository for a revert (search git log for
2a027b47dba6).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum
2018-11-11 20:17 ` Rafał Miłecki
@ 2018-11-20 17:51 ` Ben Hutchings
0 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2018-11-20 17:51 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Linux Kernel Mailing List, Stable, Andrew Morton, Paul Burton,
Hauke Mehrtens, linux-mips@linux-mips.org, Chris Packham,
James Hogan, Tokunori Ikegami
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
On Sun, 2018-11-11 at 21:17 +0100, Rafał Miłecki wrote:
> On Sun, 11 Nov 2018 at 21:05, Ben Hutchings <ben@decadent.org.uk> wrote:
> > 3.16.61-rc1 review patch. If anyone has any objections, please let me know.
>
> Nack. This patch has caused a regression and had to be reverted.
> Please check upstream repository for a revert (search git log for
> 2a027b47dba6).
I've dropped this from the queue, thanks.
Ben.
--
Ben Hutchings
Time is nature's way of making sure that
everything doesn't happen at once.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-11-20 17:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <lsq.1541965744.387173642@decadent.org.uk>
2018-11-11 19:49 ` [PATCH 3.16 261/366] MIPS: Fix off-by-one in pci_resource_to_user() Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 348/366] MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 156/366] MIPS: io: Add barrier after register read in inX() Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum Ben Hutchings
2018-11-11 20:17 ` Rafał Miłecki
2018-11-20 17:51 ` Ben Hutchings
2018-11-11 19:49 ` [PATCH 3.16 183/366] time: Make sure jiffies_to_msecs() preserves non-zero time periods Ben Hutchings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox