diff --git a/app-admin/kernel-tools/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch b/app-admin/kernel-tools/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch index af84fc82342..5e235a114bd 100644 --- a/app-admin/kernel-tools/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch +++ b/app-admin/kernel-tools/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch @@ -1,7 +1,7 @@ -From 824081ce89b55b2fa74a684b48ed5756b6e116de Mon Sep 17 00:00:00 2001 +From 76e2687b779f5ebbb85208f3c6d4ac017032483e Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:28 +0800 -Subject: [PATCH 001/136] UPSTREAM: net: stmmac: Move the atds flag to the +Subject: [PATCH 001/155] UPSTREAM: net: stmmac: Move the atds flag to the stmmac_dma_cfg structure ATDS (Alternate Descriptor Size) is a part of the DMA Bus Mode configs @@ -89,7 +89,7 @@ index b402fb54f613..82957db47c99 100644 /* Enable Application Access by writing to DMA CSR0 */ writel(DMA_BUS_MODE_DEFAULT | (dma_cfg->pbl << DMA_BUS_MODE_PBL_SHIFT), diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -index 84d3a8551b03..e0165358c4ac 100644 +index 071f128aa490..77b35abc6f6f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -153,7 +153,7 @@ static void dwmac410_dma_init_channel(struct stmmac_priv *priv, @@ -129,7 +129,7 @@ index e53c32362774..1c99c99f4627 100644 struct stmmac_dma_cfg *dma_cfg, u32 chan); void (*init_rx_chan)(struct stmmac_priv *priv, void __iomem *ioaddr, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index f3a1b179aaea..9f1286835550 100644 +index afb8a5a079fa..30be8a77de17 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3003,7 +3003,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) diff --git a/app-admin/kernel-tools/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch b/app-admin/kernel-tools/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch index b6c39aa0f9e..27db4bedc31 100644 --- a/app-admin/kernel-tools/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch +++ b/app-admin/kernel-tools/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch @@ -1,7 +1,7 @@ -From a3ddc68c851a794e01c2be4b2b94ff8b54e414c9 Mon Sep 17 00:00:00 2001 +From 92b87b44f271e22cd4e7fcc1e2fd57f4bdf377b8 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:29 +0800 -Subject: [PATCH 002/136] UPSTREAM: net: stmmac: Add multi-channel support +Subject: [PATCH 002/155] UPSTREAM: net: stmmac: Add multi-channel support DW GMAC v3.73 can be equipped with the Audio Video (AV) feature which enables transmission of time-sensitive traffic over bridged local area @@ -311,7 +311,7 @@ index 1c99c99f4627..7e90f34b8c88 100644 u32 chan, bool rx, bool tx); void (*disable_dma_irq)(struct stmmac_priv *priv, void __iomem *ioaddr, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index 9f1286835550..d9fca8d1227c 100644 +index 30be8a77de17..88b3179dac9f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2367,9 +2367,11 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) @@ -338,7 +338,7 @@ index 9f1286835550..d9fca8d1227c 100644 xsk_tx_metadata_to_compl(meta, &tx_q->tx_skbuff_dma[entry].xsk_meta); -@@ -4753,7 +4755,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -4766,7 +4768,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len); @@ -347,7 +347,7 @@ index 9f1286835550..d9fca8d1227c 100644 stmmac_flush_tx_descriptors(priv, queue); stmmac_tx_timer_arm(priv, queue); -@@ -4980,7 +4982,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue, +@@ -4993,7 +4995,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue, u64_stats_update_end(&txq_stats->q_syncp); } diff --git a/app-admin/kernel-tools/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch b/app-admin/kernel-tools/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch index 4eca5bc29ca..f43a13d10d1 100644 --- a/app-admin/kernel-tools/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch +++ b/app-admin/kernel-tools/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch @@ -1,7 +1,7 @@ -From b063435621cbcd3fd51cb25d05106c3380f3433e Mon Sep 17 00:00:00 2001 +From 81aefab4299d0457a4598b48b2084c8544957df6 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:30 +0800 -Subject: [PATCH 003/136] UPSTREAM: net: stmmac: Export dwmac1000_dma_ops +Subject: [PATCH 003/155] UPSTREAM: net: stmmac: Export dwmac1000_dma_ops Export the DW GMAC DMA-ops descriptor so one could be available in the low-level platform drivers. It will be utilized to override some diff --git a/app-admin/kernel-tools/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch b/app-admin/kernel-tools/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch index aa950a7bf62..94f08b7518f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch +++ b/app-admin/kernel-tools/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch @@ -1,7 +1,7 @@ -From acfbae3e8040d845f20cfbbb5b878ff16de72087 Mon Sep 17 00:00:00 2001 +From 2b9847a3d238bcc879be726657d0aebf00e9f2a5 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:07 +0800 -Subject: [PATCH 004/136] UPSTREAM: net: stmmac: dwmac-loongson: Drop +Subject: [PATCH 004/155] UPSTREAM: net: stmmac: dwmac-loongson: Drop duplicated hash-based filter size init The plat_stmmacenet_data::multicast_filter_bins field is twice diff --git a/app-admin/kernel-tools/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch b/app-admin/kernel-tools/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch index f2f85192c5d..e5c02292695 100644 --- a/app-admin/kernel-tools/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch +++ b/app-admin/kernel-tools/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch @@ -1,7 +1,7 @@ -From 2a825df8370cabf00a4144536eb462b26fb9876f Mon Sep 17 00:00:00 2001 +From 1ae366570645f4cfbd7ad578b1f7fe36d5d74409 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:08 +0800 -Subject: [PATCH 005/136] UPSTREAM: net: stmmac: dwmac-loongson: Drop +Subject: [PATCH 005/155] UPSTREAM: net: stmmac: dwmac-loongson: Drop pci_enable/disable_msi calls The Loongson GMAC driver currently doesn't utilize the MSI IRQs, but diff --git a/app-admin/kernel-tools/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch b/app-admin/kernel-tools/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch index 7fdc08d72b5..f16c4f04338 100644 --- a/app-admin/kernel-tools/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch +++ b/app-admin/kernel-tools/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch @@ -1,7 +1,7 @@ -From 2972edf03c4abe5c560473c0c832fd7f41ec1262 Mon Sep 17 00:00:00 2001 +From 3802598ae80709f2c79545831486c9e3dc1644af Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:09 +0800 -Subject: [PATCH 006/136] UPSTREAM: net: stmmac: dwmac-loongson: Use +Subject: [PATCH 006/155] UPSTREAM: net: stmmac: dwmac-loongson: Use PCI_DEVICE_DATA() macro for device identification For the readability sake convert the hard-coded Loongson GMAC PCI ID to diff --git a/app-admin/kernel-tools/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch b/app-admin/kernel-tools/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch index 5048dffc5c8..cc38b47f614 100644 --- a/app-admin/kernel-tools/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch +++ b/app-admin/kernel-tools/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch @@ -1,7 +1,7 @@ -From bed65aa3ed1d69a124b5af977a42b9e8066e45d1 Mon Sep 17 00:00:00 2001 +From 709c822af9036b06d097dce1a9a59004e7af5df7 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:10 +0800 -Subject: [PATCH 007/136] UPSTREAM: net: stmmac: dwmac-loongson: Detach +Subject: [PATCH 007/155] UPSTREAM: net: stmmac: dwmac-loongson: Detach GMAC-specific platform data init Loongson delivers two types of the network devices: Loongson GMAC and diff --git a/app-admin/kernel-tools/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch b/app-admin/kernel-tools/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch index 43fdeed248c..4b237d28d56 100644 --- a/app-admin/kernel-tools/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch +++ b/app-admin/kernel-tools/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch @@ -1,7 +1,7 @@ -From 3f19ec4946927e2b0ad77921281209534a07415e Mon Sep 17 00:00:00 2001 +From 5d200790a06f27176875c105816d75e1d452a35c Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:03 +0800 -Subject: [PATCH 008/136] UPSTREAM: net: stmmac: dwmac-loongson: Add +Subject: [PATCH 008/155] UPSTREAM: net: stmmac: dwmac-loongson: Add phy_interface for Loongson GMAC PHY-interface of the Loongson GMAC device is RGMII with no internal diff --git a/app-admin/kernel-tools/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch b/app-admin/kernel-tools/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch index 9eae8de48bb..2f4a55eef13 100644 --- a/app-admin/kernel-tools/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch +++ b/app-admin/kernel-tools/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch @@ -1,7 +1,7 @@ -From 837b04eda9001da60c9b927489ccb1aebe293ad9 Mon Sep 17 00:00:00 2001 +From 3ac46d4f61ea3d07ed3ece1cfdfbc999ed766f9b Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:04 +0800 -Subject: [PATCH 009/136] UPSTREAM: net: stmmac: dwmac-loongson: Introduce PCI +Subject: [PATCH 009/155] UPSTREAM: net: stmmac: dwmac-loongson: Introduce PCI device info data The Loongson GNET device support is about to be added in one of the diff --git a/app-admin/kernel-tools/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch b/app-admin/kernel-tools/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch index 7535d87caaf..5e5919f568b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch @@ -1,7 +1,7 @@ -From 7ff50f25283d623c55c08f1dbd4309491c225739 Mon Sep 17 00:00:00 2001 +From 32bdd7fb785ab245eadc9c54e10bc5adf1e30996 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:05 +0800 -Subject: [PATCH 010/136] UPSTREAM: net: stmmac: dwmac-loongson: Add DT-less +Subject: [PATCH 010/155] UPSTREAM: net: stmmac: dwmac-loongson: Add DT-less GMAC PCI-device support The Loongson GMAC driver currently supports the network controllers diff --git a/app-admin/kernel-tools/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch b/app-admin/kernel-tools/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch index ba5938f5642..9c7369f51b1 100644 --- a/app-admin/kernel-tools/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch +++ b/app-admin/kernel-tools/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch @@ -1,7 +1,7 @@ -From 10bfd43fd621924c9a08759c56e58ce462773793 Mon Sep 17 00:00:00 2001 +From 73f5fcf08bc05abfc894c63c9dc6324f7934fd41 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:54 +0800 -Subject: [PATCH 011/136] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson +Subject: [PATCH 011/155] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support The Loongson DWMAC driver currently supports the Loongson GMAC diff --git a/app-admin/kernel-tools/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch b/app-admin/kernel-tools/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch index c6dc62b1612..b5c776fb7d4 100644 --- a/app-admin/kernel-tools/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch +++ b/app-admin/kernel-tools/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch @@ -1,7 +1,7 @@ -From 0523fdc1a05f7602537ddd8552b7c1a9082e253c Mon Sep 17 00:00:00 2001 +From 65a9cc808ecb94d584c4a9bbbc2544c135319b8c Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:55 +0800 -Subject: [PATCH 012/136] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson +Subject: [PATCH 012/155] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson GNET support The new generation Loongson LS2K2000 SoC and LS7A2000 chipset are diff --git a/app-admin/kernel-tools/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch b/app-admin/kernel-tools/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch index c54464e247d..f40d820666a 100644 --- a/app-admin/kernel-tools/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch +++ b/app-admin/kernel-tools/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch @@ -1,7 +1,7 @@ -From fbeae8b22826bc0a9e9700ab6a4e56ac5e3f06c2 Mon Sep 17 00:00:00 2001 +From 0ba38e82ad1aa11d6fca0cf2fd3865a36693965d Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:56 +0800 -Subject: [PATCH 013/136] UPSTREAM: net: stmmac: dwmac-loongson: Add loongson +Subject: [PATCH 013/155] UPSTREAM: net: stmmac: dwmac-loongson: Add loongson module author Add Yanteng Si as MODULE_AUTHOR of Loongson DWMAC PCI driver. diff --git a/app-admin/kernel-tools/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch b/app-admin/kernel-tools/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch index 6698bb8054c..6c5990ba991 100644 --- a/app-admin/kernel-tools/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch @@ -1,7 +1,7 @@ -From 025350973de15a7fc9a80fb3a2c94a7f922645e3 Mon Sep 17 00:00:00 2001 +From 3ee7b3657a2f5c109f4be0511b3bd50379de6cf0 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 014/136] UPSTREAM: LoongArch: Revert qspinlock to test-and-set +Subject: [PATCH 014/155] UPSTREAM: LoongArch: Revert qspinlock to test-and-set simple lock on VM Similar with x86, when VM is detected, revert to a simple test-and-set @@ -152,10 +152,10 @@ index 9c9b75b76f62..32537e9b1708 100644 + return 0; +} diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c -index 0f0740f0be27..00e307203ddb 100644 +index d2b18ed23b8a..cbd3c09a93c1 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c -@@ -603,6 +603,8 @@ void __init setup_arch(char **cmdline_p) +@@ -604,6 +604,8 @@ void __init setup_arch(char **cmdline_p) arch_mem_init(cmdline_p); resource_init(); diff --git a/app-admin/kernel-tools/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch b/app-admin/kernel-tools/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch index 5c08406b1c1..26032224ae6 100644 --- a/app-admin/kernel-tools/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch +++ b/app-admin/kernel-tools/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch @@ -1,7 +1,7 @@ -From 8ecfb0ed873e7f63821a1e2cb851bef09f194eb3 Mon Sep 17 00:00:00 2001 +From feca8b81dd1aff2256c79806170645767d6ffd00 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 015/136] UPSTREAM: LoongArch: KVM: Add VM feature detection +Subject: [PATCH 015/155] UPSTREAM: LoongArch: KVM: Add VM feature detection function Loongson SIMD Extension (LSX), Loongson Advanced SIMD Extension (LASX) diff --git a/app-admin/kernel-tools/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch b/app-admin/kernel-tools/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch index 1a596f63321..ee35d1a195f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch +++ b/app-admin/kernel-tools/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch @@ -1,7 +1,7 @@ -From f3b96d3c5e3f71381bb0742e97051ba23c740fe2 Mon Sep 17 00:00:00 2001 +From ec0f45f6d968cff7e922c6f658d56b160e83d279 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 016/136] UPSTREAM: LoongArch: KVM: Add Binary Translation +Subject: [PATCH 016/155] UPSTREAM: LoongArch: KVM: Add Binary Translation extension support Loongson Binary Translation (LBT) is used to accelerate binary translation, diff --git a/app-admin/kernel-tools/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch b/app-admin/kernel-tools/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch index f16889495b0..b95ef018e5b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch @@ -1,7 +1,7 @@ -From d8fa5c6421c4f8e54b5de1303cd7ad1ef9ea4eb1 Mon Sep 17 00:00:00 2001 +From c579334ba8b90ee281fc9e0c1b9d63e8a72e4ac9 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 017/136] UPSTREAM: LoongArch: KVM: Add vm migration support +Subject: [PATCH 017/155] UPSTREAM: LoongArch: KVM: Add vm migration support for LBT registers Every vcpu has separate LBT registers. And there are four scr registers, diff --git a/app-admin/kernel-tools/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch b/app-admin/kernel-tools/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch index 5290f686eaa..8018537ce41 100644 --- a/app-admin/kernel-tools/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch +++ b/app-admin/kernel-tools/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch @@ -1,7 +1,7 @@ -From 0307a7c039a1b592c86d821e826bdcfdfa37fdf1 Mon Sep 17 00:00:00 2001 +From 634a3f39e68c154b8c2016744e73876b1be78dab Mon Sep 17 00:00:00 2001 From: Song Gao Date: Thu, 12 Sep 2024 20:53:40 +0800 -Subject: [PATCH 018/136] UPSTREAM: LoongArch: KVM: Add PMU support for guest +Subject: [PATCH 018/155] UPSTREAM: LoongArch: KVM: Add PMU support for guest On LoongArch, the host and guest have their own PMU CSRs registers and they share PMU hardware resources. A set of PMU CSRs consists of a CTRL diff --git a/app-admin/kernel-tools/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch b/app-admin/kernel-tools/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch index ad708243f08..7ea97743a2f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch +++ b/app-admin/kernel-tools/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch @@ -1,7 +1,7 @@ -From 1117b27df87b113630ea116412e65d35483c7ce6 Mon Sep 17 00:00:00 2001 +From f8b4f3474d5d50c87cdbb283512b5ec34247084a Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Thu, 12 Sep 2024 20:53:40 +0800 -Subject: [PATCH 019/136] UPSTREAM: LoongArch: KVM: Enable paravirt feature +Subject: [PATCH 019/155] UPSTREAM: LoongArch: KVM: Enable paravirt feature control from VMM Export kernel paravirt features to user space, so that VMM can control diff --git a/app-admin/kernel-tools/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch b/app-admin/kernel-tools/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch index cbc41f19171..bf3e9663810 100644 --- a/app-admin/kernel-tools/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch +++ b/app-admin/kernel-tools/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch @@ -1,7 +1,7 @@ -From ae4dbaaed98b3e1e556e0efdaedb8de3a8377caf Mon Sep 17 00:00:00 2001 +From ae058ae99b29a9d20b2d61ea5c41bcedfe8aeefd Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Thu, 12 Sep 2024 22:56:14 +0800 -Subject: [PATCH 020/136] UPSTREAM: LoongArch: KVM: Implement function +Subject: [PATCH 020/155] UPSTREAM: LoongArch: KVM: Implement function kvm_para_has_feature() Implement function kvm_para_has_feature() to detect supported paravirt diff --git a/app-admin/kernel-tools/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch b/app-admin/kernel-tools/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch index 8b2388dd9f7..14f78042370 100644 --- a/app-admin/kernel-tools/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch +++ b/app-admin/kernel-tools/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch @@ -1,7 +1,7 @@ -From 12456a0fce5003a3419a8a1a1cdb7a8a8cd92cc3 Mon Sep 17 00:00:00 2001 +From e6b7c487ecdfd3f6fbfdfd39864474221cb3828e Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 28 Aug 2024 12:59:50 +0800 -Subject: [PATCH 021/136] UPSTREAM: Loongarch: KVM: Add KVM hypercalls +Subject: [PATCH 021/155] UPSTREAM: Loongarch: KVM: Add KVM hypercalls documentation for LoongArch Add documentation topic for using pv_virt when running as a guest diff --git a/app-admin/kernel-tools/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch b/app-admin/kernel-tools/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch index 1e96ef2f243..b29be571855 100644 --- a/app-admin/kernel-tools/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch +++ b/app-admin/kernel-tools/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch @@ -1,7 +1,7 @@ -From 0f0e513a112262e0bd064c00afca2f39906b00c8 Mon Sep 17 00:00:00 2001 +From 413c6aba0ff447490bb63a1af69bde1175543a4d Mon Sep 17 00:00:00 2001 From: WangYuli Date: Fri, 6 Sep 2024 13:40:08 +0800 -Subject: [PATCH 022/136] UPSTREAM: treewide: correct the typo 'retun' +Subject: [PATCH 022/155] UPSTREAM: treewide: correct the typo 'retun' There are some spelling mistakes of 'retun' in comments which should be instead of 'return'. diff --git a/app-admin/kernel-tools/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch b/app-admin/kernel-tools/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch index 06a8722ea96..734950e1366 100644 --- a/app-admin/kernel-tools/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch +++ b/app-admin/kernel-tools/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch @@ -1,7 +1,7 @@ -From 3974fe82e4a5b23fb716ec7f8667f87f46ce4476 Mon Sep 17 00:00:00 2001 +From 83ac05a24d3ff53d5f68debf8e4e27aad06b3efd Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:14:58 +0800 -Subject: [PATCH 023/136] UPSTREAM: cpu/hotplug: Make HOTPLUG_PARALLEL +Subject: [PATCH 023/155] UPSTREAM: cpu/hotplug: Make HOTPLUG_PARALLEL independent of HOTPLUG_SMT Provide stub functions for SMT related parallel bring up functions so that diff --git a/app-admin/kernel-tools/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch b/app-admin/kernel-tools/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch index 50b3b16fba1..3ec9ccc3311 100644 --- a/app-admin/kernel-tools/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch +++ b/app-admin/kernel-tools/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch @@ -1,7 +1,7 @@ -From 70cbe440cfa89e8d2a808f6d3ef9ba64d19d0a4c Mon Sep 17 00:00:00 2001 +From bb5e4c46110fb9b0918c2f09feff906089a2e925 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:14:59 +0800 -Subject: [PATCH 024/136] UPSTREAM: cpu/hotplug: Provide weak fallback for +Subject: [PATCH 024/155] UPSTREAM: cpu/hotplug: Provide weak fallback for arch_cpuhp_init_parallel_bringup() CONFIG_HOTPLUG_PARALLEL expects the architecture to implement diff --git a/app-admin/kernel-tools/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch b/app-admin/kernel-tools/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch index 1ff345dabd6..74d2675b42c 100644 --- a/app-admin/kernel-tools/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch +++ b/app-admin/kernel-tools/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch @@ -1,7 +1,7 @@ -From d20aa9fbb304be006b0dcee8f696a89477ed1286 Mon Sep 17 00:00:00 2001 +From 7c75261d52ebb3b2d6953044d43b73cc4bb8a320 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 15 Aug 2024 19:26:07 +0800 -Subject: [PATCH 025/136] UPSTREAM: irqchip/loongson-pch-msi: Switch to MSI +Subject: [PATCH 025/155] UPSTREAM: irqchip/loongson-pch-msi: Switch to MSI parent domains Remove the global PCI/MSI irqdomain implementation and provide the diff --git a/app-admin/kernel-tools/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch b/app-admin/kernel-tools/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch index 70c3c2e5e84..447695ae162 100644 --- a/app-admin/kernel-tools/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch @@ -1,7 +1,7 @@ -From f2de3afd71ee070a715f1ec6d1b68bf1f1801ab6 Mon Sep 17 00:00:00 2001 +From 842740dc2455e4cd2f55d357d73732f8de0cfadf Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:32 +0800 -Subject: [PATCH 026/136] BACKPORT: LoongArch: Move irqchip function prototypes +Subject: [PATCH 026/155] BACKPORT: LoongArch: Move irqchip function prototypes to irq-loongson.h Some irqchip functions are only for internal use by irqchip drivers, so diff --git a/app-admin/kernel-tools/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch b/app-admin/kernel-tools/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch index 275a297060d..dd6dcfc0453 100644 --- a/app-admin/kernel-tools/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch +++ b/app-admin/kernel-tools/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch @@ -1,7 +1,7 @@ -From 75a67da700ae2c22ec269ebc04579bd434c39c9c Mon Sep 17 00:00:00 2001 +From 800fc7e94a6beb024f8104b7ec7cd9830aa8ab2b Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:33 +0800 -Subject: [PATCH 027/136] UPSTREAM: LoongArch: Architectural preparation for +Subject: [PATCH 027/155] UPSTREAM: LoongArch: Architectural preparation for AVEC irqchip Add architectural preparation for AVEC irqchip, including: diff --git a/app-admin/kernel-tools/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch b/app-admin/kernel-tools/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch index b92cb1d2137..f0792921e98 100644 --- a/app-admin/kernel-tools/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch +++ b/app-admin/kernel-tools/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch @@ -1,7 +1,7 @@ -From b29f8e81123a9f20affb08a8a291bd95f379f8b4 Mon Sep 17 00:00:00 2001 +From 71f3c56d8baa6ef31976f2fb83dcd0e9981d2b61 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:34 +0800 -Subject: [PATCH 028/136] BACKPORT: irqchip/loongson-eiointc: Rename +Subject: [PATCH 028/155] BACKPORT: irqchip/loongson-eiointc: Rename CPUHP_AP_IRQ_LOONGARCH_STARTING Rename CPUHP_AP_IRQ_LOONGARCH_STARTING to CPUHP_AP_IRQ_EIOINTC_STARTING diff --git a/app-admin/kernel-tools/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch b/app-admin/kernel-tools/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch index 365fb5ce752..ee114138a49 100644 --- a/app-admin/kernel-tools/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch +++ b/app-admin/kernel-tools/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch @@ -1,7 +1,7 @@ -From 43f19a98cf6f1c2484d0d8d4231ae3147d0152d2 Mon Sep 17 00:00:00 2001 +From d066042c8e3e2824f7183c0fb2f79d89f27f0dc1 Mon Sep 17 00:00:00 2001 From: Tianyang Zhang Date: Fri, 23 Aug 2024 18:43:36 +0800 -Subject: [PATCH 029/136] UPSTREAM: irqchip/loongson-pch-msi: Prepare +Subject: [PATCH 029/155] UPSTREAM: irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC On Loongson-3C6000 and higher systems with AVECINTC irqchip, there may diff --git a/app-admin/kernel-tools/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch b/app-admin/kernel-tools/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch index 298263641cc..c9afd4c7d38 100644 --- a/app-admin/kernel-tools/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch +++ b/app-admin/kernel-tools/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch @@ -1,7 +1,7 @@ -From b4fc62f13499fe67189ad012978a956fa5e9d827 Mon Sep 17 00:00:00 2001 +From 91cdedc38ced7e43c2c9d61ddcf2fc09df570ae1 Mon Sep 17 00:00:00 2001 From: Tianyang Zhang Date: Fri, 23 Aug 2024 18:43:37 +0800 -Subject: [PATCH 030/136] BACKPORT: irqchip/loongarch-avec: Add AVEC irqchip +Subject: [PATCH 030/155] BACKPORT: irqchip/loongarch-avec: Add AVEC irqchip support Introduce the advanced extended interrupt controllers (AVECINTC). This diff --git a/app-admin/kernel-tools/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch b/app-admin/kernel-tools/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch index 9da994ac454..3851a5acffb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch +++ b/app-admin/kernel-tools/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch @@ -1,7 +1,7 @@ -From 425fd551f56889f6dbdd37a21fce7a4600f5af65 Mon Sep 17 00:00:00 2001 +From 6ea5941aa5a3c50a4340ba975c2850d3fd8ab714 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 26 Jul 2024 17:29:11 +0800 -Subject: [PATCH 031/136] UPSTREAM: PCI/ACPI: Increase Loongson max PCI hosts +Subject: [PATCH 031/155] UPSTREAM: PCI/ACPI: Increase Loongson max PCI hosts to 8 Beginning with Loongson-3C6000, there can be up to 8 PCI hosts for diff --git a/app-admin/kernel-tools/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch b/app-admin/kernel-tools/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch index 50a28fa7e28..13a954c78ea 100644 --- a/app-admin/kernel-tools/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch +++ b/app-admin/kernel-tools/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch @@ -1,7 +1,7 @@ -From d0ca13875fa8888a3164c97b5206ec6338136382 Mon Sep 17 00:00:00 2001 +From 7ccc2cfd670d7a6bfdde0e375c5a4c6c6ff99f00 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:09 +0800 -Subject: [PATCH 032/136] UPSTREAM: LoongArch: Enable objtool for Clang +Subject: [PATCH 032/155] UPSTREAM: LoongArch: Enable objtool for Clang For now, it can enable objtool for Clang, just remove !CC_IS_CLANG for HAVE_OBJTOOL in arch/loongarch/Kconfig. diff --git a/app-admin/kernel-tools/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch b/app-admin/kernel-tools/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch index ad07d50aaa1..89aa6aee79d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch +++ b/app-admin/kernel-tools/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch @@ -1,7 +1,7 @@ -From ebdb5e55c7e3f34de6371e3e6de0a8ab5f69a0b0 Mon Sep 17 00:00:00 2001 +From fcf4b8f8bef80d99a22e2a75f74934b096ad055b Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:09 +0800 -Subject: [PATCH 033/136] UPSTREAM: LoongArch: Set AS_HAS_THIN_ADD_SUB as y if +Subject: [PATCH 033/155] UPSTREAM: LoongArch: Set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM When building kernel with "make CC=clang defconfig", LLVM Assembler is diff --git a/app-admin/kernel-tools/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch b/app-admin/kernel-tools/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch index 1755bfc5202..8cf1da21c3b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch +++ b/app-admin/kernel-tools/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch @@ -1,7 +1,7 @@ -From 822615a367b1e984ac1df11b58ddc6d0934f78fc Mon Sep 17 00:00:00 2001 +From 8f44292b0ca056712073476c56950c02533e45a8 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:10 +0800 -Subject: [PATCH 034/136] UPSTREAM: LoongArch: Remove +Subject: [PATCH 034/155] UPSTREAM: LoongArch: Remove STACK_FRAME_NON_STANDARD(do_syscall) For now, we can remove STACK_FRAME_NON_STANDARD(do_syscall) because diff --git a/app-admin/kernel-tools/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch b/app-admin/kernel-tools/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch index 8d9fd069967..ff2972b5b3d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch +++ b/app-admin/kernel-tools/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch @@ -1,7 +1,7 @@ -From 5af75d679df39f1d4aa451beaab7530c50725519 Mon Sep 17 00:00:00 2001 +From 4a99dc573243342878119ddcc1bdbd5dedf45578 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 24 Sep 2024 15:31:51 +0800 -Subject: [PATCH 035/136] UPSTREAM: LoongArch: Enable generic CPU +Subject: [PATCH 035/155] UPSTREAM: LoongArch: Enable generic CPU vulnerabilites support Currently, many architectures support generic CPU vulnerabilites, such diff --git a/app-admin/kernel-tools/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch b/app-admin/kernel-tools/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch index 5e91743cfd6..830faae03ca 100644 --- a/app-admin/kernel-tools/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch +++ b/app-admin/kernel-tools/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch @@ -1,7 +1,7 @@ -From 99884d8639f02f8ca93b44bf9b3ee259c791fb8c Mon Sep 17 00:00:00 2001 +From 883fba49772e9f267fcd2eba09e5f12ab96ced54 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Tue, 24 Sep 2024 15:32:06 +0800 -Subject: [PATCH 036/136] UPSTREAM: LoongArch: Enable ACPI BGRT handling +Subject: [PATCH 036/155] UPSTREAM: LoongArch: Enable ACPI BGRT handling Add ACPI BGRT support on LoongArch so it can display image provied by acpi table at boot stage and switch to graphical UI smoothly. diff --git a/app-admin/kernel-tools/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch b/app-admin/kernel-tools/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch index 95ec0a0ebcf..1fcbfa732a7 100644 --- a/app-admin/kernel-tools/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch +++ b/app-admin/kernel-tools/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch @@ -1,7 +1,7 @@ -From ee29bf2de186a3854d5eac49a07d72c9d2e1d2ae Mon Sep 17 00:00:00 2001 +From 976c7ece32787ec8fa7d67ee99ea511ad05dde5c Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 037/136] UPSTREAM: LoongArch: Rework CPU feature probe from +Subject: [PATCH 037/155] UPSTREAM: LoongArch: Rework CPU feature probe from CPUCFG/IOCSR Probe ISA level, TLB, IOCSR information from CPUCFG to improve kernel diff --git a/app-admin/kernel-tools/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch b/app-admin/kernel-tools/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch index 3a6dc160ced..0fd4d1a588e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch +++ b/app-admin/kernel-tools/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch @@ -1,7 +1,7 @@ -From e64d54f3ca663a517a126412fc270fd5ab906e05 Mon Sep 17 00:00:00 2001 +From 06ab0dfff28566fb22c365f729d3670c65f33358 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 038/136] UPSTREAM: LoongArch: Add ARCH_HAS_SET_MEMORY support +Subject: [PATCH 038/155] UPSTREAM: LoongArch: Add ARCH_HAS_SET_MEMORY support Add set_memory_ro/rw/x/nx architecture hooks to change the page attribution. diff --git a/app-admin/kernel-tools/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch b/app-admin/kernel-tools/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch index ee6799d9362..edf13a0f3fd 100644 --- a/app-admin/kernel-tools/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch +++ b/app-admin/kernel-tools/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch @@ -1,7 +1,7 @@ -From a8412b2dc4f5c8f2c77aeb90b37aca5fbba69f31 Mon Sep 17 00:00:00 2001 +From 4547bfbd072abe2f27f48e04496f369d74c1291d Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 039/136] UPSTREAM: LoongArch: Add ARCH_HAS_SET_DIRECT_MAP +Subject: [PATCH 039/155] UPSTREAM: LoongArch: Add ARCH_HAS_SET_DIRECT_MAP support Add set_direct_map_*() functions for setting the direct map alias for diff --git a/app-admin/kernel-tools/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch b/app-admin/kernel-tools/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch index a59e0883bd9..549ee6d7e5c 100644 --- a/app-admin/kernel-tools/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch +++ b/app-admin/kernel-tools/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch @@ -1,7 +1,7 @@ -From 5cf3791859bb121bbcb7c19b112bcf5db0ba6a31 Mon Sep 17 00:00:00 2001 +From a2212ed94d984824c266b21974f405b164e89a2c Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 040/136] UPSTREAM: LoongArch: Improve hardware page table +Subject: [PATCH 040/155] UPSTREAM: LoongArch: Improve hardware page table walker LoongArch has similar problems explained in commit 7f0b1bf04511348995d6 diff --git a/app-admin/kernel-tools/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch b/app-admin/kernel-tools/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch index 0c726b60b30..aa6a1afc956 100644 --- a/app-admin/kernel-tools/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch +++ b/app-admin/kernel-tools/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch @@ -1,7 +1,7 @@ -From c4b1b257299f8e7d318bae18b38ff965b06de80d Mon Sep 17 00:00:00 2001 +From 6cf36786cff27ee3e7fccf4dbd12e72259902fd1 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 041/136] UPSTREAM: LoongArch: Simplify _percpu_read() and +Subject: [PATCH 041/155] UPSTREAM: LoongArch: Simplify _percpu_read() and _percpu_write() Now _percpu_read() and _percpu_write() macros call __percpu_read() diff --git a/app-admin/kernel-tools/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch b/app-admin/kernel-tools/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch index 059bcbc885c..6f7dc17bd91 100644 --- a/app-admin/kernel-tools/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch +++ b/app-admin/kernel-tools/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch @@ -1,7 +1,7 @@ -From abf6aabc0b833f2f947190fd1ec8ca5991c8af99 Mon Sep 17 00:00:00 2001 +From dddbdfecadc04b1c97bc8f00d36e615fd76a3587 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 042/136] UPSTREAM: LoongArch: Remove posix_types.h include +Subject: [PATCH 042/155] UPSTREAM: LoongArch: Remove posix_types.h include from sigcontext.h Nothing in sigcontext.h seems to require anything from diff --git a/app-admin/kernel-tools/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch b/app-admin/kernel-tools/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch index 234643e4bac..4afaa6e0a57 100644 --- a/app-admin/kernel-tools/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch +++ b/app-admin/kernel-tools/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch @@ -1,7 +1,7 @@ -From 414d3e48bd9bb22c40be57157f61f0bbe3296b24 Mon Sep 17 00:00:00 2001 +From b2b9fad21e0dbce8aed3f3cccddee1fb52647848 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 17 Sep 2024 22:23:22 +0800 -Subject: [PATCH 043/136] UPSTREAM: Docs/LoongArch: Add advanced extended IRQ +Subject: [PATCH 043/155] UPSTREAM: Docs/LoongArch: Add advanced extended IRQ model description Introduce the advanced extended interrupt controllers (AVECINTC). This diff --git a/app-admin/kernel-tools/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch b/app-admin/kernel-tools/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch new file mode 100644 index 00000000000..9ecd7c7db7e --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch @@ -0,0 +1,327 @@ +From 83387410868a7ea7c626845fbcc0e8c2c0816c64 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sun, 11 Aug 2024 02:14:41 +0200 +Subject: [PATCH 044/155] UPSTREAM: hwmon: Add thermal sensor driver for + Surface Aggregator Module + +Some of the newer Microsoft Surface devices (such as the Surface Book +3 and Pro 9) have thermal sensors connected via the Surface Aggregator +Module (the embedded controller on those devices). Add a basic driver +to read out the temperature values of those sensors. + +The EC can have up to 16 thermal sensors connected via a single +sub-device, each providing temperature readings and a label string. + +Link: https://github.com/linux-surface/surface-aggregator-module/issues/59 +Reviewed-by: Hans de Goede +Co-developed-by: Ivor Wanders +Signed-off-by: Ivor Wanders +Signed-off-by: Maximilian Luz +Message-ID: <20240811001503.753728-1-luzmaximilian@gmail.com> +Signed-off-by: Guenter Roeck + +(cherry picked from commit 63be321e5a096746b396fc43c7d25135a61617c9) +Signed-off-by: Kexy Biscuit +--- + MAINTAINERS | 6 + + drivers/hwmon/Kconfig | 11 ++ + drivers/hwmon/Makefile | 1 + + drivers/hwmon/surface_temp.c | 235 +++++++++++++++++++++++++++++++++++ + 4 files changed, 253 insertions(+) + create mode 100644 drivers/hwmon/surface_temp.c + +diff --git a/MAINTAINERS b/MAINTAINERS +index 53629156e327..73ebd630afe7 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -15219,6 +15219,12 @@ S: Maintained + F: Documentation/hwmon/surface_fan.rst + F: drivers/hwmon/surface_fan.c + ++MICROSOFT SURFACE SENSOR THERMAL DRIVER ++M: Maximilian Luz ++L: linux-hwmon@vger.kernel.org ++S: Maintained ++F: drivers/hwmon/surface_temp.c ++ + MICROSOFT SURFACE GPE LID SUPPORT DRIVER + M: Maximilian Luz + L: platform-driver-x86@vger.kernel.org +diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig +index 778e584c3a75..6b0f71c059ab 100644 +--- a/drivers/hwmon/Kconfig ++++ b/drivers/hwmon/Kconfig +@@ -2084,6 +2084,17 @@ config SENSORS_SURFACE_FAN + + Select M or Y here, if you want to be able to read the fan's speed. + ++config SENSORS_SURFACE_TEMP ++ tristate "Microsoft Surface Thermal Sensor Driver" ++ depends on SURFACE_AGGREGATOR ++ depends on SURFACE_AGGREGATOR_BUS ++ help ++ Driver for monitoring thermal sensors connected via the Surface ++ Aggregator Module (embedded controller) on Microsoft Surface devices. ++ ++ This driver can also be built as a module. If so, the module ++ will be called surface_temp. ++ + config SENSORS_ADC128D818 + tristate "Texas Instruments ADC128D818" + depends on I2C +diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile +index b1c7056c37db..3ce8d6a9202e 100644 +--- a/drivers/hwmon/Makefile ++++ b/drivers/hwmon/Makefile +@@ -209,6 +209,7 @@ obj-$(CONFIG_SENSORS_SPARX5) += sparx5-temp.o + obj-$(CONFIG_SENSORS_SPD5118) += spd5118.o + obj-$(CONFIG_SENSORS_STTS751) += stts751.o + obj-$(CONFIG_SENSORS_SURFACE_FAN)+= surface_fan.o ++obj-$(CONFIG_SENSORS_SURFACE_TEMP)+= surface_temp.o + obj-$(CONFIG_SENSORS_SY7636A) += sy7636a-hwmon.o + obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o + obj-$(CONFIG_SENSORS_TC74) += tc74.o +diff --git a/drivers/hwmon/surface_temp.c b/drivers/hwmon/surface_temp.c +new file mode 100644 +index 000000000000..cd21f331f157 +--- /dev/null ++++ b/drivers/hwmon/surface_temp.c +@@ -0,0 +1,235 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Thermal sensor subsystem driver for Surface System Aggregator Module (SSAM). ++ * ++ * Copyright (C) 2022-2023 Maximilian Luz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++/* -- SAM interface. -------------------------------------------------------- */ ++ ++/* ++ * Available sensors are indicated by a 16-bit bitfield, where a 1 marks the ++ * presence of a sensor. So we have at most 16 possible sensors/channels. ++ */ ++#define SSAM_TMP_SENSOR_MAX_COUNT 16 ++ ++/* ++ * All names observed so far are 6 characters long, but there's only ++ * zeros after the name, so perhaps they can be longer. This number reflects ++ * the maximum zero-padded space observed in the returned buffer. ++ */ ++#define SSAM_TMP_SENSOR_NAME_LENGTH 18 ++ ++struct ssam_tmp_get_name_rsp { ++ __le16 unknown1; ++ char unknown2; ++ char name[SSAM_TMP_SENSOR_NAME_LENGTH]; ++} __packed; ++ ++static_assert(sizeof(struct ssam_tmp_get_name_rsp) == 21); ++ ++SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_tmp_get_available_sensors, __le16, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x04, ++}); ++ ++SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_temperature, __le16, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x01, ++}); ++ ++SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_name, struct ssam_tmp_get_name_rsp, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x0e, ++}); ++ ++static int ssam_tmp_get_available_sensors(struct ssam_device *sdev, s16 *sensors) ++{ ++ __le16 sensors_le; ++ int status; ++ ++ status = __ssam_tmp_get_available_sensors(sdev, &sensors_le); ++ if (status) ++ return status; ++ ++ *sensors = le16_to_cpu(sensors_le); ++ return 0; ++} ++ ++static int ssam_tmp_get_temperature(struct ssam_device *sdev, u8 iid, long *temperature) ++{ ++ __le16 temp_le; ++ int status; ++ ++ status = __ssam_tmp_get_temperature(sdev->ctrl, sdev->uid.target, iid, &temp_le); ++ if (status) ++ return status; ++ ++ /* Convert 1/10 °K to 1/1000 °C */ ++ *temperature = (le16_to_cpu(temp_le) - 2731) * 100L; ++ return 0; ++} ++ ++static int ssam_tmp_get_name(struct ssam_device *sdev, u8 iid, char *buf, size_t buf_len) ++{ ++ struct ssam_tmp_get_name_rsp name_rsp; ++ int status; ++ ++ status = __ssam_tmp_get_name(sdev->ctrl, sdev->uid.target, iid, &name_rsp); ++ if (status) ++ return status; ++ ++ /* ++ * This should not fail unless the name in the returned struct is not ++ * null-terminated or someone changed something in the struct ++ * definitions above, since our buffer and struct have the same ++ * capacity by design. So if this fails, log an error message. Since ++ * the more likely cause is that the returned string isn't ++ * null-terminated, we might have received garbage (as opposed to just ++ * an incomplete string), so also fail the function. ++ */ ++ status = strscpy(buf, name_rsp.name, buf_len); ++ if (status < 0) { ++ dev_err(&sdev->dev, "received non-null-terminated sensor name string\n"); ++ return status; ++ } ++ ++ return 0; ++} ++ ++/* -- Driver.---------------------------------------------------------------- */ ++ ++struct ssam_temp { ++ struct ssam_device *sdev; ++ s16 sensors; ++ char names[SSAM_TMP_SENSOR_MAX_COUNT][SSAM_TMP_SENSOR_NAME_LENGTH]; ++}; ++ ++static umode_t ssam_temp_hwmon_is_visible(const void *data, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel) ++{ ++ const struct ssam_temp *ssam_temp = data; ++ ++ if (!(ssam_temp->sensors & BIT(channel))) ++ return 0; ++ ++ return 0444; ++} ++ ++static int ssam_temp_hwmon_read(struct device *dev, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel, long *value) ++{ ++ const struct ssam_temp *ssam_temp = dev_get_drvdata(dev); ++ ++ return ssam_tmp_get_temperature(ssam_temp->sdev, channel + 1, value); ++} ++ ++static int ssam_temp_hwmon_read_string(struct device *dev, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel, const char **str) ++{ ++ const struct ssam_temp *ssam_temp = dev_get_drvdata(dev); ++ ++ *str = ssam_temp->names[channel]; ++ return 0; ++} ++ ++static const struct hwmon_channel_info * const ssam_temp_hwmon_info[] = { ++ HWMON_CHANNEL_INFO(chip, ++ HWMON_C_REGISTER_TZ), ++ HWMON_CHANNEL_INFO(temp, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL), ++ NULL ++}; ++ ++static const struct hwmon_ops ssam_temp_hwmon_ops = { ++ .is_visible = ssam_temp_hwmon_is_visible, ++ .read = ssam_temp_hwmon_read, ++ .read_string = ssam_temp_hwmon_read_string, ++}; ++ ++static const struct hwmon_chip_info ssam_temp_hwmon_chip_info = { ++ .ops = &ssam_temp_hwmon_ops, ++ .info = ssam_temp_hwmon_info, ++}; ++ ++static int ssam_temp_probe(struct ssam_device *sdev) ++{ ++ struct ssam_temp *ssam_temp; ++ struct device *hwmon_dev; ++ s16 sensors; ++ int channel; ++ int status; ++ ++ status = ssam_tmp_get_available_sensors(sdev, &sensors); ++ if (status) ++ return status; ++ ++ ssam_temp = devm_kzalloc(&sdev->dev, sizeof(*ssam_temp), GFP_KERNEL); ++ if (!ssam_temp) ++ return -ENOMEM; ++ ++ ssam_temp->sdev = sdev; ++ ssam_temp->sensors = sensors; ++ ++ /* Retrieve the name for each available sensor. */ ++ for (channel = 0; channel < SSAM_TMP_SENSOR_MAX_COUNT; channel++) { ++ if (!(sensors & BIT(channel))) ++ continue; ++ ++ status = ssam_tmp_get_name(sdev, channel + 1, ssam_temp->names[channel], ++ SSAM_TMP_SENSOR_NAME_LENGTH); ++ if (status) ++ return status; ++ } ++ ++ hwmon_dev = devm_hwmon_device_register_with_info(&sdev->dev, "surface_thermal", ssam_temp, ++ &ssam_temp_hwmon_chip_info, NULL); ++ return PTR_ERR_OR_ZERO(hwmon_dev); ++} ++ ++static const struct ssam_device_id ssam_temp_match[] = { ++ { SSAM_SDEV(TMP, SAM, 0x00, 0x02) }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(ssam, ssam_temp_match); ++ ++static struct ssam_device_driver ssam_temp = { ++ .probe = ssam_temp_probe, ++ .match_table = ssam_temp_match, ++ .driver = { ++ .name = "surface_temp", ++ .probe_type = PROBE_PREFER_ASYNCHRONOUS, ++ }, ++}; ++module_ssam_device_driver(ssam_temp); ++ ++MODULE_AUTHOR("Maximilian Luz "); ++MODULE_DESCRIPTION("Thermal sensor subsystem driver for Surface System Aggregator Module"); ++MODULE_LICENSE("GPL"); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch b/app-admin/kernel-tools/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch rename to app-admin/kernel-tools/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch index c85c8d16948..9539622b1a3 100644 --- a/app-admin/kernel-tools/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch +++ b/app-admin/kernel-tools/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch @@ -1,7 +1,7 @@ -From 5f6a7a8d85f41687a3776c8616b2b39807fc07e0 Mon Sep 17 00:00:00 2001 +From 685bd4efc58907e746f4d080b026f9034ae7d41f Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 14 Jul 2022 16:41:36 +0800 -Subject: [PATCH 044/136] FROMLIST: SH: cpuinfo: Fix a warning for +Subject: [PATCH 045/155] FROMLIST: SH: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, diff --git a/app-admin/kernel-tools/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch b/app-admin/kernel-tools/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch similarity index 92% rename from app-admin/kernel-tools/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch rename to app-admin/kernel-tools/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch index 4bce9effc34..84be4b4df05 100644 --- a/app-admin/kernel-tools/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch +++ b/app-admin/kernel-tools/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch @@ -1,7 +1,7 @@ -From 841d9414beb8c76c1ce38c93a32fc7acfd33a8b6 Mon Sep 17 00:00:00 2001 +From 2052836c69ffd04a9ed5701a241c1b628b814244 Mon Sep 17 00:00:00 2001 From: Hunter Laux Date: Wed, 6 Apr 2016 00:54:05 -0700 -Subject: [PATCH 045/136] BACKPORT: FROMLIST: usb: phy: tegra: Add 38.4MHz +Subject: [PATCH 046/155] BACKPORT: FROMLIST: usb: phy: tegra: Add 38.4MHz clock table entry The Tegra210 uses a 38.4MHz OSC. This clock table entry is required to diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch b/app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch rename to app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch index dd7de2bda34..cfadf420b7b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch +++ b/app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch @@ -1,7 +1,7 @@ -From d9214bf02249453c8a61cc8f9b5f07c3a3f4a9bf Mon Sep 17 00:00:00 2001 +From 059933138e027c69ffec1751ea54ed92c163008c Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Thu, 10 Oct 2024 16:30:25 +0800 -Subject: [PATCH 046/136] FROMLIST: dt-bindings: pwm: Add Loongson PWM +Date: Tue, 22 Oct 2024 17:04:14 +0800 +Subject: [PATCH 047/155] FROMLIST: dt-bindings: pwm: Add Loongson PWM controller Add Loongson PWM controller binding with DT schema format using @@ -11,7 +11,7 @@ Signed-off-by: Binbin Zhou Reviewed-by: Krzysztof Kozlowski Acked-by: Huacai Chen -Link: https://lore.kernel.org/all/fc0711008aae1ec9678813c4ca233db63aa0360d.1728463622.git.zhoubinbin@loongson.cn/ +Link: https://lore.kernel.org/all/dfc1e51dcf94485d1d7abe3612a0d8216143d32d.1729583747.git.zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- .../bindings/pwm/loongson,ls7a-pwm.yaml | 66 +++++++++++++++++++ @@ -92,7 +92,7 @@ index 000000000000..46814773e0cc + #pwm-cells = <3>; + }; diff --git a/MAINTAINERS b/MAINTAINERS -index 53629156e327..cc091571d3ac 100644 +index 73ebd630afe7..6ad85d250abe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13206,6 +13206,12 @@ S: Maintained diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch b/app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch rename to app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch index 6612536183a..ffe23beb0ba 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch +++ b/app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch @@ -1,7 +1,7 @@ -From 7388b4d3da888696d7457e930225396695525731 Mon Sep 17 00:00:00 2001 +From 38a3f1026bf6c21e3de19adb6d461053642e3b48 Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Thu, 10 Oct 2024 16:30:26 +0800 -Subject: [PATCH 047/136] FROMLIST: pwm: Add Loongson PWM controller support +Date: Tue, 22 Oct 2024 17:04:15 +0800 +Subject: [PATCH 048/155] FROMLIST: pwm: Add Loongson PWM controller support This commit adds a generic PWM framework driver for the PWM controller found on Loongson family chips. @@ -11,18 +11,18 @@ Signed-off-by: Juxin Gao Signed-off-by: Binbin Zhou Acked-by: Huacai Chen -Link: https://lore.kernel.org/all/aab9b84ca3ea7e37cc42ad1622724e8198b5b0ea.1728463622.git.zhoubinbin@loongson.cn/ +Link: https://lore.kernel.org/all/66bcb210478df5215e4e31e4f25c25194d6163ca.1729583747.git.zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- MAINTAINERS | 1 + drivers/pwm/Kconfig | 12 ++ drivers/pwm/Makefile | 1 + - drivers/pwm/pwm-loongson.c | 287 +++++++++++++++++++++++++++++++++++++ - 4 files changed, 301 insertions(+) + drivers/pwm/pwm-loongson.c | 288 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 302 insertions(+) create mode 100644 drivers/pwm/pwm-loongson.c diff --git a/MAINTAINERS b/MAINTAINERS -index cc091571d3ac..8e98849c842f 100644 +index 6ad85d250abe..b584d408c075 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13211,6 +13211,7 @@ M: Binbin Zhou @@ -70,10 +70,10 @@ index 0be4f3e6dd43..7ddf231d9d62 100644 obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx.o diff --git a/drivers/pwm/pwm-loongson.c b/drivers/pwm/pwm-loongson.c new file mode 100644 -index 000000000000..cdd320ed3060 +index 000000000000..4c9b14efadc3 --- /dev/null +++ b/drivers/pwm/pwm-loongson.c -@@ -0,0 +1,287 @@ +@@ -0,0 +1,288 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2017-2024 Loongson Technology Corporation Limited. @@ -292,6 +292,7 @@ index 000000000000..cdd320ed3060 + } + + chip->ops = &pwm_loongson_ops; ++ chip->atomic = true; + dev_set_drvdata(dev, chip); + + ret = devm_pwmchip_add(dev, chip); diff --git a/app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch b/app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch similarity index 91% rename from app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch rename to app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch index 476560b37c6..731f9b37f2f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch +++ b/app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch @@ -1,7 +1,7 @@ -From 05d00f56d01e19c2c86790e6c71b7015f0d0b31b Mon Sep 17 00:00:00 2001 +From 201fad93fc3ca14e739f9f2964cb2397406cb7a8 Mon Sep 17 00:00:00 2001 From: Hongchen Zhang Date: Thu, 13 Jun 2024 15:42:58 +0800 -Subject: [PATCH 048/136] FROMLIST: PCI: pci_call_probe: call local_pci_probe() +Subject: [PATCH 049/155] FROMLIST: PCI: pci_call_probe: call local_pci_probe() when selected cpu is offline Call work_on_cpu(cpu, fn, arg) in pci_call_probe() while the argument diff --git a/app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch b/app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch rename to app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch index c0a47d4d134..34a07d6c600 100644 --- a/app-admin/kernel-tools/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch +++ b/app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch @@ -1,7 +1,7 @@ -From f038f09e363e0af7d5628f9edab3c7a57e08ad04 Mon Sep 17 00:00:00 2001 +From e4030c81f7a85d039ecd560d156edf5c76b3b1a1 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:27 -0500 -Subject: [PATCH 049/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ANY. +Subject: [PATCH 050/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ANY. This corresponds to part of the functionality of the NT syscall NtWaitForMultipleObjects(). Specifically, it implements the behaviour where diff --git a/app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch b/app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch rename to app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch index f701dd61a62..afd660a1067 100644 --- a/app-admin/kernel-tools/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch +++ b/app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch @@ -1,7 +1,7 @@ -From 84105d1b3d39d357ef82e7fe9b3120ce2437a8ed Mon Sep 17 00:00:00 2001 +From 671b90d3e1830636da029e720b951d5efaaa20b7 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:28 -0500 -Subject: [PATCH 050/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ALL. +Subject: [PATCH 051/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ALL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch b/app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch rename to app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch index c0f3e7c2540..b3d1a1ab9a3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch +++ b/app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch @@ -1,7 +1,7 @@ -From 740f89023cbc391441f41976a08e555d85cdfe8a Mon Sep 17 00:00:00 2001 +From 9241db70beb0497bc189cb4a3df20764ceb1252a Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:29 -0500 -Subject: [PATCH 051/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX. +Subject: [PATCH 052/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX. This corresponds to the NT syscall NtCreateMutant(). diff --git a/app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch b/app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch rename to app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch index d58ad5a4ef1..d5340afe31b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch +++ b/app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch @@ -1,7 +1,7 @@ -From 273837066a84abd35455f5fc43f960c72ca26076 Mon Sep 17 00:00:00 2001 +From f9c6f401864e4822dddfbbd882cb96caac211108 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:30 -0500 -Subject: [PATCH 052/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK. +Subject: [PATCH 053/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK. This corresponds to the NT syscall NtReleaseMutant(). diff --git a/app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch b/app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch rename to app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch index 8b2af53095b..2ad0ee22453 100644 --- a/app-admin/kernel-tools/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch +++ b/app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch @@ -1,7 +1,7 @@ -From f190b2c69f253a27a5974d1a4aa273eddf3c6732 Mon Sep 17 00:00:00 2001 +From e5b286736401f4e3941123ec8755b6f76f208eb2 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:31 -0500 -Subject: [PATCH 053/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_KILL. +Subject: [PATCH 054/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_KILL. This does not correspond to any NT syscall. Rather, when a thread dies, it should be called by the NT emulator for each mutex, with the TID of the dying diff --git a/app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch b/app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch rename to app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch index eb0d8576cf0..ccece84809e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch +++ b/app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch @@ -1,7 +1,7 @@ -From d0d86b02ceb927cbeb2dce3a404afe71d21bf932 Mon Sep 17 00:00:00 2001 +From 85e83496cdc212ad71f5acf36885ea6cbe5d4fb2 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:32 -0500 -Subject: [PATCH 054/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_EVENT. +Subject: [PATCH 055/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_EVENT. This correspond to the NT syscall NtCreateEvent(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch b/app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch rename to app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch index 18aa0d011ff..d05420b2b8e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch +++ b/app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch @@ -1,7 +1,7 @@ -From 96958b770d7ce34ee4f70aacbc2ff3a5140c9c3b Mon Sep 17 00:00:00 2001 +From 2dc5c9b5d38514fde5d9ecec2ef45258e7a38fa3 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:33 -0500 -Subject: [PATCH 055/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_SET. +Subject: [PATCH 056/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_SET. This corresponds to the NT syscall NtSetEvent(). diff --git a/app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch b/app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch rename to app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch index ad19b26130e..e8301a28ab9 100644 --- a/app-admin/kernel-tools/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch +++ b/app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch @@ -1,7 +1,7 @@ -From e851458afb9d43ef74cc4403d6c9a663434d8b92 Mon Sep 17 00:00:00 2001 +From 64024446232b7d11812b15f5edd34a27b559b268 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:34 -0500 -Subject: [PATCH 056/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_RESET. +Subject: [PATCH 057/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_RESET. This corresponds to the NT syscall NtResetEvent(). diff --git a/app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch b/app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch rename to app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch index 871759dfb1f..a1a56f704cb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch +++ b/app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch @@ -1,7 +1,7 @@ -From cd86cf17d5ec83c2d1a8a9d3ffb25290c5ea17ae Mon Sep 17 00:00:00 2001 +From e2248072e9652db5fb3b853dffe0f57fd0c7d3fa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:35 -0500 -Subject: [PATCH 057/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_PULSE. +Subject: [PATCH 058/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_PULSE. This corresponds to the NT syscall NtPulseEvent(). diff --git a/app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch b/app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch rename to app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch index 621157516e2..09886481e6e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch +++ b/app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch @@ -1,7 +1,7 @@ -From 245c5ad748678e5acb803a29a54775b610c08547 Mon Sep 17 00:00:00 2001 +From 4e711ae31b7522079929ada9a1208c2938aa1424 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:36 -0500 -Subject: [PATCH 058/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_SEM_READ. +Subject: [PATCH 059/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_SEM_READ. This corresponds to the NT syscall NtQuerySemaphore(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch b/app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch rename to app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch index bd6e6f76f9d..69de2919850 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch +++ b/app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch @@ -1,7 +1,7 @@ -From 2fcdba1584054357170824c3c3639519a151ea92 Mon Sep 17 00:00:00 2001 +From e75e8b837827e09b27454150cf92439e396894e4 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:37 -0500 -Subject: [PATCH 059/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_READ. +Subject: [PATCH 060/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_READ. This corresponds to the NT syscall NtQueryMutant(). diff --git a/app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch b/app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch rename to app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch index 479f911fda1..3991f4a1574 100644 --- a/app-admin/kernel-tools/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch +++ b/app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch @@ -1,7 +1,7 @@ -From 44faf909179de0084afd7b27ae26a1a841ed359f Mon Sep 17 00:00:00 2001 +From d727ab99233992d1ed7a4cc86d3ce3d3de3f0eab Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:38 -0500 -Subject: [PATCH 060/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_READ. +Subject: [PATCH 061/155] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_READ. This corresponds to the NT syscall NtQueryEvent(). diff --git a/app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch b/app-admin/kernel-tools/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch rename to app-admin/kernel-tools/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch index 2e1e6a1e9f6..fcd2ca3e82c 100644 --- a/app-admin/kernel-tools/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch +++ b/app-admin/kernel-tools/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch @@ -1,7 +1,7 @@ -From 42b415ec6d14c1712bc0de0fd83e8213a3746f51 Mon Sep 17 00:00:00 2001 +From bf2f5ec6393d4a577d2809df8e4f063780be6bb4 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:39 -0500 -Subject: [PATCH 061/136] FROMLIST: ntsync: Introduce alertable waits. +Subject: [PATCH 062/155] FROMLIST: ntsync: Introduce alertable waits. NT waits can optionally be made "alertable". This is a special channel for thread wakeup that is mildly similar to SIGIO. A thread has an internal single diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch b/app-admin/kernel-tools/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch rename to app-admin/kernel-tools/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch index 062516a2849..a3c718c4f8d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch +++ b/app-admin/kernel-tools/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch @@ -1,7 +1,7 @@ -From 93a1dfd0548549e9f627ab333afc608653c1d16e Mon Sep 17 00:00:00 2001 +From 2f7b62f1dfd754422b2c2c4abb98cfdd54526f80 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:40 -0500 -Subject: [PATCH 062/136] BACKPORT: FROMLIST: selftests: ntsync: Add some tests +Subject: [PATCH 063/155] BACKPORT: FROMLIST: selftests: ntsync: Add some tests for semaphore state. Wine has tests for its synchronization primitives, but these are more accessible diff --git a/app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch deleted file mode 100644 index fc35cb3e056..00000000000 --- a/app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 58d3ab336ae2fce95e029aa04b43b0e95df0bda8 Mon Sep 17 00:00:00 2001 -From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:42 -0500 -Subject: [PATCH 064/136] FROMLIST: selftests: ntsync: Add some tests for - NTSYNC_IOC_WAIT_ANY. - -Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are -considered signaled or not signaled, and how they are affected by a successful -wait. - -Signed-off-by: Elizabeth Figura - -Link: https://lore.kernel.org/all/20240519202454.1192826-17-zfigura@codeweavers.com/ -Signed-off-by: Kexy Biscuit ---- - .../testing/selftests/drivers/ntsync/ntsync.c | 119 ++++++++++++++++++ - 1 file changed, 119 insertions(+) - -diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 7cd0f40594fd..40ad8cbd3138 100644 ---- a/tools/testing/selftests/drivers/ntsync/ntsync.c -+++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -342,4 +342,123 @@ TEST(mutex_state) - close(fd); - } - -+TEST(test_wait_any) -+{ -+ int objs[NTSYNC_MAX_WAIT_COUNT + 1], fd, ret; -+ struct ntsync_mutex_args mutex_args = {0}; -+ struct ntsync_sem_args sem_args = {0}; -+ __u32 owner, index, count, i; -+ struct timespec timeout; -+ -+ clock_gettime(CLOCK_MONOTONIC, &timeout); -+ -+ fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); -+ ASSERT_LE(0, fd); -+ -+ sem_args.count = 2; -+ sem_args.max = 3; -+ sem_args.sem = 0xdeadbeef; -+ ret = ioctl(fd, NTSYNC_IOC_CREATE_SEM, &sem_args); -+ EXPECT_EQ(0, ret); -+ EXPECT_NE(0xdeadbeef, sem_args.sem); -+ -+ mutex_args.owner = 0; -+ mutex_args.count = 0; -+ mutex_args.mutex = 0xdeadbeef; -+ ret = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); -+ EXPECT_EQ(0, ret); -+ EXPECT_NE(0xdeadbeef, mutex_args.mutex); -+ -+ objs[0] = sem_args.sem; -+ objs[1] = mutex_args.mutex; -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ count = 1; -+ ret = post_sem(sem_args.sem, &count); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ -+ owner = 123; -+ ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); -+ EXPECT_EQ(0, ret); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EOWNERDEAD, errno); -+ EXPECT_EQ(1, index); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ -+ /* test waiting on the same object twice */ -+ count = 2; -+ ret = post_sem(sem_args.sem, &count); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ -+ objs[0] = objs[1] = sem_args.sem; -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 1, 3); -+ -+ ret = wait_any(fd, 0, NULL, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ -+ for (i = 0; i < NTSYNC_MAX_WAIT_COUNT + 1; ++i) -+ objs[i] = sem_args.sem; -+ -+ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ -+ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT + 1, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EINVAL, errno); -+ -+ ret = wait_any(fd, -1, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EINVAL, errno); -+ -+ close(sem_args.sem); -+ close(mutex_args.mutex); -+ -+ close(fd); -+} -+ - TEST_HARNESS_MAIN --- -2.47.0 - diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch b/app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch rename to app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch index 724e34ef0ad..d44cf7544d5 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch +++ b/app-admin/kernel-tools/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch @@ -1,7 +1,7 @@ -From fd603d4b814869cbefb5f44de01414ca9eb32c63 Mon Sep 17 00:00:00 2001 +From 39da3d16b65e948d5d32ba0e26189aae84a01263 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:41 -0500 -Subject: [PATCH 063/136] FROMLIST: selftests: ntsync: Add some tests for mutex +Subject: [PATCH 064/155] FROMLIST: selftests: ntsync: Add some tests for mutex state. Test mutex-specific ioctls NTSYNC_IOC_MUTEX_UNLOCK and NTSYNC_IOC_MUTEX_READ, diff --git a/app-admin/kernel-tools/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/app-admin/kernel-tools/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch index 7b8009b7b51..2d4ac9c54d3 100644 --- a/app-admin/kernel-tools/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch +++ b/app-admin/kernel-tools/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch @@ -1,67 +1,38 @@ -From b9ba7f4120b59c5efdd5f6969ea47c79f904933d Mon Sep 17 00:00:00 2001 +From 8eed174d09401be8e1eca59dd939f972551ecafc Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:43 -0500 -Subject: [PATCH 065/136] FROMLIST: selftests: ntsync: Add some tests for - NTSYNC_IOC_WAIT_ALL. +Date: Sun, 19 May 2024 15:24:42 -0500 +Subject: [PATCH 065/155] FROMLIST: selftests: ntsync: Add some tests for + NTSYNC_IOC_WAIT_ANY. -Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects -are considered simultaneously signaled. +Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are +considered signaled or not signaled, and how they are affected by a successful +wait. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-18-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-17-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 99 ++++++++++++++++++- - 1 file changed, 97 insertions(+), 2 deletions(-) + .../testing/selftests/drivers/ntsync/ntsync.c | 119 ++++++++++++++++++ + 1 file changed, 119 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 40ad8cbd3138..c0f372167557 100644 +index 7cd0f40594fd..40ad8cbd3138 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -73,7 +73,8 @@ static int unlock_mutex(int mutex, __u32 owner, __u32 *count) - return ret; - } - --static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+static int wait_objs(int fd, unsigned long request, __u32 count, -+ const int *objs, __u32 owner, __u32 *index) - { - struct ntsync_wait_args args = {0}; - struct timespec timeout; -@@ -86,11 +87,21 @@ static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *in - args.objs = (uintptr_t)objs; - args.owner = owner; - args.index = 0xdeadbeef; -- ret = ioctl(fd, NTSYNC_IOC_WAIT_ANY, &args); -+ ret = ioctl(fd, request, &args); - *index = args.index; - return ret; - } - -+static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+{ -+ return wait_objs(fd, NTSYNC_IOC_WAIT_ANY, count, objs, owner, index); -+} -+ -+static int wait_all(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+{ -+ return wait_objs(fd, NTSYNC_IOC_WAIT_ALL, count, objs, owner, index); -+} -+ - TEST(semaphore_state) - { - struct ntsync_sem_args sem_args; -@@ -461,4 +472,88 @@ TEST(test_wait_any) +@@ -342,4 +342,123 @@ TEST(mutex_state) close(fd); } -+TEST(test_wait_all) ++TEST(test_wait_any) +{ ++ int objs[NTSYNC_MAX_WAIT_COUNT + 1], fd, ret; + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_sem_args sem_args = {0}; -+ __u32 owner, index, count; -+ int objs[2], fd, ret; ++ __u32 owner, index, count, i; ++ struct timespec timeout; ++ ++ clock_gettime(CLOCK_MONOTONIC, &timeout); + + fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); + ASSERT_LE(0, fd); @@ -83,54 +54,86 @@ index 40ad8cbd3138..c0f372167557 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); ++ check_mutex_state(mutex_args.mutex, 0, 0); + -+ ret = wait_all(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); ++ check_mutex_state(mutex_args.mutex, 0, 0); + -+ ret = wait_all(fd, 2, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); ++ ret = wait_any(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); + check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); ++ check_mutex_state(mutex_args.mutex, 1, 123); + -+ count = 3; ++ count = 1; + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 2, 3); -+ check_mutex_state(mutex_args.mutex, 3, 123); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_any(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); + + owner = 123; + ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); + EXPECT_EQ(0, ret); + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 456, &index); + EXPECT_EQ(-1, ret); + EXPECT_EQ(EOWNERDEAD, errno); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); ++ EXPECT_EQ(1, index); ++ ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); + + /* test waiting on the same object twice */ ++ count = 2; ++ ret = post_sem(sem_args.sem, &count); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, count); ++ + objs[0] = objs[1] = sem_args.sem; -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 1, 3); ++ ++ ret = wait_any(fd, 0, NULL, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ ++ for (i = 0; i < NTSYNC_MAX_WAIT_COUNT + 1; ++i) ++ objs[i] = sem_args.sem; ++ ++ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ ++ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT + 1, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EINVAL, errno); ++ ++ ret = wait_any(fd, -1, objs, 123, &index); + EXPECT_EQ(-1, ret); + EXPECT_EQ(EINVAL, errno); + diff --git a/app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch new file mode 100644 index 00000000000..721609d8c9a --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch @@ -0,0 +1,146 @@ +From 533f8b6b5ab95d0491d5b461b6c1a578eb1072b4 Mon Sep 17 00:00:00 2001 +From: Elizabeth Figura +Date: Sun, 19 May 2024 15:24:43 -0500 +Subject: [PATCH 066/155] FROMLIST: selftests: ntsync: Add some tests for + NTSYNC_IOC_WAIT_ALL. + +Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects +are considered simultaneously signaled. + +Signed-off-by: Elizabeth Figura + +Link: https://lore.kernel.org/all/20240519202454.1192826-18-zfigura@codeweavers.com/ +Signed-off-by: Kexy Biscuit +--- + .../testing/selftests/drivers/ntsync/ntsync.c | 99 ++++++++++++++++++- + 1 file changed, 97 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c +index 40ad8cbd3138..c0f372167557 100644 +--- a/tools/testing/selftests/drivers/ntsync/ntsync.c ++++ b/tools/testing/selftests/drivers/ntsync/ntsync.c +@@ -73,7 +73,8 @@ static int unlock_mutex(int mutex, __u32 owner, __u32 *count) + return ret; + } + +-static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++static int wait_objs(int fd, unsigned long request, __u32 count, ++ const int *objs, __u32 owner, __u32 *index) + { + struct ntsync_wait_args args = {0}; + struct timespec timeout; +@@ -86,11 +87,21 @@ static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *in + args.objs = (uintptr_t)objs; + args.owner = owner; + args.index = 0xdeadbeef; +- ret = ioctl(fd, NTSYNC_IOC_WAIT_ANY, &args); ++ ret = ioctl(fd, request, &args); + *index = args.index; + return ret; + } + ++static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++{ ++ return wait_objs(fd, NTSYNC_IOC_WAIT_ANY, count, objs, owner, index); ++} ++ ++static int wait_all(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++{ ++ return wait_objs(fd, NTSYNC_IOC_WAIT_ALL, count, objs, owner, index); ++} ++ + TEST(semaphore_state) + { + struct ntsync_sem_args sem_args; +@@ -461,4 +472,88 @@ TEST(test_wait_any) + close(fd); + } + ++TEST(test_wait_all) ++{ ++ struct ntsync_mutex_args mutex_args = {0}; ++ struct ntsync_sem_args sem_args = {0}; ++ __u32 owner, index, count; ++ int objs[2], fd, ret; ++ ++ fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); ++ ASSERT_LE(0, fd); ++ ++ sem_args.count = 2; ++ sem_args.max = 3; ++ sem_args.sem = 0xdeadbeef; ++ ret = ioctl(fd, NTSYNC_IOC_CREATE_SEM, &sem_args); ++ EXPECT_EQ(0, ret); ++ EXPECT_NE(0xdeadbeef, sem_args.sem); ++ ++ mutex_args.owner = 0; ++ mutex_args.count = 0; ++ mutex_args.mutex = 0xdeadbeef; ++ ret = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); ++ EXPECT_EQ(0, ret); ++ EXPECT_NE(0xdeadbeef, mutex_args.mutex); ++ ++ objs[0] = sem_args.sem; ++ objs[1] = mutex_args.mutex; ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_all(fd, 2, objs, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ count = 3; ++ ret = post_sem(sem_args.sem, &count); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, count); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 2, 3); ++ check_mutex_state(mutex_args.mutex, 3, 123); ++ ++ owner = 123; ++ ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); ++ EXPECT_EQ(0, ret); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EOWNERDEAD, errno); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ /* test waiting on the same object twice */ ++ objs[0] = objs[1] = sem_args.sem; ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EINVAL, errno); ++ ++ close(sem_args.sem); ++ close(mutex_args.mutex); ++ ++ close(fd); ++} ++ + TEST_HARNESS_MAIN +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/app-admin/kernel-tools/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 427029675cd..6fe1aa12bf0 100644 --- a/app-admin/kernel-tools/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,30 +1,69 @@ -From ca5ec2db3c4818ea100324a65a82fab26aa019ae Mon Sep 17 00:00:00 2001 +From ca7f01ea66262b10a3b0aff95f8248dec6cd9447 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:45 -0500 -Subject: [PATCH 067/136] FROMLIST: selftests: ntsync: Add some tests for - wakeup signaling with WINESYNC_IOC_WAIT_ALL. +Date: Sun, 19 May 2024 15:24:44 -0500 +Subject: [PATCH 067/155] FROMLIST: selftests: ntsync: Add some tests for + wakeup signaling with WINESYNC_IOC_WAIT_ANY. -Test contended "wait-for-all" waits, to make sure that scheduling and wakeup -logic works correctly, and that the wait only exits once objects are all -simultaneously signaled. +Test contended "wait-for-any" waits, to make sure that scheduling and wakeup +logic works correctly. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-20-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-19-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 98 +++++++++++++++++++ - 1 file changed, 98 insertions(+) + .../testing/selftests/drivers/ntsync/ntsync.c | 150 ++++++++++++++++++ + 1 file changed, 150 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 993f5db23768..b77fb0b2c4b1 100644 +index c0f372167557..993f5db23768 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -706,4 +706,102 @@ TEST(wake_any) +@@ -556,4 +556,154 @@ TEST(test_wait_all) close(fd); } -+TEST(wake_all) ++struct wake_args { ++ int fd; ++ int obj; ++}; ++ ++struct wait_args { ++ int fd; ++ unsigned long request; ++ struct ntsync_wait_args *args; ++ int ret; ++ int err; ++}; ++ ++static void *wait_thread(void *arg) ++{ ++ struct wait_args *args = arg; ++ ++ args->ret = ioctl(args->fd, args->request, args->args); ++ args->err = errno; ++ return NULL; ++} ++ ++static __u64 get_abs_timeout(unsigned int ms) ++{ ++ struct timespec timeout; ++ clock_gettime(CLOCK_MONOTONIC, &timeout); ++ return (timeout.tv_sec * 1000000000) + timeout.tv_nsec + (ms * 1000000); ++} ++ ++static int wait_for_thread(pthread_t thread, unsigned int ms) ++{ ++ struct timespec timeout; ++ ++ clock_gettime(CLOCK_REALTIME, &timeout); ++ timeout.tv_nsec += ms * 1000000; ++ timeout.tv_sec += (timeout.tv_nsec / 1000000000); ++ timeout.tv_nsec %= 1000000000; ++ return pthread_timedjoin_np(thread, NULL, &timeout); ++} ++ ++TEST(wake_any) +{ + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_wait_args wait_args = {0}; @@ -54,13 +93,16 @@ index 993f5db23768..b77fb0b2c4b1 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + ++ /* test waking the semaphore */ ++ + wait_args.timeout = get_abs_timeout(1000); + wait_args.objs = (uintptr_t)objs; + wait_args.count = 2; + wait_args.owner = 456; ++ wait_args.index = 0xdeadbeef; + thread_args.fd = fd; + thread_args.args = &wait_args; -+ thread_args.request = NTSYNC_IOC_WAIT_ALL; ++ thread_args.request = NTSYNC_IOC_WAIT_ANY; + ret = pthread_create(&thread, NULL, wait_thread, &thread_args); + EXPECT_EQ(0, ret); + @@ -71,35 +113,44 @@ index 993f5db23768..b77fb0b2c4b1 100644 + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); ++ check_sem_state(sem_args.sem, 0, 3); + -+ ret = pthread_tryjoin_np(thread, NULL); -+ EXPECT_EQ(EBUSY, ret); ++ ret = wait_for_thread(thread, 100); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, thread_args.ret); ++ EXPECT_EQ(0, wait_args.index); + -+ check_sem_state(sem_args.sem, 1, 3); ++ /* test waking the mutex */ + -+ ret = wait_any(fd, 1, &sem_args.sem, 123, &index); ++ /* first grab it again for owner 123 */ ++ ret = wait_any(fd, 1, &mutex_args.mutex, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + ++ wait_args.timeout = get_abs_timeout(1000); ++ wait_args.owner = 456; ++ ret = pthread_create(&thread, NULL, wait_thread, &thread_args); ++ EXPECT_EQ(0, ret); ++ ++ ret = wait_for_thread(thread, 100); ++ EXPECT_EQ(ETIMEDOUT, ret); ++ + ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, count); ++ EXPECT_EQ(2, count); + + ret = pthread_tryjoin_np(thread, NULL); + EXPECT_EQ(EBUSY, ret); + -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ count = 2; -+ ret = post_sem(sem_args.sem, &count); ++ ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ check_sem_state(sem_args.sem, 1, 3); ++ EXPECT_EQ(1, mutex_args.count); + check_mutex_state(mutex_args.mutex, 1, 456); + + ret = wait_for_thread(thread, 100); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, thread_args.ret); ++ EXPECT_EQ(1, wait_args.index); + + /* delete an object while it's being waited on */ + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 53% rename from runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index e5cf3d5cbae..32f01a0c80a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,69 +1,30 @@ -From 8678427a252e4aad785a6e7a123522c932d745dd Mon Sep 17 00:00:00 2001 +From 5bf1e0eb257794ba6b039b2627aa070a76704caa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:44 -0500 -Subject: [PATCH 066/136] FROMLIST: selftests: ntsync: Add some tests for - wakeup signaling with WINESYNC_IOC_WAIT_ANY. +Date: Sun, 19 May 2024 15:24:45 -0500 +Subject: [PATCH 068/155] FROMLIST: selftests: ntsync: Add some tests for + wakeup signaling with WINESYNC_IOC_WAIT_ALL. -Test contended "wait-for-any" waits, to make sure that scheduling and wakeup -logic works correctly. +Test contended "wait-for-all" waits, to make sure that scheduling and wakeup +logic works correctly, and that the wait only exits once objects are all +simultaneously signaled. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-19-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-20-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 150 ++++++++++++++++++ - 1 file changed, 150 insertions(+) + .../testing/selftests/drivers/ntsync/ntsync.c | 98 +++++++++++++++++++ + 1 file changed, 98 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index c0f372167557..993f5db23768 100644 +index 993f5db23768..b77fb0b2c4b1 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -556,4 +556,154 @@ TEST(test_wait_all) +@@ -706,4 +706,102 @@ TEST(wake_any) close(fd); } -+struct wake_args { -+ int fd; -+ int obj; -+}; -+ -+struct wait_args { -+ int fd; -+ unsigned long request; -+ struct ntsync_wait_args *args; -+ int ret; -+ int err; -+}; -+ -+static void *wait_thread(void *arg) -+{ -+ struct wait_args *args = arg; -+ -+ args->ret = ioctl(args->fd, args->request, args->args); -+ args->err = errno; -+ return NULL; -+} -+ -+static __u64 get_abs_timeout(unsigned int ms) -+{ -+ struct timespec timeout; -+ clock_gettime(CLOCK_MONOTONIC, &timeout); -+ return (timeout.tv_sec * 1000000000) + timeout.tv_nsec + (ms * 1000000); -+} -+ -+static int wait_for_thread(pthread_t thread, unsigned int ms) -+{ -+ struct timespec timeout; -+ -+ clock_gettime(CLOCK_REALTIME, &timeout); -+ timeout.tv_nsec += ms * 1000000; -+ timeout.tv_sec += (timeout.tv_nsec / 1000000000); -+ timeout.tv_nsec %= 1000000000; -+ return pthread_timedjoin_np(thread, NULL, &timeout); -+} -+ -+TEST(wake_any) ++TEST(wake_all) +{ + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_wait_args wait_args = {0}; @@ -93,16 +54,13 @@ index c0f372167557..993f5db23768 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + -+ /* test waking the semaphore */ -+ + wait_args.timeout = get_abs_timeout(1000); + wait_args.objs = (uintptr_t)objs; + wait_args.count = 2; + wait_args.owner = 456; -+ wait_args.index = 0xdeadbeef; + thread_args.fd = fd; + thread_args.args = &wait_args; -+ thread_args.request = NTSYNC_IOC_WAIT_ANY; ++ thread_args.request = NTSYNC_IOC_WAIT_ALL; + ret = pthread_create(&thread, NULL, wait_thread, &thread_args); + EXPECT_EQ(0, ret); + @@ -113,44 +71,35 @@ index c0f372167557..993f5db23768 100644 + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); -+ check_sem_state(sem_args.sem, 0, 3); + -+ ret = wait_for_thread(thread, 100); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, thread_args.ret); -+ EXPECT_EQ(0, wait_args.index); ++ ret = pthread_tryjoin_np(thread, NULL); ++ EXPECT_EQ(EBUSY, ret); + -+ /* test waking the mutex */ ++ check_sem_state(sem_args.sem, 1, 3); + -+ /* first grab it again for owner 123 */ -+ ret = wait_any(fd, 1, &mutex_args.mutex, 123, &index); ++ ret = wait_any(fd, 1, &sem_args.sem, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + -+ wait_args.timeout = get_abs_timeout(1000); -+ wait_args.owner = 456; -+ ret = pthread_create(&thread, NULL, wait_thread, &thread_args); -+ EXPECT_EQ(0, ret); -+ -+ ret = wait_for_thread(thread, 100); -+ EXPECT_EQ(ETIMEDOUT, ret); -+ + ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(2, count); ++ EXPECT_EQ(1, count); + + ret = pthread_tryjoin_np(thread, NULL); + EXPECT_EQ(EBUSY, ret); + -+ ret = unlock_mutex(mutex_args.mutex, 123, &count); ++ check_mutex_state(mutex_args.mutex, 0, 0); ++ ++ count = 2; ++ ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, mutex_args.count); ++ EXPECT_EQ(0, count); ++ check_sem_state(sem_args.sem, 1, 3); + check_mutex_state(mutex_args.mutex, 1, 456); + + ret = wait_for_thread(thread, 100); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, thread_args.ret); -+ EXPECT_EQ(1, wait_args.index); + + /* delete an object while it's being waited on */ + diff --git a/app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch b/app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch rename to app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch index 6c3a100e2c5..9f9d08c80f3 100644 --- a/app-admin/kernel-tools/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch @@ -1,7 +1,7 @@ -From 678685136637b284b0ef54889ba1cda55f59cda2 Mon Sep 17 00:00:00 2001 +From 3c17851170943725ce9c4d410fb31e2e4d0ca636 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:46 -0500 -Subject: [PATCH 068/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 069/155] FROMLIST: selftests: ntsync: Add some tests for manual-reset event state. Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, diff --git a/app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch b/app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch rename to app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch index 3cfec24e3fc..e149d93973d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch +++ b/app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch @@ -1,7 +1,7 @@ -From 8d9a3655ea5c4f942bf1fcd63985d5679fd971d1 Mon Sep 17 00:00:00 2001 +From c682b4ad845e19a209f5c8cffc4caa00fd49457c Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:47 -0500 -Subject: [PATCH 069/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 070/155] FROMLIST: selftests: ntsync: Add some tests for auto-reset event state. Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 9ad7cf4e2c0..d12e2b10b7e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,7 +1,7 @@ -From b18c039e095601a2700e811c79012efbbdcb2320 Mon Sep 17 00:00:00 2001 +From f99eb791d1181aa34c651d98d4186626f5a4ccfa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:48 -0500 -Subject: [PATCH 070/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 071/155] FROMLIST: selftests: ntsync: Add some tests for wakeup signaling with events. Expand the contended wait tests, which previously only covered events and diff --git a/app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch b/app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch rename to app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch index 3ad9ac56531..8d28d065e50 100644 --- a/app-admin/kernel-tools/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch +++ b/app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch @@ -1,7 +1,7 @@ -From 4636500d6b2691177c8689c65c39dc0eef922826 Mon Sep 17 00:00:00 2001 +From e3b8e4347c0a107c229f048ba73c1670623daf35 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:49 -0500 -Subject: [PATCH 071/136] FROMLIST: selftests: ntsync: Add tests for alertable +Subject: [PATCH 072/155] FROMLIST: selftests: ntsync: Add tests for alertable waits. Test the "alert" functionality of NTSYNC_IOC_WAIT_ALL and NTSYNC_IOC_WAIT_ANY, diff --git a/app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 7301da40224..81e0327e1f9 100644 --- a/app-admin/kernel-tools/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,7 +1,7 @@ -From 745b9405da721a4ea1378cb018a808c89d09a43a Mon Sep 17 00:00:00 2001 +From 2931714a2e38c4b46811e2148535bed579d56a93 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:50 -0500 -Subject: [PATCH 072/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 073/155] FROMLIST: selftests: ntsync: Add some tests for wakeup signaling via alerts. Expand the alert tests to cover alerting a thread mid-wait, to test that the diff --git a/app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch b/app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch rename to app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch index 90c0a76517e..1ca47404aac 100644 --- a/app-admin/kernel-tools/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch +++ b/app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch @@ -1,7 +1,7 @@ -From e616e609b4ca58d3d74046d2d54d218c48e86856 Mon Sep 17 00:00:00 2001 +From a44a97ab76fe2b6a9aae6e42fd9661ceb90c0c74 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:51 -0500 -Subject: [PATCH 073/136] FROMLIST: selftests: ntsync: Add a stress test for +Subject: [PATCH 074/155] FROMLIST: selftests: ntsync: Add a stress test for contended waits. Test a more realistic usage pattern, and one with heavy contention, in order to diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch b/app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch similarity index 80% rename from runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch rename to app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch index 598d6922da0..2400304e9a4 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch +++ b/app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch @@ -1,7 +1,7 @@ -From 957fbfc93da9be5a5c0987a6939ae078f55f0d15 Mon Sep 17 00:00:00 2001 +From 33faff4cdff2dd010ceb073e6b79b8f52f803fd6 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:52 -0500 -Subject: [PATCH 074/136] FROMLIST: maintainers: Add an entry for ntsync. +Subject: [PATCH 075/155] FROMLIST: maintainers: Add an entry for ntsync. Add myself as maintainer, supported by CodeWeavers. @@ -14,10 +14,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS -index 8e98849c842f..62dde1daf1a9 100644 +index b584d408c075..8ff20ebdb87d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -16327,6 +16327,15 @@ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git +@@ -16333,6 +16333,15 @@ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git F: Documentation/filesystems/ntfs3.rst F: fs/ntfs3/ diff --git a/app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch b/app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch rename to app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch index 80bec2bb223..68dc17a9738 100644 --- a/app-admin/kernel-tools/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch +++ b/app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch @@ -1,7 +1,7 @@ -From 6bdb561a9f33b0a077147434729c61c0a1ee7e18 Mon Sep 17 00:00:00 2001 +From c85800276fd87f85f5c6ef7f1b92ce0eead1fbc6 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:53 -0500 -Subject: [PATCH 075/136] FROMLIST: docs: ntsync: Add documentation for the +Subject: [PATCH 076/155] FROMLIST: docs: ntsync: Add documentation for the ntsync uAPI. Add an overall explanation of the driver architecture, and complete and precise diff --git a/app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch b/app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch similarity index 89% rename from app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch rename to app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch index 6d7e24e783d..9b4b273c638 100644 --- a/app-admin/kernel-tools/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch +++ b/app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch @@ -1,7 +1,7 @@ -From cb2f96d2ef7e32b64d1910ca59ffc1dbbae9f8ab Mon Sep 17 00:00:00 2001 +From 8d5ec73d594304c3b5695fb4f5ae60241f32cb56 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:54 -0500 -Subject: [PATCH 076/136] FROMLIST: ntsync: No longer depend on BROKEN. +Subject: [PATCH 077/155] FROMLIST: ntsync: No longer depend on BROKEN. f5b335dc025cfee90957efa90dc72fada0d5abb4 ("misc: ntsync: mark driver as "broken" to prevent from building") was committed to avoid the driver being used while diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch b/app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch rename to app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch index 2c44b639c5a..9938754f398 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch +++ b/app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch @@ -1,7 +1,7 @@ -From 3e80316c4726bdb7ee2740fb811783c5d624b37b Mon Sep 17 00:00:00 2001 +From 379257a733283fd9b8e73e30084bba3b6a84ba42 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Wed, 8 Nov 2023 10:46:13 +0800 -Subject: [PATCH 077/136] FROMLIST: drm/Makefile: Move tiny drivers before +Subject: [PATCH 078/155] FROMLIST: drm/Makefile: Move tiny drivers before native drivers After commit 60aebc9559492cea ("drivers/firmware: Move sysfb_init() from diff --git a/app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch b/app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch rename to app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch index 80707949e30..75088f78f2e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch @@ -1,7 +1,7 @@ -From 9b8d150cfef3c533fd0f52ffab5cf5f55355a377 Mon Sep 17 00:00:00 2001 +From 7806069f31443732f75a30cad8f0c251aac5e716 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:15:00 +0800 -Subject: [PATCH 078/136] FROMLIST: LoongArch: SMP: Implement parallel CPU +Subject: [PATCH 079/155] FROMLIST: LoongArch: SMP: Implement parallel CPU bring up Implement parallel CPU bring up for LoongArch to reduce diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch b/app-admin/kernel-tools/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch rename to app-admin/kernel-tools/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch index f53080ed93f..669ad1366f3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch +++ b/app-admin/kernel-tools/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch @@ -1,7 +1,7 @@ -From 0145795167a99098ddc604817fb5a96015abf62c Mon Sep 17 00:00:00 2001 +From a5956cf96a19af344ccfb3ae220a55d11028899e Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:03 +0800 -Subject: [PATCH 079/136] FROMLIST: dt-bindings: serial: Add Loongson UART +Subject: [PATCH 080/155] FROMLIST: dt-bindings: serial: Add Loongson UART controller Add Loongson UART controller binding with DT schema format using diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch b/app-admin/kernel-tools/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch rename to app-admin/kernel-tools/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch index 08dd2a5cce2..72f12e8534b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch @@ -1,7 +1,7 @@ -From 34171ac5370426d993f4da8f4fbf3a2100458273 Mon Sep 17 00:00:00 2001 +From aa2a59e14d6e5be5a16ca158331864780f6ba1e3 Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:04 +0800 -Subject: [PATCH 080/136] BACKPORT: FROMLIST: tty: serial: 8250: Add loongson +Subject: [PATCH 081/155] BACKPORT: FROMLIST: tty: serial: 8250: Add loongson uart driver support Due to certain hardware design challenges, we have opted to @@ -23,7 +23,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/tty/serial/8250/8250_loongson.c diff --git a/MAINTAINERS b/MAINTAINERS -index 62dde1daf1a9..3653bf325a90 100644 +index 8ff20ebdb87d..1f397800b85a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13213,6 +13213,13 @@ S: Maintained diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch b/app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch rename to app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch index 8623e23f8a5..e327f3a8b53 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch +++ b/app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch @@ -1,7 +1,7 @@ -From c28fa111a3835a1cf576bafbc0a2d4c3125f7437 Mon Sep 17 00:00:00 2001 +From 43e20e72127b2a803ff274387e8b89b8b4baac69 Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:05 +0800 -Subject: [PATCH 081/136] FROMLIST: LoongArch: Update dts to support Loongson +Subject: [PATCH 082/155] FROMLIST: LoongArch: Update dts to support Loongson UART driver. Change to use the Loongson UART driver for Loongson-2K2000, diff --git a/app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch b/app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch deleted file mode 100644 index 9e14bc49b48..00000000000 --- a/app-admin/kernel-tools/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 650c5044d7b5dfd29cb63f746fa1217368f74b01 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Tue, 24 Sep 2024 10:16:33 +0800 -Subject: [PATCH 082/136] FROMLIST: wifi: rtw89: pci: early chips only enable - 36-bit DMA on specific PCI hosts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The early chips including RTL8852A, RTL8851B, RTL8852B and RTL8852BT have -interoperability problems of 36-bit DMA with some PCI hosts. Rollback -to 32-bit DMA by default, and only enable 36-bit DMA for tested platforms. - -Since all Intel platforms we have can work correctly, add the vendor ID to -white list. Otherwise, list vendor/device ID of bridge we have tested. - -Fixes: 1fd4b3fe52ef ("wifi: rtw89: pci: support 36-bit PCI DMA address") -Reported-by: Marcel Weißenbach -Closes: https://lore.kernel.org/linux-wireless/20240918073237.Horde.VLueh0_KaiDw-9asEEcdM84@ignaz.org/T/#m07c5694df1acb173a42e1a0bab7ac22bd231a2b8 -Signed-off-by: Ping-Ke Shih - -Link: https://lore.kernel.org/all/20240924021633.19861-1-pkshih@realtek.com/ -Signed-off-by: Kexy Biscuit ---- - drivers/net/wireless/realtek/rtw89/pci.c | 48 ++++++++++++++++++++---- - 1 file changed, 41 insertions(+), 7 deletions(-) - -diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c -index 02afeb3acce4..5aef7fa37878 100644 ---- a/drivers/net/wireless/realtek/rtw89/pci.c -+++ b/drivers/net/wireless/realtek/rtw89/pci.c -@@ -3026,24 +3026,54 @@ static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev, - pci_disable_device(pdev); - } - --static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) -+static bool rtw89_pci_chip_is_manual_dac(struct rtw89_dev *rtwdev) - { -- struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; - const struct rtw89_chip_info *chip = rtwdev->chip; - -- if (!rtwpci->enable_dac) -- return; -- - switch (chip->chip_id) { - case RTL8852A: - case RTL8852B: - case RTL8851B: - case RTL8852BT: -- break; -+ return true; - default: -- return; -+ return false; -+ } -+} -+ -+static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev) -+{ -+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; -+ struct pci_dev *bridge = pci_upstream_bridge(rtwpci->pdev); -+ -+ if (!rtw89_pci_chip_is_manual_dac(rtwdev)) -+ return true; -+ -+ if (!bridge) -+ return false; -+ -+ switch (bridge->vendor) { -+ case PCI_VENDOR_ID_INTEL: -+ return true; -+ case PCI_VENDOR_ID_ASMEDIA: -+ if (bridge->device == 0x2806) -+ return true; -+ break; - } - -+ return false; -+} -+ -+static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) -+{ -+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; -+ -+ if (!rtwpci->enable_dac) -+ return; -+ -+ if (!rtw89_pci_chip_is_manual_dac(rtwdev)) -+ return; -+ - rtw89_pci_config_byte_set(rtwdev, RTW89_PCIE_L1_CTRL, RTW89_PCIE_BIT_EN_64BITS); - } - -@@ -3061,6 +3091,9 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, - goto err; - } - -+ if (!rtw89_pci_is_dac_compatible_bridge(rtwdev)) -+ goto no_dac; -+ - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); - if (!ret) { - rtwpci->enable_dac = true; -@@ -3073,6 +3106,7 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, - goto err_release_regions; - } - } -+no_dac: - - resource_len = pci_resource_len(pdev, bar_id); - rtwpci->mmap = pci_iomap(pdev, bar_id, resource_len); --- -2.47.0 - diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch b/app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch similarity index 71% rename from runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch rename to app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch index a79c5b3ab7b..c56715d30a0 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch +++ b/app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch @@ -1,50 +1,59 @@ -From cb1bd7789867a75b02d1526df102970a2c1d1165 Mon Sep 17 00:00:00 2001 +From 046dfa2e1b4b85f63b6253f1c22d1504acc92259 Mon Sep 17 00:00:00 2001 From: Zhao Qunqin -Date: Mon, 30 Sep 2024 11:29:43 +0800 -Subject: [PATCH 084/136] FROMLIST: EDAC: Add EDAC driver for loongson memory +Date: Wed, 13 Nov 2024 16:55:47 +0800 +Subject: [PATCH 083/155] FROMLIST: EDAC: Add EDAC driver for loongson memory controller -Reports single bit errors (CE) only. +Add ECC support for Loongson SoC DDR controller. This +driver reports single bit errors (CE) only. + +Only ACPI firmware is supported. Signed-off-by: Zhao Qunqin +Reviewed-by: Huacai Chen -Link: https://lore.kernel.org/all/20240930032943.5182-3-zhaoqunqin@loongson.cn/ +Link: https://lore.kernel.org/all/20241113085547.15680-1-zhaoqunqin@loongson.cn/ Signed-off-by: Kexy Biscuit --- - MAINTAINERS | 1 + + MAINTAINERS | 6 ++ arch/loongarch/Kconfig | 1 + drivers/edac/Kconfig | 8 ++ drivers/edac/Makefile | 1 + - drivers/edac/loongson_edac.c | 168 +++++++++++++++++++++++++++++++++++ - 5 files changed, 179 insertions(+) + drivers/edac/loongson_edac.c | 156 +++++++++++++++++++++++++++++++++++ + 5 files changed, 172 insertions(+) create mode 100644 drivers/edac/loongson_edac.c diff --git a/MAINTAINERS b/MAINTAINERS -index 0d6e139e4d9c..99b339474f37 100644 +index 1f397800b85a..c253fb9926e4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -13273,6 +13273,7 @@ M: Zhao Qunqin - L: linux-edac@vger.kernel.org - S: Maintained - F: Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -+F: drivers/edac/loongson_edac.c +@@ -13268,6 +13268,12 @@ S: Maintained + F: Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml + F: drivers/thermal/loongson2_thermal.c ++LOONGSON EDAC DRIVER ++M: Zhao Qunqin ++L: linux-edac@vger.kernel.org ++S: Maintained ++F: drivers/edac/loongson_edac.c ++ LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) M: Sathya Prakash + M: Sreekanth Reddy diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig -index c6d03d607b6e..bc76c641bd5b 100644 +index c6d03d607b6e..199b675e2c11 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig -@@ -186,6 +186,7 @@ config LOONGARCH - select PCI_MSI_ARCH_FALLBACKS - select PCI_QUIRKS - select PERF_USE_VMALLOC +@@ -79,6 +79,7 @@ config LOONGARCH + select BUILDTIME_TABLE_SORT + select COMMON_CLK + select CPU_PM + select EDAC_SUPPORT - select RTC_LIB - select SPARSE_IRQ - select SYSCTL_ARCH_UNALIGN_ALLOW + select EFI + select GENERIC_CLOCKEVENTS + select GENERIC_CMOS_UPDATE diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig -index 16c8de5050e5..dd627f9d60ef 100644 +index 16c8de5050e5..02369c3766e2 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -573,5 +573,13 @@ config EDAC_VERSAL @@ -53,11 +62,11 @@ index 16c8de5050e5..dd627f9d60ef 100644 +config EDAC_LOONGSON + tristate "Loongson Memory Controller" -+ depends on LOONGARCH || COMPILE_TEST ++ depends on (LOONGARCH && ACPI) || COMPILE_TEST + help + Support for error detection and correction on the Loongson + family memory controller. This driver reports single bit -+ errors (CE) only. Loongson-3A5000/3C5000/3D5000/3C5000L/3A6000/3C6000 ++ errors (CE) only. Loongson-3A5000/3C5000/3D5000/3A6000/3C6000 + are compatible. endif # EDAC @@ -72,37 +81,27 @@ index 4edfb83ffbee..d6f2cfe7e544 100644 +obj-$(CONFIG_EDAC_LOONGSON) += loongson_edac.o diff --git a/drivers/edac/loongson_edac.c b/drivers/edac/loongson_edac.c new file mode 100644 -index 000000000000..2721dfba5f23 +index 000000000000..29607972f3a1 --- /dev/null +++ b/drivers/edac/loongson_edac.c -@@ -0,0 +1,168 @@ +@@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Loongson Technology Corporation Limited. + */ + ++#include +#include -+#include +#include ++#include ++#include +#include -+ +#include "edac_module.h" + -+enum ecc_index { -+ ECC_SET = 0, -+ ECC_RESERVED, -+ ECC_COUNT, -+ ECC_CS_COUNT, -+ ECC_CODE, -+ ECC_ADDR, -+ ECC_DATA0, -+ ECC_DATA1, -+ ECC_DATA2, -+ ECC_DATA3, -+}; ++#define ECC_CS_COUNT_REG 0x18 + +struct loongson_edac_pvt { -+ u64 *ecc_base; ++ void __iomem *ecc_base; + int last_ce_count; +}; + @@ -115,7 +114,7 @@ index 000000000000..2721dfba5f23 + if (!pvt->ecc_base) + return pvt->last_ce_count; + -+ ecc = pvt->ecc_base[ECC_CS_COUNT]; ++ ecc = readq(pvt->ecc_base + ECC_CS_COUNT_REG); + /* cs0 -- cs3 */ + cs = ecc & 0xff; + cs += (ecc >> 8) & 0xff; @@ -141,7 +140,7 @@ index 000000000000..2721dfba5f23 + edac_mc_printk(mci, KERN_INFO, "add: %d", add); +} + -+static int get_dimm_config(struct mem_ctl_info *mci) ++static void dimm_config_init(struct mem_ctl_info *mci) +{ + struct dimm_info *dimm; + u32 size, npages; @@ -155,11 +154,9 @@ index 000000000000..2721dfba5f23 + snprintf(dimm->label, sizeof(dimm->label), + "MC#%uChannel#%u_DIMM#%u", mci->mc_idx, 0, 0); + dimm->grain = 8; -+ -+ return 0; +} + -+static void pvt_init(struct mem_ctl_info *mci, u64 *vbase) ++static void pvt_init(struct mem_ctl_info *mci, void __iomem *vbase) +{ + struct loongson_edac_pvt *pvt = mci->pvt_info; + @@ -170,9 +167,8 @@ index 000000000000..2721dfba5f23 +static int edac_probe(struct platform_device *pdev) +{ + struct edac_mc_layer layers[2]; -+ struct loongson_edac_pvt *pvt; + struct mem_ctl_info *mci; -+ u64 *vbase; ++ void __iomem *vbase; + int ret; + + vbase = devm_platform_ioremap_resource(pdev, 0); @@ -186,7 +182,8 @@ index 000000000000..2721dfba5f23 + layers[1].type = EDAC_MC_LAYER_SLOT; + layers[1].size = 1; + layers[1].is_virt_csrow = true; -+ mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt)); ++ mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, ++ sizeof(struct loongson_edac_pvt)); + if (mci == NULL) + return -ENOMEM; + @@ -204,7 +201,7 @@ index 000000000000..2721dfba5f23 + mci->edac_check = edac_check; + + pvt_init(mci, vbase); -+ get_dimm_config(mci); ++ dimm_config_init(mci); + + ret = edac_mc_add_mc(mci); + if (ret) { @@ -225,18 +222,18 @@ index 000000000000..2721dfba5f23 + edac_mc_free(mci); +} + -+static const struct of_device_id loongson_edac_of_match[] = { -+ { .compatible = "loongson,ls3a5000-mc-edac", }, ++static const struct acpi_device_id loongson_edac_acpi_match[] = { ++ {"LOON000G", 0}, + {} +}; -+MODULE_DEVICE_TABLE(of, loongson_edac_of_match); ++MODULE_DEVICE_TABLE(acpi, loongson_edac_acpi_match); + +static struct platform_driver loongson_edac_driver = { + .probe = edac_probe, + .remove = edac_remove, + .driver = { + .name = "loongson-mc-edac", -+ .of_match_table = loongson_edac_of_match, ++ .acpi_match_table = loongson_edac_acpi_match, + }, +}; +module_platform_driver(loongson_edac_driver); diff --git a/app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch b/app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch deleted file mode 100644 index 9d26c379cc0..00000000000 --- a/app-admin/kernel-tools/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch +++ /dev/null @@ -1,89 +0,0 @@ -From ceb55e4da592d0d491120f4a56a417b23db17b8b Mon Sep 17 00:00:00 2001 -From: Zhao Qunqin -Date: Mon, 30 Sep 2024 11:29:42 +0800 -Subject: [PATCH 083/136] FROMLIST: dt-bindings: EDAC for ls3a5000 memory - controller - -add device tree bindings for ls3a5000 EDAC driver. - -Signed-off-by: Zhao Qunqin -Reviewed-by: Krzysztof Kozlowski - -Link: https://lore.kernel.org/all/20240930032943.5182-2-zhaoqunqin@loongson.cn/ -Signed-off-by: Kexy Biscuit ---- - .../edac/loongson,ls3a5000-mc-edac.yaml | 44 +++++++++++++++++++ - MAINTAINERS | 6 +++ - 2 files changed, 50 insertions(+) - create mode 100644 Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml - -diff --git a/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml b/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -new file mode 100644 -index 000000000000..52f10bc941e1 ---- /dev/null -+++ b/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -@@ -0,0 +1,44 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/edac/loongson,ls3a5000-mc-edac.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: Loongson Memory Controller EDAC -+ -+maintainers: -+ - Zhao Qunqin -+ -+description: | -+ EDAC node is defined to describe on-chip error detection and correction for -+ Loongson Memory Controller. -+ -+properties: -+ compatible: -+ oneOf: -+ - enum: -+ - loongson,ls3a5000-mc-edac -+ - items: -+ - enum: -+ - loongson,ls3c5000l-mc-edac -+ - loongson,ls3c5000-mc-edac -+ - loongson,ls3d5000-mc-edac -+ - loongson,ls3a6000-mc-edac -+ - loongson,ls3c6000-mc-edac -+ - const: loongson,ls3a5000-mc-edac -+ -+ reg: -+ maxItems: 1 -+ -+required: -+ - compatible -+ - reg -+ -+additionalProperties: false -+ -+examples: -+ - | -+ memory-controller@1fe00600 { -+ compatible = "loongson,ls3a5000-mc-edac"; -+ reg = <0x1fe00600 0x50>; -+ }; -diff --git a/MAINTAINERS b/MAINTAINERS -index 3653bf325a90..0d6e139e4d9c 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -13268,6 +13268,12 @@ S: Maintained - F: Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml - F: drivers/thermal/loongson2_thermal.c - -+LOONGSON EDAC DRIVER -+M: Zhao Qunqin -+L: linux-edac@vger.kernel.org -+S: Maintained -+F: Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -+ - LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) - M: Sathya Prakash - M: Sreekanth Reddy --- -2.47.0 - diff --git a/app-admin/kernel-tools/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch b/app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch similarity index 81% rename from app-admin/kernel-tools/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch rename to app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch index 9d75a967373..5db811a1c60 100644 --- a/app-admin/kernel-tools/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch +++ b/app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch @@ -1,7 +1,7 @@ -From f6c84233a051d79e0cc662a04bbcfe1f23e59898 Mon Sep 17 00:00:00 2001 +From 65105fd2f6c9810a274c55074187a1ec618bd00f Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Tue, 15 Oct 2024 09:59:57 +0800 -Subject: [PATCH 112/136] FROMEXT: Input: Add driver for PixArt PS/2 touchpad +Date: Wed, 23 Oct 2024 16:38:05 +0800 +Subject: [PATCH 084/155] FROMLIST: Input: Add driver for PixArt PS/2 touchpad This patch introduces a driver for the PixArt PS/2 touchpad, which supports both clickpad and touchpad types. @@ -15,18 +15,18 @@ Signed-off-by: Jon Xie Co-developed-by: Jay Lee Signed-off-by: Jay Lee Signed-off-by: Binbin Zhou -Signed-off-by: Huacai Chen +Tested-by: Kexy Biscuit -Link: https://github.com/chenhuacai/linux/commit/9c1b0e8ccbb5c9530f83a129b35e9ebe9d4e7e93 +Link: https://lore.kernel.org/all/20241023083805.2164641-1-zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- drivers/input/mouse/Kconfig | 12 ++ drivers/input/mouse/Makefile | 1 + - drivers/input/mouse/pixart_ps2.c | 287 +++++++++++++++++++++++++++++ + drivers/input/mouse/pixart_ps2.c | 310 +++++++++++++++++++++++++++++ drivers/input/mouse/pixart_ps2.h | 36 ++++ drivers/input/mouse/psmouse-base.c | 17 ++ drivers/input/mouse/psmouse.h | 3 +- - 6 files changed, 355 insertions(+), 1 deletion(-) + 6 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 drivers/input/mouse/pixart_ps2.c create mode 100644 drivers/input/mouse/pixart_ps2.h @@ -67,10 +67,10 @@ index a1336d5bee6f..563029551529 100644 psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o diff --git a/drivers/input/mouse/pixart_ps2.c b/drivers/input/mouse/pixart_ps2.c new file mode 100644 -index 000000000000..3b13337f2447 +index 000000000000..d5cd00936171 --- /dev/null +++ b/drivers/input/mouse/pixart_ps2.c -@@ -0,0 +1,287 @@ +@@ -0,0 +1,310 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Pixart Touchpad Controller 1336U PS2 driver @@ -85,10 +85,12 @@ index 000000000000..3b13337f2447 + * + */ + ++#include +#include +#include -+#include ++#include +#include ++#include +#include +#include + @@ -103,7 +105,7 @@ index 000000000000..3b13337f2447 + if (error) + return error; + -+ *mode = (param[0] == 1) ? PIXART_MODE_ABS : PIXART_MODE_REL; ++ *mode = param[0] == 1 ? PIXART_MODE_ABS : PIXART_MODE_REL; + + return 0; +} @@ -167,15 +169,17 @@ index 000000000000..3b13337f2447 +{ + struct pixart_data *priv = psmouse->private; + struct input_dev *dev = psmouse->dev; -+ int i, id, fingers = 0, abs_x, abs_y; -+ u8 *pkt = psmouse->packet; -+ u8 contact_cnt = CONTACT_CNT(pkt[0]); ++ const u8 *pkt = psmouse->packet; ++ unsigned int contact_cnt = FIELD_GET(CONTACT_CNT_MASK, pkt[0]); ++ unsigned int i, id, abs_x, abs_y; + bool tip; + + for (i = 0; i < contact_cnt; i++) { -+ id = SLOT_ID_MASK(pkt[3 * i + 3]); -+ abs_y = ABS_Y_MASK(pkt[3 * i + 3]) | pkt[3 * i + 1]; -+ abs_x = ABS_X_MASK(pkt[3 * i + 3]) | pkt[3 * i + 2]; ++ const u8 *p = &pkt[i * 3]; ++ ++ id = FIELD_GET(SLOT_ID_MASK, p[3]); ++ abs_y = FIELD_GET(ABS_Y_MASK, p[3]) << 8 | p[1]; ++ abs_x = FIELD_GET(ABS_X_MASK, p[3]) << 8 | p[2]; + + if (i == PIXART_MAX_FINGERS - 1) + tip = pkt[14] & BIT(1); @@ -184,7 +188,6 @@ index 000000000000..3b13337f2447 + + input_mt_slot(dev, id); + if (input_mt_report_slot_state(dev, MT_TOOL_FINGER, tip)) { -+ fingers++; + input_report_abs(dev, ABS_MT_POSITION_Y, abs_y); + input_report_abs(dev, ABS_MT_POSITION_X, abs_x); + } @@ -193,10 +196,10 @@ index 000000000000..3b13337f2447 + input_mt_sync_frame(dev); + + if (priv->type == PIXART_TYPE_CLICKPAD) { -+ input_report_key(dev, BTN_LEFT, pkt[0] & 0x3); ++ input_report_key(dev, BTN_LEFT, pkt[0] & 0x03); + } else { -+ input_report_key(dev, BTN_LEFT, pkt[0] & 0x1); -+ input_report_key(dev, BTN_RIGHT, pkt[0] & 0x2); ++ input_report_key(dev, BTN_LEFT, pkt[0] & BIT(0)); ++ input_report_key(dev, BTN_RIGHT, pkt[0] & BIT(1)); + } + + input_sync(dev); @@ -205,18 +208,24 @@ index 000000000000..3b13337f2447 +static psmouse_ret_t pixart_protocol_handler(struct psmouse *psmouse) +{ + u8 *pkt = psmouse->packet; -+ u8 contact_cnt = CONTACT_CNT(pkt[0]); ++ u8 contact_cnt; ++ ++ if ((pkt[0] & 0x8c) != 0x80) ++ return PSMOUSE_BAD_DATA; + -+ if (contact_cnt > PIXART_MAX_FINGERS || ((pkt[0] & 0x8c) != 0x80)) ++ contact_cnt = FIELD_GET(CONTACT_CNT_MASK, pkt[0]); ++ if (contact_cnt > PIXART_MAX_FINGERS) + return PSMOUSE_BAD_DATA; + -+ if (contact_cnt == PIXART_MAX_FINGERS && psmouse->pktcnt < psmouse->pktsize) ++ if (contact_cnt == PIXART_MAX_FINGERS && ++ psmouse->pktcnt < psmouse->pktsize) { + return PSMOUSE_GOOD_DATA; ++ } + + if (contact_cnt == 0 && psmouse->pktcnt < 5) + return PSMOUSE_GOOD_DATA; + -+ if (psmouse->pktcnt < (3 * contact_cnt + 2)) ++ if (psmouse->pktcnt < 3 * contact_cnt + 2) + return PSMOUSE_GOOD_DATA; + + pixart_process_packet(psmouse); @@ -233,22 +242,28 @@ index 000000000000..3b13337f2447 + +static int pixart_reconnect(struct psmouse *psmouse) +{ ++ struct ps2dev *ps2dev = &psmouse->ps2dev; + u8 mode; + int error; -+ struct ps2dev *ps2dev = &psmouse->ps2dev; + + pixart_reset(psmouse); ++ + error = pixart_read_tp_mode(ps2dev, &mode); + if (error) + return error; + + if (mode != PIXART_MODE_ABS) -+ return mode; ++ return -EIO; + -+ return ps2_command(ps2dev, NULL, PIXART_CMD_SWITCH_PROTO); ++ error = ps2_command(ps2dev, NULL, PIXART_CMD_SWITCH_PROTO); ++ if (error) ++ return error; ++ ++ return 0; +} + -+static int pixart_set_input_params(struct input_dev *dev, struct pixart_data *priv) ++static int pixart_set_input_params(struct input_dev *dev, ++ struct pixart_data *priv) +{ + /* No relative support */ + __clear_bit(EV_REL, dev->evbit); @@ -268,10 +283,12 @@ index 000000000000..3b13337f2447 + input_set_abs_params(dev, ABS_X, 0, PIXART_PAD_WIDTH, 0, 0); + input_set_abs_params(dev, ABS_Y, 0, PIXART_PAD_HEIGHT, 0, 0); + -+ input_set_abs_params(dev, ABS_MT_POSITION_X, 0, PIXART_PAD_WIDTH, 0, 0); -+ input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, PIXART_PAD_HEIGHT, 0, 0); ++ input_set_abs_params(dev, ABS_MT_POSITION_X, ++ 0, PIXART_PAD_WIDTH, 0, 0); ++ input_set_abs_params(dev, ABS_MT_POSITION_Y, ++ 0, PIXART_PAD_HEIGHT, 0, 0); + -+ return input_mt_init_slots(dev, PIXART_SLOTS_NUM, ++ return input_mt_init_slots(dev, PIXART_MAX_FINGERS, + INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED); +} + @@ -283,7 +300,11 @@ index 000000000000..3b13337f2447 + if (error) + return error; + -+ return pixart_read_tp_mode(ps2dev, mode); ++ error = pixart_read_tp_mode(ps2dev, mode); ++ if (error) ++ return error; ++ ++ return 0; +} + +int pixart_detect(struct psmouse *psmouse, bool set_properties) @@ -292,6 +313,7 @@ index 000000000000..3b13337f2447 + int error; + + pixart_reset(psmouse); ++ + error = pixart_read_tp_type(&psmouse->ps2dev, &type); + if (error) + return error; @@ -317,7 +339,8 @@ index 000000000000..3b13337f2447 + psmouse->private = priv; + pixart_reset(psmouse); + -+ error = pixart_query_hardware(&psmouse->ps2dev, &priv->mode, &priv->type); ++ error = pixart_query_hardware(&psmouse->ps2dev, ++ &priv->mode, &priv->type); + if (error) { + psmouse_err(psmouse, "init: Unable to query PixArt touchpad hardware.\n"); + goto err_exit; @@ -360,7 +383,7 @@ index 000000000000..3b13337f2447 +} diff --git a/drivers/input/mouse/pixart_ps2.h b/drivers/input/mouse/pixart_ps2.h new file mode 100644 -index 000000000000..ecc0f715b291 +index 000000000000..47a1d040f2d1 --- /dev/null +++ b/drivers/input/mouse/pixart_ps2.h @@ -0,0 +1,36 @@ @@ -370,24 +393,24 @@ index 000000000000..ecc0f715b291 + +#include "psmouse.h" + -+#define PIXART_PAD_WIDTH 1023 -+#define PIXART_PAD_HEIGHT 579 -+#define PIXART_MAX_FINGERS 4 -+#define PIXART_SLOTS_NUM PIXART_MAX_FINGERS ++#define PIXART_PAD_WIDTH 1023 ++#define PIXART_PAD_HEIGHT 579 ++#define PIXART_MAX_FINGERS 4 + +#define PIXART_CMD_REPORT_FORMAT 0x01d8 +#define PIXART_CMD_SWITCH_PROTO 0x00de + -+#define PIXART_MODE_REL 0 -+#define PIXART_MODE_ABS 1 ++#define PIXART_MODE_REL 0 ++#define PIXART_MODE_ABS 1 ++ ++#define PIXART_TYPE_CLICKPAD 0 ++#define PIXART_TYPE_TOUCHPAD 1 + -+#define PIXART_TYPE_CLICKPAD 0 -+#define PIXART_TYPE_TOUCHPAD 1 ++#define CONTACT_CNT_MASK GENMASK(6, 4) + -+#define CONTACT_CNT(m) (((m) & GENMASK(6, 4)) >> 4) -+#define SLOT_ID_MASK(m) ((m) & GENMASK(2, 0)) -+#define ABS_Y_MASK(m) (((m) & GENMASK(5, 4)) << 4) -+#define ABS_X_MASK(m) (((m) & GENMASK(7, 6)) << 2) ++#define SLOT_ID_MASK GENMASK(2, 0) ++#define ABS_Y_MASK GENMASK(5, 4) ++#define ABS_X_MASK GENMASK(7, 6) + +struct pixart_data { + u8 mode; diff --git a/app-admin/kernel-tools/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch b/app-admin/kernel-tools/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch new file mode 100644 index 00000000000..212b37ea307 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch @@ -0,0 +1,104 @@ +From c9403716a755233a051230515b4933ab4ee511ed Mon Sep 17 00:00:00 2001 +From: Mingcong Bai +Date: Fri, 8 Nov 2024 20:08:21 +0800 +Subject: [PATCH 085/155] FROMLIST: iommu: intel: apply quirk_iommu_igfx for + 8086:0044 (QM57/QS57) + +(I'm not very confident about the approach of this patch but I failed to +find a better way to address the issue I have on hand, so please consider +this patch as an RFC...) + +On the Lenovo ThinkPad X201, when Intel VT-d is enabled in the BIOS, the +kernel boots with errors related to DMAR, the graphical interface appeared +quite choppy, and the system resets erratically within a minute after it +booted: + +DMAR: DRHD: handling fault status reg 3 +DMAR: [DMA Write NO_PASID] Request device [00:02.0] fault addr 0xb97ff000 +[fault reason 0x05] PTE Write access is not set + +Upon comparing boot logs with VT-d on/off, I found that the Intel Calpella +quirk (`quirk_calpella_no_shadow_gtt()') correctly applied the igfx IOMMU +disable/quirk correctly: + +pci 0000:00:00.0: DMAR: BIOS has allocated no shadow GTT; disabling IOMMU +for graphics + +Whereas with VT-d on, it went into the "else" branch, which then +triggered the DMAR handling fault above: + +... else if (!disable_igfx_iommu) { + /* we have to ensure the gfx device is idle before we flush */ + pci_info(dev, "Disabling batched IOTLB flush on Ironlake\n"); + iommu_set_dma_strict(); +} + +Now, this is not exactly scientific, but moving 0x0044 to quirk_iommu_igfx +seems to have fixed the aforementioned issue. Running a few `git blame' +runs on the function, I have found that the quirk was originally +introduced as a fix specific to ThinkPad X201: + +commit 9eecabcb9a92 ("intel-iommu: Abort IOMMU setup for igfx if BIOS gave +no shadow GTT space") + +Which was later revised twice to the "else" branch we saw above: + +- 2011: commit 6fbcfb3e467a ("intel-iommu: Workaround IOTLB hang on + Ironlake GPU") +- 2024: commit ba00196ca41c ("iommu/vt-d: Decouple igfx_off from graphic + identity mapping") + +I'm uncertain whether further testings on this particular laptops were +done in 2011 and (honestly I'm not sure) 2024, but I would be happy to do +some distro-specific testing if that's what would be required to verify +this patch. + +P.S., I also see IDs 0x0040, 0x0062, and 0x006a listed under the same +`quirk_calpella_no_shadow_gtt()' quirk, but I'm not sure how similar these +chipsets are (if they share the same issue with VT-d or even, indeed, if +this issue is specific to a bug in the Lenovo BIOS). With regards to +0x0062, it seems to be a Centrino wireless card, but not a chipset? + +I have also listed a couple (distro and kernel) bug reports below as +references (some of them are from 7-8 years ago!), as they seem to be +similar issue found on different Westmere/Ironlake, Haswell, and Broadwell +hardware setups. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=197029 +Link: https://groups.google.com/g/qubes-users/c/4NP4goUds2c?pli=1 +Link: https://bugs.archlinux.org/task/65362 +Link: https://bbs.archlinux.org/viewtopic.php?id=230323 +Reported-by: Wenhao Sun +Signed-off-by: Mingcong Bai + +Link: https://lore.kernel.org/linux-iommu/20241108120838.495931-1-jeffbai@aosc.io/ +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index dda6dea7cce0..8d28ecd0a640 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -4710,6 +4710,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_igfx); + ++/* QM57/QS57 integrated gfx malfunctions with dmar */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_iommu_igfx); ++ + /* Broadwell igfx malfunctions with dmar */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1606, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x160B, quirk_iommu_igfx); +@@ -4787,7 +4790,6 @@ static void quirk_calpella_no_shadow_gtt(struct pci_dev *dev) + } + } + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); +-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); + +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch b/app-admin/kernel-tools/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch new file mode 100644 index 00000000000..ebe8bb44669 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch @@ -0,0 +1,58 @@ +From 21489b13fc9e4d628f6067b0eaa7b27db6f0b912 Mon Sep 17 00:00:00 2001 +From: Arunpravin Paneer Selvam +Date: Mon, 11 Nov 2024 13:35:24 +0530 +Subject: [PATCH 086/155] FROMLIST: drm/amdgpu: Fix UVD contiguous CS mapping + problem + +When starting the mpv player, Radeon R9 users are observing +the below error in dmesg. + +[drm:amdgpu_uvd_cs_pass2 [amdgpu]] +*ERROR* msg/fb buffer ff00f7c000-ff00f7e000 out of 256MB segment! + +The patch tries to set the TTM_PL_FLAG_CONTIGUOUS for both user +flag(AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) set and not set cases. + +Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3599 +Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3501 +Signed-off-by: Arunpravin Paneer Selvam +Cc: stable@vger.kernel.org + +Link: https://lore.kernel.org/all/20241111080524.353192-1-Arunpravin.PaneerSelvam@amd.com/ +Signed-off-by: Kexy Biscuit +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +index a95811da242b..40aa2781e237 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +@@ -1800,13 +1800,17 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, + if (dma_resv_locking_ctx((*bo)->tbo.base.resv) != &parser->exec.ticket) + return -EINVAL; + +- (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; +- amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); +- for (i = 0; i < (*bo)->placement.num_placement; i++) +- (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; +- r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); +- if (r) +- return r; ++ if ((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) { ++ (*bo)->placements[0].flags |= TTM_PL_FLAG_CONTIGUOUS; ++ } else { ++ (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; ++ amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); ++ for (i = 0; i < (*bo)->placement.num_placement; i++) ++ (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; ++ r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); ++ if (r) ++ return r; ++ } + + return amdgpu_ttm_alloc_gart(&(*bo)->tbo); + } +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch b/app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch rename to app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch index 2899f299a7d..6ae62e7b869 100644 --- a/app-admin/kernel-tools/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch +++ b/app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch @@ -1,7 +1,7 @@ -From 6e5b814ca59f112c86bf555d88dad52c31c691aa Mon Sep 17 00:00:00 2001 +From fbbc66ea1f6d146b1b3fde57aaa6f33145be1e29 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:34:22 +0800 -Subject: [PATCH 085/136] BACKPORT: PHYTIUM: net: stmmac: Add Phytium GMAC glue +Subject: [PATCH 087/155] BACKPORT: PHYTIUM: net: stmmac: Add Phytium GMAC glue layer This patch adds support for Phytium GMAC controller which derived from @@ -26,7 +26,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c diff --git a/MAINTAINERS b/MAINTAINERS -index 99b339474f37..9c59a656441b 100644 +index c253fb9926e4..2d6be32480f3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2702,6 +2702,12 @@ S: Maintained diff --git a/app-admin/kernel-tools/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch b/app-admin/kernel-tools/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch rename to app-admin/kernel-tools/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch index f4eba2edd09..c8997b95977 100644 --- a/app-admin/kernel-tools/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch +++ b/app-admin/kernel-tools/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch @@ -1,7 +1,7 @@ -From 9bc3ebd2754056504e861a37c8915b1d350adf64 Mon Sep 17 00:00:00 2001 +From fc401aa5a88b771235346cfe38e7013ff12f4217 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 20 Oct 2023 18:55:20 +0800 -Subject: [PATCH 086/136] PHYTIUM: net: stmmac: Add a barrier to make sure all +Subject: [PATCH 088/155] PHYTIUM: net: stmmac: Add a barrier to make sure all access coherent Add a memory barrier to sync TX descriptor to avoid data error. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch b/app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch rename to app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch index 7590ade943c..57414cc3172 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch +++ b/app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch @@ -1,7 +1,7 @@ -From f3bc1bf4fac7a1fd159b3fb4bebc04d9a7684d9d Mon Sep 17 00:00:00 2001 +From 28f2f5f2f921808a4c4c4fa729b07353630557d6 Mon Sep 17 00:00:00 2001 From: zuoqian Date: Tue, 23 Jan 2024 09:24:03 +0800 -Subject: [PATCH 087/136] BACKPORT: PHYTIUM: drivers: fix build errors +Subject: [PATCH 089/155] BACKPORT: PHYTIUM: drivers: fix build errors 1. spi: Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS 82238 2. net: stmmac: clarify difference between "interface" and "phy_interface" a014c3555 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch b/app-admin/kernel-tools/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch similarity index 88% rename from runtime-kernel/linux-kernel/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch rename to app-admin/kernel-tools/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch index ecc754dcff0..d49ec3e93b4 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch +++ b/app-admin/kernel-tools/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch @@ -1,7 +1,7 @@ -From fa04fa68e76770ec032a3efda676f941f5dc4a05 Mon Sep 17 00:00:00 2001 +From 02e416726ab14ff779f81725b04f35319c605972 Mon Sep 17 00:00:00 2001 From: liutianyu1250 Date: Mon, 5 Feb 2024 09:52:51 +0800 -Subject: [PATCH 088/136] BACKPORT: PHYTIUM: Update phytium copyright info to +Subject: [PATCH 090/155] BACKPORT: PHYTIUM: Update phytium copyright info to 2024 Signed-off-by: liutianyu1250 diff --git a/app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch b/app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch rename to app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch index aa60056026d..b368ca51698 100644 --- a/app-admin/kernel-tools/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch +++ b/app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch @@ -1,7 +1,7 @@ -From 2602130f086e5dfff665d7cc859327947dd19a51 Mon Sep 17 00:00:00 2001 +From fbda7dca83853f66d23c78e9047a9eca32afec0d Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Mon, 25 Mar 2024 17:38:27 +0800 -Subject: [PATCH 089/136] BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC +Subject: [PATCH 091/155] BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC driver support v2 Modify stmmmac driver to support phytium DWMAC controler. @@ -20,7 +20,7 @@ Signed-off-by: Kexy Biscuit 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS -index 9c59a656441b..2fad0518cf89 100644 +index 2d6be32480f3..cb134e4c6791 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2702,12 +2702,6 @@ S: Maintained @@ -36,7 +36,7 @@ index 9c59a656441b..2fad0518cf89 100644 ARM/QUALCOMM CHROMEBOOK SUPPORT R: cros-qcom-dts-watchers@chromium.org F: arch/arm64/boot/dts/qcom/sc7180* -@@ -18595,6 +18589,12 @@ F: include/sound/pxa2xx-lib.h +@@ -18600,6 +18594,12 @@ F: include/sound/pxa2xx-lib.h F: sound/arm/pxa* F: sound/soc/pxa/ diff --git a/app-admin/kernel-tools/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch b/app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch rename to app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch index aded3f36927..b48852e5787 100644 --- a/app-admin/kernel-tools/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch +++ b/app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch @@ -1,7 +1,7 @@ -From 02f4e9d1cc44d8109c85edc2157cd6af415b25d3 Mon Sep 17 00:00:00 2001 +From 9135f791529961ab447935952f556166aa58a457 Mon Sep 17 00:00:00 2001 From: liutianyu1250 Date: Thu, 13 Jun 2024 17:50:28 +0800 -Subject: [PATCH 090/136] PHYTIUM: net: stmmac: phytium driver add pm support +Subject: [PATCH 092/155] PHYTIUM: net: stmmac: phytium driver add pm support Test S3 with net device open will got this cut log. ... diff --git a/app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch b/app-admin/kernel-tools/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch rename to app-admin/kernel-tools/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch index 56e877adc64..b3cc377bafc 100644 --- a/app-admin/kernel-tools/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch +++ b/app-admin/kernel-tools/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch @@ -1,7 +1,7 @@ -From d88143030909c38106cc68bad48c972155cb2271 Mon Sep 17 00:00:00 2001 +From b8199701ffc4225a64a1a1249fd3ccda688a6e6b Mon Sep 17 00:00:00 2001 From: Song Wenting Date: Mon, 25 Mar 2024 13:55:20 +0800 -Subject: [PATCH 091/136] BACKPORT: PHYTIUM: net: phytium: Add support for +Subject: [PATCH 093/155] BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC This patch provides support for Phytium GMAC controller driver. @@ -47,10 +47,10 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/net/ethernet/phytium/phytmac_v2.h diff --git a/MAINTAINERS b/MAINTAINERS -index 2fad0518cf89..e0137c469987 100644 +index cb134e4c6791..672ebe2bd043 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -18593,6 +18593,9 @@ ARM/PHYTIUM SOC SUPPORT +@@ -18598,6 +18598,9 @@ ARM/PHYTIUM SOC SUPPORT M: Wang Yinfeng S: Maintained W: https://www.phytium.com.cn diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch b/app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch rename to app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch index 81c3df6055e..9da18155387 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch +++ b/app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch @@ -1,7 +1,7 @@ -From ab9e33756688d4a74b4731cd6a5e0491abc34824 Mon Sep 17 00:00:00 2001 +From b29fc12fae69a5f1be0bccae3c917b2e04b3dfdc Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:45:04 +0800 -Subject: [PATCH 092/136] PHYTIUM: net/phytmac: Bugfixed the MDIO registration +Subject: [PATCH 094/155] PHYTIUM: net/phytmac: Bugfixed the MDIO registration failures When MDIO registration fails, it will double free netdev, diff --git a/app-admin/kernel-tools/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch b/app-admin/kernel-tools/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch similarity index 91% rename from app-admin/kernel-tools/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch rename to app-admin/kernel-tools/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch index 411f35eba46..edbdfdc8ab3 100644 --- a/app-admin/kernel-tools/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch +++ b/app-admin/kernel-tools/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch @@ -1,7 +1,7 @@ -From 74ea024936fdc76da60c3e227f1faa5a516125fc Mon Sep 17 00:00:00 2001 +From 9ba49dedc370b130da29aac5fe27ead2936064c0 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:46:54 +0800 -Subject: [PATCH 093/136] PHYTIUM: net/phytmac: Fixed the issue of pxe startup +Subject: [PATCH 095/155] PHYTIUM: net/phytmac: Fixed the issue of pxe startup failure. When network driver supports broadcast mode, no_broadcast bit of the diff --git a/app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch b/app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch rename to app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch index 56a8b6291f0..a0ecc1fe97d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch +++ b/app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch @@ -1,7 +1,7 @@ -From bdc1e54660361fe138d2c97d2eb84f6082f5be77 Mon Sep 17 00:00:00 2001 +From a8b6eba61eac9bd1e8b32698455cfd3a58e801b2 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:49:17 +0800 -Subject: [PATCH 094/136] PHYTIUM: net/phytmac: Adapt interface type 1000BASE-x +Subject: [PATCH 096/155] PHYTIUM: net/phytmac: Adapt interface type 1000BASE-x Added 1000BASE-x interface type support for phymac driver. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch b/app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch rename to app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch index c0355ee1ac0..6faf8971561 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch +++ b/app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch @@ -1,7 +1,7 @@ -From 5de2d4d68b1a4976252d860fbc0224738a3c1021 Mon Sep 17 00:00:00 2001 +From c1bca32d6e86f92daffd836b2140de259cae2e00 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:33:58 +0800 -Subject: [PATCH 095/136] BACKPORT: PHYTIUM: arm64: phytium: Add support for +Subject: [PATCH 097/155] BACKPORT: PHYTIUM: arm64: phytium: Add support for Phytium SoC family This patch adds supoort for the Phytium SoC family. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch b/app-admin/kernel-tools/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch similarity index 86% rename from runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch rename to app-admin/kernel-tools/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch index c940444e293..acbde17e70d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch +++ b/app-admin/kernel-tools/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch @@ -1,7 +1,7 @@ -From 373cecd9a655e6c5d247d5edd72181313c5df510 Mon Sep 17 00:00:00 2001 +From 2102c1b61f23a5278ac81b767c0c4e87eaec4141 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:33:59 +0800 -Subject: [PATCH 096/136] PHYTIUM: PCI: Add Phytium vendor ID +Subject: [PATCH 098/155] PHYTIUM: PCI: Add Phytium vendor ID Update pci_ids.h with the vendor ID for Phytium. diff --git a/app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch b/app-admin/kernel-tools/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch rename to app-admin/kernel-tools/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch index 83f13a50fd4..d47b0278b00 100644 --- a/app-admin/kernel-tools/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch +++ b/app-admin/kernel-tools/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch @@ -1,7 +1,7 @@ -From 85a9104b713efba1be7b3020dcf812a97e770719 Mon Sep 17 00:00:00 2001 +From cc03b7281b1a96e502ed0a435e57f2cb83269cbd Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 17 Jul 2024 18:25:37 +0800 -Subject: [PATCH 097/136] BACKPORT: DEEPIN: ethernet: Add motorcomm yt6801 +Subject: [PATCH 099/155] BACKPORT: DEEPIN: ethernet: Add motorcomm yt6801 support - The Asus XC-LS3A6M motherboard(Loongson 3A6000),CE720Z2,CE720Z... uses diff --git a/app-admin/kernel-tools/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch b/app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch rename to app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch index 2612515c88c..9dc7708a762 100644 --- a/app-admin/kernel-tools/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch +++ b/app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch @@ -1,7 +1,7 @@ -From d31707bf8b1076bdb38c0d9e5147f7cc4c957430 Mon Sep 17 00:00:00 2001 +From db5fc1967e1b429452ae54297f8e63a9e95979aa Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Jul 2024 11:00:20 +0800 -Subject: [PATCH 098/136] DEEPIN: ethernet: yt6801: fix build on >= 6.8 +Subject: [PATCH 100/155] DEEPIN: ethernet: yt6801: fix build on >= 6.8 Adapt to ethtool.h changes introduced in 6.8. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch b/app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch rename to app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch index c06ff2c1540..fb5ff46efd7 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch +++ b/app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch @@ -1,7 +1,7 @@ -From d92b6da964522e104b8f83caab369152efe70b3f Mon Sep 17 00:00:00 2001 +From 6db57299ca1004b74bfc829e1fd1cb686ca5c119 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Thu, 27 Jun 2024 14:37:53 +0800 -Subject: [PATCH 099/136] DEEPIN: net: stmmac: fix dwmac-phytium build on 6.9 +Subject: [PATCH 101/155] DEEPIN: net: stmmac: fix dwmac-phytium build on 6.9 Declare phytium_dwmac_remove() as a static function to resolve a missing prototype warning. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch b/app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch similarity index 89% rename from runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch rename to app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch index 4fc18a4ecfd..122295fc129 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch +++ b/app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch @@ -1,7 +1,7 @@ -From 95b173b2c5af446bb394c0f8150c0fc7298a6fe5 Mon Sep 17 00:00:00 2001 +From 9eacc38185fdcb3edc40f99d94df4bc62d040a09 Mon Sep 17 00:00:00 2001 From: Wentao Guan Date: Wed, 8 May 2024 18:11:37 +0800 -Subject: [PATCH 100/136] DEEPIN: net/stmmac: Add phytium old dwmac +Subject: [PATCH 102/155] DEEPIN: net/stmmac: Add phytium old dwmac acpi_device_id As Phytium ACPI Description Specification document v1.2 p13 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch b/app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch similarity index 92% rename from runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch rename to app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch index c0c5faf6a58..ef4f2fba9b3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch +++ b/app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch @@ -1,7 +1,7 @@ -From c11355aa0a6d765b614ae5d34906634c155a86dd Mon Sep 17 00:00:00 2001 +From 71d9452216a694523674411523f5f5b11e9c7916 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Mon, 27 May 2024 10:20:21 +0800 -Subject: [PATCH 101/136] DEEPIN: net: stmmac: fix potential double free of dma +Subject: [PATCH 103/155] DEEPIN: net: stmmac: fix potential double free of dma descriptor resources reset the dma descriptor related resource's pointer to NULL,otherwise @@ -30,7 +30,7 @@ Signed-off-by: Kexy Biscuit 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index d9fca8d1227c..14c2d0fa879a 100644 +index 88b3179dac9f..ebe76db47ac7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1930,13 +1930,18 @@ static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, diff --git a/app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch b/app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch similarity index 88% rename from app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch rename to app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch index 57d5861704c..a253f46bf62 100644 --- a/app-admin/kernel-tools/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch @@ -1,7 +1,7 @@ -From 7e80e0b23298c8c2213645abf2c10122b7383b59 Mon Sep 17 00:00:00 2001 +From 21264ccf795a846e653d7e42a7947ec72b54a741 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 11:45:05 +0800 -Subject: [PATCH 102/136] DEEPIN: net: ethernet: phytium: fix phytmac_platform +Subject: [PATCH 104/155] DEEPIN: net: ethernet: phytium: fix phytmac_platform on 6.9 Add missing include. diff --git a/app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch b/app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch rename to app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch index ab2dd5d0a64..9b2751bd122 100644 --- a/app-admin/kernel-tools/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch +++ b/app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch @@ -1,7 +1,7 @@ -From a77a4cc9b0d9cfc9dc88f1a689154eddd7fec9c9 Mon Sep 17 00:00:00 2001 +From 4e90a53f7554de6d7ea992c4d91fcd9b0472f985 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 14:08:40 +0800 -Subject: [PATCH 103/136] DEEPIN: net: ethernet: fix phytmac on 6.9 +Subject: [PATCH 105/155] DEEPIN: net: ethernet: fix phytmac on 6.9 Declare multiple functions as static functions to suppress warnings about missing prototypes. diff --git a/app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch b/app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch similarity index 92% rename from app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch rename to app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch index e6f011df07f..60eacb7b3fa 100644 --- a/app-admin/kernel-tools/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch +++ b/app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch @@ -1,7 +1,7 @@ -From f632a1e7800733cd6ebce7b4517ed86cd9d85e51 Mon Sep 17 00:00:00 2001 +From 51ec0391b3109c64deca69392be9307df20ea32e Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 16:23:20 +0800 -Subject: [PATCH 104/136] DEEPIN: net: ethernet: phytium: add a missing +Subject: [PATCH 106/155] DEEPIN: net: ethernet: phytium: add a missing declaration for *np MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch b/app-admin/kernel-tools/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch rename to app-admin/kernel-tools/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch index 7145e42afe2..eccf97f5b92 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch +++ b/app-admin/kernel-tools/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch @@ -1,7 +1,7 @@ -From cbe420a0a50c5cd00bb5ca464807f99b1af338b4 Mon Sep 17 00:00:00 2001 +From c195bef311878bc76d812f6fc9c273e80afd8a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=98=E6=80=80?= Date: Wed, 3 Jul 2024 03:13:45 +0000 -Subject: [PATCH 105/136] DEEPIN: net: phytium: convert and remove validate() +Subject: [PATCH 107/155] DEEPIN: net: phytium: convert and remove validate() references Populate the supported interfaces bitmap and MAC capabilities mask for diff --git a/app-admin/kernel-tools/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch b/app-admin/kernel-tools/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch new file mode 100644 index 00000000000..4d703453a3a --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch @@ -0,0 +1,76 @@ +From 65eb0e523518ca635f80a21d03905ff84672a2de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=BF=98=E6=80=80?= +Date: Tue, 9 Jul 2024 17:17:48 +0800 +Subject: [PATCH 108/155] DEEPIN: net: stmmac: dwmac-phytium: compat some + FT2000 + +Compat with some quirk platform FT2000/4 as id "FTGM0001", +use rgmii-rxid instead of rgmii (wrong ACPI DSDT), +and set dma_ops and host_dma_width (fix code style). + +origin code in k4.19 is following: +acpi_dma_configure(priv->device,DEV_DMA_COHERENT); +static u64 my_mask=0xffffffff; +priv->device->dma_mask = &my_mask; +priv->device->coherent_dma_mask = (u32)~0; +port to k5.10 add: +pdev->dev.dma_ops = NULL; + +Signed-off-by: Caicai +Signed-off-by: hmy +Signed-off-by: wenlunpeng +Signed-off-by: Wentao Guan + +Link: https://github.com/deepin-community/kernel-rolling/commit/36f000a9a3f2de52de835ef16e6bc4e562436e4e +Link: https://github.com/deepin-community/kernel/commit/9d9917cb0ff2aad860b72c28db34c638c5a61a92 +Signed-off-by: Kexy Biscuit +--- + .../ethernet/stmicro/stmmac/dwmac-phytium.c | 25 ++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +index dd4171a39a4a..eea842195513 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +@@ -68,6 +68,21 @@ static int phytium_dwmac_probe(struct platform_device *pdev) + return -ENOMEM; + + plat->phy_interface = device_get_phy_mode(&pdev->dev); ++#ifdef CONFIG_ACPI ++ static const struct acpi_device_id phytium_old_acpi_id[] = { ++ { .id = "FTGM0001" }, // compat FT2000/4 id ++ { } ++ }; ++ /* "phy-mode" in phytium platform DSDT is not correct in some old device. ++ * Force this PHY mode to rgmii-rxid and info of its use. ++ * If the phy-mode rgmii is realy used, a blacklist may need to be added. ++ */ ++ if (acpi_match_device_ids(to_acpi_device(&pdev->dev), phytium_old_acpi_id) && ++ plat->phy_interface == PHY_INTERFACE_MODE_RGMII) { ++ plat->phy_interface = PHY_INTERFACE_MODE_RGMII_RXID; ++ dev_info(&pdev->dev, "phytium workaround: phy-mode from rgmii to rgmii-rxid\n"); ++ } ++#endif + if (plat->phy_interface < 0) + return plat->phy_interface; + +@@ -156,7 +171,15 @@ static int phytium_dwmac_probe(struct platform_device *pdev) + plat->dma_cfg->aal = fwnode_property_read_bool(fwnode, "snps,aal"); + plat->dma_cfg->fixed_burst = fwnode_property_read_bool(fwnode, "snps,fixed-burst"); + plat->dma_cfg->mixed_burst = fwnode_property_read_bool(fwnode, "snps,mixed-burst"); +- ++#ifdef CONFIG_ACPI ++ /* Some old phytium 2000/4 FTGM0001 cannot auto deferred stmmac DMA settings ++ * show kernel error 'DMA descriptors allocation failed' ++ */ ++ if (acpi_match_device_ids(to_acpi_device(&pdev->dev), phytium_old_acpi_id)) { ++ pdev->dev.dma_ops = NULL; // solved set DMA mask Failed ++ plat->host_dma_width = 32; ++ } ++#endif + plat->axi->axi_lpi_en = false; + plat->axi->axi_xit_frm = false; + plat->axi->axi_wr_osr_lmt = 7; +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch b/app-admin/kernel-tools/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch similarity index 93% rename from app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch rename to app-admin/kernel-tools/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch index 81f36f636b3..39823085642 100644 --- a/app-admin/kernel-tools/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch @@ -1,7 +1,7 @@ -From 68e99204f671a814a3caca6bb4ac4cf125d98063 Mon Sep 17 00:00:00 2001 +From c84bb9fac697cd96bb31f4b8322cab0250b56713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=98=E6=80=80?= Date: Tue, 24 Sep 2024 07:10:32 +0000 -Subject: [PATCH 106/136] DEEPIN: HID: multitouch: Add quirk for HONOR +Subject: [PATCH 109/155] DEEPIN: HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch b/app-admin/kernel-tools/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch similarity index 77% rename from runtime-kernel/linux-kernel/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch rename to app-admin/kernel-tools/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch index 146469ebf0d..5a59ca25561 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch +++ b/app-admin/kernel-tools/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch @@ -1,13 +1,13 @@ -From 2e74054b1310488753564daa0e3ec6e4bc9dafde Mon Sep 17 00:00:00 2001 +From b60d6bb1ec2fb737e6bd7fc520257bbfb9fead4e Mon Sep 17 00:00:00 2001 From: Ayufan Date: Sun, 30 Dec 2018 13:32:47 +0100 -Subject: [PATCH 107/136] ARMBIAN: ayufan: dts: rockpro64: change rx_delay for +Subject: [PATCH 110/155] ARMBIAN: ayufan: dts: rockpro64: change rx_delay for gmac Change-Id: Ib3899f684188aa1ed1545717af004bba53fe0e07 Signed-off-by: Ayufan -Link: https://github.com/armbian/build/blob/1c79daddc01c08508a78943b376bdc71c431d8b5/patch/kernel/archive/rockchip64-6.11/board-rockpro64-change-rx_delay-for-gmac.patch +Link: https://github.com/armbian/build/blob/8db8e198e32f8069af97426ca6986ff9d7bf9801/patch/kernel/archive/rockchip64-6.12/board-rockpro64-change-rx_delay-for-gmac.patch Signed-off-by: Kexy Biscuit --- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi | 2 +- diff --git a/app-admin/kernel-tools/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch b/app-admin/kernel-tools/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch new file mode 100644 index 00000000000..e95b6735eaa --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch @@ -0,0 +1,174 @@ +From ae8aae78b51e51e24ba532a02e01599d463d6baa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= +Date: Tue, 3 Nov 2020 13:28:04 +0100 +Subject: [PATCH 111/155] SURFACE: mwifiex: Add quirk resetting the PCI bridge + on MS Surface devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The most recent firmware of the 88W8897 card reports a hardcoded LTR +value to the system during initialization, probably as an (unsuccessful) +attempt of the developers to fix firmware crashes. This LTR value +prevents most of the Microsoft Surface devices from entering deep +powersaving states (either platform C-State 10 or S0ix state), because +the exit latency of that state would be higher than what the card can +tolerate. + +Turns out the card works just the same (including the firmware crashes) +no matter if that hardcoded LTR value is reported or not, so it's kind +of useless and only prevents us from saving power. + +To get rid of those hardcoded LTR reports, it's possible to reset the +PCI bridge device after initializing the cards firmware. I'm not exactly +sure why that works, maybe the power management subsystem of the PCH +resets its stored LTR values when doing a function level reset of the +bridge device. Doing the reset once after starting the wifi firmware +works very well, probably because the firmware only reports that LTR +value a single time during firmware startup. + +Patchset: mwifiex + +Signed-off-by: Jonas Dreßler +Link: https://github.com/linux-surface/kernel/commit/d3dce7daa7c9b02fffc26ab4b001dd28bacc0354 +Signed-off-by: Kexy Biscuit +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 12 +++++++++ + .../wireless/marvell/mwifiex/pcie_quirks.c | 26 +++++++++++++------ + .../wireless/marvell/mwifiex/pcie_quirks.h | 1 + + 3 files changed, 31 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index 5f997becdbaa..9a9929424513 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -1702,9 +1702,21 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb) + static void mwifiex_pcie_init_fw_port(struct mwifiex_adapter *adapter) + { + struct pcie_service_card *card = adapter->card; ++ struct pci_dev *pdev = card->dev; ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; + int tx_wrap = card->txbd_wrptr & reg->tx_wrap_mask; + ++ /* Trigger a function level reset of the PCI bridge device, this makes ++ * the firmware of PCIe 88W8897 cards stop reporting a fixed LTR value ++ * that prevents the system from entering package C10 and S0ix powersaving ++ * states. ++ * We need to do it here because it must happen after firmware ++ * initialization and this function is called after that is done. ++ */ ++ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) ++ pci_reset_function(parent_pdev); ++ + /* Write the RX ring read pointer in to reg->rx_rdptr */ + mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr | tx_wrap); + } +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +index dd6d21f1dbfd..f46b06f8d643 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +@@ -13,7 +13,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 5", +@@ -22,7 +23,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 5 (LTE)", +@@ -31,7 +33,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 6", +@@ -39,7 +42,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Book 1", +@@ -47,7 +51,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Book 2", +@@ -55,7 +60,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Laptop 1", +@@ -63,7 +69,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Laptop 2", +@@ -71,7 +78,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + {} + }; +@@ -89,6 +97,8 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card) + dev_info(&pdev->dev, "no quirks enabled\n"); + if (card->quirks & QUIRK_FW_RST_D3COLD) + dev_info(&pdev->dev, "quirk reset_d3cold enabled\n"); ++ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) ++ dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n"); + } + + static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev) +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +index d6ff964aec5b..5d30ae39d65e 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +@@ -4,6 +4,7 @@ + #include "pcie.h" + + #define QUIRK_FW_RST_D3COLD BIT(0) ++#define QUIRK_DO_FLR_ON_BRIDGE BIT(1) + + void mwifiex_initialize_quirks(struct pcie_service_card *card); + int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch b/app-admin/kernel-tools/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch new file mode 100644 index 00000000000..57d0c11abc8 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch @@ -0,0 +1,159 @@ +From cac6622c25d3146ff4324a7dc7eebeb544aea58f Mon Sep 17 00:00:00 2001 +From: Tsuchiya Yuto +Date: Sun, 4 Oct 2020 00:11:49 +0900 +Subject: [PATCH 112/155] SURFACE: mwifiex: pcie: disable bridge_d3 for Surface + gen4+ + +Currently, mwifiex fw will crash after suspend on recent kernel series. +On Windows, it seems that the root port of wifi will never enter D3 state +(stay on D0 state). And on Linux, disabling the D3 state for the +bridge fixes fw crashing after suspend. + +This commit disables the D3 state of root port on driver initialization +and fixes fw crashing after suspend. + +Signed-off-by: Tsuchiya Yuto +Patchset: mwifiex + +Link: https://github.com/linux-surface/kernel/commit/9769338807b783cee28ff7bccbaa0e60c684be9f +Signed-off-by: Kexy Biscuit +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 7 +++++ + .../wireless/marvell/mwifiex/pcie_quirks.c | 27 +++++++++++++------ + .../wireless/marvell/mwifiex/pcie_quirks.h | 1 + + 3 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index 9a9929424513..2273e3029776 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -377,6 +377,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) + { + struct pcie_service_card *card; ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + int ret; + + pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n", +@@ -418,6 +419,12 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, + return -1; + } + ++ /* disable bridge_d3 for Surface gen4+ devices to fix fw crashing ++ * after suspend ++ */ ++ if (card->quirks & QUIRK_NO_BRIDGE_D3) ++ parent_pdev->bridge_d3 = false; ++ + return 0; + } + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +index f46b06f8d643..99b024ecbade 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +@@ -14,7 +14,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 5", +@@ -24,7 +25,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 5 (LTE)", +@@ -34,7 +36,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 6", +@@ -43,7 +46,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Book 1", +@@ -52,7 +56,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Book 2", +@@ -61,7 +66,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Laptop 1", +@@ -70,7 +76,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Laptop 2", +@@ -79,7 +86,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + {} + }; +@@ -99,6 +107,9 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card) + dev_info(&pdev->dev, "quirk reset_d3cold enabled\n"); + if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) + dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n"); ++ if (card->quirks & QUIRK_NO_BRIDGE_D3) ++ dev_info(&pdev->dev, ++ "quirk no_brigde_d3 enabled\n"); + } + + static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev) +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +index 5d30ae39d65e..c14eb56eb911 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +@@ -5,6 +5,7 @@ + + #define QUIRK_FW_RST_D3COLD BIT(0) + #define QUIRK_DO_FLR_ON_BRIDGE BIT(1) ++#define QUIRK_NO_BRIDGE_D3 BIT(2) + + void mwifiex_initialize_quirks(struct pcie_service_card *card); + int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch b/app-admin/kernel-tools/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch new file mode 100644 index 00000000000..57254768445 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch @@ -0,0 +1,85 @@ +From 318285d873a3e004c3a6cb406dce36d301939342 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= +Date: Thu, 25 Mar 2021 11:33:02 +0100 +Subject: [PATCH 113/155] SURFACE: Bluetooth: btusb: Lower passive lescan + interval on Marvell 88W8897 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The Marvell 88W8897 combined wifi and bluetooth card (pcie+usb version) +is used in a lot of Microsoft Surface devices, and all those devices +suffer from very low 2.4GHz wifi connection speeds while bluetooth is +enabled. The reason for that is that the default passive scanning +interval for Bluetooth Low Energy devices is quite high in Linux +(interval of 60 msec and scan window of 30 msec, see hci_core.c), and +the Marvell chip is known for its bad bt+wifi coexisting performance. + +So decrease that passive scan interval and make the scan window shorter +on this particular device to allow for spending more time transmitting +wifi signals: The new scan interval is 250 msec (0x190 * 0.625 msec) and +the new scan window is 6.25 msec (0xa * 0,625 msec). + +This change has a very large impact on the 2.4GHz wifi speeds and gets +it up to performance comparable with the Windows driver, which seems to +apply a similar quirk. + +The interval and window length were tested and found to work very well +with a lot of Bluetooth Low Energy devices, including the Surface Pen, a +Bluetooth Speaker and two modern Bluetooth headphones. All devices were +discovered immediately after turning them on. Even lower values were +also tested, but they introduced longer delays until devices get +discovered. + +Patchset: mwifiex + +Signed-off-by: Jonas Dreßler +Link: https://github.com/linux-surface/kernel/commit/f9801752d406cd308af5286c21bb27d946d3e9c7 +Signed-off-by: Kexy Biscuit +--- + drivers/bluetooth/btusb.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 2408e50743ca..9d6139a24982 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -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_LOWER_LESCAN_INTERVAL BIT(28) + + static const struct usb_device_id btusb_table[] = { + /* Generic Bluetooth USB device */ +@@ -468,6 +469,7 @@ static const struct usb_device_id quirks_table[] = { + { USB_DEVICE(0x1286, 0x2044), .driver_info = BTUSB_MARVELL }, + { USB_DEVICE(0x1286, 0x2046), .driver_info = BTUSB_MARVELL }, + { USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL }, ++ { USB_DEVICE(0x1286, 0x204c), .driver_info = BTUSB_LOWER_LESCAN_INTERVAL }, + + /* Intel Bluetooth devices */ + { USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_COMBINED }, +@@ -3866,6 +3868,19 @@ static int btusb_probe(struct usb_interface *intf, + if (id->driver_info & BTUSB_MARVELL) + hdev->set_bdaddr = btusb_set_bdaddr_marvell; + ++ /* The Marvell 88W8897 combined wifi and bluetooth card is known for ++ * very bad bt+wifi coexisting performance. ++ * ++ * Decrease the passive BT Low Energy scan interval a bit ++ * (0x0190 * 0.625 msec = 250 msec) and make the scan window shorter ++ * (0x000a * 0,625 msec = 6.25 msec). This allows for significantly ++ * higher wifi throughput while passively scanning for BT LE devices. ++ */ ++ if (id->driver_info & BTUSB_LOWER_LESCAN_INTERVAL) { ++ hdev->le_scan_interval = 0x0190; ++ hdev->le_scan_window = 0x000a; ++ } ++ + if (IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK) && + (id->driver_info & BTUSB_MEDIATEK)) { + hdev->setup = btusb_mtk_setup; +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch b/app-admin/kernel-tools/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch new file mode 100644 index 00000000000..f1a7ed35a69 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch @@ -0,0 +1,42 @@ +From b292acafd6d4a58e3cc107823a4744b5ff93b264 Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Thu, 30 Jul 2020 13:21:53 +0200 +Subject: [PATCH 114/155] SURFACE: mei: me: Add Icelake device ID for iTouch + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/349269d5e90409c3dd12e022da4771c6a66752b6 +Signed-off-by: Kexy Biscuit +--- + drivers/misc/mei/hw-me-regs.h | 1 + + drivers/misc/mei/pci-me.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h +index c3a6657dcd4a..82eef2f4eb0a 100644 +--- a/drivers/misc/mei/hw-me-regs.h ++++ b/drivers/misc/mei/hw-me-regs.h +@@ -92,6 +92,7 @@ + #define MEI_DEV_ID_CDF 0x18D3 /* Cedar Fork */ + + #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ ++#define MEI_DEV_ID_ICP_LP_3 0x34E4 /* Ice Lake Point LP 3 (iTouch) */ + #define MEI_DEV_ID_ICP_N 0x38E0 /* Ice Lake Point N */ + + #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */ +diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c +index 6589635f8ba3..a1df48a434e2 100644 +--- a/drivers/misc/mei/pci-me.c ++++ b/drivers/misc/mei/pci-me.c +@@ -97,6 +97,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { + {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H_3, MEI_ME_PCH8_ITOUCH_CFG)}, + + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, ++ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP_3, MEI_ME_PCH12_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_N, MEI_ME_PCH12_CFG)}, + + {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch b/app-admin/kernel-tools/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch new file mode 100644 index 00000000000..c7643f092b7 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch @@ -0,0 +1,112 @@ +From 1fa0ad882104ba5ecc262c52b85eb0a0023a2399 Mon Sep 17 00:00:00 2001 +From: Liban Hannan +Date: Tue, 12 Apr 2022 23:31:12 +0100 +Subject: [PATCH 115/155] BACKPORT: SURFACE: iommu: Use IOMMU passthrough mode + for IPTS + +Adds a quirk so that IOMMU uses passthrough mode for the IPTS device. +Otherwise, when IOMMU is enabled, IPTS produces DMAR errors like: + +DMAR: [DMA Read NO_PASID] Request device [00:16.4] fault addr +0x104ea3000 [fault reason 0x06] PTE Read access is not set + +This is very similar to the bug described at: +https://bugs.launchpad.net/bugs/1958004 + +Fixed with the following patch which this patch basically copies: +https://launchpadlibrarian.net/586396847/43255ca.diff + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/9c052968302b202812f519f38839dd00d3621795 +[Kexy: Resolved minor conflict in drivers/iommu/intel/iommu.c] +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index 8d28ecd0a640..dea755f15010 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -40,6 +40,11 @@ + #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) + #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) + ++#define IS_IPTS(pdev) ( \ ++ ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x9D3E) || \ ++ ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x34E4) \ ++ ) ++ + #define IOAPIC_RANGE_START (0xfee00000) + #define IOAPIC_RANGE_END (0xfeefffff) + #define IOVA_START_ADDR (0x1000) +@@ -217,12 +222,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON); + int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + ++static int dmar_map_ipts = 1; + static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; + + #define IDENTMAP_AZALIA 4 ++#define IDENTMAP_IPTS 16 + + const struct iommu_ops intel_iommu_ops; + static const struct iommu_dirty_ops intel_dirty_ops; +@@ -2156,6 +2163,9 @@ static int device_def_domain_type(struct device *dev) + + if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) + return IOMMU_DOMAIN_IDENTITY; ++ ++ if ((iommu_identity_mapping & IDENTMAP_IPTS) && IS_IPTS(pdev)) ++ return IOMMU_DOMAIN_IDENTITY; + } + + return 0; +@@ -2456,6 +2466,9 @@ static int __init init_dmars(void) + iommu_set_root_entry(iommu); + } + ++ if (!dmar_map_ipts) ++ iommu_identity_mapping |= IDENTMAP_IPTS; ++ + check_tylersburg_isoch(); + + ret = si_domain_init(hw_pass_through); +@@ -4701,6 +4714,18 @@ static void quirk_iommu_igfx(struct pci_dev *dev) + disable_igfx_iommu = 1; + } + ++static void quirk_iommu_ipts(struct pci_dev *dev) ++{ ++ if (!IS_IPTS(dev)) ++ return; ++ ++ if (risky_device(dev)) ++ return; ++ ++ pci_info(dev, "Disabling IOMMU for IPTS\n"); ++ dmar_map_ipts = 0; ++} ++ + /* G4x/GM45 integrated gfx dmar support is totally busted. */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_igfx); +@@ -4739,6 +4764,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1632, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163A, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx); + ++/* disable IPTS dmar support */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9D3E, quirk_iommu_ipts); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x34E4, quirk_iommu_ipts); ++ + static void quirk_iommu_rwbf(struct pci_dev *dev) + { + if (risky_device(dev)) +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch b/app-admin/kernel-tools/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch new file mode 100644 index 00000000000..18b569f6416 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch @@ -0,0 +1,3099 @@ +From 07ad2c6f80ec384f46bc444050e3738e4944d5ce Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Sun, 11 Dec 2022 12:00:59 +0100 +Subject: [PATCH 116/155] SURFACE: hid: Add support for Intel Precise Touch and + Stylus + +Based on linux-surface/intel-precise-touch@8abe268 + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/4d098196ff771e07ce301632377779c94dfa7cb4 +Signed-off-by: Kexy Biscuit +--- + drivers/hid/Kconfig | 2 + + drivers/hid/Makefile | 2 + + drivers/hid/ipts/Kconfig | 14 + + drivers/hid/ipts/Makefile | 16 ++ + drivers/hid/ipts/cmd.c | 61 +++++ + drivers/hid/ipts/cmd.h | 60 ++++ + drivers/hid/ipts/context.h | 52 ++++ + drivers/hid/ipts/control.c | 486 +++++++++++++++++++++++++++++++++ + drivers/hid/ipts/control.h | 126 +++++++++ + drivers/hid/ipts/desc.h | 80 ++++++ + drivers/hid/ipts/eds1.c | 104 +++++++ + drivers/hid/ipts/eds1.h | 35 +++ + drivers/hid/ipts/eds2.c | 145 ++++++++++ + drivers/hid/ipts/eds2.h | 35 +++ + drivers/hid/ipts/hid.c | 225 +++++++++++++++ + drivers/hid/ipts/hid.h | 24 ++ + drivers/hid/ipts/main.c | 126 +++++++++ + drivers/hid/ipts/mei.c | 188 +++++++++++++ + drivers/hid/ipts/mei.h | 66 +++++ + drivers/hid/ipts/receiver.c | 251 +++++++++++++++++ + drivers/hid/ipts/receiver.h | 16 ++ + drivers/hid/ipts/resources.c | 131 +++++++++ + drivers/hid/ipts/resources.h | 41 +++ + drivers/hid/ipts/spec-data.h | 100 +++++++ + drivers/hid/ipts/spec-device.h | 290 ++++++++++++++++++++ + drivers/hid/ipts/spec-hid.h | 34 +++ + drivers/hid/ipts/thread.c | 84 ++++++ + drivers/hid/ipts/thread.h | 59 ++++ + 28 files changed, 2853 insertions(+) + create mode 100644 drivers/hid/ipts/Kconfig + create mode 100644 drivers/hid/ipts/Makefile + create mode 100644 drivers/hid/ipts/cmd.c + create mode 100644 drivers/hid/ipts/cmd.h + create mode 100644 drivers/hid/ipts/context.h + create mode 100644 drivers/hid/ipts/control.c + create mode 100644 drivers/hid/ipts/control.h + create mode 100644 drivers/hid/ipts/desc.h + create mode 100644 drivers/hid/ipts/eds1.c + create mode 100644 drivers/hid/ipts/eds1.h + create mode 100644 drivers/hid/ipts/eds2.c + create mode 100644 drivers/hid/ipts/eds2.h + create mode 100644 drivers/hid/ipts/hid.c + create mode 100644 drivers/hid/ipts/hid.h + create mode 100644 drivers/hid/ipts/main.c + create mode 100644 drivers/hid/ipts/mei.c + create mode 100644 drivers/hid/ipts/mei.h + create mode 100644 drivers/hid/ipts/receiver.c + create mode 100644 drivers/hid/ipts/receiver.h + create mode 100644 drivers/hid/ipts/resources.c + create mode 100644 drivers/hid/ipts/resources.h + create mode 100644 drivers/hid/ipts/spec-data.h + create mode 100644 drivers/hid/ipts/spec-device.h + create mode 100644 drivers/hid/ipts/spec-hid.h + create mode 100644 drivers/hid/ipts/thread.c + create mode 100644 drivers/hid/ipts/thread.h + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 08446c89eff6..ccddfba86004 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -1367,4 +1367,6 @@ source "drivers/hid/amd-sfh-hid/Kconfig" + + source "drivers/hid/surface-hid/Kconfig" + ++source "drivers/hid/ipts/Kconfig" ++ + endif # HID_SUPPORT +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index e40f1ddebbb7..bdb17cffca2f 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -169,3 +169,5 @@ obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ish-hid/ + obj-$(CONFIG_AMD_SFH_HID) += amd-sfh-hid/ + + obj-$(CONFIG_SURFACE_HID_CORE) += surface-hid/ ++ ++obj-$(CONFIG_HID_IPTS) += ipts/ +diff --git a/drivers/hid/ipts/Kconfig b/drivers/hid/ipts/Kconfig +new file mode 100644 +index 000000000000..297401bd388d +--- /dev/null ++++ b/drivers/hid/ipts/Kconfig +@@ -0,0 +1,14 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++config HID_IPTS ++ tristate "Intel Precise Touch & Stylus" ++ depends on INTEL_MEI ++ depends on HID ++ help ++ Say Y here if your system has a touchscreen using Intels ++ Precise Touch & Stylus (IPTS) technology. ++ ++ If unsure say N. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called ipts. +diff --git a/drivers/hid/ipts/Makefile b/drivers/hid/ipts/Makefile +new file mode 100644 +index 000000000000..883896f68e6a +--- /dev/null ++++ b/drivers/hid/ipts/Makefile +@@ -0,0 +1,16 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++# ++# Makefile for the IPTS touchscreen driver ++# ++ ++obj-$(CONFIG_HID_IPTS) += ipts.o ++ipts-objs := cmd.o ++ipts-objs += control.o ++ipts-objs += eds1.o ++ipts-objs += eds2.o ++ipts-objs += hid.o ++ipts-objs += main.o ++ipts-objs += mei.o ++ipts-objs += receiver.o ++ipts-objs += resources.o ++ipts-objs += thread.o +diff --git a/drivers/hid/ipts/cmd.c b/drivers/hid/ipts/cmd.c +new file mode 100644 +index 000000000000..63a4934bbc5f +--- /dev/null ++++ b/drivers/hid/ipts/cmd.c +@@ -0,0 +1,61 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "mei.h" ++#include "spec-device.h" ++ ++int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp, u64 timeout) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!rsp) ++ return -EFAULT; ++ ++ /* ++ * In a response, the command code will have the most significant bit flipped to 1. ++ * If code is passed to ipts_mei_recv as is, no messages will be received. ++ */ ++ ret = ipts_mei_recv(&ipts->mei, code | IPTS_RSP_BIT, rsp, timeout); ++ if (ret < 0) ++ return ret; ++ ++ dev_dbg(ipts->dev, "Received 0x%02X with status 0x%02X\n", code, rsp->status); ++ ++ /* ++ * Some devices will always return this error. ++ * It is allowed to ignore it and to try continuing. ++ */ ++ if (rsp->status == IPTS_STATUS_COMPAT_CHECK_FAIL) ++ rsp->status = IPTS_STATUS_SUCCESS; ++ ++ return 0; ++} ++ ++int ipts_cmd_send(struct ipts_context *ipts, enum ipts_command_code code, void *data, size_t size) ++{ ++ struct ipts_command cmd = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.cmd = code; ++ ++ if (data && size > 0) ++ memcpy(cmd.payload, data, size); ++ ++ dev_dbg(ipts->dev, "Sending 0x%02X with %ld bytes payload\n", code, size); ++ return ipts_mei_send(&ipts->mei, &cmd, sizeof(cmd.cmd) + size); ++} +diff --git a/drivers/hid/ipts/cmd.h b/drivers/hid/ipts/cmd.h +new file mode 100644 +index 000000000000..2b4079075b64 +--- /dev/null ++++ b/drivers/hid/ipts/cmd.h +@@ -0,0 +1,60 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CMD_H ++#define IPTS_CMD_H ++ ++#include ++ ++#include "context.h" ++#include "spec-device.h" ++ ++/* ++ * The default timeout for receiving responses ++ */ ++#define IPTS_CMD_DEFAULT_TIMEOUT 1000 ++ ++/** ++ * ipts_cmd_recv_timeout() - Receives a response to a command. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command / response. ++ * @rsp: The address that the received response will be copied to. ++ * @timeout: How many milliseconds the function will wait at most. ++ * ++ * A negative timeout means to wait forever. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp, u64 timeout); ++ ++/** ++ * ipts_cmd_recv() - Receives a response to a command. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command / response. ++ * @rsp: The address that the received response will be copied to. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++static inline int ipts_cmd_recv(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp) ++{ ++ return ipts_cmd_recv_timeout(ipts, code, rsp, IPTS_CMD_DEFAULT_TIMEOUT); ++} ++ ++/** ++ * ipts_cmd_send() - Executes a command on the device. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command to execute. ++ * @data: The payload containing parameters for the command. ++ * @size: The size of the payload. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_cmd_send(struct ipts_context *ipts, enum ipts_command_code code, void *data, size_t size); ++ ++#endif /* IPTS_CMD_H */ +diff --git a/drivers/hid/ipts/context.h b/drivers/hid/ipts/context.h +new file mode 100644 +index 000000000000..ba33259f1f7c +--- /dev/null ++++ b/drivers/hid/ipts/context.h +@@ -0,0 +1,52 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CONTEXT_H ++#define IPTS_CONTEXT_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "mei.h" ++#include "resources.h" ++#include "spec-device.h" ++#include "thread.h" ++ ++struct ipts_context { ++ struct device *dev; ++ struct ipts_mei mei; ++ ++ enum ipts_mode mode; ++ ++ /* ++ * Prevents concurrent GET_FEATURE reports. ++ */ ++ struct mutex feature_lock; ++ struct completion feature_event; ++ ++ /* ++ * These are not inside of struct ipts_resources ++ * because they don't own the memory they point to. ++ */ ++ struct ipts_buffer feature_report; ++ struct ipts_buffer descriptor; ++ ++ bool hid_active; ++ struct hid_device *hid; ++ ++ struct ipts_device_info info; ++ struct ipts_resources resources; ++ ++ struct ipts_thread receiver_loop; ++}; ++ ++#endif /* IPTS_CONTEXT_H */ +diff --git a/drivers/hid/ipts/control.c b/drivers/hid/ipts/control.c +new file mode 100644 +index 000000000000..5360842d260b +--- /dev/null ++++ b/drivers/hid/ipts/control.c +@@ -0,0 +1,486 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "hid.h" ++#include "receiver.h" ++#include "resources.h" ++#include "spec-data.h" ++#include "spec-device.h" ++ ++static int ipts_control_get_device_info(struct ipts_context *ipts, struct ipts_device_info *info) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!info) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_GET_DEVICE_INFO, NULL, 0); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_GET_DEVICE_INFO, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ memcpy(info, rsp.payload, sizeof(*info)); ++ return 0; ++} ++ ++static int ipts_control_set_mode(struct ipts_context *ipts, enum ipts_mode mode) ++{ ++ int ret = 0; ++ struct ipts_set_mode cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.mode = mode; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_SET_MODE, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MODE: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_SET_MODE, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MODE: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "SET_MODE: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++static int ipts_control_set_mem_window(struct ipts_context *ipts, struct ipts_resources *res) ++{ ++ int i = 0; ++ int ret = 0; ++ struct ipts_mem_window cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ cmd.data_addr_lower[i] = lower_32_bits(res->data[i].dma_address); ++ cmd.data_addr_upper[i] = upper_32_bits(res->data[i].dma_address); ++ cmd.feedback_addr_lower[i] = lower_32_bits(res->feedback[i].dma_address); ++ cmd.feedback_addr_upper[i] = upper_32_bits(res->feedback[i].dma_address); ++ } ++ ++ cmd.workqueue_addr_lower = lower_32_bits(res->workqueue.dma_address); ++ cmd.workqueue_addr_upper = upper_32_bits(res->workqueue.dma_address); ++ ++ cmd.doorbell_addr_lower = lower_32_bits(res->doorbell.dma_address); ++ cmd.doorbell_addr_upper = upper_32_bits(res->doorbell.dma_address); ++ ++ cmd.hid2me_addr_lower = lower_32_bits(res->hid2me.dma_address); ++ cmd.hid2me_addr_upper = upper_32_bits(res->hid2me.dma_address); ++ ++ cmd.workqueue_size = IPTS_WORKQUEUE_SIZE; ++ cmd.workqueue_item_size = IPTS_WORKQUEUE_ITEM_SIZE; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_SET_MEM_WINDOW, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_SET_MEM_WINDOW, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++static int ipts_control_get_descriptor(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_data_header *header = NULL; ++ struct ipts_get_descriptor cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->resources.descriptor.address) ++ return -EFAULT; ++ ++ memset(ipts->resources.descriptor.address, 0, ipts->resources.descriptor.size); ++ ++ cmd.addr_lower = lower_32_bits(ipts->resources.descriptor.dma_address); ++ cmd.addr_upper = upper_32_bits(ipts->resources.descriptor.dma_address); ++ cmd.magic = 8; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_GET_DESCRIPTOR, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_GET_DESCRIPTOR, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ header = (struct ipts_data_header *)ipts->resources.descriptor.address; ++ ++ if (header->type == IPTS_DATA_TYPE_DESCRIPTOR) { ++ ipts->descriptor.address = &header->data[8]; ++ ipts->descriptor.size = header->size - 8; ++ ++ return 0; ++ } ++ ++ return -ENODATA; ++} ++ ++int ipts_control_request_flush(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_quiesce_io cmd = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_QUIESCE_IO, &cmd, sizeof(cmd)); ++ if (ret) ++ dev_err(ipts->dev, "QUIESCE_IO: send failed: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_control_wait_flush(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_QUIESCE_IO, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "QUIESCE_IO: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status == IPTS_STATUS_TIMEOUT) ++ return -EAGAIN; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "QUIESCE_IO: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_request_data(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_READY_FOR_DATA, NULL, 0); ++ if (ret) ++ dev_err(ipts->dev, "READY_FOR_DATA: send failed: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_control_wait_data(struct ipts_context *ipts, bool shutdown) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!shutdown) ++ ret = ipts_cmd_recv_timeout(ipts, IPTS_CMD_READY_FOR_DATA, &rsp, 0); ++ else ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_READY_FOR_DATA, &rsp); ++ ++ if (ret) { ++ if (ret != -EAGAIN) ++ dev_err(ipts->dev, "READY_FOR_DATA: recv failed: %d\n", ret); ++ ++ return ret; ++ } ++ ++ /* ++ * During shutdown, it is possible that the sensor has already been disabled. ++ */ ++ if (rsp.status == IPTS_STATUS_SENSOR_DISABLED) ++ return 0; ++ ++ if (rsp.status == IPTS_STATUS_TIMEOUT) ++ return -EAGAIN; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "READY_FOR_DATA: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer) ++{ ++ int ret = 0; ++ struct ipts_feedback cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.buffer = buffer; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_FEEDBACK, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "FEEDBACK: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_FEEDBACK, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "FEEDBACK: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ /* ++ * We don't know what feedback data looks like so we are sending zeros. ++ * See also ipts_control_refill_buffer. ++ */ ++ if (rsp.status == IPTS_STATUS_INVALID_PARAMS) ++ return 0; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "FEEDBACK: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_hid2me_feedback(struct ipts_context *ipts, enum ipts_feedback_cmd_type cmd, ++ enum ipts_feedback_data_type type, void *data, size_t size) ++{ ++ struct ipts_feedback_header *header = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->resources.hid2me.address) ++ return -EFAULT; ++ ++ memset(ipts->resources.hid2me.address, 0, ipts->resources.hid2me.size); ++ header = (struct ipts_feedback_header *)ipts->resources.hid2me.address; ++ ++ header->cmd_type = cmd; ++ header->data_type = type; ++ header->size = size; ++ header->buffer = IPTS_HID2ME_BUFFER; ++ ++ if (size + sizeof(*header) > ipts->resources.hid2me.size) ++ return -EINVAL; ++ ++ if (data && size > 0) ++ memcpy(header->payload, data, size); ++ ++ return ipts_control_send_feedback(ipts, IPTS_HID2ME_BUFFER); ++} ++ ++int ipts_control_start(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_device_info info = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "Starting IPTS\n"); ++ ++ ret = ipts_control_get_device_info(ipts, &info); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to get device info: %d\n", ret); ++ return ret; ++ } ++ ++ ipts->info = info; ++ ++ ret = ipts_resources_init(&ipts->resources, ipts->dev, info.data_size, info.feedback_size); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to allocate buffers: %d", ret); ++ return ret; ++ } ++ ++ dev_info(ipts->dev, "IPTS EDS Version: %d\n", info.intf_eds); ++ ++ /* ++ * Handle newer devices ++ */ ++ if (info.intf_eds > 1) { ++ /* ++ * Fetching the descriptor will only work on newer devices. ++ * For older devices, a fallback descriptor will be used. ++ */ ++ ret = ipts_control_get_descriptor(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to fetch HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ /* ++ * Newer devices can be directly initialized in polling mode. ++ */ ++ ipts->mode = IPTS_MODE_POLL; ++ } ++ ++ ret = ipts_control_set_mode(ipts, ipts->mode); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to set mode: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_set_mem_window(ipts, &ipts->resources); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to set memory window: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_receiver_start(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to start receiver: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_request_data(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request data: %d\n", ret); ++ return ret; ++ } ++ ++ ipts_hid_enable(ipts); ++ ++ ret = ipts_hid_init(ipts, info); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to initialize HID device: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int _ipts_control_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ipts_hid_disable(ipts); ++ dev_info(ipts->dev, "Stopping IPTS\n"); ++ ++ ret = ipts_receiver_stop(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to stop receiver: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_resources_free(&ipts->resources); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to free resources: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ ret = _ipts_control_stop(ipts); ++ if (ret) ++ return ret; ++ ++ ret = ipts_hid_free(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to free HID device: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_restart(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ ret = _ipts_control_stop(ipts); ++ if (ret) ++ return ret; ++ ++ /* ++ * Wait a second to give the sensor time to fully shut down. ++ */ ++ msleep(1000); ++ ++ ret = ipts_control_start(ipts); ++ if (ret) ++ return ret; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/control.h b/drivers/hid/ipts/control.h +new file mode 100644 +index 000000000000..26629c5144ed +--- /dev/null ++++ b/drivers/hid/ipts/control.h +@@ -0,0 +1,126 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CONTROL_H ++#define IPTS_CONTROL_H ++ ++#include ++ ++#include "context.h" ++#include "spec-data.h" ++#include "spec-device.h" ++ ++/** ++ * ipts_control_request_flush() - Stop the data flow. ++ * @ipts: The IPTS driver context. ++ * ++ * Runs the command to stop the data flow on the device. ++ * All outstanding data needs to be acknowledged using feedback before the command will return. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_request_flush(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_flush() - Wait until data flow has been stopped. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_wait_flush(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_flush() - Notify the device that the driver can receive new data. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_request_data(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_data() - Wait until new data is available. ++ * @ipts: The IPTS driver context. ++ * @block: Whether to block execution until data is available. ++ * ++ * In poll mode, this function will never return while the data flow is active. Instead, ++ * the poll will be incremented when new data is available. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no data is available. ++ */ ++int ipts_control_wait_data(struct ipts_context *ipts, bool block); ++ ++/** ++ * ipts_control_send_feedback() - Submits a feedback buffer to the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The ID of the buffer containing feedback data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer); ++ ++/** ++ * ipts_control_hid2me_feedback() - Sends HID2ME feedback, a special type of feedback. ++ * @ipts: The IPTS driver context. ++ * @cmd: The command that will be run on the device. ++ * @type: The type of the payload that is sent to the device. ++ * @data: The payload of the feedback command. ++ * @size: The size of the payload. ++ * ++ * HID2ME feedback is a special type of feedback, because it allows interfacing with ++ * the HID API of the device at any moment, without requiring a buffer that has to ++ * be acknowledged. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_hid2me_feedback(struct ipts_context *ipts, enum ipts_feedback_cmd_type cmd, ++ enum ipts_feedback_data_type type, void *data, size_t size); ++ ++/** ++ * ipts_control_refill_buffer() - Acknowledges that data in a buffer has been processed. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer that has been processed and can be refilled. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++static inline int ipts_control_refill_buffer(struct ipts_context *ipts, u32 buffer) ++{ ++ /* ++ * IPTS expects structured data in the feedback buffer matching the buffer that will be ++ * refilled. We don't know what that data looks like, so we just keep the buffer empty. ++ * This results in an INVALID_PARAMS error, but the buffer gets refilled without an issue. ++ * Sending a minimal structure with the buffer ID fixes the error, but breaks refilling ++ * the buffers on some devices. ++ */ ++ ++ return ipts_control_send_feedback(ipts, buffer); ++} ++ ++/** ++ * ipts_control_start() - Initialized the device and starts the data flow. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_start(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_stop() - Stops the data flow and resets the device. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_stop(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_restart() - Stops the device and starts it again. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_restart(struct ipts_context *ipts); ++ ++#endif /* IPTS_CONTROL_H */ +diff --git a/drivers/hid/ipts/desc.h b/drivers/hid/ipts/desc.h +new file mode 100644 +index 000000000000..307438c7c80c +--- /dev/null ++++ b/drivers/hid/ipts/desc.h +@@ -0,0 +1,80 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_DESC_H ++#define IPTS_DESC_H ++ ++#include ++ ++#define IPTS_HID_REPORT_SINGLETOUCH 64 ++#define IPTS_HID_REPORT_DATA 65 ++#define IPTS_HID_REPORT_SET_MODE 66 ++ ++#define IPTS_HID_REPORT_DATA_SIZE 7485 ++ ++/* ++ * HID descriptor for singletouch data. ++ * This descriptor should be present on all IPTS devices. ++ */ ++static const u8 ipts_singletouch_descriptor[] = { ++ 0x05, 0x0D, /* Usage Page (Digitizer), */ ++ 0x09, 0x04, /* Usage (Touchscreen), */ ++ 0xA1, 0x01, /* Collection (Application), */ ++ 0x85, 0x40, /* Report ID (64), */ ++ 0x09, 0x42, /* Usage (Tip Switch), */ ++ 0x15, 0x00, /* Logical Minimum (0), */ ++ 0x25, 0x01, /* Logical Maximum (1), */ ++ 0x75, 0x01, /* Report Size (1), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x95, 0x07, /* Report Count (7), */ ++ 0x81, 0x03, /* Input (Constant, Variable), */ ++ 0x05, 0x01, /* Usage Page (Desktop), */ ++ 0x09, 0x30, /* Usage (X), */ ++ 0x75, 0x10, /* Report Size (16), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0xA4, /* Push, */ ++ 0x55, 0x0E, /* Unit Exponent (14), */ ++ 0x65, 0x11, /* Unit (Centimeter), */ ++ 0x46, 0x76, 0x0B, /* Physical Maximum (2934), */ ++ 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x09, 0x31, /* Usage (Y), */ ++ 0x46, 0x74, 0x06, /* Physical Maximum (1652), */ ++ 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0xB4, /* Pop, */ ++ 0xC0, /* End Collection */ ++}; ++ ++/* ++ * Fallback HID descriptor for older devices that do not have ++ * the ability to query their HID descriptor. ++ */ ++static const u8 ipts_fallback_descriptor[] = { ++ 0x05, 0x0D, /* Usage Page (Digitizer), */ ++ 0x09, 0x0F, /* Usage (Capacitive Hm Digitizer), */ ++ 0xA1, 0x01, /* Collection (Application), */ ++ 0x85, 0x41, /* Report ID (65), */ ++ 0x09, 0x56, /* Usage (Scan Time), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0x75, 0x10, /* Report Size (16), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x09, 0x61, /* Usage (Gesture Char Quality), */ ++ 0x75, 0x08, /* Report Size (8), */ ++ 0x96, 0x3D, 0x1D, /* Report Count (7485), */ ++ 0x81, 0x03, /* Input (Constant, Variable), */ ++ 0x85, 0x42, /* Report ID (66), */ ++ 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ ++ 0x09, 0xC8, /* Usage (C8h), */ ++ 0x75, 0x08, /* Report Size (8), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0xB1, 0x02, /* Feature (Variable), */ ++ 0xC0, /* End Collection, */ ++}; ++ ++#endif /* IPTS_DESC_H */ +diff --git a/drivers/hid/ipts/eds1.c b/drivers/hid/ipts/eds1.c +new file mode 100644 +index 000000000000..7b9f54388a9f +--- /dev/null ++++ b/drivers/hid/ipts/eds1.c +@@ -0,0 +1,104 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "eds1.h" ++#include "spec-device.h" ++ ++int ipts_eds1_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size) ++{ ++ size_t size = 0; ++ u8 *buffer = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!desc_buffer) ++ return -EFAULT; ++ ++ if (!desc_size) ++ return -EFAULT; ++ ++ size = sizeof(ipts_singletouch_descriptor) + sizeof(ipts_fallback_descriptor); ++ ++ buffer = kzalloc(size, GFP_KERNEL); ++ if (!buffer) ++ return -ENOMEM; ++ ++ memcpy(buffer, ipts_singletouch_descriptor, sizeof(ipts_singletouch_descriptor)); ++ memcpy(&buffer[sizeof(ipts_singletouch_descriptor)], ipts_fallback_descriptor, ++ sizeof(ipts_fallback_descriptor)); ++ ++ *desc_size = size; ++ *desc_buffer = buffer; ++ ++ return 0; ++} ++ ++static int ipts_eds1_switch_mode(struct ipts_context *ipts, enum ipts_mode mode) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->mode == mode) ++ return 0; ++ ++ ipts->mode = mode; ++ ++ ret = ipts_control_restart(ipts); ++ if (ret) ++ dev_err(ipts->dev, "Failed to switch modes: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_eds1_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (report_id != IPTS_HID_REPORT_SET_MODE) ++ return -EIO; ++ ++ if (report_type != HID_FEATURE_REPORT) ++ return -EIO; ++ ++ if (size != 2) ++ return -EINVAL; ++ ++ /* ++ * Implement mode switching report for older devices without native HID support. ++ */ ++ ++ if (request_type == HID_REQ_GET_REPORT) { ++ memset(buffer, 0, size); ++ buffer[0] = report_id; ++ buffer[1] = ipts->mode; ++ } else if (request_type == HID_REQ_SET_REPORT) { ++ return ipts_eds1_switch_mode(ipts, buffer[1]); ++ } else { ++ return -EIO; ++ } ++ ++ return ret; ++} +diff --git a/drivers/hid/ipts/eds1.h b/drivers/hid/ipts/eds1.h +new file mode 100644 +index 000000000000..eeeb6575e3e8 +--- /dev/null ++++ b/drivers/hid/ipts/eds1.h +@@ -0,0 +1,35 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "context.h" ++ ++/** ++ * ipts_eds1_get_descriptor() - Assembles the HID descriptor of the device. ++ * @ipts: The IPTS driver context. ++ * @desc_buffer: A pointer to the location where the address of the allocated buffer is stored. ++ * @desc_size: A pointer to the location where the size of the allocated buffer is stored. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds1_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size); ++ ++/** ++ * ipts_eds1_raw_request() - Executes an output or feature report on the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer containing the report. ++ * @size: The size of the buffer. ++ * @report_id: The HID report ID. ++ * @report_type: Whether this report is an output or a feature report. ++ * @request_type: Whether this report requests or sends data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds1_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type); +diff --git a/drivers/hid/ipts/eds2.c b/drivers/hid/ipts/eds2.c +new file mode 100644 +index 000000000000..639940794615 +--- /dev/null ++++ b/drivers/hid/ipts/eds2.c +@@ -0,0 +1,145 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "eds2.h" ++#include "spec-data.h" ++ ++int ipts_eds2_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size) ++{ ++ size_t size = 0; ++ u8 *buffer = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!desc_buffer) ++ return -EFAULT; ++ ++ if (!desc_size) ++ return -EFAULT; ++ ++ size = sizeof(ipts_singletouch_descriptor) + ipts->descriptor.size; ++ ++ buffer = kzalloc(size, GFP_KERNEL); ++ if (!buffer) ++ return -ENOMEM; ++ ++ memcpy(buffer, ipts_singletouch_descriptor, sizeof(ipts_singletouch_descriptor)); ++ memcpy(&buffer[sizeof(ipts_singletouch_descriptor)], ipts->descriptor.address, ++ ipts->descriptor.size); ++ ++ *desc_size = size; ++ *desc_buffer = buffer; ++ ++ return 0; ++} ++ ++static int ipts_eds2_get_feature(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum ipts_feedback_data_type type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ mutex_lock(&ipts->feature_lock); ++ ++ memset(buffer, 0, size); ++ buffer[0] = report_id; ++ ++ memset(&ipts->feature_report, 0, sizeof(ipts->feature_report)); ++ reinit_completion(&ipts->feature_event); ++ ++ ret = ipts_control_hid2me_feedback(ipts, IPTS_FEEDBACK_CMD_TYPE_NONE, type, buffer, size); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to send hid2me feedback: %d\n", ret); ++ goto out; ++ } ++ ++ ret = wait_for_completion_timeout(&ipts->feature_event, msecs_to_jiffies(5000)); ++ if (ret == 0) { ++ dev_warn(ipts->dev, "GET_FEATURES timed out!\n"); ++ ret = -EIO; ++ goto out; ++ } ++ ++ if (!ipts->feature_report.address) { ++ ret = -EFAULT; ++ goto out; ++ } ++ ++ if (ipts->feature_report.size > size) { ++ ret = -ETOOSMALL; ++ goto out; ++ } ++ ++ ret = ipts->feature_report.size; ++ memcpy(buffer, ipts->feature_report.address, ipts->feature_report.size); ++ ++out: ++ mutex_unlock(&ipts->feature_lock); ++ return ret; ++} ++ ++static int ipts_eds2_set_feature(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum ipts_feedback_data_type type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ buffer[0] = report_id; ++ ++ ret = ipts_control_hid2me_feedback(ipts, IPTS_FEEDBACK_CMD_TYPE_NONE, type, buffer, size); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send hid2me feedback: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_eds2_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type) ++{ ++ enum ipts_feedback_data_type feedback_type = IPTS_FEEDBACK_DATA_TYPE_VENDOR; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (report_type == HID_OUTPUT_REPORT && request_type == HID_REQ_SET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT; ++ else if (report_type == HID_FEATURE_REPORT && request_type == HID_REQ_GET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES; ++ else if (report_type == HID_FEATURE_REPORT && request_type == HID_REQ_SET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES; ++ else ++ return -EIO; ++ ++ if (request_type == HID_REQ_GET_REPORT) ++ return ipts_eds2_get_feature(ipts, buffer, size, report_id, feedback_type); ++ else ++ return ipts_eds2_set_feature(ipts, buffer, size, report_id, feedback_type); ++} +diff --git a/drivers/hid/ipts/eds2.h b/drivers/hid/ipts/eds2.h +new file mode 100644 +index 000000000000..064e3716907a +--- /dev/null ++++ b/drivers/hid/ipts/eds2.h +@@ -0,0 +1,35 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "context.h" ++ ++/** ++ * ipts_eds2_get_descriptor() - Assembles the HID descriptor of the device. ++ * @ipts: The IPTS driver context. ++ * @desc_buffer: A pointer to the location where the address of the allocated buffer is stored. ++ * @desc_size: A pointer to the location where the size of the allocated buffer is stored. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds2_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size); ++ ++/** ++ * ipts_eds2_raw_request() - Executes an output or feature report on the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer containing the report. ++ * @size: The size of the buffer. ++ * @report_id: The HID report ID. ++ * @report_type: Whether this report is an output or a feature report. ++ * @request_type: Whether this report requests or sends data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds2_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type); +diff --git a/drivers/hid/ipts/hid.c b/drivers/hid/ipts/hid.c +new file mode 100644 +index 000000000000..e34a1a4f9fa7 +--- /dev/null ++++ b/drivers/hid/ipts/hid.c +@@ -0,0 +1,225 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "desc.h" ++#include "eds1.h" ++#include "eds2.h" ++#include "hid.h" ++#include "spec-data.h" ++#include "spec-hid.h" ++ ++void ipts_hid_enable(struct ipts_context *ipts) ++{ ++ WRITE_ONCE(ipts->hid_active, true); ++} ++ ++void ipts_hid_disable(struct ipts_context *ipts) ++{ ++ WRITE_ONCE(ipts->hid_active, false); ++} ++ ++static int ipts_hid_start(struct hid_device *hid) ++{ ++ return 0; ++} ++ ++static void ipts_hid_stop(struct hid_device *hid) ++{ ++} ++ ++static int ipts_hid_parse(struct hid_device *hid) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ u8 *buffer = NULL; ++ size_t size = 0; ++ ++ if (!hid) ++ return -ENODEV; ++ ++ ipts = hid->driver_data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ if (ipts->info.intf_eds == 1) ++ ret = ipts_eds1_get_descriptor(ipts, &buffer, &size); ++ else ++ ret = ipts_eds2_get_descriptor(ipts, &buffer, &size); ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to allocate HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ ret = hid_parse_report(hid, buffer, size); ++ kfree(buffer); ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to parse HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int ipts_hid_raw_request(struct hid_device *hid, unsigned char report_id, __u8 *buffer, ++ size_t size, unsigned char report_type, int request_type) ++{ ++ struct ipts_context *ipts = NULL; ++ ++ if (!hid) ++ return -ENODEV; ++ ++ ipts = hid->driver_data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ if (ipts->info.intf_eds == 1) { ++ return ipts_eds1_raw_request(ipts, buffer, size, report_id, report_type, ++ request_type); ++ } else { ++ return ipts_eds2_raw_request(ipts, buffer, size, report_id, report_type, ++ request_type); ++ } ++} ++ ++static struct hid_ll_driver ipts_hid_driver = { ++ .start = ipts_hid_start, ++ .stop = ipts_hid_stop, ++ .open = ipts_hid_start, ++ .close = ipts_hid_stop, ++ .parse = ipts_hid_parse, ++ .raw_request = ipts_hid_raw_request, ++}; ++ ++int ipts_hid_input_data(struct ipts_context *ipts, u32 buffer) ++{ ++ u8 *temp = NULL; ++ struct ipts_hid_header *frame = NULL; ++ struct ipts_data_header *header = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->hid) ++ return -ENODEV; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ header = (struct ipts_data_header *)ipts->resources.data[buffer].address; ++ ++ temp = ipts->resources.report.address; ++ memset(temp, 0, ipts->resources.report.size); ++ ++ if (!header) ++ return -EFAULT; ++ ++ if (header->size == 0) ++ return 0; ++ ++ if (header->type == IPTS_DATA_TYPE_HID) ++ return hid_input_report(ipts->hid, HID_INPUT_REPORT, header->data, header->size, 1); ++ ++ if (header->type == IPTS_DATA_TYPE_GET_FEATURES) { ++ ipts->feature_report.address = header->data; ++ ipts->feature_report.size = header->size; ++ ++ complete_all(&ipts->feature_event); ++ return 0; ++ } ++ ++ if (header->type != IPTS_DATA_TYPE_FRAME) ++ return 0; ++ ++ if (header->size + 3 + sizeof(struct ipts_hid_header) > IPTS_HID_REPORT_DATA_SIZE) ++ return -ERANGE; ++ ++ /* ++ * Synthesize a HID report matching the devices that natively send HID reports ++ */ ++ temp[0] = IPTS_HID_REPORT_DATA; ++ ++ frame = (struct ipts_hid_header *)&temp[3]; ++ frame->type = IPTS_HID_FRAME_TYPE_RAW; ++ frame->size = header->size + sizeof(*frame); ++ ++ memcpy(frame->data, header->data, header->size); ++ ++ return hid_input_report(ipts->hid, HID_INPUT_REPORT, temp, IPTS_HID_REPORT_DATA_SIZE, 1); ++} ++ ++int ipts_hid_init(struct ipts_context *ipts, struct ipts_device_info info) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->hid) ++ return 0; ++ ++ ipts->hid = hid_allocate_device(); ++ if (IS_ERR(ipts->hid)) { ++ int err = PTR_ERR(ipts->hid); ++ ++ dev_err(ipts->dev, "Failed to allocate HID device: %d\n", err); ++ return err; ++ } ++ ++ ipts->hid->driver_data = ipts; ++ ipts->hid->dev.parent = ipts->dev; ++ ipts->hid->ll_driver = &ipts_hid_driver; ++ ++ ipts->hid->vendor = info.vendor; ++ ipts->hid->product = info.product; ++ ipts->hid->group = HID_GROUP_GENERIC; ++ ++ snprintf(ipts->hid->name, sizeof(ipts->hid->name), "IPTS %04X:%04X", info.vendor, ++ info.product); ++ ++ ret = hid_add_device(ipts->hid); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to add HID device: %d\n", ret); ++ ipts_hid_free(ipts); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_hid_free(struct ipts_context *ipts) ++{ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->hid) ++ return 0; ++ ++ hid_destroy_device(ipts->hid); ++ ipts->hid = NULL; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/hid.h b/drivers/hid/ipts/hid.h +new file mode 100644 +index 000000000000..1ebe77447903 +--- /dev/null ++++ b/drivers/hid/ipts/hid.h +@@ -0,0 +1,24 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_HID_H ++#define IPTS_HID_H ++ ++#include ++ ++#include "context.h" ++#include "spec-device.h" ++ ++void ipts_hid_enable(struct ipts_context *ipts); ++void ipts_hid_disable(struct ipts_context *ipts); ++ ++int ipts_hid_input_data(struct ipts_context *ipts, u32 buffer); ++ ++int ipts_hid_init(struct ipts_context *ipts, struct ipts_device_info info); ++int ipts_hid_free(struct ipts_context *ipts); ++ ++#endif /* IPTS_HID_H */ +diff --git a/drivers/hid/ipts/main.c b/drivers/hid/ipts/main.c +new file mode 100644 +index 000000000000..fb5b5c13ee3e +--- /dev/null ++++ b/drivers/hid/ipts/main.c +@@ -0,0 +1,126 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "mei.h" ++#include "receiver.h" ++#include "spec-device.h" ++ ++/* ++ * The MEI client ID for IPTS functionality. ++ */ ++#define IPTS_ID UUID_LE(0x3e8d0870, 0x271a, 0x4208, 0x8e, 0xb5, 0x9a, 0xcb, 0x94, 0x02, 0xae, 0x04) ++ ++static int ipts_set_dma_mask(struct mei_cl_device *cldev) ++{ ++ if (!cldev) ++ return -EFAULT; ++ ++ if (!dma_coerce_mask_and_coherent(&cldev->dev, DMA_BIT_MASK(64))) ++ return 0; ++ ++ return dma_coerce_mask_and_coherent(&cldev->dev, DMA_BIT_MASK(32)); ++} ++ ++static int ipts_probe(struct mei_cl_device *cldev, const struct mei_cl_device_id *id) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) ++ return -EFAULT; ++ ++ ret = ipts_set_dma_mask(cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to set DMA mask for IPTS: %d\n", ret); ++ return ret; ++ } ++ ++ ret = mei_cldev_enable(cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to enable MEI device: %d\n", ret); ++ return ret; ++ } ++ ++ ipts = devm_kzalloc(&cldev->dev, sizeof(*ipts), GFP_KERNEL); ++ if (!ipts) { ++ mei_cldev_disable(cldev); ++ return -ENOMEM; ++ } ++ ++ ret = ipts_mei_init(&ipts->mei, cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to init MEI bus logic: %d\n", ret); ++ return ret; ++ } ++ ++ ipts->dev = &cldev->dev; ++ ipts->mode = IPTS_MODE_EVENT; ++ ++ mutex_init(&ipts->feature_lock); ++ init_completion(&ipts->feature_event); ++ ++ mei_cldev_set_drvdata(cldev, ipts); ++ ++ ret = ipts_control_start(ipts); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to start IPTS: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static void ipts_remove(struct mei_cl_device *cldev) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) { ++ pr_err("MEI device is NULL!"); ++ return; ++ } ++ ++ ipts = mei_cldev_get_drvdata(cldev); ++ ++ ret = ipts_control_stop(ipts); ++ if (ret) ++ dev_err(&cldev->dev, "Failed to stop IPTS: %d\n", ret); ++ ++ mei_cldev_disable(cldev); ++} ++ ++static struct mei_cl_device_id ipts_device_id_table[] = { ++ { .uuid = IPTS_ID, .version = MEI_CL_VERSION_ANY }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(mei, ipts_device_id_table); ++ ++static struct mei_cl_driver ipts_driver = { ++ .id_table = ipts_device_id_table, ++ .name = "ipts", ++ .probe = ipts_probe, ++ .remove = ipts_remove, ++}; ++module_mei_cl_driver(ipts_driver); ++ ++MODULE_DESCRIPTION("IPTS touchscreen driver"); ++MODULE_AUTHOR("Dorian Stoll "); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/hid/ipts/mei.c b/drivers/hid/ipts/mei.c +new file mode 100644 +index 000000000000..1e0395ceae4a +--- /dev/null ++++ b/drivers/hid/ipts/mei.c +@@ -0,0 +1,188 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "mei.h" ++ ++static void locked_list_add(struct list_head *new, struct list_head *head, ++ struct rw_semaphore *lock) ++{ ++ down_write(lock); ++ list_add(new, head); ++ up_write(lock); ++} ++ ++static void locked_list_del(struct list_head *entry, struct rw_semaphore *lock) ++{ ++ down_write(lock); ++ list_del(entry); ++ up_write(lock); ++} ++ ++static void ipts_mei_incoming(struct mei_cl_device *cldev) ++{ ++ ssize_t ret = 0; ++ struct ipts_mei_message *entry = NULL; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) { ++ pr_err("MEI device is NULL!"); ++ return; ++ } ++ ++ ipts = mei_cldev_get_drvdata(cldev); ++ if (!ipts) { ++ pr_err("IPTS driver context is NULL!"); ++ return; ++ } ++ ++ entry = devm_kzalloc(ipts->dev, sizeof(*entry), GFP_KERNEL); ++ if (!entry) ++ return; ++ ++ INIT_LIST_HEAD(&entry->list); ++ ++ do { ++ ret = mei_cldev_recv(cldev, (u8 *)&entry->rsp, sizeof(entry->rsp)); ++ } while (ret == -EINTR); ++ ++ if (ret < 0) { ++ dev_err(ipts->dev, "Error while reading response: %ld\n", ret); ++ return; ++ } ++ ++ if (ret == 0) { ++ dev_err(ipts->dev, "Received empty response\n"); ++ return; ++ } ++ ++ locked_list_add(&entry->list, &ipts->mei.messages, &ipts->mei.message_lock); ++ wake_up_all(&ipts->mei.message_queue); ++} ++ ++static int ipts_mei_search(struct ipts_mei *mei, enum ipts_command_code code, ++ struct ipts_response *rsp) ++{ ++ struct ipts_mei_message *entry = NULL; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!rsp) ++ return -EFAULT; ++ ++ down_read(&mei->message_lock); ++ ++ /* ++ * Iterate over the list of received messages, and check if there is one ++ * matching the requested command code. ++ */ ++ list_for_each_entry(entry, &mei->messages, list) { ++ if (entry->rsp.cmd == code) ++ break; ++ } ++ ++ up_read(&mei->message_lock); ++ ++ /* ++ * If entry is not the list head, this means that the loop above has been stopped early, ++ * and that we found a matching element. We drop the message from the list and return it. ++ */ ++ if (!list_entry_is_head(entry, &mei->messages, list)) { ++ locked_list_del(&entry->list, &mei->message_lock); ++ ++ *rsp = entry->rsp; ++ devm_kfree(&mei->cldev->dev, entry); ++ ++ return 0; ++ } ++ ++ return -EAGAIN; ++} ++ ++int ipts_mei_recv(struct ipts_mei *mei, enum ipts_command_code code, struct ipts_response *rsp, ++ u64 timeout) ++{ ++ int ret = 0; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ /* ++ * A timeout of 0 means check and return immideately. ++ */ ++ if (timeout == 0) ++ return ipts_mei_search(mei, code, rsp); ++ ++ /* ++ * A timeout of less than 0 means to wait forever. ++ */ ++ if (timeout < 0) { ++ wait_event(mei->message_queue, ipts_mei_search(mei, code, rsp) == 0); ++ return 0; ++ } ++ ++ ret = wait_event_timeout(mei->message_queue, ipts_mei_search(mei, code, rsp) == 0, ++ msecs_to_jiffies(timeout)); ++ ++ if (ret > 0) ++ return 0; ++ ++ return -EAGAIN; ++} ++ ++int ipts_mei_send(struct ipts_mei *mei, void *data, size_t length) ++{ ++ int ret = 0; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!mei->cldev) ++ return -EFAULT; ++ ++ if (!data) ++ return -EFAULT; ++ ++ do { ++ ret = mei_cldev_send(mei->cldev, (u8 *)data, length); ++ } while (ret == -EINTR); ++ ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++int ipts_mei_init(struct ipts_mei *mei, struct mei_cl_device *cldev) ++{ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!cldev) ++ return -EFAULT; ++ ++ mei->cldev = cldev; ++ ++ INIT_LIST_HEAD(&mei->messages); ++ init_waitqueue_head(&mei->message_queue); ++ init_rwsem(&mei->message_lock); ++ ++ mei_cldev_register_rx_cb(cldev, ipts_mei_incoming); ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/mei.h b/drivers/hid/ipts/mei.h +new file mode 100644 +index 000000000000..973bade6b0fd +--- /dev/null ++++ b/drivers/hid/ipts/mei.h +@@ -0,0 +1,66 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_MEI_H ++#define IPTS_MEI_H ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "spec-device.h" ++ ++struct ipts_mei_message { ++ struct list_head list; ++ struct ipts_response rsp; ++}; ++ ++struct ipts_mei { ++ struct mei_cl_device *cldev; ++ ++ struct list_head messages; ++ ++ wait_queue_head_t message_queue; ++ struct rw_semaphore message_lock; ++}; ++ ++/** ++ * ipts_mei_recv() - Receive data from a MEI device. ++ * @mei: The IPTS MEI device context. ++ * @code: The IPTS command code to look for. ++ * @rsp: The address that the received data will be copied to. ++ * @timeout: How many milliseconds the function will wait at most. ++ * ++ * A negative timeout means to wait forever. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++int ipts_mei_recv(struct ipts_mei *mei, enum ipts_command_code code, struct ipts_response *rsp, ++ u64 timeout); ++ ++/** ++ * ipts_mei_send() - Send data to a MEI device. ++ * @ipts: The IPTS MEI device context. ++ * @data: The data to send. ++ * @size: The size of the data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_mei_send(struct ipts_mei *mei, void *data, size_t length); ++ ++/** ++ * ipts_mei_init() - Initialize the MEI device context. ++ * @mei: The MEI device context to initialize. ++ * @cldev: The MEI device the context will be bound to. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_mei_init(struct ipts_mei *mei, struct mei_cl_device *cldev); ++ ++#endif /* IPTS_MEI_H */ +diff --git a/drivers/hid/ipts/receiver.c b/drivers/hid/ipts/receiver.c +new file mode 100644 +index 000000000000..977724c728c3 +--- /dev/null ++++ b/drivers/hid/ipts/receiver.c +@@ -0,0 +1,251 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "control.h" ++#include "hid.h" ++#include "receiver.h" ++#include "resources.h" ++#include "spec-device.h" ++#include "thread.h" ++ ++static void ipts_receiver_next_doorbell(struct ipts_context *ipts) ++{ ++ u32 *doorbell = (u32 *)ipts->resources.doorbell.address; ++ *doorbell = *doorbell + 1; ++} ++ ++static u32 ipts_receiver_current_doorbell(struct ipts_context *ipts) ++{ ++ u32 *doorbell = (u32 *)ipts->resources.doorbell.address; ++ return *doorbell; ++} ++ ++static void ipts_receiver_backoff(time64_t last, u32 n) ++{ ++ /* ++ * If the last change was less than n seconds ago, ++ * sleep for a shorter period so that new data can be ++ * processed quickly. If there was no change for more than ++ * n seconds, sleep longer to avoid wasting CPU cycles. ++ */ ++ if (last + n > ktime_get_seconds()) ++ usleep_range(1 * USEC_PER_MSEC, 5 * USEC_PER_MSEC); ++ else ++ msleep(200); ++} ++ ++static int ipts_receiver_event_loop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ u32 buffer = 0; ++ ++ struct ipts_context *ipts = NULL; ++ time64_t last = ktime_get_seconds(); ++ ++ if (!thread) ++ return -EFAULT; ++ ++ ipts = thread->data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "IPTS running in event mode\n"); ++ ++ while (!ipts_thread_should_stop(thread)) { ++ int i = 0; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_control_wait_data(ipts, false); ++ if (ret == -EAGAIN) ++ break; ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ continue; ++ } ++ ++ buffer = ipts_receiver_current_doorbell(ipts) % IPTS_BUFFERS; ++ ipts_receiver_next_doorbell(ipts); ++ ++ ret = ipts_hid_input_data(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to process buffer: %d\n", ret); ++ ++ ret = ipts_control_refill_buffer(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send feedback: %d\n", ret); ++ ++ ret = ipts_control_request_data(ipts); ++ if (ret) ++ dev_err(ipts->dev, "Failed to request data: %d\n", ret); ++ ++ last = ktime_get_seconds(); ++ } ++ ++ ipts_receiver_backoff(last, 5); ++ } ++ ++ ret = ipts_control_request_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request flush: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_wait_data(ipts, true); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ ret = ipts_control_wait_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for flush: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ return 0; ++} ++ ++static int ipts_receiver_poll_loop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ u32 buffer = 0; ++ ++ u32 doorbell = 0; ++ u32 lastdb = 0; ++ ++ struct ipts_context *ipts = NULL; ++ time64_t last = ktime_get_seconds(); ++ ++ if (!thread) ++ return -EFAULT; ++ ++ ipts = thread->data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "IPTS running in poll mode\n"); ++ ++ while (true) { ++ if (ipts_thread_should_stop(thread)) { ++ ret = ipts_control_request_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request flush: %d\n", ret); ++ return ret; ++ } ++ } ++ ++ doorbell = ipts_receiver_current_doorbell(ipts); ++ ++ /* ++ * After filling up one of the data buffers, IPTS will increment ++ * the doorbell. The value of the doorbell stands for the *next* ++ * buffer that IPTS is going to fill. ++ */ ++ while (lastdb != doorbell) { ++ buffer = lastdb % IPTS_BUFFERS; ++ ++ ret = ipts_hid_input_data(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to process buffer: %d\n", ret); ++ ++ ret = ipts_control_refill_buffer(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send feedback: %d\n", ret); ++ ++ last = ktime_get_seconds(); ++ lastdb++; ++ } ++ ++ if (ipts_thread_should_stop(thread)) ++ break; ++ ++ ipts_receiver_backoff(last, 5); ++ } ++ ++ ret = ipts_control_wait_data(ipts, true); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ ret = ipts_control_wait_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for flush: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ return 0; ++} ++ ++int ipts_receiver_start(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->mode == IPTS_MODE_EVENT) { ++ ret = ipts_thread_start(&ipts->receiver_loop, ipts_receiver_event_loop, ipts, ++ "ipts_event"); ++ } else if (ipts->mode == IPTS_MODE_POLL) { ++ ret = ipts_thread_start(&ipts->receiver_loop, ipts_receiver_poll_loop, ipts, ++ "ipts_poll"); ++ } else { ++ ret = -EINVAL; ++ } ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to start receiver loop: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_receiver_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_thread_stop(&ipts->receiver_loop); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to stop receiver loop: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/receiver.h b/drivers/hid/ipts/receiver.h +new file mode 100644 +index 000000000000..3de7da62d40c +--- /dev/null ++++ b/drivers/hid/ipts/receiver.h +@@ -0,0 +1,16 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_RECEIVER_H ++#define IPTS_RECEIVER_H ++ ++#include "context.h" ++ ++int ipts_receiver_start(struct ipts_context *ipts); ++int ipts_receiver_stop(struct ipts_context *ipts); ++ ++#endif /* IPTS_RECEIVER_H */ +diff --git a/drivers/hid/ipts/resources.c b/drivers/hid/ipts/resources.c +new file mode 100644 +index 000000000000..cc14653b2a9f +--- /dev/null ++++ b/drivers/hid/ipts/resources.c +@@ -0,0 +1,131 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++ ++#include "desc.h" ++#include "resources.h" ++#include "spec-device.h" ++ ++static int ipts_resources_alloc_buffer(struct ipts_buffer *buffer, struct device *dev, size_t size) ++{ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (buffer->address) ++ return 0; ++ ++ buffer->address = dma_alloc_coherent(dev, size, &buffer->dma_address, GFP_KERNEL); ++ ++ if (!buffer->address) ++ return -ENOMEM; ++ ++ buffer->size = size; ++ buffer->device = dev; ++ ++ return 0; ++} ++ ++static void ipts_resources_free_buffer(struct ipts_buffer *buffer) ++{ ++ if (!buffer->address) ++ return; ++ ++ dma_free_coherent(buffer->device, buffer->size, buffer->address, buffer->dma_address); ++ ++ buffer->address = NULL; ++ buffer->size = 0; ++ ++ buffer->dma_address = 0; ++ buffer->device = NULL; ++} ++ ++int ipts_resources_init(struct ipts_resources *res, struct device *dev, size_t ds, size_t fs) ++{ ++ int ret = 0; ++ ++ /* ++ * Some compilers (AOSP clang) complain about a redefined ++ * variable when this is declared inside of the for loop. ++ */ ++ int i = 0; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_resources_alloc_buffer(&res->data[i], dev, ds); ++ if (ret) ++ goto err; ++ } ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_resources_alloc_buffer(&res->feedback[i], dev, fs); ++ if (ret) ++ goto err; ++ } ++ ++ ret = ipts_resources_alloc_buffer(&res->doorbell, dev, sizeof(u32)); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->workqueue, dev, sizeof(u32)); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->hid2me, dev, fs); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->descriptor, dev, ds + 8); ++ if (ret) ++ goto err; ++ ++ if (!res->report.address) { ++ res->report.size = IPTS_HID_REPORT_DATA_SIZE; ++ res->report.address = kzalloc(res->report.size, GFP_KERNEL); ++ ++ if (!res->report.address) { ++ ret = -ENOMEM; ++ goto err; ++ } ++ } ++ ++ return 0; ++ ++err: ++ ++ ipts_resources_free(res); ++ return ret; ++} ++ ++int ipts_resources_free(struct ipts_resources *res) ++{ ++ int i = 0; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) ++ ipts_resources_free_buffer(&res->data[i]); ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) ++ ipts_resources_free_buffer(&res->feedback[i]); ++ ++ ipts_resources_free_buffer(&res->doorbell); ++ ipts_resources_free_buffer(&res->workqueue); ++ ipts_resources_free_buffer(&res->hid2me); ++ ipts_resources_free_buffer(&res->descriptor); ++ ++ kfree(res->report.address); ++ res->report.address = NULL; ++ res->report.size = 0; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/resources.h b/drivers/hid/ipts/resources.h +new file mode 100644 +index 000000000000..2068e13285f0 +--- /dev/null ++++ b/drivers/hid/ipts/resources.h +@@ -0,0 +1,41 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_RESOURCES_H ++#define IPTS_RESOURCES_H ++ ++#include ++#include ++ ++#include "spec-device.h" ++ ++struct ipts_buffer { ++ u8 *address; ++ size_t size; ++ ++ dma_addr_t dma_address; ++ struct device *device; ++}; ++ ++struct ipts_resources { ++ struct ipts_buffer data[IPTS_BUFFERS]; ++ struct ipts_buffer feedback[IPTS_BUFFERS]; ++ ++ struct ipts_buffer doorbell; ++ struct ipts_buffer workqueue; ++ struct ipts_buffer hid2me; ++ ++ struct ipts_buffer descriptor; ++ ++ // Buffer for synthesizing HID reports ++ struct ipts_buffer report; ++}; ++ ++int ipts_resources_init(struct ipts_resources *res, struct device *dev, size_t ds, size_t fs); ++int ipts_resources_free(struct ipts_resources *res); ++ ++#endif /* IPTS_RESOURCES_H */ +diff --git a/drivers/hid/ipts/spec-data.h b/drivers/hid/ipts/spec-data.h +new file mode 100644 +index 000000000000..e8dd98895a7e +--- /dev/null ++++ b/drivers/hid/ipts/spec-data.h +@@ -0,0 +1,100 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2016 Intel Corporation ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_DATA_H ++#define IPTS_SPEC_DATA_H ++ ++#include ++#include ++ ++/** ++ * enum ipts_feedback_cmd_type - Commands that can be executed on the sensor through feedback. ++ */ ++enum ipts_feedback_cmd_type { ++ IPTS_FEEDBACK_CMD_TYPE_NONE = 0, ++ IPTS_FEEDBACK_CMD_TYPE_SOFT_RESET = 1, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_ARMED = 2, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SENSING = 3, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SLEEP = 4, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_DOZE = 5, ++ IPTS_FEEDBACK_CMD_TYPE_HARD_RESET = 6, ++}; ++ ++/** ++ * enum ipts_feedback_data_type - Defines what data a feedback buffer contains. ++ * @IPTS_FEEDBACK_DATA_TYPE_VENDOR: The buffer contains vendor specific feedback. ++ * @IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES: The buffer contains a HID set features report. ++ * @IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES: The buffer contains a HID get features report. ++ * @IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT: The buffer contains a HID output report. ++ * @IPTS_FEEDBACK_DATA_TYPE_STORE_DATA: The buffer contains calibration data for the sensor. ++ */ ++enum ipts_feedback_data_type { ++ IPTS_FEEDBACK_DATA_TYPE_VENDOR = 0, ++ IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES = 1, ++ IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES = 2, ++ IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT = 3, ++ IPTS_FEEDBACK_DATA_TYPE_STORE_DATA = 4, ++}; ++ ++/** ++ * struct ipts_feedback_header - Header that is prefixed to the data in a feedback buffer. ++ * @cmd_type: A command that should be executed on the sensor. ++ * @size: The size of the payload to be written. ++ * @buffer: The ID of the buffer that contains this feedback data. ++ * @protocol: The protocol version of the EDS. ++ * @data_type: The type of data that the buffer contains. ++ * @spi_offset: The offset at which to write the payload data to the sensor. ++ * @payload: Payload for the feedback command, or 0 if no payload is sent. ++ */ ++struct ipts_feedback_header { ++ enum ipts_feedback_cmd_type cmd_type; ++ u32 size; ++ u32 buffer; ++ u32 protocol; ++ enum ipts_feedback_data_type data_type; ++ u32 spi_offset; ++ u8 reserved[40]; ++ u8 payload[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_feedback_header) == 64); ++ ++/** ++ * enum ipts_data_type - Defines what type of data a buffer contains. ++ * @IPTS_DATA_TYPE_FRAME: Raw data frame. ++ * @IPTS_DATA_TYPE_ERROR: Error data. ++ * @IPTS_DATA_TYPE_VENDOR: Vendor specific data. ++ * @IPTS_DATA_TYPE_HID: A HID report. ++ * @IPTS_DATA_TYPE_GET_FEATURES: The response to a GET_FEATURES HID2ME command. ++ */ ++enum ipts_data_type { ++ IPTS_DATA_TYPE_FRAME = 0x00, ++ IPTS_DATA_TYPE_ERROR = 0x01, ++ IPTS_DATA_TYPE_VENDOR = 0x02, ++ IPTS_DATA_TYPE_HID = 0x03, ++ IPTS_DATA_TYPE_GET_FEATURES = 0x04, ++ IPTS_DATA_TYPE_DESCRIPTOR = 0x05, ++}; ++ ++/** ++ * struct ipts_data_header - Header that is prefixed to the data in a data buffer. ++ * @type: What data the buffer contains. ++ * @size: How much data the buffer contains. ++ * @buffer: Which buffer the data is in. ++ */ ++struct ipts_data_header { ++ enum ipts_data_type type; ++ u32 size; ++ u32 buffer; ++ u8 reserved[52]; ++ u8 data[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_data_header) == 64); ++ ++#endif /* IPTS_SPEC_DATA_H */ +diff --git a/drivers/hid/ipts/spec-device.h b/drivers/hid/ipts/spec-device.h +new file mode 100644 +index 000000000000..41845f9d9025 +--- /dev/null ++++ b/drivers/hid/ipts/spec-device.h +@@ -0,0 +1,290 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2016 Intel Corporation ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_DEVICE_H ++#define IPTS_SPEC_DEVICE_H ++ ++#include ++#include ++ ++/* ++ * The amount of buffers that IPTS can use for data transfer. ++ */ ++#define IPTS_BUFFERS 16 ++ ++/* ++ * The buffer ID that is used for HID2ME feedback ++ */ ++#define IPTS_HID2ME_BUFFER IPTS_BUFFERS ++ ++/** ++ * enum ipts_command - Commands that can be sent to the IPTS hardware. ++ * @IPTS_CMD_GET_DEVICE_INFO: Retrieves vendor information from the device. ++ * @IPTS_CMD_SET_MODE: Changes the mode that the device will operate in. ++ * @IPTS_CMD_SET_MEM_WINDOW: Configures memory buffers for passing data between device and driver. ++ * @IPTS_CMD_QUIESCE_IO: Stops the data flow from the device to the driver. ++ * @IPTS_CMD_READY_FOR_DATA: Informs the device that the driver is ready to receive data. ++ * @IPTS_CMD_FEEDBACK: Informs the device that a buffer was processed and can be refilled. ++ * @IPTS_CMD_CLEAR_MEM_WINDOW: Stops the data flow and clears the buffer addresses on the device. ++ * @IPTS_CMD_RESET_SENSOR: Resets the sensor to its default state. ++ * @IPTS_CMD_GET_DESCRIPTOR: Retrieves the HID descriptor of the device. ++ */ ++enum ipts_command_code { ++ IPTS_CMD_GET_DEVICE_INFO = 0x01, ++ IPTS_CMD_SET_MODE = 0x02, ++ IPTS_CMD_SET_MEM_WINDOW = 0x03, ++ IPTS_CMD_QUIESCE_IO = 0x04, ++ IPTS_CMD_READY_FOR_DATA = 0x05, ++ IPTS_CMD_FEEDBACK = 0x06, ++ IPTS_CMD_CLEAR_MEM_WINDOW = 0x07, ++ IPTS_CMD_RESET_SENSOR = 0x0B, ++ IPTS_CMD_GET_DESCRIPTOR = 0x0F, ++}; ++ ++/** ++ * enum ipts_status - Possible status codes returned by the IPTS device. ++ * @IPTS_STATUS_SUCCESS: Operation completed successfully. ++ * @IPTS_STATUS_INVALID_PARAMS: Command contained an invalid payload. ++ * @IPTS_STATUS_ACCESS_DENIED: ME could not validate a buffer address. ++ * @IPTS_STATUS_CMD_SIZE_ERROR: Command contains an invalid payload. ++ * @IPTS_STATUS_NOT_READY: Buffer addresses have not been set. ++ * @IPTS_STATUS_REQUEST_OUTSTANDING: There is an outstanding command of the same type. ++ * @IPTS_STATUS_NO_SENSOR_FOUND: No sensor could be found. ++ * @IPTS_STATUS_OUT_OF_MEMORY: Not enough free memory for requested operation. ++ * @IPTS_STATUS_INTERNAL_ERROR: An unexpected error occurred. ++ * @IPTS_STATUS_SENSOR_DISABLED: The sensor has been disabled and must be reinitialized. ++ * @IPTS_STATUS_COMPAT_CHECK_FAIL: Compatibility revision check between sensor and ME failed. ++ * The host can ignore this error and attempt to continue. ++ * @IPTS_STATUS_SENSOR_EXPECTED_RESET: The sensor went through a reset initiated by the driver. ++ * @IPTS_STATUS_SENSOR_UNEXPECTED_RESET: The sensor went through an unexpected reset. ++ * @IPTS_STATUS_RESET_FAILED: Requested sensor reset failed to complete. ++ * @IPTS_STATUS_TIMEOUT: The operation timed out. ++ * @IPTS_STATUS_TEST_MODE_FAIL: Test mode pattern did not match expected values. ++ * @IPTS_STATUS_SENSOR_FAIL_FATAL: The sensor reported an error during reset sequence. ++ * Further progress is not possible. ++ * @IPTS_STATUS_SENSOR_FAIL_NONFATAL: The sensor reported an error during reset sequence. ++ * The driver can attempt to continue. ++ * @IPTS_STATUS_INVALID_DEVICE_CAPS: The device reported invalid capabilities. ++ * @IPTS_STATUS_QUIESCE_IO_IN_PROGRESS: Command cannot be completed until Quiesce IO is done. ++ */ ++enum ipts_status { ++ IPTS_STATUS_SUCCESS = 0x00, ++ IPTS_STATUS_INVALID_PARAMS = 0x01, ++ IPTS_STATUS_ACCESS_DENIED = 0x02, ++ IPTS_STATUS_CMD_SIZE_ERROR = 0x03, ++ IPTS_STATUS_NOT_READY = 0x04, ++ IPTS_STATUS_REQUEST_OUTSTANDING = 0x05, ++ IPTS_STATUS_NO_SENSOR_FOUND = 0x06, ++ IPTS_STATUS_OUT_OF_MEMORY = 0x07, ++ IPTS_STATUS_INTERNAL_ERROR = 0x08, ++ IPTS_STATUS_SENSOR_DISABLED = 0x09, ++ IPTS_STATUS_COMPAT_CHECK_FAIL = 0x0A, ++ IPTS_STATUS_SENSOR_EXPECTED_RESET = 0x0B, ++ IPTS_STATUS_SENSOR_UNEXPECTED_RESET = 0x0C, ++ IPTS_STATUS_RESET_FAILED = 0x0D, ++ IPTS_STATUS_TIMEOUT = 0x0E, ++ IPTS_STATUS_TEST_MODE_FAIL = 0x0F, ++ IPTS_STATUS_SENSOR_FAIL_FATAL = 0x10, ++ IPTS_STATUS_SENSOR_FAIL_NONFATAL = 0x11, ++ IPTS_STATUS_INVALID_DEVICE_CAPS = 0x12, ++ IPTS_STATUS_QUIESCE_IO_IN_PROGRESS = 0x13, ++}; ++ ++/** ++ * struct ipts_command - Message that is sent to the device for calling a command. ++ * @cmd: The command that will be called. ++ * @payload: Payload containing parameters for the called command. ++ */ ++struct ipts_command { ++ enum ipts_command_code cmd; ++ u8 payload[320]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_command) == 324); ++ ++/** ++ * enum ipts_mode - Configures what data the device produces and how its sent. ++ * @IPTS_MODE_EVENT: The device will send an event once a buffer was filled. ++ * Older devices will return singletouch data in this mode. ++ * @IPTS_MODE_POLL: The device will notify the driver by incrementing the doorbell value. ++ * Older devices will return multitouch data in this mode. ++ */ ++enum ipts_mode { ++ IPTS_MODE_EVENT = 0x00, ++ IPTS_MODE_POLL = 0x01, ++}; ++ ++/** ++ * struct ipts_set_mode - Payload for the SET_MODE command. ++ * @mode: Changes the mode that IPTS will operate in. ++ */ ++struct ipts_set_mode { ++ enum ipts_mode mode; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_set_mode) == 16); ++ ++#define IPTS_WORKQUEUE_SIZE 8192 ++#define IPTS_WORKQUEUE_ITEM_SIZE 16 ++ ++/** ++ * struct ipts_mem_window - Payload for the SET_MEM_WINDOW command. ++ * @data_addr_lower: Lower 32 bits of the data buffer addresses. ++ * @data_addr_upper: Upper 32 bits of the data buffer addresses. ++ * @workqueue_addr_lower: Lower 32 bits of the workqueue buffer address. ++ * @workqueue_addr_upper: Upper 32 bits of the workqueue buffer address. ++ * @doorbell_addr_lower: Lower 32 bits of the doorbell buffer address. ++ * @doorbell_addr_upper: Upper 32 bits of the doorbell buffer address. ++ * @feedbackaddr_lower: Lower 32 bits of the feedback buffer addresses. ++ * @feedbackaddr_upper: Upper 32 bits of the feedback buffer addresses. ++ * @hid2me_addr_lower: Lower 32 bits of the hid2me buffer address. ++ * @hid2me_addr_upper: Upper 32 bits of the hid2me buffer address. ++ * @hid2me_size: Size of the hid2me feedback buffer. ++ * @workqueue_item_size: Magic value. Must be 16. ++ * @workqueue_size: Magic value. Must be 8192. ++ * ++ * The workqueue related items in this struct are required for using ++ * GuC submission with binary processing firmware. Since this driver does ++ * not use GuC submission and instead exports raw data to userspace, these ++ * items are not actually used, but they need to be allocated and passed ++ * to the device, otherwise initialization will fail. ++ */ ++struct ipts_mem_window { ++ u32 data_addr_lower[IPTS_BUFFERS]; ++ u32 data_addr_upper[IPTS_BUFFERS]; ++ u32 workqueue_addr_lower; ++ u32 workqueue_addr_upper; ++ u32 doorbell_addr_lower; ++ u32 doorbell_addr_upper; ++ u32 feedback_addr_lower[IPTS_BUFFERS]; ++ u32 feedback_addr_upper[IPTS_BUFFERS]; ++ u32 hid2me_addr_lower; ++ u32 hid2me_addr_upper; ++ u32 hid2me_size; ++ u8 reserved1; ++ u8 workqueue_item_size; ++ u16 workqueue_size; ++ u8 reserved[32]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_mem_window) == 320); ++ ++/** ++ * struct ipts_quiesce_io - Payload for the QUIESCE_IO command. ++ */ ++struct ipts_quiesce_io { ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_quiesce_io) == 12); ++ ++/** ++ * struct ipts_feedback - Payload for the FEEDBACK command. ++ * @buffer: The buffer that the device should refill. ++ */ ++struct ipts_feedback { ++ u32 buffer; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_feedback) == 16); ++ ++/** ++ * enum ipts_reset_type - Possible ways of resetting the device. ++ * @IPTS_RESET_TYPE_HARD: Perform hardware reset using GPIO pin. ++ * @IPTS_RESET_TYPE_SOFT: Perform software reset using SPI command. ++ */ ++enum ipts_reset_type { ++ IPTS_RESET_TYPE_HARD = 0x00, ++ IPTS_RESET_TYPE_SOFT = 0x01, ++}; ++ ++/** ++ * struct ipts_reset - Payload for the RESET_SENSOR command. ++ * @type: How the device should get reset. ++ */ ++struct ipts_reset_sensor { ++ enum ipts_reset_type type; ++ u8 reserved[4]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_reset_sensor) == 8); ++ ++/** ++ * struct ipts_get_descriptor - Payload for the GET_DESCRIPTOR command. ++ * @addr_lower: The lower 32 bits of the descriptor buffer address. ++ * @addr_upper: The upper 32 bits of the descriptor buffer address. ++ * @magic: A magic value. Must be 8. ++ */ ++struct ipts_get_descriptor { ++ u32 addr_lower; ++ u32 addr_upper; ++ u32 magic; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_get_descriptor) == 24); ++ ++/* ++ * The type of a response is indicated by a ++ * command code, with the most significant bit flipped to 1. ++ */ ++#define IPTS_RSP_BIT BIT(31) ++ ++/** ++ * struct ipts_response - Data returned from the device in response to a command. ++ * @cmd: The command that this response answers (IPTS_RSP_BIT will be 1). ++ * @status: The return code of the command. ++ * @payload: The data that was produced by the command. ++ */ ++struct ipts_response { ++ enum ipts_command_code cmd; ++ enum ipts_status status; ++ u8 payload[80]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_response) == 88); ++ ++/** ++ * struct ipts_device_info - Vendor information of the IPTS device. ++ * @vendor: Vendor ID of this device. ++ * @product: Product ID of this device. ++ * @hw_version: Hardware revision of this device. ++ * @fw_version: Firmware revision of this device. ++ * @data_size: Requested size for a data buffer. ++ * @feedback_size: Requested size for a feedback buffer. ++ * @mode: Mode that the device currently operates in. ++ * @max_contacts: Maximum amount of concurrent touches the sensor can process. ++ * @sensor_min_eds: The minimum EDS version supported by the sensor. ++ * @sensor_max_eds: The maximum EDS version supported by the sensor. ++ * @me_min_eds: The minimum EDS version supported by the ME for communicating with the sensor. ++ * @me_max_eds: The maximum EDS version supported by the ME for communicating with the sensor. ++ * @intf_eds: The EDS version implemented by the interface between ME and host. ++ */ ++struct ipts_device_info { ++ u16 vendor; ++ u16 product; ++ u32 hw_version; ++ u32 fw_version; ++ u32 data_size; ++ u32 feedback_size; ++ enum ipts_mode mode; ++ u8 max_contacts; ++ u8 reserved1[3]; ++ u8 sensor_min_eds; ++ u8 sensor_maj_eds; ++ u8 me_min_eds; ++ u8 me_maj_eds; ++ u8 intf_eds; ++ u8 reserved2[11]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_device_info) == 44); ++ ++#endif /* IPTS_SPEC_DEVICE_H */ +diff --git a/drivers/hid/ipts/spec-hid.h b/drivers/hid/ipts/spec-hid.h +new file mode 100644 +index 000000000000..5a58d4a0a610 +--- /dev/null ++++ b/drivers/hid/ipts/spec-hid.h +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_HID_H ++#define IPTS_SPEC_HID_H ++ ++#include ++#include ++ ++/* ++ * Made-up type for passing raw IPTS data in a HID report. ++ */ ++#define IPTS_HID_FRAME_TYPE_RAW 0xEE ++ ++/** ++ * struct ipts_hid_frame - Header that is prefixed to raw IPTS data wrapped in a HID report. ++ * @size: Size of the data inside the report, including this header. ++ * @type: What type of data does this report contain. ++ */ ++struct ipts_hid_header { ++ u32 size; ++ u8 reserved1; ++ u8 type; ++ u8 reserved2; ++ u8 data[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_hid_header) == 7); ++ ++#endif /* IPTS_SPEC_HID_H */ +diff --git a/drivers/hid/ipts/thread.c b/drivers/hid/ipts/thread.c +new file mode 100644 +index 000000000000..355e92bea26f +--- /dev/null ++++ b/drivers/hid/ipts/thread.c +@@ -0,0 +1,84 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "thread.h" ++ ++bool ipts_thread_should_stop(struct ipts_thread *thread) ++{ ++ if (!thread) ++ return false; ++ ++ return READ_ONCE(thread->should_stop); ++} ++ ++static int ipts_thread_runner(void *data) ++{ ++ int ret = 0; ++ struct ipts_thread *thread = data; ++ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!thread->threadfn) ++ return -EFAULT; ++ ++ ret = thread->threadfn(thread); ++ complete_all(&thread->done); ++ ++ return ret; ++} ++ ++int ipts_thread_start(struct ipts_thread *thread, int (*threadfn)(struct ipts_thread *thread), ++ void *data, const char *name) ++{ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!threadfn) ++ return -EFAULT; ++ ++ init_completion(&thread->done); ++ ++ thread->data = data; ++ thread->should_stop = false; ++ thread->threadfn = threadfn; ++ ++ thread->thread = kthread_run(ipts_thread_runner, thread, name); ++ return PTR_ERR_OR_ZERO(thread->thread); ++} ++ ++int ipts_thread_stop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!thread->thread) ++ return 0; ++ ++ WRITE_ONCE(thread->should_stop, true); ++ ++ /* ++ * Make sure that the write has gone through before waiting. ++ */ ++ wmb(); ++ ++ wait_for_completion(&thread->done); ++ ret = kthread_stop(thread->thread); ++ ++ thread->thread = NULL; ++ thread->data = NULL; ++ thread->threadfn = NULL; ++ ++ return ret; ++} +diff --git a/drivers/hid/ipts/thread.h b/drivers/hid/ipts/thread.h +new file mode 100644 +index 000000000000..1f966b8b32c4 +--- /dev/null ++++ b/drivers/hid/ipts/thread.h +@@ -0,0 +1,59 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_THREAD_H ++#define IPTS_THREAD_H ++ ++#include ++#include ++#include ++ ++/* ++ * This wrapper over kthread is necessary, because calling kthread_stop makes it impossible ++ * to issue MEI commands from that thread while it shuts itself down. By using a custom ++ * boolean variable and a completion object, we can call kthread_stop only when the thread ++ * already finished all of its work and has returned. ++ */ ++struct ipts_thread { ++ struct task_struct *thread; ++ ++ bool should_stop; ++ struct completion done; ++ ++ void *data; ++ int (*threadfn)(struct ipts_thread *thread); ++}; ++ ++/** ++ * ipts_thread_should_stop() - Returns true if the thread is asked to terminate. ++ * @thread: The current thread. ++ * ++ * Returns: true if the thread should stop, false if not. ++ */ ++bool ipts_thread_should_stop(struct ipts_thread *thread); ++ ++/** ++ * ipts_thread_start() - Starts an IPTS thread. ++ * @thread: The thread to initialize and start. ++ * @threadfn: The function to execute. ++ * @data: An argument that will be passed to threadfn. ++ * @name: The name of the new thread. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_thread_start(struct ipts_thread *thread, int (*threadfn)(struct ipts_thread *thread), ++ void *data, const char name[]); ++ ++/** ++ * ipts_thread_stop() - Asks the thread to terminate and waits until it has finished. ++ * @thread: The thread that should stop. ++ * ++ * Returns: The return value of the thread function. ++ */ ++int ipts_thread_stop(struct ipts_thread *thread); ++ ++#endif /* IPTS_THREAD_H */ +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch b/app-admin/kernel-tools/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch new file mode 100644 index 00000000000..7325e0a038b --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch @@ -0,0 +1,79 @@ +From d965abd62ec5a3a38a5a9763b972c61335176eca Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 10 Oct 2021 20:56:57 +0200 +Subject: [PATCH 117/155] SURFACE: ACPI: delay enumeration of devices with a + _DEP pointing to an INT3472 device + +The clk and regulator frameworks expect clk/regulator consumer-devices +to have info about the consumed clks/regulators described in the device's +fw_node. + +To work around cases where this info is not present in the firmware tables, +which is often the case on x86/ACPI devices, both frameworks allow the +provider-driver to attach info about consumers to the clks/regulators +when registering these. + +This causes problems with the probe ordering wrt drivers for consumers +of these clks/regulators. Since the lookups are only registered when the +provider-driver binds, trying to get these clks/regulators before then +results in a -ENOENT error for clks and a dummy regulator for regulators. + +One case where we hit this issue is camera sensors such as e.g. the OV8865 +sensor found on the Microsoft Surface Go. The sensor uses clks, regulators +and GPIOs provided by a TPS68470 PMIC which is described in an INT3472 +ACPI device. There is special platform code handling this and setting +platform_data with the necessary consumer info on the MFD cells +instantiated for the PMIC under: drivers/platform/x86/intel/int3472. + +For this to work properly the ov8865 driver must not bind to the I2C-client +for the OV8865 sensor until after the TPS68470 PMIC gpio, regulator and +clk MFD cells have all been fully setup. + +The OV8865 on the Microsoft Surface Go is just one example, all X86 +devices using the Intel IPU3 camera block found on recent Intel SoCs +have similar issues where there is an INT3472 HID ACPI-device, which +describes the clks and regulators, and the driver for this INT3472 device +must be fully initialized before the sensor driver (any sensor driver) +binds for things to work properly. + +On these devices the ACPI nodes describing the sensors all have a _DEP +dependency on the matching INT3472 ACPI device (there is one per sensor). + +This allows solving the probe-ordering problem by delaying the enumeration +(instantiation of the I2C-client in the ov8865 example) of ACPI-devices +which have a _DEP dependency on an INT3472 device. + +The new acpi_dev_ready_for_enumeration() helper used for this is also +exported because for devices, which have the enumeration_by_parent flag +set, the parent-driver will do its own scan of child ACPI devices and +it will try to enumerate those during its probe(). Code doing this such +as e.g. the i2c-core-acpi.c code must call this new helper to ensure +that it too delays the enumeration until all the _DEP dependencies are +met on devices which have the new honor_deps flag set. + +Signed-off-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/60b2e713e86789d7d6f7f28a46f8fa32c181a56a +Signed-off-by: Kexy Biscuit +--- + drivers/acpi/scan.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index 22ae7829a915..0fe281280316 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -2185,6 +2185,9 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, + + static void acpi_default_enumeration(struct acpi_device *device) + { ++ if (!acpi_dev_ready_for_enumeration(device)) ++ return; ++ + /* + * Do not enumerate devices with enumeration_by_parent flag set as + * they will be enumerated by their respective parents. +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch b/app-admin/kernel-tools/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch new file mode 100644 index 00000000000..b92dd4013a4 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch @@ -0,0 +1,114 @@ +From e697b7a02970bd52b5b2aa0f98a91fa12ace671c Mon Sep 17 00:00:00 2001 +From: zouxiaoh +Date: Fri, 25 Jun 2021 08:52:59 +0800 +Subject: [PATCH 118/155] SURFACE: iommu: intel-ipu: use IOMMU passthrough mode + for Intel IPUs + +Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, +The IPU driver allocates its own page table that is not mapped +via the DMA, and thus the Intel IOMMU driver blocks access giving +this error: DMAR: DRHD: handling fault status reg 3 DMAR: +[DMA Read] Request device [00:05.0] PASID ffffffff +fault addr 76406000 [fault reason 06] PTE Read access is not set +As IPU is not an external facing device which is not risky, so use +IOMMU passthrough mode for Intel IPUs. + +Change-Id: I6dcccdadac308cf42e20a18e1b593381391e3e6b +Depends-On: Iacd67578e8c6a9b9ac73285f52b4081b72fb68a6 +Tracked-On: #JIITL8-411 +Signed-off-by: Bingbu Cao +Signed-off-by: zouxiaoh +Signed-off-by: Xu Chongyang +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/a06834b1abe43c0afbb5f4a1e1a1e85f249cab18 +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index dea755f15010..c8406641ba9d 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -45,6 +45,13 @@ + ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x34E4) \ + ) + ++#define IS_INTEL_IPU(pdev) ((pdev)->vendor == PCI_VENDOR_ID_INTEL && \ ++ ((pdev)->device == 0x9a19 || \ ++ (pdev)->device == 0x9a39 || \ ++ (pdev)->device == 0x4e19 || \ ++ (pdev)->device == 0x465d || \ ++ (pdev)->device == 0x1919)) ++ + #define IOAPIC_RANGE_START (0xfee00000) + #define IOAPIC_RANGE_END (0xfeefffff) + #define IOVA_START_ADDR (0x1000) +@@ -223,12 +230,14 @@ int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + + static int dmar_map_ipts = 1; ++static int dmar_map_ipu = 1; + static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; + + #define IDENTMAP_AZALIA 4 ++#define IDENTMAP_IPU 8 + #define IDENTMAP_IPTS 16 + + const struct iommu_ops intel_iommu_ops; +@@ -2164,6 +2173,9 @@ static int device_def_domain_type(struct device *dev) + if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) + return IOMMU_DOMAIN_IDENTITY; + ++ if ((iommu_identity_mapping & IDENTMAP_IPU) && IS_INTEL_IPU(pdev)) ++ return IOMMU_DOMAIN_IDENTITY; ++ + if ((iommu_identity_mapping & IDENTMAP_IPTS) && IS_IPTS(pdev)) + return IOMMU_DOMAIN_IDENTITY; + } +@@ -2466,6 +2478,9 @@ static int __init init_dmars(void) + iommu_set_root_entry(iommu); + } + ++ if (!dmar_map_ipu) ++ iommu_identity_mapping |= IDENTMAP_IPU; ++ + if (!dmar_map_ipts) + iommu_identity_mapping |= IDENTMAP_IPTS; + +@@ -4714,6 +4729,18 @@ static void quirk_iommu_igfx(struct pci_dev *dev) + disable_igfx_iommu = 1; + } + ++static void quirk_iommu_ipu(struct pci_dev *dev) ++{ ++ if (!IS_INTEL_IPU(dev)) ++ return; ++ ++ if (risky_device(dev)) ++ return; ++ ++ pci_info(dev, "Passthrough IOMMU for integrated Intel IPU\n"); ++ dmar_map_ipu = 0; ++} ++ + static void quirk_iommu_ipts(struct pci_dev *dev) + { + if (!IS_IPTS(dev)) +@@ -4764,6 +4791,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1632, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163A, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx); + ++/* disable IPU dmar support */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_iommu_ipu); ++ + /* disable IPTS dmar support */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9D3E, quirk_iommu_ipts); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x34E4, quirk_iommu_ipts); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch b/app-admin/kernel-tools/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch new file mode 100644 index 00000000000..94442746faa --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch @@ -0,0 +1,41 @@ +From 2de25b51d1baf0ee51b20375f36fcecfc6564a54 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Sun, 10 Oct 2021 20:57:02 +0200 +Subject: [PATCH 119/155] SURFACE: platform/x86: int3472: Enable I2c daisy + chain + +The TPS68470 PMIC has an I2C passthrough mode through which I2C traffic +can be forwarded to a device connected to the PMIC as though it were +connected directly to the system bus. Enable this mode when the chip +is initialised. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/11ccfff2684694956fb2156f8216c1275a6bd97d +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/tps68470.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c +index 1e107fd49f82..e3e1696e7f0e 100644 +--- a/drivers/platform/x86/intel/int3472/tps68470.c ++++ b/drivers/platform/x86/intel/int3472/tps68470.c +@@ -46,6 +46,13 @@ static int tps68470_chip_init(struct device *dev, struct regmap *regmap) + return ret; + } + ++ /* Enable I2C daisy chain */ ++ ret = regmap_write(regmap, TPS68470_REG_S_I2C_CTL, 0x03); ++ if (ret) { ++ dev_err(dev, "Failed to enable i2c daisy chain\n"); ++ return ret; ++ } ++ + dev_info(dev, "TPS68470 REVID: 0x%02x\n", version); + + return 0; +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch b/app-admin/kernel-tools/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch new file mode 100644 index 00000000000..30e1bb395f7 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch @@ -0,0 +1,60 @@ +From 90996eea1e8d05e24276376378641c969d867e5f Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Thu, 2 Mar 2023 12:59:39 +0000 +Subject: [PATCH 120/155] SURFACE: platform/x86: int3472: Remap reset GPIO for + INT347E + +ACPI _HID INT347E represents the OmniVision 7251 camera sensor. The +driver for this sensor expects a single pin named "enable", but on +some Microsoft Surface platforms the sensor is assigned a single +GPIO who's type flag is INT3472_GPIO_TYPE_RESET. + +Remap the GPIO pin's function from "reset" to "enable". This is done +outside of the existing remap table since it is a more widespread +discrepancy than that method is designed for. Additionally swap the +polarity of the pin to match the driver's expectation. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/469d8067637b158a501d8fa221cf7f922c021345 +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/discrete.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c +index 07b302e09340..baad1e50ca81 100644 +--- a/drivers/platform/x86/intel/int3472/discrete.c ++++ b/drivers/platform/x86/intel/int3472/discrete.c +@@ -83,12 +83,27 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 + const char *func, u32 polarity) + { + int ret; ++ const struct acpi_device_id ov7251_ids[] = { ++ { "INT347E" }, ++ { } ++ }; + + if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { + dev_warn(int3472->dev, "Too many GPIOs mapped\n"); + return -EINVAL; + } + ++ /* ++ * In addition to the function remap table we need to bulk remap the ++ * "reset" GPIO for the OmniVision 7251 sensor, as the driver for that ++ * expects its only GPIO pin to be called "enable" (and to have the ++ * opposite polarity). ++ */ ++ if (!strcmp(func, "reset") && !acpi_match_device_ids(int3472->sensor, ov7251_ids)) { ++ func = "enable"; ++ polarity ^= GPIO_ACTIVE_LOW; ++ } ++ + ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], + agpio, func, polarity); + if (ret) +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch b/app-admin/kernel-tools/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch new file mode 100644 index 00000000000..a319cd46025 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch @@ -0,0 +1,43 @@ +From a0612bf68bf671155ffeae359e2f75e6472a5346 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Tue, 21 Mar 2023 13:45:26 +0000 +Subject: [PATCH 121/155] SURFACE: media: i2c: Clarify that gain is Analogue + gain in OV7251 + +Update the control ID for the gain control in the ov7251 driver to +V4L2_CID_ANALOGUE_GAIN. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/7a741f318b87a42d351d142512d55f0407a7e9e3 +Signed-off-by: Kexy Biscuit +--- + drivers/media/i2c/ov7251.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c +index 30f61e04ecaf..9c1292ca8552 100644 +--- a/drivers/media/i2c/ov7251.c ++++ b/drivers/media/i2c/ov7251.c +@@ -1051,7 +1051,7 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl) + case V4L2_CID_EXPOSURE: + ret = ov7251_set_exposure(ov7251, ctrl->val); + break; +- case V4L2_CID_GAIN: ++ case V4L2_CID_ANALOGUE_GAIN: + ret = ov7251_set_gain(ov7251, ctrl->val); + break; + case V4L2_CID_TEST_PATTERN: +@@ -1572,7 +1572,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251) + ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, + V4L2_CID_EXPOSURE, 1, 32, 1, 32); + ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, +- V4L2_CID_GAIN, 16, 1023, 1, 16); ++ V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 16); + v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops, + V4L2_CID_TEST_PATTERN, + ARRAY_SIZE(ov7251_test_pattern_menu) - 1, +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch b/app-admin/kernel-tools/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch new file mode 100644 index 00000000000..6bc9d8faaa9 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch @@ -0,0 +1,54 @@ +From 2d2860b836c3921a51d4a42b5986590019057d87 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Wed, 22 Mar 2023 11:01:42 +0000 +Subject: [PATCH 122/155] SURFACE: media: v4l2-core: Acquire privacy led in + v4l2_async_register_subdev() + +The current call to v4l2_subdev_get_privacy_led() is contained in +v4l2_async_register_subdev_sensor(), but that function isn't used by +all the sensor drivers. Move the acquisition of the privacy led to +v4l2_async_register_subdev() instead. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8baca29ff57339999c716555b4f1d961abbec3b2 +Signed-off-by: Kexy Biscuit +--- + drivers/media/v4l2-core/v4l2-async.c | 4 ++++ + drivers/media/v4l2-core/v4l2-fwnode.c | 4 ---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c +index ee884a8221fb..4f6bafd900ee 100644 +--- a/drivers/media/v4l2-core/v4l2-async.c ++++ b/drivers/media/v4l2-core/v4l2-async.c +@@ -799,6 +799,10 @@ int __v4l2_async_register_subdev(struct v4l2_subdev *sd, struct module *module) + + INIT_LIST_HEAD(&sd->asc_list); + ++ ret = v4l2_subdev_get_privacy_led(sd); ++ if (ret < 0) ++ return ret; ++ + /* + * No reference taken. The reference is held by the device (struct + * v4l2_subdev.dev), and async sub-device does not exist independently +diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c +index f19c8adf2c61..923ed1b5ab8b 100644 +--- a/drivers/media/v4l2-core/v4l2-fwnode.c ++++ b/drivers/media/v4l2-core/v4l2-fwnode.c +@@ -1219,10 +1219,6 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd) + + v4l2_async_subdev_nf_init(notifier, sd); + +- ret = v4l2_subdev_get_privacy_led(sd); +- if (ret < 0) +- goto out_cleanup; +- + ret = v4l2_async_nf_parse_fwnode_sensor(sd->dev, notifier); + if (ret < 0) + goto out_cleanup; +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch b/app-admin/kernel-tools/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch new file mode 100644 index 00000000000..ae005a00037 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch @@ -0,0 +1,45 @@ +From ca62bdbc1712c83421700245f2d5dd3f435ebf66 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:16 +0800 +Subject: [PATCH 123/155] SURFACE: platform: x86: int3472: Add MFD cell for + tps68470 LED + +Add MFD cell for tps68470-led. + +Reviewed-by: Daniel Scally +Signed-off-by: Kate Hsuan +Reviewed-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/fbcac39c13e09ce4cc8ad3d4520fd03863eb52f0 +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/tps68470.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c +index e3e1696e7f0e..423dc555093f 100644 +--- a/drivers/platform/x86/intel/int3472/tps68470.c ++++ b/drivers/platform/x86/intel/int3472/tps68470.c +@@ -17,7 +17,7 @@ + #define DESIGNED_FOR_CHROMEOS 1 + #define DESIGNED_FOR_WINDOWS 2 + +-#define TPS68470_WIN_MFD_CELL_COUNT 3 ++#define TPS68470_WIN_MFD_CELL_COUNT 4 + + static const struct mfd_cell tps68470_cros[] = { + { .name = "tps68470-gpio" }, +@@ -200,7 +200,8 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) + cells[1].name = "tps68470-regulator"; + cells[1].platform_data = (void *)board_data->tps68470_regulator_pdata; + cells[1].pdata_size = sizeof(struct tps68470_regulator_platform_data); +- cells[2].name = "tps68470-gpio"; ++ cells[2].name = "tps68470-led"; ++ cells[3].name = "tps68470-gpio"; + + for (i = 0; i < board_data->n_gpiod_lookups; i++) + gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch b/app-admin/kernel-tools/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch new file mode 100644 index 00000000000..43cbf2da82a --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch @@ -0,0 +1,45 @@ +From e426dbcedd12f5438e66769e5467656ff50c6224 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:17 +0800 +Subject: [PATCH 124/155] SURFACE: include: mfd: tps68470: Add masks for LEDA + and LEDB + +Add flags for both LEDA(TPS68470_ILEDCTL_ENA), LEDB +(TPS68470_ILEDCTL_ENB), and current control mask for LEDB +(TPS68470_ILEDCTL_CTRLB) + +Reviewed-by: Daniel Scally +Reviewed-by: Hans de Goede +Signed-off-by: Kate Hsuan +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8bbe05d964175fdebb1cd0693aade238df967362 +Signed-off-by: Kexy Biscuit +--- + include/linux/mfd/tps68470.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/linux/mfd/tps68470.h b/include/linux/mfd/tps68470.h +index 7807fa329db0..2d2abb25b944 100644 +--- a/include/linux/mfd/tps68470.h ++++ b/include/linux/mfd/tps68470.h +@@ -34,6 +34,7 @@ + #define TPS68470_REG_SGPO 0x22 + #define TPS68470_REG_GPDI 0x26 + #define TPS68470_REG_GPDO 0x27 ++#define TPS68470_REG_ILEDCTL 0x28 + #define TPS68470_REG_VCMVAL 0x3C + #define TPS68470_REG_VAUX1VAL 0x3D + #define TPS68470_REG_VAUX2VAL 0x3E +@@ -94,4 +95,8 @@ + #define TPS68470_GPIO_MODE_OUT_CMOS 2 + #define TPS68470_GPIO_MODE_OUT_ODRAIN 3 + ++#define TPS68470_ILEDCTL_ENA BIT(2) ++#define TPS68470_ILEDCTL_ENB BIT(6) ++#define TPS68470_ILEDCTL_CTRLB GENMASK(5, 4) ++ + #endif /* __LINUX_MFD_TPS68470_H */ +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch b/app-admin/kernel-tools/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch new file mode 100644 index 00000000000..8451e1d05d8 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch @@ -0,0 +1,254 @@ +From b696a928f65d3727f87aeb97ec63a2cd83fb11d6 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:18 +0800 +Subject: [PATCH 125/155] SURFACE: leds: tps68470: Add LED control for tps68470 + +There are two LED controllers, LEDA indicator LED and LEDB flash LED for +tps68470. LEDA can be enabled by setting TPS68470_ILEDCTL_ENA. Moreover, +tps68470 provides four levels of power status for LEDB. If the +properties called "ti,ledb-current" can be found, the current will be +set according to the property values. These two LEDs can be controlled +through the LED class of sysfs (tps68470-leda and tps68470-ledb). + +Signed-off-by: Kate Hsuan +Reviewed-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8776136058fe2e8b5b1edaab6693448b37fa219d +Signed-off-by: Kexy Biscuit +--- + drivers/leds/Kconfig | 12 +++ + drivers/leds/Makefile | 1 + + drivers/leds/leds-tps68470.c | 185 +++++++++++++++++++++++++++++++++++ + 3 files changed, 198 insertions(+) + create mode 100644 drivers/leds/leds-tps68470.c + +diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig +index 8d9d8da376e4..d8597897aa83 100644 +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -933,6 +933,18 @@ config LEDS_TPS6105X + It is a single boost converter primarily for white LEDs and + audio amplifiers. + ++config LEDS_TPS68470 ++ tristate "LED support for TI TPS68470" ++ depends on LEDS_CLASS ++ depends on INTEL_SKL_INT3472 ++ help ++ This driver supports TPS68470 PMIC with LED chip. ++ It provides two LED controllers, with the ability to drive 2 ++ indicator LEDs and 2 flash LEDs. ++ ++ To compile this driver as a module, choose M and it will be ++ called leds-tps68470 ++ + config LEDS_IP30 + tristate "LED support for SGI Octane machines" + depends on LEDS_CLASS +diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile +index 18afbb5a23ee..a1d16c0af82d 100644 +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -88,6 +88,7 @@ obj-$(CONFIG_LEDS_TCA6507) += leds-tca6507.o + obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o + obj-$(CONFIG_LEDS_TLC591XX) += leds-tlc591xx.o + obj-$(CONFIG_LEDS_TPS6105X) += leds-tps6105x.o ++obj-$(CONFIG_LEDS_TPS68470) += leds-tps68470.o + obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds-turris-omnia.o + obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o + obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o +diff --git a/drivers/leds/leds-tps68470.c b/drivers/leds/leds-tps68470.c +new file mode 100644 +index 000000000000..35aeb5db89c8 +--- /dev/null ++++ b/drivers/leds/leds-tps68470.c +@@ -0,0 +1,185 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * LED driver for TPS68470 PMIC ++ * ++ * Copyright (C) 2023 Red Hat ++ * ++ * Authors: ++ * Kate Hsuan ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++#define lcdev_to_led(led_cdev) \ ++ container_of(led_cdev, struct tps68470_led, lcdev) ++ ++#define led_to_tps68470(led, index) \ ++ container_of(led, struct tps68470_device, leds[index]) ++ ++enum tps68470_led_ids { ++ TPS68470_ILED_A, ++ TPS68470_ILED_B, ++ TPS68470_NUM_LEDS ++}; ++ ++static const char *tps68470_led_names[] = { ++ [TPS68470_ILED_A] = "tps68470-iled_a", ++ [TPS68470_ILED_B] = "tps68470-iled_b", ++}; ++ ++struct tps68470_led { ++ unsigned int led_id; ++ struct led_classdev lcdev; ++}; ++ ++struct tps68470_device { ++ struct device *dev; ++ struct regmap *regmap; ++ struct tps68470_led leds[TPS68470_NUM_LEDS]; ++}; ++ ++enum ctrlb_current { ++ CTRLB_2MA = 0, ++ CTRLB_4MA = 1, ++ CTRLB_8MA = 2, ++ CTRLB_16MA = 3, ++}; ++ ++static int tps68470_brightness_set(struct led_classdev *led_cdev, enum led_brightness brightness) ++{ ++ struct tps68470_led *led = lcdev_to_led(led_cdev); ++ struct tps68470_device *tps68470 = led_to_tps68470(led, led->led_id); ++ struct regmap *regmap = tps68470->regmap; ++ ++ switch (led->led_id) { ++ case TPS68470_ILED_A: ++ return regmap_update_bits(regmap, TPS68470_REG_ILEDCTL, TPS68470_ILEDCTL_ENA, ++ brightness ? TPS68470_ILEDCTL_ENA : 0); ++ case TPS68470_ILED_B: ++ return regmap_update_bits(regmap, TPS68470_REG_ILEDCTL, TPS68470_ILEDCTL_ENB, ++ brightness ? TPS68470_ILEDCTL_ENB : 0); ++ } ++ return -EINVAL; ++} ++ ++static enum led_brightness tps68470_brightness_get(struct led_classdev *led_cdev) ++{ ++ struct tps68470_led *led = lcdev_to_led(led_cdev); ++ struct tps68470_device *tps68470 = led_to_tps68470(led, led->led_id); ++ struct regmap *regmap = tps68470->regmap; ++ int ret = 0; ++ int value = 0; ++ ++ ret = regmap_read(regmap, TPS68470_REG_ILEDCTL, &value); ++ if (ret) ++ return dev_err_probe(led_cdev->dev, -EINVAL, "failed on reading register\n"); ++ ++ switch (led->led_id) { ++ case TPS68470_ILED_A: ++ value = value & TPS68470_ILEDCTL_ENA; ++ break; ++ case TPS68470_ILED_B: ++ value = value & TPS68470_ILEDCTL_ENB; ++ break; ++ } ++ ++ return value ? LED_ON : LED_OFF; ++} ++ ++ ++static int tps68470_ledb_current_init(struct platform_device *pdev, ++ struct tps68470_device *tps68470) ++{ ++ int ret = 0; ++ unsigned int curr; ++ ++ /* configure LEDB current if the properties can be got */ ++ if (!device_property_read_u32(&pdev->dev, "ti,ledb-current", &curr)) { ++ if (curr > CTRLB_16MA) { ++ dev_err(&pdev->dev, ++ "Invalid LEDB current value: %d\n", ++ curr); ++ return -EINVAL; ++ } ++ ret = regmap_update_bits(tps68470->regmap, TPS68470_REG_ILEDCTL, ++ TPS68470_ILEDCTL_CTRLB, curr); ++ } ++ return ret; ++} ++ ++static int tps68470_leds_probe(struct platform_device *pdev) ++{ ++ int i = 0; ++ int ret = 0; ++ struct tps68470_device *tps68470; ++ struct tps68470_led *led; ++ struct led_classdev *lcdev; ++ ++ tps68470 = devm_kzalloc(&pdev->dev, sizeof(struct tps68470_device), ++ GFP_KERNEL); ++ if (!tps68470) ++ return -ENOMEM; ++ ++ tps68470->dev = &pdev->dev; ++ tps68470->regmap = dev_get_drvdata(pdev->dev.parent); ++ ++ for (i = 0; i < TPS68470_NUM_LEDS; i++) { ++ led = &tps68470->leds[i]; ++ lcdev = &led->lcdev; ++ ++ led->led_id = i; ++ ++ lcdev->name = devm_kasprintf(tps68470->dev, GFP_KERNEL, "%s::%s", ++ tps68470_led_names[i], LED_FUNCTION_INDICATOR); ++ if (!lcdev->name) ++ return -ENOMEM; ++ ++ lcdev->max_brightness = 1; ++ lcdev->brightness = 0; ++ lcdev->brightness_set_blocking = tps68470_brightness_set; ++ lcdev->brightness_get = tps68470_brightness_get; ++ lcdev->dev = &pdev->dev; ++ ++ ret = devm_led_classdev_register(tps68470->dev, lcdev); ++ if (ret) { ++ dev_err_probe(tps68470->dev, ret, ++ "error registering led\n"); ++ goto err_exit; ++ } ++ ++ if (i == TPS68470_ILED_B) { ++ ret = tps68470_ledb_current_init(pdev, tps68470); ++ if (ret) ++ goto err_exit; ++ } ++ } ++ ++err_exit: ++ if (ret) { ++ for (i = 0; i < TPS68470_NUM_LEDS; i++) { ++ if (tps68470->leds[i].lcdev.name) ++ devm_led_classdev_unregister(&pdev->dev, ++ &tps68470->leds[i].lcdev); ++ } ++ } ++ ++ return ret; ++} ++static struct platform_driver tps68470_led_driver = { ++ .driver = { ++ .name = "tps68470-led", ++ }, ++ .probe = tps68470_leds_probe, ++}; ++ ++module_platform_driver(tps68470_led_driver); ++ ++MODULE_ALIAS("platform:tps68470-led"); ++MODULE_DESCRIPTION("LED driver for TPS68470 PMIC"); ++MODULE_LICENSE("GPL v2"); +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch b/app-admin/kernel-tools/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch new file mode 100644 index 00000000000..d3c50a0e2cb --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch @@ -0,0 +1,51 @@ +From 0393c0b33816c961e4f3ebb6d4005b49da09a313 Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Sat, 3 Feb 2024 12:59:53 +0900 +Subject: [PATCH 126/155] FROMEXT: media: staging: ipu3-imgu: Fix multiple + calls of s_stream on stream stop + +Adapt to 009905e "media: v4l2-subdev: Document and enforce .s_stream() requirements" + +Patchset: cameras + +Signed-off-by: mojyack +Link: https://github.com/linux-surface/kernel/commit/6e4b702fd02830ba9de5ac4fbb2eae53b02aeedc +Signed-off-by: Kexy Biscuit +--- + drivers/staging/media/ipu3/ipu3-v4l2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c +index 3df58eb3e882..81aff2d5d898 100644 +--- a/drivers/staging/media/ipu3/ipu3-v4l2.c ++++ b/drivers/staging/media/ipu3/ipu3-v4l2.c +@@ -538,18 +538,18 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq) + + WARN_ON(!node->enabled); + +- pipe = node->pipe; +- dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); +- imgu_pipe = &imgu->imgu_pipe[pipe]; +- r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); +- if (r) +- dev_err(&imgu->pci_dev->dev, +- "failed to stop subdev streaming\n"); +- + mutex_lock(&imgu->streaming_lock); + /* Was this the first node with streaming disabled? */ + if (imgu->streaming && imgu_all_nodes_streaming(imgu, node)) { + /* Yes, really stop streaming now */ ++ pipe = node->pipe; ++ dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); ++ imgu_pipe = &imgu->imgu_pipe[pipe]; ++ r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); ++ if (r) ++ dev_err(&imgu->pci_dev->dev, ++ "failed to stop subdev streaming\n"); ++ + dev_dbg(dev, "IMGU streaming is ready to stop"); + r = imgu_s_stream(imgu, false); + if (!r) +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch b/app-admin/kernel-tools/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch new file mode 100644 index 00000000000..d40387ce78e --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch @@ -0,0 +1,37 @@ +From b3b49a0b9fbab8cec0b2621fc798bb43f626209e Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Tue, 26 Mar 2024 05:55:44 +0900 +Subject: [PATCH 127/155] SURFACE: media: i2c: dw9719: fix probe error on + surface go 2 + +On surface go 2, sometimes probing dw9719 fails with "dw9719: probe of i2c-INT347A:00-VCM failed with error -121". +The -121(-EREMOTEIO) is came from drivers/i2c/busses/i2c-designware-common.c:575, and indicates the initialize occurs too early. +So just add some delay. +There is no exact reason for this 10000us, but 100us failed. + +Patchset: cameras + +Signed-off-by: mojyack +Link: https://github.com/linux-surface/kernel/commit/3a0e7fc61359fbfd0fef1b35579fa8f5039bb8a3 +Signed-off-by: Kexy Biscuit +--- + drivers/media/i2c/dw9719.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c +index c626ed845928..0094cfda57ea 100644 +--- a/drivers/media/i2c/dw9719.c ++++ b/drivers/media/i2c/dw9719.c +@@ -82,6 +82,9 @@ static int dw9719_power_up(struct dw9719_device *dw9719) + if (ret) + return ret; + ++ /* Wait for device to be acknowledged */ ++ fsleep(10000); ++ + /* Jiggle SCL pin to wake up device */ + cci_write(dw9719->regmap, DW9719_CONTROL, 1, &ret); + +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch b/app-admin/kernel-tools/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch rename to app-admin/kernel-tools/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch index 22f1ee4727f..7e793efb0a6 100644 --- a/app-admin/kernel-tools/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch +++ b/app-admin/kernel-tools/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch @@ -1,8 +1,8 @@ -From a911568c0051b76fc34f28fcb68561d01ba6a312 Mon Sep 17 00:00:00 2001 +From 4ebb03279fdb32203eac9b928ca9c60869ec994e Mon Sep 17 00:00:00 2001 From: graysky Date: Mon, 16 Sep 2024 05:55:58 -0400 -Subject: [PATCH 108/136] FROMEXT: - more-ISA-levels-and-uarches-for-kernel-6.8-rc4+.patch +Subject: [PATCH 128/155] FROMEXT: + more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -108,7 +108,7 @@ See the following experimental evidence supporting this statement: https://github.com/graysky2/kernel_compiler_patch?tab=readme-ov-file#benchmarks REQUIREMENTS -linux version 6.8-rc3+ +linux version 6.1.79+ gcc version >=9.0 or clang version >=9.0 ACKNOWLEDGMENTS @@ -121,7 +121,7 @@ REFERENCES 4. http://www.linuxforge.net/docs/linux/linux-gcc.php Signed-off-by: graysky -Link: https://github.com/graysky2/kernel_compiler_patch/blob/3a8d20c0d22f8b63c0c78ca20e24a03dbb37b168/more-ISA-levels-and-uarches-for-kernel-6.8-rc4%2B.patch +Link: https://github.com/graysky2/kernel_compiler_patch/blob/44598c402184de0de4c9f0addce5771bf0eae0c4/more-ISA-levels-and-uarches-for-kernel-6.1.79%2B.patch Link: https://lore.kernel.org/all/W22JX8eWQctCiWIDKGjx4IUU4ZgYmKa1zPOZSKHHVZ74zpUEmVV1VoPMMNcyc-zhraUayW0d4d7OIUYZHuiEqllnAc1tB8DthZahsHZuw0Y=@proton.me/ Signed-off-by: Kexy Biscuit --- diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch b/app-admin/kernel-tools/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch rename to app-admin/kernel-tools/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch index ba23754e0af..d2891cb0726 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch +++ b/app-admin/kernel-tools/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch @@ -1,14 +1,14 @@ -From f0db2d11dcaff201b6f20aebe3abcaa13367ef9d Mon Sep 17 00:00:00 2001 +From 2cb378eba6640c688786ac166396600cd4c9fc0b Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 29 Oct 2020 16:29:11 +0800 -Subject: [PATCH 109/136] FROMEXT: LoongArch: Add CPU HWMon platform driver +Subject: [PATCH 129/155] FROMEXT: LoongArch: Add CPU HWMon platform driver This add CPU HWMon (temperature sensor) platform driver for Loongson-3. Tested-by: Xi Ruoyao Signed-off-by: Huacai Chen -Link: https://github.com/chenhuacai/linux/commit/55f122a5d0997790ce33e18cac915a9417ec698e +Link: https://github.com/chenhuacai/linux/commit/0970ae1db5a4ec2016358a34bb7d0bf7b173b7bb Signed-off-by: Kexy Biscuit --- drivers/platform/loongarch/Kconfig | 8 + diff --git a/app-admin/kernel-tools/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch b/app-admin/kernel-tools/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch rename to app-admin/kernel-tools/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch index 5b11a6e4c6d..fbd4bec2703 100644 --- a/app-admin/kernel-tools/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch +++ b/app-admin/kernel-tools/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch @@ -1,7 +1,7 @@ -From 6071f9365e3a38cd639c6e5c85917b9fbfdac862 Mon Sep 17 00:00:00 2001 +From b27650605906063f71586f4edaf940ee24e2e3c1 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Sun, 28 Jan 2024 14:07:46 +0800 -Subject: [PATCH 110/136] FROMEXT: drivers/firmware: Move sysfb_init() from +Subject: [PATCH 130/155] FROMEXT: drivers/firmware: Move sysfb_init() from device_initcall to fs_initcall Consider a configuration like this: @@ -36,7 +36,7 @@ fs_initcall function which is ensured after vgaarb initialization. Signed-off-by: Huacai Chen -Link: https://github.com/chenhuacai/linux/commit/323337772c6c4c7f30b503dfc23f46ff21f33c2f +Link: https://github.com/chenhuacai/linux/commit/a04a5bfb7c7a1b5b9041c03f8a282481aba5ed0c Signed-off-by: Kexy Biscuit --- drivers/firmware/sysfb.c | 2 +- diff --git a/app-admin/kernel-tools/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch b/app-admin/kernel-tools/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch deleted file mode 100644 index b4ec227dc29..00000000000 --- a/app-admin/kernel-tools/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 2da47be49eeddfbc6857f73892cdb09713fa45fd Mon Sep 17 00:00:00 2001 -From: Mingcong Bai -Date: Mon, 2 Sep 2024 10:19:00 +0800 -Subject: [PATCH 131/136] AOSCOS: Revert "drm/amdgpu: fix contiguous handling - for IB parsing v2" - -This commit may have caused hardware decoding for H.264 to fail on GCN 1.0 -and 2.0 cards (AMD Radeon 520, R9 390X, etc.). Whilst playing such videos, -mpv crashes with the following output: - - amdgpu: The CS has been rejected, see dmesg for more information (-22). - -Kernel logs: - - [drm:amdgpu_uvd_pass2 [amdgpu]]: *ERROR* msg/fb buffer ff019e0000- - ff019e4000 out of 256MB segment! - -Issue currently tracked at: - - https://gitlab.freedesktop.org/drm/amd/-/issues/3599 - -This reverts commit f3572db3c049b4d32bb5ba77ad5305616c44c7c1. - -Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3599#note_2550915 -Signed-off-by: Kexy Biscuit ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -index 78b3c067fea7..a373b4b0103d 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -@@ -1785,7 +1785,7 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, - struct ttm_operation_ctx ctx = { false, false }; - struct amdgpu_vm *vm = &fpriv->vm; - struct amdgpu_bo_va_mapping *mapping; -- int i, r; -+ int r; - - addr /= AMDGPU_GPU_PAGE_SIZE; - -@@ -1800,13 +1800,13 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, - if (dma_resv_locking_ctx((*bo)->tbo.base.resv) != &parser->exec.ticket) - return -EINVAL; - -- (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; -- amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); -- for (i = 0; i < (*bo)->placement.num_placement; i++) -- (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; -- r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); -- if (r) -- return r; -+ if (!((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) { -+ (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; -+ amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); -+ r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); -+ if (r) -+ return r; -+ } - - return amdgpu_ttm_alloc_gart(&(*bo)->tbo); - } --- -2.47.0 - diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch b/app-admin/kernel-tools/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch similarity index 92% rename from runtime-kernel/linux-kernel/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch rename to app-admin/kernel-tools/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch index ae19d6fa21f..8321b202171 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch @@ -1,7 +1,7 @@ -From 71b4e26466707af1e6526de8e07bff00138c62b7 Mon Sep 17 00:00:00 2001 +From d49c4a63f0b5a62683213b97cc64420ca9b6f25d Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Mon, 22 Feb 2021 10:53:47 +0800 -Subject: [PATCH 111/136] FROMEXT: drm/radeon: Workaround radeon driver bug for +Subject: [PATCH 131/155] FROMEXT: drm/radeon: Workaround radeon driver bug for Loongson Radeon driver can not handle the interrupt is faster than DMA data, so @@ -11,7 +11,7 @@ enable interrupt again when interrupt is faster than DMA data. Signed-off-by: Huacai Chen Signed-off-by: Zhijie Zhang -Link: https://github.com/chenhuacai/linux/commit/c1fe1db6dbc822a19f81ec1e9d01bd3026b2247e +Link: https://github.com/chenhuacai/linux/commit/ad499fdf01f0105ba74f315ba54c8e92aa3e1d23 Signed-off-by: Kexy Biscuit --- drivers/gpu/drm/radeon/cik.c | 1 + diff --git a/app-admin/kernel-tools/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch b/app-admin/kernel-tools/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch rename to app-admin/kernel-tools/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch index b9d5031691f..992c982a3e9 100644 --- a/app-admin/kernel-tools/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch +++ b/app-admin/kernel-tools/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch @@ -1,7 +1,7 @@ -From 487e7ad7a4f19aa4a6f92c78735ea135daf826e3 Mon Sep 17 00:00:00 2001 +From 3765739b383f0d45d8db474c7c332ea9af15c3d6 Mon Sep 17 00:00:00 2001 From: bigshans <26884666+bigshans@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:36:10 +0800 -Subject: [PATCH 113/136] FROMEXT: cjktty-6.9.patch +Subject: [PATCH 132/155] FROMEXT: cjktty-6.9.patch Co-developed-by: microcai Signed-off-by: microcai @@ -48,7 +48,7 @@ index 564341f1a74f..59d1cfbb1188 100644 vc_sel.buf_len = bp - vc_sel.buffer; diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c -index cd87e3d1291e..7bb59aac3b55 100644 +index 96842ce817af..95ef0a70f71d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -302,6 +302,14 @@ static void con_putc(struct vc_data *vc, u16 ca, unsigned int y, unsigned int x) diff --git a/app-admin/kernel-tools/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch b/app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch rename to app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch index 9de967f7cd4..cce180ccdbb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch +++ b/app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch @@ -1,7 +1,7 @@ -From b6446e8ceeb44ec61d2cf445010068bad0bb67d4 Mon Sep 17 00:00:00 2001 +From eae53514e7b7e53a877cd16f3e4b3488799e6cda Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sun, 22 Sep 2024 00:57:24 +0800 -Subject: [PATCH 114/136] AOSCOS: drm: amdgpu: use amdgpu by default for si/cik +Subject: [PATCH 133/155] AOSCOS: drm: amdgpu: use amdgpu by default for si/cik devices On LoongArch, radeon causes a memory read violation that crashes diff --git a/app-admin/kernel-tools/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch b/app-admin/kernel-tools/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch rename to app-admin/kernel-tools/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch index 05d42a92eb9..4dacf11cb04 100644 --- a/app-admin/kernel-tools/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch +++ b/app-admin/kernel-tools/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch @@ -1,7 +1,7 @@ -From 0283be7accba08212f9abd95dd0aabccc3b6feda Mon Sep 17 00:00:00 2001 +From f75c90828961e80b1123b2404f9d1176c58adce3 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sun, 22 Sep 2024 01:07:11 +0800 -Subject: [PATCH 115/136] AOSCOS: drm: amdgpu: radeon: disable cache flush +Subject: [PATCH 134/155] AOSCOS: drm: amdgpu: radeon: disable cache flush workaround for LoongArch and Loongson64 This workaround causes instability for LoongArch/Loongson (MIPS) devices diff --git a/app-admin/kernel-tools/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch b/app-admin/kernel-tools/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch similarity index 79% rename from app-admin/kernel-tools/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch rename to app-admin/kernel-tools/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch index ccb95bcae73..50028db86a8 100644 --- a/app-admin/kernel-tools/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch +++ b/app-admin/kernel-tools/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch @@ -1,7 +1,7 @@ -From f825bc2c5ffa2174444510b4a44e3416b6f1de63 Mon Sep 17 00:00:00 2001 +From a352075c5ec543ee77c67b467e1aa4cfac8347ac Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:19:19 +0800 -Subject: [PATCH 116/136] AOSCOS: net: stmmac: Make phytium_dwmac_remove() +Subject: [PATCH 135/155] AOSCOS: net: stmmac: Make phytium_dwmac_remove() return void Fixes: 731b13ef92e8 ("BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC driver support v2") @@ -12,10 +12,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c -index dd4171a39a4a..fbedbada8eed 100644 +index eea842195513..ea37d120113d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c -@@ -176,7 +176,7 @@ static int phytium_dwmac_probe(struct platform_device *pdev) +@@ -199,7 +199,7 @@ static int phytium_dwmac_probe(struct platform_device *pdev) return stmmac_dvr_probe(&pdev->dev, plat, &stmmac_res); } @@ -24,7 +24,7 @@ index dd4171a39a4a..fbedbada8eed 100644 { struct net_device *ndev = platform_get_drvdata(pdev); struct stmmac_priv *priv = netdev_priv(ndev); -@@ -184,8 +184,6 @@ static int phytium_dwmac_remove(struct platform_device *pdev) +@@ -207,8 +207,6 @@ static int phytium_dwmac_remove(struct platform_device *pdev) stmmac_pltfr_remove(pdev); clk_unregister_fixed_rate(plat->stmmac_clk); diff --git a/app-admin/kernel-tools/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch b/app-admin/kernel-tools/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch similarity index 88% rename from app-admin/kernel-tools/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch rename to app-admin/kernel-tools/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch index b06d51ab9c7..eb817525523 100644 --- a/app-admin/kernel-tools/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch +++ b/app-admin/kernel-tools/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch @@ -1,7 +1,7 @@ -From de634877103eeba93d5783038b31f59e68ea4de7 Mon Sep 17 00:00:00 2001 +From 15187f1c0a3e46d2f202159a493c1725e2e77fa0 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:42:30 +0800 -Subject: [PATCH 117/136] AOSCOS: net: phytium: Adapt struct +Subject: [PATCH 136/155] AOSCOS: net: phytium: Adapt struct kernel_ethtool_ts_info Fixes: 53f8c475850d ("BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC") diff --git a/app-admin/kernel-tools/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch b/app-admin/kernel-tools/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch rename to app-admin/kernel-tools/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch index d9503a24b88..ebb42143e75 100644 --- a/app-admin/kernel-tools/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch +++ b/app-admin/kernel-tools/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch @@ -1,7 +1,7 @@ -From e4565d4f31fda1ed4666972f73effe7da7a743da Mon Sep 17 00:00:00 2001 +From d47dea38582c7b61d1bb4ccb9a0b92c9983c6cd1 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:57:43 +0800 -Subject: [PATCH 118/136] AOSCOS: net: ethernet: phytium: Make +Subject: [PATCH 137/155] AOSCOS: net: ethernet: phytium: Make phytmac_plat_remove() return void Fixes: 53f8c475850d ("BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC") diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch b/app-admin/kernel-tools/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch similarity index 89% rename from runtime-kernel/linux-kernel/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch rename to app-admin/kernel-tools/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch index d5403ddee22..886c2f5cba7 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch +++ b/app-admin/kernel-tools/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch @@ -1,7 +1,7 @@ -From 50e3dfa9d22bb99a61eb2b858353bd4538331955 Mon Sep 17 00:00:00 2001 +From 97245f0d7ce046f1dab3371742bb5f20845ea136 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 22 Sep 2024 04:13:54 +0800 -Subject: [PATCH 119/136] AOSCOS: arm64: dts: rockchip: disable usb3 on +Subject: [PATCH 138/155] AOSCOS: arm64: dts: rockchip: disable usb3 on quartz64 USB 3 ports on Quartz64 is of bad quality as it shares lines with SATA. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch b/app-admin/kernel-tools/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch similarity index 88% rename from runtime-kernel/linux-kernel/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch rename to app-admin/kernel-tools/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch index d061097b661..0aa00096451 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch +++ b/app-admin/kernel-tools/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch @@ -1,7 +1,7 @@ -From 42cfd35f500281a04514247c3e5c8b2e09e27f7c Mon Sep 17 00:00:00 2001 +From f65b2e2f3e24732b3d2bdca967019bd049321c34 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 22 Sep 2024 04:18:12 +0800 -Subject: [PATCH 120/136] AOSCOS: arm64: drop hisi_ddrc_pmu driver +Subject: [PATCH 139/155] AOSCOS: arm64: drop hisi_ddrc_pmu driver hisi_ddrc_pmu is broken and causes Kunpeng 920-based desktop systems to freeze during boot-up. Disable this driver to workaround this issue. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch b/app-admin/kernel-tools/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch rename to app-admin/kernel-tools/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch index 6aa739a11e4..daf2c78ad61 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch +++ b/app-admin/kernel-tools/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch @@ -1,7 +1,7 @@ -From 0d2b201602f1cba4d5bf20afb9698e539d5f4076 Mon Sep 17 00:00:00 2001 +From afb4328a650b9f81917410a9118138f3b9f247b6 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 17 Jul 2024 09:03:32 +0800 -Subject: [PATCH 121/136] AOSCOS: loongarch: basic boot support for legacy +Subject: [PATCH 140/155] AOSCOS: loongarch: basic boot support for legacy firmware The addresses passed from legacy firmware in efi system tables, the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch b/app-admin/kernel-tools/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch rename to app-admin/kernel-tools/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch index 035e0237f46..b18921ed835 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch +++ b/app-admin/kernel-tools/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch @@ -1,7 +1,7 @@ -From 15529b962bc65a75cf1f5a652b24028970d8fe72 Mon Sep 17 00:00:00 2001 +From 0f3538e0c27ac03e6bc56e80b603ab3b7c819928 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Thu, 18 Jul 2024 18:55:59 +0800 -Subject: [PATCH 122/136] AOSCOS: loongarch: parse BPI data and add memory +Subject: [PATCH 141/155] AOSCOS: loongarch: parse BPI data and add memory mapping On legacy firmwares, the memory mapping information passed in the EFI @@ -436,7 +436,7 @@ index 8fe21f868f72..5d45c389e961 100644 return -EINVAL; diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c -index 00e307203ddb..fedcd1adec71 100644 +index cbd3c09a93c1..782e8849355a 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -49,6 +49,8 @@ @@ -448,7 +448,7 @@ index 00e307203ddb..fedcd1adec71 100644 #define SMBIOS_BIOSSIZE_OFFSET 0x09 #define SMBIOS_BIOSEXTERN_OFFSET 0x13 #define SMBIOS_FREQLOW_OFFSET 0x16 -@@ -593,6 +595,7 @@ void __init setup_arch(char **cmdline_p) +@@ -594,6 +596,7 @@ void __init setup_arch(char **cmdline_p) init_environ(); efi_init(); fdt_setup(); diff --git a/app-admin/kernel-tools/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch b/app-admin/kernel-tools/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch rename to app-admin/kernel-tools/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch index 82e4298ca7b..bef013070bb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch +++ b/app-admin/kernel-tools/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch @@ -1,7 +1,7 @@ -From c6dfc9b1a02ec144085ca63c8c2d340d86c72db1 Mon Sep 17 00:00:00 2001 +From 90b79cf2078ee16fe3e4dd6395e0c12e12dfbd66 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Sat, 20 Jul 2024 06:32:15 +0800 -Subject: [PATCH 123/136] AOSCOS: loongarch: add MADT ACPI table conversion +Subject: [PATCH 142/155] AOSCOS: loongarch: add MADT ACPI table conversion On machines with legacy firmware with BPI version BPI01000, i.e. the older version, the content of the MADT ACPI table is not following the diff --git a/app-admin/kernel-tools/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch b/app-admin/kernel-tools/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch rename to app-admin/kernel-tools/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch index 2f95c830cd5..4fbaeafa533 100644 --- a/app-admin/kernel-tools/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch +++ b/app-admin/kernel-tools/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch @@ -1,7 +1,7 @@ -From c21523968873b0b3b7c20dc3931b14cbd0f6b2a2 Mon Sep 17 00:00:00 2001 +From 703c00050f5f06b66eb822762d5bba68d4cc9420 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 24 Jul 2024 09:06:27 +0800 -Subject: [PATCH 124/136] AOSCOS: loongarch: correct missing offset of PCI root +Subject: [PATCH 143/155] AOSCOS: loongarch: correct missing offset of PCI root controller in DSDT table On machines with legacy firmware with BPI version BPI01000, the PCI root diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch b/app-admin/kernel-tools/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch rename to app-admin/kernel-tools/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch index 968c5a5c84c..c480e25e303 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch +++ b/app-admin/kernel-tools/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch @@ -1,7 +1,7 @@ -From 52d29fa5075667c11a7170bf736aa0e64090ed26 Mon Sep 17 00:00:00 2001 +From 5261d69c33a5b3b9562a9b4241967c789f461eec Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Thu, 25 Jul 2024 16:09:19 +0800 -Subject: [PATCH 125/136] AOSCOS: loongarch: fix missing dependency info in +Subject: [PATCH 144/155] AOSCOS: loongarch: fix missing dependency info in DSDT On machines with legacy firmware with BPI01000 version, the devices on diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch b/app-admin/kernel-tools/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch rename to app-admin/kernel-tools/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch index 7cc9c247c9f..c67d571987a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch +++ b/app-admin/kernel-tools/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch @@ -1,7 +1,7 @@ -From e30e05f8b9c10ae453ce5a23037ae813aa000743 Mon Sep 17 00:00:00 2001 +From 2803ca8e9757582fa8c6488a8bd21b3b4bf6a35e Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 13 Aug 2024 16:05:28 +0800 -Subject: [PATCH 126/136] AOSCOS: loongarch: fix DMA address offset +Subject: [PATCH 145/155] AOSCOS: loongarch: fix DMA address offset Loongarch CPUs are using HT bus interface, which is only 40-bit wide, to communicate with the bridge chipset. However, the actual memory diff --git a/app-admin/kernel-tools/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch b/app-admin/kernel-tools/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch rename to app-admin/kernel-tools/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch index 1228c4a82db..8d93ef7a30e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch +++ b/app-admin/kernel-tools/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch @@ -1,7 +1,7 @@ -From 86c4bad130e9fd8e9c280b7b45df0df113a8176f Mon Sep 17 00:00:00 2001 +From 0dbb52f00cace4273bebfe164b202e3842eb12fd Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 13 Aug 2024 22:33:01 +0800 -Subject: [PATCH 127/136] AOSCOS: loongarch: fix HT_RX_INT_TRANS register +Subject: [PATCH 146/155] AOSCOS: loongarch: fix HT_RX_INT_TRANS register On machines with legacy firmware with BPI01000 version, the HT_RX_INT_TRANS register on the node 5, i.e. the node connected with the diff --git a/app-admin/kernel-tools/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch b/app-admin/kernel-tools/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch similarity index 99% rename from app-admin/kernel-tools/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch rename to app-admin/kernel-tools/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch index 0818d8e55b6..e97994afd8c 100644 --- a/app-admin/kernel-tools/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch +++ b/app-admin/kernel-tools/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch @@ -1,7 +1,7 @@ -From d092a311156ece35a198647229fcf4971d78ffe8 Mon Sep 17 00:00:00 2001 +From 2368b5940b0afeab7fbddba3fca07560e7ae2db1 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 28 Aug 2024 03:09:24 +0800 -Subject: [PATCH 128/136] AOSCOS: arch/loongarch: add la_ow_syscall as in-tree +Subject: [PATCH 147/155] AOSCOS: arch/loongarch: add la_ow_syscall as in-tree module Signed-off-by: Miao Wang diff --git a/app-admin/kernel-tools/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch b/app-admin/kernel-tools/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch similarity index 87% rename from app-admin/kernel-tools/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch rename to app-admin/kernel-tools/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch index aa10333f5dd..978bec2885c 100644 --- a/app-admin/kernel-tools/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch +++ b/app-admin/kernel-tools/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch @@ -1,7 +1,7 @@ -From e4f32e4d859e38bcce4690520433d63e3239a5d3 Mon Sep 17 00:00:00 2001 +From 5c837366ccae0cb366f0c35c33d0697c95f47755 Mon Sep 17 00:00:00 2001 From: Tianhao Chai Date: Thu, 18 Jan 2024 18:07:58 -0500 -Subject: [PATCH 129/136] AOSCOS: la_ow_syscall: add kconfig for module +Subject: [PATCH 148/155] AOSCOS: la_ow_syscall: add kconfig for module Signed-off-by: Tianhao Chai Signed-off-by: Kexy Biscuit @@ -12,7 +12,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 arch/loongarch/ow_syscall/Kconfig diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig -index bc76c641bd5b..d3573c0960f7 100644 +index 199b675e2c11..2e036217aa61 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -724,3 +724,5 @@ source "drivers/cpufreq/Kconfig" diff --git a/app-admin/kernel-tools/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch b/app-admin/kernel-tools/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch rename to app-admin/kernel-tools/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch index 4ad9ed3c3c0..cd83b05104f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch +++ b/app-admin/kernel-tools/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch @@ -1,7 +1,7 @@ -From 0e95d7e2ea12f6dfbc879dca38cc5ffcbf756e49 Mon Sep 17 00:00:00 2001 +From 55343efcbb1c9b558f98b614880fdca88d294eec Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sat, 17 Aug 2024 11:32:11 +0800 -Subject: [PATCH 130/136] AOSCOS: platform: x86: ideapad-laptop: add fixes for +Subject: [PATCH 149/155] AOSCOS: platform: x86: ideapad-laptop: add fixes for ThinkBook 14+ (2024 G6+) This is a patch taken from ideapad-laptop-tb2024g6plus in an attempt to diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch b/app-admin/kernel-tools/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch rename to app-admin/kernel-tools/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch index edbe0e4748d..4be83f68dfe 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch +++ b/app-admin/kernel-tools/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch @@ -1,7 +1,7 @@ -From 05619edd5f0f86df22a3f5cc4b2575526eccdbae Mon Sep 17 00:00:00 2001 +From a35153d5dd201cc99ee11446b51030a8f1a4f568 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Tue, 15 Oct 2024 20:32:21 +0800 -Subject: [PATCH 133/136] AOSCOS: Revert "rcu: Fix rcu_barrier() VS post +Subject: [PATCH 150/155] AOSCOS: Revert "rcu: Fix rcu_barrier() VS post CPUHP_TEARDOWN_CPU invocation" When this change was introduced between v6.10.4 and v6.10.5, the Broadcom @@ -99,10 +99,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index e641cc681901..6f549dd62b4b 100644 +index 8af1354b2231..3be2f6e85ffd 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c -@@ -5148,15 +5148,11 @@ void rcutree_migrate_callbacks(int cpu) +@@ -5242,15 +5242,11 @@ void rcutree_migrate_callbacks(int cpu) struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); bool needwake; diff --git a/app-admin/kernel-tools/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch b/app-admin/kernel-tools/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch rename to app-admin/kernel-tools/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch index 94deb8bfdaa..ec716579870 100644 --- a/app-admin/kernel-tools/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch +++ b/app-admin/kernel-tools/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch @@ -1,7 +1,7 @@ -From 85378d209ed88a03dbd375712d41687d98276cd7 Mon Sep 17 00:00:00 2001 +From 0e1dc9c335bf216d924683342b18570cb6b4b3d8 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Tue, 15 Oct 2024 18:37:52 +0800 -Subject: [PATCH 132/136] AOSCOS: Revert "cpufreq: amd-pstate: initialize core +Subject: [PATCH 151/155] AOSCOS: Revert "cpufreq: amd-pstate: initialize core precision boost state" This commit, introduced as part of AMD P-State's updates for 6.11, breaks @@ -30,7 +30,7 @@ Signed-off-by: Kexy Biscuit 2 files changed, 23 insertions(+), 97 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c -index 589fde37ccd7..08e09ea73afe 100644 +index 929b9097a6c1..00ddd781e323 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -695,53 +695,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu, @@ -188,7 +188,7 @@ index 589fde37ccd7..08e09ea73afe 100644 if (!current_pstate_driver->adjust_perf) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; -@@ -1506,10 +1439,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1516,10 +1449,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) if (ret) goto free_cpudata1; @@ -199,7 +199,7 @@ index 589fde37ccd7..08e09ea73afe 100644 min_freq = READ_ONCE(cpudata->min_freq); max_freq = READ_ONCE(cpudata->max_freq); -@@ -1525,8 +1454,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1535,8 +1464,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) policy->min = policy->cpuinfo.min_freq; policy->max = policy->cpuinfo.max_freq; @@ -208,7 +208,7 @@ index 589fde37ccd7..08e09ea73afe 100644 /* * Set the policy to provide a valid fallback value in case * the default cpufreq governor is neither powersave nor performance. -@@ -1548,6 +1475,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1558,6 +1485,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) return ret; WRITE_ONCE(cpudata->cppc_cap1_cached, value); } @@ -216,7 +216,7 @@ index 589fde37ccd7..08e09ea73afe 100644 return 0; -@@ -1808,7 +1736,6 @@ static struct cpufreq_driver amd_pstate_epp_driver = { +@@ -1818,7 +1746,6 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .suspend = amd_pstate_epp_suspend, .resume = amd_pstate_epp_resume, .update_limits = amd_pstate_update_limits, diff --git a/app-admin/kernel-tools/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch b/app-admin/kernel-tools/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch new file mode 100644 index 00000000000..76cfa5dcdb4 --- /dev/null +++ b/app-admin/kernel-tools/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch @@ -0,0 +1,40 @@ +From 09d6589333c1228c548e7e77c89531d00455a29c Mon Sep 17 00:00:00 2001 +From: Mingcong Bai +Date: Thu, 24 Oct 2024 20:53:23 +0800 +Subject: [PATCH 152/155] AOSCOS: drm: amdgpu: disable ABM (Adaptive Backlight + Management) by default + +Per report from a contributor, since v6.9, ABM was set to be automatically +enabled/disabled. It may have seemed like a good idea for brighter +screens, but the brightness adjustment is quite abrupt, which is quite +bothersome. + +Disable this feature by default for now. + +Signed-off-by: Mingcong Bai + +Link: https://t.me/c/1109254909/594612 +Signed-off-by: Kexy Biscuit +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +index 5ce560218f09..13d5ae1aca87 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -867,9 +867,9 @@ module_param_named(visualconfirm, amdgpu_dc_visual_confirm, uint, 0444); + * Defaults to -1, or disabled. Userspace can only override this level after + * boot if it's set to auto. + */ +-int amdgpu_dm_abm_level = -1; ++int amdgpu_dm_abm_level = 0; + MODULE_PARM_DESC(abmlevel, +- "ABM level (0 = off, 1-4 = backlight reduction level, -1 auto (default))"); ++ "ABM level (0 = off (default), 1-4 = backlight reduction level, -1 auto)"); + module_param_named(abmlevel, amdgpu_dm_abm_level, int, 0444); + + int amdgpu_backlight = -1; +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 b/app-admin/kernel-tools/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 rename to app-admin/kernel-tools/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 index 1de7d26337b..2f63fce4ff5 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 +++ b/app-admin/kernel-tools/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 @@ -1,7 +1,7 @@ -From 7b4705337c0039a3a7e02f5a6efd22fecf25fd13 Mon Sep 17 00:00:00 2001 +From af96ed45c8dcaf312082dc1e9f540e5816c6c7b8 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 20 Feb 2024 15:49:58 +0800 -Subject: [PATCH 134/136] LOONGARCH64: FROMLIST: drm/radeon: Call mmiowb() at +Subject: [PATCH 153/155] LOONGARCH64: FROMLIST: drm/radeon: Call mmiowb() at the end of radeon_ring_commit() Commit fb24ea52f78e0d595852e ("drivers: Remove explicit invocations of diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 b/app-admin/kernel-tools/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 rename to app-admin/kernel-tools/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 index 66dccfaf9fc..653d70164a3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 +++ b/app-admin/kernel-tools/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 @@ -1,7 +1,7 @@ -From ec1f48c2f1c9dda9f8517020aae1c17afa2de631 Mon Sep 17 00:00:00 2001 +From a4ae3527ff2064d3eebc27451a9bccf5475a7609 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Tue, 15 Oct 2024 19:35:34 +0800 -Subject: [PATCH 135/136] LOONGARCH64: BACKPORT: FROMEXT: loongarch debug +Subject: [PATCH 154/155] LOONGARCH64: BACKPORT: FROMEXT: loongarch debug drm/xe: fix build on non-4K kernels @@ -94,7 +94,7 @@ index e147ef1d0578..ae3c17e102e0 100644 if (resv) { ctx.allow_res_evict = !(flags & XE_BO_FLAG_NO_RESV_EVICT); diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c -index 0cdbc1296e88..23eb8039f27f 100644 +index 226542bb1442..111bb64e02fb 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -35,7 +35,7 @@ static u64 xelp_ggtt_pte_encode_bo(struct xe_bo *bo, u64 bo_offset, @@ -214,7 +214,7 @@ index 1c60b685dbc6..85843b6c2c2e 100644 /* diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c -index cd9918e3896c..9d9b27cbe2e8 100644 +index 12e1fe6a8da2..bc2e4da03ef8 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -165,7 +165,7 @@ int xe_guc_ct_init(struct xe_guc_ct *ct) @@ -319,7 +319,7 @@ index 4e01df6b1b7a..2158a98729c4 100644 config->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] = xe_exec_queue_device_get_max_priority(xe); diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c -index 49ba9a1e375f..80d1e08472ad 100644 +index 3ac41f70ea6b..578ba318be0a 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1190,7 +1190,7 @@ static u64 xelp_pde_encode_bo(struct xe_bo *bo, u64 bo_offset, diff --git a/app-admin/kernel-tools/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 b/app-admin/kernel-tools/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 similarity index 89% rename from app-admin/kernel-tools/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 rename to app-admin/kernel-tools/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 index c40a8243aec..b4c8f7dff7e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 +++ b/app-admin/kernel-tools/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 @@ -1,7 +1,7 @@ -From eb4160d8f4c3b6437d3dd75bb8d05516bfa0bc41 Mon Sep 17 00:00:00 2001 +From 3a85a395f299b89ae0d93da136a3a1de8a1c7379 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Mon, 14 Oct 2024 06:58:21 +0800 -Subject: [PATCH 136/136] LOONGARCH64: AOSCOS: more fixes for Xe on LoongArch +Subject: [PATCH 155/155] LOONGARCH64: AOSCOS: more fixes for Xe on LoongArch More fixes based on the previous patch. diff --git a/app-admin/kernel-tools/spec b/app-admin/kernel-tools/spec index 5dcd0e4312a..36169e4cb4d 100644 --- a/app-admin/kernel-tools/spec +++ b/app-admin/kernel-tools/spec @@ -1,10 +1,10 @@ -VER=6.11.4 +VER=6.11.8 # Note: For use inside autobuild/. __VER="${VER}" # Use this for stable releases. -REL=1 +REL=2 # Note: In specific cases, `www.kernel.org` is faster than `cdn.kernel.org`. Change the host when appropriate. SRCS="tbl::https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${VER%%.0}.tar.xz" @@ -21,5 +21,5 @@ SRCS="tbl::https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${VER%%.0}.tar.xz" #REL=0.${RC} #SRCS="tbl::https://git.kernel.org/torvalds/t/linux-${VER%%.0}-rc${RC}.tar.gz" -CHKSUMS="sha256::bd54b0a0a46574919706698b1411ec48cf2a58345c4d8990e414acc4730e8f55" +CHKSUMS="sha256::aee8a844fe152420bece70ffae8525b9b23089aa4da31fa32f30e1859bf93c3d" CHKUPDATE="anitya::id=6501" diff --git a/runtime-kernel/linux+kernel/autobuild/defines b/runtime-kernel/linux+kernel/autobuild/defines index 23e84555770..19029a9f292 100644 --- a/runtime-kernel/linux+kernel/autobuild/defines +++ b/runtime-kernel/linux+kernel/autobuild/defines @@ -1,6 +1,6 @@ PKGNAME=linux+kernel PKGSEC=kernel -PKGDEP="linux-kernel-6.11.4" +PKGDEP="linux-kernel-6.11.8" PKGDES="Generic Linux Kernel for AOSC OS (Mainline)" PKGREP="linux+image+new linux+header+new linux+image linux+header linux+image+old linux+header+old" diff --git a/runtime-kernel/linux+kernel/spec b/runtime-kernel/linux+kernel/spec index a1bcc595220..b7537e98f2f 100644 --- a/runtime-kernel/linux+kernel/spec +++ b/runtime-kernel/linux+kernel/spec @@ -1,3 +1,3 @@ -VER=6.11.4 +VER=6.11.8 DUMMYSRC=1 CHKUPDATE="anitya::id=6501" diff --git a/runtime-kernel/linux-kernel/autobuild/amd64/config b/runtime-kernel/linux-kernel/autobuild/amd64/config index 39af90dcf20..4ea8da16d3d 100644 --- a/runtime-kernel/linux-kernel/autobuild/amd64/config +++ b/runtime-kernel/linux-kernel/autobuild/amd64/config @@ -193,7 +193,6 @@ CONFIG_AD9832=m CONFIG_AD9834=m CONFIG_ADA4250=m CONFIG_ADAPTEC_STARFIRE=m -CONFIG_ADDRESS_MASKING=y CONFIG_ADF4350=m CONFIG_ADF4371=m CONFIG_ADF4377=m @@ -1051,6 +1050,7 @@ CONFIG_CAN_8DEV_USB=m CONFIG_CAN_BCM=m CONFIG_CAN_CALC_BITTIMING=y CONFIG_CAN_CAN327=m +CONFIG_CAN_CC770_ISA=m CONFIG_CAN_CC770=m CONFIG_CAN_CC770_PLATFORM=m CONFIG_CAN_C_CAN=m @@ -1099,6 +1099,7 @@ CONFIG_CAN_PEAK_USB=m CONFIG_CAN_PLX_PCI=m CONFIG_CAN_RAW=m CONFIG_CAN_RX_OFFLOAD=y +CONFIG_CAN_SJA1000_ISA=m CONFIG_CAN_SJA1000=m CONFIG_CAN_SJA1000_PLATFORM=m CONFIG_CAN_SLCAN=m @@ -3553,6 +3554,7 @@ CONFIG_HID_GYRATION=m CONFIG_HID_HOLTEK=m CONFIG_HID_HYPERV_MOUSE=m CONFIG_HID_ICADE=m +CONFIG_HID_IPTS=m CONFIG_HID_ITE=m CONFIG_HID_JABRA=m CONFIG_HID_KENSINGTON=m @@ -4863,6 +4865,7 @@ CONFIG_LEDS_TCA6507=m CONFIG_LEDS_TI_LMU_COMMON=m CONFIG_LEDS_TLC591XX=m CONFIG_LEDS_TPS6105X=m +CONFIG_LEDS_TPS68470=m CONFIG_LEDS_TRIGGER_ACTIVITY=m CONFIG_LEDS_TRIGGER_BACKLIGHT=m CONFIG_LEDS_TRIGGER_CAMERA=m @@ -8250,6 +8253,7 @@ CONFIG_SENSORS_SPD5118=m CONFIG_SENSORS_STPDDC60=m CONFIG_SENSORS_STTS751=m CONFIG_SENSORS_SURFACE_FAN=m +CONFIG_SENSORS_SURFACE_TEMP=m CONFIG_SENSORS_SY7636A=m CONFIG_SENSORS_TC654=m CONFIG_SENSORS_TC74=m diff --git a/runtime-kernel/linux-kernel/autobuild/arm64/config b/runtime-kernel/linux-kernel/autobuild/arm64/config index 53b0f7bd2b1..e3125f91c7a 100644 --- a/runtime-kernel/linux-kernel/autobuild/arm64/config +++ b/runtime-kernel/linux-kernel/autobuild/arm64/config @@ -572,7 +572,6 @@ CONFIG_ARM64_PTR_AUTH_KERNEL=y CONFIG_ARM64_PTR_AUTH=y CONFIG_ARM64_RAS_EXTN=y # CONFIG_ARM64_RELOC_TEST is not set -CONFIG_ARM64_SME=y CONFIG_ARM64_SVE=y CONFIG_ARM64_SW_TTBR0_PAN=y CONFIG_ARM64_TAGGED_ADDR_ABI=y @@ -1295,6 +1294,7 @@ CONFIG_CAN_BCM=m CONFIG_CAN_BXCAN=m CONFIG_CAN_CALC_BITTIMING=y CONFIG_CAN_CAN327=m +CONFIG_CAN_CC770_ISA=m CONFIG_CAN_CC770=m CONFIG_CAN_CC770_PLATFORM=m CONFIG_CAN_C_CAN=m @@ -1343,6 +1343,7 @@ CONFIG_CAN_RAW=m CONFIG_CAN_RCAR_CANFD=m CONFIG_CAN_RCAR=m CONFIG_CAN_RX_OFFLOAD=y +CONFIG_CAN_SJA1000_ISA=m CONFIG_CAN_SJA1000=m CONFIG_CAN_SJA1000_PLATFORM=m CONFIG_CAN_SLCAN=m @@ -8119,7 +8120,6 @@ CONFIG_QCOM_RPMH=y CONFIG_QCOM_RPM_MASTER_STATS=m CONFIG_QCOM_RPMPD=y CONFIG_QCOM_RPROC_COMMON=m -# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set CONFIG_QCOM_SCM=y CONFIG_QCOM_SMD_RPM=y CONFIG_QCOM_SMEM_STATE=y @@ -9370,6 +9370,7 @@ CONFIG_SENSORS_SPD5118=m CONFIG_SENSORS_STPDDC60=m CONFIG_SENSORS_STTS751=m CONFIG_SENSORS_SURFACE_FAN=m +CONFIG_SENSORS_SURFACE_TEMP=m CONFIG_SENSORS_SY7636A=m CONFIG_SENSORS_TC654=m CONFIG_SENSORS_TC74=m diff --git a/runtime-kernel/linux-kernel/autobuild/loongarch64/config b/runtime-kernel/linux-kernel/autobuild/loongarch64/config index c45ad700ac7..14f4b0b2c85 100644 --- a/runtime-kernel/linux-kernel/autobuild/loongarch64/config +++ b/runtime-kernel/linux-kernel/autobuild/loongarch64/config @@ -914,6 +914,7 @@ CONFIG_CAN_8DEV_USB=m CONFIG_CAN_BCM=m CONFIG_CAN_CALC_BITTIMING=y CONFIG_CAN_CAN327=m +CONFIG_CAN_CC770_ISA=m CONFIG_CAN_CC770=m CONFIG_CAN_CC770_PLATFORM=m CONFIG_CAN_C_CAN=m @@ -962,6 +963,7 @@ CONFIG_CAN_PEAK_USB=m CONFIG_CAN_PLX_PCI=m CONFIG_CAN_RAW=m CONFIG_CAN_RX_OFFLOAD=y +CONFIG_CAN_SJA1000_ISA=m CONFIG_CAN_SJA1000=m CONFIG_CAN_SJA1000_PLATFORM=m CONFIG_CAN_SLCAN=m diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch b/runtime-kernel/linux-kernel/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch index af84fc82342..db8c1b7fa00 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0001-UPSTREAM-net-stmmac-Move-the-atds-flag-to-the-stmmac.patch @@ -1,7 +1,7 @@ -From 824081ce89b55b2fa74a684b48ed5756b6e116de Mon Sep 17 00:00:00 2001 +From 76e2687b779f5ebbb85208f3c6d4ac017032483e Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:28 +0800 -Subject: [PATCH 001/136] UPSTREAM: net: stmmac: Move the atds flag to the +Subject: [PATCH 001/156] UPSTREAM: net: stmmac: Move the atds flag to the stmmac_dma_cfg structure ATDS (Alternate Descriptor Size) is a part of the DMA Bus Mode configs @@ -89,7 +89,7 @@ index b402fb54f613..82957db47c99 100644 /* Enable Application Access by writing to DMA CSR0 */ writel(DMA_BUS_MODE_DEFAULT | (dma_cfg->pbl << DMA_BUS_MODE_PBL_SHIFT), diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -index 84d3a8551b03..e0165358c4ac 100644 +index 071f128aa490..77b35abc6f6f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -153,7 +153,7 @@ static void dwmac410_dma_init_channel(struct stmmac_priv *priv, @@ -129,7 +129,7 @@ index e53c32362774..1c99c99f4627 100644 struct stmmac_dma_cfg *dma_cfg, u32 chan); void (*init_rx_chan)(struct stmmac_priv *priv, void __iomem *ioaddr, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index f3a1b179aaea..9f1286835550 100644 +index afb8a5a079fa..30be8a77de17 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3003,7 +3003,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch b/runtime-kernel/linux-kernel/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch index b6c39aa0f9e..6fc12395688 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0002-UPSTREAM-net-stmmac-Add-multi-channel-support.patch @@ -1,7 +1,7 @@ -From a3ddc68c851a794e01c2be4b2b94ff8b54e414c9 Mon Sep 17 00:00:00 2001 +From 92b87b44f271e22cd4e7fcc1e2fd57f4bdf377b8 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:29 +0800 -Subject: [PATCH 002/136] UPSTREAM: net: stmmac: Add multi-channel support +Subject: [PATCH 002/156] UPSTREAM: net: stmmac: Add multi-channel support DW GMAC v3.73 can be equipped with the Audio Video (AV) feature which enables transmission of time-sensitive traffic over bridged local area @@ -311,7 +311,7 @@ index 1c99c99f4627..7e90f34b8c88 100644 u32 chan, bool rx, bool tx); void (*disable_dma_irq)(struct stmmac_priv *priv, void __iomem *ioaddr, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index 9f1286835550..d9fca8d1227c 100644 +index 30be8a77de17..88b3179dac9f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2367,9 +2367,11 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) @@ -338,7 +338,7 @@ index 9f1286835550..d9fca8d1227c 100644 xsk_tx_metadata_to_compl(meta, &tx_q->tx_skbuff_dma[entry].xsk_meta); -@@ -4753,7 +4755,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -4766,7 +4768,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len); @@ -347,7 +347,7 @@ index 9f1286835550..d9fca8d1227c 100644 stmmac_flush_tx_descriptors(priv, queue); stmmac_tx_timer_arm(priv, queue); -@@ -4980,7 +4982,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue, +@@ -4993,7 +4995,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue, u64_stats_update_end(&txq_stats->q_syncp); } diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch b/runtime-kernel/linux-kernel/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch index 4eca5bc29ca..3e9e887e850 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0003-UPSTREAM-net-stmmac-Export-dwmac1000_dma_ops.patch @@ -1,7 +1,7 @@ -From b063435621cbcd3fd51cb25d05106c3380f3433e Mon Sep 17 00:00:00 2001 +From 81aefab4299d0457a4598b48b2084c8544957df6 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:45:30 +0800 -Subject: [PATCH 003/136] UPSTREAM: net: stmmac: Export dwmac1000_dma_ops +Subject: [PATCH 003/156] UPSTREAM: net: stmmac: Export dwmac1000_dma_ops Export the DW GMAC DMA-ops descriptor so one could be available in the low-level platform drivers. It will be utilized to override some diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch b/runtime-kernel/linux-kernel/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch index aa950a7bf62..29df77a8934 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0004-UPSTREAM-net-stmmac-dwmac-loongson-Drop-duplicated-h.patch @@ -1,7 +1,7 @@ -From acfbae3e8040d845f20cfbbb5b878ff16de72087 Mon Sep 17 00:00:00 2001 +From 2b9847a3d238bcc879be726657d0aebf00e9f2a5 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:07 +0800 -Subject: [PATCH 004/136] UPSTREAM: net: stmmac: dwmac-loongson: Drop +Subject: [PATCH 004/156] UPSTREAM: net: stmmac: dwmac-loongson: Drop duplicated hash-based filter size init The plat_stmmacenet_data::multicast_filter_bins field is twice diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch b/runtime-kernel/linux-kernel/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch index f2f85192c5d..9de75d6e67b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0005-UPSTREAM-net-stmmac-dwmac-loongson-Drop-pci_enable-d.patch @@ -1,7 +1,7 @@ -From 2a825df8370cabf00a4144536eb462b26fb9876f Mon Sep 17 00:00:00 2001 +From 1ae366570645f4cfbd7ad578b1f7fe36d5d74409 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:08 +0800 -Subject: [PATCH 005/136] UPSTREAM: net: stmmac: dwmac-loongson: Drop +Subject: [PATCH 005/156] UPSTREAM: net: stmmac: dwmac-loongson: Drop pci_enable/disable_msi calls The Loongson GMAC driver currently doesn't utilize the MSI IRQs, but diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch b/runtime-kernel/linux-kernel/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch index 7fdc08d72b5..a0949d28a0a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0006-UPSTREAM-net-stmmac-dwmac-loongson-Use-PCI_DEVICE_DA.patch @@ -1,7 +1,7 @@ -From 2972edf03c4abe5c560473c0c832fd7f41ec1262 Mon Sep 17 00:00:00 2001 +From 3802598ae80709f2c79545831486c9e3dc1644af Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:09 +0800 -Subject: [PATCH 006/136] UPSTREAM: net: stmmac: dwmac-loongson: Use +Subject: [PATCH 006/156] UPSTREAM: net: stmmac: dwmac-loongson: Use PCI_DEVICE_DATA() macro for device identification For the readability sake convert the hard-coded Loongson GMAC PCI ID to diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch b/runtime-kernel/linux-kernel/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch index 5048dffc5c8..34a6152fc86 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0007-UPSTREAM-net-stmmac-dwmac-loongson-Detach-GMAC-speci.patch @@ -1,7 +1,7 @@ -From bed65aa3ed1d69a124b5af977a42b9e8066e45d1 Mon Sep 17 00:00:00 2001 +From 709c822af9036b06d097dce1a9a59004e7af5df7 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:47:10 +0800 -Subject: [PATCH 007/136] UPSTREAM: net: stmmac: dwmac-loongson: Detach +Subject: [PATCH 007/156] UPSTREAM: net: stmmac: dwmac-loongson: Detach GMAC-specific platform data init Loongson delivers two types of the network devices: Loongson GMAC and diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch b/runtime-kernel/linux-kernel/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch index 43fdeed248c..41c520f8ba6 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0008-UPSTREAM-net-stmmac-dwmac-loongson-Add-phy_interface.patch @@ -1,7 +1,7 @@ -From 3f19ec4946927e2b0ad77921281209534a07415e Mon Sep 17 00:00:00 2001 +From 5d200790a06f27176875c105816d75e1d452a35c Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:03 +0800 -Subject: [PATCH 008/136] UPSTREAM: net: stmmac: dwmac-loongson: Add +Subject: [PATCH 008/156] UPSTREAM: net: stmmac: dwmac-loongson: Add phy_interface for Loongson GMAC PHY-interface of the Loongson GMAC device is RGMII with no internal diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch b/runtime-kernel/linux-kernel/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch index 9eae8de48bb..c69250a2a50 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0009-UPSTREAM-net-stmmac-dwmac-loongson-Introduce-PCI-dev.patch @@ -1,7 +1,7 @@ -From 837b04eda9001da60c9b927489ccb1aebe293ad9 Mon Sep 17 00:00:00 2001 +From 3ac46d4f61ea3d07ed3ece1cfdfbc999ed766f9b Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:04 +0800 -Subject: [PATCH 009/136] UPSTREAM: net: stmmac: dwmac-loongson: Introduce PCI +Subject: [PATCH 009/156] UPSTREAM: net: stmmac: dwmac-loongson: Introduce PCI device info data The Loongson GNET device support is about to be added in one of the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch index 7535d87caaf..acc6fef983b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0010-UPSTREAM-net-stmmac-dwmac-loongson-Add-DT-less-GMAC-.patch @@ -1,7 +1,7 @@ -From 7ff50f25283d623c55c08f1dbd4309491c225739 Mon Sep 17 00:00:00 2001 +From 32bdd7fb785ab245eadc9c54e10bc5adf1e30996 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:05 +0800 -Subject: [PATCH 010/136] UPSTREAM: net: stmmac: dwmac-loongson: Add DT-less +Subject: [PATCH 010/156] UPSTREAM: net: stmmac: dwmac-loongson: Add DT-less GMAC PCI-device support The Loongson GMAC driver currently supports the network controllers diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch b/runtime-kernel/linux-kernel/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch index ba5938f5642..c10b0de671c 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0011-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-Mult.patch @@ -1,7 +1,7 @@ -From 10bfd43fd621924c9a08759c56e58ce462773793 Mon Sep 17 00:00:00 2001 +From 73f5fcf08bc05abfc894c63c9dc6324f7934fd41 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:54 +0800 -Subject: [PATCH 011/136] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson +Subject: [PATCH 011/156] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support The Loongson DWMAC driver currently supports the Loongson GMAC diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch b/runtime-kernel/linux-kernel/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch index c6dc62b1612..d890c607463 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0012-UPSTREAM-net-stmmac-dwmac-loongson-Add-Loongson-GNET.patch @@ -1,7 +1,7 @@ -From 0523fdc1a05f7602537ddd8552b7c1a9082e253c Mon Sep 17 00:00:00 2001 +From 65a9cc808ecb94d584c4a9bbbc2544c135319b8c Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:55 +0800 -Subject: [PATCH 012/136] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson +Subject: [PATCH 012/156] UPSTREAM: net: stmmac: dwmac-loongson: Add Loongson GNET support The new generation Loongson LS2K2000 SoC and LS7A2000 chipset are diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch b/runtime-kernel/linux-kernel/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch index c54464e247d..c00c4a43bb1 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0013-UPSTREAM-net-stmmac-dwmac-loongson-Add-loongson-modu.patch @@ -1,7 +1,7 @@ -From fbeae8b22826bc0a9e9700ab6a4e56ac5e3f06c2 Mon Sep 17 00:00:00 2001 +From 0ba38e82ad1aa11d6fca0cf2fd3865a36693965d Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 7 Aug 2024 21:48:56 +0800 -Subject: [PATCH 013/136] UPSTREAM: net: stmmac: dwmac-loongson: Add loongson +Subject: [PATCH 013/156] UPSTREAM: net: stmmac: dwmac-loongson: Add loongson module author Add Yanteng Si as MODULE_AUTHOR of Loongson DWMAC PCI driver. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch index 6698bb8054c..3aac6a66ca7 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0014-UPSTREAM-LoongArch-Revert-qspinlock-to-test-and-set-.patch @@ -1,7 +1,7 @@ -From 025350973de15a7fc9a80fb3a2c94a7f922645e3 Mon Sep 17 00:00:00 2001 +From 3ee7b3657a2f5c109f4be0511b3bd50379de6cf0 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 014/136] UPSTREAM: LoongArch: Revert qspinlock to test-and-set +Subject: [PATCH 014/156] UPSTREAM: LoongArch: Revert qspinlock to test-and-set simple lock on VM Similar with x86, when VM is detected, revert to a simple test-and-set @@ -152,10 +152,10 @@ index 9c9b75b76f62..32537e9b1708 100644 + return 0; +} diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c -index 0f0740f0be27..00e307203ddb 100644 +index d2b18ed23b8a..cbd3c09a93c1 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c -@@ -603,6 +603,8 @@ void __init setup_arch(char **cmdline_p) +@@ -604,6 +604,8 @@ void __init setup_arch(char **cmdline_p) arch_mem_init(cmdline_p); resource_init(); diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch b/runtime-kernel/linux-kernel/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch index 5c08406b1c1..a0a72291070 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0015-UPSTREAM-LoongArch-KVM-Add-VM-feature-detection-func.patch @@ -1,7 +1,7 @@ -From 8ecfb0ed873e7f63821a1e2cb851bef09f194eb3 Mon Sep 17 00:00:00 2001 +From feca8b81dd1aff2256c79806170645767d6ffd00 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 015/136] UPSTREAM: LoongArch: KVM: Add VM feature detection +Subject: [PATCH 015/156] UPSTREAM: LoongArch: KVM: Add VM feature detection function Loongson SIMD Extension (LSX), Loongson Advanced SIMD Extension (LASX) diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch b/runtime-kernel/linux-kernel/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch index 1a596f63321..3ddfe1eeff3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0016-UPSTREAM-LoongArch-KVM-Add-Binary-Translation-extens.patch @@ -1,7 +1,7 @@ -From f3b96d3c5e3f71381bb0742e97051ba23c740fe2 Mon Sep 17 00:00:00 2001 +From ec0f45f6d968cff7e922c6f658d56b160e83d279 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 016/136] UPSTREAM: LoongArch: KVM: Add Binary Translation +Subject: [PATCH 016/156] UPSTREAM: LoongArch: KVM: Add Binary Translation extension support Loongson Binary Translation (LBT) is used to accelerate binary translation, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch index f16889495b0..c8a95f659a6 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0017-UPSTREAM-LoongArch-KVM-Add-vm-migration-support-for-.patch @@ -1,7 +1,7 @@ -From d8fa5c6421c4f8e54b5de1303cd7ad1ef9ea4eb1 Mon Sep 17 00:00:00 2001 +From c579334ba8b90ee281fc9e0c1b9d63e8a72e4ac9 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 11 Sep 2024 23:26:32 +0800 -Subject: [PATCH 017/136] UPSTREAM: LoongArch: KVM: Add vm migration support +Subject: [PATCH 017/156] UPSTREAM: LoongArch: KVM: Add vm migration support for LBT registers Every vcpu has separate LBT registers. And there are four scr registers, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch b/runtime-kernel/linux-kernel/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch index 5290f686eaa..b97df7f0958 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0018-UPSTREAM-LoongArch-KVM-Add-PMU-support-for-guest.patch @@ -1,7 +1,7 @@ -From 0307a7c039a1b592c86d821e826bdcfdfa37fdf1 Mon Sep 17 00:00:00 2001 +From 634a3f39e68c154b8c2016744e73876b1be78dab Mon Sep 17 00:00:00 2001 From: Song Gao Date: Thu, 12 Sep 2024 20:53:40 +0800 -Subject: [PATCH 018/136] UPSTREAM: LoongArch: KVM: Add PMU support for guest +Subject: [PATCH 018/156] UPSTREAM: LoongArch: KVM: Add PMU support for guest On LoongArch, the host and guest have their own PMU CSRs registers and they share PMU hardware resources. A set of PMU CSRs consists of a CTRL diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch b/runtime-kernel/linux-kernel/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch index ad708243f08..1c850f16ece 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0019-UPSTREAM-LoongArch-KVM-Enable-paravirt-feature-contr.patch @@ -1,7 +1,7 @@ -From 1117b27df87b113630ea116412e65d35483c7ce6 Mon Sep 17 00:00:00 2001 +From f8b4f3474d5d50c87cdbb283512b5ec34247084a Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Thu, 12 Sep 2024 20:53:40 +0800 -Subject: [PATCH 019/136] UPSTREAM: LoongArch: KVM: Enable paravirt feature +Subject: [PATCH 019/156] UPSTREAM: LoongArch: KVM: Enable paravirt feature control from VMM Export kernel paravirt features to user space, so that VMM can control diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch b/runtime-kernel/linux-kernel/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch index cbc41f19171..6e2c616d725 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0020-UPSTREAM-LoongArch-KVM-Implement-function-kvm_para_h.patch @@ -1,7 +1,7 @@ -From ae4dbaaed98b3e1e556e0efdaedb8de3a8377caf Mon Sep 17 00:00:00 2001 +From ae058ae99b29a9d20b2d61ea5c41bcedfe8aeefd Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Thu, 12 Sep 2024 22:56:14 +0800 -Subject: [PATCH 020/136] UPSTREAM: LoongArch: KVM: Implement function +Subject: [PATCH 020/156] UPSTREAM: LoongArch: KVM: Implement function kvm_para_has_feature() Implement function kvm_para_has_feature() to detect supported paravirt diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch b/runtime-kernel/linux-kernel/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch index 8b2388dd9f7..a92070b6a74 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0021-UPSTREAM-Loongarch-KVM-Add-KVM-hypercalls-documentat.patch @@ -1,7 +1,7 @@ -From 12456a0fce5003a3419a8a1a1cdb7a8a8cd92cc3 Mon Sep 17 00:00:00 2001 +From e6b7c487ecdfd3f6fbfdfd39864474221cb3828e Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Wed, 28 Aug 2024 12:59:50 +0800 -Subject: [PATCH 021/136] UPSTREAM: Loongarch: KVM: Add KVM hypercalls +Subject: [PATCH 021/156] UPSTREAM: Loongarch: KVM: Add KVM hypercalls documentation for LoongArch Add documentation topic for using pv_virt when running as a guest diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch b/runtime-kernel/linux-kernel/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch index 1e96ef2f243..c95f94575a2 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0022-UPSTREAM-treewide-correct-the-typo-retun.patch @@ -1,7 +1,7 @@ -From 0f0e513a112262e0bd064c00afca2f39906b00c8 Mon Sep 17 00:00:00 2001 +From 413c6aba0ff447490bb63a1af69bde1175543a4d Mon Sep 17 00:00:00 2001 From: WangYuli Date: Fri, 6 Sep 2024 13:40:08 +0800 -Subject: [PATCH 022/136] UPSTREAM: treewide: correct the typo 'retun' +Subject: [PATCH 022/156] UPSTREAM: treewide: correct the typo 'retun' There are some spelling mistakes of 'retun' in comments which should be instead of 'return'. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch b/runtime-kernel/linux-kernel/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch index 06a8722ea96..b44882c364f 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0023-UPSTREAM-cpu-hotplug-Make-HOTPLUG_PARALLEL-independe.patch @@ -1,7 +1,7 @@ -From 3974fe82e4a5b23fb716ec7f8667f87f46ce4476 Mon Sep 17 00:00:00 2001 +From 83ac05a24d3ff53d5f68debf8e4e27aad06b3efd Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:14:58 +0800 -Subject: [PATCH 023/136] UPSTREAM: cpu/hotplug: Make HOTPLUG_PARALLEL +Subject: [PATCH 023/156] UPSTREAM: cpu/hotplug: Make HOTPLUG_PARALLEL independent of HOTPLUG_SMT Provide stub functions for SMT related parallel bring up functions so that diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch index 50b3b16fba1..b8c30eb0533 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0024-UPSTREAM-cpu-hotplug-Provide-weak-fallback-for-arch_.patch @@ -1,7 +1,7 @@ -From 70cbe440cfa89e8d2a808f6d3ef9ba64d19d0a4c Mon Sep 17 00:00:00 2001 +From bb5e4c46110fb9b0918c2f09feff906089a2e925 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:14:59 +0800 -Subject: [PATCH 024/136] UPSTREAM: cpu/hotplug: Provide weak fallback for +Subject: [PATCH 024/156] UPSTREAM: cpu/hotplug: Provide weak fallback for arch_cpuhp_init_parallel_bringup() CONFIG_HOTPLUG_PARALLEL expects the architecture to implement diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch b/runtime-kernel/linux-kernel/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch index 1ff345dabd6..8887dd95623 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0025-UPSTREAM-irqchip-loongson-pch-msi-Switch-to-MSI-pare.patch @@ -1,7 +1,7 @@ -From d20aa9fbb304be006b0dcee8f696a89477ed1286 Mon Sep 17 00:00:00 2001 +From 7c75261d52ebb3b2d6953044d43b73cc4bb8a320 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 15 Aug 2024 19:26:07 +0800 -Subject: [PATCH 025/136] UPSTREAM: irqchip/loongson-pch-msi: Switch to MSI +Subject: [PATCH 025/156] UPSTREAM: irqchip/loongson-pch-msi: Switch to MSI parent domains Remove the global PCI/MSI irqdomain implementation and provide the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch index 70c3c2e5e84..b80a8753820 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0026-BACKPORT-LoongArch-Move-irqchip-function-prototypes-.patch @@ -1,7 +1,7 @@ -From f2de3afd71ee070a715f1ec6d1b68bf1f1801ab6 Mon Sep 17 00:00:00 2001 +From 842740dc2455e4cd2f55d357d73732f8de0cfadf Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:32 +0800 -Subject: [PATCH 026/136] BACKPORT: LoongArch: Move irqchip function prototypes +Subject: [PATCH 026/156] BACKPORT: LoongArch: Move irqchip function prototypes to irq-loongson.h Some irqchip functions are only for internal use by irqchip drivers, so diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch b/runtime-kernel/linux-kernel/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch index 275a297060d..851a7b8d9fc 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0027-UPSTREAM-LoongArch-Architectural-preparation-for-AVE.patch @@ -1,7 +1,7 @@ -From 75a67da700ae2c22ec269ebc04579bd434c39c9c Mon Sep 17 00:00:00 2001 +From 800fc7e94a6beb024f8104b7ec7cd9830aa8ab2b Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:33 +0800 -Subject: [PATCH 027/136] UPSTREAM: LoongArch: Architectural preparation for +Subject: [PATCH 027/156] UPSTREAM: LoongArch: Architectural preparation for AVEC irqchip Add architectural preparation for AVEC irqchip, including: diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch b/runtime-kernel/linux-kernel/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch index b92cb1d2137..3763ee3a732 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0028-BACKPORT-irqchip-loongson-eiointc-Rename-CPUHP_AP_IR.patch @@ -1,7 +1,7 @@ -From b29f8e81123a9f20affb08a8a291bd95f379f8b4 Mon Sep 17 00:00:00 2001 +From 71f3c56d8baa6ef31976f2fb83dcd0e9981d2b61 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 23 Aug 2024 18:39:34 +0800 -Subject: [PATCH 028/136] BACKPORT: irqchip/loongson-eiointc: Rename +Subject: [PATCH 028/156] BACKPORT: irqchip/loongson-eiointc: Rename CPUHP_AP_IRQ_LOONGARCH_STARTING Rename CPUHP_AP_IRQ_LOONGARCH_STARTING to CPUHP_AP_IRQ_EIOINTC_STARTING diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch b/runtime-kernel/linux-kernel/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch index 365fb5ce752..01bcb864f01 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0029-UPSTREAM-irqchip-loongson-pch-msi-Prepare-get_pch_ms.patch @@ -1,7 +1,7 @@ -From 43f19a98cf6f1c2484d0d8d4231ae3147d0152d2 Mon Sep 17 00:00:00 2001 +From d066042c8e3e2824f7183c0fb2f79d89f27f0dc1 Mon Sep 17 00:00:00 2001 From: Tianyang Zhang Date: Fri, 23 Aug 2024 18:43:36 +0800 -Subject: [PATCH 029/136] UPSTREAM: irqchip/loongson-pch-msi: Prepare +Subject: [PATCH 029/156] UPSTREAM: irqchip/loongson-pch-msi: Prepare get_pch_msi_handle() for AVECINTC On Loongson-3C6000 and higher systems with AVECINTC irqchip, there may diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch b/runtime-kernel/linux-kernel/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch index 298263641cc..7cd36e34fca 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0030-BACKPORT-irqchip-loongarch-avec-Add-AVEC-irqchip-sup.patch @@ -1,7 +1,7 @@ -From b4fc62f13499fe67189ad012978a956fa5e9d827 Mon Sep 17 00:00:00 2001 +From 91cdedc38ced7e43c2c9d61ddcf2fc09df570ae1 Mon Sep 17 00:00:00 2001 From: Tianyang Zhang Date: Fri, 23 Aug 2024 18:43:37 +0800 -Subject: [PATCH 030/136] BACKPORT: irqchip/loongarch-avec: Add AVEC irqchip +Subject: [PATCH 030/156] BACKPORT: irqchip/loongarch-avec: Add AVEC irqchip support Introduce the advanced extended interrupt controllers (AVECINTC). This diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch b/runtime-kernel/linux-kernel/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch index 9da994ac454..15d246c3888 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0031-UPSTREAM-PCI-ACPI-Increase-Loongson-max-PCI-hosts-to.patch @@ -1,7 +1,7 @@ -From 425fd551f56889f6dbdd37a21fce7a4600f5af65 Mon Sep 17 00:00:00 2001 +From 6ea5941aa5a3c50a4340ba975c2850d3fd8ab714 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 26 Jul 2024 17:29:11 +0800 -Subject: [PATCH 031/136] UPSTREAM: PCI/ACPI: Increase Loongson max PCI hosts +Subject: [PATCH 031/156] UPSTREAM: PCI/ACPI: Increase Loongson max PCI hosts to 8 Beginning with Loongson-3C6000, there can be up to 8 PCI hosts for diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch b/runtime-kernel/linux-kernel/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch index 50a28fa7e28..1e81dd63620 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0032-UPSTREAM-LoongArch-Enable-objtool-for-Clang.patch @@ -1,7 +1,7 @@ -From d0ca13875fa8888a3164c97b5206ec6338136382 Mon Sep 17 00:00:00 2001 +From 7ccc2cfd670d7a6bfdde0e375c5a4c6c6ff99f00 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:09 +0800 -Subject: [PATCH 032/136] UPSTREAM: LoongArch: Enable objtool for Clang +Subject: [PATCH 032/156] UPSTREAM: LoongArch: Enable objtool for Clang For now, it can enable objtool for Clang, just remove !CC_IS_CLANG for HAVE_OBJTOOL in arch/loongarch/Kconfig. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch b/runtime-kernel/linux-kernel/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch index ad07d50aaa1..b524b7ed4c8 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0033-UPSTREAM-LoongArch-Set-AS_HAS_THIN_ADD_SUB-as-y-if-A.patch @@ -1,7 +1,7 @@ -From ebdb5e55c7e3f34de6371e3e6de0a8ab5f69a0b0 Mon Sep 17 00:00:00 2001 +From fcf4b8f8bef80d99a22e2a75f74934b096ad055b Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:09 +0800 -Subject: [PATCH 033/136] UPSTREAM: LoongArch: Set AS_HAS_THIN_ADD_SUB as y if +Subject: [PATCH 033/156] UPSTREAM: LoongArch: Set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM When building kernel with "make CC=clang defconfig", LLVM Assembler is diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch b/runtime-kernel/linux-kernel/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch index 1755bfc5202..7d3c1304223 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0034-UPSTREAM-LoongArch-Remove-STACK_FRAME_NON_STANDARD-d.patch @@ -1,7 +1,7 @@ -From 822615a367b1e984ac1df11b58ddc6d0934f78fc Mon Sep 17 00:00:00 2001 +From 8f44292b0ca056712073476c56950c02533e45a8 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 17 Sep 2024 22:23:10 +0800 -Subject: [PATCH 034/136] UPSTREAM: LoongArch: Remove +Subject: [PATCH 034/156] UPSTREAM: LoongArch: Remove STACK_FRAME_NON_STANDARD(do_syscall) For now, we can remove STACK_FRAME_NON_STANDARD(do_syscall) because diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch b/runtime-kernel/linux-kernel/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch index 8d9fd069967..5860038327e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0035-UPSTREAM-LoongArch-Enable-generic-CPU-vulnerabilites.patch @@ -1,7 +1,7 @@ -From 5af75d679df39f1d4aa451beaab7530c50725519 Mon Sep 17 00:00:00 2001 +From 4a99dc573243342878119ddcc1bdbd5dedf45578 Mon Sep 17 00:00:00 2001 From: Tiezhu Yang Date: Tue, 24 Sep 2024 15:31:51 +0800 -Subject: [PATCH 035/136] UPSTREAM: LoongArch: Enable generic CPU +Subject: [PATCH 035/156] UPSTREAM: LoongArch: Enable generic CPU vulnerabilites support Currently, many architectures support generic CPU vulnerabilites, such diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch b/runtime-kernel/linux-kernel/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch index 5e91743cfd6..b0333359b21 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0036-UPSTREAM-LoongArch-Enable-ACPI-BGRT-handling.patch @@ -1,7 +1,7 @@ -From 99884d8639f02f8ca93b44bf9b3ee259c791fb8c Mon Sep 17 00:00:00 2001 +From 883fba49772e9f267fcd2eba09e5f12ab96ced54 Mon Sep 17 00:00:00 2001 From: Bibo Mao Date: Tue, 24 Sep 2024 15:32:06 +0800 -Subject: [PATCH 036/136] UPSTREAM: LoongArch: Enable ACPI BGRT handling +Subject: [PATCH 036/156] UPSTREAM: LoongArch: Enable ACPI BGRT handling Add ACPI BGRT support on LoongArch so it can display image provied by acpi table at boot stage and switch to graphical UI smoothly. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch b/runtime-kernel/linux-kernel/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch index 95ec0a0ebcf..dba464df4eb 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0037-UPSTREAM-LoongArch-Rework-CPU-feature-probe-from-CPU.patch @@ -1,7 +1,7 @@ -From ee29bf2de186a3854d5eac49a07d72c9d2e1d2ae Mon Sep 17 00:00:00 2001 +From 976c7ece32787ec8fa7d67ee99ea511ad05dde5c Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 037/136] UPSTREAM: LoongArch: Rework CPU feature probe from +Subject: [PATCH 037/156] UPSTREAM: LoongArch: Rework CPU feature probe from CPUCFG/IOCSR Probe ISA level, TLB, IOCSR information from CPUCFG to improve kernel diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch b/runtime-kernel/linux-kernel/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch index 3a6dc160ced..738f4f35087 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0038-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_MEMORY-support.patch @@ -1,7 +1,7 @@ -From e64d54f3ca663a517a126412fc270fd5ab906e05 Mon Sep 17 00:00:00 2001 +From 06ab0dfff28566fb22c365f729d3670c65f33358 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 038/136] UPSTREAM: LoongArch: Add ARCH_HAS_SET_MEMORY support +Subject: [PATCH 038/156] UPSTREAM: LoongArch: Add ARCH_HAS_SET_MEMORY support Add set_memory_ro/rw/x/nx architecture hooks to change the page attribution. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch b/runtime-kernel/linux-kernel/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch index ee6799d9362..b7feed24619 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0039-UPSTREAM-LoongArch-Add-ARCH_HAS_SET_DIRECT_MAP-suppo.patch @@ -1,7 +1,7 @@ -From a8412b2dc4f5c8f2c77aeb90b37aca5fbba69f31 Mon Sep 17 00:00:00 2001 +From 4547bfbd072abe2f27f48e04496f369d74c1291d Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 039/136] UPSTREAM: LoongArch: Add ARCH_HAS_SET_DIRECT_MAP +Subject: [PATCH 039/156] UPSTREAM: LoongArch: Add ARCH_HAS_SET_DIRECT_MAP support Add set_direct_map_*() functions for setting the direct map alias for diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch b/runtime-kernel/linux-kernel/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch index a59e0883bd9..2b7ae6f24e2 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0040-UPSTREAM-LoongArch-Improve-hardware-page-table-walke.patch @@ -1,7 +1,7 @@ -From 5cf3791859bb121bbcb7c19b112bcf5db0ba6a31 Mon Sep 17 00:00:00 2001 +From a2212ed94d984824c266b21974f405b164e89a2c Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 040/136] UPSTREAM: LoongArch: Improve hardware page table +Subject: [PATCH 040/156] UPSTREAM: LoongArch: Improve hardware page table walker LoongArch has similar problems explained in commit 7f0b1bf04511348995d6 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch b/runtime-kernel/linux-kernel/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch index 0c726b60b30..f2cfb73aef1 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0041-UPSTREAM-LoongArch-Simplify-_percpu_read-and-_percpu.patch @@ -1,7 +1,7 @@ -From c4b1b257299f8e7d318bae18b38ff965b06de80d Mon Sep 17 00:00:00 2001 +From 6cf36786cff27ee3e7fccf4dbd12e72259902fd1 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 041/136] UPSTREAM: LoongArch: Simplify _percpu_read() and +Subject: [PATCH 041/156] UPSTREAM: LoongArch: Simplify _percpu_read() and _percpu_write() Now _percpu_read() and _percpu_write() macros call __percpu_read() diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch b/runtime-kernel/linux-kernel/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch index 059bcbc885c..d48252dbe3a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0042-UPSTREAM-LoongArch-Remove-posix_types.h-include-from.patch @@ -1,7 +1,7 @@ -From abf6aabc0b833f2f947190fd1ec8ca5991c8af99 Mon Sep 17 00:00:00 2001 +From dddbdfecadc04b1c97bc8f00d36e615fd76a3587 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 24 Sep 2024 15:32:20 +0800 -Subject: [PATCH 042/136] UPSTREAM: LoongArch: Remove posix_types.h include +Subject: [PATCH 042/156] UPSTREAM: LoongArch: Remove posix_types.h include from sigcontext.h Nothing in sigcontext.h seems to require anything from diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch b/runtime-kernel/linux-kernel/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch index 234643e4bac..08cf2e33c2d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0043-UPSTREAM-Docs-LoongArch-Add-advanced-extended-IRQ-mo.patch @@ -1,7 +1,7 @@ -From 414d3e48bd9bb22c40be57157f61f0bbe3296b24 Mon Sep 17 00:00:00 2001 +From b2b9fad21e0dbce8aed3f3cccddee1fb52647848 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 17 Sep 2024 22:23:22 +0800 -Subject: [PATCH 043/136] UPSTREAM: Docs/LoongArch: Add advanced extended IRQ +Subject: [PATCH 043/156] UPSTREAM: Docs/LoongArch: Add advanced extended IRQ model description Introduce the advanced extended interrupt controllers (AVECINTC). This diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch b/runtime-kernel/linux-kernel/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch new file mode 100644 index 00000000000..2b2bf83cda9 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0044-UPSTREAM-hwmon-Add-thermal-sensor-driver-for-Surface.patch @@ -0,0 +1,327 @@ +From 83387410868a7ea7c626845fbcc0e8c2c0816c64 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sun, 11 Aug 2024 02:14:41 +0200 +Subject: [PATCH 044/156] UPSTREAM: hwmon: Add thermal sensor driver for + Surface Aggregator Module + +Some of the newer Microsoft Surface devices (such as the Surface Book +3 and Pro 9) have thermal sensors connected via the Surface Aggregator +Module (the embedded controller on those devices). Add a basic driver +to read out the temperature values of those sensors. + +The EC can have up to 16 thermal sensors connected via a single +sub-device, each providing temperature readings and a label string. + +Link: https://github.com/linux-surface/surface-aggregator-module/issues/59 +Reviewed-by: Hans de Goede +Co-developed-by: Ivor Wanders +Signed-off-by: Ivor Wanders +Signed-off-by: Maximilian Luz +Message-ID: <20240811001503.753728-1-luzmaximilian@gmail.com> +Signed-off-by: Guenter Roeck + +(cherry picked from commit 63be321e5a096746b396fc43c7d25135a61617c9) +Signed-off-by: Kexy Biscuit +--- + MAINTAINERS | 6 + + drivers/hwmon/Kconfig | 11 ++ + drivers/hwmon/Makefile | 1 + + drivers/hwmon/surface_temp.c | 235 +++++++++++++++++++++++++++++++++++ + 4 files changed, 253 insertions(+) + create mode 100644 drivers/hwmon/surface_temp.c + +diff --git a/MAINTAINERS b/MAINTAINERS +index 53629156e327..73ebd630afe7 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -15219,6 +15219,12 @@ S: Maintained + F: Documentation/hwmon/surface_fan.rst + F: drivers/hwmon/surface_fan.c + ++MICROSOFT SURFACE SENSOR THERMAL DRIVER ++M: Maximilian Luz ++L: linux-hwmon@vger.kernel.org ++S: Maintained ++F: drivers/hwmon/surface_temp.c ++ + MICROSOFT SURFACE GPE LID SUPPORT DRIVER + M: Maximilian Luz + L: platform-driver-x86@vger.kernel.org +diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig +index 778e584c3a75..6b0f71c059ab 100644 +--- a/drivers/hwmon/Kconfig ++++ b/drivers/hwmon/Kconfig +@@ -2084,6 +2084,17 @@ config SENSORS_SURFACE_FAN + + Select M or Y here, if you want to be able to read the fan's speed. + ++config SENSORS_SURFACE_TEMP ++ tristate "Microsoft Surface Thermal Sensor Driver" ++ depends on SURFACE_AGGREGATOR ++ depends on SURFACE_AGGREGATOR_BUS ++ help ++ Driver for monitoring thermal sensors connected via the Surface ++ Aggregator Module (embedded controller) on Microsoft Surface devices. ++ ++ This driver can also be built as a module. If so, the module ++ will be called surface_temp. ++ + config SENSORS_ADC128D818 + tristate "Texas Instruments ADC128D818" + depends on I2C +diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile +index b1c7056c37db..3ce8d6a9202e 100644 +--- a/drivers/hwmon/Makefile ++++ b/drivers/hwmon/Makefile +@@ -209,6 +209,7 @@ obj-$(CONFIG_SENSORS_SPARX5) += sparx5-temp.o + obj-$(CONFIG_SENSORS_SPD5118) += spd5118.o + obj-$(CONFIG_SENSORS_STTS751) += stts751.o + obj-$(CONFIG_SENSORS_SURFACE_FAN)+= surface_fan.o ++obj-$(CONFIG_SENSORS_SURFACE_TEMP)+= surface_temp.o + obj-$(CONFIG_SENSORS_SY7636A) += sy7636a-hwmon.o + obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o + obj-$(CONFIG_SENSORS_TC74) += tc74.o +diff --git a/drivers/hwmon/surface_temp.c b/drivers/hwmon/surface_temp.c +new file mode 100644 +index 000000000000..cd21f331f157 +--- /dev/null ++++ b/drivers/hwmon/surface_temp.c +@@ -0,0 +1,235 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Thermal sensor subsystem driver for Surface System Aggregator Module (SSAM). ++ * ++ * Copyright (C) 2022-2023 Maximilian Luz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++/* -- SAM interface. -------------------------------------------------------- */ ++ ++/* ++ * Available sensors are indicated by a 16-bit bitfield, where a 1 marks the ++ * presence of a sensor. So we have at most 16 possible sensors/channels. ++ */ ++#define SSAM_TMP_SENSOR_MAX_COUNT 16 ++ ++/* ++ * All names observed so far are 6 characters long, but there's only ++ * zeros after the name, so perhaps they can be longer. This number reflects ++ * the maximum zero-padded space observed in the returned buffer. ++ */ ++#define SSAM_TMP_SENSOR_NAME_LENGTH 18 ++ ++struct ssam_tmp_get_name_rsp { ++ __le16 unknown1; ++ char unknown2; ++ char name[SSAM_TMP_SENSOR_NAME_LENGTH]; ++} __packed; ++ ++static_assert(sizeof(struct ssam_tmp_get_name_rsp) == 21); ++ ++SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_tmp_get_available_sensors, __le16, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x04, ++}); ++ ++SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_temperature, __le16, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x01, ++}); ++ ++SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_name, struct ssam_tmp_get_name_rsp, { ++ .target_category = SSAM_SSH_TC_TMP, ++ .command_id = 0x0e, ++}); ++ ++static int ssam_tmp_get_available_sensors(struct ssam_device *sdev, s16 *sensors) ++{ ++ __le16 sensors_le; ++ int status; ++ ++ status = __ssam_tmp_get_available_sensors(sdev, &sensors_le); ++ if (status) ++ return status; ++ ++ *sensors = le16_to_cpu(sensors_le); ++ return 0; ++} ++ ++static int ssam_tmp_get_temperature(struct ssam_device *sdev, u8 iid, long *temperature) ++{ ++ __le16 temp_le; ++ int status; ++ ++ status = __ssam_tmp_get_temperature(sdev->ctrl, sdev->uid.target, iid, &temp_le); ++ if (status) ++ return status; ++ ++ /* Convert 1/10 °K to 1/1000 °C */ ++ *temperature = (le16_to_cpu(temp_le) - 2731) * 100L; ++ return 0; ++} ++ ++static int ssam_tmp_get_name(struct ssam_device *sdev, u8 iid, char *buf, size_t buf_len) ++{ ++ struct ssam_tmp_get_name_rsp name_rsp; ++ int status; ++ ++ status = __ssam_tmp_get_name(sdev->ctrl, sdev->uid.target, iid, &name_rsp); ++ if (status) ++ return status; ++ ++ /* ++ * This should not fail unless the name in the returned struct is not ++ * null-terminated or someone changed something in the struct ++ * definitions above, since our buffer and struct have the same ++ * capacity by design. So if this fails, log an error message. Since ++ * the more likely cause is that the returned string isn't ++ * null-terminated, we might have received garbage (as opposed to just ++ * an incomplete string), so also fail the function. ++ */ ++ status = strscpy(buf, name_rsp.name, buf_len); ++ if (status < 0) { ++ dev_err(&sdev->dev, "received non-null-terminated sensor name string\n"); ++ return status; ++ } ++ ++ return 0; ++} ++ ++/* -- Driver.---------------------------------------------------------------- */ ++ ++struct ssam_temp { ++ struct ssam_device *sdev; ++ s16 sensors; ++ char names[SSAM_TMP_SENSOR_MAX_COUNT][SSAM_TMP_SENSOR_NAME_LENGTH]; ++}; ++ ++static umode_t ssam_temp_hwmon_is_visible(const void *data, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel) ++{ ++ const struct ssam_temp *ssam_temp = data; ++ ++ if (!(ssam_temp->sensors & BIT(channel))) ++ return 0; ++ ++ return 0444; ++} ++ ++static int ssam_temp_hwmon_read(struct device *dev, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel, long *value) ++{ ++ const struct ssam_temp *ssam_temp = dev_get_drvdata(dev); ++ ++ return ssam_tmp_get_temperature(ssam_temp->sdev, channel + 1, value); ++} ++ ++static int ssam_temp_hwmon_read_string(struct device *dev, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel, const char **str) ++{ ++ const struct ssam_temp *ssam_temp = dev_get_drvdata(dev); ++ ++ *str = ssam_temp->names[channel]; ++ return 0; ++} ++ ++static const struct hwmon_channel_info * const ssam_temp_hwmon_info[] = { ++ HWMON_CHANNEL_INFO(chip, ++ HWMON_C_REGISTER_TZ), ++ HWMON_CHANNEL_INFO(temp, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL, ++ HWMON_T_INPUT | HWMON_T_LABEL), ++ NULL ++}; ++ ++static const struct hwmon_ops ssam_temp_hwmon_ops = { ++ .is_visible = ssam_temp_hwmon_is_visible, ++ .read = ssam_temp_hwmon_read, ++ .read_string = ssam_temp_hwmon_read_string, ++}; ++ ++static const struct hwmon_chip_info ssam_temp_hwmon_chip_info = { ++ .ops = &ssam_temp_hwmon_ops, ++ .info = ssam_temp_hwmon_info, ++}; ++ ++static int ssam_temp_probe(struct ssam_device *sdev) ++{ ++ struct ssam_temp *ssam_temp; ++ struct device *hwmon_dev; ++ s16 sensors; ++ int channel; ++ int status; ++ ++ status = ssam_tmp_get_available_sensors(sdev, &sensors); ++ if (status) ++ return status; ++ ++ ssam_temp = devm_kzalloc(&sdev->dev, sizeof(*ssam_temp), GFP_KERNEL); ++ if (!ssam_temp) ++ return -ENOMEM; ++ ++ ssam_temp->sdev = sdev; ++ ssam_temp->sensors = sensors; ++ ++ /* Retrieve the name for each available sensor. */ ++ for (channel = 0; channel < SSAM_TMP_SENSOR_MAX_COUNT; channel++) { ++ if (!(sensors & BIT(channel))) ++ continue; ++ ++ status = ssam_tmp_get_name(sdev, channel + 1, ssam_temp->names[channel], ++ SSAM_TMP_SENSOR_NAME_LENGTH); ++ if (status) ++ return status; ++ } ++ ++ hwmon_dev = devm_hwmon_device_register_with_info(&sdev->dev, "surface_thermal", ssam_temp, ++ &ssam_temp_hwmon_chip_info, NULL); ++ return PTR_ERR_OR_ZERO(hwmon_dev); ++} ++ ++static const struct ssam_device_id ssam_temp_match[] = { ++ { SSAM_SDEV(TMP, SAM, 0x00, 0x02) }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(ssam, ssam_temp_match); ++ ++static struct ssam_device_driver ssam_temp = { ++ .probe = ssam_temp_probe, ++ .match_table = ssam_temp_match, ++ .driver = { ++ .name = "surface_temp", ++ .probe_type = PROBE_PREFER_ASYNCHRONOUS, ++ }, ++}; ++module_ssam_device_driver(ssam_temp); ++ ++MODULE_AUTHOR("Maximilian Luz "); ++MODULE_DESCRIPTION("Thermal sensor subsystem driver for Surface System Aggregator Module"); ++MODULE_LICENSE("GPL"); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch b/runtime-kernel/linux-kernel/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch index c85c8d16948..5adcb321dd3 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0044-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0045-FROMLIST-SH-cpuinfo-Fix-a-warning-for-CONFIG_CPUMASK.patch @@ -1,7 +1,7 @@ -From 5f6a7a8d85f41687a3776c8616b2b39807fc07e0 Mon Sep 17 00:00:00 2001 +From 685bd4efc58907e746f4d080b026f9034ae7d41f Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 14 Jul 2022 16:41:36 +0800 -Subject: [PATCH 044/136] FROMLIST: SH: cpuinfo: Fix a warning for +Subject: [PATCH 045/156] FROMLIST: SH: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch b/runtime-kernel/linux-kernel/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch similarity index 92% rename from runtime-kernel/linux-kernel/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch index 4bce9effc34..785df3b9174 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0045-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0046-BACKPORT-FROMLIST-usb-phy-tegra-Add-38.4MHz-clock-ta.patch @@ -1,7 +1,7 @@ -From 841d9414beb8c76c1ce38c93a32fc7acfd33a8b6 Mon Sep 17 00:00:00 2001 +From 2052836c69ffd04a9ed5701a241c1b628b814244 Mon Sep 17 00:00:00 2001 From: Hunter Laux Date: Wed, 6 Apr 2016 00:54:05 -0700 -Subject: [PATCH 045/136] BACKPORT: FROMLIST: usb: phy: tegra: Add 38.4MHz +Subject: [PATCH 046/156] BACKPORT: FROMLIST: usb: phy: tegra: Add 38.4MHz clock table entry The Tegra210 uses a 38.4MHz OSC. This clock table entry is required to diff --git a/app-admin/kernel-tools/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch b/runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch index dd7de2bda34..36b8289c299 100644 --- a/app-admin/kernel-tools/autobuild/patches/0046-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0047-FROMLIST-dt-bindings-pwm-Add-Loongson-PWM-controller.patch @@ -1,7 +1,7 @@ -From d9214bf02249453c8a61cc8f9b5f07c3a3f4a9bf Mon Sep 17 00:00:00 2001 +From 059933138e027c69ffec1751ea54ed92c163008c Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Thu, 10 Oct 2024 16:30:25 +0800 -Subject: [PATCH 046/136] FROMLIST: dt-bindings: pwm: Add Loongson PWM +Date: Tue, 22 Oct 2024 17:04:14 +0800 +Subject: [PATCH 047/156] FROMLIST: dt-bindings: pwm: Add Loongson PWM controller Add Loongson PWM controller binding with DT schema format using @@ -11,7 +11,7 @@ Signed-off-by: Binbin Zhou Reviewed-by: Krzysztof Kozlowski Acked-by: Huacai Chen -Link: https://lore.kernel.org/all/fc0711008aae1ec9678813c4ca233db63aa0360d.1728463622.git.zhoubinbin@loongson.cn/ +Link: https://lore.kernel.org/all/dfc1e51dcf94485d1d7abe3612a0d8216143d32d.1729583747.git.zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- .../bindings/pwm/loongson,ls7a-pwm.yaml | 66 +++++++++++++++++++ @@ -92,7 +92,7 @@ index 000000000000..46814773e0cc + #pwm-cells = <3>; + }; diff --git a/MAINTAINERS b/MAINTAINERS -index 53629156e327..cc091571d3ac 100644 +index 73ebd630afe7..6ad85d250abe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13206,6 +13206,12 @@ S: Maintained diff --git a/app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch b/runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch index 6612536183a..074e3caab6d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0047-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-pwm-Add-Loongson-PWM-controller-support.patch @@ -1,7 +1,7 @@ -From 7388b4d3da888696d7457e930225396695525731 Mon Sep 17 00:00:00 2001 +From 38a3f1026bf6c21e3de19adb6d461053642e3b48 Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Thu, 10 Oct 2024 16:30:26 +0800 -Subject: [PATCH 047/136] FROMLIST: pwm: Add Loongson PWM controller support +Date: Tue, 22 Oct 2024 17:04:15 +0800 +Subject: [PATCH 048/156] FROMLIST: pwm: Add Loongson PWM controller support This commit adds a generic PWM framework driver for the PWM controller found on Loongson family chips. @@ -11,18 +11,18 @@ Signed-off-by: Juxin Gao Signed-off-by: Binbin Zhou Acked-by: Huacai Chen -Link: https://lore.kernel.org/all/aab9b84ca3ea7e37cc42ad1622724e8198b5b0ea.1728463622.git.zhoubinbin@loongson.cn/ +Link: https://lore.kernel.org/all/66bcb210478df5215e4e31e4f25c25194d6163ca.1729583747.git.zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- MAINTAINERS | 1 + drivers/pwm/Kconfig | 12 ++ drivers/pwm/Makefile | 1 + - drivers/pwm/pwm-loongson.c | 287 +++++++++++++++++++++++++++++++++++++ - 4 files changed, 301 insertions(+) + drivers/pwm/pwm-loongson.c | 288 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 302 insertions(+) create mode 100644 drivers/pwm/pwm-loongson.c diff --git a/MAINTAINERS b/MAINTAINERS -index cc091571d3ac..8e98849c842f 100644 +index 6ad85d250abe..b584d408c075 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13211,6 +13211,7 @@ M: Binbin Zhou @@ -70,10 +70,10 @@ index 0be4f3e6dd43..7ddf231d9d62 100644 obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx.o diff --git a/drivers/pwm/pwm-loongson.c b/drivers/pwm/pwm-loongson.c new file mode 100644 -index 000000000000..cdd320ed3060 +index 000000000000..4c9b14efadc3 --- /dev/null +++ b/drivers/pwm/pwm-loongson.c -@@ -0,0 +1,287 @@ +@@ -0,0 +1,288 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2017-2024 Loongson Technology Corporation Limited. @@ -292,6 +292,7 @@ index 000000000000..cdd320ed3060 + } + + chip->ops = &pwm_loongson_ops; ++ chip->atomic = true; + dev_set_drvdata(dev, chip); + + ret = devm_pwmchip_add(dev, chip); diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch b/runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch similarity index 91% rename from runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch index 476560b37c6..99cbcca8c0d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0048-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-PCI-pci_call_probe-call-local_pci_probe-whe.patch @@ -1,7 +1,7 @@ -From 05d00f56d01e19c2c86790e6c71b7015f0d0b31b Mon Sep 17 00:00:00 2001 +From 201fad93fc3ca14e739f9f2964cb2397406cb7a8 Mon Sep 17 00:00:00 2001 From: Hongchen Zhang Date: Thu, 13 Jun 2024 15:42:58 +0800 -Subject: [PATCH 048/136] FROMLIST: PCI: pci_call_probe: call local_pci_probe() +Subject: [PATCH 049/156] FROMLIST: PCI: pci_call_probe: call local_pci_probe() when selected cpu is offline Call work_on_cpu(cpu, fn, arg) in pci_call_probe() while the argument diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch b/runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch index c0a47d4d134..6c158f5df73 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0049-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch @@ -1,7 +1,7 @@ -From f038f09e363e0af7d5628f9edab3c7a57e08ad04 Mon Sep 17 00:00:00 2001 +From e4030c81f7a85d039ecd560d156edf5c76b3b1a1 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:27 -0500 -Subject: [PATCH 049/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ANY. +Subject: [PATCH 050/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ANY. This corresponds to part of the functionality of the NT syscall NtWaitForMultipleObjects(). Specifically, it implements the behaviour where diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch b/runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch index f701dd61a62..b397bf5822f 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0050-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch @@ -1,7 +1,7 @@ -From 84105d1b3d39d357ef82e7fe9b3120ce2437a8ed Mon Sep 17 00:00:00 2001 +From 671b90d3e1830636da029e720b951d5efaaa20b7 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:28 -0500 -Subject: [PATCH 050/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ALL. +Subject: [PATCH 051/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_WAIT_ALL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch b/runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch index c0f3e7c2540..642cb19e1a2 100644 --- a/app-admin/kernel-tools/autobuild/patches/0051-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch @@ -1,7 +1,7 @@ -From 740f89023cbc391441f41976a08e555d85cdfe8a Mon Sep 17 00:00:00 2001 +From 9241db70beb0497bc189cb4a3df20764ceb1252a Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:29 -0500 -Subject: [PATCH 051/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX. +Subject: [PATCH 052/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX. This corresponds to the NT syscall NtCreateMutant(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch b/runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch index d58ad5a4ef1..b50b762cda6 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0052-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_UNLOCK.patch @@ -1,7 +1,7 @@ -From 273837066a84abd35455f5fc43f960c72ca26076 Mon Sep 17 00:00:00 2001 +From f9c6f401864e4822dddfbbd882cb96caac211108 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:30 -0500 -Subject: [PATCH 052/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK. +Subject: [PATCH 053/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK. This corresponds to the NT syscall NtReleaseMutant(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch b/runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch index 8b2af53095b..6716990be03 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0053-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch @@ -1,7 +1,7 @@ -From f190b2c69f253a27a5974d1a4aa273eddf3c6732 Mon Sep 17 00:00:00 2001 +From e5b286736401f4e3941123ec8755b6f76f208eb2 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:31 -0500 -Subject: [PATCH 053/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_KILL. +Subject: [PATCH 054/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_KILL. This does not correspond to any NT syscall. Rather, when a thread dies, it should be called by the NT emulator for each mutex, with the TID of the dying diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch b/runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch index eb0d8576cf0..2e0cebd561a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0054-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch @@ -1,7 +1,7 @@ -From d0d86b02ceb927cbeb2dce3a404afe71d21bf932 Mon Sep 17 00:00:00 2001 +From 85e83496cdc212ad71f5acf36885ea6cbe5d4fb2 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:32 -0500 -Subject: [PATCH 054/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_EVENT. +Subject: [PATCH 055/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_CREATE_EVENT. This correspond to the NT syscall NtCreateEvent(). diff --git a/app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch b/runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch index 18aa0d011ff..bf0977e6cde 100644 --- a/app-admin/kernel-tools/autobuild/patches/0055-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_SET.patch @@ -1,7 +1,7 @@ -From 96958b770d7ce34ee4f70aacbc2ff3a5140c9c3b Mon Sep 17 00:00:00 2001 +From 2dc5c9b5d38514fde5d9ecec2ef45258e7a38fa3 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:33 -0500 -Subject: [PATCH 055/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_SET. +Subject: [PATCH 056/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_SET. This corresponds to the NT syscall NtSetEvent(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch b/runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch index ad19b26130e..1d654dbb910 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0056-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_RESET.patch @@ -1,7 +1,7 @@ -From e851458afb9d43ef74cc4403d6c9a663434d8b92 Mon Sep 17 00:00:00 2001 +From 64024446232b7d11812b15f5edd34a27b559b268 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:34 -0500 -Subject: [PATCH 056/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_RESET. +Subject: [PATCH 057/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_RESET. This corresponds to the NT syscall NtResetEvent(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch b/runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch index 871759dfb1f..78866f14b02 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0057-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_PULSE.patch @@ -1,7 +1,7 @@ -From cd86cf17d5ec83c2d1a8a9d3ffb25290c5ea17ae Mon Sep 17 00:00:00 2001 +From e2248072e9652db5fb3b853dffe0f57fd0c7d3fa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:35 -0500 -Subject: [PATCH 057/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_PULSE. +Subject: [PATCH 058/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_PULSE. This corresponds to the NT syscall NtPulseEvent(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch b/runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch index 621157516e2..f3da92dbc2c 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0058-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_SEM_READ.patch @@ -1,7 +1,7 @@ -From 245c5ad748678e5acb803a29a54775b610c08547 Mon Sep 17 00:00:00 2001 +From 4e711ae31b7522079929ada9a1208c2938aa1424 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:36 -0500 -Subject: [PATCH 058/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_SEM_READ. +Subject: [PATCH 059/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_SEM_READ. This corresponds to the NT syscall NtQuerySemaphore(). diff --git a/app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch b/runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch index bd6e6f76f9d..4825c039d8f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0059-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_MUTEX_READ.patch @@ -1,7 +1,7 @@ -From 2fcdba1584054357170824c3c3639519a151ea92 Mon Sep 17 00:00:00 2001 +From e75e8b837827e09b27454150cf92439e396894e4 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:37 -0500 -Subject: [PATCH 059/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_READ. +Subject: [PATCH 060/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_MUTEX_READ. This corresponds to the NT syscall NtQueryMutant(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch b/runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch index 479f911fda1..33b575de523 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0060-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-NTSYNC_IOC_EVENT_READ.patch @@ -1,7 +1,7 @@ -From 44faf909179de0084afd7b27ae26a1a841ed359f Mon Sep 17 00:00:00 2001 +From d727ab99233992d1ed7a4cc86d3ce3d3de3f0eab Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:38 -0500 -Subject: [PATCH 060/136] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_READ. +Subject: [PATCH 061/156] FROMLIST: ntsync: Introduce NTSYNC_IOC_EVENT_READ. This corresponds to the NT syscall NtQueryEvent(). diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch b/runtime-kernel/linux-kernel/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch index 2e1e6a1e9f6..b7fdca67ec5 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0061-FROMLIST-ntsync-Introduce-alertable-waits.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0062-FROMLIST-ntsync-Introduce-alertable-waits.patch @@ -1,7 +1,7 @@ -From 42b415ec6d14c1712bc0de0fd83e8213a3746f51 Mon Sep 17 00:00:00 2001 +From bf2f5ec6393d4a577d2809df8e4f063780be6bb4 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:39 -0500 -Subject: [PATCH 061/136] FROMLIST: ntsync: Introduce alertable waits. +Subject: [PATCH 062/156] FROMLIST: ntsync: Introduce alertable waits. NT waits can optionally be made "alertable". This is a special channel for thread wakeup that is mildly similar to SIGIO. A thread has an internal single diff --git a/app-admin/kernel-tools/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch b/runtime-kernel/linux-kernel/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch index 062516a2849..6a5752f1001 100644 --- a/app-admin/kernel-tools/autobuild/patches/0062-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0063-BACKPORT-FROMLIST-selftests-ntsync-Add-some-tests-fo.patch @@ -1,7 +1,7 @@ -From 93a1dfd0548549e9f627ab333afc608653c1d16e Mon Sep 17 00:00:00 2001 +From 2f7b62f1dfd754422b2c2c4abb98cfdd54526f80 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:40 -0500 -Subject: [PATCH 062/136] BACKPORT: FROMLIST: selftests: ntsync: Add some tests +Subject: [PATCH 063/156] BACKPORT: FROMLIST: selftests: ntsync: Add some tests for semaphore state. Wine has tests for its synchronization primitives, but these are more accessible diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch deleted file mode 100644 index fc35cb3e056..00000000000 --- a/runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 58d3ab336ae2fce95e029aa04b43b0e95df0bda8 Mon Sep 17 00:00:00 2001 -From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:42 -0500 -Subject: [PATCH 064/136] FROMLIST: selftests: ntsync: Add some tests for - NTSYNC_IOC_WAIT_ANY. - -Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are -considered signaled or not signaled, and how they are affected by a successful -wait. - -Signed-off-by: Elizabeth Figura - -Link: https://lore.kernel.org/all/20240519202454.1192826-17-zfigura@codeweavers.com/ -Signed-off-by: Kexy Biscuit ---- - .../testing/selftests/drivers/ntsync/ntsync.c | 119 ++++++++++++++++++ - 1 file changed, 119 insertions(+) - -diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 7cd0f40594fd..40ad8cbd3138 100644 ---- a/tools/testing/selftests/drivers/ntsync/ntsync.c -+++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -342,4 +342,123 @@ TEST(mutex_state) - close(fd); - } - -+TEST(test_wait_any) -+{ -+ int objs[NTSYNC_MAX_WAIT_COUNT + 1], fd, ret; -+ struct ntsync_mutex_args mutex_args = {0}; -+ struct ntsync_sem_args sem_args = {0}; -+ __u32 owner, index, count, i; -+ struct timespec timeout; -+ -+ clock_gettime(CLOCK_MONOTONIC, &timeout); -+ -+ fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); -+ ASSERT_LE(0, fd); -+ -+ sem_args.count = 2; -+ sem_args.max = 3; -+ sem_args.sem = 0xdeadbeef; -+ ret = ioctl(fd, NTSYNC_IOC_CREATE_SEM, &sem_args); -+ EXPECT_EQ(0, ret); -+ EXPECT_NE(0xdeadbeef, sem_args.sem); -+ -+ mutex_args.owner = 0; -+ mutex_args.count = 0; -+ mutex_args.mutex = 0xdeadbeef; -+ ret = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); -+ EXPECT_EQ(0, ret); -+ EXPECT_NE(0xdeadbeef, mutex_args.mutex); -+ -+ objs[0] = sem_args.sem; -+ objs[1] = mutex_args.mutex; -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ count = 1; -+ ret = post_sem(sem_args.sem, &count); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ ret = wait_any(fd, 2, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ -+ owner = 123; -+ ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); -+ EXPECT_EQ(0, ret); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EOWNERDEAD, errno); -+ EXPECT_EQ(1, index); -+ -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, index); -+ -+ /* test waiting on the same object twice */ -+ count = 2; -+ ret = post_sem(sem_args.sem, &count); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ -+ objs[0] = objs[1] = sem_args.sem; -+ ret = wait_any(fd, 2, objs, 456, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 1, 3); -+ -+ ret = wait_any(fd, 0, NULL, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ -+ for (i = 0; i < NTSYNC_MAX_WAIT_COUNT + 1; ++i) -+ objs[i] = sem_args.sem; -+ -+ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT, objs, 123, &index); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, index); -+ -+ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT + 1, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EINVAL, errno); -+ -+ ret = wait_any(fd, -1, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(EINVAL, errno); -+ -+ close(sem_args.sem); -+ close(mutex_args.mutex); -+ -+ close(fd); -+} -+ - TEST_HARNESS_MAIN --- -2.47.0 - diff --git a/app-admin/kernel-tools/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch b/runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch index 724e34ef0ad..b7f71161bb7 100644 --- a/app-admin/kernel-tools/autobuild/patches/0063-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0064-FROMLIST-selftests-ntsync-Add-some-tests-for-mutex-s.patch @@ -1,7 +1,7 @@ -From fd603d4b814869cbefb5f44de01414ca9eb32c63 Mon Sep 17 00:00:00 2001 +From 39da3d16b65e948d5d32ba0e26189aae84a01263 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:41 -0500 -Subject: [PATCH 063/136] FROMLIST: selftests: ntsync: Add some tests for mutex +Subject: [PATCH 064/156] FROMLIST: selftests: ntsync: Add some tests for mutex state. Test mutex-specific ioctls NTSYNC_IOC_MUTEX_UNLOCK and NTSYNC_IOC_MUTEX_READ, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch index 7b8009b7b51..68bf17c93b7 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0065-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch @@ -1,67 +1,38 @@ -From b9ba7f4120b59c5efdd5f6969ea47c79f904933d Mon Sep 17 00:00:00 2001 +From 8eed174d09401be8e1eca59dd939f972551ecafc Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:43 -0500 -Subject: [PATCH 065/136] FROMLIST: selftests: ntsync: Add some tests for - NTSYNC_IOC_WAIT_ALL. +Date: Sun, 19 May 2024 15:24:42 -0500 +Subject: [PATCH 065/156] FROMLIST: selftests: ntsync: Add some tests for + NTSYNC_IOC_WAIT_ANY. -Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects -are considered simultaneously signaled. +Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are +considered signaled or not signaled, and how they are affected by a successful +wait. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-18-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-17-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 99 ++++++++++++++++++- - 1 file changed, 97 insertions(+), 2 deletions(-) + .../testing/selftests/drivers/ntsync/ntsync.c | 119 ++++++++++++++++++ + 1 file changed, 119 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 40ad8cbd3138..c0f372167557 100644 +index 7cd0f40594fd..40ad8cbd3138 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -73,7 +73,8 @@ static int unlock_mutex(int mutex, __u32 owner, __u32 *count) - return ret; - } - --static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+static int wait_objs(int fd, unsigned long request, __u32 count, -+ const int *objs, __u32 owner, __u32 *index) - { - struct ntsync_wait_args args = {0}; - struct timespec timeout; -@@ -86,11 +87,21 @@ static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *in - args.objs = (uintptr_t)objs; - args.owner = owner; - args.index = 0xdeadbeef; -- ret = ioctl(fd, NTSYNC_IOC_WAIT_ANY, &args); -+ ret = ioctl(fd, request, &args); - *index = args.index; - return ret; - } - -+static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+{ -+ return wait_objs(fd, NTSYNC_IOC_WAIT_ANY, count, objs, owner, index); -+} -+ -+static int wait_all(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) -+{ -+ return wait_objs(fd, NTSYNC_IOC_WAIT_ALL, count, objs, owner, index); -+} -+ - TEST(semaphore_state) - { - struct ntsync_sem_args sem_args; -@@ -461,4 +472,88 @@ TEST(test_wait_any) +@@ -342,4 +342,123 @@ TEST(mutex_state) close(fd); } -+TEST(test_wait_all) ++TEST(test_wait_any) +{ ++ int objs[NTSYNC_MAX_WAIT_COUNT + 1], fd, ret; + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_sem_args sem_args = {0}; -+ __u32 owner, index, count; -+ int objs[2], fd, ret; ++ __u32 owner, index, count, i; ++ struct timespec timeout; ++ ++ clock_gettime(CLOCK_MONOTONIC, &timeout); + + fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); + ASSERT_LE(0, fd); @@ -83,54 +54,86 @@ index 40ad8cbd3138..c0f372167557 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); ++ check_mutex_state(mutex_args.mutex, 0, 0); + -+ ret = wait_all(fd, 2, objs, 456, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); -+ -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); ++ check_mutex_state(mutex_args.mutex, 0, 0); + -+ ret = wait_all(fd, 2, objs, 123, &index); -+ EXPECT_EQ(-1, ret); -+ EXPECT_EQ(ETIMEDOUT, errno); ++ ret = wait_any(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); + check_sem_state(sem_args.sem, 0, 3); -+ check_mutex_state(mutex_args.mutex, 2, 123); ++ check_mutex_state(mutex_args.mutex, 1, 123); + -+ count = 3; ++ count = 1; + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); -+ check_sem_state(sem_args.sem, 2, 3); -+ check_mutex_state(mutex_args.mutex, 3, 123); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_any(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); + + owner = 123; + ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); + EXPECT_EQ(0, ret); + -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 456, &index); + EXPECT_EQ(-1, ret); + EXPECT_EQ(EOWNERDEAD, errno); -+ check_sem_state(sem_args.sem, 1, 3); -+ check_mutex_state(mutex_args.mutex, 1, 123); ++ EXPECT_EQ(1, index); ++ ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(1, index); + + /* test waiting on the same object twice */ ++ count = 2; ++ ret = post_sem(sem_args.sem, &count); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, count); ++ + objs[0] = objs[1] = sem_args.sem; -+ ret = wait_all(fd, 2, objs, 123, &index); ++ ret = wait_any(fd, 2, objs, 456, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 1, 3); ++ ++ ret = wait_any(fd, 0, NULL, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ ++ for (i = 0; i < NTSYNC_MAX_WAIT_COUNT + 1; ++i) ++ objs[i] = sem_args.sem; ++ ++ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ ++ ret = wait_any(fd, NTSYNC_MAX_WAIT_COUNT + 1, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EINVAL, errno); ++ ++ ret = wait_any(fd, -1, objs, 123, &index); + EXPECT_EQ(-1, ret); + EXPECT_EQ(EINVAL, errno); + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch new file mode 100644 index 00000000000..6af8cf9953c --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-NTSYNC_.patch @@ -0,0 +1,146 @@ +From 533f8b6b5ab95d0491d5b461b6c1a578eb1072b4 Mon Sep 17 00:00:00 2001 +From: Elizabeth Figura +Date: Sun, 19 May 2024 15:24:43 -0500 +Subject: [PATCH 066/156] FROMLIST: selftests: ntsync: Add some tests for + NTSYNC_IOC_WAIT_ALL. + +Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects +are considered simultaneously signaled. + +Signed-off-by: Elizabeth Figura + +Link: https://lore.kernel.org/all/20240519202454.1192826-18-zfigura@codeweavers.com/ +Signed-off-by: Kexy Biscuit +--- + .../testing/selftests/drivers/ntsync/ntsync.c | 99 ++++++++++++++++++- + 1 file changed, 97 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c +index 40ad8cbd3138..c0f372167557 100644 +--- a/tools/testing/selftests/drivers/ntsync/ntsync.c ++++ b/tools/testing/selftests/drivers/ntsync/ntsync.c +@@ -73,7 +73,8 @@ static int unlock_mutex(int mutex, __u32 owner, __u32 *count) + return ret; + } + +-static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++static int wait_objs(int fd, unsigned long request, __u32 count, ++ const int *objs, __u32 owner, __u32 *index) + { + struct ntsync_wait_args args = {0}; + struct timespec timeout; +@@ -86,11 +87,21 @@ static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *in + args.objs = (uintptr_t)objs; + args.owner = owner; + args.index = 0xdeadbeef; +- ret = ioctl(fd, NTSYNC_IOC_WAIT_ANY, &args); ++ ret = ioctl(fd, request, &args); + *index = args.index; + return ret; + } + ++static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++{ ++ return wait_objs(fd, NTSYNC_IOC_WAIT_ANY, count, objs, owner, index); ++} ++ ++static int wait_all(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index) ++{ ++ return wait_objs(fd, NTSYNC_IOC_WAIT_ALL, count, objs, owner, index); ++} ++ + TEST(semaphore_state) + { + struct ntsync_sem_args sem_args; +@@ -461,4 +472,88 @@ TEST(test_wait_any) + close(fd); + } + ++TEST(test_wait_all) ++{ ++ struct ntsync_mutex_args mutex_args = {0}; ++ struct ntsync_sem_args sem_args = {0}; ++ __u32 owner, index, count; ++ int objs[2], fd, ret; ++ ++ fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); ++ ASSERT_LE(0, fd); ++ ++ sem_args.count = 2; ++ sem_args.max = 3; ++ sem_args.sem = 0xdeadbeef; ++ ret = ioctl(fd, NTSYNC_IOC_CREATE_SEM, &sem_args); ++ EXPECT_EQ(0, ret); ++ EXPECT_NE(0xdeadbeef, sem_args.sem); ++ ++ mutex_args.owner = 0; ++ mutex_args.count = 0; ++ mutex_args.mutex = 0xdeadbeef; ++ ret = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); ++ EXPECT_EQ(0, ret); ++ EXPECT_NE(0xdeadbeef, mutex_args.mutex); ++ ++ objs[0] = sem_args.sem; ++ objs[1] = mutex_args.mutex; ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_all(fd, 2, objs, 456, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(ETIMEDOUT, errno); ++ check_sem_state(sem_args.sem, 0, 3); ++ check_mutex_state(mutex_args.mutex, 2, 123); ++ ++ count = 3; ++ ret = post_sem(sem_args.sem, &count); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, count); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, index); ++ check_sem_state(sem_args.sem, 2, 3); ++ check_mutex_state(mutex_args.mutex, 3, 123); ++ ++ owner = 123; ++ ret = ioctl(mutex_args.mutex, NTSYNC_IOC_MUTEX_KILL, &owner); ++ EXPECT_EQ(0, ret); ++ ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EOWNERDEAD, errno); ++ check_sem_state(sem_args.sem, 1, 3); ++ check_mutex_state(mutex_args.mutex, 1, 123); ++ ++ /* test waiting on the same object twice */ ++ objs[0] = objs[1] = sem_args.sem; ++ ret = wait_all(fd, 2, objs, 123, &index); ++ EXPECT_EQ(-1, ret); ++ EXPECT_EQ(EINVAL, errno); ++ ++ close(sem_args.sem); ++ close(mutex_args.mutex); ++ ++ close(fd); ++} ++ + TEST_HARNESS_MAIN +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 427029675cd..f0c422f4508 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0067-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,30 +1,69 @@ -From ca5ec2db3c4818ea100324a65a82fab26aa019ae Mon Sep 17 00:00:00 2001 +From ca7f01ea66262b10a3b0aff95f8248dec6cd9447 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:45 -0500 -Subject: [PATCH 067/136] FROMLIST: selftests: ntsync: Add some tests for - wakeup signaling with WINESYNC_IOC_WAIT_ALL. +Date: Sun, 19 May 2024 15:24:44 -0500 +Subject: [PATCH 067/156] FROMLIST: selftests: ntsync: Add some tests for + wakeup signaling with WINESYNC_IOC_WAIT_ANY. -Test contended "wait-for-all" waits, to make sure that scheduling and wakeup -logic works correctly, and that the wait only exits once objects are all -simultaneously signaled. +Test contended "wait-for-any" waits, to make sure that scheduling and wakeup +logic works correctly. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-20-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-19-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 98 +++++++++++++++++++ - 1 file changed, 98 insertions(+) + .../testing/selftests/drivers/ntsync/ntsync.c | 150 ++++++++++++++++++ + 1 file changed, 150 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index 993f5db23768..b77fb0b2c4b1 100644 +index c0f372167557..993f5db23768 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -706,4 +706,102 @@ TEST(wake_any) +@@ -556,4 +556,154 @@ TEST(test_wait_all) close(fd); } -+TEST(wake_all) ++struct wake_args { ++ int fd; ++ int obj; ++}; ++ ++struct wait_args { ++ int fd; ++ unsigned long request; ++ struct ntsync_wait_args *args; ++ int ret; ++ int err; ++}; ++ ++static void *wait_thread(void *arg) ++{ ++ struct wait_args *args = arg; ++ ++ args->ret = ioctl(args->fd, args->request, args->args); ++ args->err = errno; ++ return NULL; ++} ++ ++static __u64 get_abs_timeout(unsigned int ms) ++{ ++ struct timespec timeout; ++ clock_gettime(CLOCK_MONOTONIC, &timeout); ++ return (timeout.tv_sec * 1000000000) + timeout.tv_nsec + (ms * 1000000); ++} ++ ++static int wait_for_thread(pthread_t thread, unsigned int ms) ++{ ++ struct timespec timeout; ++ ++ clock_gettime(CLOCK_REALTIME, &timeout); ++ timeout.tv_nsec += ms * 1000000; ++ timeout.tv_sec += (timeout.tv_nsec / 1000000000); ++ timeout.tv_nsec %= 1000000000; ++ return pthread_timedjoin_np(thread, NULL, &timeout); ++} ++ ++TEST(wake_any) +{ + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_wait_args wait_args = {0}; @@ -54,13 +93,16 @@ index 993f5db23768..b77fb0b2c4b1 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + ++ /* test waking the semaphore */ ++ + wait_args.timeout = get_abs_timeout(1000); + wait_args.objs = (uintptr_t)objs; + wait_args.count = 2; + wait_args.owner = 456; ++ wait_args.index = 0xdeadbeef; + thread_args.fd = fd; + thread_args.args = &wait_args; -+ thread_args.request = NTSYNC_IOC_WAIT_ALL; ++ thread_args.request = NTSYNC_IOC_WAIT_ANY; + ret = pthread_create(&thread, NULL, wait_thread, &thread_args); + EXPECT_EQ(0, ret); + @@ -71,35 +113,44 @@ index 993f5db23768..b77fb0b2c4b1 100644 + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); ++ check_sem_state(sem_args.sem, 0, 3); + -+ ret = pthread_tryjoin_np(thread, NULL); -+ EXPECT_EQ(EBUSY, ret); ++ ret = wait_for_thread(thread, 100); ++ EXPECT_EQ(0, ret); ++ EXPECT_EQ(0, thread_args.ret); ++ EXPECT_EQ(0, wait_args.index); + -+ check_sem_state(sem_args.sem, 1, 3); ++ /* test waking the mutex */ + -+ ret = wait_any(fd, 1, &sem_args.sem, 123, &index); ++ /* first grab it again for owner 123 */ ++ ret = wait_any(fd, 1, &mutex_args.mutex, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + ++ wait_args.timeout = get_abs_timeout(1000); ++ wait_args.owner = 456; ++ ret = pthread_create(&thread, NULL, wait_thread, &thread_args); ++ EXPECT_EQ(0, ret); ++ ++ ret = wait_for_thread(thread, 100); ++ EXPECT_EQ(ETIMEDOUT, ret); ++ + ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, count); ++ EXPECT_EQ(2, count); + + ret = pthread_tryjoin_np(thread, NULL); + EXPECT_EQ(EBUSY, ret); + -+ check_mutex_state(mutex_args.mutex, 0, 0); -+ -+ count = 2; -+ ret = post_sem(sem_args.sem, &count); ++ ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, count); -+ check_sem_state(sem_args.sem, 1, 3); ++ EXPECT_EQ(1, mutex_args.count); + check_mutex_state(mutex_args.mutex, 1, 456); + + ret = wait_for_thread(thread, 100); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, thread_args.ret); ++ EXPECT_EQ(1, wait_args.index); + + /* delete an object while it's being waited on */ + diff --git a/app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 53% rename from app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index e5cf3d5cbae..bc0c00b32b4 100644 --- a/app-admin/kernel-tools/autobuild/patches/0066-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,69 +1,30 @@ -From 8678427a252e4aad785a6e7a123522c932d745dd Mon Sep 17 00:00:00 2001 +From 5bf1e0eb257794ba6b039b2627aa070a76704caa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura -Date: Sun, 19 May 2024 15:24:44 -0500 -Subject: [PATCH 066/136] FROMLIST: selftests: ntsync: Add some tests for - wakeup signaling with WINESYNC_IOC_WAIT_ANY. +Date: Sun, 19 May 2024 15:24:45 -0500 +Subject: [PATCH 068/156] FROMLIST: selftests: ntsync: Add some tests for + wakeup signaling with WINESYNC_IOC_WAIT_ALL. -Test contended "wait-for-any" waits, to make sure that scheduling and wakeup -logic works correctly. +Test contended "wait-for-all" waits, to make sure that scheduling and wakeup +logic works correctly, and that the wait only exits once objects are all +simultaneously signaled. Signed-off-by: Elizabeth Figura -Link: https://lore.kernel.org/all/20240519202454.1192826-19-zfigura@codeweavers.com/ +Link: https://lore.kernel.org/all/20240519202454.1192826-20-zfigura@codeweavers.com/ Signed-off-by: Kexy Biscuit --- - .../testing/selftests/drivers/ntsync/ntsync.c | 150 ++++++++++++++++++ - 1 file changed, 150 insertions(+) + .../testing/selftests/drivers/ntsync/ntsync.c | 98 +++++++++++++++++++ + 1 file changed, 98 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c -index c0f372167557..993f5db23768 100644 +index 993f5db23768..b77fb0b2c4b1 100644 --- a/tools/testing/selftests/drivers/ntsync/ntsync.c +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c -@@ -556,4 +556,154 @@ TEST(test_wait_all) +@@ -706,4 +706,102 @@ TEST(wake_any) close(fd); } -+struct wake_args { -+ int fd; -+ int obj; -+}; -+ -+struct wait_args { -+ int fd; -+ unsigned long request; -+ struct ntsync_wait_args *args; -+ int ret; -+ int err; -+}; -+ -+static void *wait_thread(void *arg) -+{ -+ struct wait_args *args = arg; -+ -+ args->ret = ioctl(args->fd, args->request, args->args); -+ args->err = errno; -+ return NULL; -+} -+ -+static __u64 get_abs_timeout(unsigned int ms) -+{ -+ struct timespec timeout; -+ clock_gettime(CLOCK_MONOTONIC, &timeout); -+ return (timeout.tv_sec * 1000000000) + timeout.tv_nsec + (ms * 1000000); -+} -+ -+static int wait_for_thread(pthread_t thread, unsigned int ms) -+{ -+ struct timespec timeout; -+ -+ clock_gettime(CLOCK_REALTIME, &timeout); -+ timeout.tv_nsec += ms * 1000000; -+ timeout.tv_sec += (timeout.tv_nsec / 1000000000); -+ timeout.tv_nsec %= 1000000000; -+ return pthread_timedjoin_np(thread, NULL, &timeout); -+} -+ -+TEST(wake_any) ++TEST(wake_all) +{ + struct ntsync_mutex_args mutex_args = {0}; + struct ntsync_wait_args wait_args = {0}; @@ -93,16 +54,13 @@ index c0f372167557..993f5db23768 100644 + objs[0] = sem_args.sem; + objs[1] = mutex_args.mutex; + -+ /* test waking the semaphore */ -+ + wait_args.timeout = get_abs_timeout(1000); + wait_args.objs = (uintptr_t)objs; + wait_args.count = 2; + wait_args.owner = 456; -+ wait_args.index = 0xdeadbeef; + thread_args.fd = fd; + thread_args.args = &wait_args; -+ thread_args.request = NTSYNC_IOC_WAIT_ANY; ++ thread_args.request = NTSYNC_IOC_WAIT_ALL; + ret = pthread_create(&thread, NULL, wait_thread, &thread_args); + EXPECT_EQ(0, ret); + @@ -113,44 +71,35 @@ index c0f372167557..993f5db23768 100644 + ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, count); -+ check_sem_state(sem_args.sem, 0, 3); + -+ ret = wait_for_thread(thread, 100); -+ EXPECT_EQ(0, ret); -+ EXPECT_EQ(0, thread_args.ret); -+ EXPECT_EQ(0, wait_args.index); ++ ret = pthread_tryjoin_np(thread, NULL); ++ EXPECT_EQ(EBUSY, ret); + -+ /* test waking the mutex */ ++ check_sem_state(sem_args.sem, 1, 3); + -+ /* first grab it again for owner 123 */ -+ ret = wait_any(fd, 1, &mutex_args.mutex, 123, &index); ++ ret = wait_any(fd, 1, &sem_args.sem, 123, &index); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, index); + -+ wait_args.timeout = get_abs_timeout(1000); -+ wait_args.owner = 456; -+ ret = pthread_create(&thread, NULL, wait_thread, &thread_args); -+ EXPECT_EQ(0, ret); -+ -+ ret = wait_for_thread(thread, 100); -+ EXPECT_EQ(ETIMEDOUT, ret); -+ + ret = unlock_mutex(mutex_args.mutex, 123, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(2, count); ++ EXPECT_EQ(1, count); + + ret = pthread_tryjoin_np(thread, NULL); + EXPECT_EQ(EBUSY, ret); + -+ ret = unlock_mutex(mutex_args.mutex, 123, &count); ++ check_mutex_state(mutex_args.mutex, 0, 0); ++ ++ count = 2; ++ ret = post_sem(sem_args.sem, &count); + EXPECT_EQ(0, ret); -+ EXPECT_EQ(1, mutex_args.count); ++ EXPECT_EQ(0, count); ++ check_sem_state(sem_args.sem, 1, 3); + check_mutex_state(mutex_args.mutex, 1, 456); + + ret = wait_for_thread(thread, 100); + EXPECT_EQ(0, ret); + EXPECT_EQ(0, thread_args.ret); -+ EXPECT_EQ(1, wait_args.index); + + /* delete an object while it's being waited on */ + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch index 6c3a100e2c5..34a2c90319e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0068-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-manual-.patch @@ -1,7 +1,7 @@ -From 678685136637b284b0ef54889ba1cda55f59cda2 Mon Sep 17 00:00:00 2001 +From 3c17851170943725ce9c4d410fb31e2e4d0ca636 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:46 -0500 -Subject: [PATCH 068/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 069/156] FROMLIST: selftests: ntsync: Add some tests for manual-reset event state. Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch b/runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch index 3cfec24e3fc..1c3c498d3f0 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0069-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-auto-re.patch @@ -1,7 +1,7 @@ -From 8d9a3655ea5c4f942bf1fcd63985d5679fd971d1 Mon Sep 17 00:00:00 2001 +From c682b4ad845e19a209f5c8cffc4caa00fd49457c Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:47 -0500 -Subject: [PATCH 069/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 070/156] FROMLIST: selftests: ntsync: Add some tests for auto-reset event state. Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, diff --git a/app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 9ad7cf4e2c0..50ac77daf33 100644 --- a/app-admin/kernel-tools/autobuild/patches/0070-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,7 +1,7 @@ -From b18c039e095601a2700e811c79012efbbdcb2320 Mon Sep 17 00:00:00 2001 +From f99eb791d1181aa34c651d98d4186626f5a4ccfa Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:48 -0500 -Subject: [PATCH 070/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 071/156] FROMLIST: selftests: ntsync: Add some tests for wakeup signaling with events. Expand the contended wait tests, which previously only covered events and diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch b/runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch index 3ad9ac56531..60800553275 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0071-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-tests-for-alertable-wa.patch @@ -1,7 +1,7 @@ -From 4636500d6b2691177c8689c65c39dc0eef922826 Mon Sep 17 00:00:00 2001 +From e3b8e4347c0a107c229f048ba73c1670623daf35 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:49 -0500 -Subject: [PATCH 071/136] FROMLIST: selftests: ntsync: Add tests for alertable +Subject: [PATCH 072/156] FROMLIST: selftests: ntsync: Add tests for alertable waits. Test the "alert" functionality of NTSYNC_IOC_WAIT_ALL and NTSYNC_IOC_WAIT_ANY, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch index 7301da40224..26ab2a4398f 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0072-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-some-tests-for-wakeup-.patch @@ -1,7 +1,7 @@ -From 745b9405da721a4ea1378cb018a808c89d09a43a Mon Sep 17 00:00:00 2001 +From 2931714a2e38c4b46811e2148535bed579d56a93 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:50 -0500 -Subject: [PATCH 072/136] FROMLIST: selftests: ntsync: Add some tests for +Subject: [PATCH 073/156] FROMLIST: selftests: ntsync: Add some tests for wakeup signaling via alerts. Expand the alert tests to cover alerting a thread mid-wait, to test that the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch b/runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch index 90c0a76517e..80528db949b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0073-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0074-FROMLIST-selftests-ntsync-Add-a-stress-test-for-cont.patch @@ -1,7 +1,7 @@ -From e616e609b4ca58d3d74046d2d54d218c48e86856 Mon Sep 17 00:00:00 2001 +From a44a97ab76fe2b6a9aae6e42fd9661ceb90c0c74 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:51 -0500 -Subject: [PATCH 073/136] FROMLIST: selftests: ntsync: Add a stress test for +Subject: [PATCH 074/156] FROMLIST: selftests: ntsync: Add a stress test for contended waits. Test a more realistic usage pattern, and one with heavy contention, in order to diff --git a/app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch b/runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch similarity index 80% rename from app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch index 598d6922da0..ed69e3ac4df 100644 --- a/app-admin/kernel-tools/autobuild/patches/0074-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-maintainers-Add-an-entry-for-ntsync.patch @@ -1,7 +1,7 @@ -From 957fbfc93da9be5a5c0987a6939ae078f55f0d15 Mon Sep 17 00:00:00 2001 +From 33faff4cdff2dd010ceb073e6b79b8f52f803fd6 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:52 -0500 -Subject: [PATCH 074/136] FROMLIST: maintainers: Add an entry for ntsync. +Subject: [PATCH 075/156] FROMLIST: maintainers: Add an entry for ntsync. Add myself as maintainer, supported by CodeWeavers. @@ -14,10 +14,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS -index 8e98849c842f..62dde1daf1a9 100644 +index b584d408c075..8ff20ebdb87d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -16327,6 +16327,15 @@ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git +@@ -16333,6 +16333,15 @@ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git F: Documentation/filesystems/ntfs3.rst F: fs/ntfs3/ diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch b/runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch index 80bec2bb223..7a06cee6fbe 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0075-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-docs-ntsync-Add-documentation-for-the-ntsyn.patch @@ -1,7 +1,7 @@ -From 6bdb561a9f33b0a077147434729c61c0a1ee7e18 Mon Sep 17 00:00:00 2001 +From c85800276fd87f85f5c6ef7f1b92ce0eead1fbc6 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:53 -0500 -Subject: [PATCH 075/136] FROMLIST: docs: ntsync: Add documentation for the +Subject: [PATCH 076/156] FROMLIST: docs: ntsync: Add documentation for the ntsync uAPI. Add an overall explanation of the driver architecture, and complete and precise diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch b/runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch similarity index 89% rename from runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch index 6d7e24e783d..f821de8b4cf 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0076-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0077-FROMLIST-ntsync-No-longer-depend-on-BROKEN.patch @@ -1,7 +1,7 @@ -From cb2f96d2ef7e32b64d1910ca59ffc1dbbae9f8ab Mon Sep 17 00:00:00 2001 +From 8d5ec73d594304c3b5695fb4f5ae60241f32cb56 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 19 May 2024 15:24:54 -0500 -Subject: [PATCH 076/136] FROMLIST: ntsync: No longer depend on BROKEN. +Subject: [PATCH 077/156] FROMLIST: ntsync: No longer depend on BROKEN. f5b335dc025cfee90957efa90dc72fada0d5abb4 ("misc: ntsync: mark driver as "broken" to prevent from building") was committed to avoid the driver being used while diff --git a/app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch b/runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch index 2c44b639c5a..ebdf90590b9 100644 --- a/app-admin/kernel-tools/autobuild/patches/0077-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-drm-Makefile-Move-tiny-drivers-before-nativ.patch @@ -1,7 +1,7 @@ -From 3e80316c4726bdb7ee2740fb811783c5d624b37b Mon Sep 17 00:00:00 2001 +From 379257a733283fd9b8e73e30084bba3b6a84ba42 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Wed, 8 Nov 2023 10:46:13 +0800 -Subject: [PATCH 077/136] FROMLIST: drm/Makefile: Move tiny drivers before +Subject: [PATCH 078/156] FROMLIST: drm/Makefile: Move tiny drivers before native drivers After commit 60aebc9559492cea ("drivers/firmware: Move sysfb_init() from diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch index 80707949e30..6d9c924c908 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0078-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0079-FROMLIST-LoongArch-SMP-Implement-parallel-CPU-bring-.patch @@ -1,7 +1,7 @@ -From 9b8d150cfef3c533fd0f52ffab5cf5f55355a377 Mon Sep 17 00:00:00 2001 +From 7806069f31443732f75a30cad8f0c251aac5e716 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 16 Jul 2024 22:15:00 +0800 -Subject: [PATCH 078/136] FROMLIST: LoongArch: SMP: Implement parallel CPU +Subject: [PATCH 079/156] FROMLIST: LoongArch: SMP: Implement parallel CPU bring up Implement parallel CPU bring up for LoongArch to reduce diff --git a/app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch b/runtime-kernel/linux-kernel/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch index f53080ed93f..53a75d68b59 100644 --- a/app-admin/kernel-tools/autobuild/patches/0079-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0080-FROMLIST-dt-bindings-serial-Add-Loongson-UART-contro.patch @@ -1,7 +1,7 @@ -From 0145795167a99098ddc604817fb5a96015abf62c Mon Sep 17 00:00:00 2001 +From a5956cf96a19af344ccfb3ae220a55d11028899e Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:03 +0800 -Subject: [PATCH 079/136] FROMLIST: dt-bindings: serial: Add Loongson UART +Subject: [PATCH 080/156] FROMLIST: dt-bindings: serial: Add Loongson UART controller Add Loongson UART controller binding with DT schema format using diff --git a/app-admin/kernel-tools/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch index 08dd2a5cce2..d60b383a1d2 100644 --- a/app-admin/kernel-tools/autobuild/patches/0080-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0081-BACKPORT-FROMLIST-tty-serial-8250-Add-loongson-uart-.patch @@ -1,7 +1,7 @@ -From 34171ac5370426d993f4da8f4fbf3a2100458273 Mon Sep 17 00:00:00 2001 +From aa2a59e14d6e5be5a16ca158331864780f6ba1e3 Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:04 +0800 -Subject: [PATCH 080/136] BACKPORT: FROMLIST: tty: serial: 8250: Add loongson +Subject: [PATCH 081/156] BACKPORT: FROMLIST: tty: serial: 8250: Add loongson uart driver support Due to certain hardware design challenges, we have opted to @@ -23,7 +23,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/tty/serial/8250/8250_loongson.c diff --git a/MAINTAINERS b/MAINTAINERS -index 62dde1daf1a9..3653bf325a90 100644 +index 8ff20ebdb87d..1f397800b85a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13213,6 +13213,13 @@ S: Maintained diff --git a/app-admin/kernel-tools/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch b/runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch similarity index 94% rename from app-admin/kernel-tools/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch index 8623e23f8a5..0eda4349c87 100644 --- a/app-admin/kernel-tools/autobuild/patches/0081-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-LoongArch-Update-dts-to-support-Loongson-UA.patch @@ -1,7 +1,7 @@ -From c28fa111a3835a1cf576bafbc0a2d4c3125f7437 Mon Sep 17 00:00:00 2001 +From 43e20e72127b2a803ff274387e8b89b8b4baac69 Mon Sep 17 00:00:00 2001 From: Haowei Zheng Date: Mon, 26 Aug 2024 10:47:05 +0800 -Subject: [PATCH 081/136] FROMLIST: LoongArch: Update dts to support Loongson +Subject: [PATCH 082/156] FROMLIST: LoongArch: Update dts to support Loongson UART driver. Change to use the Loongson UART driver for Loongson-2K2000, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch b/runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch deleted file mode 100644 index 9e14bc49b48..00000000000 --- a/runtime-kernel/linux-kernel/autobuild/patches/0082-FROMLIST-wifi-rtw89-pci-early-chips-only-enable-36-b.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 650c5044d7b5dfd29cb63f746fa1217368f74b01 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Tue, 24 Sep 2024 10:16:33 +0800 -Subject: [PATCH 082/136] FROMLIST: wifi: rtw89: pci: early chips only enable - 36-bit DMA on specific PCI hosts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The early chips including RTL8852A, RTL8851B, RTL8852B and RTL8852BT have -interoperability problems of 36-bit DMA with some PCI hosts. Rollback -to 32-bit DMA by default, and only enable 36-bit DMA for tested platforms. - -Since all Intel platforms we have can work correctly, add the vendor ID to -white list. Otherwise, list vendor/device ID of bridge we have tested. - -Fixes: 1fd4b3fe52ef ("wifi: rtw89: pci: support 36-bit PCI DMA address") -Reported-by: Marcel Weißenbach -Closes: https://lore.kernel.org/linux-wireless/20240918073237.Horde.VLueh0_KaiDw-9asEEcdM84@ignaz.org/T/#m07c5694df1acb173a42e1a0bab7ac22bd231a2b8 -Signed-off-by: Ping-Ke Shih - -Link: https://lore.kernel.org/all/20240924021633.19861-1-pkshih@realtek.com/ -Signed-off-by: Kexy Biscuit ---- - drivers/net/wireless/realtek/rtw89/pci.c | 48 ++++++++++++++++++++---- - 1 file changed, 41 insertions(+), 7 deletions(-) - -diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c -index 02afeb3acce4..5aef7fa37878 100644 ---- a/drivers/net/wireless/realtek/rtw89/pci.c -+++ b/drivers/net/wireless/realtek/rtw89/pci.c -@@ -3026,24 +3026,54 @@ static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev, - pci_disable_device(pdev); - } - --static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) -+static bool rtw89_pci_chip_is_manual_dac(struct rtw89_dev *rtwdev) - { -- struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; - const struct rtw89_chip_info *chip = rtwdev->chip; - -- if (!rtwpci->enable_dac) -- return; -- - switch (chip->chip_id) { - case RTL8852A: - case RTL8852B: - case RTL8851B: - case RTL8852BT: -- break; -+ return true; - default: -- return; -+ return false; -+ } -+} -+ -+static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev) -+{ -+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; -+ struct pci_dev *bridge = pci_upstream_bridge(rtwpci->pdev); -+ -+ if (!rtw89_pci_chip_is_manual_dac(rtwdev)) -+ return true; -+ -+ if (!bridge) -+ return false; -+ -+ switch (bridge->vendor) { -+ case PCI_VENDOR_ID_INTEL: -+ return true; -+ case PCI_VENDOR_ID_ASMEDIA: -+ if (bridge->device == 0x2806) -+ return true; -+ break; - } - -+ return false; -+} -+ -+static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) -+{ -+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; -+ -+ if (!rtwpci->enable_dac) -+ return; -+ -+ if (!rtw89_pci_chip_is_manual_dac(rtwdev)) -+ return; -+ - rtw89_pci_config_byte_set(rtwdev, RTW89_PCIE_L1_CTRL, RTW89_PCIE_BIT_EN_64BITS); - } - -@@ -3061,6 +3091,9 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, - goto err; - } - -+ if (!rtw89_pci_is_dac_compatible_bridge(rtwdev)) -+ goto no_dac; -+ - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); - if (!ret) { - rtwpci->enable_dac = true; -@@ -3073,6 +3106,7 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, - goto err_release_regions; - } - } -+no_dac: - - resource_len = pci_resource_len(pdev, bar_id); - rtwpci->mmap = pci_iomap(pdev, bar_id, resource_len); --- -2.47.0 - diff --git a/app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch b/runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch similarity index 71% rename from app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch index a79c5b3ab7b..a2306df6245 100644 --- a/app-admin/kernel-tools/autobuild/patches/0084-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-EDAC-Add-EDAC-driver-for-loongson-memory-co.patch @@ -1,50 +1,59 @@ -From cb1bd7789867a75b02d1526df102970a2c1d1165 Mon Sep 17 00:00:00 2001 +From 046dfa2e1b4b85f63b6253f1c22d1504acc92259 Mon Sep 17 00:00:00 2001 From: Zhao Qunqin -Date: Mon, 30 Sep 2024 11:29:43 +0800 -Subject: [PATCH 084/136] FROMLIST: EDAC: Add EDAC driver for loongson memory +Date: Wed, 13 Nov 2024 16:55:47 +0800 +Subject: [PATCH 083/156] FROMLIST: EDAC: Add EDAC driver for loongson memory controller -Reports single bit errors (CE) only. +Add ECC support for Loongson SoC DDR controller. This +driver reports single bit errors (CE) only. + +Only ACPI firmware is supported. Signed-off-by: Zhao Qunqin +Reviewed-by: Huacai Chen -Link: https://lore.kernel.org/all/20240930032943.5182-3-zhaoqunqin@loongson.cn/ +Link: https://lore.kernel.org/all/20241113085547.15680-1-zhaoqunqin@loongson.cn/ Signed-off-by: Kexy Biscuit --- - MAINTAINERS | 1 + + MAINTAINERS | 6 ++ arch/loongarch/Kconfig | 1 + drivers/edac/Kconfig | 8 ++ drivers/edac/Makefile | 1 + - drivers/edac/loongson_edac.c | 168 +++++++++++++++++++++++++++++++++++ - 5 files changed, 179 insertions(+) + drivers/edac/loongson_edac.c | 156 +++++++++++++++++++++++++++++++++++ + 5 files changed, 172 insertions(+) create mode 100644 drivers/edac/loongson_edac.c diff --git a/MAINTAINERS b/MAINTAINERS -index 0d6e139e4d9c..99b339474f37 100644 +index 1f397800b85a..c253fb9926e4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -13273,6 +13273,7 @@ M: Zhao Qunqin - L: linux-edac@vger.kernel.org - S: Maintained - F: Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -+F: drivers/edac/loongson_edac.c +@@ -13268,6 +13268,12 @@ S: Maintained + F: Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml + F: drivers/thermal/loongson2_thermal.c ++LOONGSON EDAC DRIVER ++M: Zhao Qunqin ++L: linux-edac@vger.kernel.org ++S: Maintained ++F: drivers/edac/loongson_edac.c ++ LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) M: Sathya Prakash + M: Sreekanth Reddy diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig -index c6d03d607b6e..bc76c641bd5b 100644 +index c6d03d607b6e..199b675e2c11 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig -@@ -186,6 +186,7 @@ config LOONGARCH - select PCI_MSI_ARCH_FALLBACKS - select PCI_QUIRKS - select PERF_USE_VMALLOC +@@ -79,6 +79,7 @@ config LOONGARCH + select BUILDTIME_TABLE_SORT + select COMMON_CLK + select CPU_PM + select EDAC_SUPPORT - select RTC_LIB - select SPARSE_IRQ - select SYSCTL_ARCH_UNALIGN_ALLOW + select EFI + select GENERIC_CLOCKEVENTS + select GENERIC_CMOS_UPDATE diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig -index 16c8de5050e5..dd627f9d60ef 100644 +index 16c8de5050e5..02369c3766e2 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -573,5 +573,13 @@ config EDAC_VERSAL @@ -53,11 +62,11 @@ index 16c8de5050e5..dd627f9d60ef 100644 +config EDAC_LOONGSON + tristate "Loongson Memory Controller" -+ depends on LOONGARCH || COMPILE_TEST ++ depends on (LOONGARCH && ACPI) || COMPILE_TEST + help + Support for error detection and correction on the Loongson + family memory controller. This driver reports single bit -+ errors (CE) only. Loongson-3A5000/3C5000/3D5000/3C5000L/3A6000/3C6000 ++ errors (CE) only. Loongson-3A5000/3C5000/3D5000/3A6000/3C6000 + are compatible. endif # EDAC @@ -72,37 +81,27 @@ index 4edfb83ffbee..d6f2cfe7e544 100644 +obj-$(CONFIG_EDAC_LOONGSON) += loongson_edac.o diff --git a/drivers/edac/loongson_edac.c b/drivers/edac/loongson_edac.c new file mode 100644 -index 000000000000..2721dfba5f23 +index 000000000000..29607972f3a1 --- /dev/null +++ b/drivers/edac/loongson_edac.c -@@ -0,0 +1,168 @@ +@@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Loongson Technology Corporation Limited. + */ + ++#include +#include -+#include +#include ++#include ++#include +#include -+ +#include "edac_module.h" + -+enum ecc_index { -+ ECC_SET = 0, -+ ECC_RESERVED, -+ ECC_COUNT, -+ ECC_CS_COUNT, -+ ECC_CODE, -+ ECC_ADDR, -+ ECC_DATA0, -+ ECC_DATA1, -+ ECC_DATA2, -+ ECC_DATA3, -+}; ++#define ECC_CS_COUNT_REG 0x18 + +struct loongson_edac_pvt { -+ u64 *ecc_base; ++ void __iomem *ecc_base; + int last_ce_count; +}; + @@ -115,7 +114,7 @@ index 000000000000..2721dfba5f23 + if (!pvt->ecc_base) + return pvt->last_ce_count; + -+ ecc = pvt->ecc_base[ECC_CS_COUNT]; ++ ecc = readq(pvt->ecc_base + ECC_CS_COUNT_REG); + /* cs0 -- cs3 */ + cs = ecc & 0xff; + cs += (ecc >> 8) & 0xff; @@ -141,7 +140,7 @@ index 000000000000..2721dfba5f23 + edac_mc_printk(mci, KERN_INFO, "add: %d", add); +} + -+static int get_dimm_config(struct mem_ctl_info *mci) ++static void dimm_config_init(struct mem_ctl_info *mci) +{ + struct dimm_info *dimm; + u32 size, npages; @@ -155,11 +154,9 @@ index 000000000000..2721dfba5f23 + snprintf(dimm->label, sizeof(dimm->label), + "MC#%uChannel#%u_DIMM#%u", mci->mc_idx, 0, 0); + dimm->grain = 8; -+ -+ return 0; +} + -+static void pvt_init(struct mem_ctl_info *mci, u64 *vbase) ++static void pvt_init(struct mem_ctl_info *mci, void __iomem *vbase) +{ + struct loongson_edac_pvt *pvt = mci->pvt_info; + @@ -170,9 +167,8 @@ index 000000000000..2721dfba5f23 +static int edac_probe(struct platform_device *pdev) +{ + struct edac_mc_layer layers[2]; -+ struct loongson_edac_pvt *pvt; + struct mem_ctl_info *mci; -+ u64 *vbase; ++ void __iomem *vbase; + int ret; + + vbase = devm_platform_ioremap_resource(pdev, 0); @@ -186,7 +182,8 @@ index 000000000000..2721dfba5f23 + layers[1].type = EDAC_MC_LAYER_SLOT; + layers[1].size = 1; + layers[1].is_virt_csrow = true; -+ mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt)); ++ mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, ++ sizeof(struct loongson_edac_pvt)); + if (mci == NULL) + return -ENOMEM; + @@ -204,7 +201,7 @@ index 000000000000..2721dfba5f23 + mci->edac_check = edac_check; + + pvt_init(mci, vbase); -+ get_dimm_config(mci); ++ dimm_config_init(mci); + + ret = edac_mc_add_mc(mci); + if (ret) { @@ -225,18 +222,18 @@ index 000000000000..2721dfba5f23 + edac_mc_free(mci); +} + -+static const struct of_device_id loongson_edac_of_match[] = { -+ { .compatible = "loongson,ls3a5000-mc-edac", }, ++static const struct acpi_device_id loongson_edac_acpi_match[] = { ++ {"LOON000G", 0}, + {} +}; -+MODULE_DEVICE_TABLE(of, loongson_edac_of_match); ++MODULE_DEVICE_TABLE(acpi, loongson_edac_acpi_match); + +static struct platform_driver loongson_edac_driver = { + .probe = edac_probe, + .remove = edac_remove, + .driver = { + .name = "loongson-mc-edac", -+ .of_match_table = loongson_edac_of_match, ++ .acpi_match_table = loongson_edac_acpi_match, + }, +}; +module_platform_driver(loongson_edac_driver); diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch b/runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch deleted file mode 100644 index 9d26c379cc0..00000000000 --- a/runtime-kernel/linux-kernel/autobuild/patches/0083-FROMLIST-dt-bindings-EDAC-for-ls3a5000-memory-contro.patch +++ /dev/null @@ -1,89 +0,0 @@ -From ceb55e4da592d0d491120f4a56a417b23db17b8b Mon Sep 17 00:00:00 2001 -From: Zhao Qunqin -Date: Mon, 30 Sep 2024 11:29:42 +0800 -Subject: [PATCH 083/136] FROMLIST: dt-bindings: EDAC for ls3a5000 memory - controller - -add device tree bindings for ls3a5000 EDAC driver. - -Signed-off-by: Zhao Qunqin -Reviewed-by: Krzysztof Kozlowski - -Link: https://lore.kernel.org/all/20240930032943.5182-2-zhaoqunqin@loongson.cn/ -Signed-off-by: Kexy Biscuit ---- - .../edac/loongson,ls3a5000-mc-edac.yaml | 44 +++++++++++++++++++ - MAINTAINERS | 6 +++ - 2 files changed, 50 insertions(+) - create mode 100644 Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml - -diff --git a/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml b/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -new file mode 100644 -index 000000000000..52f10bc941e1 ---- /dev/null -+++ b/Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -@@ -0,0 +1,44 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/edac/loongson,ls3a5000-mc-edac.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: Loongson Memory Controller EDAC -+ -+maintainers: -+ - Zhao Qunqin -+ -+description: | -+ EDAC node is defined to describe on-chip error detection and correction for -+ Loongson Memory Controller. -+ -+properties: -+ compatible: -+ oneOf: -+ - enum: -+ - loongson,ls3a5000-mc-edac -+ - items: -+ - enum: -+ - loongson,ls3c5000l-mc-edac -+ - loongson,ls3c5000-mc-edac -+ - loongson,ls3d5000-mc-edac -+ - loongson,ls3a6000-mc-edac -+ - loongson,ls3c6000-mc-edac -+ - const: loongson,ls3a5000-mc-edac -+ -+ reg: -+ maxItems: 1 -+ -+required: -+ - compatible -+ - reg -+ -+additionalProperties: false -+ -+examples: -+ - | -+ memory-controller@1fe00600 { -+ compatible = "loongson,ls3a5000-mc-edac"; -+ reg = <0x1fe00600 0x50>; -+ }; -diff --git a/MAINTAINERS b/MAINTAINERS -index 3653bf325a90..0d6e139e4d9c 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -13268,6 +13268,12 @@ S: Maintained - F: Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml - F: drivers/thermal/loongson2_thermal.c - -+LOONGSON EDAC DRIVER -+M: Zhao Qunqin -+L: linux-edac@vger.kernel.org -+S: Maintained -+F: Documentation/devicetree/bindings/edac/loongson,ls3a5000-mc-edac.yaml -+ - LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) - M: Sathya Prakash - M: Sreekanth Reddy --- -2.47.0 - diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch b/runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch similarity index 81% rename from runtime-kernel/linux-kernel/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch index 9d75a967373..541968678d1 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0112-FROMEXT-Input-Add-driver-for-PixArt-PS-2-touchpad.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0084-FROMLIST-Input-Add-driver-for-PixArt-PS-2-touchpad.patch @@ -1,7 +1,7 @@ -From f6c84233a051d79e0cc662a04bbcfe1f23e59898 Mon Sep 17 00:00:00 2001 +From 65105fd2f6c9810a274c55074187a1ec618bd00f Mon Sep 17 00:00:00 2001 From: Binbin Zhou -Date: Tue, 15 Oct 2024 09:59:57 +0800 -Subject: [PATCH 112/136] FROMEXT: Input: Add driver for PixArt PS/2 touchpad +Date: Wed, 23 Oct 2024 16:38:05 +0800 +Subject: [PATCH 084/156] FROMLIST: Input: Add driver for PixArt PS/2 touchpad This patch introduces a driver for the PixArt PS/2 touchpad, which supports both clickpad and touchpad types. @@ -15,18 +15,18 @@ Signed-off-by: Jon Xie Co-developed-by: Jay Lee Signed-off-by: Jay Lee Signed-off-by: Binbin Zhou -Signed-off-by: Huacai Chen +Tested-by: Kexy Biscuit -Link: https://github.com/chenhuacai/linux/commit/9c1b0e8ccbb5c9530f83a129b35e9ebe9d4e7e93 +Link: https://lore.kernel.org/all/20241023083805.2164641-1-zhoubinbin@loongson.cn/ Signed-off-by: Kexy Biscuit --- drivers/input/mouse/Kconfig | 12 ++ drivers/input/mouse/Makefile | 1 + - drivers/input/mouse/pixart_ps2.c | 287 +++++++++++++++++++++++++++++ + drivers/input/mouse/pixart_ps2.c | 310 +++++++++++++++++++++++++++++ drivers/input/mouse/pixart_ps2.h | 36 ++++ drivers/input/mouse/psmouse-base.c | 17 ++ drivers/input/mouse/psmouse.h | 3 +- - 6 files changed, 355 insertions(+), 1 deletion(-) + 6 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 drivers/input/mouse/pixart_ps2.c create mode 100644 drivers/input/mouse/pixart_ps2.h @@ -67,10 +67,10 @@ index a1336d5bee6f..563029551529 100644 psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o diff --git a/drivers/input/mouse/pixart_ps2.c b/drivers/input/mouse/pixart_ps2.c new file mode 100644 -index 000000000000..3b13337f2447 +index 000000000000..d5cd00936171 --- /dev/null +++ b/drivers/input/mouse/pixart_ps2.c -@@ -0,0 +1,287 @@ +@@ -0,0 +1,310 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Pixart Touchpad Controller 1336U PS2 driver @@ -85,10 +85,12 @@ index 000000000000..3b13337f2447 + * + */ + ++#include +#include +#include -+#include ++#include +#include ++#include +#include +#include + @@ -103,7 +105,7 @@ index 000000000000..3b13337f2447 + if (error) + return error; + -+ *mode = (param[0] == 1) ? PIXART_MODE_ABS : PIXART_MODE_REL; ++ *mode = param[0] == 1 ? PIXART_MODE_ABS : PIXART_MODE_REL; + + return 0; +} @@ -167,15 +169,17 @@ index 000000000000..3b13337f2447 +{ + struct pixart_data *priv = psmouse->private; + struct input_dev *dev = psmouse->dev; -+ int i, id, fingers = 0, abs_x, abs_y; -+ u8 *pkt = psmouse->packet; -+ u8 contact_cnt = CONTACT_CNT(pkt[0]); ++ const u8 *pkt = psmouse->packet; ++ unsigned int contact_cnt = FIELD_GET(CONTACT_CNT_MASK, pkt[0]); ++ unsigned int i, id, abs_x, abs_y; + bool tip; + + for (i = 0; i < contact_cnt; i++) { -+ id = SLOT_ID_MASK(pkt[3 * i + 3]); -+ abs_y = ABS_Y_MASK(pkt[3 * i + 3]) | pkt[3 * i + 1]; -+ abs_x = ABS_X_MASK(pkt[3 * i + 3]) | pkt[3 * i + 2]; ++ const u8 *p = &pkt[i * 3]; ++ ++ id = FIELD_GET(SLOT_ID_MASK, p[3]); ++ abs_y = FIELD_GET(ABS_Y_MASK, p[3]) << 8 | p[1]; ++ abs_x = FIELD_GET(ABS_X_MASK, p[3]) << 8 | p[2]; + + if (i == PIXART_MAX_FINGERS - 1) + tip = pkt[14] & BIT(1); @@ -184,7 +188,6 @@ index 000000000000..3b13337f2447 + + input_mt_slot(dev, id); + if (input_mt_report_slot_state(dev, MT_TOOL_FINGER, tip)) { -+ fingers++; + input_report_abs(dev, ABS_MT_POSITION_Y, abs_y); + input_report_abs(dev, ABS_MT_POSITION_X, abs_x); + } @@ -193,10 +196,10 @@ index 000000000000..3b13337f2447 + input_mt_sync_frame(dev); + + if (priv->type == PIXART_TYPE_CLICKPAD) { -+ input_report_key(dev, BTN_LEFT, pkt[0] & 0x3); ++ input_report_key(dev, BTN_LEFT, pkt[0] & 0x03); + } else { -+ input_report_key(dev, BTN_LEFT, pkt[0] & 0x1); -+ input_report_key(dev, BTN_RIGHT, pkt[0] & 0x2); ++ input_report_key(dev, BTN_LEFT, pkt[0] & BIT(0)); ++ input_report_key(dev, BTN_RIGHT, pkt[0] & BIT(1)); + } + + input_sync(dev); @@ -205,18 +208,24 @@ index 000000000000..3b13337f2447 +static psmouse_ret_t pixart_protocol_handler(struct psmouse *psmouse) +{ + u8 *pkt = psmouse->packet; -+ u8 contact_cnt = CONTACT_CNT(pkt[0]); ++ u8 contact_cnt; ++ ++ if ((pkt[0] & 0x8c) != 0x80) ++ return PSMOUSE_BAD_DATA; + -+ if (contact_cnt > PIXART_MAX_FINGERS || ((pkt[0] & 0x8c) != 0x80)) ++ contact_cnt = FIELD_GET(CONTACT_CNT_MASK, pkt[0]); ++ if (contact_cnt > PIXART_MAX_FINGERS) + return PSMOUSE_BAD_DATA; + -+ if (contact_cnt == PIXART_MAX_FINGERS && psmouse->pktcnt < psmouse->pktsize) ++ if (contact_cnt == PIXART_MAX_FINGERS && ++ psmouse->pktcnt < psmouse->pktsize) { + return PSMOUSE_GOOD_DATA; ++ } + + if (contact_cnt == 0 && psmouse->pktcnt < 5) + return PSMOUSE_GOOD_DATA; + -+ if (psmouse->pktcnt < (3 * contact_cnt + 2)) ++ if (psmouse->pktcnt < 3 * contact_cnt + 2) + return PSMOUSE_GOOD_DATA; + + pixart_process_packet(psmouse); @@ -233,22 +242,28 @@ index 000000000000..3b13337f2447 + +static int pixart_reconnect(struct psmouse *psmouse) +{ ++ struct ps2dev *ps2dev = &psmouse->ps2dev; + u8 mode; + int error; -+ struct ps2dev *ps2dev = &psmouse->ps2dev; + + pixart_reset(psmouse); ++ + error = pixart_read_tp_mode(ps2dev, &mode); + if (error) + return error; + + if (mode != PIXART_MODE_ABS) -+ return mode; ++ return -EIO; + -+ return ps2_command(ps2dev, NULL, PIXART_CMD_SWITCH_PROTO); ++ error = ps2_command(ps2dev, NULL, PIXART_CMD_SWITCH_PROTO); ++ if (error) ++ return error; ++ ++ return 0; +} + -+static int pixart_set_input_params(struct input_dev *dev, struct pixart_data *priv) ++static int pixart_set_input_params(struct input_dev *dev, ++ struct pixart_data *priv) +{ + /* No relative support */ + __clear_bit(EV_REL, dev->evbit); @@ -268,10 +283,12 @@ index 000000000000..3b13337f2447 + input_set_abs_params(dev, ABS_X, 0, PIXART_PAD_WIDTH, 0, 0); + input_set_abs_params(dev, ABS_Y, 0, PIXART_PAD_HEIGHT, 0, 0); + -+ input_set_abs_params(dev, ABS_MT_POSITION_X, 0, PIXART_PAD_WIDTH, 0, 0); -+ input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, PIXART_PAD_HEIGHT, 0, 0); ++ input_set_abs_params(dev, ABS_MT_POSITION_X, ++ 0, PIXART_PAD_WIDTH, 0, 0); ++ input_set_abs_params(dev, ABS_MT_POSITION_Y, ++ 0, PIXART_PAD_HEIGHT, 0, 0); + -+ return input_mt_init_slots(dev, PIXART_SLOTS_NUM, ++ return input_mt_init_slots(dev, PIXART_MAX_FINGERS, + INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED); +} + @@ -283,7 +300,11 @@ index 000000000000..3b13337f2447 + if (error) + return error; + -+ return pixart_read_tp_mode(ps2dev, mode); ++ error = pixart_read_tp_mode(ps2dev, mode); ++ if (error) ++ return error; ++ ++ return 0; +} + +int pixart_detect(struct psmouse *psmouse, bool set_properties) @@ -292,6 +313,7 @@ index 000000000000..3b13337f2447 + int error; + + pixart_reset(psmouse); ++ + error = pixart_read_tp_type(&psmouse->ps2dev, &type); + if (error) + return error; @@ -317,7 +339,8 @@ index 000000000000..3b13337f2447 + psmouse->private = priv; + pixart_reset(psmouse); + -+ error = pixart_query_hardware(&psmouse->ps2dev, &priv->mode, &priv->type); ++ error = pixart_query_hardware(&psmouse->ps2dev, ++ &priv->mode, &priv->type); + if (error) { + psmouse_err(psmouse, "init: Unable to query PixArt touchpad hardware.\n"); + goto err_exit; @@ -360,7 +383,7 @@ index 000000000000..3b13337f2447 +} diff --git a/drivers/input/mouse/pixart_ps2.h b/drivers/input/mouse/pixart_ps2.h new file mode 100644 -index 000000000000..ecc0f715b291 +index 000000000000..47a1d040f2d1 --- /dev/null +++ b/drivers/input/mouse/pixart_ps2.h @@ -0,0 +1,36 @@ @@ -370,24 +393,24 @@ index 000000000000..ecc0f715b291 + +#include "psmouse.h" + -+#define PIXART_PAD_WIDTH 1023 -+#define PIXART_PAD_HEIGHT 579 -+#define PIXART_MAX_FINGERS 4 -+#define PIXART_SLOTS_NUM PIXART_MAX_FINGERS ++#define PIXART_PAD_WIDTH 1023 ++#define PIXART_PAD_HEIGHT 579 ++#define PIXART_MAX_FINGERS 4 + +#define PIXART_CMD_REPORT_FORMAT 0x01d8 +#define PIXART_CMD_SWITCH_PROTO 0x00de + -+#define PIXART_MODE_REL 0 -+#define PIXART_MODE_ABS 1 ++#define PIXART_MODE_REL 0 ++#define PIXART_MODE_ABS 1 ++ ++#define PIXART_TYPE_CLICKPAD 0 ++#define PIXART_TYPE_TOUCHPAD 1 + -+#define PIXART_TYPE_CLICKPAD 0 -+#define PIXART_TYPE_TOUCHPAD 1 ++#define CONTACT_CNT_MASK GENMASK(6, 4) + -+#define CONTACT_CNT(m) (((m) & GENMASK(6, 4)) >> 4) -+#define SLOT_ID_MASK(m) ((m) & GENMASK(2, 0)) -+#define ABS_Y_MASK(m) (((m) & GENMASK(5, 4)) << 4) -+#define ABS_X_MASK(m) (((m) & GENMASK(7, 6)) << 2) ++#define SLOT_ID_MASK GENMASK(2, 0) ++#define ABS_Y_MASK GENMASK(5, 4) ++#define ABS_X_MASK GENMASK(7, 6) + +struct pixart_data { + u8 mode; diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch b/runtime-kernel/linux-kernel/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch new file mode 100644 index 00000000000..de98163046b --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0085-FROMLIST-iommu-intel-apply-quirk_iommu_igfx-for-8086.patch @@ -0,0 +1,104 @@ +From c9403716a755233a051230515b4933ab4ee511ed Mon Sep 17 00:00:00 2001 +From: Mingcong Bai +Date: Fri, 8 Nov 2024 20:08:21 +0800 +Subject: [PATCH 085/156] FROMLIST: iommu: intel: apply quirk_iommu_igfx for + 8086:0044 (QM57/QS57) + +(I'm not very confident about the approach of this patch but I failed to +find a better way to address the issue I have on hand, so please consider +this patch as an RFC...) + +On the Lenovo ThinkPad X201, when Intel VT-d is enabled in the BIOS, the +kernel boots with errors related to DMAR, the graphical interface appeared +quite choppy, and the system resets erratically within a minute after it +booted: + +DMAR: DRHD: handling fault status reg 3 +DMAR: [DMA Write NO_PASID] Request device [00:02.0] fault addr 0xb97ff000 +[fault reason 0x05] PTE Write access is not set + +Upon comparing boot logs with VT-d on/off, I found that the Intel Calpella +quirk (`quirk_calpella_no_shadow_gtt()') correctly applied the igfx IOMMU +disable/quirk correctly: + +pci 0000:00:00.0: DMAR: BIOS has allocated no shadow GTT; disabling IOMMU +for graphics + +Whereas with VT-d on, it went into the "else" branch, which then +triggered the DMAR handling fault above: + +... else if (!disable_igfx_iommu) { + /* we have to ensure the gfx device is idle before we flush */ + pci_info(dev, "Disabling batched IOTLB flush on Ironlake\n"); + iommu_set_dma_strict(); +} + +Now, this is not exactly scientific, but moving 0x0044 to quirk_iommu_igfx +seems to have fixed the aforementioned issue. Running a few `git blame' +runs on the function, I have found that the quirk was originally +introduced as a fix specific to ThinkPad X201: + +commit 9eecabcb9a92 ("intel-iommu: Abort IOMMU setup for igfx if BIOS gave +no shadow GTT space") + +Which was later revised twice to the "else" branch we saw above: + +- 2011: commit 6fbcfb3e467a ("intel-iommu: Workaround IOTLB hang on + Ironlake GPU") +- 2024: commit ba00196ca41c ("iommu/vt-d: Decouple igfx_off from graphic + identity mapping") + +I'm uncertain whether further testings on this particular laptops were +done in 2011 and (honestly I'm not sure) 2024, but I would be happy to do +some distro-specific testing if that's what would be required to verify +this patch. + +P.S., I also see IDs 0x0040, 0x0062, and 0x006a listed under the same +`quirk_calpella_no_shadow_gtt()' quirk, but I'm not sure how similar these +chipsets are (if they share the same issue with VT-d or even, indeed, if +this issue is specific to a bug in the Lenovo BIOS). With regards to +0x0062, it seems to be a Centrino wireless card, but not a chipset? + +I have also listed a couple (distro and kernel) bug reports below as +references (some of them are from 7-8 years ago!), as they seem to be +similar issue found on different Westmere/Ironlake, Haswell, and Broadwell +hardware setups. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=197029 +Link: https://groups.google.com/g/qubes-users/c/4NP4goUds2c?pli=1 +Link: https://bugs.archlinux.org/task/65362 +Link: https://bbs.archlinux.org/viewtopic.php?id=230323 +Reported-by: Wenhao Sun +Signed-off-by: Mingcong Bai + +Link: https://lore.kernel.org/linux-iommu/20241108120838.495931-1-jeffbai@aosc.io/ +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index dda6dea7cce0..8d28ecd0a640 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -4710,6 +4710,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_igfx); + ++/* QM57/QS57 integrated gfx malfunctions with dmar */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_iommu_igfx); ++ + /* Broadwell igfx malfunctions with dmar */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1606, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x160B, quirk_iommu_igfx); +@@ -4787,7 +4790,6 @@ static void quirk_calpella_no_shadow_gtt(struct pci_dev *dev) + } + } + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); +-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); + +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch b/runtime-kernel/linux-kernel/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch new file mode 100644 index 00000000000..dfbd4900242 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0086-FROMLIST-drm-amdgpu-Fix-UVD-contiguous-CS-mapping-pr.patch @@ -0,0 +1,58 @@ +From 21489b13fc9e4d628f6067b0eaa7b27db6f0b912 Mon Sep 17 00:00:00 2001 +From: Arunpravin Paneer Selvam +Date: Mon, 11 Nov 2024 13:35:24 +0530 +Subject: [PATCH 086/156] FROMLIST: drm/amdgpu: Fix UVD contiguous CS mapping + problem + +When starting the mpv player, Radeon R9 users are observing +the below error in dmesg. + +[drm:amdgpu_uvd_cs_pass2 [amdgpu]] +*ERROR* msg/fb buffer ff00f7c000-ff00f7e000 out of 256MB segment! + +The patch tries to set the TTM_PL_FLAG_CONTIGUOUS for both user +flag(AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) set and not set cases. + +Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3599 +Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3501 +Signed-off-by: Arunpravin Paneer Selvam +Cc: stable@vger.kernel.org + +Link: https://lore.kernel.org/all/20241111080524.353192-1-Arunpravin.PaneerSelvam@amd.com/ +Signed-off-by: Kexy Biscuit +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +index a95811da242b..40aa2781e237 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +@@ -1800,13 +1800,17 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, + if (dma_resv_locking_ctx((*bo)->tbo.base.resv) != &parser->exec.ticket) + return -EINVAL; + +- (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; +- amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); +- for (i = 0; i < (*bo)->placement.num_placement; i++) +- (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; +- r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); +- if (r) +- return r; ++ if ((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) { ++ (*bo)->placements[0].flags |= TTM_PL_FLAG_CONTIGUOUS; ++ } else { ++ (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; ++ amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); ++ for (i = 0; i < (*bo)->placement.num_placement; i++) ++ (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; ++ r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); ++ if (r) ++ return r; ++ } + + return amdgpu_ttm_alloc_gart(&(*bo)->tbo); + } +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch b/runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch index 2899f299a7d..7bfefdb35cd 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0085-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0087-BACKPORT-PHYTIUM-net-stmmac-Add-Phytium-GMAC-glue-la.patch @@ -1,7 +1,7 @@ -From 6e5b814ca59f112c86bf555d88dad52c31c691aa Mon Sep 17 00:00:00 2001 +From fbbc66ea1f6d146b1b3fde57aaa6f33145be1e29 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:34:22 +0800 -Subject: [PATCH 085/136] BACKPORT: PHYTIUM: net: stmmac: Add Phytium GMAC glue +Subject: [PATCH 087/156] BACKPORT: PHYTIUM: net: stmmac: Add Phytium GMAC glue layer This patch adds support for Phytium GMAC controller which derived from @@ -26,7 +26,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c diff --git a/MAINTAINERS b/MAINTAINERS -index 99b339474f37..9c59a656441b 100644 +index c253fb9926e4..2d6be32480f3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2702,6 +2702,12 @@ S: Maintained diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch b/runtime-kernel/linux-kernel/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch index f4eba2edd09..ddf5fe0afdb 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0086-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0088-PHYTIUM-net-stmmac-Add-a-barrier-to-make-sure-all-ac.patch @@ -1,7 +1,7 @@ -From 9bc3ebd2754056504e861a37c8915b1d350adf64 Mon Sep 17 00:00:00 2001 +From fc401aa5a88b771235346cfe38e7013ff12f4217 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 20 Oct 2023 18:55:20 +0800 -Subject: [PATCH 086/136] PHYTIUM: net: stmmac: Add a barrier to make sure all +Subject: [PATCH 088/156] PHYTIUM: net: stmmac: Add a barrier to make sure all access coherent Add a memory barrier to sync TX descriptor to avoid data error. diff --git a/app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch b/runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch index 7590ade943c..22720797b4f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0087-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-drivers-fix-build-errors.patch @@ -1,7 +1,7 @@ -From f3bc1bf4fac7a1fd159b3fb4bebc04d9a7684d9d Mon Sep 17 00:00:00 2001 +From 28f2f5f2f921808a4c4c4fa729b07353630557d6 Mon Sep 17 00:00:00 2001 From: zuoqian Date: Tue, 23 Jan 2024 09:24:03 +0800 -Subject: [PATCH 087/136] BACKPORT: PHYTIUM: drivers: fix build errors +Subject: [PATCH 089/156] BACKPORT: PHYTIUM: drivers: fix build errors 1. spi: Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS 82238 2. net: stmmac: clarify difference between "interface" and "phy_interface" a014c3555 diff --git a/app-admin/kernel-tools/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch b/runtime-kernel/linux-kernel/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch similarity index 88% rename from app-admin/kernel-tools/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch index ecc754dcff0..8fc8574360d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0088-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0090-BACKPORT-PHYTIUM-Update-phytium-copyright-info-to-20.patch @@ -1,7 +1,7 @@ -From fa04fa68e76770ec032a3efda676f941f5dc4a05 Mon Sep 17 00:00:00 2001 +From 02e416726ab14ff779f81725b04f35319c605972 Mon Sep 17 00:00:00 2001 From: liutianyu1250 Date: Mon, 5 Feb 2024 09:52:51 +0800 -Subject: [PATCH 088/136] BACKPORT: PHYTIUM: Update phytium copyright info to +Subject: [PATCH 090/156] BACKPORT: PHYTIUM: Update phytium copyright info to 2024 Signed-off-by: liutianyu1250 diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch b/runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch index aa60056026d..213be6c478a 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0089-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-stmmac-Add-phytium-DWMAC-driver.patch @@ -1,7 +1,7 @@ -From 2602130f086e5dfff665d7cc859327947dd19a51 Mon Sep 17 00:00:00 2001 +From fbda7dca83853f66d23c78e9047a9eca32afec0d Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Mon, 25 Mar 2024 17:38:27 +0800 -Subject: [PATCH 089/136] BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC +Subject: [PATCH 091/156] BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC driver support v2 Modify stmmmac driver to support phytium DWMAC controler. @@ -20,7 +20,7 @@ Signed-off-by: Kexy Biscuit 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS -index 9c59a656441b..2fad0518cf89 100644 +index 2d6be32480f3..cb134e4c6791 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2702,12 +2702,6 @@ S: Maintained @@ -36,7 +36,7 @@ index 9c59a656441b..2fad0518cf89 100644 ARM/QUALCOMM CHROMEBOOK SUPPORT R: cros-qcom-dts-watchers@chromium.org F: arch/arm64/boot/dts/qcom/sc7180* -@@ -18595,6 +18589,12 @@ F: include/sound/pxa2xx-lib.h +@@ -18600,6 +18594,12 @@ F: include/sound/pxa2xx-lib.h F: sound/arm/pxa* F: sound/soc/pxa/ diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch b/runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch index aded3f36927..575fea5bbbe 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0090-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0092-PHYTIUM-net-stmmac-phytium-driver-add-pm-support.patch @@ -1,7 +1,7 @@ -From 02f4e9d1cc44d8109c85edc2157cd6af415b25d3 Mon Sep 17 00:00:00 2001 +From 9135f791529961ab447935952f556166aa58a457 Mon Sep 17 00:00:00 2001 From: liutianyu1250 Date: Thu, 13 Jun 2024 17:50:28 +0800 -Subject: [PATCH 090/136] PHYTIUM: net: stmmac: phytium driver add pm support +Subject: [PATCH 092/156] PHYTIUM: net: stmmac: phytium driver add pm support Test S3 with net device open will got this cut log. ... diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch b/runtime-kernel/linux-kernel/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch index 56e877adc64..bdcd932a235 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0091-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0093-BACKPORT-PHYTIUM-net-phytium-Add-support-for-phytium.patch @@ -1,7 +1,7 @@ -From d88143030909c38106cc68bad48c972155cb2271 Mon Sep 17 00:00:00 2001 +From b8199701ffc4225a64a1a1249fd3ccda688a6e6b Mon Sep 17 00:00:00 2001 From: Song Wenting Date: Mon, 25 Mar 2024 13:55:20 +0800 -Subject: [PATCH 091/136] BACKPORT: PHYTIUM: net: phytium: Add support for +Subject: [PATCH 093/156] BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC This patch provides support for Phytium GMAC controller driver. @@ -47,10 +47,10 @@ Signed-off-by: Kexy Biscuit create mode 100644 drivers/net/ethernet/phytium/phytmac_v2.h diff --git a/MAINTAINERS b/MAINTAINERS -index 2fad0518cf89..e0137c469987 100644 +index cb134e4c6791..672ebe2bd043 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -18593,6 +18593,9 @@ ARM/PHYTIUM SOC SUPPORT +@@ -18598,6 +18598,9 @@ ARM/PHYTIUM SOC SUPPORT M: Wang Yinfeng S: Maintained W: https://www.phytium.com.cn diff --git a/app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch b/runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch index 81c3df6055e..394d274b8ba 100644 --- a/app-admin/kernel-tools/autobuild/patches/0092-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Bugfixed-the-MDIO-registration-f.patch @@ -1,7 +1,7 @@ -From ab9e33756688d4a74b4731cd6a5e0491abc34824 Mon Sep 17 00:00:00 2001 +From b29fc12fae69a5f1be0bccae3c917b2e04b3dfdc Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:45:04 +0800 -Subject: [PATCH 092/136] PHYTIUM: net/phytmac: Bugfixed the MDIO registration +Subject: [PATCH 094/156] PHYTIUM: net/phytmac: Bugfixed the MDIO registration failures When MDIO registration fails, it will double free netdev, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch b/runtime-kernel/linux-kernel/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch similarity index 91% rename from runtime-kernel/linux-kernel/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch index 411f35eba46..af5b3236578 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0093-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0095-PHYTIUM-net-phytmac-Fixed-the-issue-of-pxe-startup-f.patch @@ -1,7 +1,7 @@ -From 74ea024936fdc76da60c3e227f1faa5a516125fc Mon Sep 17 00:00:00 2001 +From 9ba49dedc370b130da29aac5fe27ead2936064c0 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:46:54 +0800 -Subject: [PATCH 093/136] PHYTIUM: net/phytmac: Fixed the issue of pxe startup +Subject: [PATCH 095/156] PHYTIUM: net/phytmac: Fixed the issue of pxe startup failure. When network driver supports broadcast mode, no_broadcast bit of the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch b/runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch index 56a8b6291f0..1124d23b058 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0094-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0096-PHYTIUM-net-phytmac-Adapt-interface-type-1000BASE-x.patch @@ -1,7 +1,7 @@ -From bdc1e54660361fe138d2c97d2eb84f6082f5be77 Mon Sep 17 00:00:00 2001 +From a8b6eba61eac9bd1e8b32698455cfd3a58e801b2 Mon Sep 17 00:00:00 2001 From: Li Wencheng Date: Fri, 29 Mar 2024 16:49:17 +0800 -Subject: [PATCH 094/136] PHYTIUM: net/phytmac: Adapt interface type 1000BASE-x +Subject: [PATCH 096/156] PHYTIUM: net/phytmac: Adapt interface type 1000BASE-x Added 1000BASE-x interface type support for phymac driver. diff --git a/app-admin/kernel-tools/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch b/runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch index c0355ee1ac0..5ea4f9d024d 100644 --- a/app-admin/kernel-tools/autobuild/patches/0095-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-PHYTIUM-arm64-phytium-Add-support-for-Phyti.patch @@ -1,7 +1,7 @@ -From 5de2d4d68b1a4976252d860fbc0224738a3c1021 Mon Sep 17 00:00:00 2001 +From c1bca32d6e86f92daffd836b2140de259cae2e00 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:33:58 +0800 -Subject: [PATCH 095/136] BACKPORT: PHYTIUM: arm64: phytium: Add support for +Subject: [PATCH 097/156] BACKPORT: PHYTIUM: arm64: phytium: Add support for Phytium SoC family This patch adds supoort for the Phytium SoC family. diff --git a/app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch b/runtime-kernel/linux-kernel/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch similarity index 86% rename from app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch index c940444e293..a5e4b5ac6b4 100644 --- a/app-admin/kernel-tools/autobuild/patches/0096-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0098-PHYTIUM-PCI-Add-Phytium-vendor-ID.patch @@ -1,7 +1,7 @@ -From 373cecd9a655e6c5d247d5edd72181313c5df510 Mon Sep 17 00:00:00 2001 +From 2102c1b61f23a5278ac81b767c0c4e87eaec4141 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Fri, 14 Jul 2023 08:33:59 +0800 -Subject: [PATCH 096/136] PHYTIUM: PCI: Add Phytium vendor ID +Subject: [PATCH 098/156] PHYTIUM: PCI: Add Phytium vendor ID Update pci_ids.h with the vendor ID for Phytium. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch b/runtime-kernel/linux-kernel/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch index 83f13a50fd4..366a535232d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0097-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0099-BACKPORT-DEEPIN-ethernet-Add-motorcomm-yt6801-suppor.patch @@ -1,7 +1,7 @@ -From 85a9104b713efba1be7b3020dcf812a97e770719 Mon Sep 17 00:00:00 2001 +From cc03b7281b1a96e502ed0a435e57f2cb83269cbd Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Wed, 17 Jul 2024 18:25:37 +0800 -Subject: [PATCH 097/136] BACKPORT: DEEPIN: ethernet: Add motorcomm yt6801 +Subject: [PATCH 099/156] BACKPORT: DEEPIN: ethernet: Add motorcomm yt6801 support - The Asus XC-LS3A6M motherboard(Loongson 3A6000),CE720Z2,CE720Z... uses diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch b/runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch index 2612515c88c..83f59858b7d 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0098-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0100-DEEPIN-ethernet-yt6801-fix-build-on-6.8.patch @@ -1,7 +1,7 @@ -From d31707bf8b1076bdb38c0d9e5147f7cc4c957430 Mon Sep 17 00:00:00 2001 +From db5fc1967e1b429452ae54297f8e63a9e95979aa Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Jul 2024 11:00:20 +0800 -Subject: [PATCH 098/136] DEEPIN: ethernet: yt6801: fix build on >= 6.8 +Subject: [PATCH 100/156] DEEPIN: ethernet: yt6801: fix build on >= 6.8 Adapt to ethtool.h changes introduced in 6.8. diff --git a/app-admin/kernel-tools/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch b/runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch similarity index 90% rename from app-admin/kernel-tools/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch index c06ff2c1540..320e9be21c6 100644 --- a/app-admin/kernel-tools/autobuild/patches/0099-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0101-DEEPIN-net-stmmac-fix-dwmac-phytium-build-on-6.9.patch @@ -1,7 +1,7 @@ -From d92b6da964522e104b8f83caab369152efe70b3f Mon Sep 17 00:00:00 2001 +From 6db57299ca1004b74bfc829e1fd1cb686ca5c119 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Thu, 27 Jun 2024 14:37:53 +0800 -Subject: [PATCH 099/136] DEEPIN: net: stmmac: fix dwmac-phytium build on 6.9 +Subject: [PATCH 101/156] DEEPIN: net: stmmac: fix dwmac-phytium build on 6.9 Declare phytium_dwmac_remove() as a static function to resolve a missing prototype warning. diff --git a/app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch similarity index 89% rename from app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch index 4fc18a4ecfd..0969ac837ea 100644 --- a/app-admin/kernel-tools/autobuild/patches/0100-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-stmmac-Add-phytium-old-dwmac-acpi_device_.patch @@ -1,7 +1,7 @@ -From 95b173b2c5af446bb394c0f8150c0fc7298a6fe5 Mon Sep 17 00:00:00 2001 +From 9eacc38185fdcb3edc40f99d94df4bc62d040a09 Mon Sep 17 00:00:00 2001 From: Wentao Guan Date: Wed, 8 May 2024 18:11:37 +0800 -Subject: [PATCH 100/136] DEEPIN: net/stmmac: Add phytium old dwmac +Subject: [PATCH 102/156] DEEPIN: net/stmmac: Add phytium old dwmac acpi_device_id As Phytium ACPI Description Specification document v1.2 p13 diff --git a/app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch b/runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch similarity index 92% rename from app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch index c0c5faf6a58..ae451189b9f 100644 --- a/app-admin/kernel-tools/autobuild/patches/0101-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-stmmac-fix-potential-double-free-of-dma-d.patch @@ -1,7 +1,7 @@ -From c11355aa0a6d765b614ae5d34906634c155a86dd Mon Sep 17 00:00:00 2001 +From 71d9452216a694523674411523f5f5b11e9c7916 Mon Sep 17 00:00:00 2001 From: Yanteng Si Date: Mon, 27 May 2024 10:20:21 +0800 -Subject: [PATCH 101/136] DEEPIN: net: stmmac: fix potential double free of dma +Subject: [PATCH 103/156] DEEPIN: net: stmmac: fix potential double free of dma descriptor resources reset the dma descriptor related resource's pointer to NULL,otherwise @@ -30,7 +30,7 @@ Signed-off-by: Kexy Biscuit 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index d9fca8d1227c..14c2d0fa879a 100644 +index 88b3179dac9f..ebe76db47ac7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1930,13 +1930,18 @@ static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch similarity index 88% rename from runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch index 57d5861704c..7bb95ec0f82 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0102-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-fix-phytmac_platform-on-.patch @@ -1,7 +1,7 @@ -From 7e80e0b23298c8c2213645abf2c10122b7383b59 Mon Sep 17 00:00:00 2001 +From 21264ccf795a846e653d7e42a7947ec72b54a741 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 11:45:05 +0800 -Subject: [PATCH 102/136] DEEPIN: net: ethernet: phytium: fix phytmac_platform +Subject: [PATCH 104/156] DEEPIN: net: ethernet: phytium: fix phytmac_platform on 6.9 Add missing include. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch b/runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch index ab2dd5d0a64..07b66891faa 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0103-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0105-DEEPIN-net-ethernet-fix-phytmac-on-6.9.patch @@ -1,7 +1,7 @@ -From a77a4cc9b0d9cfc9dc88f1a689154eddd7fec9c9 Mon Sep 17 00:00:00 2001 +From 4e90a53f7554de6d7ea992c4d91fcd9b0472f985 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 14:08:40 +0800 -Subject: [PATCH 103/136] DEEPIN: net: ethernet: fix phytmac on 6.9 +Subject: [PATCH 105/156] DEEPIN: net: ethernet: fix phytmac on 6.9 Declare multiple functions as static functions to suppress warnings about missing prototypes. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch b/runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch similarity index 92% rename from runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch index e6f011df07f..54b10daf522 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0104-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-net-ethernet-phytium-add-a-missing-declaratio.patch @@ -1,7 +1,7 @@ -From f632a1e7800733cd6ebce7b4517ed86cd9d85e51 Mon Sep 17 00:00:00 2001 +From 51ec0391b3109c64deca69392be9307df20ea32e Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Fri, 28 Jun 2024 16:23:20 +0800 -Subject: [PATCH 104/136] DEEPIN: net: ethernet: phytium: add a missing +Subject: [PATCH 106/156] DEEPIN: net: ethernet: phytium: add a missing declaration for *np MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch b/runtime-kernel/linux-kernel/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch index 7145e42afe2..d17213c498e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0105-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0107-DEEPIN-net-phytium-convert-and-remove-validate-refer.patch @@ -1,7 +1,7 @@ -From cbe420a0a50c5cd00bb5ca464807f99b1af338b4 Mon Sep 17 00:00:00 2001 +From c195bef311878bc76d812f6fc9c273e80afd8a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=98=E6=80=80?= Date: Wed, 3 Jul 2024 03:13:45 +0000 -Subject: [PATCH 105/136] DEEPIN: net: phytium: convert and remove validate() +Subject: [PATCH 107/156] DEEPIN: net: phytium: convert and remove validate() references Populate the supported interfaces bitmap and MAC capabilities mask for diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch b/runtime-kernel/linux-kernel/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch new file mode 100644 index 00000000000..83e41de56f0 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0108-DEEPIN-net-stmmac-dwmac-phytium-compat-some-FT2000.patch @@ -0,0 +1,76 @@ +From 65eb0e523518ca635f80a21d03905ff84672a2de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=BF=98=E6=80=80?= +Date: Tue, 9 Jul 2024 17:17:48 +0800 +Subject: [PATCH 108/156] DEEPIN: net: stmmac: dwmac-phytium: compat some + FT2000 + +Compat with some quirk platform FT2000/4 as id "FTGM0001", +use rgmii-rxid instead of rgmii (wrong ACPI DSDT), +and set dma_ops and host_dma_width (fix code style). + +origin code in k4.19 is following: +acpi_dma_configure(priv->device,DEV_DMA_COHERENT); +static u64 my_mask=0xffffffff; +priv->device->dma_mask = &my_mask; +priv->device->coherent_dma_mask = (u32)~0; +port to k5.10 add: +pdev->dev.dma_ops = NULL; + +Signed-off-by: Caicai +Signed-off-by: hmy +Signed-off-by: wenlunpeng +Signed-off-by: Wentao Guan + +Link: https://github.com/deepin-community/kernel-rolling/commit/36f000a9a3f2de52de835ef16e6bc4e562436e4e +Link: https://github.com/deepin-community/kernel/commit/9d9917cb0ff2aad860b72c28db34c638c5a61a92 +Signed-off-by: Kexy Biscuit +--- + .../ethernet/stmicro/stmmac/dwmac-phytium.c | 25 ++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +index dd4171a39a4a..eea842195513 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +@@ -68,6 +68,21 @@ static int phytium_dwmac_probe(struct platform_device *pdev) + return -ENOMEM; + + plat->phy_interface = device_get_phy_mode(&pdev->dev); ++#ifdef CONFIG_ACPI ++ static const struct acpi_device_id phytium_old_acpi_id[] = { ++ { .id = "FTGM0001" }, // compat FT2000/4 id ++ { } ++ }; ++ /* "phy-mode" in phytium platform DSDT is not correct in some old device. ++ * Force this PHY mode to rgmii-rxid and info of its use. ++ * If the phy-mode rgmii is realy used, a blacklist may need to be added. ++ */ ++ if (acpi_match_device_ids(to_acpi_device(&pdev->dev), phytium_old_acpi_id) && ++ plat->phy_interface == PHY_INTERFACE_MODE_RGMII) { ++ plat->phy_interface = PHY_INTERFACE_MODE_RGMII_RXID; ++ dev_info(&pdev->dev, "phytium workaround: phy-mode from rgmii to rgmii-rxid\n"); ++ } ++#endif + if (plat->phy_interface < 0) + return plat->phy_interface; + +@@ -156,7 +171,15 @@ static int phytium_dwmac_probe(struct platform_device *pdev) + plat->dma_cfg->aal = fwnode_property_read_bool(fwnode, "snps,aal"); + plat->dma_cfg->fixed_burst = fwnode_property_read_bool(fwnode, "snps,fixed-burst"); + plat->dma_cfg->mixed_burst = fwnode_property_read_bool(fwnode, "snps,mixed-burst"); +- ++#ifdef CONFIG_ACPI ++ /* Some old phytium 2000/4 FTGM0001 cannot auto deferred stmmac DMA settings ++ * show kernel error 'DMA descriptors allocation failed' ++ */ ++ if (acpi_match_device_ids(to_acpi_device(&pdev->dev), phytium_old_acpi_id)) { ++ pdev->dev.dma_ops = NULL; // solved set DMA mask Failed ++ plat->host_dma_width = 32; ++ } ++#endif + plat->axi->axi_lpi_en = false; + plat->axi->axi_xit_frm = false; + plat->axi->axi_wr_osr_lmt = 7; +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch similarity index 93% rename from runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch index 81f36f636b3..11af4fffed1 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0106-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0109-DEEPIN-HID-multitouch-Add-quirk-for-HONOR-MagicBook-.patch @@ -1,7 +1,7 @@ -From 68e99204f671a814a3caca6bb4ac4cf125d98063 Mon Sep 17 00:00:00 2001 +From c84bb9fac697cd96bb31f4b8322cab0250b56713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=98=E6=80=80?= Date: Tue, 24 Sep 2024 07:10:32 +0000 -Subject: [PATCH 106/136] DEEPIN: HID: multitouch: Add quirk for HONOR +Subject: [PATCH 109/156] DEEPIN: HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/app-admin/kernel-tools/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch b/runtime-kernel/linux-kernel/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch similarity index 77% rename from app-admin/kernel-tools/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch index 146469ebf0d..8a6c02b2feb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0107-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0110-ARMBIAN-ayufan-dts-rockpro64-change-rx_delay-for-gma.patch @@ -1,13 +1,13 @@ -From 2e74054b1310488753564daa0e3ec6e4bc9dafde Mon Sep 17 00:00:00 2001 +From b60d6bb1ec2fb737e6bd7fc520257bbfb9fead4e Mon Sep 17 00:00:00 2001 From: Ayufan Date: Sun, 30 Dec 2018 13:32:47 +0100 -Subject: [PATCH 107/136] ARMBIAN: ayufan: dts: rockpro64: change rx_delay for +Subject: [PATCH 110/156] ARMBIAN: ayufan: dts: rockpro64: change rx_delay for gmac Change-Id: Ib3899f684188aa1ed1545717af004bba53fe0e07 Signed-off-by: Ayufan -Link: https://github.com/armbian/build/blob/1c79daddc01c08508a78943b376bdc71c431d8b5/patch/kernel/archive/rockchip64-6.11/board-rockpro64-change-rx_delay-for-gmac.patch +Link: https://github.com/armbian/build/blob/8db8e198e32f8069af97426ca6986ff9d7bf9801/patch/kernel/archive/rockchip64-6.12/board-rockpro64-change-rx_delay-for-gmac.patch Signed-off-by: Kexy Biscuit --- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi | 2 +- diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch b/runtime-kernel/linux-kernel/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch new file mode 100644 index 00000000000..ce0ac70ee84 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0111-SURFACE-mwifiex-Add-quirk-resetting-the-PCI-bridge-o.patch @@ -0,0 +1,174 @@ +From ae8aae78b51e51e24ba532a02e01599d463d6baa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= +Date: Tue, 3 Nov 2020 13:28:04 +0100 +Subject: [PATCH 111/156] SURFACE: mwifiex: Add quirk resetting the PCI bridge + on MS Surface devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The most recent firmware of the 88W8897 card reports a hardcoded LTR +value to the system during initialization, probably as an (unsuccessful) +attempt of the developers to fix firmware crashes. This LTR value +prevents most of the Microsoft Surface devices from entering deep +powersaving states (either platform C-State 10 or S0ix state), because +the exit latency of that state would be higher than what the card can +tolerate. + +Turns out the card works just the same (including the firmware crashes) +no matter if that hardcoded LTR value is reported or not, so it's kind +of useless and only prevents us from saving power. + +To get rid of those hardcoded LTR reports, it's possible to reset the +PCI bridge device after initializing the cards firmware. I'm not exactly +sure why that works, maybe the power management subsystem of the PCH +resets its stored LTR values when doing a function level reset of the +bridge device. Doing the reset once after starting the wifi firmware +works very well, probably because the firmware only reports that LTR +value a single time during firmware startup. + +Patchset: mwifiex + +Signed-off-by: Jonas Dreßler +Link: https://github.com/linux-surface/kernel/commit/d3dce7daa7c9b02fffc26ab4b001dd28bacc0354 +Signed-off-by: Kexy Biscuit +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 12 +++++++++ + .../wireless/marvell/mwifiex/pcie_quirks.c | 26 +++++++++++++------ + .../wireless/marvell/mwifiex/pcie_quirks.h | 1 + + 3 files changed, 31 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index 5f997becdbaa..9a9929424513 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -1702,9 +1702,21 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb) + static void mwifiex_pcie_init_fw_port(struct mwifiex_adapter *adapter) + { + struct pcie_service_card *card = adapter->card; ++ struct pci_dev *pdev = card->dev; ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; + int tx_wrap = card->txbd_wrptr & reg->tx_wrap_mask; + ++ /* Trigger a function level reset of the PCI bridge device, this makes ++ * the firmware of PCIe 88W8897 cards stop reporting a fixed LTR value ++ * that prevents the system from entering package C10 and S0ix powersaving ++ * states. ++ * We need to do it here because it must happen after firmware ++ * initialization and this function is called after that is done. ++ */ ++ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) ++ pci_reset_function(parent_pdev); ++ + /* Write the RX ring read pointer in to reg->rx_rdptr */ + mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr | tx_wrap); + } +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +index dd6d21f1dbfd..f46b06f8d643 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +@@ -13,7 +13,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 5", +@@ -22,7 +23,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 5 (LTE)", +@@ -31,7 +33,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Pro 6", +@@ -39,7 +42,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Book 1", +@@ -47,7 +51,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Book 2", +@@ -55,7 +60,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Laptop 1", +@@ -63,7 +69,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + { + .ident = "Surface Laptop 2", +@@ -71,7 +78,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"), + }, +- .driver_data = (void *)QUIRK_FW_RST_D3COLD, ++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD | ++ QUIRK_DO_FLR_ON_BRIDGE), + }, + {} + }; +@@ -89,6 +97,8 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card) + dev_info(&pdev->dev, "no quirks enabled\n"); + if (card->quirks & QUIRK_FW_RST_D3COLD) + dev_info(&pdev->dev, "quirk reset_d3cold enabled\n"); ++ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) ++ dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n"); + } + + static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev) +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +index d6ff964aec5b..5d30ae39d65e 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +@@ -4,6 +4,7 @@ + #include "pcie.h" + + #define QUIRK_FW_RST_D3COLD BIT(0) ++#define QUIRK_DO_FLR_ON_BRIDGE BIT(1) + + void mwifiex_initialize_quirks(struct pcie_service_card *card); + int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch b/runtime-kernel/linux-kernel/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch new file mode 100644 index 00000000000..f3779ba74fa --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0112-SURFACE-mwifiex-pcie-disable-bridge_d3-for-Surface-g.patch @@ -0,0 +1,159 @@ +From cac6622c25d3146ff4324a7dc7eebeb544aea58f Mon Sep 17 00:00:00 2001 +From: Tsuchiya Yuto +Date: Sun, 4 Oct 2020 00:11:49 +0900 +Subject: [PATCH 112/156] SURFACE: mwifiex: pcie: disable bridge_d3 for Surface + gen4+ + +Currently, mwifiex fw will crash after suspend on recent kernel series. +On Windows, it seems that the root port of wifi will never enter D3 state +(stay on D0 state). And on Linux, disabling the D3 state for the +bridge fixes fw crashing after suspend. + +This commit disables the D3 state of root port on driver initialization +and fixes fw crashing after suspend. + +Signed-off-by: Tsuchiya Yuto +Patchset: mwifiex + +Link: https://github.com/linux-surface/kernel/commit/9769338807b783cee28ff7bccbaa0e60c684be9f +Signed-off-by: Kexy Biscuit +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 7 +++++ + .../wireless/marvell/mwifiex/pcie_quirks.c | 27 +++++++++++++------ + .../wireless/marvell/mwifiex/pcie_quirks.h | 1 + + 3 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index 9a9929424513..2273e3029776 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -377,6 +377,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) + { + struct pcie_service_card *card; ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + int ret; + + pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n", +@@ -418,6 +419,12 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, + return -1; + } + ++ /* disable bridge_d3 for Surface gen4+ devices to fix fw crashing ++ * after suspend ++ */ ++ if (card->quirks & QUIRK_NO_BRIDGE_D3) ++ parent_pdev->bridge_d3 = false; ++ + return 0; + } + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +index f46b06f8d643..99b024ecbade 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c +@@ -14,7 +14,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 5", +@@ -24,7 +25,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 5 (LTE)", +@@ -34,7 +36,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Pro 6", +@@ -43,7 +46,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Book 1", +@@ -52,7 +56,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Book 2", +@@ -61,7 +66,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Laptop 1", +@@ -70,7 +76,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + { + .ident = "Surface Laptop 2", +@@ -79,7 +86,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"), + }, + .driver_data = (void *)(QUIRK_FW_RST_D3COLD | +- QUIRK_DO_FLR_ON_BRIDGE), ++ QUIRK_DO_FLR_ON_BRIDGE | ++ QUIRK_NO_BRIDGE_D3), + }, + {} + }; +@@ -99,6 +107,9 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card) + dev_info(&pdev->dev, "quirk reset_d3cold enabled\n"); + if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) + dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n"); ++ if (card->quirks & QUIRK_NO_BRIDGE_D3) ++ dev_info(&pdev->dev, ++ "quirk no_brigde_d3 enabled\n"); + } + + static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev) +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +index 5d30ae39d65e..c14eb56eb911 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h ++++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h +@@ -5,6 +5,7 @@ + + #define QUIRK_FW_RST_D3COLD BIT(0) + #define QUIRK_DO_FLR_ON_BRIDGE BIT(1) ++#define QUIRK_NO_BRIDGE_D3 BIT(2) + + void mwifiex_initialize_quirks(struct pcie_service_card *card); + int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch b/runtime-kernel/linux-kernel/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch new file mode 100644 index 00000000000..cac11d2cfdb --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0113-SURFACE-Bluetooth-btusb-Lower-passive-lescan-interva.patch @@ -0,0 +1,85 @@ +From 318285d873a3e004c3a6cb406dce36d301939342 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= +Date: Thu, 25 Mar 2021 11:33:02 +0100 +Subject: [PATCH 113/156] SURFACE: Bluetooth: btusb: Lower passive lescan + interval on Marvell 88W8897 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The Marvell 88W8897 combined wifi and bluetooth card (pcie+usb version) +is used in a lot of Microsoft Surface devices, and all those devices +suffer from very low 2.4GHz wifi connection speeds while bluetooth is +enabled. The reason for that is that the default passive scanning +interval for Bluetooth Low Energy devices is quite high in Linux +(interval of 60 msec and scan window of 30 msec, see hci_core.c), and +the Marvell chip is known for its bad bt+wifi coexisting performance. + +So decrease that passive scan interval and make the scan window shorter +on this particular device to allow for spending more time transmitting +wifi signals: The new scan interval is 250 msec (0x190 * 0.625 msec) and +the new scan window is 6.25 msec (0xa * 0,625 msec). + +This change has a very large impact on the 2.4GHz wifi speeds and gets +it up to performance comparable with the Windows driver, which seems to +apply a similar quirk. + +The interval and window length were tested and found to work very well +with a lot of Bluetooth Low Energy devices, including the Surface Pen, a +Bluetooth Speaker and two modern Bluetooth headphones. All devices were +discovered immediately after turning them on. Even lower values were +also tested, but they introduced longer delays until devices get +discovered. + +Patchset: mwifiex + +Signed-off-by: Jonas Dreßler +Link: https://github.com/linux-surface/kernel/commit/f9801752d406cd308af5286c21bb27d946d3e9c7 +Signed-off-by: Kexy Biscuit +--- + drivers/bluetooth/btusb.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 2408e50743ca..9d6139a24982 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -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_LOWER_LESCAN_INTERVAL BIT(28) + + static const struct usb_device_id btusb_table[] = { + /* Generic Bluetooth USB device */ +@@ -468,6 +469,7 @@ static const struct usb_device_id quirks_table[] = { + { USB_DEVICE(0x1286, 0x2044), .driver_info = BTUSB_MARVELL }, + { USB_DEVICE(0x1286, 0x2046), .driver_info = BTUSB_MARVELL }, + { USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL }, ++ { USB_DEVICE(0x1286, 0x204c), .driver_info = BTUSB_LOWER_LESCAN_INTERVAL }, + + /* Intel Bluetooth devices */ + { USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_COMBINED }, +@@ -3866,6 +3868,19 @@ static int btusb_probe(struct usb_interface *intf, + if (id->driver_info & BTUSB_MARVELL) + hdev->set_bdaddr = btusb_set_bdaddr_marvell; + ++ /* The Marvell 88W8897 combined wifi and bluetooth card is known for ++ * very bad bt+wifi coexisting performance. ++ * ++ * Decrease the passive BT Low Energy scan interval a bit ++ * (0x0190 * 0.625 msec = 250 msec) and make the scan window shorter ++ * (0x000a * 0,625 msec = 6.25 msec). This allows for significantly ++ * higher wifi throughput while passively scanning for BT LE devices. ++ */ ++ if (id->driver_info & BTUSB_LOWER_LESCAN_INTERVAL) { ++ hdev->le_scan_interval = 0x0190; ++ hdev->le_scan_window = 0x000a; ++ } ++ + if (IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK) && + (id->driver_info & BTUSB_MEDIATEK)) { + hdev->setup = btusb_mtk_setup; +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch b/runtime-kernel/linux-kernel/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch new file mode 100644 index 00000000000..cb8a3797aaf --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0114-SURFACE-mei-me-Add-Icelake-device-ID-for-iTouch.patch @@ -0,0 +1,42 @@ +From b292acafd6d4a58e3cc107823a4744b5ff93b264 Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Thu, 30 Jul 2020 13:21:53 +0200 +Subject: [PATCH 114/156] SURFACE: mei: me: Add Icelake device ID for iTouch + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/349269d5e90409c3dd12e022da4771c6a66752b6 +Signed-off-by: Kexy Biscuit +--- + drivers/misc/mei/hw-me-regs.h | 1 + + drivers/misc/mei/pci-me.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h +index c3a6657dcd4a..82eef2f4eb0a 100644 +--- a/drivers/misc/mei/hw-me-regs.h ++++ b/drivers/misc/mei/hw-me-regs.h +@@ -92,6 +92,7 @@ + #define MEI_DEV_ID_CDF 0x18D3 /* Cedar Fork */ + + #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ ++#define MEI_DEV_ID_ICP_LP_3 0x34E4 /* Ice Lake Point LP 3 (iTouch) */ + #define MEI_DEV_ID_ICP_N 0x38E0 /* Ice Lake Point N */ + + #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */ +diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c +index 6589635f8ba3..a1df48a434e2 100644 +--- a/drivers/misc/mei/pci-me.c ++++ b/drivers/misc/mei/pci-me.c +@@ -97,6 +97,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { + {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H_3, MEI_ME_PCH8_ITOUCH_CFG)}, + + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, ++ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP_3, MEI_ME_PCH12_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_N, MEI_ME_PCH12_CFG)}, + + {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch b/runtime-kernel/linux-kernel/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch new file mode 100644 index 00000000000..ea81afc07ac --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0115-BACKPORT-SURFACE-iommu-Use-IOMMU-passthrough-mode-fo.patch @@ -0,0 +1,112 @@ +From 1fa0ad882104ba5ecc262c52b85eb0a0023a2399 Mon Sep 17 00:00:00 2001 +From: Liban Hannan +Date: Tue, 12 Apr 2022 23:31:12 +0100 +Subject: [PATCH 115/156] BACKPORT: SURFACE: iommu: Use IOMMU passthrough mode + for IPTS + +Adds a quirk so that IOMMU uses passthrough mode for the IPTS device. +Otherwise, when IOMMU is enabled, IPTS produces DMAR errors like: + +DMAR: [DMA Read NO_PASID] Request device [00:16.4] fault addr +0x104ea3000 [fault reason 0x06] PTE Read access is not set + +This is very similar to the bug described at: +https://bugs.launchpad.net/bugs/1958004 + +Fixed with the following patch which this patch basically copies: +https://launchpadlibrarian.net/586396847/43255ca.diff + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/9c052968302b202812f519f38839dd00d3621795 +[Kexy: Resolved minor conflict in drivers/iommu/intel/iommu.c] +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index 8d28ecd0a640..dea755f15010 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -40,6 +40,11 @@ + #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) + #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) + ++#define IS_IPTS(pdev) ( \ ++ ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x9D3E) || \ ++ ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x34E4) \ ++ ) ++ + #define IOAPIC_RANGE_START (0xfee00000) + #define IOAPIC_RANGE_END (0xfeefffff) + #define IOVA_START_ADDR (0x1000) +@@ -217,12 +222,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON); + int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + ++static int dmar_map_ipts = 1; + static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; + + #define IDENTMAP_AZALIA 4 ++#define IDENTMAP_IPTS 16 + + const struct iommu_ops intel_iommu_ops; + static const struct iommu_dirty_ops intel_dirty_ops; +@@ -2156,6 +2163,9 @@ static int device_def_domain_type(struct device *dev) + + if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) + return IOMMU_DOMAIN_IDENTITY; ++ ++ if ((iommu_identity_mapping & IDENTMAP_IPTS) && IS_IPTS(pdev)) ++ return IOMMU_DOMAIN_IDENTITY; + } + + return 0; +@@ -2456,6 +2466,9 @@ static int __init init_dmars(void) + iommu_set_root_entry(iommu); + } + ++ if (!dmar_map_ipts) ++ iommu_identity_mapping |= IDENTMAP_IPTS; ++ + check_tylersburg_isoch(); + + ret = si_domain_init(hw_pass_through); +@@ -4701,6 +4714,18 @@ static void quirk_iommu_igfx(struct pci_dev *dev) + disable_igfx_iommu = 1; + } + ++static void quirk_iommu_ipts(struct pci_dev *dev) ++{ ++ if (!IS_IPTS(dev)) ++ return; ++ ++ if (risky_device(dev)) ++ return; ++ ++ pci_info(dev, "Disabling IOMMU for IPTS\n"); ++ dmar_map_ipts = 0; ++} ++ + /* G4x/GM45 integrated gfx dmar support is totally busted. */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_igfx); +@@ -4739,6 +4764,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1632, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163A, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx); + ++/* disable IPTS dmar support */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9D3E, quirk_iommu_ipts); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x34E4, quirk_iommu_ipts); ++ + static void quirk_iommu_rwbf(struct pci_dev *dev) + { + if (risky_device(dev)) +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch new file mode 100644 index 00000000000..3fa89c83fb8 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0116-SURFACE-hid-Add-support-for-Intel-Precise-Touch-and-.patch @@ -0,0 +1,3099 @@ +From 07ad2c6f80ec384f46bc444050e3738e4944d5ce Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Sun, 11 Dec 2022 12:00:59 +0100 +Subject: [PATCH 116/156] SURFACE: hid: Add support for Intel Precise Touch and + Stylus + +Based on linux-surface/intel-precise-touch@8abe268 + +Signed-off-by: Dorian Stoll +Patchset: ipts + +Link: https://github.com/linux-surface/kernel/commit/4d098196ff771e07ce301632377779c94dfa7cb4 +Signed-off-by: Kexy Biscuit +--- + drivers/hid/Kconfig | 2 + + drivers/hid/Makefile | 2 + + drivers/hid/ipts/Kconfig | 14 + + drivers/hid/ipts/Makefile | 16 ++ + drivers/hid/ipts/cmd.c | 61 +++++ + drivers/hid/ipts/cmd.h | 60 ++++ + drivers/hid/ipts/context.h | 52 ++++ + drivers/hid/ipts/control.c | 486 +++++++++++++++++++++++++++++++++ + drivers/hid/ipts/control.h | 126 +++++++++ + drivers/hid/ipts/desc.h | 80 ++++++ + drivers/hid/ipts/eds1.c | 104 +++++++ + drivers/hid/ipts/eds1.h | 35 +++ + drivers/hid/ipts/eds2.c | 145 ++++++++++ + drivers/hid/ipts/eds2.h | 35 +++ + drivers/hid/ipts/hid.c | 225 +++++++++++++++ + drivers/hid/ipts/hid.h | 24 ++ + drivers/hid/ipts/main.c | 126 +++++++++ + drivers/hid/ipts/mei.c | 188 +++++++++++++ + drivers/hid/ipts/mei.h | 66 +++++ + drivers/hid/ipts/receiver.c | 251 +++++++++++++++++ + drivers/hid/ipts/receiver.h | 16 ++ + drivers/hid/ipts/resources.c | 131 +++++++++ + drivers/hid/ipts/resources.h | 41 +++ + drivers/hid/ipts/spec-data.h | 100 +++++++ + drivers/hid/ipts/spec-device.h | 290 ++++++++++++++++++++ + drivers/hid/ipts/spec-hid.h | 34 +++ + drivers/hid/ipts/thread.c | 84 ++++++ + drivers/hid/ipts/thread.h | 59 ++++ + 28 files changed, 2853 insertions(+) + create mode 100644 drivers/hid/ipts/Kconfig + create mode 100644 drivers/hid/ipts/Makefile + create mode 100644 drivers/hid/ipts/cmd.c + create mode 100644 drivers/hid/ipts/cmd.h + create mode 100644 drivers/hid/ipts/context.h + create mode 100644 drivers/hid/ipts/control.c + create mode 100644 drivers/hid/ipts/control.h + create mode 100644 drivers/hid/ipts/desc.h + create mode 100644 drivers/hid/ipts/eds1.c + create mode 100644 drivers/hid/ipts/eds1.h + create mode 100644 drivers/hid/ipts/eds2.c + create mode 100644 drivers/hid/ipts/eds2.h + create mode 100644 drivers/hid/ipts/hid.c + create mode 100644 drivers/hid/ipts/hid.h + create mode 100644 drivers/hid/ipts/main.c + create mode 100644 drivers/hid/ipts/mei.c + create mode 100644 drivers/hid/ipts/mei.h + create mode 100644 drivers/hid/ipts/receiver.c + create mode 100644 drivers/hid/ipts/receiver.h + create mode 100644 drivers/hid/ipts/resources.c + create mode 100644 drivers/hid/ipts/resources.h + create mode 100644 drivers/hid/ipts/spec-data.h + create mode 100644 drivers/hid/ipts/spec-device.h + create mode 100644 drivers/hid/ipts/spec-hid.h + create mode 100644 drivers/hid/ipts/thread.c + create mode 100644 drivers/hid/ipts/thread.h + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 08446c89eff6..ccddfba86004 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -1367,4 +1367,6 @@ source "drivers/hid/amd-sfh-hid/Kconfig" + + source "drivers/hid/surface-hid/Kconfig" + ++source "drivers/hid/ipts/Kconfig" ++ + endif # HID_SUPPORT +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index e40f1ddebbb7..bdb17cffca2f 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -169,3 +169,5 @@ obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ish-hid/ + obj-$(CONFIG_AMD_SFH_HID) += amd-sfh-hid/ + + obj-$(CONFIG_SURFACE_HID_CORE) += surface-hid/ ++ ++obj-$(CONFIG_HID_IPTS) += ipts/ +diff --git a/drivers/hid/ipts/Kconfig b/drivers/hid/ipts/Kconfig +new file mode 100644 +index 000000000000..297401bd388d +--- /dev/null ++++ b/drivers/hid/ipts/Kconfig +@@ -0,0 +1,14 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++config HID_IPTS ++ tristate "Intel Precise Touch & Stylus" ++ depends on INTEL_MEI ++ depends on HID ++ help ++ Say Y here if your system has a touchscreen using Intels ++ Precise Touch & Stylus (IPTS) technology. ++ ++ If unsure say N. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called ipts. +diff --git a/drivers/hid/ipts/Makefile b/drivers/hid/ipts/Makefile +new file mode 100644 +index 000000000000..883896f68e6a +--- /dev/null ++++ b/drivers/hid/ipts/Makefile +@@ -0,0 +1,16 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++# ++# Makefile for the IPTS touchscreen driver ++# ++ ++obj-$(CONFIG_HID_IPTS) += ipts.o ++ipts-objs := cmd.o ++ipts-objs += control.o ++ipts-objs += eds1.o ++ipts-objs += eds2.o ++ipts-objs += hid.o ++ipts-objs += main.o ++ipts-objs += mei.o ++ipts-objs += receiver.o ++ipts-objs += resources.o ++ipts-objs += thread.o +diff --git a/drivers/hid/ipts/cmd.c b/drivers/hid/ipts/cmd.c +new file mode 100644 +index 000000000000..63a4934bbc5f +--- /dev/null ++++ b/drivers/hid/ipts/cmd.c +@@ -0,0 +1,61 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "mei.h" ++#include "spec-device.h" ++ ++int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp, u64 timeout) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!rsp) ++ return -EFAULT; ++ ++ /* ++ * In a response, the command code will have the most significant bit flipped to 1. ++ * If code is passed to ipts_mei_recv as is, no messages will be received. ++ */ ++ ret = ipts_mei_recv(&ipts->mei, code | IPTS_RSP_BIT, rsp, timeout); ++ if (ret < 0) ++ return ret; ++ ++ dev_dbg(ipts->dev, "Received 0x%02X with status 0x%02X\n", code, rsp->status); ++ ++ /* ++ * Some devices will always return this error. ++ * It is allowed to ignore it and to try continuing. ++ */ ++ if (rsp->status == IPTS_STATUS_COMPAT_CHECK_FAIL) ++ rsp->status = IPTS_STATUS_SUCCESS; ++ ++ return 0; ++} ++ ++int ipts_cmd_send(struct ipts_context *ipts, enum ipts_command_code code, void *data, size_t size) ++{ ++ struct ipts_command cmd = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.cmd = code; ++ ++ if (data && size > 0) ++ memcpy(cmd.payload, data, size); ++ ++ dev_dbg(ipts->dev, "Sending 0x%02X with %ld bytes payload\n", code, size); ++ return ipts_mei_send(&ipts->mei, &cmd, sizeof(cmd.cmd) + size); ++} +diff --git a/drivers/hid/ipts/cmd.h b/drivers/hid/ipts/cmd.h +new file mode 100644 +index 000000000000..2b4079075b64 +--- /dev/null ++++ b/drivers/hid/ipts/cmd.h +@@ -0,0 +1,60 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CMD_H ++#define IPTS_CMD_H ++ ++#include ++ ++#include "context.h" ++#include "spec-device.h" ++ ++/* ++ * The default timeout for receiving responses ++ */ ++#define IPTS_CMD_DEFAULT_TIMEOUT 1000 ++ ++/** ++ * ipts_cmd_recv_timeout() - Receives a response to a command. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command / response. ++ * @rsp: The address that the received response will be copied to. ++ * @timeout: How many milliseconds the function will wait at most. ++ * ++ * A negative timeout means to wait forever. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++int ipts_cmd_recv_timeout(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp, u64 timeout); ++ ++/** ++ * ipts_cmd_recv() - Receives a response to a command. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command / response. ++ * @rsp: The address that the received response will be copied to. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++static inline int ipts_cmd_recv(struct ipts_context *ipts, enum ipts_command_code code, ++ struct ipts_response *rsp) ++{ ++ return ipts_cmd_recv_timeout(ipts, code, rsp, IPTS_CMD_DEFAULT_TIMEOUT); ++} ++ ++/** ++ * ipts_cmd_send() - Executes a command on the device. ++ * @ipts: The IPTS driver context. ++ * @code: The type of the command to execute. ++ * @data: The payload containing parameters for the command. ++ * @size: The size of the payload. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_cmd_send(struct ipts_context *ipts, enum ipts_command_code code, void *data, size_t size); ++ ++#endif /* IPTS_CMD_H */ +diff --git a/drivers/hid/ipts/context.h b/drivers/hid/ipts/context.h +new file mode 100644 +index 000000000000..ba33259f1f7c +--- /dev/null ++++ b/drivers/hid/ipts/context.h +@@ -0,0 +1,52 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CONTEXT_H ++#define IPTS_CONTEXT_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "mei.h" ++#include "resources.h" ++#include "spec-device.h" ++#include "thread.h" ++ ++struct ipts_context { ++ struct device *dev; ++ struct ipts_mei mei; ++ ++ enum ipts_mode mode; ++ ++ /* ++ * Prevents concurrent GET_FEATURE reports. ++ */ ++ struct mutex feature_lock; ++ struct completion feature_event; ++ ++ /* ++ * These are not inside of struct ipts_resources ++ * because they don't own the memory they point to. ++ */ ++ struct ipts_buffer feature_report; ++ struct ipts_buffer descriptor; ++ ++ bool hid_active; ++ struct hid_device *hid; ++ ++ struct ipts_device_info info; ++ struct ipts_resources resources; ++ ++ struct ipts_thread receiver_loop; ++}; ++ ++#endif /* IPTS_CONTEXT_H */ +diff --git a/drivers/hid/ipts/control.c b/drivers/hid/ipts/control.c +new file mode 100644 +index 000000000000..5360842d260b +--- /dev/null ++++ b/drivers/hid/ipts/control.c +@@ -0,0 +1,486 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "hid.h" ++#include "receiver.h" ++#include "resources.h" ++#include "spec-data.h" ++#include "spec-device.h" ++ ++static int ipts_control_get_device_info(struct ipts_context *ipts, struct ipts_device_info *info) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!info) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_GET_DEVICE_INFO, NULL, 0); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_GET_DEVICE_INFO, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "GET_DEVICE_INFO: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ memcpy(info, rsp.payload, sizeof(*info)); ++ return 0; ++} ++ ++static int ipts_control_set_mode(struct ipts_context *ipts, enum ipts_mode mode) ++{ ++ int ret = 0; ++ struct ipts_set_mode cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.mode = mode; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_SET_MODE, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MODE: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_SET_MODE, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MODE: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "SET_MODE: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++static int ipts_control_set_mem_window(struct ipts_context *ipts, struct ipts_resources *res) ++{ ++ int i = 0; ++ int ret = 0; ++ struct ipts_mem_window cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ cmd.data_addr_lower[i] = lower_32_bits(res->data[i].dma_address); ++ cmd.data_addr_upper[i] = upper_32_bits(res->data[i].dma_address); ++ cmd.feedback_addr_lower[i] = lower_32_bits(res->feedback[i].dma_address); ++ cmd.feedback_addr_upper[i] = upper_32_bits(res->feedback[i].dma_address); ++ } ++ ++ cmd.workqueue_addr_lower = lower_32_bits(res->workqueue.dma_address); ++ cmd.workqueue_addr_upper = upper_32_bits(res->workqueue.dma_address); ++ ++ cmd.doorbell_addr_lower = lower_32_bits(res->doorbell.dma_address); ++ cmd.doorbell_addr_upper = upper_32_bits(res->doorbell.dma_address); ++ ++ cmd.hid2me_addr_lower = lower_32_bits(res->hid2me.dma_address); ++ cmd.hid2me_addr_upper = upper_32_bits(res->hid2me.dma_address); ++ ++ cmd.workqueue_size = IPTS_WORKQUEUE_SIZE; ++ cmd.workqueue_item_size = IPTS_WORKQUEUE_ITEM_SIZE; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_SET_MEM_WINDOW, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_SET_MEM_WINDOW, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "SET_MEM_WINDOW: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++static int ipts_control_get_descriptor(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_data_header *header = NULL; ++ struct ipts_get_descriptor cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->resources.descriptor.address) ++ return -EFAULT; ++ ++ memset(ipts->resources.descriptor.address, 0, ipts->resources.descriptor.size); ++ ++ cmd.addr_lower = lower_32_bits(ipts->resources.descriptor.dma_address); ++ cmd.addr_upper = upper_32_bits(ipts->resources.descriptor.dma_address); ++ cmd.magic = 8; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_GET_DESCRIPTOR, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_GET_DESCRIPTOR, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "GET_DESCRIPTOR: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ header = (struct ipts_data_header *)ipts->resources.descriptor.address; ++ ++ if (header->type == IPTS_DATA_TYPE_DESCRIPTOR) { ++ ipts->descriptor.address = &header->data[8]; ++ ipts->descriptor.size = header->size - 8; ++ ++ return 0; ++ } ++ ++ return -ENODATA; ++} ++ ++int ipts_control_request_flush(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_quiesce_io cmd = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_QUIESCE_IO, &cmd, sizeof(cmd)); ++ if (ret) ++ dev_err(ipts->dev, "QUIESCE_IO: send failed: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_control_wait_flush(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_QUIESCE_IO, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "QUIESCE_IO: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (rsp.status == IPTS_STATUS_TIMEOUT) ++ return -EAGAIN; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "QUIESCE_IO: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_request_data(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_READY_FOR_DATA, NULL, 0); ++ if (ret) ++ dev_err(ipts->dev, "READY_FOR_DATA: send failed: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_control_wait_data(struct ipts_context *ipts, bool shutdown) ++{ ++ int ret = 0; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!shutdown) ++ ret = ipts_cmd_recv_timeout(ipts, IPTS_CMD_READY_FOR_DATA, &rsp, 0); ++ else ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_READY_FOR_DATA, &rsp); ++ ++ if (ret) { ++ if (ret != -EAGAIN) ++ dev_err(ipts->dev, "READY_FOR_DATA: recv failed: %d\n", ret); ++ ++ return ret; ++ } ++ ++ /* ++ * During shutdown, it is possible that the sensor has already been disabled. ++ */ ++ if (rsp.status == IPTS_STATUS_SENSOR_DISABLED) ++ return 0; ++ ++ if (rsp.status == IPTS_STATUS_TIMEOUT) ++ return -EAGAIN; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "READY_FOR_DATA: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer) ++{ ++ int ret = 0; ++ struct ipts_feedback cmd = { 0 }; ++ struct ipts_response rsp = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ cmd.buffer = buffer; ++ ++ ret = ipts_cmd_send(ipts, IPTS_CMD_FEEDBACK, &cmd, sizeof(cmd)); ++ if (ret) { ++ dev_err(ipts->dev, "FEEDBACK: send failed: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_cmd_recv(ipts, IPTS_CMD_FEEDBACK, &rsp); ++ if (ret) { ++ dev_err(ipts->dev, "FEEDBACK: recv failed: %d\n", ret); ++ return ret; ++ } ++ ++ /* ++ * We don't know what feedback data looks like so we are sending zeros. ++ * See also ipts_control_refill_buffer. ++ */ ++ if (rsp.status == IPTS_STATUS_INVALID_PARAMS) ++ return 0; ++ ++ if (rsp.status != IPTS_STATUS_SUCCESS) { ++ dev_err(ipts->dev, "FEEDBACK: cmd failed: %d\n", rsp.status); ++ return -EBADR; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_hid2me_feedback(struct ipts_context *ipts, enum ipts_feedback_cmd_type cmd, ++ enum ipts_feedback_data_type type, void *data, size_t size) ++{ ++ struct ipts_feedback_header *header = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->resources.hid2me.address) ++ return -EFAULT; ++ ++ memset(ipts->resources.hid2me.address, 0, ipts->resources.hid2me.size); ++ header = (struct ipts_feedback_header *)ipts->resources.hid2me.address; ++ ++ header->cmd_type = cmd; ++ header->data_type = type; ++ header->size = size; ++ header->buffer = IPTS_HID2ME_BUFFER; ++ ++ if (size + sizeof(*header) > ipts->resources.hid2me.size) ++ return -EINVAL; ++ ++ if (data && size > 0) ++ memcpy(header->payload, data, size); ++ ++ return ipts_control_send_feedback(ipts, IPTS_HID2ME_BUFFER); ++} ++ ++int ipts_control_start(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ struct ipts_device_info info = { 0 }; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "Starting IPTS\n"); ++ ++ ret = ipts_control_get_device_info(ipts, &info); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to get device info: %d\n", ret); ++ return ret; ++ } ++ ++ ipts->info = info; ++ ++ ret = ipts_resources_init(&ipts->resources, ipts->dev, info.data_size, info.feedback_size); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to allocate buffers: %d", ret); ++ return ret; ++ } ++ ++ dev_info(ipts->dev, "IPTS EDS Version: %d\n", info.intf_eds); ++ ++ /* ++ * Handle newer devices ++ */ ++ if (info.intf_eds > 1) { ++ /* ++ * Fetching the descriptor will only work on newer devices. ++ * For older devices, a fallback descriptor will be used. ++ */ ++ ret = ipts_control_get_descriptor(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to fetch HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ /* ++ * Newer devices can be directly initialized in polling mode. ++ */ ++ ipts->mode = IPTS_MODE_POLL; ++ } ++ ++ ret = ipts_control_set_mode(ipts, ipts->mode); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to set mode: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_set_mem_window(ipts, &ipts->resources); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to set memory window: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_receiver_start(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to start receiver: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_request_data(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request data: %d\n", ret); ++ return ret; ++ } ++ ++ ipts_hid_enable(ipts); ++ ++ ret = ipts_hid_init(ipts, info); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to initialize HID device: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int _ipts_control_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ipts_hid_disable(ipts); ++ dev_info(ipts->dev, "Stopping IPTS\n"); ++ ++ ret = ipts_receiver_stop(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to stop receiver: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_resources_free(&ipts->resources); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to free resources: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ ret = _ipts_control_stop(ipts); ++ if (ret) ++ return ret; ++ ++ ret = ipts_hid_free(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to free HID device: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_control_restart(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ ret = _ipts_control_stop(ipts); ++ if (ret) ++ return ret; ++ ++ /* ++ * Wait a second to give the sensor time to fully shut down. ++ */ ++ msleep(1000); ++ ++ ret = ipts_control_start(ipts); ++ if (ret) ++ return ret; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/control.h b/drivers/hid/ipts/control.h +new file mode 100644 +index 000000000000..26629c5144ed +--- /dev/null ++++ b/drivers/hid/ipts/control.h +@@ -0,0 +1,126 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_CONTROL_H ++#define IPTS_CONTROL_H ++ ++#include ++ ++#include "context.h" ++#include "spec-data.h" ++#include "spec-device.h" ++ ++/** ++ * ipts_control_request_flush() - Stop the data flow. ++ * @ipts: The IPTS driver context. ++ * ++ * Runs the command to stop the data flow on the device. ++ * All outstanding data needs to be acknowledged using feedback before the command will return. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_request_flush(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_flush() - Wait until data flow has been stopped. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_wait_flush(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_flush() - Notify the device that the driver can receive new data. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_request_data(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_wait_data() - Wait until new data is available. ++ * @ipts: The IPTS driver context. ++ * @block: Whether to block execution until data is available. ++ * ++ * In poll mode, this function will never return while the data flow is active. Instead, ++ * the poll will be incremented when new data is available. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no data is available. ++ */ ++int ipts_control_wait_data(struct ipts_context *ipts, bool block); ++ ++/** ++ * ipts_control_send_feedback() - Submits a feedback buffer to the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The ID of the buffer containing feedback data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_send_feedback(struct ipts_context *ipts, u32 buffer); ++ ++/** ++ * ipts_control_hid2me_feedback() - Sends HID2ME feedback, a special type of feedback. ++ * @ipts: The IPTS driver context. ++ * @cmd: The command that will be run on the device. ++ * @type: The type of the payload that is sent to the device. ++ * @data: The payload of the feedback command. ++ * @size: The size of the payload. ++ * ++ * HID2ME feedback is a special type of feedback, because it allows interfacing with ++ * the HID API of the device at any moment, without requiring a buffer that has to ++ * be acknowledged. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_hid2me_feedback(struct ipts_context *ipts, enum ipts_feedback_cmd_type cmd, ++ enum ipts_feedback_data_type type, void *data, size_t size); ++ ++/** ++ * ipts_control_refill_buffer() - Acknowledges that data in a buffer has been processed. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer that has been processed and can be refilled. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++static inline int ipts_control_refill_buffer(struct ipts_context *ipts, u32 buffer) ++{ ++ /* ++ * IPTS expects structured data in the feedback buffer matching the buffer that will be ++ * refilled. We don't know what that data looks like, so we just keep the buffer empty. ++ * This results in an INVALID_PARAMS error, but the buffer gets refilled without an issue. ++ * Sending a minimal structure with the buffer ID fixes the error, but breaks refilling ++ * the buffers on some devices. ++ */ ++ ++ return ipts_control_send_feedback(ipts, buffer); ++} ++ ++/** ++ * ipts_control_start() - Initialized the device and starts the data flow. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_start(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_stop() - Stops the data flow and resets the device. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_stop(struct ipts_context *ipts); ++ ++/** ++ * ipts_control_restart() - Stops the device and starts it again. ++ * @ipts: The IPTS driver context. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_control_restart(struct ipts_context *ipts); ++ ++#endif /* IPTS_CONTROL_H */ +diff --git a/drivers/hid/ipts/desc.h b/drivers/hid/ipts/desc.h +new file mode 100644 +index 000000000000..307438c7c80c +--- /dev/null ++++ b/drivers/hid/ipts/desc.h +@@ -0,0 +1,80 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_DESC_H ++#define IPTS_DESC_H ++ ++#include ++ ++#define IPTS_HID_REPORT_SINGLETOUCH 64 ++#define IPTS_HID_REPORT_DATA 65 ++#define IPTS_HID_REPORT_SET_MODE 66 ++ ++#define IPTS_HID_REPORT_DATA_SIZE 7485 ++ ++/* ++ * HID descriptor for singletouch data. ++ * This descriptor should be present on all IPTS devices. ++ */ ++static const u8 ipts_singletouch_descriptor[] = { ++ 0x05, 0x0D, /* Usage Page (Digitizer), */ ++ 0x09, 0x04, /* Usage (Touchscreen), */ ++ 0xA1, 0x01, /* Collection (Application), */ ++ 0x85, 0x40, /* Report ID (64), */ ++ 0x09, 0x42, /* Usage (Tip Switch), */ ++ 0x15, 0x00, /* Logical Minimum (0), */ ++ 0x25, 0x01, /* Logical Maximum (1), */ ++ 0x75, 0x01, /* Report Size (1), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x95, 0x07, /* Report Count (7), */ ++ 0x81, 0x03, /* Input (Constant, Variable), */ ++ 0x05, 0x01, /* Usage Page (Desktop), */ ++ 0x09, 0x30, /* Usage (X), */ ++ 0x75, 0x10, /* Report Size (16), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0xA4, /* Push, */ ++ 0x55, 0x0E, /* Unit Exponent (14), */ ++ 0x65, 0x11, /* Unit (Centimeter), */ ++ 0x46, 0x76, 0x0B, /* Physical Maximum (2934), */ ++ 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x09, 0x31, /* Usage (Y), */ ++ 0x46, 0x74, 0x06, /* Physical Maximum (1652), */ ++ 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0xB4, /* Pop, */ ++ 0xC0, /* End Collection */ ++}; ++ ++/* ++ * Fallback HID descriptor for older devices that do not have ++ * the ability to query their HID descriptor. ++ */ ++static const u8 ipts_fallback_descriptor[] = { ++ 0x05, 0x0D, /* Usage Page (Digitizer), */ ++ 0x09, 0x0F, /* Usage (Capacitive Hm Digitizer), */ ++ 0xA1, 0x01, /* Collection (Application), */ ++ 0x85, 0x41, /* Report ID (65), */ ++ 0x09, 0x56, /* Usage (Scan Time), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0x75, 0x10, /* Report Size (16), */ ++ 0x81, 0x02, /* Input (Variable), */ ++ 0x09, 0x61, /* Usage (Gesture Char Quality), */ ++ 0x75, 0x08, /* Report Size (8), */ ++ 0x96, 0x3D, 0x1D, /* Report Count (7485), */ ++ 0x81, 0x03, /* Input (Constant, Variable), */ ++ 0x85, 0x42, /* Report ID (66), */ ++ 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ ++ 0x09, 0xC8, /* Usage (C8h), */ ++ 0x75, 0x08, /* Report Size (8), */ ++ 0x95, 0x01, /* Report Count (1), */ ++ 0xB1, 0x02, /* Feature (Variable), */ ++ 0xC0, /* End Collection, */ ++}; ++ ++#endif /* IPTS_DESC_H */ +diff --git a/drivers/hid/ipts/eds1.c b/drivers/hid/ipts/eds1.c +new file mode 100644 +index 000000000000..7b9f54388a9f +--- /dev/null ++++ b/drivers/hid/ipts/eds1.c +@@ -0,0 +1,104 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "eds1.h" ++#include "spec-device.h" ++ ++int ipts_eds1_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size) ++{ ++ size_t size = 0; ++ u8 *buffer = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!desc_buffer) ++ return -EFAULT; ++ ++ if (!desc_size) ++ return -EFAULT; ++ ++ size = sizeof(ipts_singletouch_descriptor) + sizeof(ipts_fallback_descriptor); ++ ++ buffer = kzalloc(size, GFP_KERNEL); ++ if (!buffer) ++ return -ENOMEM; ++ ++ memcpy(buffer, ipts_singletouch_descriptor, sizeof(ipts_singletouch_descriptor)); ++ memcpy(&buffer[sizeof(ipts_singletouch_descriptor)], ipts_fallback_descriptor, ++ sizeof(ipts_fallback_descriptor)); ++ ++ *desc_size = size; ++ *desc_buffer = buffer; ++ ++ return 0; ++} ++ ++static int ipts_eds1_switch_mode(struct ipts_context *ipts, enum ipts_mode mode) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->mode == mode) ++ return 0; ++ ++ ipts->mode = mode; ++ ++ ret = ipts_control_restart(ipts); ++ if (ret) ++ dev_err(ipts->dev, "Failed to switch modes: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_eds1_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (report_id != IPTS_HID_REPORT_SET_MODE) ++ return -EIO; ++ ++ if (report_type != HID_FEATURE_REPORT) ++ return -EIO; ++ ++ if (size != 2) ++ return -EINVAL; ++ ++ /* ++ * Implement mode switching report for older devices without native HID support. ++ */ ++ ++ if (request_type == HID_REQ_GET_REPORT) { ++ memset(buffer, 0, size); ++ buffer[0] = report_id; ++ buffer[1] = ipts->mode; ++ } else if (request_type == HID_REQ_SET_REPORT) { ++ return ipts_eds1_switch_mode(ipts, buffer[1]); ++ } else { ++ return -EIO; ++ } ++ ++ return ret; ++} +diff --git a/drivers/hid/ipts/eds1.h b/drivers/hid/ipts/eds1.h +new file mode 100644 +index 000000000000..eeeb6575e3e8 +--- /dev/null ++++ b/drivers/hid/ipts/eds1.h +@@ -0,0 +1,35 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "context.h" ++ ++/** ++ * ipts_eds1_get_descriptor() - Assembles the HID descriptor of the device. ++ * @ipts: The IPTS driver context. ++ * @desc_buffer: A pointer to the location where the address of the allocated buffer is stored. ++ * @desc_size: A pointer to the location where the size of the allocated buffer is stored. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds1_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size); ++ ++/** ++ * ipts_eds1_raw_request() - Executes an output or feature report on the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer containing the report. ++ * @size: The size of the buffer. ++ * @report_id: The HID report ID. ++ * @report_type: Whether this report is an output or a feature report. ++ * @request_type: Whether this report requests or sends data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds1_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type); +diff --git a/drivers/hid/ipts/eds2.c b/drivers/hid/ipts/eds2.c +new file mode 100644 +index 000000000000..639940794615 +--- /dev/null ++++ b/drivers/hid/ipts/eds2.c +@@ -0,0 +1,145 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "desc.h" ++#include "eds2.h" ++#include "spec-data.h" ++ ++int ipts_eds2_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size) ++{ ++ size_t size = 0; ++ u8 *buffer = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!desc_buffer) ++ return -EFAULT; ++ ++ if (!desc_size) ++ return -EFAULT; ++ ++ size = sizeof(ipts_singletouch_descriptor) + ipts->descriptor.size; ++ ++ buffer = kzalloc(size, GFP_KERNEL); ++ if (!buffer) ++ return -ENOMEM; ++ ++ memcpy(buffer, ipts_singletouch_descriptor, sizeof(ipts_singletouch_descriptor)); ++ memcpy(&buffer[sizeof(ipts_singletouch_descriptor)], ipts->descriptor.address, ++ ipts->descriptor.size); ++ ++ *desc_size = size; ++ *desc_buffer = buffer; ++ ++ return 0; ++} ++ ++static int ipts_eds2_get_feature(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum ipts_feedback_data_type type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ mutex_lock(&ipts->feature_lock); ++ ++ memset(buffer, 0, size); ++ buffer[0] = report_id; ++ ++ memset(&ipts->feature_report, 0, sizeof(ipts->feature_report)); ++ reinit_completion(&ipts->feature_event); ++ ++ ret = ipts_control_hid2me_feedback(ipts, IPTS_FEEDBACK_CMD_TYPE_NONE, type, buffer, size); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to send hid2me feedback: %d\n", ret); ++ goto out; ++ } ++ ++ ret = wait_for_completion_timeout(&ipts->feature_event, msecs_to_jiffies(5000)); ++ if (ret == 0) { ++ dev_warn(ipts->dev, "GET_FEATURES timed out!\n"); ++ ret = -EIO; ++ goto out; ++ } ++ ++ if (!ipts->feature_report.address) { ++ ret = -EFAULT; ++ goto out; ++ } ++ ++ if (ipts->feature_report.size > size) { ++ ret = -ETOOSMALL; ++ goto out; ++ } ++ ++ ret = ipts->feature_report.size; ++ memcpy(buffer, ipts->feature_report.address, ipts->feature_report.size); ++ ++out: ++ mutex_unlock(&ipts->feature_lock); ++ return ret; ++} ++ ++static int ipts_eds2_set_feature(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum ipts_feedback_data_type type) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ buffer[0] = report_id; ++ ++ ret = ipts_control_hid2me_feedback(ipts, IPTS_FEEDBACK_CMD_TYPE_NONE, type, buffer, size); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send hid2me feedback: %d\n", ret); ++ ++ return ret; ++} ++ ++int ipts_eds2_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type) ++{ ++ enum ipts_feedback_data_type feedback_type = IPTS_FEEDBACK_DATA_TYPE_VENDOR; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (report_type == HID_OUTPUT_REPORT && request_type == HID_REQ_SET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT; ++ else if (report_type == HID_FEATURE_REPORT && request_type == HID_REQ_GET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES; ++ else if (report_type == HID_FEATURE_REPORT && request_type == HID_REQ_SET_REPORT) ++ feedback_type = IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES; ++ else ++ return -EIO; ++ ++ if (request_type == HID_REQ_GET_REPORT) ++ return ipts_eds2_get_feature(ipts, buffer, size, report_id, feedback_type); ++ else ++ return ipts_eds2_set_feature(ipts, buffer, size, report_id, feedback_type); ++} +diff --git a/drivers/hid/ipts/eds2.h b/drivers/hid/ipts/eds2.h +new file mode 100644 +index 000000000000..064e3716907a +--- /dev/null ++++ b/drivers/hid/ipts/eds2.h +@@ -0,0 +1,35 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++ ++#include "context.h" ++ ++/** ++ * ipts_eds2_get_descriptor() - Assembles the HID descriptor of the device. ++ * @ipts: The IPTS driver context. ++ * @desc_buffer: A pointer to the location where the address of the allocated buffer is stored. ++ * @desc_size: A pointer to the location where the size of the allocated buffer is stored. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds2_get_descriptor(struct ipts_context *ipts, u8 **desc_buffer, size_t *desc_size); ++ ++/** ++ * ipts_eds2_raw_request() - Executes an output or feature report on the device. ++ * @ipts: The IPTS driver context. ++ * @buffer: The buffer containing the report. ++ * @size: The size of the buffer. ++ * @report_id: The HID report ID. ++ * @report_type: Whether this report is an output or a feature report. ++ * @request_type: Whether this report requests or sends data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_eds2_raw_request(struct ipts_context *ipts, u8 *buffer, size_t size, u8 report_id, ++ enum hid_report_type report_type, enum hid_class_request request_type); +diff --git a/drivers/hid/ipts/hid.c b/drivers/hid/ipts/hid.c +new file mode 100644 +index 000000000000..e34a1a4f9fa7 +--- /dev/null ++++ b/drivers/hid/ipts/hid.c +@@ -0,0 +1,225 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "desc.h" ++#include "eds1.h" ++#include "eds2.h" ++#include "hid.h" ++#include "spec-data.h" ++#include "spec-hid.h" ++ ++void ipts_hid_enable(struct ipts_context *ipts) ++{ ++ WRITE_ONCE(ipts->hid_active, true); ++} ++ ++void ipts_hid_disable(struct ipts_context *ipts) ++{ ++ WRITE_ONCE(ipts->hid_active, false); ++} ++ ++static int ipts_hid_start(struct hid_device *hid) ++{ ++ return 0; ++} ++ ++static void ipts_hid_stop(struct hid_device *hid) ++{ ++} ++ ++static int ipts_hid_parse(struct hid_device *hid) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ u8 *buffer = NULL; ++ size_t size = 0; ++ ++ if (!hid) ++ return -ENODEV; ++ ++ ipts = hid->driver_data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ if (ipts->info.intf_eds == 1) ++ ret = ipts_eds1_get_descriptor(ipts, &buffer, &size); ++ else ++ ret = ipts_eds2_get_descriptor(ipts, &buffer, &size); ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to allocate HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ ret = hid_parse_report(hid, buffer, size); ++ kfree(buffer); ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to parse HID descriptor: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int ipts_hid_raw_request(struct hid_device *hid, unsigned char report_id, __u8 *buffer, ++ size_t size, unsigned char report_type, int request_type) ++{ ++ struct ipts_context *ipts = NULL; ++ ++ if (!hid) ++ return -ENODEV; ++ ++ ipts = hid->driver_data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ if (ipts->info.intf_eds == 1) { ++ return ipts_eds1_raw_request(ipts, buffer, size, report_id, report_type, ++ request_type); ++ } else { ++ return ipts_eds2_raw_request(ipts, buffer, size, report_id, report_type, ++ request_type); ++ } ++} ++ ++static struct hid_ll_driver ipts_hid_driver = { ++ .start = ipts_hid_start, ++ .stop = ipts_hid_stop, ++ .open = ipts_hid_start, ++ .close = ipts_hid_stop, ++ .parse = ipts_hid_parse, ++ .raw_request = ipts_hid_raw_request, ++}; ++ ++int ipts_hid_input_data(struct ipts_context *ipts, u32 buffer) ++{ ++ u8 *temp = NULL; ++ struct ipts_hid_header *frame = NULL; ++ struct ipts_data_header *header = NULL; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->hid) ++ return -ENODEV; ++ ++ if (!READ_ONCE(ipts->hid_active)) ++ return -ENODEV; ++ ++ header = (struct ipts_data_header *)ipts->resources.data[buffer].address; ++ ++ temp = ipts->resources.report.address; ++ memset(temp, 0, ipts->resources.report.size); ++ ++ if (!header) ++ return -EFAULT; ++ ++ if (header->size == 0) ++ return 0; ++ ++ if (header->type == IPTS_DATA_TYPE_HID) ++ return hid_input_report(ipts->hid, HID_INPUT_REPORT, header->data, header->size, 1); ++ ++ if (header->type == IPTS_DATA_TYPE_GET_FEATURES) { ++ ipts->feature_report.address = header->data; ++ ipts->feature_report.size = header->size; ++ ++ complete_all(&ipts->feature_event); ++ return 0; ++ } ++ ++ if (header->type != IPTS_DATA_TYPE_FRAME) ++ return 0; ++ ++ if (header->size + 3 + sizeof(struct ipts_hid_header) > IPTS_HID_REPORT_DATA_SIZE) ++ return -ERANGE; ++ ++ /* ++ * Synthesize a HID report matching the devices that natively send HID reports ++ */ ++ temp[0] = IPTS_HID_REPORT_DATA; ++ ++ frame = (struct ipts_hid_header *)&temp[3]; ++ frame->type = IPTS_HID_FRAME_TYPE_RAW; ++ frame->size = header->size + sizeof(*frame); ++ ++ memcpy(frame->data, header->data, header->size); ++ ++ return hid_input_report(ipts->hid, HID_INPUT_REPORT, temp, IPTS_HID_REPORT_DATA_SIZE, 1); ++} ++ ++int ipts_hid_init(struct ipts_context *ipts, struct ipts_device_info info) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->hid) ++ return 0; ++ ++ ipts->hid = hid_allocate_device(); ++ if (IS_ERR(ipts->hid)) { ++ int err = PTR_ERR(ipts->hid); ++ ++ dev_err(ipts->dev, "Failed to allocate HID device: %d\n", err); ++ return err; ++ } ++ ++ ipts->hid->driver_data = ipts; ++ ipts->hid->dev.parent = ipts->dev; ++ ipts->hid->ll_driver = &ipts_hid_driver; ++ ++ ipts->hid->vendor = info.vendor; ++ ipts->hid->product = info.product; ++ ipts->hid->group = HID_GROUP_GENERIC; ++ ++ snprintf(ipts->hid->name, sizeof(ipts->hid->name), "IPTS %04X:%04X", info.vendor, ++ info.product); ++ ++ ret = hid_add_device(ipts->hid); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to add HID device: %d\n", ret); ++ ipts_hid_free(ipts); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_hid_free(struct ipts_context *ipts) ++{ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (!ipts->hid) ++ return 0; ++ ++ hid_destroy_device(ipts->hid); ++ ipts->hid = NULL; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/hid.h b/drivers/hid/ipts/hid.h +new file mode 100644 +index 000000000000..1ebe77447903 +--- /dev/null ++++ b/drivers/hid/ipts/hid.h +@@ -0,0 +1,24 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2022-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_HID_H ++#define IPTS_HID_H ++ ++#include ++ ++#include "context.h" ++#include "spec-device.h" ++ ++void ipts_hid_enable(struct ipts_context *ipts); ++void ipts_hid_disable(struct ipts_context *ipts); ++ ++int ipts_hid_input_data(struct ipts_context *ipts, u32 buffer); ++ ++int ipts_hid_init(struct ipts_context *ipts, struct ipts_device_info info); ++int ipts_hid_free(struct ipts_context *ipts); ++ ++#endif /* IPTS_HID_H */ +diff --git a/drivers/hid/ipts/main.c b/drivers/hid/ipts/main.c +new file mode 100644 +index 000000000000..fb5b5c13ee3e +--- /dev/null ++++ b/drivers/hid/ipts/main.c +@@ -0,0 +1,126 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "control.h" ++#include "mei.h" ++#include "receiver.h" ++#include "spec-device.h" ++ ++/* ++ * The MEI client ID for IPTS functionality. ++ */ ++#define IPTS_ID UUID_LE(0x3e8d0870, 0x271a, 0x4208, 0x8e, 0xb5, 0x9a, 0xcb, 0x94, 0x02, 0xae, 0x04) ++ ++static int ipts_set_dma_mask(struct mei_cl_device *cldev) ++{ ++ if (!cldev) ++ return -EFAULT; ++ ++ if (!dma_coerce_mask_and_coherent(&cldev->dev, DMA_BIT_MASK(64))) ++ return 0; ++ ++ return dma_coerce_mask_and_coherent(&cldev->dev, DMA_BIT_MASK(32)); ++} ++ ++static int ipts_probe(struct mei_cl_device *cldev, const struct mei_cl_device_id *id) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) ++ return -EFAULT; ++ ++ ret = ipts_set_dma_mask(cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to set DMA mask for IPTS: %d\n", ret); ++ return ret; ++ } ++ ++ ret = mei_cldev_enable(cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to enable MEI device: %d\n", ret); ++ return ret; ++ } ++ ++ ipts = devm_kzalloc(&cldev->dev, sizeof(*ipts), GFP_KERNEL); ++ if (!ipts) { ++ mei_cldev_disable(cldev); ++ return -ENOMEM; ++ } ++ ++ ret = ipts_mei_init(&ipts->mei, cldev); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to init MEI bus logic: %d\n", ret); ++ return ret; ++ } ++ ++ ipts->dev = &cldev->dev; ++ ipts->mode = IPTS_MODE_EVENT; ++ ++ mutex_init(&ipts->feature_lock); ++ init_completion(&ipts->feature_event); ++ ++ mei_cldev_set_drvdata(cldev, ipts); ++ ++ ret = ipts_control_start(ipts); ++ if (ret) { ++ dev_err(&cldev->dev, "Failed to start IPTS: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static void ipts_remove(struct mei_cl_device *cldev) ++{ ++ int ret = 0; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) { ++ pr_err("MEI device is NULL!"); ++ return; ++ } ++ ++ ipts = mei_cldev_get_drvdata(cldev); ++ ++ ret = ipts_control_stop(ipts); ++ if (ret) ++ dev_err(&cldev->dev, "Failed to stop IPTS: %d\n", ret); ++ ++ mei_cldev_disable(cldev); ++} ++ ++static struct mei_cl_device_id ipts_device_id_table[] = { ++ { .uuid = IPTS_ID, .version = MEI_CL_VERSION_ANY }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(mei, ipts_device_id_table); ++ ++static struct mei_cl_driver ipts_driver = { ++ .id_table = ipts_device_id_table, ++ .name = "ipts", ++ .probe = ipts_probe, ++ .remove = ipts_remove, ++}; ++module_mei_cl_driver(ipts_driver); ++ ++MODULE_DESCRIPTION("IPTS touchscreen driver"); ++MODULE_AUTHOR("Dorian Stoll "); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/hid/ipts/mei.c b/drivers/hid/ipts/mei.c +new file mode 100644 +index 000000000000..1e0395ceae4a +--- /dev/null ++++ b/drivers/hid/ipts/mei.c +@@ -0,0 +1,188 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "context.h" ++#include "mei.h" ++ ++static void locked_list_add(struct list_head *new, struct list_head *head, ++ struct rw_semaphore *lock) ++{ ++ down_write(lock); ++ list_add(new, head); ++ up_write(lock); ++} ++ ++static void locked_list_del(struct list_head *entry, struct rw_semaphore *lock) ++{ ++ down_write(lock); ++ list_del(entry); ++ up_write(lock); ++} ++ ++static void ipts_mei_incoming(struct mei_cl_device *cldev) ++{ ++ ssize_t ret = 0; ++ struct ipts_mei_message *entry = NULL; ++ struct ipts_context *ipts = NULL; ++ ++ if (!cldev) { ++ pr_err("MEI device is NULL!"); ++ return; ++ } ++ ++ ipts = mei_cldev_get_drvdata(cldev); ++ if (!ipts) { ++ pr_err("IPTS driver context is NULL!"); ++ return; ++ } ++ ++ entry = devm_kzalloc(ipts->dev, sizeof(*entry), GFP_KERNEL); ++ if (!entry) ++ return; ++ ++ INIT_LIST_HEAD(&entry->list); ++ ++ do { ++ ret = mei_cldev_recv(cldev, (u8 *)&entry->rsp, sizeof(entry->rsp)); ++ } while (ret == -EINTR); ++ ++ if (ret < 0) { ++ dev_err(ipts->dev, "Error while reading response: %ld\n", ret); ++ return; ++ } ++ ++ if (ret == 0) { ++ dev_err(ipts->dev, "Received empty response\n"); ++ return; ++ } ++ ++ locked_list_add(&entry->list, &ipts->mei.messages, &ipts->mei.message_lock); ++ wake_up_all(&ipts->mei.message_queue); ++} ++ ++static int ipts_mei_search(struct ipts_mei *mei, enum ipts_command_code code, ++ struct ipts_response *rsp) ++{ ++ struct ipts_mei_message *entry = NULL; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!rsp) ++ return -EFAULT; ++ ++ down_read(&mei->message_lock); ++ ++ /* ++ * Iterate over the list of received messages, and check if there is one ++ * matching the requested command code. ++ */ ++ list_for_each_entry(entry, &mei->messages, list) { ++ if (entry->rsp.cmd == code) ++ break; ++ } ++ ++ up_read(&mei->message_lock); ++ ++ /* ++ * If entry is not the list head, this means that the loop above has been stopped early, ++ * and that we found a matching element. We drop the message from the list and return it. ++ */ ++ if (!list_entry_is_head(entry, &mei->messages, list)) { ++ locked_list_del(&entry->list, &mei->message_lock); ++ ++ *rsp = entry->rsp; ++ devm_kfree(&mei->cldev->dev, entry); ++ ++ return 0; ++ } ++ ++ return -EAGAIN; ++} ++ ++int ipts_mei_recv(struct ipts_mei *mei, enum ipts_command_code code, struct ipts_response *rsp, ++ u64 timeout) ++{ ++ int ret = 0; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ /* ++ * A timeout of 0 means check and return immideately. ++ */ ++ if (timeout == 0) ++ return ipts_mei_search(mei, code, rsp); ++ ++ /* ++ * A timeout of less than 0 means to wait forever. ++ */ ++ if (timeout < 0) { ++ wait_event(mei->message_queue, ipts_mei_search(mei, code, rsp) == 0); ++ return 0; ++ } ++ ++ ret = wait_event_timeout(mei->message_queue, ipts_mei_search(mei, code, rsp) == 0, ++ msecs_to_jiffies(timeout)); ++ ++ if (ret > 0) ++ return 0; ++ ++ return -EAGAIN; ++} ++ ++int ipts_mei_send(struct ipts_mei *mei, void *data, size_t length) ++{ ++ int ret = 0; ++ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!mei->cldev) ++ return -EFAULT; ++ ++ if (!data) ++ return -EFAULT; ++ ++ do { ++ ret = mei_cldev_send(mei->cldev, (u8 *)data, length); ++ } while (ret == -EINTR); ++ ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++int ipts_mei_init(struct ipts_mei *mei, struct mei_cl_device *cldev) ++{ ++ if (!mei) ++ return -EFAULT; ++ ++ if (!cldev) ++ return -EFAULT; ++ ++ mei->cldev = cldev; ++ ++ INIT_LIST_HEAD(&mei->messages); ++ init_waitqueue_head(&mei->message_queue); ++ init_rwsem(&mei->message_lock); ++ ++ mei_cldev_register_rx_cb(cldev, ipts_mei_incoming); ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/mei.h b/drivers/hid/ipts/mei.h +new file mode 100644 +index 000000000000..973bade6b0fd +--- /dev/null ++++ b/drivers/hid/ipts/mei.h +@@ -0,0 +1,66 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_MEI_H ++#define IPTS_MEI_H ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "spec-device.h" ++ ++struct ipts_mei_message { ++ struct list_head list; ++ struct ipts_response rsp; ++}; ++ ++struct ipts_mei { ++ struct mei_cl_device *cldev; ++ ++ struct list_head messages; ++ ++ wait_queue_head_t message_queue; ++ struct rw_semaphore message_lock; ++}; ++ ++/** ++ * ipts_mei_recv() - Receive data from a MEI device. ++ * @mei: The IPTS MEI device context. ++ * @code: The IPTS command code to look for. ++ * @rsp: The address that the received data will be copied to. ++ * @timeout: How many milliseconds the function will wait at most. ++ * ++ * A negative timeout means to wait forever. ++ * ++ * Returns: 0 on success, <0 on error, -EAGAIN if no response has been received. ++ */ ++int ipts_mei_recv(struct ipts_mei *mei, enum ipts_command_code code, struct ipts_response *rsp, ++ u64 timeout); ++ ++/** ++ * ipts_mei_send() - Send data to a MEI device. ++ * @ipts: The IPTS MEI device context. ++ * @data: The data to send. ++ * @size: The size of the data. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_mei_send(struct ipts_mei *mei, void *data, size_t length); ++ ++/** ++ * ipts_mei_init() - Initialize the MEI device context. ++ * @mei: The MEI device context to initialize. ++ * @cldev: The MEI device the context will be bound to. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_mei_init(struct ipts_mei *mei, struct mei_cl_device *cldev); ++ ++#endif /* IPTS_MEI_H */ +diff --git a/drivers/hid/ipts/receiver.c b/drivers/hid/ipts/receiver.c +new file mode 100644 +index 000000000000..977724c728c3 +--- /dev/null ++++ b/drivers/hid/ipts/receiver.c +@@ -0,0 +1,251 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "cmd.h" ++#include "context.h" ++#include "control.h" ++#include "hid.h" ++#include "receiver.h" ++#include "resources.h" ++#include "spec-device.h" ++#include "thread.h" ++ ++static void ipts_receiver_next_doorbell(struct ipts_context *ipts) ++{ ++ u32 *doorbell = (u32 *)ipts->resources.doorbell.address; ++ *doorbell = *doorbell + 1; ++} ++ ++static u32 ipts_receiver_current_doorbell(struct ipts_context *ipts) ++{ ++ u32 *doorbell = (u32 *)ipts->resources.doorbell.address; ++ return *doorbell; ++} ++ ++static void ipts_receiver_backoff(time64_t last, u32 n) ++{ ++ /* ++ * If the last change was less than n seconds ago, ++ * sleep for a shorter period so that new data can be ++ * processed quickly. If there was no change for more than ++ * n seconds, sleep longer to avoid wasting CPU cycles. ++ */ ++ if (last + n > ktime_get_seconds()) ++ usleep_range(1 * USEC_PER_MSEC, 5 * USEC_PER_MSEC); ++ else ++ msleep(200); ++} ++ ++static int ipts_receiver_event_loop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ u32 buffer = 0; ++ ++ struct ipts_context *ipts = NULL; ++ time64_t last = ktime_get_seconds(); ++ ++ if (!thread) ++ return -EFAULT; ++ ++ ipts = thread->data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "IPTS running in event mode\n"); ++ ++ while (!ipts_thread_should_stop(thread)) { ++ int i = 0; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_control_wait_data(ipts, false); ++ if (ret == -EAGAIN) ++ break; ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ continue; ++ } ++ ++ buffer = ipts_receiver_current_doorbell(ipts) % IPTS_BUFFERS; ++ ipts_receiver_next_doorbell(ipts); ++ ++ ret = ipts_hid_input_data(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to process buffer: %d\n", ret); ++ ++ ret = ipts_control_refill_buffer(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send feedback: %d\n", ret); ++ ++ ret = ipts_control_request_data(ipts); ++ if (ret) ++ dev_err(ipts->dev, "Failed to request data: %d\n", ret); ++ ++ last = ktime_get_seconds(); ++ } ++ ++ ipts_receiver_backoff(last, 5); ++ } ++ ++ ret = ipts_control_request_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request flush: %d\n", ret); ++ return ret; ++ } ++ ++ ret = ipts_control_wait_data(ipts, true); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ ret = ipts_control_wait_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for flush: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ return 0; ++} ++ ++static int ipts_receiver_poll_loop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ u32 buffer = 0; ++ ++ u32 doorbell = 0; ++ u32 lastdb = 0; ++ ++ struct ipts_context *ipts = NULL; ++ time64_t last = ktime_get_seconds(); ++ ++ if (!thread) ++ return -EFAULT; ++ ++ ipts = thread->data; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ dev_info(ipts->dev, "IPTS running in poll mode\n"); ++ ++ while (true) { ++ if (ipts_thread_should_stop(thread)) { ++ ret = ipts_control_request_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to request flush: %d\n", ret); ++ return ret; ++ } ++ } ++ ++ doorbell = ipts_receiver_current_doorbell(ipts); ++ ++ /* ++ * After filling up one of the data buffers, IPTS will increment ++ * the doorbell. The value of the doorbell stands for the *next* ++ * buffer that IPTS is going to fill. ++ */ ++ while (lastdb != doorbell) { ++ buffer = lastdb % IPTS_BUFFERS; ++ ++ ret = ipts_hid_input_data(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to process buffer: %d\n", ret); ++ ++ ret = ipts_control_refill_buffer(ipts, buffer); ++ if (ret) ++ dev_err(ipts->dev, "Failed to send feedback: %d\n", ret); ++ ++ last = ktime_get_seconds(); ++ lastdb++; ++ } ++ ++ if (ipts_thread_should_stop(thread)) ++ break; ++ ++ ipts_receiver_backoff(last, 5); ++ } ++ ++ ret = ipts_control_wait_data(ipts, true); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for data: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ ret = ipts_control_wait_flush(ipts); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to wait for flush: %d\n", ret); ++ ++ if (ret != -EAGAIN) ++ return ret; ++ else ++ return 0; ++ } ++ ++ return 0; ++} ++ ++int ipts_receiver_start(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ if (ipts->mode == IPTS_MODE_EVENT) { ++ ret = ipts_thread_start(&ipts->receiver_loop, ipts_receiver_event_loop, ipts, ++ "ipts_event"); ++ } else if (ipts->mode == IPTS_MODE_POLL) { ++ ret = ipts_thread_start(&ipts->receiver_loop, ipts_receiver_poll_loop, ipts, ++ "ipts_poll"); ++ } else { ++ ret = -EINVAL; ++ } ++ ++ if (ret) { ++ dev_err(ipts->dev, "Failed to start receiver loop: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++int ipts_receiver_stop(struct ipts_context *ipts) ++{ ++ int ret = 0; ++ ++ if (!ipts) ++ return -EFAULT; ++ ++ ret = ipts_thread_stop(&ipts->receiver_loop); ++ if (ret) { ++ dev_err(ipts->dev, "Failed to stop receiver loop: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/receiver.h b/drivers/hid/ipts/receiver.h +new file mode 100644 +index 000000000000..3de7da62d40c +--- /dev/null ++++ b/drivers/hid/ipts/receiver.h +@@ -0,0 +1,16 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_RECEIVER_H ++#define IPTS_RECEIVER_H ++ ++#include "context.h" ++ ++int ipts_receiver_start(struct ipts_context *ipts); ++int ipts_receiver_stop(struct ipts_context *ipts); ++ ++#endif /* IPTS_RECEIVER_H */ +diff --git a/drivers/hid/ipts/resources.c b/drivers/hid/ipts/resources.c +new file mode 100644 +index 000000000000..cc14653b2a9f +--- /dev/null ++++ b/drivers/hid/ipts/resources.c +@@ -0,0 +1,131 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++ ++#include "desc.h" ++#include "resources.h" ++#include "spec-device.h" ++ ++static int ipts_resources_alloc_buffer(struct ipts_buffer *buffer, struct device *dev, size_t size) ++{ ++ if (!buffer) ++ return -EFAULT; ++ ++ if (buffer->address) ++ return 0; ++ ++ buffer->address = dma_alloc_coherent(dev, size, &buffer->dma_address, GFP_KERNEL); ++ ++ if (!buffer->address) ++ return -ENOMEM; ++ ++ buffer->size = size; ++ buffer->device = dev; ++ ++ return 0; ++} ++ ++static void ipts_resources_free_buffer(struct ipts_buffer *buffer) ++{ ++ if (!buffer->address) ++ return; ++ ++ dma_free_coherent(buffer->device, buffer->size, buffer->address, buffer->dma_address); ++ ++ buffer->address = NULL; ++ buffer->size = 0; ++ ++ buffer->dma_address = 0; ++ buffer->device = NULL; ++} ++ ++int ipts_resources_init(struct ipts_resources *res, struct device *dev, size_t ds, size_t fs) ++{ ++ int ret = 0; ++ ++ /* ++ * Some compilers (AOSP clang) complain about a redefined ++ * variable when this is declared inside of the for loop. ++ */ ++ int i = 0; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_resources_alloc_buffer(&res->data[i], dev, ds); ++ if (ret) ++ goto err; ++ } ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) { ++ ret = ipts_resources_alloc_buffer(&res->feedback[i], dev, fs); ++ if (ret) ++ goto err; ++ } ++ ++ ret = ipts_resources_alloc_buffer(&res->doorbell, dev, sizeof(u32)); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->workqueue, dev, sizeof(u32)); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->hid2me, dev, fs); ++ if (ret) ++ goto err; ++ ++ ret = ipts_resources_alloc_buffer(&res->descriptor, dev, ds + 8); ++ if (ret) ++ goto err; ++ ++ if (!res->report.address) { ++ res->report.size = IPTS_HID_REPORT_DATA_SIZE; ++ res->report.address = kzalloc(res->report.size, GFP_KERNEL); ++ ++ if (!res->report.address) { ++ ret = -ENOMEM; ++ goto err; ++ } ++ } ++ ++ return 0; ++ ++err: ++ ++ ipts_resources_free(res); ++ return ret; ++} ++ ++int ipts_resources_free(struct ipts_resources *res) ++{ ++ int i = 0; ++ ++ if (!res) ++ return -EFAULT; ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) ++ ipts_resources_free_buffer(&res->data[i]); ++ ++ for (i = 0; i < IPTS_BUFFERS; i++) ++ ipts_resources_free_buffer(&res->feedback[i]); ++ ++ ipts_resources_free_buffer(&res->doorbell); ++ ipts_resources_free_buffer(&res->workqueue); ++ ipts_resources_free_buffer(&res->hid2me); ++ ipts_resources_free_buffer(&res->descriptor); ++ ++ kfree(res->report.address); ++ res->report.address = NULL; ++ res->report.size = 0; ++ ++ return 0; ++} +diff --git a/drivers/hid/ipts/resources.h b/drivers/hid/ipts/resources.h +new file mode 100644 +index 000000000000..2068e13285f0 +--- /dev/null ++++ b/drivers/hid/ipts/resources.h +@@ -0,0 +1,41 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_RESOURCES_H ++#define IPTS_RESOURCES_H ++ ++#include ++#include ++ ++#include "spec-device.h" ++ ++struct ipts_buffer { ++ u8 *address; ++ size_t size; ++ ++ dma_addr_t dma_address; ++ struct device *device; ++}; ++ ++struct ipts_resources { ++ struct ipts_buffer data[IPTS_BUFFERS]; ++ struct ipts_buffer feedback[IPTS_BUFFERS]; ++ ++ struct ipts_buffer doorbell; ++ struct ipts_buffer workqueue; ++ struct ipts_buffer hid2me; ++ ++ struct ipts_buffer descriptor; ++ ++ // Buffer for synthesizing HID reports ++ struct ipts_buffer report; ++}; ++ ++int ipts_resources_init(struct ipts_resources *res, struct device *dev, size_t ds, size_t fs); ++int ipts_resources_free(struct ipts_resources *res); ++ ++#endif /* IPTS_RESOURCES_H */ +diff --git a/drivers/hid/ipts/spec-data.h b/drivers/hid/ipts/spec-data.h +new file mode 100644 +index 000000000000..e8dd98895a7e +--- /dev/null ++++ b/drivers/hid/ipts/spec-data.h +@@ -0,0 +1,100 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2016 Intel Corporation ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_DATA_H ++#define IPTS_SPEC_DATA_H ++ ++#include ++#include ++ ++/** ++ * enum ipts_feedback_cmd_type - Commands that can be executed on the sensor through feedback. ++ */ ++enum ipts_feedback_cmd_type { ++ IPTS_FEEDBACK_CMD_TYPE_NONE = 0, ++ IPTS_FEEDBACK_CMD_TYPE_SOFT_RESET = 1, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_ARMED = 2, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SENSING = 3, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_SLEEP = 4, ++ IPTS_FEEDBACK_CMD_TYPE_GOTO_DOZE = 5, ++ IPTS_FEEDBACK_CMD_TYPE_HARD_RESET = 6, ++}; ++ ++/** ++ * enum ipts_feedback_data_type - Defines what data a feedback buffer contains. ++ * @IPTS_FEEDBACK_DATA_TYPE_VENDOR: The buffer contains vendor specific feedback. ++ * @IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES: The buffer contains a HID set features report. ++ * @IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES: The buffer contains a HID get features report. ++ * @IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT: The buffer contains a HID output report. ++ * @IPTS_FEEDBACK_DATA_TYPE_STORE_DATA: The buffer contains calibration data for the sensor. ++ */ ++enum ipts_feedback_data_type { ++ IPTS_FEEDBACK_DATA_TYPE_VENDOR = 0, ++ IPTS_FEEDBACK_DATA_TYPE_SET_FEATURES = 1, ++ IPTS_FEEDBACK_DATA_TYPE_GET_FEATURES = 2, ++ IPTS_FEEDBACK_DATA_TYPE_OUTPUT_REPORT = 3, ++ IPTS_FEEDBACK_DATA_TYPE_STORE_DATA = 4, ++}; ++ ++/** ++ * struct ipts_feedback_header - Header that is prefixed to the data in a feedback buffer. ++ * @cmd_type: A command that should be executed on the sensor. ++ * @size: The size of the payload to be written. ++ * @buffer: The ID of the buffer that contains this feedback data. ++ * @protocol: The protocol version of the EDS. ++ * @data_type: The type of data that the buffer contains. ++ * @spi_offset: The offset at which to write the payload data to the sensor. ++ * @payload: Payload for the feedback command, or 0 if no payload is sent. ++ */ ++struct ipts_feedback_header { ++ enum ipts_feedback_cmd_type cmd_type; ++ u32 size; ++ u32 buffer; ++ u32 protocol; ++ enum ipts_feedback_data_type data_type; ++ u32 spi_offset; ++ u8 reserved[40]; ++ u8 payload[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_feedback_header) == 64); ++ ++/** ++ * enum ipts_data_type - Defines what type of data a buffer contains. ++ * @IPTS_DATA_TYPE_FRAME: Raw data frame. ++ * @IPTS_DATA_TYPE_ERROR: Error data. ++ * @IPTS_DATA_TYPE_VENDOR: Vendor specific data. ++ * @IPTS_DATA_TYPE_HID: A HID report. ++ * @IPTS_DATA_TYPE_GET_FEATURES: The response to a GET_FEATURES HID2ME command. ++ */ ++enum ipts_data_type { ++ IPTS_DATA_TYPE_FRAME = 0x00, ++ IPTS_DATA_TYPE_ERROR = 0x01, ++ IPTS_DATA_TYPE_VENDOR = 0x02, ++ IPTS_DATA_TYPE_HID = 0x03, ++ IPTS_DATA_TYPE_GET_FEATURES = 0x04, ++ IPTS_DATA_TYPE_DESCRIPTOR = 0x05, ++}; ++ ++/** ++ * struct ipts_data_header - Header that is prefixed to the data in a data buffer. ++ * @type: What data the buffer contains. ++ * @size: How much data the buffer contains. ++ * @buffer: Which buffer the data is in. ++ */ ++struct ipts_data_header { ++ enum ipts_data_type type; ++ u32 size; ++ u32 buffer; ++ u8 reserved[52]; ++ u8 data[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_data_header) == 64); ++ ++#endif /* IPTS_SPEC_DATA_H */ +diff --git a/drivers/hid/ipts/spec-device.h b/drivers/hid/ipts/spec-device.h +new file mode 100644 +index 000000000000..41845f9d9025 +--- /dev/null ++++ b/drivers/hid/ipts/spec-device.h +@@ -0,0 +1,290 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2016 Intel Corporation ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_DEVICE_H ++#define IPTS_SPEC_DEVICE_H ++ ++#include ++#include ++ ++/* ++ * The amount of buffers that IPTS can use for data transfer. ++ */ ++#define IPTS_BUFFERS 16 ++ ++/* ++ * The buffer ID that is used for HID2ME feedback ++ */ ++#define IPTS_HID2ME_BUFFER IPTS_BUFFERS ++ ++/** ++ * enum ipts_command - Commands that can be sent to the IPTS hardware. ++ * @IPTS_CMD_GET_DEVICE_INFO: Retrieves vendor information from the device. ++ * @IPTS_CMD_SET_MODE: Changes the mode that the device will operate in. ++ * @IPTS_CMD_SET_MEM_WINDOW: Configures memory buffers for passing data between device and driver. ++ * @IPTS_CMD_QUIESCE_IO: Stops the data flow from the device to the driver. ++ * @IPTS_CMD_READY_FOR_DATA: Informs the device that the driver is ready to receive data. ++ * @IPTS_CMD_FEEDBACK: Informs the device that a buffer was processed and can be refilled. ++ * @IPTS_CMD_CLEAR_MEM_WINDOW: Stops the data flow and clears the buffer addresses on the device. ++ * @IPTS_CMD_RESET_SENSOR: Resets the sensor to its default state. ++ * @IPTS_CMD_GET_DESCRIPTOR: Retrieves the HID descriptor of the device. ++ */ ++enum ipts_command_code { ++ IPTS_CMD_GET_DEVICE_INFO = 0x01, ++ IPTS_CMD_SET_MODE = 0x02, ++ IPTS_CMD_SET_MEM_WINDOW = 0x03, ++ IPTS_CMD_QUIESCE_IO = 0x04, ++ IPTS_CMD_READY_FOR_DATA = 0x05, ++ IPTS_CMD_FEEDBACK = 0x06, ++ IPTS_CMD_CLEAR_MEM_WINDOW = 0x07, ++ IPTS_CMD_RESET_SENSOR = 0x0B, ++ IPTS_CMD_GET_DESCRIPTOR = 0x0F, ++}; ++ ++/** ++ * enum ipts_status - Possible status codes returned by the IPTS device. ++ * @IPTS_STATUS_SUCCESS: Operation completed successfully. ++ * @IPTS_STATUS_INVALID_PARAMS: Command contained an invalid payload. ++ * @IPTS_STATUS_ACCESS_DENIED: ME could not validate a buffer address. ++ * @IPTS_STATUS_CMD_SIZE_ERROR: Command contains an invalid payload. ++ * @IPTS_STATUS_NOT_READY: Buffer addresses have not been set. ++ * @IPTS_STATUS_REQUEST_OUTSTANDING: There is an outstanding command of the same type. ++ * @IPTS_STATUS_NO_SENSOR_FOUND: No sensor could be found. ++ * @IPTS_STATUS_OUT_OF_MEMORY: Not enough free memory for requested operation. ++ * @IPTS_STATUS_INTERNAL_ERROR: An unexpected error occurred. ++ * @IPTS_STATUS_SENSOR_DISABLED: The sensor has been disabled and must be reinitialized. ++ * @IPTS_STATUS_COMPAT_CHECK_FAIL: Compatibility revision check between sensor and ME failed. ++ * The host can ignore this error and attempt to continue. ++ * @IPTS_STATUS_SENSOR_EXPECTED_RESET: The sensor went through a reset initiated by the driver. ++ * @IPTS_STATUS_SENSOR_UNEXPECTED_RESET: The sensor went through an unexpected reset. ++ * @IPTS_STATUS_RESET_FAILED: Requested sensor reset failed to complete. ++ * @IPTS_STATUS_TIMEOUT: The operation timed out. ++ * @IPTS_STATUS_TEST_MODE_FAIL: Test mode pattern did not match expected values. ++ * @IPTS_STATUS_SENSOR_FAIL_FATAL: The sensor reported an error during reset sequence. ++ * Further progress is not possible. ++ * @IPTS_STATUS_SENSOR_FAIL_NONFATAL: The sensor reported an error during reset sequence. ++ * The driver can attempt to continue. ++ * @IPTS_STATUS_INVALID_DEVICE_CAPS: The device reported invalid capabilities. ++ * @IPTS_STATUS_QUIESCE_IO_IN_PROGRESS: Command cannot be completed until Quiesce IO is done. ++ */ ++enum ipts_status { ++ IPTS_STATUS_SUCCESS = 0x00, ++ IPTS_STATUS_INVALID_PARAMS = 0x01, ++ IPTS_STATUS_ACCESS_DENIED = 0x02, ++ IPTS_STATUS_CMD_SIZE_ERROR = 0x03, ++ IPTS_STATUS_NOT_READY = 0x04, ++ IPTS_STATUS_REQUEST_OUTSTANDING = 0x05, ++ IPTS_STATUS_NO_SENSOR_FOUND = 0x06, ++ IPTS_STATUS_OUT_OF_MEMORY = 0x07, ++ IPTS_STATUS_INTERNAL_ERROR = 0x08, ++ IPTS_STATUS_SENSOR_DISABLED = 0x09, ++ IPTS_STATUS_COMPAT_CHECK_FAIL = 0x0A, ++ IPTS_STATUS_SENSOR_EXPECTED_RESET = 0x0B, ++ IPTS_STATUS_SENSOR_UNEXPECTED_RESET = 0x0C, ++ IPTS_STATUS_RESET_FAILED = 0x0D, ++ IPTS_STATUS_TIMEOUT = 0x0E, ++ IPTS_STATUS_TEST_MODE_FAIL = 0x0F, ++ IPTS_STATUS_SENSOR_FAIL_FATAL = 0x10, ++ IPTS_STATUS_SENSOR_FAIL_NONFATAL = 0x11, ++ IPTS_STATUS_INVALID_DEVICE_CAPS = 0x12, ++ IPTS_STATUS_QUIESCE_IO_IN_PROGRESS = 0x13, ++}; ++ ++/** ++ * struct ipts_command - Message that is sent to the device for calling a command. ++ * @cmd: The command that will be called. ++ * @payload: Payload containing parameters for the called command. ++ */ ++struct ipts_command { ++ enum ipts_command_code cmd; ++ u8 payload[320]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_command) == 324); ++ ++/** ++ * enum ipts_mode - Configures what data the device produces and how its sent. ++ * @IPTS_MODE_EVENT: The device will send an event once a buffer was filled. ++ * Older devices will return singletouch data in this mode. ++ * @IPTS_MODE_POLL: The device will notify the driver by incrementing the doorbell value. ++ * Older devices will return multitouch data in this mode. ++ */ ++enum ipts_mode { ++ IPTS_MODE_EVENT = 0x00, ++ IPTS_MODE_POLL = 0x01, ++}; ++ ++/** ++ * struct ipts_set_mode - Payload for the SET_MODE command. ++ * @mode: Changes the mode that IPTS will operate in. ++ */ ++struct ipts_set_mode { ++ enum ipts_mode mode; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_set_mode) == 16); ++ ++#define IPTS_WORKQUEUE_SIZE 8192 ++#define IPTS_WORKQUEUE_ITEM_SIZE 16 ++ ++/** ++ * struct ipts_mem_window - Payload for the SET_MEM_WINDOW command. ++ * @data_addr_lower: Lower 32 bits of the data buffer addresses. ++ * @data_addr_upper: Upper 32 bits of the data buffer addresses. ++ * @workqueue_addr_lower: Lower 32 bits of the workqueue buffer address. ++ * @workqueue_addr_upper: Upper 32 bits of the workqueue buffer address. ++ * @doorbell_addr_lower: Lower 32 bits of the doorbell buffer address. ++ * @doorbell_addr_upper: Upper 32 bits of the doorbell buffer address. ++ * @feedbackaddr_lower: Lower 32 bits of the feedback buffer addresses. ++ * @feedbackaddr_upper: Upper 32 bits of the feedback buffer addresses. ++ * @hid2me_addr_lower: Lower 32 bits of the hid2me buffer address. ++ * @hid2me_addr_upper: Upper 32 bits of the hid2me buffer address. ++ * @hid2me_size: Size of the hid2me feedback buffer. ++ * @workqueue_item_size: Magic value. Must be 16. ++ * @workqueue_size: Magic value. Must be 8192. ++ * ++ * The workqueue related items in this struct are required for using ++ * GuC submission with binary processing firmware. Since this driver does ++ * not use GuC submission and instead exports raw data to userspace, these ++ * items are not actually used, but they need to be allocated and passed ++ * to the device, otherwise initialization will fail. ++ */ ++struct ipts_mem_window { ++ u32 data_addr_lower[IPTS_BUFFERS]; ++ u32 data_addr_upper[IPTS_BUFFERS]; ++ u32 workqueue_addr_lower; ++ u32 workqueue_addr_upper; ++ u32 doorbell_addr_lower; ++ u32 doorbell_addr_upper; ++ u32 feedback_addr_lower[IPTS_BUFFERS]; ++ u32 feedback_addr_upper[IPTS_BUFFERS]; ++ u32 hid2me_addr_lower; ++ u32 hid2me_addr_upper; ++ u32 hid2me_size; ++ u8 reserved1; ++ u8 workqueue_item_size; ++ u16 workqueue_size; ++ u8 reserved[32]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_mem_window) == 320); ++ ++/** ++ * struct ipts_quiesce_io - Payload for the QUIESCE_IO command. ++ */ ++struct ipts_quiesce_io { ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_quiesce_io) == 12); ++ ++/** ++ * struct ipts_feedback - Payload for the FEEDBACK command. ++ * @buffer: The buffer that the device should refill. ++ */ ++struct ipts_feedback { ++ u32 buffer; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_feedback) == 16); ++ ++/** ++ * enum ipts_reset_type - Possible ways of resetting the device. ++ * @IPTS_RESET_TYPE_HARD: Perform hardware reset using GPIO pin. ++ * @IPTS_RESET_TYPE_SOFT: Perform software reset using SPI command. ++ */ ++enum ipts_reset_type { ++ IPTS_RESET_TYPE_HARD = 0x00, ++ IPTS_RESET_TYPE_SOFT = 0x01, ++}; ++ ++/** ++ * struct ipts_reset - Payload for the RESET_SENSOR command. ++ * @type: How the device should get reset. ++ */ ++struct ipts_reset_sensor { ++ enum ipts_reset_type type; ++ u8 reserved[4]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_reset_sensor) == 8); ++ ++/** ++ * struct ipts_get_descriptor - Payload for the GET_DESCRIPTOR command. ++ * @addr_lower: The lower 32 bits of the descriptor buffer address. ++ * @addr_upper: The upper 32 bits of the descriptor buffer address. ++ * @magic: A magic value. Must be 8. ++ */ ++struct ipts_get_descriptor { ++ u32 addr_lower; ++ u32 addr_upper; ++ u32 magic; ++ u8 reserved[12]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_get_descriptor) == 24); ++ ++/* ++ * The type of a response is indicated by a ++ * command code, with the most significant bit flipped to 1. ++ */ ++#define IPTS_RSP_BIT BIT(31) ++ ++/** ++ * struct ipts_response - Data returned from the device in response to a command. ++ * @cmd: The command that this response answers (IPTS_RSP_BIT will be 1). ++ * @status: The return code of the command. ++ * @payload: The data that was produced by the command. ++ */ ++struct ipts_response { ++ enum ipts_command_code cmd; ++ enum ipts_status status; ++ u8 payload[80]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_response) == 88); ++ ++/** ++ * struct ipts_device_info - Vendor information of the IPTS device. ++ * @vendor: Vendor ID of this device. ++ * @product: Product ID of this device. ++ * @hw_version: Hardware revision of this device. ++ * @fw_version: Firmware revision of this device. ++ * @data_size: Requested size for a data buffer. ++ * @feedback_size: Requested size for a feedback buffer. ++ * @mode: Mode that the device currently operates in. ++ * @max_contacts: Maximum amount of concurrent touches the sensor can process. ++ * @sensor_min_eds: The minimum EDS version supported by the sensor. ++ * @sensor_max_eds: The maximum EDS version supported by the sensor. ++ * @me_min_eds: The minimum EDS version supported by the ME for communicating with the sensor. ++ * @me_max_eds: The maximum EDS version supported by the ME for communicating with the sensor. ++ * @intf_eds: The EDS version implemented by the interface between ME and host. ++ */ ++struct ipts_device_info { ++ u16 vendor; ++ u16 product; ++ u32 hw_version; ++ u32 fw_version; ++ u32 data_size; ++ u32 feedback_size; ++ enum ipts_mode mode; ++ u8 max_contacts; ++ u8 reserved1[3]; ++ u8 sensor_min_eds; ++ u8 sensor_maj_eds; ++ u8 me_min_eds; ++ u8 me_maj_eds; ++ u8 intf_eds; ++ u8 reserved2[11]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_device_info) == 44); ++ ++#endif /* IPTS_SPEC_DEVICE_H */ +diff --git a/drivers/hid/ipts/spec-hid.h b/drivers/hid/ipts/spec-hid.h +new file mode 100644 +index 000000000000..5a58d4a0a610 +--- /dev/null ++++ b/drivers/hid/ipts/spec-hid.h +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2020-2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_SPEC_HID_H ++#define IPTS_SPEC_HID_H ++ ++#include ++#include ++ ++/* ++ * Made-up type for passing raw IPTS data in a HID report. ++ */ ++#define IPTS_HID_FRAME_TYPE_RAW 0xEE ++ ++/** ++ * struct ipts_hid_frame - Header that is prefixed to raw IPTS data wrapped in a HID report. ++ * @size: Size of the data inside the report, including this header. ++ * @type: What type of data does this report contain. ++ */ ++struct ipts_hid_header { ++ u32 size; ++ u8 reserved1; ++ u8 type; ++ u8 reserved2; ++ u8 data[]; ++} __packed; ++ ++static_assert(sizeof(struct ipts_hid_header) == 7); ++ ++#endif /* IPTS_SPEC_HID_H */ +diff --git a/drivers/hid/ipts/thread.c b/drivers/hid/ipts/thread.c +new file mode 100644 +index 000000000000..355e92bea26f +--- /dev/null ++++ b/drivers/hid/ipts/thread.c +@@ -0,0 +1,84 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "thread.h" ++ ++bool ipts_thread_should_stop(struct ipts_thread *thread) ++{ ++ if (!thread) ++ return false; ++ ++ return READ_ONCE(thread->should_stop); ++} ++ ++static int ipts_thread_runner(void *data) ++{ ++ int ret = 0; ++ struct ipts_thread *thread = data; ++ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!thread->threadfn) ++ return -EFAULT; ++ ++ ret = thread->threadfn(thread); ++ complete_all(&thread->done); ++ ++ return ret; ++} ++ ++int ipts_thread_start(struct ipts_thread *thread, int (*threadfn)(struct ipts_thread *thread), ++ void *data, const char *name) ++{ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!threadfn) ++ return -EFAULT; ++ ++ init_completion(&thread->done); ++ ++ thread->data = data; ++ thread->should_stop = false; ++ thread->threadfn = threadfn; ++ ++ thread->thread = kthread_run(ipts_thread_runner, thread, name); ++ return PTR_ERR_OR_ZERO(thread->thread); ++} ++ ++int ipts_thread_stop(struct ipts_thread *thread) ++{ ++ int ret = 0; ++ ++ if (!thread) ++ return -EFAULT; ++ ++ if (!thread->thread) ++ return 0; ++ ++ WRITE_ONCE(thread->should_stop, true); ++ ++ /* ++ * Make sure that the write has gone through before waiting. ++ */ ++ wmb(); ++ ++ wait_for_completion(&thread->done); ++ ret = kthread_stop(thread->thread); ++ ++ thread->thread = NULL; ++ thread->data = NULL; ++ thread->threadfn = NULL; ++ ++ return ret; ++} +diff --git a/drivers/hid/ipts/thread.h b/drivers/hid/ipts/thread.h +new file mode 100644 +index 000000000000..1f966b8b32c4 +--- /dev/null ++++ b/drivers/hid/ipts/thread.h +@@ -0,0 +1,59 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright (c) 2023 Dorian Stoll ++ * ++ * Linux driver for Intel Precise Touch & Stylus ++ */ ++ ++#ifndef IPTS_THREAD_H ++#define IPTS_THREAD_H ++ ++#include ++#include ++#include ++ ++/* ++ * This wrapper over kthread is necessary, because calling kthread_stop makes it impossible ++ * to issue MEI commands from that thread while it shuts itself down. By using a custom ++ * boolean variable and a completion object, we can call kthread_stop only when the thread ++ * already finished all of its work and has returned. ++ */ ++struct ipts_thread { ++ struct task_struct *thread; ++ ++ bool should_stop; ++ struct completion done; ++ ++ void *data; ++ int (*threadfn)(struct ipts_thread *thread); ++}; ++ ++/** ++ * ipts_thread_should_stop() - Returns true if the thread is asked to terminate. ++ * @thread: The current thread. ++ * ++ * Returns: true if the thread should stop, false if not. ++ */ ++bool ipts_thread_should_stop(struct ipts_thread *thread); ++ ++/** ++ * ipts_thread_start() - Starts an IPTS thread. ++ * @thread: The thread to initialize and start. ++ * @threadfn: The function to execute. ++ * @data: An argument that will be passed to threadfn. ++ * @name: The name of the new thread. ++ * ++ * Returns: 0 on success, <0 on error. ++ */ ++int ipts_thread_start(struct ipts_thread *thread, int (*threadfn)(struct ipts_thread *thread), ++ void *data, const char name[]); ++ ++/** ++ * ipts_thread_stop() - Asks the thread to terminate and waits until it has finished. ++ * @thread: The thread that should stop. ++ * ++ * Returns: The return value of the thread function. ++ */ ++int ipts_thread_stop(struct ipts_thread *thread); ++ ++#endif /* IPTS_THREAD_H */ +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch b/runtime-kernel/linux-kernel/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch new file mode 100644 index 00000000000..4b0b41ebd58 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0117-SURFACE-ACPI-delay-enumeration-of-devices-with-a-_DE.patch @@ -0,0 +1,79 @@ +From d965abd62ec5a3a38a5a9763b972c61335176eca Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 10 Oct 2021 20:56:57 +0200 +Subject: [PATCH 117/156] SURFACE: ACPI: delay enumeration of devices with a + _DEP pointing to an INT3472 device + +The clk and regulator frameworks expect clk/regulator consumer-devices +to have info about the consumed clks/regulators described in the device's +fw_node. + +To work around cases where this info is not present in the firmware tables, +which is often the case on x86/ACPI devices, both frameworks allow the +provider-driver to attach info about consumers to the clks/regulators +when registering these. + +This causes problems with the probe ordering wrt drivers for consumers +of these clks/regulators. Since the lookups are only registered when the +provider-driver binds, trying to get these clks/regulators before then +results in a -ENOENT error for clks and a dummy regulator for regulators. + +One case where we hit this issue is camera sensors such as e.g. the OV8865 +sensor found on the Microsoft Surface Go. The sensor uses clks, regulators +and GPIOs provided by a TPS68470 PMIC which is described in an INT3472 +ACPI device. There is special platform code handling this and setting +platform_data with the necessary consumer info on the MFD cells +instantiated for the PMIC under: drivers/platform/x86/intel/int3472. + +For this to work properly the ov8865 driver must not bind to the I2C-client +for the OV8865 sensor until after the TPS68470 PMIC gpio, regulator and +clk MFD cells have all been fully setup. + +The OV8865 on the Microsoft Surface Go is just one example, all X86 +devices using the Intel IPU3 camera block found on recent Intel SoCs +have similar issues where there is an INT3472 HID ACPI-device, which +describes the clks and regulators, and the driver for this INT3472 device +must be fully initialized before the sensor driver (any sensor driver) +binds for things to work properly. + +On these devices the ACPI nodes describing the sensors all have a _DEP +dependency on the matching INT3472 ACPI device (there is one per sensor). + +This allows solving the probe-ordering problem by delaying the enumeration +(instantiation of the I2C-client in the ov8865 example) of ACPI-devices +which have a _DEP dependency on an INT3472 device. + +The new acpi_dev_ready_for_enumeration() helper used for this is also +exported because for devices, which have the enumeration_by_parent flag +set, the parent-driver will do its own scan of child ACPI devices and +it will try to enumerate those during its probe(). Code doing this such +as e.g. the i2c-core-acpi.c code must call this new helper to ensure +that it too delays the enumeration until all the _DEP dependencies are +met on devices which have the new honor_deps flag set. + +Signed-off-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/60b2e713e86789d7d6f7f28a46f8fa32c181a56a +Signed-off-by: Kexy Biscuit +--- + drivers/acpi/scan.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index 22ae7829a915..0fe281280316 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -2185,6 +2185,9 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, + + static void acpi_default_enumeration(struct acpi_device *device) + { ++ if (!acpi_dev_ready_for_enumeration(device)) ++ return; ++ + /* + * Do not enumerate devices with enumeration_by_parent flag set as + * they will be enumerated by their respective parents. +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch b/runtime-kernel/linux-kernel/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch new file mode 100644 index 00000000000..6334f4e77c2 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0118-SURFACE-iommu-intel-ipu-use-IOMMU-passthrough-mode-f.patch @@ -0,0 +1,114 @@ +From e697b7a02970bd52b5b2aa0f98a91fa12ace671c Mon Sep 17 00:00:00 2001 +From: zouxiaoh +Date: Fri, 25 Jun 2021 08:52:59 +0800 +Subject: [PATCH 118/156] SURFACE: iommu: intel-ipu: use IOMMU passthrough mode + for Intel IPUs + +Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, +The IPU driver allocates its own page table that is not mapped +via the DMA, and thus the Intel IOMMU driver blocks access giving +this error: DMAR: DRHD: handling fault status reg 3 DMAR: +[DMA Read] Request device [00:05.0] PASID ffffffff +fault addr 76406000 [fault reason 06] PTE Read access is not set +As IPU is not an external facing device which is not risky, so use +IOMMU passthrough mode for Intel IPUs. + +Change-Id: I6dcccdadac308cf42e20a18e1b593381391e3e6b +Depends-On: Iacd67578e8c6a9b9ac73285f52b4081b72fb68a6 +Tracked-On: #JIITL8-411 +Signed-off-by: Bingbu Cao +Signed-off-by: zouxiaoh +Signed-off-by: Xu Chongyang +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/a06834b1abe43c0afbb5f4a1e1a1e85f249cab18 +Signed-off-by: Kexy Biscuit +--- + drivers/iommu/intel/iommu.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index dea755f15010..c8406641ba9d 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -45,6 +45,13 @@ + ((pdev)->vendor == PCI_VENDOR_ID_INTEL && (pdev)->device == 0x34E4) \ + ) + ++#define IS_INTEL_IPU(pdev) ((pdev)->vendor == PCI_VENDOR_ID_INTEL && \ ++ ((pdev)->device == 0x9a19 || \ ++ (pdev)->device == 0x9a39 || \ ++ (pdev)->device == 0x4e19 || \ ++ (pdev)->device == 0x465d || \ ++ (pdev)->device == 0x1919)) ++ + #define IOAPIC_RANGE_START (0xfee00000) + #define IOAPIC_RANGE_END (0xfeefffff) + #define IOVA_START_ADDR (0x1000) +@@ -223,12 +230,14 @@ int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + + static int dmar_map_ipts = 1; ++static int dmar_map_ipu = 1; + static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; + + #define IDENTMAP_AZALIA 4 ++#define IDENTMAP_IPU 8 + #define IDENTMAP_IPTS 16 + + const struct iommu_ops intel_iommu_ops; +@@ -2164,6 +2173,9 @@ static int device_def_domain_type(struct device *dev) + if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) + return IOMMU_DOMAIN_IDENTITY; + ++ if ((iommu_identity_mapping & IDENTMAP_IPU) && IS_INTEL_IPU(pdev)) ++ return IOMMU_DOMAIN_IDENTITY; ++ + if ((iommu_identity_mapping & IDENTMAP_IPTS) && IS_IPTS(pdev)) + return IOMMU_DOMAIN_IDENTITY; + } +@@ -2466,6 +2478,9 @@ static int __init init_dmars(void) + iommu_set_root_entry(iommu); + } + ++ if (!dmar_map_ipu) ++ iommu_identity_mapping |= IDENTMAP_IPU; ++ + if (!dmar_map_ipts) + iommu_identity_mapping |= IDENTMAP_IPTS; + +@@ -4714,6 +4729,18 @@ static void quirk_iommu_igfx(struct pci_dev *dev) + disable_igfx_iommu = 1; + } + ++static void quirk_iommu_ipu(struct pci_dev *dev) ++{ ++ if (!IS_INTEL_IPU(dev)) ++ return; ++ ++ if (risky_device(dev)) ++ return; ++ ++ pci_info(dev, "Passthrough IOMMU for integrated Intel IPU\n"); ++ dmar_map_ipu = 0; ++} ++ + static void quirk_iommu_ipts(struct pci_dev *dev) + { + if (!IS_IPTS(dev)) +@@ -4764,6 +4791,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1632, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163A, quirk_iommu_igfx); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx); + ++/* disable IPU dmar support */ ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_iommu_ipu); ++ + /* disable IPTS dmar support */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9D3E, quirk_iommu_ipts); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x34E4, quirk_iommu_ipts); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch b/runtime-kernel/linux-kernel/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch new file mode 100644 index 00000000000..7271bd5327d --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0119-SURFACE-platform-x86-int3472-Enable-I2c-daisy-chain.patch @@ -0,0 +1,41 @@ +From 2de25b51d1baf0ee51b20375f36fcecfc6564a54 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Sun, 10 Oct 2021 20:57:02 +0200 +Subject: [PATCH 119/156] SURFACE: platform/x86: int3472: Enable I2c daisy + chain + +The TPS68470 PMIC has an I2C passthrough mode through which I2C traffic +can be forwarded to a device connected to the PMIC as though it were +connected directly to the system bus. Enable this mode when the chip +is initialised. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/11ccfff2684694956fb2156f8216c1275a6bd97d +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/tps68470.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c +index 1e107fd49f82..e3e1696e7f0e 100644 +--- a/drivers/platform/x86/intel/int3472/tps68470.c ++++ b/drivers/platform/x86/intel/int3472/tps68470.c +@@ -46,6 +46,13 @@ static int tps68470_chip_init(struct device *dev, struct regmap *regmap) + return ret; + } + ++ /* Enable I2C daisy chain */ ++ ret = regmap_write(regmap, TPS68470_REG_S_I2C_CTL, 0x03); ++ if (ret) { ++ dev_err(dev, "Failed to enable i2c daisy chain\n"); ++ return ret; ++ } ++ + dev_info(dev, "TPS68470 REVID: 0x%02x\n", version); + + return 0; +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch b/runtime-kernel/linux-kernel/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch new file mode 100644 index 00000000000..a6228342ae3 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0120-SURFACE-platform-x86-int3472-Remap-reset-GPIO-for-IN.patch @@ -0,0 +1,60 @@ +From 90996eea1e8d05e24276376378641c969d867e5f Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Thu, 2 Mar 2023 12:59:39 +0000 +Subject: [PATCH 120/156] SURFACE: platform/x86: int3472: Remap reset GPIO for + INT347E + +ACPI _HID INT347E represents the OmniVision 7251 camera sensor. The +driver for this sensor expects a single pin named "enable", but on +some Microsoft Surface platforms the sensor is assigned a single +GPIO who's type flag is INT3472_GPIO_TYPE_RESET. + +Remap the GPIO pin's function from "reset" to "enable". This is done +outside of the existing remap table since it is a more widespread +discrepancy than that method is designed for. Additionally swap the +polarity of the pin to match the driver's expectation. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/469d8067637b158a501d8fa221cf7f922c021345 +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/discrete.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c +index 07b302e09340..baad1e50ca81 100644 +--- a/drivers/platform/x86/intel/int3472/discrete.c ++++ b/drivers/platform/x86/intel/int3472/discrete.c +@@ -83,12 +83,27 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 + const char *func, u32 polarity) + { + int ret; ++ const struct acpi_device_id ov7251_ids[] = { ++ { "INT347E" }, ++ { } ++ }; + + if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { + dev_warn(int3472->dev, "Too many GPIOs mapped\n"); + return -EINVAL; + } + ++ /* ++ * In addition to the function remap table we need to bulk remap the ++ * "reset" GPIO for the OmniVision 7251 sensor, as the driver for that ++ * expects its only GPIO pin to be called "enable" (and to have the ++ * opposite polarity). ++ */ ++ if (!strcmp(func, "reset") && !acpi_match_device_ids(int3472->sensor, ov7251_ids)) { ++ func = "enable"; ++ polarity ^= GPIO_ACTIVE_LOW; ++ } ++ + ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], + agpio, func, polarity); + if (ret) +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch b/runtime-kernel/linux-kernel/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch new file mode 100644 index 00000000000..91fd8e986e5 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0121-SURFACE-media-i2c-Clarify-that-gain-is-Analogue-gain.patch @@ -0,0 +1,43 @@ +From a0612bf68bf671155ffeae359e2f75e6472a5346 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Tue, 21 Mar 2023 13:45:26 +0000 +Subject: [PATCH 121/156] SURFACE: media: i2c: Clarify that gain is Analogue + gain in OV7251 + +Update the control ID for the gain control in the ov7251 driver to +V4L2_CID_ANALOGUE_GAIN. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/7a741f318b87a42d351d142512d55f0407a7e9e3 +Signed-off-by: Kexy Biscuit +--- + drivers/media/i2c/ov7251.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c +index 30f61e04ecaf..9c1292ca8552 100644 +--- a/drivers/media/i2c/ov7251.c ++++ b/drivers/media/i2c/ov7251.c +@@ -1051,7 +1051,7 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl) + case V4L2_CID_EXPOSURE: + ret = ov7251_set_exposure(ov7251, ctrl->val); + break; +- case V4L2_CID_GAIN: ++ case V4L2_CID_ANALOGUE_GAIN: + ret = ov7251_set_gain(ov7251, ctrl->val); + break; + case V4L2_CID_TEST_PATTERN: +@@ -1572,7 +1572,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251) + ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, + V4L2_CID_EXPOSURE, 1, 32, 1, 32); + ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, +- V4L2_CID_GAIN, 16, 1023, 1, 16); ++ V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 16); + v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops, + V4L2_CID_TEST_PATTERN, + ARRAY_SIZE(ov7251_test_pattern_menu) - 1, +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch b/runtime-kernel/linux-kernel/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch new file mode 100644 index 00000000000..71b68ac5b3c --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0122-SURFACE-media-v4l2-core-Acquire-privacy-led-in-v4l2_.patch @@ -0,0 +1,54 @@ +From 2d2860b836c3921a51d4a42b5986590019057d87 Mon Sep 17 00:00:00 2001 +From: Daniel Scally +Date: Wed, 22 Mar 2023 11:01:42 +0000 +Subject: [PATCH 122/156] SURFACE: media: v4l2-core: Acquire privacy led in + v4l2_async_register_subdev() + +The current call to v4l2_subdev_get_privacy_led() is contained in +v4l2_async_register_subdev_sensor(), but that function isn't used by +all the sensor drivers. Move the acquisition of the privacy led to +v4l2_async_register_subdev() instead. + +Signed-off-by: Daniel Scally +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8baca29ff57339999c716555b4f1d961abbec3b2 +Signed-off-by: Kexy Biscuit +--- + drivers/media/v4l2-core/v4l2-async.c | 4 ++++ + drivers/media/v4l2-core/v4l2-fwnode.c | 4 ---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c +index ee884a8221fb..4f6bafd900ee 100644 +--- a/drivers/media/v4l2-core/v4l2-async.c ++++ b/drivers/media/v4l2-core/v4l2-async.c +@@ -799,6 +799,10 @@ int __v4l2_async_register_subdev(struct v4l2_subdev *sd, struct module *module) + + INIT_LIST_HEAD(&sd->asc_list); + ++ ret = v4l2_subdev_get_privacy_led(sd); ++ if (ret < 0) ++ return ret; ++ + /* + * No reference taken. The reference is held by the device (struct + * v4l2_subdev.dev), and async sub-device does not exist independently +diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c +index f19c8adf2c61..923ed1b5ab8b 100644 +--- a/drivers/media/v4l2-core/v4l2-fwnode.c ++++ b/drivers/media/v4l2-core/v4l2-fwnode.c +@@ -1219,10 +1219,6 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd) + + v4l2_async_subdev_nf_init(notifier, sd); + +- ret = v4l2_subdev_get_privacy_led(sd); +- if (ret < 0) +- goto out_cleanup; +- + ret = v4l2_async_nf_parse_fwnode_sensor(sd->dev, notifier); + if (ret < 0) + goto out_cleanup; +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch b/runtime-kernel/linux-kernel/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch new file mode 100644 index 00000000000..5b3b9765c74 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0123-SURFACE-platform-x86-int3472-Add-MFD-cell-for-tps684.patch @@ -0,0 +1,45 @@ +From ca62bdbc1712c83421700245f2d5dd3f435ebf66 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:16 +0800 +Subject: [PATCH 123/156] SURFACE: platform: x86: int3472: Add MFD cell for + tps68470 LED + +Add MFD cell for tps68470-led. + +Reviewed-by: Daniel Scally +Signed-off-by: Kate Hsuan +Reviewed-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/fbcac39c13e09ce4cc8ad3d4520fd03863eb52f0 +Signed-off-by: Kexy Biscuit +--- + drivers/platform/x86/intel/int3472/tps68470.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c +index e3e1696e7f0e..423dc555093f 100644 +--- a/drivers/platform/x86/intel/int3472/tps68470.c ++++ b/drivers/platform/x86/intel/int3472/tps68470.c +@@ -17,7 +17,7 @@ + #define DESIGNED_FOR_CHROMEOS 1 + #define DESIGNED_FOR_WINDOWS 2 + +-#define TPS68470_WIN_MFD_CELL_COUNT 3 ++#define TPS68470_WIN_MFD_CELL_COUNT 4 + + static const struct mfd_cell tps68470_cros[] = { + { .name = "tps68470-gpio" }, +@@ -200,7 +200,8 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) + cells[1].name = "tps68470-regulator"; + cells[1].platform_data = (void *)board_data->tps68470_regulator_pdata; + cells[1].pdata_size = sizeof(struct tps68470_regulator_platform_data); +- cells[2].name = "tps68470-gpio"; ++ cells[2].name = "tps68470-led"; ++ cells[3].name = "tps68470-gpio"; + + for (i = 0; i < board_data->n_gpiod_lookups; i++) + gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch new file mode 100644 index 00000000000..84904a30d6b --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0124-SURFACE-include-mfd-tps68470-Add-masks-for-LEDA-and-.patch @@ -0,0 +1,45 @@ +From e426dbcedd12f5438e66769e5467656ff50c6224 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:17 +0800 +Subject: [PATCH 124/156] SURFACE: include: mfd: tps68470: Add masks for LEDA + and LEDB + +Add flags for both LEDA(TPS68470_ILEDCTL_ENA), LEDB +(TPS68470_ILEDCTL_ENB), and current control mask for LEDB +(TPS68470_ILEDCTL_CTRLB) + +Reviewed-by: Daniel Scally +Reviewed-by: Hans de Goede +Signed-off-by: Kate Hsuan +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8bbe05d964175fdebb1cd0693aade238df967362 +Signed-off-by: Kexy Biscuit +--- + include/linux/mfd/tps68470.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/linux/mfd/tps68470.h b/include/linux/mfd/tps68470.h +index 7807fa329db0..2d2abb25b944 100644 +--- a/include/linux/mfd/tps68470.h ++++ b/include/linux/mfd/tps68470.h +@@ -34,6 +34,7 @@ + #define TPS68470_REG_SGPO 0x22 + #define TPS68470_REG_GPDI 0x26 + #define TPS68470_REG_GPDO 0x27 ++#define TPS68470_REG_ILEDCTL 0x28 + #define TPS68470_REG_VCMVAL 0x3C + #define TPS68470_REG_VAUX1VAL 0x3D + #define TPS68470_REG_VAUX2VAL 0x3E +@@ -94,4 +95,8 @@ + #define TPS68470_GPIO_MODE_OUT_CMOS 2 + #define TPS68470_GPIO_MODE_OUT_ODRAIN 3 + ++#define TPS68470_ILEDCTL_ENA BIT(2) ++#define TPS68470_ILEDCTL_ENB BIT(6) ++#define TPS68470_ILEDCTL_CTRLB GENMASK(5, 4) ++ + #endif /* __LINUX_MFD_TPS68470_H */ +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch b/runtime-kernel/linux-kernel/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch new file mode 100644 index 00000000000..2cac9d7f9c6 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0125-SURFACE-leds-tps68470-Add-LED-control-for-tps68470.patch @@ -0,0 +1,254 @@ +From b696a928f65d3727f87aeb97ec63a2cd83fb11d6 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 21 Mar 2023 23:37:18 +0800 +Subject: [PATCH 125/156] SURFACE: leds: tps68470: Add LED control for tps68470 + +There are two LED controllers, LEDA indicator LED and LEDB flash LED for +tps68470. LEDA can be enabled by setting TPS68470_ILEDCTL_ENA. Moreover, +tps68470 provides four levels of power status for LEDB. If the +properties called "ti,ledb-current" can be found, the current will be +set according to the property values. These two LEDs can be controlled +through the LED class of sysfs (tps68470-leda and tps68470-ledb). + +Signed-off-by: Kate Hsuan +Reviewed-by: Hans de Goede +Patchset: cameras + +Link: https://github.com/linux-surface/kernel/commit/8776136058fe2e8b5b1edaab6693448b37fa219d +Signed-off-by: Kexy Biscuit +--- + drivers/leds/Kconfig | 12 +++ + drivers/leds/Makefile | 1 + + drivers/leds/leds-tps68470.c | 185 +++++++++++++++++++++++++++++++++++ + 3 files changed, 198 insertions(+) + create mode 100644 drivers/leds/leds-tps68470.c + +diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig +index 8d9d8da376e4..d8597897aa83 100644 +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -933,6 +933,18 @@ config LEDS_TPS6105X + It is a single boost converter primarily for white LEDs and + audio amplifiers. + ++config LEDS_TPS68470 ++ tristate "LED support for TI TPS68470" ++ depends on LEDS_CLASS ++ depends on INTEL_SKL_INT3472 ++ help ++ This driver supports TPS68470 PMIC with LED chip. ++ It provides two LED controllers, with the ability to drive 2 ++ indicator LEDs and 2 flash LEDs. ++ ++ To compile this driver as a module, choose M and it will be ++ called leds-tps68470 ++ + config LEDS_IP30 + tristate "LED support for SGI Octane machines" + depends on LEDS_CLASS +diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile +index 18afbb5a23ee..a1d16c0af82d 100644 +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -88,6 +88,7 @@ obj-$(CONFIG_LEDS_TCA6507) += leds-tca6507.o + obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o + obj-$(CONFIG_LEDS_TLC591XX) += leds-tlc591xx.o + obj-$(CONFIG_LEDS_TPS6105X) += leds-tps6105x.o ++obj-$(CONFIG_LEDS_TPS68470) += leds-tps68470.o + obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds-turris-omnia.o + obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o + obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o +diff --git a/drivers/leds/leds-tps68470.c b/drivers/leds/leds-tps68470.c +new file mode 100644 +index 000000000000..35aeb5db89c8 +--- /dev/null ++++ b/drivers/leds/leds-tps68470.c +@@ -0,0 +1,185 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * LED driver for TPS68470 PMIC ++ * ++ * Copyright (C) 2023 Red Hat ++ * ++ * Authors: ++ * Kate Hsuan ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++#define lcdev_to_led(led_cdev) \ ++ container_of(led_cdev, struct tps68470_led, lcdev) ++ ++#define led_to_tps68470(led, index) \ ++ container_of(led, struct tps68470_device, leds[index]) ++ ++enum tps68470_led_ids { ++ TPS68470_ILED_A, ++ TPS68470_ILED_B, ++ TPS68470_NUM_LEDS ++}; ++ ++static const char *tps68470_led_names[] = { ++ [TPS68470_ILED_A] = "tps68470-iled_a", ++ [TPS68470_ILED_B] = "tps68470-iled_b", ++}; ++ ++struct tps68470_led { ++ unsigned int led_id; ++ struct led_classdev lcdev; ++}; ++ ++struct tps68470_device { ++ struct device *dev; ++ struct regmap *regmap; ++ struct tps68470_led leds[TPS68470_NUM_LEDS]; ++}; ++ ++enum ctrlb_current { ++ CTRLB_2MA = 0, ++ CTRLB_4MA = 1, ++ CTRLB_8MA = 2, ++ CTRLB_16MA = 3, ++}; ++ ++static int tps68470_brightness_set(struct led_classdev *led_cdev, enum led_brightness brightness) ++{ ++ struct tps68470_led *led = lcdev_to_led(led_cdev); ++ struct tps68470_device *tps68470 = led_to_tps68470(led, led->led_id); ++ struct regmap *regmap = tps68470->regmap; ++ ++ switch (led->led_id) { ++ case TPS68470_ILED_A: ++ return regmap_update_bits(regmap, TPS68470_REG_ILEDCTL, TPS68470_ILEDCTL_ENA, ++ brightness ? TPS68470_ILEDCTL_ENA : 0); ++ case TPS68470_ILED_B: ++ return regmap_update_bits(regmap, TPS68470_REG_ILEDCTL, TPS68470_ILEDCTL_ENB, ++ brightness ? TPS68470_ILEDCTL_ENB : 0); ++ } ++ return -EINVAL; ++} ++ ++static enum led_brightness tps68470_brightness_get(struct led_classdev *led_cdev) ++{ ++ struct tps68470_led *led = lcdev_to_led(led_cdev); ++ struct tps68470_device *tps68470 = led_to_tps68470(led, led->led_id); ++ struct regmap *regmap = tps68470->regmap; ++ int ret = 0; ++ int value = 0; ++ ++ ret = regmap_read(regmap, TPS68470_REG_ILEDCTL, &value); ++ if (ret) ++ return dev_err_probe(led_cdev->dev, -EINVAL, "failed on reading register\n"); ++ ++ switch (led->led_id) { ++ case TPS68470_ILED_A: ++ value = value & TPS68470_ILEDCTL_ENA; ++ break; ++ case TPS68470_ILED_B: ++ value = value & TPS68470_ILEDCTL_ENB; ++ break; ++ } ++ ++ return value ? LED_ON : LED_OFF; ++} ++ ++ ++static int tps68470_ledb_current_init(struct platform_device *pdev, ++ struct tps68470_device *tps68470) ++{ ++ int ret = 0; ++ unsigned int curr; ++ ++ /* configure LEDB current if the properties can be got */ ++ if (!device_property_read_u32(&pdev->dev, "ti,ledb-current", &curr)) { ++ if (curr > CTRLB_16MA) { ++ dev_err(&pdev->dev, ++ "Invalid LEDB current value: %d\n", ++ curr); ++ return -EINVAL; ++ } ++ ret = regmap_update_bits(tps68470->regmap, TPS68470_REG_ILEDCTL, ++ TPS68470_ILEDCTL_CTRLB, curr); ++ } ++ return ret; ++} ++ ++static int tps68470_leds_probe(struct platform_device *pdev) ++{ ++ int i = 0; ++ int ret = 0; ++ struct tps68470_device *tps68470; ++ struct tps68470_led *led; ++ struct led_classdev *lcdev; ++ ++ tps68470 = devm_kzalloc(&pdev->dev, sizeof(struct tps68470_device), ++ GFP_KERNEL); ++ if (!tps68470) ++ return -ENOMEM; ++ ++ tps68470->dev = &pdev->dev; ++ tps68470->regmap = dev_get_drvdata(pdev->dev.parent); ++ ++ for (i = 0; i < TPS68470_NUM_LEDS; i++) { ++ led = &tps68470->leds[i]; ++ lcdev = &led->lcdev; ++ ++ led->led_id = i; ++ ++ lcdev->name = devm_kasprintf(tps68470->dev, GFP_KERNEL, "%s::%s", ++ tps68470_led_names[i], LED_FUNCTION_INDICATOR); ++ if (!lcdev->name) ++ return -ENOMEM; ++ ++ lcdev->max_brightness = 1; ++ lcdev->brightness = 0; ++ lcdev->brightness_set_blocking = tps68470_brightness_set; ++ lcdev->brightness_get = tps68470_brightness_get; ++ lcdev->dev = &pdev->dev; ++ ++ ret = devm_led_classdev_register(tps68470->dev, lcdev); ++ if (ret) { ++ dev_err_probe(tps68470->dev, ret, ++ "error registering led\n"); ++ goto err_exit; ++ } ++ ++ if (i == TPS68470_ILED_B) { ++ ret = tps68470_ledb_current_init(pdev, tps68470); ++ if (ret) ++ goto err_exit; ++ } ++ } ++ ++err_exit: ++ if (ret) { ++ for (i = 0; i < TPS68470_NUM_LEDS; i++) { ++ if (tps68470->leds[i].lcdev.name) ++ devm_led_classdev_unregister(&pdev->dev, ++ &tps68470->leds[i].lcdev); ++ } ++ } ++ ++ return ret; ++} ++static struct platform_driver tps68470_led_driver = { ++ .driver = { ++ .name = "tps68470-led", ++ }, ++ .probe = tps68470_leds_probe, ++}; ++ ++module_platform_driver(tps68470_led_driver); ++ ++MODULE_ALIAS("platform:tps68470-led"); ++MODULE_DESCRIPTION("LED driver for TPS68470 PMIC"); ++MODULE_LICENSE("GPL v2"); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch b/runtime-kernel/linux-kernel/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch new file mode 100644 index 00000000000..a626625cf73 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0126-FROMEXT-media-staging-ipu3-imgu-Fix-multiple-calls-o.patch @@ -0,0 +1,51 @@ +From 0393c0b33816c961e4f3ebb6d4005b49da09a313 Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Sat, 3 Feb 2024 12:59:53 +0900 +Subject: [PATCH 126/156] FROMEXT: media: staging: ipu3-imgu: Fix multiple + calls of s_stream on stream stop + +Adapt to 009905e "media: v4l2-subdev: Document and enforce .s_stream() requirements" + +Patchset: cameras + +Signed-off-by: mojyack +Link: https://github.com/linux-surface/kernel/commit/6e4b702fd02830ba9de5ac4fbb2eae53b02aeedc +Signed-off-by: Kexy Biscuit +--- + drivers/staging/media/ipu3/ipu3-v4l2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c +index 3df58eb3e882..81aff2d5d898 100644 +--- a/drivers/staging/media/ipu3/ipu3-v4l2.c ++++ b/drivers/staging/media/ipu3/ipu3-v4l2.c +@@ -538,18 +538,18 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq) + + WARN_ON(!node->enabled); + +- pipe = node->pipe; +- dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); +- imgu_pipe = &imgu->imgu_pipe[pipe]; +- r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); +- if (r) +- dev_err(&imgu->pci_dev->dev, +- "failed to stop subdev streaming\n"); +- + mutex_lock(&imgu->streaming_lock); + /* Was this the first node with streaming disabled? */ + if (imgu->streaming && imgu_all_nodes_streaming(imgu, node)) { + /* Yes, really stop streaming now */ ++ pipe = node->pipe; ++ dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id); ++ imgu_pipe = &imgu->imgu_pipe[pipe]; ++ r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); ++ if (r) ++ dev_err(&imgu->pci_dev->dev, ++ "failed to stop subdev streaming\n"); ++ + dev_dbg(dev, "IMGU streaming is ready to stop"); + r = imgu_s_stream(imgu, false); + if (!r) +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch new file mode 100644 index 00000000000..74255411f9f --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0127-SURFACE-media-i2c-dw9719-fix-probe-error-on-surface-.patch @@ -0,0 +1,37 @@ +From b3b49a0b9fbab8cec0b2621fc798bb43f626209e Mon Sep 17 00:00:00 2001 +From: mojyack +Date: Tue, 26 Mar 2024 05:55:44 +0900 +Subject: [PATCH 127/156] SURFACE: media: i2c: dw9719: fix probe error on + surface go 2 + +On surface go 2, sometimes probing dw9719 fails with "dw9719: probe of i2c-INT347A:00-VCM failed with error -121". +The -121(-EREMOTEIO) is came from drivers/i2c/busses/i2c-designware-common.c:575, and indicates the initialize occurs too early. +So just add some delay. +There is no exact reason for this 10000us, but 100us failed. + +Patchset: cameras + +Signed-off-by: mojyack +Link: https://github.com/linux-surface/kernel/commit/3a0e7fc61359fbfd0fef1b35579fa8f5039bb8a3 +Signed-off-by: Kexy Biscuit +--- + drivers/media/i2c/dw9719.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c +index c626ed845928..0094cfda57ea 100644 +--- a/drivers/media/i2c/dw9719.c ++++ b/drivers/media/i2c/dw9719.c +@@ -82,6 +82,9 @@ static int dw9719_power_up(struct dw9719_device *dw9719) + if (ret) + return ret; + ++ /* Wait for device to be acknowledged */ ++ fsleep(10000); ++ + /* Jiggle SCL pin to wake up device */ + cci_write(dw9719->regmap, DW9719_CONTROL, 1, &ret); + +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch b/runtime-kernel/linux-kernel/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch similarity index 98% rename from runtime-kernel/linux-kernel/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch index 22f1ee4727f..b9695b1d466 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0108-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.8-r.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0128-FROMEXT-more-ISA-levels-and-uarches-for-kernel-6.1.7.patch @@ -1,8 +1,8 @@ -From a911568c0051b76fc34f28fcb68561d01ba6a312 Mon Sep 17 00:00:00 2001 +From 4ebb03279fdb32203eac9b928ca9c60869ec994e Mon Sep 17 00:00:00 2001 From: graysky Date: Mon, 16 Sep 2024 05:55:58 -0400 -Subject: [PATCH 108/136] FROMEXT: - more-ISA-levels-and-uarches-for-kernel-6.8-rc4+.patch +Subject: [PATCH 128/156] FROMEXT: + more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -108,7 +108,7 @@ See the following experimental evidence supporting this statement: https://github.com/graysky2/kernel_compiler_patch?tab=readme-ov-file#benchmarks REQUIREMENTS -linux version 6.8-rc3+ +linux version 6.1.79+ gcc version >=9.0 or clang version >=9.0 ACKNOWLEDGMENTS @@ -121,7 +121,7 @@ REFERENCES 4. http://www.linuxforge.net/docs/linux/linux-gcc.php Signed-off-by: graysky -Link: https://github.com/graysky2/kernel_compiler_patch/blob/3a8d20c0d22f8b63c0c78ca20e24a03dbb37b168/more-ISA-levels-and-uarches-for-kernel-6.8-rc4%2B.patch +Link: https://github.com/graysky2/kernel_compiler_patch/blob/44598c402184de0de4c9f0addce5771bf0eae0c4/more-ISA-levels-and-uarches-for-kernel-6.1.79%2B.patch Link: https://lore.kernel.org/all/W22JX8eWQctCiWIDKGjx4IUU4ZgYmKa1zPOZSKHHVZ74zpUEmVV1VoPMMNcyc-zhraUayW0d4d7OIUYZHuiEqllnAc1tB8DthZahsHZuw0Y=@proton.me/ Signed-off-by: Kexy Biscuit --- diff --git a/app-admin/kernel-tools/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch b/runtime-kernel/linux-kernel/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch index ba23754e0af..4506d8137ac 100644 --- a/app-admin/kernel-tools/autobuild/patches/0109-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0129-FROMEXT-LoongArch-Add-CPU-HWMon-platform-driver.patch @@ -1,14 +1,14 @@ -From f0db2d11dcaff201b6f20aebe3abcaa13367ef9d Mon Sep 17 00:00:00 2001 +From 2cb378eba6640c688786ac166396600cd4c9fc0b Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Thu, 29 Oct 2020 16:29:11 +0800 -Subject: [PATCH 109/136] FROMEXT: LoongArch: Add CPU HWMon platform driver +Subject: [PATCH 129/156] FROMEXT: LoongArch: Add CPU HWMon platform driver This add CPU HWMon (temperature sensor) platform driver for Loongson-3. Tested-by: Xi Ruoyao Signed-off-by: Huacai Chen -Link: https://github.com/chenhuacai/linux/commit/55f122a5d0997790ce33e18cac915a9417ec698e +Link: https://github.com/chenhuacai/linux/commit/0970ae1db5a4ec2016358a34bb7d0bf7b173b7bb Signed-off-by: Kexy Biscuit --- drivers/platform/loongarch/Kconfig | 8 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch b/runtime-kernel/linux-kernel/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch index 5b11a6e4c6d..babd9a84d97 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0110-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0130-FROMEXT-drivers-firmware-Move-sysfb_init-from-device.patch @@ -1,7 +1,7 @@ -From 6071f9365e3a38cd639c6e5c85917b9fbfdac862 Mon Sep 17 00:00:00 2001 +From b27650605906063f71586f4edaf940ee24e2e3c1 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Sun, 28 Jan 2024 14:07:46 +0800 -Subject: [PATCH 110/136] FROMEXT: drivers/firmware: Move sysfb_init() from +Subject: [PATCH 130/156] FROMEXT: drivers/firmware: Move sysfb_init() from device_initcall to fs_initcall Consider a configuration like this: @@ -36,7 +36,7 @@ fs_initcall function which is ensured after vgaarb initialization. Signed-off-by: Huacai Chen -Link: https://github.com/chenhuacai/linux/commit/323337772c6c4c7f30b503dfc23f46ff21f33c2f +Link: https://github.com/chenhuacai/linux/commit/a04a5bfb7c7a1b5b9041c03f8a282481aba5ed0c Signed-off-by: Kexy Biscuit --- drivers/firmware/sysfb.c | 2 +- diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch b/runtime-kernel/linux-kernel/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch deleted file mode 100644 index b4ec227dc29..00000000000 --- a/runtime-kernel/linux-kernel/autobuild/patches/0131-AOSCOS-Revert-drm-amdgpu-fix-contiguous-handling-for.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 2da47be49eeddfbc6857f73892cdb09713fa45fd Mon Sep 17 00:00:00 2001 -From: Mingcong Bai -Date: Mon, 2 Sep 2024 10:19:00 +0800 -Subject: [PATCH 131/136] AOSCOS: Revert "drm/amdgpu: fix contiguous handling - for IB parsing v2" - -This commit may have caused hardware decoding for H.264 to fail on GCN 1.0 -and 2.0 cards (AMD Radeon 520, R9 390X, etc.). Whilst playing such videos, -mpv crashes with the following output: - - amdgpu: The CS has been rejected, see dmesg for more information (-22). - -Kernel logs: - - [drm:amdgpu_uvd_pass2 [amdgpu]]: *ERROR* msg/fb buffer ff019e0000- - ff019e4000 out of 256MB segment! - -Issue currently tracked at: - - https://gitlab.freedesktop.org/drm/amd/-/issues/3599 - -This reverts commit f3572db3c049b4d32bb5ba77ad5305616c44c7c1. - -Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3599#note_2550915 -Signed-off-by: Kexy Biscuit ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -index 78b3c067fea7..a373b4b0103d 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c -@@ -1785,7 +1785,7 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, - struct ttm_operation_ctx ctx = { false, false }; - struct amdgpu_vm *vm = &fpriv->vm; - struct amdgpu_bo_va_mapping *mapping; -- int i, r; -+ int r; - - addr /= AMDGPU_GPU_PAGE_SIZE; - -@@ -1800,13 +1800,13 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, - if (dma_resv_locking_ctx((*bo)->tbo.base.resv) != &parser->exec.ticket) - return -EINVAL; - -- (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; -- amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); -- for (i = 0; i < (*bo)->placement.num_placement; i++) -- (*bo)->placements[i].flags |= TTM_PL_FLAG_CONTIGUOUS; -- r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); -- if (r) -- return r; -+ if (!((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) { -+ (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; -+ amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains); -+ r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx); -+ if (r) -+ return r; -+ } - - return amdgpu_ttm_alloc_gart(&(*bo)->tbo); - } --- -2.47.0 - diff --git a/app-admin/kernel-tools/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch similarity index 92% rename from app-admin/kernel-tools/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch index ae19d6fa21f..2d975944b00 100644 --- a/app-admin/kernel-tools/autobuild/patches/0111-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0131-FROMEXT-drm-radeon-Workaround-radeon-driver-bug-for-.patch @@ -1,7 +1,7 @@ -From 71b4e26466707af1e6526de8e07bff00138c62b7 Mon Sep 17 00:00:00 2001 +From d49c4a63f0b5a62683213b97cc64420ca9b6f25d Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Mon, 22 Feb 2021 10:53:47 +0800 -Subject: [PATCH 111/136] FROMEXT: drm/radeon: Workaround radeon driver bug for +Subject: [PATCH 131/156] FROMEXT: drm/radeon: Workaround radeon driver bug for Loongson Radeon driver can not handle the interrupt is faster than DMA data, so @@ -11,7 +11,7 @@ enable interrupt again when interrupt is faster than DMA data. Signed-off-by: Huacai Chen Signed-off-by: Zhijie Zhang -Link: https://github.com/chenhuacai/linux/commit/c1fe1db6dbc822a19f81ec1e9d01bd3026b2247e +Link: https://github.com/chenhuacai/linux/commit/ad499fdf01f0105ba74f315ba54c8e92aa3e1d23 Signed-off-by: Kexy Biscuit --- drivers/gpu/drm/radeon/cik.c | 1 + diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch b/runtime-kernel/linux-kernel/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch index b9d5031691f..5a1dbf6d62c 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0113-FROMEXT-cjktty-6.9.patch.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0132-FROMEXT-cjktty-6.9.patch.patch @@ -1,7 +1,7 @@ -From 487e7ad7a4f19aa4a6f92c78735ea135daf826e3 Mon Sep 17 00:00:00 2001 +From 3765739b383f0d45d8db474c7c332ea9af15c3d6 Mon Sep 17 00:00:00 2001 From: bigshans <26884666+bigshans@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:36:10 +0800 -Subject: [PATCH 113/136] FROMEXT: cjktty-6.9.patch +Subject: [PATCH 132/156] FROMEXT: cjktty-6.9.patch Co-developed-by: microcai Signed-off-by: microcai @@ -48,7 +48,7 @@ index 564341f1a74f..59d1cfbb1188 100644 vc_sel.buf_len = bp - vc_sel.buffer; diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c -index cd87e3d1291e..7bb59aac3b55 100644 +index 96842ce817af..95ef0a70f71d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -302,6 +302,14 @@ static void con_putc(struct vc_data *vc, u16 ca, unsigned int y, unsigned int x) diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch b/runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch index 9de967f7cd4..edd6820ee30 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0114-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0133-AOSCOS-drm-amdgpu-use-amdgpu-by-default-for-si-cik-d.patch @@ -1,7 +1,7 @@ -From b6446e8ceeb44ec61d2cf445010068bad0bb67d4 Mon Sep 17 00:00:00 2001 +From eae53514e7b7e53a877cd16f3e4b3488799e6cda Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sun, 22 Sep 2024 00:57:24 +0800 -Subject: [PATCH 114/136] AOSCOS: drm: amdgpu: use amdgpu by default for si/cik +Subject: [PATCH 133/156] AOSCOS: drm: amdgpu: use amdgpu by default for si/cik devices On LoongArch, radeon causes a memory read violation that crashes diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch b/runtime-kernel/linux-kernel/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch index 05d42a92eb9..897dc0b629c 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0115-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0134-AOSCOS-drm-amdgpu-radeon-disable-cache-flush-workaro.patch @@ -1,7 +1,7 @@ -From 0283be7accba08212f9abd95dd0aabccc3b6feda Mon Sep 17 00:00:00 2001 +From f75c90828961e80b1123b2404f9d1176c58adce3 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sun, 22 Sep 2024 01:07:11 +0800 -Subject: [PATCH 115/136] AOSCOS: drm: amdgpu: radeon: disable cache flush +Subject: [PATCH 134/156] AOSCOS: drm: amdgpu: radeon: disable cache flush workaround for LoongArch and Loongson64 This workaround causes instability for LoongArch/Loongson (MIPS) devices diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch b/runtime-kernel/linux-kernel/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch similarity index 79% rename from runtime-kernel/linux-kernel/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch index ccb95bcae73..6e54ab0bf71 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0116-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0135-AOSCOS-net-stmmac-Make-phytium_dwmac_remove-return-v.patch @@ -1,7 +1,7 @@ -From f825bc2c5ffa2174444510b4a44e3416b6f1de63 Mon Sep 17 00:00:00 2001 +From a352075c5ec543ee77c67b467e1aa4cfac8347ac Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:19:19 +0800 -Subject: [PATCH 116/136] AOSCOS: net: stmmac: Make phytium_dwmac_remove() +Subject: [PATCH 135/156] AOSCOS: net: stmmac: Make phytium_dwmac_remove() return void Fixes: 731b13ef92e8 ("BACKPORT: PHYTIUM: net/stmmac: Add phytium DWMAC driver support v2") @@ -12,10 +12,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c -index dd4171a39a4a..fbedbada8eed 100644 +index eea842195513..ea37d120113d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-phytium.c -@@ -176,7 +176,7 @@ static int phytium_dwmac_probe(struct platform_device *pdev) +@@ -199,7 +199,7 @@ static int phytium_dwmac_probe(struct platform_device *pdev) return stmmac_dvr_probe(&pdev->dev, plat, &stmmac_res); } @@ -24,7 +24,7 @@ index dd4171a39a4a..fbedbada8eed 100644 { struct net_device *ndev = platform_get_drvdata(pdev); struct stmmac_priv *priv = netdev_priv(ndev); -@@ -184,8 +184,6 @@ static int phytium_dwmac_remove(struct platform_device *pdev) +@@ -207,8 +207,6 @@ static int phytium_dwmac_remove(struct platform_device *pdev) stmmac_pltfr_remove(pdev); clk_unregister_fixed_rate(plat->stmmac_clk); diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch b/runtime-kernel/linux-kernel/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch similarity index 88% rename from runtime-kernel/linux-kernel/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch index b06d51ab9c7..8edf98a8b1e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0117-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0136-AOSCOS-net-phytium-Adapt-struct-kernel_ethtool_ts_in.patch @@ -1,7 +1,7 @@ -From de634877103eeba93d5783038b31f59e68ea4de7 Mon Sep 17 00:00:00 2001 +From 15187f1c0a3e46d2f202159a493c1725e2e77fa0 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:42:30 +0800 -Subject: [PATCH 117/136] AOSCOS: net: phytium: Adapt struct +Subject: [PATCH 136/156] AOSCOS: net: phytium: Adapt struct kernel_ethtool_ts_info Fixes: 53f8c475850d ("BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC") diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch b/runtime-kernel/linux-kernel/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch similarity index 90% rename from runtime-kernel/linux-kernel/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch index d9503a24b88..6d726856449 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0118-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0137-AOSCOS-net-ethernet-phytium-Make-phytmac_plat_remove.patch @@ -1,7 +1,7 @@ -From e4565d4f31fda1ed4666972f73effe7da7a743da Mon Sep 17 00:00:00 2001 +From d47dea38582c7b61d1bb4ccb9a0b92c9983c6cd1 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Sun, 22 Sep 2024 03:57:43 +0800 -Subject: [PATCH 118/136] AOSCOS: net: ethernet: phytium: Make +Subject: [PATCH 137/156] AOSCOS: net: ethernet: phytium: Make phytmac_plat_remove() return void Fixes: 53f8c475850d ("BACKPORT: PHYTIUM: net: phytium: Add support for phytium GMAC") diff --git a/app-admin/kernel-tools/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch b/runtime-kernel/linux-kernel/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch similarity index 89% rename from app-admin/kernel-tools/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch index d5403ddee22..e63e9bc155b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0119-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0138-AOSCOS-arm64-dts-rockchip-disable-usb3-on-quartz64.patch @@ -1,7 +1,7 @@ -From 50e3dfa9d22bb99a61eb2b858353bd4538331955 Mon Sep 17 00:00:00 2001 +From 97245f0d7ce046f1dab3371742bb5f20845ea136 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 22 Sep 2024 04:13:54 +0800 -Subject: [PATCH 119/136] AOSCOS: arm64: dts: rockchip: disable usb3 on +Subject: [PATCH 138/156] AOSCOS: arm64: dts: rockchip: disable usb3 on quartz64 USB 3 ports on Quartz64 is of bad quality as it shares lines with SATA. diff --git a/app-admin/kernel-tools/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch b/runtime-kernel/linux-kernel/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch similarity index 88% rename from app-admin/kernel-tools/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch index d061097b661..01675a05be9 100644 --- a/app-admin/kernel-tools/autobuild/patches/0120-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0139-AOSCOS-arm64-drop-hisi_ddrc_pmu-driver.patch @@ -1,7 +1,7 @@ -From 42cfd35f500281a04514247c3e5c8b2e09e27f7c Mon Sep 17 00:00:00 2001 +From f65b2e2f3e24732b3d2bdca967019bd049321c34 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 22 Sep 2024 04:18:12 +0800 -Subject: [PATCH 120/136] AOSCOS: arm64: drop hisi_ddrc_pmu driver +Subject: [PATCH 139/156] AOSCOS: arm64: drop hisi_ddrc_pmu driver hisi_ddrc_pmu is broken and causes Kunpeng 920-based desktop systems to freeze during boot-up. Disable this driver to workaround this issue. diff --git a/app-admin/kernel-tools/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch b/runtime-kernel/linux-kernel/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch index 6aa739a11e4..1290eabe358 100644 --- a/app-admin/kernel-tools/autobuild/patches/0121-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0140-AOSCOS-loongarch-basic-boot-support-for-legacy-firmw.patch @@ -1,7 +1,7 @@ -From 0d2b201602f1cba4d5bf20afb9698e539d5f4076 Mon Sep 17 00:00:00 2001 +From afb4328a650b9f81917410a9118138f3b9f247b6 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 17 Jul 2024 09:03:32 +0800 -Subject: [PATCH 121/136] AOSCOS: loongarch: basic boot support for legacy +Subject: [PATCH 140/156] AOSCOS: loongarch: basic boot support for legacy firmware The addresses passed from legacy firmware in efi system tables, the diff --git a/app-admin/kernel-tools/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch b/runtime-kernel/linux-kernel/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch index 035e0237f46..bb25730b9a7 100644 --- a/app-admin/kernel-tools/autobuild/patches/0122-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0141-AOSCOS-loongarch-parse-BPI-data-and-add-memory-mappi.patch @@ -1,7 +1,7 @@ -From 15529b962bc65a75cf1f5a652b24028970d8fe72 Mon Sep 17 00:00:00 2001 +From 0f3538e0c27ac03e6bc56e80b603ab3b7c819928 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Thu, 18 Jul 2024 18:55:59 +0800 -Subject: [PATCH 122/136] AOSCOS: loongarch: parse BPI data and add memory +Subject: [PATCH 141/156] AOSCOS: loongarch: parse BPI data and add memory mapping On legacy firmwares, the memory mapping information passed in the EFI @@ -436,7 +436,7 @@ index 8fe21f868f72..5d45c389e961 100644 return -EINVAL; diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c -index 00e307203ddb..fedcd1adec71 100644 +index cbd3c09a93c1..782e8849355a 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -49,6 +49,8 @@ @@ -448,7 +448,7 @@ index 00e307203ddb..fedcd1adec71 100644 #define SMBIOS_BIOSSIZE_OFFSET 0x09 #define SMBIOS_BIOSEXTERN_OFFSET 0x13 #define SMBIOS_FREQLOW_OFFSET 0x16 -@@ -593,6 +595,7 @@ void __init setup_arch(char **cmdline_p) +@@ -594,6 +596,7 @@ void __init setup_arch(char **cmdline_p) init_environ(); efi_init(); fdt_setup(); diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch b/runtime-kernel/linux-kernel/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch index 82e4298ca7b..3e5cc9856dc 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0123-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0142-AOSCOS-loongarch-add-MADT-ACPI-table-conversion.patch @@ -1,7 +1,7 @@ -From c6dfc9b1a02ec144085ca63c8c2d340d86c72db1 Mon Sep 17 00:00:00 2001 +From 90b79cf2078ee16fe3e4dd6395e0c12e12dfbd66 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Sat, 20 Jul 2024 06:32:15 +0800 -Subject: [PATCH 123/136] AOSCOS: loongarch: add MADT ACPI table conversion +Subject: [PATCH 142/156] AOSCOS: loongarch: add MADT ACPI table conversion On machines with legacy firmware with BPI version BPI01000, i.e. the older version, the content of the MADT ACPI table is not following the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch b/runtime-kernel/linux-kernel/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch similarity index 97% rename from runtime-kernel/linux-kernel/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch index 2f95c830cd5..8ec3bc53f8e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0124-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0143-AOSCOS-loongarch-correct-missing-offset-of-PCI-root-.patch @@ -1,7 +1,7 @@ -From c21523968873b0b3b7c20dc3931b14cbd0f6b2a2 Mon Sep 17 00:00:00 2001 +From 703c00050f5f06b66eb822762d5bba68d4cc9420 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 24 Jul 2024 09:06:27 +0800 -Subject: [PATCH 124/136] AOSCOS: loongarch: correct missing offset of PCI root +Subject: [PATCH 143/156] AOSCOS: loongarch: correct missing offset of PCI root controller in DSDT table On machines with legacy firmware with BPI version BPI01000, the PCI root diff --git a/app-admin/kernel-tools/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch b/runtime-kernel/linux-kernel/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch index 968c5a5c84c..b0b0e2c0ca2 100644 --- a/app-admin/kernel-tools/autobuild/patches/0125-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0144-AOSCOS-loongarch-fix-missing-dependency-info-in-DSDT.patch @@ -1,7 +1,7 @@ -From 52d29fa5075667c11a7170bf736aa0e64090ed26 Mon Sep 17 00:00:00 2001 +From 5261d69c33a5b3b9562a9b4241967c789f461eec Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Thu, 25 Jul 2024 16:09:19 +0800 -Subject: [PATCH 125/136] AOSCOS: loongarch: fix missing dependency info in +Subject: [PATCH 144/156] AOSCOS: loongarch: fix missing dependency info in DSDT On machines with legacy firmware with BPI01000 version, the devices on diff --git a/app-admin/kernel-tools/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch b/runtime-kernel/linux-kernel/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch similarity index 97% rename from app-admin/kernel-tools/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch index 7cc9c247c9f..d245c63391b 100644 --- a/app-admin/kernel-tools/autobuild/patches/0126-AOSCOS-loongarch-fix-DMA-address-offset.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0145-AOSCOS-loongarch-fix-DMA-address-offset.patch @@ -1,7 +1,7 @@ -From e30e05f8b9c10ae453ce5a23037ae813aa000743 Mon Sep 17 00:00:00 2001 +From 2803ca8e9757582fa8c6488a8bd21b3b4bf6a35e Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 13 Aug 2024 16:05:28 +0800 -Subject: [PATCH 126/136] AOSCOS: loongarch: fix DMA address offset +Subject: [PATCH 145/156] AOSCOS: loongarch: fix DMA address offset Loongarch CPUs are using HT bus interface, which is only 40-bit wide, to communicate with the bridge chipset. However, the actual memory diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch b/runtime-kernel/linux-kernel/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch similarity index 95% rename from runtime-kernel/linux-kernel/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch index 1228c4a82db..1447ad1941e 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0127-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0146-AOSCOS-loongarch-fix-HT_RX_INT_TRANS-register.patch @@ -1,7 +1,7 @@ -From 86c4bad130e9fd8e9c280b7b45df0df113a8176f Mon Sep 17 00:00:00 2001 +From 0dbb52f00cace4273bebfe164b202e3842eb12fd Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 13 Aug 2024 22:33:01 +0800 -Subject: [PATCH 127/136] AOSCOS: loongarch: fix HT_RX_INT_TRANS register +Subject: [PATCH 146/156] AOSCOS: loongarch: fix HT_RX_INT_TRANS register On machines with legacy firmware with BPI01000 version, the HT_RX_INT_TRANS register on the node 5, i.e. the node connected with the diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch b/runtime-kernel/linux-kernel/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch similarity index 99% rename from runtime-kernel/linux-kernel/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch index 0818d8e55b6..af56b788602 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0128-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0147-AOSCOS-arch-loongarch-add-la_ow_syscall-as-in-tree-m.patch @@ -1,7 +1,7 @@ -From d092a311156ece35a198647229fcf4971d78ffe8 Mon Sep 17 00:00:00 2001 +From 2368b5940b0afeab7fbddba3fca07560e7ae2db1 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Wed, 28 Aug 2024 03:09:24 +0800 -Subject: [PATCH 128/136] AOSCOS: arch/loongarch: add la_ow_syscall as in-tree +Subject: [PATCH 147/156] AOSCOS: arch/loongarch: add la_ow_syscall as in-tree module Signed-off-by: Miao Wang diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch b/runtime-kernel/linux-kernel/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch similarity index 87% rename from runtime-kernel/linux-kernel/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch index aa10333f5dd..d4a64f9b924 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0129-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0148-AOSCOS-la_ow_syscall-add-kconfig-for-module.patch @@ -1,7 +1,7 @@ -From e4f32e4d859e38bcce4690520433d63e3239a5d3 Mon Sep 17 00:00:00 2001 +From 5c837366ccae0cb366f0c35c33d0697c95f47755 Mon Sep 17 00:00:00 2001 From: Tianhao Chai Date: Thu, 18 Jan 2024 18:07:58 -0500 -Subject: [PATCH 129/136] AOSCOS: la_ow_syscall: add kconfig for module +Subject: [PATCH 148/156] AOSCOS: la_ow_syscall: add kconfig for module Signed-off-by: Tianhao Chai Signed-off-by: Kexy Biscuit @@ -12,7 +12,7 @@ Signed-off-by: Kexy Biscuit create mode 100644 arch/loongarch/ow_syscall/Kconfig diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig -index bc76c641bd5b..d3573c0960f7 100644 +index 199b675e2c11..2e036217aa61 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -724,3 +724,5 @@ source "drivers/cpufreq/Kconfig" diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch b/runtime-kernel/linux-kernel/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch similarity index 96% rename from runtime-kernel/linux-kernel/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch index 4ad9ed3c3c0..caf463b5da4 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0130-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0149-AOSCOS-platform-x86-ideapad-laptop-add-fixes-for-Thi.patch @@ -1,7 +1,7 @@ -From 0e95d7e2ea12f6dfbc879dca38cc5ffcbf756e49 Mon Sep 17 00:00:00 2001 +From 55343efcbb1c9b558f98b614880fdca88d294eec Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Sat, 17 Aug 2024 11:32:11 +0800 -Subject: [PATCH 130/136] AOSCOS: platform: x86: ideapad-laptop: add fixes for +Subject: [PATCH 149/156] AOSCOS: platform: x86: ideapad-laptop: add fixes for ThinkBook 14+ (2024 G6+) This is a patch taken from ideapad-laptop-tb2024g6plus in an attempt to diff --git a/app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch b/runtime-kernel/linux-kernel/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch similarity index 96% rename from app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch index edbe0e4748d..6aef72711cb 100644 --- a/app-admin/kernel-tools/autobuild/patches/0133-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0150-AOSCOS-Revert-rcu-Fix-rcu_barrier-VS-post-CPUHP_TEAR.patch @@ -1,7 +1,7 @@ -From 05619edd5f0f86df22a3f5cc4b2575526eccdbae Mon Sep 17 00:00:00 2001 +From a35153d5dd201cc99ee11446b51030a8f1a4f568 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Tue, 15 Oct 2024 20:32:21 +0800 -Subject: [PATCH 133/136] AOSCOS: Revert "rcu: Fix rcu_barrier() VS post +Subject: [PATCH 150/156] AOSCOS: Revert "rcu: Fix rcu_barrier() VS post CPUHP_TEARDOWN_CPU invocation" When this change was introduced between v6.10.4 and v6.10.5, the Broadcom @@ -99,10 +99,10 @@ Signed-off-by: Kexy Biscuit 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index e641cc681901..6f549dd62b4b 100644 +index 8af1354b2231..3be2f6e85ffd 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c -@@ -5148,15 +5148,11 @@ void rcutree_migrate_callbacks(int cpu) +@@ -5242,15 +5242,11 @@ void rcutree_migrate_callbacks(int cpu) struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); bool needwake; diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch b/runtime-kernel/linux-kernel/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch similarity index 94% rename from runtime-kernel/linux-kernel/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch rename to runtime-kernel/linux-kernel/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch index 94deb8bfdaa..064d182f191 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0132-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch +++ b/runtime-kernel/linux-kernel/autobuild/patches/0151-AOSCOS-Revert-cpufreq-amd-pstate-initialize-core-pre.patch @@ -1,7 +1,7 @@ -From 85378d209ed88a03dbd375712d41687d98276cd7 Mon Sep 17 00:00:00 2001 +From 0e1dc9c335bf216d924683342b18570cb6b4b3d8 Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Tue, 15 Oct 2024 18:37:52 +0800 -Subject: [PATCH 132/136] AOSCOS: Revert "cpufreq: amd-pstate: initialize core +Subject: [PATCH 151/156] AOSCOS: Revert "cpufreq: amd-pstate: initialize core precision boost state" This commit, introduced as part of AMD P-State's updates for 6.11, breaks @@ -30,7 +30,7 @@ Signed-off-by: Kexy Biscuit 2 files changed, 23 insertions(+), 97 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c -index 589fde37ccd7..08e09ea73afe 100644 +index 929b9097a6c1..00ddd781e323 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -695,53 +695,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu, @@ -188,7 +188,7 @@ index 589fde37ccd7..08e09ea73afe 100644 if (!current_pstate_driver->adjust_perf) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; -@@ -1506,10 +1439,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1516,10 +1449,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) if (ret) goto free_cpudata1; @@ -199,7 +199,7 @@ index 589fde37ccd7..08e09ea73afe 100644 min_freq = READ_ONCE(cpudata->min_freq); max_freq = READ_ONCE(cpudata->max_freq); -@@ -1525,8 +1454,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1535,8 +1464,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) policy->min = policy->cpuinfo.min_freq; policy->max = policy->cpuinfo.max_freq; @@ -208,7 +208,7 @@ index 589fde37ccd7..08e09ea73afe 100644 /* * Set the policy to provide a valid fallback value in case * the default cpufreq governor is neither powersave nor performance. -@@ -1548,6 +1475,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) +@@ -1558,6 +1485,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) return ret; WRITE_ONCE(cpudata->cppc_cap1_cached, value); } @@ -216,7 +216,7 @@ index 589fde37ccd7..08e09ea73afe 100644 return 0; -@@ -1808,7 +1736,6 @@ static struct cpufreq_driver amd_pstate_epp_driver = { +@@ -1818,7 +1746,6 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .suspend = amd_pstate_epp_suspend, .resume = amd_pstate_epp_resume, .update_limits = amd_pstate_update_limits, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch b/runtime-kernel/linux-kernel/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch new file mode 100644 index 00000000000..a6bb77386d1 --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0152-AOSCOS-drm-amdgpu-disable-ABM-Adaptive-Backlight-Man.patch @@ -0,0 +1,40 @@ +From 09d6589333c1228c548e7e77c89531d00455a29c Mon Sep 17 00:00:00 2001 +From: Mingcong Bai +Date: Thu, 24 Oct 2024 20:53:23 +0800 +Subject: [PATCH 152/156] AOSCOS: drm: amdgpu: disable ABM (Adaptive Backlight + Management) by default + +Per report from a contributor, since v6.9, ABM was set to be automatically +enabled/disabled. It may have seemed like a good idea for brighter +screens, but the brightness adjustment is quite abrupt, which is quite +bothersome. + +Disable this feature by default for now. + +Signed-off-by: Mingcong Bai + +Link: https://t.me/c/1109254909/594612 +Signed-off-by: Kexy Biscuit +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +index 5ce560218f09..13d5ae1aca87 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -867,9 +867,9 @@ module_param_named(visualconfirm, amdgpu_dc_visual_confirm, uint, 0444); + * Defaults to -1, or disabled. Userspace can only override this level after + * boot if it's set to auto. + */ +-int amdgpu_dm_abm_level = -1; ++int amdgpu_dm_abm_level = 0; + MODULE_PARM_DESC(abmlevel, +- "ABM level (0 = off, 1-4 = backlight reduction level, -1 auto (default))"); ++ "ABM level (0 = off (default), 1-4 = backlight reduction level, -1 auto)"); + module_param_named(abmlevel, amdgpu_dm_abm_level, int, 0444); + + int amdgpu_backlight = -1; +-- +2.47.0 + diff --git a/app-admin/kernel-tools/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 b/runtime-kernel/linux-kernel/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 similarity index 95% rename from app-admin/kernel-tools/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 rename to runtime-kernel/linux-kernel/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 index 1de7d26337b..3020fafaa5e 100644 --- a/app-admin/kernel-tools/autobuild/patches/0134-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 +++ b/runtime-kernel/linux-kernel/autobuild/patches/0153-LOONGARCH64-FROMLIST-drm-radeon-Call-mmiowb-at-the-e.patch.loongarch64 @@ -1,7 +1,7 @@ -From 7b4705337c0039a3a7e02f5a6efd22fecf25fd13 Mon Sep 17 00:00:00 2001 +From af96ed45c8dcaf312082dc1e9f540e5816c6c7b8 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 20 Feb 2024 15:49:58 +0800 -Subject: [PATCH 134/136] LOONGARCH64: FROMLIST: drm/radeon: Call mmiowb() at +Subject: [PATCH 153/156] LOONGARCH64: FROMLIST: drm/radeon: Call mmiowb() at the end of radeon_ring_commit() Commit fb24ea52f78e0d595852e ("drivers: Remove explicit invocations of diff --git a/app-admin/kernel-tools/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 b/runtime-kernel/linux-kernel/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 similarity index 98% rename from app-admin/kernel-tools/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 rename to runtime-kernel/linux-kernel/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 index 66dccfaf9fc..7b643670836 100644 --- a/app-admin/kernel-tools/autobuild/patches/0135-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 +++ b/runtime-kernel/linux-kernel/autobuild/patches/0154-LOONGARCH64-BACKPORT-FROMEXT-loongarch-debug.patch.loongarch64 @@ -1,7 +1,7 @@ -From ec1f48c2f1c9dda9f8517020aae1c17afa2de631 Mon Sep 17 00:00:00 2001 +From a4ae3527ff2064d3eebc27451a9bccf5475a7609 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Tue, 15 Oct 2024 19:35:34 +0800 -Subject: [PATCH 135/136] LOONGARCH64: BACKPORT: FROMEXT: loongarch debug +Subject: [PATCH 154/156] LOONGARCH64: BACKPORT: FROMEXT: loongarch debug drm/xe: fix build on non-4K kernels @@ -94,7 +94,7 @@ index e147ef1d0578..ae3c17e102e0 100644 if (resv) { ctx.allow_res_evict = !(flags & XE_BO_FLAG_NO_RESV_EVICT); diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c -index 0cdbc1296e88..23eb8039f27f 100644 +index 226542bb1442..111bb64e02fb 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -35,7 +35,7 @@ static u64 xelp_ggtt_pte_encode_bo(struct xe_bo *bo, u64 bo_offset, @@ -214,7 +214,7 @@ index 1c60b685dbc6..85843b6c2c2e 100644 /* diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c -index cd9918e3896c..9d9b27cbe2e8 100644 +index 12e1fe6a8da2..bc2e4da03ef8 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -165,7 +165,7 @@ int xe_guc_ct_init(struct xe_guc_ct *ct) @@ -319,7 +319,7 @@ index 4e01df6b1b7a..2158a98729c4 100644 config->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] = xe_exec_queue_device_get_max_priority(xe); diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c -index 49ba9a1e375f..80d1e08472ad 100644 +index 3ac41f70ea6b..578ba318be0a 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1190,7 +1190,7 @@ static u64 xelp_pde_encode_bo(struct xe_bo *bo, u64 bo_offset, diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 b/runtime-kernel/linux-kernel/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 similarity index 89% rename from runtime-kernel/linux-kernel/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 rename to runtime-kernel/linux-kernel/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 index c40a8243aec..38c4931b65b 100644 --- a/runtime-kernel/linux-kernel/autobuild/patches/0136-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 +++ b/runtime-kernel/linux-kernel/autobuild/patches/0155-LOONGARCH64-AOSCOS-more-fixes-for-Xe-on-LoongArch.patch.loongarch64 @@ -1,7 +1,7 @@ -From eb4160d8f4c3b6437d3dd75bb8d05516bfa0bc41 Mon Sep 17 00:00:00 2001 +From 3a85a395f299b89ae0d93da136a3a1de8a1c7379 Mon Sep 17 00:00:00 2001 From: Kexy Biscuit Date: Mon, 14 Oct 2024 06:58:21 +0800 -Subject: [PATCH 136/136] LOONGARCH64: AOSCOS: more fixes for Xe on LoongArch +Subject: [PATCH 155/156] LOONGARCH64: AOSCOS: more fixes for Xe on LoongArch More fixes based on the previous patch. diff --git a/runtime-kernel/linux-kernel/autobuild/patches/0156-ALSA-hda-Poll-jack-events-for-LS7A-HD-Audio.patch b/runtime-kernel/linux-kernel/autobuild/patches/0156-ALSA-hda-Poll-jack-events-for-LS7A-HD-Audio.patch new file mode 100644 index 00000000000..b8227805cda --- /dev/null +++ b/runtime-kernel/linux-kernel/autobuild/patches/0156-ALSA-hda-Poll-jack-events-for-LS7A-HD-Audio.patch @@ -0,0 +1,34 @@ +From 2147748a3fd80ff5e6e64218717b5db404be4584 Mon Sep 17 00:00:00 2001 +From: Huacai Chen +Date: Fri, 15 Nov 2024 23:06:53 +0800 +Subject: [PATCH 156/156] ALSA: hda: Poll jack events for LS7A HD-Audio + +LS7A HD-Audio disable interrupts and use polling mode due to hardware +drawbacks. As a result, unsolicited jack events are also unusable. If +we want to support headphone hotplug, we need to also poll jack events. + +Here we use 1500ms as the poll interval if no module parameter specify +it. + +Cc: stable@vger.kernel.org +Signed-off-by: Huacai Chen +--- + sound/pci/hda/hda_intel.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index e8958a464647..94533a75bebd 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -1863,6 +1863,8 @@ static int azx_first_init(struct azx *chip) + bus->polling_mode = 1; + bus->not_use_interrupts = 1; + bus->access_sdnctl_in_dword = 1; ++ if (!chip->jackpoll_interval) ++ chip->jackpoll_interval = msecs_to_jiffies(1500); + } + + err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio"); +-- +2.47.0 + diff --git a/runtime-kernel/linux-kernel/autobuild/ppc64el/config b/runtime-kernel/linux-kernel/autobuild/ppc64el/config index 0d870002e19..f3fe6a1c969 100644 --- a/runtime-kernel/linux-kernel/autobuild/ppc64el/config +++ b/runtime-kernel/linux-kernel/autobuild/ppc64el/config @@ -887,6 +887,7 @@ CONFIG_CAN_8DEV_USB=m CONFIG_CAN_BCM=m CONFIG_CAN_CALC_BITTIMING=y # CONFIG_CAN_CAN327 is not set +CONFIG_CAN_CC770_ISA=m CONFIG_CAN_CC770=m CONFIG_CAN_CC770_PLATFORM=m CONFIG_CAN_C_CAN=m @@ -935,6 +936,7 @@ CONFIG_CAN_PEAK_USB=m CONFIG_CAN_PLX_PCI=m CONFIG_CAN_RAW=m CONFIG_CAN_RX_OFFLOAD=y +CONFIG_CAN_SJA1000_ISA=m CONFIG_CAN_SJA1000=m CONFIG_CAN_SJA1000_PLATFORM=m CONFIG_CAN_SLCAN=m diff --git a/runtime-kernel/linux-kernel/autobuild/riscv64/config b/runtime-kernel/linux-kernel/autobuild/riscv64/config index 609ac21d2f0..01b12aa0578 100644 --- a/runtime-kernel/linux-kernel/autobuild/riscv64/config +++ b/runtime-kernel/linux-kernel/autobuild/riscv64/config @@ -643,7 +643,6 @@ CONFIG_BRCMFMAC_SDIO=y CONFIG_BRCMFMAC_USB=y CONFIG_BRCMSMAC_LEDS=y CONFIG_BRCMSMAC=m -# CONFIG_BRCM_TRACING is not set CONFIG_BRCMUTIL=m # CONFIG_BRIDGE is not set # CONFIG_BROADCOM_PHY is not set @@ -2333,7 +2332,6 @@ CONFIG_HAVE_PREEMPT_DYNAMIC=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_RETHOOK=y CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_RUST=y CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y CONFIG_HAVE_SCHED_AVG_IRQ=y @@ -3272,7 +3270,6 @@ CONFIG_MAC80211_HAS_RC=y CONFIG_MAC80211_LEDS=y CONFIG_MAC80211=m # CONFIG_MAC80211_MESH is not set -# CONFIG_MAC80211_MESSAGE_TRACING is not set CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y CONFIG_MAC80211_RC_MINSTREL=y diff --git a/runtime-kernel/linux-kernel/spec b/runtime-kernel/linux-kernel/spec index 5dcd0e4312a..5eb14d52f8d 100644 --- a/runtime-kernel/linux-kernel/spec +++ b/runtime-kernel/linux-kernel/spec @@ -1,10 +1,10 @@ -VER=6.11.4 +VER=6.11.8 # Note: For use inside autobuild/. __VER="${VER}" # Use this for stable releases. -REL=1 +REL=3 # Note: In specific cases, `www.kernel.org` is faster than `cdn.kernel.org`. Change the host when appropriate. SRCS="tbl::https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${VER%%.0}.tar.xz" @@ -21,5 +21,5 @@ SRCS="tbl::https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${VER%%.0}.tar.xz" #REL=0.${RC} #SRCS="tbl::https://git.kernel.org/torvalds/t/linux-${VER%%.0}-rc${RC}.tar.gz" -CHKSUMS="sha256::bd54b0a0a46574919706698b1411ec48cf2a58345c4d8990e414acc4730e8f55" +CHKSUMS="sha256::aee8a844fe152420bece70ffae8525b9b23089aa4da31fa32f30e1859bf93c3d" CHKUPDATE="anitya::id=6501"