From nobody Sat Apr 18 21:01:21 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 602BCC433EF for ; Mon, 11 Jul 2022 09:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232198AbiGKJZg (ORCPT ); Mon, 11 Jul 2022 05:25:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232255AbiGKJYX (ORCPT ); Mon, 11 Jul 2022 05:24:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86B222BF8; Mon, 11 Jul 2022 02:14: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 162A761140; Mon, 11 Jul 2022 09:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20870C34115; Mon, 11 Jul 2022 09:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530856; bh=uGlEy0o9eAIMJ4xj6ANHll0AzmvXaid4kNNsamvBGuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3KQpf0o26h5LxgTWSuOy3Wl/fEsvM7tBGOBCEniyqmrEOf6CPF0HqlFQqBaYaBcA 6JwjFpCNNQT//SZbgFtwQDOefzZ9zdCiS138ojFKM3o6GoUbvJ6Ax6M7o0KsGOjILN SDT0IgzOteA5zWMcOqt85TWRv5JnomILLD35Bw3w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dylan Yudaken , Jens Axboe Subject: [PATCH 5.18 001/112] io_uring: fix provided buffer import Date: Mon, 11 Jul 2022 11:06:01 +0200 Message-Id: <20220711090549.589060946@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Dylan Yudaken commit 09007af2b627f0f195c6c53c4829b285cc3990ec upstream. io_import_iovec uses the s pointer, but this was changed immediately after the iovec was re-imported and so it was imported into the wrong place. Change the ordering. Fixes: 2be2eb02e2f5 ("io_uring: ensure reads re-import for selected buffers= ") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220630132006.2825668-1-dylany@fb.com [axboe: ensure we don't half-import as well] Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- fs/io_uring.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3495,6 +3495,13 @@ static ssize_t io_iov_buffer_select(stru return __io_iov_buffer_select(req, iov, issue_flags); } =20 +static inline bool io_do_buffer_select(struct io_kiocb *req) +{ + if (!(req->flags & REQ_F_BUFFER_SELECT)) + return false; + return !(req->flags & REQ_F_BUFFER_SELECTED); +} + static struct iovec *__io_import_iovec(int rw, struct io_kiocb *req, struct io_rw_state *s, unsigned int issue_flags) @@ -3854,18 +3861,19 @@ static int io_read(struct io_kiocb *req, if (unlikely(ret < 0)) return ret; } else { + rw =3D req->async_data; + s =3D &rw->s; + /* * Safe and required to re-import if we're using provided * buffers, as we dropped the selected one before retry. */ - if (req->flags & REQ_F_BUFFER_SELECT) { + if (io_do_buffer_select(req)) { ret =3D io_import_iovec(READ, req, &iovec, s, issue_flags); if (unlikely(ret < 0)) return ret; } =20 - rw =3D req->async_data; - s =3D &rw->s; /* * We come here from an earlier attempt, restore our state to * match in case it doesn't. It's cheap enough that we don't From nobody Sat Apr 18 21:01:21 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 340B2C433EF for ; Mon, 11 Jul 2022 09:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbiGKJ02 (ORCPT ); Mon, 11 Jul 2022 05:26:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232360AbiGKJYe (ORCPT ); Mon, 11 Jul 2022 05:24:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86BFD24955; Mon, 11 Jul 2022 02:14:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 19868B80CEF; Mon, 11 Jul 2022 09:14:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65760C341C0; Mon, 11 Jul 2022 09:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530886; bh=gn6z5xNUSkjtagaL4BSFt6iLReVorGh4Ro3OTLFfa/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I54qc7h19xyYQLj6t9sV0J94Jr4Ypq+te4QZt0dmI0gUPYCxG2Qj9O1KJ/eCMM/bb o8g1thZIPLNEOnJVB5B8Ltzsy46U/OySSuW/zxJGxu96VpmYirPDbbOVD5EdaE66P6 W3vXzmAqLEn2MLZPNeiFCePqBjIMbelNRkKw+VyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.18 002/112] ALSA: usb-audio: Workarounds for Behringer UMC 204/404 HD Date: Mon, 11 Jul 2022 11:06:02 +0200 Message-Id: <20220711090549.617382071@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Takashi Iwai commit ae8b1631561a3634cc09d0c62bbdd938eade05ec upstream. Both Behringer UMC 202 HD and 404 HD need explicit quirks to enable the implicit feedback mode and start the playback stream primarily. The former seems fixing the stuttering and the latter is required for a playback-only case. Note that the "clock source 41 is not valid" error message still appears even after this fix, but it should be only once at probe. The reason of the error is still unknown, but this seems to be mostly harmless as it's a one-off error and the driver retires the clock setup and it succeeds afterwards. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=3D215934 Cc: Link: https://lore.kernel.org/r/20220624101132.14528-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/usb/quirks.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1842,6 +1842,10 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */ QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x1397, 0x0508, /* Behringer UMC204HD */ + QUIRK_FLAG_PLAYBACK_FIRST | QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x1397, 0x0509, /* Behringer UMC404HD */ + QUIRK_FLAG_PLAYBACK_FIRST | QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x13e5, 0x0001, /* Serato Phono */ QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x154e, 0x1002, /* Denon DCD-1500RE */ From nobody Sat Apr 18 21:01:21 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 76B04CCA480 for ; Mon, 11 Jul 2022 09:27:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbiGKJ1F (ORCPT ); Mon, 11 Jul 2022 05:27:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231913AbiGKJZH (ORCPT ); Mon, 11 Jul 2022 05:25:07 -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 E8A6A3AE63; Mon, 11 Jul 2022 02:15:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EEC8DB80DB7; Mon, 11 Jul 2022 09:15:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56CC3C34115; Mon, 11 Jul 2022 09:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530916; bh=nxxkMb4NrN9k+YIwms6fxAfJIchR/V3HenrDCucwkxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nh9Ih7/yKN11yRoJRbyCO02iVZe1PNo5psAA/DHsqZumZqW6XrFlNv0NgEHazR55I MJ6/G1fnxSUi0bClp/JO7sWvbhByxFEOWBnZ1iIC+ZV4wYx1wEbEF0ZAgRdyfzveYE rjW2/fcyL/4Upu7i+p2sm6BAsqE9T9cwQofb1aNA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Crawford , Takashi Iwai Subject: [PATCH 5.18 003/112] ALSA: hda/realtek: Add quirk for Clevo L140PU Date: Mon, 11 Jul 2022 11:06:03 +0200 Message-Id: <20220711090549.646221762@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tim Crawford commit 11bea26929a1a3a9dd1a287b60c2f471701bf706 upstream. Fixes headset detection on Clevo L140PU. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220624144109.3957-1-tcrawford@system76.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -9264,6 +9264,7 @@ static const struct snd_pci_quirk alc269 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_= NO_PRESENCE), SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MI= C_NO_PRESENCE), SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_N= O_PRESENCE), + SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_N= O_PRESENCE), SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_N= O_PRESENCE), SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MI= C_NO_PRESENCE), SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MI= C_NO_PRESENCE), From nobody Sat Apr 18 21:01:21 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 61C75C43334 for ; Mon, 11 Jul 2022 09:27:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbiGKJ10 (ORCPT ); Mon, 11 Jul 2022 05:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232285AbiGKJ0O (ORCPT ); Mon, 11 Jul 2022 05:26:14 -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 74DBC6053D; Mon, 11 Jul 2022 02:15: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 20C31B80E74; Mon, 11 Jul 2022 09:15:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 636BDC341CB; Mon, 11 Jul 2022 09:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530924; bh=4WZcDCsFE9fpCFpZDFTLUsccbZ30dyi6tyVEhn+pBDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krFgbsDpY/UniGQpiEkABPmpalTYOkb0xXMkmVHlcV8CP9MZv0P43h08zoQ9dLYXR JeNgzvAJkCMXlarzjtjl8cxmIPeVaVw/yRiQZ8B2ATGVxBZFn9GVd9GHLIVphUc4jG wJdtgv3QYNH9hNJEEHeIWvbzYRJ7qpLmeb2ZEsr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Jan Engelhardt Subject: [PATCH 5.18 004/112] ALSA: cs46xx: Fix missing snd_card_free() call at probe error Date: Mon, 11 Jul 2022 11:06:04 +0200 Message-Id: <20220711090549.674639067@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Takashi Iwai commit c5e58c4545a69677d078b4c813b5d10d3481be9c upstream. The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 5bff69b3645d ("ALSA: cs46xx: Allocate resources with device-managed = APIs") Cc: Reported-and-tested-by: Jan Engelhardt Link: https://lore.kernel.org/r/p2p1s96o-746-74p4-s95-61qo1p7782pn@vanv.qr Link: https://lore.kernel.org/r/20220705152336.350-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/pci/cs46xx/cs46xx.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c @@ -74,36 +74,36 @@ static int snd_card_cs46xx_probe(struct err =3D snd_cs46xx_create(card, pci, external_amp[dev], thinkpad[dev]); if (err < 0) - return err; + goto error; card->private_data =3D chip; chip->accept_valid =3D mmap_valid[dev]; err =3D snd_cs46xx_pcm(chip, 0); if (err < 0) - return err; + goto error; #ifdef CONFIG_SND_CS46XX_NEW_DSP err =3D snd_cs46xx_pcm_rear(chip, 1); if (err < 0) - return err; + goto error; err =3D snd_cs46xx_pcm_iec958(chip, 2); if (err < 0) - return err; + goto error; #endif err =3D snd_cs46xx_mixer(chip, 2); if (err < 0) - return err; + goto error; #ifdef CONFIG_SND_CS46XX_NEW_DSP if (chip->nr_ac97_codecs =3D=3D2) { err =3D snd_cs46xx_pcm_center_lfe(chip, 3); if (err < 0) - return err; + goto error; } #endif err =3D snd_cs46xx_midi(chip, 0); if (err < 0) - return err; + goto error; err =3D snd_cs46xx_start_dsp(chip); if (err < 0) - return err; + goto error; =20 snd_cs46xx_gameport(chip); =20 @@ -117,11 +117,15 @@ static int snd_card_cs46xx_probe(struct =20 err =3D snd_card_register(card); if (err < 0) - return err; + goto error; =20 pci_set_drvdata(pci, card); dev++; return 0; + + error: + snd_card_free(card); + return err; } =20 static struct pci_driver cs46xx_driver =3D { From nobody Sat Apr 18 21:01:21 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 59FA7C433EF for ; Mon, 11 Jul 2022 09:27:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbiGKJ1a (ORCPT ); Mon, 11 Jul 2022 05:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232310AbiGKJ0W (ORCPT ); Mon, 11 Jul 2022 05:26:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C339560698; Mon, 11 Jul 2022 02:15: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 202156115B; Mon, 11 Jul 2022 09:15:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D9FBC34115; Mon, 11 Jul 2022 09:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530927; bh=02Gr89cUsMTj9nZTGgI/higKfc2ahKfCiNE3RXAa/4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0u6NcpZheDC7RdncdL7VulbTZfR11MrYKQ1CJZxkcFoGiObObKRT05hOT48Z4FnNe 1tc0TG3tcTrKSNkfj2MvY5O2oAIzn8kpWCQTllD3SlfvZ8TSQSxs6buL6uRzsQVpSG MpG+QaGUbn6sFXwrNy+GyesfCbQjtRoGPvymxEqo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Norbert Slusarek , Thadeu Lima de Souza Cascardo , Oliver Hartkopp , Marc Kleine-Budde Subject: [PATCH 5.18 005/112] can: bcm: use call_rcu() instead of costly synchronize_rcu() Date: Mon, 11 Jul 2022 11:06:05 +0200 Message-Id: <20220711090549.703484998@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Oliver Hartkopp commit f1b4e32aca0811aa011c76e5d6cf2fa19224b386 upstream. In commit d5f9023fa61e ("can: bcm: delay release of struct bcm_op after synchronize_rcu()") Thadeu Lima de Souza Cascardo introduced two synchronize_rcu() calls in bcm_release() (only once at socket close) and in bcm_delete_rx_op() (called on removal of each single bcm_op). Unfortunately this slow removal of the bcm_op's affects user space applications like cansniffer where the modification of a filter removes 2048 bcm_op's which blocks the cansniffer application for 40(!) seconds. In commit 181d4447905d ("can: gw: use call_rcu() instead of costly synchronize_rcu()") Eric Dumazet replaced the synchronize_rcu() calls with several call_rcu()'s to safely remove the data structures after the removal of CAN ID subscriptions with can_rx_unregister() calls. This patch adopts Erics approach for the can-bcm which should be applicable since the removal of tasklet_kill() in bcm_remove_op() and the introduction of the HRTIMER_MODE_SOFT timer handling in Linux 5.4. Fixes: d5f9023fa61e ("can: bcm: delay release of struct bcm_op after synchr= onize_rcu()") # >=3D 5.4 Link: https://lore.kernel.org/all/20220520183239.19111-1-socketcan@hartkopp= .net Cc: stable@vger.kernel.org Cc: Eric Dumazet Cc: Norbert Slusarek Cc: Thadeu Lima de Souza Cascardo Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/can/bcm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -100,6 +100,7 @@ static inline u64 get_u64(const struct c =20 struct bcm_op { struct list_head list; + struct rcu_head rcu; int ifindex; canid_t can_id; u32 flags; @@ -718,10 +719,9 @@ static struct bcm_op *bcm_find_op(struct return NULL; } =20 -static void bcm_remove_op(struct bcm_op *op) +static void bcm_free_op_rcu(struct rcu_head *rcu_head) { - hrtimer_cancel(&op->timer); - hrtimer_cancel(&op->thrtimer); + struct bcm_op *op =3D container_of(rcu_head, struct bcm_op, rcu); =20 if ((op->frames) && (op->frames !=3D &op->sframe)) kfree(op->frames); @@ -732,6 +732,14 @@ static void bcm_remove_op(struct bcm_op kfree(op); } =20 +static void bcm_remove_op(struct bcm_op *op) +{ + hrtimer_cancel(&op->timer); + hrtimer_cancel(&op->thrtimer); + + call_rcu(&op->rcu, bcm_free_op_rcu); +} + static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) { if (op->rx_reg_dev =3D=3D dev) { @@ -757,6 +765,9 @@ static int bcm_delete_rx_op(struct list_ if ((op->can_id =3D=3D mh->can_id) && (op->ifindex =3D=3D ifindex) && (op->flags & CAN_FD_FRAME) =3D=3D (mh->flags & CAN_FD_FRAME)) { =20 + /* disable automatic timer on frame reception */ + op->flags |=3D RX_NO_AUTOTIMER; + /* * Don't care if we're bound or not (due to netdev * problems) can_rx_unregister() is always a save @@ -785,7 +796,6 @@ static int bcm_delete_rx_op(struct list_ bcm_rx_handler, op); =20 list_del(&op->list); - synchronize_rcu(); bcm_remove_op(op); return 1; /* done */ } From nobody Sat Apr 18 21:01:21 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 C16D0C433EF for ; Mon, 11 Jul 2022 09:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232404AbiGKJ1d (ORCPT ); Mon, 11 Jul 2022 05:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232384AbiGKJ0p (ORCPT ); Mon, 11 Jul 2022 05:26:45 -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 1356E6170C; Mon, 11 Jul 2022 02:15:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C958B80DB7; Mon, 11 Jul 2022 09:15:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D34CDC34115; Mon, 11 Jul 2022 09:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530930; bh=Hoge35Khau6ID3ug7P6H4oEJ7hAraObgqJGqh9yregM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EfM2a5f2Fl0qkWVYA4lLHVvqoYqBoh1TfN/c7qY/D/4EGiDkWWj//2QqhjXSMY2SP Gq8KSJSQ5yIeDbXQg1ISvxTeoxbO42oC89Lhr1fOzHUpy2d/MjIlFZy5G1zR4+avg1 6G9GawSY5LUWfO9JpOC64WeRZieLLpGDxQ/MuWZM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Larsson , Liang He , Marc Kleine-Budde Subject: [PATCH 5.18 006/112] can: grcan: grcan_probe(): remove extra of_node_get() Date: Mon, 11 Jul 2022 11:06:06 +0200 Message-Id: <20220711090549.731770484@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 562fed945ea482833667f85496eeda766d511386 upstream. In grcan_probe(), of_find_node_by_path() has already increased the refcount. There is no need to call of_node_get() again, so remove it. Link: https://lore.kernel.org/all/20220619070257.4067022-1-windhl@126.com Fixes: 1e93ed26acf0 ("can: grcan: grcan_probe(): fix broken system id check= for errata workaround needs") Cc: stable@vger.kernel.org # v5.18 Cc: Andreas Larsson Signed-off-by: Liang He Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/grcan.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -1646,7 +1646,6 @@ static int grcan_probe(struct platform_d */ sysid_parent =3D of_find_node_by_path("/ambapp0"); if (sysid_parent) { - of_node_get(sysid_parent); err =3D of_property_read_u32(sysid_parent, "systemid", &sysid); if (!err && ((sysid & GRLIB_VERSION_MASK) >=3D GRCAN_TXBUG_SAFE_GRLIB_VERSION)) From nobody Sat Apr 18 21:01:21 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 E9281C433EF for ; Mon, 11 Jul 2022 09:27:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbiGKJ1j (ORCPT ); Mon, 11 Jul 2022 05:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231982AbiGKJ05 (ORCPT ); Mon, 11 Jul 2022 05:26:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87FE13CBCD; Mon, 11 Jul 2022 02:15:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8CE361226; Mon, 11 Jul 2022 09:15:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0255C34115; Mon, 11 Jul 2022 09:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530933; bh=h767cPWK/Kt31VwAfBA7A8Ipg4z0NEJbLUloznUSy0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ctNR4FrM202FkqyIQt0j869LKNWO8cH/9BjccU0kDT3sFnvZssTyMcdMFiEyf3+OQ 3/VOsED3zZ0riV7GNwWNXaz4gOjuDs8RKdSHO2+FMxEslA948qUyz+ICOJuKZW0IoE ER1yAzTSAiDqVUx7wBeYYtorPUWguVRjwtD1ZiVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rhett Aultman , Marc Kleine-Budde Subject: [PATCH 5.18 007/112] can: gs_usb: gs_usb_open/close(): fix memory leak Date: Mon, 11 Jul 2022 11:06:07 +0200 Message-Id: <20220711090549.760440897@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Rhett Aultman commit 2bda24ef95c0311ab93bda00db40486acf30bd0a upstream. The gs_usb driver appears to suffer from a malady common to many USB CAN adapter drivers in that it performs usb_alloc_coherent() to allocate a number of USB request blocks (URBs) for RX, and then later relies on usb_kill_anchored_urbs() to free them, but this doesn't actually free them. As a result, this may be leaking DMA memory that's been used by the driver. This commit is an adaptation of the techniques found in the esd_usb2 driver where a similar design pattern led to a memory leak. It explicitly frees the RX URBs and their DMA memory via a call to usb_free_coherent(). Since the RX URBs were allocated in the gs_can_open(), we remove them in gs_can_close() rather than in the disconnect function as was done in esd_usb2. For more information, see the 928150fad41b ("can: esd_usb2: fix memory leak"). Link: https://lore.kernel.org/all/alpine.DEB.2.22.394.2206031547001.1630869= @thelappy Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices= ") Cc: stable@vger.kernel.org Signed-off-by: Rhett Aultman Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/usb/gs_usb.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -268,6 +268,8 @@ struct gs_can { =20 struct usb_anchor tx_submitted; atomic_t active_tx_urbs; + void *rxbuf[GS_MAX_RX_URBS]; + dma_addr_t rxbuf_dma[GS_MAX_RX_URBS]; }; =20 /* usb interface struct */ @@ -742,6 +744,7 @@ static int gs_can_open(struct net_device for (i =3D 0; i < GS_MAX_RX_URBS; i++) { struct urb *urb; u8 *buf; + dma_addr_t buf_dma; =20 /* alloc rx urb */ urb =3D usb_alloc_urb(0, GFP_KERNEL); @@ -752,7 +755,7 @@ static int gs_can_open(struct net_device buf =3D usb_alloc_coherent(dev->udev, dev->parent->hf_size_rx, GFP_KERNEL, - &urb->transfer_dma); + &buf_dma); if (!buf) { netdev_err(netdev, "No memory left for USB buffer\n"); @@ -760,6 +763,8 @@ static int gs_can_open(struct net_device return -ENOMEM; } =20 + urb->transfer_dma =3D buf_dma; + /* fill, anchor, and submit rx urb */ usb_fill_bulk_urb(urb, dev->udev, @@ -781,10 +786,17 @@ static int gs_can_open(struct net_device "usb_submit failed (err=3D%d)\n", rc); =20 usb_unanchor_urb(urb); + usb_free_coherent(dev->udev, + sizeof(struct gs_host_frame), + buf, + buf_dma); usb_free_urb(urb); break; } =20 + dev->rxbuf[i] =3D buf; + dev->rxbuf_dma[i] =3D buf_dma; + /* Drop reference, * USB core will take care of freeing it */ @@ -842,13 +854,20 @@ static int gs_can_close(struct net_devic int rc; struct gs_can *dev =3D netdev_priv(netdev); struct gs_usb *parent =3D dev->parent; + unsigned int i; =20 netif_stop_queue(netdev); =20 /* Stop polling */ parent->active_channels--; - if (!parent->active_channels) + if (!parent->active_channels) { usb_kill_anchored_urbs(&parent->rx_submitted); + for (i =3D 0; i < GS_MAX_RX_URBS; i++) + usb_free_coherent(dev->udev, + sizeof(struct gs_host_frame), + dev->rxbuf[i], + dev->rxbuf_dma[i]); + } =20 /* Stop sending URBs */ usb_kill_anchored_urbs(&dev->tx_submitted); From nobody Sat Apr 18 21:01:21 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 42FFBC433EF for ; Mon, 11 Jul 2022 09:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232299AbiGKJ1s (ORCPT ); Mon, 11 Jul 2022 05:27:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232255AbiGKJ1J (ORCPT ); Mon, 11 Jul 2022 05:27:09 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDE65643D7; Mon, 11 Jul 2022 02:15: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 sin.source.kernel.org (Postfix) with ESMTPS id 95D16CE125A; Mon, 11 Jul 2022 09:15:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80893C34115; Mon, 11 Jul 2022 09:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530935; bh=RZqVaIfm4vVNEO6ke1jAxHBE44MuH8z1nMRH0nnAEFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hTubfGU+f/PnnG0BWGTmv7CazD0RNFiZSo6PPcKh9ZIXqKyHh7M2EhWml1TyY09/O fYuwIH6RI3ssK+KglccabsE+ykuLnjQWatdjiW0s2vMZtqjKtxh9vdWmUcyJ+0xvy8 b2WeFwVfAmJ3lBSQ2A2NthrOd6wRbREbKtJOWhhc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Torin Cooper-Bennun , Chandrasekar Ramakrishnan , Marc Kleine-Budde Subject: [PATCH 5.18 008/112] can: m_can: m_can_chip_config(): actually enable internal timestamping Date: Mon, 11 Jul 2022 11:06:08 +0200 Message-Id: <20220711090549.788707971@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Marc Kleine-Budde commit 5b12933de4e76ec164031c18ce8e0904abf530d7 upstream. In commit df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") the timestamping in the m_can core should be enabled. In peripheral mode, the RX'ed CAN frames, TX compete frames and error events are sorted by the timestamp. The above mentioned commit however forgot to enable the timestamping. Add the missing bits to enable the timestamp counter to the write of the Timestamp Counter Configuration register. Link: https://lore.kernel.org/all/20220612212708.4081756-1-mkl@pengutronix.= de Fixes: df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure= internal timestamps") Cc: # 5.13 Cc: Torin Cooper-Bennun Reviewed-by: Chandrasekar Ramakrishnan Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/m_can/m_can.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1360,7 +1360,9 @@ static void m_can_chip_config(struct net /* enable internal timestamp generation, with a prescalar of 16. The * prescalar is applied to the nominal bit timing */ - m_can_write(cdev, M_CAN_TSCC, FIELD_PREP(TSCC_TCP_MASK, 0xf)); + m_can_write(cdev, M_CAN_TSCC, + FIELD_PREP(TSCC_TCP_MASK, 0xf) | + FIELD_PREP(TSCC_TSS_MASK, TSCC_TSS_INTERNAL)); =20 m_can_config_endisable(cdev, false); From nobody Sat Apr 18 21:01:21 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 138FECCA47B for ; Mon, 11 Jul 2022 09:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231967AbiGKJ2I (ORCPT ); Mon, 11 Jul 2022 05:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232441AbiGKJ10 (ORCPT ); Mon, 11 Jul 2022 05:27:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97DEC643F3; Mon, 11 Jul 2022 02:15:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C906AB80E87; Mon, 11 Jul 2022 09:15:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35BDBC34115; Mon, 11 Jul 2022 09:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530938; bh=dEqsAoUirAyUGEREUy96KikMAHDexhgpijutbuTwZec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WfkfZwd9tejblT7l8z4vwCQvRujJpYMQkItumvpVMrY2NS8uBRv2GppTw17EYpXpF 6X8nvhbkWI2pgK3TH2n25RgiF2OWLydIRFKhMT2S10jTO7jURSkifgRclaXkF0ncLk /dsfRs212GZccXEszEkZ1AfkW7w4enih7hRl9wN0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Torin Cooper-Bennun , Chandrasekar Ramakrishnan , Marc Kleine-Budde Subject: [PATCH 5.18 009/112] can: m_can: m_can_{read_fifo,echo_tx_event}(): shift timestamp to full 32 bits Date: Mon, 11 Jul 2022 11:06:09 +0200 Message-Id: <20220711090549.820201664@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Marc Kleine-Budde commit 4c3333693f07313f5f0145a922f14a7d3c0f4f21 upstream. In commit 1be37d3b0414 ("can: m_can: fix periph RX path: use rx-offload to ensure skbs are sent from softirq context") the RX path for peripheral devices was switched to RX-offload. Received CAN frames are pushed to RX-offload together with a timestamp. RX-offload is designed to handle overflows of the timestamp correctly, if 32 bit timestamps are provided. The timestamps of m_can core are only 16 bits wide. So this patch shifts them to full 32 bit before passing them to RX-offload. Link: https://lore.kernel.org/all/20220612211410.4081390-1-mkl@pengutronix.= de Fixes: 1be37d3b0414 ("can: m_can: fix periph RX path: use rx-offload to ens= ure skbs are sent from softirq context") Cc: # 5.13 Cc: Torin Cooper-Bennun Reviewed-by: Chandrasekar Ramakrishnan Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/m_can/m_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -532,7 +532,7 @@ static int m_can_read_fifo(struct net_de /* acknowledge rx fifo 0 */ m_can_write(cdev, M_CAN_RXF0A, fgi); =20 - timestamp =3D FIELD_GET(RX_BUF_RXTS_MASK, fifo_header.dlc); + timestamp =3D FIELD_GET(RX_BUF_RXTS_MASK, fifo_header.dlc) << 16; =20 m_can_receive_skb(cdev, skb, timestamp); =20 @@ -1036,7 +1036,7 @@ static int m_can_echo_tx_event(struct ne } =20 msg_mark =3D FIELD_GET(TX_EVENT_MM_MASK, txe); - timestamp =3D FIELD_GET(TX_EVENT_TXTS_MASK, txe); + timestamp =3D FIELD_GET(TX_EVENT_TXTS_MASK, txe) << 16; =20 /* ack txe element */ m_can_write(cdev, M_CAN_TXEFA, FIELD_PREP(TXEFA_EFAI_MASK, From nobody Sat Apr 18 21:01:21 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 471D1C43334 for ; Mon, 11 Jul 2022 09:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232208AbiGKJZi (ORCPT ); Mon, 11 Jul 2022 05:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232314AbiGKJY1 (ORCPT ); Mon, 11 Jul 2022 05:24:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D17728712; Mon, 11 Jul 2022 02:14: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 A6B05B80DB7; Mon, 11 Jul 2022 09:14:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D13F8C34115; Mon, 11 Jul 2022 09:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530859; bh=bsXV8+Mms5E8ds3X0Qz1+Q+jpY/VJMmNjkRxriLNeMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r5CimK/X72VHkW+3/X4qnx5UPAFUyLUOL1xfNQIqh9V/4d8/664N61c7zgnzUpVQ4 W3EVtUFocC+EYnasXtRA1r2xX63RUVu9Ud3FrYJyG4xYw7U+Pa96Dpbhy2HskHzPub GgBF+OnXAYVs4BRvZfp5It1QVhx2fjMQjCW2GysM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Kleine-Budde , Jimmy Assarsson Subject: [PATCH 5.18 010/112] can: kvaser_usb: replace run-time checks with struct kvaser_usb_driver_info Date: Mon, 11 Jul 2022 11:06:10 +0200 Message-Id: <20220711090549.850454025@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Jimmy Assarsson commit 49f274c72357d2d74cba70b172cf369768909707 upstream. Unify and move compile-time known information into new struct kvaser_usb_driver_info, in favor of run-time checks. All Kvaser USBcanII supports listen-only mode and error counter reporting. Link: https://lore.kernel.org/all/20220603083820.800246-2-extja@kvaser.com Suggested-by: Marc Kleine-Budde Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson [mkl: move struct kvaser_usb_driver_info into kvaser_usb_core.c] Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 22 + drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 274 ++++++++++++------= ----- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 24 +- 3 files changed, 172 insertions(+), 148 deletions(-) --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb.h +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb.h @@ -35,9 +35,9 @@ #define KVASER_USB_RX_BUFFER_SIZE 3072 #define KVASER_USB_MAX_NET_DEVICES 5 =20 -/* USB devices features */ -#define KVASER_USB_HAS_SILENT_MODE BIT(0) -#define KVASER_USB_HAS_TXRX_ERRORS BIT(1) +/* Kvaser USB device quirks */ +#define KVASER_USB_QUIRK_HAS_SILENT_MODE BIT(0) +#define KVASER_USB_QUIRK_HAS_TXRX_ERRORS BIT(1) =20 /* Device capabilities */ #define KVASER_USB_CAP_BERR_CAP 0x01 @@ -65,12 +65,7 @@ struct kvaser_usb_dev_card_data_hydra { struct kvaser_usb_dev_card_data { u32 ctrlmode_supported; u32 capabilities; - union { - struct { - enum kvaser_usb_leaf_family family; - } leaf; - struct kvaser_usb_dev_card_data_hydra hydra; - }; + struct kvaser_usb_dev_card_data_hydra hydra; }; =20 /* Context for an outstanding, not yet ACKed, transmission */ @@ -83,7 +78,7 @@ struct kvaser_usb { struct usb_device *udev; struct usb_interface *intf; struct kvaser_usb_net_priv *nets[KVASER_USB_MAX_NET_DEVICES]; - const struct kvaser_usb_dev_ops *ops; + const struct kvaser_usb_driver_info *driver_info; const struct kvaser_usb_dev_cfg *cfg; =20 struct usb_endpoint_descriptor *bulk_in, *bulk_out; @@ -165,6 +160,12 @@ struct kvaser_usb_dev_ops { u16 transid); }; =20 +struct kvaser_usb_driver_info { + u32 quirks; + enum kvaser_usb_leaf_family family; + const struct kvaser_usb_dev_ops *ops; +}; + struct kvaser_usb_dev_cfg { const struct can_clock clock; const unsigned int timestamp_freq; @@ -184,4 +185,5 @@ int kvaser_usb_send_cmd_async(struct kva int len); =20 int kvaser_usb_can_rx_over_error(struct net_device *netdev); + #endif /* KVASER_USB_H */ --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c @@ -61,8 +61,6 @@ #define USB_USBCAN_R_V2_PRODUCT_ID 294 #define USB_LEAF_LIGHT_R_V2_PRODUCT_ID 295 #define USB_LEAF_LIGHT_HS_V2_OEM2_PRODUCT_ID 296 -#define USB_LEAF_PRODUCT_ID_END \ - USB_LEAF_LIGHT_HS_V2_OEM2_PRODUCT_ID =20 /* Kvaser USBCan-II devices product ids */ #define USB_USBCAN_REVB_PRODUCT_ID 2 @@ -89,116 +87,144 @@ #define USB_USBCAN_PRO_4HS_PRODUCT_ID 276 #define USB_HYBRID_CANLIN_PRODUCT_ID 277 #define USB_HYBRID_PRO_CANLIN_PRODUCT_ID 278 -#define USB_HYDRA_PRODUCT_ID_END \ - USB_HYBRID_PRO_CANLIN_PRODUCT_ID =20 -static inline bool kvaser_is_leaf(const struct usb_device_id *id) -{ - return (id->idProduct >=3D USB_LEAF_DEVEL_PRODUCT_ID && - id->idProduct <=3D USB_CAN_R_PRODUCT_ID) || - (id->idProduct >=3D USB_LEAF_LITE_V2_PRODUCT_ID && - id->idProduct <=3D USB_LEAF_PRODUCT_ID_END); -} +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_hydra = =3D { + .quirks =3D 0, + .ops =3D &kvaser_usb_hydra_dev_ops, +}; =20 -static inline bool kvaser_is_usbcan(const struct usb_device_id *id) -{ - return id->idProduct >=3D USB_USBCAN_REVB_PRODUCT_ID && - id->idProduct <=3D USB_MEMORATOR_PRODUCT_ID; -} +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_usbcan = =3D { + .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS | + KVASER_USB_QUIRK_HAS_SILENT_MODE, + .family =3D KVASER_USBCAN, + .ops =3D &kvaser_usb_leaf_dev_ops, +}; =20 -static inline bool kvaser_is_hydra(const struct usb_device_id *id) -{ - return id->idProduct >=3D USB_BLACKBIRD_V2_PRODUCT_ID && - id->idProduct <=3D USB_HYDRA_PRODUCT_ID_END; -} +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf =3D= { + .quirks =3D 0, + .family =3D KVASER_LEAF, + .ops =3D &kvaser_usb_leaf_dev_ops, +}; + +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf_err= =3D { + .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS, + .family =3D KVASER_LEAF, + .ops =3D &kvaser_usb_leaf_dev_ops, +}; + +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf_err= _listen =3D { + .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS | + KVASER_USB_QUIRK_HAS_SILENT_MODE, + .family =3D KVASER_LEAF, + .ops =3D &kvaser_usb_leaf_dev_ops, +}; =20 static const struct usb_device_id kvaser_usb_table[] =3D { /* Leaf USB product IDs */ - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_DEVEL_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_PRODUCT_ID) }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_DEVEL_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_LS_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_SWC_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_LIN_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_LS_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_SWC_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_DEVEL_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_HSHS_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_UPRO_HSHS_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_GI_PRODUCT_ID) }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_GI_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_OBDII_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS | - KVASER_USB_HAS_SILENT_MODE }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err_listen= }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_HSLS_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_CH_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_BLACKBIRD_SPRO_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_OEM_MERCURY_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_OEM_LEAF_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_CAN_R_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_LIGHT_2HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_2HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_R_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_R_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM2_PRODUCT_ID) }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_LIGHT_2HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_2HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_R_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_R_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, =20 /* USBCANII USB product IDs */ { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN2_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_usbcan }, { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_REVB_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_usbcan }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMORATOR_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_usbcan }, { USB_DEVICE(KVASER_VENDOR_ID, USB_VCI2_PRODUCT_ID), - .driver_info =3D KVASER_USB_HAS_TXRX_ERRORS }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_usbcan }, =20 /* Minihydra USB product IDs */ - { USB_DEVICE(KVASER_VENDOR_ID, USB_BLACKBIRD_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_PRO_5HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_5HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_LIGHT_4HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_HS_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_2HS_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_2HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_PRO_2HS_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_2CANLIN_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_ATI_USBCAN_PRO_2HS_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_ATI_MEMO_PRO_2HS_V2_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_2CANLIN_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_U100_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_U100P_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_U100S_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_4HS_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_CANLIN_PRODUCT_ID) }, - { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_CANLIN_PRODUCT_ID) }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_BLACKBIRD_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_PRO_5HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_5HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_LIGHT_4HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_HS_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_2HS_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_2HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO_PRO_2HS_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_2CANLIN_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_ATI_USBCAN_PRO_2HS_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_ATI_MEMO_PRO_2HS_V2_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_2CANLIN_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_U100_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_U100P_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_U100S_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_4HS_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_CANLIN_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, + { USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_CANLIN_PRODUCT_ID), + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_hydra }, { } }; MODULE_DEVICE_TABLE(usb, kvaser_usb_table); @@ -285,6 +311,7 @@ int kvaser_usb_can_rx_over_error(struct static void kvaser_usb_read_bulk_callback(struct urb *urb) { struct kvaser_usb *dev =3D urb->context; + const struct kvaser_usb_dev_ops *ops =3D dev->driver_info->ops; int err; unsigned int i; =20 @@ -301,8 +328,8 @@ static void kvaser_usb_read_bulk_callbac goto resubmit_urb; } =20 - dev->ops->dev_read_bulk_callback(dev, urb->transfer_buffer, - urb->actual_length); + ops->dev_read_bulk_callback(dev, urb->transfer_buffer, + urb->actual_length); =20 resubmit_urb: usb_fill_bulk_urb(urb, dev->udev, @@ -396,6 +423,7 @@ static int kvaser_usb_open(struct net_de { struct kvaser_usb_net_priv *priv =3D netdev_priv(netdev); struct kvaser_usb *dev =3D priv->dev; + const struct kvaser_usb_dev_ops *ops =3D dev->driver_info->ops; int err; =20 err =3D open_candev(netdev); @@ -406,11 +434,11 @@ static int kvaser_usb_open(struct net_de if (err) goto error; =20 - err =3D dev->ops->dev_set_opt_mode(priv); + err =3D ops->dev_set_opt_mode(priv); if (err) goto error; =20 - err =3D dev->ops->dev_start_chip(priv); + err =3D ops->dev_start_chip(priv); if (err) { netdev_warn(netdev, "Cannot start device, error %d\n", err); goto error; @@ -467,22 +495,23 @@ static int kvaser_usb_close(struct net_d { struct kvaser_usb_net_priv *priv =3D netdev_priv(netdev); struct kvaser_usb *dev =3D priv->dev; + const struct kvaser_usb_dev_ops *ops =3D dev->driver_info->ops; int err; =20 netif_stop_queue(netdev); =20 - err =3D dev->ops->dev_flush_queue(priv); + err =3D ops->dev_flush_queue(priv); if (err) netdev_warn(netdev, "Cannot flush queue, error %d\n", err); =20 - if (dev->ops->dev_reset_chip) { - err =3D dev->ops->dev_reset_chip(dev, priv->channel); + if (ops->dev_reset_chip) { + err =3D ops->dev_reset_chip(dev, priv->channel); if (err) netdev_warn(netdev, "Cannot reset card, error %d\n", err); } =20 - err =3D dev->ops->dev_stop_chip(priv); + err =3D ops->dev_stop_chip(priv); if (err) netdev_warn(netdev, "Cannot stop device, error %d\n", err); =20 @@ -521,6 +550,7 @@ static netdev_tx_t kvaser_usb_start_xmit { struct kvaser_usb_net_priv *priv =3D netdev_priv(netdev); struct kvaser_usb *dev =3D priv->dev; + const struct kvaser_usb_dev_ops *ops =3D dev->driver_info->ops; struct net_device_stats *stats =3D &netdev->stats; struct kvaser_usb_tx_urb_context *context =3D NULL; struct urb *urb; @@ -563,8 +593,7 @@ static netdev_tx_t kvaser_usb_start_xmit goto freeurb; } =20 - buf =3D dev->ops->dev_frame_to_cmd(priv, skb, &cmd_len, - context->echo_index); + buf =3D ops->dev_frame_to_cmd(priv, skb, &cmd_len, context->echo_index); if (!buf) { stats->tx_dropped++; dev_kfree_skb(skb); @@ -648,15 +677,16 @@ static void kvaser_usb_remove_interfaces } } =20 -static int kvaser_usb_init_one(struct kvaser_usb *dev, - const struct usb_device_id *id, int channel) +static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) { struct net_device *netdev; struct kvaser_usb_net_priv *priv; + const struct kvaser_usb_driver_info *driver_info =3D dev->driver_info; + const struct kvaser_usb_dev_ops *ops =3D driver_info->ops; int err; =20 - if (dev->ops->dev_reset_chip) { - err =3D dev->ops->dev_reset_chip(dev, channel); + if (ops->dev_reset_chip) { + err =3D ops->dev_reset_chip(dev, channel); if (err) return err; } @@ -685,20 +715,19 @@ static int kvaser_usb_init_one(struct kv priv->can.state =3D CAN_STATE_STOPPED; priv->can.clock.freq =3D dev->cfg->clock.freq; priv->can.bittiming_const =3D dev->cfg->bittiming_const; - priv->can.do_set_bittiming =3D dev->ops->dev_set_bittiming; - priv->can.do_set_mode =3D dev->ops->dev_set_mode; - if ((id->driver_info & KVASER_USB_HAS_TXRX_ERRORS) || + priv->can.do_set_bittiming =3D ops->dev_set_bittiming; + priv->can.do_set_mode =3D ops->dev_set_mode; + if ((driver_info->quirks & KVASER_USB_QUIRK_HAS_TXRX_ERRORS) || (priv->dev->card_data.capabilities & KVASER_USB_CAP_BERR_CAP)) - priv->can.do_get_berr_counter =3D dev->ops->dev_get_berr_counter; - if (id->driver_info & KVASER_USB_HAS_SILENT_MODE) + priv->can.do_get_berr_counter =3D ops->dev_get_berr_counter; + if (driver_info->quirks & KVASER_USB_QUIRK_HAS_SILENT_MODE) priv->can.ctrlmode_supported |=3D CAN_CTRLMODE_LISTENONLY; =20 priv->can.ctrlmode_supported |=3D dev->card_data.ctrlmode_supported; =20 if (priv->can.ctrlmode_supported & CAN_CTRLMODE_FD) { priv->can.data_bittiming_const =3D dev->cfg->data_bittiming_const; - priv->can.do_set_data_bittiming =3D - dev->ops->dev_set_data_bittiming; + priv->can.do_set_data_bittiming =3D ops->dev_set_data_bittiming; } =20 netdev->flags |=3D IFF_ECHO; @@ -729,29 +758,22 @@ static int kvaser_usb_probe(struct usb_i struct kvaser_usb *dev; int err; int i; + const struct kvaser_usb_driver_info *driver_info; + const struct kvaser_usb_dev_ops *ops; + + driver_info =3D (const struct kvaser_usb_driver_info *)id->driver_info; + if (!driver_info) + return -ENODEV; =20 dev =3D devm_kzalloc(&intf->dev, sizeof(*dev), GFP_KERNEL); if (!dev) return -ENOMEM; =20 - if (kvaser_is_leaf(id)) { - dev->card_data.leaf.family =3D KVASER_LEAF; - dev->ops =3D &kvaser_usb_leaf_dev_ops; - } else if (kvaser_is_usbcan(id)) { - dev->card_data.leaf.family =3D KVASER_USBCAN; - dev->ops =3D &kvaser_usb_leaf_dev_ops; - } else if (kvaser_is_hydra(id)) { - dev->ops =3D &kvaser_usb_hydra_dev_ops; - } else { - dev_err(&intf->dev, - "Product ID (%d) is not a supported Kvaser USB device\n", - id->idProduct); - return -ENODEV; - } - dev->intf =3D intf; + dev->driver_info =3D driver_info; + ops =3D driver_info->ops; =20 - err =3D dev->ops->dev_setup_endpoints(dev); + err =3D ops->dev_setup_endpoints(dev); if (err) { dev_err(&intf->dev, "Cannot get usb endpoint(s)"); return err; @@ -765,22 +787,22 @@ static int kvaser_usb_probe(struct usb_i =20 dev->card_data.ctrlmode_supported =3D 0; dev->card_data.capabilities =3D 0; - err =3D dev->ops->dev_init_card(dev); + err =3D ops->dev_init_card(dev); if (err) { dev_err(&intf->dev, "Failed to initialize card, error %d\n", err); return err; } =20 - err =3D dev->ops->dev_get_software_info(dev); + err =3D ops->dev_get_software_info(dev); if (err) { dev_err(&intf->dev, "Cannot get software info, error %d\n", err); return err; } =20 - if (dev->ops->dev_get_software_details) { - err =3D dev->ops->dev_get_software_details(dev); + if (ops->dev_get_software_details) { + err =3D ops->dev_get_software_details(dev); if (err) { dev_err(&intf->dev, "Cannot get software details, error %d\n", err); @@ -798,14 +820,14 @@ static int kvaser_usb_probe(struct usb_i =20 dev_dbg(&intf->dev, "Max outstanding tx =3D %d URBs\n", dev->max_tx_urbs); =20 - err =3D dev->ops->dev_get_card_info(dev); + err =3D ops->dev_get_card_info(dev); if (err) { dev_err(&intf->dev, "Cannot get card info, error %d\n", err); return err; } =20 - if (dev->ops->dev_get_capabilities) { - err =3D dev->ops->dev_get_capabilities(dev); + if (ops->dev_get_capabilities) { + err =3D ops->dev_get_capabilities(dev); if (err) { dev_err(&intf->dev, "Cannot get capabilities, error %d\n", err); @@ -815,7 +837,7 @@ static int kvaser_usb_probe(struct usb_i } =20 for (i =3D 0; i < dev->nchannels; i++) { - err =3D kvaser_usb_init_one(dev, id, i); + err =3D kvaser_usb_init_one(dev, i); if (err) { kvaser_usb_remove_interfaces(dev); return err; --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -404,7 +404,7 @@ kvaser_usb_leaf_frame_to_cmd(const struc sizeof(struct kvaser_cmd_tx_can); cmd->u.tx_can.channel =3D priv->channel; =20 - switch (dev->card_data.leaf.family) { + switch (dev->driver_info->family) { case KVASER_LEAF: cmd_tx_can_flags =3D &cmd->u.tx_can.leaf.flags; break; @@ -550,7 +550,7 @@ static int kvaser_usb_leaf_get_software_ if (err) return err; =20 - switch (dev->card_data.leaf.family) { + switch (dev->driver_info->family) { case KVASER_LEAF: kvaser_usb_leaf_get_software_info_leaf(dev, &cmd.u.leaf.softinfo); break; @@ -597,7 +597,7 @@ static int kvaser_usb_leaf_get_card_info =20 dev->nchannels =3D cmd.u.cardinfo.nchannels; if (dev->nchannels > KVASER_USB_MAX_NET_DEVICES || - (dev->card_data.leaf.family =3D=3D KVASER_USBCAN && + (dev->driver_info->family =3D=3D KVASER_USBCAN && dev->nchannels > MAX_USBCAN_NET_DEVICES)) return -EINVAL; =20 @@ -730,7 +730,7 @@ kvaser_usb_leaf_rx_error_update_can_stat new_state < CAN_STATE_BUS_OFF) priv->can.can_stats.restarts++; =20 - switch (dev->card_data.leaf.family) { + switch (dev->driver_info->family) { case KVASER_LEAF: if (es->leaf.error_factor) { priv->can.can_stats.bus_error++; @@ -809,7 +809,7 @@ static void kvaser_usb_leaf_rx_error(con } } =20 - switch (dev->card_data.leaf.family) { + switch (dev->driver_info->family) { case KVASER_LEAF: if (es->leaf.error_factor) { cf->can_id |=3D CAN_ERR_BUSERROR | CAN_ERR_PROT; @@ -999,7 +999,7 @@ static void kvaser_usb_leaf_rx_can_msg(c stats =3D &priv->netdev->stats; =20 if ((cmd->u.rx_can_header.flag & MSG_FLAG_ERROR_FRAME) && - (dev->card_data.leaf.family =3D=3D KVASER_LEAF && + (dev->driver_info->family =3D=3D KVASER_LEAF && cmd->id =3D=3D CMD_LEAF_LOG_MESSAGE)) { kvaser_usb_leaf_leaf_rx_error(dev, cmd); return; @@ -1015,7 +1015,7 @@ static void kvaser_usb_leaf_rx_can_msg(c return; } =20 - switch (dev->card_data.leaf.family) { + switch (dev->driver_info->family) { case KVASER_LEAF: rx_data =3D cmd->u.leaf.rx_can.data; break; @@ -1030,7 +1030,7 @@ static void kvaser_usb_leaf_rx_can_msg(c return; } =20 - if (dev->card_data.leaf.family =3D=3D KVASER_LEAF && cmd->id =3D=3D + if (dev->driver_info->family =3D=3D KVASER_LEAF && cmd->id =3D=3D CMD_LEAF_LOG_MESSAGE) { cf->can_id =3D le32_to_cpu(cmd->u.leaf.log_message.id); if (cf->can_id & KVASER_EXTENDED_FRAME) @@ -1128,14 +1128,14 @@ static void kvaser_usb_leaf_handle_comma break; =20 case CMD_LEAF_LOG_MESSAGE: - if (dev->card_data.leaf.family !=3D KVASER_LEAF) + if (dev->driver_info->family !=3D KVASER_LEAF) goto warn; kvaser_usb_leaf_rx_can_msg(dev, cmd); break; =20 case CMD_CHIP_STATE_EVENT: case CMD_CAN_ERROR_EVENT: - if (dev->card_data.leaf.family =3D=3D KVASER_LEAF) + if (dev->driver_info->family =3D=3D KVASER_LEAF) kvaser_usb_leaf_leaf_rx_error(dev, cmd); else kvaser_usb_leaf_usbcan_rx_error(dev, cmd); @@ -1147,12 +1147,12 @@ static void kvaser_usb_leaf_handle_comma =20 /* Ignored commands */ case CMD_USBCAN_CLOCK_OVERFLOW_EVENT: - if (dev->card_data.leaf.family !=3D KVASER_USBCAN) + if (dev->driver_info->family !=3D KVASER_USBCAN) goto warn; break; =20 case CMD_FLUSH_QUEUE_REPLY: - if (dev->card_data.leaf.family !=3D KVASER_LEAF) + if (dev->driver_info->family !=3D KVASER_LEAF) goto warn; break; From nobody Sat Apr 18 21:01:21 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 8A787C43334 for ; Mon, 11 Jul 2022 09:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbiGKJZn (ORCPT ); Mon, 11 Jul 2022 05:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232312AbiGKJY1 (ORCPT ); Mon, 11 Jul 2022 05:24:27 -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 4CCB731DD6; Mon, 11 Jul 2022 02:14: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 96861610A5; Mon, 11 Jul 2022 09:14:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A45ECC34115; Mon, 11 Jul 2022 09:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530862; bh=KjuQQVvvy/2MK2aBnoVMiXW2330YgfuGXKz1Nwiq64s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBlbHq4VoDRETbg/2/NHwlewakwAC+by4QELuqAUCQnUYu0BO0+iguLigSI2RrxtH IPC7x+GI9dfmYEeyemaG2wqH5bgX+8JpcBt2hf+YcvJ+sXzG/XNkcL60kp8Fk2zzCF KhBIfQaFBYsWgHFeUKoUcTv3LEgEEz3Mmt/cErL4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jimmy Assarsson , Marc Kleine-Budde Subject: [PATCH 5.18 011/112] can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression Date: Mon, 11 Jul 2022 11:06:11 +0200 Message-Id: <20220711090549.878870010@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Jimmy Assarsson commit e6c80e601053ffdac5709f11ff3ec1e19ed05f7b upstream. The firmware of M32C based Leaf devices expects bittiming parameters calculated for 16MHz clock. Since we use the actual clock frequency of the device, the device may end up with wrong bittiming parameters, depending on user requested parameters. This regression affects M32C based Leaf devices with non-16MHz clock. Fixes: fb12797ab1fe ("can: kvaser_usb: get CAN clock frequency from device") Link: https://lore.kernel.org/all/20220603083820.800246-3-extja@kvaser.com Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 1=20 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 33 ++++++++++++++----= ----- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 25 +++++++++++------ 3 files changed, 38 insertions(+), 21 deletions(-) --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb.h +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb.h @@ -38,6 +38,7 @@ /* Kvaser USB device quirks */ #define KVASER_USB_QUIRK_HAS_SILENT_MODE BIT(0) #define KVASER_USB_QUIRK_HAS_TXRX_ERRORS BIT(1) +#define KVASER_USB_QUIRK_IGNORE_CLK_FREQ BIT(2) =20 /* Device capabilities */ #define KVASER_USB_CAP_BERR_CAP 0x01 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c @@ -101,26 +101,33 @@ static const struct kvaser_usb_driver_in }; =20 static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf =3D= { - .quirks =3D 0, + .quirks =3D KVASER_USB_QUIRK_IGNORE_CLK_FREQ, .family =3D KVASER_LEAF, .ops =3D &kvaser_usb_leaf_dev_ops, }; =20 static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf_err= =3D { - .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS, + .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS | + KVASER_USB_QUIRK_IGNORE_CLK_FREQ, .family =3D KVASER_LEAF, .ops =3D &kvaser_usb_leaf_dev_ops, }; =20 static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf_err= _listen =3D { .quirks =3D KVASER_USB_QUIRK_HAS_TXRX_ERRORS | - KVASER_USB_QUIRK_HAS_SILENT_MODE, + KVASER_USB_QUIRK_HAS_SILENT_MODE | + KVASER_USB_QUIRK_IGNORE_CLK_FREQ, .family =3D KVASER_LEAF, .ops =3D &kvaser_usb_leaf_dev_ops, }; =20 +static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leafimx = =3D { + .quirks =3D 0, + .ops =3D &kvaser_usb_leaf_dev_ops, +}; + static const struct usb_device_id kvaser_usb_table[] =3D { - /* Leaf USB product IDs */ + /* Leaf M32C USB product IDs */ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_DEVEL_PRODUCT_ID), .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_PRODUCT_ID), @@ -161,22 +168,24 @@ static const struct usb_device_id kvaser .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, { USB_DEVICE(KVASER_VENDOR_ID, USB_CAN_R_PRODUCT_ID), .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf_err }, + + /* Leaf i.MX28 USB product IDs */ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_V2_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_HS_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_LIGHT_2HS_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_MINI_PCIE_2HS_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_R_V2_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_R_V2_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LIGHT_HS_V2_OEM2_PRODUCT_ID), - .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leaf }, + .driver_info =3D (kernel_ulong_t)&kvaser_usb_driver_info_leafimx }, =20 /* USBCANII USB product IDs */ { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN2_PRODUCT_ID), --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -524,16 +524,23 @@ static void kvaser_usb_leaf_get_software dev->fw_version =3D le32_to_cpu(softinfo->fw_version); dev->max_tx_urbs =3D le16_to_cpu(softinfo->max_outstanding_tx); =20 - switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) { - case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK: + if (dev->driver_info->quirks & KVASER_USB_QUIRK_IGNORE_CLK_FREQ) { + /* Firmware expects bittiming parameters calculated for 16MHz + * clock, regardless of the actual clock + */ dev->cfg =3D &kvaser_usb_leaf_dev_cfg_16mhz; - break; - case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK: - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_24mhz; - break; - case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK: - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_32mhz; - break; + } else { + switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) { + case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK: + dev->cfg =3D &kvaser_usb_leaf_dev_cfg_16mhz; + break; + case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK: + dev->cfg =3D &kvaser_usb_leaf_dev_cfg_24mhz; + break; + case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK: + dev->cfg =3D &kvaser_usb_leaf_dev_cfg_32mhz; + break; + } } } From nobody Sat Apr 18 21:01:21 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 002B4C43334 for ; Mon, 11 Jul 2022 09:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbiGKJZs (ORCPT ); Mon, 11 Jul 2022 05:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbiGKJY2 (ORCPT ); Mon, 11 Jul 2022 05:24: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 BFB5824083; Mon, 11 Jul 2022 02:14:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6046D610A5; Mon, 11 Jul 2022 09:14:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C1B6C34115; Mon, 11 Jul 2022 09:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530864; bh=9zKcRDvGIukSaPf02jvVXm9S3PuGQlxAdfdoIRhT27s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U70CsmGE2IJ+N0fdK2mxge3oxGMWkjWaR10Hr5thNTy9+vNCBnnoSL8LqcsYd1UwW wAnRUQocAXphr9Z5IWo5L+kHSDlaby2XPU27MLyrK2+fnPV9Q6i0m9XyWdQa5AXJUP FTn/3Q0zzqz9yIJfr+oU/YucPCeEu4HN3kTFwCBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jimmy Assarsson , Marc Kleine-Budde Subject: [PATCH 5.18 012/112] can: kvaser_usb: kvaser_usb_leaf: fix bittiming limits Date: Mon, 11 Jul 2022 11:06:12 +0200 Message-Id: <20220711090549.907064955@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Jimmy Assarsson commit b3b6df2c56d80b8c6740433cff5f016668b8de70 upstream. Use correct bittiming limits depending on device. For devices based on USBcanII, Leaf M32C or Leaf i.MX28. Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devic= es") Fixes: b4f20130af23 ("can: kvaser_usb: add support for Kvaser Leaf v2 and u= sb mini PCIe") Fixes: f5d4abea3ce0 ("can: kvaser_usb: Add support for the USBcan-II family= ") Link: https://lore.kernel.org/all/20220603083820.800246-4-extja@kvaser.com Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson [mkl: remove stray netlink.h include] [mkl: keep struct can_bittiming_const kvaser_usb_flexc_bittiming_const in k= vaser_usb_hydra.c] Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 2=20 drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 4 - drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 76 ++++++++++++-----= ----- 3 files changed, 47 insertions(+), 35 deletions(-) --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb.h +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb.h @@ -187,4 +187,6 @@ int kvaser_usb_send_cmd_async(struct kva =20 int kvaser_usb_can_rx_over_error(struct net_device *netdev); =20 +extern const struct can_bittiming_const kvaser_usb_flexc_bittiming_const; + #endif /* KVASER_USB_H */ --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -375,7 +375,7 @@ static const struct can_bittiming_const .brp_inc =3D 1, }; =20 -static const struct can_bittiming_const kvaser_usb_hydra_flexc_bittiming_c= =3D { +const struct can_bittiming_const kvaser_usb_flexc_bittiming_const =3D { .name =3D "kvaser_usb_flex", .tseg1_min =3D 4, .tseg1_max =3D 16, @@ -2052,7 +2052,7 @@ static const struct kvaser_usb_dev_cfg k .freq =3D 24 * MEGA /* Hz */, }, .timestamp_freq =3D 1, - .bittiming_const =3D &kvaser_usb_hydra_flexc_bittiming_c, + .bittiming_const =3D &kvaser_usb_flexc_bittiming_const, }; =20 static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_rt =3D { --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -101,16 +101,6 @@ #define USBCAN_ERROR_STATE_RX_ERROR BIT(1) #define USBCAN_ERROR_STATE_BUSERROR BIT(2) =20 -/* bittiming parameters */ -#define KVASER_USB_TSEG1_MIN 1 -#define KVASER_USB_TSEG1_MAX 16 -#define KVASER_USB_TSEG2_MIN 1 -#define KVASER_USB_TSEG2_MAX 8 -#define KVASER_USB_SJW_MAX 4 -#define KVASER_USB_BRP_MIN 1 -#define KVASER_USB_BRP_MAX 64 -#define KVASER_USB_BRP_INC 1 - /* ctrl modes */ #define KVASER_CTRL_MODE_NORMAL 1 #define KVASER_CTRL_MODE_SILENT 2 @@ -343,48 +333,68 @@ struct kvaser_usb_err_summary { }; }; =20 -static const struct can_bittiming_const kvaser_usb_leaf_bittiming_const = =3D { - .name =3D "kvaser_usb", - .tseg1_min =3D KVASER_USB_TSEG1_MIN, - .tseg1_max =3D KVASER_USB_TSEG1_MAX, - .tseg2_min =3D KVASER_USB_TSEG2_MIN, - .tseg2_max =3D KVASER_USB_TSEG2_MAX, - .sjw_max =3D KVASER_USB_SJW_MAX, - .brp_min =3D KVASER_USB_BRP_MIN, - .brp_max =3D KVASER_USB_BRP_MAX, - .brp_inc =3D KVASER_USB_BRP_INC, +static const struct can_bittiming_const kvaser_usb_leaf_m16c_bittiming_con= st =3D { + .name =3D "kvaser_usb_ucii", + .tseg1_min =3D 4, + .tseg1_max =3D 16, + .tseg2_min =3D 2, + .tseg2_max =3D 8, + .sjw_max =3D 4, + .brp_min =3D 1, + .brp_max =3D 16, + .brp_inc =3D 1, +}; + +static const struct can_bittiming_const kvaser_usb_leaf_m32c_bittiming_con= st =3D { + .name =3D "kvaser_usb_leaf", + .tseg1_min =3D 3, + .tseg1_max =3D 16, + .tseg2_min =3D 2, + .tseg2_max =3D 8, + .sjw_max =3D 4, + .brp_min =3D 2, + .brp_max =3D 128, + .brp_inc =3D 2, }; =20 -static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_8mhz =3D { +static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_usbcan_dev_cfg =3D { .clock =3D { .freq =3D 8 * MEGA /* Hz */, }, .timestamp_freq =3D 1, - .bittiming_const =3D &kvaser_usb_leaf_bittiming_const, + .bittiming_const =3D &kvaser_usb_leaf_m16c_bittiming_const, +}; + +static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_m32c_dev_cfg =3D { + .clock =3D { + .freq =3D 16 * MEGA /* Hz */, + }, + .timestamp_freq =3D 1, + .bittiming_const =3D &kvaser_usb_leaf_m32c_bittiming_const, }; =20 -static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_16mhz =3D { +static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_imx_dev_cfg_16mhz = =3D { .clock =3D { .freq =3D 16 * MEGA /* Hz */, }, .timestamp_freq =3D 1, - .bittiming_const =3D &kvaser_usb_leaf_bittiming_const, + .bittiming_const =3D &kvaser_usb_flexc_bittiming_const, }; =20 -static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_24mhz =3D { +static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_imx_dev_cfg_24mhz = =3D { .clock =3D { .freq =3D 24 * MEGA /* Hz */, }, .timestamp_freq =3D 1, - .bittiming_const =3D &kvaser_usb_leaf_bittiming_const, + .bittiming_const =3D &kvaser_usb_flexc_bittiming_const, }; =20 -static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_32mhz =3D { +static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_imx_dev_cfg_32mhz = =3D { .clock =3D { .freq =3D 32 * MEGA /* Hz */, }, .timestamp_freq =3D 1, - .bittiming_const =3D &kvaser_usb_leaf_bittiming_const, + .bittiming_const =3D &kvaser_usb_flexc_bittiming_const, }; =20 static void * @@ -528,17 +538,17 @@ static void kvaser_usb_leaf_get_software /* Firmware expects bittiming parameters calculated for 16MHz * clock, regardless of the actual clock */ - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_16mhz; + dev->cfg =3D &kvaser_usb_leaf_m32c_dev_cfg; } else { switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) { case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK: - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_16mhz; + dev->cfg =3D &kvaser_usb_leaf_imx_dev_cfg_16mhz; break; case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK: - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_24mhz; + dev->cfg =3D &kvaser_usb_leaf_imx_dev_cfg_24mhz; break; case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK: - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_32mhz; + dev->cfg =3D &kvaser_usb_leaf_imx_dev_cfg_32mhz; break; } } @@ -565,7 +575,7 @@ static int kvaser_usb_leaf_get_software_ dev->fw_version =3D le32_to_cpu(cmd.u.usbcan.softinfo.fw_version); dev->max_tx_urbs =3D le16_to_cpu(cmd.u.usbcan.softinfo.max_outstanding_tx); - dev->cfg =3D &kvaser_usb_leaf_dev_cfg_8mhz; + dev->cfg =3D &kvaser_usb_leaf_usbcan_dev_cfg; break; } From nobody Sat Apr 18 21:01:21 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 CCDEBC43334 for ; Mon, 11 Jul 2022 09:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232233AbiGKJZ5 (ORCPT ); Mon, 11 Jul 2022 05:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232326AbiGKJY2 (ORCPT ); Mon, 11 Jul 2022 05:24:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3690E28701; Mon, 11 Jul 2022 02:14: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 D6208B80CEF; Mon, 11 Jul 2022 09:14:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39C5BC34115; Mon, 11 Jul 2022 09:14:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530867; bh=md5Iwx5idA89husX/GHelj2HKMmJ5QIfXFbbhQRgCII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A4z3PlloF/0/XYClrygbl8Yw8WsuzNjrngy23x0qG5HOg16WVjagPc3JkP59JJG/4 xzfXHZFvUp/H7BtVvT8WOhi9LOE9vPzCO16VT4GPqRLuXdyZYRWrAuFpcHYMtv9AI/ xtjypcEWdPw2wqKWdPXHzXYK/+hL4bU52jV7aqrs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Modilaynen , Thomas Kopp , Marc Kleine-Budde Subject: [PATCH 5.18 013/112] can: mcp251xfd: mcp251xfd_regmap_crc_read(): improve workaround handling for mcp2517fd Date: Mon, 11 Jul 2022 11:06:13 +0200 Message-Id: <20220711090549.934935044@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Thomas Kopp commit 406cc9cdb3e8d644b15e8028948f091b82abdbca upstream. The mcp251xfd compatible chips have an erratum ([1], [2]), where the received CRC doesn't match the calculated CRC. In commit c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") the following workaround was implementierend. - If a CRC read error on the TBC register is detected and the first byte is 0x00 or 0x80, the most significant bit of the first byte is flipped and the CRC is calculated again. - If the CRC now matches, the _original_ data is passed to the reader. For now we assume transferred data was OK. Measurements on the mcp2517fd show that the workaround is applicable not only of the lowest byte is 0x00 or 0x80, but also if 3 least significant bits are set. Update check on 1st data byte and workaround description accordingly. [1] mcp2517fd: DS80000792C: "Incorrect CRC for certain READ_CRC commands" [2] mcp2518fd: DS80000789C: "Incorrect CRC for certain READ_CRC commands" Link: https://lore.kernel.org/all/DM4PR11MB53901D49578FE265B239E55AFB7C9@DM= 4PR11MB5390.namprd11.prod.outlook.com Fixes: c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work aro= und broken CRC on TBC register") Cc: stable@vger.kernel.org Reported-by: Pavel Modilaynen Signed-off-by: Thomas Kopp [mkl: split into 2 patches, update patch description and documentation] Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c @@ -334,10 +334,12 @@ mcp251xfd_regmap_crc_read(void *context, * register. It increments once per SYS clock tick, * which is 20 or 40 MHz. * - * Observation shows that if the lowest byte (which is - * transferred first on the SPI bus) of that register - * is 0x00 or 0x80 the calculated CRC doesn't always - * match the transferred one. + * Observation on the mcp2518fd shows that if the + * lowest byte (which is transferred first on the SPI + * bus) of that register is 0x00 or 0x80 the + * calculated CRC doesn't always match the transferred + * one. On the mcp2517fd this problem is not limited + * to the first byte being 0x00 or 0x80. * * If the highest bit in the lowest byte is flipped * the transferred CRC matches the calculated one. We @@ -346,7 +348,8 @@ mcp251xfd_regmap_crc_read(void *context, * correct. */ if (reg =3D=3D MCP251XFD_REG_TBC && - (buf_rx->data[0] =3D=3D 0x0 || buf_rx->data[0] =3D=3D 0x80)) { + ((buf_rx->data[0] & 0xf8) =3D=3D 0x0 || + (buf_rx->data[0] & 0xf8) =3D=3D 0x80)) { /* Flip highest bit in lowest byte of le32 */ buf_rx->data[0] ^=3D 0x80; From nobody Sat Apr 18 21:01:21 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 A673FC433EF for ; Mon, 11 Jul 2022 09:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232261AbiGKJ0E (ORCPT ); Mon, 11 Jul 2022 05:26:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232334AbiGKJYa (ORCPT ); Mon, 11 Jul 2022 05:24:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3B7240B8; Mon, 11 Jul 2022 02:14: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 sin.source.kernel.org (Postfix) with ESMTPS id 1969CCE1259; Mon, 11 Jul 2022 09:14:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0A78C34115; Mon, 11 Jul 2022 09:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530870; bh=TRtp90YBaVG03YygRHmLfEk23dEDAC+1e/I54l6MBK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xAKViFAe3ccsJ0IfM7Aqkor+bOR0L63uoStpXfNM2vao5MsB473nk0daYxLr0LwWl yKK41+SvQtxlxcI0mSM9RmjFdUnhUoRu3VXZRpIFTWZzPtT1suZStsmbVCHNbYo9q6 zzgYgmVWFBkAR4mnCjxuTaFknb6Nfx4ELiW8Gka0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Kopp , Marc Kleine-Budde Subject: [PATCH 5.18 014/112] can: mcp251xfd: mcp251xfd_regmap_crc_read(): update workaround broken CRC on TBC register Date: Mon, 11 Jul 2022 11:06:14 +0200 Message-Id: <20220711090549.963890864@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Thomas Kopp commit e3d4ee7d5f7f5256dfe89219afcc7a2d553b731f upstream. The mcp251xfd compatible chips have an erratum ([1], [2]), where the received CRC doesn't match the calculated CRC. In commit c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") the following workaround was implementierend. - If a CRC read error on the TBC register is detected and the first byte is 0x00 or 0x80, the most significant bit of the first byte is flipped and the CRC is calculated again. - If the CRC now matches, the _original_ data is passed to the reader. For now we assume transferred data was OK. New investigations and simulations indicate that the CRC send by the device is calculated on correct data, and the data is incorrectly received by the SPI host controller. Use flipped instead of original data and update workaround description in mcp251xfd_regmap_crc_read(). [1] mcp2517fd: DS80000792C: "Incorrect CRC for certain READ_CRC commands" [2] mcp2518fd: DS80000789C: "Incorrect CRC for certain READ_CRC commands" Link: https://lore.kernel.org/all/DM4PR11MB53901D49578FE265B239E55AFB7C9@DM= 4PR11MB5390.namprd11.prod.outlook.com Fixes: c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work aro= und broken CRC on TBC register") Cc: stable@vger.kernel.org Signed-off-by: Thomas Kopp [mkl: split into 2 patches, update patch description and documentation] Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c @@ -343,9 +343,8 @@ mcp251xfd_regmap_crc_read(void *context, * * If the highest bit in the lowest byte is flipped * the transferred CRC matches the calculated one. We - * assume for now the CRC calculation in the chip - * works on wrong data and the transferred data is - * correct. + * assume for now the CRC operates on the correct + * data. */ if (reg =3D=3D MCP251XFD_REG_TBC && ((buf_rx->data[0] & 0xf8) =3D=3D 0x0 || @@ -359,10 +358,8 @@ mcp251xfd_regmap_crc_read(void *context, val_len); if (!err) { /* If CRC is now correct, assume - * transferred data was OK, flip bit - * back to original value. + * flipped data is OK. */ - buf_rx->data[0] ^=3D 0x80; goto out; } } From nobody Sat Apr 18 21:01:21 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 034C4C433EF for ; Mon, 11 Jul 2022 09:25:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232223AbiGKJZx (ORCPT ); Mon, 11 Jul 2022 05:25:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232332AbiGKJYa (ORCPT ); Mon, 11 Jul 2022 05:24:30 -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 F3B9E286F7; Mon, 11 Jul 2022 02:14: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 dfw.source.kernel.org (Postfix) with ESMTPS id 92F6A6115B; Mon, 11 Jul 2022 09:14:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B407C34115; Mon, 11 Jul 2022 09:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530873; bh=sp7b6ESRpulFFd9mvznL9RA2PFRIIr/6Tdch+jz+hkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AVSpHnx+kKupwjnSL2bXMEwHF8ANgOnOiUobf8OhUrKrs9GXlK3mF76Z0oYQHsHxO Iuy5eFx1kX8Y9KCbCFkV3gV40lEOmhtrR+pwKnMAsr7k/T5Cw307kJL5aL6YmS2V34 pH107yctn4tIDrKOxDHJcqxOAzKkwUzIBzXRrwEM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manivannan Sadhasivam , Marc Kleine-Budde Subject: [PATCH 5.18 015/112] can: mcp251xfd: mcp251xfd_stop(): add missing hrtimer_cancel() Date: Mon, 11 Jul 2022 11:06:15 +0200 Message-Id: <20220711090549.991364775@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Marc Kleine-Budde commit d5a972f561a003e302e4267340c57e8fbd096fa4 upstream. In commit 169d00a25658 ("can: mcp251xfd: add TX IRQ coalescing support") software based TX coalescing was added to the driver. The key idea is to keep the TX complete IRQ disabled for some time after processing it and re-enable later by a hrtimer. When bringing the interface down, this timer has to be stopped. Add the missing hrtimer_cancel() of the tx_irq_time hrtimer to mcp251xfd_stop(). Link: https://lore.kernel.org/all/20220620143942.891811-1-mkl@pengutronix.de Fixes: 169d00a25658 ("can: mcp251xfd: add TX IRQ coalescing support") Cc: stable@vger.kernel.org # v5.18 Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -1641,6 +1641,7 @@ static int mcp251xfd_stop(struct net_dev netif_stop_queue(ndev); set_bit(MCP251XFD_FLAGS_DOWN, priv->flags); hrtimer_cancel(&priv->rx_irq_timer); + hrtimer_cancel(&priv->tx_irq_timer); mcp251xfd_chip_interrupts_disable(priv); free_irq(ndev->irq, priv); can_rx_offload_disable(&priv->offload); From nobody Sat Apr 18 21:01:21 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 53C20C43334 for ; Mon, 11 Jul 2022 09:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbiGKJZ7 (ORCPT ); Mon, 11 Jul 2022 05:25:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232342AbiGKJYb (ORCPT ); Mon, 11 Jul 2022 05:24:31 -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 6B001248C3; Mon, 11 Jul 2022 02:14:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0F340B80CEF; Mon, 11 Jul 2022 09:14:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6943EC34115; Mon, 11 Jul 2022 09:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530875; bh=jB0H8cSNf+eVpBWlZgcCCXpWZ7iENjkNJUguFijwHjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z45c/kQsmngOX7VXe4pGcuB4+JXF2uXqS7DGdB6iXknB+tqErw31qfVsxCtzJwhiC jHUP5UMzzfQidaSDljSIqSHI1Wd/QKVinb5Vn1r8p1X97lg5YkFHV3q0aaauiazqL9 U9aIOzEy9o15AIVXAXMiN5tWXg9U2ZHS34Jc7e0k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuee K1r0a , Daniel Borkmann , Andrii Nakryiko , John Fastabend Subject: [PATCH 5.18 016/112] bpf: Fix incorrect verifier simulation around jmp32s jeq/jne Date: Mon, 11 Jul 2022 11:06:16 +0200 Message-Id: <20220711090550.020730354@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Daniel Borkmann commit a12ca6277eca6aeeccf66e840c23a2b520e24c8f upstream. Kuee reported a quirk in the jmp32's jeq/jne simulation, namely that the register value does not match expectations for the fall-through path. For example: Before fix: 0: R1=3Dctx(off=3D0,imm=3D0) R10=3Dfp0 0: (b7) r2 =3D 0 ; R2_w=3DP0 1: (b7) r6 =3D 563 ; R6_w=3DP563 2: (87) r2 =3D -r2 ; R2_w=3DPscalar() 3: (87) r2 =3D -r2 ; R2_w=3DPscalar() 4: (4c) w2 |=3D w6 ; R2_w=3DPscalar(umin=3D563,umax= =3D4294967295,var_off=3D(0x233; 0xfffffdcc),s32_min=3D-2147483085) R6_w=3DP= 563 5: (56) if w2 !=3D 0x8 goto pc+1 ; R2_w=3DP571 <--- [*] 6: (95) exit R0 !read_ok After fix: 0: R1=3Dctx(off=3D0,imm=3D0) R10=3Dfp0 0: (b7) r2 =3D 0 ; R2_w=3DP0 1: (b7) r6 =3D 563 ; R6_w=3DP563 2: (87) r2 =3D -r2 ; R2_w=3DPscalar() 3: (87) r2 =3D -r2 ; R2_w=3DPscalar() 4: (4c) w2 |=3D w6 ; R2_w=3DPscalar(umin=3D563,umax= =3D4294967295,var_off=3D(0x233; 0xfffffdcc),s32_min=3D-2147483085) R6_w=3DP= 563 5: (56) if w2 !=3D 0x8 goto pc+1 ; R2_w=3DP8 <--- [*] 6: (95) exit R0 !read_ok As can be seen on line 5 for the branch fall-through path in R2 [*] is that given condition w2 !=3D 0x8 is false, verifier should conclude that r2 =3D = 8 as upper 32 bit are known to be zero. However, verifier incorrectly concludes that r2 =3D 571 which is far off. The problem is it only marks false{true}_reg as known in the switch for JE/= NE case, but at the end of the function, it uses {false,true}_{64,32}off to update {false,true}_reg->var_off and they still hold the prior value of {false,true}_reg->var_off before it got marked as known. The subsequent __reg_combine_32_into_64() then propagates this old var_off and derives new bounds. The information between min/max bounds on {false,true}_reg from setting the register to known const combined with the {false,true}_reg->var= _off based on the old information then derives wrong register data. Fix it by detangling the BPF_JEQ/BPF_JNE cases and updating relevant {false,true}_{64,32}off tnums along with the register marking to known constant. Fixes: 3f50f132d840 ("bpf: Verifier, do explicit ALU32 bounds tracking") Reported-by: Kuee K1r0a Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220701124727.11153-1-daniel@iogearbox.n= et Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- kernel/bpf/verifier.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -9068,26 +9068,33 @@ static void reg_set_min_max(struct bpf_r return; =20 switch (opcode) { + /* JEQ/JNE comparison doesn't change the register equivalence. + * + * r1 =3D r2; + * if (r1 =3D=3D 42) goto label; + * ... + * label: // here both r1 and r2 are known to be 42. + * + * Hence when marking register as known preserve it's ID. + */ case BPF_JEQ: + if (is_jmp32) { + __mark_reg32_known(true_reg, val32); + true_32off =3D tnum_subreg(true_reg->var_off); + } else { + ___mark_reg_known(true_reg, val); + true_64off =3D true_reg->var_off; + } + break; case BPF_JNE: - { - struct bpf_reg_state *reg =3D - opcode =3D=3D BPF_JEQ ? true_reg : false_reg; - - /* JEQ/JNE comparison doesn't change the register equivalence. - * r1 =3D r2; - * if (r1 =3D=3D 42) goto label; - * ... - * label: // here both r1 and r2 are known to be 42. - * - * Hence when marking register as known preserve it's ID. - */ - if (is_jmp32) - __mark_reg32_known(reg, val32); - else - ___mark_reg_known(reg, val); + if (is_jmp32) { + __mark_reg32_known(false_reg, val32); + false_32off =3D tnum_subreg(false_reg->var_off); + } else { + ___mark_reg_known(false_reg, val); + false_64off =3D false_reg->var_off; + } break; - } case BPF_JSET: if (is_jmp32) { false_32off =3D tnum_and(false_32off, tnum_const(~val32)); From nobody Sat Apr 18 21:01:21 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 DCAD6C43334 for ; Mon, 11 Jul 2022 09:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232282AbiGKJ0M (ORCPT ); Mon, 11 Jul 2022 05:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbiGKJYb (ORCPT ); Mon, 11 Jul 2022 05:24:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6C123150; Mon, 11 Jul 2022 02:14: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 1DEE8610A5; Mon, 11 Jul 2022 09:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B2E2C34115; Mon, 11 Jul 2022 09:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530878; bh=5D836XQBOGnEC4gj8gALZ38OdTXjtmvc8NRllUhKRfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GhGveSKxqYVrVCCVlXCVok+w/imsSRJ73vgp51UTf6oc76jaaNVF20sNv/sIETpbW BjkVPLClDgmCEv/tloDxKfB45MYusEn9Kpf2M4NmpJBhV6WUPELVqx3ygKTsFy+dId KouhCG7FFsecDv5+4twy96qLSD0Tu8mDgwK8cBRc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuee K1r0a , Daniel Borkmann , Andrii Nakryiko , John Fastabend Subject: [PATCH 5.18 017/112] bpf: Fix insufficient bounds propagation from adjust_scalar_min_max_vals Date: Mon, 11 Jul 2022 11:06:17 +0200 Message-Id: <20220711090550.048634501@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Daniel Borkmann commit 3844d153a41adea718202c10ae91dc96b37453b5 upstream. Kuee reported a corner case where the tnum becomes constant after the call to __reg_bound_offset(), but the register's bounds are not, that is, its min bounds are still not equal to the register's max bounds. This in turn allows to leak pointers through turning a pointer register as is into an unknown scalar via adjust_ptr_min_max_vals(). Before: func#0 @0 0: R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R10=3Dfp(off= =3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) 0: (b7) r0 =3D 1 ; R0_w=3Dscalar(imm=3D1,umin=3D1,= umax=3D1,var_off=3D(0x1; 0x0)) 1: (b7) r3 =3D 0 ; R3_w=3Dscalar(imm=3D0,umax=3D0,= var_off=3D(0x0; 0x0)) 2: (87) r3 =3D -r3 ; R3_w=3Dscalar() 3: (87) r3 =3D -r3 ; R3_w=3Dscalar() 4: (47) r3 |=3D 32767 ; R3_w=3Dscalar(smin=3D-922337203= 6854743041,umin=3D32767,var_off=3D(0x7fff; 0xffffffffffff8000),s32_min=3D-2= 147450881) 5: (75) if r3 s>=3D 0x0 goto pc+1 ; R3_w=3Dscalar(umin=3D9223372036= 854808575,var_off=3D(0x8000000000007fff; 0x7fffffffffff8000),s32_min=3D-214= 7450881,u32_min=3D32767) 6: (95) exit from 5 to 7: R0=3Dscalar(imm=3D1,umin=3D1,umax=3D1,var_off=3D(0x1; 0x0)) = R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R3=3Dscalar(umin=3D= 32767,umax=3D9223372036854775807,var_off=3D(0x7fff; 0x7fffffffffff8000),s32= _min=3D-2147450881) R10=3Dfp(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) 7: (d5) if r3 s<=3D 0x8000 goto pc+1 ; R3=3Dscalar(umin=3D32769,umax= =3D9223372036854775807,var_off=3D(0x7fff; 0x7fffffffffff8000),s32_min=3D-21= 47450881,u32_min=3D32767) 8: (95) exit from 7 to 9: R0=3Dscalar(imm=3D1,umin=3D1,umax=3D1,var_off=3D(0x1; 0x0)) = R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R3=3Dscalar(umin=3D= 32767,umax=3D32768,var_off=3D(0x7fff; 0x8000)) R10=3Dfp(off=3D0,imm=3D0,uma= x=3D0,var_off=3D(0x0; 0x0)) 9: (07) r3 +=3D -32767 ; R3_w=3Dscalar(imm=3D0,umax=3D1,= var_off=3D(0x0; 0x0)) <--- [*] 10: (95) exit What can be seen here is that R3=3Dscalar(umin=3D32767,umax=3D32768,var_off= =3D(0x7fff; 0x8000)) after the operation R3 +=3D -32767 results in a 'malformed' consta= nt, that is, R3_w=3Dscalar(imm=3D0,umax=3D1,var_off=3D(0x0; 0x0)). Intersecting with= var_off has not been done at that point via __update_reg_bounds(), which would have imp= roved the umax to be equal to umin. Refactor the tnum <> min/max bounds information flow into a reg_bounds_sync= () helper and use it consistently everywhere. After the fix, bounds have been corrected to R3_w=3Dscalar(imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) and thus = the register is regarded as a 'proper' constant scalar of 0. After: func#0 @0 0: R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R10=3Dfp(off= =3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) 0: (b7) r0 =3D 1 ; R0_w=3Dscalar(imm=3D1,umin=3D1,= umax=3D1,var_off=3D(0x1; 0x0)) 1: (b7) r3 =3D 0 ; R3_w=3Dscalar(imm=3D0,umax=3D0,= var_off=3D(0x0; 0x0)) 2: (87) r3 =3D -r3 ; R3_w=3Dscalar() 3: (87) r3 =3D -r3 ; R3_w=3Dscalar() 4: (47) r3 |=3D 32767 ; R3_w=3Dscalar(smin=3D-922337203= 6854743041,umin=3D32767,var_off=3D(0x7fff; 0xffffffffffff8000),s32_min=3D-2= 147450881) 5: (75) if r3 s>=3D 0x0 goto pc+1 ; R3_w=3Dscalar(umin=3D9223372036= 854808575,var_off=3D(0x8000000000007fff; 0x7fffffffffff8000),s32_min=3D-214= 7450881,u32_min=3D32767) 6: (95) exit from 5 to 7: R0=3Dscalar(imm=3D1,umin=3D1,umax=3D1,var_off=3D(0x1; 0x0)) = R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R3=3Dscalar(umin=3D= 32767,umax=3D9223372036854775807,var_off=3D(0x7fff; 0x7fffffffffff8000),s32= _min=3D-2147450881) R10=3Dfp(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) 7: (d5) if r3 s<=3D 0x8000 goto pc+1 ; R3=3Dscalar(umin=3D32769,umax= =3D9223372036854775807,var_off=3D(0x7fff; 0x7fffffffffff8000),s32_min=3D-21= 47450881,u32_min=3D32767) 8: (95) exit from 7 to 9: R0=3Dscalar(imm=3D1,umin=3D1,umax=3D1,var_off=3D(0x1; 0x0)) = R1=3Dctx(off=3D0,imm=3D0,umax=3D0,var_off=3D(0x0; 0x0)) R3=3Dscalar(umin=3D= 32767,umax=3D32768,var_off=3D(0x7fff; 0x8000)) R10=3Dfp(off=3D0,imm=3D0,uma= x=3D0,var_off=3D(0x0; 0x0)) 9: (07) r3 +=3D -32767 ; R3_w=3Dscalar(imm=3D0,umax=3D0,= var_off=3D(0x0; 0x0)) <--- [*] 10: (95) exit Fixes: b03c9f9fdc37 ("bpf/verifier: track signed and unsigned min/max value= s") Reported-by: Kuee K1r0a Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220701124727.11153-2-daniel@iogearbox.n= et Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- kernel/bpf/verifier.c | 72 +++++++++++++++------------------------------= ----- 1 file changed, 23 insertions(+), 49 deletions(-) --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1417,6 +1417,21 @@ static void __reg_bound_offset(struct bp reg->var_off =3D tnum_or(tnum_clear_subreg(var64_off), var32_off); } =20 +static void reg_bounds_sync(struct bpf_reg_state *reg) +{ + /* We might have learned new bounds from the var_off. */ + __update_reg_bounds(reg); + /* We might have learned something about the sign bit. */ + __reg_deduce_bounds(reg); + /* We might have learned some bits from the bounds. */ + __reg_bound_offset(reg); + /* Intersecting with the old var_off might have improved our bounds + * slightly, e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), + * then new var_off is (0; 0x7f...fc) which improves our umax. + */ + __update_reg_bounds(reg); +} + static bool __reg32_bound_s64(s32 a) { return a >=3D 0 && a <=3D S32_MAX; @@ -1458,16 +1473,8 @@ static void __reg_combine_32_into_64(str * so they do not impact tnum bounds calculation. */ __mark_reg64_unbounded(reg); - __update_reg_bounds(reg); } - - /* Intersecting with the old var_off might have improved our bounds - * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), - * then new var_off is (0; 0x7f...fc) which improves our umax. - */ - __reg_deduce_bounds(reg); - __reg_bound_offset(reg); - __update_reg_bounds(reg); + reg_bounds_sync(reg); } =20 static bool __reg64_bound_s32(s64 a) @@ -1483,7 +1490,6 @@ static bool __reg64_bound_u32(u64 a) static void __reg_combine_64_into_32(struct bpf_reg_state *reg) { __mark_reg32_unbounded(reg); - if (__reg64_bound_s32(reg->smin_value) && __reg64_bound_s32(reg->smax_val= ue)) { reg->s32_min_value =3D (s32)reg->smin_value; reg->s32_max_value =3D (s32)reg->smax_value; @@ -1492,14 +1498,7 @@ static void __reg_combine_64_into_32(str reg->u32_min_value =3D (u32)reg->umin_value; reg->u32_max_value =3D (u32)reg->umax_value; } - - /* Intersecting with the old var_off might have improved our bounds - * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), - * then new var_off is (0; 0x7f...fc) which improves our umax. - */ - __reg_deduce_bounds(reg); - __reg_bound_offset(reg); - __update_reg_bounds(reg); + reg_bounds_sync(reg); } =20 /* Mark a register as having a completely unknown (scalar) value. */ @@ -6485,9 +6484,7 @@ static void do_refine_retval_range(struc ret_reg->s32_max_value =3D meta->msize_max_value; ret_reg->smin_value =3D -MAX_ERRNO; ret_reg->s32_min_value =3D -MAX_ERRNO; - __reg_deduce_bounds(ret_reg); - __reg_bound_offset(ret_reg); - __update_reg_bounds(ret_reg); + reg_bounds_sync(ret_reg); } =20 static int @@ -7693,11 +7690,7 @@ static int adjust_ptr_min_max_vals(struc =20 if (!check_reg_sane_offset(env, dst_reg, ptr_reg->type)) return -EINVAL; - - __update_reg_bounds(dst_reg); - __reg_deduce_bounds(dst_reg); - __reg_bound_offset(dst_reg); - + reg_bounds_sync(dst_reg); if (sanitize_check_bounds(env, insn, dst_reg) < 0) return -EACCES; if (sanitize_needed(opcode)) { @@ -8435,10 +8428,7 @@ static int adjust_scalar_min_max_vals(st /* ALU32 ops are zero extended into 64bit register */ if (alu32) zext_32_to_64(dst_reg); - - __update_reg_bounds(dst_reg); - __reg_deduce_bounds(dst_reg); - __reg_bound_offset(dst_reg); + reg_bounds_sync(dst_reg); return 0; } =20 @@ -8627,10 +8617,7 @@ static int check_alu_op(struct bpf_verif insn->dst_reg); } zext_32_to_64(dst_reg); - - __update_reg_bounds(dst_reg); - __reg_deduce_bounds(dst_reg); - __reg_bound_offset(dst_reg); + reg_bounds_sync(dst_reg); } } else { /* case: R =3D imm @@ -9233,21 +9220,8 @@ static void __reg_combine_min_max(struct dst_reg->smax_value); src_reg->var_off =3D dst_reg->var_off =3D tnum_intersect(src_reg->var_off, dst_reg->var_off); - /* We might have learned new bounds from the var_off. */ - __update_reg_bounds(src_reg); - __update_reg_bounds(dst_reg); - /* We might have learned something about the sign bit. */ - __reg_deduce_bounds(src_reg); - __reg_deduce_bounds(dst_reg); - /* We might have learned some bits from the bounds. */ - __reg_bound_offset(src_reg); - __reg_bound_offset(dst_reg); - /* Intersecting with the old var_off might have improved our bounds - * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), - * then new var_off is (0; 0x7f...fc) which improves our umax. - */ - __update_reg_bounds(src_reg); - __update_reg_bounds(dst_reg); + reg_bounds_sync(src_reg); + reg_bounds_sync(dst_reg); } =20 static void reg_combine_min_max(struct bpf_reg_state *true_src, From nobody Sat Apr 18 21:01:21 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 2B354C43334 for ; Mon, 11 Jul 2022 09:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbiGKJ0R (ORCPT ); Mon, 11 Jul 2022 05:26:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232353AbiGKJYc (ORCPT ); Mon, 11 Jul 2022 05:24:32 -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 C3709248D4; Mon, 11 Jul 2022 02:14: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 7DF79B80953; Mon, 11 Jul 2022 09:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9236C34115; Mon, 11 Jul 2022 09:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530881; bh=D3SaVN4OtJ9jFkZCISlCl7bmwvDmH9WGXXwg2da6PjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbwaJiitwZZhfOb9g3jaes++UDNJaAQ9MX9TgufcOK/5dAhSA6RBqWKIUUyfbOTbP SJ0/+Hj+cfz6o1uLR4Wy05EtOpQDtbaBQoSyTQg/yXJZUa2LahayYANnfMT7UFnAAU nEKbZ6yJOF8j1vfsJ4QR3d+KRitWfNtHeEQWkYWM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , Jakub Kicinski Subject: [PATCH 5.18 018/112] usbnet: fix memory leak in error case Date: Mon, 11 Jul 2022 11:06:18 +0200 Message-Id: <20220711090550.076579599@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Oliver Neukum commit b55a21b764c1e182014630fa5486d717484ac58f upstream. usbnet_write_cmd_async() mixed up which buffers need to be freed in which error case. v2: add Fixes tag v3: fix uninitialized buf pointer Fixes: 877bd862f32b8 ("usbnet: introduce usbnet 3 command helpers") Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220705125351.17309-1-oneukum@suse.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/usb/usbnet.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -2137,7 +2137,7 @@ static void usbnet_async_cmd_cb(struct u int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, u16 value, u16 index, const void *data, u16 size) { - struct usb_ctrlrequest *req =3D NULL; + struct usb_ctrlrequest *req; struct urb *urb; int err =3D -ENOMEM; void *buf =3D NULL; @@ -2155,7 +2155,7 @@ int usbnet_write_cmd_async(struct usbnet if (!buf) { netdev_err(dev->net, "Error allocating buffer" " in %s!\n", __func__); - goto fail_free; + goto fail_free_urb; } } =20 @@ -2179,14 +2179,21 @@ int usbnet_write_cmd_async(struct usbnet if (err < 0) { netdev_err(dev->net, "Error submitting the control" " message: status=3D%d\n", err); - goto fail_free; + goto fail_free_all; } return 0; =20 +fail_free_all: + kfree(req); fail_free_buf: kfree(buf); -fail_free: - kfree(req); + /* + * avoid a double free + * needed because the flag can be set only + * after filling the URB + */ + urb->transfer_flags =3D 0; +fail_free_urb: usb_free_urb(urb); fail: return err; From nobody Sat Apr 18 21:01:21 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 91D64CCA47B for ; Mon, 11 Jul 2022 09:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbiGKJ0H (ORCPT ); Mon, 11 Jul 2022 05:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232355AbiGKJYd (ORCPT ); Mon, 11 Jul 2022 05:24:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B6F1248F7; Mon, 11 Jul 2022 02:14:46 -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 42A6BB80956; Mon, 11 Jul 2022 09:14:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96A62C34115; Mon, 11 Jul 2022 09:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530884; bh=lIq5QL1O+Kc+TdTym8+QkepgY8j0DpxAsVZjsV1n+AI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pq8O3yR3g8KYbWIVBqlqK6bODKqRrpTjBNGM0oei3+cVXUMoPrPhVs6n6KfShC/Ij 0nGpgngf6fDnjw5kUfJZMLYAoc75mNcESpUTnOxbgT7/Oyd0RKqoEYcsd87Ei/xiDK Jp90cm3vrqXLElfEojk7vHUZuyt+n2xc5LYLL98k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Duoming Zhou , Jakub Kicinski Subject: [PATCH 5.18 019/112] net: rose: fix UAF bug caused by rose_t0timer_expiry Date: Mon, 11 Jul 2022 11:06:19 +0200 Message-Id: <20220711090550.104404747@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Duoming Zhou commit 148ca04518070910739dfc4eeda765057856403d upstream. There are UAF bugs caused by rose_t0timer_expiry(). The root cause is that del_timer() could not stop the timer handler that is running and there is no synchronization. One of the race conditions is shown below: (thread 1) | (thread 2) | rose_device_event | rose_rt_device_down | rose_remove_neigh rose_t0timer_expiry | rose_stop_t0timer(rose_neigh) ... | del_timer(&neigh->t0timer) | kfree(rose_neigh) //[1]FREE neigh->dce_mode //[2]USE | The rose_neigh is deallocated in position [1] and use in position [2]. The crash trace triggered by POC is like below: BUG: KASAN: use-after-free in expire_timers+0x144/0x320 Write of size 8 at addr ffff888009b19658 by task swapper/0/0 ... Call Trace: dump_stack_lvl+0xbf/0xee print_address_description+0x7b/0x440 print_report+0x101/0x230 ? expire_timers+0x144/0x320 kasan_report+0xed/0x120 ? expire_timers+0x144/0x320 expire_timers+0x144/0x320 __run_timers+0x3ff/0x4d0 run_timer_softirq+0x41/0x80 __do_softirq+0x233/0x544 ... This patch changes rose_stop_ftimer() and rose_stop_t0timer() in rose_remove_neigh() to del_timer_sync() in order that the timer handler could be finished before the resources such as rose_neigh and so on are deallocated. As a result, the UAF bugs could be mitigated. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220705125610.77971-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/rose/rose_route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c @@ -227,8 +227,8 @@ static void rose_remove_neigh(struct ros { struct rose_neigh *s; =20 - rose_stop_ftimer(rose_neigh); - rose_stop_t0timer(rose_neigh); + del_timer_sync(&rose_neigh->ftimer); + del_timer_sync(&rose_neigh->t0timer); =20 skb_queue_purge(&rose_neigh->queue); From nobody Sat Apr 18 21:01:21 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 974E4C433EF for ; Mon, 11 Jul 2022 09:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbiGKJ0Z (ORCPT ); Mon, 11 Jul 2022 05:26:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232366AbiGKJYf (ORCPT ); Mon, 11 Jul 2022 05:24:35 -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 25A6529822; Mon, 11 Jul 2022 02:14:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BAA54B80D2C; Mon, 11 Jul 2022 09:14:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BBABC36AEB; Mon, 11 Jul 2022 09:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530889; bh=404RDpCX/R8w6TAuufcmeta5kQhm/fqKDMIEIfueZ68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RRFRelNDBAUV1HJrUqnLdB6C63PCqbUa2C6gIqK1eTETL/wiQXwYxbqUoMIv1JdAo VV3sADs1ETEyFi06tu2DxDRr6kZwjkWLF+CThe6fr8rK/Z7OOi2kzs3nV53+5vrWQF ZyYIK9NKhcldrPQOBmfN6jDdlkuall6d9+1w/LRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Horatiu Vultur , Jakub Kicinski Subject: [PATCH 5.18 020/112] net: lan966x: hardcode the number of external ports Date: Mon, 11 Jul 2022 11:06:20 +0200 Message-Id: <20220711090550.133256899@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Michael Walle commit e6fa930f73a15238f3cb0c204e2f786c919b815c upstream. Instead of counting the child nodes in the device tree, hardcode the number of ports in the driver itself. The counting won't work at all if an ethernet port is marked as disabled, e.g. because it is not connected on the board at all. It turns out that the LAN9662 and LAN9668 use the same switching IP with the same synthesis parameters. The only difference is that the output ports are not connected. Thus, we can just hardcode the number of physical ports to 8. Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver") Signed-off-by: Michael Walle Reviewed-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220704153654.1167886-1-michael@walle.cc Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 8 ++------ drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -979,7 +979,7 @@ static int lan966x_probe(struct platform struct fwnode_handle *ports, *portnp; struct lan966x *lan966x; u8 mac_addr[ETH_ALEN]; - int err, i; + int err; =20 lan966x =3D devm_kzalloc(&pdev->dev, sizeof(*lan966x), GFP_KERNEL); if (!lan966x) @@ -1010,11 +1010,7 @@ static int lan966x_probe(struct platform if (err) return dev_err_probe(&pdev->dev, err, "Reset failed"); =20 - i =3D 0; - fwnode_for_each_available_child_node(ports, portnp) - ++i; - - lan966x->num_phys_ports =3D i; + lan966x->num_phys_ports =3D NUM_PHYS_PORTS; lan966x->ports =3D devm_kcalloc(&pdev->dev, lan966x->num_phys_ports, sizeof(struct lan966x_port *), GFP_KERNEL); --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h @@ -31,6 +31,7 @@ /* Reserved amount for (SRC, PRIO) at index 8*SRC + PRIO */ #define QSYS_Q_RSRV 95 =20 +#define NUM_PHYS_PORTS 8 #define CPU_PORT 8 =20 /* Reserved PGIDs */ From nobody Sat Apr 18 21:01:21 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 5041DC433EF for ; Mon, 11 Jul 2022 09:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232303AbiGKJ0U (ORCPT ); Mon, 11 Jul 2022 05:26:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbiGKJYg (ORCPT ); Mon, 11 Jul 2022 05:24:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0C22983B; Mon, 11 Jul 2022 02:14: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 CF1316122D; Mon, 11 Jul 2022 09:14:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC11BC34115; Mon, 11 Jul 2022 09:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530892; bh=IGjaSXXz+F58VMvnjySoD6f9kLwkf6beF4+9SB1lVBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yDQsW1Pc8vmFR1DGEA1dpHfNFFIYGvPwZxXVKpjRGlT6oYA+bm/RD/BC8LTL85HnE 5+2FS8bzVlJmc9+dcYZ0P69ZT+5IzZJ2h9mS2amqvXrp9jZj1i/+CUVc6QoQkdkN/f iMlc4I365Z5XkdYm7W+nUhtOsulyR0oR+/GM3DFc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefano Brivio , Pablo Neira Ayuso Subject: [PATCH 5.18 021/112] netfilter: nft_set_pipapo: release elements in clone from abort path Date: Mon, 11 Jul 2022 11:06:21 +0200 Message-Id: <20220711090550.161213436@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Pablo Neira Ayuso commit 9827a0e6e23bf43003cd3d5b7fb11baf59a35e1e upstream. New elements that reside in the clone are not released in case that the transaction is aborted. [16302.231754] ------------[ cut here ]------------ [16302.231756] WARNING: CPU: 0 PID: 100509 at net/netfilter/nf_tables_api.c= :1864 nf_tables_chain_destroy+0x26/0x127 [nf_tables] [...] [16302.231882] CPU: 0 PID: 100509 Comm: nft Tainted: G W 5.1= 9.0-rc3+ #155 [...] [16302.231887] RIP: 0010:nf_tables_chain_destroy+0x26/0x127 [nf_tables] [16302.231899] Code: f3 fe ff ff 41 55 41 54 55 53 48 8b 6f 10 48 89 fb 48 = c7 c7 82 96 d9 a0 8b 55 50 48 8b 75 58 e8 de f5 92 e0 83 7d 50 00 74 09 <0f= > 0b 5b 5d 41 5c 41 5d c3 4c 8b 65 00 48 8b 7d 08 49 39 fc 74 05 [...] [16302.231917] Call Trace: [16302.231919] [16302.231921] __nf_tables_abort.cold+0x23/0x28 [nf_tables] [16302.231934] nf_tables_abort+0x30/0x50 [nf_tables] [16302.231946] nfnetlink_rcv_batch+0x41a/0x840 [nfnetlink] [16302.231952] ? __nla_validate_parse+0x48/0x190 [16302.231959] nfnetlink_rcv+0x110/0x129 [nfnetlink] [16302.231963] netlink_unicast+0x211/0x340 [16302.231969] netlink_sendmsg+0x21e/0x460 Add nft_set_pipapo_match_destroy() helper function to release the elements in the lookup tables. Stefano Brivio says: "We additionally look for elements pointers in the cloned matching data if priv->dirty is set, because that means that cloned data might point to additional elements we did not commit to the working copy yet (such as the abort path case, but perhaps not limited to it)." Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation o= f ranges") Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/netfilter/nft_set_pipapo.c | 48 ++++++++++++++++++++++++++++--------= ----- 1 file changed, 33 insertions(+), 15 deletions(-) --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -2125,6 +2125,32 @@ out_scratch: } =20 /** + * nft_set_pipapo_match_destroy() - Destroy elements from key mapping array + * @set: nftables API set representation + * @m: matching data pointing to key mapping array + */ +static void nft_set_pipapo_match_destroy(const struct nft_set *set, + struct nft_pipapo_match *m) +{ + struct nft_pipapo_field *f; + int i, r; + + for (i =3D 0, f =3D m->f; i < m->field_count - 1; i++, f++) + ; + + for (r =3D 0; r < f->rules; r++) { + struct nft_pipapo_elem *e; + + if (r < f->rules - 1 && f->mt[r + 1].e =3D=3D f->mt[r].e) + continue; + + e =3D f->mt[r].e; + + nft_set_elem_destroy(set, e, true); + } +} + +/** * nft_pipapo_destroy() - Free private data for set and all committed elem= ents * @set: nftables API set representation */ @@ -2132,26 +2158,13 @@ static void nft_pipapo_destroy(const str { struct nft_pipapo *priv =3D nft_set_priv(set); struct nft_pipapo_match *m; - struct nft_pipapo_field *f; - int i, r, cpu; + int cpu; =20 m =3D rcu_dereference_protected(priv->match, true); if (m) { rcu_barrier(); =20 - for (i =3D 0, f =3D m->f; i < m->field_count - 1; i++, f++) - ; - - for (r =3D 0; r < f->rules; r++) { - struct nft_pipapo_elem *e; - - if (r < f->rules - 1 && f->mt[r + 1].e =3D=3D f->mt[r].e) - continue; - - e =3D f->mt[r].e; - - nft_set_elem_destroy(set, e, true); - } + nft_set_pipapo_match_destroy(set, m); =20 #ifdef NFT_PIPAPO_ALIGN free_percpu(m->scratch_aligned); @@ -2165,6 +2178,11 @@ static void nft_pipapo_destroy(const str } =20 if (priv->clone) { + m =3D priv->clone; + + if (priv->dirty) + nft_set_pipapo_match_destroy(set, m); + #ifdef NFT_PIPAPO_ALIGN free_percpu(priv->clone->scratch_aligned); #endif From nobody Sat Apr 18 21:01:21 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 6E047C433EF for ; Mon, 11 Jul 2022 09:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232338AbiGKJ0d (ORCPT ); Mon, 11 Jul 2022 05:26:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbiGKJYg (ORCPT ); Mon, 11 Jul 2022 05:24:36 -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 2841529C9C; Mon, 11 Jul 2022 02:14:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B8E45610A5; Mon, 11 Jul 2022 09:14:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8836C34115; Mon, 11 Jul 2022 09:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530895; bh=LeO8Igb2hdh3kyMobdyRRQAuDTQtRfL4d/jaR8S1KFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVSlINmXDhswxpvSQvOxB9WHEyWhiw8EGroylLWJHhZCE9Gw3EDXjmlWN1UVE9Ez0 695MJEvSD3Kjal+mwZULCzsM1z5SX/401gcoO6uSz66SNKsi6+1eDHIFZQKucsvbIP MakDK8LBD9imetP09gD845jXfk3l5jr4TDzzoC9Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hugues ANGUELKOV , Pablo Neira Ayuso Subject: [PATCH 5.18 022/112] netfilter: nf_tables: stricter validation of element data Date: Mon, 11 Jul 2022 11:06:22 +0200 Message-Id: <20220711090550.189185714@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Pablo Neira Ayuso commit 7e6bc1f6cabcd30aba0b11219d8e01b952eacbb6 upstream. Make sure element data type and length do not mismatch the one specified by the set declaration. Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys= / data") Reported-by: Hugues ANGUELKOV Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/netfilter/nf_tables_api.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -5213,13 +5213,20 @@ static int nft_setelem_parse_data(struct struct nft_data *data, struct nlattr *attr) { + u32 dtype; int err; =20 err =3D nft_data_init(ctx, data, NFT_DATA_VALUE_MAXLEN, desc, attr); if (err < 0) return err; =20 - if (desc->type !=3D NFT_DATA_VERDICT && desc->len !=3D set->dlen) { + if (set->dtype =3D=3D NFT_DATA_VERDICT) + dtype =3D NFT_DATA_VERDICT; + else + dtype =3D NFT_DATA_VALUE; + + if (dtype !=3D desc->type || + set->dlen !=3D desc->len) { nft_data_release(data, desc->type); return -EINVAL; } From nobody Sat Apr 18 21:01:21 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 96D16C433EF for ; Mon, 11 Jul 2022 09:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbiGKJ0f (ORCPT ); Mon, 11 Jul 2022 05:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbiGKJYi (ORCPT ); Mon, 11 Jul 2022 05:24:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9753D29CA4; Mon, 11 Jul 2022 02:15: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 ams.source.kernel.org (Postfix) with ESMTPS id 3E89AB80CEF; Mon, 11 Jul 2022 09:14:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77E78C34115; Mon, 11 Jul 2022 09:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530898; bh=5m+h39eZ7eMqr/vCdn8mmEWEdo/XefaS2iIxrXuVj1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XjIrqSK4pBb5qS4kivrBSDFxEO2HWffD1PRwM6fngC1LnQ0SmHaHwJEHAqwX6y9nR xI3UsB5kvUHQR+0a/RXkuq4E4M0rs/0c02CHHXwyBem+42GIXogYdWohvQnIB1aNAL V9RBpXNhI0OdVkiQNzrEoOZY/A9tLOkv2w8rp+48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Andrii Nakryiko , Jakub Kicinski Subject: [PATCH 5.18 023/112] selftests/net: fix section name when using xdp_dummy.o Date: Mon, 11 Jul 2022 11:06:23 +0200 Message-Id: <20220711090550.218320773@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Hangbin Liu commit d28b25a62a47a8c8aa19bd543863aab6717e68c9 upstream. Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests") the xdp_dummy.o's section name has changed to xdp. But some tests are still using "section xdp_dummy", which make the tests failed. Fix them by updating to the new section name. Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftes= ts") Signed-off-by: Hangbin Liu Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220630062228.3453016-1-liuhangbin@gmail.c= om Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- tools/testing/selftests/net/udpgro.sh | 2 +- tools/testing/selftests/net/udpgro_bench.sh | 2 +- tools/testing/selftests/net/udpgro_frglist.sh | 2 +- tools/testing/selftests/net/udpgro_fwd.sh | 2 +- tools/testing/selftests/net/veth.sh | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) --- a/tools/testing/selftests/net/udpgro.sh +++ b/tools/testing/selftests/net/udpgro.sh @@ -34,7 +34,7 @@ cfg_veth() { ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24 ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad ip -netns "${PEER_NS}" link set dev veth1 up - ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp_dummy + ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp } =20 run_one() { --- a/tools/testing/selftests/net/udpgro_bench.sh +++ b/tools/testing/selftests/net/udpgro_bench.sh @@ -34,7 +34,7 @@ run_one() { ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad ip -netns "${PEER_NS}" link set dev veth1 up =20 - ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp_dummy + ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} -r & ip netns exec "${PEER_NS}" ./udpgso_bench_rx -t ${rx_args} -r & =20 --- a/tools/testing/selftests/net/udpgro_frglist.sh +++ b/tools/testing/selftests/net/udpgro_frglist.sh @@ -36,7 +36,7 @@ run_one() { ip netns exec "${PEER_NS}" ethtool -K veth1 rx-gro-list on =20 =20 - ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp_dummy + ip -n "${PEER_NS}" link set veth1 xdp object ../bpf/xdp_dummy.o section x= dp tc -n "${PEER_NS}" qdisc add dev veth1 clsact tc -n "${PEER_NS}" filter add dev veth1 ingress prio 4 protocol ipv6 bpf = object-file ../bpf/nat6to4.o section schedcls/ingress6/nat_6 direct-action tc -n "${PEER_NS}" filter add dev veth1 egress prio 4 protocol ip bpf obj= ect-file ../bpf/nat6to4.o section schedcls/egress4/snat4 direct-action --- a/tools/testing/selftests/net/udpgro_fwd.sh +++ b/tools/testing/selftests/net/udpgro_fwd.sh @@ -46,7 +46,7 @@ create_ns() { ip -n $BASE$ns addr add dev veth$ns $BM_NET_V4$ns/24 ip -n $BASE$ns addr add dev veth$ns $BM_NET_V6$ns/64 nodad done - ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp= _dummy 2>/dev/null + ip -n $NS_DST link set veth$DST xdp object ../bpf/xdp_dummy.o section xdp= 2>/dev/null } =20 create_vxlan_endpoint() { --- a/tools/testing/selftests/net/veth.sh +++ b/tools/testing/selftests/net/veth.sh @@ -289,14 +289,14 @@ if [ $CPUS -gt 1 ]; then ip netns exec $NS_SRC ethtool -L veth$SRC rx 1 tx 2 2>/dev/null printf "%-60s" "bad setting: XDP with RX nr less than TX" ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \ - section xdp_dummy 2>/dev/null &&\ + section xdp 2>/dev/null &&\ echo "fail - set operation successful ?!?" || echo " ok " =20 # the following tests will run with multiple channels active ip netns exec $NS_SRC ethtool -L veth$SRC rx 2 ip netns exec $NS_DST ethtool -L veth$DST rx 2 ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o \ - section xdp_dummy 2>/dev/null + section xdp 2>/dev/null printf "%-60s" "bad setting: reducing RX nr below peer TX with XDP set" ip netns exec $NS_DST ethtool -L veth$DST rx 1 2>/dev/null &&\ echo "fail - set operation successful ?!?" || echo " ok " @@ -311,7 +311,7 @@ if [ $CPUS -gt 2 ]; then chk_channels "setting invalid channels nr" $DST 2 2 fi =20 -ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section = xdp_dummy 2>/dev/null +ip -n $NS_DST link set dev veth$DST xdp object ../bpf/xdp_dummy.o section = xdp 2>/dev/null chk_gro_flag "with xdp attached - gro flag" $DST on chk_gro_flag " - peer gro flag" $SRC off chk_tso_flag " - tso flag" $SRC off From nobody Sat Apr 18 21:01:21 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 1E7F7C433EF for ; Mon, 11 Jul 2022 09:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbiGKJ0h (ORCPT ); Mon, 11 Jul 2022 05:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232402AbiGKJYi (ORCPT ); Mon, 11 Jul 2022 05:24:38 -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 3D6372A265; Mon, 11 Jul 2022 02:15:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6364B80956; Mon, 11 Jul 2022 09:15:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CDE4C34115; Mon, 11 Jul 2022 09:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530900; bh=M8F7ClygEJ6IJ2pVBqWf2m2U8Tr8lvwUpI2W+Xuh+NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sS2WdEe5NOMyyvSFdh7FrOO+JvVNyMjNKq/XEOUWpboyMBXbqxzLGYwWe03MCynsN otLlz5dI6sAj+VnwiNB/mPlH5OgtgVQJah5Bf29G3IemsbIbHBgMZy9QLa13HPaqJR As1lxrZwQwkLC5org8g+D00GtaIyO+HyUfCo3GW4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rasmus Villemoes , Manivannan Sadhasivam , Marc Kleine-Budde Subject: [PATCH 5.18 024/112] can: mcp251xfd: mcp251xfd_register_get_dev_id(): use correct length to read dev_id Date: Mon, 11 Jul 2022 11:06:24 +0200 Message-Id: <20220711090550.245995783@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Marc Kleine-Budde commit 0ff32bfa0e794ccc3601de7158b522bf736fa63c upstream. The device ID register is 32 bits wide. The driver uses incorrectly the size of a pointer to a u32 to calculate the length of the SPI transfer. This results in a read of 2 registers on 64 bit platforms. This is no problem on the Linux side, as the RX buffer of the SPI transfer is large enough. In the mpc251xfd chip this results in the read of an undocumented register. So far no problems were observed. Fix the length of the SPI transfer to read the device ID register only. Link: https://lore.kernel.org/all/20220616094914.244440-1-mkl@pengutronix.de Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SP= I CAN") Reported-by: Rasmus Villemoes Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -1769,7 +1769,7 @@ mcp251xfd_register_get_dev_id(const stru xfer[0].len =3D sizeof(buf_tx->cmd); xfer[0].speed_hz =3D priv->spi_max_speed_hz_slow; xfer[1].rx_buf =3D buf_rx->data; - xfer[1].len =3D sizeof(dev_id); + xfer[1].len =3D sizeof(*dev_id); xfer[1].speed_hz =3D priv->spi_max_speed_hz_fast; =20 mcp251xfd_spi_cmd_read_nocrc(&buf_tx->cmd, MCP251XFD_REG_DEVID); From nobody Sat Apr 18 21:01:21 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 C21B0C433EF for ; Mon, 11 Jul 2022 09:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbiGKJ0k (ORCPT ); Mon, 11 Jul 2022 05:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232408AbiGKJYj (ORCPT ); Mon, 11 Jul 2022 05:24:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798AA2A427; Mon, 11 Jul 2022 02:15: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 D532F6123B; Mon, 11 Jul 2022 09:15:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8FFEC341C0; Mon, 11 Jul 2022 09:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530903; bh=Thsqa8+oXxSlU5z5RVlpc5ANmuoUcNe2Gohr70520l0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izkg/dP0IREvJoxSbtbPLGhy3rgx9JI0VU11q4eTPwd684LYCfOwtH8BvND2ZCIXW gZU/Zh97egZvz7LAFjqtkBi0QpTtQrfgO5XgmF6smUJXAWAe1K+lmh2MWzV1AOOsiN Ja8zqFl+wAT5USu0fiaGhg9rjMCo3lacbIllgKiY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rasmus Villemoes , Manivannan Sadhasivam , Marc Kleine-Budde Subject: [PATCH 5.18 025/112] can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix endianness conversion Date: Mon, 11 Jul 2022 11:06:25 +0200 Message-Id: <20220711090550.274324178@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Marc Kleine-Budde commit 1c0e78a287e3493e22bde8553d02f3b89177eaf7 upstream. In mcp251xfd_register_get_dev_id() the device ID register is read with handcrafted SPI transfers. As all registers, this register is in little endian. Further it is not naturally aligned in struct mcp251xfd_map_buf_nocrc::data. However after the transfer the register content is converted from big endian to CPU endianness not taking care of being unaligned. Fix the conversion by converting from little endian to CPU endianness taking the unaligned source into account. Side note: So far the register content is 0x0 on all mcp251xfd compatible chips, and is only used for an informative printk. Link: https://lore.kernel.org/all/20220627092859.809042-1-mkl@pengutronix.de Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SP= I CAN") Reviewed-by: Rasmus Villemoes Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -12,6 +12,7 @@ // Copyright (c) 2019 Martin Sperl // =20 +#include #include #include #include @@ -1778,7 +1779,7 @@ mcp251xfd_register_get_dev_id(const stru if (err) goto out_kfree_buf_tx; =20 - *dev_id =3D be32_to_cpup((__be32 *)buf_rx->data); + *dev_id =3D get_unaligned_le32(buf_rx->data); *effective_speed_hz_slow =3D xfer[0].effective_speed_hz; *effective_speed_hz_fast =3D xfer[1].effective_speed_hz; From nobody Sat Apr 18 21:01:21 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 2E58AC433EF for ; Mon, 11 Jul 2022 09:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbiGKJ0p (ORCPT ); Mon, 11 Jul 2022 05:26:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbiGKJYl (ORCPT ); Mon, 11 Jul 2022 05:24:41 -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 18ED82A42E; Mon, 11 Jul 2022 02:15:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A87D46125D; Mon, 11 Jul 2022 09:15:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4F58C34115; Mon, 11 Jul 2022 09:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530906; bh=OLnwXVKD707ZZ+mGhuVMLJQBSfiNvdmdll5ulhhZKEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MSLGebucLkhOlmKH+KekzFkdwBbo7xt08Fss2snbkyafpyZGa/U4f4EC5jKVPLEsJ 6MBaGGizjuSJf4r+KwBRkgive8ye6uSBGX//6D1Ry4abLuUzuGjgc5K9GToDBXaVvk f2KphAPTOnofuSiHsGBPbnFbqCWlsr3xzVmiYVMg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Duy Nguyen , Yoshihiro Shimoda , Marc Kleine-Budde Subject: [PATCH 5.18 026/112] can: rcar_canfd: Fix data transmission failed on R-Car V3U Date: Mon, 11 Jul 2022 11:06:26 +0200 Message-Id: <20220711090550.302308045@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Duy Nguyen commit 374e11f1bde91545674233459e5a0416ba842b69 upstream. On R-Car V3U, this driver should use suitable register offset instead of other SoCs' one. Otherwise, data transmission failed on R-Car V3U. Fixes: 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC") Link: https://lore.kernel.org/all/20220704074611.957191-1-yoshihiro.shimoda= .uh@renesas.com Reviewed-by: Geert Uytterhoeven Signed-off-by: Duy Nguyen Signed-off-by: Yoshihiro Shimoda Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/can/rcar/rcar_canfd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -1334,7 +1334,10 @@ static void rcar_canfd_set_bittiming(str cfg =3D (RCANFD_DCFG_DTSEG1(gpriv, tseg1) | RCANFD_DCFG_DBRP(brp) | RCANFD_DCFG_DSJW(sjw) | RCANFD_DCFG_DTSEG2(gpriv, tseg2)); =20 - rcar_canfd_write(priv->base, RCANFD_F_DCFG(ch), cfg); + if (is_v3u(gpriv)) + rcar_canfd_write(priv->base, RCANFD_V3U_DCFG(ch), cfg); + else + rcar_canfd_write(priv->base, RCANFD_F_DCFG(ch), cfg); netdev_dbg(priv->ndev, "drate: brp %u, sjw %u, tseg1 %u, tseg2 %u\n", brp, sjw, tseg1, tseg2); } else { From nobody Sat Apr 18 21:01:21 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 CE77EC433EF for ; Mon, 11 Jul 2022 09:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbiGKJ0s (ORCPT ); Mon, 11 Jul 2022 05:26:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbiGKJYo (ORCPT ); Mon, 11 Jul 2022 05:24:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C642F326CE; Mon, 11 Jul 2022 02:15: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 5051561226; Mon, 11 Jul 2022 09:15:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65F63C341C8; Mon, 11 Jul 2022 09:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530908; bh=XIRK/QPcy0fpo090+o2Pp+uylOSPt5DoDRhcqmsfk6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ezXSJBsEvo+KGZwDs1dL1/dL6SQ0lKTzbLOQ8MYdRrGfdoqV4Qcuantc80gYjo4wi P7xWwM8JS0VTpRMAKTwl+SF35e2H0F1WIcutelmZzBMCn0g4FJK/aEHhKuR+gKkj0L Nf9cCa5rIPfbDuCfCQzxA7P5xnneiZviEc/pn3uU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivasa Rao Mandadapu , Srinivas Kandagatla , Mark Brown Subject: [PATCH 5.18 027/112] ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared Date: Mon, 11 Jul 2022 11:06:27 +0200 Message-Id: <20220711090550.330720531@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Srinivas Kandagatla commit 58136d93d4e2c1207a5e4f3044815cd40b1d95fd upstream. prepare callback can be called multiple times, so unprepare the stream if its already prepared. Without this DSP is not happy to setting the params on a already prepared graph. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Reported-by: Srinivasa Rao Mandadapu Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220610144818.511797-1-srinivas.kandagatla= @linaro.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/qcom/qdsp6/q6apm-dai.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -147,6 +147,12 @@ static int q6apm_dai_prepare(struct snd_ cfg.num_channels =3D runtime->channels; cfg.bit_width =3D prtd->bits_per_sample; =20 + if (prtd->state) { + /* clear the previous setup if any */ + q6apm_graph_stop(prtd->graph); + q6apm_unmap_memory_regions(prtd->graph, substream->stream); + } + prtd->pcm_count =3D snd_pcm_lib_period_bytes(substream); prtd->pos =3D 0; /* rate and channels are sent to audio driver */ From nobody Sat Apr 18 21:01:21 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 E6DDCC43334 for ; Mon, 11 Jul 2022 09:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbiGKJ0v (ORCPT ); Mon, 11 Jul 2022 05:26:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232487AbiGKJYs (ORCPT ); Mon, 11 Jul 2022 05:24:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 507153336F; Mon, 11 Jul 2022 02:15:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8F58DB80833; Mon, 11 Jul 2022 09:15:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09DE8C34115; Mon, 11 Jul 2022 09:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530911; bh=Y2vZqC06i8AzUbZvUFSXTCsRIMDbkbovhT/11q7TMbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJlyVSlsBAveI+tePYbG46gPTcN9/TFGz+Gfe0QukvX0Uu6XSARPZuNFMwGdPbM3Q NKyei7gE9uQKXdVx4Bye4DQv7M5TBUYtLBFE8sjyIlhnasA1y0edOwaHrZgJUj7Pgb nXT3tE1cNVyqaQSHjdRyJ6VZuxKbz3LW1F9Xpcvc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joerg Roedel Subject: [PATCH 5.18 028/112] MAINTAINERS: Remove iommu@lists.linux-foundation.org Date: Mon, 11 Jul 2022 11:06:28 +0200 Message-Id: <20220711090550.365306950@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Joerg Roedel commit c51b8f85c4157eb91c2f4ab34b0c52fea642e77c upstream. The IOMMU mailing list has moved to iommu@lists.linux.dev and the old list should bounce by now. Remove it from the MAINTAINERS file. Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220706103331.10215-1-joro@8bytes.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- MAINTAINERS | 11 ----------- 1 file changed, 11 deletions(-) --- a/MAINTAINERS +++ b/MAINTAINERS @@ -426,7 +426,6 @@ F: drivers/acpi/*thermal* ACPI VIOT DRIVER M: Jean-Philippe Brucker L: linux-acpi@vger.kernel.org -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Maintained F: drivers/acpi/viot.c @@ -960,7 +959,6 @@ F: drivers/video/fbdev/geode/ AMD IOMMU (AMD-VI) M: Joerg Roedel R: Suravee Suthikulpanit -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git @@ -5899,7 +5897,6 @@ DMA MAPPING HELPERS M: Christoph Hellwig M: Marek Szyprowski R: Robin Murphy -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Supported W: http://git.infradead.org/users/hch/dma-mapping.git @@ -5912,7 +5909,6 @@ F: kernel/dma/ =20 DMA MAPPING BENCHMARK M: Xiang Chen -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev F: kernel/dma/map_benchmark.c F: tools/testing/selftests/dma/ @@ -7479,7 +7475,6 @@ F: drivers/gpu/drm/exynos/exynos_dp* =20 EXYNOS SYSMMU (IOMMU) driver M: Marek Szyprowski -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Maintained F: drivers/iommu/exynos-iommu.c @@ -9879,7 +9874,6 @@ F: drivers/hid/intel-ish-hid/ INTEL IOMMU (VT-d) M: David Woodhouse M: Lu Baolu -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git @@ -10258,7 +10252,6 @@ F: include/linux/iomap.h IOMMU DRIVERS M: Joerg Roedel M: Will Deacon -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git @@ -12375,7 +12368,6 @@ F: drivers/i2c/busses/i2c-mt65xx.c =20 MEDIATEK IOMMU DRIVER M: Yong Wu -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev L: linux-mediatek@lists.infradead.org (moderated for non-subscribers) S: Supported @@ -16361,7 +16353,6 @@ F: drivers/i2c/busses/i2c-qcom-cci.c =20 QUALCOMM IOMMU M: Rob Clark -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev L: linux-arm-msm@vger.kernel.org S: Maintained @@ -18947,7 +18938,6 @@ F: arch/x86/boot/video* =20 SWIOTLB SUBSYSTEM M: Christoph Hellwig -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Supported W: http://git.infradead.org/users/hch/dma-mapping.git @@ -21618,7 +21608,6 @@ XEN SWIOTLB SUBSYSTEM M: Juergen Gross M: Stefano Stabellini L: xen-devel@lists.xenproject.org (moderated for non-subscribers) -L: iommu@lists.linux-foundation.org L: iommu@lists.linux.dev S: Supported F: arch/x86/xen/*swiotlb* From nobody Sat Apr 18 21:01:21 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 A50CEC43334 for ; Mon, 11 Jul 2022 09:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232400AbiGKJ0z (ORCPT ); Mon, 11 Jul 2022 05:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbiGKJYx (ORCPT ); Mon, 11 Jul 2022 05:24:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3154A37186; Mon, 11 Jul 2022 02:15: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 ams.source.kernel.org (Postfix) with ESMTPS id 4650CB80E7E; Mon, 11 Jul 2022 09:15:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0269C341C0; Mon, 11 Jul 2022 09:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530914; bh=cI6yKnCywpfP9pCIdeMRNme6AxuT+26wTSRXrQmwRB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qqGhJw6ArpkgLMGqyZ7CIcpv6KDxqeQ30gQ6nqRwYjREQ7k7+sObWEj9Pa4qQlSBh RENSNtVJZiHc8g5o7Tm3wHcNJHmmH+pNWtwnEXz+oY3OM4vs+n2ilcAD+sukp6MVxq bY7AS5xFgQi2CQ0jTALp4zswXSxD3ecgcZ2HGKL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Zhang, Bernice" , Jacob Pan , Yian Chen , Joerg Roedel , Zhang@vger.kernel.org Subject: [PATCH 5.18 029/112] iommu/vt-d: Fix PCI bus rescan device hot add Date: Mon, 11 Jul 2022 11:06:29 +0200 Message-Id: <20220711090550.393546816@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Yian Chen commit 316f92a705a4c2bf4712135180d56f3cca09243a upstream. Notifier calling chain uses priority to determine the execution order of the notifiers or listeners registered to the chain. PCI bus device hot add utilizes the notification mechanism. The current code sets low priority (INT_MIN) to Intel dmar_pci_bus_notifier and postpones DMAR decoding after adding new device into IOMMU. The result is that struct device pointer cannot be found in DRHD search for the new device's DMAR/IOMMU. Subsequently, the device is put under the "catch-all" IOMMU instead of the correct one. This could cause system hang when device TLB invalidation is sent to the wrong IOMMU. Invalidation timeout error and hard lockup have been observed and data inconsistency/crush may occur as well. This patch fixes the issue by setting a positive priority(1) for dmar_pci_bus_notifier while the priority of IOMMU bus notifier uses the default value(0), therefore DMAR decoding will be in advance of DRHD search for a new device to find the correct IOMMU. Following is a 2-step example that triggers the bug by simulating PCI device hot add behavior in Intel Sapphire Rapids server. echo 1 > /sys/bus/pci/devices/0000:6a:01.0/remove echo 1 > /sys/bus/pci/rescan Fixes: 59ce0515cdaf ("iommu/vt-d: Update DRHD/RMRR/ATSR device scope") Cc: stable@vger.kernel.org # v3.15+ Reported-by: Zhang, Bernice Signed-off-by: Jacob Pan Signed-off-by: Yian Chen Link: https://lore.kernel.org/r/20220521002115.1624069-1-yian.chen@intel.com Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iommu/intel/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -383,7 +383,7 @@ static int dmar_pci_bus_notifier(struct =20 static struct notifier_block dmar_pci_bus_nb =3D { .notifier_call =3D dmar_pci_bus_notifier, - .priority =3D INT_MIN, + .priority =3D 1, }; =20 static struct dmar_drhd_unit * From nobody Sat Apr 18 21:01:21 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 2E0D8C43334 for ; Mon, 11 Jul 2022 09:27:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbiGKJ1I (ORCPT ); Mon, 11 Jul 2022 05:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbiGKJZ3 (ORCPT ); Mon, 11 Jul 2022 05:25:29 -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 812BC3C15E; Mon, 11 Jul 2022 02:15: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 AD772B80E6D; Mon, 11 Jul 2022 09:15:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C99FC385A2; Mon, 11 Jul 2022 09:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530919; bh=3Oqf7mTGRy74t/mYgL2BARavYyB7H0SI+5g6itj9mUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTUX16Lq5sU3WtvNRHfTV+/bCfUWM9xvPV1XbJMoe7f0SUYxwL0zLfJqcDt8kfs0l ThYzs73AGEelHbNtgv+tvIUPuXCmsA9KFsQ4RDqadLUi8nRygbNQdRkiS8OaKovLpH GUKv/dwT7asLuo8ksuqszgo7DeDFe12OfdeeUyng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chenyi Qiang , Ethan Zhao , Lu Baolu , Kevin Tian , Joerg Roedel Subject: [PATCH 5.18 030/112] iommu/vt-d: Fix RID2PASID setup/teardown failure Date: Mon, 11 Jul 2022 11:06:30 +0200 Message-Id: <20220711090550.422283157@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Lu Baolu commit 4140d77a022101376bbfa3ec3e3da5063455c60e upstream. The IOMMU driver shares the pasid table for PCI alias devices. When the RID2PASID entry of the shared pasid table has been filled by the first device, the subsequent device will encounter the "DMAR: Setup RID2PASID failed" failure as the pasid entry has already been marked as present. As the result, the IOMMU probing process will be aborted. On the contrary, when any alias device is hot-removed from the system, for example, by writing to /sys/bus/pci/devices/.../remove, the shared RID2PASID will be cleared without any notifications to other devices. As the result, any DMAs from those rest devices are blocked. Sharing pasid table among PCI alias devices could save two memory pages for devices underneath the PCIe-to-PCI bridges. Anyway, considering that those devices are rare on modern platforms that support VT-d in scalable mode and the saved memory is negligible, it's reasonable to remove this part of immature code to make the driver feasible and stable. Fixes: ef848b7e5a6a0 ("iommu/vt-d: Setup pasid entry for RID2PASID support") Reported-by: Chenyi Qiang Reported-by: Ethan Zhao Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Ethan Zhao Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220623065720.727849-1-baolu.lu@linux.inte= l.com Link: https://lore.kernel.org/r/20220625133430.2200315-2-baolu.lu@linux.int= el.com Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/iommu/intel/iommu.c | 24 --------------- drivers/iommu/intel/pasid.c | 69 +--------------------------------------= ----- drivers/iommu/intel/pasid.h | 1=20 include/linux/intel-iommu.h | 3 - 4 files changed, 3 insertions(+), 94 deletions(-) --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -320,30 +320,6 @@ EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped DEFINE_SPINLOCK(device_domain_lock); static LIST_HEAD(device_domain_list); =20 -/* - * Iterate over elements in device_domain_list and call the specified - * callback @fn against each element. - */ -int for_each_device_domain(int (*fn)(struct device_domain_info *info, - void *data), void *data) -{ - int ret =3D 0; - unsigned long flags; - struct device_domain_info *info; - - spin_lock_irqsave(&device_domain_lock, flags); - list_for_each_entry(info, &device_domain_list, global) { - ret =3D fn(info, data); - if (ret) { - spin_unlock_irqrestore(&device_domain_lock, flags); - return ret; - } - } - spin_unlock_irqrestore(&device_domain_lock, flags); - - return 0; -} - const struct iommu_ops intel_iommu_ops; =20 static bool translation_pre_enabled(struct intel_iommu *iommu) --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -86,54 +86,6 @@ void vcmd_free_pasid(struct intel_iommu /* * Per device pasid table management: */ -static inline void -device_attach_pasid_table(struct device_domain_info *info, - struct pasid_table *pasid_table) -{ - info->pasid_table =3D pasid_table; - list_add(&info->table, &pasid_table->dev); -} - -static inline void -device_detach_pasid_table(struct device_domain_info *info, - struct pasid_table *pasid_table) -{ - info->pasid_table =3D NULL; - list_del(&info->table); -} - -struct pasid_table_opaque { - struct pasid_table **pasid_table; - int segment; - int bus; - int devfn; -}; - -static int search_pasid_table(struct device_domain_info *info, void *opaqu= e) -{ - struct pasid_table_opaque *data =3D opaque; - - if (info->iommu->segment =3D=3D data->segment && - info->bus =3D=3D data->bus && - info->devfn =3D=3D data->devfn && - info->pasid_table) { - *data->pasid_table =3D info->pasid_table; - return 1; - } - - return 0; -} - -static int get_alias_pasid_table(struct pci_dev *pdev, u16 alias, void *op= aque) -{ - struct pasid_table_opaque *data =3D opaque; - - data->segment =3D pci_domain_nr(pdev->bus); - data->bus =3D PCI_BUS_NUM(alias); - data->devfn =3D alias & 0xff; - - return for_each_device_domain(&search_pasid_table, data); -} =20 /* * Allocate a pasid table for @dev. It should be called in a @@ -143,28 +95,18 @@ int intel_pasid_alloc_table(struct devic { struct device_domain_info *info; struct pasid_table *pasid_table; - struct pasid_table_opaque data; struct page *pages; u32 max_pasid =3D 0; - int ret, order; - int size; + int order, size; =20 might_sleep(); info =3D dev_iommu_priv_get(dev); if (WARN_ON(!info || !dev_is_pci(dev) || info->pasid_table)) return -EINVAL; =20 - /* DMA alias device already has a pasid table, use it: */ - data.pasid_table =3D &pasid_table; - ret =3D pci_for_each_dma_alias(to_pci_dev(dev), - &get_alias_pasid_table, &data); - if (ret) - goto attach_out; - pasid_table =3D kzalloc(sizeof(*pasid_table), GFP_KERNEL); if (!pasid_table) return -ENOMEM; - INIT_LIST_HEAD(&pasid_table->dev); =20 if (info->pasid_supported) max_pasid =3D min_t(u32, pci_max_pasids(to_pci_dev(dev)), @@ -182,9 +124,7 @@ int intel_pasid_alloc_table(struct devic pasid_table->table =3D page_address(pages); pasid_table->order =3D order; pasid_table->max_pasid =3D 1 << (order + PAGE_SHIFT + 3); - -attach_out: - device_attach_pasid_table(info, pasid_table); + info->pasid_table =3D pasid_table; =20 return 0; } @@ -202,10 +142,7 @@ void intel_pasid_free_table(struct devic return; =20 pasid_table =3D info->pasid_table; - device_detach_pasid_table(info, pasid_table); - - if (!list_empty(&pasid_table->dev)) - return; + info->pasid_table =3D NULL; =20 /* Free scalable mode PASID directory tables: */ dir =3D pasid_table->table; --- a/drivers/iommu/intel/pasid.h +++ b/drivers/iommu/intel/pasid.h @@ -74,7 +74,6 @@ struct pasid_table { void *table; /* pasid table pointer */ int order; /* page order of pasid table */ u32 max_pasid; /* max pasid */ - struct list_head dev; /* device list */ }; =20 /* Get PRESENT bit of a PASID directory entry. */ --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -611,7 +611,6 @@ struct intel_iommu { struct device_domain_info { struct list_head link; /* link to domain siblings */ struct list_head global; /* link to global list */ - struct list_head table; /* link to pasid table */ u32 segment; /* PCI segment number */ u8 bus; /* PCI bus number */ u8 devfn; /* PCI devfn number */ @@ -728,8 +727,6 @@ extern int dmar_ir_support(void); void *alloc_pgtable_page(int node); void free_pgtable_page(void *vaddr); struct intel_iommu *domain_get_iommu(struct dmar_domain *domain); -int for_each_device_domain(int (*fn)(struct device_domain_info *info, - void *data), void *data); void iommu_flush_write_buffer(struct intel_iommu *iommu); int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev= ); struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn= ); From nobody Sat Apr 18 21:01:21 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 6D643C433EF for ; Mon, 11 Jul 2022 09:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232426AbiGKJ1N (ORCPT ); Mon, 11 Jul 2022 05:27:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232193AbiGKJZa (ORCPT ); Mon, 11 Jul 2022 05:25:30 -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 190AC3C16B; Mon, 11 Jul 2022 02:15: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 9E72B61226; Mon, 11 Jul 2022 09:15:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB432C36AE2; Mon, 11 Jul 2022 09:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530922; bh=VPZKuoyCmG6wEttXmpKkWoqkMqKHAQupFqKBA0qKEA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sOj5P1uzD/2dzj8ii78QzFVk37JHVaPjSjltRFwkgizPqVg4P+uYoPPs8/kEFV6W/ TUMICy2xUhLbsT5C37azwGo0g5bZFCQIFhIWSXHV04KGpfVUfXM4VSG7bnl+2PMHyR j/q+eGs7KI0Zgy1C4bov/K8XQwB+F/oPtOrQIhwY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Williams , Alison Schofield Subject: [PATCH 5.18 031/112] cxl/mbox: Use __le32 in get,set_lsa mailbox structures Date: Mon, 11 Jul 2022 11:06:31 +0200 Message-Id: <20220711090550.450548703@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Alison Schofield commit 8a66487506161dbc1d22fd154d2de0244e232040 upstream. CXL specification defines these as little endian. Fixes: 60b8f17215de ("cxl/pmem: Translate NVDIMM label commands to CXL labe= l commands") Reported-by: Dan Williams Signed-off-by: Alison Schofield Link: https://lore.kernel.org/r/20220225221456.1025635-1-alison.schofield@i= ntel.com Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/cxl/cxlmem.h | 8 ++++---- drivers/cxl/pmem.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -252,13 +252,13 @@ struct cxl_mbox_identify { } __packed; =20 struct cxl_mbox_get_lsa { - u32 offset; - u32 length; + __le32 offset; + __le32 length; } __packed; =20 struct cxl_mbox_set_lsa { - u32 offset; - u32 reserved; + __le32 offset; + __le32 reserved; u8 data[]; } __packed; =20 --- a/drivers/cxl/pmem.c +++ b/drivers/cxl/pmem.c @@ -108,8 +108,8 @@ static int cxl_pmem_get_config_data(stru return -EINVAL; =20 get_lsa =3D (struct cxl_mbox_get_lsa) { - .offset =3D cmd->in_offset, - .length =3D cmd->in_length, + .offset =3D cpu_to_le32(cmd->in_offset), + .length =3D cpu_to_le32(cmd->in_length), }; =20 rc =3D cxl_mbox_send_cmd(cxlds, CXL_MBOX_OP_GET_LSA, &get_lsa, @@ -139,7 +139,7 @@ static int cxl_pmem_set_config_data(stru return -ENOMEM; =20 *set_lsa =3D (struct cxl_mbox_set_lsa) { - .offset =3D cmd->in_offset, + .offset =3D cpu_to_le32(cmd->in_offset), }; memcpy(set_lsa->data, cmd->in_buf, cmd->in_length); From nobody Sat Apr 18 21:01:21 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 55DADC43334 for ; Mon, 11 Jul 2022 09:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232711AbiGKJdt (ORCPT ); Mon, 11 Jul 2022 05:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbiGKJdA (ORCPT ); Mon, 11 Jul 2022 05:33: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 86BF778DC1; Mon, 11 Jul 2022 02:17: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 dfw.source.kernel.org (Postfix) with ESMTPS id C55FE61227; Mon, 11 Jul 2022 09:17:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D169AC34115; Mon, 11 Jul 2022 09:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531061; bh=YYUyytMC0pUftyIXjxoK3jnBzW0leo2WLvAhxuXrFMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npD0GjuXEakmizbNC47q/fXRmf2R4axDAY6wJ267dh5pN8RXl6msi/Z5x4ikruypm LO1WZBmSo7SH8y6vZtrxqpvkEfE6yPrYloh0Kojn/u8kyAWXody+1SZY+AdlAjLbyP ZijuMZFNXu8oTigwiRzXsglxdzdS1xqazHkYbiRE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Ira Weiny , Dan Williams Subject: [PATCH 5.18 032/112] cxl: Fix cleanup of port devices on failure to probe driver. Date: Mon, 11 Jul 2022 11:06:32 +0200 Message-Id: <20220711090550.479566633@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Jonathan Cameron commit db9a3a35d31ea337331f0e6e07e04bcd52642894 upstream. The device is created, and then there is a check if a driver succesfully bound to it. In event of failing the bind (e.g. failure in cxl_port_probe()) the device is left registered. When a bus rescan later occurs, fresh devices are created leading to a multiple device representing the same underlying hardware. Bad things may follow and at very least we have far to= o many devices. Fix by ensuring autoremove is registered if the device create succeeds, but doesn't depend on sucessful binding to a driver. Bug was observed as side effect of incorrect ownership in [PATCH v9 6/9] cxl/port: Read CDAT table but will result from any failure to in cxl_port_probe(). Fixes: 8dd2bc0f8e02 ("cxl/mem: Add the cxl_mem driver") Signed-off-by: Jonathan Cameron Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220609134519.11668-1-Jonathan.Cameron@hua= wei.com Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/cxl/mem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/cxl/mem.c +++ b/drivers/cxl/mem.c @@ -46,6 +46,7 @@ static int create_endpoint(struct cxl_me { struct cxl_dev_state *cxlds =3D cxlmd->cxlds; struct cxl_port *endpoint; + int rc; =20 endpoint =3D devm_cxl_add_port(&parent_port->dev, &cxlmd->dev, cxlds->component_reg_phys, parent_port); @@ -54,13 +55,17 @@ static int create_endpoint(struct cxl_me =20 dev_dbg(&cxlmd->dev, "add: %s\n", dev_name(&endpoint->dev)); =20 + rc =3D cxl_endpoint_autoremove(cxlmd, endpoint); + if (rc) + return rc; + if (!endpoint->dev.driver) { dev_err(&cxlmd->dev, "%s failed probe\n", dev_name(&endpoint->dev)); return -ENXIO; } =20 - return cxl_endpoint_autoremove(cxlmd, endpoint); + return 0; } =20 /** From nobody Sat Apr 18 21:01:21 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 5B2A5C43334 for ; Mon, 11 Jul 2022 09:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232482AbiGKJ2V (ORCPT ); Mon, 11 Jul 2022 05:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232417AbiGKJ1p (ORCPT ); Mon, 11 Jul 2022 05:27: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 8DEB064E3C; Mon, 11 Jul 2022 02:15: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 96E9F6127D; Mon, 11 Jul 2022 09:15:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A399AC34115; Mon, 11 Jul 2022 09:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530944; bh=o1OFCP3bO86cv1e3AyPnCsMYZPBo9rwY9+UU0tu8cX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tT/zscwPP4ho7JtnlrUGl8+9m/ZJjhjg/9QSgd/17gGMcqFm1kWJwECAqplQKpAdA Me2873d0117g2ZfMUR7kL/dc9DDYOZe1ebrJIL6OtX4HaC0ftaau2+i5qoZg9nnWnY r4z8YHxw2K6sEBFKK1/L4tA7V76CGpkWo2psOGzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guiling Deng , Helge Deller Subject: [PATCH 5.18 033/112] fbdev: fbmem: Fix logo center image dx issue Date: Mon, 11 Jul 2022 11:06:33 +0200 Message-Id: <20220711090550.508197556@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Guiling Deng commit 955f04766d4e6eb94bf3baa539e096808c74ebfb upstream. Image.dx gets wrong value because of missing '()'. If xres =3D=3D logo->width and n =3D=3D 1, image.dx =3D -16. Signed-off-by: Guiling Deng Fixes: 3d8b1933eb1c ("fbdev: fbmem: add config option to center the bootup = logo") Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -510,7 +510,7 @@ static int fb_show_logo_line(struct fb_i =20 while (n && (n * (logo->width + 8) - 8 > xres)) --n; - image.dx =3D (xres - n * (logo->width + 8) - 8) / 2; + image.dx =3D (xres - (n * (logo->width + 8) - 8)) / 2; image.dy =3D y ?: (yres - logo->height) / 2; } else { image.dx =3D 0; From nobody Sat Apr 18 21:01:21 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 EAB32C433EF for ; Mon, 11 Jul 2022 09:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231163AbiGKJaI (ORCPT ); Mon, 11 Jul 2022 05:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbiGKJ3R (ORCPT ); Mon, 11 Jul 2022 05:29:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18FD6A9ED; Mon, 11 Jul 2022 02:16: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 dfw.source.kernel.org (Postfix) with ESMTPS id B52696122D; Mon, 11 Jul 2022 09:16:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA9B4C34115; Mon, 11 Jul 2022 09:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530975; bh=qyyOTkvn1nf1BGX42SoGU7wvsA00jHIfSQboi+dvWiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vx2tLZTJVL7Od09Ixm/XX57v7PgnsNS3A8dO/OmEjgud4YQo8NIBslI5pAX13yAwG zAvJ7MMcXHCAQjWdMlnpe/gS2GmsUlF4bF/lRKmpxrbwk5PqBeh+mSyFDdF8uD7+yF FnzN4qQxP06l4hjETXabVyK9bcRw0LU4sTrGuvOQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller , Geert Uytterhoeven Subject: [PATCH 5.18 034/112] fbmem: Check virtual screen sizes in fb_set_var() Date: Mon, 11 Jul 2022 11:06:34 +0200 Message-Id: <20220711090550.537845731@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Helge Deller commit 6c11df58fd1ac0aefcb3b227f72769272b939e56 upstream. Verify that the fbdev or drm driver correctly adjusted the virtual screen sizes. On failure report the failing driver and reject the screen size change. Signed-off-by: Helge Deller Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/video/fbdev/core/fbmem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1016,6 +1016,16 @@ fb_set_var(struct fb_info *info, struct if (ret) return ret; =20 + /* verify that virtual resolution >=3D physical resolution */ + if (var->xres_virtual < var->xres || + var->yres_virtual < var->yres) { + pr_warn("WARNING: fbcon: Driver '%s' missed to adjust virtual screen siz= e (%ux%u vs. %ux%u)\n", + info->fix.id, + var->xres_virtual, var->yres_virtual, + var->xres, var->yres); + return -EINVAL; + } + if ((var->activate & FB_ACTIVATE_MASK) !=3D FB_ACTIVATE_NOW) return 0; From nobody Sat Apr 18 21:01:21 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 89DF6C43334 for ; Mon, 11 Jul 2022 09:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232314AbiGKJbN (ORCPT ); Mon, 11 Jul 2022 05:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232638AbiGKJan (ORCPT ); Mon, 11 Jul 2022 05:30:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F63972EC5; Mon, 11 Jul 2022 02:16:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ABC4AB80833; Mon, 11 Jul 2022 09:16:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0462DC34115; Mon, 11 Jul 2022 09:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531005; bh=S9mbCzU3aDaS30PbSuhcVdHDJcVEx5OvHyDJ8pSdBd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mrlZ43oiuVekCcvXSQfabDatNg3NNH4Dsx62mbkt/R5chPm7eYGIgvZOYi3vnz9r0 vi05qwZKND26Rx/VsByklS6x/r+8u4+ipsQ3ZgTdbtqbs6ti6AhZbimf54IzitQtkJ YhmAuVHmAy6VIcAbDhUxmxi/bUMzumdy8ibkEKtg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller , Daniel Vetter , Geert Uytterhoeven Subject: [PATCH 5.18 035/112] fbcon: Disallow setting font bigger than screen size Date: Mon, 11 Jul 2022 11:06:35 +0200 Message-Id: <20220711090550.566480384@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Helge Deller commit 65a01e601dbba8b7a51a2677811f70f783766682 upstream. Prevent that users set a font size which is bigger than the physical screen. It's unlikely this may happen (because screens are usually much larger than= the fonts and each font char is limited to 32x32 pixels), but it may happen on smaller screens/LCD displays. Signed-off-by: Helge Deller Reviewed-by: Daniel Vetter Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/video/fbdev/core/fbcon.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2480,6 +2480,11 @@ static int fbcon_set_font(struct vc_data if (charcount !=3D 256 && charcount !=3D 512) return -EINVAL; =20 + /* font bigger than screen resolution ? */ + if (w > FBCON_SWAP(info->var.rotate, info->var.xres, info->var.yres) || + h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres)) + return -EINVAL; + /* Make sure drawing engine can handle the font */ if (!(info->pixmap.blit_x & (1 << (font->width - 1))) || !(info->pixmap.blit_y & (1 << (font->height - 1)))) From nobody Sat Apr 18 21:01:21 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 D4242C43334 for ; Mon, 11 Jul 2022 09:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232651AbiGKJc2 (ORCPT ); Mon, 11 Jul 2022 05:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbiGKJbi (ORCPT ); Mon, 11 Jul 2022 05:31:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6AF741997; Mon, 11 Jul 2022 02:17:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4865B61211; Mon, 11 Jul 2022 09:17:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5023EC34115; Mon, 11 Jul 2022 09:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531035; bh=ODv6FVyFqJypdHeESRIAoKeDqcRVtLTyAlBMhN7uHHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpmQyCLe7rl12N7Qen/3pOrxYqsh9rhW2J1Mi/wfFPSUIUuqpJ4fowMAeFyioZWI1 2D2v8DOYuxVtWDUB0SSxY2nF6OxXCnZoo1rjOshQ6h8hYfvS4DPjeaHHq18HVjNC8o a8Iz2od29SKdOQ8++0925gfHqm43IzVOL5RJN+oo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller , Geert Uytterhoeven Subject: [PATCH 5.18 036/112] fbcon: Prevent that screen size is smaller than font size Date: Mon, 11 Jul 2022 11:06:36 +0200 Message-Id: <20220711090550.595447764@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Helge Deller commit e64242caef18b4a5840b0e7a9bff37abd4f4f933 upstream. We need to prevent that users configure a screen size which is smaller than= the currently selected font size. Otherwise rendering chars on the screen will access memory outside the graphics memory region. This patch adds a new function fbcon_modechange_possible() which implements this check and which later may be extended with other checks if necessary. The new function is called from the FBIOPUT_VSCREENINFO ioctl handler in fbmem.c, which will return -EINVAL if userspace asked for a too small screen size. Signed-off-by: Helge Deller Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/video/fbdev/core/fbcon.c | 28 ++++++++++++++++++++++++++++ drivers/video/fbdev/core/fbmem.c | 4 +++- include/linux/fbcon.h | 4 ++++ 3 files changed, 35 insertions(+), 1 deletion(-) --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2747,6 +2747,34 @@ void fbcon_update_vcs(struct fb_info *in } EXPORT_SYMBOL(fbcon_update_vcs); =20 +/* let fbcon check if it supports a new screen resolution */ +int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screenin= fo *var) +{ + struct fbcon_ops *ops =3D info->fbcon_par; + struct vc_data *vc; + unsigned int i; + + WARN_CONSOLE_UNLOCKED(); + + if (!ops) + return 0; + + /* prevent setting a screen size which is smaller than font size */ + for (i =3D first_fb_vc; i <=3D last_fb_vc; i++) { + vc =3D vc_cons[i].d; + if (!vc || vc->vc_mode !=3D KD_TEXT || + registered_fb[con2fb_map[i]] !=3D info) + continue; + + if (vc->vc_font.width > FBCON_SWAP(var->rotate, var->xres, var->yres) || + vc->vc_font.height > FBCON_SWAP(var->rotate, var->yres, var->xres)) + return -EINVAL; + } + + return 0; +} +EXPORT_SYMBOL_GPL(fbcon_modechange_possible); + int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1116,7 +1116,9 @@ static long do_fb_ioctl(struct fb_info * return -EFAULT; console_lock(); lock_fb_info(info); - ret =3D fb_set_var(info, &var); + ret =3D fbcon_modechange_possible(info, &var); + if (!ret) + ret =3D fb_set_var(info, &var); if (!ret) fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL); unlock_fb_info(info); --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -15,6 +15,8 @@ void fbcon_new_modelist(struct fb_info * void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps); void fbcon_fb_blanked(struct fb_info *info, int blank); +int fbcon_modechange_possible(struct fb_info *info, + struct fb_var_screeninfo *var); void fbcon_update_vcs(struct fb_info *info, bool all); void fbcon_remap_all(struct fb_info *info); int fbcon_set_con2fb_map_ioctl(void __user *argp); @@ -33,6 +35,8 @@ static inline void fbcon_new_modelist(st static inline void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps) {} static inline void fbcon_fb_blanked(struct fb_info *info, int blank) {} +static inline int fbcon_modechange_possible(struct fb_info *info, + struct fb_var_screeninfo *var) { return 0; } static inline void fbcon_update_vcs(struct fb_info *info, bool all) {} static inline void fbcon_remap_all(struct fb_info *info) {} static inline int fbcon_set_con2fb_map_ioctl(void __user *argp) { return 0= ; } From nobody Sat Apr 18 21:01:21 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 F0A87CCA483 for ; Mon, 11 Jul 2022 09:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbiGKJda (ORCPT ); Mon, 11 Jul 2022 05:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232731AbiGKJcg (ORCPT ); Mon, 11 Jul 2022 05:32: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 86F717820A; Mon, 11 Jul 2022 02:17: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 AE960B80D2C; Mon, 11 Jul 2022 09:17:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F5E8C34115; Mon, 11 Jul 2022 09:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531047; bh=brbJvPvQyUrPmRBFXJ1vZX/QnauMoQjd4xPA//Wvnoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xOZwvj3QkYqxUzRvNHgUS7OOwlF1J5gURiEGOcqswcfcSruQq40ocWyzsvaAX4gvR cmDbX6WxRgBwqXl+Qr0yTDNUBtDTb3WjlIgePlR4+h8Kp92dc66b7gHXzjkiWpeJ3d HAUF7YCD8uo6mKglrAZ+rBbBvG2akRCBFu5+KbBk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Rafael J. Wysocki" Subject: [PATCH 5.18 037/112] PM: runtime: Redefine pm_runtime_release_supplier() Date: Mon, 11 Jul 2022 11:06:37 +0200 Message-Id: <20220711090550.624905851@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Rafael J. Wysocki commit 07358194badf73e267289b40b761f5dc56928eab upstream. Instead of passing an extra bool argument to pm_runtime_release_supplier(), make its callers take care of triggering a runtime-suspend of the supplier device as needed. No expected functional impact. Suggested-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Cc: 5.1+ # 5.1+ Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/base/core.c | 3 ++- drivers/base/power/runtime.c | 20 +++++++++----------- include/linux/pm_runtime.h | 5 ++--- 3 files changed, 13 insertions(+), 15 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -485,7 +485,8 @@ static void device_link_release_fn(struc /* Ensure that all references to the link object have been dropped. */ device_link_synchronize_removal(); =20 - pm_runtime_release_supplier(link, true); + pm_runtime_release_supplier(link); + pm_request_idle(link->supplier); =20 put_device(link->consumer); put_device(link->supplier); --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -308,13 +308,10 @@ static int rpm_get_suppliers(struct devi /** * pm_runtime_release_supplier - Drop references to device link's supplier. * @link: Target device link. - * @check_idle: Whether or not to check if the supplier device is idle. * - * Drop all runtime PM references associated with @link to its supplier de= vice - * and if @check_idle is set, check if that device is idle (and so it can = be - * suspended). + * Drop all runtime PM references associated with @link to its supplier de= vice. */ -void pm_runtime_release_supplier(struct device_link *link, bool check_idle) +void pm_runtime_release_supplier(struct device_link *link) { struct device *supplier =3D link->supplier; =20 @@ -327,9 +324,6 @@ void pm_runtime_release_supplier(struct while (refcount_dec_not_one(&link->rpm_active) && atomic_read(&supplier->power.usage_count) > 0) pm_runtime_put_noidle(supplier); - - if (check_idle) - pm_request_idle(supplier); } =20 static void __rpm_put_suppliers(struct device *dev, bool try_to_suspend) @@ -337,8 +331,11 @@ static void __rpm_put_suppliers(struct d struct device_link *link; =20 list_for_each_entry_rcu(link, &dev->links.suppliers, c_node, - device_links_read_lock_held()) - pm_runtime_release_supplier(link, try_to_suspend); + device_links_read_lock_held()) { + pm_runtime_release_supplier(link); + if (try_to_suspend) + pm_request_idle(link->supplier); + } } =20 static void rpm_put_suppliers(struct device *dev) @@ -1807,7 +1804,8 @@ void pm_runtime_drop_link(struct device_ return; =20 pm_runtime_drop_link_count(link->consumer); - pm_runtime_release_supplier(link, true); + pm_runtime_release_supplier(link); + pm_request_idle(link->supplier); } =20 static bool pm_runtime_need_not_resume(struct device *dev) --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -82,7 +82,7 @@ extern void pm_runtime_get_suppliers(str extern void pm_runtime_put_suppliers(struct device *dev); extern void pm_runtime_new_link(struct device *dev); extern void pm_runtime_drop_link(struct device_link *link); -extern void pm_runtime_release_supplier(struct device_link *link, bool che= ck_idle); +extern void pm_runtime_release_supplier(struct device_link *link); =20 extern int devm_pm_runtime_enable(struct device *dev); =20 @@ -308,8 +308,7 @@ static inline void pm_runtime_get_suppli static inline void pm_runtime_put_suppliers(struct device *dev) {} static inline void pm_runtime_new_link(struct device *dev) {} static inline void pm_runtime_drop_link(struct device_link *link) {} -static inline void pm_runtime_release_supplier(struct device_link *link, - bool check_idle) {} +static inline void pm_runtime_release_supplier(struct device_link *link) {} =20 #endif /* !CONFIG_PM */ From nobody Sat Apr 18 21:01:21 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 268BCC43334 for ; Mon, 11 Jul 2022 09:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232909AbiGKJdZ (ORCPT ); Mon, 11 Jul 2022 05:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231447AbiGKJcn (ORCPT ); Mon, 11 Jul 2022 05:32:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8BB17822A; Mon, 11 Jul 2022 02:17:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 774B1B80E74; Mon, 11 Jul 2022 09:17:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4747C341CE; Mon, 11 Jul 2022 09:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531050; bh=YVnFkwa8Y6Ua+2s8C/87eVG7a1hYAbDX9XzAqUxF8pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKpre+DunpdAOKlOFGvQ+Mm3GmoyY+9EwTJYDXmd3jvUduZQtB7GYLuAYsQet8jN7 3aluaxs5hDFKcdJZXzDTSxXMR1n9afjjyZpKSy5GAFydcatjFEhXo4dBGlo29+/s3L 7QMiqQy8M65zT0zYuYKfV9WGKL4lZ7N8ZT0LC46Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Wang , "Rafael J. Wysocki" Subject: [PATCH 5.18 038/112] PM: runtime: Fix supplier device management during consumer probe Date: Mon, 11 Jul 2022 11:06:38 +0200 Message-Id: <20220711090550.653474614@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Rafael J. Wysocki commit 887371066039011144b4a94af97d9328df6869a2 upstream. Because pm_runtime_get_suppliers() bumps up the rpm_active counter of each device link to a supplier of the given device in addition to bumping up the supplier's PM-runtime usage counter, a runtime suspend of the consumer device may case the latter to go down to 0 when pm_runtime_put_suppliers() is running on a remote CPU. If that happens after pm_runtime_put_suppliers() has released power.lock for the consumer device, and a runtime resume of that device takes place immediately after it, before pm_runtime_put() is called for the supplier, that pm_runtime_put() call may cause the supplier to be suspended even though the consumer is active. To prevent that from happening, modify pm_runtime_get_suppliers() to call pm_runtime_get_sync() for the given device's suppliers without touching the rpm_active counters of the involved device links Accordingly, modify pm_runtime_put_suppliers() to call pm_runtime_put() for the given device's suppliers without looking at the rpm_active counters of the device links at hand. [This is analogous to what happened before commit 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter imbalance").] Since pm_runtime_get_suppliers() sets supplier_preactivated for each device link where the supplier's PM-runtime usage counter has been incremented and pm_runtime_put_suppliers() calls pm_runtime_put() for the suppliers whose device links have supplier_preactivated set, the PM-runtime usage counter is balanced for each supplier and this is independent of the runtime suspend and resume of the consumer device. However, in case a device link with DL_FLAG_PM_RUNTIME set is dropped during the consumer device probe, so pm_runtime_get_suppliers() bumps up the supplier's PM-runtime usage counter, but it cannot be dropped by pm_runtime_put_suppliers(), make device_link_release_fn() take care of that. Fixes: 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter i= mbalance") Reported-by: Peter Wang Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Reviewed-by: Peter Wang Cc: 5.1+ # 5.1+ Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/base/core.c | 10 ++++++++++ drivers/base/power/runtime.c | 14 +------------- 2 files changed, 11 insertions(+), 13 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -486,6 +486,16 @@ static void device_link_release_fn(struc device_link_synchronize_removal(); =20 pm_runtime_release_supplier(link); + /* + * If supplier_preactivated is set, the link has been dropped between + * the pm_runtime_get_suppliers() and pm_runtime_put_suppliers() calls + * in __driver_probe_device(). In that case, drop the supplier's + * PM-runtime usage counter to remove the reference taken by + * pm_runtime_get_suppliers(). + */ + if (link->supplier_preactivated) + pm_runtime_put_noidle(link->supplier); + pm_request_idle(link->supplier); =20 put_device(link->consumer); --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1737,7 +1737,6 @@ void pm_runtime_get_suppliers(struct dev if (link->flags & DL_FLAG_PM_RUNTIME) { link->supplier_preactivated =3D true; pm_runtime_get_sync(link->supplier); - refcount_inc(&link->rpm_active); } =20 device_links_read_unlock(idx); @@ -1757,19 +1756,8 @@ void pm_runtime_put_suppliers(struct dev list_for_each_entry_rcu(link, &dev->links.suppliers, c_node, device_links_read_lock_held()) if (link->supplier_preactivated) { - bool put; - link->supplier_preactivated =3D false; - - spin_lock_irq(&dev->power.lock); - - put =3D pm_runtime_status_suspended(dev) && - refcount_dec_not_one(&link->rpm_active); - - spin_unlock_irq(&dev->power.lock); - - if (put) - pm_runtime_put(link->supplier); + pm_runtime_put(link->supplier); } =20 device_links_read_unlock(idx); From nobody Sat Apr 18 21:01:21 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 E4F94CCA482 for ; Mon, 11 Jul 2022 09:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbiGKJdg (ORCPT ); Mon, 11 Jul 2022 05:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232268AbiGKJcp (ORCPT ); Mon, 11 Jul 2022 05:32:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FDA978216; Mon, 11 Jul 2022 02:17:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A3E5861227; Mon, 11 Jul 2022 09:17:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5AB1C34115; Mon, 11 Jul 2022 09:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531053; bh=SKoJobLuXWL5FRX92QKZJyelch0U0Zzj/8c/a3u1sTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XT3B5120QJweKUh2APK5Kw4i1qYi5ETHd85UOdUFIYW6mOCHhi/UFyzxdKfmcKBu2 RkWhLhNhKFlRvKf5xHL4f3CaJd906T/26tzxjqKaX7n1TE5i587pJH7U2dKnWZpns7 Irw+Lrn3HGM0JEbE0ZG+VUBHv2NiDabfrwCeV2DQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Alison Schofield , Dan Williams Subject: [PATCH 5.18 039/112] memregion: Fix memregion_free() fallback definition Date: Mon, 11 Jul 2022 11:06:39 +0200 Message-Id: <20220711090550.682502815@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dan Williams commit f50974eee5c4a5de1e4f1a3d873099f170df25f8 upstream. In the CONFIG_MEMREGION=3Dn case, memregion_free() is meant to be a static inline. 0day reports: In file included from drivers/cxl/core/port.c:4: include/linux/memregion.h:19:6: warning: no previous prototype for function 'memregion_free' [-Wmissing-prototypes] Mark memregion_free() static. Fixes: 33dd70752cd7 ("lib: Uplevel the pmem "region" ida to a global alloca= tor") Reported-by: kernel test robot Reviewed-by: Alison Schofield Link: https://lore.kernel.org/r/165601455171.4042645.3350844271068713515.st= git@dwillia2-xfh Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- include/linux/memregion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/memregion.h +++ b/include/linux/memregion.h @@ -16,7 +16,7 @@ static inline int memregion_alloc(gfp_t { return -ENOMEM; } -void memregion_free(int id) +static inline void memregion_free(int id) { } #endif From nobody Sat Apr 18 21:01:21 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 42E6DC43334 for ; Mon, 11 Jul 2022 09:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232622AbiGKJdk (ORCPT ); Mon, 11 Jul 2022 05:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232548AbiGKJcs (ORCPT ); Mon, 11 Jul 2022 05:32:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F1978DC7; Mon, 11 Jul 2022 02:17:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 52440612AF; Mon, 11 Jul 2022 09:17:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68F14C34115; Mon, 11 Jul 2022 09:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531055; bh=7glkkp0LLer/1vOu19Ra/fd2zYttlhPNl2QaoAA/NUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQYINLdC49PaaQWu24jYBLLNQn1xZh5sWqPAJ1qcnvGqInoq+P1wIc2M/6RhVl+qr h0zuxGVzCmohiY3NEYHDIQS2xaeEnj4EFEWaGhpwitHjOro/ggE6fiGkXIrpIACgKw AULyfDN9jnkMzihEphu9kfTZJdwIMxAmyQUdgIlA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Boyd , Hsin-Yi Wang , Helge Deller Subject: [PATCH 5.18 040/112] video: of_display_timing.h: include errno.h Date: Mon, 11 Jul 2022 11:06:40 +0200 Message-Id: <20220711090550.711265777@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 3663a2fb325b8782524f3edb0ae32d6faa615109 upstream. If CONFIG_OF is not enabled, default of_get_display_timing() returns an errno, so include the header. Fixes: 422b67e0b31a ("videomode: provide dummy inline functions for !CONFIG= _OF") Suggested-by: Stephen Boyd Signed-off-by: Hsin-Yi Wang Reviewed-by: Stephen Boyd Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- include/video/of_display_timing.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/video/of_display_timing.h +++ b/include/video/of_display_timing.h @@ -8,6 +8,8 @@ #ifndef __LINUX_OF_DISPLAY_TIMING_H #define __LINUX_OF_DISPLAY_TIMING_H =20 +#include + struct device_node; struct display_timing; struct display_timings; From nobody Sat Apr 18 21:01:21 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 274A2C43334 for ; Mon, 11 Jul 2022 09:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbiGKJdo (ORCPT ); Mon, 11 Jul 2022 05:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbiGKJc4 (ORCPT ); Mon, 11 Jul 2022 05:32:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9639B78DD7; Mon, 11 Jul 2022 02:17: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 0A18F6122D; Mon, 11 Jul 2022 09:17:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1939DC34115; Mon, 11 Jul 2022 09:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531058; bh=DoAdjjA6vsIejV4loK50pbT1nheKnTBbr6OKl7P5HVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xI2r2tV2oaCCmHe8jjDMDLyEbyEtQaxqRhy2mMYSe2pefYuoQprR+rruR23qvVTm2 fTaRFsOMO9+b0YPNuje1LW+5s4WFWRZzQxrO506r3t2PTK2RO7VIv61lCqJSEl8VVj mUxaxM5Sl8vFsfjjFv0sDhEKbiR1SOBtXxueEESs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Kellermann , David Howells Subject: [PATCH 5.18 041/112] fscache: Fix invalidation/lookup race Date: Mon, 11 Jul 2022 11:06:41 +0200 Message-Id: <20220711090550.739560152@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: David Howells commit 85e4ea1049c70fb99de5c6057e835d151fb647da upstream. If an NFS file is opened for writing and closed, fscache_invalidate() will be asked to invalidate the file - however, if the cookie is in the LOOKING_UP state (or the CREATING state), then request to invalidate doesn't get recorded for fscache_cookie_state_machine() to do something with. Fix this by making __fscache_invalidate() set a flag if it sees the cookie is in the LOOKING_UP state to indicate that we need to go to invalidation. Note that this requires a count on the n_accesses counter for the state machine, which that will release when it's done. fscache_cookie_state_machine() then shifts to the INVALIDATING state if it sees the flag. Without this, an nfs file can get corrupted if it gets modified locally and then read locally as the cache contents may not get updated. Fixes: d24af13e2e23 ("fscache: Implement cookie invalidation") Reported-by: Max Kellermann Signed-off-by: David Howells Tested-by: Max Kellermann Link: https://lore.kernel.org/r/YlWWbpW5Foynjllo@rabbit.intern.cm-ag [1] Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- fs/fscache/cookie.c | 15 ++++++++++++++- include/linux/fscache.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -517,7 +517,14 @@ static void fscache_perform_lookup(struc } =20 fscache_see_cookie(cookie, fscache_cookie_see_active); - fscache_set_cookie_state(cookie, FSCACHE_COOKIE_STATE_ACTIVE); + spin_lock(&cookie->lock); + if (test_and_clear_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags)) + __fscache_set_cookie_state(cookie, + FSCACHE_COOKIE_STATE_INVALIDATING); + else + __fscache_set_cookie_state(cookie, FSCACHE_COOKIE_STATE_ACTIVE); + spin_unlock(&cookie->lock); + wake_up_cookie_state(cookie); trace =3D fscache_access_lookup_cookie_end; =20 out: @@ -752,6 +759,9 @@ again_locked: spin_lock(&cookie->lock); } =20 + if (test_and_clear_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags)) + fscache_end_cookie_access(cookie, fscache_access_invalidate_cookie_end); + switch (state) { case FSCACHE_COOKIE_STATE_RELINQUISHING: fscache_see_cookie(cookie, fscache_cookie_see_relinquish); @@ -1048,6 +1058,9 @@ void __fscache_invalidate(struct fscache return; =20 case FSCACHE_COOKIE_STATE_LOOKING_UP: + __fscache_begin_cookie_access(cookie, fscache_access_invalidate_cookie); + set_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags); + fallthrough; case FSCACHE_COOKIE_STATE_CREATING: spin_unlock(&cookie->lock); _leave(" [look %x]", cookie->inval_counter); --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -129,6 +129,7 @@ struct fscache_cookie { #define FSCACHE_COOKIE_DO_PREP_TO_WRITE 12 /* T if cookie needs write pre= paration */ #define FSCACHE_COOKIE_HAVE_DATA 13 /* T if this cookie has data stored */ #define FSCACHE_COOKIE_IS_HASHED 14 /* T if this cookie is hashed */ +#define FSCACHE_COOKIE_DO_INVALIDATE 15 /* T if cookie needs invalidation= */ =20 enum fscache_cookie_state state; u8 advice; /* FSCACHE_ADV_* */ From nobody Sat Apr 18 21:01:21 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 7B134C433EF for ; Mon, 11 Jul 2022 09:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbiGKJ2n (ORCPT ); Mon, 11 Jul 2022 05:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbiGKJ2J (ORCPT ); Mon, 11 Jul 2022 05:28:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D187065D4A; Mon, 11 Jul 2022 02:15:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1895EB80CEF; Mon, 11 Jul 2022 09:15:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66D89C34115; Mon, 11 Jul 2022 09:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530946; bh=W8/U7RwBnc4bjGCMnrC47ATNXOlB1KpgtdGMePTGKuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JeC3ZXeqQS3jLUSVS+3rZarJzq5xz50vvvapDFMKlMjAW7vRtQrkzOF6bQv1v8OsT H1e78waiISvdu5EsCocoei3gi68dL+zMeFuB2SzLAQsq5CDRQmHdtuye7WOn9nImDT c+9JYvmkvRjikv9s12FFkmPBVZf0WNxqbc4V9TC4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yue Hu , David Howells , Gao Xiang , Jeffle Xu , Jeff Layton Subject: [PATCH 5.18 042/112] fscache: Fix if condition in fscache_wait_on_volume_collision() Date: Mon, 11 Jul 2022 11:06:42 +0200 Message-Id: <20220711090550.767202252@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Yue Hu commit bf17455b9cbd4b10bf30d39c047307e1d774fb1a upstream. After waiting for the volume to complete the acquisition with timeout, the if condition under which potential volume collision occurs should be acquire the volume is still pending rather than not pending so that we will continue to wait until the pending flag is cleared. Also, use the existing test pending wrapper directly instead of test_bit(). Fixes: 62ab63352350 ("fscache: Implement volume registration") Signed-off-by: Yue Hu Signed-off-by: David Howells Reviewed-by: Gao Xiang Reviewed-by: Jeffle Xu Reviewed-by: Jeff Layton Link: https://listman.redhat.com/archives/linux-cachefs/2022-May/006918.html Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- fs/fscache/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/fscache/volume.c +++ b/fs/fscache/volume.c @@ -143,7 +143,7 @@ static void fscache_wait_on_volume_colli { wait_var_event_timeout(&candidate->flags, !fscache_is_acquire_pending(candidate), 20 * HZ); - if (!fscache_is_acquire_pending(candidate)) { + if (fscache_is_acquire_pending(candidate)) { pr_notice("Potential volume collision new=3D%08x old=3D%08x", candidate->debug_id, collidee_debug_id); fscache_stat(&fscache_n_volumes_collision); @@ -182,7 +182,7 @@ static bool fscache_hash_volume(struct f hlist_bl_add_head(&candidate->hash_link, h); hlist_bl_unlock(h); =20 - if (test_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, &candidate->flags)) + if (fscache_is_acquire_pending(candidate)) fscache_wait_on_volume_collision(candidate, collidee_debug_id); return true; From nobody Sat Apr 18 21:01:21 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 9662AC433EF for ; Mon, 11 Jul 2022 09:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbiGKJ3B (ORCPT ); Mon, 11 Jul 2022 05:29:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbiGKJ2a (ORCPT ); Mon, 11 Jul 2022 05:28:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B43066AF8; Mon, 11 Jul 2022 02:15:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 34307CE1256; Mon, 11 Jul 2022 09:15:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25DC5C341C0; Mon, 11 Jul 2022 09:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530949; bh=K6jNGp2dUuNiWhAggovJ4j01QWBZArB13C35cE1qd8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2sObBLVnxmLMeCVvKM+Pd9f810Bjmi+tHJTHfRIPvWZZDREILT8xn8ZaYrSAXasz8 80kKjhQhpKEOKUPTLCCOv7X8b8gsezPA7E8jDlVa1H3GXNvhiy6PzUyW4KP0uwuVMh AJfYwdmJHoDyVfPYZaY5rQZSFRWIbLLg3f+tkyaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sachin Sant , "Jason A. Donenfeld" , Michael Ellerman Subject: [PATCH 5.18 043/112] powerpc/powernv: delay rng platform device creation until later in boot Date: Mon, 11 Jul 2022 11:06:43 +0200 Message-Id: <20220711090550.795413187@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 887502826549caa7e4215fd9e628f48f14c0825a upstream. The platform device for the rng must be created much later in boot. Otherwise it tries to connect to a parent that doesn't yet exist, resulting in this splat: [ 0.000478] kobject: '(null)' ((____ptrval____)): is not initialized, = yet kobject_get() is being called. [ 0.002925] [c000000002a0fb30] [c00000000073b0bc] kobject_get+0x8c/0x1= 00 (unreliable) [ 0.003071] [c000000002a0fba0] [c00000000087e464] device_add+0xf4/0xb00 [ 0.003194] [c000000002a0fc80] [c000000000a7f6e4] of_device_add+0x64/0= x80 [ 0.003321] [c000000002a0fcb0] [c000000000a800d0] of_platform_device_c= reate_pdata+0xd0/0x1b0 [ 0.003476] [c000000002a0fd00] [c00000000201fa44] pnv_get_random_long_= early+0x240/0x2e4 [ 0.003623] [c000000002a0fe20] [c000000002060c38] random_init+0xc0/0x2= 14 This patch fixes the issue by doing the platform device creation inside of machine_subsys_initcall. Fixes: f3eac426657d ("powerpc/powernv: wire up rng during setup_arch") Cc: stable@vger.kernel.org Reported-by: Sachin Sant Signed-off-by: Jason A. Donenfeld Tested-by: Sachin Sant [mpe: Change "of node" to "platform device" in change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220630121654.1939181-1-Jason@zx2c4.com Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/powerpc/platforms/powernv/rng.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/arch/powerpc/platforms/powernv/rng.c +++ b/arch/powerpc/platforms/powernv/rng.c @@ -176,12 +176,8 @@ static int __init pnv_get_random_long_ea NULL) !=3D pnv_get_random_long_early) return 0; =20 - for_each_compatible_node(dn, NULL, "ibm,power-rng") { - if (rng_create(dn)) - continue; - /* Create devices for hwrng driver */ - of_platform_device_create(dn, NULL, NULL); - } + for_each_compatible_node(dn, NULL, "ibm,power-rng") + rng_create(dn); =20 if (!ppc_md.get_random_seed) return 0; @@ -205,10 +201,18 @@ void __init pnv_rng_init(void) =20 static int __init pnv_rng_late_init(void) { + struct device_node *dn; 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); + + if (ppc_md.get_random_seed =3D=3D powernv_get_random_long) { + for_each_compatible_node(dn, NULL, "ibm,power-rng") + of_platform_device_create(dn, NULL, NULL); + } + return 0; } machine_subsys_initcall(powernv, pnv_rng_late_init); From nobody Sat Apr 18 21:01:21 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 3F3CBC433EF for ; Mon, 11 Jul 2022 09:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbiGKJ25 (ORCPT ); Mon, 11 Jul 2022 05:28:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232461AbiGKJ2T (ORCPT ); Mon, 11 Jul 2022 05:28:19 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A22166AF1; Mon, 11 Jul 2022 02:15:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C600FCE1260; Mon, 11 Jul 2022 09:15:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D75CDC34115; Mon, 11 Jul 2022 09:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530952; bh=/sbOSX3Pnsxhpi+1YjZXiP7EM8K6cK3NsOE1FwYeRFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MaxrDC+BrL36d47/jbDs+ajZ3SSgeCtpAxmOsv5D/XVui+7Yow35ffNB9wcrb2fYm 6ovIl5UIcleIAnBs703pFpZ8Dd6RiwFbHDoHvXzvbnfBag5nnTNRFpaon6nJVzl+mF vdYQJS/zXee0m5uZP8Cy2vx+3SAJVK1FXBZ++yPY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Marangi , Jakub Kicinski Subject: [PATCH 5.18 044/112] net: dsa: qca8k: reset cpu port on MTU change Date: Mon, 11 Jul 2022 11:06:44 +0200 Message-Id: <20220711090550.823175937@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Christian Marangi commit 386228c694bf1e7a7688e44412cb33500b0ac585 upstream. It was discovered that the Documentation lacks of a fundamental detail on how to correctly change the MAX_FRAME_SIZE of the switch. In fact if the MAX_FRAME_SIZE is changed while the cpu port is on, the switch panics and cease to send any packet. This cause the mgmt ethernet system to not receive any packet (the slow fallback still works) and makes the device not reachable. To recover from this a switch reset is required. To correctly handle this, turn off the cpu ports before changing the MAX_FRAME_SIZE and turn on again after the value is applied. Fixes: f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20220621151122.10220-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/dsa/qca8k.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -2372,7 +2372,7 @@ static int qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) { struct qca8k_priv *priv =3D ds->priv; - int i, mtu =3D 0; + int ret, i, mtu =3D 0; =20 priv->port_mtu[port] =3D new_mtu; =20 @@ -2380,8 +2380,27 @@ qca8k_port_change_mtu(struct dsa_switch if (priv->port_mtu[i] > mtu) mtu =3D priv->port_mtu[i]; =20 + /* To change the MAX_FRAME_SIZE the cpu ports must be off or + * the switch panics. + * Turn off both cpu ports before applying the new value to prevent + * this. + */ + if (priv->port_sts[0].enabled) + qca8k_port_set_status(priv, 0, 0); + + if (priv->port_sts[6].enabled) + qca8k_port_set_status(priv, 6, 0); + /* Include L2 header / FCS length */ - return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_L= EN); + ret =3D qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_= LEN); + + if (priv->port_sts[0].enabled) + qca8k_port_set_status(priv, 0, 1); + + if (priv->port_sts[6].enabled) + qca8k_port_set_status(priv, 6, 1); + + return ret; } =20 static int From nobody Sat Apr 18 21:01:21 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 E1EDEC43334 for ; Mon, 11 Jul 2022 09:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbiGKJ3H (ORCPT ); Mon, 11 Jul 2022 05:29:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232297AbiGKJ2c (ORCPT ); Mon, 11 Jul 2022 05:28:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C0366B83; Mon, 11 Jul 2022 02:15:59 -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 55521B80E6D; Mon, 11 Jul 2022 09:15:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF179C34115; Mon, 11 Jul 2022 09:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530955; bh=8xduzV9XPwv+MRJJNBuvjbGKAF/YIl6fxiUCeWx2Z4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FeNbjR8toCySRRLL6K6rn7EuTzIWbwEh7Dh8Hv0tz/BToehms2EJAPdFLxNy0fpHy l5br1bn5kfsUzZvYO6k2V2/aUUzJguhGJDOLuAChxudbh5IT97ArOYsvZ+k9V4CpxA EQRCLT/LqBb+dVytw+qjWQoC5aYGly0e0f4QHfbg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Martin Blumenstingl , Neil Armstrong , Sasha Levin Subject: [PATCH 5.18 045/112] ARM: meson: Fix refcount leak in meson_smp_prepare_cpus Date: Mon, 11 Jul 2022 11:06:45 +0200 Message-Id: <20220711090550.851832759@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin [ Upstream commit 34d2cd3fccced12b958b8848e3eff0ee4296764c ] 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: d850f3e5d296 ("ARM: meson: Add SMP bringup code for Meson8 and Meson= 8b") Signed-off-by: Miaoqian Lin Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220512021611.47921-1-linmq006@gmail.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-meson/platsmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-meson/platsmp.c b/arch/arm/mach-meson/platsmp.c index 4b8ad728bb42..32ac60b89fdc 100644 --- a/arch/arm/mach-meson/platsmp.c +++ b/arch/arm/mach-meson/platsmp.c @@ -71,6 +71,7 @@ static void __init meson_smp_prepare_cpus(const char *scu= _compatible, } =20 sram_base =3D of_iomap(node, 0); + of_node_put(node); if (!sram_base) { pr_err("Couldn't map SRAM registers\n"); return; @@ -91,6 +92,7 @@ static void __init meson_smp_prepare_cpus(const char *scu= _compatible, } =20 scu_base =3D of_iomap(node, 0); + of_node_put(node); if (!scu_base) { pr_err("Couldn't map SCU registers\n"); return; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 0D5E6CCA480 for ; Mon, 11 Jul 2022 09:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbiGKJ34 (ORCPT ); Mon, 11 Jul 2022 05:29:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232311AbiGKJ2l (ORCPT ); Mon, 11 Jul 2022 05:28:41 -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 933E966BAE; Mon, 11 Jul 2022 02:16: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 740DFB80E76; Mon, 11 Jul 2022 09:15:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C6A7C341C0; Mon, 11 Jul 2022 09:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530958; bh=JnbQUXFmoCPU/Ryxi5nJ3JILasfWjNYUzM7FYb5s3Dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v3cOSiqDotguFJ+lWWhl4b06ja+7eu0UwX9S8vf6NVwv55460T15eW+hNxlkUwYAA r3RXGM7BEDhT5SWu/r5rJvsUtqEV52Tw1kH1B7kSOSOHojbNUr3NvEZjqL+T6eiOo+ bya79tCnnGwLygYlzwzQDe1P1BlEp6Du/wsHjEls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Holland , Jernej Skrabec , Linus Walleij , Sasha Levin Subject: [PATCH 5.18 046/112] pinctrl: sunxi: a83t: Fix NAND function name for some pins Date: Mon, 11 Jul 2022 11:06:46 +0200 Message-Id: <20220711090550.879919936@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Samuel Holland [ Upstream commit aaefa29270d9551b604165a08406543efa9d16f5 ] The other NAND pins on Port C use the "nand0" function name. "nand0" also matches all of the other Allwinner SoCs. Fixes: 4730f33f0d82 ("pinctrl: sunxi: add allwinner A83T PIO controller sup= port") Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220526024956.49500-1-samuel@sholland.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c b/drivers/pinctrl/s= unxi/pinctrl-sun8i-a83t.c index 4ada80317a3b..b5c1a8f363f3 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c @@ -158,26 +158,26 @@ static const struct sunxi_desc_pin sun8i_a83t_pins[] = =3D { SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x2, "nand"), /* DQ6 */ + SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */ SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x2, "nand"), /* DQ7 */ + SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */ SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x2, "nand"), /* DQS */ + SUNXI_FUNCTION(0x2, "nand0"), /* DQS */ SUNXI_FUNCTION(0x3, "mmc2")), /* RST */ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x2, "nand")), /* CE2 */ + SUNXI_FUNCTION(0x2, "nand0")), /* CE2 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x2, "nand")), /* CE3 */ + SUNXI_FUNCTION(0x2, "nand0")), /* CE3 */ /* Hole */ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2), SUNXI_FUNCTION(0x0, "gpio_in"), --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 13718C433EF for ; Mon, 11 Jul 2022 09:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231913AbiGKJ3u (ORCPT ); Mon, 11 Jul 2022 05:29:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbiGKJ2l (ORCPT ); Mon, 11 Jul 2022 05:28:41 -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 1D15466BB5; Mon, 11 Jul 2022 02:16:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 693286122D; Mon, 11 Jul 2022 09:16:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DBCEC34115; Mon, 11 Jul 2022 09:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530960; bh=Mk2mPfafefPzBg8D/s3U0LXolpcBRBnONqnf4t85Qdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gD/Kk6tFyP63Z/I5hIMsz1vKDCD9bLbRMuhI9aDDJ5jDwaTZog8IYZrblfsAKPZcc J7pAclhKOQmGBgZCBy23VzQ4S672zCfNx1nWOMKxVQMrmm3VzpfSAK/KKNxKj1/TxE 3o+IxKwk5Nof8rkP4hyNr8CCzfZhxiq0n9xp//oQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Paul E. McKenney" , Sasha Levin Subject: [PATCH 5.18 047/112] srcu: Tighten cleanup_srcu_struct() GP checks Date: Mon, 11 Jul 2022 11:06:47 +0200 Message-Id: <20220711090550.908046442@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Paul E. McKenney [ Upstream commit 8ed00760203d8018bee042fbfe8e076579be2c2b ] Currently, cleanup_srcu_struct() checks for a grace period in progress, but it does not check for a grace period that has not yet started but which might start at any time. Such a situation could result in a use-after-free bug, so this commit adds a check for a grace period that is needed but not yet started to cleanup_srcu_struct(). Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- kernel/rcu/srcutree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 6833d8887181..d30e4db04506 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -382,9 +382,11 @@ void cleanup_srcu_struct(struct srcu_struct *ssp) return; /* Forgot srcu_barrier(), so just leak it! */ } if (WARN_ON(rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq)) !=3D SRCU_STATE_ID= LE) || + WARN_ON(rcu_seq_current(&ssp->srcu_gp_seq) !=3D ssp->srcu_gp_seq_need= ed) || WARN_ON(srcu_readers_active(ssp))) { - pr_info("%s: Active srcu_struct %p state: %d\n", - __func__, ssp, rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq))); + pr_info("%s: Active srcu_struct %p read state: %d gp state: %lu/%lu\n", + __func__, ssp, rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq)), + rcu_seq_current(&ssp->srcu_gp_seq), ssp->srcu_gp_seq_needed); return; /* Caller forgot to stop doing call_srcu()? */ } free_percpu(ssp->sda); --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 EAF2DC433EF for ; Mon, 11 Jul 2022 09:31:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232641AbiGKJbK (ORCPT ); Mon, 11 Jul 2022 05:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbiGKJ2o (ORCPT ); Mon, 11 Jul 2022 05:28:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11ABC67597; Mon, 11 Jul 2022 02:16:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2956FB80DB7; Mon, 11 Jul 2022 09:16:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DFF4C34115; Mon, 11 Jul 2022 09:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530963; bh=ZF+WrzFbhV5KX1eMz2BAXCroj3WkNOc6oPxo40Y+VAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sIS3VmYr7gUUNAwu8jDugOEVZzI8KuzQ6Qush6t78GnzDMYUUlyxgbJz+ddbeAcfH gMTiJwtJ4hi8TVE2EKERxwofuzI303Aboh0hAvtA6G0oxUby3Hzj5GqhomQjKm0/Pm uOgOm8DWX3r/a7TfSr5WkbKcg3Xtq1tphW6dZBiA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.18 048/112] ASoC: rt711: Add endianness flag in snd_soc_component_driver Date: Mon, 11 Jul 2022 11:06:48 +0200 Message-Id: <20220711090550.935510604@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Charles Keepax [ Upstream commit 33f06beac3ade10834a82ad4105dcd91d4b00d61 ] The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-31-ckeepax@opensource= .cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/codecs/rt711.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index ea25fd58d43a..9838fb4d5b9c 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -950,6 +950,7 @@ static const struct snd_soc_component_driver soc_codec_= dev_rt711 =3D { .num_dapm_routes =3D ARRAY_SIZE(rt711_audio_map), .set_jack =3D rt711_set_jack_detect, .remove =3D rt711_remove, + .endianness =3D 1, }; =20 static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 E9AA0CCA47B for ; Mon, 11 Jul 2022 09:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232491AbiGKJaD (ORCPT ); Mon, 11 Jul 2022 05:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232430AbiGKJ26 (ORCPT ); Mon, 11 Jul 2022 05:28:58 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42ABD3D5BB; Mon, 11 Jul 2022 02:16:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4C3AECE1257; Mon, 11 Jul 2022 09:16:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3596EC34115; Mon, 11 Jul 2022 09:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530966; bh=JPTtwrhYO+9fwde/gMayrS/kfAgw334mCpu7LaLrJOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvAOPLoyQTU/f096wBGZMRHNGf/Ftg0Au6nEyN7UyFcFDjI/JGikwfhibOOwDbLq/ bVVIgS7IgGiWwdDyRN5UfrIwJmYwJyq9FUZWI0IxF0G922QwLuzc9TqmfuQgQFPDMg 3+6EJ69OfTW9TSNls5z6LyZtvGTf89TaCDYyy7fE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.18 049/112] ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driver Date: Mon, 11 Jul 2022 11:06:49 +0200 Message-Id: <20220711090550.964084337@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Charles Keepax [ Upstream commit 3e50a5001055d79c04ea1c79fe4b4ff937a3339c ] The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-32-ckeepax@opensource= .cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/codecs/rt711-sdca.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c index bdb1375f0338..57629c18db38 100644 --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -1208,6 +1208,7 @@ static const struct snd_soc_component_driver soc_sdca= _dev_rt711 =3D { .num_dapm_routes =3D ARRAY_SIZE(rt711_sdca_audio_map), .set_jack =3D rt711_sdca_set_jack_detect, .remove =3D rt711_sdca_remove, + .endianness =3D 1, }; =20 static int rt711_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_st= ream, --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 55DF2C43334 for ; Mon, 11 Jul 2022 09:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232441AbiGKJ37 (ORCPT ); Mon, 11 Jul 2022 05:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbiGKJ2x (ORCPT ); Mon, 11 Jul 2022 05:28: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 08AAA67CB3; Mon, 11 Jul 2022 02:16: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 275D061226; Mon, 11 Jul 2022 09:16:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E632C34115; Mon, 11 Jul 2022 09:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530969; bh=aGhW0L5S5/qszPA/VigzEF4H7aLqd5d9aPEeEJjbKXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y6f9bSWUJi9DghfpybpyOVNz4vmG98u0/9OYBF4J7mAUCsvyrN5a8S5cd8Pe22Wci k+cEwTskXPyno3JFv45lkCspGDTD7MqgeEcrSHqFj5zJbIxw4y8vLRjcc7VQx8qT0v CpdV+QePMEbPeqSWTtT9NZ3FneeySoRjOi9ol0xI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Bard Liao , Mark Brown , Sasha Levin Subject: [PATCH 5.18 050/112] ASoC: codecs: rt700/rt711/rt711-sdca: resume bus/codec in .set_jack_detect Date: Mon, 11 Jul 2022 11:06:50 +0200 Message-Id: <20220711090550.991819916@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Pierre-Louis Bossart [ Upstream commit 40737057b48f1b4db67b0d766b95c87ba8fc5e03 ] The .set_jack_detect() codec component callback is invoked during card registration, which happens when the machine driver is probed. The issue is that this callback can race with the bus suspend/resume, and IO timeouts can happen. This can be reproduced very easily if the machine driver is 'blacklisted' and manually probed after the bus suspends. The bus and codec need to be re-initialized using pm_runtime helpers. Previous contributions tried to make sure accesses to the bus during the .set_jack_detect() component callback only happen when the bus is active. This was done by changing the regcache status on a component remove. This is however a layering violation, the regcache status should only be modified on device probe, suspend and resume. The component probe/remove should not modify how the device regcache is handled. This solution also didn't handle all the possible race conditions, and the RT700 headset codec was not handled. This patch tries to resume the codec device before handling the jack initializations. In case the codec has not yet been initialized, pm_runtime may not be enabled yet, so we don't squelch the -EACCES error code and only stop the jack information. When the codec reports as attached, the jack initialization will proceed as usual. BugLink: https://github.com/thesofproject/linux/issues/3643 Fixes: 7ad4d237e7c4a ('ASoC: rt711-sdca: Add RT711 SDCA vendor-specific dri= ver') Fixes: 899b12542b089 ('ASoC: rt711: add snd_soc_component remove callback') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-8-pierre-louis.bossar= t@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/codecs/rt700.c | 16 +++++++++++++--- sound/soc/codecs/rt711-sdca.c | 26 ++++++++++++++------------ sound/soc/codecs/rt711.c | 24 +++++++++++++----------- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/rt700.c b/sound/soc/codecs/rt700.c index e61a8257bf64..360d61a36c35 100644 --- a/sound/soc/codecs/rt700.c +++ b/sound/soc/codecs/rt700.c @@ -315,17 +315,27 @@ static int rt700_set_jack_detect(struct snd_soc_compo= nent *component, struct snd_soc_jack *hs_jack, void *data) { struct rt700_priv *rt700 =3D snd_soc_component_get_drvdata(component); + int ret; =20 rt700->hs_jack =3D hs_jack; =20 - if (!rt700->hw_init) { - dev_dbg(&rt700->slave->dev, - "%s hw_init not ready yet\n", __func__); + ret =3D pm_runtime_resume_and_get(component->dev); + if (ret < 0) { + if (ret !=3D -EACCES) { + dev_err(component->dev, "%s: failed to resume %d\n", __func__, ret); + return ret; + } + + /* pm_runtime not enabled yet */ + dev_dbg(component->dev, "%s: skipping jack init for now\n", __func__); return 0; } =20 rt700_jack_init(rt700); =20 + pm_runtime_mark_last_busy(component->dev); + pm_runtime_put_autosuspend(component->dev); + return 0; } =20 diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c index 57629c18db38..9d59e653b941 100644 --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -487,16 +487,27 @@ static int rt711_sdca_set_jack_detect(struct snd_soc_= component *component, struct snd_soc_jack *hs_jack, void *data) { struct rt711_sdca_priv *rt711 =3D snd_soc_component_get_drvdata(component= ); + int ret; =20 rt711->hs_jack =3D hs_jack; =20 - if (!rt711->hw_init) { - dev_dbg(&rt711->slave->dev, - "%s hw_init not ready yet\n", __func__); + ret =3D pm_runtime_resume_and_get(component->dev); + if (ret < 0) { + if (ret !=3D -EACCES) { + dev_err(component->dev, "%s: failed to resume %d\n", __func__, ret); + return ret; + } + + /* pm_runtime not enabled yet */ + dev_dbg(component->dev, "%s: skipping jack init for now\n", __func__); return 0; } =20 rt711_sdca_jack_init(rt711); + + pm_runtime_mark_last_busy(component->dev); + pm_runtime_put_autosuspend(component->dev); + return 0; } =20 @@ -1190,14 +1201,6 @@ static int rt711_sdca_probe(struct snd_soc_component= *component) return 0; } =20 -static void rt711_sdca_remove(struct snd_soc_component *component) -{ - struct rt711_sdca_priv *rt711 =3D snd_soc_component_get_drvdata(component= ); - - regcache_cache_only(rt711->regmap, true); - regcache_cache_only(rt711->mbq_regmap, true); -} - static const struct snd_soc_component_driver soc_sdca_dev_rt711 =3D { .probe =3D rt711_sdca_probe, .controls =3D rt711_sdca_snd_controls, @@ -1207,7 +1210,6 @@ static const struct snd_soc_component_driver soc_sdca= _dev_rt711 =3D { .dapm_routes =3D rt711_sdca_audio_map, .num_dapm_routes =3D ARRAY_SIZE(rt711_sdca_audio_map), .set_jack =3D rt711_sdca_set_jack_detect, - .remove =3D rt711_sdca_remove, .endianness =3D 1, }; =20 diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index 9838fb4d5b9c..9958067e80f1 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -457,17 +457,27 @@ static int rt711_set_jack_detect(struct snd_soc_compo= nent *component, struct snd_soc_jack *hs_jack, void *data) { struct rt711_priv *rt711 =3D snd_soc_component_get_drvdata(component); + int ret; =20 rt711->hs_jack =3D hs_jack; =20 - if (!rt711->hw_init) { - dev_dbg(&rt711->slave->dev, - "%s hw_init not ready yet\n", __func__); + ret =3D pm_runtime_resume_and_get(component->dev); + if (ret < 0) { + if (ret !=3D -EACCES) { + dev_err(component->dev, "%s: failed to resume %d\n", __func__, ret); + return ret; + } + + /* pm_runtime not enabled yet */ + dev_dbg(component->dev, "%s: skipping jack init for now\n", __func__); return 0; } =20 rt711_jack_init(rt711); =20 + pm_runtime_mark_last_busy(component->dev); + pm_runtime_put_autosuspend(component->dev); + return 0; } =20 @@ -932,13 +942,6 @@ static int rt711_probe(struct snd_soc_component *compo= nent) return 0; } =20 -static void rt711_remove(struct snd_soc_component *component) -{ - struct rt711_priv *rt711 =3D snd_soc_component_get_drvdata(component); - - regcache_cache_only(rt711->regmap, true); -} - static const struct snd_soc_component_driver soc_codec_dev_rt711 =3D { .probe =3D rt711_probe, .set_bias_level =3D rt711_set_bias_level, @@ -949,7 +952,6 @@ static const struct snd_soc_component_driver soc_codec_= dev_rt711 =3D { .dapm_routes =3D rt711_audio_map, .num_dapm_routes =3D ARRAY_SIZE(rt711_audio_map), .set_jack =3D rt711_set_jack_detect, - .remove =3D rt711_remove, .endianness =3D 1, }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 AE16CC43334 for ; Mon, 11 Jul 2022 09:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232455AbiGKJaA (ORCPT ); Mon, 11 Jul 2022 05:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbiGKJ26 (ORCPT ); Mon, 11 Jul 2022 05:28:58 -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 7028C3D5AA; Mon, 11 Jul 2022 02:16:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CAC0761243; Mon, 11 Jul 2022 09:16:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5C53C34115; Mon, 11 Jul 2022 09:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530972; bh=FBu7KY5YYbZo+WK5Ypy6wwAPJNUeHar+h74qFtStpgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k09N59zIOh/VOnEj+MXk9uD2iFhLIJa6KduHngKSo8RTwpAXcuWuoOGxE4H5VJ/81 b00pd1CN52IVOtNdnyJra7NPs54R05/yAgdNiKhYHESdXGgp1U5n7xRiu8nYwoeUVe jjvpOcmHcK1ykqR/MDOeOmjYUZvZ+d/9wt7bKCeg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Pierre-Louis Bossart , Ranjani Sridharan , Bard Liao , Mark Brown , Sasha Levin Subject: [PATCH 5.18 051/112] ASoC: SOF: ipc3-topology: Move and correct size checks in sof_ipc3_control_load_bytes() Date: Mon, 11 Jul 2022 11:06:51 +0200 Message-Id: <20220711090551.020035523@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peter Ujfalusi [ Upstream commit c2d1aec3f5da2475aa13a487d329823b7d27d499 ] Move the size checks prior to allocating memory as these checks do not need the data to be allocated and in case of an error we would not need to free the allocation. The max size must not be less than the size of struct sof_ipc_ctrl_data + struct sof_abi_hdr as the ABI header needs to be present under all circumstances. The check was incorrectly used or between the two size checks. Fixes: b5cee8feb1d4 ("ASoC: SOF: topology: Make control parsing IPC agnosti= c") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220610084735.19397-1-peter.ujfalusi@linux= .intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/sof/ipc3-topology.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index cdff48c4195f..80fb82ece38d 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -1578,24 +1578,23 @@ static int sof_ipc3_control_load_bytes(struct snd_s= of_dev *sdev, struct snd_sof_ struct sof_ipc_ctrl_data *cdata; int ret; =20 - scontrol->ipc_control_data =3D kzalloc(scontrol->max_size, GFP_KERNEL); - if (!scontrol->ipc_control_data) - return -ENOMEM; - - if (scontrol->max_size < sizeof(*cdata) || - scontrol->max_size < sizeof(struct sof_abi_hdr)) { - ret =3D -EINVAL; - goto err; + if (scontrol->max_size < (sizeof(*cdata) + sizeof(struct sof_abi_hdr))) { + dev_err(sdev->dev, "%s: insufficient size for a bytes control: %zu.\n", + __func__, scontrol->max_size); + return -EINVAL; } =20 - /* init the get/put bytes data */ if (scontrol->priv_size > scontrol->max_size - sizeof(*cdata)) { - dev_err(sdev->dev, "err: bytes data size %zu exceeds max %zu.\n", + dev_err(sdev->dev, + "%s: bytes data size %zu exceeds max %zu.\n", __func__, scontrol->priv_size, scontrol->max_size - sizeof(*cdata)); - ret =3D -EINVAL; - goto err; + return -EINVAL; } =20 + scontrol->ipc_control_data =3D kzalloc(scontrol->max_size, GFP_KERNEL); + if (!scontrol->ipc_control_data) + return -ENOMEM; + scontrol->size =3D sizeof(struct sof_ipc_ctrl_data) + scontrol->priv_size; =20 cdata =3D scontrol->ipc_control_data; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 D14ECC433EF for ; Mon, 11 Jul 2022 09:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232543AbiGKJaO (ORCPT ); Mon, 11 Jul 2022 05:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbiGKJ3T (ORCPT ); Mon, 11 Jul 2022 05:29:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3E110EF; Mon, 11 Jul 2022 02:16:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 69C3061278; Mon, 11 Jul 2022 09:16:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E96C34115; Mon, 11 Jul 2022 09:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530977; bh=45YfZqTeBaddWVj5ELAXw0HVwdPptdajeRd/ErUVfHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FqpQHRqHfUCDdwFZIaxZACgQjp+XkAl84aJP+Tt9HtwBrF0wq7KywZbDZZRfJ7Hdm ecz0pdRSkVAZ846FPGhTAGYkD8ERm2xzSoEWLAh4NuCb+OeViBPfmd+FoK4fA7wK35 QmEbEUbjaiNvJkJPFTn+DYXl2Xr3FzQMiZ7X/qyM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ranjani Sridharan , Peter Ujfalusi , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.18 052/112] ASoC: SOF: Intel: hda: Fix compressed stream position tracking Date: Mon, 11 Jul 2022 11:06:52 +0200 Message-Id: <20220711090551.048463206@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peter Ujfalusi [ Upstream commit ca7ab1dcf58dfce5bc851bf7e50fd94822c24665 ] Commit 288fad2f71fa ("ASoC: SOF: Intel: hda: add quirks for HDAudio DMA pos= ition information") modified the PCM path only, but left the compressed data patch using an obsolete option. Move the functionality in a helper that can be called for both PCM and compressed data. Reviewed-by: Ranjani Sridharan Fixes: 288fad2f71fa ("ASoC: SOF: Intel: hda: add quirks for HDAudio DMA pos= ition information") Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220616201953.130876-1-pierre-louis.bossar= t@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- sound/soc/sof/intel/hda-pcm.c | 74 +------------------------ sound/soc/sof/intel/hda-stream.c | 94 ++++++++++++++++++++++++++++++-- sound/soc/sof/intel/hda.h | 3 + 3 files changed, 94 insertions(+), 77 deletions(-) diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c index dc1f743730c0..6888e0a4665d 100644 --- a/sound/soc/sof/intel/hda-pcm.c +++ b/sound/soc/sof/intel/hda-pcm.c @@ -192,79 +192,7 @@ snd_pcm_uframes_t hda_dsp_pcm_pointer(struct snd_sof_d= ev *sdev, goto found; } =20 - switch (sof_hda_position_quirk) { - case SOF_HDA_POSITION_QUIRK_USE_SKYLAKE_LEGACY: - /* - * This legacy code, inherited from the Skylake driver, - * mixes DPIB registers and DPIB DDR updates and - * does not seem to follow any known hardware recommendations. - * It's not clear e.g. why there is a different flow - * for capture and playback, the only information that matters is - * what traffic class is used, and on all SOF-enabled platforms - * only VC0 is supported so the work-around was likely not necessary - * and quite possibly wrong. - */ - - /* DPIB/posbuf position mode: - * For Playback, Use DPIB register from HDA space which - * reflects the actual data transferred. - * For Capture, Use the position buffer for pointer, as DPIB - * is not accurate enough, its update may be completed - * earlier than the data written to DDR. - */ - if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { - pos =3D snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, - AZX_REG_VS_SDXDPIB_XBASE + - (AZX_REG_VS_SDXDPIB_XINTERVAL * - hstream->index)); - } else { - /* - * For capture stream, we need more workaround to fix the - * position incorrect issue: - * - * 1. Wait at least 20us before reading position buffer after - * the interrupt generated(IOC), to make sure position update - * happens on frame boundary i.e. 20.833uSec for 48KHz. - * 2. Perform a dummy Read to DPIB register to flush DMA - * position value. - * 3. Read the DMA Position from posbuf. Now the readback - * value should be >=3D period boundary. - */ - usleep_range(20, 21); - snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, - AZX_REG_VS_SDXDPIB_XBASE + - (AZX_REG_VS_SDXDPIB_XINTERVAL * - hstream->index)); - pos =3D snd_hdac_stream_get_pos_posbuf(hstream); - } - break; - case SOF_HDA_POSITION_QUIRK_USE_DPIB_REGISTERS: - /* - * In case VC1 traffic is disabled this is the recommended option - */ - pos =3D snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, - AZX_REG_VS_SDXDPIB_XBASE + - (AZX_REG_VS_SDXDPIB_XINTERVAL * - hstream->index)); - break; - case SOF_HDA_POSITION_QUIRK_USE_DPIB_DDR_UPDATE: - /* - * This is the recommended option when VC1 is enabled. - * While this isn't needed for SOF platforms it's added for - * consistency and debug. - */ - pos =3D snd_hdac_stream_get_pos_posbuf(hstream); - break; - default: - dev_err_once(sdev->dev, "hda_position_quirk value %d not supported\n", - sof_hda_position_quirk); - pos =3D 0; - break; - } - - if (pos >=3D hstream->bufsize) - pos =3D 0; - + pos =3D hda_dsp_stream_get_position(hstream, substream->stream, true); found: pos =3D bytes_to_frames(substream->runtime, pos); =20 diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-str= eam.c index daeb64c495e4..d95ae17e81cc 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -707,12 +707,13 @@ bool hda_dsp_check_stream_irq(struct snd_sof_dev *sde= v) } =20 static void -hda_dsp_set_bytes_transferred(struct hdac_stream *hstream, u64 buffer_size) +hda_dsp_compr_bytes_transferred(struct hdac_stream *hstream, int direction) { + u64 buffer_size =3D hstream->bufsize; u64 prev_pos, pos, num_bytes; =20 div64_u64_rem(hstream->curr_pos, buffer_size, &prev_pos); - pos =3D snd_hdac_stream_get_pos_posbuf(hstream); + pos =3D hda_dsp_stream_get_position(hstream, direction, false); =20 if (pos < prev_pos) num_bytes =3D (buffer_size - prev_pos) + pos; @@ -748,8 +749,7 @@ static bool hda_dsp_stream_check(struct hdac_bus *bus, = u32 status) if (s->substream && sof_hda->no_ipc_position) { snd_sof_pcm_period_elapsed(s->substream); } else if (s->cstream) { - hda_dsp_set_bytes_transferred(s, - s->cstream->runtime->buffer_size); + hda_dsp_compr_bytes_transferred(s, s->cstream->direction); snd_compr_fragment_elapsed(s->cstream); } } @@ -1009,3 +1009,89 @@ void hda_dsp_stream_free(struct snd_sof_dev *sdev) devm_kfree(sdev->dev, hda_stream); } } + +snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, + int direction, bool can_sleep) +{ + struct hdac_ext_stream *hext_stream =3D stream_to_hdac_ext_stream(hstream= ); + struct sof_intel_hda_stream *hda_stream =3D hstream_to_sof_hda_stream(hex= t_stream); + struct snd_sof_dev *sdev =3D hda_stream->sdev; + snd_pcm_uframes_t pos; + + switch (sof_hda_position_quirk) { + case SOF_HDA_POSITION_QUIRK_USE_SKYLAKE_LEGACY: + /* + * This legacy code, inherited from the Skylake driver, + * mixes DPIB registers and DPIB DDR updates and + * does not seem to follow any known hardware recommendations. + * It's not clear e.g. why there is a different flow + * for capture and playback, the only information that matters is + * what traffic class is used, and on all SOF-enabled platforms + * only VC0 is supported so the work-around was likely not necessary + * and quite possibly wrong. + */ + + /* DPIB/posbuf position mode: + * For Playback, Use DPIB register from HDA space which + * reflects the actual data transferred. + * For Capture, Use the position buffer for pointer, as DPIB + * is not accurate enough, its update may be completed + * earlier than the data written to DDR. + */ + if (direction =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { + pos =3D snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, + AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * + hstream->index)); + } else { + /* + * For capture stream, we need more workaround to fix the + * position incorrect issue: + * + * 1. Wait at least 20us before reading position buffer after + * the interrupt generated(IOC), to make sure position update + * happens on frame boundary i.e. 20.833uSec for 48KHz. + * 2. Perform a dummy Read to DPIB register to flush DMA + * position value. + * 3. Read the DMA Position from posbuf. Now the readback + * value should be >=3D period boundary. + */ + if (can_sleep) + usleep_range(20, 21); + + snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, + AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * + hstream->index)); + pos =3D snd_hdac_stream_get_pos_posbuf(hstream); + } + break; + case SOF_HDA_POSITION_QUIRK_USE_DPIB_REGISTERS: + /* + * In case VC1 traffic is disabled this is the recommended option + */ + pos =3D snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, + AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * + hstream->index)); + break; + case SOF_HDA_POSITION_QUIRK_USE_DPIB_DDR_UPDATE: + /* + * This is the recommended option when VC1 is enabled. + * While this isn't needed for SOF platforms it's added for + * consistency and debug. + */ + pos =3D snd_hdac_stream_get_pos_posbuf(hstream); + break; + default: + dev_err_once(sdev->dev, "hda_position_quirk value %d not supported\n", + sof_hda_position_quirk); + pos =3D 0; + break; + } + + if (pos >=3D hstream->bufsize) + pos =3D 0; + + return pos; +} diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 05e5e158614a..196494ba1245 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -557,6 +557,9 @@ int hda_dsp_stream_setup_bdl(struct snd_sof_dev *sdev, bool hda_dsp_check_ipc_irq(struct snd_sof_dev *sdev); bool hda_dsp_check_stream_irq(struct snd_sof_dev *sdev); =20 +snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, + int direction, bool can_sleep); + struct hdac_ext_stream * hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction, u32 flags); int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream= _tag); --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 7B4B0C433EF for ; Mon, 11 Jul 2022 09:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232552AbiGKJaR (ORCPT ); Mon, 11 Jul 2022 05:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbiGKJ3V (ORCPT ); Mon, 11 Jul 2022 05:29:21 -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 31D183DBF4; Mon, 11 Jul 2022 02:16: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 B5B99B80E6D; Mon, 11 Jul 2022 09:16:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24C74C34115; Mon, 11 Jul 2022 09:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530980; bh=ZW6FWAURDGv8mjytaJe/r3CiduGETujhMIKENOvBdaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yyX69ruw9L/knYcLIOIbVz6Sn2P5LguTkBbWlOS9mw++5WTwdOWklWoyYlvP2Pj++ HwV9jIWcpZULsrvEBTZVou+QhnnjTyPXRVjyhrs2npU7iD9IgWRUSmqU+frVhBK2Wh RwNzGX+ZAbiyDpDOBhCD/LD6qnrftefJ2BNNXPAY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Zapolskiy , Dmitry Baryshkov , Vinod Koul , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.18 053/112] arm64: dts: qcom: sm8450: fix interconnects property of UFS node Date: Mon, 11 Jul 2022 11:06:53 +0200 Message-Id: <20220711090551.077126740@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vladimir Zapolskiy [ Upstream commit de9b3d9616078f1d1d0d51b01cdafa101733f935 ] All interconnect device tree nodes on sm8450 are 2-cells, however in UFS node they are handled as 1-cells, fix it. Fixes: aa2d0bf04a3c ("arm64: dts: qcom: sm8450: add interconnect nodes") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Dmitry Baryshkov Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220310221934.1560729-1-vladimir.zapolskiy= @linaro.org Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qco= m/sm8450.dtsi index e63b7b0458cf..7a14eb89e4ca 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -1383,8 +1383,8 @@ =20 iommus =3D <&apps_smmu 0xe0 0x0>; =20 - interconnects =3D <&aggre1_noc MASTER_UFS_MEM &mc_virt SLAVE_EBI1>, - <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_UFS_MEM_CFG>; + interconnects =3D <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI1 0>, + <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_UFS_MEM_CFG 0>; interconnect-names =3D "ufs-ddr", "cpu-ufs"; clock-names =3D "core_clk", --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 650AAC433EF for ; Mon, 11 Jul 2022 09:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232584AbiGKJaZ (ORCPT ); Mon, 11 Jul 2022 05:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232702AbiGKJ33 (ORCPT ); Mon, 11 Jul 2022 05:29:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B4C66D9F2; Mon, 11 Jul 2022 02:16: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 sin.source.kernel.org (Postfix) with ESMTPS id EB907CE125F; Mon, 11 Jul 2022 09:16:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0150C341C0; Mon, 11 Jul 2022 09:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530983; bh=wuFITWr7voOniBRlxupsTInvUgybpSVcKtHclsOVbcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gWY90zNy9CBfsXXLpaXJ8dPGY9/WFYNxFCXSdGqjT+nc+Nr24bbVicWHTeh5Fd63k B1/E1TmQuxx/osPlT4v7+D7jVppGb3pBSpeey2wMaP592Qn24nN5pzPQeuCnWZGfN6 AcpMllXVCzymtQNoeguqCp/gVlEYLYNXNk3UMOV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konrad Dybcio , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.18 054/112] arm64: dts: qcom: msm8994: Fix CPU6/7 reg values Date: Mon, 11 Jul 2022 11:06:54 +0200 Message-Id: <20220711090551.105006997@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Konrad Dybcio [ Upstream commit 47bf59c4755930f616dd90c8c6a85f40a6d347ea ] CPU6 and CPU7 were mistakengly pointing to CPU5 reg. Fix it. Fixes: 02d8091bbca0 ("arm64: dts: qcom: msm8994: Add a proper CPU map") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220501184016.64138-1-konrad.dybcio@somain= line.org Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/qcom/msm8994.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qc= om/msm8994.dtsi index b1e595cb4b90..6b76321288d0 100644 --- a/arch/arm64/boot/dts/qcom/msm8994.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi @@ -93,7 +93,7 @@ CPU6: cpu@102 { device_type =3D "cpu"; compatible =3D "arm,cortex-a57"; - reg =3D <0x0 0x101>; + reg =3D <0x0 0x102>; enable-method =3D "psci"; next-level-cache =3D <&L2_1>; }; @@ -101,7 +101,7 @@ CPU7: cpu@103 { device_type =3D "cpu"; compatible =3D "arm,cortex-a57"; - reg =3D <0x0 0x101>; + reg =3D <0x0 0x103>; enable-method =3D "psci"; next-level-cache =3D <&L2_1>; }; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 370F6C433EF for ; Mon, 11 Jul 2022 09:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbiGKJaW (ORCPT ); Mon, 11 Jul 2022 05:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbiGKJ31 (ORCPT ); Mon, 11 Jul 2022 05:29:27 -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 E0E136D56B; Mon, 11 Jul 2022 02:16:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9419F61243; Mon, 11 Jul 2022 09:16:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2061C34115; Mon, 11 Jul 2022 09:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530986; bh=QpAJqreb6gSFTrZdxgUfc7154j1uRiyvfmEosIasGDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwB1bGutfVJab+Q0WGygxmi+bHbLCcWs42AAv9aLxbY/Oo+Q+rtqIHXD6uu0mxhWq 2qBNf2jmhiluwSdCFeV4PzzPL3MmsiOw1z9G3Ri6JeNpiZHcBiFlV3CKahqIL5LlDr wJS/CzmVAzL5GhRqGxEQ2wQPVfjfmSiZNHyjQNw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.18 055/112] arm64: dts: qcom: sdm845: use dispcc AHB clock for mdss node Date: Mon, 11 Jul 2022 11:06:55 +0200 Message-Id: <20220711090551.133270013@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 Baryshkov [ Upstream commit 3ba500dee327e0261e728edec8a4f2f563d2760c ] It was noticed that on sdm845 after an MDSS suspend/resume cycle the driver can not read HW_REV registers properly (they will return 0 instead). Chaning the "iface" clock from <&gcc GCC_DISP_AHB_CLK> to <&dispcc DISP_CC_MDSS_AHB_CLK> fixes the issue. Fixes: 08c2a076d18f ("arm64: dts: qcom: sdm845: Add dpu to sdm845 dts file") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220531124735.1165582-1-dmitry.baryshkov@l= inaro.org Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qco= m/sdm845.dtsi index b31bf62e8680..ad21cf465c98 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -4238,7 +4238,7 @@ =20 power-domains =3D <&dispcc MDSS_GDSC>; =20 - clocks =3D <&gcc GCC_DISP_AHB_CLK>, + clocks =3D <&dispcc DISP_CC_MDSS_AHB_CLK>, <&dispcc DISP_CC_MDSS_MDP_CLK>; clock-names =3D "iface", "core"; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 326D7C433EF for ; Mon, 11 Jul 2022 09:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbiGKJa3 (ORCPT ); Mon, 11 Jul 2022 05:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbiGKJ3e (ORCPT ); Mon, 11 Jul 2022 05:29:34 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3810D6E8B5; Mon, 11 Jul 2022 02:16: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 sin.source.kernel.org (Postfix) with ESMTPS id 8400ACE1256; Mon, 11 Jul 2022 09:16:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6393CC34115; Mon, 11 Jul 2022 09:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530988; bh=wpauSRjKkxczRqOFAKR0G9QBSNrt+x6DlEL/bNnxU/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQQKOSzCDrMdXK0lAbJhz/hoLh/isJjqWIwDOm3dbCPBot5U07LXgP+lEU6jeScwX 4ccNqv2e4QPmPVSUthXQ4kLoSsQ5MMA1OGyZrNeYyRWuCK0RAZsd9xCXjizHg9bMs0 wzOAzR1U+HVFJ8RTavENFjYg2/hRkJbLF66qa05o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 056/112] ARM: mxs_defconfig: Enable the framebuffer Date: Mon, 11 Jul 2022 11:06:56 +0200 Message-Id: <20220711090551.161652167@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Fabio Estevam [ Upstream commit b10ef5f2ddb3a5a22ac0936c8d91a50ac5e55e77 ] Currently, when booting Linux on a imx28-evk board there is no display activity. Enable CONFIG_FB which is nowadays required for CONFIG_DRM_PANEL_LVDS, CONFIG_DRM_PANEL_SIMPLE, CONFIG_DRM_PANEL_SEIKO_43WVF1G, CONFIG_FB_MODE_HELPERS, CONFIG_BACKLIGHT_PWM, CONFIG_BACKLIGHT_GPIO, CONFIG_FRAMEBUFFER_CONSOLE, CONFIG_LOGO, CONFIG_FONTS, CONFIG_FONT_8x8 and CONFIG_FONT_8x16. Based on commit c54467482ffd ("ARM: imx_v6_v7_defconfig: enable fb"). Fixes: f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/configs/mxs_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig index ca32446b187f..f53086ddc48b 100644 --- a/arch/arm/configs/mxs_defconfig +++ b/arch/arm/configs/mxs_defconfig @@ -93,6 +93,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=3Dy CONFIG_DRM=3Dy CONFIG_DRM_PANEL_SEIKO_43WVF1G=3Dy CONFIG_DRM_MXSFB=3Dy +CONFIG_FB=3Dy CONFIG_FB_MODE_HELPERS=3Dy CONFIG_LCD_CLASS_DEVICE=3Dy CONFIG_BACKLIGHT_CLASS_DEVICE=3Dy --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 7676BC433EF for ; Mon, 11 Jul 2022 09:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232523AbiGKJad (ORCPT ); Mon, 11 Jul 2022 05:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbiGKJ3f (ORCPT ); Mon, 11 Jul 2022 05:29:35 -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 F288D6EE85; Mon, 11 Jul 2022 02:16: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 dfw.source.kernel.org (Postfix) with ESMTPS id 37FD5612A4; Mon, 11 Jul 2022 09:16:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41DBAC34115; Mon, 11 Jul 2022 09:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530991; bh=xw1+ULQZcaTYDOOaUEfRRQinfme4Yw0I2ZlRLfnvuws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AJo1duaavk+UXKMAc7St96JCDmccAZ4EreIBm+YG2Zb58qG3Cky6OqC+lk8Ye21k3 hRUL9nAFiKM6RqhkYOcOlRQEZqAkphf/5YXIYUxIa5M5q3/EzX2hjzHQJJmT4xZkRI 7FIvYFSlmPDFQQgiX8G0nsqtbBHjh8Mine9tk/wg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 057/112] arm64: dts: imx8mp-evk: correct mmc pad settings Date: Mon, 11 Jul 2022 11:06:57 +0200 Message-Id: <20220711090551.191072025@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit 01785f1f156511c4f285786b4192245d4f476bf1 ] According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Not set reserved bit. Fixes: 9e847693c6f3 ("arm64: dts: freescale: Add i.MX8MP EVK board support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 4c3ac4214a2c..f31cf778890d 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -500,7 +500,7 @@ =20 pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp { fsl,pins =3D < - MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19 0x41 + MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19 0x40 >; }; =20 @@ -525,7 +525,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d0 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d0 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d0 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; =20 @@ -537,7 +537,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d4 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d4 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d4 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; =20 @@ -549,7 +549,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d6 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d6 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d6 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 E4B3CC433EF for ; Mon, 11 Jul 2022 09:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbiGKJan (ORCPT ); Mon, 11 Jul 2022 05:30:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbiGKJ3p (ORCPT ); Mon, 11 Jul 2022 05:29: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 F2652709AE; Mon, 11 Jul 2022 02:16:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0892761226; Mon, 11 Jul 2022 09:16:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1615AC34115; Mon, 11 Jul 2022 09:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530994; bh=QjqgyLl0/S8E7GIf56Ex+JLVKwqnCTDYX7/NdJD+5yM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NUZuuIg/nGYZISMVaBmzESg0b27klzZflcUs99P7kLUbdXcA4f2QKlF1pQONZzrGg ZJu/2kMGSEOzoyBYCN3fPQJ+w++HfMHDIavSNzb4WujHZS/LqwqYbqLaYd1VnpyRiE BFiRT+vMo4QDcS73oxlNcrLHMfqGP91elxjARbO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haibo Chen , Sherry Sun , Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 058/112] arm64: dts: imx8mp-evk: correct the uart2 pinctl value Date: Mon, 11 Jul 2022 11:06:58 +0200 Message-Id: <20220711090551.219419939@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Sherry Sun [ Upstream commit 2d4fb72b681205eed4553d8802632bd3270be3ba ] According to the IOMUXC_SW_PAD_CTL_PAD_UART2_RXD/TXD register define in imx8mp RM, bit0 and bit3 are reserved, and the uart2 rx/tx pin should enable the pull up, so need to set bit8 to 1. The original pinctl value 0x49 is incorrect and needs to be changed to 0x140, same as uart1 and uart3. Fixes: 9e847693c6f3 ("arm64: dts: freescale: Add i.MX8MP EVK board support") Reviewed-by: Haibo Chen Signed-off-by: Sherry Sun Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index f31cf778890d..4ba31fc5d0a5 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -506,8 +506,8 @@ =20 pinctrl_uart2: uart2grp { fsl,pins =3D < - MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX 0x49 - MX8MP_IOMUXC_UART2_TXD__UART2_DCE_TX 0x49 + MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX 0x140 + MX8MP_IOMUXC_UART2_TXD__UART2_DCE_TX 0x140 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 54EB7C43334 for ; Mon, 11 Jul 2022 09:30:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232573AbiGKJay (ORCPT ); Mon, 11 Jul 2022 05:30:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232195AbiGKJ3w (ORCPT ); Mon, 11 Jul 2022 05:29:52 -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 BDB7C70E65; Mon, 11 Jul 2022 02:16:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7317DB80E84; Mon, 11 Jul 2022 09:16:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1099C34115; Mon, 11 Jul 2022 09:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530997; bh=Z2/2u6TLOVitQk2RLbfwQpjOCKKEC9SNKDWAizoSSRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYRPts+2koqX74idH1nvIy9vvpmItEfs4zZeHTiT6nMVfVn7hFdO8OfT8WtGFEHwr XrQn1H90jBLbs/4cCuY0ii+qaZxftaxrkszF6ThKL4YF2Brkh+2AR/CMLkQC79OhfI AsImtNA/N2ATctkS6UbEGBApvuAI8xxkhYAR2C88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 059/112] arm64: dts: imx8mp-evk: correct gpio-led pad settings Date: Mon, 11 Jul 2022 11:06:59 +0200 Message-Id: <20220711090551.247481297@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit b838582ab8d5fb11b2c0275056a9f34e1d94fece ] 0x19 is not a valid setting. According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Correct setting with PE PUE set, DSE set to 0. Fixes: 50d336b12f34 ("arm64: dts: imx8mp-evk: Add GPIO LED support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 4ba31fc5d0a5..4ff75c4cbddc 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -461,7 +461,7 @@ =20 pinctrl_gpio_led: gpioledgrp { fsl,pins =3D < - MX8MP_IOMUXC_NAND_READY_B__GPIO3_IO16 0x19 + MX8MP_IOMUXC_NAND_READY_B__GPIO3_IO16 0x140 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 EDEB6C433EF for ; Mon, 11 Jul 2022 09:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbiGKJa5 (ORCPT ); Mon, 11 Jul 2022 05:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbiGKJaB (ORCPT ); Mon, 11 Jul 2022 05:30:01 -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 5717C71706; Mon, 11 Jul 2022 02:16: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 39E92B80DB7; Mon, 11 Jul 2022 09:16:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93531C34115; Mon, 11 Jul 2022 09:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530999; bh=xJbSYnmH/54BOp4rxr0Fm4HlFwlIftTdla6newmm24M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bfXvE5PdqKPnSXReKP8ntnszD4bxOApJQa0a5XQJ3m+6pGGeKhipoFCpJcDw/rL4o m8mTy61WpEr7CJz740VcfqAEkuprW/T/K69i9oKfZiD6oaX19fL6CDgtahoDIlswcT vYBLoRPtdy2pVcmxaFp3gQf3WlKldhkjj0WBnZOE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 060/112] arm64: dts: imx8mp-evk: correct vbus pad settings Date: Mon, 11 Jul 2022 11:07:00 +0200 Message-Id: <20220711090551.276566045@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit e2c00820a99c55c9bb40642d5818a904a1e0d664 ] 0x19 is not a valid setting. According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Not set reserved bit. Fixes: 43da4f92a611 ("arm64: dts: imx8mp-evk: enable usb1 as host mode") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 4ff75c4cbddc..a28ce8af61bd 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -513,7 +513,7 @@ =20 pinctrl_usb1_vbus: usb1grp { fsl,pins =3D < - MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR 0x19 + MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR 0x10 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 051C4C43334 for ; Mon, 11 Jul 2022 09:31:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbiGKJbQ (ORCPT ); Mon, 11 Jul 2022 05:31:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231686AbiGKJan (ORCPT ); Mon, 11 Jul 2022 05:30:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4F171BDC; Mon, 11 Jul 2022 02:16:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D42D8B80E76; Mon, 11 Jul 2022 09:16:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40B61C341C0; Mon, 11 Jul 2022 09:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531002; bh=vTOSQ7Hoe5H6kjHaDQd6KM7DOede6l2jYUUVvCmRlYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/z699CGHvhnOvJ9qXkF1scp/B6Ua2If7bvKtqkJO/trgOisamLrEpCrgDmysyAnP CCGWK6vRv3AmD3RaSdbmDtfQWz096haax0oN1NED+IfFtiAY9QBQp4UG49EH/i6sXh 1z1TR+aZDOqk1Q1SW7xDNFOnc4xMBBPSsq7SHhQo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 061/112] arm64: dts: imx8mp-evk: correct eqos pad settings Date: Mon, 11 Jul 2022 11:07:01 +0200 Message-Id: <20220711090551.305054090@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit e6e1bc0ec9e8ad212fa46d8878a6e17cd31fdf7b ] According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: dc6d5dc89bad ("arm64: dts: imx8mp-evk: enable EQOS ethernet") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index a28ce8af61bd..454856bd4f56 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -395,21 +395,21 @@ &iomuxc { pinctrl_eqos: eqosgrp { fsl,pins =3D < - MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x3 - MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x3 - MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x91 - MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x91 - MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x91 - MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x91 - MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x91 - MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x91 - MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x1f - MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x1f - MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x1f - MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x1f - MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x1f - MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x1f - MX8MP_IOMUXC_SAI2_RXC__GPIO4_IO22 0x19 + MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x2 + MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x2 + MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x90 + MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x90 + MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x90 + MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x90 + MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x90 + MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x90 + MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x16 + MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x16 + MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x16 + MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x16 + MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x16 + MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x16 + MX8MP_IOMUXC_SAI2_RXC__GPIO4_IO22 0x10 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 C5CB1C433EF for ; Mon, 11 Jul 2022 09:31:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232665AbiGKJbU (ORCPT ); Mon, 11 Jul 2022 05:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbiGKJaw (ORCPT ); Mon, 11 Jul 2022 05:30:52 -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 7E1B672EE2; Mon, 11 Jul 2022 02:16:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 73F7EB80E84; Mon, 11 Jul 2022 09:16:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A962CC34115; Mon, 11 Jul 2022 09:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531008; bh=MvmgnXxSGFc0Vw1XACvyfAJ3wLGDYlztU1H00/h+Z1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xR0lYE7ZZ1cKPlfePi4vG62yc6RgkeCtck2QPcHatiDf5ZUFYTzqWp9x9UTCXGmL1 daQkwSKSd0HZVlX6ucFgMUN3YSXzOuj/CnOwuqT7ZozCOz6wJ3HJAPg7s25d9+nhmI bZ12HceEnFFx9YnZQBm/Z5fMzWw8OtPLEyrlVVRk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 062/112] arm64: dts: imx8mp-evk: correct I2C5 pad settings Date: Mon, 11 Jul 2022 11:07:02 +0200 Message-Id: <20220711090551.334196919@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit 8c214b78e149dc7209e38a031292fe21d7017561 ] According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 8134822db08d ("arm64: dts: imx8mp-evk: add support for I2C5") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 454856bd4f56..938757b26add 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -481,8 +481,8 @@ =20 pinctrl_i2c5: i2c5grp { fsl,pins =3D < - MX8MP_IOMUXC_SPDIF_RX__I2C5_SDA 0x400001c3 - MX8MP_IOMUXC_SPDIF_TX__I2C5_SCL 0x400001c3 + MX8MP_IOMUXC_SPDIF_RX__I2C5_SDA 0x400001c2 + MX8MP_IOMUXC_SPDIF_TX__I2C5_SCL 0x400001c2 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 5446CC43334 for ; Mon, 11 Jul 2022 09:31:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbiGKJbk (ORCPT ); Mon, 11 Jul 2022 05:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbiGKJbH (ORCPT ); Mon, 11 Jul 2022 05:31:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BCDE643F; Mon, 11 Jul 2022 02:17: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 dfw.source.kernel.org (Postfix) with ESMTPS id 9D4FE61226; Mon, 11 Jul 2022 09:16:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85A55C34115; Mon, 11 Jul 2022 09:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531011; bh=J9c10HAnH2hw2pDgYHAA0dGZKXuDFaJLoxPb6YbGnLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1FGiIJKhKwp9rWtYQi+vMYinCO4PzcgToob9im5CBlfpaOIR2glZsRkbu6AKQ+Y4V IHs42czp+8G2XCH72lkE4lZjhhcQolmzogMTZAFgpdf8A+HduNnjy3KUdqOLq/0ScB FSgbEb3WULy99nr6tuGzO+c3ecZlSQRJrHDl1NdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 063/112] arm64: dts: imx8mp-evk: correct I2C1 pad settings Date: Mon, 11 Jul 2022 11:07:03 +0200 Message-Id: <20220711090551.362280006@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit 05a7f43478e890513d571f36660bfedc1482a588 ] According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 5497bc2a2bff ("arm64: dts: imx8mp-evk: Add PMIC device") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 938757b26add..b4499d9953ed 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -467,8 +467,8 @@ =20 pinctrl_i2c1: i2c1grp { fsl,pins =3D < - MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL 0x400001c3 - MX8MP_IOMUXC_I2C1_SDA__I2C1_SDA 0x400001c3 + MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL 0x400001c2 + MX8MP_IOMUXC_I2C1_SDA__I2C1_SDA 0x400001c2 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 DD7D8C43334 for ; Mon, 11 Jul 2022 09:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231790AbiGKJbp (ORCPT ); Mon, 11 Jul 2022 05:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232627AbiGKJbJ (ORCPT ); Mon, 11 Jul 2022 05:31:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5DE27392F; Mon, 11 Jul 2022 02:17: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 F0CC9B80E6D; Mon, 11 Jul 2022 09:16:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60BE1C34115; Mon, 11 Jul 2022 09:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531013; bh=u1NrMuvG/IieSAsT54FWCTo3AUkmCnYBX/4A6l6U9FA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wrJlAuE1Ur28w25mjKCMByJbhMZ+oLwBGNU5cv9VIth605d20RcFITtegnbISmLmi MU8zxAV35u2WClERIKDziXrIjiX4MP7YLL+FRYM9g97lr8AeaiPAjXN2T7YeoH8iO/ L/fbluuhBNlXQ4WuFFbHaf5zhCFmVpYQRzzD67Qc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 064/112] arm64: dts: imx8mp-evk: correct I2C3 pad settings Date: Mon, 11 Jul 2022 11:07:04 +0200 Message-Id: <20220711090551.390833050@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit 0836de513ebaae5f03014641eac996290d67493d ] According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 5e4a67ff7f69 ("arm64: dts: imx8mp-evk: Add i2c3 support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index b4499d9953ed..5744fa76e9b2 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -474,8 +474,8 @@ =20 pinctrl_i2c3: i2c3grp { fsl,pins =3D < - MX8MP_IOMUXC_I2C3_SCL__I2C3_SCL 0x400001c3 - MX8MP_IOMUXC_I2C3_SDA__I2C3_SDA 0x400001c3 + MX8MP_IOMUXC_I2C3_SCL__I2C3_SCL 0x400001c2 + MX8MP_IOMUXC_I2C3_SDA__I2C3_SDA 0x400001c2 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 CED26CCA47B for ; Mon, 11 Jul 2022 09:31:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232620AbiGKJbh (ORCPT ); Mon, 11 Jul 2022 05:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232614AbiGKJbF (ORCPT ); Mon, 11 Jul 2022 05:31:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62BF63F326; Mon, 11 Jul 2022 02:16:59 -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 D7FF5B80E7A; Mon, 11 Jul 2022 09:16:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31D3AC34115; Mon, 11 Jul 2022 09:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531016; bh=eChDofblrc/z9HyIYPzqly3n06khJx7Bm7VoQk/EUFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y2xg124P+uh5tqRD4mses5C/p3KSxWCwCoIg8XeDzJ/tNSG+3vhtJ9c+Zub1CsMQE hTkNWPih5zfV1YXgS7+AtoIcQ/mGXaQA6m/z0FP2YSSBvIxQkLlGRmCb8BjdgQuWQ6 YTgyB8+hHxmNxhhGKUz8I9yJUdNRKsqEgTCNP62Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 065/112] arm64: dts: imx8mp-phyboard-pollux-rdk: correct uart pad settings Date: Mon, 11 Jul 2022 11:07:05 +0200 Message-Id: <20220711090551.418604348@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit e266c155bd88e95f9b86379d6b0add6ac6e5452e ] BIT3 and BIT0 are reserved bits, should not touch. Fixes: 846f752866bd ("arm64: dts: imx8mp-phyboard-pollux-rdk: Change debug = UART") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts b= /arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts index 984a6b9ded8d..e34076954897 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts @@ -156,8 +156,8 @@ =20 pinctrl_uart1: uart1grp { fsl,pins =3D < - MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x49 - MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x49 + MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x40 + MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x40 >; }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 D653AC43334 for ; Mon, 11 Jul 2022 09:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232702AbiGKJby (ORCPT ); Mon, 11 Jul 2022 05:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbiGKJbW (ORCPT ); Mon, 11 Jul 2022 05:31:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1D23ED70; Mon, 11 Jul 2022 02:17:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F12D661257; Mon, 11 Jul 2022 09:16:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07883C341C0; Mon, 11 Jul 2022 09:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531019; bh=Ydhnk3Ka6/gypkyrryB/mwM0eu6Jyl/rqSPH0WbVd+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P2ki8QpHCiq7zgfHkk77qya8yIlKB2JRmPydE6WG5yjFmsboAfrx2Wq5gH29DrbAO PIdjdWjJZ+2A7g0JFVMOIBkxt5Cvxr5QiNdJJ9WgAPHTXmbhoRalHTvtHti/xiGD4d JLx7riLEFcP0k0hz4qM6t1iMZkJyIN0iXG0bDV48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 066/112] arm64: dts: imx8mp-phyboard-pollux-rdk: correct eqos pad settings Date: Mon, 11 Jul 2022 11:07:06 +0200 Message-Id: <20220711090551.447345801@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit bae4de618efe1c41d34aa2e6cef8b08e46256667 ] BIT3 and BIT0 are reserved bits, should not touch. Fixes: 6f96852619d5 ("arm64: dts: freescale: Add support EQOS MAC on phyBOA= RD-Pollux-i.MX8MP") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- .../freescale/imx8mp-phyboard-pollux-rdk.dts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts b= /arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts index e34076954897..cefd3d36f93f 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts @@ -116,20 +116,20 @@ &iomuxc { pinctrl_eqos: eqosgrp { fsl,pins =3D < - MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x3 - MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x3 - MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x91 - MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x91 - MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x91 - MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x91 - MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x91 - MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x91 - MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x1f - MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x1f - MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x1f - MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x1f - MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x1f - MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x1f + MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x2 + MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x2 + MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x90 + MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x90 + MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x90 + MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x90 + MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x90 + MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x90 + MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x16 + MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x16 + MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x16 + MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x16 + MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x16 + MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x16 MX8MP_IOMUXC_SAI1_MCLK__GPIO4_IO20 0x10 >; }; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 3F135CCA47B for ; Mon, 11 Jul 2022 09:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbiGKJbu (ORCPT ); Mon, 11 Jul 2022 05:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232650AbiGKJbL (ORCPT ); Mon, 11 Jul 2022 05:31:11 -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 10A5C74341; Mon, 11 Jul 2022 02:17:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 61440B80833; Mon, 11 Jul 2022 09:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4F9DC34115; Mon, 11 Jul 2022 09:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531022; bh=bbeGwcWQa70BYWRXUbdD0HP8EK6OulIySJ6Ht6nUEmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yv3MksDKdu21puzNRQ1p7PiHqL6FTz1F6BejGj/+nq/QDJDxEMdX3mleDEJbC7CEO 2wAT7BEg6uaQSQzseUgCnpKVOSw0fLPuVen/WapY+xyTsN2LSukL3eZy0d4H9dhBxQ ZwRw6FuOfBy6emxfMGBwT4c9Zop6HsEG0DhBvRy0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Rasmus Villemoes , Shawn Guo , Sasha Levin Subject: [PATCH 5.18 067/112] arm64: dts: imx8mp-phyboard-pollux-rdk: correct i2c2 & mmc settings Date: Mon, 11 Jul 2022 11:07:07 +0200 Message-Id: <20220711090551.475002030@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peng Fan [ Upstream commit 242d8ee9111171a6e68249aaff62643c513be6ec ] BIT3 and BIT0 are reserved bits, should not touch. Fixes: 88f7f6bcca37 ("arm64: dts: freescale: Add support for phyBOARD-Pollu= x-i.MX8MP") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- .../dts/freescale/imx8mp-phyboard-pollux-rdk.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts b= /arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts index cefd3d36f93f..6aa720bafe28 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts @@ -136,21 +136,21 @@ =20 pinctrl_i2c2: i2c2grp { fsl,pins =3D < - MX8MP_IOMUXC_I2C2_SCL__I2C2_SCL 0x400001c3 - MX8MP_IOMUXC_I2C2_SDA__I2C2_SDA 0x400001c3 + MX8MP_IOMUXC_I2C2_SCL__I2C2_SCL 0x400001c2 + MX8MP_IOMUXC_I2C2_SDA__I2C2_SDA 0x400001c2 >; }; =20 pinctrl_i2c2_gpio: i2c2gpiogrp { fsl,pins =3D < - MX8MP_IOMUXC_I2C2_SCL__GPIO5_IO16 0x1e3 - MX8MP_IOMUXC_I2C2_SDA__GPIO5_IO17 0x1e3 + MX8MP_IOMUXC_I2C2_SCL__GPIO5_IO16 0x1e2 + MX8MP_IOMUXC_I2C2_SDA__GPIO5_IO17 0x1e2 >; }; =20 pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp { fsl,pins =3D < - MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19 0x41 + MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19 0x40 >; }; =20 @@ -175,7 +175,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d0 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d0 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d0 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; =20 @@ -187,7 +187,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d4 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d4 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d4 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; =20 @@ -199,7 +199,7 @@ MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d6 MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d6 MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d6 - MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc1 + MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0 >; }; }; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 D763DC43334 for ; Mon, 11 Jul 2022 09:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232499AbiGKJcF (ORCPT ); Mon, 11 Jul 2022 05:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbiGKJb0 (ORCPT ); Mon, 11 Jul 2022 05:31: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 8D1FF41980; Mon, 11 Jul 2022 02:17:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4C65BB80E76; Mon, 11 Jul 2022 09:17:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91284C34115; Mon, 11 Jul 2022 09:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531024; bh=GNaanrgBvVvXf/zQk3uqVcuxRzwmpZVg9nibxRF44sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O1ADv51xjlD9PV2UnLul48GI40E9k5WPEyph7msTZMGchWs0mjXGIF6CPnCQ221s4 4twOx0UXLPJbr9mIfq9yjXkw95AzKjYL7r1x/UE2UBWkLAuQ/K3JwMnIpz2nvIEu22 dRjL/QZlQBVAMR6BM7MCnnA5OIjYW+4uyGtobPTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrei Lalaev , Samuel Holland , Linus Walleij , Sasha Levin Subject: [PATCH 5.18 068/112] pinctrl: sunxi: sunxi_pconf_set: use correct offset Date: Mon, 11 Jul 2022 11:07:08 +0200 Message-Id: <20220711090551.504332178@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Andrei Lalaev [ Upstream commit cd4c1e65a32afd003b08ad4aafe1e4d3e4e8e61b ] Some Allwinner SoCs have 2 pinctrls (PIO and R_PIO). Previous implementation used absolute pin numbering and it was incorrect for R_PIO pinctrl. It's necessary to take into account the base pin number. Fixes: 90be64e27621 ("pinctrl: sunxi: implement pin_config_set") Signed-off-by: Andrei Lalaev Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220525190423.410609-1-andrey.lalaev@gmail= .com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/= pinctrl-sunxi.c index d9327d7d56ee..dd928402af99 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -544,6 +544,8 @@ static int sunxi_pconf_set(struct pinctrl_dev *pctldev,= unsigned pin, struct sunxi_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); int i; =20 + pin -=3D pctl->desc->pin_base; + for (i =3D 0; i < num_configs; i++) { enum pin_config_param param; unsigned long flags; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 09B25C43334 for ; Mon, 11 Jul 2022 09:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbiGKJcN (ORCPT ); Mon, 11 Jul 2022 05:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbiGKJbc (ORCPT ); Mon, 11 Jul 2022 05:31:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DDF2747A7; Mon, 11 Jul 2022 02:17:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 37BBE61227; Mon, 11 Jul 2022 09:17:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 436AAC34115; Mon, 11 Jul 2022 09:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531027; bh=CvZxMF564fImUCGGwfXZ9rZR8Plvf1bwcZjjJWcrvAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slzW9vM2bvQhphegeZxFh/lOcAq6IuIB/8hYU0YGkvAOj5yF/DsbDXfPYpueEEM/O vjgvuO2LhN9lwQy8KxwaF+IqTTLNfq/dMheGp9d3B266zgf/dFqpTy7fX4huiapJ8E /mBvujLWK5fBUG9KPvTrrHSbgE6QK05mzjsvEL2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Herring , Konrad Dybcio , Stephan Gerhold , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.18 069/112] arm64: dts: qcom: msm8992-*: Fix vdd_lvs1_2-supply typo Date: Mon, 11 Jul 2022 11:07:09 +0200 Message-Id: <20220711090551.532705662@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stephan Gerhold [ Upstream commit 5fb779558f1c97e2bf2794cb59553e569c38e2f9 ] "make dtbs_check" complains about the missing "-supply" suffix for vdd_lvs1_2 which is clearly a typo, originally introduced in the msm8994-smd-rpm.dtsi file and apparently later copied to msm8992-xiaomi-libra.dts: msm8992-lg-bullhead-rev-10/101.dtb: pm8994-regulators: 'vdd_lvs1_2' does not match any of the regexes: '.*-supply$', '^((s|l|lvs|5vs)[0-9]*)|(boost-bypass)|(bob)$', 'pinctrl-[0= -9]+' >From schema: regulator/qcom,smd-rpm-regulator.yaml msm8992-xiaomi-libra.dtb: pm8994-regulators: 'vdd_lvs1_2' does not match any of the regexes: '.*-supply$', '^((s|l|lvs|5vs)[0-9]*)|(boost-bypass)|(bob)$', 'pinctrl-[0= -9]+' >From schema: regulator/qcom,smd-rpm-regulator.yaml Reported-by: Rob Herring Cc: Konrad Dybcio Fixes: f3b2c99e73be ("arm64: dts: Enable onboard SDHCI on msm8992") Fixes: 0f5cdb31e850 ("arm64: dts: qcom: Add Xiaomi Libra (Mi 4C) device tre= e") Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220627135938.2901871-1-stephan.gerhold@ke= rnkonzept.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi b/arch/arm64= /boot/dts/qcom/msm8992-lg-bullhead.dtsi index 3b0cc85d6674..71e373b11de9 100644 --- a/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi @@ -74,7 +74,7 @@ vdd_l17_29-supply =3D <&vph_pwr>; vdd_l20_21-supply =3D <&vph_pwr>; vdd_l25-supply =3D <&pm8994_s5>; - vdd_lvs1_2 =3D <&pm8994_s4>; + vdd_lvs1_2-supply =3D <&pm8994_s4>; =20 /* S1, S2, S6 and S12 are managed by RPMPD */ =20 diff --git a/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts b/arch/arm64= /boot/dts/qcom/msm8992-xiaomi-libra.dts index 84558ab5fe86..ae882bfbf48d 100644 --- a/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts +++ b/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts @@ -143,7 +143,7 @@ vdd_l17_29-supply =3D <&vph_pwr>; vdd_l20_21-supply =3D <&vph_pwr>; vdd_l25-supply =3D <&pm8994_s5>; - vdd_lvs1_2 =3D <&pm8994_s4>; + vdd_lvs1_2-supply =3D <&pm8994_s4>; =20 /* S1, S2, S6 and S12 are managed by RPMPD */ =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 40DC4C433EF for ; Mon, 11 Jul 2022 09:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbiGKJcS (ORCPT ); Mon, 11 Jul 2022 05:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232677AbiGKJbf (ORCPT ); Mon, 11 Jul 2022 05:31:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 143F574DDD; Mon, 11 Jul 2022 02:17:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83C2DB80DB7; Mon, 11 Jul 2022 09:17:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5DD6C34115; Mon, 11 Jul 2022 09:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531030; bh=IScW0LFMmcTStFPx2URycrFLwFhfPk+cUhNi93H2wMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnFeZpc7kD3FfA717v8R3QJC0V3yvUhfJeoHN01iHLPWOgQ0uFmBRKDsetsznL0DV TkDFEbl3X3G0TiL7LmPM611AIZBMSqa/569AkzGUfs4yhEIS+FquXNUkvaH9aDYtXU lzN9V+vrZT6gl33MNeblRbncyvac3RXan/gSyT1Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 070/112] ARM: at91: pm: use proper compatible for sama5d2s rtc Date: Mon, 11 Jul 2022 11:07:10 +0200 Message-Id: <20220711090551.560301623@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea [ Upstream commit ddc980da8043779119acaca106c6d9b445c9b65b ] Use proper compatible strings for SAMA5D2's RTC IPs. This is necessary for configuring wakeup sources for ULP1 PM mode. Fixes: d7484f5c6b3b ("ARM: at91: pm: configure wakeup sources for ULP1 mode= ") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-2-claudiu.beznea@micr= ochip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-at91/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 0fd609e26615..0da13a7afa31 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -146,7 +146,7 @@ static const struct wakeup_source_info ws_info[] =3D { =20 static const struct of_device_id sama5d2_ws_ids[] =3D { { .compatible =3D "atmel,sama5d2-gem", .data =3D &ws_info[0] }, - { .compatible =3D "atmel,at91rm9200-rtc", .data =3D &ws_info[1] }, + { .compatible =3D "atmel,sama5d2-rtc", .data =3D &ws_info[1] }, { .compatible =3D "atmel,sama5d3-udc", .data =3D &ws_info[2] }, { .compatible =3D "atmel,at91rm9200-ohci", .data =3D &ws_info[2] }, { .compatible =3D "usb-ohci", .data =3D &ws_info[2] }, --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 C9386C433EF for ; Mon, 11 Jul 2022 09:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232695AbiGKJcX (ORCPT ); Mon, 11 Jul 2022 05:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbiGKJbh (ORCPT ); Mon, 11 Jul 2022 05:31:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA2C74DF0; Mon, 11 Jul 2022 02:17:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2D7F5B80D2C; Mon, 11 Jul 2022 09:17:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89A83C341CB; Mon, 11 Jul 2022 09:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531032; bh=mlI1Uud6q9h62IR3vOayBWgTsVubl46hJHtd1vn7oWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAIL7HEO1c83jT0NM+3MBtSUp7GrRZCLIAH9X88sh8ggn4cbkj7JyfQmz71b8JE22 HZ27jKGjQFM5fpsKjJtgPQSE2mBD3qQ2TgJZQ79XxhlD/gFwvbByZYGnxRtthVRaOb 98EK3oOkybzphEefeWWwvQutQfwP5kYWWTkdhS9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 071/112] ARM: at91: pm: use proper compatibles for sam9x60s rtc and rtt Date: Mon, 11 Jul 2022 11:07:11 +0200 Message-Id: <20220711090551.588383999@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea [ Upstream commit 641522665dbb25ce117c78746df1aad8b58c80e5 ] Use proper compatible strings for SAM9X60's RTC and RTT IPs. These are necessary for configuring wakeup sources for ULP1 PM mode. Fixes: eaedc0d379da ("ARM: at91: pm: add ULP1 support for SAM9X60") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-3-claudiu.beznea@micr= ochip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-at91/pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 0da13a7afa31..464b7dea5bbe 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -157,12 +157,12 @@ static const struct of_device_id sama5d2_ws_ids[] =3D= { }; =20 static const struct of_device_id sam9x60_ws_ids[] =3D { - { .compatible =3D "atmel,at91sam9x5-rtc", .data =3D &ws_info[1] }, + { .compatible =3D "microchip,sam9x60-rtc", .data =3D &ws_info[1] }, { .compatible =3D "atmel,at91rm9200-ohci", .data =3D &ws_info[2] }, { .compatible =3D "usb-ohci", .data =3D &ws_info[2] }, { .compatible =3D "atmel,at91sam9g45-ehci", .data =3D &ws_info[2] }, { .compatible =3D "usb-ehci", .data =3D &ws_info[2] }, - { .compatible =3D "atmel,at91sam9260-rtt", .data =3D &ws_info[4] }, + { .compatible =3D "microchip,sam9x60-rtt", .data =3D &ws_info[4] }, { .compatible =3D "cdns,sam9x60-macb", .data =3D &ws_info[5] }, { /* sentinel */ } }; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 23786C433EF for ; Mon, 11 Jul 2022 09:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231882AbiGKJch (ORCPT ); Mon, 11 Jul 2022 05:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbiGKJb7 (ORCPT ); Mon, 11 Jul 2022 05:31:59 -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 5ECE34199E; Mon, 11 Jul 2022 02:17:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF08CB80E76; Mon, 11 Jul 2022 09:17:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022F0C34115; Mon, 11 Jul 2022 09:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531038; bh=8UAVguRCvTybjVhHmN58+ti9OdpcIkLeDFPb9kOGhRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a9L/M1t3KwOeHvcVjeOcTS2raWA/unQnWr8sA8Wc28lmzzyDnoY9pD3/ml0o9bLvp G1ngjWM+5Sj8EKGHaTbiHOWOmZLWvO5qLxqTyMpavQ8xTpWw6sPDSYoNeqqy7+mUSt e8mmILAxBBVy5E3urprM9sWI1tsfLd18oo5i1UGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 072/112] ARM: at91: pm: use proper compatibles for sama7g5s rtc and rtt Date: Mon, 11 Jul 2022 11:07:12 +0200 Message-Id: <20220711090551.616611516@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea [ Upstream commit 1c40169b35ad58906814d53a517ac92db3d20d5f ] Use proper compatible strings for SAMA7G5's RTC and RTT IPs. These are necessary for configuring wakeup sources for ULP1 PM mode. Fixes: 6501330f9f5e ("ARM: at91: pm: add pm support for SAMA7G5") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-4-claudiu.beznea@micr= ochip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/mach-at91/pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 464b7dea5bbe..32f224f723a5 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -168,13 +168,13 @@ static const struct of_device_id sam9x60_ws_ids[] =3D= { }; =20 static const struct of_device_id sama7g5_ws_ids[] =3D { - { .compatible =3D "atmel,at91sam9x5-rtc", .data =3D &ws_info[1] }, + { .compatible =3D "microchip,sama7g5-rtc", .data =3D &ws_info[1] }, { .compatible =3D "microchip,sama7g5-ohci", .data =3D &ws_info[2] }, { .compatible =3D "usb-ohci", .data =3D &ws_info[2] }, { .compatible =3D "atmel,at91sam9g45-ehci", .data =3D &ws_info[2] }, { .compatible =3D "usb-ehci", .data =3D &ws_info[2] }, { .compatible =3D "microchip,sama7g5-sdhci", .data =3D &ws_info[3] }, - { .compatible =3D "atmel,at91sam9260-rtt", .data =3D &ws_info[4] }, + { .compatible =3D "microchip,sama7g5-rtt", .data =3D &ws_info[4] }, { /* sentinel */ } }; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 19D9EC43334 for ; Mon, 11 Jul 2022 09:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbiGKJcq (ORCPT ); Mon, 11 Jul 2022 05:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbiGKJcD (ORCPT ); Mon, 11 Jul 2022 05:32:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFA3419A8; Mon, 11 Jul 2022 02:17: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 dfw.source.kernel.org (Postfix) with ESMTPS id E1AD561257; Mon, 11 Jul 2022 09:17:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E63E2C341C0; Mon, 11 Jul 2022 09:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531041; bh=ettJJAGG6+QCxqGnRfN2A097HPuayip3gBx+rD7C5SU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kn1GrgSTPERNG/GiDxQ4ZKewRqgH+uXxXakpQmsy2oDb5oOr0FZFv+vQ7X4AtJ8xI UbwA7nbtU7rzSvKXPhfY6EGHxIGO4pW3X4d9HxDVWL8rsqAVNG+4/H2crHO4Fk00Gd 0TeGf33T2lJ8y4uA5qLjxcv6T4GKrdLL+K9/Do/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eugen Hristev , Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 073/112] ARM: dts: at91: sam9x60ek: fix eeprom compatible and size Date: Mon, 11 Jul 2022 11:07:13 +0200 Message-Id: <20220711090551.644673592@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Eugen Hristev [ Upstream commit f2cbbc3f926316ccf8ef9363d8a60c1110afc1c7 ] The board has a microchip 24aa025e48 eeprom, which is a 2 Kbits memory, so it's compatible with at24c02 not at24c32. Also the size property is wrong, it's not 128 bytes, but 256 bytes. Thus removing and leaving it to the default (256). Fixes: 1e5f532c27371 ("ARM: dts: at91: sam9x60: add device tree for soc and= board") Signed-off-by: Eugen Hristev Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220607090455.80433-1-eugen.hristev@microc= hip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/boot/dts/at91-sam9x60ek.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-= sam9x60ek.dts index 7719ea3d4933..81ccb0636a00 100644 --- a/arch/arm/boot/dts/at91-sam9x60ek.dts +++ b/arch/arm/boot/dts/at91-sam9x60ek.dts @@ -233,10 +233,9 @@ status =3D "okay"; =20 eeprom@53 { - compatible =3D "atmel,24c32"; + compatible =3D "atmel,24c02"; reg =3D <0x53>; pagesize =3D <16>; - size =3D <128>; status =3D "okay"; }; }; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 2AD74C433EF for ; Mon, 11 Jul 2022 09:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232673AbiGKJcu (ORCPT ); Mon, 11 Jul 2022 05:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232640AbiGKJcN (ORCPT ); Mon, 11 Jul 2022 05:32:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D013C4330F; Mon, 11 Jul 2022 02:17:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AB32D61243; Mon, 11 Jul 2022 09:17:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3689C341C0; Mon, 11 Jul 2022 09:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531044; bh=sHcfpShKWSDRKQYb8GObnyX1seYyzwG9Pz2xF486Y9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q3OXiC661ocFEmfXf4AXNmQUHiaaq5j5N+YfRtYZWsF0qYphlBZidyApwbkLMXtRW 23fZCl26JefuXfsoBGCZwfn6nFUlTEFO69T8pvu/F3VKBth3yUp8mY6xdTSh1PL4oy pkTClaSO116nQJH/oezYuUaYSLEzwhU2KEc4v54U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eugen Hristev , Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 074/112] ARM: dts: at91: sama5d2_icp: fix eeprom compatibles Date: Mon, 11 Jul 2022 11:07:14 +0200 Message-Id: <20220711090551.672969978@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Eugen Hristev [ Upstream commit 416ce193d73a734ded6d09fe141017b38af1c567 ] The eeprom memories on the board are microchip 24aa025e48, which are 2 Kbits and are compatible with at24c02 not at24c32. Fixes: 68a95ef72cefe ("ARM: dts: at91: sama5d2-icp: add SAMA5D2-ICP") Signed-off-by: Eugen Hristev Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220607090455.80433-2-eugen.hristev@microc= hip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/boot/dts/at91-sama5d2_icp.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at9= 1-sama5d2_icp.dts index 806eb1d911d7..164201a8fbf2 100644 --- a/arch/arm/boot/dts/at91-sama5d2_icp.dts +++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts @@ -329,21 +329,21 @@ status =3D "okay"; =20 eeprom@50 { - compatible =3D "atmel,24c32"; + compatible =3D "atmel,24c02"; reg =3D <0x50>; pagesize =3D <16>; status =3D "okay"; }; =20 eeprom@52 { - compatible =3D "atmel,24c32"; + compatible =3D "atmel,24c02"; reg =3D <0x52>; pagesize =3D <16>; status =3D "disabled"; }; =20 eeprom@53 { - compatible =3D "atmel,24c32"; + compatible =3D "atmel,24c02"; reg =3D <0x53>; pagesize =3D <16>; status =3D "disabled"; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 7568ACCA47B for ; Mon, 11 Jul 2022 09:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbiGKJiC (ORCPT ); Mon, 11 Jul 2022 05:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbiGKJhI (ORCPT ); Mon, 11 Jul 2022 05:37:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 041AD4E63E; Mon, 11 Jul 2022 02:19:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B0324B80E76; Mon, 11 Jul 2022 09:19:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26579C34115; Mon, 11 Jul 2022 09:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531166; bh=KCG/poZQs1m2qcMF8m1bdRnnCDWxrbakgTIoSY55yeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0gJP3LgHyX4OlS2bAUYbOyrXe+1vBAi91brCTAvq9+ucOQs+QoMepCZczhxl5NU// /ef7I8DufqTxrQmDSYVYmT1NdyLDtzA2twODVDpJWG18viQshKTkURbJKTBafrp1z2 9s/+FL0140nBX71WGmdh2oaM1qhf/NFugHo8JaVU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mihai Sain , Claudiu Beznea , Sasha Levin Subject: [PATCH 5.18 075/112] ARM: at91: fix soc detection for SAM9X60 SiPs Date: Mon, 11 Jul 2022 11:07:15 +0200 Message-Id: <20220711090551.700795977@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Mihai Sain [ Upstream commit 35074df65a8d8c5328a83e2eea948f7bbc8e6e08 ] Fix SoC detection for SAM9X60 SiPs: SAM9X60D5M SAM9X60D1G SAM9X60D6K Fixes: af3a10513cd6 ("drivers: soc: atmel: add per soc id and version match= masks") Signed-off-by: Mihai Sain Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220616081344.1978664-1-claudiu.beznea@mic= rochip.com Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/soc/atmel/soc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c index b2d365ae0282..dae8a2e0f745 100644 --- a/drivers/soc/atmel/soc.c +++ b/drivers/soc/atmel/soc.c @@ -91,14 +91,14 @@ static const struct at91_soc socs[] __initconst =3D { AT91_SOC(SAM9X60_CIDR_MATCH, AT91_CIDR_MATCH_MASK, AT91_CIDR_VERSION_MASK, SAM9X60_EXID_MATCH, "sam9x60", "sam9x60"), - AT91_SOC(SAM9X60_CIDR_MATCH, SAM9X60_D5M_EXID_MATCH, - AT91_CIDR_VERSION_MASK, SAM9X60_EXID_MATCH, + AT91_SOC(SAM9X60_CIDR_MATCH, AT91_CIDR_MATCH_MASK, + AT91_CIDR_VERSION_MASK, SAM9X60_D5M_EXID_MATCH, "sam9x60 64MiB DDR2 SiP", "sam9x60"), - AT91_SOC(SAM9X60_CIDR_MATCH, SAM9X60_D1G_EXID_MATCH, - AT91_CIDR_VERSION_MASK, SAM9X60_EXID_MATCH, + AT91_SOC(SAM9X60_CIDR_MATCH, AT91_CIDR_MATCH_MASK, + AT91_CIDR_VERSION_MASK, SAM9X60_D1G_EXID_MATCH, "sam9x60 128MiB DDR2 SiP", "sam9x60"), - AT91_SOC(SAM9X60_CIDR_MATCH, SAM9X60_D6K_EXID_MATCH, - AT91_CIDR_VERSION_MASK, SAM9X60_EXID_MATCH, + AT91_SOC(SAM9X60_CIDR_MATCH, AT91_CIDR_MATCH_MASK, + AT91_CIDR_VERSION_MASK, SAM9X60_D6K_EXID_MATCH, "sam9x60 8MiB SDRAM SiP", "sam9x60"), #endif #ifdef CONFIG_SOC_SAMA5 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 EAB57C433EF for ; Mon, 11 Jul 2022 09:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbiGKJdv (ORCPT ); Mon, 11 Jul 2022 05:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232757AbiGKJdD (ORCPT ); Mon, 11 Jul 2022 05:33:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5588D78DF2; Mon, 11 Jul 2022 02:17: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 B28B56129D; Mon, 11 Jul 2022 09:17:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96A7BC34115; Mon, 11 Jul 2022 09:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531064; bh=+JD6V1ZUOHmjXkK9EI6NbALLnIhn7jm5/ts2zJED3dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZfJzg1pWoIX8PwM/y1tOn5yVYRSYAK3z8NyXWhh2fW1hIJ05OOAYtisJIKcDIqNsG x1DD5ziAOoQc7jcwvZwTI96tZ263HPXwl6ffs6QBwjP3V/cc7+LpF8hOqRk4Ewe8Jx LmmFQVvjeRyJiz+0n+xXDWJfNNmq6PGgjB81gYCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Malov , Daniel Borkmann , Magnus Karlsson , Sasha Levin Subject: [PATCH 5.18 076/112] xsk: Clear page contiguity bit when unmapping pool Date: Mon, 11 Jul 2022 11:07:16 +0200 Message-Id: <20220711090551.728724924@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Ivan Malov [ Upstream commit 512d1999b8e94a5d43fba3afc73e774849674742 ] When a XSK pool gets mapped, xp_check_dma_contiguity() adds bit 0x1 to pages' DMA addresses that go in ascending order and at 4K stride. The problem is that the bit does not get cleared before doing unmap. As a result, a lot of warnings from iommu_dma_unmap_page() are seen in dmesg, which indicates that lookups by iommu_iova_to_phys() fail. Fixes: 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API") Signed-off-by: Ivan Malov Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220628091848.534803-1-ivan.malov@oktetl= abs.ru Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/xdp/xsk_buff_pool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index 87bdd71c7bb6..f70112176b7c 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -332,6 +332,7 @@ static void __xp_dma_unmap(struct xsk_dma_map *dma_map,= unsigned long attrs) for (i =3D 0; i < dma_map->dma_pages_cnt; i++) { dma =3D &dma_map->dma_pages[i]; if (*dma) { + *dma &=3D ~XSK_NEXT_PG_CONTIG_MASK; dma_unmap_page_attrs(dma_map->dev, *dma, PAGE_SIZE, DMA_BIDIRECTIONAL, attrs); *dma =3D 0; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 787F9C433EF for ; Mon, 11 Jul 2022 09:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232823AbiGKJfa (ORCPT ); Mon, 11 Jul 2022 05:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232835AbiGKJeM (ORCPT ); Mon, 11 Jul 2022 05:34:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E697B34E; Mon, 11 Jul 2022 02:18:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A4DE56111F; Mon, 11 Jul 2022 09:18:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87F76C34115; Mon, 11 Jul 2022 09:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531095; bh=vWqdF/QbE599LGS+3jp14cUHjUuyTGGqsN3uKJFlhX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m9o6/gZVaidwP++YmzV/qhvp7kRX1eV0uPCByezbZvjNQMBz6TjBfoyC7UHrEwiL6 KU9XbqcuIirluX5SjGqbKlgb4WMPGb90FuYcqmYgLlXCAbNdyefMYtYy7pNnWXkGWr zgDhr5U2jA0xxw5jIOA8JrausH/Hp+zzAbCHwUm4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean Delvare , Yi Zhang , Terry Bowman , Terry Bowman , Wolfram Sang , Sasha Levin Subject: [PATCH 5.18 077/112] i2c: piix4: Fix a memory leak in the EFCH MMIO support Date: Mon, 11 Jul 2022 11:07:17 +0200 Message-Id: <20220711090551.756719392@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Jean Delvare [ Upstream commit 8ad59b397f86a4d8014966fdc0552095a0c4fb2b ] The recently added support for EFCH MMIO regions introduced a memory leak in that code path. The leak is caused by the fact that release_resource() merely removes the resource from the tree but does not free its memory. We need to call release_mem_region() instead, which does free the memory. As a nice side effect, this brings back some symmetry between the legacy and MMIO paths. Signed-off-by: Jean Delvare Reported-by: Yi Zhang Tested-by: Yi Zhang Reviewed-by: Terry Bowman Tested-by: Terry Bowman Fixes: 7c148722d074 ("i2c: piix4: Add EFCH MMIO support to region request a= nd release") Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/i2c/busses/i2c-piix4.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index ac8e7d60672a..39cb1b7bb865 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -161,7 +161,6 @@ static const char *piix4_aux_port_name_sb800 =3D " port= 1"; =20 struct sb800_mmio_cfg { void __iomem *addr; - struct resource *res; bool use_mmio; }; =20 @@ -179,13 +178,11 @@ static int piix4_sb800_region_request(struct device *= dev, struct sb800_mmio_cfg *mmio_cfg) { if (mmio_cfg->use_mmio) { - struct resource *res; void __iomem *addr; =20 - res =3D request_mem_region_muxed(SB800_PIIX4_FCH_PM_ADDR, - SB800_PIIX4_FCH_PM_SIZE, - "sb800_piix4_smb"); - if (!res) { + if (!request_mem_region_muxed(SB800_PIIX4_FCH_PM_ADDR, + SB800_PIIX4_FCH_PM_SIZE, + "sb800_piix4_smb")) { dev_err(dev, "SMBus base address memory region 0x%x already in use.\n", SB800_PIIX4_FCH_PM_ADDR); @@ -195,12 +192,12 @@ static int piix4_sb800_region_request(struct device *= dev, addr =3D ioremap(SB800_PIIX4_FCH_PM_ADDR, SB800_PIIX4_FCH_PM_SIZE); if (!addr) { - release_resource(res); + release_mem_region(SB800_PIIX4_FCH_PM_ADDR, + SB800_PIIX4_FCH_PM_SIZE); dev_err(dev, "SMBus base address mapping failed.\n"); return -ENOMEM; } =20 - mmio_cfg->res =3D res; mmio_cfg->addr =3D addr; =20 return 0; @@ -222,7 +219,8 @@ static void piix4_sb800_region_release(struct device *d= ev, { if (mmio_cfg->use_mmio) { iounmap(mmio_cfg->addr); - release_resource(mmio_cfg->res); + release_mem_region(SB800_PIIX4_FCH_PM_ADDR, + SB800_PIIX4_FCH_PM_SIZE); return; } =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 57FAEC43334 for ; Mon, 11 Jul 2022 09:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232169AbiGKJgl (ORCPT ); Mon, 11 Jul 2022 05:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232908AbiGKJfy (ORCPT ); Mon, 11 Jul 2022 05:35:54 -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 703644C612; Mon, 11 Jul 2022 02:18: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 4572C61227; Mon, 11 Jul 2022 09:18:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57108C34115; Mon, 11 Jul 2022 09:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531125; bh=hUxE3+wTB2JT0YWYRCLk4SO4k3ptt/3otjHdhPE3YAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fL8STZcDqPG/oBBCYwdEEJTN/sIAhbcsmDWWewQv1rrAOzEz5ZhE9W+XUZyGSN3qM BmxkdWhYX0yKTI09tBzuLQVmq5TLkH14I2GCAEi5cv9PhrjyXHWBz8ynPebceHPGlQ 83SWhEjbZQiNQZ+Fl/D/5jxoPHQxkMCviFIkq1QA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukasz Cieplicki , Jedrzej Jagielski , Tony Nguyen , Sasha Levin , Gurucharan Subject: [PATCH 5.18 078/112] i40e: Fix dropped jumbo frames statistics Date: Mon, 11 Jul 2022 11:07:18 +0200 Message-Id: <20220711090551.785160086@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Lukasz Cieplicki [ Upstream commit 1adb1563e7b7ec659379a18e607e8bc3522d8a78 ] Dropped packets caused by too large frames were not included in dropped RX packets statistics. Issue was caused by not reading the GL_RXERR1 register. That register stores count of packet which was have been dropped due to too large size. Fix it by reading GL_RXERR1 register for each interface. Repro steps: Send a packet larger than the set MTU to SUT Observe rx statists: ethtool -S | grep rx | grep -v ": 0" Fixes: 41a9e55c89be ("i40e: add missing VSI statistics") Signed-off-by: Lukasz Cieplicki Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan (A Contingent worker at Int= el) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/intel/i40e/i40e.h | 16 ++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 73 +++++++++++++++++++ .../net/ethernet/intel/i40e/i40e_register.h | 13 ++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 1 + 4 files changed, 103 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/= intel/i40e/i40e.h index 55c6bce5da61..615aff0798d3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -37,6 +37,7 @@ #include #include #include +#include #include "i40e_type.h" #include "i40e_prototype.h" #include @@ -1091,6 +1092,21 @@ static inline void i40e_write_fd_input_set(struct i4= 0e_pf *pf, (u32)(val & 0xFFFFFFFFULL)); } =20 +/** + * i40e_get_pf_count - get PCI PF count. + * @hw: pointer to a hw. + * + * Reports the function number of the highest PCI physical + * function plus 1 as it is loaded from the NVM. + * + * Return: PCI PF count. + **/ +static inline u32 i40e_get_pf_count(struct i40e_hw *hw) +{ + return FIELD_GET(I40E_GLGEN_PCIFCNCNT_PCIPFCNT_MASK, + rd32(hw, I40E_GLGEN_PCIFCNCNT)); +} + /* needed by i40e_ethtool.c */ int i40e_up(struct i40e_vsi *vsi); void i40e_down(struct i40e_vsi *vsi); diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethe= rnet/intel/i40e/i40e_main.c index 46bb1169a004..77eb9c726205 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -549,6 +549,47 @@ void i40e_pf_reset_stats(struct i40e_pf *pf) pf->hw_csum_rx_error =3D 0; } =20 +/** + * i40e_compute_pci_to_hw_id - compute index form PCI function. + * @vsi: ptr to the VSI to read from. + * @hw: ptr to the hardware info. + **/ +static u32 i40e_compute_pci_to_hw_id(struct i40e_vsi *vsi, struct i40e_hw = *hw) +{ + int pf_count =3D i40e_get_pf_count(hw); + + if (vsi->type =3D=3D I40E_VSI_SRIOV) + return (hw->port * BIT(7)) / pf_count + vsi->vf_id; + + return hw->port + BIT(7); +} + +/** + * i40e_stat_update64 - read and update a 64 bit stat from the chip. + * @hw: ptr to the hardware info. + * @hireg: the high 32 bit reg to read. + * @loreg: the low 32 bit reg to read. + * @offset_loaded: has the initial offset been loaded yet. + * @offset: ptr to current offset value. + * @stat: ptr to the stat. + * + * Since the device stats are not reset at PFReset, they will not + * be zeroed when the driver starts. We'll save the first values read + * and use them as offsets to be subtracted from the raw values in order + * to report stats that count from zero. + **/ +static void i40e_stat_update64(struct i40e_hw *hw, u32 hireg, u32 loreg, + bool offset_loaded, u64 *offset, u64 *stat) +{ + u64 new_data; + + new_data =3D rd64(hw, loreg); + + if (!offset_loaded || new_data < *offset) + *offset =3D new_data; + *stat =3D new_data - *offset; +} + /** * i40e_stat_update48 - read and update a 48 bit stat from the chip * @hw: ptr to the hardware info @@ -620,6 +661,34 @@ static void i40e_stat_update_and_clear32(struct i40e_h= w *hw, u32 reg, u64 *stat) *stat +=3D new_data; } =20 +/** + * i40e_stats_update_rx_discards - update rx_discards. + * @vsi: ptr to the VSI to be updated. + * @hw: ptr to the hardware info. + * @stat_idx: VSI's stat_counter_idx. + * @offset_loaded: ptr to the VSI's stat_offsets_loaded. + * @stat_offset: ptr to stat_offset to store first read of specific regist= er. + * @stat: ptr to VSI's stat to be updated. + **/ +static void +i40e_stats_update_rx_discards(struct i40e_vsi *vsi, struct i40e_hw *hw, + int stat_idx, bool offset_loaded, + struct i40e_eth_stats *stat_offset, + struct i40e_eth_stats *stat) +{ + u64 rx_rdpc, rx_rxerr; + + i40e_stat_update32(hw, I40E_GLV_RDPC(stat_idx), offset_loaded, + &stat_offset->rx_discards, &rx_rdpc); + i40e_stat_update64(hw, + I40E_GL_RXERR1H(i40e_compute_pci_to_hw_id(vsi, hw)), + I40E_GL_RXERR1L(i40e_compute_pci_to_hw_id(vsi, hw)), + offset_loaded, &stat_offset->rx_discards_other, + &rx_rxerr); + + stat->rx_discards =3D rx_rdpc + rx_rxerr; +} + /** * i40e_update_eth_stats - Update VSI-specific ethernet statistics counter= s. * @vsi: the VSI to be updated @@ -679,6 +748,10 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi) I40E_GLV_BPTCL(stat_idx), vsi->stat_offsets_loaded, &oes->tx_broadcast, &es->tx_broadcast); + + i40e_stats_update_rx_discards(vsi, hw, stat_idx, + vsi->stat_offsets_loaded, oes, es); + vsi->stat_offsets_loaded =3D true; } =20 diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/= ethernet/intel/i40e/i40e_register.h index 1908eed4fa5e..7339003aa17c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_register.h +++ b/drivers/net/ethernet/intel/i40e/i40e_register.h @@ -211,6 +211,11 @@ #define I40E_GLGEN_MSRWD_MDIWRDATA_SHIFT 0 #define I40E_GLGEN_MSRWD_MDIRDDATA_SHIFT 16 #define I40E_GLGEN_MSRWD_MDIRDDATA_MASK I40E_MASK(0xFFFF, I40E_GLGEN_MSRWD= _MDIRDDATA_SHIFT) +#define I40E_GLGEN_PCIFCNCNT 0x001C0AB4 /* Reset: PCIR */ +#define I40E_GLGEN_PCIFCNCNT_PCIPFCNT_SHIFT 0 +#define I40E_GLGEN_PCIFCNCNT_PCIPFCNT_MASK I40E_MASK(0x1F, I40E_GLGEN_PCI= FCNCNT_PCIPFCNT_SHIFT) +#define I40E_GLGEN_PCIFCNCNT_PCIVFCNT_SHIFT 16 +#define I40E_GLGEN_PCIFCNCNT_PCIVFCNT_MASK I40E_MASK(0xFF, I40E_GLGEN_PCI= FCNCNT_PCIVFCNT_SHIFT) #define I40E_GLGEN_RSTAT 0x000B8188 /* Reset: POR */ #define I40E_GLGEN_RSTAT_DEVSTATE_SHIFT 0 #define I40E_GLGEN_RSTAT_DEVSTATE_MASK I40E_MASK(0x3, I40E_GLGEN_RSTAT_DEV= STATE_SHIFT) @@ -643,6 +648,14 @@ #define I40E_VFQF_HKEY1_MAX_INDEX 12 #define I40E_VFQF_HLUT1(_i, _VF) (0x00220000 + ((_i) * 1024 + (_VF) * 4)) = /* _i=3D0...15, _VF=3D0...127 */ /* Reset: CORER */ #define I40E_VFQF_HLUT1_MAX_INDEX 15 +#define I40E_GL_RXERR1H(_i) (0x00318004 + ((_i) * 8)) /* _i=3D= 0...143 */ /* Reset: CORER */ +#define I40E_GL_RXERR1H_MAX_INDEX 143 +#define I40E_GL_RXERR1H_RXERR1H_SHIFT 0 +#define I40E_GL_RXERR1H_RXERR1H_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_RXER= R1H_RXERR1H_SHIFT) +#define I40E_GL_RXERR1L(_i) (0x00318000 + ((_i) * 8)) /* _i=3D= 0...143 */ /* Reset: CORER */ +#define I40E_GL_RXERR1L_MAX_INDEX 143 +#define I40E_GL_RXERR1L_RXERR1L_SHIFT 0 +#define I40E_GL_RXERR1L_RXERR1L_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_RXER= R1L_RXERR1L_SHIFT) #define I40E_GLPRT_BPRCH(_i) (0x003005E4 + ((_i) * 8)) /* _i=3D0...3 */ /*= Reset: CORER */ #define I40E_GLPRT_BPRCL(_i) (0x003005E0 + ((_i) * 8)) /* _i=3D0...3 */ /*= Reset: CORER */ #define I40E_GLPRT_BPTCH(_i) (0x00300A04 + ((_i) * 8)) /* _i=3D0...3 */ /*= Reset: CORER */ diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethe= rnet/intel/i40e/i40e_type.h index 36a4ca1ffb1a..7b3f30beb757 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h @@ -1172,6 +1172,7 @@ struct i40e_eth_stats { u64 tx_broadcast; /* bptc */ u64 tx_discards; /* tdpc */ u64 tx_errors; /* tepc */ + u64 rx_discards_other; /* rxerr1 */ }; =20 /* Statistics collected per VEB per TC */ --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 6910CC433EF for ; Mon, 11 Jul 2022 09:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233057AbiGKJhh (ORCPT ); Mon, 11 Jul 2022 05:37:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232956AbiGKJg4 (ORCPT ); Mon, 11 Jul 2022 05:36:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E576B1263D; Mon, 11 Jul 2022 02:19:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 93F47B80833; Mon, 11 Jul 2022 09:19:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F225BC34115; Mon, 11 Jul 2022 09:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531150; bh=SbQjTmkrJEcRV6QDAy0fMtAN5mBYr4UruzKauaQHEWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hnWobTUqrpUNoh4yIc7ZOAH1Csn45+4icUWx7/pwYtD9ozeufpTWafkPfdBz9n0FD 0QhYJ3YMKAs7l7gGWPUuomtIvpUn0RsDLEtwOZdtNcHgVGZi6VX45DHvROjELsQfFH axJFG08r/krb4NEnre+BoNRNuoZ3Jl6t/9rl05Ho= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Norbert Zulinski , Jan Sokolowski , Konrad Jankowski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.18 079/112] i40e: Fix VFs MAC Address change on VM Date: Mon, 11 Jul 2022 11:07:19 +0200 Message-Id: <20220711090551.814223026@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Norbert Zulinski [ Upstream commit fed0d9f13266a22ce1fc9a97521ef9cdc6271a23 ] Clear VF MAC from parent PF and remove VF filter from VSI when both conditions are true: -VIRTCHNL_VF_OFFLOAD_USO is not used -VM MAC was not set from PF level It affects older version of IAVF and it allow them to change MAC Address on VM, newer IAVF won't change their behaviour. Previously it wasn't possible to change VF's MAC Address on VM because there is flag on IAVF driver that won't allow to change MAC Address if this address is given from PF driver. Fixes: 155f0ac2c96b ("iavf: allow permanent MAC address to change") Signed-off-by: Norbert Zulinski Signed-off-by: Jan Sokolowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/n= et/ethernet/intel/i40e/i40e_virtchnl_pf.c index 033ea71763e3..86b0f21287dc 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2147,6 +2147,10 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_= vf *vf, u8 *msg) /* VFs only use TC 0 */ vfres->vsi_res[0].qset_handle =3D le16_to_cpu(vsi->info.qs_handle[0]); + if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) { + i40e_del_mac_filter(vsi, vf->default_lan_addr.addr); + eth_zero_addr(vf->default_lan_addr.addr); + } ether_addr_copy(vfres->vsi_res[0].default_mac_addr, vf->default_lan_addr.addr); } --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 0B857C43334 for ; Mon, 11 Jul 2022 09:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233067AbiGKJhj (ORCPT ); Mon, 11 Jul 2022 05:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbiGKJhC (ORCPT ); Mon, 11 Jul 2022 05:37:02 -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 501E24D4CD; Mon, 11 Jul 2022 02:19:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 986BC6129D; Mon, 11 Jul 2022 09:19:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5E76C34115; Mon, 11 Jul 2022 09:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531153; bh=Lx4hc0nUrNwQiiQOUQxsaBTqW6L6HwC4km2Y1mY4GHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HNZd+WfIGP0VtfiHLQ0TtMIJKm5phVZPxyHWiNTWGjhCTyxuGHQ6gTE+VuKF9YvdE PSQyqjUGk36NGxr3mv1yd42Ah02bMwURBbCft4LvWFZYtQXiiI7CZOMo4zSyMBLkqV /aJujp1IOTH2xca2V5b0J9TezwAXd/LdZpko0Czw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabrice Gasnier , Alexandre Torgue , Sasha Levin Subject: [PATCH 5.18 080/112] ARM: dts: stm32: add missing usbh clock and fix clk order on stm32mp15 Date: Mon, 11 Jul 2022 11:07:20 +0200 Message-Id: <20220711090551.842963197@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Fabrice Gasnier [ Upstream commit 1d0c1aadf1fd9f3de95d1532b3651e8634546e71 ] The USBH composed of EHCI and OHCI controllers needs the PHY clock to be initialized first, before enabling (gating) them. The reverse is also required when going to suspend. So, add USBPHY clock as 1st entry in both controllers, so the USBPHY PLL gets enabled 1st upon controller init. Upon suspend/resume, this also makes the clock to be disabled/re-enabled in the correct order. This fixes some IRQ storm conditions seen when going to low-power, due to PHY PLL being disabled before all clocks are cleanly gated. Fixes: 949a0c0dec85 ("ARM: dts: stm32: add USB Host (USBH) support to stm32= mp157c") Fixes: db7be2cb87ae ("ARM: dts: stm32: use usbphyc ck_usbo_48m as USBH OHCI= clock on stm32mp151") Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/arm/boot/dts/stm32mp151.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp1= 51.dtsi index f9aa9af31efd..9c2bbf115f4c 100644 --- a/arch/arm/boot/dts/stm32mp151.dtsi +++ b/arch/arm/boot/dts/stm32mp151.dtsi @@ -1474,7 +1474,7 @@ usbh_ohci: usb@5800c000 { compatible =3D "generic-ohci"; reg =3D <0x5800c000 0x1000>; - clocks =3D <&rcc USBH>, <&usbphyc>; + clocks =3D <&usbphyc>, <&rcc USBH>; resets =3D <&rcc USBH_R>; interrupts =3D ; status =3D "disabled"; @@ -1483,7 +1483,7 @@ usbh_ehci: usb@5800d000 { compatible =3D "generic-ehci"; reg =3D <0x5800d000 0x1000>; - clocks =3D <&rcc USBH>; + clocks =3D <&usbphyc>, <&rcc USBH>; resets =3D <&rcc USBH_R>; interrupts =3D ; companion =3D <&usbh_ohci>; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 4E739CCA480 for ; Mon, 11 Jul 2022 09:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233083AbiGKJhr (ORCPT ); Mon, 11 Jul 2022 05:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233002AbiGKJhD (ORCPT ); Mon, 11 Jul 2022 05:37:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5EA81209C; Mon, 11 Jul 2022 02:19:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6434D6129D; Mon, 11 Jul 2022 09:19:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CF87C34115; Mon, 11 Jul 2022 09:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531155; bh=AqmAQeDOEStw/4FQwCYgZRe78SsSM0WY/CAgDInFhHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYTN6gkj1Ii5eHSnk9lX3RrklssvUB4s3B7GyNyzcKaeubec3oMlutb4WrL+erBfN i1Ckp7TZU+I+8tXytRSBZTOF0hyw+c3VQ+6fcqRbOEEk7JuVZeV4gPwdrSfbr/q0hY 5ArPLZTAE+hFmsNmC0V97F+GvxpJXpUmvIi9tZfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Child , Brian King , Rick Lindsley , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 081/112] ibmvnic: Properly dispose of all skbs during a failover. Date: Mon, 11 Jul 2022 11:07:21 +0200 Message-Id: <20220711090551.871598411@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Rick Lindsley [ Upstream commit 1b18f09d31cfa7148df15a7d5c5e0e86f105f7d1 ] During a reset, there may have been transmits in flight that are no longer valid and cannot be fulfilled. Resetting and clearing the queues is insufficient; each skb also needs to be explicitly freed so that upper levels are not left waiting for confirmation of a transmit that will never happen. If this happens frequently enough, the apparent backlog will cause TCP to begin "congestion control" unnecessarily, culminating in permanently decreased throughput. Fixes: d7c0ef36bde03 ("ibmvnic: Free and re-allocate scrqs when tx/rx scrqs= change") Tested-by: Nick Child Reviewed-by: Brian King Signed-off-by: Rick Lindsley Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/= ibmvnic.c index 5c5931dba51d..c4221f89ab18 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -5774,6 +5774,15 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter= *adapter, bool reset) release_sub_crqs(adapter, 0); rc =3D init_sub_crqs(adapter); } else { + /* no need to reinitialize completely, but we do + * need to clean up transmits that were in flight + * when we processed the reset. Failure to do so + * will confound the upper layer, usually TCP, by + * creating the illusion of transmits that are + * awaiting completion. + */ + clean_tx_pools(adapter); + rc =3D reset_sub_crq_queues(adapter); } } else { --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 82EBEC43334 for ; Mon, 11 Jul 2022 09:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbiGKJhx (ORCPT ); Mon, 11 Jul 2022 05:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232795AbiGKJhE (ORCPT ); Mon, 11 Jul 2022 05:37:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A0451CB19; Mon, 11 Jul 2022 02:19:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8378B80833; Mon, 11 Jul 2022 09:19:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2548DC34115; Mon, 11 Jul 2022 09:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531158; bh=bvGkvaKm/HFxpgZ8hSpuauZJCtQUmCt5n/fC96tnSJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CmlgRU2TSl5Ny7w5i0Jo40piKmCFSa8xZjqVboYYS0yDy1hlE1H34Xwmkutd0nhAV thEuHja524Yom/ABUZwe7my4zWUKGdY5auPtJKFbjH4ZTz6qzc0CU0gsTanJZlN01t OOKGwTNRHl9tlAQiePEkG0T6DrTGBG24XY9sJDYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Ido Schimmel , Paolo Abeni , Sasha Levin Subject: [PATCH 5.18 082/112] selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT Date: Mon, 11 Jul 2022 11:07:22 +0200 Message-Id: <20220711090551.899811206@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vladimir Oltean [ Upstream commit b8e629b05f5d23f9649c901bef09fab8b0c2e4b9 ] As mentioned in the blamed commit, flood_unicast_test() works by checking the match count on a tc filter placed on the receiving interface. But the second host interface (host2_if) has no interest in receiving a packet with MAC DA de:ad:be:ef:13:37, so its RX filter drops it even before the ingress tc filter gets to be executed. So we will incorrectly get the message "Packet was not flooded when should", when in fact, the packet was flooded as expected but dropped due to an unrelated reason, at some other layer on the receiving side. Force h2 to accept this packet by temporarily placing it in promiscuous mode. Alternatively we could either deliver to its MAC address or use tcpdump_start, but this has the fewest complications. This fixes the "flooding" test from bridge_vlan_aware.sh and bridge_vlan_unaware.sh, which calls flood_test from the lib. Fixes: 236dd50bf67a ("selftests: forwarding: Add a test for flooded traffic= ") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- tools/testing/selftests/net/forwarding/lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/= selftests/net/forwarding/lib.sh index 664b9ecaf228..823e5cef062d 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1242,6 +1242,7 @@ flood_test_do() =20 # Add an ACL on `host2_if` which will tell us whether the packet # was flooded to it or not. + ip link set $host2_if promisc on tc qdisc add dev $host2_if ingress tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \ flower dst_mac $mac action drop @@ -1259,6 +1260,7 @@ flood_test_do() =20 tc filter del dev $host2_if ingress protocol ip pref 1 handle 101 flower tc qdisc del dev $host2_if ingress + ip link set $host2_if promisc off =20 return $err } --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 30E3EC43334 for ; Mon, 11 Jul 2022 09:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233089AbiGKJh5 (ORCPT ); Mon, 11 Jul 2022 05:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232799AbiGKJhE (ORCPT ); Mon, 11 Jul 2022 05:37:04 -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 2D76F4D4DE; Mon, 11 Jul 2022 02:19: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 dfw.source.kernel.org (Postfix) with ESMTPS id B3C0D612B7; Mon, 11 Jul 2022 09:19:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0D1AC34115; Mon, 11 Jul 2022 09:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531161; bh=13USmbIN3HFkiw1i02GRSczp16nmyxwwPWc6C2ThZb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOsG8kTSUWExCk95r5st4sNHLxcKgUT3wLjJhIvhtoI5SDS2Hj4kMa7Si9Ap1amn9 Mh7FwnfLgmsXeyKhkJgsLZQQkx+qqmJmWcNa6JH9Wa1gBrCY3rOIGX0dJQe2wQB9jM ONVeoj1+U3M/llD/fAzLIa1wr60WXpVcYIPbl9Tw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Ido Schimmel , Paolo Abeni , Sasha Levin Subject: [PATCH 5.18 083/112] selftests: forwarding: fix learning_test when h1 supports IFF_UNICAST_FLT Date: Mon, 11 Jul 2022 11:07:23 +0200 Message-Id: <20220711090551.927835704@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vladimir Oltean [ Upstream commit 1a635d3e1c80626237fdae47a5545b6655d8d81c ] The first host interface has by default no interest in receiving packets MAC DA de:ad:be:ef:13:37, so it might drop them before they hit the tc filter and this might confuse the selftest. Enable promiscuous mode such that the filter properly counts received packets. Fixes: d4deb01467ec ("selftests: forwarding: Add a test for FDB learning") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- tools/testing/selftests/net/forwarding/lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/= selftests/net/forwarding/lib.sh index 823e5cef062d..412e52e89071 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1176,6 +1176,7 @@ learning_test() # FDB entry was installed. bridge link set dev $br_port1 flood off =20 + ip link set $host1_if promisc on tc qdisc add dev $host1_if ingress tc filter add dev $host1_if ingress protocol ip pref 1 handle 101 \ flower dst_mac $mac action drop @@ -1225,6 +1226,7 @@ learning_test() =20 tc filter del dev $host1_if ingress protocol ip pref 1 handle 101 flower tc qdisc del dev $host1_if ingress + ip link set $host1_if promisc off =20 bridge link set dev $br_port1 flood on =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 77969C43334 for ; Mon, 11 Jul 2022 09:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233095AbiGKJiA (ORCPT ); Mon, 11 Jul 2022 05:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233006AbiGKJhF (ORCPT ); Mon, 11 Jul 2022 05:37:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2EB51261D; Mon, 11 Jul 2022 02:19: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 dfw.source.kernel.org (Postfix) with ESMTPS id 597636111F; Mon, 11 Jul 2022 09:19:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A43CC385A9; Mon, 11 Jul 2022 09:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531163; bh=bEHtYdEwJZX67YLc4RQfA/Z+TOjaYsEkyRE3U77hJK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkWdPQC81cY3vi420Sm3rBRVG+es1Oa0YfVEyPwKY3YcFqb6WPL1FS0HDt0krFSth Golt/OTt/Pwx8ASnXhE4cPr173Y/qcTdJhj6JyNPZMBmJb8YsFimfzD76QRcLkpSDM 3/BLl6ndP6XlGyrNa/vGRNa7VziMa+SyJcpNhxks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Ido Schimmel , Paolo Abeni , Sasha Levin Subject: [PATCH 5.18 084/112] selftests: forwarding: fix error message in learning_test Date: Mon, 11 Jul 2022 11:07:24 +0200 Message-Id: <20220711090551.955625692@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vladimir Oltean [ Upstream commit 83844aacab2015da1dba1df0cc61fc4b4c4e8076 ] When packets are not received, they aren't received on $host1_if, so the message talking about the second host not receiving them is incorrect. Fix it. Fixes: d4deb01467ec ("selftests: forwarding: Add a test for FDB learning") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- tools/testing/selftests/net/forwarding/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/= selftests/net/forwarding/lib.sh index 412e52e89071..063da0d53462 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1187,7 +1187,7 @@ learning_test() tc -j -s filter show dev $host1_if ingress \ | jq -e ".[] | select(.options.handle =3D=3D 101) \ | select(.options.actions[0].stats.packets =3D=3D 1)" &> /dev/null - check_fail $? "Packet reached second host when should not" + check_fail $? "Packet reached first host when should not" =20 $MZ $host1_if -c 1 -p 64 -a $mac -t ip -q sleep 1 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 856D2C43334 for ; Mon, 11 Jul 2022 09:33:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbiGKJd5 (ORCPT ); Mon, 11 Jul 2022 05:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232777AbiGKJdF (ORCPT ); Mon, 11 Jul 2022 05:33:05 -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 79DC4DFCD; Mon, 11 Jul 2022 02:17:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B689C61227; Mon, 11 Jul 2022 09:17:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93861C34115; Mon, 11 Jul 2022 09:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531067; bh=Vl9qchXDrnXIPpbdhnqUfVPKvvwM5SxL0Tt8mIXQMNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Levzabi4wVbiJu168U9VGVvbIqQ51v1e9nZQvosVZ0dTZ4P3a/Pv147hAVQEsc+Xt GHheqmvKYnB9qrWQxuBCxrpOcvn+GmkO6o3HNKexYTEE5UBGb7TRU27QL8acGzboNO SaMdlNtBas9e+MH58Z7VjLtudgmV/Y6CWMgEwpoU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre Gondois , Sudeep Holla , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 085/112] ACPI: CPPC: Check _OSC for flexible address space Date: Mon, 11 Jul 2022 11:07:25 +0200 Message-Id: <20220711090551.984038787@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Pierre Gondois [ Upstream commit 0651ab90e4ade17f1d4f4367b70f6120480410f3 ] ACPI 6.2 Section 6.2.11.2 'Platform-Wide OSPM Capabilities': Starting with ACPI Specification 6.2, all _CPC registers can be in PCC, System Memory, System IO, or Functional Fixed Hardware address spaces. OSPM support for this more flexible register space scheme is indicated by the =E2=80=9CFlexible Address Space for CPPC Registers=E2=80= =9D _OSC bit Otherwise (cf ACPI 6.1, s8.4.7.1.1.X), _CPC registers must be in: - PCC or Functional Fixed Hardware address space if defined - SystemMemory address space (NULL register) if not defined Add the corresponding _OSC bit and check it when parsing _CPC objects. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/acpi/bus.c | 18 ++++++++++++++++++ drivers/acpi/cppc_acpi.c | 9 +++++++++ include/linux/acpi.h | 2 ++ 3 files changed, 29 insertions(+) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 3e58b613a2c4..9eca43d1d941 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -278,6 +278,20 @@ bool osc_sb_apei_support_acked; bool osc_pc_lpi_support_confirmed; EXPORT_SYMBOL_GPL(osc_pc_lpi_support_confirmed); =20 +/* + * ACPI 6.2 Section 6.2.11.2 'Platform-Wide OSPM Capabilities': + * Starting with ACPI Specification 6.2, all _CPC registers can be in + * PCC, System Memory, System IO, or Functional Fixed Hardware address + * spaces. OSPM support for this more flexible register space scheme is + * indicated by the =E2=80=9CFlexible Address Space for CPPC Registers= =E2=80=9D _OSC bit. + * + * Otherwise (cf ACPI 6.1, s8.4.7.1.1.X), _CPC registers must be in: + * - PCC or Functional Fixed Hardware address space if defined + * - SystemMemory address space (NULL register) if not defined + */ +bool osc_cpc_flexible_adr_space_confirmed; +EXPORT_SYMBOL_GPL(osc_cpc_flexible_adr_space_confirmed); + /* * ACPI 6.4 Operating System Capabilities for USB. */ @@ -321,6 +335,8 @@ static void acpi_bus_osc_negotiate_platform_control(voi= d) } #endif =20 + capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPC_FLEXIBLE_ADR_SPACE; + if (IS_ENABLED(CONFIG_SCHED_MC_PRIO)) capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPC_DIVERSE_HIGH_SUPPORT; =20 @@ -366,6 +382,8 @@ static void acpi_bus_osc_negotiate_platform_control(voi= d) capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_PCLPI_SUPPORT; osc_sb_native_usb4_support_confirmed =3D capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_NATIVE_USB4_SUPPORT; + osc_cpc_flexible_adr_space_confirmed =3D + capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPC_FLEXIBLE_ADR_SPACE; } =20 kfree(context.ret.pointer); diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 34576ab0e2e1..840223c12540 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -746,6 +746,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *p= r) if (gas_t->address) { void __iomem *addr; =20 + if (!osc_cpc_flexible_adr_space_confirmed) { + pr_debug("Flexible address space capability not supported\n"); + goto out_free; + } + addr =3D ioremap(gas_t->address, gas_t->bit_width/8); if (!addr) goto out_free; @@ -768,6 +773,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *p= r) gas_t->address); goto out_free; } + if (!osc_cpc_flexible_adr_space_confirmed) { + pr_debug("Flexible address space capability not supported\n"); + goto out_free; + } } else { if (gas_t->space_id !=3D ACPI_ADR_SPACE_FIXED_HARDWARE || !cpc_ffh_sup= ported()) { /* Support only PCC, SystemMemory, SystemIO, and FFH type regs. */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d7136d13aa44..03465db16b68 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -574,6 +574,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acp= i_osc_context *context); #define OSC_SB_OSLPI_SUPPORT 0x00000100 #define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000 #define OSC_SB_GENERIC_INITIATOR_SUPPORT 0x00002000 +#define OSC_SB_CPC_FLEXIBLE_ADR_SPACE 0x00004000 #define OSC_SB_NATIVE_USB4_SUPPORT 0x00040000 #define OSC_SB_PRM_SUPPORT 0x00200000 =20 @@ -581,6 +582,7 @@ extern bool osc_sb_apei_support_acked; extern bool osc_pc_lpi_support_confirmed; extern bool osc_sb_native_usb4_support_confirmed; extern bool osc_sb_cppc_not_supported; +extern bool osc_cpc_flexible_adr_space_confirmed; =20 /* USB4 Capabilities */ #define OSC_USB_USB3_TUNNELING 0x00000001 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 EF714C433EF for ; Mon, 11 Jul 2022 09:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbiGKJf6 (ORCPT ); Mon, 11 Jul 2022 05:35:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbiGKJdJ (ORCPT ); Mon, 11 Jul 2022 05:33:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6FC87A51E; Mon, 11 Jul 2022 02:17:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 32029B80DB7; Mon, 11 Jul 2022 09:17:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73DA2C34115; Mon, 11 Jul 2022 09:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531069; bh=ystBTxczR/PAzzJhVMRn+JJ0S2FAWr2yL8B30ZNTPOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KMIyL6C4Tylj9iSVIczefyp4uZj9b82nM/hViBII/tHxGuUbPhmw5IhhSZ554p2cT Np/cd6XzgWk/g1uQZBv9gWAJhKN4NkdXkuAdcm5NKoqtqZGB8R930WzaXOs2YTbRau lWJz0/uiT0esWiL3tYT//ea+xULNwGIFCnuI3FSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre Gondois , Sudeep Holla , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 086/112] ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported Date: Mon, 11 Jul 2022 11:07:26 +0200 Message-Id: <20220711090552.012032465@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Pierre Gondois [ Upstream commit 72f2ecb7ece7c1d89758d4929d98e95d95fe7199 ] The _OSC method allows the OS and firmware to communicate about supported features/capabitlities. It also allows the OS to take control of some features. In ACPI 6.4, s6.2.11.2 Platform-Wide OSPM Capabilities, the CPPC (resp. v2) bit should be set by the OS if it 'supports controlling processor performance via the interfaces described in the _CPC object'. The OS supports CPPC and parses the _CPC object only if CONFIG_ACPI_CPPC_LIB is set. Replace the x86 specific boot_cpu_has(X86_FEATURE_HWP) dynamic check with an arch generic CONFIG_ACPI_CPPC_LIB build-time check. Note: CONFIG_X86_INTEL_PSTATE selects CONFIG_ACPI_CPPC_LIB. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/acpi/bus.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 9eca43d1d941..1fc24f4fbcb4 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -329,10 +329,11 @@ static void acpi_bus_osc_negotiate_platform_control(v= oid) #endif #ifdef CONFIG_X86 capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_GENERIC_INITIATOR_SUPPORT; - if (boot_cpu_has(X86_FEATURE_HWP)) { - capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPC_SUPPORT; - capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPCV2_SUPPORT; - } +#endif + +#ifdef CONFIG_ACPI_CPPC_LIB + capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPC_SUPPORT; + capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPCV2_SUPPORT; #endif =20 capbuf[OSC_SUPPORT_DWORD] |=3D OSC_SB_CPC_FLEXIBLE_ADR_SPACE; @@ -357,10 +358,9 @@ static void acpi_bus_osc_negotiate_platform_control(vo= id) return; } =20 -#ifdef CONFIG_X86 - if (boot_cpu_has(X86_FEATURE_HWP)) - osc_sb_cppc_not_supported =3D !(capbuf_ret[OSC_SUPPORT_DWORD] & - (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT)); +#ifdef CONFIG_ACPI_CPPC_LIB + osc_sb_cppc_not_supported =3D !(capbuf_ret[OSC_SUPPORT_DWORD] & + (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT)); #endif =20 /* --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 C8575C433EF for ; Mon, 11 Jul 2022 09:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbiGKJeB (ORCPT ); Mon, 11 Jul 2022 05:34:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232659AbiGKJdN (ORCPT ); Mon, 11 Jul 2022 05:33:13 -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 4E3F57A537; Mon, 11 Jul 2022 02:17: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 F41CBB80D2C; Mon, 11 Jul 2022 09:17:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207EAC34115; Mon, 11 Jul 2022 09:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531072; bh=RYid31WpNmRGIPa8flzGgo//b6LZ8YhVCis19SygF2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RmhvgD5EbCcN5FUdgge8GrqujycKoBvvpmDsTeeZhb4TRbSXe56V4QxCHajRSt6Jd 39vAJRandymSKYNbWTN7GpYLfT6MrBhjF5vtDqjppjN0tdx+Z558Q0y45E03/co/H9 f4f/emBKjKngHPlMISvg/w+6VhaGvZI/XIxCME9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, CUI Hao , maxim.novozhilov@gmail.com, lethe.tree@protonmail.com, garystephenwright@gmail.com, galaxyking0419@gmail.com, Mika Westerberg , Mario Limonciello , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 087/112] ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked Date: Mon, 11 Jul 2022 11:07:27 +0200 Message-Id: <20220711090552.041370592@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Mario Limonciello [ Upstream commit 7feec7430edddb87c24b0a86b08a03d0b496a755 ] Previously the kernel used to ignore whether the firmware masked CPPC or CPPCv2 and would just pretend that it worked. When support for the USB4 bit in _OSC was introduced from commit 9e1f561afb ("ACPI: Execute platform _OSC also with query bit clear") the kernel began to look at the return when the query bit was clear. This caused regressions that were misdiagnosed and attempted to be solved as part of commit 2ca8e6285250 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag""). This caused a different regression where non-Intel systems weren't able to negotiate _OSC properly. This was reverted in commit 2ca8e6285250 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag"") and attempted to be fixed by commit c42fa24b4475 ("ACPI: bus: Avoid using CPPC if not supported by firmware") but the regression still returned. These systems with the regression only load support for CPPC from an SSDT dynamically when _OSC reports CPPC v2. Avoid the problem by not letting CPPC satisfy the requirement in `acpi_cppc_processor_probe`. Reported-by: CUI Hao Reported-by: maxim.novozhilov@gmail.com Reported-by: lethe.tree@protonmail.com Reported-by: garystephenwright@gmail.com Reported-by: galaxyking0419@gmail.com Fixes: c42fa24b4475 ("ACPI: bus: Avoid using CPPC if not supported by firmw= are") Fixes: 2ca8e6285250 ("Revert "ACPI Pass the same capabilities to the _OSC r= egardless of the query flag"") Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D213023 Link: https://bugzilla.redhat.com/show_bug.cgi?id=3D2075387 Reviewed-by: Mika Westerberg Tested-by: CUI Hao Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/acpi/bus.c | 11 +++++------ drivers/acpi/cppc_acpi.c | 4 +++- include/linux/acpi.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 1fc24f4fbcb4..6c735cfa7d43 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -298,7 +298,7 @@ EXPORT_SYMBOL_GPL(osc_cpc_flexible_adr_space_confirmed); bool osc_sb_native_usb4_support_confirmed; EXPORT_SYMBOL_GPL(osc_sb_native_usb4_support_confirmed); =20 -bool osc_sb_cppc_not_supported; +bool osc_sb_cppc2_support_acked; =20 static u8 sb_uuid_str[] =3D "0811B06E-4A27-44F9-8D60-3CBBC22E7B48"; static void acpi_bus_osc_negotiate_platform_control(void) @@ -358,11 +358,6 @@ static void acpi_bus_osc_negotiate_platform_control(vo= id) return; } =20 -#ifdef CONFIG_ACPI_CPPC_LIB - osc_sb_cppc_not_supported =3D !(capbuf_ret[OSC_SUPPORT_DWORD] & - (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT)); -#endif - /* * Now run _OSC again with query flag clear and with the caps * supported by both the OS and the platform. @@ -376,6 +371,10 @@ static void acpi_bus_osc_negotiate_platform_control(vo= id) =20 capbuf_ret =3D context.ret.pointer; if (context.ret.length > OSC_SUPPORT_DWORD) { +#ifdef CONFIG_ACPI_CPPC_LIB + osc_sb_cppc2_support_acked =3D capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CP= CV2_SUPPORT; +#endif + osc_sb_apei_support_acked =3D capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT; osc_pc_lpi_support_confirmed =3D diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 840223c12540..6aff8019047b 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -666,8 +666,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *p= r) acpi_status status; int ret =3D -ENODATA; =20 - if (osc_sb_cppc_not_supported) + if (!osc_sb_cppc2_support_acked) { + pr_debug("CPPC v2 _OSC not acked\n"); return -ENODEV; + } =20 /* Parse the ACPI _CPC table for this CPU. */ status =3D acpi_evaluate_object_typed(handle, "_CPC", NULL, &output, diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 03465db16b68..cf1f770208da 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -581,7 +581,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acp= i_osc_context *context); extern bool osc_sb_apei_support_acked; extern bool osc_pc_lpi_support_confirmed; extern bool osc_sb_native_usb4_support_confirmed; -extern bool osc_sb_cppc_not_supported; +extern bool osc_sb_cppc2_support_acked; extern bool osc_cpc_flexible_adr_space_confirmed; =20 /* USB4 Capabilities */ --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 7A274C433EF for ; Mon, 11 Jul 2022 09:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232764AbiGKJeE (ORCPT ); Mon, 11 Jul 2022 05:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232792AbiGKJdQ (ORCPT ); Mon, 11 Jul 2022 05:33:16 -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 C3FDA7AB14; Mon, 11 Jul 2022 02:17:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 281DB612B8; Mon, 11 Jul 2022 09:17:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C8BDC36AE7; Mon, 11 Jul 2022 09:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531075; bh=WewbxobdXy3VRk5+aYIVvs3YD7Yl6NReJmWuY9HmJdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1R6MsxSBbw/cOsTCQhdHVgNM796dT6yzN/wZHAzGIyrmPEjUqQSEh0VlBoh3HL9o7 EqzQoUN+tREajs49jdKJOLfzzlIgHu7WZRcg4Gd8tc7H39r0BKVZQ3wvxAZHvrLhT/ hUXOj9s90beQWOGLemkXRfn42zMAgS0a8cYTscs4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Perry Yuan , Mario Limonciello , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 088/112] ACPI: CPPC: Dont require _OSC if X86_FEATURE_CPPC is supported Date: Mon, 11 Jul 2022 11:07:28 +0200 Message-Id: <20220711090552.069300240@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Mario Limonciello [ Upstream commit 8b356e536e69f3a4d6778ae9f0858a1beadabb1f ] commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") added support for claiming to support CPPC in _OSC on non-Intel platforms. This unfortunately caused a regression on a vartiety of AMD platforms in the field because a number of AMD platforms don't set the `_OSC` bit 5 or 6 to indicate CPPC or CPPC v2 support. As these AMD platforms already claim CPPC support via a dedicated MSR from `X86_FEATURE_CPPC`, use this enable this feature rather than requiring the `_OSC` on platforms with a dedicated MSR. If there is additional breakage on the shared memory designs also missing this _OSC, additional follow up changes may be needed. Fixes: 72f2ecb7ece7 ("Set CPPC _OSC bits for all and when CPPC_LIB is suppo= rted") Reported-by: Perry Yuan Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- arch/x86/kernel/acpi/cppc.c | 10 ++++++++++ drivers/acpi/cppc_acpi.c | 16 +++++++++++++++- include/acpi/cppc_acpi.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index df1644d9b3b6..3677df836e91 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -11,6 +11,16 @@ =20 /* Refer to drivers/acpi/cppc_acpi.c for the description of functions */ =20 +bool cpc_supported_by_cpu(void) +{ + switch (boot_cpu_data.x86_vendor) { + case X86_VENDOR_AMD: + case X86_VENDOR_HYGON: + return boot_cpu_has(X86_FEATURE_CPPC); + } + return false; +} + bool cpc_ffh_supported(void) { return true; diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 6aff8019047b..57ca7aa0e169 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -559,6 +559,19 @@ bool __weak cpc_ffh_supported(void) return false; } =20 +/** + * cpc_supported_by_cpu() - check if CPPC is supported by CPU + * + * Check if the architectural support for CPPC is present even + * if the _OSC hasn't prescribed it + * + * Return: true for supported, false for not supported + */ +bool __weak cpc_supported_by_cpu(void) +{ + return false; +} + /** * pcc_data_alloc() - Allocate the pcc_data memory for pcc subspace * @@ -668,7 +681,8 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) =20 if (!osc_sb_cppc2_support_acked) { pr_debug("CPPC v2 _OSC not acked\n"); - return -ENODEV; + if (!cpc_supported_by_cpu()) + return -ENODEV; } =20 /* Parse the ACPI _CPC table for this CPU. */ diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 92b7ea8d8f5e..181907349b49 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -144,6 +144,7 @@ extern bool acpi_cpc_valid(void); extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_dat= a); extern unsigned int cppc_get_transition_latency(int cpu); extern bool cpc_ffh_supported(void); +extern bool cpc_supported_by_cpu(void); extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val); extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val); #else /* !CONFIG_ACPI_CPPC_LIB */ --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 D6747CCA47B for ; Mon, 11 Jul 2022 09:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231451AbiGKJet (ORCPT ); Mon, 11 Jul 2022 05:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232887AbiGKJdX (ORCPT ); Mon, 11 Jul 2022 05:33:23 -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 5EB0246D88; Mon, 11 Jul 2022 02:18:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9B827B80DB7; Mon, 11 Jul 2022 09:17:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D5EC34115; Mon, 11 Jul 2022 09:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531078; bh=3C2xL54NrtXzg4JDawT+H0GFUdMSUjJmyWE0vulAu6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IvphS3EUIAE3yQDDBIbnfHxGRSSr/shh21GRVaZ+IkDtn1tbPNpzq+lOMC6FwyeoJ IURnUGltS68ospz50SIRIEGWudoSFWjrGJqSg80YckYSeAE+86FnEKD2uOwcd+/ttb 07/PvrvRXpPj961I4IaR9JumJ8Sln7OOHh9fR1Z0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vlad Buslov , Saeed Mahameed , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 089/112] net/mlx5e: Fix matchall police parameters validation Date: Mon, 11 Jul 2022 11:07:29 +0200 Message-Id: <20220711090552.097643334@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vlad Buslov [ Upstream commit 4d1e07d83ccc87f210e5b852b0a5ea812a2f191c ] Referenced commit prepared the code for upcoming extension that allows mlx5 to offload police action attached to flower classifier. However, with regard to existing matchall classifier offload validation should be reversed as FLOW_ACTION_CONTINUE is the only supported notexceed police action type. Fix the problem by allowing FLOW_ACTION_CONTINUE for police action and extend scan_tc_matchall_fdb_actions() to only allow such actions with matchall classifier. Fixes: d97b4b105ce7 ("flow_offload: reject offload for all drivers with inv= alid police parameters") Signed-off-by: Vlad Buslov Acked-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/= ethernet/mellanox/mlx5/core/en_tc.c index ec2dfecd7f0f..c01651047448 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -4503,13 +4503,6 @@ static int mlx5e_policer_validate(const struct flow_= action *action, return -EOPNOTSUPP; } =20 - if (act->police.notexceed.act_id !=3D FLOW_ACTION_PIPE && - act->police.notexceed.act_id !=3D FLOW_ACTION_ACCEPT) { - NL_SET_ERR_MSG_MOD(extack, - "Offload not supported when conform action is not pipe or ok"); - return -EOPNOTSUPP; - } - if (act->police.notexceed.act_id =3D=3D FLOW_ACTION_ACCEPT && !flow_action_is_last_entry(action, act)) { NL_SET_ERR_MSG_MOD(extack, @@ -4560,6 +4553,12 @@ static int scan_tc_matchall_fdb_actions(struct mlx5e= _priv *priv, flow_action_for_each(i, act, flow_action) { switch (act->id) { case FLOW_ACTION_POLICE: + if (act->police.notexceed.act_id !=3D FLOW_ACTION_CONTINUE) { + NL_SET_ERR_MSG_MOD(extack, + "Offload not supported when conform action is not continue"); + return -EOPNOTSUPP; + } + err =3D mlx5e_policer_validate(flow_action, act, extack); if (err) return err; --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 211A1C43334 for ; Mon, 11 Jul 2022 09:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232779AbiGKJfF (ORCPT ); Mon, 11 Jul 2022 05:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232902AbiGKJdY (ORCPT ); Mon, 11 Jul 2022 05:33: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 AD5BE7AC0B; Mon, 11 Jul 2022 02:18:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26DE2B80E74; Mon, 11 Jul 2022 09:18:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90EE8C34115; Mon, 11 Jul 2022 09:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531080; bh=XpgknY7GZkaapSMyf+HiPgrIBtIyDVXS7/RWFf/2jKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGvbGKaxMAGNSCVJiKHJAsXwRM3LhjOvHNw0H1s5iCDufrmfMJvB4tE/Qiofg51xO bfRI1m9Z2OK52aQGMLQl0AZYsbqmWtpFE3TF2VxGOAxgL+KeNwNX2pder2zycy+313 NlAo0sz+8d3mSepSXhC3vAWbqTrNJDZlH0YzANZk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Mat Martineau , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 090/112] mptcp: Avoid acquiring PM lock for subflow priority changes Date: Mon, 11 Jul 2022 11:07:30 +0200 Message-Id: <20220711090552.125703382@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Mat Martineau [ Upstream commit c21b50d5912b68c4414c60ef5b30416c103f9fd8 ] The in-kernel path manager code for changing subflow flags acquired both the msk socket lock and the PM lock when possibly changing the "backup" and "fullmesh" flags. mptcp_pm_nl_mp_prio_send_ack() does not access anything protected by the PM lock, and it must release and reacquire the PM lock. By pushing the PM lock to where it is needed in mptcp_pm_nl_fullmesh(), the lock is only acquired when the fullmesh flag is changed and the backup flag code no longer has to release and reacquire the PM lock. The change in locking context requires the MIB update to be modified - move that to a better location instead. This change also makes it possible to call mptcp_pm_nl_mp_prio_send_ack() for the userspace PM commands without manipulating the in-kernel PM lock. Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/mptcp/options.c | 3 +++ net/mptcp/pm_netlink.c | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index b548cec86c9d..48e34b81fa1c 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -1538,6 +1538,9 @@ void mptcp_write_options(__be32 *ptr, const struct tc= p_sock *tp, *ptr++ =3D mptcp_option(MPTCPOPT_MP_PRIO, TCPOLEN_MPTCP_PRIO, opts->backup, TCPOPT_NOP); + + MPTCP_INC_STATS(sock_net((const struct sock *)tp), + MPTCP_MIB_MPPRIOTX); } =20 mp_capable_done: diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index e3dcc5501579..88077ea02ed3 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -720,7 +720,6 @@ static int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_so= ck *msk, =20 mptcp_for_each_subflow(msk, subflow) { struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); - struct sock *sk =3D (struct sock *)msk; struct mptcp_addr_info local; =20 local_address((struct sock_common *)ssk, &local); @@ -732,12 +731,9 @@ static int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_s= ock *msk, subflow->backup =3D bkup; subflow->send_mp_prio =3D 1; subflow->request_bkup =3D bkup; - __MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPPRIOTX); =20 - spin_unlock_bh(&msk->pm.lock); pr_debug("send ack for mp_prio"); mptcp_subflow_send_ack(ssk); - spin_lock_bh(&msk->pm.lock); =20 return 0; } @@ -1769,8 +1765,10 @@ static void mptcp_pm_nl_fullmesh(struct mptcp_sock *= msk, =20 list.ids[list.nr++] =3D addr->id; =20 + spin_lock_bh(&msk->pm.lock); mptcp_pm_nl_rm_subflow_received(msk, &list); mptcp_pm_create_subflow_or_signal_addr(msk); + spin_unlock_bh(&msk->pm.lock); } =20 static int mptcp_nl_set_flags(struct net *net, @@ -1788,12 +1786,10 @@ static int mptcp_nl_set_flags(struct net *net, goto next; =20 lock_sock(sk); - spin_lock_bh(&msk->pm.lock); if (changed & MPTCP_PM_ADDR_FLAG_BACKUP) ret =3D mptcp_pm_nl_mp_prio_send_ack(msk, addr, bkup); if (changed & MPTCP_PM_ADDR_FLAG_FULLMESH) mptcp_pm_nl_fullmesh(msk, addr); - spin_unlock_bh(&msk->pm.lock); release_sock(sk); =20 next: --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 D2665C43334 for ; Mon, 11 Jul 2022 09:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbiGKJfN (ORCPT ); Mon, 11 Jul 2022 05:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232915AbiGKJd0 (ORCPT ); Mon, 11 Jul 2022 05:33:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D5C21055E; Mon, 11 Jul 2022 02:18:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DC663B80E76; Mon, 11 Jul 2022 09:18:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49208C34115; Mon, 11 Jul 2022 09:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531083; bh=eflLSHmdQJmlx3Jr8ZLDE+HE6JQPzKLnL+kk1obFACA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oyxAmWIBOYeRgAWd7dNQpGXMr4aNRnrIrLDdbkH5G6Q1qIqCa72IQgQgfMArZRQqj LigVBTUFYsXA31dInYjhyUnnz9zry3h0qEwd/usLbJNonasfjEjdYBOzUb9zjQvMNT rWKyY2VTB9svAIGYxEyBNg3JlUUOgmQscZEMAOcw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Mat Martineau , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 091/112] mptcp: Acquire the subflow socket lock before modifying MP_PRIO flags Date: Mon, 11 Jul 2022 11:07:31 +0200 Message-Id: <20220711090552.154216495@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Mat Martineau [ Upstream commit a657430260e5437df16004c8c317821d946b5ead ] When setting up a subflow's flags for sending MP_PRIO MPTCP options, the subflow socket lock was not held while reading and modifying several struct members that are also read and modified in mptcp_write_options(). Acquire the subflow socket lock earlier and send the MP_PRIO ACK with that lock already acquired. Add a new variant of the mptcp_subflow_send_ack() helper to use with the subflow lock held. Fixes: 067065422fcd ("mptcp: add the outgoing MP_PRIO support") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/mptcp/pm_netlink.c | 5 ++++- net/mptcp/protocol.c | 9 +++++++-- net/mptcp/protocol.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 88077ea02ed3..3384569f73b8 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -721,11 +721,13 @@ static int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_= sock *msk, mptcp_for_each_subflow(msk, subflow) { struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); struct mptcp_addr_info local; + bool slow; =20 local_address((struct sock_common *)ssk, &local); if (!addresses_equal(&local, addr, addr->port)) continue; =20 + slow =3D lock_sock_fast(ssk); if (subflow->backup !=3D bkup) msk->last_snd =3D NULL; subflow->backup =3D bkup; @@ -733,7 +735,8 @@ static int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_so= ck *msk, subflow->request_bkup =3D bkup; =20 pr_debug("send ack for mp_prio"); - mptcp_subflow_send_ack(ssk); + __mptcp_subflow_send_ack(ssk); + unlock_sock_fast(ssk, slow); =20 return 0; } diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 713077eef04a..b0fb1fc0bd4a 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -506,13 +506,18 @@ static bool tcp_can_send_ack(const struct sock *ssk) (TCPF_SYN_SENT | TCPF_SYN_RECV | TCPF_TIME_WAIT | TCPF_CLOSE | TCP= F_LISTEN)); } =20 +void __mptcp_subflow_send_ack(struct sock *ssk) +{ + if (tcp_can_send_ack(ssk)) + tcp_send_ack(ssk); +} + void mptcp_subflow_send_ack(struct sock *ssk) { bool slow; =20 slow =3D lock_sock_fast(ssk); - if (tcp_can_send_ack(ssk)) - tcp_send_ack(ssk); + __mptcp_subflow_send_ack(ssk); unlock_sock_fast(ssk, slow); } =20 diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 2aab5aff6bcd..ad36a05aa67d 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -584,6 +584,7 @@ void __init mptcp_subflow_init(void); void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how); void mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_subflow_context *subflow); +void __mptcp_subflow_send_ack(struct sock *ssk); void mptcp_subflow_send_ack(struct sock *ssk); void mptcp_subflow_reset(struct sock *ssk); void mptcp_subflow_queue_clean(struct sock *ssk); --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 E5E87C43334 for ; Mon, 11 Jul 2022 09:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232791AbiGKJfS (ORCPT ); Mon, 11 Jul 2022 05:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231827AbiGKJd1 (ORCPT ); Mon, 11 Jul 2022 05:33:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6FD4A83E; Mon, 11 Jul 2022 02:18:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E312E6122D; Mon, 11 Jul 2022 09:18:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F20C7C34115; Mon, 11 Jul 2022 09:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531086; bh=uA9peSemjhDCKbrL2L1momVRELa96iCGC0cbyN1g4SQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ft4vUFA4bcryzFY9KN5XGhuW8F4js4wX87J+cjH5kjfNuR31PJlVlLOOEicjL6ebf fsPpf+pz4Ei1rJ0CqyA1YklmheRQsoPRnHpKyGf5bG7OaI6as8U+QH1Qhx/W8U9cng H2YBYJLULVbobpvmaKY4jIJsMUqs9Id6a6DzT1oQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Mat Martineau , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 092/112] mptcp: fix local endpoint accounting Date: Mon, 11 Jul 2022 11:07:32 +0200 Message-Id: <20220711090552.182306252@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Paolo Abeni [ Upstream commit 843b5e75efff04db34fcf9856de53c9e415530a2 ] In mptcp_pm_nl_rm_addr_or_subflow() we always mark as available the id corresponding to the just removed address. The used bitmap actually tracks only the local IDs: we must restrict the operation when a (local) subflow is removed. Fixes: a88c9e496937 ("mptcp: do not block subflows creation on errors") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/mptcp/pm_netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 3384569f73b8..78345278e4a7 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -793,7 +793,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp= _sock *msk, removed =3D true; __MPTCP_INC_STATS(sock_net(sk), rm_type); } - __set_bit(rm_list->ids[i], msk->pm.id_avail_bitmap); + if (rm_type =3D=3D MPTCP_MIB_RMSUBFLOW) + __set_bit(rm_list->ids[i], msk->pm.id_avail_bitmap); if (!removed) continue; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 A9991C43334 for ; Mon, 11 Jul 2022 09:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232809AbiGKJfX (ORCPT ); Mon, 11 Jul 2022 05:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbiGKJdj (ORCPT ); Mon, 11 Jul 2022 05:33:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EECF64A805; Mon, 11 Jul 2022 02:18: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 F019861211; Mon, 11 Jul 2022 09:18:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD7B2C34115; Mon, 11 Jul 2022 09:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531089; bh=TpOOyILXwNDLE/XBw7fTsT1Ty6fmSAT2o3InDr9Alx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqtGRged3iFM5kZJ1FohNj81mpO7rMjg4T8PLZCBNKayhiUiFWyeFIIpAQ2HfhwtE XBDZN5oPhJu0ccjKrtCL671HDV6025N96tm7BgSrFl+z87XkKLaRwJKyBZz2GhfndE 9CMpXIdCT7kikXyGVxRB2Qgnxb/z0xERx8gjFmus= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Erhard F." , Heiner Kallweit , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.18 093/112] r8169: fix accessing unset transport header Date: Mon, 11 Jul 2022 11:07:33 +0200 Message-Id: <20220711090552.210907375@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Heiner Kallweit [ Upstream commit faa4e04e5e140a6d02260289a8fba8fd8d7a3003 ] 66e4c8d95008 ("net: warn if transport header was not set") added a check that triggers a warning in r8169, see [0]. The commit referenced in the Fixes tag refers to the change from which the patch applies cleanly, there's nothing wrong with this commit. It seems the actual issue (not bug, because the warning is harmless here) was introduced with bdfa4ed68187 ("r8169: use Giant Send"). [0] https://bugzilla.kernel.org/show_bug.cgi?id=3D216157 Fixes: 8d520b4de3ed ("r8169: work around RTL8125 UDP hw bug") Reported-by: Erhard F. Tested-by: Erhard F. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/1b2c2b29-3dc0-f7b6-5694-97ec526d51a0@gmail.= com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/net/ethernet/realtek/r8169_main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethern= et/realtek/r8169_main.c index 33f5c5698ccb..642e435c7031 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4190,7 +4190,6 @@ static void rtl8169_tso_csum_v1(struct sk_buff *skb, = u32 *opts) static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, struct sk_buff *skb, u32 *opts) { - u32 transport_offset =3D (u32)skb_transport_offset(skb); struct skb_shared_info *shinfo =3D skb_shinfo(skb); u32 mss =3D shinfo->gso_size; =20 @@ -4207,7 +4206,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_privat= e *tp, WARN_ON_ONCE(1); } =20 - opts[0] |=3D transport_offset << GTTCPHO_SHIFT; + opts[0] |=3D skb_transport_offset(skb) << GTTCPHO_SHIFT; opts[1] |=3D mss << TD1_MSS_SHIFT; } else if (skb->ip_summed =3D=3D CHECKSUM_PARTIAL) { u8 ip_protocol; @@ -4235,7 +4234,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_privat= e *tp, else WARN_ON_ONCE(1); =20 - opts[1] |=3D transport_offset << TCPHO_SHIFT; + opts[1] |=3D skb_transport_offset(skb) << TCPHO_SHIFT; } else { unsigned int padto =3D rtl_quirk_packet_padto(tp, skb); =20 @@ -4402,14 +4401,13 @@ static netdev_features_t rtl8169_features_check(str= uct sk_buff *skb, struct net_device *dev, netdev_features_t features) { - int transport_offset =3D skb_transport_offset(skb); struct rtl8169_private *tp =3D netdev_priv(dev); =20 if (skb_is_gso(skb)) { if (tp->mac_version =3D=3D RTL_GIGA_MAC_VER_34) features =3D rtl8168evl_fix_tso(skb, features); =20 - if (transport_offset > GTTCPHO_MAX && + if (skb_transport_offset(skb) > GTTCPHO_MAX && rtl_chip_supports_csum_v2(tp)) features &=3D ~NETIF_F_ALL_TSO; } else if (skb->ip_summed =3D=3D CHECKSUM_PARTIAL) { @@ -4420,7 +4418,7 @@ static netdev_features_t rtl8169_features_check(struc= t sk_buff *skb, if (rtl_quirk_packet_padto(tp, skb)) features &=3D ~NETIF_F_CSUM_MASK; =20 - if (transport_offset > TCPHO_MAX && + if (skb_transport_offset(skb) > TCPHO_MAX && rtl_chip_supports_csum_v2(tp)) features &=3D ~NETIF_F_CSUM_MASK; } --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 62CAFC43334 for ; Mon, 11 Jul 2022 09:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbiGKJf0 (ORCPT ); Mon, 11 Jul 2022 05:35:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232775AbiGKJeI (ORCPT ); Mon, 11 Jul 2022 05:34:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B35D37AC39; Mon, 11 Jul 2022 02:18:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BE89B612A4; Mon, 11 Jul 2022 09:18:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE434C34115; Mon, 11 Jul 2022 09:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531092; bh=7eKPgAvwlYCxbUAwj8QUdkVCmwJ5akFGqrV1jD3Hl4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Sit3gZEdOJec7VAT/lT8d/72LKafVkh7ilvzEdxARoKms4OrC/gZUlGmIssfnV8J 8pInildLTayOfOZpb1XckHNSEyp7CkjiAFSddcjRA8ALrTMRBkrm0FhqSgf0FNadsc fv3yaiPPRQBRRPhXyvwVSVKKWA/N2ER1TKdWk2qM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Satish Nagireddy , Lars-Peter Clausen , Michal Simek , Wolfram Sang , Sasha Levin Subject: [PATCH 5.18 094/112] i2c: cadence: Unregister the clk notifier in error path Date: Mon, 11 Jul 2022 11:07:34 +0200 Message-Id: <20220711090552.238440866@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Satish Nagireddy [ Upstream commit 3501f0c663063513ad604fb1b3f06af637d3396d ] This patch ensures that the clock notifier is unregistered when driver probe is returning error. Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller") Signed-off-by: Satish Nagireddy Tested-by: Lars-Peter Clausen Reviewed-by: Michal Simek Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/i2c/busses/i2c-cadence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cade= nce.c index b4c1ad19cdae..3d6f8ee355bf 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -1338,6 +1338,7 @@ static int cdns_i2c_probe(struct platform_device *pde= v) return 0; =20 err_clk_dis: + clk_notifier_unregister(id->clk, &id->clk_rate_change_nb); clk_disable_unprepare(id->clk); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 94A04C433EF for ; Mon, 11 Jul 2022 09:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbiGKJfi (ORCPT ); Mon, 11 Jul 2022 05:35:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232921AbiGKJeQ (ORCPT ); Mon, 11 Jul 2022 05:34:16 -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 135DC7B78A; Mon, 11 Jul 2022 02:18: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 5D9036122D; Mon, 11 Jul 2022 09:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 630D7C34115; Mon, 11 Jul 2022 09:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531097; bh=Uai6T07U7SXLqWHnyoXLrxVxloyCBiKlazL3N1+IVY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBeS8n4U8gNKvsr0+QgWOTu9Jhuhvm8ExUTuh7NenWEHeviQeDr9pgxAlvn9mqwD8 DOSo9lFcFeLmYJ07EuQO56lRuO6RzT7juBTgFRmdZE7MFOKhLyQAEfMuZnsJumCe2Y buJorkG124PBQxDcGVQ631x9/ZSEaNbVCaPxqrnE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Petr Machata , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 095/112] net/sched: act_api: Add extack to offload_act_setup() callback Date: Mon, 11 Jul 2022 11:07:35 +0200 Message-Id: <20220711090552.267058888@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Ido Schimmel [ Upstream commit c2ccf84ecb715bb81dc7f51e69d680a95bf055ae ] The callback is used by various actions to populate the flow action structure prior to offload. Pass extack to this callback so that the various actions will be able to report accurate error messages to user space. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- include/net/act_api.h | 3 ++- include/net/pkt_cls.h | 6 ++++-- net/sched/act_api.c | 4 ++-- net/sched/act_csum.c | 3 ++- net/sched/act_ct.c | 3 ++- net/sched/act_gact.c | 3 ++- net/sched/act_gate.c | 3 ++- net/sched/act_mirred.c | 3 ++- net/sched/act_mpls.c | 3 ++- net/sched/act_pedit.c | 3 ++- net/sched/act_police.c | 3 ++- net/sched/act_sample.c | 3 ++- net/sched/act_skbedit.c | 3 ++- net/sched/act_tunnel_key.c | 3 ++- net/sched/act_vlan.c | 3 ++- net/sched/cls_api.c | 16 ++++++++++------ net/sched/cls_flower.c | 6 ++++-- net/sched/cls_matchall.c | 6 ++++-- 18 files changed, 50 insertions(+), 27 deletions(-) diff --git a/include/net/act_api.h b/include/net/act_api.h index 3049cb69c025..9cf6870b526e 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -134,7 +134,8 @@ struct tc_action_ops { (*get_psample_group)(const struct tc_action *a, tc_action_priv_destructor *destructor); int (*offload_act_setup)(struct tc_action *act, void *entry_data, - u32 *index_inc, bool bind); + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack); }; =20 struct tc_action_net { diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index a3b57a93228a..8cf001aed858 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -547,10 +547,12 @@ tcf_match_indev(struct sk_buff *skb, int ifindex) } =20 int tc_setup_offload_action(struct flow_action *flow_action, - const struct tcf_exts *exts); + const struct tcf_exts *exts, + struct netlink_ext_ack *extack); void tc_cleanup_offload_action(struct flow_action *flow_action); int tc_setup_action(struct flow_action *flow_action, - struct tc_action *actions[]); + struct tc_action *actions[], + struct netlink_ext_ack *extack); =20 int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type, void *type_data, bool err_stop, bool rtnl_held); diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 6fa9e7b1406a..817065aa2833 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -195,7 +195,7 @@ static int offload_action_init(struct flow_offload_acti= on *fl_action, if (act->ops->offload_act_setup) { spin_lock_bh(&act->tcfa_lock); err =3D act->ops->offload_act_setup(act, fl_action, NULL, - false); + false, extack); spin_unlock_bh(&act->tcfa_lock); return err; } @@ -271,7 +271,7 @@ static int tcf_action_offload_add_ex(struct tc_action *= action, if (err) goto fl_err; =20 - err =3D tc_setup_action(&fl_action->action, actions); + err =3D tc_setup_action(&fl_action->action, actions, extack); if (err) { NL_SET_ERR_MSG_MOD(extack, "Failed to setup tc actions for offload"); diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index e0f515b774ca..22847ee009ef 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -696,7 +696,8 @@ static size_t tcf_csum_get_fill_size(const struct tc_ac= tion *act) } =20 static int tcf_csum_offload_act_setup(struct tc_action *act, void *entry_d= ata, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index b3ca837fd4e8..e013253b10d1 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -1584,7 +1584,8 @@ static void tcf_stats_update(struct tc_action *a, u64= bytes, u64 packets, } =20 static int tcf_ct_offload_act_setup(struct tc_action *act, void *entry_dat= a, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index bde6a6c01e64..db84a0473cc1 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c @@ -253,7 +253,8 @@ static size_t tcf_gact_get_fill_size(const struct tc_ac= tion *act) } =20 static int tcf_gact_offload_act_setup(struct tc_action *act, void *entry_d= ata, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c index d56e73843a4b..fd5155274733 100644 --- a/net/sched/act_gate.c +++ b/net/sched/act_gate.c @@ -619,7 +619,8 @@ static int tcf_gate_get_entries(struct flow_action_entr= y *entry, } =20 static int tcf_gate_offload_act_setup(struct tc_action *act, void *entry_d= ata, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { int err; =20 diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 39acd1d18609..70a6a4447e6b 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -460,7 +460,8 @@ static void tcf_offload_mirred_get_dev(struct flow_acti= on_entry *entry, } =20 static int tcf_mirred_offload_act_setup(struct tc_action *act, void *entry= _data, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index b9ff3459fdab..23fcfa5605df 100644 --- a/net/sched/act_mpls.c +++ b/net/sched/act_mpls.c @@ -385,7 +385,8 @@ static int tcf_mpls_search(struct net *net, struct tc_a= ction **a, u32 index) } =20 static int tcf_mpls_offload_act_setup(struct tc_action *act, void *entry_d= ata, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 211c757bfc3c..8fccc914f464 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -510,7 +510,8 @@ static int tcf_pedit_search(struct net *net, struct tc_= action **a, u32 index) } =20 static int tcf_pedit_offload_act_setup(struct tc_action *act, void *entry_= data, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_police.c b/net/sched/act_police.c index f4d917705263..77c17e9b46d1 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -442,7 +442,8 @@ static int tcf_police_act_to_flow_act(int tc_act, u32 *= extval) } =20 static int tcf_police_offload_act_setup(struct tc_action *act, void *entry= _data, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c index 9a22cdda6bbd..2f7f5e44d28c 100644 --- a/net/sched/act_sample.c +++ b/net/sched/act_sample.c @@ -291,7 +291,8 @@ static void tcf_offload_sample_get_group(struct flow_ac= tion_entry *entry, } =20 static int tcf_sample_offload_act_setup(struct tc_action *act, void *entry= _data, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index ceba11b198bb..8cd8e506c9c9 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -328,7 +328,8 @@ static size_t tcf_skbedit_get_fill_size(const struct tc= _action *act) } =20 static int tcf_skbedit_offload_act_setup(struct tc_action *act, void *entr= y_data, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c index 23aba03d26a8..3c6f40478c81 100644 --- a/net/sched/act_tunnel_key.c +++ b/net/sched/act_tunnel_key.c @@ -808,7 +808,8 @@ static int tcf_tunnel_encap_get_tunnel(struct flow_acti= on_entry *entry, static int tcf_tunnel_key_offload_act_setup(struct tc_action *act, void *entry_data, u32 *index_inc, - bool bind) + bool bind, + struct netlink_ext_ack *extack) { int err; =20 diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 883454c4f921..8c89bce99cbd 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -369,7 +369,8 @@ static size_t tcf_vlan_get_fill_size(const struct tc_ac= tion *act) } =20 static int tcf_vlan_offload_act_setup(struct tc_action *act, void *entry_d= ata, - u32 *index_inc, bool bind) + u32 *index_inc, bool bind, + struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry =3D entry_data; diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index f0699f39afdb..2d4dc1468a9a 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3513,11 +3513,13 @@ EXPORT_SYMBOL(tc_cleanup_offload_action); =20 static int tc_setup_offload_act(struct tc_action *act, struct flow_action_entry *entry, - u32 *index_inc) + u32 *index_inc, + struct netlink_ext_ack *extack) { #ifdef CONFIG_NET_CLS_ACT if (act->ops->offload_act_setup) - return act->ops->offload_act_setup(act, entry, index_inc, true); + return act->ops->offload_act_setup(act, entry, index_inc, true, + extack); else return -EOPNOTSUPP; #else @@ -3526,7 +3528,8 @@ static int tc_setup_offload_act(struct tc_action *act, } =20 int tc_setup_action(struct flow_action *flow_action, - struct tc_action *actions[]) + struct tc_action *actions[], + struct netlink_ext_ack *extack) { int i, j, index, err =3D 0; struct tc_action *act; @@ -3551,7 +3554,7 @@ int tc_setup_action(struct flow_action *flow_action, entry->hw_stats =3D tc_act_hw_stats(act->hw_stats); entry->hw_index =3D act->tcfa_index; index =3D 0; - err =3D tc_setup_offload_act(act, entry, &index); + err =3D tc_setup_offload_act(act, entry, &index, extack); if (!err) j +=3D index; else @@ -3570,13 +3573,14 @@ int tc_setup_action(struct flow_action *flow_action, } =20 int tc_setup_offload_action(struct flow_action *flow_action, - const struct tcf_exts *exts) + const struct tcf_exts *exts, + struct netlink_ext_ack *extack) { #ifdef CONFIG_NET_CLS_ACT if (!exts) return 0; =20 - return tc_setup_action(flow_action, exts->actions); + return tc_setup_action(flow_action, exts->actions, extack); #else return 0; #endif diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index ed5e6f08e74a..cddacf49f9e8 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -464,7 +464,8 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, cls_flower.rule->match.key =3D &f->mkey; cls_flower.classid =3D f->res.classid; =20 - err =3D tc_setup_offload_action(&cls_flower.rule->action, &f->exts); + err =3D tc_setup_offload_action(&cls_flower.rule->action, &f->exts, + cls_flower.common.extack); if (err) { kfree(cls_flower.rule); if (skip_sw) { @@ -2362,7 +2363,8 @@ static int fl_reoffload(struct tcf_proto *tp, bool ad= d, flow_setup_cb_t *cb, cls_flower.rule->match.mask =3D &f->mask->key; cls_flower.rule->match.key =3D &f->mkey; =20 - err =3D tc_setup_offload_action(&cls_flower.rule->action, &f->exts); + err =3D tc_setup_offload_action(&cls_flower.rule->action, &f->exts, + cls_flower.common.extack); if (err) { kfree(cls_flower.rule); if (tc_skip_sw(f->flags)) { diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index ca5670fd5228..df80c6b185a0 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -97,7 +97,8 @@ static int mall_replace_hw_filter(struct tcf_proto *tp, cls_mall.command =3D TC_CLSMATCHALL_REPLACE; cls_mall.cookie =3D cookie; =20 - err =3D tc_setup_offload_action(&cls_mall.rule->action, &head->exts); + err =3D tc_setup_offload_action(&cls_mall.rule->action, &head->exts, + cls_mall.common.extack); if (err) { kfree(cls_mall.rule); mall_destroy_hw_filter(tp, head, cookie, NULL); @@ -302,7 +303,8 @@ static int mall_reoffload(struct tcf_proto *tp, bool ad= d, flow_setup_cb_t *cb, TC_CLSMATCHALL_REPLACE : TC_CLSMATCHALL_DESTROY; cls_mall.cookie =3D (unsigned long)head; =20 - err =3D tc_setup_offload_action(&cls_mall.rule->action, &head->exts); + err =3D tc_setup_offload_action(&cls_mall.rule->action, &head->exts, + cls_mall.common.extack); if (err) { kfree(cls_mall.rule); if (add && tc_skip_sw(head->flags)) { --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 6C105C433EF for ; Mon, 11 Jul 2022 09:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbiGKJfp (ORCPT ); Mon, 11 Jul 2022 05:35:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232956AbiGKJeV (ORCPT ); Mon, 11 Jul 2022 05:34:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F0AE4AD52; Mon, 11 Jul 2022 02:18: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 ams.source.kernel.org (Postfix) with ESMTPS id BDDD7B80E6D; Mon, 11 Jul 2022 09:18:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E245C34115; Mon, 11 Jul 2022 09:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531100; bh=x+n02lqPWItvAjdGSPkEYYyeV0aQ4CySBYUYedRQtTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwJwEobcxbDXDcJg70puIIN0VrNVaakxJmk/qmfaykGgMStWNZvat+cahroApA8AG wimkABs/SlWYFyoMhbAaQFzLZ9jdXg1YCaLT9m0E3pcEyH+D+h++SdnaafsyNjxWmn IIPf9l3x4kDME0Q+8/77zMflycXoyj9w1PmLGs5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Petr Machata , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 096/112] net/sched: act_police: Add extack messages for offload failure Date: Mon, 11 Jul 2022 11:07:36 +0200 Message-Id: <20220711090552.294762568@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Ido Schimmel [ Upstream commit b50e462bc22df4488ec04d85606646e3db5952b8 ] For better error reporting to user space, add extack messages when police action offload fails. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw actio= n police rate 100Mbit burst 10000 Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-182 [000] b..1. 21.592969: netlink_extack: msg=3Dact_polic= e: Offload not supported when conform/exceed action is "reclassify" tc-182 [000] ..... 21.592982: netlink_extack: msg=3Dcls_match= all: Failed to setup flow action # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw actio= n police rate 100Mbit burst 10000 conform-exceed drop/continue Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-184 [000] b..1. 38.882579: netlink_extack: msg=3Dact_polic= e: Offload not supported when conform/exceed action is "continue" tc-184 [000] ..... 38.882593: netlink_extack: msg=3Dcls_match= all: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- net/sched/act_police.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 77c17e9b46d1..79c8901f66ab 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -419,7 +419,8 @@ static int tcf_police_search(struct net *net, struct tc= _action **a, u32 index) return tcf_idr_search(tn, a, index); } =20 -static int tcf_police_act_to_flow_act(int tc_act, u32 *extval) +static int tcf_police_act_to_flow_act(int tc_act, u32 *extval, + struct netlink_ext_ack *extack) { int act_id =3D -EOPNOTSUPP; =20 @@ -430,12 +431,20 @@ static int tcf_police_act_to_flow_act(int tc_act, u32= *extval) act_id =3D FLOW_ACTION_DROP; else if (tc_act =3D=3D TC_ACT_PIPE) act_id =3D FLOW_ACTION_PIPE; + else if (tc_act =3D=3D TC_ACT_RECLASSIFY) + NL_SET_ERR_MSG_MOD(extack, "Offload not supported when conform/exceed a= ction is \"reclassify\""); + else + NL_SET_ERR_MSG_MOD(extack, "Unsupported conform/exceed action offload"); } else if (TC_ACT_EXT_CMP(tc_act, TC_ACT_GOTO_CHAIN)) { act_id =3D FLOW_ACTION_GOTO; *extval =3D tc_act & TC_ACT_EXT_VAL_MASK; } else if (TC_ACT_EXT_CMP(tc_act, TC_ACT_JUMP)) { act_id =3D FLOW_ACTION_JUMP; *extval =3D tc_act & TC_ACT_EXT_VAL_MASK; + } else if (tc_act =3D=3D TC_ACT_UNSPEC) { + NL_SET_ERR_MSG_MOD(extack, "Offload not supported when conform/exceed ac= tion is \"continue\""); + } else { + NL_SET_ERR_MSG_MOD(extack, "Unsupported conform/exceed action offload"); } =20 return act_id; @@ -467,14 +476,16 @@ static int tcf_police_offload_act_setup(struct tc_act= ion *act, void *entry_data, entry->police.mtu =3D tcf_police_tcfp_mtu(act); =20 act_id =3D tcf_police_act_to_flow_act(police->tcf_action, - &entry->police.exceed.extval); + &entry->police.exceed.extval, + extack); if (act_id < 0) return act_id; =20 entry->police.exceed.act_id =3D act_id; =20 act_id =3D tcf_police_act_to_flow_act(p->tcfp_result, - &entry->police.notexceed.extval); + &entry->police.notexceed.extval, + extack); if (act_id < 0) return act_id; =20 --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 24DF1C43334 for ; Mon, 11 Jul 2022 09:35:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232864AbiGKJfm (ORCPT ); Mon, 11 Jul 2022 05:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbiGKJeW (ORCPT ); Mon, 11 Jul 2022 05:34:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7801C7CB54; Mon, 11 Jul 2022 02:18: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 dfw.source.kernel.org (Postfix) with ESMTPS id DA92361211; Mon, 11 Jul 2022 09:18:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9164C34115; Mon, 11 Jul 2022 09:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531103; bh=1lxe/7MLB2qdkeeIApXg0/WsPxJWzm5Ya/YAReb80k0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=coIVzrDMx69FDwXWD/YASJrD8ocM8y8nTo5/vlACsOfz148s0Gy+KkVQxz3X5/M3h iaEmjcESYLWIAUxObmFAv8VUzU7KNonDd2+prUBuPbZyGHuNQ/0aFApI7RGa2RIxIq QnOpInmHskrZcao3FIKgEflqg3bG54krbZqYYqaI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vlad Buslov , Ido Schimmel , "David S. Miller" , Sasha Levin Subject: [PATCH 5.18 097/112] net/sched: act_police: allow continue action offload Date: Mon, 11 Jul 2022 11:07:37 +0200 Message-Id: <20220711090552.323023513@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Vlad Buslov [ Upstream commit 052f744f44462cc49b88a125b0f7b93a9e47a9dd ] Offloading police with action TC_ACT_UNSPEC was erroneously disabled even though it was supported by mlx5 matchall offload implementation, which didn't verify the action type but instead assumed that any single police action attached to matchall classifier is a 'continue' action. Lack of action type check made it non-obvious what mlx5 matchall implementation actually supports and caused implementers and reviewers of referenced commits to disallow it as a part of improved validation code. Fixes: b8cd5831c61c ("net: flow_offload: add tc police action parameters") Fixes: b50e462bc22d ("net/sched: act_police: Add extack messages for offloa= d failure") Signed-off-by: Vlad Buslov Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- include/net/flow_offload.h | 1 + net/sched/act_police.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 6484095a8c01..7ac313858037 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -152,6 +152,7 @@ enum flow_action_id { FLOW_ACTION_PIPE, FLOW_ACTION_VLAN_PUSH_ETH, FLOW_ACTION_VLAN_POP_ETH, + FLOW_ACTION_CONTINUE, NUM_FLOW_ACTIONS, }; =20 diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 79c8901f66ab..b759628a47c2 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -442,7 +442,7 @@ static int tcf_police_act_to_flow_act(int tc_act, u32 *= extval, act_id =3D FLOW_ACTION_JUMP; *extval =3D tc_act & TC_ACT_EXT_VAL_MASK; } else if (tc_act =3D=3D TC_ACT_UNSPEC) { - NL_SET_ERR_MSG_MOD(extack, "Offload not supported when conform/exceed ac= tion is \"continue\""); + act_id =3D FLOW_ACTION_CONTINUE; } else { NL_SET_ERR_MSG_MOD(extack, "Unsupported conform/exceed action offload"); } --=20 2.35.1 From nobody Sat Apr 18 21:01:21 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 01804C433EF for ; Mon, 11 Jul 2022 09:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232894AbiGKJfs (ORCPT ); Mon, 11 Jul 2022 05:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbiGKJe2 (ORCPT ); Mon, 11 Jul 2022 05:34:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD89E7CB76; Mon, 11 Jul 2022 02:18: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 ams.source.kernel.org (Postfix) with ESMTPS id 5E8C3B80E76; Mon, 11 Jul 2022 09:18:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4183C34115; Mon, 11 Jul 2022 09:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531106; bh=hO3SubTDNadDhvRH31+Tty536xvTdQZURVktA9So88U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Chl9ZkAs4q22TeDOzPpRmE9zs/YO50AvhulP9v7PIsZ7wRgwScfmFudFSp1zp9Qk2 c5yjEbPCl78HIqwM1XmdFXk8SaJk3jQaWa0Hz+GZpRW2NCV1hsPDoKvKe6n/CFNXHg z0is+yUxpjGOAb4bLz6c/BKatZdNdSjj/Zk3qlpg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Robinson , Fabio Estevam , Vinod Koul Subject: [PATCH 5.18 098/112] dmaengine: imx-sdma: Allow imx8m for imx7 FW revs Date: Mon, 11 Jul 2022 11:07:38 +0200 Message-Id: <20220711090552.351682596@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Peter Robinson commit a7cd3cf0b2e5aaacfe5e02c472bd28e98e640be7 upstream. The revision of the imx-sdma IP that is in the i.MX8M series is the same is that as that in the i.MX7 series but the imx7d MODULE_FIRMWARE directive is wrapped in a condiditional which means it's not defined when built for aarch64 SOC_IMX8M platforms and hence you get the following errors when the driver loads on imx8m devices: imx-sdma 302c0000.dma-controller: Direct firmware load for imx/sdma/sdma-im= x7d.bin failed with error -2 imx-sdma 302c0000.dma-controller: external firmware not found, using ROM fi= rmware Add the SOC_IMX8M into the check so the firmware can load on i.MX8. Fixes: 1474d48bd639 ("arm64: dts: imx8mq: Add SDMA nodes") Fixes: 941acd566b18 ("dmaengine: imx-sdma: Only check ratio on parts that s= upport 1:1") Signed-off-by: Peter Robinson Cc: stable@vger.kernel.org # v5.2+ Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220606161034.3544803-1-pbrobinson@gmail.c= om Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/imx-sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2280,7 +2280,7 @@ MODULE_DESCRIPTION("i.MX SDMA driver"); #if IS_ENABLED(CONFIG_SOC_IMX6Q) MODULE_FIRMWARE("imx/sdma/sdma-imx6q.bin"); #endif -#if IS_ENABLED(CONFIG_SOC_IMX7D) +#if IS_ENABLED(CONFIG_SOC_IMX7D) || IS_ENABLED(CONFIG_SOC_IMX8M) MODULE_FIRMWARE("imx/sdma/sdma-imx7d.bin"); #endif MODULE_LICENSE("GPL"); From nobody Sat Apr 18 21:01:21 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 02BDDC433EF for ; Mon, 11 Jul 2022 09:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbiGKJfz (ORCPT ); Mon, 11 Jul 2022 05:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233033AbiGKJe3 (ORCPT ); Mon, 11 Jul 2022 05:34: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 12A3426C; Mon, 11 Jul 2022 02:18:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55F6661227; Mon, 11 Jul 2022 09:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6464CC34115; Mon, 11 Jul 2022 09:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531108; bh=tZ7qhXzqW2g6UfpzLi8EA29W6soXunuN4wWkkPK9Bx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFQdwz5UScm5UvfgtZiF61Cw9CyqDPpBjnzl4vRQUD0wZecRYEnKowlC2/M11fGdL pXd8Tak3nK9HZUrP6nuFLBQVgqo8GT62Ce5EiQYVN5AIednIh5laBoce3M1tW481vi 38twM5kcS6P4Nl+sJvuFwI1a47vYk6WuhKRpPUpk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sascha Hauer , Vinod Koul Subject: [PATCH 5.18 099/112] dmaengine: imx-sdma: only restart cyclic channel when enabled Date: Mon, 11 Jul 2022 11:07:39 +0200 Message-Id: <20220711090552.380949774@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sascha Hauer commit 09f7b80fac3e588b282ad26aabd7336d7d293efd upstream. An interrupt for a channel might be pending even after struct dma_device::device_terminate_all has been called. In that case the recently introduced warning message "restart cyclic channel..." triggers and the channel will be restarted. This is not desired as the channel has just been stopped. Only restart the channel when we still have a descriptor set for it (which will be set to NULL in sdma_terminate_all()). Fixes: 5b215c28b9235 ("dmaengine: imx-sdma: restart cyclic channel if neede= d") Cc: stable@vger.kernel.org Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220617115042.4004062-1-s.hauer@pengutroni= x.de Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/imx-sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -872,7 +872,7 @@ static void sdma_update_channel_loop(str * SDMA stops cyclic channel when DMA request triggers a channel and no S= DMA * owned buffer is available (i.e. BD_DONE was set too late). */ - if (!is_sdma_channel_enabled(sdmac->sdma, sdmac->channel)) { + if (sdmac->desc && !is_sdma_channel_enabled(sdmac->sdma, sdmac->channel))= { dev_warn(sdmac->sdma->dev, "restart cyclic channel %d\n", sdmac->channel= ); sdma_enable_channel(sdmac->sdma, sdmac->channel); } From nobody Sat Apr 18 21:01:21 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 86715C43334 for ; Mon, 11 Jul 2022 09:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbiGKJgC (ORCPT ); Mon, 11 Jul 2022 05:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233116AbiGKJen (ORCPT ); Mon, 11 Jul 2022 05:34:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599ED55B0; Mon, 11 Jul 2022 02:18:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C3081B80D2C; Mon, 11 Jul 2022 09:18:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20640C34115; Mon, 11 Jul 2022 09:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531111; bh=FM/xnDTajo5tg/nDWYB6juALM7uDbh8bArFdijDwNc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6TBblBkZ6CVOWuQzFi9I4C8KkIsaQ9LEdlH6n/C2XKXJxDYBSbLE/yLiAOkkGzcy PeJ37TS1BNm8dIijhvVKt2rENQRWaMtMyaYyEBMdUG7+gAkW25OTaOqvPvW+ZM5fBH v98CYX8sMlPx4a03AxF46h0WvR2OFPXx1cQuJnfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , stable Subject: [PATCH 5.18 100/112] misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer Date: Mon, 11 Jul 2022 11:07:40 +0200 Message-Id: <20220711090552.410096104@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Shuah Khan commit eb7f8e28420372787933eec079735c35034bda7d upstream. rtsx_usb driver allocates coherent dma buffer for urb transfers. This buffer is passed to usb_bulk_msg() and usb core tries to map already mapped buffer running into a dma mapping error. xhci_hcd 0000:01:00.0: rejecting DMA map of vmalloc memory WARNING: CPU: 1 PID: 279 at include/linux/dma-mapping.h:326 usb_ hcd_map_ur= b_for_dma+0x7d6/0x820 ... xhci_map_urb_for_dma+0x291/0x4e0 usb_hcd_submit_urb+0x199/0x12b0 ... usb_submit_urb+0x3b8/0x9e0 usb_start_wait_urb+0xe3/0x2d0 usb_bulk_msg+0x115/0x240 rtsx_usb_transfer_data+0x185/0x1a8 [rtsx_usb] rtsx_usb_send_cmd+0xbb/0x123 [rtsx_usb] rtsx_usb_write_register+0x12c/0x143 [rtsx_usb] rtsx_usb_probe+0x226/0x4b2 [rtsx_usb] Fix it to use kmalloc() to get DMA-able memory region instead. Signed-off-by: Shuah Khan Cc: stable Link: https://lore.kernel.org/r/667d627d502e1ba9ff4f9b94966df3299d2d3c0d.16= 56642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/misc/cardreader/rtsx_usb.c | 13 +++++++------ include/linux/rtsx_usb.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) --- a/drivers/misc/cardreader/rtsx_usb.c +++ b/drivers/misc/cardreader/rtsx_usb.c @@ -631,8 +631,7 @@ static int rtsx_usb_probe(struct usb_int =20 ucr->pusb_dev =3D usb_dev; =20 - ucr->iobuf =3D usb_alloc_coherent(ucr->pusb_dev, IOBUF_SIZE, - GFP_KERNEL, &ucr->iobuf_dma); + ucr->iobuf =3D kmalloc(IOBUF_SIZE, GFP_KERNEL); if (!ucr->iobuf) return -ENOMEM; =20 @@ -668,8 +667,9 @@ static int rtsx_usb_probe(struct usb_int =20 out_init_fail: usb_set_intfdata(ucr->pusb_intf, NULL); - usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf, - ucr->iobuf_dma); + kfree(ucr->iobuf); + ucr->iobuf =3D NULL; + ucr->cmd_buf =3D ucr->rsp_buf =3D NULL; return ret; } =20 @@ -682,8 +682,9 @@ static void rtsx_usb_disconnect(struct u mfd_remove_devices(&intf->dev); =20 usb_set_intfdata(ucr->pusb_intf, NULL); - usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf, - ucr->iobuf_dma); + kfree(ucr->iobuf); + ucr->iobuf =3D NULL; + ucr->cmd_buf =3D ucr->rsp_buf =3D NULL; } =20 #ifdef CONFIG_PM --- a/include/linux/rtsx_usb.h +++ b/include/linux/rtsx_usb.h @@ -55,7 +55,6 @@ struct rtsx_ucr { struct usb_interface *pusb_intf; struct usb_sg_request current_sg; unsigned char *iobuf; - dma_addr_t iobuf_dma; =20 struct timer_list sg_timer; struct mutex dev_mutex; From nobody Sat Apr 18 21:01:21 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 4F2C8C43334 for ; Mon, 11 Jul 2022 09:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232935AbiGKJgE (ORCPT ); Mon, 11 Jul 2022 05:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbiGKJen (ORCPT ); Mon, 11 Jul 2022 05:34:43 -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 5A00F5F70; Mon, 11 Jul 2022 02:18: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 AD0AC6111F; Mon, 11 Jul 2022 09:18:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB261C34115; Mon, 11 Jul 2022 09:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531114; bh=6P8CXs3MGbhhmsH5Oe+Hzg9axBWkQxRbYazFIsEe6KE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B9p2zf+OCh9enCny0gxnrL2CzNC80s6/oc1KuVwIaLGgpWtjqC7v/9r7DbJ5vNYCH SFDJwbnF2bdVwRyC/NCT+K67T9batzCyu842DlojDoO7iisEsw17RN3XKARf/iFANK UcHFlud3oazRtFl+ts+HO24vX5zC7IkvrtnhBoFY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , stable Subject: [PATCH 5.18 101/112] misc: rtsx_usb: use separate command and response buffers Date: Mon, 11 Jul 2022 11:07:41 +0200 Message-Id: <20220711090552.437486205@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Shuah Khan commit 3776c78559853fd151be7c41e369fd076fb679d5 upstream. rtsx_usb uses same buffer for command and response. There could be a potential conflict using the same buffer for both especially if retries and timeouts are involved. Use separate command and response buffers to avoid conflicts. Signed-off-by: Shuah Khan Cc: stable Link: https://lore.kernel.org/r/07e3721804ff07aaab9ef5b39a5691d0718b9ade.16= 56642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/misc/cardreader/rtsx_usb.c | 26 +++++++++++++++++--------- include/linux/rtsx_usb.h | 1 - 2 files changed, 17 insertions(+), 10 deletions(-) --- a/drivers/misc/cardreader/rtsx_usb.c +++ b/drivers/misc/cardreader/rtsx_usb.c @@ -631,15 +631,18 @@ static int rtsx_usb_probe(struct usb_int =20 ucr->pusb_dev =3D usb_dev; =20 - ucr->iobuf =3D kmalloc(IOBUF_SIZE, GFP_KERNEL); - if (!ucr->iobuf) + ucr->cmd_buf =3D kmalloc(IOBUF_SIZE, GFP_KERNEL); + if (!ucr->cmd_buf) return -ENOMEM; =20 + ucr->rsp_buf =3D kmalloc(IOBUF_SIZE, GFP_KERNEL); + if (!ucr->rsp_buf) + goto out_free_cmd_buf; + usb_set_intfdata(intf, ucr); =20 ucr->vendor_id =3D id->idVendor; ucr->product_id =3D id->idProduct; - ucr->cmd_buf =3D ucr->rsp_buf =3D ucr->iobuf; =20 mutex_init(&ucr->dev_mutex); =20 @@ -667,9 +670,11 @@ static int rtsx_usb_probe(struct usb_int =20 out_init_fail: usb_set_intfdata(ucr->pusb_intf, NULL); - kfree(ucr->iobuf); - ucr->iobuf =3D NULL; - ucr->cmd_buf =3D ucr->rsp_buf =3D NULL; + kfree(ucr->rsp_buf); + ucr->rsp_buf =3D NULL; +out_free_cmd_buf: + kfree(ucr->cmd_buf); + ucr->cmd_buf =3D NULL; return ret; } =20 @@ -682,9 +687,12 @@ static void rtsx_usb_disconnect(struct u mfd_remove_devices(&intf->dev); =20 usb_set_intfdata(ucr->pusb_intf, NULL); - kfree(ucr->iobuf); - ucr->iobuf =3D NULL; - ucr->cmd_buf =3D ucr->rsp_buf =3D NULL; + + kfree(ucr->cmd_buf); + ucr->cmd_buf =3D NULL; + + kfree(ucr->rsp_buf); + ucr->rsp_buf =3D NULL; } =20 #ifdef CONFIG_PM --- a/include/linux/rtsx_usb.h +++ b/include/linux/rtsx_usb.h @@ -54,7 +54,6 @@ struct rtsx_ucr { struct usb_device *pusb_dev; struct usb_interface *pusb_intf; struct usb_sg_request current_sg; - unsigned char *iobuf; =20 struct timer_list sg_timer; struct mutex dev_mutex; From nobody Sat Apr 18 21:01:21 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 8E2A2C43334 for ; Mon, 11 Jul 2022 09:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232942AbiGKJgH (ORCPT ); Mon, 11 Jul 2022 05:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233133AbiGKJeo (ORCPT ); Mon, 11 Jul 2022 05:34:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A8965A5; Mon, 11 Jul 2022 02:18:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AF67B61227; Mon, 11 Jul 2022 09:18:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95F46C34115; Mon, 11 Jul 2022 09:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531117; bh=lh7AYL4Z8YvuRd3eo1vbbmlhCCo0hOo/6FSah1I1Stk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XnXAKEEcCxLV5Pxm9RMvtB92AMjidQ215doMoEsWLwR9qGvdgXtv2r0yHyREpPhWy BX5vSEPgIvFdjD4bifU/fmIj9W2HwkTr4TeVPfWZWm1OZcs+9xeXxPfVfq5N9ePIDk JslGHFmBArHfUEkRUkH64vEiNNdCC13FJkwXvvTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , stable , Shuah Khan Subject: [PATCH 5.18 102/112] misc: rtsx_usb: set return value in rsp_buf alloc err path Date: Mon, 11 Jul 2022 11:07:42 +0200 Message-Id: <20220711090552.465851390@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Shuah Khan commit 2cd37c2e72449a7add6da1183d20a6247d6db111 upstream. Set return value in rsp_buf alloc error path before going to error handling. drivers/misc/cardreader/rtsx_usb.c:639:6: warning: variable 'ret' is used u= ninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!ucr->rsp_buf) ^~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:678:9: note: uninitialized use occurs= here return ret; ^~~ drivers/misc/cardreader/rtsx_usb.c:639:2: note: remove the 'if' if its c= ondition is always false if (!ucr->rsp_buf) ^~~~~~~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:622:9: note: initialize the variable = 'ret' to silence this warning int ret; ^ =3D 0 Fixes: 3776c7855985 ("misc: rtsx_usb: use separate command and response buf= fers") Reported-by: kernel test robot Cc: stable Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220701165352.15687-1-skhan@linuxfoundatio= n.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/misc/cardreader/rtsx_usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/misc/cardreader/rtsx_usb.c +++ b/drivers/misc/cardreader/rtsx_usb.c @@ -636,8 +636,10 @@ static int rtsx_usb_probe(struct usb_int return -ENOMEM; =20 ucr->rsp_buf =3D kmalloc(IOBUF_SIZE, GFP_KERNEL); - if (!ucr->rsp_buf) + if (!ucr->rsp_buf) { + ret =3D -ENOMEM; goto out_free_cmd_buf; + } =20 usb_set_intfdata(intf, ucr); From nobody Sat Apr 18 21:01:21 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 03850C43334 for ; Mon, 11 Jul 2022 09:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbiGKJgT (ORCPT ); Mon, 11 Jul 2022 05:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbiGKJeu (ORCPT ); Mon, 11 Jul 2022 05:34:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D086330; Mon, 11 Jul 2022 02:18: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 183FEB80833; Mon, 11 Jul 2022 09:18:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DB0FC34115; Mon, 11 Jul 2022 09:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531119; bh=mtlslkPZOGbYO1mkm2rsME8Fmx8ft0J7wjRxl8Q0S6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UTHyPNEtckOlWmioD52H87fPcpfwPgg+Xz0udjgVcw3qnedyPkqiVWqmVpUdfmdNd 1LcQ0OPHXQ04FxeewAxHtj4kUfB8DTB7keAJMm1q6sI9erJ2euzCVGe8p6OZ5rh75S NCDQEZ787T68JiX51QduU5mWqVbMWZXVT9JpE5Ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samin Guo , Emil Renner Berthing , Vinod Koul Subject: [PATCH 5.18 103/112] dmaengine: dw-axi-dmac: Fix RMW on channel suspend register Date: Mon, 11 Jul 2022 11:07:43 +0200 Message-Id: <20220711090552.494344585@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Emil Renner Berthing commit 49db68d45bdcad06e28a420d5d911e4178389666 upstream. When the DMA is configured for more than 8 channels the bits controlling suspend moves to another register. However when adding support for this the new register would be completely overwritten in one case and overwritten with values from the old register in another case. Found by comparing the parallel implementation of more than 8 channel support for the StarFive JH7100 SoC by Samin. Fixes: 824351668a41 ("dmaengine: dw-axi-dmac: support DMAX_NUM_CHANNELS > 8= ") Co-developed-by: Samin Guo Signed-off-by: Samin Guo Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220627090939.1775717-1-emil.renner.berthi= ng@canonical.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -1164,8 +1164,9 @@ static int dma_chan_pause(struct dma_cha BIT(chan->id) << DMAC_CHAN_SUSP_WE_SHIFT; axi_dma_iowrite32(chan->chip, DMAC_CHEN, val); } else { - val =3D BIT(chan->id) << DMAC_CHAN_SUSP2_SHIFT | - BIT(chan->id) << DMAC_CHAN_SUSP2_WE_SHIFT; + val =3D axi_dma_ioread32(chan->chip, DMAC_CHSUSPREG); + val |=3D BIT(chan->id) << DMAC_CHAN_SUSP2_SHIFT | + BIT(chan->id) << DMAC_CHAN_SUSP2_WE_SHIFT; axi_dma_iowrite32(chan->chip, DMAC_CHSUSPREG, val); } =20 @@ -1190,12 +1191,13 @@ static inline void axi_chan_resume(struc { u32 val; =20 - val =3D axi_dma_ioread32(chan->chip, DMAC_CHEN); if (chan->chip->dw->hdata->reg_map_8_channels) { + val =3D axi_dma_ioread32(chan->chip, DMAC_CHEN); val &=3D ~(BIT(chan->id) << DMAC_CHAN_SUSP_SHIFT); val |=3D (BIT(chan->id) << DMAC_CHAN_SUSP_WE_SHIFT); axi_dma_iowrite32(chan->chip, DMAC_CHEN, val); } else { + val =3D axi_dma_ioread32(chan->chip, DMAC_CHSUSPREG); val &=3D ~(BIT(chan->id) << DMAC_CHAN_SUSP2_SHIFT); val |=3D (BIT(chan->id) << DMAC_CHAN_SUSP2_WE_SHIFT); axi_dma_iowrite32(chan->chip, DMAC_CHSUSPREG, val); From nobody Sat Apr 18 21:01:21 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 EE878C433EF for ; Mon, 11 Jul 2022 09:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232822AbiGKJgc (ORCPT ); Mon, 11 Jul 2022 05:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232787AbiGKJfG (ORCPT ); Mon, 11 Jul 2022 05:35:06 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B7E52FCC; Mon, 11 Jul 2022 02:18:46 -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 9EA39CE1257; Mon, 11 Jul 2022 09:18:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A8D0C34115; Mon, 11 Jul 2022 09:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531122; bh=Rt/Sio1pJh64bojAYm8X1d6JRxSAP0jT01fXLbbdLhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VDTrIBbAKh4MvlxlQSuJhmM+7YgnDPP1f3RshffKqVDWqnyRaojs7oCibEOqVCItb 0DuHZrBVJjd22ZW+TpfhlsOpUXvgUPZ6A/LsPcWKzpqpWSgvySF+L1FLus0Lg3OfC6 T80/GGcaSNz4TLIhfXv31yj4EafvUStQb/VeijRA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Holland , Rob Herring , Vinod Koul Subject: [PATCH 5.18 104/112] dt-bindings: dma: allwinner,sun50i-a64-dma: Fix min/max typo Date: Mon, 11 Jul 2022 11:07:44 +0200 Message-Id: <20220711090552.522591209@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Samuel Holland commit 607a48c78e6b427b0b684d24e61c19e846ad65d6 upstream. The conditional block for variants with a second clock should have set minItems, not maxItems, which was already 2. Since clock-names requires two items, this typo should not have caused any problems. Fixes: edd14218bd66 ("dt-bindings: dmaengine: Convert Allwinner A31 and A64= DMA to a schema") Signed-off-by: Samuel Holland Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220702031903.21703-1-samuel@sholland.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml | 2= +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml @@ -64,7 +64,7 @@ if: then: properties: clocks: - maxItems: 2 + minItems: 2 =20 required: - clock-names From nobody Sat Apr 18 21:01:21 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 39374C433EF for ; Mon, 11 Jul 2022 09:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232646AbiGKJgq (ORCPT ); Mon, 11 Jul 2022 05:36:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbiGKJgP (ORCPT ); Mon, 11 Jul 2022 05:36:15 -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 EAE9B7E803; Mon, 11 Jul 2022 02:18:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC9A4B80833; Mon, 11 Jul 2022 09:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A904C34115; Mon, 11 Jul 2022 09:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531128; bh=T7xOkgvjtE3PbkwxKocejNJRefdrZpo1wFeudSfDjeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sguYXvPtjYa/zAT5vahAdAlNRg3nTCSq3y5iuXkMtFkkoNn5h5fPc4tAhV4ZPihHY kOCd+jKXlGrlFjxWEXNF7UJWOlhJa/zQQhIgwliRiv+VEZzf7cu9rWFMxmJiqMm4OD pJ0UUtCYuWhtJPyYOwXnIaK65esQSLgMVNYhjEPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Itay Iellin , Matthew Wilcox , Linus Torvalds Subject: [PATCH 5.18 105/112] ida: dont use BUG_ON() for debugging Date: Mon, 11 Jul 2022 11:07:45 +0200 Message-Id: <20220711090552.550441998@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Linus Torvalds commit fc82bbf4dede758007763867d0282353c06d1121 upstream. This is another old BUG_ON() that just shouldn't exist (see also commit a382f8fee42c: "signal handling: don't use BUG_ON() for debugging"). In fact, as Matthew Wilcox points out, this condition shouldn't really even result in a warning, since a negative id allocation result is just a normal allocation failure: "I wonder if we should even warn here -- sure, the caller is trying to free something that wasn't allocated, but we don't warn for kfree(NULL)" and goes on to point out how that current error check is only causing people to unnecessarily do their own index range checking before freeing it. This was noted by Itay Iellin, because the bluetooth HCI socket cookie code does *not* do that range checking, and ends up just freeing the error case too, triggering the BUG_ON(). The HCI code requires CAP_NET_RAW, and seems to just result in an ugly splat, but there really is no reason to BUG_ON() here, and we have generally striven for allocation models where it's always ok to just do free(alloc()); even if the allocation were to fail for some random reason (usually obviously that "random" reason being some resource limit). Fixes: 88eca0207cf1 ("ida: simplified functions for id allocation") Reported-by: Itay Iellin Suggested-by: Matthew Wilcox Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- lib/idr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/lib/idr.c +++ b/lib/idr.c @@ -491,7 +491,8 @@ void ida_free(struct ida *ida, unsigned struct ida_bitmap *bitmap; unsigned long flags; =20 - BUG_ON((int)id < 0); + if ((int)id < 0) + return; =20 xas_lock_irqsave(&xas, flags); bitmap =3D xas_load(&xas); From nobody Sat Apr 18 21:01:22 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 A877EC43334 for ; Mon, 11 Jul 2022 09:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232997AbiGKJgz (ORCPT ); Mon, 11 Jul 2022 05:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232956AbiGKJgT (ORCPT ); Mon, 11 Jul 2022 05:36:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782DF4C630; Mon, 11 Jul 2022 02:18:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 994A6B80E76; Mon, 11 Jul 2022 09:18:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDD7FC34115; Mon, 11 Jul 2022 09:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531131; bh=p0lflOcWHVfiMHk1+KUAd/x8/pQZqrbHUD1i0/M/Vz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ml7N69w/GPaPWcOshhL702ju8eojgWb/Wfy2S0OkRVtNhM0HfVgEAAlqbk8lRNKBH mANxKuJwrP7kF1gpjfh7pH9SmxL6JNtX62joaD7vEyi5VtMjPb40uIlmHD1GzwPwhB ks6CA9cM2EnvvHTUFTFRbF2M3SAdrlRMiafNl9zA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Vinod Koul Subject: [PATCH 5.18 106/112] dmaengine: pl330: Fix lockdep warning about non-static key Date: Mon, 11 Jul 2022 11:07:46 +0200 Message-Id: <20220711090552.578956571@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 Osipenko commit b64b3b2f1d81f83519582e1feee87d77f51f5f17 upstream. The DEFINE_SPINLOCK() macro shouldn't be used for dynamically allocated spinlocks. The lockdep warns about this and disables locking validator. Fix the warning by making lock static. INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. Hardware name: Radxa ROCK Pi 4C (DT) Call trace: dump_backtrace.part.0+0xcc/0xe0 show_stack+0x18/0x6c dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 register_lock_class+0x4a8/0x4cc __lock_acquire+0x78/0x20cc lock_acquire.part.0+0xe0/0x230 lock_acquire+0x68/0x84 _raw_spin_lock_irqsave+0x84/0xc4 add_desc+0x44/0xc0 pl330_get_desc+0x15c/0x1d0 pl330_prep_dma_cyclic+0x100/0x270 snd_dmaengine_pcm_trigger+0xec/0x1c0 dmaengine_pcm_trigger+0x18/0x24 ... Fixes: e588710311ee ("dmaengine: pl330: fix descriptor allocation fail") Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220520181432.149904-1-dmitry.osipenko@col= labora.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/pl330.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2589,7 +2589,7 @@ static struct dma_pl330_desc *pl330_get_ =20 /* If the DMAC pool is empty, alloc new */ if (!desc) { - DEFINE_SPINLOCK(lock); + static DEFINE_SPINLOCK(lock); LIST_HEAD(pool); =20 if (!add_desc(&pool, &lock, GFP_ATOMIC, 1)) From nobody Sat Apr 18 21:01:22 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 527E1CCA47B for ; Mon, 11 Jul 2022 09:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232833AbiGKJhG (ORCPT ); Mon, 11 Jul 2022 05:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232513AbiGKJga (ORCPT ); Mon, 11 Jul 2022 05:36:30 -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 BDEE581499; Mon, 11 Jul 2022 02:18:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 46FDEB80E74; Mon, 11 Jul 2022 09:18:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94C11C34115; Mon, 11 Jul 2022 09:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531134; bh=maPocCFDUREvXM9pIbr4oBu9Z1mY1qtMxmnH6+RDnnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXl/DMpN2jNZVyvUZ73w1CzLZ4s4JBU6JQamOCDZgJQITdPRRfiUTEqQ+jnK9pBun cO4l/sreIzITqqWw/8rvHbcyDcVFmIxvQCWqlRdaEq0BOJ3KzpWKk12H/49VuU9BVd 9gcRDwRbqCZfDtH/+AC7l6chlACexlvitMKJ0hyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Vinod Koul Subject: [PATCH 5.18 107/112] dmaengine: lgm: Fix an error handling path in intel_ldma_probe() Date: Mon, 11 Jul 2022 11:07:47 +0200 Message-Id: <20220711090552.607253147@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Christophe JAILLET commit 1dbe67b9faea0bc340cce894018076679c16cb71 upstream. ldma_clk_disable() calls both: clk_disable_unprepare(d->core_clk); reset_control_assert(d->rst); So, should devm_reset_control_get_optional() fail, core_clk should not be prepare_enable'd before it, otherwise it will never be disable_unprepare'd. Reorder the code to handle the error handling path as expected. Fixes: 32d31c79a1a4 ("dmaengine: Add Intel LGM SoC DMA support.") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/18504549bc4d2b62a72a02cb22a2e4d8e6a58720.16= 53241224.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/lgm/lgm-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/dma/lgm/lgm-dma.c +++ b/drivers/dma/lgm/lgm-dma.c @@ -1593,11 +1593,12 @@ static int intel_ldma_probe(struct platf d->core_clk =3D devm_clk_get_optional(dev, NULL); if (IS_ERR(d->core_clk)) return PTR_ERR(d->core_clk); - clk_prepare_enable(d->core_clk); =20 d->rst =3D devm_reset_control_get_optional(dev, NULL); if (IS_ERR(d->rst)) return PTR_ERR(d->rst); + + clk_prepare_enable(d->core_clk); reset_control_deassert(d->rst); =20 ret =3D devm_add_action_or_reset(dev, ldma_clk_disable, d); From nobody Sat Apr 18 21:01:22 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 6347FC43334 for ; Mon, 11 Jul 2022 09:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232852AbiGKJhJ (ORCPT ); Mon, 11 Jul 2022 05:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbiGKJgd (ORCPT ); Mon, 11 Jul 2022 05:36:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3EDD820DC; Mon, 11 Jul 2022 02:18:59 -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 23414B80E76; Mon, 11 Jul 2022 09:18:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72203C34115; Mon, 11 Jul 2022 09:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531136; bh=XBONTpeGMl4Fkew44k0xDUFHUV3pxi3H65zw282K6WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cm8a9f6D2An+1PqeNyB/bjUHJ8cqXWjBK9J84Khyx2ckJSDQbOInN+7XLXVWwbXSS 17zUYlpi21K7lDUUvC7jDR2Hw5nue6HivkVPGkyK06lXtbjAi6y51uuGvMj1tjLGgb QZroowmlSmT93v+CywVtMS1rHr1htgDYl+fyICJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Vinod Koul Subject: [PATCH 5.18 108/112] dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly Date: Mon, 11 Jul 2022 11:07:48 +0200 Message-Id: <20220711090552.635437033@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Michael Walle commit 3770d92bd5237d686e49da7b2fb86f53ee6ed259 upstream. It seems that it is valid to have less than the requested number of descriptors. But what is not valid and leads to subsequent errors is to have zero descriptors. In that case, abort the probing. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended D= MA Controller driver") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220526135111.1470926-1-michael@walle.cc Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/at_xdmac.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -1893,6 +1893,11 @@ static int at_xdmac_alloc_chan_resources for (i =3D 0; i < init_nr_desc_per_channel; i++) { desc =3D at_xdmac_alloc_desc(chan, GFP_KERNEL); if (!desc) { + if (i =3D=3D 0) { + dev_warn(chan2dev(chan), + "can't allocate any descriptors\n"); + return -EIO; + } dev_warn(chan2dev(chan), "only %d descriptors have been allocated\n", i); break; From nobody Sat Apr 18 21:01:22 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 55B84C433EF for ; Mon, 11 Jul 2022 09:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbiGKJhL (ORCPT ); Mon, 11 Jul 2022 05:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232849AbiGKJgf (ORCPT ); Mon, 11 Jul 2022 05:36:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96BE0820EF; Mon, 11 Jul 2022 02:19: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 dfw.source.kernel.org (Postfix) with ESMTPS id 20B5A612A3; Mon, 11 Jul 2022 09:19:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30744C34115; Mon, 11 Jul 2022 09:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531139; bh=Hk/f5HEXN2CGqKGi2hWX/5xqot39iQo6TVSPqo3c+18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1+J2GBNCcODJq7rrVdIoljflseK/PbAxc3HOuTRZs2pS/yj5VfFw5VLHAGMsfTNF nAuobwEScODPeJL2qrGrEJb8O4NxvTXaQxE/Vkm89K/tBrNeAC1S8j8Sthx2kh8JnV R/uWw8MDOZw/oiv1Ma8jrcQYvpmhxcRV6rNUZP+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Vinod Koul Subject: [PATCH 5.18 109/112] dmaengine: ti: Fix refcount leak in ti_dra7_xbar_route_allocate Date: Mon, 11 Jul 2022 11:07:49 +0200 Message-Id: <20220711090552.662970534@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 c132fe78ad7b4ce8b5d49a501a15c29d08eeb23a upstream. of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. Add missing of_node_put() in to fix this. Fixes: ec9bfa1e1a79 ("dmaengine: ti-dma-crossbar: dra7: Use bitops instead = of idr") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220605042723.17668-2-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/ti/dma-crossbar.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -268,6 +268,7 @@ static void *ti_dra7_xbar_route_allocate mutex_unlock(&xbar->mutex); dev_err(&pdev->dev, "Run out of free DMA requests\n"); kfree(map); + of_node_put(dma_spec->np); return ERR_PTR(-ENOMEM); } set_bit(map->xbar_out, xbar->dma_inuse); From nobody Sat Apr 18 21:01:22 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 64596C43334 for ; Mon, 11 Jul 2022 09:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233032AbiGKJhQ (ORCPT ); Mon, 11 Jul 2022 05:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232879AbiGKJgi (ORCPT ); Mon, 11 Jul 2022 05:36: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 3E9B9823A0; Mon, 11 Jul 2022 02:19:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BAEF86111F; Mon, 11 Jul 2022 09:19:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4D83C34115; Mon, 11 Jul 2022 09:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531142; bh=gqWazm/mNwpkstb0KhVnW7UFdBsaUH4OBtp1yI4PIXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nQNBR/Rwn3S/TOl5S0m3nWKHazzCN2hbiFq8ZNAaCQrevJ684hGA9D77YYI8BwzA4 tT0AcpSEafdB2E7Sx8NXom2G3ntoFuHX24HqJ+UB8wMRK7777DBXWDbkKXQLucfZ7M qVAXBtCy+ErOODTABACI18//JikqapyntHE65kbQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Gerhold , Caleb Connolly , Vinod Koul Subject: [PATCH 5.18 110/112] dmaengine: qcom: bam_dma: fix runtime PM underflow Date: Mon, 11 Jul 2022 11:07:50 +0200 Message-Id: <20220711090552.690669633@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Caleb Connolly commit 0ac9c3dd0d6fe293cd5044cfad10bec27d171e4e upstream. Commit dbad41e7bb5f ("dmaengine: qcom: bam_dma: check if the runtime pm ena= bled") caused unbalanced pm_runtime_get/put() calls when the bam is controlled remotely. This commit reverts it and just enables pm_runtime in all cases, the clk_* functions already just nop when the clock is NULL. Also clean up a bit by removing unnecessary bamclk null checks. Suggested-by: Stephan Gerhold Fixes: dbad41e7bb5f ("dmaengine: qcom: bam_dma: check if the runtime pm ena= bled") Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20220629140559.118537-1-caleb.connolly@lina= ro.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/qcom/bam_dma.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -558,14 +558,6 @@ static int bam_alloc_chan(struct dma_cha return 0; } =20 -static int bam_pm_runtime_get_sync(struct device *dev) -{ - if (pm_runtime_enabled(dev)) - return pm_runtime_get_sync(dev); - - return 0; -} - /** * bam_free_chan - Frees dma resources associated with specific channel * @chan: specified channel @@ -581,7 +573,7 @@ static void bam_free_chan(struct dma_cha unsigned long flags; int ret; =20 - ret =3D bam_pm_runtime_get_sync(bdev->dev); + ret =3D pm_runtime_get_sync(bdev->dev); if (ret < 0) return; =20 @@ -784,7 +776,7 @@ static int bam_pause(struct dma_chan *ch unsigned long flag; int ret; =20 - ret =3D bam_pm_runtime_get_sync(bdev->dev); + ret =3D pm_runtime_get_sync(bdev->dev); if (ret < 0) return ret; =20 @@ -810,7 +802,7 @@ static int bam_resume(struct dma_chan *c unsigned long flag; int ret; =20 - ret =3D bam_pm_runtime_get_sync(bdev->dev); + ret =3D pm_runtime_get_sync(bdev->dev); if (ret < 0) return ret; =20 @@ -919,7 +911,7 @@ static irqreturn_t bam_dma_irq(int irq, if (srcs & P_IRQ) tasklet_schedule(&bdev->task); =20 - ret =3D bam_pm_runtime_get_sync(bdev->dev); + ret =3D pm_runtime_get_sync(bdev->dev); if (ret < 0) return IRQ_NONE; =20 @@ -1037,7 +1029,7 @@ static void bam_start_dma(struct bam_cha if (!vd) return; =20 - ret =3D bam_pm_runtime_get_sync(bdev->dev); + ret =3D pm_runtime_get_sync(bdev->dev); if (ret < 0) return; =20 @@ -1374,11 +1366,6 @@ static int bam_dma_probe(struct platform if (ret) goto err_unregister_dma; =20 - if (!bdev->bamclk) { - pm_runtime_disable(&pdev->dev); - return 0; - } - pm_runtime_irq_safe(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, BAM_DMA_AUTOSUSPEND_DELAY); pm_runtime_use_autosuspend(&pdev->dev); @@ -1462,10 +1449,8 @@ static int __maybe_unused bam_dma_suspen { struct bam_device *bdev =3D dev_get_drvdata(dev); =20 - if (bdev->bamclk) { - pm_runtime_force_suspend(dev); - clk_unprepare(bdev->bamclk); - } + pm_runtime_force_suspend(dev); + clk_unprepare(bdev->bamclk); =20 return 0; } @@ -1475,13 +1460,11 @@ static int __maybe_unused bam_dma_resume struct bam_device *bdev =3D dev_get_drvdata(dev); int ret; =20 - if (bdev->bamclk) { - ret =3D clk_prepare(bdev->bamclk); - if (ret) - return ret; + ret =3D clk_prepare(bdev->bamclk); + if (ret) + return ret; =20 - pm_runtime_force_resume(dev); - } + pm_runtime_force_resume(dev); =20 return 0; } From nobody Sat Apr 18 21:01:22 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 BB111C43334 for ; Mon, 11 Jul 2022 09:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232118AbiGKJh3 (ORCPT ); Mon, 11 Jul 2022 05:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232981AbiGKJgn (ORCPT ); Mon, 11 Jul 2022 05:36:43 -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 A1FD711C36; Mon, 11 Jul 2022 02:19:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 24D88B80E6D; Mon, 11 Jul 2022 09:19:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EA86C34115; Mon, 11 Jul 2022 09:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531144; bh=VEDEAuGYpp7Jizzi0f+s+J5j7QxYR9ToluTbgD9NrJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Ve1+zHepIKdyfu2AJCeDBKCsGe+BLNqItKRVuqXt+qDgwXpWvA50N7I2Ej8JlU52 eJZ+5nMaoY/WVfXx6pPOHB3uh8wjI9tKeFlaJeSJ/HRU0Us+Bm7Y5kjtrkpZm9BoSx WNcEPcvJirhAyQ4+xNljxDhMScB4KS7TJ8PrA4ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Peter Ujfalusi , Vinod Koul Subject: [PATCH 5.18 111/112] dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate Date: Mon, 11 Jul 2022 11:07:51 +0200 Message-Id: <20220711090552.718821300@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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 615a4bfc426e11dba05c2cf343f9ac752fb381d2 upstream. of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Fixes: a074ae38f859 ("dmaengine: Add driver for TI DMA crossbar on DRA7x") Signed-off-by: Miaoqian Lin Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220605042723.17668-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/ti/dma-crossbar.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -245,6 +245,7 @@ static void *ti_dra7_xbar_route_allocate if (dma_spec->args[0] >=3D xbar->xbar_requests) { dev_err(&pdev->dev, "Invalid XBAR request number: %d\n", dma_spec->args[0]); + put_device(&pdev->dev); return ERR_PTR(-EINVAL); } =20 @@ -252,12 +253,14 @@ static void *ti_dra7_xbar_route_allocate dma_spec->np =3D of_parse_phandle(ofdma->of_node, "dma-masters", 0); if (!dma_spec->np) { dev_err(&pdev->dev, "Can't get DMA master\n"); + put_device(&pdev->dev); return ERR_PTR(-EINVAL); } =20 map =3D kzalloc(sizeof(*map), GFP_KERNEL); if (!map) { of_node_put(dma_spec->np); + put_device(&pdev->dev); return ERR_PTR(-ENOMEM); } =20 @@ -269,6 +272,7 @@ static void *ti_dra7_xbar_route_allocate dev_err(&pdev->dev, "Run out of free DMA requests\n"); kfree(map); of_node_put(dma_spec->np); + put_device(&pdev->dev); return ERR_PTR(-ENOMEM); } set_bit(map->xbar_out, xbar->dma_inuse); From nobody Sat Apr 18 21:01:22 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 9DA07C433EF for ; Mon, 11 Jul 2022 09:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbiGKJhf (ORCPT ); Mon, 11 Jul 2022 05:37:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232986AbiGKJgn (ORCPT ); Mon, 11 Jul 2022 05:36:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EC851261F; Mon, 11 Jul 2022 02:19:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B4836111F; Mon, 11 Jul 2022 09:19:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34BE3C34115; Mon, 11 Jul 2022 09:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531147; bh=x7m0mhFzTw7bZfUJ5gPgtgFWPeIZ0MGHw9B9TK6gqyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cTbqoFdsar8Ty4czdenutGtSOfvmWfvy9P5ciyQ85+xukHEJ3PF3E//QfRjruicUo 5ZkrdRuc9vncNh0PKT34ftqTkZwcXyLGgkHbG49NpLK01IHn2BCFZTDyMRk18RjbPk jngJ7A+bmr2Eiz7lfk6nJIXLWUftfZ91Zk8DFdpE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Zhu , Dave Jiang , Fenghua Yu , Vinod Koul Subject: [PATCH 5.18 112/112] dmaengine: idxd: force wq context cleanup on device disable path Date: Mon, 11 Jul 2022 11:07:52 +0200 Message-Id: <20220711090552.746712817@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090549.543317027@linuxfoundation.org> References: <20220711090549.543317027@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: Dave Jiang commit 44c4237cf3436bda2b185ff728123651ad133f69 upstream. Testing shown that when a wq mode is setup to be dedicated and then torn down and reconfigured to shared, the wq configured end up being dedicated anyays. The root cause is when idxd_device_wqs_clear_state() gets called during idxd_driver removal, idxd_wq_disable_cleanup() does not get called vs when the wq driver is removed first. The check of wq state being "enabled" causes the cleanup to be bypassed. However, idxd_driver->remove() releases all wq drivers. So the wqs goes to "disabled" state and will never be "enabled". By that point, the driver has no idea if the wq was previously configured or clean. So force call idxd_wq_disable_cleanup() on all wqs always to make sure everything gets cleaned up. Reported-by: Tony Zhu Tested-by: Tony Zhu Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits afte= r disabling device") Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220628230056.2527816-1-fenghua.yu@intel.c= om Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Sudip Mukherjee --- drivers/dma/idxd/device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -698,10 +698,7 @@ static void idxd_device_wqs_clear_state( for (i =3D 0; i < idxd->max_wqs; i++) { struct idxd_wq *wq =3D idxd->wqs[i]; =20 - if (wq->state =3D=3D IDXD_WQ_ENABLED) { - idxd_wq_disable_cleanup(wq); - wq->state =3D IDXD_WQ_DISABLED; - } + idxd_wq_disable_cleanup(wq); idxd_wq_device_reset_cleanup(wq); } }