Linux 4.19.154
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.154 kernel.
All users of the 4.19 kernel series must upgrade.
Many thanks to Pavel Machek for pointing out that the last 4.19.y release was "short" a bunch of patches, which results in this "the rest of the series" release.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/boot/dts/imx6sl.dtsi | 2 arch/arm/boot/dts/owl-s500.dtsi | 6 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 10 - arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 arch/arm64/boot/dts/qcom/pm8916.dtsi | 2 arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 arch/powerpc/include/asm/tlb.h | 13 - arch/powerpc/kernel/tau_6xx.c | 96 +++------- arch/powerpc/mm/tlb-radix.c | 23 +- arch/powerpc/perf/hv-gpci-requests.h | 6 arch/powerpc/perf/isa207-common.c | 10 + arch/powerpc/platforms/Kconfig | 14 - arch/powerpc/platforms/powernv/opal-dump.c | 41 +++- arch/x86/kvm/emulate.c | 2 block/blk-core.c | 9 drivers/clk/at91/clk-main.c | 11 - drivers/clk/bcm/clk-bcm2835.c | 4 drivers/clk/rockchip/clk-half-divider.c | 2 drivers/cpufreq/powernv-cpufreq.c | 9 drivers/crypto/ccp/ccp-ops.c | 2 drivers/gpu/drm/virtio/virtgpu_kms.c | 2 drivers/gpu/drm/virtio/virtgpu_vq.c | 10 - drivers/i2c/busses/Kconfig | 1 drivers/i2c/i2c-core-acpi.c | 11 + drivers/infiniband/core/cma.c | 84 +++----- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 drivers/infiniband/sw/rdmavt/vt.c | 4 drivers/input/keyboard/ep93xx_keypad.c | 4 drivers/input/keyboard/omap4-keypad.c | 6 drivers/input/keyboard/twl4030_keypad.c | 8 drivers/input/serio/sun4i-ps2.c | 9 drivers/input/touchscreen/imx6ul_tsc.c | 27 +- drivers/input/touchscreen/stmfts.c | 2 drivers/mailbox/mailbox.c | 12 - drivers/media/firewire/firedtv-fw.c | 6 drivers/media/pci/bt8xx/bttv-driver.c | 13 + drivers/media/pci/saa7134/saa7134-tvaudio.c | 3 drivers/media/platform/exynos4-is/fimc-isp.c | 4 drivers/media/platform/exynos4-is/fimc-lite.c | 2 drivers/media/platform/exynos4-is/media-dev.c | 4 drivers/media/platform/exynos4-is/mipi-csis.c | 4 drivers/media/platform/qcom/venus/core.c | 5 drivers/media/platform/s3c-camif/camif-core.c | 5 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 drivers/media/platform/sti/delta/delta-v4l2.c | 4 drivers/media/platform/sti/hva/hva-hw.c | 4 drivers/media/platform/vsp1/vsp1_drv.c | 11 - drivers/media/rc/ati_remote.c | 4 drivers/media/usb/uvc/uvc_v4l2.c | 30 +++ drivers/memory/fsl-corenet-cf.c | 6 drivers/memory/omap-gpmc.c | 8 drivers/misc/cardreader/rtsx_pcr.c | 4 drivers/misc/eeprom/at25.c | 2 drivers/misc/mic/vop/vop_main.c | 2 drivers/misc/mic/vop/vop_vringh.c | 24 +- drivers/mmc/core/sdio_cis.c | 3 drivers/net/can/flexcan.c | 34 ++- drivers/net/ethernet/korina.c | 4 drivers/net/wireless/ath/ath10k/htt_rx.c | 8 drivers/net/wireless/ath/ath9k/hif_usb.c | 19 + drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 4 drivers/net/wireless/marvell/mwifiex/usb.c | 3 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 - drivers/ntb/hw/amd/ntb_hw_amd.c | 1 drivers/nvme/target/core.c | 3 drivers/pci/controller/pcie-iproc-msi.c | 13 - drivers/pwm/pwm-img.c | 3 drivers/rapidio/devices/rio_mport_cdev.c | 18 + drivers/rpmsg/qcom_smd.c | 32 ++- drivers/scsi/ibmvscsi/ibmvfc.c | 1 drivers/scsi/mvumi.c | 1 drivers/scsi/qedi/qedi_fw.c | 23 +- drivers/scsi/qedi/qedi_iscsi.c | 2 drivers/scsi/ufs/ufs-qcom.c | 5 drivers/tty/ipwireless/network.c | 4 drivers/tty/ipwireless/tty.c | 2 drivers/tty/serial/fsl_lpuart.c | 2 drivers/usb/class/cdc-acm.c | 23 ++ drivers/usb/class/cdc-wdm.c | 72 +++++-- drivers/usb/core/urb.c | 89 +++++---- drivers/usb/dwc3/dwc3-of-simple.c | 1 drivers/usb/gadget/function/f_ncm.c | 2 drivers/usb/gadget/function/f_printer.c | 16 + drivers/usb/host/ohci-hcd.c | 16 + drivers/vfio/pci/vfio_pci_intrs.c | 4 drivers/vfio/vfio_iommu_type1.c | 3 drivers/watchdog/sp5100_tco.h | 2 drivers/watchdog/watchdog_dev.c | 6 fs/dlm/config.c | 3 fs/ext4/fsmap.c | 3 fs/f2fs/sysfs.c | 1 fs/ntfs/inode.c | 6 fs/ramfs/file-nommu.c | 2 fs/reiserfs/inode.c | 3 fs/reiserfs/super.c | 8 fs/udf/inode.c | 25 +- fs/udf/super.c | 6 fs/xfs/xfs_rtalloc.c | 11 + include/linux/overflow.h | 1 include/scsi/scsi_common.h | 7 include/trace/events/target.h | 12 - include/uapi/linux/perf_event.h | 2 kernel/debug/kdb/kdb_io.c | 8 kernel/power/hibernate.c | 11 - kernel/sched/core.c | 2 kernel/sched/sched.h | 13 + lib/crc32.c | 2 net/bluetooth/l2cap_sock.c | 7 net/ipv4/ip_gre.c | 15 + net/mac80211/cfg.c | 3 net/mac80211/sta_info.c | 4 net/netfilter/ipvs/ip_vs_ctl.c | 7 net/netfilter/nf_conntrack_proto_tcp.c | 19 + net/netfilter/nf_dup_netdev.c | 1 net/netfilter/nft_fwd_netdev.c | 1 net/sunrpc/auth_gss/svcauth_gss.c | 27 +- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 3 samples/mic/mpssd/mpssd.c | 4 tools/perf/util/intel-pt.c | 8 122 files changed, 808 insertions(+), 450 deletions(-)
Abhishek Pandit-Subedi (1):
Bluetooth: Only mark socket zapped after unlocking
Adam Goode (1):
media: uvcvideo: Ensure all probed info is returned to v4l2
Aditya Pakki (1):
media: st-delta: Fix reference count leak in delta_run_work
Adrian Hunter (1):
perf intel-pt: Fix "context_switch event has no tid" error
Al Grant (1):
perf: correct SNOOPX field offset
Alex Williamson (1):
vfio/pci: Clear token on bypass registration failure
Alexander Aring (1):
fs: dlm: fix configfs memory leak
Athira Rajeev (1):
powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
Brooke Basile (1):
ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()
Can Guo (1):
scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()
Chris Chiu (1):
rtl8xxxu: prevent potential memory leak
Christian Eggers (1):
eeprom: at25: set minimum read/write access stride to 1
Christoph Hellwig (1):
PM: hibernate: remove the bogus call to get_gendisk() in software_resume()
Claudiu Beznea (1):
clk: at91: clk-main: update key before writing AT91_CKGR_MOR
Colin Ian King (1):
IB/rdmavt: Fix sizeof mismatch
Cong Wang (1):
ip_gre: set dev->hard_header_len and dev->needed_headroom properly
Cristian Ciocaltea (1):
ARM: dts: owl-s500: Fix incorrect PPI interrupt specifiers
Dan Aloni (1):
svcrdma: fix bounce buffers for unaligned offsets and multiple pages
Dan Carpenter (3):
rpmsg: smd: Fix a kobj leak in in qcom_smd_parse_edge()
Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()
memory: omap-gpmc: Fix a couple off by ones
Daniel Thompson (1):
kdb: Fix pager search for multi-line strings
Darrick J. Wong (2):
ext4: limit entries returned when counting fsmap records
xfs: make sure the rt allocator doesn't run off the end
Dinghao Liu (7):
watchdog: Fix memleak in watchdog_cdev_register
watchdog: Use put_device on error
media: vsp1: Fix runtime PM imbalance on error
media: platform: s3c-camif: Fix runtime PM imbalance on error
media: platform: sti: hva: Fix runtime PM imbalance on error
media: bdisp: Fix runtime PM imbalance on error
media: venus: core: Fix runtime PM imbalance in venus_probe
Dirk Behme (1):
i2c: rcar: Auto select RESET_CONTROLLER
Doug Horn (1):
Fix use after free in get_capset_info callback.
Eli Billauer (1):
usb: core: Solve race condition in anchor cleanup functions
Eric Biggers (1):
reiserfs: only call unlock_new_inode() if I_NEW
Finn Thain (2):
powerpc/tau: Check processor type before enabling TAU interrupt powerpc/tau: Disable TAU between measurements
Francesco Ruggeri (1):
netfilter: conntrack: connection timeout after re-register
Greg Kroah-Hartman (1):
Linux 4.19.154
Guenter Roeck (1):
watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3
Hamish Martin (1):
usb: ohci: Default to per-port over-current protection
Hans de Goede (1):
i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs
Hauke Mehrtens (1):
pwm: img: Fix null pointer access in probe
Horia Geantă (1):
ARM: dts: imx6sl: fix rng node
Jamie Iles (1):
f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info
Jan Kara (3):
udf: Limit sparing table size
udf: Avoid accessing uninitialized data on failed inode read
reiserfs: Fix memory leak in reiserfs_parse_options()
Jason Gunthorpe (2):
RDMA/cma: Remove dead code for kernel rdmacm multicast RDMA/cma: Consolidate the destruction of a cma_multicast in one place
Jassi Brar (1):
mailbox: avoid timer start from callback
Jernej Skrabec (1):
ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix dcdc1 regulator
Jing Xiangfeng (3):
rapidio: fix the missed put_device() for rio_mport_add_riodev
scsi: mvumi: Fix error return in mvumi_io_attach()
scsi: ibmvfc: Fix error return in ibmvfc_probe()
Joakim Zhang (1):
can: flexcan: flexcan_chip_stop(): add error handling and propagate error value
Johan Hovold (1):
USB: cdc-acm: handle broken union descriptors
Juri Lelli (1):
sched/features: Fix !CONFIG_JUMP_LABEL case
Kaige Li (1):
NTB: hw: amd: fix an issue about leak system resources
Kajol Jain (1):
powerpc/perf/hv-gpci: Fix starting index value
Keita Suzuki (2):
misc: rtsx: Fix memory leak in rtsx_pci_probe
brcmsmac: fix memory leak in wlc_phy_attach_lcnphy
Krzysztof Kozlowski (5):
Input: ep93xx_keypad - fix handling of platform_get_irq() error
Input: omap4-keypad - fix handling of platform_get_irq() error
Input: twl4030_keypad - fix handling of platform_get_irq() error
Input: sun4i-ps2 - fix handling of platform_get_irq() error
memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
Leon Romanovsky (1):
overflow: Include header file with SIZE_MAX declaration
Lijun Ou (1):
RDMA/hns: Set the unsupported wr opcode
Lorenzo Colitti (1):
usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets.
Mark Tomlinson (1):
PCI: iproc: Set affinity mask on MSI interrupts
Martijn de Gouw (1):
SUNRPC: fix copying of multiple pages in gss_read_proxy_verf()
Matthew Wilcox (Oracle) (1):
ramfs: fix nommu mmap with gaps in the page cache
Mauro Carvalho Chehab (2):
media: saa7134: avoid a shift overflow
usb: dwc3: simple: add support for Hikey 970
Michal Simek (1):
arm64: dts: zynqmp: Remove additional compatible string for i2c IPs
Navid Emamdoost (1):
clk: bcm2835: add missing release if devm_clk_hw_register fails
Nicholas Piggin (1):
powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm
Nilesh Javali (2):
scsi: qedi: Protect active command list to avoid list corruption
scsi: qedi: Fix list_del corruption while removing active I/O
Oliver Neukum (2):
media: ati_remote: sanity check for both endpoints
USB: cdc-wdm: Make wdm_flush() interruptible and add wdm_fsync().
Pablo Neira Ayuso (1):
netfilter: nf_fwd_netdev: clear timestamp in forwarding path
Pali Rohár (1):
mmc: sdio: Check for CISTPL_VERS_1 buffer size
Pavel Machek (2):
crypto: ccp - fix error handling
media: firewire: fix memory leak
Peilin Ye (1):
ipvs: Fix uninit-value in do_ip_vs_set_ctl()
Peng Fan (1):
tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
Qiushi Wu (4):
media: sti: Fix reference count leaks
media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync
media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync
media: exynos4-is: Fix a reference count leak
Robert Hoo (1):
KVM: x86: emulating RDPID failure shall return #UD rather than #GP
Roman Bolshakov (1):
scsi: target: core: Add CONTROL field for trace events
Rustam Kovhaev (1):
ntfs: add check for mft record size in superblock
Sherry Sun (2):
mic: vop: copy data to kernel space then write to io memory
misc: vop: add round_up(x,4) for vring_size to avoid kernel panic
Souptick Joarder (1):
rapidio: fix error handling path
Srikar Dronamraju (1):
cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier
Stephan Gerhold (2):
arm64: dts: qcom: pm8916: Remove invalid reg size from wcd_codec
arm64: dts: qcom: msm8916: Fix MDP/DSI interrupts
Stephen Boyd (1):
clk: rockchip: Initialize hw to error to avoid undefined behavior
Tetsuo Handa (2):
block: ratelimit handle_bad_sector() message
mwifiex: don't call del_timer_sync() on uninitialized timer
Thomas Pedersen (1):
mac80211: handle lack of sband->bitrates in rates
Tobias Jordan (1):
lib/crc32.c: fix trivial typo in preprocessor condition
Tong Zhang (1):
tty: ipwireless: fix error handling
Valentin Vidic (1):
net: korina: cast KSEG0 address to pointer in kfree
Vasant Hegde (1):
powerpc/powernv/dump: Fix race while processing OPAL dump
Vincent Mailhol (1):
usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
Wang Yufen (1):
brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach
Weihang Li (1):
RDMA/hns: Fix missing sq_sig_type when querying QP
Xiaolong Huang (1):
media: media/pci: prevent memory leak in bttv_probe
Xiaoyang Xu (1):
vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages
YueHaibing (2):
Input: stmfts - fix a & vs && typo
memory: omap-gpmc: Fix build error without CONFIG_OF
Zekun Shen (1):
ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()
Zqiang (1):
usb: gadget: function: printer: fix use-after-free in __lock_acquire
zhenwei pi (1):
nvmet: fix uninitialized work for zero kato
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 153 +SUBLEVEL = 154 EXTRAVERSION = NAME = "People's Front"
arch/arm/boot/dts/imx6sl.dtsi +2 -0
@@ -922,8 +922,10 @@ }; rngb: rngb@21b4000 { + compatible = "fsl,imx6sl-rngb", "fsl,imx25-rngb"; reg = <0x021b4000 0x4000>; interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks IMX6SL_CLK_DUMMY>; }; weim: weim@21b8000 {
arch/arm/boot/dts/owl-s500.dtsi +3 -3
@@ -85,21 +85,21 @@ global_timer: timer@b0020200 { compatible = "arm,cortex-a9-global-timer"; reg = <0xb0020200 0x100>; - interrupts = <GIC_PPI 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; + interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; status = "disabled"; }; twd_timer: timer@b0020600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0xb0020600 0x20>; - interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; status = "disabled"; }; twd_wdt: wdt@b0020620 { compatible = "arm,cortex-a9-twd-wdt"; reg = <0xb0020620 0xe0>; - interrupts = <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; + interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; status = "disabled"; };
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts +5 -5
@@ -206,16 +206,16 @@ }; ®_dc1sw { - regulator-min-microvolt = <3000000>; - regulator-max-microvolt = <3000000>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; regulator-name = "vcc-gmac-phy"; }; ®_dcdc1 { regulator-always-on; - regulator-min-microvolt = <3000000>; - regulator-max-microvolt = <3000000>; - regulator-name = "vcc-3v0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; }; ®_dcdc2 {
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
@@ -877,7 +877,7 @@ reg-names = "mdp_phys"; interrupt-parent = <&mdss>; - interrupts = <0 0>; + interrupts = <0>; clocks = <&gcc GCC_MDSS_AHB_CLK>, <&gcc GCC_MDSS_AXI_CLK>,
@@ -909,7 +909,7 @@ reg-names = "dsi_ctrl"; interrupt-parent = <&mdss>; - interrupts = <4 0>; + interrupts = <4>; assigned-clocks = <&gcc BYTE0_CLK_SRC>, <&gcc PCLK0_CLK_SRC>;
arch/arm64/boot/dts/qcom/pm8916.dtsi +1 -1
@@ -99,7 +99,7 @@ wcd_codec: codec@f000 { compatible = "qcom,pm8916-wcd-analog-codec"; - reg = <0xf000 0x200>; + reg = <0xf000>; reg-names = "pmic-codec-core"; clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>; clock-names = "mclk";
arch/arm64/boot/dts/xilinx/zynqmp.dtsi +2 -2
@@ -411,7 +411,7 @@ }; i2c0: i2c@ff020000 { - compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10"; + compatible = "cdns,i2c-r1p14"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 17 4>;
@@ -421,7 +421,7 @@ }; i2c1: i2c@ff030000 { - compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10"; + compatible = "cdns,i2c-r1p14"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 18 4>;
arch/powerpc/include/asm/tlb.h +0 -13
@@ -76,19 +76,6 @@ static inline int mm_is_thread_local(struct mm_struct *mm)return false; return cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm)); } -static inline void mm_reset_thread_local (struct mm_struct *mm) -{ -WARN_ON (atomic_read (&mm->context.copros) >0 ); -/* -* It's possible for mm_access to take a reference on mm_users to -* access the remote mm from another thread, but it's not allowed -* to set mm_cpumask, so mm_users may be > 1 here. -*/ -WARN_ON (current->mm != mm); -atomic_set (&mm->context.active_cpus,1 ); -cpumask_clear (mm_cpumask (mm)); -cpumask_set_cpu (smp_processor_id (),mm_cpumask (mm)); -}#else /* CONFIG_PPC_BOOK3S_64 */ static inline int mm_is_thread_local (struct mm_struct *mm) {
arch/powerpc/kernel/tau_6xx.c +37 -59
154 lines not on this page · raw message
arch/powerpc/mm/tlb-radix.c +16 -7
@@ -598,19 +598,29 @@ static void do_exit_flush_lazy_tlb(void *arg)struct mm_struct *mm = arg;unsigned long pid = mm->context.id; +/* +* A kthread could have done a mmget_not_zero() after the flushing CPU +* checked mm_is_singlethreaded, and be in the process of +* kthread_use_mm when interrupted here. In that case, current->mm will +* be set to mm, because kthread_use_mm() setting ->mm and switching to +* the mm is done with interrupts off. +*/ if (current->mm == mm) -return ;/* Local CPU */ + goto out_flush;if (current->active_mm == mm) { -/* -* Must be a kernel thread because sender is single-threaded. -*/ -BUG_ON (current->mm); +WARN_ON_ONCE (current->mm !=NULL ); +/* Is a kernel thread and is using mm as the lazy tlb */ mmgrab (&init_mm); -switch_mm (mm, &init_mm, current); current->active_mm = &init_mm; +switch_mm_irqs_off (mm, &init_mm, current);mmdrop (mm); } + +atomic_dec (&mm->context.active_cpus); +cpumask_clear_cpu (smp_processor_id (),mm_cpumask (mm)); + +out_flush:_tlbiel_pid (pid,RIC_FLUSH_ALL ); }
@@ -625,7 +635,6 @@ static void exit_flush_lazy_tlbs(struct mm_struct *mm)*/ smp_call_function_many (mm_cpumask (mm), do_exit_flush_lazy_tlb, (void *)mm,1 ); -mm_reset_thread_local (mm); }void radix__flush_tlb_mm (struct mm_struct *mm)
arch/powerpc/perf/hv-gpci-requests.h +3 -3
@@ -95,7 +95,7 @@ REQUEST(__field(0, 8, partition_id)#define REQUEST_NAME system_performance_capabilities#define REQUEST_NUM 0x40 -#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff" +#define REQUEST_IDX_KIND "starting_index=0xffffffff"#include I (REQUEST_BEGIN ) REQUEST(__field(0, 1, perf_collect_privileged) __field(0x1, 1, capability_mask)
@@ -223,7 +223,7 @@ REQUEST(__field(0, 2, partition_id)#define REQUEST_NAME system_hypervisor_times#define REQUEST_NUM 0xF0 -#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff" +#define REQUEST_IDX_KIND "starting_index=0xffffffff"#include I (REQUEST_BEGIN ) REQUEST(__count(0, 8, time_spent_to_dispatch_virtual_processors) __count(0x8, 8, time_spent_processing_virtual_processor_timers)
@@ -234,7 +234,7 @@ REQUEST(__count(0, 8, time_spent_to_dispatch_virtual_processors)#define REQUEST_NAME system_tlbie_count_and_time#define REQUEST_NUM 0xF4 -#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff" +#define REQUEST_IDX_KIND "starting_index=0xffffffff"#include I (REQUEST_BEGIN )REQUEST (__count (0 ,8 , tlbie_instructions_issued)/*
arch/powerpc/perf/isa207-common.c +10 -0
@@ -273,6 +273,15 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp) mask |=CNST_PMC_MASK (pmc); value |=CNST_PMC_VAL (pmc); + +/* +* PMC5 and PMC6 are used to count cycles and instructions and +* they do not support most of the constraint bits. Add a check +* to exclude PMC5/6 from most of the constraints except for +* EBB/BHRB. +*/ +if (pmc >=5 ) + goto ebb_bhrb; }if (pmc <=4 ) {
@@ -331,6 +340,7 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp) } } +ebb_bhrb:if (!pmc && ebb)/* EBB events must specify the PMC */ return -1 ;
arch/powerpc/platforms/Kconfig +4 -10
@@ -238,12 +238,11 @@ config TAU temperature within 2-4 degrees Celsius. This option shows the current on-die temperature in /proc/cpuinfo if the cpu supports it. - Unfortunately, on some chip revisions, this sensor is very inaccurate - and in many cases, does not work at all, so don't assume the cpu - temp is actually what /proc/cpuinfo says it is. + Unfortunately, this sensor is very inaccurate when uncalibrated, so + don't assume the cpu temp is actually what /proc/cpuinfo says it is. config TAU_INT - bool "Interrupt driven TAU driver (DANGEROUS)" + bool "Interrupt driven TAU driver (EXPERIMENTAL)" depends on TAU ---help--- The TAU supports an interrupt driven mode which causes an interrupt
@@ -251,12 +250,7 @@ config TAU_INT to get notified the temp has exceeded a range. With this option off, a timer is used to re-check the temperature periodically. - However, on some cpus it appears that the TAU interrupt hardware - is buggy and can cause a situation which would lead unexplained hard - lockups. - - Unless you are extending the TAU driver, or enjoy kernel/hardware - debugging, leave this option off. + If in doubt, say N here. config TAU_AVERAGE bool "Average high and low temp"
arch/powerpc/platforms/powernv/opal-dump.c +29 -12
65 lines not on this page · raw message
arch/x86/kvm/emulate.c +1 -1
@@ -3561,7 +3561,7 @@ static int em_rdpid(struct x86_emulate_ctxt *ctxt)u64 tsc_aux =0 ;if (ctxt->ops->get_msr (ctxt,MSR_TSC_AUX , &tsc_aux)) -return emulate_gp (ctxt,0 ); +return emulate_ud (ctxt); ctxt->dst.val = tsc_aux;return X86EMUL_CONTINUE ; }
block/blk-core.c +4 -5
@@ -2127,11 +2127,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) {char b[BDEVNAME_SIZE ]; -printk (KERN_INFO "attempt to access beyond end of device\n" ); -printk (KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n" , -bio_devname (bio, b), bio->bi_opf, - (unsigned long long )bio_end_sector (bio), - (long long )maxsector); +pr_info_ratelimited ("attempt to access beyond end of device\n" +"%s: rw=%d, want=%llu, limit=%llu\n" , +bio_devname (bio, b), bio->bi_opf, +bio_end_sector (bio), maxsector); }#ifdef CONFIG_FAIL_MAKE_REQUEST
drivers/clk/at91/clk-main.c +8 -3
@@ -517,12 +517,17 @@ static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index)return -EINVAL ;regmap_read (regmap,AT91_CKGR_MOR , &tmp); - tmp &= ~MOR_KEY_MASK ;if (index && !(tmp &AT91_PMC_MOSCSEL )) -regmap_write (regmap,AT91_CKGR_MOR , tmp |AT91_PMC_MOSCSEL ); + tmp =AT91_PMC_MOSCSEL ;else if (!index && (tmp &AT91_PMC_MOSCSEL )) -regmap_write (regmap,AT91_CKGR_MOR , tmp & ~AT91_PMC_MOSCSEL ); + tmp =0 ; +else +return 0 ; + +regmap_update_bits (regmap,AT91_CKGR_MOR , +AT91_PMC_MOSCSEL |MOR_KEY_MASK , + tmp |AT91_PMC_KEY );while (!clk_sam9x5_main_ready (regmap))cpu_relax ();
drivers/clk/bcm/clk-bcm2835.c +3 -1
@@ -1319,8 +1319,10 @@ static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman, pll->hw.init = &init; ret =devm_clk_hw_register (cprman->dev, &pll->hw); -if (ret) +if (ret) { +kfree (pll);return NULL ; + }return &pll->hw; }
drivers/clk/rockchip/clk-half-divider.c +1 -1
@@ -166,7 +166,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name,unsigned long flags, spinlock_t *lock) { - struct clk *clk; + struct clk *clk = ERR_PTR(-ENOMEM);struct clk_mux *mux =NULL ;struct clk_gate *gate =NULL ;struct clk_divider *div =NULL ;
drivers/cpufreq/powernv-cpufreq.c +6 -3
@@ -885,12 +885,15 @@ static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) { int cpu; -struct cpufreq_policy cpu_policy; +struct cpufreq_policy *cpu_policy; rebooting = true;for_each_online_cpu (cpu) { -cpufreq_get_policy (&cpu_policy, cpu); -powernv_cpufreq_target_index (&cpu_policy,get_nominal_index ()); + cpu_policy =cpufreq_cpu_get (cpu); +if (!cpu_policy) +continue ; +powernv_cpufreq_target_index (cpu_policy,get_nominal_index ()); +cpufreq_cpu_put (cpu_policy); }return NOTIFY_DONE ;
drivers/crypto/ccp/ccp-ops.c +1 -1
@@ -1752,7 +1752,7 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)break ;default : ret = -EINVAL ; - goto e_ctx; + goto e_data; } }else {/* Stash the context */
drivers/gpu/drm/virtio/virtgpu_kms.c +2 -0
@@ -113,8 +113,10 @@ static void virtio_gpu_get_capsets(struct virtio_gpu_device *vgdev, vgdev->capsets[i].id > 0, 5 * HZ);if (ret ==0 ) {DRM_ERROR ("timed out waiting for cap set %d\n" , i); +spin_lock (&vgdev->display_info_lock);kfree (vgdev->capsets); vgdev->capsets =NULL ; +spin_unlock (&vgdev->display_info_lock);return ; } DRM_INFO("cap set %d: id %d, max-version %d, max-size %d\n",
drivers/gpu/drm/virtio/virtgpu_vq.c +7 -3
@@ -566,9 +566,13 @@ static void virtio_gpu_cmd_get_capset_info_cb(struct virtio_gpu_device *vgdev,int i =le32_to_cpu (cmd->capset_index);spin_lock (&vgdev->display_info_lock); - vgdev->capsets[i].id =le32_to_cpu (resp->capset_id); - vgdev->capsets[i].max_version =le32_to_cpu (resp->capset_max_version); - vgdev->capsets[i].max_size =le32_to_cpu (resp->capset_max_size); +if (vgdev->capsets) { + vgdev->capsets[i].id =le32_to_cpu (resp->capset_id); + vgdev->capsets[i].max_version =le32_to_cpu (resp->capset_max_version); + vgdev->capsets[i].max_size =le32_to_cpu (resp->capset_max_size); + }else { +DRM_ERROR ("invalid capset memory." ); + }spin_unlock (&vgdev->display_info_lock);wake_up (&vgdev->resp_wq); }
drivers/i2c/busses/Kconfig +1 -0
@@ -1117,6 +1117,7 @@ config I2C_RCAR tristate "Renesas R-Car I2C Controller" depends on ARCH_RENESAS || COMPILE_TEST select I2C_SLAVE + select RESET_CONTROLLER if ARCH_RCAR_GEN3 help If you say yes to this option, support will be included for the R-Car I2C controller.
drivers/i2c/i2c-core-acpi.c +10 -1
@@ -219,6 +219,7 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level,void i2c_acpi_register_devices (struct i2c_adapter *adap) {acpi_status status; +acpi_handle handle;if (!has_acpi_companion (&adap->dev))return ;
@@ -229,6 +230,15 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap) adap, NULL);if (ACPI_FAILURE (status))dev_warn (&adap->dev,"failed to enumerate I2C slaves\n" ); + +if (!adap->dev.parent) +return ; + + handle =ACPI_HANDLE (adap->dev.parent); +if (!handle) +return ; + +acpi_walk_dep_device_list (handle); } const struct acpi_device_id *
@@ -693,7 +703,6 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter)return -ENOMEM ; } -acpi_walk_dep_device_list (handle);return 0 ; }
drivers/infiniband/core/cma.c +36 -48
118 lines not on this page · raw message
drivers/infiniband/hw/hns/hns_roce_hw_v1.c +0 -1
@@ -274,7 +274,6 @@ static int hns_roce_v1_post_send(struct ib_qp *ibqp, ps_opcode =HNS_ROCE_WQE_OPCODE_SEND ;break ;case IB_WR_LOCAL_INV : -break ;case IB_WR_ATOMIC_CMP_AND_SWP :case IB_WR_ATOMIC_FETCH_AND_ADD :case IB_WR_LSO :
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +1 -0
@@ -3821,6 +3821,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, } qp_init_attr->cap = qp_attr->cap; + qp_init_attr->sq_sig_type = hr_qp->sq_signal_bits; out:mutex_unlock (&hr_qp->mutex);
drivers/infiniband/sw/rdmavt/vt.c +1 -3
@@ -95,9 +95,7 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)if (!rdi)return rdi; - rdi->ports =kcalloc (nports, -sizeof (struct rvt_ibport **), -GFP_KERNEL ); + rdi->ports =kcalloc (nports,sizeof (*rdi->ports),GFP_KERNEL );if (!rdi->ports)ib_dealloc_device (&rdi->ibdev);
drivers/input/keyboard/ep93xx_keypad.c +2 -2
@@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) } keypad->irq =platform_get_irq (pdev,0 ); -if (!keypad->irq) { - err = -ENXIO ; +if (keypad->irq <0 ) { + err = keypad->irq; goto failed_free; }
drivers/input/keyboard/omap4-keypad.c +2 -4
@@ -253,10 +253,8 @@ static int omap4_keypad_probe(struct platform_device *pdev) } irq =platform_get_irq (pdev,0 ); -if (!irq) { -dev_err (&pdev->dev,"no keyboard irq assigned\n" ); -return -EINVAL ; - } +if (irq <0 ) +return irq; keypad_data =kzalloc (sizeof (struct omap4_keypad ),GFP_KERNEL );if (!keypad_data) {
drivers/input/keyboard/twl4030_keypad.c +3 -5
@@ -63,7 +63,7 @@ struct twl4030_keypad {bool autorepeat;unsigned int n_rows;unsigned int n_cols; -unsigned int irq; +int irq;struct device *dbg_dev;struct input_dev *input;
@@ -389,10 +389,8 @@ static int twl4030_kp_probe(struct platform_device *pdev) } kp->irq =platform_get_irq (pdev,0 ); -if (!kp->irq) { -dev_err (&pdev->dev,"no keyboard irq assigned\n" ); -return -EINVAL ; - } +if (kp->irq <0 ) +return kp->irq; error = matrix_keypad_build_keymap(keymap_data, NULL, TWL4030_MAX_ROWS,
drivers/input/serio/sun4i-ps2.c +3 -6
@@ -210,7 +210,6 @@ static int sun4i_ps2_probe(struct platform_device *pdev)struct sun4i_ps2data *drvdata;struct serio *serio;struct device *dev = &pdev->dev; -unsigned int irq;int error; drvdata =kzalloc (sizeof (struct sun4i_ps2data ),GFP_KERNEL );
@@ -263,14 +262,12 @@ static int sun4i_ps2_probe(struct platform_device *pdev)writel (0 , drvdata->reg_base +PS2_REG_GCTL );/* Get IRQ for the device */ - irq =platform_get_irq (pdev,0 ); -if (!irq) { -dev_err (dev,"no IRQ found\n" ); - error = -ENXIO ; + drvdata->irq =platform_get_irq (pdev,0 ); +if (drvdata->irq <0 ) { + error = drvdata->irq; goto err_disable_clk; } - drvdata->irq = irq; drvdata->serio = serio; drvdata->dev = dev;
drivers/input/touchscreen/imx6ul_tsc.c +16 -11
@@ -538,20 +538,25 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev)mutex_lock (&input_dev->mutex); -if (input_dev->users) { - retval =clk_prepare_enable (tsc->adc_clk); -if (retval) - goto out; - - retval =clk_prepare_enable (tsc->tsc_clk); -if (retval) { -clk_disable_unprepare (tsc->adc_clk); - goto out; - } +if (!input_dev->users) + goto out; - retval =imx6ul_tsc_init (tsc); + retval =clk_prepare_enable (tsc->adc_clk); +if (retval) + goto out; + + retval =clk_prepare_enable (tsc->tsc_clk); +if (retval) { +clk_disable_unprepare (tsc->adc_clk); + goto out; } + retval =imx6ul_tsc_init (tsc); +if (retval) { +clk_disable_unprepare (tsc->tsc_clk); +clk_disable_unprepare (tsc->adc_clk); + goto out; + } out:mutex_unlock (&input_dev->mutex);return retval;
drivers/input/touchscreen/stmfts.c +1 -1
@@ -479,7 +479,7 @@ static ssize_t stmfts_sysfs_hover_enable_write(struct device *dev,mutex_lock (&sdata->mutex); -if (value & sdata->hover_enabled) +if (value && sdata->hover_enabled) goto out;if (sdata->running)
drivers/mailbox/mailbox.c +7 -5
@@ -85,9 +85,12 @@ static void msg_submit(struct mbox_chan *chan) exit:spin_unlock_irqrestore (&chan->lock, flags); -if (!err && (chan->txdone_method &TXDONE_BY_POLL )) -/* kick start the timer immediately to avoid delays */ -hrtimer_start (&chan->mbox->poll_hrt,0 ,HRTIMER_MODE_REL ); +/* kick start the timer immediately to avoid delays */ +if (!err && (chan->txdone_method &TXDONE_BY_POLL )) { +/* but only if not already active */ +if (!hrtimer_active (&chan->mbox->poll_hrt)) +hrtimer_start (&chan->mbox->poll_hrt,0 ,HRTIMER_MODE_REL ); + } }static void tx_tick (struct mbox_chan *chan,int r)
@@ -125,11 +128,10 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer)struct mbox_chan *chan = &mbox->chans[i];if (chan->active_req && chan->cl) { + resched = true; txdone = chan->mbox->ops->last_tx_done (chan);if (txdone)tx_tick (chan,0 ); -else - resched = true; } }
drivers/media/firewire/firedtv-fw.c +4 -2
@@ -271,8 +271,10 @@ static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) name_len =fw_csr_string (unit->directory,CSR_MODEL , name,sizeof (name)); -if (name_len <0 ) -return name_len; +if (name_len <0 ) { + err = name_len; + goto fail_free; + }for (i =ARRAY_SIZE (model_names); --i; )if (strlen (model_names[i]) <= name_len &&strncmp (name, model_names[i], name_len) ==0 )
drivers/media/pci/bt8xx/bttv-driver.c +10 -3
@@ -4055,11 +4055,13 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) btv->id = dev->device;if (pci_enable_device (dev)) {pr_warn ("%d: Can't enable device\n" , btv->c.nr); -return -EIO ; + result = -EIO ; + goto free_mem; }if (pci_set_dma_mask (dev,DMA_BIT_MASK (32 ))) {pr_warn ("%d: No suitable DMA available\n" , btv->c.nr); -return -EIO ; + result = -EIO ; + goto free_mem; } if (!request_mem_region(pci_resource_start(dev,0), pci_resource_len(dev,0),
@@ -4067,7 +4069,8 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)pr_warn ("%d: can't request iomem (0x%llx)\n" , btv->c.nr, (unsigned long long )pci_resource_start (dev,0 )); -return -EBUSY ; + result = -EBUSY ; + goto free_mem; }pci_set_master (dev);pci_set_command (dev);
@@ -4253,6 +4256,10 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)release_mem_region (pci_resource_start (btv->c.pci,0 ),pci_resource_len (btv->c.pci,0 ));pci_disable_device (btv->c.pci); + +free_mem: + bttvs[btv->c.nr] =NULL ; +kfree (btv);return result; }
drivers/media/pci/saa7134/saa7134-tvaudio.c +2 -1
@@ -693,7 +693,8 @@ int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value) {int err; -audio_dbg (2 ,"dsp write reg 0x%x = 0x%06x\n" , reg <<2 , value); +audio_dbg (2 ,"dsp write reg 0x%x = 0x%06x\n" , + (reg <<2 ) &0xffffffff , value); err =saa_dsp_wait_bit (dev,SAA7135_DSP_RWSTATE_WRR );if (err <0 )return err;
drivers/media/platform/exynos4-is/fimc-isp.c +3 -1
@@ -311,8 +311,10 @@ static int fimc_isp_subdev_s_power(struct v4l2_subdev *sd, int on)if (on) { ret =pm_runtime_get_sync (&is->pdev->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (&is->pdev->dev);return ret; + }set_bit (IS_ST_PWR_ON , &is->state); ret =fimc_is_start_firmware (is);
drivers/media/platform/exynos4-is/fimc-lite.c +1 -1
@@ -480,7 +480,7 @@ static int fimc_lite_open(struct file *file)set_bit (ST_FLITE_IN_USE , &fimc->state); ret =pm_runtime_get_sync (&fimc->pdev->dev);if (ret <0 ) - goto unlock; + goto err_pm; ret =v4l2_fh_open (file);if (ret <0 )
drivers/media/platform/exynos4-is/media-dev.c +3 -1
@@ -481,8 +481,10 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd)return -ENXIO ; ret =pm_runtime_get_sync (fmd->pmf); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (fmd->pmf);return ret; + } fmd->num_sensors =0 ;
drivers/media/platform/exynos4-is/mipi-csis.c +3 -1
@@ -513,8 +513,10 @@ static int s5pcsis_s_stream(struct v4l2_subdev *sd, int enable)if (enable) {s5pcsis_clear_counters (state); ret =pm_runtime_get_sync (&state->pdev->dev); -if (ret && ret !=1 ) +if (ret && ret !=1 ) { +pm_runtime_put_noidle (&state->pdev->dev);return ret; + } }mutex_lock (&state->lock);
drivers/media/platform/qcom/venus/core.c +4 -1
@@ -321,8 +321,10 @@ static int venus_probe(struct platform_device *pdev) goto err_dev_unregister; ret =pm_runtime_put_sync (dev); -if (ret) +if (ret) { +pm_runtime_get_noresume (dev); goto err_dev_unregister; + }return 0 ;
@@ -333,6 +335,7 @@ static int venus_probe(struct platform_device *pdev) err_venus_shutdown:venus_shutdown (dev); err_runtime_disable: +pm_runtime_put_noidle (dev);pm_runtime_set_suspended (dev);pm_runtime_disable (dev);hfi_destroy (core);
drivers/media/platform/s3c-camif/camif-core.c +2 -3
@@ -476,7 +476,7 @@ static int s3c_camif_probe(struct platform_device *pdev) ret =camif_media_dev_init (camif);if (ret <0 ) - goto err_alloc; + goto err_pm; ret =camif_register_sensor (camif);if (ret <0 )
@@ -510,10 +510,9 @@ static int s3c_camif_probe(struct platform_device *pdev)media_device_unregister (&camif->media_dev);media_device_cleanup (&camif->media_dev);camif_unregister_media_entities (camif); -err_alloc: +err_pm:pm_runtime_put (dev);pm_runtime_disable (dev); -err_pm:camif_clk_put (camif); err_clk:s3c_camif_unregister_subdev (camif);
drivers/media/platform/sti/bdisp/bdisp-v4l2.c +1 -2
@@ -1371,7 +1371,7 @@ static int bdisp_probe(struct platform_device *pdev) ret =pm_runtime_get_sync (dev);if (ret <0 ) {dev_err (dev,"failed to set PM\n" ); - goto err_dbg; + goto err_pm; }/* Filters */
@@ -1399,7 +1399,6 @@ static int bdisp_probe(struct platform_device *pdev)bdisp_hw_free_filters (bdisp->dev); err_pm:pm_runtime_put (dev); -err_dbg:bdisp_debugfs_remove (bdisp); err_v4l2:v4l2_device_unregister (&bdisp->v4l2_dev);
drivers/media/platform/sti/delta/delta-v4l2.c +3 -1
@@ -954,8 +954,10 @@ static void delta_run_work(struct work_struct *work)/* enable the hardware */ if (!dec->pm) { ret =delta_get_sync (ctx); -if (ret) +if (ret) { +delta_put_autosuspend (ctx); goto err; + } }/* decode this access unit */
drivers/media/platform/sti/hva/hva-hw.c +3 -1
@@ -272,6 +272,7 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva)if (pm_runtime_get_sync (dev) <0 ) {dev_err (dev,"%s failed to get pm_runtime\n" ,HVA_PREFIX ); +pm_runtime_put_noidle (dev);mutex_unlock (&hva->protect_mutex);return -EFAULT ; }
@@ -392,7 +393,7 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva) ret =pm_runtime_get_sync (dev);if (ret <0 ) {dev_err (dev,"%s failed to set PM\n" ,HVA_PREFIX ); - goto err_clk; + goto err_pm; }/* check IP hardware version */
@@ -557,6 +558,7 @@ void hva_hw_dump_regs(struct hva_dev *hva, struct seq_file *s)if (pm_runtime_get_sync (dev) <0 ) {seq_puts (s,"Cannot wake up IP\n" ); +pm_runtime_put_noidle (dev);mutex_unlock (&hva->protect_mutex);return ; }
drivers/media/platform/vsp1/vsp1_drv.c +8 -3
@@ -562,7 +562,12 @@ int vsp1_device_get(struct vsp1_device *vsp1)int ret; ret =pm_runtime_get_sync (vsp1->dev); -return ret <0 ? ret :0 ; +if (ret <0 ) { +pm_runtime_put_noidle (vsp1->dev); +return ret; + } + +return 0 ; }/*
@@ -845,12 +850,12 @@ static int vsp1_probe(struct platform_device *pdev)/* Configure device parameters based on the version register. */ pm_runtime_enable (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev); + ret =vsp1_device_get (vsp1);if (ret <0 ) goto done; vsp1->version =vsp1_read (vsp1,VI6_IP_VERSION ); -pm_runtime_put_sync (&pdev->dev); +vsp1_device_put (vsp1);for (i =0 ; i <ARRAY_SIZE (vsp1_device_infos); ++i) { if ((vsp1->version & VI6_IP_VERSION_MODEL_MASK) ==
drivers/media/rc/ati_remote.c +4 -0
@@ -845,6 +845,10 @@ static int ati_remote_probe(struct usb_interface *interface,err ("%s: endpoint_in message size==0? \n" , __func__);return -ENODEV ; } +if (!usb_endpoint_is_int_out (endpoint_out)) { +err ("%s: Unexpected endpoint_out\n" , __func__); +return -ENODEV ; + } ati_remote =kzalloc (sizeof (struct ati_remote ),GFP_KERNEL ); rc_dev =rc_allocate_device (RC_DRIVER_SCANCODE );
drivers/media/usb/uvc/uvc_v4l2.c +30 -0
@@ -252,11 +252,41 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,if (ret <0 ) goto done; +/* After the probe, update fmt with the values returned from +* negotiation with the device. +*/ +for (i =0 ; i < stream->nformats; ++i) { +if (probe->bFormatIndex == stream->format[i].index) { + format = &stream->format[i]; +break ; + } + } + +if (i == stream->nformats) { +uvc_trace (UVC_TRACE_FORMAT ,"Unknown bFormatIndex %u\n" , + probe->bFormatIndex); +return -EINVAL ; + } + +for (i =0 ; i < format->nframes; ++i) { +if (probe->bFrameIndex == format->frame[i].bFrameIndex) { + frame = &format->frame[i]; +break ; + } + } + +if (i == format->nframes) { +uvc_trace (UVC_TRACE_FORMAT ,"Unknown bFrameIndex %u\n" , + probe->bFrameIndex); +return -EINVAL ; + } + fmt->fmt.pix.width = frame->wWidth; fmt->fmt.pix.height = frame->wHeight; fmt->fmt.pix.field =V4L2_FIELD_NONE ; fmt->fmt.pix.bytesperline =uvc_v4l2_get_bytesperline (format, frame); fmt->fmt.pix.sizeimage = probe->dwMaxVideoFrameSize; + fmt->fmt.pix.pixelformat = format->fcc; fmt->fmt.pix.colorspace = format->colorspace; fmt->fmt.pix.priv =0 ;
drivers/memory/fsl-corenet-cf.c +2 -4
@@ -215,10 +215,8 @@ static int ccf_probe(struct platform_device *pdev)dev_set_drvdata (&pdev->dev, ccf); irq =platform_get_irq (pdev,0 ); -if (!irq) { -dev_err (&pdev->dev,"%s: no irq\n" , __func__); -return -ENXIO ; - } +if (irq <0 ) +return irq; ret =devm_request_irq (&pdev->dev, irq, ccf_irq,0 , pdev->name, ccf);if (ret) {
drivers/memory/omap-gpmc.c +6 -2
@@ -951,7 +951,7 @@ static int gpmc_cs_remap(int cs, u32 base)int ret;u32 old_base, size; -if (cs > gpmc_cs_num) { +if (cs >= gpmc_cs_num) {pr_err ("%s: requested chip-select is disabled\n" , __func__);return -ENODEV ; }
@@ -986,7 +986,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)struct resource *res = &gpmc->mem;int r =-1 ; -if (cs > gpmc_cs_num) { +if (cs >= gpmc_cs_num) {pr_err ("%s: requested chip-select is disabled\n" , __func__);return -ENODEV ; }
@@ -2278,6 +2278,10 @@ static void gpmc_probe_dt_children(struct platform_device *pdev) } }#else +void gpmc_read_settings_dt (struct device_node *np,struct gpmc_settings *p) +{ +memset (p,0 ,sizeof (*p)); +}static int gpmc_probe_dt (struct platform_device *pdev) {return 0 ;
drivers/misc/cardreader/rtsx_pcr.c +3 -1
@@ -1524,12 +1524,14 @@ static int rtsx_pci_probe(struct pci_dev *pcidev, ret =mfd_add_devices (&pcidev->dev, pcr->id, rtsx_pcr_cells,ARRAY_SIZE (rtsx_pcr_cells),NULL ,0 ,NULL );if (ret <0 ) - goto disable_irq; + goto free_slots;schedule_delayed_work (&pcr->idle_work,msecs_to_jiffies (200 ));return 0 ; +free_slots: +kfree (pcr->slots); disable_irq:free_irq (pcr->irq, (void *)pcr); disable_msi:
drivers/misc/eeprom/at25.c +1 -1
@@ -362,7 +362,7 @@ static int at25_probe(struct spi_device *spi) at25->nvmem_config.reg_read = at25_ee_read; at25->nvmem_config.reg_write = at25_ee_write; at25->nvmem_config.priv = at25; - at25->nvmem_config.stride =4 ; + at25->nvmem_config.stride =1 ; at25->nvmem_config.word_size =1 ; at25->nvmem_config.size = chip.byte_len;
drivers/misc/mic/vop/vop_main.c +1 -1
@@ -301,7 +301,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev,/* First assign the vring's allocated in host memory */ vqconfig =_vop_vq_config (vdev->desc) + index;memcpy_fromio (&config, vqconfig,sizeof (config)); - _vr_size =vring_size (le16_to_cpu (config.num),MIC_VIRTIO_RING_ALIGN ); + _vr_size =round_up (vring_size (le16_to_cpu (config.num),MIC_VIRTIO_RING_ALIGN ),4 ); vr_size =PAGE_ALIGN (_vr_size +sizeof (struct _mic_vring_info )); va = vpdev->hw_ops->ioremap (vpdev,le64_to_cpu (config.address), vr_size);
drivers/misc/mic/vop/vop_vringh.c +16 -8
@@ -308,7 +308,7 @@ static int vop_virtio_add_device(struct vop_vdev *vdev, num =le16_to_cpu (vqconfig[i].num);mutex_init (&vvr->vr_mutex); - vr_size =PAGE_ALIGN (vring_size (num,MIC_VIRTIO_RING_ALIGN ) + + vr_size =PAGE_ALIGN (round_up (vring_size (num,MIC_VIRTIO_RING_ALIGN ),4 ) +sizeof (struct _mic_vring_info )); vr->va = (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO,
@@ -320,7 +320,7 @@ static int vop_virtio_add_device(struct vop_vdev *vdev, goto err; } vr->len = vr_size; - vr->info = vr->va +vring_size (num,MIC_VIRTIO_RING_ALIGN ); + vr->info = vr->va +round_up (vring_size (num,MIC_VIRTIO_RING_ALIGN ),4 ); vr->info->magic =cpu_to_le32 (MIC_MAGIC + vdev->virtio_id + i); vr_addr =dma_map_single (&vpdev->dev, vr->va, vr_size,DMA_BIDIRECTIONAL );
@@ -611,6 +611,7 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf,size_t partlen;bool dma =VOP_USE_DMA ;int err =0 ; +size_t offset =0 ;if (daddr & (dma_alignment -1 )) { vdev->tx_dst_unaligned += len;
@@ -659,13 +660,20 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf,* We are copying to IO below and should ideally use something * like copy_from_user_toio(..) if it existed. */ -if (copy_from_user ((void __force *)dbuf, ubuf, len)) { - err = -EFAULT ; -dev_err (vop_dev (vdev),"%s %d err %d\n" , - __func__, __LINE__, err); - goto err; +while (len) { + partlen =min_t (size_t, len,VOP_INT_DMA_BUF_SIZE ); + +if (copy_from_user (vvr->buf, ubuf + offset, partlen)) { + err = -EFAULT ; +dev_err (vop_dev (vdev),"%s %d err %d\n" , + __func__, __LINE__, err); + goto err; + } +memcpy_toio (dbuf + offset, vvr->buf, partlen); + offset += partlen; + vdev->out_bytes += partlen; + len -= partlen; } - vdev->out_bytes += len; err =0 ; err: vpdev->hw_ops->iounmap (vpdev, dbuf);
drivers/mmc/core/sdio_cis.c +3 -0
@@ -30,6 +30,9 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,unsigned i, nr_strings;char **buffer, *string; +if (size <2 ) +return 0 ; +/* Find all null-terminated (including zero length) strings in the TPLLV1_INFO field. Trailing garbage is ignored. */ buf +=2 ;
drivers/net/can/flexcan.c +28 -6
@@ -1091,18 +1091,23 @@ static int flexcan_chip_start(struct net_device *dev)return err; } -/* flexcan_chip_stop +/* __flexcan_chip_stop * -* this functions is entered with clocks enabled +* this function is entered with clocks enabled */ -static void flexcan_chip_stop (struct net_device *dev) +static int __flexcan_chip_stop (struct net_device *dev,bool disable_on_error) {struct flexcan_priv *priv =netdev_priv (dev);struct flexcan_regs __iomem *regs = priv->regs; +int err;/* freeze + disable module */ -flexcan_chip_freeze (priv); -flexcan_chip_disable (priv); + err =flexcan_chip_freeze (priv); +if (err && !disable_on_error) +return err; + err =flexcan_chip_disable (priv); +if (err && !disable_on_error) + goto out_chip_unfreeze;/* Disable all interrupts */ priv->write (0 , ®s->imask2);
@@ -1112,6 +1117,23 @@ static void flexcan_chip_stop(struct net_device *dev)flexcan_transceiver_disable (priv); priv->can.state =CAN_STATE_STOPPED ; + +return 0 ; + + out_chip_unfreeze: +flexcan_chip_unfreeze (priv); + +return err; +} + +static inline int flexcan_chip_stop_disable_on_error (struct net_device *dev) +{ +return __flexcan_chip_stop (dev, true); +} + +static inline int flexcan_chip_stop (struct net_device *dev) +{ +return __flexcan_chip_stop (dev, false); }static int flexcan_open (struct net_device *dev)
@@ -1165,7 +1187,7 @@ static int flexcan_close(struct net_device *dev)netif_stop_queue (dev);can_rx_offload_disable (&priv->offload); -flexcan_chip_stop (dev); +flexcan_chip_stop_disable_on_error (dev);free_irq (dev->irq, dev);clk_disable_unprepare (priv->clk_per);
drivers/net/ethernet/korina.c +2 -2
@@ -1113,7 +1113,7 @@ static int korina_probe(struct platform_device *pdev)return rc; probe_err_register: -kfree (KSEG0ADDR (lp->td_ring)); +kfree ((struct dma_desc *)KSEG0ADDR (lp->td_ring)); probe_err_td_ring:iounmap (lp->tx_dma_regs); probe_err_dma_tx:
@@ -1133,7 +1133,7 @@ static int korina_remove(struct platform_device *pdev)iounmap (lp->eth_regs);iounmap (lp->rx_dma_regs);iounmap (lp->tx_dma_regs); -kfree (KSEG0ADDR (lp->td_ring)); +kfree ((struct dma_desc *)KSEG0ADDR (lp->td_ring));unregister_netdev (bif->dev);free_netdev (bif->dev);
drivers/net/wireless/ath/ath10k/htt_rx.c +8 -0
@@ -153,6 +153,14 @@ static int __ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num)BUILD_BUG_ON (HTT_RX_RING_FILL_LEVEL >=HTT_RX_RING_SIZE /2 ); idx =__le32_to_cpu (*htt->rx_ring.alloc_idx.vaddr); + +if (idx <0 || idx >= htt->rx_ring.size) { +ath10k_err (htt->ar,"rx ring index is not valid, firmware malfunctioning?\n" ); + idx &= htt->rx_ring.size_mask; + ret = -ENOMEM ; + goto fail; + } +while (num >0 ) { skb =dev_alloc_skb (HTT_RX_BUF_SIZE +HTT_RX_DESC_ALIGN );if (!skb) {
drivers/net/wireless/ath/ath9k/hif_usb.c +19 -0
@@ -449,10 +449,19 @@ static void hif_usb_stop(void *hif_handle)spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);/* The pending URBs have to be canceled. */ +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags);list_for_each_entry_safe (tx_buf, tx_buf_tmp, &hif_dev->tx.tx_pending, list) { +usb_get_urb (tx_buf->urb); +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);usb_kill_urb (tx_buf->urb); +list_del (&tx_buf->list); +usb_free_urb (tx_buf->urb); +kfree (tx_buf->buf); +kfree (tx_buf); +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); } +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);usb_kill_anchored_urbs (&hif_dev->mgmt_submitted); }
@@ -762,27 +771,37 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev)struct tx_buf *tx_buf =NULL , *tx_buf_tmp =NULL ;unsigned long flags; +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags);list_for_each_entry_safe (tx_buf, tx_buf_tmp, &hif_dev->tx.tx_buf, list) { +usb_get_urb (tx_buf->urb); +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);usb_kill_urb (tx_buf->urb);list_del (&tx_buf->list);usb_free_urb (tx_buf->urb);kfree (tx_buf->buf);kfree (tx_buf); +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); } +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); hif_dev->tx.flags |=HIF_USB_TX_FLUSH ;spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags); +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags);list_for_each_entry_safe (tx_buf, tx_buf_tmp, &hif_dev->tx.tx_pending, list) { +usb_get_urb (tx_buf->urb); +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);usb_kill_urb (tx_buf->urb);list_del (&tx_buf->list);usb_free_urb (tx_buf->urb);kfree (tx_buf->buf);kfree (tx_buf); +spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); } +spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);usb_kill_anchored_urbs (&hif_dev->mgmt_submitted); }
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +2 -0
@@ -1563,6 +1563,8 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)BRCMF_TX_IOCTL_MAX_MSG_SIZE , msgbuf->ioctbuf, msgbuf->ioctbuf_handle); +if (msgbuf->txflow_wq) +destroy_workqueue (msgbuf->txflow_wq);kfree (msgbuf); }return -ENOMEM ;
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c +3 -1
@@ -5085,8 +5085,10 @@ bool wlc_phy_attach_lcnphy(struct brcms_phy *pi) pi->pi_fptr.radioloftget = wlc_lcnphy_get_radio_loft; pi->pi_fptr.detach = wlc_phy_detach_lcnphy; -if (!wlc_phy_txpwr_srom_read_lcnphy (pi)) +if (!wlc_phy_txpwr_srom_read_lcnphy (pi)) { +kfree (pi->u.pi_lcnphy);return false; + }if (LCNREV_IS (pi->pubpi.phy_rev,1 )) {if (pi_lcn->lcnphy_tempsense_option ==3 ) {
drivers/net/wireless/marvell/mwifiex/usb.c +2 -1
@@ -1355,7 +1355,8 @@ static void mwifiex_usb_cleanup_tx_aggr(struct mwifiex_adapter *adapter) skb_dequeue(&port->tx_aggr.aggr_list)))mwifiex_write_data_complete (adapter, skb_tmp,0 ,-1 ); -del_timer_sync (&port->tx_aggr.timer_cnxt.hold_timer); +if (port->tx_aggr.timer_cnxt.hold_timer.function) +del_timer_sync (&port->tx_aggr.timer_cnxt.hold_timer); port->tx_aggr.timer_cnxt.is_hold_timer_set = false; port->tx_aggr.timer_cnxt.hold_tmo_msecs =0 ; }
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +9 -1
@@ -5453,7 +5453,6 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw) ret =usb_submit_urb (urb,GFP_KERNEL );if (ret) {usb_unanchor_urb (urb); -usb_free_urb (urb); goto error; }
@@ -5462,6 +5461,7 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw)rtl8xxxu_write32 (priv,REG_USB_HIMR , val32); error: +usb_free_urb (urb);return ret; }
@@ -5787,6 +5787,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)struct rtl8xxxu_priv *priv = hw->priv;struct rtl8xxxu_rx_urb *rx_urb;struct rtl8xxxu_tx_urb *tx_urb; +struct sk_buff *skb;unsigned long flags;int ret, i;
@@ -5837,6 +5838,13 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) rx_urb->hw = hw; ret =rtl8xxxu_submit_rx_urb (priv, rx_urb); +if (ret) { +if (ret != -ENOMEM ) { + skb = (struct sk_buff *)rx_urb->urb.context; +dev_kfree_skb (skb); + } +rtl8xxxu_queue_rx_urb (priv, rx_urb); + } } exit:/*
drivers/ntb/hw/amd/ntb_hw_amd.c +1 -0
@@ -1036,6 +1036,7 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev, err_dma_mask:pci_clear_master (pdev); +pci_release_regions (pdev); err_pci_regions:pci_disable_device (pdev); err_pci_enable:
drivers/nvme/target/core.c +2 -1
@@ -787,7 +787,8 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl)* in case a host died before it enabled the controller. Hence, simply * reset the keep alive timer when the controller is enabled. */ -mod_delayed_work (system_wq, &ctrl->ka_work, ctrl->kato *HZ ); +if (ctrl->kato) +mod_delayed_work (system_wq, &ctrl->ka_work, ctrl->kato *HZ ); }static void nvmet_clear_ctrl (struct nvmet_ctrl *ctrl)
drivers/pci/controller/pcie-iproc-msi.c +9 -4
@@ -209,15 +209,20 @@ static int iproc_msi_irq_set_affinity(struct irq_data *data,struct iproc_msi *msi =irq_data_get_irq_chip_data (data);int target_cpu =cpumask_first (mask);int curr_cpu; +int ret; curr_cpu =hwirq_to_cpu (msi, data->hwirq);if (curr_cpu == target_cpu) -return IRQ_SET_MASK_OK_DONE ; + ret =IRQ_SET_MASK_OK_DONE ; +else { +/* steer MSI to the target CPU */ + data->hwirq =hwirq_to_canonical_hwirq (msi, data->hwirq) + target_cpu; + ret =IRQ_SET_MASK_OK ; + } -/* steer MSI to the target CPU */ - data->hwirq =hwirq_to_canonical_hwirq (msi, data->hwirq) + target_cpu; +irq_data_update_effective_affinity (data,cpumask_of (target_cpu)); -return IRQ_SET_MASK_OK ; +return ret; } static void iproc_msi_irq_compose_msi_msg(struct irq_data *data,
drivers/pwm/pwm-img.c +2 -1
@@ -280,6 +280,8 @@ static int img_pwm_probe(struct platform_device *pdev)return PTR_ERR (pwm->pwm_clk); } +platform_set_drvdata (pdev, pwm); +pm_runtime_set_autosuspend_delay (&pdev->dev,IMG_PWM_PM_TIMEOUT );pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_enable (&pdev->dev);
@@ -316,7 +318,6 @@ static int img_pwm_probe(struct platform_device *pdev) goto err_suspend; } -platform_set_drvdata (pdev, pwm);return 0 ; err_suspend:
drivers/rapidio/devices/rio_mport_cdev.c +11 -7
@@ -875,15 +875,16 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode,rmcd_error ("get_user_pages_unlocked err=%ld" , pinned); nr_pages =0 ; - }else + }else {rmcd_error ("pinned %ld out of %ld pages" , pinned, nr_pages); +/* +* Set nr_pages up to mean "how many pages to unpin, in +* the error handler: +*/ + nr_pages = pinned; + } ret = -EFAULT ; -/* -* Set nr_pages up to mean "how many pages to unpin, in -* the error handler: -*/ - nr_pages = pinned; goto err_pg; }
@@ -1684,6 +1685,7 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,struct rio_dev *rdev;struct rio_switch *rswitch =NULL ;struct rio_mport *mport; +struct device *dev;size_t size;u32 rval;u32 swpinfo =0 ;
@@ -1698,8 +1700,10 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,rmcd_debug (RDEV ,"name:%s ct:0x%x did:0x%x hc:0x%x" , dev_info.name, dev_info.comptag, dev_info.destid, dev_info.hopcount); -if (bus_find_device_by_name (&rio_bus_type,NULL , dev_info.name)) { + dev =bus_find_device_by_name (&rio_bus_type,NULL , dev_info.name); +if (dev) {rmcd_debug (RDEV ,"device %s already exists" , dev_info.name); +put_device (dev);return -EEXIST ; }
drivers/rpmsg/qcom_smd.c +22 -10
@@ -1338,7 +1338,7 @@ static int qcom_smd_parse_edge(struct device *dev, ret =of_property_read_u32 (node, key, &edge->edge_id);if (ret) {dev_err (dev,"edge missing %s property\n" , key); -return -EINVAL ; + goto put_node; } edge->remote_pid =QCOM_SMEM_HOST_ANY ;
@@ -1349,32 +1349,37 @@ static int qcom_smd_parse_edge(struct device *dev, edge->mbox_client.knows_txdone = true; edge->mbox_chan =mbox_request_channel (&edge->mbox_client,0 );if (IS_ERR (edge->mbox_chan)) { -if (PTR_ERR (edge->mbox_chan) != -ENODEV ) -return PTR_ERR (edge->mbox_chan); +if (PTR_ERR (edge->mbox_chan) != -ENODEV ) { + ret =PTR_ERR (edge->mbox_chan); + goto put_node; + } edge->mbox_chan =NULL ; syscon_np =of_parse_phandle (node,"qcom,ipc" ,0 );if (!syscon_np) {dev_err (dev,"no qcom,ipc node\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto put_node; } edge->ipc_regmap =syscon_node_to_regmap (syscon_np); -if (IS_ERR (edge->ipc_regmap)) -return PTR_ERR (edge->ipc_regmap); +if (IS_ERR (edge->ipc_regmap)) { + ret =PTR_ERR (edge->ipc_regmap); + goto put_node; + } key ="qcom,ipc" ; ret =of_property_read_u32_index (node, key,1 , &edge->ipc_offset);if (ret <0 ) {dev_err (dev,"no offset in %s\n" , key); -return -EINVAL ; + goto put_node; } ret =of_property_read_u32_index (node, key,2 , &edge->ipc_bit);if (ret <0 ) {dev_err (dev,"no bit in %s\n" , key); -return -EINVAL ; + goto put_node; } }
@@ -1385,7 +1390,8 @@ static int qcom_smd_parse_edge(struct device *dev, irq =irq_of_parse_and_map (node,0 );if (irq <0 ) {dev_err (dev,"required smd interrupt missing\n" ); -return -EINVAL ; + ret = irq; + goto put_node; } ret = devm_request_irq(dev, irq,
@@ -1393,12 +1399,18 @@ static int qcom_smd_parse_edge(struct device *dev, node->name, edge);if (ret) {dev_err (dev,"failed to request smd irq\n" ); -return ret; + goto put_node; } edge->irq = irq;return 0 ; + +put_node: +of_node_put (node); + edge->of_node =NULL ; + +return ret; }/*
drivers/scsi/ibmvscsi/ibmvfc.c +1 -0
@@ -4795,6 +4795,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)if (IS_ERR (vhost->work_thread)) {dev_err (dev,"Couldn't create kernel thread: %ld\n" ,PTR_ERR (vhost->work_thread)); + rc =PTR_ERR (vhost->work_thread); goto free_host_mem; }
drivers/scsi/mvumi.c +1 -0
@@ -2439,6 +2439,7 @@ static int mvumi_io_attach(struct mvumi_hba *mhba)if (IS_ERR (mhba->dm_thread)) {dev_err (&mhba->pdev->dev,"failed to create device scan thread\n" ); + ret =PTR_ERR (mhba->dm_thread);mutex_unlock (&mhba->sas_discovery_mutex); goto fail_create_thread; }
drivers/scsi/qedi/qedi_fw.c +19 -4
@@ -62,6 +62,7 @@ static void qedi_process_logout_resp(struct qedi_ctx *qedi,"Freeing tid=0x%x for cid=0x%x\n" , cmd->task_id, qedi_conn->iscsi_conn_id); +spin_lock (&qedi_conn->list_lock);if (likely (cmd->io_cmd_in_list)) { cmd->io_cmd_in_list = false;list_del_init (&cmd->io_cmd);
@@ -72,6 +73,7 @@ static void qedi_process_logout_resp(struct qedi_ctx *qedi, cmd->task_id, qedi_conn->iscsi_conn_id, &cmd->io_cmd); } +spin_unlock (&qedi_conn->list_lock); cmd->state =RESPONSE_RECEIVED ;qedi_clear_task_idx (qedi, cmd->task_id);
@@ -125,6 +127,7 @@ static void qedi_process_text_resp(struct qedi_ctx *qedi,"Freeing tid=0x%x for cid=0x%x\n" , cmd->task_id, qedi_conn->iscsi_conn_id); +spin_lock (&qedi_conn->list_lock);if (likely (cmd->io_cmd_in_list)) { cmd->io_cmd_in_list = false;list_del_init (&cmd->io_cmd);
@@ -135,6 +138,7 @@ static void qedi_process_text_resp(struct qedi_ctx *qedi, cmd->task_id, qedi_conn->iscsi_conn_id, &cmd->io_cmd); } +spin_unlock (&qedi_conn->list_lock); cmd->state =RESPONSE_RECEIVED ;qedi_clear_task_idx (qedi, cmd->task_id);
@@ -227,11 +231,13 @@ static void qedi_process_tmf_resp(struct qedi_ctx *qedi, tmf_hdr = (struct iscsi_tm *)qedi_cmd->task->hdr; +spin_lock (&qedi_conn->list_lock);if (likely (qedi_cmd->io_cmd_in_list)) { qedi_cmd->io_cmd_in_list = false;list_del_init (&qedi_cmd->io_cmd); qedi_conn->active_cmd_count--; } +spin_unlock (&qedi_conn->list_lock); if (((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == ISCSI_TM_FUNC_LOGICAL_UNIT_RESET) ||
@@ -293,11 +299,13 @@ static void qedi_process_login_resp(struct qedi_ctx *qedi,ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK ; qedi_conn->gen_pdu.resp_wr_ptr = qedi_conn->gen_pdu.resp_buf + pld_len; +spin_lock (&qedi_conn->list_lock);if (likely (cmd->io_cmd_in_list)) { cmd->io_cmd_in_list = false;list_del_init (&cmd->io_cmd); qedi_conn->active_cmd_count--; } +spin_unlock (&qedi_conn->list_lock);memset (task_ctx,'\0' ,sizeof (*task_ctx));
@@ -829,8 +837,11 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi,qedi_clear_task_idx (qedi_conn->qedi, rtid);spin_lock (&qedi_conn->list_lock); -list_del_init (&dbg_cmd->io_cmd); - qedi_conn->active_cmd_count--; +if (likely (dbg_cmd->io_cmd_in_list)) { + dbg_cmd->io_cmd_in_list = false; +list_del_init (&dbg_cmd->io_cmd); + qedi_conn->active_cmd_count--; + }spin_unlock (&qedi_conn->list_lock); qedi_cmd->state =CLEANUP_RECV ;wake_up_interruptible (&qedi_conn->wait_queue);
@@ -1249,6 +1260,7 @@ int qedi_cleanup_all_io(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn, qedi_conn->cmd_cleanup_req++;qedi_iscsi_cleanup_task (ctask, true); + cmd->io_cmd_in_list = false;list_del_init (&cmd->io_cmd); qedi_conn->active_cmd_count--; QEDI_WARN(&qedi->dbg_ctx,
@@ -1462,8 +1474,11 @@ static void qedi_tmf_work(struct work_struct *work)spin_unlock_bh (&qedi_conn->tmf_work_lock);spin_lock (&qedi_conn->list_lock); -list_del_init (&cmd->io_cmd); - qedi_conn->active_cmd_count--; +if (likely (cmd->io_cmd_in_list)) { + cmd->io_cmd_in_list = false; +list_del_init (&cmd->io_cmd); + qedi_conn->active_cmd_count--; + }spin_unlock (&qedi_conn->list_lock);clear_bit (QEDI_CONN_FW_CLEANUP , &qedi_conn->flags);
drivers/scsi/qedi/qedi_iscsi.c +2 -0
@@ -976,11 +976,13 @@ static void qedi_cleanup_active_cmd_list(struct qedi_conn *qedi_conn) {struct qedi_cmd *cmd, *cmd_tmp; +spin_lock (&qedi_conn->list_lock);list_for_each_entry_safe (cmd, cmd_tmp, &qedi_conn->active_cmd_list, io_cmd) {list_del_init (&cmd->io_cmd); qedi_conn->active_cmd_count--; } +spin_unlock (&qedi_conn->list_lock); }static void qedi_ep_disconnect (struct iscsi_endpoint *ep)
drivers/scsi/ufs/ufs-qcom.c +0 -5
@@ -1581,9 +1581,6 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)*/ } mask <<= offset; - -pm_runtime_get_sync (host->hba->dev); -ufshcd_hold (host->hba, false);ufshcd_rmwl (host->hba,TEST_BUS_SEL , (u32 )host->testbus.select_major <<19 ,REG_UFS_CFG1 );
@@ -1596,8 +1593,6 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)* committed before returning. */ mb (); -ufshcd_release (host->hba); -pm_runtime_put_sync (host->hba->dev);return 0 ; }
drivers/tty/ipwireless/network.c +2 -2
@@ -117,7 +117,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, skb->len, notify_packet_sent, network); -if (ret ==-1 ) { +if (ret <0 ) {skb_pull (skb,2 );return 0 ; }
@@ -134,7 +134,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, notify_packet_sent, network);kfree (buf); -if (ret ==-1 ) +if (ret <0 )return 0 ; }kfree_skb (skb);
drivers/tty/ipwireless/tty.c +1 -1
@@ -218,7 +218,7 @@ static int ipw_write(struct tty_struct *linux_tty, ret =ipwireless_send_packet (tty->hardware,IPW_CHANNEL_RAS , buf, count, ipw_write_packet_sent_callback, tty); -if (ret ==-1 ) { +if (ret <0 ) {mutex_unlock (&tty->ipw_tty_mutex);return 0 ; }
drivers/tty/serial/fsl_lpuart.c +1 -1
@@ -563,7 +563,7 @@ static void lpuart32_poll_put_char(struct uart_port *port, unsigned char c)static int lpuart32_poll_get_char (struct uart_port *port) { -if (!(lpuart32_read (port,UARTSTAT ) &UARTSTAT_RDRF )) +if (!(lpuart32_read (port,UARTWATER ) >>UARTWATER_RXCNT_OFF ))return NO_POLL_CHAR ;return lpuart32_read (port,UARTDATA );
drivers/usb/class/cdc-acm.c +23 -0
@@ -1275,9 +1275,21 @@ static int acm_probe(struct usb_interface *intf, } } }else { +int class =-1 ; + data_intf_num = union_header->bSlaveInterface0; control_interface =usb_ifnum_to_if (usb_dev, union_header->bMasterInterface0); data_interface =usb_ifnum_to_if (usb_dev, data_intf_num); + +if (control_interface) + class = control_interface->cur_altsetting->desc.bInterfaceClass; + +if (class !=USB_CLASS_COMM && class !=USB_CLASS_CDC_DATA ) { +dev_dbg (&intf->dev,"Broken union descriptor, assuming single interface\n" ); + combined_interfaces =1 ; + control_interface = data_interface = intf; + goto look_for_collapsed_interface; + } }if (!control_interface || !data_interface) {
@@ -1932,6 +1944,17 @@ static const struct usb_device_id acm_ids[] = { .driver_info = IGNORE_DEVICE, }, +/* Exclude ETAS ES58x */ + { USB_DEVICE(0x108c, 0x0159), /* ES581.4 */ + .driver_info =IGNORE_DEVICE , + }, + { USB_DEVICE(0x108c, 0x0168), /* ES582.1 */ + .driver_info = IGNORE_DEVICE, + }, + { USB_DEVICE(0x108c, 0x0169), /* ES584.1 */ + .driver_info = IGNORE_DEVICE, + }, + { USB_DEVICE(0x1bc7, 0x0021), /* Telit 3G ACM only composition */ .driver_info = SEND_ZERO_PACKET, },
drivers/usb/class/cdc-wdm.c +55 -17
114 lines not on this page · raw message
drivers/usb/core/urb.c +54 -35
120 lines not on this page · raw message
drivers/usb/dwc3/dwc3-of-simple.c +1 -0
@@ -243,6 +243,7 @@ static const struct of_device_id of_dwc3_simple_match[] = { { .compatible = "amlogic,meson-axg-dwc3" }, { .compatible = "amlogic,meson-gxl-dwc3" }, { .compatible = "allwinner,sun50i-h6-dwc3" }, + { .compatible = "hisilicon,hi3670-dwc3" }, {/* Sentinel */ } };MODULE_DEVICE_TABLE (of, of_dwc3_simple_match);
drivers/usb/gadget/function/f_ncm.c +1 -1
@@ -1523,7 +1523,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) fs_ncm_notify_desc.bEndpointAddress; status =usb_assign_descriptors (f, ncm_fs_function, ncm_hs_function, - ncm_ss_function,NULL ); + ncm_ss_function, ncm_ss_function);if (status) goto fail;
drivers/usb/gadget/function/f_printer.c +14 -2
@@ -31,6 +31,7 @@#include <linux/types.h> #include <linux/ctype.h> #include <linux/cdev.h> +#include <linux/kref.h> #include <asm/byteorder.h> #include <linux/io.h>
@@ -64,7 +65,7 @@ struct printer_dev {struct usb_gadget *gadget;s8 interface;struct usb_ep *in_ep, *out_ep; - +struct kref kref;struct list_head rx_reqs;/* List of free RX structs */ struct list_head rx_reqs_active;/* List of Active RX xfers */ struct list_head rx_buffers;/* List of completed xfers */
@@ -218,6 +219,13 @@ static inline struct usb_endpoint_descriptor *ep_desc(struct usb_gadget *gadget,/*-------------------------------------------------------------------------*/ +static void printer_dev_free (struct kref *kref) +{ + struct printer_dev *dev = container_of(kref, struct printer_dev, kref); + +kfree (dev); +} +static struct usb_request *printer_req_alloc (struct usb_ep *ep,unsigned len,gfp_t gfp_flags) {
@@ -348,6 +356,7 @@ printer_open(struct inode *inode, struct file *fd)spin_unlock_irqrestore (&dev->lock, flags); +kref_get (&dev->kref);DBG (dev,"printer_open returned %x\n" , ret);return ret; }
@@ -365,6 +374,7 @@ printer_close(struct inode *inode, struct file *fd) dev->printer_status &= ~PRINTER_SELECTED ;spin_unlock_irqrestore (&dev->lock, flags); +kref_put (&dev->kref, printer_dev_free);DBG (dev,"printer_close\n" );return 0 ;
@@ -1350,7 +1360,8 @@ static void gprinter_free(struct usb_function *f)struct f_printer_opts *opts; opts = container_of(f->fi, struct f_printer_opts, func_inst); -kfree (dev); + +kref_put (&dev->kref, printer_dev_free);mutex_lock (&opts->lock); --opts->refcnt;mutex_unlock (&opts->lock);
@@ -1419,6 +1430,7 @@ static struct usb_function *gprinter_alloc(struct usb_function_instance *fi)return ERR_PTR (-ENOMEM ); } +kref_init (&dev->kref); ++opts->refcnt; dev->minor = opts->minor; dev->pnp_string = opts->pnp_string;
drivers/usb/host/ohci-hcd.c +10 -6
@@ -665,20 +665,24 @@ static int ohci_run (struct ohci_hcd *ohci)/* handle root hub init quirks ... */ val =roothub_a (ohci); - val &= ~(RH_A_PSM |RH_A_OCPM ); +/* Configure for per-port over-current protection by default */ + val &= ~RH_A_NOCP ; + val |=RH_A_OCPM ;if (ohci->flags &OHCI_QUIRK_SUPERIO ) { -/* NSC 87560 and maybe others */ +/* NSC 87560 and maybe others. +* Ganged power switching, no over-current protection. +*/ val |=RH_A_NOCP ; - val &= ~(RH_A_POTPGT |RH_A_NPS ); -ohci_writel (ohci, val, &ohci->regs->roothub.a); + val &= ~(RH_A_POTPGT |RH_A_NPS |RH_A_PSM |RH_A_OCPM ); }else if ((ohci->flags &OHCI_QUIRK_AMD756 ) || (ohci->flags &OHCI_QUIRK_HUB_POWER )) {/* hub power always on; required for AMD-756 and some -* Mac platforms. ganged overcurrent reporting, if any. +* Mac platforms. */ val |=RH_A_NPS ; -ohci_writel (ohci, val, &ohci->regs->roothub.a); } +ohci_writel (ohci, val, &ohci->regs->roothub.a); +ohci_writel (ohci,RH_HS_LPSC , &ohci->regs->roothub.status);ohci_writel (ohci, (val &RH_A_NPS ) ?0 :RH_B_PPCM , &ohci->regs->roothub.b);
drivers/vfio/pci/vfio_pci_intrs.c +3 -1
@@ -355,11 +355,13 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev, vdev->ctx[vector].producer.token = trigger; vdev->ctx[vector].producer.irq = irq; ret =irq_bypass_register_producer (&vdev->ctx[vector].producer); -if (unlikely (ret)) +if (unlikely (ret)) {dev_info (&pdev->dev,"irq bypass producer (token %p) registration fails: %d\n" , vdev->ctx[vector].producer.token, ret); + vdev->ctx[vector].producer.token =NULL ; + } vdev->ctx[vector].trigger = trigger;return 0 ;
drivers/vfio/vfio_iommu_type1.c +2 -1
@@ -636,7 +636,8 @@ static int vfio_iommu_type1_pin_pages(void *iommu_data, ret =vfio_add_to_pfn_list (dma, iova, phys_pfn[i]);if (ret) { -vfio_unpin_page_external (dma, iova, do_accounting); +if (put_pfn (phys_pfn[i], dma->prot) && do_accounting) +vfio_lock_acct (dma,-1 , true); goto pin_unwind; } }
drivers/watchdog/sp5100_tco.h +1 -1
@@ -70,7 +70,7 @@#define EFCH_PM_DECODEEN_WDT_TMREN BIT(7) -#define EFCH_PM_DECODEEN3 0x00 +#define EFCH_PM_DECODEEN3 0x03#define EFCH_PM_DECODEEN_SECOND_RES GENMASK(1, 0)#define EFCH_PM_WATCHDOG_DISABLE ((u8)GENMASK(3, 2))
drivers/watchdog/watchdog_dev.c +4 -2
@@ -944,8 +944,10 @@ static int watchdog_cdev_register(struct watchdog_device *wdd) wd_data->wdd = wdd; wdd->wd_data = wd_data; -if (IS_ERR_OR_NULL (watchdog_kworker)) +if (IS_ERR_OR_NULL (watchdog_kworker)) { +kfree (wd_data);return -ENODEV ; + }device_initialize (&wd_data->dev); wd_data->dev.devt =MKDEV (MAJOR (watchdog_devt), wdd->id);
@@ -971,7 +973,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)pr_err ("%s: a legacy watchdog module is probably present.\n" , wdd->info->identity); old_wd_data =NULL ; -kfree (wd_data); +put_device (&wd_data->dev);return err; } }
fs/dlm/config.c +3 -0
@@ -218,6 +218,7 @@ struct dlm_space {struct list_head members;struct mutex members_lock;int members_count; +struct dlm_nodes *nds; };struct dlm_comms {
@@ -426,6 +427,7 @@ static struct config_group *make_space(struct config_group *g, const char *name)INIT_LIST_HEAD (&sp->members);mutex_init (&sp->members_lock); sp->members_count =0 ; + sp->nds = nds;return &sp->group; fail:
@@ -447,6 +449,7 @@ static void drop_space(struct config_group *g, struct config_item *i)static void release_space (struct config_item *i) {struct dlm_space *sp =config_item_to_space (i); +kfree (sp->nds);kfree (sp); }
fs/ext4/fsmap.c +3 -0
@@ -108,6 +108,9 @@ static int ext4_getfsmap_helper(struct super_block *sb,/* Are we just counting mappings? */ if (info->gfi_head->fmh_count ==0 ) { +if (info->gfi_head->fmh_entries ==UINT_MAX ) +return EXT4_QUERY_RANGE_ABORT ; +if (rec_fsblk > info->gfi_next_fsblk) info->gfi_head->fmh_entries++;
fs/f2fs/sysfs.c +1 -0
@@ -717,4 +717,5 @@ void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi) }kobject_del (&sbi->s_kobj);kobject_put (&sbi->s_kobj); +wait_for_completion (&sbi->s_kobj_unregister); }
fs/ntfs/inode.c +6 -0
@@ -1835,6 +1835,12 @@ int ntfs_read_inode_mount(struct inode *vi)brelse (bh); } +if (le32_to_cpu (m->bytes_allocated) != vol->mft_record_size) { +ntfs_error (sb,"Incorrect mft record size %u in superblock, should be %u." , +le32_to_cpu (m->bytes_allocated), vol->mft_record_size); + goto err_out; + } +/* Apply the mst fixups. */ if (post_read_mst_fixup ((NTFS_RECORD *)m, vol->mft_record_size)) {/* FIXME: Try to use the $MFTMirr now. */
fs/ramfs/file-nommu.c +1 -1
@@ -228,7 +228,7 @@ static unsigned long ramfs_nommu_get_unmapped_area(struct file *file,if (!pages) goto out_free; - nr =find_get_pages (inode->i_mapping, &pgoff, lpages, pages); + nr =find_get_pages_contig (inode->i_mapping, pgoff, lpages, pages);if (nr != lpages) goto out_free_pages;/* leave if some pages were missing */
fs/reiserfs/inode.c +2 -1
@@ -2161,7 +2161,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, out_inserted_sd:clear_nlink (inode); th->t_trans_id =0 ;/* so the caller can't use this handle later */ -unlock_new_inode (inode);/* OK to do even if we hadn't locked it */ +if (inode->i_state &I_NEW ) +unlock_new_inode (inode);iput (inode);return err; }
fs/reiserfs/super.c +4 -4
@@ -1264,6 +1264,10 @@ static int reiserfs_parse_options(struct super_block *s, "turned on.");return 0 ; } +if (qf_names[qtype] != +REISERFS_SB (s)->s_qf_names[qtype]) +kfree (qf_names[qtype]); + qf_names[qtype] =NULL ; if (*arg) { /* Some filename specified? */ if (REISERFS_SB(s)->s_qf_names[qtype] && strcmp(REISERFS_SB(s)->s_qf_names[qtype],
@@ -1293,10 +1297,6 @@ static int reiserfs_parse_options(struct super_block *s,else *mount_options |=1 <<REISERFS_GRPQUOTA ; }else { -if (qf_names[qtype] != -REISERFS_SB (s)->s_qf_names[qtype]) -kfree (qf_names[qtype]); - qf_names[qtype] =NULL ;if (qtype ==USRQUOTA ) *mount_options &= ~(1 <<REISERFS_USRQUOTA );else
fs/udf/inode.c +14 -11
@@ -132,21 +132,24 @@ void udf_evict_inode(struct inode *inode)struct udf_inode_info *iinfo =UDF_I (inode);int want_delete =0 ; -if (!inode->i_nlink && !is_bad_inode (inode)) { - want_delete =1 ; -udf_setsize (inode,0 ); -udf_update_inode (inode,IS_SYNC (inode)); +if (!is_bad_inode (inode)) { +if (!inode->i_nlink) { + want_delete =1 ; +udf_setsize (inode,0 ); +udf_update_inode (inode,IS_SYNC (inode)); + } +if (iinfo->i_alloc_type !=ICBTAG_FLAG_AD_IN_ICB && + inode->i_size != iinfo->i_lenExtents) { +udf_warn (inode->i_sb, +"Inode %lu (mode %o) has inode size %llu different from extent length %llu. Filesystem need not be standards compliant.\n" , + inode->i_ino, inode->i_mode, + (unsigned long long )inode->i_size, + (unsigned long long )iinfo->i_lenExtents); + } }truncate_inode_pages_final (&inode->i_data);invalidate_inode_buffers (inode);clear_inode (inode); -if (iinfo->i_alloc_type !=ICBTAG_FLAG_AD_IN_ICB && - inode->i_size != iinfo->i_lenExtents) { -udf_warn (inode->i_sb,"Inode %lu (mode %o) has inode size %llu different from extent length %llu. Filesystem need not be standards compliant.\n" , - inode->i_ino, inode->i_mode, - (unsigned long long )inode->i_size, - (unsigned long long )iinfo->i_lenExtents); - }kfree (iinfo->i_ext.i_data); iinfo->i_ext.i_data =NULL ;udf_clear_extent_cache (inode);
fs/udf/super.c +6 -0
@@ -1349,6 +1349,12 @@ static int udf_load_sparable_map(struct super_block *sb, (int)spm->numSparingTables);return -EIO ; } +if (le32_to_cpu (spm->sizeSparingTable) > sb->s_blocksize) { +udf_err (sb,"error loading logical volume descriptor: " +"Too big sparing table size (%u)\n" , +le32_to_cpu (spm->sizeSparingTable)); +return -EIO ; + }for (i =0 ; i < spm->numSparingTables; i++) { loc =le32_to_cpu (spm->locSparingTable[i]);
fs/xfs/xfs_rtalloc.c +11 -0
@@ -245,6 +245,9 @@ xfs_rtallocate_extent_block( end =XFS_BLOCKTOBIT (mp, bbno +1 ) -1 ; i <= end; i++) { +/* Make sure we don't scan off the end of the rt volume. */ + maxlen =min (mp->m_sb.sb_rextents, i + maxlen) - i; +/* * See if there's a free extent of maxlen starting at i. * If it's not so then next will contain the first non-free.
@@ -440,6 +443,14 @@ xfs_rtallocate_extent_near(*/ if (bno >= mp->m_sb.sb_rextents) bno = mp->m_sb.sb_rextents -1 ; + +/* Make sure we don't run off the end of the rt volume. */ + maxlen =min (mp->m_sb.sb_rextents, bno + maxlen) - bno; +if (maxlen < minlen) { + *rtblock =NULLRTBLOCK ; +return 0 ; + } +/* * Try the exact allocation first. */
include/linux/overflow.h +1 -0
@@ -3,6 +3,7 @@#define __LINUX_OVERFLOW_H#include <linux/compiler.h> +#include <linux/limits.h> /* * In the fallback code below, we need to compute the minimum and
include/scsi/scsi_common.h +7 -0
@@ -25,6 +25,13 @@ scsi_command_size(const unsigned char *cmnd) scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]); } +static inline unsigned char +scsi_command_control (const unsigned char *cmnd) +{ +return (cmnd[0 ] ==VARIABLE_LENGTH_CMD ) ? + cmnd[1 ] : cmnd[COMMAND_SIZE (cmnd[0 ]) -1 ]; +} +/* Returns a human-readable name for the device */ extern const char *scsi_device_type (unsigned type);
include/trace/events/target.h +6 -6
@@ -140,6 +140,7 @@ TRACE_EVENT(target_sequencer_start, __field( unsigned int, opcode ) __field( unsigned int, data_length ) __field( unsigned int, task_attribute ) + __field( unsigned char, control ) __array( unsigned char, cdb, TCM_MAX_COMMAND_SIZE ) __string( initiator, cmd->se_sess->se_node_acl->initiatorname ) ),
@@ -149,6 +150,7 @@ TRACE_EVENT(target_sequencer_start, __entry->opcode = cmd->t_task_cdb[0 ]; __entry->data_length = cmd->data_length; __entry->task_attribute = cmd->sam_task_attr; + __entry->control =scsi_command_control (cmd->t_task_cdb);memcpy (__entry->cdb, cmd->t_task_cdb,TCM_MAX_COMMAND_SIZE );__assign_str (initiator, cmd->se_sess->se_node_acl->initiatorname); ),
@@ -158,9 +160,7 @@ TRACE_EVENT(target_sequencer_start,show_opcode_name (__entry->opcode), __entry->data_length,__print_hex (__entry->cdb,16 ),show_task_attribute_name (__entry->task_attribute), -scsi_command_size (__entry->cdb) <=16 ? - __entry->cdb[scsi_command_size (__entry->cdb) -1 ] : - __entry->cdb[1 ] + __entry->control ) );
@@ -175,6 +175,7 @@ TRACE_EVENT(target_cmd_complete, __field( unsigned int, opcode ) __field( unsigned int, data_length ) __field( unsigned int, task_attribute ) + __field( unsigned char, control ) __field( unsigned char, scsi_status ) __field( unsigned char, sense_length ) __array( unsigned char, cdb, TCM_MAX_COMMAND_SIZE )
@@ -187,6 +188,7 @@ TRACE_EVENT(target_cmd_complete, __entry->opcode = cmd->t_task_cdb[0 ]; __entry->data_length = cmd->data_length; __entry->task_attribute = cmd->sam_task_attr; + __entry->control =scsi_command_control (cmd->t_task_cdb); __entry->scsi_status = cmd->scsi_status; __entry->sense_length = cmd->scsi_status ==SAM_STAT_CHECK_CONDITION ?min (18 , ((u8 *) cmd->sense_buffer)[SPC_ADD_SENSE_LEN_OFFSET ] +8 ) :0 ;
@@ -203,9 +205,7 @@ TRACE_EVENT(target_cmd_complete,show_opcode_name (__entry->opcode), __entry->data_length,__print_hex (__entry->cdb,16 ),show_task_attribute_name (__entry->task_attribute), -scsi_command_size (__entry->cdb) <=16 ? - __entry->cdb[scsi_command_size (__entry->cdb) -1 ] : - __entry->cdb[1 ] + __entry->control ) );
include/uapi/linux/perf_event.h +1 -1
@@ -1079,7 +1079,7 @@ union perf_mem_data_src {#define PERF_MEM_SNOOPX_FWD 0x01/* forward */ /* 1 free */ -#define PERF_MEM_SNOOPX_SHIFT 37 +#define PERF_MEM_SNOOPX_SHIFT 38/* locked instruction */ #define PERF_MEM_LOCK_NA 0x01/* not available */
kernel/debug/kdb/kdb_io.c +6 -2
@@ -679,12 +679,16 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap) size_avail =sizeof (kdb_buffer) - len; goto kdb_print_out; } -if (kdb_grepping_flag >=KDB_GREPPING_FLAG_SEARCH ) +if (kdb_grepping_flag >=KDB_GREPPING_FLAG_SEARCH ) {/* * This was a interactive search (using '/' at more -* prompt) and it has completed. Clear the flag. +* prompt) and it has completed. Replace the \0 with +* its original value to ensure multi-line strings +* are handled properly, and return to normal mode. */ + *cphold = replaced_byte; kdb_grepping_flag =0 ; + }/* * at this point the string is a full line and * should be printed, up to the null.
kernel/power/hibernate.c +0 -11
@@ -842,17 +842,6 @@ static int software_resume(void)/* Check if the device is there */ swsusp_resume_device =name_to_dev_t (resume_file); - -/* -* name_to_dev_t is ineffective to verify parition if resume_file is in -* integer format. (e.g. major:minor) -*/ -if (isdigit (resume_file[0 ]) && resume_wait) { -int partno; -while (!get_gendisk (swsusp_resume_device, &partno)) -msleep (10 ); - } -if (!swsusp_resume_device) {/* * Some device discovery might still be in progress; we need
kernel/sched/core.c +1 -1
@@ -24,7 +24,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); -#if defined(CONFIG_SCHED_DEBUG ) && defined(CONFIG_JUMP_LABEL ) +#ifdef CONFIG_SCHED_DEBUG /* * Debugging: various feature bits *
kernel/sched/sched.h +10 -3
@@ -1361,7 +1361,7 @@ enum {#undef SCHED_FEAT -#if defined(CONFIG_SCHED_DEBUG ) && defined(CONFIG_JUMP_LABEL ) +#ifdef CONFIG_SCHED_DEBUG /* * To support run-time toggling of sched features, all the translation units
@@ -1369,6 +1369,7 @@ enum {*/ extern const_debug unsigned int sysctl_sched_features; +#ifdef CONFIG_JUMP_LABEL #define SCHED_FEAT (name, enabled) \ static __always_inline bool static_branch_##name(struct static_key *key) \ { \
@@ -1381,7 +1382,13 @@ static __always_inline bool static_branch_##name(struct static_key *key) \extern struct static_key sched_feat_keys[__SCHED_FEAT_NR];#define sched_feat (x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x])) -#else /* !(SCHED_DEBUG && CONFIG_JUMP_LABEL) */ +#else /* !CONFIG_JUMP_LABEL */ + +#define sched_feat (x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) + +#endif /* CONFIG_JUMP_LABEL */ + +#else /* !SCHED_DEBUG */ /* * Each translation unit has its own copy of sysctl_sched_features to allow
@@ -1397,7 +1404,7 @@ static const_debug __maybe_unused unsigned int sysctl_sched_features =#define sched_feat (x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) -#endif /* SCHED_DEBUG && CONFIG_JUMP_LABEL */ +#endif /* SCHED_DEBUG */ extern struct static_key_false sched_numa_balancing;extern struct static_key_false sched_schedstats;
lib/crc32.c +1 -1
@@ -328,7 +328,7 @@ static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p,return crc; } -#if CRC_LE_BITS ==1 +#if CRC_BE_BITS ==1 u32 __pure crc32_be (u32 crc,unsigned char const *p,size_t len) {return crc32_be_generic (crc, p, len,NULL ,CRC32_POLY_BE );
net/bluetooth/l2cap_sock.c +4 -3
@@ -1341,8 +1341,6 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err) parent =bt_sk (sk)->parent; -sock_set_flag (sk,SOCK_ZAPPED ); -switch (chan->state) {case BT_OPEN :case BT_BOUND :
@@ -1369,8 +1367,11 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err)break ; } -release_sock (sk); + +/* Only zap after cleanup to avoid use after free race */ +sock_set_flag (sk,SOCK_ZAPPED ); + } static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state,
net/ipv4/ip_gre.c +11 -4
@@ -680,9 +680,7 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, }if (dev->header_ops) { -/* Need space for new headers */ -if (skb_cow_head (skb, dev->needed_headroom - - (tunnel->hlen +sizeof (struct iphdr )))) +if (skb_cow_head (skb,0 )) goto free_skb; tnl_params = (const struct iphdr *)skb->data;
@@ -800,7 +798,11 @@ static void ipgre_link_update(struct net_device *dev, bool set_mtu) len = tunnel->tun_hlen - len; tunnel->hlen = tunnel->hlen + len; - dev->needed_headroom = dev->needed_headroom + len; +if (dev->header_ops) + dev->hard_header_len += len; +else + dev->needed_headroom += len; +if (set_mtu) dev->mtu =max_t (int, dev->mtu - len,68 );
@@ -1003,6 +1005,7 @@ static void __gre_tunnel_init(struct net_device *dev) tunnel->parms.iph.protocol =IPPROTO_GRE ; tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; + dev->needed_headroom = tunnel->hlen +sizeof (tunnel->parms.iph); dev->features |=GRE_FEATURES ; dev->hw_features |=GRE_FEATURES ;
@@ -1046,10 +1049,14 @@ static int ipgre_tunnel_init(struct net_device *dev)return -EINVAL ; dev->flags =IFF_BROADCAST ; dev->header_ops = &ipgre_header_ops; + dev->hard_header_len = tunnel->hlen +sizeof (*iph); + dev->needed_headroom = 0; }#endif }else if (!tunnel->collect_md) { dev->header_ops = &ipgre_header_ops; + dev->hard_header_len = tunnel->hlen +sizeof (*iph); + dev->needed_headroom =0 ; }return ip_tunnel_init (dev);
net/mac80211/cfg.c +2 -1
@@ -664,7 +664,8 @@ void sta_set_rate_info_tx(struct sta_info *sta,u16 brate; sband =ieee80211_get_sband (sta->sdata); -if (sband) { +WARN_ON_ONCE (sband && !sband->bitrates); +if (sband && sband->bitrates) { brate = sband->bitrates[rate->idx].bitrate; rinfo->legacy =DIV_ROUND_UP (brate,1 << shift); }
net/mac80211/sta_info.c +4 -0
@@ -2009,6 +2009,10 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u32 rate,int rate_idx =STA_STATS_GET (LEGACY_IDX , rate); sband = local->hw.wiphy->bands[band]; + +if (WARN_ON_ONCE (!sband->bitrates)) +break ; + brate = sband->bitrates[rate_idx].bitrate;if (rinfo->bw ==RATE_INFO_BW_5 ) shift =2 ;
net/netfilter/ipvs/ip_vs_ctl.c +4 -3
@@ -2393,6 +2393,10 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)/* Set timeout values for (tcp tcpfin udp) */ ret =ip_vs_set_timeout (ipvs, (struct ip_vs_timeout_user *)arg); goto out_unlock; + }else if (!len) { +/* No more commands with len == 0 below */ + ret = -EINVAL ; + goto out_unlock; } usvc_compat = (struct ip_vs_service_user *)arg;
@@ -2469,9 +2473,6 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)break ;case IP_VS_SO_SET_DELDEST : ret =ip_vs_del_dest (svc, &udest); -break ; -default : - ret = -EINVAL ; } out_unlock:
net/netfilter/nf_conntrack_proto_tcp.c +13 -6
@@ -549,13 +549,20 @@ static bool tcp_in_window(const struct nf_conn *ct, swin = win << sender->td_scale; sender->td_maxwin = (swin ==0 ?1 : swin); sender->td_maxend = end + sender->td_maxwin; -/* -* We haven't seen traffic in the other direction yet -* but we have to tweak window tracking to pass III -* and IV until that happens. -*/ -if (receiver->td_maxwin ==0 ) +if (receiver->td_maxwin ==0 ) { +/* We haven't seen traffic in the other +* direction yet but we have to tweak window +* tracking to pass III and IV until that +* happens. +*/ receiver->td_end = receiver->td_maxend = sack; + }else if (sack == receiver->td_end +1 ) { +/* Likely a reply to a keepalive. +* Needed for III. +*/ + receiver->td_end++; + } + } } else if (((state->state == TCP_CONNTRACK_SYN_SENT && dir == IP_CT_DIR_ORIGINAL)
net/netfilter/nf_dup_netdev.c +1 -0
@@ -21,6 +21,7 @@ static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev)skb_push (skb, skb->mac_len); skb->dev = dev; + skb->tstamp =0 ;dev_queue_xmit (skb); }
net/netfilter/nft_fwd_netdev.c +1 -0
@@ -129,6 +129,7 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,return ; skb->dev = dev; + skb->tstamp =0 ;neigh_xmit (neigh_table, dev, addr, skb); out: regs->verdict.code = verdict;
net/sunrpc/auth_gss/svcauth_gss.c +17 -10
@@ -1079,9 +1079,9 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp, struct gssp_in_token *in_token) {struct kvec *argv = &rqstp->rq_arg.head[0 ]; -unsigned int page_base, length; -int pages, i, res; -size_t inlen; +unsigned int length, pgto_offs, pgfrom_offs; +int pages, i, res, pgto, pgfrom; +size_t inlen, to_offs, from_offs; res =gss_read_common_verf (gc, argv, authp, in_handle);if (res)
@@ -1109,17 +1109,24 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp,memcpy (page_address (in_token->pages[0 ]), argv->iov_base, length); inlen -= length; - i =1 ; - page_base = rqstp->rq_arg.page_base; + to_offs = length; + from_offs = rqstp->rq_arg.page_base;while (inlen) { - length = min_t(unsigned int, inlen, PAGE_SIZE); -memcpy (page_address (in_token->pages[i]), -page_address (rqstp->rq_arg.pages[i]) + page_base, + pgto = to_offs >>PAGE_SHIFT ; + pgfrom = from_offs >>PAGE_SHIFT ; + pgto_offs = to_offs & ~PAGE_MASK ; + pgfrom_offs = from_offs & ~PAGE_MASK ; + + length = min_t(unsigned int, inlen, + min_t(unsigned int, PAGE_SIZE - pgto_offs, +PAGE_SIZE - pgfrom_offs)); +memcpy (page_address (in_token->pages[pgto]) + pgto_offs, +page_address (rqstp->rq_arg.pages[pgfrom]) + pgfrom_offs, length); + to_offs += length; + from_offs += length; inlen -= length; - page_base =0 ; - i++; }return 0 ; }
net/sunrpc/xprtrdma/svc_rdma_sendto.c +2 -1
@@ -639,10 +639,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma,while (remaining) { len =min_t (u32,PAGE_SIZE - pageoff, remaining); -memcpy (dst,page_address (*ppages), len); +memcpy (dst,page_address (*ppages) + pageoff, len); remaining -= len; dst += len; pageoff =0 ; + ppages++; } }
samples/mic/mpssd/mpssd.c +2 -2
@@ -414,9 +414,9 @@ mic_virtio_copy(struct mic_info *mic, int fd,static inline unsigned _vring_size (unsigned int num,unsigned long align) { -return ((sizeof (struct vring_desc ) * num +sizeof (__u16) * (3 + num) +return _ALIGN_UP (((sizeof (struct vring_desc ) * num +sizeof (__u16) * (3 + num) + align -1 ) & ~(align -1 )) - +sizeof (__u16) *3 +sizeof (struct vring_used_elem ) * num; + +sizeof (__u16) *3 +sizeof (struct vring_used_elem ) * num,4 ); }/*
tools/perf/util/intel-pt.c +4 -4
@@ -876,6 +876,8 @@ static void intel_pt_set_pid_tid_cpu(struct intel_pt *pt,if (queue->tid ==-1 || pt->have_sched_switch) { ptq->tid =machine__get_current_tid (pt->machine, ptq->cpu); +if (ptq->tid ==-1 ) + ptq->pid =-1 ;thread__zput (ptq->thread); }
@@ -1915,10 +1917,8 @@ static int intel_pt_context_switch(struct intel_pt *pt, union perf_event *event, tid = sample->tid; } -if (tid ==-1 ) { -pr_err ("context_switch event has no tid\n" ); -return -EINVAL ; - } +if (tid ==-1 ) +intel_pt_log ("context_switch event has no tid\n" ); intel_pt_log("context_switch: cpu %d pid %d tid %d time %"PRIu64" tsc %#"PRIx64"\n", cpu, pid, tid, sample->time, perf_time_to_tsc(sample->time,
Quoted 8 lines · Greg Kroah-Hartman
block/blk-core.c +0
-2@@ -2127,11 +2127,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) {char b[BDEVNAME_SIZE ]; -printk (KERN_INFO "attempt to access beyond end of device\n" ); - printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",
block/blk-core.c static void handle_bad_sector(struct bio *bio, sector_t maxsector) · line 2136
Quoted 10 lines
block/blk-core.c +4
-3-bio_devname (bio, b), bio->bi_opf, - (unsigned long long )bio_end_sector (bio), - (long long)maxsector); +pr_info_ratelimited ("attempt to access beyond end of device\n" +"%s: rw=%d, want=%llu, limit=%llu\n" , +bio_devname (bio, b), bio->bi_opf, +bio_end_sector (bio), maxsector); }#ifdef CONFIG_FAIL_MAKE_REQUEST
Above change "block: ratelimit handle_bad_sector() message" upstream commit f4ac712e4fe009635344b9af5d890fe25fcc8c0d in 4.19.154 kernel is not completely OK.
Removing casts from arguments 4 and 5 produces these compile warnings:
In file included from ./include/linux/kernel.h:14:0,
from block/blk-core.c:14:
block/blk-core.c: In function 'handle_bad_sector':
./include/linux/kern_levels.h:5:18: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'sector_t {aka long unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
./include/linux/printk.h:424:10: note: in definition of macro 'printk_ratelimited'
printk(fmt, ##__VA_ARGS__); \
^~~
./include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^~~~~~~~
./include/linux/printk.h:444:21: note: in expansion of macro 'KERN_INFO'
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~block/blk-core.c:2130:2: note: in expansion of macro 'pr_info_ratelimited'
pr_info_ratelimited("attempt to access beyond end of device\n"
^~~~~~~~~~~~~~~~~~~./include/linux/kern_levels.h:5:18: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'sector_t {aka long unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
./include/linux/printk.h:424:10: note: in definition of macro 'printk_ratelimited'
printk(fmt, ##__VA_ARGS__); \
^~~
./include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^~~~~~~~
./include/linux/printk.h:444:21: note: in expansion of macro 'KERN_INFO'
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~block/blk-core.c:2130:2: note: in expansion of macro 'pr_info_ratelimited'
pr_info_ratelimited("attempt to access beyond end of device\n" ^~~~~~~~~~~~~~~~~~~
For 64 bit systems it is only compile time cosmetic warning. For 32 bit system + CONFIG_LBDAF=n it introduces bugs: output formats are "%llu" and passed parameters are 32 bits. That is not OK.
Upstream kernels have hardcoded 64 bit sector_t. In older stable trees sector_t can be either 64 or 32 bit. In other words, backport of above patch needs to keep those original casts.
Signature · 1 line
Jari Ruusu 4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD ACDF F073 3C80 8132 F189
Quoted 26 lines · Jari Ruusu
Quoted 8 lines · Greg Kroah-Hartman
block/blk-core.c +0
-2@@ -2127,11 +2127,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) {char b[BDEVNAME_SIZE ]; -printk (KERN_INFO "attempt to access beyond end of device\n" ); - printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",block/blk-core.c static void handle_bad_sector(struct bio *bio, sector_t maxsector) · line 2136
Quoted 10 lines
block/blk-core.c +4
-3-bio_devname (bio, b), bio->bi_opf, - (unsigned long long )bio_end_sector (bio), - (long long)maxsector); +pr_info_ratelimited ("attempt to access beyond end of device\n" +"%s: rw=%d, want=%llu, limit=%llu\n" , +bio_devname (bio, b), bio->bi_opf, +bio_end_sector (bio), maxsector); }#ifdef CONFIG_FAIL_MAKE_REQUEST Above change "block: ratelimit
handle_bad_sector()message" upstream commitf4ac712e4fe009635344b9af5d890fe25fcc8c0din 4.19.154 kernel is not completely OK.Removing casts from arguments 4 and 5 produces these compile warnings:
(...snipped...)
Quoted 7 lines
For 64 bit systems it is only compile time cosmetic warning. For 32 bit system +
CONFIG_LBDAF=nit introduces bugs: output formats are "%llu" and passed parameters are 32 bits. That is not OK.Upstream kernels have hardcoded 64 bit
sector_t. In older stable treessector_tcan be either 64 or 32 bit. In other words, backport of above patch needs to keep those original casts.
Indeed, commit f4ac712e4fe00963 ("block: ratelimit handle_bad_sector() message") depends on commit 72deb455b5ec619f ("block: remove CONFIG_LBDAF") which was merged into 5.2 kernel.
-------- Forwarded Message --------
Date: Thu, 8 Oct 2020 07:40:49 +0100
From: Christoph Hellwig <[email protected]>
To: Tetsuo Handa <[email protected]>
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: Re: [PATCH] block: ratelimit handle_bad_sector() message
Message-ID: <[email protected]>
References: <[email protected]>
In-Reply-To: <[email protected]>
block/blk-core.c static void handle_bad_sector(struct bio *bio, sector_t maxsector) · line 810
Quoted 13 lines · Tetsuo Handa
block/blk-core.c +2
-2@@ -803,8 +803,8 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) {char b[BDEVNAME_SIZE ]; -printk (KERN_INFO "attempt to access beyond end of device\n" ); -printk (KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n" , +printk_ratelimited (KERN_INFO "attempt to access beyond end of device\n" ); +printk_ratelimited (KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n" ,bio_devname (bio, b), bio->bi_opf, (unsigned long long )bio_end_sector (bio), (long long )maxsector);
Please use pr_info_ratelimited, and also remove the casts now that sector_t is guranteed to be an unsigned long long.
Greg Kroah-Hartman
maintainerQuoted 32 lines · Tetsuo Handa
Quoted 26 lines · Jari Ruusu
Quoted 8 lines · Greg Kroah-Hartman
block/blk-core.c +0
-2@@ -2127,11 +2127,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) {char b[BDEVNAME_SIZE ]; -printk (KERN_INFO "attempt to access beyond end of device\n" ); - printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",block/blk-core.c static void handle_bad_sector(struct bio *bio, sector_t maxsector) · line 2136
Quoted 10 lines
block/blk-core.c +4
-3-bio_devname (bio, b), bio->bi_opf, - (unsigned long long )bio_end_sector (bio), - (long long)maxsector); +pr_info_ratelimited ("attempt to access beyond end of device\n" +"%s: rw=%d, want=%llu, limit=%llu\n" , +bio_devname (bio, b), bio->bi_opf, +bio_end_sector (bio), maxsector); }#ifdef CONFIG_FAIL_MAKE_REQUEST Above change "block: ratelimit
handle_bad_sector()message" upstream commitf4ac712e4fe009635344b9af5d890fe25fcc8c0din 4.19.154 kernel is not completely OK.Removing casts from arguments 4 and 5 produces these compile warnings:
(...snipped...)
Quoted 4 lines
For 64 bit systems it is only compile time cosmetic warning. For 32 bit system +
CONFIG_LBDAF=nit introduces bugs: output formats are "%llu" and passed parameters are 32 bits. That is not OK.
Quoted 7 lines
Quoted 3 lines
Upstream kernels have hardcoded 64 bit
sector_t. In older stable treessector_tcan be either 64 or 32 bit. In other words, backport of above patch needs to keep those original casts.Indeed, commit
f4ac712e4fe00963("block: ratelimithandle_bad_sector()message") depends on commit72deb455b5ec619f("block: removeCONFIG_LBDAF") which was merged into 5.2 kernel.
Good catch, I'll go revert this now, sorry about it.
greg k-h