Linux 5.15.167
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.15.167 kernel.
All users of the 5.15 kernel series must upgrade.
The updated 5.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/locking/hwspinlock.rst | 11 Makefile | 2 arch/arm64/include/asm/acpi.h | 12 arch/arm64/kernel/acpi_numa.c | 11 arch/mips/kernel/cevt-r4k.c | 15 arch/riscv/kernel/head.S | 3 arch/s390/kernel/vmlinux.lds.S | 9 arch/um/drivers/line.c | 2 arch/x86/kvm/svm/svm.c | 15 arch/x86/mm/pti.c | 45 +- block/blk-integrity.c | 2 drivers/acpi/acpi_processor.c | 15 drivers/android/binder.c | 1 drivers/ata/libata-core.c | 4 drivers/ata/pata_macio.c | 7 drivers/base/devres.c | 1 drivers/clk/qcom/clk-alpha-pll.c | 6 drivers/clocksource/timer-imx-tpm.c | 16 drivers/clocksource/timer-of.c | 17 drivers/clocksource/timer-of.h | 1 drivers/cpufreq/scmi-cpufreq.c | 4 drivers/gpio/gpio-rockchip.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_afmt.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c | 6 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.h | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 5 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 drivers/gpu/drm/amd/amdgpu/df_v1_7.c | 2 drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 2 drivers/gpu/drm/amd/amdkfd/kfd_crat.h | 2 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 5 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 3 drivers/gpu/drm/amd/display/dc/core/dc.c | 1 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb_scl.c | 3 drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 17 drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 17 drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c | 15 drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c | 28 + drivers/gpu/drm/amd/pm/powerplay/hwmgr/pp_psm.c | 13 drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 5 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 29 + drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 2 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 15 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 90 ++++- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 20 - drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 31 + drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 6 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 drivers/gpu/drm/bridge/tc358767.c | 2 drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 drivers/gpu/drm/i915/i915_sw_fence.c | 8 drivers/gpu/drm/meson/meson_plane.c | 17 drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 4 drivers/hid/hid-cougar.c | 2 drivers/hv/vmbus_drv.c | 1 drivers/hwmon/adc128d818.c | 4 drivers/hwmon/lm95234.c | 9 drivers/hwmon/nct6775.c | 2 drivers/hwmon/w83627ehf.c | 4 drivers/hwspinlock/hwspinlock_core.c | 28 + drivers/hwspinlock/hwspinlock_internal.h | 3 drivers/i3c/master/mipi-i3c-hci/dma.c | 5 drivers/iio/adc/ad7124.c | 27 - drivers/iio/buffer/industrialio-buffer-dmaengine.c | 4 drivers/iio/inkern.c | 8 drivers/infiniband/hw/efa/efa_com.c | 30 - drivers/input/misc/uinput.c | 14 drivers/iommu/intel/dmar.c | 2 drivers/iommu/sun50i-iommu.c | 1 drivers/irqchip/irq-armada-370-xp.c | 4 drivers/irqchip/irq-gic-v2m.c | 6 drivers/leds/leds-spi-byte.c | 6 drivers/md/dm-init.c | 4 drivers/media/platform/qcom/camss/camss.c | 5 drivers/media/test-drivers/vivid/vivid-vid-cap.c | 17 drivers/media/test-drivers/vivid/vivid-vid-out.c | 16 drivers/media/usb/uvc/uvc_driver.c | 18 - drivers/misc/vmw_vmci/vmci_resource.c | 3 drivers/mmc/host/cqhci-core.c | 2 drivers/mmc/host/dw_mmc.c | 4 drivers/mmc/host/sdhci-of-aspeed.c | 1 drivers/net/bareudp.c | 22 - drivers/net/can/m_can/m_can.c | 5 drivers/net/can/spi/mcp251x.c | 2 drivers/net/dsa/vitesse-vsc73xx-core.c | 10 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 20 - drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 10 drivers/net/ethernet/intel/ice/ice_lib.c | 12 drivers/net/ethernet/intel/igb/igb_main.c | 10 drivers/net/ethernet/intel/igc/igc_main.c | 1 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 drivers/net/geneve.c | 8 drivers/net/usb/ch9200.c | 4 drivers/net/usb/cx82310_eth.c | 5 drivers/net/usb/ipheth.c | 2 drivers/net/usb/kaweth.c | 3 drivers/net/usb/mcs7830.c | 4 drivers/net/usb/qmi_wwan.c | 1 drivers/net/usb/sierra_net.c | 6 drivers/net/usb/sr9700.c | 4 drivers/net/usb/sr9800.c | 5 drivers/net/usb/usbnet.c | 15 drivers/net/virtio_net.c | 8 drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 1 drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 3 drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 1 drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 drivers/net/wireless/marvell/mwifiex/main.h | 3 drivers/nvme/host/pci.c | 11 drivers/nvme/target/tcp.c | 4 drivers/nvmem/core.c | 6 drivers/of/irq.c | 15 drivers/pci/controller/dwc/pci-keystone.c | 44 ++ drivers/pci/controller/dwc/pcie-al.c | 16 drivers/pci/hotplug/pnv_php.c | 3 drivers/pci/pci.c | 35 +- drivers/pcmcia/yenta_socket.c | 6 drivers/platform/x86/dell/dell-smbios-base.c | 5 drivers/staging/iio/frequency/ad9834.c | 2 drivers/uio/uio_hv_generic.c | 11 drivers/usb/dwc3/core.c | 15 drivers/usb/dwc3/core.h | 2 drivers/usb/storage/uas.c | 1 drivers/usb/typec/ucsi/ucsi.h | 2 drivers/usb/usbip/stub_rx.c | 77 ++-- fs/btrfs/ctree.c | 12 fs/btrfs/ctree.h | 1 fs/btrfs/extent-tree.c | 32 + fs/btrfs/file.c | 25 - fs/btrfs/inode.c | 2 fs/btrfs/transaction.h | 6 fs/cifs/smb2ops.c | 24 - fs/ext4/fast_commit.c | 8 fs/ext4/inode.c | 5 fs/ext4/page-io.c | 14 fs/fuse/file.c | 8 fs/fuse/xattr.c | 4 fs/ksmbd/smb2pdu.c | 4 fs/ksmbd/transport_tcp.c | 4 fs/nfs/super.c | 2 fs/nilfs2/recovery.c | 35 +- fs/nilfs2/segment.c | 10 fs/nilfs2/sysfs.c | 117 ++++-- fs/notify/fsnotify.c | 31 + fs/notify/fsnotify.h | 2 fs/notify/mark.c | 32 + fs/ntfs3/dir.c | 52 +- fs/squashfs/inode.c | 7 fs/udf/super.c | 24 + include/linux/fsnotify_backend.h | 8 include/linux/hwspinlock.h | 6 include/linux/i2c.h | 2 include/linux/udp.h | 2 include/linux/virtio_net.h | 35 +- include/net/bluetooth/hci_core.h | 5 kernel/cgroup/cgroup.c | 2 kernel/dma/debug.c | 5 kernel/dma/map_benchmark.c | 16 kernel/events/core.c | 18 - kernel/events/internal.h | 1 kernel/events/ring_buffer.c | 2 kernel/events/uprobes.c | 3 kernel/locking/rtmutex.c | 9 kernel/rcu/tasks.h | 2 kernel/rcu/tree.h | 1 kernel/rcu/tree_nocb.h | 32 - kernel/smp.c | 1 kernel/trace/trace.c | 2 kernel/workqueue.c | 12 lib/generic-radix-tree.c | 2 mm/memcontrol.c | 23 + net/8021q/vlan_core.c | 7 net/bluetooth/mgmt.c | 60 +-- net/bluetooth/smp.c | 7 net/bridge/br_fdb.c | 6 net/can/bcm.c | 4 net/ethernet/eth.c | 7 net/ipv4/af_inet.c | 19 - net/ipv4/fou.c | 54 +-- net/ipv4/gre_offload.c | 12 net/ipv4/tcp_bpf.c | 2 net/ipv4/tcp_offload.c | 3 net/ipv4/udp_offload.c | 22 - net/ipv6/ila/ila.h | 1 net/ipv6/ila/ila_main.c | 6 net/ipv6/ila/ila_xlat.c | 13 net/ipv6/ip6_offload.c | 14 net/ipv6/udp_offload.c | 2 net/mptcp/options.c | 44 +- net/mptcp/pm.c | 36 +- net/mptcp/pm_netlink.c | 174 ++++++---- net/mptcp/protocol.c | 61 ++- net/mptcp/protocol.h | 28 - net/mptcp/sockopt.c | 4 net/mptcp/subflow.c | 56 +-- net/netfilter/nf_conncount.c | 8 net/sched/sch_cake.c | 11 net/sched/sch_netem.c | 9 net/sunrpc/xprtsock.c | 7 net/unix/af_unix.c | 9 net/wireless/scan.c | 46 +- security/apparmor/apparmorfs.c | 4 security/smack/smack_lsm.c | 14 sound/hda/hdmi_chmap.c | 18 + sound/pci/hda/hda_generic.c | 63 +++ sound/pci/hda/hda_generic.h | 1 sound/pci/hda/patch_conexant.c | 13 sound/pci/hda/patch_realtek.c | 10 sound/soc/soc-dapm.c | 1 sound/soc/soc-topology.c | 2 sound/soc/sunxi/sun4i-i2s.c | 143 ++++---- tools/lib/bpf/libbpf.c | 4 tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 tools/testing/selftests/net/udpgso.c | 2 221 files changed, 1925 insertions(+), 986 deletions(-)
Abhishek Pandit-Subedi (1):
usb: typec: ucsi: Fix null pointer dereference in trace
Aleksandr Mishin (3):
PCI: al: Check IORESOURCE_BUS existence during probe platform/x86: dell-smbios: Fix error path in dell_smbios_init()
staging: iio: frequency: ad9834: Validate frequency parameter value
Alex Hung (5):
drm/amd/display: Check gpio_id before used as array index drm/amd/display: Check num_valid_sets before accessing reader_wm_sets[] drm/amd/display: Check msg_id before processing transcation drm/amd/display: Skip wbscl_set_scaler_filter if filter is null drm/amd/display: Check HDCP returned status
Alvin Lee (1):
drm/amd/display: Assign linear_pitch_alignment even for VM
Amadeusz Sławiński (1):
ASoC: topology: Properly initialize soc_enum values
Amir Goldstein (1):
fsnotify: clear PARENT_WATCHED flags lazily
Andreas Ziegler (1):
libbpf: Add NULL checks to bpf_object__{prev_map,next_map}Andy Shevchenko (3):
leds: spi-byte: Call of_node_put() on error path drm/i915/fence: Mark debug_fence_init_onstack() with __maybe_unused drm/i915/fence: Mark debug_fence_free() with __maybe_unused
Arend van Spriel (1):
wifi: brcmsmac: advertise MFP_CAPABLE to enable WPA3
Asad Kamal (1):
drm/amd/amdgpu: Check tbo resource pointer
Benjamin Marzinski (1):
dm init: Handle minors larger than 255
Bob Zhou (1):
drm/amd/pm: Fix the null pointer dereference for vega10_hwmgr
Breno Leitao (1):
virtio_net: Fix napi_skb_cache_put warning
Camila Alvarez (1):
HID: cougar: fix slab-out-of-bounds Read in cougar_report_fixup
Carlos Llamas (1):
binder: fix UAF caused by offsets overwrite
Casey Schaufler (1):
smack: tcp: ipv4, fix incorrect labeling
Chen Ni (1):
media: qcom: camss: Add check for v4l2_fwnode_endpoint_parse
Christoffer Sandberg (1):
ALSA: hda/conexant: Add pincfg quirk to enable top speakers on Sirius devices
Christoph Hellwig (1):
block: remove the blk_flush_integrity call in blk_integrity_unregister
Cong Wang (1):
tcp_bpf: fix return value of tcp_bpf_sendmsg()
Daiwei Li (1):
igb: Fix not clearing TimeSync interrupts for 82580
Dan Carpenter (2):
igc: Unlock on error in igc_io_resume()
ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
Dan Williams (1):
PCI: Add missing bridge lock to pci_bus_lock()
Daniel Borkmann (1):
net, sunrpc: Remap EPERM in case of connection failure in xs_tcp_setup_socket
Daniel Lezcano (1):
clocksource/drivers/timer-of: Remove percpu irq related code
David Fernandez Gonzalez (1):
VMCI: Fix use-after-free when removing resource in vmci_resource_remove()
David Lechner (1):
iio: buffer-dmaengine: fix releasing dma channel on error
David Sterba (1):
btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry()
Dmitry Torokhov (1):
Input: uinput - reject requests with unreasonable number of slots
Dumitru Ceclan (2):
iio: adc: ad7124: fix config comparison
iio: adc: ad7124: fix chip ID mismatch
Eric Biggers (1):
ext4: reject casefold inode flag without casefold feature
Eric Dumazet (3):
ila: call nf_unregister_net_hooks() sooner
gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers
gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlers
Faisal Hassan (1):
usb: dwc3: core: update LC timer as per USB Spec V3.2
Felix Fietkau (1):
udp: fix receiving fraglist GSO packets
Filipe Manana (2):
btrfs: replace BUG_ON() with error handling at update_ref_for_cow()
btrfs: fix race between direct IO write and fsync when using same fd
Frederic Weisbecker (1):
rcu/nocb: Remove buggy bypass lock contention mitigation
Geert Uytterhoeven (1):
nvmem: Fix return type of devm_nvmem_device_get() in kerneldoc
Georg Gottleuber (1):
nvme-pci: Add sleep quirk for Samsung 990 Evo
Greg Kroah-Hartman (1):
Linux 5.15.167
Guenter Roeck (4):
hwmon: (adc128d818) Fix underflows seen when writing limit attributes
hwmon: (lm95234) Fix underflows seen when writing limit attributes
hwmon: (nct6775-core) Fix underflows seen when writing limit attributes
hwmon: (w83627ehf) Fix underflows seen when writing limit attributes
Guillaume Nault (1):
bareudp: Fix device stats updates.
Hans Verkuil (2):
media: vivid: fix wrong sizeimage value for mplane
media: vivid: don't set HDMI TX controls if there are no HDMI outputs
Haoran Liu (1):
drm/meson: plane: Add error handling
Heiko Carstens (1):
s390/vmlinux.lds.S: Move ro_after_init section behind rodata section
Hersen Wu (3):
drm/amd/display: Stop amdgpu_dm initialize when stream nums greater than 6 drm/amd/display: Add array index check for hdcp ddc access drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create
Jacky Bai (2):
clocksource/drivers/imx-tpm: Fix return -ETIME when delta exceeds INT_MAX clocksource/drivers/imx-tpm: Fix next event not taking effect sometime
Jacob Pan (1):
iommu/vt-d: Handle volatile descriptor status read
Jagadeesh Kona (1):
cpufreq: scmi: Avoid overflow of target_freq in fast switch
Jakub Kicinski (1):
net: usb: don't write directly to netdev->dev_addr
James Morse (1):
arm64: acpi: Move get_cpu_for_acpi_id() to a header
Jan Kara (3):
udf: Limit file size to 4TB
ext4: handle redirtying in ext4_bio_write_page()
udf: Avoid excessive partition lengths
Jann Horn (1):
fuse: use unsigned type for getxattr/listxattr size truncation
Jarkko Nikula (1):
i3c: mipi-i3c-hci: Error out instead on BUG_ON() in IBI DMA setup
Jernej Skrabec (1):
iommu: sun50i: clear bypass register
Jesse Zhang (6):
drm/amd/pm: fix warning using uninitialized value of max_vid_step drm/amd/pm: fix the Out-of-bounds read warning drm/amdgpu: fix the waring dereferencing hive drm/amd/pm: check specific index for aldebaran drm/amdgpu: the warning dereferencing obj for nbio_v7_4 drm/amd/pm: check negtive return for table entries
Jiaxun Yang (1):
MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed
Joanne Koong (1):
fuse: update stats for pages in dropped aux writeback list
Johannes Berg (2):
wifi: cfg80211: make hash table duplicates more survivable
um: line: always fill *error_out in setup_one_line()
Jonas Gorski (1):
net: bridge: br_fdb_external_learn_add(): always set EXT_LEARN
Jonathan Cameron (3):
ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add()
ACPI: processor: Fix memory leaks in error paths of processor_add()
arm64: acpi: Harden get_cpu_for_acpi_id() against missing CPU entry
Josef Bacik (2):
btrfs: replace BUG_ON with ASSERT in walk_down_proc()
btrfs: clean up our handling of refs == 0 in snapshot delete
Jules Irenge (1):
pcmcia: Use resource_size function on resource object
Kent Overstreet (1):
lib/generic-radix-tree.c: Fix rare race in __genradix_ptr_alloc()
Kishon Vijay Abraham I (1):
PCI: keystone: Add workaround for Errata #i2037 (AM65x SR 1.0)
Konstantin Andreev (1):
smack: unix sockets: fix accept()ed socket label
Konstantin Komarov (1):
fs/ntfs3: Check more cases when directory is corrupted
Krishna Kumar (1):
pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv
Krzysztof Kozlowski (1):
gpio: rockchip: fix OF node leak in probe()
Kuniyuki Iwashima (3):
af_unix: Remove put_pid()/put_cred() in copy_peercred().
can: bcm: Remove proc entry when dev is unregistered.
fou: Fix null-ptr-deref in GRO.
Larysa Zaremba (1):
ice: check ICE_VSI_DOWN under rtnl_lock when preparing for reset
Leesoo Ahn (1):
apparmor: fix possible NULL pointer dereference
Liao Chen (1):
mmc: sdhci-of-aspeed: fix module autoloading
Luis Henriques (SUSE) (1):
ext4: fix possible tid_t sequence overflows
Luiz Augusto von Dentz (2):
Revert "Bluetooth: MGMT/SMP: Fix address type when using SMP over BREDR/LE"
Bluetooth: MGMT: Ignore keys being loaded with invalid type
Ma Jun (7):
drm/amdgpu: Fix uninitialized variable warning in amdgpu_afmt_acr drm/amdgpu/pm: Check the return value of smum_send_msg_to_smc drm/amdgpu/pm: Fix uninitialized variable warning for smu10 drm/amdgpu/pm: Fix uninitialized variable agc_btc_response drm/amdgpu: Fix out-of-bounds write warning
drm/amdgpu: Fix out-of-bounds read of df_v1_7_channel_number drm/amdgpu/pm: Check input value for CUSTOM profile mode setting on legacy SOCs
Ma Ke (1):
irqchip/gic-v2m: Fix refcount leak in gicv2m_of_init()
Marek Olšák (1):
drm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6
Marek Vasut (1):
drm/bridge: tc358767: Check if fully initialized before signalling HPD event via IRQ
Matteo Martelli (2):
iio: fix scale application in iio_convert_raw_to_processed_unlocked
ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode
Matthieu Baerts (NGI0) (12):
mptcp: pm: re-using ID of unused flushed subflows
mptcp: pm: only decrement add_addr_accepted for MPJ req
mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR
mptcp: pm: fullmesh: select the right ID later
mptcp: pm: avoid possible UaF when selecting endp
mptcp: avoid duplicated SUB_CLOSED events
mptcp: close subflow when receiving TCP+FIN
mptcp: pm: ADD_ADDR 0 is not a new address
mptcp: pm: do not remove already closed subflows
mptcp: pm: skip connecting to already established sf
mptcp: pr_debug: add missing \n at the end
mptcp: pm: send ACK on an active subflow
Maurizio Lombardi (1):
nvmet-tcp: fix kernel crash if commands allocation fails
Maxim Levitsky (1):
KVM: SVM: fix emulation of msr reads/writes of MSR_FS_BASE and MSR_GS_BASE
Maximilien Perreault (1):
ALSA: hda/realtek: Support mute LED on HP Laptop 14-dq2xxx
Michael Chen (1):
drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device
Michael Ellerman (1):
ata: pata_macio: Use WARN instead of BUG
Michael Margolin (1):
RDMA/efa: Properly handle unexpected AQ completions
Naman Jain (1):
Drivers: hv: vmbus: Fix rescind handling in uio_hv_generic
Namjae Jeon (1):
ksmbd: unset the binding mark of a reused connection
Nicholas Piggin (2):
workqueue: wq_watchdog_touch is always called with valid CPU
workqueue: Improve scalability of workqueue watchdog touch
Nikita Kiryushin (1):
rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow
Oliver Neukum (2):
usbnet: modern method to get random MAC
usbnet: ipheth: race between ipheth_close and error handling
Olivier Sobrie (1):
HID: amd_sfh: free driver_data after destroying hid device
Pali Rohár (1):
irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1
Paolo Abeni (1):
mptcp: constify a bunch of of helpers
Pawel Dembicki (1):
net: dsa: vsc73xx: fix possible subblocks range of CAPT block
Peter Zijlstra (1):
perf/aux: Fix AUX buffer serialization
Philip Mueller (1):
drm: panel-orientation-quirks: Add quirk for OrangePi Neo
Phillip Lougher (1):
Squashfs: sanity check symbolic link size
Qing Wang (1):
nilfs2: replace snprintf in show functions with sysfs_emit
Ravi Bangoria (1):
KVM: SVM: Don't advertise Bus Lock Detect to guest if SVM support is missing
Ricardo Ribalda (1):
media: uvcvideo: Enforce alignment of frame and interval
Richard Fitzgerald (2):
i2c: Fix conditional for substituting empty ACPI functions
i2c: Use IS_REACHABLE() for substituting empty ACPI functions
Richard Maina (1):
hwspinlock: Introduce hwspin_lock_bust()
Rik van Riel (1):
dma-debug: avoid deadlock between dma debug vs printk and netconsole
Roland Xu (1):
rtmutex: Drop rt_mutex::wait_lock before scheduling
Ronnie Sahlberg (1):
cifs: Check the lease context if we actually got a lease
Ryusuke Konishi (3):
nilfs2: fix missing cleanup on rollforward recovery error
nilfs2: fix state management in error path of log writing function
nilfs2: protect references to superblock parameters exposed in sysfs
Sam Protsenko (1):
mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K
Sascha Hauer (1):
wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id()
Satya Priya Kakitapalli (2):
clk: qcom: clk-alpha-pll: Fix the pll post div mask
clk: qcom: clk-alpha-pll: Fix the trion pll postdiv set rate API
Saurabh Sengar (1):
uio_hv_generic: Fix kernel NULL pointer dereference in hv_uio_rescind
Seunghwan Baek (1):
mmc: cqhci: Fix checking of CQHCI_HALT state
Shahar S Matityahu (1):
wifi: iwlwifi: remove fw_running op
Shakeel Butt (1):
memcg: protect concurrent access to mem_cgroup_idr
Shannon Nelson (1):
ionic: fix potential irq name truncation
Shantanu Goel (1):
usb: uas: set host status byte on data completion error
Simon Arlott (1):
can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open
Simon Holesch (1):
usbip: Don't submit special requests twice
Simon Horman (1):
can: m_can: Release irq on error in m_can_open
Stefan Wiehler (1):
of/irq: Prevent device address out-of-bounds read in interrupt map walk
Stephen Hemminger (1):
sch/netem: fix use after free in netem_dequeue
Sven Schnelle (1):
uprobes: Use kzalloc to allocate xol area
Takashi Iwai (3):
ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
ALSA: hda/conexant: Mute speakers at suspend / shutdown
ALSA: hda: Add input value sanity checks to HDMI channel map controls
Tao Zhou (1):
drm/amdgpu: update type of buf size to u32 for eeprom functions
Terry Cheong (1):
ALSA: hda/realtek: add patch for internal mic in Lenovo V145
Thomas Gleixner (1):
x86/mm: Fix PTI for i386 some more
Tim Huang (6):
drm/amdgpu: fix overflowed array index read warning drm/amd/pm: fix uninitialized variable warning for smu8_hwmgr drm/amdgpu: fix uninitialized scalar variable warning drm/amd/pm: fix uninitialized variable warnings for vega10_hwmgr drm/amdgpu: fix ucode out-of-bounds read warning drm/amdgpu: fix mc_data out-of-bounds read warning
Toke Høiland-Jørgensen (1):
sched: sch_cake: fix bulk flow accounting logic for host fairness
Trond Myklebust (1):
NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations
Vladimir Oltean (1):
net: dpaa: avoid on-stack arrays of NR_CPUS elements
Waiman Long (1):
cgroup: Protect css->cgroup write under css_set_lock
Willem de Bruijn (2):
net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation
net: drop bad gso csum_start and offset in virtio_net_hdr
Yan Zhai (1):
gso: fix dodgy bit handling for GSO_UDP_L4
Yicong Yang (1):
dma-mapping: benchmark: Don't starve others when doing the test
Yifan Zha (1):
drm/amdgpu: Set no_hw_access when VF request full GPU fails
Yunjian Wang (1):
netfilter: nf_conncount: fix wrong variable type
Yuri Benditovich (1):
net: change maximum number of UDP segments to 128
ZHANG Yuntian (1):
net: usb: qmi_wwan: add MeiG Smart SRM825L
Zenghui Yu (1):
kselftests: dmabuf-heaps: Ensure the driver name is null-terminated
Zheng Qixing (1):
ata: libata: Fix memory leak for error path in ata_host_alloc()
Zheng Yejian (1):
tracing: Avoid possible softlockup in tracing_iter_reset()
Zhigang Luo (1):
drm/amdgpu: avoid reading vf2pf info size from FB
Zijun Hu (1):
devres: Initialize an uninitialized struct member
Zqiang (1):
smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu()
robelin (1):
ASoC: dapm: Fix UAF for snd_soc_pcm_runtime object
yang.zhang (1):
riscv: set trap vector earlier
Greg Kroah-Hartman
maintainerDocumentation/locking/hwspinlock.rst +11 -0
@@ -85,6 +85,17 @@ is already free). Should be called from a process context (might sleep). +:: + + int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id); + +After verifying the owner of the hwspinlock, release a previously acquired +hwspinlock; returns 0 on success, or an appropriate error code on failure +(e.g. -EOPNOTSUPP if the bust operation is not defined for the specific +hwspinlock). + +Should be called from a process context (might sleep). + :: int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 15 -SUBLEVEL = 166 +SUBLEVEL = 167 EXTRAVERSION = NAME = Trick or Treat
arch/arm64/include/asm/acpi.h +12 -0
@@ -97,6 +97,18 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)return acpi_cpu_get_madt_gicc (cpu)->uid; } +static inline int get_cpu_for_acpi_id (u32 uid) +{ +int cpu; + +for (cpu =0 ; cpu < nr_cpu_ids; cpu++) +if (acpi_cpu_get_madt_gicc (cpu) && + uid ==get_acpi_id_for_cpu (cpu)) +return cpu; + +return -EINVAL ; +} +static inline void arch_fix_phys_package_id (int num,u32 slot) { }void __init acpi_init_cpus (void );int apei_claim_sea (struct pt_regs *regs);
arch/arm64/kernel/acpi_numa.c +0 -11
@@ -34,17 +34,6 @@ int __init acpi_numa_get_nid(unsigned int cpu)return acpi_early_node_map[cpu]; } -static inline int get_cpu_for_acpi_id (u32 uid) -{ -int cpu; - -for (cpu =0 ; cpu < nr_cpu_ids; cpu++) -if (uid ==get_acpi_id_for_cpu (cpu)) -return cpu; - -return -EINVAL ; -} -static int __init acpi_parse_gicc_pxm (union acpi_subtable_headers *header,const unsigned long end) {
arch/mips/kernel/cevt-r4k.c +7 -8
@@ -303,13 +303,6 @@ int r4k_clockevent_init(void)if (!c0_compare_int_usable ())return -ENXIO ; -/* -* With vectored interrupts things are getting platform specific. -* get_c0_compare_int is a hook to allow a platform to return the -* interrupt number of its liking. -*/ - irq =get_c0_compare_int (); - cd = &per_cpu (mips_clockevent_device, cpu); cd->name ="MIPS" ;
@@ -320,7 +313,6 @@ int r4k_clockevent_init(void) min_delta =calculate_min_delta (); cd->rating =300 ; - cd->irq = irq; cd->cpumask =cpumask_of (cpu); cd->set_next_event = mips_next_event; cd->event_handler = mips_event_handler;
@@ -332,6 +324,13 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; +/* +* With vectored interrupts things are getting platform specific. +* get_c0_compare_int is a hook to allow a platform to return the +* interrupt number of its liking. +*/ + irq =get_c0_compare_int (); +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , c0_compare_interrupt))pr_err ("Failed to request irq %d (timer)\n" , irq);
arch/riscv/kernel/head.S +3 -0
@@ -309,6 +309,9 @@ clear_bss_done: #else mv a0, s1 #endif /* CONFIG_BUILTIN_DTB */ + /* Set trap vector to spin forever to help debug */ + la a3, .Lsecondary_park + csrw CSR_TVEC, a3 call setup_vm #ifdef CONFIG_MMU la a0, early_pg_dir
arch/s390/kernel/vmlinux.lds.S +9 -0
@@ -72,6 +72,15 @@ SECTIONS . = ALIGN(PAGE_SIZE); __end_ro_after_init = .; + .data.rel.ro : { + *(.data.rel.ro .data.rel.ro.*) + } + .got : { + __got_start = .; + *(.got) + __got_end = .; + } + RW_DATA(0x100, PAGE_SIZE, THREAD_SIZE) BOOT_DATA_PRESERVED
arch/um/drivers/line.c +2 -0
@@ -383,6 +383,7 @@ int setup_one_line(struct line *lines, int n, char *init,parse_chan_pair (NULL , line, n, opts, error_out); err =0 ; } + *error_out ="configured as 'none'" ; }else {char *new =kstrdup (init,GFP_KERNEL );if (!new) {
@@ -406,6 +407,7 @@ int setup_one_line(struct line *lines, int n, char *init, } }if (err) { + *error_out ="failed to parse channel pair" ; line->init_str =NULL ; line->valid =0 ;kfree (new);
arch/x86/kvm/svm/svm.c +15 -0
@@ -958,6 +958,9 @@ static __init void svm_set_cpu_caps(void)/* CPUID 0x8000001F (SME/SEV features) */ sev_set_cpu_caps (); + +/* Don't advertise Bus Lock Detect to guest if SVM support is absent */ +kvm_cpu_cap_clear (X86_FEATURE_BUS_LOCK_DETECT ); }static __init int svm_hardware_setup (void )
@@ -2712,6 +2715,12 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)case MSR_CSTAR : msr_info->data = svm->vmcb01.ptr->save.cstar;break ; +case MSR_GS_BASE : + msr_info->data = svm->vmcb01.ptr->save.gs.base; +break ; +case MSR_FS_BASE : + msr_info->data = svm->vmcb01.ptr->save.fs.base; +break ;case MSR_KERNEL_GS_BASE : msr_info->data = svm->vmcb01.ptr->save.kernel_gs_base;break ;
@@ -2923,6 +2932,12 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)case MSR_CSTAR : svm->vmcb01.ptr->save.cstar = data;break ; +case MSR_GS_BASE : + svm->vmcb01.ptr->save.gs.base = data; +break ; +case MSR_FS_BASE : + svm->vmcb01.ptr->save.fs.base = data; +break ;case MSR_KERNEL_GS_BASE : svm->vmcb01.ptr->save.kernel_gs_base = data;break ;
arch/x86/mm/pti.c +29 -16
117 lines not on this page · raw message
block/blk-integrity.c +0 -2
@@ -431,8 +431,6 @@ void blk_integrity_unregister(struct gendisk *disk)if (!bi->profile)return ; -/* ensure all bios are off the integrity workqueue */ -blk_flush_integrity ();blk_queue_flag_clear (QUEUE_FLAG_STABLE_WRITES , disk->queue);memset (bi,0 ,sizeof (*bi)); }
drivers/acpi/acpi_processor.c +8 -7
@@ -373,7 +373,7 @@ static int acpi_processor_add(struct acpi_device *device, result =acpi_processor_get_info (device);if (result)/* Processor is not physically present or unavailable */ -return 0 ; + goto err_clear_driver_data;BUG_ON (pr->id >= nr_cpu_ids);
@@ -388,7 +388,7 @@ static int acpi_processor_add(struct acpi_device *device,"BIOS reported wrong ACPI id %d for the processor\n" , pr->id);/* Give up, but do not abort the namespace scan. */ - goto err; + goto err_clear_driver_data; }/* * processor_device_array is not cleared on errors to allow buggy BIOS
@@ -400,12 +400,12 @@ static int acpi_processor_add(struct acpi_device *device, dev =get_cpu_device (pr->id);if (!dev) { result = -ENODEV ; - goto err; + goto err_clear_per_cpu; } result =acpi_bind_one (dev, device);if (result) - goto err; + goto err_clear_per_cpu; pr->dev = dev;
@@ -416,10 +416,11 @@ static int acpi_processor_add(struct acpi_device *device,dev_err (dev,"Processor driver could not be attached\n" );acpi_unbind_one (dev); - err: -free_cpumask_var (pr->throttling.shared_cpu_map); - device->driver_data =NULL ; + err_clear_per_cpu:per_cpu (processors, pr->id) =NULL ; + err_clear_driver_data: + device->driver_data =NULL ; +free_cpumask_var (pr->throttling.shared_cpu_map); err_free_pr:kfree (pr);return result;
drivers/android/binder.c +1 -0
@@ -3173,6 +3173,7 @@ static void binder_transaction(struct binder_proc *proc,*/ copy_size = object_offset - user_offset; if (copy_size && (user_offset > object_offset || + object_offset > tr->data_size || binder_alloc_copy_user_to_buffer( &target_proc->alloc, t->buffer, user_offset,
drivers/ata/libata-core.c +3 -1
@@ -5454,8 +5454,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports) } dr =devres_alloc (ata_devres_release,0 ,GFP_KERNEL ); -if (!dr) +if (!dr) { +kfree (host); goto err_out; + }devres_add (dev, dr);dev_set_drvdata (dev, host);
drivers/ata/pata_macio.c +5 -2
@@ -540,7 +540,8 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)while (sg_len) {/* table overflow should never happen */ -BUG_ON (pi++ >=MAX_DCMDS ); +if (WARN_ON_ONCE (pi >=MAX_DCMDS )) +return AC_ERR_SYSTEM ; len = (sg_len <MAX_DBDMA_SEG ) ? sg_len :MAX_DBDMA_SEG ; table->command =cpu_to_le16 (write ?OUTPUT_MORE :INPUT_MORE );
@@ -552,11 +553,13 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc) addr += len; sg_len -= len; ++table; + ++pi; } }/* Should never happen according to Tejun */ -BUG_ON (!pi); +if (WARN_ON_ONCE (!pi)) +return AC_ERR_SYSTEM ;/* Convert the last command to an input/output */ table--;
drivers/base/devres.c +1 -0
@@ -562,6 +562,7 @@ void * devres_open_group(struct device *dev, void *id, gfp_t gfp) grp->id = grp;if (id) grp->id = id; + grp->color =0 ;spin_lock_irqsave (&dev->devres_lock, flags);add_dr (dev, &grp->node[0 ]);
drivers/clk/qcom/clk-alpha-pll.c +3 -3
@@ -38,7 +38,7 @@#define PLL_USER_CTL (p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])# define PLL_POST_DIV_SHIFT 8 -# define PLL_POST_DIV_MASK (p) GENMASK((p)->width, 0) +# define PLL_POST_DIV_MASK (p) GENMASK((p)->width - 1, 0)# define PLL_ALPHA_EN BIT(24)# define PLL_ALPHA_MODE BIT(25)# define PLL_VCO_SHIFT 20
@@ -1362,8 +1362,8 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate, }return regmap_update_bits (regmap,PLL_USER_CTL (pll), -PLL_POST_DIV_MASK (pll) <<PLL_POST_DIV_SHIFT , - val <<PLL_POST_DIV_SHIFT ); +PLL_POST_DIV_MASK (pll) << pll->post_div_shift, + val << pll->post_div_shift); }const struct clk_ops clk_alpha_pll_postdiv_trion_ops = {
drivers/clocksource/timer-imx-tpm.c +12 -4
@@ -83,20 +83,28 @@ static u64 notrace tpm_read_sched_clock(void)static int tpm_set_next_event (unsigned long delta,struct clock_event_device *evt) { -unsigned long next, now; +unsigned long next, prev, now; - next =tpm_read_counter (); - next += delta; + prev =tpm_read_counter (); + next = prev + delta;writel (next, timer_base +TPM_C0V ); now =tpm_read_counter (); +/* +* Need to wait CNT increase at least 1 cycle to make sure +* the C0V has been updated into HW. +*/ +if ((next &0xffffffff ) !=readl (timer_base +TPM_C0V )) +while (now ==tpm_read_counter ()) + ; +/* * NOTE: We observed in a very small probability, the bus fabric * contention between GPU and A7 may results a few cycles delay * of writing CNT registers which may cause the min_delta event got * missed, so we need add a ETIME check here in case it happened. */ -return (int )(next - now) <=0 ? -ETIME :0 ; +return (now - prev) >= delta ? -ETIME :0 ; }static int tpm_set_state_oneshot (struct clock_event_device *evt)
drivers/clocksource/timer-of.c +4 -13
@@ -25,10 +25,7 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)struct clock_event_device *clkevt = &to->clkevt; -if (of_irq->percpu) -free_percpu_irq (of_irq->irq, clkevt); -else -free_irq (of_irq->irq, clkevt); +free_irq (of_irq->irq, clkevt); }/**
@@ -42,9 +39,6 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)* - Get interrupt number by name * - Get interrupt number by index * -* When the interrupt is per CPU, 'request_percpu_irq()' is called, -* otherwise 'request_irq()' is used. -* * Returns 0 on success, < 0 otherwise */ static __init int timer_of_irq_init(struct device_node *np,
@@ -69,12 +63,9 @@ static __init int timer_of_irq_init(struct device_node *np,return -EINVAL ; } - ret = of_irq->percpu ? -request_percpu_irq (of_irq->irq, of_irq->handler, - np->full_name, clkevt) : -request_irq (of_irq->irq, of_irq->handler, - of_irq->flags ? of_irq->flags :IRQF_TIMER , - np->full_name, clkevt); + ret =request_irq (of_irq->irq, of_irq->handler, + of_irq->flags ? of_irq->flags :IRQF_TIMER , + np->full_name, clkevt);if (ret) {pr_err ("Failed to request irq %d for %pOF\n" , of_irq->irq, np);return ret;
drivers/clocksource/timer-of.h +0 -1
@@ -11,7 +11,6 @@struct of_timer_irq {int irq;int index; -int percpu;const char *name;unsigned long flags;irq_handler_t handler;
drivers/cpufreq/scmi-cpufreq.c +2 -2
@@ -61,9 +61,9 @@ static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq) {struct scmi_data *priv = policy->driver_data; +unsigned long freq = target_freq; -if (!perf_ops->freq_set (ph, priv->domain_id, - target_freq *1000 , true)) +if (!perf_ops->freq_set (ph, priv->domain_id, freq *1000 , true))return target_freq;return 0 ;
drivers/gpio/gpio-rockchip.c +1 -0
@@ -708,6 +708,7 @@ static int rockchip_gpio_probe(struct platform_device *pdev)return -ENODEV ; pctldev =of_pinctrl_get (pctlnp); +of_node_put (pctlnp);if (!pctldev)return -EPROBE_DEFER ;
drivers/gpu/drm/amd/amdgpu/amdgpu_afmt.c +1 -0
@@ -100,6 +100,7 @@ struct amdgpu_afmt_acr amdgpu_afmt_acr(uint32_t clock)amdgpu_afmt_calc_cts (clock, &res.cts_32khz, &res.n_32khz,32000 );amdgpu_afmt_calc_cts (clock, &res.cts_44_1khz, &res.n_44_1khz,44100 );amdgpu_afmt_calc_cts (clock, &res.cts_48khz, &res.n_48khz,48000 ); + res.clock = clock;return res; }
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +2 -0
@@ -1475,6 +1475,8 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev, (u32 )le32_to_cpu (*((u32 *)reg_data + j)); j++; }else if ((reg_table->mc_reg_address[i].pre_reg_data &LOW_NIBBLE_MASK ) ==DATA_EQU_PREV ) { +if (i ==0 ) +continue ; reg_table->mc_reg_table_entry[num_ranges].mc_data[i] = reg_table->mc_reg_table_entry[num_ranges].mc_data[i -1 ]; }
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +3 -0
@@ -213,6 +213,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,struct amdgpu_firmware_info *ucode; id =fw_type_convert (cgs_device, type); +if (id >=AMDGPU_UCODE_ID_MAXIMUM ) +return -EINVAL ; + ucode = &adev->firmware.ucode[id];if (ucode->fw ==NULL )return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
@@ -4406,7 +4406,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) shadow = vmbo->shadow;/* No need to recover an evicted BO */ -if (shadow->tbo.resource->mem_type !=TTM_PL_TT || +if (!shadow->tbo.resource || + shadow->tbo.resource->mem_type !=TTM_PL_TT || shadow->tbo.resource->start ==AMDGPU_BO_INVALID_OFFSET || shadow->parent->tbo.resource->mem_type !=TTM_PL_VRAM )continue ;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -2
@@ -842,8 +842,7 @@ static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb) {u64 micro_tile_mode; -/* Zero swizzle mode means linear */ -if (AMDGPU_TILING_GET (afb->tiling_flags,SWIZZLE_MODE ) ==0 ) +if (AMDGPU_TILING_GET (afb->tiling_flags,ARRAY_MODE ) ==1 )/* LINEAR_ALIGNED */ return 0 ; micro_tile_mode =AMDGPU_TILING_GET (afb->tiling_flags,MICRO_TILE_MODE );
drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c +3 -3
@@ -177,7 +177,7 @@ static int __amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,* Returns the number of bytes read/written; -errno on error. */ static int amdgpu_eeprom_xfer (struct i2c_adapter *i2c_adap,u32 eeprom_addr, -u8 *eeprom_buf,u16 buf_size,bool read) +u8 *eeprom_buf,u32 buf_size,bool read) {const struct i2c_adapter_quirks *quirks = i2c_adap->quirks;u16 limit;
@@ -224,7 +224,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,int amdgpu_eeprom_read (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes) +u32 bytes) {return amdgpu_eeprom_xfer (i2c_adap, eeprom_addr, eeprom_buf, bytes, true);
@@ -232,7 +232,7 @@ int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,int amdgpu_eeprom_write (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes) +u32 bytes) {return amdgpu_eeprom_xfer (i2c_adap, eeprom_addr, eeprom_buf, bytes, false);
drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.h +2 -2
@@ -28,10 +28,10 @@int amdgpu_eeprom_read (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes); +u32 bytes);int amdgpu_eeprom_write (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes); +u32 bytes);#endif
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -1178,6 +1178,9 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp,uint8_t dst_num_links = node_info.num_links; hive =amdgpu_get_xgmi_hive (psp->adev); +if (WARN_ON (!hive)) +return ; +list_for_each_entry (mirror_adev, &hive->device_list, gmc.xgmi.head) {struct psp_xgmi_topology_info *mirror_top_info;int j;
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -2
@@ -263,7 +263,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->max_dw = max_dw; ring->hw_prio = hw_prio; -if (!ring->no_scheduler) { +if (!ring->no_scheduler && ring->funcs->type <AMDGPU_HW_IP_NUM ) { hw_ip = ring->funcs->type; num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds; adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
@@ -367,8 +367,9 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, size_t size, loff_t *pos) { struct amdgpu_ring *ring = file_inode(f)->i_private; -int r, i;uint32_t value, result, early[3 ]; +loff_t i; +int r;if (*pos &3 || size &3 )return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +6 -2
@@ -122,8 +122,10 @@ int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init)if (virt->ops && virt->ops->req_full_gpu) { r = virt->ops->req_full_gpu (adev, init); -if (r) +if (r) { + adev->no_hw_access = true;return r; + } adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME ; }
@@ -410,6 +412,8 @@ static void amdgpu_virt_add_bad_page(struct amdgpu_device *adev,uint64_t retired_page;uint32_t bp_idx, bp_cnt; +memset (&bp,0 ,sizeof (bp)); +if (bp_block_size) { bp_cnt = bp_block_size /sizeof (uint64_t );for (bp_idx =0 ; bp_idx < bp_cnt; bp_idx++) {
@@ -584,7 +588,7 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev) vf2pf_info->checksum =amd_sriov_msg_checksum ( - vf2pf_info, vf2pf_info->header.size,0 ,0 ); + vf2pf_info,sizeof (*vf2pf_info),0 ,0 );return 0 ; }
drivers/gpu/drm/amd/amdgpu/df_v1_7.c +2 -0
@@ -70,6 +70,8 @@ static u32 df_v1_7_get_hbm_channel_number(struct amdgpu_device *adev)int fb_channel_number; fb_channel_number = adev->df.funcs->get_fb_channel_number (adev); +if (fb_channel_number >=ARRAY_SIZE (df_v1_7_channel_number)) + fb_channel_number =0 ;return df_v1_7_channel_number[fb_channel_number]; }
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +1 -1
@@ -370,7 +370,7 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_deviceelse WREG32_SOC15 (NBIO ,0 , mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); -if (!ras->disable_ras_err_cnt_harvest) { +if (ras && !ras->disable_ras_err_cnt_harvest && obj) {/* * clear error status after ras_controller_intr * according to hw team and count ue number
drivers/gpu/drm/amd/amdkfd/kfd_crat.h +0 -2
@@ -42,8 +42,6 @@#define CRAT_OEMTABLEID_LENGTH 8#define CRAT_RESERVED_LENGTH 6 -#define CRAT_OEMID_64BIT_MASK ((1ULL << (CRAT_OEMID_LENGTH * 8)) - 1) -/* Compute Unit flags */ #define COMPUTE_UNIT_CPU (1 << 0)/* Create Virtual CRAT for CPU */ #define COMPUTE_UNIT_GPU (1 << 1)/* Create Virtual CRAT for GPU */
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -2
@@ -910,8 +910,7 @@ static void kfd_update_system_properties(void) dev =list_last_entry (&topology_device_list, struct kfd_topology_device, list);if (dev) { - sys_props.platform_id = - (*((uint64_t *)dev->oem_id)) &CRAT_OEMID_64BIT_MASK ; + sys_props.platform_id = dev->oem_id64; sys_props.platform_oem = *((uint64_t *)dev->oem_table_id); sys_props.platform_rev = dev->oem_revision; }
drivers/gpu/drm/amd/amdkfd/kfd_topology.h +4 -1
@@ -184,7 +184,10 @@ struct kfd_topology_device {struct attribute attr_gpuid;struct attribute attr_name;struct attribute attr_props; -uint8_t oem_id[CRAT_OEMID_LENGTH ]; +union { +uint8_t oem_id[CRAT_OEMID_LENGTH ]; +uint64_t oem_id64; + };uint8_t oem_table_id[CRAT_OEMTABLEID_LENGTH ];uint32_t oem_revision; };
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
@@ -4211,7 +4211,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)/* There is one primary plane per CRTC */ primary_planes = dm->dc->caps.max_streams; -ASSERT (primary_planes <=AMDGPU_MAX_PLANES ); +if (primary_planes >AMDGPU_MAX_PLANES ) { +DRM_ERROR ("DM: Plane nums out of 6 planes\n" ); +return -EINVAL ; + }/* * Initialize primary planes, implicit planes for legacy IOCTLS.
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +2 -1
@@ -489,7 +489,8 @@ static void build_watermark_ranges(struct clk_bw_params *bw_params, struct pp_sm ranges->reader_wm_sets[num_valid_sets].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ;/* Modify previous watermark range to cover up to max */ - ranges->reader_wm_sets[num_valid_sets -1 ].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ; +if (num_valid_sets >0 ) + ranges->reader_wm_sets[num_valid_sets -1 ].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ; } num_valid_sets++; }
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1107,6 +1107,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)return NULL ;if (init_params->dce_environment ==DCE_ENV_VIRTUAL_HW ) { + dc->caps.linear_pitch_alignment =64 ;if (!dc_construct_ctx (dc, init_params)) goto destruct_dc; }else {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb_scl.c +3 -0
@@ -690,6 +690,9 @@ static void wbscl_set_scaler_filter(int pair;uint16_t odd_coef, even_coef; +if (!filter) +return ; +for (phase =0 ; phase < (NUM_PHASES /2 +1 ); phase++) {for (pair =0 ; pair < tap_pairs; pair++) { even_coef = filter[phase * taps +2 * pair];
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +13 -4
@@ -58,7 +58,7 @@ struct gpio_service *dal_gpio_service_create( struct dc_context *ctx) {struct gpio_service *service; -uint32_t index_of_id; +int32_t index_of_id; service =kzalloc (sizeof (struct gpio_service ),GFP_KERNEL );
@@ -114,7 +114,7 @@ struct gpio_service *dal_gpio_service_create(return service; failure_2: -while (index_of_id) { +while (index_of_id >0 ) { --index_of_id;kfree (service->busyness[index_of_id]); }
@@ -241,6 +241,9 @@ static bool is_pin_busy( enum gpio_id id, uint32_t en) { +if (id ==GPIO_ID_UNKNOWN ) +return false; +return service->busyness[id][en]; }
@@ -249,6 +252,9 @@ static void set_pin_busy( enum gpio_id id, uint32_t en) { +if (id ==GPIO_ID_UNKNOWN ) +return ; + service->busyness[id][en] = true; }
@@ -257,6 +263,9 @@ static void set_pin_free( enum gpio_id id, uint32_t en) { +if (id ==GPIO_ID_UNKNOWN ) +return ; + service->busyness[id][en] = false; }
@@ -265,7 +274,7 @@ enum gpio_result dal_gpio_service_lock( enum gpio_id id, uint32_t en) { -if (!service->busyness[id]) { +if (id !=GPIO_ID_UNKNOWN && !service->busyness[id]) {ASSERT_CRITICAL (false);return GPIO_RESULT_OPEN_FAILED ; }
@@ -279,7 +288,7 @@ enum gpio_result dal_gpio_service_unlock( enum gpio_id id, uint32_t en) { -if (!service->busyness[id]) { +if (id !=GPIO_ID_UNKNOWN && !service->busyness[id]) {ASSERT_CRITICAL (false);return GPIO_RESULT_OPEN_FAILED ; }
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +15 -2
@@ -131,13 +131,21 @@ static bool hdmi_14_process_transaction(const uint8_t hdcp_i2c_addr_link_primary =0x3a ;/* 0x74 >> 1*/ const uint8_t hdcp_i2c_addr_link_secondary =0x3b ;/* 0x76 >> 1*/ struct i2c_command i2c_command; -uint8_t offset = hdcp_i2c_offsets[message_info->msg_id]; +uint8_t offset;struct i2c_payload i2c_payloads[] = { - { true,0 ,1 , &offset }, + { true,0 ,1 ,0 },/* actual hdcp payload, will be filled later, zeroed for now*/ {0 } }; +if (message_info->msg_id ==HDCP_MESSAGE_ID_INVALID ) { +DC_LOG_ERROR ("%s: Invalid message_info msg_id - %d\n" , __func__, message_info->msg_id); +return false; + } + + offset = hdcp_i2c_offsets[message_info->msg_id]; + i2c_payloads[0 ].data = &offset; +switch (message_info->link) {case HDCP_LINK_SECONDARY : i2c_payloads[0 ].address = hdcp_i2c_addr_link_secondary;
@@ -311,6 +319,11 @@ static bool dp_11_process_transaction( struct dc_link *link, struct hdcp_protection_message *message_info) { +if (message_info->msg_id ==HDCP_MESSAGE_ID_INVALID ) { +DC_LOG_ERROR ("%s: Invalid message_info msg_id - %d\n" , __func__, message_info->msg_id); +return false; + } + return dpcd_access_helper( link, message_info->length,
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c +9 -6
@@ -433,17 +433,20 @@ static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp, }if (status ==MOD_HDCP_STATUS_SUCCESS ) -mod_hdcp_execute_and_set (mod_hdcp_read_bstatus, +if (!mod_hdcp_execute_and_set (mod_hdcp_read_bstatus, &input->bstatus_read, &status, - hdcp,"bstatus_read" ); + hdcp,"bstatus_read" )) + goto out;if (status ==MOD_HDCP_STATUS_SUCCESS ) -mod_hdcp_execute_and_set (check_link_integrity_dp, +if (!mod_hdcp_execute_and_set (check_link_integrity_dp, &input->link_integrity_check, &status, - hdcp,"link_integrity_check" ); + hdcp,"link_integrity_check" )) + goto out;if (status ==MOD_HDCP_STATUS_SUCCESS ) -mod_hdcp_execute_and_set (check_no_reauthentication_request_dp, +if (!mod_hdcp_execute_and_set (check_no_reauthentication_request_dp, &input->reauth_request_check, &status, - hdcp,"reauth_request_check" ); + hdcp,"reauth_request_check" )) + goto out; out:return status; }
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c +24 -4
@@ -156,11 +156,16 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp,uint32_t cur_size =0 ;uint32_t data_offset =0 ; -if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID ) { +if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID || + msg_id >=MOD_HDCP_MESSAGE_ID_MAX )return MOD_HDCP_STATUS_DDC_FAILURE ; - }if (is_dp_hdcp (hdcp)) { +int num_dpcd_addrs =sizeof (hdcp_dpcd_addrs) / +sizeof (hdcp_dpcd_addrs[0 ]); +if (msg_id >= num_dpcd_addrs) +return MOD_HDCP_STATUS_DDC_FAILURE ; +while (buf_len >0 ) { cur_size =MIN (buf_len,HDCP_MAX_AUX_TRANSACTION_SIZE ); success = hdcp->config.ddc.funcs.read_dpcd(hdcp->config.ddc.handle,
@@ -175,6 +180,11 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp, data_offset += cur_size; } }else { +int num_i2c_offsets =sizeof (hdcp_i2c_offsets) / +sizeof (hdcp_i2c_offsets[0 ]); +if (msg_id >= num_i2c_offsets) +return MOD_HDCP_STATUS_DDC_FAILURE ; + success = hdcp->config.ddc.funcs.read_i2c( hdcp->config.ddc.handle, HDCP_I2C_ADDR,
@@ -219,11 +229,16 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp,uint32_t cur_size =0 ;uint32_t data_offset =0 ; -if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID ) { +if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID || + msg_id >=MOD_HDCP_MESSAGE_ID_MAX )return MOD_HDCP_STATUS_DDC_FAILURE ; - }if (is_dp_hdcp (hdcp)) { +int num_dpcd_addrs =sizeof (hdcp_dpcd_addrs) / +sizeof (hdcp_dpcd_addrs[0 ]); +if (msg_id >= num_dpcd_addrs) +return MOD_HDCP_STATUS_DDC_FAILURE ; +while (buf_len >0 ) { cur_size =MIN (buf_len,HDCP_MAX_AUX_TRANSACTION_SIZE ); success = hdcp->config.ddc.funcs.write_dpcd(
@@ -239,6 +254,11 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp, data_offset += cur_size; } }else { +int num_i2c_offsets =sizeof (hdcp_i2c_offsets) / +sizeof (hdcp_i2c_offsets[0 ]); +if (msg_id >= num_i2c_offsets) +return MOD_HDCP_STATUS_DDC_FAILURE ; + hdcp->buf[0 ] = hdcp_i2c_offsets[msg_id];memmove (&hdcp->buf[1 ], buf, buf_len); success = hdcp->config.ddc.funcs.write_i2c(
drivers/gpu/drm/amd/pm/powerplay/hwmgr/pp_psm.c +8 -5
@@ -30,9 +30,8 @@ int psm_init_power_state_table(struct pp_hwmgr *hwmgr) {int result;unsigned int i; -unsigned int table_entries;struct pp_power_state *state; -int size; +int size, table_entries;if (hwmgr->hwmgr_func->get_num_of_pp_table_entries ==NULL )return 0 ;
@@ -40,15 +39,19 @@ int psm_init_power_state_table(struct pp_hwmgr *hwmgr)if (hwmgr->hwmgr_func->get_power_state_size ==NULL )return 0 ; - hwmgr->num_ps = table_entries = hwmgr->hwmgr_func->get_num_of_pp_table_entries (hwmgr); + table_entries = hwmgr->hwmgr_func->get_num_of_pp_table_entries (hwmgr); - hwmgr->ps_size = size = hwmgr->hwmgr_func->get_power_state_size (hwmgr) + + size = hwmgr->hwmgr_func->get_power_state_size (hwmgr) +sizeof (struct pp_power_state ); -if (table_entries ==0 || size ==0 ) { +if (table_entries <=0 || size ==0 ) {pr_warn ("Please check whether power state management is supported on this asic\n" ); + hwmgr->num_ps =0 ; + hwmgr->ps_size =0 ;return 0 ; } + hwmgr->num_ps = table_entries; + hwmgr->ps_size = size; hwmgr->ps =kcalloc (table_entries, size,GFP_KERNEL );if (hwmgr->ps ==NULL )
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +3 -2
@@ -73,8 +73,9 @@ static int atomctrl_retrieve_ac_timing( j++; }else if ((table->mc_reg_address[i].uc_pre_reg_data &LOW_NIBBLE_MASK ) ==DATA_EQU_PREV ) { - table->mc_reg_table_entry[num_ranges].mc_data[i] = - table->mc_reg_table_entry[num_ranges].mc_data[i-1 ]; +if (i) + table->mc_reg_table_entry[num_ranges].mc_data[i] = + table->mc_reg_table_entry[num_ranges].mc_data[i-1 ]; } } num_ranges++;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +22 -7
@@ -1026,7 +1026,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,switch (type) {case PP_SCLK : -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now); +if (ret) +return ret;/* driver only know min/max gfx_clk, Add level 1 for all other gfx clks */ if (now == data->gfx_max_freq_limit/100 )
@@ -1047,7 +1049,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, i == 2 ? "*" : "");break ;case PP_MCLK : -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetFclkFrequency, &now); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetFclkFrequency, &now); +if (ret) +return ret;for (i =0 ; i < mclk_table->count; i++) size += sprintf(buf + size, "%d: %uMhz %s\n",
@@ -1547,7 +1551,10 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, }if (input[0 ] ==0 ) { -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); +if (ret) +return ret; +if (input[1 ] < min_freq) {pr_err ("Fine grain setting minimum sclk (%ld) MHz is less than the minimum allowed (%d) MHz\n" , input[1 ], min_freq);
@@ -1555,7 +1562,10 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, } smu10_data->gfx_actual_soft_min_freq = input[1 ]; }else if (input[0 ] ==1 ) { -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); +if (ret) +return ret; +if (input[1 ] > max_freq) {pr_err ("Fine grain setting maximum sclk (%ld) MHz is greater than the maximum allowed (%d) MHz\n" , input[1 ], max_freq);
@@ -1570,10 +1580,15 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr,pr_err ("Input parameter number not correct\n" );return -EINVAL ; } -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); - + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); +if (ret) +return ret; smu10_data->gfx_actual_soft_min_freq = min_freq; + + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); +if (ret) +return ret; + smu10_data->gfx_actual_soft_max_freq = max_freq; }else if (type ==PP_OD_COMMIT_DPM_TABLE ) {if (size !=0 ) {
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +1 -1
@@ -5597,7 +5597,7 @@ static int smu7_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint mode = input[size];switch (mode) {case PP_SMC_POWER_PROFILE_CUSTOM : -if (size <8 && size !=0 ) +if (size !=8 && size !=0 )return -EINVAL ;/* If only CUSTOM is passed in, use the saved values. Check * that we actually have a CUSTOM profile by ensuring that
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +12 -3
@@ -584,6 +584,7 @@ static int smu8_init_uvd_limit(struct pp_hwmgr *hwmgr) hwmgr->dyn_state.uvd_clock_voltage_dependency_table;unsigned long clock =0 ;uint32_t level; +int ret;if (NULL == table || table->count <=0 )return -EINVAL ;
@@ -591,7 +592,9 @@ static int smu8_init_uvd_limit(struct pp_hwmgr *hwmgr) data->uvd_dpm.soft_min_clk =0 ; data->uvd_dpm.hard_min_clk =0 ; -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxUvdLevel, &level); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxUvdLevel, &level); +if (ret) +return ret;if (level < table->count) clock = table->entries[level].vclk;
@@ -611,6 +614,7 @@ static int smu8_init_vce_limit(struct pp_hwmgr *hwmgr) hwmgr->dyn_state.vce_clock_voltage_dependency_table;unsigned long clock =0 ;uint32_t level; +int ret;if (NULL == table || table->count <=0 )return -EINVAL ;
@@ -618,7 +622,9 @@ static int smu8_init_vce_limit(struct pp_hwmgr *hwmgr) data->vce_dpm.soft_min_clk =0 ; data->vce_dpm.hard_min_clk =0 ; -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxEclkLevel, &level); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxEclkLevel, &level); +if (ret) +return ret;if (level < table->count) clock = table->entries[level].ecclk;
@@ -638,6 +644,7 @@ static int smu8_init_acp_limit(struct pp_hwmgr *hwmgr) hwmgr->dyn_state.acp_clock_voltage_dependency_table;unsigned long clock =0 ;uint32_t level; +int ret;if (NULL == table || table->count <=0 )return -EINVAL ;
@@ -645,7 +652,9 @@ static int smu8_init_acp_limit(struct pp_hwmgr *hwmgr) data->acp_dpm.soft_min_clk =0 ; data->acp_dpm.hard_min_clk =0 ; -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxAclkLevel, &level); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxAclkLevel, &level); +if (ret) +return ret;if (level < table->count) clock = table->entries[level].acpclk;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +71 -19
235 lines not on this page · raw message
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +15 -5
@@ -294,12 +294,12 @@ static int vega12_set_features_platform_caps(struct pp_hwmgr *hwmgr)return 0 ; } -static void vega12_init_dpm_defaults (struct pp_hwmgr *hwmgr) +static int vega12_init_dpm_defaults (struct pp_hwmgr *hwmgr) {struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);struct amdgpu_device *adev = hwmgr->adev;uint32_t top32, bottom32; -int i; +int i, ret; data->smu_features[GNLD_DPM_PREFETCHER ].smu_feature_id =FEATURE_DPM_PREFETCHER_BIT ;
@@ -365,10 +365,16 @@ static void vega12_init_dpm_defaults(struct pp_hwmgr *hwmgr) }/* Get the SN to turn into a Unique ID */ -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); +if (ret) +return ret; + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); +if (ret) +return ret; adev->unique_id = ((uint64_t )bottom32 <<32 ) | top32; + +return 0 ; }static int vega12_set_private_data_based_on_pptable (struct pp_hwmgr *hwmgr)
@@ -411,7 +417,11 @@ static int vega12_hwmgr_backend_init(struct pp_hwmgr *hwmgr)vega12_set_features_platform_caps (hwmgr); -vega12_init_dpm_defaults (hwmgr); + result =vega12_init_dpm_defaults (hwmgr); +if (result) { +pr_err ("%s failed\n" , __func__); +return result; + }/* Parse pptable data read from VBIOS */ vega12_set_private_data_based_on_pptable (hwmgr);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +23 -8
@@ -329,12 +329,12 @@ static int vega20_set_features_platform_caps(struct pp_hwmgr *hwmgr)return 0 ; } -static void vega20_init_dpm_defaults (struct pp_hwmgr *hwmgr) +static int vega20_init_dpm_defaults (struct pp_hwmgr *hwmgr) {struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);struct amdgpu_device *adev = hwmgr->adev;uint32_t top32, bottom32; -int i; +int i, ret; data->smu_features[GNLD_DPM_PREFETCHER ].smu_feature_id =FEATURE_DPM_PREFETCHER_BIT ;
@@ -405,10 +405,17 @@ static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr) }/* Get the SN to turn into a Unique ID */ -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); +if (ret) +return ret; + + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); +if (ret) +return ret; adev->unique_id = ((uint64_t )bottom32 <<32 ) | top32; + +return 0 ; }static int vega20_set_private_data_based_on_pptable (struct pp_hwmgr *hwmgr)
@@ -428,6 +435,7 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr) {struct vega20_hwmgr *data;struct amdgpu_device *adev = hwmgr->adev; +int result; data =kzalloc (sizeof (struct vega20_hwmgr ),GFP_KERNEL );if (data ==NULL )
@@ -453,8 +461,11 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr)vega20_set_features_platform_caps (hwmgr); -vega20_init_dpm_defaults (hwmgr); - + result =vega20_init_dpm_defaults (hwmgr); +if (result) { +pr_err ("%s failed\n" , __func__); +return result; + }/* Parse pptable data read from VBIOS */ vega20_set_private_data_based_on_pptable (hwmgr);
@@ -4098,9 +4109,11 @@ static int vega20_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uiif (power_profile_mode ==PP_SMC_POWER_PROFILE_CUSTOM ) {struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); -if (size ==0 && !data->is_custom_profile_set) + +if (size !=10 && size !=0 )return -EINVAL ; -if (size <10 && size !=0 ) + +if (size ==0 && !data->is_custom_profile_set)return -EINVAL ; result = vega20_get_activity_monitor_coeff(hwmgr,
@@ -4162,6 +4175,8 @@ static int vega20_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui activity_monitor.Fclk_PD_Data_error_coeff = input[8 ]; activity_monitor.Fclk_PD_Data_error_rate_coeff = input[9 ];break ; +default : +return -EINVAL ; } result = vega20_set_activity_monitor_coeff(hwmgr,
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +5 -1
@@ -130,13 +130,17 @@ int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr, uint64_t *features_enabled) {uint32_t enabled_features; +int ret;if (features_enabled ==NULL )return -EINVAL ; -smum_send_msg_to_smc (hwmgr, + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetEnabledSmuFeatures, &enabled_features); +if (ret) +return ret; + *features_enabled = enabled_features;return 0 ;
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +2 -1
@@ -1775,7 +1775,8 @@ static int aldebaran_mode2_reset(struct smu_context *smu) index =smu_cmn_to_asic_specific_index (smu,CMN2ASIC_MAPPING_MSG , SMU_MSG_GfxDeviceDriverReset); - +if (index <0 ) +return -EINVAL ;mutex_lock (&smu->message_lock);if (smu_version >=0x00441400 ) { ret =smu_cmn_send_msg_without_waiting (smu, (uint16_t )index,SMU_RESET_MODE_2 );
drivers/gpu/drm/bridge/tc358767.c +1 -1
@@ -1527,7 +1527,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg)dev_err (tc->dev,"syserr %x\n" , stat); } -if (tc->hpd_pin >=0 && tc->bridge.dev) { +if (tc->hpd_pin >=0 && tc->bridge.dev && tc->aux.drm_dev) {/* * H is triggered when the GPIO goes high. *
drivers/gpu/drm/drm_panel_orientation_quirks.c +6 -0
@@ -318,6 +318,12 @@ static const struct dmi_system_id orientation_data[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"), }, .driver_data = (void *)&lcd1600x2560_leftside_up, + }, { /* OrangePi Neo */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"OrangePi" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"), + }, + .driver_data = (void *)&lcd1200x1920_rightside_up, }, { /* Samsung GalaxyBook 10.6 */ .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
drivers/gpu/drm/i915/i915_sw_fence.c +4 -4
@@ -49,7 +49,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)debug_object_init (fence, &i915_sw_fence_debug_descr); } -static inline void debug_fence_init_onstack (struct i915_sw_fence *fence) +static inline __maybe_unused void debug_fence_init_onstack (struct i915_sw_fence *fence) {debug_object_init_on_stack (fence, &i915_sw_fence_debug_descr); }
@@ -75,7 +75,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence)debug_object_destroy (fence, &i915_sw_fence_debug_descr); } -static inline void debug_fence_free (struct i915_sw_fence *fence) +static inline __maybe_unused void debug_fence_free (struct i915_sw_fence *fence) {debug_object_free (fence, &i915_sw_fence_debug_descr);smp_wmb ();/* flush the change in state before reallocation */
@@ -92,7 +92,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence) { } -static inline void debug_fence_init_onstack (struct i915_sw_fence *fence) +static inline __maybe_unused void debug_fence_init_onstack (struct i915_sw_fence *fence) { }
@@ -113,7 +113,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence) { } -static inline void debug_fence_free (struct i915_sw_fence *fence) +static inline __maybe_unused void debug_fence_free (struct i915_sw_fence *fence) { }
drivers/gpu/drm/meson/meson_plane.c +11 -6
@@ -533,6 +533,7 @@ int meson_plane_create(struct meson_drm *priv)struct meson_plane *meson_plane;struct drm_plane *plane;const uint64_t *format_modifiers = format_modifiers_default; +int ret; meson_plane =devm_kzalloc (priv->drm->dev,sizeof (*meson_plane),GFP_KERNEL );
@@ -547,12 +548,16 @@ int meson_plane_create(struct meson_drm *priv)else if (meson_vpu_is_compatible (priv,VPU_COMPATIBLE_G12A )) format_modifiers = format_modifiers_afbc_g12a; -drm_universal_plane_init (priv->drm, plane,0xFF , - &meson_plane_funcs, - supported_drm_formats, -ARRAY_SIZE (supported_drm_formats), - format_modifiers, -DRM_PLANE_TYPE_PRIMARY ,"meson_primary_plane" ); + ret =drm_universal_plane_init (priv->drm, plane,0xFF , + &meson_plane_funcs, + supported_drm_formats, +ARRAY_SIZE (supported_drm_formats), + format_modifiers, +DRM_PLANE_TYPE_PRIMARY ,"meson_primary_plane" ); +if (ret) { +devm_kfree (priv->drm->dev, meson_plane); +return ret; + }drm_plane_helper_add (plane, &meson_plane_helper_funcs);
drivers/hid/amd-sfh-hid/amd_sfh_hid.c +3 -1
@@ -164,11 +164,13 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data)void amdtp_hid_remove (struct amdtp_cl_data *cli_data) {int i; +struct amdtp_hid_data *hid_data;for (i =0 ; i < cli_data->num_hid_devices; ++i) {if (cli_data->hid_sensor_hubs[i]) { -kfree (cli_data->hid_sensor_hubs[i]->driver_data); + hid_data = cli_data->hid_sensor_hubs[i]->driver_data;hid_destroy_device (cli_data->hid_sensor_hubs[i]); +kfree (hid_data); cli_data->hid_sensor_hubs[i] =NULL ; } }
drivers/hid/hid-cougar.c +1 -1
@@ -106,7 +106,7 @@ static void cougar_fix_g6_mapping(void)static __u8 *cougar_report_fixup (struct hid_device *hdev,__u8 *rdesc,unsigned int *rsize) { -if (rdesc[2 ] ==0x09 && rdesc[3 ] ==0x02 && +if (*rsize >=117 && rdesc[2 ] ==0x09 && rdesc[3 ] ==0x02 && (rdesc[115 ] | rdesc[116 ] <<8 ) >=HID_MAX_USAGES ) {hid_info (hdev,"usage count exceeds max: fixing up report descriptor\n" );
drivers/hv/vmbus_drv.c +1 -0
@@ -2008,6 +2008,7 @@ static umode_t vmbus_chan_attr_is_visible(struct kobject *kobj,return attr->mode; } +EXPORT_SYMBOL_GPL (vmbus_device_unregister);static struct attribute_group vmbus_chan_group = { .attrs = vmbus_chan_attrs,
drivers/hwmon/adc128d818.c +2 -2
@@ -176,7 +176,7 @@ static ssize_t adc128_in_store(struct device *dev,mutex_lock (&data->update_lock);/* 10 mV LSB on limit registers */ - regval =clamp_val (DIV_ROUND_CLOSEST (val,10 ),0 ,255 ); + regval =DIV_ROUND_CLOSEST (clamp_val (val,0 ,2550 ),10 ); data->in[index][nr] = regval <<4 ; reg = index ==1 ?ADC128_REG_IN_MIN (nr) :ADC128_REG_IN_MAX (nr);i2c_smbus_write_byte_data (data->client, reg, regval);
@@ -214,7 +214,7 @@ static ssize_t adc128_temp_store(struct device *dev,return err;mutex_lock (&data->update_lock); - regval =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),-128 ,127 ); + regval =DIV_ROUND_CLOSEST (clamp_val (val,-128000 ,127000 ),1000 ); data->temp[index] = regval <<1 ; i2c_smbus_write_byte_data(data->client, index == 1 ? ADC128_REG_TEMP_MAX
drivers/hwmon/lm95234.c +5 -4
@@ -301,7 +301,8 @@ static ssize_t tcrit2_store(struct device *dev, struct device_attribute *attr,if (ret <0 )return ret; - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),0 , index ?255 :127 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,0 , (index ?255 :127 ) *1000 ), +1000 );mutex_lock (&data->update_lock); data->tcrit2[index] = val;
@@ -350,7 +351,7 @@ static ssize_t tcrit1_store(struct device *dev, struct device_attribute *attr,if (ret <0 )return ret; - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),0 ,255 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,0 ,255000 ),1000 );mutex_lock (&data->update_lock); data->tcrit1[index] = val;
@@ -391,7 +392,7 @@ static ssize_t tcrit1_hyst_store(struct device *dev,if (ret <0 )return ret; - val =DIV_ROUND_CLOSEST (val,1000 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,-255000 ,255000 ),1000 ); val =clamp_val ((int )data->tcrit1[index] - val,0 ,31 );mutex_lock (&data->update_lock);
@@ -431,7 +432,7 @@ static ssize_t offset_store(struct device *dev, struct device_attribute *attr,return ret;/* Accuracy is 1/2 degrees C */ - val =clamp_val (DIV_ROUND_CLOSEST (val,500 ),-128 ,127 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,-64000 ,63500 ),500 );mutex_lock (&data->update_lock); data->toffset[index] = val;
drivers/hwmon/nct6775.c +1 -1
@@ -2374,7 +2374,7 @@ store_temp_offset(struct device *dev, struct device_attribute *attr,if (err <0 )return err; - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),-128 ,127 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,-128000 ,127000 ),1000 );mutex_lock (&data->update_lock); data->temp_offset[nr] = val;
drivers/hwmon/w83627ehf.c +2 -2
@@ -895,7 +895,7 @@ store_target_temp(struct device *dev, struct device_attribute *attr,if (err <0 )return err; - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),0 ,127 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,0 ,127000 ),1000 );mutex_lock (&data->update_lock); data->target_temp[nr] = val;
@@ -920,7 +920,7 @@ store_tolerance(struct device *dev, struct device_attribute *attr,return err;/* Limit the temp to 0C - 15C */ - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),0 ,15 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,0 ,15000 ),1000 );mutex_lock (&data->update_lock); reg =w83627ehf_read_value (data,W83627EHF_REG_TOLERANCE [nr]);
drivers/hwspinlock/hwspinlock_core.c +28 -0
@@ -302,6 +302,34 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) }EXPORT_SYMBOL_GPL (__hwspin_unlock); +/** +* hwspin_lock_bust() - bust a specific hwspinlock +* @hwlock: a previously-acquired hwspinlock which we want to bust +* @id: identifier of the remote lock holder, if applicable +* +* This function will bust a hwspinlock that was previously acquired as +* long as the current owner of the lock matches the id given by the caller. +* +* Context: Process context. +* +* Returns: 0 on success, or -EINVAL if the hwspinlock does not exist, or +* the bust operation fails, and -EOPNOTSUPP if the bust operation is not +* defined for the hwspinlock. +*/ +int hwspin_lock_bust (struct hwspinlock *hwlock,unsigned int id) +{ +if (WARN_ON (!hwlock)) +return -EINVAL ; + +if (!hwlock->bank->ops->bust) { +pr_err ("bust operation not defined\n" ); +return -EOPNOTSUPP ; + } + +return hwlock->bank->ops->bust (hwlock, id); +} +EXPORT_SYMBOL_GPL (hwspin_lock_bust); +/** * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id * @bank: the hwspinlock device bank
drivers/hwspinlock/hwspinlock_internal.h +3 -0
@@ -21,6 +21,8 @@ struct hwspinlock_device;* @trylock: make a single attempt to take the lock. returns 0 on * failure and true on success. may _not_ sleep. * @unlock: release the lock. always succeed. may _not_ sleep. +* @bust: optional, platform-specific bust handler, called by hwspinlock +* core to bust a specific lock. * @relax: optional, platform-specific relax handler, called by hwspinlock * core while spinning on a lock, between two successive * invocations of @trylock. may _not_ sleep.
@@ -28,6 +30,7 @@ struct hwspinlock_device;struct hwspinlock_ops {int (*trylock)(struct hwspinlock *lock);void (*unlock)(struct hwspinlock *lock); +int (*bust)(struct hwspinlock *lock,unsigned int id);void (*relax)(struct hwspinlock *lock); };
drivers/i3c/master/mipi-i3c-hci/dma.c +4 -1
@@ -291,7 +291,10 @@ static int hci_dma_init(struct i3c_hci *hci) rh->ibi_chunk_sz =dma_get_cache_alignment (); rh->ibi_chunk_sz *=IBI_CHUNK_CACHELINES ; -BUG_ON (rh->ibi_chunk_sz >256 ); +if (rh->ibi_chunk_sz >256 ) { + ret = -EINVAL ; + goto err_out; + } ibi_status_ring_sz = rh->ibi_status_sz * rh->ibi_status_entries; ibi_data_ring_sz = rh->ibi_chunk_sz * rh->ibi_chunks_total;
drivers/iio/adc/ad7124.c +16 -11
@@ -144,15 +144,18 @@ struct ad7124_chip_info {struct ad7124_channel_config {bool live;unsigned int cfg_slot; -enum ad7124_ref_sel refsel; -bool bipolar; -bool buf_positive; -bool buf_negative; -unsigned int vref_mv; -unsigned int pga_bits; -unsigned int odr; -unsigned int odr_sel_bits; -unsigned int filter_type; +/* Following fields are used to compare equality. */ + struct_group(config_props, + enum ad7124_ref_sel refsel; +bool bipolar; +bool buf_positive; +bool buf_negative; +unsigned int vref_mv; +unsigned int pga_bits; +unsigned int odr; +unsigned int odr_sel_bits; +unsigned int filter_type; + ); };struct ad7124_channel {
@@ -331,11 +334,12 @@ static struct ad7124_channel_config *ad7124_find_similar_live_cfg(struct ad7124_ptrdiff_t cmp_size;int i; - cmp_size = (u8 *)&cfg->live - (u8 *)cfg; + cmp_size = sizeof_field(struct ad7124_channel_config, config_props);for (i =0 ; i < st->num_channels; i++) { cfg_aux = &st->channels[i].cfg; -if (cfg_aux->live && !memcmp (cfg, cfg_aux, cmp_size)) +if (cfg_aux->live && + !memcmp (&cfg->config_props, &cfg_aux->config_props, cmp_size))return cfg_aux; }
@@ -686,6 +690,7 @@ static int ad7124_soft_reset(struct ad7124_state *st)if (ret <0 )return ret; +fsleep (200 ); timeout =100 ; do { ret = ad_sd_read_reg(&st->sd, AD7124_STATUS, 1, &readval);
drivers/iio/buffer/industrialio-buffer-dmaengine.c +3 -1
@@ -180,7 +180,7 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev, ret =dma_get_slave_caps (chan, &caps);if (ret <0 ) - goto err_free; + goto err_release;/* Needs to be aligned to the maximum of the minimums */ if (caps.src_addr_widths)
@@ -206,6 +206,8 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev,return &dmaengine_buffer->queue.buffer; +err_release: +dma_release_channel (chan); err_free:kfree (dmaengine_buffer);return ERR_PTR (ret);
drivers/iio/inkern.c +4 -4
@@ -629,17 +629,17 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,break ;case IIO_VAL_INT_PLUS_MICRO :if (scale_val2 <0 ) - *processed = -raw64 * scale_val; + *processed = -raw64 * scale_val * scale;else - *processed = raw64 * scale_val; + *processed = raw64 * scale_val * scale; *processed +=div_s64 (raw64 * (s64 )scale_val2 * scale,1000000LL );break ;case IIO_VAL_INT_PLUS_NANO :if (scale_val2 <0 ) - *processed = -raw64 * scale_val; + *processed = -raw64 * scale_val * scale;else - *processed = raw64 * scale_val; + *processed = raw64 * scale_val * scale; *processed +=div_s64 (raw64 * (s64 )scale_val2 * scale,1000000000LL );break ;
drivers/infiniband/hw/efa/efa_com.c +17 -13
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause /* -* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved. */ #include "efa_com.h"
@@ -398,8 +398,8 @@ static struct efa_comp_ctx *efa_com_submit_admin_cmd(struct efa_com_admin_queuereturn comp_ctx; } -static void efa_com_handle_single_admin_completion (struct efa_com_admin_queue *aq, -struct efa_admin_acq_entry *cqe) +static int efa_com_handle_single_admin_completion (struct efa_com_admin_queue *aq, +struct efa_admin_acq_entry *cqe) {struct efa_comp_ctx *comp_ctx;u16 cmd_id;
@@ -408,11 +408,11 @@ static void efa_com_handle_single_admin_completion(struct efa_com_admin_queue *a EFA_ADMIN_ACQ_COMMON_DESC_COMMAND_ID); comp_ctx =efa_com_get_comp_ctx (aq, cmd_id, false); -if (!comp_ctx) { +if (comp_ctx->status !=EFA_CMD_SUBMITTED ) {ibdev_err (aq->efa_dev, -"comp_ctx is NULL. Changing the admin queue running state\n" ); -clear_bit (EFA_AQ_STATE_RUNNING_BIT , &aq->state); -return ; +"Received completion with unexpected command id[%d], sq producer: %d, sq consumer: %d, cq consumer: %d\n" , + cmd_id, aq->sq.pc, aq->sq.cc, aq->cq.cc); +return -EINVAL ; } comp_ctx->status =EFA_CMD_COMPLETED ;
@@ -420,14 +420,17 @@ static void efa_com_handle_single_admin_completion(struct efa_com_admin_queue *aif (!test_bit (EFA_AQ_STATE_POLLING_BIT , &aq->state))complete (&comp_ctx->wait_event); + +return 0 ; }static void efa_com_handle_admin_completion (struct efa_com_admin_queue *aq) {struct efa_admin_acq_entry *cqe;u16 queue_size_mask; -u16 comp_num =0 ; +u16 comp_cmds =0 ;u8 phase; +int err;u16 ci; queue_size_mask = aq->depth -1 ;
@@ -445,10 +448,12 @@ static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq)* phase bit was validated */ dma_rmb (); -efa_com_handle_single_admin_completion (aq, cqe); + err =efa_com_handle_single_admin_completion (aq, cqe); +if (!err) + comp_cmds++; + aq->cq.cc++; ci++; - comp_num++;if (ci == aq->depth) { ci =0 ; phase = !phase;
@@ -457,10 +462,9 @@ static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq) cqe = &aq->cq.entries[ci]; } - aq->cq.cc += comp_num; aq->cq.phase = phase; - aq->sq.cc += comp_num; -atomic64_add (comp_num, &aq->stats.completed_cmd); + aq->sq.cc += comp_cmds; +atomic64_add (comp_cmds, &aq->stats.completed_cmd); }static int efa_com_comp_status_to_errno (u8 comp_status)
drivers/input/misc/uinput.c +14 -0
@@ -416,6 +416,20 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,return -EINVAL ; } +/* +* Limit number of contacts to a reasonable value (100). This +* ensures that we need less than 2 pages for struct input_mt +* (we are not using in-kernel slot assignment so not going to +* allocate memory for the "red" table), and we should have no +* trouble getting this much memory. +*/ +if (code ==ABS_MT_SLOT && max >99 ) { +printk (KERN_DEBUG +"%s: unreasonably large number of slots requested: %d\n" , +UINPUT_NAME , max); +return -EINVAL ; + } +return 0 ; }
drivers/iommu/intel/dmar.c +1 -1
@@ -1418,7 +1418,7 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc,*/ writel (qi->free_head << shift, iommu->reg +DMAR_IQT_REG ); -while (qi->desc_status[wait_index] !=QI_DONE ) { +while (READ_ONCE (qi->desc_status[wait_index]) !=QI_DONE ) {/* * We will leave the interrupts disabled, to prevent interrupt * context to queue another cmd while a cmd is already submitted
drivers/iommu/sun50i-iommu.c +1 -0
@@ -379,6 +379,7 @@ static int sun50i_iommu_enable(struct sun50i_iommu *iommu)IOMMU_TLB_PREFETCH_MASTER_ENABLE (3 ) |IOMMU_TLB_PREFETCH_MASTER_ENABLE (4 ) | IOMMU_TLB_PREFETCH_MASTER_ENABLE(5)); +iommu_write (iommu,IOMMU_BYPASS_REG ,0 );iommu_write (iommu,IOMMU_INT_ENABLE_REG ,IOMMU_INT_MASK ); iommu_write(iommu, IOMMU_DM_AUT_CTRL_REG(SUN50I_IOMMU_ACI_NONE), IOMMU_DM_AUT_CTRL_RD_UNAVAIL(SUN50I_IOMMU_ACI_NONE, 0) |
drivers/irqchip/irq-armada-370-xp.c +4 -0
@@ -546,6 +546,10 @@ static struct irq_chip armada_370_xp_irq_chip = {static int armada_370_xp_mpic_irq_map (struct irq_domain *h,unsigned int virq,irq_hw_number_t hw) { +/* IRQs 0 and 1 cannot be mapped, they are handled internally */ +if (hw <=1 ) +return -EINVAL ; +armada_370_xp_irq_mask (irq_get_irq_data (virq));if (!is_percpu_irq (hw)) writel(hw, per_cpu_int_base +
drivers/irqchip/irq-gic-v2m.c +3 -3
@@ -439,12 +439,12 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle, ret =gicv2m_init_one (&child->fwnode, spi_start, nr_spis, &res,0 ); -if (ret) { -of_node_put (child); +if (ret)break ; - } } +if (ret && child) +of_node_put (child);if (!ret) ret =gicv2m_allocate_domains (parent);if (ret)
drivers/leds/leds-spi-byte.c +5 -1
@@ -91,7 +91,6 @@ static int spi_byte_probe(struct spi_device *spi)dev_err (dev,"Device must have exactly one LED sub-node." );return -EINVAL ; } - child =of_get_next_available_child (dev_of_node (dev),NULL ); led =devm_kzalloc (dev,sizeof (*led),GFP_KERNEL );if (!led)
@@ -107,11 +106,13 @@ static int spi_byte_probe(struct spi_device *spi) led->ldev.max_brightness = led->cdef->max_value - led->cdef->off_value; led->ldev.brightness_set_blocking = spi_byte_brightness_set_blocking; + child =of_get_next_available_child (dev_of_node (dev),NULL ); state =of_get_property (child,"default-state" ,NULL );if (state) {if (!strcmp (state,"on" )) { led->ldev.brightness = led->ldev.max_brightness; }else if (strcmp (state,"off" )) { +of_node_put (child);/* all other cases except "off" */ dev_err (dev,"default-state can only be 'on' or 'off'" );return -EINVAL ;
@@ -122,9 +123,12 @@ static int spi_byte_probe(struct spi_device *spi) ret =devm_led_classdev_register (&spi->dev, &led->ldev);if (ret) { +of_node_put (child);mutex_destroy (&led->mutex);return ret; } + +of_node_put (child);spi_set_drvdata (spi, led);return 0 ;
drivers/md/dm-init.c +3 -1
@@ -213,8 +213,10 @@ static char __init *dm_parse_device_entry(struct dm_device *dev, char *str)strscpy (dev->dmi.uuid, field[1 ],sizeof (dev->dmi.uuid));/* minor */ if (strlen (field[2 ])) { -if (kstrtoull (field[2 ],0 , &dev->dmi.dev)) +if (kstrtoull (field[2 ],0 , &dev->dmi.dev) || + dev->dmi.dev >= (1 <<MINORBITS ))return ERR_PTR (-EINVAL ); + dev->dmi.dev =huge_encode_dev ((dev_t )dev->dmi.dev); dev->dmi.flags |=DM_PERSISTENT_DEV_FLAG ; }/* flags */
drivers/media/platform/qcom/camss/camss.c +4 -1
@@ -835,8 +835,11 @@ static int camss_of_parse_endpoint_node(struct device *dev,struct v4l2_fwnode_bus_mipi_csi2 *mipi_csi2;struct v4l2_fwnode_endpoint vep = { {0 } };unsigned int i; +int ret; -v4l2_fwnode_endpoint_parse (of_fwnode_handle (node), &vep); + ret =v4l2_fwnode_endpoint_parse (of_fwnode_handle (node), &vep); +if (ret) +return ret; csd->interface.csiphy_id = vep.base.port;
drivers/media/test-drivers/vivid/vivid-vid-cap.c +11 -6
@@ -113,8 +113,9 @@ static int vid_cap_queue_setup(struct vb2_queue *vq,if (*nplanes != buffers)return -EINVAL ;for (p =0 ; p < buffers; p++) { -if (sizes[p] <tpg_g_line_width (&dev->tpg, p) * h + - dev->fmt_cap->data_offset[p]) +if (sizes[p] <tpg_g_line_width (&dev->tpg, p) * h / + dev->fmt_cap->vdownsampling[p] + + dev->fmt_cap->data_offset[p])return -EINVAL ; } }else {
@@ -1797,8 +1798,10 @@ int vidioc_s_edid(struct file *file, void *_fh,return -EINVAL ;if (edid->blocks ==0 ) { dev->edid_blocks =0 ; -v4l2_ctrl_s_ctrl (dev->ctrl_tx_edid_present,0 ); -v4l2_ctrl_s_ctrl (dev->ctrl_tx_hotplug,0 ); +if (dev->num_outputs) { +v4l2_ctrl_s_ctrl (dev->ctrl_tx_edid_present,0 ); +v4l2_ctrl_s_ctrl (dev->ctrl_tx_hotplug,0 ); + } phys_addr =CEC_PHYS_ADDR_INVALID ; goto set_phys_addr; }
@@ -1822,8 +1825,10 @@ int vidioc_s_edid(struct file *file, void *_fh, display_present |= dev->display_present[i] << j++; -v4l2_ctrl_s_ctrl (dev->ctrl_tx_edid_present, display_present); -v4l2_ctrl_s_ctrl (dev->ctrl_tx_hotplug, display_present); +if (dev->num_outputs) { +v4l2_ctrl_s_ctrl (dev->ctrl_tx_edid_present, display_present); +v4l2_ctrl_s_ctrl (dev->ctrl_tx_hotplug, display_present); + } set_phys_addr:/* TODO: a proper hotplug detect cycle should be emulated here */
drivers/media/test-drivers/vivid/vivid-vid-out.c +9 -7
@@ -63,14 +63,16 @@ static int vid_out_queue_setup(struct vb2_queue *vq,if (sizes[0 ] < size)return -EINVAL ;for (p =1 ; p < planes; p++) { -if (sizes[p] < dev->bytesperline_out[p] * h + - vfmt->data_offset[p]) +if (sizes[p] < dev->bytesperline_out[p] * h / + vfmt->vdownsampling[p] + + vfmt->data_offset[p])return -EINVAL ; } }else {for (p =0 ; p < planes; p++) - sizes[p] = p ? dev->bytesperline_out[p] * h + - vfmt->data_offset[p] : size; + sizes[p] = p ? dev->bytesperline_out[p] * h / + vfmt->vdownsampling[p] + + vfmt->data_offset[p] : size; }if (vq->num_buffers + *nbuffers <2 )
@@ -127,7 +129,7 @@ static int vid_out_buf_prepare(struct vb2_buffer *vb)for (p =0 ; p < planes; p++) {if (p) - size = dev->bytesperline_out[p] * h; + size = dev->bytesperline_out[p] * h / vfmt->vdownsampling[p]; size += vb->planes[p].data_offset;if (vb2_get_plane_payload (vb, p) < size) {
@@ -334,8 +336,8 @@ int vivid_g_fmt_vid_out(struct file *file, void *priv,for (p =0 ; p < mp->num_planes; p++) { mp->plane_fmt[p].bytesperline = dev->bytesperline_out[p]; mp->plane_fmt[p].sizeimage = - mp->plane_fmt[p].bytesperline * mp->height + - fmt->data_offset[p]; + mp->plane_fmt[p].bytesperline * mp->height / + fmt->vdownsampling[p] + fmt->data_offset[p]; }for (p = fmt->buffers; p < fmt->planes; p++) {unsigned stride = dev->bytesperline_out[p];
drivers/media/usb/uvc/uvc_driver.c +14 -4
@@ -936,16 +936,26 @@ static int uvc_parse_streaming(struct uvc_device *dev, goto error; } - size = nformats *sizeof (*format) + nframes *sizeof (*frame) +/* +* Allocate memory for the formats, the frames and the intervals, +* plus any required padding to guarantee that everything has the +* correct alignment. +*/ + size = nformats *sizeof (*format); + size = ALIGN(size, __alignof__(*frame)) + nframes * sizeof(*frame); + size = ALIGN(size, __alignof__(*interval)) + nintervals *sizeof (*interval); + format =kzalloc (size,GFP_KERNEL ); -if (format ==NULL ) { +if (!format) { ret = -ENOMEM ; goto error; } - frame = (struct uvc_frame *)&format[nformats]; - interval = (u32 *)&frame[nframes]; + frame = (void *)format + nformats *sizeof (*format); + frame = PTR_ALIGN(frame, __alignof__(*frame)); + interval = (void *)frame + nframes *sizeof (*frame); + interval = PTR_ALIGN(interval, __alignof__(*interval)); streaming->format = format; streaming->nformats =0 ;
drivers/misc/vmw_vmci/vmci_resource.c +2 -1
@@ -144,7 +144,8 @@ void vmci_resource_remove(struct vmci_resource *resource)spin_lock (&vmci_resource_table.lock);hlist_for_each_entry (r, &vmci_resource_table.entries[idx], node) { -if (vmci_handle_is_equal (r->handle, resource->handle)) { +if (vmci_handle_is_equal (r->handle, resource->handle) && + resource->type == r->type) {hlist_del_init_rcu (&r->node);break ; }
drivers/mmc/host/cqhci-core.c +1 -1
@@ -612,7 +612,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)cqhci_writel (cq_host,0 ,CQHCI_CTL ); mmc->cqe_on = true;pr_debug ("%s: cqhci: CQE on\n" ,mmc_hostname (mmc)); -if (cqhci_readl (cq_host,CQHCI_CTL ) &&CQHCI_HALT ) { +if (cqhci_readl (cq_host,CQHCI_CTL ) &CQHCI_HALT ) {pr_err ("%s: cqhci: CQE failed to exit halt state\n" ,mmc_hostname (mmc)); }
drivers/mmc/host/dw_mmc.c +2 -2
@@ -2903,8 +2903,8 @@ static int dw_mci_init_slot(struct dw_mci *host)if (host->use_dma ==TRANS_MODE_IDMAC ) { mmc->max_segs = host->ring_size; mmc->max_blk_size =65535 ; - mmc->max_seg_size =0x1000 ; - mmc->max_req_size = mmc->max_seg_size * host->ring_size; + mmc->max_req_size =DW_MCI_DESC_DATA_LENGTH * host->ring_size; + mmc->max_seg_size = mmc->max_req_size; mmc->max_blk_count = mmc->max_req_size /512 ; }else if (host->use_dma ==TRANS_MODE_EDMAC ) { mmc->max_segs =64 ;
drivers/mmc/host/sdhci-of-aspeed.c +1 -0
@@ -513,6 +513,7 @@ static const struct of_device_id aspeed_sdhci_of_match[] = { { .compatible = "aspeed,ast2600-sdhci", .data = &ast2600_sdhci_pdata, }, { } }; +MODULE_DEVICE_TABLE (of, aspeed_sdhci_of_match);static struct platform_driver aspeed_sdhci_driver = { .driver = {
drivers/net/bareudp.c +11 -11
@@ -75,7 +75,7 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)if (skb_copy_bits (skb,BAREUDP_BASE_HLEN , &ipversion,sizeof (ipversion))) { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; } ipversion >>=4 ;
@@ -85,7 +85,7 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) }else if (ipversion ==6 && bareudp->multi_proto_mode) { proto =htons (ETH_P_IPV6 ); }else { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; } }else if (bareudp->ethertype ==htons (ETH_P_MPLS_UC )) {
@@ -99,7 +99,7 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) ipv4_is_multicast(tunnel_hdr->daddr)) { proto = htons(ETH_P_MPLS_MC); } else { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; } }else {
@@ -115,7 +115,7 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) (addr_type & IPV6_ADDR_MULTICAST)) { proto = htons(ETH_P_MPLS_MC); } else { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; } }
@@ -127,12 +127,12 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) proto, !net_eq(bareudp->net, dev_net(bareudp->dev)))) { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; } tun_dst =udp_tun_rx_dst (skb, family,TUNNEL_KEY ,0 ,0 );if (!tun_dst) { - bareudp->dev->stats.rx_dropped++; +DEV_STATS_INC (bareudp->dev, rx_dropped); goto drop; }skb_dst_set (skb, &tun_dst->dst);
@@ -158,8 +158,8 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) &((struct ipv6hdr *)oiph)->saddr); }if (err >1 ) { - ++bareudp->dev->stats.rx_frame_errors; - ++bareudp->dev->stats.rx_errors; +DEV_STATS_INC (bareudp->dev, rx_frame_errors); +DEV_STATS_INC (bareudp->dev, rx_errors); goto drop; } }
@@ -455,11 +455,11 @@ static netdev_tx_t bareudp_xmit(struct sk_buff *skb, struct net_device *dev)dev_kfree_skb (skb);if (err == -ELOOP ) - dev->stats.collisions++; +DEV_STATS_INC (dev, collisions);else if (err == -ENETUNREACH ) - dev->stats.tx_carrier_errors++; +DEV_STATS_INC (dev, tx_carrier_errors); - dev->stats.tx_errors++; +DEV_STATS_INC (dev, tx_errors);return NETDEV_TX_OK ; }
drivers/net/can/m_can/m_can.c +4 -1
@@ -1840,7 +1840,7 @@ static int m_can_open(struct net_device *dev)/* start the m_can controller */ err =m_can_start (dev);if (err) - goto exit_irq_fail; + goto exit_start_fail;can_led_event (dev,CAN_LED_EVENT_OPEN );
@@ -1851,6 +1851,9 @@ static int m_can_open(struct net_device *dev)return 0 ; +exit_start_fail: +if (cdev->is_peripheral || dev->irq) +free_irq (dev->irq, dev); exit_irq_fail:if (cdev->is_peripheral)destroy_workqueue (cdev->tx_wq);
drivers/net/can/spi/mcp251x.c +1 -1
@@ -755,7 +755,7 @@ static int mcp251x_hw_wake(struct spi_device *spi)int ret;/* Force wakeup interrupt to wake device, but don't execute IST */ -disable_irq (spi->irq); +disable_irq_nosync (spi->irq);mcp251x_write_2regs (spi,CANINTE ,CANINTE_WAKIE ,CANINTF_WAKIF );/* Wait for oscillator startup timer after wake up */
drivers/net/dsa/vitesse-vsc73xx-core.c +8 -2
@@ -35,7 +35,7 @@#define VSC73XX_BLOCK_ANALYZER 0x2/* Only subblock 0 */ #define VSC73XX_BLOCK_MII 0x3/* Subblocks 0 and 1 */ #define VSC73XX_BLOCK_MEMINIT 0x3/* Only subblock 2 */ -#define VSC73XX_BLOCK_CAPTURE 0x4/* Only subblock 2 */ +#define VSC73XX_BLOCK_CAPTURE 0x4/* Subblocks 0-4, 6, 7 */ #define VSC73XX_BLOCK_ARBITER 0x5/* Only subblock 0 */ #define VSC73XX_BLOCK_SYSTEM 0x7/* Only subblock 0 */
@@ -371,13 +371,19 @@ int vsc73xx_is_addr_valid(u8 block, u8 subblock)break ;case VSC73XX_BLOCK_MII : -case VSC73XX_BLOCK_CAPTURE :case VSC73XX_BLOCK_ARBITER :switch (subblock) { case 0 ... 1:return 1 ; }break ; +case VSC73XX_BLOCK_CAPTURE : +switch (subblock) { + case 0 ... 4: + case 6 ... 7: +return 1 ; + } +break ; }return 0 ;
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +15 -5
@@ -910,14 +910,18 @@ static inline void dpaa_setup_egress(const struct dpaa_priv *priv, } } -static void dpaa_fq_setup (struct dpaa_priv *priv, -const struct dpaa_fq_cbs *fq_cbs, -struct fman_port *tx_port) +static int dpaa_fq_setup (struct dpaa_priv *priv, +const struct dpaa_fq_cbs *fq_cbs, +struct fman_port *tx_port) {int egress_cnt =0 , conf_cnt =0 , num_portals =0 , portal_cnt =0 , cpu;const cpumask_t *affine_cpus =qman_affine_cpus (); -u16 channels[NR_CPUS ];struct dpaa_fq *fq; +u16 *channels; + + channels =kcalloc (num_possible_cpus (),sizeof (u16),GFP_KERNEL ); +if (!channels) +return -ENOMEM ;for_each_cpu_and (cpu, affine_cpus, cpu_online_mask) channels[num_portals++] =qman_affine_channel (cpu);
@@ -976,6 +980,10 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,break ; } } + +kfree (channels); + +return 0 ; } static inline int dpaa_tx_fq_to_id(const struct dpaa_priv *priv,
@@ -3444,7 +3452,9 @@ static int dpaa_eth_probe(struct platform_device *pdev)*/ dpaa_eth_add_channel (priv->channel, &pdev->dev); -dpaa_fq_setup (priv, &dpaa_fq_cbs, priv->mac_dev->port[TX ]); + err =dpaa_fq_setup (priv, &dpaa_fq_cbs, priv->mac_dev->port[TX ]); +if (err) + goto free_dpaa_bps;/* Create a congestion group for this netdev, with * dynamically-allocated CGR ID.
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +9 -1
@@ -541,12 +541,16 @@ static int dpaa_set_coalesce(struct net_device *dev, struct netlink_ext_ack *extack) {const cpumask_t *cpus =qman_affine_cpus (); -bool needs_revert[NR_CPUS ] = {false};struct qman_portal *portal;u32 period, prev_period;u8 thresh, prev_thresh; +bool *needs_revert;int cpu, res; + needs_revert =kcalloc (num_possible_cpus (),sizeof (bool ),GFP_KERNEL ); +if (!needs_revert) +return -ENOMEM ; + period = c->rx_coalesce_usecs; thresh = c->rx_max_coalesced_frames;
@@ -569,6 +573,8 @@ static int dpaa_set_coalesce(struct net_device *dev, needs_revert[cpu] = true; } +kfree (needs_revert); +return 0 ; revert_values:
@@ -582,6 +588,8 @@ static int dpaa_set_coalesce(struct net_device *dev,qman_dqrr_set_ithresh (portal, prev_thresh); } +kfree (needs_revert); +return res; }
drivers/net/ethernet/intel/ice/ice_lib.c +6 -6
@@ -2751,8 +2751,7 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked)*/ void ice_dis_vsi (struct ice_vsi *vsi,bool locked) { -if (test_bit (ICE_VSI_DOWN , vsi->state)) -return ; +bool already_down =test_bit (ICE_VSI_DOWN , vsi->state);set_bit (ICE_VSI_NEEDS_RESTART , vsi->state);
@@ -2760,15 +2759,16 @@ void ice_dis_vsi(struct ice_vsi *vsi, bool locked)if (netif_running (vsi->netdev)) {if (!locked)rtnl_lock (); - -ice_vsi_close (vsi); + already_down =test_bit (ICE_VSI_DOWN , vsi->state); +if (!already_down) +ice_vsi_close (vsi);if (!locked)rtnl_unlock (); - }else { + }else if (!already_down) {ice_vsi_close (vsi); } - }else if (vsi->type ==ICE_VSI_CTRL ) { + }else if (vsi->type ==ICE_VSI_CTRL && !already_down) {ice_vsi_close (vsi); } }
drivers/net/ethernet/intel/igb/igb_main.c +10 -0
@@ -6799,10 +6799,20 @@ static void igb_extts(struct igb_adapter *adapter, int tsintr_tt)static void igb_tsync_interrupt (struct igb_adapter *adapter) { +const u32 mask = (TSINTR_SYS_WRAP |E1000_TSICR_TXTS | +TSINTR_TT0 |TSINTR_TT1 | +TSINTR_AUTT0 |TSINTR_AUTT1 );struct e1000_hw *hw = &adapter->hw;u32 tsicr =rd32 (E1000_TSICR );struct ptp_clock_event event; +if (hw->mac.type == e1000_82580) { +/* 82580 has a hardware bug that requires an explicit +* write to clear the TimeSync interrupt cause. +*/ +wr32 (E1000_TSICR , tsicr & mask); + } +if (tsicr &TSINTR_SYS_WRAP ) { event.type =PTP_CLOCK_PPS ;if (adapter->ptp_caps.pps)
drivers/net/ethernet/intel/igc/igc_main.c +1 -0
@@ -7057,6 +7057,7 @@ static void igc_io_resume(struct pci_dev *pdev)rtnl_lock ();if (netif_running (netdev)) {if (igc_open (netdev)) { +rtnl_unlock ();netdev_err (netdev,"igc_open failed after reset\n" );return ; }
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -1
@@ -221,7 +221,7 @@ static int ionic_request_irq(struct ionic_lif *lif, struct ionic_qcq *qcq) name =dev_name (dev);snprintf (intr->name,sizeof (intr->name), -"%s-%s-%s" ,IONIC_DRV_NAME , name, q->name); +"%.5s-%.16s-%.8s" ,IONIC_DRV_NAME , name, q->name);return devm_request_irq (dev, intr->vector, ionic_isr,0 , intr->name, &qcq->napi);
drivers/net/geneve.c +1 -7
@@ -530,18 +530,15 @@ static struct sk_buff *geneve_gro_receive(struct sock *sk, type = gh->proto_type; -rcu_read_lock (); ptype =gro_find_receive_by_type (type);if (!ptype) - goto out_unlock; + goto out;skb_gro_pull (skb, gh_len);skb_gro_postpull_rcsum (skb, gh, gh_len); pp =call_gro_receive (ptype->callbacks.gro_receive, head, skb); flush =0 ; -out_unlock: -rcu_read_unlock (); out:skb_gro_flush_final (skb, pp, flush);
@@ -561,13 +558,10 @@ static int geneve_gro_complete(struct sock *sk, struct sk_buff *skb, gh_len =geneve_hlen (gh); type = gh->proto_type; -rcu_read_lock (); ptype =gro_find_complete_by_type (type);if (ptype) err = ptype->callbacks.gro_complete (skb, nhoff + gh_len); -rcu_read_unlock (); -skb_set_inner_mac_header (skb, nhoff + gh_len);return err;
drivers/net/usb/ch9200.c +3 -1
@@ -336,6 +336,7 @@ static int ch9200_bind(struct usbnet *dev, struct usb_interface *intf) {int retval =0 ;unsigned char data[2 ]; +u8 addr[ETH_ALEN ]; retval =usbnet_get_endpoints (dev, intf);if (retval)
@@ -383,7 +384,8 @@ static int ch9200_bind(struct usbnet *dev, struct usb_interface *intf) retval =control_write (dev,REQUEST_WRITE ,0 ,MAC_REG_CTRL , data,0x02 ,CONTROL_TIMEOUT_MS ); - retval =get_mac_address (dev, dev->net->dev_addr); + retval =get_mac_address (dev, addr); +eth_hw_addr_set (dev->net, addr);return retval; }
drivers/net/usb/cx82310_eth.c +3 -2
@@ -146,6 +146,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)u8 link[3 ];int timeout =50 ;struct cx82310_priv *priv; +u8 addr[ETH_ALEN ];/* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */ if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0
@@ -202,12 +203,12 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) goto err;/* get the MAC address */ - ret =cx82310_cmd (dev,CMD_GET_MAC_ADDR , true,NULL ,0 , - dev->net->dev_addr,ETH_ALEN ); + ret =cx82310_cmd (dev,CMD_GET_MAC_ADDR , true,NULL ,0 , addr,ETH_ALEN );if (ret) {netdev_err (dev->net,"unable to read MAC address: %d\n" , ret); goto err; } +eth_hw_addr_set (dev->net, addr);/* start (does not seem to have any effect?) */ ret =cx82310_cmd (dev,CMD_START , false,NULL ,0 ,NULL ,0 );
drivers/net/usb/ipheth.c +1 -1
@@ -353,8 +353,8 @@ static int ipheth_close(struct net_device *net) {struct ipheth_device *dev =netdev_priv (net); -cancel_delayed_work_sync (&dev->carrier_work);netif_stop_queue (net); +cancel_delayed_work_sync (&dev->carrier_work);return 0 ; }
drivers/net/usb/kaweth.c +1 -2
@@ -1044,8 +1044,7 @@ static int kaweth_probe( goto err_all_but_rxbuf;memcpy (netdev->broadcast, &bcast_addr,sizeof (bcast_addr)); -memcpy (netdev->dev_addr, &kaweth->configuration.hw_addr, -sizeof (kaweth->configuration.hw_addr)); +eth_hw_addr_set (netdev, (u8 *)&kaweth->configuration.hw_addr); netdev->netdev_ops = &kaweth_netdev_ops; netdev->watchdog_timeo =KAWETH_TX_TIMEOUT ;
drivers/net/usb/mcs7830.c +3 -1
@@ -481,17 +481,19 @@ static const struct net_device_ops mcs7830_netdev_ops = {static int mcs7830_bind (struct usbnet *dev,struct usb_interface *udev) {struct net_device *net = dev->net; +u8 addr[ETH_ALEN ];int ret;int retry;/* Initial startup: Gather MAC address setting from EEPROM */ ret = -EINVAL ;for (retry =0 ; retry <5 && ret; retry++) - ret =mcs7830_hif_get_mac_address (dev, net->dev_addr); + ret =mcs7830_hif_get_mac_address (dev, addr);if (ret) {dev_warn (&dev->udev->dev,"Cannot read MAC address\n" ); goto out; } +eth_hw_addr_set (net, addr);mcs7830_data_set_multicast (net);
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1426,6 +1426,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */ + {QMI_FIXED_INTF(0x2dee, 0x4d22, 5)}, /* MeiG Smart SRM825L *//* 4. Gobi 1000 devices */ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
drivers/net/usb/sierra_net.c +4 -2
@@ -669,6 +669,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) 0x00, 0x00, SIERRA_NET_HIP_MSYNC_ID, 0x00};static const u8 shdwn_tmplate[sizeof (priv->shdwn_msg)] = {0x00 ,0x00 ,SIERRA_NET_HIP_SHUTD_ID ,0x00 }; +u8 mod[2 ];dev_dbg (&dev->udev->dev,"%s" , __func__);
@@ -698,8 +699,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->netdev_ops = &sierra_net_device_ops;/* change MAC addr to include, ifacenum, and to be unique */ - dev->net->dev_addr[ETH_ALEN -2 ] =atomic_inc_return (&iface_counter); - dev->net->dev_addr[ETH_ALEN -1 ] = ifacenum; + mod[0 ] =atomic_inc_return (&iface_counter); + mod[1 ] = ifacenum; +dev_addr_mod (dev->net,ETH_ALEN -2 , mod,2 );/* prepare shutdown message template */ memcpy (priv->shdwn_msg, shdwn_tmplate,sizeof (priv->shdwn_msg));
drivers/net/usb/sr9700.c +3 -1
@@ -327,6 +327,7 @@ static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf) {struct net_device *netdev;struct mii_if_info *mii; +u8 addr[ETH_ALEN ];int ret; ret =usbnet_get_endpoints (dev, intf);
@@ -357,11 +358,12 @@ static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf)* EEPROM automatically to PAR. In case there is no EEPROM externally, * a default MAC address is stored in PAR for making chip work properly. */ -if (sr_read (dev,SR_PAR ,ETH_ALEN , netdev->dev_addr) <0 ) { +if (sr_read (dev,SR_PAR ,ETH_ALEN , addr) <0 ) {netdev_err (netdev,"Error reading MAC address\n" ); ret = -ENODEV ; goto out; } +eth_hw_addr_set (netdev, addr);/* power up and reset phy */ sr_write_reg (dev,SR_PRR ,PRR_PHY_RST );
drivers/net/usb/sr9800.c +3 -2
@@ -731,6 +731,7 @@ static int sr9800_bind(struct usbnet *dev, struct usb_interface *intf)struct sr_data *data = (struct sr_data *)&dev->data;u16 led01_mux, led23_mux;int ret, embd_phy; +u8 addr[ETH_ALEN ];u32 phyid;u16 rx_ctl;
@@ -756,12 +757,12 @@ static int sr9800_bind(struct usbnet *dev, struct usb_interface *intf) }/* Get the MAC address */ - ret =sr_read_cmd (dev,SR_CMD_READ_NODE_ID ,0 ,0 ,ETH_ALEN , - dev->net->dev_addr); + ret =sr_read_cmd (dev,SR_CMD_READ_NODE_ID ,0 ,0 ,ETH_ALEN , addr);if (ret <0 ) {netdev_dbg (dev->net,"Failed to read MAC address: %d\n" , ret);return ret; } +eth_hw_addr_set (dev->net, addr);netdev_dbg (dev->net,"mac addr : %pM\n" , dev->net->dev_addr);/* Initialize MII structure */
drivers/net/usb/usbnet.c +6 -9
@@ -64,9 +64,6 @@/*-------------------------------------------------------------------------*/ -// randomly generated ethernet address -static u8 node_id [ETH_ALEN ]; -/* use ethtool to change the level for any given device */ static int msg_level =-1 ;module_param (msg_level, int,0 );
@@ -165,12 +162,13 @@ EXPORT_SYMBOL_GPL(usbnet_get_endpoints);int usbnet_get_ethernet_addr (struct usbnet *dev,int iMACAddress) { +u8 addr[ETH_ALEN ];int tmp =-1 , ret;unsigned char buf [13 ]; ret =usb_string (dev->udev, iMACAddress, buf,sizeof buf);if (ret ==12 ) - tmp =hex2bin (dev->net->dev_addr, buf,6 ); + tmp =hex2bin (addr, buf,6 );if (tmp <0 ) {dev_dbg (&dev->udev->dev,"bad MAC string %d fetch, %d\n" , iMACAddress, tmp);
@@ -178,6 +176,7 @@ int usbnet_get_ethernet_addr(struct usbnet *dev, int iMACAddress) ret = -EINVAL ;return ret; } +eth_hw_addr_set (dev->net, addr);return 0 ; }EXPORT_SYMBOL_GPL (usbnet_get_ethernet_addr);
@@ -1727,7 +1726,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) dev->net = net;strscpy (net->name,"usb%d" ,sizeof (net->name)); -memcpy (net->dev_addr, node_id,sizeof node_id);/* rx and tx sides can use different message sizes; * bind() should set rx_urb_size in that case.
@@ -1801,9 +1799,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) goto out4; } -/* let userspace know we have a random address */ -if (ether_addr_equal (net->dev_addr, node_id)) - net->addr_assign_type =NET_ADDR_RANDOM ; +/* this flags the device for user space */ +if (!is_valid_ether_addr (net->dev_addr)) +eth_hw_addr_random (net);if ((dev->driver_info->flags &FLAG_WLAN ) !=0 )SET_NETDEV_DEVTYPE (net, &wlan_type);
@@ -2213,7 +2211,6 @@ static int __init usbnet_init(void) BUILD_BUG_ON( sizeof_field(struct sk_buff, cb) < sizeof(struct skb_data)); -eth_random_addr (node_id);return 0 ; }module_init (usbnet_init);
drivers/net/virtio_net.c +4 -4
@@ -1548,7 +1548,7 @@ static bool is_xdp_raw_buffer_queue(struct virtnet_info *vi, int q)return false; } -static void virtnet_poll_cleantx (struct receive_queue *rq) +static void virtnet_poll_cleantx (struct receive_queue *rq,int budget) {struct virtnet_info *vi = rq->vq->vdev->priv;unsigned int index =vq2rxq (rq->vq);
@@ -1561,7 +1561,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq)if (__netif_tx_trylock (txq)) {do {virtqueue_disable_cb (sq->vq); -free_old_xmit_skbs (sq, true); +free_old_xmit_skbs (sq, !!budget); }while (unlikely (!virtqueue_enable_cb_delayed (sq->vq)));if (sq->vq->num_free >=2 +MAX_SKB_FRAGS )
@@ -1580,7 +1580,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget)unsigned int received;unsigned int xdp_xmit =0 ; -virtnet_poll_cleantx (rq); +virtnet_poll_cleantx (rq, budget); received =virtnet_receive (rq, budget, &xdp_xmit);
@@ -1683,7 +1683,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget) txq =netdev_get_tx_queue (vi->dev, index);__netif_tx_lock (txq,raw_smp_processor_id ());virtqueue_disable_cb (sq->vq); -free_old_xmit_skbs (sq, true); +free_old_xmit_skbs (sq, !!budget);if (sq->vq->num_free >=2 +MAX_SKB_FRAGS )netif_tx_wake_queue (txq);
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +1 -0
@@ -1088,6 +1088,7 @@ static int ieee_hw_init(struct ieee80211_hw *hw)ieee80211_hw_set (hw,AMPDU_AGGREGATION );ieee80211_hw_set (hw,SIGNAL_DBM );ieee80211_hw_set (hw,REPORTS_TX_ACK_STATUS ); +ieee80211_hw_set (hw,MFP_CAPABLE ); hw->extra_tx_headroom =brcms_c_get_header_len (); hw->queues =N_TX_QUEUES ;
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +1 -2
@@ -252,8 +252,7 @@ static ssize_t iwl_dbgfs_send_hcmd_write(struct iwl_fw_runtime *fwrt, char *buf, .data = { NULL, }, }; -if (fwrt->ops && fwrt->ops->fw_running && - !fwrt->ops->fw_running (fwrt->ops_ctx)) +if (!iwl_trans_fw_running (fwrt->trans))return -EIO ;if (count < header_size +1 || count >1024 *4 )
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +0 -1
@@ -18,7 +18,6 @@struct iwl_fw_runtime_ops {int (*dump_start)(void *ctx);void (*dump_end)(void *ctx); -bool (*fw_running)(void *ctx);int (*send_hcmd)(void *ctx,struct iwl_host_cmd *host_cmd);bool (*d3_debug_enable)(void *ctx); };
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 -6
@@ -653,11 +653,6 @@ static void iwl_mvm_fwrt_dump_end(void *ctx)mutex_unlock (&mvm->mutex); } -static bool iwl_mvm_fwrt_fw_running (void *ctx) -{ -return iwl_mvm_firmware_running (ctx); -} -static int iwl_mvm_fwrt_send_hcmd (void *ctx,struct iwl_host_cmd *host_cmd) {struct iwl_mvm *mvm = (struct iwl_mvm *)ctx;
@@ -678,7 +673,6 @@ static bool iwl_mvm_d3_debug_enable(void *ctx)static const struct iwl_fw_runtime_ops iwl_mvm_fwrt_ops = { .dump_start = iwl_mvm_fwrt_dump_start, .dump_end = iwl_mvm_fwrt_dump_end, - .fw_running = iwl_mvm_fwrt_fw_running, .send_hcmd = iwl_mvm_fwrt_send_hcmd, .d3_debug_enable = iwl_mvm_d3_debug_enable, };
drivers/net/wireless/marvell/mwifiex/main.h +3 -0
@@ -1310,6 +1310,9 @@ mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,for (i =0 ; i < adapter->priv_num; i++) {if (adapter->priv[i]) { +if (adapter->priv[i]->bss_mode ==NL80211_IFTYPE_UNSPECIFIED ) +continue ; +if ((adapter->priv[i]->bss_num == bss_num) && (adapter->priv[i]->bss_type == bss_type))break ;
drivers/nvme/host/pci.c +11 -0
@@ -2974,6 +2974,17 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev) dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") || dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"))return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND ; + }else if (pdev->vendor ==0x144d && pdev->device ==0xa80d ) { +/* +* Exclude Samsung 990 Evo from NVME_QUIRK_SIMPLE_SUSPEND +* because of high power consumption (> 2 Watt) in s2idle +* sleep. Only some boards with Intel CPU are affected. +*/ +if (dmi_match (DMI_BOARD_NAME ,"GMxPXxx" ) || +dmi_match (DMI_BOARD_NAME ,"PH4PG31" ) || +dmi_match (DMI_BOARD_NAME ,"PH4PRX1_PH6PRX1" ) || +dmi_match (DMI_BOARD_NAME ,"PH6PG01_PH6PG71" )) +return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND ; }/*
drivers/nvme/target/tcp.c +3 -1
@@ -1819,8 +1819,10 @@ static u16 nvmet_tcp_install_queue(struct nvmet_sq *sq) } queue->nr_cmds = sq->size *2 ; -if (nvmet_tcp_alloc_cmds (queue)) +if (nvmet_tcp_alloc_cmds (queue)) { + queue->nr_cmds =0 ;return NVME_SC_INTERNAL ; + }return 0 ; }
drivers/nvmem/core.c +3 -3
@@ -1112,13 +1112,13 @@ void nvmem_device_put(struct nvmem_device *nvmem)EXPORT_SYMBOL_GPL (nvmem_device_put);/** -* devm_nvmem_device_get() - Get nvmem cell of device form a given id +* devm_nvmem_device_get() - Get nvmem device of device form a given id * * @dev: Device that requests the nvmem device. * @id: name id for the requested nvmem device. * -* Return: ERR_PTR() on error or a valid pointer to a struct nvmem_cell -* on success. The nvmem_cell will be freed by the automatically once the +* Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device +* on success. The nvmem_device will be freed by the automatically once the * device is freed. */ struct nvmem_device *devm_nvmem_device_get (struct device *dev,const char *id)
drivers/of/irq.c +11 -4
@@ -288,7 +288,8 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_arstruct device_node *p;const __be32 *addr;u32 intsize; -int i, res; +int i, res, addr_len; +__be32 addr_buf[3 ] = {0 };pr_debug ("of_irq_parse_one: dev=%pOF, index=%d\n" , device, index);
@@ -297,13 +298,19 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_arreturn of_irq_parse_oldworld (device, index, out_irq);/* Get the reg property (if any) */ - addr =of_get_property (device,"reg" ,NULL ); + addr =of_get_property (device,"reg" , &addr_len); + +/* Prevent out-of-bounds read in case of longer interrupt parent address size */ +if (addr_len > (3 *sizeof (__be32))) + addr_len =3 *sizeof (__be32); +if (addr) +memcpy (addr_buf, addr, addr_len);/* Try the new-style interrupts-extended first */ res =of_parse_phandle_with_args (device,"interrupts-extended" ,"#interrupt-cells" , index, out_irq);if (!res) -return of_irq_parse_raw (addr, out_irq); +return of_irq_parse_raw (addr_buf, out_irq);/* Look for the interrupt parent. */ p =of_irq_find_parent (device);
@@ -333,7 +340,7 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar/* Check if there are any interrupt-map translations to process */ - res =of_irq_parse_raw (addr, out_irq); + res =of_irq_parse_raw (addr_buf, out_irq); out:of_node_put (p);return res;
drivers/pci/controller/dwc/pci-keystone.c +43 -1
78 lines not on this page · raw message
drivers/pci/controller/dwc/pcie-al.c +13 -3
@@ -242,18 +242,24 @@ static struct pci_ops al_child_pci_ops = { .write = pci_generic_config_write, }; -static void al_pcie_config_prepare (struct al_pcie *pcie) +static int al_pcie_config_prepare (struct al_pcie *pcie) {struct al_pcie_target_bus_cfg *target_bus_cfg;struct pcie_port *pp = &pcie->pci->pp;unsigned int ecam_bus_mask; +struct resource_entry *ft;u32 cfg_control_offset; +struct resource *bus;u8 subordinate_bus;u8 secondary_bus;u32 cfg_control;u32 reg; -struct resource *bus =resource_list_first_type (&pp->bridge->windows,IORESOURCE_BUS )->res; + ft =resource_list_first_type (&pp->bridge->windows,IORESOURCE_BUS ); +if (!ft) +return -ENODEV ; + + bus = ft->res; target_bus_cfg = &pcie->target_bus_cfg; ecam_bus_mask = (pcie->ecam_size >>PCIE_ECAM_BUS_SHIFT ) -1 ;
@@ -287,6 +293,8 @@ static void al_pcie_config_prepare(struct al_pcie *pcie)FIELD_PREP (CFG_CONTROL_SEC_BUS_MASK , secondary_bus);al_pcie_controller_writel (pcie, cfg_control_offset, reg); + +return 0 ; }static int al_pcie_host_init (struct pcie_port *pp)
@@ -305,7 +313,9 @@ static int al_pcie_host_init(struct pcie_port *pp)if (rc)return rc; -al_pcie_config_prepare (pcie); + rc =al_pcie_config_prepare (pcie); +if (rc) +return rc;return 0 ; }
drivers/pci/hotplug/pnv_php.c +1 -2
@@ -38,7 +38,6 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot, bool disable_device) {struct pci_dev *pdev = php_slot->pdev; -int irq = php_slot->irq;u16 ctrl;if (php_slot->irq >0 ) {
@@ -57,7 +56,7 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot, php_slot->wq =NULL ; } -if (disable_device || irq >0 ) { +if (disable_device) {if (pdev->msix_enabled)pci_disable_msix (pdev);else if (pdev->msi_enabled)
drivers/pci/pci.c +21 -14
@@ -5496,10 +5496,12 @@ static void pci_bus_lock(struct pci_bus *bus) {struct pci_dev *dev; +pci_dev_lock (bus->self);list_for_each_entry (dev, &bus->devices, bus_list) { -pci_dev_lock (dev);if (dev->subordinate)pci_bus_lock (dev->subordinate); +else +pci_dev_lock (dev); } }
@@ -5511,8 +5513,10 @@ static void pci_bus_unlock(struct pci_bus *bus)list_for_each_entry (dev, &bus->devices, bus_list) {if (dev->subordinate)pci_bus_unlock (dev->subordinate); -pci_dev_unlock (dev); +else +pci_dev_unlock (dev); } +pci_dev_unlock (bus->self); }/* Return 1 on successful lock, 0 on contention */
@@ -5520,15 +5524,15 @@ static int pci_bus_trylock(struct pci_bus *bus) {struct pci_dev *dev; +if (!pci_dev_trylock (bus->self)) +return 0 ; +list_for_each_entry (dev, &bus->devices, bus_list) { -if (!pci_dev_trylock (dev)) - goto unlock;if (dev->subordinate) { -if (!pci_bus_trylock (dev->subordinate)) { -pci_dev_unlock (dev); +if (!pci_bus_trylock (dev->subordinate)) goto unlock; - } - } + }else if (!pci_dev_trylock (dev)) + goto unlock; }return 1 ;
@@ -5536,8 +5540,10 @@ static int pci_bus_trylock(struct pci_bus *bus)list_for_each_entry_continue_reverse (dev, &bus->devices, bus_list) {if (dev->subordinate)pci_bus_unlock (dev->subordinate); -pci_dev_unlock (dev); +else +pci_dev_unlock (dev); } +pci_dev_unlock (bus->self);return 0 ; }
@@ -5569,9 +5575,10 @@ static void pci_slot_lock(struct pci_slot *slot)list_for_each_entry (dev, &slot->bus->devices, bus_list) {if (!dev->slot || dev->slot != slot)continue ; -pci_dev_lock (dev);if (dev->subordinate)pci_bus_lock (dev->subordinate); +else +pci_dev_lock (dev); } }
@@ -5597,14 +5604,13 @@ static int pci_slot_trylock(struct pci_slot *slot)list_for_each_entry (dev, &slot->bus->devices, bus_list) {if (!dev->slot || dev->slot != slot)continue ; -if (!pci_dev_trylock (dev)) - goto unlock;if (dev->subordinate) {if (!pci_bus_trylock (dev->subordinate)) {pci_dev_unlock (dev); goto unlock; } - } + }else if (!pci_dev_trylock (dev)) + goto unlock; }return 1 ;
@@ -5615,7 +5621,8 @@ static int pci_slot_trylock(struct pci_slot *slot)continue ;if (dev->subordinate)pci_bus_unlock (dev->subordinate); -pci_dev_unlock (dev); +else +pci_dev_unlock (dev); }return 0 ; }
drivers/pcmcia/yenta_socket.c +3 -3
@@ -636,11 +636,11 @@ static int yenta_search_one_res(struct resource *root, struct resource *res, start =PCIBIOS_MIN_CARDBUS_IO ; end = ~0U ; }else { -unsigned long avail = root->end - root->start; +unsigned long avail =resource_size (root);int i; size =BRIDGE_MEM_MAX ; -if (size > avail/8 ) { - size = (avail+1 )/8 ; +if (size > (avail -1 ) /8 ) { + size = avail /8 ;/* round size down to next power of 2 */ i =0 ;while ((size /=2 ) !=0 )
drivers/platform/x86/dell/dell-smbios-base.c +4 -1
@@ -589,7 +589,10 @@ static int __init dell_smbios_init(void)return 0 ; fail_sysfs: -free_group (platform_device); +if (!wmi) +exit_dell_smbios_wmi (); +if (!smm) +exit_dell_smbios_smm (); fail_create_group:platform_device_del (platform_device);
drivers/staging/iio/frequency/ad9834.c +1 -1
@@ -114,7 +114,7 @@ static int ad9834_write_frequency(struct ad9834_state *st, clk_freq =clk_get_rate (st->mclk); -if (fout > (clk_freq /2 )) +if (!clk_freq || fout > (clk_freq /2 ))return -EINVAL ; regval =ad9834_calc_freqreg (clk_freq, fout);
drivers/uio/uio_hv_generic.c +10 -1
@@ -104,10 +104,11 @@ static void hv_uio_channel_cb(void *context)/* * Callback from vmbus_event when channel is rescinded. +* It is meant for rescind of primary channels only. */
Lines of this file are not shown. View the raw message.
drivers/usb/usbip/stub_rx.c +50 -27
77 lines not on this page · raw message
fs/nilfs2/sysfs.c +70 -47
117 lines not on this page · raw message
fs/ntfs3/dir.c +32 -20
52 lines not on this page · raw message
net/bluetooth/mgmt.c +25 -35
60 lines not on this page · raw message
net/ipv4/fou.c +31 -23
54 lines not on this page · raw message
net/mptcp/options.c +22 -22
44 lines not on this page · raw message
net/mptcp/pm_netlink.c +108 -66
174 lines not on this page · raw message
net/mptcp/protocol.c +35 -26
61 lines not on this page · raw message
net/mptcp/subflow.c +30 -26
56 lines not on this page · raw message
net/wireless/scan.c +34 -12
46 lines not on this page · raw message
sound/pci/hda/hda_generic.c +63 -0
63 lines not on this page · raw message
sound/soc/sunxi/sun4i-i2s.c +73 -70
143 lines not on this page · raw message
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c +3 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.