Update for riscv64

Two patches applied:
  - 5d35634ecc.patch
    Upstreamed in v6.12, but not backported.
  - https://patchwork.kernel.org/project/linux-pci/patch/20240227103522.80915-23-minda.chen@starfivetech.com/mbox/
    Not approved upstream until more details are available.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2024-11-04 12:36:13 +02:00
parent c736c44067
commit 64cee184fa
Signed by: davidlt
GPG Key ID: 7A5F42FAF91FACC3
4 changed files with 290 additions and 21 deletions

View File

@ -61,6 +61,7 @@ CONFIG_ACPI_FFH=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_HED=y
CONFIG_ACPI_HMAT=y
CONFIG_ACPI_HOTPLUG_MEMORY=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_ACPI_IPMI=m
CONFIG_ACPI_NFIT=m
@ -959,7 +960,9 @@ CONFIG_CLK_KUNIT_TEST=m
CONFIG_CLK_SIFIVE_PRCI=y
CONFIG_CLK_SIFIVE=y
CONFIG_CLK_SOPHGO_CV1800=y
# CONFIG_CLK_SOPHGO_SG2042_PLL is not set
CONFIG_CLK_SOPHGO_SG2042_CLKGEN=y
CONFIG_CLK_SOPHGO_SG2042_PLL=y
CONFIG_CLK_SOPHGO_SG2042_RPGATE=y
# CONFIG_CLK_SP810 is not set
CONFIG_CLK_STARFIVE_JH7100_AUDIO=m
CONFIG_CLK_STARFIVE_JH7100=y
@ -1048,8 +1051,8 @@ CONFIG_CORTINA_PHY=m
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPUFREQ_DT=m
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
@ -1393,6 +1396,8 @@ CONFIG_DEV_DAX_HMEM=m
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_DEV_DAX=m
# CONFIG_DEV_DAX_PMEM_COMPAT is not set
CONFIG_DEV_DAX_PMEM=m
CONFIG_DEVICE_PRIVATE=y
CONFIG_DEVMEM=y
CONFIG_DEVPORT=y
CONFIG_DEVTMPFS_MOUNT=y
@ -3638,7 +3643,8 @@ CONFIG_MEMCPY_KUNIT_TEST=m
CONFIG_MEMCPY_SLOW_KUNIT_TEST=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
# CONFIG_MEMORY is not set
# CONFIG_MEMSTICK_DEBUG is not set
CONFIG_MEMSTICK_JMICRON_38X=m
@ -4728,6 +4734,8 @@ CONFIG_NULL_TTY=m
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_NUMA_BALANCING=y
CONFIG_NUMA=y
CONFIG_NVDIMM_DAX=y
CONFIG_NVDIMM_PFN=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
# CONFIG_NVHE_EL2_DEBUG is not set
CONFIG_NVIDIA_SHIELD_FF=y
@ -4909,7 +4917,7 @@ CONFIG_PCIE_MICROCHIP_HOST=y
# CONFIG_PCI_ENDPOINT_TEST is not set
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_PTM=y
# CONFIG_PCIE_STARFIVE_HOST is not set
CONFIG_PCIE_STARFIVE_HOST=y
CONFIG_PCIE_XILINX_CPM=y
CONFIG_PCIE_XILINX=y
# CONFIG_PCI_FTPCI100 is not set
@ -4982,7 +4990,7 @@ CONFIG_PHY_RTK_RTD_USB3PHY=m
# CONFIG_PHY_SAMSUNG_USB2 is not set
# CONFIG_PHYS_RAM_BASE_FIXED is not set
CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
# CONFIG_PHY_STARFIVE_JH7110_DPHY_TX is not set
CONFIG_PHY_STARFIVE_JH7110_DPHY_TX=m
CONFIG_PHY_STARFIVE_JH7110_PCIE=m
CONFIG_PHY_STARFIVE_JH7110_USB=m
# CONFIG_PHY_TUSB1210 is not set
@ -5724,9 +5732,9 @@ CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
# CONFIG_RUST_EXTRA_LOCKDEP is not set
CONFIG_RUST_FW_LOADER_ABSTRACTIONS=y
# CONFIG_RUST is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
CONFIG_RUST_PHYLIB_ABSTRACTIONS=y
CONFIG_RUST=y
CONFIG_RV_MON_WWNR=y
CONFIG_RV_REACTORS=y
CONFIG_RV_REACT_PANIC=y
@ -6219,7 +6227,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
# CONFIG_SERIAL_EARLYCON_RISCV_SBI is not set
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_FSL_LPUART is not set
@ -8095,7 +8103,7 @@ CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_BT848=m
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_CADENCE_CSI2RX is not set
CONFIG_VIDEO_CADENCE_CSI2RX=m
CONFIG_VIDEO_CADENCE_CSI2TX=m
# CONFIG_VIDEO_CADENCE is not set
# CONFIG_VIDEO_CAFE_CCIC is not set
@ -8553,6 +8561,7 @@ CONFIG_ZISOFS=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_DFLTCC=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZONE_DEVICE=y
CONFIG_ZONE_DMA=y
CONFIG_ZONEFS_FS=m
CONFIG_ZOPT2201=m

View File

@ -61,6 +61,7 @@ CONFIG_ACPI_FFH=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_HED=y
CONFIG_ACPI_HMAT=y
CONFIG_ACPI_HOTPLUG_MEMORY=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_ACPI_IPMI=m
CONFIG_ACPI_NFIT=m
@ -958,7 +959,9 @@ CONFIG_CLK_KUNIT_TEST=m
CONFIG_CLK_SIFIVE_PRCI=y
CONFIG_CLK_SIFIVE=y
CONFIG_CLK_SOPHGO_CV1800=y
# CONFIG_CLK_SOPHGO_SG2042_PLL is not set
CONFIG_CLK_SOPHGO_SG2042_CLKGEN=y
CONFIG_CLK_SOPHGO_SG2042_PLL=y
CONFIG_CLK_SOPHGO_SG2042_RPGATE=y
# CONFIG_CLK_SP810 is not set
CONFIG_CLK_STARFIVE_JH7100_AUDIO=m
CONFIG_CLK_STARFIVE_JH7100=y
@ -1047,8 +1050,8 @@ CONFIG_CORTINA_PHY=m
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPUFREQ_DT=m
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
@ -1384,6 +1387,8 @@ CONFIG_DEV_DAX_HMEM=m
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_DEV_DAX=m
# CONFIG_DEV_DAX_PMEM_COMPAT is not set
CONFIG_DEV_DAX_PMEM=m
CONFIG_DEVICE_PRIVATE=y
CONFIG_DEVMEM=y
CONFIG_DEVPORT=y
CONFIG_DEVTMPFS_MOUNT=y
@ -3612,7 +3617,8 @@ CONFIG_MEMCPY_KUNIT_TEST=m
CONFIG_MEMCPY_SLOW_KUNIT_TEST=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
# CONFIG_MEMORY is not set
# CONFIG_MEMSTICK_DEBUG is not set
CONFIG_MEMSTICK_JMICRON_38X=m
@ -4701,6 +4707,8 @@ CONFIG_NULL_TTY=m
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_NUMA_BALANCING=y
CONFIG_NUMA=y
CONFIG_NVDIMM_DAX=y
CONFIG_NVDIMM_PFN=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
# CONFIG_NVHE_EL2_DEBUG is not set
CONFIG_NVIDIA_SHIELD_FF=y
@ -4881,7 +4889,7 @@ CONFIG_PCIE_MICROCHIP_HOST=y
# CONFIG_PCI_ENDPOINT_TEST is not set
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_PTM=y
# CONFIG_PCIE_STARFIVE_HOST is not set
CONFIG_PCIE_STARFIVE_HOST=y
CONFIG_PCIE_XILINX_CPM=y
CONFIG_PCIE_XILINX=y
# CONFIG_PCI_FTPCI100 is not set
@ -4954,7 +4962,7 @@ CONFIG_PHY_RTK_RTD_USB3PHY=m
# CONFIG_PHY_SAMSUNG_USB2 is not set
# CONFIG_PHYS_RAM_BASE_FIXED is not set
CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
# CONFIG_PHY_STARFIVE_JH7110_DPHY_TX is not set
CONFIG_PHY_STARFIVE_JH7110_DPHY_TX=m
CONFIG_PHY_STARFIVE_JH7110_PCIE=m
CONFIG_PHY_STARFIVE_JH7110_USB=m
# CONFIG_PHY_TUSB1210 is not set
@ -5696,9 +5704,9 @@ CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
# CONFIG_RUST_EXTRA_LOCKDEP is not set
CONFIG_RUST_FW_LOADER_ABSTRACTIONS=y
# CONFIG_RUST is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
CONFIG_RUST_PHYLIB_ABSTRACTIONS=y
CONFIG_RUST=y
CONFIG_RV_MON_WWNR=y
CONFIG_RV_REACTORS=y
CONFIG_RV_REACT_PANIC=y
@ -6191,7 +6199,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
# CONFIG_SERIAL_EARLYCON_RISCV_SBI is not set
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_FSL_LPUART is not set
@ -8065,7 +8073,7 @@ CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_BT848=m
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_CADENCE_CSI2RX is not set
CONFIG_VIDEO_CADENCE_CSI2RX=m
CONFIG_VIDEO_CADENCE_CSI2TX=m
# CONFIG_VIDEO_CADENCE is not set
# CONFIG_VIDEO_CAFE_CCIC is not set
@ -8523,6 +8531,7 @@ CONFIG_ZISOFS=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_DFLTCC=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZONE_DEVICE=y
CONFIG_ZONE_DMA=y
CONFIG_ZONEFS_FS=m
CONFIG_ZOPT2201=m

View File

@ -169,7 +169,7 @@ Summary: The Linux kernel
# This is needed to do merge window version magic
%define patchlevel 11
# This allows pkg_release to have configurable %%{?dist} tag
%define specrelease 300%{?buildid}%{?dist}
%define specrelease 300%{?buildid}.0.riscv64%{?dist}
# This defines the kabi tarball version
%define kabiversion 6.11.6
@ -592,9 +592,9 @@ Summary: The Linux kernel
# Architectures we build tools/cpupower on
%if 0%{?fedora}
%define cpupowerarchs %{ix86} x86_64 ppc64le aarch64
%define cpupowerarchs %{ix86} x86_64 ppc64le aarch64 riscv64
%else
%define cpupowerarchs i686 x86_64 ppc64le aarch64
%define cpupowerarchs i686 x86_64 ppc64le aarch64 riscv64
%endif
# Architectures we build kernel livepatching selftests on
@ -4128,6 +4128,9 @@ fi\
#
#
%changelog
* Mon Nov 04 2024 David Abdurachmanov <davidlt@rivosinc.com> [6.11.6-0.0.riscv64]
- Update for riscv64
* Fri Nov 01 2024 Augusto Caringi <acaringi@redhat.com> [6.11.6-0]
- Linux v6.11.6

View File

@ -0,0 +1,248 @@
From 5d35634ecc2d2c3938bd7dc23df0ad046da1b303 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jslaby@suse.cz>
Date: Tue, 22 Oct 2024 17:22:36 -0300
Subject: [PATCH] perf trace: Fix non-listed archs in the syscalltbl routines
This fixes a build breakage on 32-bit arm, where the
syscalltbl__id_at_idx() function was missing.
Committer notes:
Generating a proper syscall table from a copy of
arch/arm/tools/syscall.tbl ends up being too big a patch for this rc
stage, I started doing it but while testing noticed some other problems
with using BPF to collect pointer args on arm7 (32-bit) will maybe
continue trying to make it work on the next cycle...
Fixes: 7a2fb5619cc1fb53 ("perf trace: Fix iteration of syscall ids in syscalltbl->entries")
Suggested-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: <jslaby@suse.cz>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/lkml/3a592835-a14f-40be-8961-c0cee7720a94@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/syscalltbl.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 7c15dec6900d8a..6c45ded922b6d5 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -46,6 +46,11 @@ static const char *const *syscalltbl_native = syscalltbl_mips_n64;
#include <asm/syscalls.c>
const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID;
static const char *const *syscalltbl_native = syscalltbl_loongarch;
+#else
+const int syscalltbl_native_max_id = 0;
+static const char *const syscalltbl_native[] = {
+ [0] = "unknown",
+};
#endif
struct syscall {
@@ -182,6 +187,11 @@ int syscalltbl__id(struct syscalltbl *tbl, const char *name)
return audit_name_to_syscall(name, tbl->audit_machine);
}
+int syscalltbl__id_at_idx(struct syscalltbl *tbl __maybe_unused, int idx)
+{
+ return idx;
+}
+
int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused,
const char *syscall_glob __maybe_unused, int *idx __maybe_unused)
{
From patchwork Tue Feb 27 10:35:21 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Minda Chen <minda.chen@starfivetech.com>
X-Patchwork-Id: 13573559
Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn
(mail-bjschn02on2135.outbound.protection.partner.outlook.cn [139.219.17.135])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94537139579;
Tue, 27 Feb 2024 11:11:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=fail smtp.client-ip=139.219.17.135
ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1709032275; cv=fail;
b=s9nV/rt/Ex8Z5/LYusFRed4Lx8KAeR69MPH+3rOkXA+oFAkCJuJT9qikvbKQhbNB5G+gk1eWqxjTdruUEKfC2jj/tS2O8FTnUvWmioqByEynspoUBI8026yKas8N3jmDhQHlAf0CtWkNouhKHaHkMoiLuhv6ryXjuyzv8j6Dzu0=
ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1709032275; c=relaxed/simple;
bh=b4OZOSD25+5sI02YP7Nrkijs+dPDSqP3Lz3dA2/96Pc=;
h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
Content-Type:MIME-Version;
b=fcCvRPer2WJW/4e0j85LSqwFoh4pdve/d29PwzrzjQ6MDmEj9QZ0H9IdFqr/N6Z25NKaRTLRGkHkwj2gTqdgSGGJJJpSnJ92DMZSOlSU9sfIzndoMru4QYYAaZNW/OkGl3S2wY6JdPGUg8zQH3lX/4Vf5t9CSUydwmfDdAxfC9s=
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=none (p=none dis=none) header.from=starfivetech.com;
spf=pass smtp.mailfrom=starfivetech.com;
arc=fail smtp.client-ip=139.219.17.135
Authentication-Results: smtp.subspace.kernel.org;
dmarc=none (p=none dis=none) header.from=starfivetech.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=starfivetech.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=WHsuYgLPP+/qmA/+R6jGjAIUjzPw4opqEOV18DzmFF/O1SeUtAO8L9x9rxZY6eF0zCMirOoVsKuGwv+ttVvuj+iX6qrr4G3YxXhnnkEo8onkJh+aPlY1IYVAoExIG5tEfbV2NfN1QQQsy9g4re8CvwTjuUW62BSWV3HMbTAVR3Vxav17GZAwvwlIbyVfK11QLd1Hc2Xlp14dxAMsFT4n7CRG11fccbzUf6CQKJREikDykE64KQ9B/OssgBOwsVgoyVV6VYXrf8hP6YR3r1wwQdV/vmyD3BWGl45tYc/fmmyzawK5x/yep2rfN1EhRYLodMTil07vsC015edac/hqeQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=yGwEVnjesGyg+IGj8N8t8tCwaLr08GpiDbq+vLxRUQ8=;
b=FRMMsmSvy9C27Z87It+gwkCZ+p5TaWW20KFaDRAnLyLJwHkegabL07o/b52039QzG/wiqT7YOKZOBMDarQqV5o9a29CpoybdHVYPlAEfusmje+Fr1pOBKsMuwnTXAOy1NzVsF3PhYFuEKpa+LDYMAPgbxfk/wM3Ad6sEdJ46mM8uPxEmOG2mW+1SOJGM/AalKX7IPVrfc7ugXiURNaQa4PgpHLwgX0ul9zMDyx9+byAcsskQDoO/wKfmsrGRKCMT6Dq8QhLoP+NV6j9Y0siK/tDBP4urJg7DcUH8LwWLHqYIld4DQvegD7WWd9VagDhwsbjZLNx2aYljudol8ow0vg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=starfivetech.com; dmarc=pass action=none
header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=starfivetech.com;
Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn
(2406:e500:c311:25::15) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn
(2406:e500:c311:25::15) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.47; Tue, 27 Feb
2024 10:35:52 +0000
Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn
([fe80::5a5a:fa59:15fd:63dc]) by
SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::5a5a:fa59:15fd:63dc%3])
with mapi id 15.20.7270.047; Tue, 27 Feb 2024 10:35:52 +0000
From: Minda Chen <minda.chen@starfivetech.com>
To: Conor Dooley <conor@kernel.org>,
=?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>,
Rob Herring <robh+dt@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Daire McNamara <daire.mcnamara@microchip.com>,
Emil Renner Berthing <emil.renner.berthing@canonical.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org,
linux-pci@vger.kernel.org,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mason Huo <mason.huo@starfivetech.com>,
Leyfoon Tan <leyfoon.tan@starfivetech.com>,
Kevin Xie <kevin.xie@starfivetech.com>,
Minda Chen <minda.chen@starfivetech.com>
Subject: [PATCH v15,RESEND 22/23] PCI: starfive: Offload the NVMe timeout
workaround to host drivers.
Date: Tue, 27 Feb 2024 18:35:21 +0800
Message-Id: <20240227103522.80915-23-minda.chen@starfivetech.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20240227103522.80915-1-minda.chen@starfivetech.com>
References: <20240227103522.80915-1-minda.chen@starfivetech.com>
X-ClientProxiedBy: NT0PR01CA0003.CHNPR01.prod.partner.outlook.cn
(2406:e500:c510::15) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn
(2406:e500:c311:25::15)
Precedence: bulk
X-Mailing-List: linux-pci@vger.kernel.org
List-Id: <linux-pci.vger.kernel.org>
List-Subscribe: <mailto:linux-pci+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-pci+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_
X-MS-Office365-Filtering-Correlation-Id: e8c49661-21f3-486e-017e-08dc377fdef2
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
q7fbERTA0VzLvOUyVBYR8WMrAvU5OPQJhex/7IRjoZ/m4LRkrnFVldLkFLcaEhobgmaNNieen7pxHtr7kGg7+YpOrknHTv/iKPW9o+MISBFRJddw+f24fKZXzKH81uTtQ2MtNGuCz8Ca3TUtZa77ykXAp2dmkuRrMg/M7LwL/ZhS+AQZRSgCG1Jh0td3ugenjsScykca3hnfAFGsOP0puVvr34nicphWG3yJOAa67pTm7wG+7vluD1B6ATsvWvp6DQF/3yviJSUTptE5bdrNXRqEAbEtY0EL2+to+WUOLa2beUZCGW0+Gd8aQsfnc79w4nHKqxMN7H2E6WWOH8WbzY8rMY27w4weZu33fo2ezENc1RM1C6p4HXwPAy3FnvXd/E2F9tZg0f6HI+ds2hCbAbnGMVjUk9WR+XknPbnup+pfuLZEgA92X7doVYx0M2UUkbjRdkNUQimTkj5f0+izHfJrCVyuZ3a6wN3DAb0RhT0MEv3Zpm8erjZ6VxtHDddZTXHvs4p+1Q1SYA01SMrtS+SUAhBh8rD9O6n/RN+3umGfuDnUjmZuggtWtxUcyxi3fMyPgd3SAj8LqkYhvmnU77BSISIUYwzbQXJLr1KaXH74ivV+PQVLlCg8iR5mvBdL
X-Forefront-Antispam-Report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(38350700005);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
Pyf7fz9uvlxgVqrAzGu/DOkJUoQlVZ757BfMvr+fC26AtWQ59XNAOlmvHZ5U1V6WkeB0nZYch4GH1dJim0mi1ClvaBhC3g5Y1k1MwpG+xnYcMubZv08GZ9RiQoY1q0WMMzIxL7Vv2g2F+mOzv4kk5UZGhJCjGKb7LBT9MAmNVsgaYR8m/e8/CvQ4LSLy3eIY16ZWzPeUSYe29TD/wGYUSe95q94C1gBeCoUD3EzUbPkRRxU8i1fvzgVnp5nXQUbMdIuPQ2DfZjO0OD42bg8q0w6m0VU31s2FT6P3z7hbLfVkAk2MVSOCsZlphi7FL/vpe4rlUs0IBZxAVyVXH5a6EbINX6jJzmGwDXn/Uv3aGoYR4EabkUUQqyaDDEITt+YNn+ajxMvrKqb92Xmr1/khDrhSXRJ7qo/kUon0KSqWgVDHW5cm/svfJ5/I9jddW0eQoGJDovxbuRncA3EpGTMP298MwYvsEdL2/n1aU/DlZKbQi7ytsl9SyHs8J+Hqc4Ybmg1I40agN8mopZu19Clqrp95nhXThVRQfvV4iWwxnHwGSWNdlU7tJl7ZgJNRKDCxfXRchefsFsleCXhhstKnY5CwbUMr6M1kBMb66EfmIhqLo611R6EFi+jucmQxyt3tIi4fn3l/b6q26c60sRIj9yZmPwPScKOzTi1BvHBSuo4EBDaUgNOD9HmasqJYG8DTiD6wiaUTUbz/IzCvFDNMHIyacPeWt6E8P56Gh2MzSJBYGS6/8bsX4gA7Tp+SLXBmzmHpzQubw1XUjQCSFOrE1lMA5HfrVhQOmIB4hi05MWSlvqKP+2ZxVva4NnqQ3H44RgwQe5/psySmD0QBug3P1qg8qUUgc7XWoCzn8rkH6da0FqgzKfM8Fpm35hHpWQhgmsVgqmxwOFivYSENAs/qfmu3f1rqFQBiBbwKkMCKv0Fu6QkrCJ+eoJcQVlCEkN97/ZrtW7et2mmqF+ze1ujrLagiFBhME+x8T9Ogxz4axoWml8LuP/LRjqO/i/VoxvaCKIBhSdg/mDzQaMeqV24s8yKJsgQ33e9fEVjiwbDz5aBt1L5kxAuBtWYPf4+YlT3GkYI53ds81AdmPuYMvr8X/QJKyzC548+DtAIGcQm2DoGWDevz1yQaDvB7eUsEm63y87oaZ3CN8O6m+y+bTB81xjt3gJMUNuXN0TFBX9geym7wFq6UKIk0FgKmfrR8aVYfP2GFM5K2LrqR4gR6pNYEGNvchd0YyOpdPsAv8BVa5lCtl32PdNuze5tKM9o3WRv9VovBTfs4NTRjzUE+mX4KHmjZqCvMwayu8kTSgAEyo2hvGWRH7xN64G1OIFNGsGMq2fb3oImSANgDw4fCyrKs2NLjHAK+4I4JT1rPGYS8SMErMTrKs+7Qb4gm5NwmrNQbpaUPBGgmcyL8q2znFBSHj7LzgPcv3rPKPMs73QJIkpWgJgfW3o8o+PYTnyP6hb25/zEeht5hVkOBQoyHTQc1GIF3UvLvahzgXb7ffcxB1nQG5KIZKKNUKY9vFFRjblZr/l00uJo722YDSKr43Z20UjARbHS55N78J17reNO1P2E6lvA9/2M5CEwHj0kr9si7zlR+NcyYX3vPHlMp/aGqSw==
X-OriginatorOrg: starfivetech.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
e8c49661-21f3-486e-017e-08dc377fdef2
X-MS-Exchange-CrossTenant-AuthSource:
SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 10:35:52.1693
(UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName:
CsbLUkwtaPPwweU0AhqQRx7T5ln6i76bpcn+jZGsjyKdpcKb3PTeC+cqMTMwueuC8ha9f253SCIiggjdjZGHJY3f8CKLTx5uUTGWqKRMy7g=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0863
From: Kevin Xie <kevin.xie@starfivetech.com>
As the Starfive JH7110 hardware can't keep two inbound post write in
order all the time, such as MSI messages and NVMe completions. If the
NVMe completion update later than the MSI, an NVMe IRQ handle will miss.
As a workaround, we will wait a while before going to the generic
handle here.
Verified with NVMe SSD, USB SSD, R8169 NIC.
The performance are stable and even higher after this patch.
Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com>
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
drivers/pci/controller/plda/pcie-plda-host.c | 12 ++++++++++++
drivers/pci/controller/plda/pcie-plda.h | 1 +
drivers/pci/controller/plda/pcie-starfive.c | 1 +
3 files changed, 14 insertions(+)
diff --git a/drivers/pci/controller/plda/pcie-plda-host.c b/drivers/pci/controller/plda/pcie-plda-host.c
index a18923d7cea6..9e077ddf45c0 100644
--- a/drivers/pci/controller/plda/pcie-plda-host.c
+++ b/drivers/pci/controller/plda/pcie-plda-host.c
@@ -13,6 +13,7 @@
#include <linux/msi.h>
#include <linux/pci_regs.h>
#include <linux/pci-ecam.h>
+#include <linux/delay.h>
#include "pcie-plda.h"
@@ -44,6 +45,17 @@ static void plda_handle_msi(struct irq_desc *desc)
bridge_base_addr + ISTATUS_LOCAL);
status = readl_relaxed(bridge_base_addr + ISTATUS_MSI);
for_each_set_bit(bit, &status, msi->num_vectors) {
+ /*
+ * As the Starfive JH7110 hardware can't keep two
+ * inbound post write in order all the time, such as
+ * MSI messages and NVMe completions.
+ * If the NVMe completion update later than the MSI,
+ * an NVMe IRQ handle will miss.
+ * As a workaround, we will wait a while before
+ * going to the generic handle here.
+ */
+ if (port->msi_quirk_delay_us)
+ udelay(port->msi_quirk_delay_us);
ret = generic_handle_domain_irq(msi->dev_domain, bit);
if (ret)
dev_err_ratelimited(dev, "bad MSI IRQ %d\n",
diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h
index 04e385758a2f..feccf285dfe8 100644
--- a/drivers/pci/controller/plda/pcie-plda.h
+++ b/drivers/pci/controller/plda/pcie-plda.h
@@ -186,6 +186,7 @@ struct plda_pcie_rp {
int msi_irq;
int intx_irq;
int num_events;
+ u16 msi_quirk_delay_us;
};
struct plda_event {
diff --git a/drivers/pci/controller/plda/pcie-starfive.c b/drivers/pci/controller/plda/pcie-starfive.c
index 9bb9f0e29565..5cfc30572b7f 100644
--- a/drivers/pci/controller/plda/pcie-starfive.c
+++ b/drivers/pci/controller/plda/pcie-starfive.c
@@ -391,6 +391,7 @@ static int starfive_pcie_probe(struct platform_device *pdev)
plda->host_ops = &sf_host_ops;
plda->num_events = PLDA_MAX_EVENT_NUM;
+ plda->msi_quirk_delay_us = 1;
/* mask doorbell event */
plda->events_bitmap = GENMASK(PLDA_INT_EVENT_NUM - 1, 0)
& ~BIT(PLDA_AXI_DOORBELL)