4.19.97-stable review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 4.19.97-stable review
This is the start of the stable review cycle for the 4.19.97 release. There are 84 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, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.97-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.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.19.97-rc1
Kai Li <[email protected]>
ocfs2: call journal flush to mark journal as empty after journal recovery when mount
Nick Desaulniers <[email protected]>
hexagon: work around compiler crash
Nick Desaulniers <[email protected]>
hexagon: parenthesize registers in asm predicates
[email protected] <[email protected]>
ioat: ioat_alloc_ring() failure handling.
John Stultz <[email protected]>
dmaengine: k3dma: Avoid null pointer traversal
Ben Dooks (Codethink) <[email protected]>
drm/arm/mali: make malidp_mw_connector_helper_funcs static
Jouni Hogander <[email protected]>
MIPS: Prevent link failure with kcov instrumentation
Vladimir Kondratiev <[email protected]>
mips: cacheinfo: report shared CPU map
Mathieu Desnoyers <[email protected]>
rseq/selftests: Turn off timeout setting
Shuah Khan <[email protected]>
selftests: firmware: Fix it to do root uid check and skip
Varun Prakash <[email protected]>
scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
Johnson CH Chen (陳昭勳) <[email protected]>
gpio: mpc8xxx: Add platform device to gpiochip->parent
Chuhong Yuan <[email protected]>
rtc: brcmstb-waketimer: add missed clk_disable_unprepare
Kars de Jong <[email protected]>
rtc: msm6242: Fix reading of 10-hour digit
Chao Yu <[email protected]>
f2fs: fix potential overflow
Nathan Chancellor <[email protected]>
rtlwifi: Remove unnecessary NULL check in rtl_regd_init
Mans Rullgard <[email protected]>
spi: atmel: fix handling of cs_change set on non-last xfer
Sergei Shtylyov <[email protected]>
mtd: spi-nor: fix silent truncation in spi_nor_read_raw()
Sergei Shtylyov <[email protected]>
mtd: spi-nor: fix silent truncation in spi_nor_read()
Yong Wu <[email protected]>
iommu/mediatek: Correct the flush_iotlb_all callback
Seung-Woo Kim <[email protected]>
media: exynos4-is: Fix recursive locking in isp_video_release()
Christophe JAILLET <[email protected]>
media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'
Niklas Söderlund <[email protected]>
media: rcar-vin: Fix incorrect return statement in rvin_try_format()
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix some format attributes not under control
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix incorrect use of JPEG colorspace
Peng Fan <[email protected]>
tty: serial: pch_uart: correct usage of dma_unmap_sg
Peng Fan <[email protected]>
tty: serial: imx: use the sg count from dma_map_sg
Oliver O'Halloran <[email protected]>
powerpc/powernv: Disable native PCIe port management
Bjorn Helgaas <[email protected]>
PCI/PTM: Remove spurious "d" from granularity message
Niklas Cassel <[email protected]>
PCI: dwc: Fix find_next_bit() usage
Arnd Bergmann <[email protected]>
compat_ioctl: handle SIOCOUTQNSD
Arnd Bergmann <[email protected]>
af_unix: add compat_ioctl support
Loic Poulain <[email protected]>
arm64: dts: apq8096-db820c: Increase load on l21 for SDCARD
Arnd Bergmann <[email protected]>
scsi: sd: enable compat ioctls for sed-opal
Andy Shevchenko <[email protected]>
pinctrl: lewisburg: Update pin list according to v1.1v6
Colin Ian King <[email protected]>
pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
Marian Mihailescu <[email protected]>
clk: samsung: exynos5420: Preserve CPU clocks configuration during suspend/resume
Alexander Usyskin <[email protected]>
mei: fix modalias documentation
Alexandru Ardelean <[email protected]>
iio: imu: adis16480: assign bias value only if operation succeeded
Trond Myklebust <[email protected]>
NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
Trond Myklebust <[email protected]>
NFSv2: Fix a typo in encode_sattr()
Ard Biesheuvel <[email protected]>
crypto: virtio - implement missing support for output IVs
Chuck Lever <[email protected]>
xprtrdma: Fix completion wait during device removal
Hans de Goede <[email protected]>
platform/x86: GPD pocket fan: Use default values when wrong modparams are given
Jian-Hong Pan <[email protected]>
platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0
Xiang Chen <[email protected]>
scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI
James Bottomley <[email protected]>
scsi: enclosure: Fix stale device oops with hot replug
Bart Van Assche <[email protected]>
RDMA/srpt: Report the SCSI residual to the initiator
Leon Romanovsky <[email protected]>
RDMA/mlx5: Return proper error value
Goldwyn Rodrigues <[email protected]>
btrfs: simplify inode locking for RWF_NOWAIT
Christian König <[email protected]>
drm/ttm: fix incrementing the page pointer for huge pages
Christian König <[email protected]>
drm/ttm: fix start page for huge page check in ttm_put_pages()
David Howells <[email protected]>
afs: Fix missing cell comparison in afs_test_super()
Nathan Chancellor <[email protected]>
cifs: Adjust indentation in smb2_open_file
Alexandra Winter <[email protected]>
s390/qeth: Fix vnicc_is_in_use if rx_bcast not set
Alexandra Winter <[email protected]>
s390/qeth: fix false reporting of VNIC CHAR config failure
Taehee Yoo <[email protected]>
hsr: reset network header when supervision frame is created
Geert Uytterhoeven <[email protected]>
gpio: Fix error message on out-of-range GPIO in lookup table
Jon Derrick <[email protected]>
iommu: Remove device link to group on failure
Swapna Manupati <[email protected]>
gpio: zynq: Fix for bug in zynq_gpio_restore_context API
Peter Ujfalusi <[email protected]>
mtd: onenand: omap2: Pass correct flags for prep_dma_memcpy
Olivier Moysan <[email protected]>
ASoC: stm32: spdifrx: fix race condition in irq handler
Olivier Moysan <[email protected]>
ASoC: stm32: spdifrx: fix inconsistent lock state
Daniel Baluta <[email protected]>
ASoC: soc-core: Set dpcm_playback / dpcm_capture
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Fix Send Work Entry state check while polling completions
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Avoid freeing MR resources if dereg fails
Ran Bi <[email protected]>
rtc: mt6397: fix alarm register overwrite
Tyler Hicks <[email protected]>
drm/i915: Fix use-after-free when destroying GEM context
YueHaibing <[email protected]>
dccp: Fix memleak in __feat_register_sp
Navid Emamdoost <[email protected]>
RDMA: Fix goto target to release the allocated memory
Navid Emamdoost <[email protected]>
iwlwifi: pcie: fix memory leaks in iwl_pcie_ctxt_info_gen3_init
Navid Emamdoost <[email protected]>
iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
Vandana BN <[email protected]>
media: usb:zr364xx:Fix KASAN:null-ptr-deref Read in zr364xx_vidioc_querycap
Sheng Yong <[email protected]>
f2fs: check if file namelen exceeds max value
Jaegeuk Kim <[email protected]>
f2fs: check memory boundary by insane namelen
Ben Hutchings <[email protected]>
f2fs: Move err variable to function scope in f2fs_fill_dentries()
Jouni Malinen <[email protected]>
mac80211: Do not send Layer 2 Update frame before authorization
Dedy Lansky <[email protected]>
cfg80211/mac80211: make ieee80211_send_layer2_update a public function
Arnd Bergmann <[email protected]>
fs/select: avoid clang stack usage warning
Arnd Bergmann <[email protected]>
ethtool: reduce stack usage with clang
Jiri Kosina <[email protected]>
HID: hidraw, uhid: Always report EPOLLOUT
Marcel Holtmann <[email protected]>
HID: hidraw: Fix returning EPOLLOUT from hidraw_poll
Fabian Henneke <[email protected]>
hidraw: Return EPOLLOUT from hidraw_poll
-------------
Diffstat:
Documentation/ABI/testing/sysfs-bus-mei | 2 +- Makefile | 4 +- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 + arch/hexagon/include/asm/atomic.h | 8 +- arch/hexagon/include/asm/bitops.h | 8 +- arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/include/asm/futex.h | 6 +- arch/hexagon/include/asm/spinlock.h | 20 +-- arch/hexagon/kernel/stacktrace.c | 4 +- arch/hexagon/kernel/vm_entry.S | 2 +- arch/mips/boot/compressed/Makefile | 3 + arch/mips/kernel/cacheinfo.c | 27 +++- arch/powerpc/platforms/powernv/pci.c | 17 ++ drivers/clk/samsung/clk-exynos5420.c | 2 + drivers/crypto/virtio/virtio_crypto_algs.c | 9 ++ drivers/dma/ioat/dma.c | 3 +- drivers/dma/k3dma.c | 12 +- drivers/gpio/gpio-mpc8xxx.c | 1 + drivers/gpio/gpio-zynq.c | 8 +- drivers/gpio/gpiolib.c | 5 +- drivers/gpu/drm/arm/malidp_mw.c | 2 +- drivers/gpu/drm/i915/i915_gem_context.c | 13 +- drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 +- drivers/hid/hidraw.c | 7 +- drivers/hid/uhid.c | 5 +- drivers/iio/imu/adis16480.c | 6 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 +- drivers/infiniband/hw/mlx5/mr.c | 2 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 +++ drivers/iommu/iommu.c | 1 + drivers/iommu/mtk_iommu.c | 2 +- drivers/media/i2c/ov6650.c | 72 ++++++--- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- drivers/media/platform/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 +- drivers/media/usb/zr364xx/zr364xx.c | 3 +- drivers/misc/enclosure.c | 3 +- drivers/mtd/nand/onenand/omap2.c | 3 +- drivers/mtd/spi-nor/spi-nor.c | 4 +- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + .../wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 36 +++-- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- drivers/pci/controller/dwc/pcie-designware-host.c | 11 +- drivers/pci/pcie/ptm.c | 2 +- drivers/pinctrl/intel/pinctrl-lewisburg.c | 171 +++++++++++---------- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +- drivers/platform/x86/asus-wmi.c | 8 +- drivers/platform/x86/gpd-pocket-fan.c | 25 ++- drivers/rtc/rtc-brcmstb-waketimer.c | 1 + drivers/rtc/rtc-msm6242.c | 3 +- drivers/rtc/rtc-mt6397.c | 47 ++++-- drivers/s390/net/qeth_l2_main.c | 4 +- drivers/scsi/cxgbi/libcxgbi.c | 3 +- drivers/scsi/sd.c | 18 ++- drivers/spi/spi-atmel.c | 10 +- drivers/tty/serial/imx.c | 2 +- drivers/tty/serial/pch_uart.c | 5 +- fs/afs/super.c | 1 + fs/btrfs/file.c | 5 +- fs/cifs/smb2file.c | 2 +- fs/f2fs/data.c | 2 +- fs/f2fs/dir.c | 18 ++- fs/f2fs/file.c | 2 +- fs/nfs/nfs2xdr.c | 2 +- fs/nfs/nfs4proc.c | 4 +- fs/ocfs2/journal.c | 8 + include/linux/poll.h | 4 + include/net/cfg80211.h | 11 ++ net/core/ethtool.c | 16 +- net/dccp/feat.c | 7 +- net/hsr/hsr_device.c | 2 + net/mac80211/cfg.c | 58 +------ net/mac80211/sta_info.c | 4 + net/socket.c | 1 + net/sunrpc/xprtrdma/verbs.c | 2 +- net/unix/af_unix.c | 19 +++ net/wireless/util.c | 45 ++++++ sound/soc/soc-core.c | 2 + sound/soc/stm/stm32_spdifrx.c | 36 +++-- tools/testing/selftests/firmware/fw_lib.sh | 6 + tools/testing/selftests/rseq/settings | 1 + 82 files changed, 603 insertions(+), 331 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/84 hidraw: Return EPOLLOUT from hidraw_poll
From: Fabian Henneke <[email protected]>
[ Upstream commit 378b80370aa1fe50f9c48a3ac8af3e416e73b89f ]
Always return EPOLLOUT from hidraw_poll when a device is connected. This is safe since writes are always possible (but will always block).
hidraw does not support non-blocking writes and instead always calls blocking backend functions on write requests. Hence, so far, a call to poll never returned EPOLLOUT, which confuses tools like socat.
In-reply-to: <CA+hv5qkyis03CgYTWeWX9cr0my-d2Oe+aZo+mjmWRXgjrGqyrw@mail.gmail.com>
--- drivers/hid/hidraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hidraw.c +1 -1
@@ -260,7 +260,7 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)poll_wait (file, &list->hidraw->wait, wait);if (list->head != list->tail) -return EPOLLIN |EPOLLRDNORM ; +return EPOLLIN |EPOLLRDNORM |EPOLLOUT ;if (!list->hidraw->exist)return EPOLLERR |EPOLLHUP ;return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 2/84 HID: hidraw: Fix returning EPOLLOUT from hidraw_poll
In reply to Greg Kroah-HartmanFrom: Marcel Holtmann <[email protected]>
[ Upstream commit 9f3b61dc1dd7b81e99e7ed23776bb64a35f39e1a ]
When polling a connected /dev/hidrawX device, it is useful to get the EPOLLOUT when writing is possible. Since writing is possible as soon as the device is connected, always return it.
Right now EPOLLOUT is only returned when there are also input reports are available. This works if devices start sending reports when connected, but some HID devices might need an output report first before sending any input reports. This change will allow using EPOLLOUT here as well.
--- drivers/hid/hidraw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hidraw.c +2 -2
@@ -260,10 +260,10 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)poll_wait (file, &list->hidraw->wait, wait);if (list->head != list->tail) -return EPOLLIN |EPOLLRDNORM |EPOLLOUT ; +return EPOLLIN |EPOLLRDNORM ;if (!list->hidraw->exist)return EPOLLERR |EPOLLHUP ; -return 0 ; +return EPOLLOUT |EPOLLWRNORM ; }static int hidraw_open (struct inode *inode,struct file *file)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 3/84 HID: hidraw, uhid: Always report EPOLLOUT
In reply to Greg Kroah-HartmanFrom: Jiri Kosina <[email protected]>
[ Upstream commit 9e635c2851df6caee651e589fbf937b637973c91 ]
hidraw and uhid device nodes are always available for writing so we should always report EPOLLOUT and EPOLLWRNORM bits, not only in the cases when there is nothing to read.
--- drivers/hid/hidraw.c | 7 ++++--- drivers/hid/uhid.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/hid/hidraw.c +4 -3
@@ -257,13 +257,14 @@ out:static __poll_t hidraw_poll (struct file *file,poll_table *wait) {struct hidraw_list *list = file->private_data; +__poll_t mask =EPOLLOUT |EPOLLWRNORM ;/* hidraw is always writable */ poll_wait (file, &list->hidraw->wait, wait);if (list->head != list->tail) -return EPOLLIN |EPOLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ;if (!list->hidraw->exist) -return EPOLLERR |EPOLLHUP ; -return EPOLLOUT |EPOLLWRNORM ; + mask |=EPOLLERR |EPOLLHUP ; +return mask; }static int hidraw_open (struct inode *inode,struct file *file)
drivers/hid/uhid.c +3 -2
@@ -769,13 +769,14 @@ unlock:static __poll_t uhid_char_poll (struct file *file,poll_table *wait) {struct uhid_device *uhid = file->private_data; +__poll_t mask =EPOLLOUT |EPOLLWRNORM ;/* uhid is always writable */ poll_wait (file, &uhid->waitq, wait);if (uhid->head != uhid->tail) -return EPOLLIN |EPOLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ; -return EPOLLOUT |EPOLLWRNORM ; +return mask; }static const struct file_operations uhid_fops = {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 4/84 ethtool: reduce stack usage with clang
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 3499e87ea0413ee5b2cc028f4c8ed4d424bc7f98 upstream.
clang inlines the dev_ethtool() more aggressively than gcc does, leading to a larger amount of used stack space:
net/core/ethtool.c:2536:24: error: stack frame size of 1216 bytes in function 'dev_ethtool' [-Werror,-Wframe-larger-than=]
Marking the sub-functions that require the most stack space as noinline_for_stack gives us reasonable behavior on all compilers.
--- net/core/ethtool.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
net/core/ethtool.c +9 -7
@@ -2413,9 +2413,10 @@ static int ethtool_set_tunable(struct nereturn ret; } -static int ethtool_get_per_queue_coalesce (struct net_device *dev, -void __user *useraddr, -struct ethtool_per_queue_op *per_queue_opt) +static noinline_for_stack int +ethtool_get_per_queue_coalesce (struct net_device *dev, +void __user *useraddr, +struct ethtool_per_queue_op *per_queue_opt) {u32 bit;int ret;
@@ -2443,9 +2444,10 @@ static int ethtool_get_per_queue_coalescreturn 0 ; } -static int ethtool_set_per_queue_coalesce (struct net_device *dev, -void __user *useraddr, -struct ethtool_per_queue_op *per_queue_opt) +static noinline_for_stack int +ethtool_set_per_queue_coalesce (struct net_device *dev, +void __user *useraddr, +struct ethtool_per_queue_op *per_queue_opt) {u32 bit;int i, ret =0 ;
@@ -2499,7 +2501,7 @@ roll_back:return ret; } -static int ethtool_set_per_queue (struct net_device *dev, +static int noinline_for_stack ethtool_set_per_queue(struct net_device *dev,void __user *useraddr,u32 sub_cmd) {struct ethtool_per_queue_op per_queue_opt;
Greg Kroah-Hartman
maintainerPATCH 5/84 fs/select: avoid clang stack usage warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit ad312f95d41c9de19313c51e388c4984451c010f upstream.
The select() implementation is carefully tuned to put a sensible amount of data on the stack for holding a copy of the user space fd_set, but not too large to risk overflowing the kernel stack.
When building a 32-bit kernel with clang, we need a little more space than with gcc, which often triggers a warning:
fs/select.c:619:5: error: stack frame size of 1048 bytes in function 'core_sys_select' [-Werror,-Wframe-larger-than=] int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
I experimentally found that for 32-bit ARM, reducing the maximum stack usage by 64 bytes keeps us reliably under the warning limit again.
--- include/linux/poll.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/poll.h +4 -0
@@ -16,7 +16,11 @@extern struct ctl_table epoll_table[];/* for sysctl */ /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating additional memory. */ +#ifdef __clang__ +#define MAX_STACK_ALLOC 768 +#else #define MAX_STACK_ALLOC 832 +#endif #define FRONTEND_STACK_ALLOC 256#define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC#define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC
Greg Kroah-Hartman
maintainerPATCH 6/84 cfg80211/mac80211: make ieee80211_send_layer2_update a public function
In reply to Greg Kroah-HartmanFrom: Dedy Lansky <[email protected]>
commit 30ca1aa536211f5ac3de0173513a7a99a98a97f3 upstream.
Make ieee80211_send_layer2_update() a common function so other drivers can re-use it.
[bwh: Backported to 4.19 as dependency of commit 3e493173b784
"mac80211: Do not send Layer 2 Update frame before authorization"]
--- include/net/cfg80211.h | 11 +++++++++++ net/mac80211/cfg.c | 48 ++---------------------------------------------- net/wireless/util.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 46 deletions(-)
include/net/cfg80211.h +11 -0
@@ -4734,6 +4734,17 @@ const u8 *cfg80211_find_vendor_ie(unsign const u8 *ies, int len);/** +* cfg80211_send_layer2_update - send layer 2 update frame +* +* @dev: network device +* @addr: STA MAC address +* +* Wireless drivers can use this function to update forwarding tables in bridge +* devices upon STA association. +*/ +void cfg80211_send_layer2_update (struct net_device *dev,const u8 *addr); + +/** * DOC: Regulatory enforcement infrastructure * * TODO
net/mac80211/cfg.c +2 -46
66 lines not on this page · raw message
net/wireless/util.c +45 -0
48 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 7/84 mac80211: Do not send Layer 2 Update frame before authorization
In reply to Greg Kroah-HartmanFrom: Jouni Malinen <[email protected]>
commit 3e493173b7841259a08c5c8e5cbe90adb349da7e upstream.
The Layer 2 Update frame is used to update bridges when a station roams to another AP even if that STA does not transmit any frames after the reassociation. This behavior was described in IEEE Std 802.11F-2003 as something that would happen based on MLME-ASSOCIATE.indication, i.e., before completing 4-way handshake. However, this IEEE trial-use recommended practice document was published before RSN (IEEE Std 802.11i-2004) and as such, did not consider RSN use cases. Furthermore, IEEE Std 802.11F-2003 was withdrawn in 2006 and as such, has not been maintained amd should not be used anymore.
Sending out the Layer 2 Update frame immediately after association is fine for open networks (and also when using SAE, FT protocol, or FILS authentication when the station is actually authenticated by the time association completes). However, it is not appropriate for cases where RSN is used with PSK or EAP authentication since the station is actually fully authenticated only once the 4-way handshake completes after authentication and attackers might be able to use the unauthenticated triggering of Layer 2 Update frame transmission to disrupt bridge behavior.
Fix this by postponing transmission of the Layer 2 Update frame from station entry addition to the point when the station entry is marked authorized. Similarly, send out the VLAN binding update only if the STA entry has already been authorized.
--- net/mac80211/cfg.c | 14 ++++---------- net/mac80211/sta_info.c | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-)
net/mac80211/cfg.c +4 -10
@@ -1410,7 +1410,6 @@ static int ieee80211_add_station(structstruct sta_info *sta;struct ieee80211_sub_if_data *sdata;int err; -int layer2_update;if (params->vlan) { sdata =IEEE80211_DEV_TO_SUB_IF (params->vlan);
@@ -1454,18 +1453,12 @@ static int ieee80211_add_station(struct test_sta_flag(sta, WLAN_STA_ASSOC))rate_control_rate_init (sta); - layer2_update = sdata->vif.type ==NL80211_IFTYPE_AP_VLAN || - sdata->vif.type ==NL80211_IFTYPE_AP ; - err =sta_info_insert_rcu (sta);if (err) {rcu_read_unlock ();return err; } -if (layer2_update) -cfg80211_send_layer2_update (sta->sdata->dev, sta->sta.addr); -rcu_read_unlock ();return 0 ;
@@ -1563,10 +1556,11 @@ static int ieee80211_change_station(stru sta->sdata = vlansdata;ieee80211_check_fast_xmit (sta); -if (test_sta_flag (sta,WLAN_STA_AUTHORIZED )) +if (test_sta_flag (sta,WLAN_STA_AUTHORIZED )) {ieee80211_vif_inc_num_mcast (sta->sdata); - -cfg80211_send_layer2_update (sta->sdata->dev, sta->sta.addr); +cfg80211_send_layer2_update (sta->sdata->dev, + sta->sta.addr); + } } err =sta_apply_parameters (local, sta, params);
net/mac80211/sta_info.c +4 -0
@@ -1906,6 +1906,10 @@ int sta_info_move_state(struct sta_infoieee80211_check_fast_xmit (sta);ieee80211_check_fast_rx (sta); } +if (sta->sdata->vif.type ==NL80211_IFTYPE_AP_VLAN || + sta->sdata->vif.type ==NL80211_IFTYPE_AP ) +cfg80211_send_layer2_update (sta->sdata->dev, + sta->sta.addr);break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 8/84 f2fs: Move err variable to function scope in f2fs_fill_dentries()
In reply to Greg Kroah-HartmanFrom: Ben Hutchings <[email protected]>
This is preparation for the following backported fixes. It was done upstream as part of commit e1293bdfa01d "f2fs: plug readahead IO in readdir()", the rest of which does not seem suitable for stable.
--- fs/f2fs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/f2fs/dir.c +3 -2
@@ -785,6 +785,7 @@ int f2fs_fill_dentries(struct dir_contexstruct f2fs_dir_entry *de =NULL ;struct fscrypt_str de_name =FSTR_INIT (NULL ,0 );struct f2fs_sb_info *sbi =F2FS_I_SB (d->inode); +int err =0 ; bit_pos = ((unsigned long )ctx->pos % d->max);
@@ -807,7 +808,6 @@ int f2fs_fill_dentries(struct dir_contexif (f2fs_encrypted_inode (d->inode)) {int save_len = fstr->len; -int err; err = fscrypt_fname_disk_to_usr(d->inode, (u32)de->hash_code, 0,
@@ -829,7 +829,8 @@ int f2fs_fill_dentries(struct dir_contex bit_pos +=GET_DENTRY_SLOTS (le16_to_cpu (de->name_len)); ctx->pos = start_pos + bit_pos; } -return 0 ; +out: +return err; }static int f2fs_readdir (struct file *file,struct dir_context *ctx)
Greg Kroah-Hartman
maintainerPATCH 9/84 f2fs: check memory boundary by insane namelen
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit 4e240d1bab1ead280ddf5eb05058dba6bbd57d10 upstream.
If namelen is corrupted to have very long value, fill_dentries can copy wrong memory area.
--- fs/f2fs/dir.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/f2fs/dir.c +11 -1
@@ -806,6 +806,17 @@ int f2fs_fill_dentries(struct dir_contex de_name.name = d->filename[bit_pos]; de_name.len =le16_to_cpu (de->name_len); +/* check memory boundary before moving forward */ + bit_pos +=GET_DENTRY_SLOTS (le16_to_cpu (de->name_len)); +if (unlikely (bit_pos > d->max)) { +f2fs_msg (sbi->sb,KERN_WARNING , +"%s: corrupted namelen=%d, run fsck to fix." , + __func__,le16_to_cpu (de->name_len)); +set_sbi_flag (sbi,SBI_NEED_FSCK ); + err = -EINVAL ; + goto out; + } +if (f2fs_encrypted_inode (d->inode)) {int save_len = fstr->len;
@@ -826,7 +837,6 @@ int f2fs_fill_dentries(struct dir_contexif (sbi->readdir_ra ==1 )f2fs_ra_node_page (sbi,le32_to_cpu (de->ino)); - bit_pos +=GET_DENTRY_SLOTS (le16_to_cpu (de->name_len)); ctx->pos = start_pos + bit_pos; } out:
Greg Kroah-Hartman
maintainerPATCH 10/84 f2fs: check if file namelen exceeds max value
In reply to Greg Kroah-HartmanFrom: Sheng Yong <[email protected]>
commit 720db068634c91553a8e1d9a0fcd8c7050e06d2b upstream.
Dentry bitmap is not enough to detect incorrect dentries. So this patch also checks the namelen value of a dentry.
--- fs/f2fs/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/dir.c +2 -1
@@ -808,7 +808,8 @@ int f2fs_fill_dentries(struct dir_contex/* check memory boundary before moving forward */ bit_pos +=GET_DENTRY_SLOTS (le16_to_cpu (de->name_len)); -if (unlikely (bit_pos > d->max)) { +if (unlikely (bit_pos > d->max || +le16_to_cpu (de->name_len) >F2FS_NAME_LEN )) {f2fs_msg (sbi->sb,KERN_WARNING ,"%s: corrupted namelen=%d, run fsck to fix." , __func__,le16_to_cpu (de->name_len));
Greg Kroah-Hartman
maintainerPATCH 11/84 media: usb:zr364xx:Fix KASAN:null-ptr-deref Read in zr364xx_vidioc_querycap
In reply to Greg Kroah-HartmanFrom: Vandana BN <[email protected]>
commit 5d2e73a5f80a5b5aff3caf1ec6d39b5b3f54b26e upstream.
SyzKaller hit the null pointer deref while reading from uninitialized udev->product in zr364xx_vidioc_querycap().
==================================================================
BUG: KASAN: null-ptr-deref in read_word_at_a_time+0xe/0x20 include/linux/compiler.h:274 Read of size 1 at addr 0000000000000000 by task v4l_id/5287 CPU: 1 PID: 5287 Comm: v4l_id Not tainted 5.1.0-rc3-319004-g43151d6 #6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xe8/0x16e lib/dump_stack.c:113 kasan_report.cold+0x5/0x3c mm/kasan/report.c:321 read_word_at_a_time+0xe/0x20 include/linux/compiler.h:274 strscpy+0x8a/0x280 lib/string.c:207 zr364xx_vidioc_querycap+0xb5/0x210 drivers/media/usb/zr364xx/zr364xx.c:706 v4l_querycap+0x12b/0x340 drivers/media/v4l2-core/v4l2-ioctl.c:1062 __video_do_ioctl+0x5bb/0xb40 drivers/media/v4l2-core/v4l2-ioctl.c:2874 video_usercopy+0x44e/0xf00 drivers/media/v4l2-core/v4l2-ioctl.c:3056 v4l2_ioctl+0x14e/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xced/0x12f0 fs/ioctl.c:696 ksys_ioctl+0xa0/0xc0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x74/0xb0 fs/ioctl.c:718 do_syscall_64+0xcf/0x4f0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f3b56d8b347 Code: 90 90 90 48 8b 05 f1 fa 2a 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff
ff c3 90 90 90 90 90 90 90 90 90 90 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c1 fa 2a 00 31 d2 48 29 c2 64
RSP: 002b:00007ffe005d5d68 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f3b56d8b347
RDX: 00007ffe005d5d70 RSI: 0000000080685600 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000400884
R13: 00007ffe005d5ec0 R14: 0000000000000000 R15: 0000000000000000
==================================================================
For this device udev->product is not initialized and accessing it causes a NULL pointer deref.
The fix is to check for NULL before strscpy() and copy empty string, if product is NULL
--- drivers/media/usb/zr364xx/zr364xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/usb/zr364xx/zr364xx.c +2 -1
@@ -703,7 +703,8 @@ static int zr364xx_vidioc_querycap(strucstruct zr364xx_camera *cam =video_drvdata (file);strlcpy (cap->driver,DRIVER_DESC ,sizeof (cap->driver)); -strlcpy (cap->card, cam->udev->product,sizeof (cap->card)); +if (cam->udev->product) +strlcpy (cap->card, cam->udev->product,sizeof (cap->card));strlcpy (cap->bus_info,dev_name (&cam->udev->dev),sizeof (cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
Greg Kroah-Hartman
maintainerPATCH 12/84 iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit b4b814fec1a5a849383f7b3886b654a13abbda7d upstream.
In alloc_sgtable if alloc_page fails, the alocated table should be released.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +1 -0
@@ -547,6 +547,7 @@ static struct scatterlist *alloc_sgtableif (new_page)__free_page (new_page); } +kfree (table);return NULL ; } alloc_size =min_t (int, size,PAGE_SIZE );
Greg Kroah-Hartman
maintainerPATCH 13/84 iwlwifi: pcie: fix memory leaks in iwl_pcie_ctxt_info_gen3_init
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit 0f4f199443faca715523b0659aa536251d8b978f upstream.
In iwl_pcie_ctxt_info_gen3_init there are cases that the allocated dma memory is leaked in case of error.
DMA memories prph_scratch, prph_info, and ctxt_info_gen3 are allocated and initialized to be later assigned to trans_pcie. But in any error case before such assignment the allocated memories should be released.
First of such error cases happens when iwl_pcie_init_fw_sec fails. Current implementation correctly releases prph_scratch. But in two sunsequent error cases where dma_alloc_coherent may fail, such releases are missing.
This commit adds release for prph_scratch when allocation for prph_info fails, and adds releases for prph_scratch and prph_info when allocation for ctxt_info_gen3 fails.
--- drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 36 ++++++++++----- 1 file changed, 25 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +25 -11
@@ -102,13 +102,9 @@ int iwl_pcie_ctxt_info_gen3_init(struct/* allocate ucode sections in dram and set addresses */ ret =iwl_pcie_init_fw_sec (trans, fw, &prph_scratch->dram); -if (ret) { -dma_free_coherent (trans->dev, -sizeof (*prph_scratch), - prph_scratch, - trans_pcie->prph_scratch_dma_addr); -return ret; - } +if (ret) + goto err_free_prph_scratch; +/* Allocate prph information * currently we don't assign to the prph info anything, but it would get
@@ -116,16 +112,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct prph_info =dma_alloc_coherent (trans->dev,sizeof (*prph_info), &trans_pcie->prph_info_dma_addr,GFP_KERNEL ); -if (!prph_info) -return -ENOMEM ; +if (!prph_info) { + ret = -ENOMEM ; + goto err_free_prph_scratch; + }/* Allocate context info */ ctxt_info_gen3 =dma_alloc_coherent (trans->dev,sizeof (*ctxt_info_gen3), &trans_pcie->ctxt_info_dma_addr,GFP_KERNEL ); -if (!ctxt_info_gen3) -return -ENOMEM ; +if (!ctxt_info_gen3) { + ret = -ENOMEM ; + goto err_free_prph_info; + } ctxt_info_gen3->prph_info_base_addr =cpu_to_le64 (trans_pcie->prph_info_dma_addr);
@@ -176,6 +176,20 @@ int iwl_pcie_ctxt_info_gen3_init(structiwl_set_bit (trans,CSR_GP_CNTRL ,CSR_AUTO_FUNC_INIT );return 0 ; + +err_free_prph_info: +dma_free_coherent (trans->dev, +sizeof (*prph_info), + prph_info, + trans_pcie->prph_info_dma_addr); + +err_free_prph_scratch: +dma_free_coherent (trans->dev, +sizeof (*prph_scratch), + prph_scratch, + trans_pcie->prph_scratch_dma_addr); +return ret; + }void iwl_pcie_ctxt_info_gen3_free (struct iwl_trans *trans)
Greg Kroah-Hartman
maintainerPATCH 14/84 RDMA: Fix goto target to release the allocated memory
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit 4a9d46a9fe14401f21df69cea97c62396d5fb053 upstream.
In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory should be released by goto fail.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 -1
@@ -1446,7 +1446,7 @@ struct ib_srq *bnxt_re_create_srq(structdev_err (rdev_to_dev (rdev),"SRQ copy to udata failed!" );bnxt_qplib_destroy_srq (&rdev->qplib_res, &srq->qplib_srq); - goto exit; + goto fail; } }if (nq)
Greg Kroah-Hartman
maintainerPATCH 15/84 dccp: Fix memleak in __feat_register_sp
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
commit 1d3ff0950e2b40dc861b1739029649d03f591820 upstream.
If dccp_feat_push_change fails, we forget free the mem which is alloced by kmemdup in dccp_feat_clone_sp_val.
--- net/dccp/feat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/dccp/feat.c +6 -1
@@ -738,7 +738,12 @@ static int __feat_register_sp(struct lisif (dccp_feat_clone_sp_val (&fval, sp_val, sp_len))return -ENOMEM ; -return dccp_feat_push_change (fn, feat, is_local, mandatory, &fval); +if (dccp_feat_push_change (fn, feat, is_local, mandatory, &fval)) { +kfree (fval.sp.vec); +return -ENOMEM ; + } + +return 0 ; }/**
Greg Kroah-Hartman
maintainerPATCH 16/84 drm/i915: Fix use-after-free when destroying GEM context
In reply to Greg Kroah-HartmanFrom: Tyler Hicks <[email protected]>
This patch is a simplified fix to address a use-after-free in 4.14.x and 4.19.x stable kernels. The flaw is already fixed upstream, starting in 5.2, by commit 7dc40713618c ("drm/i915: Introduce a mutex for file_priv->context_idr") as part of a more complex patch series that isn't appropriate for backporting to stable kernels.
Expand mutex coverage, while destroying the GEM context, to include the GEM context lookup step. This fixes a use-after-free detected by KASAN:
==================================================================
BUG: KASAN: use-after-free in i915_ppgtt_close+0x2ca/0x2f0
Write of size 1 at addr ffff8881368a8368 by task i915-poc/3124
CPU: 0 PID: 3124 Comm: i915-poc Not tainted 4.14.164 #1
Hardware name: HP HP Elite x2 1012 G1 /80FC, BIOS N85 Ver. 01.20 04/05/2017
Call Trace:
dump_stack+0xcd/0x12e
? _atomic_dec_and_lock+0x1b2/0x1b2
? i915_ppgtt_close+0x2ca/0x2f0
? printk+0x8f/0xab
? show_regs_print_info+0x53/0x53
? i915_ppgtt_close+0x2ca/0x2f0
print_address_description+0x65/0x270
? i915_ppgtt_close+0x2ca/0x2f0
kasan_report+0x251/0x340
i915_ppgtt_close+0x2ca/0x2f0
? __radix_tree_insert+0x3f0/0x3f0
? i915_ppgtt_init_hw+0x7c0/0x7c0
context_close+0x42e/0x680
? i915_gem_context_release+0x230/0x230
? kasan_kmalloc+0xa0/0xd0
? radix_tree_delete_item+0x1d4/0x250
? radix_tree_lookup+0x10/0x10
? inet_recvmsg+0x4b0/0x4b0
? kasan_slab_free+0x88/0xc0
i915_gem_context_destroy_ioctl+0x236/0x300
? i915_gem_context_create_ioctl+0x360/0x360
? drm_dev_printk+0x1d0/0x1d0
? memcpy+0x34/0x50
? i915_gem_context_create_ioctl+0x360/0x360
drm_ioctl_kernel+0x1b0/0x2b0
? drm_ioctl_permit+0x2a0/0x2a0
? avc_ss_reset+0xd0/0xd0
drm_ioctl+0x6fe/0xa20
? i915_gem_context_create_ioctl+0x360/0x360
? drm_getstats+0x20/0x20
? put_unused_fd+0x260/0x260
do_vfs_ioctl+0x189/0x12d0
? ioctl_preallocate+0x280/0x280
? selinux_file_ioctl+0x3a7/0x680
? selinux_bprm_set_creds+0xe30/0xe30
? security_file_ioctl+0x69/0xa0
? selinux_bprm_set_creds+0xe30/0xe30
SyS_ioctl+0x6f/0x80
? __sys_sendmmsg+0x4a0/0x4a0
? do_vfs_ioctl+0x12d0/0x12d0
do_syscall_64+0x214/0x5f0
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x25/0x60
? __switch_to_asm+0x31/0x60
? syscall_return_slowpath+0x2c0/0x2c0
? copy_overflow+0x20/0x20
? __switch_to_asm+0x25/0x60
? syscall_return_via_sysret+0x2a/0x7a
? prepare_exit_to_usermode+0x200/0x200
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x25/0x60
? __switch_to_asm+0x25/0x60
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x25/0x60
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x31/0x60
? __switch_to_asm+0x25/0x60
entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x7f7fda5115d7
RSP: 002b:00007f7eec317ec8 EFLAGS: 00000286 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7fda5115d7
RDX: 000055b306db9188 RSI: 000000004008646e RDI: 0000000000000003
RBP: 00007f7eec317ef0 R08: 00007f7eec318700 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 00007f7eec317fc0
R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffd8007ade0
Allocated by task 2898:
save_stack+0x32/0xb0
kasan_kmalloc+0xa0/0xd0
kmem_cache_alloc_trace+0x5e/0x180
i915_ppgtt_create+0xab/0x2510
i915_gem_create_context+0x981/0xf90
i915_gem_context_create_ioctl+0x1d7/0x360
drm_ioctl_kernel+0x1b0/0x2b0
drm_ioctl+0x6fe/0xa20
do_vfs_ioctl+0x189/0x12d0
SyS_ioctl+0x6f/0x80
do_syscall_64+0x214/0x5f0
entry_SYSCALL_64_after_hwframe+0x3d/0xa2
Freed by task 104:
save_stack+0x32/0xb0
kasan_slab_free+0x72/0xc0
kfree+0x88/0x190
i915_ppgtt_release+0x24e/0x460
i915_gem_context_free+0x90/0x480
contexts_free_worker+0x54/0x80
process_one_work+0x876/0x14e0
worker_thread+0x1b8/0xfd0
kthread+0x2f8/0x3c0
ret_from_fork+0x35/0x40
The buggy address belongs to the object at ffff8881368a8000
which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 872 bytes inside of
8192-byte region [ffff8881368a8000, ffff8881368aa000)
The buggy address belongs to the page:
page:ffffea0004da2a00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0
flags: 0x200000000008100(slab|head)
raw: 0200000000008100 0000000000000000 0000000000000000 0000000100030003
raw: dead000000000100 dead000000000200 ffff88822a002280 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8881368a8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881368a8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881368a8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881368a8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881368a8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================--- drivers/gpu/drm/i915/i915_gem_context.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +7 -6
@@ -770,18 +770,19 @@ int i915_gem_context_destroy_ioctl(strucif (args->ctx_id ==DEFAULT_CONTEXT_HANDLE )return -ENOENT ; + ret =i915_mutex_lock_interruptible (dev); +if (ret) +return ret; + ctx =i915_gem_context_lookup (file_priv, args->ctx_id); -if (!ctx) +if (!ctx) { +mutex_unlock (&dev->struct_mutex);return -ENOENT ; - - ret =mutex_lock_interruptible (&dev->struct_mutex); -if (ret) - goto out; + }__destroy_hw_context (ctx, file_priv);mutex_unlock (&dev->struct_mutex); -out:i915_gem_context_put (ctx);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 17/84 rtc: mt6397: fix alarm register overwrite
In reply to Greg Kroah-HartmanFrom: Ran Bi <[email protected]>
commit 653997eeecef95c3ead4fba1b2d27e6a5854d6cd upstream.
Alarm registers high byte was reserved for other functions. This add mask in alarm registers operation functions. This also fix error condition in interrupt handler.
--- drivers/rtc/rtc-mt6397.c | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-)
drivers/rtc/rtc-mt6397.c +33 -14
@@ -55,6 +55,14 @@#define RTC_AL_SEC 0x0018 +#define RTC_AL_SEC_MASK 0x003f +#define RTC_AL_MIN_MASK 0x003f +#define RTC_AL_HOU_MASK 0x001f +#define RTC_AL_DOM_MASK 0x001f +#define RTC_AL_DOW_MASK 0x0007 +#define RTC_AL_MTH_MASK 0x000f +#define RTC_AL_YEA_MASK 0x007f +#define RTC_PDN2 0x002e#define RTC_PDN2_PWRON_ALARM BIT(4)
@@ -111,7 +119,7 @@ static irqreturn_t mtk_rtc_irq_handler_t irqen = irqsta & ~RTC_IRQ_EN_AL ;mutex_lock (&rtc->lock);if (regmap_write (rtc->regmap, rtc->addr_base +RTC_IRQ_EN , - irqen) <0 ) + irqen) ==0 )mtk_rtc_write_trigger (rtc);mutex_unlock (&rtc->lock);
@@ -233,12 +241,12 @@ static int mtk_rtc_read_alarm(struct dev alm->pending = !!(pdn2 &RTC_PDN2_PWRON_ALARM );mutex_unlock (&rtc->lock); - tm->tm_sec = data[RTC_OFFSET_SEC ]; - tm->tm_min = data[RTC_OFFSET_MIN ]; - tm->tm_hour = data[RTC_OFFSET_HOUR ]; - tm->tm_mday = data[RTC_OFFSET_DOM ]; - tm->tm_mon = data[RTC_OFFSET_MTH ]; - tm->tm_year = data[RTC_OFFSET_YEAR ]; + tm->tm_sec = data[RTC_OFFSET_SEC ] &RTC_AL_SEC_MASK ; + tm->tm_min = data[RTC_OFFSET_MIN ] &RTC_AL_MIN_MASK ; + tm->tm_hour = data[RTC_OFFSET_HOUR ] &RTC_AL_HOU_MASK ; + tm->tm_mday = data[RTC_OFFSET_DOM ] &RTC_AL_DOM_MASK ; + tm->tm_mon = data[RTC_OFFSET_MTH ] &RTC_AL_MTH_MASK ; + tm->tm_year = data[RTC_OFFSET_YEAR ] &RTC_AL_YEA_MASK ; tm->tm_year +=RTC_MIN_YEAR_OFFSET ; tm->tm_mon--;
@@ -259,14 +267,25 @@ static int mtk_rtc_set_alarm(struct devi tm->tm_year -=RTC_MIN_YEAR_OFFSET ; tm->tm_mon++; - data[RTC_OFFSET_SEC ] = tm->tm_sec; - data[RTC_OFFSET_MIN ] = tm->tm_min; - data[RTC_OFFSET_HOUR ] = tm->tm_hour; - data[RTC_OFFSET_DOM ] = tm->tm_mday; - data[RTC_OFFSET_MTH ] = tm->tm_mon; - data[RTC_OFFSET_YEAR ] = tm->tm_year; -mutex_lock (&rtc->lock); + ret =regmap_bulk_read (rtc->regmap, rtc->addr_base +RTC_AL_SEC , + data,RTC_OFFSET_COUNT ); +if (ret <0 ) + goto exit; + + data[RTC_OFFSET_SEC ] = ((data[RTC_OFFSET_SEC ] & ~(RTC_AL_SEC_MASK )) | + (tm->tm_sec &RTC_AL_SEC_MASK )); + data[RTC_OFFSET_MIN ] = ((data[RTC_OFFSET_MIN ] & ~(RTC_AL_MIN_MASK )) | + (tm->tm_min &RTC_AL_MIN_MASK )); + data[RTC_OFFSET_HOUR ] = ((data[RTC_OFFSET_HOUR ] & ~(RTC_AL_HOU_MASK )) | + (tm->tm_hour &RTC_AL_HOU_MASK )); + data[RTC_OFFSET_DOM ] = ((data[RTC_OFFSET_DOM ] & ~(RTC_AL_DOM_MASK )) | + (tm->tm_mday &RTC_AL_DOM_MASK )); + data[RTC_OFFSET_MTH ] = ((data[RTC_OFFSET_MTH ] & ~(RTC_AL_MTH_MASK )) | + (tm->tm_mon &RTC_AL_MTH_MASK )); + data[RTC_OFFSET_YEAR ] = ((data[RTC_OFFSET_YEAR ] & ~(RTC_AL_YEA_MASK )) | + (tm->tm_year &RTC_AL_YEA_MASK )); +if (alm->enabled) { ret = regmap_bulk_write(rtc->regmap, rtc->addr_base + RTC_AL_SEC,
Greg Kroah-Hartman
maintainerPATCH 18/84 RDMA/bnxt_re: Avoid freeing MR resources if dereg fails
In reply to Greg Kroah-HartmanFrom: Selvin Xavier <[email protected]>
commit 9a4467a6b282a299b932608ac2c9034f8415359f upstream.
The driver returns an error code for MR dereg, but frees the MR structure. When the MR dereg is retried due to previous error, the system crashes as the structure is already freed.
BUG: unable to handle kernel NULL pointer dereference at 00000000000001b8 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 7 PID: 12178 Comm: ib_send_bw Kdump: loaded Not tainted 4.18.0-124.el8.x86_64 #1 Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.1.10 03/10/2015 RIP: 0010:__dev_printk+0x2a/0x70 Code: 0f 1f 44 00 00 49 89 d1 48 85 f6 0f 84 f6 2b 00 00 4c 8b 46 70 4d 85 c0 75 04 4c 8b
46 10 48 8b 86 a8 00 00 00 48 85 c0 74 16 <48> 8b 08 0f be 7f 01 48 c7 c2 13 ac ac 83 83 ef 30 e9 10 fe ff ff
RSP: 0018:ffffaf7c04607a60 EFLAGS: 00010006
RAX: 00000000000001b8 RBX: ffffa0010c91c488 RCX: 0000000000000246
RDX: ffffaf7c04607a68 RSI: ffffa0010c91caa8 RDI: ffffffff83a788eb
RBP: ffffaf7c04607ac8 R08: 0000000000000000 R09: ffffaf7c04607a68
R10: 0000000000000000 R11: 0000000000000001 R12: ffffaf7c04607b90
R13: 000000000000000e R14: 0000000000000000 R15: 00000000ffffa001
FS: 0000146fa1f1cdc0(0000) GS:ffffa0012fac0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000001b8 CR3: 000000007680a003 CR4: 00000000001606e0
Call Trace: dev_err+0x6c/0x90 ? dev_printk_emit+0x4e/0x70 bnxt_qplib_rcfw_send_message+0x594/0x660 [bnxt_re] ? dev_err+0x6c/0x90 bnxt_qplib_free_mrw+0x80/0xe0 [bnxt_re] bnxt_re_dereg_mr+0x2e/0xd0 [bnxt_re] ib_dereg_mr+0x2f/0x50 [ib_core] destroy_hw_idr_uobject+0x20/0x70 [ib_uverbs] uverbs_destroy_uobject+0x2e/0x170 [ib_uverbs] __uverbs_cleanup_ufile+0x6e/0x90 [ib_uverbs] uverbs_destroy_ufile_hw+0x61/0x130 [ib_uverbs] ib_uverbs_close+0x1f/0x80 [ib_uverbs] __fput+0xb7/0x230 task_work_run+0x8a/0xb0 do_exit+0x2da/0xb40 ... RIP: 0033:0x146fa113a387 Code: Bad RIP value. RSP: 002b:00007fff945d1478 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff02 RAX: 0000000000000000 RBX: 000055a248908d70 RCX: 0000000000000000 RDX: 0000146fa1f2b000 RSI: 0000000000000001 RDI: 000055a248906488 RBP: 000055a248909630 R08: 0000000000010000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 000055a248906488 R13: 0000000000000001 R14: 0000000000000000 R15: 000055a2489095f0
Do not free the MR structures, when driver returns error to the stack.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +3 -1
@@ -3368,8 +3368,10 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mrint rc; rc =bnxt_qplib_free_mrw (&rdev->qplib_res, &mr->qplib_mr); -if (rc) +if (rc) {dev_err (rdev_to_dev (rdev),"Dereg MR failed: %#x\n" , rc); +return rc; + }if (mr->pages) { rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
Greg Kroah-Hartman
maintainerPATCH 19/84 RDMA/bnxt_re: Fix Send Work Entry state check while polling completions
In reply to Greg Kroah-HartmanFrom: Selvin Xavier <[email protected]>
commit c5275723580922e5f3264f96751337661a153c7d upstream.
Some adapters need a fence Work Entry to handle retransmission. Currently the driver checks for this condition, only if the Send queue entry is signalled. Implement the condition check, irrespective of the signalled state of the Work queue entries
Failure to add the fence can result in access to memory that is already marked as completed, triggering data corruption, transmission failure, IOMMU failures, etc.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +6 -6
@@ -2273,13 +2273,13 @@ static int bnxt_qplib_cq_process_req(str/* Add qp to flush list of the CQ */ bnxt_qplib_add_flush_qp (qp); }else { +/* Before we complete, do WA 9060 */ +if (do_wa9060 (qp, cq, cq_cons, sw_sq_cons, + cqe_sq_cons)) { + *lib_qp = qp; + goto out; + }if (swq->flags &SQ_SEND_FLAGS_SIGNAL_COMP ) { -/* Before we complete, do WA 9060 */ -if (do_wa9060 (qp, cq, cq_cons, sw_sq_cons, - cqe_sq_cons)) { - *lib_qp = qp; - goto out; - } cqe->status =CQ_REQ_STATUS_OK ; cqe++; (*budget)--;
Greg Kroah-Hartman
maintainerPATCH 20/84 ASoC: soc-core: Set dpcm_playback / dpcm_capture
In reply to Greg Kroah-HartmanFrom: Daniel Baluta <[email protected]>
commit 218fe9b7ec7f32c10a07539365488d80af7b0084 upstream.
When converting a normal link to a DPCM link we need to set dpcm_playback / dpcm_capture otherwise playback/capture streams will not be created resulting in errors like this:
[ 36.039111] sai1-wm8960-hifi: ASoC: no backend playback stream
--- sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-core.c +2 -0
@@ -1921,6 +1921,8 @@ static void soc_check_tplg_fes(struct sn/* convert non BE into BE */ dai_link->no_pcm =1 ; + dai_link->dpcm_playback =1 ; + dai_link->dpcm_capture =1 ;/* override any BE fixups */ dai_link->be_hw_params_fixup =
Greg Kroah-Hartman
maintainerPATCH 21/84 ASoC: stm32: spdifrx: fix inconsistent lock state
In reply to Greg Kroah-HartmanFrom: Olivier Moysan <[email protected]>
commit 2859b1784031b5709446af8f6039c467f136e67d upstream.
In current spdifrx driver locks may be requested as follows:
- request lock on iec capture control, when starting synchronization.
- request lock in interrupt context, when spdifrx stop is called from IRQ handler.
Take lock with IRQs disabled, to avoid the possible deadlock.
Lockdep report:
[ 74.278059] ================================ [ 74.282306] WARNING: inconsistent lock state [ 74.290120] -------------------------------- ... [ 74.314373] CPU0 [ 74.314377] ---- [ 74.314381] lock(&(&spdifrx->lock)->rlock); [ 74.314396] <Interrupt> [ 74.314400] lock(&(&spdifrx->lock)->rlock);
--- sound/soc/stm/stm32_spdifrx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
sound/soc/stm/stm32_spdifrx.c +7 -5
@@ -313,6 +313,7 @@ static void stm32_spdifrx_dma_ctrl_stop(static int stm32_spdifrx_start_sync (struct stm32_spdifrx_data *spdifrx) {int cr, cr_mask, imr, ret; +unsigned long flags;/* Enable IRQs */ imr =SPDIFRX_IMR_IFEIE |SPDIFRX_IMR_SYNCDIE |SPDIFRX_IMR_PERRIE ;
@@ -320,7 +321,7 @@ static int stm32_spdifrx_start_sync(struif (ret)return ret; -spin_lock (&spdifrx->lock); +spin_lock_irqsave (&spdifrx->lock, flags); spdifrx->refcount++;
@@ -353,7 +354,7 @@ static int stm32_spdifrx_start_sync(stru "Failed to start synchronization\n"); } -spin_unlock (&spdifrx->lock); +spin_unlock_irqrestore (&spdifrx->lock, flags);return ret; }
@@ -361,11 +362,12 @@ static int stm32_spdifrx_start_sync(strustatic void stm32_spdifrx_stop (struct stm32_spdifrx_data *spdifrx) {int cr, cr_mask, reg; +unsigned long flags; -spin_lock (&spdifrx->lock); +spin_lock_irqsave (&spdifrx->lock, flags);if (--spdifrx->refcount) { -spin_unlock (&spdifrx->lock); +spin_unlock_irqrestore (&spdifrx->lock, flags);return ; }
@@ -384,7 +386,7 @@ static void stm32_spdifrx_stop(struct stregmap_read (spdifrx->regmap,STM32_SPDIFRX_DR , ®);regmap_read (spdifrx->regmap,STM32_SPDIFRX_CSR , ®); -spin_unlock (&spdifrx->lock); +spin_unlock_irqrestore (&spdifrx->lock, flags); } static int stm32_spdifrx_dma_ctrl_register(struct device *dev,
Greg Kroah-Hartman
maintainerPATCH 22/84 ASoC: stm32: spdifrx: fix race condition in irq handler
In reply to Greg Kroah-HartmanFrom: Olivier Moysan <[email protected]>
commit 86e1956af4c863d653136fd6e5694adf2054dbaa upstream.
When snd_pcm_stop() is called in interrupt routine, substream context may have already been released. Add protection on substream context.
--- sound/soc/stm/stm32_spdifrx.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
sound/soc/stm/stm32_spdifrx.c +19 -5
@@ -213,6 +213,7 @@* @slave_config: dma slave channel runtime config pointer * @phys_addr: SPDIFRX registers physical base address * @lock: synchronization enabling lock +* @irq_lock: prevent race condition with IRQ on stream state * @cs: channel status buffer * @ub: user data buffer * @irq: SPDIFRX interrupt line
@@ -233,6 +234,7 @@ struct stm32_spdifrx_data {struct dma_slave_config slave_config;dma_addr_t phys_addr;spinlock_t lock;/* Sync enabling lock */ +spinlock_t irq_lock;/* Prevent race condition on stream state */ unsigned char cs[SPDIFRX_CS_BYTES_NB ];unsigned char ub[SPDIFRX_UB_BYTES_NB ];int irq;
@@ -645,7 +647,6 @@ static const struct regmap_config stm32_static irqreturn_t stm32_spdifrx_isr (int irq,void *devid) {struct stm32_spdifrx_data *spdifrx = (struct stm32_spdifrx_data *)devid; -struct snd_pcm_substream *substream = spdifrx->substream;struct platform_device *pdev = spdifrx->pdev;unsigned int cr, mask, sr, imr;unsigned int flags;
@@ -713,14 +714,19 @@ static irqreturn_t stm32_spdifrx_isr(intregmap_update_bits (spdifrx->regmap,STM32_SPDIFRX_CR ,SPDIFRX_CR_SPDIFEN_MASK , cr); -if (substream) -snd_pcm_stop (substream,SNDRV_PCM_STATE_DISCONNECTED ); +spin_lock (&spdifrx->irq_lock); +if (spdifrx->substream) +snd_pcm_stop (spdifrx->substream, +SNDRV_PCM_STATE_DISCONNECTED ); +spin_unlock (&spdifrx->irq_lock);return IRQ_HANDLED ; } -if (err_xrun && substream) -snd_pcm_stop_xrun (substream); +spin_lock (&spdifrx->irq_lock); +if (err_xrun && spdifrx->substream) +snd_pcm_stop_xrun (spdifrx->substream); +spin_unlock (&spdifrx->irq_lock);return IRQ_HANDLED ; }
@@ -729,9 +735,12 @@ static int stm32_spdifrx_startup(struct struct snd_soc_dai *cpu_dai) {struct stm32_spdifrx_data *spdifrx =snd_soc_dai_get_drvdata (cpu_dai); +unsigned long flags;int ret; +spin_lock_irqsave (&spdifrx->irq_lock, flags); spdifrx->substream = substream; +spin_unlock_irqrestore (&spdifrx->irq_lock, flags); ret =clk_prepare_enable (spdifrx->kclk);if (ret)
@@ -807,8 +816,12 @@ static void stm32_spdifrx_shutdown(struc struct snd_soc_dai *cpu_dai) {struct stm32_spdifrx_data *spdifrx =snd_soc_dai_get_drvdata (cpu_dai); +unsigned long flags; +spin_lock_irqsave (&spdifrx->irq_lock, flags); spdifrx->substream =NULL ; +spin_unlock_irqrestore (&spdifrx->irq_lock, flags); +clk_disable_unprepare (spdifrx->kclk); }
@@ -912,6 +925,7 @@ static int stm32_spdifrx_probe(struct pl spdifrx->pdev = pdev;init_completion (&spdifrx->cs_completion);spin_lock_init (&spdifrx->lock); +spin_lock_init (&spdifrx->irq_lock);platform_set_drvdata (pdev, spdifrx);
Greg Kroah-Hartman
maintainerPATCH 23/84 mtd: onenand: omap2: Pass correct flags for prep_dma_memcpy
In reply to Greg Kroah-HartmanFrom: Peter Ujfalusi <[email protected]>
commit 8bcef0d54067077cf9a6cb129022c77559926e8c upstream.
The commit converting the driver to DMAengine was missing the flags for the memcpy prepare call.
It went unnoticed since the omap-dma driver was ignoring them.
--- drivers/mtd/nand/onenand/omap2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/onenand/omap2.c +2 -1
@@ -341,7 +341,8 @@ static inline int omap2_onenand_dma_transtruct dma_async_tx_descriptor *tx;dma_cookie_t cookie; - tx =dmaengine_prep_dma_memcpy (c->dma_chan, dst, src, count,0 ); + tx =dmaengine_prep_dma_memcpy (c->dma_chan, dst, src, count, +DMA_CTRL_ACK |DMA_PREP_INTERRUPT );if (!tx) {dev_err (&c->pdev->dev,"Failed to prepare DMA memcpy\n" );return -EIO ;
Greg Kroah-Hartman
maintainerPATCH 24/84 gpio: zynq: Fix for bug in zynq_gpio_restore_context API
In reply to Greg Kroah-HartmanFrom: Swapna Manupati <[email protected]>
commit 36f2e7207f21a83ca0054116191f119ac64583ab upstream.
This patch writes the inverse value of Interrupt Mask Status register into the Interrupt Enable register in zynq_gpio_restore_context API to fix the bug.
--- drivers/gpio/gpio-zynq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpio/gpio-zynq.c +5 -3
@@ -639,6 +639,8 @@ static void zynq_gpio_restore_context(stunsigned int bank_num;for (bank_num =0 ; bank_num < gpio->p_data->max_bank; bank_num++) { +writel_relaxed (ZYNQ_GPIO_IXR_DISABLE_ALL , gpio->base_addr + +ZYNQ_GPIO_INTDIS_OFFSET (bank_num));writel_relaxed (gpio->context.datalsw[bank_num], gpio->base_addr +ZYNQ_GPIO_DATA_LSW_OFFSET (bank_num));
@@ -648,9 +650,6 @@ static void zynq_gpio_restore_context(stwritel_relaxed (gpio->context.dirm[bank_num], gpio->base_addr +ZYNQ_GPIO_DIRM_OFFSET (bank_num)); -writel_relaxed (gpio->context.int_en[bank_num], - gpio->base_addr + -ZYNQ_GPIO_INTEN_OFFSET (bank_num));writel_relaxed (gpio->context.int_type[bank_num], gpio->base_addr +ZYNQ_GPIO_INTTYPE_OFFSET (bank_num));
@@ -660,6 +659,9 @@ static void zynq_gpio_restore_context(stwritel_relaxed (gpio->context.int_any[bank_num], gpio->base_addr +ZYNQ_GPIO_INTANY_OFFSET (bank_num)); +writel_relaxed (~(gpio->context.int_en[bank_num]), + gpio->base_addr + +ZYNQ_GPIO_INTEN_OFFSET (bank_num)); } }
Greg Kroah-Hartman
maintainerPATCH 25/84 iommu: Remove device link to group on failure
In reply to Greg Kroah-HartmanFrom: Jon Derrick <[email protected]>
commit 7d4e6ccd1fb09dbfbc49746ca82bd5c25ad4bfe4 upstream.
This adds the missing teardown step that removes the device link from the group when the device addition fails.
--- drivers/iommu/iommu.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/iommu.c +1 -0
@@ -650,6 +650,7 @@ err_put_group:mutex_unlock (&group->mutex); dev->iommu_group =NULL ;kobject_put (group->devices_kobj); +sysfs_remove_link (group->devices_kobj, device->name); err_free_name:kfree (device->name); err_remove_link:
Greg Kroah-Hartman
maintainerPATCH 26/84 gpio: Fix error message on out-of-range GPIO in lookup table
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
commit d935bd50dd14a7714cbdba9a76435dbb56edb1ae upstream.
When a GPIO offset in a lookup table is out-of-range, the printed error message (1) does not include the actual out-of-range value, and (2) contains an off-by-one error in the upper bound.
Avoid user confusion by also printing the actual GPIO offset, and correcting the upper bound of the range.
While at it, use "%u" for unsigned int.
Sample impact:
-requested GPIO 0 is out of range [0..32] for chip e6052000.gpio
+requested GPIO 0 (45) is out of range [0..31] for chip e6052000.gpio--- drivers/gpio/gpiolib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.c +3 -2
@@ -3757,8 +3757,9 @@ static struct gpio_desc *gpiod_find(struif (chip->ngpio <= p->chip_hwnum) {dev_err (dev, -"requested GPIO %d is out of range [0..%d] for chip %s\n" , - idx, chip->ngpio, chip->label); +"requested GPIO %u (%u) is out of range [0..%u] for chip %s\n" , + idx, p->chip_hwnum, chip->ngpio -1 , + chip->label);return ERR_PTR (-EINVAL ); }
Greg Kroah-Hartman
maintainerPATCH 27/84 hsr: reset network header when supervision frame is created
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
commit 3ed0a1d563903bdb4b4c36c58c4d9c1bcb23a6e6 upstream.
The supervision frame is L2 frame.
When supervision frame is created, hsr module doesn't set network header. If tap routine is enabled, dev_queue_xmit_nit() is called and it checks network_header. If network_header pointer wasn't set(or invalid), it resets network_header and warns.
In order to avoid unnecessary warning message, resetting network_header is needed.
Test commands:
ip netns add nst
ip link add veth0 type veth peer name veth1
ip link add veth2 type veth peer name veth3
ip link set veth1 netns nst
ip link set veth3 netns nst
ip link set veth0 up
ip link set veth2 up
ip link add hsr0 type hsr slave1 veth0 slave2 veth2
ip a a 192.168.100.1/24 dev hsr0
ip link set hsr0 up
ip netns exec nst ip link set veth1 up
ip netns exec nst ip link set veth3 up
ip netns exec nst ip link add hsr1 type hsr slave1 veth1 slave2 veth3 ip netns exec nst ip a a 192.168.100.2/24 dev hsr1
ip netns exec nst ip link set hsr1 up
tcpdump -nei veth0
Splat looks like:
[ 175.852292][ C3] protocol 88fb is buggy, dev veth0
--- net/hsr/hsr_device.c | 2 ++ 1 file changed, 2 insertions(+)
net/hsr/hsr_device.c +2 -0
@@ -281,6 +281,8 @@ static void send_hsr_supervision_frame(s skb->dev->dev_addr, skb->len) <= 0) goto out;skb_reset_mac_header (skb); +skb_reset_network_header (skb); +skb_reset_transport_header (skb);if (hsrVer >0 ) { hsr_tag =skb_put (skb,sizeof (struct hsr_tag ));
Greg Kroah-Hartman
maintainerPATCH 28/84 s390/qeth: fix false reporting of VNIC CHAR config failure
In reply to Greg Kroah-HartmanFrom: Alexandra Winter <[email protected]>
commit 68c57bfd52836e31bff33e5e1fc64029749d2c35 upstream.
Symptom: Error message "Configuring the VNIC characteristics failed" in dmesg whenever an OSA interface on z15 is set online.
The VNIC characteristics get re-programmed when setting a L2 device online. This follows the selected 'wanted' characteristics - with the exception that the INVISIBLE characteristic unconditionally gets switched off.
For devices that don't support INVISIBLE (ie. OSA), the resulting IO failure raises a noisy error message
("Configuring the VNIC characteristics failed").
For IQD, INVISIBLE is off by default anyways.
So don't unnecessarily special-case the INVISIBLE characteristic, and thereby suppress the misleading error message on OSA devices.
--- drivers/s390/net/qeth_l2_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/s390/net/qeth_l2_main.c +0 -1
@@ -2367,7 +2367,6 @@ static void qeth_l2_vnicc_init(struct qe error =qeth_l2_vnicc_recover_timeout (card,QETH_VNICC_LEARNING , timeout); chars_tmp = card->options.vnicc.wanted_chars ^QETH_VNICC_DEFAULT ; - chars_tmp |=QETH_VNICC_BRIDGE_INVISIBLE ; chars_len =sizeof (card->options.vnicc.wanted_chars) *BITS_PER_BYTE ;for_each_set_bit (i, &chars_tmp, chars_len) { vnicc =BIT (i);
Greg Kroah-Hartman
maintainerPATCH 29/84 s390/qeth: Fix vnicc_is_in_use if rx_bcast not set
In reply to Greg Kroah-HartmanFrom: Alexandra Winter <[email protected]>
commit e8a66d800471e2df7f0b484e2e46898b21d1fa82 upstream.
Symptom: After vnicc/rx_bcast has been manually set to 0,
bridge_* sysfs parameters can still be set or written.
Only occurs on HiperSockets, as OSA doesn't support changing rx_bcast.
Vnic characteristics and bridgeport settings are mutually exclusive. rx_bcast defaults to 1, so manually setting it to 0 should disable bridge_* parameters.
Instead it makes sense here to check the supported mask. If the card does not support vnicc at all, bridge commands are always allowed.
--- drivers/s390/net/qeth_l2_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +1 -2
@@ -2285,8 +2285,7 @@ int qeth_l2_vnicc_get_timeout(struct qet/* check if VNICC is currently enabled */ bool qeth_l2_vnicc_is_in_use (struct qeth_card *card) { -/* if everything is turned off, VNICC is not active */ -if (!card->options.vnicc.cur_chars) +if (!card->options.vnicc.sup_chars)return false;/* default values are only OK if rx_bcast was not enabled by user * or the card is offline.
Greg Kroah-Hartman
maintainerPATCH 30/84 cifs: Adjust indentation in smb2_open_file
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 7935799e041ae10d380d04ea23868240f082bd11 upstream.
Clang warns:
../fs/cifs/smb2file.c:70:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (oparms->tcon->use_resilient) {
^
../fs/cifs/smb2file.c:66:2: note: previous statement is here
if (rc)
^1 warning generated.
This warning occurs because there is a space after the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
--- fs/cifs/smb2file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2file.c +1 -1
@@ -67,7 +67,7 @@ smb2_open_file(const unsigned int xid, s goto out; -if (oparms->tcon->use_resilient) { +if (oparms->tcon->use_resilient) { nr_ioctl_req.Timeout =0 ;/* use server default (120 seconds) */ nr_ioctl_req.Reserved =0 ; rc = SMB2_ioctl(xid, oparms->tcon, fid->persistent_fid,
Greg Kroah-Hartman
maintainerPATCH 31/84 afs: Fix missing cell comparison in afs_test_super()
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
commit 106bc79843c3c6f4f00753d1f46e54e815f99377 upstream.
Fix missing cell comparison in afs_test_super(). Without this, any pair volumes that have the same volume ID will share a superblock, no matter the cell, unless they're in different network namespaces.
Normally, most users will only deal with a single cell and so they won't see this. Even if they do look into a second cell, they won't see a problem unless they happen to hit a volume with the same ID as one they've already got mounted.
Before the patch:
# ls /afs/grand.central.org/archive
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# ls /afs/kth.se/
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# cat /proc/mounts | grep afs
none /afs afs rw,relatime,dyn,autocell 0 0
#grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
#grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
#grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0After the patch:
# ls /afs/grand.central.org/archive
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# ls /afs/kth.se/
admin/ common/ install/ OldFiles/ service/ system/
bakrestores/ home/ misc/ pkg/ src/ wsadmin/
# cat /proc/mounts | grep afs
none /afs afs rw,relatime,dyn,autocell 0 0
#grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
#grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
#kth.se:root.cell /afs/kth.se afs ro,relatime 0 0--- fs/afs/super.c | 1 + 1 file changed, 1 insertion(+)
fs/afs/super.c +1 -0
@@ -356,6 +356,7 @@ static int afs_test_super(struct super_breturn (as->net_ns == as1->net_ns && as->volume && as->volume->vid == as1->volume->vid && + as->cell == as1->cell && !as->dyn_root); }
Greg Kroah-Hartman
maintainerPATCH 32/84 drm/ttm: fix start page for huge page check in ttm_put_pages()
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
commit ac1e516d5a4c56bf0cb4a3dfc0672f689131cfd4 upstream.
The first page entry is always the same with itself.
--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +2 -2
@@ -732,7 +732,7 @@ static void ttm_put_pages(struct page **#ifdef CONFIG_TRANSPARENT_HUGEPAGE if (!(flags &TTM_PAGE_FLAG_DMA32 ) && (npages - i) >=HPAGE_PMD_NR ) { -for (j =0 ; j <HPAGE_PMD_NR ; ++j) +for (j =1 ; j <HPAGE_PMD_NR ; ++j)if (p++ != pages[i + j])break ;
@@ -767,7 +767,7 @@ static void ttm_put_pages(struct page **if (!p)break ; -for (j =0 ; j <HPAGE_PMD_NR ; ++j) +for (j =1 ; j <HPAGE_PMD_NR ; ++j)if (p++ != pages[i + j])break ;
Greg Kroah-Hartman
maintainerPATCH 33/84 drm/ttm: fix incrementing the page pointer for huge pages
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
commit 453393369dc9806d2455151e329c599684762428 upstream.
When we increment the counter we need to increment the pointer as well.
--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +2 -2
@@ -733,7 +733,7 @@ static void ttm_put_pages(struct page **if (!(flags &TTM_PAGE_FLAG_DMA32 ) && (npages - i) >=HPAGE_PMD_NR ) {for (j =1 ; j <HPAGE_PMD_NR ; ++j) -if (p++ != pages[i + j]) +if (++p != pages[i + j])break ;if (j ==HPAGE_PMD_NR )
@@ -768,7 +768,7 @@ static void ttm_put_pages(struct page **break ;for (j =1 ; j <HPAGE_PMD_NR ; ++j) -if (p++ != pages[i + j]) +if (++p != pages[i + j])break ;if (j !=HPAGE_PMD_NR )
Greg Kroah-Hartman
maintainerPATCH 34/84 btrfs: simplify inode locking for RWF_NOWAIT
In reply to Greg Kroah-HartmanFrom: Goldwyn Rodrigues <[email protected]>
commit 9cf35f673583ccc9f3e2507498b3079d56614ad3 upstream.
This is similar to 942491c9e6d6 ("xfs: fix AIM7 regression"). Apparently our current rwsem code doesn't like doing the trylock, then lock for real scheme. This causes extra contention on the lock and can be measured eg. by AIM7 benchmark. So change our read/write methods to just do the trylock for the RWF_NOWAIT case.
--- fs/btrfs/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/file.c +3 -2
@@ -1903,9 +1903,10 @@ static ssize_t btrfs_file_write_iter(str (iocb->ki_flags & IOCB_NOWAIT))return -EOPNOTSUPP ; -if (!inode_trylock (inode)) { -if (iocb->ki_flags &IOCB_NOWAIT ) +if (iocb->ki_flags &IOCB_NOWAIT ) { +if (!inode_trylock (inode))return -EAGAIN ; + }else {inode_lock (inode); }
Greg Kroah-Hartman
maintainerPATCH 35/84 RDMA/mlx5: Return proper error value
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
commit 546d30099ed204792083f043cd7e016de86016a3 upstream.
Returned value from mlx5_mr_cache_alloc() is checked to be error or real pointer. Return proper error code instead of NULL which is not checked later.
--- drivers/infiniband/hw/mlx5/mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mr.c +1 -1
@@ -457,7 +457,7 @@ struct mlx5_ib_mr *mlx5_mr_cache_alloc(sif (entry <0 || entry >=MAX_MR_CACHE_ENTRIES ) {mlx5_ib_err (dev,"cache entry %d is out of range\n" , entry); -return NULL ; +return ERR_PTR (-EINVAL ); } ent = &cache->ent[entry];
Greg Kroah-Hartman
maintainerPATCH 36/84 RDMA/srpt: Report the SCSI residual to the initiator
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit e88982ad1bb12db699de96fbc07096359ef6176c upstream.
The code added by this patch is similar to the code that already exists in ibmvscsis_determine_resid(). This patch has been tested by running the following command:
strace sg_raw -r 1k /dev/sdb 12 00 00 00 60 00 -o inquiry.bin |&
grep resid=
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/infiniband/ulp/srpt/ib_srpt.c +24 -0
@@ -1324,9 +1324,11 @@ static int srpt_build_cmd_rsp(struct srp struct srpt_send_ioctx *ioctx, u64 tag, int status) { + struct se_cmd *cmd = &ioctx->cmd;struct srp_rsp *srp_rsp;const u8 *sense_data;int sense_data_len, max_sense_len; +u32 resid = cmd->residual_count;/* * The lowest bit of all SAM-3 status codes is zero (see also
@@ -1348,6 +1350,28 @@ static int srpt_build_cmd_rsp(struct srp srp_rsp->tag = tag; srp_rsp->status = status; +if (cmd->se_cmd_flags &SCF_UNDERFLOW_BIT ) { +if (cmd->data_direction ==DMA_TO_DEVICE ) { +/* residual data from an underflow write */ + srp_rsp->flags =SRP_RSP_FLAG_DOUNDER ; + srp_rsp->data_out_res_cnt =cpu_to_be32 (resid); + }else if (cmd->data_direction ==DMA_FROM_DEVICE ) { +/* residual data from an underflow read */ + srp_rsp->flags =SRP_RSP_FLAG_DIUNDER ; + srp_rsp->data_in_res_cnt =cpu_to_be32 (resid); + } + }else if (cmd->se_cmd_flags &SCF_OVERFLOW_BIT ) { +if (cmd->data_direction ==DMA_TO_DEVICE ) { +/* residual data from an overflow write */ + srp_rsp->flags =SRP_RSP_FLAG_DOOVER ; + srp_rsp->data_out_res_cnt =cpu_to_be32 (resid); + }else if (cmd->data_direction ==DMA_FROM_DEVICE ) { +/* residual data from an overflow read */ + srp_rsp->flags =SRP_RSP_FLAG_DIOVER ; + srp_rsp->data_in_res_cnt =cpu_to_be32 (resid); + } + } +if (sense_data_len) {BUILD_BUG_ON (MIN_MAX_RSP_SIZE <=sizeof (*srp_rsp)); max_sense_len = ch->max_ti_iu_len -sizeof (*srp_rsp);
Greg Kroah-Hartman
maintainerPATCH 37/84 scsi: enclosure: Fix stale device oops with hot replug
In reply to Greg Kroah-HartmanFrom: James Bottomley <[email protected]>
commit 529244bd1afc102ab164429d338d310d5d65e60d upstream.
Doing an add/remove/add on a SCSI device in an enclosure leads to an oops caused by poisoned values in the enclosure device list pointers. The reason is because we are keeping the enclosure device across the enclosed device add/remove/add but the current code is doing a device_add/device_del/device_add on it. This is the wrong thing to do in sysfs, so fix it by not doing a device_del on the enclosure device simply because of a hot remove of the drive in the slot.
[mkp: added missing email addresses]
--- drivers/misc/enclosure.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/enclosure.c +1 -2
@@ -419,10 +419,9 @@ int enclosure_remove_device(struct enclo cdev = &edev->component[i];if (cdev->dev == dev) {enclosure_remove_links (cdev); -device_del (&cdev->cdev);put_device (dev); cdev->dev =NULL ; -return device_add (&cdev->cdev); +return 0 ; } }return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 38/84 scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI
In reply to Greg Kroah-HartmanFrom: Xiang Chen <[email protected]>
commit 465f4edaecc6c37f81349233e84d46246bcac11a upstream.
If an attached disk with protection information enabled is reformatted to Type 0 the revalidation code does not clear the original protection type and subsequent accesses will keep setting RDPROTECT/WRPROTECT.
Set the protection type to 0 if the disk reports PROT_EN=0 in READ CAPACITY(16).
[mkp: commit desc]
--- drivers/scsi/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/sd.c +3 -1
@@ -2195,8 +2195,10 @@ static int sd_read_protection_type(strucu8 type;int ret =0 ; -if (scsi_device_protection (sdp) ==0 || (buffer[12 ] &1 ) ==0 ) +if (scsi_device_protection (sdp) ==0 || (buffer[12 ] &1 ) ==0 ) { + sdkp->protection_type =0 ;return ret; + } type = ((buffer[12 ] >>1 ) &7 ) +1 ;/* P_TYPE 0 = Type 1 */
Greg Kroah-Hartman
maintainerPATCH 39/84 platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0
In reply to Greg Kroah-HartmanFrom: Jian-Hong Pan <[email protected]>
commit 176a7fca81c5090a7240664e3002c106d296bf31 upstream.
Some of ASUS laptops like UX431FL keyboard backlight cannot be set to brightness 0. According to ASUS' information, the brightness should be 0x80 ~ 0x83. This patch fixes it by following the logic.
--- drivers/platform/x86/asus-wmi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/platform/x86/asus-wmi.c +1 -7
@@ -463,13 +463,7 @@ static void kbd_led_update(struct work_s asus = container_of(work, struct asus_wmi, kbd_led_work); -/* -* bits 0-2: level -* bit 7: light on/off -*/ -if (asus->kbd_led_wk >0 ) - ctrl_param =0x80 | (asus->kbd_led_wk &0x7F ); - + ctrl_param =0x80 | (asus->kbd_led_wk &0x7F );asus_wmi_set_devstate (ASUS_WMI_DEVID_KBD_BACKLIGHT , ctrl_param,NULL );led_classdev_notify_brightness_hw_changed (&asus->kbd_led, asus->kbd_led_wk); }
Greg Kroah-Hartman
maintainerPATCH 40/84 platform/x86: GPD pocket fan: Use default values when wrong modparams are given
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 6ae01050e49f0080ae30575d9b45a6d4a3d7ee23 upstream.
Use our default values when wrong module-parameters are given, instead of refusing to load. Refusing to load leaves the fan at the BIOS default setting, which is "Off". The CPU's thermal throttling should protect the system from damage, but not-loading is really not the best fallback in this case.
This commit fixes this by re-setting module-parameter values to their defaults if they are out of range, instead of failing the probe with -EINVAL.
--- drivers/platform/x86/gpd-pocket-fan.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
drivers/platform/x86/gpd-pocket-fan.c +19 -6
@@ -16,17 +16,27 @@#define MAX_SPEED 3 -static int temp_limits[3 ] = {55000 ,60000 ,65000 }; +#define TEMP_LIMIT0_DEFAULT 55000 +#define TEMP_LIMIT1_DEFAULT 60000 +#define TEMP_LIMIT2_DEFAULT 65000 + +#define HYSTERESIS_DEFAULT 3000 + +#define SPEED_ON_AC_DEFAULT 2 + +static int temp_limits[3 ] = { +TEMP_LIMIT0_DEFAULT ,TEMP_LIMIT1_DEFAULT ,TEMP_LIMIT2_DEFAULT , +};module_param_array (temp_limits, int,NULL ,0444 );MODULE_PARM_DESC (temp_limits,"Millicelsius values above which the fan speed increases" ); -static int hysteresis =3000 ; +static int hysteresis =HYSTERESIS_DEFAULT ;module_param (hysteresis, int,0444 );MODULE_PARM_DESC (hysteresis,"Hysteresis in millicelsius before lowering the fan speed" ); -static int speed_on_ac =2 ; +static int speed_on_ac =SPEED_ON_AC_DEFAULT ;module_param (speed_on_ac, int,0444 );MODULE_PARM_DESC (speed_on_ac,"minimum fan speed to allow when system is powered by AC" );
@@ -120,18 +130,21 @@ static int gpd_pocket_fan_probe(struct pif (temp_limits[i] <40000 || temp_limits[i] >70000 ) {dev_err (&pdev->dev,"Invalid temp-limit %d (must be between 40000 and 70000)\n" , temp_limits[i]); -return -EINVAL ; + temp_limits[0 ] =TEMP_LIMIT0_DEFAULT ; + temp_limits[1 ] =TEMP_LIMIT1_DEFAULT ; + temp_limits[2 ] =TEMP_LIMIT2_DEFAULT ; +break ; } }if (hysteresis <1000 || hysteresis >10000 ) {dev_err (&pdev->dev,"Invalid hysteresis %d (must be between 1000 and 10000)\n" , hysteresis); -return -EINVAL ; + hysteresis =HYSTERESIS_DEFAULT ; }if (speed_on_ac <0 || speed_on_ac >MAX_SPEED ) {dev_err (&pdev->dev,"Invalid speed_on_ac %d (must be between 0 and 3)\n" , speed_on_ac); -return -EINVAL ; + speed_on_ac =SPEED_ON_AC_DEFAULT ; } fan =devm_kzalloc (&pdev->dev,sizeof (*fan),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 41/84 xprtrdma: Fix completion wait during device removal
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 13cb886c591f341a8759f175292ddf978ef903a1 upstream.
I've found that on occasion, "rmmod <dev>" will hang while if an NFS is under load.
Ensure that ri_remove_done is initialized only just before the transport is woken up to force a close. This avoids the completion possibly getting initialized again while the CM event handler is waiting for a wake-up.
--- net/sunrpc/xprtrdma/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xprtrdma/verbs.c +1 -1
@@ -248,6 +248,7 @@ rpcrdma_conn_upcall(struct rdma_cm_id *i ia->ri_device->name, rpcrdma_addrstr(xprt), rpcrdma_portstr(xprt));#endif +init_completion (&ia->ri_remove_done);set_bit (RPCRDMA_IAF_REMOVING , &ia->ri_flags); ep->rep_connected = -ENODEV ;xprt_force_disconnect (&xprt->rx_xprt);
@@ -306,7 +307,6 @@ rpcrdma_create_id(struct rpcrdma_xprt *xtrace_xprtrdma_conn_start (xprt);init_completion (&ia->ri_done); -init_completion (&ia->ri_remove_done); id =rdma_create_id (xprt->rx_xprt.xprt_net, rpcrdma_conn_upcall, xprt,RDMA_PS_TCP ,IB_QPT_RC );
Greg Kroah-Hartman
maintainerPATCH 42/84 crypto: virtio - implement missing support for output IVs
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit 500e6807ce93b1fdc7d5b827c5cc167cc35630db upstream.
In order to allow for CBC to be chained, which is something that the CTS template relies upon, implementations of CBC need to pass the IV to be used for subsequent invocations via the IV buffer. This was not implemented yet for virtio-crypto so implement it now.
--- drivers/crypto/virtio/virtio_crypto_algs.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/crypto/virtio/virtio_crypto_algs.c +9 -0
@@ -449,6 +449,11 @@ __virtio_crypto_ablkcipher_do_req(struct goto free; }memcpy (iv, req->info, ivsize); +if (!vc_sym_req->encrypt) +scatterwalk_map_and_copy (req->info, req->src, + req->nbytes -AES_BLOCK_SIZE , +AES_BLOCK_SIZE ,0 ); +sg_init_one (&iv_sg, iv, ivsize); sgs[num_out++] = &iv_sg; vc_sym_req->iv = iv;
@@ -585,6 +590,10 @@ static void virtio_crypto_ablkcipher_fin struct ablkcipher_request *req, int err) { +if (vc_sym_req->encrypt) +scatterwalk_map_and_copy (req->info, req->dst, + req->nbytes -AES_BLOCK_SIZE , +AES_BLOCK_SIZE ,0 );crypto_finalize_ablkcipher_request (vc_sym_req->base.dataq->engine, req, err);kzfree (vc_sym_req->iv);
Greg Kroah-Hartman
maintainerPATCH 43/84 NFSv2: Fix a typo in encode_sattr()
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
commit ad97a995d8edff820d4238bd0dfc69f440031ae6 upstream.
Encode the mtime correctly.
--- fs/nfs/nfs2xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs2xdr.c +1 -1
@@ -385,7 +385,7 @@ static void encode_sattr(struct xdr_stre }else p =xdr_time_not_set (p);if (attr->ia_valid &ATTR_MTIME_SET ) { - ts =timespec64_to_timespec (attr->ia_atime); + ts =timespec64_to_timespec (attr->ia_mtime);xdr_encode_time (p, &ts); }else if (attr->ia_valid &ATTR_MTIME ) { ts =timespec64_to_timespec (attr->ia_mtime);
Greg Kroah-Hartman
maintainerPATCH 44/84 NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
commit 5326de9e94bedcf7366e7e7625d4deb8c1f1ca8a upstream.
If nfs4_delegreturn_prepare needs to wait for a layoutreturn to complete then make sure we drop the sequence slot if we hold it.
--- fs/nfs/nfs4proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs/nfs4proc.c +3 -1
@@ -6103,8 +6103,10 @@ static void nfs4_delegreturn_prepare(str d_data = (struct nfs4_delegreturndata *)data; -if (!d_data->lr.roc &&nfs4_wait_on_layoutreturn (d_data->inode, task)) +if (!d_data->lr.roc &&nfs4_wait_on_layoutreturn (d_data->inode, task)) { +nfs4_sequence_done (task, &d_data->res.seq_res);return ; + } lo = d_data->args.lr_args ? d_data->args.lr_args->layout :NULL ;if (lo && !pnfs_layout_is_valid (lo)) {
Greg Kroah-Hartman
maintainerPATCH 45/84 iio: imu: adis16480: assign bias value only if operation succeeded
In reply to Greg Kroah-HartmanFrom: Alexandru Ardelean <[email protected]>
commit 9b742763d9d4195e823ae6ece760c9ed0500c1dc upstream.
This was found only after the whole thing with the inline functions, but the compiler actually found something. The value of the bias (in adis16480_get_calibbias()) should only be set if the read operation was successful.
No actual known problem occurs as users of this function all ultimately check the return value. Hence probably not stable material.
--- drivers/iio/imu/adis16480.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/imu/adis16480.c +4 -2
@@ -376,12 +376,14 @@ static int adis16480_get_calibbias(struccase IIO_MAGN :case IIO_PRESSURE : ret =adis_read_reg_16 (&st->adis, reg, &val16); - *bias =sign_extend32 (val16,15 ); +if (ret ==0 ) + *bias =sign_extend32 (val16,15 );break ;case IIO_ANGL_VEL :case IIO_ACCEL : ret =adis_read_reg_32 (&st->adis, reg, &val32); - *bias =sign_extend32 (val32,31 ); +if (ret ==0 ) + *bias =sign_extend32 (val32,31 );break ;default : ret = -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 46/84 mei: fix modalias documentation
In reply to Greg Kroah-HartmanFrom: Alexander Usyskin <[email protected]>
commit 73668309215285366c433489de70d31362987be9 upstream.
mei client bus added the client protocol version to the device alias, but ABI documentation was not updated.
--- Documentation/ABI/testing/sysfs-bus-mei | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-bus-mei +1 -1
@@ -4,7 +4,7 @@ KernelVersion: 3.10 Contact: Samuel Ortiz <[email protected]> [email protected] Description: Stores the same MODALIAS value emitted by uevent - Format: mei:<mei device name>:<device uuid>: + Format: mei:<mei device name>:<device uuid>:<protocol version> What: /sys/bus/mei/devices/.../name Date: May 2015
Greg Kroah-Hartman
maintainerPATCH 47/84 clk: samsung: exynos5420: Preserve CPU clocks configuration during suspend/resume
In reply to Greg Kroah-HartmanFrom: Marian Mihailescu <[email protected]>
commit e21be0d1d7bd7f78a77613f6bcb6965e72b22fc1 upstream.
Save and restore top PLL related configuration registers for big (APLL) and LITTLE (KPLL) cores during suspend/resume cycle. So far, CPU clocks were reset to default values after suspend/resume cycle and performance after system resume was affected when performance governor has been selected.
--- drivers/clk/samsung/clk-exynos5420.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/samsung/clk-exynos5420.c +2 -0
@@ -171,6 +171,8 @@ static const unsigned long exynos5x_clk_GATE_BUS_CPU ,GATE_SCLK_CPU ,CLKOUT_CMU_CPU , +APLL_CON0 , +KPLL_CON0 ,CPLL_CON0 ,DPLL_CON0 , EPLL_CON0,
Greg Kroah-Hartman
maintainerPATCH 48/84 pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
commit 5ff8aca906f3a7a7db79fad92f2a4401107ef50d upstream.
The call to pinctrl_count_index_with_args checks for a -EINVAL return however this function calls pinctrl_get_list_and_count and this can return -ENOENT. Rather than check for a specific error, fix this by checking for any error return to catch the -ENOENT case.
Addresses-Coverity: ("Improper use of negative")
--- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c +1 -1
@@ -496,7 +496,7 @@ static int ti_iodelay_dt_node_to_map(strreturn -EINVAL ; rows =pinctrl_count_index_with_args (np, name); -if (rows == -EINVAL ) +if (rows <0 )return rows; *map =devm_kzalloc (iod->dev,sizeof (**map),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 49/84 pinctrl: lewisburg: Update pin list according to v1.1v6
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit e66ff71fd0dba36a53f91f39e4da6c7b84764f2e upstream.
Version 1.1v6 of pin list has some changes in pin names for Intel Lewisburg.
Update the driver accordingly.
Note, it reveals the bug in the driver that misses two pins in GPP_L and has rather two extra ones. That's why the ordering of some groups is changed.
--- drivers/pinctrl/intel/pinctrl-lewisburg.c | 171 +++++++++++++++--------------- 1 file changed, 86 insertions(+), 85 deletions(-)
drivers/pinctrl/intel/pinctrl-lewisburg.c +86 -85
@@ -31,6 +31,7 @@ .npins = ((e) - (s) + 1), \ } +/* Lewisburg */ static const struct pinctrl_pin_desc lbg_pins[] = {/* GPP_A */ PINCTRL_PIN (0 ,"RCINB" ),
@@ -70,7 +71,7 @@ static const struct pinctrl_pin_desc lbgPINCTRL_PIN (33 ,"SRCCLKREQB_4" ),PINCTRL_PIN (34 ,"SRCCLKREQB_5" ),PINCTRL_PIN (35 ,"GPP_B_11" ), -PINCTRL_PIN (36 ,"GLB_RST_WARN_N" ), +PINCTRL_PIN (36 ,"SLP_S0B" ),PINCTRL_PIN (37 ,"PLTRSTB" ),PINCTRL_PIN (38 ,"SPKR" ), PINCTRL_PIN(39, "GPP_B_15"),
@@ -183,96 +184,96 @@ static const struct pinctrl_pin_desc lbgPINCTRL_PIN (141 ,"GBE_PCI_DIS" ),PINCTRL_PIN (142 ,"GBE_LAN_DIS" ),PINCTRL_PIN (143 ,"GPP_I_10" ), -PINCTRL_PIN (144 ,"GPIO_RCOMP_3P3" ),/* GPP_J */ -PINCTRL_PIN (145 ,"GBE_LED_0_0" ), -PINCTRL_PIN (146 ,"GBE_LED_0_1" ), -PINCTRL_PIN (147 ,"GBE_LED_1_0" ), -PINCTRL_PIN (148 ,"GBE_LED_1_1" ), -PINCTRL_PIN (149 ,"GBE_LED_2_0" ), -PINCTRL_PIN (150 ,"GBE_LED_2_1" ), -PINCTRL_PIN (151 ,"GBE_LED_3_0" ), -PINCTRL_PIN (152 ,"GBE_LED_3_1" ), -PINCTRL_PIN (153 ,"GBE_SCL_0" ), -PINCTRL_PIN (154 ,"GBE_SDA_0" ), -PINCTRL_PIN (155 ,"GBE_SCL_1" ), -PINCTRL_PIN (156 ,"GBE_SDA_1" ), -PINCTRL_PIN (157 ,"GBE_SCL_2" ), -PINCTRL_PIN (158 ,"GBE_SDA_2" ), -PINCTRL_PIN (159 ,"GBE_SCL_3" ), -PINCTRL_PIN (160 ,"GBE_SDA_3" ), -PINCTRL_PIN (161 ,"GBE_SDP_0_0" ), -PINCTRL_PIN (162 ,"GBE_SDP_0_1" ), -PINCTRL_PIN (163 ,"GBE_SDP_1_0" ), -PINCTRL_PIN (164 ,"GBE_SDP_1_1" ), -PINCTRL_PIN (165 ,"GBE_SDP_2_0" ), -PINCTRL_PIN (166 ,"GBE_SDP_2_1" ), -PINCTRL_PIN (167 ,"GBE_SDP_3_0" ), -PINCTRL_PIN (168 ,"GBE_SDP_3_1" ), +PINCTRL_PIN (144 ,"GBE_LED_0_0" ), +PINCTRL_PIN (145 ,"GBE_LED_0_1" ), +PINCTRL_PIN (146 ,"GBE_LED_1_0" ), +PINCTRL_PIN (147 ,"GBE_LED_1_1" ), +PINCTRL_PIN (148 ,"GBE_LED_2_0" ), +PINCTRL_PIN (149 ,"GBE_LED_2_1" ), +PINCTRL_PIN (150 ,"GBE_LED_3_0" ), +PINCTRL_PIN (151 ,"GBE_LED_3_1" ), +PINCTRL_PIN (152 ,"GBE_SCL_0" ), +PINCTRL_PIN (153 ,"GBE_SDA_0" ), +PINCTRL_PIN (154 ,"GBE_SCL_1" ), +PINCTRL_PIN (155 ,"GBE_SDA_1" ), +PINCTRL_PIN (156 ,"GBE_SCL_2" ), +PINCTRL_PIN (157 ,"GBE_SDA_2" ), +PINCTRL_PIN (158 ,"GBE_SCL_3" ), +PINCTRL_PIN (159 ,"GBE_SDA_3" ), +PINCTRL_PIN (160 ,"GBE_SDP_0_0" ), +PINCTRL_PIN (161 ,"GBE_SDP_0_1" ), +PINCTRL_PIN (162 ,"GBE_SDP_1_0" ), +PINCTRL_PIN (163 ,"GBE_SDP_1_1" ), +PINCTRL_PIN (164 ,"GBE_SDP_2_0" ), +PINCTRL_PIN (165 ,"GBE_SDP_2_1" ), +PINCTRL_PIN (166 ,"GBE_SDP_3_0" ), +PINCTRL_PIN (167 ,"GBE_SDP_3_1" ),/* GPP_K */ -PINCTRL_PIN (169 ,"GBE_RMIICLK" ), -PINCTRL_PIN (170 ,"GBE_RMII_TXD_0" ), -PINCTRL_PIN (171 ,"GBE_RMII_TXD_1" ), +PINCTRL_PIN (168 ,"GBE_RMIICLK" ), +PINCTRL_PIN (169 ,"GBE_RMII_RXD_0" ), +PINCTRL_PIN (170 ,"GBE_RMII_RXD_1" ), +PINCTRL_PIN (171 ,"GBE_RMII_CRS_DV" ),PINCTRL_PIN (172 ,"GBE_RMII_TX_EN" ), -PINCTRL_PIN (173 ,"GBE_RMII_CRS_DV" ), -PINCTRL_PIN (174 ,"GBE_RMII_RXD_0" ), -PINCTRL_PIN (175 ,"GBE_RMII_RXD_1" ), -PINCTRL_PIN (176 ,"GBE_RMII_RX_ER" ), -PINCTRL_PIN (177 ,"GBE_RMII_ARBIN" ), -PINCTRL_PIN (178 ,"GBE_RMII_ARB_OUT" ), -PINCTRL_PIN (179 ,"PE_RST_N" ), -PINCTRL_PIN (180 ,"GPIO_RCOMP_1P8_3P3" ), +PINCTRL_PIN (173 ,"GBE_RMII_TXD_0" ), +PINCTRL_PIN (174 ,"GBE_RMII_TXD_1" ), +PINCTRL_PIN (175 ,"GBE_RMII_RX_ER" ), +PINCTRL_PIN (176 ,"GBE_RMII_ARBIN" ), +PINCTRL_PIN (177 ,"GBE_RMII_ARB_OUT" ), +PINCTRL_PIN (178 ,"PE_RST_N" ),/* GPP_G */ -PINCTRL_PIN (181 ,"FAN_TACH_0" ), -PINCTRL_PIN (182 ,"FAN_TACH_1" ), -PINCTRL_PIN (183 ,"FAN_TACH_2" ), -PINCTRL_PIN (184 ,"FAN_TACH_3" ), -PINCTRL_PIN (185 ,"FAN_TACH_4" ), -PINCTRL_PIN (186 ,"FAN_TACH_5" ), -PINCTRL_PIN (187 ,"FAN_TACH_6" ), -PINCTRL_PIN (188 ,"FAN_TACH_7" ), -PINCTRL_PIN (189 ,"FAN_PWM_0" ), -PINCTRL_PIN (190 ,"FAN_PWM_1" ), -PINCTRL_PIN (191 ,"FAN_PWM_2" ), -PINCTRL_PIN (192 ,"FAN_PWM_3" ), -PINCTRL_PIN (193 ,"GSXDOUT" ), -PINCTRL_PIN (194 ,"GSXSLOAD" ), -PINCTRL_PIN (195 ,"GSXDIN" ), -PINCTRL_PIN (196 ,"GSXSRESETB" ), -PINCTRL_PIN (197 ,"GSXCLK" ), -PINCTRL_PIN (198 ,"ADR_COMPLETE" ), -PINCTRL_PIN (199 ,"NMIB" ), -PINCTRL_PIN (200 ,"SMIB" ), -PINCTRL_PIN (201 ,"SSATA_DEVSLP_0" ), -PINCTRL_PIN (202 ,"SSATA_DEVSLP_1" ), -PINCTRL_PIN (203 ,"SSATA_DEVSLP_2" ), -PINCTRL_PIN (204 ,"SSATAXPCIE0_SSATAGP0" ), +PINCTRL_PIN (179 ,"FAN_TACH_0" ), +PINCTRL_PIN (180 ,"FAN_TACH_1" ), +PINCTRL_PIN (181 ,"FAN_TACH_2" ), +PINCTRL_PIN (182 ,"FAN_TACH_3" ), +PINCTRL_PIN (183 ,"FAN_TACH_4" ), +PINCTRL_PIN (184 ,"FAN_TACH_5" ), +PINCTRL_PIN (185 ,"FAN_TACH_6" ), +PINCTRL_PIN (186 ,"FAN_TACH_7" ), +PINCTRL_PIN (187 ,"FAN_PWM_0" ), +PINCTRL_PIN (188 ,"FAN_PWM_1" ), +PINCTRL_PIN (189 ,"FAN_PWM_2" ), +PINCTRL_PIN (190 ,"FAN_PWM_3" ), +PINCTRL_PIN (191 ,"GSXDOUT" ), +PINCTRL_PIN (192 ,"GSXSLOAD" ), +PINCTRL_PIN (193 ,"GSXDIN" ), +PINCTRL_PIN (194 ,"GSXSRESETB" ), +PINCTRL_PIN (195 ,"GSXCLK" ), +PINCTRL_PIN (196 ,"ADR_COMPLETE" ), +PINCTRL_PIN (197 ,"NMIB" ), +PINCTRL_PIN (198 ,"SMIB" ), +PINCTRL_PIN (199 ,"SSATA_DEVSLP_0" ), +PINCTRL_PIN (200 ,"SSATA_DEVSLP_1" ), +PINCTRL_PIN (201 ,"SSATA_DEVSLP_2" ), +PINCTRL_PIN (202 ,"SSATAXPCIE0_SSATAGP0" ),/* GPP_H */ -PINCTRL_PIN (205 ,"SRCCLKREQB_6" ), -PINCTRL_PIN (206 ,"SRCCLKREQB_7" ), -PINCTRL_PIN (207 ,"SRCCLKREQB_8" ), -PINCTRL_PIN (208 ,"SRCCLKREQB_9" ), -PINCTRL_PIN (209 ,"SRCCLKREQB_10" ), -PINCTRL_PIN (210 ,"SRCCLKREQB_11" ), -PINCTRL_PIN (211 ,"SRCCLKREQB_12" ), -PINCTRL_PIN (212 ,"SRCCLKREQB_13" ), -PINCTRL_PIN (213 ,"SRCCLKREQB_14" ), -PINCTRL_PIN (214 ,"SRCCLKREQB_15" ), -PINCTRL_PIN (215 ,"SML2CLK" ), -PINCTRL_PIN (216 ,"SML2DATA" ), -PINCTRL_PIN (217 ,"SML2ALERTB" ), -PINCTRL_PIN (218 ,"SML3CLK" ), -PINCTRL_PIN (219 ,"SML3DATA" ), -PINCTRL_PIN (220 ,"SML3ALERTB" ), -PINCTRL_PIN (221 ,"SML4CLK" ), -PINCTRL_PIN (222 ,"SML4DATA" ), -PINCTRL_PIN (223 ,"SML4ALERTB" ), -PINCTRL_PIN (224 ,"SSATAXPCIE1_SSATAGP1" ), -PINCTRL_PIN (225 ,"SSATAXPCIE2_SSATAGP2" ), -PINCTRL_PIN (226 ,"SSATAXPCIE3_SSATAGP3" ), -PINCTRL_PIN (227 ,"SSATAXPCIE4_SSATAGP4" ), -PINCTRL_PIN (228 ,"SSATAXPCIE5_SSATAGP5" ), +PINCTRL_PIN (203 ,"SRCCLKREQB_6" ), +PINCTRL_PIN (204 ,"SRCCLKREQB_7" ), +PINCTRL_PIN (205 ,"SRCCLKREQB_8" ), +PINCTRL_PIN (206 ,"SRCCLKREQB_9" ), +PINCTRL_PIN (207 ,"SRCCLKREQB_10" ), +PINCTRL_PIN (208 ,"SRCCLKREQB_11" ), +PINCTRL_PIN (209 ,"SRCCLKREQB_12" ), +PINCTRL_PIN (210 ,"SRCCLKREQB_13" ), +PINCTRL_PIN (211 ,"SRCCLKREQB_14" ), +PINCTRL_PIN (212 ,"SRCCLKREQB_15" ), +PINCTRL_PIN (213 ,"SML2CLK" ), +PINCTRL_PIN (214 ,"SML2DATA" ), +PINCTRL_PIN (215 ,"SML2ALERTB" ), +PINCTRL_PIN (216 ,"SML3CLK" ), +PINCTRL_PIN (217 ,"SML3DATA" ), +PINCTRL_PIN (218 ,"SML3ALERTB" ), +PINCTRL_PIN (219 ,"SML4CLK" ), +PINCTRL_PIN (220 ,"SML4DATA" ), +PINCTRL_PIN (221 ,"SML4ALERTB" ), +PINCTRL_PIN (222 ,"SSATAXPCIE1_SSATAGP1" ), +PINCTRL_PIN (223 ,"SSATAXPCIE2_SSATAGP2" ), +PINCTRL_PIN (224 ,"SSATAXPCIE3_SSATAGP3" ), +PINCTRL_PIN (225 ,"SSATAXPCIE4_SSATAGP4" ), +PINCTRL_PIN (226 ,"SSATAXPCIE5_SSATAGP5" ),/* GPP_L */ +PINCTRL_PIN (227 ,"GPP_L_0" ), +PINCTRL_PIN (228 ,"EC_CSME_INTR_OUT" ),PINCTRL_PIN (229 ,"VISA2CH0_D0" ),PINCTRL_PIN (230 ,"VISA2CH0_D1" ), PINCTRL_PIN(231, "VISA2CH0_D2"),
Greg Kroah-Hartman
maintainerPATCH 50/84 scsi: sd: enable compat ioctls for sed-opal
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 142b2ac82e31c174936c5719fa12ae28f51a55b7 upstream.
The sed_ioctl() function is written to be compatible between 32-bit and 64-bit processes, however compat mode is only wired up for nvme, not for sd.
Add the missing call to sed_ioctl() in sd_compat_ioctl().
--- drivers/scsi/sd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/scsi/sd.c +12 -2
@@ -1685,20 +1685,30 @@ static void sd_rescan(struct device *devstatic int sd_compat_ioctl (struct block_device *bdev,fmode_t mode,unsigned int cmd,unsigned long arg) { -struct scsi_device *sdev =scsi_disk (bdev->bd_disk)->device; +struct gendisk *disk = bdev->bd_disk; +struct scsi_disk *sdkp =scsi_disk (disk); +struct scsi_device *sdev = sdkp->device; +void __user *p =compat_ptr (arg);int error; + error =scsi_verify_blk_ioctl (bdev, cmd); +if (error <0 ) +return error; + error =scsi_ioctl_block_when_processing_errors (sdev, cmd, (mode &FMODE_NDELAY ) !=0 );if (error)return error; + +if (is_sed_ioctl (cmd)) +return sed_ioctl (sdkp->opal_dev, cmd, p);/* * Let the static ioctl translation table take care of it. */ if (!sdev->host->hostt->compat_ioctl)return -ENOIOCTLCMD ; -return sdev->host->hostt->compat_ioctl (sdev, cmd, (void __user *)arg); +return sdev->host->hostt->compat_ioctl (sdev, cmd, p); }#endif
Greg Kroah-Hartman
maintainerPATCH 51/84 arm64: dts: apq8096-db820c: Increase load on l21 for SDCARD
In reply to Greg Kroah-HartmanFrom: Loic Poulain <[email protected]>
commit e38161bd325ea541ef2f258d8e28281077dde524 upstream.
In the same way as for msm8974-hammerhead, l21 load, used for SDCARD VMMC, needs to be increased in order to prevent any voltage drop issues (due to limited current) happening with some SDCARDS or during specific operations (e.g. write).
--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +2 -0
@@ -580,6 +580,8 @@ l21 { regulator-min-microvolt = <2950000>; regulator-max-microvolt = <2950000>; + regulator-allow-set-load; + regulator-system-load = <200000>; }; l22 { regulator-min-microvolt = <3300000>;
Greg Kroah-Hartman
maintainerPATCH 52/84 af_unix: add compat_ioctl support
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 5f6beb9e0f633f3cc845cdd67973c506372931b4 upstream.
The af_unix protocol family has a custom ioctl command (inexplicibly based on SIOCPROTOPRIVATE), but never had a compat_ioctl handler for 32-bit applications.
Since all commands are compatible here, add a trivial wrapper that performs the compat_ptr() conversion for SIOCOUTQ/SIOCINQ. SIOCUNIXFILE does not use the argument, but it doesn't hurt to also use compat_ptr() here.
--- net/unix/af_unix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
net/unix/af_unix.c +19 -0
@@ -649,6 +649,9 @@ static __poll_t unix_poll(struct file *,static __poll_t unix_dgram_poll (struct file *,struct socket *,poll_table *);static int unix_ioctl (struct socket *,unsigned int ,unsigned long ); +#ifdef CONFIG_COMPAT +static int unix_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg); +#endif static int unix_shutdown (struct socket *,int );static int unix_stream_sendmsg (struct socket *,struct msghdr *,size_t );static int unix_stream_recvmsg (struct socket *,struct msghdr *,size_t ,int );
@@ -690,6 +693,9 @@ static const struct proto_ops unix_strea .getname = unix_getname, .poll = unix_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = unix_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -713,6 +719,9 @@ static const struct proto_ops unix_dgram .getname = unix_getname, .poll = unix_dgram_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = sock_no_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -735,6 +744,9 @@ static const struct proto_ops unix_seqpa .getname = unix_getname, .poll = unix_dgram_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = unix_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -2646,6 +2658,13 @@ static int unix_ioctl(struct socket *socreturn err; } +#ifdef CONFIG_COMPAT +static int unix_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg) +{ +return unix_ioctl (sock, cmd, (unsigned long )compat_ptr (arg)); +} +#endif +static __poll_t unix_poll (struct file *file,struct socket *sock,poll_table *wait) {struct sock *sk = sock->sk;
Greg Kroah-Hartman
maintainerPATCH 53/84 compat_ioctl: handle SIOCOUTQNSD
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 9d7bf41fafa5b5ddd4c13eb39446b0045f0a8167 upstream.
Unlike the normal SIOCOUTQ, SIOCOUTQNSD was never handled in compat mode. Add it to the common socket compat handler along with similar ones.
--- net/socket.c | 1 + 1 file changed, 1 insertion(+)
net/socket.c +1 -0
@@ -3240,6 +3240,7 @@ static int compat_sock_ioctl_trans(struccase SIOCSARP :case SIOCGARP :case SIOCDARP : +case SIOCOUTQNSD :case SIOCATMARK :return sock_do_ioctl (net, sock, cmd, arg); }
Greg Kroah-Hartman
maintainerPATCH 54/84 PCI: dwc: Fix find_next_bit() usage
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
commit 1137e61dcb99f7f8b54e77ed83f68b5b485a3e34 upstream.
find_next_bit() takes a parameter of size long, and performs arithmetic that assumes that the argument is of size long.
Therefore we cannot pass a u32, since this will cause find_next_bit() to read outside the stack buffer and will produce the following print:
BUG: KASAN: stack-out-of-bounds in find_next_bit+0x38/0xb0
--- drivers/pci/controller/dwc/pcie-designware-host.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/controller/dwc/pcie-designware-host.c +6 -5
@@ -78,7 +78,8 @@ static struct msi_domain_info dw_pcie_msirqreturn_t dw_handle_msi_irq (struct pcie_port *pp) {int i, pos, irq; -u32 val, num_ctrls; +unsigned long val; +u32 status, num_ctrls;irqreturn_t ret =IRQ_NONE ; num_ctrls = pp->num_vectors /MAX_MSI_IRQS_PER_CTRL ;
@@ -86,14 +87,14 @@ irqreturn_t dw_handle_msi_irq(struct pcifor (i =0 ; i < num_ctrls; i++) {dw_pcie_rd_own_conf (pp,PCIE_MSI_INTR0_STATUS + (i *MSI_REG_CTRL_BLOCK_SIZE ), -4 , &val); -if (!val) +4 , &status); +if (!status)continue ; ret =IRQ_HANDLED ; + val = status; pos =0 ; -while ((pos =find_next_bit ((unsigned long *) &val, -MAX_MSI_IRQS_PER_CTRL , +while ((pos =find_next_bit (&val,MAX_MSI_IRQS_PER_CTRL , pos)) !=MAX_MSI_IRQS_PER_CTRL ) { irq = irq_find_mapping(pp->irq_domain, (i * MAX_MSI_IRQS_PER_CTRL) +
Greg Kroah-Hartman
maintainerPATCH 55/84 PCI/PTM: Remove spurious "d" from granularity message
In reply to Greg Kroah-HartmanFrom: Bjorn Helgaas <[email protected]>
commit 127a7709495db52a41012deaebbb7afc231dad91 upstream.
The granularity message has an extra "d":
pci 0000:02:00.0: PTM enabled, 4dns granularity
Remove the "d" so the message is simply "PTM enabled, 4ns granularity".
--- drivers/pci/pcie/ptm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/ptm.c +1 -1
@@ -21,7 +21,7 @@ static void pci_ptm_info(struct pci_devsnprintf (clock_desc,sizeof (clock_desc),">254ns" );break ;default : -snprintf (clock_desc,sizeof (clock_desc),"%udns" , +snprintf (clock_desc,sizeof (clock_desc),"%uns" , dev->ptm_granularity);break ; }
Greg Kroah-Hartman
maintainerPATCH 56/84 powerpc/powernv: Disable native PCIe port management
In reply to Greg Kroah-HartmanFrom: Oliver O'Halloran <[email protected]>
commit 9d72dcef891030545f39ad386a30cf91df517fb2 upstream.
On PowerNV the PCIe topology is (currently) managed by the powernv platform code in Linux in cooperation with the platform firmware. Linux's native PCIe port service drivers operate independently of both and this can cause problems.
The main issue is that the portbus driver will conflict with the platform specific hotplug driver (pnv_php) over ownership of the MSI used to notify the host when a hotplug event occurs. The portbus driver claims this MSI on behalf of the individual port services because the same interrupt is used for hotplug events, PMEs (on root ports), and link bandwidth change notifications. The portbus driver will always claim the interrupt even if the individual port service drivers, such as pciehp, are compiled out.
The second, bigger, problem is that the hotplug port service driver fundamentally does not work on PowerNV. The platform assumes that all PCI devices have a corresponding arch-specific handle derived from the DT node for the device (pci_dn) and without one the platform will not allow a PCI device to be enabled. This problem is largely due to historical baggage, but it can't be resolved without significant re-factoring of the platform PCI support.
We can fix these problems in the interim by setting the "pcie_ports_disabled" flag during platform initialisation. The flag indicates the platform owns the PCIe ports which stops the portbus driver from being registered.
This does have the side effect of disabling all port services drivers that is: AER, PME, BW notifications, hotplug, and DPC. However, this is not a huge disadvantage on PowerNV since these services are either unused or handled through other means.
--- arch/powerpc/platforms/powernv/pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/powerpc/platforms/powernv/pci.c +17 -0
@@ -1095,6 +1095,23 @@ void __init pnv_pci_init(void)if (!firmware_has_feature (FW_FEATURE_OPAL ))return ; +#ifdef CONFIG_PCIEPORTBUS +/* +* On PowerNV PCIe devices are (currently) managed in cooperation +* with firmware. This isn't *strictly* required, but there's enough +* assumptions baked into both firmware and the platform code that +* it's unwise to allow the portbus services to be used. +* +* We need to fix this eventually, but for now set this flag to disable +* the portbus driver. The AER service isn't required since that AER +* events are handled via EEH. The pciehp hotplug driver can't work +* without kernel changes (and portbus binding breaks pnv_php). The +* other services also require some thinking about how we're going +* to integrate them. +*/ + pcie_ports_disabled = true; +#endif +/* Look for IODA IO-Hubs. */ for_each_compatible_node (np,NULL ,"ibm,ioda-hub" ) {pnv_pci_init_ioda_hub (np);
Greg Kroah-Hartman
maintainerPATCH 57/84 tty: serial: imx: use the sg count from dma_map_sg
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
commit 596fd8dffb745afcebc0ec6968e17fe29f02044c upstream.
The dmaengine_prep_slave_sg needs to use sg count returned by dma_map_sg, not use sport->dma_tx_nents, because the return value of dma_map_sg is not always same with "nents".
--- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/imx.c +1 -1
@@ -624,7 +624,7 @@ static void imx_uart_dma_tx(struct imx_pdev_err (dev,"DMA mapping error for TX.\n" );return ; } - desc =dmaengine_prep_slave_sg (chan, sgl, sport->dma_tx_nents, + desc =dmaengine_prep_slave_sg (chan, sgl, ret,DMA_MEM_TO_DEV ,DMA_PREP_INTERRUPT );if (!desc) { dma_unmap_sg(dev, sgl, sport->dma_tx_nents,
Greg Kroah-Hartman
maintainerPATCH 58/84 tty: serial: pch_uart: correct usage of dma_unmap_sg
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
commit 74887542fdcc92ad06a48c0cca17cdf09fc8aa00 upstream.
Per Documentation/DMA-API-HOWTO.txt,
To unmap a scatterlist, just call:
dma_unmap_sg(dev, sglist, nents, direction);
.. note::
The 'nents' argument to the dma_unmap_sg call must be the _same_ one you passed into the dma_map_sg call, it should _NOT_ be the 'count' value _returned_ from the dma_map_sg call.
However in the driver, priv->nent is directly assigned with value returned from dma_map_sg, and dma_unmap_sg use priv->nent for unmap, this breaks the API usage.
So introduce a new entry orig_nent to remember 'nents'.
--- drivers/tty/serial/pch_uart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/tty/serial/pch_uart.c +4 -1
@@ -235,6 +235,7 @@ struct eg20t_port {struct dma_chan *chan_rx;struct scatterlist *sg_tx_p;int nent; +int orig_nent;struct scatterlist sg_rx;int tx_dma_use;void *rx_buf_virt;
@@ -789,9 +790,10 @@ static void pch_dma_tx_complete(void *ar } xmit->tail &=UART_XMIT_SIZE -1 ;async_tx_ack (priv->desc_tx); -dma_unmap_sg (port->dev, sg, priv->nent,DMA_TO_DEVICE ); +dma_unmap_sg (port->dev, sg, priv->orig_nent,DMA_TO_DEVICE ); priv->tx_dma_use =0 ; priv->nent =0 ; + priv->orig_nent =0 ;kfree (priv->sg_tx_p);pch_uart_hal_enable_interrupt (priv,PCH_UART_HAL_TX_INT ); }
@@ -1015,6 +1017,7 @@ static unsigned int dma_handle_tx(structdev_err (priv->port.dev,"%s:dma_map_sg Failed\n" , __func__);return 0 ; } + priv->orig_nent = num; priv->nent = nent;for (i =0 ; i < nent; i++, sg++) {
Greg Kroah-Hartman
maintainerPATCH 59/84 media: ov6650: Fix incorrect use of JPEG colorspace
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 12500731895ef09afc5b66b86b76c0884fb9c7bf upstream.
Since its initial submission, the driver selects V4L2_COLORSPACE_JPEG for supported formats other than V4L2_MBUS_FMT_SBGGR8_1X8. According to v4l2-compliance test program, V4L2_COLORSPACE_JPEG applies exclusively to V4L2_PIX_FMT_JPEG. Since the sensor does not support JPEG format, fix it to always select V4L2_COLORSPACE_SRGB.
--- drivers/media/i2c/ov6650.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/media/i2c/ov6650.c +2 -11
@@ -203,7 +203,6 @@ struct ov6650 {unsigned long pclk_max;/* from resolution and format */ struct v4l2_fract tpf;/* as requested with s_frame_interval */ u32 code; -enum v4l2_colorspace colorspace; };
@@ -520,7 +519,7 @@ static int ov6650_get_fmt(struct v4l2_su mf->width = priv->rect.width >> priv->half_scale; mf->height = priv->rect.height >> priv->half_scale; mf->code = priv->code; - mf->colorspace = priv->colorspace; + mf->colorspace =V4L2_COLORSPACE_SRGB ; mf->field =V4L2_FIELD_NONE ;return 0 ;
@@ -627,11 +626,6 @@ static int ov6650_s_fmt(struct v4l2_subd priv->pclk_max =8000000 ; } -if (code ==MEDIA_BUS_FMT_SBGGR8_1X8 ) - priv->colorspace =V4L2_COLORSPACE_SRGB ; -else if (code !=0 ) - priv->colorspace =V4L2_COLORSPACE_JPEG ; -if (half_scale) {dev_dbg (&client->dev,"max resolution: QCIF\n" ); coma_set |=COMA_QCIF ;
@@ -666,7 +660,6 @@ static int ov6650_s_fmt(struct v4l2_subd priv->code = code;if (!ret) { - mf->colorspace = priv->colorspace; mf->width = priv->rect.width >> half_scale; mf->height = priv->rect.height >> half_scale; }
@@ -689,6 +682,7 @@ static int ov6650_set_fmt(struct v4l2_su &mf->height, 2, H_CIF, 1, 0); mf->field =V4L2_FIELD_NONE ; + mf->colorspace =V4L2_COLORSPACE_SRGB ;switch (mf->code) {case MEDIA_BUS_FMT_Y10_1X10 :
@@ -699,13 +693,11 @@ static int ov6650_set_fmt(struct v4l2_sucase MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_VYUY8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 : - mf->colorspace =V4L2_COLORSPACE_JPEG ;break ;default : mf->code =MEDIA_BUS_FMT_SBGGR8_1X8 ;/* fall through */ case MEDIA_BUS_FMT_SBGGR8_1X8 : - mf->colorspace =V4L2_COLORSPACE_SRGB ;break ; }
@@ -1006,7 +998,6 @@ static int ov6650_probe(struct i2c_clien priv->rect.height =H_CIF ; priv->half_scale = false; priv->code =MEDIA_BUS_FMT_YUYV8_2X8 ; - priv->colorspace =V4L2_COLORSPACE_JPEG ; ret =ov6650_video_probe (client);if (ret)
Greg Kroah-Hartman
maintainerPATCH 60/84 media: ov6650: Fix some format attributes not under control
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 1c6a2b63095154bbf9e8f38d79487a728331bf65 upstream.
User arguments passed to .get/set_fmt() pad operation callbacks may contain unsupported values. The driver takes control over frame size and pixel code as well as colorspace and field attributes but has never cared for remainig format attributes, i.e., ycbcr_enc, quantization and xfer_func, introduced by commit 11ff030c7365 ("[media]
v4l2-mediabus: improve colorspace support"). Fix it.
Set up a static v4l2_mbus_framefmt structure with attributes initialized to reasonable defaults and use it for updating content of user provided arguments. In case of V4L2_SUBDEV_FORMAT_ACTIVE, postpone frame size update, now performed from inside ov6650_s_fmt() helper, util the user argument is first updated in ov6650_set_fmt() with default frame format content. For V4L2_SUBDEV_FORMAT_TRY, don't copy all attributes to pad config, only those handled by the driver, then fill the response with the default frame format updated with resulting pad config format code and frame size.
--- drivers/media/i2c/ov6650.c | 51 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 12 deletions(-)
drivers/media/i2c/ov6650.c +39 -12
@@ -215,6 +215,17 @@ static u32 ov6650_codes[] = { MEDIA_BUS_FMT_Y8_1X8, }; +static const struct v4l2_mbus_framefmt ov6650_def_fmt = { + .width =W_CIF , + .height =H_CIF , + .code =MEDIA_BUS_FMT_SBGGR8_1X8 , + .colorspace =V4L2_COLORSPACE_SRGB , + .field =V4L2_FIELD_NONE , + .ycbcr_enc =V4L2_YCBCR_ENC_DEFAULT , + .quantization =V4L2_QUANTIZATION_DEFAULT , + .xfer_func =V4L2_XFER_FUNC_DEFAULT , +}; +/* read a register */ static int ov6650_reg_read (struct i2c_client *client,u8 reg,u8 *val) {
@@ -516,11 +527,13 @@ static int ov6650_get_fmt(struct v4l2_suif (format->pad)return -EINVAL ; +/* initialize response with default media bus frame format */ + *mf = ov6650_def_fmt; + +/* update media bus format code and frame size */ mf->width = priv->rect.width >> priv->half_scale; mf->height = priv->rect.height >> priv->half_scale; mf->code = priv->code; - mf->colorspace =V4L2_COLORSPACE_SRGB ; - mf->field =V4L2_FIELD_NONE ;return 0 ; }
@@ -659,10 +672,6 @@ static int ov6650_s_fmt(struct v4l2_subdif (!ret) priv->code = code; -if (!ret) { - mf->width = priv->rect.width >> half_scale; - mf->height = priv->rect.height >> half_scale; - }return ret; }
@@ -681,9 +690,6 @@ static int ov6650_set_fmt(struct v4l2_suv4l_bound_align_image (&mf->width,2 ,W_CIF ,1 , &mf->height,2 ,H_CIF ,1 ,0 ); - mf->field =V4L2_FIELD_NONE ; - mf->colorspace =V4L2_COLORSPACE_SRGB ; -switch (mf->code) {case MEDIA_BUS_FMT_Y10_1X10 : mf->code =MEDIA_BUS_FMT_Y8_1X8 ;
@@ -701,10 +707,31 @@ static int ov6650_set_fmt(struct v4l2_subreak ; } -if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return ov6650_s_fmt (sd, mf); - cfg->try_fmt = *mf; +if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { +/* store media bus format code and frame size in pad config */ + cfg->try_fmt.width = mf->width; + cfg->try_fmt.height = mf->height; + cfg->try_fmt.code = mf->code; + +/* return default mbus frame format updated with pad config */ + *mf = ov6650_def_fmt; + mf->width = cfg->try_fmt.width; + mf->height = cfg->try_fmt.height; + mf->code = cfg->try_fmt.code; + + }else { +/* apply new media bus format code and frame size */ +int ret =ov6650_s_fmt (sd, mf); +if (ret) +return ret; + +/* return default format updated with active size and code */ + *mf = ov6650_def_fmt; + mf->width = priv->rect.width >> priv->half_scale; + mf->height = priv->rect.height >> priv->half_scale; + mf->code = priv->code; + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 61/84 media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 39034bb0c26b76a2c3abc54aa28c185f18b40c2f upstream.
Commit da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad op get_fmt") converted a former ov6650_g_fmt() video operation callback to an ov6650_get_fmt() pad operation callback. However, the converted function disregards a format->which flag that pad operations should obey and always returns active frame format settings.
That can be fixed by always responding to V4L2_SUBDEV_FORMAT_TRY with -EINVAL, or providing the response from a pad config argument, likely updated by a former user call to V4L2_SUBDEV_FORMAT_TRY .set_fmt(). Since implementation of the latter is trivial, go for it.
--- drivers/media/i2c/ov6650.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/media/i2c/ov6650.c +9 -3
@@ -531,10 +531,16 @@ static int ov6650_get_fmt(struct v4l2_su *mf = ov6650_def_fmt;/* update media bus format code and frame size */ - mf->width = priv->rect.width >> priv->half_scale; - mf->height = priv->rect.height >> priv->half_scale; - mf->code = priv->code; +if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { + mf->width = cfg->try_fmt.width; + mf->height = cfg->try_fmt.height; + mf->code = cfg->try_fmt.code; + }else { + mf->width = priv->rect.width >> priv->half_scale; + mf->height = priv->rect.height >> priv->half_scale; + mf->code = priv->code; + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 62/84 media: rcar-vin: Fix incorrect return statement in rvin_try_format()
In reply to Greg Kroah-HartmanFrom: Niklas Söderlund <[email protected]>
commit a0862a40364e2f87109317e31c51c9d7bc89e33f upstream.
While refactoring code the return statement became corrupted, fix it by returning the correct return code.
--- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/rcar-vin/rcar-v4l2.c +2 -1
@@ -196,6 +196,7 @@ static int rvin_try_format(struct rvin_d ret =v4l2_subdev_call (sd, pad, set_fmt, pad_cfg, &format);if (ret <0 && ret != -ENOIOCTLCMD ) goto done; + ret =0 ;v4l2_fill_pix_format (pix, &format.format);
@@ -230,7 +231,7 @@ static int rvin_try_format(struct rvin_d done:v4l2_subdev_free_pad_config (pad_cfg); -return 0 ; +return ret; } static int rvin_querycap(struct file *file, void *priv,
Greg Kroah-Hartman
maintainerPATCH 63/84 media: v4l: cadence: Fix how unsued lanes are handled in csi2rx_start()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 2eca8e4c1df4864b937752c3aa2f7925114f4806 upstream.
The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'.
--- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/cadence/cdns-csi2rx.c +1 -1
@@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_pr*/ for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) {unsigned int idx =find_first_zero_bit (&lanes_used, -sizeof (lanes_used)); + csi2rx->max_lanes);set_bit (idx, &lanes_used); reg |=CSI2RX_STATIC_CFG_DLANE_MAP (i, i +1 ); }
Greg Kroah-Hartman
maintainerPATCH 64/84 media: exynos4-is: Fix recursive locking in isp_video_release()
In reply to Greg Kroah-HartmanFrom: Seung-Woo Kim <[email protected]>
commit 704c6c80fb471d1bb0ef0d61a94617d1d55743cd upstream.
Quoted 1 line
From
isp_video_release(),&isp->video_lockis held and subsequent
vb2_fop_release() tries to lock vdev->lock which is same with the previous one. Replace vb2_fop_release() with _vb2_fop_release() to fix the recursive locking.
--- drivers/media/platform/exynos4-is/fimc-isp-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/exynos4-is/fimc-isp-video.c +1 -1
@@ -316,7 +316,7 @@ static int isp_video_release(struct file ivc->streaming =0 ; } -vb2_fop_release (file); +_vb2_fop_release (file,NULL );if (v4l2_fh_is_singular_file (file)) {fimc_pipeline_call (&ivc->ve, close);
Greg Kroah-Hartman
maintainerPATCH 65/84 iommu/mediatek: Correct the flush_iotlb_all callback
In reply to Greg Kroah-HartmanFrom: Yong Wu <[email protected]>
commit 2009122f1d83dd8375572661961eab1e7e86bffe upstream.
Use the correct tlb_flush_all instead of the original one.
--- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/mtk_iommu.c +1 -1
@@ -394,7 +394,7 @@ static size_t mtk_iommu_unmap(struct iomstatic void mtk_iommu_iotlb_sync (struct iommu_domain *domain) { -mtk_iommu_tlb_sync (mtk_iommu_get_m4u_data ()); +mtk_iommu_tlb_flush_all (mtk_iommu_get_m4u_data ()); } static phys_addr_t mtk_iommu_iova_to_phys(struct iommu_domain *domain,
Greg Kroah-Hartman
maintainerPATCH 66/84 mtd: spi-nor: fix silent truncation in spi_nor_read()
In reply to Greg Kroah-HartmanFrom: Sergei Shtylyov <[email protected]>
commit a719a75a7761e4139dd099330d9fe3589d844f9b upstream.
spi_nor_read() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type.
--- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/spi-nor.c +1 -1
@@ -1294,7 +1294,7 @@ static int spi_nor_read(struct mtd_info size_t *retlen, u_char *buf) { struct spi_nor *nor = mtd_to_spi_nor(mtd); -int ret; +ssize_t ret;dev_dbg (nor->dev,"from 0x%08x, len %zd\n" , (u32 )from, len);
Greg Kroah-Hartman
maintainerPATCH 67/84 mtd: spi-nor: fix silent truncation in spi_nor_read_raw()
In reply to Greg Kroah-HartmanFrom: Sergei Shtylyov <[email protected]>
commit 3d63ee5deb466fd66ed6ffb164a87ce36425cf36 upstream.
spi_nor_read_raw() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type.
--- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/spi-nor.c +1 -1
@@ -1523,7 +1523,7 @@ static int macronix_quad_enable(struct s*/ static int write_sr_cr (struct spi_nor *nor,u8 *sr_cr) { -int ret; +ssize_t ret;write_enable (nor);
Greg Kroah-Hartman
maintainerPATCH 68/84 spi: atmel: fix handling of cs_change set on non-last xfer
In reply to Greg Kroah-HartmanFrom: Mans Rullgard <[email protected]>
commit fed8d8c7a6dc2a76d7764842853d81c770b0788e upstream.
The driver does the wrong thing when cs_change is set on a non-last xfer in a message. When cs_change is set, the driver deactivates the CS and leaves it off until a later xfer again has cs_change set whereas it should be briefly toggling CS off and on again.
This patch brings the behaviour of the driver back in line with the documentation and common sense. The delay of 10 us is the same as is used by the default spi_transfer_one_message() function in spi.c.
--- drivers/spi/spi-atmel.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/spi/spi-atmel.c +3 -7
@@ -305,7 +305,6 @@ struct atmel_spi {bool use_cs_gpios;bool keep_cs; -bool cs_active;u32 fifo_size; };
@@ -1381,11 +1380,9 @@ static int atmel_spi_one_transfer(struct &msg->transfers)) { as->keep_cs = true; }else { - as->cs_active = !as->cs_active; -if (as->cs_active) -cs_activate (as, msg->spi); -else -cs_deactivate (as, msg->spi); +cs_deactivate (as, msg->spi); +udelay (10 ); +cs_activate (as, msg->spi); } }
@@ -1408,7 +1405,6 @@ static int atmel_spi_transfer_one_messagatmel_spi_lock (as);cs_activate (as, spi); - as->cs_active = true; as->keep_cs = false; msg->status =0 ;
Greg Kroah-Hartman
maintainerPATCH 69/84 rtlwifi: Remove unnecessary NULL check in rtl_regd_init
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 091c6e9c083f7ebaff00b37ad13562d51464d175 upstream.
When building with Clang + -Wtautological-pointer-compare:
drivers/net/wireless/realtek/rtlwifi/regd.c:389:33: warning: comparison of address of 'rtlpriv->regd' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (wiphy == NULL || &rtlpriv->regd == NULL)
~~~~~~~~~^~~~ ~~~~1 warning generated.
The address of an array member is never NULL unless it is the first struct member so remove the unnecessary check. This was addressed in the staging version of the driver in commit f986978b32b3 ("Staging:
rtlwifi: remove unnecessary NULL check").
While we are here, fix the following checkpatch warning:
CHECK: Comparison to NULL could be written "!wiphy" 35: FILE: drivers/net/wireless/realtek/rtlwifi/regd.c:389:
+ if (wiphy == NULL)
--- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/regd.c +1 -1
@@ -427,7 +427,7 @@ int rtl_regd_init(struct ieee80211_hw *hstruct wiphy *wiphy = hw->wiphy;struct country_code_to_enum_rd *country =NULL ; -if (wiphy ==NULL || &rtlpriv->regd ==NULL ) +if (!wiphy)return -EINVAL ;/* init country_code from efuse channel plan */
Greg Kroah-Hartman
maintainerPATCH 70/84 f2fs: fix potential overflow
In reply to Greg Kroah-HartmanFrom: Chao Yu <[email protected]>
commit 1f0d5c911b64165c9754139a26c8c2fad352c132 upstream.
We expect 64-bit calculation result from below statement, however in 32-bit machine, looped left shift operation on pgoff_t type variable may cause overflow issue, fix it by forcing type cast.
page->index << PAGE_SHIFT;
--- fs/f2fs/data.c | 2 +- fs/f2fs/file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/data.c +1 -1
@@ -1857,7 +1857,7 @@ static int __write_data_page(struct pageloff_t i_size =i_size_read (inode);const pgoff_t end_index = ((unsigned long long ) i_size) >>PAGE_SHIFT ; -loff_t psize = (page->index +1 ) <<PAGE_SHIFT ; +loff_t psize = (loff_t)(page->index +1 ) <<PAGE_SHIFT ;unsigned offset =0 ;bool need_balance_fs = false;int err =0 ;
fs/f2fs/file.c +1 -1
@@ -1101,7 +1101,7 @@ static int __clone_blkaddrs(struct inode } dn.ofs_in_node++; i++; - new_size = (dst + i) <<PAGE_SHIFT ; + new_size = (loff_t)(dst + i) <<PAGE_SHIFT ;if (dst_inode->i_size < new_size)f2fs_i_size_write (dst_inode, new_size); }while (--ilen && (do_replace[i] || blkaddr[i] ==NULL_ADDR ));
Greg Kroah-Hartman
maintainerPATCH 71/84 rtc: msm6242: Fix reading of 10-hour digit
In reply to Greg Kroah-HartmanFrom: Kars de Jong <[email protected]>
commit e34494c8df0cd96fc432efae121db3212c46ae48 upstream.
The driver was reading the wrong register as the 10-hour digit due to a misplaced ')'. It was in fact reading the 1-second digit register due to this bug.
Also remove the use of a magic number for the hour mask and use the define for it which was already present.
--- drivers/rtc/rtc-msm6242.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-msm6242.c +2 -1
@@ -132,7 +132,8 @@ static int msm6242_read_time(struct devimsm6242_read (priv,MSM6242_SECOND1 ); tm->tm_min =msm6242_read (priv,MSM6242_MINUTE10 ) *10 +msm6242_read (priv,MSM6242_MINUTE1 ); - tm->tm_hour = (msm6242_read (priv,MSM6242_HOUR10 &3 )) *10 + + tm->tm_hour = (msm6242_read (priv,MSM6242_HOUR10 ) & +MSM6242_HOUR10_HR_MASK ) *10 +msm6242_read (priv,MSM6242_HOUR1 ); tm->tm_mday =msm6242_read (priv,MSM6242_DAY10 ) *10 +msm6242_read (priv,MSM6242_DAY1 );
Greg Kroah-Hartman
maintainerPATCH 72/84 rtc: brcmstb-waketimer: add missed clk_disable_unprepare
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
commit 94303f8930ed78aea0f189b703c9d79fff9555d7 upstream.
This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare to fix it.
--- drivers/rtc/rtc-brcmstb-waketimer.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-brcmstb-waketimer.c +1 -0
@@ -287,6 +287,7 @@ static int brcmstb_waketmr_remove(structstruct brcmstb_waketmr *timer =dev_get_drvdata (&pdev->dev);unregister_reboot_notifier (&timer->reboot_notifier); +clk_disable_unprepare (timer->clk);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 73/84 gpio: mpc8xxx: Add platform device to gpiochip->parent
In reply to Greg Kroah-HartmanFrom: Johnson CH Chen (陳昭勳) <[email protected]>
[ Upstream commit 322f6a3182d42df18059a89c53b09d33919f755e ]
Dear Linus Walleij,
In old kernels, some APIs still try to use parent->of_node from struct gpio_chip, and it could be resulted in kernel panic because parent is NULL. Adding platform device to gpiochip->parent can fix this problem.
--- drivers/gpio/gpio-mpc8xxx.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-mpc8xxx.c +1 -0
@@ -317,6 +317,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)return -ENOMEM ; gc = &mpc8xxx_gc->gc; + gc->parent = &pdev->dev;if (of_property_read_bool (np,"little-endian" )) { ret = bgpio_init(gc, &pdev->dev, 4,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 74/84 scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
In reply to Greg Kroah-HartmanFrom: Varun Prakash <[email protected]>
[ Upstream commit 71482fde704efdd8c3abe0faf34d922c61e8d76b ]
If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check for NULL pointer before dereferencing it.
--- drivers/scsi/cxgbi/libcxgbi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/cxgbi/libcxgbi.c +2 -1
@@ -121,7 +121,8 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev) "cdev 0x%p, p# %u.\n", cdev, cdev->nports);cxgbi_hbas_remove (cdev);cxgbi_device_portmap_cleanup (cdev); -cxgbi_ppm_release (cdev->cdev2ppm (cdev)); +if (cdev->cdev2ppm) +cxgbi_ppm_release (cdev->cdev2ppm (cdev));if (cdev->pmap.max_connect)cxgbi_free_big_mem (cdev->pmap.port_csk);kfree (cdev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 75/84 selftests: firmware: Fix it to do root uid check and skip
In reply to Greg Kroah-HartmanFrom: Shuah Khan <[email protected]>
[ Upstream commit c65e41538b04e0d64a673828745a00cb68a24371 ]
firmware attempts to load test modules that require root access and fail. Fix it to check for root uid and exit with skip code instead.
Before this fix:
selftests: firmware: fw_run_tests.sh
modprobe: ERROR: could not insert 'test_firmware': Operation not permitted You must have the following enabled in your kernel:CONFIG_TEST_FIRMWARE=yCONFIG_FW_LOADER=yCONFIG_FW_LOADER_USER_HELPER=yCONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=y
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP
With this fix:
selftests: firmware: fw_run_tests.sh
skip all tests: must be run as root
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP
--- tools/testing/selftests/firmware/fw_lib.sh | 6 ++++++ 1 file changed, 6 insertions(+)
tools/testing/selftests/firmware/fw_lib.sh +6 -0
@@ -28,6 +28,12 @@ test_modprobe() check_mods() { + local uid=$(id -u) + if [ $uid -ne 0 ]; then + echo "skip all tests: must be run as root" >&2 + exit $ksft_skip + fi + trap "test_modprobe" EXIT if [ ! -d $DIR ]; then modprobe test_firmware
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 76/84 rseq/selftests: Turn off timeout setting
In reply to Greg Kroah-HartmanFrom: Mathieu Desnoyers <[email protected]>
[ Upstream commit af9cb29c5488381083b0b5ccdfb3cd931063384a ]
As the rseq selftests can run for a long period of time, disable the timeout that the general selftests have.
--- tools/testing/selftests/rseq/settings | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/testing/selftests/rseq/settings
tools/testing/selftests/rseq/settings new file +1 -0
@@ -0,0 +1 @@ +timeout=0
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 77/84 mips: cacheinfo: report shared CPU map
In reply to Greg Kroah-HartmanFrom: Vladimir Kondratiev <[email protected]>
[ Upstream commit 3b1313eb32c499d46dc4c3e896d19d9564c879c4 ]
Report L1 caches as shared per core; L2 - per cluster.
This fixes "perf" that went crazy if shared_cpu_map attribute not reported on sysfs, in form of
/sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_list /sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_map
--- arch/mips/kernel/cacheinfo.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
arch/mips/kernel/cacheinfo.c +26 -1
@@ -61,6 +61,25 @@ static int __init_cache_level(unsigned int cpu)return 0 ; } +static void fill_cpumask_siblings (int cpu,cpumask_t *cpu_map) +{ +int cpu1; + +for_each_possible_cpu (cpu1) +if (cpus_are_siblings (cpu, cpu1)) +cpumask_set_cpu (cpu1, cpu_map); +} + +static void fill_cpumask_cluster (int cpu,cpumask_t *cpu_map) +{ +int cpu1; +int cluster =cpu_cluster (&cpu_data[cpu]); + +for_each_possible_cpu (cpu1) +if (cpu_cluster (&cpu_data[cpu1]) == cluster) +cpumask_set_cpu (cpu1, cpu_map); +} +static int __populate_cache_leaves (unsigned int cpu) {struct cpuinfo_mips *c = ¤t_cpu_data;
@@ -68,14 +87,20 @@ static int __populate_cache_leaves(unsigned int cpu)struct cacheinfo *this_leaf = this_cpu_ci->info_list;if (c->icache.waysize) { +/* L1 caches are per core */ +fill_cpumask_siblings (cpu, &this_leaf->shared_cpu_map);populate_cache (dcache, this_leaf,1 ,CACHE_TYPE_DATA ); +fill_cpumask_siblings (cpu, &this_leaf->shared_cpu_map);populate_cache (icache, this_leaf,1 ,CACHE_TYPE_INST ); }else {populate_cache (dcache, this_leaf,1 ,CACHE_TYPE_UNIFIED ); } -if (c->scache.waysize) +if (c->scache.waysize) { +/* L2 cache is per cluster */ +fill_cpumask_cluster (cpu, &this_leaf->shared_cpu_map);populate_cache (scache, this_leaf,2 ,CACHE_TYPE_UNIFIED ); + }if (c->tcache.waysize)populate_cache (tcache, this_leaf,3 ,CACHE_TYPE_UNIFIED );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 78/84 MIPS: Prevent link failure with kcov instrumentation
In reply to Greg Kroah-HartmanFrom: Jouni Hogander <[email protected]>
[ Upstream commit a4a3893114a41e365274d5fab5d9ff5acc235ff0 ]
__sanitizer_cov_trace_pc() is not linked in and causing link failure if KCOV_INSTRUMENT is enabled. Fix this by disabling instrumentation for compressed image.
--- arch/mips/boot/compressed/Makefile | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/boot/compressed/Makefile +3 -0
@@ -29,6 +29,9 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS) +# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. +KCOV_INSTRUMENT := n + # decompressor objects (linked with vmlinuz) vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 79/84 drm/arm/mali: make malidp_mw_connector_helper_funcs static
In reply to Greg Kroah-HartmanFrom: Ben Dooks (Codethink) <[email protected]>
[ Upstream commit ac2917b01992c098b8d4e6837115e3ca347fdd90 ]
The malidp_mw_connector_helper_funcs is not referenced by name outside of the file it is in, so make it static to avoid the following warning:
drivers/gpu/drm/arm/malidp_mw.c:59:41: warning: symbol 'malidp_mw_connector_helper_funcs' was not declared. Should it be static?
--- drivers/gpu/drm/arm/malidp_mw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_mw.c +1 -1
@@ -55,7 +55,7 @@ malidp_mw_connector_mode_valid(struct drm_connector *connector,return MODE_OK ; } -const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs = { +static const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs = { .get_modes = malidp_mw_connector_get_modes, .mode_valid = malidp_mw_connector_mode_valid, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 80/84 dmaengine: k3dma: Avoid null pointer traversal
In reply to Greg Kroah-HartmanFrom: John Stultz <[email protected]>
[ Upstream commit 2f42e05b942fe2fbfb9bbc6e34e1dd8c3ce4f3a4 ]
In some cases we seem to submit two transactions in a row, which causes us to lose track of the first. If we then cancel the request, we may still get an interrupt, which traverses a null ds_run value.
So try to avoid starting a new transaction if the ds_run value is set.
While this patch avoids the null pointer crash, I've had some reports of the k3dma driver still getting confused, which suggests the ds_run/ds_done value handling still isn't quite right. However, I've not run into an issue recently with it so I think this patch is worth pushing upstream to avoid the crash.
--- drivers/dma/k3dma.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/dma/k3dma.c +9 -3
@@ -222,9 +222,11 @@ static irqreturn_t k3_dma_int_handler(int irq, void *dev_id) c = p->vchan;if (c && (tc1 &BIT (i))) {spin_lock_irqsave (&c->vc.lock, flags); -vchan_cookie_complete (&p->ds_run->vd); - p->ds_done = p->ds_run; - p->ds_run =NULL ; +if (p->ds_run !=NULL ) { +vchan_cookie_complete (&p->ds_run->vd); + p->ds_done = p->ds_run; + p->ds_run =NULL ; + }spin_unlock_irqrestore (&c->vc.lock, flags); }if (c && (tc2 &BIT (i))) {
@@ -264,6 +266,10 @@ static int k3_dma_start_txd(struct k3_dma_chan *c)if (BIT (c->phy->idx) &k3_dma_get_chan_stat (d))return -EAGAIN ; +/* Avoid losing track of ds_run if a transaction is in flight */ +if (c->phy->ds_run) +return -EAGAIN ; +if (vd) {struct k3_dma_desc_sw *ds = container_of(vd, struct k3_dma_desc_sw, vd);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 81/84 ioat: ioat_alloc_ring() failure handling.
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
[ Upstream commit b0b5ce1010ffc50015eaec72b0028aaae3f526bb ]
If dma_alloc_coherent() returns NULL in ioat_alloc_ring(), ring allocation must not proceed.
Until now, if the first call to dma_alloc_coherent() in ioat_alloc_ring() returned NULL, the processing could proceed, failing with NULL-pointer dereferencing further down the line.
--- drivers/dma/ioat/dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/ioat/dma.c +2 -1
@@ -388,10 +388,11 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) descs->virt =dma_alloc_coherent (to_dev (ioat_chan),SZ_2M , &descs->hw, flags); -if (!descs->virt && (i >0 )) { +if (!descs->virt) {int idx;for (idx =0 ; idx < i; idx++) { + descs = &ioat_chan->descs[idx];dma_free_coherent (to_dev (ioat_chan),SZ_2M , descs->virt, descs->hw); descs->virt =NULL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 82/84 hexagon: parenthesize registers in asm predicates
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
[ Upstream commit 780a0cfda9006a9a22d6473c2d4c527f5c68eb2e ]
Hexagon requires that register predicates in assembly be parenthesized.
--- arch/hexagon/include/asm/atomic.h | 8 ++++---- arch/hexagon/include/asm/bitops.h | 8 ++++---- arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/include/asm/futex.h | 6 +++--- arch/hexagon/include/asm/spinlock.h | 20 ++++++++++---------- arch/hexagon/kernel/vm_entry.S | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-)
arch/hexagon/include/asm/atomic.h +4 -4
@@ -105,7 +105,7 @@ static inline void atomic_##op(int i, atomic_t *v) \"1: %0 = memw_locked(%1);\n" \ " %0 = "#op "(%0,%2);\n" \ " memw_locked(%1,P3)=%0;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -121,7 +121,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \"1: %0 = memw_locked(%1);\n" \ " %0 = "#op "(%0,%2);\n" \ " memw_locked(%1,P3)=%0;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -138,7 +138,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \"1: %0 = memw_locked(%2);\n" \ " %1 = "#op "(%0,%3);\n" \ " memw_locked(%2,P3)=%1;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output), "=&r" (val) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -187,7 +187,7 @@ static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)" }" " memw_locked(%2, p3) = %1;" " {" -" if !p3 jump 1b;" +" if (!p3) jump 1b;" " }" "2:" : "=&r" (__oldval), "=&r" (tmp)
arch/hexagon/include/asm/bitops.h +4 -4
@@ -52,7 +52,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = clrbit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -76,7 +76,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = setbit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -102,7 +102,7 @@ static inline int test_and_change_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = togglebit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -237,7 +237,7 @@ static inline int ffs(int x)int r; asm("{ P0 = cmp.eq(%1,#0); %0 = ct0(%1);}\n" -"{ if P0 %0 = #0; if !P0 %0 = add(%0,#1);}\n" +"{ if (P0) %0 = #0; if (!P0) %0 = add(%0,#1);}\n" :"=&r" (r) :"r" (x) :"p0" );
arch/hexagon/include/asm/cmpxchg.h +1 -1
@@ -44,7 +44,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, __asm__ __volatile__ ("1: %0 = memw_locked(%1);\n" /* load into retval */ " memw_locked(%1,P0) = %2;\n" /* store into memory */ -" if !P0 jump 1b;\n" +" if (!P0) jump 1b;\n" :"=&r" (retval) :"r" (ptr),"r" (x) : "memory", "p0"
arch/hexagon/include/asm/futex.h +3 -3
@@ -16,7 +16,7 @@/* For example: %1 = %4 */ \ insn \"2: memw_locked(%3,p2) = %1;\n" \ -" if !p2 jump 1b;\n" \ +" if (!p2) jump 1b;\n" \" %1 = #0;\n" \"3:\n" \".section .fixup,\"ax\"\n" \
@@ -84,10 +84,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval,"1: %1 = memw_locked(%3)\n" " {\n" " p2 = cmp.eq(%1,%4)\n" -" if !p2.new jump:NT 3f\n" +" if (!p2.new) jump:NT 3f\n" " }\n" "2: memw_locked(%3,p2) = %5\n" -" if !p2 jump 1b\n" +" if (!p2) jump 1b\n" "3:\n" ".section .fixup,\"ax\"\n" "4: %0 = #%6\n"
arch/hexagon/include/asm/spinlock.h +10 -10
@@ -44,9 +44,9 @@ static inline void arch_read_lock(arch_rwlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0);\n" " { P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -60,7 +60,7 @@ static inline void arch_read_unlock(arch_rwlock_t *lock) "1: R6 = memw_locked(%0);\n" " R6 = add(R6,#-1);\n" " memw_locked(%0,P3) = R6\n" - " if !P3 jump 1b;\n" + " if (!P3) jump 1b;\n" : : "r" (&lock->lock) : "memory", "r6", "p3"
@@ -75,7 +75,7 @@ static inline int arch_read_trylock(arch_rwlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1);\n" " { %0 = #0; P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" -" { if !P3 jump 1f; }\n" +" { if (!P3) jump 1f; }\n" " memw_locked(%1,P3) = R6;\n" " { %0 = P3 }\n" "1:\n"
@@ -92,9 +92,9 @@ static inline void arch_write_lock(arch_rwlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0)\n" " { P3 = cmp.eq(R6,#0); R6 = #-1;}\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -108,7 +108,7 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1)\n" " { %0 = #0; P3 = cmp.eq(R6,#0); R6 = #-1;}\n" -" { if !P3 jump 1f; }\n" +" { if (!P3) jump 1f; }\n" " memw_locked(%1,P3) = R6;\n" " %0 = P3;\n" "1:\n"
@@ -131,9 +131,9 @@ static inline void arch_spin_lock(arch_spinlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0);\n" " P3 = cmp.eq(R6,#0);\n" -" { if !P3 jump 1b; R6 = #1; }\n" +" { if (!P3) jump 1b; R6 = #1; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -153,7 +153,7 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1);\n" " P3 = cmp.eq(R6,#0);\n" -" { if !P3 jump 1f; R6 = #1; %0 = #0; }\n" +" { if (!P3) jump 1f; R6 = #1; %0 = #0; }\n" " memw_locked(%1,P3) = R6;\n" " %0 = P3;\n" "1:\n"
arch/hexagon/kernel/vm_entry.S +1 -1
@@ -382,7 +382,7 @@ ret_from_fork: R26.L = #LO(do_work_pending); R0 = #VM_INT_DISABLE; } - if P0 jump check_work_pending + if (P0) jump check_work_pending { R0 = R25; callr R24
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 83/84 hexagon: work around compiler crash
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
[ Upstream commit 63e80314ab7cf4783526d2e44ee57a90514911c9 ]
Clang cannot translate the string "r30" into a valid register yet.
--- arch/hexagon/kernel/stacktrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/hexagon/kernel/stacktrace.c +1 -3
@@ -24,8 +24,6 @@#include <linux/thread_info.h> #include <linux/module.h> -registerunsigned long current_frame_pointer asm("r30" ); -struct stackframe {unsigned long fp;unsigned long rets;
@@ -43,7 +41,7 @@ void save_stack_trace(struct stack_trace *trace) low = (unsigned long )task_stack_page (current); high = low +THREAD_SIZE ; - fp = current_frame_pointer; + fp = (unsigned long )__builtin_frame_address (0 );while (fp >= low && fp <= (high -sizeof (*frame))) { frame = (struct stackframe *)fp;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 84/84 ocfs2: call journal flush to mark journal as empty after journal recovery when mount
In reply to Greg Kroah-HartmanFrom: Kai Li <[email protected]>
[ Upstream commit 397eac17f86f404f5ba31d8c3e39ec3124b39fd3 ]
If journal is dirty when mount, it will be replayed but jbd2 sb log tail cannot be updated to mark a new start because journal->j_flag has already been set with JBD2_ABORT first in journal_init_common.
When a new transaction is committed, it will be recored in block 1 first(journal->j_tail is set to 1 in journal_reset). If emergency restart happens again before journal super block is updated unfortunately, the new recorded trans will not be replayed in the next mount.
The following steps describe this procedure in detail.
1. mount and touch some files
2. these transactions are committed to journal area but not checkpointed
3. emergency restart
4. mount again and its journals are replayed
5. journal super block's first s_start is 1, but its s_seq is not updated
6. touch a new file and its trans is committed but not checkpointed
7. emergency restart again
8. mount and journal is dirty, but trans committed in 6 will not be replayed.
This exception happens easily when this lun is used by only one node. If it is used by multi-nodes, other node will replay its journal and its journal super block will be updated after recovery like what this patch does.
ocfs2_recover_node->ocfs2_replay_journal.
The following jbd2 journal can be generated by touching a new file after journal is replayed, and seq 15 is the first valid commit, but first seq is 13 in journal super block.
logdump:
Block 0: Journal Superblock
Seq: 0 Type: 4 (JBD2_SUPERBLOCK_V2)
Blocksize: 4096 Total Blocks: 32768 First Block: 1
First Commit ID: 13 Start Log Blknum: 1
Error: 0
Feature Compat: 0
Feature Incompat: 2 block64
Feature RO compat: 0
Journal UUID: 4ED3822C54294467A4F8E87D2BA4BC36
FS Share Cnt: 1 Dynamic Superblk Blknum: 0
Per Txn Block Limit Journal: 0 Data: 0
Block 1: Journal Commit Block
Seq: 14 Type: 2 (JBD2_COMMIT_BLOCK)
Block 2: Journal Descriptor
Seq: 15 Type: 1 (JBD2_DESCRIPTOR_BLOCK)
No. Blocknum Flags
0. 587 none
UUID: 00000000000000000000000000000000
1. 8257792 JBD2_FLAG_SAME_UUID 2. 619 JBD2_FLAG_SAME_UUID 3. 24772864 JBD2_FLAG_SAME_UUID 4. 8257802 JBD2_FLAG_SAME_UUID 5. 513 JBD2_FLAG_SAME_UUID JBD2_FLAG_LAST_TAG ... Block 7: Inode Inode: 8257802 Mode: 0640 Generation: 57157641 (0x3682809) FS Generation: 2839773110 (0xa9437fb6) CRC32: 00000000 ECC: 0000 Type: Regular Attr: 0x0 Flags: Valid Dynamic Features: (0x1) InlineData User: 0 (root) Group: 0 (root) Size: 7 Links: 1 Clusters: 0 ctime: 0x5de5d870 0x11104c61 -- Tue Dec 3 11:37:20.286280801 2019 atime: 0x5de5d870 0x113181a1 -- Tue Dec 3 11:37:20.288457121 2019 mtime: 0x5de5d870 0x11104c61 -- Tue Dec 3 11:37:20.286280801 2019
dtime: 0x0 -- Thu Jan 1 08:00:00 1970
...
Block 9: Journal Commit Block
Seq: 15 Type: 2 (JBD2_COMMIT_BLOCK)
The following is journal recovery log when recovering the upper jbd2 journal when mount again.
syslog:
ocfs2: File system on device (252,1) was not unmounted cleanly, recovering it. fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 0 fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 1 fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 2 fs/jbd2/recovery.c:(jbd2_journal_recover, 278): JBD2: recovery, exit status 0, recovered transactions 13 to 13
Due to first commit seq 13 recorded in journal super is not consistent with the value recorded in block 1(seq is 14), journal recovery will be terminated before seq 15 even though it is an unbroken commit, inode 8257802 is a new file and it will be lost.
--- fs/ocfs2/journal.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ocfs2/journal.c +8 -0
@@ -1080,6 +1080,14 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)ocfs2_clear_journal_error (osb->sb, journal->j_journal, osb->slot_num); +if (replayed) { +jbd2_journal_lock_updates (journal->j_journal); + status =jbd2_journal_flush (journal->j_journal); +jbd2_journal_unlock_updates (journal->j_journal); +if (status <0 ) +mlog_errno (status); + } + status =ocfs2_journal_toggle_dirty (osb,1 , replayed);if (status <0 ) {mlog_errno (status);
Signature · 1 line
2.20.1
Jon Hunter
maintainerQuoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.97 release. There are 84 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, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.97-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
All tests are passing for Tegra ...
Test results for stable-v4.19:
13 builds: 13 pass, 0 fail
22 boots: 22 pass, 0 fail
32 tests: 32 pass, 0 failLinux version: 4.19.97-rc1-ge301315724e2
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Cheers
Jon
Signature · 1 line
nvpublic
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.97 release. There are 84 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, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.97-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 4.19.97-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.19.y
git commit: e301315724e25ac136c78f10a08928c03bdf7466
git describe: v4.19.96-85-ge301315724e2
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.19-oe/build/v4.19.96-85-ge301315724e2
No regressions (compared to build v4.19.96)
No fixes (compared to build v4.19.96)
Ran 24423 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* perf
* spectre-meltdown-checker-test
* v4l2-compliance
* ltp-fs-tests
* network-basic-tests
* ltp-open-posix-tests
* kvm-unit-tests
* ssuite
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.97 release. There are 84 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, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
Build results:
total: 156 pass: 156 fail: 0 Qemu test results: total: 383 pass: 383 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.97 release. There are 84 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, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.97-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah