6.12.58-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 298/565 ALSA: usb-audio: apply quirk for MOONDROP Quark2
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cryolitia PukNgae <[email protected]>
[ Upstream commit a73349c5dd27bc544b048e2e2c8ef6394f05b793 ]
It reports a MIN value -15360 for volume control, but will mute when setting it less than -14208
--- sound/usb/mixer.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/usb/mixer.c +7 -0
@@ -1191,6 +1191,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, cval->res =1 ; }break ; +case USB_ID (0x3302 ,0x12db ):/* MOONDROP Quark2 */ +if (!strcmp (kctl->id.name,"PCM Playback Volume" )) { +usb_audio_info (chip, +"set volume quirk for MOONDROP Quark2\n" ); + cval->min =-14208 ;/* Mute under it */ + } +break ; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 299/565 PCI: imx6: Enable the Vaux supply if available
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Zhu <[email protected]>
[ Upstream commit c221cbf8dc547eb8489152ac62ef103fede99545 ]
When the 3.3Vaux supply is present, fetch it at the probe time and keep it enabled for the entire PCIe controller lifecycle so that the link can enter L2 state and the devices can signal wakeup using either Beacon or WAKE# mechanisms.
--- drivers/pci/controller/dwc/pci-imx6.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pci/controller/dwc/pci-imx6.c +4 -0
@@ -1487,6 +1487,10 @@ static int imx_pcie_probe(struct platform_device *pdev) pci->max_link_speed =1 ;of_property_read_u32 (node,"fsl,max-link-speed" , &pci->max_link_speed); + ret =devm_regulator_get_enable_optional (&pdev->dev,"vpcie3v3aux" ); +if (ret <0 && ret != -ENODEV ) +return dev_err_probe (dev, ret,"failed to enable Vaux supply\n" ); + imx_pcie->vpcie =devm_regulator_get_optional (&pdev->dev,"vpcie" );if (IS_ERR (imx_pcie->vpcie)) {if (PTR_ERR (imx_pcie->vpcie) != -ENODEV )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 300/565 drm/xe/guc: Set upper limit of H2G retries over CTB
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 2506af5f8109a387a5e8e9e3d7c498480b8033db ]
The GuC communication protocol allows GuC to send NO_RESPONSE_RETRY reply message to indicate that due to some interim condition it can not handle incoming H2G request and the host shall resend it.
But in some cases, due to errors, this unsatisfied condition might be final and this could lead to endless retries as it was recently seen on the CI:
[drm] GT0: PF: VF1 FLR didn't finish in 5000 ms (-ETIMEDOUT) [drm] GT0: PF: VF1 resource sanitizing failed (-ETIMEDOUT) [drm] GT0: PF: VF1 FLR failed!
[drm:guc_ct_send_recv [xe]] GT0: H2G action 0x5503 retrying: reason 0x0 [drm:guc_ct_send_recv [xe]] GT0: H2G action 0x5503 retrying: reason 0x0 [drm:guc_ct_send_recv [xe]] GT0: H2G action 0x5503 retrying: reason 0x0 [drm:guc_ct_send_recv [xe]] GT0: H2G action 0x5503 retrying: reason 0x0
To avoid such dangerous loops allow only limited number of retries (for now 50) and add some delays (n * 5ms) to slow down the rate of resending this repeated request.
--- drivers/gpu/drm/xe/xe_guc_ct.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/xe/xe_guc_ct.c +10 -0
@@ -977,11 +977,15 @@ static bool retry_failure(struct xe_guc_ct *ct, int ret)return true; } +#define GUC_SEND_RETRY_LIMIT 50 +#define GUC_SEND_RETRY_MSLEEP 5 +static int guc_ct_send_recv (struct xe_guc_ct *ct,const u32 *action,u32 len,u32 *response_buffer,bool no_fail) {struct xe_gt *gt =ct_to_gt (ct);struct g2h_fence g2h_fence; +unsigned int retries =0 ;int ret =0 ;/*
@@ -1065,6 +1069,12 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,xe_gt_dbg (gt,"H2G action %#x retrying: reason %#x\n" , action[0 ], g2h_fence.reason);mutex_unlock (&ct->lock); +if (++retries >GUC_SEND_RETRY_LIMIT ) { +xe_gt_err (gt,"H2G action %#x reached retry limit=%u, aborting\n" , + action[0 ],GUC_SEND_RETRY_LIMIT ); +return -ELOOP ; + } +msleep (GUC_SEND_RETRY_MSLEEP * retries); goto retry; }if (g2h_fence.fail) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 301/565 net: call cond_resched() less often in __release_sock()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 16c610162d1f1c332209de1c91ffb09b659bb65d ]
While stress testing TCP I had unexpected retransmits and sack packets when a single cpu receives data from multiple high-throughput flows.
super_netperf 4 -H srv -T,10 -l 3000 &
Tcpdump extract:
00:00:00.000007 IP6 clnt > srv: Flags [.], seq 26062848:26124288, ack 1, win 66, options [nop,nop,TS val 651460834 ecr 3100749131], length 61440 00:00:00.000006 IP6 clnt > srv: Flags [.], seq 26124288:26185728, ack 1, win 66, options [nop,nop,TS val 651460834 ecr 3100749131], length 61440 00:00:00.000005 IP6 clnt > srv: Flags [P.], seq 26185728:26243072, ack 1, win 66, options [nop,nop,TS val 651460834 ecr 3100749131], length 57344 00:00:00.000006 IP6 clnt > srv: Flags [.], seq 26243072:26304512, ack 1, win 66, options [nop,nop,TS val 651460844 ecr 3100749141], length 61440 00:00:00.000005 IP6 clnt > srv: Flags [.], seq 26304512:26365952, ack 1, win 66, options [nop,nop,TS val 651460844 ecr 3100749141], length 61440 00:00:00.000007 IP6 clnt > srv: Flags [P.], seq 26365952:26423296, ack 1, win 66, options [nop,nop,TS val 651460844 ecr 3100749141], length 57344 00:00:00.000006 IP6 clnt > srv: Flags [.], seq 26423296:26484736, ack 1, win 66, options [nop,nop,TS val 651460853 ecr 3100749150], length 61440 00:00:00.000005 IP6 clnt > srv: Flags [.], seq 26484736:26546176, ack 1, win 66, options [nop,nop,TS val 651460853 ecr 3100749150], length 61440 00:00:00.000005 IP6 clnt > srv: Flags [P.], seq 26546176:26603520, ack 1, win 66, options [nop,nop,TS val 651460853 ecr 3100749150], length 57344 00:00:00.003932 IP6 clnt > srv: Flags [P.], seq 26603520:26619904, ack 1, win 66, options [nop,nop,TS val 651464844 ecr 3100753141], length 16384 00:00:00.006602 IP6 clnt > srv: Flags [.], seq 24862720:24866816, ack 1, win 66, options [nop,nop,TS val 651471419 ecr 3100759716], length 4096 00:00:00.013000 IP6 clnt > srv: Flags [.], seq 24862720:24866816, ack 1, win 66, options [nop,nop,TS val 651484421 ecr 3100772718], length 4096 00:00:00.000416 IP6 srv > clnt: Flags [.], ack 26619904, win 1393, options [nop,nop,TS val 3100773185 ecr 651484421,nop,nop,sack 1 {24862720:24866816}], length 0
After analysis, it appears this is because of the cond_resched() call from __release_sock().
When current thread is yielding, while still holding the TCP socket lock, it might regain the cpu after a very long time.
Other peer TLP/RTO is firing (multiple times) and packets are retransmit, while the initial copy is waiting in the socket backlog or receive queue.
In this patch, I call cond_resched() only once every 16 packets.
Modern TCP stack now spends less time per packet in the backlog, especially because ACK are no longer sent (commit 133c4c0d3717 "tcp: defer regular ACK while processing socket backlog")
Before:
clnt:/# nstat -n;sleep 10;nstat|egrep "TcpOutSegs|TcpRetransSegs|TCPFastRetrans|TCPTimeouts|Probes|TCPSpuriousRTOs|DSACK" TcpOutSegs 19046186 0.0 TcpRetransSegs 1471 0.0 TcpExtTCPTimeouts 1397 0.0 TcpExtTCPLossProbes 1356 0.0 TcpExtTCPDSACKRecv 1352 0.0 TcpExtTCPSpuriousRTOs 114 0.0 TcpExtTCPDSACKRecvSegs 1352 0.0
After:
clnt:/# nstat -n;sleep 10;nstat|egrep "TcpOutSegs|TcpRetransSegs|TCPFastRetrans|TCPTimeouts|Probes|TCPSpuriousRTOs|DSACK" TcpOutSegs 19218936 0.0
--- net/core/sock.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/core/sock.c +8 -4
@@ -3093,23 +3093,27 @@ void __release_sock(struct sock *sk) __acquires(&sk->sk_lock.slock) {struct sk_buff *skb, *next; +int nb =0 ;while ((skb = sk->sk_backlog.head) !=NULL ) { sk->sk_backlog.head = sk->sk_backlog.tail =NULL ;spin_unlock_bh (&sk->sk_lock.slock); -do { +while (1 ) { next = skb->next;prefetch (next);DEBUG_NET_WARN_ON_ONCE (skb_dst_is_noref (skb));skb_mark_not_on_list (skb);sk_backlog_rcv (sk, skb); -cond_resched (); - skb = next; - }while (skb !=NULL ); +if (!skb) +break ; + +if (!(++nb &15 )) +cond_resched (); + }spin_lock_bh (&sk->sk_lock.slock); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 302/565 smsc911x: add second read of EEPROM mac when possible corruption seen
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Foster <[email protected]>
[ Upstream commit 69777753a8919b0b8313c856e707e1d1fe5ced85 ]
When the EEPROM MAC is read by way of ADDRH, it can return all 0s the first time. Subsequent reads succeed.
This is fully reproduceable on the Phytec PCM049 SOM.
Re-read the ADDRH when this behaviour is observed, in an attempt to correctly apply the EEPROM MAC address.
--- drivers/net/ethernet/smsc/smsc911x.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +12 -2
@@ -2163,10 +2163,20 @@ static const struct net_device_ops smsc911x_netdev_ops = {static void smsc911x_read_mac_address (struct net_device *dev) {struct smsc911x_data *pdata =netdev_priv (dev); -u32 mac_high16 =smsc911x_mac_read (pdata,ADDRH ); -u32 mac_low32 =smsc911x_mac_read (pdata,ADDRL ); +u32 mac_high16, mac_low32;u8 addr[ETH_ALEN ]; + mac_high16 =smsc911x_mac_read (pdata,ADDRH ); + mac_low32 =smsc911x_mac_read (pdata,ADDRL ); + +/* The first mac_read in some setups can incorrectly read 0. Re-read it +* to get the full MAC if this is observed. +*/ +if (mac_high16 ==0 ) { +SMSC_TRACE (pdata, probe,"Re-read MAC ADDRH\n" ); + mac_high16 =smsc911x_mac_read (pdata,ADDRH ); + } + addr[0 ] = (u8)(mac_low32); addr[1 ] = (u8)(mac_low32 >>8 ); addr[2 ] = (u8)(mac_low32 >>16 );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 303/565 iommu/amd: Skip enabling command/event buffers for kdump
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ashish Kalra <[email protected]>
[ Upstream commit 9be15fbfc6c5c89c22cf6e209f66ea43ee0e58bb ]
After a panic if SNP is enabled in the previous kernel then the kdump kernel boots with IOMMU SNP enforcement still enabled.
IOMMU command buffers and event buffer registers remain locked and exclusive to the previous kernel. Attempts to enable command and event buffers in the kdump kernel will fail, as hardware ignores writes to the locked MMIO registers as per AMD IOMMU spec Section 2.12.2.1.
Skip enabling command buffers and event buffers for kdump boot as they are already enabled in the previous kernel.
--- drivers/iommu/amd/init.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/iommu/amd/init.c +19 -9
@@ -816,11 +816,16 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu)BUG_ON (iommu->cmd_buf ==NULL ); - entry =iommu_virt_to_phys (iommu->cmd_buf); - entry |=MMIO_CMD_SIZE_512 ; - -memcpy_toio (iommu->mmio_base +MMIO_CMD_BUF_OFFSET , - &entry,sizeof (entry)); +if (!is_kdump_kernel ()) { +/* +* Command buffer is re-used for kdump kernel and setting +* of MMIO register is not required. +*/ + entry =iommu_virt_to_phys (iommu->cmd_buf); + entry |=MMIO_CMD_SIZE_512 ; +memcpy_toio (iommu->mmio_base +MMIO_CMD_BUF_OFFSET , + &entry,sizeof (entry)); + }amd_iommu_reset_cmd_buffer (iommu); }
@@ -869,10 +874,15 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu)BUG_ON (iommu->evt_buf ==NULL ); - entry =iommu_virt_to_phys (iommu->evt_buf) |EVT_LEN_MASK ; - -memcpy_toio (iommu->mmio_base +MMIO_EVT_BUF_OFFSET , - &entry,sizeof (entry)); +if (!is_kdump_kernel ()) { +/* +* Event buffer is re-used for kdump kernel and setting +* of MMIO register is not required. +*/ + entry =iommu_virt_to_phys (iommu->evt_buf) |EVT_LEN_MASK ; +memcpy_toio (iommu->mmio_base +MMIO_EVT_BUF_OFFSET , + &entry,sizeof (entry)); + }/* set head and tail to zero manually */ writel (0x00 , iommu->mmio_base +MMIO_EVT_HEAD_OFFSET );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 304/565 crypto: ccp: Skip SEV and SNP INIT for kdump boot
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ashish Kalra <[email protected]>
[ Upstream commit 8c571019d8a817b701888926529a5d7a826b947b ]
Since SEV or SNP may already be initialized in the previous kernel, attempting to initialize them again in the kdump kernel can result in SNP initialization failures, which in turn lead to IOMMU initialization failures. Moreover, SNP/SEV guests are not run under a kdump kernel, so there is no need to initialize SEV or SNP during kdump boot.
Skip SNP and SEV INIT if doing kdump boot.
--- drivers/crypto/ccp/sev-dev.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/crypto/ccp/sev-dev.c +10 -0
@@ -28,6 +28,7 @@#include <linux/fs_struct.h> #include <linux/psp.h> #include <linux/amd-iommu.h> +#include <linux/crash_dump.h> #include <asm/smp.h> #include <asm/cacheflush.h>
@@ -1314,6 +1315,15 @@ static int _sev_platform_init_locked(struct sev_platform_init_args *args)if (!psp_master || !psp_master->sev_data)return -ENODEV ; +/* +* Skip SNP/SEV initialization under a kdump kernel as SEV/SNP +* may already be initialized in the previous kernel. Since no +* SNP/SEV guests are run under a kdump kernel, there is no +* need to initialize SNP or SEV during kdump boot. +*/ +if (is_kdump_kernel ()) +return 0 ; + sev = psp_master->sev_data;if (sev->state ==SEV_STATE_INIT )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 305/565 iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit ecf6508923f87e4597228f70cc838af3d37f6662 ]
These registers exist and at least on the t602x variant the IRQ only clears when theses are cleared.
--- drivers/iommu/apple-dart.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/iommu/apple-dart.c +5 -0
@@ -122,6 +122,8 @@#define DART_T8110_ERROR_ADDR_LO 0x170#define DART_T8110_ERROR_ADDR_HI 0x174 +#define DART_T8110_ERROR_STREAMS 0x1c0 +#define DART_T8110_PROTECT 0x200#define DART_T8110_UNPROTECT 0x204#define DART_T8110_PROTECT_LOCK 0x208
@@ -1073,6 +1075,9 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev) error, stream_idx, error_code, fault_name, addr);writel (error, dart->regs +DART_T8110_ERROR ); +for (int i =0 ; i <BITS_TO_U32 (dart->num_streams); i++) +writel (U32_MAX , dart->regs +DART_T8110_ERROR_STREAMS +4 * i); +return IRQ_HANDLED ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 306/565 drm/amd: add more cyan skillfish PCI ids
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 1e18746381793bef7c715fc5ec5611a422a75c4c ]
Add additional PCI IDs to the cyan skillfish family.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
@@ -2135,6 +2135,11 @@ static const struct pci_device_id pciidlist[] = { {0x1002, 0x7410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ALDEBARAN},/* CYAN_SKILLFISH */ + {0x1002, 0x13DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, + {0x1002, 0x13F9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, + {0x1002, 0x13FA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, + {0x1002, 0x13FB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, + {0x1002, 0x13FC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, {0x1002, 0x13FE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU}, {0x1002, 0x143F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 307/565 drm/amdgpu: dont enable SMU on cyan skillfish
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 94bd7bf2c920998b4c756bc8a54fd3dbdf7e4360 ]
Cyan skillfish uses different SMU firmware.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -1
@@ -2040,13 +2040,16 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (11 ,0 ,5 ):case IP_VERSION (11 ,0 ,9 ):case IP_VERSION (11 ,0 ,7 ): -case IP_VERSION (11 ,0 ,8 ):case IP_VERSION (11 ,0 ,11 ):case IP_VERSION (11 ,0 ,12 ):case IP_VERSION (11 ,0 ,13 ):case IP_VERSION (11 ,5 ,0 ):amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block);break ; +case IP_VERSION (11 ,0 ,8 ): +if (adev->apu_flags &AMD_APU_IS_CYAN_SKILLFISH2 ) +amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block); +break ;case IP_VERSION (12 ,0 ,0 ):case IP_VERSION (12 ,0 ,1 ):amdgpu_device_ip_block_add (adev, &smu_v12_0_ip_block);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 308/565 drm/amdgpu: add support for cyan skillfish gpu_info
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit fa819e3a7c1ee994ce014cc5a991c7fd91bc00f1 ]
Some SOCs which are part of the cyan skillfish family rely on an explicit firmware for IP discovery. Add support for the gpu_info firmware.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -0
@@ -93,6 +93,7 @@ MODULE_FIRMWARE("amdgpu/picasso_gpu_info.bin");MODULE_FIRMWARE ("amdgpu/raven2_gpu_info.bin" );MODULE_FIRMWARE ("amdgpu/arcturus_gpu_info.bin" );MODULE_FIRMWARE ("amdgpu/navi12_gpu_info.bin" ); +MODULE_FIRMWARE ("amdgpu/cyan_skillfish_gpu_info.bin" );#define AMDGPU_RESUME_MS 2000#define AMDGPU_MAX_RETRY_LIMIT 2
@@ -2412,6 +2413,9 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)return 0 ; chip_name ="navi12" ;break ; +case CHIP_CYAN_SKILLFISH : + chip_name ="cyan_skillfish" ; +break ; } err = amdgpu_ucode_request(adev, &adev->firmware.gpu_info_fw,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 309/565 drm/amd/display: Fix pbn_div Calculation Error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fangzhi Zuo <[email protected]>
[ Upstream commit 12cdfb61b32a7be581ec5932e0b6a482cb098204 ]
[Why]dm_mst_get_pbn_divider() returns value integer coming from
the cast from fixed point, but the casted integer will then be used in dfixed_const to be multiplied by 4096. The cast from fixed point to integer causes the calculation error becomes bigger when multiplied by 4096.
That makes the calculated pbn_div value becomes smaller than it should be, which leads to the req_slot number becomes bigger.
Such error is getting reflected in 8k30 timing,
where the correct and incorrect calculated req_slot 62.9 Vs 63.1. That makes the wrong calculation failed to light up 8k30 after a dock under HBR3 x 4.
[How]
Restore the accuracy by keeping the fraction part
calculated for the left shift operation.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 ++++++++++--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -7715,7 +7715,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,if (IS_ERR (mst_state))return PTR_ERR (mst_state); - mst_state->pbn_div.full =dfixed_const (dm_mst_get_pbn_divider (aconnector->mst_root->dc_link)); + mst_state->pbn_div.full =dm_mst_get_pbn_divider (aconnector->mst_root->dc_link);if (!state->duplicated) {int max_bpc = conn_state->max_requested_bpc;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -3
@@ -816,13 +816,20 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,drm_connector_attach_dp_subconnector_property (&aconnector->base); } -int dm_mst_get_pbn_divider (struct dc_link *link) +uint32_t dm_mst_get_pbn_divider (struct dc_link *link) { +uint32_t pbn_div_x100; +uint64_t dividend, divisor; +if (!link)return 0 ; -return dc_link_bandwidth_kbps (link, -dc_link_get_link_cap (link)) / (8 *1000 *54 ); + dividend = (uint64_t )dc_link_bandwidth_kbps (link,dc_link_get_link_cap (link)) *100 ; + divisor =8 *1000 *54 ; + + pbn_div_x100 =div64_u64 (dividend, divisor); + +return dfixed_const (pbn_div_x100) /100 ; }struct dsc_mst_fairness_params {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +1 -1
@@ -59,7 +59,7 @@ enum mst_msg_ready_type {struct amdgpu_display_manager ;struct amdgpu_dm_connector ; -int dm_mst_get_pbn_divider (struct dc_link *link); +uint32_t dm_mst_get_pbn_divider (struct dc_link *link); void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 310/565 net: dsa: felix: support phy-mode = "10g-qxgmii"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
[ Upstream commit 6f616757dd306fce4b55131df23737732e347d8f ]
The "usxgmii" phy-mode that the Felix switch ports support on LS1028A is not quite USXGMII, it is defined by the USXGMII multiport specification document as 10G-QXGMII. It uses the same signaling as USXGMII, but it multiplexes 4 ports over the link, resulting in a maximum speed of 2.5G per port.
This change is needed in preparation for the lynx-10g SerDes driver on LS1028A, which will make a more clear distinction between usxgmii (supported on lane 0) and 10g-qxgmii (supported on lane 1). These protocols have their configuration in different PCCR registers (PCCRB vs PCCR9).
Continue parsing and supporting single-port-per-lane USXGMII when found in the device tree as usual (because it works), but add support for 10G-QXGMII too. Using phy-mode = "10g-qxgmii" will be required when modifying the device trees to specify a "phys" phandle to the SerDes lane. The result when the "phys" phandle is present but the phy-mode is wrong is undefined.
The only PHY driver in known use with this phy-mode, AQR412C, will gain logic to transition from "usxgmii" to "10g-qxgmii" in a future change. Prepare the driver by also setting PHY_INTERFACE_MODE_10G_QXGMII in supported_interfaces when PHY_INTERFACE_MODE_USXGMII is there, to prevent breakage with existing device trees.
--- drivers/net/dsa/ocelot/felix.c | 4 ++++ drivers/net/dsa/ocelot/felix.h | 3 ++- drivers/net/dsa/ocelot/felix_vsc9959.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/dsa/ocelot/felix.c +4 -0
@@ -1153,6 +1153,9 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port,__set_bit (ocelot->ports[port]->phy_mode, config->supported_interfaces); +if (ocelot->ports[port]->phy_mode ==PHY_INTERFACE_MODE_USXGMII ) +__set_bit (PHY_INTERFACE_MODE_10G_QXGMII , + config->supported_interfaces); } static void felix_phylink_mac_config(struct phylink_config *config,
@@ -1351,6 +1354,7 @@ static const u32 felix_phy_match_table[PHY_INTERFACE_MODE_MAX] = { [PHY_INTERFACE_MODE_SGMII] = OCELOT_PORT_MODE_SGMII, [PHY_INTERFACE_MODE_QSGMII] = OCELOT_PORT_MODE_QSGMII, [PHY_INTERFACE_MODE_USXGMII] = OCELOT_PORT_MODE_USXGMII, + [PHY_INTERFACE_MODE_10G_QXGMII] = OCELOT_PORT_MODE_10G_QXGMII, [PHY_INTERFACE_MODE_1000BASEX] = OCELOT_PORT_MODE_1000BASEX, [PHY_INTERFACE_MODE_2500BASEX] = OCELOT_PORT_MODE_2500BASEX, };
drivers/net/dsa/ocelot/felix.h +2 -1
@@ -12,8 +12,9 @@#define OCELOT_PORT_MODE_SGMII BIT(1)#define OCELOT_PORT_MODE_QSGMII BIT(2)#define OCELOT_PORT_MODE_2500BASEX BIT(3) -#define OCELOT_PORT_MODE_USXGMII BIT(4) +#define OCELOT_PORT_MODE_USXGMII BIT(4)/* compatibility */ #define OCELOT_PORT_MODE_1000BASEX BIT(5) +#define OCELOT_PORT_MODE_10G_QXGMII BIT(6)struct device_node ;
drivers/net/dsa/ocelot/felix_vsc9959.c +2 -1
@@ -34,7 +34,8 @@ OCELOT_PORT_MODE_QSGMII | \ OCELOT_PORT_MODE_1000BASEX | \ OCELOT_PORT_MODE_2500BASEX | \ - OCELOT_PORT_MODE_USXGMII) + OCELOT_PORT_MODE_USXGMII | \ + OCELOT_PORT_MODE_10G_QXGMII)static const u32 vsc9959_port_modes[VSC9959_NUM_PORTS ] = {VSC9959_PORT_MODE_SERDES ,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 311/565 usb: gadget: f_hid: Fix zero length packet transfer
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: William Wu <[email protected]>
[ Upstream commit ed6f727c575b1eb8136e744acfd5e7306c9548f6 ]
Set the hid req->zero flag of ep0/in_ep to true by default, then the UDC drivers can transfer a zero length packet at the end if the hid transfer with size divisible to EPs max packet size according to the USB 2.0 spec.
--- drivers/usb/gadget/function/f_hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_hid.c +2 -2
@@ -526,7 +526,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, } req->status =0 ; - req->zero =0 ; + req->zero =1 ; req->length = count; req->complete = f_hidg_req_complete; req->context = hidg;
@@ -982,7 +982,7 @@ static int hidg_setup(struct usb_function *f,return -EOPNOTSUPP ; respond: - req->zero =0 ; + req->zero =1 ; req->length = length; status =usb_ep_queue (cdev->gadget->ep0, req,GFP_ATOMIC );if (status <0 )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 312/565 usb: cdns3: gadget: Use-after-free during failed initialization and exit of cdnsp gadget
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Yufeng <[email protected]>
[ Upstream commit 87c5ff5615dc0a37167e8faf3adeeddc6f1344a3 ]
In the __cdnsp_gadget_init() and cdnsp_gadget_exit() functions, the gadget structure (pdev->gadget) was freed before its endpoints.
The endpoints are linked via the ep_list in the gadget structure. Freeing the gadget first leaves dangling pointers in the endpoint list. When the endpoints are subsequently freed, this results in a use-after-free.
Fix:
By separating the usb_del_gadget_udc() operation into distinct "del" and "put" steps, cdnsp_gadget_free_endpoints() can be executed prior to the final release of the gadget structure with usb_put_gadget().
A patch similar to bb9c74a5bd14("usb: dwc3: gadget: Free gadget structure
only after freeing endpoints").
--- drivers/usb/cdns3/cdnsp-gadget.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/usb/cdns3/cdnsp-gadget.c +6 -2
@@ -1975,7 +1975,10 @@ static int __cdnsp_gadget_init(struct cdns *cdns)return 0 ; del_gadget: -usb_del_gadget_udc (&pdev->gadget); +usb_del_gadget (&pdev->gadget); +cdnsp_gadget_free_endpoints (pdev); +usb_put_gadget (&pdev->gadget); + goto halt_pdev; free_endpoints:cdnsp_gadget_free_endpoints (pdev); halt_pdev:
@@ -1997,8 +2000,9 @@ static void cdnsp_gadget_exit(struct cdns *cdns)devm_free_irq (pdev->dev, cdns->dev_irq, pdev);pm_runtime_mark_last_busy (cdns->dev);pm_runtime_put_autosuspend (cdns->dev); -usb_del_gadget_udc (&pdev->gadget); +usb_del_gadget (&pdev->gadget);cdnsp_gadget_free_endpoints (pdev); +usb_put_gadget (&pdev->gadget);cdnsp_mem_cleanup (pdev);kfree (pdev); cdns->gadget_dev =NULL ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 313/565 tty/vt: Add missing return value for VT_RESIZE in vt_ioctl()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <[email protected]>
[ Upstream commit da7e8b3823962b13e713d4891e136a261ed8e6a2 ]
In vt_ioctl(), the handler for VT_RESIZE always returns 0, which prevents users from detecting errors. Add the missing return value so that errors can be properly reported to users like vt_resizex().
--- drivers/tty/vt/vt_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/vt/vt_ioctl.c +3 -1
@@ -923,7 +923,9 @@ int vt_ioctl(struct tty_struct *tty,if (vc) {/* FIXME: review v tty lock */ -__vc_resize (vc_cons[i].d, cc, ll, true); + ret =__vc_resize (vc_cons[i].d, cc, ll, true); +if (ret) +return ret; } }console_unlock ();
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 314/565 drm/msm: make sure to not queue up recovery more than once
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antonino Maniscalco <[email protected]>
[ Upstream commit 10fb1b2fcaee5545a5e54db1ed4d7b15c2db50c8 ]
If two fault IRQs arrive in short succession recovery work will be queued up twice.
When recovery runs a second time it may end up killing an unrelated context.
Prevent this by masking off interrupts when triggering recovery.
Patchwork: https://patchwork.freedesktop.org/patch/670023/
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +3 -0
@@ -1522,6 +1522,9 @@ static void a6xx_fault_detect_irq(struct msm_gpu *gpu)/* Turn off the hangcheck timer to keep it from bothering us */ del_timer (&gpu->hangcheck_timer); +/* Turn off interrupts to avoid triggering recovery again */ +gpu_write (gpu,REG_A6XX_RBBM_INT_0_MASK ,0 ); +kthread_queue_work (gpu->worker, &gpu->recover_work); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 315/565 char: Use list_del_init() in misc_deregister() to reinitialize list pointer
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xion Wang <[email protected]>
[ Upstream commit e28022873c0d051e980c4145f1965cab5504b498 ]
Currently, misc_deregister() uses list_del() to remove the device from the list. After list_del(), the list pointers are set to LIST_POISON1 and LIST_POISON2, which may help catch use-after-free bugs, but does not reset the list head.
If misc_deregister() is called more than once on the same device, list_empty() will not return true, and list_del() may be called again, leading to undefined behavior.
Replace list_del() with list_del_init() to reinitialize the list head after deletion. This makes the code more robust against double deregistration and allows safe usage of list_empty() on the miscdevice after deregistration.
[ Note, this seems to keep broken out-of-tree drivers from doing foolish
things. While this does not matter for any in-kernel drivers, external drivers could use a bit of help to show them they shouldn't be doing stuff like re-registering misc devices - gregkh ]
--- drivers/char/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/misc.c +1 -1
@@ -299,7 +299,7 @@ void misc_deregister(struct miscdevice *misc)return ;mutex_lock (&misc_mtx); -list_del (&misc->list); +list_del_init (&misc->list);device_destroy (&misc_class,MKDEV (MISC_MAJOR , misc->minor));misc_minor_free (misc->minor);if (misc->minor >MISC_DYNAMIC_MINOR )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 316/565 PCI: endpoint: pci-epf-test: Limit PCIe BAR size for fixed BARs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit d5f6bd3ee3f5048f272182dc91675c082773999e ]
Currently, the test allocates BAR sizes according to fixed table bar_size. This does not work with controllers which have fixed size BARs that are smaller than the requested BAR size. One such controller is Renesas R-Car V4H PCIe controller, which has BAR4 size limited to 256 bytes, which is much less than one of the BAR size, 131072 currently requested by this test. A lot of controllers drivers in-tree have fixed size BARs, and they do work perfectly fine, but it is only because their fixed size is larger than the size requested by pci-epf-test.c
Adjust the test such that in case a fixed size BAR is detected, the fixed BAR size is used, as that is the only possible option.
This helps with test failures reported as follows:
pci_epf_test pci_epf_test.0: requested BAR size is larger than fixed size pci_epf_test pci_epf_test.0: Failed to allocate space for BAR4
--- drivers/pci/endpoint/functions/pci-epf-test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +6 -1
@@ -860,7 +860,12 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)if (bar == test_reg_bar)continue ; - base =pci_epf_alloc_space (epf, bar_size[bar], bar, +if (epc_features->bar[bar].type ==BAR_FIXED ) + test_reg_size = epc_features->bar[bar].fixed_size; +else + test_reg_size = bar_size[bar]; + + base =pci_epf_alloc_space (epf, test_reg_size, bar, epc_features,PRIMARY_INTERFACE );if (!base) dev_err(dev, "Failed to allocate space for BAR%d\n",
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 317/565 wifi: iwlwifi: fw: Add ASUS to PPAG and TAS list
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nidhish A N <[email protected]>
[ Upstream commit c5318e6e1c6436ce35ba521d96975e13cc5119f7 ]
Add ASUS to the list of OEMs that are allowed to use the PPAG and TAS feature.
--- drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +12 -2
@@ -57,11 +57,16 @@ static const struct dmi_system_id dmi_ppag_approved_list[] = {DMI_MATCH (DMI_SYS_VENDOR ,"Microsoft Corporation" ), }, }, - { .ident = "ASUS", + { .ident = "ASUSTEK", .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), }, }, + { .ident = "ASUS", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUS" ), + }, + }, { .ident = "GOOGLE-HP", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Google"),
@@ -134,11 +139,16 @@ static const struct dmi_system_id dmi_tas_approved_list[] = {DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), }, }, - { .ident = "ASUS", + { .ident = "ASUSTEK", .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), }, }, + { .ident = "ASUS", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUS" ), + }, + }, { .ident = "GOOGLE-HP", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Google"),
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 318/565 media: ov08x40: Fix the horizontal flip control
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Yao <[email protected]>
[ Upstream commit c7df6f339af94689fdc433887f9fbb480bf8a4ed ]
The datasheet of ov08x40 doesn't match the hardware behavior. 0x3821[2] == 1 is the original state and 0 the horizontal flip enabled.
--- drivers/media/i2c/ov08x40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov08x40.c +1 -1
@@ -1564,7 +1564,7 @@ static int ov08x40_set_ctrl_hflip(struct ov08x40 *ov08x, u32 ctrl_val)return ov08x40_write_reg (ov08x,OV08X40_REG_MIRROR ,OV08X40_REG_VALUE_08BIT , - ctrl_val ? val |BIT (2 ) : val & ~BIT (2 )); + ctrl_val ? val & ~BIT (2 ) : val |BIT (2 )); }static int ov08x40_set_ctrl_vflip (struct ov08x40 *ov08x,u32 ctrl_val)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 319/565 media: i2c: og01a1b: Specify monochrome media bus format instead of Bayer
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit bfbd5aa5347fbd11ade188b316b800bfb27d9e22 ]
The OmniVision OG01A1B image sensor is a monochrome sensor, it supports 8-bit and 10-bit RAW output formats only.
That said the planar greyscale Y8/Y10 media formats are more appropriate for the sensor instead of the originally and arbitrary selected SGRBG one, since there is no red, green or blue color components.
--- drivers/media/i2c/og01a1b.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/i2c/og01a1b.c +3 -3
@@ -682,7 +682,7 @@ static void og01a1b_update_pad_format(const struct og01a1b_mode *mode, { fmt->width = mode->width; fmt->height = mode->height; - fmt->code =MEDIA_BUS_FMT_SGRBG10_1X10 ; + fmt->code =MEDIA_BUS_FMT_Y10_1X10 ; fmt->field =V4L2_FIELD_NONE ; }
@@ -828,7 +828,7 @@ static int og01a1b_enum_mbus_code(struct v4l2_subdev *sd,if (code->index >0 )return -EINVAL ; - code->code =MEDIA_BUS_FMT_SGRBG10_1X10 ; + code->code =MEDIA_BUS_FMT_Y10_1X10 ;return 0 ; }
@@ -840,7 +840,7 @@ static int og01a1b_enum_frame_size(struct v4l2_subdev *sd,if (fse->index >=ARRAY_SIZE (supported_modes))return -EINVAL ; -if (fse->code !=MEDIA_BUS_FMT_SGRBG10_1X10 ) +if (fse->code !=MEDIA_BUS_FMT_Y10_1X10 )return -EINVAL ; fse->min_width = supported_modes[fse->index].width;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 320/565 f2fs: fix wrong layout information on 16KB page
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaegeuk Kim <[email protected]>
[ Upstream commit a33be64b98d0723748d2fab0832b926613e1fce0 ]
This patch fixes to support different block size.
--- fs/f2fs/sysfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
fs/f2fs/sysfs.c +6 -3
@@ -1623,12 +1623,15 @@ static int __maybe_unused disk_map_seq_show(struct seq_file *seq,seq_printf (seq," Main : 0x%010x (%10d)\n" ,SM_I (sbi)->main_blkaddr,le32_to_cpu (F2FS_RAW_SUPER (sbi)->segment_count_main)); -seq_printf (seq," # of Sections : %12d\n" , -le32_to_cpu (F2FS_RAW_SUPER (sbi)->section_count)); +seq_printf (seq," Block size : %12lu KB\n" ,F2FS_BLKSIZE >>10 ); +seq_printf (seq," Segment size : %12d MB\n" , + (BLKS_PER_SEG (sbi) << (F2FS_BLKSIZE_BITS -10 )) >>10 );seq_printf (seq," Segs/Sections : %12d\n" ,SEGS_PER_SEC (sbi));seq_printf (seq," Section size : %12d MB\n" , -SEGS_PER_SEC (sbi) <<1 ); + (BLKS_PER_SEC (sbi) << (F2FS_BLKSIZE_BITS -10 )) >>10 ); +seq_printf (seq," # of Sections : %12d\n" , +le32_to_cpu (F2FS_RAW_SUPER (sbi)->section_count));if (!f2fs_is_multi_device (sbi))return 0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 321/565 selftests: mptcp: join: allow more time to send ADD_ADDR
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
[ Upstream commit e2cda6343bfe459c3331db5afcd675ab333112dd ]
When many ADD_ADDR need to be sent, it can take some time to send each of them, and create new subflows. Some CIs seem to occasionally have issues with these tests, especially with "debug" kernels.
Two subtests will now run for a slightly longer time: the last two where 3 or more ADD_ADDR are sent during the test.
--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +4 -2
@@ -2125,7 +2125,8 @@ signal_address_tests() pm_nl_add_endpoint $ns1 10.0.3.1 flags signal pm_nl_add_endpoint $ns1 10.0.4.1 flags signal pm_nl_set_limits $ns2 3 3 - run_tests $ns1 $ns2 10.0.1.1 + speed=slow \ + run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 3 3 3 chk_add_nr 3 3 fi
@@ -2137,7 +2138,8 @@ signal_address_tests() pm_nl_add_endpoint $ns1 10.0.3.1 flags signal pm_nl_add_endpoint $ns1 10.0.14.1 flags signal pm_nl_set_limits $ns2 3 3 - run_tests $ns1 $ns2 10.0.1.1 + speed=slow \ + run_tests $ns1 $ns2 10.0.1.1 join_syn_tx=3 \ chk_join_nr 1 1 1 chk_add_nr 3 3
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 322/565 scsi: ufs: host: mediatek: Enhance recovery on resume failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit 15ef3f5aa822f32524cba1463422a2c9372443f0 ]
Improve the recovery process for failed resume operations. Log the device's power status and return 0 if both resume and recovery fail to prevent I/O hang.
--- drivers/ufs/host/ufs-mediatek.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/ufs/host/ufs-mediatek.c +14 -1
@@ -1564,8 +1564,21 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) }return 0 ; + fail: -return ufshcd_link_recovery (hba); +/* +* Check if the platform (parent) device has resumed, and ensure that +* power, clock, and MTCMOS are all turned on. +*/ + err =ufshcd_link_recovery (hba); +if (err) { +dev_err (hba->dev,"Device PM: req=%d, status:%d, err:%d\n" , + hba->dev->power.request, + hba->dev->power.runtime_status, + hba->dev->power.runtime_error); + } + +return 0 ;/* Cannot return a failure, otherwise, the I/O will hang. */ }static void ufs_mtk_dbg_register_dump (struct ufs_hba *hba)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 323/565 scsi: ufs: host: mediatek: Fix unbalanced IRQ enable issue
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit 91cad911edd1612ed28f5cfb2d4c53a8824951a5 ]
Resolve the issue of unbalanced IRQ enablement by setting the 'is_mcq_intr_enabled' flag after the first successful IRQ enablement. Ensure proper tracking of the IRQ state and prevent potential mismatches in IRQ handling.
--- drivers/ufs/host/ufs-mediatek.c | 1 + 1 file changed, 1 insertion(+)
drivers/ufs/host/ufs-mediatek.c +1 -0
@@ -1846,6 +1846,7 @@ static int ufs_mtk_config_mcq_irq(struct ufs_hba *hba)return ret; } } + host->is_mcq_intr_enabled = true;return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 324/565 scsi: ufs: host: mediatek: Enhance recovery on hibernation exit failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit faac32d4ece30609f1a0930ca0ae951cf6dc1786 ]
Improve the recovery process for hibernation exit failures. Trigger the error handler and break the suspend operation to ensure effective recovery from hibernation errors. Activate the error handling mechanism by ufshcd_force_error_recovery and scheduling the error handler work.
--- drivers/ufs/core/ufshcd.c | 3 ++- drivers/ufs/host/ufs-mediatek.c | 14 +++++++++++--- include/ufs/ufshcd.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-)
drivers/ufs/core/ufshcd.c +2 -1
@@ -6374,13 +6374,14 @@ void ufshcd_schedule_eh_work(struct ufs_hba *hba) } } -static void ufshcd_force_error_recovery (struct ufs_hba *hba) +void ufshcd_force_error_recovery (struct ufs_hba *hba) {spin_lock_irq (hba->host->host_lock); hba->force_reset = true;ufshcd_schedule_eh_work (hba);spin_unlock_irq (hba->host->host_lock); } +EXPORT_SYMBOL_GPL (ufshcd_force_error_recovery);static void ufshcd_clk_scaling_allow (struct ufs_hba *hba,bool allow) {
drivers/ufs/host/ufs-mediatek.c +11 -3
@@ -1483,7 +1483,7 @@ static void ufs_mtk_dev_vreg_set_lpm(struct ufs_hba *hba, bool lpm) } } -static void ufs_mtk_auto_hibern8_disable (struct ufs_hba *hba) +static int ufs_mtk_auto_hibern8_disable (struct ufs_hba *hba) {int ret;
@@ -1494,8 +1494,16 @@ static void ufs_mtk_auto_hibern8_disable(struct ufs_hba *hba)ufs_mtk_wait_idle_state (hba,5 ); ret =ufs_mtk_wait_link_state (hba,VS_LINK_UP ,100 ); -if (ret) +if (ret) {dev_warn (hba->dev,"exit h8 state fail, ret=%d\n" , ret); + +ufshcd_force_error_recovery (hba); + +/* trigger error handler and break suspend */ + ret = -EBUSY ; + } + +return ret; } static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
@@ -1506,7 +1514,7 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,if (status ==PRE_CHANGE ) {if (ufshcd_is_auto_hibern8_supported (hba)) -ufs_mtk_auto_hibern8_disable (hba); +return ufs_mtk_auto_hibern8_disable (hba);return 0 ; }
include/ufs/ufshcd.h +1 -0
@@ -1487,5 +1487,6 @@ int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask);int ufshcd_write_ee_control (struct ufs_hba *hba);int ufshcd_update_ee_control (struct ufs_hba *hba,u16 *mask,const u16 *other_mask,u16 set,u16 clr); +void ufshcd_force_error_recovery (struct ufs_hba *hba);#endif /* End of Header */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 325/565 net: phy: marvell: Fix 88e1510 downshift counter errata
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rohan G Thomas <[email protected]>
[ Upstream commit deb105f49879dd50d595f7f55207d6e74dec34e6 ]
The 88e1510 PHY has an erratum where the phy downshift counter is not cleared after phy being suspended(BMCR_PDOWN set) and then later resumed(BMCR_PDOWN cleared). This can cause the gigabit link to intermittently downshift to a lower speed.
Disabling and re-enabling the downshift feature clears the counter, allowing the PHY to retry gigabit link negotiation up to the programmed retry count times before downshifting. This behavior has been observed on copper links.
--- drivers/net/phy/marvell.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/net/phy/marvell.c +38 -1
@@ -1848,6 +1848,43 @@ static int marvell_resume(struct phy_device *phydev)return err; } +/* m88e1510_resume +* +* The 88e1510 PHY has an erratum where the phy downshift counter is not cleared +* after phy being suspended(BMCR_PDOWN set) and then later resumed(BMCR_PDOWN +* cleared). This can cause the link to intermittently downshift to a lower speed. +* +* Disabling and re-enabling the downshift feature clears the counter, allowing +* the PHY to retry gigabit link negotiation up to the programmed retry count +* before downshifting. This behavior has been observed on copper links. +*/ +static int m88e1510_resume (struct phy_device *phydev) +{ +int err; +u8 cnt =0 ; + + err =marvell_resume (phydev); +if (err <0 ) +return err; + +/* read downshift counter value */ + err =m88e1011_get_downshift (phydev, &cnt); +if (err <0 ) +return err; + +if (cnt) { +/* downshift disabled */ + err =m88e1011_set_downshift (phydev,0 ); +if (err <0 ) +return err; + +/* downshift enabled, with previous counter value */ + err =m88e1011_set_downshift (phydev, cnt); + } + +return err; +} +static int marvell_aneg_done (struct phy_device *phydev) {int retval =phy_read (phydev,MII_M1011_PHY_STATUS );
@@ -3887,7 +3924,7 @@ static struct phy_driver marvell_drivers[] = { .handle_interrupt = marvell_handle_interrupt, .get_wol = m88e1318_get_wol, .set_wol = m88e1318_set_wol, - .resume = marvell_resume, + .resume = m88e1510_resume, .suspend = marvell_suspend, .read_page = marvell_read_page, .write_page = marvell_write_page,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 326/565 scsi: ufs: host: mediatek: Correct system PM flow
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit 77b96ef70b6ba46e3473e5e3a66095c4bc0e93a4 ]
Refine the system power management (PM) flow by skipping low power mode (LPM) and MTCMOS settings if runtime PM is already applied. Prevent redundant operations to ensure a more efficient PM process.
--- drivers/ufs/host/ufs-mediatek.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/ufs/host/ufs-mediatek.c +14 -3
@@ -1989,27 +1989,38 @@ static int ufs_mtk_system_suspend(struct device *dev) ret =ufshcd_system_suspend (dev);if (ret) -return ret; + goto out; + +if (pm_runtime_suspended (hba->dev)) + goto out;ufs_mtk_dev_vreg_set_lpm (hba, true);if (ufs_mtk_is_rtff_mtcmos (hba))ufs_mtk_mtcmos_ctrl (false, res); - return 0; +out: + return ret; }static int ufs_mtk_system_resume (struct device *dev) { +int ret =0 ;struct ufs_hba *hba =dev_get_drvdata (dev);struct arm_smccc_res res; +if (pm_runtime_suspended (hba->dev)) + goto out; +ufs_mtk_dev_vreg_set_lpm (hba, false);if (ufs_mtk_is_rtff_mtcmos (hba))ufs_mtk_mtcmos_ctrl (true, res); -return ufshcd_system_resume (dev); +out: + ret =ufshcd_system_resume (dev); + +return ret; }#endif
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 327/565 scsi: ufs: host: mediatek: Disable auto-hibern8 during power mode changes
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit f5ca8d0c7a6388abd5d8023cc682e1543728cc73 ]
Disable auto-hibern8 during power mode transitions to prevent unintended entry into auto-hibern8. Restore the original auto-hibern8 timer value after completing the power mode change to maintain system stability and prevent potential issues during power state transitions.
--- drivers/ufs/host/ufs-mediatek.c | 53 +++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 23 deletions(-)
drivers/ufs/host/ufs-mediatek.c +30 -23
@@ -1237,19 +1237,49 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,return ret; } +static int ufs_mtk_auto_hibern8_disable (struct ufs_hba *hba) +{ +int ret; + +/* disable auto-hibern8 */ +ufshcd_writel (hba,0 ,REG_AUTO_HIBERNATE_IDLE_TIMER ); + +/* wait host return to idle state when auto-hibern8 off */ +ufs_mtk_wait_idle_state (hba,5 ); + + ret =ufs_mtk_wait_link_state (hba,VS_LINK_UP ,100 ); +if (ret) { +dev_warn (hba->dev,"exit h8 state fail, ret=%d\n" , ret); + +ufshcd_force_error_recovery (hba); + +/* trigger error handler and break suspend */ + ret = -EBUSY ; + } + +return ret; +} +static int ufs_mtk_pwr_change_notify (struct ufs_hba *hba,enum ufs_notify_change_status stage,struct ufs_pa_layer_attr *dev_max_params,struct ufs_pa_layer_attr *dev_req_params) {int ret =0 ; +static u32 reg;switch (stage) {case PRE_CHANGE : +if (ufshcd_is_auto_hibern8_supported (hba)) { + reg =ufshcd_readl (hba,REG_AUTO_HIBERNATE_IDLE_TIMER ); +ufs_mtk_auto_hibern8_disable (hba); + } ret =ufs_mtk_pre_pwr_change (hba, dev_max_params, dev_req_params);break ;case POST_CHANGE : +if (ufshcd_is_auto_hibern8_supported (hba)) +ufshcd_writel (hba, reg,REG_AUTO_HIBERNATE_IDLE_TIMER );break ;default : ret = -EINVAL ;
@@ -1483,29 +1513,6 @@ static void ufs_mtk_dev_vreg_set_lpm(struct ufs_hba *hba, bool lpm) } } -static int ufs_mtk_auto_hibern8_disable (struct ufs_hba *hba) -{ -int ret; - -/* disable auto-hibern8 */ -ufshcd_writel (hba,0 ,REG_AUTO_HIBERNATE_IDLE_TIMER ); - -/* wait host return to idle state when auto-hibern8 off */ -ufs_mtk_wait_idle_state (hba,5 ); - - ret =ufs_mtk_wait_link_state (hba,VS_LINK_UP ,100 ); -if (ret) { -dev_warn (hba->dev,"exit h8 state fail, ret=%d\n" , ret); - -ufshcd_force_error_recovery (hba); - -/* trigger error handler and break suspend */ - ret = -EBUSY ; - } - -return ret; -} -static int ufs_mtk_suspend (struct ufs_hba *hba,enum ufs_pm_op pm_op,enum ufs_notify_change_status status) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 328/565 ntfs3: pretend $Extend records as regular files
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 4e8011ffec79717e5fdac43a7e79faf811a384b7 ]
Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()") requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/ S_IFIFO/S_IFSOCK type, use S_IFREG for $Extend records.
--- fs/ntfs3/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/ntfs3/inode.c +1 -0
@@ -471,6 +471,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) { /* Records in $Extend are not a files or general directories. */ inode->i_op = &ntfs_file_inode_operations; + mode = S_IFREG; } else { err = -EINVAL ; goto out;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 329/565 wifi: mac80211: Fix HE capabilities element check
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilan Peer <[email protected]>
[ Upstream commit ea928544f3215fdeac24d66bef85e10bb638b8c1 ]
The element data length check did not account for the extra octet used for the extension ID. Fix it.
--- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -1
@@ -5148,7 +5148,7 @@ static u8 ieee80211_max_rx_chains(struct ieee80211_link_data *link, he_cap_elem =cfg80211_find_ext_elem (WLAN_EID_EXT_HE_CAPABILITY , ies->data, ies->len); -if (!he_cap_elem || he_cap_elem->datalen <sizeof (*he_cap)) +if (!he_cap_elem || he_cap_elem->datalen <sizeof (*he_cap) +1 )return chains;/* skip one byte ext_tag_id */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 330/565 phy: cadence: cdns-dphy: Enable lower resolutions in dphy
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harikrishna Shenoy <[email protected]>
[ Upstream commit 43bd2c44515f8ee5c019ce6e6583f5640387a41b ]
Enable support for data lane rates between 80-160 Mbps cdns dphy as mentioned in TRM [0] by setting the pll_opdiv field to 16. This change enables lower resolutions like 640x480 at 60Hz.
[0]: https://www.ti.com/lit/zip/spruil1
(Table 12-552. DPHY_TX_PLL_CTRL Register Field Descriptions)
--- drivers/phy/cadence/cdns-dphy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/cadence/cdns-dphy.c +3 -1
@@ -145,7 +145,7 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy, dlane_bps = opts->hs_clk_rate; -if (dlane_bps >2500000000UL || dlane_bps <160000000UL ) +if (dlane_bps >2500000000UL || dlane_bps <80000000UL )return -EINVAL ;else if (dlane_bps >=1250000000 ) cfg->pll_opdiv =1 ;
@@ -155,6 +155,8 @@ static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy, cfg->pll_opdiv =4 ; else if (dlane_bps >= 160000000) cfg->pll_opdiv = 8; + else if (dlane_bps >= 80000000) + cfg->pll_opdiv = 16; cfg->pll_fbdiv = DIV_ROUND_UP_ULL(dlane_bps * 2 * cfg->pll_opdiv * cfg->pll_ipdiv,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 331/565 Fix access to video_is_primary_device() when compiled without CONFIG_VIDEO
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <[email protected]>
[ Upstream commit 6e490dea61b88aac9762c9f79a54aad4ea2e6cd1 ]
When compiled without CONFIG_VIDEO the architecture specific implementations of video_is_primary_device() include prototypes and assume that video-common.c will be linked. Guard against this so that the fallback inline implementation that returns false will be used when compiled without CONFIG_VIDEO.
--- arch/parisc/include/asm/video.h | 2 +- arch/sparc/include/asm/video.h | 2 ++ arch/x86/include/asm/video.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)
arch/parisc/include/asm/video.h +1 -1
@@ -6,7 +6,7 @@struct device ; -#if defined(CONFIG_STI_CORE ) +#if defined(CONFIG_STI_CORE ) && defined(CONFIG_VIDEO )bool video_is_primary_device (struct device *dev);#define video_is_primary_device video_is_primary_device#endif
arch/sparc/include/asm/video.h +2 -0
@@ -19,8 +19,10 @@ static inline pgprot_t pgprot_framebuffer(pgprot_t prot,#define pgprot_framebuffer pgprot_framebuffer#endif +#ifdef CONFIG_VIDEO bool video_is_primary_device (struct device *dev);#define video_is_primary_device video_is_primary_device +#endif static inline void fb_memcpy_fromio (void *to,const volatile void __iomem *from,size_t n) {
arch/x86/include/asm/video.h +2 -0
@@ -13,8 +13,10 @@ pgprot_t pgprot_framebuffer(pgprot_t prot, unsigned long offset);#define pgprot_framebuffer pgprot_framebuffer +#ifdef CONFIG_VIDEO bool video_is_primary_device (struct device *dev);#define video_is_primary_device video_is_primary_device +#endif #include <asm-generic/video.h>
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 332/565 phy: renesas: r8a779f0-ether-serdes: add new step added to latest datasheet
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Dege <[email protected]>
[ Upstream commit e4a8db93b5ec9bca1cc66b295544899e3afd5e86 ]
R-Car S4-8 datasheet Rev.1.20 describes some additional register settings at the end of the initialization.
--- drivers/phy/renesas/r8a779f0-ether-serdes.c | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/phy/renesas/r8a779f0-ether-serdes.c +28 -0
@@ -49,6 +49,13 @@ static void r8a779f0_eth_serdes_write32(void __iomem *addr, u32 offs, u32 bank,iowrite32 (data, addr + offs); } +static u32 r8a779f0_eth_serdes_read32 (void __iomem *addr,u32 offs,u32 bank) +{ +iowrite32 (bank, addr +R8A779F0_ETH_SERDES_BANK_SELECT ); + +return ioread32 (addr + offs); +} +static int r8a779f0_eth_serdes_reg_wait (struct r8a779f0_eth_serdes_channel *channel,u32 offs,u32 bank,u32 mask,u32 expected)
@@ -274,6 +281,7 @@ static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channel *channel) {int ret; +u32 val; ret =r8a779f0_eth_serdes_chan_setting (channel);if (ret)
@@ -287,6 +295,26 @@ static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channelr8a779f0_eth_serdes_write32 (channel->addr,0x03d0 ,0x380 ,0x0000 ); + val =r8a779f0_eth_serdes_read32 (channel->addr,0x00c0 ,0x180 ); +r8a779f0_eth_serdes_write32 (channel->addr,0x00c0 ,0x180 , val |BIT (8 )); + ret =r8a779f0_eth_serdes_reg_wait (channel,0x0100 ,0x180 ,BIT (0 ),1 ); +if (ret) +return ret; +r8a779f0_eth_serdes_write32 (channel->addr,0x00c0 ,0x180 , val & ~BIT (8 )); + ret =r8a779f0_eth_serdes_reg_wait (channel,0x0100 ,0x180 ,BIT (0 ),0 ); +if (ret) +return ret; + + val =r8a779f0_eth_serdes_read32 (channel->addr,0x0144 ,0x180 ); +r8a779f0_eth_serdes_write32 (channel->addr,0x0144 ,0x180 , val |BIT (4 )); + ret =r8a779f0_eth_serdes_reg_wait (channel,0x0180 ,0x180 ,BIT (0 ),1 ); +if (ret) +return ret; +r8a779f0_eth_serdes_write32 (channel->addr,0x0144 ,0x180 , val & ~BIT (4 )); + ret =r8a779f0_eth_serdes_reg_wait (channel,0x0180 ,0x180 ,BIT (0 ),0 ); +if (ret) +return ret; +return r8a779f0_eth_serdes_monitor_linkup (channel); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 333/565 phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Riesch <[email protected]>
[ Upstream commit 8c7c19466c854fa86b82d2148eaa9bf0e6531423 ]
The driver for the Rockchip MIPI CSI-2 DPHY uses GRF register offset value 0 to sort out undefined registers. However, the RK3588 CSIDPHY GRF this offset is perfectly fine (in fact, register 0 is the only one in this register file).
Introduce a boolean variable to indicate valid registers and allow writes to register 0.
--- drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-csidphy.c +3 -2
@@ -87,10 +87,11 @@ struct dphy_reg {u32 offset;u32 mask;u32 shift; +u8 valid; };#define PHY_REG (_offset, _width, _shift) \ - { .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, } + { .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, .valid = 1, }static const struct dphy_reg rk1808_grf_dphy_regs[] = { [GRF_DPHY_CSIPHY_FORCERXMODE ] =PHY_REG (RK1808_GRF_PD_VI_CON_OFFSET ,4 ,0 ),
@@ -145,7 +146,7 @@ static inline void write_grf_reg(struct rockchip_inno_csidphy *priv,const struct dphy_drv_data *drv_data = priv->drv_data;const struct dphy_reg *reg = &drv_data->grf_regs[index]; -if (reg->offset) +if (reg->valid)regmap_write (priv->grf, reg->offset,HIWORD_UPDATE (value, reg->mask, reg->shift)); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 334/565 drm/msm/registers: Generate _HI/LO builders for reg64
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <[email protected]>
[ Upstream commit 60e9f776b7932d67c88e8475df7830cb9cdf3154 ]
The upstream mesa copy of the GPU regs has shifted more things to reg64 instead of seperate 32b HI/LO reg32's. This works better with the "new- style" c++ builders that mesa has been migrating to for a6xx+ (to better handle register shuffling between gens), but it leaves the C builders with missing _HI/LO builders.
So handle the special case of reg64, automatically generating the missing _HI/LO builders.
Patchwork: https://patchwork.freedesktop.org/patch/673559/
--- drivers/gpu/drm/msm/registers/gen_header.py | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/msm/registers/gen_header.py +7 -0
@@ -149,6 +149,7 @@ class Bitset(object): def __init__(self, name, template): self.name = name self.inline = False + self.reg = None if template: self.fields = template.fields[:] else:
@@ -255,6 +256,11 @@ class Bitset(object): def dump(self, prefix=None): if prefix == None: prefix = self.name + if self.reg and self.reg.bit_size == 64: + print("static inline uint32_t %s_LO(uint32_t val)\n{" % prefix) + print("\treturn val;\n}") + print("static inline uint32_t %s_HI(uint32_t val)\n{" % prefix) + print("\treturn val;\n}") for f in self.fields: if f.name: name = prefix + "_" + f.name
@@ -619,6 +625,7 @@ class Parser(object): self.current_reg = Reg(attrs, self.prefix(variant), self.current_array, bit_size) self.current_reg.bitset = self.current_bitset + self.current_bitset.reg = self.current_reg if len(self.stack) == 1: self.file.append(self.current_reg)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 335/565 net: sh_eth: Disable WoL if system can not suspend
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Söderlund <[email protected]>
[ Upstream commit 9c02ea544ac35a9def5827d30594406947ccd81a ]
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using CONFIG_PM_SLEEP.
--- drivers/net/ethernet/renesas/sh_eth.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/renesas/sh_eth.c +4 -0
@@ -2360,6 +2360,7 @@ static int sh_eth_set_ringparam(struct net_device *ndev,return 0 ; } +#ifdef CONFIG_PM_SLEEP static void sh_eth_get_wol (struct net_device *ndev,struct ethtool_wolinfo *wol) {struct sh_eth_private *mdp =netdev_priv (ndev);
@@ -2386,6 +2387,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)return 0 ; } +#endif static const struct ethtool_ops sh_eth_ethtool_ops = { .get_regs_len = sh_eth_get_regs_len,
@@ -2401,8 +2403,10 @@ static const struct ethtool_ops sh_eth_ethtool_ops = { .set_ringparam = sh_eth_set_ringparam, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, +#ifdef CONFIG_PM_SLEEP .get_wol = sh_eth_get_wol, .set_wol = sh_eth_set_wol, +#endif };/* network device open function */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 336/565 selftests: net: replace sleeps in fcnal-test with waits
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit 15c068cb214d74a2faca9293b25f454242d0d65e ]
fcnal-test.sh already includes lib.sh, use relevant helpers instead of sleeping. Replace sleep after starting nettest as a server with wait_local_port_listen.
--- tools/testing/selftests/net/fcnal-test.sh | 428 +++++++++++----------- 1 file changed, 214 insertions(+), 214 deletions(-)
tools/testing/selftests/net/fcnal-test.sh +214 -214
@@ -875,7 +875,7 @@ ipv4_tcp_md5_novrf() # basic use case log_start run_cmd nettest -s -M ${MD5_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: Single address config"
@@ -883,7 +883,7 @@ ipv4_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: Server no config, client uses password"
@@ -891,7 +891,7 @@ ipv4_tcp_md5_novrf() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -s -M ${MD5_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: Client uses wrong password"
@@ -899,7 +899,7 @@ ipv4_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -s -M ${MD5_PW} -m ${NSB_LO_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: Client address does not match address configured with password"
@@ -910,7 +910,7 @@ ipv4_tcp_md5_novrf() # client in prefix log_start run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: Prefix config"
@@ -918,7 +918,7 @@ ipv4_tcp_md5_novrf() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: Prefix config, client uses wrong password"
@@ -926,7 +926,7 @@ ipv4_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -c ${NSB_LO_IP} -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: Prefix config, client address not in configured prefix" }
@@ -943,7 +943,7 @@ ipv4_tcp_md5() # basic use case log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Single address config"
@@ -951,7 +951,7 @@ ipv4_tcp_md5() log_start show_hint "Should timeout since server does not have MD5 auth" run_cmd nettest -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Server no config, client uses password"
@@ -959,7 +959,7 @@ ipv4_tcp_md5() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Client uses wrong password"
@@ -967,7 +967,7 @@ ipv4_tcp_md5() log_start show_hint "Should timeout since server config differs from client" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_LO_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Client address does not match address configured with password"
@@ -978,7 +978,7 @@ ipv4_tcp_md5() # client in prefix log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Prefix config"
@@ -986,7 +986,7 @@ ipv4_tcp_md5() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Prefix config, client uses wrong password"
@@ -994,7 +994,7 @@ ipv4_tcp_md5() log_start show_hint "Should timeout since client address is outside of prefix" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -c ${NSB_LO_IP} -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Prefix config, client address not in configured prefix"
@@ -1005,14 +1005,14 @@ ipv4_tcp_md5() log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Single address config in default VRF and VRF, conn in VRF" log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 0 "MD5: VRF: Single address config in default VRF and VRF, conn in default VRF"
@@ -1020,7 +1020,7 @@ ipv4_tcp_md5() show_hint "Should timeout since client in default VRF uses VRF password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Single address config in default VRF and VRF, conn in default VRF with VRF pw"
@@ -1028,21 +1028,21 @@ ipv4_tcp_md5() show_hint "Should timeout since client in VRF uses default VRF password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Single address config in default VRF and VRF, conn in VRF with default VRF pw" log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Prefix config in default VRF and VRF, conn in VRF" log_start run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 0 "MD5: VRF: Prefix config in default VRF and VRF, conn in default VRF"
@@ -1050,7 +1050,7 @@ ipv4_tcp_md5() show_hint "Should timeout since client in default VRF uses VRF password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Prefix config in default VRF and VRF, conn in default VRF with VRF pw"
@@ -1058,7 +1058,7 @@ ipv4_tcp_md5() show_hint "Should timeout since client in VRF uses default VRF password" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} & run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Prefix config in default VRF and VRF, conn in VRF with default VRF pw"
@@ -1082,14 +1082,14 @@ test_ipv4_md5_vrf__vrf_server__no_bind_ifindex() log_start show_hint "Simulates applications using VRF without TCP_MD5SIG_FLAG_IFINDEX" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: VRF-bound server, unbound key accepts connection" log_start show_hint "Binding both the socket and the key is not required but it works" run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: VRF-bound server, bound key accepts connection" }
@@ -1103,25 +1103,25 @@ test_ipv4_md5_vrf__global_server__bind_ifindex0() log_start run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Global server, Key bound to ifindex=0 rejects VRF connection" log_start run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Global server, key bound to ifindex=0 accepts non-VRF connection" log_start run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Global server, key not bound to ifindex accepts VRF connection" log_start run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Global server, key not bound to ifindex accepts non-VRF connection"
@@ -1193,7 +1193,7 @@ ipv4_tcp_novrf() do log_start run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "Global server" done
@@ -1201,7 +1201,7 @@ ipv4_tcp_novrf() a=${NSA_IP} log_start run_cmd nettest -s -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "Device server"
@@ -1221,13 +1221,13 @@ ipv4_tcp_novrf() do log_start run_cmd_nsb nettest -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -r ${a} -0 ${NSA_IP} log_test_addr ${a} $? 0 "Client" log_start run_cmd_nsb nettest -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 0 "Client, device bind"
@@ -1249,7 +1249,7 @@ ipv4_tcp_novrf() do log_start run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -0 ${a} -1 ${a} log_test_addr ${a} $? 0 "Global server, local connection" done
@@ -1257,7 +1257,7 @@ ipv4_tcp_novrf() a=${NSA_IP} log_start run_cmd nettest -s -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -0 ${a} log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
@@ -1266,7 +1266,7 @@ ipv4_tcp_novrf() log_start show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope" run_cmd nettest -s -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} log_test_addr ${a} $? 1 "Device server, unbound client, local connection" done
@@ -1274,7 +1274,7 @@ ipv4_tcp_novrf() a=${NSA_IP} log_start run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -0 ${a} -d ${NSA_DEV} log_test_addr ${a} $? 0 "Global server, device client, local connection"
@@ -1283,7 +1283,7 @@ ipv4_tcp_novrf() log_start show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope" run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 1 "Global server, device client, local connection" done
@@ -1291,7 +1291,7 @@ ipv4_tcp_novrf() a=${NSA_IP} log_start run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -d ${NSA_DEV} -r ${a} -0 ${a} log_test_addr ${a} $? 0 "Device server, device client, local connection"
@@ -1323,19 +1323,19 @@ ipv4_tcp_vrf() log_start show_hint "Should fail 'Connection refused' since global server with VRF is disabled" run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 1 "Global server" log_start run_cmd nettest -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "VRF server" log_start run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "Device server"
@@ -1352,7 +1352,7 @@ ipv4_tcp_vrf() log_start show_hint "Should fail 'Connection refused' since global server with VRF is disabled" run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 1 "Global server, local connection"
@@ -1374,14 +1374,14 @@ ipv4_tcp_vrf() log_start show_hint "client socket should be bound to VRF" run_cmd nettest -s -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "Global server" log_start show_hint "client socket should be bound to VRF" run_cmd nettest -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "VRF server"
@@ -1396,7 +1396,7 @@ ipv4_tcp_vrf() log_start show_hint "client socket should be bound to device" run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 0 "Device server"
@@ -1406,7 +1406,7 @@ ipv4_tcp_vrf() log_start show_hint "Should fail 'Connection refused' since client is not bound to VRF" run_cmd nettest -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} log_test_addr ${a} $? 1 "Global server, local connection" done
@@ -1418,13 +1418,13 @@ ipv4_tcp_vrf() do log_start run_cmd_nsb nettest -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -r ${a} -d ${VRF} log_test_addr ${a} $? 0 "Client, VRF bind" log_start run_cmd_nsb nettest -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 0 "Client, device bind"
@@ -1443,7 +1443,7 @@ ipv4_tcp_vrf() do log_start run_cmd nettest -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${VRF} -0 ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local connection" done
@@ -1451,26 +1451,26 @@ ipv4_tcp_vrf() a=${NSA_IP} log_start run_cmd nettest -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a} log_test_addr ${a} $? 0 "VRF server, device client, local connection" log_start show_hint "Should fail 'No route to host' since client is out of VRF scope" run_cmd nettest -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} log_test_addr ${a} $? 1 "VRF server, unbound client, local connection" log_start run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${VRF} -0 ${a} log_test_addr ${a} $? 0 "Device server, VRF client, local connection" log_start run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a} log_test_addr ${a} $? 0 "Device server, device client, local connection" }
@@ -1509,7 +1509,7 @@ ipv4_udp_novrf() do log_start run_cmd nettest -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "Global server"
@@ -1522,7 +1522,7 @@ ipv4_udp_novrf() a=${NSA_IP} log_start run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "Device server"
@@ -1533,31 +1533,31 @@ ipv4_udp_novrf() do log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -D -r ${a} -0 ${NSA_IP} log_test_addr ${a} $? 0 "Client" log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP} log_test_addr ${a} $? 0 "Client, device bind" log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP} log_test_addr ${a} $? 0 "Client, device send via cmsg" log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP} log_test_addr ${a} $? 0 "Client, device bind via IP_UNICAST_IF" log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP} -U log_test_addr ${a} $? 0 "Client, device bind via IP_UNICAST_IF, with connect()"
@@ -1580,7 +1580,7 @@ ipv4_udp_novrf() do log_start run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} -0 ${a} -1 ${a} log_test_addr ${a} $? 0 "Global server, local connection" done
@@ -1588,7 +1588,7 @@ ipv4_udp_novrf() a=${NSA_IP} log_start run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
@@ -1597,7 +1597,7 @@ ipv4_udp_novrf() log_start show_hint "Should fail 'Connection refused' since address is out of device scope" run_cmd nettest -s -D -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} log_test_addr ${a} $? 1 "Device server, unbound client, local connection" done
@@ -1605,25 +1605,25 @@ ipv4_udp_novrf() a=${NSA_IP} log_start run_cmd nettest -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Global server, device client, local connection" log_start run_cmd nettest -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -C -r ${a} log_test_addr ${a} $? 0 "Global server, device send via cmsg, local connection" log_start run_cmd nettest -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -S -r ${a} log_test_addr ${a} $? 0 "Global server, device client via IP_UNICAST_IF, local connection" log_start run_cmd nettest -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -S -r ${a} -U log_test_addr ${a} $? 0 "Global server, device client via IP_UNICAST_IF, local connection, with connect()"
@@ -1636,28 +1636,28 @@ ipv4_udp_novrf() log_start show_hint "Should fail since addresses on loopback are out of device scope" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 2 "Global server, device client, local connection" log_start show_hint "Should fail since addresses on loopback are out of device scope" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C log_test_addr ${a} $? 1 "Global server, device send via cmsg, local connection" log_start show_hint "Should fail since addresses on loopback are out of device scope" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection" log_start show_hint "Should fail since addresses on loopback are out of device scope" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -U log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection, with connect()"
@@ -1667,7 +1667,7 @@ ipv4_udp_novrf() a=${NSA_IP} log_start run_cmd nettest -D -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} -0 ${a} log_test_addr ${a} $? 0 "Device server, device client, local conn"
@@ -1709,19 +1709,19 @@ ipv4_udp_vrf() log_start show_hint "Fails because ingress is in a VRF and global server is disabled" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 1 "Global server" log_start run_cmd nettest -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "VRF server" log_start run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "Enslaved device server"
@@ -1733,7 +1733,7 @@ ipv4_udp_vrf() log_start show_hint "Should fail 'Connection refused' since global server is out of scope" run_cmd nettest -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 1 "Global server, VRF client, local connection" done
@@ -1741,26 +1741,26 @@ ipv4_udp_vrf() a=${NSA_IP} log_start run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn" log_start run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "VRF server, enslaved device client, local connection" a=${NSA_IP} log_start run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn" log_start run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
@@ -1775,19 +1775,19 @@ ipv4_udp_vrf() do log_start run_cmd nettest -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "Global server" log_start run_cmd nettest -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "VRF server" log_start run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -D -r ${a} log_test_addr ${a} $? 0 "Enslaved device server"
@@ -1802,13 +1802,13 @@ ipv4_udp_vrf() # log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -d ${VRF} -D -r ${NSB_IP} -1 ${NSA_IP} log_test $? 0 "VRF client" log_start run_cmd_nsb nettest -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -d ${NSA_DEV} -D -r ${NSB_IP} -1 ${NSA_IP} log_test $? 0 "Enslaved device client"
@@ -1829,31 +1829,31 @@ ipv4_udp_vrf() a=${NSA_IP} log_start run_cmd nettest -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Global server, VRF client, local conn" log_start run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn" log_start run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "VRF server, device client, local conn" log_start run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn" log_start run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
@@ -1861,7 +1861,7 @@ ipv4_udp_vrf() do log_start run_cmd nettest -D -s -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Global server, VRF client, local conn" done
@@ -1870,7 +1870,7 @@ ipv4_udp_vrf() do log_start run_cmd nettest -s -D -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn" done
@@ -2093,7 +2093,7 @@ ipv4_rt() do log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2107,7 +2107,7 @@ ipv4_rt() do log_start run_cmd nettest ${varg} -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2120,7 +2120,7 @@ ipv4_rt() a=${NSA_IP} log_start run_cmd nettest ${varg} -s -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2134,7 +2134,7 @@ ipv4_rt() # log_start run_cmd_nsb nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${NSB_IP} & sleep 3 run_cmd ip link del ${VRF}
@@ -2145,7 +2145,7 @@ ipv4_rt() log_start run_cmd_nsb nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${NSB_IP} & sleep 3 run_cmd ip link del ${VRF}
@@ -2161,7 +2161,7 @@ ipv4_rt() do log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2175,7 +2175,7 @@ ipv4_rt() do log_start run_cmd nettest ${varg} -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2189,7 +2189,7 @@ ipv4_rt() log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2200,7 +2200,7 @@ ipv4_rt() log_start run_cmd nettest ${varg} -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2211,7 +2211,7 @@ ipv4_rt() log_start run_cmd nettest ${varg} -I ${NSA_DEV} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -2561,7 +2561,7 @@ ipv6_tcp_md5_novrf() # basic use case log_start run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: Single address config"
@@ -2569,7 +2569,7 @@ ipv6_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: Server no config, client uses password"
@@ -2577,7 +2577,7 @@ ipv6_tcp_md5_novrf() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: Client uses wrong password"
@@ -2585,7 +2585,7 @@ ipv6_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_LO_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: Client address does not match address configured with password"
@@ -2596,7 +2596,7 @@ ipv6_tcp_md5_novrf() # client in prefix log_start run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: Prefix config"
@@ -2604,7 +2604,7 @@ ipv6_tcp_md5_novrf() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: Prefix config, client uses wrong password"
@@ -2612,7 +2612,7 @@ ipv6_tcp_md5_novrf() log_start show_hint "Should timeout due to MD5 mismatch" run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -c ${NSB_LO_IP6} -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: Prefix config, client address not in configured prefix" }
@@ -2629,7 +2629,7 @@ ipv6_tcp_md5() # basic use case log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Single address config"
@@ -2637,7 +2637,7 @@ ipv6_tcp_md5() log_start show_hint "Should timeout since server does not have MD5 auth" run_cmd nettest -6 -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Server no config, client uses password"
@@ -2645,7 +2645,7 @@ ipv6_tcp_md5() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Client uses wrong password"
@@ -2653,7 +2653,7 @@ ipv6_tcp_md5() log_start show_hint "Should timeout since server config differs from client" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_LO_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Client address does not match address configured with password"
@@ -2664,7 +2664,7 @@ ipv6_tcp_md5() # client in prefix log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Prefix config"
@@ -2672,7 +2672,7 @@ ipv6_tcp_md5() log_start show_hint "Should timeout since client uses wrong password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Prefix config, client uses wrong password"
@@ -2680,7 +2680,7 @@ ipv6_tcp_md5() log_start show_hint "Should timeout since client address is outside of prefix" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -c ${NSB_LO_IP6} -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Prefix config, client address not in configured prefix"
@@ -2691,14 +2691,14 @@ ipv6_tcp_md5() log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Single address config in default VRF and VRF, conn in VRF" log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 0 "MD5: VRF: Single address config in default VRF and VRF, conn in default VRF"
@@ -2706,7 +2706,7 @@ ipv6_tcp_md5() show_hint "Should timeout since client in default VRF uses VRF password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Single address config in default VRF and VRF, conn in default VRF with VRF pw"
@@ -2714,21 +2714,21 @@ ipv6_tcp_md5() show_hint "Should timeout since client in VRF uses default VRF password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Single address config in default VRF and VRF, conn in VRF with default VRF pw" log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 0 "MD5: VRF: Prefix config in default VRF and VRF, conn in VRF" log_start run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 0 "MD5: VRF: Prefix config in default VRF and VRF, conn in default VRF"
@@ -2736,7 +2736,7 @@ ipv6_tcp_md5() show_hint "Should timeout since client in default VRF uses VRF password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_PW} log_test $? 2 "MD5: VRF: Prefix config in default VRF and VRF, conn in default VRF with VRF pw"
@@ -2744,7 +2744,7 @@ ipv6_tcp_md5() show_hint "Should timeout since client in VRF uses default VRF password" run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} & run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW} log_test $? 2 "MD5: VRF: Prefix config in default VRF and VRF, conn in VRF with default VRF pw"
@@ -2772,7 +2772,7 @@ ipv6_tcp_novrf() do log_start run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "Global server" done
@@ -2793,7 +2793,7 @@ ipv6_tcp_novrf() do log_start run_cmd_nsb nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -6 -r ${a} log_test_addr ${a} $? 0 "Client" done
@@ -2802,7 +2802,7 @@ ipv6_tcp_novrf() do log_start run_cmd_nsb nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 0 "Client, device bind" done
@@ -2822,7 +2822,7 @@ ipv6_tcp_novrf() do log_start run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} log_test_addr ${a} $? 0 "Global server, local connection" done
@@ -2830,7 +2830,7 @@ ipv6_tcp_novrf() a=${NSA_IP6} log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -0 ${a} log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
@@ -2839,7 +2839,7 @@ ipv6_tcp_novrf() log_start show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope" run_cmd nettest -6 -s -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} log_test_addr ${a} $? 1 "Device server, unbound client, local connection" done
@@ -2847,7 +2847,7 @@ ipv6_tcp_novrf() a=${NSA_IP6} log_start run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a} log_test_addr ${a} $? 0 "Global server, device client, local connection"
@@ -2856,7 +2856,7 @@ ipv6_tcp_novrf() log_start show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope" run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 1 "Global server, device client, local connection" done
@@ -2865,7 +2865,7 @@ ipv6_tcp_novrf() do log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Device server, device client, local conn" done
@@ -2898,7 +2898,7 @@ ipv6_tcp_vrf() log_start show_hint "Should fail 'Connection refused' since global server with VRF is disabled" run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 1 "Global server" done
@@ -2907,7 +2907,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "VRF server" done
@@ -2916,7 +2916,7 @@ ipv6_tcp_vrf() a=${NSA_LINKIP6}%${NSB_DEV} log_start run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "VRF server"
@@ -2924,7 +2924,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "Device server" done
@@ -2943,7 +2943,7 @@ ipv6_tcp_vrf() log_start show_hint "Should fail 'Connection refused' since global server with VRF is disabled" run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 1 "Global server, local connection"
@@ -2964,7 +2964,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "Global server" done
@@ -2973,7 +2973,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "VRF server" done
@@ -2982,13 +2982,13 @@ ipv6_tcp_vrf() a=${NSA_LINKIP6}%${NSB_DEV} log_start run_cmd nettest -6 -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "Global server" log_start run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "VRF server"
@@ -2996,7 +2996,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 0 "Device server" done
@@ -3016,7 +3016,7 @@ ipv6_tcp_vrf() log_start show_hint "Fails 'Connection refused' since client is not in VRF" run_cmd nettest -6 -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} log_test_addr ${a} $? 1 "Global server, local connection" done
@@ -3029,7 +3029,7 @@ ipv6_tcp_vrf() do log_start run_cmd_nsb nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -6 -r ${a} -d ${VRF} log_test_addr ${a} $? 0 "Client, VRF bind" done
@@ -3038,7 +3038,7 @@ ipv6_tcp_vrf() log_start show_hint "Fails since VRF device does not allow linklocal addresses" run_cmd_nsb nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -6 -r ${a} -d ${VRF} log_test_addr ${a} $? 1 "Client, VRF bind"
@@ -3046,7 +3046,7 @@ ipv6_tcp_vrf() do log_start run_cmd_nsb nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 0 "Client, device bind" done
@@ -3071,7 +3071,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local connection" done
@@ -3079,7 +3079,7 @@ ipv6_tcp_vrf() a=${NSA_IP6} log_start run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a} log_test_addr ${a} $? 0 "VRF server, device client, local connection"
@@ -3087,13 +3087,13 @@ ipv6_tcp_vrf() log_start show_hint "Should fail since unbound client is out of VRF scope" run_cmd nettest -6 -s -I ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} log_test_addr ${a} $? 1 "VRF server, unbound client, local connection" log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a} log_test_addr ${a} $? 0 "Device server, VRF client, local connection"
@@ -3101,7 +3101,7 @@ ipv6_tcp_vrf() do log_start run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a} log_test_addr ${a} $? 0 "Device server, device client, local connection" done
@@ -3141,13 +3141,13 @@ ipv6_udp_novrf() do log_start run_cmd nettest -6 -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Global server" log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Device server" done
@@ -3155,7 +3155,7 @@ ipv6_udp_novrf() a=${NSA_LO_IP6} log_start run_cmd nettest -6 -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Global server"
@@ -3165,7 +3165,7 @@ ipv6_udp_novrf() #log_start #show_hint "Should fail since loopback address is out of scope" #run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - #sleep 1 + wait_local_port_listen ${NSA} 12345 udp #run_cmd_nsb nettest -6 -D -r ${a} #log_test_addr ${a} $? 1 "Device server"
@@ -3185,25 +3185,25 @@ ipv6_udp_novrf() do log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -r ${a} -0 ${NSA_IP6} log_test_addr ${a} $? 0 "Client" log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP6} log_test_addr ${a} $? 0 "Client, device bind" log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP6} log_test_addr ${a} $? 0 "Client, device send via cmsg" log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP6} log_test_addr ${a} $? 0 "Client, device bind via IPV6_UNICAST_IF"
@@ -3225,7 +3225,7 @@ ipv6_udp_novrf() do log_start run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} -0 ${a} -1 ${a} log_test_addr ${a} $? 0 "Global server, local connection" done
@@ -3233,7 +3233,7 @@ ipv6_udp_novrf() a=${NSA_IP6} log_start run_cmd nettest -6 -s -D -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
@@ -3242,7 +3242,7 @@ ipv6_udp_novrf() log_start show_hint "Should fail 'Connection refused' since address is out of device scope" run_cmd nettest -6 -s -D -I ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} log_test_addr ${a} $? 1 "Device server, local connection" done
@@ -3250,19 +3250,19 @@ ipv6_udp_novrf() a=${NSA_IP6} log_start run_cmd nettest -6 -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Global server, device client, local connection" log_start run_cmd nettest -6 -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -C -r ${a} log_test_addr ${a} $? 0 "Global server, device send via cmsg, local connection" log_start run_cmd nettest -6 -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -S -r ${a} log_test_addr ${a} $? 0 "Global server, device client via IPV6_UNICAST_IF, local connection"
@@ -3271,28 +3271,28 @@ ipv6_udp_novrf() log_start show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} log_test_addr ${a} $? 1 "Global server, device client, local connection" log_start show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C log_test_addr ${a} $? 1 "Global server, device send via cmsg, local connection" log_start show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection" log_start show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -U log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection, with connect()" done
@@ -3300,7 +3300,7 @@ ipv6_udp_novrf() a=${NSA_IP6} log_start run_cmd nettest -6 -D -s -I ${NSA_DEV} -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} -0 ${a} log_test_addr ${a} $? 0 "Device server, device client, local conn"
@@ -3314,7 +3314,7 @@ ipv6_udp_novrf() run_cmd_nsb ip -6 ro add ${NSA_IP6}/128 dev ${NSB_DEV} log_start run_cmd nettest -6 -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${NSA_IP6} log_test $? 0 "UDP in - LLA to GUA"
@@ -3338,7 +3338,7 @@ ipv6_udp_vrf() log_start show_hint "Should fail 'Connection refused' since global server is disabled" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 1 "Global server" done
@@ -3347,7 +3347,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "VRF server" done
@@ -3356,7 +3356,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Enslaved device server" done
@@ -3378,7 +3378,7 @@ ipv6_udp_vrf() log_start show_hint "Should fail 'Connection refused' since global server is disabled" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 1 "Global server, VRF client, local conn" done
@@ -3387,7 +3387,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn" done
@@ -3396,25 +3396,25 @@ ipv6_udp_vrf() log_start show_hint "Should fail 'Connection refused' since global server is disabled" run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 1 "Global server, device client, local conn" log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "VRF server, device client, local conn" log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn" log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
@@ -3429,7 +3429,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Global server" done
@@ -3438,7 +3438,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "VRF server" done
@@ -3447,7 +3447,7 @@ ipv6_udp_vrf() do log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${a} log_test_addr ${a} $? 0 "Enslaved device server" done
@@ -3465,7 +3465,7 @@ ipv6_udp_vrf() # log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${NSB_IP6} log_test $? 0 "VRF client"
@@ -3476,7 +3476,7 @@ ipv6_udp_vrf() log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_IP6} log_test $? 0 "Enslaved device client"
@@ -3491,13 +3491,13 @@ ipv6_udp_vrf() a=${NSA_IP6} log_start run_cmd nettest -6 -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Global server, VRF client, local conn" #log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
@@ -3505,13 +3505,13 @@ ipv6_udp_vrf() a=${VRF_IP6} log_start run_cmd nettest -6 -D -s -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Global server, VRF client, local conn" log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${VRF} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
@@ -3527,25 +3527,25 @@ ipv6_udp_vrf() a=${NSA_IP6} log_start run_cmd nettest -6 -D -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Global server, device client, local conn" log_start run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "VRF server, device client, local conn" log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${VRF} -r ${a} log_test_addr ${a} $? 0 "Device server, VRF client, local conn" log_start run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} log_test_addr ${a} $? 0 "Device server, device client, local conn"
@@ -3557,7 +3557,7 @@ ipv6_udp_vrf() # link local addresses log_start run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -d ${NSB_DEV} -r ${NSA_LINKIP6} log_test $? 0 "Global server, linklocal IP"
@@ -3568,7 +3568,7 @@ ipv6_udp_vrf() log_start run_cmd_nsb nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_LINKIP6} log_test $? 0 "Enslaved device client, linklocal IP"
@@ -3579,7 +3579,7 @@ ipv6_udp_vrf() log_start run_cmd nettest -6 -D -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSA_LINKIP6} log_test $? 0 "Enslaved device client, local conn - linklocal IP"
@@ -3592,7 +3592,7 @@ ipv6_udp_vrf() run_cmd_nsb ip -6 ro add ${NSA_IP6}/128 dev ${NSB_DEV} log_start run_cmd nettest -6 -s -D & - sleep 1 + wait_local_port_listen ${NSA} 12345 udp run_cmd_nsb nettest -6 -D -r ${NSA_IP6} log_test $? 0 "UDP in - LLA to GUA"
@@ -3771,7 +3771,7 @@ ipv6_rt() do log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3785,7 +3785,7 @@ ipv6_rt() do log_start run_cmd nettest ${varg} -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3799,7 +3799,7 @@ ipv6_rt() do log_start run_cmd nettest ${varg} -I ${NSA_DEV} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${varg} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3814,7 +3814,7 @@ ipv6_rt() # log_start run_cmd_nsb nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${NSB_IP6} & sleep 3 run_cmd ip link del ${VRF}
@@ -3825,7 +3825,7 @@ ipv6_rt() log_start run_cmd_nsb nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSB} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${NSB_IP6} & sleep 3 run_cmd ip link del ${VRF}
@@ -3842,7 +3842,7 @@ ipv6_rt() do log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3856,7 +3856,7 @@ ipv6_rt() do log_start run_cmd nettest ${varg} -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${VRF} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3869,7 +3869,7 @@ ipv6_rt() a=${NSA_IP6} log_start run_cmd nettest ${varg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3880,7 +3880,7 @@ ipv6_rt() log_start run_cmd nettest ${varg} -I ${VRF} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3891,7 +3891,7 @@ ipv6_rt() log_start run_cmd nettest ${varg} -I ${NSA_DEV} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} & sleep 3 run_cmd ip link del ${VRF}
@@ -3950,7 +3950,7 @@ netfilter_tcp_reset() do log_start run_cmd nettest -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -r ${a} log_test_addr ${a} $? 1 "Global server, reject with TCP-reset on Rx" done
@@ -3968,7 +3968,7 @@ netfilter_icmp() do log_start run_cmd nettest ${arg} -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest ${arg} -r ${a} log_test_addr ${a} $? 1 "Global ${stype} server, Rx reject icmp-port-unreach" done
@@ -4007,7 +4007,7 @@ netfilter_tcp6_reset() do log_start run_cmd nettest -6 -s & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 -r ${a} log_test_addr ${a} $? 1 "Global server, reject with TCP-reset on Rx" done
@@ -4025,7 +4025,7 @@ netfilter_icmp6() do log_start run_cmd nettest -6 -s ${arg} & - sleep 1 + wait_local_port_listen ${NSA} 12345 tcp run_cmd_nsb nettest -6 ${arg} -r ${a} log_test_addr ${a} $? 1 "Global ${stype} server, Rx reject icmp-port-unreach" done
@@ -4221,12 +4221,12 @@ use_case_snat_on_vrf() run_cmd ip6tables -t nat -A POSTROUTING -p tcp -m tcp --dport ${port} -j SNAT --to-source ${NSA_LO_IP6} -o ${VRF} run_cmd_nsb nettest -s -l ${NSB_IP} -p ${port} & - sleep 1 + wait_local_port_listen ${NSB} ${port} tcp run_cmd nettest -d ${VRF} -r ${NSB_IP} -p ${port} log_test $? 0 "IPv4 TCP connection over VRF with SNAT" run_cmd_nsb nettest -6 -s -l ${NSB_IP6} -p ${port} & - sleep 1 + wait_local_port_listen ${NSB} ${port} tcp run_cmd nettest -6 -d ${VRF} -r ${NSB_IP6} -p ${port} log_test $? 0 "IPv6 TCP connection over VRF with SNAT"
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 337/565 media: redrat3: use int type to store negative error codes
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qianfeng Rong <[email protected]>
[ Upstream commit ecba852dc9f4993f4f894ea1f352564560e19a3e ]
Change "ret" from u8 to int type in redrat3_enable_detector() to store negative error codes or zero returned by redrat3_send_cmd() and usb_submit_urb() - this better aligns with the coding standards and maintains code consistency.
No effect on runtime.
--- drivers/media/rc/redrat3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/redrat3.c +1 -1
@@ -422,7 +422,7 @@ static int redrat3_send_cmd(int cmd, struct redrat3_dev *rr3)static int redrat3_enable_detector (struct redrat3_dev *rr3) {struct device *dev = rr3->dev; -u8 ret; +int ret; ret =redrat3_send_cmd (RR3_RC_DET_ENABLE , rr3);if (ret !=0 )
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 338/565 selftests: traceroute: Use require_command()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 47efbac9b768553331b9459743a29861e0acd797 ]
Use require_command() so that the test will return SKIP (4) when a required command is not present.
Before:
# ./traceroute.sh SKIP: Could not run IPV6 test without traceroute6 SKIP: Could not run IPV4 test without traceroute $ echo $? 0
After:
# ./traceroute.sh TEST: traceroute6 not installed [SKIP] $ echo $? 4
--- tools/testing/selftests/net/traceroute.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
tools/testing/selftests/net/traceroute.sh +3 -10
@@ -203,11 +203,6 @@ setup_traceroute6() run_traceroute6() { - if [ ! -x "$(command -v traceroute6)" ]; then - echo "SKIP: Could not run IPV6 test without traceroute6" - return - fi - setup_traceroute6 # traceroute6 host-2 from host-1 (expects 2000:102::2)
@@ -268,11 +263,6 @@ setup_traceroute() run_traceroute() { - if [ ! -x "$(command -v traceroute)" ]; then - echo "SKIP: Could not run IPV4 test without traceroute" - return - fi - setup_traceroute # traceroute host-2 from host-1 (expects 1.0.1.1). Takes a while.
@@ -306,6 +296,9 @@ do esac done +require_command traceroute6 +require_command traceroute + run_tests printf "\nTests passed: %3d\n" ${nsuccess}
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 339/565 selftests: traceroute: Return correct value on failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit c068ba9d3ded56cb1ba4d5135ee84bf8039bd563 ]
The test always returns success even if some tests were modified to fail. Fix by converting the test to use the appropriate library functions instead of using its own functions.
Before:
# ./traceroute.sh TEST: IPV6 traceroute [FAIL] TEST: IPV4 traceroute [ OK ]
Tests passed: 1
Tests failed: 1
$ echo $? 0
After:
# ./traceroute.sh
TEST: IPv6 traceroute [FAIL]
traceroute6 did not return 2000:102::2
TEST: IPv4 traceroute [ OK ]
$ echo $?
1--- tools/testing/selftests/net/traceroute.sh | 38 ++++++----------------- 1 file changed, 9 insertions(+), 29 deletions(-)
tools/testing/selftests/net/traceroute.sh +9 -29
@@ -10,28 +10,6 @@ PAUSE_ON_FAIL=no ################################################################################ # -log_test() -{ - local rc=$1 - local expected=$2 - local msg="$3" - - if [ ${rc} -eq ${expected} ]; then - printf "TEST: %-60s [ OK ]\n" "${msg}" - nsuccess=$((nsuccess+1)) - else - ret=1 - nfail=$((nfail+1)) - printf "TEST: %-60s [FAIL]\n" "${msg}" - if [ "${PAUSE_ON_FAIL}" = "yes" ]; then - echo - echo "hit enter to continue, 'q' to quit" - read a - [ "$a" = "q" ] && exit 1 - fi - fi -} - run_cmd() { local ns
@@ -205,9 +183,12 @@ run_traceroute6() { setup_traceroute6 + RET=0 + # traceroute6 host-2 from host-1 (expects 2000:102::2) run_cmd $h1 "traceroute6 2000:103::4 | grep -q 2000:102::2" - log_test $? 0 "IPV6 traceroute" + check_err $? "traceroute6 did not return 2000:102::2" + log_test "IPv6 traceroute" cleanup_traceroute6 }
@@ -265,9 +246,12 @@ run_traceroute() { setup_traceroute + RET=0 + # traceroute host-2 from host-1 (expects 1.0.1.1). Takes a while. run_cmd $h1 "traceroute 1.0.2.4 | grep -q 1.0.1.1" - log_test $? 0 "IPV4 traceroute" + check_err $? "traceroute did not return 1.0.1.1" + log_test "IPv4 traceroute" cleanup_traceroute }
@@ -284,9 +268,6 @@ run_tests() ################################################################################ # main -declare -i nfail=0 -declare -i nsuccess=0 - while getopts :pv o do case $o in
@@ -301,5 +282,4 @@ require_command traceroute run_tests -printf "\nTests passed: %3d\n" ${nsuccess} -printf "Tests failed: %3d\n" ${nfail} +exit "${EXIT_STATUS}"
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 340/565 openrisc: Add R_OR1K_32_PCREL relocation type module support
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: chenmiao <[email protected]>
[ Upstream commit 9d0cb6d00be891586261a35da7f8c3c956825c39 ]
To ensure the proper functioning of the jump_label test module, this patch adds support for the R_OR1K_32_PCREL relocation type for any modules. The implementation calculates the PC-relative offset by subtracting the instruction location from the target value and stores the result at the specified location.
--- arch/openrisc/kernel/module.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/openrisc/kernel/module.c +4 -0
@@ -55,6 +55,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, value |= *location &0xfc000000 ; *location = value;break ; +case R_OR1K_32_PCREL : + value -= (uint32_t )location; + *location = value; +break ;case R_OR1K_AHI16 :/* Adjust the operand to match with a signed LO16. */ value +=0x8000 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 341/565 netfilter: nf_reject: dont reply to icmp error messages
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit db99b2f2b3e2cd8227ac9990ca4a8a31a1e95e56 ]
tcp reject code won't reply to a tcp reset.
But the icmp reject 'netdev' family versions will reply to icmp dst-unreach errors, unlike icmp_send() and icmp6_send() which are used by the inet family implementation (and internally by the REJECT target).
Check for the icmp(6) type and do not respond if its an unreachable error.
Without this, something like 'ip protocol icmp reject', when used in a netdev chain attached to 'lo', cause a packet loop.
Same for two hosts that both use such a rule: each error packet will be replied to.
Such situation persist until the (bogus) rule is amended to ratelimit or checks the icmp type before the reject statement.
As the inet versions don't do this make the netdev ones follow along.
--- net/ipv4/netfilter/nf_reject_ipv4.c | 25 ++++++++++++++++++++++++ net/ipv6/netfilter/nf_reject_ipv6.c | 30 +++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+)
net/ipv4/netfilter/nf_reject_ipv4.c +25 -0
@@ -71,6 +71,27 @@ struct sk_buff *nf_reject_skb_v4_tcp_reset(struct net *net, }EXPORT_SYMBOL_GPL (nf_reject_skb_v4_tcp_reset); +static bool nf_skb_is_icmp_unreach (const struct sk_buff *skb) +{ +const struct iphdr *iph =ip_hdr (skb); +u8 *tp, _type; +int thoff; + +if (iph->protocol !=IPPROTO_ICMP ) +return false; + + thoff =skb_network_offset (skb) +sizeof (*iph); + + tp =skb_header_pointer (skb, + thoff + offsetof(struct icmphdr , type), +sizeof (_type), &_type); + +if (!tp) +return false; + +return *tp ==ICMP_DEST_UNREACH ; +} + struct sk_buff *nf_reject_skb_v4_unreach(struct net *net, struct sk_buff *oldskb, const struct net_device *dev,
@@ -91,6 +112,10 @@ struct sk_buff *nf_reject_skb_v4_unreach(struct net *net,if (ip_hdr (oldskb)->frag_off &htons (IP_OFFSET ))return NULL ; +/* don't reply to ICMP_DEST_UNREACH with ICMP_DEST_UNREACH. */ +if (nf_skb_is_icmp_unreach (oldskb)) +return NULL ; +/* RFC says return as much as we can without exceeding 576 bytes. */ len = min_t(unsigned int, 536, oldskb->len);
net/ipv6/netfilter/nf_reject_ipv6.c +30 -0
@@ -91,6 +91,32 @@ struct sk_buff *nf_reject_skb_v6_tcp_reset(struct net *net, }EXPORT_SYMBOL_GPL (nf_reject_skb_v6_tcp_reset); +static bool nf_skb_is_icmp6_unreach (const struct sk_buff *skb) +{ +const struct ipv6hdr *ip6h =ipv6_hdr (skb); +u8 proto = ip6h->nexthdr; +u8 _type, *tp; +int thoff; +__be16 fo; + + thoff =ipv6_skip_exthdr (skb, ((u8 *)(ip6h +1 ) - skb->data), &proto, &fo); + +if (thoff <0 || thoff >= skb->len || fo !=0 ) +return false; + +if (proto !=IPPROTO_ICMPV6 ) +return false; + + tp =skb_header_pointer (skb, + thoff + offsetof(struct icmp6hdr , icmp6_type), +sizeof (_type), &_type); + +if (!tp) +return false; + +return *tp ==ICMPV6_DEST_UNREACH ; +} + struct sk_buff *nf_reject_skb_v6_unreach(struct net *net, struct sk_buff *oldskb, const struct net_device *dev,
@@ -104,6 +130,10 @@ struct sk_buff *nf_reject_skb_v6_unreach(struct net *net,if (!nf_reject_ip6hdr_validate (oldskb))return NULL ; +/* Don't reply to ICMPV6_DEST_UNREACH with ICMPV6_DEST_UNREACH */ +if (nf_skb_is_icmp6_unreach (oldskb)) +return NULL ; +/* Include "As much of invoking packet as possible without the ICMPv6 * packet exceeding the minimum IPv6 MTU" in the ICMP payload. */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 342/565 x86/kvm: Prefer native qspinlock for dedicated vCPUs irrespective of PV_UNHALT
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit 960550503965094b0babd7e8c83ec66c8a763b0b ]
The commit b2798ba0b876 ("KVM: X86: Choose qspinlock when dedicated physical CPUs are available") states that when PV_DEDICATED=1 (vCPU has dedicated pCPU), qspinlock should be preferred regardless of PV_UNHALT. However, the current implementation doesn't reflect this: when PV_UNHALT=0, we still use virt_spin_lock() even with dedicated pCPUs.
This is suboptimal because:
1. Native qspinlocks should outperform virt_spin_lock() for dedicated vCPUs irrespective of HALT exiting
2. virt_spin_lock() should only be preferred when vCPUs may be preempted (non-dedicated case)
So reorder the PV spinlock checks to:
1. First handle dedicated pCPU case (disable virt_spin_lock_key)
2. Second check single CPU, and nopvspin configuration
3. Only then check PV_UNHALT support
This ensures we always use native qspinlock for dedicated vCPUs, delivering pretty performance gains at high contention levels.
--- arch/x86/kernel/kvm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/x86/kernel/kvm.c +10 -10
@@ -1089,16 +1089,6 @@ static void kvm_wait(u8 *ptr, u8 val)*/ void __init kvm_spinlock_init (void ) { -/* -* In case host doesn't support KVM_FEATURE_PV_UNHALT there is still an -* advantage of keeping virt_spin_lock_key enabled: virt_spin_lock() is -* preferred over native qspinlock when vCPU is preempted. -*/ -if (!kvm_para_has_feature (KVM_FEATURE_PV_UNHALT )) { -pr_info ("PV spinlocks disabled, no host support\n" ); -return ; - } -/* * Disable PV spinlocks and use native qspinlock when dedicated pCPUs * are available.
@@ -1118,6 +1108,16 @@ void __init kvm_spinlock_init(void) goto out; } +/* +* In case host doesn't support KVM_FEATURE_PV_UNHALT there is still an +* advantage of keeping virt_spin_lock_key enabled: virt_spin_lock() is +* preferred over native qspinlock when vCPU is preempted. +*/ +if (!kvm_para_has_feature (KVM_FEATURE_PV_UNHALT )) { +pr_info ("PV spinlocks disabled, no host support\n" ); +return ; + } +pr_info ("PV spinlocks enabled\n" );__pv_init_lock_hash ();
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 343/565 selftests: Disable dad for ipv6 in fcnal-test.sh
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Ahern <[email protected]>
[ Upstream commit 53d591730ea34f97a82f7ec6e7c987ca6e34dc21 ]
Constrained test environment; duplicate address detection is not needed and causes races so disable it.
--- tools/testing/selftests/net/fcnal-test.sh | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/net/fcnal-test.sh +2 -0
@@ -424,6 +424,8 @@ create_ns() ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.forwarding=1 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.forwarding=1 + ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.accept_dad=0 + ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.accept_dad=0 } # create veth pair to connect namespaces and apply addresses.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 344/565 eth: 8139too: Make 8139TOO_PIO depend on !NO_IOPORT_MAP
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Palmer <[email protected]>
[ Upstream commit 43adad382e1fdecabd2c4cd2bea777ef4ce4109e ]
When 8139too is probing and 8139TOO_PIO=y it will call pci_iomap_range() and from there __pci_ioport_map() for the PCI IO space.
If HAS_IOPORT_MAP=n and NO_GENERIC_PCI_IOPORT_MAP=n, like it is on my m68k config, __pci_ioport_map() becomes NULL, pci_iomap_range() will always fail and the driver will complain it couldn't map the PIO space and return an error.
NO_IOPORT_MAP seems to cover the case where what 8139too is trying to do cannot ever work so make 8139TOO_PIO depend on being it false and avoid creating an unusable driver.
--- drivers/net/ethernet/realtek/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/Kconfig +1 -1
@@ -58,7 +58,7 @@ config 8139TOO config 8139TOO_PIO bool "Use PIO instead of MMIO" default y - depends on 8139TOO + depends on 8139TOO && !NO_IOPORT_MAP help This instructs the driver to use programmed I/O ports (PIO) instead of PCI shared memory (MMIO). This can possibly solve some problems
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 345/565 selftests: Replace sleep with slowwait
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Ahern <[email protected]>
[ Upstream commit 2f186dd5585c3afb415df80e52f71af16c9d3655 ]
Replace the sleep in kill_procs with slowwait.
--- tools/testing/selftests/net/fcnal-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/fcnal-test.sh +1 -1
@@ -189,7 +189,7 @@ show_hint() kill_procs() { killall nettest ping ping6 >/dev/null 2>&1 - sleep 1 + slowwait 2 sh -c 'test -z "$(pgrep '"'^(nettest|ping|ping6)$'"')"' } set_ping_group()
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 346/565 net: devmem: expose tcp_recvmsg_locked errors
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Fomichev <[email protected]>
[ Upstream commit 18282100d7040614b553f1cad737cb689c04e2b9 ]
tcp_recvmsg_dmabuf can export the following errors:
- EFAULT when linear copy fails
- ETOOSMALL when cmsg put fails
- ENODEV if one of the frags is readable
- ENOMEM on xarray failures
But they are all ignored and replaced by EFAULT in the caller (tcp_recvmsg_locked). Expose real error to the userspace to add more transparency on what specifically fails.
In non-devmem case (skb_copy_datagram_msg) doing if (!copied) copied=-EFAULT is ok because skb_copy_datagram_msg can return only EFAULT.
--- net/ipv4/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp.c +2 -2
@@ -2780,9 +2780,9 @@ static int tcp_recvmsg_locked(struct sock *sk, struct msghdr *msg, size_t len, err =tcp_recvmsg_dmabuf (sk, skb, offset, msg, used); -if (err <=0 ) { +if (err <0 ) {if (!copied) - copied = -EFAULT ; + copied = err;break ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 347/565 udp_tunnel: use netdev_warn() instead of netdev_WARN()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alok Tiwari <[email protected]>
[ Upstream commit dc2f650f7e6857bf384069c1a56b2937a1ee370d ]
netdev_WARN() uses WARN/WARN_ON to print a backtrace along with file and line information. In this case, udp_tunnel_nic_register() returning an error is just a failed operation, not a kernel bug.
udp_tunnel_nic_register() can fail due to a memory allocation failure (kzalloc() or udp_tunnel_nic_alloc()).
This is a normal runtime error and not a kernel bug.
Replace netdev_WARN() with netdev_warn() accordingly.
--- net/ipv4/udp_tunnel_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/udp_tunnel_nic.c +1 -1
@@ -892,7 +892,7 @@ udp_tunnel_nic_netdevice_event(struct notifier_block *unused, err =udp_tunnel_nic_register (dev);if (err) -netdev_WARN (dev,"failed to register for UDP tunnel offloads: %d" , err); +netdev_warn (dev,"failed to register for UDP tunnel offloads: %d" , err);return notifier_from_errno (err); }/* All other events will need the udp_tunnel_nic state */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 348/565 HID: asus: add Z13 folio to generic group for multitouch to work
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
[ Upstream commit b595974b4afe0e171dd707da570964ff642742e3 ]
The Asus Z13 folio has a multitouch touchpad that needs to bind to the hid-multitouch driver in order to work properly. So bind it to the HID_GROUP_GENERIC group to release the touchpad and move it to the bottom so that the comment applies to it.
While at it, change the generic KEYBOARD3 name to Z13_FOLIO.
--- drivers/hid/hid-asus.c | 6 +++--- drivers/hid/hid-ids.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/hid/hid-asus.c +3 -3
@@ -1384,9 +1384,6 @@ static const struct hid_device_id asus_devices[] = { {HID_USB_DEVICE (USB_VENDOR_ID_ASUSTEK ,USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 ), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, - { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, -USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 ), - QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR ), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
@@ -1416,6 +1413,9 @@ static const struct hid_device_id asus_devices[] = {* Note bind to the HID_GROUP_GENERIC group, so that we only bind to the keyboard * part, while letting hid-multitouch.c handle the touchpad. */ + {HID_DEVICE (BUS_USB ,HID_GROUP_GENERIC , +USB_VENDOR_ID_ASUSTEK ,USB_DEVICE_ID_ASUSTEK_ROG_Z13_FOLIO ), + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD) }, { }
drivers/hid/hid-ids.h +1 -1
@@ -219,7 +219,7 @@#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 -#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30 +#define USB_DEVICE_ID_ASUSTEK_ROG_Z13_FOLIO 0x1a30#define USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR 0x18c6#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY 0x1abe#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY_X 0x1b4c
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 349/565 watchdog: s3c2410_wdt: Fix max_timeout being calculated larger
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sangwook Shin <[email protected]>
[ Upstream commit df3c6e0b6d83450563d6266e1dacc7eaf25511f4 ]
Fix the issue of max_timeout being calculated larger than actual value. The calculation result of freq / (S3C2410_WTCON_PRESCALE_MAX + 1) / S3C2410_WTCON_MAXDIV is smaller than the actual value because the remainder is discarded during the calculation process. This leads to a larger calculated value for max_timeout compared to the actual settable value. To resolve this issue, the order of calculations in the computation process has been adjusted.
--- drivers/watchdog/s3c2410_wdt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/watchdog/s3c2410_wdt.c +8 -2
@@ -27,6 +27,7 @@#include <linux/mfd/syscon.h> #include <linux/regmap.h> #include <linux/delay.h> +#include <linux/math64.h> #define S3C2410_WTCON 0x00#define S3C2410_WTDAT 0x04
@@ -344,9 +345,14 @@ static inline unsigned long s3c2410wdt_get_freq(struct s3c2410_wdt *wdt)static inline unsigned int s3c2410wdt_max_timeout (struct s3c2410_wdt *wdt) {const unsigned long freq =s3c2410wdt_get_freq (wdt); +const u64 n_max = (u64)(S3C2410_WTCON_PRESCALE_MAX +1 ) * +S3C2410_WTCON_MAXDIV *S3C2410_WTCNT_MAXCNT ; +u64 t_max =div64_ul (n_max, freq); -return S3C2410_WTCNT_MAXCNT / (freq / (S3C2410_WTCON_PRESCALE_MAX +1 ) - /S3C2410_WTCON_MAXDIV ); +if (t_max >UINT_MAX ) + t_max =UINT_MAX ; + +return t_max; }static int s3c2410wdt_disable_wdt_reset (struct s3c2410_wdt *wdt,bool mask)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 350/565 crypto: sun8i-ce - remove channel timeout field
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <[email protected]>
[ Upstream commit 9a23ea1f7558bdd3f8d2b35b1c2e16a2f9bf671e ]
Using the number of bytes in the request as DMA timeout is really inconsistent, as large requests could possibly set a timeout of hundreds of seconds.
Remove the per-channel timeout field and use a single, static DMA timeout of 3 seconds for all requests.
--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 1 - drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 2 -- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 1 - drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 1 - drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 +- 6 files changed, 3 insertions(+), 9 deletions(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c +0 -1
@@ -264,7 +264,6 @@ static int sun8i_ce_cipher_prepare(struct crypto_engine *engine, void *async_req goto theend_sgs; } - chan->timeout = areq->cryptlen; rctx->nr_sgs = ns; rctx->nr_sgd = nd;return 0 ;
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +2 -3
@@ -210,11 +210,10 @@ int sun8i_ce_run_task(struct sun8i_ce_dev *ce, int flow, const char *name)mutex_unlock (&ce->mlock);wait_for_completion_interruptible_timeout (&ce->chanlist[flow].complete, -msecs_to_jiffies (ce->chanlist[flow].timeout)); +msecs_to_jiffies (CE_DMA_TIMEOUT_MS ));if (ce->chanlist[flow].status ==0 ) { -dev_err (ce->dev,"DMA timeout for %s (tm=%d) on flow %d\n" , name, - ce->chanlist[flow].timeout, flow); +dev_err (ce->dev,"DMA timeout for %s on flow %d\n" , name, flow); err = -EFAULT ; }/* No need to lock for this read, the channel is locked so
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c +0 -2
@@ -457,8 +457,6 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)else cet->t_dlen =cpu_to_le32 (areq->nbytes /4 + j); - chan->timeout = areq->nbytes; - err =sun8i_ce_run_task (ce, flow,crypto_ahash_alg_name (tfm));dma_unmap_single (ce->dev, addr_pad, j *4 ,DMA_TO_DEVICE );
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c +0 -1
@@ -137,7 +137,6 @@ int sun8i_ce_prng_generate(struct crypto_rng *tfm, const u8 *src, cet->t_dst[0 ].addr =desc_addr_val_le32 (ce, dma_dst); cet->t_dst[0 ].len =cpu_to_le32 (todo /4 ); - ce->chanlist[flow].timeout =2000 ; err =sun8i_ce_run_task (ce,3 ,"PRNG" );mutex_unlock (&ce->rnglock);
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c +0 -1
@@ -79,7 +79,6 @@ static int sun8i_ce_trng_read(struct hwrng *rng, void *data, size_t max, bool wa cet->t_dst[0 ].addr =desc_addr_val_le32 (ce, dma_dst); cet->t_dst[0 ].len =cpu_to_le32 (todo /4 ); - ce->chanlist[flow].timeout = todo; err =sun8i_ce_run_task (ce,3 ,"TRNG" );mutex_unlock (&ce->rnglock);
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h +1 -1
@@ -106,6 +106,7 @@#define MAX_SG 8#define CE_MAX_CLOCKS 4 +#define CE_DMA_TIMEOUT_MS 3000#define MAXFLOW 4
@@ -196,7 +197,6 @@ struct sun8i_ce_flow {struct completion complete;int status;dma_addr_t t_phy; -int timeout;struct ce_task *tl;void *backup_iv;void *bounce_iv;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 351/565 PCI: dwc: Verify the single eDMA IRQ in dw_pcie_edma_irq_verify()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit 09fefb24ed5e15f3b112f6c04b21a90ea23eaf8b ]
dw_pcie_edma_irq_verify() is supposed to verify the eDMA IRQs in devicetree by fetching them using either 'dma' or 'dmaX' IRQ names. Former is used when the platform uses a single IRQ for all eDMA channels and latter is used when the platform uses separate IRQ per channel. But currently, dw_pcie_edma_irq_verify() bails out early if edma::nr_irqs is 1, i.e., when a single IRQ is used. This gives an impression that the driver could work with any single IRQ in devicetree, not necessarily with name 'dma'.
But dw_pcie_edma_irq_vector(), which actually requests the IRQ, does require the single IRQ to be named as 'dma'. So this creates inconsistency between dw_pcie_edma_irq_verify() and dw_pcie_edma_irq_vector().
Thus, to fix this inconsistency, make sure dw_pcie_edma_irq_verify() also verifies the single IRQ name by removing the bail out code.
--- drivers/pci/controller/dwc/pcie-designware.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pci/controller/dwc/pcie-designware.c +1 -3
@@ -978,9 +978,7 @@ static int dw_pcie_edma_irq_verify(struct dw_pcie *pci)char name[6 ];int ret; -if (pci->edma.nr_irqs ==1 ) -return 0 ; -else if (pci->edma.nr_irqs >1 ) +if (pci->edma.nr_irqs >1 )return pci->edma.nr_irqs != ch_cnt ? -EINVAL :0 ; ret =platform_get_irq_byname_optional (pdev,"dma" );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 352/565 crypto: ccp - Fix incorrect payload size calculation in psp_poulate_hsti()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunseong Kim <[email protected]>
[ Upstream commit 2b0dc40ac6ca16ee0c489927f4856cf9cd3874c7 ]
payload_size field of the request header is incorrectly calculated using sizeof(req). Since 'req' is a pointer (struct hsti_request *), sizeof(req) returns the size of the pointer itself (e.g., 8 bytes on a 64-bit system), rather than the size of the structure it points to. This leads to an incorrect payload size being sent to the Platform Security Processor (PSP), potentially causing the HSTI query command to fail.
Fix this by using sizeof(*req) to correctly calculate the size of the struct hsti_request.
--- drivers/crypto/ccp/hsti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/hsti.c +1 -1
@@ -88,7 +88,7 @@ static int psp_poulate_hsti(struct psp_device *psp)if (!req)return -ENOMEM ; - req->header.payload_size =sizeof (req); + req->header.payload_size =sizeof (*req); ret =psp_send_platform_access_msg (PSP_CMD_HSTI_QUERY , (struct psp_request *)req);if (ret)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 353/565 crypto: caam - double the entropy delay interval for retry
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaurav Jain <[email protected]>
[ Upstream commit 9048beca9c5614d486e2b492c0a7867164bf56a8 ]
during entropy evaluation, if the generated samples fail any statistical test, then, all of the bits will be discarded, and a second set of samples will be generated and tested.
the entropy delay interval should be doubled before performing the retry.
also, ctrlpriv->rng4_sh_init and inst_handles both reads RNG DRNG status register, but only inst_handles is updated before every retry. so only check inst_handles and removing ctrlpriv->rng4_sh_init
--- drivers/crypto/caam/ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/caam/ctrl.c +2 -2
@@ -702,12 +702,12 @@ static int caam_ctrl_rng_init(struct device *dev)*/ if (needs_entropy_delay_adjustment ()) ent_delay =12000 ; -if (!(ctrlpriv->rng4_sh_init || inst_handles)) { +if (!inst_handles) {dev_info (dev,"Entropy delay = %u\n" , ent_delay);kick_trng (dev, ent_delay); - ent_delay +=400 ; + ent_delay = ent_delay *2 ; }/* * if instantiate_rng(...) fails, the loop will rerun
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 354/565 net/cls_cgroup: Fix task_get_classid() during qdisc run
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yafang Shao <[email protected]>
[ Upstream commit 66048f8b3cc7e462953c04285183cdee43a1cb89 ]
During recent testing with the netem qdisc to inject delays into TCP traffic, we observed that our CLS BPF program failed to function correctly due to incorrect classid retrieval from task_get_classid(). The issue manifests in the following call stack:
bpf_get_cgroup_classid+5
cls_bpf_classify+507
__tcf_classify+90
tcf_classify+217
__dev_queue_xmit+798
bond_dev_queue_xmit+43
__bond_start_xmit+211
bond_start_xmit+70
dev_hard_start_xmit+142
sch_direct_xmit+161
__qdisc_run+102 <<<<< Issue location
__dev_xmit_skb+1015
__dev_queue_xmit+637
neigh_hh_output+159
ip_finish_output2+461
__ip_finish_output+183
ip_finish_output+41
ip_output+120
ip_local_out+94
__ip_queue_xmit+394
ip_queue_xmit+21
__tcp_transmit_skb+2169
tcp_write_xmit+959
__tcp_push_pending_frames+55
tcp_push+264
tcp_sendmsg_locked+661
tcp_sendmsg+45
inet_sendmsg+67
sock_sendmsg+98
sock_write_iter+147
vfs_write+786
ksys_write+181
__x64_sys_write+25
do_syscall_64+56
entry_SYSCALL_64_after_hwframe+100The problem occurs when multiple tasks share a single qdisc. In such cases, __qdisc_run() may transmit skbs created by different tasks. Consequently, task_get_classid() retrieves an incorrect classid since it references the current task's context rather than the skb's originating task.
Given that dev_queue_xmit() always executes with bh disabled, we can use softirq_count() instead to obtain the correct classid.
The simple steps to reproduce this issue:
1. Add network delay to the network interface:
such as: tc qdisc add dev bond0 root netem delay 1.5ms
2. Build two distinct net_cls cgroups, each with a network-intensive task
3. Initiate parallel TCP streams from both tasks to external servers.
Under this specific condition, the issue reliably occurs. The kernel eventually dequeues an SKB that originated from Task-A while executing in the context of Task-B.
It is worth noting that it will change the established behavior for a slightly different scenario:
<sock S is created by task A>
<class ID for task A is changed>
<skb is created by sock S xmit and classified>
prior to this patch the skb will be classified with the 'new' task A classid, now with the old/original one. The bpf_get_cgroup_classid_curr() function is a more appropriate choice for this case.
--- include/net/cls_cgroup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/cls_cgroup.h +1 -1
@@ -63,7 +63,7 @@ static inline u32 task_get_classid(const struct sk_buff *skb)* calls by looking at the number of nested bh disable calls because * softirqs always disables bh. */ -if (in_serving_softirq ()) { +if (softirq_count ()) {struct sock *sk =skb_to_full_sk (skb);/* If there is an sock_cgroup_classid we'll use that. */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 355/565 wifi: mt76: mt7921: Add 160MHz beamformee capability for mt7922 device
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quan Zhou <[email protected]>
[ Upstream commit 25ef5b5d02ac03fe8dd91cf25bd011a570fbeba2 ]
Enable 160MHz beamformee support on mt7922 by updating HE capability element configuration. Previously, only 160MHz channel width was set, but beamformee for 160MHz was not properly advertised. This patch adds BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 capability to allow devices to utilize 160MHz BW for beamforming.
Tested by connecting to 160MHz-bandwidth beamforming AP and verified HE capability.
--- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/main.c +2 -0
@@ -135,6 +135,8 @@ mt7921_init_he_caps(struct mt792x_phy *phy, enum nl80211_band band,if (is_mt7922 (phy->mt76->dev)) { he_cap_elem->phy_cap_info[0 ] |=IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G ; + he_cap_elem->phy_cap_info[4 ] |= +IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 ; he_cap_elem->phy_cap_info[8 ] |=IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU |IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 356/565 wifi: mt76: mt7996: Temporarily disable EPCS
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Lin <[email protected]>
[ Upstream commit e6291bb7a5935b2f1d337fd7a58eab7ada6678ad ]
EPCS is not yet ready, so do not claim to support it.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +0 -1
@@ -1190,7 +1190,6 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band, eht_cap->has_eht = true; eht_cap_elem->mac_cap_info[0 ] = -IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS |IEEE80211_EHT_MAC_CAP0_OM_CONTROL |u8_encode_bits (IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 ,IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 357/565 wifi: mt76: mt76_eeprom_override to int
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <[email protected]>
[ Upstream commit c7c682100cec97b699fe24b26d89278fd459cc84 ]
mt76_eeprom_override has of_get_mac_address, which can return -EPROBE_DEFER if the nvmem driver gets loaded after mt76 for some reason.
Make sure this gets passed to probe so that nvmem mac overrides always work.
--- drivers/net/wireless/mediatek/mt76/eeprom.c | 9 +++++++-- drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c | 3 +-- drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c | 4 +--- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 5 ++++- drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 6 +++++- drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c | 4 +++- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 4 +--- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 4 +++- drivers/net/wireless/mediatek/mt76/mt7921/init.c | 4 +++- drivers/net/wireless/mediatek/mt76/mt7925/init.c | 4 +++- drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c | 3 +-- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 4 +++- 13 files changed, 36 insertions(+), 20 deletions(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +7 -2
@@ -163,13 +163,16 @@ static int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int len)return mt76_get_of_data_from_nvmem (dev, eep,"eeprom" , len); } -void +int mt76_eeprom_override (struct mt76_phy *phy) {struct mt76_dev *dev = phy->dev;struct device_node *np = dev->dev->of_node; +int err; -of_get_mac_address (np, phy->macaddr); + err =of_get_mac_address (np, phy->macaddr); +if (err == -EPROBE_DEFER ) +return err;if (!is_valid_ether_addr (phy->macaddr)) {eth_random_addr (phy->macaddr);
@@ -177,6 +180,8 @@ mt76_eeprom_override(struct mt76_phy *phy)"Invalid MAC address, using random address %pM\n" , phy->macaddr); } + +return 0 ; }EXPORT_SYMBOL_GPL (mt76_eeprom_override);
drivers/net/wireless/mediatek/mt76/mt76.h +1 -1
@@ -1185,7 +1185,7 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str, s8 *val, int len);int mt76_eeprom_init (struct mt76_dev *dev,int len); -void mt76_eeprom_override (struct mt76_phy *phy); +int mt76_eeprom_override (struct mt76_phy *phy);int mt76_get_of_data_from_mtd (struct mt76_dev *dev,void *eep,int offset,int len);int mt76_get_of_data_from_nvmem (struct mt76_dev *dev,void *eep,const char *cell_name,int len);
drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c +1 -2
@@ -182,7 +182,6 @@ int mt7603_eeprom_init(struct mt7603_dev *dev) dev->mphy.antenna_mask =1 ; dev->mphy.chainmask = dev->mphy.antenna_mask; -mt76_eeprom_override (&dev->mphy); -return 0 ; +return mt76_eeprom_override (&dev->mphy); }
drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c +1 -3
@@ -351,8 +351,6 @@ int mt7615_eeprom_init(struct mt7615_dev *dev, u32 addr)memcpy (dev->mphy.macaddr, dev->mt76.eeprom.data +MT_EE_MAC_ADDR ,ETH_ALEN ); -mt76_eeprom_override (&dev->mphy); - -return 0 ; +return mt76_eeprom_override (&dev->mphy); }EXPORT_SYMBOL_GPL (mt7615_eeprom_init);
drivers/net/wireless/mediatek/mt76/mt7615/init.c +4 -1
@@ -570,7 +570,10 @@ int mt7615_register_ext_phy(struct mt7615_dev *dev) ETH_ALEN); mphy->macaddr[0 ] |=2 ; mphy->macaddr[0 ] ^=BIT (7 ); -mt76_eeprom_override (mphy); + + ret =mt76_eeprom_override (mphy); +if (ret) +return ret;/* second phy can only handle 5 GHz */ mphy->cap.has_5ghz = true;
drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c +5 -1
@@ -332,7 +332,11 @@ int mt76x0_eeprom_init(struct mt76x02_dev *dev)memcpy (dev->mphy.macaddr, (u8 *)dev->mt76.eeprom.data +MT_EE_MAC_ADDR ,ETH_ALEN ); -mt76_eeprom_override (&dev->mphy); + + err =mt76_eeprom_override (&dev->mphy); +if (err) +return err; +mt76x02_mac_setaddr (dev, dev->mphy.macaddr);mt76x0_set_chip_cap (dev);
drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c +3 -1
@@ -499,7 +499,9 @@ int mt76x2_eeprom_init(struct mt76x02_dev *dev)mt76x02_eeprom_parse_hw_cap (dev);mt76x2_eeprom_get_macaddr (dev); -mt76_eeprom_override (&dev->mphy); + ret =mt76_eeprom_override (&dev->mphy); +if (ret) +return ret; dev->mphy.macaddr[0 ] &= ~BIT (1 );return 0 ;
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +1 -3
@@ -284,9 +284,7 @@ int mt7915_eeprom_init(struct mt7915_dev *dev)memcpy (dev->mphy.macaddr, dev->mt76.eeprom.data +MT_EE_MAC_ADDR ,ETH_ALEN ); -mt76_eeprom_override (&dev->mphy); - -return 0 ; +return mt76_eeprom_override (&dev->mphy); } int mt7915_eeprom_get_target_power(struct mt7915_dev *dev,
drivers/net/wireless/mediatek/mt76/mt7915/init.c +3 -1
@@ -689,7 +689,9 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy) mphy->macaddr[0 ] |=2 ; mphy->macaddr[0 ] ^=BIT (7 ); } -mt76_eeprom_override (mphy); + ret =mt76_eeprom_override (mphy); +if (ret) +return ret;/* init wiphy according to mphy and phy */ mt7915_init_wiphy (phy);
drivers/net/wireless/mediatek/mt76/mt7921/init.c +3 -1
@@ -182,7 +182,9 @@ static int __mt7921_init_hardware(struct mt792x_dev *dev)if (ret) goto out; -mt76_eeprom_override (&dev->mphy); + ret =mt76_eeprom_override (&dev->mphy); +if (ret) + goto out; ret =mt7921_mcu_set_eeprom (dev);if (ret)
drivers/net/wireless/mediatek/mt76/mt7925/init.c +3 -1
@@ -132,7 +132,9 @@ static int __mt7925_init_hardware(struct mt792x_dev *dev)if (ret) goto out; -mt76_eeprom_override (&dev->mphy); + ret =mt76_eeprom_override (&dev->mphy); +if (ret) + goto out; ret =mt7925_mcu_set_eeprom (dev);if (ret)
drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c +1 -2
@@ -235,9 +235,8 @@ int mt7996_eeprom_init(struct mt7996_dev *dev)return ret;memcpy (dev->mphy.macaddr, dev->mt76.eeprom.data +MT_EE_MAC_ADDR ,ETH_ALEN ); -mt76_eeprom_override (&dev->mphy); -return 0 ; +return mt76_eeprom_override (&dev->mphy); } int mt7996_eeprom_get_target_power(struct mt7996_dev *dev,
drivers/net/wireless/mediatek/mt76/mt7996/init.c +3 -1
@@ -601,7 +601,9 @@ static int mt7996_register_phy(struct mt7996_dev *dev, struct mt7996_phy *phy,if (band ==MT_BAND2 ) mphy->macaddr[0 ] ^=BIT (6 ); } -mt76_eeprom_override (mphy); + ret =mt76_eeprom_override (mphy); +if (ret) + goto error;/* init wiphy according to mphy and phy */ mt7996_init_wiphy (mphy->hw, wed);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 358/565 ALSA: serial-generic: remove shared static buffer
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Keeping <[email protected]>
[ Upstream commit 84973249011fda3ff292f83439a062fec81ef982 ]
If multiple instances of this driver are instantiated and try to send concurrently then the single static buffer snd_serial_generic_tx_work() will cause corruption in the data output.
Move the buffer into the per-instance driver data to avoid this.
--- sound/drivers/serial-generic.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
sound/drivers/serial-generic.c +7 -5
@@ -37,6 +37,8 @@ MODULE_LICENSE("GPL");#define SERIAL_TX_STATE_ACTIVE 1#define SERIAL_TX_STATE_WAKEUP 2 +#define INTERNAL_BUF_SIZE 256 +struct snd_serial_generic {struct serdev_device *serdev;
@@ -51,6 +53,7 @@ struct snd_serial_generic {struct work_struct tx_work;unsigned long tx_state; +char tx_buf[INTERNAL_BUF_SIZE ]; };static void snd_serial_generic_tx_wakeup (struct snd_serial_generic *drvdata)
@@ -61,11 +64,8 @@ static void snd_serial_generic_tx_wakeup(struct snd_serial_generic *drvdata)schedule_work (&drvdata->tx_work); } -#define INTERNAL_BUF_SIZE 256 -static void snd_serial_generic_tx_work (struct work_struct *work) { -static char buf[INTERNAL_BUF_SIZE ];int num_bytes; struct snd_serial_generic *drvdata = container_of(work, struct snd_serial_generic, tx_work);
@@ -78,8 +78,10 @@ static void snd_serial_generic_tx_work(struct work_struct *work)if (!test_bit (SERIAL_MODE_OUTPUT_OPEN , &drvdata->filemode))break ; - num_bytes =snd_rawmidi_transmit_peek (substream, buf,INTERNAL_BUF_SIZE ); - num_bytes =serdev_device_write_buf (drvdata->serdev, buf, num_bytes); + num_bytes =snd_rawmidi_transmit_peek (substream, drvdata->tx_buf, +INTERNAL_BUF_SIZE ); + num_bytes =serdev_device_write_buf (drvdata->serdev, drvdata->tx_buf, + num_bytes);if (!num_bytes)break ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 359/565 wifi: mt76: mt7996: fix memory leak on mt7996_mcu_sta_key_tlv error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 7c0f63fe37a5da2c13fc35c89053b31be8ead895 ]
Free the allocated skb on error
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +3 -1
@@ -2283,8 +2283,10 @@ int mt7996_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,return PTR_ERR (skb); ret =mt7996_mcu_sta_key_tlv (wcid, skb, key, cmd); -if (ret) +if (ret) { +dev_kfree_skb (skb);return ret; + }return mt76_mcu_skb_send_msg (dev, skb, mcu_cmd, true); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 360/565 drm/amdgpu: Use memdup_array_user in amdgpu_cs_wait_fences_ioctl
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tvrtko Ursulin <[email protected]>
[ Upstream commit dea75df7afe14d6217576dbc28cc3ec1d1f712fb ]
Replace kmalloc_array() + copy_from_user() with memdup_array_user().
This shrinks the source code and improves separation between the kernel and userspace slabs.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -14
@@ -1737,30 +1737,21 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, {struct amdgpu_device *adev =drm_to_adev (dev);union drm_amdgpu_wait_fences *wait = data; -uint32_t fence_count = wait->in.fence_count; -struct drm_amdgpu_fence *fences_user;struct drm_amdgpu_fence *fences;int r;/* Get the fences from userspace */ - fences =kmalloc_array (fence_count,sizeof (struct drm_amdgpu_fence ), -GFP_KERNEL ); -if (fences ==NULL ) -return -ENOMEM ; - - fences_user =u64_to_user_ptr (wait->in.fences); -if (copy_from_user (fences, fences_user, -sizeof (struct drm_amdgpu_fence ) * fence_count)) { - r = -EFAULT ; - goto err_free_fences; - } + fences =memdup_array_user (u64_to_user_ptr (wait->in.fences), + wait->in.fence_count, +sizeof (struct drm_amdgpu_fence )); +if (IS_ERR (fences)) +return PTR_ERR (fences);if (wait->in.wait_all) r =amdgpu_cs_wait_all_fences (adev, filp, wait, fences);else r =amdgpu_cs_wait_any_fence (adev, filp, wait, fences); -err_free_fences:kfree (fences);return r;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 361/565 drm/amd/display: Set up pixel encoding for YCBCR422
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 5e76bc677cb7c92b37d8bc66bb67a18922895be2 ]
[Why]fill_stream_properties_from_drm_display_mode() will not configure pixel encoding to YCBCR422 when the DRM color format supports YCBCR422 but not YCBCR420 or YCBCR4444. Instead it will fallback to RGB.
[How]
Add support for YCBCR422 in pixel encoding mapping.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -6161,6 +6161,9 @@ static void fill_stream_properties_from_drm_display_mode( && aconnector && aconnector->force_yuv420_output) timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420; + else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR422) + && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) + timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR422; else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR444) && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 362/565 drm/amd/display: fix dml ms order of operations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ausef Yousof <[email protected]>
[ Upstream commit 02a6c2e4b28ff31f7a904c196a99fb2efe81e2cf ]
[why&how]
small error in order of operations in immediateflipbytes calculation on dml ms side that can result in dml ms and mp mismatch immediateflip support for a given pipe and thus an invalid hw state, correct the order to align with mp.
--- drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +1 -1
@@ -6527,7 +6527,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) mode_lib->ms.TotImmediateFlipBytes =0 ;for (k =0 ; k <= mode_lib->ms.num_active_planes -1 ; k++) {if (!(mode_lib->ms.policy.ImmediateFlipRequirement[k] == dml_immediate_flip_not_required)) { - mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k] + mode_lib->ms.MetaRowBytes[j][k]; + mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * (mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k] + mode_lib->ms.MetaRowBytes[j][k]);if (mode_lib->ms.use_one_row_for_frame_flip[j][k]) { mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * (2 * mode_lib->ms.DPTEBytesPerRow[j][k]); }else {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 363/565 drm/amd: Avoid evicting resources at S5
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <[email protected]>
[ Upstream commit 531df041f2a5296174abd8292d298eb62fe1ea97 ]
Normally resources are evicted on dGPUs at suspend or hibernate and on APUs at hibernate. These steps are unnecessary when using the S4 callbacks to put the system into S5.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -0
@@ -4731,6 +4731,10 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)if ((adev->in_s3 || adev->in_s0ix) && (adev->flags &AMD_IS_APU ))return 0 ; +/* No need to evict when going to S5 through S4 callbacks */ +if (system_state ==SYSTEM_POWER_OFF ) +return 0 ; + ret =amdgpu_ttm_evict_resources (adev,TTM_PL_VRAM );if (ret)DRM_WARN ("evicting device resources failed\n" );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 364/565 drm/amd/display: Fix DVI-D/HDMI adapters
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Kristóf <[email protected]>
[ Upstream commit 489f0f600ce2c0dae640df9035e1d82677d2580f ]
When the EDID has the HDMI bit, we should simply select the HDMI signal type even on DVI ports.
For reference see, the legacy amdgpu display code:amdgpu_atombios_encoder_get_encoder_mode
which selects ATOM_ENCODER_MODE_HDMI for the same case.
This commit fixes DVI connectors to work with DVI-D/HDMI adapters so that they can now produce output over these connectors for HDMI monitors with higher bandwidth modes. With this change, even HDMI audio works through DVI.
For testing, I used a CAA-DMDHFD3 DVI-D/HDMI adapter with the following GPUs:
Tahiti (DCE 6) - DC can now output 4K 30 Hz over DVI Polaris 10 (DCE 11.2) - DC can now output 4K 60 Hz over DVI
--- drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/link/link_detection.c +4 -0
@@ -1132,6 +1132,10 @@ static bool detect_link_and_local_sink(struct dc_link *link,if (sink->sink_signal ==SIGNAL_TYPE_HDMI_TYPE_A && !sink->edid_caps.edid_hdmi) sink->sink_signal =SIGNAL_TYPE_DVI_SINGLE_LINK ; +else if (dc_is_dvi_signal (sink->sink_signal) && + aud_support->hdmi_audio_native && + sink->edid_caps.edid_hdmi) + sink->sink_signal =SIGNAL_TYPE_HDMI_TYPE_A ;if (link->local_sink &&dc_is_dp_signal (sink_caps.signal))dp_trace_init (link);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 365/565 drm/amd/display: Disable VRR on DCE 6
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Kristóf <[email protected]>
[ Upstream commit 043c87d7d56e135393f8aab927148096e2d17589 ]
DCE 6 was not advertised as being able to support VRR, so let's mark it as unsupported for now.
The VRR implementation in amdgpu_dm depends on the VUPDATE interrupt which is not registered for DCE 6.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- drivers/gpu/drm/amd/display/dc/dc_helper.c | 5 +++++ drivers/gpu/drm/amd/display/dc/dm_services.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -1
@@ -10455,6 +10455,8 @@ static void get_freesync_config_for_crtc( }else { config.state =VRR_STATE_INACTIVE ; } + }else { + config.state =VRR_STATE_UNSUPPORTED ; } out: new_crtc_state->freesync_config = config;
@@ -12357,7 +12359,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, dm_con_state =to_dm_connector_state (connector->state); -if (!adev->dm.freesync_module) +if (!adev->dm.freesync_module || !dc_supports_vrr (sink->ctx->dce_version)) goto update;/* Some eDP panels only have the refresh rate range info in DisplayID */
drivers/gpu/drm/amd/display/dc/dc_helper.c +5 -0
@@ -747,3 +747,8 @@ char *dce_version_to_string(const int version)return "Unknown" ; } } + +bool dc_supports_vrr (const enum dce_version v) +{ +return v >=DCE_VERSION_8_0 ; +}
drivers/gpu/drm/amd/display/dc/dm_services.h +2 -0
@@ -304,4 +304,6 @@ void dm_dtn_log_end(struct dc_context *ctx,char *dce_version_to_string (const int version); +bool dc_supports_vrr (const enum dce_version v); +#endif /* __DM_SERVICES_H__ */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 366/565 drm/amd/display/dml2: Guard dml21_map_dc_state_into_dml_display_cfg with DC_FP_START
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xi Ruoyao <[email protected]>
[ Upstream commit c97a7dccb3ed680031011cfc1457506e6de49c9a ]
dml21_map_dc_state_into_dml_display_cfg calls (the call is usually inlined by the compiler) populate_dml21_surface_config_from_plane_state and populate_dml21_plane_config_from_plane_state which may use FPU. In a x86-64 build:
$ objdump --disassemble=dml21_map_dc_state_into_dml_display_cfg \
Quoted 2 lines
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.o| grep %xmm -c
63
Thus it needs to be guarded with DC_FP_START. But we must note that the current code quality of the in-kernel FPU use in AMD dml2 is very much
problematic: we are actually calling DC_FP_START in dml21_wrapper.c here, and this translation unit is built with CC_FLAGS_FPU. Strictly speaking this does not make any sense: with CC_FLAGS_FPU the compiler is allowed to generate FPU uses anywhere in the translated code, perhaps out of the DC_FP_START guard. This problematic pattern also occurs in at least dml2_wrapper.c, dcn35_fpu.c, and dcn351_fpu.c. Thus we really need a careful audit and refactor for the in-kernel FPU uses, and this patch is simply whacking a mole. However per the reporter, whacking this mole is enough to make a 9060XT "just work."
--- drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +4 -0
@@ -217,7 +217,9 @@ static bool dml21_mode_check_and_programming(const struct dc *in_dc, struct dc_s dml_ctx->config.svp_pstate.callbacks.release_phantom_streams_and_planes (in_dc, context);/* Populate stream, plane mappings and other fields in display config. */ +DC_FP_START (); result =dml21_map_dc_state_into_dml_display_cfg (in_dc, context, dml_ctx); +DC_FP_END ();if (!result)return false;
@@ -271,7 +273,9 @@ static bool dml21_check_mode_support(const struct dc *in_dc, struct dc_state *co dml_ctx->config.svp_pstate.callbacks.release_phantom_streams_and_planes (in_dc, context); mode_support->dml2_instance = dml_init->dml2_instance; +DC_FP_START ();dml21_map_dc_state_into_dml_display_cfg (in_dc, context, dml_ctx); +DC_FP_END (); dml_ctx->v21.mode_programming.dml2_instance->scratch.build_mode_programming_locals.mode_programming_params.programming = dml_ctx->v21.mode_programming.programming;DC_FP_START (); is_supported =dml2_check_mode_supported (mode_support);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 367/565 page_pool: always add GFP_NOWARN for ATOMIC allocations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit f3b52167a0cb23b27414452fbc1278da2ee884fc ]
Driver authors often forget to add GFP_NOWARN for page allocation from the datapath. This is annoying to users as OOMs are a fact of life, and we pretty much expect network Rx to hit page allocation failures during OOM. Make page pool add GFP_NOWARN for ATOMIC allocations by default.
--- net/core/page_pool.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/core/page_pool.c +6 -0
@@ -586,6 +586,12 @@ static noinline netmem_ref __page_pool_alloc_pages_slow(struct page_pool *pool,netmem_ref netmem;int i, nr_pages; +/* Unconditionally set NOWARN if allocating from NAPI. +* Drivers forget to set it, and OOM reports on packet Rx are useless. +*/ +if ((gfp &GFP_ATOMIC ) ==GFP_ATOMIC ) + gfp |= __GFP_NOWARN; +/* Don't support bulk alloc for high-order pages */ if (unlikely (pp_order))return page_to_netmem (__page_pool_alloc_page_order (pool, gfp));
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 368/565 ethernet: Extend device_get_mac_address() to use NVMEM
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit d2d3f529e7b6ff2aa432b16a2317126621c28058 ]
A lot of modern SoC have the ability to store MAC addresses in their NVMEM. So extend the generic function device_get_mac_address() to obtain the MAC address from an nvmem cell named 'mac-address' in case there is no firmware node which contains the MAC address directly.
--- net/ethernet/eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/ethernet/eth.c +4 -1
@@ -613,7 +613,10 @@ EXPORT_SYMBOL(fwnode_get_mac_address);*/ int device_get_mac_address (struct device *dev,char *addr) { -return fwnode_get_mac_address (dev_fwnode (dev), addr); +if (!fwnode_get_mac_address (dev_fwnode (dev), addr)) +return 0 ; + +return nvmem_get_mac_address (dev, addr); }EXPORT_SYMBOL (device_get_mac_address);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 369/565 HID: i2c-hid: Resolve touchpad issues on Dell systems during S4
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <[email protected]>
[ Upstream commit 7d62beb102d6fa9a4e5e874be7fbf47a62fcc4f6 ]
Dell systems utilize an EC-based touchpad emulation when the ACPI touchpad _DSM is not invoked. This emulation acts as a secondary master on the I2C bus, designed for scenarios where the I2C touchpad driver is absent, such as in BIOS menus. Typically, loading the i2c-hid module triggers the _DSM at initialization, disabling the EC-based emulation.
However, if the i2c-hid module is missing from the boot kernel used for hibernation snapshot restoration, the _DSM remains uncalled, resulting in dual masters on the I2C bus and subsequent arbitration errors. This issue arises when i2c-hid resides in the rootfs instead of the kernel or initramfs.
To address this, switch from using the SYSTEM_SLEEP_PM_OPS() macro to dedicated callbacks, introducing a specific callback for restoring the S4 image. This callback ensures the _DSM is invoked.
--- drivers/hid/i2c-hid/i2c-hid-acpi.c | 8 ++++++++ drivers/hid/i2c-hid/i2c-hid-core.c | 28 +++++++++++++++++++++++++++- drivers/hid/i2c-hid/i2c-hid.h | 2 ++ 3 files changed, 37 insertions(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid-acpi.c +8 -0
@@ -76,6 +76,13 @@ static int i2c_hid_acpi_get_descriptor(struct i2c_hid_acpi *ihid_acpi)return hid_descriptor_address; } +static void i2c_hid_acpi_restore_sequence (struct i2chid_ops *ops) +{ + struct i2c_hid_acpi *ihid_acpi = container_of(ops, struct i2c_hid_acpi, ops); + +i2c_hid_acpi_get_descriptor (ihid_acpi); +} +static void i2c_hid_acpi_shutdown_tail (struct i2chid_ops *ops) { struct i2c_hid_acpi *ihid_acpi = container_of(ops, struct i2c_hid_acpi, ops);
@@ -96,6 +103,7 @@ static int i2c_hid_acpi_probe(struct i2c_client *client) ihid_acpi->adev =ACPI_COMPANION (dev); ihid_acpi->ops.shutdown_tail = i2c_hid_acpi_shutdown_tail; + ihid_acpi->ops.restore_sequence = i2c_hid_acpi_restore_sequence; ret =i2c_hid_acpi_get_descriptor (ihid_acpi);if (ret <0 )
drivers/hid/i2c-hid/i2c-hid-core.c +27 -1
@@ -955,6 +955,14 @@ static void i2c_hid_core_shutdown_tail(struct i2c_hid *ihid) ihid->ops->shutdown_tail (ihid->ops); } +static void i2c_hid_core_restore_sequence (struct i2c_hid *ihid) +{ +if (!ihid->ops->restore_sequence) +return ; + + ihid->ops->restore_sequence (ihid->ops); +} +static int i2c_hid_core_suspend (struct i2c_hid *ihid,bool force_poweroff) {struct i2c_client *client = ihid->client;
@@ -1350,8 +1358,26 @@ static int i2c_hid_core_pm_resume(struct device *dev)return i2c_hid_core_resume (ihid); } +static int i2c_hid_core_pm_restore (struct device *dev) +{ +struct i2c_client *client =to_i2c_client (dev); +struct i2c_hid *ihid =i2c_get_clientdata (client); + +if (ihid->is_panel_follower) +return 0 ; + +i2c_hid_core_restore_sequence (ihid); + +return i2c_hid_core_resume (ihid); +} +const struct dev_pm_ops i2c_hid_core_pm = { -SYSTEM_SLEEP_PM_OPS (i2c_hid_core_pm_suspend, i2c_hid_core_pm_resume) + .suspend =pm_sleep_ptr (i2c_hid_core_pm_suspend), + .resume =pm_sleep_ptr (i2c_hid_core_pm_resume), + .freeze =pm_sleep_ptr (i2c_hid_core_pm_suspend), + .thaw =pm_sleep_ptr (i2c_hid_core_pm_resume), + .poweroff =pm_sleep_ptr (i2c_hid_core_pm_suspend), + .restore =pm_sleep_ptr (i2c_hid_core_pm_restore), };EXPORT_SYMBOL_GPL (i2c_hid_core_pm);
drivers/hid/i2c-hid/i2c-hid.h +2 -0
@@ -27,11 +27,13 @@ static inline u32 i2c_hid_get_dmi_quirks(const u16 vendor, const u16 product)* @power_up: do sequencing to power up the device. * @power_down: do sequencing to power down the device. * @shutdown_tail: called at the end of shutdown. +* @restore_sequence: hibernation restore sequence. */ struct i2chid_ops {int (*power_up)(struct i2chid_ops *ops);void (*power_down)(struct i2chid_ops *ops);void (*shutdown_tail)(struct i2chid_ops *ops); +void (*restore_sequence)(struct i2chid_ops *ops); }; int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 370/565 drm/xe/guc: Return an error code if the GuC load fails
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Harrison <[email protected]>
[ Upstream commit 3b09b11805bfee32d5a0000f5ede42c07237a6c4 ]
Due to multiple explosion issues in the early days of the Xe driver, the GuC load was hacked to never return a failure. That prevented kernel panics and such initially, but now all it achieves is creating more confusing errors when the driver tries to submit commands to a GuC it already knows is not there. So fix that up.
As a stop-gap and to help with debug of load failures due to invalid GuC init params, a wedge call had been added to the inner GuC load function. The reason being that it leaves the GuC log accessible via debugfs. However, for an end user, simply aborting the module load is much cleaner than wedging and trying to continue. The wedge blocks user submissions but it seems that various bits of the driver itself still try to submit to a dead GuC and lots of subsequent errors occur. And with regards to developers debugging why their particular code change is being rejected by the GuC, it is trivial to either add the wedge back in and hack the return code to zero again or to just do a GuC log dump to dmesg.
v2: Add support for error injection testing and drop the now redundant wedge call.
--- drivers/gpu/drm/xe/xe_guc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_guc.c +9 -4
@@ -593,7 +593,7 @@ static s32 guc_pc_get_cur_freq(struct xe_guc_pc *guc_pc)#endif #define GUC_LOAD_TIME_WARN_MS 200 -static void guc_wait_ucode (struct xe_guc *guc) +static int guc_wait_ucode (struct xe_guc *guc) {struct xe_gt *gt =guc_to_gt (guc);struct xe_guc_pc *guc_pc = >->uc.guc.pc;
@@ -699,7 +699,7 @@ static void guc_wait_ucode(struct xe_guc *guc)break ; } -xe_device_declare_wedged (gt_to_xe (gt)); +return -EPROTO ; }else if (delta_ms >GUC_LOAD_TIME_WARN_MS ) {xe_gt_warn (gt,"excessive init time: %lldms! [status = 0x%08X, timeouts = %d]\n" , delta_ms, status, count);
@@ -711,7 +711,10 @@ static void guc_wait_ucode(struct xe_guc *guc) delta_ms,xe_guc_pc_get_act_freq (guc_pc),guc_pc_get_cur_freq (guc_pc), before_freq, status, count); } + +return 0 ; } +ALLOW_ERROR_INJECTION (guc_wait_ucode,ERRNO );static int __xe_guc_upload (struct xe_guc *guc) {
@@ -743,14 +746,16 @@ static int __xe_guc_upload(struct xe_guc *guc) goto out;/* Wait for authentication */ -guc_wait_ucode (guc); + ret =guc_wait_ucode (guc); +if (ret) + goto out;xe_uc_fw_change_status (&guc->fw,XE_UC_FIRMWARE_RUNNING );return 0 ; out:xe_uc_fw_change_status (&guc->fw,XE_UC_FIRMWARE_LOAD_FAIL ); -return 0 /* FIXME: ret, don't want to stop load currently */ ; +return ret; }static int vf_guc_min_load_for_hwconfig (struct xe_guc *guc)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 371/565 drm/amdgpu: reject gang submissions under SRIOV
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <[email protected]>
[ Upstream commit d7ddcf921e7d0d8ebe82e89635bc9dc26ba9540d ]
Gang submission means that the kernel driver guarantees that multiple submissions are executed on the HW at the same time on different engines.
Background is that those submissions then depend on each other and each can't finish stand alone.
SRIOV now uses world switch to preempt submissions on the engines to allow sharing the HW resources between multiple VFs.
The problem is now that the SRIOV world switch can't know about such inter dependencies and will cause a timeout if it waits for a partially running gang submission.
To conclude SRIOV and gang submissions are fundamentally incompatible at the moment. For now just disable them.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
@@ -286,7 +286,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, } } -if (!p->gang_size) { +if (!p->gang_size || (amdgpu_sriov_vf (p->adev) && p->gang_size >1 )) { ret = -EINVAL ; goto free_all_kdata; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 372/565 selftests/Makefile: include $(INSTALL_DEP_TARGETS) in clean target to clean net/lib dependency
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nai-Chen Cheng <[email protected]>
[ Upstream commit d3f7457da7b9527a06dbcbfaf666aa51ac2eeb53 ]
The selftests 'make clean' does not clean the net/lib because it only processes $(TARGETS) and ignores $(INSTALL_DEP_TARGETS). This leaves compiled objects in net/lib after cleaning, requiring manual cleanup.
Include $(INSTALL_DEP_TARGETS) in clean target to ensure net/lib dependency is properly cleaned.
--- tools/testing/selftests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/Makefile +1 -1
@@ -296,7 +296,7 @@ gen_tar: install @echo "Created ${TAR_PATH}" clean: - @for TARGET in $(TARGETS); do \ + @for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ done;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 373/565 scsi: ufs: core: Disable timestamp functionality if not supported
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit fb1f4568346153d2f80fdb4ffcfa0cf4fb257d3c ]
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.
Message-ID: <[email protected]>
--- drivers/ufs/core/ufshcd.c | 6 +++++- include/ufs/ufs_quirks.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +5 -1
@@ -295,6 +295,9 @@ static const struct ufs_dev_quirk ufs_fixups[] = { { .wmanufacturerid = UFS_VENDOR_TOSHIBA, .model = "THGLF2G9D8KBADG", .quirk = UFS_DEVICE_QUIRK_PA_TACTIVATE }, + { .wmanufacturerid = UFS_VENDOR_TOSHIBA, + .model = "THGJFJT1E45BATP", + .quirk = UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT }, {} };
@@ -8670,7 +8673,8 @@ static void ufshcd_set_timestamp_attr(struct ufs_hba *hba)struct ufs_dev_info *dev_info = &hba->dev_info;struct utp_upiu_query_v4_0 *upiu_data; -if (dev_info->wspecversion <0x400 ) +if (dev_info->wspecversion <0x400 || + hba->dev_quirks &UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT )return ;ufshcd_dev_man_lock (hba);
include/ufs/ufs_quirks.h +3 -0
@@ -113,4 +113,7 @@ struct ufs_dev_quirk {*/ #define UFS_DEVICE_QUIRK_PA_HIBER8TIME (1 << 12) +/* Some UFS 4 devices do not support the qTimestamp attribute */ +#define UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT (1 << 13) +#endif /* UFS_QUIRKS_H_ */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 374/565 scsi: lpfc: Clean up allocated queues when queue setup mbox commands fail
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit 803dfd83df33b7565f23aef597d5dd036adfa792 ]
lpfc_sli4_queue_setup() does not allocate memory and is used for submitting CREATE_QUEUE mailbox commands. Thus, if such mailbox commands fail we should clean up by also freeing the memory allocated for the queues with lpfc_sli4_queue_destroy(). Change the intended clean up label for the lpfc_sli4_queue_setup() error case to out_destroy_queue.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_sli.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_sli.c +1 -2
@@ -8811,7 +8811,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)if (unlikely (rc)) {lpfc_printf_log (phba,KERN_ERR ,LOG_TRACE_EVENT ,"0381 Error %d during queue setup.\n" , rc); - goto out_stop_timers; + goto out_destroy_queue; }/* Initialize the driver internal SLI layer lists. */ lpfc_sli4_setup (phba);
@@ -9094,7 +9094,6 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)lpfc_free_iocb_list (phba); out_destroy_queue:lpfc_sli4_queue_destroy (phba); -out_stop_timers:lpfc_stop_hba_timers (phba); out_free_mbox:mempool_free (mboxq, phba->mbox_mem_pool);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 375/565 scsi: lpfc: Decrement ndlp kref after FDISC retries exhausted
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit b5bf6d681fce69cd1a57bfc0f1bdbbb348035117 ]
The kref for Fabric_DID ndlps is not decremented after repeated FDISC failures and exhausting maximum allowed retries. This can leave the ndlp lingering unnecessarily. Add a test and set bit operation for the NLP_DROPPED flag. If not previously set, then a kref is decremented. The ndlp is freed when the remaining reference for the completing ELS is put.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_els.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/scsi/lpfc/lpfc_els.c +5 -0
@@ -11237,6 +11237,11 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,lpfc_vlog_msg (vport,KERN_WARNING ,LOG_ELS ,"0126 FDISC cmpl status: x%x/x%x)\n" , ulp_status, ulp_word4); + +/* drop initial reference */ +if (!test_and_set_bit (NLP_DROPPED , &ndlp->nlp_flag)) +lpfc_nlp_put (ndlp); + goto fdisc_failed; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 376/565 scsi: lpfc: Check return status of lpfc_reset_flush_io_context during TGT_RESET
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit f408dde2468b3957e92b25e7438f74c8e9fb9e73 ]
If lpfc_reset_flush_io_context fails to execute, then the wrong return status code may be passed back to upper layers when issuing a target reset TMF command. Fix by checking the return status from lpfc_reset_flush_io_context() first in order to properly return FAILED or FAST_IO_FAIL.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_scsi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +10 -4
@@ -5929,7 +5929,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport)/** * lpfc_reset_flush_io_context - * @vport: The virtual port (scsi_host) for the flush context -* @tgt_id: If aborting by Target contect - specifies the target id +* @tgt_id: If aborting by Target context - specifies the target id * @lun_id: If aborting by Lun context - specifies the lun id * @context: specifies the context level to flush at. *
@@ -6103,8 +6103,14 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE ;spin_unlock_irqrestore (&pnode->lock, flags); } -lpfc_reset_flush_io_context (vport, tgt_id, lun_id, -LPFC_CTX_TGT ); + status =lpfc_reset_flush_io_context (vport, tgt_id, lun_id, +LPFC_CTX_TGT ); +if (status !=SUCCESS ) { +lpfc_printf_vlog (vport,KERN_ERR ,LOG_FCP , +"0726 Target Reset flush status x%x\n" , + status); +return status; + }return FAST_IO_FAIL ; }
@@ -6200,7 +6206,7 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd)int rc, ret =SUCCESS ;lpfc_printf_vlog (vport,KERN_ERR ,LOG_FCP , -"3172 SCSI layer issued Host Reset Data:\n" ); +"3172 SCSI layer issued Host Reset\n" );lpfc_offline_prep (phba,LPFC_MBX_WAIT );lpfc_offline (phba);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 377/565 scsi: lpfc: Remove ndlp kref decrement clause for F_Port_Ctrl in lpfc_cleanup
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit a4809b98eb004fcbf7c4d45eb5a624d1c682bb73 ]
In lpfc_cleanup, there is an extraneous nlp_put for NPIV ports on the F_Port_Ctrl ndlp object. In cases when an ABTS is issued, the outstanding kref is needed for when a second XRI_ABORTED CQE is received. The final kref for the ndlp is designed to be decremented in lpfc_sli4_els_xri_aborted instead. Also, add a new log message to allow for future diagnostics when debugging related issues.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_els.c | 6 +++++- drivers/scsi/lpfc/lpfc_init.c | 7 ------- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +5 -1
@@ -11992,7 +11992,11 @@ lpfc_sli4_els_xri_aborted(struct lpfc_hba *phba, sglq_entry->state =SGL_FREED ;spin_unlock_irqrestore (&phba->sli4_hba.sgl_list_lock, iflag); - +lpfc_printf_log (phba,KERN_INFO ,LOG_ELS |LOG_SLI | +LOG_DISCOVERY |LOG_NODE , +"0732 ELS XRI ABORT on Node: ndlp=x%px " +"xri=x%x\n" , + ndlp, xri);if (ndlp) { lpfc_set_rrq_active(phba, ndlp, sglq_entry->sli4_lxritag,
drivers/scsi/lpfc/lpfc_init.c +0 -7
@@ -3036,13 +3036,6 @@ lpfc_cleanup(struct lpfc_vport *vport)lpfc_vmid_vport_cleanup (vport);list_for_each_entry_safe (ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { -if (vport->port_type !=LPFC_PHYSICAL_PORT && - ndlp->nlp_DID == Fabric_DID) { -/* Just free up ndlp with Fabric_DID for vports */ -lpfc_nlp_put (ndlp); -continue ; - } -if (ndlp->nlp_DID == Fabric_Cntl_DID && ndlp->nlp_state ==NLP_STE_UNUSED_NODE ) {lpfc_nlp_put (ndlp);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 378/565 scsi: lpfc: Define size of debugfs entry for xri rebalancing
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit 5de09770b1c0e229d2cec93e7f634fcdc87c9bc8 ]
To assist in debugging lpfc_xri_rebalancing driver parameter, a debugfs entry is used. The debugfs file operations for xri rebalancing have been previously implemented, but lack definition for its information buffer size. Similar to other pre-existing debugfs entry buffers, define LPFC_HDWQINFO_SIZE as 8192 bytes.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_debugfs.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/lpfc/lpfc_debugfs.h +3 -0
@@ -44,6 +44,9 @@/* hbqinfo output buffer size */ #define LPFC_HBQINFO_SIZE 8192 +/* hdwqinfo output buffer size */ +#define LPFC_HDWQINFO_SIZE 8192 +/* nvmestat output buffer size */ #define LPFC_NVMESTAT_SIZE 8192#define LPFC_IOKTIME_SIZE 8192
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 379/565 scsi: lpfc: Ensure PLOGI_ACC is sent prior to PRLI in Point to Point topology
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Tee <[email protected]>
[ Upstream commit 2bf81856a403c92a4ce375288f33fba82ca2ccc6 ]
There is a timing race condition when a PRLI may be sent on the wire before PLOGI_ACC in Point to Point topology. Fix by deferring REG_RPI mbox completion handling to after PLOGI_ACC's CQE completion. Because the discovery state machine only sends PRLI after REG_RPI mbox completion, PRLI is now guaranteed to be sent after PLOGI_ACC.
Message-ID: <[email protected]>
--- drivers/scsi/lpfc/lpfc_els.c | 10 +++++++--- drivers/scsi/lpfc/lpfc_nportdisc.c | 23 ++++++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +7 -3
@@ -5329,12 +5329,12 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ulp_status, ulp_word4, did);/* ELS response tag <ulpIoTag> completes */ lpfc_printf_vlog (vport,KERN_INFO ,LOG_ELS , -"0110 ELS response tag x%x completes " +"0110 ELS response tag x%x completes fc_flag x%lx" "Data: x%x x%x x%x x%x x%lx x%x x%x x%x %p %p\n" , - iotag, ulp_status, ulp_word4, tmo, + iotag, vport->fc_flag, ulp_status, ulp_word4, tmo, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi,kref_read (&ndlp->kref), mbox, ndlp); -if (mbox) { +if (mbox && !test_bit (FC_PT2PT , &vport->fc_flag)) {if (ulp_status ==0 &&test_bit (NLP_ACC_REGLOGIN , &ndlp->nlp_flag)) { if (!lpfc_unreg_rpi(vport, ndlp) &&
@@ -5393,6 +5393,10 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, } out_free_mbox:lpfc_mbox_rsrc_cleanup (phba, mbox,MBOX_THD_UNLOCKED ); + }else if (mbox &&test_bit (FC_PT2PT , &vport->fc_flag) && +test_bit (NLP_ACC_REGLOGIN , &ndlp->nlp_flag)) { +lpfc_mbx_cmpl_reg_login (phba, mbox); +clear_bit (NLP_ACC_REGLOGIN , &ndlp->nlp_flag); } out:if (ndlp && shost) {
drivers/scsi/lpfc/lpfc_nportdisc.c +18 -5
@@ -329,8 +329,14 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox)/* Now that REG_RPI completed successfully, * we can now proceed with sending the PLOGI ACC. */ - rc =lpfc_els_rsp_acc (login_mbox->vport,ELS_CMD_PLOGI , - save_iocb, ndlp,NULL ); +if (test_bit (FC_PT2PT , &ndlp->vport->fc_flag)) { + rc =lpfc_els_rsp_acc (login_mbox->vport,ELS_CMD_PLOGI , + save_iocb, ndlp, login_mbox); + }else { + rc =lpfc_els_rsp_acc (login_mbox->vport,ELS_CMD_PLOGI , + save_iocb, ndlp,NULL ); + } +if (rc) {lpfc_printf_log (phba,KERN_ERR ,LOG_TRACE_EVENT , "4576 PLOGI ACC fails pt2pt discovery: "
@@ -338,9 +344,16 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox) } } -/* Now process the REG_RPI cmpl */ -lpfc_mbx_cmpl_reg_login (phba, login_mbox); -clear_bit (NLP_ACC_REGLOGIN , &ndlp->nlp_flag); +/* If this is a fabric topology, complete the reg_rpi and prli now. +* For Pt2Pt, the reg_rpi and PRLI are deferred until after the LS_ACC +* completes. This ensures, in Pt2Pt, that the PLOGI LS_ACC is sent +* before the PRLI. +*/ +if (!test_bit (FC_PT2PT , &ndlp->vport->fc_flag)) { +/* Now process the REG_RPI cmpl */ +lpfc_mbx_cmpl_reg_login (phba, login_mbox); +clear_bit (NLP_ACC_REGLOGIN , &ndlp->nlp_flag); + }kfree (save_iocb); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 380/565 allow finish_no_open(file, ERR_PTR(-E...))
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit fe91e078b60d1beabf5cef4a37c848457a6d2dfb ]
... allowing any ->lookup() return value to be passed to it.
--- fs/open.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/open.c +6 -4
@@ -1052,18 +1052,20 @@ EXPORT_SYMBOL(finish_open);* finish_no_open - finish ->atomic_open() without opening the file * * @file: file pointer -* @dentry: dentry or NULL (as returned from ->lookup()) +* @dentry: dentry, ERR_PTR(-E...) or NULL (as returned from ->lookup()) * -* This can be used to set the result of a successful lookup in ->atomic_open(). +* This can be used to set the result of a lookup in ->atomic_open(). * * NB: unlike finish_open() this function does consume the dentry reference and * the caller need not dput() it. * -* Returns "0" which must be the return value of ->atomic_open() after having -* called this function. +* Returns 0 or -E..., which must be the return value of ->atomic_open() after +* having called this function. */ int finish_no_open (struct file *file,struct dentry *dentry) { +if (IS_ERR (dentry)) +return PTR_ERR (dentry); file->f_path.dentry = dentry;return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 381/565 usb: mon: Increase BUFF_MAX to 64 MiB to support multi-MB URBs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Forest Crossman <[email protected]>
[ Upstream commit 368ed48a5ef52e384f54d5809f0a0b79ac567479 ]
The usbmon binary interface currently truncates captures of large transfers from higher-speed USB devices. Because a single event capture is limited to one-fifth of the total buffer size, the current maximum size of a captured URB is around 240 KiB. This is insufficient when capturing traffic from modern devices that use transfers of several hundred kilobytes or more, as truncated URBs can make it impossible for user-space USB analysis tools like Wireshark to properly defragment and reassemble higher-level protocol packets in the captured data.
The root cause of this issue is the 1200 KiB BUFF_MAX limit, which has not been changed since the binary interface was introduced in 2006.
To resolve this issue, this patch increases BUFF_MAX to 64 MiB. The original comment for BUFF_MAX based the limit's calculation on a saturated 480 Mbit/s bus. Applying the same logic to a modern USB 3.2 Gen 2×2 20 Gbit/s bus (~2500 MB/s over a 20ms window) indicates the buffer should be at least 50 MB. The new limit of 64 MiB covers that, plus a little extra for any overhead.
With this change, both users and developers should now be able to debug and reverse engineer modern USB devices even when running unmodified distro kernels.
Please note that this change does not affect the default buffer size. A larger buffer is only allocated when a user explicitly requests it via the MON_IOCT_RING_SIZE ioctl, so the change to the maximum buffer size should not unduly increase memory usage for users that don't deliberately request a larger buffer.
--- drivers/usb/mon/mon_bin.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/usb/mon/mon_bin.c +8 -6
@@ -68,18 +68,20 @@* The magic limit was calculated so that it allows the monitoring * application to pick data once in two ticks. This way, another application, * which presumably drives the bus, gets to hog CPU, yet we collect our data. -* If HZ is 100, a 480 mbit/s bus drives 614 KB every jiffy. USB has an -* enormous overhead built into the bus protocol, so we need about 1000 KB. +* +* Originally, for a 480 Mbit/s bus this required a buffer of about 1 MB. For +* modern 20 Gbps buses, this value increases to over 50 MB. The maximum +* buffer size is set to 64 MiB to accommodate this. * * This is still too much for most cases, where we just snoop a few * descriptor fetches for enumeration. So, the default is a "reasonable" -* amount for systems with HZ=250 and incomplete bus saturation. +* amount for typical, low-throughput use cases. * * XXX What about multi-megabyte URBs which take minutes to transfer? */ -#define BUFF_MAX CHUNK_ALIGN(1200*1024) -#define BUFF_DFL CHUNK_ALIGN(300*1024) -#define BUFF_MIN CHUNK_ALIGN(8*1024) +#define BUFF_MAX CHUNK_ALIGN(64*1024*1024) +#define BUFF_DFL CHUNK_ALIGN(300*1024) +#define BUFF_MIN CHUNK_ALIGN(8*1024)/* * The per-event API header (2 per URB).
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 382/565 usb: xhci: plat: Facilitate using autosuspend for xhci plat devices
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krishna Kurapati <[email protected]>
[ Upstream commit 41cf11946b9076383a2222bbf1ef57d64d033f66 ]
Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs, when in host mode, it is intended that the controller goes to suspend state to save power and wait for interrupts from connected peripheral to wake it up. This is particularly used in cases where a HID or Audio device is connected. In such scenarios, the usb controller can enter auto suspend and resume action after getting interrupts from the connected device.
--- drivers/usb/host/xhci-plat.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-plat.c +1 -0
@@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const sreturn ret;pm_runtime_set_active (&pdev->dev); +pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_enable (&pdev->dev);pm_runtime_get_noresume (&pdev->dev);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 383/565 f2fs: fix infinite loop in __insert_extent_tree()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: wangzijie <[email protected]>
[ Upstream commit 23361bd54966b437e1ed3eb1a704572f4b279e58 ]
When we get wrong extent info data, and look up extent_node in rb tree, it will cause infinite loop (CONFIG_F2FS_CHECK_FS=n). Avoiding this by return NULL and print some kernel messages in that case.
--- fs/f2fs/extent_cache.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/extent_cache.c +6 -0
@@ -561,7 +561,13 @@ static struct extent_node *__insert_extent_tree(struct f2fs_sb_info *sbi, p = &(*p)->rb_right; leftmost = false; }else { +f2fs_err_ratelimited (sbi,"%s: corrupted extent, type: %d, " +"extent node in rb tree [%u, %u, %u], age [%llu, %llu], " +"extent node to insert [%u, %u, %u], age [%llu, %llu]" , + __func__, et->type, en->ei.fofs, en->ei.blk, en->ei.len, en->ei.age, + en->ei.last_blocks, ei->fofs, ei->blk, ei->len, ei->age, ei->last_blocks);f2fs_bug_on (sbi,1 ); +return NULL ; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 384/565 wifi: rtw89: obtain RX path from ppdu status IE00
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chih-Kang Chang <[email protected]>
[ Upstream commit e156d2ab36d7e47aec36845705e4ecb1e4e89976 ]
The header v2 of ppdu status is optional, If it is not enabled, the RX path must be obtained from IE00 or IE01. Append the IE00 part.
--- drivers/net/wireless/realtek/rtw89/core.c | 4 ++++ drivers/net/wireless/realtek/rtw89/txrx.h | 1 + 2 files changed, 5 insertions(+)
drivers/net/wireless/realtek/rtw89/core.c +4 -0
@@ -1710,6 +1710,10 @@ static void rtw89_core_parse_phy_status_ie00(struct rtw89_dev *rtwdev, tmp_rpl =le32_get_bits (ie->w0,RTW89_PHY_STS_IE00_W0_RPL ); phy_ppdu->rpl_avg = tmp_rpl >>1 ; + +if (!phy_ppdu->hdr_2_en) + phy_ppdu->rx_path_en = +le32_get_bits (ie->w3,RTW89_PHY_STS_IE00_W3_RX_PATH_EN ); } static void rtw89_core_parse_phy_status_ie00_v2(struct rtw89_dev *rtwdev,
drivers/net/wireless/realtek/rtw89/txrx.h +1 -0
@@ -568,6 +568,7 @@ struct rtw89_phy_sts_ie00 { } __packed;#define RTW89_PHY_STS_IE00_W0_RPL GENMASK(15, 7) +#define RTW89_PHY_STS_IE00_W3_RX_PATH_EN GENMASK(31, 28)struct rtw89_phy_sts_ie00_v2 {__le32 w0;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 385/565 wifi: rtw89: renew a completion for each H2C command waiting C2H event
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zong-Zhe Yang <[email protected]>
[ Upstream commit bc2a5a12fa6259e190c7edb03e63b28ab480101b ]
Logically before a waiting side which has already timed out turns the atomic status back to idle, a completing side could still pass atomic condition and call complete. It will make the following H2C commands, waiting C2H events, get a completion unexpectedly early. Hence, renew a completion for each H2C command waiting a C2H event.
--- drivers/net/wireless/realtek/rtw89/core.c | 49 ++++++++++++++++++++--- drivers/net/wireless/realtek/rtw89/core.h | 10 ++++- drivers/net/wireless/realtek/rtw89/fw.c | 2 + 3 files changed, 53 insertions(+), 8 deletions(-)
drivers/net/wireless/realtek/rtw89/core.c +43 -6
@@ -4318,37 +4318,74 @@ void rtw89_core_update_beacon_work(struct work_struct *work)int rtw89_wait_for_cond (struct rtw89_wait_info *wait,unsigned int cond) { -struct completion *cmpl = &wait->completion; +struct rtw89_wait_response *prep;unsigned long time_left;unsigned int cur; +int err =0 ; cur =atomic_cmpxchg (&wait->cond,RTW89_WAIT_COND_IDLE , cond);if (cur !=RTW89_WAIT_COND_IDLE )return -EBUSY ; - time_left =wait_for_completion_timeout (cmpl,RTW89_WAIT_FOR_COND_TIMEOUT ); + prep =kzalloc (sizeof (*prep),GFP_KERNEL ); +if (!prep) { + err = -ENOMEM ; + goto reset; + } + +init_completion (&prep->completion); + +rcu_assign_pointer (wait->resp, prep); + + time_left =wait_for_completion_timeout (&prep->completion, +RTW89_WAIT_FOR_COND_TIMEOUT );if (time_left ==0 ) { -atomic_set (&wait->cond,RTW89_WAIT_COND_IDLE ); -return -ETIMEDOUT ; + err = -ETIMEDOUT ; + goto cleanup; } + wait->data = prep->data; + +cleanup: +rcu_assign_pointer (wait->resp,NULL ); +kfree_rcu (prep, rcu_head); + +reset: +atomic_set (&wait->cond,RTW89_WAIT_COND_IDLE ); + +if (err) +return err; +if (wait->data.err)return -EFAULT ;return 0 ; } +static void rtw89_complete_cond_resp (struct rtw89_wait_response *resp, +const struct rtw89_completion_data *data) +{ + resp->data = *data; +complete (&resp->completion); +} +void rtw89_complete_cond (struct rtw89_wait_info *wait,unsigned int cond,const struct rtw89_completion_data *data) { +struct rtw89_wait_response *resp;unsigned int cur; +guard (rcu)(); + + resp =rcu_dereference (wait->resp); +if (!resp) +return ; + cur =atomic_cmpxchg (&wait->cond, cond,RTW89_WAIT_COND_IDLE );if (cur != cond)return ; - wait->data = *data; -complete (&wait->completion); +rtw89_complete_cond_resp (resp, data); }void rtw89_core_ntfy_btc_event (struct rtw89_dev *rtwdev,enum rtw89_btc_hmsg event)
drivers/net/wireless/realtek/rtw89/core.h +8 -2
@@ -4391,17 +4391,23 @@ struct rtw89_completion_data {u8 buf[RTW89_COMPLETION_BUF_SIZE ]; }; +struct rtw89_wait_response { +struct rcu_head rcu_head; +struct completion completion; +struct rtw89_completion_data data; +}; +struct rtw89_wait_info {atomic_t cond; -struct completion completion;struct rtw89_completion_data data; +struct rtw89_wait_response __rcu *resp; };#define RTW89_WAIT_FOR_COND_TIMEOUT msecs_to_jiffies(100)static inline void rtw89_init_wait (struct rtw89_wait_info *wait) { -init_completion (&wait->completion); +rcu_assign_pointer (wait->resp,NULL );atomic_set (&wait->cond,RTW89_WAIT_COND_IDLE ); }
drivers/net/wireless/realtek/rtw89/fw.c +2 -0
@@ -7446,6 +7446,8 @@ static int rtw89_h2c_tx_and_wait(struct rtw89_dev *rtwdev, struct sk_buff *skb, {int ret; +lockdep_assert_wiphy (rtwdev->hw->wiphy); + ret =rtw89_h2c_tx (rtwdev, skb, false);if (ret) {rtw89_err (rtwdev,"failed to send h2c\n" );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 386/565 usb: xhci-pci: add support for hosts with zero USB3 ports
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Neronin <[email protected]>
[ Upstream commit 719de070f764e079cdcb4ddeeb5b19b3ddddf9c1 ]
Add xhci support for PCI hosts that have zero USB3 ports. Avoid creating a shared Host Controller Driver (HCD) when there is only one root hub. Additionally, all references to 'xhci->shared_hcd' are now checked before use.
Only xhci-pci.c requires modification to accommodate this change, as the xhci core already supports configurations with zero USB3 ports. This capability was introduced when xHCI Platform and MediaTek added support for zero USB3 ports.
--- drivers/usb/host/xhci-pci.c | 42 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-)
drivers/usb/host/xhci-pci.c +24 -18
@@ -616,7 +616,7 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id) {int retval;struct xhci_hcd *xhci; -struct usb_hcd *hcd; +struct usb_hcd *hcd, *usb3_hcd;struct reset_control *reset; reset =devm_reset_control_get_optional_exclusive (&dev->dev,NULL );
@@ -642,26 +642,32 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id) hcd =dev_get_drvdata (&dev->dev); xhci =hcd_to_xhci (hcd); xhci->reset = reset; - xhci->shared_hcd =usb_create_shared_hcd (&xhci_pci_hc_driver, &dev->dev, -pci_name (dev), hcd); -if (!xhci->shared_hcd) { - retval = -ENOMEM ; - goto dealloc_usb2_hcd; - } - retval =xhci_ext_cap_init (xhci); -if (retval) - goto put_usb3_hcd; + xhci->allow_single_roothub =1 ; +if (!xhci_has_one_roothub (xhci)) { + xhci->shared_hcd =usb_create_shared_hcd (&xhci_pci_hc_driver, &dev->dev, +pci_name (dev), hcd); +if (!xhci->shared_hcd) { + retval = -ENOMEM ; + goto dealloc_usb2_hcd; + } - retval =usb_add_hcd (xhci->shared_hcd, dev->irq, -IRQF_SHARED ); -if (retval) - goto put_usb3_hcd; -/* Roothub already marked as USB 3.0 speed */ + retval =xhci_ext_cap_init (xhci); +if (retval) + goto put_usb3_hcd; + + retval =usb_add_hcd (xhci->shared_hcd, dev->irq,IRQF_SHARED ); +if (retval) + goto put_usb3_hcd; + }else { + retval =xhci_ext_cap_init (xhci); +if (retval) + goto dealloc_usb2_hcd; + } -if (!(xhci->quirks &XHCI_BROKEN_STREAMS ) && -HCC_MAX_PSA (xhci->hcc_params) >=4 ) - xhci->shared_hcd->can_do_streams =1 ; + usb3_hcd =xhci_get_usb3_hcd (xhci); +if (usb3_hcd && !(xhci->quirks &XHCI_BROKEN_STREAMS ) &&HCC_MAX_PSA (xhci->hcc_params) >=4 ) + usb3_hcd->can_do_streams =1 ;/* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ pm_runtime_put_noidle (&dev->dev);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 387/565 ipv6: np->rxpmtu race annotation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 9fba1eb39e2f74d2002c5cbcf1d4435d37a4f752 ]
Add READ_ONCE() annotations because np->rxpmtu can be changed while udpv6_recvmsg() and rawv6_recvmsg() read it.
Since this is a very rarely used feature, and that udpv6_recvmsg() and rawv6_recvmsg() read np->rxopt anyway, change the test order so that np->rxpmtu does not need to be in a hot cache line.
--- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv6/raw.c +1 -1
@@ -445,7 +445,7 @@ static int rawv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,if (flags &MSG_ERRQUEUE )return ipv6_recv_error (sk, msg, len, addr_len); -if (np->rxpmtu && np->rxopt.bits.rxpmtu) +if (np->rxopt.bits.rxpmtu &&READ_ONCE (np->rxpmtu))return ipv6_recv_rxpmtu (sk, msg, len, addr_len); skb =skb_recv_datagram (sk, flags, &err);
net/ipv6/udp.c +1 -1
@@ -394,7 +394,7 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,if (flags &MSG_ERRQUEUE )return ipv6_recv_error (sk, msg, len, addr_len); -if (np->rxpmtu && np->rxopt.bits.rxpmtu) +if (np->rxopt.bits.rxpmtu &&READ_ONCE (np->rxpmtu))return ipv6_recv_rxpmtu (sk, msg, len, addr_len); try_again:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 388/565 RDMA/irdma: Update Kconfig
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tatyana Nikolova <[email protected]>
[ Upstream commit 060842fed53f77a73824c9147f51dc6746c1267a ]
Update Kconfig to add dependency on idpf module and add IPU E2000 to the list of supported devices.
--- drivers/infiniband/hw/irdma/Kconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/Kconfig +4 -3
@@ -4,9 +4,10 @@ config INFINIBAND_IRDMA depends on INET depends on IPV6 || !IPV6 depends on PCI - depends on ICE && I40E + depends on IDPF && ICE && I40E select GENERIC_ALLOCATOR select AUXILIARY_BUS help - This is an Intel(R) Ethernet Protocol Driver for RDMA driver - that support E810 (iWARP/RoCE) and X722 (iWARP) network devices. + This is an Intel(R) Ethernet Protocol Driver for RDMA that + supports IPU E2000 (RoCEv2), E810 (iWARP/RoCEv2) and X722 (iWARP) + network devices.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 389/565 IB/ipoib: Ignore L3 master device
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlad Dumitrescu <[email protected]>
[ Upstream commit 42f993d3439827c4959ea77e60620d7ebfb3a477 ]
Currently, all master upper netdevices (e.g., bond, VRF) are treated equally.
When a VRF netdevice is used over an IPoIB netdevice, the expected netdev resolution is on the lower IPoIB device which has the IP address assigned to it and not the VRF device.
The rdma_cm module (CMA) tries to match incoming requests to a particular netdevice. When successful, it also validates that the return path points to the same device by performing a routing table lookup. Currently, the former would resolve to the VRF netdevice, while the latter to the correct lower IPoIB netdevice, leading to failure in rdma_cm.
Improve this by ignoring the VRF master netdevice, if it exists, and instead return the lower IPoIB device.
--- drivers/infiniband/ulp/ipoib/ipoib_main.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +11 -10
@@ -317,26 +317,27 @@ static bool ipoib_is_dev_match_addr_rcu(const struct sockaddr *addr, }/* -* Find the master net_device on top of the given net_device. +* Find the L2 master net_device on top of the given net_device. * @dev: base IPoIB net_device * -* Returns the master net_device with a reference held, or the same net_device -* if no master exists. +* Returns the L2 master net_device with reference held if the L2 master +* exists (such as bond netdevice), or returns same netdev with reference +* held when master does not exist or when L3 master (such as VRF netdev). */ static struct net_device *ipoib_get_master_net_dev (struct net_device *dev) {struct net_device *master;rcu_read_lock (); + master =netdev_master_upper_dev_get_rcu (dev); +if (!master ||netif_is_l3_master (master)) + master = dev; +dev_hold (master);rcu_read_unlock (); -if (master) -return master; - -dev_hold (dev); -return dev; +return master; }struct ipoib_walk_data {
@@ -485,7 +486,7 @@ static struct net_device *ipoib_get_net_dev_by_params(if (ret)return NULL ; -/* See if we can find a unique device matching the L2 parameters */ +/* See if we can find a unique device matching the pkey and GID */ matches =__ipoib_get_net_dev_by_params (dev_list, port, pkey_index, gid,NULL , &net_dev);
@@ -498,7 +499,7 @@ static struct net_device *ipoib_get_net_dev_by_params(dev_put (net_dev); -/* Couldn't find a unique device with L2 parameters only. Use L3 +/* Couldn't find a unique device with pkey and GID only. Use L3 * address to uniquely match the net device */ matches =__ipoib_get_net_dev_by_params (dev_list, port, pkey_index, gid, addr, &net_dev);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 390/565 jfs: Verify inode mode when loading from disk
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 7a5aa54fba2bd591b22b9b624e6baa9037276986 ]
The inode mode loaded from corrupted disk can be invalid. Do like what commit 0a9e74051313 ("isofs: Verify inode mode when loading from disk") does.
--- fs/jfs/inode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/jfs/inode.c +7 -1
@@ -59,9 +59,15 @@ struct inode *jfs_iget(struct super_block *sb, unsigned long ino)*/ inode->i_link[inode->i_size] ='\0' ; } - }else { + }else if (S_ISCHR (inode->i_mode) ||S_ISBLK (inode->i_mode) || +S_ISFIFO (inode->i_mode) ||S_ISSOCK (inode->i_mode)) { inode->i_op = &jfs_file_inode_operations;init_special_inode (inode, inode->i_mode, inode->i_rdev); + }else { +printk (KERN_DEBUG "JFS: Invalid file type 0%04o for inode %lu.\n" , + inode->i_mode, inode->i_ino); +iget_failed (inode); +return ERR_PTR (-EIO ); }unlock_new_inode (inode);return inode;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 391/565 jfs: fix uninitialized waitqueue in transaction manager
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaurya Rane <[email protected]>
[ Upstream commit 300b072df72694ea330c4c673c035253e07827b8 ]
The transaction manager initialization in txInit() was not properly initializing TxBlock[0].waitor waitqueue, causing a crash when txEnd(0) is called on read-only filesystems.
When a filesystem is mounted read-only, txBegin() returns tid=0 to indicate no transaction. However, txEnd(0) still gets called and tries to access TxBlock[0].waitor via tid_to_tblock(0), but this waitqueue was never initialized because the initialization loop started at index 1 instead of 0.
This causes a 'non-static key' lockdep warning and system crash:
INFO: trying to register non-static key in txEnd
Fix by ensuring all transaction blocks including TxBlock[0] have their waitqueues properly initialized during txInit().
--- fs/jfs/jfs_txnmgr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/jfs/jfs_txnmgr.c +5 -4
@@ -272,14 +272,15 @@ int txInit(void)if (TxBlock ==NULL )return -ENOMEM ; -for (k =1 ; k < nTxBlock -1 ; k++) { - TxBlock[k].next = k +1 ; +for (k =0 ; k < nTxBlock; k++) {init_waitqueue_head (&TxBlock[k].gcwait);init_waitqueue_head (&TxBlock[k].waitor); } + +for (k =1 ; k < nTxBlock -1 ; k++) { + TxBlock[k].next = k +1 ; + } TxBlock[k].next =0 ; -init_waitqueue_head (&TxBlock[k].gcwait); -init_waitqueue_head (&TxBlock[k].waitor); TxAnchor.freetid =1 ;init_waitqueue_head (&TxAnchor.freewait);
Signature · 1 line
2.51.0
syzbot
syzbotRe: [PATCH 6.12 391/565] jfs: fix uninitialized waitqueue in transaction manager
I see the command but can't find the corresponding bug. The email is sent to [email protected] address but the HASH does not correspond to any known bug. Please double check the…
Quoted 62 lines
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shaurya Rane <[email protected]>
[ Upstream commit
300b072df72694ea330c4c673c035253e07827b8]The transaction manager initialization in
txInit()was not properly initializing TxBlock[0].waitor waitqueue, causing a crash when txEnd(0) is called on read-only filesystems.When a filesystem is mounted read-only,
txBegin()returns tid=0 to indicate no transaction. However, txEnd(0) still gets called and tries to access TxBlock[0].waitor viatid_to_tblock(0), but this waitqueue was never initialized because the initialization loop started at index 1 instead of 0.This causes a 'non-static key' lockdep warning and system crash:
INFO: trying to register non-static key in txEndFix by ensuring all transaction blocks including TxBlock[0] have their waitqueues properly initialized during
txInit().Reported-by [email protected]Signed-off-by Shaurya Rane <[email protected]>Signed-off-by Dave Kleikamp <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- fs/jfs/jfs_txnmgr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)fs/jfs/jfs_txnmgr.c +5
-4@@ -272,14 +272,15 @@ int txInit(void)if (TxBlock ==NULL )return -ENOMEM ; -for (k =1 ; k < nTxBlock -1 ; k++) { - TxBlock[k].next = k +1 ; +for (k =0 ; k < nTxBlock; k++) {init_waitqueue_head (&TxBlock[k].gcwait);init_waitqueue_head (&TxBlock[k].waitor); } + +for (k =1 ; k < nTxBlock -1 ; k++) { + TxBlock[k].next = k +1 ; + } TxBlock[k].next =0 ; -init_waitqueue_head (&TxBlock[k].gcwait); -init_waitqueue_head (&TxBlock[k].waitor); TxAnchor.freetid =1 ;init_waitqueue_head (&TxAnchor.freewait);Signature · 1 line
2.51.0
I see the command but can't find the corresponding bug. The email is sent to [email protected] address but the HASH does not correspond to any known bug. Please double check the address.
Greg Kroah-Hartman
maintainerPATCH 392/565 drm/amdgpu/atom: Check kcalloc() for WS buffer in amdgpu_atom_execute_table_locked()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <[email protected]>
[ Upstream commit cc9a8e238e42c1f43b98c097995137d644b69245 ]
kcalloc() may fail. When WS is non-zero and allocation fails, ectx.ws remains NULL while ectx.ws_size is set, leading to a potential NULL pointer dereference in atom_get_src_int() when accessing WS entries.
Return -ENOMEM on allocation failure to avoid the NULL dereference.
--- drivers/gpu/drm/amd/amdgpu/atom.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/atom.c +4 -0
@@ -1246,6 +1246,10 @@ static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, ectx.last_jump_jiffies =0 ;if (ws) { ectx.ws =kcalloc (4 , ws,GFP_KERNEL ); +if (!ectx.ws) { + ret = -ENOMEM ; + goto free; + } ectx.ws_size = ws; }else { ectx.ws =NULL ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 393/565 ASoC: qcom: sc8280xp: explicitly set S16LE format in sc8280xp_be_hw_params_fixup()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Klimov <[email protected]>
[ Upstream commit 9565c9d53c5b440f0dde6fa731a99c1b14d879d2 ]
Setting format to s16le is required for compressed playback on compatible soundcards.
--- sound/soc/qcom/sc8280xp.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/qcom/sc8280xp.c +3 -0
@@ -7,6 +7,7 @@#include <sound/soc.h> #include <sound/soc-dapm.h> #include <sound/pcm.h> +#include <sound/pcm_params.h> #include <linux/soundwire/sdw.h> #include <sound/jack.h> #include <linux/input-event-codes.h>
@@ -82,8 +83,10 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, SNDRV_PCM_HW_PARAM_RATE);struct snd_interval *channels =hw_param_interval (params,SNDRV_PCM_HW_PARAM_CHANNELS ); +struct snd_mask *fmt =hw_param_mask (params,SNDRV_PCM_HW_PARAM_FORMAT ); rate->min = rate->max =48000 ; +snd_mask_set_format (fmt,SNDRV_PCM_FORMAT_S16_LE ); channels->min =2 ; channels->max =2 ;switch (cpu_dai->id) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 394/565 net: phy: clear link parameters on admin link down
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksij Rempel <[email protected]>
[ Upstream commit 60f887b1290b43a4f5a3497982a725687b193fa4 ]
When a PHY is halted (e.g. ip link set dev lan2 down), several fields in struct phy_device may still reflect the last active connection. This leads to ethtool showing stale values even though the link is down.
Reset selected fields in _phy_state_machine() when transitioning to PHY_HALTED and the link was previously up:
- speed/duplex -> UNKNOWN, but only in autoneg mode (in forced mode these fields carry configuration, not status)
- master_slave_state -> UNKNOWN if previously supported
- mdix -> INVALID (state only, same meaning as "unknown")
- lp_advertising -> always cleared
The cleanup is skipped if the PHY is in PHY_ERROR state, so the last values remain available for diagnostics.
--- drivers/net/phy/phy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/net/phy/phy.c +13 -0
@@ -1477,6 +1477,19 @@ static enum phy_state_work _phy_state_machine(struct phy_device *phydev) }break ;case PHY_HALTED : +if (phydev->link) { +if (phydev->autoneg ==AUTONEG_ENABLE ) { + phydev->speed =SPEED_UNKNOWN ; + phydev->duplex =DUPLEX_UNKNOWN ; + } +if (phydev->master_slave_state != +MASTER_SLAVE_STATE_UNSUPPORTED ) + phydev->master_slave_state = +MASTER_SLAVE_STATE_UNKNOWN ; + phydev->mdix =ETH_TP_MDI_INVALID ; +linkmode_zero (phydev->lp_advertising); + } + fallthrough;case PHY_ERROR :if (phydev->link) { phydev->link =0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 395/565 net: ethernet: microchip: sparx5: make it selectable for ARCH_LAN969X
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Marko <[email protected]>
[ Upstream commit 6287982aa54946449bccff3e6488d3a15e458392 ]
LAN969x switchdev support depends on the SparX-5 core,so make it selectable for ARCH_LAN969X.
--- drivers/net/ethernet/microchip/sparx5/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/microchip/sparx5/Kconfig +1 -1
@@ -3,7 +3,7 @@ config SPARX5_SWITCH depends on NET_SWITCHDEV depends on HAS_IOMEM depends on OF - depends on ARCH_SPARX5 || COMPILE_TEST + depends on ARCH_SPARX5 || ARCH_LAN969X || COMPILE_TEST depends on PTP_1588_CLOCK_OPTIONAL depends on BRIDGE || BRIDGE=n select PHYLINK
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 396/565 bus: mhi: core: Improve mhi_sync_power_up handling for SYS_ERR state
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vivek Pernamitta <[email protected]>
[ Upstream commit aa1a0e93ed21a06acb7ca9d4a4a9fce75ea53d0c ]
Allow mhi_sync_power_up to handle SYS_ERR during power-up, reboot, or recovery. This is to avoid premature exit when MHI_PM_IN_ERROR_STATE is observed during above mentioned system states.
To achieve this, treat SYS_ERR as a valid state and let its handler process the error and queue the next transition to Mission Mode instead of aborting early.
--- drivers/bus/mhi/host/internal.h | 2 ++ drivers/bus/mhi/host/pm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/bus/mhi/host/internal.h +2 -0
@@ -163,6 +163,8 @@ enum mhi_pm_state { MHI_PM_IN_ERROR_STATE(pm_state))#define MHI_PM_IN_SUSPEND_STATE (pm_state) (pm_state & \ (MHI_PM_M3_ENTER | MHI_PM_M3)) +#define MHI_PM_FATAL_ERROR (pm_state) ((pm_state == MHI_PM_FW_DL_ERR) || \ + (pm_state >= MHI_PM_SYS_ERR_FAIL))#define NR_OF_CMD_RINGS 1#define CMD_EL_PER_RING 128
drivers/bus/mhi/host/pm.c +1 -1
@@ -1279,7 +1279,7 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl) mhi_cntrl->ready_timeout_ms : mhi_cntrl->timeout_ms;wait_event_timeout (mhi_cntrl->state_event,MHI_IN_MISSION_MODE (mhi_cntrl->ee) || -MHI_PM_IN_ERROR_STATE (mhi_cntrl->pm_state), +MHI_PM_FATAL_ERROR (mhi_cntrl->pm_state),msecs_to_jiffies (timeout_ms)); ret = (MHI_IN_MISSION_MODE (mhi_cntrl->ee)) ?0 : -ETIMEDOUT ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 397/565 iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seyediman Seyedarab <[email protected]>
[ Upstream commit 75c02a037609f34db17e91be195cedb33b61bae0 ]
snprintf() returns the number of bytes that would have been written, not the number actually written. Using this for offset tracking can cause buffer overruns if truncation occurs.
Replace snprintf() with scnprintf() to ensure the offset stays within bounds.
Since scnprintf() never returns a negative value, and zero is not possible in this context because 'bytes' starts at 0 and 'size - bytes' is DEBUG_BUFFER_SIZE in the first call, which is large enough to hold the string literals used, the return value is always positive. An integer overflow is also completely out of reach here due to the small and fixed buffer size. The error check in latency_show_one() is therefore unnecessary. Remove it and make dmar_latency_snapshot() return void.
--- drivers/iommu/intel/debugfs.c | 10 ++-------- drivers/iommu/intel/perf.c | 10 ++++------ drivers/iommu/intel/perf.h | 5 ++--- 3 files changed, 8 insertions(+), 17 deletions(-)
drivers/iommu/intel/debugfs.c +2 -8
@@ -661,17 +661,11 @@ DEFINE_SHOW_ATTRIBUTE(ir_translation_struct);static void latency_show_one (struct seq_file *m,struct intel_iommu *iommu,struct dmar_drhd_unit *drhd) { -int ret; -seq_printf (m,"IOMMU: %s Register Base Address: %llx\n" , iommu->name, drhd->reg_base_addr); - ret =dmar_latency_snapshot (iommu, debug_buf,DEBUG_BUFFER_SIZE ); -if (ret <0 ) -seq_puts (m,"Failed to get latency snapshot" ); -else -seq_puts (m, debug_buf); -seq_puts (m,"\n" ); +dmar_latency_snapshot (iommu, debug_buf,DEBUG_BUFFER_SIZE ); +seq_printf (m,"%s\n" , debug_buf); }static int latency_show (struct seq_file *m,void *v)
drivers/iommu/intel/perf.c +4 -6
@@ -113,7 +113,7 @@ static char *latency_type_names[] = { " svm_prq" }; -int dmar_latency_snapshot (struct intel_iommu *iommu,char *str,size_t size) +void dmar_latency_snapshot (struct intel_iommu *iommu,char *str,size_t size) {struct latency_statistic *lstat = iommu->perf_statistic;unsigned long flags;
@@ -122,7 +122,7 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)memset (str,0 , size);for (i =0 ; i <COUNTS_NUM ; i++) - bytes +=snprintf (str + bytes, size - bytes, + bytes +=scnprintf (str + bytes, size - bytes,"%s" , latency_counter_names[i]);spin_lock_irqsave (&latency_lock, flags);
@@ -130,7 +130,7 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)if (!dmar_latency_enabled (iommu, i))continue ; - bytes +=snprintf (str + bytes, size - bytes, + bytes +=scnprintf (str + bytes, size - bytes,"\n%s" , latency_type_names[i]);for (j =0 ; j <COUNTS_NUM ; j++) {
@@ -156,11 +156,9 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)break ; } - bytes +=snprintf (str + bytes, size - bytes, + bytes +=scnprintf (str + bytes, size - bytes,"%12lld" , val); } }spin_unlock_irqrestore (&latency_lock, flags); - -return bytes; }
drivers/iommu/intel/perf.h +2 -3
@@ -40,7 +40,7 @@ void dmar_latency_disable(struct intel_iommu *iommu, enum latency_type type);bool dmar_latency_enabled (struct intel_iommu *iommu,enum latency_type type);void dmar_latency_update (struct intel_iommu *iommu,enum latency_type type,u64 latency); -int dmar_latency_snapshot (struct intel_iommu *iommu,char *str,size_t size); +void dmar_latency_snapshot (struct intel_iommu *iommu,char *str,size_t size);#else static inline int dmar_latency_enable (struct intel_iommu *iommu,enum latency_type type)
@@ -64,9 +64,8 @@ dmar_latency_update(struct intel_iommu *iommu, enum latency_type type, u64 laten { } -static inline int +static inline void dmar_latency_snapshot (struct intel_iommu *iommu,char *str,size_t size) { -return 0 ; }#endif /* CONFIG_DMAR_PERF */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 398/565 wifi: ath10k: Fix connection after GTK rekeying
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <[email protected]>
[ Upstream commit 487e8a8c3421df0af3707e54c7e069f1d89cbda7 ]
It appears that not all hardware/firmware implementations support group key deletion correctly, which can lead to connection hangs and deauthentication following GTK rekeying (delete and install).
To avoid this issue, instead of attempting to delete the key using the special WMI_CIPHER_NONE value, we now replace the key with an invalid (random) value.
This behavior has been observed with WCN39xx chipsets.
Tested-on: WCN3990 hw1.0 WLAN.HL.3.3.7.c2-00931-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/mac.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +10 -2
@@ -14,6 +14,7 @@#include <linux/acpi.h> #include <linux/of.h> #include <linux/bitfield.h> +#include <linux/random.h> #include "hif.h" #include "core.h"
@@ -288,8 +289,15 @@ static int ath10k_send_key(struct ath10k_vif *arvif, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (cmd ==DISABLE_KEY ) { - arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE ]; - arg.key_data =NULL ; +if (flags &WMI_KEY_GROUP ) { +/* Not all hardware handles group-key deletion operation +* correctly. Replace the key with a junk value to invalidate it. +*/ +get_random_bytes (key->key, key->keylen); + }else { + arg.key_cipher = ar->wmi_key_cipher[WMI_CIPHER_NONE ]; + arg.key_data =NULL ; + } }return ath10k_wmi_vdev_install_key (arvif->ar, &arg);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 399/565 wifi: mac80211: Track NAN interface start/stop
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilan Peer <[email protected]>
[ Upstream commit 8f79d2f13dd3b0af00a5303d4ff913767dd7684e ]
In case that NAN is started, mark the device as non idle, and set LED triggering similar to scan and ROC. Set the device to idle once NAN is stopped.
--- net/mac80211/cfg.c | 20 +++++++++++++++++--- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/iface.c | 9 +++++++++ 3 files changed, 28 insertions(+), 3 deletions(-)
net/mac80211/cfg.c +17 -3
@@ -285,6 +285,9 @@ static int ieee80211_start_nan(struct wiphy *wiphy,lockdep_assert_wiphy (sdata->local->hw.wiphy); +if (sdata->u.nan.started) +return -EALREADY ; + ret =ieee80211_check_combinations (sdata,NULL ,0 ,0 ,-1 );if (ret <0 )return ret;
@@ -294,12 +297,18 @@ static int ieee80211_start_nan(struct wiphy *wiphy,return ret; ret =drv_start_nan (sdata->local, sdata, conf); -if (ret) +if (ret) {ieee80211_sdata_stop (sdata); +return ret; + } - sdata->u.nan.conf = *conf; + sdata->u.nan.started = true; +ieee80211_recalc_idle (sdata->local); -return ret; + sdata->u.nan.conf.master_pref = conf->master_pref; + sdata->u.nan.conf.bands = conf->bands; + +return 0 ; } static void ieee80211_stop_nan(struct wiphy *wiphy,
@@ -307,8 +316,13 @@ static void ieee80211_stop_nan(struct wiphy *wiphy, {struct ieee80211_sub_if_data *sdata =IEEE80211_WDEV_TO_SUB_IF (wdev); +if (!sdata->u.nan.started) +return ; +drv_stop_nan (sdata->local, sdata); + sdata->u.nan.started = false;ieee80211_sdata_stop (sdata); +ieee80211_recalc_idle (sdata->local); } static int ieee80211_nan_change_conf(struct wiphy *wiphy,
net/mac80211/ieee80211_i.h +2 -0
@@ -949,11 +949,13 @@ struct ieee80211_if_mntr {* struct ieee80211_if_nan - NAN state * * @conf: current NAN configuration +* @started: true iff NAN is started * @func_lock: lock for @func_inst_ids * @function_inst_ids: a bitmap of available instance_id's */ struct ieee80211_if_nan {struct cfg80211_nan_conf conf; +bool started;/* protects function_inst_ids */ spinlock_t func_lock;
net/mac80211/iface.c +9 -0
@@ -108,6 +108,7 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, {bool working, scanning, active;unsigned int led_trig_start =0 , led_trig_stop =0 ; +struct ieee80211_sub_if_data *iter;lockdep_assert_wiphy (local->hw.wiphy);
@@ -118,6 +119,14 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, working = !local->ops->remain_on_channel && !list_empty (&local->roc_list); +list_for_each_entry (iter, &local->interfaces, list) { +if (iter->vif.type ==NL80211_IFTYPE_NAN && + iter->u.nan.started) { + working = true; +break ; + } + } + scanning =test_bit (SCAN_SW_SCANNING , &local->scanning) ||test_bit (SCAN_ONCHANNEL_SCANNING , &local->scanning);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 400/565 net: intel: fm10k: Fix parameter idx set but not used
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brahmajit Das <[email protected]>
[ Upstream commit 99e9c5ffbbee0f258a1da4eadf602b943f8c8300 ]
Variable idx is set in the loop, but is never used resulting in dead code. Building with GCC 16, which enables -Werror=unused-but-set-parameter= by default results in build error. This patch removes the idx parameter, since all the callers of the fm10k_unbind_hw_stats_q as 0 as idx anyways.
--- drivers/net/ethernet/intel/fm10k/fm10k_common.c | 5 ++--- drivers/net/ethernet/intel/fm10k/fm10k_common.h | 2 +- drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 2 +- drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_common.c +2 -3
@@ -447,17 +447,16 @@ void fm10k_update_hw_stats_q(struct fm10k_hw *hw, struct fm10k_hw_stats_q *q,/** * fm10k_unbind_hw_stats_q - Unbind the queue counters from their queues * @q: pointer to the ring of hardware statistics queue -* @idx: index pointing to the start of the ring iteration * @count: number of queues to iterate over * * Function invalidates the index values for the queues so any updates that * may have happened are ignored and the base for the queue stats is reset. **/ -void fm10k_unbind_hw_stats_q (struct fm10k_hw_stats_q *q,u32 idx,u32 count) +void fm10k_unbind_hw_stats_q (struct fm10k_hw_stats_q *q,u32 count) {u32 i; -for (i =0 ; i < count; i++, idx++, q++) { +for (i =0 ; i < count; i++, q++) { q->rx_stats_idx =0 ; q->tx_stats_idx =0 ; }
drivers/net/ethernet/intel/fm10k/fm10k_common.h +1 -1
@@ -43,6 +43,6 @@ u32 fm10k_read_hw_stats_32b(struct fm10k_hw *hw, u32 addr,void fm10k_update_hw_stats_q (struct fm10k_hw *hw,struct fm10k_hw_stats_q *q,u32 idx,u32 count);#define fm10k_unbind_hw_stats_32b (s) ((s)->base_h = 0) -void fm10k_unbind_hw_stats_q (struct fm10k_hw_stats_q *q,u32 idx,u32 count); +void fm10k_unbind_hw_stats_q (struct fm10k_hw_stats_q *q,u32 count);s32 fm10k_get_host_state_generic (struct fm10k_hw *hw,bool *host_ready);#endif /* _FM10K_COMMON_H_ */
drivers/net/ethernet/intel/fm10k/fm10k_pf.c +1 -1
@@ -1509,7 +1509,7 @@ static void fm10k_rebind_hw_stats_pf(struct fm10k_hw *hw,fm10k_unbind_hw_stats_32b (&stats->nodesc_drop);/* Unbind Queue Statistics */ -fm10k_unbind_hw_stats_q (stats->q,0 , hw->mac.max_queues); +fm10k_unbind_hw_stats_q (stats->q, hw->mac.max_queues);/* Reinitialize bases for all stats */ fm10k_update_hw_stats_pf (hw, stats);
drivers/net/ethernet/intel/fm10k/fm10k_vf.c +1 -1
@@ -465,7 +465,7 @@ static void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw, struct fm10k_hw_stats *stats) {/* Unbind Queue Statistics */ -fm10k_unbind_hw_stats_q (stats->q,0 , hw->mac.max_queues); +fm10k_unbind_hw_stats_q (stats->q, hw->mac.max_queues);/* Reinitialize bases for all stats */ fm10k_update_hw_stats_vf (hw, stats);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 401/565 r8169: set EEE speed down ratio to 1
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChunHao Lin <[email protected]>
[ Upstream commit bf7154ffb1c65a201906296a9d3eb22e9daa5ffc ]
EEE speed down means speed down MAC MCU clock. It is not from spec. It is kind of Realtek specific power saving feature. But enable it may cause some issues, like packet drop or interrupt loss. Different hardware may have different issues.
EEE speed down ratio (mac ocp 0xe056[7:4]) is used to set EEE speed down rate. The larger this value is, the more power can save. But it actually save less power then we expected. And, as mentioned above, will impact compatibility. So set it to 1 (mac ocp 0xe056[7:4] = 0) , which means not to speed down, to improve compatibility.
--- drivers/net/ethernet/realtek/r8169_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +3 -3
@@ -3467,7 +3467,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)r8168_mac_ocp_modify (tp,0xd412 ,0x0fff , sw_cnt_1ms_ini); } -r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0070 ); +r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0000 );r8168_mac_ocp_modify (tp,0xe052 ,0x6000 ,0x8008 );r8168_mac_ocp_modify (tp,0xe0d6 ,0x01ff ,0x017f );r8168_mac_ocp_modify (tp,0xd420 ,0x0fff ,0x047f );
@@ -3572,7 +3572,7 @@ static void rtl_hw_start_8117(struct rtl8169_private *tp)r8168_mac_ocp_modify (tp,0xd412 ,0x0fff , sw_cnt_1ms_ini); } -r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0070 ); +r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0000 );r8168_mac_ocp_write (tp,0xea80 ,0x0003 );r8168_mac_ocp_modify (tp,0xe052 ,0x0000 ,0x0009 );r8168_mac_ocp_modify (tp,0xd420 ,0x0fff ,0x047f );
@@ -3772,7 +3772,7 @@ static void rtl_hw_start_8125_common(struct rtl8169_private *tp)r8168_mac_ocp_modify (tp,0xc0b4 ,0x0000 ,0x000c );r8168_mac_ocp_modify (tp,0xeb6a ,0x00ff ,0x0033 );r8168_mac_ocp_modify (tp,0xeb50 ,0x03e0 ,0x0040 ); -r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0030 ); +r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0000 );r8168_mac_ocp_modify (tp,0xe040 ,0x1000 ,0x0000 );r8168_mac_ocp_modify (tp,0xea1c ,0x0003 ,0x0001 ); if (tp->mac_version == RTL_GIGA_MAC_VER_65 ||
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 402/565 PCI: cadence: Check for the existence of cdns_pcie::ops before using it
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Wang <[email protected]>
[ Upstream commit 49a6c160ad4812476f8ae1a8f4ed6d15adfa6c09 ]
cdns_pcie::ops might not be populated by all the Cadence glue drivers. This is going to be true for the upcoming Sophgo platform which doesn't set the ops.
Hence, add a check to prevent NULL pointer dereference.
--- drivers/pci/controller/cadence/pcie-cadence-host.c | 2 +- drivers/pci/controller/cadence/pcie-cadence.c | 4 ++-- drivers/pci/controller/cadence/pcie-cadence.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-host.c +1 -1
@@ -452,7 +452,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc)cdns_pcie_writel (pcie,CDNS_PCIE_AT_OB_REGION_PCI_ADDR1 (0 ), addr1);cdns_pcie_writel (pcie,CDNS_PCIE_AT_OB_REGION_DESC1 (0 ), desc1); -if (pcie->ops->cpu_addr_fixup) +if (pcie->ops && pcie->ops->cpu_addr_fixup) cpu_addr = pcie->ops->cpu_addr_fixup (pcie, cpu_addr); addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(12) |
drivers/pci/controller/cadence/pcie-cadence.c +2 -2
@@ -90,7 +90,7 @@ void cdns_pcie_set_outbound_region(struct cdns_pcie *pcie, u8 busnr, u8 fn,cdns_pcie_writel (pcie,CDNS_PCIE_AT_OB_REGION_DESC1 (r), desc1);/* Set the CPU address */ -if (pcie->ops->cpu_addr_fixup) +if (pcie->ops && pcie->ops->cpu_addr_fixup) cpu_addr = pcie->ops->cpu_addr_fixup (pcie, cpu_addr); addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(nbits) |
@@ -120,7 +120,7 @@ void cdns_pcie_set_outbound_region_for_normal_msg(struct cdns_pcie *pcie, }/* Set the CPU address */ -if (pcie->ops->cpu_addr_fixup) +if (pcie->ops && pcie->ops->cpu_addr_fixup) cpu_addr = pcie->ops->cpu_addr_fixup (pcie, cpu_addr); addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(17) |
drivers/pci/controller/cadence/pcie-cadence.h +3 -3
@@ -499,7 +499,7 @@ static inline u32 cdns_pcie_ep_fn_readl(struct cdns_pcie *pcie, u8 fn, u32 reg)static inline int cdns_pcie_start_link (struct cdns_pcie *pcie) { -if (pcie->ops->start_link) +if (pcie->ops && pcie->ops->start_link)return pcie->ops->start_link (pcie);return 0 ;
@@ -507,13 +507,13 @@ static inline int cdns_pcie_start_link(struct cdns_pcie *pcie)static inline void cdns_pcie_stop_link (struct cdns_pcie *pcie) { -if (pcie->ops->stop_link) +if (pcie->ops && pcie->ops->stop_link) pcie->ops->stop_link (pcie); }static inline bool cdns_pcie_link_up (struct cdns_pcie *pcie) { -if (pcie->ops->link_up) +if (pcie->ops && pcie->ops->link_up)return pcie->ops->link_up (pcie);return true;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 403/565 sparc/module: Add R_SPARC_UA64 relocation handling
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koakuma <[email protected]>
[ Upstream commit 05457d96175d25c976ab6241c332ae2eb5e07833 ]
This is needed so that the kernel can handle R_SPARC_UA64 relocations, which is emitted by LLVM's IAS.
--- arch/sparc/include/asm/elf_64.h | 1 + arch/sparc/kernel/module.c | 1 + 2 files changed, 2 insertions(+)
arch/sparc/include/asm/elf_64.h +1 -0
@@ -58,6 +58,7 @@#define R_SPARC_7 43#define R_SPARC_5 44#define R_SPARC_6 45 +#define R_SPARC_UA64 54/* Bits present in AT_HWCAP, primarily for Sparc32. */ #define HWCAP_SPARC_FLUSH 0x00000001
arch/sparc/kernel/module.c +1 -0
@@ -87,6 +87,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,break ;#ifdef CONFIG_SPARC64 case R_SPARC_64 : +case R_SPARC_UA64 : location[0 ] = v >>56 ; location[1 ] = v >>48 ; location[2 ] = v >>40 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 404/565 sparc64: fix prototypes of reads[bwl]()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit 7205ef77dfe167df1b83aea28cf00fc02d662990 ]
Conventions for readsl() are the same as for readl() - any __iomem pointer is acceptable, both const and volatile ones being OK. Same for readsb() and readsw().
--- arch/sparc/include/asm/io_64.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/sparc/include/asm/io_64.h +3 -3
@@ -250,19 +250,19 @@ void insl(unsigned long, void *, unsigned long);#define insw insw#define insl insl -static inline void readsb (void __iomem *port,void *buf,unsigned long count) +static inline void readsb (const volatile void __iomem *port,void *buf,unsigned long count) {insb ((unsigned long __force )port, buf, count); }#define readsb readsb -static inline void readsw (void __iomem *port,void *buf,unsigned long count) +static inline void readsw (const volatile void __iomem *port,void *buf,unsigned long count) {insw ((unsigned long __force )port, buf, count); }#define readsw readsw -static inline void readsl (void __iomem *port,void *buf,unsigned long count) +static inline void readsl (const volatile void __iomem *port,void *buf,unsigned long count) {insl ((unsigned long __force )port, buf, count); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 405/565 vfio: return -ENOTTY for unsupported device feature
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Mastro <[email protected]>
[ Upstream commit 16df67f2189a71a8310bcebddb87ed569e8352be ]
The two implementers of vfio_device_ops.device_feature, vfio_cdx_ioctl_feature and vfio_pci_core_ioctl_feature, return -ENOTTY in the fallthrough case when the feature is unsupported. For consistency, the base case, vfio_ioctl_device_feature, should do the same when device_feature == NULL, indicating an implementation has no feature extensions.
--- drivers/vfio/vfio_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vfio/vfio_main.c +1 -1
@@ -1251,7 +1251,7 @@ static int vfio_ioctl_device_feature(struct vfio_device *device, feature.argsz - minsz);default :if (unlikely (!device->ops->device_feature)) -return -EINVAL ; +return -ENOTTY ;return device->ops->device_feature (device, feature.flags, arg->data, feature.argsz - minsz);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 406/565 crypto: hisilicon/qm - invalidate queues in use
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weili Qian <[email protected]>
[ Upstream commit 85acd1b26b8f5b838887dc965dc3aa2c0253f4d1 ]
Before the device reset, although the driver has set the queue status to intercept doorbells sent by the task process, the reset thread is isolated from the user-mode task process, so the task process may still send doorbells. Therefore, before the reset, the queue is directly invalidated, and the device directly discards the doorbells sent by the process.
--- drivers/crypto/hisilicon/qm.c | 53 ++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 13 deletions(-)
drivers/crypto/hisilicon/qm.c +40 -13
@@ -47,6 +47,8 @@#define QM_SQ_TYPE_MASK GENMASK(3, 0)#define QM_SQ_TAIL_IDX (sqc) ((le16_to_cpu((sqc).w11) >> 6) & 0x1) +#define QM_SQC_DISABLE_QP (1U << 6) +#define QM_XQC_RANDOM_DATA 0xaaaa/* cqc shift */ #define QM_CQ_HOP_NUM_SHIFT 0
@@ -3008,6 +3010,9 @@ static int qm_eq_aeq_ctx_cfg(struct hisi_qm *qm)qm_init_eq_aeq_status (qm); +/* Before starting the dev, clear the memory and then configure to device using. */ +memset (qm->qdma.va,0 , qm->qdma.size); + ret =qm_eq_ctx_cfg (qm);if (ret) {dev_err (dev,"Set eqc failed!\n" );
@@ -3019,9 +3024,13 @@ static int qm_eq_aeq_ctx_cfg(struct hisi_qm *qm)static int __hisi_qm_start (struct hisi_qm *qm) { +struct device *dev = &qm->pdev->dev;int ret; -WARN_ON (!qm->qdma.va); +if (!qm->qdma.va) { +dev_err (dev,"qm qdma is NULL!\n" ); +return -EINVAL ; + }if (qm->fun_type ==QM_HW_PF ) { ret =hisi_qm_set_vft (qm,0 , qm->qp_base, qm->qp_num);
@@ -3095,7 +3104,7 @@ static int qm_restart(struct hisi_qm *qm)for (i =0 ; i < qm->qp_num; i++) { qp = &qm->qp_array[i];if (atomic_read (&qp->qp_status.flags) ==QP_STOP && - qp->is_resetting == true) { + qp->is_resetting == true && qp->is_in_kernel == true) { ret =qm_start_qp_nolock (qp,0 );if (ret <0 ) {dev_err (dev,"Failed to start qp%d!\n" , i);
@@ -3127,24 +3136,44 @@ static void qm_stop_started_qp(struct hisi_qm *qm) }/** -* qm_clear_queues() - Clear all queues memory in a qm. -* @qm: The qm in which the queues will be cleared. +* qm_invalid_queues() - invalid all queues in use. +* @qm: The qm in which the queues will be invalidated. * -* This function clears all queues memory in a qm. Reset of accelerator can -* use this to clear queues. +* This function invalid all queues in use. If the doorbell command is sent +* to device in user space after the device is reset, the device discards +* the doorbell command. */ -static void qm_clear_queues (struct hisi_qm *qm) +static void qm_invalid_queues (struct hisi_qm *qm) {struct hisi_qp *qp; +struct qm_sqc *sqc; +struct qm_cqc *cqc;int i; +/* +* Normal stop queues is no longer used and does not need to be +* invalid queues. +*/ +if (qm->status.stop_reason ==QM_NORMAL ) +return ; + +if (qm->status.stop_reason ==QM_DOWN ) +hisi_qm_cache_wb (qm); +for (i =0 ; i < qm->qp_num; i++) { qp = &qm->qp_array[i]; -if (qp->is_in_kernel && qp->is_resetting) +if (!qp->is_resetting) +continue ; + +/* Modify random data and set sqc close bit to invalid queue. */ + sqc = qm->sqc + i; + cqc = qm->cqc + i; + sqc->w8 =cpu_to_le16 (QM_XQC_RANDOM_DATA ); + sqc->w13 =cpu_to_le16 (QM_SQC_DISABLE_QP ); + cqc->w8 =cpu_to_le16 (QM_XQC_RANDOM_DATA ); +if (qp->is_in_kernel)memset (qp->qdma.va,0 , qp->qdma.size); } - -memset (qm->qdma.va,0 , qm->qdma.size); }/**
@@ -3201,7 +3230,7 @@ int hisi_qm_stop(struct hisi_qm *qm, enum qm_stop_reason r) } } -qm_clear_queues (qm); +qm_invalid_queues (qm); qm->status.stop_reason =QM_NORMAL ; err_unlock:
@@ -4586,8 +4615,6 @@ void hisi_qm_dev_shutdown(struct pci_dev *pdev) ret =hisi_qm_stop (qm,QM_DOWN );if (ret)dev_err (&pdev->dev,"Fail to stop qm in shutdown!\n" ); - -hisi_qm_cache_wb (qm); }EXPORT_SYMBOL_GPL (hisi_qm_dev_shutdown);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 407/565 crypto: hisilicon/qm - clear all VF configurations in the hardware
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weili Qian <[email protected]>
[ Upstream commit 64b9642fc29a14e1fe67842be9c69c7b90a3bcd6 ]
When disabling SR-IOV, clear the configuration of each VF in the hardware. Do not exit the configuration clearing process due to the failure of a single VF. Additionally, Clear the VF configurations before decrementing the PM counter.
--- drivers/crypto/hisilicon/qm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/crypto/hisilicon/qm.c +12 -13
@@ -3475,19 +3475,19 @@ static int qm_vf_q_assign(struct hisi_qm *qm, u32 num_vfs)return 0 ; } -static int qm_clear_vft_config (struct hisi_qm *qm) +static void qm_clear_vft_config (struct hisi_qm *qm) { -int ret;u32 i; -for (i =1 ; i <= qm->vfs_num; i++) { - ret =hisi_qm_set_vft (qm, i,0 ,0 ); -if (ret) -return ret; - } - qm->vfs_num =0 ; +/* +* When disabling SR-IOV, clear the configuration of each VF in the hardware +* sequentially. Failure to clear a single VF should not affect the clearing +* operation of other VFs. +*/ +for (i =1 ; i <= qm->vfs_num; i++) + (void )hisi_qm_set_vft (qm, i,0 ,0 ); -return 0 ; + qm->vfs_num =0 ; }static int qm_func_shaper_enable (struct hisi_qm *qm,u32 fun_index,u32 qos)
@@ -3824,13 +3824,13 @@ int hisi_qm_sriov_enable(struct pci_dev *pdev, int max_vfs) goto err_put_sync; } + qm->vfs_num = num_vfs; ret =pci_enable_sriov (pdev, num_vfs);if (ret) {pci_err (pdev,"Can't enable VF!\n" );qm_clear_vft_config (qm); goto err_put_sync; } - qm->vfs_num = num_vfs;pci_info (pdev,"VF enabled, vfs_num(=%d)!\n" , num_vfs);
@@ -3865,11 +3865,10 @@ int hisi_qm_sriov_disable(struct pci_dev *pdev, bool is_frozen) }pci_disable_sriov (pdev); - - qm->vfs_num =0 ; +qm_clear_vft_config (qm);qm_pm_put_sync (qm); -return qm_clear_vft_config (qm); +return 0 ; }EXPORT_SYMBOL_GPL (hisi_qm_sriov_disable);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 408/565 PCI/PM: Skip resuming to D0 if device is disconnected
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 299fad4133677b845ce962f78c9cf75bded63f61 ]
When a device is surprise-removed (e.g., due to a dock unplug), the PCI core unconfigures all downstream devices and sets their error state to pci_channel_io_perm_failure. This marks them as disconnected via pci_dev_is_disconnected().
During device removal, the runtime PM framework may attempt to resume the device to D0 via pm_runtime_get_sync(), which calls into pci_power_up(). Since the device is already disconnected, this resume attempt is unnecessary and results in a predictable errors like this, typically when undocking from a TBT3 or USB4 dock with PCIe tunneling:
pci 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible
Avoid powering up disconnected devices by checking their status early in pci_power_up() and returning -EIO.
--- drivers/pci/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/pci/pci.c +5 -0
@@ -1403,6 +1403,11 @@ int pci_power_up(struct pci_dev *dev)return -EIO ; } +if (pci_dev_is_disconnected (dev)) { + dev->current_state = PCI_D3cold; +return -EIO ; + } +pci_read_config_word (dev, dev->pm_cap +PCI_PM_CTRL , &pmcsr);if (PCI_POSSIBLE_ERROR (pmcsr)) { pci_err(dev, "Unable to change power state from %s to D0, device inaccessible\n",
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 409/565 selftests: forwarding: Reorder (ar)ping arguments to obey POSIX getopt
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <[email protected]>
[ Upstream commit 50d51cef555ee42fe47dd51b71366a77895e5f0b ]
Quoted from musl wiki:
GNU getopt permutes argv to pull options to the front, ahead of non-option arguments. musl and the POSIX standard getopt stop processing options at the first non-option argument with no permutation.
Thus these scripts stop working on musl since non-option arguments for tools using getopt() (in this case, (ar)ping) do not always come last. Fix it by reordering arguments.
--- .../selftests/net/forwarding/custom_multipath_hash.sh | 2 +- .../selftests/net/forwarding/gre_custom_multipath_hash.sh | 2 +- .../selftests/net/forwarding/ip6_forward_instats_vrf.sh | 6 +++--- .../net/forwarding/ip6gre_custom_multipath_hash.sh | 2 +- tools/testing/selftests/net/forwarding/lib.sh | 8 ++++---- .../selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh | 2 +- .../selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-)
tools/testing/selftests/net/forwarding/custom_multipath_hash.sh +1 -1
@@ -226,7 +226,7 @@ send_flowlabel() # Generate 16384 echo requests, each with a random flow label. ip vrf exec v$h1 sh -c \ "for _ in {1..16384}; do \ - $PING6 2001:db8:4::2 -F 0 -c 1 -q >/dev/null 2>&1; \ + $PING6 -F 0 -c 1 -q 2001:db8:4::2 >/dev/null 2>&1; \ done" }
tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh +1 -1
@@ -321,7 +321,7 @@ send_flowlabel() # Generate 16384 echo requests, each with a random flow label. ip vrf exec v$h1 sh -c \ "for _ in {1..16384}; do \ - $PING6 2001:db8:2::2 -F 0 -c 1 -q >/dev/null 2>&1; \ + $PING6 -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1; \ done" }
tools/testing/selftests/net/forwarding/ip6_forward_instats_vrf.sh +3 -3
@@ -95,7 +95,7 @@ ipv6_in_too_big_err() # Send too big packets ip vrf exec $vrf_name \ - $PING6 -s 1300 2001:1:2::2 -c 1 -w $PING_TIMEOUT &> /dev/null + $PING6 -s 1300 -c 1 -w $PING_TIMEOUT 2001:1:2::2 &> /dev/null local t1=$(ipv6_stats_get $rtr1 Ip6InTooBigErrors) test "$((t1 - t0))" -ne 0
@@ -131,7 +131,7 @@ ipv6_in_addr_err() # Disable forwarding temporary while sending the packet sysctl -qw net.ipv6.conf.all.forwarding=0 ip vrf exec $vrf_name \ - $PING6 2001:1:2::2 -c 1 -w $PING_TIMEOUT &> /dev/null + $PING6 -c 1 -w $PING_TIMEOUT 2001:1:2::2 &> /dev/null sysctl -qw net.ipv6.conf.all.forwarding=1 local t1=$(ipv6_stats_get $rtr1 Ip6InAddrErrors)
@@ -150,7 +150,7 @@ ipv6_in_discard() # Add a policy to discard ip xfrm policy add dst 2001:1:2::2/128 dir fwd action block ip vrf exec $vrf_name \ - $PING6 2001:1:2::2 -c 1 -w $PING_TIMEOUT &> /dev/null + $PING6 -c 1 -w $PING_TIMEOUT 2001:1:2::2 &> /dev/null ip xfrm policy del dst 2001:1:2::2/128 dir fwd local t1=$(ipv6_stats_get $rtr1 Ip6InDiscards)
tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh +1 -1
@@ -323,7 +323,7 @@ send_flowlabel() # Generate 16384 echo requests, each with a random flow label. ip vrf exec v$h1 sh -c \ "for _ in {1..16384}; do \ - $PING6 2001:db8:2::2 -F 0 -c 1 -q >/dev/null 2>&1; \ + $PING6 -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1; \ done" }
tools/testing/selftests/net/forwarding/lib.sh +4 -4
@@ -1360,8 +1360,8 @@ ping_do() vrf_name=$(master_name_get $if_name) ip vrf exec $vrf_name \ - $PING $args $dip -c $PING_COUNT -i 0.1 \ - -w $PING_TIMEOUT &> /dev/null + $PING $args -c $PING_COUNT -i 0.1 \ + -w $PING_TIMEOUT $dip &> /dev/null } ping_test()
@@ -1391,8 +1391,8 @@ ping6_do() vrf_name=$(master_name_get $if_name) ip vrf exec $vrf_name \ - $PING6 $args $dip -c $PING_COUNT -i 0.1 \ - -w $PING_TIMEOUT &> /dev/null + $PING6 $args -c $PING_COUNT -i 0.1 \ + -w $PING_TIMEOUT $dip &> /dev/null } ping6_test()
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh +1 -1
@@ -237,7 +237,7 @@ test_lag_slave() ip neigh flush dev br1 setup_wait_dev $up_dev setup_wait_dev $host_dev - $ARPING -I br1 192.0.2.130 -qfc 1 + $ARPING -I br1 -qfc 1 192.0.2.130 sleep 2 mirror_test vrf-h1 192.0.2.1 192.0.2.18 $host_dev 1 ">= 10"
tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh +2 -2
@@ -196,7 +196,7 @@ test_span_gre_forbidden_egress() bridge vlan add dev $swp3 vid 555 # Re-prime FDB - $ARPING -I br1.555 192.0.2.130 -fqc 1 + $ARPING -I br1.555 -fqc 1 192.0.2.130 sleep 1 quick_test_span_gre_dir $tundev
@@ -290,7 +290,7 @@ test_span_gre_fdb_roaming() bridge fdb del dev $swp2 $h3mac vlan 555 master 2>/dev/null # Re-prime FDB - $ARPING -I br1.555 192.0.2.130 -fqc 1 + $ARPING -I br1.555 -fqc 1 192.0.2.130 sleep 1 quick_test_span_gre_dir $tundev
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 410/565 remoteproc: qcom: q6v5: Avoid handling handover twice
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
[ Upstream commit 54898664e1eb6b5b3e6cdd9343c6eb15da776153 ]
A remoteproc could theoretically signal handover twice. This is unexpected and would break the reference counting for the handover resources (power domains, clocks, regulators, etc), so add a check to prevent that from happening.
--- drivers/remoteproc/qcom_q6v5.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/remoteproc/qcom_q6v5.c +5 -0
@@ -164,6 +164,11 @@ static irqreturn_t q6v5_handover_interrupt(int irq, void *data) {struct qcom_q6v5 *q6v5 = data; +if (q6v5->handover_issued) { +dev_err (q6v5->dev,"Handover signaled, but it already happened\n" ); +return IRQ_HANDLED ; + } +if (q6v5->handover) q6v5->handover (q6v5);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 411/565 wifi: ath12k: Increase DP_REO_CMD_RING_SIZE to 256
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nithyanantham Paramasivam <[email protected]>
[ Upstream commit 82993345aef6987a916337ebd2fca3ff4a6250a7 ]
Increase DP_REO_CMD_RING_SIZE from 128 to 256 to avoid queuing failures observed during stress test scenarios.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-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/dp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp.h +1 -1
@@ -167,7 +167,7 @@ struct ath12k_pdev_dp {#define DP_REO_REINJECT_RING_SIZE 32#define DP_RX_RELEASE_RING_SIZE 1024#define DP_REO_EXCEPTION_RING_SIZE 128 -#define DP_REO_CMD_RING_SIZE 128 +#define DP_REO_CMD_RING_SIZE 256#define DP_REO_STATUS_RING_SIZE 2048#define DP_RXDMA_BUF_RING_SIZE 4096#define DP_RX_MAC_BUF_RING_SIZE 2048
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 412/565 net: dsa: microchip: Set SPI as bus interface during reset for KSZ8463
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bastien Curutchet <[email protected]>
[ Upstream commit a0b977a3d19368b235f2a6c06e800fb25452029b ]
At reset, the KSZ8463 uses a strap-based configuration to set SPI as bus interface. SPI is the only bus supported by the driver. If the required pull-ups/pull-downs are missing (by mistake or by design to save power) the pins may float and the configuration can go wrong preventing any communication with the switch.
Introduce a ksz8463_configure_straps_spi() function called during the device reset. It relies on the 'straps-rxd-gpios' OF property and the 'reset' pinmux configuration to enforce SPI as bus interface.
--- drivers/net/dsa/microchip/ksz_common.c | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
drivers/net/dsa/microchip/ksz_common.c +45 -0
@@ -23,6 +23,7 @@#include <linux/of_mdio.h> #include <linux/of_net.h> #include <linux/micrel_phy.h> +#include <linux/pinctrl/consumer.h> #include <net/dsa.h> #include <net/ieee8021q.h> #include <net/pkt_cls.h>
@@ -4715,6 +4716,38 @@ static int ksz_parse_drive_strength(struct ksz_device *dev)return 0 ; } +static int ksz8463_configure_straps_spi (struct ksz_device *dev) +{ +struct pinctrl *pinctrl; +struct gpio_desc *rxd0; +struct gpio_desc *rxd1; + + rxd0 =devm_gpiod_get_index_optional (dev->dev,"straps-rxd" ,0 ,GPIOD_OUT_LOW ); +if (IS_ERR (rxd0)) +return PTR_ERR (rxd0); + + rxd1 =devm_gpiod_get_index_optional (dev->dev,"straps-rxd" ,1 ,GPIOD_OUT_HIGH ); +if (IS_ERR (rxd1)) +return PTR_ERR (rxd1); + +if (!rxd0 && !rxd1) +return 0 ; + +if ((rxd0 && !rxd1) || (rxd1 && !rxd0)) +return -EINVAL ; + + pinctrl =devm_pinctrl_get_select (dev->dev,"reset" ); +if (IS_ERR (pinctrl)) +return PTR_ERR (pinctrl); + +return 0 ; +} + +static int ksz8463_release_straps_spi (struct ksz_device *dev) +{ +return pinctrl_select_default_state (dev->dev); +} +int ksz_switch_register (struct ksz_device *dev) {const struct ksz_chip_data *info;
@@ -4730,10 +4763,22 @@ int ksz_switch_register(struct ksz_device *dev)return PTR_ERR (dev->reset_gpio);if (dev->reset_gpio) { +if (of_device_is_compatible (dev->dev->of_node,"microchip,ksz8463" )) { + ret =ksz8463_configure_straps_spi (dev); +if (ret) +return ret; + } +gpiod_set_value_cansleep (dev->reset_gpio,1 );usleep_range (10000 ,12000 );gpiod_set_value_cansleep (dev->reset_gpio,0 );msleep (100 ); + +if (of_device_is_compatible (dev->dev->of_node,"microchip,ksz8463" )) { + ret =ksz8463_release_straps_spi (dev); +if (ret) +return ret; + } }mutex_init (&dev->dev_mutex);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 413/565 drm/amd/display: Add AVI infoframe copy in copy_stream_update_to_stream
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthi Kandasamy <[email protected]>
[ Upstream commit c8bedab2d9a1a0daa49ac20f9928a943f7205582 ]
[WHY]
Ensure AVI infoframe updates from stream updates are applied to the active stream so OS overrides are not lost.
[HOW]
Copy avi_infopacket to stream when valid flag is set.
Follow existing infopacket copy pattern and perform a basic validity check before assignment.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 ++++++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
@@ -3035,6 +3035,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->adaptive_sync_infopacket) stream->adaptive_sync_infopacket = *update->adaptive_sync_infopacket; +if (update->avi_infopacket) + stream->avi_infopacket = *update->avi_infopacket; +if (update->dither_option) stream->dither_option = *update->dither_option;
@@ -3325,7 +3328,8 @@ static void commit_planes_do_stream_update(struct dc *dc, stream_update->vsp_infopacket || stream_update->hfvsif_infopacket || stream_update->adaptive_sync_infopacket || - stream_update->vtem_infopacket) { + stream_update->vtem_infopacket || + stream_update->avi_infopacket) {resource_build_info_frame (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx);
@@ -4759,6 +4763,7 @@ static bool full_update_required(struct dc *dc, stream_update->hfvsif_infopacket || stream_update->vtem_infopacket || stream_update->adaptive_sync_infopacket || + stream_update->avi_infopacket || stream_update->dpms_off || stream_update->allow_freesync || stream_update->vrr_active_variable ||
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -0
@@ -4156,8 +4156,14 @@ static void set_avi_info_frame(unsigned int fr_ind = pipe_ctx->stream->timing.fr_index;enum dc_timing_3d_format format; +if (stream->avi_infopacket.valid) { + *info_packet = stream->avi_infopacket; +return ; + } +memset (&hdmi_info,0 ,sizeof (union hdmi_info_packet )); + color_space = pipe_ctx->stream->output_color_space;if (color_space ==COLOR_SPACE_UNKNOWN ) color_space = (stream->timing.pixel_encoding == PIXEL_ENCODING_RGB) ?
drivers/gpu/drm/amd/display/dc/dc_stream.h +3 -0
@@ -200,6 +200,7 @@ struct dc_stream_state {struct dc_info_packet hfvsif_infopacket;struct dc_info_packet vtem_infopacket;struct dc_info_packet adaptive_sync_infopacket; +struct dc_info_packet avi_infopacket;uint8_t dsc_packed_pps[128 ];struct rect src;/* composition area */ struct rect dst;/* stream addressable area */
@@ -331,6 +332,8 @@ struct dc_stream_update {struct dc_info_packet *hfvsif_infopacket;struct dc_info_packet *vtem_infopacket;struct dc_info_packet *adaptive_sync_infopacket; +struct dc_info_packet *avi_infopacket; +bool *dpms_off;bool integer_scaling_update;bool *allow_freesync;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 414/565 drm/amd/display: Init dispclk from bootup clock for DCN314
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lo-an Chen <[email protected]>
[ Upstream commit f082daf08f2ff313bdf9cf929a28f6d888117986 ]
[Why]
Driver does not pick up and save vbios's clocks during init clocks, the dispclk in clk_mgr will keep 0 until the first update clocks. In some cases, OS changes the timing in the second set mode (lower the pixel clock), causing the driver to lower the dispclk in prepare bandwidth, which is illegal and causes grey screen.
[How]
1. Dump and save the vbios's clocks, and init the dispclk in dcn314_init_clocks.
2. Fix the condition in dcn314_update_clocks, regarding a 0kHz value.
--- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 142 +++++++++++++++++- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h | 5 + .../dc/resource/dcn314/dcn314_resource.c | 1 + 3 files changed, 143 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +137 -5
@@ -77,6 +77,7 @@ static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0x02401800, 0, 0, 0,#undef DC_LOGGER#define DC_LOGGER \ clk_mgr->base.base.ctx->logger +#define regCLK1_CLK_PLL_REQ 0x0237#define regCLK1_CLK_PLL_REQ_BASE_IDX 0
@@ -87,8 +88,70 @@ static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0x02401800, 0, 0, 0,#define CLK1_CLK_PLL_REQ__PllSpineDiv_MASK 0x0000F000L#define CLK1_CLK_PLL_REQ__FbMult_frac_MASK 0xFFFF0000L +#define regCLK1_CLK0_DFS_CNTL 0x0269 +#define regCLK1_CLK0_DFS_CNTL_BASE_IDX 0 +#define regCLK1_CLK1_DFS_CNTL 0x026c +#define regCLK1_CLK1_DFS_CNTL_BASE_IDX 0 +#define regCLK1_CLK2_DFS_CNTL 0x026f +#define regCLK1_CLK2_DFS_CNTL_BASE_IDX 0 +#define regCLK1_CLK3_DFS_CNTL 0x0272 +#define regCLK1_CLK3_DFS_CNTL_BASE_IDX 0 +#define regCLK1_CLK4_DFS_CNTL 0x0275 +#define regCLK1_CLK4_DFS_CNTL_BASE_IDX 0 +#define regCLK1_CLK5_DFS_CNTL 0x0278 +#define regCLK1_CLK5_DFS_CNTL_BASE_IDX 0 + +#define regCLK1_CLK0_CURRENT_CNT 0x02fb +#define regCLK1_CLK0_CURRENT_CNT_BASE_IDX 0 +#define regCLK1_CLK1_CURRENT_CNT 0x02fc +#define regCLK1_CLK1_CURRENT_CNT_BASE_IDX 0 +#define regCLK1_CLK2_CURRENT_CNT 0x02fd +#define regCLK1_CLK2_CURRENT_CNT_BASE_IDX 0 +#define regCLK1_CLK3_CURRENT_CNT 0x02fe +#define regCLK1_CLK3_CURRENT_CNT_BASE_IDX 0 +#define regCLK1_CLK4_CURRENT_CNT 0x02ff +#define regCLK1_CLK4_CURRENT_CNT_BASE_IDX 0 +#define regCLK1_CLK5_CURRENT_CNT 0x0300 +#define regCLK1_CLK5_CURRENT_CNT_BASE_IDX 0 + +#define regCLK1_CLK0_BYPASS_CNTL 0x028a +#define regCLK1_CLK0_BYPASS_CNTL_BASE_IDX 0 +#define regCLK1_CLK1_BYPASS_CNTL 0x0293 +#define regCLK1_CLK1_BYPASS_CNTL_BASE_IDX 0#define regCLK1_CLK2_BYPASS_CNTL 0x029c#define regCLK1_CLK2_BYPASS_CNTL_BASE_IDX 0 +#define regCLK1_CLK3_BYPASS_CNTL 0x02a5 +#define regCLK1_CLK3_BYPASS_CNTL_BASE_IDX 0 +#define regCLK1_CLK4_BYPASS_CNTL 0x02ae +#define regCLK1_CLK4_BYPASS_CNTL_BASE_IDX 0 +#define regCLK1_CLK5_BYPASS_CNTL 0x02b7 +#define regCLK1_CLK5_BYPASS_CNTL_BASE_IDX 0 + +#define regCLK1_CLK0_DS_CNTL 0x0283 +#define regCLK1_CLK0_DS_CNTL_BASE_IDX 0 +#define regCLK1_CLK1_DS_CNTL 0x028c +#define regCLK1_CLK1_DS_CNTL_BASE_IDX 0 +#define regCLK1_CLK2_DS_CNTL 0x0295 +#define regCLK1_CLK2_DS_CNTL_BASE_IDX 0 +#define regCLK1_CLK3_DS_CNTL 0x029e +#define regCLK1_CLK3_DS_CNTL_BASE_IDX 0 +#define regCLK1_CLK4_DS_CNTL 0x02a7 +#define regCLK1_CLK4_DS_CNTL_BASE_IDX 0 +#define regCLK1_CLK5_DS_CNTL 0x02b0 +#define regCLK1_CLK5_DS_CNTL_BASE_IDX 0 + +#define regCLK1_CLK0_ALLOW_DS 0x0284 +#define regCLK1_CLK0_ALLOW_DS_BASE_IDX 0 +#define regCLK1_CLK1_ALLOW_DS 0x028d +#define regCLK1_CLK1_ALLOW_DS_BASE_IDX 0 +#define regCLK1_CLK2_ALLOW_DS 0x0296 +#define regCLK1_CLK2_ALLOW_DS_BASE_IDX 0 +#define regCLK1_CLK3_ALLOW_DS 0x029f +#define regCLK1_CLK3_ALLOW_DS_BASE_IDX 0 +#define regCLK1_CLK4_ALLOW_DS 0x02a8 +#define regCLK1_CLK4_ALLOW_DS_BASE_IDX 0 +#define regCLK1_CLK5_ALLOW_DS 0x02b1 +#define regCLK1_CLK5_ALLOW_DS_BASE_IDX 0#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL__SHIFT 0x0#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV__SHIFT 0x10
@@ -185,6 +248,8 @@ void dcn314_init_clocks(struct clk_mgr *clk_mgr) {struct clk_mgr_internal *clk_mgr_int =TO_CLK_MGR_INTERNAL (clk_mgr);uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz; +struct clk_mgr_dcn314 *clk_mgr_dcn314 =TO_CLK_MGR_DCN314 (clk_mgr_int); +struct clk_log_info log_info = {0 };memset (&(clk_mgr->clks),0 ,sizeof (struct dc_clocks ));// Assumption is that boot state always supports pstate
@@ -200,6 +265,9 @@ void dcn314_init_clocks(struct clk_mgr *clk_mgr)dce_adjust_dp_ref_freq_for_ss (clk_mgr_int, clk_mgr->dprefclk_khz); else clk_mgr->dp_dto_source_clock_in_khz = clk_mgr->dprefclk_khz; + +dcn314_dump_clk_registers (&clk_mgr->boot_snapshot, &clk_mgr_dcn314->base.base, &log_info); + clk_mgr->clks.dispclk_khz = clk_mgr->boot_snapshot.dispclk *1000 ; } void dcn314_update_clocks(struct clk_mgr *clk_mgr_base,
@@ -218,6 +286,8 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base,if (dc->work_arounds.skip_clock_update)return ; + display_count =dcn314_get_active_display_cnt_wa (dc, context); +/* * if it is safe to lower, but we are already in the lower state, we don't have to do anything * also if safe to lower is false, we just go in the higher state
@@ -236,7 +306,6 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, }/* check that we're not already in lower */ if (clk_mgr_base->clks.pwr_state !=DCN_PWR_STATE_LOW_POWER ) { - display_count =dcn314_get_active_display_cnt_wa (dc, context);/* if we can go lower, go lower */ if (display_count ==0 ) {union display_idle_optimization_u idle_info = {0 };
@@ -293,11 +362,19 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, update_dppclk = true; } -if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { +if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) && + (new_clocks->dispclk_khz >0 || (safe_to_lower && display_count ==0 ))) { +int requested_dispclk_khz = new_clocks->dispclk_khz; +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, true); +/* Clamp the requested clock to PMFW based on their limit. */ +if (dc->debug.min_disp_clk_khz >0 && requested_dispclk_khz < dc->debug.min_disp_clk_khz) + requested_dispclk_khz = dc->debug.min_disp_clk_khz; + +dcn314_smu_set_dispclk (clk_mgr, requested_dispclk_khz); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz; -dcn314_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, false); update_dispclk = true;
@@ -385,10 +462,65 @@ bool dcn314_are_clock_states_equal(struct dc_clocks *a,return true; } -static void dcn314_dump_clk_registers (struct clk_state_registers_and_bypass *regs_and_bypass, + +static void dcn314_dump_clk_registers_internal (struct dcn35_clk_internal *internal,struct clk_mgr *clk_mgr_base) +{ +struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); + +// read dtbclk + internal->CLK1_CLK4_CURRENT_CNT =REG_READ (CLK1_CLK4_CURRENT_CNT ); + internal->CLK1_CLK4_BYPASS_CNTL =REG_READ (CLK1_CLK4_BYPASS_CNTL ); + +// read dcfclk + internal->CLK1_CLK3_CURRENT_CNT =REG_READ (CLK1_CLK3_CURRENT_CNT ); + internal->CLK1_CLK3_BYPASS_CNTL =REG_READ (CLK1_CLK3_BYPASS_CNTL ); + +// read dcf deep sleep divider + internal->CLK1_CLK3_DS_CNTL =REG_READ (CLK1_CLK3_DS_CNTL ); + internal->CLK1_CLK3_ALLOW_DS =REG_READ (CLK1_CLK3_ALLOW_DS ); + +// read dppclk + internal->CLK1_CLK1_CURRENT_CNT =REG_READ (CLK1_CLK1_CURRENT_CNT ); + internal->CLK1_CLK1_BYPASS_CNTL =REG_READ (CLK1_CLK1_BYPASS_CNTL ); + +// read dprefclk + internal->CLK1_CLK2_CURRENT_CNT =REG_READ (CLK1_CLK2_CURRENT_CNT ); + internal->CLK1_CLK2_BYPASS_CNTL =REG_READ (CLK1_CLK2_BYPASS_CNTL ); + +// read dispclk + internal->CLK1_CLK0_CURRENT_CNT =REG_READ (CLK1_CLK0_CURRENT_CNT ); + internal->CLK1_CLK0_BYPASS_CNTL =REG_READ (CLK1_CLK0_BYPASS_CNTL ); +} + +void dcn314_dump_clk_registers (struct clk_state_registers_and_bypass *regs_and_bypass,struct clk_mgr *clk_mgr_base,struct clk_log_info *log_info) { -return ; + +struct dcn35_clk_internal internal = {0 }; + +dcn314_dump_clk_registers_internal (&internal, clk_mgr_base); + + regs_and_bypass->dcfclk = internal.CLK1_CLK3_CURRENT_CNT /10 ; + regs_and_bypass->dcf_deep_sleep_divider = internal.CLK1_CLK3_DS_CNTL /10 ; + regs_and_bypass->dcf_deep_sleep_allow = internal.CLK1_CLK3_ALLOW_DS; + regs_and_bypass->dprefclk = internal.CLK1_CLK2_CURRENT_CNT /10 ; + regs_and_bypass->dispclk = internal.CLK1_CLK0_CURRENT_CNT /10 ; + regs_and_bypass->dppclk = internal.CLK1_CLK1_CURRENT_CNT /10 ; + regs_and_bypass->dtbclk = internal.CLK1_CLK4_CURRENT_CNT /10 ; + + regs_and_bypass->dppclk_bypass = internal.CLK1_CLK1_BYPASS_CNTL &0x0007 ; +if (regs_and_bypass->dppclk_bypass <0 || regs_and_bypass->dppclk_bypass >4 ) + regs_and_bypass->dppclk_bypass =0 ; + regs_and_bypass->dcfclk_bypass = internal.CLK1_CLK3_BYPASS_CNTL &0x0007 ; +if (regs_and_bypass->dcfclk_bypass <0 || regs_and_bypass->dcfclk_bypass >4 ) + regs_and_bypass->dcfclk_bypass =0 ; + regs_and_bypass->dispclk_bypass = internal.CLK1_CLK0_BYPASS_CNTL &0x0007 ; +if (regs_and_bypass->dispclk_bypass <0 || regs_and_bypass->dispclk_bypass >4 ) + regs_and_bypass->dispclk_bypass =0 ; + regs_and_bypass->dprefclk_bypass = internal.CLK1_CLK2_BYPASS_CNTL &0x0007 ; +if (regs_and_bypass->dprefclk_bypass <0 || regs_and_bypass->dprefclk_bypass >4 ) + regs_and_bypass->dprefclk_bypass =0 ; + }static struct clk_bw_params dcn314_bw_params = {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.h +5 -0
@@ -65,4 +65,9 @@ void dcn314_clk_mgr_construct(struct dc_context *ctx,void dcn314_clk_mgr_destroy (struct clk_mgr_internal *clk_mgr_int); + +void dcn314_dump_clk_registers (struct clk_state_registers_and_bypass *regs_and_bypass, +struct clk_mgr *clk_mgr_base,struct clk_log_info *log_info); + +#endif //__DCN314_CLK_MGR_H__
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +1 -0
@@ -928,6 +928,7 @@ static const struct dc_debug_options debug_defaults_drv = { .enable_legacy_fast_update = true, .using_dml2 = false, .disable_dsc_power_gate = true, + .min_disp_clk_khz = 100000, };static const struct dc_panel_config panel_config_defaults = {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 415/565 drm/amd/display: Fix for test crash due to power gating
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sridevi Arvindekar <[email protected]>
[ Upstream commit 0bf6b216d4783cb51f9af05a49d3cce4fc22dc24 ]
[Why/How]
Call power gating routine only if it is defined.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +2 -1
@@ -3086,7 +3086,8 @@ void dcn20_fpga_init_hw(struct dc *dc) res_pool->dccg->funcs->dccg_init (res_pool->dccg);//Enable ability to power gate / don't force power on permanently - hws->funcs.enable_power_gating_plane (hws, true); +if (hws->funcs.enable_power_gating_plane) + hws->funcs.enable_power_gating_plane (hws, true);// Specific to FPGA dccg and registers REG_WRITE (RBBMIF_TIMEOUT_DIS ,0xFFFFFFFF );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 416/565 drm/amd/display: change dc stream color settings only in atomic commit
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <[email protected]>
[ Upstream commit 51cb93aa0c4a9bb126b76f6e9fd640d88de25cee ]
Don't update DC stream color components during atomic check. The driver will continue validating the new CRTC color state but will not change DC stream color components. The DC stream color state will only be programmed at commit time in the atomic_setup_commit stage.
It fixes gamma LUT loss reported by KDE users when changing brightness quickly or changing Display settings (such as overscan) with nightlight on and HDR. As KWin can do a test commit with color settings different from those that should be applied in a non-test-only commit, if the driver changes DC stream color state in atomic check, this state can be eventually HW programmed in commit tail, instead of the respective state set by the non-blocking commit.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 + .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 86 ++++++++++++++----- 3 files changed, 66 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10773,7 +10773,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,if (dm_new_crtc_state->base.color_mgmt_changed || dm_old_crtc_state->regamma_tf != dm_new_crtc_state->regamma_tf ||drm_atomic_crtc_needs_modeset (new_crtc_state)) { - ret =amdgpu_dm_update_crtc_color_mgmt (dm_new_crtc_state); + ret =amdgpu_dm_check_crtc_color_mgmt (dm_new_crtc_state, true);if (ret) goto fail; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +2 -0
@@ -971,6 +971,8 @@ void amdgpu_dm_init_color_mod(void);int amdgpu_dm_create_color_properties (struct amdgpu_device *adev);int amdgpu_dm_verify_lut_sizes (const struct drm_crtc_state *crtc_state);int amdgpu_dm_update_crtc_color_mgmt (struct dm_crtc_state *crtc); +int amdgpu_dm_check_crtc_color_mgmt (struct dm_crtc_state *crtc, +bool check_only);int amdgpu_dm_update_plane_color_mgmt (struct dm_crtc_state *crtc,struct drm_plane_state *plane_state,struct dc_plane_state *dc_plane_state);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +63 -23
144 lines not on this page · raw message
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 417/565 NFSv4: handle ERR_GRACE on delegation recalls
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <[email protected]>
[ Upstream commit be390f95242785adbf37d7b8a5101dd2f2ba891b ]
RFC7530 states that clients should be prepared for the return of NFS4ERR_GRACE errors for non-reclaim lock and I/O requests.
--- fs/nfs/nfs4proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +2 -2
@@ -7823,10 +7823,10 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state,return err;do { err =_nfs4_do_setlk (state,F_SETLK , fl,NFS_LOCK_NEW ); -if (err != -NFS4ERR_DELAY ) +if (err != -NFS4ERR_DELAY && err != -NFS4ERR_GRACE )break ;ssleep (1 ); - }while (err == -NFS4ERR_DELAY ); + }while (err == -NFS4ERR_DELAY || err == -NFSERR_GRACE );return nfs4_handle_delegation_recall_error (server, state, stateid, fl, err); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 418/565 NFSv4.1: fix mount hang after CREATE_SESSION failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anthony Iliopoulos <[email protected]>
[ Upstream commit bf75ad096820fee5da40e671ebb32de725a1c417 ]
When client initialization goes through server trunking discovery, it schedules the state manager and then sleeps waiting for nfs_client initialization completion.
The state manager can fail during state recovery, and specifically in lease establishment as nfs41_init_clientid() will bail out in case of errors returned from nfs4_proc_create_session(), without ever marking the client ready. The session creation can fail for a variety of reasons e.g. during backchannel parameter negotiation, with status -EINVAL.
The error status will propagate all the way to the nfs4_state_manager but the client status will not be marked, and thus the mount process will remain blocked waiting.
Fix it by adding -EINVAL error handling to nfs4_state_manager().
--- fs/nfs/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nfs/nfs4state.c +3 -0
@@ -2745,6 +2745,9 @@ static void nfs4_state_manager(struct nfs_client *clp)case -ENETUNREACH :nfs_mark_client_ready (clp, -EIO );break ; +case -EINVAL : +nfs_mark_client_ready (clp, status); +break ;default :ssleep (1 );break ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 419/565 nfs4_setup_readdir(): insufficient locking for ->d_parent->d_inode dereferencing
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit a890a2e339b929dbd843328f9a92a1625404fe63 ]
Theoretically it's an oopsable race, but I don't believe one can manage to hit it on real hardware; might become doable on a KVM, but it still won't be easy to attack.
Anyway, it's easy to deal with - since xdr_encode_hyper() is just a call of put_unaligned_be64(), we can put that under ->d_lock and be done with that.
--- fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/nfs4proc.c +2 -0
@@ -374,7 +374,9 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent *p++ =htonl (attrs);/* bitmap */ *p++ =htonl (12 );/* attribute buffer length */ *p++ =htonl (NF4DIR ); +spin_lock (&dentry->d_lock); p =xdr_encode_hyper (p,NFS_FILEID (d_inode (dentry->d_parent))); +spin_unlock (&dentry->d_lock); readdir->pgbase = (char *)p - (char *)start; readdir->count -= readdir->pgbase;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 420/565 net: bridge: Install FDB for bridge MAC on VLAN 0
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Machata <[email protected]>
[ Upstream commit cd9a9562b2559973aa1b68c3af63021a2c5fd022 ]
Currently, after the bridge is created, the FDB does not hold an FDB entry for the bridge MAC on VLAN 0:
# ip link add name br up type bridge # ip -br link show dev br br UNKNOWN 92:19:8c:4e:01:ed <BROADCAST,MULTICAST,UP,LOWER_UP> # bridge fdb show | grep 92:19:8c:4e:01:ed 92:19:8c:4e:01:ed dev br vlan 1 master br permanent
Later when the bridge MAC is changed, or in fact when the address is given during netdevice creation, the entry appears:
# ip link add name br up address 00:11:22:33:44:55 type bridge # bridge fdb show | grep 00:11:22:33:44:55 00:11:22:33:44:55 dev br vlan 1 master br permanent 00:11:22:33:44:55 dev br master br permanent
However when the bridge address is set by the user to the current bridge address before the first port is enslaved, none of the address handlers gets invoked, because the address is not actually changed. The address is however marked as NET_ADDR_SET. Then when a port is enslaved, the address is not changed, because it is NET_ADDR_SET. Thus the VLAN 0 entry is not added, and it has not been added previously either:
# ip link add name br up type bridge # ip -br link show dev br br UNKNOWN 7e:f0:a8:1a:be:c2 <BROADCAST,MULTICAST,UP,LOWER_UP> # ip link set dev br addr 7e:f0:a8:1a:be:c2 # ip link add name v up type veth # ip link set dev v master br # ip -br link show dev br br UNKNOWN 7e:f0:a8:1a:be:c2 <BROADCAST,MULTICAST,UP,LOWER_UP> # bridge fdb | grep 7e:f0:a8:1a:be:c2 7e:f0:a8:1a:be:c2 dev br vlan 1 master br permanent
Then when the bridge MAC is used as DMAC, and br_handle_frame_finish() looks up an FDB entry with VLAN=0, it doesn't find any, and floods the traffic instead of passing it up.
Fix this by simply adding the VLAN 0 FDB entry for the bridge itself always on netdevice creation. This also makes the behavior consistent with how ports are treated: ports always have an FDB entry for each member VLAN as well as VLAN 0.
--- net/bridge/br.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bridge/br.c +5 -0
@@ -37,6 +37,11 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, vint err;if (netif_is_bridge_master (dev)) { +struct net_bridge *br =netdev_priv (dev); + +if (event ==NETDEV_REGISTER ) +br_fdb_change_mac_address (br, dev->dev_addr); + err =br_vlan_bridge_event (dev, event, ptr);if (err)return notifier_from_errno (err);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 421/565 scsi: libfc: Fix potential buffer overflow in fc_ct_ms_fill()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alok Tiwari <[email protected]>
[ Upstream commit 072fdd4b0be9b9051bdf75f36d0227aa705074ba ]
The fc_ct_ms_fill() helper currently formats the OS name and version into entry->value using "%s v%s". Since init_utsname()->sysname and ->release are unbounded strings, snprintf() may attempt to write more than FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN bytes, triggering a -Wformat-truncation warning with W=1.
In file included from drivers/scsi/libfc/fc_elsct.c:18:drivers/scsi/libfc/fc_encode.h: In function ‘fc_ct_ms_fill.constprop’:drivers/scsi/libfc/fc_encode.h:359:30: error: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size between 62 and 126 [-Werror=format-truncation=]
359 | "%s v%s",
| ^~
360 | init_utsname()->sysname,
361 | init_utsname()->release);
| ~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/libfc/fc_encode.h:357:17: note: ‘snprintf’ output between
3 and 131 bytes into a destination of size 128
357 | snprintf((char *)&entry->value,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358 | FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359 | "%s v%s",
| ~~~~~~~~~
360 | init_utsname()->sysname,
| ~~~~~~~~~~~~~~~~~~~~~~~~
361 | init_utsname()->release);
| ~~~~~~~~~~~~~~~~~~~~~~~~Fix this by using "%.62s v%.62s", which ensures sysname and release are truncated to fit within the 128-byte field defined by FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN.
[mkp: clarified commit description]
--- drivers/scsi/libfc/fc_encode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libfc/fc_encode.h +1 -1
@@ -356,7 +356,7 @@ static inline int fc_ct_ms_fill(struct fc_lport *lport,put_unaligned_be16 (len, &entry->len);snprintf ((char *)&entry->value,FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN , -"%s v%s" , +"%.62s v%.62s" ,init_utsname ()->sysname,init_utsname ()->release);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 422/565 accel/habanalabs/gaudi2: fix BMON disable configuration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vered Yavniely <[email protected]>
[ Upstream commit b4fd8e56c9a3b614370fde2d45aec1032eb67ddd ]
Change the BMON_CR register value back to its original state before enabling, so that BMON does not continue to collect information after being disabled.
--- drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c +1 -1
@@ -2426,7 +2426,7 @@ static int gaudi2_config_bmon(struct hl_device *hdev, struct hl_debug_params *paWREG32 (base_reg + mmBMON_ADDRH_E3_OFFSET,0 );WREG32 (base_reg + mmBMON_REDUCTION_OFFSET,0 );WREG32 (base_reg + mmBMON_STM_TRC_OFFSET,0x7 | (0xA <<8 )); -WREG32 (base_reg + mmBMON_CR_OFFSET,0x77 |0xf <<24 ); +WREG32 (base_reg + mmBMON_CR_OFFSET,0x41 ); }return 0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 423/565 scsi: mpt3sas: Add support for 22.5 Gbps SAS link rate
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranjan Kumar <[email protected]>
[ Upstream commit 4be7599d6b27bade41bfccca42901b917c01c30c ]
Add handling for MPI26_SAS_NEG_LINK_RATE_22_5 in _transport_convert_phy_link_rate(). This maps the new 22.5 Gbps negotiated rate to SAS_LINK_RATE_22_5_GBPS, to get correct PHY link speeds.
Message-Id: <[email protected]>
--- drivers/scsi/mpt3sas/mpt3sas_transport.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/mpt3sas/mpt3sas_transport.c +3 -0
@@ -166,6 +166,9 @@ _transport_convert_phy_link_rate(u8 link_rate)case MPI25_SAS_NEG_LINK_RATE_12_0 : rc =SAS_LINK_RATE_12_0_GBPS ;break ; +case MPI26_SAS_NEG_LINK_RATE_22_5 : + rc =SAS_LINK_RATE_22_5_GBPS ; +break ;case MPI2_SAS_NEG_LINK_RATE_PHY_DISABLED : rc =SAS_PHY_DISABLED ;break ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 424/565 accel/habanalabs: return ENOMEM if less than requested pages were pinned
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomer Tayar <[email protected]>
[ Upstream commit 9f5067531c9b79318c4e48a933cb2694f53f3de2 ]
EFAULT is currently returned if less than requested user pages are pinned. This value means a "bad address" which might be confusing to the user, as the address of the given user memory is not necessarily "bad".
Modify the return value to ENOMEM, as "out of memory" is more suitable in this case.
--- drivers/accel/habanalabs/common/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/common/memory.c +1 -1
@@ -2332,7 +2332,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,if (rc <0 ) goto destroy_pages; npages = rc; - rc = -EFAULT ; + rc = -ENOMEM ; goto put_pages; } userptr->npages = npages;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 425/565 accel/habanalabs/gaudi2: read preboot status after recovering from dirty state
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Sinyuk <[email protected]>
[ Upstream commit a0d866bab184161ba155b352650083bf6695e50e ]
Dirty state can occur when the host VM undergoes a reset while the device does not. In such a case, the driver must reset the device before it can be used again. As part of this reset, the device capabilities are zeroed. Therefore, the driver must read the Preboot status again to learn the Preboot state, capabilities, and security configuration.
--- drivers/accel/habanalabs/gaudi2/gaudi2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/accel/habanalabs/gaudi2/gaudi2.c +7 -1
@@ -3150,7 +3150,6 @@ static int gaudi2_early_init(struct hl_device *hdev) rc =hl_fw_read_preboot_status (hdev);if (rc) {if (hdev->reset_on_preboot_fail) -/* we are already on failure flow, so don't check if hw_fini fails. */ hdev->asic_funcs->hw_fini (hdev, true, false); goto pci_fini; }
@@ -3162,6 +3161,13 @@ static int gaudi2_early_init(struct hl_device *hdev)dev_err (hdev->dev,"failed to reset HW in dirty state (%d)\n" , rc); goto pci_fini; } + + rc =hl_fw_read_preboot_status (hdev); +if (rc) { +if (hdev->reset_on_preboot_fail) + hdev->asic_funcs->hw_fini (hdev, true, false); + goto pci_fini; + } }return 0 ;
Signature · 1 line
2.51.0
Re: [PATCH 6.12 425/565] accel/habanalabs/gaudi2: read preboot status after recovering from dirty state
Quoted 14 lines · Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Sinyuk <[email protected]>
[ Upstream commit
a0d866bab184161ba155b352650083bf6695e50e]Dirty state can occur when the host VM undergoes a reset while the device does not. In such a case, the driver must reset the device before it can be used again. As part of this reset, the device capabilities are zeroed. Therefore, the driver must read the Preboot status again to learn the Preboot state, capabilities, and security configuration.
Quoted 4 lines
Signed-off-by Konstantin Sinyuk <[email protected]>Reviewed-by Koby Elbaz <[email protected]>Signed-off-by Koby Elbaz <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Looks good for 6.12-stable. The backport correctly re-reads the preboot status after recovering from a dirty state, restoring accurate capability and security information following a VM-only reset.
Thanks,
Konstantin
Greg Kroah-Hartman
maintainerPATCH 426/565 accel/habanalabs: support mapping cb with vmalloc-backed coherent memory
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Moti Haimovski <[email protected]>
[ Upstream commit 513024d5a0e34fd34247043f1876b6138ca52847 ]
When IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return addresses from the vmalloc range. If such an address is mapped without VM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the VM_PFNMAP restriction.
Fix this by checking for vmalloc addresses and setting VM_MIXEDMAP in the VMA before mapping. This ensures safe mapping and avoids kernel crashes. The memory is still driver-allocated and cannot be accessed directly by userspace.
--- drivers/accel/habanalabs/gaudi/gaudi.c | 19 +++++++++++++++++++ drivers/accel/habanalabs/gaudi2/gaudi2.c | 7 +++++++ 2 files changed, 26 insertions(+)
drivers/accel/habanalabs/gaudi/gaudi.c +19 -0
@@ -4168,10 +4168,29 @@ static int gaudi_mmap(struct hl_device *hdev, struct vm_area_struct *vma,vm_flags_set (vma,VM_IO |VM_PFNMAP |VM_DONTEXPAND |VM_DONTDUMP |VM_DONTCOPY |VM_NORESERVE ); +#ifdef _HAS_DMA_MMAP_COHERENT +/* +* If dma_alloc_coherent() returns a vmalloc address, set VM_MIXEDMAP +* so vm_insert_page() can handle it safely. Without this, the kernel +* may BUG_ON due to VM_PFNMAP. +*/ +if (is_vmalloc_addr (cpu_addr)) +vm_flags_set (vma,VM_MIXEDMAP ); + rc =dma_mmap_coherent (hdev->dev, vma, cpu_addr, (dma_addr -HOST_PHYS_BASE ), size);if (rc)dev_err (hdev->dev,"dma_mmap_coherent error %d" , rc); +#else + + rc =remap_pfn_range (vma, vma->vm_start, +virt_to_phys (cpu_addr) >>PAGE_SHIFT , + size, vma->vm_page_prot); +if (rc) +dev_err (hdev->dev,"remap_pfn_range error %d" , rc); + +#endif +return rc; }
drivers/accel/habanalabs/gaudi2/gaudi2.c +7 -0
@@ -6490,6 +6490,13 @@ static int gaudi2_mmap(struct hl_device *hdev, struct vm_area_struct *vma, VM_DONTCOPY | VM_NORESERVE);#ifdef _HAS_DMA_MMAP_COHERENT +/* +* If dma_alloc_coherent() returns a vmalloc address, set VM_MIXEDMAP +* so vm_insert_page() can handle it safely. Without this, the kernel +* may BUG_ON due to VM_PFNMAP. +*/ +if (is_vmalloc_addr (cpu_addr)) +vm_flags_set (vma,VM_MIXEDMAP ); rc =dma_mmap_coherent (hdev->dev, vma, cpu_addr, dma_addr, size);if (rc)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 427/565 fs: ext4: change GFP_KERNEL to GFP_NOFS to avoid deadlock
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: chuguangqing <[email protected]>
[ Upstream commit 1534f72dc2a11ded38b0e0268fbcc0ca24e9fd4a ]
The parent function ext4_xattr_inode_lookup_create already uses GFP_NOFS for memory alloction, so the function ext4_xattr_inode_cache_find should use same gfp_flag.
--- fs/ext4/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/xattr.c +1 -1
@@ -1552,7 +1552,7 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,WARN_ON_ONCE (ext4_handle_valid (journal_current_handle ()) && !(current->flags &PF_MEMALLOC_NOFS )); - ea_data =kvmalloc (value_len,GFP_KERNEL ); + ea_data =kvmalloc (value_len,GFP_NOFS );if (!ea_data) {mb_cache_entry_put (ea_inode_cache, ce);return NULL ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 428/565 ext4: increase IO priority of fastcommit
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Sun <[email protected]>
[ Upstream commit 46e75c56dfeafb6756773b71cabe187a6886859a ]
The following code paths may result in high latency or even task hangs:
1. fastcommit io is throttled by wbt.
2. jbd2_fc_wait_bufs() might wait for a long time whileJBD2_FAST_COMMIT_ONGOING is set in journal->flags, and then jbd2_journal_commit_transaction() waits for the JBD2_FAST_COMMIT_ONGOING bit for a long time while holding the write lock of j_state_lock.
3. start_this_handle() waits for read lock of j_state_lock which
results in high latency or task hang.
Given the fact that ext4_fc_commit() already modifies the current process' IO priority to match that of the jbd2 thread, it should be reasonable to match jbd2's IO submission flags as well.
Message-ID: <[email protected]>
--- fs/ext4/fast_commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/fast_commit.c +1 -1
@@ -675,7 +675,7 @@ void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t starstatic void ext4_fc_submit_bh (struct super_block *sb,bool is_tail) { -blk_opf_t write_flags =REQ_SYNC ; +blk_opf_t write_flags =JBD2_JOURNAL_REQ_FLAGS ;struct buffer_head *bh =EXT4_SB (sb)->s_fc_bh;/* Add REQ_FUA | REQ_PREFLUSH only its tail */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 429/565 amd/amdkfd: resolve a race in amdgpu_amdkfd_device_fini_sw
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <[email protected]>
[ Upstream commit 99d7181bca34e96fbf61bdb6844918bdd4df2814 ]
There is race in amdgpu_amdkfd_device_fini_sw and interrupt. if amdgpu_amdkfd_device_fini_sw run in b/w kfd_cleanup_nodes and
kfree(kfd), and KGD interrupt generated.
kernel panic log:
BUG: kernel NULL pointer dereference, address: 0000000000000098
amdgpu 0000:c8:00.0: amdgpu: Requesting 4 partitions through PSP
PGD d78c68067 P4D d78c68067
kfd kfd: amdgpu: Allocated 3969056 bytes on gart
PUD 1465b8067 PMD @
Oops: @002 [#1] SMP NOPTI
kfd kfd: amdgpu: Total number of KFD nodes to be created: 4
CPU: 115 PID: @ Comm: swapper/115 Kdump: loaded Tainted: G S W OE K RIP: 0010:_raw_spin_lock_irqsave+0x12/0x40 Code: 89 e@ 41 5c c3 cc cc cc cc 66 66 2e Of 1f 84 00 00 00 00 00 OF 1f 40 00 Of 1f 44% 00 00 41 54 9c 41 5c fa 31 cO ba 01 00 00 00 <fO> OF b1 17 75 Ba 4c 89 e@ 41 Sc
89 c6 e8 07 38 5d
RSP: 0018: ffffc90@1a6b0e28 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000018 0000000000000001 RSI: ffff8883bb623e00 RDI: 0000000000000098 ffff8883bb000000 RO8: ffff888100055020 ROO: ffff888100055020 0000000000000000 R11: 0000000000000000 R12: 0900000000000002 ffff888F2b97da0@ R14: @000000000000098 R15: ffff8883babdfo00
CS: 010 DS: 0000 ES: 0000 CRO: 0000000080050033
CR2: 0000000000000098 CR3: 0000000e7cae2006 CR4: 0000000002770ce0 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 0000000000000000 DR6: 00000000fffeO7FO DR7: 0000000000000400
PKRU: 55555554
Call Trace: <IRQ>
kgd2kfd_interrupt+@x6b/0x1f@ [amdgpu]
? amdgpu_fence_process+0xa4/0x150 [amdgpu]
kfd kfd: amdgpu: Node: 0, interrupt_bitmap: 3 YcpxFl Rant tErace
amdgpu_irq_dispatch+0x165/0x210 [amdgpu] amdgpu_ih_process+0x80/0x100 [amdgpu]
amdgpu: Virtual CRAT table created for GPU
amdgpu_irq_handler+0x1f/@x60 [amdgpu]
__handle_irq_event_percpu+0x3d/0x170
amdgpu: Topology: Add dGPU node [0x74a2:0x1002]
handle_irq_event+0x5a/@xcO
handle_edge_irq+0x93/0x240
kfd kfd: amdgpu: KFD node 1 partition @ size 49148M
asm_call_irq_on_stack+0xf/@x20
</IRQ> common_interrupt+0xb3/0x130 asm_common_interrupt+0x1le/0x40
5.10.134-010.a1i5000.a18.x86_64 #1
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +9 -1
@@ -1084,7 +1084,15 @@ void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry) }for (i =0 ; i < kfd->num_nodes; i++) { - node = kfd->nodes[i]; +/* Race if another thread in b/w +* kfd_cleanup_nodes and kfree(kfd), +* when kfd->nodes[i] = NULL +*/ +if (kfd->nodes[i]) + node = kfd->nodes[i]; +else +return ; +spin_lock_irqsave (&node->interrupt_lock, flags); if (node->interrupts_active
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 430/565 ASoC: stm32: sai: manage context in set_sysclk callback
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Moysan <[email protected]>
[ Upstream commit 27fa1a8b2803dfd88c39f03b0969c55f667cdc43 ]
The mclk direction now needs to be specified in endpoint node with "system-clock-direction-out" property. However some calls to the set_sysclk callback, related to CPU DAI clock, result in unbalanced calls to clock API.
The set_sysclk callback in STM32 SAI driver is intended only for mclk management. So it is relevant to ensure that calls to set_sysclk are related to mclk only.
Since the master clock is handled only at runtime, skip the calls to set_sysclk in the initialization phase.
--- sound/soc/stm/stm32_sai_sub.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/soc/stm/stm32_sai_sub.c +8 -0
@@ -551,6 +551,14 @@ static int stm32_sai_set_sysclk(struct snd_soc_dai *cpu_dai,struct stm32_sai_sub_data *sai =snd_soc_dai_get_drvdata (cpu_dai);int ret; +/* +* The mclk rate is determined at runtime from the audio stream rate. +* Skip calls to the set_sysclk callback that are not relevant during the +* initialization phase. +*/ +if (!snd_soc_card_is_instantiated (cpu_dai->component->card)) +return 0 ; +if (dir ==SND_SOC_CLOCK_OUT && sai->sai_mclk) { ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_NODIV,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 431/565 ASoC: tlv320aic3x: Fix class-D initialization for tlv320aic3007
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Primoz Fiser <[email protected]>
[ Upstream commit 733a763dd8b3ac2858dd238a91bb3a2fdff4739e ]
The problem of having class-D initialization sequence in probe using regmap_register_patch() is that it will do hardware register writes immediately after being called as it bypasses regcache. Afterwards, in aic3x_init() we also perform codec soft reset, rendering class-D init sequence pointless. This issue is even more apparent when using reset GPIO line, since in that case class-D amplifier initialization fails with "Failed to init class D: -5" message as codec is already held in reset state after requesting the reset GPIO and hence hardware I/O fails with -EIO errno.
Thus move class-D amplifier initialization sequence from probe function to aic3x_set_power() just before the usual regcache sync. Use bypassed regmap_multi_reg_write_bypassed() function to make sure, class-D init sequence is performed in proper order as described in the datasheet.
--- sound/soc/codecs/tlv320aic3x.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-)
sound/soc/codecs/tlv320aic3x.c +14 -18
@@ -121,6 +121,16 @@ static const struct reg_default aic3x_reg[] = { { 108, 0x00 }, { 109, 0x00 }, }; +static const struct reg_sequence aic3007_class_d[] = { +/* Class-D speaker driver init; datasheet p. 46 */ + {AIC3X_PAGE_SELECT ,0x0D }, + {0xD ,0x0D }, + {0x8 ,0x5C }, + {0x8 ,0x5D }, + {0x8 ,0x5C }, + {AIC3X_PAGE_SELECT ,0x00 }, +}; +static bool aic3x_volatile_reg (struct device *dev,unsigned int reg) {switch (reg) {
@@ -1393,6 +1403,10 @@ static int aic3x_set_power(struct snd_soc_component *component, int power)gpiod_set_value (aic3x->gpio_reset,0 ); } +if (aic3x->model ==AIC3X_MODEL_3007 ) +regmap_multi_reg_write_bypassed (aic3x->regmap, aic3007_class_d, +ARRAY_SIZE (aic3007_class_d)); +/* Sync reg_cache with the hardware */ regcache_cache_only (aic3x->regmap, false);regcache_sync (aic3x->regmap);
@@ -1723,17 +1737,6 @@ static void aic3x_configure_ocmv(struct device *dev, struct aic3x_priv *aic3x) } } - -static const struct reg_sequence aic3007_class_d[] = { -/* Class-D speaker driver init; datasheet p. 46 */ - {AIC3X_PAGE_SELECT ,0x0D }, - {0xD ,0x0D }, - {0x8 ,0x5C }, - {0x8 ,0x5D }, - {0x8 ,0x5C }, - {AIC3X_PAGE_SELECT ,0x00 }, -}; -int aic3x_probe (struct device *dev,struct regmap *regmap,kernel_ulong_t driver_data) {struct aic3x_priv *aic3x;
@@ -1825,13 +1828,6 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driveraic3x_configure_ocmv (dev, aic3x); -if (aic3x->model ==AIC3X_MODEL_3007 ) { - ret =regmap_register_patch (aic3x->regmap, aic3007_class_d, -ARRAY_SIZE (aic3007_class_d)); -if (ret !=0 ) -dev_err (dev,"Failed to init class D: %d\n" , ret); - } - ret =devm_snd_soc_register_component (dev, &soc_component_dev_aic3x, &aic3x_dai,1 );if (ret)return ret;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 432/565 ACPI: scan: Update honor list for RPMI System MSI
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sunil V L <[email protected]>
[ Upstream commit 4215d1cf59e4b272755f4277a05cd5967935a704 ]
The RPMI System MSI interrupt controller (just like PLIC and APLIC) needs to probed prior to devices like GED which use interrupts provided by it. Also, it has dependency on the SBI MPXY mailbox device.
Add HIDs of RPMI System MSI and SBI MPXY mailbox devices to the honor list so that those dependencies are handled.
--- drivers/acpi/scan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/scan.c +2 -0
@@ -862,6 +862,8 @@ static const char * const acpi_honor_dep_ids[] = {"INTC10CF" ,/* IVSC (MTL) driver must be loaded to allow i2c access to camera sensors */ "RSCV0001" ,/* RISC-V PLIC */ "RSCV0002" ,/* RISC-V APLIC */ +"RSCV0005" ,/* RISC-V SBI MPXY MBOX */ +"RSCV0006" ,/* RISC-V RPMI SYSMSI */ "PNP0C0F" ,/* PCI Link Device */ NULL };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 433/565 vfio/pci: Fix INTx handling on legacy non-PCI 2.3 devices
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timothy Pearson <[email protected]>
[ Upstream commit 8b9f128947dd72e0fcf256088a673abac9b720bf ]
PCI devices prior to PCI 2.3 both use level interrupts and do not support interrupt masking, leading to a failure when passed through to a KVM guest on at least the ppc64 platform. This failure manifests as receiving and acknowledging a single interrupt in the guest, while the device continues to assert the level interrupt indicating a need for further servicing.
When lazy IRQ masking is used on DisINTx- (non-PCI 2.3) hardware, the following sequence occurs:
* Level IRQ assertion on device
* IRQ marked disabled in kernel
* Host interrupt handler exits without clearing the interrupt on the device
* Eventfd is delivered to userspace
* Guest processes IRQ and clears device interrupt
* Device de-asserts INTx, then re-asserts INTx while the interrupt is masked
* Newly asserted interrupt acknowledged by kernel VMM without being handled
* Software mask removed by VFIO driver
* Device INTx still asserted, host controller does not see new edge after EOI
The behavior is now platform-dependent. Some platforms (amd64) will continue to spew IRQs for as long as the INTX line remains asserted, therefore the IRQ will be handled by the host as soon as the mask is dropped. Others (ppc64) will only send the one request, and if it is not handled no further interrupts will be sent. The former behavior theoretically leaves the system vulnerable to interrupt storm, and the latter will result in the device stalling after receiving exactly one interrupt in the guest.
Work around this by disabling lazy IRQ masking for DisINTx- INTx devices.
--- drivers/vfio/pci/vfio_pci_intrs.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/vfio/pci/vfio_pci_intrs.c +7 -0
@@ -304,9 +304,14 @@ static int vfio_intx_enable(struct vfio_pci_core_device *vdev, vdev->irq_type =VFIO_PCI_INTX_IRQ_INDEX ; +if (!vdev->pci_2_3) +irq_set_status_flags (pdev->irq,IRQ_DISABLE_UNLAZY ); + ret =request_irq (pdev->irq, vfio_intx_handler, irqflags, ctx->name, ctx);if (ret) { +if (!vdev->pci_2_3) +irq_clear_status_flags (pdev->irq,IRQ_DISABLE_UNLAZY ); vdev->irq_type =VFIO_PCI_NUM_IRQS ;kfree (name);vfio_irq_ctx_free (vdev, ctx,0 );
@@ -352,6 +357,8 @@ static void vfio_intx_disable(struct vfio_pci_core_device *vdev)vfio_virqfd_disable (&ctx->unmask);vfio_virqfd_disable (&ctx->mask);free_irq (pdev->irq, ctx); +if (!vdev->pci_2_3) +irq_clear_status_flags (pdev->irq,IRQ_DISABLE_UNLAZY );if (ctx->trigger)eventfd_ctx_put (ctx->trigger);kfree (ctx->name);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 434/565 net/mlx5e: Dont query FEC statistics when FEC is disabled
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carolina Jubran <[email protected]>
[ Upstream commit 6b81b8a0b1978284e007566d7a1607b47f92209f ]
Update mlx5e_stats_fec_get() to check the active FEC mode and skip statistics collection when FEC is disabled.
--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +6 -6
@@ -1413,16 +1413,13 @@ static void fec_set_rs_stats(struct ethtool_fec_stats *fec_stats, u32 *ppcnt) }static void fec_set_block_stats (struct mlx5e_priv *priv, +int mode,struct ethtool_fec_stats *fec_stats) {struct mlx5_core_dev *mdev = priv->mdev;u32 out[MLX5_ST_SZ_DW (ppcnt_reg)] = {};u32 in[MLX5_ST_SZ_DW (ppcnt_reg)] = {};int sz =MLX5_ST_SZ_BYTES (ppcnt_reg); -int mode =fec_active_mode (mdev); - -if (mode ==MLX5E_FEC_NOFEC ) -return ;MLX5_SET (ppcnt_reg, in, local_port,1 );MLX5_SET (ppcnt_reg, in, grp,MLX5_PHYSICAL_LAYER_COUNTERS_GROUP );
@@ -1463,11 +1460,14 @@ static void fec_set_corrected_bits_total(struct mlx5e_priv *priv,void mlx5e_stats_fec_get (struct mlx5e_priv *priv,struct ethtool_fec_stats *fec_stats) { -if (!MLX5_CAP_PCAM_FEATURE (priv->mdev, ppcnt_statistical_group)) +int mode =fec_active_mode (priv->mdev); + +if (mode ==MLX5E_FEC_NOFEC || + !MLX5_CAP_PCAM_FEATURE (priv->mdev, ppcnt_statistical_group))return ;fec_set_corrected_bits_total (priv, fec_stats); -fec_set_block_stats (priv, fec_stats); +fec_set_block_stats (priv, mode, fec_stats); }#define PPORT_ETH_EXT_OFF (c) \
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 435/565 net: macb: avoid dealing with endianness in macb_set_hwaddr()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Théo Lebrun <[email protected]>
[ Upstream commit 70a5ce8bc94545ba0fb47b2498bfb12de2132f4d ]
bp->dev->dev_addr is of type unsigned char *. Casting it to a u32 pointer and dereferencing implies dealing manually with endianness, which is error-prone.
Replace by calls to get_unaligned_le32|le16() helpers.
This was found using sparse:
⟩ make C=2 drivers/net/ethernet/cadence/macb_main.o
warning: incorrect type in assignment (different base types)
expected unsigned int [usertype] bottom
got restricted __le32 [usertype]
warning: incorrect type in assignment (different base types)
expected unsigned short [usertype] top
got restricted __le16 [usertype]
...
--- drivers/net/ethernet/cadence/macb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +2 -2
@@ -281,9 +281,9 @@ static void macb_set_hwaddr(struct macb *bp)u32 bottom;u16 top; - bottom =cpu_to_le32 (*((u32 *)bp->dev->dev_addr)); + bottom =get_unaligned_le32 (bp->dev->dev_addr);macb_or_gem_writel (bp,SA1B , bottom); - top =cpu_to_le16 (*((u16 *)(bp->dev->dev_addr +4 ))); + top =get_unaligned_le16 (bp->dev->dev_addr +4 );macb_or_gem_writel (bp,SA1T , top);if (gem_has_ptp (bp)) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 436/565 Bluetooth: btusb: Check for unexpected bytes when defragmenting HCI frames
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arkadiusz Bokowy <[email protected]>
[ Upstream commit 7722d6fb54e428a8f657fccf422095a8d7e2d72c ]
Some Barrot based USB Bluetooth dongles erroneously send one extra random byte for the HCI_OP_READ_LOCAL_EXT_FEATURES command. The consequence of that is that the next HCI transfer is misaligned by one byte causing undefined behavior. In most cases the response event for the next command fails with random error code.
Since the HCI_OP_READ_LOCAL_EXT_FEATURES command is used during HCI controller initialization, the initialization fails rendering the USB dongle not usable.
Quoted 6 lines
[59.464099] usb 1-1.3: new full-speed USB device number 11 using xhci_hcd [59.561617] usb 1-1.3: New USB device found, idVendor=33fa, idProduct=0012, bcdDevice=88.91 [59.561642] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [59.561656] usb 1-1.3: Product: UGREEN BT6.0 Adapter [61.720116] Bluetooth: hci1: command 0x1005 tx timeout [61.720167] Bluetooth: hci1: Opcode 0x1005 failed: -110
This patch was tested with the 33fa:0012 device. The info from the /sys/kernel/debug/usb/devices is shown below:
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#= 12 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=33fa ProdID=0012 Rev=88.91 S: Product=UGREEN BT6.0 Adapter C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
Now the device is initialized properly:
Quoted 7 lines
[43.329852] usb 1-1.4: new full-speed USB device number 4 using dwc_otg [43.446790] usb 1-1.4: New USB device found, idVendor=33fa, idProduct=0012, bcdDevice=88.91 [43.446813] usb 1-1.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [43.446821] usb 1-1.4: Product: UGREEN BT6.0 Adapter [43.582024] Bluetooth: hci1: Unexpected continuation: 1 bytes [43.703025] Bluetooth: hci1: Unexpected continuation: 1 bytes [43.750141] Bluetooth: MGMT ver 1.23
--- drivers/bluetooth/btusb.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/bluetooth/btusb.c +17 -0
@@ -65,6 +65,7 @@ static struct usb_driver btusb_driver;#define BTUSB_INTEL_BROKEN_INITIAL_NCMD BIT(25)#define BTUSB_INTEL_NO_WBS_SUPPORT BIT(26)#define BTUSB_ACTIONS_SEMI BIT(27) +#define BTUSB_BARROT BIT(28)static const struct usb_device_id btusb_table[] = {/* Generic Bluetooth USB device */
@@ -796,6 +797,10 @@ static const struct usb_device_id quirks_table[] = { { USB_DEVICE(0x0cb5, 0xc547), .driver_info = BTUSB_REALTEK | BTUSB_WIDEBAND_SPEECH }, + /* Barrot Technology Bluetooth devices */ + { USB_DEVICE(0x33fa, 0x0010), .driver_info = BTUSB_BARROT }, + { USB_DEVICE(0x33fa, 0x0012), .driver_info = BTUSB_BARROT }, + /* Actions Semiconductor ATS2851 based devices */ { USB_DEVICE(0x10d7, 0xb012), .driver_info = BTUSB_ACTIONS_SEMI },
@@ -1193,6 +1198,18 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count) }if (!hci_skb_expect (skb)) { +/* Each chunk should correspond to at least 1 or more +* events so if there are still bytes left that doesn't +* constitute a new event this is likely a bug in the +* controller. +*/ +if (count && count <HCI_EVENT_HDR_SIZE ) { +bt_dev_warn (data->hdev, +"Unexpected continuation: %d bytes" , + count); + count =0 ; + } +/* Complete frame */ btusb_recv_event (data, skb); skb =NULL ;
Signature · 1 line
2.51.0