4.4.55-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 4.4.55-stable review
This is the start of the stable review cycle for the 4.4.55 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Mar 18 14:28:52 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.55-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.4.55-rc1
Theodore Ts'o <[email protected]>
ext4: don't BUG when truncating encrypted inodes on the orphan list
Mikulas Patocka <[email protected]>
dm: flush queued bios when process blocks to avoid deadlock
Dan Williams <[email protected]>
nfit, libnvdimm: fix interleave set cookie calculation
Michael Holzheu <[email protected]>
s390/kdump: Use "LINUX" ELF note name instead of "CORE"
Janosch Frank <[email protected]>
KVM: s390: Fix guest migration for huge guests resulting in panic
Luis de Bethencourt <[email protected]>
mvsas: fix misleading indentation
Krzysztof Kozlowski <[email protected]>
serial: samsung: Continue to work if DMA request fails
Johan Hovold <[email protected]>
USB: serial: io_ti: fix information leak in completion handler
Johan Hovold <[email protected]>
USB: serial: io_ti: fix NULL-deref in interrupt callback
Johan Hovold <[email protected]>
USB: iowarrior: fix NULL-deref in write
Johan Hovold <[email protected]>
USB: iowarrior: fix NULL-deref at probe
Johan Hovold <[email protected]>
USB: serial: omninet: fix reference leaks at open
Johan Hovold <[email protected]>
USB: serial: safe_serial: fix information leak in completion handler
Guenter Roeck <[email protected]>
usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers
Peter Chen <[email protected]>
usb: host: xhci-dbg: HCIVERSION should be a binary number
Felipe Balbi <[email protected]>
usb: gadget: function: f_fs: pass companion descriptor along
Felipe Balbi <[email protected]>
usb: dwc3: gadget: make Set Endpoint Configuration macros safe
Peter Chen <[email protected]>
usb: gadget: dummy_hcd: clear usb_gadget region before registration
Ravi Bangoria <[email protected]>
powerpc: Emulation support for load/store instructions on LE
Rik van Riel <[email protected]>
tracing: Add #undef to fix compile error
James Hogan <[email protected]>
MIPS: Netlogic: Fix CP0_EBASE redefinition warnings
Ralf Baechle <[email protected]>
MIPS: DEC: Avoid la pseudo-instruction in delay slots
Arnd Bergmann <[email protected]>
mm: memcontrol: avoid unused function warning
Arnd Bergmann <[email protected]>
cpmac: remove hopeless #warning
Arnd Bergmann <[email protected]>
MIPS: ralink: Remove unused rt*_wdt_reset functions
John Crispin <[email protected]>
MIPS: ralink: Cosmetic change to prom_init().
Arnd Bergmann <[email protected]>
mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
Arnd Bergmann <[email protected]>
MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Arnd Bergmann <[email protected]>
MIPS: ip22: Fix ip28 build for modern gcc
Arnd Bergmann <[email protected]>
MIPS: Update ip27_defconfig for SCSI_DH change
Arnd Bergmann <[email protected]>
MIPS: ip27: Disable qlge driver in defconfig
Arnd Bergmann <[email protected]>
MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Arnd Bergmann <[email protected]>
crypto: improve gcc optimization flags for serpent and wp512
Johan Hovold <[email protected]>
USB: serial: digi_acceleport: fix OOB-event processing
Johan Hovold <[email protected]>
USB: serial: digi_acceleport: fix OOB data sanity check
-------------
Diffstat:
Makefile | 4 +-- arch/mips/configs/ip22_defconfig | 4 +-- arch/mips/configs/ip27_defconfig | 3 +- arch/mips/configs/lemote2f_defconfig | 2 +- arch/mips/configs/malta_defconfig | 4 +-- arch/mips/configs/malta_kvm_defconfig | 4 +-- arch/mips/configs/malta_kvm_guest_defconfig | 4 +-- arch/mips/configs/maltaup_xpa_defconfig | 4 +-- arch/mips/configs/nlm_xlp_defconfig | 2 +- arch/mips/configs/nlm_xlr_defconfig | 2 +- arch/mips/dec/int-handler.S | 40 +++++++++++++++++++-- arch/mips/netlogic/common/reset.S | 11 +++--- arch/mips/netlogic/common/smpboot.S | 4 +-- arch/mips/ralink/prom.c | 9 +++-- arch/mips/ralink/rt288x.c | 10 ------ arch/mips/ralink/rt305x.c | 11 ------ arch/mips/ralink/rt3883.c | 10 ------ arch/mips/sgi-ip22/Platform | 2 +- arch/powerpc/lib/sstep.c | 20 ----------- arch/s390/kernel/crash_dump.c | 18 +++++----- arch/s390/mm/pgtable.c | 19 +++++++++- crypto/Makefile | 2 ++ drivers/acpi/nfit.c | 16 ++++++++- drivers/md/dm.c | 55 +++++++++++++++++++++++++++++ drivers/mtd/maps/pmcmsp-flash.c | 4 +-- drivers/net/ethernet/ti/cpmac.c | 2 +- drivers/nvdimm/namespace_devs.c | 28 +++++++++++---- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/region_devs.c | 9 +++++ drivers/scsi/mvsas/mv_sas.c | 4 +-- drivers/tty/serial/samsung.c | 6 ++-- drivers/usb/dwc3/gadget.h | 14 ++++---- drivers/usb/gadget/function/f_fs.c | 15 ++++++-- drivers/usb/gadget/udc/dummy_hcd.c | 2 ++ drivers/usb/host/xhci-dbg.c | 2 +- drivers/usb/host/xhci-plat.c | 2 ++ drivers/usb/misc/iowarrior.c | 21 +++++++---- drivers/usb/serial/digi_acceleport.c | 14 +++++--- drivers/usb/serial/io_ti.c | 8 ++++- drivers/usb/serial/omninet.c | 6 ---- drivers/usb/serial/safe_serial.c | 5 +++ fs/ext4/inode.c | 4 +++ include/linux/libnvdimm.h | 2 ++ include/trace/events/syscalls.h | 1 + mm/memcontrol.c | 36 +++++++++---------- 45 files changed, 290 insertions(+), 156 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/35 USB: serial: digi_acceleport: fix OOB data sanity check
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 2d380889215fe20b8523345649dee0579821800c upstream.
Make sure to check for short transfers to avoid underflow in a loop condition when parsing the receive buffer.
Also fix an off-by-one error in the incomplete sanity check which could lead to invalid data being parsed.
--- drivers/usb/serial/digi_acceleport.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/usb/serial/digi_acceleport.c +9 -5
@@ -1483,16 +1483,20 @@ static int digi_read_oob_callback(structstruct usb_serial *serial = port->serial;struct tty_struct *tty;struct digi_port *priv =usb_get_serial_port_data (port); +unsigned char *buf = urb->transfer_buffer;int opcode, line, status, val;int i;unsigned int rts; +if (urb->actual_length <4 ) +return -1 ; +/* handle each oob command */ -for (i =0 ; i < urb->actual_length -3 ;) { - opcode = ((unsigned char *)urb->transfer_buffer)[i++]; - line = ((unsigned char *)urb->transfer_buffer)[i++]; - status = ((unsigned char *)urb->transfer_buffer)[i++]; - val = ((unsigned char *)urb->transfer_buffer)[i++]; +for (i =0 ; i < urb->actual_length -4 ; i +=4 ) { + opcode = buf[i]; + line = buf[i +1 ]; + status = buf[i +2 ]; + val = buf[i +3 ];dev_dbg (&port->dev,"digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d\n" , opcode, line, status, val);
Greg Kroah-Hartman
maintainerPATCH 2/35 USB: serial: digi_acceleport: fix OOB-event processing
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 2e46565cf622dd0534a9d8bffe152a577b48d7aa upstream.
A recent change claimed to fix an off-by-one error in the OOB-port completion handler, but instead introduced such an error. This could specifically led to modem-status changes going unnoticed, effectively breaking TIOCMGET.
Note that the offending commit fixes a loop-condition underflow and is marked for stable, but should not be backported without this fix.
check")
--- drivers/usb/serial/digi_acceleport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/digi_acceleport.c +1 -1
@@ -1492,7 +1492,7 @@ static int digi_read_oob_callback(structreturn -1 ;/* handle each oob command */ -for (i =0 ; i < urb->actual_length -4 ; i +=4 ) { +for (i =0 ; i < urb->actual_length -3 ; i +=4 ) { opcode = buf[i]; line = buf[i +1 ]; status = buf[i +2 ];
Greg Kroah-Hartman
maintainerPATCH 3/35 crypto: improve gcc optimization flags for serpent and wp512
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 7d6e9105026788c497f0ab32fa16c82f4ab5ff61 upstream.
An ancient gcc bug (first reported in 2003) has apparently resurfaced on MIPS, where kernelci.org reports an overly large stack frame in the whirlpool hash algorithm:
crypto/wp512.c:987:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]
With some testing in different configurations, I'm seeing large variations in stack frames size up to 1500 bytes for what should have around 300 bytes at most. I also checked the reference implementation, which is essentially the same code but also comes with some test and benchmarking infrastructure.
It seems that recent compiler versions on at least arm, arm64 and powerpc have a partial fix for this problem, but enabling "-fsched-pressure", but even with that fix they suffer from the issue to a certain degree. Some testing on arm64 shows that the time needed to hash a given amount of data is roughly proportional to the stack frame size here, which makes sense given that the wp512 implementation is doing lots of loads for table lookups, and the problem with the overly large stack is a result of doing a lot more loads and stores for spilled registers (as seen from inspecting the object code).
Disabling -fschedule-insns consistently fixes the problem for wp512, in my collection of cross-compilers, the results are consistently better or identical when comparing the stack sizes in this function, though some architectures (notable x86) have schedule-insns disabled by default.
The four columns are:
default: -O2
press: -O2 -fsched-pressure
nopress: -O2 -fschedule-insns -fno-sched-pressure
nosched: -O2 -no-schedule-insns (disables sched-pressure)
default press nopress nosched
alpha-linux-gcc-4.9.3 1136 848 1136 176
am33_2.0-linux-gcc-4.9.3 2100 2076 2100 2104
arm-linux-gnueabi-gcc-4.9.3 848 848 1048 352
cris-linux-gcc-4.9.3 272 272 272 272
frv-linux-gcc-4.9.3 1128 1000 1128 280
hppa64-linux-gcc-4.9.3 1128 336 1128 184
hppa-linux-gcc-4.9.3 644 308 644 276
i386-linux-gcc-4.9.3 352 352 352 352
m32r-linux-gcc-4.9.3 720 656 720 268
microblaze-linux-gcc-4.9.3 1108 604 1108 256
mips64-linux-gcc-4.9.3 1328 592 1328 208
mips-linux-gcc-4.9.3 1096 624 1096 240
powerpc64-linux-gcc-4.9.3 1088 432 1088 160
powerpc-linux-gcc-4.9.3 1080 584 1080 224
s390-linux-gcc-4.9.3 456 456 624 360
sh3-linux-gcc-4.9.3 292 292 292 292
sparc64-linux-gcc-4.9.3 992 240 992 208
sparc-linux-gcc-4.9.3 680 592 680 312
x86_64-linux-gcc-4.9.3 224 240 272 224
xtensa-linux-gcc-4.9.3 1152 704 1152 304
aarch64-linux-gcc-7.0.0 224 224 1104 208
arm-linux-gnueabi-gcc-7.0.1 824 824 1048 352
mips-linux-gcc-7.0.0 1120 648 1120 272
x86_64-linux-gcc-7.0.1 240 240 304 240
arm-linux-gnueabi-gcc-4.4.7 840 392
arm-linux-gnueabi-gcc-4.5.4 784 728 784 320
arm-linux-gnueabi-gcc-4.6.4 736 728 736 304
arm-linux-gnueabi-gcc-4.7.4 944 784 944 352
arm-linux-gnueabi-gcc-4.8.5 464 464 760 352
arm-linux-gnueabi-gcc-4.9.3 848 848 1048 352
arm-linux-gnueabi-gcc-5.3.1 824 824 1064 336
arm-linux-gnueabi-gcc-6.1.1 808 808 1056 344
arm-linux-gnueabi-gcc-7.0.1 824 824 1048 352
Trying the same test for serpent-generic, the picture is a bit different, and while -fno-schedule-insns is generally better here than the default, -fsched-pressure wins overall, so I picked that instead.
default press nopress nosched
alpha-linux-gcc-4.9.3 1392 864 1392 960
am33_2.0-linux-gcc-4.9.3 536 524 536 528
arm-linux-gnueabi-gcc-4.9.3 552 552 776 536
cris-linux-gcc-4.9.3 528 528 528 528
frv-linux-gcc-4.9.3 536 400 536 504
hppa64-linux-gcc-4.9.3 524 208 524 480
hppa-linux-gcc-4.9.3 768 472 768 508
i386-linux-gcc-4.9.3 564 564 564 564
m32r-linux-gcc-4.9.3 712 576 712 532
microblaze-linux-gcc-4.9.3 724 392 724 512
mips64-linux-gcc-4.9.3 720 384 720 496
mips-linux-gcc-4.9.3 728 384 728 496
powerpc64-linux-gcc-4.9.3 704 304 704 480
powerpc-linux-gcc-4.9.3 704 296 704 480
s390-linux-gcc-4.9.3 560 560 592 536
sh3-linux-gcc-4.9.3 540 540 540 540
sparc64-linux-gcc-4.9.3 544 352 544 496
sparc-linux-gcc-4.9.3 544 344 544 496
x86_64-linux-gcc-4.9.3 528 536 576 528
xtensa-linux-gcc-4.9.3 752 544 752 544
aarch64-linux-gcc-7.0.0 432 432 656 480
arm-linux-gnueabi-gcc-7.0.1 616 616 808 536
mips-linux-gcc-7.0.0 720 464 720 488
x86_64-linux-gcc-7.0.1 536 528 600 536
arm-linux-gnueabi-gcc-4.4.7 592 440
arm-linux-gnueabi-gcc-4.5.4 776 448 776 544
arm-linux-gnueabi-gcc-4.6.4 776 448 776 544
arm-linux-gnueabi-gcc-4.7.4 768 448 768 544
arm-linux-gnueabi-gcc-4.8.5 488 488 776 544
arm-linux-gnueabi-gcc-4.9.3 552 552 776 536
arm-linux-gnueabi-gcc-5.3.1 552 552 776 536
arm-linux-gnueabi-gcc-6.1.1 560 560 776 536
arm-linux-gnueabi-gcc-7.0.1 616 616 808 536
I did not do any runtime tests with serpent, so it is possible that stack frame size does not directly correlate with runtime performance here and it actually makes things worse, but it's more likely to help here, and the reduced stack frame size is probably enough reason to apply the patch, especially given that the crypto code is often used in deep call chains.
--- crypto/Makefile | 2 ++ 1 file changed, 2 insertions(+)
crypto/Makefile +2 -0
@@ -62,6 +62,7 @@ obj-$(CONFIG_CRYPTO_SHA1) += sha1_generi obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o obj-$(CONFIG_CRYPTO_WP512) += wp512.o +CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o obj-$(CONFIG_CRYPTO_ECB) += ecb.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o +CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_AES) += aes_generic.o obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o
Greg Kroah-Hartman
maintainerPATCH 4/35 MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:
arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
This changes all the MIPS defconfigs with these symbols to have them built-in.
Patchwork: https://patchwork.linux-mips.org/patch/14999/
--- arch/mips/configs/ip22_defconfig | 4 ++-- arch/mips/configs/malta_defconfig | 4 ++-- arch/mips/configs/malta_kvm_defconfig | 4 ++-- arch/mips/configs/malta_kvm_guest_defconfig | 4 ++-- arch/mips/configs/maltaup_xpa_defconfig | 4 ++-- arch/mips/configs/nlm_xlp_defconfig | 2 +- arch/mips/configs/nlm_xlr_defconfig | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-)
arch/mips/configs/ip22_defconfig +2 -2
@@ -68,8 +68,8 @@ CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_DCCP=m -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/malta_defconfig +2 -2
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_DCCP=m -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/malta_kvm_defconfig +2 -2
@@ -60,8 +60,8 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_DCCP=m -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/malta_kvm_guest_defconfig +2 -2
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_DCCP=m -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/maltaup_xpa_defconfig +2 -2
@@ -61,8 +61,8 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_DCCP=m -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/nlm_xlp_defconfig +1 -1
@@ -111,7 +111,7 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/nlm_xlr_defconfig +1 -1
@@ -91,7 +91,7 @@ CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_SECMARK=y CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CT_PROTO_UDPLITE=y CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Quoted 18 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1upstream.In linux-4.10-rc,
NF_CT_PROTO_UDPLITEandNF_CT_PROTO_DCCPare bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for
NF_CT_PROTO_UDPLITEarch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEarch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITE
Quoted 5 lines
This changes all the MIPS defconfigs with these symbols to have them built-in.
Fixes 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")Fixes c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
[...]
I don't think this was needed for 4.4 or 4.9, as those symbols were still tristate type.
Ben.
Signature · 4 lines
Ben Hutchings Power corrupts. Absolute power is kind of neat. - John Lehman, Secretary of the US Navy 1981-1987
Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Quoted 34 lines · Ben Hutchings
Date: Sun, 19 Mar 2017 16:05:16 +0000
From: Ben Hutchings <[email protected]>
To: Greg Kroah-Hartman <[email protected]>,
[email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>,
[email protected], Ralf Baechle <[email protected]>
Subject: Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for
NF_CT_PROTO_DCCP/UDPLITE changeContent-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature";boundary="=-AwAI9QrjXVRk/IPasf40"
Quoted 21 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1upstream.In linux-4.10-rc,
NF_CT_PROTO_UDPLITEandNF_CT_PROTO_DCCPare bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for
NF_CT_PROTO_UDPLITEarch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEarch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEThis changes all the MIPS defconfigs with these symbols to have them built-in.
Quoted 6 lines
Quoted 2 lines
Fixes 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")Fixes c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")[...]
I don't think this was needed for 4.4 or 4.9, as those symbols were still tristate type.
Indeed, there's no waring for "make ARCH=mips malta_kvm_guest_defconfig".
Ralf
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
In reply to Ben HutchingsQuoted 22 lines · Ben Hutchings
Quoted 21 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1upstream.In linux-4.10-rc,
NF_CT_PROTO_UDPLITEandNF_CT_PROTO_DCCPare bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for
NF_CT_PROTO_UDPLITEarch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEarch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEThis changes all the MIPS defconfigs with these symbols to have them built-in.
Quoted 6 lines
Quoted 2 lines
Fixes 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")Fixes c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")[...]
I don't think this was needed for 4.4 or 4.9, as those symbols were still tristate type.
I don't know, Arnd was the one that reported it to me.
Arnd?
greg k-h
Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Ben Hutchings
Quoted 23 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1upstream.In linux-4.10-rc,
NF_CT_PROTO_UDPLITEandNF_CT_PROTO_DCCPare bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for
NF_CT_PROTO_UDPLITEarch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEarch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEThis changes all the MIPS defconfigs with these symbols to have them built-in.
Fixes 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")Fixes c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
Quoted 8 lines
Quoted 4 lines
[...]
I don't think this was needed for 4.4 or 4.9, as those symbols were still tristate type.
I don't know, Arnd was the one that reported it to me.
Arnd?
I thought I had only reported it for the v4.10-stable tree. I was a bit vague about which of the ones I reported were needed on older trees as well, but the changelog text is fairly specific.
Arnd
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Quoted 32 lines · Arnd Bergmann
Quoted 30 lines · Greg Kroah-Hartman
Quoted 28 lines · Ben Hutchings
Quoted 18 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1upstream.In linux-4.10-rc,
NF_CT_PROTO_UDPLITEandNF_CT_PROTO_DCCPare bool symbols instead of tristate, and kernelci.org reports a bunch of warnings for this, like:arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for
NF_CT_PROTO_UDPLITEarch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEarch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid forNF_CT_PROTO_DCCParch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid forNF_CT_PROTO_UDPLITEQuoted 5 lines
This changes all the MIPS defconfigs with these symbols to have them built-in.
Fixes 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")Fixes c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")[...]
I don't think this was needed for 4.4 or 4.9, as those symbols were still tristate type.
Quoted 7 lines
Quoted 3 lines
I don't know, Arnd was the one that reported it to me.
Arnd?
I thought I had only reported it for the v4.10-stable tree. I was a bit vague about which of the ones I reported were needed on older trees as well, but the changelog text is fairly specific.
You reported it there, but then on your other emails for other stable trees, said that your previously mentioned patches fixed problems in these trees as well. A bit confusing, sorry I got it wrong.
Anyway, not a big deal, is this worth me reverting? Does this cause an issue with these arches on older kernels?
thanks,
greg k-h
Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Quoted 6 lines · Greg Kroah-Hartman
You reported it there, but then on your other emails for other stable trees, said that your previously mentioned patches fixed problems in these trees as well. A bit confusing, sorry I got it wrong.
Anyway, not a big deal, is this worth me reverting? Does this cause an issue with these arches on older kernels?
Can't imagine this is going to cause an issue and in case of doubt a "y" should be safer than a "m" anyway ...
Ralf
Greg Kroah-Hartman
maintainerPATCH 5/35 MIPS: ip27: Disable qlge driver in defconfig
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit b617649468390713db1515ea79fc772d2eb897a8 upstream.
One of the last remaining failures in kernelci.org is for a gcc bug:
drivers/net/ethernet/qlogic/qlge/qlge_main.c:4819:1: error: insn does not satisfy its constraints:drivers/net/ethernet/qlogic/qlge/qlge_main.c:4819:1: internal compiler error: in extract_constrain_insn, at recog.c:2190
This is apparently broken in gcc-6 but fixed in gcc-7, and I cannot reproduce the problem here. However, it is clear that ip27_defconfig does not actually need this driver as the platform has only PCI-X but not PCIe, and the qlge adapter in turn is PCIe-only.
The driver was originally enabled in 2010 along with lots of other drivers.
Patchwork: https://patchwork.linux-mips.org/patch/15197/
--- arch/mips/configs/ip27_defconfig | 1 - 1 file changed, 1 deletion(-)
arch/mips/configs/ip27_defconfig +0 -1
@@ -206,7 +206,6 @@ CONFIG_MLX4_EN=m # CONFIG_MLX4_DEBUG is not set CONFIG_TEHUTI=m CONFIG_BNX2X=m -CONFIG_QLGE=m CONFIG_SFC=m CONFIG_BE2NET=m CONFIG_LIBERTAS_THINFIRM=m
Greg Kroah-Hartman
maintainerPATCH 6/35 MIPS: Update ip27_defconfig for SCSI_DH change
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit ea58fca1842a5dc410cae4167b01643db971a4e2 upstream.
Since linux-4.3, SCSI_DH is a bool symbol, causing a warning in kernelci.org:
arch/mips/configs/ip27_defconfig:136:warning: symbol value 'm' invalid for SCSI_DH
This updates the defconfig to have the feature built-in.
Patchwork: https://patchwork.linux-mips.org/patch/15001/
--- arch/mips/configs/ip27_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/configs/ip27_defconfig +1 -1
@@ -134,7 +134,7 @@ CONFIG_LIBFC=m CONFIG_SCSI_QLOGIC_1280=y CONFIG_SCSI_PMCRAID=m CONFIG_SCSI_BFA_FC=m -CONFIG_SCSI_DH=m +CONFIG_SCSI_DH=y CONFIG_SCSI_DH_RDAC=m CONFIG_SCSI_DH_HP_SW=m CONFIG_SCSI_DH_EMC=m
Greg Kroah-Hartman
maintainerPATCH 7/35 MIPS: ip22: Fix ip28 build for modern gcc
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 23ca9b522383d3b9b7991d8586db30118992af4a upstream.
kernelci reports a failure of the ip28_defconfig build after upgrading its gcc version:
arch/mips/sgi-ip22/Platform:29: *** gcc doesn't support needed option -mr10k-cache-barrier=store. Stop.
The problem apparently is that the -mr10k-cache-barrier=store option is now rejected for CPUs other than r10k. Explicitly including the CPU in the check fixes this and is safe because both options were introduced in gcc-4.4.
Patchwork: https://patchwork.linux-mips.org/patch/15049/
--- arch/mips/sgi-ip22/Platform | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/sgi-ip22/Platform +1 -1
@@ -25,7 +25,7 @@ endif # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys # ifdef CONFIG_SGI_IP28 - ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n) + ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n) $(error gcc doesn't support needed option -mr10k-cache-barrier=store) endif endif
Greg Kroah-Hartman
maintainerPATCH 8/35 MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit b3f6046186ef45acfeebc5a59c9fb45cefc685e7 upstream.
Since linux-4.8, CPU_FREQ_STAT is a bool symbol, causing a warning in kernelci.org:
arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for CPU_FREQ_STAT
This updates the defconfig to have the feature built-in.
Patchwork: https://patchwork.linux-mips.org/patch/15000/
--- arch/mips/configs/lemote2f_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/configs/lemote2f_defconfig +1 -1
@@ -39,7 +39,7 @@ CONFIG_HIBERNATION=y CONFIG_PM_STD_PARTITION="/dev/hda3" CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEBUG=y -CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m
Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Quoted 8 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
b3f6046186ef45acfeebc5a59c9fb45cefc685e7upstream.
Quoted 8 lines
Since linux-4.8,
CPU_FREQ_STATis a bool symbol, causing a warning in kernelci.org:arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for
CPU_FREQ_STATThis updates the defconfig to have the feature built-in.
Fixes 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")
[...]
So not needed for 4.4?
Ben.
Signature · 4 lines
Ben Hutchings Power corrupts. Absolute power is kind of neat. - John Lehman, Secretary of the US Navy 1981-1987
Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Quoted 12 lines · Ben Hutchings
Quoted 11 lines · Greg Kroah-Hartman
4.4-stable review patch.��If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
b3f6046186ef45acfeebc5a59c9fb45cefc685e7upstream.Since linux-4.8,
CPU_FREQ_STATis a bool symbol, causing a warning in kernelci.org:
Quoted 8 lines
Quoted 5 lines
arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for
CPU_FREQ_STATThis updates the defconfig to have the feature built-in.
Fixes 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")[...]
So not needed for 4.4?
I don't think so, I don't get warnings for "make ARCH=mips lemote2f_defconfig"
Ralf
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Quoted 16 lines · Ralf Baechle
Quoted 14 lines · Ben Hutchings
Quoted 13 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
b3f6046186ef45acfeebc5a59c9fb45cefc685e7upstream.Since linux-4.8,
CPU_FREQ_STATis a bool symbol, causing a warning in kernelci.org:arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for
CPU_FREQ_STAT
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
This updates the defconfig to have the feature built-in.
Fixes 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")[...]
So not needed for 4.4?
I don't think so, I don't get warnings for "make ARCH=mips
lemote2f_defconfig"
Ok, is it worth reverting as this is an issue on later kernels?
thanks,
greg k-h
Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Quoted 3 lines · Greg Kroah-Hartman
Quoted 1 line
I don't think so, I don't get warnings for "make ARCH=mips
lemote2f_defconfig"Ok, is it worth reverting as this is an issue on later kernels?
Same answer as for the other patch - I can't imagine it's going to cause any problems.
Ralf
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
Quoted 8 lines · Ralf Baechle
Quoted 3 lines · Greg Kroah-Hartman
Quoted 1 line
I don't think so, I don't get warnings for "make ARCH=mips
lemote2f_defconfig"Ok, is it worth reverting as this is an issue on later kernels?
Same answer as for the other patch - I can't imagine it's going to cause any problems.
Thanks for the response, will leave these as-is.
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change
In reply to Ben HutchingsQuoted 12 lines · Ben Hutchings
Quoted 11 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit
b3f6046186ef45acfeebc5a59c9fb45cefc685e7upstream.Since linux-4.8,
CPU_FREQ_STATis a bool symbol, causing a warning in kernelci.org:
Quoted 8 lines
Quoted 5 lines
arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for
CPU_FREQ_STATThis updates the defconfig to have the feature built-in.
Fixes 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")[...]
So not needed for 4.4?
Same again, Arnd asked for it to be applied.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 9/35 mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 906b268477bc03daaa04f739844c120fe4dbc991 upstream.
kernelci.org reports a warning for this driver, as it copies a local variable into a 'const char *' string:
drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
Using kstrndup() simplifies the code and avoids the warning.
--- drivers/mtd/maps/pmcmsp-flash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/maps/pmcmsp-flash.c +1 -3
@@ -139,15 +139,13 @@ static int __init init_msp_flash(void) } msp_maps[i].bankwidth =1 ; - msp_maps[i].name =kmalloc (7 ,GFP_KERNEL ); + msp_maps[i].name =kstrndup (flash_name,7 ,GFP_KERNEL );if (!msp_maps[i].name) {iounmap (msp_maps[i].virt);kfree (msp_parts[i]); goto cleanup_loop; } - msp_maps[i].name =strncpy (msp_maps[i].name, flash_name,7 ); -for (j =0 ; j < pcnt; j++) { part_name[5 ] ='0' + i; part_name[7 ] ='0' + j;
Greg Kroah-Hartman
maintainerPATCH 10/35 MIPS: ralink: Cosmetic change to prom_init().
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Crispin <[email protected]>
commit 9c48568b3692f1a56cbf1935e4eea835e6b185b1 upstream.
Over the years the code has been changed various times leading to argc/argv being defined in a different function to where we actually use the variables. Clean this up by moving them to prom_init_cmdline().
Patchwork: https://patchwork.linux-mips.org/patch/14902/
--- arch/mips/ralink/prom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
arch/mips/ralink/prom.c +4 -5
@@ -30,8 +30,10 @@ const char *get_system_type(void)return soc_info.sys_type; } -static __init void prom_init_cmdline (int argc,char **argv) +static __init void prom_init_cmdline (void ) { +int argc; +char **argv;int i; pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n",
@@ -60,14 +62,11 @@ static __init void prom_init_cmdline(intvoid __init prom_init (void ) { -int argc; -char **argv; -prom_soc_init (&soc_info);pr_info ("SoC Type: %s\n" ,get_system_type ()); -prom_init_cmdline (argc, argv); +prom_init_cmdline (); }void __init prom_free_prom_memory (void )
Greg Kroah-Hartman
maintainerPATCH 11/35 MIPS: ralink: Remove unused rt*_wdt_reset functions
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 886f9c69fc68f56ddea34d3de51ac1fc2ac8dfbc upstream.
All pointers to these functions were removed, so now they produce warnings:
arch/mips/ralink/rt305x.c:92:13: error: 'rt305x_wdt_reset' defined but not used [-Werror=unused-function]
This removes the functions. If we need them again, the patch can be reverted later.
Patchwork: https://patchwork.linux-mips.org/patch/15044/
--- arch/mips/ralink/rt288x.c | 10 ---------- arch/mips/ralink/rt305x.c | 11 ----------- arch/mips/ralink/rt3883.c | 10 ---------- 3 files changed, 31 deletions(-)
arch/mips/ralink/rt288x.c +0 -10
@@ -40,16 +40,6 @@ static struct rt2880_pmx_group rt2880_pi { 0 } }; -static void rt288x_wdt_reset (void ) -{ -u32 t; - -/* enable WDT reset output on pin SRAM_CS_N */ - t =rt_sysc_r32 (SYSC_REG_CLKCFG ); - t |=CLKCFG_SRAM_CS_N_WDT ; -rt_sysc_w32 (t,SYSC_REG_CLKCFG ); -} -void __init ralink_clk_init (void ) {unsigned long cpu_rate, wmac_rate =40000000 ;
arch/mips/ralink/rt305x.c +0 -11
@@ -89,17 +89,6 @@ static struct rt2880_pmx_group rt5350_pi { 0 } }; -static void rt305x_wdt_reset (void ) -{ -u32 t; - -/* enable WDT reset output on pin SRAM_CS_N */ - t =rt_sysc_r32 (SYSC_REG_SYSTEM_CONFIG ); - t |=RT305X_SYSCFG_SRAM_CS0_MODE_WDT << -RT305X_SYSCFG_SRAM_CS0_MODE_SHIFT ; -rt_sysc_w32 (t,SYSC_REG_SYSTEM_CONFIG ); -} -static unsigned long rt5350_get_mem_size (void ) {void __iomem *sysc = (void __iomem *)KSEG1ADDR (RT305X_SYSC_BASE );
arch/mips/ralink/rt3883.c +0 -10
@@ -63,16 +63,6 @@ static struct rt2880_pmx_group rt3883_pi { 0 } }; -static void rt3883_wdt_reset (void ) -{ -u32 t; - -/* enable WDT reset output on GPIO 2 */ - t =rt_sysc_r32 (RT3883_SYSC_REG_SYSCFG1 ); - t |=RT3883_SYSCFG1_GPIO2_AS_WDT_OUT ; -rt_sysc_w32 (t,RT3883_SYSC_REG_SYSCFG1 ); -} -void __init ralink_clk_init (void ) {unsigned long cpu_rate, sys_rate;
Greg Kroah-Hartman
maintainerPATCH 12/35 cpmac: remove hopeless #warning
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d43e6fb4ac4abfe4ef7c102833ed02330ad701e0 upstream.
The #warning was present 10 years ago when the driver first got merged. As the platform is rather obsolete by now, it seems very unlikely that the warning will cause anyone to fix the code properly.
kernelci.org reports the warning for every build in the meantime, so I think it's better to just turn it into a code comment to reduce noise.
--- drivers/net/ethernet/ti/cpmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpmac.c +1 -1
@@ -1237,7 +1237,7 @@ int cpmac_init(void) goto fail_alloc; } -#warning FIXME: unhardcode gpio&reset bits +/* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable (26 );ar7_gpio_disable (27 );ar7_device_reset (AR7_RESET_BIT_CPMAC_LO );
Greg Kroah-Hartman
maintainerPATCH 13/35 mm: memcontrol: avoid unused function warning
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 358c07fcc3b60ab08d77f1684de8bd81bcf49a1a upstream.
A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP is disabled but CONFIG_MEMCG is enabled:
mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
This moves the function inside of the #ifdef block that hides the calling function, to avoid the warning.
--- mm/memcontrol.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
mm/memcontrol.c +18 -18
@@ -4150,24 +4150,6 @@ static void mem_cgroup_id_get_many(strucatomic_add (n, &memcg->id.ref); } -static struct mem_cgroup *mem_cgroup_id_get_online (struct mem_cgroup *memcg) -{ -while (!atomic_inc_not_zero (&memcg->id.ref)) { -/* -* The root cgroup cannot be destroyed, so it's refcount must -* always be >= 1. -*/ -if (WARN_ON_ONCE (memcg == root_mem_cgroup)) { -VM_BUG_ON (1 ); -break ; - } - memcg =parent_mem_cgroup (memcg); -if (!memcg) - memcg = root_mem_cgroup; - } -return memcg; -} -static void mem_cgroup_id_put_many (struct mem_cgroup *memcg,unsigned int n) {if (atomic_sub_and_test (n, &memcg->id.ref)) {
@@ -5751,6 +5733,24 @@ static int __init mem_cgroup_init(void)subsys_initcall (mem_cgroup_init);#ifdef CONFIG_MEMCG_SWAP +static struct mem_cgroup *mem_cgroup_id_get_online (struct mem_cgroup *memcg) +{ +while (!atomic_inc_not_zero (&memcg->id.ref)) { +/* +* The root cgroup cannot be destroyed, so it's refcount must +* always be >= 1. +*/ +if (WARN_ON_ONCE (memcg == root_mem_cgroup)) { +VM_BUG_ON (1 ); +break ; + } + memcg =parent_mem_cgroup (memcg); +if (!memcg) + memcg = root_mem_cgroup; + } +return memcg; +} +/** * mem_cgroup_swapout - transfer a memsw charge to swap * @page: page whose memsw charge to transfer
Greg Kroah-Hartman
maintainerPATCH 14/35 MIPS: DEC: Avoid la pseudo-instruction in delay slots
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit 3021773c7c3e75e20b693931a19362681e744ea9 upstream.
When expanding the la or dla pseudo-instruction in a delay slot the GNU assembler will complain should the pseudo-instruction expand to multiple actual instructions, since only the first of them will be in the delay slot leading to the pseudo-instruction being only partially executed if the branch is taken. Use of PTR_LA in the dec int-handler.S leads to such warnings:
arch/mips/dec/int-handler.S: Assembler messages:
arch/mips/dec/int-handler.S:149: Warning: macro instruction expanded into multiple instructions in a branch delay slot arch/mips/dec/int-handler.S:198: Warning: macro instruction expanded into multiple instructions in a branch delay slot
Avoid this by open coding the PTR_LA macros.
--- arch/mips/dec/int-handler.S | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-)
arch/mips/dec/int-handler.S +38 -2
@@ -146,7 +146,25 @@ /* * Find irq with highest priority */ - PTR_LA t1,cpu_mask_nr_tbl + # open coded PTR_LA t1, cpu_mask_nr_tbl +#if (_MIPS_SZPTR == 32) + # open coded la t1, cpu_mask_nr_tbl + lui t1, %hi(cpu_mask_nr_tbl) + addiu t1, %lo(cpu_mask_nr_tbl) + +#endif +#if (_MIPS_SZPTR == 64) + # open coded dla t1, cpu_mask_nr_tbl + .set push + .set noat + lui t1, %highest(cpu_mask_nr_tbl) + lui AT, %hi(cpu_mask_nr_tbl) + daddiu t1, t1, %higher(cpu_mask_nr_tbl) + daddiu AT, AT, %lo(cpu_mask_nr_tbl) + dsll t1, 32 + daddu t1, t1, AT + .set pop +#endif 1: lw t2,(t1) nop and t2,t0
@@ -195,7 +213,25 @@ /* * Find irq with highest priority */ - PTR_LA t1,asic_mask_nr_tbl + # open coded PTR_LA t1,asic_mask_nr_tbl +#if (_MIPS_SZPTR == 32) + # open coded la t1, asic_mask_nr_tbl + lui t1, %hi(asic_mask_nr_tbl) + addiu t1, %lo(asic_mask_nr_tbl) + +#endif +#if (_MIPS_SZPTR == 64) + # open coded dla t1, asic_mask_nr_tbl + .set push + .set noat + lui t1, %highest(asic_mask_nr_tbl) + lui AT, %hi(asic_mask_nr_tbl) + daddiu t1, t1, %higher(asic_mask_nr_tbl) + daddiu AT, AT, %lo(asic_mask_nr_tbl) + dsll t1, 32 + daddu t1, t1, AT + .set pop +#endif 2: lw t2,(t1) nop and t2,t0
Greg Kroah-Hartman
maintainerPATCH 15/35 MIPS: Netlogic: Fix CP0_EBASE redefinition warnings
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
commit 32eb6e8bee147b45e5e59230630d59541ccbb6e5 upstream.
A couple of netlogic assembly files define CP0_EBASE to $15, the same as CP0_PRID in mipsregs.h, and use it for accessing both CP0_PRId and CP0_EBase registers. However commit 609cf6f2291a ("MIPS: CPS: Early debug using an ns16550-compatible UART") added a different definition of CP0_EBASE to mipsregs.h, which included a register select of 1. This causes harmless build warnings like the following:
arch/mips/netlogic/common/reset.S:53:0: warning: "CP0_EBASE" redefined
#define CP0_EBASE $15
^
In file included from arch/mips/netlogic/common/reset.S:41:0:
./arch/mips/include/asm/mipsregs.h:63:0: note: this is the location of the previous definition #define CP0_EBASE $15, 1
^
Update the code to use the definitions from mipsregs.h for accessing both registers.
Patchwork: https://patchwork.linux-mips.org/patch/13183/
--- arch/mips/netlogic/common/reset.S | 11 +++++------ arch/mips/netlogic/common/smpboot.S | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-)
arch/mips/netlogic/common/reset.S +5 -6
@@ -50,7 +50,6 @@ #include <asm/netlogic/xlp-hal/sys.h> #include <asm/netlogic/xlp-hal/cpucontrol.h> -#define CP0_EBASE $15 #define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \ XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \ SYS_CPU_NONCOHERENT_MODE * 4
@@ -92,7 +91,7 @@ * registers. On XLPII CPUs, usual cache instructions work. */ .macro xlp_flush_l1_dcache - mfc0 t0, CP0_EBASE, 0 + mfc0 t0, CP0_PRID andi t0, t0, PRID_IMP_MASK slt t1, t0, 0x1200 beqz t1, 15f
@@ -171,7 +170,7 @@ FEXPORT(nlm_reset_entry) nop 1: /* Entry point on core wakeup */ - mfc0 t0, CP0_EBASE, 0 /* processor ID */ + mfc0 t0, CP0_PRID /* processor ID */ andi t0, PRID_IMP_MASK li t1, 0x1500 /* XLP 9xx */ beq t0, t1, 2f /* does not need to set coherent */
@@ -182,8 +181,8 @@ FEXPORT(nlm_reset_entry) nop /* set bit in SYS coherent register for the core */ - mfc0 t0, CP0_EBASE, 1 - mfc0 t1, CP0_EBASE, 1 + mfc0 t0, CP0_EBASE + mfc0 t1, CP0_EBASE srl t1, 5 andi t1, 0x3 /* t1 <- node */ li t2, 0x40000
@@ -232,7 +231,7 @@ EXPORT(nlm_boot_siblings) * NOTE: All GPR contents are lost after the mtcr above! */ - mfc0 v0, CP0_EBASE, 1 + mfc0 v0, CP0_EBASE andi v0, 0x3ff /* v0 <- node/core */ /*
arch/mips/netlogic/common/smpboot.S +1 -3
@@ -48,8 +48,6 @@ #include <asm/netlogic/xlp-hal/sys.h> #include <asm/netlogic/xlp-hal/cpucontrol.h> -#define CP0_EBASE $15 - .set noreorder .set noat .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */
@@ -86,7 +84,7 @@ NESTED(nlm_boot_secondary_cpus, 16, sp) PTR_L gp, 0(t1) /* a0 has the processor id */ - mfc0 a0, CP0_EBASE, 1 + mfc0 a0, CP0_EBASE andi a0, 0x3ff /* a0 <- node/core */ PTR_LA t0, nlm_early_init_secondary jalr t0
Greg Kroah-Hartman
maintainerPATCH 16/35 tracing: Add #undef to fix compile error
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
commit bf7165cfa23695c51998231c4efa080fe1d3548d upstream.
There are several trace include files that define TRACE_INCLUDE_FILE.
Include several of them in the same .c file (as I currently have in some code I am working on), and the compile will blow up with a "warning: "TRACE_INCLUDE_FILE" redefined #define TRACE_INCLUDE_FILE syscalls"
Every other include file in include/trace/events/ avoids that issue by having a #undef TRACE_INCLUDE_FILE before the #define; syscalls.h should have one, too.
--- include/trace/events/syscalls.h | 1 + 1 file changed, 1 insertion(+)
include/trace/events/syscalls.h +1 -0
@@ -1,5 +1,6 @@#undef TRACE_SYSTEM#define TRACE_SYSTEM raw_syscalls +#undef TRACE_INCLUDE_FILE#define TRACE_INCLUDE_FILE syscalls#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ )
Greg Kroah-Hartman
maintainerPATCH 17/35 powerpc: Emulation support for load/store instructions on LE
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ravi Bangoria <[email protected]>
commit e148bd17f48bd17fca2f4f089ec879fa6e47e34c upstream.
emulate_step() uses a number of underlying kernel functions that were initially not enabled for LE. This has been rectified since. So, fix emulate_step() for LE for the corresponding instructions.
--- arch/powerpc/lib/sstep.c | 20 -------------------- 1 file changed, 20 deletions(-)
arch/powerpc/lib/sstep.c +0 -20
@@ -1806,8 +1806,6 @@ int __kprobes emulate_step(struct pt_reg goto instr_done;case LARX : -if (regs->msr &MSR_LE ) -return 0 ;if (op.ea & (size -1 ))break ;/* can't handle misaligned */ err = -EFAULT ;
@@ -1829,8 +1827,6 @@ int __kprobes emulate_step(struct pt_reg goto ldst_done;case STCX : -if (regs->msr &MSR_LE ) -return 0 ;if (op.ea & (size -1 ))break ;/* can't handle misaligned */ err = -EFAULT ;
@@ -1854,8 +1850,6 @@ int __kprobes emulate_step(struct pt_reg goto ldst_done;case LOAD : -if (regs->msr &MSR_LE ) -return 0 ; err =read_mem (®s->gpr[op.reg], op.ea, size, regs);if (!err) {if (op.type &SIGNEXT )
@@ -1867,8 +1861,6 @@ int __kprobes emulate_step(struct pt_reg#ifdef CONFIG_PPC_FPU case LOAD_FP : -if (regs->msr &MSR_LE ) -return 0 ;if (size ==4 ) err =do_fp_load (op.reg, do_lfs, op.ea, size, regs);else
@@ -1877,15 +1869,11 @@ int __kprobes emulate_step(struct pt_reg#endif #ifdef CONFIG_ALTIVEC case LOAD_VMX : -if (regs->msr &MSR_LE ) -return 0 ; err =do_vec_load (op.reg, do_lvx, op.ea & ~0xfUL , regs); goto ldst_done;#endif #ifdef CONFIG_VSX case LOAD_VSX : -if (regs->msr &MSR_LE ) -return 0 ; err =do_vsx_load (op.reg, do_lxvd2x, op.ea, regs); goto ldst_done;#endif
@@ -1908,8 +1896,6 @@ int __kprobes emulate_step(struct pt_reg goto instr_done;case STORE : -if (regs->msr &MSR_LE ) -return 0 ; if ((op.type & UPDATE) && size == sizeof(long) && op.reg == 1 && op.update_reg == 1 && !(regs->msr & MSR_PR) &&
@@ -1922,8 +1908,6 @@ int __kprobes emulate_step(struct pt_reg#ifdef CONFIG_PPC_FPU case STORE_FP : -if (regs->msr &MSR_LE ) -return 0 ;if (size ==4 ) err =do_fp_store (op.reg, do_stfs, op.ea, size, regs);else
@@ -1932,15 +1916,11 @@ int __kprobes emulate_step(struct pt_reg#endif #ifdef CONFIG_ALTIVEC case STORE_VMX : -if (regs->msr &MSR_LE ) -return 0 ; err =do_vec_store (op.reg, do_stvx, op.ea & ~0xfUL , regs); goto ldst_done;#endif #ifdef CONFIG_VSX case STORE_VSX : -if (regs->msr &MSR_LE ) -return 0 ; err =do_vsx_store (op.reg, do_stxvd2x, op.ea, regs); goto ldst_done;#endif
Greg Kroah-Hartman
maintainerPATCH 18/35 usb: gadget: dummy_hcd: clear usb_gadget region before registration
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chen <[email protected]>
commit 5bbc852676ae08e818241cf66a3ffe4be44225c4 upstream.
When the user does device unbind and rebind test, the kernel will show below dump due to usb_gadget memory region is dirty after unbind. Clear usb_gadget region for every new probe.
root@imx6qdlsolo:/sys/bus/platform/drivers/dummy_udc# echo dummy_udc.0 > bind [ 102.523312] kobject (eddd78b0): tried to init an initialized object, something is seriously wrong. [ 102.532447] CPU: 0 PID: 734 Comm: sh Not tainted 4.10.0-rc7-00872-g1b2b8e9 #1298 [ 102.539866] Hardware name: Freescale i.MX6 SoloX (Device Tree) [ 102.545717] Backtrace: [ 102.548225] [<c010d090>] (dump_backtrace) from [<c010d338>] (show_stack+0x18/0x1c) [ 102.555822] r7:ede34000 r6:60010013 r5:00000000 r4:c0f29418 [ 102.561512] [<c010d320>] (show_stack) from [<c040c2a4>] (dump_stack+0xb4/0xe8) [ 102.568764] [<c040c1f0>] (dump_stack) from [<c040e6d4>] (kobject_init+0x80/0x9c) [ 102.576187] r10:0000001f r9:eddd7000 r8:eeaf8c10 r7:eddd78a8 r6:c177891c r5:c0f3b060 [ 102.584036] r4:eddd78b0 r3:00000000 [ 102.587641] [<c040e654>] (kobject_init) from [<c05359a4>] (device_initialize+0x28/0xf8) [ 102.595665] r5:eebc4800 r4:eddd78a8 [ 102.599268] [<c053597c>] (device_initialize) from [<c05382ac>] (device_register+0x14/0x20) [ 102.607556] r7:eddd78a8 r6:00000000 r5:eebc4800 r4:eddd78a8 [ 102.613256] [<c0538298>] (device_register) from [<c0668ef4>] (usb_add_gadget_udc_release+0x8c/0x1ec) [ 102.622410] r5:eebc4800 r4:eddd7860 [ 102.626015] [<c0668e68>] (usb_add_gadget_udc_release) from [<c0669068>] (usb_add_gadget_udc+0x14/0x18) [ 102.635351] r10:0000001f r9:eddd7000 r8:eddd788c r7:bf003770 r6:eddd77f8 r5:eddd7818 [ 102.643198] r4:eddd785c r3:eddd7b24 [ 102.646834] [<c0669054>] (usb_add_gadget_udc) from [<bf003428>] (dummy_udc_probe+0x170/0x1c4 [dummy_hcd]) [ 102.656458] [<bf0032b8>] (dummy_udc_probe [dummy_hcd]) from [<c053d114>] (platform_drv_probe+0x54/0xb8) [ 102.665881] r10:00000008 r9:c1778960 r8:bf004128 r7:fffffdfb r6:bf004128 r5:eeaf8c10 [ 102.673727] r4:eeaf8c10 [ 102.676293] [<c053d0c0>] (platform_drv_probe) from [<c053b160>] (driver_probe_device+0x264/0x474) [ 102.685186] r7:00000000 r6:00000000 r5:c1778960 r4:eeaf8c10 [ 102.690876] [<c053aefc>] (driver_probe_device) from [<c05397c4>] (bind_store+0xb8/0x14c) [ 102.698994] r10:eeb3bb4c r9:ede34000 r8:0000000c r7:eeaf8c44 r6:bf004128 r5:c0f3b668 [ 102.706840] r4:eeaf8c10 [ 102.709402] [<c053970c>] (bind_store) from [<c0538ca8>] (drv_attr_store+0x28/0x34) [ 102.716998] r9:ede34000 r8:00000000 r7:ee3863c0 r6:ee3863c0 r5:c0538c80 r4:c053970c [ 102.724776] [<c0538c80>] (drv_attr_store) from [<c029c930>] (sysfs_kf_write+0x50/0x54) [ 102.732711] r5:c0538c80 r4:0000000c [ 102.736313] [<c029c8e0>] (sysfs_kf_write) from [<c029be84>] (kernfs_fop_write+0x100/0x214) [ 102.744599] r7:ee3863c0 r6:eeb3bb40 r5:00000000 r4:00000000 [ 102.750287] [<c029bd84>] (kernfs_fop_write) from [<c0222dd8>] (__vfs_write+0x34/0x120) [ 102.758231] r10:00000000 r9:ede34000 r8:c0108bc4 r7:0000000c r6:ede35f80 r5:c029bd84 [ 102.766077] r4:ee223780 [ 102.768638] [<c0222da4>] (__vfs_write) from [<c0224678>] (vfs_write+0xa8/0x170) [ 102.775974] r9:ede34000 r8:c0108bc4 r7:ede35f80 r6:01861cb0 r5:ee223780 r4:0000000c [ 102.783743] [<c02245d0>] (vfs_write) from [<c0225498>] (SyS_write+0x4c/0xa8) [ 102.790818] r9:ede34000 r8:c0108bc4 r7:0000000c r6:01861cb0 r5:ee223780 r4:ee223780 [ 102.798595] [<c022544c>] (SyS_write) from [<c0108a20>] (ret_fast_syscall+0x0/0x1c) [ 102.806188] r7:00000004 r6:b6e83d58 r5:01861cb0 r4:0000000c
--- drivers/usb/gadget/udc/dummy_hcd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/udc/dummy_hcd.c +2 -0
@@ -1033,6 +1033,8 @@ static int dummy_udc_probe(struct platfoint rc; dum = *((void **)dev_get_platdata (&pdev->dev)); +/* Clear usb_gadget region for new registration to udc-core */ +memzero_explicit (&dum->gadget,sizeof (struct usb_gadget )); dum->gadget.name = gadget_name; dum->gadget.ops = &dummy_ops; dum->gadget.max_speed =USB_SPEED_SUPER ;
Greg Kroah-Hartman
maintainerPATCH 19/35 usb: dwc3: gadget: make Set Endpoint Configuration macros safe
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felipe Balbi <[email protected]>
commit 7369090a9fb57c3fc705ce355d2e4523a5a24716 upstream.
Some gadget drivers are bad, bad boys. We notice that ADB was passing bad Burst Size which caused top bits of param0 to be overwritten which confused DWC3 when running this command.
In order to avoid future issues, we're going to make sure values passed by macros are always safe for the controller. Note that ADB still needs a fix to *not* pass bad values.
--- drivers/usb/dwc3/gadget.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/dwc3/gadget.h +7 -7
@@ -28,23 +28,23 @@ struct dwc3;#define gadget_to_dwc (g) (container_of(g, struct dwc3, gadget))/* DEPCFG parameter 1 */ -#define DWC3_DEPCFG_INT_NUM (n) ((n) << 0) +#define DWC3_DEPCFG_INT_NUM (n) (((n) & 0x1f) << 0)#define DWC3_DEPCFG_XFER_COMPLETE_EN (1 << 8)#define DWC3_DEPCFG_XFER_IN_PROGRESS_EN (1 << 9)#define DWC3_DEPCFG_XFER_NOT_READY_EN (1 << 10)#define DWC3_DEPCFG_FIFO_ERROR_EN (1 << 11)#define DWC3_DEPCFG_STREAM_EVENT_EN (1 << 13) -#define DWC3_DEPCFG_BINTERVAL_M1 (n) ((n) << 16) +#define DWC3_DEPCFG_BINTERVAL_M1 (n) (((n) & 0xff) << 16)#define DWC3_DEPCFG_STREAM_CAPABLE (1 << 24) -#define DWC3_DEPCFG_EP_NUMBER (n) ((n) << 25) +#define DWC3_DEPCFG_EP_NUMBER (n) (((n) & 0x1f) << 25)#define DWC3_DEPCFG_BULK_BASED (1 << 30)#define DWC3_DEPCFG_FIFO_BASED (1 << 31)/* DEPCFG parameter 0 */ -#define DWC3_DEPCFG_EP_TYPE (n) ((n) << 1) -#define DWC3_DEPCFG_MAX_PACKET_SIZE (n) ((n) << 3) -#define DWC3_DEPCFG_FIFO_NUMBER (n) ((n) << 17) -#define DWC3_DEPCFG_BURST_SIZE (n) ((n) << 22) +#define DWC3_DEPCFG_EP_TYPE (n) (((n) & 0x3) << 1) +#define DWC3_DEPCFG_MAX_PACKET_SIZE (n) (((n) & 0x7ff) << 3) +#define DWC3_DEPCFG_FIFO_NUMBER (n) (((n) & 0x1f) << 17) +#define DWC3_DEPCFG_BURST_SIZE (n) (((n) & 0xf) << 22)#define DWC3_DEPCFG_DATA_SEQ_NUM (n) ((n) << 26)/* This applies for core versions earlier than 1.94a */ #define DWC3_DEPCFG_IGN_SEQ_NUM (1 << 31)
Greg Kroah-Hartman
maintainerPATCH 20/35 usb: gadget: function: f_fs: pass companion descriptor along
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felipe Balbi <[email protected]>
commit 2bfa0719ac2a9b2f3c91345873d3cdebd0296ba9 upstream.
If we're dealing with SuperSpeed endpoints, we need to make sure to pass along the companion descriptor and initialize fields needed by the Gadget API. Eventually, f_fs.c should be converted to use config_ep_by_speed() like all other functions, though.
--- drivers/usb/gadget/function/f_fs.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_fs.c +13 -2
@@ -1643,11 +1643,14 @@ static int ffs_func_eps_enable(struct ffspin_lock_irqsave (&func->ffs->eps_lock, flags); do { struct usb_endpoint_descriptor *ds; + struct usb_ss_ep_comp_descriptor *comp_desc = NULL; + int needs_comp_desc = false; int desc_idx; - if (ffs->gadget->speed == USB_SPEED_SUPER) + if (ffs->gadget->speed == USB_SPEED_SUPER) { desc_idx = 2; - else if (ffs->gadget->speed == USB_SPEED_HIGH) + needs_comp_desc = true; + } else if (ffs->gadget->speed == USB_SPEED_HIGH) desc_idx = 1; else desc_idx = 0;
@@ -1664,6 +1667,14 @@ static int ffs_func_eps_enable(struct ff ep->ep->driver_data = ep; ep->ep->desc = ds; + + comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + +USB_DT_ENDPOINT_SIZE ); + ep->ep->maxburst = comp_desc->bMaxBurst +1 ; + +if (needs_comp_desc) + ep->ep->comp_desc = comp_desc; + ret =usb_ep_enable (ep->ep);if (likely (!ret)) { epfile->ep = ep;
Greg Kroah-Hartman
maintainerPATCH 21/35 usb: host: xhci-dbg: HCIVERSION should be a binary number
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chen <[email protected]>
commit f95e60a7dbecd2de816bb3ad517b3d4fbc20b507 upstream.
According to xHCI spec, HCIVERSION containing a BCD encoding of the xHCI specification revision number, 0100h corresponds to xHCI version 1.0. Change "100" as "0x100".
--- drivers/usb/host/xhci-dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dbg.c +1 -1
@@ -111,7 +111,7 @@ static void xhci_print_cap_regs(struct xxhci_dbg (xhci,"RTSOFF 0x%x:\n" , temp &RTSOFF_MASK );/* xhci 1.1 controllers have the HCCPARAMS2 register */ -if (hci_version >100 ) { +if (hci_version >0x100 ) { temp =readl (&xhci->cap_regs->hcc_params2);xhci_dbg (xhci,"HCC PARAMS2 0x%x:\n" , (unsigned int ) temp); xhci_dbg(xhci, " HC %s Force save context capability",
Greg Kroah-Hartman
maintainerPATCH 22/35 usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit dcc7620cad5ad1326a78f4031a7bf4f0e5b42984 upstream.
Upstream commit 98d74f9ceaef ("xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI xhci controllers which can result in excessive timeouts, to the point where the system reports a deadlock.
The same problem is seen with hot pluggable xhci controllers using the xhci-plat driver, such as the driver used for Type-C ports on rk3399. Similar to hot-pluggable PCI controllers, the driver for this chip removes the xhci controller from the system when the Type-C cable is disconnected.
The solution for PCI devices works just as well for non-PCI devices and avoids the problem.
--- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-plat.c +2 -0
@@ -213,6 +213,8 @@ static int xhci_plat_remove(struct platfstruct xhci_hcd *xhci =hcd_to_xhci (hcd);struct clk *clk = xhci->clk; + xhci->xhc_state |=XHCI_STATE_REMOVING ; +usb_remove_hcd (xhci->shared_hcd);usb_phy_shutdown (hcd->usb_phy);
Greg Kroah-Hartman
maintainerPATCH 23/35 USB: serial: safe_serial: fix information leak in completion handler
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 8c76d7cd520ebffc1ea9ea0850d87a224a50c7f2 upstream.
Add missing sanity check to the bulk-in completion handler to avoid an integer underflow that could be triggered by a malicious device.
This avoids leaking up to 56 bytes from after the URB transfer buffer to user space.
--- drivers/usb/serial/safe_serial.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/serial/safe_serial.c +5 -0
@@ -205,6 +205,11 @@ static void safe_process_read_urb(structif (!safe) goto out; +if (length <2 ) { +dev_err (&port->dev,"malformed packet\n" ); +return ; + } + fcs =fcs_compute10 (data, length,CRC10_INITFCS );if (fcs) {dev_err (&port->dev,"%s - bad CRC %x\n" , __func__, fcs);
Greg Kroah-Hartman
maintainerPATCH 24/35 USB: serial: omninet: fix reference leaks at open
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 30572418b445d85fcfe6c8fe84c947d2606767d8 upstream.
This driver needlessly took another reference to the tty on open, a reference which was then never released on close. This lead to not just a leak of the tty, but also a driver reference leak that prevented the driver from being unloaded after a port had once been opened.
--- drivers/usb/serial/omninet.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/usb/serial/omninet.c +0 -6
@@ -142,12 +142,6 @@ static int omninet_port_remove(struct usstatic int omninet_open (struct tty_struct *tty,struct usb_serial_port *port) { -struct usb_serial *serial = port->serial; -struct usb_serial_port *wport; - - wport = serial->port[1 ]; -tty_port_tty_set (&wport->port, tty); -return usb_serial_generic_open (tty, port); }
Greg Kroah-Hartman
maintainerPATCH 25/35 USB: iowarrior: fix NULL-deref at probe
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit b7321e81fc369abe353cf094d4f0dc2fe11ab95f upstream.
Make sure to check for the required interrupt-in endpoint to avoid dereferencing a NULL-pointer should a malicious device lack such an endpoint.
Note that a fairly recent change purported to fix this issue, but added an insufficient test on the number of endpoints only, a test which can now be removed.
--- drivers/usb/misc/iowarrior.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/usb/misc/iowarrior.c +7 -6
@@ -787,12 +787,6 @@ static int iowarrior_probe(struct usb_in iface_desc = interface->cur_altsetting; dev->product_id =le16_to_cpu (udev->descriptor.idProduct); -if (iface_desc->desc.bNumEndpoints <1 ) { -dev_err (&interface->dev,"Invalid number of endpoints\n" ); - retval = -EINVAL ; - goto error; - } -/* set up the endpoint information */ for (i =0 ; i < iface_desc->desc.bNumEndpoints; ++i) { endpoint = &iface_desc->endpoint[i].desc;
@@ -803,6 +797,13 @@ static int iowarrior_probe(struct usb_in/* this one will match for the IOWarrior56 only */ dev->int_out_endpoint = endpoint; } + +if (!dev->int_in_endpoint) { +dev_err (&interface->dev,"no interrupt-in endpoint found\n" ); + retval = -ENODEV ; + goto error; + } +/* we have to check the report_size often, so remember it in the endianness suitable for our machine */ dev->report_size =usb_endpoint_maxp (dev->int_in_endpoint); if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&
Greg Kroah-Hartman
maintainerPATCH 26/35 USB: iowarrior: fix NULL-deref in write
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit de46e56653de7b3b54baa625bd582635008b8d05 upstream.
Make sure to verify that we have the required interrupt-out endpoint for IOWarrior56 devices to avoid dereferencing a NULL-pointer in write should a malicious device lack such an endpoint.
--- drivers/usb/misc/iowarrior.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/misc/iowarrior.c +8 -0
@@ -804,6 +804,14 @@ static int iowarrior_probe(struct usb_in goto error; } +if (dev->product_id ==USB_DEVICE_ID_CODEMERCS_IOW56 ) { +if (!dev->int_out_endpoint) { +dev_err (&interface->dev,"no interrupt-out endpoint found\n" ); + retval = -ENODEV ; + goto error; + } + } +/* we have to check the report_size often, so remember it in the endianness suitable for our machine */ dev->report_size =usb_endpoint_maxp (dev->int_in_endpoint); if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&
Greg Kroah-Hartman
maintainerPATCH 27/35 USB: serial: io_ti: fix NULL-deref in interrupt callback
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 0b1d250afb8eb9d65afb568bac9b9f9253a82b49 upstream.
Fix a NULL-pointer dereference in the interrupt callback should a malicious device send data containing a bad port number by adding the missing sanity check.
--- drivers/usb/serial/io_ti.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/io_ti.c +6 -0
@@ -1674,6 +1674,12 @@ static void edge_interrupt_callback(stru function =TIUMP_GET_FUNC_FROM_CODE (data[0 ]);dev_dbg (dev,"%s - port_number %d, function %d, info 0x%x\n" , __func__, port_number, function, data[1 ]); + +if (port_number >= edge_serial->serial->num_ports) { +dev_err (dev,"bad port number %d\n" , port_number); + goto exit; + } + port = edge_serial->serial->port[port_number]; edge_port =usb_get_serial_port_data (port);if (!edge_port) {
Greg Kroah-Hartman
maintainerPATCH 28/35 USB: serial: io_ti: fix information leak in completion handler
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 654b404f2a222f918af9b0cd18ad469d0c941a8e upstream.
Add missing sanity check to the bulk-in completion handler to avoid an integer underflow that can be triggered by a malicious device.
This avoids leaking 128 kB of memory content from after the URB transfer buffer to user space.
--- drivers/usb/serial/io_ti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/io_ti.c +1 -1
@@ -1761,7 +1761,7 @@ static void edge_bulk_in_callback(struct port_number = edge_port->port->port_number; -if (edge_port->lsr_event) { +if (urb->actual_length >0 && edge_port->lsr_event) { edge_port->lsr_event =0 ;dev_dbg (dev,"%s ===== Port %u LSR Status = %02x, Data = %02x ======\n" , __func__, port_number, edge_port->lsr_mask, *data);
Greg Kroah-Hartman
maintainerPATCH 30/35 mvsas: fix misleading indentation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luis de Bethencourt <[email protected]>
commit 7789cd39274c51bf475411fe22a8ee7255082809 upstream.
Fix a smatch warning:drivers/scsi/mvsas/mv_sas.c:740 mvs_task_prep() warn: curly braces intended?
The code is correct, the indention is misleading. When the device is not ready we want to return SAS_PHY_DOWN. But current indentation makes it look like we only do so in the else branch of if (mvi_dev).
--- drivers/scsi/mvsas/mv_sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mvsas/mv_sas.c +2 -2
@@ -737,8 +737,8 @@ static int mvs_task_prep(struct sas_taskmv_dprintk ("device %016llx not ready.\n" ,SAS_ADDR (dev->sas_addr)); - rc =SAS_PHY_DOWN ; -return rc; + rc =SAS_PHY_DOWN ; +return rc; } tei.port = dev->port->lldd_port;if (tei.port && !tei.port->port_attached && !tmf) {
Greg Kroah-Hartman
maintainerPATCH 31/35 KVM: s390: Fix guest migration for huge guests resulting in panic
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janosch Frank <[email protected]>
commit 2e4d88009f57057df7672fa69a32b5224af54d37 upstream.
While we can technically not run huge page guests right now, we can setup a guest with huge pages. Trying to migrate it will trigger a VM_BUG_ON and, if the kernel is not configured to panic on a BUG, it will happily try to work on non-existing page table entries.
With this patch, we always return "dirty" if we encounter a large page when migrating. This at least fixes the immediate problem until we have proper handling for both kind of pages.
--- arch/s390/mm/pgtable.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
arch/s390/mm/pgtable.c +18 -1
@@ -1237,11 +1237,28 @@ EXPORT_SYMBOL_GPL(s390_reset_cmma);*/ bool gmap_test_and_clear_dirty (unsigned long address,struct gmap *gmap) { +pgd_t *pgd; +pud_t *pud; +pmd_t *pmd;pte_t *pte;spinlock_t *ptl;bool dirty = false; - pte =get_locked_pte (gmap->mm, address, &ptl); + pgd =pgd_offset (gmap->mm, address); + pud =pud_alloc (gmap->mm, pgd, address); +if (!pud) +return false; + pmd =pmd_alloc (gmap->mm, pud, address); +if (!pmd) +return false; +/* We can't run guests backed by huge pages, but userspace can +* still set them up and then try to migrate them without any +* migration support. +*/ +if (pmd_large (*pmd)) +return true; + + pte =pte_alloc_map_lock (gmap->mm, pmd, address, &ptl);if (unlikely (!pte))return false;
Greg Kroah-Hartman
maintainerPATCH 32/35 s390/kdump: Use "LINUX" ELF note name instead of "CORE"
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Holzheu <[email protected]>
commit a4a81d8eebdc1d209d034f62a082a5131e4242b5 upstream.
In binutils/libbfd (bfd/elf.c) it is enforced that all s390 specific ELF notes like e.g. NT_S390_PREFIX or NT_S390_CTRS have "LINUX" specified as note name. Otherwise the notes are ignored.
For /proc/vmcore we currently use "CORE" for these notes.
Up to now this has not been a real problem because the dump analysis tool "crash" does not check the note name. But it will break all programs that use libbfd for processing ELF notes.
So fix this and use "LINUX" for all s390 specific notes to comply with libbfd.
--- arch/s390/kernel/crash_dump.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
arch/s390/kernel/crash_dump.c +10 -8
@@ -23,6 +23,8 @@#define PTR_SUB (x, y) (((char *) (x)) - ((unsigned long) (y)))#define PTR_DIFF (x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y)))) +#define LINUX_NOTE_NAME "LINUX" +static struct memblock_region oldmem_region;static struct memblock_type oldmem_type = {
@@ -312,7 +314,7 @@ static void *nt_fpregset(void *ptr, strustatic void *nt_s390_timer (void *ptr,struct save_area *sa) {return nt_init (ptr,NT_S390_TIMER , &sa->timer,sizeof (sa->timer), -KEXEC_CORE_NOTE_NAME ); +LINUX_NOTE_NAME ); }/*
@@ -321,7 +323,7 @@ static void *nt_s390_timer(void *ptr, ststatic void *nt_s390_tod_cmp (void *ptr,struct save_area *sa) {return nt_init (ptr,NT_S390_TODCMP , &sa->clk_cmp, -sizeof (sa->clk_cmp),KEXEC_CORE_NOTE_NAME ); +sizeof (sa->clk_cmp),LINUX_NOTE_NAME ); }/*
@@ -330,7 +332,7 @@ static void *nt_s390_tod_cmp(void *ptr,static void *nt_s390_tod_preg (void *ptr,struct save_area *sa) {return nt_init (ptr,NT_S390_TODPREG , &sa->tod_reg, -sizeof (sa->tod_reg),KEXEC_CORE_NOTE_NAME ); +sizeof (sa->tod_reg),LINUX_NOTE_NAME ); }/*
@@ -339,7 +341,7 @@ static void *nt_s390_tod_preg(void *ptr,static void *nt_s390_ctrs (void *ptr,struct save_area *sa) {return nt_init (ptr,NT_S390_CTRS , &sa->ctrl_regs, -sizeof (sa->ctrl_regs),KEXEC_CORE_NOTE_NAME ); +sizeof (sa->ctrl_regs),LINUX_NOTE_NAME ); }/*
@@ -348,7 +350,7 @@ static void *nt_s390_ctrs(void *ptr, strstatic void *nt_s390_prefix (void *ptr,struct save_area *sa) {return nt_init (ptr,NT_S390_PREFIX , &sa->pref_reg, -sizeof (sa->pref_reg),KEXEC_CORE_NOTE_NAME ); +sizeof (sa->pref_reg),LINUX_NOTE_NAME ); }/*
@@ -357,7 +359,7 @@ static void *nt_s390_prefix(void *ptr, sstatic void *nt_s390_vx_high (void *ptr,__vector128 *vx_regs) {return nt_init (ptr,NT_S390_VXRS_HIGH , &vx_regs[16 ], -16 *sizeof (__vector128),KEXEC_CORE_NOTE_NAME ); +16 *sizeof (__vector128),LINUX_NOTE_NAME ); }/*
@@ -370,12 +372,12 @@ static void *nt_s390_vx_low(void *ptr, _int i; note = (Elf64_Nhdr *)ptr; - note->n_namesz =strlen (KEXEC_CORE_NOTE_NAME ) +1 ; + note->n_namesz =strlen (LINUX_NOTE_NAME ) +1 ; note->n_descsz =16 *8 ; note->n_type =NT_S390_VXRS_LOW ; len =sizeof (Elf64_Nhdr); -memcpy (ptr + len,KEXEC_CORE_NOTE_NAME , note->n_namesz); +memcpy (ptr + len,LINUX_NOTE_NAME , note->n_namesz); len =roundup (len + note->n_namesz,4 ); ptr += len;
Greg Kroah-Hartman
maintainerPATCH 33/35 nfit, libnvdimm: fix interleave set cookie calculation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.
The interleave-set cookie is a sum that sanity checks the composition of an interleave set has not changed from when the namespace was initially created. The checksum is calculated by sorting the DIMMs by their location in the interleave-set. The comparison for the sort must be 64-bit wide, not byte-by-byte as performed by memcmp() in the broken case.
Fix the implementation to accept correct cookie values in addition to the Linux "memcmp" order cookies, but only allow correct cookies to be generated going forward. It does mean that namespaces created by third-party-tooling, or created by newer kernels with this fix, will not validate on older kernels. However, there are a couple mitigating conditions:
1/ platforms with namespace-label capable NVDIMMs are not widely
available.
2/ interleave-sets with a single-dimm are by definition not affected
(nothing to sort). This covers the QEMU-KVM NVDIMM emulation case.
The cookie stored in the namespace label will be fixed by any write the namespace label, the most straightforward way to achieve this is to write to the "alt_name" attribute of a namespace in sysfs.
--- drivers/acpi/nfit.c | 16 +++++++++++++++- drivers/nvdimm/namespace_devs.c | 28 +++++++++++++++++++++------- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/region_devs.c | 9 +++++++++ include/linux/libnvdimm.h | 2 ++ 5 files changed, 48 insertions(+), 8 deletions(-)
drivers/acpi/nfit.c +15 -1
@@ -965,7 +965,7 @@ static size_t sizeof_nfit_set_info(int n + num_mappings *sizeof (struct nfit_set_info_map ); } -static int cmp_map (const void *m0,const void *m1) +static int cmp_map_compat (const void *m0,const void *m1) {const struct nfit_set_info_map *map0 = m0;const struct nfit_set_info_map *map1 = m1;
@@ -974,6 +974,14 @@ static int cmp_map(const void *m0, const sizeof(u64)); } +static int cmp_map (const void *m0,const void *m1) +{ +const struct nfit_set_info_map *map0 = m0; +const struct nfit_set_info_map *map1 = m1; + +return map0->region_offset - map1->region_offset; +} +/* Retrieve the nth entry referencing this spa */ static struct acpi_nfit_memory_map *memdev_from_spa (struct acpi_nfit_desc *acpi_desc,u16 range_index,int n)
@@ -1029,6 +1037,12 @@ static int acpi_nfit_init_interleave_setsort (&info->mapping[0 ], nr,sizeof (struct nfit_set_info_map ), cmp_map,NULL ); nd_set->cookie =nd_fletcher64 (info,sizeof_nfit_set_info (nr),0 ); + +/* support namespaces created with the wrong sort order */ +sort (&info->mapping[0 ], nr,sizeof (struct nfit_set_info_map ), + cmp_map_compat,NULL ); + nd_set->altcookie =nd_fletcher64 (info,sizeof_nfit_set_info (nr),0 ); + ndr_desc->nd_set = nd_set;devm_kfree (dev, info);
drivers/nvdimm/namespace_devs.c +21 -7
@@ -1534,6 +1534,7 @@ static int select_pmem_id(struct nd_registatic int find_pmem_label_set (struct nd_region *nd_region,struct nd_namespace_pmem *nspm) { +u64 altcookie =nd_region_interleave_set_altcookie (nd_region);u64 cookie =nd_region_interleave_set_cookie (nd_region);struct nd_namespace_label *nd_label;u8 select_id[NSLABEL_UUID_LEN ];
@@ -1542,8 +1543,10 @@ static int find_pmem_label_set(struct ndint rc = -ENODEV , l;u16 i; -if (cookie ==0 ) +if (cookie ==0 ) { +dev_dbg (&nd_region->dev,"invalid interleave-set-cookie\n" );return -ENXIO ; + }/* * Find a complete set of labels by uuid. By definition we can start
@@ -1552,13 +1555,24 @@ static int find_pmem_label_set(struct ndfor_each_label (l, nd_label, nd_region->mapping[0 ].labels) {u64 isetcookie =__le64_to_cpu (nd_label->isetcookie); -if (isetcookie != cookie) -continue ; +if (isetcookie != cookie) { +dev_dbg (&nd_region->dev,"invalid cookie in label: %pUb\n" , + nd_label->uuid); +if (isetcookie != altcookie) +continue ; + +dev_dbg (&nd_region->dev,"valid altcookie in label: %pUb\n" , + nd_label->uuid); + } + +for (i =0 ; nd_region->ndr_mappings; i++) { +if (has_uuid_at_pos (nd_region, nd_label->uuid, cookie, i)) +continue ; +if (has_uuid_at_pos (nd_region, nd_label->uuid, altcookie, i)) +continue ; +break ; + } -for (i =0 ; nd_region->ndr_mappings; i++) -if (!has_uuid_at_pos (nd_region, nd_label->uuid, - cookie, i)) -break ;if (i < nd_region->ndr_mappings) {/* * Give up if we don't find an instance of a
drivers/nvdimm/nd.h +1 -0
@@ -245,6 +245,7 @@ struct nd_region *to_nd_region(struct deint nd_region_to_nstype (struct nd_region *nd_region);int nd_region_register_namespaces (struct nd_region *nd_region,int *err);u64 nd_region_interleave_set_cookie (struct nd_region *nd_region); +u64 nd_region_interleave_set_altcookie (struct nd_region *nd_region);void nvdimm_bus_lock (struct device *dev);void nvdimm_bus_unlock (struct device *dev);bool is_nvdimm_bus_locked (struct device *dev);
drivers/nvdimm/region_devs.c +9 -0
@@ -379,6 +379,15 @@ u64 nd_region_interleave_set_cookie(strureturn 0 ; } +u64 nd_region_interleave_set_altcookie (struct nd_region *nd_region) +{ +struct nd_interleave_set *nd_set = nd_region->nd_set; + +if (nd_set) +return nd_set->altcookie; +return 0 ; +} +/* * Upon successful probe/remove, take/release a reference on the * associated interleave set (if present), and plant new btt + namespace
include/linux/libnvdimm.h +2 -0
@@ -83,6 +83,8 @@ struct nd_cmd_desc {struct nd_interleave_set {u64 cookie; +/* compatibility with initial buggy Linux implementation */ +u64 altcookie; };struct nd_region_desc {
Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation
Quoted 14 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit
86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67upstream.The interleave-set cookie is a sum that sanity checks the composition of an interleave set has not changed from when the namespace was initially created. The checksum is calculated by sorting the DIMMs by their location in the interleave-set. The comparison for the sort must be 64-bit wide, not byte-by-byte as performed by
memcmp()in the broken case.
[...]
Quoted 2 lines
drivers/acpi/nfit.c +0
-0
[...]
drivers/acpi/nfit.c static int cmp_map(const void *m0, const · line 983
Quoted 7 lines
drivers/acpi/nfit.c +7
-0+static int cmp_map (const void *m0,const void *m1) +{ +const struct nfit_set_info_map *map0 = m0; +const struct nfit_set_info_map *map1 = m1; + +return map0->region_offset - map1->region_offset; +}
[...]
This is returning an int, thus it's effectively doing a 32-bit comparison and not the 64-bit comparison you say is needed.
I think this function needs to do something like:
return (map0->region_offset < map1->region_offset) ? -1 : (map0->region_offset == map1->region_offset) ? 0 : 1;
Ben.
Signature · 4 lines
Ben Hutchings Power corrupts. Absolute power is kind of neat. - John Lehman, Secretary of the US Navy 1981-1987
Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation
Quoted 28 lines · Ben Hutchings
Quoted 14 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit
86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67upstream.The interleave-set cookie is a sum that sanity checks the composition of an interleave set has not changed from when the namespace was initially created. The checksum is calculated by sorting the DIMMs by their location in the interleave-set. The comparison for the sort must be 64-bit wide, not byte-by-byte as performed by
memcmp()in the broken case.[...]
Quoted 2 lines
drivers/acpi/nfit.c +0
-0[...]
Quoted 7 lines
drivers/acpi/nfit.c +7
-0+static int cmp_map (const void *m0,const void *m1) +{ +const struct nfit_set_info_map *map0 = m0; +const struct nfit_set_info_map *map1 = m1; + +return map0->region_offset - map1->region_offset; +}[...]
Quoted 7 lines
This is returning an int, thus it's effectively doing a 32-bit comparison and not the 64-bit comparison you say is needed.
I think this function needs to do something like:
return (map0->region_offset < map1->region_offset) ? -1 : (map0->region_offset == map1->region_offset) ? 0 : 1;
Yes, you're right. We could end up with unexpected sign changes. Good catch.
Greg Kroah-Hartman
maintainerPATCH 34/35 dm: flush queued bios when process blocks to avoid deadlock
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 upstream.
Commit df2cb6daa4 ("block: Avoid deadlocks with bio allocation by stacking drivers") created a workqueue for every bio set and code in bio_alloc_bioset() that tries to resolve some low-memory deadlocks by redirecting bios queued on current->bio_list to the workqueue if the system is low on memory. However other deadlocks (see below **) may happen, without any low memory condition, because generic_make_request is queuing bios to current->bio_list (rather than submitting them).
** the related dm-snapshot deadlock is detailed here:
https://www.redhat.com/archives/dm-devel/2016-July/msg00065.html
Fix this deadlock by redirecting any bios on current->bio_list to the bio_set's rescue workqueue on every schedule() call. Consequently, when the process blocks on a mutex, the bios queued on current->bio_list are dispatched to independent workqueus and they can complete without waiting for the mutex to be available.
The structure blk_plug contains an entry cb_list and this list can contain arbitrary callback functions that are called when the process blocks. To implement this fix DM (ab)uses the onstack plug's cb_list interface to get its flush_current_bio_list() called at schedule() time.
This fixes the snapshot deadlock - if the map method blocks, flush_current_bio_list() will be called and it redirects bios waiting on current->bio_list to appropriate workqueues.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1267650
Depends-on: df2cb6daa4 ("block: Avoid deadlocks with bio allocation by stacking drivers")
--- drivers/md/dm.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
drivers/md/dm.c +55 -0
@@ -1467,11 +1467,62 @@ void dm_accept_partial_bio(struct bio *b }EXPORT_SYMBOL_GPL (dm_accept_partial_bio); +/* +* Flush current->bio_list when the target map method blocks. +* This fixes deadlocks in snapshot and possibly in other targets. +*/ +struct dm_offload { +struct blk_plug plug; +struct blk_plug_cb cb; +}; + +static void flush_current_bio_list (struct blk_plug_cb *cb,bool from_schedule) +{ + struct dm_offload *o = container_of(cb, struct dm_offload, cb); +struct bio_list list; +struct bio *bio; + +INIT_LIST_HEAD (&o->cb.list); + +if (unlikely (!current->bio_list)) +return ; + + list = *current->bio_list; +bio_list_init (current->bio_list); + +while ((bio =bio_list_pop (&list))) { +struct bio_set *bs = bio->bi_pool; +if (unlikely (!bs) || bs == fs_bio_set) { +bio_list_add (current->bio_list, bio); +continue ; + } + +spin_lock (&bs->rescue_lock); +bio_list_add (&bs->rescue_list, bio); +queue_work (bs->rescue_workqueue, &bs->rescue_work); +spin_unlock (&bs->rescue_lock); + } +} + +static void dm_offload_start (struct dm_offload *o) +{ +blk_start_plug (&o->plug); + o->cb.callback = flush_current_bio_list; +list_add (&o->cb.list, ¤t->plug->cb_list); +} + +static void dm_offload_end (struct dm_offload *o) +{ +list_del (&o->cb.list); +blk_finish_plug (&o->plug); +} +static void __map_bio (struct dm_target_io *tio) {int r;sector_t sector;struct mapped_device *md; +struct dm_offload o;struct bio *clone = &tio->clone;struct dm_target *ti = tio->ti;
@@ -1484,7 +1535,11 @@ static void __map_bio(struct dm_target_i*/ atomic_inc (&tio->io->io_count); sector = clone->bi_iter.bi_sector; + +dm_offload_start (&o); r = ti->type->map (ti, clone); +dm_offload_end (&o); +if (r ==DM_MAPIO_REMAPPED ) {/* the bio has been remapped so dispatch it */
Greg Kroah-Hartman
maintainerPATCH 35/35 ext4: dont BUG when truncating encrypted inodes on the orphan list
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 0d06863f903ac5f4f6efb0273079d27de3e53a28 upstream.
Fix a BUG when the kernel tries to mount a file system constructed as follows:
echo foo > foo.txt
mke2fs -Fq -t ext4 -O encrypt foo.img 100
debugfs -w foo.img << EOF
write foo.txt aset_inode_field a i_flags 0x80800set_super_value s_last_orphan 12
quit
EOF
root@kvm-xfstests:~# mount -o loop foo.img /mnt [ 160.238770] ------------[ cut here ]------------ [ 160.240106] kernel BUG at /usr/projects/linux/ext4/fs/ext4/inode.c:3874! [ 160.240106] invalid opcode: 0000 [#1] SMP [ 160.240106] Modules linked in: [ 160.240106] CPU: 0 PID: 2547 Comm: mount Tainted: G W 4.10.0-rc3-00034-gcdd33b941b67 #227 [ 160.240106] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1 04/01/2014 [ 160.240106] task: f4518000 task.stack: f47b6000 [ 160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4 [ 160.240106] EFLAGS: 00010246 CPU: 0 [ 160.240106] EAX: 00000001 EBX: f7be4b50 ECX: f47b7dc0 EDX: 00000007 [ 160.240106] ESI: f43b05a8 EDI: f43babec EBP: f47b7dd0 ESP: f47b7dac [ 160.240106] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 160.240106] CR0: 80050033 CR2: bfd85b08 CR3: 34a00680 CR4: 000006f0 [ 160.240106] Call Trace: [ 160.240106] ext4_truncate+0x1e9/0x3e5 [ 160.240106] ext4_fill_super+0x286f/0x2b1e [ 160.240106] ? set_blocksize+0x2e/0x7e [ 160.240106] mount_bdev+0x114/0x15f [ 160.240106] ext4_mount+0x15/0x17 [ 160.240106] ? ext4_calculate_overhead+0x39d/0x39d [ 160.240106] mount_fs+0x58/0x115 [ 160.240106] vfs_kern_mount+0x4b/0xae [ 160.240106] do_mount+0x671/0x8c3 [ 160.240106] ? _copy_from_user+0x70/0x83 [ 160.240106] ? strndup_user+0x31/0x46 [ 160.240106] SyS_mount+0x57/0x7b [ 160.240106] do_int80_syscall_32+0x4f/0x61 [ 160.240106] entry_INT80_32+0x2f/0x2f [ 160.240106] EIP: 0xb76b919e [ 160.240106] EFLAGS: 00000246 CPU: 0 [ 160.240106] EAX: ffffffda EBX: 08053838 ECX: 08052188 EDX: 080537e8 [ 160.240106] ESI: c0ed0000 EDI: 00000000 EBP: 080537e8 ESP: bfa13660 [ 160.240106] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b [ 160.240106] Code: 59 8b 00 a8 01 0f 84 09 01 00 00 8b 07 66 25 00 f0 66 3d 00 80 75 61 89 f8 e8 3e e2 ff ff 84 c0 74 56 83 bf 48 02 00 00 00 75 02 <0f> 0b 81 7d e8 00 10 00 00 74 02 0f 0b 8b 43 04 8b 53 08 31 c9 [ 160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4 SS:ESP: 0068:f47b7dac [ 160.317241] ---[ end trace d6a773a375c810a5 ]---
The problem is that when the kernel tries to truncate an inode in ext4_truncate(), it tries to clear any on-disk data beyond i_size. Without the encryption key, it can't do that, and so it triggers a BUG.
E2fsck does *not* provide this service, and in practice most file systems have their orphan list processed by e2fsck, so to avoid crashing, this patch skips this step if we don't have access to the encryption key (which is the case when processing the orphan list; in all other cases, we will have the encryption key, or the kernel wouldn't have allowed the file to be opened).
An open question is whether the fact that e2fsck isn't clearing the bytes beyond i_size causing problems --- and if we've lived with it not doing it for so long, can we drop this from the kernel replay of the orphan list in all cases (not just when we don't have the key for encrypted inodes).
Addresses-Google-Bug: #35209576
--- fs/ext4/inode.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ext4/inode.c +4 -0
@@ -3573,6 +3573,10 @@ static int ext4_block_truncate_page(handunsigned blocksize;struct inode *inode = mapping->host; +/* If we are processing an encrypted inode during orphan list handling */ +if (ext4_encrypted_inode (inode) && !ext4_has_encryption_key (inode)) +return 0 ; + blocksize = inode->i_sb->s_blocksize; length = blocksize - (offset & (blocksize -1 ));
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.55 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Mar 18 14:28:52 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.55-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.55 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Mar 18 14:28:52 UTC 2017. Anything received after that time might be too late.
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 115 pass: 115 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter