6.6.23-rc1 review
Subsystems (12)
Sasha Levin
maintainerPATCH 114/638 wifi: b43: Stop/wake correct queue in DMA Tx path when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 9636951e4468f02c72cc75a82dc65d003077edbc ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop/wake queue 0 when QoS is disabled to prevent trying to stop/wake a non-existent queue and failing to stop/wake the actual queue instantiated.
Log of issue before change (with kernel parameter qos=0):
[ +5.112651] ------------[ cut here ]------------
[ +0.000005] WARNING: CPU: 7 PID: 25513 at net/mac80211/util.c:449 __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000067] Modules linked in: b43(O) snd_seq_dummy snd_hrtimer snd_seq snd_seq_device nft_chain_nat xt_MASQUERADE nf_nat xfrm_user xfrm_algo xt_addrtype overlay ccm af_packet amdgpu snd_hda_codec_cirrus snd_hda_codec_generic ledtrig_audio drm_exec amdxcp gpu_sched xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_rpfilter ipt_rpfilter xt_pkttype xt_LOG nf_log_syslog xt_tcpudp nft_compat nf_tables nfnetlink sch_fq_codel btusb uinput iTCO_wdt ctr btrtl intel_pmc_bxt i915 intel_rapl_msr mei_hdcp mei_pxp joydev at24 watchdog btintel atkbd libps2 serio radeon btbcm vivaldi_fmap btmtk intel_rapl_common snd_hda_codec_hdmi bluetooth uvcvideo nls_iso8859_1 applesmc nls_cp437 x86_pkg_temp_thermal snd_hda_intel intel_powerclamp vfat videobuf2_vmalloc coretemp fat snd_intel_dspcfg crc32_pclmul uvc polyval_clmulni snd_intel_sdw_acpi loop videobuf2_memops snd_hda_codec tun drm_suballoc_helper polyval_generic drm_ttm_helper drm_buddy tap ecdh_generic videobuf2_v4l2 gf128mul macvlan ttm ghash_clmulni_intel ecc tg3
[ +0.000044] videodev bridge snd_hda_core rapl crc16 drm_display_helper cec mousedev snd_hwdep evdev intel_cstate bcm5974 hid_appleir videobuf2_common stp mac_hid libphy snd_pcm drm_kms_helper acpi_als mei_me intel_uncore llc mc snd_timer intel_gtt industrialio_triggered_buffer apple_mfi_fastcharge i2c_i801 mei snd lpc_ich agpgart ptp i2c_smbus thunderbolt apple_gmux i2c_algo_bit kfifo_buf video industrialio soundcore pps_core wmi tiny_power_button sbs sbshc button ac cordic bcma mac80211 cfg80211 ssb rfkill libarc4 kvm_intel kvm drm irqbypass fuse backlight firmware_class efi_pstore configfs efivarfs dmi_sysfs ip_tables x_tables autofs4 dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core input_leds hid_apple led_class hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic ahci libahci libata uhci_hcd ehci_pci ehci_hcd crct10dif_pclmul crct10dif_common sha512_ssse3 sha512_generic sha256_ssse3 sha1_ssse3 aesni_intel usbcore scsi_mod libaes crypto_simd cryptd scsi_common
[ +0.000055] usb_common rtc_cmos btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq dm_snapshot dm_bufio dm_mod dax [last unloaded: b43(O)]
[ +0.000009] CPU: 7 PID: 25513 Comm: irq/17-b43 Tainted: G W O 6.6.7 #1-NixOS
[ +0.000003] Hardware name: Apple Inc. MacBookPro8,3/Mac-942459F5819B171B, BIOS 87.0.0.0.0 06/13/2019
[ +0.000001] RIP: 0010:__ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000046] Code: 00 45 85 e4 0f 85 9b 00 00 00 48 8d bd 40 09 00 00 f0 48 0f ba ad 48 09 00 00 00 72 0f 5b 5d 41 5c 41 5d 41 5e e9 cb 6d 3c d0 <0f> 0b 5b 5d 41 5c 41 5d 41 5e c3 cc cc cc cc 48 8d b4 16 94 00 00
[ +0.000002] RSP: 0018:ffffc90003c77d60 EFLAGS: 00010097
[ +0.000001] RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
[ +0.000001] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff88820b924900
[ +0.000002] RBP: ffff88820b924900 R08: ffffc90003c77d90 R09: 000000000003bfd0
[ +0.000001] R10: ffff88820b924900 R11: ffffc90003c77c68 R12: 0000000000000000
[ +0.000001] R13: 0000000000000000 R14: ffffc90003c77d90 R15: ffffffffc0fa6f40
[ +0.000001] FS: 0000000000000000(0000) GS:ffff88846fb80000(0000) knlGS:0000000000000000
[ +0.000001] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000001] CR2: 00007fafda7ae008 CR3: 000000046d220005 CR4: 00000000000606e0
[ +0.000002] Call Trace:
[ +0.000003] <TASK>
[ +0.000001] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000044] ? __warn+0x81/0x130
[ +0.000005] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000045] ? report_bug+0x171/0x1a0
[ +0.000004] ? handle_bug+0x41/0x70
[ +0.000004] ? exc_invalid_op+0x17/0x70
[ +0.000003] ? asm_exc_invalid_op+0x1a/0x20
[ +0.000005] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000043] ieee80211_wake_queue+0x4a/0x80 [mac80211]
[ +0.000044] b43_dma_handle_txstatus+0x29c/0x3a0 [b43]
[ +0.000016] ? __pfx_irq_thread_fn+0x10/0x10
[ +0.000002] b43_handle_txstatus+0x61/0x80 [b43]
[ +0.000012] b43_interrupt_thread_handler+0x3f9/0x6b0 [b43]
[ +0.000011] irq_thread_fn+0x23/0x60
[ +0.000002] irq_thread+0xfe/0x1c0
[ +0.000002] ? __pfx_irq_thread_dtor+0x10/0x10
[ +0.000001] ? __pfx_irq_thread+0x10/0x10
[ +0.000001] kthread+0xe8/0x120
[ +0.000003] ? __pfx_kthread+0x10/0x10
[ +0.000003] ret_from_fork+0x34/0x50
[ +0.000002] ? __pfx_kthread+0x10/0x10
[ +0.000002] ret_from_fork_asm+0x1b/0x30
[ +0.000004] </TASK>
[ +0.000001] ---[ end trace 0000000000000000 ]--- [ +0.000065] ------------[ cut here ]------------
[ +0.000001] WARNING: CPU: 0 PID: 56077 at net/mac80211/util.c:514 __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000077] Modules linked in: b43(O) snd_seq_dummy snd_hrtimer snd_seq snd_seq_device nft_chain_nat xt_MASQUERADE nf_nat xfrm_user xfrm_algo xt_addrtype overlay ccm af_packet amdgpu snd_hda_codec_cirrus snd_hda_codec_generic ledtrig_audio drm_exec amdxcp gpu_sched xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_rpfilter ipt_rpfilter xt_pkttype xt_LOG nf_log_syslog xt_tcpudp nft_compat nf_tables nfnetlink sch_fq_codel btusb uinput iTCO_wdt ctr btrtl intel_pmc_bxt i915 intel_rapl_msr mei_hdcp mei_pxp joydev at24 watchdog btintel atkbd libps2 serio radeon btbcm vivaldi_fmap btmtk intel_rapl_common snd_hda_codec_hdmi bluetooth uvcvideo nls_iso8859_1 applesmc nls_cp437 x86_pkg_temp_thermal snd_hda_intel intel_powerclamp vfat videobuf2_vmalloc coretemp fat snd_intel_dspcfg crc32_pclmul uvc polyval_clmulni snd_intel_sdw_acpi loop videobuf2_memops snd_hda_codec tun drm_suballoc_helper polyval_generic drm_ttm_helper drm_buddy tap ecdh_generic videobuf2_v4l2 gf128mul macvlan ttm ghash_clmulni_intel ecc tg3
[ +0.000073] videodev bridge snd_hda_core rapl crc16 drm_display_helper cec mousedev snd_hwdep evdev intel_cstate bcm5974 hid_appleir videobuf2_common stp mac_hid libphy snd_pcm drm_kms_helper acpi_als mei_me intel_uncore llc mc snd_timer intel_gtt industrialio_triggered_buffer apple_mfi_fastcharge i2c_i801 mei snd lpc_ich agpgart ptp i2c_smbus thunderbolt apple_gmux i2c_algo_bit kfifo_buf video industrialio soundcore pps_core wmi tiny_power_button sbs sbshc button ac cordic bcma mac80211 cfg80211 ssb rfkill libarc4 kvm_intel kvm drm irqbypass fuse backlight firmware_class efi_pstore configfs efivarfs dmi_sysfs ip_tables x_tables autofs4 dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core input_leds hid_apple led_class hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic ahci libahci libata uhci_hcd ehci_pci ehci_hcd crct10dif_pclmul crct10dif_common sha512_ssse3 sha512_generic sha256_ssse3 sha1_ssse3 aesni_intel usbcore scsi_mod libaes crypto_simd cryptd scsi_common
[ +0.000084] usb_common rtc_cmos btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq dm_snapshot dm_bufio dm_mod dax [last unloaded: b43]
[ +0.000012] CPU: 0 PID: 56077 Comm: kworker/u16:17 Tainted: G W O 6.6.7 #1-NixOS
[ +0.000003] Hardware name: Apple Inc. MacBookPro8,3/Mac-942459F5819B171B, BIOS 87.0.0.0.0 06/13/2019
[ +0.000001] Workqueue: phy7 b43_tx_work [b43]
[ +0.000019] RIP: 0010:__ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000076] Code: 74 11 48 8b 78 08 0f b7 d6 89 e9 4c 89 e6 e8 ab f4 00 00 65 ff 0d 9c b7 34 3f 0f 85 55 ff ff ff 0f 1f 44 00 00 e9 4b ff ff ff <0f> 0b 5b 5d 41 5c 41 5d c3 cc cc cc cc 0f 1f 80 00 00 00 00 90 90
[ +0.000002] RSP: 0000:ffffc90004157d50 EFLAGS: 00010097
[ +0.000002] RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
[ +0.000002] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff8882d65d0900
[ +0.000002] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
[ +0.000001] R10: 00000000000000ff R11: ffff88814d0155a0 R12: ffff8882d65d0900
[ +0.000002] R13: 0000000000000000 R14: ffff8881002d2800 R15: 00000000000000d0
[ +0.000002] FS: 0000000000000000(0000) GS:ffff88846f800000(0000) knlGS:0000000000000000
[ +0.000003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000002] CR2: 00007f2e8c10c880 CR3: 0000000385b66005 CR4: 00000000000606f0
[ +0.000002] Call Trace:
[ +0.000001] <TASK>
[ +0.000001] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000075] ? __warn+0x81/0x130
[ +0.000004] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000075] ? report_bug+0x171/0x1a0
[ +0.000005] ? handle_bug+0x41/0x70
[ +0.000003] ? exc_invalid_op+0x17/0x70
[ +0.000004] ? asm_exc_invalid_op+0x1a/0x20
[ +0.000004] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000076] ieee80211_stop_queue+0x36/0x50 [mac80211]
[ +0.000077] b43_dma_tx+0x550/0x780 [b43]
[ +0.000023] b43_tx_work+0x90/0x130 [b43]
[ +0.000018] process_one_work+0x174/0x340
[ +0.000003] worker_thread+0x27b/0x3a0
[ +0.000004] ? __pfx_worker_thread+0x10/0x10
[ +0.000002] kthread+0xe8/0x120
[ +0.000003] ? __pfx_kthread+0x10/0x10
[ +0.000004] ret_from_fork+0x34/0x50
[ +0.000002] ? __pfx_kthread+0x10/0x10
[ +0.000003] ret_from_fork_asm+0x1b/0x30
[ +0.000006] </TASK>
[ +0.000001] ---[ end trace 0000000000000000 ]------ drivers/net/wireless/broadcom/b43/b43.h | 16 ++++++++++++++++ drivers/net/wireless/broadcom/b43/dma.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/b43/b43.h +16 -0
@@ -1082,6 +1082,22 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)return dev->__using_pio_transfers; } +static inline void b43_wake_queue (struct b43_wldev *dev,int queue_prio) +{ +if (dev->qos_enabled) +ieee80211_wake_queue (dev->wl->hw, queue_prio); +else +ieee80211_wake_queue (dev->wl->hw,0 ); +} + +static inline void b43_stop_queue (struct b43_wldev *dev,int queue_prio) +{ +if (dev->qos_enabled) +ieee80211_stop_queue (dev->wl->hw, queue_prio); +else +ieee80211_stop_queue (dev->wl->hw,0 ); +} +/* Message printing */ __printf(2, 3) void b43info(struct b43_wl *wl, const char *fmt, ...); __printf(2, 3) void b43err(struct b43_wl *wl, const char *fmt, ...);
drivers/net/wireless/broadcom/b43/dma.c +2 -2
@@ -1399,7 +1399,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) should_inject_overflow(ring)) {/* This TX ring is full. */ unsigned int skb_mapping =skb_get_queue_mapping (skb); -ieee80211_stop_queue (dev->wl->hw, skb_mapping); +b43_stop_queue (dev, skb_mapping); dev->wl->tx_queue_stopped[skb_mapping] = true; ring->stopped = true;if (b43_debug (dev,B43_DBG_DMAVERBOSE )) {
@@ -1570,7 +1570,7 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, }else {/* If the driver queue is running wake the corresponding * mac80211 queue. */ -ieee80211_wake_queue (dev->wl->hw, ring->queue_prio); +b43_wake_queue (dev, ring->queue_prio);if (b43_debug (dev,B43_DBG_DMAVERBOSE )) {b43dbg (dev->wl,"Woke up TX ring %d\n" , ring->index); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 115/638 wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 77135a38f6c2f950d2306ac3d37cbb407e6243f2 ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop/wake queue 0 when QoS is disabled to prevent trying to stop/wake a non-existent queue and failing to stop/wake the actual queue instantiated.
--- drivers/net/wireless/broadcom/b43/pio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/broadcom/b43/pio.c +3 -3
@@ -525,7 +525,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)if (total_len > (q->buffer_size - q->buffer_used)) {/* Not enough memory on the queue. */ err = -EBUSY ; -ieee80211_stop_queue (dev->wl->hw,skb_get_queue_mapping (skb)); +b43_stop_queue (dev,skb_get_queue_mapping (skb)); q->stopped = true; goto out; }
@@ -552,7 +552,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)if (((q->buffer_size - q->buffer_used) <roundup (2 +2 +6 ,4 )) || (q->free_packet_slots ==0 )) {/* The queue is full. */ -ieee80211_stop_queue (dev->wl->hw,skb_get_queue_mapping (skb)); +b43_stop_queue (dev,skb_get_queue_mapping (skb)); q->stopped = true; }
@@ -587,7 +587,7 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev,list_add (&pack->list, &q->packets_list);if (q->stopped) { -ieee80211_wake_queue (dev->wl->hw, q->queue_prio); +b43_wake_queue (dev, q->queue_prio); q->stopped = false; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 116/638 wifi: b43: Stop correct queue in DMA worker when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 581c8967d66c4961076dbbee356834e9c6777184 ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop queue 0 when QoS is disabled to prevent trying to stop a non-existent queue and failing to stop the actual queue instantiated.
--- drivers/net/wireless/broadcom/b43/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/b43/main.c +7 -6
@@ -3603,7 +3603,7 @@ static void b43_tx_work(struct work_struct *work) err =b43_dma_tx (dev, skb);if (err == -ENOSPC ) { wl->tx_queue_stopped[queue_num] = true; -ieee80211_stop_queue (wl->hw, queue_num); +b43_stop_queue (dev, queue_num);skb_queue_head (&wl->tx_queue[queue_num], skb);break ; }
@@ -3627,6 +3627,7 @@ static void b43_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) {struct b43_wl *wl =hw_to_b43_wl (hw); +u16 skb_queue_mapping;if (unlikely (skb->len <2 +2 +6 )) {/* Too short, this can't be a valid frame. */
@@ -3635,12 +3636,12 @@ static void b43_op_tx(struct ieee80211_hw *hw, }B43_WARN_ON (skb_shinfo (skb)->nr_frags); -skb_queue_tail (&wl->tx_queue[skb->queue_mapping], skb); -if (!wl->tx_queue_stopped[skb->queue_mapping]) { + skb_queue_mapping =skb_get_queue_mapping (skb); +skb_queue_tail (&wl->tx_queue[skb_queue_mapping], skb); +if (!wl->tx_queue_stopped[skb_queue_mapping])ieee80211_queue_work (wl->hw, &wl->tx_work); - }else { -ieee80211_stop_queue (wl->hw, skb->queue_mapping); - } +else +b43_stop_queue (wl->current_dev, skb_queue_mapping); } static void b43_qos_params_upload(struct b43_wldev *dev,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 117/638 wifi: b43: Disable QoS for bcm4331
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 09795bded2e725443fe4a4803cae2079cdaf7b26 ]
bcm4331 seems to not function correctly with QoS support. This may be due to issues with currently available firmware or potentially a device specific issue.
When queues that are not of the default "best effort" priority are selected, traffic appears to not transmit out of the hardware while no errors are returned. This behavior is present among all the other priority
queues: video, voice, and background. While this can be worked around by setting a kernel parameter, the default behavior is problematic for most users and may be difficult to debug. This patch offers a working out-of-box experience for bcm4331 users.
Log of the issue (using ssh low-priority traffic as an example):
ssh -T -vvvv [email protected]
OpenSSH_9.6p1, OpenSSL 3.0.12 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: checking match for 'host * exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1'"' host github.com originally github.com
debug3: /etc/ssh/ssh_config line 5: matched 'host "github.com"'
debug1: Executing command: '/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1''
debug3: command returned status 0
debug3: /etc/ssh/ssh_config line 5: matched 'exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0r"'
debug2: match found
debug1: /etc/ssh/ssh_config line 9: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/binary-eater/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/binary-eater/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: channel_clear_timeouts: clearing
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [192.30.255.113] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
--- drivers/net/wireless/broadcom/b43/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/b43/main.c +2 -1
@@ -2587,7 +2587,8 @@ static void b43_request_firmware(struct work_struct *work) start_ieee80211: wl->hw->queues =B43_QOS_QUEUE_NUM ; -if (!modparam_qos || dev->fw.opensource) +if (!modparam_qos || dev->fw.opensource || + dev->dev->chip_id ==BCMA_CHIP_ID_BCM4331 ) wl->hw->queues =1 ; err =ieee80211_register_hw (wl->hw);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 118/638 wifi: wilc1000: fix declarations ordering
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit 535733e90e5d8912ebeccebb05b354a2d06ff459 ]
Reorder parameters declaration in wilc_parse_join_bss_param to enforce reverse christmas tree
Stable-dep-of: 205c50306acf ("wifi: wilc1000: fix RCU usage in connect path")
--- drivers/net/wireless/microchip/wilc1000/hif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/microchip/wilc1000/hif.c +4 -4
@@ -374,13 +374,13 @@ static void handle_connect_timeout(struct work_struct *work)void *wilc_parse_join_bss_param (struct cfg80211_bss *bss,struct cfg80211_crypto_settings *crypto) { -struct wilc_join_bss_param *param; -struct ieee80211_p2p_noa_attr noa_attr; -u8 rates_len =0 ; +const struct cfg80211_bss_ies *ies =rcu_dereference (bss->ies);const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie; +struct ieee80211_p2p_noa_attr noa_attr; +struct wilc_join_bss_param *param; +u8 rates_len =0 ;int ret; -const struct cfg80211_bss_ies *ies =rcu_dereference (bss->ies); param =kzalloc (sizeof (*param),GFP_KERNEL );if (!param)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 119/638 wifi: wilc1000: fix RCU usage in connect path
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit 205c50306acf58a335eb19fa84e40140f4fe814f ]
With lockdep enabled, calls to the connect function from cfg802.11 layer lead to the following warning:
=============================
WARNING: suspicious RCU usage
6.7.0-rc1-wt+ #333 Not tainted
-----------------------------drivers/net/wireless/microchip/wilc1000/hif.c:386
suspicious rcu_dereference_check() usage!
[...]
stack backtrace: CPU: 0 PID: 100 Comm: wpa_supplicant Not tainted 6.7.0-rc1-wt+ #333 Hardware name: Atmel SAMA5 unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x48 dump_stack_lvl from wilc_parse_join_bss_param+0x7dc/0x7f4 wilc_parse_join_bss_param from connect+0x2c4/0x648 connect from cfg80211_connect+0x30c/0xb74 cfg80211_connect from nl80211_connect+0x860/0xa94 nl80211_connect from genl_rcv_msg+0x3fc/0x59c genl_rcv_msg from netlink_rcv_skb+0xd0/0x1f8 netlink_rcv_skb from genl_rcv+0x2c/0x3c genl_rcv from netlink_unicast+0x3b0/0x550 netlink_unicast from netlink_sendmsg+0x368/0x688 netlink_sendmsg from ____sys_sendmsg+0x190/0x430 ____sys_sendmsg from ___sys_sendmsg+0x110/0x158 ___sys_sendmsg from sys_sendmsg+0xe8/0x150 sys_sendmsg from ret_fast_syscall+0x0/0x1c
This warning is emitted because in the connect path, when trying to parse target BSS parameters, we dereference a RCU pointer whithout being in RCU critical section.
Fix RCU dereference usage by moving it to a RCU read critical section. To avoid wrapping the whole wilc_parse_join_bss_param under the critical section, just use the critical section to copy ies data
--- drivers/net/wireless/microchip/wilc1000/hif.c | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-)
drivers/net/wireless/microchip/wilc1000/hif.c +24 -12
@@ -374,38 +374,49 @@ static void handle_connect_timeout(struct work_struct *work)void *wilc_parse_join_bss_param (struct cfg80211_bss *bss,struct cfg80211_crypto_settings *crypto) { -const struct cfg80211_bss_ies *ies =rcu_dereference (bss->ies); -const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie; +const u8 *ies_data, *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie;struct ieee80211_p2p_noa_attr noa_attr; +const struct cfg80211_bss_ies *ies;struct wilc_join_bss_param *param; -u8 rates_len =0 ; +u8 rates_len =0 , ies_len;int ret; param =kzalloc (sizeof (*param),GFP_KERNEL );if (!param)return NULL ; +rcu_read_lock (); + ies =rcu_dereference (bss->ies); + ies_data =kmemdup (ies->data, ies->len,GFP_ATOMIC ); +if (!ies_data) { +rcu_read_unlock (); +kfree (param); +return NULL ; + } + ies_len = ies->len; +rcu_read_unlock (); + param->beacon_period =cpu_to_le16 (bss->beacon_interval); param->cap_info =cpu_to_le16 (bss->capability); param->bss_type =WILC_FW_BSS_TYPE_INFRA ; param->ch =ieee80211_frequency_to_channel (bss->channel->center_freq);ether_addr_copy (param->bssid, bss->bssid); - ssid_elm =cfg80211_find_ie (WLAN_EID_SSID , ies->data, ies->len); + ssid_elm =cfg80211_find_ie (WLAN_EID_SSID , ies_data, ies_len);if (ssid_elm) {if (ssid_elm[1 ] <=IEEE80211_MAX_SSID_LEN )memcpy (param->ssid, ssid_elm +2 , ssid_elm[1 ]); } - tim_elm =cfg80211_find_ie (WLAN_EID_TIM , ies->data, ies->len); + tim_elm =cfg80211_find_ie (WLAN_EID_TIM , ies_data, ies_len);if (tim_elm && tim_elm[1 ] >=2 ) param->dtim_period = tim_elm[3 ];memset (param->p_suites,0xFF ,3 );memset (param->akm_suites,0xFF ,3 ); - rates_ie =cfg80211_find_ie (WLAN_EID_SUPP_RATES , ies->data, ies->len); + rates_ie =cfg80211_find_ie (WLAN_EID_SUPP_RATES , ies_data, ies_len);if (rates_ie) { rates_len = rates_ie[1 ];if (rates_len >WILC_MAX_RATES_SUPPORTED )
@@ -416,7 +427,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,if (rates_len <WILC_MAX_RATES_SUPPORTED ) { supp_rates_ie =cfg80211_find_ie (WLAN_EID_EXT_SUPP_RATES , - ies->data, ies->len); + ies_data, ies_len);if (supp_rates_ie) {u8 ext_rates = supp_rates_ie[1 ];
@@ -431,11 +442,11 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, } } - ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , ies->data, ies->len); + ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , ies_data, ies_len);if (ht_ie) param->ht_capable = true; - ret =cfg80211_get_p2p_attr (ies->data, ies->len, + ret =cfg80211_get_p2p_attr (ies_data, ies_len,IEEE80211_P2P_ATTR_ABSENCE_NOTICE , (u8 *)&noa_attr,sizeof (noa_attr));if (ret >0 ) {
@@ -459,7 +470,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, } wmm_ie =cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT ,WLAN_OUI_TYPE_MICROSOFT_WMM , - ies->data, ies->len); + ies_data, ies_len);if (wmm_ie) {struct ieee80211_wmm_param_ie *ie;
@@ -474,13 +485,13 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, wpa_ie =cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT ,WLAN_OUI_TYPE_MICROSOFT_WPA , - ies->data, ies->len); + ies_data, ies_len);if (wpa_ie) { param->mode_802_11i =1 ; param->rsn_found = true; } - rsn_ie =cfg80211_find_ie (WLAN_EID_RSN , ies->data, ies->len); + rsn_ie =cfg80211_find_ie (WLAN_EID_RSN , ies_data, ies_len);if (rsn_ie) {int rsn_ie_len =sizeof (struct element ) + rsn_ie[1 ];int offset =8 ;
@@ -514,6 +525,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, param->akm_suites[i] = crypto->akm_suites[i] &0xFF ; } +kfree (ies_data);return (void *)param; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 120/638 wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work
In reply to Sasha LevinFrom: Martin Kaistra <[email protected]>
[ Upstream commit 1213acb478a7181cd73eeaf00db430f1e45b1361 ]
The workqueue might still be running, when the driver is stopped. To avoid a use-after-free, call cancel_work_sync() in rtl8xxxu_stop().
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -0
@@ -7304,6 +7304,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)if (priv->usb_interrupts)rtl8xxxu_write32 (priv,REG_USB_HIMR ,0 ); +cancel_work_sync (&priv->c2hcmd_work);cancel_delayed_work_sync (&priv->ra_watchdog);rtl8xxxu_free_rx_resources (priv);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 121/638 wifi: wilc1000: do not realloc workqueue everytime an interface is added
In reply to Sasha LevinFrom: Ajay Singh <[email protected]>
[ Upstream commit 328efda22af81130c2ad981c110518cb29ff2f1d ]
Commit 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"") moved workqueue creation in wilc_netdev_ifc_init in order to set the interface name in the workqueue name. However, while the driver needs only one workqueue, the wilc_netdev_ifc_init is called each time we add an interface over a phy, which in turns overwrite the workqueue with a new one. This can be observed with the following commands:
for i in $(seq 0 10)
do
iw phy phy0 interface add wlan1 type managed
iw dev wlan1 del
done
ps -eo pid,comm|grep wlan
39 kworker/R-wlan0
98 kworker/R-wlan1
102 kworker/R-wlan1
105 kworker/R-wlan1
108 kworker/R-wlan1
111 kworker/R-wlan1
114 kworker/R-wlan1
117 kworker/R-wlan1
120 kworker/R-wlan1
123 kworker/R-wlan1
126 kworker/R-wlan1
129 kworker/R-wlan1
Fix this leakage by putting back hif_workqueue allocation in wilc_cfg80211_init. Regarding the workqueue name, it is indeed relevant to set it lowercase, however it is not attached to a specific netdev, so enforcing netdev name in the name is not so relevant. Still, enrich the name with the wiphy name to make it clear which phy is using the workqueue.
--- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 11 ++++++++++- drivers/net/wireless/microchip/wilc1000/netdev.c | 10 +--------- 2 files changed, 11 insertions(+), 10 deletions(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +10 -1
@@ -1810,15 +1810,24 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,INIT_LIST_HEAD (&wl->rxq_head.list);INIT_LIST_HEAD (&wl->vif_list); + wl->hif_workqueue =alloc_ordered_workqueue ("%s" ,WQ_MEM_RECLAIM , +wiphy_name (wl->wiphy)); +if (!wl->hif_workqueue) { + ret = -ENOMEM ; + goto free_cfg; + } vif =wilc_netdev_ifc_init (wl,"wlan%d" ,WILC_STATION_MODE ,NL80211_IFTYPE_STATION , false);if (IS_ERR (vif)) { ret =PTR_ERR (vif); - goto free_cfg; + goto free_hq; }return 0 ; +free_hq: +destroy_workqueue (wl->hif_workqueue); + free_cfg:wilc_wlan_cfg_deinit (wl);
drivers/net/wireless/microchip/wilc1000/netdev.c +1 -9
@@ -977,13 +977,6 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, goto error; } - wl->hif_workqueue =alloc_ordered_workqueue ("%s-wq" ,WQ_MEM_RECLAIM , - ndev->name); -if (!wl->hif_workqueue) { - ret = -ENOMEM ; - goto unregister_netdev; - } - ndev->needs_free_netdev = true; vif->iftype = vif_type; vif->idx =wilc_get_available_idx (wl);
@@ -996,12 +989,11 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,return vif; -unregister_netdev: +error:if (rtnl_locked)cfg80211_unregister_netdevice (ndev);else unregister_netdev (ndev); - error:free_netdev (ndev);return ERR_PTR (ret); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 122/638 wifi: wilc1000: fix multi-vif management when deleting a vif
In reply to Sasha LevinFrom: Ajay Singh <[email protected]>
[ Upstream commit 12cfc9c8d3faf887a202c89bc312202445fca7e8 ]
Adding then removing a second vif currently makes the first vif not working anymore. This is visible for example when we have a first interface connected to some access point:
- create a wpa_supplicant.conf with some AP credentials
- wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0
- dhclient wlan0
- iw phy phy0 interface add wlan1 type managed
- iw dev wlan1 del
wlan0 does not manage properly traffic anymore (eg: ping not working)
This is due to vif mode being incorrectly reconfigured with some default values in del_virtual_intf, affecting by default first vif.
Prevent first vif from being affected on second vif removal by removing vif mode change command in del_virtual_intf
--- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +0 -1
@@ -1615,7 +1615,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)cfg80211_unregister_netdevice (vif->ndev); vif->monitor_flag =0 ; -wilc_set_operation_mode (vif,0 ,0 ,0 );mutex_lock (&wl->vif_mutex);list_del_rcu (&vif->list); wl->vif_num--;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 123/638 wifi: mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir()
In reply to Sasha LevinFrom: Jinjie Ruan <[email protected]>
[ Upstream commit 50180c7f8e3de7c2d87f619131776598fcb1478d ]
debugfs_create_dir() returns ERR_PTR and never return NULL.
As Russell suggested, this patch removes the error checking for debugfs_create_dir(). This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary.
--- drivers/net/wireless/marvell/mwifiex/debugfs.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/marvell/mwifiex/debugfs.c +0 -3
@@ -970,9 +970,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv) priv->dfs_dev_dir =debugfs_create_dir (priv->netdev->name, mwifiex_dfs_dir); -if (!priv->dfs_dev_dir) -return ; -MWIFIEX_DFS_ADD_FILE (info);MWIFIEX_DFS_ADD_FILE (debug);MWIFIEX_DFS_ADD_FILE (getlog);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 124/638 ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 090c4094574705b0afc7d37825cdc5d06f0e7e02 ]
External clocks should be defined as zero-Hz clocks in the SoC .dtsi, and overridden in the board .dts when present.
Correct the clock rate of extal1 from 25 to 26 MHz, to match the crystal oscillator present on the APE6-EVM board.
--- arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts | 12 ++++++++++++ arch/arm/boot/dts/renesas/r8a73a4.dtsi | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts +12 -0
@@ -209,6 +209,18 @@ &cmt1 { status = "okay"; }; +&extal1_clk { + clock-frequency = <26000000>; +}; + +&extal2_clk { + clock-frequency = <48000000>; +}; + +&extalr_clk { + clock-frequency = <32768>; +}; + &pfc { scifa0_pins: scifa0 { groups = "scifa0_data";
arch/arm/boot/dts/renesas/r8a73a4.dtsi +6 -3
@@ -450,17 +450,20 @@ clocks { extalr_clk: extalr { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <32768>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal1_clk: extal1 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <25000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal2_clk: extal2 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <48000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; fsiack_clk: fsiack { compatible = "fixed-clock";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 125/638 arm64: dts: qcom: sc8180x: Hook up VDD_CX as GCC parent domain
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 3c58b96df110a80e78fa36ef928f1e6c375008e3 ]
Most of GCC is powered by the CX rail. Describe that relationship to let the performance state requests trickle up the chain.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -0
@@ -781,6 +781,7 @@ gcc: clock-controller@100000 { clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; + power-domains = <&rpmhpd SC8180X_CX>; }; qupv3_id_0: geniqup@8c0000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 126/638 arm64: dts: qcom: sc8180x: Fix up big CPU idle state entry latency
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 266a3a92044b89c392b3e9cfcc328d4167c18294 ]
The entry latency was oddly low.. Turns out somebody forgot about a second '1'! Fix it.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -289,7 +289,7 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { BIG_CPU_SLEEP_0: cpu-sleep-1-0 { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x40000004>; - entry-latency-us = <241>; + entry-latency-us = <2411>; exit-latency-us = <1461>; min-residency-us = <4488>; local-timer-stop;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 127/638 arm64: dts: qcom: sc8180x: Add missing CPU off state
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 07b600dfdfea65d58dd80ea25becd8cff69bfafc ]
The CPUs can be powered off without pulling the plug from the rest of the system. Describe the idle state responsible for this.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +10 -2
@@ -297,7 +297,15 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 { }; domain-idle-states { - CLUSTER_SLEEP_0: cluster-sleep-0 { + CLUSTER_SLEEP_APSS_OFF: cluster-sleep-0 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000044>; + entry-latency-us = <3300>; + exit-latency-us = <3300>; + min-residency-us = <6000>; + }; + + CLUSTER_SLEEP_AOSS_SLEEP: cluster-sleep-1 { compatible = "domain-idle-state"; arm,psci-suspend-param = <0x4100a344>; entry-latency-us = <3263>;
@@ -581,7 +589,7 @@ CPU_PD7: power-domain-cpu7 { CLUSTER_PD: power-domain-cpu-cluster0 { #power-domain-cells = <0>; - domain-idle-states = <&CLUSTER_SLEEP_0>; + domain-idle-states = <&CLUSTER_SLEEP_APSS_OFF &CLUSTER_SLEEP_AOSS_SLEEP>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 128/638 arm64: dts: qcom: sc8180x: Fix eDP PHY power-domains
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 24e98cb3d5e2c86565680e00008a794b4eac0040 ]
The (e)DP PHYs are powered by the MX line, not through the MDSS GDSC. Fix that up.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -3194,7 +3194,7 @@ edp_phy: phy@aec2a00 { <&dispcc DISP_CC_MDSS_AHB_CLK>; clock-names = "aux", "cfg_ahb"; - power-domains = <&dispcc MDSS_GDSC>; + power-domains = <&rpmhpd SC8180X_MX>; #clock-cells = <1>; #phy-cells = <0>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 129/638 arm64: dts: qcom: sc8180x: Don't hold MDP core clock at FMAX
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 309b5774f45aafd002efdb2656673542419abd6f ]
There's an OPP table to handle this, drop the permanent vote.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +2 -4
@@ -2731,10 +2731,8 @@ mdss_mdp: mdp@ae01000 { "core", "vsync"; - assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>, - <&dispcc DISP_CC_MDSS_VSYNC_CLK>; - assigned-clock-rates = <460000000>, - <19200000>; + assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>; + assigned-clock-rates = <19200000>; operating-points-v2 = <&mdp_opp_table>; power-domains = <&rpmhpd SC8180X_MMCX>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 130/638 arm64: dts: qcom: sc8180x: Require LOW_SVS vote for MMCX if DISPCC is on
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 6d9fb9e4c473cdfd2adca019b46d8e482105cae7 ]
To ensure the PLLs are getting enough power, cast a vote with DISPCC so that MMCX is at least at LOW_SVS.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -0
@@ -3218,6 +3218,7 @@ dispcc: clock-controller@af00000 { "edp_phy_pll_link_clk", "edp_phy_pll_vco_div_clk"; power-domains = <&rpmhpd SC8180X_MMCX>; + required-opps = <&rpmhpd_opp_low_svs>; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 131/638 arm64: dts: qcom: sc8180x: Shrink aoss_qmp register space size
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit dcad0590d1ea4278a55c30dd2903611a96111601 ]
The AOSS_QMP region is overallocated, bleeding into space that's supposed to be used by other peripherals. Fix it.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -3257,7 +3257,7 @@ tsens1: thermal-sensor@c265000 { aoss_qmp: power-controller@c300000 { compatible = "qcom,sc8180x-aoss-qmp", "qcom,aoss-qmp"; - reg = <0x0 0x0c300000 0x0 0x100000>; + reg = <0x0 0x0c300000 0x0 0x400>; interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>; mboxes = <&apss_shared 0>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 132/638 cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value
In reply to Sasha LevinFrom: Anastasia Belova <[email protected]>
[ Upstream commit f661017e6d326ee187db24194cabb013d81bc2a6 ]
cpufreq_cpu_get may return NULL. To avoid NULL-dereference check it and return 0 in case of error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/brcmstb-avs-cpufreq.c +2 -0
@@ -481,6 +481,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)static unsigned int brcm_avs_cpufreq_get (unsigned int cpu) {struct cpufreq_policy *policy =cpufreq_cpu_get (cpu); +if (!policy) +return 0 ;struct private_data *priv = policy->driver_data;cpufreq_cpu_put (policy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 133/638 cpufreq: mediatek-hw: Wait for CPU supplies before probing
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 788715b5f21c6455264fe00a1779e61bec407fe2 ]
Before proceeding with the probe and enabling frequency scaling for the CPUs, make sure that all supplies feeding the CPUs have probed.
This fixes an issue observed on MT8195-Tomato where if the mediatek-cpufreq-hw driver enabled the hardware (by writing to REG_FREQ_ENABLE) before the SPMI controller driver (spmi-mtk-pmif), behind which lies the big CPU supply, probed the platform would hang shortly after with "rcu: INFO: rcu_preempt detected stalls on CPUs/tasks" being printed in the log.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +18 -1
@@ -13,6 +13,7 @@#include <linux/of.h> #include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <linux/slab.h> #define LUT_MAX_ENTRIES 32U
@@ -300,7 +301,23 @@ static struct cpufreq_driver cpufreq_mtk_hw_driver = {static int mtk_cpufreq_hw_driver_probe (struct platform_device *pdev) {const void *data; -int ret; +int ret, cpu; +struct device *cpu_dev; +struct regulator *cpu_reg; + +/* Make sure that all CPU supplies are available before proceeding. */ +for_each_possible_cpu (cpu) { + cpu_dev =get_cpu_device (cpu); +if (!cpu_dev) +return dev_err_probe (&pdev->dev, -EPROBE_DEFER , +"Failed to get cpu%d device\n" , cpu); + + cpu_reg =devm_regulator_get_optional (cpu_dev,"cpu" ); +if (IS_ERR (cpu_reg)) +return dev_err_probe (&pdev->dev,PTR_ERR (cpu_reg), +"CPU%d regulator get failed\n" , cpu); + } + data =of_device_get_match_data (&pdev->dev);if (!data)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 134/638 sock_diag: annotate data-races around sock_diag_handlers[family]
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit efd402537673f9951992aea4ef0f5ff51d858f4b ]
__sock_diag_cmd() and sock_diag_bind() read sock_diag_handlers[family] without a lock held.
Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.
--- net/core/sock_diag.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/core/sock_diag.c +5 -5
@@ -193,7 +193,7 @@ int sock_diag_register(const struct sock_diag_handler *hndl)if (sock_diag_handlers[hndl->family]) err = -EBUSY ;else - sock_diag_handlers[hndl->family] = hndl; +WRITE_ONCE (sock_diag_handlers[hndl->family], hndl);mutex_unlock (&sock_diag_table_mutex);return err;
@@ -209,7 +209,7 @@ void sock_diag_unregister(const struct sock_diag_handler *hnld)mutex_lock (&sock_diag_table_mutex);BUG_ON (sock_diag_handlers[family] != hnld); - sock_diag_handlers[family] =NULL ; +WRITE_ONCE (sock_diag_handlers[family],NULL );mutex_unlock (&sock_diag_table_mutex); }EXPORT_SYMBOL_GPL (sock_diag_unregister);
@@ -227,7 +227,7 @@ static int __sock_diag_cmd(struct sk_buff *skb, struct nlmsghdr *nlh)return -EINVAL ; req->sdiag_family =array_index_nospec (req->sdiag_family,AF_MAX ); -if (sock_diag_handlers[req->sdiag_family] ==NULL ) +if (READ_ONCE (sock_diag_handlers[req->sdiag_family]) ==NULL )sock_load_diag_module (req->sdiag_family,0 );mutex_lock (&sock_diag_table_mutex);
@@ -286,12 +286,12 @@ static int sock_diag_bind(struct net *net, int group)switch (group) {case SKNLGRP_INET_TCP_DESTROY :case SKNLGRP_INET_UDP_DESTROY : -if (!sock_diag_handlers[AF_INET ]) +if (!READ_ONCE (sock_diag_handlers[AF_INET ]))sock_load_diag_module (AF_INET ,0 );break ;case SKNLGRP_INET6_TCP_DESTROY :case SKNLGRP_INET6_UDP_DESTROY : -if (!sock_diag_handlers[AF_INET6 ]) +if (!READ_ONCE (sock_diag_handlers[AF_INET6 ]))sock_load_diag_module (AF_INET6 ,0 );break ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 135/638 inet_diag: annotate data-races around inet_diag_table[]
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit e50e10ae5d81ddb41547114bfdc5edc04422f082 ]
inet_diag_lock_handler() reads inet_diag_table[proto] locklessly.
Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.
--- net/ipv4/inet_diag.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv4/inet_diag.c +3 -3
@@ -57,7 +57,7 @@ static const struct inet_diag_handler *inet_diag_lock_handler(int proto)return ERR_PTR (-ENOENT ); } -if (!inet_diag_table[proto]) +if (!READ_ONCE (inet_diag_table[proto]))sock_load_diag_module (AF_INET , proto);mutex_lock (&inet_diag_table_mutex);
@@ -1419,7 +1419,7 @@ int inet_diag_register(const struct inet_diag_handler *h)mutex_lock (&inet_diag_table_mutex); err = -EEXIST ;if (!inet_diag_table[type]) { - inet_diag_table[type] = h; +WRITE_ONCE (inet_diag_table[type], h); err =0 ; }mutex_unlock (&inet_diag_table_mutex);
@@ -1436,7 +1436,7 @@ void inet_diag_unregister(const struct inet_diag_handler *h)return ;mutex_lock (&inet_diag_table_mutex); - inet_diag_table[type] =NULL ; +WRITE_ONCE (inet_diag_table[type],NULL );mutex_unlock (&inet_diag_table_mutex); }EXPORT_SYMBOL_GPL (inet_diag_unregister);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 136/638 bpftool: Silence build warning about calloc()
In reply to Sasha LevinFrom: Tiezhu Yang <[email protected]>
[ Upstream commit f5f30386c78105cba520e443a6a9ee945ec1d066 ]
There exists the following warning when building bpftool:
CC prog.oprog.c: In function ‘profile_open_perf_events’:
prog.c:2301:24: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
2301 | sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metric);
| ^~~
prog.c:2301:24: note: earlier argument should specify number of elements, later size of each element
Tested with the latest upstream GCC which contains a new warning option -Wcalloc-transposed-args. The first argument to calloc is documented to be number of elements in array, while the second argument is size of each element, just switch the first and second arguments of calloc() to silence the build warning, compile tested only.
--- tools/bpf/bpftool/prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/prog.c +1 -1
@@ -2294,7 +2294,7 @@ static int profile_open_perf_events(struct profiler_bpf *obj)int map_fd; profile_perf_events =calloc ( -sizeof (int ), obj->rodata->num_cpu * obj->rodata->num_metric); + obj->rodata->num_cpu * obj->rodata->num_metric,sizeof (int ));if (!profile_perf_events) {p_err ("failed to allocate memory for perf_event array: %s" ,strerror (errno));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 137/638 selftests/bpf: Fix potential premature unload in bpf_testmod
In reply to Sasha LevinFrom: Artem Savkov <[email protected]>
[ Upstream commit d177c1be06ce28aa8c8710ac55be1b5ad3f314c6 ]
It is possible for bpf_kfunc_call_test_release() to be called from bpf_map_free_deferred() when bpf_testmod is already unloaded and perf_test_stuct.cnt which it tries to decrease is no longer in memory. This patch tries to fix the issue by waiting for all references to be dropped in bpf_testmod_exit().
The issue can be triggered by running 'test_progs -t map_kptr' in 6.5, but is obscured in 6.6 by d119357d07435 ("rcu-tasks: Treat only synchronous grace periods urgently").
--- tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c +9 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2020 Facebook */ #include <linux/btf.h> #include <linux/btf_ids.h> +#include <linux/delay.h> #include <linux/error-injection.h> #include <linux/init.h> #include <linux/module.h>
@@ -541,6 +542,14 @@ static int bpf_testmod_init(void)static void bpf_testmod_exit (void ) { +/* Need to wait for all references to be dropped because +* bpf_kfunc_call_test_release() which currently resides in kernel can +* be called after bpf_testmod is unloaded. Once release function is +* moved into the module this wait can be removed. +*/ +while (refcount_read (&prog_test_struct.cnt) >1 ) +msleep (20 ); +return sysfs_remove_bin_file (kernel_kobj, &bin_attr_bpf_testmod_file); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 138/638 libbpf: Apply map_set_def_max_entries() for inner_maps on creation
In reply to Sasha LevinFrom: Andrey Grafin <[email protected]>
[ Upstream commit f04deb90e516e8e48bf8693397529bc942a9e80b ]
This patch allows to auto create BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS with values of BPF_MAP_TYPE_PERF_EVENT_ARRAY by bpf_object__load().
Previous behaviour created a zero filled btf_map_def for inner maps and tried to use it for a map creation but the linux kernel forbids to create a BPF_MAP_TYPE_PERF_EVENT_ARRAY map with max_entries=0.
--- tools/lib/bpf/libbpf.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/lib/bpf/libbpf.c +4 -0
@@ -70,6 +70,7 @@static struct bpf_map *bpf_object__add_map (struct bpf_object *obj);static bool prog_is_subprog (const struct bpf_object *obj,const struct bpf_program *prog); +static int map_set_def_max_entries (struct bpf_map *map);static const char *const attach_type_name[] = { [BPF_CGROUP_INET_INGRESS ] ="cgroup_inet_ingress" ,
@@ -5121,6 +5122,9 @@ static int bpf_object__create_map(struct bpf_object *obj, struct bpf_map *map, bif (bpf_map_type__is_map_in_map (def->type)) {if (map->inner_map) { + err =map_set_def_max_entries (map->inner_map); +if (err) +return err; err =bpf_object__create_map (obj, map->inner_map, true);if (err) { pr_warn("map '%s': failed to create inner map: %d\n",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 139/638 selftest/bpf: Add map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY values
In reply to Sasha LevinFrom: Andrey Grafin <[email protected]>
[ Upstream commit 40628f9fff73adecac77a9aa390f8016724cad99 ]
Check that bpf_object__load() successfully creates map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY values.
These changes cover fix in the previous patch
"libbpf: Apply map_set_def_max_entries() for inner_maps on creation".
A command line output is:
- w/o fix
$ sudo ./test_maps libbpf: map 'mim_array_pe': failed to create inner map: -22 libbpf: map 'mim_array_pe': failed to create: Invalid argument(-22) libbpf: failed to load object './test_map_in_map.bpf.o' Failed to load test prog
- with fix
$ sudo ./test_maps ... test_maps: OK, 0 SKIPPED
--- .../selftests/bpf/progs/test_map_in_map.c | 26 +++++++++++++++++++ tools/testing/selftests/bpf/test_maps.c | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/test_map_in_map.c +26 -0
@@ -21,6 +21,32 @@ struct {__type (value, __u32); } mim_hash SEC(".maps"); +/* The following three maps are used to test +* perf_event_array map can be an inner +* map of hash/array_of_maps. +*/ +struct perf_event_array { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __type(key, __u32); + __type(value, __u32); +} inner_map0 SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS); + __uint(max_entries, 1); + __type(key, __u32); + __array(values, struct perf_event_array); +} mim_array_pe SEC(".maps") = { + .values = {&inner_map0}}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH_OF_MAPS); + __uint(max_entries, 1); + __type(key, __u32); + __array(values, struct perf_event_array); +} mim_hash_pe SEC(".maps") = { + .values = {&inner_map0}}; + SEC("xdp")int xdp_mimtest0 (struct xdp_md *ctx) {
tools/testing/selftests/bpf/test_maps.c +5 -1
@@ -1190,7 +1190,11 @@ static void test_map_in_map(void) goto out_map_in_map; } -bpf_object__load (obj); + err =bpf_object__load (obj); +if (err) { +printf ("Failed to load test prog\n" ); + goto out_map_in_map; + } map =bpf_object__find_map_by_name (obj,"mim_array" );if (!map) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 140/638 wifi: ath12k: Fix issues in channel list update
In reply to Sasha LevinFrom: Sriram R <[email protected]>
[ Upstream commit 67a48d937fac917947540c9f89630d472cd61fcb ]
Currently, the logic used to select the 6 GHz band is incorrect, which may cause 6 GHz supported channels to not be updated properly. This is because the 6 GHz Max frequency supported by the driver is being compared to the Max frequency supported on the board. If in some cases, the 6 GHz Max frequency supported on the board is less than the defined 6 GHz Max frequency, all 6 GHz channels are disabled. To address this, compare the max frequency supported by the board to the defined 6 GHz Minimum frequency by the driver.
Similarly, when a dual mac card supports both 6 GHz and 5 GHz radios, if the 5 GHz radio gets enumerated first before 6 GHz, the checks in ath12k_mac_setup_channels_rates() can cause the 5 GHz channels which were enabled earlier to get disabled when the 6 GHz channel list is updated. This is because the Min 6 GHz frequency defined in the driver is 5945 MHz, which should be 5925 MHz since channel 2 is not considered currently, but the firmware can pass 5925 MHz as the minimum. Hence, update the Min frequency supported by the driver to 5925 MHz.
In addition, ensure that the channel list update to firmware updates only the channels that the current radio (ar) supports rather than considering the wiphy support. This would be required when multiple pdevs are supported in a wiphy and they support different ranges of frequencies or bands as in single wiphy support.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/core.h | 2 +- drivers/net/wireless/ath/ath12k/mac.c | 2 +- drivers/net/wireless/ath/ath12k/reg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/core.h +1 -1
@@ -400,7 +400,7 @@ struct ath12k_sta { };#define ATH12K_MIN_5G_FREQ 4150 -#define ATH12K_MIN_6G_FREQ 5945 +#define ATH12K_MIN_6G_FREQ 5925#define ATH12K_MAX_6G_FREQ 7115#define ATH12K_NUM_CHANS 100#define ATH12K_MAX_5G_CHAN 173
drivers/net/wireless/ath/ath12k/mac.c +1 -1
@@ -7004,7 +7004,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar, }if (supported_bands &WMI_HOST_WLAN_5G_CAP ) { -if (reg_cap->high_5ghz_chan >=ATH12K_MAX_6G_FREQ ) { +if (reg_cap->high_5ghz_chan >=ATH12K_MIN_6G_FREQ ) { channels =kmemdup (ath12k_6ghz_channels,sizeof (ath12k_6ghz_channels),GFP_KERNEL );if (!channels) {
drivers/net/wireless/ath/ath12k/reg.c +2 -2
@@ -103,7 +103,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) bands = hw->wiphy->bands;for (band =0 ; band <NUM_NL80211_BANDS ; band++) { -if (!bands[band]) +if (!(ar->mac.sbands[band].channels && bands[band]))continue ;for (i =0 ; i < bands[band]->n_channels; i++) {
@@ -129,7 +129,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) ch = arg->channel;for (band =0 ; band <NUM_NL80211_BANDS ; band++) { -if (!bands[band]) +if (!(ar->mac.sbands[band].channels && bands[band]))continue ;for (i =0 ; i < bands[band]->n_channels; i++) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 141/638 selftests/bpf: De-veth-ize the tc_redirect test case
In reply to Sasha LevinFrom: Daniel Borkmann <[email protected]>
[ Upstream commit eee82da79f036bb49ff80d3088b9530e3c2e57eb ]
No functional changes to the test case, but just renaming various functions, variables, etc, to remove veth part of their name for making it more generic and reusable later on (e.g. for netkit).
Stable-dep-of: 177f1d083a19 ("selftests/bpf: Fix the flaky tc_redirect_dtime test")
--- .../selftests/bpf/prog_tests/tc_redirect.c | 263 +++++++++--------- 1 file changed, 137 insertions(+), 126 deletions(-)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +137 -126
@@ -110,11 +110,16 @@ static void netns_setup_namespaces_nofail(const char *verb) } } +enum dev_mode { +MODE_VETH , +}; +struct netns_setup_result { -int ifindex_veth_src; -int ifindex_veth_src_fwd; -int ifindex_veth_dst; -int ifindex_veth_dst_fwd; +enum dev_mode dev_mode; +int ifindex_src; +int ifindex_src_fwd; +int ifindex_dst; +int ifindex_dst_fwd; };static int get_ifaddr (const char *name,char *ifaddr)
@@ -140,55 +145,59 @@ static int get_ifaddr(const char *name, char *ifaddr)static int netns_setup_links_and_routes (struct netns_setup_result *result) {struct nstoken *nstoken =NULL ; -char veth_src_fwd_addr[IFADDR_STR_LEN +1 ] = {}; +char src_fwd_addr[IFADDR_STR_LEN +1 ] = {}; -SYS (fail,"ip link add veth_src type veth peer name veth_src_fwd" ); -SYS (fail,"ip link add veth_dst type veth peer name veth_dst_fwd" ); +if (result->dev_mode ==MODE_VETH ) { +SYS (fail,"ip link add src type veth peer name src_fwd" ); +SYS (fail,"ip link add dst type veth peer name dst_fwd" ); -SYS (fail,"ip link set veth_dst_fwd address " MAC_DST_FWD ); -SYS (fail,"ip link set veth_dst address " MAC_DST ); +SYS (fail,"ip link set dst_fwd address " MAC_DST_FWD ); +SYS (fail,"ip link set dst address " MAC_DST ); + } -if (get_ifaddr ("veth_src_fwd" , veth_src_fwd_addr)) +if (get_ifaddr ("src_fwd" , src_fwd_addr)) goto fail; - result->ifindex_veth_src =if_nametoindex ("veth_src" ); -if (!ASSERT_GT (result->ifindex_veth_src,0 ,"ifindex_veth_src" )) + result->ifindex_src =if_nametoindex ("src" ); +if (!ASSERT_GT (result->ifindex_src,0 ,"ifindex_src" )) goto fail; - result->ifindex_veth_src_fwd =if_nametoindex ("veth_src_fwd" ); -if (!ASSERT_GT (result->ifindex_veth_src_fwd,0 ,"ifindex_veth_src_fwd" )) + result->ifindex_src_fwd =if_nametoindex ("src_fwd" ); +if (!ASSERT_GT (result->ifindex_src_fwd,0 ,"ifindex_src_fwd" )) goto fail; - result->ifindex_veth_dst =if_nametoindex ("veth_dst" ); -if (!ASSERT_GT (result->ifindex_veth_dst,0 ,"ifindex_veth_dst" )) + result->ifindex_dst =if_nametoindex ("dst" ); +if (!ASSERT_GT (result->ifindex_dst,0 ,"ifindex_dst" )) goto fail; - result->ifindex_veth_dst_fwd =if_nametoindex ("veth_dst_fwd" ); -if (!ASSERT_GT (result->ifindex_veth_dst_fwd,0 ,"ifindex_veth_dst_fwd" )) + result->ifindex_dst_fwd =if_nametoindex ("dst_fwd" ); +if (!ASSERT_GT (result->ifindex_dst_fwd,0 ,"ifindex_dst_fwd" )) goto fail; -SYS (fail,"ip link set veth_src netns " NS_SRC ); -SYS (fail,"ip link set veth_src_fwd netns " NS_FWD ); -SYS (fail,"ip link set veth_dst_fwd netns " NS_FWD ); -SYS (fail,"ip link set veth_dst netns " NS_DST ); +SYS (fail,"ip link set src netns " NS_SRC ); +SYS (fail,"ip link set src_fwd netns " NS_FWD ); +SYS (fail,"ip link set dst_fwd netns " NS_FWD ); +SYS (fail,"ip link set dst netns " NS_DST );/** setup in 'src' namespace */ nstoken =open_netns (NS_SRC );if (!ASSERT_OK_PTR (nstoken,"setns src" )) goto fail; -SYS (fail,"ip addr add " IP4_SRC "/32 dev veth_src" ); -SYS (fail,"ip addr add " IP6_SRC "/128 dev veth_src nodad" ); -SYS (fail,"ip link set dev veth_src up" ); +SYS (fail,"ip addr add " IP4_SRC "/32 dev src" ); +SYS (fail,"ip addr add " IP6_SRC "/128 dev src nodad" ); +SYS (fail,"ip link set dev src up" ); -SYS (fail,"ip route add " IP4_DST "/32 dev veth_src scope global" ); -SYS (fail,"ip route add " IP4_NET "/16 dev veth_src scope global" ); -SYS (fail,"ip route add " IP6_DST "/128 dev veth_src scope global" ); +SYS (fail,"ip route add " IP4_DST "/32 dev src scope global" ); +SYS (fail,"ip route add " IP4_NET "/16 dev src scope global" ); +SYS (fail,"ip route add " IP6_DST "/128 dev src scope global" ); -SYS (fail,"ip neigh add " IP4_DST " dev veth_src lladdr %s" , - veth_src_fwd_addr); -SYS (fail,"ip neigh add " IP6_DST " dev veth_src lladdr %s" , - veth_src_fwd_addr); +if (result->dev_mode ==MODE_VETH ) { +SYS (fail,"ip neigh add " IP4_DST " dev src lladdr %s" , + src_fwd_addr); +SYS (fail,"ip neigh add " IP6_DST " dev src lladdr %s" , + src_fwd_addr); + }close_netns (nstoken);
@@ -201,15 +210,15 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)* needs v4 one in order to start ARP probing. IP4_NET route is added * to the endpoints so that the ARP processing will reply. */ -SYS (fail,"ip addr add " IP4_SLL "/32 dev veth_src_fwd" ); -SYS (fail,"ip addr add " IP4_DLL "/32 dev veth_dst_fwd" ); -SYS (fail,"ip link set dev veth_src_fwd up" ); -SYS (fail,"ip link set dev veth_dst_fwd up" ); +SYS (fail,"ip addr add " IP4_SLL "/32 dev src_fwd" ); +SYS (fail,"ip addr add " IP4_DLL "/32 dev dst_fwd" ); +SYS (fail,"ip link set dev src_fwd up" ); +SYS (fail,"ip link set dev dst_fwd up" ); -SYS (fail,"ip route add " IP4_SRC "/32 dev veth_src_fwd scope global" ); -SYS (fail,"ip route add " IP6_SRC "/128 dev veth_src_fwd scope global" ); -SYS (fail,"ip route add " IP4_DST "/32 dev veth_dst_fwd scope global" ); -SYS (fail,"ip route add " IP6_DST "/128 dev veth_dst_fwd scope global" ); +SYS (fail,"ip route add " IP4_SRC "/32 dev src_fwd scope global" ); +SYS (fail,"ip route add " IP6_SRC "/128 dev src_fwd scope global" ); +SYS (fail,"ip route add " IP4_DST "/32 dev dst_fwd scope global" ); +SYS (fail,"ip route add " IP6_DST "/128 dev dst_fwd scope global" );close_netns (nstoken);
@@ -218,16 +227,18 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)if (!ASSERT_OK_PTR (nstoken,"setns dst" )) goto fail; -SYS (fail,"ip addr add " IP4_DST "/32 dev veth_dst" ); -SYS (fail,"ip addr add " IP6_DST "/128 dev veth_dst nodad" ); -SYS (fail,"ip link set dev veth_dst up" ); +SYS (fail,"ip addr add " IP4_DST "/32 dev dst" ); +SYS (fail,"ip addr add " IP6_DST "/128 dev dst nodad" ); +SYS (fail,"ip link set dev dst up" ); -SYS (fail,"ip route add " IP4_SRC "/32 dev veth_dst scope global" ); -SYS (fail,"ip route add " IP4_NET "/16 dev veth_dst scope global" ); -SYS (fail,"ip route add " IP6_SRC "/128 dev veth_dst scope global" ); +SYS (fail,"ip route add " IP4_SRC "/32 dev dst scope global" ); +SYS (fail,"ip route add " IP4_NET "/16 dev dst scope global" ); +SYS (fail,"ip route add " IP6_SRC "/128 dev dst scope global" ); -SYS (fail,"ip neigh add " IP4_SRC " dev veth_dst lladdr " MAC_DST_FWD ); -SYS (fail,"ip neigh add " IP6_SRC " dev veth_dst lladdr " MAC_DST_FWD ); +if (result->dev_mode ==MODE_VETH ) { +SYS (fail,"ip neigh add " IP4_SRC " dev dst lladdr " MAC_DST_FWD ); +SYS (fail,"ip neigh add " IP6_SRC " dev dst lladdr " MAC_DST_FWD ); + }close_netns (nstoken);
@@ -293,23 +304,23 @@ static int netns_load_bpf(const struct bpf_program *src_prog,const struct bpf_program *chk_prog, const struct netns_setup_result *setup_result) { -LIBBPF_OPTS (bpf_tc_hook ,qdisc_veth_src_fwd ); -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_dst_fwd); +LIBBPF_OPTS (bpf_tc_hook ,qdisc_src_fwd ); +LIBBPF_OPTS (bpf_tc_hook, qdisc_dst_fwd);int err; -/* tc qdisc add dev veth_src_fwd clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_src_fwd, setup_result->ifindex_veth_src_fwd); -/* tc filter add dev veth_src_fwd ingress bpf da src_prog */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_INGRESS , src_prog,0 ); -/* tc filter add dev veth_src_fwd egress bpf da chk_prog */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_EGRESS , chk_prog,0 ); +/* tc qdisc add dev src_fwd clsact */ +QDISC_CLSACT_CREATE (&qdisc_src_fwd, setup_result->ifindex_src_fwd); +/* tc filter add dev src_fwd ingress bpf da src_prog */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_INGRESS , src_prog,0 ); +/* tc filter add dev src_fwd egress bpf da chk_prog */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_EGRESS , chk_prog,0 ); -/* tc qdisc add dev veth_dst_fwd clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_dst_fwd, setup_result->ifindex_veth_dst_fwd); -/* tc filter add dev veth_dst_fwd ingress bpf da dst_prog */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_INGRESS , dst_prog,0 ); -/* tc filter add dev veth_dst_fwd egress bpf da chk_prog */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_EGRESS , chk_prog,0 ); +/* tc qdisc add dev dst_fwd clsact */ +QDISC_CLSACT_CREATE (&qdisc_dst_fwd, setup_result->ifindex_dst_fwd); +/* tc filter add dev dst_fwd ingress bpf da dst_prog */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_INGRESS , dst_prog,0 ); +/* tc filter add dev dst_fwd egress bpf da chk_prog */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_EGRESS , chk_prog,0 );return 0 ; fail:
@@ -539,10 +550,10 @@ static void test_inet_dtime(int family, int type, const char *addr, __u16 port)static int netns_load_dtime_bpf (struct test_tc_dtime *skel,const struct netns_setup_result *setup_result) { -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_src_fwd); -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_dst_fwd); -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_src); -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_dst); +LIBBPF_OPTS (bpf_tc_hook, qdisc_src_fwd); +LIBBPF_OPTS (bpf_tc_hook, qdisc_dst_fwd); +LIBBPF_OPTS (bpf_tc_hook, qdisc_src); +LIBBPF_OPTS (bpf_tc_hook, qdisc_dst);struct nstoken *nstoken;int err;
@@ -550,58 +561,58 @@ static int netns_load_dtime_bpf(struct test_tc_dtime *skel, nstoken =open_netns (NS_SRC );if (!ASSERT_OK_PTR (nstoken,"setns " NS_SRC ))return -1 ; -/* tc qdisc add dev veth_src clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_src, setup_result->ifindex_veth_src); -/* tc filter add dev veth_src ingress bpf da ingress_host */ -XGRESS_FILTER_ADD (&qdisc_veth_src,BPF_TC_INGRESS , skel->progs.ingress_host,0 ); -/* tc filter add dev veth_src egress bpf da egress_host */ -XGRESS_FILTER_ADD (&qdisc_veth_src,BPF_TC_EGRESS , skel->progs.egress_host,0 ); +/* tc qdisc add dev src clsact */ +QDISC_CLSACT_CREATE (&qdisc_src, setup_result->ifindex_src); +/* tc filter add dev src ingress bpf da ingress_host */ +XGRESS_FILTER_ADD (&qdisc_src,BPF_TC_INGRESS , skel->progs.ingress_host,0 ); +/* tc filter add dev src egress bpf da egress_host */ +XGRESS_FILTER_ADD (&qdisc_src,BPF_TC_EGRESS , skel->progs.egress_host,0 );close_netns (nstoken);/* setup ns_dst tc progs */ nstoken =open_netns (NS_DST );if (!ASSERT_OK_PTR (nstoken,"setns " NS_DST ))return -1 ; -/* tc qdisc add dev veth_dst clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_dst, setup_result->ifindex_veth_dst); -/* tc filter add dev veth_dst ingress bpf da ingress_host */ -XGRESS_FILTER_ADD (&qdisc_veth_dst,BPF_TC_INGRESS , skel->progs.ingress_host,0 ); -/* tc filter add dev veth_dst egress bpf da egress_host */ -XGRESS_FILTER_ADD (&qdisc_veth_dst,BPF_TC_EGRESS , skel->progs.egress_host,0 ); +/* tc qdisc add dev dst clsact */ +QDISC_CLSACT_CREATE (&qdisc_dst, setup_result->ifindex_dst); +/* tc filter add dev dst ingress bpf da ingress_host */ +XGRESS_FILTER_ADD (&qdisc_dst,BPF_TC_INGRESS , skel->progs.ingress_host,0 ); +/* tc filter add dev dst egress bpf da egress_host */ +XGRESS_FILTER_ADD (&qdisc_dst,BPF_TC_EGRESS , skel->progs.egress_host,0 );close_netns (nstoken);/* setup ns_fwd tc progs */ nstoken =open_netns (NS_FWD );if (!ASSERT_OK_PTR (nstoken,"setns " NS_FWD ))return -1 ; -/* tc qdisc add dev veth_dst_fwd clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_dst_fwd, setup_result->ifindex_veth_dst_fwd); -/* tc filter add dev veth_dst_fwd ingress prio 100 bpf da ingress_fwdns_prio100 */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_INGRESS , +/* tc qdisc add dev dst_fwd clsact */ +QDISC_CLSACT_CREATE (&qdisc_dst_fwd, setup_result->ifindex_dst_fwd); +/* tc filter add dev dst_fwd ingress prio 100 bpf da ingress_fwdns_prio100 */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_INGRESS , skel->progs.ingress_fwdns_prio100,100 ); -/* tc filter add dev veth_dst_fwd ingress prio 101 bpf da ingress_fwdns_prio101 */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_INGRESS , +/* tc filter add dev dst_fwd ingress prio 101 bpf da ingress_fwdns_prio101 */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_INGRESS , skel->progs.ingress_fwdns_prio101,101 ); -/* tc filter add dev veth_dst_fwd egress prio 100 bpf da egress_fwdns_prio100 */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_EGRESS , +/* tc filter add dev dst_fwd egress prio 100 bpf da egress_fwdns_prio100 */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_EGRESS , skel->progs.egress_fwdns_prio100,100 ); -/* tc filter add dev veth_dst_fwd egress prio 101 bpf da egress_fwdns_prio101 */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_EGRESS , +/* tc filter add dev dst_fwd egress prio 101 bpf da egress_fwdns_prio101 */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_EGRESS , skel->progs.egress_fwdns_prio101,101 ); -/* tc qdisc add dev veth_src_fwd clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_src_fwd, setup_result->ifindex_veth_src_fwd); -/* tc filter add dev veth_src_fwd ingress prio 100 bpf da ingress_fwdns_prio100 */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_INGRESS , +/* tc qdisc add dev src_fwd clsact */ +QDISC_CLSACT_CREATE (&qdisc_src_fwd, setup_result->ifindex_src_fwd); +/* tc filter add dev src_fwd ingress prio 100 bpf da ingress_fwdns_prio100 */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_INGRESS , skel->progs.ingress_fwdns_prio100,100 ); -/* tc filter add dev veth_src_fwd ingress prio 101 bpf da ingress_fwdns_prio101 */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_INGRESS , +/* tc filter add dev src_fwd ingress prio 101 bpf da ingress_fwdns_prio101 */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_INGRESS , skel->progs.ingress_fwdns_prio101,101 ); -/* tc filter add dev veth_src_fwd egress prio 100 bpf da egress_fwdns_prio100 */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_EGRESS , +/* tc filter add dev src_fwd egress prio 100 bpf da egress_fwdns_prio100 */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_EGRESS , skel->progs.egress_fwdns_prio100,100 ); -/* tc filter add dev veth_src_fwd egress prio 101 bpf da egress_fwdns_prio101 */ -XGRESS_FILTER_ADD (&qdisc_veth_src_fwd,BPF_TC_EGRESS , +/* tc filter add dev src_fwd egress prio 101 bpf da egress_fwdns_prio101 */ +XGRESS_FILTER_ADD (&qdisc_src_fwd,BPF_TC_EGRESS , skel->progs.egress_fwdns_prio101,101 );close_netns (nstoken);return 0 ;
@@ -777,8 +788,8 @@ static void test_tc_redirect_dtime(struct netns_setup_result *setup_result)if (!ASSERT_OK_PTR (skel,"test_tc_dtime__open" ))return ; - skel->rodata->IFINDEX_SRC = setup_result->ifindex_veth_src_fwd; - skel->rodata->IFINDEX_DST = setup_result->ifindex_veth_dst_fwd; + skel->rodata->IFINDEX_SRC = setup_result->ifindex_src_fwd; + skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd; err =test_tc_dtime__load (skel);if (!ASSERT_OK (err,"test_tc_dtime__load" ))
@@ -868,8 +879,8 @@ static void test_tc_redirect_neigh(struct netns_setup_result *setup_result)if (!ASSERT_OK_PTR (skel,"test_tc_neigh__open" )) goto done; - skel->rodata->IFINDEX_SRC = setup_result->ifindex_veth_src_fwd; - skel->rodata->IFINDEX_DST = setup_result->ifindex_veth_dst_fwd; + skel->rodata->IFINDEX_SRC = setup_result->ifindex_src_fwd; + skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd; err =test_tc_neigh__load (skel);if (!ASSERT_OK (err,"test_tc_neigh__load" ))
@@ -904,8 +915,8 @@ static void test_tc_redirect_peer(struct netns_setup_result *setup_result)if (!ASSERT_OK_PTR (skel,"test_tc_peer__open" )) goto done; - skel->rodata->IFINDEX_SRC = setup_result->ifindex_veth_src_fwd; - skel->rodata->IFINDEX_DST = setup_result->ifindex_veth_dst_fwd; + skel->rodata->IFINDEX_SRC = setup_result->ifindex_src_fwd; + skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd; err =test_tc_peer__load (skel);if (!ASSERT_OK (err,"test_tc_peer__load" ))
@@ -996,7 +1007,7 @@ static int tun_relay_loop(int src_fd, int target_fd)static void test_tc_redirect_peer_l3 (struct netns_setup_result *setup_result) {LIBBPF_OPTS (bpf_tc_hook, qdisc_tun_fwd); -LIBBPF_OPTS (bpf_tc_hook, qdisc_veth_dst_fwd); +LIBBPF_OPTS (bpf_tc_hook, qdisc_dst_fwd);struct test_tc_peer *skel =NULL ;struct nstoken *nstoken =NULL ;int err;
@@ -1045,7 +1056,7 @@ static void test_tc_redirect_peer_l3(struct netns_setup_result *setup_result) goto fail; skel->rodata->IFINDEX_SRC = ifindex; - skel->rodata->IFINDEX_DST = setup_result->ifindex_veth_dst_fwd; + skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd; err =test_tc_peer__load (skel);if (!ASSERT_OK (err,"test_tc_peer__load" ))
@@ -1053,19 +1064,19 @@ static void test_tc_redirect_peer_l3(struct netns_setup_result *setup_result)/* Load "tc_src_l3" to the tun_fwd interface to redirect packets * towards dst, and "tc_dst" to redirect packets -* and "tc_chk" on veth_dst_fwd to drop non-redirected packets. +* and "tc_chk" on dst_fwd to drop non-redirected packets. */ /* tc qdisc add dev tun_fwd clsact */ QDISC_CLSACT_CREATE (&qdisc_tun_fwd, ifindex);/* tc filter add dev tun_fwd ingress bpf da tc_src_l3 */ XGRESS_FILTER_ADD (&qdisc_tun_fwd,BPF_TC_INGRESS , skel->progs.tc_src_l3,0 ); -/* tc qdisc add dev veth_dst_fwd clsact */ -QDISC_CLSACT_CREATE (&qdisc_veth_dst_fwd, setup_result->ifindex_veth_dst_fwd); -/* tc filter add dev veth_dst_fwd ingress bpf da tc_dst_l3 */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_INGRESS , skel->progs.tc_dst_l3,0 ); -/* tc filter add dev veth_dst_fwd egress bpf da tc_chk */ -XGRESS_FILTER_ADD (&qdisc_veth_dst_fwd,BPF_TC_EGRESS , skel->progs.tc_chk,0 ); +/* tc qdisc add dev dst_fwd clsact */ +QDISC_CLSACT_CREATE (&qdisc_dst_fwd, setup_result->ifindex_dst_fwd); +/* tc filter add dev dst_fwd ingress bpf da tc_dst_l3 */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_INGRESS , skel->progs.tc_dst_l3,0 ); +/* tc filter add dev dst_fwd egress bpf da tc_chk */ +XGRESS_FILTER_ADD (&qdisc_dst_fwd,BPF_TC_EGRESS , skel->progs.tc_chk,0 );/* Setup route and neigh tables */ SYS (fail,"ip -netns " NS_SRC " addr add dev tun_src " IP4_TUN_SRC "/24" );
@@ -1074,17 +1085,17 @@ static void test_tc_redirect_peer_l3(struct netns_setup_result *setup_result)SYS (fail,"ip -netns " NS_SRC " addr add dev tun_src " IP6_TUN_SRC "/64 nodad" );SYS (fail,"ip -netns " NS_FWD " addr add dev tun_fwd " IP6_TUN_FWD "/64 nodad" ); -SYS (fail,"ip -netns " NS_SRC " route del " IP4_DST "/32 dev veth_src scope global" ); +SYS (fail,"ip -netns " NS_SRC " route del " IP4_DST "/32 dev src scope global" );SYS (fail,"ip -netns " NS_SRC " route add " IP4_DST "/32 via " IP4_TUN_FWD " dev tun_src scope global" ); -SYS (fail,"ip -netns " NS_DST " route add " IP4_TUN_SRC "/32 dev veth_dst scope global" ); -SYS (fail,"ip -netns " NS_SRC " route del " IP6_DST "/128 dev veth_src scope global" ); +SYS (fail,"ip -netns " NS_DST " route add " IP4_TUN_SRC "/32 dev dst scope global" ); +SYS (fail,"ip -netns " NS_SRC " route del " IP6_DST "/128 dev src scope global" );SYS (fail,"ip -netns " NS_SRC " route add " IP6_DST "/128 via " IP6_TUN_FWD " dev tun_src scope global" ); -SYS (fail,"ip -netns " NS_DST " route add " IP6_TUN_SRC "/128 dev veth_dst scope global" ); +SYS (fail,"ip -netns " NS_DST " route add " IP6_TUN_SRC "/128 dev dst scope global" ); -SYS (fail,"ip -netns " NS_DST " neigh add " IP4_TUN_SRC " dev veth_dst lladdr " MAC_DST_FWD ); -SYS (fail,"ip -netns " NS_DST " neigh add " IP6_TUN_SRC " dev veth_dst lladdr " MAC_DST_FWD ); +SYS (fail,"ip -netns " NS_DST " neigh add " IP4_TUN_SRC " dev dst lladdr " MAC_DST_FWD ); +SYS (fail,"ip -netns " NS_DST " neigh add " IP6_TUN_SRC " dev dst lladdr " MAC_DST_FWD );if (!ASSERT_OK (set_forwarding (false),"disable forwarding" )) goto fail;
@@ -1106,9 +1117,9 @@ static void test_tc_redirect_peer_l3(struct netns_setup_result *setup_result)close_netns (nstoken); } -#define RUN_TEST (name) \ +#define RUN_TEST (name, mode) \ ({ \ - struct netns_setup_result setup_result; \ + struct netns_setup_result setup_result = { .dev_mode = mode, }; \ if (test__start_subtest(#name)) \ if (ASSERT_OK(netns_setup_namespaces("add"), "setup namespaces")) { \ if (ASSERT_OK(netns_setup_links_and_routes(&setup_result), \
@@ -1122,11 +1133,11 @@ static void *test_tc_redirect_run_tests(void *arg) {netns_setup_namespaces_nofail ("delete" ); -RUN_TEST (tc_redirect_peer); -RUN_TEST (tc_redirect_peer_l3); -RUN_TEST (tc_redirect_neigh); -RUN_TEST (tc_redirect_neigh_fib); -RUN_TEST (tc_redirect_dtime); +RUN_TEST (tc_redirect_peer,MODE_VETH ); +RUN_TEST (tc_redirect_peer_l3,MODE_VETH ); +RUN_TEST (tc_redirect_neigh,MODE_VETH ); +RUN_TEST (tc_redirect_neigh_fib,MODE_VETH ); +RUN_TEST (tc_redirect_dtime,MODE_VETH );return NULL ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 142/638 selftests/bpf: Add netkit to tc_redirect selftest
In reply to Sasha LevinFrom: Daniel Borkmann <[email protected]>
[ Upstream commit adfeae2d243d9e5b83d094af481d189156b11779 ]
Extend the existing tc_redirect selftest to also cover netkit devices for exercising the bpf_redirect_peer() code paths, so that we have both veth as well as netkit covered, all tests still pass after this change.
Stable-dep-of: 177f1d083a19 ("selftests/bpf: Fix the flaky tc_redirect_dtime test")
--- .../selftests/bpf/prog_tests/tc_redirect.c | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +52 -0
@@ -24,6 +24,7 @@#include "test_progs.h" #include "network_helpers.h" +#include "netlink_helpers.h" #include "test_tc_neigh_fib.skel.h" #include "test_tc_neigh.skel.h" #include "test_tc_peer.skel.h"
@@ -112,6 +113,7 @@ static void netns_setup_namespaces_nofail(const char *verb)enum dev_mode {MODE_VETH , +MODE_NETKIT , };struct netns_setup_result {
@@ -142,10 +144,51 @@ static int get_ifaddr(const char *name, char *ifaddr)return 0 ; } +static int create_netkit (int mode,char *prim,char *peer) +{ +struct rtattr *linkinfo, *data, *peer_info; +struct rtnl_handle rth = { .fd =-1 }; +const char *type ="netkit" ; +struct { +struct nlmsghdr n; +struct ifinfomsg i; +char buf[1024 ]; + } req = {}; +int err; + + err =rtnl_open (&rth,0 ); +if (!ASSERT_OK (err,"open_rtnetlink" )) +return err; + +memset (&req,0 ,sizeof (req)); + req.n.nlmsg_len =NLMSG_LENGTH (sizeof (struct ifinfomsg )); + req.n.nlmsg_flags =NLM_F_REQUEST |NLM_F_CREATE |NLM_F_EXCL ; + req.n.nlmsg_type =RTM_NEWLINK ; + req.i.ifi_family =AF_UNSPEC ; + +addattr_l (&req.n,sizeof (req),IFLA_IFNAME , prim,strlen (prim)); + linkinfo =addattr_nest (&req.n,sizeof (req),IFLA_LINKINFO ); +addattr_l (&req.n,sizeof (req),IFLA_INFO_KIND , type,strlen (type)); + data =addattr_nest (&req.n,sizeof (req),IFLA_INFO_DATA ); +addattr32 (&req.n,sizeof (req),IFLA_NETKIT_MODE , mode); + peer_info =addattr_nest (&req.n,sizeof (req),IFLA_NETKIT_PEER_INFO ); + req.n.nlmsg_len +=sizeof (struct ifinfomsg ); +addattr_l (&req.n,sizeof (req),IFLA_IFNAME , peer,strlen (peer)); +addattr_nest_end (&req.n, peer_info); +addattr_nest_end (&req.n, data); +addattr_nest_end (&req.n, linkinfo); + + err =rtnl_talk (&rth, &req.n,NULL ); +ASSERT_OK (err,"talk_rtnetlink" ); +rtnl_close (&rth); +return err; +} +static int netns_setup_links_and_routes (struct netns_setup_result *result) {struct nstoken *nstoken =NULL ;char src_fwd_addr[IFADDR_STR_LEN +1 ] = {}; +int err;if (result->dev_mode ==MODE_VETH ) {SYS (fail,"ip link add src type veth peer name src_fwd" );
@@ -153,6 +196,13 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)SYS (fail,"ip link set dst_fwd address " MAC_DST_FWD );SYS (fail,"ip link set dst address " MAC_DST ); + }else if (result->dev_mode ==MODE_NETKIT ) { + err =create_netkit (NETKIT_L3 ,"src" ,"src_fwd" ); +if (!ASSERT_OK (err,"create_ifindex_src" )) + goto fail; + err =create_netkit (NETKIT_L3 ,"dst" ,"dst_fwd" ); +if (!ASSERT_OK (err,"create_ifindex_dst" )) + goto fail; }if (get_ifaddr ("src_fwd" , src_fwd_addr))
@@ -1134,7 +1184,9 @@ static void *test_tc_redirect_run_tests(void *arg)netns_setup_namespaces_nofail ("delete" );RUN_TEST (tc_redirect_peer,MODE_VETH ); +RUN_TEST (tc_redirect_peer,MODE_NETKIT );RUN_TEST (tc_redirect_peer_l3,MODE_VETH ); +RUN_TEST (tc_redirect_peer_l3,MODE_NETKIT );RUN_TEST (tc_redirect_neigh,MODE_VETH );RUN_TEST (tc_redirect_neigh_fib,MODE_VETH );RUN_TEST (tc_redirect_dtime,MODE_VETH );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 143/638 selftests/bpf: Fix the flaky tc_redirect_dtime test
In reply to Sasha LevinFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit 177f1d083a19af58f4b1206d299ed73689249fd8 ]
BPF CI has been reporting the tc_redirect_dtime test failing from time to time:
test_inet_dtime:PASS:setns src 0 nsec
(network_helpers.c:253: errno: No route to host) Failed to connect to server close_netns:PASS:setns 0 nsec
test_inet_dtime:FAIL:connect_to_fd unexpected connect_to_fd: actual -1 < expected 0 test_tcp_clear_dtime:PASS:tcp ip6 clear dtime ingress_fwdns_p100 0 nsec
The connect_to_fd failure (EHOSTUNREACH) is from the test_tcp_clear_dtime() test and it is the very first IPv6 traffic after setting up all the links, addresses, and routes.
The symptom is this first connect() is always slow. In my setup, it could take ~3s.
After some tracing and tcpdump, the slowness is mostly spent in the neighbor solicitation in the "ns_fwd" namespace while the "ns_src" and "ns_dst" are fine.
I forced the kernel to drop the neighbor solicitation messages. I can then reproduce EHOSTUNREACH. What actually happen could be:
- the neighbor advertisement came back a little slow.
- the "ns_fwd" namespace concluded a neighbor discovery failure and triggered the ndisc_error_report() => ip6_link_failure() => icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0)
- the client's connect() reports EHOSTUNREACH after receiving the ICMPV6_DEST_UNREACH message.
The neigh table of both "ns_src" and "ns_dst" namespace has already been manually populated but not the "ns_fwd" namespace. This patch fixes it by manually populating the neigh table also in the "ns_fwd" namespace.
Although the namespace configuration part had been existed before the tc_redirect_dtime test, still Fixes-tagging the patch when the tc_redirect_dtime test was added since it is the only test hitting it so far.
--- tools/testing/selftests/bpf/prog_tests/tc_redirect.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +11 -0
@@ -188,6 +188,7 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result) {struct nstoken *nstoken =NULL ;char src_fwd_addr[IFADDR_STR_LEN +1 ] = {}; +char src_addr[IFADDR_STR_LEN +1 ] = {};int err;if (result->dev_mode ==MODE_VETH ) {
@@ -208,6 +209,9 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)if (get_ifaddr ("src_fwd" , src_fwd_addr)) goto fail; +if (get_ifaddr ("src" , src_addr)) + goto fail; + result->ifindex_src =if_nametoindex ("src" );if (!ASSERT_GT (result->ifindex_src,0 ,"ifindex_src" )) goto fail;
@@ -270,6 +274,13 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)SYS (fail,"ip route add " IP4_DST "/32 dev dst_fwd scope global" );SYS (fail,"ip route add " IP6_DST "/128 dev dst_fwd scope global" ); +if (result->dev_mode ==MODE_VETH ) { +SYS (fail,"ip neigh add " IP4_SRC " dev src_fwd lladdr %s" , src_addr); +SYS (fail,"ip neigh add " IP6_SRC " dev src_fwd lladdr %s" , src_addr); +SYS (fail,"ip neigh add " IP4_DST " dev dst_fwd lladdr %s" ,MAC_DST ); +SYS (fail,"ip neigh add " IP6_DST " dev dst_fwd lladdr %s" ,MAC_DST ); + } +close_netns (nstoken);/** setup in 'dst' namespace */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 144/638 selftests/bpf: Wait for the netstamp_needed_key static key to be turned on
In reply to Sasha LevinFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit ce6f6cffaeaa0a3bcdafcae7fe03c68c3afae631 ]
After the previous patch that speeded up the test (by avoiding neigh discovery in IPv6), the BPF CI occasionally hits this error:
rcv tstamp unexpected pkt rcv tstamp: actual 0 == expected 0
The test complains about the cmsg returned from the recvmsg() does not have the rcv timestamp. Setting skb->tstamp or not is controlled by a kernel static key "netstamp_needed_key". The static key is enabled whenever this is at least one sk with the SOCK_TIMESTAMP set.
The test_redirect_dtime does use setsockopt() to turn on
the SOCK_TIMESTAMP for the reading sk. In the kernel net_enable_timestamp() has a delay to enable the "netstamp_needed_key" when CONFIG_JUMP_LABEL is set. This potential delay is the likely reason for packet missing rcv timestamp occasionally.
This patch is to create udp sockets with SOCK_TIMESTAMP set. It sends and receives some packets until the received packet has a rcv timestamp. It currently retries at most 5 times with 1s in between. This should be enough to wait for the "netstamp_needed_key". It then holds on to the socket and only closes it at the end of the test. This guarantees that the test has the "netstamp_needed_key" key turned on from the beginning.
To simplify the udp sockets setup, they are sending/receiving packets in the same netns (ns_dst is used) and communicate over the "lo" dev. Hence, the patch enables the "lo" dev in the ns_dst.
--- .../selftests/bpf/prog_tests/tc_redirect.c | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +75 -4
@@ -291,6 +291,7 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)SYS (fail,"ip addr add " IP4_DST "/32 dev dst" );SYS (fail,"ip addr add " IP6_DST "/128 dev dst nodad" );SYS (fail,"ip link set dev dst up" ); +SYS (fail,"ip link set dev lo up" );SYS (fail,"ip route add " IP4_SRC "/32 dev dst scope global" );SYS (fail,"ip route add " IP4_NET "/16 dev dst scope global" );
@@ -468,7 +469,7 @@ static int set_forwarding(bool enable)return 0 ; } -static void rcv_tstamp (int fd,const char *expected,size_t s) +static int __rcv_tstamp (int fd,const char *expected,size_t s,__u64 *tstamp) {struct __kernel_timespec pkt_ts = {};char ctl[CMSG_SPACE (sizeof (pkt_ts))];
@@ -489,7 +490,7 @@ static void rcv_tstamp(int fd, const char *expected, size_t s) ret =recvmsg (fd, &msg,0 );if (!ASSERT_EQ (ret, s,"recvmsg" )) -return ; +return -1 ;ASSERT_STRNEQ (data, expected, s,"expected rcv data" ); cmsg =CMSG_FIRSTHDR (&msg);
@@ -498,6 +499,12 @@ static void rcv_tstamp(int fd, const char *expected, size_t s)memcpy (&pkt_ts,CMSG_DATA (cmsg),sizeof (pkt_ts)); pkt_ns = pkt_ts.tv_sec *NSEC_PER_SEC + pkt_ts.tv_nsec; +if (tstamp) { +/* caller will check the tstamp itself */ + *tstamp = pkt_ns; +return 0 ; + } +ASSERT_NEQ (pkt_ns,0 ,"pkt rcv tstamp" ); ret =clock_gettime (CLOCK_REALTIME , &now_ts);
@@ -507,6 +514,60 @@ static void rcv_tstamp(int fd, const char *expected, size_t s)if (ASSERT_GE (now_ns, pkt_ns,"check rcv tstamp" ))ASSERT_LT (now_ns - pkt_ns,5 *NSEC_PER_SEC ,"check rcv tstamp" ); +return 0 ; +} + +static void rcv_tstamp (int fd,const char *expected,size_t s) +{ +__rcv_tstamp (fd, expected, s,NULL ); +} + +static int wait_netstamp_needed_key (void ) +{ +int opt =1 , srv_fd =-1 , cli_fd =-1 , nretries =0 , err, n; +char buf[] ="testing testing" ; +struct nstoken *nstoken; +__u64 tstamp =0 ; + + nstoken =open_netns (NS_DST ); +if (!nstoken) +return -1 ; + + srv_fd =start_server (AF_INET6 ,SOCK_DGRAM ,"::1" ,0 ,0 ); +if (!ASSERT_GE (srv_fd,0 ,"start_server" )) + goto done; + + err =setsockopt (srv_fd,SOL_SOCKET ,SO_TIMESTAMPNS_NEW , + &opt,sizeof (opt)); +if (!ASSERT_OK (err,"setsockopt(SO_TIMESTAMPNS_NEW)" )) + goto done; + + cli_fd =connect_to_fd (srv_fd,TIMEOUT_MILLIS ); +if (!ASSERT_GE (cli_fd,0 ,"connect_to_fd" )) + goto done; + +again: + n =write (cli_fd, buf,sizeof (buf)); +if (!ASSERT_EQ (n,sizeof (buf),"send to server" )) + goto done; + err =__rcv_tstamp (srv_fd, buf,sizeof (buf), &tstamp); +if (!ASSERT_OK (err,"__rcv_tstamp" )) + goto done; +if (!tstamp && nretries++ <5 ) { +sleep (1 ); +printf ("netstamp_needed_key retry#%d\n" , nretries); + goto again; + } + +done: +if (!tstamp && srv_fd !=-1 ) { +close (srv_fd); + srv_fd =-1 ; + } +if (cli_fd !=-1 ) +close (cli_fd); +close_netns (nstoken); +return srv_fd; }static void snd_tstamp (int fd,char *b,size_t s)
@@ -843,11 +904,20 @@ static void test_tc_redirect_dtime(struct netns_setup_result *setup_result) {struct test_tc_dtime *skel;struct nstoken *nstoken; -int err; +int hold_tstamp_fd, err; + +/* Hold a sk with the SOCK_TIMESTAMP set to ensure there +* is no delay in the kernel net_enable_timestamp(). +* This ensures the following tests must have +* non zero rcv tstamp in the recvmsg(). +*/ + hold_tstamp_fd =wait_netstamp_needed_key (); +if (!ASSERT_GE (hold_tstamp_fd,0 ,"wait_netstamp_needed_key" )) +return ; skel =test_tc_dtime__open ();if (!ASSERT_OK_PTR (skel,"test_tc_dtime__open" )) -return ; + goto done; skel->rodata->IFINDEX_SRC = setup_result->ifindex_src_fwd; skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd;
@@ -892,6 +962,7 @@ static void test_tc_redirect_dtime(struct netns_setup_result *setup_result) done:test_tc_dtime__destroy (skel); +close (hold_tstamp_fd); }static void test_tc_redirect_neigh_fib (struct netns_setup_result *setup_result)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 145/638 af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
In reply to Sasha LevinFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 31e03207119a535d0b0e3b3a7f91983aeb2cb14d ]
gc_in_progress is changed under spin_lock(&unix_gc_lock), but wait_for_unix_gc() reads it locklessly.
Let's use READ_ONCE().
--- net/unix/garbage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/garbage.c +1 -1
@@ -198,7 +198,7 @@ void wait_for_unix_gc(void)if (READ_ONCE (unix_tot_inflight) >UNIX_INFLIGHT_TRIGGER_GC && !READ_ONCE (gc_in_progress))unix_gc (); -wait_event (unix_gc_wait, gc_in_progress == false); +wait_event (unix_gc_wait, !READ_ONCE (gc_in_progress)); }/* The external entry point: unix_gc() */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 146/638 arm64: dts: qcom: sm8450: Add missing interconnects to serial
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 6e115b75b43bd12d4061e53c8ff175e387783d8a ]
The serial ports did not have their interconnect paths specified when they were first introduced. Fix that.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sm8450.dtsi +12 -0
@@ -1025,6 +1025,12 @@ uart20: serial@894000 { pinctrl-names = "default"; pinctrl-0 = <&qup_uart20_default>; interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>; + interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS + &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "qup-core", + "qup-config"; status = "disabled"; };
@@ -1417,6 +1423,12 @@ uart7: serial@99c000 { pinctrl-names = "default"; pinctrl-0 = <&qup_uart7_tx>, <&qup_uart7_rx>; interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>; + interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS + &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "qup-core", + "qup-config"; status = "disabled"; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 147/638 soc: qcom: socinfo: rename PM2250 to PM4125
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 5155e48128826d0c5999dc9f47aa746df54da448 ]
It seems, the only actual mentions of PM2250 can be found are related to the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a PMIC name. Rename PM2250 to PM4125 to follow the documentation.
--- drivers/soc/qcom/socinfo.c | 2 +- include/soc/qcom/qcom-spmi-pmic.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/socinfo.c +1 -1
@@ -114,7 +114,7 @@ static const char *const pmic_models[] = { [50] = "PM8350B", [51] = "PMR735A", [52] = "PMR735B", - [55] = "PM2250", + [55] = "PM4125", [58] = "PM8450", [65] = "PM8010", };
include/soc/qcom/qcom-spmi-pmic.h +1 -1
@@ -48,7 +48,7 @@#define PMK8350_SUBTYPE 0x2f#define PMR735B_SUBTYPE 0x34#define PM6350_SUBTYPE 0x36 -#define PM2250_SUBTYPE 0x37 +#define PM4125_SUBTYPE 0x37#define PMI8998_FAB_ID_SMIC 0x11#define PMI8998_FAB_ID_GF 0x30
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 148/638 arm64: dts: qcom: sdm845-oneplus-common: improve DAI node naming
In reply to Sasha LevinFrom: David Heidelberg <[email protected]>
[ Upstream commit afe9867a0c0e10ba618c15d4ef6f8699872f6cc3 ]
Make it easier to understand what the reg in those nodes is by using the constants provided by qcom,q6dsp-lpass-ports.h.
Name nodes according to dt-binding expectations.
Fix for
```
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: service@4: dais: Unevaluated properties are not allowed ('qi2s@22', 'qi2s@23' were unexpected)
```--- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +4 -4
@@ -485,13 +485,13 @@ &pmi8998_charger { }; &q6afedai { - qi2s@22 { - reg = <22>; + dai@22 { + reg = <QUATERNARY_MI2S_RX>; qcom,sd-lines = <1>; }; - qi2s@23 { - reg = <23>; + dai@23 { + reg = <QUATERNARY_MI2S_TX>; qcom,sd-lines = <0>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 149/638 cpufreq: mediatek-hw: Don't error out if supply is not found
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit eaffb10b51bf74415c9252fd8fb4dd77122501ee ]
devm_regulator_get_optional() returns -ENODEV if no supply can be found. By introducing its usage, commit 788715b5f21c ("cpufreq: mediatek-hw:
Wait for CPU supplies before probing") caused the driver to fail probe if no supply was present in any of the CPU DT nodes.
Use devm_regulator_get() instead since the CPUs do require supplies even if not described in the DT. It will gracefully return a dummy regulator if none is found in the DT node, allowing probe to succeed.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +1 -1
@@ -312,7 +312,7 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)return dev_err_probe (&pdev->dev, -EPROBE_DEFER ,"Failed to get cpu%d device\n" , cpu); - cpu_reg =devm_regulator_get_optional (cpu_dev,"cpu" ); + cpu_reg =devm_regulator_get (cpu_dev,"cpu" );if (IS_ERR (cpu_reg))return dev_err_probe (&pdev->dev,PTR_ERR (cpu_reg),"CPU%d regulator get failed\n" , cpu);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 150/638 libbpf: Fix faccessat() usage on Android
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit ad57654053805bf9a62602aaec74cc78edb6f235 ]
Android implementation of libc errors out with -EINVAL in faccessat() if passed AT_EACCESS ([0]), this leads to ridiculous issue with libbpf refusing to load /sys/kernel/btf/vmlinux on Androids ([1]). Fix by detecting Android and redefining AT_EACCESS to 0, it's equivalent on Android.
[0] https://android.googlesource.com/platform/bionic/+/refs/heads/android13-release/libc/bionic/faccessat.cpp#50
[1] https://github.com/libbpf/libbpf-bootstrap/issues/250#issuecomment-1911324250
--- tools/lib/bpf/libbpf_internal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tools/lib/bpf/libbpf_internal.h +14 -0
@@ -18,6 +18,20 @@#include <libelf.h> #include "relo_core.h" +/* Android's libc doesn't support AT_EACCESS in faccessat() implementation +* ([0]), and just returns -EINVAL even if file exists and is accessible. +* See [1] for issues caused by this. +* +* So just redefine it to 0 on Android. +* +* [0] https://android.googlesource.com/platform/bionic/+/refs/heads/android13-release/libc/bionic/faccessat.cpp#50 +* [1] https://github.com/libbpf/libbpf-bootstrap/issues/250#issuecomment-1911324250 +*/ +#ifdef __ANDROID__ +#undef AT_EACCESS +#define AT_EACCESS 0 +#endif +/* make sure libbpf doesn't use kernel-only integer typedefs */ #pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 151/638 pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 883957bee580b723fd87d49ac73e0c84fc03a446 ]
On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is handled by an external regulator (max20411). Drop gfx.lvl from the list of power-domains exposed on this platform.
--- drivers/pmdomain/qcom/rpmhpd.c | 1 - 1 file changed, 1 deletion(-)
drivers/pmdomain/qcom/rpmhpd.c +0 -1
@@ -207,7 +207,6 @@ static struct rpmhpd *sa8540p_rpmhpds[] = { [SC8280XP_CX] = &cx, [SC8280XP_CX_AO] = &cx_ao, [SC8280XP_EBI] = &ebi, - [SC8280XP_GFX] = &gfx, [SC8280XP_LCX] = &lcx, [SC8280XP_LMX] = &lmx, [SC8280XP_MMCX] = &mmcx,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 152/638 arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit fd5821a1a83c969ed2dcc72fef885f3a82c1d978 ]
The SA8295P and SA8540P uses an external regulator (max20411), and gfx.lvl is not provided by rpmh. Drop the power-domains property of the gpucc node to reflect this.
--- arch/arm64/boot/dts/qcom/sa8540p.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sa8540p.dtsi +3 -0
@@ -168,6 +168,9 @@ opp-2592000000 { }; &gpucc { + /* SA8295P and SA8540P doesn't provide gfx.lvl */ + /delete-property/ power-domains; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 153/638 arm64: dts: renesas: r8a779g0: Restore sort order
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 8b93657c976a61726d7ffbe8d019b84b4abfb673 ]
Numerical by unit address, alphabetical by node name.
Stable-dep-of: 08e799f6bce8 ("arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2")
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 72 +++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +36 -36
@@ -161,11 +161,6 @@ L3_CA76_1: cache-controller-1 { }; }; - psci { - compatible = "arm,psci-1.0", "arm,psci-0.2"; - method = "smc"; - }; - extal_clk: extal { compatible = "fixed-clock"; #clock-cells = <0>;
@@ -185,6 +180,11 @@ pmu_a76 { interrupts-extended = <&gic GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>; }; + psci { + compatible = "arm,psci-1.0", "arm,psci-0.2"; + method = "smc"; + }; + /* External SCIF clock - to be overridden by boards that provide it */ scif_clk: scif { compatible = "fixed-clock";
@@ -1777,6 +1777,37 @@ ssi0: ssi-0 { }; }; + mmc0: mmc@ee140000 { + compatible = "renesas,sdhi-r8a779g0", + "renesas,rcar-gen4-sdhi"; + reg = <0 0xee140000 0 0x2000>; + interrupts = <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 706>, + <&cpg CPG_CORE R8A779G0_CLK_SD0H>; + clock-names = "core", "clkh"; + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; + resets = <&cpg 706>; + max-frequency = <200000000>; + iommus = <&ipmmu_ds0 32>; + status = "disabled"; + }; + + rpc: spi@ee200000 { + compatible = "renesas,r8a779g0-rpc-if", + "renesas,rcar-gen4-rpc-if"; + reg = <0 0xee200000 0 0x200>, + <0 0x08000000 0 0x04000000>, + <0 0xee208000 0 0x100>; + reg-names = "regs", "dirmap", "wbuf"; + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 629>; + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; + resets = <&cpg 629>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + ipmmu_rt0: iommu@ee480000 { compatible = "renesas,ipmmu-r8a779g0", "renesas,rcar-gen4-ipmmu-vmsa";
@@ -1886,37 +1917,6 @@ ipmmu_mm: iommu@eefc0000 { #iommu-cells = <1>; }; - mmc0: mmc@ee140000 { - compatible = "renesas,sdhi-r8a779g0", - "renesas,rcar-gen4-sdhi"; - reg = <0 0xee140000 0 0x2000>; - interrupts = <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&cpg CPG_MOD 706>, - <&cpg CPG_CORE R8A779G0_CLK_SD0H>; - clock-names = "core", "clkh"; - power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; - resets = <&cpg 706>; - max-frequency = <200000000>; - iommus = <&ipmmu_ds0 32>; - status = "disabled"; - }; - - rpc: spi@ee200000 { - compatible = "renesas,r8a779g0-rpc-if", - "renesas,rcar-gen4-rpc-if"; - reg = <0 0xee200000 0 0x200>, - <0 0x08000000 0 0x04000000>, - <0 0xee208000 0 0x100>; - reg-names = "regs", "dirmap", "wbuf"; - interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&cpg CPG_MOD 629>; - power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; - resets = <&cpg 629>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - gic: interrupt-controller@f1000000 { compatible = "arm,gic-v3"; #interrupt-cells = <3>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 154/638 arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 08e799f6bce80dd63c174d8d0fc61d1a6149960b ]
R-Car V4H actually has two SCIF_CLK pins.
The second pin provides the SCIF_CLK signal for HSCIF2 and SCIF4.
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +9 -3
@@ -185,13 +185,19 @@ psci { method = "smc"; }; - /* External SCIF clock - to be overridden by boards that provide it */ + /* External SCIF clocks - to be overridden by boards that provide them */ scif_clk: scif { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <0>; }; + scif_clk2: scif2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + }; + soc: soc { compatible = "simple-bus"; interrupt-parent = <&gic>;
@@ -681,7 +687,7 @@ hscif2: serial@e6560000 { interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD 516>, <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, - <&scif_clk>; + <&scif_clk2>; clock-names = "fck", "brg_int", "scif_clk"; dmas = <&dmac0 0x35>, <&dmac0 0x34>, <&dmac1 0x35>, <&dmac1 0x34>;
@@ -1057,7 +1063,7 @@ scif4: serial@e6c40000 { interrupts = <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD 705>, <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, - <&scif_clk>; + <&scif_clk2>; clock-names = "fck", "brg_int", "scif_clk"; dmas = <&dmac0 0x59>, <&dmac0 0x58>, <&dmac1 0x59>, <&dmac1 0x58>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 155/638 selftests/bpf: Disable IPv6 for lwt_redirect test
In reply to Sasha LevinFrom: Manu Bretelle <[email protected]>
[ Upstream commit 2ef61296d2844c6a4211e07ab70ef2fb412b2c30 ]
After a recent change in the vmtest runner, this test started failing sporadically.
Investigation showed that this test was subject to race condition which got exacerbated after the vm runner change. The symptoms being that the logic that waited for an ICMPv4 packet is naive and will break if 5 or more non-ICMPv4 packets make it to tap0.
When ICMPv6 is enabled, the kernel will generate traffic such as ICMPv6 router solicitation...
On a system with good performance, the expected ICMPv4 packet would very likely make it to the network interface promptly, but on a system with poor performance, those "guarantees" do not hold true anymore.
Given that the test is IPv4 only, this change disable IPv6 in the test netns by setting net.ipv6.conf.all.disable_ipv6 to 1. This essentially leaves "ping" as the sole generator of traffic in the network namespace.
If this test was to be made IPv6 compatible, the logic in wait_for_packet would need to be modified.
In more details...
At a high level, the test does:
- create a new namespace
- in setup_redirect_target set up lo, tap0, and link_err interfaces as well as add 2 routes that attaches ingress/egress sections of test_lwt_redirect.bpf.o to the xmit path.
- in send_and_capture_test_packets send an ICMP packet and read off the tap interface (using wait_for_packet) to check that a ICMP packet with the right size is read.
wait_for_packet will try to read max_retry (5) times from the tap0 fd looking for an ICMPv4 packet matching some criteria.
The problem is that when we set up the tap0 interface, because IPv6 is enabled by default, traffic such as Router solicitation is sent through tap0, as in:
# tcpdump -r /tmp/lwt_redirect.pc reading from file /tmp/lwt_redirect.pcap, link-type EN10MB (Ethernet) 04:46:23.578352 IP6 :: > ff02::1:ffc0:4427: ICMP6, neighbor solicitation, who has fe80::fcba:dff:fec0:4427, length 32 04:46:23.659522 IP6 :: > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:24.389169 IP 10.0.0.1 > 20.0.0.9: ICMP echo request, id 122, seq 1, length 108 04:46:24.618599 IP6 fe80::fcba:dff:fec0:4427 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:24.619985 IP6 fe80::fcba:dff:fec0:4427 > ff02::2: ICMP6, router solicitation, length 16 04:46:24.767326 IP6 fe80::fcba:dff:fec0:4427 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:28.936402 IP6 fe80::fcba:dff:fec0:4427 > ff02::2: ICMP6, router solicitation, length 16
If wait_for_packet sees 5 non-ICMPv4 packets, it will return 0, which is what we see in:
2024-01-31T03:51:25.0336992Z test_lwt_redirect_run:PASS:netns_create 0 nsec 2024-01-31T03:51:25.0341309Z open_netns:PASS:malloc token 0 nsec 2024-01-31T03:51:25.0344844Z open_netns:PASS:open /proc/self/ns/net 0 nsec 2024-01-31T03:51:25.0350071Z open_netns:PASS:open netns fd 0 nsec 2024-01-31T03:51:25.0353516Z open_netns:PASS:setns 0 nsec 2024-01-31T03:51:25.0356560Z test_lwt_redirect_run:PASS:setns 0 nsec 2024-01-31T03:51:25.0360140Z open_tuntap:PASS:open(/dev/net/tun) 0 nsec 2024-01-31T03:51:25.0363822Z open_tuntap:PASS:ioctl(TUNSETIFF) 0 nsec 2024-01-31T03:51:25.0367402Z open_tuntap:PASS:fcntl(O_NONBLOCK) 0 nsec 2024-01-31T03:51:25.0371167Z setup_redirect_target:PASS:open_tuntap 0 nsec 2024-01-31T03:51:25.0375180Z setup_redirect_target:PASS:if_nametoindex 0 nsec 2024-01-31T03:51:25.0379929Z setup_redirect_target:PASS:ip link add link_err type dummy 0 nsec 2024-01-31T03:51:25.0384874Z setup_redirect_target:PASS:ip link set lo up 0 nsec 2024-01-31T03:51:25.0389678Z setup_redirect_target:PASS:ip addr add dev lo 10.0.0.1/32 0 nsec 2024-01-31T03:51:25.0394814Z setup_redirect_target:PASS:ip link set link_err up 0 nsec 2024-01-31T03:51:25.0399874Z setup_redirect_target:PASS:ip link set tap0 up 0 nsec 2024-01-31T03:51:25.0407731Z setup_redirect_target:PASS:ip route add 10.0.0.0/24 dev link_err encap bpf xmit obj test_lwt_redirect.bpf.o sec redir_ingress 0 nsec 2024-01-31T03:51:25.0419105Z setup_redirect_target:PASS:ip route add 20.0.0.0/24 dev link_err encap bpf xmit obj test_lwt_redirect.bpf.o sec redir_egress 0 nsec 2024-01-31T03:51:25.0427209Z test_lwt_redirect_normal:PASS:setup_redirect_target 0 nsec 2024-01-31T03:51:25.0431424Z ping_dev:PASS:if_nametoindex 0 nsec 2024-01-31T03:51:25.0437222Z send_and_capture_test_packets:FAIL:wait_for_epacket unexpected wait_for_epacket: actual 0 != expected 1 2024-01-31T03:51:25.0448298Z (/tmp/work/bpf/bpf/tools/testing/selftests/bpf/prog_tests/lwt_redirect.c:175: errno: Success) test_lwt_redirect_normal egress test fails 2024-01-31T03:51:25.0457124Z close_netns:PASS:setns 0 nsec
When running in a VM which potential resource contrains, the odds that calling ping is not scheduled very soon after bringing tap0 up increases, and with this the chances to get our ICMP packet pushed to position 6+ in the network trace.
To confirm this indeed solves the issue, I ran the test 100 times in a row with:
errors=0
successes=0
for i in `seq 1 100`
do
./test_progs -t lwt_redirect/lwt_redirect_normal
if [ $? -eq 0 ]; then
successes=$((successes+1))
else
errors=$((errors+1))
fi
done
echo "successes: $successes/errors: $errors"While this test would at least fail a couple of time every 10 runs, here it ran 100 times with no error.
--- tools/testing/selftests/bpf/prog_tests/lwt_redirect.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/prog_tests/lwt_redirect.c +1 -0
@@ -203,6 +203,7 @@ static int setup_redirect_target(const char *target_dev, bool need_mac)if (!ASSERT_GE (target_index,0 ,"if_nametoindex" )) goto fail; +SYS (fail,"sysctl -w net.ipv6.conf.all.disable_ipv6=1" );SYS (fail,"ip link add link_err type dummy" );SYS (fail,"ip link set lo up" );SYS (fail,"ip addr add dev lo " LOCAL_SRC "/32" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 156/638 arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on OSM-S i.MX8MM
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 96293af54f6aa859015d8ca40a1437d3115ad50c ]
There are external pullup resistors on the board and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts | 4 ++-- arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +2 -2
@@ -294,8 +294,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 pinctrl_i2c4: i2c4grp { fsl,pins = < - MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 - MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 + MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 + MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 >; };
arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +2 -2
@@ -252,8 +252,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 pinctrl_i2c1: i2c1grp { fsl,pins = < - MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 - MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 + MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 + MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 157/638 arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on SL/BL i.MX8MM
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit f19e5bb91d53264d7dac5d845a4825afadf72440 ]
There are external pullup resistors on the board and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts | 4 ++-- arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +2 -2
@@ -279,8 +279,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 pinctrl_i2c4: i2c4grp { fsl,pins = < - MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 - MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 + MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 + MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 >; };
arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi +2 -2
@@ -237,8 +237,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 pinctrl_i2c1: i2c1grp { fsl,pins = < - MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 - MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 + MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 + MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 158/638 arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL OSM-S board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit c6d9b5672a0e2c4b1079a50d2fc8780c40cfd3eb ]
These signals are actively driven by the SoC or by the onboard transceiver. There's no need to enable the internal pull resistors and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +8 -8
@@ -313,19 +313,19 @@ MX8MM_IOMUXC_SAI5_MCLK_GPIO3_IO25 0x19 pinctrl_uart1: uart1grp { fsl,pins = < - MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 - MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 - MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 + MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 + MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 >; }; pinctrl_uart2: uart2grp { fsl,pins = < - MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 - MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 - MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 + MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 + MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 159/638 arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 162aadaa0df8217b0cc49d919dd00022fef65e78 ]
These signals are actively driven by the SoC or by the onboard transceiver. There's no need to enable the internal pull resistors and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- .../boot/dts/freescale/imx8mm-kontron-bl.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +8 -8
@@ -292,19 +292,19 @@ MX8MM_IOMUXC_SPDIF_RX_PWM2_OUT 0x19 pinctrl_uart1: uart1grp { fsl,pins = < - MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 - MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 - MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 + MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 + MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 >; }; pinctrl_uart2: uart2grp { fsl,pins = < - MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 - MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 - MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 + MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 + MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 160/638 arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL OSM-S board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 5a940ba3e4d7c8710c9073ff5d0ca4644d4da9db ]
Some signals have external pullup resistors on the board and don't need the internal ones to be enabled. Due to silicon errata ERR050080 let's disable the internal pull resistors whererever possible and prevent any unwanted behavior in case they wear out.
--- .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +9 -9
@@ -337,40 +337,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 pinctrl_usdhc2: usdhc2grp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 161/638 arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 008820524844326ffb3123cebceba1960c0ad0dc ]
Some signals have external pullup resistors on the board and don't need the internal ones to be enabled. Due to silicon errata ERR050080 let's disable the internal pull resistors whererever possible and prevent any unwanted behavior in case they wear out.
--- .../boot/dts/freescale/imx8mm-kontron-bl.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +9 -9
@@ -316,40 +316,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 pinctrl_usdhc2: usdhc2grp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 162/638 arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM module
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 8d0f39b7d04d864e89b84063b124fd10aa4b8809 ]
The level of the interrupt signal is active low instead. Fix this.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +1 -1
@@ -210,7 +210,7 @@ rv3028: rtc@52 { reg = <0x52>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rtc>; - interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>; + interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_LOW>; trickle-diode-disable; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 163/638 libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 93ee1eb85e28d1e35bb059c1f5965d65d5fc83c2 ]
LIBBPF_API annotation seems missing on libbpf_set_memlock_rlim API, so add it to make this API callable from libbpf's shared library version.
--- tools/lib/bpf/bpf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf.h +1 -1
@@ -35,7 +35,7 @@extern "C" {#endif -int libbpf_set_memlock_rlim (size_t memlock_bytes); +LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);struct bpf_map_create_opts {size_t sz;/* size of this struct for forward/backward compatibility */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 164/638 wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 24355fcb0d4cbcb6ddda262596558e8cfba70f11 ]
The ath9k_wmi_event_tasklet() used in ath9k_htc assumes that all the data structures have been fully initialised by the time it runs. However, because of the order in which things are initialised, this is not guaranteed to be the case, because the device is exposed to the USB subsystem before the ath9k driver initialisation is completed.
We already committed a partial fix for this in commit:8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()")
However, that commit only aborted the WMI_TXSTATUS_EVENTID command in the event tasklet, pairing it with an "initialisation complete" bit in the TX struct. It seems syzbot managed to trigger the race for one of the other commands as well, so let's just move the existing synchronisation bit to cover the whole tasklet (setting it at the end of ath9k_htc_probe_device() instead of inside ath9k_tx_init()).
--- drivers/net/wireless/ath/ath9k/htc.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++ drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 4 ---- drivers/net/wireless/ath/ath9k/wmi.c | 10 ++++++---- 4 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +1 -1
@@ -306,7 +306,6 @@ struct ath9k_htc_tx {DECLARE_BITMAP (tx_slot,MAX_TX_BUF_NUM );struct timer_list cleanup_timer;spinlock_t tx_lock; -bool initialized; };struct ath9k_htc_tx_ctl {
@@ -515,6 +514,7 @@ struct ath9k_htc_priv {unsigned long ps_usecount;bool ps_enabled;bool ps_idle; +bool initialized;#ifdef CONFIG_MAC80211_LEDS enum led_brightness brightness;
drivers/net/wireless/ath/ath9k/htc_drv_init.c +4 -0
@@ -966,6 +966,10 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, htc_handle->drv_priv = priv; +/* Allow ath9k_wmi_event_tasklet() to operate. */ +smp_wmb (); + priv->initialized = true; +return 0 ; err_init:
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +0 -4
@@ -815,10 +815,6 @@ int ath9k_tx_init(struct ath9k_htc_priv *priv)skb_queue_head_init (&priv->tx.data_vo_queue);skb_queue_head_init (&priv->tx.tx_failed); -/* Allow ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) to operate. */ -smp_wmb (); - priv->tx.initialized = true; -return 0 ; }
drivers/net/wireless/ath/ath9k/wmi.c +6 -4
@@ -155,6 +155,12 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) }spin_unlock_irqrestore (&wmi->wmi_lock, flags); +/* Check if ath9k_htc_probe_device() completed. */ +if (!data_race (priv->initialized)) { +kfree_skb (skb); +continue ; + } + hdr = (struct wmi_cmd_hdr *) skb->data; cmd_id =be16_to_cpu (hdr->command_id); wmi_event =skb_pull (skb,sizeof (struct wmi_cmd_hdr ));
@@ -169,10 +175,6 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) &wmi->drv_priv->fatal_work);break ;case WMI_TXSTATUS_EVENTID : -/* Check if ath9k_tx_init() completed. */ -if (!data_race (priv->tx.initialized)) -break ; -spin_lock_bh (&priv->tx.tx_lock);if (priv->tx.flags &ATH9K_HTC_OP_TX_DRAIN ) {spin_unlock_bh (&priv->tx.tx_lock);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 165/638 wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID
In reply to Sasha LevinFrom: Wen Gong <[email protected]>
[ Upstream commit 413e20e82ee78f142cb5194fd317db514f012602 ]
Currently when connecting to an AP with 11AX-HE phy mode, host sends WMI_VDEV_PARAM_SET_HEMU_MODE parameter to firmware after WMI_PEER_ASSOC_CMDID command. This results in TXBF not working, because firmware calculates TXBF values while handling WMI_PEER_ASSOC_CMDID, however at that time WMI_VDEV_PARAM_SET_HEMU_MODE has not been sent yet. See below log:
AP sends "VHT/HE/EHT NDP Announcement" to station, and station sends "Action no Ack" of category code HE to AP, the "Nc Index" and "Codebook Information" are wrong:
Issued action:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
Fixed parameters
Category code: HE (30)
HE Action: HE Compressed Beamforming And CQI (0)
Total length: 152
HE MIMO Control: 0x0004008018
.... .... .... .... .... .... .... .... .... .000 = Nc Index: 1 Column (0) .... .... .... .... .... .... .... ..0. .... .... = Codebook Information: 0
Change to send WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID, then firmware will calculate the TXBF values with valid parameters instead of empty values. TXBF works well and throughput performance is improved from 80 Mbps to 130 Mbps with this patch.
Good action after this patch:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
Fixed parameters
Category code: HE (30)
HE Action: HE Compressed Beamforming And CQI (0)
Total length: 409
HE MIMO Control: 0x0004008219
.... .... .... .... .... .... .... .... .... .001 = Nc Index: 2 Columns (1) .... .... .... .... .... .... .... ..1. .... .... = Codebook Information: 1
This change applies to all chipsets.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +7 -6
@@ -3025,7 +3025,14 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,rcu_read_unlock (); +if (!ath11k_mac_vif_recalc_sta_he_txbf (ar, vif, &he_cap)) { +ath11k_warn (ar->ab,"failed to recalc he txbf for vdev %i on bss %pM\n" , + arvif->vdev_id, bss_conf->bssid); +return ; + } + peer_arg.is_assoc = true; + ret =ath11k_wmi_send_peer_assoc_cmd (ar, &peer_arg);if (ret) { ath11k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
@@ -3048,12 +3055,6 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,return ; } -if (!ath11k_mac_vif_recalc_sta_he_txbf (ar, vif, &he_cap)) { -ath11k_warn (ar->ab,"failed to recalc he txbf for vdev %i on bss %pM\n" , - arvif->vdev_id, bss_conf->bssid); -return ; - } -WARN_ON (arvif->is_up); arvif->aid = vif->cfg.aid;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 166/638 wifi: ath12k: Update Qualcomm Innovation Center, Inc. copyrights
In reply to Sasha LevinFrom: Jeff Johnson <[email protected]>
[ Upstream commit 05205b9576615fca5da91cdae5a3f89f2ad32703 ]
Update the copyright for all ath12k files modified on behalf of Qualcomm Innovation Center, Inc. in 2023.
Stable-dep-of: 902700d55d4a ("wifi: ath12k: fix fetching MCBC flag for QCN9274")
--- drivers/net/wireless/ath/ath12k/dbring.c | 2 +- drivers/net/wireless/ath/ath12k/debug.c | 2 +- drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +- drivers/net/wireless/ath/ath12k/hal.c | 2 +- drivers/net/wireless/ath/ath12k/hal.h | 2 +- drivers/net/wireless/ath/ath12k/hal_rx.c | 2 +- drivers/net/wireless/ath/ath12k/hif.h | 2 +- drivers/net/wireless/ath/ath12k/hw.c | 2 +- drivers/net/wireless/ath/ath12k/hw.h | 2 +- drivers/net/wireless/ath/ath12k/mac.c | 2 +- drivers/net/wireless/ath/ath12k/mac.h | 2 +- drivers/net/wireless/ath/ath12k/mhi.c | 2 +- drivers/net/wireless/ath/ath12k/pci.c | 2 +- drivers/net/wireless/ath/ath12k/pci.h | 2 +- drivers/net/wireless/ath/ath12k/peer.h | 2 +- drivers/net/wireless/ath/ath12k/qmi.c | 2 +- drivers/net/wireless/ath/ath12k/qmi.h | 2 +- drivers/net/wireless/ath/ath12k/reg.c | 2 +- drivers/net/wireless/ath/ath12k/reg.h | 2 +- drivers/net/wireless/ath/ath12k/rx_desc.h | 2 +- drivers/net/wireless/ath/ath12k/wmi.c | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath12k/dbring.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include "core.h"
drivers/net/wireless/ath/ath12k/debug.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/vmalloc.h>
drivers/net/wireless/ath/ath12k/dp_tx.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include "core.h"
drivers/net/wireless/ath/ath12k/hal.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/dma-mapping.h> #include "hal_tx.h"
drivers/net/wireless/ath/ath12k/hal.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_HAL_H
drivers/net/wireless/ath/ath12k/hal_rx.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include "debug.h"
drivers/net/wireless/ath/ath12k/hif.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_HIF_H
drivers/net/wireless/ath/ath12k/hw.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/types.h>
drivers/net/wireless/ath/ath12k/hw.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_HW_H
drivers/net/wireless/ath/ath12k/mac.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <net/mac80211.h>
drivers/net/wireless/ath/ath12k/mac.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_MAC_H
drivers/net/wireless/ath/ath12k/mhi.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/msi.h>
drivers/net/wireless/ath/ath12k/pci.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h>
drivers/net/wireless/ath/ath12k/pci.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_PCI_H #define ATH12K_PCI_H
drivers/net/wireless/ath/ath12k/peer.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_PEER_H
drivers/net/wireless/ath/ath12k/qmi.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/elf.h>
drivers/net/wireless/ath/ath12k/qmi.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_QMI_H
drivers/net/wireless/ath/ath12k/reg.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/rtnetlink.h> #include "core.h"
drivers/net/wireless/ath/ath12k/reg.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_REG_H
drivers/net/wireless/ath/ath12k/rx_desc.h +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_RX_DESC_H #define ATH12K_RX_DESC_H
drivers/net/wireless/ath/ath12k/wmi.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/skbuff.h> #include <linux/ctype.h>
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 167/638 wifi: ath12k: fix fetching MCBC flag for QCN9274
In reply to Sasha LevinFrom: Raj Kumar Bhagat <[email protected]>
[ Upstream commit 902700d55d4a4522bb3eb4ef94f752a19c42230a ]
In QCN9274, RX packet's multicast and broadcast(MCBC) flag is fetched from RX descriptor's msdu_end info5 member but it is not correct for QCN9274. Due to this with encryption, ARP request packet is wrongly marked as MCBC packet and it is sent to mac80211 without setting RX_FLAG_PN_VALIDATED & RX_FLAG_DECRYPTED flag. This results in packet getting dropped in mac80211. Hence ping initiated from station to AP fails.
Fix this by fetching correct MCBC flag in case of QCN9274. For QC9274 MCBC flag should be fetched from RX descriptor's mpdu_start info6 member.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/hal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/hal.c +3 -3
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/dma-mapping.h> #include "hal_tx.h"
@@ -449,8 +449,8 @@ static u8 *ath12k_hw_qcn9274_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc)static bool ath12k_hw_qcn9274_rx_desc_is_da_mcbc (struct hal_rx_desc *desc) { -return __le16_to_cpu (desc->u.qcn9274.msdu_end.info5) & -RX_MSDU_END_INFO5_DA_IS_MCBC ; +return __le32_to_cpu (desc->u.qcn9274.mpdu_start.info6) & +RX_MPDU_START_INFO6_MCAST_BCAST ; } static void ath12k_hw_qcn9274_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 168/638 wifi: iwlwifi: mvm: report beacon protection failures
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 91380f768d7f6e3d003755defa792e9a00a1444a ]
Andrei reports that we just silently drop beacons after we report the key counters, but never report to userspace, so wpa_supplicant cannot send the WNM action frame. Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +15 -11
@@ -282,6 +282,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,u32 status, struct ieee80211_rx_status *stats) { + struct wireless_dev *wdev;struct iwl_mvm_sta *mvmsta;struct iwl_mvm_vif *mvmvif;u8 keyid;
@@ -303,9 +304,15 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!ieee80211_is_beacon (hdr->frame_control))return 0 ; +if (!sta) +return -1 ; + + mvmsta =iwl_mvm_sta_from_mac80211 (sta); + mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); +/* key mismatch - will also report !MIC_OK but we shouldn't count it */ if (!(status &IWL_RX_MPDU_STATUS_KEY_VALID )) -return -1 ; + goto report;/* good cases */ if (likely(status & IWL_RX_MPDU_STATUS_MIC_OK &&
@@ -314,13 +321,6 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return 0 ; } -if (!sta) -return -1 ; - - mvmsta =iwl_mvm_sta_from_mac80211 (sta); - - mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); -/* * both keys will have the same cipher and MIC length, use * whichever one is available
@@ -329,11 +329,11 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!key) { key =rcu_dereference (mvmvif->bcn_prot.keys[1 ]);if (!key) -return -1 ; + goto report; }if (len < key->icv_len +IEEE80211_GMAC_PN_LEN +2 ) -return -1 ; + goto report;/* get the real key ID */ keyid = frame[len - key->icv_len -IEEE80211_GMAC_PN_LEN -2 ];
@@ -347,7 +347,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return -1 ; key =rcu_dereference (mvmvif->bcn_prot.keys[keyid -6 ]);if (!key) -return -1 ; + goto report; }/* Report status to mac80211 */
@@ -355,6 +355,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,ieee80211_key_mic_failure (key); else if (status & IWL_RX_MPDU_STATUS_REPLAY_ERROR) ieee80211_key_replay(key); +report: + wdev =ieee80211_vif_to_wdev (mvmsta->vif); +if (wdev->netdev) +cfg80211_rx_unprot_mlme_mgmt (wdev->netdev, (void *)hdr, len);return -1 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 169/638 wifi: iwlwifi: dbg-tlv: ensure NUL termination
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit ea1d166fae14e05d49ffb0ea9fcd4658f8d3dcea ]
The iwl_fw_ini_debug_info_tlv is used as a string, so we must ensure the string is terminated correctly before using it.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +6 -0
@@ -103,6 +103,12 @@ static int iwl_dbg_tlv_alloc_debug_info(struct iwl_trans *trans,if (le32_to_cpu (tlv->length) !=sizeof (*debug_info))return -EINVAL ; +/* we use this as a string, ensure input was NUL terminated */ +if (strnlen (debug_info->debug_cfg_name, +sizeof (debug_info->debug_cfg_name)) == +sizeof (debug_info->debug_cfg_name)) +return -EINVAL ; +IWL_DEBUG_FW (trans,"WRT: Loading debug cfg: %s\n" , debug_info->debug_cfg_name);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 170/638 wifi: iwlwifi: acpi: fix WPFC reading
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 296f3e926716ded8dc29e349d2b042b362f96515 ]
The code reading the WPFC table needs to take into account the domain type (first element in the package), shouldn't leak the memory if it fails, and has a bad comment. Fix all these issues.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 10 +++++----- drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +5 -5
@@ -1268,7 +1268,6 @@ void iwl_acpi_get_phy_filters(struct iwl_fw_runtime *fwrt,if (IS_ERR (data))return ; -/* try to read wtas table revision 1 or revision 0*/ wifi_pkg =iwl_acpi_get_wifi_pkg (fwrt->dev, data,ACPI_WPFC_WIFI_DATA_SIZE , &tbl_rev);
@@ -1278,13 +1277,14 @@ void iwl_acpi_get_phy_filters(struct iwl_fw_runtime *fwrt,if (tbl_rev !=0 ) goto out_free; -BUILD_BUG_ON (ARRAY_SIZE (filters->filter_cfg_chains) !=ACPI_WPFC_WIFI_DATA_SIZE ); +BUILD_BUG_ON (ARRAY_SIZE (filters->filter_cfg_chains) != +ACPI_WPFC_WIFI_DATA_SIZE -1 );for (i =0 ; i <ARRAY_SIZE (filters->filter_cfg_chains); i++) { -if (wifi_pkg->package.elements[i].type !=ACPI_TYPE_INTEGER ) -return ; +if (wifi_pkg->package.elements[i +1 ].type !=ACPI_TYPE_INTEGER ) + goto out_free; tmp.filter_cfg_chains[i] = -cpu_to_le32 (wifi_pkg->package.elements[i].integer.value); +cpu_to_le32 (wifi_pkg->package.elements[i +1 ].integer.value); }IWL_DEBUG_RADIO (fwrt,"Loaded WPFC filter config from ACPI\n" );
drivers/net/wireless/intel/iwlwifi/fw/acpi.h +1 -1
@@ -56,7 +56,7 @@#define ACPI_EWRD_WIFI_DATA_SIZE_REV2 ((ACPI_SAR_PROFILE_NUM - 1) * \ ACPI_SAR_NUM_CHAINS_REV2 * \ ACPI_SAR_NUM_SUB_BANDS_REV2 + 3) -#define ACPI_WPFC_WIFI_DATA_SIZE 4/* 4 filter config words */ +#define ACPI_WPFC_WIFI_DATA_SIZE 5/* domain and 4 filter config words */ /* revision 0 and 1 are identical, except for the semantics in the FW */ #define ACPI_GEO_NUM_BANDS_REV0 2
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 171/638 wifi: iwlwifi: mvm: initialize rates in FW earlier
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit d3b2c6c65bfd3b9616084e91bd0d402964ea7cef ]
When connecting to an AP, we currently initialize the rate control only after associating. Since we now use firmware to assign rates to auth/assoc frames rather than using the data in the station and the firmware doesn't know, they're transmitted using low mandatory rates. However, if the AP advertised only higher supported rates we want to use them to be nicer (it still must receive mandatory rates though), so send the information to the firmware earlier to have it know about it and be able to use it.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +13 -0
@@ -3677,6 +3677,19 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,if (vif->type ==NL80211_IFTYPE_STATION && !sta->tdls) mvmvif->ap_sta = sta; +/* +* Initialize the rates here already - this really tells +* the firmware only what the supported legacy rates are +* (may be) since it's initialized already from what the +* AP advertised in the beacon/probe response. This will +* allow the firmware to send auth/assoc frames with one +* of the supported rates already, rather than having to +* use a mandatory rate. +* If we're the AP, we'll just assume mandatory rates at +* this point, but we know nothing about the STA anyway. +*/ +iwl_mvm_rs_rate_init_all_links (mvm, vif, sta); +return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 172/638 wifi: iwlwifi: fix EWRD table validity check
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit c8d8f3911135921ace8e939ea0956b55f74bf8a0 ]
EWRD ACPI table contains up to 3 additional sar profiles. According to the BIOS spec, the table contains a n_profile variable indicating how many additional profiles exist in the table.
Currently we check that n_profiles is not <= 0.
But according to the BIOS spec, 0 is a valid value, and it can't be < 0 anyway because we receive that from ACPI as an unsigned integer.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +1 -1
@@ -767,7 +767,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)* from index 1, so the maximum value allowed here is * ACPI_SAR_PROFILES_NUM - 1. */ -if (n_profiles <=0 || n_profiles >=ACPI_SAR_PROFILE_NUM ) { +if (n_profiles >=ACPI_SAR_PROFILE_NUM ) { ret = -EINVAL ; goto out_free; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 173/638 wifi: iwlwifi: mvm: d3: fix IPN byte order
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 0c769cb6b9f364423c255f117774c9ecd5bf23ea ]
The IPN is reported by the firmware in 6 bytes little endian, but mac80211 expects big endian so it can do memcmp() on it. We used to store this as a u64 which was filled in the right way, but never used. When implementing that it's used, we changed it to just be 6 bytes, but lost the conversion. Add it back.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +7 -1
@@ -2167,7 +2167,10 @@ static void iwl_mvm_convert_gtk_v3(struct iwl_wowlan_status_data *status,static void iwl_mvm_convert_igtk (struct iwl_wowlan_status_data *status,struct iwl_wowlan_igtk_status *data) { +int i; +BUILD_BUG_ON (sizeof (status->igtk.key) <sizeof (data->key)); +BUILD_BUG_ON (sizeof (status->igtk.ipn) !=sizeof (data->ipn));if (!data->key_len)return ;
@@ -2179,7 +2182,10 @@ static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status, +WOWLAN_IGTK_MIN_INDEX ;memcpy (status->igtk.key, data->key,sizeof (data->key)); -memcpy (status->igtk.ipn, data->ipn,sizeof (data->ipn)); + +/* mac80211 expects big endian for memcmp() to work, convert */ +for (i =0 ; i <sizeof (data->ipn); i++) + status->igtk.ipn[i] = data->ipn[sizeof (data->ipn) - i -1 ]; } static void iwl_mvm_parse_wowlan_info_notif(struct iwl_mvm *mvm,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 174/638 wifi: iwlwifi: mvm: fix the TLC command after ADD_STA
In reply to Sasha LevinFrom: Emmanuel Grumbach <[email protected]>
[ Upstream commit 0fcdf55fced7121c43fa576433986f1c04115b73 ]
ADD_STA resets the link quality data inside the firmware. This is not supposed to happen and has been fixed for newer devices. For older devices (AX201 and down), this makes us send frames with rates that are not in the TLC table.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +8 -4
@@ -3781,13 +3781,17 @@ iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm, mvm_sta->authorized = true; -iwl_mvm_rs_rate_init_all_links (mvm, vif, sta); -/* MFP is set by default before the station is authorized. * Clear it here in case it's not used. */ -if (!sta->mfp) -return callbacks->update_sta (mvm, vif, sta); +if (!sta->mfp) { +int ret = callbacks->update_sta (mvm, vif, sta); + +if (ret) +return ret; + } + +iwl_mvm_rs_rate_init_all_links (mvm, vif, sta);return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 175/638 wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit c868a189ecfe8cc0b3173c2eaa7f0b659326c151 ]
The driver is supposed to read the PNVM from BIOS only for non-Intel SKUs. For Intel SKUs the OEM ID will be 0.
Read BIOS PNVM only when a non-Intel SKU is indicated.
--- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +18 -12
@@ -255,21 +255,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)struct pnvm_sku_package *package;u8 *image =NULL ; -/* First attempt to get the PNVM from BIOS */ - package =iwl_uefi_get_pnvm (trans_p, len); -if (!IS_ERR_OR_NULL (package)) { -if (*len >=sizeof (*package)) { -/* we need only the data */ - *len -=sizeof (*package); - image =kmemdup (package->data, *len,GFP_KERNEL ); +/* Get PNVM from BIOS for non-Intel SKU */ +if (trans_p->sku_id[2 ]) { + package =iwl_uefi_get_pnvm (trans_p, len); +if (!IS_ERR_OR_NULL (package)) { +if (*len >=sizeof (*package)) { +/* we need only the data */ + *len -=sizeof (*package); + image =kmemdup (package->data, + *len,GFP_KERNEL ); + } +/* +* free package regardless of whether kmemdup +* succeeded +*/ +kfree (package); +if (image) +return image; } -/* free package regardless of whether kmemdup succeeded */ -kfree (package); -if (image) -return image; } -/* If it's not available, try from the filesystem */ +/* If it's not available, or for Intel SKU, try from the filesystem */ if (iwl_pnvm_get_from_fs (trans_p, &image, len))return NULL ;return image;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 176/638 gpio: vf610: allow disabling the vf610 driver
In reply to Sasha LevinFrom: Martin Kaiser <[email protected]>
[ Upstream commit f57595788244a838deec2d3be375291327cbc035 ]
The vf610 gpio driver is enabled by default for all i.MX machines, without any option to disable it in a board-specific config file.
Most i.MX chipsets have no hardware for this driver. Change the default to enable GPIO_VF610 for SOC_VF610 and disable it otherwise.
Add a text description after the bool type, this makes the driver selectable by make config etc.
--- drivers/gpio/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +2 -1
@@ -691,7 +691,8 @@ config GPIO_UNIPHIER Say yes here to support UniPhier GPIOs. config GPIO_VF610 - def_bool y + bool "VF610 GPIO support" + default y if SOC_VF610 depends on ARCH_MXC select GPIOLIB_IRQCHIP help
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 177/638 arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS
In reply to Sasha LevinFrom: Tim Harvey <[email protected]>
[ Upstream commit ec2cb52fcfef5d58574f2cfbc9a99ffc20ae5a9d ]
The GW71xx does not have a gpio controlled vbus regulator but it does require some pinctrl. Remove the regulator and move the valid pinctrl into the usbotg1 node.
--- .../dts/freescale/imx8mm-venice-gw71xx.dtsi | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +9 -20
@@ -47,17 +47,6 @@ pps { gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; status = "okay"; }; - - reg_usb_otg1_vbus: regulator-usb-otg1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_reg_usb1_en>; - compatible = "regulator-fixed"; - regulator-name = "usb_otg1_vbus"; - gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; - enable-active-high; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; }; /* off-board header */
@@ -145,9 +134,10 @@ &uart3 { }; &usbotg1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1>; dr_mode = "otg"; over-current-active-low; - vbus-supply = <®_usb_otg1_vbus>; status = "okay"; };
@@ -205,14 +195,6 @@ MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x41 >; }; - pinctrl_reg_usb1_en: regusb1grp { - fsl,pins = < - MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x41 - MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 - MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 - >; - }; - pinctrl_spi2: spi2grp { fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6
@@ -235,4 +217,11 @@ MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX 0x140 MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX 0x140 >; }; + + pinctrl_usbotg1: usbotg1grp { + fsl,pins = < + MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 + MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 + >; + }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 178/638 pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit e25ac87d3f831fed002c34aadddaf4ebb4ea45ec ]
The suspend callback disables the periph clock when the PWM is enabled and resume reenables this clock if the PWM was disabled before. Judging from the code comment it's suspend that is wrong here. Fix accordingly.
--- drivers/pwm/pwm-atmel-hlcdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-atmel-hlcdc.c +1 -1
@@ -187,7 +187,7 @@ static int atmel_hlcdc_pwm_suspend(struct device *dev)struct atmel_hlcdc_pwm *atmel =dev_get_drvdata (dev);/* Keep the periph clock enabled if the PWM is still running. */ -if (pwm_is_enabled (&atmel->chip.pwms[0 ])) +if (!pwm_is_enabled (&atmel->chip.pwms[0 ]))clk_disable_unprepare (atmel->hlcdc->periph_clk);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 179/638 net: blackhole_dev: fix build warning for ethh set but not used
In reply to Sasha LevinFrom: Breno Leitao <[email protected]>
[ Upstream commit 843a8851e89e2e85db04caaf88d8554818319047 ]
lib/test_blackhole_dev.c sets a variable that is never read, causing this following building warning:
lib/test_blackhole_dev.c:32:17: warning: variable 'ethh' set but not used [-Wunused-but-set-variable]
Remove the variable struct ethhdr *ethh, which is unused.
--- lib/test_blackhole_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/test_blackhole_dev.c +1 -2
@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void) {struct ipv6hdr *ip6h;struct sk_buff *skb; -struct ethhdr *ethh;struct udphdr *uh;int data_len;int ret;
@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void) ip6h->saddr = in6addr_loopback; ip6h->daddr = in6addr_loopback;/* Ether */ - ethh = (struct ethhdr *)skb_push (skb,sizeof (struct ethhdr )); +skb_push (skb,sizeof (struct ethhdr ));skb_set_mac_header (skb,0 ); skb->protocol =htons (ETH_P_IPV6 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 180/638 arm64: dts: ti: k3-j721s2: Fix power domain for VTM node
In reply to Sasha LevinFrom: Manorit Chawdhry <[email protected]>
[ Upstream commit 5ef196ed912e80a1e64936119ced8d7eb5635f0f ]
Fix the power domain device ID for wkup_vtm0 node.
--- arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +1 -1
@@ -652,7 +652,7 @@ wkup_vtm0: temperature-sensor@42040000 { compatible = "ti,j7200-vtm"; reg = <0x00 0x42040000 0x0 0x350>, <0x00 0x42050000 0x0 0x350>; - power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; + power-domains = <&k3_pds 180 TI_SCI_PD_SHARED>; #thermal-sensor-cells = <1>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 181/638 arm64: dts: ti: k3-j784s4: Fix power domain for VTM node
In reply to Sasha LevinFrom: Manorit Chawdhry <[email protected]>
[ Upstream commit e4d252e6d29208aea56d4c04270523e306b1e3c2 ]
Fix the power domain device ID for wkup_vtm0 node.
--- arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +1 -1
@@ -616,7 +616,7 @@ wkup_vtm0: temperature-sensor@42040000 { compatible = "ti,j7200-vtm"; reg = <0x00 0x42040000 0x00 0x350>, <0x00 0x42050000 0x00 0x350>; - power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; + power-domains = <&k3_pds 243 TI_SCI_PD_SHARED>; #thermal-sensor-cells = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 182/638 wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use
In reply to Sasha LevinFrom: Baochen Qiang <[email protected]>
[ Upstream commit b802e7b7e771dee3377d071418281f8b64d2d832 ]
Currently in ath11k_peer_assoc_h_he() rx_mcs_80 and rx_mcs_160 are used to calculate max_nss, see
if (support_160) max_nss = min(rx_mcs_80, rx_mcs_160); else max_nss = rx_mcs_80;
Kernel test robot complains on uninitialized symbols:drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'. drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_160'. drivers/net/wireless/ath/ath11k/mac.c:2323 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'.
This is because there are some code paths that never set them, so the assignment of max_nss can come from uninitialized variables. This could result in some unknown issues since a wrong peer_nss might be passed to firmware.
Change to initialize them to an invalid value at the beginning. This makes sense because even max_nss gets an invalid value, due to either or both of them being invalid, we can get an valid peer_nss with following guard:
arg->peer_nss = min(sta->deflink.rx_nss, max_nss)
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/mac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +4 -0
@@ -2296,6 +2296,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, mcs_160_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_160); mcs_80_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_80); +/* Initialize rx_mcs_160 to 9 which is an invalid value */ + rx_mcs_160 =9 ;if (support_160) {for (i =7 ; i >=0 ; i--) {u8 mcs_160 = (mcs_160_map >> (2 * i)) &3 ;
@@ -2307,6 +2309,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, } } +/* Initialize rx_mcs_80 to 9 which is an invalid value */ + rx_mcs_80 =9 ;for (i =7 ; i >=0 ; i--) {u8 mcs_80 = (mcs_80_map >> (2 * i)) &3 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 183/638 wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
In reply to Sasha LevinFrom: Zhipeng Lu <[email protected]>
[ Upstream commit 5f0e4aede01cb01fa633171f0533affd25328c3a ]
In the for statement of lbs_allocate_cmd_buffer(), if the allocation of cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer().
--- drivers/net/wireless/marvell/libertas/cmd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/libertas/cmd.c +11 -2
@@ -1132,7 +1132,7 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)if (!cmdarray[i].cmdbuf) {lbs_deb_host ("ALLOC_CMD_BUF: ptempvirtualaddr is NULL\n" ); ret =-1 ; - goto done; + goto free_cmd_array; } }
@@ -1140,8 +1140,17 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)init_waitqueue_head (&cmdarray[i].cmdwait_q);lbs_cleanup_and_insert_cmd (priv, &cmdarray[i]); } - ret =0 ; +return 0 ; +free_cmd_array: +for (i =0 ; i <LBS_NUM_CMD_BUFFERS ; i++) { +if (cmdarray[i].cmdbuf) { +kfree (cmdarray[i].cmdbuf); + cmdarray[i].cmdbuf =NULL ; + } + } +kfree (priv->cmd_array); + priv->cmd_array =NULL ; done:return ret; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 184/638 libbpf: Use OPTS_SET() macro in bpf_xdp_query()
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 92a871ab9fa59a74d013bc04f321026a057618e7 ]
When the feature_flags and xdp_zc_max_segs fields were added to the libbpf bpf_xdp_query_opts, the code writing them did not use the OPTS_SET() macro. This causes libbpf to write to those fields unconditionally, which means that programs compiled against an older version of libbpf (with a smaller size of the bpf_xdp_query_opts struct) will have its stack corrupted by libbpf writing out of bounds.
The patch adding the feature_flags field has an early bail out if the feature_flags field is not part of the opts struct (via the OPTS_HAS) macro, but the patch adding xdp_zc_max_segs does not. For consistency, this fix just changes the assignments to both fields to use the OPTS_SET() macro.
--- tools/lib/bpf/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/bpf/netlink.c +2 -2
@@ -496,8 +496,8 @@ int bpf_xdp_query(int ifindex, int xdp_flags, struct bpf_xdp_query_opts *opts)if (err)return libbpf_err (err); - opts->feature_flags = md.flags; - opts->xdp_zc_max_segs = md.xdp_zc_max_segs; +OPTS_SET (opts, feature_flags, md.flags); +OPTS_SET (opts, xdp_zc_max_segs, md.xdp_zc_max_segs); skip_feature_flags:return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 185/638 wifi: wfx: fix memory leak when starting AP
In reply to Sasha LevinFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit b8cfb7c819dd39965136a66fe3a7fde688d976fc ]
Kmemleak reported this error:
unreferenced object 0xd73d1180 (size 184):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.245s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 1e 00 01 00 00 00 00 00 ................
backtrace:
[<5ca11420>] kmem_cache_alloc+0x20c/0x5ac
[<127bdd74>] __alloc_skb+0x144/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4
[<69954f45>] __sys_sendmsg+0x64/0xa8
unreferenced object 0xce087000 (size 1024):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.246s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
10 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<9a993714>] __kmalloc_track_caller+0x230/0x600
[<f83ea192>] kmalloc_reserve.constprop.0+0x30/0x74
[<a2c61343>] __alloc_skb+0xa0/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4However, since the kernel is build optimized, it seems the stack is not accurate. It appears the issue is related to wfx_set_mfp_ap(). The issue is obvious in this function: memory allocated by ieee80211_beacon_get() is never released. Fixing this leak makes kmemleak happy.
--- drivers/net/wireless/silabs/wfx/sta.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/silabs/wfx/sta.c +10 -5
@@ -362,6 +362,7 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif)const int pairwise_cipher_suite_count_offset =8 /sizeof (u16);const int pairwise_cipher_suite_size =4 /sizeof (u16);const int akm_suite_size =4 /sizeof (u16); +int ret = -EINVAL ;const u16 *ptr;if (unlikely (!skb))
@@ -370,22 +371,26 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif) ptr = (u16 *)cfg80211_find_ie (WLAN_EID_RSN , skb->data + ieoffset, skb->len - ieoffset);if (unlikely (!ptr)) -return -EINVAL ; + goto free_skb; ptr += pairwise_cipher_suite_count_offset;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + pairwise_cipher_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + akm_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb;wfx_hif_set_mfp (wvif, *ptr &BIT (7 ), *ptr &BIT (6 )); -return 0 ; + ret =0 ; + +free_skb: +dev_kfree_skb (skb); +return ret; } int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 186/638 arm64: dts: qcom: msm8998: switch USB QMP PHY to new style of bindings
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit b7efebfeb2e8ad8187cdabba5f0212ba2e6c1069 ]
Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes).
Stable-dep-of: fc835b2311d4 ("arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY")
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 35 +++++++++++---------------- 1 file changed, 14 insertions(+), 21 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +14 -21
@@ -2160,7 +2160,7 @@ usb3_dwc3: usb@a800000 { interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; snps,dis_u2_susphy_quirk; snps,dis_enblslpm_quirk; - phys = <&qusb2phy>, <&usb1_ssphy>; + phys = <&qusb2phy>, <&usb3phy>; phy-names = "usb2-phy", "usb3-phy"; snps,has-lpm-erratum; snps,hird-threshold = /bits/ 8 <0x10>;
@@ -2169,33 +2169,26 @@ usb3_dwc3: usb@a800000 { usb3phy: phy@c010000 { compatible = "qcom,msm8998-qmp-usb3-phy"; - reg = <0x0c010000 0x18c>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - ranges; + reg = <0x0c010000 0x1000>; clocks = <&gcc GCC_USB3_PHY_AUX_CLK>, + <&gcc GCC_USB3_CLKREF_CLK>, <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, - <&gcc GCC_USB3_CLKREF_CLK>; - clock-names = "aux", "cfg_ahb", "ref"; + <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "aux", + "ref", + "cfg_ahb", + "pipe"; + clock-output-names = "usb3_phy_pipe_clk_src"; + #clock-cells = <0>; + #phy-cells = <0>; resets = <&gcc GCC_USB3_PHY_BCR>, <&gcc GCC_USB3PHY_PHY_BCR>; - reset-names = "phy", "common"; + reset-names = "phy", + "phy_phy"; - usb1_ssphy: phy@c010200 { - reg = <0xc010200 0x128>, - <0xc010400 0x200>, - <0xc010c00 0x20c>, - <0xc010600 0x128>, - <0xc010800 0x200>; - #phy-cells = <0>; - #clock-cells = <0>; - clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>; - clock-names = "pipe0"; - clock-output-names = "usb3_phy_pipe_clk_src"; - }; + status = "disabled"; }; qusb2phy: phy@c012000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 187/638 arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit fc835b2311d4deb85d776c1d73562338462aa7ac ]
The USB3 PHY on the MSM8998 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +7 -0
@@ -1085,6 +1085,11 @@ tcsr_regs_1: syscon@1f60000 { reg = <0x01f60000 0x20000>; }; + tcsr_regs_2: syscon@1fc0000 { + compatible = "qcom,msm8998-tcsr", "syscon"; + reg = <0x01fc0000 0x26000>; + }; + tlmm: pinctrl@3400000 { compatible = "qcom,msm8998-pinctrl"; reg = <0x03400000 0xc00000>;
@@ -2188,6 +2193,8 @@ usb3phy: phy@c010000 { reset-names = "phy", "phy_phy"; + qcom,tcsr-reg = <&tcsr_regs_2 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 188/638 arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit acb94d67f5a23dbb2e0021b6c30609ed05d7d6a5 ]
The USB3 PHY on the QCM2290 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/qcm2290.dtsi +7 -0
@@ -418,6 +418,11 @@ tcsr_mutex: hwlock@340000 { #hwlock-cells = <1>; }; + tcsr_regs: syscon@3c0000 { + compatible = "qcom,qcm2290-tcsr", "syscon"; + reg = <0x0 0x003c0000 0x0 0x40000>; + }; + tlmm: pinctrl@500000 { compatible = "qcom,qcm2290-tlmm"; reg = <0x0 0x00500000 0x0 0x300000>;
@@ -665,6 +670,8 @@ usb_qmpphy: phy@1615000 { #phy-cells = <0>; + qcom,tcsr-reg = <&tcsr_regs 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 189/638 arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 95d739ed962c9aaa17d77b739606dbdf31879f6e ]
The USB3 PHY on the SM6115 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/sm6115.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/sm6115.dtsi +7 -0
@@ -591,6 +591,11 @@ tcsr_mutex: hwlock@340000 { #hwlock-cells = <1>; }; + tcsr_regs: syscon@3c0000 { + compatible = "qcom,sm6115-tcsr", "syscon"; + reg = <0x0 0x003c0000 0x0 0x40000>; + }; + tlmm: pinctrl@500000 { compatible = "qcom,sm6115-tlmm"; reg = <0x0 0x00500000 0x0 0x400000>,
@@ -856,6 +861,8 @@ usb_qmpphy: phy@1615000 { #phy-cells = <0>; + qcom,tcsr-reg = <&tcsr_regs 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 190/638 wifi: ath12k: fix incorrect logic of calculating vdev_stats_id
In reply to Sasha LevinFrom: Kang Yang <[email protected]>
[ Upstream commit 019b58dcb6ed267e17b7efd03ec8575c1b67d942 ]
During calculate vdev_stats_id, will compare vdev_stats_id with ATH12K_INVAL_VDEV_STATS_ID by '<='. If vdev_stats_id is relatively small, then assign ATH12K_INVAL_VDEV_STATS_ID to vdev_stats_id.
This logic is incorrect. Firstly, should use '>=' instead of '<=' to check if this u8 variable exceeds the max valid range.
Secondly, should use the maximum value as comparison value.
Correct comparison symbols and use the maximum value ATH12K_MAX_VDEV_STATS_ID for comparison.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/mac.c +1 -1
@@ -5152,7 +5152,7 @@ ath12k_mac_get_vdev_stats_id(struct ath12k_vif *arvif) do { if (ab->free_vdev_stats_id_map & (1LL << vdev_stats_id)) { vdev_stats_id++; - if (vdev_stats_id <= ATH12K_INVAL_VDEV_STATS_ID) { + if (vdev_stats_id >= ATH12K_MAX_VDEV_STATS_ID) { vdev_stats_id = ATH12K_INVAL_VDEV_STATS_ID; break; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 191/638 printk: Disable passing console lock owner completely during panic()
In reply to Sasha LevinFrom: Petr Mladek <[email protected]>
[ Upstream commit d04d5882cd678b898a9d7c5aee6afbe9e6e77fcd ]
The commit d51507098ff91 ("printk: disable optimistic spin during panic") added checks to avoid becoming a console waiter if a panic is in progress.
However, the transition to panic can occur while there is already a waiter. The current owner should not pass the lock to the waiter because it might get stopped or blocked anytime.
Also the panic context might pass the console lock owner to an already stopped waiter by mistake. It might happen when console_flush_on_panic() ignores the current lock owner, for example:
CPU0 CPU1
---- ----console_lock_spinning_enable()
console_trylock_spinning()
[CPU1 now console waiter]
NMI: panic()
panic_other_cpus_shutdown()
[stopped as console waiter]
console_flush_on_panic()
console_lock_spinning_enable()
[print 1 record] console_lock_spinning_disable_and_check()
[handover to stopped CPU1]
This results in panic() not flushing the panic messages.
Fix these problems by disabling all spinning operations completely during panic().
Another advantage is that it prevents possible deadlocks caused by "console_owner_lock". The panic() context does not need to take it any longer. The lockless checks are safe because the functions become NOPs when they see the panic in progress. All operations manipulating the state are still synchronized by the lock even when non-panic CPUs would notice the panic synchronously.
The current owner might stay spinning. But non-panic() CPUs would get stopped anyway and the panic context will never start spinning.
--- kernel/printk/printk.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
kernel/printk/printk.c +29 -0
@@ -1850,10 +1850,23 @@ static bool console_waiter;*/ static void console_lock_spinning_enable (void ) { +/* +* Do not use spinning in panic(). The panic CPU wants to keep the lock. +* Non-panic CPUs abandon the flush anyway. +* +* Just keep the lockdep annotation. The panic-CPU should avoid +* taking console_owner_lock because it might cause a deadlock. +* This looks like the easiest way how to prevent false lockdep +* reports without handling races a lockless way. +*/ +if (panic_in_progress ()) + goto lockdep; +raw_spin_lock (&console_owner_lock); console_owner = current;raw_spin_unlock (&console_owner_lock); +lockdep:/* The waiter may spin on us after setting console_owner */ spin_acquire (&console_owner_dep_map,0 ,0 , _THIS_IP_); }
@@ -1878,6 +1891,22 @@ static int console_lock_spinning_disable_and_check(int cookie) {int waiter; +/* +* Ignore spinning waiters during panic() because they might get stopped +* or blocked at any time, +* +* It is safe because nobody is allowed to start spinning during panic +* in the first place. If there has been a waiter then non panic CPUs +* might stay spinning. They would get stopped anyway. The panic context +* will never start spinning and an interrupted spin on panic CPU will +* never continue. +*/ +if (panic_in_progress ()) { +/* Keep lockdep happy. */ +spin_release (&console_owner_dep_map, _THIS_IP_); +return 0 ; + } +raw_spin_lock (&console_owner_lock); waiter =READ_ONCE (console_waiter); console_owner =NULL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 192/638 pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 5f623835584f1c8d1030666796f40c47a448ce0b ]
The driver only used the number of pwm channels to set the pwm_chip's npwm member. The result is that if there are more capture channels than PWM channels specified in the device tree, only a part of the capture channel is usable. Fix that by passing the bigger channel count to the pwm framework. This makes it possible that the .apply() callback is called with .hwpwm >= pwm_num_devs, catch that case and return an error code.
--- drivers/pwm/pwm-sti.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/pwm/pwm-sti.c +10 -1
@@ -395,8 +395,17 @@ static int sti_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,static int sti_pwm_apply (struct pwm_chip *chip,struct pwm_device *pwm,const struct pwm_state *state) { +struct sti_pwm_chip *pc =to_sti_pwmchip (chip); +struct sti_pwm_compat_data *cdata = pc->cdata; +struct device *dev = pc->dev;int err; +if (pwm->hwpwm >= cdata->pwm_num_devs) { +dev_err (dev,"device %u is not valid for pwm mode\n" , + pwm->hwpwm); +return -EINVAL ; + } +if (state->polarity !=PWM_POLARITY_NORMAL )return -EINVAL ;
@@ -647,7 +656,7 @@ static int sti_pwm_probe(struct platform_device *pdev) pc->chip.dev = dev; pc->chip.ops = &sti_pwm_ops; - pc->chip.npwm = pc->cdata->pwm_num_devs; + pc->chip.npwm =max (cdata->pwm_num_devs, cdata->cpt_num_devs);for (i =0 ; i < cdata->cpt_num_devs; i++) {struct sti_cpt_ddata *ddata = &cdata->ddata[i];
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 193/638 tools/resolve_btfids: Refactor set sorting with types from btf_ids.h
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 9707ac4fe2f5bac6406d2403f8b8a64d7b3d8e43 ]
Instead of using magic offsets to access BTF ID set data, leverage types from btf_ids.h (btf_id_set and btf_id_set8) which define the actual layout of the data. Thanks to this change, set sorting should also continue working if the layout changes.
This requires to sync the definition of 'struct btf_id_set8' from include/linux/btf_ids.h to tools/include/linux/btf_ids.h. We don't sync the rest of the file at the moment, b/c that would require to also sync multiple dependent headers and we don't need any other defs from btf_ids.h.
Stable-dep-of: 903fad439466 ("tools/resolve_btfids: Fix cross-compilation to non-host endianness")
--- tools/bpf/resolve_btfids/main.c | 35 ++++++++++++++++++++------------- tools/include/linux/btf_ids.h | 9 +++++++++ 2 files changed, 30 insertions(+), 14 deletions(-)
tools/bpf/resolve_btfids/main.c +21 -14
@@ -70,6 +70,7 @@#include <sys/stat.h> #include <fcntl.h> #include <errno.h> +#include <linux/btf_ids.h> #include <linux/rbtree.h> #include <linux/zalloc.h> #include <linux/err.h>
@@ -78,7 +79,7 @@#include <subcmd/parse-options.h> #define BTF_IDS_SECTION ".BTF_ids" -#define BTF_ID "__BTF_ID__" +#define BTF_ID_PREFIX "__BTF_ID__"#define BTF_STRUCT "struct"#define BTF_UNION "union"
@@ -161,7 +162,7 @@ static int eprintf(int level, int var, const char *fmt, ...)static bool is_btf_id (const char *name) { -return name && !strncmp (name,BTF_ID ,sizeof (BTF_ID ) -1 ); +return name && !strncmp (name,BTF_ID_PREFIX ,sizeof (BTF_ID_PREFIX ) -1 ); }static struct btf_id *btf_id__find (struct rb_root *root,const char *name)
@@ -441,7 +442,7 @@ static int symbols_collect(struct object *obj)* __BTF_ID__TYPE__vfs_truncate__0 * prefix = ^ */ - prefix = name +sizeof (BTF_ID ) -1 ; + prefix = name +sizeof (BTF_ID_PREFIX ) -1 ;/* struct */ if (!strncmp (prefix,BTF_STRUCT ,sizeof (BTF_STRUCT ) -1 )) {
@@ -649,19 +650,18 @@ static int cmp_id(const void *pa, const void *pb)static int sets_patch (struct object *obj) {Elf_Data *data = obj->efile.idlist; -int *ptr = data->d_buf;struct rb_node *next; next =rb_first (&obj->sets);while (next) { -unsigned long addr, idx; +struct btf_id_set8 *set8; +struct btf_id_set *set; +unsigned long addr, off;struct btf_id *id; -int *base; -int cnt; id = rb_entry(next, struct btf_id, rb_node); addr = id->addr[0 ]; - idx = addr - obj->efile.idlist_addr; + off = addr - obj->efile.idlist_addr;/* sets are unique */ if (id->addr_cnt !=1 ) {
@@ -670,14 +670,21 @@ static int sets_patch(struct object *obj)return -1 ; } - idx = idx /sizeof (int ); - base = &ptr[idx] + (id->is_set8 ?2 :1 ); - cnt = ptr[idx]; +if (id->is_set) { + set = data->d_buf + off; +qsort (set->ids, set->cnt,sizeof (set->ids[0 ]), cmp_id); + }else { + set8 = data->d_buf + off; +/* +* Make sure id is at the beginning of the pairs +* struct, otherwise the below qsort would not work. +*/ +BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id); +qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + }pr_debug ("sorting addr %5lu: cnt %6d [%s]\n" , - (idx +1 ) *sizeof (int ), cnt, id->name); - -qsort (base, cnt, id->is_set8 ?sizeof (uint64_t ) :sizeof (int ), cmp_id); + off, id->is_set ? set->cnt : set8->cnt, id->name); next =rb_next (next); }
tools/include/linux/btf_ids.h +9 -0
@@ -8,6 +8,15 @@ struct btf_id_set {u32 ids[]; }; +struct btf_id_set8 { +u32 cnt; +u32 flags; +struct { +u32 id; +u32 flags; + } pairs[]; +}; +#ifdef CONFIG_DEBUG_INFO_BTF #include <linux/compiler.h> /* for __PASTE */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 194/638 tools/resolve_btfids: Fix cross-compilation to non-host endianness
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 903fad4394666bc23975c93fb58f137ce64b5192 ]
The .BTF_ids section is pre-filled with zeroed BTF ID entries during the build and afterwards patched by resolve_btfids with correct values. Since resolve_btfids always writes in host-native endianness, it relies on libelf to do the translation when the target ELF is cross-compiled to a different endianness (this was introduced in commit 61e8aeda9398 ("bpf: Fix libelf endian handling in resolv_btfids")).
Unfortunately, the translation will corrupt the flags fields of SET8 entries because these were written during vmlinux compilation and are in the correct endianness already. This will lead to numerous selftests failures such as:
$ sudo ./test_verifier 502 502
#502/p sleepable fentry accept FAIL
Failed to load prog 'Invalid argument'!
bpf_fentry_test1 is not sleepable
verification time 34 usec
stack depth 0
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
Summary: 0 PASSED, 0 SKIPPED, 1 FAILEDSince it's not possible to instruct libelf to translate just certain values, let's manually bswap the flags (both global and entry flags) in resolve_btfids when needed, so that libelf then translates everything correctly.
--- tools/bpf/resolve_btfids/main.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
tools/bpf/resolve_btfids/main.c +35 -0
@@ -90,6 +90,14 @@#define ADDR_CNT 100 +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define ELFDATANATIVE ELFDATA2LSB +#elif __BYTE_ORDER == __BIG_ENDIAN +# define ELFDATANATIVE ELFDATA2MSB +#else +# error "Unknown machine endianness!" +#endif +struct btf_id {struct rb_node rb_node;char *name;
@@ -117,6 +125,7 @@ struct object {int idlist_shndx;size_t strtabidx;unsigned long idlist_addr; +int encoding; } efile;struct rb_root sets;
@@ -320,6 +329,7 @@ static int elf_collect(struct object *obj) {Elf_Scn *scn =NULL ;size_t shdrstrndx; +GElf_Ehdr ehdr;int idx =0 ;Elf *elf;int fd;
@@ -351,6 +361,13 @@ static int elf_collect(struct object *obj)return -1 ; } +if (gelf_getehdr (obj->efile.elf, &ehdr) ==NULL ) { +pr_err ("FAILED cannot get ELF header: %s\n" , +elf_errmsg (-1 )); +return -1 ; + } + obj->efile.encoding = ehdr.e_ident[EI_DATA ]; +/* * Scan all the elf sections and look for save data * from .BTF_ids section and symbols.
@@ -681,6 +698,24 @@ static int sets_patch(struct object *obj)*/ BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id);qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + +/* +* When ELF endianness does not match endianness of the +* host, libelf will do the translation when updating +* the ELF. This, however, corrupts SET8 flags which are +* already in the target endianness. So, let's bswap +* them to the host endianness and libelf will then +* correctly translate everything. +*/ +if (obj->efile.encoding !=ELFDATANATIVE ) { +int i; + + set8->flags =bswap_32 (set8->flags); +for (i =0 ; i < set8->cnt; i++) { + set8->pairs[i].flags = +bswap_32 (set8->pairs[i].flags); + } + } } pr_debug("sorting addr %5lu: cnt %6d [%s]\n",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 195/638 wifi: iwlwifi: support EHT for WH
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit f51d6431824f0afb9f73d68971d154c47c26b86a ]
sku_cap_11be_enable should be set to true also for WH.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +1 -1
@@ -2038,7 +2038,7 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, !!(mac_flags &NVM_MAC_SKU_FLAGS_BAND_5_2_ENABLED ); nvm->sku_cap_mimo_disabled = !!(mac_flags &NVM_MAC_SKU_FLAGS_MIMO_DISABLED ); -if (CSR_HW_RFID_TYPE (trans->hw_rf_id) ==IWL_CFG_RF_TYPE_FM ) +if (CSR_HW_RFID_TYPE (trans->hw_rf_id) >=IWL_CFG_RF_TYPE_FM ) nvm->sku_cap_11be_enable = true;/* Initialize PHY sku data */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 196/638 wifi: iwlwifi: mvm: fix erroneous queue index mask
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 2e0e766bd8a7f14f10c3e70b8203c4c1e6d9ec76 ]
When retrieving the queue index ("SCD SSN") from the TX response, it's currently masked with 0xFFF. However, now that we have queues longer than 4k, that became wrong, so make the mask depend on the hardware family.
This fixes an issue where if we get a single frame reclaim while in the top half of an 8k long queue, we'd reclaim-wrap the queue twice (once on this and then again on the next non-single reclaim) which at least triggers the WARN_ON_ONCE() in iwl_txq_reclaim(), but could have other negative side effects (such as unmapping a frame that wasn't transmitted yet, and then taking an IOMMU fault) as well.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +9 -3
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2012-2014, 2018-2023 Intel Corporation +* Copyright (C) 2012-2014, 2018-2024 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -1616,12 +1616,18 @@ static void iwl_mvm_tx_status_check_trigger(struct iwl_mvm *mvm,* of the batch. This is why the SSN of the SCD is written at the end of the * whole struct at a variable offset. This function knows how to cope with the * variable offset and returns the SSN of the SCD. +* +* For 22000-series and lower, this is just 12 bits. For later, 16 bits. */ static inline u32 iwl_mvm_get_scd_ssn (struct iwl_mvm *mvm,struct iwl_mvm_tx_resp *tx_resp) { -return le32_to_cpup ((__le32 *)iwl_mvm_get_agg_status (mvm, tx_resp) + - tx_resp->frame_count) &0xfff ; +u32 val =le32_to_cpup ((__le32 *)iwl_mvm_get_agg_status (mvm, tx_resp) + + tx_resp->frame_count); + +if (mvm->trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_AX210 ) +return val &0xFFFF ; +return val &0xFFF ; } static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 197/638 wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
In reply to Sasha LevinFrom: Emmanuel Grumbach <[email protected]>
[ Upstream commit e35f316bce9e5733c9826120c1838f4c447b2c4c ]
The firmware doesn't need the MFP flag for the GTK, it can even make the firmware crash. in case the AP is configured with: group cipher TKIP and MFPC. We would send the GTK with cipher = TKIP and MFP which is of course not possible.
--- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +11 -7
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2022 - 2023 Intel Corporation +* Copyright (C) 2022 - 2024 Intel Corporation */ #include <linux/kernel.h> #include <net/mac80211.h>
@@ -62,11 +62,13 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm, struct ieee80211_key_conf *keyconf) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +bool pairwise = keyconf->flags &IEEE80211_KEY_FLAG_PAIRWISE ; +bool igtk = keyconf->keyidx ==4 || keyconf->keyidx ==5 ;u32 flags =0 ;lockdep_assert_held (&mvm->mutex); -if (!(keyconf->flags &IEEE80211_KEY_FLAG_PAIRWISE )) +if (!pairwise) flags |=IWL_SEC_KEY_FLAG_MCAST_KEY ;switch (keyconf->cipher) {
@@ -96,12 +98,14 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,if (!sta && vif->type ==NL80211_IFTYPE_STATION ) sta = mvmvif->ap_sta; -/* Set the MFP flag also for an AP interface where the key is an IGTK -* key as in such a case the station would always be NULL +/* +* If we are installing an iGTK (in AP or STA mode), we need to tell +* the firmware this key will en/decrypt MGMT frames. +* Same goes if we are installing a pairwise key for an MFP station. +* In case we're installing a groupwise key (which is not an iGTK), +* then, we will not use this key for MGMT frames. */ -if ((!IS_ERR_OR_NULL (sta) && sta->mfp) || - (vif->type ==NL80211_IFTYPE_AP && - (keyconf->keyidx ==4 || keyconf->keyidx ==5 ))) +if ((!IS_ERR_OR_NULL (sta) && sta->mfp && pairwise) || igtk) flags |=IWL_SEC_KEY_FLAG_MFP ;return flags;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 198/638 wifi: iwlwifi: mvm: don't set replay counters to 0xff
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit d5bd4041cd70faf26fc9a54bd6f172537bbe77f3 ]
The firmware (later) actually uses the values even for keys that are invalid as far as the host is concerned, later in rekeying, and then only sets the low 48 bits since the PNs are only 48 bits over the air. It does, however, compare the full 64 bits later, obviously causing problems.
Remove the memset and use kzalloc instead to avoid any old heap data leaking to the firmware. We already init all the other fields in the struct anyway. This leaves the data set to zero for any unused fields, so the firmware can look at them safely even if they're not used right now.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -3
@@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm,struct wowlan_key_rsc_v5_data data = {};int i; - data.rsc =kmalloc (sizeof (*data.rsc),GFP_KERNEL ); + data.rsc =kzalloc (sizeof (*data.rsc),GFP_KERNEL );if (!data.rsc)return -ENOMEM ; -memset (data.rsc,0xff ,sizeof (*data.rsc)); -for (i =0 ; i <ARRAY_SIZE (data.rsc->mcast_key_id_map); i++) data.rsc->mcast_key_id_map[i] =IWL_MCAST_KEY_MAP_INVALID ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 199/638 s390/pai: fix attr_event_free upper limit for pai device drivers
In reply to Sasha LevinFrom: Thomas Richter <[email protected]>
[ Upstream commit 225d09d6e5f3870560665a1829d2db79330b4c58 ]
When the device drivers are initialized, a sysfs directory is created. This contains many attributes which are allocated with kzalloc(). Should it fail, the memory for the attributes already created is freed in attr_event_free(). Its second parameter is number of attribute elements to delete. This parameter is off by one. When i. e. the 10th attribute fails to get created, attributes numbered 0 to 9 should be deleted. Currently only attributes numbered 0 to 8 are deleted.
--- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/perf_pai_crypto.c +1 -1
@@ -646,7 +646,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paicrypt_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
arch/s390/kernel/perf_pai_ext.c +1 -1
@@ -607,7 +607,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paiext_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 200/638 s390/vdso: drop '-fPIC' from LDFLAGS
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 0628c03934187be33942580e10bb9afcc61adeed ]
'-fPIC' as an option to the linker does not do what it seems like it should. With ld.bfd, it is treated as '-f PIC', which does not make sense based on the meaning of '-f':
-f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table
When building with ld.lld (currently under review in a GitHub pull request), it just errors out because '-f' means nothing and neither does '-fPIC':
ld.lld: error: unknown argument '-fPIC'
'-fPIC' was blindly copied from CFLAGS when the vDSO stopped being linked with '$(CC)', it should not be needed. Remove it to clear up the build failure with ld.lld.
--- arch/s390/kernel/vdso32/Makefile | 2 +- arch/s390/kernel/vdso64/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/vdso32/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_32 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \ +LDFLAGS_vdso32.so.dbg += -shared -soname=linux-vdso32.so.1 \ --hash-style=both --build-id=sha1 -melf_s390 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
arch/s390/kernel/vdso64/Makefile +1 -1
@@ -26,7 +26,7 @@ KBUILD_AFLAGS_64 += -m64 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_64)) KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin -ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \ +ldflags-y := -shared -soname=linux-vdso64.so.1 \ --hash-style=both --build-id=sha1 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 201/638 selftests: forwarding: Add missing config entries
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit 4acf4e62cd572b0c806035046b3698f5585ab821 ]
The config file contains a partial kernel configuration to be used by `virtme-configkernel --custom'. The presumption is that the config file contains all Kconfig options needed by the selftests from the directory.
In net/forwarding/config, many are missing, which manifests as spurious failures when running the selftests, with messages about unknown device types, qdisc kinds or classifier actions. Add the missing configurations.
Tested the resulting configuration using virtme-ng as follows:
# vng -b -f tools/testing/selftests/net/forwarding/config # vng --user root (within the VM:) # make -C tools/testing/selftests TARGETS=net/forwarding run_tests
Stable-dep-of: f0ddf15f0a74 ("selftests: forwarding: Add missing multicast routing config entries")
--- tools/testing/selftests/net/forwarding/config | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
tools/testing/selftests/net/forwarding/config +28 -0
@@ -6,14 +6,42 @@ CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_NET_VRF=m CONFIG_BPF_SYSCALL=y CONFIG_CGROUP_BPF=y +CONFIG_DUMMY=m +CONFIG_IPV6=y +CONFIG_IPV6_GRE=m +CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m CONFIG_NET_ACT_MPLS=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SAMPLE=m +CONFIG_NET_ACT_SKBEDIT=m +CONFIG_NET_ACT_TUNNEL_KEY=m CONFIG_NET_ACT_VLAN=m CONFIG_NET_CLS_FLOWER=m CONFIG_NET_CLS_MATCHALL=m +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_META=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_DEMUX=m +CONFIG_NET_IPIP=m +CONFIG_NET_SCH_ETS=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_ACT_GACT=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_TC_SKB_EXT=y +CONFIG_NET_TEAM=y +CONFIG_NET_TEAM_MODE_LOADBALANCE=y +CONFIG_NETFILTER=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_FLOW_TABLE=m +CONFIG_NF_TABLES=m CONFIG_VETH=m CONFIG_NAMESPACES=y CONFIG_NET_NS=y +CONFIG_VXLAN=m +CONFIG_XFRM_USER=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 202/638 selftests: forwarding: Add missing multicast routing config entries
In reply to Sasha LevinFrom: Ido Schimmel <[email protected]>
[ Upstream commit f0ddf15f0a74c27eb4b2271a90e69948acc3fa2c ]
The two tests that make use of multicast routig (router.sh and router_multicast.sh) are currently failing in the netdev CI because the kernel is missing multicast routing support.
Fix by adding the required config entries.
--- tools/testing/selftests/net/forwarding/config | 7 +++++++ 1 file changed, 7 insertions(+)
tools/testing/selftests/net/forwarding/config +7 -0
@@ -9,6 +9,13 @@ CONFIG_CGROUP_BPF=y CONFIG_DUMMY=m CONFIG_IPV6=y CONFIG_IPV6_GRE=m +CONFIG_IPV6_MROUTE=y +CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y +CONFIG_IPV6_PIMSM_V2=y +CONFIG_IP_MROUTE=y +CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 203/638 ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down()
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit 17ef8efc00b34918b966388b2af0993811895a8c ]
As discussed in the past (commit 2d3916f31891 ("ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()")) I think the synchronize_net() call in ipv6_mc_down() is not needed.
Under load, synchronize_net() can last between 200 usec and 5 ms.
KASAN seems to agree as well.
--- net/ipv6/mcast.c | 1 - 1 file changed, 1 deletion(-)
net/ipv6/mcast.c +0 -1
@@ -2720,7 +2720,6 @@ void ipv6_mc_down(struct inet6_dev *idev)/* Should stop work after group drop. or we will * start work again in mld_ifc_event() */ -synchronize_net ();mld_query_stop_work (idev);mld_report_stop_work (idev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 204/638 arm64: dts: mt8183: Move CrosEC base detection node to kukui-based DTs
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 04bd6411f506357fd1faedc2b2156e7ef206aa9a ]
The cbas node is used to describe base detection functionality in the ChromeOS EC, which is used for units that have a detachable keyboard and thus rely on this functionality to switch between tablet and laptop mode.
Despite the original commit having added the cbas node to the mt8183-kukui.dtsi, not all machines that include it are detachables. In fact all machines that include from mt8183-kukui-jacuzzi.dtsi are either clamshells (ie normal laptops) or convertibles, meaning the keyboard can be flipped but not detached. The detection for the keyboard getting flipped is handled by the driver bound to the keyboard-controller node in the EC.
Move the base detection node from the base kukui dtsi to the dtsis where all machines are detachables, and thus actually make use of the node.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ---- 4 files changed, 12 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi +4 -0
@@ -373,6 +373,10 @@ pen_eject { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi +4 -0
@@ -340,6 +340,10 @@ touch_pin_reset: pin_reset { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi +4 -0
@@ -344,6 +344,10 @@ rst_pin { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +0 -4
@@ -907,10 +907,6 @@ usbc_extcon: extcon0 { google,usb-port-id = <0>; }; - cbas { - compatible = "google,cros-cbas"; - }; - typec { compatible = "google,cros-ec-typec"; #address-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 205/638 arm64: dts: mediatek: mt7986: fix reference to PWM in fan node
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 7865abbbdf1e1ee57a0bb8ec83079f8840c16854 ]
This fixes typo and resolves following validation error:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm-fan: pwms: [[54, 0, 10000], [0]] is too long
from schema $id: http://devicetree.org/schemas/hwmon/pwm-fan.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +1 -1
@@ -43,7 +43,7 @@ fan: pwm-fan { #cooling-cells = <2>; /* cooling level (0, 1, 2) - pwm inverted */ cooling-levels = <255 96 0>; - pwms = <&pwm 0 10000 0>; + pwms = <&pwm 0 10000>; status = "okay"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 206/638 arm64: dts: mediatek: mt7986: drop crypto's unneeded/invalid clock name
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit bb69d19c649669f700149df309245cd925612f7c ]
According to the "inside-secure,safexcel-eip97" binding "clock-names" is required only if there are two clocks specified. If present the first name must by "core".
Name "infra_eip97_ck" is invalid and was probably just a typo. Drop it.
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +0 -1
@@ -234,7 +234,6 @@ crypto: crypto@10320000 { <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "ring0", "ring1", "ring2", "ring3"; clocks = <&infracfg CLK_INFRA_EIP97_CK>; - clock-names = "infra_eip97_ck"; assigned-clocks = <&topckgen CLK_TOP_EIP_B_SEL>; assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>; status = "disabled";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 207/638 arm64: dts: mediatek: mt7986: fix SPI bus width properties
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 4e7dc18a753cec130b06f1ddbae10ea9dcfb1723 ]
This fixes SPI setup and resolves following validation errors:arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected)
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected)
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 4 ++-- arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +2 -2
@@ -241,8 +241,8 @@ spi_nand: spi_nand@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>; - spi-tx-buswidth = <4>; - spi-rx-buswidth = <4>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; }; };
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +2 -2
@@ -156,8 +156,8 @@ spi_nand: spi_nand@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>; - spi-tx-buswidth = <4>; - spi-rx-buswidth = <4>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 208/638 arm64: dts: mediatek: mt7986: fix SPI nodename
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit bbe266c70e1343ee3e71ca31138141b3da265085 ]
This fixes following validation errors:arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 3 ++- arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +2 -1
@@ -237,7 +237,8 @@ &spi0 { pinctrl-0 = <&spi_flash_pins>; cs-gpios = <0>, <0>; status = "okay"; - spi_nand: spi_nand@0 { + + spi_nand: flash@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>;
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +2 -1
@@ -152,7 +152,8 @@ &spi0 { pinctrl-0 = <&spi_flash_pins>; cs-gpios = <0>, <0>; status = "okay"; - spi_nand: spi_nand@0 { + + spi_nand: flash@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 209/638 arm64: dts: mediatek: mt7986: drop "#clock-cells" from PWM
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 0b721691f0c80af682d0ef3aa4a177c23d41b072 ]
PWM is not a clock provider and its binding doesn't specify "#clock-cells" property.
This fixes:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm@10048000: '#clock-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/pwm/mediatek,mt2712-pwm.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +0 -1
@@ -242,7 +242,6 @@ crypto: crypto@10320000 { pwm: pwm@10048000 { compatible = "mediatek,mt7986-pwm"; reg = <0 0x10048000 0 0x1000>; - #clock-cells = <1>; #pwm-cells = <2>; interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; clocks = <&topckgen CLK_TOP_PWM_SEL>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 210/638 arm64: dts: mediatek: mt7986: add "#reset-cells" to infracfg
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit d993daff5962b2dd08f32a83bb1c0e5fa75732ea ]
MT7986's Infrastructure System Configuration Controller includes reset controller. It can reset blocks as specified in the include/dt-bindings/reset/mt7986-resets.h . Add #reset-cells so it can be referenced properly.
This fixes:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: infracfg@10001000: '#reset-cells' is a required property
from schema $id: http://devicetree.org/schemas/arm/mediatek/mediatek,infracfg.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +1 -0
@@ -153,6 +153,7 @@ infracfg: infracfg@10001000 { compatible = "mediatek,mt7986-infracfg", "syscon"; reg = <0 0x10001000 0 0x1000>; #clock-cells = <1>; + #reset-cells = <1>; }; wed_pcie: wed-pcie@10003000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 211/638 arm64: dts: mediatek: mt8192-asurada: Remove CrosEC base detection node
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 9b49cabe631b0a25aaf8fc2ba81b5b9ea6ff01b7 ]
The commit adding the ChromeOS EC to the Asurada Devicetree mistakenly added a base detection node. While tablet mode detection is supported by CrosEC and used by Hayato, it is done through the cros-ec-keyb driver. The base detection node, which is handled by the hid-google-hammer driver, also provides tablet mode detection but by checking base attachment status on the CrosEC, which is not supported for Asurada.
Hence, remove the unused CrosEC base detection node for Asurada.
--- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +0 -4
@@ -1308,10 +1308,6 @@ cros_ec: ec@0 { #address-cells = <1>; #size-cells = <0>; - base_detection: cbas { - compatible = "google,cros-cbas"; - }; - cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; #pwm-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 212/638 arm64: dts: mediatek: mt8192: fix vencoder clock name
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 76aac0f2a46847ed4a7a4fdd848dd66023c19ad1 ]
Clock name should be venc_sel as per binding.
Fix the warning message :arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb: vcodec@17020000: clock-names:0: 'venc_sel' was expected
from schema $id: http://devicetree.org/schemas/media/mediatek,vcodec-encoder.yaml#
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +1 -1
@@ -1770,7 +1770,7 @@ vcodec_enc: vcodec@17020000 { mediatek,scp = <&scp>; power-domains = <&spm MT8192_POWER_DOMAIN_VENC>; clocks = <&vencsys CLK_VENC_SET1_VENC>; - clock-names = "venc-set1"; + clock-names = "venc_sel"; assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>; assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 213/638 arm64: dts: mediatek: mt8186: fix VENC power domain clocks
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 09860910c589a3bb3b5268ff6f704cf6b18ada73 ]
The larb clock is in fact a subsys clock, so it must be prefixed by 'subsys-' to be correctly identified in the driver.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +1 -1
@@ -1061,7 +1061,7 @@ power-domain@MT8186_POWER_DOMAIN_VENC { reg = <MT8186_POWER_DOMAIN_VENC>; clocks = <&topckgen CLK_TOP_VENC>, <&vencsys CLK_VENC_CKE1_VENC>; - clock-names = "venc0", "larb"; + clock-names = "venc0", "subsys-larb"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 214/638 arm64: dts: mediatek: mt7622: add missing "device_type" to memory nodes
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 99d100e00144bc01b49a697f4bc4398f2f7e7ce4 ]
This fixes:arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb: /: memory@40000000: 'device_type' is a required property
from schema $id: http://devicetree.org/schemas/memory.yaml#arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dtb: /: memory@40000000: 'device_type' is a required property
from schema $id: http://devicetree.org/schemas/memory.yaml#
--- arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 + 2 files changed, 2 insertions(+)
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +1 -0
@@ -75,6 +75,7 @@ led-1 { memory@40000000 { reg = <0 0x40000000 0 0x40000000>; + device_type = "memory"; }; reg_1p8v: regulator-1p8v {
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +1 -0
@@ -57,6 +57,7 @@ key-wps { memory@40000000 { reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; }; reg_1p8v: regulator-1p8v {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 215/638 can: m_can: Start/Cancel polling timer together with interrupts
In reply to Sasha LevinFrom: Markus Schneider-Pargmann <[email protected]>
[ Upstream commit a163c5761019b94258ca655b27b46e82657fd6f5 ]
Interrupts are enabled/disabled in more places than just m_can_start() and m_can_stop(). Couple the polling timer with enabling/disabling of all interrupts to achieve equivalent behavior.
--- drivers/net/can/m_can/m_can.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/net/can/m_can/m_can.c +12 -11
@@ -418,6 +418,13 @@ static void m_can_config_endisable(struct m_can_classdev *cdev, bool enable)static inline void m_can_enable_all_interrupts (struct m_can_classdev *cdev) { +if (!cdev->net->irq) { +dev_dbg (cdev->dev,"Start hrtimer\n" ); +hrtimer_start (&cdev->hrtimer, +ms_to_ktime (HRTIMER_POLL_INTERVAL_MS ), +HRTIMER_MODE_REL_PINNED ); + } +/* Only interrupt line 0 is used in this driver */ m_can_write (cdev,M_CAN_ILE ,ILE_EINT0 ); }
@@ -425,6 +432,11 @@ static inline void m_can_enable_all_interrupts(struct m_can_classdev *cdev)static inline void m_can_disable_all_interrupts (struct m_can_classdev *cdev) {m_can_write (cdev,M_CAN_ILE ,0x0 ); + +if (!cdev->net->irq) { +dev_dbg (cdev->dev,"Stop hrtimer\n" ); +hrtimer_cancel (&cdev->hrtimer); + } }/* Retrieve internal timestamp counter from TSCV.TSC, and shift it to 32-bit
@@ -1417,12 +1429,6 @@ static int m_can_start(struct net_device *dev)m_can_enable_all_interrupts (cdev); -if (!dev->irq) { -dev_dbg (cdev->dev,"Start hrtimer\n" ); -hrtimer_start (&cdev->hrtimer,ms_to_ktime (HRTIMER_POLL_INTERVAL_MS ), -HRTIMER_MODE_REL_PINNED ); - } -return 0 ; }
@@ -1577,11 +1583,6 @@ static void m_can_stop(struct net_device *dev) {struct m_can_classdev *cdev =netdev_priv (dev); -if (!dev->irq) { -dev_dbg (cdev->dev,"Stop hrtimer\n" ); -hrtimer_cancel (&cdev->hrtimer); - } -/* disable all interrupts */ m_can_disable_all_interrupts (cdev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 216/638 wifi: iwlwifi: mvm: Fix the listener MAC filter flags
In reply to Sasha LevinFrom: Ilan Peer <[email protected]>
[ Upstream commit 4cdb86487e3eaddb4b3a7df30ae709e810aac84b ]
One of the flags was from the wrong API.
--- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c +1 -1
@@ -167,7 +167,7 @@ static int iwl_mvm_mld_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,iwl_mvm_mld_mac_ctxt_cmd_common (mvm, vif, &cmd, action); cmd.filter_flags =cpu_to_le32 (MAC_CFG_FILTER_PROMISC | -MAC_FILTER_IN_CONTROL_AND_MGMT | +MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT |MAC_CFG_FILTER_ACCEPT_BEACON |MAC_CFG_FILTER_ACCEPT_PROBE_REQ |MAC_CFG_FILTER_ACCEPT_GRP );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 217/638 bpf: Mark bpf_spin_{lock,unlock}() helpers with notrace correctly
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 178c54666f9c4d2f49f2ea661d0c11b52f0ed190 ]
Currently tracing is supposed not to allow for bpf_spin_{lock,unlock}() helper calls. This is to prevent deadlock for the following cases:
- there is a prog (prog-A) calling bpf_spin_{lock,unlock}().
- there is a tracing program (prog-B), e.g., fentry, attached to bpf_spin_lock() and/or bpf_spin_unlock().
- prog-B calls bpf_spin_{lock,unlock}().
For such a case, when prog-A calls bpf_spin_{lock,unlock}(), a deadlock will happen.
The related source codes are below in kernel/bpf/helpers.c:
notrace BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) notrace BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock)
notrace is supposed to prevent fentry prog from attaching to bpf_spin_{lock,unlock}().
But actually this is not the case and fentry prog can successfully attached to bpf_spin_lock(). Siddharth Chintamaneni reported the issue in [1]. The following is the macro definition for above BPF_CALL_1:
#define BPF_CALL_x(x, name, ...) \
static __always_inline \
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \
{ \
return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\
} \
static __always_inline \
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__))#define BPF_CALL_1(name, ...) BPF_CALL_x(1, name, __VA_ARGS__)
The notrace attribute is actually applied to the static always_inline function ____bpf_spin_{lock,unlock}(). The actual callback function bpf_spin_{lock,unlock}() is not marked with notrace, hence allowing fentry prog to attach to two helpers, and this
may cause the above mentioned deadlock. Siddharth Chintamaneni actually has a reproducer in [2].
To fix the issue, a new macro NOTRACE_BPF_CALL_1 is introduced which will add notrace attribute to the original function instead of the hidden always_inline function and this fixed the problem.
[1] https://lore.kernel.org/bpf/CAE5sdEigPnoGrzN8WU7Tx-h-iFuMZgW06qp0KHWtpvoXxf1OAQ@mail.gmail.com/
[2] https://lore.kernel.org/bpf/CAE5sdEg6yUc_Jz50AnUXEEUh6O73yQ1Z6NV2srJnef0ZrQkZew@mail.gmail.com/
--- include/linux/filter.h | 21 ++++++++++++--------- kernel/bpf/helpers.c | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-)
include/linux/filter.h +12 -9
@@ -505,24 +505,27 @@ static inline bool insn_is_zext(const struct bpf_insn *insn)__BPF_MAP (n, __BPF_DECL_ARGS, __BPF_N, u64, __ur_1, u64, __ur_2, \ u64, __ur_3, u64, __ur_4, u64, __ur_5) -#define BPF_CALL_x (x, name, ...) \ +#define BPF_CALL_x (x, attr, name, ...) \ static __always_inline \ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ - u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ - u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ + attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ + attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ { \ return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\ } \ static __always_inline \ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)) -#define BPF_CALL_0 (name, ...) BPF_CALL_x(0, name, __VA_ARGS__) -#define BPF_CALL_1 (name, ...) BPF_CALL_x(1, name, __VA_ARGS__) -#define BPF_CALL_2 (name, ...) BPF_CALL_x(2, name, __VA_ARGS__) -#define BPF_CALL_3 (name, ...) BPF_CALL_x(3, name, __VA_ARGS__) -#define BPF_CALL_4 (name, ...) BPF_CALL_x(4, name, __VA_ARGS__) -#define BPF_CALL_5 (name, ...) BPF_CALL_x(5, name, __VA_ARGS__) +#define __NOATTR +#define BPF_CALL_0 (name, ...) BPF_CALL_x(0, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_1 (name, ...) BPF_CALL_x(1, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_2 (name, ...) BPF_CALL_x(2, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_3 (name, ...) BPF_CALL_x(3, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_4 (name, ...) BPF_CALL_x(4, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_5 (name, ...) BPF_CALL_x(5, __NOATTR, name, __VA_ARGS__) + +#define NOTRACE_BPF_CALL_1 (name, ...) BPF_CALL_x(1, notrace, name, __VA_ARGS__)#define bpf_ctx_range (TYPE ,MEMBER ) \ offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1
kernel/bpf/helpers.c +2 -2
@@ -333,7 +333,7 @@ static inline void __bpf_spin_lock_irqsave(struct bpf_spin_lock *lock)__this_cpu_write (irqsave_flags, flags); } -notrace BPF_CALL_1 (bpf_spin_lock ,struct bpf_spin_lock *,lock ) +NOTRACE_BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) {__bpf_spin_lock_irqsave (lock);return 0 ;
@@ -356,7 +356,7 @@ static inline void __bpf_spin_unlock_irqrestore(struct bpf_spin_lock *lock)local_irq_restore (flags); } -notrace BPF_CALL_1 (bpf_spin_unlock ,struct bpf_spin_lock *,lock ) +NOTRACE_BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) {__bpf_spin_unlock_irqrestore (lock);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 218/638 bpf: don't infer PTR_TO_CTX for programs with unnamed context type
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 879bbe7aa4afa80acf72a1cad7f52416ea78c52d ]
For program types that don't have named context type name (e.g., BPF iterator programs or tracepoint programs), ctx_tname will be a non-NULL empty string. For such programs it shouldn't be possible to have PTR_TO_CTX argument for global subprogs based on type name alone. arg:ctx tag is the only way to have PTR_TO_CTX passed into global subprog for such program types.
Fix this loophole, which currently would assume PTR_TO_CTX whenever user uses a pointer to anonymous struct as an argument to their global subprogs. This happens in practice with the following (quite common, in practice) approach:
typedef struct { /* anonymous */
int x; } my_type_t;
int my_subprog(my_type_t *arg) { ... }
User's intent is to have PTR_TO_MEM argument for arg, but verifier will complain about expecting PTR_TO_CTX.
This fix also closes unintended s390x-specific KPROBE handling of PTR_TO_CTX case. Selftest change is necessary to accommodate this.
--- kernel/bpf/btf.c | 3 +++ .../bpf/progs/test_global_func_ctx_args.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+)
kernel/bpf/btf.c +3 -0
@@ -5655,6 +5655,9 @@ btf_get_prog_ctx_type(struct bpf_verifier_log *log, const struct btf *btf,bpf_log (log,"Please fix kernel include/linux/bpf_types.h\n" );return NULL ; } +/* program types without named context types work only with arg:ctx tag */ +if (ctx_tname[0 ] =='\0' ) +return false;/* only compare that prog's ctx type name is the same as * kernel expects. No need to compare field by field. * It's ok for bpf prog to do:
tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c +19 -0
@@ -26,6 +26,23 @@ int kprobe_typedef_ctx(void *ctx)return kprobe_typedef_ctx_subprog (ctx); } +/* s390x defines: +* +* typedef user_pt_regs bpf_user_pt_regs_t; +* typedef struct { ... } user_pt_regs; +* +* And so "canonical" underlying struct type is anonymous. +* So on s390x only valid ways to have PTR_TO_CTX argument in global subprogs +* are: +* - bpf_user_pt_regs_t *ctx (typedef); +* - struct bpf_user_pt_regs_t *ctx (backwards compatible struct hack); +* - void *ctx __arg_ctx (arg:ctx tag) +* +* Other architectures also allow using underlying struct types (e.g., +* `struct pt_regs *ctx` for x86-64) +*/ +#ifndef bpf_target_s390 +#define pt_regs_struct_t typeof(*(__PT_REGS_CAST((struct pt_regs *)NULL)))__weak int kprobe_struct_ctx_subprog (pt_regs_struct_t *ctx)
@@ -40,6 +57,8 @@ int kprobe_resolved_ctx(void *ctx) return kprobe_struct_ctx_subprog(ctx); } +#endif +/* this is current hack to make this work on old kernels */ struct bpf_user_pt_regs_t {};
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 219/638 arm64: dts: qcom: sdm845: Use the Low Power Island CX/MX for SLPI
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 5dd227ccfb9568935bdaf82bc1893b36457dd4d3 ]
The SLPI is powered by the Low Power Island power rails. Fix the incorrect assignment.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +2 -2
@@ -3363,8 +3363,8 @@ slpi_pas: remoteproc@5c00000 { qcom,qmp = <&aoss_qmp>; - power-domains = <&rpmhpd SDM845_CX>, - <&rpmhpd SDM845_MX>; + power-domains = <&rpmhpd SDM845_LCX>, + <&rpmhpd SDM845_LMX>; power-domain-names = "lcx", "lmx"; memory-region = <&slpi_mem>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 220/638 soc: qcom: llcc: Check return value on Broadcast_OR reg read
In reply to Sasha LevinFrom: Unnathi Chalicheemala <[email protected]>
[ Upstream commit ceeaddc19a90039861564d8e1078b778a8f95101 ]
Commit c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support") introduced a new 4.1 if statement in llcc_update_act_ctrl() without considering that ret might be overwritten. So, add return value check after Broadcast_OR register read in llcc_update_act_ctrl().
--- drivers/soc/qcom/llcc-qcom.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/qcom/llcc-qcom.c +2 -0
@@ -610,6 +610,8 @@ static int llcc_update_act_ctrl(u32 sid, ret =regmap_read_poll_timeout (drv_data->bcast_regmap, status_reg, slice_status, !(slice_status & status),0 ,LLCC_STATUS_READ_DELAY ); +if (ret) +return ret;if (drv_data->version >=LLCC_VERSION_4_1_0_0 ) ret = regmap_write(drv_data->bcast_regmap, act_clear_reg,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 221/638 ARM: dts: qcom: msm8974: correct qfprom node size
In reply to Sasha LevinFrom: Craig Tatlor <[email protected]>
[ Upstream commit 724c4bf0e4bf81dba77736afb93964c986c3c123 ]
The qfprom actually is bigger than 0x1000, so adjust the reg.
Note that the non-ECC-corrected qfprom can be found at 0xfc4b8000 (-0x4000). The current reg points to the ECC-corrected qfprom block which should have equivalent values at all offsets compared to the non-corrected version.
[[email protected]: extract to standalone patch and adjust for review comments]
--- arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi +1 -1
@@ -1194,7 +1194,7 @@ restart@fc4ab000 { qfprom: qfprom@fc4bc000 { compatible = "qcom,msm8974-qfprom", "qcom,qfprom"; - reg = <0xfc4bc000 0x1000>; + reg = <0xfc4bc000 0x2100>; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 222/638 arm64: dts: mediatek: mt8186: Add missing clocks to ssusb power domains
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit a00d4a98af44e025891e97c490b2545368a25e08 ]
The ssusb power domains currently don't list any clocks, despite depending on some, and thus rely on the bootloader leaving the required clocks on in order to work.
When booting with the upstream arm64 defconfig, the power domain controller will defer probe until modules have loaded since it has an indirect dependency on CONFIG_MTK_CMDQ, which is configured as a module. However at the point where modules are loaded, unused clocks are also disabled, causing the ssusb domains to fail to be enabled and consequently the controller to fail probe:
mtk-power-controller 10006000.syscon:power-controller: /soc/syscon@10006000/power-controller/power-domain@4: failed to power on domain: -110
mtk-power-controller: probe of 10006000.syscon:power-controller failed with error -110
Add the missing clocks for the ssusb power domains so that they can successfully probe without relying on the bootloader state.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +6 -0
@@ -931,11 +931,17 @@ power-domain@MT8186_POWER_DOMAIN_CSIRX_TOP { power-domain@MT8186_POWER_DOMAIN_SSUSB { reg = <MT8186_POWER_DOMAIN_SSUSB>; + clocks = <&topckgen CLK_TOP_USB_TOP>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>; + clock-names = "sys_ck", "ref_ck"; #power-domain-cells = <0>; }; power-domain@MT8186_POWER_DOMAIN_SSUSB_P1 { reg = <MT8186_POWER_DOMAIN_SSUSB_P1>; + clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>; + clock-names = "sys_ck", "ref_ck"; #power-domain-cells = <0>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 223/638 arm64: dts: mediatek: mt8186: Add missing xhci clock to usb controllers
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 1af98c3e53da5a8f627855cecd68b017e753ffd3 ]
The mtu3 usb controllers don't list the xhci clock, though they require it, and thus rely on the bootloader leaving it on in order to work.
When booting with the upstream arm64 defconfig, the usb controllers will defer probe until modules have loaded since they have an indirect dependency on CONFIG_MTK_CMDQ, which is configured as a module. However at the point where modules are loaded, unused clocks are also disabled, causing the usb controllers to probe without the xhci clock enabled and fail to probe:
mtu3 11201000.usb: clks of sts1 are not stable! mtu3 11201000.usb: device enable failed -110 mtu3 11201000.usb: mtu3 hw init failed:-110 mtu3 11201000.usb: failed to initialize gadget
mtu3: probe of 11201000.usb failed with error -110
(and same for the one at 11281000)
Add the missing clock for the usb controllers so that they can successfully probe without relying on the bootloader state.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +6 -4
@@ -1536,8 +1536,9 @@ ssusb0: usb@11201000 { clocks = <&topckgen CLK_TOP_USB_TOP>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_HCLK>, - <&infracfg_ao CLK_INFRA_AO_ICUSB>; - clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; + <&infracfg_ao CLK_INFRA_AO_ICUSB>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_XHCI>; + clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; interrupts = <GIC_SPI 303 IRQ_TYPE_LEVEL_HIGH 0>; phys = <&u2port0 PHY_TYPE_USB2>; power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB>;
@@ -1601,8 +1602,9 @@ ssusb1: usb@11281000 { clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_HCLK>, - <&clk26m>; - clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; + <&clk26m>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_XHCI>; + clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; interrupts = <GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH 0>; phys = <&u2port1 PHY_TYPE_USB2>, <&u3port1 PHY_TYPE_USB3>; power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB_P1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 224/638 cpufreq: qcom-hw: add CONFIG_COMMON_CLK dependency
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 3093fa33539b54db77171d2919352ad4f044a1c5 ]
It is still possible to compile-test a kernel without CONFIG_COMMON_CLK for some ancient ARM boards or other architectures, but this causes a link failure in the qcom-cpufreq-hw driver:
ERROR: modpost: "devm_clk_hw_register" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
ERROR: modpost: "devm_of_clk_add_hw_provider" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
ERROR: modpost: "of_clk_hw_onecell_get" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
Add a Kconfig dependency here to make sure this always work. Apparently this bug has been in the kernel for a while without me running into it on randconfig builds as COMMON_CLK is almost always enabled.
I have cross-checked by building an allmodconfig kernel with COMMON_CLK disabled, which showed no other driver having this problem.
--- drivers/cpufreq/Kconfig.arm | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
@@ -173,6 +173,7 @@ config ARM_QCOM_CPUFREQ_NVMEM config ARM_QCOM_CPUFREQ_HW tristate "QCOM CPUFreq HW driver" depends on ARCH_QCOM || COMPILE_TEST + depends on COMMON_CLK help Support for the CPUFreq HW driver. Some QCOM chipsets have a HW engine to offload the steps
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 225/638 wifi: wilc1000: prevent use-after-free on vif when cleaning up all interfaces
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit cb5942b77c05d54310a0420cac12935e9b6aa21c ]
wilc_netdev_cleanup currently triggers a KASAN warning, which can be observed on interface registration error path, or simply by removing the module/unbinding device from driver:
echo spi0.1 > /sys/bus/spi/drivers/wilc1000_spi/unbind
==================================================================
BUG: KASAN: slab-use-after-free in wilc_netdev_cleanup+0x508/0x5cc Read of size 4 at addr c54d1ce8 by task sh/86 CPU: 0 PID: 86 Comm: sh Not tainted 6.8.0-rc1+ #117 Hardware name: Atmel SAMA5 unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x58 dump_stack_lvl from print_report+0x154/0x500 print_report from kasan_report+0xac/0xd8 kasan_report from wilc_netdev_cleanup+0x508/0x5cc wilc_netdev_cleanup from wilc_bus_remove+0xc8/0xec wilc_bus_remove from spi_remove+0x8c/0xac spi_remove from device_release_driver_internal+0x434/0x5f8 device_release_driver_internal from unbind_store+0xbc/0x108 unbind_store from kernfs_fop_write_iter+0x398/0x584 kernfs_fop_write_iter from vfs_write+0x728/0xf88 vfs_write from ksys_write+0x110/0x1e4 ksys_write from ret_fast_syscall+0x0/0x1c
[...]
Allocated by task 1: kasan_save_track+0x30/0x5c __kasan_kmalloc+0x8c/0x94 __kmalloc_node+0x1cc/0x3e4 kvmalloc_node+0x48/0x180 alloc_netdev_mqs+0x68/0x11dc alloc_etherdev_mqs+0x28/0x34 wilc_netdev_ifc_init+0x34/0x8ec wilc_cfg80211_init+0x690/0x910 wilc_bus_probe+0xe0/0x4a0 spi_probe+0x158/0x1b0 really_probe+0x270/0xdf4 __driver_probe_device+0x1dc/0x580 driver_probe_device+0x60/0x140 __driver_attach+0x228/0x5d4 bus_for_each_dev+0x13c/0x1a8 bus_add_driver+0x2a0/0x608 driver_register+0x24c/0x578 do_one_initcall+0x180/0x310 kernel_init_freeable+0x424/0x484 kernel_init+0x20/0x148 ret_from_fork+0x14/0x28 Freed by task 86: kasan_save_track+0x30/0x5c kasan_save_free_info+0x38/0x58 __kasan_slab_free+0xe4/0x140 kfree+0xb0/0x238 device_release+0xc0/0x2a8 kobject_put+0x1d4/0x46c netdev_run_todo+0x8fc/0x11d0 wilc_netdev_cleanup+0x1e4/0x5cc wilc_bus_remove+0xc8/0xec spi_remove+0x8c/0xac device_release_driver_internal+0x434/0x5f8 unbind_store+0xbc/0x108 kernfs_fop_write_iter+0x398/0x584 vfs_write+0x728/0xf88 ksys_write+0x110/0x1e4 ret_fast_syscall+0x0/0x1c [...]
David Mosberger-Tan initial investigation [1] showed that this use-after-free is due to netdevice unregistration during vif list traversal. When unregistering a net device, since the needs_free_netdev has been set to true during registration, the netdevice object is also freed, and as a consequence, the corresponding vif object too, since it is attached to it as private netdevice data. The next occurrence of the loop then tries to access freed vif pointer to the list to move forward in the list.
Fix this use-after-free thanks to two mechanisms:
- navigate in the list with list_for_each_entry_safe, which allows to safely modify the list as we go through each element. For each element, remove it from the list with list_del_rcu
- make sure to wait for RCU grace period end after each vif removal to make sure it is safe to free the corresponding vif too (through unregister_netdev)
Since we are in a RCU "modifier" path (not a "reader" path), and because such path is expected not to be concurrent to any other modifier (we are using the vif_mutex lock), we do not need to use RCU list API, that's why we can benefit from list_for_each_entry_safe.
[1] https://lore.kernel.org/linux-wireless/[email protected]/
--- .../net/wireless/microchip/wilc1000/netdev.c | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-)
drivers/net/wireless/microchip/wilc1000/netdev.c +7 -21
@@ -878,8 +878,7 @@ static const struct net_device_ops wilc_netdev_ops = {void wilc_netdev_cleanup (struct wilc *wilc) { -struct wilc_vif *vif; -int srcu_idx, ifc_cnt =0 ; +struct wilc_vif *vif, *vif_tmp;if (!wilc)return ;
@@ -889,32 +888,19 @@ void wilc_netdev_cleanup(struct wilc *wilc) wilc->firmware =NULL ; } - srcu_idx =srcu_read_lock (&wilc->srcu); -list_for_each_entry_rcu (vif, &wilc->vif_list, list) { +list_for_each_entry_safe (vif, vif_tmp, &wilc->vif_list, list) { +mutex_lock (&wilc->vif_mutex); +list_del_rcu (&vif->list); + wilc->vif_num--; +mutex_unlock (&wilc->vif_mutex); +synchronize_srcu (&wilc->srcu);if (vif->ndev)unregister_netdev (vif->ndev); } -srcu_read_unlock (&wilc->srcu, srcu_idx);wilc_wfi_deinit_mon_interface (wilc, false);destroy_workqueue (wilc->hif_workqueue); -while (ifc_cnt <WILC_NUM_CONCURRENT_IFC ) { -mutex_lock (&wilc->vif_mutex); -if (wilc->vif_num <=0 ) { -mutex_unlock (&wilc->vif_mutex); -break ; - } - vif =wilc_get_wl_to_vif (wilc); -if (!IS_ERR (vif)) -list_del_rcu (&vif->list); - - wilc->vif_num--; -mutex_unlock (&wilc->vif_mutex); -synchronize_srcu (&wilc->srcu); - ifc_cnt++; - } -wilc_wlan_cfg_deinit (wilc);wlan_deinit_locks (wilc);wiphy_unregister (wilc->wiphy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 226/638 arm64: dts: ti: k3-am62-main: disable usb lpm
In reply to Sasha LevinFrom: Andrejs Cainikovs <[email protected]>
[ Upstream commit 9c99b337a8755a09df7735d4324ae26a6eca6261 ]
AM62 USB works with some devices, while failing to operate with others.
[ 560.189822] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller [ 560.195631] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 2 [ 574.388509] xhci-hcd xhci-hcd.4.auto: can't setup: -110 [ 574.393814] xhci-hcd xhci-hcd.4.auto: USB bus 2 deregistered [ 574.399544] xhci-hcd: probe of xhci-hcd.4.auto failed with error -110
This seems to be related to LPM (Link Power Management), and disabling it turns USB into reliable working state.
As per AM62 reference manual:
Quoted 6 lines
4.8.2.1 USB2SS Unsupported Features
The following features are not supported on this family of devices:
...
- USB 2.0 ECN: Link Power Management (LPM)
...
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +4 -0
@@ -613,6 +613,8 @@ usb0: usb@31000000 { interrupt-names = "host", "peripheral"; maximum-speed = "high-speed"; dr_mode = "otg"; + snps,usb2-gadget-lpm-disable; + snps,usb2-lpm-disable; }; };
@@ -636,6 +638,8 @@ usb1: usb@31100000 { interrupt-names = "host", "peripheral"; maximum-speed = "high-speed"; dr_mode = "otg"; + snps,usb2-gadget-lpm-disable; + snps,usb2-lpm-disable; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 227/638 ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()
In reply to Sasha LevinFrom: Armin Wolf <[email protected]>
[ Upstream commit e18afcb7b2a12b635ac10081f943fcf84ddacc51 ]
After unregistering the CPU idle device, the memory associated with it is not freed, leading to a memory leak:
unreferenced object 0xffff896282f6c000 (size 1024):
comm "swapper/0", pid 1, jiffies 4294893170 hex dump (first 32 bytes):
00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 8836a742):
[<ffffffff993495ed>] kmalloc_trace+0x29d/0x340
[<ffffffff9972f3b3>] acpi_processor_power_init+0xf3/0x1c0
[<ffffffff9972d263>] __acpi_processor_start+0xd3/0xf0
[<ffffffff9972d2bc>] acpi_processor_start+0x2c/0x50
[<ffffffff99805872>] really_probe+0xe2/0x480
[<ffffffff99805c98>] __driver_probe_device+0x78/0x160
[<ffffffff99805daf>] driver_probe_device+0x1f/0x90
[<ffffffff9980601e>] __driver_attach+0xce/0x1c0
[<ffffffff99803170>] bus_for_each_dev+0x70/0xc0
[<ffffffff99804822>] bus_add_driver+0x112/0x210
[<ffffffff99807245>] driver_register+0x55/0x100
[<ffffffff9aee4acb>] acpi_processor_driver_init+0x3b/0xc0
[<ffffffff990012d1>] do_one_initcall+0x41/0x300
[<ffffffff9ae7c4b0>] kernel_init_freeable+0x320/0x470
[<ffffffff99b231f6>] kernel_init+0x16/0x1b0
[<ffffffff99042e6d>] ret_from_fork+0x2d/0x50Fix this by freeing the CPU idle device after unregistering it.
--- drivers/acpi/processor_idle.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/processor_idle.c +2 -0
@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr) acpi_processor_registered--;if (acpi_processor_registered ==0 )cpuidle_unregister_driver (&acpi_idle_driver); + +kfree (dev); } pr->flags.power_setup_done =0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 228/638 bus: tegra-aconnect: Update dependency to ARCH_TEGRA
In reply to Sasha LevinFrom: Peter Robinson <[email protected]>
[ Upstream commit 4acd21a45c1446277e2abaece97d7fa7c2e692a9 ]
Update the architecture dependency to be the generic Tegra because the driver works on the four latest Tegra generations not just Tegra210, if you build a kernel with a specific ARCH_TEGRA_xxx_SOC option that excludes Tegra210 you don't get this driver.
--- drivers/bus/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/bus/Kconfig +3 -2
@@ -186,11 +186,12 @@ config SUNXI_RSB config TEGRA_ACONNECT tristate "Tegra ACONNECT Bus Driver" - depends on ARCH_TEGRA_210_SOC + depends on ARCH_TEGRA depends on OF && PM help Driver for the Tegra ACONNECT bus which is used to interface with - the devices inside the Audio Processing Engine (APE) for Tegra210. + the devices inside the Audio Processing Engine (APE) for + Tegra210 and later. config TEGRA_GMI tristate "Tegra Generic Memory Interface bus driver"
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 229/638 iommu/amd: Mark interrupt as managed
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit 0feda94c868d396fac3b3cb14089d2d989a07c72 ]
On many systems that have an AMD IOMMU the following sequence of warnings is observed during bootup.
``` pci 0000:00:00.2 can't derive routing for PCI INT A pci 0000:00:00.2: PCI INT A: not connected ```
This series of events happens because of the IOMMU initialization sequence order and the lack of _PRT entries for the IOMMU.
During initialization the IOMMU driver first enables the PCI device using pci_enable_device(). This will call acpi_pci_irq_enable() which will check if the interrupt is declared in a PCI routing table (_PRT) entry. According to the PCI spec [1] these routing entries are only required under PCI root bridges:
The _PRT object is required under all PCI root bridges
The IOMMU is directly connected to the root complex, so there is no parent bridge to look for a _PRT entry. The first warning is emitted since no entry could be found in the hierarchy. The second warning is then emitted because the interrupt hasn't yet been configured to any value. The pin was configured in pci_read_irq() but the byte in PCI_INTERRUPT_LINE return 0xff which means "Unknown".
After that sequence of events pci_enable_msi() is called and this will allocate an interrupt.
That is both of these warnings are totally harmless because the IOMMU uses MSI for interrupts. To avoid even trying to probe for a _PRT entry mark the IOMMU as IRQ managed. This avoids both warnings.
--- drivers/iommu/amd/init.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/iommu/amd/init.c +3 -0
@@ -2084,6 +2084,9 @@ static int __init iommu_init_pci(struct amd_iommu *iommu)/* Prevent binding other PCI device drivers to IOMMU devices */ iommu->dev->match_driver = false; +/* ACPI _PRT won't have an IRQ for IOMMU */ + iommu->dev->irq_managed =1 ; +pci_read_config_dword (iommu->dev, cap_ptr +MMIO_CAP_HDR_OFFSET , &iommu->cap);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 230/638 wifi: brcmsmac: avoid function pointer casts
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit e1ea6db35fc3ba5ff063f097385e9f7a88c25356 ]
An old cleanup went a little too far and causes a warning with clang-16 and higher as it breaks control flow integrity (KCFI) rules:
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c:64:34: error: cast from 'void (*)(struct brcms_phy *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
64 | brcms_init_timer(physhim->wl, (void (*)(void *))fn,
| ^~~~~~~~~~~~~~~~~~~~
Change this one instance back to passing a void pointer so it can be used with the timer callback interface.
--- .../net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 3 ++- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c | 5 ++--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c +2 -1
@@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)return sh; } -static void wlc_phy_timercb_phycal (struct brcms_phy *pi) +static void wlc_phy_timercb_phycal (void *ptr) { +struct brcms_phy *pi = ptr;uint delay =5 ;if (PHY_PERICAL_MPHASE_PENDING (pi)) {
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c +2 -3
@@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim) }struct wlapi_timer *wlapi_init_timer (struct phy_shim_info *physhim, -void (*fn)(struct brcms_phy *pi), +void (*fn)(void *pi),void *arg,const char *name) {return (struct wlapi_timer *) -brcms_init_timer (physhim->wl, (void (*)(void *))fn, - arg, name); +brcms_init_timer (physhim->wl, fn, arg, name); }void wlapi_free_timer (struct wlapi_timer *t)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h +1 -1
@@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim);/* PHY to WL utility functions */ struct wlapi_timer *wlapi_init_timer (struct phy_shim_info *physhim, -void (*fn)(struct brcms_phy *pi), +void (*fn)(void *pi),void *arg,const char *name);void wlapi_free_timer (struct wlapi_timer *t);void wlapi_add_timer (struct wlapi_timer *t,uint ms,int periodic);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 231/638 arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 584a327c5cffc36369b2a8953d9448826240f1ac ]
Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE name for the pin:
sdm845-db845c.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected)
--- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +1 -1
@@ -580,7 +580,7 @@ &mss_pil { &pcie0 { status = "okay"; perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; - enable-gpio = <&tlmm 134 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 134 GPIO_ACTIVE_HIGH>; vddpe-3v3-supply = <&pcie0_3p3v_dual>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 232/638 arm64: dts: qcom: sm8150: use 'gpios' suffix for PCI GPIOs
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit af6f6778d34cb40e60368e288767f674cc0c5f60 ]
Linux handles both versions, but bindings expect GPIO properties to have 'gpios' suffix instead of 'gpio':
sa8155p-adp.dtb: pci@1c00000: Unevaluated properties are not allowed ('perst-gpio' was unexpected)
Stable-dep-of: 7c38989d0f7a ("arm64: dts: qcom: sm8150: correct PCIe wake-gpios")
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +2 -2
@@ -1876,7 +1876,7 @@ pcie0: pci@1c00000 { phys = <&pcie0_lane>; phy-names = "pciephy"; - perst-gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>; + perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; enable-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; pinctrl-names = "default";
@@ -1978,7 +1978,7 @@ pcie1: pci@1c08000 { phys = <&pcie1_lane>; phy-names = "pciephy"; - perst-gpio = <&tlmm 102 GPIO_ACTIVE_HIGH>; + perst-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>; enable-gpio = <&tlmm 104 GPIO_ACTIVE_HIGH>; pinctrl-names = "default";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 233/638 arm64: dts: qcom: sm8150: correct PCIe wake-gpios
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 7c38989d0f7a35c83e7c4781271d42662903fa8d ]
Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE name for the pin:
sa8155p-adp.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected)
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
@@ -1877,7 +1877,7 @@ pcie0: pci@1c00000 { phy-names = "pciephy"; perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - enable-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 234/638 powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
In reply to Sasha LevinFrom: Daniel Lezcano <[email protected]>
[ Upstream commit b50155cb0d609437236c88201206267835c6f965 ]
The caller of the function freq_qos_add_request() checks again a non zero value but freq_qos_add_request() can return '1' if the request already exists. Therefore, the setup function fails while the QoS request actually did not failed.
Fix that by changing the check against a negative value like all the other callers of the function.
--- drivers/powercap/dtpm_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/powercap/dtpm_cpu.c +1 -1
@@ -219,7 +219,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) ret =freq_qos_add_request (&policy->constraints, &dtpm_cpu->qos_req,FREQ_QOS_MAX , pd->table[pd->nr_perf_states -1 ].frequency); -if (ret) +if (ret <0 ) goto out_dtpm_unregister;cpufreq_cpu_put (policy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 235/638 net: ena: Remove ena_select_queue
In reply to Sasha LevinFrom: Kamal Heib <[email protected]>
[ Upstream commit 78e886ba2b549945ecada055ee0765f0ded5707a ]
Avoid the following warnings by removing the ena_select_queue() function and rely on the net core to do the queue selection, The issue happen when an skb received from an interface with more queues than ena is forwarded to the ena interface.
[ 1176.159959] eth0 selects TX queue 11, but real number of TX queues is 8 [ 1176.863976] eth0 selects TX queue 14, but real number of TX queues is 8 [ 1180.767877] eth0 selects TX queue 14, but real number of TX queues is 8 [ 1188.703742] eth0 selects TX queue 14, but real number of TX queues is 8
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -17
@@ -3238,22 +3238,6 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_OK ; } -static u16 ena_select_queue (struct net_device *dev,struct sk_buff *skb, -struct net_device *sb_dev) -{ -u16 qid; -/* we suspect that this is good for in--kernel network services that -* want to loop incoming skb rx to tx in normal user generated traffic, -* most probably we will not get to this -*/ -if (skb_rx_queue_recorded (skb)) - qid =skb_get_rx_queue (skb); -else - qid =netdev_pick_tx (dev, skb,NULL ); - -return qid; -} -static void ena_config_host_info (struct ena_com_dev *ena_dev,struct pci_dev *pdev) {struct device *dev = &pdev->dev;
@@ -3424,7 +3408,6 @@ static const struct net_device_ops ena_netdev_ops = { .ndo_open = ena_open, .ndo_stop = ena_close, .ndo_start_xmit = ena_start_xmit, - .ndo_select_queue = ena_select_queue, .ndo_get_stats64 = ena_get_stats64, .ndo_tx_timeout = ena_tx_timeout, .ndo_change_mtu = ena_change_mtu,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 236/638 arm64: dts: ti: k3-j7200-common-proc-board: Modify Pinmux for wkup_uart0 and mcu_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 566feddd2ba5e29d9ccab36d6508592ae563f275 ]
WKUP_PADCONFIG registers for wkup_uart0 and mcu_uart0 lies under wkup_pmx2 for J7200. Thus, modify pinmux for both of them.
--- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +9 -8
@@ -91,24 +91,25 @@ vdd_sd_dv: gpio-regulator-TLV71033 { }; &wkup_pmx0 { +}; + +&wkup_pmx2 { mcu_uart0_pins_default: mcu-uart0-default-pins { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0xf4, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ - J721E_WKUP_IOPAD(0xf0, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ - J721E_WKUP_IOPAD(0xf8, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ - J721E_WKUP_IOPAD(0xfc, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ + J721E_WKUP_IOPAD(0x90, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ + J721E_WKUP_IOPAD(0x94, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ + J721E_WKUP_IOPAD(0x8c, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ + J721E_WKUP_IOPAD(0x88, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ >; }; wkup_uart0_pins_default: wkup-uart0-default-pins { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0xb0, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ - J721E_WKUP_IOPAD(0xb4, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ + J721E_WKUP_IOPAD(0x48, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ + J721E_WKUP_IOPAD(0x4c, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ >; }; -}; -&wkup_pmx2 { mcu_cpsw_pins_default: mcu-cpsw-default-pins { pinctrl-single,pins = < J721E_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 237/638 arm64: dts: ti: k3-j7200-common-proc-board: Remove clock-frequency from mcu_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 0fa8b0e2083d333e4854b9767fb893f924e70ae5 ]
Clock-frequency property is already present in mcu_uart0 node of the k3-j7200-mcu-wakeup.dtsi file. Thus, remove redundant clock-frequency property from mcu_uart0 node.
--- arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +0 -1
@@ -211,7 +211,6 @@ &mcu_uart0 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mcu_uart0_pins_default>; - clock-frequency = <96000000>; }; &main_uart0 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 238/638 arm64: dts: ti: k3-j721s2-common-proc-board: Remove Pinmux for CTS and RTS in wkup_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 28e5b74d524050008edf415f20a3e38907b8f176 ]
Only Tx and Rx Signal lines for wkup_uart0 are brought out on the Common Proc Board through SoM, but CTS and RTS signal lines are not brought on the board. Thus, remove pinmux for CTS and RTS signal lines for wkup_uart0 in J721S2.
--- arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +0 -2
@@ -190,8 +190,6 @@ J721S2_IOPAD(0x038, PIN_OUTPUT, 0) /* (AB28) MCASP0_ACLKX.MCAN5_TX */ &wkup_pmx2 { wkup_uart0_pins_default: wkup-uart0-default-pins { pinctrl-single,pins = < - J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (E25) WKUP_GPIO0_6.WKUP_UART0_CTSn */ - J721S2_WKUP_IOPAD(0x074, PIN_OUTPUT, 0) /* (F28) WKUP_GPIO0_7.WKUP_UART0_RTSn */ J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (D28) WKUP_UART0_RXD */ J721S2_WKUP_IOPAD(0x04c, PIN_OUTPUT, 0) /* (D27) WKUP_UART0_TXD */ >;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 239/638 arm64: dts: ti: k3-j784s4-evm: Remove Pinmux for CTS and RTS in wkup_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit d29a6cf980572d8cf7b63935716fca663e2610f0 ]
Only Tx and Rx Signal lines for wkup_uart0 are brought out on the J784S4 EVM from SoC, but CTS and RTS signal lines are not brought on the EVM. Thus, remove pinmux for CTS and RTS signal lines for wkup_uart0 in J784S4.
--- arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +0 -2
@@ -296,8 +296,6 @@ &wkup_pmx2 { wkup_uart0_pins_default: wkup-uart0-default-pins { bootph-all; pinctrl-single,pins = < - J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (L37) WKUP_GPIO0_6.WKUP_UART0_CTSn */ - J721S2_WKUP_IOPAD(0x074, PIN_INPUT, 0) /* (L36) WKUP_GPIO0_7.WKUP_UART0_RTSn */ J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (K35) WKUP_UART0_RXD */ J721S2_WKUP_IOPAD(0x04c, PIN_INPUT, 0) /* (K34) WKUP_UART0_TXD */ >;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 240/638 arm64: dts: ti: k3-am642-evm: Add boot phase tags marking
In reply to Sasha LevinFrom: Nishanth Menon <[email protected]>
[ Upstream commit 33830e077797ce4d7317b83a145f03bfde06ad4c ]
bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT.
Describe the same for AM642-evm boot devices.
Stable-dep-of: 379c7752bbd0 ("arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC")
--- arch/arm64/boot/dts/ti/k3-am642-evm.dts | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-evm.dts +28 -0
@@ -35,6 +35,7 @@ aliases { }; memory@80000000 { + bootph-all; device_type = "memory"; /* 2G RAM */ reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
@@ -108,6 +109,7 @@ rtos_ipc_memory_region: ipc-memories@a5000000 { evm_12v0: regulator-0 { /* main DC jack */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "evm_12v0"; regulator-min-microvolt = <12000000>;
@@ -129,6 +131,7 @@ vsys_5v0: regulator-1 { vsys_3v3: regulator-2 { /* output of LM5140 */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "vsys_3v3"; regulator-min-microvolt = <3300000>;
@@ -140,6 +143,7 @@ vsys_3v3: regulator-2 { vdd_mmc1: regulator-3 { /* TPS2051BD */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "vdd_mmc1"; regulator-min-microvolt = <3300000>;
@@ -161,6 +165,7 @@ vddb: regulator-4 { }; vtt_supply: regulator-5 { + bootph-all; compatible = "regulator-fixed"; regulator-name = "vtt"; pinctrl-names = "default";
@@ -251,6 +256,7 @@ AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ }; main_uart0_pins_default: main-uart0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */ AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
@@ -269,6 +275,7 @@ AM64X_IOPAD(0x0218, PIN_INPUT, 0) /* (A14) SPI0_D1 */ }; main_i2c0_pins_default: main-i2c0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */
@@ -276,6 +283,7 @@ AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ }; main_i2c1_pins_default: main-i2c1-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */ AM64X_IOPAD(0x026c, PIN_INPUT_PULLUP, 0) /* (B19) I2C1_SDA */
@@ -283,6 +291,7 @@ AM64X_IOPAD(0x026c, PIN_INPUT_PULLUP, 0) /* (B19) I2C1_SDA */ }; mdio1_pins_default: mdio1-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x01fc, PIN_OUTPUT, 4) /* (R2) PRG0_PRU1_GPO19.MDIO0_MDC */ AM64X_IOPAD(0x01f8, PIN_INPUT, 4) /* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */
@@ -290,6 +299,7 @@ AM64X_IOPAD(0x01f8, PIN_INPUT, 4) /* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */ }; rgmii1_pins_default: rgmii1-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x01cc, PIN_INPUT, 4) /* (W5) PRG0_PRU1_GPO7.RGMII1_RD0 */ AM64X_IOPAD(0x01d4, PIN_INPUT, 4) /* (Y5) PRG0_PRU1_GPO9.RGMII1_RD1 */
@@ -307,6 +317,7 @@ AM64X_IOPAD(0x00dc, PIN_OUTPUT, 4) /* (U15) PRG1_PRU0_GPO9.RGMII1_TX_CTL */ }; rgmii2_pins_default: rgmii2-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0108, PIN_INPUT, 4) /* (W11) PRG1_PRU1_GPO0.RGMII2_RD0 */ AM64X_IOPAD(0x010c, PIN_INPUT, 4) /* (V11) PRG1_PRU1_GPO1.RGMII2_RD1 */
@@ -324,6 +335,7 @@ AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) PRG1_PRU1_GPO15.RGMII2_TX_CTL */ }; main_usb0_pins_default: main-usb0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ >;
@@ -366,6 +378,7 @@ AM64X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (C17) MCAN1_TX */ }; ddr_vtt_pins_default: ddr-vtt-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0030, PIN_OUTPUT_PULLUP, 7) /* (L18) OSPI0_CSN1.GPIO0_12 */ >;
@@ -373,6 +386,7 @@ AM64X_IOPAD(0x0030, PIN_OUTPUT_PULLUP, 7) /* (L18) OSPI0_CSN1.GPIO0_12 */ }; &main_uart0 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_uart0_pins_default>;
@@ -387,6 +401,7 @@ &main_uart1 { }; &main_i2c0 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c0_pins_default>;
@@ -400,12 +415,14 @@ eeprom@50 { }; &main_i2c1 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c1_pins_default>; clock-frequency = <400000>; exp1: gpio@22 { + bootph-all; compatible = "ti,tca6424"; reg = <0x22>; gpio-controller;
@@ -438,6 +455,10 @@ display@3c { }; }; +&main_gpio0 { + bootph-all; +}; + /* mcu_gpio0 is reserved for mcu firmware usage */ &mcu_gpio0 { status = "reserved";
@@ -467,6 +488,7 @@ &sdhci0 { &sdhci1 { /* SD/MMC */ + bootph-all; vmmc-supply = <&vdd_mmc1>; pinctrl-names = "default"; bus-width = <4>;
@@ -476,11 +498,13 @@ &sdhci1 { }; &usbss0 { + bootph-all; ti,vbus-divider; ti,usb2-only; }; &usb0 { + bootph-all; dr_mode = "otg"; maximum-speed = "high-speed"; pinctrl-names = "default";
@@ -488,11 +512,13 @@ &usb0 { }; &cpsw3g { + bootph-all; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins_default>, <&rgmii2_pins_default>; }; &cpsw_port1 { + bootph-all; phy-mode = "rgmii-rxid"; phy-handle = <&cpsw3g_phy0>; };
@@ -503,11 +529,13 @@ &cpsw_port2 { }; &cpsw3g_mdio { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mdio1_pins_default>; cpsw3g_phy0: ethernet-phy@0 { + bootph-all; reg = <0>; ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 241/638 arm64: dts: ti: k3-am642-sk: Add boot phase tags marking
In reply to Sasha LevinFrom: Nishanth Menon <[email protected]>
[ Upstream commit 4669288219a7f77c6ff992d10ce6a20660863979 ]
bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT.
Describe the same for AM642-sk boot devices.
Stable-dep-of: 379c7752bbd0 ("arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC")
--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +29 -0
@@ -34,6 +34,7 @@ aliases { }; memory@80000000 { + bootph-pre-ram; device_type = "memory"; /* 2G RAM */ reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
@@ -107,6 +108,7 @@ rtos_ipc_memory_region: ipc-memories@a5000000 { vusb_main: regulator-0 { /* USB MAIN INPUT 5V DC */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "vusb_main5v0"; regulator-min-microvolt = <5000000>;
@@ -117,6 +119,7 @@ vusb_main: regulator-0 { vcc_3v3_sys: regulator-1 { /* output of LP8733xx */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "vcc_3v3_sys"; regulator-min-microvolt = <3300000>;
@@ -128,6 +131,7 @@ vcc_3v3_sys: regulator-1 { vdd_mmc1: regulator-2 { /* TPS2051BD */ + bootph-all; compatible = "regulator-fixed"; regulator-name = "vdd_mmc1"; regulator-min-microvolt = <3300000>;
@@ -234,6 +238,7 @@ led-7 { &main_pmx0 { main_mmc1_pins_default: main-mmc1-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */ AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */
@@ -248,6 +253,7 @@ AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */ }; main_uart0_pins_default: main-uart0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */ AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
@@ -257,6 +263,7 @@ AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */ }; main_uart1_pins_default: main-uart1-default-pins { + bootph-pre-ram; pinctrl-single,pins = < AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */
@@ -266,12 +273,14 @@ AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ }; main_usb0_pins_default: main-usb0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ >; }; main_i2c0_pins_default: main-i2c0-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */
@@ -279,6 +288,7 @@ AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ }; main_i2c1_pins_default: main-i2c1-default-pins { + bootph-all; pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */ AM64X_IOPAD(0x026c, PIN_INPUT_PULLUP, 0) /* (B19) I2C1_SDA */
@@ -367,6 +377,7 @@ AM64X_IOPAD(0x00bc, PIN_INPUT, 7) /* (U8) GPIO0_46 */ }; &main_uart0 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_uart0_pins_default>;
@@ -375,12 +386,14 @@ &main_uart0 { &main_uart1 { /* main_uart1 is reserved for firmware usage */ + bootph-pre-ram; status = "reserved"; pinctrl-names = "default"; pinctrl-0 = <&main_uart1_pins_default>; }; &main_i2c0 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c0_pins_default>;
@@ -393,12 +406,14 @@ eeprom@51 { }; &main_i2c1 { + bootph-all; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c1_pins_default>; clock-frequency = <400000>; exp1: gpio@70 { + bootph-all; compatible = "nxp,pca9538"; reg = <0x70>; gpio-controller;
@@ -445,6 +460,7 @@ wlcore: wlcore@2 { &sdhci1 { /* SD/MMC */ + bootph-all; vmmc-supply = <&vdd_mmc1>; pinctrl-names = "default"; bus-width = <4>;
@@ -454,11 +470,22 @@ &sdhci1 { }; &serdes_ln_ctrl { + bootph-all; idle-states = <AM64_SERDES0_LANE0_USB>; }; +&serdes_refclk { + bootph-all; +}; + +&serdes_wiz0 { + bootph-all; +}; + &serdes0 { + bootph-all; serdes0_usb_link: phy@0 { + bootph-all; reg = <0>; cdns,num-lanes = <1>; #phy-cells = <0>;
@@ -468,10 +495,12 @@ serdes0_usb_link: phy@0 { }; &usbss0 { + bootph-all; ti,vbus-divider; }; &usb0 { + bootph-all; dr_mode = "host"; maximum-speed = "super-speed"; pinctrl-names = "default";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 242/638 arm64: dts: ti: k3-am64: Enable SDHCI nodes at the board level
In reply to Sasha LevinFrom: Andrew Davis <[email protected]>
[ Upstream commit 3b6345e3fcf4c93a79f396121cd0e6f98f04da13 ]
SDHCI nodes defined in the top-level AM64 SoC dtsi files are incomplete and will not be functional unless they are extended.
As the attached SD/eMMC is only known about at the board integration level, these nodes should only be enabled when provided with this information.
Disable the SDHCI nodes in the dtsi files and only enable the ones that are actually pinned out on a given board.
Stable-dep-of: 379c7752bbd0 ("arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC")
--- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 2 ++ arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi | 1 + arch/arm64/boot/dts/ti/k3-am642-evm.dts | 6 ++++-- arch/arm64/boot/dts/ti/k3-am642-phyboard-electra-rdk.dts | 1 + arch/arm64/boot/dts/ti/k3-am642-sk.dts | 4 +++- arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts | 1 - arch/arm64/boot/dts/ti/k3-am642-tqma64xxl.dtsi | 1 + 7 files changed, 12 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +2 -0
@@ -612,6 +612,7 @@ sdhci0: mmc@fa10000 { ti,otap-del-sel-mmc-hs = <0x0>; ti,otap-del-sel-ddr52 = <0x6>; ti,otap-del-sel-hs200 = <0x7>; + status = "disabled"; }; sdhci1: mmc@fa00000 {
@@ -630,6 +631,7 @@ sdhci1: mmc@fa00000 { ti,otap-del-sel-sdr104 = <0x6>; ti,otap-del-sel-ddr50 = <0x9>; ti,clkbuf-sel = <0x7>; + status = "disabled"; }; cpsw3g: ethernet@8000000 {
arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi +1 -0
@@ -200,6 +200,7 @@ flash@0 { }; &sdhci0 { + status = "okay"; bus-width = <8>; non-removable; ti,driver-strength-ohm = <50>;
arch/arm64/boot/dts/ti/k3-am642-evm.dts +4 -2
@@ -478,17 +478,19 @@ eeprom@0 { }; }; +/* eMMC */ &sdhci0 { - /* emmc */ + status = "okay"; bus-width = <8>; non-removable; ti,driver-strength-ohm = <50>; disable-wp; }; +/* SD/MMC */ &sdhci1 { - /* SD/MMC */ bootph-all; + status = "okay"; vmmc-supply = <&vdd_mmc1>; pinctrl-names = "default"; bus-width = <4>;
arch/arm64/boot/dts/ti/k3-am642-phyboard-electra-rdk.dts +1 -0
@@ -264,6 +264,7 @@ &main_uart1 { }; &sdhci1 { + status = "okay"; vmmc-supply = <&vcc_3v3_mmc>; pinctrl-names = "default"; pinctrl-0 = <&main_mmc1_pins_default>;
arch/arm64/boot/dts/ti/k3-am642-sk.dts +3 -1
@@ -439,6 +439,7 @@ &mcu_gpio0 { }; &sdhci0 { + status = "okay"; vmmc-supply = <&wlan_en>; bus-width = <4>; non-removable;
@@ -458,9 +459,10 @@ wlcore: wlcore@2 { }; }; +/* SD/MMC */ &sdhci1 { - /* SD/MMC */ bootph-all; + status = "okay"; vmmc-supply = <&vdd_mmc1>; pinctrl-names = "default"; bus-width = <4>;
arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts +0 -1
@@ -420,7 +420,6 @@ &sdhci1 { ti,driver-strength-ohm = <50>; ti,fails-without-test-cd; /* Enabled by overlay */ - status = "disabled"; }; &tscadc0 {
arch/arm64/boot/dts/ti/k3-am642-tqma64xxl.dtsi +1 -0
@@ -207,6 +207,7 @@ partitions { }; &sdhci0 { + status = "okay"; non-removable; disable-wp; no-sdio;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 243/638 arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC
In reply to Sasha LevinFrom: Judith Mendez <[email protected]>
[ Upstream commit 379c7752bbd0e81654544a896dd19c19ebb6faba ]
Update MMC0/MMC1 OTAP/ITAP values according to the datasheet [0], refer to Table 7-68 for MMC0 and Table 7-77 for MMC1.
[0] https://www.ti.com/lit/ds/symlink/am6442.pdf
--- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +8 -1
@@ -612,6 +612,9 @@ sdhci0: mmc@fa10000 { ti,otap-del-sel-mmc-hs = <0x0>; ti,otap-del-sel-ddr52 = <0x6>; ti,otap-del-sel-hs200 = <0x7>; + ti,itap-del-sel-legacy = <0x10>; + ti,itap-del-sel-mmc-hs = <0xa>; + ti,itap-del-sel-ddr52 = <0x3>; status = "disabled"; };
@@ -624,12 +627,16 @@ sdhci1: mmc@fa00000 { clock-names = "clk_ahb", "clk_xin"; ti,trm-icp = <0x2>; ti,otap-del-sel-legacy = <0x0>; - ti,otap-del-sel-sd-hs = <0xf>; + ti,otap-del-sel-sd-hs = <0x0>; ti,otap-del-sel-sdr12 = <0xf>; ti,otap-del-sel-sdr25 = <0xf>; ti,otap-del-sel-sdr50 = <0xc>; ti,otap-del-sel-sdr104 = <0x6>; ti,otap-del-sel-ddr50 = <0x9>; + ti,itap-del-sel-legacy = <0x0>; + ti,itap-del-sel-sd-hs = <0x0>; + ti,itap-del-sel-sdr12 = <0x0>; + ti,itap-del-sel-sdr25 = <0x0>; ti,clkbuf-sel = <0x7>; status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 244/638 arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow
In reply to Sasha LevinFrom: Hsin-Te Yuan <[email protected]>
[ Upstream commit ef569d5db50e7edd709e482157769a5b3c367e22 ]
The external output reset signal was originally disabled and sent from firmware. However, an unfixed bug in the firmware on tomato prevents the signal from being sent, causing the device to fail to boot. To fix this, enable external output reset signal to allow the device to reboot normally.
--- arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 4 ++++ arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts | 4 ++++ arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts | 4 ++++ 3 files changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +4 -0
@@ -23,3 +23,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +4 -0
@@ -43,3 +43,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +4 -0
@@ -44,3 +44,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 245/638 arm64: dts: ti: Add common1 register space for AM65x SoC
In reply to Sasha LevinFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit 1a5010eade10b409d353b770d97b548b0fbdf5d7 ]
This adds common1 register space for AM65x SoC which is using TI's Keystone display hardware and supporting it as described in Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml
--- arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +3 -2
@@ -1013,9 +1013,10 @@ dss: dss@4a00000 { <0x0 0x04a07000 0x0 0x1000>, /* ovr1 */ <0x0 0x04a08000 0x0 0x1000>, /* ovr2 */ <0x0 0x04a0a000 0x0 0x1000>, /* vp1 */ - <0x0 0x04a0b000 0x0 0x1000>; /* vp2 */ + <0x0 0x04a0b000 0x0 0x1000>, /* vp2 */ + <0x0 0x04a01000 0x0 0x1000>; /* common1 */ reg-names = "common", "vidl1", "vid", - "ovr1", "ovr2", "vp1", "vp2"; + "ovr1", "ovr2", "vp1", "vp2", "common1"; ti,am65x-oldi-io-ctrl = <&dss_oldi_io_ctrl>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 246/638 arm64: dts: ti: Add common1 register space for AM62x SoC
In reply to Sasha LevinFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit 7d8ee2c3b8a2aabb9ce75795bad20773bfe1ba13 ]
This adds common1 register space for AM62x SoC which is using TI's Keystone display hardware and supporting it as described in Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +3 -2
@@ -747,9 +747,10 @@ dss: dss@30200000 { <0x00 0x30207000 0x00 0x1000>, /* ovr1 */ <0x00 0x30208000 0x00 0x1000>, /* ovr2 */ <0x00 0x3020a000 0x00 0x1000>, /* vp1: Used for OLDI */ - <0x00 0x3020b000 0x00 0x1000>; /* vp2: Used as DPI Out */ + <0x00 0x3020b000 0x00 0x1000>, /* vp2: Used as DPI Out */ + <0x00 0x30201000 0x00 0x1000>; /* common1 */ reg-names = "common", "vidl1", "vid", - "ovr1", "ovr2", "vp1", "vp2"; + "ovr1", "ovr2", "vp1", "vp2", "common1"; power-domains = <&k3_pds 186 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 186 6>, <&dss_vp1_clk>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 247/638 firmware: arm_scmi: Fix double free in SMC transport cleanup path
In reply to Sasha LevinFrom: Andre Przywara <[email protected]>
[ Upstream commit f1d71576d2c9ec8fdb822173fa7f3de79475e9bd ]
When the generic SCMI code tears down a channel, it calls the chan_free callback function, defined by each transport. Since multiple protocols might share the same transport_info member, chan_free() might want to clean up the same member multiple times within the given SCMI transport implementation. In this case, it is SMC transport. This will lead to a NULL pointer dereference at the second time:
| scmi_protocol scmi_dev.1: Enabled polling mode TX channel - prot_id:16
| arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
| arm-scmi firmware:scmi: unable to communicate with SCMI
| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
| Mem abort info:
| ESR = 0x0000000096000004
| EC = 0x25: DABT (current EL), IL = 32 bits
| SET = 0, FnV = 0
| EA = 0, S1PTW = 0
| FSC = 0x04: level 0 translation fault
| Data abort info:
| ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
| CM = 0, WnR = 0, TnD = 0, TagAccess = 0
| GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
| user pgtable: 4k pages, 48-bit VAs, pgdp=0000000881ef8000
| [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
| Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
| Modules linked in:
| CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-00124-g455ef3d016c9-dirty #793
| Hardware name: FVP Base RevC (DT)
| pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
| pc : smc_chan_free+0x3c/0x6c
| lr : smc_chan_free+0x3c/0x6c
| Call trace:
| smc_chan_free+0x3c/0x6c
| idr_for_each+0x68/0xf8
| scmi_cleanup_channels.isra.0+0x2c/0x58
| scmi_probe+0x434/0x734
| platform_probe+0x68/0xd8
| really_probe+0x110/0x27c
| __driver_probe_device+0x78/0x12c
| driver_probe_device+0x3c/0x118
| __driver_attach+0x74/0x128
| bus_for_each_dev+0x78/0xe0
| driver_attach+0x24/0x30
| bus_add_driver+0xe4/0x1e8
| driver_register+0x60/0x128
| __platform_driver_register+0x28/0x34
| scmi_driver_init+0x84/0xc0
| do_one_initcall+0x78/0x33c
| kernel_init_freeable+0x2b8/0x51c
| kernel_init+0x24/0x130
| ret_from_fork+0x10/0x20
| Code: f0004701 910a0021 aa1403e5 97b91c70 (b9400280)
| ---[ end trace 0000000000000000 ]---Simply check for the struct pointer being NULL before trying to access its members, to avoid this situation.
This was found when a transport doesn't really work (for instance no SMC service), the probe routines then tries to clean up, and triggers a crash.
--- drivers/firmware/arm_scmi/smc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/firmware/arm_scmi/smc.c +7 -0
@@ -196,6 +196,13 @@ static int smc_chan_free(int id, void *p, void *data)struct scmi_chan_info *cinfo = p;struct scmi_smc *scmi_info = cinfo->transport_info; +/* +* Different protocols might share the same chan info, so a previous +* smc_chan_free call might have already freed the structure. +*/ +if (!scmi_info) +return 0 ; +/* Ignore any possible further reception on the IRQ path */ if (scmi_info->irq >0 )free_irq (scmi_info->irq, scmi_info);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 248/638 arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS
In reply to Sasha LevinFrom: Jai Luthra <[email protected]>
[ Upstream commit 90a67583171f213711de662fab9f8d24a2d291a9 ]
The INTR module for DMASS1 (CSI specific DMASS) is outside the currently available ranges, as it starts at 0x4e400000. So fix the ranges property to enable programming the interrupts correctly.
--- arch/arm64/boot/dts/ti/k3-am62p.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62p.dtsi +1 -1
@@ -71,7 +71,7 @@ cbass_main: bus@f0000 { <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* SA3 sproxy data */ <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */ <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* SA3 sproxy config */ - <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */ + <0x00 0x48000000 0x00 0x48000000 0x00 0x06408000>, /* DMSS */ <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */ <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */ <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 249/638 wifi: wilc1000: revert reset line logic flip
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit f3ec643947634bed41b97bd56b248f7c78498eab ]
This reverts commit fcf690b0b47494df51d214db5c5a714a400b0257.
When using a wilc1000 chip over a spi bus, users can optionally define a reset gpio and a chip enable gpio. The reset line of wilc1000 is active low, so to hold the chip in reset, a low (physical) value must be applied.
The corresponding device tree binding documentation was introduced by commit f31ee3c0a555 ("wilc1000: Document enable-gpios and reset-gpios properties") and correctly indicates that the reset line is an active-low signal. The corresponding driver part, brought by commit ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver") was applying the correct logic. But commit fcf690b0b474 ("wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down") eventually flipped this logic and started misusing the gpiod APIs, applying an inverted logic when powering up/down the chip (for example, setting the reset line to a logic "1" during power up, which in fact asserts the reset line when device tree describes the reset line as GPIO_ACTIVE_LOW). As a consequence, any platform currently using the driver in SPI mode must use a faulty reset line description in device tree, or else chip will be maintained in reset and will not even allow to bring up the chip.
Fix reset line usage by inverting back the gpiod APIs usage, setting the reset line to the logic value "0" when powering the chip, and the logic value "1" when powering off the chip.
--- drivers/net/wireless/microchip/wilc1000/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/microchip/wilc1000/spi.c +3 -3
@@ -192,11 +192,11 @@ static void wilc_wlan_power(struct wilc *wilc, bool on)/* assert ENABLE: */ gpiod_set_value (gpios->enable,1 );mdelay (5 ); -/* assert RESET: */ -gpiod_set_value (gpios->reset,1 ); - }else {/* deassert RESET: */ gpiod_set_value (gpios->reset,0 ); + }else { +/* assert RESET: */ +gpiod_set_value (gpios->reset,1 );/* deassert ENABLE: */ gpiod_set_value (gpios->enable,0 ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 250/638 ARM: dts: arm: realview: Fix development chip ROM compatible value
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 3baa4c5143d65ebab2de0d99a395e5f4f1f46608 ]
When the development chip ROM was added, the "direct-mapped" compatible value was already obsolete. In addition, the device node lacked the accompanying "probe-type" property, causing the old physmap_of_core driver to fall back to trying all available probe types. Unfortunately this fallback was lost when the DT and pdata cases were merged.
Fix this by using the modern "mtd-rom" compatible value instead.
--- arch/arm/boot/dts/arm/arm-realview-pb1176.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/arm/arm-realview-pb1176.dts +1 -1
@@ -451,7 +451,7 @@ pb1176_serial3: serial@1010f000 { /* Direct-mapped development chip ROM */ pb1176_rom@10200000 { - compatible = "direct-mapped"; + compatible = "mtd-rom"; reg = <0x10200000 0x4000>; bank-width = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 251/638 memory: tegra: Correct DLA client names
In reply to Sasha LevinFrom: Jon Hunter <[email protected]>
[ Upstream commit 51d915cbeef4c7a154f5d810b1e10d8125f2b0cc ]
Some of the names for the Tegra234 DLA clients are not unique and do not align with the name of the client ID definitions. Therefore, it is not possible to determine the exact DLA client from messages that print the client name. Fix this by correcting the DLA memory client names for Tegra234 to align with the name of the corresponding memory client ID.
Note that although the client names are also used by the interconnect framework, interconnect support for the DLA clients has not been added and so this issue does not impact the interconnect support.
--- drivers/memory/tegra/tegra234.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/memory/tegra/tegra234.c +8 -8
@@ -121,7 +121,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDB, - .name = "dla0rdb", + .name = "dla1rdb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -407,7 +407,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDB1, - .name = "dla0rdb1", + .name = "dla1rdb1", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -417,7 +417,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1WRB, - .name = "dla0wrb", + .name = "dla1wrb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -663,7 +663,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDA, - .name = "dla0rda", + .name = "dla1rda", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -673,7 +673,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1FALRDB, - .name = "dla0falrdb", + .name = "dla1falrdb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -683,7 +683,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1WRA, - .name = "dla0wra", + .name = "dla1wra", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -693,7 +693,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1FALWRB, - .name = "dla0falwrb", + .name = "dla1falwrb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -857,7 +857,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDA1, - .name = "dla0rda1", + .name = "dla1rda1", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 252/638 wifi: mt76: mt7996: fix TWT issues
In reply to Sasha LevinFrom: Peter Chiu <[email protected]>
[ Upstream commit 5c832c228f6a7ba7e900c5296ce0fb3844bafec5 ]
This patch fixes the following TWT issues:
- Change table_mask to u16 to support up to 16 TWT stations
- Reject TWT flows for duplicated establishment
- Fix possible unaligned pointer
- Remove unsupported TWT_CONTROL_WAKE_DUR_UNIT flag
- The minimum TWT duration supported by mt7996 chipsets is 64. Reply with TWT_SETUP_CMD_DICTATE if the min_twt_dur is smaller than 64
--- .../net/wireless/mediatek/mt76/mt7996/mac.c | 53 ++++++++++++++++--- .../wireless/mediatek/mt76/mt7996/mt7996.h | 3 +- 2 files changed, 47 insertions(+), 9 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mac.c +45 -8
@@ -2433,6 +2433,34 @@ static int mt7996_mac_check_twt_req(struct ieee80211_twt_setup *twt)return 0 ; } +static bool +mt7996_mac_twt_param_equal (struct mt7996_sta *msta, +struct ieee80211_twt_params *twt_agrt) +{ +u16 type =le16_to_cpu (twt_agrt->req_type); +u8 exp; +int i; + + exp =FIELD_GET (IEEE80211_TWT_REQTYPE_WAKE_INT_EXP , type); +for (i =0 ; i <MT7996_MAX_STA_TWT_AGRT ; i++) { +struct mt7996_twt_flow *f; + +if (!(msta->twt.flowid_mask &BIT (i))) +continue ; + + f = &msta->twt.flow[i]; +if (f->duration == twt_agrt->min_twt_dur && + f->mantissa == twt_agrt->mantissa && + f->exp == exp && + f->protection == !!(type &IEEE80211_TWT_REQTYPE_PROTECTION ) && + f->flowtype == !!(type &IEEE80211_TWT_REQTYPE_FLOWTYPE ) && + f->trigger == !!(type &IEEE80211_TWT_REQTYPE_TRIGGER )) +return true; + } + +return false; +} +void mt7996_mac_add_twt_setup (struct ieee80211_hw *hw,struct ieee80211_sta *sta,struct ieee80211_twt_setup *twt)
@@ -2444,8 +2472,7 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw,enum ieee80211_twt_setup_cmd sta_setup_cmd;struct mt7996_dev *dev =mt7996_hw_dev (hw);struct mt7996_twt_flow *flow; -int flowid, table_id; -u8 exp; +u8 flowid, table_id, exp;if (mt7996_mac_check_twt_req (twt)) goto out;
@@ -2458,9 +2485,19 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw,if (hweight8 (msta->twt.flowid_mask) ==ARRAY_SIZE (msta->twt.flow)) goto unlock; +if (twt_agrt->min_twt_dur <MT7996_MIN_TWT_DUR ) { + setup_cmd =TWT_SETUP_CMD_DICTATE ; + twt_agrt->min_twt_dur =MT7996_MIN_TWT_DUR ; + goto unlock; + } + +if (mt7996_mac_twt_param_equal (msta, twt_agrt)) + goto unlock; + flowid =ffs (~msta->twt.flowid_mask) -1 ; -le16p_replace_bits (&twt_agrt->req_type, flowid, -IEEE80211_TWT_REQTYPE_FLOWID ); + twt_agrt->req_type &= ~cpu_to_le16 (IEEE80211_TWT_REQTYPE_FLOWID ); + twt_agrt->req_type |=le16_encode_bits (flowid, +IEEE80211_TWT_REQTYPE_FLOWID ); table_id =ffs (~dev->twt.table_mask) -1 ; exp =FIELD_GET (IEEE80211_TWT_REQTYPE_WAKE_INT_EXP , req_type);
@@ -2507,10 +2544,10 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw, unlock:mutex_unlock (&dev->mt76.mutex); out: -le16p_replace_bits (&twt_agrt->req_type, setup_cmd, -IEEE80211_TWT_REQTYPE_SETUP_CMD ); - twt->control = (twt->control &IEEE80211_TWT_CONTROL_WAKE_DUR_UNIT ) | - (twt->control &IEEE80211_TWT_CONTROL_RX_DISABLED ); + twt_agrt->req_type &= ~cpu_to_le16 (IEEE80211_TWT_REQTYPE_SETUP_CMD ); + twt_agrt->req_type |= +le16_encode_bits (setup_cmd,IEEE80211_TWT_REQTYPE_SETUP_CMD ); + twt->control = twt->control &IEEE80211_TWT_CONTROL_RX_DISABLED ; } void mt7996_mac_twt_teardown_flow(struct mt7996_dev *dev,
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h +2 -1
@@ -43,6 +43,7 @@#define MT7996_MAX_TWT_AGRT 16#define MT7996_MAX_STA_TWT_AGRT 8 +#define MT7996_MIN_TWT_DUR 64#define MT7996_MAX_QUEUE (__MT_RXQ_MAX + __MT_MCUQ_MAX + 3)/* NOTE: used to map mt76_rates. idx may change if firmware expands table */
@@ -237,7 +238,7 @@ struct mt7996_dev {struct rchan *relay_fwlog;struct { -u8 table_mask; +u16 table_mask;u8 n_agrt; } twt;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 253/638 wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps
In reply to Sasha LevinFrom: Benjamin Lin <[email protected]>
[ Upstream commit d52c97592f06552a4289008602b5d5b724084ba7 ]
The EHT MCS map subfield of 20 MHz-Only is not present in the EHT capability of AP, so STA does not need to parse the subfield. Moreover, AP should parse the subfield only if STA is 20 MHz-Only, which can be confirmed by checking supported channel width in HE capability.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +14 -2
@@ -1005,6 +1005,9 @@ mt7996_mcu_sta_he_6g_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)static void mt7996_mcu_sta_eht_tlv (struct sk_buff *skb,struct ieee80211_sta *sta) { +struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; +struct ieee80211_vif *vif =container_of ((void *)msta->vif, + struct ieee80211_vif, drv_priv);struct ieee80211_eht_mcs_nss_supp *mcs_map;struct ieee80211_eht_cap_elem_fixed *elem;struct sta_rec_eht *eht;
@@ -1024,8 +1027,17 @@ mt7996_mcu_sta_eht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) eht->phy_cap =cpu_to_le64 (*(u64 *)elem->phy_cap_info); eht->phy_cap_ext =cpu_to_le64 (elem->phy_cap_info[8 ]); -if (sta->deflink.bandwidth ==IEEE80211_STA_RX_BW_20 ) -memcpy (eht->mcs_map_bw20, &mcs_map->only_20mhz,sizeof (eht->mcs_map_bw20)); +if (vif->type !=NL80211_IFTYPE_STATION && + (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0 ] & + (IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G )) ==0 ) { +memcpy (eht->mcs_map_bw20, &mcs_map->only_20mhz, +sizeof (eht->mcs_map_bw20)); +return ; + } +memcpy (eht->mcs_map_bw80, &mcs_map->bw._80,sizeof (eht->mcs_map_bw80));memcpy (eht->mcs_map_bw160, &mcs_map->bw._160,sizeof (eht->mcs_map_bw160));memcpy (eht->mcs_map_bw320, &mcs_map->bw._320,sizeof (eht->mcs_map_bw320));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 254/638 wifi: mt76: mt7996: fix HE beamformer phy cap for station vif
In reply to Sasha LevinFrom: Howard Hsu <[email protected]>
[ Upstream commit e1a491e856a8a36c46b39ecd07f3bba5a119d83a ]
Set correct beamformer capabilities for station vif in HE PHY capability IE.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +3 -2
@@ -557,11 +557,12 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,/* the maximum cap is 4 x 3, (Nr, Nc) = (3, 2) */ elem->phy_cap_info[7 ] |=min_t (int, sts -1 ,2 ) <<3 ; -if (vif !=NL80211_IFTYPE_AP ) +if (!(vif ==NL80211_IFTYPE_AP || vif ==NL80211_IFTYPE_STATION ))return ; elem->phy_cap_info[3 ] |=IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER ; - elem->phy_cap_info[4 ] |=IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER ; +if (vif ==NL80211_IFTYPE_AP ) + elem->phy_cap_info[4 ] |=IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER ; c =FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK , sts - 1) |
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 255/638 wifi: mt76: mt7996: fix efuse reading issue
In reply to Sasha LevinFrom: StanleyYP Wang <[email protected]>
[ Upstream commit d3ad99be7cc2d174126d908addd6bea2b157aa75 ]
The efuse data starts from the 48th bytes instead of 64th bytes in the returned event skb.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +1 -1
@@ -3100,7 +3100,7 @@ int mt7996_mcu_get_eeprom(struct mt7996_dev *dev, u32 offset)u32 addr =le32_to_cpu (*(__le32 *)(skb->data +12 ));u8 *buf = (u8 *)dev->mt76.eeprom.data + addr; -skb_pull (skb,64 ); +skb_pull (skb,48 );memcpy (buf, skb->data,MT7996_EEPROM_BLOCK_SIZE ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 256/638 wifi: mt76: mt7996: fix HIF_TXD_V2_1 value
In reply to Sasha LevinFrom: Benjamin Lin <[email protected]>
[ Upstream commit de8882775156682ba358afc82cb575c92cf3d092 ]
Sync the value of HIF_TXD_V2_1 with firmware to let it correctly fill TXD values for HW path.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +1 -1
@@ -276,7 +276,7 @@ static void mt7996_mac_init_basic_rates(struct mt7996_dev *dev)void mt7996_mac_init (struct mt7996_dev *dev) { -#define HIF_TXD_V2_1 4 +#define HIF_TXD_V2_1 0x21int i;mt76_clear (dev,MT_MDP_DCR2 ,MT_MDP_DCR2_RX_TRANS_SHORT );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 257/638 wifi: mt76: mt792x: fix ethtool warning
In reply to Sasha LevinFrom: Gen Xu <[email protected]>
[ Upstream commit 7b4f9cd6a5fc221895b1d9be83ee3c13c00d09ab ]
Add a missing EHT related field to fix the following ethtool warning:
[98179.287352] mt7921e 0003:01:00.0: ei: 74 SSTATS_LEN: 73
--- drivers/net/wireless/mediatek/mt76/mt792x_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt792x_core.c +1 -0
@@ -332,6 +332,7 @@ static const char mt792x_gstrings_stats[][ETH_GSTRING_LEN] = {"v_tx_bw_40" ,"v_tx_bw_80" ,"v_tx_bw_160" , +"v_tx_bw_320" ,"v_tx_mcs_0" ,"v_tx_mcs_1" , "v_tx_mcs_2",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 258/638 wifi: mt76: mt7921e: fix use-after-free in free_irq()
In reply to Sasha LevinFrom: Deren Wu <[email protected]>
[ Upstream commit c957280ef6ab6bdf559a91ae693a6b34310697e3 ]
From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test to make sure the shared irq handler should be able to handle the unexpected event after deregistration. For this case, let's apply MT76_REMOVED flag to indicate the device was removed and do not run into the resource access anymore.
BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e] Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115 CPU: 28 PID: 11115 Comm: rmmod Tainted: G W L 5.17.0 #10 Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024 Call Trace: <TASK> dump_stack_lvl+0x6f/0xa0 print_address_description.constprop.0+0x1f/0x190 ? mt7921_irq_handler+0xd8/0x100 [mt7921e] ? mt7921_irq_handler+0xd8/0x100 [mt7921e] kasan_report.cold+0x7f/0x11b ? mt7921_irq_handler+0xd8/0x100 [mt7921e] mt7921_irq_handler+0xd8/0x100 [mt7921e] free_irq+0x627/0xaa0 devm_free_irq+0x94/0xd0 ? devm_request_any_context_irq+0x160/0x160 ? kobject_put+0x18d/0x4a0 mt7921_pci_remove+0x153/0x190 [mt7921e] pci_device_remove+0xa2/0x1d0 __device_release_driver+0x346/0x6e0 driver_detach+0x1ef/0x2c0 bus_remove_driver+0xe7/0x2d0 ? __check_object_size+0x57/0x310 pci_unregister_driver+0x26/0x250 __do_sys_delete_module+0x307/0x510 ? free_module+0x6a0/0x6a0 ? fpregs_assert_state_consistent+0x4b/0xb0 ? rcu_read_lock_sched_held+0x10/0x70 ? syscall_enter_from_user_mode+0x20/0x70 ? trace_hardirqs_on+0x1c/0x130 do_syscall_64+0x5c/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 ? do_syscall_64+0x68/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xae
--- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 1 + drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/pci.c +1 -0
@@ -387,6 +387,7 @@ static void mt7921_pci_remove(struct pci_dev *pdev) struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);mt7921e_unregister_device (dev); +set_bit (MT76_REMOVED , &mdev->phy.state);devm_free_irq (&pdev->dev, pdev->irq, dev);mt76_free_device (&dev->mt76);pci_free_irq_vectors (pdev);
drivers/net/wireless/mediatek/mt76/mt792x_dma.c +2 -0
@@ -12,6 +12,8 @@ irqreturn_t mt792x_irq_handler(int irq, void *dev_instance) {struct mt792x_dev *dev = dev_instance; +if (test_bit (MT76_REMOVED , &dev->mt76.phy.state)) +return IRQ_NONE ;mt76_wr (dev, dev->irq_map->host_irq_enable,0 );if (!test_bit (MT76_STATE_INITIALIZED , &dev->mphy.state))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 259/638 wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 07ce1d46372489d90f9cccebb3277d1af801c4b9 ]
In some case, the MTCL table will exist, but MTDS table will not. So the SAR will init fail. This patch make MTCL and MTDS can exist with no dependence.
--- .../wireless/mediatek/mt76/mt792x_acpi_sar.c | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/mt792x_acpi_sar.c +14 -12
@@ -66,13 +66,15 @@ mt792x_acpi_read(struct mt792x_dev *dev, u8 *method, u8 **tbl, u32 *len) }/* MTCL : Country List Table for 6G band */ -static void +static int mt792x_asar_acpi_read_mtcl (struct mt792x_dev *dev,u8 **table,u8 *version) { -if (mt792x_acpi_read (dev, MT792x_ACPI_MTCL, table,NULL ) <0 ) - *version =1 ; -else - *version =2 ; +int ret; + + *version = ((ret =mt792x_acpi_read (dev, MT792x_ACPI_MTCL, table,NULL )) <0 ) + ?1 :2 ; + +return ret; }/* MTDS : Dynamic SAR Power Table */
@@ -166,16 +168,16 @@ int mt792x_init_acpi_sar(struct mt792x_dev *dev)if (!asar)return -ENOMEM ; -mt792x_asar_acpi_read_mtcl (dev, (u8 **)&asar->countrylist, &asar->ver); + ret =mt792x_asar_acpi_read_mtcl (dev, (u8 **)&asar->countrylist, &asar->ver); +if (ret) { +devm_kfree (dev->mt76.dev, asar->countrylist); + asar->countrylist =NULL ; + } -/* MTDS is mandatory. Return error if table is invalid */ ret =mt792x_asar_acpi_read_mtds (dev, (u8 **)&asar->dyn, asar->ver);if (ret) {devm_kfree (dev->mt76.dev, asar->dyn); -devm_kfree (dev->mt76.dev, asar->countrylist); -devm_kfree (dev->mt76.dev, asar); - -return ret; + asar->dyn =NULL ; }/* MTGS is optional */
@@ -290,7 +292,7 @@ int mt792x_init_acpi_sar_power(struct mt792x_phy *phy, bool set_default)const struct cfg80211_sar_capa *capa = phy->mt76->hw->wiphy->sar_capa;int i; -if (!phy->acpisar) +if (!phy->acpisar || !((struct mt792x_acpi_sar *)phy->acpisar)->dyn)return 0 ;/* When ACPI SAR enabled in HW, we should apply rules for .frp
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 260/638 arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes
In reply to Sasha LevinFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 14fe225dd5fcd5928583b0bcc34398a581f51602 ]
The IRQC IP block supports Bus error and ECCRAM interrupts on RZ/G2L and alike SoC's (listed below). Update the IRQC nodes with the missing interrupts, and additionally, include the 'interrupt-names' properties in the IRQC nodes so that the driver can parse interrupts by name.
- R9A07G043U - RZ/G2UL
- R9A07G044L/R9A07G044LC - RZ/{G2L,G2LC}
- R9A07G054 - RZ/V2L--- arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 12 +++++++++-- arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 22 ++++++++++++++++++++- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 22 ++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g043u.dtsi +10 -2
@@ -109,7 +109,13 @@ irqc: interrupt-controller@110a0000 { <SOC_PERIPHERAL_IRQ(473) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(474) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(475) IRQ_TYPE_LEVEL_HIGH>, - <SOC_PERIPHERAL_IRQ(25) IRQ_TYPE_EDGE_RISING>; + <SOC_PERIPHERAL_IRQ(25) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(34) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(35) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(36) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(37) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(38) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(39) IRQ_TYPE_EDGE_RISING>; interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", "irq4", "irq5", "irq6", "irq7",
@@ -121,7 +127,9 @@ irqc: interrupt-controller@110a0000 { "tint20", "tint21", "tint22", "tint23", "tint24", "tint25", "tint26", "tint27", "tint28", "tint29", "tint30", "tint31", - "bus-err"; + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G043_IA55_CLK>, <&cpg CPG_MOD R9A07G043_IA55_PCLK>; clock-names = "clk", "pclk";
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +21 -1
@@ -905,7 +905,27 @@ irqc: interrupt-controller@110a0000 { <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", + "tint0", "tint1", "tint2", "tint3", + "tint4", "tint5", "tint6", "tint7", + "tint8", "tint9", "tint10", "tint11", + "tint12", "tint13", "tint14", "tint15", + "tint16", "tint17", "tint18", "tint19", + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G044_IA55_CLK>, <&cpg CPG_MOD R9A07G044_IA55_PCLK>; clock-names = "clk", "pclk";
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +21 -1
@@ -912,7 +912,27 @@ irqc: interrupt-controller@110a0000 { <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", + "tint0", "tint1", "tint2", "tint3", + "tint4", "tint5", "tint6", "tint7", + "tint8", "tint9", "tint10", "tint11", + "tint12", "tint13", "tint14", "tint15", + "tint16", "tint17", "tint18", "tint19", + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G054_IA55_CLK>, <&cpg CPG_MOD R9A07G054_IA55_PCLK>; clock-names = "clk", "pclk";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 261/638 arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0c51912331f8ba5ce5fb52f46e340945160672a3 ]
All Ethernet AVB instances on R-Car V3U have registers related to UDP/IP support, but the declared register blocks for the first two instances are too small to cover them.
Fix this by extending the register block sizes.
--- arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a779a0.dtsi +2 -2
@@ -658,7 +658,7 @@ channel7 { avb0: ethernet@e6800000 { compatible = "renesas,etheravb-r8a779a0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6800000 0 0x800>; + reg = <0 0xe6800000 0 0x1000>; interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
@@ -706,7 +706,7 @@ avb0: ethernet@e6800000 { avb1: ethernet@e6810000 { compatible = "renesas,etheravb-r8a779a0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6810000 0 0x800>; + reg = <0 0xe6810000 0 0x1000>; interrupts = <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 262/638 arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7edbb5880dc3317a5eaec2166de71ff394598e6b ]
All Ethernet AVB instances on R-Car V4H have registers related to UDP/IP support, but the declared register blocks for the first two instances are too small to cover them.
Fix this by extending the register block sizes.
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +2 -2
@@ -767,7 +767,7 @@ channel7 { avb0: ethernet@e6800000 { compatible = "renesas,etheravb-r8a779g0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6800000 0 0x800>; + reg = <0 0xe6800000 0 0x1000>; interrupts = <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>,
@@ -814,7 +814,7 @@ avb0: ethernet@e6800000 { avb1: ethernet@e6810000 { compatible = "renesas,etheravb-r8a779g0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6810000 0 0x800>; + reg = <0 0xe6810000 0 0x1000>; interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0