From nobody Tue Apr 21 16:01:35 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 AD771C43334 for ; Thu, 30 Jun 2022 13:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235674AbiF3Nvo (ORCPT ); Thu, 30 Jun 2022 09:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235434AbiF3NvK (ORCPT ); Thu, 30 Jun 2022 09:51:10 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0C440E6D; Thu, 30 Jun 2022 06:49: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 sin.source.kernel.org (Postfix) with ESMTPS id 70CB9CE2EB9; Thu, 30 Jun 2022 13:49:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60FD6C3411E; Thu, 30 Jun 2022 13:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596947; bh=SX5d9fc7xezRnx6EdzirEA4WlPsJIus5S0oM8iz9u9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MVOk2WUkETMMkEi6kxzQ060QS1Z3sJhWZOFNlzWp2Ucpdmlux9jBpdUM0AlW76iOo +JjNtGD8mbPrpH9DO/uh1Foajs2B4dBJwzXHkZcHk4AvJ8v/VHhHT0bq3BTs7x5wZB JoG/nUAujkZigEMUauQm3cIvqAhwhTJC+pXdA1lM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Slaby , guodaxing Subject: [PATCH 4.14 01/35] vt: drop old FONT ioctls Date: Thu, 30 Jun 2022 15:46:12 +0200 Message-Id: <20220630133232.480167082@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/tty/vt/vt.c | 34 ---------- drivers/tty/vt/vt_ioctl.c | 149 -----------------------------------------= ----- include/linux/kd.h | 8 -- 3 files changed, 3 insertions(+), 188 deletions(-) delete mode 100644 include/linux/kd.h --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4132,16 +4132,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 @@ -4169,27 +4161,7 @@ static int con_font_set(struct vc_data * return -EINVAL; if (op->charcount > 512) return -EINVAL; - if (!op->height) { /* Need to guess font height [compat] */ - int h, i; - u8 __user *charmap =3D op->data; - u8 tmp; - =09 - /* If from KDFONTOP ioctl, don't allow things which can be done in userl= and, - so that we can get rid of this soon */ - if (!(op->flags & KD_FONT_FLAG_OLD)) - return -EINVAL; - for (h =3D 32; h > 0; h--) - for (i =3D 0; i < op->charcount; i++) { - if (get_user(tmp, &charmap[32*i+h-1])) - return -EFAULT; - if (tmp) - goto nonzero; - } - return -EINVAL; - nonzero: - op->height =3D h; - } - 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) --- 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_* */ @@ -1222,11 +1078,6 @@ long vt_compat_ioctl(struct tty_struct * /* * these need special handlers for incompatible data structures */ - case PIO_FONTX: - case GIO_FONTX: - ret =3D compat_fontx_ioctl(vc, cmd, up, perm, &op); - break; - case KDFONTOP: ret =3D compat_kdfontop_ioctl(up, perm, &op, vc); break; --- 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 Tue Apr 21 16:01:35 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 811EFC43334 for ; Thu, 30 Jun 2022 13:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235759AbiF3Nxd (ORCPT ); Thu, 30 Jun 2022 09:53:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235791AbiF3Nw2 (ORCPT ); Thu, 30 Jun 2022 09:52:28 -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 A671745509; Thu, 30 Jun 2022 06:49: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 dfw.source.kernel.org (Postfix) with ESMTPS id CFE6861FF6; Thu, 30 Jun 2022 13:49:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D73F3C34115; Thu, 30 Jun 2022 13:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596978; bh=h1N85u9a3APp1yw2woC9p/8mzkK2TLZrhyjIps8M9WU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qt4iUnqyXYHK25BHwhPHFiCoyAq47RsyYeDbXtiHwirlu1AsNKaeYAxdiscit5UOi jfkIPVdFk6smgYC7Gyvx25NdEa+rkzLEaNC6BKPvMKKDjHx6bx+hBB0/ckTBUeVYEa A+57dKVWkboN0nPeXFhYCiqJXGpMPMCekc1J9nyM= 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 4.14 02/35] random: schedule mix_interrupt_randomness() less often Date: Thu, 30 Jun 2022 15:46:13 +0200 Message-Id: <20220630133232.511345542@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 Tue Apr 21 16:01:35 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 CC0ADC43334 for ; Thu, 30 Jun 2022 13:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235909AbiF3Nyc (ORCPT ); Thu, 30 Jun 2022 09:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235810AbiF3Nxw (ORCPT ); Thu, 30 Jun 2022 09:53:52 -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 B26A44F660; Thu, 30 Jun 2022 06:50:09 -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 8920761FF6; Thu, 30 Jun 2022 13:50:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89464C34115; Thu, 30 Jun 2022 13:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597008; bh=x7P22JytzPf6oNjq71S/evHGGCzh/+caYNfY3VnwaO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SrtiuNWNJy1VglhD9/OgzD07Ofkt8dzKdjCRMpsBBlA3sWulgfZJ/pPfRyK4+v14C JopkVWz5cv01V11hm7YYdFjTFpnEE+hm3Y3DiwEsG03b/EHAND8ua9ErkAFrGA4gB8 livB2iZGm4L5xNZTCUngsIUawUmjgXsYzWDoXygc= 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 4.14 03/35] ata: libata: add qc->flags in ata_qc_complete_template tracepoint Date: Thu, 30 Jun 2022 15:46:14 +0200 Message-Id: <20220630133232.540977324@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 Tue Apr 21 16:01:35 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 24FF5C43334 for ; Thu, 30 Jun 2022 13:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235945AbiF3Nzb (ORCPT ); Thu, 30 Jun 2022 09:55:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235866AbiF3Nyp (ORCPT ); Thu, 30 Jun 2022 09:54:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4DF935253; Thu, 30 Jun 2022 06:50:23 -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 4AFA86204B; Thu, 30 Jun 2022 13:50:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 544FEC34115; Thu, 30 Jun 2022 13:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597022; bh=VPc362y2Xt8oeF1O2gzNh2F430ZnHbftdjgSOiSbxS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAt1qgu6Acn6lWyQchIjN4dz70s1EwqenHwtY88Z3S+RgzjCReJne0xvgZug9ineT +3m6RPBQ6xufweaHR6+XQhRKS2uJcLrQMli3t5QB2BjqiP7KAurUHpr9V9PDmKDOsp 2PT8vdx5nZx9+s3SRNRqzE+FlcZi7HgeR1xY3Gew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikos Tsironis , Mike Snitzer Subject: [PATCH 4.14 04/35] dm era: commit metadata in postsuspend after worker stops Date: Thu, 30 Jun 2022 15:46:15 +0200 Message-Id: <20220630133232.570283588@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -1396,7 +1396,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 Tue Apr 21 16:01:35 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 661DDC433EF for ; Thu, 30 Jun 2022 13:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235762AbiF3Nzv (ORCPT ); Thu, 30 Jun 2022 09:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235896AbiF3Nyu (ORCPT ); Thu, 30 Jun 2022 09:54:50 -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 841A236B7D; Thu, 30 Jun 2022 06:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 17CFA61FD8; Thu, 30 Jun 2022 13:50:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21D31C34115; Thu, 30 Jun 2022 13:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597025; bh=r/AUmqVNZ/rqk8TyaWRYjSqZNwcpqBfVSV8e106GGsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwpNXueBq+fbdIoyvMXfAqXvxUeXfMnMW+r67nPg//C+CqQrPPDjncB6z9XB5kaST UFzAgOVXwftju2wMhh/v9DVhi40q+xF2VWFhG4bWuFYRs/az27lGLvmoKct1q0cI34 U/JyZIADN8A0nIJ3XmIQrIBYiljUgLUoaKFkeHxc= 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 4.14 05/35] random: quiet urandom warning ratelimit suppression message Date: Thu, 30 Jun 2022 15:46:16 +0200 Message-Id: <20220630133232.600336036@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 Tue Apr 21 16:01:35 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 DD585C433EF for ; Thu, 30 Jun 2022 13:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235929AbiF3Nz6 (ORCPT ); Thu, 30 Jun 2022 09:55:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235801AbiF3Ny7 (ORCPT ); Thu, 30 Jun 2022 09:54:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B82C65A46B; Thu, 30 Jun 2022 06:50: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 ams.source.kernel.org (Postfix) with ESMTPS id CDFEAB82AD8; Thu, 30 Jun 2022 13:50:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3F11C3411E; Thu, 30 Jun 2022 13:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597028; bh=vyo2qOmr7Aa0fK2HLMk9KQPHq4OLN6PaVvRBMTn4xfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mE6cwIJcS27e2VM3rXJd4hs3tAs8v8csgh4h0pCUAUGXNiggu3MCFSRk+FuoUJ6TB 92VBtf1Dlb10KjjAwjgieZyARJ05MS/jsUz+q2+qVz9KDkg+buYARqq0OM3I//60MX LMphAzvyKKi2pzWAD3yqqZvrIyl3gCXCyQYEa+Ec= 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 4.14 06/35] USB: serial: option: add Telit LE910Cx 0x1250 composition Date: Thu, 30 Jun 2022 15:46:17 +0200 Message-Id: <20220630133232.629342153@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1282,6 +1282,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 Tue Apr 21 16:01:35 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 5C427CCA47B for ; Thu, 30 Jun 2022 13:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235966AbiF3N4C (ORCPT ); Thu, 30 Jun 2022 09:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235848AbiF3NzB (ORCPT ); Thu, 30 Jun 2022 09:55:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E3374785; Thu, 30 Jun 2022 06:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 01D5E61FF6; Thu, 30 Jun 2022 13:50:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F1EC34115; Thu, 30 Jun 2022 13:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597031; bh=B5leJsp/j6w1GOH5nUKhrXG5bd4cR4H1tvD5dzhwwTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qe4aodHZR7+C9NdyVEaj/+TH/emNy6Q+7uFaVTXnP9Bd6Bx4994qiIRDks6Cz6qNK fEFt8W0JP9SKIzoS0BJC9jA7E/jHG80N9rrpHdjmOK4kFYYNuL1XBRxERiKV3XGVWp PTvvD1mxZ1uDQuzM/FzNy1lk1IwvkFBedPm82zZk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglin Tan , Johan Hovold Subject: [PATCH 4.14 07/35] USB: serial: option: add Quectel EM05-G modem Date: Thu, 30 Jun 2022 15:46:18 +0200 Message-Id: <20220630133232.657579575@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing -------------- 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 @@ -255,6 +255,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 @@ -1137,6 +1138,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 Tue Apr 21 16:01:35 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 ABD2BC43334 for ; Thu, 30 Jun 2022 13:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235905AbiF3N4Q (ORCPT ); Thu, 30 Jun 2022 09:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235950AbiF3Nzr (ORCPT ); Thu, 30 Jun 2022 09:55:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DED366B7; Thu, 30 Jun 2022 06:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id C84E46204B; Thu, 30 Jun 2022 13:50:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D20A6C3411E; Thu, 30 Jun 2022 13:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597034; bh=q9LM/snGtCeCnUkntmOPyVTiaM9W6nHtPieduW10RUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hesbbu5JX1pcEEZ7iP05x29ipmuNfXtK2Andz81JsiwDW4wQZuatq23hQdR7Uv/8T EenLYTRMEKFPjG4HCoileTq7YT132UcgyAks32JZlGZLFewLX/dDXbOSfA/8LzqaeI a9mHvbO3e7zEQad6nDllYquGIljrkNw7tZFu1P7c= 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 4.14 08/35] USB: serial: option: add Quectel RM500K module support Date: Thu, 30 Jun 2022 15:46:19 +0200 Message-Id: <20220630133232.686904639@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -260,6 +260,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 @@ -1153,6 +1154,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 Tue Apr 21 16:01:35 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 BB6E9C433EF for ; Thu, 30 Jun 2022 13:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235963AbiF3N4d (ORCPT ); Thu, 30 Jun 2022 09:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235795AbiF3Nzy (ORCPT ); Thu, 30 Jun 2022 09:55:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4387E022; Thu, 30 Jun 2022 06:50: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 ams.source.kernel.org (Postfix) with ESMTPS id 3DC6CB82AF6; Thu, 30 Jun 2022 13:50:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89E89C34115; Thu, 30 Jun 2022 13:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597036; bh=cpzX2yLedtKk+NI8PK8akJRB/FF4SgQBdiOZDYm3AXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Azgg+66EUaMplU2/Zof78g0sqL4VEwEirdF11U3hIIFlHRVPAJ3bzbkYbmAa1yGDX n8XtCGYB7jhHDPHIOYdOrUgRhPct2MAHYzuP5OBRG2ISnqPfhzZg50TzueNQsBUc6/ bXFXuYb51t2HqLJyw8fzNQyP1ZwF86kZnKc4MTNA= 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 4.14 09/35] bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers Date: Thu, 30 Jun 2022 15:46:20 +0200 Message-Id: <20220630133232.715988145@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 7096fcbf699c..98e64f63d9ba 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3048,9 +3048,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 Tue Apr 21 16:01:35 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 29D89CCA47B for ; Thu, 30 Jun 2022 13:51:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235701AbiF3Nvk (ORCPT ); Thu, 30 Jun 2022 09:51:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbiF3NvL (ORCPT ); Thu, 30 Jun 2022 09:51:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C20D37A03; Thu, 30 Jun 2022 06:49: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 dfw.source.kernel.org (Postfix) with ESMTPS id E0E6962005; Thu, 30 Jun 2022 13:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC06FC34115; Thu, 30 Jun 2022 13:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596950; bh=oCbBNzQ7H7CJAOIyXRH136dBBNXqajI5X04Of4eAtTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aol36U6d0SWtxOWamxRi01AulBsAI8eaW4RcKZGM6/Ewv/gM0tU88wLXH8QIQPxbC zB9tdTOyMm4hPxuEN/37T5f+u2Bq4S1fQloCb0p63XMYP/L51PFkYUdLaCjTrsHoXM YKipvjWXTdZkM8FQfWXBgL5nCrovMfk4OdS4dQVg= 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 4.14 10/35] x86/xen: Remove undefined behavior in setup_features() Date: Thu, 30 Jun 2022 15:46:21 +0200 Message-Id: <20220630133232.744912833@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 d7d34fdfc993..f466f776604f 100644 --- a/drivers/xen/features.c +++ b/drivers/xen/features.c @@ -28,6 +28,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 5D756CCA47B for ; Thu, 30 Jun 2022 13:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235731AbiF3Nv4 (ORCPT ); Thu, 30 Jun 2022 09:51:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235588AbiF3Nv0 (ORCPT ); Thu, 30 Jun 2022 09:51:26 -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 3577E1020; Thu, 30 Jun 2022 06:49: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 ams.source.kernel.org (Postfix) with ESMTPS id 6D185B82AFA; Thu, 30 Jun 2022 13:49:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C884FC34115; Thu, 30 Jun 2022 13:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596953; bh=7kiX5/iU3xMuzV4UnCjZcDeo0Fq3+CeUwxfLySqMeXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uadquo0eR0gBVYmeX2rGEXVboYyFTg7PPpbqcq3Ylx0rndX4nkFxxJ06WKf9tk6HI FwCZSwaFWwTDa5RRAakRe1JGGGeXmFwv3/ZG8nNbNQrxSq3tPVSy3LussxslX4qa15 FW8vY1OPLWEDKt/92gqhQ92NGUN2vbhhgHaPMeFM= 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 4.14 11/35] MIPS: Remove repetitive increase irq_err_count Date: Thu, 30 Jun 2022 15:46:22 +0200 Message-Id: <20220630133232.773486663@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 745b7b436961..42f77b318974 100644 --- a/arch/mips/vr41xx/common/icu.c +++ b/arch/mips/vr41xx/common/icu.c @@ -653,8 +653,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 ac8deb01f6f6..ee3163dd794b 100644 --- a/drivers/gpio/gpio-vr41xx.c +++ b/drivers/gpio/gpio-vr41xx.c @@ -224,8 +224,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 Tue Apr 21 16:01:35 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 4244BC43334 for ; Thu, 30 Jun 2022 13:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235683AbiF3NwA (ORCPT ); Thu, 30 Jun 2022 09:52:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235617AbiF3Nv1 (ORCPT ); Thu, 30 Jun 2022 09:51:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20BF7427C8; Thu, 30 Jun 2022 06:49:17 -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 85E5762006; Thu, 30 Jun 2022 13:49:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92929C341CC; Thu, 30 Jun 2022 13:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596956; bh=ZxozKRz9RYqVmnenqYn0pui8X/beczmuhy+GS2bJ248=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6XTzfCApUCoSh7fJNMdmchaI4bFZDWgzG5kRfelSFXH/cepGdxK94cpkjgBrfKgV u8osSPZzcRXMTjAIv5D0mSPZFJZE2D7qCdBb69xm43vd+W1h5CzEOrb+I/VCnjDaIC GFP9+HRr72/bEExnWkWBvtJ676OSj1jA15uZcnBg= 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 4.14 12/35] igb: Make DMA faster when CPU is active on the PCIe link Date: Thu, 30 Jun 2022 15:46:23 +0200 Message-Id: <20220630133232.803178765@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 618063d21f96..7b70e95ee352 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8618,11 +8618,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 @@ -8655,7 +8654,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 @@ -8672,12 +8670,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 Tue Apr 21 16:01:35 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 B3EC9C43334 for ; Thu, 30 Jun 2022 13:52:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235340AbiF3NwD (ORCPT ); Thu, 30 Jun 2022 09:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbiF3Nv3 (ORCPT ); Thu, 30 Jun 2022 09:51:29 -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 4DDCE42A16; Thu, 30 Jun 2022 06:49: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 3244661FD8; Thu, 30 Jun 2022 13:49:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44D8FC34115; Thu, 30 Jun 2022 13:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596958; bh=y9i6OcD3+jttfol87JifqvXY8ddQ2O+EJsT5yNM2FLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sJWrqn2FPe+X996vU8Mhju+PT3n1JCqSK/empU+RyhlW1dsxI0EqL2lcfObCIvvCT gtXK26CU4FiTxoX6wYsR6p+NFPw9Lj/QaxgzBAYonoKgLcai4PeUZdU+2sZ2NITXpT mgmjFTPI0I02f37e+uTLESWggSLBLPFmC6xHUkSc= 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 4.14 13/35] iio: adc: vf610: fix conversion mode sysfs node name Date: Thu, 30 Jun 2022 15:46:24 +0200 Message-Id: <20220630133232.833185273@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 Tue Apr 21 16:01:35 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 C0718CCA47B for ; Thu, 30 Jun 2022 13:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235582AbiF3NwR (ORCPT ); Thu, 30 Jun 2022 09:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbiF3Nvm (ORCPT ); Thu, 30 Jun 2022 09:51:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B3F43AF5; Thu, 30 Jun 2022 06:49: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 A6C8BB82AF7; Thu, 30 Jun 2022 13:49:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02679C34115; Thu, 30 Jun 2022 13:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596961; bh=SFPCNYMIa6duS07QbJTp6fZo5uJ7Nj5zQ/CfAM0yrGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ci1PIaPCMovZNUoUAs25FRQL4jbpbt6j+WwriA3Ivy3BEvwRklozCorPPnY1N8n0l PE76fTzWosyzzi/tKVmIeqJFEu+a2kJse+vF59eWFqPOwEYW2mUEkqIpPTtI9JCxTv 6GOVmLRsQLmQiLk4pdTBN1MvRZsEqQQqvnx5aSyE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Yang Subject: [PATCH 4.14 14/35] usb: chipidea: udc: check request status before setting device address Date: Thu, 30 Jun 2022 15:46:25 +0200 Message-Id: <20220630133232.862400159@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/chipidea/udc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -923,6 +923,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 Tue Apr 21 16:01:35 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 1756BCCA47B for ; Thu, 30 Jun 2022 13:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235766AbiF3NwU (ORCPT ); Thu, 30 Jun 2022 09:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235454AbiF3Nvv (ORCPT ); Thu, 30 Jun 2022 09:51:51 -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 5E1FE43ED6; Thu, 30 Jun 2022 06:49: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 7EA6DB82AF5; Thu, 30 Jun 2022 13:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF02CC34115; Thu, 30 Jun 2022 13:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596964; bh=M5eWI8GLqMBs1KZpLYLx0aef5pNK01Mfwl3xIvzEc+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kjn9qvrFr8fN3GexzXxIIXo6lRrkG2OdB+kLl17cUruOdfT5Hg8rg8u/u23CLiKcv ytCWlVNuYps3HKy1wFX5WycWfLGTF+iyuUtn2gw0fqZ/ZZUM3prfFtPEhLnTDSinrY MIJRck2/B+APnQLRWyUTCk+PQfihNbv9oEvNnllQ= 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 4.14 15/35] iio:accel:bma180: rearrange iio trigger get and register Date: Thu, 30 Jun 2022 15:46:26 +0200 Message-Id: <20220630133232.891429035@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -782,11 +782,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 Tue Apr 21 16:01:35 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 4ABC1C433EF for ; Thu, 30 Jun 2022 13:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235618AbiF3Nw6 (ORCPT ); Thu, 30 Jun 2022 09:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235455AbiF3Nvw (ORCPT ); Thu, 30 Jun 2022 09:51:52 -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 5C6C942A32; Thu, 30 Jun 2022 06:49: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 AD6D96200A; Thu, 30 Jun 2022 13:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B64D8C34115; Thu, 30 Jun 2022 13:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596967; bh=G68ram22Yw6cqctiSSLLhL4MFElmk76X4+SYrpPQTNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cw1+TCrqDjQ19yxhLLUFlfYsz7vLahQUGjNR8dpR8zIihfUxR5iTidmhkmbmrGYj9 ZNrFzOXmaX5zBeLvqGOmq76j4LpFEsgcGmmJLhOAHyW50huMpxS/bKXveM13JDiN29 vANoZ283oQwbjXAhr2+RPGMXU6XDoGYeX4Qg8JGk= 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 4.14 16/35] iio: accel: mma8452: ignore the return value of reset operation Date: Thu, 30 Jun 2022 15:46:27 +0200 Message-Id: <20220630133232.920870308@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -1412,10 +1412,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 Tue Apr 21 16:01:35 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 450BAC43334 for ; Thu, 30 Jun 2022 13:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235798AbiF3Ny3 (ORCPT ); Thu, 30 Jun 2022 09:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235532AbiF3NwJ (ORCPT ); Thu, 30 Jun 2022 09:52:09 -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 5469E443F8; Thu, 30 Jun 2022 06:49: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 7D1DE62051; Thu, 30 Jun 2022 13:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85C96C34115; Thu, 30 Jun 2022 13:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596969; bh=CLKucOR1KV+hTdnmQuZOHWx60dJ5jfawBtDEBI3Okjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okJ1QGb+4WlBd+ZQe2iAsbz1PsHmvTQC60v/oPCKudCCQ8MfGKlsUd1d3AXgfl9qy u7bIn8r3KzF6x455mNBHl4GwLgENpXFUO+wewvvQhS1e1iAWWG9t0gw0BH3eGN0A5c E/nZAiNy13AVrRcx/EOETgqYEw+09gOZmCzjXXBQ= 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 4.14 17/35] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Date: Thu, 30 Jun 2022 15:46:28 +0200 Message-Id: <20220630133232.949544518@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 Tue Apr 21 16:01:35 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 725ADC43334 for ; Thu, 30 Jun 2022 13:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235733AbiF3NxX (ORCPT ); Thu, 30 Jun 2022 09:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235725AbiF3NwP (ORCPT ); Thu, 30 Jun 2022 09:52:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4726844A34; Thu, 30 Jun 2022 06:49: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 090A2B82AED; Thu, 30 Jun 2022 13:49:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42BA6C34115; Thu, 30 Jun 2022 13:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596972; bh=iHDelUGsW4GMdXhXCRonmDdd/G3/Yh0SQ4wX9e19R3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zAWJfDhyXHLtRxwCAdJK2p5ALmgjaRx/CpjqbOZQ+YDtwMHz80Xux9rp1sDthZeGX +rbGQk4VG70KhF2P5LvcBYnCBA2nUAP24tGdwf+hDbkGUh8dUsF7zdQhmk7MHrLFG1 0w2jAnbXGImTGH9uuC6IVHXOVF7WuT3EiKC0mjWs= 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 4.14 18/35] iio: trigger: sysfs: fix use-after-free on remove Date: Thu, 30 Jun 2022 15:46:29 +0200 Message-Id: <20220630133232.978268816@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -199,6 +199,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 Tue Apr 21 16:01:35 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 94C20C43334 for ; Thu, 30 Jun 2022 13:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235691AbiF3NxK (ORCPT ); Thu, 30 Jun 2022 09:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233783AbiF3NwQ (ORCPT ); Thu, 30 Jun 2022 09:52:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4802E69F; Thu, 30 Jun 2022 06:49:37 -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 0737162007; Thu, 30 Jun 2022 13:49:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF9FC34115; Thu, 30 Jun 2022 13:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596975; bh=59dgnchq3XHklAwf0vy/8xadvWw5GpNCkcKvtAD1piM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMAxlE6cguIeJlC07r9AhcCkn0wPVHjKFOvFBO/gRyt+vBJ9t68ulV9bmfl+QfSdi PPzi5qV6cWTxdvBj+tgG1R1IjrJqg5sXPYiz9KBu0+N5AfbCzTkLMS/TeACX4FJVX6 I2jMhzbimKMZv/Ga+rFFsaBhESoB3cSQahI+9HDk= 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 4.14 19/35] iio: adc: axp288: Override TS pin bias current for some models Date: Thu, 30 Jun 2022 15:46:30 +0200 Message-Id: <20220630133233.006090452@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -213,6 +213,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 Tue Apr 21 16:01:35 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 13227C43334 for ; Thu, 30 Jun 2022 13:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235395AbiF3Nxj (ORCPT ); Thu, 30 Jun 2022 09:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235829AbiF3Nwi (ORCPT ); Thu, 30 Jun 2022 09:52:38 -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 7428F4578C; Thu, 30 Jun 2022 06:49:44 -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 995D661FFB; Thu, 30 Jun 2022 13:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A291FC34115; Thu, 30 Jun 2022 13:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596981; bh=//tNa/+oXvrh+YZZ1UklDkaYoawaeD35eJmeJbf1BKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/71ka4wiBvpG98YZevpw19O5C0wO2i3HsqAw7TJDvxVNxUohiIraq/v3DwTEVb1Q Sltt5kBe3EJY3MERloGLRr7P52XtDsTKtIPKqneflFwkH/ltiTH79fSsCQ3G555O2Y Plh9+MJ63KyEQuOJc5OhZbXYQF99UlFnB51Vd13g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 4.14 20/35] xtensa: xtfpga: Fix refcount leak bug in setup Date: Thu, 30 Jun 2022 15:46:31 +0200 Message-Id: <20220630133233.035122118@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -152,6 +152,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 Tue Apr 21 16:01:35 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 A4C49C43334 for ; Thu, 30 Jun 2022 13:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235793AbiF3Nxm (ORCPT ); Thu, 30 Jun 2022 09:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235838AbiF3Nwm (ORCPT ); Thu, 30 Jun 2022 09:52: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 5B2D14579D; Thu, 30 Jun 2022 06:49: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 dfw.source.kernel.org (Postfix) with ESMTPS id 477E26205D; Thu, 30 Jun 2022 13:49:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C9C8C3411E; Thu, 30 Jun 2022 13:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596983; bh=tQbpvtEvCBc44itrMEC0A4dvWcUm/1NCxpin/Lzp79o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxlSejOYVWVZ6MjwtbnPd1fi+PYDn0zzrbS2a2qBJxSmaVX7EdHBTeS0UFvty/XmI oMVaw1TfNXLT7dyTSsTTAV8YvyTNFeGfv4AosIf+tgyK9mpuVHAsVNHIKV26gHwHqB WM6+gQttotdZFkn6tA38+JOp+9XgBej6IN+WTrl0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 4.14 21/35] xtensa: Fix refcount leak bug in time.c Date: Thu, 30 Jun 2022 15:46:32 +0200 Message-Id: <20220630133233.064006826@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/xtensa/kernel/time.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -146,6 +146,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 Tue Apr 21 16:01:35 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 47DF1C433EF for ; Thu, 30 Jun 2022 13:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235803AbiF3Nxv (ORCPT ); Thu, 30 Jun 2022 09:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235848AbiF3Nwm (ORCPT ); Thu, 30 Jun 2022 09:52:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E19B3152A; Thu, 30 Jun 2022 06:49: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 dfw.source.kernel.org (Postfix) with ESMTPS id E783162000; Thu, 30 Jun 2022 13:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 073D4C34115; Thu, 30 Jun 2022 13:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596986; bh=fUBXeY/tbiGpHbTy5FVhnNYpcPo4dQ92LT2jXQSqICY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xfuqkklSPG3atPtWtYmbHOWfj3rioHbV0P8XSL7/1TqZEmhyZ1a6PbjbGD93mWoaP nHMJyJ//0c4Wa+X7gbNd4tJpEQA3qcE4G1vFrNwxu+lLqad6jqxhRy9heOFua1WDlm tJQcCybOVLtQMKlxaC0kWGFPgQHET03s+PV+oYlc= 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 4.14 22/35] powerpc: Enable execve syscall exit tracepoint Date: Thu, 30 Jun 2022 15:46:33 +0200 Message-Id: <20220630133233.092536416@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -1613,7 +1613,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 Tue Apr 21 16:01:35 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 A92FDC433EF for ; Thu, 30 Jun 2022 13:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235823AbiF3Nxx (ORCPT ); Thu, 30 Jun 2022 09:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235866AbiF3Nwo (ORCPT ); Thu, 30 Jun 2022 09:52:44 -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 718C7457BD; Thu, 30 Jun 2022 06:49: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 dfw.source.kernel.org (Postfix) with ESMTPS id C068B62009; Thu, 30 Jun 2022 13:49:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA7C2C34115; Thu, 30 Jun 2022 13:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596989; bh=94PS/wZZ8JNT7ubTfHG0d21mTHjU+1fTr8cQX43SgWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/iIUgCtRd/+nilF8NbEKOvB48TNLq3vsLGSjdCaSlDHAPi9yJclnxdy74Jfb4fo3 jpZ4RKsnHi1ZeVNc5o7gIRS7VcTp/SdH3jDyiD7phOpPlBXzUvRxMEoXYDoIxk7wX6 1Zklc3/TSHm32wEANecu8MNOqIET2W/hXVf3o6GQ= 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 4.14 23/35] powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address Date: Thu, 30 Jun 2022 15:46:34 +0200 Message-Id: <20220630133233.120912777@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -1104,7 +1104,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 }, @@ -1151,6 +1151,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 Tue Apr 21 16:01:35 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 C92D3C433EF for ; Thu, 30 Jun 2022 13:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235839AbiF3NyB (ORCPT ); Thu, 30 Jun 2022 09:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235874AbiF3Nwp (ORCPT ); Thu, 30 Jun 2022 09:52: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 16E434D4CD; Thu, 30 Jun 2022 06:49:53 -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 796746200A; Thu, 30 Jun 2022 13:49:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88422C34115; Thu, 30 Jun 2022 13:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596991; bh=2iqwB+Ep/xBJmSAobJOf1hxOvc3lJ9JyccdRzg6H0Eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XmbPUcc2NSih+yxDWndsrHYqQDw+BQIrmsUypFsr+D6+RfhnCCKRlw13jmfaLYJXo se+Jv0vHG3oEwOXkjTayk9Ek5BB2/xXzbyG8Fe739c1Ao0tGkuFnkDp6MB9K+YChFS fODp85pmRPmz2xo4fZYtFwC6GPrt7zIqsH/XkAOU= 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 4.14 24/35] powerpc/powernv: wire up rng during setup_arch Date: Thu, 30 Jun 2022 15:46:35 +0200 Message-Id: <20220630133233.150086082@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -29,4 +29,6 @@ extern void opal_event_shutdown(void); =20 bool cpu_core_split_required(void); =20 +void pnv_rng_init(void); + #endif /* _POWERNV_H */ --- a/arch/powerpc/platforms/powernv/rng.c +++ b/arch/powerpc/platforms/powernv/rng.c @@ -21,6 +21,7 @@ #include #include #include +#include "powernv.h" =20 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul =20 @@ -32,7 +33,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 @@ -170,6 +170,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 Tue Apr 21 16:01:35 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 E1EFEC433EF for ; Thu, 30 Jun 2022 13:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235867AbiF3NyE (ORCPT ); Thu, 30 Jun 2022 09:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235877AbiF3Nwp (ORCPT ); Thu, 30 Jun 2022 09:52: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 AD24B4D4FE; Thu, 30 Jun 2022 06:49: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 4A4746200C; Thu, 30 Jun 2022 13:49:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52419C34115; Thu, 30 Jun 2022 13:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596994; bh=o3tqqsF5eFwjKTHYgfSEao3TrrhqYt7yT8Nw8o9EBlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oxu5VyJtSoMOQhwfvhOIyoeMArtKxZ9keMc/hbLKxl9DGbQeKVWlK9bNVYJOZifun 09cJMVvep0MbMkM2vza19hzW/+YndZpm1ZNM4PIi2Bb52Oda769J5MZALCb+KyzI9i 8HNXKV+/x+VbGFnq5iRXZycUe8U18Lu7jgll7id4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Shawn Guo Subject: [PATCH 4.14 25/35] ARM: dts: imx6qdl: correct PU regulator ramp delay Date: Thu, 30 Jun 2022 15:46:36 +0200 Message-Id: <20220630133233.179789514@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -699,7 +699,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 Tue Apr 21 16:01:35 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 A9886C433EF for ; Thu, 30 Jun 2022 13:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235635AbiF3NyQ (ORCPT ); Thu, 30 Jun 2022 09:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235919AbiF3Nwx (ORCPT ); Thu, 30 Jun 2022 09:52:53 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C196031506; Thu, 30 Jun 2022 06:50:00 -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 sin.source.kernel.org (Postfix) with ESMTPS id 2DB89CE2DD1; Thu, 30 Jun 2022 13:49:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C526C34115; Thu, 30 Jun 2022 13:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596997; bh=ubEP0kYFRH/uBrefTE8f7YvfEDMdThulOwFMVSz2ylw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1gSJnIIusGHBxfIEahkv70a+ImIcx5n/98giFgX/ckek0/izeVE671/iKiVuBYsb n8UkgalFi0NnS9UvfSwXH3AiZgh4l/3qlRQpAW6I6NC2hNE6p31kwyOSDtfTW7EP7O FrhDkAKw43lMIZKJv/4Ba3pBg/OVGzi1vgyuwRZA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski Subject: [PATCH 4.14 26/35] ARM: exynos: Fix refcount leak in exynos_map_pmu Date: Thu, 30 Jun 2022 15:46:37 +0200 Message-Id: <20220630133233.208278314@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -167,6 +167,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 Tue Apr 21 16:01:35 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 29E2EC433EF for ; Thu, 30 Jun 2022 13:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235471AbiF3NyN (ORCPT ); Thu, 30 Jun 2022 09:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbiF3Nwx (ORCPT ); Thu, 30 Jun 2022 09:52:53 -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 8592534664; Thu, 30 Jun 2022 06:50: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 12D3761FD8; Thu, 30 Jun 2022 13:50:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17C33C34115; Thu, 30 Jun 2022 13:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597000; bh=l+0t1T7UVgnnl52KigGaMI+Ya57FIMlUgLltqt/jz/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WaGTonxdISR/BsXGEERGT+72jMbHzphrnNVCi6NXo8nGGUFsPHZ8542BrOKijNopB Q9qVlIBU+0wTnfi+OY0vTUnw6JEVQRV9111uDc538inHyxZ2fytl+9EC57G3ylzuyu BtF++FGnsSskJu84cmQjg/wAuuSULSbNBFpmF9gs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Arnd Bergmann Subject: [PATCH 4.14 27/35] ARM: Fix refcount leak in axxia_boot_secondary Date: Thu, 30 Jun 2022 15:46:38 +0200 Message-Id: <20220630133233.237132772@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -42,6 +42,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 Tue Apr 21 16:01:35 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 08806C433EF for ; Thu, 30 Jun 2022 13:54:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235696AbiF3NyU (ORCPT ); Thu, 30 Jun 2022 09:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235581AbiF3Nwz (ORCPT ); Thu, 30 Jun 2022 09:52:55 -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 0141E344F4; Thu, 30 Jun 2022 06:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id D5A9E62007; Thu, 30 Jun 2022 13:50:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD548C34115; Thu, 30 Jun 2022 13:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597003; bh=SIMiUVob+dd9u0/AVhftthNtqULRglDZgMH8b1w4/Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lFF+vpWhQ8oSgNSd7N6jO4XJFMxf/Gnxj7TQEjfw68YBLydOT5ymr9kWN9YAvl3gj U1DVLQPSX9JTWc6cs9rdxBUMCTO4SBn7pvqZl8Iwc1LvlAMEg67qMRwhwRUMhZ7EQ1 hEYxlK5XaALJeZcYYB89ikFhZvoAqwE/gngA7M5U= 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 4.14 28/35] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Thu, 30 Jun 2022 15:46:39 +0200 Message-Id: <20220630133233.266285647@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- 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 @@ -379,6 +379,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)) { @@ -392,6 +393,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 Tue Apr 21 16:01:35 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 8BDAAC43334 for ; Thu, 30 Jun 2022 13:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235859AbiF3Nyk (ORCPT ); Thu, 30 Jun 2022 09:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235825AbiF3Nxy (ORCPT ); Thu, 30 Jun 2022 09:53:54 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B12D54D4CC; Thu, 30 Jun 2022 06:50:09 -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 sin.source.kernel.org (Postfix) with ESMTPS id BDDEDCE2EC5; Thu, 30 Jun 2022 13:50:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B15E0C3411E; Thu, 30 Jun 2022 13:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597006; bh=1AdeRkjT1D9guRWJn8hKQdm2VdWHMDHQ56vEvC5zzyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRuvWGvtYm1a68vP5MX7Bw0jPX6qUlEd4LvV61KeCQ1PcrazZcPZ6xIAIjr1j2tdL yWmIgPaN8XvfIqsAMeuVDnN1X7xARvv8/QCj7pp4TEezpijq8Yf+Igvi0ti7Shm7B8 g/tv9CRHGYvTzUPPZtW3wOqWw+mkofZIq900pg9M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nick Desaulniers Subject: [PATCH 4.14 29/35] modpost: fix section mismatch check for exported init/exit sections Date: Thu, 30 Jun 2022 15:46:40 +0200 Message-Id: <20220630133233.296570364@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1077,7 +1077,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 Tue Apr 21 16:01:35 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 85B8DC43334 for ; Thu, 30 Jun 2022 13:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235917AbiF3Nyp (ORCPT ); Thu, 30 Jun 2022 09:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235856AbiF3NyD (ORCPT ); Thu, 30 Jun 2022 09:54: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 69CDC4F67B; Thu, 30 Jun 2022 06:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 4AFC66200C; Thu, 30 Jun 2022 13:50:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CF0AC34115; Thu, 30 Jun 2022 13:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597011; bh=5IAul4nVA0v/SXKbKkkc5UM9tUp4vDxfGgP1gt6NQFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uo2IZIsqFYeoezbw2gp5ouisrFfMZaAEH4n3JGBghucdDJaTVcRTF3FyzYaLpOq3b MIIOEltEVvhpSKg7iN39VGBKiFizAuoNv1vNLcMVgEhh6QQjZkrRiZ+AuEXyvEkraX pvCubOTfKm3fxyxIiAtoSY/1J9YlxF43WuD7HQhs= 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 4.14 30/35] powerpc/pseries: wire up rng during setup_arch() Date: Thu, 30 Jun 2022 15:46:41 +0200 Message-Id: <20220630133233.325811539@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/powerpc/platforms/pseries/pseries.h | 2 ++ arch/powerpc/platforms/pseries/rng.c | 11 +++-------- arch/powerpc/platforms/pseries/setup.c | 1 + 3 files changed, 6 insertions(+), 8 deletions(-) --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h @@ -102,4 +102,6 @@ int dlpar_workqueue_init(void); =20 void pseries_setup_rfi_flush(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 @@ -14,6 +14,7 @@ #include #include #include +#include "pseries.h" =20 =20 static int pseries_get_random_long(unsigned long *v) @@ -28,19 +29,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 @@ -594,6 +594,7 @@ static void __init pSeries_setup_arch(vo } =20 ppc_md.pcibios_root_bridge_prepare =3D pseries_root_bridge_prepare; + pseries_rng_init(); } =20 static int __init pSeries_init_panel(void) From nobody Tue Apr 21 16:01:35 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 CDA1DC43334 for ; Thu, 30 Jun 2022 13:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235737AbiF3Nyv (ORCPT ); Thu, 30 Jun 2022 09:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235716AbiF3NyU (ORCPT ); Thu, 30 Jun 2022 09:54:20 -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 58DE752380; Thu, 30 Jun 2022 06:50: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 1ED9461FD8; Thu, 30 Jun 2022 13:50:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29582C34115; Thu, 30 Jun 2022 13:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597014; bh=DuigcMx0DqVCBIG2n4mSaG34J8iwHHjFkHvYhh4Vh9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pNg0vYEIXhaNR/qzJc5VqMRqznETE0SJh8YEKW+WnOhwA1MkbnAOd5ZfMZaph4f09 tJJ1iDNbJnUux8Zu4rv76iCP2Vc3EnfKs5wxm/fgaDQp6eqIk6V36CFx1xo+SwOXUh ydGgRujznGqP14Upo7v4A39+lu6uFovYQU7xpqo4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Christoph Hellwig , Jessica Yu Subject: [PATCH 4.14 31/35] drm: remove drm_fb_helper_modinit Date: Thu, 30 Jun 2022 15:46:42 +0200 Message-Id: <20220630133233.355081013@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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: Christoph Hellwig commit bf22c9ec39da90ce866d5f625d616f28bc733dc1 upstream. drm_fb_helper_modinit has a lot of boilerplate for what is not very simple functionality. Just open code it in the only caller using IS_ENABLED and IS_MODULE, and skip the find_module check as a request_module is harmless if the module is already loaded (and not other caller has this find_module check either). Acked-by: Daniel Vetter Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/gpu/drm/drm_crtc_helper_internal.h | 10 ---------- drivers/gpu/drm/drm_fb_helper.c | 21 --------------------- drivers/gpu/drm/drm_kms_helper_common.c | 23 +++++++++++------------ 3 files changed, 11 insertions(+), 43 deletions(-) --- a/drivers/gpu/drm/drm_crtc_helper_internal.h +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h @@ -32,16 +32,6 @@ #include #include =20 -/* drm_fb_helper.c */ -#ifdef CONFIG_DRM_FBDEV_EMULATION -int drm_fb_helper_modinit(void); -#else -static inline int drm_fb_helper_modinit(void) -{ - return 0; -} -#endif - /* drm_dp_aux_dev.c */ #ifdef CONFIG_DRM_DP_AUX_CHARDEV int drm_dp_aux_dev_init(void); --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2612,24 +2612,3 @@ int drm_fb_helper_hotplug_event(struct d return 0; } EXPORT_SYMBOL(drm_fb_helper_hotplug_event); - -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) - * but the module doesn't depend on any fb console symbols. At least - * attempt to load fbcon to avoid leaving the system without a usable cons= ole. - */ -int __init drm_fb_helper_modinit(void) -{ -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) - const char name[] =3D "fbcon"; - struct module *fbcon; - - mutex_lock(&module_mutex); - fbcon =3D find_module(name); - mutex_unlock(&module_mutex); - - if (!fbcon) - request_module_nowait(name); -#endif - return 0; -} -EXPORT_SYMBOL(drm_fb_helper_modinit); --- a/drivers/gpu/drm/drm_kms_helper_common.c +++ b/drivers/gpu/drm/drm_kms_helper_common.c @@ -35,19 +35,18 @@ MODULE_LICENSE("GPL and additional right =20 static int __init drm_kms_helper_init(void) { - int ret; + /* + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) + * but the module doesn't depend on any fb console symbols. At least + * attempt to load fbcon to avoid leaving the system without a usable + * console. + */ + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && + !IS_ENABLED(CONFIG_EXPERT)) + request_module_nowait("fbcon"); =20 - /* Call init functions from specific kms helpers here */ - ret =3D drm_fb_helper_modinit(); - if (ret < 0) - goto out; - - ret =3D drm_dp_aux_dev_init(); - if (ret < 0) - goto out; - -out: - return ret; + return drm_dp_aux_dev_init(); } =20 static void __exit drm_kms_helper_exit(void) From nobody Tue Apr 21 16:01:35 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 B1C0DC433EF for ; Thu, 30 Jun 2022 13:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235836AbiF3NzB (ORCPT ); Thu, 30 Jun 2022 09:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235807AbiF3Nya (ORCPT ); Thu, 30 Jun 2022 09:54:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B442A58FD2; Thu, 30 Jun 2022 06:50:20 -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 8A074B82AF6; Thu, 30 Jun 2022 13:50:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D983BC34115; Thu, 30 Jun 2022 13:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597017; bh=UqT7Ezn9pWtS5CRV1aEcCh3rXLPAeHPdmaWs4yzft/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KjbSFD5d+cSG1OPl/lXFxF8E+50mi2ExgfvSuWifl9hk/xcL/CefVTY5AX4cRlO3U MCkHjdQV4f6avPbLxafI+WF0tRfY0xYXUnUAOpQvBKiMCOzFDDcESG5Y6eOlW1pMX7 PDgb4bTqj8l6Lvm09lFaq687PKzZX9KcwAiZUQ1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masahiro Yamada , Oleksandr Tyshchenko , Stefano Stabellini , Juergen Gross Subject: [PATCH 4.14 32/35] xen: unexport __init-annotated xen_xlate_map_ballooned_pages() Date: Thu, 30 Jun 2022 15:46:43 +0200 Message-Id: <20220630133233.383327806@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 dbac14a5a05ff8e1ce7c0da0e1f520ce39ec62ea upstream. EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because none of the in-tree call-sites (arch/arm/xen/enlighten.c, arch/x86/xen/grant-table.c) is compiled as modular. Fixes: 243848fc018c ("xen/grant-table: Move xlated_setup_gnttab_pages to co= mmon place") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/20220606045920.4161881-1-masahiroy@kernel.o= rg Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/xen/xlate_mmu.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/xen/xlate_mmu.c +++ b/drivers/xen/xlate_mmu.c @@ -262,4 +262,3 @@ int __init xen_xlate_map_ballooned_pages =20 return 0; } -EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages); From nobody Tue Apr 21 16:01:35 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 0E28BC43334 for ; Thu, 30 Jun 2022 13:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235873AbiF3NzS (ORCPT ); Thu, 30 Jun 2022 09:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235914AbiF3Nyo (ORCPT ); Thu, 30 Jun 2022 09:54:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 121F451B3C; Thu, 30 Jun 2022 06:50: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 223EEB82AEE; Thu, 30 Jun 2022 13:50:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86172C34115; Thu, 30 Jun 2022 13:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597019; bh=LkGjcLM0HH0up5ztvdF1X5AAzcBGFDmqE0jYW4s03Zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1gr3286hnc6MvlfImSDVT44gRCenEYmFAKRgF880cl4EQ+wqBrf0MzumuexXh/2tD zs2l3n/Ugm7j8n+E7CJmRp+SwvImjoDO0a3kfH1kEqSdj4PxdoB+nNXg71ms9US2n9 CCcKurJXczyuzFqgnSxj/iY1Ir6ZQ9d3UJLp1QN8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Hsin-Yi Wang , Will Deacon , Florian Fainelli Subject: [PATCH 4.14 33/35] fdt: Update CRC check for rng-seed Date: Thu, 30 Jun 2022 15:46:44 +0200 Message-Id: <20220630133233.413005017@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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: Hsin-Yi Wang commit dd753d961c4844a39f947be115b3d81e10376ee5 upstream. Commit 428826f5358c ("fdt: add support for rng-seed") moves of_fdt_crc32 from early_init_dt_verify() to early_init_dt_scan() since early_init_dt_scan_chosen() may modify fdt to erase rng-seed. However, arm and some other arch won't call early_init_dt_scan(), they call early_init_dt_verify() then early_init_dt_scan_nodes(). Restore of_fdt_crc32 to early_init_dt_verify() then update it in early_init_dt_scan_chosen() if fdt if updated. Fixes: 428826f5358c ("fdt: add support for rng-seed") Reported-by: Geert Uytterhoeven Signed-off-by: Hsin-Yi Wang Tested-by: Geert Uytterhoeven Signed-off-by: Will Deacon Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/of/fdt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1159,6 +1159,10 @@ int __init early_init_dt_scan_chosen(uns =20 /* try to clear seed so it won't be found. */ fdt_nop_property(initial_boot_params, node, "rng-seed"); + + /* update CRC check value */ + of_fdt_crc32 =3D crc32_be(~0, initial_boot_params, + fdt_totalsize(initial_boot_params)); } =20 /* break now */ @@ -1272,6 +1276,8 @@ bool __init early_init_dt_verify(void *p =20 /* Setup flat device-tree pointer */ initial_boot_params =3D params; + of_fdt_crc32 =3D crc32_be(~0, initial_boot_params, + fdt_totalsize(initial_boot_params)); return true; } =20 @@ -1297,8 +1303,6 @@ bool __init early_init_dt_scan(void *par return false; =20 early_init_dt_scan_nodes(); - of_fdt_crc32 =3D crc32_be(~0, initial_boot_params, - fdt_totalsize(initial_boot_params)); return true; } From nobody Tue Apr 21 16:01:35 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 0275CC433EF for ; Thu, 30 Jun 2022 13:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236007AbiF3N5G (ORCPT ); Thu, 30 Jun 2022 09:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235987AbiF3N4Y (ORCPT ); Thu, 30 Jun 2022 09:56:24 -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 8E58F3B026; Thu, 30 Jun 2022 06:50: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 ams.source.kernel.org (Postfix) with ESMTPS id 642C1B82AEE; Thu, 30 Jun 2022 13:50:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDBBEC34115; Thu, 30 Jun 2022 13:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597045; bh=JGWObjH0AjpoMYTLFfuxVJHH84oeCMnkgyGdD9U098M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AFp7hAZR4WwoLPjZCprXs+4QAVGBBC3Vfdyt8d2ZQNDZwGiOnWpYztXkM1O5dsrWw 5AOyAhSvvrGWS3ZW/7Nyf7QGLDGxYw7ETaTh3gEF2NX0bW/xQ4Mt99D7fGnNt2FxbJ oRjB4S/SwXbxR4b4kb/hfd5z579u/sFnA3WwmKjc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , "Naveen N. Rao" , "Eric W. Biederman" , Andrew Morton Subject: [PATCH 4.14 34/35] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] Date: Thu, 30 Jun 2022 15:46:45 +0200 Message-Id: <20220630133233.443358893@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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 3e35142ef99fe6b4fe5d834ad43ee13cca10a2dc upstream. Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [1], binutils (v2.36+) started dropping section symbols that it thought were unused. This isn't an issue in general, but with kexec_file.c, gcc is placing kexec_arch_apply_relocations[_add] into a separate .text.unlikely section and the section symbol ".text.unlikely" is being dropped. Due to this, recordmcount is unable to find a non-weak symbol in .text.unlikely to generate a relocation record against. Address this by dropping the weak attribute from these functions. Instead, follow the existing pattern of having architectures #define the name of the function they want to override in their headers. [1] https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommit;h=3Dd1bcae8= 33b32f1 [akpm@linux-foundation.org: arch/s390/include/asm/kexec.h needs linux/modul= e.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n.rao@linux.= vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/x86/include/asm/kexec.h | 6 ++++++ include/linux/kexec.h | 26 ++++++++++++++++++++++---- kernel/kexec_file.c | 18 ------------------ 3 files changed, 28 insertions(+), 22 deletions(-) --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h @@ -21,6 +21,7 @@ #ifndef __ASSEMBLY__ =20 #include +#include =20 #include #include @@ -217,6 +218,11 @@ extern int arch_kexec_post_alloc_pages(v extern void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages); #define arch_kexec_pre_free_pages arch_kexec_pre_free_pages =20 +#ifdef CONFIG_KEXEC_FILE +int arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, + Elf_Shdr *sechdrs, unsigned int relsec); +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add +#endif #endif =20 typedef void crash_vmclear_fn(void); --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -163,6 +163,28 @@ int __weak arch_kexec_walk_mem(struct ke int (*func)(u64, u64, void *)); extern int kexec_add_buffer(struct kexec_buf *kbuf); int kexec_locate_mem_hole(struct kexec_buf *kbuf); + +#ifndef arch_kexec_apply_relocations_add +/* Apply relocations of type RELA */ +static inline int +arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, + Elf_Shdr *sechdrs, unsigned int relsec) +{ + pr_err("RELA relocation unsupported.\n"); + return -ENOEXEC; +} +#endif + +#ifndef arch_kexec_apply_relocations +/* Apply relocations of type REL */ +static inline int +arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, + unsigned int relsec) +{ + pr_err("REL relocation unsupported.\n"); + return -ENOEXEC; +} +#endif #endif /* CONFIG_KEXEC_FILE */ =20 struct kimage { @@ -288,10 +310,6 @@ void * __weak arch_kexec_kernel_image_lo int __weak arch_kimage_file_post_load_cleanup(struct kimage *image); int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf, unsigned long buf_len); -int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, - Elf_Shdr *sechdrs, unsigned int relsec); -int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *se= chdrs, - unsigned int relsec); void arch_kexec_protect_crashkres(void); void arch_kexec_unprotect_crashkres(void); =20 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -53,24 +53,6 @@ int __weak arch_kexec_kernel_verify_sig( } #endif =20 -/* Apply relocations of type RELA */ -int __weak -arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, - unsigned int relsec) -{ - pr_err("RELA relocation unsupported.\n"); - return -ENOEXEC; -} - -/* Apply relocations of type REL */ -int __weak -arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, - unsigned int relsec) -{ - pr_err("REL relocation unsupported.\n"); - return -ENOEXEC; -} - /* * Free up memory used by kernel, initrd, and command line. This is tempor= ary * memory allocation which is not needed any more after these buffers have From nobody Tue Apr 21 16:01:35 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 A9A74C43334 for ; Thu, 30 Jun 2022 13:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235721AbiF3N5C (ORCPT ); Thu, 30 Jun 2022 09:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbiF3N4S (ORCPT ); Thu, 30 Jun 2022 09:56:18 -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 2049D3A738; Thu, 30 Jun 2022 06:50:53 -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 D64AF620C8; Thu, 30 Jun 2022 13:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E404DC34115; Thu, 30 Jun 2022 13:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597042; bh=h2JDpZP4+w1S5GsPmV9MTCOP0Fo5GPWS2uYAPZKXtpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0nqK8F2MvJ44QC0rj7aU2nPUi5bgNpq5GVY7TpdNNobx161FvsBDQhqv6haafjwhA jAsiNMwINFlYyac0M5K0nuPtvKmgFQ3UIAmOxMnORBom/hbhuj6vqq56BA3c6ujBcc VaOEY7lx79ws4azGuChyKfM/+Sw2flKcZIcsBSwU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Shixin Subject: [PATCH 4.14 35/35] swiotlb: skip swiotlb_bounce when orig_addr is zero Date: Thu, 30 Jun 2022 15:46:46 +0200 Message-Id: <20220630133233.472267211@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.433955678@linuxfoundation.org> References: <20220630133232.433955678@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: Liu Shixin After patch ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE"), swiotlb_bounce will be called in swiotlb_tbl_map_single unconditionally. This requires that the physical address must be valid, which is not always true on stable-4.19 or earlier version. On stable-4.19, swiotlb_alloc_buffer will call swiotlb_tbl_map_single with orig_addr equal to zero, which cause such a panic: Unable to handle kernel paging request at virtual address ffffb77a40000000 ... pc : __memcpy+0x100/0x180 lr : swiotlb_bounce+0x74/0x88 ... Call trace: __memcpy+0x100/0x180 swiotlb_tbl_map_single+0x2c8/0x338 swiotlb_alloc+0xb4/0x198 __dma_alloc+0x84/0x1d8 ... On stable-4.9 and stable-4.14, swiotlb_alloc_coherent wille call map_single with orig_addr equal to zero, which can cause same panic. Fix this by skipping swiotlb_bounce when orig_addr is zero. Fixes: ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE") Signed-off-by: Liu Shixin Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- lib/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -607,7 +607,8 @@ found: * unconditional bounce may prevent leaking swiotlb content (i.e. * kernel memory) to user-space. */ - swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE); + if (orig_addr) + swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE); return tlb_addr; } EXPORT_SYMBOL_GPL(swiotlb_tbl_map_single);