From nobody Thu Apr 9 10:38:16 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 0EAECECAAD8 for ; Fri, 16 Sep 2022 10:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231134AbiIPKLb (ORCPT ); Fri, 16 Sep 2022 06:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbiIPKKe (ORCPT ); Fri, 16 Sep 2022 06:10:34 -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 27CEEAC265; Fri, 16 Sep 2022 03:09:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 332A7629FD; Fri, 16 Sep 2022 10:09:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3472EC433D6; Fri, 16 Sep 2022 10:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322940; bh=SX8ctfDoXZyy93CaTDmVcLfuc2fkCYRrEUR7A5GxBqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y58p6FPVFedZ8DM3+5xu0Ci5GmOTz7TmgdMzCLHT85ys1ydtm+p4ht0Nf6lZsXxcm +SNjl7eknXeuxCjdAcX3AMvefMc043ROtro0T2X2EfXfpkBJB3GkKFDXcc//CwZiPN 5ZRr5Yqp2rFakeycDYeHuo42JNxLRNGVxjl8vq1s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Sasha Levin Subject: [PATCH 5.4 01/14] drm/msm/rd: Fix FIFO-full deadlock Date: Fri, 16 Sep 2022 12:08:08 +0200 Message-Id: <20220916100443.200072026@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Rob Clark [ Upstream commit 174974d8463b77c2b4065e98513adb204e64de7d ] If the previous thing cat'ing $debugfs/rd left the FIFO full, then subsequent open could deadlock in rd_write() (because open is blocked, not giving a chance for read() to consume any data in the FIFO). Also it is generally a good idea to clear out old data from the FIFO. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/496706/ Link: https://lore.kernel.org/r/20220807160901.2353471-2-robdclark@gmail.com Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/gpu/drm/msm/msm_rd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index c7832a951039f..a6b024b06b363 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -191,6 +191,9 @@ static int rd_open(struct inode *inode, struct file *fi= le) file->private_data =3D rd; rd->open =3D true; =20 + /* Reset fifo to clear any previously unread data: */ + rd->fifo.head =3D rd->fifo.tail =3D 0; + /* the parsing tools need to know gpu-id to know which * register database to load. */ --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 A0CB9C54EE9 for ; Fri, 16 Sep 2022 10:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231197AbiIPKM2 (ORCPT ); Fri, 16 Sep 2022 06:12:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbiIPKLz (ORCPT ); Fri, 16 Sep 2022 06:11: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 59CD11AD; Fri, 16 Sep 2022 03:09: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 5B54B62A0A; Fri, 16 Sep 2022 10:09:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65D42C433D6; Fri, 16 Sep 2022 10:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322964; bh=5W1NvthT7Gk6j/4+GOkbynLdXPLwKUVSKJmdvZ0KROw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nbr4feJQAX7eGO4Wq8bvmNKhq1T7IE8gssNKsYxMZTzCDcOZj9jrhxIhPc68tO3kP 5m7HHup9Sgc4cEPeRFZ5TRF32258ucyaE0shCX/V1cnvdDYrVXSyfMqJYwQNPVHHGA Ej+Lub+GPJb6DxmDruzqGD0p55aFyf9FLE7yzpcw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Wang , Jiri Kosina , Sasha Levin Subject: [PATCH 5.4 02/14] HID: ishtp-hid-clientHID: ishtp-hid-client: Fix comment typo Date: Fri, 16 Sep 2022 12:08:09 +0200 Message-Id: <20220916100443.252923503@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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 Wang [ Upstream commit 94553f8a218540d676efbf3f7827ed493d1057cf ] The double `like' is duplicated in the comment, remove one. Signed-off-by: Jason Wang Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/hid/intel-ish-hid/ishtp-hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.h b/drivers/hid/intel-ish-= hid/ishtp-hid.h index 5ffd0da3cf1fa..65af0ebef79f6 100644 --- a/drivers/hid/intel-ish-hid/ishtp-hid.h +++ b/drivers/hid/intel-ish-hid/ishtp-hid.h @@ -110,7 +110,7 @@ struct report_list { * @multi_packet_cnt: Count of fragmented packet count * * This structure is used to store completion flags and per client data li= ke - * like report description, number of HID devices etc. + * report description, number of HID devices etc. */ struct ishtp_cl_data { /* completion flags */ --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 2991DC6FA8B for ; Fri, 16 Sep 2022 10:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230506AbiIPKMX (ORCPT ); Fri, 16 Sep 2022 06:12:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbiIPKLy (ORCPT ); Fri, 16 Sep 2022 06:11:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5880126C1; Fri, 16 Sep 2022 03:09:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F2F2EB82503; Fri, 16 Sep 2022 10:09:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EE63C433C1; Fri, 16 Sep 2022 10:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322967; bh=bc2OW2J+0cXow/XWPZkMpI2LiaUOa6IBtOe2gC9WYqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SIeDwg0qQ92vOQ88zl2XrrlgKpGmuKT62WIo0R6Naq1taMl2afWcdhVweF7dKrD6L NuoerkIJOVChLzEm1HnM30FIENcUxDTrLCzzYg1uaNGPaPeKEYQTPnKcZrr7wTgo5u WRBRgffefZetA9g4COQgLcCrxKsMnWL+wE/bBbd0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Even Xu , Srinivas Pandruvada , Jiri Kosina , Sasha Levin Subject: [PATCH 5.4 03/14] hid: intel-ish-hid: ishtp: Fix ishtp client sending disordered message Date: Fri, 16 Sep 2022 12:08:10 +0200 Message-Id: <20220916100443.298475397@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Even Xu [ Upstream commit e1fa076706209cc447d7a2abd0843a18277e5ef7 ] There is a timing issue captured during ishtp client sending stress tests. It was observed during stress tests that ISH firmware is getting out of ordered messages. This is a rare scenario as the current set of ISH client drivers don't send much data to firmware. But this may not be the case going forward. When message size is bigger than IPC MTU, ishtp splits the message into fragments and uses serialized async method to send message fragments. The call stack: ishtp_cl_send_msg_ipc->ipc_tx_callback(first fregment)-> ishtp_send_msg(with callback)->write_ipc_to_queue-> write_ipc_from_queue->callback->ipc_tx_callback(next fregment)...... When an ipc write complete interrupt is received, driver also calls write_ipc_from_queue->ipc_tx_callback in ISR to start sending of next fragm= ent. Through ipc_tx_callback uses spin_lock to protect message splitting, as the serialized sending method will call back to ipc_tx_callback again, so it do= esn't put sending under spin_lock, it causes driver cannot guarantee all fragments be sent in order. Considering this scenario: ipc_tx_callback just finished a fragment splitting, and not call ishtp_send= _msg yet, there is a write complete interrupt happens, then ISR->write_ipc_from_= queue ->ipc_tx_callback->ishtp_send_msg->write_ipc_to_queue...... Because ISR has higher exec priority than normal thread, this causes the new fragment be sent out before previous fragment. This disordered message caus= es invalid message to firmware. The solution is, to send fragments synchronously: Use ishtp_write_message writing fragments into tx queue directly one by one, instead of ishtp_send_msg only writing one fragment with completion callbac= k. As no completion callback be used, so change ipc_tx_callback to ipc_tx_send. Signed-off-by: Even Xu Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/hid/intel-ish-hid/ishtp/client.c | 68 ++++++++++++++---------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ishtp/client.c b/drivers/hid/intel-i= sh-hid/ishtp/client.c index 1cc157126fce7..c0d69303e3b09 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client.c +++ b/drivers/hid/intel-ish-hid/ishtp/client.c @@ -626,13 +626,14 @@ static void ishtp_cl_read_complete(struct ishtp_cl_rb= *rb) } =20 /** - * ipc_tx_callback() - IPC tx callback function + * ipc_tx_send() - IPC tx send function * @prm: Pointer to client device instance * - * Send message over IPC either first time or on callback on previous mess= age - * completion + * Send message over IPC. Message will be split into fragments + * if message size is bigger than IPC FIFO size, and all + * fragments will be sent one by one. */ -static void ipc_tx_callback(void *prm) +static void ipc_tx_send(void *prm) { struct ishtp_cl *cl =3D prm; struct ishtp_cl_tx_ring *cl_msg; @@ -677,32 +678,41 @@ static void ipc_tx_callback(void *prm) list); rem =3D cl_msg->send_buf.size - cl->tx_offs; =20 - ishtp_hdr.host_addr =3D cl->host_client_id; - ishtp_hdr.fw_addr =3D cl->fw_client_id; - ishtp_hdr.reserved =3D 0; - pmsg =3D cl_msg->send_buf.data + cl->tx_offs; + while (rem > 0) { + ishtp_hdr.host_addr =3D cl->host_client_id; + ishtp_hdr.fw_addr =3D cl->fw_client_id; + ishtp_hdr.reserved =3D 0; + pmsg =3D cl_msg->send_buf.data + cl->tx_offs; + + if (rem <=3D dev->mtu) { + /* Last fragment or only one packet */ + ishtp_hdr.length =3D rem; + ishtp_hdr.msg_complete =3D 1; + /* Submit to IPC queue with no callback */ + ishtp_write_message(dev, &ishtp_hdr, pmsg); + cl->tx_offs =3D 0; + cl->sending =3D 0; =20 - if (rem <=3D dev->mtu) { - ishtp_hdr.length =3D rem; - ishtp_hdr.msg_complete =3D 1; - cl->sending =3D 0; - list_del_init(&cl_msg->list); /* Must be before write */ - spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags); - /* Submit to IPC queue with no callback */ - ishtp_write_message(dev, &ishtp_hdr, pmsg); - spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags); - list_add_tail(&cl_msg->list, &cl->tx_free_list.list); - ++cl->tx_ring_free_size; - spin_unlock_irqrestore(&cl->tx_free_list_spinlock, - tx_free_flags); - } else { - /* Send IPC fragment */ - spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags); - cl->tx_offs +=3D dev->mtu; - ishtp_hdr.length =3D dev->mtu; - ishtp_hdr.msg_complete =3D 0; - ishtp_send_msg(dev, &ishtp_hdr, pmsg, ipc_tx_callback, cl); + break; + } else { + /* Send ipc fragment */ + ishtp_hdr.length =3D dev->mtu; + ishtp_hdr.msg_complete =3D 0; + /* All fregments submitted to IPC queue with no callback */ + ishtp_write_message(dev, &ishtp_hdr, pmsg); + cl->tx_offs +=3D dev->mtu; + rem =3D cl_msg->send_buf.size - cl->tx_offs; + } } + + list_del_init(&cl_msg->list); + spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags); + + spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags); + list_add_tail(&cl_msg->list, &cl->tx_free_list.list); + ++cl->tx_ring_free_size; + spin_unlock_irqrestore(&cl->tx_free_list_spinlock, + tx_free_flags); } =20 /** @@ -720,7 +730,7 @@ static void ishtp_cl_send_msg_ipc(struct ishtp_device *= dev, return; =20 cl->tx_offs =3D 0; - ipc_tx_callback(cl); + ipc_tx_send(cl); ++cl->send_msg_cnt_ipc; } =20 --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 CC328ECAAD8 for ; Fri, 16 Sep 2022 10:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbiIPKMd (ORCPT ); Fri, 16 Sep 2022 06:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbiIPKL5 (ORCPT ); Fri, 16 Sep 2022 06:11:57 -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 39EA12BD3; Fri, 16 Sep 2022 03:09:33 -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 BCFB2B8250D; Fri, 16 Sep 2022 10:09:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17067C433C1; Fri, 16 Sep 2022 10:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322970; bh=iw5VxxdpmG4eV6+L/tprOv7+8QHc3taUs95F7OTGuWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yo297a0rQ7ObHaLQPLr2EBPf+Hb2GsM7ksi2Vw0ptQheEMOYs7xvkbpsClt0K6Vd3 4nKwUVIR1d1htwrjBKkErxKOH5HOEd5TMqKNqYSDV0VvCeiWSRkQzbkLBg5gRBl6nD J7/L1GZPN+zuRoDj2z5g2UvDZj56RjjJcUK0T/6c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , Kai-Heng Feng , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 04/14] tg3: Disable tg3 device on system reboot to avoid triggering AER Date: Fri, 16 Sep 2022 12:08:11 +0200 Message-Id: <20220916100443.340992431@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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 2ca1c94ce0b65a2ce7512b718f3d8a0fe6224bca ] Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused a reboot hang on one Dell servers so the commit was reverted. Someone managed to collect the AER log and it's caused by MSI: [ 148.762067] ACPI: Preparing to enter system sleep state S5 [ 148.794638] {1}[Hardware Error]: Hardware error from APEI Generic Hardwar= e Error Source: 5 [ 148.803731] {1}[Hardware Error]: event severity: recoverable [ 148.810191] {1}[Hardware Error]: Error 0, type: fatal [ 148.816088] {1}[Hardware Error]: section_type: PCIe error [ 148.822391] {1}[Hardware Error]: port_type: 0, PCIe end point [ 148.829026] {1}[Hardware Error]: version: 3.0 [ 148.834266] {1}[Hardware Error]: command: 0x0006, status: 0x0010 [ 148.841140] {1}[Hardware Error]: device_id: 0000:04:00.0 [ 148.847309] {1}[Hardware Error]: slot: 0 [ 148.852077] {1}[Hardware Error]: secondary_bus: 0x00 [ 148.857876] {1}[Hardware Error]: vendor_id: 0x14e4, device_id: 0x165f [ 148.865145] {1}[Hardware Error]: class_code: 020000 [ 148.870845] {1}[Hardware Error]: aer_uncor_status: 0x00100000, aer_uncor_= mask: 0x00010000 [ 148.879842] {1}[Hardware Error]: aer_uncor_severity: 0x000ef030 [ 148.886575] {1}[Hardware Error]: TLP Header: 40000001 0000030f 90028090 0= 0000000 [ 148.894823] tg3 0000:04:00.0: AER: aer_status: 0x00100000, aer_mask: 0x00= 010000 [ 148.902795] tg3 0000:04:00.0: AER: [20] UnsupReq (First) [ 148.910234] tg3 0000:04:00.0: AER: aer_layer=3DTransaction Layer, aer_age= nt=3DRequester ID [ 148.918806] tg3 0000:04:00.0: AER: aer_uncor_severity: 0x000ef030 [ 148.925558] tg3 0000:04:00.0: AER: TLP Header: 40000001 0000030f 90028090= 00000000 The MSI is probably raised by incoming packets, so power down the device and disable bus mastering to stop the traffic, as user confirmed this approach works. In addition to that, be extra safe and cancel reset task if it's running. Cc: Josef Bacik Link: https://lore.kernel.org/all/b8db79e6857c41dab4ef08bdf826ea7c47e3bafc.= 1615947283.git.josef@toxicpanda.com/ BugLink: https://bugs.launchpad.net/bugs/1917471 Signed-off-by: Kai-Heng Feng Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220826002530.1153296-1-kai.heng.feng@cano= nical.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/net/ethernet/broadcom/tg3.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/bro= adcom/tg3.c index 70bd79dc43f2e..a9962474d551d 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -18154,16 +18154,20 @@ static void tg3_shutdown(struct pci_dev *pdev) struct net_device *dev =3D pci_get_drvdata(pdev); struct tg3 *tp =3D netdev_priv(dev); =20 + tg3_reset_task_cancel(tp); + rtnl_lock(); + netif_device_detach(dev); =20 if (netif_running(dev)) dev_close(dev); =20 - if (system_state =3D=3D SYSTEM_POWER_OFF) - tg3_power_down(tp); + tg3_power_down(tp); =20 rtnl_unlock(); + + pci_disable_device(pdev); } =20 /** --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 B75D2C6FA8B for ; Fri, 16 Sep 2022 10:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbiIPKMh (ORCPT ); Fri, 16 Sep 2022 06:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbiIPKMC (ORCPT ); Fri, 16 Sep 2022 06:12:02 -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 7C4B96311; Fri, 16 Sep 2022 03:09: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 E329EB8250A; Fri, 16 Sep 2022 10:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36B18C433C1; Fri, 16 Sep 2022 10:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322973; bh=6bVcFPgX1KF7WqxaGjbnW0BFwjnl06bEq3caxDd2nXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ax81Oglxt5xrrUlru7nhWyKIKOpy3gmXo50G9hZ4tUcAAF7Acc7u4ulrkgcTQrBJ0 GliUvoUGPuib1Ptay0YyION8ixge85PpSva9XGRbEDFisiwyUUus8dnd1tEfwNPqO/ ySIAJwNgX+IuemHe4phfEwrzPy+uE86QvzSe2UUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Qiong , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.4 05/14] ieee802154: cc2520: add rc code in cc2520_tx() Date: Fri, 16 Sep 2022 12:08:12 +0200 Message-Id: <20220916100443.391653883@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Li Qiong [ Upstream commit ffd7bdddaab193c38416fd5dd416d065517d266e ] The rc code is 0 at the error path "status & CC2520_STATUS_TX_UNDERFLOW". Assign rc code with '-EINVAL' at this error path to fix it. Signed-off-by: Li Qiong Link: https://lore.kernel.org/r/20220829071259.18330-1-liqiong@nfschina.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/net/ieee802154/cc2520.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc252= 0.c index 43506948e444d..0432a4f829a98 100644 --- a/drivers/net/ieee802154/cc2520.c +++ b/drivers/net/ieee802154/cc2520.c @@ -507,6 +507,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb) goto err_tx; =20 if (status & CC2520_STATUS_TX_UNDERFLOW) { + rc =3D -EINVAL; dev_err(&priv->spi->dev, "cc2520 tx underflow exception\n"); goto err_tx; } --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 EE4B2C54EE9 for ; Fri, 16 Sep 2022 10:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbiIPKMl (ORCPT ); Fri, 16 Sep 2022 06:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbiIPKMH (ORCPT ); Fri, 16 Sep 2022 06:12:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C42B8DFAD; Fri, 16 Sep 2022 03:09: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 062C1629E2; Fri, 16 Sep 2022 10:09:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C5B0C433C1; Fri, 16 Sep 2022 10:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322976; bh=de0UWzH2KUXwSSVq/hNoyyVgaNRZRqOmYE7O8y8s+Gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ch3sq9aJzdkphSh/PATcXnWC9+hprqAcqv9DiH4cMf0LZItIrFNnXBxVqXgHCsB9K nqywvOWO+IMAVMS9W+QjOyDE09FA6FsISJT0KdXjV4sWrTWTDYs2mFpAMfPwlZPaHY khhYkLBOU6SxJzpsSWO7PRt4mbZyLQvg94TQ3UVk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg Tulli , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.4 06/14] Input: iforce - add support for Boeder Force Feedback Wheel Date: Fri, 16 Sep 2022 12:08:13 +0200 Message-Id: <20220916100443.440363368@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Greg Tulli [ Upstream commit 9c9c71168f7979f3798b61c65b4530fbfbcf19d1 ] Add a new iforce_device entry to support the Boeder Force Feedback Wheel device. Signed-off-by: Greg Tulli Link: https://lore.kernel.org/r/3256420-c8ac-31b-8499-3c488a9880fd@gmail.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- Documentation/input/joydev/joystick.rst | 1 + drivers/input/joystick/iforce/iforce-main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Documentation/input/joydev/joystick.rst b/Documentation/input/= joydev/joystick.rst index 9746fd76cc581..f38c330c028e5 100644 --- a/Documentation/input/joydev/joystick.rst +++ b/Documentation/input/joydev/joystick.rst @@ -517,6 +517,7 @@ All I-Force devices are supported by the iforce module.= This includes: * AVB Mag Turbo Force * AVB Top Shot Pegasus * AVB Top Shot Force Feedback Racing Wheel +* Boeder Force Feedback Wheel * Logitech WingMan Force * Logitech WingMan Force Wheel * Guillemot Race Leader Force Feedback diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/jo= ystick/iforce/iforce-main.c index b2a68bc9f0b4d..b86de1312512b 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c @@ -50,6 +50,7 @@ static struct iforce_device iforce_device[] =3D { { 0x046d, 0xc291, "Logitech WingMan Formula Force", btn_wheel, abs_wheel= , ff_iforce }, { 0x05ef, 0x020a, "AVB Top Shot Pegasus", btn_joystick_avb, abs_avb_peg= asus, ff_iforce }, { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_wheel, abs_wheel, ff_iforc= e }, + { 0x05ef, 0x8886, "Boeder Force Feedback Wheel", btn_wheel, abs_wheel, f= f_iforce }, { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_wheel, = abs_wheel, ff_iforce }, //? { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel= , abs_wheel, ff_iforce }, //? { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce= }, --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 A8838ECAAD8 for ; Fri, 16 Sep 2022 10:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbiIPKNA (ORCPT ); Fri, 16 Sep 2022 06:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbiIPKMK (ORCPT ); Fri, 16 Sep 2022 06:12:10 -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 339AE1581D; Fri, 16 Sep 2022 03:09:42 -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 D4BF4B8250A; Fri, 16 Sep 2022 10:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DCE2C43470; Fri, 16 Sep 2022 10:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322979; bh=GCShRCnTLQE4vixCcjzwPmhD/eX4kUQGFemHCnjlSIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snWwY+QJIAWpqstDaAZY9bKgL/iafrDdvHF5+FefaSPDWvvdARGyc+EwJ8hgVlJSt 7uR9ZdBpxI1j2NIZ3CTspjRCyI0ZLh/wTxvTSvOFgK4i6gG5EBDjR4n02XOG0LR/TZ Yt+1lTTs93RjafCffz36/srlWo8Q0BNSwq/f6chM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maurizio Lombardi , Sagi Grimberg , Chaitanya Kulkarni , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.4 07/14] nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change() Date: Fri, 16 Sep 2022 12:08:14 +0200 Message-Id: <20220916100443.491099436@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Maurizio Lombardi [ Upstream commit 478814a5584197fa1fb18377653626e3416e7cd6 ] TCP_FIN_WAIT2 and TCP_LAST_ACK were not handled, the connection is closing so we can ignore them and avoid printing the "unhandled state" warning message. [ 1298.852386] nvmet_tcp: queue 2 unhandled state 5 [ 1298.879112] nvmet_tcp: queue 7 unhandled state 5 [ 1298.884253] nvmet_tcp: queue 8 unhandled state 5 [ 1298.889475] nvmet_tcp: queue 9 unhandled state 5 v2: Do not call nvmet_tcp_schedule_release_queue(), just ignore the fin_wait2 and last_ack states. Signed-off-by: Maurizio Lombardi Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/nvme/target/tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index e9512d077b8a8..eb5b39c2bba84 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1416,6 +1416,9 @@ static void nvmet_tcp_state_change(struct sock *sk) goto done; =20 switch (sk->sk_state) { + case TCP_FIN_WAIT2: + case TCP_LAST_ACK: + break; case TCP_FIN_WAIT1: case TCP_CLOSE_WAIT: case TCP_CLOSE: --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 F3750C54EE9 for ; Fri, 16 Sep 2022 10:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230362AbiIPKNF (ORCPT ); Fri, 16 Sep 2022 06:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbiIPKMR (ORCPT ); Fri, 16 Sep 2022 06:12:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8816C1A049; Fri, 16 Sep 2022 03:09:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0BFAB82521; Fri, 16 Sep 2022 10:09:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 492E5C433C1; Fri, 16 Sep 2022 10:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322982; bh=oPZrZTAQIjQDJjJfYGVmJfuEiAnbcNj8vaUKQPAYhHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jkf5Ez0l0txV1mZhTYdJfoOnqFl7jMwxC2L7SGDifBqW/e/ukodG1/XnFF59z2nbb GDjDuiC2QtMph4AXW+5u01p59Ia4fNUZz8IulG00fIL6fEW51j/Ak8sIQ+MppmkeDC biGTznEktEurNCgDpt2C4/BHt9Xfu8sdZd8mQjv8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Zhe , Will Deacon , Sasha Levin Subject: [PATCH 5.4 08/14] perf/arm_pmu_platform: fix tests for platform_get_irq() failure Date: Fri, 16 Sep 2022 12:08:15 +0200 Message-Id: <20220916100443.542088404@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Yu Zhe [ Upstream commit 6bb0d64c100091e131cd16710b62fda3319cd0af ] The platform_get_irq() returns negative error codes. It can't actually return zero. Signed-off-by: Yu Zhe Link: https://lore.kernel.org/r/20220825011844.8536-1-yuzhe@nfschina.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platfor= m.c index e35cb76c8d104..6eb077db7384d 100644 --- a/drivers/perf/arm_pmu_platform.c +++ b/drivers/perf/arm_pmu_platform.c @@ -118,7 +118,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu) =20 if (num_irqs =3D=3D 1) { int irq =3D platform_get_irq(pdev, 0); - if (irq && irq_is_percpu_devid(irq)) + if ((irq > 0) && irq_is_percpu_devid(irq)) return pmu_parse_percpu_irq(pmu, irq); } =20 --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 27C3DECAAD8 for ; Fri, 16 Sep 2022 10:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231430AbiIPKNK (ORCPT ); Fri, 16 Sep 2022 06:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiIPKMS (ORCPT ); Fri, 16 Sep 2022 06:12:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AF313DEF; Fri, 16 Sep 2022 03:09: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 71841629DB; Fri, 16 Sep 2022 10:09:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62B7FC433D6; Fri, 16 Sep 2022 10:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322985; bh=YOjem7ah/rTmlWHmKgWcThkUr+SkoQdAtlYFJNDYvJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4JH8Y54h424mYTt7iJzsRFQR3uJr/0EaXuMJU8MvFffKfn+X4iXAJuQO9l7o44/w byivPEqqce2se07d5MyzTvVC8MTnXfEjiAGwPwQ9cn7rz00AXz5AVvaNvxZVCwK99W MGGGW84K9HQy/l07ALosSX8Nsl8jiHla9pCTa6F4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Sasha Levin Subject: [PATCH 5.4 09/14] platform/x86: acer-wmi: Acer Aspire One AOD270/Packard Bell Dot keymap fixes Date: Fri, 16 Sep 2022 12:08:16 +0200 Message-Id: <20220916100443.583059864@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Hans de Goede [ Upstream commit c3b82d26bc85f5fc2fef5ec8cce17c89633a55a8 ] 2 keymap fixes for the Acer Aspire One AOD270 and the same hardware rebranded as Packard Bell Dot SC: 1. The F2 key is marked with a big '?' symbol on the Packard Bell Dot SC, this sends WMID_HOTKEY_EVENTs with a scancode of 0x27 add a mapping for this. 2. Scancode 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event with the "Video Bus" input device events. But on these devices the "Video Bus" does not send events for this key. Map 0x61 to KEY_UNKNOWN instead of using KE_IGNORE so that udev/hwdb can override it on these devs. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220829163544.5288-1-hdegoede@redhat.com Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/platform/x86/acer-wmi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wm= i.c index d27a564389a47..e88bd54ff8bd6 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -93,6 +93,7 @@ static const struct key_entry acer_wmi_keymap[] __initcon= st =3D { {KE_KEY, 0x22, {KEY_PROG2} }, /* Arcade */ {KE_KEY, 0x23, {KEY_PROG3} }, /* P_Key */ {KE_KEY, 0x24, {KEY_PROG4} }, /* Social networking_Key */ + {KE_KEY, 0x27, {KEY_HELP} }, {KE_KEY, 0x29, {KEY_PROG3} }, /* P_Key for TM8372 */ {KE_IGNORE, 0x41, {KEY_MUTE} }, {KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} }, @@ -106,7 +107,13 @@ static const struct key_entry acer_wmi_keymap[] __init= const =3D { {KE_IGNORE, 0x48, {KEY_VOLUMEUP} }, {KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} }, {KE_IGNORE, 0x4a, {KEY_VOLUMEDOWN} }, - {KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} }, + /* + * 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event + * with the "Video Bus" input device events. But sometimes it is not + * a dup. Map it to KEY_UNKNOWN instead of using KE_IGNORE so that + * udev/hwdb can override it on systems where it is not a dup. + */ + {KE_KEY, 0x61, {KEY_UNKNOWN} }, {KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} }, {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} }, {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 A35A6C6FA90 for ; Fri, 16 Sep 2022 10:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbiIPKOO (ORCPT ); Fri, 16 Sep 2022 06:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbiIPKNA (ORCPT ); Fri, 16 Sep 2022 06:13:00 -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 107BBA9269; Fri, 16 Sep 2022 03:10:10 -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 491D962A05; Fri, 16 Sep 2022 10:10:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36912C433D6; Fri, 16 Sep 2022 10:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663323003; bh=iPJdzqZkaPbbW0M+Sk9HKES9lv2O1Zy8J6UuE8E/eg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V9d9soQKZ4DOJYjuRUY1mspdtkICrJ5lE4tMT0Mu9+0kfSc100Cg16a/3IB/RXlik ViVpQ3B95uNO5mAVUxSunE7jzoJerly8KXuY7dQ7PR/qK92oSod+lQVhM6XoTAPuWf w9SQK/4sxSfD9GsKVQgNQJXJBRDQ65s4PCmjB1w0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Alan Stern , Hu Xiaoying , Sasha Levin Subject: [PATCH 5.4 10/14] usb: storage: Add ASUS <0x0b05:0x1932> to IGNORE_UAS Date: Fri, 16 Sep 2022 12:08:17 +0200 Message-Id: <20220916100443.629596221@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Hu Xiaoying [ Upstream commit c61feaee68b9735be06f162bc046c7f1959efb0c ] USB external storage device(0x0b05:1932), use gnome-disk-utility tools to test usb write < 30MB/s. if does not to load module of uas for this device, can increase the write speed from 20MB/s to >40MB/s. Suggested-by: Matthias Kaehlcke Acked-by: Alan Stern Signed-off-by: Hu Xiaoying Link: https://lore.kernel.org/r/20220901045737.3438046-1-huxiaoying@kylinos= .cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/usb/storage/unusual_uas.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusua= l_uas.h index 2f72753c3e225..0b37c8e550e7d 100644 --- a/drivers/usb/storage/unusual_uas.h +++ b/drivers/usb/storage/unusual_uas.h @@ -62,6 +62,13 @@ UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_IGNORE_UAS), =20 +/* Reported-by: Tom Hu */ +UNUSUAL_DEV(0x0b05, 0x1932, 0x0000, 0x9999, + "ASUS", + "External HDD", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_IGNORE_UAS), + /* Reported-by: David Webb */ UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, "Seagate", --=20 2.35.1 From nobody Thu Apr 9 10:38:16 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 CB450C54EE9 for ; Fri, 16 Sep 2022 10:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231442AbiIPKNT (ORCPT ); Fri, 16 Sep 2022 06:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiIPKMW (ORCPT ); Fri, 16 Sep 2022 06:12:22 -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 39BB82EF35; Fri, 16 Sep 2022 03:09: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 5F58A629E7; Fri, 16 Sep 2022 10:09:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B101C433D7; Fri, 16 Sep 2022 10:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322991; bh=uWJM0brIsoL6qeR/qf8zSfHE35LumEcj4LcdZJCYzWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yNS8mxBa6TCGj7xWGY58U38uqCK/+1Q996BuBo/N1wO+2kUPxeSqjHLYalexJWQnG piO5vaqCJcJ5XqWLGmJqjiFsk72fGynI1XQovJtWMlCU716QbXIwBMme4StHx3e7T+ mMWNmTjmBXG2bMU9vAXmW7lXYS8d9hkqaR6oW4eQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn Subject: [PATCH 5.4 11/14] mm: Fix TLB flush for not-first PFNMAP mappings in unmap_region() Date: Fri, 16 Sep 2022 12:08:18 +0200 Message-Id: <20220916100443.678644319@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Jann Horn This is a stable-specific patch. I botched the stable-specific rewrite of commit b67fbebd4cf98 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas"): As Hugh pointed out, unmap_region() actually operates on a list of VMAs, and the variable "vma" merely points to the first VMA in that list. So if we want to check whether any of the VMAs we're operating on is PFNMAP or MIXEDMAP, we have to iterate through the list and check each VMA. Signed-off-by: Jann Horn Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- mm/mmap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2605,6 +2605,7 @@ static void unmap_region(struct mm_struc { struct vm_area_struct *next =3D prev ? prev->vm_next : mm->mmap; struct mmu_gather tlb; + struct vm_area_struct *cur_vma; =20 lru_add_drain(); tlb_gather_mmu(&tlb, mm, start, end); @@ -2619,8 +2620,12 @@ static void unmap_region(struct mm_struc * concurrent flush in this region has to be coming through the rmap, * and we synchronize against that using the rmap lock. */ - if ((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) !=3D 0) - tlb_flush_mmu(&tlb); + for (cur_vma =3D vma; cur_vma; cur_vma =3D cur_vma->vm_next) { + if ((cur_vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) !=3D 0) { + tlb_flush_mmu(&tlb); + break; + } + } =20 free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS, next ? next->vm_start : USER_PGTABLES_CEILING); From nobody Thu Apr 9 10:38:16 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 C3692ECAAD8 for ; Fri, 16 Sep 2022 10:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231473AbiIPKNi (ORCPT ); Fri, 16 Sep 2022 06:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbiIPKMg (ORCPT ); Fri, 16 Sep 2022 06:12:36 -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 7D048A9275; Fri, 16 Sep 2022 03:09:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 033D5B8250A; Fri, 16 Sep 2022 10:09:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40B15C433D6; Fri, 16 Sep 2022 10:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322994; bh=DQWIx9XyANCRgWEEgXj/WTYOhCUaYKzp/lm0BSWaQzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fmsQPhQQd0HeO6MFRKX0I89CEaGBX70+YGE0E1m9J4cha+hoThwXKncSsQ3FBgP43 y8n1X8HAOnRxNAWHvnbaD2OqGz4glazlqr1e0p8BmFKylODuIvlVR/3r1T3+ex7+Ny /aFQM5NK4OmHsm9RC+l8t23KPVuBJyCztzS5TH7s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Enguerrand de Ribaucourt , Andrew Lunn , Jakub Kicinski Subject: [PATCH 5.4 12/14] net: dp83822: disable rx error interrupt Date: Fri, 16 Sep 2022 12:08:19 +0200 Message-Id: <20220916100443.721296292@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Enguerrand de Ribaucourt commit 0e597e2affb90d6ea48df6890d882924acf71e19 upstream. Some RX errors, notably when disconnecting the cable, increase the RCSR register. Once half full (0x7fff), an interrupt flood is generated. I measured ~3k/s interrupts even after the RX errors transfer was stopped. Since we don't read and clear the RCSR register, we should disable this interrupt. Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/net/phy/dp83822.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -197,8 +197,7 @@ static int dp83822_config_intr(struct ph if (misr_status < 0) return misr_status; =20 - misr_status |=3D (DP83822_RX_ERR_HF_INT_EN | - DP83822_ANEG_COMPLETE_INT_EN | + misr_status |=3D (DP83822_ANEG_COMPLETE_INT_EN | DP83822_DUP_MODE_CHANGE_INT_EN | DP83822_SPEED_CHANGED_INT_EN | DP83822_LINK_STAT_INT_EN | From nobody Thu Apr 9 10:38:16 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 E2A11C6FA90 for ; Fri, 16 Sep 2022 10:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbiIPKNm (ORCPT ); Fri, 16 Sep 2022 06:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiIPKMv (ORCPT ); Fri, 16 Sep 2022 06:12:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81B4A99C9; Fri, 16 Sep 2022 03:10:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 162CDB82518; Fri, 16 Sep 2022 10:09:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F70BC433C1; Fri, 16 Sep 2022 10:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322997; bh=S07XMmLlcm/5xYS+ZKU7ruAv+2iVf9I/7rxvTXJEHGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yb6EdPBbRRrZgbD3Ey5kD2noIjIQwBiGwOoLNnGR9RtMH1/DAGvyufDx2PB2im2co r0FHv/J3ewma3k3G6H7BHIISwUIiMqQMFgPd4Uij+y8U0nB9PD7xn++AN9UxcVUADg GzcK0wRrpyb3LlB6NehYvy6Z66H9xy8PIivzvF0M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathew McBride , Ioana Ciornei , Arnd Bergmann Subject: [PATCH 5.4 13/14] soc: fsl: select FSL_GUTS driver for DPIO Date: Fri, 16 Sep 2022 12:08:20 +0200 Message-Id: <20220916100443.766339299@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Mathew McBride commit 9a472613f5bccf1b36837423495ae592a9c5182f upstream. The soc/fsl/dpio driver will perform a soc_device_match() to determine the optimal cache settings for a given CPU core. If FSL_GUTS is not enabled, this search will fail and the driver will not configure cache stashing for the given DPIO, and a string of "unknown SoC" messages will appear: fsl_mc_dpio dpio.7: unknown SoC version fsl_mc_dpio dpio.6: unknown SoC version fsl_mc_dpio dpio.5: unknown SoC version Fixes: 51da14e96e9b ("soc: fsl: dpio: configure cache stashing destination") Signed-off-by: Mathew McBride Reviewed-by: Ioana Ciornei Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220901052149.23873-2-matt@traverse.com.au' Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- drivers/soc/fsl/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig @@ -24,6 +24,7 @@ config FSL_MC_DPIO tristate "QorIQ DPAA2 DPIO driver" depends on FSL_MC_BUS select SOC_BUS + select FSL_GUTS help Driver for the DPAA2 DPIO object. A DPIO provides queue and buffer management facilities for software to interact with From nobody Thu Apr 9 10:38:16 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 971A9C54EE9 for ; Fri, 16 Sep 2022 10:14:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbiIPKNg (ORCPT ); Fri, 16 Sep 2022 06:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbiIPKMa (ORCPT ); Fri, 16 Sep 2022 06:12:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBEDA3D7D; Fri, 16 Sep 2022 03:10:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 102F6629E7; Fri, 16 Sep 2022 10:10:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 268C2C433C1; Fri, 16 Sep 2022 10:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663323000; bh=01W0zjQVqA35OWNap4lZMa7U31CITdvi1cGX39Kpkbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eyQ2bQjl5w/SEN2takO+dywmdhTiO1Tjatf/g23kLUAJBe5gcCaHWegf90Ug7enHk kzDxFfC6KX4kBhs+zPRYlIS43ZR4StePjo2VfeVwHXdJddOyKq4uMDgxALR/tYcDG4 vtEtRw9AvbClK8YSy+/8Q7w2CeaPOnM3OeAKGnZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , "Steven Rostedt (Google)" Subject: [PATCH 5.4 14/14] tracefs: Only clobber mode/uid/gid on remount if asked Date: Fri, 16 Sep 2022 12:08:21 +0200 Message-Id: <20220916100443.814559871@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100443.123226979@linuxfoundation.org> References: <20220916100443.123226979@linuxfoundation.org> User-Agent: quilt/0.67 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: Brian Norris commit 47311db8e8f33011d90dee76b39c8886120cdda4 upstream. Users may have explicitly configured their tracefs permissions; we shouldn't overwrite those just because a second mount appeared. Only clobber if the options were provided at mount time. Note: the previous behavior was especially surprising in the presence of automounted /sys/kernel/debug/tracing/. Existing behavior: ## Pre-existing status: tracefs is 0755. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x ## (Re)trigger the automount. # umount /sys/kernel/debug/tracing # stat -c '%A' /sys/kernel/debug/tracing/. drwx------ ## Unexpected: the automount changed mode for other mount instances. # stat -c '%A' /sys/kernel/tracing/ drwx------ New behavior (after this change): ## Pre-existing status: tracefs is 0755. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x ## (Re)trigger the automount. # umount /sys/kernel/debug/tracing # stat -c '%A' /sys/kernel/debug/tracing/. drwxr-xr-x ## Expected: the automount does not change other mount instances. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x Link: https://lkml.kernel.org/r/20220826174353.2.Iab6e5ea57963d6deca5311b27= fb7226790d44406@changeid Cc: stable@vger.kernel.org Fixes: 4282d60689d4f ("tracefs: Add new tracefs file system") Signed-off-by: Brian Norris Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Sudip Mukherjee --- fs/tracefs/inode.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -139,6 +139,8 @@ struct tracefs_mount_opts { kuid_t uid; kgid_t gid; umode_t mode; + /* Opt_* bitfield. */ + unsigned int opts; }; =20 enum { @@ -239,6 +241,7 @@ static int tracefs_parse_options(char *d kgid_t gid; char *p; =20 + opts->opts =3D 0; opts->mode =3D TRACEFS_DEFAULT_MODE; =20 while ((p =3D strsep(&data, ",")) !=3D NULL) { @@ -273,24 +276,36 @@ static int tracefs_parse_options(char *d * but traditionally tracefs has ignored all mount options */ } + + opts->opts |=3D BIT(token); } =20 return 0; } =20 -static int tracefs_apply_options(struct super_block *sb) +static int tracefs_apply_options(struct super_block *sb, bool remount) { struct tracefs_fs_info *fsi =3D sb->s_fs_info; struct inode *inode =3D sb->s_root->d_inode; struct tracefs_mount_opts *opts =3D &fsi->mount_opts; =20 - inode->i_mode &=3D ~S_IALLUGO; - inode->i_mode |=3D opts->mode; + /* + * On remount, only reset mode/uid/gid if they were provided as mount + * options. + */ + + if (!remount || opts->opts & BIT(Opt_mode)) { + inode->i_mode &=3D ~S_IALLUGO; + inode->i_mode |=3D opts->mode; + } =20 - inode->i_uid =3D opts->uid; + if (!remount || opts->opts & BIT(Opt_uid)) + inode->i_uid =3D opts->uid; =20 - /* Set all the group ids to the mount option */ - set_gid(sb->s_root, opts->gid); + if (!remount || opts->opts & BIT(Opt_gid)) { + /* Set all the group ids to the mount option */ + set_gid(sb->s_root, opts->gid); + } =20 return 0; } @@ -305,7 +320,7 @@ static int tracefs_remount(struct super_ if (err) goto fail; =20 - tracefs_apply_options(sb); + tracefs_apply_options(sb, true); =20 fail: return err; @@ -357,7 +372,7 @@ static int trace_fill_super(struct super =20 sb->s_op =3D &tracefs_super_operations; =20 - tracefs_apply_options(sb); + tracefs_apply_options(sb, false); =20 return 0;