On Wed, Mar 30, 2022 at 05:42:45AM -0400, Joshua Freedman wrote:
> I just re-verified all this:
>
> For audio and mic:
> 5.17.1 is broken. Dummy Output. 5.16.12 is also dummy output.
> 5.16.11 was the last working version. 5.16.11-76051611-generic
Great, can you use 'git bisect' to track down the exact commit that
causes problems? Odds are it's not this one, but perhaps an audio
change?
thanks,
greg k-h
Hi reviewers,
I suggest to apply the following patch to stable kernel 5.4.y and 5.10.y:
commit: 5b61343b50590fb04a3f6be2cdc4868091757262
Subject: iommu/iova: Improve 32-bit free space estimate
kernel version to apply to: 5.4.y and 5.10.y
Reason:
The patch fix a corner case of iova allocation and the allocation failure
can be found under stress tests.
Test:
The patch can be applied to Linux 5.10.109 and Linux 5.4.188 without conflicts.
Both Linux 5.10.109 and Linux 5.4.188 can be built successfully with
this patch. (ARCH=arm64 defconfig)
Thanks,
Miles
Hi Joshua,
Le mer., mars 30 2022 at 03:34:34 -0400, Joshua Freedman
<freedman.joshua(a)gmail.com> a écrit :
> Hi, I noticed my audio and mic stopped working on my yoga c930 on
> 5.16.12 and newer. 5.16.11 was ok. On 5.16.12 and above I get a
> dummy output and no mic.
>
> Anything we can do about that? Thanks.
>
> I'm not a git guy so I just looked at the changlogs and this was the
> only audio one in 5.16.12. I could be wrong in the ID though.
This commit changes the clocks on the JZ4725B SoC, there is just no way
for it to be the cause of your problem.
Cheers,
-Paul
> commit 6b0d719ffed1c21c1a2e473301fd95f78cd35c9e
> Author: Siarhei Volkau <lis8215(a)gmail.com>
> Date: Sat Feb 5 20:18:49 2022 +0300
>
> clk: jz4725b: fix mmc0 clock gating
>
> commit 2f0754f27a230fee6e6d753f07585cee03bedfe3 upstream.
>
> The mmc0 clock gate bit was mistakenly assigned to "i2s" clock.
> You can find that the same bit is assigned to "mmc0" too.
> It leads to mmc0 hang for a long time after any sound activity
> also it prevented PM_SLEEP to work properly.
> I guess it was introduced by copy-paste from jz4740 driver
> where it is really controls I2S clock gate.
>
> Fixes: 226dfa4726eb ("clk: Add Ingenic jz4725b CGU driver")
> Signed-off-by: Siarhei Volkau <lis8215(a)gmail.com>
> Tested-by: Siarhei Volkau <lis8215(a)gmail.com>
> Reviewed-by: Paul Cercueil <paul(a)crapouillou.net>
> Cc: stable(a)vger.kernel.org
> Link:
> https://lore.kernel.org/r/20220205171849.687805-2-lis8215@gmail.com
> Signed-off-by: Stephen Boyd <sboyd(a)kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
>
>
> --
>
>
> Joshua Freedman
>
> President
>
> P: +19168060052
>
> 49 Sample BR RD
>
> Mechanicsburg, PA 17050-2386
>
> Fix & Flip Rehab Financing <31 Unit
>
>
>
>
> PGPKEY
>
On Wed, Mar 30, 2022 at 03:34:34AM -0400, Joshua Freedman wrote:
> Hi, I noticed my audio and mic stopped working on my yoga c930 on 5.16.12
> and newer. 5.16.11 was ok. On 5.16.12 and above I get a dummy output and
> no mic.
>
> Anything we can do about that? Thanks.
>
> I'm not a git guy so I just looked at the changlogs and this was the only
> audio one in 5.16.12. I could be wrong in the ID though.
>
> commit 6b0d719ffed1c21c1a2e473301fd95f78cd35c9e
> Author: Siarhei Volkau <lis8215(a)gmail.com>
> Date: Sat Feb 5 20:18:49 2022 +0300
>
> clk: jz4725b: fix mmc0 clock gating
>
> commit 2f0754f27a230fee6e6d753f07585cee03bedfe3 upstream.
>
> The mmc0 clock gate bit was mistakenly assigned to "i2s" clock.
> You can find that the same bit is assigned to "mmc0" too.
> It leads to mmc0 hang for a long time after any sound activity
> also it prevented PM_SLEEP to work properly.
> I guess it was introduced by copy-paste from jz4740 driver
> where it is really controls I2S clock gate.
>
> Fixes: 226dfa4726eb ("clk: Add Ingenic jz4725b CGU driver")
> Signed-off-by: Siarhei Volkau <lis8215(a)gmail.com>
> Tested-by: Siarhei Volkau <lis8215(a)gmail.com>
> Reviewed-by: Paul Cercueil <paul(a)crapouillou.net>
> Cc: stable(a)vger.kernel.org
> Link: https://lore.kernel.org/r/20220205171849.687805-2-lis8215@gmail.com
> Signed-off-by: Stephen Boyd <sboyd(a)kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
>
If you revert this does your machine work properly? Is 5.17 also broken
for you due to this change, or does it work properly?
thanks,
greg k-h
On Wed, Mar 30, 2022 at 04:01:59PM +0900, 조준완 wrote:
>
>
> Dear Greg Kroah-Hartman,
<snip>
Again, this was sent in html format, which is rejected by the lists.
Please fix your email client and try again.
thanks,
greg k-h
On Wed, Mar 30, 2022 at 03:21:22PM +0900, 조준완 wrote:
>
>
>
>
> Dear Greg Kroah-Hartman,
<snip>
Please resend in non-html format so it properly makes it to the mailing
lists and I will gladly respond.
thanks,
greg k-h
The patch titled
Subject: mm: fix unexpected zeroed page mapping with zram swap
has been added to the -mm tree. Its filename is
mm-fix-unexpected-zeroed-page-mapping-with-zram-swap.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-fix-unexpected-zeroed-page-map…
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-unexpected-zeroed-page-map…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Minchan Kim <minchan(a)kernel.org>
Subject: mm: fix unexpected zeroed page mapping with zram swap
Two processes under CLONE_VM cloning, user process can be corrupted by
seeing zeroed page unexpectedly.
CPU A CPU B
do_swap_page do_swap_page
SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path
swap_readpage valid data
swap_slot_free_notify
delete zram entry
swap_readpage zeroed(invalid) data
pte_lock
map the *zero data* to userspace
pte_unlock
pte_lock
if (!pte_same)
goto out_nomap;
pte_unlock
return and next refault will
read zeroed data
The swap_slot_free_notify is bogus for CLONE_VM case since it doesn't
increase the refcount of swap slot at copy_mm so it couldn't catch up
whether it's safe or not to discard data from backing device. In the
case, only the lock it could rely on to synchronize swap slot freeing is
page table lock. Thus, this patch gets rid of the swap_slot_free_notify
function. With this patch, CPU A will see correct data.
CPU A CPU B
do_swap_page do_swap_page
SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path
swap_readpage original data
pte_lock
map the original data
swap_free
swap_range_free
bd_disk->fops->swap_slot_free_notify
swap_readpage read zeroed data
pte_unlock
pte_lock
if (!pte_same)
goto out_nomap;
pte_unlock
return
on next refault will see mapped data by CPU B
The concern of the patch would increase memory consumption since it could
keep wasted memory with compressed form in zram as well as uncompressed
form in address space. However, most of cases of zram uses no readahead
and do_swap_page is followed by swap_free so it will free the compressed
form from in zram quickly.
Link: https://lkml.kernel.org/r/YjTVVxIAsnKAXjTd@google.com
Fixes: 0bcac06f27d7 ("mm, swap: skip swapcache for swapin of synchronous device")
Reported-by: Ivan Babrou <ivan(a)cloudflare.com>
Tested-by: Ivan Babrou <ivan(a)cloudflare.com>
Signed-off-by: Minchan Kim <minchan(a)kernel.org>
Cc: Nitin Gupta <ngupta(a)vflare.org>
Cc: Sergey Senozhatsky <senozhatsky(a)chromium.org>
Cc: Jens Axboe <axboe(a)kernel.dk>
Cc: David Hildenbrand <david(a)redhat.com>
Cc: <stable(a)vger.kernel.org> [4.14+]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/page_io.c | 54 -------------------------------------------------
1 file changed, 54 deletions(-)
--- a/mm/page_io.c~mm-fix-unexpected-zeroed-page-mapping-with-zram-swap
+++ a/mm/page_io.c
@@ -51,54 +51,6 @@ void end_swap_bio_write(struct bio *bio)
bio_put(bio);
}
-static void swap_slot_free_notify(struct page *page)
-{
- struct swap_info_struct *sis;
- struct gendisk *disk;
- swp_entry_t entry;
-
- /*
- * There is no guarantee that the page is in swap cache - the software
- * suspend code (at least) uses end_swap_bio_read() against a non-
- * swapcache page. So we must check PG_swapcache before proceeding with
- * this optimization.
- */
- if (unlikely(!PageSwapCache(page)))
- return;
-
- sis = page_swap_info(page);
- if (data_race(!(sis->flags & SWP_BLKDEV)))
- return;
-
- /*
- * The swap subsystem performs lazy swap slot freeing,
- * expecting that the page will be swapped out again.
- * So we can avoid an unnecessary write if the page
- * isn't redirtied.
- * This is good for real swap storage because we can
- * reduce unnecessary I/O and enhance wear-leveling
- * if an SSD is used as the as swap device.
- * But if in-memory swap device (eg zram) is used,
- * this causes a duplicated copy between uncompressed
- * data in VM-owned memory and compressed data in
- * zram-owned memory. So let's free zram-owned memory
- * and make the VM-owned decompressed page *dirty*,
- * so the page should be swapped out somewhere again if
- * we again wish to reclaim it.
- */
- disk = sis->bdev->bd_disk;
- entry.val = page_private(page);
- if (disk->fops->swap_slot_free_notify && __swap_count(entry) == 1) {
- unsigned long offset;
-
- offset = swp_offset(entry);
-
- SetPageDirty(page);
- disk->fops->swap_slot_free_notify(sis->bdev,
- offset);
- }
-}
-
static void end_swap_bio_read(struct bio *bio)
{
struct page *page = bio_first_page_all(bio);
@@ -114,7 +66,6 @@ static void end_swap_bio_read(struct bio
}
SetPageUptodate(page);
- swap_slot_free_notify(page);
out:
unlock_page(page);
WRITE_ONCE(bio->bi_private, NULL);
@@ -394,11 +345,6 @@ int swap_readpage(struct page *page, boo
if (sis->flags & SWP_SYNCHRONOUS_IO) {
ret = bdev_read_page(sis->bdev, swap_page_sector(page), page);
if (!ret) {
- if (trylock_page(page)) {
- swap_slot_free_notify(page);
- unlock_page(page);
- }
-
count_vm_event(PSWPIN);
goto out;
}
_
Patches currently in -mm which might be from minchan(a)kernel.org are
mm-fix-unexpected-zeroed-page-mapping-with-zram-swap.patch
The previous commit fixed a memory leak on the send path in the event
that IPv6 is disabled at compile time, but how did a packet even arrive
there to begin with? It turns out we have previously allowed IPv6
endpoints even when IPv6 support is disabled at compile time. This is
awkward and inconsistent. Instead, let's just ignore all things IPv6,
the same way we do other malformed endpoints, in the case where IPv6 is
disabled.
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: stable(a)vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason(a)zx2c4.com>
---
drivers/net/wireguard/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c
index 467eef0e563b..0414d7a6ce74 100644
--- a/drivers/net/wireguard/socket.c
+++ b/drivers/net/wireguard/socket.c
@@ -242,7 +242,7 @@ int wg_socket_endpoint_from_skb(struct endpoint *endpoint,
endpoint->addr4.sin_addr.s_addr = ip_hdr(skb)->saddr;
endpoint->src4.s_addr = ip_hdr(skb)->daddr;
endpoint->src_if4 = skb->skb_iif;
- } else if (skb->protocol == htons(ETH_P_IPV6)) {
+ } else if (IS_ENABLED(CONFIG_IPV6) && skb->protocol == htons(ETH_P_IPV6)) {
endpoint->addr6.sin6_family = AF_INET6;
endpoint->addr6.sin6_port = udp_hdr(skb)->source;
endpoint->addr6.sin6_addr = ipv6_hdr(skb)->saddr;
@@ -285,7 +285,7 @@ void wg_socket_set_peer_endpoint(struct wg_peer *peer,
peer->endpoint.addr4 = endpoint->addr4;
peer->endpoint.src4 = endpoint->src4;
peer->endpoint.src_if4 = endpoint->src_if4;
- } else if (endpoint->addr.sa_family == AF_INET6) {
+ } else if (IS_ENABLED(CONFIG_IPV6) && endpoint->addr.sa_family == AF_INET6) {
peer->endpoint.addr6 = endpoint->addr6;
peer->endpoint.src6 = endpoint->src6;
} else {
--
2.35.1
We make too nuanced use of ptr_ring to entirely move to the skb_array
wrappers, but we at least should avoid the naughty function pointer cast
when cleaning up skbs. Otherwise RAP/CFI will honk at us. This patch
uses the __skb_array_destroy_skb wrapper for the cleanup, rather than
directly providing kfree_skb, which is what other drivers in the same
situation do too.
Reported-by: PaX Team <pageexec(a)freemail.hu>
Fixes: 886fcee939ad ("wireguard: receive: use ring buffer for incoming handshakes")
Cc: stable(a)vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason(a)zx2c4.com>
---
drivers/net/wireguard/queueing.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireguard/queueing.c b/drivers/net/wireguard/queueing.c
index 1de413b19e34..8084e7408c0a 100644
--- a/drivers/net/wireguard/queueing.c
+++ b/drivers/net/wireguard/queueing.c
@@ -4,6 +4,7 @@
*/
#include "queueing.h"
+#include <linux/skb_array.h>
struct multicore_worker __percpu *
wg_packet_percpu_multicore_worker_alloc(work_func_t function, void *ptr)
@@ -42,7 +43,7 @@ void wg_packet_queue_free(struct crypt_queue *queue, bool purge)
{
free_percpu(queue->worker);
WARN_ON(!purge && !__ptr_ring_empty(&queue->ring));
- ptr_ring_cleanup(&queue->ring, purge ? (void(*)(void*))kfree_skb : NULL);
+ ptr_ring_cleanup(&queue->ring, purge ? __skb_array_destroy_skb : NULL);
}
#define NEXT(skb) ((skb)->prev)
--
2.35.1