From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B5B4C43334 for ; Mon, 27 Jun 2022 11:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235542AbiF0LaL (ORCPT ); Mon, 27 Jun 2022 07:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235408AbiF0L3H (ORCPT ); Mon, 27 Jun 2022 07:29:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BAAFB7; Mon, 27 Jun 2022 04:28:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 56774614A0; Mon, 27 Jun 2022 11:28:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6028FC341C7; Mon, 27 Jun 2022 11:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329284; bh=qBg9c1Wa0DxN8KQkjTmsMOTevIElqmC9fhezyiiKe7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YY8oO+uSY8Qs96Q2yWZZJDQgR87QPDfqsbxkGN4j8dgWWD2NwSfzK5/1mvXohjJmV vz1NALp4OBHdn9rQtKBkl+Ly2RAynXuTVdykY6VU5FRrAy1n6W0KeQsQ/lmIoA7CXo lVZrx8Tqn+n6iFEZPXd5k4xrjWQ0A/q+p+XeW7A8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Slaby , guodaxing Subject: [PATCH 5.4 01/60] vt: drop old FONT ioctls Date: Mon, 27 Jun 2022 13:21:12 +0200 Message-Id: <20220627111927.688770302@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jiri Slaby commit ff2047fb755d4415ec3c70ac799889371151796d upstream. Drop support for these ioctls: * PIO_FONT, PIO_FONTX * GIO_FONT, GIO_FONTX * PIO_FONTRESET As was demonstrated by commit 90bfdeef83f1 (tty: make FONTX ioctl use the tty pointer they were actually passed), these ioctls are not used from userspace, as: 1) they used to be broken (set up font on current console, not the open one) and racy (before the commit above) 2) KDFONTOP ioctl is used for years instead Note that PIO_FONTRESET is defunct on most systems as VGA_CONSOLE is set on them for ages. That turns on BROKEN_GRAPHICS_PROGRAMS which makes PIO_FONTRESET just return an error. We are removing KD_FONT_FLAG_OLD here as it was used only by these removed ioctls. kd.h header exists both in kernel and uapi headers, so we can remove the kernel one completely. Everyone includeing kd.h will now automatically get the uapi one. There are now unused definitions of the ioctl numbers and "struct consolefontdesc" in kd.h, but as it is a uapi header, I am not touching these. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210105120239.28031-8-jslaby@suse.cz Cc: guodaxing Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/tty/vt/vt.c | 39 ------------ drivers/tty/vt/vt_ioctl.c | 147 -----------------------------------------= ----- include/linux/kd.h | 8 -- 3 files changed, 3 insertions(+), 191 deletions(-) delete mode 100644 include/linux/kd.h --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4541,16 +4541,8 @@ static int con_font_get(struct vc_data * =20 if (op->data && font.charcount > op->charcount) rc =3D -ENOSPC; - if (!(op->flags & KD_FONT_FLAG_OLD)) { - if (font.width > op->width || font.height > op->height)=20 - rc =3D -ENOSPC; - } else { - if (font.width !=3D 8) - rc =3D -EIO; - else if ((op->height && font.height > op->height) || - font.height > 32) - rc =3D -ENOSPC; - } + if (font.width > op->width || font.height > op->height) + rc =3D -ENOSPC; if (rc) goto out; =20 @@ -4578,7 +4570,7 @@ static int con_font_set(struct vc_data * return -EINVAL; if (op->charcount > 512) return -EINVAL; - if (op->width <=3D 0 || op->width > 32 || op->height > 32) + if (op->width <=3D 0 || op->width > 32 || !op->height || op->height > 32) return -EINVAL; size =3D (op->width+7)/8 * 32 * op->charcount; if (size > max_font_size) @@ -4588,31 +4580,6 @@ static int con_font_set(struct vc_data * if (IS_ERR(font.data)) return PTR_ERR(font.data); =20 - if (!op->height) { /* Need to guess font height [compat] */ - int h, i; - u8 *charmap =3D font.data; - - /* - * If from KDFONTOP ioctl, don't allow things which can be done - * in userland,so that we can get rid of this soon - */ - if (!(op->flags & KD_FONT_FLAG_OLD)) { - kfree(font.data); - return -EINVAL; - } - - for (h =3D 32; h > 0; h--) - for (i =3D 0; i < op->charcount; i++) - if (charmap[32*i+h-1]) - goto nonzero; - - kfree(font.data); - return -EINVAL; - - nonzero: - op->height =3D h; - } - font.charcount =3D op->charcount; font.width =3D op->width; font.height =3D op->height; --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c @@ -241,48 +241,6 @@ int vt_waitactive(int n) #define GPLAST 0x3df #define GPNUM (GPLAST - GPFIRST + 1) =20 - - -static inline int=20 -do_fontx_ioctl(struct vc_data *vc, int cmd, struct consolefontdesc __user = *user_cfd, int perm, struct console_font_op *op) -{ - struct consolefontdesc cfdarg; - int i; - - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct consolefontdesc)))=20 - return -EFAULT; - =09 - switch (cmd) { - case PIO_FONTX: - if (!perm) - return -EPERM; - op->op =3D KD_FONT_OP_SET; - op->flags =3D KD_FONT_FLAG_OLD; - op->width =3D 8; - op->height =3D cfdarg.charheight; - op->charcount =3D cfdarg.charcount; - op->data =3D cfdarg.chardata; - return con_font_op(vc, op); - - case GIO_FONTX: - op->op =3D KD_FONT_OP_GET; - op->flags =3D KD_FONT_FLAG_OLD; - op->width =3D 8; - op->height =3D cfdarg.charheight; - op->charcount =3D cfdarg.charcount; - op->data =3D cfdarg.chardata; - i =3D con_font_op(vc, op); - if (i) - return i; - cfdarg.charheight =3D op->height; - cfdarg.charcount =3D op->charcount; - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc))) - return -EFAULT; - return 0; - } - return -EINVAL; -} - static inline int=20 do_unimap_ioctl(int cmd, struct unimapdesc __user *user_ud, int perm, stru= ct vc_data *vc) { @@ -919,30 +877,6 @@ int vt_ioctl(struct tty_struct *tty, break; } =20 - case PIO_FONT: { - if (!perm) - return -EPERM; - op.op =3D KD_FONT_OP_SET; - op.flags =3D KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibili= ty */ - op.width =3D 8; - op.height =3D 0; - op.charcount =3D 256; - op.data =3D up; - ret =3D con_font_op(vc, &op); - break; - } - - case GIO_FONT: { - op.op =3D KD_FONT_OP_GET; - op.flags =3D KD_FONT_FLAG_OLD; - op.width =3D 8; - op.height =3D 32; - op.charcount =3D 256; - op.data =3D up; - ret =3D con_font_op(vc, &op); - break; - } - case PIO_CMAP: if (!perm) ret =3D -EPERM; @@ -954,36 +888,6 @@ int vt_ioctl(struct tty_struct *tty, ret =3D con_get_cmap(up); break; =20 - case PIO_FONTX: - case GIO_FONTX: - ret =3D do_fontx_ioctl(vc, cmd, up, perm, &op); - break; - - case PIO_FONTRESET: - { - if (!perm) - return -EPERM; - -#ifdef BROKEN_GRAPHICS_PROGRAMS - /* With BROKEN_GRAPHICS_PROGRAMS defined, the default - font is not saved. */ - ret =3D -ENOSYS; - break; -#else - { - op.op =3D KD_FONT_OP_SET_DEFAULT; - op.data =3D NULL; - ret =3D con_font_op(vc, &op); - if (ret) - break; - console_lock(); - con_set_default_unimap(vc); - console_unlock(); - break; - } -#endif - } - case KDFONTOP: { if (copy_from_user(&op, up, sizeof(op))) { ret =3D -EFAULT; @@ -1097,54 +1001,6 @@ void vc_SAK(struct work_struct *work) =20 #ifdef CONFIG_COMPAT =20 -struct compat_consolefontdesc { - unsigned short charcount; /* characters in font (256 or 512) */ - unsigned short charheight; /* scan lines per character (1-32) */ - compat_caddr_t chardata; /* font data in expanded form */ -}; - -static inline int -compat_fontx_ioctl(struct vc_data *vc, int cmd, - struct compat_consolefontdesc __user *user_cfd, - int perm, struct console_font_op *op) -{ - struct compat_consolefontdesc cfdarg; - int i; - - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct compat_consolefontdes= c))) - return -EFAULT; - - switch (cmd) { - case PIO_FONTX: - if (!perm) - return -EPERM; - op->op =3D KD_FONT_OP_SET; - op->flags =3D KD_FONT_FLAG_OLD; - op->width =3D 8; - op->height =3D cfdarg.charheight; - op->charcount =3D cfdarg.charcount; - op->data =3D compat_ptr(cfdarg.chardata); - return con_font_op(vc, op); - - case GIO_FONTX: - op->op =3D KD_FONT_OP_GET; - op->flags =3D KD_FONT_FLAG_OLD; - op->width =3D 8; - op->height =3D cfdarg.charheight; - op->charcount =3D cfdarg.charcount; - op->data =3D compat_ptr(cfdarg.chardata); - i =3D con_font_op(vc, op); - if (i) - return i; - cfdarg.charheight =3D op->height; - cfdarg.charcount =3D op->charcount; - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct compat_consolefontdesc= ))) - return -EFAULT; - return 0; - } - return -EINVAL; -} - struct compat_console_font_op { compat_uint_t op; /* operation code KD_FONT_OP_* */ compat_uint_t flags; /* KD_FONT_FLAG_* */ @@ -1221,9 +1077,6 @@ long vt_compat_ioctl(struct tty_struct * /* * these need special handlers for incompatible data structures */ - case PIO_FONTX: - case GIO_FONTX: - return compat_fontx_ioctl(vc, cmd, up, perm, &op); =20 case KDFONTOP: return compat_kdfontop_ioctl(up, perm, &op, vc); --- a/include/linux/kd.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _LINUX_KD_H -#define _LINUX_KD_H - -#include - -#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat]= */ -#endif /* _LINUX_KD_H */ From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 887F3C433EF for ; Mon, 27 Jun 2022 11:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236126AbiF0Lfj (ORCPT ); Mon, 27 Jun 2022 07:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236107AbiF0LdP (ORCPT ); Mon, 27 Jun 2022 07:33:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B17DB2E8; Mon, 27 Jun 2022 04:30:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4F3736141D; Mon, 27 Jun 2022 11:30:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E169C3411D; Mon, 27 Jun 2022 11:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329417; bh=h1N85u9a3APp1yw2woC9p/8mzkK2TLZrhyjIps8M9WU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jnPJ56+lRcbQMruB9fIppf44L3pUT9XKE2xITQRDtAyB6lmZUTXGB5gbIoHKzInpK +3BEsPryJR3Pe8l+SHJlboiALY94r8QE6IFOJ63vP4uKg+WMDCkjnakJPth9COqYSg vFBJuSVNqXP7pFEGiFv4HBImae3DofY8dlULgPZs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dominik Brodowski , Sebastian Andrzej Siewior , "Jason A. Donenfeld" Subject: [PATCH 5.4 02/60] random: schedule mix_interrupt_randomness() less often Date: Mon, 27 Jun 2022 13:21:13 +0200 Message-Id: <20220627111927.719224755@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jason A. Donenfeld commit 534d2eaf1970274150596fdd2bf552721e65d6b2 upstream. It used to be that mix_interrupt_randomness() would credit 1 bit each time it ran, and so add_interrupt_randomness() would schedule mix() to run every 64 interrupts, a fairly arbitrary number, but nonetheless considered to be a decent enough conservative estimate. Since e3e33fc2ea7f ("random: do not use input pool from hard IRQs"), mix() is now able to credit multiple bits, depending on the number of calls to add(). This was done for reasons separate from this commit, but it has the nice side effect of enabling this patch to schedule mix() less often. Currently the rules are: a) Credit 1 bit for every 64 calls to add(). b) Schedule mix() once a second that add() is called. c) Schedule mix() once every 64 calls to add(). Rules (a) and (c) no longer need to be coupled. It's still important to have _some_ value in (c), so that we don't "over-saturate" the fast pool, but the once per second we get from rule (b) is a plenty enough baseline. So, by increasing the 64 in rule (c) to something larger, we avoid calling queue_work_on() as frequently during irq storms. This commit changes that 64 in rule (c) to be 1024, which means we schedule mix() 16 times less often. And it does *not* need to change the 64 in rule (a). Fixes: 58340f8e952b ("random: defer fast pool mixing to worker") Cc: stable@vger.kernel.org Cc: Dominik Brodowski Acked-by: Sebastian Andrzej Siewior Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -996,7 +996,7 @@ void add_interrupt_randomness(int irq) if (new_count & MIX_INFLIGHT) return; =20 - if (new_count < 64 && !time_is_before_jiffies(fast_pool->last + HZ)) + if (new_count < 1024 && !time_is_before_jiffies(fast_pool->last + HZ)) return; =20 if (unlikely(!fast_pool->mix.func)) From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99073C433EF for ; Mon, 27 Jun 2022 11:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235442AbiF0LaT (ORCPT ); Mon, 27 Jun 2022 07:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235419AbiF0L3N (ORCPT ); Mon, 27 Jun 2022 07:29:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0B8109; Mon, 27 Jun 2022 04:28:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D06F61494; Mon, 27 Jun 2022 11:28:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39F97C3411D; Mon, 27 Jun 2022 11:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329290; bh=NqWKPAx54vazXc3qKoDsW40jReYuUC9TIV8zapkZdIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mjtouuWwTbNllOMFg/k8oV6IGa1i4Vmy7jdM81p27HdTlg5Zcka/O6By316TrSMdv ElWneVZpW56k6/awhPyTbWwLR2moVAlOP02l/pc2n3fDs1P70flMyjLsHq1tZ2vzVG vXxdITunATjDZkxDd1xmcS7zqESTkiUzXA2CdtCs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.4 03/60] ALSA: hda/via: Fix missing beep setup Date: Mon, 27 Jun 2022 13:21:14 +0200 Message-Id: <20220627111927.748906353@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Takashi Iwai commit c7807b27d510e5aa53c8a120cfc02c33c24ebb5f upstream. Like the previous fix for Conexant codec, the beep_nid has to be set up before calling snd_hda_gen_parse_auto_config(); otherwise it'd miss the path setup. Fix the call order for addressing the missing beep setup. Fixes: 0e8f9862493a ("ALSA: hda/via - Simplify control management") Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216152 Link: https://lore.kernel.org/r/20220620104008.1994-2-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/hda/patch_via.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -520,11 +520,11 @@ static int via_parse_auto_config(struct if (err < 0) return err; =20 - err =3D snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); + err =3D auto_parse_beep(codec); if (err < 0) return err; =20 - err =3D auto_parse_beep(codec); + err =3D snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); if (err < 0) return err; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21CCFC433EF for ; Mon, 27 Jun 2022 11:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235654AbiF0Lbi (ORCPT ); Mon, 27 Jun 2022 07:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235505AbiF0LbG (ORCPT ); Mon, 27 Jun 2022 07:31:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C02ED43; Mon, 27 Jun 2022 04:28:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7810AB81120; Mon, 27 Jun 2022 11:28:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF189C3411D; Mon, 27 Jun 2022 11:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329325; bh=XOIx0qfVQ5fqLo+dyftsQnSrhrY/uehJbydbzUAbTuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ojnwlVzdBB+MwzPDqWnMernuopeZP4GtiFajVRKFkFr6o10gZrSvu45HbxJu8OW/ sr6hZY6/WbuGNQtU/FvZ5ICrznK0edlQjViAXC/buqZUjXqjLnsA/W3QbSnN5s/t6k NsRGAyXVG5xWnF/eF+Nop80QiAtSoDD880yx65PM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.4 04/60] ALSA: hda/conexant: Fix missing beep setup Date: Mon, 27 Jun 2022 13:21:15 +0200 Message-Id: <20220627111927.778951830@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Takashi Iwai commit 5faa0bc69102f3a4c605581564c367be5eb94dfa upstream. Currently the Conexant codec driver sets up the beep NID after calling snd_hda_gen_parse_auto_config(). It turned out that this results in the insufficient setup for the beep control, as the generic parser handles the fake path in snd_hda_gen_parse_auto_config() only if the beep_nid is set up beforehand. For dealing with the beep widget properly, call cx_auto_parse_beep() before snd_hda_gen_parse_auto_config() call. Fixes: 51e19ca5f755 ("ALSA: hda/conexant - Clean up beep code") Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216152 Link: https://lore.kernel.org/r/20220620104008.1994-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/hda/patch_conexant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -1048,11 +1048,11 @@ static int patch_conexant_auto(struct hd if (err < 0) goto error; =20 - err =3D snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); + err =3D cx_auto_parse_beep(codec); if (err < 0) goto error; =20 - err =3D cx_auto_parse_beep(codec); + err =3D snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); if (err < 0) goto error; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 813AFCCA481 for ; Mon, 27 Jun 2022 11:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235520AbiF0Ld4 (ORCPT ); Mon, 27 Jun 2022 07:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235499AbiF0LcD (ORCPT ); Mon, 27 Jun 2022 07:32:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767D52637; Mon, 27 Jun 2022 04:29:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 13D8261494; Mon, 27 Jun 2022 11:29:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00B5BC3411D; Mon, 27 Jun 2022 11:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329358; bh=Rse5J3isC+DufuGIxXJNKM33pL28cbW3lAk8M9k5KxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dxMLbBPp3xkr+zy1GCeroiBRi19usRTkiWX7xmkIg5ra7E1oE4irjaPxe0st2EZnb 6uPqpGwa6HRGzjtt7TIpQgKkzl+pX426EPGTnMVxFANUYjsFfPeYdlMTVcD0PcJDay DHoYoy8F9J02/a4Abm7zm2LF02c9tEmQOtcTdnDU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kailang Yang , Takashi Iwai Subject: [PATCH 5.4 05/60] ALSA: hda/realtek - ALC897 headset MIC no sound Date: Mon, 27 Jun 2022 13:21:16 +0200 Message-Id: <20220627111927.808204592@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kailang Yang commit fe6900bd8156467365bd5b976df64928fdebfeb0 upstream. There is not have Headset Mic verb table in BIOS default. So, it will have recording issue from headset MIC. Add the verb table value without jack detect. It will turn on Headset Mic. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/719133a27d8844a890002cb817001dfa@realtek.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/hda/patch_realtek.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -9805,6 +9805,7 @@ enum { ALC668_FIXUP_MIC_DET_COEF, ALC897_FIXUP_LENOVO_HEADSET_MIC, ALC897_FIXUP_HEADSET_MIC_PIN, + ALC897_FIXUP_HP_HSMIC_VERB, }; =20 static const struct hda_fixup alc662_fixups[] =3D { @@ -10224,6 +10225,13 @@ static const struct hda_fixup alc662_fix .chained =3D true, .chain_id =3D ALC897_FIXUP_LENOVO_HEADSET_MIC }, + [ALC897_FIXUP_HP_HSMIC_VERB] =3D { + .type =3D HDA_FIXUP_PINS, + .v.pins =3D (const struct hda_pintbl[]) { + { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detec= t */ + { } + }, + }, }; =20 static const struct snd_pci_quirk alc662_fixup_tbl[] =3D { @@ -10249,6 +10257,7 @@ static const struct snd_pci_quirk alc662 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), + SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB), SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MI= C2), SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FD86C433EF for ; Mon, 27 Jun 2022 11:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235794AbiF0LeR (ORCPT ); Mon, 27 Jun 2022 07:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235926AbiF0Lc4 (ORCPT ); Mon, 27 Jun 2022 07:32:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A29FE222; Mon, 27 Jun 2022 04:29:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3ADA561456; Mon, 27 Jun 2022 11:29:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42778C36AF6; Mon, 27 Jun 2022 11:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329391; bh=/QaahEWEP/FNbDW7blJ/3l3rhMLNvJ8Lgx7nCxAMYu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z9Px/HWypyeiuV4aQY8tsRlXRfLpeOn9AZ0/mC0jvDAbpbYxmy8DYRUXZJtETDfdI fUlmCYc0FT8U/PlRNDuwOS+eOU+DaJ9BcCT02U7zHYQ3GA+ecfyQ/aWD0s3f8X3jeT n0afq7gp/OF8wGc9XUGK8RwyktN6ech1vKExeLxg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Crawford , Takashi Iwai Subject: [PATCH 5.4 06/60] ALSA: hda/realtek: Add quirk for Clevo PD70PNT Date: Mon, 27 Jun 2022 13:21:17 +0200 Message-Id: <20220627111927.837891591@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tim Crawford commit d49951219b0249d3eff49e4f02e0de82357bc8a0 upstream. Fixes speaker output and headset detection on Clevo PD70PNT. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220617133028.50568-1-tcrawford@system76.c= om Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2585,6 +2585,7 @@ static const struct snd_pci_quirk alc882 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_= PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP= _CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB5= 1ED_PINS), + SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB= 51ED_PINS), SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_= PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_= PINS), SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51E= D), From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A75BFC433EF for ; Mon, 27 Jun 2022 11:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235841AbiF0Leh (ORCPT ); Mon, 27 Jun 2022 07:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236014AbiF0LdD (ORCPT ); Mon, 27 Jun 2022 07:33:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C09BCBE; Mon, 27 Jun 2022 04:30:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83FAEB81122; Mon, 27 Jun 2022 11:30:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6B6BC3411D; Mon, 27 Jun 2022 11:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329403; bh=SYnv/FhFH1ekUtV6eC1WyevHUII+0SmBoVZiwtyZeUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QKN5LpM20M6Ry22VMZJ1OYycawkQ8rWCm5zSqrZ7hBJhCAf0cBGx50/3dORJTA+yp WgAZ08QrgfFYSs2/aCxpI8/WGSZRwfw+kV9Tvjb7q5ehe29EtQ1b0w0TPGRIvs8Oby vnYTGJ7t1J8NPg1VSPVQGTu+WsRwQm8wn3JexPWI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rosemarie ORiorden , Eelco Chaudron , Paolo Abeni Subject: [PATCH 5.4 07/60] net: openvswitch: fix parsing of nw_proto for IPv6 fragments Date: Mon, 27 Jun 2022 13:21:18 +0200 Message-Id: <20220627111927.866949565@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Rosemarie O'Riorden commit 12378a5a75e33f34f8586706eb61cca9e6d4690c upstream. When a packet enters the OVS datapath and does not match any existing flows installed in the kernel flow cache, the packet will be sent to userspace to be parsed, and a new flow will be created. The kernel and OVS rely on each other to parse packet fields in the same way so that packets will be handled properly. As per the design document linked below, OVS expects all later IPv6 fragments to have nw_proto=3D44 in the flow key, so they can be correctly matched on OpenFlow rules. OpenFlow controllers create pipelines based on this design. This behavior was changed by the commit in the Fixes tag so that nw_proto equals the next_header field of the last extension header. However, there is no counterpart for this change in OVS userspace, meaning that this field is parsed differently between OVS and the kernel. This is a problem because OVS creates actions based on what is parsed in userspace, but the kernel-provided flow key is used as a match criteria, as described in Documentation/networking/openvswitch.rst. This leads to issues such as packets incorrectly matching on a flow and thus the wrong list of actions being applied to the packet. Such changes in packet parsing cannot be implemented without breaking the userspace. The offending commit is partially reverted to restore the expected behavior. The change technically made sense and there is a good reason that it was implemented, but it does not comply with the original design of OVS. If in the future someone wants to implement such a change, then it must be user-configurable and disabled by default to preserve backwards compatibility with existing OVS versions. Cc: stable@vger.kernel.org Fixes: fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later= frags") Link: https://docs.openvswitch.org/en/latest/topics/design/#fragments Signed-off-by: Rosemarie O'Riorden Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/20220621204845.9721-1-roriorden@redhat.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/openvswitch/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -265,7 +265,7 @@ static int parse_ipv6hdr(struct sk_buff if (flags & IP6_FH_F_FRAG) { if (frag_off) { key->ip.frag =3D OVS_FRAG_TYPE_LATER; - key->ip.proto =3D nexthdr; + key->ip.proto =3D NEXTHDR_FRAGMENT; return 0; } key->ip.frag =3D OVS_FRAG_TYPE_FIRST; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2CDFC433EF for ; Mon, 27 Jun 2022 11:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235854AbiF0Lej (ORCPT ); Mon, 27 Jun 2022 07:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236036AbiF0LdF (ORCPT ); Mon, 27 Jun 2022 07:33:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D852DBCB8; Mon, 27 Jun 2022 04:30:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 71C82B8112E; Mon, 27 Jun 2022 11:30:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF970C3411D; Mon, 27 Jun 2022 11:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329406; bh=MbXe0ur52wnHNXV65jswXkfskRWW47XRp/QkLCJo9nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YWDrUMewBj33EMio+vKdrPp1whs5ybk4j6TjjYULN6MjnAh3F+ZWktjcO7FTJXLQS yTsDbrq9+qm2ARDn0djMcDQdqoq6GNEO/qePH371wq7oao5tRbajQekF1TkGcsJWGu CEzJfP2TqrbzmlnW3qYbc9y6jTei83C8KN5wpBDc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chevron Li , Ulf Hansson Subject: [PATCH 5.4 08/60] mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing Date: Mon, 27 Jun 2022 13:21:19 +0200 Message-Id: <20220627111927.896346056@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Chevron Li commit e591fcf6b4e39335c9b128b17738fcd2fdd278ae upstream. The result from ->get_cd() may be incorrect as the card detect debouncing isn't managed correctly. Let's fix it. Signed-off-by: Chevron Li Fixes: 7d44061704dd ("mmc: sdhci-pci-o2micro: Fix O2 Host data read/write D= LL Lock phase shift issue") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220602132543.596-1-chevron.li@bayhubtech.= com [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/mmc/host/sdhci-pci-o2micro.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -145,6 +145,8 @@ static int sdhci_o2_get_cd(struct mmc_ho =20 if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS)) sdhci_o2_enable_internal_clock(host); + else + sdhci_o2_wait_card_detect_stable(host); =20 return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); } From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B844C43334 for ; Mon, 27 Jun 2022 11:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235873AbiF0Len (ORCPT ); Mon, 27 Jun 2022 07:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236058AbiF0LdH (ORCPT ); Mon, 27 Jun 2022 07:33:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8CB1BE05; Mon, 27 Jun 2022 04:30:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 663B8B8111A; Mon, 27 Jun 2022 11:30:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B77BBC3411D; Mon, 27 Jun 2022 11:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329409; bh=rluxQ2+A54yIjuuZuUh66DBwb2gFHEaBDbn3E7gQcac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t67rs93C1/aQz3AqZQXy4eQB/oPDJwh6vB5xMRj88sSgnbM4j+QEI6XeLqRDyI5hK taFLWT6k1FsXFfCpX3aBXTze+eRKccCzUhPEaQsH7f+hQ7zCViytNFnr7YcvIB14+C 2DDu9FAug+5ySfvGaVAX/1o9VFRg5H2k79r6Bv38= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sascha Hauer , Miquel Raynal Subject: [PATCH 5.4 09/60] mtd: rawnand: gpmi: Fix setting busy timeout setting Date: Mon, 27 Jun 2022 13:21:20 +0200 Message-Id: <20220627111927.925744356@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sascha Hauer commit 06781a5026350cde699d2d10c9914a25c1524f45 upstream. The DEVICE_BUSY_TIMEOUT value is described in the Reference Manual as: | Timeout waiting for NAND Ready/Busy or ATA IRQ. Used in WAIT_FOR_READY | mode. This value is the number of GPMI_CLK cycles multiplied by 4096. So instead of multiplying the value in cycles with 4096, we have to divide it by that value. Use DIV_ROUND_UP to make sure we are on the safe side, especially when the calculated value in cycles is smaller than 4096 as typically the case. This bug likely never triggered because any timeout !=3D 0 usually will do. In my case the busy timeout in cycles was originally calculated as 2408, which multiplied with 4096 is 0x968000. The lower 16 bits were taken for the 16 bit wide register field, so the register value was 0x8000. With 2970bf5a32f0 ("mtd: rawnand: gpmi: fix controller timings setting") however the value in cycles became 2384, which multiplied with 4096 is 0x950000. The lower 16 bit are 0x0 now resulting in an intermediate timeout when reading from NAND. Fixes: b1206122069aa ("mtd: rawnand: gpmi: use core timings instead of an e= mpirical derivation") Cc: stable@vger.kernel.org Signed-off-by: Sascha Hauer Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220614083138.3455683-1-s.hauer@pe= ngutronix.de Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -682,7 +682,7 @@ static void gpmi_nfc_compute_timings(str hw->timing0 =3D BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) | BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) | BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles); - hw->timing1 =3D BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096); + hw->timing1 =3D BF_GPMI_TIMING1_BUSY_TIMEOUT(DIV_ROUND_UP(busy_timeout_cy= cles, 4096)); =20 /* * Derive NFC ideal delay from {3}: From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 492EEC433EF for ; Mon, 27 Jun 2022 11:34:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235886AbiF0Leo (ORCPT ); Mon, 27 Jun 2022 07:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236069AbiF0LdI (ORCPT ); Mon, 27 Jun 2022 07:33:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24AA8BE3A; Mon, 27 Jun 2022 04:30:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 959D9614EF; Mon, 27 Jun 2022 11:30:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8893C341C7; Mon, 27 Jun 2022 11:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329412; bh=x7P22JytzPf6oNjq71S/evHGGCzh/+caYNfY3VnwaO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dFhrLzXJBD1u/FZnMj/Le4d46lsfXgyWjgS7W4WysTlDQEX17lN+WXq4NxodAArZF 8C9aVcKyZJ1J2h01Z/nIxzBBm7FgY+mwaYx6Sh+v3xRc+/Y/GmIOGXYsCdJbNLzHHd mhuhcWvA4p3oLyz2SkT16QgDb1/DFFcYGBZTU5Cg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Edward Wu , Damien Le Moal Subject: [PATCH 5.4 10/60] ata: libata: add qc->flags in ata_qc_complete_template tracepoint Date: Mon, 27 Jun 2022 13:21:21 +0200 Message-Id: <20220627111927.955056698@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Edward Wu commit 540a92bfe6dab7310b9df2e488ba247d784d0163 upstream. Add flags value to check the result of ata completion Fixes: 255c03d15a29 ("libata: Add tracepoints") Cc: stable@vger.kernel.org Signed-off-by: Edward Wu Signed-off-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- include/trace/events/libata.h | 1 + 1 file changed, 1 insertion(+) --- a/include/trace/events/libata.h +++ b/include/trace/events/libata.h @@ -249,6 +249,7 @@ DECLARE_EVENT_CLASS(ata_qc_complete_temp __entry->hob_feature =3D qc->result_tf.hob_feature; __entry->nsect =3D qc->result_tf.nsect; __entry->hob_nsect =3D qc->result_tf.hob_nsect; + __entry->flags =3D qc->flags; ), =20 TP_printk("ata_port=3D%u ata_dev=3D%u tag=3D%d flags=3D%s status=3D%s " \ From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCC60C43334 for ; Mon, 27 Jun 2022 11:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235918AbiF0Ler (ORCPT ); Mon, 27 Jun 2022 07:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236092AbiF0LdK (ORCPT ); Mon, 27 Jun 2022 07:33:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B19FBE2B; Mon, 27 Jun 2022 04:30:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5969E61510; Mon, 27 Jun 2022 11:30:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68236C3411D; Mon, 27 Jun 2022 11:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329414; bh=cuO2nTisTqBS0cLwTF9hisxzJeuL2o6+A2Rz7bYaU/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=msKQhhZZfmwNbaPw/bts5dgyCB2ZJKJ3ljYK5i5cN9kdYHUq5CYtEPpC6oo4O9W1L p3Cn0VIZ44oknn/RmKAW7KPOX6oZqnHAgviot11fcndA/YmO1YxSHic+xXpWDrRrSk GZUZ/SQW/N0G9kBqzUXMkox2o3wTLg2DQs4xBcXo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikos Tsironis , Mike Snitzer Subject: [PATCH 5.4 11/60] dm era: commit metadata in postsuspend after worker stops Date: Mon, 27 Jun 2022 13:21:22 +0200 Message-Id: <20220627111927.985048485@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Nikos Tsironis commit 9ae6e8b1c9bbf6874163d1243e393137313762b7 upstream. During postsuspend dm-era does the following: 1. Archives the current era 2. Commits the metadata, as part of the RPC call for archiving the current era 3. Stops the worker Until the worker stops, it might write to the metadata again. Moreover, these writes are not flushed to disk immediately, but are cached by the dm-bufio client, which writes them back asynchronously. As a result, the committed metadata of a suspended dm-era device might not be consistent with the in-core metadata. In some cases, this can result in the corruption of the on-disk metadata. Suppose the following sequence of events: 1. Load a new table, e.g. a snapshot-origin table, to a device with a dm-era table 2. Suspend the device 3. dm-era commits its metadata, but the worker does a few more metadata writes until it stops, as part of digesting an archived writeset 4. These writes are cached by the dm-bufio client 5. Load the dm-era table to another device. 6. The new instance of the dm-era target loads the committed, on-disk metadata, which don't include the extra writes done by the worker after the metadata commit. 7. Resume the new device 8. The new dm-era target instance starts using the metadata 9. Resume the original device 10. The destructor of the old dm-era target instance is called and destroys the dm-bufio client, which results in flushing the cached writes to disk 11. These writes might overwrite the writes done by the new dm-era instance, hence corrupting its metadata. Fix this by committing the metadata after the worker stops running. stop_worker uses flush_workqueue to flush the current work. However, the work item may re-queue itself and flush_workqueue doesn't wait for re-queued works to finish. This could result in the worker changing the metadata after they have been committed, or writing to the metadata concurrently with the commit in the postsuspend thread. Use drain_workqueue instead, which waits until the work and all re-queued works finish. Fixes: eec40579d8487 ("dm: add era target") Cc: stable@vger.kernel.org # v3.15+ Signed-off-by: Nikos Tsironis Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/md/dm-era-target.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/md/dm-era-target.c +++ b/drivers/md/dm-era-target.c @@ -1397,7 +1397,7 @@ static void start_worker(struct era *era static void stop_worker(struct era *era) { atomic_set(&era->suspended, 1); - flush_workqueue(era->wq); + drain_workqueue(era->wq); } =20 /*---------------------------------------------------------------- @@ -1581,6 +1581,12 @@ static void era_postsuspend(struct dm_ta } =20 stop_worker(era); + + r =3D metadata_commit(era->md); + if (r) { + DMERR("%s: metadata_commit failed", __func__); + /* FIXME: fail mode */ + } } =20 static int era_preresume(struct dm_target *ti) From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59F6BC433EF for ; Mon, 27 Jun 2022 11:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235434AbiF0LaO (ORCPT ); Mon, 27 Jun 2022 07:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235420AbiF0L3N (ORCPT ); Mon, 27 Jun 2022 07:29:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D85CC131; Mon, 27 Jun 2022 04:28:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 756D061456; Mon, 27 Jun 2022 11:28:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3219DC3411D; Mon, 27 Jun 2022 11:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329293; bh=A2migJAf3lhueRVP05DdDRYtA3dnSY0+3MDuPOjx5+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cAmAoMrlsvb2u5BBuRiwM8uhJF2lfGDY3c2Lt6sqKnIn1uioYN4eCrk7BHkpCZ2ah Kqkmp2PrtXofyWCiNKWl/9nyPpLme21UtopVYtIjDPsKkstMpCfJ7j2tu1zRSu+OD3 xADEP9DHJ504ES2nVlOh+AJ1dtT/1tTO7MUY1xRk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Marzinski , Mikulas Patocka , Mike Snitzer Subject: [PATCH 5.4 12/60] dm mirror log: clear log bits up to BITS_PER_LONG boundary Date: Mon, 27 Jun 2022 13:21:23 +0200 Message-Id: <20220627111928.015873235@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mikulas Patocka commit 90736eb3232d208ee048493f371075e4272e0944 upstream. Commit 85e123c27d5c ("dm mirror log: round up region bitmap size to BITS_PER_LONG") introduced a regression on 64-bit architectures in the lvm testsuite tests: lvcreate-mirror, mirror-names and vgsplit-operation. If the device is shrunk, we need to clear log bits beyond the end of the device. The code clears bits up to a 32-bit boundary and then calculates lc->sync_count by summing set bits up to a 64-bit boundary (the commit changed that; previously, this boundary was 32-bit too). So, it was using some non-zeroed bits in the calculation and this caused misbehavior. Fix this regression by clearing bits up to BITS_PER_LONG boundary. Fixes: 85e123c27d5c ("dm mirror log: round up region bitmap size to BITS_PE= R_LONG") Cc: stable@vger.kernel.org Reported-by: Benjamin Marzinski Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/md/dm-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -615,7 +615,7 @@ static int disk_resume(struct dm_dirty_l log_clear_bit(lc, lc->clean_bits, i); =20 /* clear any old bits -- device has shrunk */ - for (i =3D lc->region_count; i % (sizeof(*lc->clean_bits) << BYTE_SHIFT);= i++) + for (i =3D lc->region_count; i % BITS_PER_LONG; i++) log_clear_bit(lc, lc->clean_bits, i); =20 /* copy clean across to sync */ From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1A70C433EF for ; Mon, 27 Jun 2022 11:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235570AbiF0La2 (ORCPT ); Mon, 27 Jun 2022 07:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235260AbiF0L3W (ORCPT ); Mon, 27 Jun 2022 07:29:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D8C282; Mon, 27 Jun 2022 04:28:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6FF88B81117; Mon, 27 Jun 2022 11:28:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB71BC341C8; Mon, 27 Jun 2022 11:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329297; bh=r/AUmqVNZ/rqk8TyaWRYjSqZNwcpqBfVSV8e106GGsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDABpeYSYDTuYz7ukqDcaMTnOqfdo8VRSvoMqsX44DxyNuVg3mYzkVGGZt1P3hW0S GHKSq50I/nBkXdSz0t59NhFEwYsMD7Ee2n2+9pC9DJDY19ddEqIYtyHTo54lEU/4yS 6aIHY57Q5H0vadHwgLLNPuHNjCXNDJiGtPsMxCvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Hunter , Ron Economos , "Jason A. Donenfeld" Subject: [PATCH 5.4 13/60] random: quiet urandom warning ratelimit suppression message Date: Mon, 27 Jun 2022 13:21:24 +0200 Message-Id: <20220627111928.045896631@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jason A. Donenfeld commit c01d4d0a82b71857be7449380338bc53dde2da92 upstream. random.c ratelimits how much it warns about uninitialized urandom reads using __ratelimit(). When the RNG is finally initialized, it prints the number of missed messages due to ratelimiting. It has been this way since that functionality was introduced back in 2018. Recently, cc1e127bfa95 ("random: remove ratelimiting for in-kernel unseeded randomness") put a bit more stress on the urandom ratelimiting, which teased out a bug in the implementation. Specifically, when under pressure, __ratelimit() will print its own message and reset the count back to 0, making the final message at the end less useful. Secondly, it does so as a pr_warn(), which apparently is undesirable for people's CI. Fortunately, __ratelimit() has the RATELIMIT_MSG_ON_RELEASE flag exactly for this purpose, so we set the flag. Fixes: 4e00b339e264 ("random: rate limit unseeded randomness warnings") Cc: stable@vger.kernel.org Reported-by: Jon Hunter Reported-by: Ron Economos Tested-by: Ron Economos Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/char/random.c | 2 +- include/linux/ratelimit.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -88,7 +88,7 @@ static RAW_NOTIFIER_HEAD(random_ready_ch =20 /* Control how we warn userspace. */ static struct ratelimit_state urandom_warning =3D - RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3); + RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_REL= EASE); static int ratelimit_disable __read_mostly =3D IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM); module_param_named(ratelimit_disable, ratelimit_disable, int, 0644); --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h @@ -23,12 +23,16 @@ struct ratelimit_state { unsigned long flags; }; =20 -#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) { \ - .lock =3D __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ - .interval =3D interval_init, \ - .burst =3D burst_init, \ +#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_= init) { \ + .lock =3D __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ + .interval =3D interval_init, \ + .burst =3D burst_init, \ + .flags =3D flags_init, \ } =20 +#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \ + RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0) + #define RATELIMIT_STATE_INIT_DISABLED \ RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST) From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D03C43334 for ; Mon, 27 Jun 2022 11:30:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235459AbiF0Lad (ORCPT ); Mon, 27 Jun 2022 07:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235271AbiF0L3Y (ORCPT ); Mon, 27 Jun 2022 07:29:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE5F82A9; Mon, 27 Jun 2022 04:28:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 40089B8111E; Mon, 27 Jun 2022 11:28:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94464C3411D; Mon, 27 Jun 2022 11:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329300; bh=hGuOut/iB47OP+a8fIGR+FF0ZAQpLfuGm7US7TJUxkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6QdpYdojzuOV5Cr/lo/UL1yqN9dhKm/Z+h4SW3qRdyuqtTu4LYRGvzhUfXh6P3P5 XXjDiI1V6sw+e/Wy+dF4BVRU4x2HF8NILre0nWjbrHJvuTpaE6yM52VMAnYzP0z/hr vhOe/rdTU/R2UmrBgntpTmViJvrundrVx3cfxU/A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniele Palmas , Carlo Lobrano , Johan Hovold Subject: [PATCH 5.4 14/60] USB: serial: option: add Telit LE910Cx 0x1250 composition Date: Mon, 27 Jun 2022 13:21:25 +0200 Message-Id: <20220627111928.077293197@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Carlo Lobrano commit 342fc0c3b345525da21112bd0478a0dc741598ea upstream. Add support for the following Telit LE910Cx composition: 0x1250: rmnet, tty, tty, tty, tty Reviewed-by: Daniele Palmas Signed-off-by: Carlo Lobrano Link: https://lore.kernel.org/r/20220614075623.2392607-1-c.lobrano@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1279,6 +1279,7 @@ static const struct usb_device_id option .driver_info =3D NCTRL(0) | RSVD(1) | RSVD(2) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE9= 10Cx (RNDIS) */ .driver_info =3D NCTRL(2) | RSVD(3) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00= ) }, /* Telit LE910Cx (rmnet) */ { USB_DEVICE(TELIT_VENDOR_ID, 0x1260), .driver_info =3D NCTRL(0) | RSVD(1) | RSVD(2) }, { USB_DEVICE(TELIT_VENDOR_ID, 0x1261), From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68CAEC43334 for ; Mon, 27 Jun 2022 11:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235584AbiF0Lar (ORCPT ); Mon, 27 Jun 2022 07:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235460AbiF0L3e (ORCPT ); Mon, 27 Jun 2022 07:29:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED55E33B; Mon, 27 Jun 2022 04:28:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A3D81B81123; Mon, 27 Jun 2022 11:28:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09A02C36AF3; Mon, 27 Jun 2022 11:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329303; bh=trcPkf+EXPWSnihqZu36c4JcAydRwY2vhM6nuMOJUUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zLs7eXLG24unDYqN0kslKWdDG1p1vYP3VUU78Qoa6Klcn+UFQMI4OQkZd05yO6kc5 wlUEIQrst0IXodsp5cdvfWvIH7Mix/dF3GZdmZNgjAh9kAInfcTbrqh5E/x+eOdkiF gdToVIp8sLlDg0fuzOevXyfJtDsP3PZAzPpNcZS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglin Tan , Johan Hovold Subject: [PATCH 5.4 15/60] USB: serial: option: add Quectel EM05-G modem Date: Mon, 27 Jun 2022 13:21:26 +0200 Message-Id: <20220627111928.107308193@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yonglin Tan commit 33b29dbb39bcbd0a96e440646396bbf670b914fa upstream. The EM05-G modem has 2 USB configurations that are configurable via the AT command AT+QCFG=3D"usbnet",[ 0 | 2 ] which make the modem enumerate with the following interfaces, respectively: "RMNET" : AT + DIAG + NMEA + Modem + QMI "MBIM" : MBIM + AT + DIAG + NMEA + Modem The detailed description of the USB configuration for each mode as follows: RMNET Mode Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee -------------- T: Bus=3D01 Lev=3D01 Prnt=3D01 Port=3D00 Cnt=3D01 Dev#=3D 21 Spd=3D480 Mx= Ch=3D 0 D: Ver=3D 2.00 Cls=3Def(misc ) Sub=3D02 Prot=3D01 MxPS=3D64 #Cfgs=3D 1 P: Vendor=3D2c7c ProdID=3D030a Rev=3D 3.18 S: Manufacturer=3DQuectel S: Product=3DQuectel EM05-G C:* #Ifs=3D 5 Cfg#=3D 1 Atr=3Da0 MxPwr=3D500mA I:* If#=3D 3 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Doption E: Ad=3D81(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D01(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 4 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D83(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D82(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D02(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 2 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D85(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D84(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D03(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 5 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D87(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D86(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D04(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 6 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3D(none) E: Ad=3D89(I) Atr=3D03(Int.) MxPS=3D 8 Ivl=3D32ms E: Ad=3D88(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D05(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms MBIM Mode -------------- T: Bus=3D01 Lev=3D01 Prnt=3D01 Port=3D00 Cnt=3D01 Dev#=3D 16 Spd=3D480 Mx= Ch=3D 0 D: Ver=3D 2.00 Cls=3Def(misc ) Sub=3D02 Prot=3D01 MxPS=3D64 #Cfgs=3D 1 P: Vendor=3D2c7c ProdID=3D030a Rev=3D 3.18 S: Manufacturer=3DQuectel S: Product=3DQuectel EM05-G C:* #Ifs=3D 6 Cfg#=3D 1 Atr=3Da0 MxPwr=3D500mA A: FirstIf#=3D 0 IfCount=3D 2 Cls=3D02(comm.) Sub=3D0e Prot=3D00 I:* If#=3D 3 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Doption E: Ad=3D81(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D01(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 4 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D83(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D82(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D02(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 2 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D85(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D84(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D03(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 5 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D87(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D86(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D04(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I:* If#=3D 0 Alt=3D 0 #EPs=3D 1 Cls=3D02(comm.) Sub=3D0e Prot=3D00 Driver= =3Dcdc_mbim E: Ad=3D89(I) Atr=3D03(Int.) MxPS=3D 64 Ivl=3D32ms I: If#=3D 1 Alt=3D 0 #EPs=3D 0 Cls=3D0a(data ) Sub=3D00 Prot=3D02 Driver= =3Dcdc_mbim I:* If#=3D 1 Alt=3D 1 #EPs=3D 2 Cls=3D0a(data ) Sub=3D00 Prot=3D02 Driver= =3Dcdc_mbim E: Ad=3D88(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D05(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms Signed-off-by: Yonglin Tan Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -252,6 +252,7 @@ static void option_instat_callback(struc #define QUECTEL_PRODUCT_EG95 0x0195 #define QUECTEL_PRODUCT_BG96 0x0296 #define QUECTEL_PRODUCT_EP06 0x0306 +#define QUECTEL_PRODUCT_EM05G 0x030a #define QUECTEL_PRODUCT_EM12 0x0512 #define QUECTEL_PRODUCT_RM500Q 0x0800 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 @@ -1134,6 +1135,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, = 0xff, 0xff, 0xff), .driver_info =3D RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, = 0xff, 0, 0) }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0x= ff), + .driver_info =3D RSVD(6) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, = 0xff, 0xff, 0xff), .driver_info =3D RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, = 0xff, 0, 0) }, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1176EC43334 for ; Mon, 27 Jun 2022 11:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235593AbiF0Lax (ORCPT ); Mon, 27 Jun 2022 07:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235477AbiF0L3m (ORCPT ); Mon, 27 Jun 2022 07:29:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6003FB07; Mon, 27 Jun 2022 04:28:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B5873614ED; Mon, 27 Jun 2022 11:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1A02C3411D; Mon, 27 Jun 2022 11:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329306; bh=6AxkFONhHzmOfd4oMiIArsoJYhYr/Fsf+dMwrYnOOFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rzxdxvo0Q6mvJjqz84sX5FG51AxkruLQfwuBZBc349r+SFhgdk0OUXpwMOtaOmZwJ wCXUOXnobPNpaJj319Rvd6lWGul+4pL7HxT+I9opB2WSq7yiE5d8q9ktYIXz53gd7k 0+S943NsBSSpONBkT2lvQM76vGK8QMhHFEx/jP28= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ballon Shi , Macpaul Lin , Johan Hovold Subject: [PATCH 5.4 16/60] USB: serial: option: add Quectel RM500K module support Date: Mon, 27 Jun 2022 13:21:27 +0200 Message-Id: <20220627111928.138227692@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Macpaul Lin commit 15b694e96c31807d8515aacfa687a1e8a4fbbadc upstream. Add usb product id of the Quectel RM500K module. RM500K provides 2 mandatory interfaces to Linux host after enumeration. - /dev/ttyUSB5: this is a serial interface for control path. User needs to write AT commands to this device node to query status, set APN, set PIN code, and enable/disable the data connection to 5G network. - ethX: this is the data path provided as a RNDIS devices. After the data connection has been established, Linux host can access 5G data network via this interface. "RNDIS": RNDIS + ADB + AT (/dev/ttyUSB5) + MODEM COMs usb-devices output for 0x7001: T: Bus=3D05 Lev=3D01 Prnt=3D01 Port=3D00 Cnt=3D01 Dev#=3D 3 Spd=3D480 MxC= h=3D 0 D: Ver=3D 2.10 Cls=3Def(misc ) Sub=3D02 Prot=3D01 MxPS=3D64 #Cfgs=3D 1 P: Vendor=3D2c7c ProdID=3D7001 Rev=3D00.01 S: Manufacturer=3DMediaTek Inc. S: Product=3DUSB DATA CARD S: SerialNumber=3D869206050009672 C: #Ifs=3D10 Cfg#=3D 1 Atr=3Da0 MxPwr=3D500mA I: If#=3D 0 Alt=3D 0 #EPs=3D 1 Cls=3D02(commc) Sub=3D02 Prot=3Dff Driver= =3Drndis_host E: Ad=3D82(I) Atr=3D03(Int.) MxPS=3D 64 Ivl=3D125us I: If#=3D 1 Alt=3D 0 #EPs=3D 2 Cls=3D0a(data ) Sub=3D00 Prot=3D00 Driver= =3Drndis_host E: Ad=3D01(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D81(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 2 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D02(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D83(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 3 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D03(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D84(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 4 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D04(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D85(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 5 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D42 Prot=3D01 Driver= =3D(none) E: Ad=3D05(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D86(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 6 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D06(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D87(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 7 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D07(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D88(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 8 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D08(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D89(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms I: If#=3D 9 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D00 Prot=3D00 Driver= =3Doption E: Ad=3D09(O) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms E: Ad=3D8a(I) Atr=3D02(Bulk) MxPS=3D 512 Ivl=3D0ms Co-developed-by: Ballon Shi Signed-off-by: Ballon Shi Signed-off-by: Macpaul Lin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -257,6 +257,7 @@ static void option_instat_callback(struc #define QUECTEL_PRODUCT_RM500Q 0x0800 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 #define QUECTEL_PRODUCT_EC200T 0x6026 +#define QUECTEL_PRODUCT_RM500K 0x7001 =20 #define CMOTECH_VENDOR_ID 0x16d8 #define CMOTECH_PRODUCT_6001 0x6001 @@ -1150,6 +1151,7 @@ static const struct usb_device_id option .driver_info =3D ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S= _CN, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T= , 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K= , 0xff, 0x00, 0x00) }, =20 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E6F9C433EF for ; Mon, 27 Jun 2022 11:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235602AbiF0LbE (ORCPT ); Mon, 27 Jun 2022 07:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235505AbiF0L3u (ORCPT ); Mon, 27 Jun 2022 07:29:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1114EB4B; Mon, 27 Jun 2022 04:28:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9D933B8111A; Mon, 27 Jun 2022 11:28:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13DEDC3411D; Mon, 27 Jun 2022 11:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329309; bh=kDihq9Bw183BjtWkYgzYJBoXpL/l/VQicOl/orkDVZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ip3Wu/L2UQ2B083j7WzoB+2Qd74EIZWZyovq472gRumkgVb6OXD1mhgHEpQ2ueeJ mLRBUzfaZA/4xAHIei6YviqZvwvgS2zsZ4YIHiRpG6bQOjWUs+75EpoWY/DHxBMqT9 3S9Ki85UqLQsf5w9jtYBKGYKaSqedhGhnlYwWmxQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antoine Tenart , Jon Maxwell , Daniel Borkmann , Curtis Taylor , Martin KaFai Lau , Sasha Levin Subject: [PATCH 5.4 17/60] bpf: Fix request_sock leak in sk lookup helpers Date: Mon, 27 Jun 2022 13:21:28 +0200 Message-Id: <20220627111928.168248168@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jon Maxwell [ Upstream commit 3046a827316c0e55fc563b4fb78c93b9ca5c7c37 ] A customer reported a request_socket leak in a Calico cloud environment. We found that a BPF program was doing a socket lookup with takes a refcnt on the socket and that it was finding the request_socket but returning the par= ent LISTEN socket via sk_to_full_sk() without decrementing the child request so= cket 1st, resulting in request_sock slab object leak. This patch retains the existing behaviour of returning full socks to the caller but it also decrem= ents the child request_socket if one is present before doing so to prevent the l= eak. Thanks to Curtis Taylor for all the help in diagnosing and testing this. And thanks to Antoine Tenart for the reproducer and patch input. v2 of this patch contains, refactor as per Daniel Borkmann's suggestions to validate RCU flags on the listen socket so that it balances with bpf_sk_rel= ease() and update comments as per Martin KaFai Lau's suggestion. One small change = to Daniels suggestion, put "sk =3D sk2" under "if (sk2 !=3D sk)" to avoid an e= xtra instruction. Fixes: f7355a6c0497 ("bpf: Check sk_fullsock() before returning from bpf_sk= _lookup()") Fixes: edbf8c01de5a ("bpf: add skc_lookup_tcp helper") Co-developed-by: Antoine Tenart Signed-off-by: Antoine Tenart Signed-off-by: Jon Maxwell Signed-off-by: Daniel Borkmann Tested-by: Curtis Taylor Cc: Martin KaFai Lau Link: https://lore.kernel.org/bpf/56d6f898-bde0-bb25-3427-12a330b29fb8@ioge= arbox.net Link: https://lore.kernel.org/bpf/20220615011540.813025-1-jmaxwell37@gmail.= com Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/core/filter.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index b0df4ddbe30c..eba96343c7af 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5313,10 +5313,21 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_soc= k_tuple *tuple, u32 len, ifindex, proto, netns_id, flags); =20 if (sk) { - sk =3D sk_to_full_sk(sk); - if (!sk_fullsock(sk)) { + struct sock *sk2 =3D sk_to_full_sk(sk); + + /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the origi= nal sk + * sock refcnt is decremented to prevent a request_sock leak. + */ + if (!sk_fullsock(sk2)) + sk2 =3D NULL; + if (sk2 !=3D sk) { sock_gen_put(sk); - return NULL; + /* Ensure there is no need to bump sk2 refcnt */ + if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { + WARN_ONCE(1, "Found non-RCU, unreferenced socket!"); + return NULL; + } + sk =3D sk2; } } =20 @@ -5350,10 +5361,21 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_= tuple *tuple, u32 len, flags); =20 if (sk) { - sk =3D sk_to_full_sk(sk); - if (!sk_fullsock(sk)) { + struct sock *sk2 =3D sk_to_full_sk(sk); + + /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the origi= nal sk + * sock refcnt is decremented to prevent a request_sock leak. + */ + if (!sk_fullsock(sk2)) + sk2 =3D NULL; + if (sk2 !=3D sk) { sock_gen_put(sk); - return NULL; + /* Ensure there is no need to bump sk2 refcnt */ + if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { + WARN_ONCE(1, "Found non-RCU, unreferenced socket!"); + return NULL; + } + sk =3D sk2; } } =20 --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4BF0C43334 for ; Mon, 27 Jun 2022 11:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235516AbiF0LbJ (ORCPT ); Mon, 27 Jun 2022 07:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235514AbiF0L3x (ORCPT ); Mon, 27 Jun 2022 07:29:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D00B6A; Mon, 27 Jun 2022 04:28:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83344B81123; Mon, 27 Jun 2022 11:28:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA648C3411D; Mon, 27 Jun 2022 11:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329312; bh=H3PkShMS5tf0/PpMKZejczg+nRG9ZJY4p0skfPXy2wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rkOrmDEv3sJlBZNNmswWxBbiWQZwPzRTQT4edRKga5NJQK6C2v7+AWbUK9oKazoqe W+1KlHGSisyjBvg4fdxj/lsYXZ0vSqaT2uWItwq4p6F241gXv54ozVkTzEbT/XEwBw oaMy8eatJv8eVRVXdN+0rUnnkXC35PqFf8K8MRZI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Spacek , Claudiu Manoil , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 18/60] phy: aquantia: Fix AN when higher speeds than 1G are not advertised Date: Mon, 27 Jun 2022 13:21:29 +0200 Message-Id: <20220627111928.196980705@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Claudiu Manoil [ Upstream commit 9b7fd1670a94a57d974795acebde843a5c1a354e ] Even when the eth port is resticted to work with speeds not higher than 1G, and so the eth driver is requesting the phy (via phylink) to advertise up to 1000BASET support, the aquantia phy device is still advertising for 2.5G and 5G speeds. Clear these advertising defaults when requested. Cc: Ondrej Spacek Fixes: 09c4c57f7bc41 ("net: phy: aquantia: add support for auto-negotiation= configuration") Signed-off-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220610084037.7625-1-claudiu.manoil@nxp.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/phy/aquantia_main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia_mai= n.c index 975789d9349d..75d8351ee250 100644 --- a/drivers/net/phy/aquantia_main.c +++ b/drivers/net/phy/aquantia_main.c @@ -34,6 +34,8 @@ #define MDIO_AN_VEND_PROV 0xc400 #define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) #define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) +#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) +#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) #define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) #define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) #define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 @@ -230,9 +232,20 @@ static int aqr_config_aneg(struct phy_device *phydev) phydev->advertising)) reg |=3D MDIO_AN_VEND_PROV_1000BASET_HALF; =20 + /* Handle the case when the 2.5G and 5G speeds are not advertised */ + if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + phydev->advertising)) + reg |=3D MDIO_AN_VEND_PROV_2500BASET_FULL; + + if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + phydev->advertising)) + reg |=3D MDIO_AN_VEND_PROV_5000BASET_FULL; + ret =3D phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, MDIO_AN_VEND_PROV_1000BASET_HALF | - MDIO_AN_VEND_PROV_1000BASET_FULL, reg); + MDIO_AN_VEND_PROV_1000BASET_FULL | + MDIO_AN_VEND_PROV_2500BASET_FULL | + MDIO_AN_VEND_PROV_5000BASET_FULL, reg); if (ret < 0) return ret; if (ret > 0) --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C289C43334 for ; Mon, 27 Jun 2022 11:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235579AbiF0LbT (ORCPT ); Mon, 27 Jun 2022 07:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235567AbiF0LaZ (ORCPT ); Mon, 27 Jun 2022 07:30:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73705B98; Mon, 27 Jun 2022 04:28:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8155B81116; Mon, 27 Jun 2022 11:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A56AC3411D; Mon, 27 Jun 2022 11:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329315; bh=Jz1o9UB3Ng6FEk7XWi8NWkLeXLQCX2UUuwvit7PxSH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=agWD3y3DO94Bsp70m0tQCLX8N3P4Y5A4CrLYyZazyct6mgji/n5CY+WjZquwJXvS9 mj1Be+DPElrweKHACdJGSMyP32RNTBV0W+jZrh3XMqRkeJOFElSlnEUiiTVRu9sjMH fUBVclPYTN1o5K8oNpwxZkRulrVD3dyDKYE+dTco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Toppins , Jay Vosburgh , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 19/60] bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers Date: Mon, 27 Jun 2022 13:21:30 +0200 Message-Id: <20220627111928.227365898@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jay Vosburgh [ Upstream commit 7a9214f3d88cfdb099f3896e102a306b316d8707 ] The bonding ARP monitor fails to decrement send_peer_notif, the number of peer notifications (gratuitous ARP or ND) to be sent. This results in a continuous series of notifications. Correct this by decrementing the counter for each notification. Reported-by: Jonathan Toppins Signed-off-by: Jay Vosburgh Fixes: b0929915e035 ("bonding: Fix RTNL: assertion failed at net/core/rtnet= link.c for ab arp monitor") Link: https://lore.kernel.org/netdev/b2fd4147-8f50-bebd-963a-1a3e8d1d9715@r= edhat.com/ Tested-by: Jonathan Toppins Reviewed-by: Jonathan Toppins Link: https://lore.kernel.org/r/9400.1655407960@famine Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/bonding/bond_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_mai= n.c index d6ecd03b6045..246bcbd650b4 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3071,9 +3071,11 @@ static void bond_activebackup_arp_mon(struct bonding= *bond) if (!rtnl_trylock()) return; =20 - if (should_notify_peers) + if (should_notify_peers) { + bond->send_peer_notif--; call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev); + } if (should_notify_rtnl) { bond_slave_state_notify(bond); bond_slave_link_notify(bond); --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB5A4C43334 for ; Mon, 27 Jun 2022 11:31:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235490AbiF0LbY (ORCPT ); Mon, 27 Jun 2022 07:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235480AbiF0LbA (ORCPT ); Mon, 27 Jun 2022 07:31:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3661C70; Mon, 27 Jun 2022 04:28:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5ADE9B81117; Mon, 27 Jun 2022 11:28:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADD88C3411D; Mon, 27 Jun 2022 11:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329319; bh=8HHd8s6/5GHoKVXqUt4UT5kPffZIDiUHJ3d5gShlvh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dH2FHbIiYEkkNlv7m3OZYJxZITcBnsxUePgpE8XCW20347H3o+E86EwCzEEyHXEW1 F08P7ToKtMLf2Od0NjjLvhjNgUHwboa+9w7pgYF2PEb02TpTxrl23AKmuvO2UCGe8N 4eI/LihwnqmYtiCoWCm2wDYOMctBQkj3sSt71clM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuming Chen , Cong Wang , Peilin Ye , Stephen Hemminger , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 20/60] net/sched: sch_netem: Fix arithmetic in netem_dump() for 32-bit platforms Date: Mon, 27 Jun 2022 13:21:31 +0200 Message-Id: <20220627111928.256454221@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Peilin Ye [ Upstream commit a2b1a5d40bd12b44322c2ccd40bb0ec1699708b6 ] As reported by Yuming, currently tc always show a latency of UINT_MAX for netem Qdisc's on 32-bit platforms: $ tc qdisc add dev dummy0 root netem latency 100ms $ tc qdisc show dev dummy0 qdisc netem 8001: root refcnt 2 limit 1000 delay 275s 275s ^^^^^^^^^^^^^^^^ Let us take a closer look at netem_dump(): qopt.latency =3D min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->latency, UINT_MAX); qopt.latency is __u32, psched_tdiff_t is signed long, (psched_tdiff_t)(UINT_MAX) is negative for 32-bit platforms, so qopt.latency is always UINT_MAX. Fix it by using psched_time_t (u64) instead. Note: confusingly, users have two ways to specify 'latency': 1. normally, via '__u32 latency' in struct tc_netem_qopt; 2. via the TCA_NETEM_LATENCY64 attribute, which is s64. For the second case, theoretically 'latency' could be negative. This patch ignores that corner case, since it is broken (i.e. assigning a negative s64 to __u32) anyways, and should be handled separately. Thanks Ted Lin for the analysis [1] . [1] https://github.com/raspberrypi/linux/issues/3512 Reported-by: Yuming Chen Fixes: 112f9cb65643 ("netem: convert to qdisc_watchdog_schedule_ns") Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Acked-by: Stephen Hemminger Link: https://lore.kernel.org/r/20220616234336.2443-1-yepeilin.cs@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/sched/sch_netem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index f4101a920d1f..1802f134aa40 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -1146,9 +1146,9 @@ static int netem_dump(struct Qdisc *sch, struct sk_bu= ff *skb) struct tc_netem_rate rate; struct tc_netem_slot slot; =20 - qopt.latency =3D min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->latency), + qopt.latency =3D min_t(psched_time_t, PSCHED_NS2TICKS(q->latency), UINT_MAX); - qopt.jitter =3D min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->jitter), + qopt.jitter =3D min_t(psched_time_t, PSCHED_NS2TICKS(q->jitter), UINT_MAX); qopt.limit =3D q->limit; qopt.loss =3D q->loss; --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11FC1C43334 for ; Mon, 27 Jun 2022 11:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235500AbiF0Lb3 (ORCPT ); Mon, 27 Jun 2022 07:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235402AbiF0LbB (ORCPT ); Mon, 27 Jun 2022 07:31:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C936C35; Mon, 27 Jun 2022 04:28:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C51B16149A; Mon, 27 Jun 2022 11:28:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7ACC3411D; Mon, 27 Jun 2022 11:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329322; bh=hWor5TbAdbXUvesvXIX1mOkRXrLBzYeK9PD0uprgNdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oeifk1IuurWjqKY4W40Iak+j9IjNLQcGgK8KRpWCfmmrEH+phz6cNAeG8R/pX0IZq YehFES4Ib/goUmwAHei6vf6lIB1yKXe49BZOgjOhwWHmRg5dQn0RF5muSKzuyixU+N zwZqXxYG7zdI0v7SkNZNgvEgW5GgGd1obSKHmf1I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Baryshkov , Stephen Boyd , Abhinav Kumar , Rob Clark , Sasha Levin Subject: [PATCH 5.4 21/60] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf Date: Mon, 27 Jun 2022 13:21:32 +0200 Message-Id: <20220627111928.287391461@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin [ Upstream commit b9cc4598607cb7f7eae5c75fc1e3209cd52ff5e0 ] of_graph_get_remote_node() returns remote device node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/488473/ Link: https://lore.kernel.org/r/20220607110841.53889-1-linmq006@gmail.com Signed-off-by: Rob Clark Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm= /disp/mdp4/mdp4_kms.c index 4f0c6d58e06f..f0a5767b69f5 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -245,6 +245,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4= _kms, encoder =3D mdp4_lcdc_encoder_init(dev, panel_node); if (IS_ERR(encoder)) { DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n"); + of_node_put(panel_node); return PTR_ERR(encoder); } =20 @@ -254,6 +255,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4= _kms, connector =3D mdp4_lvds_connector_init(dev, panel_node, encoder); if (IS_ERR(connector)) { DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n"); + of_node_put(panel_node); return PTR_ERR(connector); } =20 --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B963FC43334 for ; Mon, 27 Jun 2022 11:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235650AbiF0Lbf (ORCPT ); Mon, 27 Jun 2022 07:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235504AbiF0LbD (ORCPT ); Mon, 27 Jun 2022 07:31:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D22ED4B; Mon, 27 Jun 2022 04:28:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E6931614A2; Mon, 27 Jun 2022 11:28:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E08DCC3411D; Mon, 27 Jun 2022 11:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329328; bh=LlgC4nsVgK7Zb/Vo/t1dxgEUjpmBoqef2/GAMs9dq68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOza0L4NIVJB6wq0UPl6PQ+BQk5Jq/J2k77fDSaiclyurJstpW+M7fpSJ89W5aj/t mykydQp4K+NG1V+fSfVtITS9pu3QAN9If9l5KZax6If8wnQQkhnw/qlZS/6a7WsXsj 7gfnwceLjmXsWXhoFBdxws+OEmrn/C6wBRJ9sRX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Eric Dumazet , William Tu , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 22/60] erspan: do not assume transport header is always set Date: Mon, 27 Jun 2022 13:21:33 +0200 Message-Id: <20220627111928.317427277@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eric Dumazet [ Upstream commit 301bd140ed0b24f0da660874c7e8a47dad8c8222 ] Rewrite tests in ip6erspan_tunnel_xmit() and erspan_fb_xmit() to not assume transport header is set. syzbot reported: WARNING: CPU: 0 PID: 1350 at include/linux/skbuff.h:2911 skb_transport_head= er include/linux/skbuff.h:2911 [inline] WARNING: CPU: 0 PID: 1350 at include/linux/skbuff.h:2911 ip6erspan_tunnel_x= mit+0x15af/0x2eb0 net/ipv6/ip6_gre.c:963 Modules linked in: CPU: 0 PID: 1350 Comm: aoe_tx0 Not tainted 5.19.0-rc2-syzkaller-00160-g2742= 95c6e53f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:skb_transport_header include/linux/skbuff.h:2911 [inline] RIP: 0010:ip6erspan_tunnel_xmit+0x15af/0x2eb0 net/ipv6/ip6_gre.c:963 Code: 0f 47 f0 40 88 b5 7f fe ff ff e8 8c 16 4b f9 89 de bf ff ff ff ff e8 = a0 12 4b f9 66 83 fb ff 0f 85 1d f1 ff ff e8 71 16 4b f9 <0f> 0b e9 43 f0 f= f ff e8 65 16 4b f9 48 8d 85 30 ff ff ff ba 60 00 RSP: 0018:ffffc90005daf910 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 000000000000ffff RCX: 0000000000000000 RDX: ffff88801f032100 RSI: ffffffff882e8d3f RDI: 0000000000000003 RBP: ffffc90005dafab8 R08: 0000000000000003 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000000 R12: ffff888024f21d40 R13: 000000000000a288 R14: 00000000000000b0 R15: ffff888025a2e000 FS: 0000000000000000(0000) GS:ffff88802c800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e425000 CR3: 000000006d099000 CR4: 0000000000152ef0 Call Trace: __netdev_start_xmit include/linux/netdevice.h:4805 [inline] netdev_start_xmit include/linux/netdevice.h:4819 [inline] xmit_one net/core/dev.c:3588 [inline] dev_hard_start_xmit+0x188/0x880 net/core/dev.c:3604 sch_direct_xmit+0x19f/0xbe0 net/sched/sch_generic.c:342 __dev_xmit_skb net/core/dev.c:3815 [inline] __dev_queue_xmit+0x14a1/0x3900 net/core/dev.c:4219 dev_queue_xmit include/linux/netdevice.h:2994 [inline] tx+0x6a/0xc0 drivers/block/aoe/aoenet.c:63 kthread+0x1e7/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Fixes: d5db21a3e697 ("erspan: auto detect truncated ipv6 packets.") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: William Tu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/ipv4/ip_gre.c | 15 ++++++++++----- net/ipv6/ip6_gre.c | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 614410a6db44..52dbffb7bc2f 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -497,7 +497,6 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct = net_device *dev) int tunnel_hlen; int version; int nhoff; - int thoff; =20 tun_info =3D skb_tunnel_info(skb); if (unlikely(!tun_info || !(tun_info->mode & IP_TUNNEL_INFO_TX) || @@ -531,10 +530,16 @@ static void erspan_fb_xmit(struct sk_buff *skb, struc= t net_device *dev) (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff)) truncate =3D true; =20 - thoff =3D skb_transport_header(skb) - skb_mac_header(skb); - if (skb->protocol =3D=3D htons(ETH_P_IPV6) && - (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)) - truncate =3D true; + if (skb->protocol =3D=3D htons(ETH_P_IPV6)) { + int thoff; + + if (skb_transport_header_was_set(skb)) + thoff =3D skb_transport_header(skb) - skb_mac_header(skb); + else + thoff =3D nhoff + sizeof(struct ipv6hdr); + if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff) + truncate =3D true; + } =20 if (version =3D=3D 1) { erspan_build_header(skb, ntohl(tunnel_id_to_key32(key->tun_id)), diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index e550db28aabb..4a6396d574a0 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -927,7 +927,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff= *skb, __be16 proto; __u32 mtu; int nhoff; - int thoff; =20 if (!pskb_inet_may_pull(skb)) goto tx_err; @@ -948,10 +947,16 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_bu= ff *skb, (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff)) truncate =3D true; =20 - thoff =3D skb_transport_header(skb) - skb_mac_header(skb); - if (skb->protocol =3D=3D htons(ETH_P_IPV6) && - (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)) - truncate =3D true; + if (skb->protocol =3D=3D htons(ETH_P_IPV6)) { + int thoff; + + if (skb_transport_header_was_set(skb)) + thoff =3D skb_transport_header(skb) - skb_mac_header(skb); + else + thoff =3D nhoff + sizeof(struct ipv6hdr); + if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff) + truncate =3D true; + } =20 if (skb_cow_head(skb, dev->needed_headroom ?: t->hlen)) goto tx_err; --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B83BEC43334 for ; Mon, 27 Jun 2022 11:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235622AbiF0Lbs (ORCPT ); Mon, 27 Jun 2022 07:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235569AbiF0LbR (ORCPT ); Mon, 27 Jun 2022 07:31:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2768ED6D; Mon, 27 Jun 2022 04:28:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A5D92B8111B; Mon, 27 Jun 2022 11:28:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2DF8C3411D; Mon, 27 Jun 2022 11:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329331; bh=ZqftpU+kk3SnOFzlbRPWOF0DcyaQ14Ql2h3g/xhvsTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sxA40sSUMAfzLppPWJeP3pb+Q44hOJ5Edyl2Xit97W4Wtasm3ZLvXmsm6iUdE2ryk o1GWkJFwY4Zv8aGDUl2cxF09ycZ3GOKjLhA9v/f1N4xbYyNGwh2h2mWBF/YY7OOuPa 0M7tM06KYzCT0GcFJ0EObLR9X65T43BwDkIRAljI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+29c3c12f3214b85ad081@syzkaller.appspotmail.com, Ziyang Xuan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 23/60] net/tls: fix tls_sk_proto_close executed repeatedly Date: Mon, 27 Jun 2022 13:21:34 +0200 Message-Id: <20220627111928.347499673@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Ziyang Xuan [ Upstream commit 69135c572d1f84261a6de2a1268513a7e71753e2 ] After setting the sock ktls, update ctx->sk_proto to sock->sk_prot by tls_update(), so now ctx->sk_proto->close is tls_sk_proto_close(). When close the sock, tls_sk_proto_close() is called for sock->sk_prot->close is tls_sk_proto_close(). But ctx->sk_proto->close() will be executed later in tls_sk_proto_close(). Thus tls_sk_proto_close() executed repeatedly occurred. That will trigger the following bug. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:tls_sk_proto_close+0xd8/0xaf0 net/tls/tls_main.c:306 Call Trace: tls_sk_proto_close+0x356/0xaf0 net/tls/tls_main.c:329 inet_release+0x12e/0x280 net/ipv4/af_inet.c:428 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 Updating a proto which is same with sock->sk_prot is incorrect. Add proto and sock->sk_prot equality check at the head of tls_update() to fix it. Fixes: 95fa145479fb ("bpf: sockmap/tls, close can race with map free") Reported-by: syzbot+29c3c12f3214b85ad081@syzkaller.appspotmail.com Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/tls/tls_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 7aba4ee77aba..df9177d96f7f 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -803,6 +803,9 @@ static void tls_update(struct sock *sk, struct proto *p, { struct tls_context *ctx; =20 + if (sk->sk_prot =3D=3D p) + return; + ctx =3D tls_get_ctx(sk); if (likely(ctx)) { ctx->sk_write_space =3D write_space; --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65BD0C43334 for ; Mon, 27 Jun 2022 11:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235013AbiF0Lb5 (ORCPT ); Mon, 27 Jun 2022 07:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235396AbiF0LbX (ORCPT ); Mon, 27 Jun 2022 07:31:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E76DDF; Mon, 27 Jun 2022 04:28:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 858F8B81120; Mon, 27 Jun 2022 11:28:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC595C3411D; Mon, 27 Jun 2022 11:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329334; bh=Ijmwv+syevkvdt93fWVqN1GeiV0joTO4w7doeUlDHqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pIV2JxwihspDQNFvVGR89JhLpEd2tW8Z74Bo+uQRudYJ9QZH5l94/qU+1RX+xeagr T06b3FuHSanXkExAzQcnatQJRPyPe/k/M13UBvcMSYFy7NBpow0BpnFGwUqS8yGwJ+ JubN0gBKqSogqAAt/vDxjuSfD8mfXJZL97s1YHS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, zdi-disclosures@trendmicro.com, Linus Torvalds , Gerd Hoffmann , Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 24/60] udmabuf: add back sanity check Date: Mon, 27 Jun 2022 13:21:35 +0200 Message-Id: <20220627111928.376754235@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Gerd Hoffmann [ Upstream commit 05b252cccb2e5c3f56119d25de684b4f810ba40a ] Check vm_fault->pgoff before using it. When we removed the warning, we also removed the check. Fixes: 7b26e4e2119d ("udmabuf: drop WARN_ON() check.") Reported-by: zdi-disclosures@trendmicro.com Suggested-by: Linus Torvalds Signed-off-by: Gerd Hoffmann Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma-buf/udmabuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index e553c6a937f6..c6e9b7bd7618 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -24,8 +24,11 @@ static vm_fault_t udmabuf_vm_fault(struct vm_fault *vmf) { struct vm_area_struct *vma =3D vmf->vma; struct udmabuf *ubuf =3D vma->vm_private_data; + pgoff_t pgoff =3D vmf->pgoff; =20 - vmf->page =3D ubuf->pages[vmf->pgoff]; + if (pgoff >=3D ubuf->pagecount) + return VM_FAULT_SIGBUS; + vmf->page =3D ubuf->pages[pgoff]; get_page(vmf->page); return 0; } --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71DE0CCA47F for ; Mon, 27 Jun 2022 11:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235485AbiF0LcC (ORCPT ); Mon, 27 Jun 2022 07:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235648AbiF0Lbe (ORCPT ); Mon, 27 Jun 2022 07:31:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6FD6F6A; Mon, 27 Jun 2022 04:29:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E763B81116; Mon, 27 Jun 2022 11:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBC1EC385A5; Mon, 27 Jun 2022 11:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329337; bh=vHphNEGDnvQP6fenj0WdjSl93B5+8QPE+d2p67vjjAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSUgt0EP5KoJo8sfnkpEr3kobnS6Z+87Nd1A3Nlg6kHObbZ/r2FoEx2BwC4QTDvXo Uf1UHV1/8ZHbhdXHXcQiDYUE3Zs7jVgSTB7Uz4ga6boyHjmR4PuoMHVmWuzhxjVbnS OWOmR+EaorQWqrtAZ3Y1OqupjTA5pr9s7ZVTD4Qk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Grall , Juergen Gross , Sasha Levin Subject: [PATCH 5.4 25/60] x86/xen: Remove undefined behavior in setup_features() Date: Mon, 27 Jun 2022 13:21:36 +0200 Message-Id: <20220627111928.406738132@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Julien Grall [ Upstream commit ecb6237fa397b7b810d798ad19322eca466dbab1 ] 1 << 31 is undefined. So switch to 1U << 31. Fixes: 5ead97c84fa7 ("xen: Core Xen implementation") Signed-off-by: Julien Grall Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220617103037.57828-1-julien@xen.org Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/xen/features.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/features.c b/drivers/xen/features.c index 25c053b09605..2c306de228db 100644 --- a/drivers/xen/features.c +++ b/drivers/xen/features.c @@ -29,6 +29,6 @@ void xen_setup_features(void) if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0) break; for (j =3D 0; j < 32; j++) - xen_features[i * 32 + j] =3D !!(fi.submap & 1< X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6825DC43334 for ; Mon, 27 Jun 2022 11:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235270AbiF0LcE (ORCPT ); Mon, 27 Jun 2022 07:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235509AbiF0Lbd (ORCPT ); Mon, 27 Jun 2022 07:31:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E22F68; Mon, 27 Jun 2022 04:29:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EED40614F6; Mon, 27 Jun 2022 11:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBED3C3411D; Mon, 27 Jun 2022 11:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329340; bh=mQxZLlG1fnMhdpl5nNqIAaOfKrFy36I2HEN0sikocns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTi8Znt5M589g3bVbNmhwe7acP1CagXgi8DM2ZSFliJlym9EOaarCbRpLRCfhg+t/ hW8DOwbRJKsP7G1YbRgkNYWk9DA+iz7fEZuICds+t6LXwRhELGYZxl0WSLmViWlrII O/BtjZX8Yqb33KmgEPXGetlVox2H6aQGSzmt09t4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, k2ci , huhai , Genjian Zhang , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.4 26/60] MIPS: Remove repetitive increase irq_err_count Date: Mon, 27 Jun 2022 13:21:37 +0200 Message-Id: <20220627111928.456280316@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: huhai [ Upstream commit c81aba8fde2aee4f5778ebab3a1d51bd2ef48e4c ] commit 979934da9e7a ("[PATCH] mips: update IRQ handling for vr41xx") added a function irq_dispatch, and it'll increase irq_err_count when the get_irq callback returns a negative value, but increase irq_err_count in get_irq was not removed. And also, modpost complains once gpio-vr41xx drivers become modules. ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined! So it would be a good idea to remove repetitive increase irq_err_count in get_irq callback. Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib") Fixes: 979934da9e7a ("[PATCH] mips: update IRQ handling for vr41xx") Reported-by: k2ci Signed-off-by: huhai Signed-off-by: Genjian Zhang Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/mips/vr41xx/common/icu.c | 2 -- drivers/gpio/gpio-vr41xx.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c index 7b7f25b4b057..9240bcdbe74e 100644 --- a/arch/mips/vr41xx/common/icu.c +++ b/arch/mips/vr41xx/common/icu.c @@ -640,8 +640,6 @@ static int icu_get_irq(unsigned int irq) =20 printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2); =20 - atomic_inc(&irq_err_count); - return -1; } =20 diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c index 98cd715ccc33..8d09b619c166 100644 --- a/drivers/gpio/gpio-vr41xx.c +++ b/drivers/gpio/gpio-vr41xx.c @@ -217,8 +217,6 @@ static int giu_get_irq(unsigned int irq) printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n", maskl, pendl, maskh, pendh); =20 - atomic_inc(&irq_err_count); - return -EINVAL; } =20 --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF0CCCA473 for ; Mon, 27 Jun 2022 11:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235392AbiF0LcQ (ORCPT ); Mon, 27 Jun 2022 07:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235555AbiF0Lbr (ORCPT ); Mon, 27 Jun 2022 07:31:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C70010CD; Mon, 27 Jun 2022 04:29:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B0E90B8111B; Mon, 27 Jun 2022 11:29:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE6E0C3411D; Mon, 27 Jun 2022 11:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329343; bh=SpUk5xopBVEJbsXDCPPzUrXYRKodP1EeLbPsa/mnV5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAxAvQQc17HlJe5D1b1fxOQtfwrdnFzpCMxqCikoGmBCl8BGahtYbiowninu4ynjB LW0sh99vFJsb52KYSjcWfVy77orzlaoDfoMLnaMjP03Nj+0V6r8hPypjAKbiYzu/fy 9Ozt6noYLDIu9UND0KKY/D9nkrOlDgN9kzxRaCPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Dionne , David Howells , linux-afs@lists.infradead.org, Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 27/60] afs: Fix dynamic root getattr Date: Mon, 27 Jun 2022 13:21:38 +0200 Message-Id: <20220627111928.485967575@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: David Howells [ Upstream commit cb78d1b5efffe4cf97e16766329dd7358aed3deb ] The recent patch to make afs_getattr consult the server didn't account for the pseudo-inodes employed by the dynamic root-type afs superblock not having a volume or a server to access, and thus an oops occurs if such a directory is stat'd. Fix this by checking to see if the vnode->volume pointer actually points anywhere before following it in afs_getattr(). This can be tested by stat'ing a directory in /afs. It may be sufficient just to do "ls /afs" and the oops looks something like: BUG: kernel NULL pointer dereference, address: 0000000000000020 ... RIP: 0010:afs_getattr+0x8b/0x14b ... Call Trace: vfs_statx+0x79/0xf5 vfs_fstatat+0x49/0x62 Fixes: 2aeb8c86d499 ("afs: Fix afs_getattr() to refetch file status if call= back break occurred") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/165408450783.1031787.7941404776393751186.st= git@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- fs/afs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 90eac3ec01cb..622363af4c1b 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -739,7 +739,8 @@ int afs_getattr(const struct path *path, struct kstat *= stat, =20 _enter("{ ino=3D%lu v=3D%u }", inode->i_ino, inode->i_generation); =20 - if (!(query_flags & AT_STATX_DONT_SYNC) && + if (vnode->volume && + !(query_flags & AT_STATX_DONT_SYNC) && !test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) { key =3D afs_request_key(vnode->volume->cell); if (IS_ERR(key)) --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 313CAC43334 for ; Mon, 27 Jun 2022 11:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234949AbiF0LcS (ORCPT ); Mon, 27 Jun 2022 07:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235569AbiF0Lbt (ORCPT ); Mon, 27 Jun 2022 07:31:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C28F1106; Mon, 27 Jun 2022 04:29:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D7988614EC; Mon, 27 Jun 2022 11:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E34A8C341C8; Mon, 27 Jun 2022 11:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329346; bh=nNlTjBxA5nd4i3KBDtgYY2oKAdkO4zFbe5ZgGJlmHII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=csFzvCv8uDz3d8GjQWpLmYy6tBD2lANdewHzkFYltAT2eEpo4WhAbGF7+QiJvHZ2E 26WoIw11QbI1lMM1xU6aSOpY7Wj1ajA/uEgT695aH3OOIpcSFi7Sh6lHa/ehqUBWgF SacISkhqkWCvFofCP/5yitnlQmVgYB8pYo3lDCpE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anatolii Gerasymenko , Tony Nguyen , Sasha Levin , Gurucharan Subject: [PATCH 5.4 28/60] ice: ethtool: advertise 1000M speeds properly Date: Mon, 27 Jun 2022 13:21:39 +0200 Message-Id: <20220627111928.515000449@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Anatolii Gerasymenko [ Upstream commit c3d184c83ff4b80167e34edfc3d21df424bf27ff ] In current implementation ice_update_phy_type enables all link modes for selected speed. This approach doesn't work for 1000M speeds, because both copper (1000baseT) and optical (1000baseX) standards cannot be enabled at once. Fix this, by adding the function `ice_set_phy_type_from_speed()` for 1000M speeds. Fixes: 48cb27f2fd18 ("ice: Implement handlers for ethtool PHY/link operatio= ns") Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Int= el) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 39 +++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/eth= ernet/intel/ice/ice_ethtool.c index fc9ff985a62b..b297a3ca22fc 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -2337,6 +2337,42 @@ ice_setup_autoneg(struct ice_port_info *p, struct et= htool_link_ksettings *ks, return err; } =20 +/** + * ice_set_phy_type_from_speed - set phy_types based on speeds + * and advertised modes + * @ks: ethtool link ksettings struct + * @phy_type_low: pointer to the lower part of phy_type + * @phy_type_high: pointer to the higher part of phy_type + * @adv_link_speed: targeted link speeds bitmap + */ +static void +ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks, + u64 *phy_type_low, u64 *phy_type_high, + u16 adv_link_speed) +{ + /* Handle 1000M speed in a special way because ice_update_phy_type + * enables all link modes, but having mixed copper and optical + * standards is not supported. + */ + adv_link_speed &=3D ~ICE_AQ_LINK_SPEED_1000MB; + + if (ethtool_link_ksettings_test_link_mode(ks, advertising, + 1000baseT_Full)) + *phy_type_low |=3D ICE_PHY_TYPE_LOW_1000BASE_T | + ICE_PHY_TYPE_LOW_1G_SGMII; + + if (ethtool_link_ksettings_test_link_mode(ks, advertising, + 1000baseKX_Full)) + *phy_type_low |=3D ICE_PHY_TYPE_LOW_1000BASE_KX; + + if (ethtool_link_ksettings_test_link_mode(ks, advertising, + 1000baseX_Full)) + *phy_type_low |=3D ICE_PHY_TYPE_LOW_1000BASE_SX | + ICE_PHY_TYPE_LOW_1000BASE_LX; + + ice_update_phy_type(phy_type_low, phy_type_high, adv_link_speed); +} + /** * ice_set_link_ksettings - Set Speed and Duplex * @netdev: network interface device structure @@ -2472,7 +2508,8 @@ ice_set_link_ksettings(struct net_device *netdev, adv_link_speed =3D curr_link_speed; =20 /* Convert the advertise link speeds to their corresponded PHY_TYPE */ - ice_update_phy_type(&phy_type_low, &phy_type_high, adv_link_speed); + ice_set_phy_type_from_speed(ks, &phy_type_low, &phy_type_high, + adv_link_speed); =20 if (!autoneg_changed && adv_link_speed =3D=3D curr_link_speed) { netdev_info(netdev, "Nothing changed, exiting without setting anything.\= n"); --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CC4BC43334 for ; Mon, 27 Jun 2022 11:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234504AbiF0LcU (ORCPT ); Mon, 27 Jun 2022 07:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235104AbiF0Lb4 (ORCPT ); Mon, 27 Jun 2022 07:31:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D878117C; Mon, 27 Jun 2022 04:29:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7B43EB81120; Mon, 27 Jun 2022 11:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C96C1C3411D; Mon, 27 Jun 2022 11:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329349; bh=AQ+qKiZJFbHOjNCj/teult017izcdEKNS540K4VL6qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O0zLexhSVdruxmkOSrrjpSvgGQfTuhaa88j6xVZ3MeOcmP3IRuvj2BjmfzYF7ljrx eQPtTS7tV56NtMFXbdjO6nA9zZQL9Vamov7hyDqNOMtgQc0Z/6EEap96t7dLQelDho dA0chPbF8BnY0O5E5SKp0pBXGXc4UKNQE29faD24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aidan MacDonald , Mark Brown , Sasha Levin Subject: [PATCH 5.4 29/60] regmap-irq: Fix a bug in regmap_irq_enable() for type_in_mask chips Date: Mon, 27 Jun 2022 13:21:40 +0200 Message-Id: <20220627111928.544357960@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Aidan MacDonald [ Upstream commit 485037ae9a095491beb7f893c909a76cc4f9d1e7 ] When enabling a type_in_mask irq, the type_buf contents must be AND'd with the mask of the IRQ we're enabling to avoid enabling other IRQs by accident, which can happen if several type_in_mask irqs share a mask register. Fixes: bc998a730367 ("regmap: irq: handle HW using separate rising/falling = edge interrupts") Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220620200644.1961936-2-aidanmacdonald.0x0= @gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/base/regmap/regmap-irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-= irq.c index 3d64c9331a82..3c1e554df4eb 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -214,6 +214,7 @@ static void regmap_irq_enable(struct irq_data *data) struct regmap_irq_chip_data *d =3D irq_data_get_irq_chip_data(data); struct regmap *map =3D d->map; const struct regmap_irq *irq_data =3D irq_to_regmap_irq(d, data->hwirq); + unsigned int reg =3D irq_data->reg_offset / map->reg_stride; unsigned int mask, type; =20 type =3D irq_data->type.type_falling_val | irq_data->type.type_rising_val; @@ -230,14 +231,14 @@ static void regmap_irq_enable(struct irq_data *data) * at the corresponding offset in regmap_irq_set_type(). */ if (d->chip->type_in_mask && type) - mask =3D d->type_buf[irq_data->reg_offset / map->reg_stride]; + mask =3D d->type_buf[reg] & irq_data->mask; else mask =3D irq_data->mask; =20 if (d->chip->clear_on_unmask) d->clear_status =3D true; =20 - d->mask_buf[irq_data->reg_offset / map->reg_stride] &=3D ~mask; + d->mask_buf[reg] &=3D ~mask; } =20 static void regmap_irq_disable(struct irq_data *data) --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94CAFC43334 for ; Mon, 27 Jun 2022 11:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234622AbiF0Lds (ORCPT ); Mon, 27 Jun 2022 07:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235272AbiF0Lb5 (ORCPT ); Mon, 27 Jun 2022 07:31:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F972194; Mon, 27 Jun 2022 04:29:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B36E5614EC; Mon, 27 Jun 2022 11:29:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5C05C341C7; Mon, 27 Jun 2022 11:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329352; bh=YjnRasFIojLLIzPHUxVjdng4DpIWoFgETIHdtiiqFO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKasqgINKd5ZaMBudpxZkOQHEaJQaY8kWfSbSfnX5HxR5yWDjRC7q33jf82+wDN9i ZDsFpXarltqPDXgNsKwnhDOSxy70F9/16WvpUQwgQFWWl0K1w2o6BpILtJL8hJoVkZ /lpMSEJrmfaKeWzcbMGKCT5zE0auE9xCd+zR3BwU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Tony Nguyen , Jakub Kicinski , Sasha Levin , Gurucharan Subject: [PATCH 5.4 30/60] igb: Make DMA faster when CPU is active on the PCIe link Date: Mon, 27 Jun 2022 13:21:41 +0200 Message-Id: <20220627111928.574105609@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kai-Heng Feng [ Upstream commit 4e0effd9007ea0be31f7488611eb3824b4541554 ] Intel I210 on some Intel Alder Lake platforms can only achieve ~750Mbps Tx speed via iperf. The RR2DCDELAY shows around 0x2xxx DMA delay, which will be significantly lower when 1) ASPM is disabled or 2) SoC package c-state stays above PC3. When the RR2DCDELAY is around 0x1xxx the Tx speed can reach to ~950Mbps. According to the I210 datasheet "8.26.1 PCIe Misc. Register - PCIEMISC", "DMA Idle Indication" doesn't seem to tie to DMA coalesce anymore, so set it to 1b for "DMA is considered idle when there is no Rx or Tx AND when there are no TLPs indicating that CPU is active detected on the PCIe link (such as the host executes CSR or Configuration register read or write operation)" and performing Tx should also fall under "active CPU on PCIe link" case. In addition to that, commit b6e0c419f040 ("igb: Move DMA Coalescing init code to separate function.") seems to wrongly changed from enabling E1000_PCIEMISC_LX_DECISION to disabling it, also fix that. Fixes: b6e0c419f040 ("igb: Move DMA Coalescing init code to separate functi= on.") Signed-off-by: Kai-Heng Feng Tested-by: Gurucharan (A Contingent worker at Int= el) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220621221056.604304-1-anthony.l.nguyen@in= tel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethern= et/intel/igb/igb_main.c index 26c8d09ad4dd..8734dfd001bb 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -9404,11 +9404,10 @@ static void igb_init_dmac(struct igb_adapter *adapt= er, u32 pba) struct e1000_hw *hw =3D &adapter->hw; u32 dmac_thr; u16 hwm; + u32 reg; =20 if (hw->mac.type > e1000_82580) { if (adapter->flags & IGB_FLAG_DMAC) { - u32 reg; - /* force threshold to 0. */ wr32(E1000_DMCTXTH, 0); =20 @@ -9441,7 +9440,6 @@ static void igb_init_dmac(struct igb_adapter *adapter= , u32 pba) /* Disable BMC-to-OS Watchdog Enable */ if (hw->mac.type !=3D e1000_i354) reg &=3D ~E1000_DMACR_DC_BMC2OSW_EN; - wr32(E1000_DMACR, reg); =20 /* no lower threshold to disable @@ -9458,12 +9456,12 @@ static void igb_init_dmac(struct igb_adapter *adapt= er, u32 pba) */ wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE - (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6); + } =20 - /* make low power state decision controlled - * by DMA coal - */ + if (hw->mac.type >=3D e1000_i210 || + (adapter->flags & IGB_FLAG_DMAC)) { reg =3D rd32(E1000_PCIEMISC); - reg &=3D ~E1000_PCIEMISC_LX_DECISION; + reg |=3D E1000_PCIEMISC_LX_DECISION; wr32(E1000_PCIEMISC, reg); } /* endif adapter->dmac is not disabled */ } else if (hw->mac.type =3D=3D e1000_82580) { --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57A70C43334 for ; Mon, 27 Jun 2022 11:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235440AbiF0Ldv (ORCPT ); Mon, 27 Jun 2022 07:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235359AbiF0LcB (ORCPT ); Mon, 27 Jun 2022 07:32:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51CBB2626; Mon, 27 Jun 2022 04:29:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA0A361456; Mon, 27 Jun 2022 11:29:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7169C3411D; Mon, 27 Jun 2022 11:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329355; bh=ci+cimYg8BJpQQXgDnq8gXkdRziCesnU7foWgcHsP2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vwt8h5U1Xgt4OcfVpQfwR5NfAuJT1kfxVoh4Q+dazhPmxWukzHmjDLLGTg0pKg0RE 6C21ldDHYo8LQelurhuBplS/VtZPdDdAxsOq334RRyOCK7H2pImOQBOkiRYtAhByTu Zu+iunHNdcsuxc2yCwYuMmwy8LHwOdVjD4UDyNi0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Gerhold , Jesper Dangaard Brouer , Jason Wang , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 31/60] virtio_net: fix xdp_rxq_info bug after suspend/resume Date: Mon, 27 Jun 2022 13:21:42 +0200 Message-Id: <20220627111928.603995886@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stephan Gerhold [ Upstream commit 8af52fe9fd3bf5e7478da99193c0632276e1dfce ] The following sequence currently causes a driver bug warning when using virtio_net: # ip link set eth0 up # echo mem > /sys/power/state (or e.g. # rtcwake -s 10 -m mem) # ip link set eth0 down Missing register, driver bug WARNING: CPU: 0 PID: 375 at net/core/xdp.c:138 xdp_rxq_info_unreg+0x58/0x= 60 Call trace: xdp_rxq_info_unreg+0x58/0x60 virtnet_close+0x58/0xac __dev_close_many+0xac/0x140 __dev_change_flags+0xd8/0x210 dev_change_flags+0x24/0x64 do_setlink+0x230/0xdd0 ... This happens because virtnet_freeze() frees the receive_queue completely (including struct xdp_rxq_info) but does not call xdp_rxq_info_unreg(). Similarly, virtnet_restore() sets up the receive_queue again but does not call xdp_rxq_info_reg(). Actually, parts of virtnet_freeze_down() and virtnet_restore_up() are almost identical to virtnet_close() and virtnet_open(): only the calls to xdp_rxq_info_(un)reg() are missing. This means that we can fix this easily and avoid such problems in the future by just calling virtnet_close()/open() from the freeze/restore handlers. Aside from adding the missing xdp_rxq_info calls the only difference is that the refill work is only cancelled if netif_running(). However, this should not make any functional difference since the refill work should only be active if the network interface is actually up. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Stephan Gerhold Acked-by: Jesper Dangaard Brouer Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220621114845.3650258-1-stephan.gerhold@ke= rnkonzept.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/virtio_net.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 37c2cecd1e50..f4c03518d7d2 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2393,7 +2393,6 @@ static const struct ethtool_ops virtnet_ethtool_ops = =3D { static void virtnet_freeze_down(struct virtio_device *vdev) { struct virtnet_info *vi =3D vdev->priv; - int i; =20 /* Make sure no work handler is accessing the device */ flush_work(&vi->config_work); @@ -2401,14 +2400,8 @@ static void virtnet_freeze_down(struct virtio_device= *vdev) netif_tx_lock_bh(vi->dev); netif_device_detach(vi->dev); netif_tx_unlock_bh(vi->dev); - cancel_delayed_work_sync(&vi->refill); - - if (netif_running(vi->dev)) { - for (i =3D 0; i < vi->max_queue_pairs; i++) { - napi_disable(&vi->rq[i].napi); - virtnet_napi_tx_disable(&vi->sq[i].napi); - } - } + if (netif_running(vi->dev)) + virtnet_close(vi->dev); } =20 static int init_vqs(struct virtnet_info *vi); @@ -2416,7 +2409,7 @@ static int init_vqs(struct virtnet_info *vi); static int virtnet_restore_up(struct virtio_device *vdev) { struct virtnet_info *vi =3D vdev->priv; - int err, i; + int err; =20 err =3D init_vqs(vi); if (err) @@ -2425,15 +2418,9 @@ static int virtnet_restore_up(struct virtio_device *= vdev) virtio_device_ready(vdev); =20 if (netif_running(vi->dev)) { - for (i =3D 0; i < vi->curr_queue_pairs; i++) - if (!try_fill_recv(vi, &vi->rq[i], GFP_KERNEL)) - schedule_delayed_work(&vi->refill, 0); - - for (i =3D 0; i < vi->max_queue_pairs; i++) { - virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); - virtnet_napi_tx_enable(vi, vi->sq[i].vq, - &vi->sq[i].napi); - } + err =3D virtnet_open(vi->dev); + if (err) + return err; } =20 netif_tx_lock_bh(vi->dev); --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C82B7C433EF for ; Mon, 27 Jun 2022 11:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236086AbiF0Lf1 (ORCPT ); Mon, 27 Jun 2022 07:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235351AbiF0LcQ (ORCPT ); Mon, 27 Jun 2022 07:32:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8E76579; Mon, 27 Jun 2022 04:29:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2845B81122; Mon, 27 Jun 2022 11:29:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40D49C3411D; Mon, 27 Jun 2022 11:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329361; bh=hqBg51TtQ2Y5YQFT14WWcZJPCnt/QxcNOyTLRLJ9cAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YKdcr4jJbDiZPXru7cCAI6weRvxVw+GwnVsX4ATQuKr0/C9Cz5QEOZmQbuxBP+EmA di/SyP2hxHYlrkXybmNjNWDuwexDUOCDzPDtdxGmnG3wj7RyDvy/JcrCbPixMXcEF9 77qLlCLFuDj/dv1wAKhWa1d5mZgadlELlbWAJNJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , John Fastabend , Paolo Abeni , Sasha Levin Subject: [PATCH 5.4 32/60] Revert "net/tls: fix tls_sk_proto_close executed repeatedly" Date: Mon, 27 Jun 2022 13:21:43 +0200 Message-Id: <20220627111928.633100609@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jakub Kicinski [ Upstream commit 1b205d948fbb06a7613d87dcea0ff5fd8a08ed91 ] This reverts commit 69135c572d1f84261a6de2a1268513a7e71753e2. This commit was just papering over the issue, ULP should not get ->update() called with its own sk_prot. Each ULP would need to add this check. Fixes: 69135c572d1f ("net/tls: fix tls_sk_proto_close executed repeatedly") Signed-off-by: Jakub Kicinski Reviewed-by: John Fastabend Link: https://lore.kernel.org/r/20220620191353.1184629-1-kuba@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/tls/tls_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index df9177d96f7f..7aba4ee77aba 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -803,9 +803,6 @@ static void tls_update(struct sock *sk, struct proto *p, { struct tls_context *ctx; =20 - if (sk->sk_prot =3D=3D p) - return; - ctx =3D tls_get_ctx(sk); if (likely(ctx)) { ctx->sk_write_space =3D write_space; --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8B26CCA47F for ; Mon, 27 Jun 2022 11:34:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235604AbiF0Ld7 (ORCPT ); Mon, 27 Jun 2022 07:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235639AbiF0Lc3 (ORCPT ); Mon, 27 Jun 2022 07:32:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B8B365D3; Mon, 27 Jun 2022 04:29:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4DB3B81117; Mon, 27 Jun 2022 11:29:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57F86C385A5; Mon, 27 Jun 2022 11:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329364; bh=Hv5XT+wihpAxWcKTmxWkBoWJWkQXIxwXbE/EI2bjpSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQZ6bA8+vS9zdjrgcs2sKay22J21sXs/ZTpz17teP72wpuyzSwHPFlXEz8SRAAgu8 ZEQEMgM9JyAj5Gxh7JMivX0l3J61LGxKTppu6ITdXtNUvE6rrXvVMNMnaOmY4Qm5ig 2oMxWEqCdfKto2MuvNA33t7L/me8jUsyBadHcrOw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Andy Shevchenko , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.4 33/60] gpio: winbond: Fix error code in winbond_gpio_get() Date: Mon, 27 Jun 2022 13:21:44 +0200 Message-Id: <20220627111928.663134075@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dan Carpenter [ Upstream commit 9ca766eaea2e87b8b773bff04ee56c055cb76d4e ] This error path returns 1, but it should instead propagate the negative error code from winbond_sio_enter(). Fixes: a0d65009411c ("gpio: winbond: Add driver") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/gpio/gpio-winbond.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c index 7f8f5b02e31d..4b61d975cc0e 100644 --- a/drivers/gpio/gpio-winbond.c +++ b/drivers/gpio/gpio-winbond.c @@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, uns= igned int offset) unsigned long *base =3D gpiochip_get_data(gc); const struct winbond_gpio_info *info; bool val; + int ret; =20 winbond_gpio_get_info(&offset, &info); =20 - val =3D winbond_sio_enter(*base); - if (val) - return val; + ret =3D winbond_sio_enter(*base); + if (ret) + return ret; =20 winbond_sio_select_logical(*base, info->dev); =20 --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 323CECCA481 for ; Mon, 27 Jun 2022 11:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235682AbiF0LeD (ORCPT ); Mon, 27 Jun 2022 07:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235668AbiF0Lcb (ORCPT ); Mon, 27 Jun 2022 07:32:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB797658C; Mon, 27 Jun 2022 04:29:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49DE16149A; Mon, 27 Jun 2022 11:29:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5314EC3411D; Mon, 27 Jun 2022 11:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329367; bh=Dr1tPwRBXZXzKH51dcRtoXnJy+WZCNIc6xKbvhjml14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zFLZag4h/kPCgAnLMxUHXwilRyRLzbVzoXN2Ry2Dk4xO3v7K3cg3YAjKKbmDEKCZN uVL9azFB/3JeKKnftP+Rcx8v3XgFElFGSMalHYS1hUeZiO1pAvD1wqrBHyDGvIuxhH MflOe2ejR5a+X73BchzgtrzOGvodoH/hvgKgSttE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Richter , Sumanth Korikkar , Alexander Gordeev , Sasha Levin Subject: [PATCH 5.4 34/60] s390/cpumf: Handle events cycles and instructions identical Date: Mon, 27 Jun 2022 13:21:45 +0200 Message-Id: <20220627111928.693625278@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Thomas Richter [ Upstream commit be857b7f77d130dbbd47c91fc35198b040f35865 ] Events CPU_CYCLES and INSTRUCTIONS can be submitted with two different perf_event attribute::type values: - PERF_TYPE_HARDWARE: when invoked via perf tool predefined events name cycles or cpu-cycles or instructions. - pmu->type: when invoked via perf tool event name cpu_cf/CPU_CYLCES/ or cpu_cf/INSTRUCTIONS/. This invocation also selects the PMU to which the event belongs. Handle both type of invocations identical for events CPU_CYLCES and INSTRUCTIONS. They address the same hardware. The result is different when event modifier exclude_kernel is also set. Invocation with event modifier for user space event counting fails. Output before: # perf stat -e cpum_cf/cpu_cycles/u -- true Performance counter stats for 'true': cpum_cf/cpu_cycles/u 0.000761033 seconds time elapsed 0.000076000 seconds user 0.000725000 seconds sys # Output after: # perf stat -e cpum_cf/cpu_cycles/u -- true Performance counter stats for 'true': 349,613 cpum_cf/cpu_cycles/u 0.000844143 seconds time elapsed 0.000079000 seconds user 0.000800000 seconds sys # Fixes: 6a82e23f45fe ("s390/cpumf: Adjust registration of s390 PMU device dr= ivers") Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar [agordeev@linux.ibm.com corrected commit ID of Fixes commit] Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/s390/kernel/perf_cpum_cf.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_c= f.c index 0eb1d1cc53a8..dddb32e53db8 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -292,6 +292,26 @@ static int __hw_perf_event_init(struct perf_event *eve= nt, unsigned int type) return err; } =20 +/* Events CPU_CYLCES and INSTRUCTIONS can be submitted with two different + * attribute::type values: + * - PERF_TYPE_HARDWARE: + * - pmu->type: + * Handle both type of invocations identical. They address the same hardwa= re. + * The result is different when event modifiers exclude_kernel and/or + * exclude_user are also set. + */ +static int cpumf_pmu_event_type(struct perf_event *event) +{ + u64 ev =3D event->attr.config; + + if (cpumf_generic_events_basic[PERF_COUNT_HW_CPU_CYCLES] =3D=3D ev || + cpumf_generic_events_basic[PERF_COUNT_HW_INSTRUCTIONS] =3D=3D ev || + cpumf_generic_events_user[PERF_COUNT_HW_CPU_CYCLES] =3D=3D ev || + cpumf_generic_events_user[PERF_COUNT_HW_INSTRUCTIONS] =3D=3D ev) + return PERF_TYPE_HARDWARE; + return PERF_TYPE_RAW; +} + static int cpumf_pmu_event_init(struct perf_event *event) { unsigned int type =3D event->attr.type; @@ -301,7 +321,7 @@ static int cpumf_pmu_event_init(struct perf_event *even= t) err =3D __hw_perf_event_init(event, type); else if (event->pmu->type =3D=3D type) /* Registered as unknown PMU */ - err =3D __hw_perf_event_init(event, PERF_TYPE_RAW); + err =3D __hw_perf_event_init(event, cpumf_pmu_event_type(event)); else return -ENOENT; =20 --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D116C43334 for ; Mon, 27 Jun 2022 11:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236095AbiF0Lfa (ORCPT ); Mon, 27 Jun 2022 07:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235677AbiF0Lcb (ORCPT ); Mon, 27 Jun 2022 07:32:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C904E95A3; Mon, 27 Jun 2022 04:29:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54FD0614E6; Mon, 27 Jun 2022 11:29:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C6D3C3411D; Mon, 27 Jun 2022 11:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329370; bh=y9i6OcD3+jttfol87JifqvXY8ddQ2O+EJsT5yNM2FLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0jky/vpF1yIa1he5wVsRCrQnlq4VbdLC+ekAKH5h317VVi8ubqnhp+5v/yWZkZIQO p2bhYUZnsI9TR6KrregwFeqeM0mvF9qXosezEFNBAjE/PMg4oeZdBj9AwVwrzGcZbn NjCayxX5iPkgHIFY3bbxXosYNWltMe9jwC1TZ/PU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baruch Siach , Haibo Chen , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.4 35/60] iio: adc: vf610: fix conversion mode sysfs node name Date: Mon, 27 Jun 2022 13:21:46 +0200 Message-Id: <20220627111928.723166638@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Baruch Siach [ Upstream commit f1a633b15cd5371a2a83f02c513984e51132dd68 ] The documentation missed the "in_" prefix for this IIO_SHARED_BY_DIR entry. Fixes: bf04c1a367e3 ("iio: adc: vf610: implement configurable conversion mo= des") Signed-off-by: Baruch Siach Acked-by: Haibo Chen Link: https://lore.kernel.org/r/560dc93fafe5ef7e9a409885fd20b6beac3973d8.16= 53900626.git.baruch@tkos.co.il Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- Documentation/ABI/testing/sysfs-bus-iio-vf610 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-bus-iio-vf610 b/Documentation/= ABI/testing/sysfs-bus-iio-vf610 index 308a6756d3bf..491ead804488 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio-vf610 +++ b/Documentation/ABI/testing/sysfs-bus-iio-vf610 @@ -1,4 +1,4 @@ -What: /sys/bus/iio/devices/iio:deviceX/conversion_mode +What: /sys/bus/iio/devices/iio:deviceX/in_conversion_mode KernelVersion: 4.2 Contact: linux-iio@vger.kernel.org Description: --=20 2.35.1 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2E09CCA482 for ; Mon, 27 Jun 2022 11:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235703AbiF0LeG (ORCPT ); Mon, 27 Jun 2022 07:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235730AbiF0Lch (ORCPT ); Mon, 27 Jun 2022 07:32:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D276B85E; Mon, 27 Jun 2022 04:29:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CD14BB81122; Mon, 27 Jun 2022 11:29:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D4F2C3411D; Mon, 27 Jun 2022 11:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329373; bh=Oae29rXEpAbedTU0LwPxLpUcqf8CXhY8N15Xyi0ITX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v49qUZ0SeYdzD7aVn3igA8R04ANuJdYI7WQr9BatVcOs8vnE/hSHT2qEG1QEVXyH+ b2VWJoxh8ONBC39ujn8ittiBsr7N5wBLeq5HAqCJKUMMqnWpiZhWr27NKI7afLpD5a ayatkQ/8sdmpC+DmIHMWEpbVGytOmv49g9tKXjS8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 5.4 36/60] xhci: turn off port power in shutdown Date: Mon, 27 Jun 2022 13:21:47 +0200 Message-Id: <20220627111928.753066955@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mathias Nyman commit 83810f84ecf11dfc5a9414a8b762c3501b328185 upstream. If ports are not turned off in shutdown then runtime suspended self-powered USB devices may survive in U3 link state over S5. During subsequent boot, if firmware sends an IPC command to program the port in DISCONNECT state, it will time out, causing significant delay in the boot time. Turning off roothub port power is also recommended in xhci specification 4.19.4 "Port Power" in the additional note. Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220623111945.1557702-3-mathias.nyman@linu= x.intel.com Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci.c | 15 +++++++++++++-- drivers/usb/host/xhci.h | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -566,7 +566,7 @@ struct xhci_hub *xhci_get_rhub(struct us * It will release and re-aquire the lock while calling ACPI * method. */ -static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, +void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index, bool on, unsigned long *flags) { struct xhci_hub *rhub; --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -775,6 +775,8 @@ static void xhci_stop(struct usb_hcd *hc void xhci_shutdown(struct usb_hcd *hcd) { struct xhci_hcd *xhci =3D hcd_to_xhci(hcd); + unsigned long flags; + int i; =20 if (xhci->quirks & XHCI_SPURIOUS_REBOOT) usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); @@ -790,12 +792,21 @@ void xhci_shutdown(struct usb_hcd *hcd) del_timer_sync(&xhci->shared_hcd->rh_timer); } =20 - spin_lock_irq(&xhci->lock); + spin_lock_irqsave(&xhci->lock, flags); xhci_halt(xhci); + + /* Power off USB2 ports*/ + for (i =3D 0; i < xhci->usb2_rhub.num_ports; i++) + xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags); + + /* Power off USB3 ports*/ + for (i =3D 0; i < xhci->usb3_rhub.num_ports; i++) + xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags); + /* Workaround for spurious wakeups at shutdown with HSW */ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) xhci_reset(xhci, XHCI_RESET_SHORT_USEC); - spin_unlock_irq(&xhci->lock); + spin_unlock_irqrestore(&xhci->lock, flags); =20 xhci_cleanup_msix(xhci); =20 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -2155,6 +2155,8 @@ int xhci_hub_control(struct usb_hcd *hcd int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1); struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); +void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 i= ndex, + bool on, unsigned long *flags); =20 void xhci_hc_died(struct xhci_hcd *xhci); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 983C8C433EF for ; Mon, 27 Jun 2022 11:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235726AbiF0LeJ (ORCPT ); Mon, 27 Jun 2022 07:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235765AbiF0Lck (ORCPT ); Mon, 27 Jun 2022 07:32:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 874CAB873; Mon, 27 Jun 2022 04:29:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D79F3B81120; Mon, 27 Jun 2022 11:29:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2804BC3411D; Mon, 27 Jun 2022 11:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329376; bh=H1bSBWVGZV+5s+ZnLeAHu/3Oh13Lb4XGnzywVcrTRGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aNzyfZv9ODNMCb1lAvpc3MXcS5sFoAjom13ZIMIWtwM8yvWpztzlO5v8f4SLvIVxx 6UE4NyJZ4y6nYtjsBEosF7VgOCGXWDFjF7XyjuEj2mnbu5cgQnnnE313Gcd7ZTIgMU 7mr2GLAeLSIcvM0LdZmzawVH4fxmdN/pCx17x/cU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Yang Subject: [PATCH 5.4 37/60] usb: chipidea: udc: check request status before setting device address Date: Mon, 27 Jun 2022 13:21:48 +0200 Message-Id: <20220627111928.781890501@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xu Yang commit b24346a240b36cfc4df194d145463874985aa29b upstream. The complete() function may be called even though request is not completed. In this case, it's necessary to check request status so as not to set device address wrongly. Fixes: 10775eb17bee ("usb: chipidea: udc: update gadget states according to= ch9") cc: Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/usb/chipidea/udc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -921,6 +921,9 @@ isr_setup_status_complete(struct usb_ep struct ci_hdrc *ci =3D req->context; unsigned long flags; =20 + if (req->status < 0) + return; + if (ci->setaddr) { hw_usb_set_address(ci, ci->address); ci->setaddr =3D false; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E52CC433EF for ; Mon, 27 Jun 2022 11:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236109AbiF0Lfc (ORCPT ); Mon, 27 Jun 2022 07:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235801AbiF0Lcp (ORCPT ); Mon, 27 Jun 2022 07:32:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001CAB84E; Mon, 27 Jun 2022 04:29:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3F0BD614E6; Mon, 27 Jun 2022 11:29:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 365D9C3411D; Mon, 27 Jun 2022 11:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329379; bh=e5SxuUVBR5YTS1lsaIKWd96E4rewCB1yPA1mZtrYxBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AWeWtBW/08IOOfIxeflalEhRf/nzHpGpOST7JUDQ5Kis2RlfjkakB9dVcRUjjSNBA kRMwH7hWMv/X03j28m8WknHP/fBenkuCOTOBjbmZK736LbkLeBk81x3DVTnscDhhdX AU52eAk2oKNNci/TFVI11LvyF3t0Bvn0ACJpL5U0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Rokosov , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 38/60] iio:chemical:ccs811: rearrange iio trigger get and register Date: Mon, 27 Jun 2022 13:21:49 +0200 Message-Id: <20220627111928.811227872@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dmitry Rokosov commit d710359c0b445e8c03e24f19ae2fb79ce7282260 upstream. IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: f1f065d7ac30 ("iio: chemical: ccs811: Add support for data ready tri= gger") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-5-ddrokosov@sberdevices= .ru Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/chemical/ccs811.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iio/chemical/ccs811.c +++ b/drivers/iio/chemical/ccs811.c @@ -418,11 +418,11 @@ static int ccs811_probe(struct i2c_clien data->drdy_trig->dev.parent =3D &client->dev; data->drdy_trig->ops =3D &ccs811_trigger_ops; iio_trigger_set_drvdata(data->drdy_trig, indio_dev); - indio_dev->trig =3D data->drdy_trig; - iio_trigger_get(indio_dev->trig); ret =3D iio_trigger_register(data->drdy_trig); if (ret) goto err_poweroff; + + indio_dev->trig =3D iio_trigger_get(data->drdy_trig); } =20 ret =3D iio_triggered_buffer_setup(indio_dev, NULL, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F4025C43334 for ; Mon, 27 Jun 2022 11:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235737AbiF0LeL (ORCPT ); Mon, 27 Jun 2022 07:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235855AbiF0Lcu (ORCPT ); Mon, 27 Jun 2022 07:32:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B0DBC27; Mon, 27 Jun 2022 04:29:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11E94B81120; Mon, 27 Jun 2022 11:29:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4817AC3411D; Mon, 27 Jun 2022 11:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329382; bh=CSba8t3KPko6bwOZeRrf8R9GFqgz31Oy3X9V/EUquhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5kLny5XTR3bK+XDBa7zryEsERgzDhrtsD4M8ZPSa0T7f3a/Ohhb7qqH8QAVX+zY9 PGogmvs1n/mLG54Ftp/n/RULe2MqUdMnEU2gaNbwr7FkCm4D1M3MPPoUzZbXMz96/i 7VcdHW5rmmrVaGDV0oUwl9GhqX6S9Wic9JDsfZMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Rokosov , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 39/60] iio:accel:bma180: rearrange iio trigger get and register Date: Mon, 27 Jun 2022 13:21:50 +0200 Message-Id: <20220627111928.840058568@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dmitry Rokosov commit e5f3205b04d7f95a2ef43bce4b454a7f264d6923 upstream. IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: 0668a4e4d297 ("iio: accel: bma180: Fix indio_dev->trig assignment") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-2-ddrokosov@sberdevices= .ru Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/accel/bma180.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -793,11 +793,12 @@ static int bma180_probe(struct i2c_clien data->trig->dev.parent =3D &client->dev; data->trig->ops =3D &bma180_trigger_ops; iio_trigger_set_drvdata(data->trig, indio_dev); - indio_dev->trig =3D iio_trigger_get(data->trig); =20 ret =3D iio_trigger_register(data->trig); if (ret) goto err_trigger_free; + + indio_dev->trig =3D iio_trigger_get(data->trig); } =20 ret =3D iio_triggered_buffer_setup(indio_dev, NULL, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2200C433EF for ; Mon, 27 Jun 2022 11:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235761AbiF0LeO (ORCPT ); Mon, 27 Jun 2022 07:34:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235891AbiF0Lcx (ORCPT ); Mon, 27 Jun 2022 07:32:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A9CAD; Mon, 27 Jun 2022 04:29:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 03EC1B8111A; Mon, 27 Jun 2022 11:29:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 591CFC3411D; Mon, 27 Jun 2022 11:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329385; bh=e6qYBuNvaK9vJWUNHSGQdFOs57yjXaAesaxvVanYtg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x69AsPKMugb/Xdy9r9rXb7VCx3MwuaQfOg8DESYbP1D3XPdWjnbLlFNS1dwDVurJ4 K4Q5pQT5Z2LmDQjU5mYp8r6K6HLBGzBVFlRd1AtIC1PL0OhiaHyeCi98tA3bX/5Yvd oLAnHv+MoXkPU/BCHfwN9fHPFkEMBt58FpS8Zghs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Rokosov , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 40/60] iio:accel:mxc4005: rearrange iio trigger get and register Date: Mon, 27 Jun 2022 13:21:51 +0200 Message-Id: <20220627111928.869433949@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dmitry Rokosov commit 9354c224c9b4f55847a0de3e968cba2ebf15af3b upstream. IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: 47196620c82f ("iio: mxc4005: add data ready trigger for mxc4005") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-4-ddrokosov@sberdevices= .ru Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/accel/mxc4005.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iio/accel/mxc4005.c +++ b/drivers/iio/accel/mxc4005.c @@ -462,8 +462,6 @@ static int mxc4005_probe(struct i2c_clie data->dready_trig->dev.parent =3D &client->dev; data->dready_trig->ops =3D &mxc4005_trigger_ops; iio_trigger_set_drvdata(data->dready_trig, indio_dev); - indio_dev->trig =3D data->dready_trig; - iio_trigger_get(indio_dev->trig); ret =3D devm_iio_trigger_register(&client->dev, data->dready_trig); if (ret) { @@ -471,6 +469,8 @@ static int mxc4005_probe(struct i2c_clie "failed to register trigger\n"); return ret; } + + indio_dev->trig =3D iio_trigger_get(data->dready_trig); } =20 return devm_iio_device_register(&client->dev, indio_dev); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA92C43334 for ; Mon, 27 Jun 2022 11:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236116AbiF0Lff (ORCPT ); Mon, 27 Jun 2022 07:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235913AbiF0Lcz (ORCPT ); Mon, 27 Jun 2022 07:32:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D68109; Mon, 27 Jun 2022 04:29:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E1AA2B8111B; Mon, 27 Jun 2022 11:29:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C014C3411D; Mon, 27 Jun 2022 11:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329388; bh=xYxiTnQiNYNkHpstZ5wyUZKasR0aKcFMUnvba22Y3So=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuiS/QlI5YJJokHKY1PGi79Y6zEA37KVJ4n6TUzQ7LOh+80OmgwULkfGfrpqnfbif HqMx89+e+258q9fR+ZgAIGG9ebja8YijbCkE47LkHjISNHrwJgerQokl43LlPQ13yb D4by3J5SDQ4yHoNajps0bnDbOorUCbDDpi0Miobg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haibo Chen , Hans de Goede , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 41/60] iio: accel: mma8452: ignore the return value of reset operation Date: Mon, 27 Jun 2022 13:21:52 +0200 Message-Id: <20220627111928.898410833@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Haibo Chen commit bf745142cc0a3e1723f9207fb0c073c88464b7b4 upstream. On fxls8471, after set the reset bit, the device will reset immediately, will not give ACK. So ignore the return value of this reset operation, let the following code logic to check whether the reset operation works. Signed-off-by: Haibo Chen Fixes: ecabae713196 ("iio: mma8452: Initialise before activating") Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/1655292718-14287-1-git-send-email-haibo.che= n@nxp.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/accel/mma8452.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1489,10 +1489,14 @@ static int mma8452_reset(struct i2c_clie int i; int ret; =20 - ret =3D i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2, + /* + * Find on fxls8471, after config reset bit, it reset immediately, + * and will not give ACK, so here do not check the return value. + * The following code will read the reset register, and check whether + * this reset works. + */ + i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2, MMA8452_CTRL_REG2_RST); - if (ret < 0) - return ret; =20 for (i =3D 0; i < 10; i++) { usleep_range(100, 200); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA8DDC43334 for ; Mon, 27 Jun 2022 11:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235834AbiF0LeY (ORCPT ); Mon, 27 Jun 2022 07:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235936AbiF0Lc5 (ORCPT ); Mon, 27 Jun 2022 07:32:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F371B2; Mon, 27 Jun 2022 04:29:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E9D26149A; Mon, 27 Jun 2022 11:29:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27AC4C36AE5; Mon, 27 Jun 2022 11:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329394; bh=CLKucOR1KV+hTdnmQuZOHWx60dJ5jfawBtDEBI3Okjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dh5SAoddwZnR0O8AKreneThaKyYjCwuhpCKz3/hV5NApZmXDbtsgWBDu7Sllzz8fW s4Aj00VP5RJgFZK6mytIvV9R9b6mgN+OYfeAj7zwq98B375YJM65Crou0YKWJGCWYp oyjCWlaNvu+IoHAqQwN9UHE+zY5TYLfPWkKXcXjo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Linus Walleij , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 42/60] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Date: Mon, 27 Jun 2022 13:21:53 +0200 Message-Id: <20220627111928.927348219@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zheyu Ma commit b2f5ad97645e1deb5ca9bcb7090084b92cae35d2 upstream. The driver should disable regulators when fails at regmap_update_bits(). Signed-off-by: Zheyu Ma Reviewed-by: Linus Walleij Cc: Link: https://lore.kernel.org/r/20220510092431.1711284-1-zheyuma97@gmail.com Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/gyro/mpu3050-core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -874,6 +874,7 @@ static int mpu3050_power_up(struct mpu30 ret =3D regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, MPU3050_PWR_MGM_SLEEP, 0); if (ret) { + regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs); dev_err(mpu3050->dev, "error setting power mode\n"); return ret; } From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDABAC43334 for ; Mon, 27 Jun 2022 11:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235676AbiF0Lea (ORCPT ); Mon, 27 Jun 2022 07:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235967AbiF0Lc7 (ORCPT ); Mon, 27 Jun 2022 07:32:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7776ABC90; Mon, 27 Jun 2022 04:29:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EED5F614EC; Mon, 27 Jun 2022 11:29:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 034F6C3411D; Mon, 27 Jun 2022 11:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329397; bh=d4ivODzHRCoUbS18FraA4uE1V6HELuJGshoYN4G+sEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQuPa3Aqaxpiv8csjVDVIVrCaJ0iTG/to0O/r0KwSvFHjEKsEm/zYoykfyCzrmAHn ZNUuxAUs3T6SN6LTg0Cd8JFv7PU3eWPcLxm6y0y+GBko9MtyWvC5meL2Cbf8GBuTHz zkyPwucpXWTslG191CFXT3a2eB98jr4tle0vKiAA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Whitchurch , Lars-Peter Clausen , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 43/60] iio: trigger: sysfs: fix use-after-free on remove Date: Mon, 27 Jun 2022 13:21:54 +0200 Message-Id: <20220627111928.957293275@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Vincent Whitchurch commit 78601726d4a59a291acc5a52da1d3a0a6831e4e8 upstream. Ensure that the irq_work has completed before the trigger is freed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KASAN: use-after-free in irq_work_run_list Read of size 8 at addr 0000000064702248 by task python3/25 Call Trace: irq_work_run_list irq_work_tick update_process_times tick_sched_handle tick_sched_timer __hrtimer_run_queues hrtimer_interrupt Allocated by task 25: kmem_cache_alloc_trace iio_sysfs_trig_add dev_attr_store sysfs_kf_write kernfs_fop_write_iter new_sync_write vfs_write ksys_write sys_write Freed by task 25: kfree iio_sysfs_trig_remove dev_attr_store sysfs_kf_write kernfs_fop_write_iter new_sync_write vfs_write ksys_write sys_write =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Fixes: f38bc926d022 ("staging:iio:sysfs-trigger: Use irq_work to properly a= ctive trigger") Signed-off-by: Vincent Whitchurch Reviewed-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220519091925.1053897-1-vincent.whitchurch= @axis.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/trigger/iio-trig-sysfs.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/trigger/iio-trig-sysfs.c +++ b/drivers/iio/trigger/iio-trig-sysfs.c @@ -196,6 +196,7 @@ static int iio_sysfs_trigger_remove(int } =20 iio_trigger_unregister(t->trig); + irq_work_sync(&t->work); iio_trigger_free(t->trig); =20 list_del(&t->l); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20522C43334 for ; Mon, 27 Jun 2022 11:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235754AbiF0Led (ORCPT ); Mon, 27 Jun 2022 07:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235989AbiF0LdB (ORCPT ); Mon, 27 Jun 2022 07:33:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29FA5BCA9; Mon, 27 Jun 2022 04:30:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89038B81120; Mon, 27 Jun 2022 11:30:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 017DEC3411D; Mon, 27 Jun 2022 11:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329400; bh=oS4JqcnqTMwkuhSqxF7Xow7fCFBCovJFEcg1qA2kNVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cy8MMJx1kBwNvWFBFynh2Ut8Gl49vS6VbfYwIJje7bmLDVwN9rqXZSpp58ms9xPEb HaEzptH8qooah0WnjdDQrzJ+/+FbfzSCCOV8syNhTiflu909RY4PFruez/ZJ99iwkG bBDkLYer91qXQtr4o53eWWppiTdGSh/bgxIamPD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olivier Moysan , Fabrice Gasnier , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 44/60] iio: adc: stm32: fix maximum clock rate for stm32mp15x Date: Mon, 27 Jun 2022 13:21:55 +0200 Message-Id: <20220627111928.986365479@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Olivier Moysan commit 990539486e7e311fb5dab1bf4d85d1a8973ae644 upstream. Change maximum STM32 ADC input clock rate to 36MHz, as specified in STM32MP15x datasheets. Fixes: d58c67d1d851 ("iio: adc: stm32-adc: add support for STM32MP1") Signed-off-by: Olivier Moysan Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220609095234.375925-1-olivier.moysan@foss= .st.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/adc/stm32-adc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/stm32-adc-core.c +++ b/drivers/iio/adc/stm32-adc-core.c @@ -815,7 +815,7 @@ static const struct stm32_adc_priv_cfg s static const struct stm32_adc_priv_cfg stm32mp1_adc_priv_cfg =3D { .regs =3D &stm32h7_adc_common_regs, .clk_sel =3D stm32h7_adc_clk_sel, - .max_clk_rate_hz =3D 40000000, + .max_clk_rate_hz =3D 36000000, .has_syscfg =3D HAS_VBOOSTER | HAS_ANASWVDD, .num_irqs =3D 2, }; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31EC1C433EF for ; Mon, 27 Jun 2022 11:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235993AbiF0Lf7 (ORCPT ); Mon, 27 Jun 2022 07:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236382AbiF0Ldp (ORCPT ); Mon, 27 Jun 2022 07:33:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0873B71; Mon, 27 Jun 2022 04:31:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8CA166150E; Mon, 27 Jun 2022 11:31:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9196DC3411D; Mon, 27 Jun 2022 11:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329465; bh=vgvNJrHBHS9C46/WmKV1U9Crcq8Uj+IGHmrgSflbAnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BY/HP/TYdDG9uB39Q3V6eH6cfR2FaF4nlbNDPZyfqLLIlqYQymKv3bFT27ugF8msh a/kXwRO4HGL/1AgvLriQuuCoGrM7BSOaOcCvfnzRmjI50aJgUsm0hTklH4zMt/6dC4 Z3pdI+OZTeDIPISUeKtqfvNxQY4XzhOHMiZlYGxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 45/60] iio: adc: axp288: Override TS pin bias current for some models Date: Mon, 27 Jun 2022 13:21:56 +0200 Message-Id: <20220627111929.015392263@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede commit 048058399f19d43cf21de9f5d36cd8144337d004 upstream. Since commit 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") we preserve the bias current set by the firmware at boot. This fixes issues we were seeing on various models. Some models like the Nuvision Solo 10 Draw tablet actually need the old hardcoded 80=C5=B3A bias current for battery temperature monitoring to work properly. Add a quirk entry for the Nuvision Solo 10 Draw to the DMI quirk table to restore setting the bias current to 80=C5=B3A on this model. Fixes: 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=3D215882 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220506095040.21008-1-hdegoede@redhat.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iio/adc/axp288_adc.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/iio/adc/axp288_adc.c +++ b/drivers/iio/adc/axp288_adc.c @@ -196,6 +196,14 @@ static const struct dmi_system_id axp288 }, .driver_data =3D (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA, }, + { + /* Nuvision Solo 10 Draw */ + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "TMAX"), + DMI_MATCH(DMI_PRODUCT_NAME, "TM101W610L"), + }, + .driver_data =3D (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA, + }, {} }; =20 From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2273EC43334 for ; Mon, 27 Jun 2022 11:35:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236135AbiF0Lfl (ORCPT ); Mon, 27 Jun 2022 07:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236132AbiF0LdR (ORCPT ); Mon, 27 Jun 2022 07:33:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E325BF6C; Mon, 27 Jun 2022 04:30:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50B9661494; Mon, 27 Jun 2022 11:30:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F3F0C3411D; Mon, 27 Jun 2022 11:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329420; bh=AnMJAmMUcYuIuEwfnCA8fZf9H/5ZJ1+zFyeoIm3LNko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2/767sKJoSYaqU2o6PYoWwgTDTs/8gz6NxnIUZsM0objfqYxCpsxnpT1DOg7KMaq fBrQ8K+DmAyfv337QGNVwoBqjt+q6sl2edtcFJSFkWESV2TzkoJiBwGRDzZG/7CR1b Ny/1n0HzPddAzSWqRF8wGU2XmRx5tDKS3DaNvXXE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 5.4 46/60] xtensa: xtfpga: Fix refcount leak bug in setup Date: Mon, 27 Jun 2022 13:21:57 +0200 Message-Id: <20220627111929.043731752@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liang He commit 173940b3ae40114d4179c251a98ee039dc9cd5b3 upstream. In machine_setup(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: stable@vger.kernel.org Signed-off-by: Liang He Message-Id: <20220617115323.4046905-1-windhl@126.com> Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/xtensa/platforms/xtfpga/setup.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/xtensa/platforms/xtfpga/setup.c +++ b/arch/xtensa/platforms/xtfpga/setup.c @@ -148,6 +148,7 @@ static int __init machine_setup(void) =20 if ((eth =3D of_find_compatible_node(eth, NULL, "opencores,ethoc"))) update_local_mac(eth); + of_node_put(eth); return 0; } arch_initcall(machine_setup); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 960E9C433EF for ; Mon, 27 Jun 2022 11:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236010AbiF0LfJ (ORCPT ); Mon, 27 Jun 2022 07:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236247AbiF0Lda (ORCPT ); Mon, 27 Jun 2022 07:33:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11355D119; Mon, 27 Jun 2022 04:30:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9046561355; Mon, 27 Jun 2022 11:30:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B93DC3411D; Mon, 27 Jun 2022 11:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329442; bh=NGrFpnGNy+UhulDZSNrnYduBOQTEXJrXmxA3Afg3+7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4SkJgiGRXXWGAe4hAKmoo0L8gkqfqVGqfy37QsQGJUojIGWhlaIGyP9eM5bmpeL5 9yHMPg0YjmWv9oEMoh7aBDTEZe942zgeH2r51IZcIUc/nFq6X7VTHH4BvBlyo1FKCE mWstepnwD1Ksodo9meXaAR3Wmyq0Q2DAEdLeDhqQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 5.4 47/60] xtensa: Fix refcount leak bug in time.c Date: Mon, 27 Jun 2022 13:21:58 +0200 Message-Id: <20220627111929.073062554@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liang He commit a0117dc956429f2ede17b323046e1968d1849150 upstream. In calibrate_ccount(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: stable@vger.kernel.org Signed-off-by: Liang He Message-Id: <20220617124432.4049006-1-windhl@126.com> Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/xtensa/kernel/time.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -160,6 +160,7 @@ static void __init calibrate_ccount(void cpu =3D of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu"); if (cpu) { clk =3D of_clk_get(cpu, 0); + of_node_put(cpu); if (!IS_ERR(clk)) { ccount_freq =3D clk_get_rate(clk); return; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC1D0C433EF for ; Mon, 27 Jun 2022 11:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236023AbiF0LfM (ORCPT ); Mon, 27 Jun 2022 07:35:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbiF0Ldd (ORCPT ); Mon, 27 Jun 2022 07:33:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960D3D12F; Mon, 27 Jun 2022 04:30:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 487CEB8111B; Mon, 27 Jun 2022 11:30:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A19F7C3411D; Mon, 27 Jun 2022 11:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329445; bh=Y8/7DRUh+lZjPlYwIbH/DiRIh4q8KDZY8gKG2Qs2WwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1jKsxoaWqNfQNtXQXq0/T//P49T0wsReCRKKqCev5L9N+xA/tg0/T2MADVpOH0CM2 gb3Hb1F1fI1dlWCyRPLEIHWtCZfk89IreynzKHLvmPz6yfuDoe8/AkELQn3L2+Tx4A x9M8q2KDJC/b1vY0aBhiG+zXErOPp6aOWvXJAuOs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller , John David Anglin Subject: [PATCH 5.4 48/60] parisc: Enable ARCH_HAS_STRICT_MODULE_RWX Date: Mon, 27 Jun 2022 13:21:59 +0200 Message-Id: <20220627111929.102264306@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Helge Deller commit 0a1355db36718178becd2bfe728a023933d73123 upstream. Fix a boot crash on a c8000 machine as reported by Dave. Basically it chan= ges patch_map() to return an alias mapping to the to-be-patched code in order to prevent writing to write-protected memory. Signed-off-by: Helge Deller Suggested-by: John David Anglin Cc: stable@vger.kernel.org # v5.2+ Link: https://lore.kernel.org/all/e8ec39e8-25f8-e6b4-b7ed-4cb23efc756e@bell= .net/ Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/parisc/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -11,6 +11,7 @@ config PARISC select ARCH_WANT_FRAME_POINTERS select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_STRICT_KERNEL_RWX + select ARCH_HAS_STRICT_MODULE_RWX select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_NO_SG_CHAIN select ARCH_SUPPORTS_MEMORY_FAILURE From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C721BC433EF for ; Mon, 27 Jun 2022 11:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236039AbiF0LfO (ORCPT ); Mon, 27 Jun 2022 07:35:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236293AbiF0Lde (ORCPT ); Mon, 27 Jun 2022 07:33:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755BEB07; Mon, 27 Jun 2022 04:30:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 12B8CB8111B; Mon, 27 Jun 2022 11:30:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6723BC3411D; Mon, 27 Jun 2022 11:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329447; bh=cIyAScn2AhewLmNAPu3c6ZTbqfpYL2Q2tu+IGjIzypI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ug8OhEzoENU3oxBRayE4+c5iQoCQ4kPWx9VC1DoK0DpZ4/pD/hpwDGFWOg0NcriOY 8+Jk/EZMQ3UWKURjGhxWceMna1akm1mg73Cjoqz2zL4z/wUU7PfjXOSOeTHEkZY3ET 55QRB12EwsUf0it6xVp20yKSW9h2seg3Su73jbEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Naveen N. Rao" , Sumit Dubey2 , Michael Ellerman Subject: [PATCH 5.4 49/60] powerpc: Enable execve syscall exit tracepoint Date: Mon, 27 Jun 2022 13:22:00 +0200 Message-Id: <20220627111929.133760521@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Naveen N. Rao commit ec6d0dde71d760aa60316f8d1c9a1b0d99213529 upstream. On execve[at], we are zero'ing out most of the thread register state including gpr[0], which contains the syscall number. Due to this, we fail to trigger the syscall exit tracepoint properly. Fix this by retaining gpr[0] in the thread register state. Before this patch: # tail /sys/kernel/debug/tracing/trace cat-123 [000] ..... 61.449351: sys_execve(filename: 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8) cat-124 [000] ..... 62.428481: sys_execve(filename: 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8) echo-125 [000] ..... 65.813702: sys_execve(filename: 7fffa6b23378, argv: 7fffa6b233a0, envp: 7fffa6b233b0) echo-125 [000] ..... 65.822214: sys_execveat(fd: 0, filename: 1009ac48, argv: 7ffff65d0c98, envp: 7ffff65d0ca8, flags: 0) After this patch: # tail /sys/kernel/debug/tracing/trace cat-127 [000] ..... 100.416262: sys_execve(filename: 7fffa41b3448, argv: 7fffa41b33e0, envp: 7fffa41b33f8) cat-127 [000] ..... 100.418203: sys_execve -> 0x0 echo-128 [000] ..... 103.873968: sys_execve(filename: 7fffa41b3378, argv: 7fffa41b33a0, envp: 7fffa41b33b0) echo-128 [000] ..... 103.875102: sys_execve -> 0x0 echo-128 [000] ..... 103.882097: sys_execveat(fd: 0, filename: 1009ac48, argv: 7fffd10d2148, envp: 7fffd10d2158, flags: 0) echo-128 [000] ..... 103.883225: sys_execveat -> 0x0 Cc: stable@vger.kernel.org Signed-off-by: Naveen N. Rao Tested-by: Sumit Dubey2 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220609103328.41306-1-naveen.n.rao@linux.v= net.ibm.com Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/powerpc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1719,7 +1719,7 @@ void start_thread(struct pt_regs *regs, tm_reclaim_current(0); #endif =20 - memset(regs->gpr, 0, sizeof(regs->gpr)); + memset(®s->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0])); regs->ctr =3D 0; regs->link =3D 0; regs->xer =3D 0; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E361AC43334 for ; Mon, 27 Jun 2022 11:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235643AbiF0LfR (ORCPT ); Mon, 27 Jun 2022 07:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbiF0Lde (ORCPT ); Mon, 27 Jun 2022 07:33:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4660DE85; Mon, 27 Jun 2022 04:30:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 38D0F612D8; Mon, 27 Jun 2022 11:30:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47DE0C3411D; Mon, 27 Jun 2022 11:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329450; bh=kkt3gAkpk4zSt5RnRBLPq4ddCp0djTQjV7HBZwGkRQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KGobKaAqFvrsExtmcMeKl6MhmHpiLfwOzTOXw/5Z6gtwhCRbWohYJnlU24+1qiP3R eTKx02eS3DWx0u3GUPCzoqOh9B46fl0ZCi8r7rIaZ/BRa58ffhJO5fPt6RnjhXgdtm BOjOr1fQp8s+VfdMHn+e7Haz8pZ4ENsUwUYQ5n10= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sathvika Vasireddy , Andrew Donnellan , Tyrel Datwyler , Nathan Lynch , Michael Ellerman Subject: [PATCH 5.4 50/60] powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address Date: Mon, 27 Jun 2022 13:22:01 +0200 Message-Id: <20220627111929.162390729@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Andrew Donnellan commit 7bc08056a6dabc3a1442216daf527edf61ac24b6 upstream. Add a special case to block_rtas_call() to allow the ibm,platform-dump RTAS call through the RTAS filter if the buffer address is 0. According to PAPR, ibm,platform-dump is called with a null buffer address to notify the platform firmware that processing of a particular dump is finished. Without this, on a pseries machine with CONFIG_PPC_RTAS_FILTER enabled, an application such as rtas_errd that is attempting to retrieve a dump will encounter an error at the end of the retrieval process. Fixes: bd59380c5ba4 ("powerpc/rtas: Restrict RTAS requests from userspace") Cc: stable@vger.kernel.org Reported-by: Sathvika Vasireddy Signed-off-by: Andrew Donnellan Reviewed-by: Tyrel Datwyler Reviewed-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220614134952.156010-1-ajd@linux.ibm.com Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/powerpc/kernel/rtas.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -988,7 +988,7 @@ static struct rtas_filter rtas_filters[] { "get-time-of-day", -1, -1, -1, -1, -1 }, { "ibm,get-vpd", -1, 0, -1, 1, 2 }, { "ibm,lpar-perftools", -1, 2, 3, -1, -1 }, - { "ibm,platform-dump", -1, 4, 5, -1, -1 }, + { "ibm,platform-dump", -1, 4, 5, -1, -1 }, /* Special cased */ { "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 }, { "ibm,scan-log-dump", -1, 0, 1, -1, -1 }, { "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 }, @@ -1035,6 +1035,15 @@ static bool block_rtas_call(int token, i size =3D 1; =20 end =3D base + size - 1; + + /* + * Special case for ibm,platform-dump - NULL buffer + * address is used to indicate end of dump processing + */ + if (!strcmp(f->name, "ibm,platform-dump") && + base =3D=3D 0) + return false; + if (!in_rmo_buf(base, end)) goto err; } From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FEE8C43334 for ; Mon, 27 Jun 2022 11:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236061AbiF0LfU (ORCPT ); Mon, 27 Jun 2022 07:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236317AbiF0Ldg (ORCPT ); Mon, 27 Jun 2022 07:33:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16712DEA2; Mon, 27 Jun 2022 04:30:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CC887B8111B; Mon, 27 Jun 2022 11:30:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D300C3411D; Mon, 27 Jun 2022 11:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329453; bh=ENp+C17M95ListxMPUSfVGysZT5Z3g9W0BA635L+hEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tni5OM9gKAzZaItOB1OdMZRA3OuQRwlmv+uEwn0Sff4pCri0j/QEs73VUOjiNM0Ep QlQavm5RDcAyG1xpmmuUdOTX1TD5FPuVdFgXzJHd/nGYX7b/jRL9dPWcQNE7LT5NTa XkJvZtgXsDvxrZyAEEOumRoK7m0qWP8y0+GoC4s0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Christophe Leroy , Michael Ellerman Subject: [PATCH 5.4 51/60] powerpc/powernv: wire up rng during setup_arch Date: Mon, 27 Jun 2022 13:22:02 +0200 Message-Id: <20220627111929.192191226@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jason A. Donenfeld commit f3eac426657d985b97c92fa5f7ae1d43f04721f3 upstream. The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Complicating things, however, is that POWER8 systems need some per-cpu state and kmalloc, which isn't available at this stage. So we split things up into an early phase and a later opportunistic phase. This commit also removes some noisy log messages that don't add much. Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for pow= ernv") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Jason A. Donenfeld Reviewed-by: Christophe Leroy [mpe: Add of_node_put(), use pnv naming, minor change log editing] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220621140849.127227-1-Jason@zx2c4.com Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/powerpc/platforms/powernv/powernv.h | 2 + arch/powerpc/platforms/powernv/rng.c | 52 +++++++++++++++++++++-----= ----- arch/powerpc/platforms/powernv/setup.c | 2 + 3 files changed, 40 insertions(+), 16 deletions(-) --- a/arch/powerpc/platforms/powernv/powernv.h +++ b/arch/powerpc/platforms/powernv/powernv.h @@ -35,4 +35,6 @@ ssize_t memcons_copy(struct memcons *mc, u32 memcons_get_size(struct memcons *mc); struct memcons *memcons_init(struct device_node *node, const char *mc_prop= _name); =20 +void pnv_rng_init(void); + #endif /* _POWERNV_H */ --- a/arch/powerpc/platforms/powernv/rng.c +++ b/arch/powerpc/platforms/powernv/rng.c @@ -17,6 +17,7 @@ #include #include #include +#include "powernv.h" =20 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul =20 @@ -28,7 +29,6 @@ struct powernv_rng { =20 static DEFINE_PER_CPU(struct powernv_rng *, powernv_rng); =20 - int powernv_hwrng_present(void) { struct powernv_rng *rng; @@ -98,9 +98,6 @@ static int initialise_darn(void) return 0; } } - - pr_warn("Unable to use DARN for get_random_seed()\n"); - return -EIO; } =20 @@ -163,32 +160,55 @@ static __init int rng_create(struct devi =20 rng_init_per_cpu(rng, dn); =20 - pr_info_once("Registering arch random hook.\n"); - ppc_md.get_random_seed =3D powernv_get_random_long; =20 return 0; } =20 -static __init int rng_init(void) +static int __init pnv_get_random_long_early(unsigned long *v) { struct device_node *dn; - int rc; + + if (!slab_is_available()) + return 0; + + if (cmpxchg(&ppc_md.get_random_seed, pnv_get_random_long_early, + NULL) !=3D pnv_get_random_long_early) + return 0; =20 for_each_compatible_node(dn, NULL, "ibm,power-rng") { - rc =3D rng_create(dn); - if (rc) { - pr_err("Failed creating rng for %pOF (%d).\n", - dn, rc); + if (rng_create(dn)) continue; - } - /* Create devices for hwrng driver */ of_platform_device_create(dn, NULL, NULL); } =20 - initialise_darn(); + if (!ppc_md.get_random_seed) + return 0; + return ppc_md.get_random_seed(v); +} + +void __init pnv_rng_init(void) +{ + struct device_node *dn; =20 + /* Prefer darn over the rest. */ + if (!initialise_darn()) + return; + + dn =3D of_find_compatible_node(NULL, NULL, "ibm,power-rng"); + if (dn) + ppc_md.get_random_seed =3D pnv_get_random_long_early; + + of_node_put(dn); +} + +static int __init pnv_rng_late_init(void) +{ + unsigned long v; + /* In case it wasn't called during init for some other reason. */ + if (ppc_md.get_random_seed =3D=3D pnv_get_random_long_early) + pnv_get_random_long_early(&v); return 0; } -machine_subsys_initcall(powernv, rng_init); +machine_subsys_initcall(powernv, pnv_rng_late_init); --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -168,6 +168,8 @@ static void __init pnv_setup_arch(void) powersave_nap =3D 1; =20 /* XXX PMCS */ + + pnv_rng_init(); } =20 static void __init pnv_init(void) From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2D5FCCA473 for ; Mon, 27 Jun 2022 11:35:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235824AbiF0LfY (ORCPT ); Mon, 27 Jun 2022 07:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236325AbiF0Ldh (ORCPT ); Mon, 27 Jun 2022 07:33:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E985DEAC; Mon, 27 Jun 2022 04:30:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B253612D8; Mon, 27 Jun 2022 11:30:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C3F2C3411D; Mon, 27 Jun 2022 11:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329456; bh=CE16h4Za8gFzCYa0eRZvLILjAcKuoaholZwAc3agvQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=af7puuye9HCFPQ2GVW6VnuO21O95dzcb7EsXwSXuZxRCxq7+Akq5GzxX5SEPDSnGP fJNl5O5DyBOAV/j3TI8gOFh83cQlgU8XprK7hNR7oi19PboFJ0qmsmKIo3gfRMyTI+ EPN1anO+bZryWTQGxYhIu92DYumxUWRATqmNUXQY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Shawn Guo Subject: [PATCH 5.4 52/60] ARM: dts: imx6qdl: correct PU regulator ramp delay Date: Mon, 27 Jun 2022 13:22:03 +0200 Message-Id: <20220627111929.221347169@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Lucas Stach commit 93a8ba2a619816d631bd69e9ce2172b4d7a481b8 upstream. Contrary to what was believed at the time, the ramp delay of 150us is not plenty for the PU LDO with the default step time of 512 pulses of the 24MHz clock. Measurements have shown that after enabling the LDO the voltage on VDDPU_CAP jumps to ~750mV in the first step and after that the regulator executes the normal ramp up as defined by the step size control. This means it takes the regulator between 360us and 370us to ramp up to the nominal 1.15V voltage for this power domain. With the old setting of the ramp delay the power up of the PU GPC domain would happen in the middle of the regulator ramp with the voltage being at around 900mV. Apparently this was enough for most units to properly power up the peripherals in the domain and execute the reset. Some units however, fail to power up properly, especially when the chip is at a low temperature. In that case any access to the GPU registers would yield an incorrect result with no way to recover from this situation. Change the ramp delay to 380us to cover the measured ramp up time with a bit of additional slack. Fixes: 40130d327f72 ("ARM: dts: imx6qdl: Allow disabling the PU regulator, = add a enable ramp delay") Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/boot/dts/imx6qdl.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -766,7 +766,7 @@ regulator-name =3D "vddpu"; regulator-min-microvolt =3D <725000>; regulator-max-microvolt =3D <1450000>; - regulator-enable-ramp-delay =3D <150>; + regulator-enable-ramp-delay =3D <380>; anatop-reg-offset =3D <0x140>; anatop-vol-bit-shift =3D <9>; anatop-vol-bit-width =3D <5>; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AA2EC433EF for ; Mon, 27 Jun 2022 11:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235800AbiF0Lfr (ORCPT ); Mon, 27 Jun 2022 07:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236360AbiF0Ldl (ORCPT ); Mon, 27 Jun 2022 07:33:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2815AB3F; Mon, 27 Jun 2022 04:31:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7ED88B8111B; Mon, 27 Jun 2022 11:31:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3046C3411D; Mon, 27 Jun 2022 11:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329459; bh=Uhr76rKpMn9k14Rt8kwoPSjAeauo8B0/oEPeKfxRQSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oFNIx3j6mBiNHySsPQQbxRCRHtlAXtXoh9zsb/iNWJhnaQT2rR2xTQUAJo2D7bzjp uAh8iQaz14WV9SyQquTdFW05LUaXLuA2sZ7LfqB5zdW6FE8GsgxmHXFbHQmwkY4Els VIiUXdCbFnEI6r3f4uEHUHQy0USxIuljpoMkczY0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski Subject: [PATCH 5.4 53/60] ARM: exynos: Fix refcount leak in exynos_map_pmu Date: Mon, 27 Jun 2022 13:22:04 +0200 Message-Id: <20220627111929.250837330@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin commit c4c79525042a4a7df96b73477feaf232fe44ae81 upstream. of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. of_node_put() checks null pointer. Fixes: fce9e5bb2526 ("ARM: EXYNOS: Add support for mapping PMU base address= via DT") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523145513.12341-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-exynos/exynos.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -136,6 +136,7 @@ static void exynos_map_pmu(void) np =3D of_find_matching_node(NULL, exynos_dt_pmu_match); if (np) pmu_base_addr =3D of_iomap(np, 0); + of_node_put(np); } =20 static void __init exynos_init_irq(void) From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D237CC43334 for ; Mon, 27 Jun 2022 11:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235923AbiF0Lfy (ORCPT ); Mon, 27 Jun 2022 07:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236376AbiF0Ldo (ORCPT ); Mon, 27 Jun 2022 07:33:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA57CB50; Mon, 27 Jun 2022 04:31:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 51F8BB8111B; Mon, 27 Jun 2022 11:31:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBE36C3411D; Mon, 27 Jun 2022 11:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329462; bh=+PEY8aTgvCN7a4zjWSNtiwwqaicvZrFgs6faUOWbhog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lO9YyI3dvmlRHkJ3nJAT8CD9VXqnytrEZOfm+oPLQMFIbRLk6qMhs1ajevn22J7s4 uMPdMiYoz0Z7WklBCSwl2+x13umJ66wE58z4whuug+ADtz1q3G84p74luJFnTdWziN yZ6AwHc/FGPDRK2Z1zpVbHKvLudbjwu7KtShVP7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Andy Shevchenko , Florian Fainelli Subject: [PATCH 5.4 54/60] soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe Date: Mon, 27 Jun 2022 13:22:05 +0200 Message-Id: <20220627111929.279609206@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin commit 37d838de369b07b596c19ff3662bf0293fdb09ee upstream. of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. In brcmstb_init_sram, it pass dn to of_address_to_resource(), of_address_to_resource() will call of_find_device_by_node() to take reference, so we should release the reference returned by of_find_matching_node(). Fixes: 0b741b8234c8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend s= tates (ARM)") Signed-off-by: Miaoqian Lin Reviewed-by: Andy Shevchenko Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/soc/bcm/brcmstb/pm/pm-arm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c @@ -780,6 +780,7 @@ static int brcmstb_pm_probe(struct platf } =20 ret =3D brcmstb_init_sram(dn); + of_node_put(dn); if (ret) { pr_err("error setting up SRAM for PM\n"); return ret; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0A94C43334 for ; Mon, 27 Jun 2022 11:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234513AbiF0Lew (ORCPT ); Mon, 27 Jun 2022 07:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236156AbiF0LdW (ORCPT ); Mon, 27 Jun 2022 07:33:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D59BF74; Mon, 27 Jun 2022 04:30:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F022AB81117; Mon, 27 Jun 2022 11:30:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E0ADC3411D; Mon, 27 Jun 2022 11:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329423; bh=ysNOEvu3zGd1TifXXdMtyPRCM21reTJXO7MAoKCElac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRvpeqnnQtA534pnBZPd/rUTbXBCbocaTQm/yWIeE1RWIjsWRbEYE9iHjN2MWvbbL 8X4BedeMFxqENHhl7YV5TNj1cKauWQE1m6o7hCiYsUAi8HUTxj7VFmkjc9b9AT1YMV uN5JAY9tf7xX1khsLq57L0D2uaqmEeHAAjwHGUM4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Arnd Bergmann Subject: [PATCH 5.4 55/60] ARM: Fix refcount leak in axxia_boot_secondary Date: Mon, 27 Jun 2022 13:22:06 +0200 Message-Id: <20220627111929.308416091@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin commit 7c7ff68daa93d8c4cdea482da4f2429c0398fcde upstream. of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 1d22924e1c4e ("ARM: Add platform support for LSI AXM55xx SoC") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220601090548.47616-1-linmq006@gmail.com' Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-axxia/platsmp.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/arm/mach-axxia/platsmp.c +++ b/arch/arm/mach-axxia/platsmp.c @@ -39,6 +39,7 @@ static int axxia_boot_secondary(unsigned return -ENOENT; =20 syscon =3D of_iomap(syscon_np, 0); + of_node_put(syscon_np); if (!syscon) return -ENOMEM; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D56E3C43334 for ; Mon, 27 Jun 2022 11:34:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235966AbiF0Lez (ORCPT ); Mon, 27 Jun 2022 07:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236168AbiF0LdY (ORCPT ); Mon, 27 Jun 2022 07:33:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBF4CE11; Mon, 27 Jun 2022 04:30:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BDD5BB81126; Mon, 27 Jun 2022 11:30:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356ACC341C7; Mon, 27 Jun 2022 11:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329426; bh=zbM+FiatcV99sgVVByCocxpD5uvDGwRXusMpryNERgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFx/VgJvB45RKMRVXkiUK8Wqr644aSFYCUXrl3IdJPQyU5x0RX6+w45cPr4K6nh+O uvOmVdhUQ0gb+taD8tGbeaNxGhx2Tl8elDYVWTze6+TJ2zR8M0ouuf1C5L2SqM0rvG xvOYKG1/Jjh85/mfbZpp9bVw+A1yhMcaXXJcGug0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Halasa , Arnd Bergmann Subject: [PATCH 5.4 56/60] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Mon, 27 Jun 2022 13:22:07 +0200 Message-Id: <20220627111929.338371319@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin commit 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 upstream. of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support") Signed-off-by: Miaoqian Lin Acked-by: Krzysztof Halasa Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-cns3xxx/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c @@ -376,6 +376,7 @@ static void __init cns3xxx_init(void) /* De-Asscer SATA Reset */ cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA)); } + of_node_put(dn); =20 dn =3D of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci"); if (of_device_is_available(dn)) { @@ -389,6 +390,7 @@ static void __init cns3xxx_init(void) cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); } + of_node_put(dn); =20 pm_power_off =3D cns3xxx_power_off; From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66C25C43334 for ; Mon, 27 Jun 2022 11:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235665AbiF0Lfq (ORCPT ); Mon, 27 Jun 2022 07:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236179AbiF0LdZ (ORCPT ); Mon, 27 Jun 2022 07:33:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE8FCE15; Mon, 27 Jun 2022 04:30:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 05F1D612D8; Mon, 27 Jun 2022 11:30:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 070A0C3411D; Mon, 27 Jun 2022 11:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329429; bh=ShsZi12gGKcQZTw4TBWnl6cqCYb50NfFZL+L+POtwTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkq82g0Gfl32HnwCKpJ8oX2gkJDdeEUMiEm2oEZSRUKLssW/4/b+8sl1bfhxeZNT9 YAdZZm+xosWpzPl8okpA3kprP/Dz5qPpa5sKZthSAhHi8MaEukK97Py8s0vBgDv5VP XYLxB60cOj4N2jthdkb9KsZe6NoeD8gdTRHkpUvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nick Desaulniers Subject: [PATCH 5.4 57/60] modpost: fix section mismatch check for exported init/exit sections Date: Mon, 27 Jun 2022 13:22:08 +0200 Message-Id: <20220627111929.368555413@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada commit 28438794aba47a27e922857d27b31b74e8559143 upstream. Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores instead of 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec field. Fixes: f02e8a6596b7 ("module: Sort exported symbols") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1131,7 +1131,7 @@ static const struct sectioncheck section }, /* Do not export init/exit functions or data */ { - .fromsec =3D { "__ksymtab*", NULL }, + .fromsec =3D { "___ksymtab*", NULL }, .bad_tosec =3D { INIT_SECTIONS, EXIT_SECTIONS, NULL }, .mismatch =3D EXPORT_TO_INIT_EXIT, .symbol_white_list =3D { DEFAULT_SYMBOL_WHITE_LIST, NULL }, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692BDC43334 for ; Mon, 27 Jun 2022 11:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235977AbiF0Le5 (ORCPT ); Mon, 27 Jun 2022 07:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236198AbiF0Ld1 (ORCPT ); Mon, 27 Jun 2022 07:33:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CFFBCE2A; Mon, 27 Jun 2022 04:30:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8685DB8111A; Mon, 27 Jun 2022 11:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EABBCC341CD; Mon, 27 Jun 2022 11:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329432; bh=XtTYzG2sSKDKpLMoDkSYqdHNzo+dDX9KmREtNYeCC4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oNg7W+z2dXbG9reXz8dl72Df6Pg9JOdo7GwQxC/+NOc6pF/xy9LxaGfRQ/QFJmvJB kl48CYO03xEtXmKv+cMP5qjFDlhjbw9WOaAF+uFbTLOnWSY7Oyy1IFuHQekF11dtTf pmfppipHe60TDtvzO7kAdBQvNVnW97TEex66xDUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" Subject: [PATCH 5.4 58/60] random: update comment from copy_to_user() -> copy_to_iter() Date: Mon, 27 Jun 2022 13:22:09 +0200 Message-Id: <20220627111929.398188532@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jason A. Donenfeld commit 63b8ea5e4f1a87dea4d3114293fc8e96a8f193d7 upstream. This comment wasn't updated when we moved from read() to read_iter(), so this patch makes the trivial fix. Fixes: 1b388e7765f2 ("random: convert to using fops->read_iter()") Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -450,7 +450,7 @@ static ssize_t get_random_bytes_user(str =20 /* * Immediately overwrite the ChaCha key at index 4 with random - * bytes, in case userspace causes copy_to_user() below to sleep + * bytes, in case userspace causes copy_to_iter() below to sleep * forever, so that we still retain forward secrecy in that case. */ crng_make_state(chacha_state, (u8 *)&chacha_state[4], CHACHA_KEY_SIZE); From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1967BC43334 for ; Mon, 27 Jun 2022 11:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235989AbiF0LfG (ORCPT ); Mon, 27 Jun 2022 07:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbiF0Ld1 (ORCPT ); Mon, 27 Jun 2022 07:33:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B510ECE35; Mon, 27 Jun 2022 04:30:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B43F614F0; Mon, 27 Jun 2022 11:30:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16C18C341D2; Mon, 27 Jun 2022 11:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329435; bh=zTmVWyeo9uBh0jWVQ7ODzF2cjoMO46JiMkOWCxwDuJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ROVGLgvXqBkipx1qNjGShsbrd1S2BThlQILZj/oAzq3UcmxxNoXv3lFEERiDjNaIp 23oawrg36eXEdA+yYElmZg/UhPBgqGwnzffP/xLWHZynyBUZyavOMEsnV2gjbGfytO 3tCgv2TY7FdXjnjzB/c5re89ACbUWaoZI39tRD8w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sami Tolvanen , Nick Desaulniers Subject: [PATCH 5.4 59/60] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) Date: Mon, 27 Jun 2022 13:22:10 +0200 Message-Id: <20220627111929.426963379@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada commit 53632ba87d9f302a8d97a11ec2f4f4eec7bb75ea upstream. If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice. Commit 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix the issue at all. Now I realized I had applied a wrong patch. In v1 patch [1], the autoksyms_recursive target correctly recurses to "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive". In v2 patch [2], I accidentally dropped the diff line, and it recurses to "$(MAKE) -f $(srctree)/Makefile vmlinux". Restore the code I intended in v1. [1]: https://lore.kernel.org/linux-kbuild/1521045861-22418-8-git-send-email= -yamada.masahiro@socionext.com/ [2]: https://lore.kernel.org/linux-kbuild/1521166725-24157-8-git-send-email= -yamada.masahiro@socionext.com/ Fixes: 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED= _KSYMS") Signed-off-by: Masahiro Yamada Tested-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -1073,7 +1073,7 @@ PHONY +=3D autoksyms_recursive ifdef CONFIG_TRIM_UNUSED_KSYMS autoksyms_recursive: descend modules.order $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ - "$(MAKE) -f $(srctree)/Makefile vmlinux" + "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive" endif =20 # For the kernel to actually contain only the needed exported symbols, From nobody Sun Apr 19 20:31:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC82C433EF for ; Mon, 27 Jun 2022 11:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235116AbiF0LfH (ORCPT ); Mon, 27 Jun 2022 07:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236237AbiF0Lda (ORCPT ); Mon, 27 Jun 2022 07:33:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03B86D10B; Mon, 27 Jun 2022 04:30:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 63852B8111A; Mon, 27 Jun 2022 11:30:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31D20C3411D; Mon, 27 Jun 2022 11:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329439; bh=10mVpdiw6f+f02y4ZjqUbiBDWe4mSbM1JwVKYUuAddI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjNPh7ywehEnX163ijqbjjDciUGMRPfSQ4o284Ide2ic+RiY+gTOE/3uwckujuwmF SMof7KCsXPn7W0jxlUlKjkEqDTaOIYkMhwO1P/YjGBk+rnSik7nOJpk/CRyfuejsGe 6XrFCoLVn5Gy9I83aMuItFP6VG2ZIfjKdneWd+2Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Christophe Leroy , Michael Ellerman Subject: [PATCH 5.4 60/60] powerpc/pseries: wire up rng during setup_arch() Date: Mon, 27 Jun 2022 13:22:11 +0200 Message-Id: <20220627111929.455633485@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jason A. Donenfeld commit e561e472a3d441753bd012333b057f48fef1045b upstream. The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire this up. This commit also removes some noisy log messages that don't add much. Fixes: a489043f4626 ("powerpc/pseries: Implement arch_get_random_long() bas= ed on H_RANDOM") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Jason A. Donenfeld Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220611151015.548325-4-Jason@zx2c4.com Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman Reported-by: Linux Kernel Functional Testing Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/powerpc/platforms/pseries/pseries.h | 2 ++ arch/powerpc/platforms/pseries/rng.c | 11 +++-------- arch/powerpc/platforms/pseries/setup.c | 2 ++ 3 files changed, 7 insertions(+), 8 deletions(-) --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h @@ -114,4 +114,6 @@ int dlpar_workqueue_init(void); void pseries_setup_rfi_flush(void); void pseries_lpar_read_hblkrm_characteristics(void); =20 +void pseries_rng_init(void); + #endif /* _PSERIES_PSERIES_H */ --- a/arch/powerpc/platforms/pseries/rng.c +++ b/arch/powerpc/platforms/pseries/rng.c @@ -10,6 +10,7 @@ #include #include #include +#include "pseries.h" =20 =20 static int pseries_get_random_long(unsigned long *v) @@ -24,19 +25,13 @@ static int pseries_get_random_long(unsig return 0; } =20 -static __init int rng_init(void) +void __init pseries_rng_init(void) { struct device_node *dn; =20 dn =3D of_find_compatible_node(NULL, NULL, "ibm,random"); if (!dn) - return -ENODEV; - - pr_info("Registering arch random hook.\n"); - + return; ppc_md.get_random_seed =3D pseries_get_random_long; - of_node_put(dn); - return 0; } -machine_subsys_initcall(pseries, rng_init); --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -792,6 +792,8 @@ static void __init pSeries_setup_arch(vo =20 if (swiotlb_force =3D=3D SWIOTLB_FORCE) ppc_swiotlb_enable =3D 1; + + pseries_rng_init(); } =20 static void pseries_panic(char *str)