4.14.213-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 4.14.213-rc1 review
This is the start of the stable review cycle for the 4.14.213 release. There are 242 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 30 Dec 2020 12:48:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.213-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.14.213-rc1
Jubin Zhong <[email protected]>
PCI: Fix pci_slot_release() NULL pointer dereference
Dan Williams <[email protected]>
libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
SeongJae Park <[email protected]>
xenbus/xenbus_backend: Disallow pending watch messages
SeongJae Park <[email protected]>
xen/xenbus: Count pending messages for each watch
SeongJae Park <[email protected]>
xen/xenbus/xen_bus_type: Support will_handle watch callback
SeongJae Park <[email protected]>
xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
SeongJae Park <[email protected]>
xen/xenbus: Allow watches discard events before queueing
Pawel Wieczorkiewicz <[email protected]>
xen-blkback: set ring->xenblkd to NULL after kthread_stop()
Terry Zhou <[email protected]>
clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
Zhao Heming <[email protected]>
md/cluster: fix deadlock when node is doing resync job
Jonathan Cameron <[email protected]>
iio:imu:bmi160: Fix too large a buffer.
Jonathan Cameron <[email protected]>
iio:pressure:mpl3115: Force alignment of buffer
Jonathan Cameron <[email protected]>
iio:light:rpr0521: Fix timestamp alignment and prevent data leak.
Qinglang Miao <[email protected]>
iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
Nuno Sá <[email protected]>
iio: buffer: Fix demux update
Sven Eckelmann <[email protected]>
mtd: parser: cmdline: Fix parsing of part-names with colons
Evan Green <[email protected]>
soc: qcom: smp2p: Safely acquire spinlock without IRQs
Lukas Wunner <[email protected]>
spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path
Lukas Wunner <[email protected]>
spi: sc18is602: Don't leak SPI master in probe error path
Lukas Wunner <[email protected]>
spi: rb4xx: Don't leak SPI master in probe error path
Lukas Wunner <[email protected]>
spi: pic32: Don't leak DMA channels in probe error path
Lukas Wunner <[email protected]>
spi: davinci: Fix use-after-free on unbind
Lukas Wunner <[email protected]>
spi: spi-sh: Fix use-after-free on unbind
Zwane Mwaikambo <[email protected]>
drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor()
Dave Kleikamp <[email protected]>
jfs: Fix array index bounds check in dbAdjTree
Zhe Li <[email protected]>
jffs2: Fix GC exit abnormally
Luis Henriques <[email protected]>
ceph: fix race in concurrent __ceph_remove_cap invocations
Roberto Sassu <[email protected]>
ima: Don't modify file descriptor mode on the fly
David Hildenbrand <[email protected]>
powerpc/powernv/memtrace: Don't leak kernel memory to user space
Christophe Leroy <[email protected]>
powerpc/xmon: Change printk() to pr_cont()
Tyrel Datwyler <[email protected]>
powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
Nicolas Ferre <[email protected]>
ARM: dts: at91: sama5d2: fix CAN message ram offset and size
Marc Zyngier <[email protected]>
KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
Jan Kara <[email protected]>
ext4: fix deadlock with fs freezing and EA inodes
Chunguang Xu <[email protected]>
ext4: fix a memory leak of ext4_free_data
Pavel Machek <[email protected]>
btrfs: fix return value mixup in btrfs_get_extent
Filipe Manana <[email protected]>
Btrfs: fix selftests failure due to uninitialized i_mode in test inodes
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write unthrottling
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write-wakeup use-after-free
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix stalled writes
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix write deadlock
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix dropped unthrottle interrupts
Johan Hovold <[email protected]>
USB: serial: mos7720: fix parallel-port state restore
Borislav Petkov <[email protected]>
EDAC/amd64: Fix PCI component registration
Ard Biesheuvel <[email protected]>
crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
Athira Rajeev <[email protected]>
powerpc/perf: Exclude kernel samples while counting events in user space.
Ian Abbott <[email protected]>
staging: comedi: mf6x4: Fix AI end-of-conversion detection
Stefan Haberland <[email protected]>
s390/dasd: fix list corruption of lcu list
Stefan Haberland <[email protected]>
s390/dasd: fix list corruption of pavgroup group list
Stefan Haberland <[email protected]>
s390/dasd: prevent inconsistent LCU device data
Sven Schnelle <[email protected]>
s390/smp: perform initial CPU reset also for SMT siblings
Takashi Iwai <[email protected]>
ALSA: usb-audio: Disable sample read check if firmware doesn't give back
Takashi Iwai <[email protected]>
ALSA: pcm: oss: Fix a few more UBSAN fixes
Chris Chiu <[email protected]>
ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
Hui Wang <[email protected]>
ACPI: PNP: compare the string length in the matching_id()
Daniel Scally <[email protected]>
Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
Rafael J. Wysocki <[email protected]>
PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
Arnd Bergmann <[email protected]>
Input: cyapa_gen6 - fix out-of-bounds stack access
Lukas Wunner <[email protected]>
media: netup_unidvb: Don't leak SPI master in probe error path
Sean Young <[email protected]>
media: sunxi-cir: ensure IR is handled when it is continuous
Alan Stern <[email protected]>
media: gspca: Fix memory leak in probe
Simon Beginn <[email protected]>
Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
Dmitry Torokhov <[email protected]>
Input: cros_ec_keyb - send 'scancodes' in addition to key events
Serge Hallyn <[email protected]>
fix namespaced fscaps when !CONFIG_SECURITY
Sara Sharon <[email protected]>
cfg80211: initialize rekey_data
Jernej Skrabec <[email protected]>
clk: sunxi-ng: Make sure divider tables have sentinel
Christophe JAILLET <[email protected]>
clk: s2mps11: Fix a resource leak in error handling paths in the probe function
Dan Carpenter <[email protected]>
qlcnic: Fix error code in probe
Zheng Zengkai <[email protected]>
perf record: Fix memory leak when using '--user-regs=?' to list registers
Lokesh Vutla <[email protected]>
pwm: lp3943: Dynamically allocate PWM chip base
Uwe Kleine-König <[email protected]>
pwm: zx: Add missing cleanup in error path
Zhang Qilong <[email protected]>
clk: ti: Fix memleak in ti_fapll_synth_setup
Arnd Bergmann <[email protected]>
watchdog: coh901327: add COMMON_CLK dependency
Manivannan Sadhasivam <[email protected]>
watchdog: qcom: Avoid context switch in restart handler
Vincent Stehlé <[email protected]>
net: korina: fix return value
Christophe JAILLET <[email protected]>
net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
Christophe JAILLET <[email protected]>
net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
Dwaipayan Ray <[email protected]>
checkpatch: fix unescaped left brace
Vincent Stehlé <[email protected]>
powerpc/ps3: use dma_mapping_error()
Bongsu Jeon <[email protected]>
nfc: s3fwrn5: Release the nfc firmware
Anton Ivanov <[email protected]>
um: chan_xterm: Fix fd leak
Guenter Roeck <[email protected]>
watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
Marc Zyngier <[email protected]>
irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
Dan Carpenter <[email protected]>
ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
Marek Szyprowski <[email protected]>
extcon: max77693: Fix modalias string
Dmitry Osipenko <[email protected]>
clk: tegra: Fix duplicated SE clock entry
Masami Hiramatsu <[email protected]>
x86/kprobes: Restore BTF if the single-stepping is cancelled
Cheng Lin <[email protected]>
nfs_common: need lock during iterate through the list
kazuo ito <[email protected]>
nfsd: Fix message level for normal termination
Yang Yingliang <[email protected]>
speakup: fix uninitialized flush_lock
Zhang Qilong <[email protected]>
usb: oxu210hp-hcd: Fix memory leak in oxu_create
Zhang Qilong <[email protected]>
usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
Nathan Lynch <[email protected]>
powerpc/pseries/hibernation: remove redundant cacheinfo update
Nathan Lynch <[email protected]>
powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
Zhang Changzhong <[email protected]>
scsi: fnic: Fix error return code in fnic_probe()
Arnd Bergmann <[email protected]>
seq_buf: Avoid type mismatch for seq_buf_init
Zhang Qilong <[email protected]>
scsi: pm80xx: Fix error return in pm8001_pci_probe()
Qinglang Miao <[email protected]>
scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
Pali Rohár <[email protected]>
cpufreq: scpi: Add missing MODULE_ALIAS
Pali Rohár <[email protected]>
cpufreq: loongson1: Add missing MODULE_ALIAS
Pali Rohár <[email protected]>
cpufreq: st: Add missing MODULE_DEVICE_TABLE
Pali Rohár <[email protected]>
cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
Pali Rohár <[email protected]>
cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
Keqian Zhu <[email protected]>
clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
Qinglang Miao <[email protected]>
dm ioctl: fix error return code in target_message
Chuhong Yuan <[email protected]>
ASoC: jz4740-i2s: add missed checks for clk_get()
Leon Romanovsky <[email protected]>
net/mlx5: Properly convey driver version to firmware
Jing Xiangfeng <[email protected]>
memstick: r592: Fix error return in r592_probe()
Chen-Yu Tsai <[email protected]>
arm64: dts: rockchip: Fix UART pull-ups on rk3328
Yu Kuai <[email protected]>
pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
Claudiu Beznea <[email protected]>
ARM: dts: at91: sama5d2: map securam as device
Yu Kuai <[email protected]>
clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
Dan Carpenter <[email protected]>
media: saa7146: fix array overflow in vidioc_s_audio()
Jason Gunthorpe <[email protected]>
vfio-pci: Use io_remap_pfn_range() for PCI IO memory
NeilBrown <[email protected]>
NFS: switch nfsiod to be an UNBOUND workqueue.
Calum Mackay <[email protected]>
lockd: don't use interval-based rebinding over TCP
Trond Myklebust <[email protected]>
SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
Olga Kornievskaia <[email protected]>
NFSv4.2: condition READDIR's mask for security label based on LSM state
Christophe JAILLET <[email protected]>
ath10k: Release some resources in an error handling path
Christophe JAILLET <[email protected]>
ath10k: Fix an error handling path
Alexandre Belloni <[email protected]>
ARM: dts: at91: at91sam9rl: fix ADC triggers
Bharat Gooty <[email protected]>
PCI: iproc: Fix out-of-bound array accesses
Marc Zyngier <[email protected]>
genirq/irqdomain: Don't try to free an interrupt that has no mapping
Zhang Qilong <[email protected]>
power: supply: bq24190_charger: fix reference leak
Chris Packham <[email protected]>
ARM: dts: Remove non-existent i2c1 from 98dx3236
Jing Xiangfeng <[email protected]>
HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
Dan Carpenter <[email protected]>
media: max2175: fix max2175_set_csm_mode() error code
Qinglang Miao <[email protected]>
mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
Daniel T. Lee <[email protected]>
samples: bpf: Fix lwt_len_hist reusing previous BPF map
Keita Suzuki <[email protected]>
media: siano: fix memory leak of debugfs members in smsdvb_hotplug
Qinglang Miao <[email protected]>
cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
Sebastian Andrzej Siewior <[email protected]>
orinoco: Move context allocation after processing the skb
Cristian Birsan <[email protected]>
ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
Cristian Birsan <[email protected]>
ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
Qinglang Miao <[email protected]>
memstick: fix a double-free bug in memstick_check
Kamal Heib <[email protected]>
RDMA/cxgb4: Validate the number of CQEs
Zhang Qilong <[email protected]>
Input: omap4-keypad - fix runtime PM error handling
Zhihao Cheng <[email protected]>
drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
Zhang Qilong <[email protected]>
soc: ti: Fix reference imbalance in knav_dma_probe
Zhang Qilong <[email protected]>
soc: ti: knav_qmss: fix reference leak in knav_queue_probe
Zhang Qilong <[email protected]>
crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
Christophe Leroy <[email protected]>
powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
Dmitry Torokhov <[email protected]>
Input: ads7846 - fix unaligned access on 7845
Oleksij Rempel <[email protected]>
Input: ads7846 - fix integer overflow on Rt calculation
David Jander <[email protected]>
Input: ads7846 - fix race that causes missing releases
Yang Yingliang <[email protected]>
drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
Qinglang Miao <[email protected]>
media: solo6x10: fix missing snd_card_free in error handling case
Martin Wilck <[email protected]>
scsi: core: Fix VPD LUN ID designator priorities
Yu Kuai <[email protected]>
media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
Zhang Qilong <[email protected]>
staging: greybus: codecs: Fix reference counter leak in error handling
Necip Fazil Yildiran <[email protected]>
MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
Arnd Bergmann <[email protected]>
RDMa/mthca: Work around -Wenum-conversion warning
Zhang Qilong <[email protected]>
ASoC: arizona: Fix a wrong free in wm8997_probe
Vincent Bernat <[email protected]>
net: evaluate net.ipv4.conf.all.proxy_arp_pvlan
Vincent Bernat <[email protected]>
net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown
Zhang Qilong <[email protected]>
ASoC: wm8998: Fix PM disable depth imbalance on error
Tsuchiya Yuto <[email protected]>
mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
Zhang Qilong <[email protected]>
spi: tegra114: fix reference leak in tegra spi ops
Zhang Qilong <[email protected]>
spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
Zhang Qilong <[email protected]>
spi: tegra20-slink: fix reference leak in slink ops of tegra20
Zhang Qilong <[email protected]>
spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
Anmol Karn <[email protected]>
Bluetooth: Fix null pointer dereference in hci_event_packet()
Paweł Chmiel <[email protected]>
arm64: dts: exynos: Correct psci compatible used on Exynos7
Paul Moore <[email protected]>
selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
Cezary Rojewski <[email protected]>
ASoC: pcm: DRAIN support reactivation
Zhang Qilong <[email protected]>
spi: img-spfi: fix reference leak in img_spfi_resume
Christophe Leroy <[email protected]>
crypto: talitos - Fix return type of current_desc_hdr()
Thomas Gleixner <[email protected]>
sched: Reenable interrupts in do_sched_yield()
Peng Liu <[email protected]>
sched/deadline: Fix sched_dl_global_validate()
Ard Biesheuvel <[email protected]>
ARM: p2v: fix handling of LPAE translation in BE mode
Arvind Sankar <[email protected]>
x86/mm/ident_map: Check for errors from ident_pud_init()
Bob Pearson <[email protected]>
RDMA/rxe: Compute PSN windows correctly
Tianyue Ren <[email protected]>
selinux: fix error initialization in inode_doinit_with_dentry()
Kamal Heib <[email protected]>
RDMA/bnxt_re: Set queue pair state when being queried
Nicolas Boichat <[email protected]>
soc: mediatek: Check if power domains can be powered on at boot time
Dan Carpenter <[email protected]>
soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
Tom Rix <[email protected]>
drm/gma500: fix double free of gma_connector
Peilin Ye <[email protected]>
Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
Dae R. Jeong <[email protected]>
md: fix a warning caused by a race between concurrent md_ioctl()s
Eric Biggers <[email protected]>
crypto: af_alg - avoid undefined behavior accessing salg_name
Antti Palosaari <[email protected]>
media: msi2500: assign SPI bus number dynamically
Jan Kara <[email protected]>
quota: Sanity-check quota file headers on load
Alexey Kardashevskiy <[email protected]>
serial_core: Check for port state when tty is in error state
Julian Sax <[email protected]>
HID: i2c-hid: add Vero K147 to descriptor override
Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU
Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410
Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU
Fabio Estevam <[email protected]>
usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
Will McVicker <[email protected]>
USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
Jack Pham <[email protected]>
usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
Will McVicker <[email protected]>
USB: gadget: f_midi: setup SuperSpeed Plus descriptors
taehyun.cho <[email protected]>
USB: gadget: f_acm: add support for SuperSpeed Plus
Johan Hovold <[email protected]>
USB: serial: option: add interface-number sanity check to flag handling
Nicolin Chen <[email protected]>
soc/tegra: fuse: Fix index bug in get_process_id
Thomas Gleixner <[email protected]>
dm table: Remove BUG_ON(in_interrupt())
Sreekanth Reddy <[email protected]>
scsi: mpt3sas: Increase IOCInit request timeout to 30s
Sven Eckelmann <[email protected]>
vxlan: Copy needed_tailroom from lowerdev
Sven Eckelmann <[email protected]>
vxlan: Add needed_headroom for lower device
Qinglang Miao <[email protected]>
drm/tegra: sor: Disable clocks on error in tegra_sor_init()
Nicholas Piggin <[email protected]>
kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
Leon Romanovsky <[email protected]>
RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
Zhang Qilong <[email protected]>
can: softing: softing_netdev_open(): fix error handling
Randy Dunlap <[email protected]>
scsi: bnx2i: Requires MMU
Baruch Siach <[email protected]>
gpio: mvebu: fix potential user-after-free on probe
Icenowy Zheng <[email protected]>
ARM: dts: sun8i: v3s: fix GIC node memory range
Andy Shevchenko <[email protected]>
pinctrl: baytrail: Avoid clearing debounce value when turning it off
Andy Shevchenko <[email protected]>
pinctrl: merrifield: Set default bias in case no particular value given
Xin Xiong <[email protected]>
drm: fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi
Alexander Sverdlin <[email protected]>
serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
Takashi Iwai <[email protected]>
ALSA: pcm: oss: Fix potential out-of-bounds shift
Thomas Gleixner <[email protected]>
USB: sisusbvga: Make console support depend on BROKEN
Oliver Neukum <[email protected]>
USB: UAS: introduce a quirk to set no_write_same
Li Jun <[email protected]>
xhci: Give USB2 ports time to enter U3 in bus suspend
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix control 'access overflow' errors from chmap
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix potential out-of-bounds shift
Oliver Neukum <[email protected]>
USB: add RESET_RESUME quirk for Snapscan 1212
Bui Quang Minh <[email protected]>
USB: dummy-hcd: Fix uninitialized array use in init()
Eric Dumazet <[email protected]>
mac80211: mesh: fix mesh_pathtbl_init() error path
Zhang Changzhong <[email protected]>
net: bridge: vlan: fix error return code in __vlan_add()
Martin Blumenstingl <[email protected]>
net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux
Fugang Duan <[email protected]>
net: stmmac: delete the eee_ctrl_timer after napi disabled
Moshe Shemesh <[email protected]>
net/mlx4_en: Handle TX error CQE
Moshe Shemesh <[email protected]>
net/mlx4_en: Avoid scheduling restart task if it is already running
Neal Cardwell <[email protected]>
tcp: fix cwnd-limited bug for TSO deferral where we send nothing
Fugang Duan <[email protected]>
net: stmmac: free tx skb buffer in stmmac_resume()
Ansuel Smith <[email protected]>
PCI: qcom: Add missing reset for ipq806x
Arvind Sankar <[email protected]>
x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
Dan Carpenter <[email protected]>
scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
Arnd Bergmann <[email protected]>
kbuild: avoid static_assert for genksyms
Coiby Xu <[email protected]>
pinctrl: amd: remove debounce filter setting in IRQ type setting
Chris Chiu <[email protected]>
Input: i8042 - add Acer laptops to the i8042 reset list
Dmitry Torokhov <[email protected]>
Input: cm109 - do not stomp on control URB
Timo Witte <[email protected]>
platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
Hao Si <[email protected]>
soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)
Can Guo <[email protected]>
scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
Vineet Gupta <[email protected]>
ARC: stack unwinding: don't assume non-current task is sleeping
Sara Sharon <[email protected]>
iwlwifi: mvm: fix kernel panic in case of assert during CSA
Markus Reichl <[email protected]>
arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.
Johannes Berg <[email protected]>
iwlwifi: pcie: limit memory read spin time
Nathan Chancellor <[email protected]>
spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
Lukas Wunner <[email protected]>
spi: bcm2835aux: Fix use-after-free on unbind
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 1 + Documentation/networking/ip-sysctl.txt | 3 + Makefile | 4 +- arch/arc/kernel/stacktrace.c | 23 ++-- arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 5 - arch/arm/boot/dts/at91-sama5d3_xplained.dts | 7 ++ arch/arm/boot/dts/at91-sama5d4_xplained.dts | 7 ++ arch/arm/boot/dts/at91sam9rl.dtsi | 19 ++-- arch/arm/boot/dts/exynos5410-odroidxu.dts | 6 +- arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 28 +++++ arch/arm/boot/dts/exynos5410.dtsi | 4 + arch/arm/boot/dts/sama5d2.dtsi | 7 +- arch/arm/boot/dts/sun8i-v3s.dtsi | 2 +- arch/arm/kernel/head.S | 6 +- arch/arm/mach-shmobile/pm-rmobile.c | 1 + arch/arm64/boot/dts/exynos/exynos7.dtsi | 4 +- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 16 +-- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 3 + arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/sys_regs.c | 1 + arch/mips/bcm47xx/Kconfig | 1 + arch/powerpc/include/asm/cputable.h | 5 - arch/powerpc/kernel/rtas.c | 2 +- arch/powerpc/perf/core-book3s.c | 10 ++ arch/powerpc/platforms/powernv/memtrace.c | 22 ++++ arch/powerpc/platforms/pseries/suspend.c | 4 - arch/powerpc/xmon/nonstdio.c | 2 +- arch/s390/kernel/smp.c | 18 +-- arch/um/drivers/xterm.c | 5 + arch/x86/include/asm/pgtable_types.h | 1 + arch/x86/kernel/kprobes/core.c | 5 + arch/x86/mm/ident_map.c | 12 +- arch/x86/mm/mem_encrypt.c | 4 +- crypto/af_alg.c | 10 +- crypto/ecdh.c | 9 +- drivers/acpi/acpi_pnp.c | 3 + drivers/acpi/device_pm.c | 41 ++----- drivers/acpi/resource.c | 2 +- drivers/block/xen-blkback/xenbus.c | 4 +- drivers/bus/mips_cdmm.c | 4 +- drivers/clk/clk-s2mps11.c | 1 + drivers/clk/mvebu/armada-37xx-xtal.c | 4 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 1 + drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 1 + drivers/clk/tegra/clk-id.h | 1 + drivers/clk/tegra/clk-tegra-periph.c | 2 +- drivers/clk/ti/fapll.c | 11 +- drivers/clocksource/arm_arch_timer.c | 23 ++-- drivers/clocksource/cadence_ttc_timer.c | 18 +-- drivers/cpufreq/highbank-cpufreq.c | 7 ++ drivers/cpufreq/loongson1-cpufreq.c | 1 + drivers/cpufreq/mediatek-cpufreq.c | 1 + drivers/cpufreq/scpi-cpufreq.c | 1 + drivers/cpufreq/sti-cpufreq.c | 7 ++ drivers/crypto/omap-aes.c | 3 +- drivers/crypto/talitos.c | 6 +- drivers/edac/amd64_edac.c | 26 +++-- drivers/extcon/extcon-max77693.c | 2 +- drivers/gpio/gpio-mvebu.c | 16 ++- drivers/gpu/drm/drm_dp_aux_dev.c | 2 +- drivers/gpu/drm/drm_dp_mst_topology.c | 7 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + drivers/gpu/drm/tegra/sor.c | 10 +- drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 8 ++ drivers/hsi/controllers/omap_ssi_core.c | 2 +- drivers/iio/adc/rockchip_saradc.c | 2 +- drivers/iio/imu/bmi160/bmi160_core.c | 4 +- drivers/iio/industrialio-buffer.c | 6 +- drivers/iio/light/rpr0521.c | 17 ++- drivers/iio/pressure/mpl3115.c | 9 +- drivers/infiniband/core/cm.c | 2 + drivers/infiniband/hw/bnxt_re/ib_verbs.c | 1 + drivers/infiniband/hw/cxgb4/cq.c | 3 + drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_dev.h | 1 - drivers/infiniband/sw/rxe/rxe_req.c | 3 +- drivers/input/keyboard/cros_ec_keyb.c | 1 + drivers/input/keyboard/omap4-keypad.c | 89 +++++++++------ drivers/input/misc/cm109.c | 7 +- drivers/input/mouse/cyapa_gen6.c | 2 +- drivers/input/serio/i8042-x86ia64io.h | 42 +++++++ drivers/input/touchscreen/ads7846.c | 52 +++++---- drivers/input/touchscreen/goodix.c | 12 ++ drivers/irqchip/irq-alpine-msi.c | 3 +- drivers/md/dm-ioctl.c | 1 + drivers/md/dm-table.c | 6 - drivers/md/md-cluster.c | 67 ++++++----- drivers/md/md.c | 13 ++- drivers/media/common/siano/smsdvb-main.c | 5 +- drivers/media/i2c/max2175.c | 2 +- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c | 5 +- drivers/media/pci/saa7146/mxb.c | 19 ++-- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 1 + drivers/media/rc/sunxi-cir.c | 2 + drivers/media/usb/gspca/gspca.c | 1 + drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/memstick/core/memstick.c | 1 - drivers/memstick/host/r592.c | 12 +- drivers/mtd/cmdlinepart.c | 14 ++- drivers/net/can/softing/softing_main.c | 9 +- drivers/net/ethernet/allwinner/sun4i-emac.c | 7 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +- drivers/net/ethernet/korina.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 21 ++-- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 40 +++++-- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 12 +- drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 + .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 6 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 27 ++++- drivers/net/vxlan.c | 3 + drivers/net/wireless/ath/ath10k/usb.c | 7 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 36 ++++-- .../net/wireless/intersil/orinoco/orinoco_usb.c | 14 +-- drivers/net/wireless/marvell/mwifiex/main.c | 2 + drivers/net/wireless/st/cw1200/main.c | 2 + drivers/net/xen-netback/xenbus.c | 6 +- drivers/nfc/s3fwrn5/firmware.c | 4 +- drivers/nvdimm/label.c | 9 ++ drivers/pci/dwc/pcie-qcom.c | 12 ++ drivers/pci/host/pcie-iproc.c | 10 +- drivers/pci/pci-acpi.c | 4 +- drivers/pci/slot.c | 6 +- drivers/pinctrl/intel/pinctrl-baytrail.c | 8 +- drivers/pinctrl/intel/pinctrl-merrifield.c | 8 ++ drivers/pinctrl/pinctrl-amd.c | 7 -- drivers/pinctrl/pinctrl-falcon.c | 14 ++- drivers/platform/x86/acer-wmi.c | 1 + drivers/power/supply/bq24190_charger.c | 20 +++- drivers/ps3/ps3stor_lib.c | 2 +- drivers/pwm/pwm-lp3943.c | 1 + drivers/pwm/pwm-zx.c | 1 + drivers/s390/block/dasd_alias.c | 12 +- drivers/scsi/be2iscsi/be_main.c | 4 +- drivers/scsi/bnx2i/Kconfig | 1 + drivers/scsi/fnic/fnic_main.c | 1 + drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- drivers/scsi/pm8001/pm8001_init.c | 3 +- drivers/scsi/qedi/qedi_main.c | 4 +- drivers/scsi/scsi_lib.c | 126 ++++++++++++++------- drivers/scsi/ufs/ufshcd.c | 7 ++ drivers/soc/mediatek/mtk-scpsys.c | 5 +- drivers/soc/qcom/smp2p.c | 5 +- drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +- drivers/soc/ti/knav_dma.c | 13 ++- drivers/soc/ti/knav_qmss_queue.c | 4 +- drivers/spi/spi-bcm2835aux.c | 17 +-- drivers/spi/spi-davinci.c | 2 +- drivers/spi/spi-img-spfi.c | 4 +- drivers/spi/spi-pic32.c | 1 + drivers/spi/spi-rb4xx.c | 2 +- drivers/spi/spi-sc18is602.c | 13 +-- drivers/spi/spi-sh.c | 13 +-- drivers/spi/spi-st-ssc4.c | 5 +- drivers/spi/spi-tegra114.c | 2 + drivers/spi/spi-tegra20-sflash.c | 1 + drivers/spi/spi-tegra20-slink.c | 2 + drivers/spi/spi-ti-qspi.c | 1 + drivers/staging/comedi/drivers/mf6x4.c | 3 +- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 5 +- drivers/staging/greybus/audio_codec.c | 2 + drivers/staging/speakup/speakup_dectlk.c | 2 +- drivers/tty/serial/8250/8250_omap.c | 5 - drivers/tty/serial/serial_core.c | 4 + drivers/usb/chipidea/ci_hdrc_imx.c | 3 +- drivers/usb/core/quirks.c | 3 + drivers/usb/gadget/function/f_acm.c | 2 +- drivers/usb/gadget/function/f_fs.c | 5 +- drivers/usb/gadget/function/f_midi.c | 6 + drivers/usb/gadget/function/f_rndis.c | 4 +- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- drivers/usb/host/ehci-omap.c | 1 + drivers/usb/host/oxu210hp-hcd.c | 4 +- drivers/usb/host/xhci-hub.c | 4 + drivers/usb/misc/sisusbvga/Kconfig | 2 +- drivers/usb/serial/keyspan_pda.c | 63 ++++++----- drivers/usb/serial/mos7720.c | 2 + drivers/usb/serial/option.c | 23 +++- drivers/usb/storage/uas.c | 3 + drivers/usb/storage/unusual_uas.h | 7 +- drivers/usb/storage/usb.c | 3 + drivers/vfio/pci/vfio_pci.c | 4 +- drivers/watchdog/Kconfig | 3 +- drivers/watchdog/qcom-wdt.c | 2 +- drivers/xen/xen-pciback/xenbus.c | 2 +- drivers/xen/xenbus/xenbus.h | 2 + drivers/xen/xenbus/xenbus_client.c | 8 +- drivers/xen/xenbus/xenbus_probe.c | 1 + drivers/xen/xenbus/xenbus_probe_backend.c | 7 ++ drivers/xen/xenbus/xenbus_xs.c | 34 ++++-- fs/btrfs/inode.c | 2 +- fs/btrfs/tests/btrfs-tests.c | 8 +- fs/ceph/caps.c | 11 +- fs/ext4/inode.c | 19 +++- fs/ext4/mballoc.c | 1 + fs/jffs2/readinode.c | 16 +++ fs/jfs/jfs_dmap.h | 2 +- fs/lockd/host.c | 20 ++-- fs/nfs/inode.c | 2 +- fs/nfs/nfs4proc.c | 10 +- fs/nfs_common/grace.c | 6 +- fs/nfsd/nfssvc.c | 3 +- fs/quota/quota_v2.c | 19 ++++ include/acpi/acpi_bus.h | 5 - include/linux/build_bug.h | 5 + include/linux/inetdevice.h | 4 +- include/linux/security.h | 2 +- include/linux/seq_buf.h | 2 +- include/linux/sunrpc/xprt.h | 1 + include/linux/trace_seq.h | 4 +- include/linux/usb_usual.h | 2 + include/uapi/linux/if_alg.h | 16 +++ include/xen/xenbus.h | 15 ++- kernel/cpu.c | 6 +- kernel/irq/irqdomain.c | 11 +- kernel/sched/core.c | 6 +- kernel/sched/deadline.c | 5 +- kernel/sched/sched.h | 42 +++---- net/bluetooth/hci_event.c | 17 +-- net/bridge/br_vlan.c | 4 +- net/ipv4/tcp_output.c | 9 +- net/mac80211/mesh_pathtbl.c | 4 +- net/sunrpc/xprt.c | 65 ++++++++--- net/sunrpc/xprtrdma/module.c | 1 + net/sunrpc/xprtrdma/transport.c | 1 + net/sunrpc/xprtsock.c | 4 + net/wireless/nl80211.c | 2 +- samples/bpf/lwt_len_hist.sh | 2 + samples/bpf/test_lwt_bpf.sh | 0 scripts/checkpatch.pl | 2 +- security/integrity/ima/ima_crypto.c | 20 +--- security/selinux/hooks.c | 16 ++- sound/core/oss/pcm_oss.c | 28 +++-- sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/wm8997.c | 2 + sound/soc/codecs/wm8998.c | 4 +- sound/soc/codecs/wm_adsp.c | 5 +- sound/soc/jz4740/jz4740-i2s.c | 4 + sound/soc/soc-pcm.c | 2 + sound/usb/clock.c | 6 + sound/usb/format.c | 2 + sound/usb/stream.c | 6 +- tools/perf/util/parse-regs-options.c | 2 +- 246 files changed, 1453 insertions(+), 675 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/242 spi: bcm2835aux: Fix use-after-free on unbind
From: Lukas Wunner <[email protected]>
[ Upstream commit e13ee6cc4781edaf8c7321bee19217e3702ed481 ]
bcm2835aux_spi_remove() accesses the driver's private data after calling spi_unregister_master() even though that function releases the last reference on the spi_master and thereby frees the private data.
Fix by switching over to the new devm_spi_alloc_master() helper which keeps the private data accessible until the driver has unbound.
--- drivers/spi/spi-bcm2835aux.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/spi/spi-bcm2835aux.c +6 -12
@@ -407,7 +407,7 @@ static int bcm2835aux_spi_probe(struct punsigned long clk_hz;int err; - master =spi_alloc_master (&pdev->dev,sizeof (*bs)); + master =devm_spi_alloc_master (&pdev->dev,sizeof (*bs));if (!master) {dev_err (&pdev->dev,"spi_alloc_master() failed\n" );return -ENOMEM ;
@@ -439,30 +439,26 @@ static int bcm2835aux_spi_probe(struct p/* the main area */ res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); bs->regs =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (bs->regs)) { - err =PTR_ERR (bs->regs); - goto out_master_put; - } +if (IS_ERR (bs->regs)) +return PTR_ERR (bs->regs); bs->clk =devm_clk_get (&pdev->dev,NULL );if ((!bs->clk) || (IS_ERR (bs->clk))) { - err =PTR_ERR (bs->clk);dev_err (&pdev->dev,"could not get clk: %d\n" , err); - goto out_master_put; +return PTR_ERR (bs->clk); } bs->irq =platform_get_irq (pdev,0 );if (bs->irq <=0 ) {dev_err (&pdev->dev,"could not get IRQ: %d\n" , bs->irq); - err = bs->irq ? bs->irq : -ENODEV ; - goto out_master_put; +return bs->irq ? bs->irq : -ENODEV ; }/* this also enables the HW block */ err =clk_prepare_enable (bs->clk);if (err) {dev_err (&pdev->dev,"could not prepare clock: %d\n" , err); - goto out_master_put; +return err; }/* just checking if the clock returns a sane value */
@@ -495,8 +491,6 @@ static int bcm2835aux_spi_probe(struct p out_clk_disable:clk_disable_unprepare (bs->clk); -out_master_put: -spi_master_put (master);return err; }
Greg Kroah-Hartman
maintainerPATCH 2/242 spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit d853b3406903a7dc5b14eb5bada3e8cd677f66a2 ]
Clang warns:
drivers/spi/spi-bcm2835aux.c:532:50: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
dev_err(&pdev->dev, "could not get clk: %d\n", err);
^~~
./include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
drivers/spi/spi-bcm2835aux.c:495:9: note: initialize the variable 'err'
to silence this warning
int err;
^
= 01 warning generated.
Restore the assignment so that the error value can be used in the dev_err statement and there is no uninitialized memory being leaked.
--- drivers/spi/spi-bcm2835aux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-bcm2835aux.c +2 -1
@@ -444,8 +444,9 @@ static int bcm2835aux_spi_probe(struct p bs->clk =devm_clk_get (&pdev->dev,NULL );if ((!bs->clk) || (IS_ERR (bs->clk))) { + err =PTR_ERR (bs->clk);dev_err (&pdev->dev,"could not get clk: %d\n" , err); -return PTR_ERR (bs->clk); +return err; } bs->irq =platform_get_irq (pdev,0 );
Greg Kroah-Hartman
maintainerPATCH 3/242 iwlwifi: pcie: limit memory read spin time
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit 04516706bb99889986ddfa3a769ed50d2dc7ac13 ]
When we read device memory, we lock a spinlock, write the address we want to read from the device and then spin in a loop reading the data in 32-bit quantities from another register.
As the description makes clear, this is rather inefficient, incurring a PCIe bus transaction for every read. In a typical device today, we want to read 786k SMEM if it crashes, leading to 192k register reads. Occasionally, we've seen the whole loop take over 20 seconds and then triggering the soft lockup detector.
Clearly, it is unreasonable to spin here for such extended periods of time.
To fix this, break the loop down into an outer and an inner loop, and break out of the inner loop if more than half a second elapsed. To avoid too much overhead, check for that only every 128 reads, though there's no particular reason for that number. Then, unlock and relock to obtain NIC access again, reprogram the start address and continue.
This will keep (interrupt) latencies on the CPU down to a reasonable time.
--- .../net/wireless/intel/iwlwifi/pcie/trans.c | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +27 -9
@@ -1927,18 +1927,36 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr, void *buf, int dwords) {unsigned long flags; -int offs, ret =0 ; +int offs =0 ;u32 *vals = buf; -if (iwl_trans_grab_nic_access (trans, &flags)) { -iwl_write32 (trans,HBUS_TARG_MEM_RADDR , addr); -for (offs =0 ; offs < dwords; offs++) - vals[offs] =iwl_read32 (trans,HBUS_TARG_MEM_RDAT ); -iwl_trans_release_nic_access (trans, &flags); - }else { - ret = -EBUSY ; +while (offs < dwords) { +/* limit the time we spin here under lock to 1/2s */ +ktime_t timeout =ktime_add_us (ktime_get (),500 *USEC_PER_MSEC ); + +if (iwl_trans_grab_nic_access (trans, &flags)) { +iwl_write32 (trans,HBUS_TARG_MEM_RADDR , + addr +4 * offs); + +while (offs < dwords) { + vals[offs] =iwl_read32 (trans, +HBUS_TARG_MEM_RDAT ); + offs++; + +/* calling ktime_get is expensive so +* do it once in 128 reads +*/ +if (offs %128 ==0 &&ktime_after (ktime_get (), + timeout)) +break ; + } +iwl_trans_release_nic_access (trans, &flags); + }else { +return -EBUSY ; + } } -return ret; + +return 0 ; } static int iwl_trans_pcie_write_mem(struct iwl_trans *trans, u32 addr,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 4/242 arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.
In reply to Greg Kroah-HartmanFrom: Markus Reichl <[email protected]>
[ Upstream commit 0011c6d182774fc781fb9e115ebe8baa356029ae ]
Recently introduced async probe on mmc devices can shuffle block IDs. Pin them to fixed values to ease booting in environments where UUIDs are not practical. Use newly introduced aliases for mmcblk devices from [1].
[1]
https://patchwork.kernel.org/patch/11747669/
--- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +3 -0
@@ -66,6 +66,9 @@ i2c6 = &i2c6; i2c7 = &i2c7; i2c8 = &i2c8; + mmc0 = &sdio0; + mmc1 = &sdmmc; + mmc2 = &sdhci; serial0 = &uart0; serial1 = &uart1; serial2 = &uart2;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 5/242 iwlwifi: mvm: fix kernel panic in case of assert during CSA
In reply to Greg Kroah-HartmanFrom: Sara Sharon <[email protected]>
[ Upstream commit fe56d05ee6c87f6a1a8c7267affd92c9438249cc ]
During CSA, we briefly nullify the phy context, in __iwl_mvm_unassign_vif_chanctx. In case we have a FW assert right after it, it remains NULL though. We end up running into endless loop due to mac80211 trying repeatedly to move us to ASSOC state, and we keep returning -EINVAL. Later down the road we hit a kernel panic.
Detect and avoid this endless loop.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 -1
@@ -2654,7 +2654,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,/* this would be a mac80211 bug ... but don't crash */ if (WARN_ON_ONCE (!mvmvif->phy_ctxt)) -return -EINVAL ; +return test_bit (IWL_MVM_STATUS_HW_RESTART_REQUESTED , &mvm->status) ?0 : -EINVAL ;/* * If we are in a STA removal flow and in DQA mode:
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 6/242 ARC: stack unwinding: dont assume non-current task is sleeping
In reply to Greg Kroah-HartmanFrom: Vineet Gupta <[email protected]>
[ Upstream commit e42404fa10fd11fe72d0a0e149a321d10e577715 ]
To start stack unwinding (SP, PC and BLINK) are needed. When the explicit execution context (pt_regs etc) is not available, unwinder assumes the task is sleeping (in __switch_to()) and fetches SP and BLINK from kernel mode stack.
But this assumption is not true, specially in a SMP system, when top runs on 1 core, there may be active running processes on all cores.
So when unwinding non courrent tasks, ensure they are NOT running.
And while at it, handle the self unwinding case explicitly.
This came out of investigation of a customer reported hang with rcutorture+top
--- arch/arc/kernel/stacktrace.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
arch/arc/kernel/stacktrace.c +15 -8
@@ -41,15 +41,15 @@#ifdef CONFIG_ARC_DW2_UNWIND -static void seed_unwind_frame_info (struct task_struct *tsk, -struct pt_regs *regs, -struct unwind_frame_info *frame_info) +static int +seed_unwind_frame_info (struct task_struct *tsk,struct pt_regs *regs, +struct unwind_frame_info *frame_info) {/* * synchronous unwinding (e.g. dump_stack) * - uses current values of SP and friends */ -if (tsk ==NULL && regs ==NULL ) { +if (regs ==NULL && (tsk ==NULL || tsk == current)) {unsigned long fp, sp, blink, ret; frame_info->task = current;
@@ -68,11 +68,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk, frame_info->call_frame =0 ; }else if (regs ==NULL ) {/* -* Asynchronous unwinding of sleeping task -* - Gets SP etc from task's pt_regs (saved bottom of kernel -* mode stack of task) +* Asynchronous unwinding of a likely sleeping task +* - first ensure it is actually sleeping +* - if so, it will be in __switch_to, kernel mode SP of task +* is safe-kept and BLINK at a well known location in there */ +if (tsk->state ==TASK_RUNNING ) +return -1 ; + frame_info->task = tsk; frame_info->regs.r27 =TSK_K_FP (tsk);
@@ -106,6 +110,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk, frame_info->regs.r63 = regs->ret; frame_info->call_frame = 0; } + +return 0 ; }#endif
@@ -119,7 +125,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,unsigned int address;struct unwind_frame_info frame_info; -seed_unwind_frame_info (tsk, regs, &frame_info); +if (seed_unwind_frame_info (tsk, regs, &frame_info)) +return 0 ;while (1 ) { address =UNW_PC (&frame_info);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 7/242 scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
[ Upstream commit 73cc291c270248567245f084dcdf5078069af6b5 ]
If someone plays with the UFS clk scaling devfreq governor through sysfs, ufshcd_devfreq_scale may be called even when HBA is not runtime ACTIVE. This can lead to unexpected error. We cannot just protect it by calling pm_runtime_get_sync() because that may cause a race condition since HBA runtime suspend ops need to suspend clk scaling. To fix this call pm_runtime_get_noresume() and check HBA's runtime status. Only proceed if HBA is runtime ACTIVE, otherwise just bail.
governor_store
devfreq_performance_handler
update_devfreq
devfreq_set_target
ufshcd_devfreq_target
ufshcd_devfreq_scale
--- drivers/scsi/ufs/ufshcd.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/ufs/ufshcd.c +7 -0
@@ -1215,8 +1215,15 @@ static int ufshcd_devfreq_target(struct device *dev, }spin_unlock_irqrestore (hba->host->host_lock, irq_flags); +pm_runtime_get_noresume (hba->dev); +if (!pm_runtime_active (hba->dev)) { +pm_runtime_put_noidle (hba->dev); + ret = -EAGAIN ; + goto out; + } start =ktime_get (); ret =ufshcd_devfreq_scale (hba, scale_up); +pm_runtime_put (hba->dev); trace_ufshcd_profile_clk_scaling(dev_name(hba->dev), (scale_up ? "up" : "down"),
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 8/242 soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)
In reply to Greg Kroah-HartmanFrom: Hao Si <[email protected]>
[ Upstream commit 2663b3388551230cbc4606a40fabf3331ceb59e4 ]
The local variable 'cpumask_t mask' is in the stack memory, and its address is assigned to 'desc->affinity' in 'irq_set_affinity_hint()'. But the memory area where this variable is located is at risk of being modified.
During LTP testing, the following error was generated:
Unable to handle kernel paging request at virtual address ffff000012e9b790
Mem abort info:
ESR = 0x96000007
Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000007
CM = 0, WnR = 0
swapper pgtable: 4k pages, 48-bit VAs, pgdp = 0000000075ac5e07 [ffff000012e9b790] pgd=00000027dbffe003, pud=00000027dbffd003, pmd=00000027b6d61003, pte=0000000000000000
Internal error: Oops: 96000007 [#1] PREEMPT SMP Modules linked in: xt_conntrack Process read_all (pid: 20171, stack limit = 0x0000000044ea4095) CPU: 14 PID: 20171 Comm: read_all Tainted: G B W Hardware name: NXP Layerscape LX2160ARDB (DT) pstate: 80000085 (Nzcv daIf -PAN -UAO) pc : irq_affinity_hint_proc_show+0x54/0xb0 lr : irq_affinity_hint_proc_show+0x4c/0xb0
sp : ffff00001138bc10
x29: ffff00001138bc10 x28: 0000ffffd131d1e0
x27: 00000000007000c0 x26: ffff8025b9480dc0
x25: ffff8025b9480da8 x24: 00000000000003ff
x23: ffff8027334f8300 x22: ffff80272e97d000
x21: ffff80272e97d0b0 x20: ffff8025b9480d80
x19: ffff000009a49000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000040
x11: 0000000000000000 x10: ffff802735b79b88 x9 : 0000000000000000 x8 : 0000000000000000 x7 : ffff000009a49848 x6 : 0000000000000003 x5 : 0000000000000000 x4 : ffff000008157d6c x3 : ffff00001138bc10 x2 : ffff000012e9b790 x1 : 0000000000000000 x0 : 0000000000000000
Call trace: irq_affinity_hint_proc_show+0x54/0xb0 seq_read+0x1b0/0x440 proc_reg_read+0x80/0xd8 __vfs_read+0x60/0x178 vfs_read+0x94/0x150 ksys_read+0x74/0xf0 __arm64_sys_read+0x24/0x30 el0_svc_common.constprop.0+0xd8/0x1a0 el0_svc_handler+0x34/0x88 el0_svc+0x10/0x14 Code: f9001bbf 943e0732 f94066c2 b4000062 (f9400041) ---[ end trace b495bdcb0b3b732b ]--- Kernel panic - not syncing: Fatal exception
SMP: stopping secondary CPUs
SMP: failed to stop secondary CPUs 0,2-4,6,8,11,13-15 Kernel Offset: disabled
CPU features: 0x0,21006008
Memory Limit: none
---[ end Kernel panic - not syncing: Fatal exception ]---
Fix it by using 'cpumask_of(cpu)' to get the cpumask.
--- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/fsl-mc/bus/dpio/dpio-driver.c +1 -4
@@ -77,7 +77,6 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)struct dpio_priv *priv;int error;struct fsl_mc_device_irq *irq; -cpumask_t mask; priv =dev_get_drvdata (&dpio_dev->dev);
@@ -96,9 +95,7 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu) }/* set the affinity hint */ -cpumask_clear (&mask); -cpumask_set_cpu (cpu, &mask); -if (irq_set_affinity_hint (irq->msi_desc->irq, &mask)) +if (irq_set_affinity_hint (irq->msi_desc->irq,cpumask_of (cpu)))dev_err (&dpio_dev->dev,"irq_set_affinity failed irq %d cpu %d\n" , irq->msi_desc->irq, cpu);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 9/242 platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
In reply to Greg Kroah-HartmanFrom: Timo Witte <[email protected]>
[ Upstream commit 9e7a005ad56aa7d6ea5830c5ffcc60bf35de380b ]
Got a dmesg message on my AMD Renoir based Acer laptop:
"acer_wmi: Unknown key number - 0x84" when toggling keyboard background light
--- drivers/platform/x86/acer-wmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/acer-wmi.c +1 -0
@@ -124,6 +124,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = { {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ {KE_IGNORE, 0x81, {KEY_SLEEP} }, {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */ + {KE_IGNORE, 0x84, {KEY_KBDILLUMTOGGLE} }, /* Automatic Keyboard background light toggle */ {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} }, {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} }, {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 10/242 Input: cm109 - do not stomp on control URB
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
commit 82e06090473289ce63e23fdeb8737aad59b10645 upstream.
We need to make sure we are not stomping on the control URB that was issued when opening the device when attempting to toggle buzzer. To do that we need to mark it as pending in cm109_open().
--- drivers/input/misc/cm109.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/input/misc/cm109.c +5 -2
@@ -571,12 +571,15 @@ static int cm109_input_open(struct input dev->ctl_data->byte[HID_OR2 ] = dev->keybit; dev->ctl_data->byte[HID_OR3 ] =0x00 ; + dev->ctl_urb_pending =1 ; error =usb_submit_urb (dev->urb_ctl,GFP_KERNEL ); -if (error) +if (error) { + dev->ctl_urb_pending =0 ;dev_err (&dev->intf->dev,"%s: usb_submit_urb (urb_ctl) failed %d\n" , __func__, error); -else + }else { dev->open =1 ; + }mutex_unlock (&dev->pm_mutex);
Greg Kroah-Hartman
maintainerPATCH 11/242 Input: i8042 - add Acer laptops to the i8042 reset list
In reply to Greg Kroah-HartmanFrom: Chris Chiu <[email protected]>
commit ce6520b0eafad5962ffc21dc47cd7bd3250e9045 upstream.
The touchpad operates in Basic Mode by default in the Acer BIOS setup, but some Aspire/TravelMate models require the i8042 to be reset in order to be correctly detected.
--- drivers/input/serio/i8042-x86ia64io.h | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +42 -0
@@ -616,6 +616,48 @@ static const struct dmi_system_id __init }, }, { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"), + }, + }, + {/* Advent 4211 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
Greg Kroah-Hartman
maintainerPATCH 12/242 pinctrl: amd: remove debounce filter setting in IRQ type setting
In reply to Greg Kroah-HartmanFrom: Coiby Xu <[email protected]>
commit 47a0001436352c9853d72bf2071e85b316d688a2 upstream.
Debounce filter setting should be independent from IRQ type setting because according to the ACPI specs, there are separate arguments for specifying debounce timeout and IRQ type in GpioIo() and GpioInt().
Together with commit 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter") and Andy's patch "gpiolib: acpi: Take into account debounce settings" [1], this will fix broken touchpads for laptops whose BIOS set the debounce timeout to a relatively large value. For example, the BIOS of Lenovo AMD gaming laptops including Legion-5 15ARH05 (R7000), Legion-5P (R7000P) and IdeaPad Gaming 3 15ARH05, set the debounce timeout to 124.8ms. This led to the kernel receiving only ~7 HID reports per second from the Synaptics touchpad
(MSFT0001:00 06CB:7F28).
Existing touchpads like [2][3] are not troubled by this bug because the debounce timeout has been set to 0 by the BIOS before enabling the debounce filter in setting IRQ type.
[1] https://lore.kernel.org/linux-gpio/[email protected]/
8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
[2] https://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
[3] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28
--- drivers/pinctrl/pinctrl-amd.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/pinctrl/pinctrl-amd.c +0 -7
@@ -426,7 +426,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_HIGH <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -434,7 +433,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_LOW <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -442,7 +440,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT (LEVEL_TRIG_OFF ); pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=BOTH_EADGE <<ACTIVE_LEVEL_OFF ; - pin_reg |=DB_TYPE_REMOVE_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_edge_irq);break ;
@@ -450,8 +447,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |=LEVEL_TRIGGER <<LEVEL_TRIG_OFF ; pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_HIGH <<ACTIVE_LEVEL_OFF ; - pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); - pin_reg |=DB_TYPE_PRESERVE_LOW_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_level_irq);break ;
@@ -459,8 +454,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |=LEVEL_TRIGGER <<LEVEL_TRIG_OFF ; pin_reg &= ~(ACTIVE_LEVEL_MASK <<ACTIVE_LEVEL_OFF ); pin_reg |=ACTIVE_LOW <<ACTIVE_LEVEL_OFF ; - pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); - pin_reg |=DB_TYPE_PRESERVE_HIGH_GLITCH <<DB_CNTRL_OFF ;irq_set_handler_locked (d, handle_level_irq);break ;
Greg Kroah-Hartman
maintainerPATCH 13/242 kbuild: avoid static_assert for genksyms
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 14dc3983b5dff513a90bd5a8cc90acaf7867c3d0 upstream.
genksyms does not know or care about the _Static_assert() built-in, and sometimes falls back to ignoring the later symbols, which causes undefined behavior such as
WARNING: modpost: EXPORT symbol "ethtool_set_ethtool_phy_ops" [vmlinux] version generation failed, symbol will not be versioned.
ld: net/ethtool/common.o: relocation R_AARCH64_ABS32 against `__crc_ethtool_set_ethtool_phy_ops' can not be used when making a shared object net/ethtool/common.o:(_ftrace_annotated_branch+0x0): dangerous relocation: unsupported relocation
Redefine static_assert for genksyms to avoid that.
--- include/linux/build_bug.h | 5 +++++ 1 file changed, 5 insertions(+)
include/linux/build_bug.h +5 -0
@@ -82,4 +82,9 @@#endif /* __CHECKER__ */ +#ifdef __GENKSYMS__ +/* genksyms gets confused by _Static_assert */ +#define _Static_assert (expr, ...) +#endif +#endif /* _LINUX_BUILD_BUG_H */
Greg Kroah-Hartman
maintainerPATCH 14/242 scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit eeaf06af6f87e1dba371fbe42674e6f963220b9c upstream.
My patch caused kernel Oopses and delays in boot. Revert it.
The problem was that I moved the "mem->dma = paddr;" before the call to be_fill_queue(). But the first thing that the be_fill_queue() function does is memset the whole struct to zero which overwrites the assignment.
--- drivers/scsi/be2iscsi/be_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/be2iscsi/be_main.c +2 -2
@@ -3013,7 +3013,6 @@ static int beiscsi_create_eqs(struct bei goto create_eq_error; } - mem->dma = paddr; mem->va = eq_vaddress; ret =be_fill_queue (eq, phba->params.num_eq_entries,sizeof (struct be_eq_entry ), eq_vaddress);
@@ -3023,6 +3022,7 @@ static int beiscsi_create_eqs(struct bei goto create_eq_error; } + mem->dma = paddr; ret =beiscsi_cmd_eq_create (&phba->ctrl, eq, phwi_context->cur_eqd);if (ret) {
@@ -3079,7 +3079,6 @@ static int beiscsi_create_cqs(struct bei goto create_cq_error; } - mem->dma = paddr; ret =be_fill_queue (cq, phba->params.num_cq_entries,sizeof (struct sol_cqe ), cq_vaddress);if (ret) {
@@ -3089,6 +3088,7 @@ static int beiscsi_create_cqs(struct bei goto create_cq_error; } + mem->dma = paddr; ret =beiscsi_cmd_cq_create (&phba->ctrl, cq, eq, false, false,0 );if (ret) {
Greg Kroah-Hartman
maintainerPATCH 15/242 x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
In reply to Greg Kroah-HartmanFrom: Arvind Sankar <[email protected]>
commit 29ac40cbed2bc06fa218ca25d7f5e280d3d08a25 upstream.
The PAT bit is in different locations for 4k and 2M/1G page table entries.
Add a definition for _PAGE_LARGE_CACHE_MASK to represent the three caching bits (PWT, PCD, PAT), similar to _PAGE_CACHE_MASK for 4k pages, and use it in the definition of PMD_FLAGS_DEC_WP to get the correct PAT index for write-protected pages.
--- arch/x86/include/asm/pgtable_types.h | 1 + arch/x86/mm/mem_encrypt.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/include/asm/pgtable_types.h +1 -0
@@ -148,6 +148,7 @@ enum page_cache_mode {#endif #define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT) +#define _PAGE_LARGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)#define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC))#define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP))
arch/x86/mm/mem_encrypt.c +2 -2
@@ -248,8 +248,8 @@ static void __init sme_clear_pgd(struct#define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)#define PMD_FLAGS_DEC PMD_FLAGS_LARGE -#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \ - (_PAGE_PAT | _PAGE_PWT)) +#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \ + (_PAGE_PAT_LARGE | _PAGE_PWT))#define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC)
Greg Kroah-Hartman
maintainerPATCH 16/242 PCI: qcom: Add missing reset for ipq806x
In reply to Greg Kroah-HartmanFrom: Ansuel Smith <[email protected]>
commit ee367e2cdd2202b5714982739e684543cd2cee0e upstream
Add missing ext reset used by ipq8064 SoC in PCIe qcom driver.
--- drivers/pci/dwc/pcie-qcom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/pci/dwc/pcie-qcom.c +12 -0
@@ -96,6 +96,7 @@ struct qcom_pcie_resources_2_1_0 {struct reset_control *ahb_reset;struct reset_control *por_reset;struct reset_control *phy_reset; +struct reset_control *ext_reset;struct regulator *vdda;struct regulator *vdda_phy;struct regulator *vdda_refclk;
@@ -265,6 +266,10 @@ static int qcom_pcie_get_resources_2_1_0if (IS_ERR (res->por_reset))return PTR_ERR (res->por_reset); + res->ext_reset =devm_reset_control_get_optional_exclusive (dev,"ext" ); +if (IS_ERR (res->ext_reset)) +return PTR_ERR (res->ext_reset); + res->phy_reset =devm_reset_control_get_exclusive (dev,"phy" );return PTR_ERR_OR_ZERO (res->phy_reset); }
@@ -277,6 +282,7 @@ static void qcom_pcie_deinit_2_1_0(strucreset_control_assert (res->axi_reset);reset_control_assert (res->ahb_reset);reset_control_assert (res->por_reset); +reset_control_assert (res->ext_reset);reset_control_assert (res->pci_reset);clk_disable_unprepare (res->iface_clk);clk_disable_unprepare (res->core_clk);
@@ -342,6 +348,12 @@ static int qcom_pcie_init_2_1_0(struct q goto err_deassert_ahb; } + ret =reset_control_deassert (res->ext_reset); +if (ret) { +dev_err (dev,"cannot deassert ext reset\n" ); + goto err_deassert_ahb; + } +/* enable PCIe clocks and resets */ val =readl (pcie->parf +PCIE20_PARF_PHY_CTRL ); val &= ~BIT (0 );
Greg Kroah-Hartman
maintainerPATCH 17/242 net: stmmac: free tx skb buffer in stmmac_resume()
In reply to Greg Kroah-HartmanFrom: Fugang Duan <[email protected]>
[ Upstream commit 4ec236c7c51f89abb0224a4da4a6b77f9beb6600 ]
When do suspend/resume test, there have WARN_ON() log dump from stmmac_xmit() funciton, the code logic:
entry = tx_q->cur_tx; first_entry = entry; WARN_ON(tx_q->tx_skbuff[first_entry]);
In normal case, tx_q->tx_skbuff[txq->cur_tx] should be NULL because the skb should be handled and freed in stmmac_tx_clean().
But stmmac_resume() reset queue parameters like below, skb buffers may not be freed.
tx_q->cur_tx = 0; tx_q->dirty_tx = 0;
So free tx skb buffer in stmmac_resume() to avoid warning and memory leak.
log:
[ 46.139824] ------------[ cut here ]------------ [ 46.144453] WARNING: CPU: 0 PID: 0 at drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3235 stmmac_xmit+0x7a0/0x9d0 [ 46.154969] Modules linked in: crct10dif_ce vvcam(O) flexcan can_dev [ 46.161328] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 5.4.24-2.1.0+g2ad925d15481 #1 [ 46.170369] Hardware name: NXP i.MX8MPlus EVK board (DT) [ 46.175677] pstate: 80000005 (Nzcv daif -PAN -UAO) [ 46.180465] pc : stmmac_xmit+0x7a0/0x9d0 [ 46.184387] lr : dev_hard_start_xmit+0x94/0x158 [ 46.188913] sp : ffff800010003cc0 [ 46.192224] x29: ffff800010003cc0 x28: ffff000177e2a100 [ 46.197533] x27: ffff000176ef0840 x26: ffff000176ef0090 [ 46.202842] x25: 0000000000000000 x24: 0000000000000000 [ 46.208151] x23: 0000000000000003 x22: ffff8000119ddd30 [ 46.213460] x21: ffff00017636f000 x20: ffff000176ef0cc0 [ 46.218769] x19: 0000000000000003 x18: 0000000000000000 [ 46.224078] x17: 0000000000000000 x16: 0000000000000000 [ 46.229386] x15: 0000000000000079 x14: 0000000000000000 [ 46.234695] x13: 0000000000000003 x12: 0000000000000003 [ 46.240003] x11: 0000000000000010 x10: 0000000000000010 [ 46.245312] x9 : ffff00017002b140 x8 : 0000000000000000 [ 46.250621] x7 : ffff00017636f000 x6 : 0000000000000010 [ 46.255930] x5 : 0000000000000001 x4 : ffff000176ef0000 [ 46.261238] x3 : 0000000000000003 x2 : 00000000ffffffff [ 46.266547] x1 : ffff000177e2a000 x0 : 0000000000000000 [ 46.271856] Call trace: [ 46.274302] stmmac_xmit+0x7a0/0x9d0 [ 46.277874] dev_hard_start_xmit+0x94/0x158 [ 46.282056] sch_direct_xmit+0x11c/0x338 [ 46.285976] __qdisc_run+0x118/0x5f0 [ 46.289549] net_tx_action+0x110/0x198 [ 46.293297] __do_softirq+0x120/0x23c [ 46.296958] irq_exit+0xb8/0xd8 [ 46.300098] __handle_domain_irq+0x64/0xb8 [ 46.304191] gic_handle_irq+0x5c/0x148 [ 46.307936] el1_irq+0xb8/0x180 [ 46.311076] cpuidle_enter_state+0x84/0x360 [ 46.315256] cpuidle_enter+0x34/0x48 [ 46.318829] call_cpuidle+0x18/0x38 [ 46.322314] do_idle+0x1e0/0x280 [ 46.325539] cpu_startup_entry+0x24/0x40 [ 46.329460] rest_init+0xd4/0xe0 [ 46.332687] arch_call_rest_init+0xc/0x14 [ 46.336695] start_kernel+0x420/0x44c [ 46.340353] ---[ end trace bc1ee695123cbacd ]---
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +14 -0
@@ -1429,6 +1429,19 @@ static void dma_free_tx_skbufs(struct st }/** +* stmmac_free_tx_skbufs - free TX skb buffers +* @priv: private structure +*/ +static void stmmac_free_tx_skbufs (struct stmmac_priv *priv) +{ +u32 tx_queue_cnt = priv->plat->tx_queues_to_use; +u32 queue; + +for (queue =0 ; queue < tx_queue_cnt; queue++) +dma_free_tx_skbufs (priv, queue); +} + +/** * free_dma_rx_desc_resources - free RX dma desc resources * @priv: private structure */
@@ -4503,6 +4516,7 @@ int stmmac_resume(struct device *dev)*/ priv->mss =0 ; +stmmac_free_tx_skbufs (priv);stmmac_clear_descriptors (priv);stmmac_hw_setup (ndev, false);
Greg Kroah-Hartman
maintainerPATCH 18/242 tcp: fix cwnd-limited bug for TSO deferral where we send nothing
In reply to Greg Kroah-HartmanFrom: Neal Cardwell <[email protected]>
[ Upstream commit 299bcb55ecd1412f6df606e9dc0912d55610029e ]
When cwnd is not a multiple of the TSO skb size of N*MSS, we can get into persistent scenarios where we have the following sequence:
(1) ACK for full-sized skb of N*MSS arrives
-> tcp_write_xmit() transmit full-sized skb with N*MSS -> move pacing release time forward
-> exit tcp_write_xmit() because pacing time is in the future
(2) TSQ callback or TCP internal pacing timer fires
-> try to transmit next skb, but TSO deferral finds remainder of
available cwnd is not big enough to trigger an immediate send now, so we defer sending until the next ACK.
(3) repeat...
So we can get into a case where we never mark ourselves as cwnd-limited for many seconds at a time, even with bulk/infinite-backlog senders, because:
o In case (1) above, every time in tcp_write_xmit() we have enough cwnd to send a full-sized skb, we are not fully using the cwnd (because cwnd is not a multiple of the TSO skb size). So every time we send data, we are not cwnd limited, and so in the cwnd-limited tracking code in tcp_cwnd_validate() we mark ourselves as not cwnd-limited.
o In case (2) above, every time in tcp_write_xmit() that we try to transmit the "remainder" of the cwnd but defer, we set the local variable is_cwnd_limited to true, but we do not send any packets, so sent_pkts is zero, so we don't call the cwnd-limited logic to update tp->is_cwnd_limited.
--- net/ipv4/tcp_output.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/ipv4/tcp_output.c +6 -3
@@ -1620,7 +1620,8 @@ static void tcp_cwnd_validate(struct soc* window, and remember whether we were cwnd-limited then. */ if (!before (tp->snd_una, tp->max_packets_seq) || - tp->packets_out > tp->max_packets_out) { + tp->packets_out > tp->max_packets_out || + is_cwnd_limited) { tp->max_packets_out = tp->packets_out; tp->max_packets_seq = tp->snd_nxt; tp->is_cwnd_limited = is_cwnd_limited;
@@ -2411,6 +2412,10 @@ repair:else tcp_chrono_stop (sk,TCP_CHRONO_RWND_LIMITED ); + is_cwnd_limited |= (tcp_packets_in_flight (tp) >= tp->snd_cwnd); +if (likely (sent_pkts || is_cwnd_limited)) +tcp_cwnd_validate (sk, is_cwnd_limited); +if (likely (sent_pkts)) {if (tcp_in_cwnd_reduction (sk)) tp->prr_out += sent_pkts;
@@ -2418,8 +2423,6 @@ repair:/* Send one loss probe per tail loss episode. */ if (push_one !=2 )tcp_schedule_loss_probe (sk, false); - is_cwnd_limited |= (tcp_packets_in_flight (tp) >= tp->snd_cwnd); -tcp_cwnd_validate (sk, is_cwnd_limited);return false; }return !tp->packets_out &&tcp_send_head (sk);
Greg Kroah-Hartman
maintainerPATCH 19/242 net/mlx4_en: Avoid scheduling restart task if it is already running
In reply to Greg Kroah-HartmanFrom: Moshe Shemesh <[email protected]>
[ Upstream commit fed91613c9dd455dd154b22fa8e11b8526466082 ]
Add restarting state flag to avoid scheduling another restart task while such task is already running. Change task name from watchdog_task to restart_task to better fit the task role.
--- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 20 +++++++++++++------- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 7 ++++++- 2 files changed, 19 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +13 -7
@@ -1389,8 +1389,10 @@ static void mlx4_en_tx_timeout(struct ne } priv->port_stats.tx_timeout++; -en_dbg (DRV , priv,"Scheduling watchdog\n" ); -queue_work (mdev->workqueue, &priv->watchdog_task); +if (!test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state)) { +en_dbg (DRV , priv,"Scheduling port restart\n" ); +queue_work (mdev->workqueue, &priv->restart_task); + } }
@@ -1839,6 +1841,7 @@ int mlx4_en_start_port(struct net_devicelocal_bh_enable (); } +clear_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state);netif_tx_start_all_queues (dev);netif_device_attach (dev);
@@ -2009,7 +2012,7 @@ void mlx4_en_stop_port(struct net_devicestatic void mlx4_en_restart (struct work_struct *work) { struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, - watchdog_task); + restart_task);struct mlx4_en_dev *mdev = priv->mdev;struct net_device *dev = priv->dev;
@@ -2388,7 +2391,7 @@ static int mlx4_en_change_mtu(struct netif (netif_running (dev)) {mutex_lock (&mdev->state_lock);if (!mdev->device_up) { -/* NIC is probably restarting - let watchdog task reset +/* NIC is probably restarting - let restart task reset * the port */ en_dbg (DRV , priv,"Change MTU called with card down!?\n" ); }else {
@@ -2397,7 +2400,9 @@ static int mlx4_en_change_mtu(struct netif (err) {en_err (priv,"Failed restarting port:%d\n" , priv->port); -queue_work (mdev->workqueue, &priv->watchdog_task); +if (!test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , + &priv->state)) +queue_work (mdev->workqueue, &priv->restart_task); } }mutex_unlock (&mdev->state_lock);
@@ -2883,7 +2888,8 @@ static int mlx4_xdp_set(struct net_devicif (err) {en_err (priv,"Failed starting port %d for XDP change\n" , priv->port); -queue_work (mdev->workqueue, &priv->watchdog_task); +if (!test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state)) +queue_work (mdev->workqueue, &priv->restart_task); } }
@@ -3284,7 +3290,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->counter_index =MLX4_SINK_COUNTER_INDEX (mdev->dev);spin_lock_init (&priv->stats_lock);INIT_WORK (&priv->rx_mode_task, mlx4_en_do_set_rx_mode); -INIT_WORK (&priv->watchdog_task, mlx4_en_restart); +INIT_WORK (&priv->restart_task, mlx4_en_restart);INIT_WORK (&priv->linkstate_task, mlx4_en_linkstate);INIT_DELAYED_WORK (&priv->stats_task, mlx4_en_do_get_stats);INIT_DELAYED_WORK (&priv->service_task, mlx4_en_service_task);
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +6 -1
@@ -525,6 +525,10 @@ struct mlx4_en_stats_bitmap {struct mutex mutex;/* for mutual access to stats bitmap */ }; +enum { +MLX4_EN_STATE_FLAG_RESTARTING , +}; +struct mlx4_en_priv {struct mlx4_en_dev *mdev;struct mlx4_en_port_profile *prof;
@@ -590,7 +594,7 @@ struct mlx4_en_priv {struct mlx4_en_cq *rx_cq[MAX_RX_RINGS ];struct mlx4_qp drop_qp;struct work_struct rx_mode_task; -struct work_struct watchdog_task; +struct work_struct restart_task;struct work_struct linkstate_task;struct delayed_work stats_task;struct delayed_work service_task;
@@ -637,6 +641,7 @@ struct mlx4_en_priv {u32 pflags;u8 rss_key[MLX4_EN_RSS_KEY_SIZE ];u8 rss_hash_fn; +unsigned long state; };enum mlx4_en_wol {
Greg Kroah-Hartman
maintainerPATCH 20/242 net/mlx4_en: Handle TX error CQE
In reply to Greg Kroah-HartmanFrom: Moshe Shemesh <[email protected]>
[ Upstream commit ba603d9d7b1215c72513d7c7aa02b6775fd4891b ]
In case error CQE was found while polling TX CQ, the QP is in error state and all posted WQEs will generate error CQEs without any data transmitted. Fix it by reopening the channels, via same method used for TX timeout handling.
In addition add some more info on error CQE and WQE for debug.
--- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 drivers/net/ethernet/mellanox/mlx4/en_tx.c | 40 ++++++++++++++++++++----- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 5 +++ 3 files changed, 39 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 -0
@@ -1746,6 +1746,7 @@ int mlx4_en_start_port(struct net_devicemlx4_en_deactivate_cq (priv, cq); goto tx_err; } +clear_bit (MLX4_EN_TX_RING_STATE_RECOVERING , &tx_ring->state);if (t !=TX_XDP ) { tx_ring->tx_queue =netdev_get_tx_queue (dev, i); tx_ring->recycle_ring =NULL ;
drivers/net/ethernet/mellanox/mlx4/en_tx.c +33 -7
@@ -385,6 +385,35 @@ int mlx4_en_free_tx_buf(struct net_devicreturn cnt; } +static void mlx4_en_handle_err_cqe (struct mlx4_en_priv *priv,struct mlx4_err_cqe *err_cqe, +u16 cqe_index,struct mlx4_en_tx_ring *ring) +{ +struct mlx4_en_dev *mdev = priv->mdev; +struct mlx4_en_tx_info *tx_info; +struct mlx4_en_tx_desc *tx_desc; +u16 wqe_index; +int desc_size; + +en_err (priv,"CQE error - cqn 0x%x, ci 0x%x, vendor syndrome: 0x%x syndrome: 0x%x\n" , + ring->sp_cqn, cqe_index, err_cqe->vendor_err_syndrome, err_cqe->syndrome); +print_hex_dump (KERN_WARNING ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , err_cqe,sizeof (*err_cqe), + false); + + wqe_index =be16_to_cpu (err_cqe->wqe_index) & ring->size_mask; + tx_info = &ring->tx_info[wqe_index]; + desc_size = tx_info->nr_txbb <<LOG_TXBB_SIZE ; +en_err (priv,"Related WQE - qpn 0x%x, wqe index 0x%x, wqe size 0x%x\n" , ring->qpn, + wqe_index, desc_size); + tx_desc = ring->buf + (wqe_index <<LOG_TXBB_SIZE ); +print_hex_dump (KERN_WARNING ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , tx_desc, desc_size, false); + +if (test_and_set_bit (MLX4_EN_STATE_FLAG_RESTARTING , &priv->state)) +return ; + +en_err (priv,"Scheduling port restart\n" ); +queue_work (mdev->workqueue, &priv->restart_task); +} +bool mlx4_en_process_tx_cq (struct net_device *dev,struct mlx4_en_cq *cq,int napi_budget) {
@@ -431,13 +460,10 @@ bool mlx4_en_process_tx_cq(struct net_dedma_rmb ();if (unlikely ((cqe->owner_sr_opcode &MLX4_CQE_OPCODE_MASK ) == -MLX4_CQE_OPCODE_ERROR )) { -struct mlx4_err_cqe *cqe_err = (struct mlx4_err_cqe *)cqe; - -en_err (priv,"CQE error - vendor syndrome: 0x%x syndrome: 0x%x\n" , - cqe_err->vendor_err_syndrome, - cqe_err->syndrome); - } +MLX4_CQE_OPCODE_ERROR )) +if (!test_and_set_bit (MLX4_EN_TX_RING_STATE_RECOVERING , &ring->state)) +mlx4_en_handle_err_cqe (priv, (struct mlx4_err_cqe *)cqe, index, + ring);/* Skip over last polled CQE */ new_index =be16_to_cpu (cqe->wqe_index) & size_mask;
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +5 -0
@@ -267,6 +267,10 @@ struct mlx4_en_page_cache { } buf[MLX4_EN_CACHE_SIZE ]; }; +enum { +MLX4_EN_TX_RING_STATE_RECOVERING , +}; +struct mlx4_en_priv ;struct mlx4_en_tx_ring {
@@ -313,6 +317,7 @@ struct mlx4_en_tx_ring {* Only queue_stopped might be used if BQL is not properly working. */ unsigned long queue_stopped; +unsigned long state;struct mlx4_hwq_resources sp_wqres;struct mlx4_qp sp_qp;struct mlx4_qp_context sp_context;
Greg Kroah-Hartman
maintainerPATCH 21/242 net: stmmac: delete the eee_ctrl_timer after napi disabled
In reply to Greg Kroah-HartmanFrom: Fugang Duan <[email protected]>
[ Upstream commit 5f58591323bf3f342920179f24515935c4b5fd60 ]
There have chance to re-enable the eee_ctrl_timer and fire the timer in napi callback after delete the timer in .stmmac_release(), which introduces to access eee registers in the timer function after clocks are disabled then causes system hang. Found this issue when do suspend/resume and reboot stress test.
It is safe to delete the timer after napi disabled and disable lpi mode.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 -3
@@ -2705,9 +2705,6 @@ static int stmmac_release(struct net_dev {struct stmmac_priv *priv =netdev_priv (dev); -if (priv->eee_enabled) -del_timer_sync (&priv->eee_ctrl_timer); -/* Stop and disconnect the PHY */ if (dev->phydev) {phy_stop (dev->phydev);
@@ -2727,6 +2724,11 @@ static int stmmac_release(struct net_devif (priv->lpi_irq >0 )free_irq (priv->lpi_irq, dev); +if (priv->eee_enabled) { + priv->tx_path_in_lpi_mode = false; +del_timer_sync (&priv->eee_ctrl_timer); + } +/* Stop TX/RX DMA and clear the descriptors */ stmmac_stop_all_dma (priv);
@@ -4418,6 +4420,11 @@ int stmmac_suspend(struct device *dev)stmmac_disable_all_queues (priv); +if (priv->eee_enabled) { + priv->tx_path_in_lpi_mode = false; +del_timer_sync (&priv->eee_ctrl_timer); + } +/* Stop TX/RX DMA */ stmmac_stop_all_dma (priv);
Greg Kroah-Hartman
maintainerPATCH 22/242 net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 82ca4c922b8992013a238d65cf4e60cc33e12f36 ]
The m250_sel mux clock uses bit 4 in the PRG_ETH0 register. Fix this by shifting the PRG_ETH0_CLK_M250_SEL_MASK accordingly as the "mask" in struct clk_mux expects the mask relative to the "shift" field in the same struct.
While here, get rid of the PRG_ETH0_CLK_M250_SEL_SHIFT macro and use __ffs() to determine it from the existing PRG_ETH0_CLK_M250_SEL_MASK macro.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +3 -3
@@ -30,7 +30,6 @@#define PRG_ETH0_RGMII_MODE BIT(0)/* mux to choose between fclk_div2 (bit unset) and mpll2 (bit set) */ -#define PRG_ETH0_CLK_M250_SEL_SHIFT 4#define PRG_ETH0_CLK_M250_SEL_MASK GENMASK(4, 4)#define PRG_ETH0_TXDLY_SHIFT 5
@@ -121,8 +120,9 @@ static int meson8b_init_clk(struct meson init.num_parents =MUX_CLK_NUM_PARENTS ; dwmac->m250_mux.reg = dwmac->regs +PRG_ETH0 ; - dwmac->m250_mux.shift =PRG_ETH0_CLK_M250_SEL_SHIFT ; - dwmac->m250_mux.mask =PRG_ETH0_CLK_M250_SEL_MASK ; + dwmac->m250_mux.shift =__ffs (PRG_ETH0_CLK_M250_SEL_MASK ); + dwmac->m250_mux.mask =PRG_ETH0_CLK_M250_SEL_MASK >> + dwmac->m250_mux.shift; dwmac->m250_mux.flags =0 ; dwmac->m250_mux.table =NULL ; dwmac->m250_mux.hw.init = &init;
Greg Kroah-Hartman
maintainerPATCH 23/242 net: bridge: vlan: fix error return code in __vlan_add()
In reply to Greg Kroah-HartmanFrom: Zhang Changzhong <[email protected]>
[ Upstream commit ee4f52a8de2c6f78b01f10b4c330867d88c1653a ]
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- net/bridge/br_vlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/bridge/br_vlan.c +3 -1
@@ -241,8 +241,10 @@ static int __vlan_add(struct net_bridge_ } masterv =br_vlan_get_master (br, v->vid); -if (!masterv) +if (!masterv) { + err = -ENOMEM ; goto out_filt; + } v->brvlan = masterv; v->stats = masterv->stats; }
Greg Kroah-Hartman
maintainerPATCH 24/242 mac80211: mesh: fix mesh_pathtbl_init() error path
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 905b2032fa424f253d9126271439cc1db2b01130 ]
If tbl_mpp can not be allocated, we call mesh_table_free(tbl_path) while tbl_path rhashtable has not yet been initialized, which causes panics.
Simply factorize the rhashtable_init() call into mesh_table_alloc()
WARNING: CPU: 1 PID: 8474 at kernel/workqueue.c:3040 __flush_work kernel/workqueue.c:3040 [inline] WARNING: CPU: 1 PID: 8474 at kernel/workqueue.c:3040 __cancel_work_timer+0x514/0x540 kernel/workqueue.c:3136 Modules linked in: CPU: 1 PID: 8474 Comm: syz-executor663 Not tainted 5.10.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__flush_work kernel/workqueue.c:3040 [inline] RIP: 0010:__cancel_work_timer+0x514/0x540 kernel/workqueue.c:3136 Code: 5d c3 e8 bf ae 29 00 0f 0b e9 f0 fd ff ff e8 b3 ae 29 00 0f 0b 43 80 3c 3e 00 0f 85 31 ff ff ff e9 34 ff ff ff e8 9c ae 29 00 <0f> 0b e9 dc fe ff ff 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 7d fd ff RSP: 0018:ffffc9000165f5a0 EFLAGS: 00010293 RAX: ffffffff814b7064 RBX: 0000000000000001 RCX: ffff888021c80000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888024039ca0 R08: dffffc0000000000 R09: fffffbfff1dd3e64 R10: fffffbfff1dd3e64 R11: 0000000000000000 R12: 1ffff920002cbebd R13: ffff888024039c88 R14: 1ffff11004807391 R15: dffffc0000000000 FS: 0000000001347880(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000140 CR3: 000000002cc0a000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: rhashtable_free_and_destroy+0x25/0x9c0 lib/rhashtable.c:1137 mesh_table_free net/mac80211/mesh_pathtbl.c:69 [inline] mesh_pathtbl_init+0x287/0x2e0 net/mac80211/mesh_pathtbl.c:785 ieee80211_mesh_init_sdata+0x2ee/0x530 net/mac80211/mesh.c:1591 ieee80211_setup_sdata+0x733/0xc40 net/mac80211/iface.c:1569 ieee80211_if_add+0xd5c/0x1cd0 net/mac80211/iface.c:1987 ieee80211_add_iface+0x59/0x130 net/mac80211/cfg.c:125 rdev_add_virtual_intf net/wireless/rdev-ops.h:45 [inline] nl80211_new_interface+0x563/0xb40 net/wireless/nl80211.c:3855 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0xe4e/0x1280 net/netlink/genetlink.c:800 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2494 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x780/0x930 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x9a8/0xd40 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg net/socket.c:671 [inline] ____sys_sendmsg+0x519/0x800 net/socket.c:2353 ___sys_sendmsg net/socket.c:2407 [inline] __sys_sendmsg+0x2b1/0x360 net/socket.c:2440 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- net/mac80211/mesh_pathtbl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/mac80211/mesh_pathtbl.c +1 -3
@@ -61,6 +61,7 @@ static struct mesh_table *mesh_table_allINIT_HLIST_HEAD (&newtbl->known_gates);atomic_set (&newtbl->entries,0 );spin_lock_init (&newtbl->gates_lock); +rhashtable_init (&newtbl->rhead, &mesh_rht_params);return newtbl; }
@@ -851,9 +852,6 @@ int mesh_pathtbl_init(struct ieee80211_s goto free_path; } -rhashtable_init (&tbl_path->rhead, &mesh_rht_params); -rhashtable_init (&tbl_mpp->rhead, &mesh_rht_params); - sdata->u.mesh.mesh_paths = tbl_path; sdata->u.mesh.mpp_paths = tbl_mpp;
Greg Kroah-Hartman
maintainerPATCH 25/242 USB: dummy-hcd: Fix uninitialized array use in init()
In reply to Greg Kroah-HartmanFrom: Bui Quang Minh <[email protected]>
commit e90cfa813da7a527785033a0b247594c2de93dd8 upstream.
This error path
err_add_pdata: for (i = 0; i < mod_data.num; i++) kfree(dum[i]);
can be triggered when not all dum's elements are initialized.
Fix this by initializing all dum's elements to NULL.
--- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/dummy_hcd.c +1 -1
@@ -2742,7 +2742,7 @@ static int __init init(void) {int retval = -ENOMEM ;int i; -struct dummy *dum[MAX_NUM_UDC ]; +struct dummy *dum[MAX_NUM_UDC ] = {};if (usb_disabled ())return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 26/242 USB: add RESET_RESUME quirk for Snapscan 1212
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 08a02f954b0def3ada8ed6d4b2c7bcb67e885e9c upstream.
I got reports that some models of this old scanner need this when using runtime PM.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -189,6 +189,9 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x06a3, 0x0006), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Agfa SNAPSCAN 1212U */ + { USB_DEVICE(0x06bd, 0x0001), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */ { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 27/242 ALSA: usb-audio: Fix potential out-of-bounds shift
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 43d5ca88dfcd35e43010fdd818e067aa9a55f5ba upstream.
syzbot spotted a potential out-of-bounds shift in the USB-audio format parser that receives the arbitrary shift value from the USB descriptor.
Add a range check for avoiding the undefined behavior.
--- sound/usb/format.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/format.c +2 -0
@@ -52,6 +52,8 @@ static u64 parse_audio_format_i_type(strcase UAC_VERSION_1 :default : {struct uac_format_type_i_discrete_descriptor *fmt = _fmt; +if (format >=64 ) +return 0 ;/* invalid format */ sample_width = fmt->bBitResolution; sample_bytes = fmt->bSubframeSize; format =1 << format;
Greg Kroah-Hartman
maintainerPATCH 28/242 ALSA: usb-audio: Fix control access overflow errors from chmap
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit c6dde8ffd071aea9d1ce64279178e470977b235c upstream.
The current channel-map control implementation in USB-audio driver may lead to an error message like
"control 3:0:0:Playback Channel Map:0: access overflow"
when CONFIG_SND_CTL_VALIDATION is set. It's because the chmap get callback clears the whole array no matter which count is set, and rather the false-positive detection.
This patch fixes the problem by clearing only the needed array range at usb_chmap_ctl_get().
--- sound/usb/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/usb/stream.c +3 -3
@@ -185,16 +185,16 @@ static int usb_chmap_ctl_get(struct snd_struct snd_pcm_chmap *info =snd_kcontrol_chip (kcontrol);struct snd_usb_substream *subs = info->private_data;struct snd_pcm_chmap_elem *chmap =NULL ; -int i; +int i =0 ; -memset (ucontrol->value.integer.value,0 , -sizeof (ucontrol->value.integer.value));if (subs->cur_audiofmt) chmap = subs->cur_audiofmt->chmap;if (chmap) {for (i =0 ; i < chmap->channels; i++) ucontrol->value.integer.value[i] = chmap->map[i]; } +for (; i < subs->channels_max; i++) + ucontrol->value.integer.value[i] =0 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 29/242 xhci: Give USB2 ports time to enter U3 in bus suspend
In reply to Greg Kroah-HartmanFrom: Li Jun <[email protected]>
commit c1373f10479b624fb6dba0805d673e860f1b421d upstream.
If a USB2 device wakeup is not enabled/supported the link state may still be in U0 in xhci_bus_suspend(), where it's then manually put to suspended U3 state.
Just as with selective suspend the device needs time to enter U3 suspend before continuing with further suspend operations (e.g. system suspend), otherwise we may enter system suspend with link state in U0.
[commit message rewording -Mathias]
--- drivers/usb/host/xhci-hub.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/host/xhci-hub.c +4 -0
@@ -1590,6 +1590,10 @@ int xhci_bus_suspend(struct usb_hcd *hcd hcd->state =HC_STATE_SUSPENDED ; bus_state->next_statechange = jiffies +msecs_to_jiffies (10 );spin_unlock_irqrestore (&xhci->lock, flags); + +if (bus_state->bus_suspended) +usleep_range (5000 ,10000 ); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 30/242 USB: UAS: introduce a quirk to set no_write_same
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 8010622c86ca5bb44bc98492f5968726fc7c7a21 upstream.
UAS does not share the pessimistic assumption storage is making that devices cannot deal with WRITE_SAME. A few devices supported by UAS, are reported to not deal well with WRITE_SAME. Those need a quirk.
Add it to the device that needs it.
--- Documentation/admin-guide/kernel-parameters.txt | 1 + drivers/usb/storage/uas.c | 3 +++ drivers/usb/storage/unusual_uas.h | 7 +++++-- drivers/usb/storage/usb.c | 3 +++ include/linux/usb_usual.h | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +1 -0
@@ -4750,6 +4750,7 @@ device); j = NO_REPORT_LUNS (don't use report luns command, uas only); + k = NO_SAME (do not use WRITE_SAME, uas only) l = NOT_LOCKABLE (don't try to lock and unlock ejectable media, not on uas); m = MAX_SECTORS_64 (don't transfer more
drivers/usb/storage/uas.c +3 -0
@@ -874,6 +874,9 @@ static int uas_slave_configure(struct scif (devinfo->flags &US_FL_NO_READ_CAPACITY_16 ) sdev->no_read_capacity_16 =1 ; +/* Some disks cannot handle WRITE_SAME */ +if (devinfo->flags &US_FL_NO_SAME ) + sdev->no_write_same =1 ;/* * Some disks return the total number of blocks in response * to READ CAPACITY rather than the highest block number.
drivers/usb/storage/unusual_uas.h +5 -2
@@ -48,12 +48,15 @@ UNUSUAL_DEV(0x054c, 0x087d, 0x0000, 0x99 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NO_REPORT_OPCODES), -/* Reported-by: Julian Groß <[email protected]> */ +/* +* Initially Reported-by: Julian Groß <[email protected]> +* Further reports David C. Partridge <[email protected]> +*/ UNUSUAL_DEV (0x059f ,0x105f ,0x0000 ,0x9999 ,"LaCie" ,"2Big Quadra USB3" ,USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , - US_FL_NO_REPORT_OPCODES), + US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME),/* * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
drivers/usb/storage/usb.c +3 -0
@@ -557,6 +557,9 @@ void usb_stor_adjust_quirks(struct usb_dcase 'j' : f |=US_FL_NO_REPORT_LUNS ;break ; +case 'k' : + f |=US_FL_NO_SAME ; +break ;case 'l' : f |=US_FL_NOT_LOCKABLE ;break ;
include/linux/usb_usual.h +2 -0
@@ -84,6 +84,8 @@/* Cannot handle REPORT_LUNS */ \US_FLAG (ALWAYS_SYNC ,0x20000000 ) \ /* lies about caching, so always sync */ \ +US_FLAG (NO_SAME ,0x40000000 ) \ + /* Cannot handle WRITE_SAME */ \#define US_FLAG (name, value) US_FL_##name = value ,enum {US_DO_ALL_FLAGS };
Greg Kroah-Hartman
maintainerPATCH 31/242 USB: sisusbvga: Make console support depend on BROKEN
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
commit 862ee699fefe1e6d6f2c1518395f0b999b8beb15 upstream.
The console part of sisusbvga is broken vs. printk(). It uses in_atomic() to detect contexts in which it cannot sleep despite the big fat comment in preempt.h which says: Do not use in_atomic() in driver code.
in_atomic() does not work on kernels with CONFIG_PREEMPT_COUNT=n which means that spin/rw_lock held regions are not detected by it.
There is no way to make this work by handing context information through to the driver and this only can be solved once the core printk infrastructure supports sleepable console drivers.
Make it depend on BROKEN for now.
--- drivers/usb/misc/sisusbvga/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/sisusbvga/Kconfig +1 -1
@@ -15,7 +15,7 @@ config USB_SISUSBVGA config USB_SISUSBVGA_CON bool "Text console and mode switching support" if USB_SISUSBVGA - depends on VT + depends on VT && BROKEN select FONT_8x16 ---help--- Say Y here if you want a VGA text console via the USB dongle or
Greg Kroah-Hartman
maintainerPATCH 32/242 ALSA: pcm: oss: Fix potential out-of-bounds shift
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 175b8d89fe292796811fdee87fa39799a5b6b87a upstream.
syzbot spotted a potential out-of-bounds shift in the PCM OSS layer where it calculates the buffer size with the arbitrary shift value given via an ioctl.
Add a range check for avoiding the undefined behavior.
As the value can be treated by a signed integer, the max shift should be 30.
--- sound/core/oss/pcm_oss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/core/oss/pcm_oss.c +5 -1
@@ -1949,11 +1949,15 @@ static int snd_pcm_oss_set_subdivide(strstatic int snd_pcm_oss_set_fragment1 (struct snd_pcm_substream *substream,unsigned int val) {struct snd_pcm_runtime *runtime; +int fragshift; runtime = substream->runtime;if (runtime->oss.subdivision || runtime->oss.fragshift)return -EINVAL ; - runtime->oss.fragshift = val &0xffff ; + fragshift = val &0xffff ; +if (fragshift >=31 ) +return -EINVAL ; + runtime->oss.fragshift = fragshift; runtime->oss.maxfrags = (val >>16 ) &0xffff ;if (runtime->oss.fragshift <4 )/* < 16 */ runtime->oss.fragshift =4 ;
Greg Kroah-Hartman
maintainerPATCH 33/242 serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
In reply to Greg Kroah-HartmanFrom: Alexander Sverdlin <[email protected]>
commit d96f04d347e4011977abdbb4da5d8f303ebd26f8 upstream.
It has been observed that once per 300-1300 port openings the first transmitted byte is being corrupted on AM3352 ("v" written to FIFO appeared as "e" on the wire). It only happened if single byte has been transmitted right after port open, which means, DMA is not used for this transfer and the corruption never happened afterwards.
Therefore I've carefully re-read the MDR1 errata (link below), which says "when accessing the MDR1 registers that causes a dummy under-run condition that will freeze the UART in IrDA transmission. In UART mode, this may corrupt the transferred data". Strictly speaking, omap_8250_mdr1_errataset() performs a read access and if the value is the same as should be written, exits without errata-recommended FIFO reset.
A brief check of the serial_omap_mdr1_errataset() from the competing omap-serial driver showed it has no read access of MDR1. After removing the read access from omap_8250_mdr1_errataset() the data corruption never happened any more.
--- drivers/tty/serial/8250/8250_omap.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/tty/serial/8250/8250_omap.c +0 -5
@@ -161,11 +161,6 @@ static void omap_8250_mdr1_errataset(str struct omap8250_priv *priv) {u8 timeout =255 ; -u8 old_mdr1; - - old_mdr1 =serial_in (up,UART_OMAP_MDR1 ); -if (old_mdr1 == priv->mdr1) -return ;serial_out (up,UART_OMAP_MDR1 , priv->mdr1);udelay (2 );
Greg Kroah-Hartman
maintainerPATCH 34/242 drm: fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi
In reply to Greg Kroah-HartmanFrom: Xin Xiong <[email protected]>
commit a34a0a632dd991a371fec56431d73279f9c54029 upstream
drm_dp_mst_allocate_vcpi() invokes drm_dp_mst_topology_get_port_validated(), which increases the refcount of the "port".
These reference counting issues take place in two exception handling paths separately. Either when “slots” is less than 0 or when drm_dp_init_vcpi() returns a negative value, the function forgets to reduce the refcnt increased drm_dp_mst_topology_get_port_validated(), which results in a refcount leak.
Fix these issues by pulling up the error handling when "slots" is less than 0, and calling drm_dp_mst_topology_put_port() before termination when drm_dp_init_vcpi() returns a negative value.
--- drivers/gpu/drm/drm_dp_mst_topology.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +4 -3
@@ -2629,11 +2629,11 @@ bool drm_dp_mst_allocate_vcpi(struct drm {int ret; - port =drm_dp_get_validated_port_ref (mgr, port); -if (!port) +if (slots <0 )return false; -if (slots <0 ) + port =drm_dp_get_validated_port_ref (mgr, port); +if (!port)return false;if (port->vcpi.vcpi >0 ) {
@@ -2648,6 +2648,7 @@ bool drm_dp_mst_allocate_vcpi(struct drmif (ret) {DRM_DEBUG_KMS ("failed to init vcpi slots=%d max=63 ret=%d\n" ,DIV_ROUND_UP (pbn, mgr->pbn_div), ret); +drm_dp_put_port (port); goto out; } DRM_DEBUG_KMS("initing vcpi for pbn=%d slots=%d\n",
Greg Kroah-Hartman
maintainerPATCH 35/242 pinctrl: merrifield: Set default bias in case no particular value given
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 0fa86fc2e28227f1e64f13867e73cf864c6d25ad ]
When GPIO library asks pin control to set the bias, it doesn't pass any value of it and argument is considered boolean (and this is true for ACPI GpioIo() / GpioInt() resources, by the way). Thus, individual drivers must behave well, when they got the resistance value of 1 Ohm, i.e. transforming it to sane default.
In case of Intel Merrifield pin control hardware the 20 kOhm sounds plausible because it gives a good trade off between weakness and minimization of leakage current (will be only 50 uA with the above choice).
Depends-on: 2956b5d94a76 ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips")
--- drivers/pinctrl/intel/pinctrl-merrifield.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pinctrl/intel/pinctrl-merrifield.c +8 -0
@@ -731,6 +731,10 @@ static int mrfld_config_set_pin(struct mrfld_pinctrl *mp, unsigned int pin, mask |= BUFCFG_Px_EN_MASK |BUFCFG_PUPD_VAL_MASK ; bits |=BUFCFG_PU_EN ; +/* Set default strength value in case none is given */ +if (arg ==1 ) + arg =20000 ; +switch (arg) {case 50000 : bits |=BUFCFG_PUPD_VAL_50K <<BUFCFG_PUPD_VAL_SHIFT ;
@@ -751,6 +755,10 @@ static int mrfld_config_set_pin(struct mrfld_pinctrl *mp, unsigned int pin, mask |= BUFCFG_Px_EN_MASK |BUFCFG_PUPD_VAL_MASK ; bits |=BUFCFG_PD_EN ; +/* Set default strength value in case none is given */ +if (arg ==1 ) + arg =20000 ; +switch (arg) {case 50000 : bits |=BUFCFG_PUPD_VAL_50K <<BUFCFG_PUPD_VAL_SHIFT ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 36/242 pinctrl: baytrail: Avoid clearing debounce value when turning it off
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 0b74e40a4e41f3cbad76dff4c50850d47b525b26 ]
Baytrail pin control has a common register to set up debounce timeout. When a pin configuration requested debounce to be disabled, the rest of the pins may still want to have debounce enabled and thus rely on the common timeout value. Avoid clearing debounce value when turning it off for one pin while others may still use it.
Depends-on: 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce support")
Depends-on: 827e1579e1d5 ("pinctrl: baytrail: Rectify debounce support (part 2)")
--- drivers/pinctrl/intel/pinctrl-baytrail.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-baytrail.c +7 -1
@@ -1266,7 +1266,6 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,break ;case PIN_CONFIG_INPUT_DEBOUNCE : debounce =readl (db_reg); - debounce &= ~BYT_DEBOUNCE_PULSE_MASK ;if (arg) conf |=BYT_DEBOUNCE_EN ;
@@ -1275,24 +1274,31 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,switch (arg) {case 375 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_375US ;break ;case 750 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_750US ;break ;case 1500 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_1500US ;break ;case 3000 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_3MS ;break ;case 6000 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_6MS ;break ;case 12000 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_12MS ;break ;case 24000 : + debounce &= ~BYT_DEBOUNCE_PULSE_MASK ; debounce |=BYT_DEBOUNCE_PULSE_24MS ;break ;default :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 37/242 ARM: dts: sun8i: v3s: fix GIC node memory range
In reply to Greg Kroah-HartmanFrom: Icenowy Zheng <[email protected]>
[ Upstream commit a98fd117a2553ab1a6d2fe3c7acae88c1eca4372 ]
Currently the GIC node in V3s DTSI follows some old DT examples, and being broken. This leads a warning at boot.
Fix this.
--- arch/arm/boot/dts/sun8i-v3s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sun8i-v3s.dtsi +1 -1
@@ -419,7 +419,7 @@ gic: interrupt-controller@01c81000 { compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; reg = <0x01c81000 0x1000>, - <0x01c82000 0x1000>, + <0x01c82000 0x2000>, <0x01c84000 0x2000>, <0x01c86000 0x2000>; interrupt-controller;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 38/242 gpio: mvebu: fix potential user-after-free on probe
In reply to Greg Kroah-HartmanFrom: Baruch Siach <[email protected]>
[ Upstream commit 7ee1a01e47403f72b9f38839a737692f6991263e ]
When mvebu_pwm_probe() fails IRQ domain is not released. Move pwm probe before IRQ domain allocation. Add pwm cleanup code to the failure path.
--- drivers/gpio/gpio-mvebu.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpio/gpio-mvebu.c +11 -5
@@ -1195,6 +1195,13 @@ static int mvebu_gpio_probe(struct platform_device *pdev)devm_gpiochip_add_data (&pdev->dev, &mvchip->chip, mvchip); +/* Some MVEBU SoCs have simple PWM support for GPIO lines */ +if (IS_ENABLED (CONFIG_PWM )) { + err =mvebu_pwm_probe (pdev, mvchip, id); +if (err) +return err; + } +/* Some gpio controllers do not provide irq support */ if (!have_irqs)return 0 ;
@@ -1204,7 +1211,8 @@ static int mvebu_gpio_probe(struct platform_device *pdev)if (!mvchip->domain) {dev_err (&pdev->dev,"couldn't allocate irq domain %s (DT).\n" , mvchip->chip.label); -return -ENODEV ; + err = -ENODEV ; + goto err_pwm; } err = irq_alloc_domain_generic_chips(
@@ -1252,14 +1260,12 @@ static int mvebu_gpio_probe(struct platform_device *pdev) mvchip); } -/* Some MVEBU SoCs have simple PWM support for GPIO lines */ -if (IS_ENABLED (CONFIG_PWM )) -return mvebu_pwm_probe (pdev, mvchip, id); -return 0 ; err_domain:irq_domain_remove (mvchip->domain); +err_pwm: +pwmchip_remove (&mvchip->mvpwm->chip);return err; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 39/242 scsi: bnx2i: Requires MMU
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 2d586494c4a001312650f0b919d534e429dd1e09 ]
The SCSI_BNX2_ISCSI kconfig symbol selects CNIC and CNIC selects UIO, which depends on MMU.
Since 'select' does not follow dependency chains, add the same MMU dependency to SCSI_BNX2_ISCSI.
Quietens this kconfig warning:
WARNING: unmet direct dependencies detected for CNIC
Depends on [n]: NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_BROADCOM [=y] && PCI [=y] && (IPV6 [=m] || IPV6 [=m]=n) && MMU [=n] Selected by [m]:
- SCSI_BNX2_ISCSI [=m] && SCSI_LOWLEVEL [=y] && SCSI [=y] && NET [=y] && PCI [=y] && (IPV6 [=m] || IPV6 [=m]=n)
--- drivers/scsi/bnx2i/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/bnx2i/Kconfig +1 -0
@@ -3,6 +3,7 @@ config SCSI_BNX2_ISCSI depends on NET depends on PCI depends on (IPV6 || IPV6=n) + depends on MMU select SCSI_ISCSI_ATTRS select NETDEVICES select ETHERNET
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 40/242 can: softing: softing_netdev_open(): fix error handling
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 4d1be581ec6b92a338bb7ed23e1381f45ddf336f ]
If softing_netdev_open() fails, we should call close_candev() to avoid reference leak.
--- drivers/net/can/softing/softing_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/can/softing/softing_main.c +7 -2
@@ -393,8 +393,13 @@ static int softing_netdev_open(struct net_device *ndev)/* check or determine and set bittime */ ret =open_candev (ndev); -if (!ret) - ret =softing_startstop (ndev,1 ); +if (ret) +return ret; + + ret =softing_startstop (ndev,1 ); +if (ret <0 ) +close_candev (ndev); +return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 41/242 RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 340b940ea0ed12d9adbb8f72dea17d516b2019e8 ]
If cm_create_timewait_info() fails, the timewait_info pointer will contain an error value and will be used in cm_remove_remote() later.
general protection fault, probably for non-canonical address 0xdffffc0000000024: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0×0000000000000120-0×0000000000000127] CPU: 2 PID: 12446 Comm: syz-executor.3 Not tainted 5.10.0-rc5-5d4c0742a60e #27 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:cm_remove_remote.isra.0+0x24/0×170 drivers/infiniband/core/cm.c:978 Code: 84 00 00 00 00 00 41 54 55 53 48 89 fb 48 8d ab 2d 01 00 00 e8 7d bf 4b fe 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 48 89 ea 83 e2 07 38 d0 7f 08 84 c0 0f 85 fc 00 00 00 RSP: 0018:ffff888013127918 EFLAGS: 00010006 RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: ffffc9000a18b000 RDX: 0000000000000024 RSI: ffffffff82edc573 RDI: fffffffffffffff4 RBP: 0000000000000121 R08: 0000000000000001 R09: ffffed1002624f1d R10: 0000000000000003 R11: ffffed1002624f1c R12: ffff888107760c70 R13: ffff888107760c40 R14: fffffffffffffff4 R15: ffff888107760c9c FS: 00007fe1ffcc1700(0000) GS:ffff88811a600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2ff21000 CR3: 000000010f504001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: cm_destroy_id+0x189/0×15b0 drivers/infiniband/core/cm.c:1155 cma_connect_ib drivers/infiniband/core/cma.c:4029 [inline] rdma_connect_locked+0x1100/0×17c0 drivers/infiniband/core/cma.c:4107 rdma_connect+0x2a/0×40 drivers/infiniband/core/cma.c:4140 ucma_connect+0x277/0×340 drivers/infiniband/core/ucma.c:1069 ucma_write+0x236/0×2f0 drivers/infiniband/core/ucma.c:1724 vfs_write+0x220/0×830 fs/read_write.c:603 ksys_write+0x1df/0×240 fs/read_write.c:658 do_syscall_64+0x33/0×40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/infiniband/core/cm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/core/cm.c +2 -0
@@ -1349,6 +1349,7 @@ int ib_send_cm_req(struct ib_cm_id *cm_id, id.local_id);if (IS_ERR (cm_id_priv->timewait_info)) { ret =PTR_ERR (cm_id_priv->timewait_info); + cm_id_priv->timewait_info =NULL ; goto out; }
@@ -1836,6 +1837,7 @@ static int cm_req_handler(struct cm_work *work) id.local_id);if (IS_ERR (cm_id_priv->timewait_info)) { ret =PTR_ERR (cm_id_priv->timewait_info); + cm_id_priv->timewait_info =NULL ; goto destroy; } cm_id_priv->timewait_info->work.remote_id = req_msg->local_comm_id;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 42/242 kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
In reply to Greg Kroah-HartmanFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 8ff00399b153440c1c83e20c43020385b416415b ]
powerpc/64s keeps a counter in the mm which counts bits set in mm_cpumask as well as other things. This means it can't use generic code to clear bits out of the mask and doesn't adjust the arch specific counter.
Add an arch override that allows powerpc/64s to use clear_tasks_mm_cpumask().
--- kernel/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/cpu.c +5 -1
@@ -772,6 +772,10 @@ void __init cpuhp_threads_init(void) }#ifdef CONFIG_HOTPLUG_CPU +#ifndef arch_clear_mm_cpumask_cpu +#define arch_clear_mm_cpumask_cpu (cpu, mm) cpumask_clear_cpu(cpu, mm_cpumask(mm)) +#endif +/** * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU * @cpu: a CPU id
@@ -807,7 +811,7 @@ void clear_tasks_mm_cpumask(int cpu) t =find_lock_task_mm (p);if (!t)continue ; -cpumask_clear_cpu (cpu,mm_cpumask (t->mm)); +arch_clear_mm_cpumask_cpu (cpu, t->mm);task_unlock (t); }rcu_read_unlock ();
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 43/242 drm/tegra: sor: Disable clocks on error in tegra_sor_init()
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit bf3a3cdcad40e5928a22ea0fd200d17fd6d6308d ]
Fix the missing clk_disable_unprepare() before return from tegra_sor_init() in the error handling case.
--- drivers/gpu/drm/tegra/sor.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/tegra/sor.c +8 -2
@@ -2378,17 +2378,23 @@ static int tegra_sor_init(struct host1x_client *client)if (err <0 ) {dev_err (sor->dev,"failed to deassert SOR reset: %d\n" , err); +clk_disable_unprepare (sor->clk);return err; } } err =clk_prepare_enable (sor->clk_safe); -if (err <0 ) +if (err <0 ) { +clk_disable_unprepare (sor->clk);return err; + } err =clk_prepare_enable (sor->clk_dp); -if (err <0 ) +if (err <0 ) { +clk_disable_unprepare (sor->clk_safe); +clk_disable_unprepare (sor->clk);return err; + }return 0 ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 44/242 vxlan: Add needed_headroom for lower device
In reply to Greg Kroah-HartmanFrom: Sven Eckelmann <[email protected]>
[ Upstream commit 0a35dc41fea67ac4495ce7584406bf9557a6e7d0 ]
It was observed that sending data via batadv over vxlan (on top of wireguard) reduced the performance massively compared to raw ethernet or batadv on raw ethernet. A check of perf data showed that the vxlan_build_skb was calling all the time pskb_expand_head to allocate enough headroom for:
min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len
+ VXLAN_HLEN + iphdr_len;
But the vxlan_config_apply only requested needed headroom for:
lowerdev->hard_header_len + VXLAN6_HEADROOM or VXLAN_HEADROOM
So it completely ignored the needed_headroom of the lower device. The first caller of net_dev_xmit could therefore never make sure that enough headroom was allocated for the rest of the transmit path.
--- drivers/net/vxlan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/vxlan.c +1 -0
@@ -3184,6 +3184,7 @@ static void vxlan_config_apply(struct net_device *dev, dev->gso_max_segs = lowerdev->gso_max_segs; needed_headroom = lowerdev->hard_header_len; + needed_headroom += lowerdev->needed_headroom; max_mtu = lowerdev->mtu - (use_ipv6 ?VXLAN6_HEADROOM :VXLAN_HEADROOM );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 45/242 vxlan: Copy needed_tailroom from lowerdev
In reply to Greg Kroah-HartmanFrom: Sven Eckelmann <[email protected]>
[ Upstream commit a5e74021e84bb5eadf760aaf2c583304f02269be ]
While vxlan doesn't need any extra tailroom, the lowerdev might need it. In that case, copy it over to reduce the chance for additional (re)allocations in the transmit path.
--- drivers/net/vxlan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/vxlan.c +2 -0
@@ -3186,6 +3186,8 @@ static void vxlan_config_apply(struct net_device *dev, needed_headroom = lowerdev->hard_header_len; needed_headroom += lowerdev->needed_headroom; + dev->needed_tailroom = lowerdev->needed_tailroom; + max_mtu = lowerdev->mtu - (use_ipv6 ?VXLAN6_HEADROOM :VXLAN_HEADROOM );if (max_mtu <ETH_MIN_MTU )
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 46/242 scsi: mpt3sas: Increase IOCInit request timeout to 30s
In reply to Greg Kroah-HartmanFrom: Sreekanth Reddy <[email protected]>
[ Upstream commit 85dad327d9b58b4c9ce08189a2707167de392d23 ]
Currently the IOCInit request message timeout is set to 10s. This is not sufficient in some scenarios such as during HBA FW downgrade operations.
Increase the IOCInit request timeout to 30s.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +1 -1
@@ -4575,7 +4575,7 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc) r =_base_handshake_req_reply_wait (ioc,sizeof (Mpi2IOCInitRequest_t), (u32 *)&mpi_request, -sizeof (Mpi2IOCInitReply_t), (u16 *)&mpi_reply,10 ); +sizeof (Mpi2IOCInitReply_t), (u16 *)&mpi_reply,30 );if (r !=0 ) { pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n",
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 47/242 dm table: Remove BUG_ON(in_interrupt())
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
[ Upstream commit e7b624183d921b49ef0a96329f21647d38865ee9 ]
The BUG_ON(in_interrupt()) in dm_table_event() is a historic leftover from a rework of the dm table code which changed the calling context.
Issuing a BUG for a wrong calling context is frowned upon and in_interrupt() is deprecated and only covering parts of the wrong contexts. The sanity check for the context is covered by CONFIG_DEBUG_ATOMIC_SLEEP and other debug facilities already.
--- drivers/md/dm-table.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/md/dm-table.c +0 -6
@@ -1295,12 +1295,6 @@ void dm_table_event_callback(struct dm_table *t,void dm_table_event (struct dm_table *t) { -/* -* You can no longer call dm_table_event() from interrupt -* context, use a bottom half instead. -*/ -BUG_ON (in_interrupt ()); -mutex_lock (&_event_lock);if (t->event_fn) t->event_fn (t->event_context);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 48/242 soc/tegra: fuse: Fix index bug in get_process_id
In reply to Greg Kroah-HartmanFrom: Nicolin Chen <[email protected]>
commit b9ce9b0f83b536a4ac7de7567a265d28d13e5bea upstream.
This patch simply fixes a bug of referencing speedos[num] in every for-loop iteration in get_process_id function.
--- drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/speedo-tegra210.c +1 -1
@@ -105,7 +105,7 @@ static int get_process_id(int value, conunsigned int i;for (i =0 ; i < num; i++) -if (value < speedos[num]) +if (value < speedos[i])return i;return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 49/242 USB: serial: option: add interface-number sanity check to flag handling
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit a251963f76fa0226d0fdf0c4f989496f18d9ae7f upstream.
Add an interface-number sanity check before testing the device flags to avoid relying on undefined behaviour when left shifting in case a device uses an interface number greater than or equal to BITS_PER_LONG (i.e. 64 or 32).
--- drivers/usb/serial/option.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +21 -2
@@ -566,6 +566,9 @@ static void option_instat_callback(struc/* Device flags */ +/* Highest interface number which can be used with NCTRL() and RSVD() */ +#define FLAG_IFNUM_MAX 7 +/* Interface does not support modem-control requests */ #define NCTRL (ifnum) ((BIT(ifnum) & 0xff) << 8)
@@ -2102,6 +2105,14 @@ static struct usb_serial_driver * constmodule_usb_serial_driver (serial_drivers, option_ids); +static bool iface_is_reserved (unsigned long device_flags,u8 ifnum) +{ +if (ifnum >FLAG_IFNUM_MAX ) +return false; + +return device_flags &RSVD (ifnum); +} +static int option_probe (struct usb_serial *serial,const struct usb_device_id *id) {
@@ -2119,7 +2130,7 @@ static int option_probe(struct usb_seria* the same class/subclass/protocol as the serial interfaces. Look at * the Windows driver .INF files for reserved interface numbers. */ -if (device_flags &RSVD (iface_desc->bInterfaceNumber)) +if (iface_is_reserved (device_flags, iface_desc->bInterfaceNumber))return -ENODEV ;/* * Don't bind network interface on Samsung GT-B3730, it is handled by
@@ -2143,6 +2154,14 @@ static int option_probe(struct usb_seriareturn 0 ; } +static bool iface_no_modem_control (unsigned long device_flags,u8 ifnum) +{ +if (ifnum >FLAG_IFNUM_MAX ) +return false; + +return device_flags &NCTRL (ifnum); +} +static int option_attach (struct usb_serial *serial) {struct usb_interface_descriptor *iface_desc;
@@ -2158,7 +2177,7 @@ static int option_attach(struct usb_seri iface_desc = &serial->interface->cur_altsetting->desc; -if (!(device_flags &NCTRL (iface_desc->bInterfaceNumber))) +if (!iface_no_modem_control (device_flags, iface_desc->bInterfaceNumber)) data->use_send_setup =1 ;if (device_flags &ZLP )
Greg Kroah-Hartman
maintainerPATCH 50/242 USB: gadget: f_acm: add support for SuperSpeed Plus
In reply to Greg Kroah-HartmanFrom: taehyun.cho <[email protected]>
commit 3ee05c20656782387aa9eb010fdb9bb16982ac3f upstream.
Setup the SuperSpeed Plus descriptors for f_acm. This allows the gadget to work properly without crashing at SuperSpeed rates.
--- drivers/usb/gadget/function/f_acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_acm.c +1 -1
@@ -687,7 +687,7 @@ acm_bind(struct usb_configuration *c, st acm_ss_out_desc.bEndpointAddress = acm_fs_out_desc.bEndpointAddress; status =usb_assign_descriptors (f, acm_fs_function, acm_hs_function, - acm_ss_function,NULL ); + acm_ss_function, acm_ss_function);if (status) goto fail;
Greg Kroah-Hartman
maintainerPATCH 51/242 USB: gadget: f_midi: setup SuperSpeed Plus descriptors
In reply to Greg Kroah-HartmanFrom: Will McVicker <[email protected]>
commit 457a902ba1a73b7720666b21ca038cd19764db18 upstream.
Needed for SuperSpeed Plus support for f_midi. This allows the gadget to work properly without crashing at SuperSpeed rates.
--- drivers/usb/gadget/function/f_midi.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/gadget/function/f_midi.c +6 -0
@@ -1048,6 +1048,12 @@ static int f_midi_bind(struct usb_config f->ss_descriptors =usb_copy_descriptors (midi_function);if (!f->ss_descriptors) goto fail_f_midi; + +if (gadget_is_superspeed_plus (c->cdev->gadget)) { + f->ssp_descriptors =usb_copy_descriptors (midi_function); +if (!f->ssp_descriptors) + goto fail_f_midi; + } }kfree (midi_function);
Greg Kroah-Hartman
maintainerPATCH 52/242 usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
In reply to Greg Kroah-HartmanFrom: Jack Pham <[email protected]>
commit a353397b0d5dfa3c99b372505db3378fc919c6c6 upstream.
In many cases a function that supports SuperSpeed can very well operate in SuperSpeedPlus, if a gadget controller supports it, as the endpoint descriptors (and companion descriptors) are generally identical and can be re-used. This is true for two commonly used functions: Android's ADB and MTP. So we can simply assign the usb_function's ssp_descriptors array to point to its ss_descriptors, if available. Similarly, we need to allow an epfile's ioctl for FUNCTIONFS_ENDPOINT_DESC to correctly return the corresponding SuperSpeed endpoint descriptor in case the connected speed is SuperSpeedPlus as well.
The only exception is if a function wants to implement an Isochronous endpoint capable of transferring more than 48KB per service interval when operating at greater than USB 3.1 Gen1 speed, in which case it would require an additional SuperSpeedPlus Isochronous Endpoint Companion descriptor to be returned as part of the Configuration Descriptor. Support for that would need to be separately added to the userspace-facing FunctionFS API which may not be a trivial task--likely a new descriptor format (v3?) may need to be devised to allow for separate SS and SSP descriptors to be supplied.
--- drivers/usb/gadget/function/f_fs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +4 -1
@@ -1248,6 +1248,7 @@ static long ffs_epfile_ioctl(struct fileswitch (epfile->ffs->gadget->speed) {case USB_SPEED_SUPER : +case USB_SPEED_SUPER_PLUS : desc_idx =2 ;break ;case USB_SPEED_HIGH :
@@ -3067,7 +3068,8 @@ static int _ffs_func_bind(struct usb_con }if (likely (super)) { - func->function.ss_descriptors =vla_ptr (vlabuf, d, ss_descs); + func->function.ss_descriptors = func->function.ssp_descriptors = +vla_ptr (vlabuf, d, ss_descs); ss_len = ffs_do_descs(ffs->ss_descs_count, vla_ptr(vlabuf, d, raw_descs) + fs_len + hs_len, d_raw_descs__sz - fs_len - hs_len,
@@ -3477,6 +3479,7 @@ static void ffs_func_unbind(struct usb_c func->function.fs_descriptors =NULL ; func->function.hs_descriptors =NULL ; func->function.ss_descriptors =NULL ; + func->function.ssp_descriptors =NULL ; func->interfaces_nums =NULL ;ffs_event_add (ffs,FUNCTIONFS_UNBIND );
Greg Kroah-Hartman
maintainerPATCH 53/242 USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
In reply to Greg Kroah-HartmanFrom: Will McVicker <[email protected]>
commit b00f444f9add39b64d1943fa75538a1ebd54a290 upstream.
Align the SuperSpeed Plus bitrate for f_rndis to match f_ncm's ncm_bitrate defined by commit 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed descriptors for CDC NCM").
--- drivers/usb/gadget/function/f_rndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_rndis.c +3 -1
@@ -91,8 +91,10 @@ static inline struct f_rndis *func_to_rn/* peak (theoretical) bulk transfer rate in bits-per-second */ static unsigned int bitrate (struct usb_gadget *g) { +if (gadget_is_superspeed (g) && g->speed >=USB_SPEED_SUPER_PLUS ) +return 4250000000U ;if (gadget_is_superspeed (g) && g->speed ==USB_SPEED_SUPER ) -return 13 *1024 *8 *1000 *8 ; +return 3750000000U ;else if (gadget_is_dualspeed (g) && g->speed ==USB_SPEED_HIGH )return 13 *512 *8 *1000 *8 ;else
Greg Kroah-Hartman
maintainerPATCH 54/242 usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
commit c7721e15f434920145c376e8fe77e1c079fc3726 upstream.
According to the i.MX6UL Errata document:
https://www.nxp.com/docs/en/errata/IMX6ULCE.pdf
ERR007881 also affects i.MX6UL, so pass the CI_HDRC_DISABLE_DEVICE_STREAMING flag to workaround the issue.
--- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_imx.c +2 -1
@@ -64,7 +64,8 @@ static const struct ci_hdrc_imx_platformstatic const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = { .flags =CI_HDRC_SUPPORTS_RUNTIME_PM | -CI_HDRC_TURN_VBUS_EARLY_ON , +CI_HDRC_TURN_VBUS_EARLY_ON | +CI_HDRC_DISABLE_DEVICE_STREAMING , };static const struct ci_hdrc_imx_platform_flag imx7d_usb_data = {
Greg Kroah-Hartman
maintainerPATCH 55/242 ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit ecc1ff532b499d20304a4f682247137025814c34 upstream.
On Odroid XU board the USB3-0 port is a microUSB and USB3-1 port is USB type A (host). The roles were copied from Odroid XU3 (Exynos5422) design which has it reversed.
--- arch/arm/boot/dts/exynos5410-odroidxu.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/exynos5410-odroidxu.dts +2 -2
@@ -629,11 +629,11 @@ }; &usbdrd_dwc3_0 { - dr_mode = "host"; + dr_mode = "peripheral"; }; &usbdrd_dwc3_1 { - dr_mode = "peripheral"; + dr_mode = "host"; }; &usbdrd3_0 {
Greg Kroah-Hartman
maintainerPATCH 56/242 ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 3d992fd8f4e0f09c980726308d2f2725587b32d6 upstream.
The VBUS control (PWREN) and over-current pins of USB 3.0 DWC3 controllers are on Exynos5410 regular GPIOs. This is different than for example on Exynos5422 where these are special ETC pins with proper reset values (pulls, functions).
Therefore these pins should be configured to enable proper USB 3.0 peripheral and host modes. This also fixes over-current warning:
[ 6.024658] usb usb4-port1: over-current condition
[ 6.028271] usb usb3-port1: over-current condition--- arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 28 ++++++++++++++++++++++++++++ arch/arm/boot/dts/exynos5410.dtsi | 4 ++++ 2 files changed, 32 insertions(+)
arch/arm/boot/dts/exynos5410-pinctrl.dtsi +28 -0
@@ -563,6 +563,34 @@ interrupt-controller; #interrupt-cells = <2>; }; + + usb3_1_oc: usb3-1-oc { + samsung,pins = "gpk2-4", "gpk2-5"; + samsung,pin-function = <EXYNOS_PIN_FUNC_2>; + samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; + samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; + }; + + usb3_1_vbusctrl: usb3-1-vbusctrl { + samsung,pins = "gpk2-6", "gpk2-7"; + samsung,pin-function = <EXYNOS_PIN_FUNC_2>; + samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; + samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; + }; + + usb3_0_oc: usb3-0-oc { + samsung,pins = "gpk3-0", "gpk3-1"; + samsung,pin-function = <EXYNOS_PIN_FUNC_2>; + samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; + samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; + }; + + usb3_0_vbusctrl: usb3-0-vbusctrl { + samsung,pins = "gpk3-2", "gpk3-3"; + samsung,pin-function = <EXYNOS_PIN_FUNC_2>; + samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; + samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; + }; }; &pinctrl_2 {
arch/arm/boot/dts/exynos5410.dtsi +4 -0
@@ -381,6 +381,8 @@ &usbdrd3_0 { clocks = <&clock CLK_USBD300>; clock-names = "usbdrd30"; + pinctrl-names = "default"; + pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>; }; &usbdrd_phy0 {
@@ -392,6 +394,8 @@ &usbdrd3_1 { clocks = <&clock CLK_USBD301>; clock-names = "usbdrd30"; + pinctrl-names = "default"; + pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>; }; &usbdrd_dwc3_1 {
Greg Kroah-Hartman
maintainerPATCH 57/242 ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit bd7e7ff56feea7810df900fb09c9741d259861d9 upstream.
On Odroid XU LDO12 and LDO15 supplies the power to USB 3.0 blocks but the GPK GPIO pins are supplied by LDO7 (VDDQ_LCD). LDO7 also supplies GPJ GPIO pins.
The Exynos pinctrl driver does not take any supplies, so to have entire GPIO block always available, make the regulator always on.
--- arch/arm/boot/dts/exynos5410-odroidxu.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/exynos5410-odroidxu.dts +2 -0
@@ -327,6 +327,8 @@ regulator-name = "vddq_lcd"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + /* Supplies also GPK and GPJ */ + regulator-always-on; }; ldo8_reg: LDO8 {
Greg Kroah-Hartman
maintainerPATCH 58/242 HID: i2c-hid: add Vero K147 to descriptor override
In reply to Greg Kroah-HartmanFrom: Julian Sax <[email protected]>
commit c870d50ce387d84b6438211a7044c60afbd5d60a upstream.
This device uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list.
--- drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 -0
@@ -397,6 +397,14 @@ static const struct dmi_system_id i2c_hi }, .driver_data = (void *)&sipodev_desc }, + { + .ident = "Vero K147", + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VERO"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "K147"), + }, + .driver_data = (void *)&sipodev_desc + }, { } /* Terminate list */ };
Greg Kroah-Hartman
maintainerPATCH 59/242 serial_core: Check for port state when tty is in error state
In reply to Greg Kroah-HartmanFrom: Alexey Kardashevskiy <[email protected]>
commit 2f70e49ed860020f5abae4f7015018ebc10e1f0e upstream.
At the moment opening a serial device node (such as /dev/ttyS3) succeeds even if there is no actual serial device behind it. Reading/writing/ioctls fail as expected because the uart port is not initialized (the type is PORT_UNKNOWN) and the TTY_IO_ERROR error state bit is set fot the tty.
However setting line discipline does not have these checks 8250_port.c (8250 is the default choice made by univ8250_console_init()). As the result of PORT_UNKNOWN, uart_port::iobase is NULL which a platform translates onto some address accessing which produces a crash like below.
This adds tty_port_initialized() to uart_set_ldisc() to prevent the crash.
Found by syzkaller.
--- drivers/tty/serial/serial_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/serial_core.c +4 -0
@@ -1434,6 +1434,10 @@ static void uart_set_ldisc(struct tty_st {struct uart_state *state = tty->driver_data;struct uart_port *uport; +struct tty_port *port = &state->port; + +if (!tty_port_initialized (port)) +return ;mutex_lock (&state->port.mutex); uport =uart_port_check (state);
Greg Kroah-Hartman
maintainerPATCH 60/242 quota: Sanity-check quota file headers on load
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 11c514a99bb960941535134f0587102855e8ddee upstream.
Perform basic sanity checks of quota headers to avoid kernel crashes on corrupted quota files.
--- fs/quota/quota_v2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
fs/quota/quota_v2.c +19 -0
@@ -158,6 +158,25 @@ static int v2_read_file_info(struct supe qinfo->dqi_entry_size =sizeof (struct v2r1_disk_dqblk ); qinfo->dqi_ops = &v2r1_qtree_ops; } + ret = -EUCLEAN ; +/* Some sanity checks of the read headers... */ +if ((loff_t )qinfo->dqi_blocks << qinfo->dqi_blocksize_bits > +i_size_read (sb_dqopt (sb)->files[type])) { +quota_error (sb,"Number of blocks too big for quota file size (%llu > %llu)." , + (loff_t )qinfo->dqi_blocks << qinfo->dqi_blocksize_bits, +i_size_read (sb_dqopt (sb)->files[type])); + goto out; + } +if (qinfo->dqi_free_blk >= qinfo->dqi_blocks) { +quota_error (sb,"Free block number too big (%u >= %u)." , + qinfo->dqi_free_blk, qinfo->dqi_blocks); + goto out; + } +if (qinfo->dqi_free_entry >= qinfo->dqi_blocks) { +quota_error (sb,"Block with free entry too big (%u >= %u)." , + qinfo->dqi_free_entry, qinfo->dqi_blocks); + goto out; + } ret =0 ; out:up_read (&dqopt->dqio_sem);
Greg Kroah-Hartman
maintainerPATCH 61/242 media: msi2500: assign SPI bus number dynamically
In reply to Greg Kroah-HartmanFrom: Antti Palosaari <[email protected]>
commit 9c60cc797cf72e95bb39f32316e9f0e5f85435f9 upstream.
SPI bus number must be assigned dynamically for each device, otherwise it will crash when multiple devices are plugged to system.
--- drivers/media/usb/msi2500/msi2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/msi2500/msi2500.c +1 -1
@@ -1250,7 +1250,7 @@ static int msi2500_probe(struct usb_inte } dev->master = master; - master->bus_num =0 ; + master->bus_num =-1 ; master->num_chipselect =1 ; master->transfer_one_message = msi2500_transfer_one_message;spi_master_set_devdata (master, dev);
Greg Kroah-Hartman
maintainerPATCH 62/242 crypto: af_alg - avoid undefined behavior accessing salg_name
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 92eb6c3060ebe3adf381fd9899451c5b047bb14d upstream.
Commit 3f69cc60768b ("crypto: af_alg - Allow arbitrarily long algorithm names") made the kernel start accepting arbitrarily long algorithm names in sockaddr_alg. However, the actual length of the salg_name field stayed at the original 64 bytes.
This is broken because the kernel can access indices >= 64 in salg_name, which is undefined behavior -- even though the memory that is accessed is still located within the sockaddr structure. It would only be defined behavior if the array were properly marked as arbitrary-length (either by making it a flexible array, which is the recommended way these days, or by making it an array of length 0 or 1).
We can't simply change salg_name into a flexible array, since that would break source compatibility with userspace programs that embed sockaddr_alg into another struct, or (more commonly) declare a sockaddr_alg like 'struct sockaddr_alg sa = { .salg_name = "foo" };'.
One solution would be to change salg_name into a flexible array only when '#ifdef __KERNEL__'. However, that would keep userspace without an easy way to actually use the longer algorithm names.
Instead, add a new structure 'sockaddr_alg_new' that has the flexible array field, and expose it to both userspace and the kernel. Make the kernel use it correctly in alg_bind().
This addresses the syzbot report
"UBSAN: array-index-out-of-bounds in alg_bind"
(https://syzkaller.appspot.com/bug?extid=92ead4eb8e26a26d465e).
--- crypto/af_alg.c | 10 +++++++--- include/uapi/linux/if_alg.h | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-)
crypto/af_alg.c +7 -3
@@ -151,7 +151,7 @@ static int alg_bind(struct socket *sock,const u32 allowed =CRYPTO_ALG_KERN_DRIVER_ONLY ;struct sock *sk = sock->sk;struct alg_sock *ask =alg_sk (sk); -struct sockaddr_alg *sa = (void *)uaddr; +struct sockaddr_alg_new *sa = (void *)uaddr;const struct af_alg_type *type;void *private;int err;
@@ -159,7 +159,11 @@ static int alg_bind(struct socket *sock,if (sock->state ==SS_CONNECTED )return -EINVAL ; -if (addr_len <sizeof (*sa)) +BUILD_BUG_ON (offsetof(struct sockaddr_alg_new , salg_name) != + offsetof(struct sockaddr_alg , salg_name)); +BUILD_BUG_ON (offsetof(struct sockaddr_alg , salg_name) !=sizeof (*sa)); + +if (addr_len <sizeof (*sa) +1 )return -EINVAL ;/* If caller uses non-allowed flag, return error. */
@@ -167,7 +171,7 @@ static int alg_bind(struct socket *sock,return -EINVAL ; sa->salg_type[sizeof (sa->salg_type) -1 ] =0 ; - sa->salg_name[sizeof (sa->salg_name) + addr_len -sizeof (*sa) -1 ] =0 ; + sa->salg_name[addr_len -sizeof (*sa) -1 ] =0 ; type =alg_get_type (sa->salg_type);if (IS_ERR (type) &&PTR_ERR (type) == -ENOENT ) {
include/uapi/linux/if_alg.h +16 -0
@@ -24,6 +24,22 @@ struct sockaddr_alg {__u8 salg_name[64 ]; }; +/* +* Linux v4.12 and later removed the 64-byte limit on salg_name[]; it's now an +* arbitrary-length field. We had to keep the original struct above for source +* compatibility with existing userspace programs, though. Use the new struct +* below if support for very long algorithm names is needed. To do this, +* allocate 'sizeof(struct sockaddr_alg_new) + strlen(algname) + 1' bytes, and +* copy algname (including the null terminator) into salg_name. +*/ +struct sockaddr_alg_new { +__u16 salg_family; +__u8 salg_type[14 ]; +__u32 salg_feat; +__u32 salg_mask; +__u8 salg_name[]; +}; +struct af_alg_iv {__u32 ivlen;__u8 iv[0 ];
Greg Kroah-Hartman
maintainerPATCH 63/242 md: fix a warning caused by a race between concurrent md_ioctl()s
In reply to Greg Kroah-HartmanFrom: Dae R. Jeong <[email protected]>
commit c731b84b51bf7fe83448bea8f56a6d55006b0615 upstream.
Syzkaller reports a warning as belows.
WARNING: CPU: 0 PID: 9647 at drivers/md/md.c:7169 ... Call Trace: ... RIP: 0010:md_ioctl+0x4017/0x5980 drivers/md/md.c:7169 RSP: 0018:ffff888096027950 EFLAGS: 00010293 RAX: ffff88809322c380 RBX: 0000000000000932 RCX: ffffffff84e266f2 RDX: 0000000000000000 RSI: ffffffff84e299f7 RDI: 0000000000000007 RBP: ffff888096027bc0 R08: ffff88809322c380 R09: ffffed101341a482 R10: ffff888096027940 R11: ffff88809a0d240f R12: 0000000000000932 R13: ffff8880a2c14100 R14: ffff88809a0d2268 R15: ffff88809a0d2408 __blkdev_driver_ioctl block/ioctl.c:304 [inline] blkdev_ioctl+0xece/0x1c10 block/ioctl.c:606 block_ioctl+0xee/0x130 fs/block_dev.c:1930 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe
This is caused by a race between two concurrenct md_ioctl()s closing the array.
CPU1 (md_ioctl()) CPU2 (md_ioctl())
------ ------set_bit(MD_CLOSING, &mddev->flags);
did_set_md_closing = true;
WARN_ON_ONCE(test_bit(MD_CLOSING,
&mddev->flags));
if(did_set_md_closing)
clear_bit(MD_CLOSING, &mddev->flags);Fix the warning by returning immediately if the MD_CLOSING bit is set in &mddev->flags which indicates that the array is being closed.
--- drivers/md/md.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/md/md.c +5 -2
@@ -7187,8 +7187,11 @@ static int md_ioctl(struct block_device err = -EBUSY ; goto out; } -WARN_ON_ONCE (test_bit (MD_CLOSING , &mddev->flags)); -set_bit (MD_CLOSING , &mddev->flags); +if (test_and_set_bit (MD_CLOSING , &mddev->flags)) { +mutex_unlock (&mddev->open_mutex); + err = -EBUSY ; + goto out; + } did_set_md_closing = true;mutex_unlock (&mddev->open_mutex);sync_blockdev (bdev);
Greg Kroah-Hartman
maintainerPATCH 64/242 Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
commit f7e0e8b2f1b0a09b527885babda3e912ba820798 upstream.
num_reports is not being properly checked. A malformed event packet with a large num_reports number makes hci_le_direct_adv_report_evt() read out of bounds. Fix it.
--- net/bluetooth/hci_event.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
net/bluetooth/hci_event.c +5 -7
@@ -5141,20 +5141,18 @@ static void hci_le_direct_adv_report_evt struct sk_buff *skb) {u8 num_reports = skb->data[0 ]; -void *ptr = &skb->data[1 ]; +struct hci_ev_le_direct_adv_info *ev = (void *)&skb->data[1 ]; -hci_dev_lock (hdev); +if (!num_reports || skb->len < num_reports *sizeof (*ev) +1 ) +return ; -while (num_reports--) { -struct hci_ev_le_direct_adv_info *ev = ptr; +hci_dev_lock (hdev); +for (; num_reports; num_reports--, ev++)process_adv_report (hdev, ev->evt_type, &ev->bdaddr, ev->bdaddr_type, &ev->direct_addr, ev->direct_addr_type, ev->rssi,NULL ,0 ); - ptr +=sizeof (*ev); - } -hci_dev_unlock (hdev); }
Greg Kroah-Hartman
maintainerPATCH 65/242 drm/gma500: fix double free of gma_connector
In reply to Greg Kroah-HartmanFrom: Tom Rix <[email protected]>
[ Upstream commit 4e19d51ca5b28a1d435a844c7b2a8e1b1b6fa237 ]
clang static analysis reports this problem:
cdv_intel_dp.c:2101:2: warning: Attempt to free released memory
kfree(gma_connector);
^~~~~~~~~~~~~~~~~~~~In cdv_intel_dp_init() when the call to cdv_intel_edp_panel_vdd_off() fails, the handler calls cdv_intel_dp_destroy(connector) which does the first free of gma_connector. So adjust the goto label and skip the second free.
--- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/gma500/cdv_intel_dp.c +1 -1
@@ -2126,7 +2126,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_devDRM_INFO ("failed to retrieve link info, disabling eDP\n" );cdv_intel_dp_encoder_destroy (encoder);cdv_intel_dp_destroy (connector); - goto err_priv; + goto err_connector; }else { DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n", intel_dp->dpcd[0], intel_dp->dpcd[1],
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 66/242 soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit cf25d802e029c31efac8bdc979236927f37183bd ]
This code needs to call iounmap() on one error path.
--- arch/arm/mach-shmobile/pm-rmobile.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/pm-rmobile.c +1 -0
@@ -336,6 +336,7 @@ static int __init rmobile_init_pm_domains(void) pmd =of_get_child_by_name (np,"pm-domains" );if (!pmd) { +iounmap (base);pr_warn ("%pOF lacks pm-domains node\n" , np);continue ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 67/242 soc: mediatek: Check if power domains can be powered on at boot time
In reply to Greg Kroah-HartmanFrom: Nicolas Boichat <[email protected]>
[ Upstream commit 4007844b05815717f522c7ea9914e24ad0ff6c79 ]
In the error case, where a power domain cannot be powered on successfully at boot time (in mtk_register_power_domains), pm_genpd_init would still be called with is_off=false, and the system would later try to disable the power domain again, triggering warnings as disabled clocks are disabled again (and other potential issues).
Also print a warning splat in that case, as this should never happen.
--- drivers/soc/mediatek/mtk-scpsys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/mediatek/mtk-scpsys.c +3 -2
@@ -481,6 +481,7 @@ static void mtk_register_power_domains(struct platform_device *pdev,for (i =0 ; i < num; i++) {struct scp_domain *scpd = &scp->domains[i];struct generic_pm_domain *genpd = &scpd->genpd; +bool on;/* * Initially turn on all domains to make the domains usable
@@ -488,9 +489,9 @@ static void mtk_register_power_domains(struct platform_device *pdev,* software. The unused domains will be switched off during * late_init time. */ - genpd->power_on (genpd); + on = !WARN_ON (genpd->power_on (genpd) <0 ); -pm_genpd_init (genpd,NULL , false); +pm_genpd_init (genpd,NULL , !on); }/*
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 68/242 RDMA/bnxt_re: Set queue pair state when being queried
In reply to Greg Kroah-HartmanFrom: Kamal Heib <[email protected]>
[ Upstream commit 53839b51a7671eeb3fb44d479d541cf3a0f2dd45 ]
The API for ib_query_qp requires the driver to set cur_qp_state on return, add the missing set.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 -0
@@ -1590,6 +1590,7 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, goto out; } qp_attr->qp_state =__to_ib_qp_state (qplib_qp->state); + qp_attr->cur_qp_state =__to_ib_qp_state (qplib_qp->cur_qp_state); qp_attr->en_sqd_async_notify = qplib_qp->en_sqd_async_notify ?1 :0 ; qp_attr->qp_access_flags =__to_ib_access_flags (qplib_qp->access); qp_attr->pkey_index = qplib_qp->pkey_index;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 69/242 selinux: fix error initialization in inode_doinit_with_dentry()
In reply to Greg Kroah-HartmanFrom: Tianyue Ren <[email protected]>
[ Upstream commit 83370b31a915493231e5b9addc72e4bef69f8d31 ]
Mark the inode security label as invalid if we cannot find a dentry so that we will retry later rather than marking it initialized with the unlabeled SID.
--- security/selinux/hooks.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
security/selinux/hooks.c +16 -3
@@ -1569,7 +1569,13 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent* inode_doinit with a dentry, before these inodes could * be used again by userspace. */ - goto out; + isec->initialized =LABEL_INVALID ; +/* +* There is nothing useful to jump to the "out" +* label, except a needless spin lock/unlock +* cycle. +*/ +return 0 ; } len =INITCONTEXTLEN ;
@@ -1677,8 +1683,15 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent* inode_doinit() with a dentry, before these inodes * could be used again by userspace. */ -if (!dentry) - goto out; +if (!dentry) { + isec->initialized =LABEL_INVALID ; +/* +* There is nothing useful to jump to the "out" +* label, except a needless spin lock/unlock +* cycle. +*/ +return 0 ; + } rc =selinux_genfs_get_sid (dentry, sclass, sbsec->flags, &sid);dput (dentry);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 70/242 RDMA/rxe: Compute PSN windows correctly
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit bb3ab2979fd69db23328691cb10067861df89037 ]
The code which limited the number of unacknowledged PSNs was incorrect. The PSNs are limited to 24 bits and wrap back to zero from 0x00ffffff. The test was computing a 32 bit value which wraps at 32 bits so that qp->req.psn can appear smaller than the limit when it is actually larger.
Replace '>' test with psn_compare which is used for other PSN comparisons and correctly handles the 24 bit size.
--- drivers/infiniband/sw/rxe/rxe_req.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_req.c +2 -1
@@ -664,7 +664,8 @@ next_wqe: }if (unlikely (qp_type (qp) ==IB_QPT_RC && - qp->req.psn > (qp->comp.psn +RXE_MAX_UNACKED_PSNS ))) { +psn_compare (qp->req.psn, (qp->comp.psn + +RXE_MAX_UNACKED_PSNS )) >0 )) { qp->req.wait_psn =1 ; goto exit; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 71/242 x86/mm/ident_map: Check for errors from ident_pud_init()
In reply to Greg Kroah-HartmanFrom: Arvind Sankar <[email protected]>
[ Upstream commit 1fcd009102ee02e217f2e7635ab65517d785da8e ]
Commit
ea3b5e60ce80 ("x86/mm/ident_map: Add 5-level paging support")
added ident_p4d_init() to support 5-level paging, but this function doesn't check and return errors from ident_pud_init().
For example, the decompressor stub uses this code to create an identity mapping. If it runs out of pages while trying to allocate a PMD pagetable, the error will be currently ignored.
Fix this to propagate errors.
[ bp: Space out statements for better readability. ]
--- arch/x86/mm/ident_map.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/x86/mm/ident_map.c +10 -2
@@ -62,6 +62,7 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page, unsigned long addr, unsigned long end) {unsigned long next; +int result;for (; addr < end; addr = next) {p4d_t *p4d = p4d_page +p4d_index (addr);
@@ -73,13 +74,20 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page,if (p4d_present (*p4d)) { pud =pud_offset (p4d,0 ); -ident_pud_init (info, pud, addr, next); + result =ident_pud_init (info, pud, addr, next); +if (result) +return result; +continue ; } pud = (pud_t *)info->alloc_pgt_page (info->context);if (!pud)return -ENOMEM ; -ident_pud_init (info, pud, addr, next); + + result =ident_pud_init (info, pud, addr, next); +if (result) +return result; +set_p4d (p4d,__p4d (__pa (pud) | info->kernpg_flag)); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 72/242 ARM: p2v: fix handling of LPAE translation in BE mode
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 4e79f0211b473f8e1eab8211a9fd50cc41a3a061 ]
When running in BE mode on LPAE hardware with a PA-to-VA translation that exceeds 4 GB, we patch bits 39:32 of the offset into the wrong byte of the opcode. So fix that, by rotating the offset in r0 to the right by 8 bits, which will put the 8-bit immediate in bits 31:24.
Note that this will also move bit #22 in its correct place when applying the rotation to the constant #0x400000.
--- arch/arm/kernel/head.S | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/kernel/head.S +1 -5
@@ -674,12 +674,8 @@ ARM_BE8(rev16 ip, ip) ldrcc r7, [r4], #4 @ use branch for delay slot bcc 1b bx lr -#else -#ifdef CONFIG_CPU_ENDIAN_BE8 - moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction #else moveq r0, #0x400000 @ set bit 22, mov to mvn instruction -#endif b 2f 1: ldr ip, [r7, r3] #ifdef CONFIG_CPU_ENDIAN_BE8
@@ -688,7 +684,7 @@ ARM_BE8(rev16 ip, ip) tst ip, #0x000f0000 @ check the rotation field orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 biceq ip, ip, #0x00004000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 + orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0 #else bic ip, ip, #0x000000ff tst ip, #0xf00 @ check the rotation field
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 73/242 sched/deadline: Fix sched_dl_global_validate()
In reply to Greg Kroah-HartmanFrom: Peng Liu <[email protected]>
[ Upstream commit a57415f5d1e43c3a5c5d412cd85e2792d7ed9b11 ]
When change sched_rt_{runtime, period}_us, we validate that the new settings should at least accommodate the currently allocated -dl bandwidth:
sched_rt_handler()
--> sched_dl_bandwidth_validate()
{
new_bw = global_rt_runtime()/global_rt_period();
for_each_possible_cpu(cpu) {
dl_b = dl_bw_of(cpu);
if (new_bw < dl_b->total_bw) <-------
ret = -EBUSY;
}
}But under CONFIG_SMP, dl_bw is per root domain , but not per CPU, dl_b->total_bw is the allocated bandwidth of the whole root domain. Instead, we should compare dl_b->total_bw against "cpus*new_bw", where 'cpus' is the number of CPUs of the root domain.
Also, below annotation(in kernel/sched/sched.h) implied implementation only appeared in SCHED_DEADLINE v2[1], then deadline scheduler kept evolving till got merged(v9), but the annotation remains unchanged, meaningless and misleading, update it.
* With respect to SMP, the bandwidth is given on a per-CPU basis,
* meaning that:
* - dl_bw (< 100%) is the bandwidth of the system (group) on each CPU;
* - dl_total_bw array contains, in the i-eth element, the currently
* allocated bandwidth on the i-eth CPU.
[1]: https://lore.kernel.org/lkml/1267385230.13676.101.camel@Palantir/
--- kernel/sched/deadline.c | 5 +++-- kernel/sched/sched.h | 42 ++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 26 deletions(-)
kernel/sched/deadline.c +3 -2
@@ -2345,7 +2345,7 @@ int sched_dl_global_validate(void)u64 period =global_rt_period ();u64 new_bw =to_ratio (period, runtime);struct dl_bw *dl_b; -int cpu, ret =0 ; +int cpu, cpus, ret =0 ;unsigned long flags;/*
@@ -2360,9 +2360,10 @@ int sched_dl_global_validate(void)for_each_possible_cpu (cpu) {rcu_read_lock_sched (); dl_b =dl_bw_of (cpu); + cpus =dl_bw_cpus (cpu);raw_spin_lock_irqsave (&dl_b->lock, flags); -if (new_bw < dl_b->total_bw) +if (new_bw * cpus < dl_b->total_bw) ret = -EBUSY ;raw_spin_unlock_irqrestore (&dl_b->lock, flags);
kernel/sched/sched.h +18 -24
54 lines not on this page · raw message
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 74/242 sched: Reenable interrupts in do_sched_yield()
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
[ Upstream commit 345a957fcc95630bf5535d7668a59ed983eb49a7 ]
do_sched_yield() invokes schedule() with interrupts disabled which is not allowed. This goes back to the pre git era to commit a6efb709806c ("[PATCH] irqlock patch 2.5.27-H6") in the history tree.
Reenable interrupts and remove the misleading comment which "explains" it.
--- kernel/sched/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
kernel/sched/core.c +1 -5
@@ -4826,12 +4826,8 @@ SYSCALL_DEFINE0(sched_yield)schedstat_inc (rq->yld_count); current->sched_class->yield_task (rq); -/* -* Since we are going to call schedule() anyway, there's -* no need to preempt or enable interrupts: -*/ preempt_disable (); -rq_unlock (rq, &rf); +rq_unlock_irq (rq, &rf);sched_preempt_enable_no_resched ();schedule ();
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 75/242 crypto: talitos - Fix return type of current_desc_hdr()
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit 0237616173fd363a54bd272aa3bd376faa1d7caa ]
current_desc_hdr() returns a u32 but in fact this is a __be32, leading to a lot of sparse warnings.
Change the return type to __be32 and ensure it is handled as sure by the caller.
--- drivers/crypto/talitos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/talitos.c +3 -3
@@ -447,7 +447,7 @@ DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE)/* * locate current (offending) descriptor */ -static u32 current_desc_hdr (struct device *dev,int ch) +static __be32 current_desc_hdr (struct device *dev,int ch) {struct talitos_private *priv =dev_get_drvdata (dev);int tail, iter;
@@ -478,13 +478,13 @@ static u32 current_desc_hdr(struct device *dev, int ch)/* * user diagnostics; report root cause of error based on execution unit status */ -static void report_eu_error (struct device *dev,int ch,u32 desc_hdr) +static void report_eu_error (struct device *dev,int ch,__be32 desc_hdr) {struct talitos_private *priv =dev_get_drvdata (dev);int i;if (!desc_hdr) - desc_hdr =in_be32 (priv->chan[ch].reg +TALITOS_DESCBUF ); + desc_hdr =cpu_to_be32 (in_be32 (priv->chan[ch].reg +TALITOS_DESCBUF ));switch (desc_hdr &DESC_HDR_SEL0_MASK ) {case DESC_HDR_SEL0_AFEU :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 76/242 spi: img-spfi: fix reference leak in img_spfi_resume
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit ee5558a9084584015c8754ffd029ce14a5827fa8 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in img_spfi_resume, so we should fix it.
--- drivers/spi/spi-img-spfi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-img-spfi.c +3 -1
@@ -771,8 +771,10 @@ static int img_spfi_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret) +if (ret) { +pm_runtime_put_noidle (dev);return ret; + }spfi_reset (spfi);pm_runtime_put (dev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 77/242 ASoC: pcm: DRAIN support reactivation
In reply to Greg Kroah-HartmanFrom: Cezary Rojewski <[email protected]>
[ Upstream commit 4c22b80f61540ea99d9b4af0127315338755f05b ]
soc-pcm's dpcm_fe_dai_do_trigger() supported DRAIN commnad up to kernel v5.4 where explicit switch(cmd) has been introduced which takes into account all SNDRV_PCM_TRIGGER_xxx but SNDRV_PCM_TRIGGER_DRAIN. Update switch statement to reactive support for it.
As DRAIN is somewhat unique by lacking negative/stop counterpart, bring behaviour of dpcm_fe_dai_do_trigger() for said command back to its pre-v5.4 state by adding it to START/RESUME/PAUSE_RELEASE group.
--- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-pcm.c +2 -0
@@ -2172,6 +2172,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : +case SNDRV_PCM_TRIGGER_DRAIN : ret =dpcm_dai_trigger_fe_be (substream, cmd, true);break ;case SNDRV_PCM_TRIGGER_STOP :
@@ -2189,6 +2190,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : +case SNDRV_PCM_TRIGGER_DRAIN : ret =dpcm_dai_trigger_fe_be (substream, cmd, false);break ;case SNDRV_PCM_TRIGGER_STOP :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 78/242 selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
In reply to Greg Kroah-HartmanFrom: Paul Moore <[email protected]>
[ Upstream commit 200ea5a2292dc444a818b096ae6a32ba3caa51b9 ]
A previous fix, commit 83370b31a915 ("selinux: fix error initialization in inode_doinit_with_dentry()"), changed how failures were handled before a SELinux policy was loaded. Unfortunately that patch was potentially problematic for two reasons: it set the isec->initialized state without holding a lock, and it didn't set the inode's SELinux label to the "default" for the particular filesystem. The later can be a problem if/when a later attempt to revalidate the inode fails and SELinux reverts to the existing inode label.
This patch should restore the default inode labeling that existed before the original fix, without affecting the LABEL_INVALID marking such that revalidation will still be attempted in the future.
--- security/selinux/hooks.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-)
security/selinux/hooks.c +13 -18
@@ -1569,13 +1569,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent* inode_doinit with a dentry, before these inodes could * be used again by userspace. */ - isec->initialized =LABEL_INVALID ; -/* -* There is nothing useful to jump to the "out" -* label, except a needless spin lock/unlock -* cycle. -*/ -return 0 ; + goto out_invalid; } len =INITCONTEXTLEN ;
@@ -1683,15 +1677,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent* inode_doinit() with a dentry, before these inodes * could be used again by userspace. */ -if (!dentry) { - isec->initialized =LABEL_INVALID ; -/* -* There is nothing useful to jump to the "out" -* label, except a needless spin lock/unlock -* cycle. -*/ -return 0 ; - } +if (!dentry) + goto out_invalid; rc =selinux_genfs_get_sid (dentry, sclass, sbsec->flags, &sid);dput (dentry);
@@ -1704,11 +1691,10 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent out:spin_lock (&isec->lock);if (isec->initialized ==LABEL_PENDING ) { -if (!sid || rc) { +if (rc) { isec->initialized =LABEL_INVALID ; goto out_unlock; } - isec->initialized =LABEL_INITIALIZED ; isec->sid = sid; }
@@ -1716,6 +1702,15 @@ out: out_unlock:spin_unlock (&isec->lock);return rc; + +out_invalid: +spin_lock (&isec->lock); +if (isec->initialized ==LABEL_PENDING ) { + isec->initialized =LABEL_INVALID ; + isec->sid = sid; + } +spin_unlock (&isec->lock); +return 0 ; }/* Convert a Linux signal to an access vector. */
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 79/242 arm64: dts: exynos: Correct psci compatible used on Exynos7
In reply to Greg Kroah-HartmanFrom: Paweł Chmiel <[email protected]>
[ Upstream commit e1e47fbca668507a81bb388fcae044b89d112ecc ]
It's not possible to reboot or poweroff Exynos7420 using PSCI. Instead we need to use syscon reboot/poweroff drivers, like it's done for other Exynos SoCs. This was confirmed by checking vendor source and testing it on Samsung Galaxy S6 device based on this SoC.
To be able to use custom restart/poweroff handlers instead of PSCI functions, we need to correct psci compatible. This also requires us to provide function ids for CPU_ON and CPU_OFF.
--- arch/arm64/boot/dts/exynos/exynos7.dtsi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/exynos/exynos7.dtsi +3 -1
@@ -65,8 +65,10 @@ }; psci { - compatible = "arm,psci-0.2"; + compatible = "arm,psci"; method = "smc"; + cpu_off = <0x84000002>; + cpu_on = <0xC4000003>; }; soc: soc {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 80/242 Bluetooth: Fix null pointer dereference in hci_event_packet()
In reply to Greg Kroah-HartmanFrom: Anmol Karn <[email protected]>
[ Upstream commit 6dfccd13db2ff2b709ef60a50163925d477549aa ]
AMP_MGR is getting derefernced in hci_phy_link_complete_evt(), when called from hci_event_packet() and there is a possibility, that hcon->amp_mgr may not be found when accessing after initialization of hcon.
- net/bluetooth/hci_event.c:4945
The bug seems to get triggered in this line:
bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;
Fix it by adding a NULL check for the hcon->amp_mgr before checking the ev-status.
--- net/bluetooth/hci_event.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bluetooth/hci_event.c +5 -0
@@ -4350,6 +4350,11 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,return ; } +if (!hcon->amp_mgr) { +hci_dev_unlock (hdev); +return ; + } +if (ev->status) {hci_conn_del (hcon);hci_dev_unlock (hdev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 81/242 spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 45c0cba753641e5d7c3207f04241bd0e7a021698 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in ti_qspi_setup, so we should fix it.
--- drivers/spi/spi-ti-qspi.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-ti-qspi.c +1 -0
@@ -180,6 +180,7 @@ static int ti_qspi_setup(struct spi_device *spi) ret =pm_runtime_get_sync (qspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (qspi->dev);dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 82/242 spi: tegra20-slink: fix reference leak in slink ops of tegra20
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 763eab7074f6e71babd85d796156f05a675f9510 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in two callers(tegra_slink_setup and tegra_slink_resume), so we should fix it.
--- drivers/spi/spi-tegra20-slink.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spi-tegra20-slink.c +2 -0
@@ -761,6 +761,7 @@ static int tegra_slink_setup(struct spi_device *spi) ret =pm_runtime_get_sync (tspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (tspi->dev);dev_err (tspi->dev,"pm runtime failed, e = %d\n" , ret);return ret; }
@@ -1197,6 +1198,7 @@ static int tegra_slink_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 83/242 spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 3482e797ab688da6703fe18d8bad52f94199f4f2 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in tegra_sflash_resume, so we should fix it.
--- drivers/spi/spi-tegra20-sflash.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-tegra20-sflash.c +1 -0
@@ -564,6 +564,7 @@ static int tegra_sflash_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 84/242 spi: tegra114: fix reference leak in tegra spi ops
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit a042184c7fb99961ea083d4ec192614bec671969 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in two callers(tegra_spi_setup and tegra_spi_resume), so we should fix it.
--- drivers/spi/spi-tegra114.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spi-tegra114.c +2 -0
@@ -827,6 +827,7 @@ static int tegra_spi_setup(struct spi_device *spi) ret =pm_runtime_get_sync (tspi->dev);if (ret <0 ) { +pm_runtime_put_noidle (tspi->dev);dev_err (tspi->dev,"pm runtime failed, e = %d\n" , ret);return ret; }
@@ -1252,6 +1253,7 @@ static int tegra_spi_resume(struct device *dev) ret =pm_runtime_get_sync (dev);if (ret <0 ) { +pm_runtime_put_noidle (dev);dev_err (dev,"pm runtime failed, e = %d\n" , ret);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 85/242 mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
In reply to Greg Kroah-HartmanFrom: Tsuchiya Yuto <[email protected]>
[ Upstream commit fa74cb1dc0f4da46c441b735ca865ac52de42c0e ]
When a PCIe function level reset (FLR) is performed but without fw reset for some reasons (e.g., on Microsoft Surface devices, fw reset requires other quirks), it fails to reset wifi properly. You can trigger the issue on such devices via debugfs entry for reset:
$ echo 1 | sudo tee /sys/kernel/debug/mwifiex/mlan0/reset
and the resulting dmesg log:
[ 45.740508] mwifiex_pcie 0000:03:00.0: Resetting per request
[ 45.742937] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 3
[ 45.744666] mwifiex_pcie 0000:03:00.0: info: shutdown mwifiex...
[ 45.751530] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.751539] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771691] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771695] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 45.771697] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771698] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 45.771699] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771701] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 45.771702] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771703] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 45.771704] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771705] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 45.771707] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
[ 45.771708] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 53.099343] mwifiex_pcie 0000:03:00.0: info: trying to associate to '[SSID]' bssid [BSSID]
[ 53.241870] mwifiex_pcie 0000:03:00.0: info: associated to bssid [BSSID] successfully
[ 75.377942] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
[ 85.385491] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 15
[ 87.539408] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
[ 87.539412] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 99.699917] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
[ 99.699925] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[ 111.859802] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
[ 111.859808] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
[...]When comparing mwifiex_shutdown_sw() with mwifiex_pcie_remove(), it lacks mwifiex_init_shutdown_fw().
This commit fixes mwifiex_shutdown_sw() by adding the missing mwifiex_init_shutdown_fw().
--- drivers/net/wireless/marvell/mwifiex/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/marvell/mwifiex/main.c +2 -0
@@ -1447,6 +1447,8 @@ int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) priv =mwifiex_get_priv (adapter,MWIFIEX_BSS_ROLE_ANY );mwifiex_deauthenticate (priv,NULL ); +mwifiex_init_shutdown_fw (priv,MWIFIEX_FUNC_SHUTDOWN ); +mwifiex_uninit_sw (adapter);if (adapter->if_ops.down_dev)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 86/242 ASoC: wm8998: Fix PM disable depth imbalance on error
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 193aa0a043645220d2a2f783ba06ae13d4601078 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- sound/soc/codecs/wm8998.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8998.c +3 -1
@@ -1425,7 +1425,7 @@ static int wm8998_probe(struct platform_device *pdev) ret =arizona_init_spk_irqs (arizona);if (ret <0 ) -return ret; + goto err_pm_disable; ret =snd_soc_register_codec (&pdev->dev, &soc_codec_dev_wm8998, wm8998_dai,ARRAY_SIZE (wm8998_dai));
@@ -1438,6 +1438,8 @@ static int wm8998_probe(struct platform_device *pdev) err_spk_irqs:arizona_free_spk_irqs (arizona); +err_pm_disable: +pm_runtime_disable (&pdev->dev);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 87/242 net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown
In reply to Greg Kroah-HartmanFrom: Vincent Bernat <[email protected]>
[ Upstream commit c0c5a60f0f1311bcf08bbe735122096d6326fb5b ]
Introduced in 0eeb075fad73, the "ignore_routes_with_linkdown" sysctl ignores a route whose interface is down. It is provided as a per-interface sysctl. However, while a "all" variant is exposed, it was a noop since it was never evaluated. We use the usual "or" logic for this kind of sysctls.
Tested with:
ip link add type veth # veth0 + veth1
ip link add type veth # veth1 + veth2
ip link set up dev veth0
ip link set up dev veth1 # link-status paired with veth0
ip link set up dev veth2
ip link set up dev veth3 # link-status paired with veth2
# First available path
ip -4 addr add 203.0.113.${uts#H}/24 dev veth0
ip -6 addr add 2001:db8:1::${uts#H}/64 dev veth0
# Second available path
ip -4 addr add 192.0.2.${uts#H}/24 dev veth2
ip -6 addr add 2001:db8:2::${uts#H}/64 dev veth2
# More specific route through first path
ip -4 route add 198.51.100.0/25 via 203.0.113.254 # via veth0
ip -6 route add 2001:db8:3::/56 via 2001:db8:1::ff # via veth0
# Less specific route through second path
ip -4 route add 198.51.100.0/24 via 192.0.2.254 # via veth2
ip -6 route add 2001:db8:3::/48 via 2001:db8:2::ff # via veth2
# H1: enable on "all"
# H2: enable on "veth0"
for v in ipv4 ipv6; do
case $uts in
H1)
sysctl -qw net.${v}.conf.all.ignore_routes_with_linkdown=1
;;
H2)
sysctl -qw net.${v}.conf.veth0.ignore_routes_with_linkdown=1
;;
esac
done
set -xe
# When veth0 is up, best route is through veth0
ip -o route get 198.51.100.1 | grep -Fw veth0
ip -o route get 2001:db8:3::1 | grep -Fw veth0
# When veth0 is down, best route should be through veth2 on H1/H2,
# but on veth0 on H2
ip link set down dev veth1 # down veth0
ip route show
[ $uts != H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth0
[ $uts != H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth0
[ $uts = H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth2
[ $uts = H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth2Without this patch, the two last lines would fail on H1 (the one using the "all" sysctl). With the patch, everything succeeds as expected.
Also document the sysctl in ip-sysctl.rst.
--- Documentation/networking/ip-sysctl.txt | 3 +++ include/linux/inetdevice.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
Documentation/networking/ip-sysctl.txt +3 -0
@@ -1271,6 +1271,9 @@ igmpv3_unsolicited_report_interval - INTEGER IGMPv3 report retransmit will take place. Default: 1000 (1 seconds) +ignore_routes_with_linkdown - BOOLEAN + Ignore routes whose link is down when performing a FIB lookup. + promote_secondaries - BOOLEAN When a primary IP address is removed from this interface promote a corresponding secondary IP address instead of
include/linux/inetdevice.h +1 -1
@@ -123,7 +123,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))#define IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN (in_dev) \ - IN_DEV_CONF_GET((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) + IN_DEV_ORCONF((in_dev), IGNORE_ROUTES_WITH_LINKDOWN)#define IN_DEV_ARPFILTER (in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)#define IN_DEV_ARP_ACCEPT (in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 88/242 net: evaluate net.ipv4.conf.all.proxy_arp_pvlan
In reply to Greg Kroah-HartmanFrom: Vincent Bernat <[email protected]>
[ Upstream commit 1af5318c00a8acc33a90537af49b3f23f72a2c4b ]
Introduced in 65324144b50b, the "proxy_arp_vlan" sysctl is a per-interface sysctl to tune proxy ARP support for private VLANs. While the "all" variant is exposed, it was a noop and never evaluated. We use the usual "or" logic for this kind of sysctls.
--- include/linux/inetdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/inetdevice.h +1 -1
@@ -102,7 +102,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)#define IN_DEV_LOG_MARTIANS (in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)#define IN_DEV_PROXY_ARP (in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) -#define IN_DEV_PROXY_ARP_PVLAN (in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) +#define IN_DEV_PROXY_ARP_PVLAN (in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP_PVLAN)#define IN_DEV_SHARED_MEDIA (in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)#define IN_DEV_TX_REDIRECTS (in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)#define IN_DEV_SEC_REDIRECTS (in_dev) IN_DEV_ORCONF((in_dev), \
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 89/242 ASoC: arizona: Fix a wrong free in wm8997_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 5e7aace13df24ff72511f29c14ebbfe638ef733c ]
In the normal path, we should not free the arizona, we should return immediately. It will be free when call remove operation.
--- sound/soc/codecs/wm8997.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/wm8997.c +2 -0
@@ -1179,6 +1179,8 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } +return ret; + err_spk_irqs:arizona_free_spk_irqs (arizona);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 90/242 RDMa/mthca: Work around -Wenum-conversion warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit fbb7dc5db6dee553b5a07c27e86364a5223e244c ]
gcc points out a suspicious mixing of enum types in a function that converts from MTHCA_OPCODE_* values to IB_WC_* values:
drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one':drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum <anonymous>' to 'enum ib_wc_opcode' [-Wenum-conversion]
607 | entry->opcode = MTHCA_OPCODE_INVALID;
Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if this is meaningful, but it seems harmless as it deals with an invalid input.
Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is still bogus, but at least doesn't make compiler warnings.
--- drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_dev.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/mthca/mthca_cq.c +1 -1
@@ -609,7 +609,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev, entry->byte_len =MTHCA_ATOMIC_BYTE_LEN ;break ;default : - entry->opcode =MTHCA_OPCODE_INVALID ; + entry->opcode =0xFF ;break ; } }else {
drivers/infiniband/hw/mthca/mthca_dev.h +0 -1
@@ -105,7 +105,6 @@ enum {MTHCA_OPCODE_ATOMIC_CS =0x11 ,MTHCA_OPCODE_ATOMIC_FA =0x12 , MTHCA_OPCODE_BIND_MW = 0x18, -MTHCA_OPCODE_INVALID =0xff }; enum {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 91/242 MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
In reply to Greg Kroah-HartmanFrom: Necip Fazil Yildiran <[email protected]>
[ Upstream commit 3a5fe2fb9635c43359c9729352f45044f3c8df6b ]
When BCM47XX_BCMA is enabled and BCMA_DRIVER_PCI is disabled, it results in the following Kbuild warning:
WARNING: unmet direct dependencies detected for BCMA_DRIVER_PCI_HOSTMODE
Depends on [n]: MIPS [=y] && BCMA_DRIVER_PCI [=n] && PCI_DRIVERS_LEGACY [=y] && BCMA [=y]=y Selected by [y]:
- BCM47XX_BCMA [=y] && BCM47XX [=y] && PCI [=y]
The reason is that BCM47XX_BCMA selects BCMA_DRIVER_PCI_HOSTMODE without depending on or selecting BCMA_DRIVER_PCI while BCMA_DRIVER_PCI_HOSTMODE depends on BCMA_DRIVER_PCI. This can also fail building the kernel.
Honor the kconfig dependency to remove unmet direct dependency warnings and avoid any potential build failures.
--- arch/mips/bcm47xx/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/bcm47xx/Kconfig +1 -0
@@ -27,6 +27,7 @@ config BCM47XX_BCMA select BCMA select BCMA_HOST_SOC select BCMA_DRIVER_MIPS + select BCMA_DRIVER_PCI if PCI select BCMA_DRIVER_PCI_HOSTMODE if PCI select BCMA_DRIVER_GPIO default y
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 92/242 staging: greybus: codecs: Fix reference counter leak in error handling
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 3952659a6108f77a0d062d8e8487bdbdaf52a66c ]
gb_pm_runtime_get_sync has increased the usage counter of the device here. Forgetting to call gb_pm_runtime_put_noidle will result in usage counter leak in the error branch of (gbcodec_hw_params and gbcodec_prepare). We fixed it by adding it.
--- drivers/staging/greybus/audio_codec.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/greybus/audio_codec.c +2 -0
@@ -490,6 +490,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream,if (ret) {dev_err_ratelimited (dai->dev,"%d: Error during set_config\n" , ret); +gb_pm_runtime_put_noidle (bundle);mutex_unlock (&codec->lock);return ret; }
@@ -566,6 +567,7 @@ static int gbcodec_prepare(struct snd_pcm_substream *substream,break ; }if (ret) { +gb_pm_runtime_put_noidle (bundle);mutex_unlock (&codec->lock);dev_err_ratelimited (dai->dev,"set_data_size failed:%d\n" , ret);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 93/242 media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 27c3943683f74e35e1d390ceb2e3639eff616ad6 ]
mtk_vcodec_release_dec_pm() will be called in two places:
a. mtk_vcodec_init_dec_pm() succeed while mtk_vcodec_probe() return error. b. mtk_vcodec_dec_remove().
In both cases put_device() call is needed, since of_find_device_by_node() was called in mtk_vcodec_init_dec_pm() previously.
Thus add put_devices() call in mtk_vcodec_release_dec_pm()
--- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c +1 -0
@@ -103,6 +103,7 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev)void mtk_vcodec_release_dec_pm (struct mtk_vcodec_dev *dev) {pm_runtime_disable (dev->pm.dev); +put_device (dev->pm.larbvdec); }void mtk_vcodec_dec_pw_on (struct mtk_vcodec_pm *pm)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 94/242 scsi: core: Fix VPD LUN ID designator priorities
In reply to Greg Kroah-HartmanFrom: Martin Wilck <[email protected]>
[ Upstream commit 2e4209b3806cda9b89c30fd5e7bfecb7044ec78b ]
The current implementation of scsi_vpd_lun_id() uses the designator length as an implicit measure of priority. This works most of the time, but not always. For example, some Hitachi storage arrays return this in VPD 0x83:
VPD INQUIRY: Device Identification page
Designation descriptor number 1, descriptor length: 24
designator_type: T10 vendor identification, code_set: ASCII associated with the Addressed logical unit
vendor id: HITACHI
vendor specific: 5030C3502025
Designation descriptor number 2, descriptor length: 6
designator_type: vendor specific [0x0], code_set: Binary associated with the Target port
vendor specific: 08 03
Designation descriptor number 3, descriptor length: 20
designator_type: NAA, code_set: Binary
associated with the Addressed logical unit
NAA 6, IEEE Company_id: 0x60e8
Vendor Specific Identifier: 0x7c35000
Vendor Specific Identifier Extension: 0x30c35000002025
[0x60060e8007c350000030c35000002025]The current code would use the first descriptor because it's longer than the NAA descriptor. But this is wrong, the kernel is supposed to prefer NAA descriptors over T10 vendor ID. Designator length should only be used to compare designators of the same type.
This patch addresses the issue by separating designator priority and length.
--- drivers/scsi/scsi_lib.c | 126 +++++++++++++++++++++++++++------------- 1 file changed, 86 insertions(+), 40 deletions(-)
drivers/scsi/scsi_lib.c +86 -40
@@ -3326,6 +3326,78 @@ void sdev_enable_disk_events(struct scsi_device *sdev) }EXPORT_SYMBOL (sdev_enable_disk_events); +static unsigned char designator_prio (const unsigned char *d) +{ +if (d[1 ] &0x30 ) +/* not associated with LUN */ +return 0 ; + +if (d[3 ] ==0 ) +/* invalid length */ +return 0 ; + +/* +* Order of preference for lun descriptor: +* - SCSI name string +* - NAA IEEE Registered Extended +* - EUI-64 based 16-byte +* - EUI-64 based 12-byte +* - NAA IEEE Registered +* - NAA IEEE Extended +* - EUI-64 based 8-byte +* - SCSI name string (truncated) +* - T10 Vendor ID +* as longer descriptors reduce the likelyhood +* of identification clashes. +*/ + +switch (d[1 ] &0xf ) { +case 8 : +/* SCSI name string, variable-length UTF-8 */ +return 9 ; +case 3 : +switch (d[4 ] >>4 ) { +case 6 : +/* NAA registered extended */ +return 8 ; +case 5 : +/* NAA registered */ +return 5 ; +case 4 : +/* NAA extended */ +return 4 ; +case 3 : +/* NAA locally assigned */ +return 1 ; +default : +break ; + } +break ; +case 2 : +switch (d[3 ]) { +case 16 : +/* EUI64-based, 16 byte */ +return 7 ; +case 12 : +/* EUI64-based, 12 byte */ +return 6 ; +case 8 : +/* EUI64-based, 8 byte */ +return 3 ; +default : +break ; + } +break ; +case 1 : +/* T10 vendor ID */ +return 1 ; +default : +break ; + } + +return 0 ; +} +/** * scsi_vpd_lun_id - return a unique device identification * @sdev: SCSI device
@@ -3342,7 +3414,7 @@ EXPORT_SYMBOL(sdev_enable_disk_events);*/ int scsi_vpd_lun_id (struct scsi_device *sdev,char *id,size_t id_len) { -u8 cur_id_type =0xff ; +u8 cur_id_prio =0 ;u8 cur_id_size =0 ;const unsigned char *d, *cur_id_str;const struct scsi_vpd *vpd_pg83;
@@ -3355,20 +3427,6 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len)return -ENXIO ; } -/* -* Look for the correct descriptor. -* Order of preference for lun descriptor: -* - SCSI name string -* - NAA IEEE Registered Extended -* - EUI-64 based 16-byte -* - EUI-64 based 12-byte -* - NAA IEEE Registered -* - NAA IEEE Extended -* - T10 Vendor ID -* as longer descriptors reduce the likelyhood -* of identification clashes. -*/ -/* The id string must be at least 20 bytes + terminating NULL byte */ if (id_len <21 ) {rcu_read_unlock ();
@@ -3378,8 +3436,9 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len)memset (id,0 , id_len); d = vpd_pg83->data +4 ;while (d < vpd_pg83->data + vpd_pg83->len) { -/* Skip designators not referring to the LUN */ -if ((d[1 ] &0x30 ) !=0x00 ) +u8 prio =designator_prio (d); + +if (prio ==0 || cur_id_prio > prio) goto next_desig;switch (d[1 ] &0xf ) {
@@ -3387,28 +3446,19 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len)/* T10 Vendor ID */ if (cur_id_size > d[3 ])break ; -/* Prefer anything */ -if (cur_id_type >0x01 && cur_id_type !=0xff ) -break ; + cur_id_prio = prio; cur_id_size = d[3 ];if (cur_id_size +4 > id_len) cur_id_size = id_len -4 ; cur_id_str = d +4 ; - cur_id_type = d[1 ] &0xf ; id_size =snprintf (id, id_len,"t10.%*pE" , cur_id_size, cur_id_str);break ;case 0x2 :/* EUI-64 */ -if (cur_id_size > d[3 ]) -break ; -/* Prefer NAA IEEE Registered Extended */ -if (cur_id_type ==0x3 && - cur_id_size == d[3 ]) -break ; + cur_id_prio = prio; cur_id_size = d[3 ]; cur_id_str = d +4 ; - cur_id_type = d[1 ] &0xf ;switch (cur_id_size) {case 8 : id_size = snprintf(id, id_len,
@@ -3426,17 +3476,14 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len) cur_id_str);break ;default : - cur_id_size =0 ;break ; }break ;case 0x3 :/* NAA */ -if (cur_id_size > d[3 ]) -break ; + cur_id_prio = prio; cur_id_size = d[3 ]; cur_id_str = d +4 ; - cur_id_type = d[1 ] &0xf ;switch (cur_id_size) {case 8 : id_size = snprintf(id, id_len,
@@ -3449,26 +3496,25 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len) cur_id_str);break ;default : - cur_id_size =0 ;break ; }break ;case 0x8 :/* SCSI name string */ -if (cur_id_size +4 > d[3 ]) +if (cur_id_size > d[3 ])break ;/* Prefer others for truncated descriptor */ -if (cur_id_size && d[3 ] > id_len) -break ; +if (d[3 ] > id_len) { + prio =2 ; +if (cur_id_prio > prio) +break ; + } + cur_id_prio = prio; cur_id_size = id_size = d[3 ]; cur_id_str = d +4 ; - cur_id_type = d[1 ] &0xf ;if (cur_id_size >= id_len) cur_id_size = id_len -1 ;memcpy (id, cur_id_str, cur_id_size); -/* Decrease priority for truncated descriptor */ -if (cur_id_size != id_size) - cur_id_size =6 ;break ;default :break ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 95/242 media: solo6x10: fix missing snd_card_free in error handling case
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit dcdff74fa6bc00c32079d0bebd620764c26f2d89 ]
Fix to goto snd_error in error handling case when fails to do snd_ctl_add, as done elsewhere in this function.
--- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
@@ -401,7 +401,7 @@ int solo_g723_init(struct solo_dev *solo_dev) ret =snd_ctl_add (card,snd_ctl_new1 (&kctl, solo_dev));if (ret <0 ) -return ret; + goto snd_error; ret =solo_snd_pcm_init (solo_dev);if (ret <0 )
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 96/242 drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 723ae803218da993143387bf966042eccefac077 ]
Return -ENOMEM when allocating refill memory failed.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -0
@@ -751,6 +751,7 @@ static int omap_dmm_probe(struct platform_device *dev) &omap_dmm->refill_pa, GFP_KERNEL);if (!omap_dmm->refill_va) {dev_err (&dev->dev,"could not allocate refill memory\n" ); + ret = -ENOMEM ; goto fail; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 97/242 Input: ads7846 - fix race that causes missing releases
In reply to Greg Kroah-HartmanFrom: David Jander <[email protected]>
[ Upstream commit e52cd628a03f72a547dbf90ccb703ee64800504a ]
If touchscreen is released while busy reading HWMON device, the release can be missed. The IRQ thread is not started because no touch is active and BTN_TOUCH release event is never sent.
--- drivers/input/touchscreen/ads7846.c | 44 +++++++++++++++++------------ 1 file changed, 26 insertions(+), 18 deletions(-)
drivers/input/touchscreen/ads7846.c +26 -18
@@ -199,6 +199,26 @@ struct ads7846 {#define REF_ON (READ_12BIT_DFR(x, 1, 1))#define REF_OFF (READ_12BIT_DFR(y, 0, 0)) +static int get_pendown_state (struct ads7846 *ts) +{ +if (ts->get_pendown_state) +return ts->get_pendown_state (); + +return !gpio_get_value (ts->gpio_pendown); +} + +static void ads7846_report_pen_up (struct ads7846 *ts) +{ +struct input_dev *input = ts->input; + +input_report_key (input,BTN_TOUCH ,0 ); +input_report_abs (input,ABS_PRESSURE ,0 ); +input_sync (input); + + ts->pendown = false; +dev_vdbg (&ts->spi->dev,"UP\n" ); +} +/* Must be called with ts->lock held */ static void ads7846_stop (struct ads7846 *ts) {
@@ -215,6 +235,10 @@ static void ads7846_stop(struct ads7846 *ts)static void ads7846_restart (struct ads7846 *ts) {if (!ts->disabled && !ts->suspended) { +/* Check if pen was released since last stop */ +if (ts->pendown && !get_pendown_state (ts)) +ads7846_report_pen_up (ts); +/* Tell IRQ thread that it may poll the device. */ ts->stopped = false;mb ();
@@ -605,14 +629,6 @@ static const struct attribute_group ads784x_attr_group = {/*--------------------------------------------------------------------------*/ -static int get_pendown_state (struct ads7846 *ts) -{ -if (ts->get_pendown_state) -return ts->get_pendown_state (); - -return !gpio_get_value (ts->gpio_pendown); -} -static void null_wait_for_sync (void ) { }
@@ -871,16 +887,8 @@ static irqreturn_t ads7846_irq(int irq, void *handle) msecs_to_jiffies(TS_POLL_PERIOD)); } -if (ts->pendown && !ts->stopped) { -struct input_dev *input = ts->input; - -input_report_key (input,BTN_TOUCH ,0 ); -input_report_abs (input,ABS_PRESSURE ,0 ); -input_sync (input); - - ts->pendown = false; -dev_vdbg (&ts->spi->dev,"UP\n" ); - } +if (ts->pendown && !ts->stopped) +ads7846_report_pen_up (ts);return IRQ_HANDLED ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 98/242 Input: ads7846 - fix integer overflow on Rt calculation
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 820830ec918f6c3dcd77a54a1c6198ab57407916 ]
In some rare cases the 32 bit Rt value will overflow if z2 and x is max, z1 is minimal value and x_plate_ohms is relatively high (for example 800 ohm). This would happen on some screen age with low pressure.
There are two possible fixes:
- make Rt 64bit
- reorder calculation to avoid overflow
The second variant seems to be preferable, since 64 bit calculation on 32 bit system is a bit more expensive.
--- drivers/input/touchscreen/ads7846.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ads7846.c +3 -2
@@ -801,10 +801,11 @@ static void ads7846_report_state(struct ads7846 *ts)/* compute touch pressure resistance using equation #2 */ Rt = z2; Rt -= z1; - Rt *= x; Rt *= ts->x_plate_ohms; + Rt =DIV_ROUND_CLOSEST (Rt,16 ); + Rt *= x; Rt /= z1; - Rt = (Rt +2047 ) >>12 ; + Rt =DIV_ROUND_CLOSEST (Rt,256 ); }else { Rt =0 ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 99/242 Input: ads7846 - fix unaligned access on 7845
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 03e2c9c782f721b661a0e42b1b58f394b5298544 ]
req->sample[1] is not naturally aligned at word boundary, and therefore we should use get_unaligned_be16() when accessing it.
--- drivers/input/touchscreen/ads7846.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +2 -1
@@ -35,6 +35,7 @@#include <linux/regulator/consumer.h> #include <linux/module.h> #include <asm/irq.h> +#include <asm/unaligned.h> /* * This code has been heavily tested on a Nokia 770, and lightly
@@ -434,7 +435,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)if (status ==0 ) {/* BE12 value, then padding */ - status =be16_to_cpu (*((u16 *)&req->sample[1 ])); + status =get_unaligned_be16 (&req->sample[1 ]); status = status >>3 ; status &=0x0fff ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 100/242 powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit 78665179e569c7e1fe102fb6c21d0f5b6951f084 ]
On 8xx, we get the following features:
[ 0.000000] cpu_features = 0x0000000000000100 [ 0.000000] possible = 0x0000000000000120 [ 0.000000] always = 0x0000000000000000
This is not correct. As CONFIG_PPC_8xx is mutually exclusive with all other configurations, the three lines should be equal.
The problem is due to CPU_FTRS_GENERIC_32 which is taken when CONFIG_BOOK3S_32 is NOT selected. This CPU_FTRS_GENERIC_32 is pointless because there is no generic configuration supporting all 32 bits but book3s/32.
Remove this pointless generic features definition to unbreak the calculation of 'possible' features and 'always' features.
--- arch/powerpc/include/asm/cputable.h | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/include/asm/cputable.h +0 -5
@@ -423,7 +423,6 @@ enum { CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) -#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)/* 64-bit CPUs */ #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
@@ -515,8 +514,6 @@ enum { CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | CPU_FTRS_CLASSIC32 | -#else - CPU_FTRS_GENERIC_32 |#endif #ifdef CONFIG_PPC_8xx CPU_FTRS_8XX |
@@ -567,8 +564,6 @@ enum { CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & CPU_FTRS_CLASSIC32 & -#else - CPU_FTRS_GENERIC_32 &#endif #ifdef CONFIG_PPC_8xx CPU_FTRS_8XX &
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 101/242 crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit ff8107200367f4abe0e5bce66a245e8d0f2d229e ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- drivers/crypto/omap-aes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/omap-aes.c +2 -1
@@ -1071,7 +1071,7 @@ static int omap_aes_probe(struct platform_device *pdev)if (err <0 ) {dev_err (dev,"%s: failed to get_sync(%d)\n" , __func__, err); - goto err_res; + goto err_pm_disable; }omap_aes_dma_stop (dd);
@@ -1180,6 +1180,7 @@ err_engine:omap_aes_dma_cleanup (dd); err_irq:tasklet_kill (&dd->done_task); +err_pm_disable:pm_runtime_disable (dev); err_res: dd =NULL ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 102/242 soc: ti: knav_qmss: fix reference leak in knav_queue_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in knav_queue_probe, so we should fix it.
--- drivers/soc/ti/knav_qmss_queue.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/ti/knav_qmss_queue.c +1 -0
@@ -1719,6 +1719,7 @@ static int knav_queue_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev); ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) { +pm_runtime_put_noidle (&pdev->dev);dev_err (dev,"Failed to enable QMSS\n" );return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 103/242 soc: ti: Fix reference imbalance in knav_dma_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit b4fa73358c306d747a2200aec6f7acb97e5750e6 ]
The patch fix two reference leak.
1) pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to call put operation will result in reference leak.
2) The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced.
We fix it by: 1) adding call pm_runtime_put_noidle or pm_runtime_put_sync in error handling. 2) adding pm_runtime_disable in error handling, to keep usage counter and disable depth balanced.
--- drivers/soc/ti/knav_dma.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/soc/ti/knav_dma.c +11 -2
@@ -752,8 +752,9 @@ static int knav_dma_probe(struct platform_device *pdev)pm_runtime_enable (kdev->dev); ret =pm_runtime_get_sync (kdev->dev);if (ret <0 ) { +pm_runtime_put_noidle (kdev->dev);dev_err (kdev->dev,"unable to enable pktdma, err %d\n" , ret); -return ret; + goto err_pm_disable; }/* Initialise all packet dmas */
@@ -767,13 +768,21 @@ static int knav_dma_probe(struct platform_device *pdev)if (list_empty (&kdev->list)) {dev_err (dev,"no valid dma instance\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto err_put_sync; }debugfs_create_file ("knav_dma" ,S_IFREG |S_IRUGO ,NULL ,NULL , &knav_dma_debug_ops);return ret; + +err_put_sync: +pm_runtime_put_sync (kdev->dev); +err_pm_disable: +pm_runtime_disable (kdev->dev); + +return ret; }static int knav_dma_remove (struct platform_device *pdev)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 104/242 drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
[ Upstream commit 4cba398f37f868f515ff12868418dc28574853a1 ]
Fix to return the error code from of_get_child_by_name() instaed of 0 in knav_queue_probe().
--- drivers/soc/ti/knav_qmss_queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/ti/knav_qmss_queue.c +2 -1
@@ -1787,9 +1787,10 @@ static int knav_queue_probe(struct platform_device *pdev)if (ret) goto err; - regions =of_get_child_by_name (node,"descriptor-regions" ); + regions =of_get_child_by_name (node,"descriptor-regions" );if (!regions) {dev_err (dev,"descriptor-regions not specified\n" ); + ret = -ENODEV ; goto err; } ret =knav_queue_setup_regions (kdev, regions);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 105/242 Input: omap4-keypad - fix runtime PM error handling
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 59bbf83835f591b95c3bdd09d900f3584fa227af ]
In omap4_keypad_probe, the patch fix several bugs.
1) pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak.
2) In err_unmap, forget to disable runtime of device, pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced.
3) In err_pm_disable, it will call pm_runtime_put_sync twice not one time.
To fix this we factor out code reading revision and disabling touchpad, and drop PM reference once we are done talking to the device.
--- drivers/input/keyboard/omap4-keypad.c | 89 ++++++++++++++++----------- 1 file changed, 53 insertions(+), 36 deletions(-)
drivers/input/keyboard/omap4-keypad.c +53 -36
@@ -199,12 +199,8 @@ static int omap4_keypad_open(struct input_dev *input)return 0 ; } -static void omap4_keypad_close (struct input_dev *input) +static void omap4_keypad_stop (struct omap4_keypad *keypad_data) { -struct omap4_keypad *keypad_data =input_get_drvdata (input); - -disable_irq (keypad_data->irq); -/* Disable interrupts and wake-up events */ kbd_write_irqreg (keypad_data,OMAP4_KBD_IRQENABLE ,OMAP4_VAL_IRQDISABLE );
@@ -213,7 +209,15 @@ static void omap4_keypad_close(struct input_dev *input)/* clear pending interrupts */ kbd_write_irqreg (keypad_data,OMAP4_KBD_IRQSTATUS ,kbd_read_irqreg (keypad_data,OMAP4_KBD_IRQSTATUS )); +} + +static void omap4_keypad_close (struct input_dev *input) +{ +struct omap4_keypad *keypad_data; + keypad_data =input_get_drvdata (input); +disable_irq (keypad_data->irq); +omap4_keypad_stop (keypad_data);enable_irq (keypad_data->irq);pm_runtime_put_sync (input->dev.parent);
@@ -236,13 +240,37 @@ static int omap4_keypad_parse_dt(struct device *dev,return 0 ; } +static int omap4_keypad_check_revision (struct device *dev, +struct omap4_keypad *keypad_data) +{ +unsigned int rev; + + rev =__raw_readl (keypad_data->base +OMAP4_KBD_REVISION ); + rev &=0x03 <<30 ; + rev >>=30 ; +switch (rev) { +case KBD_REVISION_OMAP4 : + keypad_data->reg_offset =0x00 ; + keypad_data->irqreg_offset =0x00 ; +break ; +case KBD_REVISION_OMAP5 : + keypad_data->reg_offset =0x10 ; + keypad_data->irqreg_offset =0x0c ; +break ; +default : +dev_err (dev,"Keypad reports unsupported revision %d" , rev); +return -EINVAL ; + } + +return 0 ; +} +static int omap4_keypad_probe (struct platform_device *pdev) {struct omap4_keypad *keypad_data;struct input_dev *input_dev;struct resource *res;unsigned int max_keys; -int rev;int irq;int error;
@@ -282,41 +310,33 @@ static int omap4_keypad_probe(struct platform_device *pdev) goto err_release_mem; } +pm_runtime_enable (&pdev->dev);/* * Enable clocks for the keypad module so that we can read * revision register. */ -pm_runtime_enable (&pdev->dev); error =pm_runtime_get_sync (&pdev->dev);if (error) {dev_err (&pdev->dev,"pm_runtime_get_sync() failed\n" ); - goto err_unmap; - } - rev =__raw_readl (keypad_data->base +OMAP4_KBD_REVISION ); - rev &=0x03 <<30 ; - rev >>=30 ; -switch (rev) { -case KBD_REVISION_OMAP4 : - keypad_data->reg_offset =0x00 ; - keypad_data->irqreg_offset =0x00 ; -break ; -case KBD_REVISION_OMAP5 : - keypad_data->reg_offset =0x10 ; - keypad_data->irqreg_offset =0x0c ; -break ; -default : -dev_err (&pdev->dev, -"Keypad reports unsupported revision %d" , rev); - error = -EINVAL ; - goto err_pm_put_sync; +pm_runtime_put_noidle (&pdev->dev); + }else { + error =omap4_keypad_check_revision (&pdev->dev, + keypad_data); +if (!error) { +/* Ensure device does not raise interrupts */ +omap4_keypad_stop (keypad_data); + } +pm_runtime_put_sync (&pdev->dev); } +if (error) + goto err_pm_disable;/* input device allocation */ keypad_data->input = input_dev =input_allocate_device ();if (!input_dev) { error = -ENOMEM ; - goto err_pm_put_sync; + goto err_pm_disable; } input_dev->name = pdev->name;
@@ -361,28 +381,25 @@ static int omap4_keypad_probe(struct platform_device *pdev) goto err_free_keymap; } -device_init_wakeup (&pdev->dev, true); -pm_runtime_put_sync (&pdev->dev); - error =input_register_device (keypad_data->input);if (error <0 ) {dev_err (&pdev->dev,"failed to register input device\n" ); - goto err_pm_disable; + goto err_free_irq; } +device_init_wakeup (&pdev->dev, true);platform_set_drvdata (pdev, keypad_data); +return 0 ; -err_pm_disable: -pm_runtime_disable (&pdev->dev); +err_free_irq:free_irq (keypad_data->irq, keypad_data); err_free_keymap:kfree (keypad_data->keymap); err_free_input:input_free_device (input_dev); -err_pm_put_sync: -pm_runtime_put_sync (&pdev->dev); -err_unmap: +err_pm_disable: +pm_runtime_disable (&pdev->dev);iounmap (keypad_data->base); err_release_mem:release_mem_region (res->start,resource_size (res));
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 106/242 RDMA/cxgb4: Validate the number of CQEs
In reply to Greg Kroah-HartmanFrom: Kamal Heib <[email protected]>
[ Upstream commit 6d8285e604e0221b67bd5db736921b7ddce37d00 ]
Before create CQ, make sure that the requested number of CQEs is in the supported range.
--- drivers/infiniband/hw/cxgb4/cq.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/cxgb4/cq.c +3 -0
@@ -906,6 +906,9 @@ struct ib_cq *c4iw_create_cq(struct ib_d rhp =to_c4iw_dev (ibdev); +if (entries <1 || entries > ibdev->attrs.max_cqe) +return ERR_PTR (-EINVAL ); +if (vector >= rhp->rdev.lldi.nciq)return ERR_PTR (-EINVAL );
Greg Kroah-Hartman
maintainerPATCH 107/242 memstick: fix a double-free bug in memstick_check
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit e3e9ced5c93803d5b2ea1942c4bf0192622531d6 ]
kfree(host->card) has been called in put_device so that another kfree would raise cause a double-free bug.
--- drivers/memstick/core/memstick.c | 1 - 1 file changed, 1 deletion(-)
drivers/memstick/core/memstick.c +0 -1
@@ -469,7 +469,6 @@ static void memstick_check(struct work_struct *work) host->card = card;if (device_register (&card->dev)) {put_device (&card->dev); -kfree (host->card); host->card =NULL ; } }else
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 108/242 ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
In reply to Greg Kroah-HartmanFrom: Cristian Birsan <[email protected]>
[ Upstream commit be4dd2d448816a27c1446f8f37fce375daf64148 ]
The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without it the driver probes but VBus is not powered because of wrong pincontrol configuration.
--- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/at91-sama5d4_xplained.dts +7 -0
@@ -158,6 +158,11 @@ atmel,pins = <AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; }; + pinctrl_usb_default: usb_default { + atmel,pins = + <AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE + AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; + }; pinctrl_key_gpio: key_gpio_0 { atmel,pins = <AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
@@ -183,6 +188,8 @@ &pioE 11 GPIO_ACTIVE_HIGH &pioE 14 GPIO_ACTIVE_HIGH >; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_default>; status = "okay"; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 109/242 ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
In reply to Greg Kroah-HartmanFrom: Cristian Birsan <[email protected]>
[ Upstream commit e1062fa7292f1e3744db0a487c4ac0109e09b03d ]
The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without it the driver probes but VBus is not powered because of wrong pincontrol configuration.
--- arch/arm/boot/dts/at91-sama5d3_xplained.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/at91-sama5d3_xplained.dts +7 -0
@@ -231,6 +231,11 @@ atmel,pins = <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */ }; + pinctrl_usb_default: usb_default { + atmel,pins = + <AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE + AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; + }; }; }; };
@@ -248,6 +253,8 @@ &pioE 3 GPIO_ACTIVE_LOW &pioE 4 GPIO_ACTIVE_LOW >; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_default>; status = "okay"; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 110/242 orinoco: Move context allocation after processing the skb
In reply to Greg Kroah-HartmanFrom: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit a31eb615646a63370aa1da1053c45439c7653d83 ]
ezusb_xmit() allocates a context which is leaked if orinoco_process_xmit_skb() returns an error.
Move ezusb_alloc_ctx() after the invocation of orinoco_process_xmit_skb() because the context is not needed so early. ezusb_access_ltv() will cleanup the context in case of an error.
--- .../net/wireless/intersil/orinoco/orinoco_usb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +7 -7
@@ -1237,13 +1237,6 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)if (skb->len <ETH_HLEN ) goto drop; - ctx =ezusb_alloc_ctx (upriv,EZUSB_RID_TX ,0 ); -if (!ctx) - goto busy; - -memset (ctx->buf,0 ,BULK_BUF_SIZE ); - buf = ctx->buf->data; - tx_control =0 ; err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
@@ -1251,6 +1244,13 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)if (err) goto drop; + ctx =ezusb_alloc_ctx (upriv,EZUSB_RID_TX ,0 ); +if (!ctx) + goto drop; + +memset (ctx->buf,0 ,BULK_BUF_SIZE ); + buf = ctx->buf->data; + {__le16 *tx_cntl = (__le16 *)buf; *tx_cntl =cpu_to_le16 (tx_control);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 111/242 cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit 7ec8a926188eb8e7a3cbaca43ec44f2d7146d71b ]
Add the missing destroy_workqueue() before return from cw1200_init_common in the error handling case.
--- drivers/net/wireless/st/cw1200/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/st/cw1200/main.c +2 -0
@@ -385,6 +385,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr, CW1200_LINK_ID_MAX, cw1200_skb_dtor, priv)) { +destroy_workqueue (priv->workqueue);ieee80211_free_hw (hw);return NULL ; }
@@ -396,6 +397,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr,for (; i >0 ; i--)cw1200_queue_deinit (&priv->tx_queue[i -1 ]);cw1200_queue_stats_deinit (&priv->tx_queue_stats); +destroy_workqueue (priv->workqueue);ieee80211_free_hw (hw);return NULL ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 112/242 media: siano: fix memory leak of debugfs members in smsdvb_hotplug
In reply to Greg Kroah-HartmanFrom: Keita Suzuki <[email protected]>
[ Upstream commit abf287eeff4c6da6aa804bbd429dfd9d0dfb6ea7 ]
When dvb_create_media_graph fails, the debugfs kept inside client should be released. However, the current implementation does not release them.
Fix this by adding a new goto label to call smsdvb_debugfs_release.
--- drivers/media/common/siano/smsdvb-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/media/common/siano/smsdvb-main.c +4 -1
@@ -1180,12 +1180,15 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc =dvb_create_media_graph (&client->adapter, true);if (rc <0 ) {pr_err ("dvb_create_media_graph failed %d\n" , rc); - goto client_error; + goto media_graph_error; }pr_info ("DVB interface registered.\n" );return 0 ; +media_graph_error: +smsdvb_debugfs_release (client); + client_error:dvb_unregister_frontend (&client->frontend);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 113/242 samples: bpf: Fix lwt_len_hist reusing previous BPF map
In reply to Greg Kroah-HartmanFrom: Daniel T. Lee <[email protected]>
[ Upstream commit 0afe0a998c40085a6342e1aeb4c510cccba46caf ]
Currently, lwt_len_hist's map lwt_len_hist_map is uses pinning, and the map isn't cleared on test end. This leds to reuse of that map for each test, which prevents the results of the test from being accurate.
This commit fixes the problem by removing of pinned map from bpffs. Also, this commit add the executable permission to shell script files.
--- samples/bpf/lwt_len_hist.sh | 2 ++ samples/bpf/test_lwt_bpf.sh | 0 2 files changed, 2 insertions(+) mode change 100644 => 100755 samples/bpf/lwt_len_hist.sh mode change 100644 => 100755 samples/bpf/test_lwt_bpf.sh
samples/bpf/lwt_len_hist.sh +2 -0
@@ -8,6 +8,8 @@ VETH1=tst_lwt1b TRACE_ROOT=/sys/kernel/debug/tracing function cleanup { + # To reset saved histogram, remove pinned map + rm /sys/fs/bpf/tc/globals/lwt_len_hist_map ip route del 192.168.253.2/32 dev $VETH0 2> /dev/null ip link del $VETH0 2> /dev/null ip link del $VETH1 2> /dev/null
samples/bpf/test_lwt_bpf.sh +0 -0
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 114/242 mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit f0e82242b16826077a2775eacfe201d803bb7a22 ]
kfree(dev) has been called inside put_device so anther kfree would cause a use-after-free bug/
--- drivers/bus/mips_cdmm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/bus/mips_cdmm.c +1 -3
@@ -544,10 +544,8 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus)dev_set_name (&dev->dev,"cdmm%u-%u" , cpu, id); ++id; ret =device_register (&dev->dev); -if (ret) { +if (ret)put_device (&dev->dev); -kfree (dev); - } } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 115/242 media: max2175: fix max2175_set_csm_mode() error code
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 9b1b0cb0636166187478ef68d5b95f5caea062ec ]
This is supposed to return negative error codes but the type is bool so it returns true instead.
--- drivers/media/i2c/max2175.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/max2175.c +1 -1
@@ -511,7 +511,7 @@ static void max2175_set_bbfilter(struct max2175 *ctx) } } -static bool max2175_set_csm_mode (struct max2175 *ctx, +static int max2175_set_csm_mode (struct max2175 *ctx,enum max2175_csm_mode new_mode) {int ret =max2175_poll_csm_ready (ctx);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 116/242 HSI: omap_ssi: Dont jump to free ID in ssi_add_controller()
In reply to Greg Kroah-HartmanFrom: Jing Xiangfeng <[email protected]>
[ Upstream commit 41fff6e19bc8d6d8bca79ea388427c426e72e097 ]
In current code, it jumps to ida_simple_remove() when ida_simple_get() failes to allocate an ID. Just return to fix it.
--- drivers/hsi/controllers/omap_ssi_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +1 -1
@@ -389,7 +389,7 @@ static int ssi_add_controller(struct hsi_controller *ssi, err =ida_simple_get (&platform_omap_ssi_ida,0 ,0 ,GFP_KERNEL );if (err <0 ) - goto out_err; +return err; ssi->id = err; ssi->owner =THIS_MODULE ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 117/242 ARM: dts: Remove non-existent i2c1 from 98dx3236
In reply to Greg Kroah-HartmanFrom: Chris Packham <[email protected]>
[ Upstream commit 7f24479ead579459106bb55c2320a000135731f9 ]
The switches with integrated CPUs have only got a single i2c controller. They incorrectly gained one when they were split from the Armada-XP.
--- arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 5 ----- 1 file changed, 5 deletions(-)
arch/arm/boot/dts/armada-xp-98dx3236.dtsi +0 -5
@@ -303,11 +303,6 @@ reg = <0x11000 0x100>; }; -&i2c1 { - compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; - reg = <0x11100 0x100>; -}; - &mpic { reg = <0x20a00 0x2d0>, <0x21070 0x58>; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 118/242 power: supply: bq24190_charger: fix reference leak
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit b2f6cb78eaa1cad57dd3fe11d0458cd4fae9a584 ]
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to call pm_runtime_put_noidle will result in reference leak in callers(bq24190_sysfs_show, bq24190_charger_get_property, bq24190_charger_set_property, bq24190_battery_get_property, bq24190_battery_set_property), so we should fix it.
--- drivers/power/supply/bq24190_charger.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/power/supply/bq24190_charger.c +15 -5
@@ -450,8 +450,10 @@ static ssize_t bq24190_sysfs_show(struct device *dev,return -EINVAL ; ret =pm_runtime_get_sync (bdi->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (bdi->dev);return ret; + } ret =bq24190_read_mask (bdi, info->reg, info->mask, info->shift, &v);if (ret)
@@ -1086,8 +1088,10 @@ static int bq24190_charger_get_property(struct power_supply *psy,dev_dbg (bdi->dev,"prop: %d\n" , psp); ret =pm_runtime_get_sync (bdi->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (bdi->dev);return ret; + }switch (psp) {case POWER_SUPPLY_PROP_CHARGE_TYPE :
@@ -1158,8 +1162,10 @@ static int bq24190_charger_set_property(struct power_supply *psy,dev_dbg (bdi->dev,"prop: %d\n" , psp); ret =pm_runtime_get_sync (bdi->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (bdi->dev);return ret; + }switch (psp) {case POWER_SUPPLY_PROP_ONLINE :
@@ -1424,8 +1430,10 @@ static int bq24190_battery_get_property(struct power_supply *psy,dev_dbg (bdi->dev,"prop: %d\n" , psp); ret =pm_runtime_get_sync (bdi->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (bdi->dev);return ret; + }switch (psp) {case POWER_SUPPLY_PROP_STATUS :
@@ -1470,8 +1478,10 @@ static int bq24190_battery_set_property(struct power_supply *psy,dev_dbg (bdi->dev,"prop: %d\n" , psp); ret =pm_runtime_get_sync (bdi->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (bdi->dev);return ret; + }switch (psp) {case POWER_SUPPLY_PROP_ONLINE :
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 119/242 genirq/irqdomain: Dont try to free an interrupt that has no mapping
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
[ Upstream commit 4615fbc3788ddc8e7c6d697714ad35a53729aa2c ]
When an interrupt allocation fails for N interrupts, it is pretty common for the error handling code to free the same number of interrupts, no matter how many interrupts have actually been allocated.
This may result in the domain freeing code to be unexpectedly called for interrupts that have no mapping in that domain. Things end pretty badly.
Instead, add some checks to irq_domain_free_irqs_hierarchy() to make sure that thiss does not follow the hierarchy if no mapping exists for a given interrupt.
--- kernel/irq/irqdomain.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
kernel/irq/irqdomain.c +9 -2
@@ -1364,8 +1364,15 @@ static void irq_domain_free_irqs_hierarchy(struct irq_domain *domain, unsigned int irq_base, unsigned int nr_irqs) { - if (domain->ops->free) - domain->ops->free(domain, irq_base, nr_irqs); +unsigned int i; + +if (!domain->ops->free) +return ; + +for (i =0 ; i < nr_irqs; i++) { +if (irq_domain_get_irq_data (domain, irq_base + i)) + domain->ops->free (domain, irq_base + i,1 ); + } } int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 120/242 PCI: iproc: Fix out-of-bound array accesses
In reply to Greg Kroah-HartmanFrom: Bharat Gooty <[email protected]>
[ Upstream commit a3ff529f5d368a17ff35ada8009e101162ebeaf9 ]
Declare the full size array for all revisions of PAX register sets to avoid potentially out of bound access of the register array when they are being initialized in iproc_pcie_rev_init().
--- drivers/pci/host/pcie-iproc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/pci/host/pcie-iproc.c +5 -5
@@ -306,7 +306,7 @@ enum iproc_pcie_reg { };/* iProc PCIe PAXB BCMA registers */ -static const u16 iproc_pcie_reg_paxb_bcma[] = { +static const u16 iproc_pcie_reg_paxb_bcma[IPROC_PCIE_MAX_NUM_REG ] = { [IPROC_PCIE_CLK_CTRL ] =0x000 , [IPROC_PCIE_CFG_IND_ADDR ] =0x120 , [IPROC_PCIE_CFG_IND_DATA ] =0x124 ,
@@ -317,7 +317,7 @@ static const u16 iproc_pcie_reg_paxb_bcma[] = { };/* iProc PCIe PAXB registers */ -static const u16 iproc_pcie_reg_paxb[] = { +static const u16 iproc_pcie_reg_paxb[IPROC_PCIE_MAX_NUM_REG ] = { [IPROC_PCIE_CLK_CTRL ] =0x000 , [IPROC_PCIE_CFG_IND_ADDR ] =0x120 , [IPROC_PCIE_CFG_IND_DATA ] =0x124 ,
@@ -333,7 +333,7 @@ static const u16 iproc_pcie_reg_paxb[] = { };/* iProc PCIe PAXB v2 registers */ -static const u16 iproc_pcie_reg_paxb_v2[] = { +static const u16 iproc_pcie_reg_paxb_v2[IPROC_PCIE_MAX_NUM_REG ] = { [IPROC_PCIE_CLK_CTRL ] =0x000 , [IPROC_PCIE_CFG_IND_ADDR ] =0x120 , [IPROC_PCIE_CFG_IND_DATA ] =0x124 ,
@@ -361,7 +361,7 @@ static const u16 iproc_pcie_reg_paxb_v2[] = { };/* iProc PCIe PAXC v1 registers */ -static const u16 iproc_pcie_reg_paxc[] = { +static const u16 iproc_pcie_reg_paxc[IPROC_PCIE_MAX_NUM_REG ] = { [IPROC_PCIE_CLK_CTRL ] =0x000 , [IPROC_PCIE_CFG_IND_ADDR ] =0x1f0 , [IPROC_PCIE_CFG_IND_DATA ] =0x1f4 ,
@@ -370,7 +370,7 @@ static const u16 iproc_pcie_reg_paxc[] = { };/* iProc PCIe PAXC v2 registers */ -static const u16 iproc_pcie_reg_paxc_v2[] = { +static const u16 iproc_pcie_reg_paxc_v2[IPROC_PCIE_MAX_NUM_REG ] = { [IPROC_PCIE_MSI_GIC_MODE ] =0x050 , [IPROC_PCIE_MSI_BASE_ADDR ] =0x074 , [IPROC_PCIE_MSI_WINDOW_SIZE ] =0x078 ,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 121/242 ARM: dts: at91: at91sam9rl: fix ADC triggers
In reply to Greg Kroah-HartmanFrom: Alexandre Belloni <[email protected]>
[ Upstream commit 851a95da583c26e2ddeb7281e9b61f0d76ea5aba ]
The triggers for the ADC were taken from at91sam9260 dtsi but are not correct.
--- arch/arm/boot/dts/at91sam9rl.dtsi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
arch/arm/boot/dts/at91sam9rl.dtsi +11 -8
@@ -274,23 +274,26 @@ atmel,adc-use-res = "highres"; trigger0 { - trigger-name = "timer-counter-0"; + trigger-name = "external-rising"; trigger-value = <0x1>; + trigger-external; }; + trigger1 { - trigger-name = "timer-counter-1"; - trigger-value = <0x3>; + trigger-name = "external-falling"; + trigger-value = <0x2>; + trigger-external; }; trigger2 { - trigger-name = "timer-counter-2"; - trigger-value = <0x5>; + trigger-name = "external-any"; + trigger-value = <0x3>; + trigger-external; }; trigger3 { - trigger-name = "external"; - trigger-value = <0x13>; - trigger-external; + trigger-name = "continuous"; + trigger-value = <0x6>; }; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 122/242 ath10k: Fix an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit ed3573bc3943c27d2d8e405a242f87ed14572ca1 ]
If 'ath10k_usb_create()' fails, we should release some resources and report an error instead of silently continuing.
--- drivers/net/wireless/ath/ath10k/usb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/usb.c +2 -0
@@ -1019,6 +1019,8 @@ static int ath10k_usb_probe(struct usb_interface *interface, ar_usb =ath10k_usb_priv (ar); ret =ath10k_usb_create (ar, interface); +if (ret) + goto err; ar_usb->ar = ar; ar->dev_id = product_id;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 123/242 ath10k: Release some resources in an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 6364e693f4a7a89a2fb3dd2cbd6cc06d5fd6e26d ]
Should an error occur after calling 'ath10k_usb_create()', it should be undone by a corresponding 'ath10k_usb_destroy()' call
--- drivers/net/wireless/ath/ath10k/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/usb.c +4 -1
@@ -1032,7 +1032,7 @@ static int ath10k_usb_probe(struct usb_interface *interface, ret =ath10k_core_register (ar, chip_id);if (ret) {ath10k_warn (ar,"failed to register driver core: %d\n" , ret); - goto err; + goto err_usb_destroy; }/* TODO: remove this once USB support is fully implemented */
@@ -1040,6 +1040,9 @@ static int ath10k_usb_probe(struct usb_interface *interface,return 0 ; +err_usb_destroy: +ath10k_usb_destroy (ar); + err:ath10k_core_destroy (ar);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 124/242 NFSv4.2: condition READDIRs mask for security label based on LSM state
In reply to Greg Kroah-HartmanFrom: Olga Kornievskaia <[email protected]>
[ Upstream commit 05ad917561fca39a03338cb21fe9622f998b0f9c ]
Currently, the client will always ask for security_labels if the server returns that it supports that feature regardless of any LSM modules (such as Selinux) enforcing security policy. This adds performance penalty to the READDIR operation.
Client adjusts superblock's support of the security_label based on the server's support but also current client's configuration of the LSM modules. Thus, prior to using the default bitmask in READDIR, this patch checks the server's capabilities and then instructs READDIR to remove FATTR4_WORD2_SECURITY_LABEL from the bitmask.
v5: fixing silly mistakes of the rushed v4
v4: simplifying logic
v3: changing label's initialization per Ondrej's comment
v2: dropping selinux hook and using the sb cap.
--- fs/nfs/nfs4proc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +8 -2
@@ -4445,12 +4445,12 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, u64 cookie, struct page **pages, unsigned int count, bool plus) { struct inode *dir = d_inode(dentry); +struct nfs_server *server =NFS_SERVER (dir);struct nfs4_readdir_arg args = { .fh =NFS_FH (dir), .pages = pages, .pgbase =0 , .count = count, - .bitmask =NFS_SERVER (d_inode (dentry))->attr_bitmask, .plus = plus, };struct nfs4_readdir_res res;
@@ -4465,9 +4465,15 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,dprintk ("%s: dentry = %pd2, cookie = %Lu\n" , __func__, dentry, (unsigned long long )cookie); +if (!(server->caps &NFS_CAP_SECURITY_LABEL )) + args.bitmask = server->attr_bitmask_nl; +else + args.bitmask = server->attr_bitmask; +nfs4_setup_readdir (cookie,NFS_I (dir)->cookieverf, dentry, &args); res.pgbase = args.pgbase; - status =nfs4_call_sync (NFS_SERVER (dir)->client,NFS_SERVER (dir), &msg, &args.seq_args, &res.seq_res,0 ); + status =nfs4_call_sync (server->client, server, &msg, &args.seq_args, + &res.seq_res,0 );if (status >=0 ) {memcpy (NFS_I (dir)->cookieverf, res.verifier.data,NFS4_VERIFIER_SIZE ); status += args.pgbase;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 125/242 SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit d5aa6b22e2258f05317313ecc02efbb988ed6d38 ]
According to RFC5666, the correct netid for an IPv6 addressed RDMA transport is "rdma6", which we've supported as a mount option since Linux-4.7. The problem is when we try to load the module "xprtrdma6", that will fail, since there is no modulealias of that name.
--- include/linux/sunrpc/xprt.h | 1 + net/sunrpc/xprt.c | 65 +++++++++++++++++++++++++-------- net/sunrpc/xprtrdma/module.c | 1 + net/sunrpc/xprtrdma/transport.c | 1 + net/sunrpc/xprtsock.c | 4 ++ 5 files changed, 56 insertions(+), 16 deletions(-)
include/linux/sunrpc/xprt.h +1 -0
@@ -316,6 +316,7 @@ struct xprt_class {struct rpc_xprt * (*setup)(struct xprt_create *);struct module *owner;char name[32 ]; +const char * netid[]; };/*
net/sunrpc/xprt.c +49 -16
80 lines not on this page · raw message
net/sunrpc/xprtrdma/module.c +1 -0
@@ -19,6 +19,7 @@ MODULE_DESCRIPTION("RPC/RDMA Transport");MODULE_LICENSE ("Dual BSD/GPL" );MODULE_ALIAS ("svcrdma" );MODULE_ALIAS ("xprtrdma" ); +MODULE_ALIAS ("rpcrdma6" ); static void __exit rpc_rdma_cleanup(void) {
net/sunrpc/xprtrdma/transport.c +1 -0
@@ -849,6 +849,7 @@ static struct xprt_class xprt_rdma = { .owner = THIS_MODULE, .ident = XPRT_TRANSPORT_RDMA, .setup = xprt_setup_rdma, + .netid = { "rdma", "rdma6", "" }, }; void xprt_rdma_cleanup(void)
net/sunrpc/xprtsock.c +4 -0
@@ -3208,6 +3208,7 @@ static struct xprt_class xs_local_transport = { .owner = THIS_MODULE, .ident = XPRT_TRANSPORT_LOCAL, .setup = xs_setup_local, + .netid = { "" }, }; static struct xprt_class xs_udp_transport = {
@@ -3216,6 +3217,7 @@ static struct xprt_class xs_udp_transport = { .owner = THIS_MODULE, .ident = XPRT_TRANSPORT_UDP, .setup = xs_setup_udp, + .netid = { "udp", "udp6", "" }, }; static struct xprt_class xs_tcp_transport = {
@@ -3224,6 +3226,7 @@ static struct xprt_class xs_tcp_transport = { .owner = THIS_MODULE, .ident = XPRT_TRANSPORT_TCP, .setup = xs_setup_tcp, + .netid = { "tcp", "tcp6", "" }, }; static struct xprt_class xs_bc_tcp_transport = {
@@ -3232,6 +3235,7 @@ static struct xprt_class xs_bc_tcp_transport = { .owner = THIS_MODULE, .ident = XPRT_TRANSPORT_BC_TCP, .setup = xs_setup_bc_tcp, + .netid = { "" }, }; /**
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 126/242 lockd: dont use interval-based rebinding over TCP
In reply to Greg Kroah-HartmanFrom: Calum Mackay <[email protected]>
[ Upstream commit 9b82d88d5976e5f2b8015d58913654856576ace5 ]
NLM uses an interval-based rebinding, i.e. it clears the transport's binding under certain conditions if more than 60 seconds have elapsed since the connection was last bound.
This rebinding is not necessary for an autobind RPC client over a connection-oriented protocol like TCP.
It can also cause problems: it is possible for nlm_bind_host() to clear XPRT_BOUND whilst a connection worker is in the middle of trying to reconnect, after it had already been checked in xprt_connect().
When the connection worker notices that XPRT_BOUND has been cleared under it, in xs_tcp_finish_connecting(), that results in:
xs_tcp_setup_socket: connect returned unhandled error -107
Worse, it's possible that the two can get into lockstep, resulting in the same behaviour repeated indefinitely, with the above error every 300 seconds, without ever recovering, and the connection never being established. This has been seen in practice, with a large number of NLM client tasks, following a server restart.
The existing callers of nlm_bind_host & nlm_rebind_host should not need to force the rebind, for TCP, so restrict the interval-based rebinding to UDP only.
For TCP, we will still rebind when needed, e.g. on timeout, and connection error (including closure), since connection-related errors on an existing connection, ECONNREFUSED when trying to connect, and rpc_check_timeout(), already unconditionally clear XPRT_BOUND.
To avoid having to add the fix, and explanation, to both nlm_bind_host() and nlm_rebind_host(), remove the duplicate code from the former, and have it call the latter.
Drop the dprintk, which adds no value over a trace.
--- fs/lockd/host.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
fs/lockd/host.c +11 -9
@@ -431,12 +431,7 @@ nlm_bind_host(struct nlm_host *host)* RPC rebind is required */ if ((clnt = host->h_rpcclnt) !=NULL ) { -if (time_after_eq (jiffies, host->h_nextrebind)) { -rpc_force_rebind (clnt); - host->h_nextrebind = jiffies +NLM_HOST_REBIND ; -dprintk ("lockd: next rebind in %lu jiffies\n" , - host->h_nextrebind - jiffies); - } +nlm_rebind_host (host); }else {unsigned long increment = nlmsvc_timeout;struct rpc_timeout timeparms = {
@@ -484,13 +479,20 @@ nlm_bind_host(struct nlm_host *host)return clnt; } -/* -* Force a portmap lookup of the remote lockd port +/** +* nlm_rebind_host - If needed, force a portmap lookup of the peer's lockd port +* @host: NLM host handle for peer +* +* This is not needed when using a connection-oriented protocol, such as TCP. +* The existing autobind mechanism is sufficient to force a rebind when +* required, e.g. on connection state transitions. */ void nlm_rebind_host (struct nlm_host *host) { -dprintk ("lockd: rebind host %s\n" , host->h_name); +if (host->h_proto !=IPPROTO_UDP ) +return ; +if (host->h_rpcclnt &&time_after_eq (jiffies, host->h_nextrebind)) {rpc_force_rebind (host->h_rpcclnt); host->h_nextrebind = jiffies +NLM_HOST_REBIND ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 127/242 NFS: switch nfsiod to be an UNBOUND workqueue.
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit bf701b765eaa82dd164d65edc5747ec7288bb5c3 ]
nfsiod is currently a concurrency-managed workqueue (CMWQ). This means that workitems scheduled to nfsiod on a given CPU are queued behind all other work items queued on any CMWQ on the same CPU. This can introduce unexpected latency.
Occaionally nfsiod can even cause excessive latency. If the work item to complete a CLOSE request calls the final iput() on an inode, the address_space of that inode will be dismantled. This takes time proportional to the number of in-memory pages, which on a large host working on large files (e.g.. 5TB), can be a large number of pages resulting in a noticable number of seconds.
We can avoid these latency problems by switching nfsiod to WQ_UNBOUND. This causes each concurrent work item to gets a dedicated thread which can be scheduled to an idle CPU.
There is precedent for this as several other filesystems use WQ_UNBOUND workqueue for handling various async events.
--- fs/nfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/inode.c +1 -1
@@ -2053,7 +2053,7 @@ static int nfsiod_start(void) {struct workqueue_struct *wq;dprintk ("RPC: creating workqueue nfsiod\n" ); - wq =alloc_workqueue ("nfsiod" ,WQ_MEM_RECLAIM ,0 ); + wq =alloc_workqueue ("nfsiod" ,WQ_MEM_RECLAIM |WQ_UNBOUND ,0 );if (wq ==NULL )return -ENOMEM ; nfsiod_workqueue = wq;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 128/242 vfio-pci: Use io_remap_pfn_range() for PCI IO memory
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
[ Upstream commit 7b06a56d468b756ad6bb43ac21b11e474ebc54a0 ]
commit f8f6ae5d077a ("mm: always have io_remap_pfn_range() set pgprot_decrypted()") allows drivers using mmap to put PCI memory mapped BAR space into userspace to work correctly on AMD SME systems that default to all memory encrypted.
Since vfio_pci_mmap_fault() is working with PCI memory mapped BAR space it should be calling io_remap_pfn_range() otherwise it will not work on SME systems.
--- drivers/vfio/pci/vfio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci.c +2 -2
@@ -1380,8 +1380,8 @@ static int vfio_pci_mmap_fault(struct vm_fault *vmf)mutex_unlock (&vdev->vma_lock); -if (remap_pfn_range (vma, vma->vm_start, vma->vm_pgoff, - vma->vm_end - vma->vm_start, vma->vm_page_prot)) +if (io_remap_pfn_range (vma, vma->vm_start, vma->vm_pgoff, + vma->vm_end - vma->vm_start, vma->vm_page_prot)) ret =VM_FAULT_SIGBUS ; up_out:
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 129/242 media: saa7146: fix array overflow in vidioc_s_audio()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 8e4d86e241cf035d6d3467cd346e7ce490681937 ]
The "a->index" value comes from the user via the ioctl. The problem is that the shift can wrap resulting in setting "mxb->cur_audinput" to an invalid value, which later results in an array overflow.
--- drivers/media/pci/saa7146/mxb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/media/pci/saa7146/mxb.c +10 -9
@@ -652,16 +652,17 @@ static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *struct mxb *mxb = (struct mxb *)dev->ext_priv;DEB_D ("VIDIOC_S_AUDIO %d\n" , a->index); -if (mxb_inputs[mxb->cur_input].audioset & (1 << a->index)) { -if (mxb->cur_audinput != a->index) { - mxb->cur_audinput = a->index; -tea6420_route (mxb, a->index); -if (mxb->cur_audinput ==0 ) -mxb_update_audmode (mxb); - } -return 0 ; +if (a->index >=32 || + !(mxb_inputs[mxb->cur_input].audioset & (1 << a->index))) +return -EINVAL ; + +if (mxb->cur_audinput != a->index) { + mxb->cur_audinput = a->index; +tea6420_route (mxb, a->index); +if (mxb->cur_audinput ==0 ) +mxb_update_audmode (mxb); } -return -EINVAL ; +return 0 ; }#ifdef CONFIG_VIDEO_ADV_DEBUG
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 130/242 clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit eee422c46e6840a81c9db18a497b74387a557b29 ]
If clk_notifier_register() failed, ttc_setup_clockevent() will return without freeing 'ttcce', which will leak memory.
--- drivers/clocksource/cadence_ttc_timer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/clocksource/cadence_ttc_timer.c +9 -9
@@ -419,10 +419,8 @@ static int __init ttc_setup_clockevent(struct clk *clk, ttcce->ttc.clk = clk; err =clk_prepare_enable (ttcce->ttc.clk); -if (err) { -kfree (ttcce); -return err; - } +if (err) + goto out_kfree; ttcce->ttc.clk_rate_change_nb.notifier_call = ttc_rate_change_clockevent_cb;
@@ -432,7 +430,7 @@ static int __init ttc_setup_clockevent(struct clk *clk, &ttcce->ttc.clk_rate_change_nb);if (err) {pr_warn ("Unable to register clock notifier.\n" ); -return err; + goto out_kfree; } ttcce->ttc.freq =clk_get_rate (ttcce->ttc.clk);
@@ -461,15 +459,17 @@ static int __init ttc_setup_clockevent(struct clk *clk, err =request_irq (irq, ttc_clock_event_interrupt,IRQF_TIMER , ttcce->ce.name, ttcce); -if (err) { -kfree (ttcce); -return err; - } +if (err) + goto out_kfree;clockevents_config_and_register (&ttcce->ce, ttcce->ttc.freq /PRESCALE ,1 ,0xfffe );return 0 ; + +out_kfree: +kfree (ttcce); +return err; }/**
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 131/242 ARM: dts: at91: sama5d2: map securam as device
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 9b5dcc8d427e2bcb84c49eb03ffefe11e7537a55 ]
Due to strobe signal not being propagated from CPU to securam the securam needs to be mapped as device or strongly ordered memory to work properly. Otherwise, updating to one offset may affect the adjacent locations in securam.
--- arch/arm/boot/dts/sama5d2.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/sama5d2.dtsi +1 -0
@@ -1243,6 +1243,7 @@ clocks = <&securam_clk>; #address-cells = <1>; #size-cells = <1>; + no-memory-wc; ranges = <0 0xf8044000 0x1420>; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 132/242 pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 89cce2b3f247a434ee174ab6803698041df98014 ]
if of_find_device_by_node() succeed, pinctrl_falcon_probe() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation.
--- drivers/pinctrl/pinctrl-falcon.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-falcon.c +9 -5
@@ -438,24 +438,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev)/* load and remap the pad resources of the different banks */ for_each_compatible_node (np,NULL ,"lantiq,pad-falcon" ) { -struct platform_device *ppdev =of_find_device_by_node (np);const __be32 *bank =of_get_property (np,"lantiq,bank" ,NULL );struct resource res; +struct platform_device *ppdev;u32 avail;int pins;if (!of_device_is_available (np))continue ; -if (!ppdev) { -dev_err (&pdev->dev,"failed to find pad pdev\n" ); -continue ; - }if (!bank || *bank >=PORTS )continue ;if (of_address_to_resource (np,0 , &res))continue ; + + ppdev =of_find_device_by_node (np); +if (!ppdev) { +dev_err (&pdev->dev,"failed to find pad pdev\n" ); +continue ; + } + falcon_info.clk[*bank] =clk_get (&ppdev->dev,NULL ); +put_device (&ppdev->dev);if (IS_ERR (falcon_info.clk[*bank])) {dev_err (&ppdev->dev,"failed to get clock\n" );return PTR_ERR (falcon_info.clk[*bank]);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 133/242 arm64: dts: rockchip: Fix UART pull-ups on rk3328
In reply to Greg Kroah-HartmanFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 94dad6bed3c86c00050bf7c2b2ad6b630facae31 ]
For UARTs, the local pull-ups should be on the RX pin, not the TX pin. UARTs transmit active-low, so a disconnected RX pin should be pulled high instead of left floating to prevent noise being interpreted as transmissions.
This gets rid of bogus sysrq events when the UART console is not connected.
--- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +8 -8
@@ -1062,8 +1062,8 @@ uart0 { uart0_xfer: uart0-xfer { - rockchip,pins = <1 RK_PB1 1 &pcfg_pull_up>, - <1 RK_PB0 1 &pcfg_pull_none>; + rockchip,pins = <1 RK_PB1 1 &pcfg_pull_none>, + <1 RK_PB0 1 &pcfg_pull_up>; }; uart0_cts: uart0-cts {
@@ -1081,8 +1081,8 @@ uart1 { uart1_xfer: uart1-xfer { - rockchip,pins = <3 RK_PA4 4 &pcfg_pull_up>, - <3 RK_PA6 4 &pcfg_pull_none>; + rockchip,pins = <3 RK_PA4 4 &pcfg_pull_none>, + <3 RK_PA6 4 &pcfg_pull_up>; }; uart1_cts: uart1-cts {
@@ -1100,15 +1100,15 @@ uart2-0 { uart2m0_xfer: uart2m0-xfer { - rockchip,pins = <1 RK_PA0 2 &pcfg_pull_up>, - <1 RK_PA1 2 &pcfg_pull_none>; + rockchip,pins = <1 RK_PA0 2 &pcfg_pull_none>, + <1 RK_PA1 2 &pcfg_pull_up>; }; }; uart2-1 { uart2m1_xfer: uart2m1-xfer { - rockchip,pins = <2 RK_PA0 1 &pcfg_pull_up>, - <2 RK_PA1 1 &pcfg_pull_none>; + rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>, + <2 RK_PA1 1 &pcfg_pull_up>; }; };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 134/242 memstick: r592: Fix error return in r592_probe()
In reply to Greg Kroah-HartmanFrom: Jing Xiangfeng <[email protected]>
[ Upstream commit db29d3d1c2451e673e29c7257471e3ce9d50383a ]
Fix to return a error code from the error handling case instead of 0.
--- drivers/memstick/host/r592.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/memstick/host/r592.c +8 -4
@@ -762,8 +762,10 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto error3; dev->mmio =pci_ioremap_bar (pdev,0 ); -if (!dev->mmio) +if (!dev->mmio) { + error = -ENOMEM ; goto error4; + } dev->irq = pdev->irq;spin_lock_init (&dev->irq_lock);
@@ -790,12 +792,14 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) &dev->dummy_dma_page_physical_address, GFP_KERNEL);r592_stop_dma (dev ,0 ); -if (request_irq (dev->irq, &r592_irq,IRQF_SHARED , -DRV_NAME , dev)) + error =request_irq (dev->irq, &r592_irq,IRQF_SHARED , +DRV_NAME , dev); +if (error) goto error6;r592_update_card_detect (dev); -if (memstick_add_host (host)) + error =memstick_add_host (host); +if (error) goto error7;message ("driver successfully loaded" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 135/242 net/mlx5: Properly convey driver version to firmware
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 907af0f0cab4ee5d5604f182ecec2c5b5119d294 ]
mlx5 firmware expects driver version in specific format X.X.X, so make it always correct and based on real kernel version aligned with the driver.
--- drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +5 -1
@@ -51,6 +51,7 @@#ifdef CONFIG_RFS_ACCEL #include <linux/cpu_rmap.h> #endif +#include <linux/version.h> #include <net/devlink.h> #include "mlx5_core.h" #include "fs_core.h"
@@ -204,7 +205,10 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev)strncat (string,"," , remaining_size); remaining_size =max_t (int,0 , driver_ver_sz -strlen (string)); -strncat (string,DRIVER_VERSION , remaining_size); + +snprintf (string +strlen (string), remaining_size,"%u.%u.%u" , + (u8)((LINUX_VERSION_CODE >>16 ) &0xff ), (u8)((LINUX_VERSION_CODE >>8 ) &0xff ), + (u16)(LINUX_VERSION_CODE &0xffff ));/*Send the command*/ MLX5_SET(set_driver_version_in, in, opcode,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 136/242 ASoC: jz4740-i2s: add missed checks for clk_get()
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
[ Upstream commit 1c1fb2653a0c2e3f310c07eacd8fc3a10e08c97a ]
jz4740_i2s_set_sysclk() does not check the return values of clk_get(), while the file dereferences the pointers in clk_put().
Add the missed checks to fix it.
--- sound/soc/jz4740/jz4740-i2s.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/jz4740/jz4740-i2s.c +4 -0
@@ -318,10 +318,14 @@ static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,switch (clk_id) {case JZ4740_I2S_CLKSRC_EXT : parent =clk_get (NULL ,"ext" ); +if (IS_ERR (parent)) +return PTR_ERR (parent);clk_set_parent (i2s->clk_i2s, parent);break ;case JZ4740_I2S_CLKSRC_PLL : parent =clk_get (NULL ,"pll half" ); +if (IS_ERR (parent)) +return PTR_ERR (parent);clk_set_parent (i2s->clk_i2s, parent); ret =clk_set_rate (i2s->clk_i2s, freq);break ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 137/242 dm ioctl: fix error return code in target_message
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit 4d7659bfbe277a43399a4a2d90fca141e70f29e1 ]
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/md/dm-ioctl.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm-ioctl.c +1 -0
@@ -1574,6 +1574,7 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t paraif (!argc) {DMWARN ("Empty message received." ); + r = -EINVAL ; goto out_argv; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 138/242 clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
In reply to Greg Kroah-HartmanFrom: Keqian Zhu <[email protected]>
[ Upstream commit 8b7770b877d187bfdae1eaf587bd2b792479a31c ]
ARM virtual counter supports event stream, it can only trigger an event when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, so the actual period of event stream is 2^(cntkctl_evnti + 1). For example, when the trigger bit is 0, then virtual counter trigger an event for every two cycles.
While we're at it, rework the way we compute the trigger bit position by making it more obvious that when bits [n:n-1] are both set (with n being the most significant bit), we pick bit (n + 1).
--- drivers/clocksource/arm_arch_timer.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/clocksource/arm_arch_timer.c +16 -7
@@ -744,15 +744,24 @@ static void arch_timer_evtstrm_enable(int divider)static void arch_timer_configure_evtstream (void ) { -int evt_stream_div, pos; +int evt_stream_div, lsb; + +/* +* As the event stream can at most be generated at half the frequency +* of the counter, use half the frequency when computing the divider. +*/ + evt_stream_div = arch_timer_rate /ARCH_TIMER_EVT_STREAM_FREQ /2 ; + +/* +* Find the closest power of two to the divisor. If the adjacent bit +* of lsb (last set bit, starts from 0) is set, then we use (lsb + 1). +*/ + lsb =fls (evt_stream_div) -1 ; +if (lsb >0 && (evt_stream_div &BIT (lsb -1 ))) + lsb++; -/* Find the closest power of two to the divisor */ - evt_stream_div = arch_timer_rate /ARCH_TIMER_EVT_STREAM_FREQ ; - pos =fls (evt_stream_div); -if (pos >1 && !(evt_stream_div & (1 << (pos -2 )))) - pos--;/* enable event stream */ -arch_timer_evtstrm_enable (min (pos,15 )); +arch_timer_evtstrm_enable (max (0 ,min (lsb,15 ))); }static void arch_counter_set_user_access (void )
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 139/242 cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 9433777a6e0aae27468d3434b75cd51bb88ff711 ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/highbank-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/cpufreq/highbank-cpufreq.c +7 -0
@@ -104,6 +104,13 @@ out_put_node: }module_init (hb_cpufreq_driver_init); +static const struct of_device_id __maybe_unused hb_cpufreq_of_match[] = { + { .compatible ="calxeda,highbank" }, + { .compatible ="calxeda,ecx-2000" }, + { }, +}; +MODULE_DEVICE_TABLE (of, hb_cpufreq_of_match); +MODULE_AUTHOR ("Mark Langsdorf <[email protected]>" );MODULE_DESCRIPTION ("Calxeda Highbank cpufreq driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 140/242 cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit af6eca06501118af3e2ad46eee8edab20624b74e ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/mediatek-cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/mediatek-cpufreq.c +1 -0
@@ -582,6 +582,7 @@ static const struct of_device_id mtk_cpufreq_machines[] __initconst = { { } }; +MODULE_DEVICE_TABLE (of, mtk_cpufreq_machines);static int __init mtk_cpufreq_driver_init (void ) {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 141/242 cpufreq: st: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 183747ab52654eb406fc6b5bfb40806b75d31811 ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/sti-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/cpufreq/sti-cpufreq.c +7 -0
@@ -295,6 +295,13 @@ register_cpufreq_dt: }module_init (sti_cpufreq_init); +static const struct of_device_id __maybe_unused sti_cpufreq_of_match[] = { + { .compatible ="st,stih407" }, + { .compatible ="st,stih410" }, + { }, +}; +MODULE_DEVICE_TABLE (of, sti_cpufreq_of_match); +MODULE_DESCRIPTION ("STMicroelectronics CPUFreq/OPP driver" );MODULE_AUTHOR ("Ajitpal Singh <[email protected]>" );MODULE_AUTHOR ("Lee Jones <[email protected]>" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 142/242 cpufreq: loongson1: Add missing MODULE_ALIAS
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit b9acab091842ca8b288882798bb809f7abf5408a ]
This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/loongson1-cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/loongson1-cpufreq.c +1 -0
@@ -217,6 +217,7 @@ static struct platform_driver ls1x_cpufreq_platdrv = {module_platform_driver (ls1x_cpufreq_platdrv); +MODULE_ALIAS ("platform:ls1x-cpufreq" );MODULE_AUTHOR ("Kelvin Cheung <[email protected]>" );MODULE_DESCRIPTION ("Loongson1 CPUFreq driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 143/242 cpufreq: scpi: Add missing MODULE_ALIAS
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit c0382d049d2def37b81e907a8b22661a4a4a6eb5 ]
This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq driver when it is compiled as an external module.
--- drivers/cpufreq/scpi-cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/scpi-cpufreq.c +1 -0
@@ -85,6 +85,7 @@ static struct platform_driver scpi_cpufreq_platdrv = { };module_platform_driver (scpi_cpufreq_platdrv); +MODULE_ALIAS ("platform:scpi-cpufreq" );MODULE_AUTHOR ("Sudeep Holla <[email protected]>" );MODULE_DESCRIPTION ("ARM SCPI CPUFreq interface driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 144/242 scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
In reply to Greg Kroah-HartmanFrom: Qinglang Miao <[email protected]>
[ Upstream commit 62eebd5247c4e4ce08826ad5995cf4dd7ce919dd ]
Add the missing destroy_workqueue() before return from __qedi_probe in the error handling case when fails to create workqueue qedi->offload_thread.
--- drivers/scsi/qedi/qedi_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/qedi/qedi_main.c +3 -1
@@ -2387,7 +2387,7 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)QEDI_ERR (&qedi->dbg_ctx,"Unable to start offload thread!\n" ); rc = -ENODEV ; - goto free_cid_que; + goto free_tmf_thread; }/* F/w needs 1st task context memory entry for performance */
@@ -2407,6 +2407,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)return 0 ; +free_tmf_thread: +destroy_workqueue (qedi->tmf_thread); free_cid_que:qedi_release_cid_que (qedi); free_uio:
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 145/242 scsi: pm80xx: Fix error return in pm8001_pci_probe()
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 97031ccffa4f62728602bfea8439dd045cd3aeb2 ]
The driver did not return an error in the case where pm8001_configure_phy_settings() failed.
Use rc to store the return value of pm8001_configure_phy_settings().
--- drivers/scsi/pm8001/pm8001_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c +2 -1
@@ -1054,7 +1054,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,pm8001_init_sas_add (pm8001_ha);/* phy setting support for motherboard controller */ -if (pm8001_configure_phy_settings (pm8001_ha)) + rc =pm8001_configure_phy_settings (pm8001_ha); +if (rc) goto err_out_shost;pm8001_post_sas_ha_init (shost, chip);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 146/242 seq_buf: Avoid type mismatch for seq_buf_init
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit d9a9280a0d0ae51dc1d4142138b99242b7ec8ac6 ]
Building with W=2 prints a number of warnings for one function that has a pointer type mismatch:
linux/seq_buf.h: In function 'seq_buf_init':linux/seq_buf.h:35:12: warning: pointer targets in assignment from 'unsigned char *' to 'char *' differ in signedness [-Wpointer-sign]
Change the type in the function prototype according to the type in the structure.
--- include/linux/seq_buf.h | 2 +- include/linux/trace_seq.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/seq_buf.h +1 -1
@@ -30,7 +30,7 @@ static inline void seq_buf_clear(struct seq_buf *s) }static inline void -seq_buf_init (struct seq_buf *s,unsigned char *buf,unsigned int size) +seq_buf_init (struct seq_buf *s,char *buf,unsigned int size) { s->buffer = buf; s->size = size;
include/linux/trace_seq.h +2 -2
@@ -12,7 +12,7 @@*/ struct trace_seq { -unsigned char buffer[PAGE_SIZE ]; +char buffer[PAGE_SIZE ];struct seq_buf seq;int full; };
@@ -51,7 +51,7 @@ static inline int trace_seq_used(struct trace_seq *s)* that is about to be written to and then return the result * of that write. */ -static inline unsigned char * +static inline char *trace_seq_buffer_ptr (struct trace_seq *s) {return s->buffer +seq_buf_used (&s->seq);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 147/242 scsi: fnic: Fix error return code in fnic_probe()
In reply to Greg Kroah-HartmanFrom: Zhang Changzhong <[email protected]>
[ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ]
Return a negative error code from the error handling case instead of 0 as done elsewhere in this function.
--- drivers/scsi/fnic/fnic_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/fnic/fnic_main.c +1 -0
@@ -746,6 +746,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i <FNIC_IO_LOCKS ; i++)spin_lock_init (&fnic->io_req_lock[i]); + err = -ENOMEM ; fnic->io_req_pool =mempool_create_slab_pool (2 , fnic_io_req_cache);if (!fnic->io_req_pool) goto err_out_free_resources;
Signature · 1 line
2.27.0
RE: [PATCH 4.14 147/242] scsi: fnic: Fix error return code in fnic_probe()
Regards,
Karan
-----Original Message-----
From: Greg Kroah-Hartman <[email protected]>
Sent: Monday, December 28, 2020 4:49 AM
To: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>; [email protected]; Hulk Robot <[email protected]>; Karan Tilak Kumar (kartilak) <[email protected]>; Zhang Changzhong <[email protected]>; Martin K. Petersen <[email protected]>; Sasha Levin <[email protected]>
Subject: [PATCH 4.14 147/242] scsi: fnic: Fix error return code in fnic_probe()
From: Zhang Changzhong <[email protected]>
[ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ]
Return a negative error code from the error handling case instead of 0 as done elsewhere in this function.
--- drivers/scsi/fnic/fnic_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/fnic/fnic_main.c +1 -0
@@ -746,6 +746,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i <FNIC_IO_LOCKS ; i++)spin_lock_init (&fnic->io_req_lock[i]); + err = -ENOMEM ; fnic->io_req_pool =mempool_create_slab_pool (2 , fnic_io_req_cache);if (!fnic->io_req_pool) goto err_out_free_resources;
--
2.27.0
Greg Kroah-Hartman
maintainerPATCH 148/242 powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
In reply to Greg Kroah-HartmanFrom: Nathan Lynch <[email protected]>
[ Upstream commit 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc ]
There are three ways pseries_suspend_begin() can be reached:
1. When "mem" is written to /sys/power/state:
kobj_attr_store()
-> state_store()
-> pm_suspend()
-> suspend_devices_and_enter()
-> pseries_suspend_begin()This never works because there is no way to supply a valid stream id using this interface, and H_VASI_STATE is called with a stream id of zero. So this call path is useless at best.
2. When a stream id is written to /sys/devices/system/power/hibernate. pseries_suspend_begin() is polled directly from store_hibernate() until the stream is in the "Suspending" state (i.e. the platform is ready for the OS to suspend execution):
dev_attr_store()
-> store_hibernate()
-> pseries_suspend_begin()
3. When a stream id is written to /sys/devices/system/power/hibernate (continued). After #2, pseries_suspend_begin() is called once again from the pm core:
dev_attr_store()
-> store_hibernate()
-> pm_suspend()
-> suspend_devices_and_enter()
-> pseries_suspend_begin()This is redundant because the VASI suspend state is already known to be Suspending.
The begin() callback of platform_suspend_ops is optional, so we can simply remove that assignment with no loss of function.
--- arch/powerpc/platforms/pseries/suspend.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/platforms/pseries/suspend.c +0 -1
@@ -224,7 +224,6 @@ static struct bus_type suspend_subsys = {static const struct platform_suspend_ops pseries_suspend_ops = { .valid = suspend_valid_only_mem, - .begin = pseries_suspend_begin, .prepare_late = pseries_prepare_late, .enter = pseries_suspend_enter, };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 149/242 powerpc/pseries/hibernation: remove redundant cacheinfo update
In reply to Greg Kroah-HartmanFrom: Nathan Lynch <[email protected]>
[ Upstream commit b866459489fe8ef0e92cde3cbd6bbb1af6c4e99b ]
Partitions with cache nodes in the device tree can encounter the following warning on resume:
CPU 0 already accounted in PowerPC,POWER9@0(Data)
WARNING: CPU: 0 PID: 3177 at arch/powerpc/kernel/cacheinfo.c:197 cacheinfo_cpu_online+0x640/0x820
These calls to cacheinfo_cpu_offline/online have been redundant since commit e610a466d16a ("powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration").
--- arch/powerpc/platforms/pseries/suspend.c | 3 --- 1 file changed, 3 deletions(-)
arch/powerpc/platforms/pseries/suspend.c +0 -3
@@ -26,7 +26,6 @@#include <asm/mmu.h> #include <asm/rtas.h> #include <asm/topology.h> -#include "../../kernel/cacheinfo.h" static u64 stream_id;static struct device suspend_dev;
@@ -91,9 +90,7 @@ static void pseries_suspend_enable_irqs(void)* Update configuration which can be modified based on device tree * changes during resume. */ -cacheinfo_cpu_offline (smp_processor_id ());post_mobility_fixup (); -cacheinfo_cpu_online (smp_processor_id ()); }/**
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 150/242 usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit d6ff32478d7e95d6ca199b5c852710d6964d5811 ]
The pm_runtime_enable will decrement the power disable depth. Imbalance depth will resulted in enabling runtime PM of device fails later. Thus a pairing decrement must be needed on the error handling path to keep it balanced.
--- drivers/usb/host/ehci-omap.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ehci-omap.c +1 -0
@@ -237,6 +237,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) err_pm_runtime:pm_runtime_put_sync (dev); +pm_runtime_disable (dev); err_phy:for (i =0 ; i < omap->nports; i++) {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 151/242 usb: oxu210hp-hcd: Fix memory leak in oxu_create
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit e5548b05631ec3e6bfdaef1cad28c799545b791b ]
usb_create_hcd will alloc memory for hcd, and we should call usb_put_hcd to free it when adding fails to prevent memory leak.
--- drivers/usb/host/oxu210hp-hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/oxu210hp-hcd.c +3 -1
@@ -3732,8 +3732,10 @@ static struct usb_hcd *oxu_create(struct platform_device *pdev, oxu->is_otg = otg; ret =usb_add_hcd (hcd, irq,IRQF_SHARED ); -if (ret <0 ) +if (ret <0 ) { +usb_put_hcd (hcd);return ERR_PTR (ret); + }device_wakeup_enable (hcd->self.controller);return hcd;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 152/242 speakup: fix uninitialized flush_lock
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit d1b928ee1cfa965a3327bbaa59bfa005d97fa0fe ]
The flush_lock is uninitialized, use DEFINE_SPINLOCK to define and initialize flush_lock.
--- drivers/staging/speakup/speakup_dectlk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/speakup_dectlk.c +1 -1
@@ -46,7 +46,7 @@ static unsigned char get_index(struct spk_synth *synth);static int in_escape;static int is_flushing; -static spinlock_t flush_lock; +static DEFINE_SPINLOCK (flush_lock);static DECLARE_WAIT_QUEUE_HEAD (flush);static struct var_t vars[] = {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 153/242 nfsd: Fix message level for normal termination
In reply to Greg Kroah-HartmanFrom: kazuo ito <[email protected]>
[ Upstream commit 4420440c57892779f265108f46f83832a88ca795 ]
The warning message from nfsd terminating normally can confuse system adminstrators or monitoring software.
Though it's not exactly fair to pin-point a commit where it originated, the current form in the current place started to appear in:
--- fs/nfsd/nfssvc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfsd/nfssvc.c +1 -2
@@ -410,8 +410,7 @@ static void nfsd_last_thread(struct svc_serv *serv, struct net *net)return ;nfsd_shutdown_net (net); -printk (KERN_WARNING "nfsd: last server has exited, flushing export " -"cache\n" ); +pr_info ("nfsd: last server has exited, flushing export cache\n" );nfsd_export_flush (net); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 154/242 nfs_common: need lock during iterate through the list
In reply to Greg Kroah-HartmanFrom: Cheng Lin <[email protected]>
[ Upstream commit 4a9d81caf841cd2c0ae36abec9c2963bf21d0284 ]
If the elem is deleted during be iterated on it, the iteration process will fall into an endless loop.
kernel: NMI watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [nfsd:17137]
PID: 17137 TASK: ffff8818d93c0000 CPU: 4 COMMAND: "nfsd" [exception RIP: __state_in_grace+76]
RIP: ffffffffc00e817c RSP: ffff8818d3aefc98 RFLAGS: 00000246 RAX: ffff881dc0c38298 RBX: ffffffff81b03580 RCX: ffff881dc02c9f50 RDX: ffff881e3fce8500 RSI: 0000000000000001 RDI: ffffffff81b03580 RBP: ffff8818d3aefca0 R8: 0000000000000020 R9: ffff8818d3aefd40 R10: ffff88017fc03800 R11: ffff8818e83933c0 R12: ffff8818d3aefd40 R13: 0000000000000000 R14: ffff8818e8391068 R15: ffff8818fa6e4000 CS: 0010 SS: 0018
#0 [ffff8818d3aefc98] opens_in_grace at ffffffffc00e81e3 [grace] #1 [ffff8818d3aefca8] nfs4_preprocess_stateid_op at ffffffffc02a3e6c [nfsd] #2 [ffff8818d3aefd18] nfsd4_write at ffffffffc028ed5b [nfsd]
#3 [ffff8818d3aefd80] nfsd4_proc_compound at ffffffffc0290a0d [nfsd] #4 [ffff8818d3aefdd0] nfsd_dispatch at ffffffffc027b800 [nfsd] #5 [ffff8818d3aefe08] svc_process_common at ffffffffc02017f3 [sunrpc] #6 [ffff8818d3aefe70] svc_process at ffffffffc0201ce3 [sunrpc] #7 [ffff8818d3aefe98] nfsd at ffffffffc027b117 [nfsd]
#8 [ffff8818d3aefec8] kthread at ffffffff810b88c1
#9 [ffff8818d3aeff50] ret_from_fork at ffffffff816d1607
The troublemake elem:
crash> lock_manager ffff881dc0c38298
struct lock_manager {
list = {
next = 0xffff881dc0c38298,
prev = 0xffff881dc0c38298
},
block_opens = false
}
--- fs/nfs_common/grace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/nfs_common/grace.c +5 -1
@@ -75,10 +75,14 @@ __state_in_grace(struct net *net, bool open)if (!open)return !list_empty (grace_list); +spin_lock (&grace_lock);list_for_each_entry (lm, grace_list, list) { -if (lm->block_opens) +if (lm->block_opens) { +spin_unlock (&grace_lock);return true; + } } +spin_unlock (&grace_lock);return false; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 155/242 x86/kprobes: Restore BTF if the single-stepping is cancelled
In reply to Greg Kroah-HartmanFrom: Masami Hiramatsu <[email protected]>
[ Upstream commit 78ff2733ff352175eb7f4418a34654346e1b6cd2 ]
Fix to restore BTF if single-stepping causes a page fault and it is cancelled.
Usually the BTF flag was restored when the single stepping is done (in resume_execution()). However, if a page fault happens on the single stepping instruction, the fault handler is invoked and the single stepping is cancelled. Thus, the BTF flag is not restored.
--- arch/x86/kernel/kprobes/core.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kernel/kprobes/core.c +5 -0
@@ -1022,6 +1022,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)* So clear it by resetting the current kprobe: */ regs->flags &= ~X86_EFLAGS_TF ; +/* +* Since the single step (trap) has been cancelled, +* we need to restore BTF here. +*/ +restore_btf ();/* * If the TF flag was set before the kprobe hit,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 156/242 clk: tegra: Fix duplicated SE clock entry
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 5bf5861d6ea6c3f4b38fc8fda2062b2dc44ac63d ]
The periph_clks[] array contains duplicated entry for Security Engine clock which was meant to be defined for T210, but it wasn't added properly. This patch corrects the T210 SE entry and fixes the following error message on T114/T124: "Tegra clk 127: register failed with -17".
Tested-by Nicolas Chauvet <[email protected]>
Reported-by Nicolas Chauvet <[email protected]>
--- drivers/clk/tegra/clk-id.h | 1 + drivers/clk/tegra/clk-tegra-periph.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/clk/tegra/clk-id.h +1 -0
@@ -234,6 +234,7 @@ enum clk_id { tegra_clk_sdmmc4_8, tegra_clk_sdmmc4_9, tegra_clk_se, + tegra_clk_se_10, tegra_clk_soc_therm, tegra_clk_soc_therm_8, tegra_clk_sor0,
drivers/clk/tegra/clk-tegra-periph.c +1 -1
@@ -673,7 +673,7 @@ static struct tegra_periph_init_data periph_clks[] = {INT8 ("host1x" , mux_pllm_pllc2_c_c3_pllp_plla,CLK_SOURCE_HOST1X ,28 ,0 , tegra_clk_host1x_8),INT8 ("host1x" , mux_pllc4_out1_pllc_pllc4_out2_pllp_clkm_plla_pllc4_out0,CLK_SOURCE_HOST1X ,28 ,0 , tegra_clk_host1x_9),INT8 ("se" , mux_pllp_pllc2_c_c3_pllm_clkm,CLK_SOURCE_SE ,127 ,TEGRA_PERIPH_ON_APB , tegra_clk_se), -INT8 ("se" , mux_pllp_pllc2_c_c3_clkm,CLK_SOURCE_SE ,127 ,TEGRA_PERIPH_ON_APB , tegra_clk_se), +INT8 ("se" , mux_pllp_pllc2_c_c3_clkm,CLK_SOURCE_SE ,127 ,TEGRA_PERIPH_ON_APB , tegra_clk_se_10),INT8 ("2d" , mux_pllm_pllc2_c_c3_pllp_plla,CLK_SOURCE_2D ,21 ,0 , tegra_clk_gr2d_8),INT8 ("3d" , mux_pllm_pllc2_c_c3_pllp_plla,CLK_SOURCE_3D ,24 ,0 , tegra_clk_gr3d_8), INT8("vic03", mux_pllm_pllc_pllp_plla_pllc2_c3_clkm, CLK_SOURCE_VIC03, 178, 0, tegra_clk_vic03),
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 157/242 extcon: max77693: Fix modalias string
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit e1efdb604f5c9903a5d92ef42244009d3c04880f ]
The platform device driver name is "max77693-muic", so advertise it properly in the modalias string. This fixes automated module loading when this driver is compiled as a module.
--- drivers/extcon/extcon-max77693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max77693.c +1 -1
@@ -1275,4 +1275,4 @@ module_platform_driver(max77693_muic_driver);MODULE_DESCRIPTION ("Maxim MAX77693 Extcon driver" );MODULE_AUTHOR ("Chanwoo Choi <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("platform:extcon-max77693" ); +MODULE_ALIAS ("platform:max77693-muic" );
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 158/242 ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 85a7555575a0e48f9b73db310d0d762a08a46d63 ]
The error handling frees "ctl" but it's still on the "dsp->ctl_list" list so that could result in a use after free. Remove it from the list before returning.
--- sound/soc/codecs/wm_adsp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/codecs/wm_adsp.c +3 -2
@@ -1391,7 +1391,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, ctl_work =kzalloc (sizeof (*ctl_work),GFP_KERNEL );if (!ctl_work) { ret = -ENOMEM ; - goto err_ctl_cache; + goto err_list_del; } ctl_work->dsp = dsp;
@@ -1401,7 +1401,8 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,return 0 ; -err_ctl_cache: +err_list_del: +list_del (&ctl->list);kfree (ctl->cache); err_ctl_name:kfree (ctl->name);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 159/242 irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
[ Upstream commit 3841245e8498a789c65dedd7ffa8fb2fee2c0684 ]
The alpine-msi driver has an interesting allocation error handling, where it frees the same interrupts repeatedly. Hilarity follows.
This code is probably never executed, but let's fix it nonetheless.
--- drivers/irqchip/irq-alpine-msi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-alpine-msi.c +1 -2
@@ -165,8 +165,7 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain,return 0 ; err_sgi: -while (--i >=0 ) -irq_domain_free_irqs_parent (domain, virq, i); +irq_domain_free_irqs_parent (domain, virq, i -1 );alpine_msix_free_sgi (priv, sgi, nr_irqs);return err; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 160/242 watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
In reply to Greg Kroah-HartmanFrom: Guenter Roeck <[email protected]>
[ Upstream commit 8ae2511112d2e18bc7d324b77f965d34083a25a2 ]
If HAS_IOMEM is not defined and SIRFSOC_WATCHDOG is enabled, the build fails with the following error.
drivers/watchdog/sirfsoc_wdt.o: in function `sirfsoc_wdt_probe':
sirfsoc_wdt.c:(.text+0x112):
undefined reference to `devm_platform_ioremap_resource'
--- drivers/watchdog/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/watchdog/Kconfig +1 -0
@@ -620,6 +620,7 @@ config MOXART_WDT config SIRFSOC_WATCHDOG tristate "SiRFSOC watchdog" + depends on HAS_IOMEM depends on ARCH_SIRF || COMPILE_TEST select WATCHDOG_CORE default y
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 161/242 um: chan_xterm: Fix fd leak
In reply to Greg Kroah-HartmanFrom: Anton Ivanov <[email protected]>
[ Upstream commit 9431f7c199ab0d02da1482d62255e0b4621cb1b5 ]
xterm serial channel was leaking a fd used in setting up the port helper
This bug is prehistoric - it predates switching to git. The "fixes" header here is really just to mark all the versions we would like this to apply to which is "Anything from the Cretaceous period onwards".
No dinosaurs were harmed in fixing this bug.
--- arch/um/drivers/xterm.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/um/drivers/xterm.c +5 -0
@@ -18,6 +18,7 @@struct xterm_chan {int pid;int helper_pid; +int chan_fd;char *title;int device;int raw;
@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts)return NULL ; *data = ((struct xterm_chan ) { .pid =-1 , .helper_pid =-1 , + .chan_fd =-1 , .device = device, .title = opts->xterm_title, .raw = opts->raw } );
@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d, goto out_kill; } + data->chan_fd = fd; new =xterm_fd (fd, &data->helper_pid);if (new <0 ) { err = new;
@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d)os_kill_process (data->helper_pid,0 ); data->helper_pid =-1 ; +if (data->chan_fd !=-1 ) +os_close_file (data->chan_fd);os_close_file (fd); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 162/242 nfc: s3fwrn5: Release the nfc firmware
In reply to Greg Kroah-HartmanFrom: Bongsu Jeon <[email protected]>
[ Upstream commit a4485baefa1efa596702ebffd5a9c760d42b14b5 ]
add the code to release the nfc firmware when the firmware image size is wrong.
--- drivers/nfc/s3fwrn5/firmware.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nfc/s3fwrn5/firmware.c +3 -1
@@ -304,8 +304,10 @@ static int s3fwrn5_fw_request_firmware(struct s3fwrn5_fw_info *fw_info)if (ret <0 )return ret; -if (fw->fw->size <S3FWRN5_FW_IMAGE_HEADER_SIZE ) +if (fw->fw->size <S3FWRN5_FW_IMAGE_HEADER_SIZE ) { +release_firmware (fw->fw);return -EINVAL ; + }memcpy (fw->date, fw->fw->data +0x00 ,12 ); fw->date[12 ] ='\0' ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 163/242 powerpc/ps3: use dma_mapping_error()
In reply to Greg Kroah-HartmanFrom: Vincent Stehlé <[email protected]>
[ Upstream commit d0edaa28a1f7830997131cbce87b6c52472825d1 ]
The DMA address returned by dma_map_single() should be checked with dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
--- drivers/ps3/ps3stor_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ps3/ps3stor_lib.c +1 -1
@@ -201,7 +201,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler) dev->bounce_lpar =ps3_mm_phys_to_lpar (__pa (dev->bounce_buf)); dev->bounce_dma =dma_map_single (&dev->sbd.core, dev->bounce_buf, dev->bounce_size,DMA_BIDIRECTIONAL ); -if (!dev->bounce_dma) { +if (dma_mapping_error (&dev->sbd.core, dev->bounce_dma)) {dev_err (&dev->sbd.core,"%s:%u: map DMA region failed\n" , __func__, __LINE__); error = -ENODEV ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 164/242 checkpatch: fix unescaped left brace
In reply to Greg Kroah-HartmanFrom: Dwaipayan Ray <[email protected]>
[ Upstream commit 03f4935135b9efeb780b970ba023c201f81cf4e6 ]
There is an unescaped left brace in a regex in OPEN_BRACE check. This throws a runtime error when checkpatch is run with --fix flag and the OPEN_BRACE check is executed.
Fix it by escaping the left brace.
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -3898,7 +3898,7 @@ sub process { $fix) { fix_delete_line($fixlinenr, $rawline); my $fixed_line = $rawline; - $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; my $line1 = $1; my $line2 = $2; fix_insert_line($fixlinenr, ltrim($line1));
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 165/242 net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 4375ada01963d1ebf733d60d1bb6e5db401e1ac6 ]
If the 'register_netdev()' call fails, we must undo a previous 'bcmgenet_mii_init()' call.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -1
@@ -3593,8 +3593,10 @@ static int bcmgenet_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); err =register_netdev (dev); -if (err) +if (err) { +bcmgenet_mii_exit (dev); goto err; + }return err;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 166/242 net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 322e53d1e2529ae9d501f5e0f20604a79b873aef ]
'irq_of_parse_and_map()' should be balanced by a corresponding 'irq_dispose_mapping()' call. Otherwise, there is some resources leaks.
Add such a call in the error handling path of the probe function and in the remove function.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +5 -2
@@ -847,13 +847,13 @@ static int emac_probe(struct platform_device *pdev) db->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (db->clk)) { ret =PTR_ERR (db->clk); - goto out_iounmap; + goto out_dispose_mapping; } ret =clk_prepare_enable (db->clk);if (ret) {dev_err (&pdev->dev,"Error couldn't enable clock (%d)\n" , ret); - goto out_iounmap; + goto out_dispose_mapping; } ret =sunxi_sram_claim (&pdev->dev);
@@ -910,6 +910,8 @@ out_release_sram:sunxi_sram_release (&pdev->dev); out_clk_disable_unprepare:clk_disable_unprepare (db->clk); +out_dispose_mapping: +irq_dispose_mapping (ndev->irq); out_iounmap:iounmap (db->membase); out:
@@ -928,6 +930,7 @@ static int emac_remove(struct platform_device *pdev)unregister_netdev (ndev);sunxi_sram_release (&pdev->dev);clk_disable_unprepare (db->clk); +irq_dispose_mapping (ndev->irq);iounmap (db->membase);free_netdev (ndev);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 167/242 net: korina: fix return value
In reply to Greg Kroah-HartmanFrom: Vincent Stehlé <[email protected]>
[ Upstream commit 7eb000bdbe7c7da811ef51942b356f6e819b13ba ]
The ndo_start_xmit() method must not attempt to free the skb to transmit when returning NETDEV_TX_BUSY. Therefore, make sure the korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
--- drivers/net/ethernet/korina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/korina.c +1 -1
@@ -216,7 +216,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)dev_kfree_skb_any (skb);spin_unlock_irqrestore (&lp->lock, flags); -return NETDEV_TX_BUSY ; +return NETDEV_TX_OK ; } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 168/242 watchdog: qcom: Avoid context switch in restart handler
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 7948fab26bcc468aa2a76462f441291b5fb0d5c7 ]
The use of msleep() in the restart handler will cause scheduler to induce a context switch which is not desirable. This generates below warning on SDX55 when WDT is the only available restart source:
[ 39.800188] reboot: Restarting system [ 39.804115] ------------[ cut here ]------------ [ 39.807855] WARNING: CPU: 0 PID: 678 at kernel/rcu/tree_plugin.h:297 rcu_note_context_switch+0x190/0x764 [ 39.812538] Modules linked in: [ 39.821954] CPU: 0 PID: 678 Comm: reboot Not tainted 5.10.0-rc1-00063-g33a9990d1d66-dirty #47 [ 39.824854] Hardware name: Generic DT based system [ 39.833470] [<c0310fbc>] (unwind_backtrace) from [<c030c544>] (show_stack+0x10/0x14) [ 39.838154] [<c030c544>] (show_stack) from [<c0c218f0>] (dump_stack+0x8c/0xa0) [ 39.846049] [<c0c218f0>] (dump_stack) from [<c0322f80>] (__warn+0xd8/0xf0) [ 39.853058] [<c0322f80>] (__warn) from [<c0c1dc08>] (warn_slowpath_fmt+0x64/0xc8) [ 39.859925] [<c0c1dc08>] (warn_slowpath_fmt) from [<c038b6f4>] (rcu_note_context_switch+0x190/0x764) [ 39.867503] [<c038b6f4>] (rcu_note_context_switch) from [<c0c2aa3c>] (__schedule+0x84/0x640) [ 39.876685] [<c0c2aa3c>] (__schedule) from [<c0c2b050>] (schedule+0x58/0x10c) [ 39.885095] [<c0c2b050>] (schedule) from [<c0c2eed0>] (schedule_timeout+0x1e8/0x3d4) [ 39.892135] [<c0c2eed0>] (schedule_timeout) from [<c039ad40>] (msleep+0x2c/0x38) [ 39.899947] [<c039ad40>] (msleep) from [<c0a59d0c>] (qcom_wdt_restart+0xc4/0xcc) [ 39.907319] [<c0a59d0c>] (qcom_wdt_restart) from [<c0a58290>] (watchdog_restart_notifier+0x18/0x28) [ 39.914715] [<c0a58290>] (watchdog_restart_notifier) from [<c03468e0>] (atomic_notifier_call_chain+0x60/0x84) [ 39.923487] [<c03468e0>] (atomic_notifier_call_chain) from [<c030ae64>] (machine_restart+0x78/0x7c) [ 39.933551] [<c030ae64>] (machine_restart) from [<c0348048>] (__do_sys_reboot+0xdc/0x1e0) [ 39.942397] [<c0348048>] (__do_sys_reboot) from [<c0300060>] (ret_fast_syscall+0x0/0x54) [ 39.950721] Exception stack(0xc3e0bfa8 to 0xc3e0bff0) [ 39.958855] bfa0: 0001221c bed2fe24 fee1dead 28121969 01234567 00000000 [ 39.963832] bfc0: 0001221c bed2fe24 00000003 00000058 000225e0 00000000 00000000 00000000 [ 39.971985] bfe0: b6e62560 bed2fc84 00010fd8 b6e62580 [ 39.980124] ---[ end trace 3f578288bad866e4 ]---
Hence, replace msleep() with mdelay() to fix this issue.
--- drivers/watchdog/qcom-wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/qcom-wdt.c +1 -1
@@ -121,7 +121,7 @@ static int qcom_wdt_restart(struct watchdog_device *wdd, unsigned long action,*/ wmb (); -msleep (150 ); +mdelay (150 );return 0 ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 169/242 watchdog: coh901327: add COMMON_CLK dependency
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 36c47df85ee8e1f8a35366ac11324f8875de00eb ]
clang produces a build failure in configurations without COMMON_CLK when a timeout calculation goes wrong:
arm-linux-gnueabi-ld: drivers/watchdog/coh901327_wdt.o: in function `coh901327_enable':
coh901327_wdt.c:(.text+0x50): undefined reference to `__bad_udelay'
Add a Kconfig dependency to only do build testing when COMMON_CLK is enabled.
--- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/Kconfig +1 -1
@@ -495,7 +495,7 @@ config SUNXI_WATCHDOG config COH901327_WATCHDOG bool "ST-Ericsson COH 901 327 watchdog" - depends on ARCH_U300 || (ARM && COMPILE_TEST) + depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST) default y if MACH_U300 select WATCHDOG_CORE help
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 170/242 clk: ti: Fix memleak in ti_fapll_synth_setup
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 8c6239f6e95f583bb763d0228e02d4dd0fb3d492 ]
If clk_register fails, we should goto free branch
before function returns to prevent memleak.
--- drivers/clk/ti/fapll.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/clk/ti/fapll.c +9 -2
@@ -497,6 +497,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, {struct clk_init_data *init;struct fapll_synth *synth; +struct clk *clk =ERR_PTR (-ENOMEM ); init =kzalloc (sizeof (*init),GFP_KERNEL );if (!init)
@@ -519,13 +520,19 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, synth->hw.init = init; synth->clk_pll = pll_clk; -return clk_register (NULL , &synth->hw); + clk =clk_register (NULL , &synth->hw); +if (IS_ERR (clk)) { +pr_err ("failed to register clock\n" ); + goto free; + } + +return clk; free:kfree (synth);kfree (init); -return ERR_PTR (-ENOMEM ); +return clk; }static void __init ti_fapll_setup (struct device_node *node)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 171/242 pwm: zx: Add missing cleanup in error path
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 269effd03f6142df4c74814cfdd5f0b041b30bf9 ]
zx_pwm_probe() called clk_prepare_enable() before; this must be undone in the error path.
--- drivers/pwm/pwm-zx.c | 1 + 1 file changed, 1 insertion(+)
drivers/pwm/pwm-zx.c +1 -0
@@ -241,6 +241,7 @@ static int zx_pwm_probe(struct platform_device *pdev) ret =pwmchip_add (&zpc->chip);if (ret <0 ) {dev_err (&pdev->dev,"failed to add PWM chip: %d\n" , ret); +clk_disable_unprepare (zpc->pclk);return ret; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 173/242 perf record: Fix memory leak when using --user-regs=? to list registers
In reply to Greg Kroah-HartmanFrom: Zheng Zengkai <[email protected]>
[ Upstream commit 2eb5dd418034ecea2f7031e3d33f2991a878b148 ]
When using 'perf record's option '-I' or '--user-regs=' along with argument '?' to list available register names, memory of variable 'os' allocated by strdup() needs to be released before __parse_regs() returns, otherwise memory leak will occur.
--- tools/perf/util/parse-regs-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/parse-regs-options.c +1 -1
@@ -41,7 +41,7 @@ parse_regs(const struct option *opt, const char *str, int unset) }fputc ('\n' , stderr);/* just printing available regs */ -return -1 ; + goto error; }for (r = sample_reg_masks; r->name; r++) {if (!strcasecmp (s, r->name))
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 174/242 qlcnic: Fix error code in probe
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 0d52848632a357948028eab67ff9b7cc0c12a0fb ]
Return -EINVAL if we can't find the correct device. Currently it returns success.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -0
@@ -2511,6 +2511,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)qlcnic_sriov_vf_register_map (ahw);break ;default : + err = -EINVAL ; goto err_out_free_hw_res; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 175/242 clk: s2mps11: Fix a resource leak in error handling paths in the probe function
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit d2d94fc567624f96187e8b52083795620f93e69f ]
Some resource should be released in the error handling path of the probe function, as already done in the remove function.
The remove function was fixed in commit bf416bd45738 ("clk: s2mps11: Add missing of_node_put and of_clk_del_provider")
--- drivers/clk/clk-s2mps11.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk-s2mps11.c +1 -0
@@ -211,6 +211,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)return ret; err_reg: +of_node_put (s2mps11_clks[0 ].clk_np);while (--i >=0 )clkdev_drop (s2mps11_clks[i].lookup);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 176/242 clk: sunxi-ng: Make sure divider tables have sentinel
In reply to Greg Kroah-HartmanFrom: Jernej Skrabec <[email protected]>
[ Upstream commit 48f68de00c1405351fa0e7bc44bca067c49cd0a3 ]
Two clock divider tables are missing sentinel at the end. Effect of that is that clock framework reads past the last entry. Fix that with adding sentinel at the end.
Issue was discovered with KASan.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 1 + drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 1 + 2 files changed, 2 insertions(+)
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +1 -0
@@ -381,6 +381,7 @@ static struct clk_div_table ths_div_table[] = { { .val = 1, .div = 2 }, { .val = 2, .div = 4 }, { .val = 3, .div = 6 }, + { /* Sentinel */ }, };static const char *const ths_parents[] = {"osc24M" };static struct ccu_div ths_clk = {
drivers/clk/sunxi-ng/ccu-sun8i-h3.c +1 -0
@@ -315,6 +315,7 @@ static struct clk_div_table ths_div_table[] = { { .val = 1, .div = 2 }, { .val = 2, .div = 4 }, { .val = 3, .div = 6 }, + { /* Sentinel */ }, }; static SUNXI_CCU_DIV_TABLE_WITH_GATE(ths_clk, "ths", "osc24M", 0x074, 0, 2, ths_div_table, BIT(31), 0);
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 177/242 cfg80211: initialize rekey_data
In reply to Greg Kroah-HartmanFrom: Sara Sharon <[email protected]>
[ Upstream commit f495acd8851d7b345e5f0e521b2645b1e1f928a0 ]
In case we have old supplicant, the akm field is uninitialized.
--- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
@@ -10969,7 +10969,7 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)struct net_device *dev = info->user_ptr[1 ];struct wireless_dev *wdev = dev->ieee80211_ptr;struct nlattr *tb[NUM_NL80211_REKEY_DATA ]; -struct cfg80211_gtk_rekey_data rekey_data; +struct cfg80211_gtk_rekey_data rekey_data = {};int err;if (!info->attrs[NL80211_ATTR_REKEY_DATA ])
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 178/242 fix namespaced fscaps when !CONFIG_SECURITY
In reply to Greg Kroah-HartmanFrom: Serge Hallyn <[email protected]>
[ Upstream commit ed9b25d1970a4787ac6a39c2091e63b127ecbfc1 ]
Namespaced file capabilities were introduced in 8db6c34f1dbc . When userspace reads an xattr for a namespaced capability, a virtualized representation of it is returned if the caller is in a user namespace owned by the capability's owning rootid. The function which performs this virtualization was not hooked up if CONFIG_SECURITY=n. Therefore in that case the original xattr was shown instead of the virtualized one.
To test this using libcap-bin (*1),
$ v=$(mktemp) $ unshare -Ur setcap cap_sys_admin-eip $v $ unshare -Ur setcap -v cap_sys_admin-eip $v /tmp/tmp.lSiIFRvt8Y: OK
"setcap -v" verifies the values instead of setting them, and will check whether the rootid value is set. Therefore, with this bug un-fixed, and with CONFIG_SECURITY=n, setcap -v will fail:
$ v=$(mktemp) $ unshare -Ur setcap cap_sys_admin=eip $v $ unshare -Ur setcap -v cap_sys_admin=eip $v nsowner[got=1000, want=0],/tmp/tmp.HHDiOOl9fY differs in []
Fix this bug by calling cap_inode_getsecurity() in security_inode_getsecurity() instead of returning -EOPNOTSUPP, when CONFIG_SECURITY=n.
*1 - note, if libcap is too old for getcap to have the '-n' option, then use verify-caps instead.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=209689
--- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/security.h +1 -1
@@ -780,7 +780,7 @@ static inline int security_inode_killpriv(struct dentry *dentry)static inline int security_inode_getsecurity (struct inode *inode,const char *name,void **buffer,bool alloc) { -return -EOPNOTSUPP ; +return cap_inode_getsecurity (inode, name, buffer, alloc); }static inline int security_inode_setsecurity (struct inode *inode,const char *name,const void *value,size_t size,int flags)
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 179/242 Input: cros_ec_keyb - send scancodes in addition to key events
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 80db2a087f425b63f0163bc95217abd01c637cb5 ]
To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events.
--- drivers/input/keyboard/cros_ec_keyb.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/keyboard/cros_ec_keyb.c +1 -0
@@ -196,6 +196,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,"changed: [r%d c%d]: byte %02x\n" , row, col, new_state); +input_event (idev,EV_MSC ,MSC_SCAN , pos);input_report_key (idev, keycodes[pos], new_state); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 180/242 Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
In reply to Greg Kroah-HartmanFrom: Simon Beginn <[email protected]>
[ Upstream commit cffdd6d90482316e18d686060a4397902ea04bd2 ]
The touchscreen on the Teclast x98 Pro is also mounted upside-down in relation to the display orientation.
--- drivers/input/touchscreen/goodix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/input/touchscreen/goodix.c +12 -0
@@ -101,6 +101,18 @@ static const struct dmi_system_id rotated_screen[] = { DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"), }, }, + { + .ident = "Teclast X98 Pro", + .matches = { +/* +* Only match BIOS date, because the manufacturers +* BIOS does not report the board name at all +* (sometimes)... +*/ +DMI_MATCH (DMI_BOARD_VENDOR ,"TECLAST" ), + DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"), + }, + }, { .ident ="WinBook TW100" , .matches = {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 181/242 media: gspca: Fix memory leak in probe
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
commit e469d0b09a19496e1972a20974bbf55b728151eb upstream.
The gspca driver leaks memory when a probe fails. gspca_dev_probe2() calls v4l2_device_register(), which takes a reference to the underlying device node (in this case, a USB interface). But the failure pathway neglects to call v4l2_device_unregister(), the routine responsible for dropping this reference. Consequently the memory for the USB interface and its device never gets released.
This patch adds the missing function call.
--- drivers/media/usb/gspca/gspca.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/gspca/gspca.c +1 -0
@@ -2140,6 +2140,7 @@ out:input_unregister_device (gspca_dev->input_dev);#endif v4l2_ctrl_handler_free (gspca_dev->vdev.ctrl_handler); +v4l2_device_unregister (&gspca_dev->v4l2_dev);kfree (gspca_dev->usb_buf);kfree (gspca_dev);return ret;
Greg Kroah-Hartman
maintainerPATCH 182/242 media: sunxi-cir: ensure IR is handled when it is continuous
In reply to Greg Kroah-HartmanFrom: Sean Young <[email protected]>
commit 3f56df4c8ffeb120ed41906d3aae71799b7e726a upstream.
If a user holds a button down on a remote, then no ir idle interrupt will be generated until the user releases the button, depending on how quickly the remote repeats. No IR is processed until that point, which means that holding down a button may not do anything.
This also resolves an issue on a Cubieboard 1 where the IR receiver is picking up ambient infrared as IR and spews out endless
"rc rc0: IR event FIFO is full!" messages unless you choose to live in the dark.
--- drivers/media/rc/sunxi-cir.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/rc/sunxi-cir.c +2 -0
@@ -132,6 +132,8 @@ static irqreturn_t sunxi_ir_irq(int irqn }else if (status ®_RXINT_RPEI_EN ) {ir_raw_event_set_idle (ir->rc, true);ir_raw_event_handle (ir->rc); + }else { +ir_raw_event_handle (ir->rc); }spin_unlock (&ir->ir_lock);
Greg Kroah-Hartman
maintainerPATCH 183/242 media: netup_unidvb: Dont leak SPI master in probe error path
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit e297ddf296de35037fa97f4302782def196d350a upstream.
If the call to spi_register_master() fails on probe of the NetUP Universal DVB driver, the spi_master struct is erroneously not freed.
Likewise, if spi_new_device() fails, the spi_controller struct is not unregistered. Plug the leaks.
While at it, fix an ordering issue in netup_spi_release() wherein spi_unregister_master() is called after fiddling with the IRQ control register. The correct order is to call spi_unregister_master() *before* this teardown step because bus accesses may still be ongoing until that function returns.
--- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c +3 -2
@@ -184,7 +184,7 @@ int netup_spi_init(struct netup_unidvb_dstruct spi_master *master;struct netup_spi *nspi; - master =spi_alloc_master (&ndev->pci_dev->dev, + master =devm_spi_alloc_master (&ndev->pci_dev->dev,sizeof (struct netup_spi ));if (!master) { dev_err(&ndev->pci_dev->dev,
@@ -217,6 +217,7 @@ int netup_spi_init(struct netup_unidvb_d ndev->pci_slot, ndev->pci_func);if (!spi_new_device (master, &netup_spi_board)) { +spi_unregister_master (master); ndev->spi =NULL ;dev_err (&ndev->pci_dev->dev,"%s(): unable to create SPI device\n" , __func__);
@@ -235,13 +236,13 @@ void netup_spi_release(struct netup_unidif (!spi)return ; +spi_unregister_master (spi->master);spin_lock_irqsave (&spi->lock, flags); reg =readw (&spi->regs->control_stat);writew (reg |NETUP_SPI_CTRL_IRQ , &spi->regs->control_stat); reg =readw (&spi->regs->control_stat);writew (reg & ~NETUP_SPI_CTRL_IMASK , &spi->regs->control_stat);spin_unlock_irqrestore (&spi->lock, flags); -spi_unregister_master (spi->master); ndev->spi =NULL ; }
Greg Kroah-Hartman
maintainerPATCH 184/242 Input: cyapa_gen6 - fix out-of-bounds stack access
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit f051ae4f6c732c231046945b36234e977f8467c6 upstream.
gcc -Warray-bounds warns about a serious bug incyapa_pip_retrieve_data_structure:
drivers/input/mouse/cyapa_gen6.c: In function 'cyapa_pip_retrieve_data_structure.constprop':include/linux/unaligned/access_ok.h:40:17: warning: array subscript -1 is outside array bounds of 'struct retrieve_data_struct_cmd[1]' [-Warray-bounds]
40 | *((__le16 *)p) = cpu_to_le16(val);drivers/input/mouse/cyapa_gen6.c:569:13: note: while referencing 'cmd'
569 | } __packed cmd;
| ^~~
Apparently the '-2' was added to the pointer instead of the value, writing garbage into the stack next to this variable.
--- drivers/input/mouse/cyapa_gen6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/cyapa_gen6.c +1 -1
@@ -573,7 +573,7 @@ static int cyapa_pip_retrieve_data_strucmemset (&cmd,0 ,sizeof (cmd));put_unaligned_le16 (PIP_OUTPUT_REPORT_ADDR , &cmd.head.addr); -put_unaligned_le16 (sizeof (cmd), &cmd.head.length -2 ); +put_unaligned_le16 (sizeof (cmd) -2 , &cmd.head.length); cmd.head.report_id =PIP_APP_CMD_REPORT_ID ; cmd.head.cmd_code =PIP_RETRIEVE_DATA_STRUCTURE ;put_unaligned_le16 (read_offset, &cmd.read_offset);
Greg Kroah-Hartman
maintainerPATCH 185/242 PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
In reply to Greg Kroah-HartmanFrom: Rafael J. Wysocki <[email protected]>
commit 7482c5cb90e5a7f9e9e12dd154d405e0219656e3 upstream.
The idea behind acpi_pm_set_bridge_wakeup() was to allow bridges to be reference counted for wakeup enabling, because they may be enabled to signal wakeup on behalf of their subordinate devices and that may happen for multiple times in a row, whereas for the other devices it only makes sense to enable wakeup signaling once.
However, this becomes problematic if the bridge itself is suspended, because it is treated as a "regular" device in that case and the reference counting doesn't work.
For instance, suppose that there are two devices below a bridge and they both can signal wakeup. Every time one of them is suspended, wakeup signaling is enabled for the bridge, so when they both have been suspended, the bridge's wakeup reference counter value is 2.
Say that the bridge is suspended subsequently and acpi_pci_wakeup() is called for it. Because the bridge can signal wakeup, that function will invoke acpi_pm_set_device_wakeup() to configure it and __acpi_pm_set_device_wakeup() will be called with the last argument equal to 1. This causes __acpi_device_wakeup_enable() invoked by it to omit the reference counting, because the reference counter of the target device (the bridge) is 2 at that time.
Now say that the bridge resumes and one of the device below it resumes too, so the bridge's reference counter becomes 0 and wakeup signaling is disabled for it, but there is still the other suspended device which may need the bridge to signal wakeup on its behalf and that is not going to work.
To address this scenario, use wakeup enable reference counting for all devices, not just for bridges, so drop the last argument from __acpi_device_wakeup_enable() and __acpi_pm_set_device_wakeup(), which causes acpi_pm_set_device_wakeup() and acpi_pm_set_bridge_wakeup() to become identical, so drop the latter and use the former instead of it everywhere.
--- drivers/acpi/device_pm.c | 41 ++++++++++++----------------------------- drivers/pci/pci-acpi.c | 4 ++-- include/acpi/acpi_bus.h | 5 ----- 3 files changed, 14 insertions(+), 36 deletions(-)
drivers/acpi/device_pm.c +12 -29
@@ -694,7 +694,7 @@ static void acpi_pm_notify_work_func(strstatic DEFINE_MUTEX (acpi_wakeup_lock);static int __acpi_device_wakeup_enable (struct acpi_device *adev, -u32 target_state,int max_count) +u32 target_state) {struct acpi_device_wakeup *wakeup = &adev->wakeup;acpi_status status;
@@ -702,9 +702,10 @@ static int __acpi_device_wakeup_enable(smutex_lock (&acpi_wakeup_lock); -if (wakeup->enable_count >= max_count) +if (wakeup->enable_count >=INT_MAX ) { +acpi_handle_info (adev->handle,"Wakeup enable count out of bounds!\n" ); goto out; - + }if (wakeup->enable_count >0 ) goto inc;
@@ -741,7 +742,7 @@ out:*/ static int acpi_device_wakeup_enable (struct acpi_device *adev,u32 target_state) { -return __acpi_device_wakeup_enable (adev, target_state,1 ); +return __acpi_device_wakeup_enable (adev, target_state); }/**
@@ -771,8 +772,12 @@ out:mutex_unlock (&acpi_wakeup_lock); } -static int __acpi_pm_set_device_wakeup (struct device *dev,bool enable, -int max_count) +/** +* acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device. +* @dev: Device to enable/disable to generate wakeup events. +* @enable: Whether to enable or disable the wakeup functionality. +*/ +int acpi_pm_set_device_wakeup (struct device *dev,bool enable) {struct acpi_device *adev;int error;
@@ -792,37 +797,15 @@ static int __acpi_pm_set_device_wakeup(sreturn 0 ; } - error =__acpi_device_wakeup_enable (adev,acpi_target_system_state (), - max_count); + error =__acpi_device_wakeup_enable (adev,acpi_target_system_state ());if (!error)dev_dbg (dev,"Wakeup enabled by ACPI\n" );return error; } - -/** -* acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device. -* @dev: Device to enable/disable to generate wakeup events. -* @enable: Whether to enable or disable the wakeup functionality. -*/ -int acpi_pm_set_device_wakeup (struct device *dev,bool enable) -{ -return __acpi_pm_set_device_wakeup (dev, enable,1 ); -}EXPORT_SYMBOL_GPL (acpi_pm_set_device_wakeup);/** -* acpi_pm_set_bridge_wakeup - Enable/disable remote wakeup for given bridge. -* @dev: Bridge device to enable/disable to generate wakeup events. -* @enable: Whether to enable or disable the wakeup functionality. -*/ -int acpi_pm_set_bridge_wakeup (struct device *dev,bool enable) -{ -return __acpi_pm_set_device_wakeup (dev, enable,INT_MAX ); -} -EXPORT_SYMBOL_GPL (acpi_pm_set_bridge_wakeup); - -/** * acpi_dev_pm_low_power - Put ACPI device into a low-power state. * @dev: Device to put into a low-power state. * @adev: ACPI device node corresponding to @dev.
drivers/pci/pci-acpi.c +2 -2
@@ -573,7 +573,7 @@ static int acpi_pci_propagate_wakeup(str {while (bus->parent) {if (acpi_pm_device_can_wakeup (&bus->self->dev)) -return acpi_pm_set_bridge_wakeup (&bus->self->dev, enable); +return acpi_pm_set_device_wakeup (&bus->self->dev, enable); bus = bus->parent; }
@@ -581,7 +581,7 @@ static int acpi_pci_propagate_wakeup(str/* We have reached the root bus. */ if (bus->bridge) {if (acpi_pm_device_can_wakeup (bus->bridge)) -return acpi_pm_set_bridge_wakeup (bus->bridge, enable); +return acpi_pm_set_device_wakeup (bus->bridge, enable); }return 0 ; }
include/acpi/acpi_bus.h +0 -5
@@ -619,7 +619,6 @@ acpi_status acpi_remove_pm_notifier(strubool acpi_pm_device_can_wakeup (struct device *dev);int acpi_pm_device_sleep_state (struct device *,int *,int );int acpi_pm_set_device_wakeup (struct device *dev,bool enable); -int acpi_pm_set_bridge_wakeup (struct device *dev,bool enable);#else static inline void acpi_pm_wakeup_event (struct device *dev) {
@@ -650,10 +649,6 @@ static inline int acpi_pm_set_device_wak {return -ENODEV ; } -static inline int acpi_pm_set_bridge_wakeup (struct device *dev,bool enable) -{ -return -ENODEV ; -}#endif #ifdef CONFIG_ACPI_SLEEP
Greg Kroah-Hartman
maintainerPATCH 186/242 Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
In reply to Greg Kroah-HartmanFrom: Daniel Scally <[email protected]>
commit 12fc4dad94dfac25599f31257aac181c691ca96f upstream.
This reverts commit 8a66790b7850a6669129af078768a1d42076a0ef.
Switching this function to AE_CTRL_TERMINATE broke the documented behaviour of acpi_dev_get_resources() - AE_CTRL_TERMINATE does not, in fact, terminate the resource walk because acpi_walk_resource_buffer() ignores it (specifically converting it to AE_OK), referring to that value as "an OK termination by the user function". This means that acpi_dev_get_resources() does not abort processing when the preproc function returns a negative value.
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/resource.c +1 -1
@@ -548,7 +548,7 @@ static acpi_status acpi_dev_process_reso ret = c->preproc (ares, c->preproc_data);if (ret <0 ) { c->error = ret; -return AE_CTRL_TERMINATE ; +return AE_ABORT_METHOD ; }else if (ret >0 ) {return AE_OK ; }
Greg Kroah-Hartman
maintainerPATCH 187/242 ACPI: PNP: compare the string length in the matching_id()
In reply to Greg Kroah-HartmanFrom: Hui Wang <[email protected]>
commit b08221c40febcbda9309dd70c61cf1b0ebb0e351 upstream.
Recently we met a touchscreen problem on some Thinkpad machines, the touchscreen driver (i2c-hid) is not loaded and the touchscreen can't work.
An i2c ACPI device with the name WACF2200 is defined in the BIOS, with the current rule in matching_id(), this device will be regarded as a PNP device since there is WACFXXX in the acpi_pnp_device_ids[] and this PNP device is attached to the acpi device as the 1st physical_node, this will make the i2c bus match fail when i2c bus calls acpi_companion_match() to match the acpi_id_table in the i2c-hid driver.
WACF2200 is an i2c device instead of a PNP device, after adding the string length comparing, the matching_id() will return false when matching WACF2200 and WACFXXX, and it is reasonable to compare the string length when matching two IDs.
--- drivers/acpi/acpi_pnp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/acpi_pnp.c +3 -0
@@ -320,6 +320,9 @@ static bool matching_id(const char *idst {int i; +if (strlen (idstr) !=strlen (list_id)) +return false; +if (memcmp (idstr, list_id,3 ))return false;
Greg Kroah-Hartman
maintainerPATCH 188/242 ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
In reply to Greg Kroah-HartmanFrom: Chris Chiu <[email protected]>
commit 7e413528474d5895e3e315c019fb0c43522eb6d9 upstream.
The ASUS laptop Q524UQK with ALC255 codec can't detect the headset microphone until ALC255_FIXUP_ASUS_MIC_NO_PRESENCE quirk applied.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -6590,6 +6590,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1043 ,0x1b13 ,"Asus U41SV" ,ALC269_FIXUP_INV_DMIC ),SND_PCI_QUIRK (0x1043 ,0x1bbd ,"ASUS Z550MA" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x1c23 ,"Asus X55U" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ), +SND_PCI_QUIRK (0x1043 ,0x125e ,"ASUS Q524UQK" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x1ccd ,"ASUS X555UB" ,ALC256_FIXUP_ASUS_MIC ),SND_PCI_QUIRK (0x1043 ,0x3030 ,"ASUS ZN270IE" ,ALC256_FIXUP_ASUS_AIO_GPIO2 ), SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),