AgeCommit message (Collapse)Author
2021-11-09ARM: configs: apalis-imx6: fix android config apalis_imx6_android_defconfigtoradex_4.9-2.3.x-imx-nexttoradex_4.9-2.3.x-imxDenys Drozdov
Update android config file to avoid the following build errors: arm-none-linux-gnueabihf-ld: drivers/built-in.o: in function `gckOS_CreateSyncTimeline': core.c:(.text+0x2736a8): undefined reference to `viv_sync_timeline_create' arm-none-linux-gnueabihf-ld: drivers/built-in.o: in function `gckOS_DestroySyncTimeline': core.c:(.text+0x2736d4): undefined reference to `viv_sync_timeline_destroy' arm-none-linux-gnueabihf-ld: drivers/built-in.o: in function `gckOS_CreateNativeFence': core.c:(.text+0x273720): undefined reference to `viv_fence_create' arm-none-linux-gnueabihf-ld: core.c:(.text+0x27372c): undefined reference to `sync_file_create' arm-none-linux-gnueabihf-ld: drivers/built-in.o: in function `gckOS_WaitNativeFence': core.c:(.text+0x273804): undefined reference to `sync_file_get_fence' arm-none-linux-gnueabihf-ld: arch/arm/mach-imx/built-in.o: in function `imx6sl_enter_wait': platform-imx-dma.c:(.text+0x380): undefined reference to `psci_ops' arm-none-linux-gnueabihf-ld: platform-imx-dma.c:(.text+0x384): undefined reference to `psci_ops' Makefile:1016: recipe for target 'vmlinux' failed make[1]: *** [vmlinux] Error 1 Makefile:536: recipe for target '__build_one_by_one' failed make: *** [__build_one_by_one] Error 2 Signed-off-by: Denys Drozdov <>
2021-11-09.gitlab-ci.yml: update CI build scriptDenys Drozdov
Use up to date container to verify build commit Signed-off-by: Denys Drozdov <>
2021-11-08dt-bindings: micrel-ksz90x1: Add rxc-dll and txc-dll propertiesPhilippe Schenker
This commit adds two properties to control the RX DLL and TX DLL 2ns delay on RXC/TXC RGMII clock lines. This is especially needed if the MAC does not provide TXC delay by itself. Related-to: ELB-1299 Signed-off-by: Philippe Schenker <>
2021-11-08net: phy: micrel: Add KSZ9131 rxdll txdll bypass dt propertiesPhilippe Schenker
With this patch one is able to control the rx dll and tx dll bypass bits, hence the 2ns delay on rxc and txc lines in devicetree. Related-to: ELB-1299 Signed-off-by: Philippe Schenker <>
2021-11-08ARM: mach-imx6q: add ksz9131rn_phy_fixupPhilippe Schenker
The MAC of the i.MX6 SoC is compliant with RGMII v1.3. The KSZ9131 PHY is like KSZ9031 adhering to RGMII v2.0 specification. This means the MAC should provide a delay to the TXC line. Because the i.MX6 MAC does not provide this delay this has to be done in the PHY. This patch adds by default ~1.4ns delay to the TXC line. This should be good for all boards that have all RGMII signals routed with the same length. The KSZ9131 has relatively high tolerances on skew registers from MMD 2.4 to MMD 2.8. Therefore the new DLL-based delay of 2ns is used and then as little as possibly subtracted from that so we get more accurate delay. This is actually needed because the i.MX6 SoC has an asyn skew on TXC from -100ps to 900ps. Related-to: ELB-1299 Signed-off-by: Philippe Schenker <>
2021-11-08dt-bindings: net: add support for Microchip KSZ9131Yuiko Oshino
Add support for Microchip Technology KSZ9131 10/100/1000 Ethernet PHY Signed-off-by: Yuiko Oshino <> Signed-off-by: David S. Miller <> (cherry picked from commit bff5b4b3737219195ca0caef4ff7884303cb5dc1) Related-to: ELB-1299 Signed-off-by: Philippe Schenker <>
2021-11-08net: phy: micrel: add Microchip KSZ9131 initial driverYuiko Oshino
Add support for Microchip Technology KSZ9131 10/100/1000 Ethernet PHY Signed-off-by: Yuiko Oshino <> Signed-off-by: David S. Miller <> (cherry picked from commit bff5b4b3737219195ca0caef4ff7884303cb5dc1) Backport: Added the line: '.config_aneg = genphy_config_aneg,' to KSZ9131 data structure Related-to: ELB-1299 Signed-off-by: Philippe Schenker <>
2020-06-04ARM: colibri-im6ull: enable on-module bluetoothColibri-iMX7_LXDE-Image_2.8b7.-20200610Colibri-iMX6_LXDE-Image_2.8b7.-20200610Colibri-iMX6ULL_LXDE-Image_2.8b7.-20200610Apalis-iMX6_LXDE-Image_2.8b7.-20200610Oleksandr Suvorov
Colibri-iMX6ULL WB version includes the on-module WiFi/Bluetooth device AW-CM276NF. Enable driver support for Bluetooth part of this device. Related-to: ELB-2767 Signed-off-by: Oleksandr Suvorov <>
2020-05-21Merge remote-tracking branch 'remotes/fslc/4.9-2.3.x-imx' into ↵Marcel Ziswiler
toradex_4.9-2.3.x-imx-next Conflicts: sound/soc/codecs/sgtl5000.c sound/soc/fsl/imx-sgtl5000.c
2020-05-20Merge pull request #76 from toradex/4.9-2.3.x-imxOtavio Salvador
4.9 2.3.x imx
2020-05-19Merge tag 'v4.9.220' into 4.9-2.3.x-imxMarcel Ziswiler
This is the 4.9.220 stable release Conflicts: arch/arm/Kconfig.debug arch/arm/boot/dts/imx7s.dtsi arch/arm/mach-imx/common.h arch/arm/mach-imx/cpuidle-imx6q.c arch/arm/mach-imx/cpuidle-imx6sx.c arch/arm/mach-imx/suspend-imx6.S block/blk-core.c drivers/crypto/caam/caamalg.c drivers/crypto/mxs-dcp.c drivers/dma/imx-sdma.c drivers/gpu/drm/bridge/adv7511/adv7511_drv.c drivers/input/keyboard/imx_keypad.c drivers/input/keyboard/snvs_pwrkey.c drivers/mmc/host/sdhci.c drivers/net/can/flexcan.c drivers/net/ethernet/freescale/fec_main.c drivers/net/phy/phy_device.c drivers/net/wireless/ath/ath10k/pci.c drivers/tty/serial/imx.c drivers/usb/dwc3/gadget.c drivers/usb/host/xhci.c include/linux/blkdev.h include/linux/cpu.h include/linux/platform_data/dma-imx-sdma.h kernel/cpu.c net/wireless/util.c sound/soc/fsl/Kconfig sound/soc/fsl/fsl_esai.c sound/soc/fsl/fsl_sai.c sound/soc/fsl/imx-sgtl5000.c
2020-05-14arm64: defconfig: enable options required for backportsOleksandr Suvorov
Enable WIRELESS_EXT, WEXT_PRIV and MODULE_SIG options that are needed for the backports-5.4. Related-to: ELB-2724 Signed-off-by: Oleksandr Suvorov <>
2020-05-14arm64: defconfig: disable wireless driversOleksandr Suvorov
Disable wireless drivers and cfg80211 module to avoid conflicts with backported drivers. Related-to: ELB-2724 Signed-off-by: Oleksandr Suvorov <>
2020-05-14ARM: apalis/colibri-imx6/7/6ull: disable wireless driversOleksandr Suvorov
Disabling all wireless drivers and cfg80211 module to avoid conflicts with backported drivers. Related-to: ELB-2724 Signed-off-by: Oleksandr Suvorov <>
2020-05-14ARM: apalis/colibri-imx6/7/6ull: enable options required for backportsOleksandr Suvorov
Enable WIRELESS_EXT, WEXT_PRIV and MODULE_SIG options as needed for the backports-5.4. Related-to: ELB-2724 Signed-off-by: Oleksandr Suvorov <>
2020-05-14wireless: make wireless_ext and wext_priv storableOleksandr Suvorov
The config option WIRELESS_EXT and WEXT_PRIV use to build external drivers, such as backports. Make these options storable in config file to be able to set them independently. Related-to: ELB-2388 Signed-off-by: Oleksandr Suvorov <>
2020-05-08ARM: dts: colibri-imx6ull: Use pull-down for adc pinsPhilippe Schenker
As suggested by the reference manual in a note in chapter 13.2 this commit disables the keeper and enables a 100k pull-down on the adc pins. Related-to: ELB-2690 Signed-off-by: Philippe Schenker <> (cherry picked from commit d5a3675860d03d783689de3ed7cb3dec27e6a155)
2020-04-24Linux 4.9.220Greg Kroah-Hartman
2020-04-24x86/vdso: Fix lsl operand orderSamuel Neves
commit e78e5a91456fcecaa2efbb3706572fe043766f4d upstream. In the __getcpu function, lsl is using the wrong target and destination registers. Luckily, the compiler tends to choose %eax for both variables, so it has been working so far. Fixes: a582c540ac1b ("x86/vdso: Use RDPID in preference to LSL when available") Signed-off-by: Samuel Neves <> Signed-off-by: Thomas Gleixner <> Acked-by: Andy Lutomirski <> Cc: Link: Signed-off-by: Nobuhiro Iwamatsu (CIP) <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)Evalds Iodzevics
On Intel it is required to do CPUID(1) before reading the microcode revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call CPUID, unfortunately on 32 bit machines code inside sync_core() always jumps past CPUID instruction as it depends on data structure boot_cpu_data witch are not populated correctly so early in boot sequence. It depends on: commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single datum") This patch is for 4.4 but also should apply to 4.9 Signed-off-by: Evalds Iodzevics <> Cc: Signed-off-by: Greg Kroah-Hartman <>
2020-04-24x86/CPU: Add native CPUID variants returning a single datumBorislav Petkov
commit 5dedade6dfa243c130b85d1e4daba6f027805033 upstream. ... similarly to the cpuid_<reg>() variants. Signed-off-by: Borislav Petkov <> Link: Signed-off-by: Thomas Gleixner <> Cc: Evalds Iodzevics <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24mtd: phram: fix a double free issue in error pathWen Yang
commit 49c64df880570034308e4a9a49c4bc95cf8cdb33 upstream. The variable 'name' is released multiple times in the error path, which may cause double free issues. This problem is avoided by adding a goto label to release the memory uniformly. And this change also makes the code a bit more cleaner. Fixes: 4f678a58d335 ("mtd: fix memory leaks in phram_setup") Signed-off-by: Wen Yang <> Cc: Joern Engel <> Cc: Miquel Raynal <> Cc: Richard Weinberger <> Cc: Vignesh Raghavendra <> Cc: Cc: Signed-off-by: Miquel Raynal <> Link: Signed-off-by: Greg Kroah-Hartman <>
2020-04-24mtd: lpddr: Fix a double free in probe()Dan Carpenter
commit 4da0ea71ea934af18db4c63396ba2af1a679ef02 upstream. This function is only called from lpddr_probe(). We free "lpddr" both here and in the caller, so it's a double free. The best place to free "lpddr" is in lpddr_probe() so let's delete this one. Fixes: 8dc004395d5e ("[MTD] LPDDR qinfo probing.") Signed-off-by: Dan Carpenter <> Signed-off-by: Miquel Raynal <> Link: Signed-off-by: Greg Kroah-Hartman <>
2020-04-24locktorture: Print ratio of acquisitions, not failuresPaul E. McKenney
commit 80c503e0e68fbe271680ab48f0fe29bc034b01b7 upstream. The __torture_print_stats() function in locktorture.c carefully initializes local variable "min" to statp[0].n_lock_acquired, but then compares it to statp[i].n_lock_fail. Given that the .n_lock_fail field should normally be zero, and given the initialization, it seems reasonable to display the maximum and minimum number acquisitions instead of miscomputing the maximum and minimum number of failures. This commit therefore switches from failures to acquisitions. And this turns out to be not only a day-zero bug, but entirely my own fault. I hate it when that happens! Fixes: 0af3fe1efa53 ("locktorture: Add a lock-torture kernel module") Reported-by: Will Deacon <> Signed-off-by: Paul E. McKenney <> Acked-by: Will Deacon <> Cc: Davidlohr Bueso <> Cc: Josh Triplett <> Cc: Peter Zijlstra <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24tty: evh_bytechan: Fix out of bounds accessesStephen Rothwell
commit 3670664b5da555a2a481449b3baafff113b0ac35 upstream. ev_byte_channel_send() assumes that its third argument is a 16 byte array. Some places where it is called it may not be (or we can't easily tell if it is). Newer compilers have started producing warnings about this, so make sure we actually pass a 16 byte array. There may be more elegant solutions to this, but the driver is quite old and hasn't been updated in many years. The warnings (from a powerpc allyesconfig build) are: In file included from include/linux/byteorder/big_endian.h:5, from arch/powerpc/include/uapi/asm/byteorder.h:14, from include/asm-generic/bitops/le.h:6, from arch/powerpc/include/asm/bitops.h:250, from include/linux/bitops.h:29, from include/linux/kernel.h:12, from include/asm-generic/bug.h:19, from arch/powerpc/include/asm/bug.h:109, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from drivers/tty/ehv_bytechan.c:24: drivers/tty/ehv_bytechan.c: In function ‘ehv_bc_udbg_putc’: arch/powerpc/include/asm/epapr_hcalls.h:298:20: warning: array subscript 1 is outside array bounds of ‘const char[1]’ [-Warray-bounds] 298 | r6 = be32_to_cpu(p[1]); include/uapi/linux/byteorder/big_endian.h:40:51: note: in definition of macro ‘__be32_to_cpu’ 40 | #define __be32_to_cpu(x) ((__force __u32)(__be32)(x)) | ^ arch/powerpc/include/asm/epapr_hcalls.h:298:7: note: in expansion of macro ‘be32_to_cpu’ 298 | r6 = be32_to_cpu(p[1]); | ^~~~~~~~~~~ drivers/tty/ehv_bytechan.c:166:13: note: while referencing ‘data’ 166 | static void ehv_bc_udbg_putc(char c) | ^~~~~~~~~~~~~~~~ Fixes: dcd83aaff1c8 ("tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver") Signed-off-by: Stephen Rothwell <> Tested-by: Laurentiu Tudor <> [mpe: Trim warnings from change log] Signed-off-by: Michael Ellerman <> Link: Signed-off-by: Greg Kroah-Hartman <>
2020-04-24fbdev: potential information leak in do_fb_ioctl()Dan Carpenter
commit d3d19d6fc5736a798b118971935ce274f7deaa82 upstream. The "fix" struct has a 2 byte hole after ->ywrapstep and the "fix = info->fix;" assignment doesn't necessarily clear it. It depends on the compiler. The solution is just to replace the assignment with an memcpy(). Fixes: 1f5e31d7e55a ("fbmem: don't call copy_from/to_user() with mutex held") Signed-off-by: Dan Carpenter <> Cc: Andrew Morton <> Cc: Arnd Bergmann <> Cc: "Eric W. Biederman" <> Cc: Andrea Righi <> Cc: Daniel Vetter <> Cc: Sam Ravnborg <> Cc: Maarten Lankhorst <> Cc: Daniel Thompson <> Cc: Peter Rosin <> Cc: Jani Nikula <> Cc: Gerd Hoffmann <> Signed-off-by: Bartlomiej Zolnierkiewicz <> Link: Signed-off-by: Greg Kroah-Hartman <>
2020-04-24iommu/amd: Fix the configuration of GCR3 table root pointerAdrian Huang
[ Upstream commit c20f36534666e37858a14e591114d93cc1be0d34 ] The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However, this requires 21 bits (Please see the AMD IOMMU specification). This leads to the potential failure when the bit 51 of SPA of the GCR3 table root pointer is 1'. Signed-off-by: Adrian Huang <> Fixes: 52815b75682e2 ("iommu/amd: Add support for IOMMUv2 domain mode") Signed-off-by: Joerg Roedel <> Signed-off-by: Sasha Levin <>
2020-04-24libnvdimm: Out of bounds read in __nd_ioctl()Dan Carpenter
[ Upstream commit f84afbdd3a9e5e10633695677b95422572f920dc ] The "cmd" comes from the user and it can be up to 255. It it's more than the number of bits in long, it results out of bounds read when we check test_bit(cmd, &cmd_mask). The highest valid value for "cmd" is ND_CMD_CALL (10) so I added a compare against that. Fixes: 62232e45f4a2 ("libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices") Signed-off-by: Dan Carpenter <> Link: Signed-off-by: Dan Williams <> Signed-off-by: Sasha Levin <>
2020-04-24ext2: fix debug reference to ext2_xattr_cacheJan Kara
[ Upstream commit 32302085a8d90859c40cf1a5e8313f575d06ec75 ] Fix a debug-only build error in ext2/xattr.c: When building without extra debugging, (and with another patch that uses no_printk() instead of <empty> for the ext2-xattr debug-print macros, this build error happens: ../fs/ext2/xattr.c: In function ‘ext2_xattr_cache_insert’: ../fs/ext2/xattr.c:869:18: error: ‘ext2_xattr_cache’ undeclared (first use in this function); did you mean ‘ext2_xattr_list’? atomic_read(&ext2_xattr_cache->c_entry_count)); Fix the problem by removing cached entry count from the debug message since otherwise we'd have to export the mbcache structure just for that. Fixes: be0726d33cb8 ("ext2: convert to mbcache2") Reported-by: Randy Dunlap <> Signed-off-by: Jan Kara <> Signed-off-by: Sasha Levin <>
2020-04-24ext2: fix empty body warnings when -Wextra is usedRandy Dunlap
[ Upstream commit 44a52022e7f15cbaab957df1c14f7a4f527ef7cf ] When EXT2_ATTR_DEBUG is not defined, modify the 2 debug macros to use the no_printk() macro instead of <nothing>. This fixes gcc warnings when -Wextra is used: ../fs/ext2/xattr.c:252:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:258:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:330:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:872:45: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] I have verified that the only object code change (with gcc 7.5.0) is the reversal of some instructions from 'cmp a,b' to 'cmp b,a'. Link: Signed-off-by: Randy Dunlap <> Cc: Jan Kara <> Cc: Signed-off-by: Jan Kara <> Signed-off-by: Sasha Levin <>
2020-04-24NFS: Fix memory leaks in nfs_pageio_stop_mirroring()Trond Myklebust
[ Upstream commit 862f35c94730c9270833f3ad05bd758a29f204ed ] If we just set the mirror count to 1 without first clearing out the mirrors, we can leak queued up requests. Signed-off-by: Trond Myklebust <> Signed-off-by: Sasha Levin <>
2020-04-24KVM: s390: vsie: Fix possible race when shadowing region 3 tablesDavid Hildenbrand
[ Upstream commit 1493e0f944f3c319d11e067c185c904d01c17ae5 ] We have to properly retry again by returning -EINVAL immediately in case somebody else instantiated the table concurrently. We missed to add the goto in this function only. The code now matches the other, similar shadowing functions. We are overwriting an existing region 2 table entry. All allocated pages are added to the crst_list to be freed later, so they are not lost forever. However, when unshadowing the region 2 table, we wouldn't trigger unshadowing of the original shadowed region 3 table that we replaced. It would get unshadowed when the original region 3 table is modified. As it's not connected to the page table hierarchy anymore, it's not going to get used anymore. However, for a limited time, this page table will stick around, so it's in some sense a temporary memory leak. Identified by manual code inspection. I don't think this classifies as stable material. Fixes: 998f637cc4b9 ("s390/mm: avoid races on region/segment/page table shadowing") Signed-off-by: David Hildenbrand <> Link: Reviewed-by: Claudio Imbrenda <> Reviewed-by: Christian Borntraeger <> Signed-off-by: Christian Borntraeger <> Signed-off-by: Sasha Levin <>
2020-04-24compiler.h: fix error in BUILD_BUG_ON() reportingVegard Nossum
[ Upstream commit af9c5d2e3b355854ff0e4acfbfbfadcd5198a349 ] compiletime_assert() uses __LINE__ to create a unique function name. This means that if you have more than one BUILD_BUG_ON() in the same source line (which can happen if they appear e.g. in a macro), then the error message from the compiler might output the wrong condition. For this source file: #include <linux/build_bug.h> #define macro() \ BUILD_BUG_ON(1); \ BUILD_BUG_ON(0); void foo() { macro(); } gcc would output: ./include/linux/compiler.h:350:38: error: call to `__compiletime_assert_9' declared with attribute error: BUILD_BUG_ON failed: 0 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) However, it was not the BUILD_BUG_ON(0) that failed, so it should say 1 instead of 0. With this patch, we use __COUNTER__ instead of __LINE__, so each BUILD_BUG_ON() gets a different function name and the correct condition is printed: ./include/linux/compiler.h:350:38: error: call to `__compiletime_assert_0' declared with attribute error: BUILD_BUG_ON failed: 1 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) Signed-off-by: Vegard Nossum <> Signed-off-by: Andrew Morton <> Reviewed-by: Masahiro Yamada <> Reviewed-by: Daniel Santos <> Cc: Rasmus Villemoes <> Cc: Ian Abbott <> Cc: Joe Perches <> Link: Signed-off-by: Linus Torvalds <> Signed-off-by: Sasha Levin <>
2020-04-24percpu_counter: fix a data race at vm_committed_asQian Cai
[ Upstream commit 7e2345200262e4a6056580f0231cccdaffc825f3 ] "vm_committed_as.count" could be accessed concurrently as reported by KCSAN, BUG: KCSAN: data-race in __vm_enough_memory / percpu_counter_add_batch write to 0xffffffff9451c538 of 8 bytes by task 65879 on cpu 35: percpu_counter_add_batch+0x83/0xd0 percpu_counter_add_batch at lib/percpu_counter.c:91 __vm_enough_memory+0xb9/0x260 dup_mm+0x3a4/0x8f0 copy_process+0x2458/0x3240 _do_fork+0xaa/0x9f0 __do_sys_clone+0x125/0x160 __x64_sys_clone+0x70/0x90 do_syscall_64+0x91/0xb05 entry_SYSCALL_64_after_hwframe+0x49/0xbe read to 0xffffffff9451c538 of 8 bytes by task 66773 on cpu 19: __vm_enough_memory+0x199/0x260 percpu_counter_read_positive at include/linux/percpu_counter.h:81 (inlined by) __vm_enough_memory at mm/util.c:839 mmap_region+0x1b2/0xa10 do_mmap+0x45c/0x700 vm_mmap_pgoff+0xc0/0x130 ksys_mmap_pgoff+0x6e/0x300 __x64_sys_mmap+0x33/0x40 do_syscall_64+0x91/0xb05 entry_SYSCALL_64_after_hwframe+0x49/0xbe The read is outside percpu_counter::lock critical section which results in a data race. Fix it by adding a READ_ONCE() in percpu_counter_read_positive() which could also service as the existing compiler memory barrier. Signed-off-by: Qian Cai <> Signed-off-by: Andrew Morton <> Acked-by: Marco Elver <> Link: Signed-off-by: Linus Torvalds <> Signed-off-by: Sasha Levin <>
2020-04-24ext4: do not commit super on read-only bdevEric Sandeen
[ Upstream commit c96e2b8564adfb8ac14469ebc51ddc1bfecb3ae2 ] Under some circumstances we may encounter a filesystem error on a read-only block device, and if we try to save the error info to the superblock and commit it, we'll wind up with a noisy error and backtrace, i.e.: [ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0: comm mount: iget: illegal inode # ------------[ cut here ]------------ generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2) WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0 ... To avoid this, commit the error info in the superblock only if the block device is writable. Reported-by: Ritesh Harjani <> Signed-off-by: Eric Sandeen <> Reviewed-by: Andreas Dilger <> Link: Signed-off-by: Theodore Ts'o <> Signed-off-by: Sasha Levin <>
2020-04-24powerpc/maple: Fix declaration made after definitionNathan Chancellor
[ Upstream commit af6cf95c4d003fccd6c2ecc99a598fb854b537e7 ] When building ppc64 defconfig, Clang errors (trimmed for brevity): arch/powerpc/platforms/maple/setup.c:365:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] machine_device_initcall(maple, maple_cpc925_edac_setup); ^ machine_device_initcall expands to __define_machine_initcall, which in turn has the macro machine_is used in it, which declares mach_##name with an __attribute__((weak)). define_machine actually defines mach_##name, which in this file happens before the declaration, hence the warning. To fix this, move define_machine after machine_device_initcall so that the declaration occurs before the definition, which matches how machine_device_initcall and define_machine work throughout arch/powerpc. While we're here, remove some spaces before tabs. Fixes: 8f101a051ef0 ("edac: cpc925 MC platform device setup") Reported-by: Nick Desaulniers <> Suggested-by: Ilie Halip <> Signed-off-by: Nathan Chancellor <> Signed-off-by: Michael Ellerman <> Link: Signed-off-by: Sasha Levin <>
2020-04-24s390/cpuinfo: fix wrong output when CPU0 is offlineAlexander Gordeev
[ Upstream commit 872f27103874a73783aeff2aac2b41a489f67d7c ] /proc/cpuinfo should not print information about CPU 0 when it is offline. Fixes: 281eaa8cb67c ("s390/cpuinfo: simplify locking and skip offline cpus early") Signed-off-by: Alexander Gordeev <> Reviewed-by: Heiko Carstens <> [ shortened commit message] Signed-off-by: Heiko Carstens <> Signed-off-by: Vasily Gorbik <> Signed-off-by: Sasha Levin <>
2020-04-24NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context failsMisono Tomohiro
[ Upstream commit 8605cf0e852af3b2c771c18417499dc4ceed03d5 ] When dreq is allocated by nfs_direct_req_alloc(), dreq->kref is initialized to 2. Therefore we need to call nfs_direct_req_release() twice to release the allocated dreq. Usually it is called in nfs_file_direct_{read, write}() and nfs_direct_complete(). However, current code only calls nfs_direct_req_relese() once if nfs_get_lock_context() fails in nfs_file_direct_{read, write}(). So, that case would result in memory leak. Fix this by adding the missing call. Signed-off-by: Misono Tomohiro <> Signed-off-by: Trond Myklebust <> Signed-off-by: Sasha Levin <>
2020-04-24clk: tegra: Fix Tegra PMC clock out parentsSowjanya Komatineni
[ Upstream commit 6fe38aa8cac3a5db38154331742835a4d9740788 ] Tegra PMC clocks clk_out_1, clk_out_2, and clk_out_3 supported parents are osc, osc_div2, osc_div4 and extern clock. Clock driver is using incorrect parents clk_m, clk_m_div2, clk_m_div4 for PMC clocks. This patch fixes this. Tested-by: Dmitry Osipenko <> Reviewed-by: Dmitry Osipenko <> Signed-off-by: Sowjanya Komatineni <> Signed-off-by: Thierry Reding <> Signed-off-by: Sasha Levin <>
2020-04-24power: supply: bq27xxx_battery: Silence deferred-probe errorDmitry Osipenko
[ Upstream commit 583b53ece0b0268c542a1eafadb62e3d4b0aab8c ] The driver fails to probe with -EPROBE_DEFER if battery's power supply (charger driver) isn't ready yet and this results in a bit noisy error message in KMSG during kernel's boot up. Let's silence the harmless error message. Signed-off-by: Dmitry Osipenko <> Reviewed-by: Andrew F. Davis <> Reviewed-by: Pali Rohár <> Signed-off-by: Sebastian Reichel <> Signed-off-by: Sasha Levin <>
2020-04-24clk: at91: usb: continue if clk_hw_round_rate() return zeroClaudiu Beznea
[ Upstream commit b0ecf1c6c6e82da4847900fad0272abfd014666d ] clk_hw_round_rate() may call round rate function of its parents. In case of SAM9X60 two of USB parrents are PLLA and UPLL. These clocks are controlled by clk-sam9x60-pll.c driver. The round rate function for this driver is sam9x60_pll_round_rate() which call in turn sam9x60_pll_get_best_div_mul(). In case the requested rate is not in the proper range (rate < characteristics->output[0].min && rate > characteristics->output[0].max) the sam9x60_pll_round_rate() will return a negative number to its caller (called by clk_core_round_rate_nolock()). clk_hw_round_rate() will return zero in case a negative number is returned by clk_core_round_rate_nolock(). With this, the USB clock will continue its rate computation even caller of clk_hw_round_rate() returned an error. With this, the USB clock on SAM9X60 may not chose the best parent. I detected this after a suspend/resume cycle on SAM9X60. Signed-off-by: Claudiu Beznea <> Link: Signed-off-by: Stephen Boyd <> Signed-off-by: Sasha Levin <>
2020-04-24of: unittest: kmemleak in of_unittest_platform_populate()Frank Rowand
[ Upstream commit 216830d2413cc61be3f76bc02ffd905e47d2439e ] kmemleak reports several memory leaks from devicetree unittest. This is the fix for problem 2 of 5. of_unittest_platform_populate() left an elevated reference count for grandchild nodes (which are platform devices). Fix the platform device reference counts so that the memory will be freed. Fixes: fb2caa50fbac ("of/selftest: add testcase for nodes with same name and address") Reported-by: Erhard F. <> Signed-off-by: Frank Rowand <> Signed-off-by: Rob Herring <> Signed-off-by: Sasha Levin <>
2020-04-24arm64: cpu_errata: include required headersArnd Bergmann
commit 94a5d8790e79ab78f499d2d9f1ff2cab63849d9f upstream. Without including psci.h and arm-smccc.h, we now get a build failure in some configurations: arch/arm64/kernel/cpu_errata.c: In function 'arm64_update_smccc_conduit': arch/arm64/kernel/cpu_errata.c:278:10: error: 'psci_ops' undeclared (first use in this function); did you mean 'sysfs_ops'? arch/arm64/kernel/cpu_errata.c: In function 'arm64_set_ssbd_mitigation': arch/arm64/kernel/cpu_errata.c:311:3: error: implicit declaration of function 'arm_smccc_1_1_hvc' [-Werror=implicit-function-declaration] arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_WORKAROUND_2, state, NULL); Signed-off-by: Arnd Bergmann <> Signed-off-by: Catalin Marinas <> Signed-off-by: Nathan Chancellor <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24of: fix missing kobject init for !SYSFS && OF_DYNAMIC configRob Herring
[ Upstream commit bd82bbf38cbe27f2c65660da801900d71bcc5cc8 ] The ref counting is broken for OF_DYNAMIC when sysfs is disabled because the kobject initialization is skipped. Only the properties add/remove/update should be skipped for !SYSFS config. Tested-by: Nicolas Pitre <> Reviewed-by: Frank Rowand <> Acked-by: Grant Likely <> Signed-off-by: Rob Herring <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24soc: qcom: smem: Use le32_to_cpu for comparisonChris Lew
[ Upstream commit a216000f0140f415cec96129f777b5234c9d142f ] Endianness can vary in the system, add le32_to_cpu when comparing partition sizes from smem. Signed-off-by: Chris Lew <> Acked-by: Bjorn Andersson <> Signed-off-by: Andy Gross <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24wil6210: fix length check in __wmi_sendLior David
[ Upstream commit 26a6d5274865532502c682ff378ac8ebe2886238 ] The current length check: sizeof(cmd) + len > r->entry_size will allow very large values of len (> U16_MAX - sizeof(cmd)) and can cause a buffer overflow. Fix the check to cover this case. In addition, ensure the mailbox entry_size is not too small, since this can also bypass the above check. Signed-off-by: Lior David <> Signed-off-by: Maya Erez <> Signed-off-by: Kalle Valo <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24rtc: pm8xxx: Fix issue in RTC write pathMohit Aggarwal
[ Upstream commit 83220bf38b77a830f8e62ab1a0d0408304f9b966 ] In order to set time in rtc, need to disable rtc hw before writing into rtc registers. Also fixes disabling of alarm while setting rtc time. Signed-off-by: Mohit Aggarwal <> Signed-off-by: Alexandre Belloni <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24wil6210: rate limit wil_rx_refill errorDedy Lansky
[ Upstream commit 3d6b72729cc2933906de8d2c602ae05e920b2122 ] wil_err inside wil_rx_refill can flood the log buffer. Replace it with wil_err_ratelimited. Signed-off-by: Dedy Lansky <> Signed-off-by: Maya Erez <> Signed-off-by: Kalle Valo <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24scsi: ufs: ufs-qcom: remove broken hci version quirkSubhash Jadavani
[ Upstream commit 69a6fff068567469c0ef1156ae5ac8d3d71701f0 ] UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION is only applicable for QCOM UFS host controller version 2.x.y and this has been fixed from version 3.x.y onwards, hence this change removes this quirk for version 3.x.y onwards. [mkp: applied by hand] Signed-off-by: Subhash Jadavani <> Signed-off-by: Asutosh Das <> Signed-off-by: Martin K. Petersen <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>
2020-04-24scsi: ufs: make sure all interrupts are processedVenkat Gopalakrishnan
[ Upstream commit 7f6ba4f12e6cbfdefbb95cfd8fc67ece6c15d799 ] As multiple requests are submitted to the ufs host controller in parallel there could be instances where the command completion interrupt arrives later for a request that is already processed earlier as the corresponding doorbell was cleared when handling the previous interrupt. Read the interrupt status in a loop after processing the received interrupt to catch such interrupts and handle it. Signed-off-by: Venkat Gopalakrishnan <> Signed-off-by: Asutosh Das <> Reviewed-by: Subhash Jadavani <> Signed-off-by: Martin K. Petersen <> Signed-off-by: Lee Jones <> Signed-off-by: Greg Kroah-Hartman <>