Linux 6.1.109
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.109 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.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 block/blk-integrity.c | 2 drivers/base/regmap/regmap-spi.c | 3 drivers/cpufreq/scmi-cpufreq.c | 4 drivers/dma/altera-msgdma.c | 9 drivers/gpu/drm/amd/amdgpu/amdgpu_afmt.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c | 6 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.h | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 5 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 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 | 19 - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 3 drivers/gpu/drm/amd/display/dc/core/dc.c | 1 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb_scl.c | 3 drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c | 7 drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 7 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/amd_powerplay.c | 2 drivers/gpu/drm/amd/pm/powerplay/hwmgr/pp_psm.c | 13 - drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 5 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 29 ++ drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 2 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 15 + drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 60 ++++- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 20 + drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 31 ++ drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 6 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 27 +- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 14 + drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 drivers/gpu/drm/bridge/tc358767.c | 2 drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 drivers/gpu/drm/meson/meson_plane.c | 17 + drivers/hwmon/k10temp.c | 36 ++- drivers/hwspinlock/hwspinlock_core.c | 28 ++ drivers/hwspinlock/hwspinlock_internal.h | 3 drivers/iio/industrialio-core.c | 7 drivers/iio/industrialio-event.c | 9 drivers/iio/inkern.c | 32 ++ drivers/infiniband/hw/efa/efa_com.c | 30 +- drivers/media/usb/uvc/uvc_driver.c | 18 + drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 drivers/net/usb/qmi_wwan.c | 1 drivers/net/virtio_net.c | 8 drivers/net/wireless/ath/ath11k/qmi.c | 2 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/realtek/rtw89/ser.c | 8 drivers/pci/controller/dwc/pcie-al.c | 16 + drivers/pci/msi/msi.c | 10 drivers/ufs/core/ufshcd.c | 3 drivers/usb/typec/ucsi/ucsi.h | 2 drivers/usb/usbip/stub_rx.c | 77 ++++--- fs/ext4/extents.c | 2 fs/ext4/inode.c | 5 fs/ext4/page-io.c | 14 + fs/f2fs/f2fs.h | 1 fs/f2fs/file.c | 42 +++ fs/f2fs/inode.c | 8 fs/notify/fsnotify.c | 31 +- fs/notify/fsnotify.h | 2 fs/notify/mark.c | 32 ++ fs/udf/super.c | 9 include/clocksource/timer-xilinx.h | 2 include/linux/fsnotify_backend.h | 8 include/linux/hwspinlock.h | 6 include/linux/i2c.h | 2 kernel/dma/debug.c | 5 kernel/rcu/tree.h | 1 kernel/rcu/tree_nocb.h | 32 -- net/bluetooth/sco.c | 76 ++++--- net/mptcp/options.c | 50 ++-- net/mptcp/pm.c | 28 +- net/mptcp/pm_netlink.c | 151 ++++++++------ net/mptcp/protocol.c | 58 ++--- net/mptcp/protocol.h | 10 net/mptcp/sockopt.c | 4 net/mptcp/subflow.c | 50 ++-- net/wireless/scan.c | 46 +++- security/apparmor/apparmorfs.c | 4 security/smack/smack_lsm.c | 2 sound/pci/hda/hda_generic.c | 63 +++++ sound/pci/hda/hda_generic.h | 1 sound/pci/hda/patch_conexant.c | 2 sound/soc/amd/yc/acp6x-mach.c | 7 tools/testing/selftests/net/mptcp/mptcp_join.sh | 136 ++++++++++-- 102 files changed, 1141 insertions(+), 489 deletions(-)
Abhishek Pandit-Subedi (1):
usb: typec: ucsi: Fix null pointer dereference in trace
Aleksandr Mishin (1):
PCI: al: Check IORESOURCE_BUS existence during probe
Alex Hung (6):
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: Spinlock before reading event drm/amd/display: Ensure index calculation will not overflow drm/amd/display: Skip wbscl_set_scaler_filter if filter is null
Alvin Lee (1):
drm/amd/display: Assign linear_pitch_alignment even for VM
Amir Goldstein (1):
fsnotify: clear PARENT_WATCHED flags lazily
Andy Shevchenko (1):
regmap: spi: Fix potential off-by-one when calculating reserved size
Asad Kamal (1):
drm/amd/amdgpu: Check tbo resource pointer
Breno Leitao (1):
virtio_net: Fix napi_skb_cache_put warning
Casey Schaufler (1):
smack: tcp: ipv4, fix incorrect labeling
Chao Yu (1):
f2fs: fix to truncate preallocated blocks in f2fs_file_open()
Christoph Hellwig (1):
block: remove the blk_flush_integrity call in blk_integrity_unregister
Dragos Tatulea (1):
net/mlx5e: SHAMPO, Fix incorrect page release
Eric Biggers (1):
ext4: reject casefold inode flag without casefold feature
Frederic Weisbecker (1):
rcu/nocb: Remove buggy bypass lock contention mitigation
Geliang Tang (1):
mptcp: make pm_remove_addrs_and_subflows static
Greg Kroah-Hartman (1):
Linux 6.1.109
Haoran Liu (1):
drm/meson: plane: Add error handling
Hersen Wu (4):
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 drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration
Jagadeesh Kona (1):
cpufreq: scmi: Avoid overflow of target_freq in fast switch
Jan Kara (2):
udf: Limit file size to 4TB
ext4: handle redirtying in ext4_bio_write_page()
Jeff Johnson (1):
wifi: ath11k: initialize 'ret' in ath11k_qmi_load_file_target_mem()
Jesse Zhang (9):
drm/amd/pm: fix uninitialized variable warning drm/amd/pm: fix warning using uninitialized value of max_vid_step drm/amd/pm: Fix negative array index read
drm/amd/pm: fix the Out-of-bounds read warning drm/amdgpu: fix dereference after null check drm/amdgpu: fix the waring dereferencing hive drm/amd/pm: check specific index for aldebaran drm/amdgpu: the warning dereferencing obj for nbio_v7_4 drm/amd/pm: check negtive return for table entries
Johannes Berg (1):
wifi: cfg80211: make hash table duplicates more survivable
Julien Stephan (1):
driver: iio: add missing checks on iio_info's callback access
Ken Sloat (1):
pwm: xilinx: Fix u32 overflow issue in 32-bit width PWM mode.
Krzysztof Stępniak (1):
ASoC: amd: yc: Support mic on Lenovo Thinkpad E14 Gen 6
Leesoo Ahn (1):
apparmor: fix possible NULL pointer dereference
Luiz Augusto von Dentz (1):
Bluetooth: SCO: Fix possible circular locking dependency on sco_connect_cfm
Ma Jun (7):
drm/amdgpu: Fix uninitialized variable warning in amdgpu_afmt_acr drm/amdgpu/pm: Check the return value of smum_send_msg_to_smc drm/amdgpu/pm: Fix uninitialized variable warning for smu10 drm/amdgpu/pm: Fix uninitialized variable agc_btc_response drm/amdgpu: Fix out-of-bounds write warning
drm/amdgpu: Fix out-of-bounds read of df_v1_7_channel_number drm/amdgpu/pm: Check input value for CUSTOM profile mode setting on legacy SOCs
Marek Vasut (1):
drm/bridge: tc358767: Check if fully initialized before signalling HPD event via IRQ
Matthieu Baerts (NGI0) (17):
mptcp: pm: fix RM_ADDR ID for the initial subflow
mptcp: pm: fullmesh: select the right ID later
mptcp: pm: avoid possible UaF when selecting endp
mptcp: pm: reuse ID 0 after delete and re-add
mptcp: pm: fix ID 0 endp usage after multiple re-creations
selftests: mptcp: join: validate fullmesh endp on 1st sf
selftests: mptcp: join: check re-using ID of closed subflow
selftests: mptcp: add explicit test case for remove/readd
selftests: mptcp: join: test for flush/re-add endpoints
selftests: mptcp: join: check re-using ID of unused ADD_ADDR
selftests: mptcp: join: check re-adding init endp with != id
mptcp: pr_debug: add missing \n at the end
mptcp: avoid duplicated SUB_CLOSED events
selftests: mptcp: join: check removing ID 0 endpoint
selftests: mptcp: join: no extra msg if no counter
selftests: mptcp: join: check re-re-adding ID 0 endp
selftests: mptcp: join: cannot rm sf if closed
Michael Chen (1):
drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device
Michael Margolin (1):
RDMA/efa: Properly handle unexpected AQ completions
Mostafa Saleh (1):
PCI/MSI: Fix UAF in msi_capability_init
Olivier Dautricourt (2):
dmaengine: altera-msgdma: use irq variant of spin_lock/unlock while invoking callbacks
dmaengine: altera-msgdma: properly free descriptor in msgdma_free_descriptor
Pauli Virtanen (1):
Bluetooth: SCO: fix sco_conn related locking and validity issues
Peter Wang (1):
scsi: ufs: core: Bypass quick recovery if force reset is needed
Philip Mueller (1):
drm: panel-orientation-quirks: Add quirk for OrangePi Neo
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
Shahar S Matityahu (1):
wifi: iwlwifi: remove fw_running op
Shannon Nelson (1):
ionic: fix potential irq name truncation
Simon Holesch (1):
usbip: Don't submit special requests twice
Takashi Iwai (2):
ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
ALSA: hda/conexant: Mute speakers at suspend / shutdown
Tao Zhou (1):
drm/amdgpu: update type of buf size to u32 for eeprom functions
Tim Huang (6):
drm/amdgpu: fix overflowed array index read warning drm/amd/pm: fix uninitialized variable warning for smu8_hwmgr drm/amd/pm: fix uninitialized variable warnings for vega10_hwmgr drm/amd/pm: fix uninitialized variable warnings for vangogh_ppt drm/amdgpu: fix ucode out-of-bounds read warning drm/amdgpu: fix mc_data out-of-bounds read warning
Wayne Lin (1):
drm/amd/display: Correct the defined value for AMDGPU_DMUB_NOTIFICATION_MAX
Yazen Ghannam (1):
hwmon: (k10temp) Check return value of amd_smn_read()
ZHANG Yuntian (1):
net: usb: qmi_wwan: add MeiG Smart SRM825L
Zhigang Luo (1):
drm/amdgpu: avoid reading vf2pf info size from FB
Zong-Zhe Yang (1):
wifi: rtw89: ser: avoid multiple deinit on same CAM
winstang (1):
drm/amd/display: added NULL check at start of dc_validate_stream
zhanchengbin (1):
ext4: fix inode tree inconsistency caused by ENOMEM
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 = 6 PATCHLEVEL = 1 -SUBLEVEL = 108 +SUBLEVEL = 109 EXTRAVERSION = NAME = Curry Ramen
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/base/regmap/regmap-spi.c +1 -2
@@ -122,8 +122,7 @@ static const struct regmap_bus *regmap_get_spi_bus(struct spi_device *spi,return ERR_PTR (-ENOMEM ); max_msg_size =spi_max_message_size (spi); - reg_reserve_size = config->reg_bits /BITS_PER_BYTE - + config->pad_bits /BITS_PER_BYTE ; + reg_reserve_size = (config->reg_bits + config->pad_bits) /BITS_PER_BYTE ;if (max_size + reg_reserve_size > max_msg_size) max_size -= reg_reserve_size;
drivers/cpufreq/scmi-cpufreq.c +2 -2
@@ -62,9 +62,9 @@ static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq) {struct scmi_data *priv = policy->driver_data; +unsigned long freq = target_freq; -if (!perf_ops->freq_set (ph, priv->domain_id, - target_freq *1000 , true)) +if (!perf_ops->freq_set (ph, priv->domain_id, freq *1000 , true))return target_freq;return 0 ;
drivers/dma/altera-msgdma.c +4 -5
@@ -233,7 +233,7 @@ static void msgdma_free_descriptor(struct msgdma_device *mdev,struct msgdma_sw_desc *child, *next; mdev->desc_free_cnt++; -list_add_tail (&desc->node, &mdev->free_list); +list_move_tail (&desc->node, &mdev->free_list);list_for_each_entry_safe (child, next, &desc->tx_list, node) { mdev->desc_free_cnt++;list_move_tail (&child->node, &mdev->free_list);
@@ -583,17 +583,16 @@ static void msgdma_issue_pending(struct dma_chan *chan)static void msgdma_chan_desc_cleanup (struct msgdma_device *mdev) {struct msgdma_sw_desc *desc, *next; +unsigned long irqflags;list_for_each_entry_safe (desc, next, &mdev->done_list, node) {struct dmaengine_desc_callback cb; -list_del (&desc->node); -dmaengine_desc_get_callback (&desc->async_tx, &cb);if (dmaengine_desc_callback_valid (&cb)) { -spin_unlock (&mdev->lock); +spin_unlock_irqrestore (&mdev->lock, irqflags);dmaengine_desc_callback_invoke (&cb,NULL ); -spin_lock (&mdev->lock); +spin_lock_irqsave (&mdev->lock, irqflags); }/* Run any dependencies, then free the descriptor */
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
@@ -1476,6 +1476,8 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev, (u32 )le32_to_cpu (*((u32 *)reg_data + j)); j++; }else if ((reg_table->mc_reg_address[i].pre_reg_data &LOW_NIBBLE_MASK ) ==DATA_EQU_PREV ) { +if (i ==0 ) +continue ; reg_table->mc_reg_table_entry[num_ranges].mc_data[i] = reg_table->mc_reg_table_entry[num_ranges].mc_data[i -1 ]; }
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +3 -0
@@ -213,6 +213,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,struct amdgpu_firmware_info *ucode; id =fw_type_convert (cgs_device, type); +if (id >=AMDGPU_UCODE_ID_MAXIMUM ) +return -EINVAL ; + ucode = &adev->firmware.ucode[id];if (ucode->fw ==NULL )return -EINVAL ;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -2
@@ -4560,7 +4560,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) shadow = vmbo->shadow;/* No need to recover an evicted BO */ -if (shadow->tbo.resource->mem_type !=TTM_PL_TT || +if (!shadow->tbo.resource || + shadow->tbo.resource->mem_type !=TTM_PL_TT || shadow->tbo.resource->start ==AMDGPU_BO_INVALID_OFFSET || shadow->parent->tbo.resource->mem_type !=TTM_PL_VRAM )continue ;
@@ -5390,7 +5391,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,* to put adev in the 1st position. */ INIT_LIST_HEAD (&device_list); -if (!amdgpu_sriov_vf (adev) && (adev->gmc.xgmi.num_physical_nodes >1 )) { +if (!amdgpu_sriov_vf (adev) && (adev->gmc.xgmi.num_physical_nodes >1 ) && hive) {list_for_each_entry (tmp_adev, &hive->device_list, gmc.xgmi.head) {list_add_tail (&tmp_adev->reset_list, &device_list);if (gpu_reset_for_dev_remove && adev->shutdown)
drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c +3 -3
@@ -179,7 +179,7 @@ static int __amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,* Returns the number of bytes read/written; -errno on error. */ static int amdgpu_eeprom_xfer (struct i2c_adapter *i2c_adap,u32 eeprom_addr, -u8 *eeprom_buf,u16 buf_size,bool read) +u8 *eeprom_buf,u32 buf_size,bool read) {const struct i2c_adapter_quirks *quirks = i2c_adap->quirks;u16 limit;
@@ -226,7 +226,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,int amdgpu_eeprom_read (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes) +u32 bytes) {return amdgpu_eeprom_xfer (i2c_adap, eeprom_addr, eeprom_buf, bytes, true);
@@ -234,7 +234,7 @@ int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,int amdgpu_eeprom_write (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes) +u32 bytes) {return amdgpu_eeprom_xfer (i2c_adap, eeprom_addr, eeprom_buf, bytes, false);
drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.h +2 -2
@@ -28,10 +28,10 @@int amdgpu_eeprom_read (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes); +u32 bytes);int amdgpu_eeprom_write (struct i2c_adapter *i2c_adap,u32 eeprom_addr,u8 *eeprom_buf, -u16 bytes); +u32 bytes);#endif
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -1297,6 +1297,9 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp,uint8_t dst_num_links = node_info.num_links; hive =amdgpu_get_xgmi_hive (psp->adev); +if (WARN_ON (!hive)) +return ; +list_for_each_entry (mirror_adev, &hive->device_list, gmc.xgmi.head) {struct psp_xgmi_topology_info *mirror_top_info;int j;
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -2
@@ -324,7 +324,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->max_dw = max_dw; ring->hw_prio = hw_prio; -if (!ring->no_scheduler) { +if (!ring->no_scheduler && ring->funcs->type <AMDGPU_HW_IP_NUM ) { hw_ip = ring->funcs->type; num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds; adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
@@ -434,8 +434,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 +1 -1
@@ -604,7 +604,7 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev) vf2pf_info->dummy_page_addr = (uint64_t )adev->dummy_page_addr; 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
@@ -384,7 +384,7 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_deviceelse WREG32_SOC15 (NBIO ,0 , mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); -if (!ras->disable_ras_err_cnt_harvest) { +if (ras && !ras->disable_ras_err_cnt_harvest && obj) {/* * clear error status after ras_controller_intr * according to hw team and count ue number
drivers/gpu/drm/amd/amdkfd/kfd_crat.h +0 -2
@@ -43,8 +43,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
@@ -972,8 +972,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
@@ -146,7 +146,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 +10 -9
@@ -4359,7 +4359,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.
@@ -8052,15 +8055,13 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, bundle->stream_update.vrr_infopacket = &acrtc_state->stream->vrr_infopacket; } - }else if (cursor_update && acrtc_state->active_planes >0 && - acrtc_attach->base.state->event) { -drm_crtc_vblank_get (pcrtc); - + }else if (cursor_update && acrtc_state->active_planes >0 ) {spin_lock_irqsave (&pcrtc->dev->event_lock, flags); - - acrtc_attach->event = acrtc_attach->base.state->event; - acrtc_attach->base.state->event =NULL ; - +if (acrtc_attach->base.state->event) { +drm_crtc_vblank_get (pcrtc); + acrtc_attach->event = acrtc_attach->base.state->event; + acrtc_attach->base.state->event =NULL ; + }spin_unlock_irqrestore (&pcrtc->dev->event_lock, flags); }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
@@ -49,7 +49,7 @@#define AMDGPU_DM_MAX_NUM_EDP 2 -#define AMDGPU_DMUB_NOTIFICATION_MAX 5 +#define AMDGPU_DMUB_NOTIFICATION_MAX 6/* #include "include/amdgpu_dal_power_if.h"
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +2 -1
@@ -484,7 +484,8 @@ static void build_watermark_ranges(struct clk_bw_params *bw_params, struct pp_sm ranges->reader_wm_sets[num_valid_sets].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ;/* Modify previous watermark range to cover up to max */ - ranges->reader_wm_sets[num_valid_sets -1 ].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ; +if (num_valid_sets >0 ) + ranges->reader_wm_sets[num_valid_sets -1 ].max_fill_clk_mhz =PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX ; } num_valid_sets++; }
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1265,6 +1265,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)return NULL ;if (init_params->dce_environment ==DCE_ENV_VIRTUAL_HW ) { + dc->caps.linear_pitch_alignment =64 ;if (!dc_construct_ctx (dc, init_params)) goto destruct_dc; }else {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -3629,6 +3629,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,enum dc_status dc_validate_stream (struct dc *dc,struct dc_stream_state *stream) { +if (dc ==NULL || stream ==NULL ) +return DC_ERROR_UNEXPECTED ; +struct dc_link *link = stream->link;struct timing_generator *tg = dc->res_pool->timing_generators[0 ];enum dc_status res =DC_OK ;
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/dml/calcs/dcn_calcs.c +3 -4
@@ -1453,10 +1453,9 @@ void dcn_bw_update_from_pplib_fclks(ASSERT (fclks->num_levels); vmin0p65_idx =0 ; - vmid0p72_idx = fclks->num_levels - - (fclks->num_levels >2 ?3 : (fclks->num_levels >1 ?2 :1 )); - vnom0p8_idx = fclks->num_levels - (fclks->num_levels >1 ?2 :1 ); - vmax0p9_idx = fclks->num_levels -1 ; + vmid0p72_idx = fclks->num_levels >2 ? fclks->num_levels -3 :0 ; + vnom0p8_idx = fclks->num_levels >1 ? fclks->num_levels -2 :0 ; + vmax0p9_idx = fclks->num_levels >0 ? fclks->num_levels -1 :0 ; dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 =32 * (fclks->data[vmin0p65_idx].clocks_in_khz /1000.0 ) /1000.0 ;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +6 -1
@@ -1099,8 +1099,13 @@ void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib)// Total Available Pipes Support Check for (k =0 ; k < mode_lib->vba.NumberOfActivePlanes; ++k) { - total_pipes += mode_lib->vba.DPPPerPlane[k]; pipe_idx =get_pipe_idx (mode_lib, k); +if (pipe_idx ==-1 ) { +ASSERT (0 ); +continue ;// skip inactive planes + } + total_pipes += mode_lib->vba.DPPPerPlane[k]; +if (mode_lib->vba.cache_pipes[pipe_idx].clks_cfg.dppclk_mhz >0.0 ) mode_lib->vba.DPPCLK[k] = mode_lib->vba.cache_pipes[pipe_idx].clks_cfg.dppclk_mhz;else
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +13 -4
@@ -56,7 +56,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 );
@@ -112,7 +112,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]); }
@@ -239,6 +239,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]; }
@@ -247,6 +250,9 @@ static void set_pin_busy( enum gpio_id id, uint32_t en) { +if (id ==GPIO_ID_UNKNOWN ) +return ; + service->busyness[id][en] = true; }
@@ -255,6 +261,9 @@ static void set_pin_free( enum gpio_id id, uint32_t en) { +if (id ==GPIO_ID_UNKNOWN ) +return ; + service->busyness[id][en] = false; }
@@ -263,7 +272,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 ; }
@@ -277,7 +286,7 @@ enum gpio_result dal_gpio_service_unlock( enum gpio_id id, uint32_t en) { -if (!service->busyness[id]) { +if (id !=GPIO_ID_UNKNOWN && !service->busyness[id]) {ASSERT_CRITICAL (false);return GPIO_RESULT_OPEN_FAILED ; }
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +15 -2
@@ -131,13 +131,21 @@ static bool hdmi_14_process_transaction(const uint8_t hdcp_i2c_addr_link_primary =0x3a ;/* 0x74 >> 1*/ const uint8_t hdcp_i2c_addr_link_secondary =0x3b ;/* 0x76 >> 1*/ struct i2c_command i2c_command; -uint8_t offset = hdcp_i2c_offsets[message_info->msg_id]; +uint8_t offset;struct i2c_payload i2c_payloads[] = { - { true,0 ,1 , &offset }, + { true,0 ,1 ,0 },/* actual hdcp payload, will be filled later, zeroed for now*/ {0 } }; +if (message_info->msg_id ==HDCP_MESSAGE_ID_INVALID ) { +DC_LOG_ERROR ("%s: Invalid message_info msg_id - %d\n" , __func__, message_info->msg_id); +return false; + } + + offset = hdcp_i2c_offsets[message_info->msg_id]; + i2c_payloads[0 ].data = &offset; +switch (message_info->link) {case HDCP_LINK_SECONDARY : i2c_payloads[0 ].address = hdcp_i2c_addr_link_secondary;
@@ -311,6 +319,11 @@ static bool dp_11_process_transaction( struct dc_link *link, struct hdcp_protection_message *message_info) { +if (message_info->msg_id ==HDCP_MESSAGE_ID_INVALID ) { +DC_LOG_ERROR ("%s: Invalid message_info msg_id - %d\n" , __func__, message_info->msg_id); +return false; + } + return dpcd_access_helper( link, message_info->length,
drivers/gpu/drm/amd/display/modules/hdcp/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/amd_powerplay.c +1 -1
@@ -99,7 +99,7 @@ static void pp_swctf_delayed_work_handler(struct work_struct *work)struct amdgpu_device *adev = hwmgr->adev;struct amdgpu_dpm_thermal *range = &adev->pm.dpm.thermal; -uint32_t gpu_temperature, size; +uint32_t gpu_temperature, size =sizeof (gpu_temperature);int ret;/*
drivers/gpu/drm/amd/pm/powerplay/hwmgr/pp_psm.c +8 -5
@@ -30,9 +30,8 @@ int psm_init_power_state_table(struct pp_hwmgr *hwmgr) {int result;unsigned int i; -unsigned int table_entries;struct pp_power_state *state; -int size; +int size, table_entries;if (hwmgr->hwmgr_func->get_num_of_pp_table_entries ==NULL )return 0 ;
@@ -40,15 +39,19 @@ int psm_init_power_state_table(struct pp_hwmgr *hwmgr)if (hwmgr->hwmgr_func->get_power_state_size ==NULL )return 0 ; - hwmgr->num_ps = table_entries = hwmgr->hwmgr_func->get_num_of_pp_table_entries (hwmgr); + table_entries = hwmgr->hwmgr_func->get_num_of_pp_table_entries (hwmgr); - hwmgr->ps_size = size = hwmgr->hwmgr_func->get_power_state_size (hwmgr) + + size = hwmgr->hwmgr_func->get_power_state_size (hwmgr) +sizeof (struct pp_power_state ); -if (table_entries ==0 || size ==0 ) { +if (table_entries <=0 || size ==0 ) {pr_warn ("Please check whether power state management is supported on this asic\n" ); + hwmgr->num_ps =0 ; + hwmgr->ps_size =0 ;return 0 ; } + hwmgr->num_ps = table_entries; + hwmgr->ps_size = size; hwmgr->ps =kcalloc (table_entries, size,GFP_KERNEL );if (hwmgr->ps ==NULL )
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +3 -2
@@ -73,8 +73,9 @@ static int atomctrl_retrieve_ac_timing( j++; }else if ((table->mc_reg_address[i].uc_pre_reg_data &LOW_NIBBLE_MASK ) ==DATA_EQU_PREV ) { - table->mc_reg_table_entry[num_ranges].mc_data[i] = - table->mc_reg_table_entry[num_ranges].mc_data[i-1 ]; +if (i) + table->mc_reg_table_entry[num_ranges].mc_data[i] = + table->mc_reg_table_entry[num_ranges].mc_data[i-1 ]; } } num_ranges++;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +22 -7
@@ -1036,7 +1036,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,switch (type) {case PP_SCLK : -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now); +if (ret) +return ret;/* driver only know min/max gfx_clk, Add level 1 for all other gfx clks */ if (now == data->gfx_max_freq_limit/100 )
@@ -1057,7 +1059,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, i == 2 ? "*" : "");break ;case PP_MCLK : -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetFclkFrequency, &now); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetFclkFrequency, &now); +if (ret) +return ret;for (i =0 ; i < mclk_table->count; i++) size += sprintf(buf + size, "%d: %uMhz %s\n",
@@ -1550,7 +1554,10 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, }if (input[0 ] ==0 ) { -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); +if (ret) +return ret; +if (input[1 ] < min_freq) {pr_err ("Fine grain setting minimum sclk (%ld) MHz is less than the minimum allowed (%d) MHz\n" , input[1 ], min_freq);
@@ -1558,7 +1565,10 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, } smu10_data->gfx_actual_soft_min_freq = input[1 ]; }else if (input[0 ] ==1 ) { -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); +if (ret) +return ret; +if (input[1 ] > max_freq) {pr_err ("Fine grain setting maximum sclk (%ld) MHz is greater than the maximum allowed (%d) MHz\n" , input[1 ], max_freq);
@@ -1573,10 +1583,15 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr,pr_err ("Input parameter number not correct\n" );return -EINVAL ; } -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); - + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq); +if (ret) +return ret; smu10_data->gfx_actual_soft_min_freq = min_freq; + + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq); +if (ret) +return ret; + smu10_data->gfx_actual_soft_max_freq = max_freq; }else if (type ==PP_OD_COMMIT_DPM_TABLE ) {if (size !=0 ) {
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +1 -1
@@ -5639,7 +5639,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 +45 -15
154 lines not on this page · raw message
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +15 -5
@@ -294,12 +294,12 @@ static int vega12_set_features_platform_caps(struct pp_hwmgr *hwmgr)return 0 ; } -static void vega12_init_dpm_defaults (struct pp_hwmgr *hwmgr) +static int vega12_init_dpm_defaults (struct pp_hwmgr *hwmgr) {struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);struct amdgpu_device *adev = hwmgr->adev;uint32_t top32, bottom32; -int i; +int i, ret; data->smu_features[GNLD_DPM_PREFETCHER ].smu_feature_id =FEATURE_DPM_PREFETCHER_BIT ;
@@ -365,10 +365,16 @@ static void vega12_init_dpm_defaults(struct pp_hwmgr *hwmgr) }/* Get the SN to turn into a Unique ID */ -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); +if (ret) +return ret; + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); +if (ret) +return ret; adev->unique_id = ((uint64_t )bottom32 <<32 ) | top32; + +return 0 ; }static int vega12_set_private_data_based_on_pptable (struct pp_hwmgr *hwmgr)
@@ -411,7 +417,11 @@ static int vega12_hwmgr_backend_init(struct pp_hwmgr *hwmgr)vega12_set_features_platform_caps (hwmgr); -vega12_init_dpm_defaults (hwmgr); + result =vega12_init_dpm_defaults (hwmgr); +if (result) { +pr_err ("%s failed\n" , __func__); +return result; + }/* Parse pptable data read from VBIOS */ vega12_set_private_data_based_on_pptable (hwmgr);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +23 -8
@@ -329,12 +329,12 @@ static int vega20_set_features_platform_caps(struct pp_hwmgr *hwmgr)return 0 ; } -static void vega20_init_dpm_defaults (struct pp_hwmgr *hwmgr) +static int vega20_init_dpm_defaults (struct pp_hwmgr *hwmgr) {struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);struct amdgpu_device *adev = hwmgr->adev;uint32_t top32, bottom32; -int i; +int i, ret; data->smu_features[GNLD_DPM_PREFETCHER ].smu_feature_id =FEATURE_DPM_PREFETCHER_BIT ;
@@ -405,10 +405,17 @@ static void vega20_init_dpm_defaults(struct pp_hwmgr *hwmgr) }/* Get the SN to turn into a Unique ID */ -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); -smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumTop32, &top32); +if (ret) +return ret; + + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ReadSerialNumBottom32, &bottom32); +if (ret) +return ret; adev->unique_id = ((uint64_t )bottom32 <<32 ) | top32; + +return 0 ; }static int vega20_set_private_data_based_on_pptable (struct pp_hwmgr *hwmgr)
@@ -428,6 +435,7 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr) {struct vega20_hwmgr *data;struct amdgpu_device *adev = hwmgr->adev; +int result; data =kzalloc (sizeof (struct vega20_hwmgr ),GFP_KERNEL );if (data ==NULL )
@@ -453,8 +461,11 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr)vega20_set_features_platform_caps (hwmgr); -vega20_init_dpm_defaults (hwmgr); - + result =vega20_init_dpm_defaults (hwmgr); +if (result) { +pr_err ("%s failed\n" , __func__); +return result; + }/* Parse pptable data read from VBIOS */ vega20_set_private_data_based_on_pptable (hwmgr);
@@ -4084,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,
@@ -4148,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
@@ -130,13 +130,17 @@ int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr, uint64_t *features_enabled) {uint32_t enabled_features; +int ret;if (features_enabled ==NULL )return -EINVAL ; -smum_send_msg_to_smc (hwmgr, + ret =smum_send_msg_to_smc (hwmgr, PPSMC_MSG_GetEnabledSmuFeatures, &enabled_features); +if (ret) +return ret; + *features_enabled = enabled_features;return 0 ;
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +21 -6
@@ -1215,19 +1215,22 @@ static int navi10_get_current_clk_freq_by_table(struct smu_context *smu, value); } -static bool navi10_is_support_fine_grained_dpm (struct smu_context *smu,enum smu_clk_type clk_type) +static int navi10_is_support_fine_grained_dpm (struct smu_context *smu,enum smu_clk_type clk_type) {PPTable_t *pptable = smu->smu_table.driver_pptable;DpmDescriptor_t *dpm_desc =NULL ; -uint32_t clk_index =0 ; +int clk_index =0 ; clk_index =smu_cmn_to_asic_specific_index (smu,CMN2ASIC_MAPPING_CLK , clk_type); +if (clk_index <0 ) +return clk_index; + dpm_desc = &pptable->DpmDescriptor[clk_index];/* 0 - Fine grained DPM, 1 - Discrete DPM */ -return dpm_desc->SnapToDiscrete ==0 ; +return dpm_desc->SnapToDiscrete ==0 ?1 :0 ; }static inline bool navi10_od_feature_is_supported (struct smu_11_0_overdrive_table *od_table,enum SMU_11_0_ODFEATURE_CAP cap)
@@ -1283,7 +1286,11 @@ static int navi10_emit_clk_levels(struct smu_context *smu,if (ret)return ret; -if (!navi10_is_support_fine_grained_dpm (smu, clk_type)) { + ret =navi10_is_support_fine_grained_dpm (smu, clk_type); +if (ret <0 ) +return ret; + +if (!ret) {for (i =0 ; i < count; i++) { ret =smu_v11_0_get_dpm_freq_by_index (smu, clk_type, i, &value);
@@ -1492,7 +1499,11 @@ static int navi10_print_clk_levels(struct smu_context *smu,if (ret)return size; -if (!navi10_is_support_fine_grained_dpm (smu, clk_type)) { + ret =navi10_is_support_fine_grained_dpm (smu, clk_type); +if (ret <0 ) +return ret; + +if (!ret) {for (i =0 ; i < count; i++) { ret =smu_v11_0_get_dpm_freq_by_index (smu, clk_type, i, &value);if (ret)
@@ -1661,7 +1672,11 @@ static int navi10_force_clk_levels(struct smu_context *smu,case SMU_UCLK :case SMU_FCLK :/* There is only 2 levels for fine grained DPM */ -if (navi10_is_support_fine_grained_dpm (smu, clk_type)) { + ret =navi10_is_support_fine_grained_dpm (smu, clk_type); +if (ret <0 ) +return ret; + +if (ret) { soft_max_level = (soft_max_level >=1 ?1 :0 ); soft_min_level = (soft_min_level >=1 ?1 :0 ); }
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +14 -0
@@ -1003,6 +1003,18 @@ static int vangogh_get_dpm_ultimate_freq(struct smu_context *smu, } }if (min) { + ret =vangogh_get_profiling_clk_mask (smu, +AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK , +NULL , +NULL , + &mclk_mask, + &fclk_mask, + &soc_mask); +if (ret) + goto failed; + + vclk_mask = dclk_mask =0 ; +switch (clk_type) {case SMU_UCLK :case SMU_MCLK :
@@ -2363,6 +2375,8 @@ static u32 vangogh_set_gfxoff_residency(struct smu_context *smu, bool start) ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_LogGfxOffResidency, start, &residency); +if (ret) +return ret;if (!start) adev->gfx.gfx_off_residency = residency;
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +2 -1
@@ -1939,7 +1939,8 @@ static int aldebaran_mode2_reset(struct smu_context *smu) index =smu_cmn_to_asic_specific_index (smu,CMN2ASIC_MAPPING_MSG , SMU_MSG_GfxDeviceDriverReset); - +if (index <0 ) +return -EINVAL ;mutex_lock (&smu->message_lock);if (smu_version >=0x00441400 ) { ret =smu_cmn_send_msg_without_waiting (smu, (uint16_t )index,SMU_RESET_MODE_2 );
drivers/gpu/drm/bridge/tc358767.c +1 -1
@@ -1841,7 +1841,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg)dev_err (tc->dev,"syserr %x\n" , stat); } -if (tc->hpd_pin >=0 && tc->bridge.dev) { +if (tc->hpd_pin >=0 && tc->bridge.dev && tc->aux.drm_dev) {/* * H is triggered when the GPIO goes high. *
drivers/gpu/drm/drm_panel_orientation_quirks.c +6 -0
@@ -414,6 +414,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/meson/meson_plane.c +11 -6
@@ -534,6 +534,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 );
@@ -548,12 +549,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/hwmon/k10temp.c +27 -9
@@ -153,8 +153,9 @@ static void read_tempreg_nb_f15(struct pci_dev *pdev, u32 *regval)static void read_tempreg_nb_zen (struct pci_dev *pdev,u32 *regval) { -amd_smn_read (amd_pci_dev_to_node_id (pdev), -ZEN_REPORTED_TEMP_CTRL_BASE , regval); +if (amd_smn_read (amd_pci_dev_to_node_id (pdev), +ZEN_REPORTED_TEMP_CTRL_BASE , regval)) + *regval =0 ; }static long get_raw_temp (struct k10temp_data *data)
@@ -205,6 +206,7 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel, long *val) {struct k10temp_data *data =dev_get_drvdata (dev); +int ret = -EOPNOTSUPP ;u32 regval;switch (attr) {
@@ -221,13 +223,17 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel, *val =0 ;break ; case 2 ... 13: /* Tccd{1-12} */ -amd_smn_read (amd_pci_dev_to_node_id (data->pdev), -ZEN_CCD_TEMP (data->ccd_offset, channel -2 ), - ®val); + ret =amd_smn_read (amd_pci_dev_to_node_id (data->pdev), +ZEN_CCD_TEMP (data->ccd_offset, channel -2 ), + ®val); + +if (ret) +return ret; + *val = (regval &ZEN_CCD_TEMP_MASK ) *125 -49000 ;break ;default : -return -EOPNOTSUPP ; +return ret; }break ;case hwmon_temp_max:
@@ -243,7 +249,7 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel, - ((regval >> 24) & 0xf)) * 500 + 52000;break ;default : -return -EOPNOTSUPP ; +return ret; }return 0 ; }
@@ -381,8 +387,20 @@ static void k10temp_get_ccd_support(struct pci_dev *pdev,int i;for (i =0 ; i < limit; i++) { -amd_smn_read (amd_pci_dev_to_node_id (pdev), -ZEN_CCD_TEMP (data->ccd_offset, i), ®val); +/* +* Ignore inaccessible CCDs. +* +* Some systems will return a register value of 0, and the TEMP_VALID +* bit check below will naturally fail. +* +* Other systems will return a PCI_ERROR_RESPONSE (0xFFFFFFFF) for +* the register value. And this will incorrectly pass the TEMP_VALID +* bit check. +*/ +if (amd_smn_read (amd_pci_dev_to_node_id (pdev), +ZEN_CCD_TEMP (data->ccd_offset, i), ®val)) +continue ; +if (regval &ZEN_CCD_TEMP_VALID ) data->show_temp |=BIT (TCCD_BIT (i)); }
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/industrialio-core.c +6 -1
@@ -767,9 +767,11 @@ static ssize_t iio_read_channel_info(struct device *dev,INDIO_MAX_RAW_ELEMENTS , vals, &val_len, this_attr->address); - else + else if (indio_dev->info->read_raw) ret = indio_dev->info->read_raw (indio_dev, this_attr->c, &vals[0 ], &vals[1 ], this_attr->address); + else + return -EINVAL;if (ret <0 )return ret;
@@ -851,6 +853,9 @@ static ssize_t iio_read_channel_info_avail(struct device *dev,int length;int type; +if (!indio_dev->info->read_avail) +return -EINVAL ; + ret = indio_dev->info->read_avail (indio_dev, this_attr->c, &vals, &type, &length, this_attr->address);
drivers/iio/industrialio-event.c +9 -0
@@ -283,6 +283,9 @@ static ssize_t iio_ev_state_store(struct device *dev,if (ret <0 )return ret; +if (!indio_dev->info->write_event_config) +return -EINVAL ; + ret = indio_dev->info->write_event_config (indio_dev, this_attr->c,iio_ev_attr_type (this_attr),iio_ev_attr_dir (this_attr), val);
@@ -298,6 +301,9 @@ static ssize_t iio_ev_state_show(struct device *dev,struct iio_dev_attr *this_attr =to_iio_dev_attr (attr);int val; +if (!indio_dev->info->read_event_config) +return -EINVAL ; + val = indio_dev->info->read_event_config (indio_dev, this_attr->c,iio_ev_attr_type (this_attr),iio_ev_attr_dir (this_attr));
@@ -316,6 +322,9 @@ static ssize_t iio_ev_value_show(struct device *dev,int val, val2, val_arr[2 ];int ret; +if (!indio_dev->info->read_event_value) +return -EINVAL ; + ret = indio_dev->info->read_event_value(indio_dev, this_attr->c, iio_ev_attr_type(this_attr), iio_ev_attr_dir(this_attr), iio_ev_attr_info(this_attr),
drivers/iio/inkern.c +22 -10
@@ -561,6 +561,7 @@ EXPORT_SYMBOL_GPL(devm_iio_channel_get_all);static int iio_channel_read (struct iio_channel *chan,int *val,int *val2,enum iio_chan_info_enum info) { +const struct iio_info *iio_info = chan->indio_dev->info;int unused;int vals[INDIO_MAX_RAW_ELEMENTS ];int ret;
@@ -572,15 +573,18 @@ static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,if (!iio_channel_has_info (chan->channel, info))return -EINVAL ; -if (chan->indio_dev->info->read_raw_multi) { - ret = chan->indio_dev->info->read_raw_multi (chan->indio_dev, - chan->channel,INDIO_MAX_RAW_ELEMENTS , - vals, &val_len, info); +if (iio_info->read_raw_multi) { + ret = iio_info->read_raw_multi (chan->indio_dev, + chan->channel, +INDIO_MAX_RAW_ELEMENTS , + vals, &val_len, info); *val = vals[0 ]; *val2 = vals[1 ]; + }else if (iio_info->read_raw) { + ret = iio_info->read_raw (chan->indio_dev, + chan->channel, val, val2, info); }else { - ret = chan->indio_dev->info->read_raw (chan->indio_dev, - chan->channel, val, val2, info); +return -EINVAL ; }return ret;
@@ -800,11 +804,15 @@ static int iio_channel_read_avail(struct iio_channel *chan, const int **vals, int *type, int *length, enum iio_chan_info_enum info) { + const struct iio_info *iio_info = chan->indio_dev->info; +if (!iio_channel_has_available (chan->channel, info))return -EINVAL ; -return chan->indio_dev->info->read_avail (chan->indio_dev, chan->channel, - vals, type, length, info); +if (iio_info->read_avail) +return iio_info->read_avail (chan->indio_dev, chan->channel, + vals, type, length, info); +return -EINVAL ; } int iio_read_avail_channel_attribute(struct iio_channel *chan,
@@ -935,8 +943,12 @@ EXPORT_SYMBOL_GPL(iio_get_channel_type);static int iio_channel_write (struct iio_channel *chan,int val,int val2,enum iio_chan_info_enum info) { -return chan->indio_dev->info->write_raw (chan->indio_dev, - chan->channel, val, val2, info); +const struct iio_info *iio_info = chan->indio_dev->info; + +if (iio_info->write_raw) +return iio_info->write_raw (chan->indio_dev, + chan->channel, val, val2, info); +return -EINVAL ; } int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
drivers/infiniband/hw/efa/efa_com.c +17 -13
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause /* -* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved. */ #include "efa_com.h"
@@ -406,8 +406,8 @@ static struct efa_comp_ctx *efa_com_submit_admin_cmd(struct efa_com_admin_queuereturn comp_ctx; } -static void efa_com_handle_single_admin_completion (struct efa_com_admin_queue *aq, -struct efa_admin_acq_entry *cqe) +static int efa_com_handle_single_admin_completion (struct efa_com_admin_queue *aq, +struct efa_admin_acq_entry *cqe) {struct efa_comp_ctx *comp_ctx;u16 cmd_id;
@@ -416,11 +416,11 @@ static void efa_com_handle_single_admin_completion(struct efa_com_admin_queue *a EFA_ADMIN_ACQ_COMMON_DESC_COMMAND_ID); comp_ctx =efa_com_get_comp_ctx (aq, cmd_id, false); -if (!comp_ctx) { +if (comp_ctx->status !=EFA_CMD_SUBMITTED ) {ibdev_err (aq->efa_dev, -"comp_ctx is NULL. Changing the admin queue running state\n" ); -clear_bit (EFA_AQ_STATE_RUNNING_BIT , &aq->state); -return ; +"Received completion with unexpected command id[%d], sq producer: %d, sq consumer: %d, cq consumer: %d\n" , + cmd_id, aq->sq.pc, aq->sq.cc, aq->cq.cc); +return -EINVAL ; } comp_ctx->status =EFA_CMD_COMPLETED ;
@@ -428,14 +428,17 @@ static void efa_com_handle_single_admin_completion(struct efa_com_admin_queue *aif (!test_bit (EFA_AQ_STATE_POLLING_BIT , &aq->state))complete (&comp_ctx->wait_event); + +return 0 ; }static void efa_com_handle_admin_completion (struct efa_com_admin_queue *aq) {struct efa_admin_acq_entry *cqe;u16 queue_size_mask; -u16 comp_num =0 ; +u16 comp_cmds =0 ;u8 phase; +int err;u16 ci; queue_size_mask = aq->depth -1 ;
@@ -453,10 +456,12 @@ static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq)* phase bit was validated */ dma_rmb (); -efa_com_handle_single_admin_completion (aq, cqe); + err =efa_com_handle_single_admin_completion (aq, cqe); +if (!err) + comp_cmds++; + aq->cq.cc++; ci++; - comp_num++;if (ci == aq->depth) { ci =0 ; phase = !phase;
@@ -465,10 +470,9 @@ static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq) cqe = &aq->cq.entries[ci]; } - aq->cq.cc += comp_num; aq->cq.phase = phase; - aq->sq.cc += comp_num; -atomic64_add (comp_num, &aq->stats.completed_cmd); + aq->sq.cc += comp_cmds; +atomic64_add (comp_cmds, &aq->stats.completed_cmd); }static int efa_com_comp_status_to_errno (u8 comp_status)
drivers/media/usb/uvc/uvc_driver.c +14 -4
@@ -666,16 +666,26 @@ static int uvc_parse_streaming(struct uvc_device *dev, goto error; } - size = nformats *sizeof (*format) + nframes *sizeof (*frame) +/* +* Allocate memory for the formats, the frames and the intervals, +* plus any required padding to guarantee that everything has the +* correct alignment. +*/ + size = nformats *sizeof (*format); + size = ALIGN(size, __alignof__(*frame)) + nframes * sizeof(*frame); + size = ALIGN(size, __alignof__(*interval)) + nintervals *sizeof (*interval); + format =kzalloc (size,GFP_KERNEL ); -if (format ==NULL ) { +if (!format) { ret = -ENOMEM ; goto error; } - frame = (struct uvc_frame *)&format[nformats]; - interval = (u32 *)&frame[nframes]; + frame = (void *)format + nformats *sizeof (*format); + frame = PTR_ALIGN(frame, __alignof__(*frame)); + interval = (void *)frame + nframes *sizeof (*frame); + interval = PTR_ALIGN(interval, __alignof__(*interval)); streaming->format = format; streaming->nformats =0 ;
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +2 -1
@@ -2141,7 +2141,8 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqif (flush)mlx5e_shampo_flush_skb (rq, cqe, match); free_hd_entry: -mlx5e_free_rx_shampo_hd_entry (rq, header_index); +if (likely (head_size)) +mlx5e_free_rx_shampo_hd_entry (rq, header_index); mpwrq_cqe_out:if (likely (wi->consumed_strides < rq->mpwqe.num_strides))return ;
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -1
@@ -230,7 +230,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/usb/qmi_wwan.c +1 -0
@@ -1436,6 +1436,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/virtio_net.c +4 -4
@@ -1638,7 +1638,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);
@@ -1656,7 +1656,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq)do {virtqueue_disable_cb (sq->vq); -free_old_xmit_skbs (sq, true); +free_old_xmit_skbs (sq, !!budget); }while (unlikely (!virtqueue_enable_cb_delayed (sq->vq)));if (sq->vq->num_free >=2 +MAX_SKB_FRAGS )
@@ -1675,7 +1675,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);
@@ -1778,7 +1778,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget) txq =netdev_get_tx_queue (vi->dev, index);__netif_tx_lock (txq,raw_smp_processor_id ());virtqueue_disable_cb (sq->vq); -free_old_xmit_skbs (sq, true); +free_old_xmit_skbs (sq, !!budget);if (sq->vq->num_free >=2 +MAX_SKB_FRAGS )netif_tx_wake_queue (txq);
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
@@ -2293,7 +2293,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab,struct qmi_txn txn;const u8 *temp = data;void __iomem *bdf_addr =NULL ; -int ret; +int ret =0 ;u32 remaining = len; req =kzalloc (sizeof (*req),GFP_KERNEL );
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +1 -2
@@ -252,8 +252,7 @@ static ssize_t iwl_dbgfs_send_hcmd_write(struct iwl_fw_runtime *fwrt, char *buf, .data = { NULL, }, }; -if (fwrt->ops && fwrt->ops->fw_running && - !fwrt->ops->fw_running (fwrt->ops_ctx)) +if (!iwl_trans_fw_running (fwrt->trans))return -EIO ;if (count < header_size +1 || count >1024 *4 )
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +0 -1
@@ -18,7 +18,6 @@struct iwl_fw_runtime_ops {void (*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
@@ -670,11 +670,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;
@@ -695,7 +690,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/realtek/rtw89/ser.c +6 -2
@@ -304,9 +304,13 @@ static void ser_reset_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)static void ser_sta_deinit_cam_iter (void *data,struct ieee80211_sta *sta) { -struct rtw89_vif *rtwvif = (struct rtw89_vif *)data; -struct rtw89_dev *rtwdev = rtwvif->rtwdev; +struct rtw89_vif *target_rtwvif = (struct rtw89_vif *)data;struct rtw89_sta *rtwsta = (struct rtw89_sta *)sta->drv_priv; +struct rtw89_vif *rtwvif = rtwsta->rtwvif; +struct rtw89_dev *rtwdev = rtwvif->rtwdev; + +if (rtwvif != target_rtwvif) +return ;if (rtwvif->net_type ==RTW89_NET_TYPE_AP_MODE || sta->tdls)rtw89_cam_deinit_addr_cam (rtwdev, &rtwsta->addr_cam);
drivers/pci/controller/dwc/pcie-al.c +13 -3
@@ -242,18 +242,24 @@ static struct pci_ops al_child_pci_ops = { .write = pci_generic_config_write, }; -static void al_pcie_config_prepare (struct al_pcie *pcie) +static int al_pcie_config_prepare (struct al_pcie *pcie) {struct al_pcie_target_bus_cfg *target_bus_cfg;struct dw_pcie_rp *pp = &pcie->pci->pp;unsigned int ecam_bus_mask; +struct resource_entry *ft;u32 cfg_control_offset; +struct resource *bus;u8 subordinate_bus;u8 secondary_bus;u32 cfg_control;u32 reg; -struct resource *bus =resource_list_first_type (&pp->bridge->windows,IORESOURCE_BUS )->res; + ft =resource_list_first_type (&pp->bridge->windows,IORESOURCE_BUS ); +if (!ft) +return -ENODEV ; + + bus = ft->res; target_bus_cfg = &pcie->target_bus_cfg; ecam_bus_mask = (pcie->ecam_size >>PCIE_ECAM_BUS_SHIFT ) -1 ;
@@ -287,6 +293,8 @@ static void al_pcie_config_prepare(struct al_pcie *pcie)FIELD_PREP (CFG_CONTROL_SEC_BUS_MASK , secondary_bus);al_pcie_controller_writel (pcie, cfg_control_offset, reg); + +return 0 ; }static int al_pcie_host_init (struct dw_pcie_rp *pp)
@@ -305,7 +313,9 @@ static int al_pcie_host_init(struct dw_pcie_rp *pp)if (rc)return rc; -al_pcie_config_prepare (pcie); + rc =al_pcie_config_prepare (pcie); +if (rc) +return rc;return 0 ; }
drivers/pci/msi/msi.c +8 -2
@@ -431,7 +431,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec, struct irq_affinity *affd) {struct irq_affinity_desc *masks =NULL ; -struct msi_desc *entry; +struct msi_desc *entry, desc;int ret;/*
@@ -452,6 +452,12 @@ static int msi_capability_init(struct pci_dev *dev, int nvec,/* All MSIs are unmasked by default; mask them all */ entry =msi_first_desc (&dev->dev,MSI_DESC_ALL );pci_msi_mask (entry,msi_multi_mask (entry)); +/* +* Copy the MSI descriptor for the error path because +* pci_msi_setup_msi_irqs() will free it for the hierarchical +* interrupt domain case. +*/ +memcpy (&desc, entry,sizeof (desc));/* Configure MSI capability structure */ ret =pci_msi_setup_msi_irqs (dev, nvec,PCI_CAP_ID_MSI );
@@ -471,7 +477,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec, goto unlock; err: -pci_msi_unmask (entry,msi_multi_mask (entry)); +pci_msi_unmask (&desc,msi_multi_mask (&desc));free_msi_irqs (dev); fail: dev->msi_enabled =0 ;
drivers/ufs/core/ufshcd.c +2 -1
@@ -6307,7 +6307,8 @@ static void ufshcd_err_handler(struct work_struct *work)if (ufshcd_err_handling_should_stop (hba)) goto skip_err_handling; -if (hba->dev_quirks &UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS ) { +if ((hba->dev_quirks &UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS ) && + !hba->force_reset) {bool ret;spin_unlock_irqrestore (hba->host->host_lock, flags);
drivers/usb/typec/ucsi/ucsi.h +1 -1
@@ -373,7 +373,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/ext4/extents.c +1 -1
@@ -3229,7 +3229,7 @@ static int ext4_split_extent_at(handle_t *handle,ext4_ext_mark_unwritten (ex2); err =ext4_ext_insert_extent (handle, inode, ppath, &newex, flags); -if (err != -ENOSPC && err != -EDQUOT ) +if (err != -ENOSPC && err != -EDQUOT && err != -ENOMEM ) goto out;if (EXT4_EXT_MAY_ZEROOUT & split_flag) {
fs/ext4/inode.c +4 -1
@@ -5101,9 +5101,12 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, "iget: bogus i_mode (%o)", inode->i_mode); goto bad_inode; } -if (IS_CASEFOLDED (inode) && !ext4_has_feature_casefold (inode->i_sb)) +if (IS_CASEFOLDED (inode) && !ext4_has_feature_casefold (inode->i_sb)) {ext4_error_inode (inode, function, line,0 ,"casefold flag without casefold feature" ); + ret = -EFSCORRUPTED ; + goto bad_inode; + }if ((err_str =check_igot_inode (inode, flags)) !=NULL ) {ext4_error_inode (inode, function, line,0 , err_str); ret = -EFSCORRUPTED ;
fs/ext4/page-io.c +12 -2
@@ -484,6 +484,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 ;
@@ -491,6 +498,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);
@@ -534,7 +542,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;
@@ -547,7 +558,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/f2fs/f2fs.h +1 -0
@@ -788,6 +788,7 @@ enum {FI_ALIGNED_WRITE ,/* enable aligned write */ FI_COW_FILE ,/* indicate COW file */ FI_ATOMIC_COMMITTED ,/* indicate atomic commit completed except disk sync */ +FI_OPENED_FILE ,/* indicate file has been opened */ FI_MAX, /* max flag, never be used */ };
fs/f2fs/file.c +41 -1
54 lines not on this page · raw message
fs/f2fs/inode.c +0 -8
@@ -549,14 +549,6 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino) }f2fs_set_inode_flags (inode); -if (file_should_truncate (inode) && - !is_sbi_flag_set (sbi,SBI_POR_DOING )) { - ret =f2fs_truncate (inode); -if (ret) - goto bad_inode; -file_dont_truncate (inode); - } -unlock_new_inode (inode);trace_f2fs_iget (inode);return inode;
fs/notify/fsnotify.c +21 -10
@@ -103,17 +103,13 @@ void fsnotify_sb_delete(struct super_block *sb)* parent cares. Thus when an event happens on a child it can quickly tell * if there is a need to find a parent and send the event to the parent. */ -void __fsnotify_update_child_dentry_flags (struct inode *inode) +void fsnotify_set_children_dentry_flags (struct inode *inode) {struct dentry *alias; -int watched;if (!S_ISDIR (inode->i_mode))return ; -/* determine if the children should tell inode about their events */ - watched =fsnotify_inode_watches_children (inode); -spin_lock (&inode->i_lock);/* run all of the dentries associated with this inode. Since this is a * directory, there damn well better only be one item on this list */
@@ -129,10 +125,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)continue ;spin_lock_nested (&child->d_lock,DENTRY_D_LOCK_NESTED ); -if (watched) - child->d_flags |=DCACHE_FSNOTIFY_PARENT_WATCHED ; -else - child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED ; + child->d_flags |=DCACHE_FSNOTIFY_PARENT_WATCHED ;spin_unlock (&child->d_lock); }spin_unlock (&alias->d_lock);
@@ -140,6 +133,24 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)spin_unlock (&inode->i_lock); } +/* +* Lazily clear false positive PARENT_WATCHED flag for child whose parent had +* stopped watching children. +*/ +static void fsnotify_clear_child_dentry_flag (struct inode *pinode, +struct dentry *dentry) +{ +spin_lock (&dentry->d_lock); +/* +* d_lock is a sufficient barrier to prevent observing a non-watched +* parent state from before the fsnotify_set_children_dentry_flags() +* or fsnotify_update_flags() call that had set PARENT_WATCHED. +*/ +if (!fsnotify_inode_watches_children (pinode)) + dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED ; +spin_unlock (&dentry->d_lock); +} +/* Are inode/sb/mount interested in parent and name info with this event? */ static bool fsnotify_event_needs_parent (struct inode *inode,struct mount *mnt,__u32 mask)
@@ -208,7 +219,7 @@ int __fsnotify_parent(struct dentry *dentry, __u32 mask, const void *data, p_inode = parent->d_inode; p_mask =fsnotify_inode_watches_children (p_inode);if (unlikely (parent_watched && !p_mask)) -__fsnotify_update_child_dentry_flags (p_inode); +fsnotify_clear_child_dentry_flag (p_inode, dentry);/* * Include parent/name in notification either if some notification
fs/notify/fsnotify.h +1 -1
@@ -74,7 +74,7 @@ static inline void fsnotify_clear_marks_by_sb(struct super_block *sb)* update the dentry->d_flags of all of inode's children to indicate if inode cares * about events that happen to its children. */ -extern void __fsnotify_update_child_dentry_flags (struct inode *inode); +extern void fsnotify_set_children_dentry_flags (struct inode *inode);extern struct kmem_cache *fsnotify_mark_connector_cachep;
fs/notify/mark.c +29 -3
@@ -176,6 +176,24 @@ static void *__fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)return fsnotify_update_iref (conn, want_iref); } +static bool fsnotify_conn_watches_children ( +struct fsnotify_mark_connector *conn) +{ +if (conn->type !=FSNOTIFY_OBJ_TYPE_INODE ) +return false; + +return fsnotify_inode_watches_children (fsnotify_conn_inode (conn)); +} + +static void fsnotify_conn_set_children_dentry_flags ( +struct fsnotify_mark_connector *conn) +{ +if (conn->type !=FSNOTIFY_OBJ_TYPE_INODE ) +return ; + +fsnotify_set_children_dentry_flags (fsnotify_conn_inode (conn)); +} +/* * Calculate mask of events for a list of marks. The caller must make sure * connector and connector->obj cannot disappear under us. Callers achieve
@@ -184,15 +202,23 @@ static void *__fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)*/ void fsnotify_recalc_mask (struct fsnotify_mark_connector *conn) { +bool update_children; +if (!conn)return ;spin_lock (&conn->lock); + update_children = !fsnotify_conn_watches_children (conn);__fsnotify_recalc_mask (conn); + update_children &=fsnotify_conn_watches_children (conn);spin_unlock (&conn->lock); -if (conn->type ==FSNOTIFY_OBJ_TYPE_INODE ) -__fsnotify_update_child_dentry_flags ( -fsnotify_conn_inode (conn)); +/* +* Set children's PARENT_WATCHED flags only if parent started watching. +* When parent stops watching, we clear false positive PARENT_WATCHED +* flags lazily in __fsnotify_parent(). +*/ +if (update_children) +fsnotify_conn_set_children_dentry_flags (conn); }/* Free all connectors queued for freeing once SRCU period ends */
fs/udf/super.c +8 -1
@@ -86,6 +86,13 @@ enum {#define UDF_MAX_LVID_NESTING 1000enum {UDF_MAX_LINKS =0xffff }; +/* +* We limit filesize to 4TB. This is arbitrary as the on-disk format supports +* more but because the file space is described by a linked list of extents, +* each of which can have at most 1GB, the creation and handling of extents +* gets unusably slow beyond certain point... +*/ +#define UDF_MAX_FILESIZE (1ULL << 42)/* These are the "meat" - everything else is stuffing */ static int udf_fill_super (struct super_block *,void *,int );
@@ -2299,7 +2306,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ret = -ENOMEM ; goto error_out; } - sb->s_maxbytes =MAX_LFS_FILESIZE ; + sb->s_maxbytes =UDF_MAX_FILESIZE ; sb->s_max_links =UDF_MAX_LINKS ;return 0 ;
include/clocksource/timer-xilinx.h +1 -1
@@ -41,7 +41,7 @@ struct regmap;struct xilinx_timer_priv {struct regmap *map;struct clk *clk; -u32 max; +u64 max; };/**
include/linux/fsnotify_backend.h +5 -3
@@ -563,12 +563,14 @@ static inline __u32 fsnotify_parent_needed_mask(__u32 mask)static inline int fsnotify_inode_watches_children (struct inode *inode) { +__u32 parent_mask =READ_ONCE (inode->i_fsnotify_mask); +/* FS_EVENT_ON_CHILD is set if the inode may care */ -if (!(inode->i_fsnotify_mask &FS_EVENT_ON_CHILD )) +if (!(parent_mask &FS_EVENT_ON_CHILD ))return 0 ;/* this inode might care about child events, does it care about the * specific set of events that can happen on a child? */ -return inode->i_fsnotify_mask &FS_EVENTS_POSS_ON_CHILD ; +return parent_mask &FS_EVENTS_POSS_ON_CHILD ; }/*
@@ -582,7 +584,7 @@ static inline void fsnotify_update_flags(struct dentry *dentry)/* * Serialisation of setting PARENT_WATCHED on the dentries is provided * by d_lock. If inotify_inode_watched changes after we have taken -* d_lock, the following __fsnotify_update_child_dentry_flags call will +* d_lock, the following fsnotify_set_children_dentry_flags call will * find our entry, so it will spin until we complete here, and update * us with the new state. */
include/linux/hwspinlock.h +6 -0
@@ -68,6 +68,7 @@ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,int __hwspin_trylock (struct hwspinlock *,int ,unsigned long *);void __hwspin_unlock (struct hwspinlock *,int ,unsigned long *);int of_hwspin_lock_get_id_byname (struct device_node *np,const char *name); +int hwspin_lock_bust (struct hwspinlock *hwlock,unsigned int id);int devm_hwspin_lock_free (struct device *dev,struct hwspinlock *hwlock);struct hwspinlock *devm_hwspin_lock_request (struct device *dev); struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
@@ -127,6 +128,11 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) { } +static inline int hwspin_lock_bust (struct hwspinlock *hwlock,unsigned int id) +{ +return 0 ; +} +static inline int of_hwspin_lock_get_id (struct device_node *np,int index) {return 0 ;
include/linux/i2c.h +1 -1
@@ -1035,7 +1035,7 @@ static inline int of_i2c_get_board_info(struct device *dev,struct acpi_resource ;struct acpi_resource_i2c_serialbus ; -#if IS_ENABLED (CONFIG_ACPI ) +#if IS_REACHABLE (CONFIG_ACPI ) &&IS_REACHABLE (CONFIG_I2C )bool i2c_acpi_get_i2c_resource (struct acpi_resource *ares,struct acpi_resource_i2c_serialbus **i2c);int i2c_acpi_client_count (struct acpi_device *adev);
kernel/dma/debug.c +4 -1
@@ -445,8 +445,11 @@ void debug_dma_dump_mappings(struct device *dev)* dma_active_cacheline entry to track per event. dma_map_sg(), on the * other hand, consumes a single dma_debug_entry, but inserts 'nents' * entries into the tree. +* +* Use __GFP_NOWARN because the printk from an OOM, to netconsole, could end +* up right back in the DMA debugging code, leading to a deadlock. */ -static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC); +static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC | __GFP_NOWARN);static DEFINE_SPINLOCK (radix_lock);#define ACTIVE_CACHELINE_MAX_OVERLAP ((1 << RADIX_TREE_MAX_TAGS) - 1)#define CACHELINE_PER_PAGE_SHIFT (PAGE_SHIFT - L1_CACHE_SHIFT)
kernel/rcu/tree.h +0 -1
@@ -207,7 +207,6 @@ struct rcu_data {struct swait_queue_head nocb_state_wq;/* For offloading state changes */ struct task_struct *nocb_gp_kthread;raw_spinlock_t nocb_lock;/* Guard following pair of fields. */ -atomic_t nocb_lock_contended;/* Contention experienced. */ int nocb_defer_wakeup;/* Defer wakeup of nocb_kthread. */ struct timer_list nocb_timer;/* Enforce finite deferral. */ unsigned long nocb_gp_adv_time;/* Last call_rcu() CB adv (jiffies). */
kernel/rcu/tree_nocb.h +6 -26
@@ -91,8 +91,7 @@ module_param(nocb_nobypass_lim_per_jiffy, int, 0);/* * Acquire the specified rcu_data structure's ->nocb_bypass_lock. If the -* lock isn't immediately available, increment ->nocb_lock_contended to -* flag the contention. +* lock isn't immediately available, perform minimal sanity check. */ static void rcu_nocb_bypass_lock(struct rcu_data *rdp) __acquires(&rdp->nocb_bypass_lock)
@@ -100,29 +99,12 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)lockdep_assert_irqs_disabled ();if (raw_spin_trylock (&rdp->nocb_bypass_lock))return ; -atomic_inc (&rdp->nocb_lock_contended); +/* +* Contention expected only when local enqueue collide with +* remote flush from kthreads. +*/ WARN_ON_ONCE (smp_processor_id () != rdp->cpu); -smp_mb__after_atomic ();/* atomic_inc() before lock. */ raw_spin_lock (&rdp->nocb_bypass_lock); -smp_mb__before_atomic ();/* atomic_dec() after lock. */ -atomic_dec (&rdp->nocb_lock_contended); -} - -/* -* Spinwait until the specified rcu_data structure's ->nocb_lock is -* not contended. Please note that this is extremely special-purpose, -* relying on the fact that at most two kthreads and one CPU contend for -* this lock, and also that the two kthreads are guaranteed to have frequent -* grace-period-duration time intervals between successive acquisitions -* of the lock. This allows us to use an extremely simple throttling -* mechanism, and further to apply it only to the CPU doing floods of -* call_rcu() invocations. Don't try this at home! -*/ -static void rcu_nocb_wait_contended (struct rcu_data *rdp) -{ -WARN_ON_ONCE (smp_processor_id () != rdp->cpu); -while (WARN_ON_ONCE (atomic_read (&rdp->nocb_lock_contended))) -cpu_relax (); }/*
@@ -452,7 +434,6 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, }// We need to use the bypass. -rcu_nocb_wait_contended (rdp);rcu_nocb_bypass_lock (rdp); ncbs =rcu_cblist_n_cbs (&rdp->nocb_bypass);rcu_segcblist_inc_len (&rdp->cblist);/* Must precede enqueue. */
@@ -1476,12 +1457,11 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)sprintf (bufw,"%ld" , rsclp->gp_seq[RCU_WAIT_TAIL ]);sprintf (bufr,"%ld" , rsclp->gp_seq[RCU_NEXT_READY_TAIL ]); - pr_info(" CB %d^%d->%d %c%c%c%c%c%c F%ld L%ld C%d %c%c%s%c%s%c%c q%ld %c CPU %d%s\n", + pr_info(" CB %d^%d->%d %c%c%c%c%c F%ld L%ld C%d %c%c%s%c%s%c%c q%ld %c CPU %d%s\n", rdp->cpu, rdp->nocb_gp_rdp->cpu, nocb_next_rdp ? nocb_next_rdp->cpu : -1, "kK"[!!rdp->nocb_cb_kthread], "bB"[raw_spin_is_locked(&rdp->nocb_bypass_lock)], - "cC"[!!atomic_read(&rdp->nocb_lock_contended)], "lL"[raw_spin_is_locked(&rdp->nocb_lock)], "sS"[!!rdp->nocb_cb_sleep], ".W"[swait_active(&rdp->nocb_cb_wq)],
net/bluetooth/sco.c +44 -32
142 lines not on this page · raw message
net/mptcp/options.c +25 -25
198 lines not on this page · raw message
net/mptcp/pm.c +14 -14
@@ -20,7 +20,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, {u8 add_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, local_id=%d, echo=%d" , msk, addr->id, echo); +pr_debug ("msk=%p, local_id=%d, echo=%d\n" , msk, addr->id, echo);lockdep_assert_held (&msk->pm.lock);
@@ -45,7 +45,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_ {u8 rm_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, rm_list_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p, rm_list_nr=%d\n" , msk, rm_list->nr);if (rm_addr) {pr_warn ("addr_signal error, rm_addr=%d" , rm_addr);
@@ -65,7 +65,7 @@ void mptcp_pm_new_connection(struct mptcp_sock *msk, const struct sock *ssk, int {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p, token=%u side=%d" , msk, msk->token, server_side); +pr_debug ("msk=%p, token=%u side=%d\n" , msk, msk->token, server_side);WRITE_ONCE (pm->server_side, server_side);mptcp_event (MPTCP_EVENT_CREATED , msk, ssk,GFP_ATOMIC );
@@ -89,7 +89,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("msk=%p subflows=%d max=%d allow=%d" , msk, pm->subflows, +pr_debug ("msk=%p subflows=%d max=%d allow=%d\n" , msk, pm->subflows, subflows_max,READ_ONCE (pm->accept_subflow));/* try to avoid acquiring the lock below */
@@ -113,7 +113,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk)static bool mptcp_pm_schedule_work (struct mptcp_sock *msk,enum mptcp_pm_status new_status) { -pr_debug ("msk=%p status=%x new=%lx" , msk, msk->pm.status, +pr_debug ("msk=%p status=%x new=%lx\n" , msk, msk->pm.status,BIT (new_status));if (msk->pm.status &BIT (new_status))return false;
@@ -128,7 +128,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk,struct mptcp_pm_data *pm = &msk->pm;bool announce = false; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -152,14 +152,14 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk,void mptcp_pm_connection_closed (struct mptcp_sock *msk) { -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk); }void mptcp_pm_subflow_established (struct mptcp_sock *msk) {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!READ_ONCE (pm->work_pending))return ;
@@ -211,7 +211,7 @@ void mptcp_pm_add_addr_received(const struct sock *ssk,struct mptcp_sock *msk =mptcp_sk (subflow->conn);struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p remote_id=%d accept=%d" , msk, addr->id, +pr_debug ("msk=%p remote_id=%d accept=%d\n" , msk, addr->id,READ_ONCE (pm->accept_addr));mptcp_event_addr_announced (ssk, addr);
@@ -244,7 +244,7 @@ void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk, {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -268,7 +268,7 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,struct mptcp_pm_data *pm = &msk->pm;u8 i; -pr_debug ("msk=%p remote_ids_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p remote_ids_nr=%d\n" , msk, rm_list->nr);for (i =0 ; i < rm_list->nr; i++)mptcp_event_addr_removed (msk, rm_list->ids[i]);
@@ -307,19 +307,19 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fail_seq)struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (sk);struct mptcp_sock *msk =mptcp_sk (subflow->conn); -pr_debug ("fail_seq=%llu" , fail_seq); +pr_debug ("fail_seq=%llu\n" , fail_seq);if (!READ_ONCE (msk->allow_infinite_fallback))return ;if (!subflow->fail_tout) { -pr_debug ("send MP_FAIL response and infinite map" ); +pr_debug ("send MP_FAIL response and infinite map\n" ); subflow->send_mp_fail =1 ; subflow->send_infinite_map =1 ;tcp_send_ack (sk); }else { -pr_debug ("MP_FAIL response received" ); +pr_debug ("MP_FAIL response received\n" );WRITE_ONCE (subflow->fail_tout,0 ); } }
net/mptcp/pm_netlink.c +91 -60
361 lines not on this page · raw message
net/mptcp/protocol.c +32 -26
7 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/net/mptcp/mptcp_join.sh +115 -21
136 lines not on this page · 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.