6.3.4-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 122/364 wifi: iwlwifi: pcie: Fix integer overflow in iwl_write_to_user_buf
In reply to Greg Kroah-HartmanFrom: Hyunwoo Kim <[email protected]>
[ Upstream commit 58d1b717879bfeabe09b35e41ad667c79933eb2e ]
An integer overflow occurs in the iwl_write_to_user_buf() function, which is called by the iwl_dbgfs_monitor_data_read() function.
static bool iwl_write_to_user_buf(char __user *user_buf, ssize_t count,
void *buf, ssize_t *size, ssize_t *bytes_copied)
{
int buf_size_left = count - *bytes_copied;
buf_size_left = buf_size_left - (buf_size_left % sizeof(u32));
if (*size > buf_size_left)
*size = buf_size_left;If the user passes a SIZE_MAX value to the "ssize_t count" parameter, the ssize_t count parameter is assigned to "int buf_size_left". Then compare "*size" with "buf_size_left" . Here, "buf_size_left" is a negative number, so "*size" is assigned "buf_size_left" and goes into the third argument of the copy_to_user function, causing a heap overflow.
This is not a security vulnerability because iwl_dbgfs_monitor_data_read() is a debugfs operation with 0400 privileges.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -1
@@ -2861,7 +2861,7 @@ static bool iwl_write_to_user_buf(char __user *user_buf, ssize_t count, void *buf, ssize_t *size, ssize_t *bytes_copied) { - int buf_size_left = count - *bytes_copied; + ssize_t buf_size_left = count - *bytes_copied; buf_size_left = buf_size_left - (buf_size_left %sizeof (u32));if (*size > buf_size_left)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 123/364 wifi: iwlwifi: mvm: fix ptk_pn memory leak
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit d066a530af8e1833c7ea2cef7784004700c85f79 ]
If adding a key to firmware fails we leak the allocated ptk_pn. This shouldn't happen in practice, but we should still fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +5 -1
@@ -3587,7 +3587,7 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);struct iwl_mvm_sta *mvmsta =NULL ; -struct iwl_mvm_key_pn *ptk_pn; +struct iwl_mvm_key_pn *ptk_pn =NULL ;int keyidx = key->keyidx;u32 sec_key_id =WIDE_ID (DATA_PATH_GROUP ,SEC_KEY_CMD );u8 sec_key_ver =iwl_fw_lookup_cmd_ver (mvm->fw, sec_key_id,0 );
@@ -3739,6 +3739,10 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,if (ret) {IWL_WARN (mvm,"set key failed\n" ); key->hw_key_idx =STA_KEY_IDX_INVALID ; +if (ptk_pn) { +RCU_INIT_POINTER (mvmsta->ptk_pn[keyidx],NULL ); +kfree (ptk_pn); + }/* * can't add key for RX, but we don't need it * in the device for TX so still return 0,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 124/364 block, bfq: Fix division by zero error on zero wsum
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit e53413f8deedf738a6782cc14cc00bd5852ccf18 ]
When the weighted sum is zero the calculation of limit causes a division by zero error. Fix this by continuing to the next level.
This was discovered by running as root:
stress-ng --ioprio 0
Fixes divison by error oops:
[ 521.450556] divide error: 0000 [#1] SMP NOPTI [ 521.450766] CPU: 2 PID: 2684464 Comm: stress-ng-iopri Not tainted 6.2.1-1280.native #1 [ 521.451117] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 [ 521.451627] RIP: 0010:bfqq_request_over_limit+0x207/0x400 [ 521.451875] Code: 01 48 8d 0c c8 74 0b 48 8b 82 98 00 00 00 48 8d 0c c8 8b 85 34 ff ff ff 48 89 ca 41 0f af 41 50 48 d1 ea 48 98 48 01 d0 31 d2 <48> f7 f1 41 39 41 48 89 85 34 ff ff ff 0f 8c 7b 01 00 00 49 8b 44 [ 521.452699] RSP: 0018:ffffb1af84eb3948 EFLAGS: 00010046 [ 521.452938] RAX: 000000000000003c RBX: 0000000000000000 RCX: 0000000000000000 [ 521.453262] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffb1af84eb3978 [ 521.453584] RBP: ffffb1af84eb3a30 R08: 0000000000000001 R09: ffff8f88ab8a4ba0 [ 521.453905] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8f88ab8a4b18 [ 521.454224] R13: ffff8f8699093000 R14: 0000000000000001 R15: ffffb1af84eb3970 [ 521.454549] FS: 00005640b6b0b580(0000) GS:ffff8f88b3880000(0000) knlGS:0000000000000000 [ 521.454912] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 521.455170] CR2: 00007ffcbcae4e38 CR3: 00000002e46de001 CR4: 0000000000770ee0 [ 521.455491] PKRU: 55555554 [ 521.455619] Call Trace: [ 521.455736] <TASK> [ 521.455837] ? bfq_request_merge+0x3a/0xc0 [ 521.456027] ? elv_merge+0x115/0x140 [ 521.456191] bfq_limit_depth+0xc8/0x240 [ 521.456366] __blk_mq_alloc_requests+0x21a/0x2c0 [ 521.456577] blk_mq_submit_bio+0x23c/0x6c0 [ 521.456766] __submit_bio+0xb8/0x140 [ 521.457236] submit_bio_noacct_nocheck+0x212/0x300 [ 521.457748] submit_bio_noacct+0x1a6/0x580 [ 521.458220] submit_bio+0x43/0x80 [ 521.458660] ext4_io_submit+0x23/0x80 [ 521.459116] ext4_do_writepages+0x40a/0xd00 [ 521.459596] ext4_writepages+0x65/0x100 [ 521.460050] do_writepages+0xb7/0x1c0 [ 521.460492] __filemap_fdatawrite_range+0xa6/0x100 [ 521.460979] file_write_and_wait_range+0xbf/0x140 [ 521.461452] ext4_sync_file+0x105/0x340 [ 521.461882] __x64_sys_fsync+0x67/0x100 [ 521.462305] ? syscall_exit_to_user_mode+0x2c/0x1c0 [ 521.462768] do_syscall_64+0x3b/0xc0 [ 521.463165] entry_SYSCALL_64_after_hwframe+0x5a/0xc4 [ 521.463621] RIP: 0033:0x5640b6c56590 [ 521.464006] Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 80 3d 71 70 0e 00 00 74 17 b8 4a 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c
--- block/bfq-iosched.c | 2 ++ 1 file changed, 2 insertions(+)
block/bfq-iosched.c +2 -0
@@ -649,6 +649,8 @@ static bool bfqq_request_over_limit(struct bfq_queue *bfqq, int limit) sched_data->service_tree[i].wsum; } } +if (!wsum) +continue ; limit =DIV_ROUND_CLOSEST (limit * entity->weight, wsum);if (entity->allocated >= limit) { bfq_log_bfqq(bfqq->bfqd, bfqq,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 125/364 wifi: ath11k: Ignore frags from uninitialized peer in dp.
In reply to Greg Kroah-HartmanFrom: Harshitha Prem <[email protected]>
[ Upstream commit a06bfb3c9f69f303692cdae87bc0899d2ae8b2a6 ]
When max virtual ap interfaces are configured in all the bands with ACS and hostapd restart is done every 60s, a crash is observed at random times.
In this certain scenario, a fragmented packet is received for self peer, for which rx_tid and rx_frags are not initialized in datapath. While handling this fragment, crash is observed as the rx_frag list is uninitialised and when we walk in ath11k_dp_rx_h_sort_frags, skb null leads to exception.
To address this, before processing received fragments we check dp_setup_done flag is set to ensure that peer has completed its dp peer setup for fragment queue, else ignore processing the fragments.
Call trace: ath11k_dp_process_rx_err+0x550/0x1084 [ath11k] ath11k_dp_service_srng+0x70/0x370 [ath11k] 0xffffffc009693a04 __napi_poll+0x30/0xa4 net_rx_action+0x118/0x270 __do_softirq+0x10c/0x244 irq_exit+0x64/0xb4 __handle_domain_irq+0x88/0xac gic_handle_irq+0x74/0xbc el1_irq+0xf0/0x1c0 arch_cpu_idle+0x10/0x18 do_idle+0x104/0x248 cpu_startup_entry+0x20/0x64 rest_init+0xd0/0xdc arch_call_rest_init+0xc/0x14 start_kernel+0x480/0x4b8 Code: f9400281 f94066a2 91405021 b94a0023 (f9406401)
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/dp.c | 4 +++- drivers/net/wireless/ath/ath11k/dp_rx.c | 8 ++++++++ drivers/net/wireless/ath/ath11k/peer.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/dp.c +3 -1
@@ -36,6 +36,7 @@ void ath11k_dp_peer_cleanup(struct ath11k *ar, int vdev_id, const u8 *addr) }ath11k_peer_rx_tid_cleanup (ar, peer); + peer->dp_setup_done = false;crypto_free_shash (peer->tfm_mmic);spin_unlock_bh (&ab->base_lock); }
@@ -72,7 +73,8 @@ int ath11k_dp_peer_setup(struct ath11k *ar, int vdev_id, const u8 *addr) ret =ath11k_peer_rx_frag_setup (ar, addr, vdev_id);if (ret) {ath11k_warn (ab,"failed to setup rx defrag context\n" ); -return ret; + tid--; + goto peer_clean; }/* TODO: Setup other peer specific resource used in data path */
drivers/net/wireless/ath/ath11k/dp_rx.c +8 -0
@@ -3138,6 +3138,7 @@ int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id } peer->tfm_mmic = tfm; + peer->dp_setup_done = true;spin_unlock_bh (&ab->base_lock);return 0 ;
@@ -3583,6 +3584,13 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, ret = -ENOENT ; goto out_unlock; } +if (!peer->dp_setup_done) { +ath11k_warn (ab,"The peer %pM [%d] has uninitialized datapath\n" , + peer->addr, peer_id); + ret = -ENOENT ; + goto out_unlock; + } + rx_tid = &peer->rx_tid[tid]; if ((!skb_queue_empty(&rx_tid->rx_frags) && seqno != rx_tid->cur_sn) ||
drivers/net/wireless/ath/ath11k/peer.h +1 -0
@@ -35,6 +35,7 @@ struct ath11k_peer {u16 sec_type;u16 sec_type_grp;bool is_authorized; +bool dp_setup_done; };void ath11k_peer_unmap_event (struct ath11k_base *ab,u16 peer_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 126/364 wifi: mt76: mt7921: add Netgear AXE3000 (A8000) support
In reply to Greg Kroah-HartmanFrom: Reese Russell <[email protected]>
[ Upstream commit 03eb52dd78cab08f13925aeec8315fbdbcba3253 ]
Issue: Though the Netgear AXE3000 (A8000) is based on the mt7921 chipset because of the unique USB VID:PID combination this device does not initialize/register. Thus making it not plug and play.
Fix: Adds support for the Netgear AXE3000 (A8000) based on the Mediatek mt7921au chipset. The method of action is adding the USD VID/PID pair to the mt7921u_device_table[] array.
Notes: A retail sample of the Netgear AXE3000 (A8000) yeilds the following from lsusb D 0846:9060 NetGear, Inc. Wireless_Device. This pair 0846:9060 VID:PID has been reported by other users on Github.
--- drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/usb.c +3 -0
@@ -18,6 +18,9 @@ static const struct usb_device_id mt7921u_device_table[] = {/* Comfast CF-952AX */ { USB_DEVICE_AND_INTERFACE_INFO(0x3574, 0x6211, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM }, + /* Netgear, Inc. [A8000,AXE3000] */ + { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9060, 0xff, 0xff, 0xff), + .driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM }, { }, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 127/364 wifi: iwlwifi: fix iwl_mvm_max_amsdu_size() for MLO
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit b2bc600cced23762d4e97db8989b18772145604f ]
For MLO, we cannot use vif->bss_conf.chandef.chan->band, since that will lead to a NULL-ptr dereference as bss_conf isn't used. However, in case of real MLO, we also need to take both LMACs into account if they exist, since the station might be active on both LMACs at the same time.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 37 +++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +34 -3
@@ -791,10 +791,11 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, struct ieee80211_sta *sta, unsigned int tid) {struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta); -enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band;u8 ac = tid_to_mac80211_ac[tid]; +enum nl80211_band band;unsigned int txf; -int lmac =iwl_mvm_get_lmac_id (mvm->fw, band); +unsigned int val; +int lmac;/* For HE redirect to trigger based fifos */ if (sta->deflink.he_cap.has_he && !WARN_ON (!iwl_mvm_has_new_tx_api (mvm)))
@@ -808,7 +809,37 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm,* We also want to have the start of the next packet inside the * fifo to be able to send bursts. */ - return min_t(unsigned int, mvmsta->max_amsdu_len, + val = mvmsta->max_amsdu_len; + +if (hweight16 (sta->valid_links) <=1 ) { +if (sta->valid_links) { +struct ieee80211_bss_conf *link_conf; +unsigned int link =ffs (sta->valid_links) -1 ; + +rcu_read_lock (); + link_conf =rcu_dereference (mvmsta->vif->link_conf[link]); +if (WARN_ON (!link_conf)) + band =NL80211_BAND_2GHZ ; +else + band = link_conf->chandef.chan->band; +rcu_read_unlock (); + }else { + band = mvmsta->vif->bss_conf.chandef.chan->band; + } + + lmac =iwl_mvm_get_lmac_id (mvm->fw, band); + }else if (fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_CDB_SUPPORT )) { +/* for real MLO restrict to both LMACs if they exist */ + lmac =IWL_LMAC_5G_INDEX ; + val = min_t(unsigned int, val, + mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] -256 ); + lmac =IWL_LMAC_24G_INDEX ; + }else { + lmac =IWL_LMAC_24G_INDEX ; + } + + return min_t(unsigned int, val, mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] -256 ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 128/364 f2fs: relax sanity check if checkpoint is corrupted
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
[ Upstream commit bd90c5cd339a9d7cdc609d2d6310b80dc697070d ]
1. extent_cache
- let's drop the largest extent_cache
2. invalidate_block
- don't show the warnings
--- fs/f2fs/checkpoint.c | 10 ++++++++++ fs/f2fs/data.c | 4 ++++ fs/f2fs/extent_cache.c | 22 +++++++++++++++------- 3 files changed, 29 insertions(+), 7 deletions(-)
fs/f2fs/checkpoint.c +10 -0
@@ -152,6 +152,11 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr, se =get_seg_entry (sbi, segno); exist =f2fs_test_bit (offset, se->cur_valid_map); + +/* skip data, if we already have an error in checkpoint. */ +if (unlikely (f2fs_cp_error (sbi))) +return exist; +if (exist && type ==DATA_GENERIC_ENHANCE_UPDATE ) {f2fs_err (sbi,"Inconsistent error blkaddr:%u, sit bitmap:%d" , blkaddr, exist);
@@ -202,6 +207,11 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,case DATA_GENERIC_ENHANCE_UPDATE :if (unlikely (blkaddr >=MAX_BLKADDR (sbi) || blkaddr <MAIN_BLKADDR (sbi))) { + +/* Skip to emit an error message. */ +if (unlikely (f2fs_cp_error (sbi))) +return false; +f2fs_warn (sbi,"access invalid blkaddr:%u" , blkaddr);set_sbi_flag (sbi,SBI_NEED_FSCK );
fs/f2fs/data.c +4 -0
@@ -2237,6 +2237,10 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,if (ret) goto out; +if (unlikely (f2fs_cp_error (sbi))) { + ret = -EIO ; + goto out_put_dnode; + }f2fs_bug_on (sbi, dn.data_blkaddr !=COMPRESS_ADDR ); skip_reading_dnode:
fs/f2fs/extent_cache.c +15 -7
@@ -23,18 +23,26 @@ bool sanity_check_extent_cache(struct inode *inode) {struct f2fs_sb_info *sbi =F2FS_I_SB (inode);struct f2fs_inode_info *fi =F2FS_I (inode); +struct extent_tree *et = fi->extent_tree[EX_READ ];struct extent_info *ei; -if (!fi->extent_tree[EX_READ ]) +if (!et) +return true; + + ei = &et->largest; +if (!ei->len)return true; - ei = &fi->extent_tree[EX_READ ]->largest; +/* Let's drop, if checkpoint got corrupted. */ +if (is_set_ckpt_flags (sbi,CP_ERROR_FLAG )) { + ei->len =0 ; + et->largest_updated = true; +return true; + } -if (ei->len && - (!f2fs_is_valid_blkaddr (sbi, ei->blk, -DATA_GENERIC_ENHANCE ) || - !f2fs_is_valid_blkaddr (sbi, ei->blk + ei->len -1 , -DATA_GENERIC_ENHANCE ))) { +if (!f2fs_is_valid_blkaddr (sbi, ei->blk,DATA_GENERIC_ENHANCE ) || + !f2fs_is_valid_blkaddr (sbi, ei->blk + ei->len -1 , +DATA_GENERIC_ENHANCE )) {set_sbi_flag (sbi,SBI_NEED_FSCK ); f2fs_warn(sbi, "%s: inode (ino=%lx) extent info [%u, %u, %u] is incorrect, run fsck to fix", __func__, inode->i_ino,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 129/364 null_blk: Always check queue mode setting from configfs
In reply to Greg Kroah-HartmanFrom: Chaitanya Kulkarni <[email protected]>
[ Upstream commit 63f8793ee60513a09f110ea460a6ff2c33811cdb ]
Make sure to check device queue mode in the null_validate_conf() and return error for NULL_Q_RQ as we don't allow legacy I/O path, without this patch we get OOPs when queue mode is set to 1 from configfs, following are repro steps :-
modprobe null_blk nr_devices=0
mkdir config/nullb/nullb0
echo 1 > config/nullb/nullb0/memory_backed
echo 4096 > config/nullb/nullb0/blocksize
echo 20480 > config/nullb/nullb0/size
echo 1 > config/nullb/nullb0/queue_mode
echo 1 > config/nullb/nullb0/power
Entering kdb (current=0xffff88810acdd080, pid 2372) on processor 42 Oops: (null) due to oops @ 0xffffffffc041c329
CPU: 42 PID: 2372 Comm: sh Tainted: G O N 6.3.0-rc5lblk+ #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:null_add_dev.part.0+0xd9/0x720 [null_blk] Code: 01 00 00 85 d2 0f 85 a1 03 00 00 48 83 bb 08 01 00 00 00 0f 85 f7 03 00 00 80 bb 62 01 00 00 00 48 8b 75 20 0f 85 6d 02 00 00 <48> 89 6e 60 48 8b 75 20 bf 06 00 00 00 e8 f5 37 2c c1 48 8b 75 20 RSP: 0018:ffffc900052cbde0 EFLAGS: 00010246 RAX: 0000000000000001 RBX: ffff88811084d800 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888100042e00 RBP: ffff8881053d8200 R08: ffffc900052cbd68 R09: ffff888105db2000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000002 R13: ffff888104765200 R14: ffff88810eec1748 R15: ffff88810eec1740 FS: 00007fd445fd1740(0000) GS:ffff8897dfc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000060 CR3: 0000000166a00000 CR4: 0000000000350ee0 DR0: ffffffff8437a488 DR1: ffffffff8437a489 DR2: ffffffff8437a48a DR3: ffffffff8437a48b DR6: 00000000ffff0ff0 DR7: 0000000000000400 Call Trace: <TASK> nullb_device_power_store+0xd1/0x120 [null_blk] configfs_write_iter+0xb4/0x120 vfs_write+0x2ba/0x3c0 ksys_write+0x5f/0xe0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7fd4460c57a7 Code: 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 RSP: 002b:00007ffd3792a4a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fd4460c57a7 RDX: 0000000000000002 RSI: 000055b43c02e4c0 RDI: 0000000000000001 RBP: 000055b43c02e4c0 R08: 000000000000000a R09: 00007fd44615b4e0 R10: 00007fd44615b3e0 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fd446198520 R14: 0000000000000002 R15: 00007fd446198700 </TASK>
--- drivers/block/null_blk/main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/block/null_blk/main.c +5 -0
@@ -1964,6 +1964,11 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)static int null_validate_conf (struct nullb_device *dev) { +if (dev->queue_mode ==NULL_Q_RQ ) { +pr_err ("legacy IO path is no longer available\n" ); +return -EINVAL ; + } + dev->blocksize =round_down (dev->blocksize,512 ); dev->blocksize = clamp_t(unsigned int, dev->blocksize, 512, 4096);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 130/364 wifi: iwlwifi: dvm: Fix memcpy: detected field-spanning write backtrace
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit ef16799640865f937719f0771c93be5dca18adc6 ]
A received TKIP key may be up to 32 bytes because it may contain MIC rx/tx keys too. These are not used by iwl and copying these over overflows the iwl_keyinfo.key field.
Add a check to not copy more data to iwl_keyinfo.key then will fit.
This fixes backtraces like this one:
memcpy: detected field-spanning write (size 32) of single field "sta_cmd.key.key" at drivers/net/wireless/intel/iwlwifi/dvm/sta.c:1103 (size 16)
WARNING: CPU: 1 PID: 946 at drivers/net/wireless/intel/iwlwifi/dvm/sta.c:1103 iwlagn_send_sta_key+0x375/0x390 [iwldvm] <snip> Hardware name: Dell Inc. Latitude E6430/0H3MT5, BIOS A21 05/08/2017 RIP: 0010:iwlagn_send_sta_key+0x375/0x390 [iwldvm] <snip> Call Trace: <TASK> iwl_set_dynamic_key+0x1f0/0x220 [iwldvm] iwlagn_mac_set_key+0x1e4/0x280 [iwldvm] drv_set_key+0xa4/0x1b0 [mac80211] ieee80211_key_enable_hw_accel+0xa8/0x2d0 [mac80211] ieee80211_key_replace+0x22d/0x8e0 [mac80211] <snip>
--- drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/dvm/sta.c +4 -1
@@ -1081,6 +1081,7 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv, {__le16 key_flags;struct iwl_addsta_cmd sta_cmd; +size_t to_copy;int i;spin_lock_bh (&priv->sta_lock);
@@ -1100,7 +1101,9 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv, sta_cmd.key.tkip_rx_tsc_byte2 = tkip_iv32;for (i =0 ; i <5 ; i++) sta_cmd.key.tkip_rx_ttak[i] =cpu_to_le16 (tkip_p1k[i]); -memcpy (sta_cmd.key.key, keyconf->key, keyconf->keylen); +/* keyconf may contain MIC rx/tx keys which iwl does not use */ + to_copy =min_t (size_t,sizeof (sta_cmd.key.key), keyconf->keylen); +memcpy (sta_cmd.key.key, keyconf->key, to_copy);break ;case WLAN_CIPHER_SUITE_WEP104 : key_flags |=STA_KEY_FLG_KEY_SIZE_MSK ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 131/364 wifi: ath11k: Fix SKB corruption in REO destination ring
In reply to Greg Kroah-HartmanFrom: Nagarajan Maran <[email protected]>
[ Upstream commit f9fff67d2d7ca6fa8066132003a3deef654c55b1 ]
While running traffics for a long time, randomly an RX descriptor filled with value "0" from REO destination ring is received. This descriptor which is invalid causes the wrong SKB (SKB stored in the IDR lookup with buffer id "0") to be fetched which in turn causes SKB memory corruption issue and the same leads to crash after some time.
Changed the start id for idr allocation to "1" and the buffer id "0" is reserved for error validation. Introduced Sanity check to validate the descriptor, before processing the SKB.
Crash Signature :
Unable to handle kernel paging request at virtual address 3f004900 PC points to "b15_dma_inv_range+0x30/0x50" LR points to "dma_cache_maint_page+0x8c/0x128".
The Backtrace obtained is as follows:
[<8031716c>] (b15_dma_inv_range) from [<80313a4c>] (dma_cache_maint_page+0x8c/0x128)
[<80313a4c>] (dma_cache_maint_page) from [<80313b90>] (__dma_page_dev_to_cpu+0x28/0xcc) [<80313b90>] (__dma_page_dev_to_cpu) from [<7fb5dd68>] (ath11k_dp_process_rx+0x1e8/0x4a4 [ath11k]) [<7fb5dd68>] (ath11k_dp_process_rx [ath11k]) from [<7fb53c20>] (ath11k_dp_service_srng+0xb0/0x2ac [ath11k]) [<7fb53c20>] (ath11k_dp_service_srng [ath11k]) from [<7f67bba4>] (ath11k_pci_ext_grp_napi_poll+0x1c/0x78 [ath11k_pci]) [<7f67bba4>] (ath11k_pci_ext_grp_napi_poll [ath11k_pci]) from [<807d5cf4>] (__napi_poll+0x28/0xb8) [<807d5cf4>] (__napi_poll) from [<807d5f28>] (net_rx_action+0xf0/0x280)
[<807d5f28>] (net_rx_action) from [<80302148>] (__do_softirq+0xd0/0x280)
[<80302148>] (__do_softirq) from [<80320408>] (irq_exit+0x74/0xd4)
[<80320408>] (irq_exit) from [<803638a4>] (__handle_domain_irq+0x90/0xb4)
[<803638a4>] (__handle_domain_irq) from [<805bedec>] (gic_handle_irq+0x58/0x90)
[<805bedec>] (gic_handle_irq) from [<80301a78>] (__irq_svc+0x58/0x8c)
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +6 -3
@@ -389,10 +389,10 @@ int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, goto fail_free_skb;spin_lock_bh (&rx_ring->idr_lock); - buf_id =idr_alloc (&rx_ring->bufs_idr, skb,0 , - rx_ring->bufs_max *3 ,GFP_ATOMIC ); + buf_id =idr_alloc (&rx_ring->bufs_idr, skb,1 , + (rx_ring->bufs_max *3 ) +1 ,GFP_ATOMIC );spin_unlock_bh (&rx_ring->idr_lock); -if (buf_id <0 ) +if (buf_id <=0 ) goto fail_dma_unmap; desc =ath11k_hal_srng_src_get_next_entry (ab, srng);
@@ -2665,6 +2665,9 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, cookie); mac_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_PDEV_ID , cookie); +if (unlikely (buf_id ==0 )) +continue ; + ar = ab->pdevs[mac_id].ar; rx_ring = &ar->dp.rx_refill_buf_ring;spin_lock_bh (&rx_ring->idr_lock);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 132/364 wifi: rtw88: Fix memory leak in rtw88_usb
In reply to Greg Kroah-HartmanFrom: Larry Finger <[email protected]>
[ Upstream commit 59a3a312009723e3e5082899655fdcc420e2b47a ]
Kmemleak shows the following leak arising from routine in the usb probe routine:
unreferenced object 0xffff895cb29bba00 (size 512):
comm "(udev-worker)", pid 534, jiffies 4294903932 (age 102751.088s) hex dump (first 32 bytes):
77 30 30 30 00 00 00 00 02 2f 2d 2b 30 00 00 00 w000...../-+0...
02 00 2a 28 00 00 00 00 ff 55 ff ff ff 00 00 00 ..*(.....U......
backtrace:
[<ffffffff9265fa36>] kmalloc_trace+0x26/0x90
[<ffffffffc17eec41>] rtw_usb_probe+0x2f1/0x680 [rtw_usb]
[<ffffffffc03e19fd>] usb_probe_interface+0xdd/0x2e0 [usbcore]
[<ffffffff92b4f2fe>] really_probe+0x18e/0x3d0
[<ffffffff92b4f5b8>] __driver_probe_device+0x78/0x160
[<ffffffff92b4f6bf>] driver_probe_device+0x1f/0x90
[<ffffffff92b4f8df>] __driver_attach+0xbf/0x1b0
[<ffffffff92b4d350>] bus_for_each_dev+0x70/0xc0
[<ffffffff92b4e51e>] bus_add_driver+0x10e/0x210
[<ffffffff92b50935>] driver_register+0x55/0xf0
[<ffffffffc03e0708>] usb_register_driver+0x88/0x140 [usbcore]
[<ffffffff92401153>] do_one_initcall+0x43/0x210
[<ffffffff9254f42a>] do_init_module+0x4a/0x200
[<ffffffff92551d1c>] __do_sys_finit_module+0xac/0x120
[<ffffffff92ee6626>] do_syscall_64+0x56/0x80
[<ffffffff9300006a>] entry_SYSCALL_64_after_hwframe+0x46/0xb0The leak was verified to be real by unloading the driver, which resulted in a dangling pointer to the allocation.
The allocated memory is freed in rtw_usb_intf_deinit().
--- drivers/net/wireless/realtek/rtw88/usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw88/usb.c +1 -0
@@ -804,6 +804,7 @@ static void rtw_usb_intf_deinit(struct rtw_dev *rtwdev,struct rtw_usb *rtwusb =rtw_get_usb_priv (rtwdev);usb_put_dev (rtwusb->udev); +kfree (rtwusb->usb_data);usb_set_intfdata (intf,NULL ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 133/364 nbd: fix incomplete validation of ioctl arg
In reply to Greg Kroah-HartmanFrom: Zhong Jinghua <[email protected]>
[ Upstream commit 55793ea54d77719a071b1ccc05a05056e3b5e009 ]
We tested and found an alarm caused by nbd_ioctl arg without verification. The UBSAN warning calltrace like below:
UBSAN: Undefined behaviour in fs/buffer.c:1709:35 signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long long int' CPU: 3 PID: 2523 Comm: syz-executor.0 Not tainted 4.19.90 #1 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x3f0 arch/arm64/kernel/time.c:78 show_stack+0x28/0x38 arch/arm64/kernel/traps.c:158 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x170/0x1dc lib/dump_stack.c:118 ubsan_epilogue+0x18/0xb4 lib/ubsan.c:161 handle_overflow+0x188/0x1dc lib/ubsan.c:192 __ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:206 __block_write_full_page+0x94c/0xa20 fs/buffer.c:1709 block_write_full_page+0x1f0/0x280 fs/buffer.c:2934 blkdev_writepage+0x34/0x40 fs/block_dev.c:607 __writepage+0x68/0xe8 mm/page-writeback.c:2305 write_cache_pages+0x44c/0xc70 mm/page-writeback.c:2240 generic_writepages+0xdc/0x148 mm/page-writeback.c:2329 blkdev_writepages+0x2c/0x38 fs/block_dev.c:2114 do_writepages+0xd4/0x250 mm/page-writeback.c:2344
The reason for triggering this warning is __block_write_full_page() -> i_size_read(inode) - 1 overflow.inode->i_size is assigned in __nbd_ioctl() -> nbd_set_size() -> bytesize. We think it is necessary to limit the size of arg to prevent errors.
Moreover, __nbd_ioctl() -> nbd_add_socket(), arg will be cast to int. Assuming the value of arg is 0x80000000000000001) (on a 64-bit machine), it will become 1 after the coercion, which will return unexpected results.
Fix it by adding checks to prevent passing in too large numbers.
--- drivers/block/nbd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/block/nbd.c +6 -0
@@ -325,6 +325,9 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize,if (blk_validate_block_size (blksize))return -EINVAL ; +if (bytesize <0 ) +return -EINVAL ; + nbd->config->bytesize = bytesize; nbd->config->blksize_bits =__ffs (blksize);
@@ -1111,6 +1114,9 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,struct nbd_sock *nsock;int err; +/* Arg will be cast to int, check it to avoid overflow */ +if (arg >INT_MAX ) +return -EINVAL ; sock =nbd_get_socket (nbd, arg, &err);if (!sock)return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 134/364 ipvs: Update width of source for ip_vs_sync_conn_options
In reply to Greg Kroah-HartmanFrom: Simon Horman <[email protected]>
[ Upstream commit e3478c68f6704638d08f437cbc552ca5970c151a ]
In ip_vs_sync_conn_v0() copy is made to struct ip_vs_sync_conn_options. That structure looks like this:
struct ip_vs_sync_conn_options {
struct ip_vs_seq in_seq;
struct ip_vs_seq out_seq;
};The source of the copy is the in_seq field of struct ip_vs_conn. Whose type is struct ip_vs_seq. Thus we can see that the source - is not as wide as the amount of data copied, which is the width of struct ip_vs_sync_conn_option.
The copy is safe because the next field in is another struct ip_vs_seq. Make use of struct_group() to annotate this.
Flagged by gcc-13 as:
In file included from ./include/linux/string.h:254,
from ./include/linux/bitmap.h:11,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/paravirt.h:17,
from ./arch/x86/include/asm/cpuid.h:62,
from ./arch/x86/include/asm/processor.h:19,
from ./arch/x86/include/asm/timex.h:5,
from ./include/linux/timex.h:67,
from ./include/linux/time32.h:13,
from ./include/linux/time.h:60,
from ./include/linux/stat.h:19,
from ./include/linux/module.h:13,
from net/netfilter/ipvs/ip_vs_sync.c:38:
In function 'fortify_memcpy_chk',
inlined from 'ip_vs_sync_conn_v0' at net/netfilter/ipvs/ip_vs_sync.c:606:3:
./include/linux/fortify-string.h:529:25: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]
529 | __read_overflow2_field(q_size_field, size);
|Compile tested only.
--- include/net/ip_vs.h | 6 ++++-- net/netfilter/ipvs/ip_vs_sync.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
include/net/ip_vs.h +4 -2
@@ -630,8 +630,10 @@ struct ip_vs_conn {*/ struct ip_vs_app *app;/* bound ip_vs_app object */ void *app_data;/* Application private data */ -struct ip_vs_seq in_seq;/* incoming seq. struct */ -struct ip_vs_seq out_seq;/* outgoing seq. struct */ +struct_group (sync_conn_opt, + struct ip_vs_seq in_seq; /* incoming seq. struct */ +struct ip_vs_seq out_seq;/* outgoing seq. struct */ + );const struct ip_vs_pe *pe;char *pe_data;
net/netfilter/ipvs/ip_vs_sync.c +1 -1
@@ -603,7 +603,7 @@ static void ip_vs_sync_conn_v0(struct netns_ipvs *ipvs, struct ip_vs_conn *cp,if (cp->flags &IP_VS_CONN_F_SEQ_MASK ) {struct ip_vs_sync_conn_options *opt = (struct ip_vs_sync_conn_options *)&s[1 ]; -memcpy (opt, &cp->in_seq,sizeof (*opt)); +memcpy (opt, &cp->sync_conn_opt,sizeof (*opt)); } m->nr_conns++;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 135/364 Bluetooth: btusb: Add new PID/VID 04ca:3801 for MT7663
In reply to Greg Kroah-HartmanFrom: Meng Tang <[email protected]>
[ Upstream commit 13209415d0e88396d99d346b184864834d70d68a ]
This bluetooth device is found in a combo WLAN/BT card for a MediaTek 7663.
Tested on Acer Aspire A315-24P Notebook
The device information:
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04ca ProdID=3801 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
--- drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btusb.c +3 -0
@@ -558,6 +558,9 @@ static const struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x043e, 0x310c), .driver_info = BTUSB_MEDIATEK |BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3801), .driver_info = BTUSB_MEDIATEK | +BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, /* Additional MediaTek MT7668 Bluetooth devices */ { USB_DEVICE(0x043e, 0x3109), .driver_info = BTUSB_MEDIATEK |
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 136/364 Bluetooth: Add new quirk for broken local ext features page 2
In reply to Greg Kroah-HartmanFrom: Vasily Khoruzhick <[email protected]>
[ Upstream commit 8194f1ef5a815aea815a91daf2c721eab2674f1f ]
Some adapters (e.g. RTL8723CS) advertise that they have more than 2 pages for local ext features, but they don't support any features declared in these pages. RTL8723CS reports max_page = 2 and declares support for sync train and secure connection, but it responds with either garbage or with error in status on corresponding commands.
--- include/net/bluetooth/hci.h | 7 +++++++ net/bluetooth/hci_event.c | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-)
include/net/bluetooth/hci.h +7 -0
@@ -294,6 +294,13 @@ enum {* during the hdev->setup vendor callback. */ HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG , + +/* When this quirk is set, max_page for local extended features +* is set to 1, even if controller reports higher number. Some +* controllers (e.g. RTL8723CS) report more pages, but they +* don't actually support features declared there. +*/ + HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, };/* HCI device flags */
net/bluetooth/hci_event.c +7 -2
@@ -886,8 +886,13 @@ static u8 hci_cc_read_local_ext_features(struct hci_dev *hdev, void *data,if (rp->status)return rp->status; -if (hdev->max_page < rp->max_page) - hdev->max_page = rp->max_page; +if (hdev->max_page < rp->max_page) { +if (test_bit (HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2 , + &hdev->quirks)) +bt_dev_warn (hdev,"broken local ext features page 2" ); +else + hdev->max_page = rp->max_page; + }if (rp->page <HCI_MAX_PAGES )memcpy (hdev->features[rp->page], rp->features,8 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 137/364 Bluetooth: btrtl: add support for the RTL8723CS
In reply to Greg Kroah-HartmanFrom: Vasily Khoruzhick <[email protected]>
[ Upstream commit c0123cb6c4c7fc2a42ead6cd7d3e82b8e1c25c6f ]
The Realtek RTL8723CS is a SDIO WiFi chip. It also contains a Bluetooth module which is connected via UART to the host.
It shares lmp subversion with 8703B, so Realtek's userspace initialization tool (rtk_hciattach) differentiates varieties of RTL8723CS (CG, VF, XX) with RTL8703B using vendor's command to read chip type.
Also this chip declares support for some features it doesn't support so add a quirk to indicate that these features are broken.
--- drivers/bluetooth/btrtl.c | 120 +++++++++++++++++++++++++++++++++++-- drivers/bluetooth/btrtl.h | 5 ++ drivers/bluetooth/hci_h5.c | 4 ++ 3 files changed, 125 insertions(+), 4 deletions(-)
drivers/bluetooth/btrtl.c +116 -4
@@ -17,7 +17,11 @@#define VERSION "0.1" +#define RTL_CHIP_8723CS_CG 3 +#define RTL_CHIP_8723CS_VF 4 +#define RTL_CHIP_8723CS_XX 5#define RTL_EPATCH_SIGNATURE "Realtech" +#define RTL_ROM_LMP_8703B 0x8703#define RTL_ROM_LMP_8723A 0x1200#define RTL_ROM_LMP_8723B 0x8723#define RTL_ROM_LMP_8821A 0x8821
@@ -30,6 +34,7 @@#define IC_MATCH_FL_HCIREV (1 << 1)#define IC_MATCH_FL_HCIVER (1 << 2)#define IC_MATCH_FL_HCIBUS (1 << 3) +#define IC_MATCH_FL_CHIP_TYPE (1 << 4)#define IC_INFO (lmps, hcir, hciv, bus) \ .match_flags = IC_MATCH_FL_LMPSUBV | IC_MATCH_FL_HCIREV | \ IC_MATCH_FL_HCIVER | IC_MATCH_FL_HCIBUS, \
@@ -59,6 +64,7 @@ struct id_table {__u16 hci_rev;__u8 hci_ver;__u8 hci_bus; +__u8 chip_type;bool config_needed;bool has_rom_version;bool has_msft_ext;
@@ -99,6 +105,39 @@ static const struct id_table ic_id_table[] = { .fw_name = "rtl_bt/rtl8723b_fw.bin", .cfg_name = "rtl_bt/rtl8723b_config" }, +/* 8723CS-CG */ + { .match_flags = IC_MATCH_FL_LMPSUBV | IC_MATCH_FL_CHIP_TYPE | + IC_MATCH_FL_HCIBUS, + .lmp_subver = RTL_ROM_LMP_8703B, + .chip_type = RTL_CHIP_8723CS_CG, + .hci_bus = HCI_UART, + .config_needed = true, + .has_rom_version = true, + .fw_name = "rtl_bt/rtl8723cs_cg_fw.bin", + .cfg_name = "rtl_bt/rtl8723cs_cg_config" }, + + /* 8723CS-VF */ + { .match_flags = IC_MATCH_FL_LMPSUBV | IC_MATCH_FL_CHIP_TYPE | + IC_MATCH_FL_HCIBUS, + .lmp_subver = RTL_ROM_LMP_8703B, + .chip_type = RTL_CHIP_8723CS_VF, + .hci_bus = HCI_UART, + .config_needed = true, + .has_rom_version = true, + .fw_name = "rtl_bt/rtl8723cs_vf_fw.bin", + .cfg_name = "rtl_bt/rtl8723cs_vf_config" }, + + /* 8723CS-XX */ + { .match_flags = IC_MATCH_FL_LMPSUBV | IC_MATCH_FL_CHIP_TYPE | + IC_MATCH_FL_HCIBUS, + .lmp_subver = RTL_ROM_LMP_8703B, + .chip_type = RTL_CHIP_8723CS_XX, + .hci_bus = HCI_UART, + .config_needed = true, + .has_rom_version = true, + .fw_name = "rtl_bt/rtl8723cs_xx_fw.bin", + .cfg_name = "rtl_bt/rtl8723cs_xx_config" }, + /* 8723D */ { IC_INFO(RTL_ROM_LMP_8723B, 0xd, 0x8, HCI_USB), .config_needed = true,
@@ -208,7 +247,8 @@ static const struct id_table ic_id_table[] = { };static const struct id_table *btrtl_match_ic (u16 lmp_subver,u16 hci_rev, -u8 hci_ver,u8 hci_bus) +u8 hci_ver,u8 hci_bus, +u8 chip_type) {int i;
@@ -225,6 +265,9 @@ static const struct id_table *btrtl_match_ic(u16 lmp_subver, u16 hci_rev,if ((ic_id_table[i].match_flags &IC_MATCH_FL_HCIBUS ) && (ic_id_table[i].hci_bus != hci_bus))continue ; +if ((ic_id_table[i].match_flags &IC_MATCH_FL_CHIP_TYPE ) && + (ic_id_table[i].chip_type != chip_type)) +continue ;break ; }
@@ -307,6 +350,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev, { RTL_ROM_LMP_8723B, 1 }, { RTL_ROM_LMP_8821A, 2 }, { RTL_ROM_LMP_8761A, 3 }, + { RTL_ROM_LMP_8703B, 7 }, { RTL_ROM_LMP_8822B, 8 }, { RTL_ROM_LMP_8723B, 9 }, /* 8723D */ { RTL_ROM_LMP_8821A, 10 }, /* 8821C */
@@ -587,6 +631,48 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev,return ret; } +static bool rtl_has_chip_type (u16 lmp_subver) +{ +switch (lmp_subver) { +case RTL_ROM_LMP_8703B : +return true; +default : +break ; + } + +return false; +} + +static int rtl_read_chip_type (struct hci_dev *hdev,u8 *type) +{ +struct rtl_chip_type_evt *chip_type; +struct sk_buff *skb; +const unsigned char cmd_buf[] = {0x00 ,0x94 ,0xa0 ,0x00 ,0xb0 }; + +/* Read RTL chip type command */ + skb =__hci_cmd_sync (hdev,0xfc61 ,5 , cmd_buf,HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { +rtl_dev_err (hdev,"Read chip type failed (%ld)" , +PTR_ERR (skb)); +return PTR_ERR (skb); + } + + chip_type =skb_pull_data (skb,sizeof (*chip_type)); +if (!chip_type) { +rtl_dev_err (hdev,"RTL chip type event length mismatch" ); +kfree_skb (skb); +return -EIO ; + } + +rtl_dev_info (hdev,"chip_type status=%x type=%x" , + chip_type->status, chip_type->type); + + *type = chip_type->type &0x0f ; + +kfree_skb (skb); +return 0 ; +} +void btrtl_free (struct btrtl_device_info *btrtl_dev) {kvfree (btrtl_dev->fw_data);
@@ -603,7 +689,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,struct hci_rp_read_local_version *resp;char cfg_name[40 ];u16 hci_rev, lmp_subver; -u8 hci_ver; +u8 hci_ver, chip_type =0 ;int ret;u16 opcode;u8 cmd[2 ];
@@ -629,8 +715,14 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hci_rev =le16_to_cpu (resp->hci_rev); lmp_subver =le16_to_cpu (resp->lmp_subver); +if (rtl_has_chip_type (lmp_subver)) { + ret =rtl_read_chip_type (hdev, &chip_type); +if (ret) + goto err_free; + } + btrtl_dev->ic_info =btrtl_match_ic (lmp_subver, hci_rev, hci_ver, - hdev->bus); + hdev->bus, chip_type);if (!btrtl_dev->ic_info) btrtl_dev->drop_fw = true;
@@ -673,7 +765,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, lmp_subver =le16_to_cpu (resp->lmp_subver); btrtl_dev->ic_info =btrtl_match_ic (lmp_subver, hci_rev, hci_ver, - hdev->bus); + hdev->bus, chip_type); } out_free:kfree_skb (skb);
@@ -755,6 +847,7 @@ int btrtl_download_firmware(struct hci_dev *hdev,case RTL_ROM_LMP_8761A :case RTL_ROM_LMP_8822B :case RTL_ROM_LMP_8852A : +case RTL_ROM_LMP_8703B :return btrtl_setup_rtl8723b (hdev, btrtl_dev);default :rtl_dev_info (hdev,"assuming no firmware upload needed" );
@@ -795,6 +888,19 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)rtl_dev_dbg (hdev,"WBS supported not enabled." );break ; } + +switch (btrtl_dev->ic_info->lmp_subver) { +case RTL_ROM_LMP_8703B : +/* 8723CS reports two pages for local ext features, +* but it doesn't support any features from page 2 - +* it either responds with garbage or with error status +*/ +set_bit (HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2 , + &hdev->quirks); +break ; +default : +break ; + } }EXPORT_SYMBOL_GPL (btrtl_set_quirks);
@@ -953,6 +1059,12 @@ MODULE_FIRMWARE("rtl_bt/rtl8723b_fw.bin");MODULE_FIRMWARE ("rtl_bt/rtl8723b_config.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8723bs_fw.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8723bs_config.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_cg_fw.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_cg_config.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_vf_fw.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_vf_config.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_xx_fw.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8723cs_xx_config.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8723ds_fw.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8723ds_config.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8761a_fw.bin" );
drivers/bluetooth/btrtl.h +5 -0
@@ -14,6 +14,11 @@struct btrtl_device_info ; +struct rtl_chip_type_evt { +__u8 status; +__u8 type; +} __packed; +struct rtl_download_cmd {__u8 index;__u8 data[RTL_FRAG_LEN ];
drivers/bluetooth/hci_h5.c +4 -0
@@ -936,6 +936,8 @@ static int h5_btrtl_setup(struct h5 *h5) err =btrtl_download_firmware (h5->hu->hdev, btrtl_dev);/* Give the device some time before the hci-core sends it a reset */ usleep_range (10000 ,20000 ); +if (err) + goto out_free;btrtl_set_quirks (h5->hu->hdev, btrtl_dev);
@@ -1100,6 +1102,8 @@ static const struct of_device_id rtl_bluetooth_of_match[] = { .data = (const void *)&h5_data_rtl8822cs }, { .compatible = "realtek,rtl8723bs-bt", .data = (const void *)&h5_data_rtl8723bs }, + { .compatible = "realtek,rtl8723cs-bt", + .data = (const void *)&h5_data_rtl8723bs }, { .compatible = "realtek,rtl8723ds-bt", .data = (const void *)&h5_data_rtl8723bs },#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 138/364 Bluetooth: Improve support for Actions Semi ATS2851 based devices
In reply to Greg Kroah-HartmanFrom: Raul Cheleguini <[email protected]>
[ Upstream commit 7c2b2d2d0cb658aa543e11e90ae95621d3cb5fe6 ]
Add two more quirks to resume the device initialization and basic operation as the device seems not to support "Read Transmit Power" and "Set Extended Scan Parameters".
< HCI Command: LE Read Transmit Power (0x08|0x004b) plen 0
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Read Transmit Power (0x08|0x004b) ncmd 1
Status: Unknown HCI Command (0x01)< HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 8
Own address type: Random (0x01)
Filter policy: Accept all advertisement (0x00)
PHYs: 0x01
Entry 0: LE 1M
Type: Active (0x01)
Interval: 11.250 msec (0x0012)
Window: 11.250 msec (0x0012)Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1
Status: Unknown HCI Command (0x01)--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -4105,6 +4105,8 @@ static int btusb_probe(struct usb_interface *intf,if (id->driver_info &BTUSB_ACTIONS_SEMI ) {/* Support is advertised, but not implemented */ set_bit (HCI_QUIRK_BROKEN_ERR_DATA_REPORTING , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_EXT_SCAN , &hdev->quirks); }if (!reset)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 139/364 Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
In reply to Greg Kroah-HartmanFrom: Max Chou <[email protected]>
[ Upstream commit 253cf30e8d3d001850a95c4729d668f916b037ab ]
The btrtl_set_quirks() has accessed btrtl_dev->ic_info->lmp_subver since b8e482d02513. However, if installing a Realtek Bluetooth controller without the driver supported, it will hit the NULL point accessed.
Add a check for NULL to avoid the Kernel Oops.
--- drivers/bluetooth/btrtl.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btrtl.c +3 -0
@@ -889,6 +889,9 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)break ; } +if (!btrtl_dev->ic_info) +return ; +switch (btrtl_dev->ic_info->lmp_subver) {case RTL_ROM_LMP_8703B :/* 8723CS reports two pages for local ext features,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 140/364 Bluetooth: btintel: Add LE States quirk support
In reply to Greg Kroah-HartmanFrom: Chethan T N <[email protected]>
[ Upstream commit 77f542b10c535c9a93bf8afdd2665524935807c2 ]
Basically all Intel controllers support both Central/Peripheral LE states.
This patch enables the LE States quirk by default on all Solar and Magnertor Intel controllers.
--- drivers/bluetooth/btintel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel.c +2 -3
@@ -2684,9 +2684,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)*/ set_bit (HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED , &hdev->quirks); -/* Valid LE States quirk for GfP */ -if (INTEL_HW_VARIANT (ver_tlv.cnvi_bt) ==0x18 ) -set_bit (HCI_QUIRK_VALID_LE_STATES , &hdev->quirks); +/* Apply LE States quirk from solar onwards */ +set_bit (HCI_QUIRK_VALID_LE_STATES , &hdev->quirks);/* Setup MSFT Extension support */ btintel_set_msft_opcode(hdev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 141/364 Bluetooth: hci_bcm: Fall back to getting bdaddr from EFI if not set
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 0d218c3642b9ccf71f44987cd03c19320f3bd918 ]
On some devices the BCM Bluetooth adapter does not have a valid bdaddr set.
btbcm.c currently sets HCI_QUIRK_INVALID_BDADDR to indicate when this is the case. But this requires users to manual setup a btaddr, by doing e.g.:
btmgmt -i hci0 public-addr 'B0:F1:EC:82:1D:B3'
Which means that Bluetooth will not work out of the box on such devices. To avoid this (where possible) hci_bcm sets: HCI_QUIRK_USE_BDADDR_PROPERTY which tries to get the bdaddr from devicetree.
But this only works on devicetree platforms. On UEFI based platforms there is a special Broadcom UEFI variable which when present contains the devices bdaddr, just like how there is another UEFI variable which contains wifi nvram contents including the wifi MAC address.
Add support for getting the bdaddr from this Broadcom UEFI variable, so that Bluetooth will work OOTB for users on devices where this UEFI variable is present.
This fixes Bluetooth not working on for example Asus T100HA 2-in-1s.
--- drivers/bluetooth/btbcm.c | 47 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-)
drivers/bluetooth/btbcm.c +44 -3
@@ -6,6 +6,7 @@* Copyright (C) 2015 Intel Corporation */ +#include <linux/efi.h> #include <linux/module.h> #include <linux/firmware.h> #include <linux/dmi.h>
@@ -34,6 +35,43 @@/* For kmalloc-ing the fw-name array instead of putting it on the stack */ typedef char bcm_fw_name [BCM_FW_NAME_LEN ]; +#ifdef CONFIG_EFI +static int btbcm_set_bdaddr_from_efi (struct hci_dev *hdev) +{ +efi_guid_t guid =EFI_GUID (0x74b00bd9 ,0x805a ,0x4d61 ,0xb5 ,0x1f , +0x43 ,0x26 ,0x81 ,0x23 ,0xd1 ,0x13 ); +bdaddr_t efi_bdaddr, bdaddr; +efi_status_t status; +unsigned long len; +int ret; + +if (!efi_rt_services_supported (EFI_RT_SUPPORTED_GET_VARIABLE )) +return -EOPNOTSUPP ; + + len =sizeof (efi_bdaddr); + status = efi.get_variable (L"BDADDR" , &guid,NULL , &len, &efi_bdaddr); +if (status !=EFI_SUCCESS ) +return -ENXIO ; + +if (len !=sizeof (efi_bdaddr)) +return -EIO ; + +baswap (&bdaddr, &efi_bdaddr); + + ret =btbcm_set_bdaddr (hdev, &bdaddr); +if (ret) +return ret; + +bt_dev_info (hdev,"BCM: Using EFI device address (%pMR)" , &bdaddr); +return 0 ; +} +#else +static int btbcm_set_bdaddr_from_efi (struct hci_dev *hdev) +{ +return -EOPNOTSUPP ; +} +#endif +int btbcm_check_bdaddr (struct hci_dev *hdev) {struct hci_rp_read_bd_addr *bda;
@@ -87,9 +125,12 @@ int btbcm_check_bdaddr(struct hci_dev *hdev) !bacmp(&bda->bdaddr, BDADDR_BCM4345C5) || !bacmp(&bda->bdaddr, BDADDR_BCM43430A0) || !bacmp(&bda->bdaddr, BDADDR_BCM43341B)) { -bt_dev_info (hdev,"BCM: Using default device address (%pMR)" , - &bda->bdaddr); -set_bit (HCI_QUIRK_INVALID_BDADDR , &hdev->quirks); +/* Try falling back to BDADDR EFI variable */ +if (btbcm_set_bdaddr_from_efi (hdev) !=0 ) { +bt_dev_info (hdev,"BCM: Using default device address (%pMR)" , + &bda->bdaddr); +set_bit (HCI_QUIRK_INVALID_BDADDR , &hdev->quirks); + } }kfree_skb (skb);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 142/364 Bluetooth: Add new quirk for broken set random RPA timeout for ATS2851
In reply to Greg Kroah-HartmanFrom: Raul Cheleguini <[email protected]>
[ Upstream commit 91b6d02ddcd113352bdd895990b252065c596de7 ]
The ATS2851 based controller advertises support for command "LE Set Random Private Address Timeout" but does not actually implement it, impeding the controller initialization.
Add the quirk HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT to unblock the controller initialization.
< HCI Command: LE Set Resolvable Private... (0x08|0x002e) plen 2
Timeout: 900 seconds
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 1
Status: Unknown HCI Command (0x01)--- drivers/bluetooth/btusb.c | 1 + include/net/bluetooth/hci.h | 8 ++++++++ net/bluetooth/hci_sync.c | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-)
drivers/bluetooth/btusb.c +1 -0
@@ -4106,6 +4106,7 @@ static int btusb_probe(struct usb_interface *intf,/* Support is advertised, but not implemented */ set_bit (HCI_QUIRK_BROKEN_ERR_DATA_REPORTING , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_EXT_SCAN , &hdev->quirks); }
include/net/bluetooth/hci.h +8 -0
@@ -301,6 +301,14 @@ enum {* don't actually support features declared there. */ HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2 , + +/* +* When this quirk is set, the HCI_OP_LE_SET_RPA_TIMEOUT command is +* skipped during initialization. This is required for the Actions +* Semiconductor ATS2851 based controllers, which erroneously claims +* to support it. +*/ + HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT, };/* HCI device flags */
net/bluetooth/hci_sync.c +5 -1
@@ -4093,7 +4093,8 @@ static int hci_le_set_rpa_timeout_sync(struct hci_dev *hdev) {__le16 timeout =cpu_to_le16 (hdev->rpa_timeout); -if (!(hdev->commands[35 ] &0x04 )) +if (!(hdev->commands[35 ] &0x04 ) || +test_bit (HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , &hdev->quirks))return 0 ; return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_RPA_TIMEOUT,
@@ -4533,6 +4534,9 @@ static const struct { "HCI Set Event Filter command not supported."),HCI_QUIRK_BROKEN (ENHANCED_SETUP_SYNC_CONN ,"HCI Enhanced Setup Synchronous Connection command is " +"advertised, but not supported." ), +HCI_QUIRK_BROKEN (SET_RPA_TIMEOUT , +"HCI LE Set Random Private Address Timeout command is " "advertised, but not supported.") };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 143/364 Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
In reply to Greg Kroah-HartmanFrom: Min Li <[email protected]>
[ Upstream commit 25e97f7b1866e6b8503be349eeea44bb52d661ce ]
conn->chan_lock isn't acquired before l2cap_get_chan_by_scid, if l2cap_get_chan_by_scid returns NULL, then 'bad unlock balance' is triggered.
--- net/bluetooth/l2cap_core.c | 1 - 1 file changed, 1 deletion(-)
net/bluetooth/l2cap_core.c +0 -1
@@ -4694,7 +4694,6 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, chan =l2cap_get_chan_by_scid (conn, scid);if (!chan) { -mutex_unlock (&conn->chan_lock);return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 144/364 Bluetooth: btrtl: Add the support for RTL8851B
In reply to Greg Kroah-HartmanFrom: Max Chou <[email protected]>
[ Upstream commit 7948fe1c92d92313eea5453f83deb7f0141355e8 ]
Add the support for RTL8851B BT controller on USB interface. The necessary firmware will be submitted to linux-firmware project.
Note that the Bluetooth devices WITH the VID=0x0bda would be set the feature quirk in btrtl_setup_realtek(). It's able to ignore the feature flag set for the specific VID and PID in blacklist_table[] of btusb.c. (check [1])
If Realtek Bluetooth chips WITHOUT the VID=0x0bda, it shall be added the feature flag for the specific VID and PID in blacklist_table[] of btusb.c. (check [2])
[1] '9ab9235fe5cf ("Bluetooth: btrtl: Enable WBS for the specific Realtek devices")'
[2] '73280f13c9bb ("Bluetooth: btusb: Add the more support IDs for
Realtek RTL8822CE")'
The device info from /sys/kernel/debug/usb/devices as below.
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 33 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=b851 Rev= 0.00 S: Manufacturer=Realtek S: Product=802.11ax WLAN Adapter S: SerialNumber=00E04C885A01 C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/bluetooth/btrtl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/bluetooth/btrtl.c +15 -0
@@ -28,6 +28,7 @@#define RTL_ROM_LMP_8761A 0x8761#define RTL_ROM_LMP_8822B 0x8822#define RTL_ROM_LMP_8852A 0x8852 +#define RTL_ROM_LMP_8851B 0x8851#define RTL_CONFIG_MAGIC 0x8723ab55#define IC_MATCH_FL_LMPSUBV (1 << 0)
@@ -56,6 +57,7 @@ enum btrtl_chip_id {CHIP_ID_8852A =18 ,CHIP_ID_8852B =20 ,CHIP_ID_8852C =25 , + CHIP_ID_8851B = 36, }; struct id_table {
@@ -244,6 +246,14 @@ static const struct id_table ic_id_table[] = { .has_msft_ext = true, .fw_name = "rtl_bt/rtl8852cu_fw.bin", .cfg_name = "rtl_bt/rtl8852cu_config" }, + +/* 8851B */ + { IC_INFO(RTL_ROM_LMP_8851B, 0xb, 0xc, HCI_USB), + .config_needed = false, + .has_rom_version = true, + .has_msft_ext = false, + .fw_name = "rtl_bt/rtl8851bu_fw.bin", + .cfg_name = "rtl_bt/rtl8851bu_config" }, }; static const struct id_table *btrtl_match_ic(u16 lmp_subver, u16 hci_rev,
@@ -359,6 +369,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev, { RTL_ROM_LMP_8852A, 18 }, /* 8852A */ { RTL_ROM_LMP_8852A, 20 }, /* 8852B */ { RTL_ROM_LMP_8852A, 25 }, /* 8852C */ + { RTL_ROM_LMP_8851B, 36 }, /* 8851B */ }; min_size =sizeof (struct rtl_epatch_header ) +sizeof (extension_sig) +3 ;
@@ -848,6 +859,7 @@ int btrtl_download_firmware(struct hci_dev *hdev,case RTL_ROM_LMP_8822B :case RTL_ROM_LMP_8852A :case RTL_ROM_LMP_8703B : +case RTL_ROM_LMP_8851B :return btrtl_setup_rtl8723b (hdev, btrtl_dev);default :rtl_dev_info (hdev,"assuming no firmware upload needed" );
@@ -872,6 +884,7 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)case CHIP_ID_8852A :case CHIP_ID_8852B :case CHIP_ID_8852C : +case CHIP_ID_8851B :set_bit (HCI_QUIRK_VALID_LE_STATES , &hdev->quirks);set_bit (HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED , &hdev->quirks);
@@ -1082,3 +1095,5 @@ MODULE_FIRMWARE("rtl_bt/rtl8852bu_fw.bin");MODULE_FIRMWARE ("rtl_bt/rtl8852bu_config.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8852cu_fw.bin" );MODULE_FIRMWARE ("rtl_bt/rtl8852cu_config.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8851bu_fw.bin" ); +MODULE_FIRMWARE ("rtl_bt/rtl8851bu_config.bin" );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 145/364 staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
In reply to Greg Kroah-HartmanFrom: Philipp Hortmann <[email protected]>
[ Upstream commit fda2093860df4812d69052a8cf4997e53853a340 ]
Replace macro RTL_PCI_DEVICE with PCI_DEVICE to get rid of rtl819xp_ops which is empty.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
@@ -48,9 +48,9 @@ static const struct rtl819x_ops rtl819xp_ops = { };static struct pci_device_id rtl8192_pci_id_tbl[] = { - {RTL_PCI_DEVICE (0x10ec ,0x8192 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0044 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0047 , rtl819xp_ops)}, + {PCI_DEVICE (0x10ec ,0x8192 )}, + {PCI_DEVICE (0x07aa ,0x0044 )}, + {PCI_DEVICE (0x07aa ,0x0047 )}, {} };
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -5
@@ -55,11 +55,6 @@#define IS_HARDWARE_TYPE_8192SE (_priv) \ (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE) -#define RTL_PCI_DEVICE (vend, dev, cfg) \ - .vendor = (vend), .device = (dev), \ - .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ - .driver_data = (kernel_ulong_t)&(cfg) -#define TOTAL_CAM_ENTRY 32#define CAM_CONTENT_COUNT 8
Signature · 1 line
2.39.2
Re: [PATCH 6.3 145/364] staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
Quoted 6 lines · Greg Kroah-Hartman
From: Philipp Hortmann <[email protected]>
[ Upstream commit
fda2093860df4812d69052a8cf4997e53853a340]Replace macro
RTL_PCI_DEVICEwithPCI_DEVICEto get rid ofrtl819xp_opswhich is empty.
It is not empty (except in 6.4).
This needs to be reverted from all stable branches.
Ben.
Quoted 42 lines
Signed-off-by Philipp Hortmann <[email protected]>Link https://lore.kernel.org/r/8b45ee783fa91196b7c9d6fc840a189496afd2f4.1677133271.git.philipp.g.hortmann@gmail.com open hereSigned-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-)drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3
-3@@ -48,9 +48,9 @@ static const struct rtl819x_ops rtl819xp_ops = { };static struct pci_device_id rtl8192_pci_id_tbl[] = { - {RTL_PCI_DEVICE (0x10ec ,0x8192 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0044 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0047 , rtl819xp_ops)}, + {PCI_DEVICE (0x10ec ,0x8192 )}, + {PCI_DEVICE (0x07aa ,0x0044 )}, + {PCI_DEVICE (0x07aa ,0x0047 )}, {} };drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0
-5@@ -55,11 +55,6 @@#define IS_HARDWARE_TYPE_8192SE (_priv) \ (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE) -#define RTL_PCI_DEVICE (vend, dev, cfg) \ - .vendor = (vend), .device = (dev), \ - .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ - .driver_data = (kernel_ulong_t)&(cfg) -#define TOTAL_CAM_ENTRY 32#define CAM_CONTENT_COUNT 8
Signature · 2 lines
Ben Hutchings When in doubt, use brute force. - Ken Thompson
Greg Kroah-Hartman
maintainerRe: [PATCH 6.3 145/364] staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
Quoted 11 lines · Ben Hutchings
Quoted 6 lines · Greg Kroah-Hartman
From: Philipp Hortmann <[email protected]>
[ Upstream commit
fda2093860df4812d69052a8cf4997e53853a340]Replace macro
RTL_PCI_DEVICEwithPCI_DEVICEto get rid ofrtl819xp_opswhich is empty.It is not empty (except in 6.4).
This needs to be reverted from all stable branches.
{sigh} You are right. I'll go revert it from everywhere, thanks for the review and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 146/364 HID: apple: Set the tilde quirk flag on the Geyser 4 and later
In reply to Greg Kroah-HartmanFrom: Alex Henrie <[email protected]>
[ Upstream commit c3388ddc74a863466c7c3fa24d3a9cea9c9bca53 ]
I recently tested several old MacBooks and as far as I can tell, all MacBooks that have an ISO keyboard have the tilde key quirk:
Product Model Year System CPU Shape Labels Country Quirky
============================================================================
05ac:021b A1181 2006 MacBook2,1 T5600 ISO British 13 Yes 05ac:021b A1181 2007 MacBook2,1 T7200 ISO Québécois 13 Yes 05ac:0229 A1181 2007 MacBook4,1 T8300 ANSI Usonian 33 No 05ac:022a A1181 2007 MacBook4,1 T8100 ISO English 13 Yes 05ac:022a A1181 2007 MacBook5,2 P7350 ISO Québécois 13 Yes 05ac:0237 A1278 2008 MacBook5,1 P7350 ISO Dutch 13 Yes 05ac:0237 A1278 2009 MacBook5,5 P7550 ISO British 13 Yes
The model number and year are from the laptop case. Since Apple printed the same model and year on many different laptops, the system name (as reported in the SMBIOS tables) and CPU form a more precise identifier.
--- drivers/hid/hid-apple.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/hid/hid-apple.c +9 -7
@@ -882,7 +882,8 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | APPLE_RDESC_JIS },
@@ -901,7 +902,8 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | APPLE_RDESC_JIS },
@@ -942,31 +944,31 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), - .driver_data = APPLE_HAS_FN }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), - .driver_data = APPLE_HAS_FN }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO), - .driver_data = APPLE_HAS_FN }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO), - .driver_data = APPLE_HAS_FN }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO), - .driver_data = APPLE_HAS_FN }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 147/364 iio: imu: st_lsm6dsx: discard samples during filters settling time
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
[ Upstream commit db3c490503bee4d0611f9fc17fcd8cfe6fcdbcad ]
During digital filters settling time the driver is expected to drop samples since they can be corrupted. Introduce the capability to drop a given number of samples according to the configured ODR. Add sample_to_discard for LSM6DSM-like sensors since new generation devices (e.g. LSM6DSO) support DRDY mask where corrupted samples are masked in hw with values greather than 0x7ffd so the driver can easily discard them.
I have not added sample_to_discard support for LSM6DS3 or LSM6DS3H since I do not have any sample for testing at the moment.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 11 ++++ .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 57 ++++++++++++++++--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 18 ++++++ 3 files changed, 78 insertions(+), 8 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +11 -0
@@ -137,6 +137,13 @@ struct st_lsm6dsx_odr_table_entry {int odr_len; }; +struct st_lsm6dsx_samples_to_discard { +struct { +u32 milli_hz; +u16 samples; + } val[ST_LSM6DSX_ODR_LIST_SIZE ]; +}; +struct st_lsm6dsx_fs {u32 gain;u8 val;
@@ -291,6 +298,7 @@ struct st_lsm6dsx_ext_dev_settings {* @irq_config: interrupts related registers. * @drdy_mask: register info for data-ready mask (addr + mask). * @odr_table: Hw sensors odr table (Hz + val). +* @samples_to_discard: Number of samples to discard for filters settling time. * @fs_table: Hw sensors gain table (gain + val). * @decimator: List of decimator register info (addr + mask). * @batch: List of FIFO batching register info (addr + mask).
@@ -323,6 +331,7 @@ struct st_lsm6dsx_settings { } irq_config;struct st_lsm6dsx_reg drdy_mask;struct st_lsm6dsx_odr_table_entry odr_table[2 ]; +struct st_lsm6dsx_samples_to_discard samples_to_discard[2 ];struct st_lsm6dsx_fs_table_entry fs_table[2 ];struct st_lsm6dsx_reg decimator[ST_LSM6DSX_MAX_ID ];struct st_lsm6dsx_reg batch[ST_LSM6DSX_MAX_ID ];
@@ -353,6 +362,7 @@ enum st_lsm6dsx_fifo_mode {* @hw: Pointer to instance of struct st_lsm6dsx_hw. * @gain: Configured sensor sensitivity. * @odr: Output data rate of the sensor [Hz]. +* @samples_to_discard: Number of samples to discard for filters settling time. * @watermark: Sensor watermark level. * @decimator: Sensor decimation factor. * @sip: Number of samples in a given pattern.
@@ -367,6 +377,7 @@ struct st_lsm6dsx_sensor {u32 gain;u32 odr; +u16 samples_to_discard;u16 watermark;u8 decimator;u8 sip;
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +49 -8
78 lines not on this page · raw message
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +18 -0
@@ -634,6 +634,24 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { .fs_len = 4, }, }, + .samples_to_discard = { + [ST_LSM6DSX_ID_ACC] = { + .val[0] = { 12500, 1 }, + .val[1] = { 26000, 1 }, + .val[2] = { 52000, 1 }, + .val[3] = { 104000, 2 }, + .val[4] = { 208000, 2 }, + .val[5] = { 416000, 2 }, + }, + [ST_LSM6DSX_ID_GYRO] = { + .val[0] = { 12500, 2 }, + .val[1] = { 26000, 5 }, + .val[2] = { 52000, 7 }, + .val[3] = { 104000, 12 }, + .val[4] = { 208000, 20 }, + .val[5] = { 416000, 36 }, + }, + }, .irq_config = { .irq1 = { .addr = 0x0d,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 148/364 staging: axis-fifo: initialize timeouts in init only
In reply to Greg Kroah-HartmanFrom: Khadija Kamran <[email protected]>
[ Upstream commit 752cbd8f191678e86aa754f795546b7f06b7f171 ]
Initialize the module parameters, read_timeout and write_timeout once in init().
Module parameters can only be set once and cannot be modified later, so we don't need to evaluate them again when passing the parameters to wait_event_interruptible_timeout().
Convert datatype of {read,write}_timeout from 'int' to 'long int' because implicit conversion of 'long int' to 'int' in statement '{read,write}_timeout = MAX_SCHEDULE_TIMEOUT' results in an overflow.
Change format specifier for {read,write}_timeout from %i to %li.
--- drivers/staging/axis-fifo/axis-fifo.c | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
drivers/staging/axis-fifo/axis-fifo.c +17 -11
@@ -103,17 +103,17 @@* globals * ---------------------------- */ -static int read_timeout =1000 ;/* ms to wait before read() times out */ -static int write_timeout =1000 ;/* ms to wait before write() times out */ +static long read_timeout =1000 ;/* ms to wait before read() times out */ +static long write_timeout =1000 ;/* ms to wait before write() times out */ /* ---------------------------- * module command-line arguments * ---------------------------- */ -module_param (read_timeout, int,0444 ); +module_param (read_timeout, long,0444 );MODULE_PARM_DESC (read_timeout,"ms to wait before blocking read() timing out; set to -1 for no timeout" ); -module_param (write_timeout, int,0444 ); +module_param (write_timeout, long,0444 );MODULE_PARM_DESC (write_timeout,"ms to wait before blocking write() timing out; set to -1 for no timeout" );/* ----------------------------
@@ -384,9 +384,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,mutex_lock (&fifo->read_lock); ret =wait_event_interruptible_timeout (fifo->read_queue,ioread32 (fifo->base_addr +XLLF_RDFO_OFFSET ), - (read_timeout >=0 ) ? -msecs_to_jiffies (read_timeout) : -MAX_SCHEDULE_TIMEOUT ); + read_timeout);if (ret <=0 ) {if (ret ==0 ) {
@@ -528,9 +526,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf, ret =wait_event_interruptible_timeout (fifo->write_queue,ioread32 (fifo->base_addr +XLLF_TDFV_OFFSET ) >= words_to_write, - (write_timeout >=0 ) ? -msecs_to_jiffies (write_timeout) : -MAX_SCHEDULE_TIMEOUT ); + write_timeout);if (ret <=0 ) {if (ret ==0 ) {
@@ -948,7 +944,17 @@ static struct platform_driver axis_fifo_driver = {static int __init axis_fifo_init (void ) { -pr_info ("axis-fifo driver loaded with parameters read_timeout = %i, write_timeout = %i\n" , +if (read_timeout >=0 ) + read_timeout =msecs_to_jiffies (read_timeout); +else + read_timeout =MAX_SCHEDULE_TIMEOUT ; + +if (write_timeout >=0 ) + write_timeout =msecs_to_jiffies (write_timeout); +else + write_timeout =MAX_SCHEDULE_TIMEOUT ; + +pr_info ("axis-fifo driver loaded with parameters read_timeout = %li, write_timeout = %li\n" , read_timeout, write_timeout);return platform_driver_register (&axis_fifo_driver); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 149/364 xhci: mem: Carefully calculate size for memory allocations
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 347284984f415e52590373253c6943bbdc806ebf ]
Carefully calculate size for memory allocations, i.e. with help of size_mul() macro from overflow.h.
--- drivers/usb/host/xhci-mem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/usb/host/xhci-mem.c +5 -4
@@ -9,6 +9,7 @@*/ #include <linux/usb.h> +#include <linux/overflow.h> #include <linux/pci.h> #include <linux/slab.h> #include <linux/dmapool.h>
@@ -568,7 +569,7 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, gfp_t mem_flags) {struct device *dev =xhci_to_hcd (xhci)->self.sysdev; -size_t size =sizeof (struct xhci_stream_ctx ) * num_stream_ctxs; +size_t size =size_mul (sizeof (struct xhci_stream_ctx ), num_stream_ctxs);if (size >MEDIUM_STREAM_ARRAY_SIZE ) return dma_alloc_coherent(dev, size,
@@ -1660,7 +1661,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) goto fail_sp; xhci->scratchpad->sp_array =dma_alloc_coherent (dev, - num_sp *sizeof (u64), +size_mul (sizeof (u64), num_sp), &xhci->scratchpad->sp_dma, flags);if (!xhci->scratchpad->sp_array) goto fail_sp2;
@@ -1799,7 +1800,7 @@ int xhci_alloc_erst(struct xhci_hcd *xhci,struct xhci_segment *seg;struct xhci_erst_entry *entry; - size =sizeof (struct xhci_erst_entry ) * evt_ring->num_segs; + size =size_mul (sizeof (struct xhci_erst_entry ), evt_ring->num_segs); erst->entries =dma_alloc_coherent (xhci_to_hcd (xhci)->self.sysdev, size, &erst->erst_dma_addr, flags);if (!erst->entries)
@@ -1830,7 +1831,7 @@ xhci_free_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir)if (!ir)return ; - erst_size =sizeof (struct xhci_erst_entry ) * (ir->erst.num_entries); + erst_size =sizeof (struct xhci_erst_entry ) * ir->erst.num_entries;if (ir->erst.entries) dma_free_coherent(dev, erst_size, ir->erst.entries,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 150/364 xhci: Avoid PCI MSI/MSIX interrupt reinitialization at resume
In reply to Greg Kroah-HartmanFrom: Josue David Hernandez Gutierrez <[email protected]>
[ Upstream commit 944e7deb4238d10cd16905474574236ac8a8e847 ]
xhci MSI setup is currently done at the same time as xHC host is started in xhci_run(). This couples the generic xhci code with PCI, and will reconfigure MSI/MSIX interrupts every time xHC is started.
Decouple MSI/MSIX configuration from generic xhci code by moving MSI/MSIX part to a PCI specific xhci_pci_run() function overriding xhci_run().
This allows us to remove unnecessay MSI/MSIX reconfiguration done every time PCI xhci resumes from suspend. i.e. remove the xhci_cleanup_msix() call from xhci_resume() and the xhci_try_enale_msi() call in xhci_run() called a bit later by xhci_resume()
[minor changes and commit message rewrite -Mathias]
--- drivers/usb/host/xhci-pci.c | 15 +++++++++++++++ drivers/usb/host/xhci.c | 8 ++------ drivers/usb/host/xhci.h | 1 + 3 files changed, 18 insertions(+), 6 deletions(-)
drivers/usb/host/xhci-pci.c +15 -0
@@ -78,14 +78,29 @@ static const char hcd_name[] = "xhci_hcd";static struct hc_driver __read_mostly xhci_pci_hc_driver;static int xhci_pci_setup (struct usb_hcd *hcd); +static int xhci_pci_run (struct usb_hcd *hcd);static int xhci_pci_update_hub_device (struct usb_hcd *hcd,struct usb_device *hdev,struct usb_tt *tt,gfp_t mem_flags);static const struct xhci_driver_overrides xhci_pci_overrides__initconst = { .reset = xhci_pci_setup, + .start = xhci_pci_run, .update_hub_device = xhci_pci_update_hub_device, }; +static int xhci_pci_run (struct usb_hcd *hcd) +{ +int ret; + +if (usb_hcd_is_primary_hcd (hcd)) { + ret =xhci_try_enable_msi (hcd); +if (ret) +return ret; + } + +return xhci_run (hcd); +} +/* called after powerup, by probe or system-pm "wakeup" */ static int xhci_pci_reinit (struct xhci_hcd *xhci,struct pci_dev *pdev) {
drivers/usb/host/xhci.c +2 -6
@@ -436,7 +436,7 @@ static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) } } -static int xhci_try_enable_msi (struct usb_hcd *hcd) +int xhci_try_enable_msi (struct usb_hcd *hcd) {struct xhci_hcd *xhci =hcd_to_xhci (hcd);struct pci_dev *pdev;
@@ -490,6 +490,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) hcd->irq = pdev->irq; return 0; } +EXPORT_SYMBOL_GPL (xhci_try_enable_msi);#else
@@ -705,10 +706,6 @@ int xhci_run(struct usb_hcd *hcd)xhci_dbg_trace (xhci, trace_xhci_dbg_init,"xhci_run" ); - ret =xhci_try_enable_msi (hcd); -if (ret) -return ret; - temp_64 =xhci_read_64 (xhci, &ir->ir_set->erst_dequeue); temp_64 &= ~ERST_PTR_MASK ; xhci_dbg_trace(xhci, trace_xhci_dbg_init,
@@ -1250,7 +1247,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)spin_unlock_irq (&xhci->lock);if (retval)return retval; -xhci_cleanup_msix (xhci);xhci_dbg (xhci,"// Disabling event ring interrupts\n" ); temp =readl (&xhci->op_regs->status);
drivers/usb/host/xhci.h +1 -0
@@ -2143,6 +2143,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated);irqreturn_t xhci_irq (struct usb_hcd *hcd);irqreturn_t xhci_msi_irq (int irq,void *hcd); +int xhci_try_enable_msi (struct usb_hcd *hcd);int xhci_alloc_dev (struct usb_hcd *hcd,struct usb_device *udev); int xhci_alloc_tt_info(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 151/364 spi: intel-pci: Add support for Meteor Lake-S SPI serial flash
In reply to Greg Kroah-HartmanFrom: Mika Westerberg <[email protected]>
[ Upstream commit c2912d42e86e494935722669e4d9eade69649072 ]
Intel Meteor Lake-S has the same SPI serial flash controller as Meteor Lake-P. Add Meteor Lake-S PCI ID to the driver list of supported devices.
--- drivers/spi/spi-intel-pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-intel-pci.c +1 -0
@@ -83,6 +83,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = { { PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info }, + { PCI_VDEVICE(INTEL, 0xae23), (unsigned long)&cnl_info }, { }, };MODULE_DEVICE_TABLE (pci, intel_spi_pci_ids);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 152/364 ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A42)
In reply to Greg Kroah-HartmanFrom: Prajna Sariputra <[email protected]>
[ Upstream commit ee4281de4d60288b9c802bb0906061ec355ecef2 ]
This model requires an additional detection quirk to enable the internal microphone.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -262,6 +262,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"HP" ), + DMI_MATCH(DMI_BOARD_NAME, "8A42"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 153/364 HID: logitech-hidpp: Dont use the USB serial for USB devices
In reply to Greg Kroah-HartmanFrom: Bastien Nocera <[email protected]>
[ Upstream commit 7ad1fe0da0fa91bf920b79ab05ae97bfabecc4f4 ]
For devices that support the 0x0003 feature (Device Information) version 4, set the serial based on the output of that feature, rather than relying on the usbhid code setting the USB serial.
This should allow the serial when connected through USB to (nearly) match the one when connected through a unifying receiver.
For example, on the serials on a G903 wired/wireless mouse:
- Unifying: 4067-e8-ce-cd-45
- USB before patch: 017C385C3837
- USB after patch: c086-e8-ce-cd-45
--- drivers/hid/hid-logitech-hidpp.c | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
drivers/hid/hid-logitech-hidpp.c +51 -0
@@ -947,6 +947,55 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)return 0 ; } +/* -------------------------------------------------------------------------- */ +/* 0x0003: Device Information */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_PAGE_DEVICE_INFORMATION 0x0003 + +#define CMD_GET_DEVICE_INFO 0x00 + +static int hidpp_get_serial (struct hidpp_device *hidpp,u32 *serial) +{ +struct hidpp_report response; +u8 feature_type; +u8 feature_index; +int ret; + + ret =hidpp_root_get_feature (hidpp,HIDPP_PAGE_DEVICE_INFORMATION , + &feature_index, + &feature_type); +if (ret) +return ret; + + ret =hidpp_send_fap_command_sync (hidpp, feature_index, +CMD_GET_DEVICE_INFO , +NULL ,0 , &response); +if (ret) +return ret; + +/* See hidpp_unifying_get_serial() */ + *serial = *((u32 *)&response.rap.params[1 ]); +return 0 ; +} + +static int hidpp_serial_init (struct hidpp_device *hidpp) +{ +struct hid_device *hdev = hidpp->hid_dev; +u32 serial; +int ret; + + ret =hidpp_get_serial (hidpp, &serial); +if (ret) +return ret; + +snprintf (hdev->uniq,sizeof (hdev->uniq),"%04x-%4phD" , + hdev->product, &serial); +dbg_hid ("HID++ DeviceInformation: Got serial: %s\n" , hdev->uniq); + +return 0 ; +} +/* -------------------------------------------------------------------------- */ /* 0x0005: GetDeviceNameType */ /* -------------------------------------------------------------------------- */
@@ -4210,6 +4259,8 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)if (hidpp->quirks &HIDPP_QUIRK_UNIFYING )hidpp_unifying_init (hidpp); +else if (hid_is_usb (hidpp->hid_dev)) +hidpp_serial_init (hidpp); connected =hidpp_root_get_protocol_version (hidpp) ==0 ;atomic_set (&hidpp->connected, connected);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 154/364 HID: logitech-hidpp: Reconcile USB and Unifying serials
In reply to Greg Kroah-HartmanFrom: Bastien Nocera <[email protected]>
[ Upstream commit 5b3691d15e04b6d5a32c915577b8dbc5cfb56382 ]
Now that USB HID++ devices can gather a serial number that matches the one that would be gathered when connected through a Unifying receiver, remove the last difference by dropping the product ID as devices usually have different product IDs when connected through USB or Unifying.
For example, on the serials on a G903 wired/wireless mouse:
- Unifying before patch: 4067-e8-ce-cd-45
- USB before patch: c086-e8-ce-cd-45
- Unifying and USB after patch: e8-ce-cd-45
--- drivers/hid/hid-logitech-hidpp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/hid/hid-logitech-hidpp.c +2 -4
@@ -853,8 +853,7 @@ static int hidpp_unifying_init(struct hidpp_device *hidpp)if (ret)return ret; -snprintf (hdev->uniq,sizeof (hdev->uniq),"%04x-%4phD" , - hdev->product, &serial); +snprintf (hdev->uniq,sizeof (hdev->uniq),"%4phD" , &serial);dbg_hid ("HID++ Unifying: Got serial: %s\n" , hdev->uniq); name =hidpp_unifying_get_name (hidpp);
@@ -989,8 +988,7 @@ static int hidpp_serial_init(struct hidpp_device *hidpp)if (ret)return ret; -snprintf (hdev->uniq,sizeof (hdev->uniq),"%04x-%4phD" , - hdev->product, &serial); +snprintf (hdev->uniq,sizeof (hdev->uniq),"%4phD" , &serial);dbg_hid ("HID++ DeviceInformation: Got serial: %s\n" , hdev->uniq);return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 155/364 spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3
In reply to Greg Kroah-HartmanFrom: Kevin Groeneveld <[email protected]>
[ Upstream commit 87c614175bbf28d3fd076dc2d166bac759e41427 ]
When using gpio based chip select the cs value can go outside the range 0 – 3. The various MX51_ECSPI_* macros did not take this into consideration resulting in possible corruption of the configuration.
For example for any cs value over 3 the SCLKPHA bits would not be set and other values in the register possibly corrupted.
One way to fix this is to just mask the cs bits to 2 bits. This still allows all 4 native chip selects to work as well as gpio chip selects (which can use any of the 4 chip select configurations).
--- drivers/spi/spi-imx.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/spi/spi-imx.c +18 -6
@@ -252,6 +252,18 @@ static bool spi_imx_can_dma(struct spi_controller *controller, struct spi_devicereturn true; } +/* +* Note the number of natively supported chip selects for MX51 is 4. Some +* devices may have less actual SS pins but the register map supports 4. When +* using gpio chip selects the cs values passed into the macros below can go +* outside the range 0 - 3. We therefore need to limit the cs value to avoid +* corrupting bits outside the allocated locations. +* +* The simplest way to do this is to just mask the cs bits to 2 bits. This +* still allows all 4 native chip selects to work as well as gpio chip selects +* (which can use any of the 4 chip select configurations). +*/ +#define MX51_ECSPI_CTRL 0x08#define MX51_ECSPI_CTRL_ENABLE (1 << 0)#define MX51_ECSPI_CTRL_XCH (1 << 2)
@@ -260,16 +272,16 @@ static bool spi_imx_can_dma(struct spi_controller *controller, struct spi_device#define MX51_ECSPI_CTRL_DRCTL (drctl) ((drctl) << 16)#define MX51_ECSPI_CTRL_POSTDIV_OFFSET 8#define MX51_ECSPI_CTRL_PREDIV_OFFSET 12 -#define MX51_ECSPI_CTRL_CS (cs) ((cs) << 18) +#define MX51_ECSPI_CTRL_CS (cs) ((cs & 3) << 18)#define MX51_ECSPI_CTRL_BL_OFFSET 20#define MX51_ECSPI_CTRL_BL_MASK (0xfff << 20)#define MX51_ECSPI_CONFIG 0x0c -#define MX51_ECSPI_CONFIG_SCLKPHA (cs) (1 << ((cs) + 0)) -#define MX51_ECSPI_CONFIG_SCLKPOL (cs) (1 << ((cs) + 4)) -#define MX51_ECSPI_CONFIG_SBBCTRL (cs) (1 << ((cs) + 8)) -#define MX51_ECSPI_CONFIG_SSBPOL (cs) (1 << ((cs) + 12)) -#define MX51_ECSPI_CONFIG_SCLKCTL (cs) (1 << ((cs) + 20)) +#define MX51_ECSPI_CONFIG_SCLKPHA (cs) (1 << ((cs & 3) + 0)) +#define MX51_ECSPI_CONFIG_SCLKPOL (cs) (1 << ((cs & 3) + 4)) +#define MX51_ECSPI_CONFIG_SBBCTRL (cs) (1 << ((cs & 3) + 8)) +#define MX51_ECSPI_CONFIG_SSBPOL (cs) (1 << ((cs & 3) + 12)) +#define MX51_ECSPI_CONFIG_SCLKCTL (cs) (1 << ((cs & 3) + 20))#define MX51_ECSPI_INT 0x10#define MX51_ECSPI_INT_TEEN (1 << 0)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 156/364 usb: typec: ucsi: acpi: add quirk for ASUS Zenbook UM325
In reply to Greg Kroah-HartmanFrom: Samuel Čavoj <[email protected]>
[ Upstream commit 326e1c208f3f24d14b93f910b8ae32c94923d22c ]
On some ACPI platforms (namely the ASUS Zenbook UM325) the _DSM method must not be called after a notification is received but instead the mailbox should be read immediately from RAM. This is because the ACPI interrupt handler destroys the CCI in ERAM after copying to system memory, and when _DSM is later called to perform a second copy, it retrieves a garbage value.
Instead, the _DSM(read) method should only be called when necessary, i.e. for polling the state after reset and for retrieving the version. Other reads should not call _DSM and only peek into the RAM region.
This adds a separate read operation for the Zenbook that syncs the ACPI mailbox only with polled commands.
--- drivers/usb/typec/ucsi/ucsi_acpi.c | 44 ++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-)
drivers/usb/typec/ucsi/ucsi_acpi.c +42 -2
@@ -9,6 +9,7 @@#include <linux/platform_device.h> #include <linux/module.h> #include <linux/acpi.h> +#include <linux/dmi.h> #include "ucsi.h"
@@ -23,6 +24,7 @@ struct ucsi_acpi {struct completion complete;unsigned long flags;guid_t guid; +u64 cmd; };static int ucsi_acpi_dsm (struct ucsi_acpi *ua,int func)
@@ -62,6 +64,7 @@ static int ucsi_acpi_async_write(struct ucsi *ucsi, unsigned int offset,struct ucsi_acpi *ua =ucsi_get_drvdata (ucsi);memcpy (ua->base + offset, val, val_len); + ua->cmd = *(u64 *)val;return ucsi_acpi_dsm (ua,UCSI_DSM_FUNC_WRITE ); }
@@ -93,13 +96,46 @@ static const struct ucsi_operations ucsi_acpi_ops = { .async_write = ucsi_acpi_async_write }; +static int +ucsi_zenbook_read (struct ucsi *ucsi,unsigned int offset,void *val,size_t val_len) +{ +struct ucsi_acpi *ua =ucsi_get_drvdata (ucsi); +int ret; + +if (offset ==UCSI_VERSION ||UCSI_COMMAND (ua->cmd) ==UCSI_PPM_RESET ) { + ret =ucsi_acpi_dsm (ua,UCSI_DSM_FUNC_READ ); +if (ret) +return ret; + } + +memcpy (val, ua->base + offset, val_len); + +return 0 ; +} + +static const struct ucsi_operations ucsi_zenbook_ops = { + .read = ucsi_zenbook_read, + .sync_write = ucsi_acpi_sync_write, + .async_write = ucsi_acpi_async_write +}; + +static const struct dmi_system_id zenbook_dmi_id[] = { + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"ZenBook UX325UA_UM325UA" ), + }, + }, + { } +}; +static void ucsi_acpi_notify (acpi_handle handle,u32 event,void *data) {struct ucsi_acpi *ua = data;u32 cci;int ret; - ret =ucsi_acpi_read (ua->ucsi,UCSI_CCI , &cci,sizeof (cci)); + ret = ua->ucsi->ops->read (ua->ucsi,UCSI_CCI , &cci,sizeof (cci));if (ret)return ;
@@ -114,6 +150,7 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data)static int ucsi_acpi_probe (struct platform_device *pdev) {struct acpi_device *adev =ACPI_COMPANION (&pdev->dev); +const struct ucsi_operations *ops = &ucsi_acpi_ops;struct ucsi_acpi *ua;struct resource *res;acpi_status status;
@@ -143,7 +180,10 @@ static int ucsi_acpi_probe(struct platform_device *pdev)init_completion (&ua->complete); ua->dev = &pdev->dev; - ua->ucsi =ucsi_create (&pdev->dev, &ucsi_acpi_ops); +if (dmi_check_system (zenbook_dmi_id)) + ops = &ucsi_zenbook_ops; + + ua->ucsi =ucsi_create (&pdev->dev, ops);if (IS_ERR (ua->ucsi))return PTR_ERR (ua->ucsi);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 157/364 ALSA: hda: LNL: add HD Audio PCI ID
In reply to Greg Kroah-HartmanFrom: Fred Oh <[email protected]>
[ Upstream commit 714b2f025d767e7df1fe9da18bd70537d64cc157 ]
Add HD Audio PCI ID for Intel Lunarlake platform.
--- sound/pci/hda/hda_intel.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/hda_intel.c +3 -0
@@ -2528,6 +2528,9 @@ static const struct pci_device_id azx_ids[] = {/* Meteorlake-P */ { PCI_DEVICE(0x8086, 0x7e28), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, + /* Lunarlake-P */ + { PCI_DEVICE(0x8086, 0xa828), + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, /* Broxton-P(Apollolake) */ { PCI_DEVICE(0x8086, 0x5a98), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 158/364 ASoC: amd: Add Dell G15 5525 to quirks list
In reply to Greg Kroah-HartmanFrom: Cem Kaya <[email protected]>
[ Upstream commit faf15233e59052f4d61cad2da6e56daf33124d96 ]
Add Dell G15 5525 Ryzen Edition to quirks list for acp6x so that internal mic works.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -45,6 +45,13 @@ static struct snd_soc_card acp6x_card = { };static const struct dmi_system_id yc_acp_quirk_table[] = { + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Dell G15 5525" ), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 159/364 ASoC: amd: yc: Add ThinkBook 14 G5+ ARP to quirks list for acp6x
In reply to Greg Kroah-HartmanFrom: Baishan Jiang <[email protected]>
[ Upstream commit a8f5da0bf4d85a6ad03810d902aba61c572102a6 ]
ThinkBook 14 G5+ ARP uses Ryzen 7735H processor, and has the same microphone problem as ThinkBook 14 G4+ ARA.
Adding 21HY to acp6x quirks table enables microphone for ThinkBook 14 G5+ ARP.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -185,6 +185,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 160/364 ASoC: amd: Add check for acp config flags
In reply to Greg Kroah-HartmanFrom: Syed Saba Kareem <[email protected]>
[ Upstream commit bddcfb0802eb69b0f51293eab5db33d344c0262f ]
We have SOF and generic ACP support enabled for Rembrandt and pheonix platforms on some machines. Since we have same PCI id used for probing, add check for machine configuration flag to avoid conflict with newer pci drivers. Such machine flag has been initialized via dmi match on few Chrome machines. If no flag is specified probe and register older platform device.
--- sound/soc/amd/Kconfig | 2 ++ sound/soc/amd/ps/acp63.h | 2 ++ sound/soc/amd/ps/pci-ps.c | 8 +++++++- sound/soc/amd/yc/acp6x.h | 3 +++ sound/soc/amd/yc/pci-acp6x.c | 8 +++++++- 5 files changed, 21 insertions(+), 2 deletions(-)
sound/soc/amd/Kconfig +2 -0
@@ -90,6 +90,7 @@ config SND_SOC_AMD_VANGOGH_MACH config SND_SOC_AMD_ACP6x tristate "AMD Audio Coprocessor-v6.x Yellow Carp support" + select SND_AMD_ACP_CONFIG depends on X86 && PCI help This option enables Audio Coprocessor i.e ACP v6.x support on
@@ -130,6 +131,7 @@ config SND_SOC_AMD_RPL_ACP6x config SND_SOC_AMD_PS tristate "AMD Audio Coprocessor-v6.3 Pink Sardine support" + select SND_AMD_ACP_CONFIG depends on X86 && PCI && ACPI help This option enables Audio Coprocessor i.e ACP v6.3 support on
sound/soc/amd/ps/acp63.h +2 -0
@@ -111,3 +111,5 @@ struct acp63_dev_data {u16 pdev_count;u16 pdm_dev_index; }; + +int snd_amd_acp_find_config (struct pci_dev *pci);
sound/soc/amd/ps/pci-ps.c +7 -1
@@ -247,11 +247,17 @@ static int snd_acp63_probe(struct pci_dev *pci, {struct acp63_dev_data *adata;u32 addr; -u32 irqflags; +u32 irqflags, flag;int val;int ret; irqflags =IRQF_SHARED ; + +/* Return if acp config flag is defined */ + flag =snd_amd_acp_find_config (pci); +if (flag) +return -ENODEV ; +/* Pink Sardine device check */ switch (pci->revision) {case 0x63 :
sound/soc/amd/yc/acp6x.h +3 -0
@@ -105,3 +105,6 @@ static inline void acp6x_writel(u32 val, void __iomem *base_addr) {writel (val, base_addr - ACP6x_PHY_BASE_ADDRESS); } + +int snd_amd_acp_find_config (struct pci_dev *pci); +
sound/soc/amd/yc/pci-acp6x.c +7 -1
@@ -149,10 +149,16 @@ static int snd_acp6x_probe(struct pci_dev *pci,int index =0 ;int val =0x00 ;u32 addr; -unsigned int irqflags; +unsigned int irqflags, flag;int ret; irqflags =IRQF_SHARED ; + +/* Return if acp config flag is defined */ + flag =snd_amd_acp_find_config (pci); +if (flag) +return -ENODEV ; +/* Yellow Carp device check */ switch (pci->revision) {case 0x60 :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 161/364 HID: apple: Set the tilde quirk flag on the Geyser 3
In reply to Greg Kroah-HartmanFrom: Alex Henrie <[email protected]>
[ Upstream commit 29e1ecc197d410ee59c8877098d54cf417075f7d ]
I was finally able to obtain a MacBook1,1 to test and I've now confirmed that it has the tilde key quirk as well:
Product Model Year System CPU Shape Labels Country Quirky
============================================================================
05ac:0218 A1181 2006 MacBook1,1 T2500 ISO British 13 Yes
--- drivers/hid/hid-apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-apple.c +2 -1
@@ -875,7 +875,8 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS), .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | APPLE_RDESC_JIS },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 162/364 HID: Ignore battery for ELAN touchscreen on ROG Flow X13 GV301RA
In reply to Greg Kroah-HartmanFrom: weiliang1503 <[email protected]>
[ Upstream commit 35903009dbde804a1565dc89e431c0f15179f054 ]
Ignore the reported battery level of the built-in touchscreen to suppress battery warnings when a stylus is used. The device ID was added and the battery ignore quirk was enabled.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-input.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -415,6 +415,7 @@#define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817#define I2C_DEVICE_ID_HP_SPECTRE_X360_13_AW0020NG 0x29DF#define I2C_DEVICE_ID_ASUS_TP420IA_TOUCHSCREEN 0x2BC8 +#define I2C_DEVICE_ID_ASUS_GV301RA_TOUCHSCREEN 0x2C82#define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706#define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A
drivers/hid/hid-input.c +2 -0
@@ -372,6 +372,8 @@ static const struct hid_device_id hid_battery_quirks[] = { HID_BATTERY_QUIRK_IGNORE }, {HID_I2C_DEVICE (USB_VENDOR_ID_ELAN ,I2C_DEVICE_ID_ASUS_TP420IA_TOUCHSCREEN ), HID_BATTERY_QUIRK_IGNORE }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_ASUS_GV301RA_TOUCHSCREEN), + HID_BATTERY_QUIRK_IGNORE }, { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN), HID_BATTERY_QUIRK_IGNORE }, { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 163/364 HID: wacom: generic: Set battery quirk only when we see battery data
In reply to Greg Kroah-HartmanFrom: Jason Gerecke <[email protected]>
[ Upstream commit bea407a427baa019758f29f4d31b26f008bb8cc6 ]
Some devices will include battery status usages in the HID descriptor but we won't see that battery data for one reason or another. For example, AES sensors won't send battery data unless an AES pen is in proximity. If a user does not have an AES pen but instead only interacts with the AES touchscreen with their fingers then there is no need for us to create a battery object. Similarly, if a family of peripherals shares the same HID descriptor between wired-only and wireless-capable SKUs, users of the former may never see a battery event and will not want a power_supply object created.
--- drivers/hid/wacom_wac.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-)
drivers/hid/wacom_wac.c +11 -22
@@ -1963,18 +1963,7 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage,static void wacom_wac_battery_usage_mapping (struct hid_device *hdev,struct hid_field *field,struct hid_usage *usage) { -struct wacom *wacom =hid_get_drvdata (hdev); -struct wacom_wac *wacom_wac = &wacom->wacom_wac; -struct wacom_features *features = &wacom_wac->features; -unsigned equivalent_usage =wacom_equivalent_usage (usage->hid); - -switch (equivalent_usage) { -case HID_DG_BATTERYSTRENGTH : -case WACOM_HID_WD_BATTERY_LEVEL : -case WACOM_HID_WD_BATTERY_CHARGING : - features->quirks |=WACOM_QUIRK_BATTERY ; -break ; - } +return ; } static void wacom_wac_battery_event(struct hid_device *hdev, struct hid_field *field,
@@ -1995,18 +1984,21 @@ static void wacom_wac_battery_event(struct hid_device *hdev, struct hid_field *f wacom_wac->hid_data.bat_connected =1 ; wacom_wac->hid_data.bat_status =WACOM_POWER_SUPPLY_STATUS_AUTO ; } + wacom_wac->features.quirks |=WACOM_QUIRK_BATTERY ;break ;case WACOM_HID_WD_BATTERY_LEVEL : value = value *100 / (field->logical_maximum - field->logical_minimum); wacom_wac->hid_data.battery_capacity = value; wacom_wac->hid_data.bat_connected =1 ; wacom_wac->hid_data.bat_status =WACOM_POWER_SUPPLY_STATUS_AUTO ; + wacom_wac->features.quirks |=WACOM_QUIRK_BATTERY ;break ;case WACOM_HID_WD_BATTERY_CHARGING : wacom_wac->hid_data.bat_charging = value; wacom_wac->hid_data.ps_connected = value; wacom_wac->hid_data.bat_connected =1 ; wacom_wac->hid_data.bat_status =WACOM_POWER_SUPPLY_STATUS_AUTO ; + wacom_wac->features.quirks |=WACOM_QUIRK_BATTERY ;break ; } }
@@ -2022,18 +2014,15 @@ static void wacom_wac_battery_report(struct hid_device *hdev, {struct wacom *wacom =hid_get_drvdata (hdev);struct wacom_wac *wacom_wac = &wacom->wacom_wac; -struct wacom_features *features = &wacom_wac->features; -if (features->quirks &WACOM_QUIRK_BATTERY ) { -int status = wacom_wac->hid_data.bat_status; -int capacity = wacom_wac->hid_data.battery_capacity; -bool charging = wacom_wac->hid_data.bat_charging; -bool connected = wacom_wac->hid_data.bat_connected; -bool powered = wacom_wac->hid_data.ps_connected; +int status = wacom_wac->hid_data.bat_status; +int capacity = wacom_wac->hid_data.battery_capacity; +bool charging = wacom_wac->hid_data.bat_charging; +bool connected = wacom_wac->hid_data.bat_connected; +bool powered = wacom_wac->hid_data.ps_connected; -wacom_notify_battery (wacom_wac, status, capacity, charging, - connected, powered); - } +wacom_notify_battery (wacom_wac, status, capacity, charging, + connected, powered); } static void wacom_wac_pad_usage_mapping(struct hid_device *hdev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 164/364 usb: typec: tcpm: fix multiple times discover svids error
In reply to Greg Kroah-HartmanFrom: Frank Wang <[email protected]>
[ Upstream commit dac3b192107b978198e89ec0f77375738352e0c8 ]
PD3.0 Spec 6.4.4.3.2 say that only Responder supports 12 or more SVIDs, the Discover SVIDs Command Shall be executed multiple times until a Discover SVIDs VDO is returned ending either with a SVID value of 0x0000 in the last part of the last VDO or with a VDO containing two SVIDs with values of 0x0000.
In the current implementation, if the last VDO does not find that the Discover SVIDs Command would be executed multiple times even if the Responder SVIDs are less than 12, and we found some odd dockers just meet this case. So fix it.
--- drivers/usb/typec/tcpm/tcpm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +15 -1
@@ -1523,7 +1523,21 @@ static bool svdm_consume_svids(struct tcpm_port *port, const u32 *p, int cnt) pmdata->svids[pmdata->nsvids++] = svid;tcpm_log (port,"SVID %d: 0x%x" , pmdata->nsvids, svid); } -return true; + +/* +* PD3.0 Spec 6.4.4.3.2: The SVIDs are returned 2 per VDO (see Table +* 6-43), and can be returned maximum 6 VDOs per response (see Figure +* 6-19). If the Respondersupports 12 or more SVID then the Discover +* SVIDs Command Shall be executed multiple times until a Discover +* SVIDs VDO is returned ending either with a SVID value of 0x0000 in +* the last part of the last VDO or with a VDO containing two SVIDs +* with values of 0x0000. +* +* However, some odd dockers support SVIDs less than 12 but without +* 0x0000 in the last VDO, so we need to break the Discover SVIDs +* request and return false here. +*/ +return cnt ==7 ; abort:tcpm_log (port,"SVID_DISCOVERY_MAX(%d) too low!" ,SVID_DISCOVERY_MAX );return false;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 165/364 serial: 8250: Reinit port->pm on port specific driver unbind
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 04e82793f068d2f0ffe62fcea03d007a8cdc16a7 ]
When we unbind a serial port hardware specific 8250 driver, the generic serial8250 driver takes over the port. After that we see an oops about 10 seconds later. This can produce the following at least on some TI SoCs:
Unhandled fault: imprecise external abort (0x1406)
Internal error: : 1406 [#1] SMP ARM
Turns out that we may still have the serial port hardware specific driver port->pm in use, and serial8250_pm() tries to call it after the port specific driver is gone:
serial8250_pm [8250_base] from uart_change_pm+0x54/0x8c [serial_base] uart_change_pm [serial_base] from uart_hangup+0x154/0x198 [serial_base] uart_hangup [serial_base] from __tty_hangup.part.0+0x328/0x37c __tty_hangup.part.0 from disassociate_ctty+0x154/0x20c disassociate_ctty from do_exit+0x744/0xaacdo_exit from do_group_exit+0x40/0x8cdo_group_exit from __wake_up_parent+0x0/0x1c
Let's fix the issue by calling serial8250_set_defaults() in serial8250_unregister_port(). This will set the port back to using the serial8250 default functions, and sets the port->pm to point to serial8250_pm.
--- drivers/tty/serial/8250/8250_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/8250_core.c +1 -0
@@ -1158,6 +1158,7 @@ void serial8250_unregister_port(int line) uart->port.type =PORT_UNKNOWN ; uart->port.dev = &serial8250_isa_devs->dev; uart->capabilities =0 ; +serial8250_init_port (uart);serial8250_apply_quirks (uart);uart_add_one_port (&serial8250_reg, &uart->port); }else {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 166/364 mcb-pci: Reallocate memory region to avoid memory overlapping
In reply to Greg Kroah-HartmanFrom: Rodríguez Barbarin, José Javier <[email protected]>
[ Upstream commit 9be24faadd085c284890c3afcec7a0184642315a ]
mcb-pci requests a fixed-size memory region to parse the chameleon table, however, if the chameleon table is smaller that the allocated region, it could overlap with the IP Cores' memory regions.
After parsing the chameleon table, drop/reallocate the memory region with the actual chameleon table size.
--- drivers/mcb/mcb-pci.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
drivers/mcb/mcb-pci.c +25 -2
@@ -31,7 +31,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) {struct resource *res;struct priv *priv; -int ret; +int ret, table_size;unsigned long flags; priv =devm_kzalloc (&pdev->dev,sizeof (struct priv ),GFP_KERNEL );
@@ -90,7 +90,30 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (ret <0 ) goto out_mcb_bus; -dev_dbg (&pdev->dev,"Found %d cells\n" , ret); + table_size = ret; + +if (table_size <CHAM_HEADER_SIZE ) { +/* Release the previous resources */ +devm_iounmap (&pdev->dev, priv->base); +devm_release_mem_region (&pdev->dev, priv->mapbase,CHAM_HEADER_SIZE ); + +/* Then, allocate it again with the actual chameleon table size */ + res =devm_request_mem_region (&pdev->dev, priv->mapbase, + table_size, +KBUILD_MODNAME ); +if (!res) { +dev_err (&pdev->dev,"Failed to request PCI memory\n" ); + ret = -EBUSY ; + goto out_mcb_bus; + } + + priv->base =devm_ioremap (&pdev->dev, priv->mapbase, table_size); +if (!priv->base) { +dev_err (&pdev->dev,"Cannot ioremap\n" ); + ret = -ENOMEM ; + goto out_mcb_bus; + } + }mcb_bus_add_devices (priv->bus);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 167/364 powerpc: Use of_property_present() for testing DT property presence
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
[ Upstream commit 857d423c74228cfa064f79ff3a16b163fdb8d542 ]
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.
--- arch/powerpc/kernel/legacy_serial.c | 8 ++++---- arch/powerpc/platforms/44x/iss4xx.c | 2 +- arch/powerpc/platforms/44x/ppc476.c | 2 +- arch/powerpc/platforms/cell/spu_manage.c | 2 +- arch/powerpc/platforms/powermac/pic.c | 3 +-- arch/powerpc/platforms/powernv/opal-lpc.c | 2 +- arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 2 +- arch/powerpc/sysdev/mpic_msgr.c | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-)
arch/powerpc/kernel/legacy_serial.c +4 -4
@@ -171,11 +171,11 @@ static int __init add_legacy_soc_port(struct device_node *np,/* We only support ports that have a clock frequency properly * encoded in the device-tree. */ -if (of_get_property (np,"clock-frequency" ,NULL ) ==NULL ) +if (!of_property_present (np,"clock-frequency" ))return -1 ;/* if reg-offset don't try to use it */ -if ((of_get_property (np,"reg-offset" ,NULL ) !=NULL )) +if (of_property_present (np,"reg-offset" ))return -1 ;/* if rtas uses this device, don't try to use it as well */
@@ -237,7 +237,7 @@ static int __init add_legacy_isa_port(struct device_node *np,* Note: Don't even try on P8 lpc, we know it's not directly mapped */ if (!of_device_is_compatible (isa_brg,"ibm,power8-lpc" ) || -of_get_property (isa_brg,"ranges" ,NULL )) { +of_property_present (isa_brg,"ranges" )) { taddr =of_translate_address (np, reg);if (taddr ==OF_BAD_ADDR ) taddr =0 ;
@@ -268,7 +268,7 @@ static int __init add_legacy_pci_port(struct device_node *np,* compatible UARTs on PCI need all sort of quirks (port offsets * etc...) that this code doesn't know about */ -if (of_get_property (np,"clock-frequency" ,NULL ) ==NULL ) +if (!of_property_present (np,"clock-frequency" ))return -1 ;/* Get the PCI address. Assume BAR 0 */
arch/powerpc/platforms/44x/iss4xx.c +1 -1
@@ -52,7 +52,7 @@ static void __init iss4xx_init_irq(void)/* Find top level interrupt controller */ for_each_node_with_property (np,"interrupt-controller" ) { -if (of_get_property (np,"interrupts" ,NULL ) ==NULL ) +if (!of_property_present (np,"interrupts" ))break ; }if (np ==NULL )
arch/powerpc/platforms/44x/ppc476.c +1 -1
@@ -122,7 +122,7 @@ static void __init ppc47x_init_irq(void)/* Find top level interrupt controller */ for_each_node_with_property (np,"interrupt-controller" ) { -if (of_get_property (np,"interrupts" ,NULL ) ==NULL ) +if (!of_property_present (np,"interrupts" ))break ; }if (np ==NULL )
arch/powerpc/platforms/cell/spu_manage.c +1 -1
@@ -402,7 +402,7 @@ static int __init of_has_vicinity(void)struct device_node *dn;for_each_node_by_type (dn,"spe" ) { -if (of_find_property (dn,"vicinity" ,NULL )) { +if (of_property_present (dn,"vicinity" )) {of_node_put (dn);return 1 ; }
arch/powerpc/platforms/powermac/pic.c +1 -2
@@ -475,8 +475,7 @@ static int __init pmac_pic_probe_mpic(void)/* We can have up to 2 MPICs cascaded */ for_each_node_by_type (np,"open-pic" ) { -if (master ==NULL && -of_get_property (np,"interrupts" ,NULL ) ==NULL ) +if (master ==NULL && !of_property_present (np,"interrupts" )) master =of_node_get (np);else if (slave ==NULL ) slave =of_node_get (np);
arch/powerpc/platforms/powernv/opal-lpc.c +1 -1
@@ -403,7 +403,7 @@ void __init opal_lpc_init(void)return ;/* Does it support direct mapping ? */ -if (of_get_property (np,"ranges" ,NULL )) { +if (of_property_present (np,"ranges" )) {pr_info ("OPAL: Found memory mapped LPC bus on chip %d\n" , opal_lpc_chip_id);isa_bridge_init_non_pci (np);
arch/powerpc/platforms/pseries/hotplug-cpu.c +1 -1
@@ -493,7 +493,7 @@ static bool valid_cpu_drc_index(struct device_node *parent, u32 drc_index)bool found = false;int rc, index; -if (of_find_property (parent,"ibm,drc-info" ,NULL )) +if (of_property_present (parent,"ibm,drc-info" ))return drc_info_valid_index (parent, drc_index);/* Note that the format of the ibm,drc-indexes array is
arch/powerpc/platforms/pseries/vio.c +1 -1
@@ -1440,7 +1440,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) viodev->dev.bus = &vio_bus_type; viodev->dev.release = vio_dev_release; -if (of_get_property (viodev->dev.of_node,"ibm,my-dma-window" ,NULL )) { +if (of_property_present (viodev->dev.of_node,"ibm,my-dma-window" )) {if (firmware_has_feature (FW_FEATURE_CMO ))vio_cmo_set_dma_ops (viodev);else
arch/powerpc/sysdev/mpic_msgr.c +1 -1
@@ -116,7 +116,7 @@ static unsigned int mpic_msgr_number_of_blocks(void)for (;;) {snprintf (buf,sizeof (buf),"mpic-msgr-block%d" , count); -if (!of_find_property (aliases, buf,NULL )) +if (!of_property_present (aliases, buf))break ; count +=1 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 168/364 sched: Fix KCSAN noinstr violation
In reply to Greg Kroah-HartmanFrom: Josh Poimboeuf <[email protected]>
[ Upstream commit e0b081d17a9f4e5c0cbb0e5fbeb1abe3de0f7e4e ]
With KCSAN enabled, end_of_stack() can get out-of-lined. Force it inline.
Fixes the following warnings:
vmlinux.o: warning: objtool: check_stackleak_irqoff+0x2b: call to end_of_stack() leaves .noinstr.text section
--- include/linux/sched/task_stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/task_stack.h +1 -1
@@ -23,7 +23,7 @@ static __always_inline void *task_stack_page(const struct task_struct *task)#define setup_thread_stack (new,old) do { } while(0) -static inline unsigned long *end_of_stack (const struct task_struct *task) +static __always_inline unsigned long *end_of_stack (const struct task_struct *task) {#ifdef CONFIG_STACK_GROWSUP return (unsigned long *)((unsigned long )task->stack +THREAD_SIZE ) -1 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 169/364 lkdtm/stackleak: Fix noinstr violation
In reply to Greg Kroah-HartmanFrom: Josh Poimboeuf <[email protected]>
[ Upstream commit f571da059f86fd9d432aea32c9c7e5aaa53245d8 ]
Fixes the following warning:
vmlinux.o: warning: objtool: check_stackleak_irqoff+0x2b6: call to _printk() leaves .noinstr.text section
--- drivers/misc/lkdtm/stackleak.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/misc/lkdtm/stackleak.c +6 -0
@@ -43,12 +43,14 @@ static void noinstr check_stackleak_irqoff(void)* STACK_END_MAGIC, and in either casee something is seriously wrong. */ if (current_sp < task_stack_low || current_sp >= task_stack_high) { +instrumentation_begin ();pr_err ("FAIL: current_stack_pointer (0x%lx) outside of task stack bounds [0x%lx..0x%lx]\n" , current_sp, task_stack_low, task_stack_high -1 ); test_failed = true; goto out; }if (lowest_sp < task_stack_low || lowest_sp >= task_stack_high) { +instrumentation_begin ();pr_err ("FAIL: current->lowest_stack (0x%lx) outside of task stack bounds [0x%lx..0x%lx]\n" , lowest_sp, task_stack_low, task_stack_high -1 ); test_failed = true;
@@ -86,11 +88,14 @@ static void noinstr check_stackleak_irqoff(void)if (*(unsigned long *)poison_low ==STACKLEAK_POISON )continue ; +instrumentation_begin ();pr_err ("FAIL: non-poison value %lu bytes below poison boundary: 0x%lx\n" , poison_high - poison_low, *(unsigned long *)poison_low); test_failed = true; + goto out; } +instrumentation_begin ();pr_info ("stackleak stack usage:\n" " high offset: %lu bytes\n" " current: %lu bytes\n"
@@ -113,6 +118,7 @@ static void noinstr check_stackleak_irqoff(void) }else {pr_info ("OK: the rest of the thread stack is properly erased\n" ); } +instrumentation_end (); }static void lkdtm_STACKLEAK_ERASING (void )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 170/364 riscv: Fix EFI stub usage of KASAN instrumented strcmp function
In reply to Greg Kroah-HartmanFrom: Alexandre Ghiti <[email protected]>
[ Upstream commit 617955ca6e275c4dd0dcf5316fca7fc04a8f2fe6 ]
The EFI stub must not use any KASAN instrumented code as the kernel proper did not initialize the thread pointer and the mapping for the KASAN shadow region.
Avoid using the generic strcmp function, instead use the one in drivers/firmware/efi/libstub/string.c.
--- arch/riscv/kernel/image-vars.h | 2 -- 1 file changed, 2 deletions(-)
arch/riscv/kernel/image-vars.h +0 -2
@@ -23,8 +23,6 @@* linked at. The routines below are all implemented in assembler in a * position independent manner */ -__efistub_strcmp = strcmp; - __efistub__start = _start; __efistub__start_kernel = _start_kernel; __efistub__end = _end;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 171/364 recordmcount: Fix memory leaks in the uwrite function
In reply to Greg Kroah-HartmanFrom: Hao Zeng <[email protected]>
[ Upstream commit fa359d068574d29e7d2f0fdd0ebe4c6a12b5cfb9 ]
Common realloc mistake: 'file_append' nulled but not freed upon failure
--- scripts/recordmcount.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/recordmcount.c +5 -1
@@ -110,6 +110,7 @@ static ssize_t uwrite(void const *const buf, size_t const count) {size_t cnt = count;off_t idx =0 ; +void *p =NULL ; file_updated =1 ;
@@ -117,7 +118,10 @@ static ssize_t uwrite(void const *const buf, size_t const count)off_t aoffset = (file_ptr + count) - file_end;if (aoffset > file_append_size) { - file_append =realloc (file_append, aoffset); + p =realloc (file_append, aoffset); +if (!p) +free (file_append); + file_append = p; file_append_size = aoffset; }if (!file_append) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 172/364 RDMA/core: Fix multiple -Warray-bounds warnings
In reply to Greg Kroah-HartmanFrom: Gustavo A. R. Silva <[email protected]>
[ Upstream commit aa4d540b4150052ae3b36d286b9c833a961ce291 ]
GCC-13 (and Clang)[1] does not like to access a partially allocated object, since it cannot reason about it for bounds checking.
In this case 140 bytes are allocated for an object of type struct ib_umad_packet:
packet = kzalloc(sizeof(*packet) + IB_MGMT_RMPP_HDR, GFP_KERNEL);
However, notice that sizeof(*packet) is only 104 bytes:
struct ib_umad_packet {
struct ib_mad_send_buf * msg; /* 0 8 */
struct ib_mad_recv_wc * recv_wc; /* 8 8 */
struct list_head list; /* 16 16 */
int length; /* 32 4 */
/* XXX 4 bytes hole, try to pack */
struct ib_user_mad mad __attribute__((__aligned__(8))); /* 40 64 */
/* size: 104, cachelines: 2, members: 5 */
/* sum members: 100, holes: 1, sum holes: 4 */
/* forced alignments: 1, forced holes: 1, sum forced holes: 4 */
/* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));and 36 bytes extra bytes are allocated for a flexible-array member in struct ib_user_mad:
include/rdma/ib_mad.h:
120 enum {
...
123 IB_MGMT_RMPP_HDR = 36,
... }
struct ib_user_mad {
struct ib_user_mad_hdr hdr; /* 0 64 */
/* --- cacheline 1 boundary (64 bytes) --- */
__u64 data[] __attribute__((__aligned__(8))); /* 64 0 */
/* size: 64, cachelines: 1, members: 2 */
/* forced alignments: 1 */
} __attribute__((__aligned__(8)));So we have sizeof(*packet) + IB_MGMT_RMPP_HDR == 140 bytes
Then the address of the flex-array member (for which only 36 bytes were allocated) is casted and copied into a pointer to struct ib_rmpp_mad, which, in turn, is of size 256 bytes:
rmpp_mad = (struct ib_rmpp_mad *) packet->mad.data;
struct ib_rmpp_mad {
struct ib_mad_hdr mad_hdr; /* 0 24 */
struct ib_rmpp_hdr rmpp_hdr; /* 24 12 */
u8 data[220]; /* 36 220 *//* size: 256, cachelines: 4, members: 3 */ };
The thing is that those 36 bytes allocated for flex-array member data in struct ib_user_mad onlly account for the size of both struct ib_mad_hdr and struct ib_rmpp_hdr, but nothing is left for array u8 data[220]. So, the compiler is legitimately complaining about accessing an object for which not enough memory was allocated.
Apparently, the only members of struct ib_rmpp_mad that are relevant (that are actually being used) in function ib_umad_write() are mad_hdr and rmpp_hdr. So, instead of casting packet->mad.data to (struct ib_rmpp_mad *) create a new structure
struct ib_rmpp_mad_hdr {
struct ib_mad_hdr mad_hdr;
struct ib_rmpp_hdr rmpp_hdr;
} __packed;and cast packet->mad.data to (struct ib_rmpp_mad_hdr *).
Notice that
IB_MGMT_RMPP_HDR == sizeof(struct ib_rmpp_mad_hdr) == 36 bytes
Refactor the rest of the code, accordingly.
Fix the following warnings seen under GCC-13 and -Warray-bounds:drivers/infiniband/core/user_mad.c:564:50: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=] drivers/infiniband/core/user_mad.c:566:42: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=] drivers/infiniband/core/user_mad.c:618:25: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=] drivers/infiniband/core/user_mad.c:622:44: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=]
--- drivers/infiniband/core/user_mad.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/infiniband/core/user_mad.c +14 -9
@@ -131,6 +131,11 @@ struct ib_umad_packet {struct ib_user_mad mad; }; +struct ib_rmpp_mad_hdr { +struct ib_mad_hdr mad_hdr; +struct ib_rmpp_hdr rmpp_hdr; +} __packed; +#define CREATE_TRACE_POINTS #include <trace/events/ib_umad.h>
@@ -494,11 +499,11 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, size_t count, loff_t *pos) { struct ib_umad_file *file = filp->private_data; +struct ib_rmpp_mad_hdr *rmpp_mad_hdr;struct ib_umad_packet *packet;struct ib_mad_agent *agent;struct rdma_ah_attr ah_attr;struct ib_ah *ah; -struct ib_rmpp_mad *rmpp_mad;__be64 *tid;int ret, data_len, hdr_len, copy_offset, rmpp_active;u8 base_version;
@@ -506,7 +511,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,if (count <hdr_size (file) +IB_MGMT_RMPP_HDR )return -EINVAL ; - packet =kzalloc (sizeof *packet +IB_MGMT_RMPP_HDR ,GFP_KERNEL ); + packet =kzalloc (sizeof (*packet) +IB_MGMT_RMPP_HDR ,GFP_KERNEL );if (!packet)return -ENOMEM ;
@@ -560,13 +565,13 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, goto err_up; } - rmpp_mad = (struct ib_rmpp_mad *) packet->mad.data; - hdr_len =ib_get_mad_data_offset (rmpp_mad->mad_hdr.mgmt_class); + rmpp_mad_hdr = (struct ib_rmpp_mad_hdr *)packet->mad.data; + hdr_len =ib_get_mad_data_offset (rmpp_mad_hdr->mad_hdr.mgmt_class); -if (ib_is_mad_class_rmpp (rmpp_mad->mad_hdr.mgmt_class) +if (ib_is_mad_class_rmpp (rmpp_mad_hdr->mad_hdr.mgmt_class) &&ib_mad_kernel_rmpp_agent (agent)) { copy_offset =IB_MGMT_RMPP_HDR ; - rmpp_active =ib_get_rmpp_flags (&rmpp_mad->rmpp_hdr) & + rmpp_active =ib_get_rmpp_flags (&rmpp_mad_hdr->rmpp_hdr) &IB_MGMT_RMPP_FLAG_ACTIVE ; }else { copy_offset =IB_MGMT_MAD_HDR ;
@@ -615,12 +620,12 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid; *tid =cpu_to_be64 (((u64 ) agent->hi_tid) <<32 | (be64_to_cpup (tid) &0xffffffff )); - rmpp_mad->mad_hdr.tid = *tid; + rmpp_mad_hdr->mad_hdr.tid = *tid; }if (!ib_mad_kernel_rmpp_agent (agent) - &&ib_is_mad_class_rmpp (rmpp_mad->mad_hdr.mgmt_class) - && (ib_get_rmpp_flags (&rmpp_mad->rmpp_hdr) &IB_MGMT_RMPP_FLAG_ACTIVE )) { + &&ib_is_mad_class_rmpp (rmpp_mad_hdr->mad_hdr.mgmt_class) + && (ib_get_rmpp_flags (&rmpp_mad_hdr->rmpp_hdr) &IB_MGMT_RMPP_FLAG_ACTIVE )) {spin_lock_irq (&file->send_lock);list_add_tail (&packet->list, &file->send_list);spin_unlock_irq (&file->send_lock);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 173/364 KVM: selftests: Add malloc failure check in vcpu_save_state
In reply to Greg Kroah-HartmanFrom: Ivan Orlov <[email protected]>
[ Upstream commit 735b0e0f2d001b7ed9486db84453fb860e764a4d ]
There is a 'malloc' call in vcpu_save_state function, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons.
--- tools/testing/selftests/kvm/lib/x86_64/processor.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/kvm/lib/x86_64/processor.c +1 -0
@@ -954,6 +954,7 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vcpu *vcpu)vcpu_run_complete_io (vcpu); state =malloc (sizeof (*state) + msr_list->nmsrs *sizeof (state->msrs.entries[0 ])); +TEST_ASSERT (state,"-ENOMEM when allocating kvm state" );vcpu_events_get (vcpu, &state->events);vcpu_mp_state_get (vcpu, &state->mp_state);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 174/364 iommu/arm-smmu-qcom: Limit the SMR groups to 128
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 12261134732689b7e30c59db9978f81230965181 ]
Some platforms support more than 128 stream matching groups than what is defined by the ARM SMMU architecture specification. But due to some unknown reasons, those additional groups don't exhibit the same behavior as the architecture supported ones.
For instance, the additional groups will not detect the quirky behavior of some firmware versions intercepting writes to S2CR register, thus skipping the quirk implemented in the driver and causing boot crash.
So let's limit the groups to 128 for now until the issue with those groups are fixed and issue a notice to users in that case.
--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +15 -1
@@ -268,12 +268,26 @@ static int qcom_smmu_init_context(struct arm_smmu_domain *smmu_domain,static int qcom_smmu_cfg_probe (struct arm_smmu_device *smmu) { -unsigned int last_s2cr =ARM_SMMU_GR0_S2CR (smmu->num_mapping_groups -1 );struct qcom_smmu *qsmmu =to_qcom_smmu (smmu); +unsigned int last_s2cr;u32 reg;u32 smr;int i; +/* +* Some platforms support more than the Arm SMMU architected maximum of +* 128 stream matching groups. For unknown reasons, the additional +* groups don't exhibit the same behavior as the architected registers, +* so limit the groups to 128 until the behavior is fixed for the other +* groups. +*/ +if (smmu->num_mapping_groups >128 ) { +dev_notice (smmu->dev,"\tLimiting the stream matching groups to 128\n" ); + smmu->num_mapping_groups =128 ; + } + + last_s2cr =ARM_SMMU_GR0_S2CR (smmu->num_mapping_groups -1 ); +/* * With some firmware versions writes to S2CR of type FAULT are * ignored, and writing BYPASS will end up written as FAULT in the
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 175/364 fs/ntfs3: Fix NULL pointer dereference in ni_write_inode
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
[ Upstream commit db2a3cc6a3481076da6344cc62a80a4e2525f36f ]
Syzbot found the following issue:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000016
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000010af56000
[0000000000000016] pgd=08000001090da003, p4d=08000001090da003, pud=08000001090ce003, pmd=0000000000000000
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 3036 Comm: syz-executor206 Not tainted 6.0.0-rc6-syzkaller-17739-g16c9f284e746 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : is_rec_inuse fs/ntfs3/ntfs.h:313 [inline] pc : ni_write_inode+0xac/0x798 fs/ntfs3/frecord.c:3232 lr : ni_write_inode+0xa0/0x798 fs/ntfs3/frecord.c:3226
sp : ffff8000126c3800
x29: ffff8000126c3860 x28: 0000000000000000 x27: ffff0000c8b02000
x26: ffff0000c7502320 x25: ffff0000c7502288 x24: 0000000000000000
x23: ffff80000cbec91c x22: ffff0000c8b03000 x21: ffff0000c8b02000
x20: 0000000000000001 x19: ffff0000c75024d8 x18: 00000000000000c0
x17: ffff80000dd1b198 x16: ffff80000db59158 x15: ffff0000c4b6b500
x14: 00000000000000b8 x13: 0000000000000000 x12: ffff0000c4b6b500
x11: ff80800008be1b60 x10: 0000000000000000 x9 : ffff0000c4b6b500 x8 : 0000000000000000 x7 : ffff800008be1b50 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000008 x1 : 0000000000000001 x0 : 0000000000000000
Call trace: is_rec_inuse fs/ntfs3/ntfs.h:313 [inline] ni_write_inode+0xac/0x798 fs/ntfs3/frecord.c:3232 ntfs_evict_inode+0x54/0x84 fs/ntfs3/inode.c:1744 evict+0xec/0x334 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput+0x2c4/0x324 fs/inode.c:1774 ntfs_new_inode+0x7c/0xe0 fs/ntfs3/fsntfs.c:1660 ntfs_create_inode+0x20c/0xe78 fs/ntfs3/inode.c:1278 ntfs_create+0x54/0x74 fs/ntfs3/namei.c:100 lookup_open fs/namei.c:3413 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x804/0x11c4 fs/namei.c:3688 do_filp_open+0xdc/0x1b8 fs/namei.c:3718 do_sys_openat2+0xb8/0x22c fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __arm64_sys_openat+0xb0/0xe0 fs/open.c:1338 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 Code: 97dafee4 340001b4 f9401328 2a1f03e0 (79402d14) ---[ end trace 0000000000000000 ]---
Above issue may happens as follows:ntfs_new_inode
mi_init
mi->mrec = kmalloc(sbi->record_size, GFP_NOFS); -->failed to allocate memory
if (!mi->mrec)
return -ENOMEM;
iput
iput_final
evict
ntfs_evict_inode
ni_write_inode
is_rec_inuse(ni->mi.mrec)-> As 'ni->mi.mrec' is NULL trigger NULL-ptr-derefTo solve above issue if new inode failed make inode bad before call 'iput()' in 'ntfs_new_inode()'.
--- fs/ntfs3/fsntfs.c | 1 + 1 file changed, 1 insertion(+)
fs/ntfs3/fsntfs.c +1 -0
@@ -1683,6 +1683,7 @@ struct ntfs_inode *ntfs_new_inode(struct ntfs_sb_info *sbi, CLST rno, bool dir) out:if (err) { +make_bad_inode (inode);iput (inode); ni =ERR_PTR (err); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 176/364 fs/ntfs3: Enhance the attribute size check
In reply to Greg Kroah-HartmanFrom: Edward Lo <[email protected]>
[ Upstream commit 4f082a7531223a438c757bb20e304f4c941c67a8 ]
This combines the overflow and boundary check so that all attribute size will be properly examined while enumerating them.
[ 169.181521] BUG: KASAN: slab-out-of-bounds in run_unpack+0x2e3/0x570 [ 169.183161] Read of size 1 at addr ffff8880094b6240 by task mount/247 [ 169.184046] [ 169.184925] CPU: 0 PID: 247 Comm: mount Not tainted 6.0.0-rc7+ #3 [ 169.185908] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 169.187066] Call Trace: [ 169.187492] <TASK> [ 169.188049] dump_stack_lvl+0x49/0x63 [ 169.188495] print_report.cold+0xf5/0x689 [ 169.188964] ? run_unpack+0x2e3/0x570 [ 169.189331] kasan_report+0xa7/0x130 [ 169.189714] ? run_unpack+0x2e3/0x570 [ 169.190079] __asan_load1+0x51/0x60 [ 169.190634] run_unpack+0x2e3/0x570 [ 169.191290] ? run_pack+0x840/0x840 [ 169.191569] ? run_lookup_entry+0xb3/0x1f0 [ 169.192443] ? mi_enum_attr+0x20a/0x230 [ 169.192886] run_unpack_ex+0xad/0x3e0 [ 169.193276] ? run_unpack+0x570/0x570 [ 169.193557] ? ni_load_mi+0x80/0x80 [ 169.193889] ? debug_smp_processor_id+0x17/0x20 [ 169.194236] ? mi_init+0x4a/0x70 [ 169.194496] attr_load_runs_vcn+0x166/0x1c0 [ 169.194851] ? attr_data_write_resident+0x250/0x250 [ 169.195188] mi_read+0x133/0x2c0 [ 169.195481] ntfs_iget5+0x277/0x1780 [ 169.196017] ? call_rcu+0x1c7/0x330 [ 169.196392] ? ntfs_get_block_bmap+0x70/0x70 [ 169.196708] ? evict+0x223/0x280 [ 169.197014] ? __kmalloc+0x33/0x540 [ 169.197305] ? wnd_init+0x15b/0x1b0 [ 169.197599] ntfs_fill_super+0x1026/0x1ba0 [ 169.197994] ? put_ntfs+0x1d0/0x1d0 [ 169.198299] ? vsprintf+0x20/0x20 [ 169.198583] ? mutex_unlock+0x81/0xd0 [ 169.198930] ? set_blocksize+0x95/0x150 [ 169.199269] get_tree_bdev+0x232/0x370 [ 169.199750] ? put_ntfs+0x1d0/0x1d0 [ 169.200094] ntfs_fs_get_tree+0x15/0x20 [ 169.200431] vfs_get_tree+0x4c/0x130 [ 169.200714] path_mount+0x654/0xfe0 [ 169.201067] ? putname+0x80/0xa0 [ 169.201358] ? finish_automount+0x2e0/0x2e0 [ 169.201965] ? putname+0x80/0xa0 [ 169.202445] ? kmem_cache_free+0x1c4/0x440 [ 169.203075] ? putname+0x80/0xa0 [ 169.203414] do_mount+0xd6/0xf0 [ 169.203719] ? path_mount+0xfe0/0xfe0 [ 169.203977] ? __kasan_check_write+0x14/0x20 [ 169.204382] __x64_sys_mount+0xca/0x110 [ 169.204711] do_syscall_64+0x3b/0x90 [ 169.205059] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 169.205571] RIP: 0033:0x7f67a80e948a [ 169.206327] Code: 48 8b 0d 11 fa 2a 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 008 [ 169.208296] RSP: 002b:00007ffddf020f58 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 [ 169.209253] RAX: ffffffffffffffda RBX: 000055e2547a6060 RCX: 00007f67a80e948a [ 169.209777] RDX: 000055e2547a6260 RSI: 000055e2547a62e0 RDI: 000055e2547aeaf0 [ 169.210342] RBP: 0000000000000000 R08: 000055e2547a6280 R09: 0000000000000020 [ 169.210843] R10: 00000000c0ed0000 R11: 0000000000000202 R12: 000055e2547aeaf0 [ 169.211307] R13: 000055e2547a6260 R14: 0000000000000000 R15: 00000000ffffffff [ 169.211913] </TASK> [ 169.212304] [ 169.212680] Allocated by task 0: [ 169.212963] (stack is not available) [ 169.213200] [ 169.213472] The buggy address belongs to the object at ffff8880094b5e00 [ 169.213472] which belongs to the cache UDP of size 1152 [ 169.214095] The buggy address is located 1088 bytes inside of [ 169.214095] 1152-byte region [ffff8880094b5e00, ffff8880094b6280) [ 169.214639] [ 169.215004] The buggy address belongs to the physical page: [ 169.215766] page:000000002e324c8c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x94b4 [ 169.218412] head:000000002e324c8c order:2 compound_mapcount:0 compound_pincount:0 [ 169.219078] flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff) [ 169.220272] raw: 000fffffc0010200 0000000000000000 dead000000000122 ffff888002409b40 [ 169.221006] raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000 [ 169.222320] page dumped because: kasan: bad access detected [ 169.222922] [ 169.223119] Memory state around the buggy address: [ 169.224056] ffff8880094b6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 169.224908] ffff8880094b6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 169.225677] >ffff8880094b6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 169.226445] ^ [ 169.227055] ffff8880094b6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 169.227638] ffff8880094b6300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
--- fs/ntfs3/record.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
fs/ntfs3/record.c +2 -7
@@ -220,11 +220,6 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)return NULL ; } -if (off + asize < off) { -/* overflow check */ -return NULL ; - } - attr =Add2Ptr (attr, asize); off += asize; }
@@ -247,8 +242,8 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)if ((t32 &0xf ) || (t32 >0x100 ))return NULL ; -/* Check boundary. */ -if (off + asize > used) +/* Check overflow and boundary. */ +if (off + asize < off || off + asize > used)return NULL ;/* Check size of attribute. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 177/364 fs/ntfs3: Fix NULL dereference in ni_write_inode
In reply to Greg Kroah-HartmanFrom: Abdun Nihaal <[email protected]>
[ Upstream commit 8dae4f6341e335a09575be60b4fdf697c732a470 ]
Syzbot reports a NULL dereference in ni_write_inode. When creating a new inode, if allocation fails in mi_init function (called in mi_format_new function), mi->mrec is set to NULL. In the error path of this inode creation, mi->mrec is later dereferenced in ni_write_inode.
Add a NULL check to prevent NULL dereference.
--- fs/ntfs3/frecord.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ntfs3/frecord.c +3 -0
@@ -3258,6 +3258,9 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint)return 0 ; } +if (!ni->mi.mrec) + goto out; +if (is_rec_inuse (ni->mi.mrec) && !(sbi->flags &NTFS_FLAGS_LOG_REPLAYING ) && inode->i_nlink) {bool modified = false;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 178/364 fs/ntfs3: Validate MFT flags before replaying logs
In reply to Greg Kroah-HartmanFrom: Edward Lo <[email protected]>
[ Upstream commit 98bea253aa28ad8be2ce565a9ca21beb4a9419e5 ]
Log load and replay is part of the metadata handle flow during mount operation. The $MFT record will be loaded and used while replaying logs. However, a malformed $MFT record, say, has RECORD_FLAG_DIR flag set and contains an ATTR_ROOT attribute will misguide kernel to treat it as a directory, and try to free the allocated resources when the corresponding inode is freed, which will cause an invalid kfree because the memory hasn't actually been allocated.
[ 101.368647] BUG: KASAN: invalid-free in kvfree+0x2c/0x40 [ 101.369457] [ 101.369986] CPU: 0 PID: 198 Comm: mount Not tainted 6.0.0-rc7+ #5 [ 101.370529] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 101.371362] Call Trace: [ 101.371795] <TASK> [ 101.372157] dump_stack_lvl+0x49/0x63 [ 101.372658] print_report.cold+0xf5/0x689 [ 101.373022] ? ni_write_inode+0x754/0xd90 [ 101.373378] ? kvfree+0x2c/0x40 [ 101.373698] kasan_report_invalid_free+0x77/0xf0 [ 101.374058] ? kvfree+0x2c/0x40 [ 101.374352] ? kvfree+0x2c/0x40 [ 101.374668] __kasan_slab_free+0x189/0x1b0 [ 101.374992] ? kvfree+0x2c/0x40 [ 101.375271] kfree+0x168/0x3b0 [ 101.375717] kvfree+0x2c/0x40 [ 101.376002] indx_clear+0x26/0x60 [ 101.376316] ni_clear+0xc5/0x290 [ 101.376661] ntfs_evict_inode+0x45/0x70 [ 101.377001] evict+0x199/0x280 [ 101.377432] iput.part.0+0x286/0x320 [ 101.377819] iput+0x32/0x50 [ 101.378166] ntfs_loadlog_and_replay+0x143/0x320 [ 101.378656] ? ntfs_bio_fill_1+0x510/0x510 [ 101.378968] ? iput.part.0+0x286/0x320 [ 101.379367] ntfs_fill_super+0xecb/0x1ba0 [ 101.379729] ? put_ntfs+0x1d0/0x1d0 [ 101.380046] ? vsprintf+0x20/0x20 [ 101.380542] ? mutex_unlock+0x81/0xd0 [ 101.380914] ? set_blocksize+0x95/0x150 [ 101.381597] get_tree_bdev+0x232/0x370 [ 101.382254] ? put_ntfs+0x1d0/0x1d0 [ 101.382699] ntfs_fs_get_tree+0x15/0x20 [ 101.383094] vfs_get_tree+0x4c/0x130 [ 101.383675] path_mount+0x654/0xfe0 [ 101.384203] ? putname+0x80/0xa0 [ 101.384540] ? finish_automount+0x2e0/0x2e0 [ 101.384943] ? putname+0x80/0xa0 [ 101.385362] ? kmem_cache_free+0x1c4/0x440 [ 101.385968] ? putname+0x80/0xa0 [ 101.386666] do_mount+0xd6/0xf0 [ 101.387228] ? path_mount+0xfe0/0xfe0 [ 101.387585] ? __kasan_check_write+0x14/0x20 [ 101.387979] __x64_sys_mount+0xca/0x110 [ 101.388436] do_syscall_64+0x3b/0x90 [ 101.388757] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 101.389289] RIP: 0033:0x7fa0f70e948a [ 101.390048] Code: 48 8b 0d 11 fa 2a 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 008 [ 101.391297] RSP: 002b:00007ffc24fdecc8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 [ 101.391988] RAX: ffffffffffffffda RBX: 000055932c183060 RCX: 00007fa0f70e948a [ 101.392494] RDX: 000055932c183260 RSI: 000055932c1832e0 RDI: 000055932c18bce0 [ 101.393053] RBP: 0000000000000000 R08: 000055932c183280 R09: 0000000000000020 [ 101.393577] R10: 00000000c0ed0000 R11: 0000000000000202 R12: 000055932c18bce0 [ 101.394044] R13: 000055932c183260 R14: 0000000000000000 R15: 00000000ffffffff [ 101.394747] </TASK> [ 101.395402] [ 101.396047] Allocated by task 198: [ 101.396724] kasan_save_stack+0x26/0x50 [ 101.397400] __kasan_slab_alloc+0x6d/0x90 [ 101.397974] kmem_cache_alloc_lru+0x192/0x5a0 [ 101.398524] ntfs_alloc_inode+0x23/0x70 [ 101.399137] alloc_inode+0x3b/0xf0 [ 101.399534] iget5_locked+0x54/0xa0 [ 101.400026] ntfs_iget5+0xaf/0x1780 [ 101.400414] ntfs_loadlog_and_replay+0xe5/0x320 [ 101.400883] ntfs_fill_super+0xecb/0x1ba0 [ 101.401313] get_tree_bdev+0x232/0x370 [ 101.401774] ntfs_fs_get_tree+0x15/0x20 [ 101.402224] vfs_get_tree+0x4c/0x130 [ 101.402673] path_mount+0x654/0xfe0 [ 101.403160] do_mount+0xd6/0xf0 [ 101.403537] __x64_sys_mount+0xca/0x110 [ 101.404058] do_syscall_64+0x3b/0x90 [ 101.404333] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 101.404816] [ 101.405067] The buggy address belongs to the object at ffff888008cc9ea0 [ 101.405067] which belongs to the cache ntfs_inode_cache of size 992 [ 101.406171] The buggy address is located 232 bytes inside of [ 101.406171] 992-byte region [ffff888008cc9ea0, ffff888008cca280) [ 101.406995] [ 101.408559] The buggy address belongs to the physical page: [ 101.409320] page:00000000dccf19dd refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8cc8 [ 101.410654] head:00000000dccf19dd order:2 compound_mapcount:0 compound_pincount:0 [ 101.411533] flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff) [ 101.412665] raw: 000fffffc0010200 0000000000000000 dead000000000122 ffff888003695140 [ 101.413209] raw: 0000000000000000 00000000800e000e 00000001ffffffff 0000000000000000 [ 101.413799] page dumped because: kasan: bad access detected [ 101.414213] [ 101.414427] Memory state around the buggy address: [ 101.414991] ffff888008cc9e80: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 [ 101.415785] ffff888008cc9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 101.416933] >ffff888008cc9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 101.417857] ^ [ 101.418566] ffff888008cca000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 101.419704] ffff888008cca080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
--- fs/ntfs3/inode.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ntfs3/inode.c +6 -0
@@ -100,6 +100,12 @@ static struct inode *ntfs_read_mft(struct inode *inode,/* Record should contain $I30 root. */ is_dir = rec->flags &RECORD_FLAG_DIR ; +/* MFT_REC_MFT is not a dir */ +if (is_dir && ino ==MFT_REC_MFT ) { + err = -EINVAL ; + goto out; + } + inode->i_generation =le16_to_cpu (rec->seq);/* Enumerate all struct Attributes MFT. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 179/364 fs/ntfs3: Add length check in indx_get_root
In reply to Greg Kroah-HartmanFrom: Edward Lo <[email protected]>
[ Upstream commit 08e8cf5f2d9ec383a2e339a2711b62a54ff3fba0 ]
This adds a length check to guarantee the retrieved index root is legit.
[ 162.459513] BUG: KASAN: use-after-free in hdr_find_e.isra.0+0x10c/0x320 [ 162.460176] Read of size 2 at addr ffff8880037bca99 by task mount/243 [ 162.460851] [ 162.461252] CPU: 0 PID: 243 Comm: mount Not tainted 6.0.0-rc7 #42 [ 162.461744] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 162.462609] Call Trace: [ 162.462954] <TASK> [ 162.463276] dump_stack_lvl+0x49/0x63 [ 162.463822] print_report.cold+0xf5/0x689 [ 162.464608] ? unwind_get_return_address+0x3a/0x60 [ 162.465766] ? hdr_find_e.isra.0+0x10c/0x320 [ 162.466975] kasan_report+0xa7/0x130 [ 162.467506] ? _raw_spin_lock_irq+0xc0/0xf0 [ 162.467998] ? hdr_find_e.isra.0+0x10c/0x320 [ 162.468536] __asan_load2+0x68/0x90 [ 162.468923] hdr_find_e.isra.0+0x10c/0x320 [ 162.469282] ? cmp_uints+0xe0/0xe0 [ 162.469557] ? cmp_sdh+0x90/0x90 [ 162.469864] ? ni_find_attr+0x214/0x300 [ 162.470217] ? ni_load_mi+0x80/0x80 [ 162.470479] ? entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 162.470931] ? ntfs_bread_run+0x190/0x190 [ 162.471307] ? indx_get_root+0xe4/0x190 [ 162.471556] ? indx_get_root+0x140/0x190 [ 162.471833] ? indx_init+0x1e0/0x1e0 [ 162.472069] ? fnd_clear+0x115/0x140 [ 162.472363] ? _raw_spin_lock_irqsave+0x100/0x100 [ 162.472731] indx_find+0x184/0x470 [ 162.473461] ? sysvec_apic_timer_interrupt+0x57/0xc0 [ 162.474429] ? indx_find_buffer+0x2d0/0x2d0 [ 162.474704] ? do_syscall_64+0x3b/0x90 [ 162.474962] dir_search_u+0x196/0x2f0 [ 162.475381] ? ntfs_nls_to_utf16+0x450/0x450 [ 162.475661] ? ntfs_security_init+0x3d6/0x440 [ 162.475906] ? is_sd_valid+0x180/0x180 [ 162.476191] ntfs_extend_init+0x13f/0x2c0 [ 162.476496] ? ntfs_fix_post_read+0x130/0x130 [ 162.476861] ? iput.part.0+0x286/0x320 [ 162.477325] ntfs_fill_super+0x11e0/0x1b50 [ 162.477709] ? put_ntfs+0x1d0/0x1d0 [ 162.477970] ? vsprintf+0x20/0x20 [ 162.478258] ? set_blocksize+0x95/0x150 [ 162.478538] get_tree_bdev+0x232/0x370 [ 162.478789] ? put_ntfs+0x1d0/0x1d0 [ 162.479038] ntfs_fs_get_tree+0x15/0x20 [ 162.479374] vfs_get_tree+0x4c/0x130 [ 162.479729] path_mount+0x654/0xfe0 [ 162.480124] ? putname+0x80/0xa0 [ 162.480484] ? finish_automount+0x2e0/0x2e0 [ 162.480894] ? putname+0x80/0xa0 [ 162.481467] ? kmem_cache_free+0x1c4/0x440 [ 162.482280] ? putname+0x80/0xa0 [ 162.482714] do_mount+0xd6/0xf0 [ 162.483264] ? path_mount+0xfe0/0xfe0 [ 162.484782] ? __kasan_check_write+0x14/0x20 [ 162.485593] __x64_sys_mount+0xca/0x110 [ 162.486024] do_syscall_64+0x3b/0x90 [ 162.486543] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 162.487141] RIP: 0033:0x7f9d374e948a [ 162.488324] Code: 48 8b 0d 11 fa 2a 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 008 [ 162.489728] RSP: 002b:00007ffe30e73d18 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [ 162.490971] RAX: ffffffffffffffda RBX: 0000561cdb43a060 RCX: 00007f9d374e948a [ 162.491669] RDX: 0000561cdb43a260 RSI: 0000561cdb43a2e0 RDI: 0000561cdb442af0 [ 162.492050] RBP: 0000000000000000 R08: 0000561cdb43a280 R09: 0000000000000020 [ 162.492459] R10: 00000000c0ed0000 R11: 0000000000000206 R12: 0000561cdb442af0 [ 162.493183] R13: 0000561cdb43a260 R14: 0000000000000000 R15: 00000000ffffffff [ 162.493644] </TASK> [ 162.493908] [ 162.494214] The buggy address belongs to the physical page: [ 162.494761] page:000000003e38a3d5 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37bc [ 162.496064] flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff) [ 162.497278] raw: 000fffffc0000000 ffffea00000df1c8 ffffea00000df008 0000000000000000 [ 162.498928] raw: 0000000000000000 0000000000240000 00000000ffffffff 0000000000000000 [ 162.500542] page dumped because: kasan: bad access detected [ 162.501057] [ 162.501242] Memory state around the buggy address: [ 162.502230] ffff8880037bc980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 162.502977] ffff8880037bca00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 162.503522] >ffff8880037bca80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 162.503963] ^ [ 162.504370] ffff8880037bcb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 162.504766] ffff8880037bcb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
--- fs/ntfs3/index.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/ntfs3/index.c +10 -1
@@ -994,6 +994,7 @@ struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni,struct ATTR_LIST_ENTRY *le =NULL ;struct ATTRIB *a;const struct INDEX_NAMES *in = &s_index_names[indx->type]; +struct INDEX_ROOT *root =NULL ; a =ni_find_attr (ni,NULL , &le,ATTR_ROOT , in->name, in->name_len,NULL , mi);
@@ -1003,7 +1004,15 @@ struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni,if (attr) *attr = a; -return resident_data_ex (a,sizeof (struct INDEX_ROOT )); + root =resident_data_ex (a,sizeof (struct INDEX_ROOT )); + +/* length check */ +if (root && offsetof(struct INDEX_ROOT , ihdr) +le32_to_cpu (root->ihdr.used) > +le32_to_cpu (a->res.data_size)) { +return NULL ; + } + +return root; } static int indx_write(struct ntfs_index *indx, struct ntfs_inode *ni,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 180/364 fs/ntfs3: Fix a possible null-pointer dereference in ni_clear()
In reply to Greg Kroah-HartmanFrom: Jia-Ju Bai <[email protected]>
[ Upstream commit ec275bf9693d19cc0fdce8436f4c425ced86f6e7 ]
In a previous commit c1006bd13146, ni->mi.mrec in ni_write_inode() could be NULL, and thus a NULL check is added for this variable.
However, in the same call stack, ni->mi.mrec can be also dereferenced in ni_clear():
ntfs_evict_inode(inode)
ni_write_inode(inode, ...)
ni = ntfs_i(inode);
is_rec_inuse(ni->mi.mrec) -> Add a NULL check by previous commit
ni_clear(ntfs_i(inode))
is_rec_inuse(ni->mi.mrec) -> No checkThus, a possible null-pointer dereference may exist in ni_clear(). To fix it, a NULL check is added in this function.
--- fs/ntfs3/frecord.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/frecord.c +1 -1
@@ -102,7 +102,7 @@ void ni_clear(struct ntfs_inode *ni) {struct rb_node *node; -if (!ni->vfs_inode.i_nlink &&is_rec_inuse (ni->mi.mrec)) +if (!ni->vfs_inode.i_nlink && ni->mi.mrec &&is_rec_inuse (ni->mi.mrec))ni_delete_all (ni);al_destroy (ni);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 181/364 clk: tegra20: fix gcc-7 constant overflow warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit b4a2adbf3586efa12fe78b9dec047423e01f3010 ]
Older gcc versions get confused by comparing a u32 value to a negative constant in a switch()/case block:
drivers/clk/tegra/clk-tegra20.c: In function 'tegra20_clk_measure_input_freq':drivers/clk/tegra/clk-tegra20.c:581:2: error: case label does not reduce to an integer constant
case OSC_CTRL_OSC_FREQ_12MHZ:
^~~~drivers/clk/tegra/clk-tegra20.c:593:2: error: case label does not reduce to an integer constant
case OSC_CTRL_OSC_FREQ_26MHZ:
Make the constants unsigned instead.
--- drivers/clk/tegra/clk-tegra20.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/clk/tegra/clk-tegra20.c +14 -14
@@ -21,24 +21,24 @@#define MISC_CLK_ENB 0x48#define OSC_CTRL 0x50 -#define OSC_CTRL_OSC_FREQ_MASK (3<<30) -#define OSC_CTRL_OSC_FREQ_13MHZ (0<<30) -#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30) -#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30) -#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30) -#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK) - -#define OSC_CTRL_PLL_REF_DIV_MASK (3<<28) -#define OSC_CTRL_PLL_REF_DIV_1 (0<<28) -#define OSC_CTRL_PLL_REF_DIV_2 (1<<28) -#define OSC_CTRL_PLL_REF_DIV_4 (2<<28) +#define OSC_CTRL_OSC_FREQ_MASK (3u<<30) +#define OSC_CTRL_OSC_FREQ_13MHZ (0u<<30) +#define OSC_CTRL_OSC_FREQ_19_2MHZ (1u<<30) +#define OSC_CTRL_OSC_FREQ_12MHZ (2u<<30) +#define OSC_CTRL_OSC_FREQ_26MHZ (3u<<30) +#define OSC_CTRL_MASK (0x3f2u | OSC_CTRL_OSC_FREQ_MASK) + +#define OSC_CTRL_PLL_REF_DIV_MASK (3u<<28) +#define OSC_CTRL_PLL_REF_DIV_1 (0u<<28) +#define OSC_CTRL_PLL_REF_DIV_2 (1u<<28) +#define OSC_CTRL_PLL_REF_DIV_4 (2u<<28)#define OSC_FREQ_DET 0x58 -#define OSC_FREQ_DET_TRIG (1<<31) +#define OSC_FREQ_DET_TRIG (1u<<31)#define OSC_FREQ_DET_STATUS 0x5c -#define OSC_FREQ_DET_BUSY (1<<31) -#define OSC_FREQ_DET_CNT_MASK 0xFFFF +#define OSC_FREQ_DET_BUSYu (1<<31) +#define OSC_FREQ_DET_CNT_MASK 0xFFFFu#define TEGRA20_CLK_PERIPH_BANKS 3
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 182/364 iommu/arm-smmu-v3: Acknowledge pri/event queue overflow if any
In reply to Greg Kroah-HartmanFrom: Tomas Krcka <[email protected]>
[ Upstream commit 67ea0b7ce41844eae7c10bb04dfe66a23318c224 ]
When an overflow occurs in the PRI queue, the SMMU toggles the overflow flag in the PROD register. To exit the overflow condition, the PRI thread is supposed to acknowledge it by toggling this flag in the CONS register. Unacknowledged overflow causes the queue to stop adding anything new.
Currently, the priq thread always writes the CONS register back to the SMMU after clearing the queue.
The writeback is not necessary if the OVFLG in the PROD register has not been changed, no overflow has occured.
This commit checks the difference of the overflow flag between CONS and PROD register. If it's different, toggles the OVACKFLG flag in the CONS register and write it to the SMMU.
The situation is similar for the event queue.
The acknowledge register is also toggled after clearing the event queue but never propagated to the hardware. This would only be done the next time when executing evtq thread.
Unacknowledged event queue overflow doesn't affect the event queue, because the SMMU still adds elements to that queue when the overflow condition is active.
But it feel nicer to keep SMMU in sync when possible, so use the same way here as well.
--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +14 -5
@@ -152,6 +152,18 @@ static void queue_inc_cons(struct arm_smmu_ll_queue *q) q->cons =Q_OVF (q->cons) |Q_WRP (q, cons) |Q_IDX (q, cons); } +static void queue_sync_cons_ovf (struct arm_smmu_queue *q) +{ +struct arm_smmu_ll_queue *llq = &q->llq; + +if (likely (Q_OVF (llq->prod) ==Q_OVF (llq->cons))) +return ; + + llq->cons =Q_OVF (llq->prod) |Q_WRP (llq, llq->cons) | +Q_IDX (llq, llq->cons); +queue_sync_cons_out (q); +} +static int queue_sync_prod_in (struct arm_smmu_queue *q) {u32 prod;
@@ -1577,8 +1589,7 @@ static irqreturn_t arm_smmu_evtq_thread(int irq, void *dev) }while (!queue_empty (llq));/* Sync our overflow flag, as we believe we're up to speed */ - llq->cons =Q_OVF (llq->prod) |Q_WRP (llq, llq->cons) | -Q_IDX (llq, llq->cons); +queue_sync_cons_ovf (q);return IRQ_HANDLED ; }
@@ -1636,9 +1647,7 @@ static irqreturn_t arm_smmu_priq_thread(int irq, void *dev) }while (!queue_empty (llq));/* Sync our overflow flag, as we believe we're up to speed */ - llq->cons =Q_OVF (llq->prod) |Q_WRP (llq, llq->cons) | -Q_IDX (llq, llq->cons); -queue_sync_cons_out (q); +queue_sync_cons_ovf (q);return IRQ_HANDLED ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 183/364 iommu/sprd: Release dma buffer to avoid memory leak
In reply to Greg Kroah-HartmanFrom: Chunyan Zhang <[email protected]>
[ Upstream commit 9afea57384d4ae7b2034593eac7fa76c7122762a ]
When attaching to a domain, the driver would alloc a DMA buffer which is used to store address mapping table, and it need to be released when the IOMMU domain is freed.
--- drivers/iommu/sprd-iommu.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-)
drivers/iommu/sprd-iommu.c +22 -7
@@ -151,13 +151,6 @@ static struct iommu_domain *sprd_iommu_domain_alloc(unsigned int domain_type)return &dom->domain; } -static void sprd_iommu_domain_free (struct iommu_domain *domain) -{ -struct sprd_iommu_domain *dom =to_sprd_domain (domain); - -kfree (dom); -} -static void sprd_iommu_first_vpn (struct sprd_iommu_domain *dom) {struct sprd_iommu_device *sdev = dom->sdev;
@@ -230,6 +223,28 @@ static void sprd_iommu_hw_en(struct sprd_iommu_device *sdev, bool en)sprd_iommu_update_bits (sdev, reg_cfg, mask,0 , val); } +static void sprd_iommu_cleanup (struct sprd_iommu_domain *dom) +{ +size_t pgt_size; + +/* Nothing need to do if the domain hasn't been attached */ +if (!dom->sdev) +return ; + + pgt_size =sprd_iommu_pgt_size (&dom->domain); +dma_free_coherent (dom->sdev->dev, pgt_size, dom->pgt_va, dom->pgt_pa); + dom->sdev =NULL ; +sprd_iommu_hw_en (dom->sdev, false); +} + +static void sprd_iommu_domain_free (struct iommu_domain *domain) +{ +struct sprd_iommu_domain *dom =to_sprd_domain (domain); + +sprd_iommu_cleanup (dom); +kfree (dom); +} +static int sprd_iommu_attach_device (struct iommu_domain *domain,struct device *dev) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 184/364 power: supply: axp288_charger: Use alt usb-id extcon on some x86 android tablets
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit ce38f3fc0f87a358a9560a3815265a94f1b38c37 ]
x86 ACPI boards which ship with only Android as their factory image may have pretty broken ACPI tables. This includes broken _AEI ACPI GPIO event handlers, which are normally used to listen to the micro-USB ID pin and:
1. Switch the USB-mux to the host / device USB controllers
2. Disable Vbus path before enabling the 5V boost (AXP reg 0x30 bit 7)
3. Turn 5V Vboost on / off
On non broken systems where this is not done through an ACPI GPIO event handler, there is an ACPI INT3496 device describing the involved GPIOs which are handled by the extcon-intel-int3496 driver; and axp288-charger.ko listens to this extcon-device and disables the Vbus path when necessary.
On x86 Android boards, with broken ACPI GPIO event handlers, these are disabled by acpi_quirk_skip_gpio_event_handlers() and an intel-int3496 extcon device is manually instantiated by x86-android-tablets.ko .
Add support to the axp288-charger code for this setup, so that it properly disables the Vbus path when necessary. Note this uses acpi_quirk_skip_gpio_event_handlers() to identify these systems, to avoid the need to add a separate DMI match table for this.
--- drivers/power/supply/axp288_charger.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/power/supply/axp288_charger.c +13 -2
@@ -836,6 +836,7 @@ static int axp288_charger_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct axp20x_dev *axp20x =dev_get_drvdata (pdev->dev.parent);struct power_supply_config charger_cfg = {}; +const char *extcon_name =NULL ;unsigned int val;/*
@@ -872,8 +873,18 @@ static int axp288_charger_probe(struct platform_device *pdev)return PTR_ERR (info->cable.edev); } -if (acpi_dev_present (USB_HOST_EXTCON_HID ,NULL ,-1 )) { - info->otg.cable =extcon_get_extcon_dev (USB_HOST_EXTCON_NAME ); +/* +* On devices with broken ACPI GPIO event handlers there also is no ACPI +* "INT3496" (USB_HOST_EXTCON_HID) device. x86-android-tablets.ko +* instantiates an "intel-int3496" extcon on these devs as a workaround. +*/ +if (acpi_quirk_skip_gpio_event_handlers ()) + extcon_name ="intel-int3496" ; +else if (acpi_dev_present (USB_HOST_EXTCON_HID ,NULL ,-1 )) + extcon_name =USB_HOST_EXTCON_NAME ; + +if (extcon_name) { + info->otg.cable =extcon_get_extcon_dev (extcon_name);if (IS_ERR (info->otg.cable)) { dev_err_probe(dev, PTR_ERR(info->otg.cable), "extcon_get_extcon_dev(%s) failed\n",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 185/364 Input: xpad - add constants for GIP interface numbers
In reply to Greg Kroah-HartmanFrom: Vicki Pfau <[email protected]>
[ Upstream commit f9b2e603c6216824e34dc9a67205d98ccc9a41ca ]
Wired GIP devices present multiple interfaces with the same USB identification other than the interface number. This adds constants for differentiating two of them and uses them where appropriate
--- drivers/input/joystick/xpad.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +4 -1
@@ -559,6 +559,9 @@ struct xboxone_init_packet {#define GIP_MOTOR_LT BIT(3)#define GIP_MOTOR_ALL (GIP_MOTOR_R | GIP_MOTOR_L | GIP_MOTOR_RT | GIP_MOTOR_LT) +#define GIP_WIRED_INTF_DATA 0 +#define GIP_WIRED_INTF_AUDIO 1 +/* * This packet is required for all Xbox One pads with 2015 * or later firmware installed (or present from the factory).
@@ -2003,7 +2006,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id }if (xpad->xtype ==XTYPE_XBOXONE && - intf->cur_altsetting->desc.bInterfaceNumber !=0 ) { + intf->cur_altsetting->desc.bInterfaceNumber !=GIP_WIRED_INTF_DATA ) {/* * The Xbox One controller lists three interfaces all with the * same interface class, subclass and protocol. Differentiate by
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 186/364 RDMA/mlx5: Remove pcie_relaxed_ordering_enabled() check for RO write
In reply to Greg Kroah-HartmanFrom: Avihai Horon <[email protected]>
[ Upstream commit ed4b0661cce119870edb1994fd06c9cbc1dc05c3 ]
pcie_relaxed_ordering_enabled() check was added to avoid a syndrome when creating a MKey with relaxed ordering (RO) enabled when the driver's relaxed_ordering_{read,write} HCA capabilities are out of sync with FW.
While this can happen with relaxed_ordering_read, it can't happen with relaxed_ordering_write as it's set if the device supports RO write, regardless of RO in PCI config space, and thus can't change during runtime.
Therefore, drop the pcie_relaxed_ordering_enabled() check for relaxed_ordering_write while keeping it for relaxed_ordering_read. Doing so will also allow the usage of RO write in VFs and VMs (where RO in PCI config space is not reported/emulated properly).
--- drivers/infiniband/hw/mlx5/mr.c | 6 +++--- drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/en_common.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/infiniband/hw/mlx5/mr.c +3 -3
@@ -67,11 +67,11 @@ static void set_mkc_access_pd_addr_fields(void *mkc, int acc, u64 start_addr,MLX5_SET (mkc, mkc, lw, !!(acc &IB_ACCESS_LOCAL_WRITE ));MLX5_SET (mkc, mkc, lr,1 ); -if ((acc &IB_ACCESS_RELAXED_ORDERING ) && -pcie_relaxed_ordering_enabled (dev->mdev->pdev)) { +if (acc &IB_ACCESS_RELAXED_ORDERING ) {if (MLX5_CAP_GEN (dev->mdev, relaxed_ordering_write))MLX5_SET (mkc, mkc, relaxed_ordering_write,1 ); -if (MLX5_CAP_GEN (dev->mdev, relaxed_ordering_read)) +if (MLX5_CAP_GEN (dev->mdev, relaxed_ordering_read) && +pcie_relaxed_ordering_enabled (dev->mdev->pdev))MLX5_SET (mkc, mkc, relaxed_ordering_read,1 ); }
drivers/net/ethernet/mellanox/mlx5/core/en/params.c +1 -2
@@ -867,8 +867,7 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev,static u8 rq_end_pad_mode (struct mlx5_core_dev *mdev,struct mlx5e_params *params) {bool lro_en = params->packet_merge.type ==MLX5E_PACKET_MERGE_LRO ; -bool ro =pcie_relaxed_ordering_enabled (mdev->pdev) && -MLX5_CAP_GEN (mdev, relaxed_ordering_write); +bool ro =MLX5_CAP_GEN (mdev, relaxed_ordering_write);return ro && lro_en ?MLX5_WQ_END_PAD_MODE_NONE :MLX5_WQ_END_PAD_MODE_ALIGN ;
drivers/net/ethernet/mellanox/mlx5/core/en_common.c +1 -1
@@ -44,7 +44,7 @@ void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc)bool ro_read =MLX5_CAP_GEN (mdev, relaxed_ordering_read);MLX5_SET (mkc, mkc, relaxed_ordering_read, ro_pci_enable && ro_read); -MLX5_SET (mkc, mkc, relaxed_ordering_write, ro_pci_enable && ro_write); +MLX5_SET (mkc, mkc, relaxed_ordering_write, ro_write); }int mlx5e_create_mkey (struct mlx5_core_dev *mdev,u32 pdn,u32 *mkey)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 187/364 clk: rockchip: rk3588: make gate linked clocks critical
In reply to Greg Kroah-HartmanFrom: Sebastian Reichel <[email protected]>
[ Upstream commit 64042c28c3bb6729df8e2fda89bc7ebbe3790907 ]
RK3588 has a couple of hardware blocks called Native Interface Unit (NIU) that gate the clocks to devices behind them. Effectively this means that some clocks require two parent clocks being enabled. Downstream implemented this by using a separate clock driver ("clk-link") for them, which enables the second clock using PM framework.
In the upstream kernel we are currently missing support for the second parent. The information about it is in the GATE_LINK() macro as linkname, but that is not used. Thus the second parent clock is not properly enabled. So far this did not really matter, since these clocks are mostly required for the more advanced IP blocks, that are not yet supported upstream. As this is about to change we need a fix. There are three options available:
1. Properly implement support for having two parent clocks in the clock framework.
2. Mark the affected clocks CLK_IGNORE_UNUSED, so that they are not disabled. This wastes some power, but keeps the hack contained within the clock driver. Going from this to the first solution is easy once that has been implemented.
3. Enabling the extra clock in the consumer driver. This leaks some implementation details into DT.
This patch implements the second option as an intermediate solution until the first one is available. I used an alias for CLK_IS_CRITICAL, so that it's easy to see which clocks are not really critical once the clock framework supports a better way to implement this.
--- drivers/clk/rockchip/clk-rk3588.c | 42 +++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-)
drivers/clk/rockchip/clk-rk3588.c +26 -16
@@ -13,15 +13,25 @@#include "clk.h" /* -* GATE with additional linked clock. Downstream enables the linked clock -* (via runtime PM) whenever the gate is enabled. The downstream implementation -* does this via separate clock nodes for each of the linked gate clocks, -* which leaks parts of the clock tree into DT. It is unclear why this is -* actually needed and things work without it for simple use cases. Thus -* the linked clock is ignored for now. +* Recent Rockchip SoCs have a new hardware block called Native Interface +* Unit (NIU), which gates clocks to devices behind them. These effectively +* need two parent clocks. +* +* Downstream enables the linked clock via runtime PM whenever the gate is +* enabled. This implementation uses separate clock nodes for each of the +* linked gate clocks, which leaks parts of the clock tree into DT. +* +* The GATE_LINK macro instead takes the second parent via 'linkname', but +* ignores the information. Once the clock framework is ready to handle it, the +* information should be passed on here. But since these clocks are required to +* access multiple relevant IP blocks, such as PCIe or USB, we mark all linked +* clocks critical until a better solution is available. This will waste some +* power, but avoids leaking implementation details into DT or hanging the +* system. */ #define GATE_LINK (_id, cname, pname, linkname, f, o, b, gf) \ GATE(_id, cname, pname, f, o, b, gf) +#define RK3588_LINKED_CLK CLK_IS_CRITICAL#define RK3588_GRF_SOC_STATUS0 0x600
@@ -1446,7 +1456,7 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = {COMPOSITE_NODIV (HCLK_NVM_ROOT ,"hclk_nvm_root" , mux_200m_100m_50m_24m_p,0 ,RK3588_CLKSEL_CON (77 ),0 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (31 ),0 ,GFLAGS ), -COMPOSITE (ACLK_NVM_ROOT ,"aclk_nvm_root" , gpll_cpll_p,0 , +COMPOSITE (ACLK_NVM_ROOT ,"aclk_nvm_root" , gpll_cpll_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (77 ),7 ,1 ,MFLAGS ,2 ,5 ,DFLAGS ,RK3588_CLKGATE_CON (31 ),1 ,GFLAGS ), GATE(ACLK_EMMC, "aclk_emmc", "aclk_nvm_root", 0,
@@ -1675,13 +1685,13 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = { RK3588_CLKGATE_CON(42), 9, GFLAGS),/* vdpu */ -COMPOSITE (ACLK_VDPU_ROOT ,"aclk_vdpu_root" , gpll_cpll_aupll_p,0 , +COMPOSITE (ACLK_VDPU_ROOT ,"aclk_vdpu_root" , gpll_cpll_aupll_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (98 ),5 ,2 ,MFLAGS ,0 ,5 ,DFLAGS ,RK3588_CLKGATE_CON (44 ),0 ,GFLAGS ),COMPOSITE_NODIV (ACLK_VDPU_LOW_ROOT ,"aclk_vdpu_low_root" , mux_400m_200m_100m_24m_p,0 ,RK3588_CLKSEL_CON (98 ),7 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (44 ),1 ,GFLAGS ), -COMPOSITE_NODIV (HCLK_VDPU_ROOT ,"hclk_vdpu_root" , mux_200m_100m_50m_24m_p,0 , +COMPOSITE_NODIV (HCLK_VDPU_ROOT ,"hclk_vdpu_root" , mux_200m_100m_50m_24m_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (98 ),9 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (44 ),2 ,GFLAGS ), COMPOSITE(ACLK_JPEG_DECODER_ROOT, "aclk_jpeg_decoder_root", gpll_cpll_aupll_spll_p, 0,
@@ -1732,9 +1742,9 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = {COMPOSITE (ACLK_RKVENC0_ROOT ,"aclk_rkvenc0_root" , gpll_cpll_npll_p,0 ,RK3588_CLKSEL_CON (102 ),7 ,2 ,MFLAGS ,2 ,5 ,DFLAGS ,RK3588_CLKGATE_CON (47 ),1 ,GFLAGS ), -GATE (HCLK_RKVENC0 ,"hclk_rkvenc0" ,"hclk_rkvenc0_root" ,0 , +GATE (HCLK_RKVENC0 ,"hclk_rkvenc0" ,"hclk_rkvenc0_root" ,RK3588_LINKED_CLK ,RK3588_CLKGATE_CON (47 ),4 ,GFLAGS ), -GATE (ACLK_RKVENC0 ,"aclk_rkvenc0" ,"aclk_rkvenc0_root" ,0 , +GATE (ACLK_RKVENC0 ,"aclk_rkvenc0" ,"aclk_rkvenc0_root" ,RK3588_LINKED_CLK ,RK3588_CLKGATE_CON (47 ),5 ,GFLAGS ), COMPOSITE(CLK_RKVENC0_CORE, "clk_rkvenc0_core", gpll_cpll_aupll_npll_p, 0, RK3588_CLKSEL_CON(102), 14, 2, MFLAGS, 9, 5, DFLAGS,
@@ -1744,10 +1754,10 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = { RK3588_CLKGATE_CON(48), 6, GFLAGS),/* vi */ -COMPOSITE (ACLK_VI_ROOT ,"aclk_vi_root" , gpll_cpll_npll_aupll_spll_p,0 , +COMPOSITE (ACLK_VI_ROOT ,"aclk_vi_root" , gpll_cpll_npll_aupll_spll_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (106 ),5 ,3 ,MFLAGS ,0 ,5 ,DFLAGS ,RK3588_CLKGATE_CON (49 ),0 ,GFLAGS ), -COMPOSITE_NODIV (HCLK_VI_ROOT ,"hclk_vi_root" , mux_200m_100m_50m_24m_p,0 , +COMPOSITE_NODIV (HCLK_VI_ROOT ,"hclk_vi_root" , mux_200m_100m_50m_24m_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (106 ),8 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (49 ),1 ,GFLAGS ), COMPOSITE_NODIV(PCLK_VI_ROOT, "pclk_vi_root", mux_100m_50m_24m_p, 0,
@@ -1919,10 +1929,10 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = {COMPOSITE (ACLK_VOP_ROOT ,"aclk_vop_root" , gpll_cpll_dmyaupll_npll_spll_p,0 ,RK3588_CLKSEL_CON (110 ),5 ,3 ,MFLAGS ,0 ,5 ,DFLAGS ,RK3588_CLKGATE_CON (52 ),0 ,GFLAGS ), -COMPOSITE_NODIV (ACLK_VOP_LOW_ROOT ,"aclk_vop_low_root" , mux_400m_200m_100m_24m_p,0 , +COMPOSITE_NODIV (ACLK_VOP_LOW_ROOT ,"aclk_vop_low_root" , mux_400m_200m_100m_24m_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (110 ),8 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (52 ),1 ,GFLAGS ), -COMPOSITE_NODIV (HCLK_VOP_ROOT ,"hclk_vop_root" , mux_200m_100m_50m_24m_p,0 , +COMPOSITE_NODIV (HCLK_VOP_ROOT ,"hclk_vop_root" , mux_200m_100m_50m_24m_p,RK3588_LINKED_CLK ,RK3588_CLKSEL_CON (110 ),10 ,2 ,MFLAGS ,RK3588_CLKGATE_CON (52 ),2 ,GFLAGS ), COMPOSITE_NODIV(PCLK_VOP_ROOT, "pclk_vop_root", mux_100m_50m_24m_p, 0,
@@ -2425,7 +2435,7 @@ static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = {GATE_LINK (ACLK_ISP1_PRE ,"aclk_isp1_pre" ,"aclk_isp1_root" ,"aclk_vi_root" ,0 ,RK3588_CLKGATE_CON (26 ),6 ,GFLAGS ),GATE_LINK (HCLK_ISP1_PRE ,"hclk_isp1_pre" ,"hclk_isp1_root" ,"hclk_vi_root" ,0 ,RK3588_CLKGATE_CON (26 ),8 ,GFLAGS ), -GATE_LINK (HCLK_NVM ,"hclk_nvm" ,"hclk_nvm_root" ,"aclk_nvm_root" ,0 ,RK3588_CLKGATE_CON (31 ),2 ,GFLAGS ), +GATE_LINK (HCLK_NVM ,"hclk_nvm" ,"hclk_nvm_root" ,"aclk_nvm_root" ,RK3588_LINKED_CLK ,RK3588_CLKGATE_CON (31 ),2 ,GFLAGS ),GATE_LINK (ACLK_USB ,"aclk_usb" ,"aclk_usb_root" ,"aclk_vo1usb_top_root" ,0 ,RK3588_CLKGATE_CON (42 ),2 ,GFLAGS ),GATE_LINK (HCLK_USB ,"hclk_usb" ,"hclk_usb_root" ,"hclk_vo1usb_top_root" ,0 ,RK3588_CLKGATE_CON (42 ),3 ,GFLAGS ), GATE_LINK(ACLK_JPEG_DECODER_PRE, "aclk_jpeg_decoder_pre", "aclk_jpeg_decoder_root", "aclk_vdpu_root", 0, RK3588_CLKGATE_CON(44), 7, GFLAGS),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 188/364 cifs: missing lock when updating session status
In reply to Greg Kroah-HartmanFrom: Steve French <[email protected]>
[ Upstream commit 943fb67b090212f1d3789eb7796b1c9045c62fd6 ]
Coverity noted a place where we were not grabbing the ses_lock when setting (and checking) ses_status.
Addresses-Coverity: 1536833 ("Data race condition (MISSING_LOCK)")
--- fs/cifs/connect.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/cifs/connect.c +6 -2
@@ -1918,18 +1918,22 @@ void __cifs_put_smb_ses(struct cifs_ses *ses)/* ses_count can never go negative */ WARN_ON (ses->ses_count <0 ); +spin_lock (&ses->ses_lock);if (ses->ses_status ==SES_GOOD ) ses->ses_status =SES_EXITING ; -cifs_free_ipc (ses); -if (ses->ses_status ==SES_EXITING && server->ops->logoff) { +spin_unlock (&ses->ses_lock); +cifs_free_ipc (ses); xid =get_xid (); rc = server->ops->logoff (xid, ses);if (rc)cifs_server_dbg (VFS ,"%s: Session Logoff failure rc=%d\n" , __func__, rc);_free_xid (xid); + }else { +spin_unlock (&ses->ses_lock); +cifs_free_ipc (ses); }spin_lock (&cifs_tcp_ses_lock);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 189/364 pinctrl: at91: use devm_kasprintf() to avoid potential leaks (part 2)
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit f494c1913cbb34b9e2078b7b045c87c1ca6df791 ]
Use devm_kasprintf() instead of kasprintf() to avoid any potential leaks. At the moment drivers have no remove functionality hence there is no need for fixes tag.
While at it, switch to use devm_kasprintf_strarray().
--- drivers/pinctrl/pinctrl-at91.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/pinctrl/pinctrl-at91.c +17 -6
@@ -18,6 +18,7 @@#include <linux/pm.h> #include <linux/seq_file.h> #include <linux/slab.h> +#include <linux/string_helpers.h> /* Since we request GPIOs from ourself */ #include <linux/pinctrl/consumer.h>
@@ -1371,6 +1372,7 @@ static int at91_pinctrl_probe_dt(struct platform_device *pdev,static int at91_pinctrl_probe (struct platform_device *pdev) { +struct device *dev = &pdev->dev;struct at91_pinctrl *info;struct pinctrl_pin_desc *pdesc;int ret, i, j, k;
@@ -1394,9 +1396,19 @@ static int at91_pinctrl_probe(struct platform_device *pdev)return -ENOMEM ;for (i =0 , k =0 ; i < gpio_banks; i++) { +char **names; + + names =devm_kasprintf_strarray (dev,"pio" ,MAX_NB_GPIO_PER_BANK ); +if (!names) +return -ENOMEM ; +for (j =0 ; j <MAX_NB_GPIO_PER_BANK ; j++, k++) { +char *name = names[j]; + +strreplace (name,'-' , i +'A' ); + pdesc->number = k; - pdesc->name =kasprintf (GFP_KERNEL ,"pio%c%d" , i +'A' , j); + pdesc->name = name; pdesc++; } }
@@ -1797,7 +1809,8 @@ static const struct of_device_id at91_gpio_of_match[] = {static int at91_gpio_probe (struct platform_device *pdev) { -struct device_node *np = pdev->dev.of_node; +struct device *dev = &pdev->dev; +struct device_node *np = dev->of_node;struct at91_gpio_chip *at91_chip =NULL ;struct gpio_chip *chip;struct pinctrl_gpio_range *range;
@@ -1866,16 +1879,14 @@ static int at91_gpio_probe(struct platform_device *pdev) chip->ngpio = ngpio; } - names =devm_kcalloc (&pdev->dev, chip->ngpio,sizeof (char *), -GFP_KERNEL ); - + names =devm_kasprintf_strarray (dev,"pio" , chip->ngpio);if (!names) { ret = -ENOMEM ; goto clk_enable_err; }for (i =0 ; i < chip->ngpio; i++) - names[i] =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"pio%c%d" , alias_idx +'A' , i); +strreplace (names[i],'-' , alias_idx +'A' ); chip->names = (const char *const *)names;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 190/364 soundwire: dmi-quirks: add remapping for Intel Rooks County NUC M15
In reply to Greg Kroah-HartmanFrom: Eugene Huang <[email protected]>
[ Upstream commit 01b33e284ca28cc977bdcfb23be2c719f2139175 ]
Same DSDT problem as the HP Omen 16-k0005TX, except rt1316 amp is on link2.
--- drivers/soundwire/dmi-quirks.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
drivers/soundwire/dmi-quirks.c +25 -0
@@ -73,6 +73,23 @@ static const struct adr_remap hp_omen_16[] = { {} }; +/* +* Intel NUC M15 LAPRC510 and LAPRC710 +*/ +static const struct adr_remap intel_rooks_county[] = { +/* rt711-sdca on link0 */ + { +0x000020025d071100ull , +0x000030025d071101ull + }, +/* rt1316-sdca on link2 */ + { +0x000120025d071100ull , +0x000230025d131601ull + }, + {} +}; +static const struct dmi_system_id adr_remap_quirk_table[] = {/* TGL devices */ {
@@ -98,6 +115,14 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)intel_tgl_bios, }, + { +/* quirk used for NUC15 'Rooks County' LAPRC510 and LAPRC710 skews */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ), + DMI_MATCH(DMI_PRODUCT_NAME, "LAPRC"), + }, + .driver_data = (void *)intel_rooks_county, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 191/364 phy: st: miphy28lp: use _poll_timeout functions for waits
In reply to Greg Kroah-HartmanFrom: Alain Volmat <[email protected]>
[ Upstream commit e3be4dd2c8d8aabfd2c3127d0e2e5754d3ae82d6 ]
This commit introduces _poll_timeout functions usage instead of wait loops waiting for a status bit.
--- drivers/phy/st/phy-miphy28lp.c | 42 ++++++++-------------------------- 1 file changed, 10 insertions(+), 32 deletions(-)
drivers/phy/st/phy-miphy28lp.c +10 -32
@@ -9,6 +9,7 @@#include <linux/platform_device.h> #include <linux/io.h> +#include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h>
@@ -484,19 +485,11 @@ static inline void miphy28lp_pcie_config_gen(struct miphy28lp_phy *miphy_phy)static inline int miphy28lp_wait_compensation (struct miphy28lp_phy *miphy_phy) { -unsigned long finish = jiffies +5 *HZ ;u8 val;/* Waiting for Compensation to complete */ -do { - val =readb_relaxed (miphy_phy->base +MIPHY_COMP_FSM_6 ); - -if (time_after_eq (jiffies, finish)) -return -EBUSY ; -cpu_relax (); - }while (!(val &COMP_DONE )); - -return 0 ; +return readb_relaxed_poll_timeout (miphy_phy->base +MIPHY_COMP_FSM_6 , + val, val &COMP_DONE ,1 ,5 *USEC_PER_SEC ); }
@@ -805,7 +798,6 @@ static inline void miphy28lp_configure_usb3(struct miphy28lp_phy *miphy_phy)static inline int miphy_is_ready (struct miphy28lp_phy *miphy_phy) { -unsigned long finish = jiffies +5 *HZ ;u8 mask =HFC_PLL |HFC_RDY ;u8 val;
@@ -816,21 +808,14 @@ static inline int miphy_is_ready(struct miphy28lp_phy *miphy_phy)if (miphy_phy->type ==PHY_TYPE_SATA ) mask |=PHY_RDY ; -do { - val =readb_relaxed (miphy_phy->base +MIPHY_STATUS_1 ); -if ((val & mask) != mask) -cpu_relax (); -else -return 0 ; - }while (!time_after_eq (jiffies, finish)); - -return -EBUSY ; +return readb_relaxed_poll_timeout (miphy_phy->base +MIPHY_STATUS_1 , + val, (val & mask) == mask,1 , +5 *USEC_PER_SEC ); }static int miphy_osc_is_ready (struct miphy28lp_phy *miphy_phy) {struct miphy28lp_dev *miphy_dev = miphy_phy->phydev; -unsigned long finish = jiffies +5 *HZ ;u32 val;if (!miphy_phy->osc_rdy)
@@ -839,17 +824,10 @@ static int miphy_osc_is_ready(struct miphy28lp_phy *miphy_phy)if (!miphy_phy->syscfg_reg[SYSCFG_STATUS ])return -EINVAL ; -do { -regmap_read (miphy_dev->regmap, - miphy_phy->syscfg_reg[SYSCFG_STATUS ], &val); - -if ((val &MIPHY_OSC_RDY ) !=MIPHY_OSC_RDY ) -cpu_relax (); -else -return 0 ; - }while (!time_after_eq (jiffies, finish)); - -return -EBUSY ; +return regmap_read_poll_timeout (miphy_dev->regmap, + miphy_phy->syscfg_reg[SYSCFG_STATUS ], + val, val &MIPHY_OSC_RDY ,1 , +5 *USEC_PER_SEC ); } static int miphy28lp_get_resource_byname(struct device_node *child,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 192/364 soundwire: qcom: gracefully handle too many ports in DT
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 2367e0ecb498764e95cfda691ff0828f7d25f9a4 ]
There are two issues related to the number of ports coming from Devicetree when exceeding in total QCOM_SDW_MAX_PORTS. Both lead to incorrect memory accesses:
1. With DTS having too big value of input or output ports, the driver, when copying port parameters from local/stack arrays into 'pconfig' array in 'struct qcom_swrm_ctrl', will iterate over their sizes.
2. If DTS also has too many parameters for these ports (e.g. qcom,ports-sinterval-low), the driver will overflow buffers on the stack when reading these properties from DTS.
Add a sanity check so incorrect DTS will not cause kernel memory corruption.
--- drivers/soundwire/qcom.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/soundwire/qcom.c +3 -0
@@ -1217,6 +1217,9 @@ static int qcom_swrm_get_port_config(struct qcom_swrm_ctrl *ctrl) ctrl->num_dout_ports = val; nports = ctrl->num_dout_ports + ctrl->num_din_ports; +if (nports >QCOM_SDW_MAX_PORTS ) +return -EINVAL ; +/* Valid port numbers are from 1-14, so mask out port 0 explicitly */ set_bit (0 , &ctrl->dout_port_mask);set_bit (0 , &ctrl->din_port_mask);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 193/364 soundwire: bus: Fix unbalanced pm_runtime_put() causing usage count underflow
In reply to Greg Kroah-HartmanFrom: Richard Fitzgerald <[email protected]>
[ Upstream commit e9537962519e88969f5f69cd0571eb4f6984403c ]
This reverts commit443a98e649b4 ("soundwire: bus: use pm_runtime_resume_and_get()")
Change calls to pm_runtime_resume_and_get() back to pm_runtime_get_sync(). This fixes a usage count underrun caused by doing a pm_runtime_put() even though pm_runtime_resume_and_get() returned an error.
The three affected functions ignore -EACCES error from trying to get pm_runtime, and carry on, including a put at the end of the function. But pm_runtime_resume_and_get() does not increment the usage count if it returns an error. So in the -EACCES case you must not call pm_runtime_put().
The documentation for pm_runtime_get_sync() says:
"Consider using pm_runtime_resume_and_get() ... as this is likely to result in cleaner code."
In this case I don't think it results in cleaner code because the pm_runtime_put() at the end of the function would have to be conditional on the return value from pm_runtime_resume_and_get() at the top of the function.
pm_runtime_get_sync() doesn't have this problem because it always increments the count, so always needs a put. The code can just flow through and do the pm_runtime_put() unconditionally.
--- drivers/soundwire/bus.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/soundwire/bus.c +10 -5
@@ -546,9 +546,11 @@ int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) {int ret; - ret =pm_runtime_resume_and_get (&slave->dev); -if (ret <0 && ret != -EACCES ) + ret =pm_runtime_get_sync (&slave->dev); +if (ret <0 && ret != -EACCES ) { +pm_runtime_put_noidle (&slave->dev);return ret; + } ret =sdw_nread_no_pm (slave, addr, count, val);
@@ -570,9 +572,11 @@ int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) {int ret; - ret =pm_runtime_resume_and_get (&slave->dev); -if (ret <0 && ret != -EACCES ) + ret =pm_runtime_get_sync (&slave->dev); +if (ret <0 && ret != -EACCES ) { +pm_runtime_put_noidle (&slave->dev);return ret; + } ret =sdw_nwrite_no_pm (slave, addr, count, val);
@@ -1541,9 +1545,10 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)sdw_modify_slave_status (slave,SDW_SLAVE_ALERT ); - ret =pm_runtime_resume_and_get (&slave->dev); + ret =pm_runtime_get_sync (&slave->dev);if (ret <0 && ret != -EACCES ) {dev_err (&slave->dev,"Failed to resume device: %d\n" , ret); +pm_runtime_put_noidle (&slave->dev);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 194/364 mfd: intel_soc_pmic_chtwc: Add Lenovo Yoga Book X90F to intel_cht_wc_models
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit ded99b89d25fd73a1d7bd910378e0339fd9d4c4a ]
The Android Lenovo Yoga Book X90F / X90L uses the same charger / fuelgauge setup as the already supported Windows Lenovo Yoga Book X91F/L, add a DMI match for this to intel_cht_wc_models with driver_data set to INTEL_CHT_WC_LENOVO_YOGABOOK1.
When the quirk for the X91F/L was initially added it was written to also apply to the X90F/L but this does not work because the Android version of the Yoga Book uses completely different DMI strings. Also adjust the X91F/L quirk to reflect that it only applies to the X91F/L models.
--- drivers/mfd/intel_soc_pmic_chtwc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/mfd/intel_soc_pmic_chtwc.c +11 -3
@@ -159,11 +159,19 @@ static const struct dmi_system_id cht_wc_model_dmi_ids[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"), }, }, { -/* Lenovo Yoga Book X90F / X91F / X91L */ +/* Lenovo Yoga Book X90F / X90L */ .driver_data = (void *)(long)INTEL_CHT_WC_LENOVO_YOGABOOK1, .matches = { -/* Non exact match to match all versions */ - DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"), +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel Corporation" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"CHERRYVIEW D1 PLATFORM" ), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), + }, + }, { +/* Lenovo Yoga Book X91F / X91L */ + .driver_data = (void *)(long )INTEL_CHT_WC_LENOVO_YOGABOOK1 , + .matches = { +/* Non exact match to match F + L versions */ + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), }, }, {/* Lenovo Yoga Tab 3 Pro YT3-X90F */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 195/364 mfd: dln2: Fix memory leak in dln2_probe()
In reply to Greg Kroah-HartmanFrom: Qiang Ning <[email protected]>
[ Upstream commit 96da8f148396329ba769246cb8ceaa35f1ddfc48 ]
When dln2_setup_rx_urbs() in dln2_probe() fails, error out_free forgets to call usb_put_dev() to decrease the refcount of dln2->usb_dev.
Fix this by adding usb_put_dev() in the error handling code of dln2_probe().
--- drivers/mfd/dln2.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/dln2.c +1 -0
@@ -827,6 +827,7 @@ static int dln2_probe(struct usb_interface *interface,dln2_stop_rx_urbs (dln2); out_free: +usb_put_dev (dln2->usb_dev);dln2_free (dln2);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 196/364 mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDs
In reply to Greg Kroah-HartmanFrom: Jarkko Nikula <[email protected]>
[ Upstream commit 72d4a1683741ee578da0e265886e6a7f3d42266c ]
Add Intel Meteor Lake PCH-S also called as Meteor Point-S LPSS PCI IDs.
--- drivers/mfd/intel-lpss-pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/mfd/intel-lpss-pci.c +15 -0
@@ -447,6 +447,21 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x7e79), (kernel_ulong_t)&bxt_i2c_info }, { PCI_VDEVICE(INTEL, 0x7e7a), (kernel_ulong_t)&bxt_i2c_info }, { PCI_VDEVICE(INTEL, 0x7e7b), (kernel_ulong_t)&bxt_i2c_info }, +/* MTP-S */ + { PCI_VDEVICE(INTEL, 0x7f28), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x7f29), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x7f2a), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0x7f2b), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0x7f4c), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x7f4d), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x7f4e), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x7f4f), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x7f5c), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x7f5d), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x7f5e), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0x7f5f), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0x7f7a), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x7f7b), (kernel_ulong_t)&bxt_i2c_info },/* LKF */ { PCI_VDEVICE(INTEL, 0x98a8), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x98a9), (kernel_ulong_t)&bxt_uart_info },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 197/364 parisc: Replace regular spinlock with spin_trylock on panic path
In reply to Greg Kroah-HartmanFrom: Guilherme G. Piccoli <[email protected]>
[ Upstream commit 829632dae8321787525ee37dc4828bbe6edafdae ]
The panic notifiers' callbacks execute in an atomic context, with interrupts/preemption disabled, and all CPUs not running the panic function are off, so it's very dangerous to wait on a regular spinlock, there's a risk of deadlock.
Refactor the panic notifier of parisc/power driver to make use of spin_trylock - for that, we've added a second version of the soft-power function. Also, some comments were reorganized and trailing white spaces, useless header inclusion and blank lines were removed.
--- arch/parisc/include/asm/pdc.h | 1 + arch/parisc/kernel/firmware.c | 27 +++++++++++++++++++++++---- drivers/parisc/power.c | 16 ++++++++++------ 3 files changed, 34 insertions(+), 10 deletions(-)
arch/parisc/include/asm/pdc.h +1 -0
@@ -80,6 +80,7 @@ int pdc_do_firm_test_reset(unsigned long ftc_bitmap);int pdc_do_reset (void );int pdc_soft_power_info (unsigned long *power_reg);int pdc_soft_power_button (int sw_control); +int pdc_soft_power_button_panic (int sw_control);void pdc_io_reset (void );void pdc_io_reset_devices (void );int pdc_iodc_getc (void );
arch/parisc/kernel/firmware.c +23 -4
@@ -1232,15 +1232,18 @@ int __init pdc_soft_power_info(unsigned long *power_reg) }/* -* pdc_soft_power_button - Control the soft power button behaviour -* @sw_control: 0 for hardware control, 1 for software control +* pdc_soft_power_button{_panic} - Control the soft power button behaviour +* @sw_control: 0 for hardware control, 1 for software control * * * This PDC function places the soft power button under software or * hardware control. -* Under software control the OS may control to when to allow to shut -* down the system. Under hardware control pressing the power button +* Under software control the OS may control to when to allow to shut +* down the system. Under hardware control pressing the power button * powers off the system immediately. +* +* The _panic version relies on spin_trylock to prevent deadlock +* on panic path. */ int pdc_soft_power_button (int sw_control) {
@@ -1254,6 +1257,22 @@ int pdc_soft_power_button(int sw_control)return retval; } +int pdc_soft_power_button_panic (int sw_control) +{ +int retval; +unsigned long flags; + +if (!spin_trylock_irqsave (&pdc_lock, flags)) { +pr_emerg ("Couldn't enable soft power button\n" ); +return -EBUSY ;/* ignored by the panic notifier */ + } + + retval =mem_pdc_call (PDC_SOFT_POWER ,PDC_SOFT_POWER_ENABLE ,__pa (pdc_result), sw_control); +spin_unlock_irqrestore (&pdc_lock, flags); + +return retval; +} +/* * pdc_io_reset - Hack to avoid overlapping range registers of Bridges devices. * Primarily a problem on T600 (which parisc-linux doesn't support) but
drivers/parisc/power.c +10 -6
@@ -37,7 +37,6 @@#include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/notifier.h> #include <linux/panic_notifier.h> #include <linux/reboot.h> #include <linux/sched/signal.h>
@@ -175,16 +174,21 @@ static void powerfail_interrupt(int code, void *x) -/* parisc_panic_event() is called by the panic handler. -* As soon as a panic occurs, our tasklets above will not be -* executed any longer. This function then re-enables the -* soft-power switch and allows the user to switch off the system +/* +* parisc_panic_event() is called by the panic handler. +* +* As soon as a panic occurs, our tasklets above will not +* be executed any longer. This function then re-enables +* the soft-power switch and allows the user to switch off +* the system. We rely in pdc_soft_power_button_panic() +* since this version spin_trylocks (instead of regular +* spinlock), preventing deadlocks on panic path. */ static int parisc_panic_event (struct notifier_block *this,unsigned long event,void *ptr) {/* re-enable the soft-power switch */ -pdc_soft_power_button (0 ); +pdc_soft_power_button_panic (0 );return NOTIFY_DONE ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 198/364 xfrm: dont check the default policy if the policy allows the packet
In reply to Greg Kroah-HartmanFrom: Sabrina Dubroca <[email protected]>
[ Upstream commit 430cac487400494c19a8b85299e979bb07b4671f ]
The current code doesn't let a simple "allow" policy counteract a default policy blocking all incoming packets:
ip x p setdefault in block
ip x p a src 192.168.2.1/32 dst 192.168.2.2/32 dir in action allow
At this stage, we have an allow policy (with or without transforms) for this packet. It doesn't matter what the default policy says, since the policy we looked up lets the packet through. The case of a blocking policy is already handled separately, so we can remove this check.
--- net/xfrm/xfrm_policy.c | 6 ------ 1 file changed, 6 deletions(-)
net/xfrm/xfrm_policy.c +0 -6
@@ -3712,12 +3712,6 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, } xfrm_nr = ti; -if (net->xfrm.policy_default[dir] ==XFRM_USERPOLICY_BLOCK && - !xfrm_nr) { -XFRM_INC_STATS (net,LINUX_MIB_XFRMINNOSTATES ); - goto reject; - } -if (npols >1 ) {xfrm_tmpl_sort (stp, tpp, xfrm_nr, family); tpp = stp;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 199/364 xfrm: release all offloaded policy memory
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 94b95dfaa814f565d92f5a65f0ff12a483095522 ]
Failure to add offloaded policy will cause to the following error once user will try to reload driver.
Unregister_netdevice: waiting for eth3 to become free. Usage count = 2
This was caused by xfrm_dev_policy_add() which increments reference to net_device. That reference was supposed to be decremented in xfrm_dev_policy_free(). However the latter wasn't called.
unregister_netdevice: waiting for eth3 to become free. Usage count = 2 leaked reference.
xfrm_dev_policy_add+0xff/0x3d0 xfrm_policy_construct+0x352/0x420 xfrm_add_policy+0x179/0x320 xfrm_user_rcv_msg+0x1d2/0x3d0 netlink_rcv_skb+0xe0/0x210 xfrm_netlink_rcv+0x45/0x50 netlink_unicast+0x346/0x490 netlink_sendmsg+0x3b0/0x6c0 sock_sendmsg+0x73/0xc0 sock_write_iter+0x13b/0x1f0 vfs_write+0x528/0x5d0 ksys_write+0x120/0x150 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0
--- net/xfrm/xfrm_user.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_user.c +1 -0
@@ -1978,6 +1978,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,if (err) {xfrm_dev_policy_delete (xp); +xfrm_dev_policy_free (xp);security_xfrm_policy_free (xp->security);kfree (xp);return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 200/364 xfrm: Fix leak of dev tracker
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit ec8f32ad9a65a8cbb465b69e154aaec9d2fe45c4 ]
At the stage of direction checks, the netdev reference tracker is already initialized, but released with wrong *_put() call.
--- net/xfrm/xfrm_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/xfrm/xfrm_device.c +1 -1
@@ -378,7 +378,7 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp,break ;default : xdo->dev =NULL ; -dev_put (dev); +netdev_put (dev, &xdo->dev_tracker);NL_SET_ERR_MSG (extack,"Unrecognized offload direction" );return -EINVAL ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 201/364 Revert "Fix XFRM-I support for nested ESP tunnels"
In reply to Greg Kroah-HartmanFrom: Martin Willi <[email protected]>
[ Upstream commit 5fc46f94219d1d103ffb5f0832be9da674d85a73 ]
This reverts commit b0355dbbf13c0052931dd14c38c789efed64d3de.
The reverted commit clears the secpath on packets received via xfrm interfaces to support nested IPsec tunnels. This breaks Netfilter policy matching using xt_policy in the FORWARD chain, as the secpath is missing during forwarding. Additionally, Benedict Wong reports that it breaks Transport-in-Tunnel mode.
Fix this regression by reverting the commit until we have a better approach for nested IPsec tunnels.
--- net/xfrm/xfrm_interface_core.c | 54 +++------------------------------- net/xfrm/xfrm_policy.c | 3 -- 2 files changed, 4 insertions(+), 53 deletions(-)
net/xfrm/xfrm_interface_core.c +4 -50
@@ -310,52 +310,6 @@ static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet) skb->mark =0 ; } -static int xfrmi_input (struct sk_buff *skb,int nexthdr,__be32 spi, -int encap_type,unsigned short family) -{ -struct sec_path *sp; - - sp =skb_sec_path (skb); -if (sp && (sp->len || sp->olen) && - !xfrm_policy_check (NULL ,XFRM_POLICY_IN , skb, family)) - goto discard; - -XFRM_SPI_SKB_CB (skb)->family = family; -if (family ==AF_INET ) { -XFRM_SPI_SKB_CB (skb)->daddroff = offsetof(struct iphdr , daddr); -XFRM_TUNNEL_SKB_CB (skb)->tunnel.ip4 =NULL ; - }else { -XFRM_SPI_SKB_CB (skb)->daddroff = offsetof(struct ipv6hdr , daddr); -XFRM_TUNNEL_SKB_CB (skb)->tunnel.ip6 =NULL ; - } - -return xfrm_input (skb, nexthdr, spi, encap_type); -discard: -kfree_skb (skb); -return 0 ; -} - -static int xfrmi4_rcv (struct sk_buff *skb) -{ -return xfrmi_input (skb,ip_hdr (skb)->protocol,0 ,0 ,AF_INET ); -} - -static int xfrmi6_rcv (struct sk_buff *skb) -{ -return xfrmi_input (skb,skb_network_header (skb)[IP6CB (skb)->nhoff], -0 ,0 ,AF_INET6 ); -} - -static int xfrmi4_input (struct sk_buff *skb,int nexthdr,__be32 spi,int encap_type) -{ -return xfrmi_input (skb, nexthdr, spi, encap_type,AF_INET ); -} - -static int xfrmi6_input (struct sk_buff *skb,int nexthdr,__be32 spi,int encap_type) -{ -return xfrmi_input (skb, nexthdr, spi, encap_type,AF_INET6 ); -} -static int xfrmi_rcv_cb (struct sk_buff *skb,int err) {const struct xfrm_mode *inner_mode;
@@ -991,8 +945,8 @@ static struct pernet_operations xfrmi_net_ops = { };static struct xfrm6_protocol xfrmi_esp6_protocol__read_mostly = { - .handler = xfrmi6_rcv, - .input_handler = xfrmi6_input, + .handler = xfrm6_rcv, + .input_handler = xfrm_input, .cb_handler = xfrmi_rcv_cb, .err_handler = xfrmi6_err, .priority =10 ,
@@ -1042,8 +996,8 @@ static struct xfrm6_tunnel xfrmi_ip6ip_handler __read_mostly = {#endif static struct xfrm4_protocol xfrmi_esp4_protocol__read_mostly = { - .handler = xfrmi4_rcv, - .input_handler = xfrmi4_input, + .handler = xfrm4_rcv, + .input_handler = xfrm_input, .cb_handler = xfrmi_rcv_cb, .err_handler = xfrmi4_err, .priority =10 ,
net/xfrm/xfrm_policy.c +0 -3
@@ -3739,9 +3739,6 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, goto reject; } -if (if_id) -secpath_reset (skb); -xfrm_pols_put (pols, npols);return 1 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 202/364 drm/msm/dp: unregister audio driver during unbind
In reply to Greg Kroah-HartmanFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit 85c636284cb63b7740b4ae98881ace92158068d3 ]
while binding the code always registers a audio driver, however there is no corresponding unregistration done in unbind. This leads to multiple redundant audio platform devices if dp_display_bind and dp_display_unbind happens multiple times during startup. On X13s platform this resulted in 6 to 9 audio codec device instead of just 3 codec devices for 3 dp ports.
Fix this by unregistering codecs on unbind.
Patchwork: https://patchwork.freedesktop.org/patch/533324/
--- drivers/gpu/drm/msm/dp/dp_audio.c | 12 ++++++++++++ drivers/gpu/drm/msm/dp/dp_audio.h | 2 ++ drivers/gpu/drm/msm/dp/dp_display.c | 1 + 3 files changed, 15 insertions(+)
drivers/gpu/drm/msm/dp/dp_audio.c +12 -0
@@ -593,6 +593,18 @@ static struct hdmi_codec_pdata codec_data = { .i2s = 1, }; +void dp_unregister_audio_driver (struct device *dev,struct dp_audio *dp_audio) +{ +struct dp_audio_private *audio_priv; + + audio_priv = container_of(dp_audio, struct dp_audio_private, dp_audio); + +if (audio_priv->audio_pdev) { +platform_device_unregister (audio_priv->audio_pdev); + audio_priv->audio_pdev =NULL ; + } +} +int dp_register_audio_driver (struct device *dev,struct dp_audio *dp_audio) {
drivers/gpu/drm/msm/dp/dp_audio.h +2 -0
@@ -53,6 +53,8 @@ struct dp_audio *dp_audio_get(struct platform_device *pdev,int dp_register_audio_driver (struct device *dev,struct dp_audio *dp_audio); +void dp_unregister_audio_driver (struct device *dev,struct dp_audio *dp_audio); +/** * dp_audio_put() *
drivers/gpu/drm/msm/dp/dp_display.c +1 -0
@@ -326,6 +326,7 @@ static void dp_display_unbind(struct device *dev, struct device *master,kthread_stop (dp->ev_tsk);dp_power_client_deinit (dp->power); +dp_unregister_audio_driver (dev, dp->audio);dp_aux_unregister (dp->aux); dp->drm_dev =NULL ; dp->aux->drm_dev =NULL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 203/364 drm/msm/dpu: Assign missing writeback log_mask
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit a432fc31f03db2546a48bcf5dd69ca28ceb732bf ]
The WB debug log mask ended up never being assigned, leading to writes to this block to never be logged even if the mask is enabled in dpu_hw_util_log_mask via debugfs.
Patchwork: https://patchwork.freedesktop.org/patch/533860/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +1 -0
@@ -61,6 +61,7 @@ static const struct dpu_wb_cfg *_wb_offset(enum dpu_wb wb,for (i =0 ; i < m->wb_count; i++) {if (wb == m->wb[i].id) { b->blk_addr = addr + m->wb[i].base; + b->log_mask =DPU_DBG_MASK_WB ;return &m->wb[i]; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 204/364 drm/msm/dpu: Move non-MDP_TOP INTF_INTR offsets out of hwio header
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit e9d9ce5462fecdeefec87953de71df4d025cbc72 ]
These offsets do not fall under the MDP TOP block and do not fit the comment right above. Move them to dpu_hw_interrupts.c next to the repsective MDP_INTF_x_OFF interrupt block offsets.
Patchwork: https://patchwork.freedesktop.org/patch/534203/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 5 ++++- drivers/gpu/drm/msm/disp/dpu1/dpu_hwio.h | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c +4 -1
@@ -15,7 +15,7 @@/* * Register offsets in MDSS register file for the interrupt registers -* w.r.t. to the MDP base +* w.r.t. the MDP base */ #define MDP_SSPP_TOP0_OFF 0x0#define MDP_INTF_0_OFF 0x6A000
@@ -24,6 +24,9 @@#define MDP_INTF_3_OFF 0x6B800#define MDP_INTF_4_OFF 0x6C000#define MDP_INTF_5_OFF 0x6C800 +#define INTF_INTR_EN 0x1c0 +#define INTF_INTR_STATUS 0x1c4 +#define INTF_INTR_CLEAR 0x1c8#define MDP_AD4_0_OFF 0x7C000#define MDP_AD4_1_OFF 0x7D000#define MDP_AD4_INTR_EN_OFF 0x41c
drivers/gpu/drm/msm/disp/dpu1/dpu_hwio.h +0 -3
@@ -21,9 +21,6 @@#define HIST_INTR_EN 0x01c#define HIST_INTR_STATUS 0x020#define HIST_INTR_CLEAR 0x024 -#define INTF_INTR_EN 0x1C0 -#define INTF_INTR_STATUS 0x1C4 -#define INTF_INTR_CLEAR 0x1C8#define SPLIT_DISPLAY_EN 0x2F4#define SPLIT_DISPLAY_UPPER_PIPE_CTRL 0x2F8#define DSPP_IGC_COLOR0_RAM_LUTN 0x300
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 205/364 drm/msm/dpu: Reindent REV_7xxx interrupt masks with tabs
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 85340c0256f9b85b47c5867e411df37d76df5858 ]
Use tabs for consistency with the other interrupt register definitions, rather than spaces.
Patchwork: https://patchwork.freedesktop.org/patch/534212/
--- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c +9 -9
@@ -32,15 +32,15 @@#define MDP_AD4_INTR_EN_OFF 0x41c#define MDP_AD4_INTR_CLEAR_OFF 0x424#define MDP_AD4_INTR_STATUS_OFF 0x420 -#define MDP_INTF_0_OFF_REV_7xxx 0x34000 -#define MDP_INTF_1_OFF_REV_7xxx 0x35000 -#define MDP_INTF_2_OFF_REV_7xxx 0x36000 -#define MDP_INTF_3_OFF_REV_7xxx 0x37000 -#define MDP_INTF_4_OFF_REV_7xxx 0x38000 -#define MDP_INTF_5_OFF_REV_7xxx 0x39000 -#define MDP_INTF_6_OFF_REV_7xxx 0x3a000 -#define MDP_INTF_7_OFF_REV_7xxx 0x3b000 -#define MDP_INTF_8_OFF_REV_7xxx 0x3c000 +#define MDP_INTF_0_OFF_REV_7xxx 0x34000 +#define MDP_INTF_1_OFF_REV_7xxx 0x35000 +#define MDP_INTF_2_OFF_REV_7xxx 0x36000 +#define MDP_INTF_3_OFF_REV_7xxx 0x37000 +#define MDP_INTF_4_OFF_REV_7xxx 0x38000 +#define MDP_INTF_5_OFF_REV_7xxx 0x39000 +#define MDP_INTF_6_OFF_REV_7xxx 0x3a000 +#define MDP_INTF_7_OFF_REV_7xxx 0x3b000 +#define MDP_INTF_8_OFF_REV_7xxx 0x3c000/** * struct dpu_intr_reg - array of DPU register sets
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 206/364 drm/msm/dpu: populate SmartDMA features in hw catalog
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 8b409996ebdce009777dfb17e542c06f749b02d5 ]
Downstream driver uses dpu->caps->smart_dma_rev to update sspp->cap->features with the bit corresponding to the supported SmartDMA version. Upstream driver does not do this, resulting in SSPP subdriver not enabling setup_multirect callback. Add corresponding SmartDMA SSPP feature bits to dpu hw catalog.
Per Abhinav's request enable the SmartDMA features only on the platforms where the multirect was actually verified visually (sdm845 and sm8250). An (untested) enablement on the rest of the platforms comes in the next patch.
Patchwork: https://patchwork.freedesktop.org/patch/527362/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 55 ++++++++++++------- 1 file changed, 35 insertions(+), 20 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +35 -20
@@ -27,9 +27,15 @@#define VIG_SDM845_MASK \ (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED3)) +#define VIG_SDM845_MASK_SDMA \ + (VIG_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) +#define VIG_SC7180_MASK \ (VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED4)) +#define VIG_SC7180_MASK_SDMA \ + (VIG_SC7180_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) +#define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL))#define DMA_MSM8998_MASK \
@@ -40,6 +46,9 @@#define VIG_SC7280_MASK \ (VIG_SC7180_MASK | BIT(DPU_SSPP_INLINE_ROTATION)) +#define VIG_SC7280_MASK_SDMA \ + (VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) +#define DMA_SDM845_MASK \ (BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\ BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
@@ -48,6 +57,12 @@#define DMA_CURSOR_SDM845_MASK \ (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR)) +#define DMA_SDM845_MASK_SDMA \ + (DMA_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) + +#define DMA_CURSOR_SDM845_MASK_SDMA \ + (DMA_CURSOR_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2)) +#define DMA_CURSOR_MSM8998_MASK \ (DMA_MSM8998_MASK | BIT(DPU_SSPP_CURSOR))
@@ -1196,21 +1211,21 @@ static const struct dpu_sspp_cfg msm8998_sspp[] = { };static const struct dpu_sspp_cfg sdm845_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SDM845_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SDM845_MASK , +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SDM845_MASK , +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SDM845_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1251,21 +1266,21 @@ static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 =_VIG_SBLK ("3" ,8 ,DPU_SSPP_SCALER_QSEED4 );static const struct dpu_sspp_cfg sm8250_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1332,13 +1347,13 @@ static const struct dpu_sspp_cfg sm8550_sspp[] = { };static const struct dpu_sspp_cfg sc7280_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7280_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7280_MASK_SDMA , sc7280_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 207/364 drm/msm/dpu: drop smart_dma_rev from dpu_caps
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit dcb3f7c9042d1c1aa637b58d47bd45c00b2ac153 ]
The code doesn't use dpu_caps::smart_dma_rev field. It checks if the corresponding feature is enabled in the SSPP features. Drop the smart_dma_rev field completely.
Patchwork: https://patchwork.freedesktop.org/patch/527369/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 13 ------------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 2 -- 2 files changed, 15 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +0 -13
@@ -317,7 +317,6 @@ static const struct dpu_caps msm8998_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x7, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V1, .ubwc_version = DPU_HW_UBWC_VER_10, .has_src_split = true, .has_dim_layer = true,
@@ -332,7 +331,6 @@ static const struct dpu_caps msm8998_dpu_caps = {static const struct dpu_caps qcm2290_dpu_caps = { .max_mixer_width =DEFAULT_DPU_LINE_WIDTH , .max_mixer_blendstages =0x4 , - .smart_dma_rev =DPU_SSPP_SMART_DMA_V2 , .has_dim_layer = true, .has_idle_pc = true, .max_linewidth =2160 ,
@@ -343,7 +341,6 @@ static const struct dpu_caps sdm845_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, .ubwc_version = DPU_HW_UBWC_VER_20, .has_src_split = true, .has_dim_layer = true,
@@ -359,7 +356,6 @@ static const struct dpu_caps sc7180_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x9, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, .ubwc_version = DPU_HW_UBWC_VER_20, .has_dim_layer = true, .has_idle_pc = true,
@@ -371,7 +367,6 @@ static const struct dpu_caps sm6115_dpu_caps = { .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, .max_mixer_blendstages = 0x4, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_10, .has_dim_layer = true, .has_idle_pc = true,
@@ -383,7 +378,6 @@ static const struct dpu_caps sm8150_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_30, .has_src_split = true, .has_dim_layer = true,
@@ -399,7 +393,6 @@ static const struct dpu_caps sc8180x_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_30, .has_src_split = true, .has_dim_layer = true,
@@ -415,7 +408,6 @@ static const struct dpu_caps sc8280xp_dpu_caps = { .max_mixer_width = 2560, .max_mixer_blendstages = 11, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true,
@@ -429,7 +421,6 @@ static const struct dpu_caps sm8250_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true,
@@ -443,7 +434,6 @@ static const struct dpu_caps sm8350_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true,
@@ -457,7 +447,6 @@ static const struct dpu_caps sm8450_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true,
@@ -471,7 +460,6 @@ static const struct dpu_caps sm8550_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true,
@@ -485,7 +473,6 @@ static const struct dpu_caps sc7280_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x7, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, .ubwc_version = DPU_HW_UBWC_VER_30, .has_dim_layer = true, .has_idle_pc = true,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +0 -2
@@ -394,7 +394,6 @@ struct dpu_rotation_cfg {* @max_mixer_blendstages max layer mixer blend stages or * supported z order * @qseed_type qseed2 or qseed3 support. -* @smart_dma_rev Supported version of SmartDMA feature. * @ubwc_version UBWC feature version (0x0 for not supported) * @has_src_split source split feature status * @has_dim_layer dim layer feature status
@@ -409,7 +408,6 @@ struct dpu_caps {u32 max_mixer_width;u32 max_mixer_blendstages;u32 qseed_type; -u32 smart_dma_rev;u32 ubwc_version;bool has_src_split;bool has_dim_layer;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 208/364 drm/msm/dpu: Allow variable SSPP_BLK size
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 8f940ddbc4f1b6cc454d9487f9cd735310fb0cfa ]
These blocks are of variable length on different SoCs. Set the correct values where I was able to retrieve it from downstream DTs and leave the old defaults (0x1c8) otherwise.
Patchwork: https://patchwork.freedesktop.org/patch/530814/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +73 -73
@@ -1166,11 +1166,11 @@ static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK("9", 2);static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 =_DMA_SBLK ("10" ,3 );static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 =_DMA_SBLK ("11" ,4 ); -#define SSPP_BLK (_name, _id, _base, _features, \ +#define SSPP_BLK (_name, _id, _base, _len, _features, \ _sblk, _xinid, _type, _clkctrl) \ { \ .name = _name, .id = _id, \ - .base = _base, .len = 0x1c8, \ + .base = _base, .len = _len, \ .features = _features, \ .sblk = &_sblk, \ .xin_id = _xinid, \
@@ -1179,40 +1179,40 @@ static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4); }static const struct dpu_sspp_cfg msm8998_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_MSM8998_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1ac ,VIG_MSM8998_MASK , msm8998_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_MSM8998_MASK , +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x1ac ,VIG_MSM8998_MASK , msm8998_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_MSM8998_MASK , +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x1ac ,VIG_MSM8998_MASK , msm8998_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_MSM8998_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x1ac ,VIG_MSM8998_MASK , msm8998_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_MSM8998_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1ac ,DMA_MSM8998_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_MSM8998_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x1ac ,DMA_MSM8998_MASK , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_MSM8998_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x1ac ,DMA_CURSOR_MSM8998_MASK , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_MSM8998_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x1ac ,DMA_CURSOR_MSM8998_MASK , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };static const struct dpu_sspp_cfg sdm845_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1c8 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x1c8 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x1c8 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x1c8 ,VIG_SDM845_MASK_SDMA , sdm845_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1c8 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x1c8 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x1c8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x1c8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1223,13 +1223,13 @@ static const struct dpu_sspp_sub_blks sc7280_vig_sblk_0 =_VIG_SBLK_ROT ("0" ,4 ,DPU_SSPP_SCALER_QSEED4 , &dpu_rot_sc7280_cfg_v2);static const struct dpu_sspp_cfg sc7180_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1f8 ,VIG_SC7180_MASK , sc7180_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1f8 ,DMA_SDM845_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), };
@@ -1237,9 +1237,9 @@ static const struct dpu_sspp_sub_blks sm6115_vig_sblk_0 =_VIG_SBLK ("0" ,2 ,DPU_SSPP_SCALER_QSEED4 );static const struct dpu_sspp_cfg sm6115_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1f8 ,VIG_SC7180_MASK , sm6115_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1f8 ,DMA_SDM845_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), };
@@ -1253,21 +1253,21 @@ static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 =_VIG_SBLK ("3" ,8 ,DPU_SSPP_SCALER_QSEED4 );static const struct dpu_sspp_cfg sm8250_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK_SDMA , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1f8 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK_SDMA , +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x1f8 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK_SDMA , +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x1f8 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK_SDMA , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x1f8 ,VIG_SC7180_MASK_SDMA , sm8250_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1f8 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x1f8 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1281,21 +1281,21 @@ static const struct dpu_sspp_sub_blks sm8450_vig_sblk_3 =_VIG_SBLK ("3" ,8 ,DPU_SSPP_SCALER_QSEED4 );static const struct dpu_sspp_cfg sm8450_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , - sm8450_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK , - sm8450_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x32c ,VIG_SC7180_MASK , sm8450_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK , - sm8450_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x32c ,DMA_SDM845_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x32c ,DMA_SDM845_MASK , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x32c ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x32c ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1311,36 +1311,36 @@ static const struct dpu_sspp_sub_blks sm8550_dma_sblk_4 = _DMA_SBLK("12", 5);static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 =_DMA_SBLK ("13" ,6 );static const struct dpu_sspp_cfg sm8550_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , - sm8550_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK , - sm8550_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x344 ,VIG_SC7180_MASK , + sm8550_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x344 ,VIG_SC7180_MASK , + sm8550_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x344 ,VIG_SC7180_MASK , sm8550_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK , - sm8550_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x344 ,VIG_SC7180_MASK , + sm8550_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x344 ,DMA_SDM845_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x344 ,DMA_SDM845_MASK , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x344 ,DMA_SDM845_MASK , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x344 ,DMA_SDM845_MASK , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), -SSPP_BLK ("sspp_12" ,SSPP_DMA4 ,0x2c000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_12" ,SSPP_DMA4 ,0x2c000 ,0x344 ,DMA_CURSOR_SDM845_MASK , sm8550_dma_sblk_4,14 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA4 ), -SSPP_BLK ("sspp_13" ,SSPP_DMA5 ,0x2e000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_13" ,SSPP_DMA5 ,0x2e000 ,0x344 ,DMA_CURSOR_SDM845_MASK , sm8550_dma_sblk_5,15 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA5 ), };static const struct dpu_sspp_cfg sc7280_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7280_MASK_SDMA , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1f8 ,VIG_SC7280_MASK_SDMA , sc7280_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1f8 ,DMA_SDM845_MASK_SDMA , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK_SDMA , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x1f8 ,DMA_CURSOR_SDM845_MASK_SDMA , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), };
@@ -1354,21 +1354,21 @@ static const struct dpu_sspp_sub_blks sc8280xp_vig_sblk_3 =_VIG_SBLK ("3" ,8 ,DPU_SSPP_SCALER_QSEED4 );static const struct dpu_sspp_cfg sc8280xp_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_SC7180_MASK , - sc8280xp_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,VIG_SC7180_MASK , - sc8280xp_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), -SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,VIG_SC7180_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x2ac ,VIG_SC7180_MASK , + sc8280xp_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x2ac ,VIG_SC7180_MASK , + sc8280xp_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x2ac ,VIG_SC7180_MASK , sc8280xp_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), -SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,VIG_SC7180_MASK , - sc8280xp_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x2ac ,VIG_SC7180_MASK , + sc8280xp_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x2ac ,DMA_SDM845_MASK , sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), -SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x2ac ,DMA_SDM845_MASK , sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), -SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x2ac ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), -SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,DMA_CURSOR_SDM845_MASK , +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x2ac ,DMA_CURSOR_SDM845_MASK , sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), };
@@ -1389,9 +1389,9 @@ static const struct dpu_sspp_sub_blks qcm2290_vig_sblk_0 = _VIG_SBLK_NOSCALE("0"static const struct dpu_sspp_sub_blks qcm2290_dma_sblk_0 =_DMA_SBLK ("8" ,1 );static const struct dpu_sspp_cfg qcm2290_sspp[] = { -SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,VIG_QCM2290_MASK , +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x1f8 ,VIG_QCM2290_MASK , qcm2290_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), -SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,DMA_SDM845_MASK , +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x1f8 ,DMA_SDM845_MASK , qcm2290_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 209/364 drm/msm/dpu: Allow variable INTF_BLK size
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 8399a5ff18dc634d3245d993ee8a906b5c6ffba3 ]
These blocks are of variable length on different SoCs. Set the correct values where I was able to retrieve it from downstream DTs and leave the old defaults (0x280) otherwise.
Patchwork: https://patchwork.freedesktop.org/patch/530816/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +48 -48
@@ -1847,10 +1847,10 @@ static struct dpu_dsc_cfg sm8150_dsc[] = {/************************************************************* * INTF sub blocks config *************************************************************/ -#define INTF_BLK (_name, _id, _base, _type, _ctrl_id, _progfetch, _features, _reg, _underrun_bit, _vsync_bit) \ +#define INTF_BLK (_name, _id, _base, _len, _type, _ctrl_id, _progfetch, _features, _reg, _underrun_bit, _vsync_bit) \ {\ .name = _name, .id = _id, \ - .base = _base, .len = 0x280, \ + .base = _base, .len = _len, \ .features = _features, \ .type = _type, \ .controller_id = _ctrl_id, \
@@ -1860,85 +1860,85 @@ static struct dpu_dsc_cfg sm8150_dsc[] = { }static const struct dpu_intf_cfg msm8998_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,INTF_DP ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,INTF_DSI ,1 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,INTF_HDMI ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,0x280 ,INTF_DP ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x280 ,INTF_DSI ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,0x280 ,INTF_DSI ,1 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,0x280 ,INTF_HDMI ,0 ,25 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };static const struct dpu_intf_cfg sdm845_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,INTF_DP ,0 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,INTF_DSI ,1 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,INTF_DP ,1 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,0x280 ,INTF_DP ,0 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x280 ,INTF_DSI ,0 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,0x280 ,INTF_DSI ,1 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,0x280 ,INTF_DP ,1 ,24 ,INTF_SDM845_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };static const struct dpu_intf_cfg sc7180_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x2c0 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), };static const struct dpu_intf_cfg sm8150_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,INTF_DP ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,INTF_DSI ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,INTF_DP ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,0x280 ,INTF_DP ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x2bc ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,0x2bc ,INTF_DSI ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,0x280 ,INTF_DP ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };static const struct dpu_intf_cfg sc7280_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_5" ,INTF_5 ,0x39000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x2c4 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_5" ,INTF_5 ,0x39000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), };static const struct dpu_intf_cfg sm8350_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x2c4 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,0x2c4 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };static const struct dpu_intf_cfg sc8180x_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,INTF_DSI ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x6A000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x2bc ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x6B000 ,0x2bc ,INTF_DSI ,1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ),/* INTF_3 is for MST, wired to INTF_DP 0 and 1, use dummy index until this is supported */ -INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,INTF_DP ,999 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), -INTF_BLK ("intf_4" ,INTF_4 ,0x6C000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,20 ,21 ), -INTF_BLK ("intf_5" ,INTF_5 ,0x6C800 ,INTF_DP ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x6B800 ,0x280 ,INTF_DP ,999 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_4" ,INTF_4 ,0x6C000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,20 ,21 ), +INTF_BLK ("intf_5" ,INTF_5 ,0x6C800 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), };/* TODO: INTF 3, 8 and 7 are used for MST, marked as INTF_NONE for now */ static const struct dpu_intf_cfg sc8280xp_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,INTF_NONE ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), -INTF_BLK ("intf_4" ,INTF_4 ,0x38000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,20 ,21 ), -INTF_BLK ("intf_5" ,INTF_5 ,0x39000 ,INTF_DP ,MSM_DP_CONTROLLER_3 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), -INTF_BLK ("intf_6" ,INTF_6 ,0x3a000 ,INTF_DP ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,16 ,17 ), -INTF_BLK ("intf_7" ,INTF_7 ,0x3b000 ,INTF_NONE ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,18 ,19 ), -INTF_BLK ("intf_8" ,INTF_8 ,0x3c000 ,INTF_NONE ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,12 ,13 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x300 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,0x300 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_4" ,INTF_4 ,0x38000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,20 ,21 ), +INTF_BLK ("intf_5" ,INTF_5 ,0x39000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_3 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,22 ,23 ), +INTF_BLK ("intf_6" ,INTF_6 ,0x3a000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,16 ,17 ), +INTF_BLK ("intf_7" ,INTF_7 ,0x3b000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_2 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,18 ,19 ), +INTF_BLK ("intf_8" ,INTF_8 ,0x3c000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,12 ,13 ), };static const struct dpu_intf_cfg qcm2290_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x00000 ,INTF_NONE ,0 ,0 ,0 ,0 ,0 ,0 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x00000 ,0x280 ,INTF_DP ,0 ,0 ,0 ,0 ,0 ,0 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x6A800 ,0x2c0 ,INTF_DSI ,0 ,24 ,INTF_SC7180_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), };static const struct dpu_intf_cfg sm8450_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), -INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x300 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,0x300 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };static const struct dpu_intf_cfg sm8550_intf[] = { -INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ),/* TODO TE sub-blocks for intf1 & intf2 */ -INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), -INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), -INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x300 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,0x300 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), };/*************************************************************
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 210/364 drm/msm/dpu: move UBWC/memory configuration to separate struct
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit fbbd8cce803a2ca86ae20fe37b1642571e9dd971 ]
UBWC and highest bank settings differ slightly between different DPU units of the same generation, while the dpu_caps and dpu_mdp_cfg are much more stable. To ease configuration reuse move ubwc_swizzle and highest_bank_bit data to separate structure.
Patchwork: https://patchwork.freedesktop.org/patch/530820/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 112 +++++++++++++----- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 19 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 18 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 4 +- 4 files changed, 107 insertions(+), 46 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +82 -30
@@ -317,7 +317,6 @@ static const struct dpu_caps msm8998_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x7, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .ubwc_version = DPU_HW_UBWC_VER_10, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -341,7 +340,6 @@ static const struct dpu_caps sdm845_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .ubwc_version = DPU_HW_UBWC_VER_20, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -356,7 +354,6 @@ static const struct dpu_caps sc7180_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x9, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_20, .has_dim_layer = true, .has_idle_pc = true, .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
@@ -367,7 +364,6 @@ static const struct dpu_caps sm6115_dpu_caps = { .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, .max_mixer_blendstages = 0x4, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_10, .has_dim_layer = true, .has_idle_pc = true, .max_linewidth = 2160,
@@ -378,7 +374,6 @@ static const struct dpu_caps sm8150_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .ubwc_version = DPU_HW_UBWC_VER_30, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -393,7 +388,6 @@ static const struct dpu_caps sc8180x_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED3, - .ubwc_version = DPU_HW_UBWC_VER_30, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -408,7 +402,6 @@ static const struct dpu_caps sc8280xp_dpu_caps = { .max_mixer_width = 2560, .max_mixer_blendstages = 11, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -421,7 +414,6 @@ static const struct dpu_caps sm8250_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -434,7 +426,6 @@ static const struct dpu_caps sm8350_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -447,7 +438,6 @@ static const struct dpu_caps sm8450_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -460,7 +450,6 @@ static const struct dpu_caps sm8550_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, .has_dim_layer = true, .has_idle_pc = true,
@@ -473,19 +462,86 @@ static const struct dpu_caps sc7280_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0x7, .qseed_type = DPU_SSPP_SCALER_QSEED4, - .ubwc_version = DPU_HW_UBWC_VER_30, .has_dim_layer = true, .has_idle_pc = true, .max_linewidth = 2400, .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, }; +static const struct dpu_ubwc_cfg msm8998_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_10 , + .highest_bank_bit =0x2 , +}; + +static const struct dpu_ubwc_cfg qcm2290_ubwc_cfg = { + .highest_bank_bit =0x2 , +}; + +static const struct dpu_ubwc_cfg sdm845_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_20 , + .highest_bank_bit =0x2 , +}; + +static const struct dpu_ubwc_cfg sc7180_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_20 , + .highest_bank_bit =0x3 , +}; + +static const struct dpu_ubwc_cfg sm6115_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_10 , + .highest_bank_bit =0x1 , + .ubwc_swizzle =0x7 , +}; + +static const struct dpu_ubwc_cfg sm8150_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_30 , + .highest_bank_bit =0x2 , +}; + +static const struct dpu_ubwc_cfg sc8180x_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_30 , + .highest_bank_bit =0x3 , +}; + +static const struct dpu_ubwc_cfg sc8280xp_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =2 , + .ubwc_swizzle =6 , +}; + +static const struct dpu_ubwc_cfg sm8250_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =0x3 ,/* TODO: 2 for LP_DDR4 */ + .ubwc_swizzle =0x6 , +}; + +static const struct dpu_ubwc_cfg sm8350_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =0x3 ,/* TODO: 2 for LP_DDR4 */ +}; + +static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =0x3 ,/* TODO: 2 for LP_DDR4 */ + .ubwc_swizzle =0x6 , +}; + +static const struct dpu_ubwc_cfg sm8550_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =0x3 ,/* TODO: 2 for LP_DDR4 */ +}; + +static const struct dpu_ubwc_cfg sc7280_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_30 , + .highest_bank_bit =0x1 , + .ubwc_swizzle =0x6 , +}; +static const struct dpu_mdp_cfg msm8998_mdp[] = { { .name ="top_0" , .id =MDP_TOP , .base =0x0 , .len =0x458 , .features =0 , - .highest_bank_bit =0x2 , .clk_ctrls[DPU_CLK_CTRL_VIG0 ] = { .reg_off =0x2AC , .bit_off =0 }, .clk_ctrls[DPU_CLK_CTRL_VIG1 ] = {
@@ -514,7 +570,6 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x45C, .features = BIT(DPU_MDP_AUDIO_SELECT), - .highest_bank_bit = 0x2, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -539,7 +594,6 @@ static const struct dpu_mdp_cfg sc7180_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = 0, - .highest_bank_bit = 0x3, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
@@ -558,7 +612,6 @@ static const struct dpu_mdp_cfg sc8180x_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x45C, .features = BIT(DPU_MDP_AUDIO_SELECT), - .highest_bank_bit = 0x3, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -583,8 +636,6 @@ static const struct dpu_mdp_cfg sm6115_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = 0, - .highest_bank_bit = 0x1, - .ubwc_swizzle = 0x7, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
@@ -597,8 +648,6 @@ static const struct dpu_mdp_cfg sm8250_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = 0, - .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ - .ubwc_swizzle = 0x6, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -627,7 +676,6 @@ static const struct dpu_mdp_cfg sm8350_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = 0, - .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -654,8 +702,6 @@ static const struct dpu_mdp_cfg sm8450_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = BIT(DPU_MDP_PERIPH_0_REMOVED), - .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ - .ubwc_swizzle = 0x6, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -681,8 +727,6 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = { { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x2014, - .highest_bank_bit = 0x1, - .ubwc_swizzle = 0x6, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
@@ -699,8 +743,6 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = BIT(DPU_MDP_PERIPH_0_REMOVED), - .highest_bank_bit = 2, - .ubwc_swizzle = 6, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0},
@@ -718,8 +760,6 @@ static const struct dpu_mdp_cfg sm8550_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0, .len = 0x494, .features = BIT(DPU_MDP_PERIPH_0_REMOVED), - .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ - .ubwc_swizzle = 0x6, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x4330, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
@@ -750,7 +790,6 @@ static const struct dpu_mdp_cfg qcm2290_mdp[] = { .name = "top_0", .id = MDP_TOP, .base = 0x0, .len = 0x494, .features = 0, - .highest_bank_bit = 0x2, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2AC, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
@@ -2524,6 +2563,7 @@ static const struct dpu_perf_cfg qcm2290_perf_data = {static const struct dpu_mdss_cfg msm8998_dpu_cfg = { .caps = &msm8998_dpu_caps, + .ubwc = &msm8998_ubwc_cfg, .mdp_count =ARRAY_SIZE (msm8998_mdp), .mdp = msm8998_mdp, .ctl_count =ARRAY_SIZE (msm8998_ctl),
@@ -2547,6 +2587,7 @@ static const struct dpu_mdss_cfg msm8998_dpu_cfg = {static const struct dpu_mdss_cfg sdm845_dpu_cfg = { .caps = &sdm845_dpu_caps, + .ubwc = &sdm845_ubwc_cfg, .mdp_count =ARRAY_SIZE (sdm845_mdp), .mdp = sdm845_mdp, .ctl_count =ARRAY_SIZE (sdm845_ctl),
@@ -2571,6 +2612,7 @@ static const struct dpu_mdss_cfg sdm845_dpu_cfg = {static const struct dpu_mdss_cfg sc7180_dpu_cfg = { .caps = &sc7180_dpu_caps, + .ubwc = &sc7180_ubwc_cfg, .mdp_count =ARRAY_SIZE (sc7180_mdp), .mdp = sc7180_mdp, .ctl_count =ARRAY_SIZE (sc7180_ctl),
@@ -2597,6 +2639,7 @@ static const struct dpu_mdss_cfg sc7180_dpu_cfg = {static const struct dpu_mdss_cfg sm6115_dpu_cfg = { .caps = &sm6115_dpu_caps, + .ubwc = &sm6115_ubwc_cfg, .mdp_count =ARRAY_SIZE (sm6115_mdp), .mdp = sm6115_mdp, .ctl_count =ARRAY_SIZE (qcm2290_ctl),
@@ -2619,6 +2662,7 @@ static const struct dpu_mdss_cfg sm6115_dpu_cfg = {static const struct dpu_mdss_cfg sm8150_dpu_cfg = { .caps = &sm8150_dpu_caps, + .ubwc = &sm8150_ubwc_cfg, .mdp_count =ARRAY_SIZE (sdm845_mdp), .mdp = sdm845_mdp, .ctl_count =ARRAY_SIZE (sm8150_ctl),
@@ -2647,6 +2691,7 @@ static const struct dpu_mdss_cfg sm8150_dpu_cfg = {static const struct dpu_mdss_cfg sc8180x_dpu_cfg = { .caps = &sc8180x_dpu_caps, + .ubwc = &sc8180x_ubwc_cfg, .mdp_count =ARRAY_SIZE (sc8180x_mdp), .mdp = sc8180x_mdp, .ctl_count =ARRAY_SIZE (sm8150_ctl),
@@ -2671,6 +2716,7 @@ static const struct dpu_mdss_cfg sc8180x_dpu_cfg = {static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = { .caps = &sc8280xp_dpu_caps, + .ubwc = &sc8280xp_ubwc_cfg, .mdp_count =ARRAY_SIZE (sc8280xp_mdp), .mdp = sc8280xp_mdp, .ctl_count =ARRAY_SIZE (sc8280xp_ctl),
@@ -2697,6 +2743,7 @@ static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = {static const struct dpu_mdss_cfg sm8250_dpu_cfg = { .caps = &sm8250_dpu_caps, + .ubwc = &sm8250_ubwc_cfg, .mdp_count =ARRAY_SIZE (sm8250_mdp), .mdp = sm8250_mdp, .ctl_count =ARRAY_SIZE (sm8150_ctl),
@@ -2727,6 +2774,7 @@ static const struct dpu_mdss_cfg sm8250_dpu_cfg = {static const struct dpu_mdss_cfg sm8350_dpu_cfg = { .caps = &sm8350_dpu_caps, + .ubwc = &sm8350_ubwc_cfg, .mdp_count =ARRAY_SIZE (sm8350_mdp), .mdp = sm8350_mdp, .ctl_count =ARRAY_SIZE (sm8350_ctl),
@@ -2753,6 +2801,7 @@ static const struct dpu_mdss_cfg sm8350_dpu_cfg = {static const struct dpu_mdss_cfg sm8450_dpu_cfg = { .caps = &sm8450_dpu_caps, + .ubwc = &sm8450_ubwc_cfg, .mdp_count =ARRAY_SIZE (sm8450_mdp), .mdp = sm8450_mdp, .ctl_count =ARRAY_SIZE (sm8450_ctl),
@@ -2779,6 +2828,7 @@ static const struct dpu_mdss_cfg sm8450_dpu_cfg = {static const struct dpu_mdss_cfg sm8550_dpu_cfg = { .caps = &sm8550_dpu_caps, + .ubwc = &sm8550_ubwc_cfg, .mdp_count =ARRAY_SIZE (sm8550_mdp), .mdp = sm8550_mdp, .ctl_count =ARRAY_SIZE (sm8550_ctl),
@@ -2805,6 +2855,7 @@ static const struct dpu_mdss_cfg sm8550_dpu_cfg = {static const struct dpu_mdss_cfg sc7280_dpu_cfg = { .caps = &sc7280_dpu_caps, + .ubwc = &sc7280_ubwc_cfg, .mdp_count =ARRAY_SIZE (sc7280_mdp), .mdp = sc7280_mdp, .ctl_count =ARRAY_SIZE (sc7280_ctl),
@@ -2827,6 +2878,7 @@ static const struct dpu_mdss_cfg sc7280_dpu_cfg = {static const struct dpu_mdss_cfg qcm2290_dpu_cfg = { .caps = &qcm2290_dpu_caps, + .ubwc = &qcm2290_ubwc_cfg, .mdp_count =ARRAY_SIZE (qcm2290_mdp), .mdp = qcm2290_mdp, .ctl_count =ARRAY_SIZE (qcm2290_ctl),
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +14 -5
@@ -394,7 +394,6 @@ struct dpu_rotation_cfg {* @max_mixer_blendstages max layer mixer blend stages or * supported z order * @qseed_type qseed2 or qseed3 support. -* @ubwc_version UBWC feature version (0x0 for not supported) * @has_src_split source split feature status * @has_dim_layer dim layer feature status * @has_idle_pc indicate if idle power collapse feature is supported
@@ -408,7 +407,6 @@ struct dpu_caps {u32 max_mixer_width;u32 max_mixer_blendstages;u32 qseed_type; -u32 ubwc_version;bool has_src_split;bool has_dim_layer;bool has_idle_pc;
@@ -537,15 +535,24 @@ struct dpu_clk_ctrl_reg {* @id: index identifying this block * @base: register base offset to mdss * @features bit mask identifying sub-blocks/features -* @highest_bank_bit: UBWC parameter -* @ubwc_swizzle: ubwc default swizzle setting * @clk_ctrls clock control register definition */ struct dpu_mdp_cfg {DPU_HW_BLK_INFO ; +struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX ]; +}; + +/** +* struct dpu_ubwc_cfg - UBWC and memory configuration +* +* @ubwc_version UBWC feature version (0x0 for not supported) +* @highest_bank_bit: UBWC parameter +* @ubwc_swizzle: ubwc default swizzle setting +*/ +struct dpu_ubwc_cfg { +u32 ubwc_version;u32 highest_bank_bit;u32 ubwc_swizzle; -struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX ]; };/* struct dpu_ctl_cfg : MDP CTL instance info
@@ -847,6 +854,8 @@ struct dpu_perf_cfg {struct dpu_mdss_cfg {const struct dpu_caps *caps; +const struct dpu_ubwc_cfg *ubwc; +u32 mdp_count;const struct dpu_mdp_cfg *mdp;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +9 -9
@@ -307,25 +307,25 @@ static void dpu_hw_sspp_setup_format(struct dpu_hw_pipe *ctx, src_format |= (fmt->fetch_mode &3 ) <<30 ;/*FRAME_FORMAT */ DPU_REG_WRITE (c,SSPP_FETCH_CONFIG ,DPU_FETCH_CONFIG_RESET_VALUE | - ctx->mdp->highest_bank_bit <<18 ); -switch (ctx->catalog->caps->ubwc_version) { + ctx->ubwc->highest_bank_bit <<18 ); +switch (ctx->ubwc->ubwc_version) {case DPU_HW_UBWC_VER_10 : fast_clear = fmt->alpha_enable ?BIT (31 ) :0 ;DPU_REG_WRITE (c,SSPP_UBWC_STATIC_CTRL , - fast_clear | (ctx->mdp->ubwc_swizzle &0x1 ) | + fast_clear | (ctx->ubwc->ubwc_swizzle &0x1 ) |BIT (8 ) | - (ctx->mdp->highest_bank_bit <<4 )); + (ctx->ubwc->highest_bank_bit <<4 ));break ;case DPU_HW_UBWC_VER_20 : fast_clear = fmt->alpha_enable ?BIT (31 ) :0 ;DPU_REG_WRITE (c,SSPP_UBWC_STATIC_CTRL , - fast_clear | (ctx->mdp->ubwc_swizzle) | - (ctx->mdp->highest_bank_bit <<4 )); + fast_clear | (ctx->ubwc->ubwc_swizzle) | + (ctx->ubwc->highest_bank_bit <<4 ));break ;case DPU_HW_UBWC_VER_30 :DPU_REG_WRITE (c,SSPP_UBWC_STATIC_CTRL , -BIT (30 ) | (ctx->mdp->ubwc_swizzle) | - (ctx->mdp->highest_bank_bit <<4 )); +BIT (30 ) | (ctx->ubwc->ubwc_swizzle) | + (ctx->ubwc->highest_bank_bit <<4 ));break ;case DPU_HW_UBWC_VER_40 : DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
@@ -804,7 +804,7 @@ struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx,/* Assign ops */ hw_pipe->catalog = catalog; - hw_pipe->mdp = &catalog->mdp[0 ]; + hw_pipe->ubwc = catalog->ubwc; hw_pipe->idx = idx; hw_pipe->cap = cfg;_setup_layer_ops (hw_pipe, hw_pipe->cap->features);
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +2 -2
@@ -351,7 +351,7 @@ struct dpu_hw_sspp_ops {* @base: hardware block base structure * @hw: block hardware details * @catalog: back pointer to catalog -* @mdp: pointer to associated mdp portion of the catalog +* @ubwc: ubwc configuration data * @idx: pipe index * @cap: pointer to layer_cfg * @ops: pointer to operations possible for this pipe
@@ -360,7 +360,7 @@ struct dpu_hw_pipe {struct dpu_hw_blk base;struct dpu_hw_blk_reg_map hw;const struct dpu_mdss_cfg *catalog; -const struct dpu_mdp_cfg *mdp; +const struct dpu_ubwc_cfg *ubwc;/* Pipe */ enum dpu_sspp idx;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 211/364 drm/msm/dpu: split SM8550 catalog entry to the separate file
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 9cc547933636fa0656b52691f24373ccd7ec61cb ]
Patchwork: https://patchwork.freedesktop.org/patch/530824/
Stable-dep-of: 701f69183d4d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
--- .../msm/disp/dpu1/catalog/dpu_8_1_sm8450.h | 202 +++++++++ .../msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 177 ++++++++ .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 383 +----------------- 3 files changed, 383 insertions(+), 379 deletions(-) create mode 100644 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h create mode 100644 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h new file +202 -0
@@ -0,0 +1,202 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. +*/ + +#ifndef _DPU_8_1_SM8450_H +#define _DPU_8_1_SM8450_H + +static const struct dpu_caps sm8450_dpu_caps = { + .max_mixer_width =DEFAULT_DPU_OUTPUT_LINE_WIDTH , + .max_mixer_blendstages =0xb , + .qseed_type =DPU_SSPP_SCALER_QSEED4 , + .has_src_split = true, + .has_dim_layer = true, + .has_idle_pc = true, + .has_3d_merge = true, + .max_linewidth =5120 , + .pixel_ram_size =DEFAULT_PIXEL_RAM_SIZE , +}; + +static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = { + .ubwc_version =DPU_HW_UBWC_VER_40 , + .highest_bank_bit =0x3 ,/* TODO: 2 for LP_DDR4 */ + .ubwc_swizzle =0x6 , +}; + +static const struct dpu_mdp_cfg sm8450_mdp[] = { + { + .name ="top_0" , .id =MDP_TOP , + .base =0x0 , .len =0x494 , + .features =BIT (DPU_MDP_PERIPH_0_REMOVED ), + .clk_ctrls[DPU_CLK_CTRL_VIG0 ] = { .reg_off =0x2ac , .bit_off =0 }, + .clk_ctrls[DPU_CLK_CTRL_VIG1 ] = { .reg_off =0x2b4 , .bit_off =0 }, + .clk_ctrls[DPU_CLK_CTRL_VIG2 ] = { .reg_off =0x2bc , .bit_off =0 }, + .clk_ctrls[DPU_CLK_CTRL_VIG3 ] = { .reg_off =0x2c4 , .bit_off =0 }, + .clk_ctrls[DPU_CLK_CTRL_DMA0 ] = { .reg_off =0x2ac , .bit_off =8 }, + .clk_ctrls[DPU_CLK_CTRL_DMA1 ] = { .reg_off =0x2b4 , .bit_off =8 }, + .clk_ctrls[DPU_CLK_CTRL_DMA2 ] = { .reg_off =0x2bc , .bit_off =8 }, + .clk_ctrls[DPU_CLK_CTRL_DMA3 ] = { .reg_off =0x2c4 , .bit_off =8 }, + .clk_ctrls[DPU_CLK_CTRL_REG_DMA ] = { .reg_off =0x2bc , .bit_off =20 }, + }, +}; + +static const struct dpu_ctl_cfg sm8450_ctl[] = { + { + .name ="ctl_0" , .id =CTL_0 , + .base =0x15000 , .len =0x204 , + .features =BIT (DPU_CTL_ACTIVE_CFG ) |BIT (DPU_CTL_SPLIT_DISPLAY ) |BIT (DPU_CTL_FETCH_ACTIVE ), + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,9 ), + }, + { + .name ="ctl_1" , .id =CTL_1 , + .base =0x16000 , .len =0x204 , + .features =BIT (DPU_CTL_SPLIT_DISPLAY ) |CTL_SC7280_MASK , + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,10 ), + }, + { + .name ="ctl_2" , .id =CTL_2 , + .base =0x17000 , .len =0x204 , + .features =CTL_SC7280_MASK , + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,11 ), + }, + { + .name ="ctl_3" , .id =CTL_3 , + .base =0x18000 , .len =0x204 , + .features =CTL_SC7280_MASK , + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,12 ), + }, + { + .name ="ctl_4" , .id =CTL_4 , + .base =0x19000 , .len =0x204 , + .features =CTL_SC7280_MASK , + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,13 ), + }, + { + .name ="ctl_5" , .id =CTL_5 , + .base =0x1a000 , .len =0x204 , + .features =CTL_SC7280_MASK , + .intr_start =DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,23 ), + }, +}; + +static const struct dpu_sspp_cfg sm8450_sspp[] = { +SSPP_BLK ("sspp_0" ,SSPP_VIG0 ,0x4000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_0,0 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG0 ), +SSPP_BLK ("sspp_1" ,SSPP_VIG1 ,0x6000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_1,4 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG1 ), +SSPP_BLK ("sspp_2" ,SSPP_VIG2 ,0x8000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_2,8 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG2 ), +SSPP_BLK ("sspp_3" ,SSPP_VIG3 ,0xa000 ,0x32c ,VIG_SC7180_MASK , + sm8450_vig_sblk_3,12 ,SSPP_TYPE_VIG ,DPU_CLK_CTRL_VIG3 ), +SSPP_BLK ("sspp_8" ,SSPP_DMA0 ,0x24000 ,0x32c ,DMA_SDM845_MASK , + sdm845_dma_sblk_0,1 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA0 ), +SSPP_BLK ("sspp_9" ,SSPP_DMA1 ,0x26000 ,0x32c ,DMA_SDM845_MASK , + sdm845_dma_sblk_1,5 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA1 ), +SSPP_BLK ("sspp_10" ,SSPP_DMA2 ,0x28000 ,0x32c ,DMA_CURSOR_SDM845_MASK , + sdm845_dma_sblk_2,9 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA2 ), +SSPP_BLK ("sspp_11" ,SSPP_DMA3 ,0x2a000 ,0x32c ,DMA_CURSOR_SDM845_MASK , + sdm845_dma_sblk_3,13 ,SSPP_TYPE_DMA ,DPU_CLK_CTRL_DMA3 ), +}; + +/* FIXME: interrupts */ +static const struct dpu_pingpong_cfg sm8450_pp[] = { +PP_BLK_TE ("pingpong_0" ,PINGPONG_0 ,0x69000 ,MERGE_3D_0 , sdm845_pp_sblk_te, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,8 ), +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,12 )), +PP_BLK_TE ("pingpong_1" ,PINGPONG_1 ,0x6a000 ,MERGE_3D_0 , sdm845_pp_sblk_te, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,9 ), +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,13 )), +PP_BLK ("pingpong_2" ,PINGPONG_2 ,0x6b000 ,MERGE_3D_1 , sdm845_pp_sblk, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,10 ), +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,14 )), +PP_BLK ("pingpong_3" ,PINGPONG_3 ,0x6c000 ,MERGE_3D_1 , sdm845_pp_sblk, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,11 ), +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,15 )), +PP_BLK ("pingpong_4" ,PINGPONG_4 ,0x6d000 ,MERGE_3D_2 , sdm845_pp_sblk, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,30 ), +-1 ), +PP_BLK ("pingpong_5" ,PINGPONG_5 ,0x6e000 ,MERGE_3D_2 , sdm845_pp_sblk, +DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,31 ), +-1 ), +PP_BLK ("pingpong_6" ,PINGPONG_6 ,0x65800 ,MERGE_3D_3 , sdm845_pp_sblk, +-1 , +-1 ), +PP_BLK ("pingpong_7" ,PINGPONG_7 ,0x65c00 ,MERGE_3D_3 , sdm845_pp_sblk, +-1 , +-1 ), +}; + +static const struct dpu_merge_3d_cfg sm8450_merge_3d[] = { +MERGE_3D_BLK ("merge_3d_0" ,MERGE_3D_0 ,0x4e000 ), +MERGE_3D_BLK ("merge_3d_1" ,MERGE_3D_1 ,0x4f000 ), +MERGE_3D_BLK ("merge_3d_2" ,MERGE_3D_2 ,0x50000 ), +MERGE_3D_BLK ("merge_3d_3" ,MERGE_3D_3 ,0x65f00 ), +}; + +static const struct dpu_intf_cfg sm8450_intf[] = { +INTF_BLK ("intf_0" ,INTF_0 ,0x34000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,24 ,25 ), +INTF_BLK ("intf_1" ,INTF_1 ,0x35000 ,0x300 ,INTF_DSI ,0 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,26 ,27 ), +INTF_BLK ("intf_2" ,INTF_2 ,0x36000 ,0x300 ,INTF_DSI ,1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,28 ,29 ), +INTF_BLK ("intf_3" ,INTF_3 ,0x37000 ,0x280 ,INTF_DP ,MSM_DP_CONTROLLER_1 ,24 ,INTF_SC7280_MASK ,MDP_SSPP_TOP0_INTR ,30 ,31 ), +}; + +static const struct dpu_perf_cfg sm8450_perf_data = { + .max_bw_low =13600000 , + .max_bw_high =18200000 , + .min_core_ib =2500000 , + .min_llcc_ib =0 , + .min_dram_ib =800000 , + .min_prefill_lines =35 , +/* FIXME: lut tables */ + .danger_lut_tbl = {0x3ffff ,0x3ffff ,0x0 }, + .safe_lut_tbl = {0xfe00 ,0xfe00 ,0xffff }, + .qos_lut_tbl = { + {.nentry =ARRAY_SIZE (sc7180_qos_linear), + .entries = sc7180_qos_linear + }, + {.nentry =ARRAY_SIZE (sc7180_qos_macrotile), + .entries = sc7180_qos_macrotile + }, + {.nentry =ARRAY_SIZE (sc7180_qos_nrt), + .entries = sc7180_qos_nrt + }, +/* TODO: macrotile-qseed is different from macrotile */ + }, + .cdp_cfg = { + {.rd_enable =1 , .wr_enable =1 }, + {.rd_enable =1 , .wr_enable =0 } + }, + .clk_inefficiency_factor =105 , + .bw_inefficiency_factor =120 , +}; + +static const struct dpu_mdss_cfg sm8450_dpu_cfg = { + .caps = &sm8450_dpu_caps, + .ubwc = &sm8450_ubwc_cfg, + .mdp_count =ARRAY_SIZE (sm8450_mdp), + .mdp = sm8450_mdp, + .ctl_count =ARRAY_SIZE (sm8450_ctl), + .ctl = sm8450_ctl, + .sspp_count =ARRAY_SIZE (sm8450_sspp), + .sspp = sm8450_sspp, + .mixer_count =ARRAY_SIZE (sm8150_lm), + .mixer = sm8150_lm, + .dspp_count =ARRAY_SIZE (sm8150_dspp), + .dspp = sm8150_dspp, + .pingpong_count =ARRAY_SIZE (sm8450_pp), + .pingpong = sm8450_pp, + .merge_3d_count =ARRAY_SIZE (sm8450_merge_3d), + .merge_3d = sm8450_merge_3d, + .intf_count =ARRAY_SIZE (sm8450_intf), + .intf = sm8450_intf, + .vbif_count =ARRAY_SIZE (sdm845_vbif), + .vbif = sdm845_vbif, + .reg_dma_count =1 , + .dma_cfg = &sm8450_regdma, + .perf = &sm8450_perf_data, + .mdss_irqs =IRQ_SM8450_MASK , +}; + +#endif
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h new file +177 -0
177 lines not on this page · raw message
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +4 -379
461 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 212/364 drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 701f69183d4d52533fb2af0d6948b7d1b00d1a09 ]
SM8550 exclusively has a DITHER sub-block inside the PINGPONG block and no other registers, hence the DITHER name of the macro and a corresponding PINGPONG block length of zero. However, the PP_BLK_ macro name was typo'd to DIPHER rather than DITHER.
Patchwork: https://patchwork.freedesktop.org/patch/534214/
--- .../drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 16 ++++++++-------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h +8 -8
@@ -106,28 +106,28 @@ static const struct dpu_sspp_cfg sm8550_sspp[] = { };static const struct dpu_pingpong_cfg sm8550_pp[] = { -PP_BLK_DIPHER ("pingpong_0" ,PINGPONG_0 ,0x69000 ,MERGE_3D_0 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_0" ,PINGPONG_0 ,0x69000 ,MERGE_3D_0 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,8 ),-1 ), -PP_BLK_DIPHER ("pingpong_1" ,PINGPONG_1 ,0x6a000 ,MERGE_3D_0 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_1" ,PINGPONG_1 ,0x6a000 ,MERGE_3D_0 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,9 ),-1 ), -PP_BLK_DIPHER ("pingpong_2" ,PINGPONG_2 ,0x6b000 ,MERGE_3D_1 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_2" ,PINGPONG_2 ,0x6b000 ,MERGE_3D_1 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,10 ),-1 ), -PP_BLK_DIPHER ("pingpong_3" ,PINGPONG_3 ,0x6c000 ,MERGE_3D_1 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_3" ,PINGPONG_3 ,0x6c000 ,MERGE_3D_1 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR ,11 ),-1 ), -PP_BLK_DIPHER ("pingpong_4" ,PINGPONG_4 ,0x6d000 ,MERGE_3D_2 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_4" ,PINGPONG_4 ,0x6d000 ,MERGE_3D_2 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,30 ),-1 ), -PP_BLK_DIPHER ("pingpong_5" ,PINGPONG_5 ,0x6e000 ,MERGE_3D_2 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_5" ,PINGPONG_5 ,0x6e000 ,MERGE_3D_2 , sc7280_pp_sblk,DPU_IRQ_IDX (MDP_SSPP_TOP0_INTR2 ,31 ),-1 ), -PP_BLK_DIPHER ("pingpong_6" ,PINGPONG_6 ,0x66000 ,MERGE_3D_3 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_6" ,PINGPONG_6 ,0x66000 ,MERGE_3D_3 , sc7280_pp_sblk,-1 ,-1 ), -PP_BLK_DIPHER ("pingpong_7" ,PINGPONG_7 ,0x66400 ,MERGE_3D_3 , sc7280_pp_sblk, +PP_BLK_DITHER ("pingpong_7" ,PINGPONG_7 ,0x66400 ,MERGE_3D_3 , sc7280_pp_sblk,-1 ,-1 ), };
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +1 -1
@@ -1435,7 +1435,7 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { .len = 0x20, .version = 0x20000}, }; -#define PP_BLK_DIPHER (_name, _id, _base, _merge_3d, _sblk, _done, _rdptr) \ +#define PP_BLK_DITHER (_name, _id, _base, _merge_3d, _sblk, _done, _rdptr) \ {\ .name = _name, .id = _id, \ .base = _base, .len = 0, \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 213/364 drm/msm/dpu: Remove duplicate register defines from INTF
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 202c044203ac5860e3025169105368d99f9bc6a2 ]
The INTF_FRAME_LINE_COUNT_EN, INTF_FRAME_COUNT and INTF_LINE_COUNT registers are already defined higher up, in the right place when sorted numerically.
Patchwork: https://patchwork.freedesktop.org/patch/534231/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +0 -5
@@ -56,11 +56,6 @@#define INTF_TPG_RGB_MAPPING 0x11C#define INTF_PROG_FETCH_START 0x170#define INTF_PROG_ROT_START 0x174 - -#define INTF_FRAME_LINE_COUNT_EN 0x0A8 -#define INTF_FRAME_COUNT 0x0AC -#define INTF_LINE_COUNT 0x0B0 -#define INTF_MUX 0x25C#define INTF_CFG_ACTIVE_H_EN BIT(29)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 214/364 dt-bindings: display/msm: dsi-controller-main: Document qcom, master-dsi and qcom, sync-dual-dsi
In reply to Greg Kroah-HartmanFrom: Jianhua Lu <[email protected]>
[ Upstream commit ca29699a57ecee6084a4056f5bfd6f11dd359a71 ]
This fixes warning:
sm8250-xiaomi-elish-csot.dtb: dsi@ae94000: Unevaluated properties are not allowed ('qcom,master-dsi', 'qcom,sync-dual-dsi' were unexpected)
Patchwork: https://patchwork.freedesktop.org/patch/534306/
--- .../bindings/display/msm/dsi-controller-main.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +12 -0
@@ -82,6 +82,18 @@ properties: Indicates if the DSI controller is driving a panel which needs 2 DSI links. + qcom,master-dsi: + type: boolean + description: | + Indicates if the DSI controller is the master DSI controller when + qcom,dual-dsi-mode enabled. + + qcom,sync-dual-dsi: + type: boolean + description: | + Indicates if the DSI controller needs to sync the other DSI controller + with MIPI DCS commands when qcom,dual-dsi-mode enabled. + assigned-clocks: minItems: 2 maxItems: 4
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 215/364 SUNRPC: Fix encoding of accepted but unsuccessful RPC replies
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit 29cd2927fb914cc53b5ba4f67d2b74695c994ba4 ]
Jiri Slaby says:
Quoted 5 lines
I bisected to this ... as it breaks nfs3-only servers in 6.3. I.e.
/etc/nfs.confcontaining:
[nfsd]
vers4=no
Quoted 7 lines
The client sees:
mount("10.0.2.15:/tmp", "/mnt", "nfs", 0, "vers=4.2,addr=10.0.2.15,clientad"...)= -1 EIO (Input/output error) write(2, "mount.nfs: mount system call fai"..., 45
mount.nfs: mount system call failed for /mntAnd the kernel says:
nfs4_discover_server_trunkingunhandled error -5. Exiting with error EIO
--- net/sunrpc/svc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
net/sunrpc/svc.c +11 -6
@@ -1382,7 +1382,7 @@ svc_process_common(struct svc_rqst *rqstp)/* Only RPCv2 supported */ xdr_stream_encode_u32 (xdr,RPC_VERSION );xdr_stream_encode_u32 (xdr,RPC_VERSION ); - goto sendit; +return 1 ;/* don't wrap */ err_bad_auth: dprintk("svc: authentication failed (%d)\n",
@@ -1398,7 +1398,7 @@ svc_process_common(struct svc_rqst *rqstp) err_bad_prog:dprintk ("svc: unknown program %d\n" , rqstp->rq_prog); serv->sv_stats->rpcbadfmt++; -xdr_stream_encode_u32 (xdr,RPC_PROG_UNAVAIL ); + *rqstp->rq_accept_statp = rpc_prog_unavail; goto sendit; err_bad_vers:
@@ -1406,7 +1406,12 @@ svc_process_common(struct svc_rqst *rqstp) rqstp->rq_vers, rqstp->rq_prog, progp->pg_name); serv->sv_stats->rpcbadfmt++; -xdr_stream_encode_u32 (xdr,RPC_PROG_MISMATCH ); + *rqstp->rq_accept_statp = rpc_prog_mismatch; + +/* +* svc_authenticate() has already added the verifier and +* advanced the stream just past rq_accept_statp. +*/ xdr_stream_encode_u32 (xdr, process.mismatch.lovers);xdr_stream_encode_u32 (xdr, process.mismatch.hivers); goto sendit;
@@ -1415,19 +1420,19 @@ svc_process_common(struct svc_rqst *rqstp)svc_printk (rqstp,"unknown procedure (%d)\n" , rqstp->rq_proc); serv->sv_stats->rpcbadfmt++; -xdr_stream_encode_u32 (xdr,RPC_PROC_UNAVAIL ); + *rqstp->rq_accept_statp = rpc_proc_unavail; goto sendit; err_garbage_args:svc_printk (rqstp,"failed to decode RPC header\n" ); serv->sv_stats->rpcbadfmt++; -xdr_stream_encode_u32 (xdr,RPC_GARBAGE_ARGS ); + *rqstp->rq_accept_statp = rpc_garbage_args; goto sendit; err_system_err: serv->sv_stats->rpcbadfmt++; -xdr_stream_encode_u32 (xdr,RPC_SYSTEM_ERR ); + *rqstp->rq_accept_statp = rpc_system_err; goto sendit; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 216/364 ASoC: fsl_micfil: Fix error handler with pm_runtime_enable
In reply to Greg Kroah-HartmanFrom: Shengjiu Wang <[email protected]>
[ Upstream commit 17955aba7877a4494d8093ae5498e19469b01d57 ]
There is error message when defer probe happens:
fsl-micfil-dai 30ca0000.micfil: Unbalanced pm_runtime_enable!
Fix the error handler with pm_runtime_enable and add fsl_micfil_remove() for pm_runtime_disable.
--- sound/soc/fsl/fsl_micfil.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
sound/soc/fsl/fsl_micfil.c +13 -1
@@ -1159,7 +1159,7 @@ static int fsl_micfil_probe(struct platform_device *pdev) ret =devm_snd_dmaengine_pcm_register (&pdev->dev,NULL ,0 );if (ret) {dev_err (&pdev->dev,"failed to pcm register\n" ); -return ret; + goto err_pm_disable; } fsl_micfil_dai.capture.formats = micfil->soc->formats;
@@ -1169,9 +1169,20 @@ static int fsl_micfil_probe(struct platform_device *pdev)if (ret) {dev_err (&pdev->dev,"failed to register component %s\n" , fsl_micfil_component.name); + goto err_pm_disable; }return ret; + +err_pm_disable: +pm_runtime_disable (&pdev->dev); + +return ret; +} + +static void fsl_micfil_remove (struct platform_device *pdev) +{ +pm_runtime_disable (&pdev->dev); }static int __maybe_unused fsl_micfil_runtime_suspend (struct device *dev)
@@ -1232,6 +1243,7 @@ static const struct dev_pm_ops fsl_micfil_pm_ops = {static struct platform_driver fsl_micfil_driver = { .probe = fsl_micfil_probe, + .remove_new = fsl_micfil_remove, .driver = { .name ="fsl-micfil-dai" , .pm = &fsl_micfil_pm_ops,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 217/364 cpupower: Make TSC read per CPU for Mperf monitor
In reply to Greg Kroah-HartmanFrom: Wyes Karny <[email protected]>
[ Upstream commit c2adb1877b76fc81ae041e1db1a6ed2078c6746b ]
System-wide TSC read could cause a drift in C0 percentage calculation. Because if first TSC is read and then one by one mperf is read for all cpus, this introduces drift between mperf reading of later CPUs and TSC reading. To lower this drift read TSC per CPU and also just after mperf read. This technique improves C0 percentage calculation in Mperf monitor.
Before fix: (System 100% busy)
| Mperf || RAPL || Idle_Stats PKG|CORE| CPU| C0 | Cx | Freq || pack | core || POLL | C1 | C2 0| 0| 0| 87.15| 12.85| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 0| 256| 84.62| 15.38| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 1| 1| 87.15| 12.85| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 1| 257| 84.08| 15.92| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 2| 2| 86.61| 13.39| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 2| 258| 83.26| 16.74| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 3| 3| 86.61| 13.39| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 3| 259| 83.60| 16.40| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 4| 4| 86.33| 13.67| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 4| 260| 83.33| 16.67| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 5| 5| 86.06| 13.94| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 5| 261| 83.05| 16.95| 2695||168659003|3970468|| 0.00| 0.00| 0.00 0| 6| 6| 85.51| 14.49| 2695||168659003|3970468|| 0.00| 0.00| 0.00
After fix: (System 100% busy)
| Mperf || RAPL || Idle_Stats PKG|CORE| CPU| C0 | Cx | Freq || pack | core || POLL | C1 | C2 0| 0| 0| 98.03| 1.97| 2415||163295480|3811189|| 0.00| 0.00| 0.00 0| 0| 256| 98.50| 1.50| 2394||163295480|3811189|| 0.00| 0.00| 0.00 0| 1| 1| 99.99| 0.01| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 1| 257| 99.99| 0.01| 2375||163295480|3811189|| 0.00| 0.00| 0.00 0| 2| 2| 99.99| 0.01| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 2| 258|100.00| 0.00| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 3| 3|100.00| 0.00| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 3| 259| 99.99| 0.01| 2435||163295480|3811189|| 0.00| 0.00| 0.00 0| 4| 4|100.00| 0.00| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 4| 260|100.00| 0.00| 2435||163295480|3811189|| 0.00| 0.00| 0.00 0| 5| 5| 99.99| 0.01| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 5| 261|100.00| 0.00| 2435||163295480|3811189|| 0.00| 0.00| 0.00 0| 6| 6|100.00| 0.00| 2401||163295480|3811189|| 0.00| 0.00| 0.00 0| 6| 262|100.00| 0.00| 2435||163295480|3811189|| 0.00| 0.00| 0.00
--- .../utils/idle_monitor/mperf_monitor.c | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-)
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c +14 -17
@@ -70,8 +70,8 @@ static int max_freq_mode;*/ static unsigned long max_frequency; -static unsigned long long tsc_at_measure_start; -static unsigned long long tsc_at_measure_end; +static unsigned long long *tsc_at_measure_start; +static unsigned long long *tsc_at_measure_end;static unsigned long long *mperf_previous_count;static unsigned long long *aperf_previous_count;static unsigned long long *mperf_current_count;
@@ -169,7 +169,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent, aperf_diff = aperf_current_count[cpu] - aperf_previous_count[cpu];if (max_freq_mode ==MAX_FREQ_TSC_REF ) { - tsc_diff = tsc_at_measure_end - tsc_at_measure_start; + tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu]; *percent =100.0 * mperf_diff / tsc_diff;dprint ("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n" , mperf_cstates[id].name, mperf_diff, tsc_diff);
@@ -206,7 +206,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,if (max_freq_mode ==MAX_FREQ_TSC_REF ) {/* Calculate max_freq from TSC count */ - tsc_diff = tsc_at_measure_end - tsc_at_measure_start; + tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu]; time_diff =timespec_diff_us (time_start, time_end); max_frequency = tsc_diff / time_diff; }
@@ -225,33 +225,27 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,static int mperf_start (void ) {int cpu; -unsigned long long dbg;clock_gettime (CLOCK_REALTIME , &time_start); -mperf_get_tsc (&tsc_at_measure_start); -for (cpu =0 ; cpu < cpu_count; cpu++) +for (cpu =0 ; cpu < cpu_count; cpu++) { +mperf_get_tsc (&tsc_at_measure_start[cpu]);mperf_init_stats (cpu); + } -mperf_get_tsc (&dbg); -dprint ("TSC diff: %llu\n" , dbg - tsc_at_measure_start);return 0 ; }static int mperf_stop (void ) { -unsigned long long dbg;int cpu; -for (cpu =0 ; cpu < cpu_count; cpu++) +for (cpu =0 ; cpu < cpu_count; cpu++) {mperf_measure_stats (cpu); +mperf_get_tsc (&tsc_at_measure_end[cpu]); + } -mperf_get_tsc (&tsc_at_measure_end);clock_gettime (CLOCK_REALTIME , &time_end); - -mperf_get_tsc (&dbg); -dprint ("TSC diff: %llu\n" , dbg - tsc_at_measure_end); -return 0 ; }
@@ -353,7 +347,8 @@ struct cpuidle_monitor *mperf_register(void) aperf_previous_count =calloc (cpu_count,sizeof (unsigned long long )); mperf_current_count =calloc (cpu_count,sizeof (unsigned long long )); aperf_current_count =calloc (cpu_count,sizeof (unsigned long long )); - + tsc_at_measure_start =calloc (cpu_count,sizeof (unsigned long long )); + tsc_at_measure_end =calloc (cpu_count,sizeof (unsigned long long )); mperf_monitor.name_len =strlen (mperf_monitor.name);return &mperf_monitor; }
@@ -364,6 +359,8 @@ void mperf_unregister(void)free (aperf_previous_count);free (mperf_current_count);free (aperf_current_count); +free (tsc_at_measure_start); +free (tsc_at_measure_end);free (is_valid); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 218/364 xfrm: Reject optional tunnel/BEET mode templates in outbound policies
In reply to Greg Kroah-HartmanFrom: Tobias Brunner <[email protected]>
[ Upstream commit 3d776e31c841ba2f69895d2255a49320bec7cea6 ]
xfrm_state_find() uses encap_family of the current template with the passed local and remote addresses to find a matching state. If an optional tunnel or BEET mode template is skipped in a mixed-family scenario, there could be a mismatch causing an out-of-bounds read as the addresses were not replaced to match the family of the next template.
While there are theoretical use cases for optional templates in outbound policies, the only practical one is to skip IPComp states in inbound policies if uncompressed packets are received that are handled by an implicitly created IPIP state instead.
--- net/xfrm/xfrm_user.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
net/xfrm/xfrm_user.c +9 -5
@@ -1768,7 +1768,7 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, }static int validate_tmpl (int nr,struct xfrm_user_tmpl *ut,u16 family, -struct netlink_ext_ack *extack) +int dir,struct netlink_ext_ack *extack) {u16 prev_family;int i;
@@ -1794,6 +1794,10 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family,switch (ut[i].mode) {case XFRM_MODE_TUNNEL :case XFRM_MODE_BEET : +if (ut[i].optional && dir ==XFRM_POLICY_OUT ) { +NL_SET_ERR_MSG (extack,"Mode in optional template not allowed in outbound policy" ); +return -EINVAL ; + }break ;default :if (ut[i].family != prev_family) {
@@ -1831,7 +1835,7 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family, }static int copy_from_user_tmpl (struct xfrm_policy *pol,struct nlattr **attrs, -struct netlink_ext_ack *extack) +int dir,struct netlink_ext_ack *extack) {struct nlattr *rt = attrs[XFRMA_TMPL ];
@@ -1842,7 +1846,7 @@ static int copy_from_user_tmpl(struct xfrm_policy *pol, struct nlattr **attrs,int nr =nla_len (rt) /sizeof (*utmpl);int err; - err =validate_tmpl (nr, utmpl, pol->family, extack); + err =validate_tmpl (nr, utmpl, pol->family, dir, extack);if (err)return err;
@@ -1919,7 +1923,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct net *net,if (err) goto error; -if (!(err =copy_from_user_tmpl (xp, attrs, extack))) +if (!(err =copy_from_user_tmpl (xp, attrs, p->dir, extack))) err =copy_from_user_sec_ctx (xp, attrs);if (err) goto error;
@@ -3498,7 +3502,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt,return NULL ; nr = ((len -sizeof (*p)) /sizeof (*ut)); -if (validate_tmpl (nr, ut, p->sel.family,NULL )) +if (validate_tmpl (nr, ut, p->sel.family, p->dir,NULL ))return NULL ;if (p->dir >XFRM_POLICY_OUT )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 219/364 af_key: Reject optional tunnel/BEET mode templates in outbound policies
In reply to Greg Kroah-HartmanFrom: Tobias Brunner <[email protected]>
[ Upstream commit cf3128a7aca55b2eefb68281d44749c683bdc96f ]
xfrm_state_find() uses encap_family of the current template with the passed local and remote addresses to find a matching state. If an optional tunnel or BEET mode template is skipped in a mixed-family scenario, there could be a mismatch causing an out-of-bounds read as the addresses were not replaced to match the family of the next template.
While there are theoretical use cases for optional templates in outbound policies, the only practical one is to skip IPComp states in inbound policies if uncompressed packets are received that are handled by an implicitly created IPIP state instead.
--- net/key/af_key.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/key/af_key.c +8 -4
@@ -1940,7 +1940,8 @@ static u32 gen_reqid(struct net *net) }static int -parse_ipsecrequest (struct xfrm_policy *xp,struct sadb_x_ipsecrequest *rq) +parse_ipsecrequest (struct xfrm_policy *xp,struct sadb_x_policy *pol, +struct sadb_x_ipsecrequest *rq) {struct net *net =xp_net (xp);struct xfrm_tmpl *t = xp->xfrm_vec + xp->xfrm_nr;
@@ -1958,9 +1959,12 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)if ((mode =pfkey_mode_to_xfrm (rq->sadb_x_ipsecrequest_mode)) <0 )return -EINVAL ; t->mode = mode; -if (rq->sadb_x_ipsecrequest_level ==IPSEC_LEVEL_USE ) +if (rq->sadb_x_ipsecrequest_level ==IPSEC_LEVEL_USE ) { +if ((mode ==XFRM_MODE_TUNNEL || mode ==XFRM_MODE_BEET ) && + pol->sadb_x_policy_dir ==IPSEC_DIR_OUTBOUND ) +return -EINVAL ; t->optional =1 ; -else if (rq->sadb_x_ipsecrequest_level ==IPSEC_LEVEL_UNIQUE ) { + }else if (rq->sadb_x_ipsecrequest_level ==IPSEC_LEVEL_UNIQUE ) { t->reqid = rq->sadb_x_ipsecrequest_reqid;if (t->reqid >IPSEC_MANUAL_REQID_MAX ) t->reqid =0 ;
@@ -2002,7 +2006,7 @@ parse_ipsecrequests(struct xfrm_policy *xp, struct sadb_x_policy *pol) rq->sadb_x_ipsecrequest_len < sizeof(*rq))return -EINVAL ; -if ((err =parse_ipsecrequest (xp, rq)) <0 ) +if ((err =parse_ipsecrequest (xp, pol, rq)) <0 )return err; len -= rq->sadb_x_ipsecrequest_len; rq = (void *)((u8 *)rq + rq->sadb_x_ipsecrequest_len);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 220/364 drm/msm: Fix submit error-path leaks
In reply to Greg Kroah-HartmanFrom: Rob Clark <[email protected]>
[ Upstream commit 68dc6c2d5eec45515855cce99256162f45651a0b ]
For errors after msm_submitqueue_get(), we need to drop the submitqueue reference. Additionally after get_unused_fd() we need to drop the fd. The ordering for dropping the queue lock and put_unused_fd() is not important, so just move this all into out_post_unlock.
v2: Only drop queue ref if submit doesn't take it
v3: Fix unitialized submit ref in error path
v4: IS_ERR_OR_NULL()
Patchwork: https://patchwork.freedesktop.org/patch/536073/
--- drivers/gpu/drm/msm/msm_gem_submit.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/msm_gem_submit.c +18 -7
@@ -719,7 +719,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,struct msm_drm_private *priv = dev->dev_private;struct drm_msm_gem_submit *args = data;struct msm_file_private *ctx = file->driver_priv; -struct msm_gem_submit *submit; +struct msm_gem_submit *submit =NULL ;struct msm_gpu *gpu = priv->gpu;struct msm_gpu_submitqueue *queue;struct msm_ringbuffer *ring;
@@ -766,13 +766,15 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, out_fence_fd =get_unused_fd_flags (O_CLOEXEC );if (out_fence_fd <0 ) { ret = out_fence_fd; -return ret; + goto out_post_unlock; } } submit =submit_create (dev, gpu, queue, args->nr_bos, args->nr_cmds); -if (IS_ERR (submit)) -return PTR_ERR (submit); +if (IS_ERR (submit)) { + ret =PTR_ERR (submit); + goto out_post_unlock; + }trace_msm_gpu_submit (pid_nr (submit->pid), ring->id, submit->ident, args->nr_bos, args->nr_cmds);
@@ -955,11 +957,20 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,if (has_ww_ticket)ww_acquire_fini (&submit->ticket); out_unlock: -if (ret && (out_fence_fd >=0 )) -put_unused_fd (out_fence_fd);mutex_unlock (&queue->lock); out_post_unlock: -msm_gem_submit_put (submit); +if (ret && (out_fence_fd >=0 )) +put_unused_fd (out_fence_fd); + +if (!IS_ERR_OR_NULL (submit)) { +msm_gem_submit_put (submit); + }else { +/* +* If the submit hasn't yet taken ownership of the queue +* then we need to drop the reference ourself: +*/ +msm_submitqueue_put (queue); + }if (!IS_ERR_OR_NULL (post_deps)) {for (i =0 ; i < args->nr_out_syncobjs; ++i) {kfree (post_deps[i].chain);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 221/364 selftests: seg6: disable DAD on IPv6 router cfg for srv6_end_dt4_l3vpn_test
In reply to Greg Kroah-HartmanFrom: Andrea Mayer <[email protected]>
[ Upstream commit 21a933c79a33add3612808f3be4ad65dd4dc026b ]
The srv6_end_dt4_l3vpn_test instantiates a virtual network consisting of several routers (rt-1, rt-2) and hosts.
When the IPv6 addresses of rt-{1,2} routers are configured, the Deduplicate Address Detection (DAD) kicks in when enabled in the Linux distros running the selftests. DAD is used to check whether an IPv6 address is already assigned in a network. Such a mechanism consists of sending an ICMPv6 Echo Request and waiting for a reply.
As the DAD process could take too long to complete, it may cause the failing of some tests carried out by the srv6_end_dt4_l3vpn_test script.
To make the srv6_end_dt4_l3vpn_test more robust, we disable DAD on routers since we configure the virtual network manually and do not need any address deduplication mechanism at all.
--- tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh +5 -1
@@ -232,10 +232,14 @@ setup_rt_networking() local nsname=rt-${rt} ip netns add ${nsname} + + ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0 + ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0 + ip link set veth-rt-${rt} netns ${nsname} ip -netns ${nsname} link set veth-rt-${rt} name veth0 - ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 + ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad ip -netns ${nsname} link set veth0 up ip -netns ${nsname} link set lo up
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 222/364 selftets: seg6: disable rp_filter by default in srv6_end_dt4_l3vpn_test
In reply to Greg Kroah-HartmanFrom: Andrea Mayer <[email protected]>
[ Upstream commit f97b8401e0deb46ad1e4245c21f651f64f55aaa6 ]
On some distributions, the rp_filter is automatically set (=1) by default on a netdev basis (also on VRFs).
In an SRv6 End.DT4 behavior, decapsulated IPv4 packets are routed using the table associated with the VRF bound to that tunnel. During lookup operations, the rp_filter can lead to packet loss when activated on the VRF.
Therefore, we chose to make this selftest more robust by explicitly disabling the rp_filter during tests (as it is automatically set by some Linux distributions).
--- .../testing/selftests/net/srv6_end_dt4_l3vpn_test.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh +6 -5
@@ -258,6 +258,12 @@ setup_hs() # set the networking for the host ip netns add ${hsname} + + # disable the rp_filter otherwise the kernel gets confused about how + # to route decap ipv4 packets. + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip -netns ${hsname} link add veth0 type veth peer name ${rtveth} ip -netns ${hsname} link set ${rtveth} netns ${rtname} ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0
@@ -276,11 +282,6 @@ setup_hs() ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1 - # disable the rp_filter otherwise the kernel gets confused about how - # to route decap ipv4 packets. - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0 - ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode" }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 223/364 devlink: change per-devlink netdev notifier to static one
In reply to Greg Kroah-HartmanFrom: Jiri Pirko <[email protected]>
[ Upstream commit e93c9378e33f68b61ea9318580d841caa22fb9ea ]
The commit 565b4824c39f ("devlink: change port event netdev notifier from per-net to global") changed original per-net notifier to be per-devlink instance. That fixed the issue of non-receiving events of netdev uninit if that moved to a different namespace. That worked fine in -net tree.
However, later on when commit ee75f1fc44dd ("net/mlx5e: Create separate devlink instance for ethernet auxiliary device") and commit 72ed5d5624af ("net/mlx5: Suspend auxiliary devices only in case of PCI device suspend") were merged, a deadlock was introduced when removing a namespace with devlink instance with another nested instance.
Here there is the bad flow example resulting in deadlock with mlx5:net_cleanup_work -> cleanup_net (takes down_read(&pernet_ops_rwsem) -> devlink_pernet_pre_exit() -> devlink_reload() -> mlx5_devlink_reload_down() -> mlx5_unload_one_devl_locked() -> mlx5_detach_device() -> del_adev() -> mlx5e_remove() -> mlx5e_destroy_devlink() -> devlink_free() -> unregister_netdevice_notifier() (takes down_write(&pernet_ops_rwsem)
Steps to reproduce:
$ modprobe mlx5_core $ ip netns add ns1 $ devlink dev reload pci/0000:08:00.0 netns ns1 $ ip netns del ns1
Resolve this by converting the notifier from per-devlink instance to a static one registered during init phase and leaving it registered forever. Use this notifier for all devlink port instances created later on.
Note what a tree needs this fix only in case all of the cited fixes commits are present.
--- net/devlink/core.c | 16 +++++++--------- net/devlink/devl_internal.h | 1 - net/devlink/leftover.c | 5 ++--- 3 files changed, 9 insertions(+), 13 deletions(-)
net/devlink/core.c +7 -9
@@ -204,11 +204,6 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops,if (ret <0 ) goto err_xa_alloc; - devlink->netdevice_nb.notifier_call = devlink_port_netdevice_event; - ret =register_netdevice_notifier (&devlink->netdevice_nb); -if (ret) - goto err_register_netdevice_notifier; - devlink->dev = dev; devlink->ops = ops;xa_init_flags (&devlink->ports,XA_FLAGS_ALLOC );
@@ -233,8 +228,6 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops,return devlink; -err_register_netdevice_notifier: -xa_erase (&devlinks, devlink->index); err_xa_alloc:kfree (devlink);return NULL ;
@@ -266,8 +259,6 @@ void devlink_free(struct devlink *devlink)xa_destroy (&devlink->params);xa_destroy (&devlink->ports); -WARN_ON_ONCE (unregister_netdevice_notifier (&devlink->netdevice_nb)); -xa_erase (&devlinks, devlink->index);devlink_put (devlink);
@@ -303,6 +294,10 @@ static struct pernet_operations devlink_pernet_ops __net_initdata = { .pre_exit = devlink_pernet_pre_exit, }; +static struct notifier_block devlink_port_netdevice_nb__net_initdata = { + .notifier_call = devlink_port_netdevice_event, +}; +static int __init devlink_init (void ) {int err;
@@ -311,6 +306,9 @@ static int __init devlink_init(void)if (err) goto out; err =register_pernet_subsys (&devlink_pernet_ops); +if (err) + goto out; + err =register_netdevice_notifier (&devlink_port_netdevice_nb); out:WARN_ON (err);
net/devlink/devl_internal.h +0 -1
@@ -50,7 +50,6 @@ struct devlink { u8 reload_failed:1;refcount_t refcount;struct rcu_work rwork; -struct notifier_block netdevice_nb;char priv[]__aligned(NETDEV_ALIGN) ; };
net/devlink/leftover.c +2 -3
@@ -7073,10 +7073,9 @@ int devlink_port_netdevice_event(struct notifier_block *nb,struct devlink_port *devlink_port = netdev->devlink_port;struct devlink *devlink; - devlink = container_of(nb, struct devlink, netdevice_nb); - -if (!devlink_port || devlink_port->devlink != devlink) +if (!devlink_port)return NOTIFY_OK ; + devlink = devlink_port->devlink;switch (event) {case NETDEV_POST_INIT :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 224/364 net: fec: Better handle pm_runtime_get() failing in .remove()
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit f816b9829b19394d318e01953aa3b2721bca040d ]
In the (unlikely) event that pm_runtime_get() (disguised as pm_runtime_resume_and_get()) fails, the remove callback returned an error early. The problem with this is that the driver core ignores the error value and continues removing the device. This results in a resource leak. Worse the devm allocated resources are freed and so if a callback of the driver is called later the register mapping is already gone which probably results in a crash.
--- drivers/net/ethernet/freescale/fec_main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +11 -4
@@ -4478,9 +4478,11 @@ fec_drv_remove(struct platform_device *pdev)struct device_node *np = pdev->dev.of_node;int ret; - ret =pm_runtime_resume_and_get (&pdev->dev); + ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) -return ret; +dev_err (&pdev->dev, +"Failed to resume device in remove callback (%pe)\n" , +ERR_PTR (ret));cancel_work_sync (&fep->tx_timeout_work);fec_ptp_stop (pdev);
@@ -4493,8 +4495,13 @@ fec_drv_remove(struct platform_device *pdev)of_phy_deregister_fixed_link (np);of_node_put (fep->phy_node); -clk_disable_unprepare (fep->clk_ahb); -clk_disable_unprepare (fep->clk_ipg); +/* After pm_runtime_get_sync() failed, the clks are still off, so skip +* disabling them again. +*/ +if (ret >=0 ) { +clk_disable_unprepare (fep->clk_ahb); +clk_disable_unprepare (fep->clk_ipg); + }pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 225/364 net: phy: dp83867: add w/a for packet errors seen with short cables
In reply to Greg Kroah-HartmanFrom: Grygorii Strashko <[email protected]>
[ Upstream commit 0b01db274028f5acd207332686ffc92ac77491ac ]
Introduce the W/A for packet errors seen with short cables (<1m) between two DP83867 PHYs.
The W/A recommended by DM requires FFE Equalizer Configuration tuning by writing value 0x0E81 to DSP_FFE_CFG register (0x012C), surrounded by hard and soft resets as follows:
write_reg(0x001F, 0x8000); //hard resetwrite_reg(DSP_FFE_CFG, 0x0E81);write_reg(0x001F, 0x4000); //soft reset
Since DP83867 PHY DM says "Changing this register to 0x0E81, will not affect Long Cable performance.", enable the W/A by default.
--- drivers/net/phy/dp83867.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/net/phy/dp83867.c +21 -1
@@ -42,6 +42,7 @@#define DP83867_STRAP_STS1 0x006E#define DP83867_STRAP_STS2 0x006f#define DP83867_RGMIIDCTL 0x0086 +#define DP83867_DSP_FFE_CFG 0x012c#define DP83867_RXFCFG 0x0134#define DP83867_RXFPMD1 0x0136#define DP83867_RXFPMD2 0x0137
@@ -910,8 +911,27 @@ static int dp83867_phy_reset(struct phy_device *phydev)usleep_range (10 ,20 ); -return phy_modify (phydev,MII_DP83867_PHYCTRL , + err =phy_modify (phydev,MII_DP83867_PHYCTRL ,DP83867_PHYCR_FORCE_LINK_GOOD ,0 ); +if (err <0 ) +return err; + +/* Configure the DSP Feedforward Equalizer Configuration register to +* improve short cable (< 1 meter) performance. This will not affect +* long cable performance. +*/ + err =phy_write_mmd (phydev,DP83867_DEVADDR ,DP83867_DSP_FFE_CFG , +0x0e81 ); +if (err <0 ) +return err; + + err =phy_write (phydev,DP83867_CTRL ,DP83867_SW_RESTART ); +if (err <0 ) +return err; + +usleep_range (10 ,20 ); + +return 0 ; }static void dp83867_link_change_notify (struct phy_device *phydev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 226/364 ALSA: firewire-digi00x: prevent potential use after free
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit c0e72058d5e21982e61a29de6b098f7c1f0db498 ]
This code was supposed to return an error code if init_stream() failed, but it instead freed dg00x->rx_stream and returned success. This potentially leads to a use after free.
--- sound/firewire/digi00x/digi00x-stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/firewire/digi00x/digi00x-stream.c +3 -1
@@ -259,8 +259,10 @@ int snd_dg00x_stream_init_duplex(struct snd_dg00x *dg00x)return err; err =init_stream (dg00x, &dg00x->tx_stream); -if (err <0 ) +if (err <0 ) {destroy_stream (dg00x, &dg00x->rx_stream); +return err; + } err =amdtp_domain_init (&dg00x->domain);if (err <0 ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 227/364 wifi: mt76: connac: fix stats->tx_bytes calculation
In reply to Greg Kroah-HartmanFrom: Ryder Lee <[email protected]>
[ Upstream commit c7ab7a29ef5c0779574120d922256ce4651555d3 ]
The stats->tx_bytes shall subtract retry byte from tx byte.
--- drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h | 2 +- drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h +1 -1
@@ -163,7 +163,7 @@ enum {#define MT_TXS5_MPDU_TX_CNT GENMASK(31, 23)#define MT_TXS6_MPDU_FAIL_CNT GENMASK(31, 23) - +#define MT_TXS7_MPDU_RETRY_BYTE GENMASK(22, 0)#define MT_TXS7_MPDU_RETRY_CNT GENMASK(31, 23)/* RXD DW1 */
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +2 -1
@@ -576,7 +576,8 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,/* PPDU based reporting */ if (FIELD_GET (MT_TXS0_TXS_FORMAT , txs) >1 ) { stats->tx_bytes += -le32_get_bits (txs_data[5 ],MT_TXS5_MPDU_TX_BYTE ); +le32_get_bits (txs_data[5 ],MT_TXS5_MPDU_TX_BYTE ) - +le32_get_bits (txs_data[7 ],MT_TXS7_MPDU_RETRY_BYTE ); stats->tx_packets +=le32_get_bits (txs_data[5 ],MT_TXS5_MPDU_TX_CNT ); stats->tx_failed +=
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 228/364 ALSA: hda/realtek: Apply HP B&O top speaker profile to Pavilion 15
In reply to Greg Kroah-HartmanFrom: Ryan C. Underwood <[email protected]>
[ Upstream commit 92553ee03166ef8fa978e7683f9f4af30c9c4e6b ]
The Pavilion 15 line has B&O top speakers similar to the x360 and applying the same profile produces good sound. Without this, the sound would be tinny and underpowered without either applying model=alc295-hp-x360 or booting another OS first.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -9363,7 +9363,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x802f ,"HP Z240" ,ALC221_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x8077 ,"HP" ,ALC256_FIXUP_HP_HEADSET_MIC ),SND_PCI_QUIRK (0x103c ,0x8158 ,"HP" ,ALC256_FIXUP_HP_HEADSET_MIC ), -SND_PCI_QUIRK (0x103c ,0x820d ,"HP Pavilion 15" ,ALC269_FIXUP_HP_MUTE_LED_MIC3 ), +SND_PCI_QUIRK (0x103c ,0x820d ,"HP Pavilion 15" ,ALC295_FIXUP_HP_X360 ),SND_PCI_QUIRK (0x103c ,0x8256 ,"HP" ,ALC221_FIXUP_HP_FRONT_MIC ),SND_PCI_QUIRK (0x103c ,0x827e ,"HP x360" ,ALC295_FIXUP_HP_X360 ), SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 229/364 ice: Fix undersized tx_flags variable
In reply to Greg Kroah-HartmanFrom: Jan Sokolowski <[email protected]>
[ Upstream commit 9113302bb43cf7a6d5a414d49b29478e57451c86 ]
As not all ICE_TX_FLAGS_* fit in current 16-bit limited tx_flags field that was introduced in the Fixes commit, VLAN-related information would be discarded completely. As such, creating a vlan and trying to run ping through would result in no traffic passing.
Fix that by refactoring tx_flags variable into flags only and a separate variable that holds VLAN ID. As there is some space left, type variable can fit between those two. Pahole reports no size change to ice_tx_buf struct.
--- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 5 ++--- drivers/net/ethernet/intel/ice/ice_txrx.c | 8 +++----- drivers/net/ethernet/intel/ice/ice_txrx.h | 9 +++------ 3 files changed, 8 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -3
@@ -932,10 +932,9 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_tx_ring *tx_ring,if ((first->tx_flags &ICE_TX_FLAGS_HW_VLAN || first->tx_flags &ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN ) || skb->priority !=TC_PRIO_CONTROL ) { - first->tx_flags &= ~ICE_TX_FLAGS_VLAN_PR_M ; + first->vid &= ~VLAN_PRIO_MASK ;/* Mask the lower 3 bits to set the 802.1p priority */ - first->tx_flags |= (skb->priority &0x7 ) << -ICE_TX_FLAGS_VLAN_PR_S ; + first->vid |= (skb->priority <<VLAN_PRIO_SHIFT ) &VLAN_PRIO_MASK ;/* if this is not already set it means a VLAN 0 + priority needs * to be offloaded */
drivers/net/ethernet/intel/ice/ice_txrx.c +3 -5
@@ -1664,8 +1664,7 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,if (first->tx_flags &ICE_TX_FLAGS_HW_VLAN ) { td_cmd |= (u64 )ICE_TX_DESC_CMD_IL2TAG1 ; - td_tag = (first->tx_flags &ICE_TX_FLAGS_VLAN_M ) >> -ICE_TX_FLAGS_VLAN_S ; + td_tag = first->vid; } dma =dma_map_single (tx_ring->dev, skb->data, size,DMA_TO_DEVICE );
@@ -1998,7 +1997,7 @@ ice_tx_prepare_vlan_flags(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first)* VLAN offloads exclusively so we only care about the VLAN ID here */ if (skb_vlan_tag_present (skb)) { - first->tx_flags |=skb_vlan_tag_get (skb) <<ICE_TX_FLAGS_VLAN_S ; + first->vid =skb_vlan_tag_get (skb);if (tx_ring->flags &ICE_TX_FLAGS_RING_VLAN_L2TAG2 ) first->tx_flags |=ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN ;else
@@ -2388,8 +2387,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring) offload.cd_qw1 |= (u64)(ICE_TX_DESC_DTYPE_CTX | (ICE_TX_CTX_DESC_IL2TAG2 <<ICE_TXD_CTX_QW1_CMD_S )); - offload.cd_l2tag2 = (first->tx_flags &ICE_TX_FLAGS_VLAN_M ) >> -ICE_TX_FLAGS_VLAN_S ; + offload.cd_l2tag2 = first->vid; }/* set up TSO offload */
drivers/net/ethernet/intel/ice/ice_txrx.h +3 -6
@@ -127,10 +127,6 @@ static inline int ice_skb_pad(void)#define ICE_TX_FLAGS_IPV6 BIT(6)#define ICE_TX_FLAGS_TUNNEL BIT(7)#define ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN BIT(8) -#define ICE_TX_FLAGS_VLAN_M 0xffff0000 -#define ICE_TX_FLAGS_VLAN_PR_M 0xe0000000 -#define ICE_TX_FLAGS_VLAN_PR_S 29 -#define ICE_TX_FLAGS_VLAN_S 16#define ICE_XDP_PASS 0#define ICE_XDP_CONSUMED BIT(0)
@@ -182,8 +178,9 @@ struct ice_tx_buf {unsigned int gso_segs;unsigned int nr_frags;/* used for mbuf XDP */ }; - u32 type:16; /* &ice_tx_buf_type */ - u32 tx_flags:16; + u32 tx_flags:12; + u32 type:4; /* &ice_tx_buf_type */ + u32 vid:16;DEFINE_DMA_UNMAP_LEN (len);DEFINE_DMA_UNMAP_ADDR (dma); };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 230/364 sfc: disable RXFCS and RXALL features by default
In reply to Greg Kroah-HartmanFrom: Pieter Jansen van Vuuren <[email protected]>
[ Upstream commit 134120b066044399ef59564ff3ba66ab344cfc5b ]
By default we would not want RXFCS and RXALL features enabled as they are mainly intended for debugging purposes. This does not stop users from enabling them later on as needed.
--- drivers/net/ethernet/sfc/ef100_netdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sfc/ef100_netdev.c +3 -1
@@ -378,7 +378,9 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data) efx->net_dev = net_dev;SET_NETDEV_DEV (net_dev, &efx->pci_dev->dev); - net_dev->features |= efx->type->offload_features; +/* enable all supported features except rx-fcs and rx-all */ + net_dev->features |= efx->type->offload_features & + ~(NETIF_F_RXFCS |NETIF_F_RXALL ); net_dev->hw_features |= efx->type->offload_features; net_dev->hw_enc_features |= efx->type->offload_features; net_dev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_SG |
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 231/364 vsock: avoid to close connected socket after the timeout
In reply to Greg Kroah-HartmanFrom: Zhuang Shengen <[email protected]>
[ Upstream commit 6d4486efe9c69626cab423456169e250a5cd3af5 ]
When client and server establish a connection through vsock, the client send a request to the server to initiate the connection, then start a timer to wait for the server's response. When the server's RESPONSE message arrives, the timer also times out and exits. The server's RESPONSE message is processed first, and the connection is established. However, the client's timer also times out, the original processing logic of the client is to directly set the state of this vsock to CLOSE and return ETIMEDOUT. It will not notify the server when the port is released, causing the server port remain.
when client's vsock_connect timeout,it should check sk state is ESTABLISHED or not. if sk state is ESTABLISHED, it means the connection is established, the client should not set the sk state to CLOSE
Note: I encountered this issue on kernel-4.18, which can be fixed by this patch. Then I checked the latest code in the community and found similar issue.
--- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/af_vsock.c +1 -1
@@ -1426,7 +1426,7 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,vsock_transport_cancel_pkt (vsk);vsock_remove_connected (vsk); goto out_wait; - }else if (timeout ==0 ) { + }else if ((sk->sk_state !=TCP_ESTABLISHED ) && (timeout ==0 )) { err = -ETIMEDOUT ; sk->sk_state =TCP_CLOSE ; sock->state =SS_UNCONNECTED ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 232/364 tcp: fix possible sk_priority leak in tcp_v4_send_reset()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 1e306ec49a1f206fd2cc89a42fac6e6f592a8cc1 ]
When tcp_v4_send_reset() is called with @sk == NULL, we do not change ctl_sk->sk_priority, which could have been set from a prior invocation.
Change tcp_v4_send_reset() to set sk_priority and sk_mark fields before calling ip_send_unicast_reply().
This means tcp_v4_send_reset() and tcp_v4_send_ack() no longer have to clear ctl_sk->sk_mark after their call to ip_send_unicast_reply().
--- net/ipv4/tcp_ipv4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +3 -2
@@ -829,6 +829,9 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) inet_twsk(sk)->tw_priority : sk->sk_priority; transmit_time =tcp_transmit_time (sk);xfrm_sk_clone_policy (ctl_sk, sk); + }else { + ctl_sk->sk_mark =0 ; + ctl_sk->sk_priority =0 ; } ip_send_unicast_reply(ctl_sk, skb, &TCP_SKB_CB(skb)->header.h4.opt,
@@ -836,7 +839,6 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) &arg, arg.iov[0 ].iov_len, transmit_time); - ctl_sk->sk_mark =0 ;xfrm_sk_free_policy (ctl_sk);sock_net_set (ctl_sk, &init_net);__TCP_INC_STATS (net,TCP_MIB_OUTSEGS );
@@ -935,7 +937,6 @@ static void tcp_v4_send_ack(const struct sock *sk, &arg, arg.iov[0 ].iov_len, transmit_time); - ctl_sk->sk_mark =0 ;sock_net_set (ctl_sk, &init_net);__TCP_INC_STATS (net,TCP_MIB_OUTSEGS );local_bh_enable ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 233/364 media: pvrusb2: fix DVB_CORE dependency
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 53558de2b5c4f4ee6bfcfbe34e27071c2d0073d5 ]
Now that DVB_CORE can be a loadable module, pvrusb2 can run into a link error:
ld.lld: error: undefined symbol: dvb_module_probe
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
referenced by
pvrusb2-devattr.c
drivers/media/usb/pvrusb2/pvrusb2-devattr.o:(pvr2_lgdt3306a_attach) in archive vmlinux.a
ld.lld: error: undefined symbol: dvb_module_release
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
referenced by
pvrusb2-devattr.c
drivers/media/usb/pvrusb2/pvrusb2-devattr.o:(pvr2_dual_fe_attach) in archive vmlinux.a
Refine the Kconfig dependencies to avoid this case.
--- drivers/media/usb/pvrusb2/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/pvrusb2/Kconfig +1 -0
@@ -37,6 +37,7 @@ config VIDEO_PVRUSB2_DVB bool "pvrusb2 ATSC/DVB support" default y depends on VIDEO_PVRUSB2 && DVB_CORE + depends on VIDEO_PVRUSB2=m || DVB_CORE=y select DVB_LGDT330X if MEDIA_SUBDRV_AUTOSELECT select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT select DVB_S5H1411 if MEDIA_SUBDRV_AUTOSELECT
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 234/364 serial: arc_uart: fix of_iomap leak in `arc_serial_probe`
In reply to Greg Kroah-HartmanFrom: Ke Zhang <[email protected]>
[ Upstream commit 8ab5fc55d7f65d58a3c3aeadf11bdf60267cd2bd ]
Smatch reports:
drivers/tty/serial/arc_uart.c:631 arc_serial_probe() warn:
'port->membase' from of_iomap() not released on lines: 631.
In arc_serial_probe(), if uart_add_one_port() fails, port->membase is not released, which would cause a resource leak.
To fix this, I replace of_iomap with devm_platform_ioremap_resource.
--- drivers/tty/serial/arc_uart.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/tty/serial/arc_uart.c +4 -3
@@ -606,10 +606,11 @@ static int arc_serial_probe(struct platform_device *pdev) } uart->baud = val; - port->membase =of_iomap (np,0 ); -if (!port->membase) + port->membase =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (port->membase)) {/* No point of dev_err since UART itself is hosed here */ -return -ENXIO ; +return PTR_ERR (port->membase); + } port->irq =irq_of_parse_and_map (np,0 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 235/364 serial: 8250_bcm7271: balance clk_enable calls
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
[ Upstream commit 8a3b5477256a54ae4a470dcebbcf8cdc18e4696d ]
The sw_baud clock must be disabled when the device driver is not connected to the device. This now occurs when probe fails and upon remove.
--- drivers/tty/serial/8250/8250_bcm7271.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_bcm7271.c +4 -1
@@ -1032,7 +1032,7 @@ static int brcmuart_probe(struct platform_device *pdev)if (clk_rate ==0 ) {dev_err (dev,"clock-frequency or clk not defined\n" ); ret = -EINVAL ; - goto release_dma; + goto err_clk_disable; }dev_dbg (dev,"DMA is %senabled\n" , priv->dma_enabled ?"" :"not " );
@@ -1119,6 +1119,8 @@ static int brcmuart_probe(struct platform_device *pdev)serial8250_unregister_port (priv->line); err:brcmuart_free_bufs (dev, priv); +err_clk_disable: +clk_disable_unprepare (baud_mux_clk); release_dma:if (priv->dma_enabled)brcmuart_arbitration (priv,0 );
@@ -1133,6 +1135,7 @@ static int brcmuart_remove(struct platform_device *pdev)hrtimer_cancel (&priv->hrt);serial8250_unregister_port (priv->line);brcmuart_free_bufs (&pdev->dev, priv); +clk_disable_unprepare (priv->baud_mux_clk);if (priv->dma_enabled)brcmuart_arbitration (priv,0 );return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 236/364 serial: 8250_bcm7271: fix leak in `brcmuart_probe`
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
[ Upstream commit f264f2f6f4788dc031cef60a0cf2881902736709 ]
Smatch reports:drivers/tty/serial/8250/8250_bcm7271.c:1120 brcmuart_probe() warn:
'baud_mux_clk' from clk_prepare_enable() not released on lines: 1032.
The issue is fixed by using a managed clock.
--- drivers/tty/serial/8250/8250_bcm7271.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_bcm7271.c +1 -1
@@ -1012,7 +1012,7 @@ static int brcmuart_probe(struct platform_device *pdev)of_property_read_u32 (np,"clock-frequency" , &clk_rate);/* See if a Baud clock has been specified */ - baud_mux_clk =of_clk_get_by_name (np,"sw_baud" ); + baud_mux_clk =devm_clk_get (dev,"sw_baud" );if (IS_ERR (baud_mux_clk)) {if (PTR_ERR (baud_mux_clk) == -EPROBE_DEFER ) { ret = -EPROBE_DEFER ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 237/364 erspan: get the proto with the md version for collect_md
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit d80fc101d2eb9b3188c228d61223890aeea480a4 ]
In commit 20704bd1633d ("erspan: build the header with the right proto according to erspan_ver"), it gets the proto with t->parms.erspan_ver, but t->parms.erspan_ver is not used by collect_md branch, and instead it should get the proto with md->version for collect_md.
Thanks to Kevin for pointing this out.
--- net/ipv6/ip6_gre.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
net/ipv6/ip6_gre.c +8 -5
@@ -1015,12 +1015,14 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,ntohl (tun_id),ntohl (md->u.index), truncate, false); + proto =htons (ETH_P_ERSPAN ); }else if (md->version ==2 ) {erspan_build_header_v2 (skb,ntohl (tun_id), md->u.md2.dir,get_hwid (&md->u.md2), truncate, false); + proto =htons (ETH_P_ERSPAN2 ); }else { goto tx_err; }
@@ -1043,24 +1045,25 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,break ; } -if (t->parms.erspan_ver ==1 ) +if (t->parms.erspan_ver ==1 ) {erspan_build_header (skb,ntohl (t->parms.o_key), t->parms.index, truncate, false); -else if (t->parms.erspan_ver ==2 ) + proto =htons (ETH_P_ERSPAN ); + }else if (t->parms.erspan_ver ==2 ) {erspan_build_header_v2 (skb,ntohl (t->parms.o_key), t->parms.dir, t->parms.hwid, truncate, false); -else + proto =htons (ETH_P_ERSPAN2 ); + }else { goto tx_err; + } fl6.daddr = t->parms.raddr; }/* Push GRE header. */ - proto = (t->parms.erspan_ver ==1 ) ?htons (ETH_P_ERSPAN ) - :htons (ETH_P_ERSPAN2 );gre_build_header (skb,8 ,TUNNEL_SEQ , proto,0 ,htonl (atomic_fetch_inc (&t->o_seqno)));/* TooBig packet may have updated dst->dev's mtu */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 238/364 net: dsa: rzn1-a5psw: enable management frames for CPU port
In reply to Greg Kroah-HartmanFrom: Clément Léger <[email protected]>
[ Upstream commit 9e4b45f20c5aac786c728619e5ee746bffce1798 ]
Currently, management frame were discarded before reaching the CPU port due to a misconfiguration of the MGMT_CONFIG register. Enable them by setting the correct value in this register in order to correctly receive management frame and handle STP.
--- drivers/net/dsa/rzn1_a5psw.c | 2 +- drivers/net/dsa/rzn1_a5psw.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/rzn1_a5psw.c +1 -1
@@ -673,7 +673,7 @@ static int a5psw_setup(struct dsa_switch *ds) }/* Configure management port */ - reg =A5PSW_CPU_PORT |A5PSW_MGMT_CFG_DISCARD ; + reg =A5PSW_CPU_PORT |A5PSW_MGMT_CFG_ENABLE ;a5psw_reg_writel (a5psw,A5PSW_MGMT_CFG , reg);/* Set pattern 0 to forward all frame to mgmt port */
drivers/net/dsa/rzn1_a5psw.h +1 -1
@@ -36,7 +36,7 @@#define A5PSW_INPUT_LEARN_BLOCK (p) BIT(p)#define A5PSW_MGMT_CFG 0x20 -#define A5PSW_MGMT_CFG_DISCARD BIT(7) +#define A5PSW_MGMT_CFG_ENABLE BIT(6)#define A5PSW_MODE_CFG 0x24#define A5PSW_MODE_STATS_RESET BIT(31)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 239/364 net: dsa: rzn1-a5psw: fix STP states handling
In reply to Greg Kroah-HartmanFrom: Alexis Lothoré <[email protected]>
[ Upstream commit ebe9bc50952757b4b25eaf514da7c464196c9606 ]
stp_set_state() should actually allow receiving BPDU while in LEARNING mode which is not the case. Additionally, the BLOCKEN bit does not actually forbid sending forwarded frames from that port. To fix this, add a5psw_port_tx_enable() function which allows to disable TX. However, while its name suggest that TX is totally disabled, it is not and can still allow to send BPDUs even if disabled. This can be done by using forced forwarding with the switch tagging mechanism but keeping "filtering" disabled (which is already the case in the rzn1-a5sw tag driver). With these fixes, STP support is now functional.
--- drivers/net/dsa/rzn1_a5psw.c | 57 ++++++++++++++++++++++++++++++------ drivers/net/dsa/rzn1_a5psw.h | 1 + 2 files changed, 49 insertions(+), 9 deletions(-)
drivers/net/dsa/rzn1_a5psw.c +48 -9
@@ -120,6 +120,22 @@ static void a5psw_port_mgmtfwd_set(struct a5psw *a5psw, int port, bool enable)a5psw_port_pattern_set (a5psw, port,A5PSW_PATTERN_MGMTFWD , enable); } +static void a5psw_port_tx_enable (struct a5psw *a5psw,int port,bool enable) +{ +u32 mask =A5PSW_PORT_ENA_TX (port); +u32 reg = enable ? mask :0 ; + +/* Even though the port TX is disabled through TXENA bit in the +* PORT_ENA register, it can still send BPDUs. This depends on the tag +* configuration added when sending packets from the CPU port to the +* switch port. Indeed, when using forced forwarding without filtering, +* even disabled ports will be able to send packets that are tagged. +* This allows to implement STP support when ports are in a state where +* forwarding traffic should be stopped but BPDUs should still be sent. +*/ +a5psw_reg_rmw (a5psw,A5PSW_PORT_ENA , mask, reg); +} +static void a5psw_port_enable_set (struct a5psw *a5psw,int port,bool enable) {u32 port_ena =0 ;
@@ -292,6 +308,22 @@ static int a5psw_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)return 0 ; } +static void a5psw_port_learning_set (struct a5psw *a5psw,int port,bool learn) +{ +u32 mask =A5PSW_INPUT_LEARN_DIS (port); +u32 reg = !learn ? mask :0 ; + +a5psw_reg_rmw (a5psw,A5PSW_INPUT_LEARN , mask, reg); +} + +static void a5psw_port_rx_block_set (struct a5psw *a5psw,int port,bool block) +{ +u32 mask =A5PSW_INPUT_LEARN_BLOCK (port); +u32 reg = block ? mask :0 ; + +a5psw_reg_rmw (a5psw,A5PSW_INPUT_LEARN , mask, reg); +} +static void a5psw_flooding_set_resolution (struct a5psw *a5psw,int port,bool set) {
@@ -344,28 +376,35 @@ static void a5psw_port_bridge_leave(struct dsa_switch *ds, int port,static void a5psw_port_stp_state_set (struct dsa_switch *ds,int port,u8 state) { -u32 mask =A5PSW_INPUT_LEARN_DIS (port) |A5PSW_INPUT_LEARN_BLOCK (port); +bool learning_enabled, rx_enabled, tx_enabled;struct a5psw *a5psw = ds->priv; -u32 reg =0 ;switch (state) {case BR_STATE_DISABLED :case BR_STATE_BLOCKING : - reg |=A5PSW_INPUT_LEARN_DIS (port); - reg |=A5PSW_INPUT_LEARN_BLOCK (port); -break ;case BR_STATE_LISTENING : - reg |=A5PSW_INPUT_LEARN_DIS (port); + rx_enabled = false; + tx_enabled = false; + learning_enabled = false;break ;case BR_STATE_LEARNING : - reg |=A5PSW_INPUT_LEARN_BLOCK (port); + rx_enabled = false; + tx_enabled = false; + learning_enabled = true;break ;case BR_STATE_FORWARDING : -default : + rx_enabled = true; + tx_enabled = true; + learning_enabled = true;break ; +default : +dev_err (ds->dev,"invalid STP state: %d\n" , state); +return ; } -a5psw_reg_rmw (a5psw,A5PSW_INPUT_LEARN , mask, reg); +a5psw_port_learning_set (a5psw, port, learning_enabled); +a5psw_port_rx_block_set (a5psw, port, !rx_enabled); +a5psw_port_tx_enable (a5psw, port, tx_enabled); }static void a5psw_port_fast_age (struct dsa_switch *ds,int port)
drivers/net/dsa/rzn1_a5psw.h +1 -0
@@ -19,6 +19,7 @@#define A5PSW_PORT_OFFSET (port) (0x400 * (port))#define A5PSW_PORT_ENA 0x8 +#define A5PSW_PORT_ENA_TX (port) BIT(port)#define A5PSW_PORT_ENA_RX_SHIFT 16#define A5PSW_PORT_ENA_TX_RX (port) (BIT((port) + A5PSW_PORT_ENA_RX_SHIFT) | \ BIT(port))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 240/364 net: dsa: rzn1-a5psw: disable learning for standalone ports
In reply to Greg Kroah-HartmanFrom: Clément Léger <[email protected]>
[ Upstream commit ec52b69c046a6219011af780aca155a96719637b ]
When ports are in standalone mode, they should have learning disabled to avoid adding new entries in the MAC lookup table which might be used by other bridge ports to forward packets. While adding that, also make sure learning is enabled for CPU port.
--- drivers/net/dsa/rzn1_a5psw.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/net/dsa/rzn1_a5psw.c +16 -8
@@ -340,6 +340,14 @@ static void a5psw_flooding_set_resolution(struct a5psw *a5psw, int port,a5psw_reg_writel (a5psw, offsets[i], a5psw->bridged_ports); } +static void a5psw_port_set_standalone (struct a5psw *a5psw,int port, +bool standalone) +{ +a5psw_port_learning_set (a5psw, port, !standalone); +a5psw_flooding_set_resolution (a5psw, port, !standalone); +a5psw_port_mgmtfwd_set (a5psw, port, standalone); +} + static int a5psw_port_bridge_join(struct dsa_switch *ds, int port, struct dsa_bridge bridge, bool *tx_fwd_offload,
@@ -355,8 +363,7 @@ static int a5psw_port_bridge_join(struct dsa_switch *ds, int port, } a5psw->br_dev = bridge.dev; -a5psw_flooding_set_resolution (a5psw, port, true); -a5psw_port_mgmtfwd_set (a5psw, port, false); +a5psw_port_set_standalone (a5psw, port, false);return 0 ; }
@@ -366,8 +373,7 @@ static void a5psw_port_bridge_leave(struct dsa_switch *ds, int port, {struct a5psw *a5psw = ds->priv; -a5psw_flooding_set_resolution (a5psw, port, false); -a5psw_port_mgmtfwd_set (a5psw, port, true); +a5psw_port_set_standalone (a5psw, port, true);/* No more ports bridged */ if (a5psw->bridged_ports ==BIT (A5PSW_CPU_PORT ))
@@ -761,13 +767,15 @@ static int a5psw_setup(struct dsa_switch *ds)if (dsa_port_is_unused (dp))continue ; -/* Enable egress flooding for CPU port */ -if (dsa_port_is_cpu (dp)) +/* Enable egress flooding and learning for CPU port */ +if (dsa_port_is_cpu (dp)) {a5psw_flooding_set_resolution (a5psw, port, true); +a5psw_port_learning_set (a5psw, port, true); + } -/* Enable management forward only for user ports */ +/* Enable standalone mode for user ports */ if (dsa_port_is_user (dp)) -a5psw_port_mgmtfwd_set (a5psw, port, true); +a5psw_port_set_standalone (a5psw, port, true); }return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 241/364 net: hns3: fix output information incomplete for dumping tx queue info with debugfs
In reply to Greg Kroah-HartmanFrom: Jie Wang <[email protected]>
[ Upstream commit 89f6bfb071182f05d7188c255b0e7251c3806f16 ]
In function hns3_dump_tx_queue_info, The print buffer is not enough when the tx BD number is configured to 32760. As a result several BD information wouldn't be displayed.
So fix it by increasing the tx queue print buffer length.
--- drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +1 -1
@@ -130,7 +130,7 @@ static struct hns3_dbg_cmd_info hns3_dbg_cmd[] = { .name = "tx_bd_queue", .cmd = HNAE3_DBG_CMD_TX_BD, .dentry = HNS3_DBG_DENTRY_TX_BD, - .buf_len = HNS3_DBG_READ_LEN_4MB, + .buf_len = HNS3_DBG_READ_LEN_5MB, .init = hns3_dbg_bd_file_init, }, {
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h +1 -0
@@ -10,6 +10,7 @@#define HNS3_DBG_READ_LEN_128KB 0x20000#define HNS3_DBG_READ_LEN_1MB 0x100000#define HNS3_DBG_READ_LEN_4MB 0x400000 +#define HNS3_DBG_READ_LEN_5MB 0x500000#define HNS3_DBG_WRITE_LEN 1024#define HNS3_DBG_DATA_STR_LEN 32
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 242/364 net: hns3: fix sending pfc frames after reset issue
In reply to Greg Kroah-HartmanFrom: Jijie Shao <[email protected]>
[ Upstream commit f14db07064727dd3bc0906c77a6d2759c1bbb395 ]
To prevent the system from abnormally sending PFC frames after an abnormal reset. The hns3 driver notifies the firmware to disable pfc before reset.
--- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 +++++++++------ .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 4 ++-- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 5 +++++ 3 files changed, 16 insertions(+), 8 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +9 -6
@@ -8053,12 +8053,15 @@ static void hclge_ae_stop(struct hnae3_handle *handle)/* If it is not PF reset or FLR, the firmware will disable the MAC, * so it only need to stop phy here. */ -if (test_bit (HCLGE_STATE_RST_HANDLING , &hdev->state) && - hdev->reset_type !=HNAE3_FUNC_RESET && - hdev->reset_type !=HNAE3_FLR_RESET ) { -hclge_mac_stop_phy (hdev); -hclge_update_link_status (hdev); -return ; +if (test_bit (HCLGE_STATE_RST_HANDLING , &hdev->state)) { +hclge_pfc_pause_en_cfg (hdev,HCLGE_PFC_TX_RX_DISABLE , +HCLGE_PFC_DISABLE ); +if (hdev->reset_type !=HNAE3_FUNC_RESET && + hdev->reset_type !=HNAE3_FLR_RESET ) { +hclge_mac_stop_phy (hdev); +hclge_update_link_status (hdev); +return ; + } }hclge_reset_tqp (handle);
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +2 -2
@@ -171,8 +171,8 @@ int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx)return hclge_cmd_send (&hdev->hw, &desc,1 ); } -static int hclge_pfc_pause_en_cfg (struct hclge_dev *hdev,u8 tx_rx_bitmap, -u8 pfc_bitmap) +int hclge_pfc_pause_en_cfg (struct hclge_dev *hdev,u8 tx_rx_bitmap, +u8 pfc_bitmap) {struct hclge_desc desc;struct hclge_pfc_en_cmd *pfc = (struct hclge_pfc_en_cmd *)desc.data;
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h +5 -0
@@ -164,6 +164,9 @@ struct hclge_bp_to_qs_map_cmd {u32 rsvd1; }; +#define HCLGE_PFC_DISABLE 0 +#define HCLGE_PFC_TX_RX_DISABLE 0 +struct hclge_pfc_en_cmd {u8 tx_rx_en_bitmap;u8 pri_en_bitmap;
@@ -235,6 +238,8 @@ void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);void hclge_tm_pfc_info_update (struct hclge_dev *hdev);int hclge_tm_dwrr_cfg (struct hclge_dev *hdev);int hclge_tm_init_hw (struct hclge_dev *hdev,bool init); +int hclge_pfc_pause_en_cfg (struct hclge_dev *hdev,u8 tx_rx_bitmap, +u8 pfc_bitmap);int hclge_mac_pause_en_cfg (struct hclge_dev *hdev,bool tx,bool rx);int hclge_pause_addr_cfg (struct hclge_dev *hdev,const u8 *mac_addr);void hclge_pfc_rx_stats_get (struct hclge_dev *hdev,u64 *stats);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 243/364 net: hns3: fix reset delay time to avoid configuration timeout
In reply to Greg Kroah-HartmanFrom: Jie Wang <[email protected]>
[ Upstream commit 814d0c786068e858d889ada3153bff82f64223ad ]
Currently the hns3 vf function reset delays 5000ms before vf rebuild process. In product applications, this delay is too long for application configurations and causes configuration timeout.
According to the tests, 500ms delay is enough for reset process except PF FLR. So this patch modifies delay to 500ms in these scenarios.
--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +4 -1
@@ -1436,7 +1436,10 @@ static int hclgevf_reset_wait(struct hclgevf_dev *hdev)* might happen in case reset assertion was made by PF. Yes, this also * means we might end up waiting bit more even for VF reset. */ -msleep (5000 ); +if (hdev->reset_type ==HNAE3_VF_FULL_RESET ) +msleep (5000 ); +else +msleep (500 );return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 244/364 net: hns3: fix reset timeout when enable full VF
In reply to Greg Kroah-HartmanFrom: Jijie Shao <[email protected]>
[ Upstream commit 6b45d5ff8c2c61baddd67d7510075ae121c5e704 ]
The timeout of the cmdq reset command has been increased to resolve the reset timeout issue in the full VF scenario. The timeout of other cmdq commands remains unchanged.
--- .../hns3/hns3_common/hclge_comm_cmd.c | 25 ++++++++++++++++--- .../hns3/hns3_common/hclge_comm_cmd.h | 8 +++++- 2 files changed, 28 insertions(+), 5 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c +21 -4
@@ -330,9 +330,25 @@ static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)return head == hw->cmq.csq.next_to_use; } -static void hclge_comm_wait_for_resp (struct hclge_comm_hw *hw, +static u32 hclge_get_cmdq_tx_timeout (u16 opcode,u32 tx_timeout) +{ +static const struct hclge_cmdq_tx_timeout_map cmdq_tx_timeout_map[] = { + {HCLGE_OPC_CFG_RST_TRIGGER ,HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS }, + }; +u32 i; + +for (i =0 ; i <ARRAY_SIZE (cmdq_tx_timeout_map); i++) +if (cmdq_tx_timeout_map[i].opcode == opcode) +return cmdq_tx_timeout_map[i].tx_timeout; + +return tx_timeout; +} + +static void hclge_comm_wait_for_resp (struct hclge_comm_hw *hw,u16 opcode,bool *is_completed) { +u32 cmdq_tx_timeout =hclge_get_cmdq_tx_timeout (opcode, + hw->cmq.tx_timeout);u32 timeout =0 ; do {
@@ -342,7 +358,7 @@ static void hclge_comm_wait_for_resp(struct hclge_comm_hw *hw, }udelay (1 ); timeout++; - }while (timeout < hw->cmq.tx_timeout); + }while (timeout < cmdq_tx_timeout); }static int hclge_comm_cmd_convert_err_code (u16 desc_ret)
@@ -406,7 +422,8 @@ static int hclge_comm_cmd_check_result(struct hclge_comm_hw *hw,* if multi descriptors to be sent, use the first one to check */ if (HCLGE_COMM_SEND_SYNC (le16_to_cpu (desc->flag))) -hclge_comm_wait_for_resp (hw, &is_completed); +hclge_comm_wait_for_resp (hw,le16_to_cpu (desc->opcode), + &is_completed);if (!is_completed) ret = -EBADE ;
@@ -528,7 +545,7 @@ int hclge_comm_cmd_queue_init(struct pci_dev *pdev, struct hclge_comm_hw *hw) cmdq->crq.desc_num =HCLGE_COMM_NIC_CMQ_DESC_NUM ;/* Setup Tx write back timeout */ - cmdq->tx_timeout =HCLGE_COMM_CMDQ_TX_TIMEOUT ; + cmdq->tx_timeout =HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT ;/* Setup queue rings */ ret =hclge_comm_alloc_cmd_queue (hw,HCLGE_COMM_TYPE_CSQ );
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +7 -1
@@ -54,7 +54,8 @@#define HCLGE_COMM_NIC_SW_RST_RDY BIT(HCLGE_COMM_NIC_SW_RST_RDY_B)#define HCLGE_COMM_NIC_CMQ_DESC_NUM_S 3#define HCLGE_COMM_NIC_CMQ_DESC_NUM 1024 -#define HCLGE_COMM_CMDQ_TX_TIMEOUT 30000 +#define HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT 30000 +#define HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS 500000enum hclge_opcode_type {/* Generic commands */
@@ -357,6 +358,11 @@ struct hclge_comm_caps_bit_map {u16 local_bit; }; +struct hclge_cmdq_tx_timeout_map { +u32 opcode; +u32 tx_timeout; +}; +struct hclge_comm_firmware_compat_cmd {__le32 compat;u8 rsv[20 ];
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 245/364 media: netup_unidvb: fix use-after-free at del_timer()
In reply to Greg Kroah-HartmanFrom: Duoming Zhou <[email protected]>
[ Upstream commit 0f5bb36bf9b39a2a96e730bf4455095b50713f63 ]
When Universal DVB card is detaching, netup_unidvb_dma_fini() uses del_timer() to stop dma->timeout timer. But when timer handler netup_unidvb_dma_timeout() is running, del_timer() could not stop it. As a result, the use-after-free bug could happen. The process is shown below:
(cleanup routine) | (timer routine)
| mod_timer(&dev->tx_sim_timer, ..)
netup_unidvb_finidev() | (wait a time)
netup_unidvb_dma_fini() | netup_unidvb_dma_timeout()
del_timer(&dma->timeout); |
| ndev->pci_dev->dev //USEFix by changing del_timer() to del_timer_sync().
--- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +1 -1
@@ -697,7 +697,7 @@ static void netup_unidvb_dma_fini(struct netup_unidvb_dev *ndev, int num)netup_unidvb_dma_enable (dma,0 );msleep (50 );cancel_work_sync (&dma->work); -del_timer (&dma->timeout); +del_timer_sync (&dma->timeout); }static int netup_unidvb_dma_setup (struct netup_unidvb_dev *ndev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 246/364 SUNRPC: double free xprt_ctxt while still in use
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit eb8d3a2c809abd73ab0a060fe971d6b9019aa3c1 ]
When an RPC request is deferred, the rq_xprt_ctxt pointer is moved out of the svc_rqst into the svc_deferred_req.
When the deferred request is revisited, the pointer is copied into the new svc_rqst - and also remains in the svc_deferred_req.
In the (rare?) case that the request is deferred a second time, the old svc_deferred_req is reused - it still has all the correct content. However in that case the rq_xprt_ctxt pointer is NOT cleared so that when xpo_release_xprt is called, the ctxt is freed (UDP) or possible added to a free list (RDMA).
When the deferred request is revisited for a second time, it will reference this ctxt which may be invalid, and the free the object a second time which is likely to oops.
So change svc_defer() to *always* clear rq_xprt_ctxt, and assert that the value is now stored in the svc_deferred_req.
--- net/sunrpc/svc_xprt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/svc_xprt.c +2 -1
@@ -1224,13 +1224,14 @@ static struct cache_deferred_req *svc_defer(struct cache_req *req) dr->daddr = rqstp->rq_daddr; dr->argslen = rqstp->rq_arg.len >>2 ; dr->xprt_ctxt = rqstp->rq_xprt_ctxt; - rqstp->rq_xprt_ctxt =NULL ;/* back up head to the start of the buffer and copy */ skip = rqstp->rq_arg.len - rqstp->rq_arg.head[0 ].iov_len;memcpy (dr->args, rqstp->rq_arg.head[0 ].iov_base - skip, dr->argslen <<2 ); } +WARN_ON_ONCE (rqstp->rq_xprt_ctxt != dr->xprt_ctxt); + rqstp->rq_xprt_ctxt =NULL ;trace_svc_defer (rqstp);svc_xprt_get (rqstp->rq_xprt); dr->xprt = rqstp->rq_xprt;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 247/364 SUNRPC: always free ctxt when freeing deferred request
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit 948f072ada23e0a504c5e4d7d71d4c83bd0785ec ]
Since the ->xprt_ctxt pointer was added to svc_deferred_req, it has not been sufficient to use kfree() to free a deferred request. We may need to free the ctxt as well.
As freeing the ctxt is all that ->xpo_release_rqst() does, we repurpose it to explicit do that even when the ctxt is not stored in an rqst. So we now have ->xpo_release_ctxt() which is given an xprt and a ctxt, which may have been taken either from an rqst or from a dreq. The caller is now responsible for clearing that pointer after the call to ->xpo_release_ctxt.
We also clear dr->xprt_ctxt when the ctxt is moved into a new rqst when revisiting a deferred request. This ensures there is only one pointer to the ctxt, so the risk of double freeing in future is reduced. The new code in svc_xprt_release which releases both the ctxt and any rq_deferred depends on this.
--- include/linux/sunrpc/svc_rdma.h | 2 +- include/linux/sunrpc/svc_xprt.h | 2 +- net/sunrpc/svc_xprt.c | 23 +++++++++++++----- net/sunrpc/svcsock.c | 30 +++++++++++++----------- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 11 ++++----- net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +- 6 files changed, 41 insertions(+), 29 deletions(-)
include/linux/sunrpc/svc_rdma.h +1 -1
@@ -176,7 +176,7 @@ extern struct svc_rdma_recv_ctxt *extern void svc_rdma_recv_ctxt_put (struct svcxprt_rdma *rdma,struct svc_rdma_recv_ctxt *ctxt);extern void svc_rdma_flush_recv_queues (struct svcxprt_rdma *rdma); -extern void svc_rdma_release_rqst (struct svc_rqst *rqstp); +extern void svc_rdma_release_ctxt (struct svc_xprt *xprt,void *ctxt);extern int svc_rdma_recvfrom (struct svc_rqst *);/* svc_rdma_rw.c */
include/linux/sunrpc/svc_xprt.h +1 -1
@@ -23,7 +23,7 @@ struct svc_xprt_ops {int (*xpo_sendto)(struct svc_rqst *);int (*xpo_result_payload)(struct svc_rqst *,unsigned int ,unsigned int ); -void (*xpo_release_rqst)(struct svc_rqst *); +void (*xpo_release_ctxt)(struct svc_xprt *xprt,void *ctxt);void (*xpo_detach)(struct svc_xprt *);void (*xpo_free)(struct svc_xprt *);void (*xpo_kill_temp_xprt)(struct svc_xprt *);
net/sunrpc/svc_xprt.c +17 -6
@@ -532,13 +532,23 @@ void svc_reserve(struct svc_rqst *rqstp, int space) }EXPORT_SYMBOL_GPL (svc_reserve); +static void free_deferred (struct svc_xprt *xprt,struct svc_deferred_req *dr) +{ +if (!dr) +return ; + + xprt->xpt_ops->xpo_release_ctxt (xprt, dr->xprt_ctxt); +kfree (dr); +} +static void svc_xprt_release (struct svc_rqst *rqstp) {struct svc_xprt *xprt = rqstp->rq_xprt; - xprt->xpt_ops->xpo_release_rqst (rqstp); + xprt->xpt_ops->xpo_release_ctxt (xprt, rqstp->rq_xprt_ctxt); + rqstp->rq_xprt_ctxt =NULL ; -kfree (rqstp->rq_deferred); +free_deferred (xprt, rqstp->rq_deferred); rqstp->rq_deferred =NULL ;pagevec_release (&rqstp->rq_pvec);
@@ -1055,7 +1065,7 @@ static void svc_delete_xprt(struct svc_xprt *xprt)spin_unlock_bh (&serv->sv_lock);while ((dr =svc_deferred_dequeue (xprt)) !=NULL ) -kfree (dr); +free_deferred (xprt, dr);call_xpt_users (xprt);svc_xprt_put (xprt);
@@ -1177,8 +1187,8 @@ static void svc_revisit(struct cache_deferred_req *dreq, int too_many)if (too_many ||test_bit (XPT_DEAD , &xprt->xpt_flags)) {spin_unlock (&xprt->xpt_lock);trace_svc_defer_drop (dr); +free_deferred (xprt, dr);svc_xprt_put (xprt); -kfree (dr);return ; } dr->xprt =NULL ;
@@ -1223,14 +1233,13 @@ static struct cache_deferred_req *svc_defer(struct cache_req *req) dr->addrlen = rqstp->rq_addrlen; dr->daddr = rqstp->rq_daddr; dr->argslen = rqstp->rq_arg.len >>2 ; - dr->xprt_ctxt = rqstp->rq_xprt_ctxt;/* back up head to the start of the buffer and copy */ skip = rqstp->rq_arg.len - rqstp->rq_arg.head[0 ].iov_len;memcpy (dr->args, rqstp->rq_arg.head[0 ].iov_base - skip, dr->argslen <<2 ); } -WARN_ON_ONCE (rqstp->rq_xprt_ctxt != dr->xprt_ctxt); + dr->xprt_ctxt = rqstp->rq_xprt_ctxt; rqstp->rq_xprt_ctxt =NULL ;trace_svc_defer (rqstp);svc_xprt_get (rqstp->rq_xprt);
@@ -1264,6 +1273,8 @@ static noinline int svc_deferred_recv(struct svc_rqst *rqstp) rqstp->rq_daddr = dr->daddr; rqstp->rq_respages = rqstp->rq_pages; rqstp->rq_xprt_ctxt = dr->xprt_ctxt; + + dr->xprt_ctxt =NULL ;svc_xprt_received (rqstp->rq_xprt);return dr->argslen <<2 ; }
net/sunrpc/svcsock.c +16 -14
@@ -112,27 +112,27 @@ static void svc_reclassify_socket(struct socket *sock)#endif /** -* svc_tcp_release_rqst - Release transport-related resources -* @rqstp: request structure with resources to be released +* svc_tcp_release_ctxt - Release transport-related resources +* @xprt: the transport which owned the context +* @ctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt * */ -static void svc_tcp_release_rqst (struct svc_rqst *rqstp) +static void svc_tcp_release_ctxt (struct svc_xprt *xprt,void *ctxt) { }/** -* svc_udp_release_rqst - Release transport-related resources -* @rqstp: request structure with resources to be released +* svc_udp_release_ctxt - Release transport-related resources +* @xprt: the transport which owned the context +* @ctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt * */ -static void svc_udp_release_rqst (struct svc_rqst *rqstp) +static void svc_udp_release_ctxt (struct svc_xprt *xprt,void *ctxt) { -struct sk_buff *skb = rqstp->rq_xprt_ctxt; +struct sk_buff *skb = ctxt; -if (skb) { - rqstp->rq_xprt_ctxt =NULL ; +if (skb)consume_skb (skb); - } }union svc_pktinfo_u {
@@ -560,7 +560,8 @@ static int svc_udp_sendto(struct svc_rqst *rqstp)unsigned int sent;int err; -svc_udp_release_rqst (rqstp); +svc_udp_release_ctxt (xprt, rqstp->rq_xprt_ctxt); + rqstp->rq_xprt_ctxt =NULL ;svc_set_cmsg_data (rqstp, cmh);
@@ -632,7 +633,7 @@ static const struct svc_xprt_ops svc_udp_ops = { .xpo_recvfrom = svc_udp_recvfrom, .xpo_sendto = svc_udp_sendto, .xpo_result_payload = svc_sock_result_payload, - .xpo_release_rqst = svc_udp_release_rqst, + .xpo_release_ctxt = svc_udp_release_ctxt, .xpo_detach = svc_sock_detach, .xpo_free = svc_sock_free, .xpo_has_wspace = svc_udp_has_wspace,
@@ -1162,7 +1163,8 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp)unsigned int sent;int err; -svc_tcp_release_rqst (rqstp); +svc_tcp_release_ctxt (xprt, rqstp->rq_xprt_ctxt); + rqstp->rq_xprt_ctxt =NULL ;atomic_inc (&svsk->sk_sendqlen);mutex_lock (&xprt->xpt_mutex);
@@ -1207,7 +1209,7 @@ static const struct svc_xprt_ops svc_tcp_ops = { .xpo_recvfrom = svc_tcp_recvfrom, .xpo_sendto = svc_tcp_sendto, .xpo_result_payload = svc_sock_result_payload, - .xpo_release_rqst = svc_tcp_release_rqst, + .xpo_release_ctxt = svc_tcp_release_ctxt, .xpo_detach = svc_tcp_sock_detach, .xpo_free = svc_sock_free, .xpo_has_wspace = svc_tcp_has_wspace,
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +5 -6
@@ -239,21 +239,20 @@ void svc_rdma_recv_ctxt_put(struct svcxprt_rdma *rdma, }/** -* svc_rdma_release_rqst - Release transport-specific per-rqst resources -* @rqstp: svc_rqst being released +* svc_rdma_release_ctxt - Release transport-specific per-rqst resources +* @xprt: the transport which owned the context +* @vctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt * * Ensure that the recv_ctxt is released whether or not a Reply * was sent. For example, the client could close the connection, * or svc_process could drop an RPC, before the Reply is sent. */ -void svc_rdma_release_rqst (struct svc_rqst *rqstp) +void svc_rdma_release_ctxt (struct svc_xprt *xprt,void *vctxt) { -struct svc_rdma_recv_ctxt *ctxt = rqstp->rq_xprt_ctxt; -struct svc_xprt *xprt = rqstp->rq_xprt; +struct svc_rdma_recv_ctxt *ctxt = vctxt;struct svcxprt_rdma *rdma = container_of(xprt, struct svcxprt_rdma, sc_xprt); - rqstp->rq_xprt_ctxt =NULL ;if (ctxt)svc_rdma_recv_ctxt_put (rdma, ctxt); }
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
@@ -80,7 +80,7 @@ static const struct svc_xprt_ops svc_rdma_ops = { .xpo_recvfrom = svc_rdma_recvfrom, .xpo_sendto = svc_rdma_sendto, .xpo_result_payload = svc_rdma_result_payload, - .xpo_release_rqst = svc_rdma_release_rqst, + .xpo_release_ctxt = svc_rdma_release_ctxt, .xpo_detach = svc_rdma_detach, .xpo_free = svc_rdma_free, .xpo_has_wspace = svc_rdma_has_wspace,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 248/364 SUNRPC: Fix trace_svc_register() call site
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit 07a27305938559fb35f7a46fb90a5e37728bdee6 ]
The trace event recorded incorrect values for the registered family, protocol, and port because the arguments are in the wrong order.
--- net/sunrpc/svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/svc.c +1 -1
@@ -1018,7 +1018,7 @@ static int __svc_register(struct net *net, const char *progname,#endif } -trace_svc_register (progname, version, protocol, port, family, error); +trace_svc_register (progname, version, family, protocol, port, error);return error; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 249/364 ASoC: SOF: ipc3-topology: Make sure that only one cmd is sent in dai_config
In reply to Greg Kroah-HartmanFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit 4708449eafe60742334606168926985798c9c9b8 ]
The commands in sof_ipc_dai_config.flags are encoded as bits:
1 (bit0) - hw_params
2 (bit1) - hw_free
4 (bit2) - pause
These are commands, they cannot be combined as one would assume, for example
3 (bit0 | bit1) is invalid.
This can happen right at the second start of a stream as at the end of the first stream we set the hw_free command (bit1) and on the second start we would OR on top of it the hw_params (bit0).
--- sound/soc/sof/ipc3-topology.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/sof/ipc3-topology.c +5 -2
@@ -2111,10 +2111,13 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget ** For the case of PAUSE/HW_FREE, since there are no quirks, flags can be used as is. */ -if (flags &SOF_DAI_CONFIG_FLAGS_HW_PARAMS ) +if (flags &SOF_DAI_CONFIG_FLAGS_HW_PARAMS ) { +/* Clear stale command */ + config->flags &= ~SOF_DAI_CONFIG_FLAGS_CMD_MASK ; config->flags |= flags; -else + }else { config->flags = flags; + }/* only send the IPC if the widget is set up in the DSP */ if (swidget->use_count >0 ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 250/364 ASoC: mediatek: mt8186: Fix use-after-free in driver remove path
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit a93d2afd3f77a7331271a0f25c6a11003db69b3c ]
When devm runs function in the "remove" path for a device it runs them in the reverse order. That means that if you have parts of your driver that aren't using devm or are using "roll your own" devm w/ devm_add_action_or_reset() you need to keep that in mind.
The mt8186 audio driver didn't quite get this right. Specifically, in mt8186_init_clock() it called mt8186_audsys_clk_register() and then went on to call a bunch of other devm function. The caller of mt8186_init_clock() used devm_add_action_or_reset() to call mt8186_deinit_clock() but, because of the intervening devm functions, the order was wrong.
Specifically at probe time, the order was:
1. mt8186_audsys_clk_register()
2. afe_priv->clk = devm_kcalloc(...)
3. afe_priv->clk[i] = devm_clk_get(...)
At remove time, the order (which should have been 3, 2, 1) was:
1. mt8186_audsys_clk_unregister()
3. Free all of afe_priv->clk[i]
2. Free afe_priv->clk
The above seemed to be causing a use-after-free. Luckily, it's easy to fix this by simply using devm more correctly. Let's move the devm_add_action_or_reset() to the right place. In addition to fixing the use-after-free, code inspection shows that this fixes a leak (missing call to mt8186_audsys_clk_unregister()) that would have happened if any of the syscon_regmap_lookup_by_phandle() calls in mt8186_init_clock() had failed.
--- sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 6 --- sound/soc/mediatek/mt8186/mt8186-afe-clk.h | 1 - sound/soc/mediatek/mt8186/mt8186-afe-pcm.c | 4 -- sound/soc/mediatek/mt8186/mt8186-audsys-clk.c | 46 ++++++++++--------- sound/soc/mediatek/mt8186/mt8186-audsys-clk.h | 1 - 5 files changed, 24 insertions(+), 34 deletions(-)
sound/soc/mediatek/mt8186/mt8186-afe-clk.c +0 -6
@@ -644,9 +644,3 @@ int mt8186_init_clock(struct mtk_base_afe *afe)return 0 ; } - -void mt8186_deinit_clock (void *priv) -{ -struct mtk_base_afe *afe = priv; -mt8186_audsys_clk_unregister (afe); -}
sound/soc/mediatek/mt8186/mt8186-afe-clk.h +0 -1
@@ -81,7 +81,6 @@ enum {struct mtk_base_afe ;int mt8186_set_audio_int_bus_parent (struct mtk_base_afe *afe,int clk_id);int mt8186_init_clock (struct mtk_base_afe *afe); -void mt8186_deinit_clock (void *priv);int mt8186_afe_enable_cgs (struct mtk_base_afe *afe);void mt8186_afe_disable_cgs (struct mtk_base_afe *afe);int mt8186_afe_enable_clock (struct mtk_base_afe *afe);
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c +0 -4
@@ -2848,10 +2848,6 @@ static int mt8186_afe_pcm_dev_probe(struct platform_device *pdev)return ret; } - ret =devm_add_action_or_reset (dev, mt8186_deinit_clock, (void *)afe); -if (ret) -return ret; -/* init memif */ afe->memif_32bit_supported =0 ; afe->memif_size =MT8186_MEMIF_NUM ;
sound/soc/mediatek/mt8186/mt8186-audsys-clk.c +24 -22
57 lines not on this page · raw message
sound/soc/mediatek/mt8186/mt8186-audsys-clk.h +0 -1
@@ -10,6 +10,5 @@#define _MT8186_AUDSYS_CLK_H_int mt8186_audsys_clk_register (struct mtk_base_afe *afe); -void mt8186_audsys_clk_unregister (struct mtk_base_afe *afe);#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 251/364 ASoC: SOF: topology: Fix logic for copying tuples
In reply to Greg Kroah-HartmanFrom: Ranjani Sridharan <[email protected]>
[ Upstream commit 41c5305cc3d827d2ea686533777a285176ae01a0 ]
Topology could have more instances of the tokens being searched for than the number of sets that need to be copied. Stop copying token after the limit of number of token instances has been reached. This worked before only by chance as we had allocated more size for the tuples array than the number of actual tokens being parsed.
--- sound/soc/sof/topology.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/sof/topology.c +4 -0
@@ -586,6 +586,10 @@ static int sof_copy_tuples(struct snd_sof_dev *sdev, struct snd_soc_tplg_vendor_if (*num_copied_tuples == tuples_size)return 0 ; } + +/* stop when we've found the required token instances */ +if (found == num_tokens * token_instance_num) +return 0 ; }/* next array */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 252/364 drm/exynos: fix g2d_open/close helper function definitions
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 2ef0785b30bd6549ddbc124979f1b6596e065ae2 ]
The empty stub functions are defined as global functions, which causes a warning because of missing prototypes:
drivers/gpu/drm/exynos/exynos_drm_g2d.h:37:5: error: no previous prototype for 'g2d_open' drivers/gpu/drm/exynos/exynos_drm_g2d.h:42:5: error: no previous prototype for 'g2d_close'
Mark them as 'static inline' to avoid the warning and to make them behave as intended.
--- drivers/gpu/drm/exynos/exynos_drm_g2d.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_g2d.h +2 -2
@@ -34,11 +34,11 @@ static inline int exynos_g2d_exec_ioctl(struct drm_device *dev, void *data, return -ENODEV; } -int g2d_open (struct drm_device *drm_dev,struct drm_file *file) +static inline int g2d_open (struct drm_device *drm_dev,struct drm_file *file) {return 0 ; } -void g2d_close (struct drm_device *drm_dev,struct drm_file *file) +static inline void g2d_close (struct drm_device *drm_dev,struct drm_file *file) { }#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 253/364 net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
In reply to Greg Kroah-HartmanFrom: Dong Chenchen <[email protected]>
[ Upstream commit c83b49383b595be50647f0c764a48c78b5f3c4f8 ]
As the call trace shows, skb_panic was caused by wrong skb->mac_header in nsh_gso_segment():
invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 3 PID: 2737 Comm: syz Not tainted 6.3.0-next-20230505 #1 RIP: 0010:skb_panic+0xda/0xe0 call Trace: skb_push+0x91/0xa0 nsh_gso_segment+0x4f3/0x570 skb_mac_gso_segment+0x19e/0x270 __skb_gso_segment+0x1e8/0x3c0 validate_xmit_skb+0x452/0x890 validate_xmit_skb_list+0x99/0xd0 sch_direct_xmit+0x294/0x7c0 __dev_queue_xmit+0x16f0/0x1d70 packet_xmit+0x185/0x210 packet_snd+0xc15/0x1170 packet_sendmsg+0x7b/0xa0 sock_sendmsg+0x14f/0x160
The root cause is:nsh_gso_segment() use skb->network_header - nhoff to reset mac_header in skb_gso_error_unwind() if inner-layer protocol gso fails. However, skb->network_header may be reset by inner-layer protocol gso function e.g. mpls_gso_segment. skb->mac_header reset by the inaccurate network_header will be larger than skb headroom.
nsh_gso_segment
nhoff = skb->network_header - skb->mac_header;
__skb_pull(skb,nsh_len)
skb_mac_gso_segment
mpls_gso_segment
skb_reset_network_header(skb);//skb->network_header+=nsh_len
return -EINVAL;
skb_gso_error_unwind
skb_push(skb, nsh_len);
skb->mac_header = skb->network_header - nhoff;
// skb->mac_header > skb->headroom, cause skb_push panicUse correct mac_offset to restore mac_header and get rid of nhoff.
--- net/nsh/nsh.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
net/nsh/nsh.c +3 -5
@@ -77,13 +77,12 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb, netdev_features_t features) {struct sk_buff *segs =ERR_PTR (-EINVAL ); +u16 mac_offset = skb->mac_header;unsigned int nsh_len, mac_len;__be16 proto; -int nhoff;skb_reset_network_header (skb); - nhoff = skb->network_header - skb->mac_header; mac_len = skb->mac_len;if (unlikely (!pskb_may_pull (skb,NSH_BASE_HDR_LEN )))
@@ -108,15 +107,14 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb, segs =skb_mac_gso_segment (skb, features);if (IS_ERR_OR_NULL (segs)) {skb_gso_error_unwind (skb,htons (ETH_P_NSH ), nsh_len, - skb->network_header - nhoff, - mac_len); + mac_offset, mac_len); goto out; }for (skb = segs; skb; skb = skb->next) { skb->protocol =htons (ETH_P_NSH );__skb_push (skb, nsh_len); -skb_set_mac_header (skb, -nhoff); + skb->mac_header = mac_offset; skb->network_header = skb->mac_header + mac_len; skb->mac_len = mac_len; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 254/364 net: fec: remove the xdp_return_frame when lack of tx BDs
In reply to Greg Kroah-HartmanFrom: Shenwei Wang <[email protected]>
[ Upstream commit 6ead9c98cafcbc6992cf35f0ca393df2c03e3316 ]
In the implementation, the sent_frame count does not increment when transmit errors occur. Therefore, bq_xmit_all() will take care of returning the XDP frames.
--- drivers/net/ethernet/freescale/fec_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +0 -1
@@ -3798,7 +3798,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep, entries_free =fec_enet_get_free_txdesc_num (txq);if (entries_free <MAX_SKB_FRAGS +1 ) {netdev_err (fep->netdev,"NOT enough BD for SG!\n" ); -xdp_return_frame (frame);return NETDEV_TX_BUSY ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 255/364 virtio_net: Fix error unwinding of XDP initialization
In reply to Greg Kroah-HartmanFrom: Feng Liu <[email protected]>
[ Upstream commit 5306623a9826aa7d63b32c6a3803c798a765474d ]
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error unwinding of init code.
Also extract helper functions of disable and enable queue pairs. Use newly introduced disable helper function in error unwinding and virtnet_close. Use enable helper function in virtnet_open.
--- drivers/net/virtio_net.c | 61 +++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 17 deletions(-)
drivers/net/virtio_net.c +44 -17
@@ -1867,6 +1867,38 @@ static int virtnet_poll(struct napi_struct *napi, int budget)return received; } +static void virtnet_disable_queue_pair (struct virtnet_info *vi,int qp_index) +{ +virtnet_napi_tx_disable (&vi->sq[qp_index].napi); +napi_disable (&vi->rq[qp_index].napi); +xdp_rxq_info_unreg (&vi->rq[qp_index].xdp_rxq); +} + +static int virtnet_enable_queue_pair (struct virtnet_info *vi,int qp_index) +{ +struct net_device *dev = vi->dev; +int err; + + err =xdp_rxq_info_reg (&vi->rq[qp_index].xdp_rxq, dev, qp_index, + vi->rq[qp_index].napi.napi_id); +if (err <0 ) +return err; + + err =xdp_rxq_info_reg_mem_model (&vi->rq[qp_index].xdp_rxq, +MEM_TYPE_PAGE_SHARED ,NULL ); +if (err <0 ) + goto err_xdp_reg_mem_model; + +virtnet_napi_enable (vi->rq[qp_index].vq, &vi->rq[qp_index].napi); +virtnet_napi_tx_enable (vi, vi->sq[qp_index].vq, &vi->sq[qp_index].napi); + +return 0 ; + +err_xdp_reg_mem_model: +xdp_rxq_info_unreg (&vi->rq[qp_index].xdp_rxq); +return err; +} +static int virtnet_open (struct net_device *dev) {struct virtnet_info *vi =netdev_priv (dev);
@@ -1880,22 +1912,20 @@ static int virtnet_open(struct net_device *dev)if (!try_fill_recv (vi, &vi->rq[i],GFP_KERNEL ))schedule_delayed_work (&vi->refill,0 ); - err =xdp_rxq_info_reg (&vi->rq[i].xdp_rxq, dev, i, vi->rq[i].napi.napi_id); + err =virtnet_enable_queue_pair (vi, i);if (err <0 ) -return err; - - err =xdp_rxq_info_reg_mem_model (&vi->rq[i].xdp_rxq, -MEM_TYPE_PAGE_SHARED ,NULL ); -if (err <0 ) { -xdp_rxq_info_unreg (&vi->rq[i].xdp_rxq); -return err; - } - -virtnet_napi_enable (vi->rq[i].vq, &vi->rq[i].napi); -virtnet_napi_tx_enable (vi, vi->sq[i].vq, &vi->sq[i].napi); + goto err_enable_qp; }return 0 ; + +err_enable_qp: +disable_delayed_refill (vi); +cancel_delayed_work_sync (&vi->refill); + +for (i--; i >=0 ; i--) +virtnet_disable_queue_pair (vi, i); +return err; }static int virtnet_poll_tx (struct napi_struct *napi,int budget)
@@ -2304,11 +2334,8 @@ static int virtnet_close(struct net_device *dev)/* Make sure refill_work doesn't re-enable napi! */ cancel_delayed_work_sync (&vi->refill); -for (i =0 ; i < vi->max_queue_pairs; i++) { -virtnet_napi_tx_disable (&vi->sq[i].napi); -napi_disable (&vi->rq[i].napi); -xdp_rxq_info_unreg (&vi->rq[i].xdp_rxq); - } +for (i =0 ; i < vi->max_queue_pairs; i++) +virtnet_disable_queue_pair (vi, i);return 0 ; }
Signature · 1 line
2.39.2