Linux 5.10.226
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.10.226 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.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/s390/kernel/vmlinux.lds.S | 9 arch/um/drivers/line.c | 2 arch/x86/mm/pti.c | 45 +- block/bio-integrity.c | 11 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/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_ring.c | 5 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 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/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/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/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/vega20_hwmgr.c | 8 drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 6 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/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/iio/adc/ad7124.c | 1 drivers/iio/buffer/industrialio-buffer-dmaengine.c | 4 drivers/iio/inkern.c | 8 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.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/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/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 | 4 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 | 23 - 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/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-smbios-base.c | 5 drivers/staging/iio/frequency/ad9834.c | 2 drivers/uio/uio_hv_generic.c | 11 drivers/usb/storage/uas.c | 1 drivers/usb/typec/ucsi/ucsi.h | 2 drivers/usb/usbip/stub_rx.c | 77 ++- fs/btrfs/extent-tree.c | 32 + fs/btrfs/inode.c | 2 fs/btrfs/ioctl.c | 5 fs/btrfs/transaction.c | 24 + fs/btrfs/transaction.h | 2 fs/ext4/page-io.c | 14 fs/fuse/file.c | 8 fs/fuse/xattr.c | 4 fs/lockd/svc.c | 3 fs/nfs/callback.c | 3 fs/nfs/super.c | 2 fs/nfsd/export.c | 32 + fs/nfsd/export.h | 4 fs/nfsd/netns.h | 25 + fs/nfsd/nfs4proc.c | 6 fs/nfsd/nfscache.c | 200 +++++----- fs/nfsd/nfsctl.c | 24 - fs/nfsd/nfsd.h | 1 fs/nfsd/nfsfh.c | 3 fs/nfsd/nfssvc.c | 38 - fs/nfsd/stats.c | 52 +- fs/nfsd/stats.h | 85 +--- fs/nfsd/trace.h | 22 + fs/nfsd/vfs.c | 6 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/squashfs/inode.c | 7 fs/udf/super.c | 24 + include/linux/cgroup-defs.h | 107 +---- include/linux/cgroup.h | 22 - include/linux/fsnotify_backend.h | 8 include/linux/hwspinlock.h | 6 include/linux/i2c.h | 2 include/linux/sunrpc/svc.h | 5 include/net/bluetooth/hci_core.h | 5 kernel/cgroup/cgroup.c | 65 +-- kernel/dma/debug.c | 5 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 | 4 kernel/rcu/tasks.h | 2 kernel/smp.c | 1 kernel/trace/trace.c | 2 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/core/netclassid_cgroup.c | 7 net/core/netprio_cgroup.c | 10 net/ethernet/eth.c | 7 net/ipv4/af_inet.c | 19 net/ipv4/fou.c | 62 +-- net/ipv4/gre_offload.c | 12 net/ipv4/inet_hashtables.c | 2 net/ipv4/tcp_bpf.c | 2 net/ipv4/udp_offload.c | 6 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 | 34 - net/mptcp/pm.c | 24 - net/mptcp/pm_netlink.c | 59 +- net/mptcp/protocol.c | 54 +- net/mptcp/protocol.h | 4 net/mptcp/subflow.c | 50 +- net/netfilter/nf_conncount.c | 8 net/sched/sch_cake.c | 11 net/sched/sch_netem.c | 9 net/sunrpc/stats.c | 2 net/sunrpc/svc.c | 36 + net/sunrpc/xprtrdma/svc_rdma_rw.c | 2 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 tools/lib/bpf/libbpf.c | 4 tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 206 files changed, 1799 insertions(+), 1097 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 (4):
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
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
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 (2):
block: remove the blk_flush_integrity call in blk_integrity_unregister
block: initialize integrity buffer to zero before writing it to media
Chuck Lever (7):
NFSD: Refactor nfsd_reply_cache_free_locked()
NFSD: Rename nfsd_reply_cache_alloc()
NFSD: Replace nfsd_prune_bucket()
NFSD: Refactor the duplicate reply cache shrinker
NFSD: Rewrite synopsis of nfsd_percpu_counters_init()
NFSD: Fix frame size warning in svc_export_parse()
svcrdma: Catch another Reply chunk overflow case
Cong Wang (1):
tcp_bpf: fix return value of tcp_bpf_sendmsg()
Connor O'Brien (2):
bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode bpf, cgroup: Assign cgroup in cgroup_sk_alloc when called from interrupt
Daiwei Li (1):
igb: Fix not clearing TimeSync interrupts for 82580
Dan Carpenter (1):
igc: Unlock on error in igc_io_resume()
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 (1):
iio: adc: ad7124: fix chip ID mismatch
Eric Dumazet (4):
ila: call nf_unregister_net_hooks() sooner
fou: remove sparse errors
gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers
gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlers
Filipe Manana (1):
btrfs: fix use-after-free after failure to create a snapshot
Geert Uytterhoeven (1):
nvmem: Fix return type of devm_nvmem_device_get() in kerneldoc
Greg Kroah-Hartman (1):
Linux 5.10.226
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
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
Jeff Layton (2):
nfsd: move reply cache initialization into nfsd startup
nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net
Jernej Skrabec (1):
iommu: sun50i: clear bypass register
Jesse Zhang (4):
drm/amd/pm: fix warning using uninitialized value of max_vid_step drm/amd/pm: fix the Out-of-bounds read warning 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 (12):
sunrpc: don't change ->sv_stats if it doesn't exist
nfsd: stop setting ->pg_stats for unused stats
sunrpc: pass in the sv_stats struct through svc_create_pooled
sunrpc: remove ->pg_stats from svc_program
sunrpc: use the struct net as the svc proc private
nfsd: rename NFSD_NET_* to NFSD_STATS_*
nfsd: expose /proc/net/sunrpc/nfsd in net namespaces
nfsd: make all of the nfsd stats per-network namespace
nfsd: remove nfsd_stats, make th_cnt a global counter
nfsd: make svc_stat per-network namespace instead of global
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
Krishna Kumar (1):
pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv
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.
Leesoo Ahn (1):
apparmor: fix possible NULL pointer dereference
Len Baker (1):
drivers/net/usb: Remove all strcpy() uses
Liao Chen (1):
mmc: sdhci-of-aspeed: fix module autoloading
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 (5):
drm/amdgpu: Fix uninitialized variable warning in amdgpu_afmt_acr 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()
Matteo Martelli (1):
iio: fix scale application in iio_convert_raw_to_processed_unlocked
Matthieu Baerts (NGI0) (2):
mptcp: pr_debug: add missing \n at the end
mptcp: pm: avoid possible UaF when selecting endp
Maurizio Lombardi (1):
nvmet-tcp: fix kernel crash if commands allocation fails
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
Naman Jain (1):
Drivers: hv: vmbus: Fix rescind handling in uio_hv_generic
NeilBrown (1):
NFSD: simplify error paths in nfsd_svc()
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
Pali Rohár (1):
irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1
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
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
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
Stanislav Fomichev (1):
net: set SOCK_RCU_FREE before inserting socket into hashtable
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
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
Yunjian Wang (1):
netfilter: nf_conncount: fix wrong variable type
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
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 = 10 -SUBLEVEL = 225 +SUBLEVEL = 226 EXTRAVERSION = NAME = Dare mighty things
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
@@ -307,13 +307,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" ;
@@ -324,7 +317,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;
@@ -336,6 +328,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/s390/kernel/vmlinux.lds.S +9 -0
@@ -69,6 +69,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
@@ -378,6 +378,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) {
@@ -401,6 +402,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/mm/pti.c +29 -16
117 lines not on this page · raw message
block/bio-integrity.c +10 -1
@@ -216,6 +216,7 @@ bool bio_integrity_prep(struct bio *bio)unsigned int bytes, offset, i;unsigned int intervals;blk_status_t status; +gfp_t gfp =GFP_NOIO ;if (!bi)return true;
@@ -238,12 +239,20 @@ bool bio_integrity_prep(struct bio *bio)if (!bi->profile->generate_fn || !(bi->flags &BLK_INTEGRITY_GENERATE ))return true; + +/* +* Zero the memory allocated to not leak uninitialized kernel +* memory to disk. For PI this only affects the app tag, but +* for non-integrity metadata it affects the entire metadata +* buffer. +*/ + gfp |= __GFP_ZERO; } intervals =bio_integrity_intervals (bi,bio_sectors (bio));/* Allocate kernel buffer for protection data */ len = intervals * bi->tuple_size; - buf =kmalloc (len,GFP_NOIO | q->bounce_gfp); + buf =kmalloc (len, gfp | q->bounce_gfp); status =BLK_STS_RESOURCE ;if (unlikely (buf ==NULL )) {printk (KERN_ERR "could not allocate integrity buffer\n" );
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
@@ -387,7 +387,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);
@@ -402,7 +402,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
@@ -414,12 +414,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;
@@ -430,10 +430,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
@@ -3530,6 +3530,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
@@ -5429,8 +5429,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
@@ -577,6 +577,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
@@ -1321,8 +1321,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/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
@@ -1626,6 +1626,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_ring.c +3 -2
@@ -260,7 +260,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->priority =DRM_SCHED_PRIORITY_NORMAL ;mutex_init (&ring->priority_mutex); -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)++] =
@@ -368,8 +368,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 +3 -1
@@ -404,6 +404,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++) {
@@ -550,7 +552,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
@@ -313,7 +313,7 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device RAS_CNTLR_INTERRUPT_CLEAR, 1);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
@@ -906,8 +906,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
@@ -182,7 +182,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
@@ -3341,7 +3341,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
@@ -455,7 +455,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/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
@@ -130,13 +130,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;
@@ -310,6 +318,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/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/smu7_hwmgr.c +1 -1
@@ -5190,7 +5190,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/vega20_hwmgr.c +6 -2
@@ -4095,9 +4095,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,
@@ -4159,6 +4161,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
@@ -131,13 +131,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/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
@@ -44,7 +44,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); }
@@ -70,7 +70,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 */
@@ -87,7 +87,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) { }
@@ -108,7 +108,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
@@ -529,6 +529,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 );
@@ -543,12 +544,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/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
@@ -1965,6 +1965,7 @@ int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel)return 0 ; } +EXPORT_SYMBOL_GPL (vmbus_device_unregister);/* * vmbus_remove_channel_attr_group - remove the channel's attribute group
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
@@ -897,7 +897,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;
@@ -922,7 +922,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/iio/adc/ad7124.c +1 -0
@@ -500,6 +500,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)
@@ -207,6 +207,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
@@ -610,17 +610,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/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
@@ -1333,7 +1333,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
@@ -380,6 +380,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
@@ -442,12 +442,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
@@ -207,8 +207,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
@@ -431,8 +431,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 {
@@ -1801,8 +1802,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; }
@@ -1826,8 +1829,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
@@ -948,16 +948,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 = nformats;
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.c +1 -1
@@ -592,7 +592,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
@@ -2826,8 +2826,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
@@ -236,6 +236,7 @@ static const struct of_device_id aspeed_sdhci_of_match[] = { { .compatible = "aspeed,ast2600-sdhci", }, { } }; +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);
@@ -157,8 +157,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; } }
@@ -453,11 +453,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/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
@@ -908,14 +908,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);
@@ -974,6 +978,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,
@@ -3015,7 +3023,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
@@ -537,12 +537,16 @@ static int dpaa_set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) {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;
@@ -565,6 +569,8 @@ static int dpaa_set_coalesce(struct net_device *dev, needs_revert[cpu] = true; } +kfree (needs_revert); +return 0 ; revert_values:
@@ -578,6 +584,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/igb/igb_main.c +10 -0
@@ -6805,10 +6805,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
@@ -5740,6 +5740,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
@@ -210,7 +210,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
@@ -528,18 +528,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);
@@ -559,13 +556,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 +2 -2
@@ -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 ; }
@@ -443,7 +443,7 @@ static int ipheth_probe(struct usb_interface *intf, netdev->netdev_ops = &ipheth_netdev_ops; netdev->watchdog_timeo =IPHETH_TX_TIMEOUT ; -strcpy (netdev->name,"eth%d" ); +strscpy (netdev->name,"eth%d" ,sizeof (netdev->name)); dev =netdev_priv (netdev); dev->udev = udev;
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
@@ -480,17 +480,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
@@ -1365,6 +1365,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
@@ -326,6 +326,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);
@@ -356,11 +357,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 +10 -13
@@ -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 );
@@ -148,12 +145,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);
@@ -161,6 +159,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);
@@ -1693,8 +1692,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) dev->interrupt_count =0 ; dev->net = net; -strcpy (net->name,"usb%d" ); -memcpy (net->dev_addr, node_id,sizeof node_id); +strscpy (net->name,"usb%d" ,sizeof (net->name));/* rx and tx sides can use different message sizes; * bind() should set rx_urb_size in that case.
@@ -1720,13 +1718,13 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)if ((dev->driver_info->flags &FLAG_ETHER ) !=0 && ((dev->driver_info->flags &FLAG_POINTTOPOINT ) ==0 || (net->dev_addr [0 ] &0x02 ) ==0 )) -strcpy (net->name,"eth%d" ); +strscpy (net->name,"eth%d" ,sizeof (net->name));/* WLAN devices should always be named "wlan%d" */ if ((dev->driver_info->flags &FLAG_WLAN ) !=0 ) -strcpy (net->name,"wlan%d" ); +strscpy (net->name,"wlan%d" ,sizeof (net->name));/* WWAN devices should always be named "wwan%d" */ if ((dev->driver_info->flags &FLAG_WWAN ) !=0 ) -strcpy (net->name,"wwan%d" ); +strscpy (net->name,"wwan%d" ,sizeof (net->name));/* devices that cannot do ARP */ if ((dev->driver_info->flags &FLAG_NOARP ) !=0 )
@@ -1768,9 +1766,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);
@@ -2180,7 +2178,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
@@ -1497,7 +1497,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);
@@ -1508,7 +1508,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq)return ;if (__netif_tx_trylock (txq)) { -free_old_xmit_skbs (sq, true); +free_old_xmit_skbs (sq, !!budget);__netif_tx_unlock (txq); }
@@ -1525,7 +1525,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);
@@ -1598,7 +1598,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); opaque =virtqueue_enable_cb_prepare (sq->vq);
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +1 -0
@@ -1089,6 +1089,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
@@ -275,8 +275,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
@@ -72,7 +72,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
@@ -577,11 +577,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;
@@ -602,7 +597,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/target/tcp.c +3 -1
@@ -1787,8 +1787,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
@@ -962,13 +962,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
@@ -250,18 +250,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 >>20 ) -1 ;
@@ -295,6 +301,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)
@@ -313,7 +321,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
@@ -5260,10 +5260,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); } }
@@ -5275,8 +5277,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 */
@@ -5284,15 +5288,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 ;
@@ -5300,8 +5304,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 ; }
@@ -5333,9 +5339,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); } }
@@ -5361,14 +5368,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 ;
@@ -5379,7 +5385,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-smbios-base.c +4 -1
@@ -610,7 +610,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
@@ -115,7 +115,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. */ static void hv_uio_rescind (struct vmbus_channel *channel) { -struct hv_device *hv_dev = channel->primary_channel->device_obj; +struct hv_device *hv_dev = channel->device_obj;struct hv_uio_private_data *pdata =hv_get_drvdata (hv_dev);/*
@@ -118,6 +119,14 @@ static void hv_uio_rescind(struct vmbus_channel *channel)/* Wake up reader */ uio_event_notify (&pdata->info); + +/* +* With rescind callback registered, rescind path will not unregister the device +* from vmbus when the primary channel is rescinded. +* Without it, rescind handling is incomplete and next onoffer msg does not come. +* Unregister the device from vmbus here. +*/ +vmbus_device_unregister (channel->device_obj); }/* Sysfs API to allow mmap of the ring buffers
drivers/usb/storage/uas.c +1 -0
@@ -424,6 +424,7 @@ static void uas_data_cmplt(struct urb *urb)uas_log_cmd_state (cmnd,"data cmplt err" , status);/* error: no data transfered */ scsi_set_resid (cmnd, sdb->length); +set_host_byte (cmnd,DID_ERROR ); }else {scsi_set_resid (cmnd, sdb->length - urb->actual_length); }
drivers/usb/typec/ucsi/ucsi.h +1 -1
@@ -365,7 +365,7 @@ ucsi_register_displayport(struct ucsi_connector *con, bool override, int offset, struct typec_altmode_desc *desc) { - return NULL; + return typec_port_register_altmode(con->port, desc); } static inline void
drivers/usb/usbip/stub_rx.c +50 -27
139 lines not on this page · raw message
fs/btrfs/extent-tree.c +25 -7
@@ -4806,7 +4806,15 @@ static noinline void reada_walk_down(struct btrfs_trans_handle *trans,/* We don't care about errors in readahead. */ if (ret <0 )continue ; -BUG_ON (refs ==0 ); + +/* +* This could be racey, it's conceivable that we raced and end +* up with a bogus refs count, if that's the case just skip, if +* we are actually corrupt we will notice when we look up +* everything again with our locks. +*/ +if (refs ==0 ) +continue ;if (wc->stage ==DROP_REFERENCE ) {if (refs ==1 )
@@ -4865,7 +4873,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,if (lookup_info && ((wc->stage ==DROP_REFERENCE && wc->refs[level] !=1 ) || (wc->stage ==UPDATE_BACKREF && !(wc->flags[level] & flag)))) { -BUG_ON (!path->locks[level]); +ASSERT (path->locks[level]); ret = btrfs_lookup_extent_info(trans, fs_info, eb->start, level, 1, &wc->refs[level],
@@ -4873,7 +4881,11 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,BUG_ON (ret == -ENOMEM );if (ret)return ret; -BUG_ON (wc->refs[level] ==0 ); +if (unlikely (wc->refs[level] ==0 )) { +btrfs_err (fs_info,"bytenr %llu has 0 references, expect > 0" , + eb->start); +return -EUCLEAN ; + } }if (wc->stage ==DROP_REFERENCE ) {
@@ -4889,7 +4901,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,/* wc->stage == UPDATE_BACKREF */ if (!(wc->flags[level] & flag)) { -BUG_ON (!path->locks[level]); +ASSERT (path->locks[level]); ret =btrfs_inc_ref (trans, root, eb,1 );BUG_ON (ret);/* -ENOMEM */ ret =btrfs_dec_ref (trans, root, eb,0 );
@@ -5006,8 +5018,9 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans, goto out_unlock;if (unlikely (wc->refs[level -1 ] ==0 )) { -btrfs_err (fs_info,"Missing references." ); - ret = -EIO ; +btrfs_err (fs_info,"bytenr %llu has 0 references, expect > 0" , + bytenr); + ret = -EUCLEAN ; goto out_unlock; } *lookup_info =0 ;
@@ -5209,7 +5222,12 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans, path->locks[level] =0 ;return ret; } -BUG_ON (wc->refs[level] ==0 ); +if (unlikely (wc->refs[level] ==0 )) { +btrfs_tree_unlock_rw (eb, path->locks[level]); +btrfs_err (fs_info,"bytenr %llu has 0 references, expect > 0" , + eb->start); +return -EUCLEAN ; + }if (wc->refs[level] ==1 ) {btrfs_tree_unlock_rw (eb, path->locks[level]); path->locks[level] =0 ;
fs/btrfs/inode.c +1 -1
@@ -5527,7 +5527,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)struct inode *inode;struct btrfs_root *root =BTRFS_I (dir)->root;struct btrfs_root *sub_root = root; -struct btrfs_key location; +struct btrfs_key location = {0 };u8 di_type =0 ;int ret =0 ;
fs/btrfs/ioctl.c +1 -4
@@ -853,10 +853,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir, goto fail; } -spin_lock (&fs_info->trans_lock); -list_add (&pending_snapshot->list, - &trans->transaction->pending_snapshots); -spin_unlock (&fs_info->trans_lock); + trans->pending_snapshot = pending_snapshot; ret =btrfs_commit_transaction (trans);if (ret)
fs/btrfs/transaction.c +24 -0
@@ -2075,6 +2075,27 @@ static inline void btrfs_wait_delalloc_flush(struct btrfs_trans_handle *trans) } } +/* +* Add a pending snapshot associated with the given transaction handle to the +* respective handle. This must be called after the transaction commit started +* and while holding fs_info->trans_lock. +* This serves to guarantee a caller of btrfs_commit_transaction() that it can +* safely free the pending snapshot pointer in case btrfs_commit_transaction() +* returns an error. +*/ +static void add_pending_snapshot (struct btrfs_trans_handle *trans) +{ +struct btrfs_transaction *cur_trans = trans->transaction; + +if (!trans->pending_snapshot) +return ; + +lockdep_assert_held (&trans->fs_info->trans_lock); +ASSERT (cur_trans->state >=TRANS_STATE_COMMIT_START ); + +list_add (&trans->pending_snapshot->list, &cur_trans->pending_snapshots); +} +int btrfs_commit_transaction (struct btrfs_trans_handle *trans) {struct btrfs_fs_info *fs_info = trans->fs_info;
@@ -2161,6 +2182,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)spin_lock (&fs_info->trans_lock);if (cur_trans->state >=TRANS_STATE_COMMIT_START ) { +add_pending_snapshot (trans); +spin_unlock (&fs_info->trans_lock);refcount_inc (&cur_trans->use_count); ret =btrfs_end_transaction (trans);
@@ -2243,6 +2266,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)* COMMIT_DOING so make sure to wait for num_writers to == 1 again. */ spin_lock (&fs_info->trans_lock); +add_pending_snapshot (trans); cur_trans->state =TRANS_STATE_COMMIT_DOING ;spin_unlock (&fs_info->trans_lock); wait_event(cur_trans->writer_wait,
fs/btrfs/transaction.h +2 -0
@@ -122,6 +122,8 @@ struct btrfs_trans_handle {struct btrfs_transaction *transaction;struct btrfs_block_rsv *block_rsv;struct btrfs_block_rsv *orig_rsv; +/* Set by a task that wants to create a snapshot. */ +struct btrfs_pending_snapshot *pending_snapshot;refcount_t use_count;unsigned int type;/*
fs/ext4/page-io.c +12 -2
@@ -493,6 +493,13 @@ int ext4_bio_write_page(struct ext4_io_submit *io,/* A hole? We can safely clear the dirty bit */ if (!buffer_mapped (bh))clear_buffer_dirty (bh); +/* +* Keeping dirty some buffer we cannot write? Make +* sure to redirty the page. This happens e.g. when +* doing writeout for transaction commit. +*/ +if (buffer_dirty (bh) && !PageDirty (page)) +redirty_page_for_writepage (wbc, page);if (io->io_bio)ext4_io_submit (io);continue ;
@@ -500,6 +507,7 @@ int ext4_bio_write_page(struct ext4_io_submit *io,if (buffer_new (bh))clear_buffer_new (bh);set_buffer_async_write (bh); +clear_buffer_dirty (bh); nr_to_submit++; }while ((bh = bh->b_this_page) != head);
@@ -542,7 +550,10 @@ int ext4_bio_write_page(struct ext4_io_submit *io,printk_ratelimited (KERN_ERR "%s: ret = %d\n" , __func__, ret);redirty_page_for_writepage (wbc, page);do { -clear_buffer_async_write (bh); +if (buffer_async_write (bh)) { +clear_buffer_async_write (bh); +set_buffer_dirty (bh); + } bh = bh->b_this_page; }while (bh != head); goto unlock;
@@ -555,7 +566,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io,continue ;io_submit_add_bh (io, inode, page, bounce_page, bh); nr_submitted++; -clear_buffer_dirty (bh); }while ((bh = bh->b_this_page) != head); unlock:
fs/fuse/file.c +7 -1
@@ -1692,10 +1692,16 @@ __acquires(fi->lock)fuse_writepage_finish (fm, wpa);spin_unlock (&fi->lock); -/* After fuse_writepage_finish() aux request list is private */ +/* After rb_erase() aux request list is private */ for (aux = wpa->next; aux; aux = next) { +struct backing_dev_info *bdi =inode_to_bdi (aux->inode); + next = aux->next; aux->next =NULL ; + +dec_wb_stat (&bdi->wb,WB_WRITEBACK ); +dec_node_page_state (aux->ia.ap.pages[0 ],NR_WRITEBACK_TEMP ); +wb_writeout_inc (&bdi->wb);fuse_writepage_free (aux); }
fs/fuse/xattr.c +2 -2
@@ -79,7 +79,7 @@ ssize_t fuse_getxattr(struct inode *inode, const char *name, void *value, } ret =fuse_simple_request (fm, &args);if (!ret && !size) - ret =min_t (ssize_t, outarg.size,XATTR_SIZE_MAX ); + ret =min_t (size_t, outarg.size,XATTR_SIZE_MAX );if (ret == -ENOSYS ) { fm->fc->no_getxattr =1 ; ret = -EOPNOTSUPP ;
@@ -141,7 +141,7 @@ ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size) } ret =fuse_simple_request (fm, &args);if (!ret && !size) - ret =min_t (ssize_t, outarg.size,XATTR_LIST_MAX ); + ret =min_t (size_t, outarg.size,XATTR_LIST_MAX );if (ret >0 && size) ret =fuse_verify_xattr_list (list, ret);if (ret == -ENOSYS ) {
fs/lockd/svc.c +0 -3
@@ -759,8 +759,6 @@ static const struct svc_version *nlmsvc_version[] = {#endif }; -static struct svc_stat nlmsvc_stats; -#define NLM_NRVERS ARRAY_SIZE(nlmsvc_version)static struct svc_program nlmsvc_program = { .pg_prog =NLM_PROGRAM ,/* program number */
@@ -768,7 +766,6 @@ static struct svc_program nlmsvc_program = { .pg_vers = nlmsvc_version, /* version table */ .pg_name = "lockd", /* service name */ .pg_class = "nfsd", /* share authentication with nfsd */ - .pg_stats = &nlmsvc_stats, /* stats table */ .pg_authenticate = &lockd_authenticate, /* export authentication */ .pg_init_request = svc_generic_init_request, .pg_rpcbind_set = svc_generic_rpcbind_set,
fs/nfs/callback.c +0 -3
@@ -407,15 +407,12 @@ static const struct svc_version *nfs4_callback_version[] = { [4] = &nfs4_callback_version4, }; -static struct svc_stat nfs4_callback_stats; -static struct svc_program nfs4_callback_program = { .pg_prog =NFS4_CALLBACK ,/* RPC service number */ .pg_nvers =ARRAY_SIZE (nfs4_callback_version),/* Number of entries */ .pg_vers = nfs4_callback_version,/* version table */ .pg_name ="NFSv4 callback" ,/* service name */ .pg_class ="nfs" ,/* authentication class */ - .pg_stats = &nfs4_callback_stats, .pg_authenticate = nfs_callback_authenticate, .pg_init_request = svc_generic_init_request, .pg_rpcbind_set = svc_generic_rpcbind_set,
fs/nfs/super.c +2 -0
@@ -47,6 +47,7 @@#include <linux/vfs.h> #include <linux/inet.h> #include <linux/in6.h> +#include <linux/sched.h> #include <linux/slab.h> #include <net/ipv6.h> #include <linux/netdevice.h>
@@ -219,6 +220,7 @@ static int __nfs_list_for_each_server(struct list_head *head, ret =fn (server, data);if (ret) goto out; +cond_resched ();rcu_read_lock (); }rcu_read_unlock ();
fs/nfsd/export.c +23 -9
@@ -339,12 +339,16 @@ static int export_stats_init(struct export_stats *stats)static void export_stats_reset (struct export_stats *stats) { -nfsd_percpu_counters_reset (stats->counter,EXP_STATS_COUNTERS_NUM ); +if (stats) +nfsd_percpu_counters_reset (stats->counter, +EXP_STATS_COUNTERS_NUM ); }static void export_stats_destroy (struct export_stats *stats) { -nfsd_percpu_counters_destroy (stats->counter,EXP_STATS_COUNTERS_NUM ); +if (stats) +nfsd_percpu_counters_destroy (stats->counter, +EXP_STATS_COUNTERS_NUM ); }static void svc_export_put (struct kref *ref)
@@ -353,7 +357,8 @@ static void svc_export_put(struct kref *ref)path_put (&exp->ex_path);auth_domain_put (exp->ex_client);nfsd4_fslocs_free (&exp->ex_fslocs); -export_stats_destroy (&exp->ex_stats); +export_stats_destroy (exp->ex_stats); +kfree (exp->ex_stats);kfree (exp->ex_uuid);kfree_rcu (exp, ex_rcu); }
@@ -738,13 +743,15 @@ static int svc_export_show(struct seq_file *m,seq_putc (m,'\t' );seq_escape (m, exp->ex_client->name," \t\n\\" );if (export_stats) { -seq_printf (m,"\t%lld\n" , exp->ex_stats.start_time); +struct percpu_counter *counter = exp->ex_stats->counter; + +seq_printf (m,"\t%lld\n" , exp->ex_stats->start_time);seq_printf (m,"\tfh_stale: %lld\n" , -percpu_counter_sum_positive (&exp->ex_stats.counter[EXP_STATS_FH_STALE ])); +percpu_counter_sum_positive (&counter[EXP_STATS_FH_STALE ]));seq_printf (m,"\tio_read: %lld\n" , -percpu_counter_sum_positive (&exp->ex_stats.counter[EXP_STATS_IO_READ ])); +percpu_counter_sum_positive (&counter[EXP_STATS_IO_READ ]));seq_printf (m,"\tio_write: %lld\n" , -percpu_counter_sum_positive (&exp->ex_stats.counter[EXP_STATS_IO_WRITE ])); +percpu_counter_sum_positive (&counter[EXP_STATS_IO_WRITE ]));seq_putc (m,'\n' );return 0 ; }
@@ -790,7 +797,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) new->ex_layout_types =0 ; new->ex_uuid =NULL ; new->cd = item->cd; -export_stats_reset (&new->ex_stats); +export_stats_reset (new->ex_stats); }static void export_update (struct cache_head *cnew,struct cache_head *citem)
@@ -826,7 +833,14 @@ static struct cache_head *svc_export_alloc(void)if (!i)return NULL ; -if (export_stats_init (&i->ex_stats)) { + i->ex_stats =kmalloc (sizeof (*(i->ex_stats)),GFP_KERNEL ); +if (!i->ex_stats) { +kfree (i); +return NULL ; + } + +if (export_stats_init (i->ex_stats)) {
Lines of this file are not shown. View the raw message.
fs/nfsd/nfscache.c +119 -81
200 lines not on this page · raw message
fs/nfsd/stats.c +21 -31
52 lines not on this page · raw message
fs/nfsd/stats.h +32 -53
85 lines not on this page · raw message
fs/nilfs2/sysfs.c +70 -47
117 lines not on this page · raw message
include/linux/cgroup-defs.h +27 -80
107 lines not on this page · raw message
kernel/cgroup/cgroup.c +21 -44
65 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 +35 -27
62 lines not on this page · raw message
net/mptcp/pm_netlink.c +32 -27
59 lines not on this page · raw message
net/mptcp/protocol.c +27 -27
54 lines not on this page · raw message
net/mptcp/subflow.c +25 -25
50 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
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.