4.19.2-stable review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 4.19.2-stable review
This is the start of the stable review cycle for the 4.19.2 release. There are 361 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 Tue Nov 13 22:14:55 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.2-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.19.2-rc1
Takashi Iwai <[email protected]>
vga_switcheroo: Fix missing gpu_bound call at audio client registration
Daniel Colascione <[email protected]>
bpf: wait for running BPF programs when updating map-in-map
Jann Horn <[email protected]>
userns: also map extents in the reverse map to kernel IDs
Mikulas Patocka <[email protected]>
vt: fix broken display when running aptitude
David Ahern <[email protected]>
net: sched: Remove TCA_OPTIONS from policy
Filipe Manana <[email protected]>
Btrfs: fix use-after-free when dumping free space
Filipe Manana <[email protected]>
Btrfs: fix use-after-free during inode eviction
Josef Bacik <[email protected]>
btrfs: move the dio_sem higher up the callchain
Josef Bacik <[email protected]>
btrfs: don't run delayed_iputs in commit
Josef Bacik <[email protected]>
btrfs: fix insert_reserved error handling
Josef Bacik <[email protected]>
btrfs: only free reserved extent if we didn't insert it
Josef Bacik <[email protected]>
btrfs: don't use ctl->free_space for max_extent_size
Josef Bacik <[email protected]>
btrfs: set max_extent_size properly
Josef Bacik <[email protected]>
btrfs: reset max_extent_size properly
Filipe Manana <[email protected]>
Btrfs: fix deadlock when writing out free space caches
Filipe Manana <[email protected]>
Btrfs: fix assertion on fsync of regular file when using no-holes feature
Filipe Manana <[email protected]>
Btrfs: fix null pointer dereference on compressed write path error
Qu Wenruo <[email protected]>
btrfs: qgroup: Dirty all qgroups before rescan
Filipe Manana <[email protected]>
Btrfs: fix wrong dentries after fsync of file that got its parent replaced
Filipe Manana <[email protected]>
Btrfs: fix warning when replaying log after fsync of a tmpfile
Josef Bacik <[email protected]>
btrfs: make sure we create all new block groups
Josef Bacik <[email protected]>
btrfs: reset max_extent_size on clear in a bitmap
Josef Bacik <[email protected]>
btrfs: protect space cache inode alloc with GFP_NOFS
Josef Bacik <[email protected]>
btrfs: release metadata before running delayed refs
Chris Mason <[email protected]>
Btrfs: don't clean dirty pages during buffered writes
Josef Bacik <[email protected]>
btrfs: wait on caching when putting the bg cache
Jeff Mahoney <[email protected]>
btrfs: keep trim from interfering with transaction commits
Jeff Mahoney <[email protected]>
btrfs: don't attempt to trim devices that don't support it
Jeff Mahoney <[email protected]>
btrfs: iterate all devices during trim, instead of fs_devices::alloc_list
Qu Wenruo <[email protected]>
btrfs: Ensure btrfs_trim_fs can trim the whole filesystem
Qu Wenruo <[email protected]>
btrfs: Enhance btrfs_trim_fs function to handle error better
Jeff Mahoney <[email protected]>
btrfs: fix error handling in btrfs_dev_replace_start
Jeff Mahoney <[email protected]>
btrfs: fix error handling in free_log_tree
Qu Wenruo <[email protected]>
btrfs: locking: Add extra check in btrfs_init_new_buffer() to avoid deadlock
Qu Wenruo <[email protected]>
btrfs: Handle owner mismatch gracefully when walking up tree
Qu Wenruo <[email protected]>
btrfs: qgroup: Avoid calling qgroup functions if qgroup is not enabled
Masami Hiramatsu <[email protected]>
tracing: Return -ENOENT if there is no target synthetic event
Breno Leitao <[email protected]>
selftests/powerpc: Fix ptrace tm failure
Masami Hiramatsu <[email protected]>
selftests/ftrace: Fix synthetic event test to delete event correctly
Johan Hovold <[email protected]>
soc/tegra: pmc: Fix child-node lookup
Bjorn Andersson <[email protected]>
soc: qcom: rmtfs-mem: Validate that scm is available
Thor Thayer <[email protected]>
arm64: dts: stratix10: Correct System Manager register size
Thor Thayer <[email protected]>
ARM: dts: socfpga: Fix SDRAM node address for Arria10
Nicolas Pitre <[email protected]>
Cramfs: fix abad comparison when wrap-arounds occur
Colin Ian King <[email protected]>
rpmsg: smd: fix memory leak on channel create
Tri Vo <[email protected]>
arm64: lse: remove -fcall-used-x0 flag
Hans Verkuil <[email protected]>
media: hdmi.h: rename ADOBE_RGB to OPRGB and ADOBE_YCC to OPYCC
Hans Verkuil <[email protected]>
media: replace ADOBERGB by OPRGB
Hans Verkuil <[email protected]>
media: media colorspaces*.rst: rename AdobeRGB to opRGB
Johan Hovold <[email protected]>
drm/mediatek: fix OF sibling-node lookup
Hans Verkuil <[email protected]>
media: adv7842: when the EDID is cleared, unconfigure CEC as well
Hans Verkuil <[email protected]>
media: adv7604: when the EDID is cleared, unconfigure CEC as well
Mauro Carvalho Chehab <[email protected]>
media: em28xx: fix handler for vidioc_s_input()
Mauro Carvalho Chehab <[email protected]>
media: em28xx: make v4l2-compliance happier by starting sequence on zero
Mauro Carvalho Chehab <[email protected]>
media: em28xx: fix input name for Terratec AV 350
Mauro Carvalho Chehab <[email protected]>
media: tvp5150: avoid going past array on v4l2_querymenu()
Mauro Carvalho Chehab <[email protected]>
media: em28xx: use a default format if TRY_FMT fails
Hans Verkuil <[email protected]>
media: cec: forgot to cancel delayed work
Hans Verkuil <[email protected]>
media: cec: fix the Signal Free Time calculation
Hans Verkuil <[email protected]>
media: cec: add new tx/rx status bits to detect aborts/timeouts
Manjunath Patil <[email protected]>
xen-blkfront: fix kernel panic with negotiate_mq error path
Juergen Gross <[email protected]>
xen: remove size limit of privcmd-buf mapping interface
Juergen Gross <[email protected]>
xen: fix xen_qlock_wait()
Hans Verkuil <[email protected]>
media: cec: integrate cec_validate_phys_addr() in cec-api.c
Hans Verkuil <[email protected]>
media: cec: make cec_get_edid_spa_location() an inline function
Bjorn Andersson <[email protected]>
remoteproc: qcom: q6v5: Propagate EPROBE_DEFER
He Zhe <[email protected]>
kgdboc: Passing ekgdboc to command line causes panic
Mauro Carvalho Chehab <[email protected]>
Revert "media: dvbsky: use just one mutex for serializing device R/W ops"
Hans Verkuil <[email protected]>
media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD
Johan Hovold <[email protected]>
net: bcmgenet: fix OF child-node lookup
Maciej W. Rozycki <[email protected]>
TC: Set DMA masks for devices
Will Deacon <[email protected]>
iommu/arm-smmu: Ensure that page-table updates are visible before TLBI
Christophe Lombard <[email protected]>
ocxl: Fix access to the AFU Descriptor Data
Johan Hovold <[email protected]>
power: supply: twl4030-charger: fix OF sibling-node lookup
Maciej W. Rozycki <[email protected]>
rtc: cmos: Remove the `use_acpi_alarm' module parameter for !ACPI
Maciej W. Rozycki <[email protected]>
rtc: cmos: Fix non-ACPI undefined reference to `hpet_rtc_interrupt'
Soeren Moch <[email protected]>
rtc: ds1307: fix ds1339 wakealarm support
Aaro Koskinen <[email protected]>
MIPS: OCTEON: fix out of bounds array access on CN68XX
Nicholas Piggin <[email protected]>
powerpc/64s/hash: Do not use PPC_INVALIDATE_ERAT on CPUs before POWER9
Michael Neuling <[email protected]>
powerpc/tm: Fix HFSCR bit for no suspend case
Christophe Leroy <[email protected]>
powerpc/msi: Fix compile error on mpc83xx
Naveen N. Rao <[email protected]>
powerpc64/module elfv1: Set opd addresses after module relocation
Jan Kara <[email protected]>
fsnotify: Fix busy inodes during unmount
Lubomir Rintel <[email protected]>
media: ov7670: make "xclk" clock optional
Damien Le Moal <[email protected]>
dm zoned: fix various dmz_get_mblock() issues
Damien Le Moal <[email protected]>
dm zoned: fix metadata block ref counting
Wenwen Wang <[email protected]>
dm ioctl: harden copy_params()'s copy_from_user() from malicious users
Amir Goldstein <[email protected]>
lockd: fix access beyond unterminated strings in prints
Trond Myklebust <[email protected]>
nfsd: Fix an Oops in free_session()
Andrew Elble <[email protected]>
nfsd: correctly decrement odstate refcount in error path
Benjamin Coddington <[email protected]>
nfs: Fix a missed page unlock after pg_doio()
Trond Myklebust <[email protected]>
NFSv4.1: Fix the r/wsize checking
Johan Hovold <[email protected]>
NFC: nfcmrvl_uart: fix OF child-node lookup
Jarkko Sakkinen <[email protected]>
tpm: fix response size validation in tpm_get_random()
Lukas Wunner <[email protected]>
genirq: Fix race on spurious interrupt detection
He Zhe <[email protected]>
printk: Fix panic caused by passing log_buf_len to command line
Steve French <[email protected]>
smb3: on kerberos mount if server doesn't specify auth type use krb5
Steve French <[email protected]>
smb3: do not attempt cifs operation in smb3 query info error path
Steve French <[email protected]>
smb3: allow stats which track session and share reconnects to be reset
Andreas Kemnade <[email protected]>
w1: omap-hdq: fix missing bus unregister at removal
Eugen Hristev <[email protected]>
iio: adc: at91: fix wrong channel number in triggered buffer mode
Eugen Hristev <[email protected]>
iio: adc: at91: fix acking DRDY irq on simple conversions
Alexey Khoroshilov <[email protected]>
iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs()
Lars-Peter Clausen <[email protected]>
iio: ad5064: Fix regulator handling
Arnd Bergmann <[email protected]>
kbuild: fix kernel/bounds.c 'W=1' warning
Mark Rutland <[email protected]>
KVM: arm64: Fix caching of host MDCR_EL2 value
Punit Agrawal <[email protected]>
KVM: arm/arm64: Ensure only THP is candidate for adjustment
Ralph Campbell <[email protected]>
mm/hmm: fix race between hmm_mirror_unregister() and mmu_notifier callback
Ralph Campbell <[email protected]>
mm/rmap: map_pte() was not handling private ZONE_DEVICE page properly
Mike Kravetz <[email protected]>
hugetlbfs: dirty pages as they are added to pagecache
Goldwyn Rodrigues <[email protected]>
ima: open a new file instance if no read permissions
Eric Biggers <[email protected]>
ima: fix showing large 'violations' or 'runtime_measurements_count'
Christoph Hellwig <[email protected]>
userfaultfd: disable irqs when taking the waitqueue lock
Vlastimil Babka <[email protected]>
mm: /proc/pid/smaps_rollup: fix NULL pointer deref in smaps_pte_range()
Jason A. Donenfeld <[email protected]>
crypto: speck - remove Speck
Ard Biesheuvel <[email protected]>
crypto: aegis/generic - fix for big endian systems
Ard Biesheuvel <[email protected]>
crypto: morus/generic - fix for big endian systems
Mikulas Patocka <[email protected]>
crypto: aesni - don't use GFP_ATOMIC allocation if the request doesn't cross a page in gcm
Horia Geantă <[email protected]>
crypto: tcrypt - fix ghash-generic speed test
Ondrej Mosnacek <[email protected]>
crypto: lrw - Fix out-of bounds access on counter overflow
Eric W. Biederman <[email protected]>
signal: Guard against negative signal numbers in copy_siginfo_from_user32
Eric W. Biederman <[email protected]>
signal/GenWQE: Fix sending of SIGKILL
Bin Meng <[email protected]>
PCI: Add Device IDs for Intel GPU "spurious interrupt" quirk
Lukas Wunner <[email protected]>
PCI/ASPM: Fix link_state teardown on device removal
Vignesh R <[email protected]>
ARM: dts: dra7: Fix up unaligned access setting for PCIe EP
Qiuxu Zhuo <[email protected]>
EDAC, skx_edac: Fix logical channel intermediate decoding
Tony Luck <[email protected]>
EDAC, {i7core,sb,skx}_edac: Fix uncorrected error counting
Michael Jin <[email protected]>
EDAC, amd64: Add Family 17h, models 10h-2fh support
Breno Leitao <[email protected]>
HID: hiddev: fix potential Spectre v1
Jason Gerecke <[email protected]>
HID: wacom: Work around HID descriptor bug in DTK-2451 and DTH-2452
Stephen Smalley <[email protected]>
selinux: fix mounting of cgroup2 under older policies
Theodore Ts'o <[email protected]>
ext4: fix use-after-free race in ext4_remount()'s error path
Wang Shilong <[email protected]>
ext4: propagate error from dquot_initialize() in EXT4_IOC_FSSETXATTR
Wang Shilong <[email protected]>
ext4: fix setattr project check in fssetxattr ioctl
Lukas Czerner <[email protected]>
ext4: initialize retries variable in ext4_da_write_inline_data_begin()
Theodore Ts'o <[email protected]>
ext4: fix EXT4_IOC_SWAP_BOOT
Al Viro <[email protected]>
gfs2_meta: ->mount() can get NULL dev_name
Jan Kara <[email protected]>
jbd2: fix use after free in jbd2_log_do_checkpoint()
Jason Gunthorpe <[email protected]>
IB/rxe: Revise the ib_wr_opcode enum
Artemy Kovalyov <[email protected]>
IB/mlx5: Fix MR cache initialization
Daniel Mack <[email protected]>
ASoC: sta32x: set ->component pointer in private struct
Takashi Iwai <[email protected]>
ASoC: intel: skylake: Add missing break in skl_tplg_get_token()
Dan Williams <[email protected]>
libnvdimm, pmem: Fix badblocks population for 'raw' namespaces
Dan Williams <[email protected]>
libnvdimm, region: Fail badblocks listing for inactive regions
Alexander Duyck <[email protected]>
libnvdimm: Hold reference on parent while scheduling async init
Nicholas Bellinger <[email protected]>
scsi: target: Fix target_wait_for_sess_cmds breakage with active signals
Nicholas Bellinger <[email protected]>
scsi: sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage
Christian Lamparter <[email protected]>
dmaengine: ppc4xx: fix off-by-one build failure
Stefan Nuernberger <[email protected]>
net/ipv4: defensive cipso option parsing
Luca Coelho <[email protected]>
iwlwifi: mvm: check return value of rs_rate_from_ucode_rate()
Felix Fietkau <[email protected]>
mt76: mt76x2: fix multi-interface beacon configuration
Yoshihiro Shimoda <[email protected]>
usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround"
Adam Thomson <[email protected]>
usb: typec: tcpm: Fix APDO PPS order checking to be based on voltage
Shuah Khan (Samsung OSG) <[email protected]>
usbip:vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten
Lubomir Rintel <[email protected]>
libertas: don't set URB_ZERO_PACKET on IN USB transfer
Juergen Gross <[email protected]>
xen/pvh: don't try to unplug emulated devices
Roger Pau Monne <[email protected]>
xen/pvh: increase early stack size
Juergen Gross <[email protected]>
xen: make xen_qlock_wait() nestable
Juergen Gross <[email protected]>
xen: fix race in xen_qlock_wait()
Boris Ostrovsky <[email protected]>
xen/balloon: Support xend-based toolstack
Vasilis Liaskovitis <[email protected]>
xen/blkfront: avoid NULL blkfront_info dereference on device removal
Dr. Greg Wettstein <[email protected]>
tpm: Restore functionality to xen vtpm driver.
Joe Jin <[email protected]>
xen-swiotlb: use actually allocated size on check physical continuous
Marek Szyprowski <[email protected]>
ARM: dts: exynos: Mark 1 GHz CPU OPP as suspend OPP on Exynos5250
Marek Szyprowski <[email protected]>
ARM: dts: exynos: Convert exynos5250.dtsi to opp-v2 bindings
Viresh Kumar <[email protected]>
OPP: Free OPP table properly on performance state irregularities
Chao Yu <[email protected]>
f2fs: fix to account IO correctly
Chao Yu <[email protected]>
f2fs: fix to recover cold bit of inode block during POR
Jaegeuk Kim <[email protected]>
f2fs: fix missing up_read
Jaegeuk Kim <[email protected]>
Revert "f2fs: fix to clear PG_checked flag in set_page_dirty()"
Prarit Bhargava <[email protected]>
cpupower: Fix AMD Family 0x17 msr_pstate size
Takashi Iwai <[email protected]>
ALSA: hda: Check the non-cached stream buffers more explicitly
Vijay Immanuel <[email protected]>
IB/rxe: fix for duplicate request processing and ack psns
Paul Cercueil <[email protected]>
dmaengine: dma-jz4780: Return error if not probed from DT
Alexandre Belloni <[email protected]>
mfd: menelaus: Fix possible race condition and leak
Chao Yu <[email protected]>
f2fs: fix to flush all dirty inodes recovered in readonly fs
Eric W. Biederman <[email protected]>
signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init
Yunlei He <[email protected]>
f2fs: report error if quota off error during umount
Zhikang Zhang <[email protected]>
f2fs: avoid sleeping under spin_lock
James Smart <[email protected]>
scsi: lpfc: Correct race with abort on completion path
James Smart <[email protected]>
scsi: lpfc: Correct soft lockup when running mds diagnostics
Alexandre Belloni <[email protected]>
uio: ensure class is registered before devices
Moni Shoua <[email protected]>
IB/mlx5: Allow transition of DCI QP to reset
Arseny Maslennikov <[email protected]>
IB/ipoib: Use dev_port to expose network interface port numbers
Stephen Boyd <[email protected]>
firmware: coreboot: Unmap ioregion after device population
Akshu Agrawal <[email protected]>
ASoC: AMD: Fix capture unstable in beginning for some runs
Waiman Long <[email protected]>
driver/dma/ioat: Call del_timer_sync() without holding prep_lock
Casey Schaufler <[email protected]>
Smack: ptrace capability use fixes
Loic Poulain <[email protected]>
usb: chipidea: Prevent unbalanced IRQ disable
Horia Geantă <[email protected]>
crypto: caam - fix implicit casts in endianness helpers
Vignesh R <[email protected]>
PCI: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode
Suzuki K Poulose <[email protected]>
coresight: etb10: Fix handling of perf mode
Tonghao Zhang <[email protected]>
PCI/MSI: Warn and return error if driver enables MSI/MSI-X twice
Chao Yu <[email protected]>
f2fs: fix to recover inode's i_flags during POR
Chao Yu <[email protected]>
f2fs: fix to recover inode's crtime during POR
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix recursive mailbox timeout
Anshuman Gupta <[email protected]>
xhci: Avoid USB autosuspend when resuming USB2 ports.
Bartosz Golaszewski <[email protected]>
nvmem: check the return value of nvmem_add_cells()
Alan Douglas <[email protected]>
PCI: cadence: Correct probe behaviour when failing to get PHY
Shaohua Li <[email protected]>
MD: fix invalid stored role for a disk
Theodore Ts'o <[email protected]>
ext4: fix argument checking in EXT4_IOC_MOVE_EXT
Alexandre Belloni <[email protected]>
usb: gadget: udc: atmel: handle at91sam9rl PMC
Fabrice Gasnier <[email protected]>
usb: dwc2: fix a race with external vbus supply
Fabrice Gasnier <[email protected]>
usb: dwc2: fix call to vbus supply exit routine, call it unlocked
Lina Iyer <[email protected]>
irqchip/pdc: Setup all edge interrupts as rising edge at GIC
Chuck Lever <[email protected]>
xprtrdma: Reset credit grant properly after a disconnect
Mika Westerberg <[email protected]>
PCI / ACPI: Enable wake automatically for power managed bridges
Jorgen Hansen <[email protected]>
VMCI: Resource wildcard match fixed
Dexuan Cui <[email protected]>
Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask
Jaegeuk Kim <[email protected]>
f2fs: clear PageError on the read path
Javier Martinez Canillas <[email protected]>
tpm: suppress transmit cmd error logs when TPM 1.2 is disabled/deactivated
Adam Thomson <[email protected]>
usb: typec: tcpm: Report back negotiated PPS voltage and current
Alan Douglas <[email protected]>
PCI: cadence: Use AXI region 0 to signal interrupts from EP
Honghui Zhang <[email protected]>
PCI: mediatek: Fix mtk_pcie_find_port() endpoint/port matching logic
[email protected] <[email protected]>
usb: host: ohci-at91: fix request of irq for optional gpio
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Fix recursive lock warning in debug kernel
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Avoid accessing nq->bar_reg_iomem in failure case
Denis Drozdov <[email protected]>
IB/ipoib: Clear IPCB before icmp_send
Leon Romanovsky <[email protected]>
RDMA/cm: Respect returned status of cm_init_av_by_path
Parav Pandit <[email protected]>
RDMA/core: Do not expose unsupported counters
Wenwen Wang <[email protected]>
scsi: megaraid_sas: fix a missing-check bug
Jim Mattson <[email protected]>
KVM: nVMX: Clear reserved bits of #DB exit qualification
David Howells <[email protected]>
UAPI: ndctl: Fix g++-unsupported initialisation in headers
Evan Green <[email protected]>
scsi: ufs: Schedule clk gating work on correct queue
Finn Thain <[email protected]>
scsi: esp_scsi: Track residual for PIO transfers
Rob Herring <[email protected]>
of: Add missing exports of node name compare functions
Jack Wang <[email protected]>
md: fix memleak for mempool
Xiao Ni <[email protected]>
MD: Memory leak when flush bio size is zero
Chao Yu <[email protected]>
f2fs: fix to account IO correctly for cgroup writeback
Johan Hovold <[email protected]>
net: stmmac: dwmac-sun8i: fix OF child-node lookup
Michal Hocko <[email protected]>
cgroup, netclassid: add a preemption point to write_classid
Ronnie Sahlberg <[email protected]>
cifs: fix a credits leak for compund commands
Geert Uytterhoeven <[email protected]>
thermal: da9062/61: Prevent hardware access during system suspend
Geert Uytterhoeven <[email protected]>
thermal: rcar_thermal: Prevent doing work after unbind
Diego Viola <[email protected]>
libata: Apply NOLPM quirk for SAMSUNG MZ7TD256HAFV-000L9
Martin Willi <[email protected]>
ath10k: schedule hardware restart if WMI command times out
Maya Erez <[email protected]>
wil6210: fix RX buffers release and unmap
Sebastian Basierski <[email protected]>
ixgbevf: VF2VF TCP RSS
Shannon Nelson <[email protected]>
ixgbe: disallow IPsec Tx offload when in SR-IOV mode
Justin Chen <[email protected]>
gpio: brcmstb: allow 0 width GPIO banks
Sara Sharon <[email protected]>
iwlwifi: mvm: fix BAR seq ctrl reporting
Dan Carpenter <[email protected]>
libertas_tf: prevent underflow in process_cmdrequest()
Siva Rebbagondla <[email protected]>
rsi: fix memory alignment issue in ARM32 platforms
Lorenzo Bianconi <[email protected]>
mt76x2u: run device cleanup routine if resume fails
Andrew Lunn <[email protected]>
net: dsa: mv88e6xxx: Fix writing to a PHY page.
Yunsheng Lin <[email protected]>
net: hns3: Fix for vf vlan delete failed problem
Yunsheng Lin <[email protected]>
net: hns3: Fix ping exited problem when doing lp selftest
Yunsheng Lin <[email protected]>
net: hns3: Preserve vlan 0 in hardware table
Douglas Anderson <[email protected]>
pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant
Douglas Anderson <[email protected]>
pinctrl: spmi-mpp: Fix pmic_mpp_config_get() to be compliant
Arnaldo Carvalho de Melo <[email protected]>
perf tests: Fix record+probe_libc_inet_pton.sh without ping's debuginfo
YueHaibing <[email protected]>
failover: Add missing check to validate 'slave_dev' in net_failover_slave_unregister
Alexei Starovoitov <[email protected]>
bpf/verifier: fix verifier instability
Stephen Boyd <[email protected]>
pinctrl: qcom: spmi-mpp: Fix drive strength setting
Hans de Goede <[email protected]>
ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers
Linus Walleij <[email protected]>
spi: gpio: No MISO does not imply no RX
Masami Hiramatsu <[email protected]>
kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()
Will Deacon <[email protected]>
arm64: entry: Allow handling of undefined instructions from EL1
Paolo Valente <[email protected]>
block, bfq: correctly charge and reset entity service in all cases
Antoine Tenart <[email protected]>
net: phy: phylink: ensure the carrier is off when starting phylink
Fuyun Liang <[email protected]>
net: hns3: Set STATE_DOWN bit of hdev state when stopping net
Peng Li <[email protected]>
net: hns3: Check hdev state when getting link status
Arend van Spriel <[email protected]>
brcmfmac: fix for proper support of 160MHz bandwidth
YueHaibing <[email protected]>
pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux
YueHaibing <[email protected]>
pinctrl: sunxi: fix 'pctrl->functions' allocation in sunxi_pinctrl_build_state
Jian Shen <[email protected]>
net: hns3: Fix ets validate issue
Jian Shen <[email protected]>
net: hns3: Add nic state check before calling netif_tx_wake_queue
Ben Hutchings <[email protected]>
x86: boot: Fix EFI stub alignment
Hans de Goede <[email protected]>
efi/x86: Call efi_parse_options() from efi_main()
Balakrishna Godavarthi <[email protected]>
Bluetooth: hci_qca: Remove hdev dereference in qca_close().
Christian Hewitt <[email protected]>
Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth
Yunsheng Lin <[email protected]>
net: hns3: Fix for packet buffer setting bug
Jacob Keller <[email protected]>
ice: update fw version check logic
Bruce Allan <[email protected]>
ice: fix changing of ring descriptor size (ethtool -G)
Will Deacon <[email protected]>
signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
Rakesh Pillai <[email protected]>
ath10k: fix tx status flag setting for management frames
James Smart <[email protected]>
nvme: call nvme_complete_rq when nvmf_check_ready fails for mpath I/O
Gustavo A. R. Silva <[email protected]>
mtd: rawnand: atmel: Fix potential NULL pointer dereference
Xiaochen Shen <[email protected]>
x86/intel_rdt: Show missing resctrl mount options
Viresh Kumar <[email protected]>
cpufreq: dt: Try freeing static OPPs only if we have added them
Dou Liyang <[email protected]>
ACPI / processor: Fix the return value of acpi_processor_ids_walk()
Rajneesh Bhardwaj <[email protected]>
ACPI / PM: LPIT: Register sysfs attributes based on FADT
Jeffrey Hugo <[email protected]>
ACPI/PPTT: Handle architecturally unknown cache types
Sagi Grimberg <[email protected]>
nvmet-rdma: use a private workqueue for delete
Tony Lindgren <[email protected]>
wlcore: Fix BUG with clear completion on timeout
Lubomir Rintel <[email protected]>
x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC
Luca Coelho <[email protected]>
iwlwifi: mvm: check for n_profiles validity in EWRD ACPI
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: clear HW_RESTART_REQUESTED when stopping the interface
Shaul Triebitz <[email protected]>
iwlwifi: pcie: avoid empty free RB queue
Masahiro Yamada <[email protected]>
mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES register to 8 if unset
Wang Dongsheng <[email protected]>
sdhci: acpi: add free_slot callback
Yu Zhao <[email protected]>
mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01
Ben Peddell <[email protected]>
bcache: Populate writeback_rate_minimum attribute
Prarit Bhargava <[email protected]>
cpupower: Fix coredump on VMWare
Sanskriti Sharma <[email protected]>
perf strbuf: Match va_{add,copy} with va_end
Sanskriti Sharma <[email protected]>
perf tools: Free 'printk' string in parse_ftrace_printk()
Sanskriti Sharma <[email protected]>
perf tools: Cleanup trace-event-info 'tdata' leak
Sanskriti Sharma <[email protected]>
perf tools: Free temporary 'sys' string in read_event_files()
Nathan Chancellor <[email protected]>
spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare}Javier González <[email protected]>
lightnvm: pblk: fix race condition on metadata I/O
Jia-Ju Bai <[email protected]>
lightnvm: pblk: fix two sleep-in-atomic-context bugs
Javier González <[email protected]>
lightnvm: pblk: fix race on sysfs line state
Thierry Reding <[email protected]>
hwmon: (pwm-fan) Set fan speed to 0 on suspend
Janosch Frank <[email protected]>
s390/sthyi: Fix machine name validity indication
Serhey Popovych <[email protected]>
tun: Consistently configure generic netdev params via rtnetlink
Ryan C Goodfellow <[email protected]>
nfp: devlink port split support for 1x100G CXP NIC
Haiyang Zhang <[email protected]>
hv_netvsc: fix vf serial matching with pci slot info
Suzuki K Poulose <[email protected]>
arm64: cpufeature: ctr: Fix cpu capability check for late CPUs
Omar Sandoval <[email protected]>
swim: fix cleanup on setup error
Omar Sandoval <[email protected]>
ataflop: fix error handling during setup
Paolo Abeni <[email protected]>
netfilter: xt_nat: fix DNAT target for shifted portmap ranges
Waiman Long <[email protected]>
locking/lockdep: Fix debug_locks off performance problem
Eric Dumazet <[email protected]>
net: loopback: clear skb->tstamp before netif_rx()
Masahisa Kojima <[email protected]>
net: socionext: Reset tx queue in ndo_stop
Marek Szyprowski <[email protected]>
ARM: dts: exynos: Disable pull control for MAX8997 interrupts on Origen
Dave Jiang <[email protected]>
x86/numa_emulation: Fix uniform-split numa emulation
Sebastian Andrzej Siewior <[email protected]>
x86/mm/pat: Disable preemption around __flush_tlb_all()
Vitaly Kuznetsov <[email protected]>
x86/kvm/nVMX: allow bare VMXON state migration
He Zhe <[email protected]>
x86/corruption-check: Fix panic in memory_corruption_check() when boot option without value is provided
Juergen Gross <[email protected]>
x86/xen: Fix boot loader version reported for PVH guests
Jiri Kosina <[email protected]>
x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Takashi Iwai <[email protected]>
ALSA: hda - Fix incorrect clearance of thinkpad_acpi hooks
Alex Stanoev <[email protected]>
ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
Hans de Goede <[email protected]>
ALSA: hda: Add 2 more models to the power_save blacklist
Jeremy Cline <[email protected]>
ALSA: hda - Add mic quirk for the Lenovo G50-30 (17aa:3905)
Hui Wang <[email protected]>
ALSA: hda/realtek - Fix the problem of the front MIC on the Lenovo M715
Takashi Iwai <[email protected]>
ALSA: hda - Fix headphone pin config for ASUS G751
Takashi Iwai <[email protected]>
ALSA: hda - Add quirk for ASUS G751 laptop
Helge Deller <[email protected]>
parisc: Fix exported address of os_hpmc handler
Helge Deller <[email protected]>
parisc: Fix map_pages() to not overwrite existing pte entries
John David Anglin <[email protected]>
parisc: Fix address in HPMC IVA
David Arcari <[email protected]>
mailbox: PCC: handle parse error
Jan Glauber <[email protected]>
ipmi: Fix timer race with module unload
Masami Hiramatsu <[email protected]>
kprobes/x86: Use preempt_enable() in optimized_callback()
Dan Williams <[email protected]>
acpi, nfit: Fix Address Range Scrub completion tracking
Erik Schmauss <[email protected]>
ACPICA: AML Parser: fix parse loop to correctly skip erroneous extended opcodes
Erik Schmauss <[email protected]>
ACPICA: AML interpreter: add region addresses in global list during initialization
Bart Van Assche <[email protected]>
ACPI / OSL: Use 'jiffies' as the time bassis for acpi_os_get_timer()
Maciej S. Szmigiero <[email protected]>
pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges
He Zhe <[email protected]>
dma-mapping: fix panic caused by passing empty cma command line argument
Rafael J. Wysocki <[email protected]>
cpufreq: conservative: Take limits changes into account properly
Ming Lei <[email protected]>
block: make sure writesame bio is aligned with logical block size
Ming Lei <[email protected]>
block: make sure discard bio is aligned with logical block size
Jens Axboe <[email protected]>
block: setup bounce bio_sets properly
Hou Tao <[email protected]>
jffs2: free jffs2_sb_info through jffs2_kill_sb()
Dmitry Bazhenov <[email protected]>
hwmon: (pmbus) Fix page count auto-detection.
Tang Junhui <[email protected]>
bcache: fix miss key refill->end in writeback
Tang Junhui <[email protected]>
bcache: correct dirty data statistics
Tang Junhui <[email protected]>
bcache: fix ioctl in flash device
Tang Junhui <[email protected]>
bcache: trace missed reading by cache_missed
Rafał Miłecki <[email protected]>
spi: bcm-qspi: fix calculation of address length
Rafał Miłecki <[email protected]>
spi: bcm-qspi: switch back to reading flash using smaller chunks
Chuanhua Han <[email protected]>
spi: spi-mem: Adjust op len based on message/transfer size limitations
Ahmad Fatoum <[email protected]>
mtd: spi-nor: fsl-quadspi: Don't let -EINVAL on the bus
Mika Westerberg <[email protected]>
mtd: spi-nor: intel-spi: Add support for Intel Ice Lake SPI serial flash
Liu Xiang <[email protected]>
mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB
Ricardo Ribalda Delgado <[email protected]>
mtd: maps: gpio-addr-flash: Fix ioremapped size
Miquel Raynal <[email protected]>
mtd: rawnand: marvell: fix the IRQ handler complete() condition
Linus Walleij <[email protected]>
gpio: mxs: Get rid of external API call
Huacai Chen <[email protected]>
MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit
Daniel Borkmann <[email protected]>
bpf: fix partial copy of map_ptr when dst is scalar
-------------
Diffstat:
Documentation/filesystems/fscrypt.rst | 10 - Documentation/media/uapi/cec/cec-ioc-receive.rst | 25 +- Documentation/media/uapi/v4l/biblio.rst | 10 - Documentation/media/uapi/v4l/colorspaces-defs.rst | 8 +- .../media/uapi/v4l/colorspaces-details.rst | 13 +- Documentation/media/videodev2.h.rst.exceptions | 6 +- Makefile | 4 +- arch/arm/boot/dts/dra7.dtsi | 2 +- arch/arm/boot/dts/exynos4210-origen.dts | 9 + arch/arm/boot/dts/exynos5250.dtsi | 131 ++-- arch/arm/boot/dts/socfpga_arria10.dtsi | 2 +- arch/arm/crypto/Kconfig | 6 - arch/arm/crypto/Makefile | 2 - arch/arm/crypto/speck-neon-core.S | 434 ------------ arch/arm/crypto/speck-neon-glue.c | 288 -------- arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 2 +- arch/arm64/crypto/Kconfig | 6 - arch/arm64/crypto/Makefile | 3 - arch/arm64/crypto/speck-neon-core.S | 352 ---------- arch/arm64/crypto/speck-neon-glue.c | 282 -------- arch/arm64/kernel/cpufeature.c | 22 +- arch/arm64/kernel/entry.S | 2 +- arch/arm64/kernel/traps.c | 11 +- arch/arm64/lib/Makefile | 2 +- arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig | 1 - arch/m68k/configs/bvme6000_defconfig | 1 - arch/m68k/configs/hp300_defconfig | 1 - arch/m68k/configs/mac_defconfig | 1 - arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme147_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - arch/m68k/configs/q40_defconfig | 1 - arch/m68k/configs/sun3_defconfig | 1 - arch/m68k/configs/sun3x_defconfig | 1 - arch/mips/cavium-octeon/executive/cvmx-helper.c | 2 +- arch/mips/include/asm/processor.h | 2 +- arch/parisc/kernel/entry.S | 2 +- arch/parisc/kernel/hpmc.S | 3 +- arch/parisc/kernel/traps.c | 3 +- arch/parisc/mm/init.c | 8 +- arch/powerpc/include/asm/mpic.h | 7 + arch/powerpc/kernel/mce_power.c | 7 + arch/powerpc/kernel/module.c | 8 + arch/powerpc/kernel/module_64.c | 5 - arch/powerpc/kernel/setup_64.c | 18 +- arch/powerpc/mm/hash_native_64.c | 4 +- arch/s390/defconfig | 1 - arch/s390/kernel/sthyi.c | 8 +- arch/x86/boot/compressed/eboot.c | 10 + arch/x86/boot/tools/build.c | 7 + arch/x86/crypto/aesni-intel_glue.c | 2 +- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/include/asm/tlbflush.h | 6 + arch/x86/kernel/check.c | 15 + arch/x86/kernel/cpu/bugs.c | 57 +- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 7 + arch/x86/kernel/kprobes/opt.c | 2 +- arch/x86/kvm/vmx.c | 22 +- arch/x86/mm/numa_emulation.c | 12 +- arch/x86/mm/pageattr.c | 6 +- arch/x86/platform/olpc/olpc-xo1-rtc.c | 3 + arch/x86/xen/enlighten_pvh.c | 2 +- arch/x86/xen/platform-pci-unplug.c | 4 + arch/x86/xen/spinlock.c | 35 +- arch/x86/xen/xen-pvh.S | 2 +- block/bfq-wf2q.c | 13 +- block/blk-lib.c | 5 +- block/blk-merge.c | 3 +- block/blk.h | 10 + block/bounce.c | 37 +- crypto/Kconfig | 14 - crypto/Makefile | 1 - crypto/aegis.h | 20 +- crypto/lrw.c | 7 +- crypto/morus1280.c | 7 +- crypto/morus640.c | 16 +- crypto/speck.c | 307 --------- crypto/tcrypt.c | 3 + crypto/testmgr.c | 24 - crypto/testmgr.h | 738 --------------------- drivers/acpi/acpi_lpit.c | 6 + drivers/acpi/acpi_lpss.c | 2 + drivers/acpi/acpi_processor.c | 7 +- drivers/acpi/acpica/dsopcode.c | 4 + drivers/acpi/acpica/psloop.c | 14 +- drivers/acpi/nfit/core.c | 169 +++-- drivers/acpi/nfit/nfit.h | 10 +- drivers/acpi/osl.c | 15 +- drivers/acpi/pptt.c | 33 +- drivers/ata/libata-core.c | 1 + drivers/block/ataflop.c | 25 +- drivers/block/swim.c | 13 +- drivers/block/xen-blkfront.c | 4 + drivers/bluetooth/btbcm.c | 1 + drivers/bluetooth/hci_qca.c | 15 +- drivers/char/ipmi/ipmi_ssif.c | 10 +- drivers/char/tpm/tpm-interface.c | 6 +- drivers/char/tpm/tpm2-cmd.c | 4 +- drivers/char/tpm/xen-tpmfront.c | 2 +- drivers/cpufreq/cpufreq-dt.c | 34 +- drivers/cpufreq/cpufreq_conservative.c | 6 +- drivers/crypto/caam/regs.h | 28 +- drivers/dma/dma-jz4780.c | 5 + drivers/dma/ioat/init.c | 9 +- drivers/dma/ppc4xx/adma.c | 2 +- drivers/edac/amd64_edac.c | 14 + drivers/edac/amd64_edac.h | 3 + drivers/edac/i7core_edac.c | 1 + drivers/edac/sb_edac.c | 1 + drivers/edac/skx_edac.c | 3 +- drivers/firmware/google/coreboot_table.c | 7 +- drivers/gpio/gpio-brcmstb.c | 15 +- drivers/gpio/gpio-mxs.c | 4 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 +- drivers/gpu/vga/vga_switcheroo.c | 3 + drivers/hid/usbhid/hiddev.c | 18 +- drivers/hid/wacom_wac.c | 19 + drivers/hv/channel_mgmt.c | 14 +- drivers/hwmon/pmbus/pmbus.c | 2 + drivers/hwmon/pmbus/pmbus_core.c | 5 +- drivers/hwmon/pwm-fan.c | 12 +- drivers/hwtracing/coresight/coresight-etb10.c | 4 + drivers/iio/adc/at91_adc.c | 6 +- drivers/iio/adc/fsl-imx25-gcq.c | 6 + drivers/iio/dac/ad5064.c | 53 +- drivers/infiniband/core/cm.c | 7 +- drivers/infiniband/core/sysfs.c | 19 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 +- drivers/infiniband/hw/mlx5/mr.c | 2 +- drivers/infiniband/hw/mlx5/qp.c | 4 +- drivers/infiniband/sw/rxe/rxe_resp.c | 8 +- drivers/infiniband/sw/rxe/rxe_verbs.h | 2 + drivers/infiniband/ulp/ipoib/ipoib_cm.c | 8 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 + drivers/iommu/arm-smmu.c | 6 + drivers/irqchip/qcom-pdc.c | 1 + drivers/lightnvm/pblk-core.c | 5 +- drivers/lightnvm/pblk-recovery.c | 6 +- drivers/lightnvm/pblk-sysfs.c | 8 +- drivers/lightnvm/pblk-write.c | 14 +- drivers/mailbox/pcc.c | 7 +- drivers/md/bcache/btree.c | 2 +- drivers/md/bcache/request.c | 5 +- drivers/md/bcache/super.c | 7 +- drivers/md/bcache/sysfs.c | 2 + drivers/md/dm-ioctl.c | 18 +- drivers/md/dm-zoned-metadata.c | 80 ++- drivers/md/md.c | 30 +- drivers/media/cec/cec-adap.c | 94 +-- drivers/media/cec/cec-api.c | 19 +- drivers/media/cec/cec-edid.c | 60 -- drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c | 262 ++++---- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +- drivers/media/i2c/adv7511.c | 6 +- drivers/media/i2c/adv7604.c | 6 +- drivers/media/i2c/adv7842.c | 4 +- drivers/media/i2c/ov7670.c | 27 +- drivers/media/i2c/tc358743.c | 4 +- drivers/media/i2c/tvp5150.c | 2 +- drivers/media/platform/vivid/vivid-core.h | 2 +- drivers/media/platform/vivid/vivid-ctrls.c | 6 +- drivers/media/platform/vivid/vivid-vid-out.c | 2 +- drivers/media/usb/dvb-usb-v2/dvbsky.c | 16 +- drivers/media/usb/em28xx/em28xx-cards.c | 33 +- drivers/media/usb/em28xx/em28xx-video.c | 92 ++- drivers/media/usb/em28xx/em28xx.h | 8 +- drivers/media/v4l2-core/v4l2-dv-timings.c | 12 +- drivers/mfd/menelaus.c | 13 +- drivers/misc/genwqe/card_base.h | 2 +- drivers/misc/genwqe/card_dev.c | 9 +- drivers/misc/ocxl/config.c | 4 +- drivers/misc/vmw_vmci/vmci_driver.c | 2 +- drivers/misc/vmw_vmci/vmci_resource.c | 3 +- drivers/mmc/host/sdhci-acpi.c | 8 + drivers/mmc/host/sdhci-pci-o2micro.c | 3 + drivers/mtd/maps/gpio-addr-flash.c | 2 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 4 + drivers/mtd/nand/raw/denali.c | 14 +- drivers/mtd/nand/raw/marvell_nand.c | 2 +- drivers/mtd/spi-nor/fsl-quadspi.c | 15 +- drivers/mtd/spi-nor/intel-spi-pci.c | 1 + drivers/net/dsa/mv88e6xxx/phy.c | 3 + drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 +- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 6 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 30 +- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 + drivers/net/ethernet/intel/ice/ice.h | 4 +- drivers/net/ethernet/intel/ice/ice_controlq.c | 30 +- drivers/net/ethernet/intel/ice/ice_ethtool.c | 17 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 + drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 17 +- drivers/net/ethernet/socionext/netsec.c | 3 + drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 12 +- drivers/net/hyperv/netvsc_drv.c | 15 +- drivers/net/loopback.c | 4 + drivers/net/net_failover.c | 3 + drivers/net/phy/phylink.c | 3 + drivers/net/tun.c | 2 + drivers/net/wireless/ath/ath10k/wmi.c | 13 +- drivers/net/wireless/ath/wil6210/txrx_edma.c | 15 +- .../net/wireless/broadcom/brcm80211/brcmutil/d11.c | 34 +- .../broadcom/brcm80211/include/brcmu_wifi.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 24 +- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 9 +- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 32 +- drivers/net/wireless/marvell/libertas/if_usb.c | 2 - drivers/net/wireless/marvell/libertas_tf/if_usb.c | 5 +- drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 3 +- drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +- drivers/net/wireless/rsi/rsi_91x_usb.c | 11 +- drivers/net/wireless/ti/wlcore/main.c | 18 +- drivers/nfc/nfcmrvl/uart.c | 5 +- drivers/nvdimm/bus.c | 4 + drivers/nvdimm/pmem.c | 4 +- drivers/nvdimm/region_devs.c | 11 +- drivers/nvme/host/fabrics.c | 7 +- drivers/nvme/host/multipath.c | 7 + drivers/nvme/target/rdma.c | 19 +- drivers/nvmem/core.c | 10 +- drivers/of/base.c | 2 + drivers/opp/of.c | 1 + drivers/pci/controller/dwc/pci-dra7xx.c | 11 +- drivers/pci/controller/pcie-cadence-ep.c | 11 +- drivers/pci/controller/pcie-cadence.c | 20 +- drivers/pci/controller/pcie-mediatek.c | 11 + drivers/pci/msi.c | 9 +- drivers/pci/pci-acpi.c | 16 +- drivers/pci/pcie/aspm.c | 2 +- drivers/pci/quirks.c | 4 + drivers/pci/remove.c | 4 +- drivers/pcmcia/ricoh.h | 35 + drivers/pcmcia/yenta_socket.c | 3 +- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 27 +- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 28 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 15 +- drivers/power/supply/twl4030_charger.c | 5 +- drivers/remoteproc/qcom_q6v5.c | 12 + drivers/rpmsg/qcom_smd.c | 7 +- drivers/rtc/rtc-cmos.c | 29 +- drivers/rtc/rtc-ds1307.c | 1 - drivers/scsi/esp_scsi.c | 1 + drivers/scsi/esp_scsi.h | 2 + drivers/scsi/lpfc/lpfc_scsi.c | 14 +- drivers/scsi/lpfc/lpfc_sli.c | 7 + drivers/scsi/mac_esp.c | 2 + drivers/scsi/megaraid/megaraid_sas_base.c | 3 + drivers/scsi/qla2xxx/qla_mbx.c | 2 +- drivers/scsi/ufs/ufshcd.c | 5 +- drivers/soc/qcom/rmtfs_mem.c | 5 + drivers/soc/tegra/pmc.c | 2 +- drivers/spi/spi-bcm-qspi.c | 4 +- drivers/spi/spi-ep93xx.c | 36 +- drivers/spi/spi-gpio.c | 10 +- drivers/spi/spi-mem.c | 15 + drivers/target/target_core_transport.c | 4 +- drivers/tc/tc.c | 8 +- drivers/thermal/da9062-thermal.c | 4 +- drivers/thermal/rcar_thermal.c | 1 + drivers/tty/serial/kgdboc.c | 5 + drivers/tty/vt/vt.c | 2 +- drivers/uio/uio.c | 9 + drivers/usb/chipidea/otg.h | 3 +- drivers/usb/dwc2/hcd.c | 12 +- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 + drivers/usb/gadget/udc/renesas_usb3.c | 3 + drivers/usb/host/ohci-at91.c | 2 + drivers/usb/host/xhci-hub.c | 5 + drivers/usb/host/xhci-ring.c | 1 + drivers/usb/typec/tcpm.c | 10 +- drivers/usb/usbip/vudc_main.c | 10 +- drivers/video/hdmi.c | 8 +- drivers/w1/masters/omap_hdq.c | 2 + drivers/xen/privcmd-buf.c | 22 +- drivers/xen/swiotlb-xen.c | 6 + drivers/xen/xen-balloon.c | 13 +- fs/btrfs/ctree.c | 17 + fs/btrfs/dev-replace.c | 7 +- fs/btrfs/extent-tree.c | 168 +++-- fs/btrfs/file.c | 41 +- fs/btrfs/free-space-cache.c | 42 +- fs/btrfs/inode.c | 15 +- fs/btrfs/ioctl.c | 11 +- fs/btrfs/qgroup.c | 5 + fs/btrfs/qgroup.h | 2 + fs/btrfs/relocation.c | 2 +- fs/btrfs/transaction.c | 15 +- fs/btrfs/tree-log.c | 86 ++- fs/cifs/cifs_debug.c | 3 + fs/cifs/cifs_spnego.c | 6 +- fs/cifs/inode.c | 10 +- fs/cifs/transport.c | 57 +- fs/cramfs/inode.c | 3 +- fs/crypto/fscrypt_private.h | 4 - fs/crypto/keyinfo.c | 10 - fs/ext4/ext4.h | 3 +- fs/ext4/inline.c | 2 +- fs/ext4/ioctl.c | 97 ++- fs/ext4/move_extent.c | 8 +- fs/ext4/super.c | 73 +- fs/f2fs/checkpoint.c | 2 + fs/f2fs/data.c | 17 +- fs/f2fs/extent_cache.c | 51 +- fs/f2fs/f2fs.h | 8 +- fs/f2fs/inode.c | 6 + fs/f2fs/node.c | 13 +- fs/f2fs/recovery.c | 15 +- fs/f2fs/super.c | 22 +- fs/gfs2/ops_fstype.c | 3 + fs/jbd2/checkpoint.c | 4 +- fs/jffs2/super.c | 4 +- fs/lockd/host.c | 2 +- fs/nfs/nfs4client.c | 16 +- fs/nfs/pagelist.c | 40 +- fs/nfsd/nfs4state.c | 3 +- fs/notify/fsnotify.c | 3 + fs/notify/mark.c | 39 +- fs/proc/task_mmu.c | 4 +- fs/userfaultfd.c | 8 +- include/crypto/speck.h | 62 -- include/linux/bpf_verifier.h | 3 + include/linux/compat.h | 3 + include/linux/fs.h | 3 + include/linux/hdmi.h | 4 +- include/linux/nvme.h | 1 + include/linux/signal.h | 2 +- include/linux/tc.h | 1 + include/linux/wait.h | 20 +- include/media/cec.h | 72 +- include/rdma/ib_verbs.h | 34 +- include/uapi/linux/cec.h | 3 + include/uapi/linux/fs.h | 4 +- include/uapi/linux/ndctl.h | 48 +- include/uapi/linux/videodev2.h | 23 +- include/uapi/rdma/ib_user_verbs.h | 20 +- kernel/bounds.c | 4 +- kernel/bpf/syscall.c | 13 + kernel/bpf/verifier.c | 26 +- kernel/cpu.c | 11 +- kernel/dma/contiguous.c | 6 +- kernel/irq/manage.c | 8 +- kernel/kprobes.c | 27 +- kernel/locking/lockdep.c | 4 +- kernel/printk/printk.c | 7 +- kernel/signal.c | 18 +- kernel/trace/trace_events_hist.c | 4 +- kernel/user_namespace.c | 12 +- lib/debug_locks.c | 2 +- mm/hmm.c | 36 +- mm/hugetlb.c | 6 + mm/page_vma_mapped.c | 24 +- net/core/netclassid_cgroup.c | 1 + net/ipv4/cipso_ipv4.c | 11 +- net/netfilter/xt_nat.c | 2 + net/sched/sch_api.c | 1 - net/sunrpc/svc_xprt.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 + net/sunrpc/xprtrdma/transport.c | 6 + security/integrity/ima/ima_crypto.c | 54 +- security/integrity/ima/ima_fs.c | 6 +- security/selinux/hooks.c | 5 + security/smack/smack_lsm.c | 13 +- sound/pci/ca0106/ca0106.h | 2 +- sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_intel.c | 15 +- sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 26 + sound/pci/hda/thinkpad_helper.c | 4 +- sound/soc/amd/acp-pcm-dma.c | 22 +- sound/soc/codecs/sta32x.c | 3 + sound/soc/intel/skylake/skl-topology.c | 1 + .../tests/shell/record+probe_libc_inet_pton.sh | 2 +- tools/perf/util/strbuf.c | 10 +- tools/perf/util/trace-event-info.c | 2 + tools/perf/util/trace-event-parse.c | 1 + tools/perf/util/trace-event-read.c | 5 +- tools/power/cpupower/utils/cpufreq-info.c | 2 + tools/power/cpupower/utils/helpers/amd.c | 7 +- .../trigger-synthetic-event-createremove.tc | 12 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c | 4 +- virt/kvm/arm/arm.c | 4 +- virt/kvm/arm/mmu.c | 8 +- 389 files changed, 3294 insertions(+), 4066 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/361 bpf: fix partial copy of map_ptr when dst is scalar
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
commit 0962590e553331db2cc0aef2dc35c57f6300dbbe upstream.
ALU operations on pointers such as scalar_reg += map_value_ptr are handled in adjust_ptr_min_max_vals(). Problem is however that map_ptr and range in the register state share a union, so transferring state through dst_reg->range = ptr_reg->range is just buggy as any new map_ptr in the dst_reg is then truncated (or null) for subsequent checks. Fix this by adding a raw member and use it for copying state over to dst_reg.
--- include/linux/bpf_verifier.h | 3 +++ kernel/bpf/verifier.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
include/linux/bpf_verifier.h +3 -0
@@ -50,6 +50,9 @@ struct bpf_reg_state {* PTR_TO_MAP_VALUE_OR_NULL */ struct bpf_map *map_ptr; + +/* Max size from any of the above. */ +unsigned long raw; };/* Fixed part of pointer offset, pointer types only */ s32 off;
kernel/bpf/verifier.c +6 -4
@@ -2762,7 +2762,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, dst_reg->umax_value = umax_ptr; dst_reg->var_off = ptr_reg->var_off; dst_reg->off = ptr_reg->off + smin_val; - dst_reg->range = ptr_reg->range; + dst_reg->raw = ptr_reg->raw;break ; }/* A new variable offset is created. Note that off_reg->off
@@ -2792,10 +2792,11 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, } dst_reg->var_off =tnum_add (ptr_reg->var_off, off_reg->var_off); dst_reg->off = ptr_reg->off; + dst_reg->raw = ptr_reg->raw;if (reg_is_pkt_pointer (ptr_reg)) { dst_reg->id = ++env->id_gen;/* something was added to pkt_ptr, set range to zero */ - dst_reg->range =0 ; + dst_reg->raw =0 ; }break ;case BPF_SUB :
@@ -2824,7 +2825,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, dst_reg->var_off = ptr_reg->var_off; dst_reg->id = ptr_reg->id; dst_reg->off = ptr_reg->off - smin_val; - dst_reg->range = ptr_reg->range; + dst_reg->raw = ptr_reg->raw;break ; }/* A new variable offset is created. If the subtrahend is known
@@ -2850,11 +2851,12 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, } dst_reg->var_off =tnum_sub (ptr_reg->var_off, off_reg->var_off); dst_reg->off = ptr_reg->off; + dst_reg->raw = ptr_reg->raw;if (reg_is_pkt_pointer (ptr_reg)) { dst_reg->id = ++env->id_gen;/* something was added to pkt_ptr, set range to zero */ if (smin_val <0 ) - dst_reg->range =0 ; + dst_reg->raw =0 ; }break ;case BPF_AND :
Signature · 1 line
2.17.1
Greg Kroah-Hartman
maintainerPATCH 2/361 MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit c61c7def1fa0a722610d89790e0255b74f3c07dd ]
Commit ea7e0480a4b6 ("MIPS: VDSO: Always map near top of user memory") set VDSO_RANDOMIZE_SIZE to 256MB for 64bit kernel. But take a look at arch/mips/mm/mmap.c we can see that MIN_GAP is 128MB, which means the mmap_base may be at (user_address_top - 128MB). This make the stack be surrounded by mmaped areas, then stack expanding fails and causes a segmentation fault. Therefore, VDSO_RANDOMIZE_SIZE should be less than MIN_GAP and this patch reduce it to 64MB.
Patchwork: https://patchwork.linux-mips.org/patch/20910/
--- arch/mips/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/processor.h +1 -1
@@ -81,7 +81,7 @@ extern unsigned int vced_count, vcei_count;#endif -#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_256M) +#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_64M)extern unsigned long mips_stack_top (void );#define STACK_TOP mips_stack_top()
Signature · 1 line
2.17.1
Greg Kroah-Hartman
maintainerPATCH 3/361 gpio: mxs: Get rid of external API call
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 833eacc7b5913da9896bacd30db7d490aa777868 ]
The MXS driver was calling back into the GPIO API from its irqchip. This is not very elegant, as we are a driver, let's just shortcut back into the gpio_chip .get() function instead.
This is a tricky case since the .get() callback is not in this file, instead assigned by bgpio_init(). Calling the function direcly in the gpio_chip is however the lesser evil.
--- drivers/gpio/gpio-mxs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-mxs.c +1 -3
@@ -18,8 +18,6 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/gpio/driver.h> -/* FIXME: for gpio_get_value(), replace this by direct register read */ -#include <linux/gpio.h> #include <linux/module.h> #define MXS_SET 0x4
@@ -86,7 +84,7 @@ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type) port->both_edges &= ~pin_mask;switch (type) {case IRQ_TYPE_EDGE_BOTH : - val =gpio_get_value (port->gc.base + d->hwirq); + val = port->gc.get (&port->gc, d->hwirq);if (val) edge =GPIO_INT_FALL_EDGE ;else
Signature · 1 line
2.17.1
Greg Kroah-Hartman
maintainerPATCH 4/361 mtd: rawnand: marvell: fix the IRQ handler complete() condition
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit 53c83b59759c1ee213f5ffa194909daee8902a28 upstream.
With the current implementation, the complete() in the IRQ handler is supposed to be called only if the register status has one or the other RDY bit set. Other events might trigger an interrupt as well if enabled, but should not end-up with a complete() call.
For this purpose, the code was checking if the other bits were set, in this case complete() was not called. This is wrong as two events might happen in a very tight time-frame and if the NDSR status read reports two bits set (eg. RDY(0) and RDDREQ) at the same time, complete() was not called.
This logic would lead to timeouts in marvell_nfc_wait_op() and has been observed on PXA boards (NFCv1) in the Hamming write path.
--- drivers/mtd/nand/raw/marvell_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/marvell_nand.c +1 -1
@@ -686,7 +686,7 @@ static irqreturn_t marvell_nfc_isr(int imarvell_nfc_disable_int (nfc, st &NDCR_ALL_INT ); -if (!(st & (NDSR_RDDREQ |NDSR_WRDREQ |NDSR_WRCMDREQ ))) +if (st & (NDSR_RDY (0 ) |NDSR_RDY (1 )))complete (&nfc->complete);return IRQ_HANDLED ;
Greg Kroah-Hartman
maintainerPATCH 5/361 mtd: maps: gpio-addr-flash: Fix ioremapped size
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda Delgado <[email protected]>
commit 6c925b333368cda4e1b0513b07f72316c0e7edd7 upstream.
We should only iomap the area of the chip that is memory mapped. Otherwise we could be mapping devices beyond the memory space or that belong to other devices.
--- drivers/mtd/maps/gpio-addr-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/gpio-addr-flash.c +1 -1
@@ -238,7 +238,7 @@ static int gpio_flash_probe(struct platf state->map.copy_to = gf_copy_to; state->map.bankwidth = pdata->width; state->map.size = state->win_size * (1 << state->gpio_count); - state->map.virt =ioremap_nocache (memory->start, state->map.size); + state->map.virt =ioremap_nocache (memory->start, state->win_size);if (!state->map.virt)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 6/361 mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Xiang <[email protected]>
commit 41fe242979e463d6ad251077ded01b825a330b7e upstream.
If the size of spi-nor flash is larger than 16MB, the read_opcode is set to SPINOR_OP_READ_1_1_4_4B, and fsl_qspi_get_seqid() will return -EINVAL when cmd is SPINOR_OP_READ_1_1_4_4B. This can cause read operation fail.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/spi-nor/fsl-quadspi.c +1 -0
@@ -478,6 +478,7 @@ static int fsl_qspi_get_seqid(struct fsl {switch (cmd) {case SPINOR_OP_READ_1_1_4 : +case SPINOR_OP_READ_1_1_4_4B :return SEQID_READ ;case SPINOR_OP_WREN :return SEQID_WREN ;
Greg Kroah-Hartman
maintainerPATCH 7/361 mtd: spi-nor: intel-spi: Add support for Intel Ice Lake SPI serial flash
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
commit 42460c31ae96cbad5ae226ee6c10bd8d70d764ae upstream.
Intel Ice Lake exposes the SPI serial flash controller as a PCI device in the same way than Intel Denverton. Add Ice Lake SPI serial flash PCI ID to the driver list of supported devices.
--- drivers/mtd/spi-nor/intel-spi-pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/spi-nor/intel-spi-pci.c +1 -0
@@ -65,6 +65,7 @@ static void intel_spi_pci_remove(structstatic const struct pci_device_id intel_spi_pci_ids[] = { {PCI_VDEVICE (INTEL ,0x18e0 ), (unsigned long )&bxt_info }, {PCI_VDEVICE (INTEL ,0x19e0 ), (unsigned long )&bxt_info }, + {PCI_VDEVICE (INTEL ,0x34a4 ), (unsigned long )&bxt_info }, {PCI_VDEVICE (INTEL ,0xa1a4 ), (unsigned long )&bxt_info }, {PCI_VDEVICE (INTEL ,0xa224 ), (unsigned long )&bxt_info }, { },
Greg Kroah-Hartman
maintainerPATCH 8/361 mtd: spi-nor: fsl-quadspi: Dont let -EINVAL on the bus
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmad Fatoum <[email protected]>
commit 000412276370a9bcfec73b3752ceefd9a927f1db upstream.
fsl_qspi_get_seqid() may return -EINVAL, but fsl_qspi_init_ahb_read() doesn't check for error codes with the result that -EINVAL could find itself signalled over the bus.
In conjunction with the LS1046A SoC's A-009283 errata ("Illegal accesses to SPI flash memory can result in a system hang") this illegal access to SPI flash memory results in a system hang if userspace attempts reading later on.
Avoid this by always checking fsl_qspi_get_seqid()'s return value and bail out otherwise.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/mtd/spi-nor/fsl-quadspi.c +10 -4
@@ -544,6 +544,9 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 c/* trigger the LUT now */ seqid =fsl_qspi_get_seqid (q, cmd); +if (seqid <0 ) +return seqid; +qspi_writel (q, (seqid <<QUADSPI_IPCR_SEQID_SHIFT ) | len, base +QUADSPI_IPCR );
@@ -672,7 +675,7 @@ static void fsl_qspi_set_map_addr(struct* causes the controller to clear the buffer, and use the sequence pointed * by the QUADSPI_BFGENCR[SEQID] to initiate a read from the flash. */ -static void fsl_qspi_init_ahb_read (struct fsl_qspi *q) +static int fsl_qspi_init_ahb_read (struct fsl_qspi *q) {void __iomem *base = q->iobase;int seqid;
@@ -697,8 +700,13 @@ static void fsl_qspi_init_ahb_read(struc/* Set the default lut sequence for AHB Read. */ seqid =fsl_qspi_get_seqid (q, q->nor[0 ].read_opcode); +if (seqid <0 ) +return seqid; +qspi_writel (q, seqid <<QUADSPI_BFGENCR_SEQID_SHIFT , q->iobase +QUADSPI_BFGENCR ); + +return 0 ; }/* This function was used to prepare and enable QSPI clock */
@@ -806,9 +814,7 @@ static int fsl_qspi_nor_setup_last(strucfsl_qspi_init_lut (q);/* Init for AHB read */ -fsl_qspi_init_ahb_read (q); - -return 0 ; +return fsl_qspi_init_ahb_read (q); }static const struct of_device_id fsl_qspi_dt_ids[] = {
Greg Kroah-Hartman
maintainerPATCH 9/361 spi: spi-mem: Adjust op len based on message/transfer size limitations
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuanhua Han <[email protected]>
commit e757996cafbeb6b71234a17130674bcd8f44c59e upstream.
We need that to adjust the len of the 2nd transfer (called data in spi-mem) if it's too long to fit in a SPI message or SPI transfer.
--- drivers/spi/spi-mem.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/spi/spi-mem.c +15 -0
@@ -346,10 +346,25 @@ EXPORT_SYMBOL_GPL(spi_mem_get_name);int spi_mem_adjust_op_size (struct spi_mem *mem,struct spi_mem_op *op) {struct spi_controller *ctlr = mem->spi->controller; +size_t len; + + len =sizeof (op->cmd.opcode) + op->addr.nbytes + op->dummy.nbytes;if (ctlr->mem_ops && ctlr->mem_ops->adjust_op_size)return ctlr->mem_ops->adjust_op_size (mem, op); +if (!ctlr->mem_ops || !ctlr->mem_ops->exec_op) { +if (len >spi_max_transfer_size (mem->spi)) +return -EINVAL ; + + op->data.nbytes =min3 ((size_t )op->data.nbytes, +spi_max_transfer_size (mem->spi), +spi_max_message_size (mem->spi) - + len); +if (!op->data.nbytes) +return -EINVAL ; + } +return 0 ; }EXPORT_SYMBOL_GPL (spi_mem_adjust_op_size);
Greg Kroah-Hartman
maintainerPATCH 10/361 spi: bcm-qspi: switch back to reading flash using smaller chunks
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <[email protected]>
commit 940ec770c295682993d1cccce3081fd7c74fece8 upstream.
Fixing/optimizing bcm_qspi_bspi_read() performance introduced two changes:
1) It added a loop to read all requested data using multiple BSPI ops.
2) It bumped max size of a single BSPI block request from 256 to 512 B.
The later change resulted in occasional BSPI timeouts causing a regression.
For some unknown reason hardware doesn't always handle reads as expected when using 512 B chunks. In such cases it may happen that BSPI returns amount of requested bytes without the last 1-3 ones. It provides the remaining bytes later but doesn't raise an interrupt until another LR start.
Switching back to 256 B reads fixes that problem and regression.
--- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-bcm-qspi.c +1 -1
@@ -89,7 +89,7 @@#define BSPI_BPP_MODE_SELECT_MASK BIT(8)#define BSPI_BPP_ADDR_SELECT_MASK BIT(16) -#define BSPI_READ_LENGTH 512 +#define BSPI_READ_LENGTH 256/* MSPI register offsets */ #define MSPI_SPCR0_LSB 0x000
Greg Kroah-Hartman
maintainerPATCH 11/361 spi: bcm-qspi: fix calculation of address length
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <[email protected]>
commit 0976eda7915507fe94e07870c19d717c9994b57a upstream.
During implementation of the new API bcm_qspi_bspi_set_flex_mode() has been modified breaking calculation of address length. An unnecessary multiplication was added breaking flash reads.
--- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-bcm-qspi.c +1 -1
@@ -355,7 +355,7 @@ static int bcm_qspi_bspi_set_flex_mode(sint bpc =0 , bpp =0 ;u8 command = op->cmd.opcode;int width = op->cmd.buswidth ? op->cmd.buswidth :SPI_NBITS_SINGLE ; -int addrlen = op->addr.nbytes *8 ; +int addrlen = op->addr.nbytes;int flex_mode =1 ; dev_dbg(&qspi->pdev->dev, "set flex mode w %x addrlen %x hp %d\n",
Greg Kroah-Hartman
maintainerPATCH 12/361 bcache: trace missed reading by cache_missed
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Junhui <[email protected]>
commit 502b291568fc7faf1ebdb2c2590f12851db0ff76 upstream.
Missed reading IOs are identified by s->cache_missed, not the s->cache_miss, so in trace_bcache_read() using trace_bcache_read to identify whether the IO is missed or not.
--- drivers/md/bcache/request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/request.c +1 -1
@@ -850,7 +850,7 @@ static void cached_dev_read_done_bh(strubch_mark_cache_accounting (s->iop.c, s->d, !s->cache_missed, s->iop.bypass); -trace_bcache_read (s->orig_bio, !s->cache_miss, s->iop.bypass); +trace_bcache_read (s->orig_bio, !s->cache_missed, s->iop.bypass);if (s->iop.status)continue_at_nobarrier (cl, cached_dev_read_error, bcache_wq);
Greg Kroah-Hartman
maintainerPATCH 13/361 bcache: fix ioctl in flash device
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Junhui <[email protected]>
commit dd0c91793b7c2658ea32c6b3a2247a8ceca45dc0 upstream.
When doing ioctl in flash device, it will call ioctl_dev() in super.c, then we should not to get cached device since flash only device has no backend device. This patch just move the jugement dc->io_disable to cached_dev_ioctl() to make ioctl in flash device correctly.
--- drivers/md/bcache/request.c | 3 +++ drivers/md/bcache/super.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/md/bcache/request.c +3 -0
@@ -1218,6 +1218,9 @@ static int cached_dev_ioctl(struct bcach { struct cached_dev *dc = container_of(d, struct cached_dev, disk); +if (dc->io_disable) +return -EIO ; +return __blkdev_driver_ioctl (dc->bdev, mode, cmd, arg); }
drivers/md/bcache/super.c +0 -4
@@ -643,10 +643,6 @@ static int ioctl_dev(struct block_device unsigned int cmd, unsigned long arg) {struct bcache_device *d = b->bd_disk->private_data; - struct cached_dev *dc = container_of(d, struct cached_dev, disk); - -if (dc->io_disable) -return -EIO ;return d->ioctl (d, mode, cmd, arg); }
Greg Kroah-Hartman
maintainerPATCH 14/361 bcache: correct dirty data statistics
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Junhui <[email protected]>
commit 2e17a262a2371d38d2ec03614a2675a32cef9912 upstream.
When bcache device is clean, dirty keys may still exist after journal replay, so we need to count these dirty keys even device in clean status, otherwise after writeback, the amount of dirty data would be incorrect.
--- drivers/md/bcache/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/bcache/super.c +2 -1
@@ -1148,11 +1148,12 @@ int bch_cached_dev_attach(struct cached_ }if (BDEV_STATE (&dc->sb) ==BDEV_STATE_DIRTY ) { -bch_sectors_dirty_init (&dc->disk);atomic_set (&dc->has_dirty,1 );bch_writeback_queue (dc); } +bch_sectors_dirty_init (&dc->disk); +bch_cached_dev_run (dc);bcache_device_link (&dc->disk, c,"bdev" );atomic_inc (&c->attached_dev_nr);
Greg Kroah-Hartman
maintainerPATCH 15/361 bcache: fix miss key refill->end in writeback
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Junhui <[email protected]>
commit 2d6cb6edd2c7fb4f40998895bda45006281b1ac5 upstream.
refill->end record the last key of writeback, for example, at the first time, keys (1,128K) to (1,1024K) are flush to the backend device, but the end key (1,1024K) is not included, since the bellow code:
if (bkey_cmp(k, refill->end) >= 0) {
ret = MAP_DONE;
goto out;
}And in the next time when we refill writeback keybuf again, we searched key start from (1,1024K), and got a key bigger than it, so the key (1,1024K) missed.
This patch modify the above code, and let the end key to be included to the writeback key buffer.
--- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/btree.c +1 -1
@@ -2434,7 +2434,7 @@ static int refill_keybuf_fn(struct btreestruct keybuf *buf = refill->buf;int ret =MAP_CONTINUE ; -if (bkey_cmp (k, refill->end) >=0 ) { +if (bkey_cmp (k, refill->end) >0 ) { ret =MAP_DONE ; goto out; }
Greg Kroah-Hartman
maintainerPATCH 16/361 hwmon: (pmbus) Fix page count auto-detection.
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Bazhenov <[email protected]>
commit e7c6a55606b5c46b449d76588968b4d8caae903f upstream.
Devices with compatible="pmbus" field have zero initial page count, and pmbus_clear_faults() being called before the page count auto- detection does not actually clear faults because it depends on the page count. Non-cleared faults in its turn may fail the subsequent page count auto-detection.
This patch fixes this problem by calling pmbus_clear_fault_page() for currently set page and calling pmbus_clear_faults() after the page count was detected.
--- drivers/hwmon/pmbus/pmbus.c | 2 ++ drivers/hwmon/pmbus/pmbus_core.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pmbus.c +2 -0
@@ -118,6 +118,8 @@ static int pmbus_identify(struct i2c_cli }else { info->pages =1 ; } + +pmbus_clear_faults (client); }if (pmbus_check_byte_register (client,0 ,PMBUS_VOUT_MODE )) {
drivers/hwmon/pmbus/pmbus_core.c +4 -1
@@ -2015,7 +2015,10 @@ static int pmbus_init_common(struct i2c_if (ret >=0 && (ret &PB_CAPABILITY_ERROR_CHECK )) client->flags |=I2C_CLIENT_PEC ; -pmbus_clear_faults (client); +if (data->info->pages) +pmbus_clear_faults (client); +else +pmbus_clear_fault_page (client,-1 );if (info->identify) { ret = (*info->identify)(client, info);
Greg Kroah-Hartman
maintainerPATCH 17/361 jffs2: free jffs2_sb_info through jffs2_kill_sb()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Tao <[email protected]>
commit 92e2921f7eee63450a5f953f4b15dc6210219430 upstream.
When an invalid mount option is passed to jffs2, jffs2_parse_options() will fail and jffs2_sb_info will be freed, but then jffs2_sb_info will be used (use-after-free) and freeed (double-free) in jffs2_kill_sb().
Fix it by removing the buggy invocation of kfree() when getting invalid mount options.
--- fs/jffs2/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/jffs2/super.c +1 -3
@@ -285,10 +285,8 @@ static int jffs2_fill_super(struct super sb->s_fs_info = c; ret =jffs2_parse_options (c, data); -if (ret) { -kfree (c); +if (ret)return -EINVAL ; - }/* Initialize JFFS2 superblock locks, the further initialization will * be done later */
Greg Kroah-Hartman
maintainerPATCH 18/361 block: setup bounce bio_sets properly
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit 52990a5fb0c991ecafebdab43138b5ed41376852 upstream.
We're only setting up the bounce bio sets if we happen to need bouncing for regular HIGHMEM, not if we only need it for ISA devices.
Protect the ISA bounce setup with a mutex, since it's being invoked from driver init functions and can thus be called in parallel.
--- block/bounce.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-)
block/bounce.c +28 -9
@@ -31,6 +31,24 @@static struct bio_set bounce_bio_set, bounce_bio_split;static mempool_t page_pool, isa_page_pool; +static void init_bounce_bioset (void ) +{ +static bool bounce_bs_setup; +int ret; + +if (bounce_bs_setup) +return ; + + ret =bioset_init (&bounce_bio_set,BIO_POOL_SIZE ,0 ,BIOSET_NEED_BVECS ); +BUG_ON (ret); +if (bioset_integrity_create (&bounce_bio_set,BIO_POOL_SIZE )) +BUG_ON (1 ); + + ret =bioset_init (&bounce_bio_split,BIO_POOL_SIZE ,0 ,0 ); +BUG_ON (ret); + bounce_bs_setup = true; +} +#if defined(CONFIG_HIGHMEM )static __init int init_emergency_pool (void ) {
@@ -44,14 +62,7 @@ static __init int init_emergency_pool(voBUG_ON (ret);pr_info ("pool size: %d pages\n" ,POOL_SIZE ); - ret =bioset_init (&bounce_bio_set,BIO_POOL_SIZE ,0 ,BIOSET_NEED_BVECS ); -BUG_ON (ret); -if (bioset_integrity_create (&bounce_bio_set,BIO_POOL_SIZE )) -BUG_ON (1 ); - - ret =bioset_init (&bounce_bio_split,BIO_POOL_SIZE ,0 ,0 ); -BUG_ON (ret); - +init_bounce_bioset ();return 0 ; }
@@ -86,6 +97,8 @@ static void *mempool_alloc_pages_isa(gfpreturn mempool_alloc_pages (gfp_mask |GFP_DMA , data); } +static DEFINE_MUTEX (isa_mutex); +/* * gets called "every" time someone init's a queue with BLK_BOUNCE_ISA * as the max address, so check if the pool has already been created.
@@ -94,14 +107,20 @@ int init_emergency_isa_pool(void) {int ret; -if (mempool_initialized (&isa_page_pool)) +mutex_lock (&isa_mutex); + +if (mempool_initialized (&isa_page_pool)) { +mutex_unlock (&isa_mutex);return 0 ; + } ret =mempool_init (&isa_page_pool,ISA_POOL_SIZE , mempool_alloc_pages_isa, mempool_free_pages, (void *)0 );BUG_ON (ret);pr_info ("isa pool size: %d pages\n" ,ISA_POOL_SIZE ); +init_bounce_bioset (); +mutex_unlock (&isa_mutex);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 19/361 block: make sure discard bio is aligned with logical block size
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
commit 1adfc5e4136f5967d591c399aff95b3b035f16b7 upstream.
Obviously the created discard bio has to be aligned with logical block size.
This patch introduces the helper of bio_allowed_max_sectors() for this purpose.
--- block/blk-lib.c | 3 +-- block/blk-merge.c | 3 ++- block/blk.h | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-)
block/blk-lib.c +1 -2
@@ -58,8 +58,7 @@ int __blkdev_issue_discard(struct block_if (!req_sects) goto fail; -if (req_sects >UINT_MAX >>9 ) - req_sects =UINT_MAX >>9 ; + req_sects =min (req_sects,bio_allowed_max_sectors (q)); end_sect = sector + req_sects;
block/blk-merge.c +2 -1
@@ -27,7 +27,8 @@ static struct bio *blk_bio_discard_split/* Zero-sector (unknown) and one-sector granularities are the same. */ granularity =max (q->limits.discard_granularity >>9 ,1U ); - max_discard_sectors =min (q->limits.max_discard_sectors,UINT_MAX >>9 ); + max_discard_sectors =min (q->limits.max_discard_sectors, +bio_allowed_max_sectors (q)); max_discard_sectors -= max_discard_sectors % granularity;if (unlikely (!max_discard_sectors)) {
block/blk.h +10 -0
@@ -329,6 +329,16 @@ static inline unsigned long blk_rq_deadl }/* +* The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size +* is defined as 'unsigned int', meantime it has to aligned to with logical +* block size which is the minimum accepted unit by hardware. +*/ +static inline unsigned int bio_allowed_max_sectors (struct request_queue *q) +{ +return round_down (UINT_MAX ,queue_logical_block_size (q)) >>9 ; +} + +/* * Internal io_context interface */ void get_io_context (struct io_context *ioc);
Greg Kroah-Hartman
maintainerPATCH 20/361 block: make sure writesame bio is aligned with logical block size
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
commit 34ffec60b27aa81d04e274e71e4c6ef740f75fc7 upstream.
Obviously the created writesame bio has to be aligned with logical block size, and use bio_allowed_max_sectors() to retrieve this number.
--- block/blk-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-lib.c +1 -1
@@ -161,7 +161,7 @@ static int __blkdev_issue_write_same(strreturn -EOPNOTSUPP ;/* Ensure that max_write_same_sectors doesn't overflow bi_size */ - max_write_same_sectors =UINT_MAX >>9 ; + max_write_same_sectors =bio_allowed_max_sectors (q);while (nr_sects) { bio =next_bio (bio,1 , gfp_mask);
Greg Kroah-Hartman
maintainerPATCH 21/361 cpufreq: conservative: Take limits changes into account properly
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit da5e79bc70b84971d2b3a55fb252e34e51d81d48 upstream.
If the policy limits change between invocations of cs_dbs_update(), the requested frequency value stored in dbs_info may not be updated and the function may use a stale value of it next time. Moreover, if idle periods are takem into account by cs_dbs_update(), the requested frequency value stored in dbs_info may be below the min policy limit, which is incorrect.
To fix these problems, always update the requested frequency value in dbs_info along with the local copy of it when the previous requested frequency is beyond the policy limits and avoid decreasing the requested frequency below the min policy limit when taking idle periods into account.
--- drivers/cpufreq/cpufreq_conservative.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq_conservative.c +4 -2
@@ -80,8 +80,10 @@ static unsigned int cs_dbs_update(struct* changed in the meantime, so fall back to current frequency in that * case. */ -if (requested_freq > policy->max || requested_freq < policy->min) +if (requested_freq > policy->max || requested_freq < policy->min) { requested_freq = policy->cur; + dbs_info->requested_freq = requested_freq; + } freq_step =get_freq_step (cs_tuners, policy);
@@ -92,7 +94,7 @@ static unsigned int cs_dbs_update(structif (policy_dbs->idle_periods <UINT_MAX ) {unsigned int freq_steps = policy_dbs->idle_periods * freq_step; -if (requested_freq > freq_steps) +if (requested_freq > policy->min + freq_steps) requested_freq -= freq_steps;else requested_freq = policy->min;
Greg Kroah-Hartman
maintainerPATCH 22/361 dma-mapping: fix panic caused by passing empty cma command line argument
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: He Zhe <[email protected]>
commit a3ceed87b07769fb80ce9dc6b604e515dba14c4b upstream.
early_cma does not check input argument before passing it to simple_strtoull. The argument would be a NULL pointer if "cma", without its value, is set in command line and thus causes the following panic.
PANIC: early exception 0xe3 IP 10:ffffffffa3e9db8d error 0 cr2 0x0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.0-rc3-yocto-standard+ #7 [ 0.000000] RIP: 0010:_parse_integer_fixup_radix+0xd/0x70 ... [ 0.000000] Call Trace: [ 0.000000] simple_strtoull+0x29/0x70 [ 0.000000] memparse+0x26/0x90 [ 0.000000] early_cma+0x17/0x6a [ 0.000000] do_early_param+0x57/0x8e [ 0.000000] parse_args+0x208/0x320 [ 0.000000] ? rdinit_setup+0x30/0x30 [ 0.000000] parse_early_options+0x29/0x2d [ 0.000000] ? rdinit_setup+0x30/0x30 [ 0.000000] parse_early_param+0x36/0x4d [ 0.000000] setup_arch+0x336/0x99e [ 0.000000] start_kernel+0x6f/0x4e6 [ 0.000000] x86_64_start_reservations+0x24/0x26 [ 0.000000] x86_64_start_kernel+0x6f/0x72 [ 0.000000] secondary_startup_64+0xa4/0xb0
This patch adds a check to prevent the panic.
--- kernel/dma/contiguous.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/dma/contiguous.c +5 -1
@@ -49,7 +49,11 @@ static phys_addr_t limit_cmdline;static int __init early_cma (char *p) { -pr_debug ("%s(%s)\n" , __func__, p); +if (!p) { +pr_err ("Config string not provided\n" ); +return -EINVAL ; + } + size_cmdline =memparse (p, &p);if (*p !='@' )return 0 ;
Greg Kroah-Hartman
maintainerPATCH 23/361 pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej S. Szmigiero <[email protected]>
commit 95691e3eddc41da2d1cd3cca51fecdfb46bd85bc upstream.
Currently, "disable_clkrun" yenta_socket module parameter is only implemented for TI CardBus bridges.
Add also an implementation for Ricoh bridges that have the necessary setting documented in publicly available datasheets.
Tested on a RL5C476II with a Sunrich C-160 CardBus NIC that doesn't work correctly unless the CLKRUN protocol is disabled.
Let's also make it clear in its description that the "disable_clkrun" module parameter only works on these two previously mentioned brands of CardBus bridges.
--- drivers/pcmcia/ricoh.h | 35 +++++++++++++++++++++++++++++++++++ drivers/pcmcia/yenta_socket.c | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-)
drivers/pcmcia/ricoh.h +35 -0
@@ -119,6 +119,10 @@#define RL5C4XX_MISC_CONTROL 0x2F/* 8 bit */ #define RL5C4XX_ZV_ENABLE 0x08 +/* Misc Control 3 Register */ +#define RL5C4XX_MISC3 0x00A2/* 16 bit */ +#define RL5C47X_MISC3_CB_CLKRUN_DIS BIT(1) +#ifdef __YENTA_H#define rl_misc (socket) ((socket)->private[0])
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_so } } +static void ricoh_set_clkrun (struct yenta_socket *socket,bool quiet) +{ +u16 misc3; + +/* +* RL5C475II likely has this setting, too, however no datasheet +* is publicly available for this chip +*/ +if (socket->dev->device !=PCI_DEVICE_ID_RICOH_RL5C476 && + socket->dev->device !=PCI_DEVICE_ID_RICOH_RL5C478 ) +return ; + +if (socket->dev->revision <0x80 ) +return ; + + misc3 =config_readw (socket,RL5C4XX_MISC3 ); +if (misc3 &RL5C47X_MISC3_CB_CLKRUN_DIS ) { +if (!quiet) +dev_dbg (&socket->dev->dev, +"CLKRUN feature already disabled\n" ); + }else if (disable_clkrun) { +if (!quiet) +dev_info (&socket->dev->dev, +"Disabling CLKRUN feature\n" ); + misc3 |=RL5C47X_MISC3_CB_CLKRUN_DIS ; +config_writew (socket,RL5C4XX_MISC3 , misc3); + } +} +static void ricoh_save_state (struct yenta_socket *socket) {rl_misc (socket) =config_readw (socket,RL5C4XX_MISC );
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct yconfig_writew (socket,RL5C4XX_16BIT_IO_0 ,rl_io (socket));config_writew (socket,RL5C4XX_16BIT_MEM_0 ,rl_mem (socket));config_writew (socket,RL5C4XX_CONFIG ,rl_config (socket)); +ricoh_set_clkrun (socket, true); }
@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_sconfig_writew (socket,RL5C4XX_CONFIG , config);ricoh_set_zv (socket); +ricoh_set_clkrun (socket, false);return 0 ; }
drivers/pcmcia/yenta_socket.c +2 -1
@@ -26,7 +26,8 @@static bool disable_clkrun;module_param (disable_clkrun, bool,0444 ); -MODULE_PARM_DESC (disable_clkrun,"If PC card doesn't function properly, please try this option" ); +MODULE_PARM_DESC (disable_clkrun, +"If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)" );static bool isa_probe =1 ;module_param (isa_probe, bool,0444 );
Greg Kroah-Hartman
maintainerPATCH 24/361 ACPI / OSL: Use jiffies as the time bassis for acpi_os_get_timer()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 83b2348e2755db48fa8f40fdb791f366fabc0ba0 upstream.
Since acpi_os_get_timer() may be called after the timer subsystem has been suspended, use the jiffies counter instead of ktime_get(). This patch avoids that the following warning is reported during hibernation:
WARNING: CPU: 0 PID: 612 at kernel/time/timekeeping.c:751 ktime_get+0x116/0x120 RIP: 0010:ktime_get+0x116/0x120 Call Trace: acpi_os_get_timer+0xe/0x30 acpi_ds_exec_begin_control_op+0x175/0x1de acpi_ds_exec_begin_op+0x2c7/0x39a acpi_ps_create_op+0x573/0x5e4 acpi_ps_parse_loop+0x349/0x1220 acpi_ps_parse_aml+0x25b/0x6da acpi_ps_execute_method+0x327/0x41b acpi_ns_evaluate+0x4e9/0x6f5 acpi_ut_evaluate_object+0xd9/0x2f2 acpi_rs_get_method_data+0x8f/0x114 acpi_walk_resources+0x122/0x1b6 acpi_pci_link_get_current.isra.2+0x157/0x280 acpi_pci_link_set+0x32f/0x4a0 irqrouter_resume+0x58/0x80 syscore_resume+0x84/0x380 hibernation_snapshot+0x20c/0x4f0 hibernate+0x22d/0x3a6 state_store+0x99/0xa0 kobj_attr_store+0x37/0x50 sysfs_kf_write+0x87/0xa0 kernfs_fop_write+0x1a5/0x240 __vfs_write+0xd2/0x410 vfs_write+0x101/0x250 ksys_write+0xab/0x120 __x64_sys_write+0x43/0x50 do_syscall_64+0x71/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe
References: https://lists.01.org/pipermail/lkp/2018-April/008406.html
--- drivers/acpi/osl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/acpi/osl.c +9 -6
@@ -617,15 +617,18 @@ void acpi_os_stall(u32 us) }/* -* Support ACPI 3.0 AML Timer operand -* Returns 64-bit free-running, monotonically increasing timer -* with 100ns granularity +* Support ACPI 3.0 AML Timer operand. Returns a 64-bit free-running, +* monotonically increasing timer with 100ns granularity. Do not use +* ktime_get() to implement this function because this function may get +* called after timekeeping has been suspended. Note: calling this function +* after timekeeping has been suspended may lead to unexpected results +* because when timekeeping is suspended the jiffies counter is not +* incremented. See also timekeeping_suspend(). */ u64 acpi_os_get_timer (void ) { -u64 time_ns =ktime_to_ns (ktime_get ()); -do_div (time_ns,100 ); -return time_ns; +return (get_jiffies_64 () -INITIAL_JIFFIES ) * + (ACPI_100NSEC_PER_SEC /HZ ); }acpi_status acpi_os_read_port (acpi_io_address port,u32 * value,u32 width)
Greg Kroah-Hartman
maintainerPATCH 25/361 ACPICA: AML interpreter: add region addresses in global list during initialization
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erik Schmauss <[email protected]>
commit 4abb951b73ff0a8a979113ef185651aa3c8da19b upstream.
The table load process omitted adding the operation region address range to the global list. This omission is problematic because the OS queries the global list to check for address range conflicts before deciding which drivers to load. This commit may result in warning messages that look like the following:
[ 7.871761] ACPI Warning: system_IO range 0x00000428-0x0000042F conflicts with op_region 0x00000400-0x0000047F (\PMIO) (20180531/utaddress-213) [ 7.871769] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
However, these messages do not signify regressions. It is a result of properly adding address ranges within the global address list.
--- drivers/acpi/acpica/dsopcode.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/acpi/acpica/dsopcode.c +4 -0
@@ -417,6 +417,10 @@ acpi_ds_eval_region_operands(struct acpiACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length)); + status =acpi_ut_add_address_range (obj_desc->region.space_id, + obj_desc->region.address, + obj_desc->region.length, node); +/* Now the address and length are valid for this opregion */ obj_desc->region.flags |=AOPOBJ_DATA_VALID ;
Re: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course not true.
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatible chip at 0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
--snip--
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after successfully loading the module.
Idea, workarounds or patches welcome.
Quoted 45 lines
------------------
From: Erik Schmauss <[email protected]>
commit
4abb951b73ff0a8a979113ef185651aa3c8da19bupstream.The table load process omitted adding the operation region address range to the global list. This omission is problematic because the OS queries the global list to check for address range conflicts before deciding which drivers to load. This commit may result in warning messages that look like the following:
[ 7.871761] ACPI Warning: system_IO range 0x00000428-0x0000042F conflicts with op_region 0x00000400-0x0000047F (\PMIO) (20180531/utaddress-213) [ 7.871769] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driverHowever, these messages do not signify regressions. It is a result of properly adding address ranges within the global address list.
Tested-by Jean-Marc Lenoir <[email protected]>Signed-off-by Erik Schmauss <[email protected]>Cc All applicable <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/acpi/acpica/dsopcode.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/acpi/acpica/dsopcode.c +4
-0@@ -417,6 +417,10 @@ acpi_ds_eval_region_operands(struct acpiACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length)); + status =acpi_ut_add_address_range (obj_desc->region.space_id, + obj_desc->region.address, + obj_desc->region.length, node); +/* Now the address and length are valid for this opregion */ obj_desc->region.flags |=AOPOBJ_DATA_VALID ;
RE: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Quoted 13 lines
-----Original Message-----
From: Holger Hoffstätte [mailto:[email protected]]
Sent: Monday, November 12, 2018 10:31 AM
To: Greg Kroah-Hartman <[email protected]>; linux- [email protected]
Cc: [email protected]; Jean-Marc Lenoir <[email protected]>; Schmauss, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>
Subject: Re: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Quoted 4 lines
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me
know.
Hi,
Quoted 13 lines
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course not true.
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatible chip at0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver --snip--
Quoted 7 lines
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after successfully loading the module.
Idea, workarounds or patches welcome.
Is there a firmware update available for this machine? If so, you may want to do a firmware update.
Also, what is the behavior in kernels 4.16 or older?
Erik
Quoted 49 lines
Quoted 7 lines
------------------
From: Erik Schmauss <[email protected]>
commit
4abb951b73ff0a8a979113ef185651aa3c8da19bupstream.Quoted 7 lines
The table load process omitted adding the operation region address range to the global list. This omission is problematic because the OS queries the global list to check for address range conflicts before deciding which drivers to load. This commit may result in warning messages that look like the following:
[ 7.871761] ACPI Warning: system_IO range 0x00000428-0x0000042Fconflicts with
op_region0x00000400-0x0000047F (\PMIO) (20180531/utaddress-213)Quoted 1 line
[ 7.871769] ACPI: If an ACPI driver is available for this device, you shoulduse it instead of the native driver
Quoted 31 lines
However, these messages do not signify regressions. It is a result of properly adding address ranges within the global address list.
Tested-by Jean-Marc Lenoir <[email protected]>Signed-off-by Erik Schmauss <[email protected]>Cc All applicable <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/acpi/acpica/dsopcode.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/acpi/acpica/dsopcode.c +4
-0@@ -417,6 +417,10 @@ acpi_ds_eval_region_operands(struct acpiACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length)); + status =acpi_ut_add_address_range (obj_desc->region.space_id, + obj_desc->region.address, + obj_desc->region.length, node); +/* Now the address and length are valid for this opregion */ obj_desc->region.flags |=AOPOBJ_DATA_VALID ;
Re: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Hello Erik,
thanks for responding.
Quoted 19 lines · Erik
Quoted 19 lines
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course not true.
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatible chip at0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver --snip--
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after successfully loading the module.
Quoted 4 lines
Quoted 1 line
Idea, workarounds or patches welcome.
Is there a firmware update available for this machine? If so, you may want to do a firmware update.
The motherboard is from 2011 and I already installed the last available BIOS from 2013 a few years ago. That fixed exactly nothing. :) This was my last motherboard from Asus ever, but alas, it's still here and otherwise working, so..
Quoted 1 line
Also, what is the behavior in kernels 4.16 or older?
Everything just worked - yes, with ACPI spew, but.. ¯\(ツ)/¯ I understand that the patch might well be "technically correct" and OK for mainline/current hardware and will try playing with acpi=.. kernel flags.
thanks,
Holger
RE: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Quoted 42 lines
-----Original Message-----
From: Holger Hoffstätte [mailto:[email protected]]
Sent: Monday, November 12, 2018 11:42 AM
To: Schmauss, Erik <[email protected]>; Greg Kroah-Hartman <[email protected]>; [email protected]
Cc: [email protected]; Jean-Marc Lenoir <[email protected]>; Wysocki, Rafael J <[email protected]>
Subject: Re: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initializationHello Erik,
thanks for responding.
Quoted 4 lines · Erik
Quoted 4 lines
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course
not true.
Quoted 11 lines
Quoted 11 lines
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatiblechip at
0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
--snip--Quoted 5 lines
Quoted 5 lines
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after
successfully loading the module.
Quoted 3 lines
Quoted 2 lines
Idea, workarounds or patches welcome.
Quoted 10 lines
Quoted 2 lines
Is there a firmware update available for this machine? If so, you may want to do a firmware update.
The motherboard is from 2011 and I already installed the last available BIOS from 2013 a few years ago. That fixed exactly nothing. :) This was my last motherboard from Asus ever, but alas, it's still here and otherwise working, so..
Quoted 1 line
Also, what is the behavior in kernels 4.16 or older?
Hi,
Quoted 3 lines
Everything just worked - yes, with ACPI spew, but.. ¯\(ツ)/¯
I understand that the patch might well be "technically correct" and OK for mainline/current hardware and will try playing with acpi=.. kernel flags.
It's strange how the driver would load in 4.16 and fail to load with this patch. I would like to make sure that the driver load behavior is not being changed from 4.16 or earlier.
Could you send a working dmesg from 4.16 (or earlier) and a failing dmesg with this stable branch using the same kernel command line parameters for both?
I don't need too much of the spew if it looks the same. I'm more interested in the initializations and the warning message.
Erik
Quoted 3 lines
thanks,
Holger
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
In reply to Holger HoffstätteQuoted 14 lines · Holger Hoffstätte
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course not true.
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatible chip at 0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver--snip--
Quoted 7 lines
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after successfully loading the module.
Idea, workarounds or patches welcome.
So Linus's tree is also "broken" for your hardware?
thanks,
greg k-h
Re: [PATCH 4.19 025/361] ACPICA: AML interpreter: add region addresses in global list during initialization
Quoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Holger Hoffstätte
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
As probably expected this patch causes problems. In my case one server can no longer load the nct6775 hwmon module, which means the fan cannot be monitored, and therefore my monitoring system promptly starts spamming me with alerts that my fan has failed - which is of course not true.
--snip--
Nov 12 18:08:56 tux kernel: nct6775: Found NCT6776D/F or compatible chip at 0x2e:0x290 Nov 12 18:08:56 tux kernel: ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x Nov 12 18:08:56 tux kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver--snip--
This is certainly caused by my old BIOS and its broken ACPI implementation, however since it's working perfectly fine otherwise I see no reason to replace it. That being said, I must be able to monitor my fan, so for now reverting the patch immediately "fixed" the problem for me - the fan entries appeared in sysfs again after successfully loading the module.
Quoted 3 lines
Quoted 1 line
Idea, workarounds or patches welcome.
So Linus's tree is also "broken" for your hardware?
Not tested yet (should I?) but I assume it will be, since it seems to be my old BIOS' ACPI implemnetation's fault. As I wrote to Erik, I just added acpi_enforce_resources=lax to the boot flags, and as expected it gives a warning for the hwmon module, but still lets it pass and work, as before or with the patch reverted. So I'm good for now.
thanks,
Holger
Greg Kroah-Hartman
maintainerPATCH 26/361 ACPICA: AML Parser: fix parse loop to correctly skip erroneous extended opcodes
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erik Schmauss <[email protected]>
commit c64baa3a6fa207d112706bc5e7fd645cd8a8663f upstream.
AML opcodes come in two lengths: 1-byte opcodes and 2-byte, extended opcodes. If an error occurs due to illegal opcodes during table load, the AML parser needs to continue loading the table. In order to do this, it needs to skip parsing of the offending opcode and operands associated with that opcode.
This change fixes the AML parse loop to correctly skip parsing of incorrect extended opcodes. Previously, only the short opcodes were skipped correctly.
--- drivers/acpi/acpica/psloop.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/acpi/acpica/psloop.c +13 -1
@@ -417,6 +417,7 @@ acpi_status acpi_ps_parse_loop(struct acunion acpi_parse_object *op =NULL ;/* current op */ struct acpi_parse_state *parser_state;u8 *aml_op_start =NULL ; +u8 opcode_length;ACPI_FUNCTION_TRACE_PTR (ps_parse_loop, walk_state);
@@ -540,8 +541,19 @@ acpi_status acpi_ps_parse_loop(struct ac"Skip parsing opcode %s" ,acpi_ps_get_opcode_name (walk_state->opcode))); + +/* +* Determine the opcode length before skipping the opcode. +* An opcode can be 1 byte or 2 bytes in length. +*/ + opcode_length =1 ; +if ((walk_state->opcode &0xFF00 ) == +AML_EXTENDED_OPCODE ) { + opcode_length =2 ; + } walk_state->parser_state.aml = - walk_state->aml +1 ; + walk_state->aml + opcode_length; + walk_state->parser_state.aml =acpi_ps_get_next_package_end (&walk_state->parser_state);
Greg Kroah-Hartman
maintainerPATCH 27/361 acpi, nfit: Fix Address Range Scrub completion tracking
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit d3abaf43bab8d5b0a3c6b982100d9e2be96de4ad upstream.
The Address Range Scrub implementation tried to skip running scrubs against ranges that were already scrubbed by the BIOS. Unfortunately that support also resulted in early scrub completions as evidenced by this debug output from nfit_test:
nd_region region9: ARS: range 1 short complete nd_region region3: ARS: range 1 short complete nd_region region4: ARS: range 2 ARS start (0) nd_region region4: ARS: range 2 short complete
...i.e. completions without any indications that the scrub was started.
This state of affairs was hard to see in the code due to the proliferation of state bits and mistakenly trying to track done state per-range when the completion is a global property of the bus.
So, kill the four ARS state bits (ARS_REQ, ARS_REQ_REDO, ARS_DONE, and ARS_SHORT), and replace them with just 2 request flags ARS_REQ_SHORT and ARS_REQ_LONG. The implementation will still complete and reap the results of BIOS initiated ARS, but it will not attempt to use that information to affect the completion status of scrubbing the ranges from a Linux perspective.
Instead, try to synchronously run a short ARS per range at init time and schedule a long scrub in the background. If ARS is busy with an ARS request, schedule both a short and a long scrub for when ARS returns to idle. This logic also satisfies the intent of what ARS_REQ_REDO was trying to achieve. The new rule is that the REQ flag stays set until the next successful ars_start() for that range.
With the new policy that the REQ flags are not cleared until the next start, the implementation no longer loses requests as can be seen from the following log:
nd_region region3: ARS: range 1 ARS start short (0) nd_region region9: ARS: range 1 ARS start short (0) nd_region region3: ARS: range 1 complete nd_region region4: ARS: range 2 ARS start short (0) nd_region region9: ARS: range 1 complete nd_region region9: ARS: range 1 ARS start long (0) nd_region region4: ARS: range 2 complete nd_region region3: ARS: range 1 ARS start long (0) nd_region region9: ARS: range 1 complete nd_region region3: ARS: range 1 complete nd_region region4: ARS: range 2 ARS start long (0) nd_region region4: ARS: range 2 complete
...note that the nfit_test emulated driver provides 2 buses, that is why some of the range indices are duplicated. Notice that each range now successfully completes a short and long scrub.
--- drivers/acpi/nfit/core.c | 167 ++++++++++++++++++++++++++--------------------- drivers/acpi/nfit/nfit.h | 10 +- 2 files changed, 100 insertions(+), 77 deletions(-)
drivers/acpi/nfit/core.c +95 -72
@@ -2466,7 +2466,8 @@ static int ars_get_cap(struct acpi_nfit_return cmd_rc; } -static int ars_start (struct acpi_nfit_desc *acpi_desc,struct nfit_spa *nfit_spa) +static int ars_start (struct acpi_nfit_desc *acpi_desc, +struct nfit_spa *nfit_spa,enum nfit_ars_state req_type) {int rc;int cmd_rc;
@@ -2477,7 +2478,7 @@ static int ars_start(struct acpi_nfit_dememset (&ars_start,0 ,sizeof (ars_start)); ars_start.address = spa->address; ars_start.length = spa->length; -if (test_bit (ARS_SHORT , &nfit_spa->ars_state)) +if (req_type ==ARS_REQ_SHORT ) ars_start.flags =ND_ARS_RETURN_PREV_DATA ;if (nfit_spa_type (spa) ==NFIT_SPA_PM ) ars_start.type =ND_ARS_PERSISTENT ;
@@ -2534,6 +2535,15 @@ static void ars_complete(struct acpi_nfistruct nd_region *nd_region = nfit_spa->nd_region;struct device *dev; +lockdep_assert_held (&acpi_desc->init_mutex); +/* +* Only advance the ARS state for ARS runs initiated by the +* kernel, ignore ARS results from BIOS initiated runs for scrub +* completion tracking. +*/ +if (acpi_desc->scrub_spa != nfit_spa) +return ; +if ((ars_status->address >= spa->address && ars_status->address < spa->address + spa->length) || (ars_status->address < spa->address)) {
@@ -2553,28 +2563,13 @@ static void ars_complete(struct acpi_nfi }else return ; -if (test_bit (ARS_DONE , &nfit_spa->ars_state)) -return ; - -if (!test_and_clear_bit (ARS_REQ , &nfit_spa->ars_state)) -return ; - + acpi_desc->scrub_spa =NULL ;if (nd_region) { dev =nd_region_dev (nd_region);nvdimm_region_notify (nd_region,NVDIMM_REVALIDATE_POISON ); }else dev = acpi_desc->dev; - -dev_dbg (dev,"ARS: range %d %s complete\n" , spa->range_index, -test_bit (ARS_SHORT , &nfit_spa->ars_state) - ?"short" :"long" ); -clear_bit (ARS_SHORT , &nfit_spa->ars_state); -if (test_and_clear_bit (ARS_REQ_REDO , &nfit_spa->ars_state)) { -set_bit (ARS_SHORT , &nfit_spa->ars_state); -set_bit (ARS_REQ , &nfit_spa->ars_state); -dev_dbg (dev,"ARS: processing scrub request received while in progress\n" ); - }else -set_bit (ARS_DONE , &nfit_spa->ars_state); +dev_dbg (dev,"ARS: range %d complete\n" , spa->range_index); }static int ars_status_process_records (struct acpi_nfit_desc *acpi_desc)
@@ -2855,46 +2850,55 @@ static int acpi_nfit_query_poison(structreturn 0 ; } -static int ars_register (struct acpi_nfit_desc *acpi_desc,struct nfit_spa *nfit_spa, -int *query_rc) +static int ars_register (struct acpi_nfit_desc *acpi_desc, +struct nfit_spa *nfit_spa) { -int rc = *query_rc; +int rc; -if (no_init_ars) +if (no_init_ars ||test_bit (ARS_FAILED , &nfit_spa->ars_state))return acpi_nfit_register_region (acpi_desc, nfit_spa); -set_bit (ARS_REQ , &nfit_spa->ars_state); -set_bit (ARS_SHORT , &nfit_spa->ars_state); +set_bit (ARS_REQ_SHORT , &nfit_spa->ars_state); +set_bit (ARS_REQ_LONG , &nfit_spa->ars_state); -switch (rc) { +switch (acpi_nfit_query_poison (acpi_desc)) {case 0 :case -EAGAIN : - rc =ars_start (acpi_desc, nfit_spa); -if (rc == -EBUSY ) { - *query_rc = rc; + rc =ars_start (acpi_desc, nfit_spa,ARS_REQ_SHORT ); +/* shouldn't happen, try again later */ +if (rc == -EBUSY )break ; - }else if (rc ==0 ) { - rc =acpi_nfit_query_poison (acpi_desc); - }else { +if (rc) {set_bit (ARS_FAILED , &nfit_spa->ars_state);break ; } -if (rc == -EAGAIN ) -clear_bit (ARS_SHORT , &nfit_spa->ars_state); -else if (rc ==0 ) -ars_complete (acpi_desc, nfit_spa); +clear_bit (ARS_REQ_SHORT , &nfit_spa->ars_state); + rc =acpi_nfit_query_poison (acpi_desc); +if (rc) +break ; + acpi_desc->scrub_spa = nfit_spa; +ars_complete (acpi_desc, nfit_spa); +/* +* If ars_complete() says we didn't complete the +* short scrub, we'll try again with a long +* request. +*/ + acpi_desc->scrub_spa =NULL ;break ;case -EBUSY : +case -ENOMEM :case -ENOSPC : +/* +* BIOS was using ARS, wait for it to complete (or +* resources to become available) and then perform our +* own scrubs. +*/ break ;default :set_bit (ARS_FAILED , &nfit_spa->ars_state);break ; } -if (test_and_clear_bit (ARS_DONE , &nfit_spa->ars_state)) -set_bit (ARS_REQ , &nfit_spa->ars_state); -return acpi_nfit_register_region (acpi_desc, nfit_spa); }
@@ -2916,6 +2920,8 @@ static unsigned int __acpi_nfit_scrub(ststruct device *dev = acpi_desc->dev;struct nfit_spa *nfit_spa; +lockdep_assert_held (&acpi_desc->init_mutex); +if (acpi_desc->cancel)return 0 ;
@@ -2939,21 +2945,49 @@ static unsigned int __acpi_nfit_scrub(stars_complete_all (acpi_desc);list_for_each_entry (nfit_spa, &acpi_desc->spas, list) { +enum nfit_ars_state req_type; +int rc; +if (test_bit (ARS_FAILED , &nfit_spa->ars_state))continue ; -if (test_bit (ARS_REQ , &nfit_spa->ars_state)) { -int rc =ars_start (acpi_desc, nfit_spa); -clear_bit (ARS_DONE , &nfit_spa->ars_state); - dev =nd_region_dev (nfit_spa->nd_region); -dev_dbg (dev,"ARS: range %d ARS start (%d)\n" , - nfit_spa->spa->range_index, rc); -if (rc ==0 || rc == -EBUSY ) -return 1 ; -dev_err (dev,"ARS: range %d ARS failed (%d)\n" , - nfit_spa->spa->range_index, rc); -set_bit (ARS_FAILED , &nfit_spa->ars_state); +/* prefer short ARS requests first */ +if (test_bit (ARS_REQ_SHORT , &nfit_spa->ars_state)) + req_type =ARS_REQ_SHORT ; +else if (test_bit (ARS_REQ_LONG , &nfit_spa->ars_state)) + req_type =ARS_REQ_LONG ; +else +continue ; + rc =ars_start (acpi_desc, nfit_spa, req_type); + + dev =nd_region_dev (nfit_spa->nd_region); +dev_dbg (dev,"ARS: range %d ARS start %s (%d)\n" , + nfit_spa->spa->range_index, + req_type ==ARS_REQ_SHORT ?"short" :"long" , + rc); +/* +* Hmm, we raced someone else starting ARS? Try again in +* a bit. +*/ +if (rc == -EBUSY ) +return 1 ; +if (rc ==0 ) { +dev_WARN_ONCE (dev, acpi_desc->scrub_spa, +"scrub start while range %d active\n" , + acpi_desc->scrub_spa->spa->range_index); +clear_bit (req_type, &nfit_spa->ars_state); + acpi_desc->scrub_spa = nfit_spa; +/* +* Consider this spa last for future scrub +* requests +*/ +list_move_tail (&nfit_spa->list, &acpi_desc->spas); +return 1 ; } + +dev_err (dev,"ARS: range %d ARS failed (%d)\n" , + nfit_spa->spa->range_index, rc); +set_bit (ARS_FAILED , &nfit_spa->ars_state); }return 0 ; }
@@ -3009,6 +3043,7 @@ static void acpi_nfit_init_ars(struct acstruct nd_cmd_ars_cap ars_cap;int rc; +set_bit (ARS_FAILED , &nfit_spa->ars_state);memset (&ars_cap,0 ,sizeof (ars_cap)); rc =ars_get_cap (acpi_desc, &ars_cap, nfit_spa);if (rc <0 )
@@ -3025,16 +3060,14 @@ static void acpi_nfit_init_ars(struct ac nfit_spa->clear_err_unit = ars_cap.clear_err_unit; acpi_desc->max_ars =max (nfit_spa->max_ars, acpi_desc->max_ars);clear_bit (ARS_FAILED , &nfit_spa->ars_state); -set_bit (ARS_REQ , &nfit_spa->ars_state); }static int acpi_nfit_register_regions (struct acpi_nfit_desc *acpi_desc) {struct nfit_spa *nfit_spa; -int rc, query_rc; +int rc;list_for_each_entry (nfit_spa, &acpi_desc->spas, list) { -set_bit (ARS_FAILED , &nfit_spa->ars_state);switch (nfit_spa_type (nfit_spa->spa)) {case NFIT_SPA_VOLATILE :case NFIT_SPA_PM :
@@ -3043,20 +3076,12 @@ static int acpi_nfit_register_regions(st } } -/* -* Reap any results that might be pending before starting new -* short requests. -*/ - query_rc =acpi_nfit_query_poison (acpi_desc); -if (query_rc ==0 ) -ars_complete_all (acpi_desc); -list_for_each_entry (nfit_spa, &acpi_desc->spas, list)switch (nfit_spa_type (nfit_spa->spa)) {case NFIT_SPA_VOLATILE :case NFIT_SPA_PM :/* register regions and kick off initial ARS run */ - rc =ars_register (acpi_desc, nfit_spa, &query_rc); + rc =ars_register (acpi_desc, nfit_spa);if (rc)return rc;break ;
@@ -3251,7 +3276,8 @@ static int acpi_nfit_clear_to_send(strucreturn 0 ; } -int acpi_nfit_ars_rescan (struct acpi_nfit_desc *acpi_desc,unsigned long flags) +int acpi_nfit_ars_rescan (struct acpi_nfit_desc *acpi_desc, +enum nfit_ars_state req_type) {struct device *dev = acpi_desc->dev;int scheduled =0 , busy =0 ;
@@ -3271,14 +3297,10 @@ int acpi_nfit_ars_rescan(struct acpi_nfiif (test_bit (ARS_FAILED , &nfit_spa->ars_state))continue ; -if (test_and_set_bit (ARS_REQ , &nfit_spa->ars_state)) { +if (test_and_set_bit (req_type, &nfit_spa->ars_state)) busy++; -set_bit (ARS_REQ_REDO , &nfit_spa->ars_state); - }else { -if (test_bit (ARS_SHORT , &flags)) -set_bit (ARS_SHORT , &nfit_spa->ars_state); +else scheduled++; - } }if (scheduled) {sched_ars (acpi_desc);
@@ -3464,10 +3486,11 @@ static void acpi_nfit_update_notify(strustatic void acpi_nfit_uc_error_notify (struct device *dev,acpi_handle handle) {struct acpi_nfit_desc *acpi_desc =dev_get_drvdata (dev); -unsigned long flags = (acpi_desc->scrub_mode ==HW_ERROR_SCRUB_ON ) ? -0 :1 <<ARS_SHORT ; -acpi_nfit_ars_rescan (acpi_desc, flags); +if (acpi_desc->scrub_mode ==HW_ERROR_SCRUB_ON ) +acpi_nfit_ars_rescan (acpi_desc,ARS_REQ_LONG ); +else +acpi_nfit_ars_rescan (acpi_desc,ARS_REQ_SHORT ); }void __acpi_nfit_notify (struct device *dev,acpi_handle handle,u32 event)
drivers/acpi/nfit/nfit.h +5 -5
@@ -118,10 +118,8 @@ enum nfit_dimm_notifiers { };enum nfit_ars_state { -ARS_REQ , -ARS_REQ_REDO , -ARS_DONE , -ARS_SHORT , +ARS_REQ_SHORT , +ARS_REQ_LONG ,ARS_FAILED , };
@@ -198,6 +196,7 @@ struct acpi_nfit_desc {struct device *dev;u8 ars_start_flags;struct nd_cmd_ars_status *ars_status; +struct nfit_spa *scrub_spa;struct delayed_work dwork;struct list_head list;struct kernfs_node *scrub_count_state;
@@ -252,7 +251,8 @@ struct nfit_blk {extern struct list_head acpi_descs;extern struct mutex acpi_desc_lock; -int acpi_nfit_ars_rescan (struct acpi_nfit_desc *acpi_desc,unsigned long flags); +int acpi_nfit_ars_rescan (struct acpi_nfit_desc *acpi_desc, +enum nfit_ars_state req_type);#ifdef CONFIG_X86_MCE void nfit_mce_register (void );
Greg Kroah-Hartman
maintainerPATCH 28/361 kprobes/x86: Use preempt_enable() in optimized_callback()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu <[email protected]>
commit 2e62024c265aa69315ed02835623740030435380 upstream.
The following commit:
a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)
removed local_irq_save/restore() from optimized_callback(), the handler might be interrupted by the rescheduling interrupt and might be rescheduled - so we must not use the preempt_enable_no_resched() macro.
Use preempt_enable() instead, to not lose preemption events.
[ mingo: Improved the changelog. ]
--- arch/x86/kernel/kprobes/opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/opt.c +1 -1
@@ -179,7 +179,7 @@ optimized_callback(struct optimized_kproopt_pre_handler (&op->kp, regs);__this_cpu_write (current_kprobe,NULL ); } -preempt_enable_no_resched (); +preempt_enable (); }NOKPROBE_SYMBOL (optimized_callback);
Greg Kroah-Hartman
maintainerPATCH 29/361 ipmi: Fix timer race with module unload
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Glauber <[email protected]>
commit 0711e8c1b4572d076264e71b0002d223f2666ed7 upstream.
Please note that below oops is from an older kernel, but the same race seems to be present in the upstream kernel too.
---8<---
The following panic was encountered during removing the ipmi_ssif module:
[ 526.352555] Unable to handle kernel paging request at virtual address ffff000006923090 [ 526.360464] Mem abort info: [ 526.363257] ESR = 0x86000007 [ 526.366304] Exception class = IABT (current EL), IL = 32 bits [ 526.372221] SET = 0, FnV = 0 [ 526.375269] EA = 0, S1PTW = 0 [ 526.378405] swapper pgtable: 4k pages, 48-bit VAs, pgd = 000000008ae60416 [ 526.385185] [ffff000006923090] *pgd=000000bffcffe803, *pud=000000bffcffd803, *pmd=0000009f4731a003, *pte=0000000000000000 [ 526.396141] Internal error: Oops: 86000007 [#1] SMP [ 526.401008] Modules linked in: nls_iso8859_1 ipmi_devintf joydev input_leds ipmi_msghandler shpchp sch_fq_codel ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear i2c_smbus hid_generic usbhid uas hid usb_storage ast aes_ce_blk i2c_algo_bit aes_ce_cipher qede ttm crc32_ce ptp crct10dif_ce drm_kms_helper ghash_ce syscopyarea sha2_ce sysfillrect sysimgblt pps_core fb_sys_fops sha256_arm64 sha1_ce mpt3sas qed drm raid_class ahci scsi_transport_sas libahci gpio_xlp i2c_xlp9xx aes_neon_bs aes_neon_blk crypto_simd cryptd aes_arm64 [last unloaded: ipmi_ssif] [ 526.468085] CPU: 125 PID: 0 Comm: swapper/125 Not tainted 4.15.0-35-generic #38~lp1775396+build.1 [ 526.476942] Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL022 08/14/2018 [ 526.484932] pstate: 00400009 (nzcv daif +PAN -UAO) [ 526.489713] pc : 0xffff000006923090 [ 526.493198] lr : call_timer_fn+0x34/0x178 [ 526.497194] sp : ffff000009b0bdd0 [ 526.500496] x29: ffff000009b0bdd0 x28: 0000000000000082 [ 526.505796] x27: 0000000000000002 x26: ffff000009515188 [ 526.511096] x25: ffff000009515180 x24: ffff0000090f1018 [ 526.516396] x23: ffff000009519660 x22: dead000000000200 [ 526.521696] x21: ffff000006923090 x20: 0000000000000100 [ 526.526995] x19: ffff809eeb466a40 x18: 0000000000000000 [ 526.532295] x17: 000000000000000e x16: 0000000000000007 [ 526.537594] x15: 0000000000000000 x14: 071c71c71c71c71c [ 526.542894] x13: 0000000000000000 x12: 0000000000000000 [ 526.548193] x11: 0000000000000001 x10: ffff000009b0be88 [ 526.553493] x9 : 0000000000000000 x8 : 0000000000000005 [ 526.558793] x7 : ffff80befc1f8528 x6 : 0000000000000020 [ 526.564092] x5 : 0000000000000040 x4 : 0000000020001b20 [ 526.569392] x3 : 0000000000000000 x2 : ffff809eeb466a40 [ 526.574692] x1 : ffff000006923090 x0 : ffff809eeb466a40 [ 526.579992] Process swapper/125 (pid: 0, stack limit = 0x000000002eb50acc) [ 526.586854] Call trace: [ 526.589289] 0xffff000006923090 [ 526.592419] expire_timers+0xc8/0x130 [ 526.596070] run_timer_softirq+0xec/0x1b0 [ 526.600070] __do_softirq+0x134/0x328 [ 526.603726] irq_exit+0xc8/0xe0 [ 526.606857] __handle_domain_irq+0x6c/0xc0 [ 526.610941] gic_handle_irq+0x84/0x188 [ 526.614679] el1_irq+0xe8/0x180 [ 526.617822] cpuidle_enter_state+0xa0/0x328 [ 526.621993] cpuidle_enter+0x34/0x48 [ 526.625564] call_cpuidle+0x44/0x70 [ 526.629040] do_idle+0x1b8/0x1f0 [ 526.632256] cpu_startup_entry+0x2c/0x30 [ 526.636174] secondary_start_kernel+0x11c/0x130 [ 526.640694] Code: bad PC value [ 526.643800] ---[ end trace d020b0b8417c2498 ]--- [ 526.648404] Kernel panic - not syncing: Fatal exception in interrupt [ 526.654778] SMP: stopping secondary CPUs [ 526.658734] Kernel Offset: disabled [ 526.662211] CPU features: 0x5800c38 [ 526.665688] Memory Limit: none [ 526.668768] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
Prevent mod_timer from arming a timer that was already removed by del_timer during module unload.
--- drivers/char/ipmi/ipmi_ssif.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/char/ipmi/ipmi_ssif.c +6 -4
@@ -606,8 +606,9 @@ static void msg_done_handler(struct ssif flags =ipmi_ssif_lock_cond (ssif_info, &oflags); ssif_info->waiting_alert = true; ssif_info->rtc_us_timer =SSIF_MSG_USEC ; -mod_timer (&ssif_info->retry_timer, - jiffies +SSIF_MSG_JIFFIES ); +if (!ssif_info->stopping) +mod_timer (&ssif_info->retry_timer, + jiffies +SSIF_MSG_JIFFIES );ipmi_ssif_unlock_cond (ssif_info, flags);return ; }
@@ -939,8 +940,9 @@ static void msg_written_handler(struct s ssif_info->waiting_alert = true; ssif_info->retries_left =SSIF_RECV_RETRIES ; ssif_info->rtc_us_timer =SSIF_MSG_PART_USEC ; -mod_timer (&ssif_info->retry_timer, - jiffies +SSIF_MSG_PART_JIFFIES ); +if (!ssif_info->stopping) +mod_timer (&ssif_info->retry_timer, + jiffies +SSIF_MSG_PART_JIFFIES );ipmi_ssif_unlock_cond (ssif_info, flags); } }
Greg Kroah-Hartman
maintainerPATCH 30/361 mailbox: PCC: handle parse error
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Arcari <[email protected]>
commit afd0b1fb22269f48d68fdf269891c653818c8047 upstream.
acpi_pcc_probe() calls acpi_table_parse_entries_array() but fails to check for an error return. This in turn can result in calling kcalloc() with a negative count as well as emitting the following misleading erorr message:
[ 2.642015] Could not allocate space for PCC mbox channels
--- drivers/mailbox/pcc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/mailbox/pcc.c +5 -2
@@ -461,8 +461,11 @@ static int __init acpi_pcc_probe(void) count =acpi_table_parse_entries_array (ACPI_SIG_PCCT ,sizeof (struct acpi_table_pcct ), proc,ACPI_PCCT_TYPE_RESERVED ,MAX_PCC_SUBSPACES ); -if (count ==0 || count >MAX_PCC_SUBSPACES ) { -pr_warn ("Invalid PCCT: %d PCC subspaces\n" , count); +if (count <=0 || count >MAX_PCC_SUBSPACES ) { +if (count <0 ) +pr_warn ("Error parsing PCC subspaces from PCCT\n" ); +else +pr_warn ("Invalid PCCT: %d PCC subspaces\n" , count);return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 31/361 parisc: Fix address in HPMC IVA
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: John David Anglin <[email protected]>
commit 1138b6718ff74d2a934459643e3754423d23b5e2 upstream.
Helge noticed that the address of the os_hpmc handler was not being correctly calculated in the hpmc macro. As a result, PDCE_CHECK would fail to call os_hpmc:
<Cpu2> e800009802e00000 0000000000000000 CC_ERR_CHECK_HPMC <Cpu2> 37000f7302e00000 8040004000000000 CC_ERR_CPU_CHECK_SUMMARY <Cpu2> f600105e02e00000 fffffff0f0c00000 CC_MC_HPMC_MONARCH_SELECTED <Cpu2> 140003b202e00000 000000000000000b CC_ERR_HPMC_STATE_ENTRY <Cpu2> 5600100b02e00000 00000000000001a0 CC_MC_OS_HPMC_LEN_ERR <Cpu2> 5600106402e00000 fffffff0f0438e70 CC_MC_BR_TO_OS_HPMC_FAILED <Cpu2> e800009802e00000 0000000000000000 CC_ERR_CHECK_HPMC <Cpu2> 37000f7302e00000 8040004000000000 CC_ERR_CPU_CHECK_SUMMARY <Cpu2> 4000109f02e00000 0000000000000000 CC_MC_HPMC_INITIATED <Cpu2> 4000101902e00000 0000000000000000 CC_MC_MULTIPLE_HPMCS <Cpu2> 030010d502e00000 0000000000000000 CC_CPU_STOP
The address problem can be seen by dumping the fault vector:
0000000040159000 <fault_vector_20>:
40159000: 63 6f 77 73 stb r15,-2447(dp)
40159004: 20 63 61 6e ldil L%b747000,r3
40159008: 20 66 6c 79 ldil L%-1c3b3000,r3
...
40159020: 08 00 02 40 nop
40159024: 20 6e 60 02 ldil L%15d000,r3
40159028: 34 63 00 00 ldo 0(r3),r3
4015902c: e8 60 c0 02 bv,n r0(r3)
40159030: 08 00 02 40 nop
40159034: 00 00 00 00 break 0,0
40159038: c0 00 70 00 bb,*< r0,sar,40159840 <fault_vector_20+0x840>
4015903c: 00 00 00 00 break 0,0Location 40159038 should contain the physical address of os_hpmc:
000000004015d000 <os_hpmc>:
4015d000: 08 1a 02 43 copy r26,r3
4015d004: 01 c0 08 a4 mfctl iva,r4
4015d008: 48 85 00 68 ldw 34(r4),r5This patch moves the address setup into initialize_ivt to resolve the above problem. I tested the change by dumping the HPMC entry after setup:
0000000040209020: 8000240
0000000040209024: 206a2004
0000000040209028: 34630ac0000000004020902c: e860c002
0000000040209030: 8000240
0000000040209034: 1bdddce6
0000000040209038: 15d000000000004020903c: 1a0
--- arch/parisc/kernel/entry.S | 2 +- arch/parisc/kernel/traps.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/parisc/kernel/entry.S +1 -1
@@ -186,7 +186,7 @@ bv,n 0(%r3) nop .word 0 /* checksum (will be patched) */ - .word PA(os_hpmc) /* address of handler */ + .word 0 /* address of handler */ .word 0 /* length of handler */ .endm
arch/parisc/kernel/traps.c +2 -1
@@ -802,7 +802,8 @@ void __init initialize_ivt(const void *i* the Length/4 words starting at Address is zero. */ -/* Compute Checksum for HPMC handler */ +/* Setup IVA and compute checksum for HPMC handler */ + ivap[6 ] = (u32 )__pa (os_hpmc); length = os_hpmc_size; ivap[7 ] = length;
Greg Kroah-Hartman
maintainerPATCH 32/361 parisc: Fix map_pages() to not overwrite existing pte entries
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 3c229b3f2dd8133f61bb81d3cb018be92f4bba39 upstream.
Fix a long-existing small nasty bug in the map_pages() implementation which leads to overwriting already written pte entries with zero, *if* map_pages() is called a second time with an end address which isn't aligned on a pmd boundry. This happens for example if we want to remap only the text segment read/write in order to run alternative patching on the code. Exiting the loop when we reach the end address fixes this.
--- arch/parisc/mm/init.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
arch/parisc/mm/init.c +2 -6
@@ -494,12 +494,8 @@ static void __init map_pages(unsigned lo pte =pte_mkhuge (pte); } -if (address >= end_paddr) { -if (force) -break ; -else -pte_val (pte) =0 ; - } +if (address >= end_paddr) +break ;set_pte (pg_table, pte);
Greg Kroah-Hartman
maintainerPATCH 33/361 parisc: Fix exported address of os_hpmc handler
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 99a3ae51d557d8e38a7aece65678a31f9db215ee upstream.
In the C-code we need to put the physical address of the hpmc handler in the interrupt vector table (IVA) in order to get HPMCs working. Since on parisc64 function pointers are indirect (in fact they are function descriptors) we instead export the address as variable and not as function.
This reverts a small part of commit f39cce654f9a ("parisc: Add cfi_startproc and cfi_endproc to assembly code").
--- arch/parisc/kernel/hpmc.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/parisc/kernel/hpmc.S +1 -2
@@ -85,7 +85,7 @@ END(hpmc_pim_data) .import intr_save, code .align 16 -ENTRY_CFI(os_hpmc) +ENTRY(os_hpmc) .os_hpmc: /*
@@ -302,7 +302,6 @@ os_hpmc_6: b . nop .align 16 /* make function length multiple of 16 bytes */ -ENDPROC_CFI(os_hpmc) .os_hpmc_end:
Greg Kroah-Hartman
maintainerPATCH 34/361 ALSA: hda - Add quirk for ASUS G751 laptop
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 11ba6111160290ccd35562f4e05cec08942a6c4c upstream.
ASUS G751 requires the extra COEF initialization to make it microphone working properly.
--- sound/pci/hda/patch_realtek.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/pci/hda/patch_realtek.c +10 -0
@@ -7738,6 +7738,7 @@ enum { ALC662_FIXUP_ASUS_Nx50, ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, ALC668_FIXUP_ASUS_Nx51, +ALC668_FIXUP_ASUS_G751 ,ALC891_FIXUP_HEADSET_MODE ,ALC891_FIXUP_DELL_MIC_NO_PRESENCE , ALC662_FIXUP_ACER_VERITON,
@@ -8007,6 +8008,14 @@ static const struct hda_fixup alc662_fix .chained = true, .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, }, + [ALC668_FIXUP_ASUS_G751] = { + .type = HDA_FIXUP_VERBS, + .v.verbs = (const struct hda_verb []) { + {0x20 ,AC_VERB_SET_COEF_INDEX ,0xc3 }, + {0x20 ,AC_VERB_SET_PROC_COEF ,0x4000 }, + {} + }, + }, [ALC891_FIXUP_HEADSET_MODE] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_headset_mode,
@@ -8080,6 +8089,7 @@ static const struct snd_pci_quirk alc662SND_PCI_QUIRK (0x1043 ,0x11cd ,"Asus N550" , ALC662_FIXUP_ASUS_Nx50),SND_PCI_QUIRK (0x1043 ,0x13df ,"Asus N550JX" ,ALC662_FIXUP_BASS_1A ),SND_PCI_QUIRK (0x1043 ,0x129d ,"Asus N750" , ALC662_FIXUP_ASUS_Nx50), +SND_PCI_QUIRK (0x1043 ,0x12ff ,"ASUS G751" ,ALC668_FIXUP_ASUS_G751 ),SND_PCI_QUIRK (0x1043 ,0x1477 ,"ASUS N56VZ" ,ALC662_FIXUP_BASS_MODE4_CHMAP ),SND_PCI_QUIRK (0x1043 ,0x15a7 ,"ASUS UX51VZH" ,ALC662_FIXUP_BASS_16 ), SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
Greg Kroah-Hartman
maintainerPATCH 35/361 ALSA: hda - Fix headphone pin config for ASUS G751
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 5b7c5e1f4c36b99d0f694f38b9ad910f520cb7ef upstream.
BIOS on ASUS G751 doesn't seem to map the headphone pin (NID 0x16) correctly. Add a quirk to address it, as well as chaining to the previous fix for the microphone.
--- sound/pci/hda/patch_realtek.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +11 -1
@@ -7738,6 +7738,7 @@ enum { ALC662_FIXUP_ASUS_Nx50, ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, ALC668_FIXUP_ASUS_Nx51, +ALC668_FIXUP_MIC_COEF ,ALC668_FIXUP_ASUS_G751 ,ALC891_FIXUP_HEADSET_MODE , ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
@@ -8008,7 +8009,7 @@ static const struct hda_fixup alc662_fix .chained = true, .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, }, - [ALC668_FIXUP_ASUS_G751] = { + [ALC668_FIXUP_MIC_COEF] = { .type = HDA_FIXUP_VERBS, .v.verbs = (const struct hda_verb []) { { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
@@ -8016,6 +8017,15 @@ static const struct hda_fixup alc662_fix {} }, }, + [ALC668_FIXUP_ASUS_G751] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x16 ,0x0421101f },/* HP */ + {} + }, + .chained = true, + .chain_id =ALC668_FIXUP_MIC_COEF + }, [ALC891_FIXUP_HEADSET_MODE] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_headset_mode,
Greg Kroah-Hartman
maintainerPATCH 36/361 ALSA: hda/realtek - Fix the problem of the front MIC on the Lenovo M715
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit d06fb562bff5d14defdacbd92449bacbaedd5cdf upstream.
The front MIC on the Lenovo M715 can't record sound, after applying the ALC294_FIXUP_LENOVO_MIC_LOCATION, the problem is fixed. So add the pin configuration of this machine to the pin quirk table.
--- sound/pci/hda/patch_realtek.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/pci/hda/patch_realtek.c +6 -0
@@ -6843,6 +6843,12 @@ static const struct snd_hda_pin_quirk al {0x21, 0x0221101f}),SND_HDA_PIN_QUIRK (0x10ec0235 ,0x17aa ,"Lenovo" ,ALC294_FIXUP_LENOVO_MIC_LOCATION , {0x14, 0x90170110}, + {0x19, 0x02a11030}, + {0x1a, 0x02a11040}, + {0x1b, 0x01011020}, + {0x21, 0x0221101f}), +SND_HDA_PIN_QUIRK (0x10ec0235 ,0x17aa ,"Lenovo" ,ALC294_FIXUP_LENOVO_MIC_LOCATION , + {0x14, 0x90170110}, {0x19, 0x02a11020}, {0x1a, 0x02a11030}, {0x21, 0x0221101f}),
Greg Kroah-Hartman
maintainerPATCH 37/361 ALSA: hda - Add mic quirk for the Lenovo G50-30 (17aa:3905)
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Cline <[email protected]>
commit e7bb6ad5685f05685dd8a6a5eda7bfcd14d5f95b upstream.
The Lenovo G50-30, like other G50 models, has a Conexant codec that requires a quirk for its inverted stereo dmic.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1249364
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -943,6 +943,7 @@ static const struct snd_pci_quirk cxt506SND_PCI_QUIRK (0x17aa ,0x21da ,"Lenovo X220" ,CXT_PINCFG_LENOVO_TP410 ),SND_PCI_QUIRK (0x17aa ,0x21db ,"Lenovo X220-tablet" ,CXT_PINCFG_LENOVO_TP410 ),SND_PCI_QUIRK (0x17aa ,0x38af ,"Lenovo IdeaPad Z560" ,CXT_FIXUP_MUTE_LED_EAPD ), +SND_PCI_QUIRK (0x17aa ,0x3905 ,"Lenovo G50-30" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x390b ,"Lenovo G50-80" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x3975 ,"Lenovo U300s" ,CXT_FIXUP_STEREO_DMIC ), SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
Greg Kroah-Hartman
maintainerPATCH 38/361 ALSA: hda: Add 2 more models to the power_save blacklist
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 5cb6b5fc013ee711d19bfc4e9deb8d6ae80741db upstream.
Power-saving is causing plops on audio start/stop on Dell Precision T3600 laptops and Intel DZ77BH boards, add these to the power_save blacklist.
--- sound/pci/hda/hda_intel.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/pci/hda/hda_intel.c +4 -0
@@ -2257,8 +2257,12 @@ static struct snd_pci_quirk power_save_b/* https://bugzilla.redhat.com/show_bug.cgi?id=1581607 */ SND_PCI_QUIRK (0x1558 ,0x3501 ,"Clevo W35xSS_370SS" ,0 ),/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ +SND_PCI_QUIRK (0x1028 ,0x0497 ,"Dell Precision T3600" ,0 ), +/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ /* Note the P55A-UD3 and Z87-D3HP share the subsys id for the HDA dev */ SND_PCI_QUIRK (0x1458 ,0xa002 ,"Gigabyte P55A-UD3 / Z87-D3HP" ,0 ), +/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ +SND_PCI_QUIRK (0x8086 ,0x2040 ,"Intel DZ77BH-55K" ,0 ),/* https://bugzilla.kernel.org/show_bug.cgi?id=199607 */ SND_PCI_QUIRK(0x8086, 0x2057, "Intel NUC5i7RYB", 0),/* https://bugzilla.redhat.com/show_bug.cgi?id=1520902 */
Greg Kroah-Hartman
maintainerPATCH 39/361 ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Stanoev <[email protected]>
commit ac237c28d5ac1b241d58b1b7b4b9fa10efb22fb5 upstream.
The Creative Audigy SE (SB0570) card currently exhibits an audible pop whenever playback is stopped or resumed, or during silent periods of an audio stream. Initialise the IZD bit to the 0 to eliminate these pops.
The Infinite Zero Detection (IZD) feature on the DAC causes the output to be shunted to Vcap after 2048 samples of silence. This discharges the AC coupling capacitor through the output and causes the aforementioned pop/click noise.
The behaviour of the IZD bit is described on page 15 of the WM8768GEDS
datasheet: "With IZD=1, applying MUTE for 1024 consecutive input samples will cause all outputs to be connected directly to VCAP. This also happens if 2048 consecutive zero input samples are applied to all 6 channels, and IZD=0. It will be removed as soon as any channel receives a non-zero input". I believe the second sentence might be referring to IZD=1 instead of IZD=0 given the observed behaviour of the card.
This change should make the DAC initialisation consistent with Creative's Windows driver, as this popping persists when initialising the card in Linux and soft rebooting into Windows, but is not present on a cold boot to Windows.
--- sound/pci/ca0106/ca0106.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ca0106/ca0106.h +1 -1
@@ -582,7 +582,7 @@#define SPI_PL_BIT_R_R (2<<7)/* right channel = right */ #define SPI_PL_BIT_R_C (3<<7)/* right channel = (L+R)/2 */ #define SPI_IZD_REG 2 -#define SPI_IZD_BIT (1<<4)/* infinite zero detect */ +#define SPI_IZD_BIT (0<<4)/* infinite zero detect */ #define SPI_FMT_REG 3#define SPI_FMT_BIT_RJ (0<<0)/* right justified mode */
Greg Kroah-Hartman
maintainerPATCH 40/361 ALSA: hda - Fix incorrect clearance of thinkpad_acpi hooks
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 5e93a125f521efd00d71af31c2a301f3d46af48c upstream.
Since the commit c647f806b8c2 ("ALSA: hda - Allow multiple ADCs for mic mute LED controls") we allow enabling the mic mute LED with multiple ADCs. The commit changed the function return value to be zero or a negative error, while this change was overlooked in the thinkpad_acpi helper code where it still expects a positive return value for success. This eventually leads to a NULL dereference on a system that has only a mic mute LED.
This patch corrects the return value check in the corresponding code as well.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201621
--- sound/pci/hda/thinkpad_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/hda/thinkpad_helper.c +2 -2
@@ -58,8 +58,8 @@ static void hda_fixup_thinkpad_acpi(stru removefunc = false; }if (led_set_func (TPACPI_LED_MICMUTE , false) >=0 && -snd_hda_gen_add_micmute_led (codec, - update_tpacpi_micmute) >0 ) + !snd_hda_gen_add_micmute_led (codec, + update_tpacpi_micmute)) removefunc = false; }
Greg Kroah-Hartman
maintainerPATCH 41/361 x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Kosina <[email protected]>
commit 53c613fe6349994f023245519265999eed75957f upstream.
STIBP is a feature provided by certain Intel ucodes / CPUs. This feature (once enabled) prevents cross-hyperthread control of decisions made by indirect branch predictors.
Enable this feature if
- the CPU is vulnerable to spectre v2
- the CPU supports SMT and has SMT siblings online
- spectre_v2 mitigation autoselection is enabled (default)
After some previous discussion, this leaves STIBP on all the time, as wrmsr on crossing kernel boundary is a no-no. This could perhaps later be a bit more optimized (like disabling it in NOHZ, experiment with disabling it in idle, etc) if needed.
Note that the synchronization of the mask manipulation via newly added spec_ctrl_mutex is currently not strictly needed, as the only updater is already being serialized by cpu_add_remove_lock, but let's make this a little bit more future-proof.
--- arch/x86/kernel/cpu/bugs.c | 57 ++++++++++++++++++++++++++++++++++++++++----- kernel/cpu.c | 11 +++++++- 2 files changed, 61 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/bugs.c +51 -6
@@ -35,12 +35,10 @@ static void __init spectre_v2_select_mitstatic void __init ssb_select_mitigation (void );static void __init l1tf_select_mitigation (void ); -/* -* Our boot-time value of the SPEC_CTRL MSR. We read it once so that any -* writes to SPEC_CTRL contain whatever reserved bits have been set. -*/ -u64 __ro_after_init x86_spec_ctrl_base; +/* The base value of the SPEC_CTRL MSR that always has to be preserved. */ +u64 x86_spec_ctrl_base;EXPORT_SYMBOL_GPL (x86_spec_ctrl_base); +static DEFINE_MUTEX (spec_ctrl_mutex);/* * The vendor and possibly platform specific bits which can be modified in
@@ -325,6 +323,46 @@ static enum spectre_v2_mitigation_cmd __return cmd; } +static bool stibp_needed (void ) +{ +if (spectre_v2_enabled ==SPECTRE_V2_NONE ) +return false; + +if (!boot_cpu_has (X86_FEATURE_STIBP )) +return false; + +return true; +} + +static void update_stibp_msr (void *info) +{ +wrmsrl (MSR_IA32_SPEC_CTRL , x86_spec_ctrl_base); +} + +void arch_smt_update (void ) +{ +u64 mask; + +if (!stibp_needed ()) +return ; + +mutex_lock (&spec_ctrl_mutex); + mask = x86_spec_ctrl_base; +if (cpu_smt_control ==CPU_SMT_ENABLED ) + mask |=SPEC_CTRL_STIBP ; +else + mask &= ~SPEC_CTRL_STIBP ; + +if (mask != x86_spec_ctrl_base) { +pr_info ("Spectre v2 cross-process SMT mitigation: %s STIBP\n" , + cpu_smt_control ==CPU_SMT_ENABLED ? +"Enabling" :"Disabling" ); + x86_spec_ctrl_base = mask; +on_each_cpu (update_stibp_msr,NULL ,1 ); + } +mutex_unlock (&spec_ctrl_mutex); +} +static void __init spectre_v2_select_mitigation (void ) {enum spectre_v2_mitigation_cmd cmd =spectre_v2_parse_cmdline ();
@@ -424,6 +462,9 @@ specv2_set_mode:setup_force_cpu_cap (X86_FEATURE_USE_IBRS_FW );pr_info ("Enabling Restricted Speculation for firmware calls\n" ); } + +/* Enable STIBP if appropriate */ +arch_smt_update (); }#undef pr_fmt
@@ -814,6 +855,8 @@ static ssize_t l1tf_show_state(char *bufstatic ssize_t cpu_show_common (struct device *dev,struct device_attribute *attr,char *buf,unsigned int bug) { +int ret; +if (!boot_cpu_has_bug (bug))return sprintf (buf,"Not affected\n" );
@@ -831,10 +874,12 @@ static ssize_t cpu_show_common(struct dereturn sprintf (buf,"Mitigation: __user pointer sanitization\n" );case X86_BUG_SPECTRE_V2 : -return sprintf (buf,"%s%s%s%s\n" , spectre_v2_strings[spectre_v2_enabled], + ret =sprintf (buf,"%s%s%s%s%s\n" , spectre_v2_strings[spectre_v2_enabled],boot_cpu_has (X86_FEATURE_USE_IBPB ) ?", IBPB" :"" ,boot_cpu_has (X86_FEATURE_USE_IBRS_FW ) ?", IBRS_FW" :"" , + (x86_spec_ctrl_base &SPEC_CTRL_STIBP ) ?", STIBP" :"" ,spectre_v2_module_string ()); +return ret;case X86_BUG_SPEC_STORE_BYPASS :return sprintf (buf,"%s\n" , ssb_strings[ssb_mode]);
kernel/cpu.c +10 -1
@@ -2026,6 +2026,12 @@ static void cpuhp_online_cpu_device(unsikobject_uevent (&dev->kobj,KOBJ_ONLINE ); } +/* +* Architectures that need SMT-specific errata handling during SMT hotplug +* should override this. +*/ +void __weak arch_smt_update (void ) { }; +static int cpuhp_smt_disable (enum cpuhp_smt_control ctrlval) {int cpu, ret =0 ;
@@ -2052,8 +2058,10 @@ static int cpuhp_smt_disable(enum cpuhp_*/ cpuhp_offline_cpu_device (cpu); } -if (!ret) +if (!ret) { cpu_smt_control = ctrlval; +arch_smt_update (); + }cpu_maps_update_done ();return ret; }
@@ -2064,6 +2072,7 @@ static int cpuhp_smt_enable(void)cpu_maps_update_begin (); cpu_smt_control =CPU_SMT_ENABLED ; +arch_smt_update ();for_each_present_cpu (cpu) {/* Skip online CPUs and CPUs on offline nodes */ if (cpu_online (cpu) || !node_online (cpu_to_node (cpu)))
Re: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Greg, please drop this patch from all -stable for now. Version that wouldn't have such performance impact is being worked on.
Signature · 2 lines
Jiri Kosina SUSE Labs
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Quoted 6 lines · Jiri Kosina
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Greg, please drop this patch from all -stable for now. Version that wouldn't have such performance impact is being worked on.
Is it reverted in Linus's tree? If not, then anything that comes "later on" will not apply here, right?
I see the thread asking about this, but I got really conflicting messages here, and now it's in all of the latest releases, and no testing seems to have uncovered issues. Is it just a "slow down" problem?
thanks,
greg k-h
Re: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Jiri Kosina
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Greg, please drop this patch from all -stable for now. Version that wouldn't have such performance impact is being worked on.
Quoted 7 lines
Is it reverted in Linus's tree? If not, then anything that comes "later on" will not apply here, right?
I see the thread asking about this, but I got really conflicting messages here, and now it's in all of the latest releases, and no testing seems to have uncovered issues. Is it just a "slow down" problem?
Greg,
It could be a big slow down in excess of 20% for some applications. And cross sibling Spectre v2 attack is quite hard to pull off.
So till we have the accompanying patchset that only apply STIBP on processes that really need it instead of universally, it should be withheld from stable.
Tim
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Quoted 17 lines · Tim Chen
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Jiri Kosina
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Greg, please drop this patch from all -stable for now. Version that wouldn't have such performance impact is being worked on.
Quoted 7 lines
Is it reverted in Linus's tree? If not, then anything that comes "later on" will not apply here, right?
I see the thread asking about this, but I got really conflicting messages here, and now it's in all of the latest releases, and no testing seems to have uncovered issues. Is it just a "slow down" problem?
Quoted 8 lines
Greg,
It could be a big slow down in excess of 20% for some applications. And cross sibling Spectre v2 attack is quite hard to pull off.
So till we have the accompanying patchset that only apply STIBP on processes that really need it instead of universally, it should be withheld from stable.
Ok, now reverted, thanks.
greg k-h
Re: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
In reply to Tim ChenQuoted 8 lines · Tim Chen
Quoted 7 lines
Is it reverted in Linus's tree? If not, then anything that comes "later on" will not apply here, right?
I see the thread asking about this, but I got really conflicting messages here, and now it's in all of the latest releases, and no testing seems to have uncovered issues. Is it just a "slow down" problem?
Quoted 8 lines
Greg,
It could be a big slow down in excess of 20% for some applications. And cross sibling Spectre v2 attack is quite hard to pull off.
So till we have the accompanying patchset that only apply STIBP on processes that really need it instead of universally, it should be withheld from stable.
Agreed; it will be trivially reintroduced with the rest, once it's ready. It's being built on top of that patch.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Re: [PATCH 4.19 041/361] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
Quoted 15 lines · Jiri Kosina
Quoted 13 lines · Tim Chen
Quoted 7 lines
Is it reverted in Linus's tree? If not, then anything that comes "later on" will not apply here, right?
I see the thread asking about this, but I got really conflicting messages here, and now it's in all of the latest releases, and no testing seems to have uncovered issues. Is it just a "slow down" problem?
Greg,
It could be a big slow down in excess of 20% for some applications. And cross sibling Spectre v2 attack is quite hard to pull off.
Quoted 7 lines
Quoted 3 lines
So till we have the accompanying patchset that only apply STIBP on processes that really need it instead of universally, it should be withheld from stable.
Agreed; it will be trivially reintroduced with the rest, once it's ready. It's being built on top of that patch.
Thanks. Appreciate it.
Tim
Greg Kroah-Hartman
maintainerPATCH 42/361 x86/xen: Fix boot loader version reported for PVH guests
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
commit 357d291ce035d1b757568058f3c9898c60d125b1 upstream.
The boot loader version reported via sysfs is wrong in case of the kernel being booted via the Xen PVH boot entry. it should be 2.12 (0x020c), but it is reported to be 2.18 (0x0212).
As the current way to set the version is error prone use the more readable variant (2 << 8) | 12.
--- arch/x86/xen/enlighten_pvh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/enlighten_pvh.c +1 -1
@@ -75,7 +75,7 @@ static void __init init_pvh_bootparams(v* Version 2.12 supports Xen entry point but we will use default x86/PC * environment (i.e. hardware_subarch 0). */ - pvh_bootparams.hdr.version =0x212 ; + pvh_bootparams.hdr.version = (2 <<8 ) |12 ; pvh_bootparams.hdr.type_of_loader = (9 <<4 ) |0 ;/* Xen loader */ x86_init.acpi.get_root_pointer = pvh_get_root_pointer;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Greg Kroah-Hartman
maintainerPATCH 43/361 x86/corruption-check: Fix panic in memory_corruption_check() when boot option without value is provided
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: He Zhe <[email protected]>
commit ccde460b9ae5c2bd5e4742af0a7f623c2daad566 upstream.
memory_corruption_check[{_period|_size}]()'s handlers do not check input argument before passing it to kstrtoul() or simple_strtoull(). The argument would be a NULL pointer if each of the kernel parameters, without its value, is set in command line and thus cause the following panic.
PANIC: early exception 0xe3 IP 10:ffffffff73587c22 error 0 cr2 0x0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.18-rc8+ #2 [ 0.000000] RIP: 0010:kstrtoull+0x2/0x10 ... [ 0.000000] Call Trace [ 0.000000] ? set_corruption_check+0x21/0x49 [ 0.000000] ? do_early_param+0x4d/0x82 [ 0.000000] ? parse_args+0x212/0x330 [ 0.000000] ? rdinit_setup+0x26/0x26 [ 0.000000] ? parse_early_options+0x20/0x23 [ 0.000000] ? rdinit_setup+0x26/0x26 [ 0.000000] ? parse_early_param+0x2d/0x39 [ 0.000000] ? setup_arch+0x2f7/0xbf4 [ 0.000000] ? start_kernel+0x5e/0x4c2 [ 0.000000] ? load_ucode_bsp+0x113/0x12f [ 0.000000] ? secondary_startup_64+0xa5/0xb0
This patch adds checks to prevent the panic.
--- arch/x86/kernel/check.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/x86/kernel/check.c +15 -0
@@ -31,6 +31,11 @@ static __init int set_corruption_check(cssize_t ret;unsigned long val; +if (!arg) { +pr_err ("memory_corruption_check config string not provided\n" ); +return -EINVAL ; + } + ret =kstrtoul (arg,10 , &val);if (ret)return ret;
@@ -45,6 +50,11 @@ static __init int set_corruption_check_pssize_t ret;unsigned long val; +if (!arg) { +pr_err ("memory_corruption_check_period config string not provided\n" ); +return -EINVAL ; + } + ret =kstrtoul (arg,10 , &val);if (ret)return ret;
@@ -59,6 +69,11 @@ static __init int set_corruption_check_schar *end;unsigned size; +if (!arg) { +pr_err ("memory_corruption_check_size config string not provided\n" ); +return -EINVAL ; + } + size =memparse (arg, &end);if (*end =='\0' )
Greg Kroah-Hartman
maintainerPATCH 44/361 x86/kvm/nVMX: allow bare VMXON state migration
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Kuznetsov <[email protected]>
commit a1b0c1c64dfef0cff8555bb708bfc5d7c66c6ca4 upstream.
It is perfectly valid for a guest to do VMXON and not do VMPTRLD. This state needs to be preserved on migration.
--- arch/x86/kvm/vmx.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
arch/x86/kvm/vmx.c +8 -7
@@ -14010,13 +14010,6 @@ static int vmx_set_nested_state(struct kif (!page_address_valid (vcpu, kvm_state->vmx.vmxon_pa))return -EINVAL ; -if (kvm_state->size <sizeof (kvm_state) +sizeof (*vmcs12)) -return -EINVAL ; - -if (kvm_state->vmx.vmcs_pa == kvm_state->vmx.vmxon_pa || - !page_address_valid (vcpu, kvm_state->vmx.vmcs_pa)) -return -EINVAL ; -if ((kvm_state->vmx.smm.flags &KVM_STATE_NESTED_SMM_GUEST_MODE ) && (kvm_state->flags &KVM_STATE_NESTED_GUEST_MODE ))return -EINVAL ;
@@ -14046,6 +14039,14 @@ static int vmx_set_nested_state(struct kif (ret)return ret; +/* Empty 'VMXON' state is permitted */ +if (kvm_state->size <sizeof (kvm_state) +sizeof (*vmcs12)) +return 0 ; + +if (kvm_state->vmx.vmcs_pa == kvm_state->vmx.vmxon_pa || + !page_address_valid (vcpu, kvm_state->vmx.vmcs_pa)) +return -EINVAL ; +set_current_vmptr (vmx, kvm_state->vmx.vmcs_pa);if (kvm_state->vmx.smm.flags &KVM_STATE_NESTED_SMM_VMXON ) {
Greg Kroah-Hartman
maintainerPATCH 45/361 x86/mm/pat: Disable preemption around __flush_tlb_all()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit f77084d96355f5fba8e2c1fb3a51a393b1570de7 upstream.
The WARN_ON_ONCE(__read_cr3() != build_cr3()) in switch_mm_irqs_off() triggers every once in a while during a snapshotted system upgrade.
The warning triggers since commit decab0888e6e ("x86/mm: Remove preempt_disable/enable() from __native_flush_tlb()"). The callchain is:
get_page_from_freelist() -> post_alloc_hook() -> __kernel_map_pages()
with CONFIG_DEBUG_PAGEALLOC enabled.
Disable preemption during CR3 reset / __flush_tlb_all() and add a comment why preemption has to be disabled so it won't be removed accidentaly.
Add another preemptible() check in __flush_tlb_all() to catch callers with enabled preemption when PGE is enabled, because PGE enabled does not trigger the warning in __native_flush_tlb(). Suggested by Andy Lutomirski.
--- arch/x86/include/asm/tlbflush.h | 6 ++++++ arch/x86/mm/pageattr.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-)
arch/x86/include/asm/tlbflush.h +6 -0
@@ -469,6 +469,12 @@ static inline void __native_flush_tlb_on*/ static inline void __flush_tlb_all (void ) { +/* +* This is to catch users with enabled preemption and the PGE feature +* and don't trigger the warning in __native_flush_tlb(). +*/ +VM_WARN_ON_ONCE (preemptible ()); +if (boot_cpu_has (X86_FEATURE_PGE )) {__flush_tlb_global (); }else {
arch/x86/mm/pageattr.c +5 -1
@@ -2086,9 +2086,13 @@ void __kernel_map_pages(struct page *pag/* * We should perform an IPI and flush all tlbs, -* but that can deadlock->flush only current cpu: +* but that can deadlock->flush only current cpu. +* Preemption needs to be disabled around __flush_tlb_all() due to +* CR3 reload in __native_flush_tlb(). */ +preempt_disable ();__flush_tlb_all (); +preempt_enable ();arch_flush_lazy_mmu_mode (); }
Greg Kroah-Hartman
maintainerPATCH 46/361 x86/numa_emulation: Fix uniform-split numa emulation
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <[email protected]>
commit c6ee7a548e2c291398b4f32c1f741c66b9f98e1c upstream.
The numa_emulation() routine in the 'uniform' case walks through all the physical 'memblk' instances and divides them into N emulated nodes with split_nodes_size_interleave_uniform(). As each physical node is consumed it is removed from the physical memblk array in the numa_remove_memblk_from() helper.
Since split_nodes_size_interleave_uniform() handles advancing the array as the 'memblk' is consumed it is expected that the base of the array is always specified as the argument.
Otherwise, on multi-socket (> 2) configurations the uniform-split capability can generate an invalid numa configuration leading to boot failures with signatures like the following:
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
Sending NMI from CPU 0 to CPUs 2:
NMI backtrace for cpu 2
CPU: 2 PID: 1332 Comm: pgdatinit0 Not tainted 4.19.0-rc8-next-20181019-baseline #59
RIP: 0010:__init_single_page.isra.74+0x81/0x90
[..]
Call Trace:
deferred_init_pages+0xaa/0xe3
deferred_init_memmap+0x18f/0x318
kthread+0xf8/0x130
? deferred_free_pages.isra.105+0xc9/0xc9
? kthread_stop+0x110/0x110
ret_from_fork+0x35/0x40--- arch/x86/mm/numa_emulation.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/x86/mm/numa_emulation.c +10 -2
@@ -400,9 +400,17 @@ void __init numa_emulation(struct numa_m n =simple_strtoul (emu_cmdline, &emu_cmdline,0 ); ret =-1 ;for_each_node_mask (i, physnode_mask) { +/* +* The reason we pass in blk[0] is due to +* numa_remove_memblk_from() called by +* emu_setup_memblk() will delete entry 0 +* and then move everything else up in the pi.blk +* array. Therefore we should always be looking +* at blk[0]. +*/ ret =split_nodes_size_interleave_uniform (&ei, &pi, - pi.blk[i].start, pi.blk[i].end,0 , - n, &pi.blk[i], nid); + pi.blk[0 ].start, pi.blk[0 ].end,0 , + n, &pi.blk[0 ], nid);if (ret <0 )break ;if (ret < n) {
Greg Kroah-Hartman
maintainerPATCH 47/361 ARM: dts: exynos: Disable pull control for MAX8997 interrupts on Origen
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
commit f5e758b8358f6c27e8a351ddf0b441a64cdabb94 upstream.
PMIC_IRQB and PMIC_KEYINB lines on Exynos4210-based Origen board have external pull-up resistors, so disable any pull control for those lines in respective pin controller node. This fixes support for MAX8997 interrupts and enables operation of wakeup from MAX8997 RTC alarm.
--- arch/arm/boot/dts/exynos4210-origen.dts | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/exynos4210-origen.dts +9 -0
@@ -151,6 +151,8 @@ reg = <0x66>; interrupt-parent = <&gpx0>; interrupts = <4 IRQ_TYPE_NONE>, <3 IRQ_TYPE_NONE>; + pinctrl-names = "default"; + pinctrl-0 = <&max8997_irq>; max8997,pmic-buck1-dvs-voltage = <1350000>; max8997,pmic-buck2-dvs-voltage = <1100000>;
@@ -288,6 +290,13 @@ }; }; +&pinctrl_1 { + max8997_irq: max8997-irq { + samsung,pins = "gpx0-3", "gpx0-4"; + samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; + }; +}; + &sdhci_0 { bus-width = <4>; pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_cd>;
Greg Kroah-Hartman
maintainerPATCH 48/361 net: socionext: Reset tx queue in ndo_stop
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahisa Kojima <[email protected]>
[ Upstream commit 8d5b0bf611ec5b7618d5b772dddc93b8afa78cb8 ]
We observed that packets and bytes count are not reset when user performs interface down. Eventually, tx queue is exhausted and packets will not be sent out.
To avoid this problem, resets tx queue in ndo_stop.
--- drivers/net/ethernet/socionext/netsec.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/socionext/netsec.c +3 -0
@@ -940,6 +940,9 @@ static void netsec_uninit_pkt_dring(stru dring->head =0 ; dring->tail =0 ; dring->pkt_cnt =0 ; + +if (id ==NETSEC_RING_TX ) +netdev_reset_queue (priv->ndev); }static void netsec_free_dring (struct netsec_priv *priv,int id)
Greg Kroah-Hartman
maintainerPATCH 49/361 net: loopback: clear skb->tstamp before netif_rx()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 4c16128b6271e70c8743178e90cccee147858503 ]
At least UDP / TCP stacks can now cook skbs with a tstamp using MONOTONIC base (or arbitrary values with SCM_TXTIME)
Since loopback driver does not call (directly or indirectly) skb_scrub_packet(), we need to clear skb->tstamp so that net_timestamp_check() can eventually resample the time, using ktime_get_real().
--- drivers/net/loopback.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/loopback.c +4 -0
@@ -75,6 +75,10 @@ static netdev_tx_t loopback_xmit(structint len;skb_tx_timestamp (skb); + +/* do not fool net_timestamp_check() with various clock bases */ + skb->tstamp =0 ; +skb_orphan (skb);/* Before queueing this packet to netif_rx(),
Greg Kroah-Hartman
maintainerPATCH 50/361 locking/lockdep: Fix debug_locks off performance problem
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
[ Upstream commit 9506a7425b094d2f1d9c877ed5a78f416669269b ]
It was found that when debug_locks was turned off because of a problem found by the lockdep code, the system performance could drop quite significantly when the lock_stat code was also configured into the kernel. For instance, parallel kernel build time on a 4-socket x86-64 server nearly doubled.
Further analysis into the cause of the slowdown traced back to the frequent call to debug_locks_off() from the __lock_acquired() function probably due to some inconsistent lockdep states with debug_locks off. The debug_locks_off() function did an unconditional atomic xchg to write a 0 value into debug_locks which had already been set to 0. This led to severe cacheline contention in the cacheline that held debug_locks. As debug_locks is being referenced in quite a few different places in the kernel, this greatly slow down the system performance.
To prevent that trashing of debug_locks cacheline, lock_acquired() and lock_contended() now checks the state of debug_locks before proceeding. The debug_locks_off() function is also modified to check debug_locks before calling __debug_locks_off().
--- kernel/locking/lockdep.c | 4 ++-- lib/debug_locks.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/locking/lockdep.c +2 -2
@@ -4122,7 +4122,7 @@ void lock_contended(struct lockdep_map * {unsigned long flags; -if (unlikely (!lock_stat)) +if (unlikely (!lock_stat || !debug_locks))return ;if (unlikely (current->lockdep_recursion))
@@ -4142,7 +4142,7 @@ void lock_acquired(struct lockdep_map *l {unsigned long flags; -if (unlikely (!lock_stat)) +if (unlikely (!lock_stat || !debug_locks))return ;if (unlikely (current->lockdep_recursion))
lib/debug_locks.c +1 -1
@@ -37,7 +37,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);*/ int debug_locks_off (void ) { -if (__debug_locks_off ()) { +if (debug_locks &&__debug_locks_off ()) {if (!debug_locks_silent) {console_verbose ();return 1 ;
Greg Kroah-Hartman
maintainerPATCH 51/361 netfilter: xt_nat: fix DNAT target for shifted portmap ranges
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
[ Upstream commit cb20f2d2c0507d60d94ef896991e95708f051dd1 ]
The commit 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges") did not set the checkentry/destroy callbacks for the newly added DNAT target. As a result, rulesets using only such nat targets are not effective, as the relevant conntrack hooks are not enabled.
The above affect also nft_compat rulesets.
Fix the issue adding the missing initializers.
--- net/netfilter/xt_nat.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/xt_nat.c +2 -0
@@ -216,6 +216,8 @@ static struct xt_target xt_nat_target_re { .name = "DNAT", .revision = 2, + .checkentry = xt_nat_checkentry, + .destroy = xt_nat_destroy, .target = xt_dnat_target_v2, .targetsize = sizeof(struct nf_nat_range2), .table = "nat",
Greg Kroah-Hartman
maintainerPATCH 52/361 ataflop: fix error handling during setup
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <[email protected]>
[ Upstream commit 71327f547ee3a46ec5c39fdbbd268401b2578d0e ]
Move queue allocation next to disk allocation to fix a couple of issues:
- If add_disk() hasn't been called, we should clear disk->queue before calling put_disk().
- If we fail to allocate a request queue, we still need to put all of the disks, not just the ones that we allocated queues for.
--- drivers/block/ataflop.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/block/ataflop.c +15 -10
@@ -1935,6 +1935,11 @@ static int __init atari_floppy_init (voi unit[i].disk =alloc_disk (1 );if (!unit[i].disk) goto Enomem; + + unit[i].disk->queue =blk_init_queue (do_fd_request, + &ataflop_lock); +if (!unit[i].disk->queue) + goto Enomem; }if (UseTrackbuffer <0 )
@@ -1966,10 +1971,6 @@ static int __init atari_floppy_init (voisprintf (unit[i].disk->disk_name,"fd%d" , i); unit[i].disk->fops = &floppy_fops; unit[i].disk->private_data = &unit[i]; - unit[i].disk->queue =blk_init_queue (do_fd_request, - &ataflop_lock); -if (!unit[i].disk->queue) - goto Enomem;set_capacity (unit[i].disk,MAX_DISK_SIZE *2 );add_disk (unit[i].disk); }
@@ -1984,13 +1985,17 @@ static int __init atari_floppy_init (voireturn 0 ; Enomem: -while (i--) { -struct request_queue *q = unit[i].disk->queue; +do { +struct gendisk *disk = unit[i].disk; -put_disk (unit[i].disk); -if (q) -blk_cleanup_queue (q); - } +if (disk) { +if (disk->queue) { +blk_cleanup_queue (disk->queue); + disk->queue =NULL ; + } +put_disk (unit[i].disk); + } + }while (i--);unregister_blkdev (FLOPPY_MAJOR ,"fd" );return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 53/361 swim: fix cleanup on setup error
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <[email protected]>
[ Upstream commit 1448a2a5360ae06f25e2edc61ae070dff5c0beb4 ]
If we fail to allocate the request queue for a disk, we still need to free that disk, not just the previous ones. Additionally, we need to cleanup the previous request queues.
--- drivers/block/swim.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/block/swim.c +11 -2
@@ -887,8 +887,17 @@ static int swim_floppy_init(struct swim_ exit_put_disks:unregister_blkdev (FLOPPY_MAJOR ,"fd" ); -while (drive--) -put_disk (swd->unit[drive].disk); +do { +struct gendisk *disk = swd->unit[drive].disk; + +if (disk) { +if (disk->queue) { +blk_cleanup_queue (disk->queue); + disk->queue =NULL ; + } +put_disk (disk); + } + }while (drive--);return err; }
Greg Kroah-Hartman
maintainerPATCH 54/361 arm64: cpufeature: ctr: Fix cpu capability check for late CPUs
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suzuki K Poulose <[email protected]>
[ Upstream commit 8ab66cbe63aeaf9e5970fb4aaef1c660fca59321 ]
The matches() routine for a capability must honor the "scope" passed to it and return the proper results.
i.e, when passed with SCOPE_LOCAL_CPU, it should check the status of the capability on the current CPU. This is used by verify_local_cpu_capabilities() on a late secondary CPU to make sure that it's compliant with the established system features. However, ARM64_HAS_CACHE_{IDC/DIC} always checks the system wide registers and this could mean that a late secondary CPU could return "true" (since the CPU hasn't updated the system wide registers yet) and thus lead the system in an inconsistent state, where the system assumes it has IDC/DIC feature, while the new CPU doesn't.
--- arch/arm64/kernel/cpufeature.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
arch/arm64/kernel/cpufeature.c +18 -4
@@ -848,15 +848,29 @@ static bool has_no_fpsimd(const struct a }static bool has_cache_idc (const struct arm64_cpu_capabilities *entry, -int __unused) +int scope) { -return read_sanitised_ftr_reg (SYS_CTR_EL0 ) &BIT (CTR_IDC_SHIFT ); +u64 ctr; + +if (scope ==SCOPE_SYSTEM ) + ctr = arm64_ftr_reg_ctrel0.sys_val; +else + ctr =read_cpuid_cachetype (); + +return ctr &BIT (CTR_IDC_SHIFT ); }static bool has_cache_dic (const struct arm64_cpu_capabilities *entry, -int __unused) +int scope) { -return read_sanitised_ftr_reg (SYS_CTR_EL0 ) &BIT (CTR_DIC_SHIFT ); +u64 ctr; + +if (scope ==SCOPE_SYSTEM ) + ctr = arm64_ftr_reg_ctrel0.sys_val; +else + ctr =read_cpuid_cachetype (); + +return ctr &BIT (CTR_DIC_SHIFT ); }#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
Greg Kroah-Hartman
maintainerPATCH 55/361 hv_netvsc: fix vf serial matching with pci slot info
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haiyang Zhang <[email protected]>
[ Upstream commit 005479556197f80139771960dda0dfdcd2d2aad5 ]
The VF device's serial number is saved as a string in PCI slot's kobj name, not the slot->number. This patch corrects the netvsc driver, so the VF device can be successfully paired with synthetic NIC.
--- drivers/net/hyperv/netvsc_drv.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/hyperv/netvsc_drv.c +11 -4
@@ -2022,14 +2022,15 @@ static void netvsc_vf_setup(struct work_rtnl_unlock (); } -/* Find netvsc by VMBus serial number. -* The PCI hyperv controller records the serial number as the slot. +/* Find netvsc by VF serial number. +* The PCI hyperv controller records the serial number as the slot kobj name. */ static struct net_device *get_netvsc_byslot (const struct net_device *vf_netdev) {struct device *parent = vf_netdev->dev.parent;struct net_device_context *ndev_ctx;struct pci_dev *pdev; +u32 serial;if (!parent || !dev_is_pci (parent))return NULL ;/* not a PCI device */
@@ -2040,16 +2041,22 @@ static struct net_device *get_netvsc_bysreturn NULL ; } +if (kstrtou32 (pci_slot_name (pdev->slot),10 , &serial)) { +netdev_notice (vf_netdev,"Invalid vf serial:%s\n" , +pci_slot_name (pdev->slot)); +return NULL ; + } +list_for_each_entry (ndev_ctx, &netvsc_dev_list, list) {if (!ndev_ctx->vf_alloc)continue ; -if (ndev_ctx->vf_serial == pdev->slot->number) +if (ndev_ctx->vf_serial == serial)return hv_get_drvdata (ndev_ctx->device_ctx); }netdev_notice (vf_netdev, -"no netdev found for slot %u\n" , pdev->slot->number); +"no netdev found for vf serial:%u\n" , serial);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 56/361 nfp: devlink port split support for 1x100G CXP NIC
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan C Goodfellow <[email protected]>
[ Upstream commit 5948185b97fa1f83d7855e638a72982a1073ebf5 ]
This commit makes it possible to use devlink to split the 100G CXP Netronome into two 40G interfaces. Currently when you ask for 2 interfaces, the math in src/nfp_devlink.c:nfp_devlink_port_split calculates that you want 5 lanes per port because for some reason eth_port.port_lanes=10 (shouldn't this be 12 for CXP?). What we really want when asking for 2 breakout interfaces is 4 lanes per port. This commit makes that happen by calculating based on 8 lanes if 10 are present.
--- drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_devlink.c +14 -3
@@ -96,6 +96,7 @@ nfp_devlink_port_split(struct devlink *d {struct nfp_pf *pf =devlink_priv (devlink);struct nfp_eth_table_port eth_port; +unsigned int lanes;int ret;if (count <2 )
@@ -114,8 +115,12 @@ nfp_devlink_port_split(struct devlink *d goto out; } - ret =nfp_devlink_set_lanes (pf, eth_port.index, - eth_port.port_lanes / count); +/* Special case the 100G CXP -> 2x40G split */ + lanes = eth_port.port_lanes / count; +if (eth_port.lanes ==10 && count ==2 ) + lanes =8 / count; + + ret =nfp_devlink_set_lanes (pf, eth_port.index, lanes); out:mutex_unlock (&pf->lock);
@@ -128,6 +133,7 @@ nfp_devlink_port_unsplit(struct devlink {struct nfp_pf *pf =devlink_priv (devlink);struct nfp_eth_table_port eth_port; +unsigned int lanes;int ret;mutex_lock (&pf->lock);
@@ -143,7 +149,12 @@ nfp_devlink_port_unsplit(struct devlink goto out; } - ret =nfp_devlink_set_lanes (pf, eth_port.index, eth_port.port_lanes); +/* Special case the 100G CXP -> 2x40G unsplit */ + lanes = eth_port.port_lanes; +if (eth_port.port_lanes ==8 ) + lanes =10 ; + + ret =nfp_devlink_set_lanes (pf, eth_port.index, lanes); out:mutex_unlock (&pf->lock);
Greg Kroah-Hartman
maintainerPATCH 57/361 tun: Consistently configure generic netdev params via rtnetlink
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serhey Popovych <[email protected]>
[ Upstream commit df52eab23d703142c766ac00bdb8db19d71238d0 ]
Configuring generic network device parameters on tun will fail in presence of IFLA_INFO_KIND attribute in IFLA_LINKINFO nested attribute since tun_validate() always return failure.
This can be visualized with following ip-link(8) command sequences:
# ip link set dev tun0 group 100 # ip link set dev tun0 group 100 type tun RTNETLINK answers: Invalid argument
with contrast to dummy and veth drivers:
# ip link set dev dummy0 group 100 # ip link set dev dummy0 type dummy
# ip link set dev veth0 group 100 # ip link set dev veth0 group 100 type veth
Fix by returning zero in tun_validate() when @data is NULL that is always in case since rtnl_link_ops->maxtype is zero in tun driver.
--- drivers/net/tun.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/tun.c +2 -0
@@ -2264,6 +2264,8 @@ static void tun_setup(struct net_devicestatic int tun_validate (struct nlattr *tb[],struct nlattr *data[],struct netlink_ext_ack *extack) { +if (!data) +return 0 ;return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 58/361 s390/sthyi: Fix machine name validity indication
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janosch Frank <[email protected]>
[ Upstream commit b5130dc2224d1881f24224c0590c6d97f2168d6a ]
When running as a level 3 guest with no host provided sthyi support sclp_ocf_cpc_name_copy() will only return zeroes. Zeroes are not a valid group name, so let's not indicate that the group name field is valid.
Also the group name is not dependent on stsi, let's not return based on stsi before setting it.
--- arch/s390/kernel/sthyi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/s390/kernel/sthyi.c +5 -3
@@ -183,17 +183,19 @@ static void fill_hdr(struct sthyi_sctnsstatic void fill_stsi_mac (struct sthyi_sctns *sctns,struct sysinfo_1_1_1 *sysinfo) { +sclp_ocf_cpc_name_copy (sctns->mac.infmname); +if (*(u64 *)sctns->mac.infmname !=0 ) + sctns->mac.infmval1 |=MAC_NAME_VLD ; +if (stsi (sysinfo,1 ,1 ,1 ))return ; -sclp_ocf_cpc_name_copy (sctns->mac.infmname); -memcpy (sctns->mac.infmtype, sysinfo->type,sizeof (sctns->mac.infmtype));memcpy (sctns->mac.infmmanu, sysinfo->manufacturer,sizeof (sctns->mac.infmmanu));memcpy (sctns->mac.infmpman, sysinfo->plant,sizeof (sctns->mac.infmpman));memcpy (sctns->mac.infmseq, sysinfo->sequence,sizeof (sctns->mac.infmseq)); - sctns->mac.infmval1 |=MAC_ID_VLD |MAC_NAME_VLD ; + sctns->mac.infmval1 |=MAC_ID_VLD ; } static void fill_stsi_par(struct sthyi_sctns *sctns,
Greg Kroah-Hartman
maintainerPATCH 59/361 hwmon: (pwm-fan) Set fan speed to 0 on suspend
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thierry Reding <[email protected]>
[ Upstream commit 95dcd64bc5a27080beaa344edfe5bdcca3d2e7dc ]
Technically this is not required because disabling the PWM should be enough. However, when support for atomic operations was implemented in the PWM subsystem, only actual changes to the PWM channel are applied during pwm_config(), which means that during after resume from suspend the old settings won't be applied.
One possible solution is for the PWM driver to implement its own PM operations such that settings from before suspend get applied on resume. This has the disadvantage of completely ignoring any particular ordering requirements that PWM user drivers might have, so it is best to leave it up to the user drivers to apply the settings that they want at the appropriate time.
Another way to solve this would be to read back the current state of the PWM at the time of resume. That way, in case the configuration was lost during suspend, applying the old settings in PWM user drivers would actually get them applied because they differ from the current settings. However, not all PWM drivers support reading the hardware state, and not all hardware may support it.
The best workaround at this point seems to be to let PWM user drivers tell the PWM subsystem that the PWM is turned off by, in addition to disabling it, also setting the duty cycle to 0. This causes the resume operation to apply a configuration that is different from the current configuration, resulting in the proper state from before suspend getting restored.
--- drivers/hwmon/pwm-fan.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/hwmon/pwm-fan.c +11 -1
@@ -290,9 +290,19 @@ static int pwm_fan_remove(struct platforstatic int pwm_fan_suspend (struct device *dev) {struct pwm_fan_ctx *ctx =dev_get_drvdata (dev); +struct pwm_args args; +int ret; + +pwm_get_args (ctx->pwm, &args); + +if (ctx->pwm_value) { + ret =pwm_config (ctx->pwm,0 , args.period); +if (ret <0 ) +return ret; -if (ctx->pwm_value)pwm_disable (ctx->pwm); + } +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 60/361 lightnvm: pblk: fix race on sysfs line state
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier González <[email protected]>
[ Upstream commit 44cdbdc657b23f75736eca3e88b781f009104363 ]
pblk exposes a sysfs interface that represents its internal state. Part of this state is the map bitmap for the current open line, which should be protected by the line lock to avoid a race when freeing the line metadata. Currently, it is not.
This patch makes sure that the line state is consistent and NULL bitmap pointers are not dereferenced.
--- drivers/lightnvm/pblk-core.c | 5 +++-- drivers/lightnvm/pblk-sysfs.c | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/lightnvm/pblk-core.c +3 -2
@@ -1539,13 +1539,14 @@ struct pblk_line *pblk_line_replace_datastruct pblk_line *cur, *new =NULL ;unsigned int left_seblks; - cur = l_mg->data_line; new = l_mg->data_next;if (!new) goto out; - l_mg->data_line = new;spin_lock (&l_mg->free_lock); + cur = l_mg->data_line; + l_mg->data_line = new; +pblk_line_setup_metadata (new, l_mg, &pblk->lm);spin_unlock (&l_mg->free_lock);
drivers/lightnvm/pblk-sysfs.c +7 -1
@@ -262,8 +262,14 @@ static ssize_t pblk_sysfs_lines(struct p sec_in_line = l_mg->data_line->sec_in_line; meta_weight =bitmap_weight (&l_mg->meta_bitmap,PBLK_DATA_LINES ); - map_weight =bitmap_weight (l_mg->data_line->map_bitmap, + +spin_lock (&l_mg->data_line->lock); +if (l_mg->data_line->map_bitmap) + map_weight =bitmap_weight (l_mg->data_line->map_bitmap, lm->sec_per_line); +else + map_weight =0 ; +spin_unlock (&l_mg->data_line->lock); }spin_unlock (&l_mg->free_lock);
Greg Kroah-Hartman
maintainerPATCH 61/361 lightnvm: pblk: fix two sleep-in-atomic-context bugs
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia-Ju Bai <[email protected]>
[ Upstream commit 7325b4bbe5952e3e939f15de812f2ee0c0d33ca9 ]
The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] nvm_dev_dma_alloc(GFP_KERNEL) drivers/lightnvm/pblk-core.c, 754:
nvm_dev_dma_alloc in pblk_line_submit_smeta_iodrivers/lightnvm/pblk-core.c, 1048:
pblk_line_submit_smeta_io in pblk_line_init_bbdrivers/lightnvm/pblk-core.c, 1434:
pblk_line_init_bb in pblk_line_replace_datadrivers/lightnvm/pblk-recovery.c, 980:
pblk_line_replace_data in pblk_recov_l2pdrivers/lightnvm/pblk-recovery.c, 976:
spin_lock in pblk_recov_l2p
[FUNC] bio_map_kern(GFP_KERNEL) drivers/lightnvm/pblk-core.c, 762:
bio_map_kern in pblk_line_submit_smeta_iodrivers/lightnvm/pblk-core.c, 1048:
pblk_line_submit_smeta_io in pblk_line_init_bbdrivers/lightnvm/pblk-core.c, 1434:
pblk_line_init_bb in pblk_line_replace_datadrivers/lightnvm/pblk-recovery.c, 980:
pblk_line_replace_data in pblk_recov_l2pdrivers/lightnvm/pblk-recovery.c, 976:
spin_lock in pblk_recov_l2p
To fix these bugs, the call to pblk_line_replace_data() is moved out of the spinlock protection.
These bugs are found by my static analysis tool DSAC.
--- drivers/lightnvm/pblk-recovery.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/lightnvm/pblk-recovery.c +4 -2
@@ -956,12 +956,14 @@ next: } } -spin_lock (&l_mg->free_lock);if (!open_lines) { +spin_lock (&l_mg->free_lock);WARN_ON_ONCE (!test_and_clear_bit (meta_line, &l_mg->meta_bitmap)); +spin_unlock (&l_mg->free_lock);pblk_line_replace_data (pblk); }else { +spin_lock (&l_mg->free_lock);/* Allocate next line for preparation */ l_mg->data_next =pblk_line_get (pblk);if (l_mg->data_next) {
@@ -969,8 +971,8 @@ next: l_mg->data_next->type =PBLK_LINETYPE_DATA ; is_next =1 ; } +spin_unlock (&l_mg->free_lock); } -spin_unlock (&l_mg->free_lock);if (is_next)pblk_line_erase (pblk, l_mg->data_next);
Greg Kroah-Hartman
maintainerPATCH 62/361 lightnvm: pblk: fix race condition on metadata I/O
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier González <[email protected]>
[ Upstream commit d8adaa3b86324c6186d0adf74bc256bdacfffdb6 ]
In pblk, when a new line is allocated, metadata for the previously written line is scheduled. This is done through a fixed memory region that is shared through time and contexts across different lines and therefore protected by a lock. Unfortunately, this lock is not properly covering all the metadata used for sharing this memory regions, resulting in a race condition.
This patch fixes this race condition by protecting this metadata properly.
--- drivers/lightnvm/pblk-write.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/lightnvm/pblk-write.c +7 -7
@@ -417,12 +417,11 @@ int pblk_submit_meta_io(struct pblk *pbl rqd->ppa_list[i] =addr_to_gen_ppa (pblk, paddr, id); } +spin_lock (&l_mg->close_lock); emeta->mem += rq_len; -if (emeta->mem >= lm->emeta_len[0 ]) { -spin_lock (&l_mg->close_lock); +if (emeta->mem >= lm->emeta_len[0 ])list_del (&meta_line->list); -spin_unlock (&l_mg->close_lock); - } +spin_unlock (&l_mg->close_lock);pblk_down_page (pblk, rqd->ppa_list, rqd->nr_ppas);
@@ -491,14 +490,15 @@ static struct pblk_line *pblk_should_substruct pblk_line *meta_line;spin_lock (&l_mg->close_lock); -retry:if (list_empty (&l_mg->emeta_list)) {spin_unlock (&l_mg->close_lock);return NULL ; } meta_line = list_first_entry(&l_mg->emeta_list, struct pblk_line, list); -if (meta_line->emeta->mem >= lm->emeta_len[0 ]) - goto retry; +if (meta_line->emeta->mem >= lm->emeta_len[0 ]) { +spin_unlock (&l_mg->close_lock); +return NULL ; + }spin_unlock (&l_mg->close_lock);if (!pblk_valid_meta_ppa (pblk, meta_line, data_rqd))
Greg Kroah-Hartman
maintainerPATCH 63/361 spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare}
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
[ Upstream commit a1108c7b2efb892350ba6a0e932dfd45622f4e2b ]
Clang warns when one enumerated type is implicitly converted to another.
drivers/spi/spi-ep93xx.c:342:62: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion]
nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:428:58: note: expanded from macro
'dma_map_sg'
#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
~~~~~~~~~~~~~~~~ ^
drivers/spi/spi-ep93xx.c:348:57: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:429:62: note: expanded from macro
'dma_unmap_sg'
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
~~~~~~~~~~~~~~~~~~ ^
drivers/spi/spi-ep93xx.c:377:56: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:429:62: note: expanded from macro
'dma_unmap_sg'
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
~~~~~~~~~~~~~~~~~~ ^3 warnings generated.
dma_{,un}map_sg expect an enum of type dma_data_direction but this driver uses dma_transfer_direction for everything. Convert the driver to use dma_data_direction for these two functions.
There are two places that strictly require an enum of typedma_transfer_direction: the direction member in struct dma_slave_config and the direction parameter in dmaengine_prep_slave_sg. To avoid using an explicit cast, add a simple function, ep93xx_dma_data_to_trans_dir, to safely map between the two types because they are not 1 to 1 in meaning.
--- drivers/spi/spi-ep93xx.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-)
drivers/spi/spi-ep93xx.c +25 -11
@@ -246,6 +246,19 @@ static int ep93xx_spi_read_write(structreturn -EINPROGRESS ; } +static enum dma_transfer_direction +ep93xx_dma_data_to_trans_dir (enum dma_data_direction dir) +{ +switch (dir) { +case DMA_TO_DEVICE : +return DMA_MEM_TO_DEV ; +case DMA_FROM_DEVICE : +return DMA_DEV_TO_MEM ; +default : +return DMA_TRANS_NONE ; + } +} +/** * ep93xx_spi_dma_prepare() - prepares a DMA transfer * @master: SPI master
@@ -257,7 +270,7 @@ static int ep93xx_spi_read_write(struct*/ static struct dma_async_tx_descriptor *ep93xx_spi_dma_prepare (struct spi_master *master, -enum dma_transfer_direction dir) +enum dma_data_direction dir) {struct ep93xx_spi *espi =spi_master_get_devdata (master);struct spi_transfer *xfer = master->cur_msg->state;
@@ -277,9 +290,9 @@ ep93xx_spi_dma_prepare(struct spi_master buswidth =DMA_SLAVE_BUSWIDTH_1_BYTE ;memset (&conf,0 ,sizeof (conf)); - conf.direction = dir; + conf.direction =ep93xx_dma_data_to_trans_dir (dir); -if (dir ==DMA_DEV_TO_MEM ) { +if (dir ==DMA_FROM_DEVICE ) { chan = espi->dma_rx; buf = xfer->rx_buf; sgt = &espi->rx_sgt;
@@ -343,7 +356,8 @@ ep93xx_spi_dma_prepare(struct spi_masterif (!nents)return ERR_PTR (-ENOMEM ); - txd =dmaengine_prep_slave_sg (chan, sgt->sgl, nents, dir,DMA_CTRL_ACK ); + txd =dmaengine_prep_slave_sg (chan, sgt->sgl, nents, conf.direction, +DMA_CTRL_ACK );if (!txd) {dma_unmap_sg (chan->device->dev, sgt->sgl, sgt->nents, dir);return ERR_PTR (-ENOMEM );
@@ -360,13 +374,13 @@ ep93xx_spi_dma_prepare(struct spi_master* unmapped. */ static void ep93xx_spi_dma_finish (struct spi_master *master, -enum dma_transfer_direction dir) +enum dma_data_direction dir) {struct ep93xx_spi *espi =spi_master_get_devdata (master);struct dma_chan *chan;struct sg_table *sgt; -if (dir ==DMA_DEV_TO_MEM ) { +if (dir ==DMA_FROM_DEVICE ) { chan = espi->dma_rx; sgt = &espi->rx_sgt; }else {
@@ -381,8 +395,8 @@ static void ep93xx_spi_dma_callback(void {struct spi_master *master = callback_param; -ep93xx_spi_dma_finish (master,DMA_MEM_TO_DEV ); -ep93xx_spi_dma_finish (master,DMA_DEV_TO_MEM ); +ep93xx_spi_dma_finish (master,DMA_TO_DEVICE ); +ep93xx_spi_dma_finish (master,DMA_FROM_DEVICE );spi_finalize_current_transfer (master); }
@@ -392,15 +406,15 @@ static int ep93xx_spi_dma_transfer(strucstruct ep93xx_spi *espi =spi_master_get_devdata (master);struct dma_async_tx_descriptor *rxd, *txd; - rxd =ep93xx_spi_dma_prepare (master,DMA_DEV_TO_MEM ); + rxd =ep93xx_spi_dma_prepare (master,DMA_FROM_DEVICE );if (IS_ERR (rxd)) {dev_err (&master->dev,"DMA RX failed: %ld\n" ,PTR_ERR (rxd));return PTR_ERR (rxd); } - txd =ep93xx_spi_dma_prepare (master,DMA_MEM_TO_DEV ); + txd =ep93xx_spi_dma_prepare (master,DMA_TO_DEVICE );if (IS_ERR (txd)) { -ep93xx_spi_dma_finish (master,DMA_DEV_TO_MEM ); +ep93xx_spi_dma_finish (master,DMA_FROM_DEVICE );dev_err (&master->dev,"DMA TX failed: %ld\n" ,PTR_ERR (txd));return PTR_ERR (txd); }
Greg Kroah-Hartman
maintainerPATCH 64/361 perf tools: Free temporary sys string in read_event_files()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sanskriti Sharma <[email protected]>
[ Upstream commit 1e44224fb0528b4c0cc176bde2bb31e9127eb14b ]
For each system in a given pevent, read_event_files() reads in a temporary 'sys' string. Be sure to free this string before moving onto to the next system and/or leaving read_event_files().
Fixes the following coverity complaints:
Error: RESOURCE_LEAK (CWE-772):
tools/perf/util/trace-event-read.c:343: overwrite_var: Overwriting "sys" in "sys = read_string()" leaks the storage that "sys" points to.
tools/perf/util/trace-event-read.c:353: leaked_storage: Variable "sys" going out of scope leaks the storage it points to.
--- tools/perf/util/trace-event-read.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/util/trace-event-read.c +4 -1
@@ -349,9 +349,12 @@ static int read_event_files(struct tep_hfor (x=0 ; x < count; x++) { size =read8 (pevent); ret =read_event_file (pevent, sys, size); -if (ret) +if (ret) { +free (sys);return ret; + } } +free (sys); }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 65/361 perf tools: Cleanup trace-event-info tdata leak
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sanskriti Sharma <[email protected]>
[ Upstream commit faedbf3fd19f2511a39397f76359e4cc6ee93072 ]
Free tracing_data structure in tracing_data_get() error paths.
Fixes the following coverity complaint:
Error: RESOURCE_LEAK (CWE-772):
leaked_storage: Variable "tdata" going out of scope leaks the storage
--- tools/perf/util/trace-event-info.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/trace-event-info.c +2 -0
@@ -531,12 +531,14 @@ struct tracing_data *tracing_data_get(st "/tmp/perf-XXXXXX");if (!mkstemp (tdata->temp_file)) {pr_debug ("Can't make temp file" ); +free (tdata);return NULL ; } temp_fd =open (tdata->temp_file,O_RDWR );if (temp_fd <0 ) {pr_debug ("Can't read '%s'" , tdata->temp_file); +free (tdata);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 66/361 perf tools: Free printk string in parse_ftrace_printk()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sanskriti Sharma <[email protected]>
[ Upstream commit 9c8a182e5a73e01afd11742a2ab887bf338fdafd ]
parse_ftrace_printk() tokenizes and parses a line, calling strdup() each iteration. Add code to free this temporary format string duplicate.
Fixes the following coverity complaints:
Error: RESOURCE_LEAK (CWE-772):
tools/perf/util/trace-event-parse.c:158: overwrite_var: Overwriting "printk" in "printk = strdup(fmt + 1)" leaks the storage that "printk" points to.
tools/perf/util/trace-event-parse.c:162: leaked_storage: Variable "printk" going out of scope leaks the storage it points to.
--- tools/perf/util/trace-event-parse.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/trace-event-parse.c +1 -0
@@ -158,6 +158,7 @@ void parse_ftrace_printk(struct tep_hand printk =strdup (fmt+1 ); line =strtok_r (NULL ,"\n" , &next);tep_register_print_string (pevent, printk, addr); +free (printk); } }
Greg Kroah-Hartman
maintainerPATCH 67/361 perf strbuf: Match va_{add,copy} with va_end
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sanskriti Sharma <[email protected]>
[ Upstream commit ce49d8436cffa9b7a6a5f110879d53e89dbc6746 ]
Ensure that all code paths in strbuf_addv() call va_end() on the ap_saved copy that was made.
Fixes the following coverity complaint:
Error: VARARGS (CWE-237): [#def683] tools/perf/util/strbuf.c:106: missing_va_end: va_end was not called for "ap_saved".
--- tools/perf/util/strbuf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
tools/perf/util/strbuf.c +8 -2
@@ -98,19 +98,25 @@ static int strbuf_addv(struct strbuf *sbva_copy (ap_saved, ap); len =vsnprintf (sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); -if (len <0 ) +if (len <0 ) { +va_end (ap_saved);return len; + }if (len >strbuf_avail (sb)) { ret =strbuf_grow (sb, len); -if (ret) +if (ret) { +va_end (ap_saved);return ret; + } len =vsnprintf (sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);va_end (ap_saved);if (len >strbuf_avail (sb)) {pr_debug ("this should not happen, your vsnprintf is broken" ); +va_end (ap_saved);return -EINVAL ; } } +va_end (ap_saved);return strbuf_setlen (sb, sb->len + len); }
Greg Kroah-Hartman
maintainerPATCH 68/361 cpupower: Fix coredump on VMWare
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prarit Bhargava <[email protected]>
[ Upstream commit f69ffc5d3db8f1f03fd6d1df5930f9a1fbd787b6 ]
cpupower crashes on VMWare guests. The guests have the AMD PStateDef MSR (0xC0010064 + state number) set to zero. As a result fid and did are zero and the crash occurs because of a divide by zero (cof = fid/did). This can be prevented by checking the enable bit in the PStateDef MSR before calculating cof. By doing this the value of pstate[i] remains zero and the value can be tested before displaying the active Pstates.
Check the enable bit in the PstateDef register for all supported families and only print out enabled Pstates.
--- tools/power/cpupower/utils/cpufreq-info.c | 2 ++ tools/power/cpupower/utils/helpers/amd.c | 5 +++++ 2 files changed, 7 insertions(+)
tools/power/cpupower/utils/cpufreq-info.c +2 -0
@@ -200,6 +200,8 @@ static int get_boost_mode(unsigned int cprintf (_ (" Boost States: %d\n" ), b_states);printf (_ (" Total States: %d\n" ), pstate_no);for (i =0 ; i < pstate_no; i++) { +if (!pstates[i]) +continue ;if (i < b_states)printf (_ (" Pstate-Pb%d: %luMHz (boost state)" "\n" ), i, pstates[i]);
tools/power/cpupower/utils/helpers/amd.c +5 -0
@@ -119,6 +119,11 @@ int decode_pstates(unsigned int cpu, uns }if (read_msr (cpu,MSR_AMD_PSTATE + i, &pstate.val))return -1 ; +if ((cpu_family ==0x17 ) && (!pstate.fam17h_bits.en)) +continue ; +else if (!pstate.bits.en) +continue ; + pstates[i] =get_cof (cpu_family, pstate); } *no = i;
Greg Kroah-Hartman
maintainerPATCH 69/361 bcache: Populate writeback_rate_minimum attribute
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Peddell <[email protected]>
[ Upstream commit 7567c2a2ad9e80a2ce977eef535e64b61899633e ]
Forgot to include the maintainers with my first email.
Somewhere between Michael Lyle's original
"bcache: PI controller for writeback rate V2" patch dated 07 Sep 2017 and 1d316e6 bcache: implement PI controller for writeback rate, the mapping of the writeback_rate_minimum attribute was dropped.
Re-add the missing sysfs writeback_rate_minimum attribute mapping to "allow the user to specify a minimum rate at which dirty blocks are retired."
--- drivers/md/bcache/sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/bcache/sysfs.c +2 -0
@@ -285,6 +285,7 @@ STORE(__cached_dev) 1, WRITEBACK_RATE_UPDATE_SECS_MAX);d_strtoul (writeback_rate_i_term_inverse);d_strtoul_nonzero (writeback_rate_p_term_inverse); +d_strtoul_nonzero (writeback_rate_minimum);sysfs_strtoul_clamp (io_error_limit, dc->error_limit,0 ,INT_MAX );
@@ -412,6 +413,7 @@ static struct attribute *bch_cached_dev_ &sysfs_writeback_rate_update_seconds, &sysfs_writeback_rate_i_term_inverse, &sysfs_writeback_rate_p_term_inverse, + &sysfs_writeback_rate_minimum, &sysfs_writeback_rate_debug, &sysfs_errors, &sysfs_io_error_limit,
Greg Kroah-Hartman
maintainerPATCH 70/361 mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhao <[email protected]>
[ Upstream commit 5169894982bb67486d93cc1e10151712bb86bcb6 ]
This device reports SDHCI_CLOCK_INT_STABLE even though it's not ready to take SDHCI_CLOCK_CARD_EN. The symptom is that reading SDHCI_CLOCK_CONTROL after enabling the clock shows absence of the bit from the register (e.g. expecting 0x0000fa07 = 0x0000fa03 | SDHCI_CLOCK_CARD_EN but only observed the first operand).
mmc1: Timeout waiting for hardware cmd interrupt.
mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00000603
mmc1: sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000
mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000
mmc1: sdhci: Present: 0x01ff0001 | Host ctl: 0x00000001
mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x0000fa03
mmc1: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000
mmc1: sdhci: Int enab: 0x00ff0083 | Sig enab: 0x00ff0083
mmc1: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
mmc1: sdhci: Caps: 0x25fcc8bf | Caps_1: 0x00002077
mmc1: sdhci: Cmd: 0x00000000 | Max curr: 0x005800c8
mmc1: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
mmc1: sdhci: Host ctl2: 0x00000008
mmc1: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000
mmc1: sdhci: ============================================
The problem happens during wakeup from S3. Adding a delay quirk after power up reliably fixes the problem.
--- drivers/mmc/host/sdhci-pci-o2micro.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-pci-o2micro.c +3 -0
@@ -490,6 +490,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_pci_write_config_byte (chip->pdev,O2_SD_LOCK_WP , scratch);break ;case PCI_DEVICE_ID_O2_SEABIRD0 : +if (chip->pdev->revision ==0x01 ) + chip->quirks |=SDHCI_QUIRK_DELAY_AFTER_POWER ; +/* fall through */ case PCI_DEVICE_ID_O2_SEABIRD1 :/* UnLock WP */ ret = pci_read_config_byte(chip->pdev,
Greg Kroah-Hartman
maintainerPATCH 71/361 sdhci: acpi: add free_slot callback
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Dongsheng <[email protected]>
[ Upstream commit c7eabbee3de99347105faa7fd925a500ccf43baf ]
The device specific resource can be free in free_slot after removing host controller.
--- drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mmc/host/sdhci-acpi.c +8 -0
@@ -76,6 +76,7 @@ struct sdhci_acpi_slot {size_t priv_size;int (*probe_slot)(struct platform_device *,const char *,const char *);int (*remove_slot)(struct platform_device *); +int (*free_slot)(struct platform_device *pdev);int (*setup_host)(struct platform_device *pdev); };
@@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platf err_cleanup:sdhci_cleanup_host (c->host); err_free: +if (c->slot && c->slot->free_slot) + c->slot->free_slot (pdev); +sdhci_free_host (c->host);return err; }
@@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct plat dead = (sdhci_readl (c->host,SDHCI_INT_STATUS ) == ~0 );sdhci_remove_host (c->host, dead); + +if (c->slot && c->slot->free_slot) + c->slot->free_slot (pdev); +sdhci_free_host (c->host);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 72/361 mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES register to 8 if unset
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit 0d55c668b218a1db68b5044bce4de74e1bd0f0c8 ]
NAND devices need additional data area (OOB) for error correction, but it is also used for Bad Block Marker (BBM). In many cases, the first byte in OOB is used for BBM, but the location actually depends on chip vendors. The NAND controller should preserve the precious BBM to keep track of bad blocks.
In Denali IP, the SPARE_AREA_SKIP_BYTES register is used to specify the number of bytes to skip from the start of OOB. The ECC engine will automatically skip the specified number of bytes when it gets access to OOB area.
The same value for SPARE_AREA_SKIP_BYTES should be used between firmware and the operating system if you intend to use the NAND device across the control hand-off.
In fact, the current denali.c code expects firmware to have already set the SPARE_AREA_SKIP_BYTES register, then reads the value out.
If no firmware (or bootloader) has initialized the controller, the register value is zero, which is the default after power-on-reset. In other words, the Linux driver cannot initialize the controller by itself.
Some possible solutions are:
[1] Add a DT property to specify the skipped bytes in OOB
[2] Associate the preferred value with compatible
[3] Hard-code the default value in the driver
My first attempt was [1], but in the review process, [3] was suggested as a counter-implementation.
(https://lore.kernel.org/patchwork/patch/983055/)
The default value 8 was chosen to match to the boot ROM of the UniPhier platform. The preferred value may vary by platform. If so, please trade up to a different solution.
--- drivers/mtd/nand/raw/denali.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/mtd/nand/raw/denali.c +10 -4
@@ -28,6 +28,7 @@MODULE_LICENSE ("GPL" );#define DENALI_NAND_NAME "denali-nand" +#define DENALI_DEFAULT_OOB_SKIP_BYTES 8/* for Indexed Addressing */ #define DENALI_INDEXED_CTRL 0x00
@@ -1105,12 +1106,17 @@ static void denali_hw_init(struct denali denali->revision =swab16 (ioread32 (denali->reg +REVISION ));/* -* tell driver how many bit controller will skip before -* writing ECC code in OOB, this register may be already -* set by firmware. So we read this value out. -* if this value is 0, just let it be. +* Set how many bytes should be skipped before writing data in OOB. +* If a non-zero value has already been set (by firmware or something), +* just use it. Otherwise, set the driver default. */ denali->oob_skip_bytes =ioread32 (denali->reg +SPARE_AREA_SKIP_BYTES ); +if (!denali->oob_skip_bytes) { + denali->oob_skip_bytes =DENALI_DEFAULT_OOB_SKIP_BYTES ; +iowrite32 (denali->oob_skip_bytes, + denali->reg +SPARE_AREA_SKIP_BYTES ); + } +denali_detect_max_banks (denali);iowrite32 (0x0F , denali->reg +RB_PIN_ENABLED );iowrite32 (CHIP_EN_DONT_CARE__FLAG , denali->reg +CHIP_ENABLE_DONT_CARE );
Greg Kroah-Hartman
maintainerPATCH 73/361 iwlwifi: pcie: avoid empty free RB queue
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaul Triebitz <[email protected]>
[ Upstream commit 868a1e863f95183f00809363fefba6d4f5bcd116 ]
If all free RB queues are empty, the driver will never restock the free RB queue. That's because the restocking happens in the Rx flow, and if the free queue is empty there will be no Rx.
Although there's a background worker (a.k.a. allocator) allocating memory for RBs so that the Rx handler can restock them, the worker may run only after the free queue has become empty (and then it is too late for restocking as explained above).
There is a solution for that called 'emergency': If the number of used RB's reaches half the amount of all RB's, the Rx handler will not wait for the allocator but immediately allocate memory for the used RB's and restock the free queue.
But, since the used RB's is per queue, it may happen that the used RB's are spread between the queues such that the emergency check will fail for each of the queues
(and still run out of RBs, causing the above symptom).
To fix it, move to emergency mode if the sum of *all* used RBs (for all Rx queues) reaches half the amount of all RB's
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 32 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +21 -11
@@ -1144,6 +1144,14 @@ void iwl_pcie_rx_free(struct iwl_trans *kfree (trans_pcie->rxq); } +static void iwl_pcie_rx_move_to_allocator (struct iwl_rxq *rxq, +struct iwl_rb_allocator *rba) +{ +spin_lock (&rba->lock); +list_splice_tail_init (&rxq->rx_used, &rba->rbd_empty); +spin_unlock (&rba->lock); +} +/* * iwl_pcie_rx_reuse_rbd - Recycle used RBDs *
@@ -1175,9 +1183,7 @@ static void iwl_pcie_rx_reuse_rbd(structif ((rxq->used_count %RX_CLAIM_REQ_ALLOC ) ==RX_POST_REQ_ALLOC ) {/* Move the 2 RBDs to the allocator ownership. Allocator has another 6 from pool for the request completion*/ -spin_lock (&rba->lock); -list_splice_tail_init (&rxq->rx_used, &rba->rbd_empty); -spin_unlock (&rba->lock); +iwl_pcie_rx_move_to_allocator (rxq, rba);atomic_inc (&rba->req_pending);queue_work (rba->alloc_wq, &rba->rx_alloc);
@@ -1396,10 +1402,18 @@ restart:IWL_DEBUG_RX (trans,"Q %d: HW = SW = %d\n" , rxq->id, r);while (i != r) { +struct iwl_rb_allocator *rba = &trans_pcie->rba;struct iwl_rx_mem_buffer *rxb; - -if (unlikely (rxq->used_count == rxq->queue_size /2 )) +/* number of RBDs still waiting for page allocation */ +u32 rb_pending_alloc = +atomic_read (&trans_pcie->rba.req_pending) * +RX_CLAIM_REQ_ALLOC ; + +if (unlikely (rb_pending_alloc >= rxq->queue_size /2 && + !emergency)) { +iwl_pcie_rx_move_to_allocator (rxq, rba); emergency = true; + } rxb =iwl_pcie_get_rxb (trans, rxq, i);if (!rxb)
@@ -1421,17 +1435,13 @@ restart:iwl_pcie_rx_allocator_get (trans, rxq);if (rxq->used_count %RX_CLAIM_REQ_ALLOC ==0 && !emergency) { -struct iwl_rb_allocator *rba = &trans_pcie->rba; -/* Add the remaining empty RBDs for allocator use */ -spin_lock (&rba->lock); -list_splice_tail_init (&rxq->rx_used, &rba->rbd_empty); -spin_unlock (&rba->lock); +iwl_pcie_rx_move_to_allocator (rxq, rba); }else if (emergency) { count++;if (count ==8 ) { count =0 ; -if (rxq->used_count < rxq->queue_size /3 ) +if (rb_pending_alloc < rxq->queue_size /3 ) emergency = false; rxq->read = i;
Greg Kroah-Hartman
maintainerPATCH 74/361 iwlwifi: mvm: clear HW_RESTART_REQUESTED when stopping the interface
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit 155f7e0441cd121b1e673d465a35e99f4b9b2f0b ]
Fix a bug that happens in the following scenario:
1) suspend without WoWLAN
2) mac80211 calls drv_stop because of the suspend
3) __iwl_mvm_mac_stop deallocates the aux station
4) during drv_stop the firmware crashes
5) iwlmvm:
* sets IWL_MVM_STATUS_HW_RESTART_REQUESTED
* asks mac80211 to kick the restart flow
6) mac80211 puts the restart worker into a freezable
queue which means that the worker will not run for now since the workqueue is already frozen
7) ...
8) resume
9) mac80211 runs ieee80211_reconfig as part of the resume
10) mac80211 detects that a restart flow has been requested and that we are now resuming from suspend and cancels the restart worker
11) mac80211 calls drv_start()
12) __iwl_mvm_mac_start checks that IWL_MVM_STATUS_HW_RESTART_REQUESTED clears it, sets IWL_MVM_STATUS_IN_HW_RESTART and calls iwl_mvm_restart_cleanup()
13) iwl_fw_error_dump gets called and accesses the device
to get debug data
14) iwl_mvm_up adds the aux station
15) iwl_mvm_add_aux_sta() allocates an internal station for the aux station
16) iwl_mvm_allocate_int_sta() tests IWL_MVM_STATUS_IN_HW_RESTART and doesn't really allocate a station ID for the aux station
17) a new queue is added for the aux station
Note that steps from 5 to 9 aren't really part of the problem but were described for the sake of completeness.
Once the iwl_mvm_mac_stop() is called, the device is not accessible, meaning that step 12) can't succeed and we'll see the following:
drivers/net/wireless/intel/iwlwifi/pcie/trans.c:2122 iwl_trans_pcie_grab_nic_access+0xc0/0x1d6 [iwlwifi]() Timeout waiting for hardware access (CSR_GP_CNTRL 0x080403d8)
Call Trace: [<ffffffffc03e6ad3>] iwl_trans_pcie_grab_nic_access+0xc0/0x1d6 [iwlwifi] [<ffffffffc03e6a13>] iwl_trans_pcie_dump_regs+0x3fd/0x3fd [iwlwifi] [<ffffffffc03dad42>] iwl_fw_error_dump+0x4f5/0xe8b [iwlwifi] [<ffffffffc04bd43e>] __iwl_mvm_mac_start+0x5a/0x21a [iwlmvm] [<ffffffffc04bd6d2>] iwl_mvm_mac_start+0xd4/0x103 [iwlmvm] [<ffffffffc042d378>] drv_start+0xa1/0xc5 [iwl7000_mac80211] [<ffffffffc045a339>] ieee80211_reconfig+0x145/0xf50 [mac80211] [<ffffffffc044788b>] ieee80211_resume+0x62/0x66 [mac80211] [<ffffffffc0366c5b>] wiphy_resume+0xa9/0xc6 [cfg80211]
The station id of the aux station is set to 0xff in step 3 and because we don't really allocate a new station id for the auxliary station (as explained in 16), we end up sending a command to the firmware asking to connect the queue to station id 0xff. This makes the firmware crash with the following information:
0x00002093 | ADVANCED_SYSASSERT 0x000002F0 | trm_hw_status0 0x00000000 | trm_hw_status1 0x00000B38 | branchlink2 0x0001978C | interruptlink1 0x00000000 | interruptlink2 0xFF080501 | data1 0xDEADBEEF | data2 0xDEADBEEF | data3
Firmware error during reconfiguration - reprobe! FW error in SYNC CMD SCD_QUEUE_CFG
Fix this by clearing IWL_MVM_STATUS_HW_RESTART_REQUESTED in iwl_mvm_mac_stop(). We won't be able to collect debug data anyway and when we will brought up again, we will have a clean state from the firmware perspective. Since we won't have IWL_MVM_STATUS_IN_HW_RESTART set in step 12) we won't get to the 2093 ASSERT either.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +6 -3
@@ -1233,12 +1233,15 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *iwl_mvm_del_aux_sta (mvm);/* -* Clear IN_HW_RESTART flag when stopping the hw (as restart_complete() -* won't be called in this case). +* Clear IN_HW_RESTART and HW_RESTART_REQUESTED flag when stopping the +* hw (as restart_complete() won't be called in this case) and mac80211 +* won't execute the restart. * But make sure to cleanup interfaces that have gone down before/during * HW restart was requested. */ -if (test_and_clear_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status)) +if (test_and_clear_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status) || +test_and_clear_bit (IWL_MVM_STATUS_HW_RESTART_REQUESTED , + &mvm->status))ieee80211_iterate_interfaces (mvm->hw,0 , iwl_mvm_cleanup_iterator, mvm);
Greg Kroah-Hartman
maintainerPATCH 75/361 iwlwifi: mvm: check for n_profiles validity in EWRD ACPI
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Coelho <[email protected]>
[ Upstream commit 2e1976bb75263fbad918e82184b16a23bd721546 ]
When reading the profiles from the EWRD table in ACPI, we loop over the data and set it into our internal table. We use the number of profiles specified in ACPI without checking its validity, so if the ACPI table is corrupted and the number is larger than our array size, we will try to make an out-of-bounds access.
Fix this by making sure the value specified in the ACPI table is valid.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +6 -2
@@ -704,8 +704,12 @@ static int iwl_mvm_sar_get_ewrd_table(st enabled = !!(wifi_pkg->package.elements[1 ].integer.value); n_profiles = wifi_pkg->package.elements[2 ].integer.value; -/* in case of BIOS bug */ -if (n_profiles <=0 ) { +/* +* Check the validity of n_profiles. The EWRD profiles start +* from index 1, so the maximum value allowed here is +* ACPI_SAR_PROFILES_NUM - 1. +*/ +if (n_profiles <=0 || n_profiles >=ACPI_SAR_PROFILE_NUM ) { ret = -EINVAL ; goto out_free; }
Greg Kroah-Hartman
maintainerPATCH 76/361 x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lubomir Rintel <[email protected]>
[ Upstream commit d92116b800fb79a72ad26121f5011f6aa3ad94c2 ]
On OLPC XO-1, the RTC is discovered via device tree from the arch initcall. Don't let the PC platform register another one from its device initcall, it's not going to work:
sysfs: cannot create duplicate filename '/devices/platform/rtc_cmos'
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #12
Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014
Call Trace:
dump_stack+0x16/0x18
sysfs_warn_dup+0x46/0x58
sysfs_create_dir_ns+0x76/0x9b
kobject_add_internal+0xed/0x209
? __schedule+0x3fa/0x447
kobject_add+0x5b/0x66
device_add+0x298/0x535
? insert_resource_conflict+0x2a/0x3e
platform_device_add+0x14d/0x192
? io_delay_init+0x19/0x19
platform_device_register+0x1c/0x1f
add_rtc_cmos+0x16/0x31
do_one_initcall+0x78/0x14a
? do_early_param+0x75/0x75
kernel_init_freeable+0x152/0x1e0
? rest_init+0xa2/0xa2
kernel_init+0x8/0xd5
ret_from_fork+0x2e/0x38
kobject_add_internal failed for rtc_cmos with -EEXIST, don't try to
register things with the same name in the same directory.
platform rtc_cmos: registered platform RTC device (no PNP device found)--- arch/x86/platform/olpc/olpc-xo1-rtc.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/platform/olpc/olpc-xo1-rtc.c +3 -0
@@ -16,6 +16,7 @@#include <asm/msr.h> #include <asm/olpc.h> +#include <asm/x86_init.h> static void rtc_wake_on (struct device *dev) {
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)if (r)return r; + x86_platform.legacy.rtc =0 ; +device_init_wakeup (&xo1_rtc_device.dev,1 );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 77/361 wlcore: Fix BUG with clear completion on timeout
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 4e651bad848955d88b29a568bfbfb4b831270e16 ]
We do not currently clear wl->elp_compl on ELP timeout and we have bogus lingering pointer that wlcore_irq then will try to access after recovery is done:
BUG: spinlock bad magic on CPU#1, irq/255-wl12xx/580
...
(spin_dump) from [<c01b9344>] (do_raw_spin_lock+0xc8/0x124) (do_raw_spin_lock) from [<c09b3970>] (_raw_spin_lock_irqsave+0x68/0x74) (_raw_spin_lock_irqsave) from [<c01a02f0>] (complete+0x24/0x58) (complete) from [<bf572610>] (wlcore_irq+0x48/0x17c [wlcore]) (wlcore_irq [wlcore]) from [<c01c5efc>] (irq_thread_fn+0x2c/0x64) (irq_thread_fn) from [<c01c623c>] (irq_thread+0x148/0x290) (irq_thread) from [<c016b4b0>] (kthread+0x160/0x17c) (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
...
After that the system will hang. Let's fix this by adding a flag for recovery and moving the recovery work call to to the error handling section.
And we want to set WL1271_FLAG_INTENDED_FW_RECOVERY and actually clear it too in wl1271_recovery_work() and just downgrade the error to a warning to prevent overly verbose output.
--- drivers/net/wireless/ti/wlcore/main.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/net/wireless/ti/wlcore/main.c +14 -4
@@ -957,6 +957,8 @@ static void wl1271_recovery_work(structBUG_ON (wl->conf.recovery.bug_on_recovery && !test_bit (WL1271_FLAG_INTENDED_FW_RECOVERY , &wl->flags)); +clear_bit (WL1271_FLAG_INTENDED_FW_RECOVERY , &wl->flags); +if (wl->conf.recovery.no_recovery) {wl1271_info ("No recovery (chosen on module load). Fw will remain stuck." ); goto out_unlock;
@@ -6710,6 +6712,7 @@ static int __maybe_unused wlcore_runtimeint ret;unsigned long start_time = jiffies;bool pending = false; +bool recovery = false;/* Nothing to do if no ELP mode requested */ if (!test_bit (WL1271_FLAG_IN_ELP , &wl->flags))
@@ -6726,7 +6729,7 @@ static int __maybe_unused wlcore_runtime ret =wlcore_raw_write32 (wl,HW_ACCESS_ELP_CTRL_REG ,ELPCTRL_WAKE_UP );if (ret <0 ) { -wl12xx_queue_recovery_work (wl); + recovery = true; goto err; }
@@ -6734,11 +6737,12 @@ static int __maybe_unused wlcore_runtime ret =wait_for_completion_timeout (&compl,msecs_to_jiffies (WL1271_WAKEUP_TIMEOUT ));if (ret ==0 ) { -wl1271_error ("ELP wakeup timeout!" ); -wl12xx_queue_recovery_work (wl); +wl1271_warning ("ELP wakeup timeout!" );/* Return no error for runtime PM for recovery */ -return 0 ; + ret =0 ; + recovery = true; + goto err; } }
@@ -6753,6 +6757,12 @@ err:spin_lock_irqsave (&wl->wl_lock, flags); wl->elp_compl =NULL ;spin_unlock_irqrestore (&wl->wl_lock, flags); + +if (recovery) { +set_bit (WL1271_FLAG_INTENDED_FW_RECOVERY , &wl->flags); +wl12xx_queue_recovery_work (wl); + } +return ret; }
Greg Kroah-Hartman
maintainerPATCH 78/361 nvmet-rdma: use a private workqueue for delete
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <[email protected]>
[ Upstream commit 2acf70ade79d26b97611a8df52eb22aa33814cd4 ]
Queue deletion is done asynchronous when the last reference on the queue is dropped. Thus, in order to make sure we don't over allocate under a connect/disconnect storm, we let queue deletion complete before making forward progress.
However, given that we flush the system_wq from rdma_cm context which runs from a workqueue context, we can have a circular locking complaint [1]. Fix that by using a private workqueue for queue deletion.
[1]:
======================================================
WARNING: possible circular locking dependency detected
4.19.0-rc4-dbg+ #3 Not tainted
------------------------------------------------------
kworker/5:0/39 is trying to acquire lock:00000000a10b6db9 (&id_priv->handler_mutex){+.+.}, at: rdma_destroy_id+0x6f/0x440 [rdma_cm]
but task is already holding lock:00000000331b4e2c ((work_completion)(&queue->release_work)){+.+.}, at: process_one_work+0x3ed/0xa20
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 ((work_completion)(&queue->release_work)){+.+.}:
process_one_work+0x474/0xa20
worker_thread+0x63/0x5a0
kthread+0x1cf/0x1f0
ret_from_fork+0x24/0x30-> #2 ((wq_completion)"events"){+.+.}:
flush_workqueue+0xf3/0x970
nvmet_rdma_cm_handler+0x133d/0x1734 [nvmet_rdma]
cma_ib_req_handler+0x72f/0xf90 [rdma_cm]
cm_process_work+0x2e/0x110 [ib_cm]
cm_req_handler+0x135b/0x1c30 [ib_cm]
cm_work_handler+0x2b7/0x38cd [ib_cm]
process_one_work+0x4ae/0xa20
nvmet_rdma:nvmet_rdma_cm_handler: nvmet_rdma: disconnected (10): status 0 id 0000000040357082
worker_thread+0x63/0x5a0
kthread+0x1cf/0x1f0
ret_from_fork+0x24/0x30nvme nvme0: Reconnecting in 10 seconds...
-> #1 (&id_priv->handler_mutex/1){+.+.}:
__mutex_lock+0xfe/0xbe0
mutex_lock_nested+0x1b/0x20
cma_ib_req_handler+0x6aa/0xf90 [rdma_cm]
cm_process_work+0x2e/0x110 [ib_cm]
cm_req_handler+0x135b/0x1c30 [ib_cm]
cm_work_handler+0x2b7/0x38cd [ib_cm]
process_one_work+0x4ae/0xa20
worker_thread+0x63/0x5a0
kthread+0x1cf/0x1f0
ret_from_fork+0x24/0x30-> #0 (&id_priv->handler_mutex){+.+.}:
lock_acquire+0xc5/0x200
__mutex_lock+0xfe/0xbe0
mutex_lock_nested+0x1b/0x20
rdma_destroy_id+0x6f/0x440 [rdma_cm]
nvmet_rdma_release_queue_work+0x8e/0x1b0 [nvmet_rdma]
process_one_work+0x4ae/0xa20
worker_thread+0x63/0x5a0
kthread+0x1cf/0x1f0
ret_from_fork+0x24/0x30--- drivers/nvme/target/rdma.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/nvme/target/rdma.c +15 -4
@@ -122,6 +122,7 @@ struct nvmet_rdma_device {int inline_page_count; }; +struct workqueue_struct *nvmet_rdma_delete_wq;static bool nvmet_rdma_use_srq;module_param_named (use_srq, nvmet_rdma_use_srq, bool,0444 );MODULE_PARM_DESC (use_srq,"Use shared receive queue." );
@@ -1267,12 +1268,12 @@ static int nvmet_rdma_queue_connect(struif (queue->host_qid ==0 ) {/* Let inflight controller teardown complete */ -flush_scheduled_work (); +flush_workqueue (nvmet_rdma_delete_wq); } ret =nvmet_rdma_cm_accept (cm_id, queue, &event->param.conn);if (ret) { -schedule_work (&queue->release_work); +queue_work (nvmet_rdma_delete_wq, &queue->release_work);/* Destroying rdma_cm id is not needed here */ return 0 ; }
@@ -1337,7 +1338,7 @@ static void __nvmet_rdma_queue_disconnecif (disconnect) {rdma_disconnect (queue->cm_id); -schedule_work (&queue->release_work); +queue_work (nvmet_rdma_delete_wq, &queue->release_work); } }
@@ -1367,7 +1368,7 @@ static void nvmet_rdma_queue_connect_faimutex_unlock (&nvmet_rdma_queue_mutex);pr_err ("failed to connect queue %d\n" , queue->idx); -schedule_work (&queue->release_work); +queue_work (nvmet_rdma_delete_wq, &queue->release_work); }/**
@@ -1649,8 +1650,17 @@ static int __init nvmet_rdma_init(void)if (ret) goto err_ib_client; + nvmet_rdma_delete_wq =alloc_workqueue ("nvmet-rdma-delete-wq" , +WQ_UNBOUND |WQ_MEM_RECLAIM |WQ_SYSFS ,0 ); +if (!nvmet_rdma_delete_wq) { + ret = -ENOMEM ; + goto err_unreg_transport; + } +return 0 ; +err_unreg_transport: +nvmet_unregister_transport (&nvmet_rdma_ops); err_ib_client:ib_unregister_client (&nvmet_rdma_ib_client);return ret;
@@ -1658,6 +1668,7 @@ err_ib_client: static void __exit nvmet_rdma_exit(void) { +destroy_workqueue (nvmet_rdma_delete_wq);nvmet_unregister_transport (&nvmet_rdma_ops);ib_unregister_client (&nvmet_rdma_ib_client);WARN_ON_ONCE (!list_empty (&nvmet_rdma_queue_list));
Re: [PATCH 4.19 078/361] nvmet-rdma: use a private workqueue for delete
Quoted 8 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <[email protected]>
[ Upstream commit
2acf70ade79d26b97611a8df52eb22aa33814cd4]
Quoted 8 lines
Queue deletion is done asynchronous when the last reference on the queue is dropped. Thus, in order to make sure we don't over allocate under a connect/disconnect storm, we let queue deletion complete before making forward progress.
However, given that we flush the
system_wqfromrdma_cmcontext which runs from a workqueue context, we can have a circular locking complaint [1]. Fix that by using a private workqueue for queue deletion.
Hi Greg,
You may want to drop this patch. A bug was discovered in this patch a few days ago. I think not backporting this patch is better than backporting it. See also the discussion at http://lists.infradead.org/pipermail/linux-nvme/2018-November/020766.html. A quote from that e-mail thread: "I think we need to revert 2acf70a ("nvmet-rdma: use a private workqueue for delete") altogether because it never made any difference..".
Bart.
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 078/361] nvmet-rdma: use a private workqueue for delete
Quoted 20 lines · Bart Van Assche
Quoted 8 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <[email protected]>
[ Upstream commit
2acf70ade79d26b97611a8df52eb22aa33814cd4]Quoted 8 lines
Queue deletion is done asynchronous when the last reference on the queue is dropped. Thus, in order to make sure we don't over allocate under a connect/disconnect storm, we let queue deletion complete before making forward progress.
However, given that we flush the
system_wqfromrdma_cmcontext which runs from a workqueue context, we can have a circular locking complaint [1]. Fix that by using a private workqueue for queue deletion.Hi Greg,
Quoted 7 lines
You may want to drop this patch. A bug was discovered in this patch a few days ago. I think not backporting this patch is better than backporting it. See also the discussion at
http://lists.infradead.org/pipermail/linux-nvme/2018-November/020766.html. A quote from that e-mail thread: "I think we need to revert 2acf70a ("nvmet-rdma: use a private workqueue for delete") altogether because it never made any difference..".
Now dropped from the 4.18 and 4.19 queues, thanks.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 79/361 ACPI/PPTT: Handle architecturally unknown cache types
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeffrey Hugo <[email protected]>
[ Upstream commit 59bbff3775c0951300f7b41345a54b999438f8d0 ]
The type of a cache might not be specified by architectural mechanisms (ie system registers), but its type might be specified in the PPTT. In this case, we should populate the type of the cache, rather than leave it undefined.
This fixes the issue where the cacheinfo driver will not populate sysfs for such caches, resulting in the information missing from utilities like lstopo and lscpu, thus degrading the user experience.
--- drivers/acpi/pptt.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-)
drivers/acpi/pptt.c +13 -20
@@ -338,9 +338,6 @@ static struct acpi_pptt_cache *acpi_findreturn found; } -/* total number of attributes checked by the properties code */ -#define PPTT_CHECKED_ATTRIBUTES 4 -/** * update_cache_properties() - Update cacheinfo for the given processor * @this_leaf: Kernel cache info structure being updated
@@ -357,25 +354,15 @@ static void update_cache_properties(strustruct acpi_pptt_cache *found_cache, struct acpi_pptt_processor *cpu_node) { - int valid_flags = 0; - this_leaf->fw_token = cpu_node; -if (found_cache->flags &ACPI_PPTT_SIZE_PROPERTY_VALID ) { +if (found_cache->flags &ACPI_PPTT_SIZE_PROPERTY_VALID ) this_leaf->size = found_cache->size; - valid_flags++; - } -if (found_cache->flags &ACPI_PPTT_LINE_SIZE_VALID ) { +if (found_cache->flags &ACPI_PPTT_LINE_SIZE_VALID ) this_leaf->coherency_line_size = found_cache->line_size; - valid_flags++; - } -if (found_cache->flags &ACPI_PPTT_NUMBER_OF_SETS_VALID ) { +if (found_cache->flags &ACPI_PPTT_NUMBER_OF_SETS_VALID ) this_leaf->number_of_sets = found_cache->number_of_sets; - valid_flags++; - } -if (found_cache->flags &ACPI_PPTT_ASSOCIATIVITY_VALID ) { +if (found_cache->flags &ACPI_PPTT_ASSOCIATIVITY_VALID ) this_leaf->ways_of_associativity = found_cache->associativity; - valid_flags++; - }if (found_cache->flags &ACPI_PPTT_WRITE_POLICY_VALID ) {switch (found_cache->attributes &ACPI_PPTT_MASK_WRITE_POLICY ) {case ACPI_PPTT_CACHE_POLICY_WT :
@@ -402,11 +389,17 @@ static void update_cache_properties(stru } }/* -* If the above flags are valid, and the cache type is NOCACHE -* update the cache type as well. +* If cache type is NOCACHE, then the cache hasn't been specified +* via other mechanisms. Update the type if a cache type has been +* provided. +* +* Note, we assume such caches are unified based on conventional system +* design and known examples. Significant work is required elsewhere to +* fully support data/instruction only type caches which are only +* specified in PPTT. */ if (this_leaf->type ==CACHE_TYPE_NOCACHE && - valid_flags ==PPTT_CHECKED_ATTRIBUTES ) + found_cache->flags &ACPI_PPTT_CACHE_TYPE_VALID ) this_leaf->type =CACHE_TYPE_UNIFIED ; }
Greg Kroah-Hartman
maintainerPATCH 80/361 ACPI / PM: LPIT: Register sysfs attributes based on FADT
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajneesh Bhardwaj <[email protected]>
[ Upstream commit 1cdda9486f5103fb133f88e662e48c504adbb779 ]
ACPI Low Power S0 Idle capabilities are announced via FADT table and can be used to inform the kernel about the presence of one or more Low Power Idle (LPI) entries as descried in LPIT table. LPIT table can exist independently even if the FADT S0 Idle flag is not set and thus it could confuse user since the following cpuidle attributes are created.
/sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
Presence or absence of above attributes could mean that the given platform supports S0ix state or not.
This change allows to create the above cpuidle attributes only if FADT table supports Low Power S0 Idle.
--- drivers/acpi/acpi_lpit.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/acpi_lpit.c +6 -0
@@ -117,11 +117,17 @@ static void lpit_update_residency(structif (!info->iomem_addr)return ; +if (!(acpi_gbl_FADT.flags &ACPI_FADT_LOW_POWER_S0 )) +return ; +/* Silently fail, if cpuidle attribute group is not present */ sysfs_add_file_to_group (&cpu_subsys.dev_root->kobj, &dev_attr_low_power_idle_system_residency_us.attr,"cpuidle" ); }else if (info->gaddr.space_id ==ACPI_ADR_SPACE_FIXED_HARDWARE ) { +if (!(acpi_gbl_FADT.flags &ACPI_FADT_LOW_POWER_S0 )) +return ; +/* Silently fail, if cpuidle attribute group is not present */ sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, &dev_attr_low_power_idle_cpu_residency_us.attr,
Greg Kroah-Hartman
maintainerPATCH 81/361 ACPI / processor: Fix the return value of acpi_processor_ids_walk()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dou Liyang <[email protected]>
[ Upstream commit d0381bf4f80c571dde1244fe5b85dc35e8b3f546 ]
ACPI driver should make sure all the processor IDs in their ACPI Namespace are unique. the driver performs a depth-first walk of the namespace tree and calls the acpi_processor_ids_walk() to check the duplicate IDs.
But, the acpi_processor_ids_walk() mistakes the return value. If a processor is checked, it returns true which causes the walk break immediately, and other processors will never be checked.
Repace the value with AE_OK which is the standard acpi_status value. And don't abort the namespace walk even on error.
--- drivers/acpi/acpi_processor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/acpi/acpi_processor.c +4 -3
@@ -643,7 +643,7 @@ static acpi_status __init acpi_processor status =acpi_get_type (handle, &acpi_type);if (ACPI_FAILURE (status)) -return false; +return status;switch (acpi_type) {case ACPI_TYPE_PROCESSOR :
@@ -663,11 +663,12 @@ static acpi_status __init acpi_processor }processor_validated_ids_update (uid); -return true; +return AE_OK ; err: +/* Exit on error, but don't abort the namespace walk */ acpi_handle_info (handle,"Invalid processor object\n" ); -return false; +return AE_OK ; }
Greg Kroah-Hartman
maintainerPATCH 82/361 cpufreq: dt: Try freeing static OPPs only if we have added them
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
[ Upstream commit 51c99dd2c06b234575661fa1e0a1dea6c3ef566f ]
We can not call dev_pm_opp_of_cpumask_remove_table() freely anymore since the latest OPP core updates as that uses reference counting to free resources. There are cases where no static OPPs are added (using DT) for a platform and trying to remove the OPP table may end up decrementing refcount which is already zero and hence generating warnings.
Lets track if we were able to add static OPPs or not and then only remove the table based on that. Some reshuffling of code is also done to do that.
--- drivers/cpufreq/cpufreq-dt.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-)
drivers/cpufreq/cpufreq-dt.c +19 -15
@@ -32,6 +32,7 @@ struct private_data {struct device *cpu_dev;struct thermal_cooling_device *cdev;const char *reg_name; +bool have_static_opps; };static struct freq_attr *cpufreq_dt_attr[] = {
@@ -204,6 +205,15 @@ static int cpufreq_init(struct cpufreq_p } } + priv =kzalloc (sizeof (*priv),GFP_KERNEL ); +if (!priv) { + ret = -ENOMEM ; + goto out_put_regulator; + } + + priv->reg_name = name; + priv->opp_table = opp_table; +/* * Initialize OPP tables for all policy->cpus. They will be shared by * all CPUs which have marked their CPUs shared with OPP bindings.
@@ -214,7 +224,8 @@ static int cpufreq_init(struct cpufreq_p* * OPPs might be populated at runtime, don't check for error here */ -dev_pm_opp_of_cpumask_add_table (policy->cpus); +if (!dev_pm_opp_of_cpumask_add_table (policy->cpus)) + priv->have_static_opps = true;/* * But we need OPP table to function so if it is not there let's
@@ -240,19 +251,10 @@ static int cpufreq_init(struct cpufreq_p __func__, ret); } - priv =kzalloc (sizeof (*priv),GFP_KERNEL ); -if (!priv) { - ret = -ENOMEM ; - goto out_free_opp; - } - - priv->reg_name = name; - priv->opp_table = opp_table; - ret =dev_pm_opp_init_cpufreq_table (cpu_dev, &freq_table);if (ret) {dev_err (cpu_dev,"failed to init cpufreq table: %d\n" , ret); - goto out_free_priv; + goto out_free_opp; } priv->cpu_dev = cpu_dev;
@@ -282,10 +284,11 @@ static int cpufreq_init(struct cpufreq_p out_free_cpufreq_table:dev_pm_opp_free_cpufreq_table (cpu_dev, &freq_table); -out_free_priv: -kfree (priv); out_free_opp: -dev_pm_opp_of_cpumask_remove_table (policy->cpus); +if (priv->have_static_opps) +dev_pm_opp_of_cpumask_remove_table (policy->cpus); +kfree (priv); +out_put_regulator:if (name)dev_pm_opp_put_regulators (opp_table); out_put_clk:
@@ -300,7 +303,8 @@ static int cpufreq_exit(struct cpufreq_pcpufreq_cooling_unregister (priv->cdev);dev_pm_opp_free_cpufreq_table (priv->cpu_dev, &policy->freq_table); -dev_pm_opp_of_cpumask_remove_table (policy->related_cpus); +if (priv->have_static_opps) +dev_pm_opp_of_cpumask_remove_table (policy->related_cpus);if (priv->reg_name)dev_pm_opp_put_regulators (priv->opp_table);
Greg Kroah-Hartman
maintainerPATCH 83/361 x86/intel_rdt: Show missing resctrl mount options
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaochen Shen <[email protected]>
[ Upstream commit 2cc81c6992248ea37d0241bc325977bab310bc3b ]
In resctrl filesystem, mount options exist to enable L3/L2 CDP and MBA Software Controller features if the platform supports them:
mount -t resctrl resctrl [-o cdp[,cdpl2][,mba_MBps]] /sys/fs/resctrl
But currently only "cdp" option is displayed in /proc/mounts. "cdpl2" and "mba_MBps" options are not shown even when they are active.
Before:
# mount -t resctrl resctrl -o cdp,mba_MBps /sys/fs/resctrl # grep resctrl /proc/mounts /sys/fs/resctrl /sys/fs/resctrl resctrl rw,relatime,cdp 0 0
After:
# mount -t resctrl resctrl -o cdp,mba_MBps /sys/fs/resctrl # grep resctrl /proc/mounts /sys/fs/resctrl /sys/fs/resctrl resctrl rw,relatime,cdp,mba_MBps 0 0
--- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +7 -0
@@ -2805,6 +2805,13 @@ static int rdtgroup_show_options(struct {if (rdt_resources_all[RDT_RESOURCE_L3DATA ].alloc_enabled)seq_puts (seq,",cdp" ); + +if (rdt_resources_all[RDT_RESOURCE_L2DATA ].alloc_enabled) +seq_puts (seq,",cdpl2" ); + +if (is_mba_sc (&rdt_resources_all[RDT_RESOURCE_MBA ])) +seq_puts (seq,",mba_MBps" ); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 84/361 mtd: rawnand: atmel: Fix potential NULL pointer dereference
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit fbed20280d912449cfb40c382cb55e3d11502587 ]
There is a potential execution path in which function of_find_compatible_node() returns NULL. In such a case, we end up having a NULL pointer dereference when accessing pointer *nfc_np* in function of_clk_get().
So, we better don't take any chances and fix this by null checking pointer *nfc_np* before calling of_clk_get().
Addresses-Coverity-ID: 1473052 ("Dereference null return value")
--- drivers/mtd/nand/raw/atmel/nand-controller.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/atmel/nand-controller.c +4 -0
@@ -2063,6 +2063,10 @@ atmel_hsmc_nand_controller_legacy_init(s nand_np = dev->of_node; nfc_np =of_find_compatible_node (dev->of_node,NULL ,"atmel,sama5d3-nfc" ); +if (!nfc_np) { +dev_err (dev,"Could not find device node for sama5d3-nfc\n" ); +return -ENODEV ; + } nc->clk =of_clk_get (nfc_np,0 );if (IS_ERR (nc->clk)) {
Greg Kroah-Hartman
maintainerPATCH 85/361 nvme: call nvme_complete_rq when nvmf_check_ready fails for mpath I/O
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit 783f4a4408e1251d17f333ad56abac24dde988b9 ]
When an io is rejected by nvmf_check_ready() due to validation of the controller state, the nvmf_fail_nonready_command() will normally return BLK_STS_RESOURCE to requeue and retry. However, if the controller is dying or the I/O is marked for NVMe multipath, the I/O is failed so that the controller can terminate or so that the io can be issued on a different path. Unfortunately, as this reject point is before the transport has accepted the command, blk-mq ends up completing the I/O and never calls nvme_complete_rq(), which is where multipath may preserve or re-route the I/O. The end result is, the device user ends up seeing an EIO error.
Example: single path connectivity, controller is under load, and a reset is induced. An I/O is received:
a) while the reset state has been set but the queues have yet to be stopped; or
b) after queues are started (at end of reset) but before the reconnect has completed.
The I/O finishes with an EIO status.
This patch makes the following changes:
- Adds the HOST_PATH_ERROR pathing status from TP4028
- Modifies the reject point such that it appears to queue successfully, but actually completes the io with the new pathing status and calls nvme_complete_rq().
- nvme_complete_rq() recognizes the new status, avoids resetting the controller (likely was already done in order to get this new status), and calls the multipather to clear the current path that errored. This allows the next command (retry or new command) to select a new path if there is one.
--- drivers/nvme/host/fabrics.c | 7 +++++-- drivers/nvme/host/multipath.c | 7 +++++++ include/linux/nvme.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/nvme/host/fabrics.c +5 -2
@@ -552,8 +552,11 @@ blk_status_t nvmf_fail_nonready_command( ctrl->state != NVME_CTRL_DEAD && !blk_noretry_request(rq) && !(rq->cmd_flags & REQ_NVME_MPATH))return BLK_STS_RESOURCE ; -nvme_req (rq)->status =NVME_SC_ABORT_REQ ; -return BLK_STS_IOERR ; + +nvme_req (rq)->status =NVME_SC_HOST_PATH_ERROR ; +blk_mq_start_request (rq); +nvme_complete_rq (rq); +return BLK_STS_OK ; }EXPORT_SYMBOL_GPL (nvmf_fail_nonready_command);
drivers/nvme/host/multipath.c +7 -0
@@ -77,6 +77,13 @@ void nvme_failover_req(struct request *rqueue_work (nvme_wq, &ns->ctrl->ana_work); }break ; +case NVME_SC_HOST_PATH_ERROR : +/* +* Temporary transport disruption in talking to the controller. +* Try to send on a new path. +*/ +nvme_mpath_clear_current_path (ns); +break ;default :/* * Reset the controller for any non-ANA error as we don't know
include/linux/nvme.h +1 -0
@@ -1241,6 +1241,7 @@ enum {NVME_SC_ANA_PERSISTENT_LOSS =0x301 ,NVME_SC_ANA_INACCESSIBLE =0x302 ,NVME_SC_ANA_TRANSITION =0x303 , +NVME_SC_HOST_PATH_ERROR =0x370 , NVME_SC_DNR = 0x4000, };
Greg Kroah-Hartman
maintainerPATCH 86/361 ath10k: fix tx status flag setting for management frames
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rakesh Pillai <[email protected]>
[ Upstream commit 058a7eab9d9ee12f57282eb0b606668dada70d7a ]
The tx_status for management frames is being filled incorrectly in the flags of skb_cb. This incorrect flag setting causes the upper layers to consider that the particular frame was not transmitted properly, leading to improper behavior.
Set the IEEE80211_TX_STAT_ACK flag in the info flags of skb_cb, to indicate the successful transmission of the management frame.
Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/wmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +6 -1
@@ -2336,7 +2336,12 @@ static int wmi_process_mgmt_tx_comp(strudma_unmap_single (ar->dev, pkt_addr->paddr, msdu->len,DMA_FROM_DEVICE ); info =IEEE80211_SKB_CB (msdu); - info->flags |= status; + +if (status) + info->flags &= ~IEEE80211_TX_STAT_ACK ; +else + info->flags |=IEEE80211_TX_STAT_ACK ; +ieee80211_tx_status_irqsafe (ar->hw, msdu); ret =0 ;
Greg Kroah-Hartman
maintainerPATCH 87/361 signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
[ Upstream commit 22839869f21ab3850fbbac9b425ccc4c0023926f ]
The sigaltstack(2) system call fails with -ENOMEM if the new alternative signal stack is found to be smaller than SIGMINSTKSZ. On architectures such as arm64, where the native value for SIGMINSTKSZ is larger than the compat value, this can result in an unexpected error being reported to a compat task. See, for example:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904385
This patch fixes the problem by extending do_sigaltstack to take the minimum signal stack size as an additional parameter, allowing the native and compat system call entry code to pass in their respective values. COMPAT_SIGMINSTKSZ is just defined as SIGMINSTKSZ if it has not been defined by the architecture.
--- include/linux/compat.h | 3 +++ kernel/signal.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-)
include/linux/compat.h +3 -0
@@ -103,6 +103,9 @@ typedef struct compat_sigaltstack { compat_size_t ss_size; } compat_stack_t;#endif +#ifndef COMPAT_MINSIGSTKSZ +#define COMPAT_MINSIGSTKSZ MINSIGSTKSZ +#endif #define compat_jiffies_to_clock_t (x) \ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
kernel/signal.c +9 -5
@@ -3460,7 +3460,8 @@ int do_sigaction(int sig, struct k_sigac }static int -do_sigaltstack (const stack_t *ss,stack_t *oss,unsigned long sp) +do_sigaltstack (const stack_t *ss,stack_t *oss,unsigned long sp, +size_t min_ss_size) {struct task_struct *t = current;
@@ -3490,7 +3491,7 @@ do_sigaltstack (const stack_t *ss, stack ss_size =0 ; ss_sp =NULL ; }else { -if (unlikely (ss_size <MINSIGSTKSZ )) +if (unlikely (ss_size < min_ss_size))return -ENOMEM ; }
@@ -3508,7 +3509,8 @@ SYSCALL_DEFINE2(sigaltstack,const stack_if (uss &©_from_user (&new, uss,sizeof (stack_t)))return -EFAULT ; err =do_sigaltstack (uss ? &new :NULL , uoss ? &old :NULL , -current_user_stack_pointer ()); +current_user_stack_pointer (), +MINSIGSTKSZ );if (!err && uoss &©_to_user (uoss, &old,sizeof (stack_t))) err = -EFAULT ;return err;
@@ -3519,7 +3521,8 @@ int restore_altstack(const stack_t __usestack_t new;if (copy_from_user (&new, uss,sizeof (stack_t)))return -EFAULT ; - (void )do_sigaltstack (&new,NULL ,current_user_stack_pointer ()); + (void )do_sigaltstack (&new,NULL ,current_user_stack_pointer (), +MINSIGSTKSZ );/* squash all but EFAULT for now */ return 0 ; }
@@ -3553,7 +3556,8 @@ static int do_compat_sigaltstack(const c uss.ss_size = uss32.ss_size; } ret =do_sigaltstack (uss_ptr ? &uss :NULL , &uoss, -compat_user_stack_pointer ()); +compat_user_stack_pointer (), +COMPAT_MINSIGSTKSZ );if (ret >=0 && uoss_ptr) {compat_stack_t old;memset (&old,0 ,sizeof (old));
Re: [PATCH 4.19 087/361] signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
Quoted 8 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
[ Upstream commit
22839869f21ab3850fbbac9b425ccc4c0023926f]
Quoted 7 lines
The sigaltstack(2) system call fails with
-ENOMEMif the new alternative signal stack is found to be smaller than SIGMINSTKSZ. On architectures such as arm64, where the native value for SIGMINSTKSZ is larger than the compat value, this can result in an unexpected error being reported to a compat task. See, for example:
...
Thanks Greg! If it's not too much effort, could you also take this for 4.9-stable as well please? That would get it into our next Debian stable update too. :-)
Thanks,
Steve
Signature · 3 lines
Steve McIntyre, Cambridge, UK. [email protected] "I suspect most samba developers are already technically insane... Of course, since many of them are Australians, you can't tell." -- Linus Torvalds
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 087/361] signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
Quoted 15 lines · Steve McIntyre
Quoted 14 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
[ Upstream commit
22839869f21ab3850fbbac9b425ccc4c0023926f]The sigaltstack(2) system call fails with
-ENOMEMif the new alternative signal stack is found to be smaller than SIGMINSTKSZ. On architectures such as arm64, where the native value for SIGMINSTKSZ is larger than the compat value, this can result in an unexpected error being reported to a compat task. See, for example:
Quoted 7 lines
Quoted 1 line
...
Thanks Greg! If it's not too much effort, could you also take this for 4.9-stable as well please? That would get it into our next Debian stable update too. :-)
Does not apply to 4.9.y, can you provide a working backport?
thanks,
greg k-h
Re: [PATCH 4.19 087/361] signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
Quoted 1 line · Greg Kroah-Hartman
On Mon, Nov 12, 2018 at 11:49:05AM +0000, Steve McIntyre wrote:
...
Quoted 5 lines
Quoted 3 lines
Thanks Greg! If it's not too much effort, could you also take this for 4.9-stable as well please? That would get it into our next Debian stable update too. :-)
Does not apply to 4.9.y, can you provide a working backport?
No problem. It's a bit belated (sorry!) but the fixup is fairly obvious. On its way in separate mail shortly.
Signature · 3 lines
Steve McIntyre, Cambridge, UK. [email protected] "We're the technical experts. We were hired so that management could ignore our recommendations and tell us how to do our jobs." -- Mike Andrews
Greg Kroah-Hartman
maintainerPATCH 88/361 ice: fix changing of ring descriptor size (ethtool -G)
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bruce Allan <[email protected]>
[ Upstream commit f934bb9b8b6136edd261b2dc2c9ad4dbc39ffc66 ]
rx_mini_pending was set to an incorrect value. This was causing EINVAL to always be returned to 'ethtool -G'. The driver does not support mini or jumbo rings so the respective settings should be zero.
Also, change the valid range of the number of descriptors in the rings to make the code simpler and easier for users to understand (this removes the valid settings of 8 and 16). Add a system log message indicating when the number is rounded-up from what the user specifies with the 'ethtool -G' command (i.e. when it is not a multiple of 32), and update the log message when a user-provided value is out of range to also indicate the stride.
--- drivers/net/ethernet/intel/ice/ice.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_ethtool.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +2 -2
@@ -39,9 +39,9 @@extern const char ice_drv_ver[];#define ICE_BAR0 0#define ICE_DFLT_NUM_DESC 128 -#define ICE_MIN_NUM_DESC 8 -#define ICE_MAX_NUM_DESC 8160#define ICE_REQ_DESC_MULTIPLE 32 +#define ICE_MIN_NUM_DESC ICE_REQ_DESC_MULTIPLE +#define ICE_MAX_NUM_DESC 8160#define ICE_DFLT_TRAFFIC_CLASS BIT(0)#define ICE_INT_NAME_STR_LEN (IFNAMSIZ + 16)#define ICE_ETHTOOL_FWVER_LEN 32
drivers/net/ethernet/intel/ice/ice_ethtool.c +14 -3
@@ -478,9 +478,11 @@ ice_get_ringparam(struct net_device *net ring->tx_max_pending =ICE_MAX_NUM_DESC ; ring->rx_pending = vsi->rx_rings[0 ]->count; ring->tx_pending = vsi->tx_rings[0 ]->count; - ring->rx_mini_pending =ICE_MIN_NUM_DESC ; + +/* Rx mini and jumbo rings are not supported */ ring->rx_mini_max_pending =0 ; ring->rx_jumbo_max_pending =0 ; + ring->rx_mini_pending =0 ; ring->rx_jumbo_pending =0 ; }
@@ -498,14 +500,23 @@ ice_set_ringparam(struct net_device *net ring->tx_pending < ICE_MIN_NUM_DESC || ring->rx_pending > ICE_MAX_NUM_DESC || ring->rx_pending < ICE_MIN_NUM_DESC) { -netdev_err (netdev,"Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n" , +netdev_err (netdev,"Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d] (increment %d)\n" , ring->tx_pending, ring->rx_pending, -ICE_MIN_NUM_DESC ,ICE_MAX_NUM_DESC ); +ICE_MIN_NUM_DESC ,ICE_MAX_NUM_DESC , +ICE_REQ_DESC_MULTIPLE );return -EINVAL ; } new_tx_cnt =ALIGN (ring->tx_pending,ICE_REQ_DESC_MULTIPLE ); +if (new_tx_cnt != ring->tx_pending) +netdev_info (netdev, +"Requested Tx descriptor count rounded up to %d\n" , + new_tx_cnt); new_rx_cnt =ALIGN (ring->rx_pending,ICE_REQ_DESC_MULTIPLE ); +if (new_rx_cnt != ring->rx_pending) +netdev_info (netdev, +"Requested Rx descriptor count rounded up to %d\n" , + new_rx_cnt);/* if nothing to do return success */ if (new_tx_cnt == vsi->tx_rings[0]->count &&
Greg Kroah-Hartman
maintainerPATCH 89/361 ice: update fw version check logic
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit 396fbf9cab5dc07f8f87773062a8d35f54b40a05 ]
We have MAX_FW_API_VER_BRANCH, MAX_FW_API_VER_MAJOR, and MAX_FW_API_VER_MINOR that we use in ice_controlq.h to test when a firmware version is newer than expected. This is currently tested by comparing each field separately. Thus, we compare the branch field against the MAX_FW_API_VER_BRANCH, and so forth.
This means that currently, if we suppose that the max firmware version is defined as 0.2.1, i.e.
Then firmware 0.1.3 will fail to load. This is because the minor version 3 is greater than the max minor version 1.
This is not intuitive, because of the notion that increasing the major firmware version to 2 should mean any firmware version with a major version is less than 2 should be considered older than 2...
In order to allow both 0.2.1 and 0.1.3 to load, you would have to define the "max" firmware version as 0.2.3.. It is possible that such a firmware version doesn't even exist yet!
Fix this by replacing the current logic with an updated check that behaves as follows:
First, we check the major version. If it is greater than the expected version, then we prevent driver load. Additionally, a warning message is logged to indicate to the system administrator that they need to update their driver. This is now the only case where the driver will refuse to load.
Second, if the major version is less than the expected version, we log an information message indicating the NVM should be updated.
Third, if the major version is exact, we'll then check the minor version. If the minor version is more than two versions less than expected, we log an information message indicating the NVM should be updated. If it is more than two versions greater than the expected version, we log an information message that the driver should be updated.
To support this, the ice_aq_ver_check function needs its signature updated to pass the HW structure. Since we now pass this structure, there is no need to pass the firmware API versions separately.
--- drivers/net/ethernet/intel/ice/ice_controlq.c | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/ice/ice_controlq.c +19 -11
@@ -518,22 +518,31 @@ shutdown_sq_out:/** * ice_aq_ver_check - Check the reported AQ API version. -* @fw_branch: The "branch" of FW, typically describes the device type -* @fw_major: The major version of the FW API -* @fw_minor: The minor version increment of the FW API +* @hw: pointer to the hardware structure * * Checks if the driver should load on a given AQ API version. * * Return: 'true' iff the driver should attempt to load. 'false' otherwise. */ -static bool ice_aq_ver_check (u8 fw_branch,u8 fw_major,u8 fw_minor) +static bool ice_aq_ver_check (struct ice_hw *hw) { -if (fw_branch !=EXP_FW_API_VER_BRANCH ) -return false; -if (fw_major !=EXP_FW_API_VER_MAJOR ) -return false; -if (fw_minor !=EXP_FW_API_VER_MINOR ) +if (hw->api_maj_ver >EXP_FW_API_VER_MAJOR ) { +/* Major API version is newer than expected, don't load */ +dev_warn (ice_hw_to_dev (hw), +"The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n" );return false; + }else if (hw->api_maj_ver ==EXP_FW_API_VER_MAJOR ) { +if (hw->api_min_ver > (EXP_FW_API_VER_MINOR +2 )) +dev_info (ice_hw_to_dev (hw), +"The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.\n" ); +else if ((hw->api_min_ver +2 ) <EXP_FW_API_VER_MINOR ) +dev_info (ice_hw_to_dev (hw), +"The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n" ); + }else { +/* Major API version is older than expected, log a warning */ +dev_info (ice_hw_to_dev (hw), +"The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n" ); + }return true; }
@@ -588,8 +597,7 @@ static enum ice_status ice_init_check_adif (status) goto init_ctrlq_free_rq; -if (!ice_aq_ver_check (hw->api_branch, hw->api_maj_ver, - hw->api_min_ver)) { +if (!ice_aq_ver_check (hw)) { status =ICE_ERR_FW_API_VER ; goto init_ctrlq_free_rq; }
Greg Kroah-Hartman
maintainerPATCH 90/361 net: hns3: Fix for packet buffer setting bug
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunsheng Lin <[email protected]>
[ Upstream commit 996ff91840eb6f288826e472685abde78bac20ea ]
The hardware expects a unit of 128 bytes when setting packet buffer. When calculating the packet buffer size, hclge_rx_buffer_calc does not round up the size as a unit of 128 byte, which may casue packet lost problem when stress testing.
This patch fixes it by rounding up packet size when calculating.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +8 -6
@@ -1657,11 +1657,13 @@ static int hclge_tx_buffer_calc(struct hstatic int hclge_rx_buffer_calc (struct hclge_dev *hdev,struct hclge_pkt_buf_alloc *buf_alloc) { -u32 rx_all = hdev->pkt_buf_size; +#define HCLGE_BUF_SIZE_UNIT 128 +u32 rx_all = hdev->pkt_buf_size, aligned_mps;int no_pfc_priv_num, pfc_priv_num;struct hclge_priv_buf *priv;int i; + aligned_mps =round_up (hdev->mps,HCLGE_BUF_SIZE_UNIT ); rx_all -=hclge_get_tx_buff_alloced (buf_alloc);/* When DCB is not supported, rx private
@@ -1680,13 +1682,13 @@ static int hclge_rx_buffer_calc(struct hif (hdev->hw_tc_map &BIT (i)) { priv->enable =1 ;if (hdev->tm_info.hw_pfc_map &BIT (i)) { - priv->wl.low = hdev->mps; - priv->wl.high = priv->wl.low + hdev->mps; + priv->wl.low = aligned_mps; + priv->wl.high = priv->wl.low + aligned_mps; priv->buf_size = priv->wl.high +HCLGE_DEFAULT_DV ; }else { priv->wl.low =0 ; - priv->wl.high =2 * hdev->mps; + priv->wl.high =2 * aligned_mps; priv->buf_size = priv->wl.high; } }else {
@@ -1718,11 +1720,11 @@ static int hclge_rx_buffer_calc(struct hif (hdev->tm_info.hw_pfc_map &BIT (i)) { priv->wl.low =128 ; - priv->wl.high = priv->wl.low + hdev->mps; + priv->wl.high = priv->wl.low + aligned_mps; priv->buf_size = priv->wl.high +HCLGE_DEFAULT_DV ; }else { priv->wl.low =0 ; - priv->wl.high = hdev->mps; + priv->wl.high = aligned_mps; priv->buf_size = priv->wl.high; } }
Greg Kroah-Hartman
maintainerPATCH 91/361 Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Hewitt <[email protected]>
[ Upstream commit a357ea098c9605f60d92a66a9073f56ce25726da ]
This patch adds the device ID for the AMPAK AP6335 combo module used in the 1st generation WeTek Hub Android/LibreELEC HTPC box. The WiFI chip identifies itself as BCM4339, while Bluetooth identifies itself as BCM4335 (rev C0):
``` [ 4.864248] Bluetooth: hci0: BCM: chip id 86 [ 4.866388] Bluetooth: hci0: BCM: features 0x2f [ 4.889317] Bluetooth: hci0: BCM4335C0 [ 4.889332] Bluetooth: hci0: BCM4335C0 (003.001.009) build 0000 [ 9.778383] Bluetooth: hci0: BCM4335C0 (003.001.009) build 0268 ```
Output from hciconfig:
``` hci0: Type: Primary Bus: UART BD Address: 43:39:00:00:1F:AC ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:7567 acl:234 sco:0 events:386 errors:0 TX bytes:53844 acl:77 sco:0 commands:304 errors:0 Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: SLAVE ACCEPT Name: 'HUB' Class: 0x0c0000 Service Classes: Rendering, Capturing Device Class: Miscellaneous, HCI Version: 4.0 (0x6) Revision: 0x10c LMP Version: 4.0 (0x6) Subversion: 0x6109 Manufacturer: Broadcom Corporation (15) ```
--- drivers/bluetooth/btbcm.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/btbcm.c +1 -0
@@ -324,6 +324,7 @@ static const struct bcm_subver_table bcm { 0x4103, "BCM4330B1" }, /* 002.001.003 */ { 0x410e, "BCM43341B0" }, /* 002.001.014 */ { 0x4406, "BCM4324B3" }, /* 002.004.006 */ + { 0x6109, "BCM4335C0" }, /* 003.001.009 */ { 0x610c, "BCM4354" }, /* 003.001.012 */ { 0x2122, "BCM4343A0" }, /* 001.001.034 */ { 0x2209, "BCM43430A1" }, /* 001.002.009 */
Greg Kroah-Hartman
maintainerPATCH 92/361 Bluetooth: hci_qca: Remove hdev dereference in qca_close().
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Balakrishna Godavarthi <[email protected]>
[ Upstream commit c2d7827338618a9e73a3f892ca63d9082bb7a94d ]
When flag KASAN is set, we are seeing an following crash while removing hci_uart module.
[ 50.589909] Unable to handle kernel paging request at virtual address 6b6b6b6b6b6b73 [ 50.597902] Mem abort info: [ 50.600846] Exception class = DABT (current EL), IL = 32 bits [ 50.606959] SET = 0, FnV = 0 [ 50.610142] EA = 0, S1PTW = 0 [ 50.613396] Data abort info: [ 50.616401] ISV = 0, ISS = 0x00000004 [ 50.620373] CM = 0, WnR = 0 [ 50.623466] [006b6b6b6b6b6b73] address between user and kernel address ranges [ 50.630818] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 50.671670] PC is at qca_power_shutdown+0x28/0x100 [hci_uart] [ 50.677593] LR is at qca_close+0x74/0xb0 [hci_uart] [ 50.775689] Process rmmod (pid: 2144, stack limit = 0xffffff801ba90000) [ 50.782493] Call trace:
[ 50.872150] [<ffffff8000c3c81c>] qca_power_shutdown+0x28/0x100 [hci_uart] [ 50.879138] [<ffffff8000c3c968>] qca_close+0x74/0xb0 [hci_uart] [ 50.885238] [<ffffff8000c3a71c>] hci_uart_unregister_device+0x44/0x50 [hci_uart] [ 50.892846] [<ffffff8000c3c9f4>] qca_serdev_remove+0x50/0x5c [hci_uart] [ 50.899654] [<ffffff800844f630>] serdev_drv_remove+0x28/0x38 [ 50.905489] [<ffffff800850fc44>] device_release_driver_internal+0x140/0x1e4 [ 50.912653] [<ffffff800850fd94>] driver_detach+0x78/0x84 [ 50.918121] [<ffffff800850edac>] bus_remove_driver+0x80/0xa8 [ 50.923942] [<ffffff80085107dc>] driver_unregister+0x4c/0x58 [ 50.929768] [<ffffff8000c3ca8c>] qca_deinit+0x24/0x598 [hci_uart] [ 50.936045] [<ffffff8000c3ca10>] hci_uart_exit+0x10/0x48 [hci_uart] [ 50.942495] [<ffffff8008136630>] SyS_delete_module+0x17c/0x224
This crash is due to dereference of hdev, after freeing it.
--- drivers/bluetooth/hci_qca.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/bluetooth/hci_qca.c +9 -6
@@ -167,7 +167,7 @@ struct qca_serdev { };static int qca_power_setup (struct hci_uart *hu,bool on); -static void qca_power_shutdown (struct hci_dev *hdev); +static void qca_power_shutdown (struct hci_uart *hu);static void __serial_clock_on (struct tty_struct *tty) {
@@ -609,7 +609,7 @@ static int qca_close(struct hci_uart *huif (hu->serdev) { qcadev =serdev_device_get_drvdata (hu->serdev);if (qcadev->btsoc_type ==QCA_WCN3990 ) -qca_power_shutdown (hu->hdev); +qca_power_shutdown (hu);else gpiod_set_value_cansleep (qcadev->bt_en,0 );
@@ -1232,12 +1232,15 @@ static const struct qca_vreg_data qca_so .num_vregs = 4, }; -static void qca_power_shutdown (struct hci_dev *hdev) +static void qca_power_shutdown (struct hci_uart *hu) { -struct hci_uart *hu =hci_get_drvdata (hdev); +struct serdev_device *serdev = hu->serdev; +unsigned char cmd =QCA_WCN3990_POWEROFF_PULSE ;host_set_baudrate (hu,2400 ); -qca_send_power_pulse (hdev,QCA_WCN3990_POWEROFF_PULSE ); +hci_uart_set_flow_control (hu, true); +serdev_device_write_buf (serdev, &cmd,sizeof (cmd)); +hci_uart_set_flow_control (hu, false);qca_power_setup (hu, false); }
@@ -1413,7 +1416,7 @@ static void qca_serdev_remove(struct serstruct qca_serdev *qcadev =serdev_device_get_drvdata (serdev);if (qcadev->btsoc_type ==QCA_WCN3990 ) -qca_power_shutdown (qcadev->serdev_hu.hdev); +qca_power_shutdown (&qcadev->serdev_hu);else clk_disable_unprepare (qcadev->susclk);
Greg Kroah-Hartman
maintainerPATCH 93/361 efi/x86: Call efi_parse_options() from efi_main()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit c33ce984435bb6142792802d75513a71e55d1969 ]
Before this commit we were only calling efi_parse_options() from make_boot_params(), but make_boot_params() only gets called if the kernel gets booted directly as an EFI executable. So when booted through e.g. grub we ended up not parsing the commandline in the boot code.
This makes the drivers/firmware/efi/libstub code ignore the "quiet" commandline argument resulting in the following message being printed:
"EFI stub: UEFI Secure Boot is enabled."
Despite the quiet request. This commits adds an extra call to efi_parse_options() to efi_main() to make sure that the options are always processed. This fixes quiet not working.
This also fixes the libstub code ignoring nokaslr and efi=nochunk.
--- arch/x86/boot/compressed/eboot.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/boot/compressed/eboot.c +10 -0
@@ -738,6 +738,7 @@ efi_main(struct efi_config *c, struct bostruct desc_struct *desc;void *handle;efi_system_table_t *_table; +unsigned long cmdline_paddr; efi_early = c;
@@ -756,6 +757,15 @@ efi_main(struct efi_config *c, struct bosetup_boot_services32 (efi_early);/* +* make_boot_params() may have been called before efi_main(), in which +* case this is the second time we parse the cmdline. This is ok, +* parsing the cmdline multiple times does not have side-effects. +*/ + cmdline_paddr = ((u64 )hdr->cmd_line_ptr | + ((u64 )boot_params->ext_cmd_line_ptr <<32 )); +efi_parse_options ((char *)cmdline_paddr); + +/* * If the boot loader gave us a value for secure_boot then we use that, * otherwise we ask the BIOS. */
Greg Kroah-Hartman
maintainerPATCH 94/361 x86: boot: Fix EFI stub alignment
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
[ Upstream commit 9c1442a9d039a1a3302fa93e9a11001c5f23b624 ]
We currently align the end of the compressed image to a multiple of
16. However, the PE-COFF header included in the EFI stub says that the file alignment is 32 bytes, and when adding an EFI signature to the file it must first be padded to this alignment.
sbsigntool commands warn about this:
warning: file-aligned section .text extends beyond end of file
warning: checksum areas are greater than image size. Invalid section table?
Worse, pesign -at least when creating a detached signature- uses the hash of the unpadded file, resulting in an invalid signature if padding is required.
Avoid both these problems by increasing alignment to 32 bytes when CONFIG_EFI_STUB is enabled.
--- arch/x86/boot/tools/build.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/boot/tools/build.c +7 -0
@@ -391,6 +391,13 @@ int main(int argc, char ** argv)die ("Unable to mmap '%s': %m" , argv[2 ]);/* Number of 16-byte paragraphs, including space for a 4-byte CRC */ sys_size = (sz +15 +4 ) /16 ; +#ifdef CONFIG_EFI_STUB +/* +* COFF requires minimum 32-byte alignment of sections, and +* adding a signature is problematic without that alignment. +*/ + sys_size = (sys_size +1 ) & ~1 ; +#endif /* Patch the setup code with the appropriate size parameters */ buf[0x1f1 ] = setup_sectors-1 ;
Greg Kroah-Hartman
maintainerPATCH 95/361 net: hns3: Add nic state check before calling netif_tx_wake_queue
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit 7a8101109dd37837f587cd56f3111d4fc17a07f5 ]
When nic down, it firstly calls netif_tx_stop_all_queues(), then calls napi_disable(). But napi_disable() will wait current napi_poll finish, it may call netif_tx_wake_queue(). This patch fixes it by add nic state checking.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +3 -1
@@ -1915,6 +1915,7 @@ static int is_valid_clean_head(struct hnbool hns3_clean_tx_ring (struct hns3_enet_ring *ring,int budget) {struct net_device *netdev = ring->tqp->handle->kinfo.netdev; +struct hns3_nic_priv *priv =netdev_priv (netdev);struct netdev_queue *dev_queue;int bytes, pkts;int head;
@@ -1961,7 +1962,8 @@ bool hns3_clean_tx_ring(struct hns3_enet* sees the new next_to_clean. */ smp_mb (); -if (netif_tx_queue_stopped (dev_queue)) { +if (netif_tx_queue_stopped (dev_queue) && + !test_bit (HNS3_NIC_STATE_DOWN , &priv->state)) {netif_tx_wake_queue (dev_queue); ring->stats.restart_queue++; }
Greg Kroah-Hartman
maintainerPATCH 96/361 net: hns3: Fix ets validate issue
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit adefc0a2ff465f4ac4a88450fe69d336c8b074c5 ]
There is a defect in hclge_ets_validate(). If each member of tc_tsa is not IEEE_8021QAZ_TSA_ETS, the variable total_ets_bw won't be updated. In this case, the check for value of total_ets_bw will fail. This patch fixes it by checking total_ets_bw only after it has been updated.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +4 -2
@@ -73,6 +73,7 @@ static int hclge_ieee_getets(struct hnaestatic int hclge_ets_validate (struct hclge_dev *hdev,struct ieee_ets *ets,u8 *tc,bool *changed) { +bool has_ets_tc = false;u32 total_ets_bw =0 ;u8 max_tc =0 ;u8 i;
@@ -100,13 +101,14 @@ static int hclge_ets_validate(struct hcl *changed = true; total_ets_bw += ets->tc_tx_bw[i]; -break ; + has_ets_tc = true; +break ;default :return -EINVAL ; } } -if (total_ets_bw !=BW_PERCENT ) +if (has_ets_tc && total_ets_bw !=BW_PERCENT )return -EINVAL ; *tc = max_tc +1 ;
Greg Kroah-Hartman
maintainerPATCH 97/361 pinctrl: sunxi: fix pctrl->functions allocation in sunxi_pinctrl_build_state
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: YueHaibing <[email protected]>
[ Upstream commit a4925311a5443126ecc90671a1604ea7b0f5b32e ]
fixes following Smatch static check warning:
./drivers/pinctrl/sunxi/pinctrl-sunxi.c:1112 sunxi_pinctrl_build_state()
warn: passing devm_ allocated variable to kfree. 'pctrl->functions'
As we will be calling krealloc() on pointer 'pctrl->functions', which means kfree() will be called in there, devm_kzalloc() shouldn't be used with the allocation in the first place. Fix the warning by calling kcalloc() and managing the free procedure in error path on our own.
--- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +9 -6
@@ -1079,10 +1079,9 @@ static int sunxi_pinctrl_build_state(str* We suppose that we won't have any more functions than pins, * we'll reallocate that later anyway */ - pctl->functions =devm_kcalloc (&pdev->dev, - pctl->ngroups, -sizeof (*pctl->functions), -GFP_KERNEL ); + pctl->functions =kcalloc (pctl->ngroups, +sizeof (*pctl->functions), +GFP_KERNEL );if (!pctl->functions)return -ENOMEM ;
@@ -1133,8 +1132,10 @@ static int sunxi_pinctrl_build_state(str func_item =sunxi_pinctrl_find_function_by_name (pctl, func->name); -if (!func_item) +if (!func_item) { +kfree (pctl->functions);return -EINVAL ; + }if (!func_item->groups) { func_item->groups =
@@ -1142,8 +1143,10 @@ static int sunxi_pinctrl_build_state(str func_item->ngroups,sizeof (*func_item->groups), GFP_KERNEL); -if (!func_item->groups) +if (!func_item->groups) { +kfree (pctl->functions);return -ENOMEM ; + } } func_grp = func_item->groups;
Greg Kroah-Hartman
maintainerPATCH 98/361 pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: YueHaibing <[email protected]>
[ Upstream commit 69f8455f6cc78fa6cdf80d0105d7a748106271dc ]
'ret' should be returned while pmic_mpp_write_mode_ctl fails.
--- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +2 -0
@@ -319,6 +319,8 @@ static int pmic_mpp_set_mux(struct pinct pad->function = function; ret =pmic_mpp_write_mode_ctl (state, pad); +if (ret <0 ) +return ret; val = pad->is_enabled <<PMIC_MPP_REG_MASTER_EN_SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 99/361 brcmfmac: fix for proper support of 160MHz bandwidth
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arend van Spriel <[email protected]>
[ Upstream commit 330994e8e8ec5d0b269a5265e6032b37e29aa336 ]
Decoding of firmware channel information was not complete for 160MHz support. This resulted in the following warning:
WARNING: CPU: 2 PID: 2222 at .../broadcom/brcm80211/brcmutil/d11.c:196 brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil] Modules linked in: brcmfmac(O) brcmutil(O) sha256_generic cfg80211 ... CPU: 2 PID: 2222 Comm: kworker/2:0 Tainted: G O 4.17.0-wt-testing-x64-00002-gf1bed50 #1 Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011 Workqueue: events request_firmware_work_func RIP: 0010:brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil] RSP: 0018:ffffc90000047bd0 EFLAGS: 00010206 RAX: 000000000000e832 RBX: ffff8801146fe910 RCX: ffff8801146fd3c0 RDX: 0000000000002800 RSI: 0000000000000070 RDI: ffffc90000047c30 RBP: ffffc90000047bd0 R08: 0000000000000000 R09: ffffffffa0798c80 R10: ffff88012bca55e0 R11: ffff880110a4ea00 R12: ffff8801146f8000 R13: ffffc90000047c30 R14: ffff8801146fe930 R15: ffff8801138e02e0 FS: 0000000000000000(0000) GS:ffff88012bc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f18ce8b8070 CR3: 000000000200a003 CR4: 00000000000206e0 Call Trace: brcmf_setup_wiphybands+0x212/0x780 [brcmfmac] brcmf_cfg80211_attach+0xae2/0x11a0 [brcmfmac] brcmf_attach+0x1fc/0x4b0 [brcmfmac] ? __kmalloc+0x13c/0x1c0 brcmf_pcie_setup+0x99b/0xe00 [brcmfmac] brcmf_fw_request_done+0x16a/0x1f0 [brcmfmac] request_firmware_work_func+0x36/0x60 process_one_work+0x146/0x350 worker_thread+0x4a/0x3b0 kthread+0x102/0x140 ? process_one_work+0x350/0x350 ? kthread_bind+0x20/0x20 ret_from_fork+0x35/0x40 Code: 66 90 0f b7 07 55 48 89 e5 89 c2 88 47 02 88 47 03 66 81 e2 00 38 66 81 fa 00 18 74 6e 66 81 fa 00 20 74 39 66 81 fa 00 10 74 14 <0f> 0b 66 25 00 c0 74 20 66 3d 00 c0 75 20 c6 47 04 01 5d c3 66 ---[ end trace 550c46682415b26d ]--- brcmfmac: brcmf_construct_chaninfo: Ignoring unexpected firmware channel 50
This patch adds the missing stuff to properly handle this.
--- drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 34 ++++++++++- drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h | 2 2 files changed, 35 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +33 -1
@@ -77,6 +77,8 @@ static u16 d11ac_bw(enum brcmu_chan_bw breturn BRCMU_CHSPEC_D11AC_BW_40 ;case BRCMU_CHAN_BW_80 :return BRCMU_CHSPEC_D11AC_BW_80 ; +case BRCMU_CHAN_BW_160 : +return BRCMU_CHSPEC_D11AC_BW_160 ;default :WARN_ON (1 ); }
@@ -190,8 +192,38 @@ static void brcmu_d11ac_decchspec(structbreak ; }break ; -case BRCMU_CHSPEC_D11AC_BW_8080 :case BRCMU_CHSPEC_D11AC_BW_160 : +switch (ch->sb) { +case BRCMU_CHAN_SB_LLL : + ch->control_ch_num -=CH_70MHZ_APART ; +break ; +case BRCMU_CHAN_SB_LLU : + ch->control_ch_num -=CH_50MHZ_APART ; +break ; +case BRCMU_CHAN_SB_LUL : + ch->control_ch_num -=CH_30MHZ_APART ; +break ; +case BRCMU_CHAN_SB_LUU : + ch->control_ch_num -=CH_10MHZ_APART ; +break ; +case BRCMU_CHAN_SB_ULL : + ch->control_ch_num +=CH_10MHZ_APART ; +break ; +case BRCMU_CHAN_SB_ULU : + ch->control_ch_num +=CH_30MHZ_APART ; +break ; +case BRCMU_CHAN_SB_UUL : + ch->control_ch_num +=CH_50MHZ_APART ; +break ; +case BRCMU_CHAN_SB_UUU : + ch->control_ch_num +=CH_70MHZ_APART ; +break ; +default : +WARN_ON_ONCE (1 ); +break ; + } +break ; +case BRCMU_CHSPEC_D11AC_BW_8080 :default :WARN_ON_ONCE (1 );break ;
drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h +2 -0
@@ -29,6 +29,8 @@#define CH_UPPER_SB 0x01#define CH_LOWER_SB 0x02#define CH_EWA_VALID 0x04 +#define CH_70MHZ_APART 14 +#define CH_50MHZ_APART 10#define CH_30MHZ_APART 6#define CH_20MHZ_APART 4#define CH_10MHZ_APART 2
Greg Kroah-Hartman
maintainerPATCH 100/361 net: hns3: Check hdev state when getting link status
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Li <[email protected]>
[ Upstream commit 582d37bbb613b8ad86bf82845d3a74a02a5a0fa1 ]
By default, HW link status is up. If hclge_update_link_status is called before net up, driver will print "link up". It is not suitable. hdev state check is needed when getting link status.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +3 -0
@@ -2362,6 +2362,9 @@ static int hclge_get_mac_phy_link(structint mac_state;int link_stat; +if (test_bit (HCLGE_STATE_DOWN , &hdev->state)) +return 0 ; + mac_state =hclge_get_mac_link_status (hdev);if (hdev->hw.mac.phydev) {
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +3 -0
@@ -299,6 +299,9 @@ void hclgevf_update_link_status(struct h client = handle->client; + link_state = +test_bit (HCLGEVF_STATE_DOWN , &hdev->state) ?0 : link_state; +if (link_state != hdev->hw.mac.link) { client->ops->link_status_change (handle, !!link_state); hdev->hw.mac.link = link_state;
Greg Kroah-Hartman
maintainerPATCH 101/361 net: hns3: Set STATE_DOWN bit of hdev state when stopping net
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuyun Liang <[email protected]>
[ Upstream commit 2f7e489611bc685b8e00aba436032a8aac6cac57 ]
We clear STATE_DOWN bit of hdev state when starting net, but do not set it again when stopping net. It causes that the net is down, but hdev state is still up. STATE_DOWN bit of hdev state should be set when stopping net.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +2 -0
@@ -3814,6 +3814,8 @@ static void hclge_ae_stop(struct hnae3_hstruct hclge_dev *hdev = vport->back;int i; +set_bit (HCLGE_STATE_DOWN , &hdev->state); +del_timer_sync (&hdev->service_timer);cancel_work_sync (&hdev->service_task);clear_bit (HCLGE_STATE_SERVICE_SCHED , &hdev->state);
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 -0
@@ -1451,6 +1451,8 @@ static void hclgevf_ae_stop(struct hnae3struct hclgevf_dev *hdev =hclgevf_ae_get_hdev (handle);int i, queue_id; +set_bit (HCLGEVF_STATE_DOWN , &hdev->state); +for (i =0 ; i < hdev->num_tqps; i++) {/* Ring disable */ queue_id =hclgevf_get_queue_id (handle->kinfo.tqp[i]);
Greg Kroah-Hartman
maintainerPATCH 102/361 net: phy: phylink: ensure the carrier is off when starting phylink
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antoine Tenart <[email protected]>
[ Upstream commit aeeb2e8fdefdd5d257a1446351c70cb3df540199 ]
Phylink made an assumption about the carrier state being down when calling phylink_start(). If this assumption isn't satisfied, the internal phylink state could misbehave and a net device could end up not being functional.
This patch fixes this by explicitly calling netif_carrier_off() in phylink_start().
--- drivers/net/phy/phylink.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/phy/phylink.c +3 -0
@@ -907,6 +907,9 @@ void phylink_start(struct phylink *pl)phylink_an_mode_str (pl->link_an_mode), phy_modes(pl->link_config.interface)); +/* Always set the carrier off */ +netif_carrier_off (pl->netdev); +/* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links.
Greg Kroah-Hartman
maintainerPATCH 103/361 block, bfq: correctly charge and reset entity service in all cases
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Valente <[email protected]>
[ Upstream commit cbeb869a3d1110450186b738199963c5e68c2a71 ]
BFQ schedules entities (which represent either per-process queues or groups of queues) as a function of their timestamps. In particular, as a function of their (virtual) finish times. The finish time of an entity is computed as a function of the budget assigned to the entity, assuming, tentatively, that the entity, once in service, will receive an amount of service equal to its budget. Then, when the entity is expired because it finishes to be served, this finish time is updated as a function of the actual service received by the entity. This allows the entity to be correctly charged with only the service received, and then to be correctly re-scheduled.
Yet an entity may receive service also while not being the entity in service (in the scheduling environment of its parent entity), for several reasons. If the entity remains with no backlog while receiving this 'unofficial' service, then it is expired. Also on such an expiration, the finish time of the entity should be updated to account for only the service actually received by the entity. Unfortunately, such an update is not performed for an entity expiring without being the entity in service.
In a similar vein, the service counter of the entity in service is reset when the entity is expired, to be ready to be used for next service cycle. This reset too should be performed also in case an entity is expired because it remains empty after receiving service while not being the entity in service. But in this case the reset is not performed.
This commit performs the above update of the finish time and reset of the service received, also for an entity expiring while not being the entity in service.
--- block/bfq-wf2q.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
block/bfq-wf2q.c +10 -3
@@ -1181,10 +1181,17 @@ bool __bfq_deactivate_entity(struct bfq_ st =bfq_entity_service_tree (entity); is_in_service = entity == sd->in_service_entity; -if (is_in_service) { -bfq_calc_finish (entity, entity->service); +bfq_calc_finish (entity, entity->service); + +if (is_in_service) sd->in_service_entity =NULL ; - } +else +/* +* Non in-service entity: nobody will take care of +* resetting its service counter on expiration. Do it +* now. +*/ + entity->service =0 ;if (entity->tree == &st->active)bfq_active_extract (st, entity);
Greg Kroah-Hartman
maintainerPATCH 104/361 arm64: entry: Allow handling of undefined instructions from EL1
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
[ Upstream commit 0bf0f444b2c49241b2b39aa3cf210d7c95ef6c34 ]
Rather than panic() when taking an undefined instruction exception from EL1, allow a hook to be registered in case we want to emulate the instruction, like we will for the SSBS PSTATE manipulation instructions.
--- arch/arm64/kernel/entry.S | 2 +- arch/arm64/kernel/traps.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-)
arch/arm64/kernel/entry.S +1 -1
@@ -589,7 +589,7 @@ el1_undef: inherit_daif pstate=x23, tmp=x2 mov x0, sp bl do_undefinstr - ASM_BUG() + kernel_exit 1 el1_dbg: /* * Debug exception handling
arch/arm64/kernel/traps.c +7 -4
@@ -310,10 +310,12 @@ static int call_undef_hook(struct pt_regint (*fn)(struct pt_regs *regs,u32 instr) =NULL ;void __user *pc = (void __user *)instruction_pointer (regs); -if (!user_mode (regs)) -return 1 ; - -if (compat_thumb_mode (regs)) { +if (!user_mode (regs)) { +__le32 instr_le; +if (probe_kernel_address ((__force __le32 *)pc, instr_le)) + goto exit; + instr =le32_to_cpu (instr_le); + }else if (compat_thumb_mode (regs)) {/* 16-bit Thumb instruction */ __le16 instr_le;if (get_user (instr_le, (__le16 __user *)pc))
@@ -407,6 +409,7 @@ asmlinkage void __exception do_undefinstreturn ;force_signal_inject (SIGILL ,ILL_ILLOPC , regs->pc); +BUG_ON (!user_mode (regs)); }void cpu_enable_cache_maint_trap (const struct arm64_cpu_capabilities *__unused)
Greg Kroah-Hartman
maintainerPATCH 105/361 kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu <[email protected]>
[ Upstream commit 819319fc93461c07b9cdb3064f154bd8cfd48172 ]
Make reuse_unused_kprobe() to return error code if it fails to reuse unused kprobe for optprobe instead of calling BUG_ON().
--- kernel/kprobes.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
kernel/kprobes.c +20 -7
@@ -700,9 +700,10 @@ static void unoptimize_kprobe(struct kpr }/* Cancel unoptimizing for reusing */ -static void reuse_unused_kprobe (struct kprobe *ap) +static int reuse_unused_kprobe (struct kprobe *ap) {struct optimized_kprobe *op; +int ret;BUG_ON (!kprobe_unused (ap));/*
@@ -714,8 +715,12 @@ static void reuse_unused_kprobe(struct k/* Enable the probe again */ ap->flags &= ~KPROBE_FLAG_DISABLED ;/* Optimize it again (remove from op->list) */ -BUG_ON (!kprobe_optready (ap)); + ret =kprobe_optready (ap); +if (ret) +return ret; +optimize_kprobe (ap); +return 0 ; }/* Remove optimized instructions */
@@ -940,11 +945,16 @@ static void __disarm_kprobe(struct kprob#define kprobe_disarmed (p) kprobe_disabled(p)#define wait_for_kprobe_optimizer () do {} while (0) -/* There should be no unused kprobes can be reused without optimization */ -static void reuse_unused_kprobe (struct kprobe *ap) +static int reuse_unused_kprobe (struct kprobe *ap) { +/* +* If the optimized kprobe is NOT supported, the aggr kprobe is +* released at the same time that the last aggregated kprobe is +* unregistered. +* Thus there should be no chance to reuse unused kprobe. +*/ printk (KERN_ERR "Error: There should be no unused kprobe here.\n" ); -BUG_ON (kprobe_unused (ap)); +return -EINVAL ; }static void free_aggr_kprobe (struct kprobe *p)
@@ -1318,9 +1328,12 @@ static int register_aggr_kprobe(struct k goto out; }init_aggr_kprobe (ap, orig_p); - }else if (kprobe_unused (ap)) + }else if (kprobe_unused (ap)) {/* This probe is going to die. Rescue it */ -reuse_unused_kprobe (ap); + ret =reuse_unused_kprobe (ap); +if (ret) + goto out; + }if (kprobe_gone (ap)) {/*
Greg Kroah-Hartman
maintainerPATCH 106/361 spi: gpio: No MISO does not imply no RX
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit abf5feef3ff0cefade0c76be53b59e55fdd46093 ]
There is a logical problem in spi-gpio with host just assigning a MOSI line and no MISO: this is interpreted as the host cannot do RX and the host is flagged with SPI_MASTER_NO_RX.
This is wrong: since GPIO lines can switch direction, in 3WIRE operation the host will simply reverse the direction of the GPIO line and start reading from it, there is even code for doing this in the driver, but it went unnoticed because it was tested by using a master with 4 wires but a device using just 3 wires.
Remove the offending flag.
--- drivers/spi/spi-gpio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/spi/spi-gpio.c +6 -4
@@ -295,9 +295,11 @@ static int spi_gpio_request(struct devic spi_gpio->miso =devm_gpiod_get_optional (dev,"miso" ,GPIOD_IN );if (IS_ERR (spi_gpio->miso))return PTR_ERR (spi_gpio->miso); -if (!spi_gpio->miso) -/* HW configuration without MISO pin */ - *mflags |=SPI_MASTER_NO_RX ; +/* +* No setting SPI_MASTER_NO_RX here - if there is only a MOSI +* pin connected the host can still do RX by changing the +* direction of the line. +*/ spi_gpio->sck =devm_gpiod_get (dev,"sck" ,GPIOD_OUT_LOW );if (IS_ERR (spi_gpio->sck))
@@ -423,7 +425,7 @@ static int spi_gpio_probe(struct platfor spi_gpio->bitbang.chipselect = spi_gpio_chipselect; spi_gpio->bitbang.set_line_direction = spi_gpio_set_direction; -if ((master_flags & (SPI_MASTER_NO_TX |SPI_MASTER_NO_RX )) ==0 ) { +if ((master_flags &SPI_MASTER_NO_TX ) ==0 ) { spi_gpio->bitbang.txrx_word[SPI_MODE_0 ] = spi_gpio_txrx_word_mode0; spi_gpio->bitbang.txrx_word[SPI_MODE_1 ] = spi_gpio_txrx_word_mode1; spi_gpio->bitbang.txrx_word[SPI_MODE_2 ] = spi_gpio_txrx_word_mode2;
Greg Kroah-Hartman
maintainerPATCH 107/361 ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 240714061c58e6b1abfb3322398a7634151c06cb ]
Bay and Cherry Trail DSTDs represent a different set of devices depending on which OS the device think it is booting. One set of decices for Windows and another set of devices for Android which targets the Android-x86 Linux kernel fork (which e.g. used to have its own display driver instead of using the i915 driver).
Which set of devices we are actually going to get is out of our control, this is controlled by the ACPI OSID variable, which gets either set through an EFI setup option, or sometimes is autodetected. So we need to support both.
This commit adds support for the 80862286 and 808622C0 ACPI HIDs which we get for the first resp. second DMA controller on Cherry Trail devices when OSID is set to Android.
--- drivers/acpi/acpi_lpss.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/acpi_lpss.c +2 -0
@@ -327,9 +327,11 @@ static const struct acpi_device_id acpi_ { "INT33FC", }, /* Braswell LPSS devices */ + { "80862286", LPSS_ADDR(lpss_dma_desc) }, { "80862288", LPSS_ADDR(bsw_pwm_dev_desc) }, { "8086228A", LPSS_ADDR(bsw_uart_dev_desc) }, { "8086228E", LPSS_ADDR(bsw_spi_dev_desc) }, + { "808622C0", LPSS_ADDR(lpss_dma_desc) }, { "808622C1", LPSS_ADDR(bsw_i2c_dev_desc) }, /* Broadwell LPSS devices */
Greg Kroah-Hartman
maintainerPATCH 108/361 pinctrl: qcom: spmi-mpp: Fix drive strength setting
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
[ Upstream commit 89c68b102f13f123aaef22b292526d6b92501334 ]
It looks like we parse the drive strength setting here, but never actually write it into the hardware to update it. Parse the setting and then write it at the end of the pinconf setting function so that it actually sticks in the hardware.
--- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +5 -1
@@ -457,7 +457,7 @@ static int pmic_mpp_config_set(struct pi pad->dtest = arg;break ;case PIN_CONFIG_DRIVE_STRENGTH : - arg = pad->drive_strength; + pad->drive_strength = arg;break ;case PMIC_MPP_CONF_AMUX_ROUTE :if (arg >=PMIC_MPP_AMUX_ROUTE_ABUS4 )
@@ -504,6 +504,10 @@ static int pmic_mpp_config_set(struct piif (ret <0 )return ret; + ret =pmic_mpp_write (state, pad,PMIC_MPP_REG_SINK_CTL , pad->drive_strength); +if (ret <0 ) +return ret; + val = pad->is_enabled <<PMIC_MPP_REG_MASTER_EN_SHIFT ;return pmic_mpp_write (state, pad,PMIC_MPP_REG_EN_CTL , val);
Greg Kroah-Hartman
maintainerPATCH 109/361 bpf/verifier: fix verifier instability
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <[email protected]>
[ Upstream commit a9c676bc8fc58d00eea9836fb14ee43c0346416a ]
Edward Cree says:
In check_mem_access(), for the PTR_TO_CTX case, after check_ctx_access() has supplied a reg_type, the other members of the register state are set appropriately. Previously reg.range was set to 0, but as it is in a union with reg.map_ptr, which is larger, upper bytes of the latter were left in place. This then caused the memcmp() in regsafe() to fail, preventing some branches from being pruned (and occasionally causing the same program to take a varying number of processed insns on repeated verifier runs).
Fix the instability by clearing bpf_reg_state in __mark_reg_[un]known()
--- kernel/bpf/verifier.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
kernel/bpf/verifier.c +8 -8
@@ -553,7 +553,9 @@ static void __mark_reg_not_init(struct b*/ static void __mark_reg_known (struct bpf_reg_state *reg,u64 imm) { - reg->id =0 ; +/* Clear id, off, and union(map_ptr, range) */ +memset (((u8 *)reg) +sizeof (reg->type),0 , + offsetof(struct bpf_reg_state , var_off) -sizeof (reg->type)); reg->var_off =tnum_const (imm); reg->smin_value = (s64 )imm; reg->smax_value = (s64 )imm;
@@ -572,7 +574,6 @@ static void __mark_reg_known_zero(structstatic void __mark_reg_const_zero (struct bpf_reg_state *reg) {__mark_reg_known (reg,0 ); - reg->off =0 ; reg->type =SCALAR_VALUE ; }
@@ -683,9 +684,12 @@ static void __mark_reg_unbounded(struct/* Mark a register as having a completely unknown (scalar) value. */ static void __mark_reg_unknown (struct bpf_reg_state *reg) { +/* +* Clear type, id, off, and union(map_ptr, range) and +* padding between 'type' and union +*/ +memset (reg,0 , offsetof(struct bpf_reg_state , var_off)); reg->type =SCALAR_VALUE ; - reg->id =0 ; - reg->off =0 ; reg->var_off = tnum_unknown; reg->frameno =0 ;__mark_reg_unbounded (reg);
@@ -1727,9 +1731,6 @@ static int check_mem_access(struct bpf_velse mark_reg_known_zero (env, regs, value_regno); - regs[value_regno].id =0 ; - regs[value_regno].off =0 ; - regs[value_regno].range =0 ; regs[value_regno].type = reg_type; }
@@ -2580,7 +2581,6 @@ static int check_helper_call(struct bpf_ regs[BPF_REG_0 ].type =PTR_TO_MAP_VALUE_OR_NULL ;/* There is no offset yet applied, variable or fixed */ mark_reg_known_zero (env, regs,BPF_REG_0 ); - regs[BPF_REG_0 ].off =0 ;/* remember map_ptr, so that check_map_access() * can check 'value_size' boundary of memory access * to map element returned from bpf_map_lookup_elem()
Greg Kroah-Hartman
maintainerPATCH 110/361 failover: Add missing check to validate slave_dev in net_failover_slave_unregister
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: YueHaibing <[email protected]>
[ Upstream commit 9e7e6cabf371cc008cb2244a04c012b516753693 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/net_failover.c: In function 'net_failover_slave_unregister':drivers/net/net_failover.c:598:35: warning:
variable 'primary_dev' set but not used [-Wunused-but-set-variable]
There should check the validity of 'slave_dev'.
--- drivers/net/net_failover.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/net_failover.c +3 -0
@@ -603,6 +603,9 @@ static int net_failover_slave_unregister primary_dev =rtnl_dereference (nfo_info->primary_dev); standby_dev =rtnl_dereference (nfo_info->standby_dev); +if (WARN_ON_ONCE (slave_dev != primary_dev && slave_dev != standby_dev)) +return -ENODEV ; +vlan_vids_del_by_dev (slave_dev, failover_dev);dev_uc_unsync (slave_dev, failover_dev);dev_mc_unsync (slave_dev, failover_dev);
Greg Kroah-Hartman
maintainerPATCH 111/361 perf tests: Fix record+probe_libc_inet_pton.sh without pings debuginfo
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit 1632936480a53d85ef3012cd9f290e247251cbb9 ]
When we don't have the iputils-debuginfo package installed, i.e. when we don't have the DWARF information needed to resolve ping's samples, we end up failing this 'perf test' entry:
# perf test ping 62: probe libc's inet_pton & backtrace it with ping : Ok # rpm -e iputils-debuginfo # perf test ping 62: probe libc's inet_pton & backtrace it with ping : FAILED! #
Fix it to accept "[unknown]" where the symbol + offset, when resolved, is expected.
I think this will fail in the other arches as well, but since I can't test now, I'm leaving s390x and ppc cases as-is.
--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +1 -1
@@ -48,7 +48,7 @@ trace_libc_inet_pton_backtrace() { *) eventattr='max-stack=3' echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected - echo ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected + echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; esac
Greg Kroah-Hartman
maintainerPATCH 112/361 pinctrl: spmi-mpp: Fix pmic_mpp_config_get() to be compliant
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 0d5b476f8f57fcb06c45fe27681ac47254f63fd2 ]
If you look at "pinconf-groups" in debugfs for ssbi-mpp you'll notice it looks like nonsense.
The problem is fairly well described in commit 1cf86bc21257 ("pinctrl:
qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant") and commit 05e0c828955c ("pinctrl: msm: Fix msm_config_group_get() to be compliant"), but it was pointed out that ssbi-mpp has the same problem. Let's fix it there too.
NOTE: in case it's helpful to someone reading this, the way to tell whether to do the -EINVAL or not is to look at the PCONFDUMP for a given attribute. If the last element (has_arg) is false then you need to do the -EINVAL trick.
ALSO NOTE: it seems unlikely that the values returned when we try to get PIN_CONFIG_BIAS_PULL_UP will actually be printed since "has_arg" is false for that one, but I guess it's still fine to return different values so I kept doing that. It seems like another driver (ssbi-gpio) uses a custom attribute (PM8XXX_QCOM_PULL_UP_STRENGTH) for something similar so maybe a future change should do that here too.
--- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +12 -7
@@ -345,13 +345,12 @@ static int pmic_mpp_config_get(struct piswitch (param) {case PIN_CONFIG_BIAS_DISABLE : - arg = pad->pullup ==PMIC_MPP_PULL_UP_OPEN ; +if (pad->pullup !=PMIC_MPP_PULL_UP_OPEN ) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_BIAS_PULL_UP :switch (pad->pullup) { -case PMIC_MPP_PULL_UP_OPEN : - arg =0 ; -break ;case PMIC_MPP_PULL_UP_0P6KOHM : arg =600 ;break ;
@@ -366,13 +365,17 @@ static int pmic_mpp_config_get(struct pi }break ;case PIN_CONFIG_BIAS_HIGH_IMPEDANCE : - arg = !pad->is_enabled; +if (pad->is_enabled) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_POWER_SOURCE : arg = pad->power_source;break ;case PIN_CONFIG_INPUT_ENABLE : - arg = pad->input_enabled; +if (!pad->input_enabled) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_OUTPUT : arg = pad->out_value;
@@ -384,7 +387,9 @@ static int pmic_mpp_config_get(struct pi arg = pad->amux_input;break ;case PMIC_MPP_CONF_PAIRED : - arg = pad->paired; +if (!pad->paired) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_DRIVE_STRENGTH : arg = pad->drive_strength;
Greg Kroah-Hartman
maintainerPATCH 113/361 pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit b432414b996d32a1bd9afe2bd595bd5729c1477f ]
If you look at "pinconf-groups" in debugfs for ssbi-gpio you'll notice it looks like nonsense.
The problem is fairly well described in commit 1cf86bc21257 ("pinctrl:
qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant") and commit 05e0c828955c ("pinctrl: msm: Fix msm_config_group_get() to be compliant"), but it was pointed out that ssbi-gpio has the same problem. Let's fix it there too.
--- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +21 -7
@@ -260,22 +260,32 @@ static int pm8xxx_pin_config_get(structswitch (param) {case PIN_CONFIG_BIAS_DISABLE : - arg = pin->bias ==PM8XXX_GPIO_BIAS_NP ; +if (pin->bias !=PM8XXX_GPIO_BIAS_NP ) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_BIAS_PULL_DOWN : - arg = pin->bias ==PM8XXX_GPIO_BIAS_PD ; +if (pin->bias !=PM8XXX_GPIO_BIAS_PD ) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_BIAS_PULL_UP : - arg = pin->bias <=PM8XXX_GPIO_BIAS_PU_1P5_30 ; +if (pin->bias >PM8XXX_GPIO_BIAS_PU_1P5_30 ) +return -EINVAL ; + arg =1 ;break ;case PM8XXX_QCOM_PULL_UP_STRENGTH : arg = pin->pull_up_strength;break ;case PIN_CONFIG_BIAS_HIGH_IMPEDANCE : - arg = pin->disable; +if (!pin->disable) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_INPUT_ENABLE : - arg = pin->mode ==PM8XXX_GPIO_MODE_INPUT ; +if (pin->mode !=PM8XXX_GPIO_MODE_INPUT ) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_OUTPUT :if (pin->mode &PM8XXX_GPIO_MODE_OUTPUT )
@@ -290,10 +300,14 @@ static int pm8xxx_pin_config_get(struct arg = pin->output_strength;break ;case PIN_CONFIG_DRIVE_PUSH_PULL : - arg = !pin->open_drain; +if (pin->open_drain) +return -EINVAL ; + arg =1 ;break ;case PIN_CONFIG_DRIVE_OPEN_DRAIN : - arg = pin->open_drain; +if (!pin->open_drain) +return -EINVAL ; + arg =1 ;break ;default :return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 114/361 net: hns3: Preserve vlan 0 in hardware table
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunsheng Lin <[email protected]>
[ Upstream commit daaa8521760ee4d4e65f309c4c37b3a1e58c9d4e ]
When netdev is down, the stack will delete the vlan from hardware including vlan0, which will cause problem when doing loopback selftest when netdev is down.
This patch fixes it by always preserving vlan 0 in hardware, because vlan 0 is defalut vlan, which should always be in hardware.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +3 -0
@@ -4739,6 +4739,9 @@ static int hclge_set_vlan_filter_hw(struu16 vport_idx, vport_num =0 ;int ret; +if (is_kill && !vlan_id) +return 0 ; + ret =hclge_set_vf_vlan_common (hdev, vport_id, is_kill, vlan_id,0 , proto);if (ret) {
Greg Kroah-Hartman
maintainerPATCH 115/361 net: hns3: Fix ping exited problem when doing lp selftest
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunsheng Lin <[email protected]>
[ Upstream commit 3f8601f0f5716c4e63a9f215bbc581df42859d61 ]
When ping is runnig and user executes the loopback selftest, the ping cmd will stop and exit.
This patch fixes it by using the hns3_nic_net_open/stop to offline the netdev when doing loopback selftest.
--- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +2 -2
@@ -309,7 +309,7 @@ static void hns3_self_test(struct net_de h->flags &HNAE3_SUPPORT_SERDES_LOOPBACK ;if (if_running) -dev_close (ndev); + ndev->netdev_ops->ndo_stop (ndev);#if IS_ENABLED (CONFIG_VLAN_8021Q )/* Disable the vlan filter for selftest does not support it */
@@ -347,7 +347,7 @@ static void hns3_self_test(struct net_de#endif if (if_running) -dev_open (ndev); + ndev->netdev_ops->ndo_open (ndev); }static int hns3_get_sset_count (struct net_device *netdev,int stringset)
Greg Kroah-Hartman
maintainerPATCH 116/361 net: hns3: Fix for vf vlan delete failed problem
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunsheng Lin <[email protected]>
[ Upstream commit 41dafea2af781d8e3ab8626d236b52e4172905a3 ]
There are only 128 entries in vf vlan table, if user has added more than 128 vlan, fw will ignore it and disable the vf vlan table. So when user deletes the vlan entry that has not been set to vf vlan table, fw will return not found result and driver treat that as error, which will cause vlan delete failed problem.
This patch fixes it by returning ok when fw returns not found result.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +8 -0
@@ -4693,9 +4693,17 @@ static int hclge_set_vf_vlan_common(stru"Add vf vlan filter fail, ret =%d.\n" , req0->resp_code); }else { +#define HCLGE_VF_VLAN_DEL_NO_FOUND 1if (!req0->resp_code)return 0 ; +if (req0->resp_code ==HCLGE_VF_VLAN_DEL_NO_FOUND ) { +dev_warn (&hdev->pdev->dev, +"vlan %d filter is not in vf vlan table\n" , + vlan); +return 0 ; + } +dev_err (&hdev->pdev->dev,"Kill vf vlan filter fail, ret =%d.\n" , req0->resp_code);
Greg Kroah-Hartman
maintainerPATCH 117/361 net: dsa: mv88e6xxx: Fix writing to a PHY page.
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Lunn <[email protected]>
[ Upstream commit c309b158090d788e96ee597444965cb79b040484 ]
After changing to the needed page, actually write the value to the register!
--- drivers/net/dsa/mv88e6xxx/phy.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/dsa/mv88e6xxx/phy.c +3 -0
@@ -110,6 +110,9 @@ int mv88e6xxx_phy_page_write(struct mv88 err =mv88e6xxx_phy_page_get (chip, phy, page);if (!err) { err =mv88e6xxx_phy_write (chip, phy,MV88E6XXX_PHY_PAGE , page); +if (!err) + err =mv88e6xxx_phy_write (chip, phy, reg, val); +mv88e6xxx_phy_page_put (chip, phy); }
Greg Kroah-Hartman
maintainerPATCH 118/361 mt76x2u: run device cleanup routine if resume fails
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <[email protected]>
[ Upstream commit 9b2fd48d36e25b9be9ddb8be8cc1eb263a1d1843 ]
Cleanup {tx,rx} and mcu queues if resume operation fails
--- drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x2_usb.c +11 -3
@@ -107,16 +107,24 @@ static int __maybe_unused mt76x2u_resume mt76u_mcu_complete_urb, &usb->mcu.cmpl);if (err <0 ) -return err; + goto err; err =mt76u_submit_rx_buffers (&dev->mt76);if (err <0 ) -return err; + goto err;tasklet_enable (&usb->rx_tasklet);tasklet_enable (&usb->tx_tasklet); -return mt76x2u_init_hardware (dev); + err =mt76x2u_init_hardware (dev); +if (err <0 ) + goto err; + +return 0 ; + +err: +mt76x2u_cleanup (dev); +return err; }MODULE_DEVICE_TABLE (usb, mt76x2u_device_table);
Greg Kroah-Hartman
maintainerPATCH 119/361 rsi: fix memory alignment issue in ARM32 platforms
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Siva Rebbagondla <[email protected]>
[ Upstream commit baa8caf4ab7af2d9e84b566b99fe919a4e9e7562 ]
During testing in ARM32 platforms, observed below kernel panic, as driver accessing data beyond the allocated memory while submitting URB to USB.
Fix: Resolved this by specifying correct length by considering 64 bit alignment. so that, USB bus driver will access only allocated memory.
Unit-test: Tested and confirm that driver bring up and scanning, connection and data transfer works fine with this fix.
...skipping...
[ 25.389450] Unable to handle kernel paging request at virtual address 5aa11422 [ 25.403078] Internal error: Oops: 5 [#1] SMP ARM [ 25.407703] Modules linked in: rsi_usb [ 25.411473] CPU: 1 PID: 317 Comm: RX-Thread Not tainted 4.18.0-rc7 #1 [ 25.419221] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 25.425764] PC is at skb_release_data+0x90/0x168 [ 25.430393] LR is at skb_release_all+0x28/0x2c [ 25.434842] pc : [<807435b0>] lr : [<80742ba0>] psr: 200e0013 5aa1141e [ 25.464633] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 25.477524] Process RX-Thread (pid: 317, stack limit = 0x(ptrval)) [ 25.483709] Stack: (0xedf69ed8 to 0xedf6a000) [ 25.569907] Backtrace: [ 25.572368] [<80743520>] (skb_release_data) from [<80742ba0>] (skb_release_all+0x28/0x2c) [ 25.580555] r9:7f00258c r8:00000001 r7:ee355000 r6:eddab0d0 r5:eddab000 r4:eddbb840 [ 25.588308] [<80742b78>] (skb_release_all) from [<807432cc>] (consume_skb+0x30/0x50) [ 25.596055] r5:eddab000 r4:eddbb840 [ 25.599648] [<8074329c>] (consume_skb) from [<7f00117c>] (rsi_usb_rx_thread+0x64/0x12c [rsi_usb]) [ 25.608524] r5:eddab000 r4:eddbb840 [ 25.612116] [<7f001118>] (rsi_usb_rx_thread [rsi_usb]) from [<80142750>] (kthread+0x11c/0x15c) [ 25.620735] r10:ee9ff9e0 r9:edcde3b8 r8:ee355000 r7:edf68000 r6:edd3a780 r5:00000000 [ 25.628567] r4:edcde380 [ 25.631110] [<80142634>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c) [ 25.638336] Exception stack(0xedf69fb0 to 0xedf69ff8) [ 25.682929] ---[ end trace 8236a5496f5b5d3b ]---
--- drivers/net/wireless/rsi/rsi_91x_usb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +7 -4
@@ -266,15 +266,17 @@ static void rsi_rx_done_handler(struct uif (urb->status) goto out; -if (urb->actual_length <=0 ) { -rsi_dbg (INFO_ZONE ,"%s: Zero length packet\n" , __func__); +if (urb->actual_length <=0 || + urb->actual_length > rx_cb->rx_skb->len) { +rsi_dbg (INFO_ZONE ,"%s: Invalid packet length = %d\n" , + __func__, urb->actual_length); goto out; }if (skb_queue_len (&dev->rx_q) >=RSI_MAX_RX_PKTS ) {rsi_dbg (INFO_ZONE ,"Max RX packets reached\n" ); goto out; } -skb_put (rx_cb->rx_skb, urb->actual_length); +skb_trim (rx_cb->rx_skb, urb->actual_length);skb_queue_tail (&dev->rx_q, rx_cb->rx_skb);rsi_set_event (&dev->rx_thread.event);
@@ -308,6 +310,7 @@ static int rsi_rx_urb_submit(struct rsi_if (!skb)return -ENOMEM ;skb_reserve (skb,MAX_DWORD_ALIGN_BYTES ); +skb_put (skb,RSI_MAX_RX_USB_PKT_SIZE -MAX_DWORD_ALIGN_BYTES ); dword_align_bytes = (unsigned long )skb->data &0x3f ;if (dword_align_bytes >0 )skb_push (skb, dword_align_bytes);
@@ -319,7 +322,7 @@ static int rsi_rx_urb_submit(struct rsi_usb_rcvbulkpipe (dev->usbdev, dev->bulkin_endpoint_addr[ep_num -1 ]), urb->transfer_buffer, -RSI_MAX_RX_USB_PKT_SIZE , + skb->len, rsi_rx_done_handler, rx_cb);
Greg Kroah-Hartman
maintainerPATCH 120/361 libertas_tf: prevent underflow in process_cmdrequest()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 3348ef6a6a126706d6a73ed40c18d8033df72783 ]
If recvlength is less than MESSAGE_HEADER_LEN (4) we would end up corrupting memory.
--- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/libertas_tf/if_usb.c +3 -2
@@ -605,9 +605,10 @@ static inline void process_cmdrequest(in {unsigned long flags; -if (recvlength >LBS_CMD_BUFFER_SIZE ) { +if (recvlength <MESSAGE_HEADER_LEN || + recvlength >LBS_CMD_BUFFER_SIZE ) {lbtf_deb_usbd (&cardp->udev->dev, -"The receive buffer is too large\n" ); +"The receive buffer is invalid: %d\n" , recvlength);kfree_skb (skb);return ; }
Greg Kroah-Hartman
maintainerPATCH 121/361 iwlwifi: mvm: fix BAR seq ctrl reporting
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
[ Upstream commit 941ab4eb66c10bc5c7234e83a7a858b2806ed151 ]
There is a bug in FW where the sequence control may be incorrect, and the driver overrides it with the value of the ieee80211 header.
However, in BAR there is no sequence control in the header, which result with arbitrary sequence.
This access to an unknown location is bad and it makes the logs very confusing - so fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +5 -4
@@ -1405,6 +1405,7 @@ static void iwl_mvm_rx_tx_cmd_single(strwhile (!skb_queue_empty (&skbs)) {struct sk_buff *skb =__skb_dequeue (&skbs);struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb); +struct ieee80211_hdr *hdr = (void *)skb->data;bool flushed = false; skb_freed++;
@@ -1449,11 +1450,11 @@ static void iwl_mvm_rx_tx_cmd_single(str info->flags |=IEEE80211_TX_STAT_AMPDU_NO_BACK ; info->flags &= ~IEEE80211_TX_CTL_AMPDU ; -/* W/A FW bug: seq_ctl is wrong when the status isn't success */ -if (status !=TX_STATUS_SUCCESS ) { -struct ieee80211_hdr *hdr = (void *)skb->data; +/* W/A FW bug: seq_ctl is wrong upon failure / BAR frame */ +if (ieee80211_is_back_req (hdr->frame_control)) + seq_ctl =0 ; +else if (status !=TX_STATUS_SUCCESS ) seq_ctl =le16_to_cpu (hdr->seq_ctrl); - }if (unlikely (!seq_ctl)) {struct ieee80211_hdr *hdr = (void *)skb->data;
Greg Kroah-Hartman
maintainerPATCH 122/361 gpio: brcmstb: allow 0 width GPIO banks
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Chen <[email protected]>
[ Upstream commit bfba223dcc4548632d8f3bfd15690a86d4c68504 ]
Sometimes we have empty banks within the GPIO block. This commit allows proper handling of 0 width GPIO banks. We handle 0 width GPIO banks by incrementing the bank and number of GPIOs, but not initializing them. This will mean a call into the non-existent GPIOs will return an error.
Also remove "GPIO registered" dev print. This information is misleading since the incremented banks and gpio_base do not reflect the actual GPIOs that get initialized. We leave this information out since it is already printed with dev_dbg.
--- drivers/gpio/gpio-brcmstb.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpio/gpio-brcmstb.c +12 -3
@@ -664,6 +664,18 @@ static int brcmstb_gpio_probe(struct plastruct brcmstb_gpio_bank *bank;struct gpio_chip *gc; +/* +* If bank_width is 0, then there is an empty bank in the +* register block. Special handling for this case. +*/ +if (bank_width ==0 ) { +dev_dbg (dev,"Width 0 found: Empty bank @ %d\n" , + num_banks); + num_banks++; + gpio_base +=MAX_GPIO_PER_BANK ; +continue ; + } + bank =devm_kzalloc (dev,sizeof (*bank),GFP_KERNEL );if (!bank) { err = -ENOMEM ;
@@ -740,9 +752,6 @@ static int brcmstb_gpio_probe(struct pla goto fail; } -dev_info (dev,"Registered %d banks (GPIO(s): %d-%d)\n" , - num_banks, priv->gpio_base, gpio_base -1 ); -if (priv->parent_wake_irq && need_wakeup_event)pm_wakeup_event (dev,0 );
Greg Kroah-Hartman
maintainerPATCH 123/361 ixgbe: disallow IPsec Tx offload when in SR-IOV mode
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shannon Nelson <[email protected]>
[ Upstream commit 47b6f50077e68bcd544f657526dad4bfdce7e87d ]
There seems to be a problem in the x540's internal switch wherein if SR-IOV mode is enabled and an offloaded IPsec packet is sent to a local VF, the packet is silently dropped. This might never be a problem as it is somewhat a corner case, but if someone happens to be using IPsec offload from the PF to a VF that just happens to get migrated to the local box, communication will mysteriously fail.
Not good.
A simple way to protect from this is to simply not allow any IPsec offloads for outgoing packets when num_vfs != 0. This doesn't help any offloads that were created before SR-IOV was enabled, but we'll get to that later.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +3 -0
@@ -676,6 +676,9 @@ static int ixgbe_ipsec_add_sa(struct xfr }else {struct tx_sa tsa; +if (adapter->num_vfs) +return -EOPNOTSUPP ; +/* find the first unused index */ ret =ixgbe_ipsec_find_empty_idx (ipsec, false);if (ret <0 ) {
Greg Kroah-Hartman
maintainerPATCH 124/361 ixgbevf: VF2VF TCP RSS
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Basierski <[email protected]>
[ Upstream commit 7fb94bd58dd6650a0158e68d414e185077d8b57a ]
While VF2VF with RSS communication, RSS Type were wrongly recognized and RSS hash was not calculated as it should be. Packets was distributed on various queues by accident.
This commit fixes that behaviour and causes proper RSS Type recognition.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +4 -0
@@ -3849,6 +3849,10 @@ static void ixgbevf_tx_csum(struct ixgbeskb_checksum_help (skb); goto no_csum; } + +if (first->protocol ==htons (ETH_P_IP )) + type_tucmd |=IXGBE_ADVTXD_TUCMD_IPV4 ; +/* update TX checksum flag */ first->tx_flags |=IXGBE_TX_FLAGS_CSUM ; vlan_macip_lens = skb_checksum_start_offset(skb) -
Greg Kroah-Hartman
maintainerPATCH 125/361 wil6210: fix RX buffers release and unmap
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maya Erez <[email protected]>
[ Upstream commit 84f16fbb62384fb209cd35741d94eb00b5ca2746 ]
RX SKBs are released in both wil6210 rmmod and RX handle. As there is no lock to protect the buffers DMA unmap,
the SKB pointer in buff_arr is used to check if the buffer memory was already released.
Setting wil->rx_buff_mgmt.buff_arr[buff_id].skb to NULL before the DMA memory unmap will prevent duplicate unmapping of the same memory. Move the buffer ID to the free list also in case the SKB is NULL.
--- drivers/net/wireless/ath/wil6210/txrx_edma.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/wil6210/txrx_edma.c +10 -5
@@ -279,9 +279,6 @@ static void wil_move_all_rx_buff_to_freeu16 buff_id; *d = *_d; - pa =wil_rx_desc_get_addr_edma (&d->dma); - dmalen =le16_to_cpu (d->dma.length); -dma_unmap_single (dev, pa, dmalen,DMA_FROM_DEVICE );/* Extract the SKB from the rx_buff management array */ buff_id =__le16_to_cpu (d->mac.buff_id);
@@ -291,10 +288,15 @@ static void wil_move_all_rx_buff_to_free } skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb; wil->rx_buff_mgmt.buff_arr[buff_id].skb =NULL ; -if (unlikely (!skb)) +if (unlikely (!skb)) {wil_err (wil,"No Rx skb at buff_id %d\n" , buff_id); -else + }else { + pa =wil_rx_desc_get_addr_edma (&d->dma); + dmalen =le16_to_cpu (d->dma.length); +dma_unmap_single (dev, pa, dmalen,DMA_FROM_DEVICE ); +kfree_skb (skb); + }/* Move the buffer from the active to the free list */ list_move(&wil->rx_buff_mgmt.buff_arr[buff_id].list,
@@ -906,6 +908,9 @@ again: wil->rx_buff_mgmt.buff_arr[buff_id].skb =NULL ;if (!skb) {wil_err (wil,"No Rx skb at buff_id %d\n" , buff_id); +/* Move the buffer from the active list to the free list */ +list_move (&wil->rx_buff_mgmt.buff_arr[buff_id].list, + &wil->rx_buff_mgmt.free); goto again; }
Greg Kroah-Hartman
maintainerPATCH 126/361 ath10k: schedule hardware restart if WMI command times out
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Willi <[email protected]>
[ Upstream commit a9911937e7d332761e8c4fcbc7ba0426bdc3956f ]
When running in AP mode, ath10k sometimes suffers from TX credit starvation. The issue is hard to reproduce and shows up once in a few days, but has been repeatedly seen with QCA9882 and a large range of firmwares, including 10.2.4.70.67.
Once the module is in this state, TX credits are never replenished, which results in "SWBA overrun" errors, as no beacons can be sent. Even worse, WMI commands run in a timeout while holding the conf mutex for three seconds each, making any further operations slow and the whole system unresponsive.
The firmware/driver never recovers from that state automatically, and triggering TX flush or warm restarts won't work over WMI. So issue a hardware restart if a WMI command times out due to missing TX credits. This implies a connectivity outage of about 1.4s in AP mode, but brings back the interface and the whole system to a usable state. WMI command timeouts have not been seen in absent of this specific issue, so taking such drastic actions seems legitimate.
--- drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath10k/wmi.c +6 -0
@@ -1869,6 +1869,12 @@ int ath10k_wmi_cmd_send(struct ath10k *aif (ret)dev_kfree_skb_any (skb); +if (ret == -EAGAIN ) { +ath10k_warn (ar,"wmi command %d timeout, restarting hardware\n" , + cmd_id); +queue_work (ar->workqueue, &ar->restart_work); + } +return ret; }
Greg Kroah-Hartman
maintainerPATCH 127/361 libata: Apply NOLPM quirk for SAMSUNG MZ7TD256HAFV-000L9
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Diego Viola <[email protected]>
[ Upstream commit a435ab4f80f983c53b4ca4f8c12b3ddd3ca17670 ]
med_power_with_dipm causes my T450 to freeze with a SAMSUNG MZ7TD256HAFV-000L9 SSD (firmware DXT02L5Q).
Switching the LPM to max_performance fixes this issue.
--- drivers/ata/libata-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-core.c +1 -0
@@ -4553,6 +4553,7 @@ static const struct ata_blacklist_entry/* These specific Samsung models/firmware-revs do not handle LPM well */ { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, }, { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_HORKAGE_NOLPM, }, + { "SAMSUNG MZ7TD256HAFV-000L9", "DXT02L5Q", ATA_HORKAGE_NOLPM, }, /* devices that don't properly handle queued TRIM commands */ { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
Greg Kroah-Hartman
maintainerPATCH 128/361 thermal: rcar_thermal: Prevent doing work after unbind
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 697ee786f15d7b65c7f3045d45fe3a05d28e0911 ]
When testing bind/unbind on r8a7791/koelsch:
WARNING: CPU: 1 PID: 697 at lib/debugobjects.c:329 debug_print_object+0x8c/0xb4
ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x10This happens if the workqueue runs after the device has been unbound. Fix this by cancelling any queued work during remove.
--- drivers/thermal/rcar_thermal.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/rcar_thermal.c +1 -0
@@ -453,6 +453,7 @@ static int rcar_thermal_remove(struct plrcar_thermal_for_each_priv (priv, common) {rcar_thermal_irq_disable (priv); +cancel_delayed_work_sync (&priv->work);if (priv->chip->use_of_thermal)thermal_remove_hwmon_sysfs (priv->zone);else
Greg Kroah-Hartman
maintainerPATCH 129/361 thermal: da9062/61: Prevent hardware access during system suspend
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 760eea43f8c6d48684f1f34b8a02fddc1456e849 ]
The workqueue used for monitoring the hardware may run while the device is already suspended. Fix this by using the freezable system workqueue instead, cfr. commit 51e20d0e3a60cf46 ("thermal: Prevent polling from happening during system suspend").
--- drivers/thermal/da9062-thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/da9062-thermal.c +2 -2
@@ -106,7 +106,7 @@ static void da9062_thermal_poll_on(struc THERMAL_EVENT_UNSPECIFIED); delay =msecs_to_jiffies (thermal->zone->passive_delay); -schedule_delayed_work (&thermal->work, delay); +queue_delayed_work (system_freezable_wq, &thermal->work, delay);return ; }
@@ -125,7 +125,7 @@ static irqreturn_t da9062_thermal_irq_hastruct da9062_thermal *thermal = data;disable_irq_nosync (thermal->irq); -schedule_delayed_work (&thermal->work,0 ); +queue_delayed_work (system_freezable_wq, &thermal->work,0 );return IRQ_HANDLED ; }
Greg Kroah-Hartman
maintainerPATCH 130/361 cifs: fix a credits leak for compund commands
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ronnie Sahlberg <[email protected]>
[ Upstream commit cb5c2e63948451d38c977685fffc06e23beb4517 ]
When processing the mids for compounds we would only add credits based on the last successful mid in the compound which would leak credits and eventually triggering a re-connect.
Fix this by splitting the mid processing part into two loops instead of one where the first loop just waits for all mids and then counts how many credits we were granted for the whole compound.
--- fs/cifs/transport.c | 57 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 20 deletions(-)
fs/cifs/transport.c +37 -20
@@ -786,7 +786,7 @@ compound_send_recv(const unsigned int xiint i, j, rc =0 ;int timeout, optype;struct mid_q_entry *midQ[MAX_COMPOUND ]; -unsigned int credits =1 ; +unsigned int credits =0 ;char *buf; timeout = flags &CIFS_TIMEOUT_MASK ;
@@ -851,17 +851,20 @@ compound_send_recv(const unsigned int ximutex_unlock (&ses->server->srv_mutex); -for (i =0 ; i < num_rqst; i++) { -if (rc <0 ) - goto out; +if (rc <0 ) + goto out; -if ((ses->status == CifsNew) || (optype &CIFS_NEG_OP )) -smb311_update_preauth_hash (ses, rqst[i].rq_iov, - rqst[i].rq_nvec); +/* +* Compounding is never used during session establish. +*/ +if ((ses->status == CifsNew) || (optype &CIFS_NEG_OP )) +smb311_update_preauth_hash (ses, rqst[0 ].rq_iov, + rqst[0 ].rq_nvec); -if (timeout ==CIFS_ASYNC_OP ) - goto out; +if (timeout ==CIFS_ASYNC_OP ) + goto out; +for (i =0 ; i < num_rqst; i++) { rc =wait_for_response (ses->server, midQ[i]);if (rc !=0 ) { cifs_dbg(FYI, "Cancelling wait for mid %llu\n",
@@ -877,10 +880,21 @@ compound_send_recv(const unsigned int xi }spin_unlock (&GlobalMid_Lock); } + } + +for (i =0 ; i < num_rqst; i++) +if (midQ[i]->resp_buf) + credits += ses->server->ops->get_credits (midQ[i]); +if (!credits) + credits =1 ; + +for (i =0 ; i < num_rqst; i++) { +if (rc <0 ) + goto out; rc =cifs_sync_mid_result (midQ[i], ses->server);if (rc !=0 ) { -add_credits (ses->server,1 , optype); +add_credits (ses->server, credits, optype);return rc; }
@@ -901,23 +915,26 @@ compound_send_recv(const unsigned int xielse resp_buf_type[i] =CIFS_SMALL_BUFFER ; -if ((ses->status == CifsNew) || (optype &CIFS_NEG_OP )) { -struct kvec iov = { - .iov_base = resp_iov[i].iov_base, - .iov_len = resp_iov[i].iov_len - }; -smb311_update_preauth_hash (ses, &iov,1 ); - } - - credits = ses->server->ops->get_credits (midQ[i]); - rc = ses->server->ops->check_receive (midQ[i], ses->server, flags &CIFS_LOG_ERROR );/* mark it so buf will not be freed by cifs_delete_mid */ if ((flags &CIFS_NO_RESP ) ==0 ) midQ[i]->resp_buf =NULL ; + + } + +/* +* Compounding is never used during session establish. +*/ +if ((ses->status == CifsNew) || (optype &CIFS_NEG_OP )) { +struct kvec iov = { + .iov_base = resp_iov[0 ].iov_base, + .iov_len = resp_iov[0 ].iov_len + }; +smb311_update_preauth_hash (ses, &iov,1 ); } + out:/* * This will dequeue all mids. After this it is important that the
Greg Kroah-Hartman
maintainerPATCH 131/361 cgroup, netclassid: add a preemption point to write_classid
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Hocko <[email protected]>
[ Upstream commit a90e90b7d55e789c71d85b946ffb5c1ab2f137ca ]
We have seen a customer complaining about soft lockups on !PREEMPT kernel config with 4.4 based kernel
[1072141.435366] NMI watchdog: BUG: soft lockup - CPU#21 stuck for 22s! [systemd:1] [1072141.444090] Modules linked in: mpt3sas raid_class binfmt_misc af_packet 8021q garp mrp stp llc xfs libcrc32c bonding iscsi_ibft iscsi_boot_sysfs msr ext4 crc16 jbd2 mbcache cdc_ether usbnet mii joydev hid_generic usbhid intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel ipmi_ssif mgag200 i2c_algo_bit ttm ipmi_devintf drbg ixgbe drm_kms_helper vxlan ansi_cprng ip6_udp_tunnel drm aesni_intel udp_tunnel aes_x86_64 iTCO_wdt syscopyarea ptp xhci_pci lrw iTCO_vendor_support pps_core gf128mul ehci_pci glue_helper sysfillrect mdio pcspkr sb_edac ablk_helper cryptd ehci_hcd sysimgblt xhci_hcd fb_sys_fops edac_core mei_me lpc_ich ses usbcore enclosure dca mfd_core ipmi_si mei i2c_i801 scsi_transport_sas usb_common ipmi_msghandler shpchp fjes wmi processor button acpi_pad btrfs xor raid6_pq sd_mod crc32c_intel megaraid_sas sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua scsi_mod md_mod autofs4 [1072141.444146] Supported: Yes [1072141.444149] CPU: 21 PID: 1 Comm: systemd Not tainted 4.4.121-92.80-default #1 [1072141.444150] Hardware name: LENOVO Lenovo System x3650 M5 -[5462P4U]- -[5462P4U]-/01GR451, BIOS -[TCE136H-2.70]- 06/13/2018 [1072141.444151] task: ffff880191bd0040 ti: ffff880191bd4000 task.ti: ffff880191bd4000 [1072141.444153] RIP: 0010:[<ffffffff815229f9>] [<ffffffff815229f9>] update_classid_sock+0x29/0x40 [1072141.444157] RSP: 0018:ffff880191bd7d58 EFLAGS: 00000286 [1072141.444158] RAX: ffff883b177cb7c0 RBX: 0000000000000000 RCX: 0000000000000000 [1072141.444159] RDX: 00000000000009c7 RSI: ffff880191bd7d5c RDI: ffff8822e29bb200 [1072141.444160] RBP: ffff883a72230980 R08: 0000000000000101 R09: 0000000000000000 [1072141.444161] R10: 0000000000000008 R11: f000000000000000 R12: ffffffff815229d0 [1072141.444162] R13: 0000000000000000 R14: ffff881fd0a47ac0 R15: ffff880191bd7f28 [1072141.444163] FS: 00007f3e2f1eb8c0(0000) GS:ffff882000340000(0000) knlGS:0000000000000000 [1072141.444164] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [1072141.444165] CR2: 00007f3e2f200000 CR3: 0000001ffea4e000 CR4: 00000000001606f0 [1072141.444166] Stack: [1072141.444166] ffffffa800000246 00000000000009c7 ffffffff8121d583 ffff8818312a05c0 [1072141.444168] ffff8818312a1100 ffff880197c3b280 ffff881861422858 ffffffffffffffea [1072141.444170] ffffffff81522b1c ffffffff81d0ca20 ffff8817fa17b950 ffff883fdd8121e0 [1072141.444171] Call Trace: [1072141.444179] [<ffffffff8121d583>] iterate_fd+0x53/0x80 [1072141.444182] [<ffffffff81522b1c>] write_classid+0x4c/0x80 [1072141.444187] [<ffffffff8111328b>] cgroup_file_write+0x9b/0x100 [1072141.444193] [<ffffffff81278bcb>] kernfs_fop_write+0x11b/0x150 [1072141.444198] [<ffffffff81201566>] __vfs_write+0x26/0x100 [1072141.444201] [<ffffffff81201bed>] vfs_write+0x9d/0x190 [1072141.444203] [<ffffffff812028c2>] SyS_write+0x42/0xa0 [1072141.444207] [<ffffffff815f58c3>] entry_SYSCALL_64_fastpath+0x1e/0xca [1072141.445490] DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x1e/0xca
If a cgroup has many tasks with many open file descriptors then we would end up in a large loop without any rescheduling point throught the operation. Add cond_resched once per task.
--- net/core/netclassid_cgroup.c | 1 + 1 file changed, 1 insertion(+)
net/core/netclassid_cgroup.c +1 -0
@@ -106,6 +106,7 @@ static int write_classid(struct cgroup_siterate_fd (p->files,0 , update_classid_sock, (void *)(unsigned long )cs->classid);task_unlock (p); +cond_resched (); }css_task_iter_end (&it);
Greg Kroah-Hartman
maintainerPATCH 132/361 net: stmmac: dwmac-sun8i: fix OF child-node lookup
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit ac63043d8cb5503c7e0fe110f947eacf2663804e ]
Use the new of_get_compatible_child() helper to lookup the mdio-internal child node instead of using of_find_compatible_node(), which searches the entire tree from a given start node and thus can return an unrelated (i.e. non-child) node.
This also addresses a potential use-after-free (e.g. after probe deferral) as the tree-wide helper drops a reference to its first argument (i.e. the mdio-mux node). Fortunately, this was inadvertently balanced by a failure to drop the mdio-mux reference after lookup.
While at it, also fix the related mdio-internal- and phy-node reference leaks.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +10 -2
@@ -714,8 +714,9 @@ static int get_ephy_nodes(struct stmmac_return -ENODEV ; } - mdio_internal =of_find_compatible_node (mdio_mux,NULL , + mdio_internal =of_get_compatible_child (mdio_mux,"allwinner,sun8i-h3-mdio-internal" ); +of_node_put (mdio_mux);if (!mdio_internal) {dev_err (priv->device,"Cannot get internal_mdio node\n" );return -ENODEV ;
@@ -729,13 +730,20 @@ static int get_ephy_nodes(struct stmmac_ gmac->rst_ephy =of_reset_control_get_exclusive (iphynode,NULL );if (IS_ERR (gmac->rst_ephy)) { ret =PTR_ERR (gmac->rst_ephy); -if (ret == -EPROBE_DEFER ) +if (ret == -EPROBE_DEFER ) { +of_node_put (iphynode); +of_node_put (mdio_internal);return ret; + }continue ; }dev_info (priv->device,"Found internal PHY node\n" ); +of_node_put (iphynode); +of_node_put (mdio_internal);return 0 ; } + +of_node_put (mdio_internal);return -ENODEV ; }
Greg Kroah-Hartman
maintainerPATCH 133/361 f2fs: fix to account IO correctly for cgroup writeback
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 78efac537de33faab9a4302cc05a70bb4a8b3b63 ]
Now, we have supported cgroup writeback, it depends on correctly IO account of specified filesystem.
But in commit d1b3e72d5490 ("f2fs: submit bio of in-place-update pages"), we split write paths from f2fs_submit_page_mbio() to two:
- f2fs_submit_page_bio() for IPU path
- f2fs_submit_page_bio() for OPU path
But still we account write IO only in f2fs_submit_page_mbio(), result in incorrect IO account, fix it by adding missing IO account in IPU path.
--- fs/f2fs/data.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/f2fs/data.c +4 -0
@@ -456,6 +456,10 @@ int f2fs_submit_page_bio(struct f2fs_io_bio_put (bio);return -EFAULT ; } + +if (fio->io_wbc && !is_read_io (fio->op)) +wbc_account_io (fio->io_wbc, page,PAGE_SIZE ); +bio_set_op_attrs (bio, fio->op, fio->op_flags);__submit_bio (fio->sbi, bio, fio->type);
Greg Kroah-Hartman
maintainerPATCH 134/361 MD: Memory leak when flush bio size is zero
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiao Ni <[email protected]>
[ Upstream commit af9b926de9c5986ab009e64917de87c9758bab10 ]
flush_pool is leaked when flush bio size is zero
--- drivers/md/md.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/md/md.c +6 -4
@@ -452,10 +452,11 @@ static void md_end_flush(struct bio *fbirdev_dec_pending (rdev, mddev);if (atomic_dec_and_test (&fi->flush_pending)) { -if (bio->bi_iter.bi_size ==0 ) +if (bio->bi_iter.bi_size ==0 ) {/* an empty barrier - all done */ bio_endio (bio); -else { +mempool_free (fi, mddev->flush_pool); + }else {INIT_WORK (&fi->flush_work, submit_flushes);queue_work (md_wq, &fi->flush_work); }
@@ -509,10 +510,11 @@ void md_flush_request(struct mddev *mddercu_read_unlock ();if (atomic_dec_and_test (&fi->flush_pending)) { -if (bio->bi_iter.bi_size ==0 ) +if (bio->bi_iter.bi_size ==0 ) {/* an empty barrier - all done */ bio_endio (bio); -else { +mempool_free (fi, mddev->flush_pool); + }else {INIT_WORK (&fi->flush_work, submit_flushes);queue_work (md_wq, &fi->flush_work); }
Greg Kroah-Hartman
maintainerPATCH 135/361 md: fix memleak for mempool
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jack Wang <[email protected]>
[ Upstream commit 6aaa58c994277647f8b05ffef3b9b225a2d08f36 ]
I noticed kmemleak report memory leak when run create/stop md in a loop, backtrace:
[<000000001ca975e7>] mempool_create_node+0x86/0xd0 [<0000000095576bcd>] md_run+0x1057/0x1410 [md_mod] [<000000007b45c5fc>] do_md_run+0x15/0x130 [md_mod] [<000000001ede9ec0>] md_ioctl+0x1f49/0x25d0 [md_mod] [<000000004142cacf>] blkdev_ioctl+0x680/0xd00
The root cause is we alloc mddev->flush_pool and mddev->flush_bio_pool in md_run, but from do_md_stop will not call into md_stop but __md_stop, move the mempool_destroy to __md_stop fixes the problem for me.
The bug was introduced in 5a409b4f56d5, the fixes should go to 4.18+
--- drivers/md/md.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/md/md.c +8 -8
@@ -5906,14 +5906,6 @@ static void __md_stop(struct mddev *mdde mddev->to_remove = &md_redundancy_group;module_put (pers->owner);clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); -} - -void md_stop (struct mddev *mddev) -{ -/* stop the array and free an attached data structures. -* This is called from dm-raid -*/ -__md_stop (mddev);if (mddev->flush_bio_pool) {mempool_destroy (mddev->flush_bio_pool); mddev->flush_bio_pool =NULL ;
@@ -5922,6 +5914,14 @@ void md_stop(struct mddev *mddev)mempool_destroy (mddev->flush_pool); mddev->flush_pool =NULL ; } +} + +void md_stop (struct mddev *mddev) +{ +/* stop the array and free an attached data structures. +* This is called from dm-raid +*/ +__md_stop (mddev);bioset_exit (&mddev->bio_set);bioset_exit (&mddev->sync_set); }
Greg Kroah-Hartman
maintainerPATCH 136/361 of: Add missing exports of node name compare functions
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
[ Upstream commit 173ee3962959a1985a109f81539a403b5cd07ae7 ]
Commit f42b0e18f2e5 ("of: add node name compare helper functions") failed to add the module exports to of_node_name_eq() and of_node_name_prefix(). Add them now.
--- drivers/of/base.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/of/base.c +2 -0
@@ -67,6 +67,7 @@ bool of_node_name_eq(const struct devicereturn (strlen (name) == len) && (strncmp (node_name, name, len) ==0 ); } +EXPORT_SYMBOL (of_node_name_eq);bool of_node_name_prefix (const struct device_node *np,const char *prefix) {
@@ -75,6 +76,7 @@ bool of_node_name_prefix(const struct dereturn strncmp (kbasename (np->full_name), prefix,strlen (prefix)) ==0 ; } +EXPORT_SYMBOL (of_node_name_prefix);int of_n_addr_cells (struct device_node *np) {
Greg Kroah-Hartman
maintainerPATCH 137/361 scsi: esp_scsi: Track residual for PIO transfers
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit fd47d919d0c336e7c22862b51ee94927ffea227a ]
If a target disconnects during a PIO data transfer the command may fail when the target reconnects:
scsi host1: DMA length is zero!
scsi host1: cur adr[04380000] len[00000000]
The scsi bus is then reset. This happens because the residual reached zero before the transfer was completed.
The usual residual calculation relies on the Transfer Count registers. That works for DMA transfers but not for PIO transfers. Fix the problem by storing the PIO transfer residual and using that to correctly calculate bytes_sent.
--- drivers/scsi/esp_scsi.c | 1 + drivers/scsi/esp_scsi.h | 2 ++ drivers/scsi/mac_esp.c | 2 ++ 3 files changed, 5 insertions(+)
drivers/scsi/esp_scsi.c +1 -0
@@ -1338,6 +1338,7 @@ static int esp_data_bytes_sent(struct es bytes_sent = esp->data_dma_len; bytes_sent -= ecount; + bytes_sent -= esp->send_cmd_residual;/* * The am53c974 has a DMA 'pecularity'. The doc states:
drivers/scsi/esp_scsi.h +2 -0
@@ -540,6 +540,8 @@ struct esp {void *dma;int dmarev; + +u32 send_cmd_residual; };/* A front-end driver for the ESP chip should do the following in
drivers/scsi/mac_esp.c +2 -0
@@ -427,6 +427,8 @@ static void mac_esp_send_pio_cmd(structscsi_esp_cmd (esp,ESP_CMD_TI ); } } + + esp->send_cmd_residual = esp_count; }static int mac_esp_irq_pending (struct esp *esp)
Greg Kroah-Hartman
maintainerPATCH 138/361 scsi: ufs: Schedule clk gating work on correct queue
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Evan Green <[email protected]>
[ Upstream commit f4bb7704699beee9edfbee875daa9089c86cf724 ]
With commit 10e5e37581fc ("scsi: ufs: Add clock ungating to a separate workqueue"), clock gating work was moved to a separate work queue with WQ_MEM_RECLAIM set, since clock gating could occur from a memory reclaim context. Unfortunately, clk_gating.gate_work was left queued via schedule_delayed_work, which is a system workqueue that does not have WQ_MEM_RECLAIM set. Because ufshcd_ungate_work attempts to cancel gate_work, the following warning appears:
[ 14.174170] workqueue: WQ_MEM_RECLAIM ufs_clk_gating_0:ufshcd_ungate_work is flushing !WQ_MEM_RECLAIM events:ufshcd_gate_work [ 14.174179] WARNING: CPU: 4 PID: 173 at kernel/workqueue.c:2440 check_flush_dependency+0x110/0x118 [ 14.205725] CPU: 4 PID: 173 Comm: kworker/u16:3 Not tainted 4.14.68 #1 [ 14.212437] Hardware name: Google Cheza (rev1) (DT) [ 14.217459] Workqueue: ufs_clk_gating_0 ufshcd_ungate_work [ 14.223107] task: ffffffc0f6a40080 task.stack: ffffff800a490000 [ 14.229195] PC is at check_flush_dependency+0x110/0x118 [ 14.234569] LR is at check_flush_dependency+0x110/0x118 [ 14.239944] pc : [<ffffff80080cad14>] lr : [<ffffff80080cad14>] pstate: 60c001c9 [ 14.333050] Call trace: [ 14.427767] [<ffffff80080cad14>] check_flush_dependency+0x110/0x118 [ 14.434219] [<ffffff80080cafec>] start_flush_work+0xac/0x1fc [ 14.440046] [<ffffff80080caeec>] flush_work+0x40/0x94 [ 14.445246] [<ffffff80080cb288>] __cancel_work_timer+0x11c/0x1b8 [ 14.451433] [<ffffff80080cb4b8>] cancel_delayed_work_sync+0x20/0x30 [ 14.457886] [<ffffff80085b9294>] ufshcd_ungate_work+0x24/0xd0 [ 14.463800] [<ffffff80080cfb04>] process_one_work+0x32c/0x690 [ 14.469713] [<ffffff80080d0154>] worker_thread+0x218/0x338 [ 14.475361] [<ffffff80080d527c>] kthread+0x120/0x130 [ 14.480470] [<ffffff8008084814>] ret_from_fork+0x10/0x18
The simple solution is to put the gate_work on the same WQ_MEM_RECLAIM work queue as the ungate_work.
--- drivers/scsi/ufs/ufshcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +3 -2
@@ -1691,8 +1691,9 @@ static void __ufshcd_release(struct ufs_ hba->clk_gating.state =REQ_CLKS_OFF ;trace_ufshcd_clk_gating (dev_name (hba->dev), hba->clk_gating.state); -schedule_delayed_work (&hba->clk_gating.gate_work, -msecs_to_jiffies (hba->clk_gating.delay_ms)); +queue_delayed_work (hba->clk_gating.clk_gating_workq, + &hba->clk_gating.gate_work, +msecs_to_jiffies (hba->clk_gating.delay_ms)); }void ufshcd_release (struct ufs_hba *hba)
Greg Kroah-Hartman
maintainerPATCH 139/361 UAPI: ndctl: Fix g++-unsupported initialisation in headers
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 9607871f37dc3e717639694b8d0dc738f2a68efc ]
The following code in the linux/ndctl header file:
static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
{
static const char * const names[] = {
[ND_CMD_ARS_CAP] = "ars_cap",
[ND_CMD_ARS_START] = "ars_start",
[ND_CMD_ARS_STATUS] = "ars_status",
[ND_CMD_CLEAR_ERROR] = "clear_error",
[ND_CMD_CALL] = "cmd_call",
};
if (cmd < ARRAY_SIZE(names) && names[cmd])
return names[cmd];
return "unknown";
}is broken in a number of ways:
(1) ARRAY_SIZE() is not generally defined.
(2) g++ does not support "non-trivial" array initialisers fully yet.
(3) Every file that calls this function will acquire a copy of names[].
The same goes for nvdimm_cmd_name().
Fix all three by converting to a switch statement where each case returns a string. That way if cmd is a constant, the compiler can trivially reduce it and, if not, the compiler can use a shared lookup table if it thinks that is more efficient.
A better way would be to remove these functions and their arrays from the header entirely.
--- include/uapi/linux/ndctl.h | 48 +++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 27 deletions(-)
include/uapi/linux/ndctl.h +21 -27
@@ -128,37 +128,31 @@ enum {static inline const char *nvdimm_bus_cmd_name (unsigned cmd) { -static const char *const names[] = { - [ND_CMD_ARS_CAP ] ="ars_cap" , - [ND_CMD_ARS_START ] ="ars_start" , - [ND_CMD_ARS_STATUS ] ="ars_status" , - [ND_CMD_CLEAR_ERROR ] ="clear_error" , - [ND_CMD_CALL ] ="cmd_call" , - }; - -if (cmd <ARRAY_SIZE (names) && names[cmd]) -return names[cmd]; -return "unknown" ; +switch (cmd) { +case ND_CMD_ARS_CAP :return "ars_cap" ; +case ND_CMD_ARS_START :return "ars_start" ; +case ND_CMD_ARS_STATUS :return "ars_status" ; +case ND_CMD_CLEAR_ERROR :return "clear_error" ; +case ND_CMD_CALL :return "cmd_call" ; +default :return "unknown" ; + } }static inline const char *nvdimm_cmd_name (unsigned cmd) { -static const char *const names[] = { - [ND_CMD_SMART ] ="smart" , - [ND_CMD_SMART_THRESHOLD ] ="smart_thresh" , - [ND_CMD_DIMM_FLAGS ] ="flags" , - [ND_CMD_GET_CONFIG_SIZE ] ="get_size" , - [ND_CMD_GET_CONFIG_DATA ] ="get_data" , - [ND_CMD_SET_CONFIG_DATA ] ="set_data" , - [ND_CMD_VENDOR_EFFECT_LOG_SIZE ] ="effect_size" , - [ND_CMD_VENDOR_EFFECT_LOG ] ="effect_log" , - [ND_CMD_VENDOR ] ="vendor" , - [ND_CMD_CALL ] ="cmd_call" , - }; - -if (cmd <ARRAY_SIZE (names) && names[cmd]) -return names[cmd]; -return "unknown" ; +switch (cmd) { +case ND_CMD_SMART :return "smart" ; +case ND_CMD_SMART_THRESHOLD :return "smart_thresh" ; +case ND_CMD_DIMM_FLAGS :return "flags" ; +case ND_CMD_GET_CONFIG_SIZE :return "get_size" ; +case ND_CMD_GET_CONFIG_DATA :return "get_data" ; +case ND_CMD_SET_CONFIG_DATA :return "set_data" ; +case ND_CMD_VENDOR_EFFECT_LOG_SIZE :return "effect_size" ; +case ND_CMD_VENDOR_EFFECT_LOG :return "effect_log" ; +case ND_CMD_VENDOR :return "vendor" ; +case ND_CMD_CALL :return "cmd_call" ; +default :return "unknown" ; + } }#define ND_IOCTL 'N'
Greg Kroah-Hartman
maintainerPATCH 140/361 KVM: nVMX: Clear reserved bits of #DB exit qualification
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jim Mattson <[email protected]>
[ Upstream commit cfb634fe3052aefc4e1360fa322018c9a0b49755 ]
According to volume 3 of the SDM, bits 63:15 and 12:4 of the exit qualification field for debug exceptions are reserved (cleared to 0). However, the SDM is incorrect about bit 16 (corresponding to DR6.RTM). This bit should be set if a debug exception (#DB) or a breakpoint exception (#BP) occurred inside an RTM region while advanced debugging of RTM transactional regions was enabled. Note that this is the opposite of DR6.RTM, which "indicates (when clear) that a debug exception (#DB) or breakpoint exception (#BP) occurred inside an RTM region while advanced debugging of RTM transactional regions was enabled."
There is still an issue with stale DR6 bits potentially being misreported for the current debug exception. DR6 should not have been modified before vectoring the #DB exception, and the "new DR6 bits" should be available somewhere, but it was and they aren't.
--- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/vmx.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -0
@@ -177,6 +177,7 @@ enum {#define DR6_BD (1 << 13)#define DR6_BS (1 << 14) +#define DR6_BT (1 << 15)#define DR6_RTM (1 << 16)#define DR6_FIXED_1 0xfffe0ff0#define DR6_INIT 0xffff0ff0
arch/x86/kvm/vmx.c +5 -2
@@ -3294,10 +3294,13 @@ static int nested_vmx_check_exception(st } }else {if (vmcs12->exception_bitmap & (1u << nr)) { -if (nr ==DB_VECTOR ) +if (nr ==DB_VECTOR ) { *exit_qual = vcpu->arch.dr6; -else + *exit_qual &= ~(DR6_FIXED_1 |DR6_BT ); + *exit_qual ^=DR6_RTM ; + }else { *exit_qual =0 ; + }return 1 ; } }
Greg Kroah-Hartman
maintainerPATCH 141/361 scsi: megaraid_sas: fix a missing-check bug
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenwen Wang <[email protected]>
[ Upstream commit 47db7873136a9c57c45390a53b57019cf73c8259 ]
In megasas_mgmt_compat_ioctl_fw(), to handle the structure compat_megasas_iocpacket 'cioc', a user-space structure megasas_iocpacket 'ioc' is allocated before megasas_mgmt_ioctl_fw() is invoked to handle the packet. Since the two data structures have different fields, the data is copied from 'cioc' to 'ioc' field by field. In the copy process, 'sense_ptr' is prepared if the field 'sense_len' is not null, because it will be used in megasas_mgmt_ioctl_fw(). To prepare 'sense_ptr', the user-space data 'ioc->sense_off' and 'cioc->sense_off' are copied and saved to kernel-space variables 'local_sense_off' and 'user_sense_off' respectively. Given that 'ioc->sense_off' is also copied from 'cioc->sense_off', 'local_sense_off' and 'user_sense_off' should have the same value. However, 'cioc' is in the user space and a malicious user can race to change the value of 'cioc->sense_off' after it is copied to 'ioc->sense_off' but before it is copied to 'user_sense_off'. By doing so, the attacker can inject different values into 'local_sense_off' and 'user_sense_off'. This can cause undefined behavior in the following execution, because the two variables are supposed to be same.
This patch enforces a check on the two kernel variables 'local_sense_off' and 'user_sense_off' to make sure they are the same after the copy. In case they are not, an error code EINVAL will be returned.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -0
@@ -7523,6 +7523,9 @@ static int megasas_mgmt_compat_ioctl_fw( get_user(user_sense_off, &cioc->sense_off))return -EFAULT ; +if (local_sense_off != user_sense_off) +return -EINVAL ; +if (local_sense_len) {void __user **sense_ioc_ptr = (void __user **)((u8 *)((unsigned long )&ioc->frame.raw) + local_sense_off);
Greg Kroah-Hartman
maintainerPATCH 142/361 RDMA/core: Do not expose unsupported counters
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Parav Pandit <[email protected]>
[ Upstream commit 0f6ef65d1c6ec8deb5d0f11f86631ec4cfe8f22e ]
If the provider driver (such as rdma_rxe) doesn't support pma counters, avoid exposing its directory similar to optional hw_counters directory. If core fails to read the PMA counter, return an error so that user can retry later if needed.
--- drivers/infiniband/core/sysfs.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/infiniband/core/sysfs.c +12 -7
@@ -512,7 +512,7 @@ static ssize_t show_pma_counter(struct i ret =get_perf_mad (p->ibdev, p->port_num, tab_attr->attr_id, &data,40 + offset /8 ,sizeof (data));if (ret <0 ) -return sprintf (buf,"N/A (no PMA)\n" ); +return ret;switch (width) {case 4 :
@@ -1057,10 +1057,12 @@ static int add_port(struct ib_device *de goto err_put; } - p->pma_table =get_counter_table (device, port_num); - ret =sysfs_create_group (&p->kobj, p->pma_table); -if (ret) - goto err_put_gid_attrs; +if (device->process_mad) { + p->pma_table =get_counter_table (device, port_num); + ret =sysfs_create_group (&p->kobj, p->pma_table); +if (ret) + goto err_put_gid_attrs; + } p->gid_group.name ="gids" ; p->gid_group.attrs =alloc_group_attrs (show_port_gid, attr.gid_tbl_len);
@@ -1173,7 +1175,8 @@ err_free_gid: p->gid_group.attrs =NULL ; err_remove_pma: -sysfs_remove_group (&p->kobj, p->pma_table); +if (p->pma_table) +sysfs_remove_group (&p->kobj, p->pma_table); err_put_gid_attrs:kobject_put (&p->gid_attr_group->kobj);
@@ -1285,7 +1288,9 @@ static void free_port_list_attributes(stkfree (port->hw_stats);free_hsag (&port->kobj, port->hw_stats_ag); } -sysfs_remove_group (p, port->pma_table); + +if (port->pma_table) +sysfs_remove_group (p, port->pma_table);sysfs_remove_group (p, &port->pkey_group);sysfs_remove_group (p, &port->gid_group); sysfs_remove_group(&port->gid_attr_group->kobj,
Greg Kroah-Hartman
maintainerPATCH 143/361 RDMA/cm: Respect returned status of cm_init_av_by_path
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
[ Upstream commit e54b6a3bcd1ec972b25a164bdf495d9e7120b107 ]
Add missing check for failure of cm_init_av_by_path
--- drivers/infiniband/core/cm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/core/cm.c +5 -2
@@ -3292,8 +3292,11 @@ static int cm_lap_handler(struct cm_workif (ret) goto unlock; -cm_init_av_by_path (param->alternate_path,NULL , &cm_id_priv->alt_av, - cm_id_priv); + ret =cm_init_av_by_path (param->alternate_path,NULL , + &cm_id_priv->alt_av, cm_id_priv); +if (ret) + goto unlock; + cm_id_priv->id.lap_state =IB_CM_LAP_RCVD ; cm_id_priv->tid = lap_msg->hdr.tid; ret =atomic_inc_and_test (&cm_id_priv->work_count);
Greg Kroah-Hartman
maintainerPATCH 144/361 IB/ipoib: Clear IPCB before icmp_send
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis Drozdov <[email protected]>
[ Upstream commit 4d6e4d12da2c308f8f976d3955c45ee62539ac98 ]
IPCB should be cleared before icmp_send, since it may contain data from previous layers and the data could be misinterpreted as ip header options, which later caused the ihl to be set to an invalid value and resulted in the following stack corruption:
[ 1083.031512] ib0: packet len 57824 (> 2048) too long to send, dropping [ 1083.031843] ib0: packet len 37904 (> 2048) too long to send, dropping [ 1083.032004] ib0: packet len 4040 (> 2048) too long to send, dropping [ 1083.032253] ib0: packet len 63800 (> 2048) too long to send, dropping [ 1083.032481] ib0: packet len 23960 (> 2048) too long to send, dropping [ 1083.033149] ib0: packet len 63800 (> 2048) too long to send, dropping [ 1083.033439] ib0: packet len 63800 (> 2048) too long to send, dropping [ 1083.033700] ib0: packet len 63800 (> 2048) too long to send, dropping [ 1083.034124] ib0: packet len 63800 (> 2048) too long to send, dropping [ 1083.034387] ================================================================== [ 1083.034602] BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0xf08/0x1310 [ 1083.034798] Write of size 4 at addr ffff880353457c5f by task kworker/u16:0/7 [ 1083.034990] [ 1083.035104] CPU: 7 PID: 7 Comm: kworker/u16:0 Tainted: G O 4.19.0-rc5+ #1 [ 1083.035316] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu2 04/01/2014 [ 1083.035573] Workqueue: ipoib_wq ipoib_cm_skb_reap [ib_ipoib] [ 1083.035750] Call Trace: [ 1083.035888] dump_stack+0x9a/0xeb [ 1083.036031] print_address_description+0xe3/0x2e0 [ 1083.036213] kasan_report+0x18a/0x2e0 [ 1083.036356] ? __ip_options_echo+0xf08/0x1310 [ 1083.036522] __ip_options_echo+0xf08/0x1310 [ 1083.036688] icmp_send+0x7b9/0x1cd0 [ 1083.036843] ? icmp_route_lookup.constprop.9+0x1070/0x1070 [ 1083.037018] ? netif_schedule_queue+0x5/0x200 [ 1083.037180] ? debug_show_all_locks+0x310/0x310 [ 1083.037341] ? rcu_dynticks_curr_cpu_in_eqs+0x85/0x120 [ 1083.037519] ? debug_locks_off+0x11/0x80 [ 1083.037673] ? debug_check_no_obj_freed+0x207/0x4c6 [ 1083.037841] ? check_flags.part.27+0x450/0x450 [ 1083.037995] ? debug_check_no_obj_freed+0xc3/0x4c6 [ 1083.038169] ? debug_locks_off+0x11/0x80 [ 1083.038318] ? skb_dequeue+0x10e/0x1a0 [ 1083.038476] ? ipoib_cm_skb_reap+0x2b5/0x650 [ib_ipoib] [ 1083.038642] ? netif_schedule_queue+0xa8/0x200 [ 1083.038820] ? ipoib_cm_skb_reap+0x544/0x650 [ib_ipoib] [ 1083.038996] ipoib_cm_skb_reap+0x544/0x650 [ib_ipoib] [ 1083.039174] process_one_work+0x912/0x1830 [ 1083.039336] ? wq_pool_ids_show+0x310/0x310 [ 1083.039491] ? lock_acquire+0x145/0x3a0 [ 1083.042312] worker_thread+0x87/0xbb0 [ 1083.045099] ? process_one_work+0x1830/0x1830 [ 1083.047865] kthread+0x322/0x3e0 [ 1083.050624] ? kthread_create_worker_on_cpu+0xc0/0xc0 [ 1083.053354] ret_from_fork+0x3a/0x50
For instance __ip_options_echo is failing to proceed with invalid srr and optlen passed from another layer via IPCB
[ 762.139568] IPv4: __ip_options_echo rr=0 ts=0 srr=43 cipso=0 [ 762.139720] IPv4: ip_options_build: IPCB 00000000f3cd969e opt 000000002ccb3533 [ 762.139838] IPv4: __ip_options_echo in srr: optlen 197 soffset 84 [ 762.139852] IPv4: ip_options_build srr=0 is_frag=0 rr_needaddr=0 ts_needaddr=0 ts_needtime=0 rr=0 ts=0 [ 762.140269] ================================================================== [ 762.140713] IPv4: __ip_options_echo rr=0 ts=0 srr=0 cipso=0 [ 762.141078] BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0x12ec/0x1680 [ 762.141087] Write of size 4 at addr ffff880353457c7f by task kworker/u16:0/7
--- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_cm.c +6 -2
@@ -1438,11 +1438,15 @@ static void ipoib_cm_skb_reap(struct worspin_unlock_irqrestore (&priv->lock, flags);netif_tx_unlock_bh (dev); -if (skb->protocol ==htons (ETH_P_IP )) +if (skb->protocol ==htons (ETH_P_IP )) { +memset (IPCB (skb),0 ,sizeof (*IPCB (skb)));icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_FRAG_NEEDED ,htonl (mtu)); + }#if IS_ENABLED (CONFIG_IPV6 ) - else if (skb->protocol == htons(ETH_P_IPV6)) + else if (skb->protocol == htons(ETH_P_IPV6)) { +memset (IP6CB (skb),0 ,sizeof (*IP6CB (skb)));icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu); + }#endif dev_kfree_skb_any (skb);
Greg Kroah-Hartman
maintainerPATCH 145/361 RDMA/bnxt_re: Avoid accessing nq->bar_reg_iomem in failure case
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <[email protected]>
[ Upstream commit ed51efd2ce44091a858ad829f666727e7c95695e ]
In the failure path, nq->bar_reg_iomem gets accessed without initializing. Avoid this by calling the bnxt_qplib_nq_stop_irq only if the initialization is complete.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -1
@@ -360,7 +360,8 @@ void bnxt_qplib_disable_nq(struct bnxt_q }/* Make sure the HW is stopped! */ -bnxt_qplib_nq_stop_irq (nq, true); +if (nq->requested) +bnxt_qplib_nq_stop_irq (nq, true);if (nq->bar_reg_iomem)iounmap (nq->bar_reg_iomem);
Greg Kroah-Hartman
maintainerPATCH 146/361 RDMA/bnxt_re: Fix recursive lock warning in debug kernel
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <[email protected]>
[ Upstream commit d455f29f6d76a5f94881ca1289aaa1e90617ff5d ]
Fix possible recursive lock warning. Its a false warning as the locks are part of two differnt HW Queue data structure - cmdq and creq. Debug kernel is throwing the following warning and stack trace.
[ 783.914967] ============================================
[ 783.914970] WARNING: possible recursive locking detected
[ 783.914973] 4.19.0-rc2+ #33 Not tainted
[ 783.914976] --------------------------------------------
[ 783.914979] swapper/2/0 is trying to acquire lock:
[ 783.914982] 000000002aa3949d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
[ 783.914999]
but task is already holding lock:
[ 783.915002] 00000000be73920d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x2a/0x350 [bnxt_re]
[ 783.915013]
other info that might help us debug this:
[ 783.915016] Possible unsafe locking scenario:[ 783.915019] CPU0 [ 783.915021] ---- [ 783.915034] lock(&(&hwq->lock)->rlock); [ 783.915035] lock(&(&hwq->lock)->rlock); [ 783.915037] *** DEADLOCK ***
[ 783.915038] May be due to missing lock nesting notation
[ 783.915039] 1 lock held by swapper/2/0:
[ 783.915040] #0: 00000000be73920d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x2a/0x350 [bnxt_re]
[ 783.915044]
stack backtrace:
[ 783.915046] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.19.0-rc2+ #33
[ 783.915047] Hardware name: Dell Inc. PowerEdge R730/0599V5, BIOS 1.0.4 08/28/2014
[ 783.915048] Call Trace:
[ 783.915049] <IRQ>
[ 783.915054] dump_stack+0x90/0xe3
[ 783.915058] __lock_acquire+0x106c/0x1080
[ 783.915061] ? sched_clock+0x5/0x10
[ 783.915063] lock_acquire+0xbd/0x1a0
[ 783.915065] ? bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
[ 783.915069] _raw_spin_lock_irqsave+0x4a/0x90
[ 783.915071] ? bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
[ 783.915073] bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
[ 783.915078] tasklet_action_common.isra.17+0x197/0x1b0
[ 783.915081] __do_softirq+0xcb/0x3a6
[ 783.915084] irq_exit+0xe9/0x100
[ 783.915085] do_IRQ+0x6a/0x120
[ 783.915087] common_interrupt+0xf/0xf
[ 783.915088] </IRQ>Use nested notation for the spin_lock to avoid this warning.
--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +11 -2
@@ -309,8 +309,17 @@ static int bnxt_qplib_process_qp_event(s rcfw->aeq_handler (rcfw, qp_event, qp);break ;default : -/* Command Response */ -spin_lock_irqsave (&cmdq->lock, flags); +/* +* Command Response +* cmdq->lock needs to be acquired to synchronie +* the command send and completion reaping. This function +* is always called with creq->lock held. Using +* the nested variant of spin_lock. +* +*/ + +spin_lock_irqsave_nested (&cmdq->lock, flags, +SINGLE_DEPTH_NESTING ); cookie =le16_to_cpu (qp_event->cookie); mcookie = qp_event->cookie; blocked = cookie &RCFW_CMD_IS_BLOCKING ;