From 9754fd489449d9df05eeeecf6bff7bcd720a4b86 Mon Sep 17 00:00:00 2001 From: David P Date: Oct 13 2021 01:31:44 +0000 Subject: updpkg: libre/linux-libre-pae 5.14.11-1 Signed-off-by: David P --- diff --git a/libre/linux-libre-pae/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/libre/linux-libre-pae/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch index c5e5b05..46cfcfa 100644 --- a/libre/linux-libre-pae/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch +++ b/libre/linux-libre-pae/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -1,7 +1,7 @@ -From 90de407f12e8ed9cb361678882c2af236b06107e Mon Sep 17 00:00:00 2001 +From f76db6fc04fadf872a138740592b4e8ec9ba9149 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 16 Sep 2019 04:53:20 +0200 -Subject: [PATCH 1/2] ZEN: Add sysctl and CONFIG to disallow unprivileged +Subject: [PATCH 1/6] ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER Our default behavior continues to match the vanilla kernel. @@ -14,10 +14,10 @@ Our default behavior continues to match the vanilla kernel. 5 files changed, 53 insertions(+) diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h -index bfa6463f8a95..27aa2bd5e50a 100644 +index eb70cabe6e7f..dda54e3bc47c 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h -@@ -116,6 +116,8 @@ void put_ucounts(struct ucounts *ucounts); +@@ -137,6 +137,8 @@ static inline void set_rlimit_ucount_max(struct user_namespace *ns, #ifdef CONFIG_USER_NS @@ -26,7 +26,7 @@ index bfa6463f8a95..27aa2bd5e50a 100644 static inline struct user_namespace *get_user_ns(struct user_namespace *ns) { if (ns) -@@ -149,6 +151,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns); +@@ -170,6 +172,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns); struct ns_common *ns_get_owner(struct ns_common *ns); #else @@ -36,10 +36,10 @@ index bfa6463f8a95..27aa2bd5e50a 100644 { return &init_user_ns; diff --git a/init/Kconfig b/init/Kconfig -index a61c92066c2e..6a2920f2e2ad 100644 +index 55f9f7738ebb..33c6a820ac08 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1195,6 +1195,22 @@ config USER_NS +@@ -1198,6 +1198,22 @@ config USER_NS If unsure, say N. @@ -63,7 +63,7 @@ index a61c92066c2e..6a2920f2e2ad 100644 bool "PID Namespaces" default y diff --git a/kernel/fork.c b/kernel/fork.c -index 567fee340500..f8ad32116152 100644 +index cbba21e3a58d..7267d46c29ea 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -98,6 +98,10 @@ @@ -77,7 +77,7 @@ index 567fee340500..f8ad32116152 100644 #include #include #include -@@ -1871,6 +1875,10 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1877,6 +1881,10 @@ static __latent_entropy struct task_struct *copy_process( if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) return ERR_PTR(-EINVAL); @@ -88,7 +88,7 @@ index 567fee340500..f8ad32116152 100644 /* * Thread groups must share signals as well, and detached threads * can only be started up within the thread group. -@@ -2973,6 +2981,12 @@ int ksys_unshare(unsigned long unshare_flags) +@@ -2981,6 +2989,12 @@ int ksys_unshare(unsigned long unshare_flags) if (unshare_flags & CLONE_NEWNS) unshare_flags |= CLONE_FS; @@ -102,10 +102,10 @@ index 567fee340500..f8ad32116152 100644 if (err) goto bad_unshare_out; diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index d4a78e08f6d8..0260dfe2daff 100644 +index 272f4a272f8c..760e8a2d815d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -103,6 +103,9 @@ +@@ -105,6 +105,9 @@ #ifdef CONFIG_LOCKUP_DETECTOR #include #endif @@ -115,7 +115,7 @@ index d4a78e08f6d8..0260dfe2daff 100644 #if defined(CONFIG_SYSCTL) -@@ -1896,6 +1899,15 @@ static struct ctl_table kern_table[] = { +@@ -1908,6 +1911,15 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dointvec, }, #endif @@ -132,7 +132,7 @@ index d4a78e08f6d8..0260dfe2daff 100644 { .procname = "tainted", diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c -index 27670ab7a4ed..300c72d2a381 100644 +index ef82d401dde8..5a6c2e07174b 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -21,6 +21,13 @@ @@ -150,5 +150,5 @@ index 27670ab7a4ed..300c72d2a381 100644 static DEFINE_MUTEX(userns_state_mutex); -- -2.32.0 +2.33.0 diff --git a/libre/linux-libre-pae/0002-Bluetooth-btusb-Add-support-for-IMC-Networks-Mediate.patch b/libre/linux-libre-pae/0002-Bluetooth-btusb-Add-support-for-IMC-Networks-Mediate.patch new file mode 100644 index 0000000..09a894e --- /dev/null +++ b/libre/linux-libre-pae/0002-Bluetooth-btusb-Add-support-for-IMC-Networks-Mediate.patch @@ -0,0 +1,79 @@ +From 810821eb3b1894f2cfcc29cffd42d193b8fe54a6 Mon Sep 17 00:00:00 2001 +From: Wai Paulo Valerio Wang +Date: Thu, 8 Jul 2021 04:00:59 +0800 +Subject: [PATCH 2/6] Bluetooth: btusb: Add support for IMC Networks Mediatek + Chip + +This add supports for IMC Networks Wireless_Device Media Chip +which contains the MT7921 chipset. + +$ lsusb + +Bus 001 Device 004: ID 13d3:3563 IMC Networks Wireless_Device + +$ cat /sys/kernel/debug/usb/devices + +T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=13d3 ProdID=3563 Rev= 1.00 +S: Manufacturer=MediaTek Inc. +S: Product=Wireless_Device +S: SerialNumber=000000000 +C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA +A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms +I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms +I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms +I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms +I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms +I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us +I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us + +Signed-off-by: Wai Paulo Valerio Wang +Signed-off-by: Marcel Holtmann +For: https://bugs.archlinux.org/task/72138 +--- + drivers/bluetooth/btusb.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index bd37d6fb88c2..e13a510e1698 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -414,6 +414,9 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x04ca, 0x3802), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, ++ { USB_DEVICE(0x13d3, 0x3563), .driver_info = BTUSB_MEDIATEK | ++ BTUSB_WIDEBAND_SPEECH | ++ BTUSB_VALID_LE_STATES }, + + /* Additional Realtek 8723AE Bluetooth devices */ + { USB_DEVICE(0x0930, 0x021d), .driver_info = BTUSB_REALTEK }, +-- +2.33.0 + diff --git a/libre/linux-libre-pae/0002-Bluetooth-btusb-check-conditions-before-enabling-USB.patch b/libre/linux-libre-pae/0002-Bluetooth-btusb-check-conditions-before-enabling-USB.patch deleted file mode 100644 index 574623c..0000000 --- a/libre/linux-libre-pae/0002-Bluetooth-btusb-check-conditions-before-enabling-USB.patch +++ /dev/null @@ -1,85 +0,0 @@ -From bdb12383a58d6989a0b1c2f925890948146bbc90 Mon Sep 17 00:00:00 2001 -From: Pauli Virtanen -Date: Mon, 26 Jul 2021 21:02:06 +0300 -Subject: [PATCH 2/2] Bluetooth: btusb: check conditions before enabling USB - ALT 3 for WBS -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some USB BT adapters don't satisfy the MTU requirement mentioned in -commit e848dbd364ac ("Bluetooth: btusb: Add support USB ALT 3 for WBS") -and have ALT 3 setting that produces no/garbled audio. Some adapters -with larger MTU were also reported to have problems with ALT 3. - -Add a flag and check it and MTU before selecting ALT 3, falling back to -ALT 1. Enable the flag for Realtek, restoring the previous behavior for -non-Realtek devices. - -Tested with USB adapters (mtu<72, no/garbled sound with ALT3, ALT1 -works) BCM20702A1 0b05:17cb, CSR8510A10 0a12:0001, and (mtu>=72, ALT3 -works) RTL8761BU 0bda:8771, Intel AX200 8087:0029 (after disabling -ALT6). Also got reports for (mtu>=72, ALT 3 reported to produce bad -audio) Intel 8087:0a2b. - -Signed-off-by: Pauli Virtanen -Fixes: e848dbd364ac ("Bluetooth: btusb: Add support USB ALT 3 for WBS") -Tested-by: Michał Kępień - -Fixes: https://bugs.archlinux.org/task/71567 ---- - drivers/bluetooth/btusb.c | 22 ++++++++++++++-------- - 1 file changed, 14 insertions(+), 8 deletions(-) - -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 6d23308119d1..e8062d0b7d4d 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -516,6 +516,7 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = { - #define BTUSB_HW_RESET_ACTIVE 12 - #define BTUSB_TX_WAIT_VND_EVT 13 - #define BTUSB_WAKEUP_DISABLE 14 -+#define BTUSB_USE_ALT3_FOR_WBS 15 - - struct btusb_data { - struct hci_dev *hdev; -@@ -1748,16 +1749,20 @@ static void btusb_work(struct work_struct *work) - /* Bluetooth USB spec recommends alt 6 (63 bytes), but - * many adapters do not support it. Alt 1 appears to - * work for all adapters that do not have alt 6, and -- * which work with WBS at all. -+ * which work with WBS at all. Some devices prefer -+ * alt 3 (HCI payload >= 60 Bytes let air packet -+ * data satisfy 60 bytes), requiring -+ * MTU >= 3 (packets) * 25 (size) - 3 (headers) = 72 -+ * see also Core spec 5, vol 4, B 2.1.1 & Table 2.1. - */ -- new_alts = btusb_find_altsetting(data, 6) ? 6 : 1; -- /* Because mSBC frames do not need to be aligned to the -- * SCO packet boundary. If support the Alt 3, use the -- * Alt 3 for HCI payload >= 60 Bytes let air packet -- * data satisfy 60 bytes. -- */ -- if (new_alts == 1 && btusb_find_altsetting(data, 3)) -+ if (btusb_find_altsetting(data, 6)) -+ new_alts = 6; -+ else if (test_bit(BTUSB_USE_ALT3_FOR_WBS, &data->flags) && -+ hdev->sco_mtu >= 72 && -+ btusb_find_altsetting(data, 3)) - new_alts = 3; -+ else -+ new_alts = 1; - } - - if (btusb_switch_alt_setting(hdev, new_alts) < 0) -@@ -4733,6 +4738,7 @@ static int btusb_probe(struct usb_interface *intf, - * (DEVICE_REMOTE_WAKEUP) - */ - set_bit(BTUSB_WAKEUP_DISABLE, &data->flags); -+ set_bit(BTUSB_USE_ALT3_FOR_WBS, &data->flags); - } - - if (!reset) --- -2.32.0 - diff --git a/libre/linux-libre-pae/0003-Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chi.patch b/libre/linux-libre-pae/0003-Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chi.patch new file mode 100644 index 0000000..4af5a53 --- /dev/null +++ b/libre/linux-libre-pae/0003-Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chi.patch @@ -0,0 +1,71 @@ +From 38c2ca84b97f9d6021c2607e214f99acd84dac2d Mon Sep 17 00:00:00 2001 +From: Aaron Ma +Date: Fri, 23 Jul 2021 01:17:18 +0800 +Subject: [PATCH 3/6] Bluetooth: btusb: Add support for Foxconn Mediatek Chip + +Add support for another Foxconn / Hon Hai device with MT7921 chip. + +T: Bus=05 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 3 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0489 ProdID=e0cd Rev= 1.00 +S: Manufacturer=MediaTek Inc. +S: Product=Wireless_Device +S: SerialNumber=000000000 +C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA +A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms +I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms +I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms +I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms +I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms +I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us +I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us + +Signed-off-by: Aaron Ma +Signed-off-by: Marcel Holtmann +For: https://bugs.archlinux.org/task/72138 +--- + drivers/bluetooth/btusb.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index e13a510e1698..aac732cc9612 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -417,6 +417,9 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x13d3, 0x3563), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, ++ { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | ++ BTUSB_WIDEBAND_SPEECH | ++ BTUSB_VALID_LE_STATES }, + + /* Additional Realtek 8723AE Bluetooth devices */ + { USB_DEVICE(0x0930, 0x021d), .driver_info = BTUSB_REALTEK }, +-- +2.33.0 + diff --git a/libre/linux-libre-pae/0004-ALSA-pcm-Check-mmap-capability-of-runtime-dma-buffer.patch b/libre/linux-libre-pae/0004-ALSA-pcm-Check-mmap-capability-of-runtime-dma-buffer.patch new file mode 100644 index 0000000..64b8717 --- /dev/null +++ b/libre/linux-libre-pae/0004-ALSA-pcm-Check-mmap-capability-of-runtime-dma-buffer.patch @@ -0,0 +1,64 @@ +From ab60c2d0242fc428a436c25c1144f6acd9d6f419 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 9 Aug 2021 09:18:27 +0200 +Subject: [PATCH 4/6] ALSA: pcm: Check mmap capability of runtime dma buffer at + first + +Currently we check only the substream->dma_buffer as the preset of the +buffer configuration for verifying the availability of mmap. But a +few drivers rather set up the buffer in the own way without the +standard buffer preallocation using substream->dma_buffer, and they +miss the proper checks. (Now it's working more or less fine as most +of them are running only on x86). + +Actually, they may set up the runtime dma_buffer (referred via +snd_pcm_get_dma_buf()) at the open callback, though. That is, this +could have been used as the primary source. + +This patch changes the hw_support_mmap() function to check the runtime +dma buffer at first. It's usually NULL with the standard buffer +preallocation, and in that case, we continue checking +substream->dma_buffer as fallback. + +Signed-off-by: Takashi Iwai +Fixes: https://bugs.archlinux.org/task/72059 +--- + sound/core/pcm_native.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c +index 71323d807dbf..dc9fa312fadd 100644 +--- a/sound/core/pcm_native.c ++++ b/sound/core/pcm_native.c +@@ -243,13 +243,18 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, + + static bool hw_support_mmap(struct snd_pcm_substream *substream) + { ++ struct snd_dma_buffer *dmabuf; ++ + if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP)) + return false; + + if (substream->ops->mmap || substream->ops->page) + return true; + +- switch (substream->dma_buffer.dev.type) { ++ dmabuf = snd_pcm_get_dma_buf(substream); ++ if (!dmabuf) ++ dmabuf = &substream->dma_buffer; ++ switch (dmabuf->dev.type) { + case SNDRV_DMA_TYPE_UNKNOWN: + /* we can't know the device, so just assume that the driver does + * everything right +@@ -259,7 +264,7 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream) + case SNDRV_DMA_TYPE_VMALLOC: + return true; + default: +- return dma_can_mmap(substream->dma_buffer.dev.dev); ++ return dma_can_mmap(dmabuf->dev.dev); + } + } + +-- +2.33.0 + diff --git a/libre/linux-libre-pae/0005-ALSA-pci-rme-Set-up-buffer-type-properly.patch b/libre/linux-libre-pae/0005-ALSA-pci-rme-Set-up-buffer-type-properly.patch new file mode 100644 index 0000000..f1d7db9 --- /dev/null +++ b/libre/linux-libre-pae/0005-ALSA-pci-rme-Set-up-buffer-type-properly.patch @@ -0,0 +1,75 @@ +From 7b0c23ec626e579ffa7ef239cac20dc7fa1797e9 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 9 Aug 2021 09:18:28 +0200 +Subject: [PATCH 5/6] ALSA: pci: rme: Set up buffer type properly + +Although the regression of the mmap was fixed in the recent commit +dc0dc8a73e8e ("ALSA: pcm: Fix mmap breakage without explicit buffer +setup"), RME9652 and HDSP drivers have still potential issues with +their mmap handling. Namely, they use the default mmap handler +without the standard buffer preallocation, and PCM core wouldn't use +the coherent DMA mapping. It's practically OK on x86, but on some +exotic architectures, it wouldn't work. + +This patch addresses the potential breakage by replacing the buffer +setup with the proper macro. It also simplifies the source code, +too. + +Signed-off-by: Takashi Iwai +Fixes: https://bugs.archlinux.org/task/72059 +--- + sound/pci/rme9652/hdsp.c | 6 ++---- + sound/pci/rme9652/rme9652.c | 6 ++---- + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c +index 8457a4bbc3df..22b8b3357918 100644 +--- a/sound/pci/rme9652/hdsp.c ++++ b/sound/pci/rme9652/hdsp.c +@@ -4518,8 +4518,7 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream) + snd_pcm_set_sync(substream); + + runtime->hw = snd_hdsp_playback_subinfo; +- runtime->dma_area = hdsp->playback_buffer; +- runtime->dma_bytes = HDSP_DMA_AREA_BYTES; ++ snd_pcm_set_runtime_buffer(substream, &hdsp->playback_dma_buf); + + hdsp->playback_pid = current->pid; + hdsp->playback_substream = substream; +@@ -4595,8 +4594,7 @@ static int snd_hdsp_capture_open(struct snd_pcm_substream *substream) + snd_pcm_set_sync(substream); + + runtime->hw = snd_hdsp_capture_subinfo; +- runtime->dma_area = hdsp->capture_buffer; +- runtime->dma_bytes = HDSP_DMA_AREA_BYTES; ++ snd_pcm_set_runtime_buffer(substream, &hdsp->capture_dma_buf); + + hdsp->capture_pid = current->pid; + hdsp->capture_substream = substream; +diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c +index f1aad38760d6..9ad2533925c4 100644 +--- a/sound/pci/rme9652/rme9652.c ++++ b/sound/pci/rme9652/rme9652.c +@@ -2279,8 +2279,7 @@ static int snd_rme9652_playback_open(struct snd_pcm_substream *substream) + snd_pcm_set_sync(substream); + + runtime->hw = snd_rme9652_playback_subinfo; +- runtime->dma_area = rme9652->playback_buffer; +- runtime->dma_bytes = RME9652_DMA_AREA_BYTES; ++ snd_pcm_set_runtime_buffer(substream, &rme9652->playback_dma_buf); + + if (rme9652->capture_substream == NULL) { + rme9652_stop(rme9652); +@@ -2339,8 +2338,7 @@ static int snd_rme9652_capture_open(struct snd_pcm_substream *substream) + snd_pcm_set_sync(substream); + + runtime->hw = snd_rme9652_capture_subinfo; +- runtime->dma_area = rme9652->capture_buffer; +- runtime->dma_bytes = RME9652_DMA_AREA_BYTES; ++ snd_pcm_set_runtime_buffer(substream, &rme9652->capture_dma_buf); + + if (rme9652->playback_substream == NULL) { + rme9652_stop(rme9652); +-- +2.33.0 + diff --git a/libre/linux-libre-pae/0006-ALSA-pci-cs46xx-Fix-set-up-buffer-type-properly.patch b/libre/linux-libre-pae/0006-ALSA-pci-cs46xx-Fix-set-up-buffer-type-properly.patch new file mode 100644 index 0000000..0305e70 --- /dev/null +++ b/libre/linux-libre-pae/0006-ALSA-pci-cs46xx-Fix-set-up-buffer-type-properly.patch @@ -0,0 +1,95 @@ +From b5ed7b38f5551c5dfca87ab29d679f3d6d327557 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 9 Aug 2021 09:18:29 +0200 +Subject: [PATCH 6/6] ALSA: pci: cs46xx: Fix set up buffer type properly + +CS46xx driver switches the buffer depending on the number of periods, +and in some cases it switches to the own buffer without updating the +buffer type properly. This may cause a problem with the mmap on +exotic architectures that require the own mmap call for the coherent +DMA buffer. + +This patch addresses the potential breakage by replacing the buffer +setup with the proper macro. It also simplifies the source code, +too. + +Signed-off-by: Takashi Iwai +Fixes: https://bugs.archlinux.org/task/72059 +--- + sound/pci/cs46xx/cs46xx_lib.c | 30 ++++++++---------------------- + 1 file changed, 8 insertions(+), 22 deletions(-) + +diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c +index 1e1eb17f8e07..d43927dcd61e 100644 +--- a/sound/pci/cs46xx/cs46xx_lib.c ++++ b/sound/pci/cs46xx/cs46xx_lib.c +@@ -1121,9 +1121,7 @@ static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, + if (params_periods(hw_params) == CS46XX_FRAGS) { + if (runtime->dma_area != cpcm->hw_buf.area) + snd_pcm_lib_free_pages(substream); +- runtime->dma_area = cpcm->hw_buf.area; +- runtime->dma_addr = cpcm->hw_buf.addr; +- runtime->dma_bytes = cpcm->hw_buf.bytes; ++ snd_pcm_set_runtime_buffer(substream, &cpcm->hw_buf); + + + #ifdef CONFIG_SND_CS46XX_NEW_DSP +@@ -1143,11 +1141,8 @@ static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, + #endif + + } else { +- if (runtime->dma_area == cpcm->hw_buf.area) { +- runtime->dma_area = NULL; +- runtime->dma_addr = 0; +- runtime->dma_bytes = 0; +- } ++ if (runtime->dma_area == cpcm->hw_buf.area) ++ snd_pcm_set_runtime_buffer(substream, NULL); + err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); + if (err < 0) { + #ifdef CONFIG_SND_CS46XX_NEW_DSP +@@ -1196,9 +1191,7 @@ static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream) + if (runtime->dma_area != cpcm->hw_buf.area) + snd_pcm_lib_free_pages(substream); + +- runtime->dma_area = NULL; +- runtime->dma_addr = 0; +- runtime->dma_bytes = 0; ++ snd_pcm_set_runtime_buffer(substream, NULL); + + return 0; + } +@@ -1287,16 +1280,11 @@ static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream, + if (runtime->periods == CS46XX_FRAGS) { + if (runtime->dma_area != chip->capt.hw_buf.area) + snd_pcm_lib_free_pages(substream); +- runtime->dma_area = chip->capt.hw_buf.area; +- runtime->dma_addr = chip->capt.hw_buf.addr; +- runtime->dma_bytes = chip->capt.hw_buf.bytes; ++ snd_pcm_set_runtime_buffer(substream, &chip->capt.hw_buf); + substream->ops = &snd_cs46xx_capture_ops; + } else { +- if (runtime->dma_area == chip->capt.hw_buf.area) { +- runtime->dma_area = NULL; +- runtime->dma_addr = 0; +- runtime->dma_bytes = 0; +- } ++ if (runtime->dma_area == chip->capt.hw_buf.area) ++ snd_pcm_set_runtime_buffer(substream, NULL); + err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); + if (err < 0) + return err; +@@ -1313,9 +1301,7 @@ static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream) + + if (runtime->dma_area != chip->capt.hw_buf.area) + snd_pcm_lib_free_pages(substream); +- runtime->dma_area = NULL; +- runtime->dma_addr = 0; +- runtime->dma_bytes = 0; ++ snd_pcm_set_runtime_buffer(substream, NULL); + + return 0; + } +-- +2.33.0 + diff --git a/libre/linux-libre-pae/PKGBUILD b/libre/linux-libre-pae/PKGBUILD index 912bfad..42e4b06 100644 --- a/libre/linux-libre-pae/PKGBUILD +++ b/libre/linux-libre-pae/PKGBUILD @@ -9,7 +9,7 @@ _replacesoldkernels=() # '%' gets replaced with kernel suffix _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre-pae -pkgver=5.13.9 +pkgver=5.14.11 pkgrel=1 pkgdesc='Linux-libre PAE (physical address extension)' url='https://linux-libre.fsfla.org/' @@ -20,7 +20,7 @@ makedepends=( xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) options=('!strip') -_srcname=linux-5.13 +_srcname=linux-5.14 source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcname##*-}-gnu/linux-libre-${_srcname##*-}-gnu.tar.xz"{,.sign} "https://linux-libre.fsfla.org/pub/linux-libre/releases/$pkgver-gnu/patch-${_srcname##*-}-gnu-$pkgver-gnu.xz"{,.sign} @@ -36,15 +36,19 @@ source=( 0002-fix-Atmel-maXTouch-touchscreen-support.patch # Arch Linux patches 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch - 0002-Bluetooth-btusb-check-conditions-before-enabling-USB.patch + 0002-Bluetooth-btusb-Add-support-for-IMC-Networks-Mediate.patch + 0003-Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chi.patch + 0004-ALSA-pcm-Check-mmap-capability-of-runtime-dma-buffer.patch + 0005-ALSA-pci-rme-Set-up-buffer-type-properly.patch + 0006-ALSA-pci-cs46xx-Fix-set-up-buffer-type-properly.patch ) validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) -sha512sums=('a24f2db9316297127447b3d7fd7a1e9e7b9a8bdb5e59e6e341568cbf877c4b65d2ccdb27ec1c23b07af6c365b2930b040bcef0d989202b503bc55b107c04d121' +sha512sums=('18798d032184ce141216ad72fcbb5ddb340809fe8d953acb50700aa0b47d36fca104dcedc7521fb3aea913d8fbeb4bd3eab1cf2c955388e6996c4154eac67d0c' 'SKIP' - '8f1b7cb25e22f241567f3b78c66a2203d6c3746e464be7f7ddfcc42198fb41f7a4a179820ca2aa751c53098652b14789c204d9057bdfe6b6927dec68c1d26eec' + '951cdb68af3bbf3b841376f82fd9c82dfd7a159cae8564e5d772f99f3170deafcabc00cb0ecfa6e7669c22087577f2eafa47d3b50bc8ea6ee5edbc65821986e1' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' @@ -52,11 +56,15 @@ sha512sums=('a24f2db9316297127447b3d7fd7a1e9e7b9a8bdb5e59e6e341568cbf877c4b65d2c 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' - '2f35c40ecff2de26048122dac3b60639012a8aaaa887f2de20c4865c6607e6f8caad540bfcec21cb3d7f38cdba94c975f0867a13b69116723ce6683403ccea32' + '176fe512658e8a958214225c7873aa1df597c5d69c515ab20f7495fa922b2b3e9b6715be96d5b7eb2438476db4a70992e4caa946b0f85401923ab402d6e41c63' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' - 'fac53c8ce68e9f56c8930a9392c89377c909f6a43a318010194949def91a104f34f46c2b32457e571435a8b326c47a48737ceb6255644bb6d42c59b27b07449a' - '722d92b750f0a5af39b850c18ff0c57dac0165e3c0219415843ec5207945971448790fec3fca570b62c8726c89b0ca6b7a5b16fd503e4581b3a63b3adfcf2c50') + 'dba36283b9ea3db5fcc9a72051a8e9cf4d409ec59769e6da9db4d321b72972242670210ad961a37f62aba68f7262e9f2f6308cfe62cda9fa050c72363a0c404a' + '693ac0e0e32cd0ab6c485deb43d6408dc9fc31234e4113206cf901a302eddf1a965f97f82ed7186f6426c085176ce95c48e116e9824d92bfd1f6656447da18dc' + 'c4a19ccec8b7636f1b5b1cf8e135e46d3aa4d233af4a1e72c2aaa83536505013f0c83602fe05ce08212b4327bebfb4f8a84b57c0d81509f0b48df5dfcc334254' + '4d81c2995e7cc5fc36929eb5bf9cc68ec02cb24147f18a88da79facd3e25182b156ca4430bf2765ff1e4c6be237d3a3e527498cd49d75217a5e16b62a478be6d' + '12c0da7fbd4e4e6ffc473ecd6dffee1dd61c201dad854347400c8f551adc35c033d6fa623cc5c1b2fe7930cdab868a8c99c6874ee171c9143e0f370398759c96' + '7f6fd402d8c29ee4f6c98ed2236318ab3f57f3dd47a92911e1b556df251b67fc83f7256223f06d1fefa849a3ceb5e40d247d2d5664ddd7cd9749bab4bc1ecb36') _replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") _replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") @@ -95,6 +103,7 @@ prepare() { echo "Setting config..." cp ../config .config make olddefconfig + diff -u ../config .config || : make -s kernelrelease > version echo "Prepared $pkgbase version $(