From: Greg Kroah-Hartman Date: Mon, 15 Nov 2021 15:40:37 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v5.4.160~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03af7745988ef53819414e427afce4cb4185dcc0;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: pci-aardvark-fix-pcie-max-payload-size-setting.patch pci-add-pci_exp_devctl_payload_-macros.patch sunrpc-partial-revert-of-commit-6f9f17287e78.patch --- diff --git a/queue-5.15/pci-aardvark-fix-pcie-max-payload-size-setting.patch b/queue-5.15/pci-aardvark-fix-pcie-max-payload-size-setting.patch new file mode 100644 index 00000000000..c8c47489699 --- /dev/null +++ b/queue-5.15/pci-aardvark-fix-pcie-max-payload-size-setting.patch @@ -0,0 +1,50 @@ +From a4e17d65dafdd3513042d8f00404c9b6068a825c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Tue, 5 Oct 2021 20:09:41 +0200 +Subject: PCI: aardvark: Fix PCIe Max Payload Size setting +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit a4e17d65dafdd3513042d8f00404c9b6068a825c upstream. + +Change PCIe Max Payload Size setting in PCIe Device Control register to 512 +bytes to align with PCIe Link Initialization sequence as defined in Marvell +Armada 3700 Functional Specification. According to the specification, +maximal Max Payload Size supported by this device is 512 bytes. + +Without this kernel prints suspicious line: + + pci 0000:01:00.0: Upstream bridge's Max Payload Size set to 256 (was 16384, max 512) + +With this change it changes to: + + pci 0000:01:00.0: Upstream bridge's Max Payload Size set to 256 (was 512, max 512) + +Link: https://lore.kernel.org/r/20211005180952.6812-3-kabel@kernel.org +Fixes: 8c39d710363c ("PCI: aardvark: Add Aardvark PCI host controller driver") +Signed-off-by: Pali Rohár +Signed-off-by: Marek Behún +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Marek Behún +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/controller/pci-aardvark.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -597,8 +597,9 @@ static void advk_pcie_setup_hw(struct ad + reg = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + PCI_EXP_DEVCTL); + reg &= ~PCI_EXP_DEVCTL_RELAX_EN; + reg &= ~PCI_EXP_DEVCTL_NOSNOOP_EN; ++ reg &= ~PCI_EXP_DEVCTL_PAYLOAD; + reg &= ~PCI_EXP_DEVCTL_READRQ; +- reg |= PCI_EXP_DEVCTL_PAYLOAD; /* Set max payload size */ ++ reg |= PCI_EXP_DEVCTL_PAYLOAD_512B; + reg |= PCI_EXP_DEVCTL_READRQ_512B; + advk_writel(pcie, reg, PCIE_CORE_PCIEXP_CAP + PCI_EXP_DEVCTL); + diff --git a/queue-5.15/pci-add-pci_exp_devctl_payload_-macros.patch b/queue-5.15/pci-add-pci_exp_devctl_payload_-macros.patch new file mode 100644 index 00000000000..7a78198617a --- /dev/null +++ b/queue-5.15/pci-add-pci_exp_devctl_payload_-macros.patch @@ -0,0 +1,41 @@ +From 460275f124fb072dca218a6b43b6370eebbab20d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Tue, 5 Oct 2021 20:09:40 +0200 +Subject: PCI: Add PCI_EXP_DEVCTL_PAYLOAD_* macros +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit 460275f124fb072dca218a6b43b6370eebbab20d upstream. + +Define a macro PCI_EXP_DEVCTL_PAYLOAD_* for every possible Max Payload +Size in linux/pci_regs.h, in the same style as PCI_EXP_DEVCTL_READRQ_*. + +Link: https://lore.kernel.org/r/20211005180952.6812-2-kabel@kernel.org +Signed-off-by: Pali Rohár +Signed-off-by: Marek Behún +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Marek Behún +Reviewed-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/pci_regs.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/include/uapi/linux/pci_regs.h ++++ b/include/uapi/linux/pci_regs.h +@@ -504,6 +504,12 @@ + #define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ + #define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */ + #define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ ++#define PCI_EXP_DEVCTL_PAYLOAD_128B 0x0000 /* 128 Bytes */ ++#define PCI_EXP_DEVCTL_PAYLOAD_256B 0x0020 /* 256 Bytes */ ++#define PCI_EXP_DEVCTL_PAYLOAD_512B 0x0040 /* 512 Bytes */ ++#define PCI_EXP_DEVCTL_PAYLOAD_1024B 0x0060 /* 1024 Bytes */ ++#define PCI_EXP_DEVCTL_PAYLOAD_2048B 0x0080 /* 2048 Bytes */ ++#define PCI_EXP_DEVCTL_PAYLOAD_4096B 0x00a0 /* 4096 Bytes */ + #define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ + #define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ + #define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ diff --git a/queue-5.15/series b/queue-5.15/series index a9efc658a70..6a836682d66 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -911,3 +911,6 @@ powerpc-64s-interrupt-fix-check_return_regs_valid-false-positive.patch powerpc-pseries-mobility-ignore-ibm-platform-facilities-updates.patch powerpc-85xx-fix-timebase-sync-issue-when-config_hotplug_cpu-n.patch drm-sun4i-fix-macros-in-sun8i_csc.h.patch +pci-add-pci_exp_devctl_payload_-macros.patch +pci-aardvark-fix-pcie-max-payload-size-setting.patch +sunrpc-partial-revert-of-commit-6f9f17287e78.patch diff --git a/queue-5.15/sunrpc-partial-revert-of-commit-6f9f17287e78.patch b/queue-5.15/sunrpc-partial-revert-of-commit-6f9f17287e78.patch new file mode 100644 index 00000000000..bb31976fab2 --- /dev/null +++ b/queue-5.15/sunrpc-partial-revert-of-commit-6f9f17287e78.patch @@ -0,0 +1,71 @@ +From ea7a1019d8baf8503ecd6e3ec8436dec283569e6 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 12 Jul 2021 09:52:59 -0400 +Subject: SUNRPC: Partial revert of commit 6f9f17287e78 + +From: Trond Myklebust + +commit ea7a1019d8baf8503ecd6e3ec8436dec283569e6 upstream. + +The premise of commit 6f9f17287e78 ("SUNRPC: Mitigate cond_resched() in +xprt_transmit()") was that cond_resched() is expensive and unnecessary +when there has been just a single send. +The point of cond_resched() is to ensure that tasks that should pre-empt +this one get a chance to do so when it is safe to do so. The code prior +to commit 6f9f17287e78 failed to take into account that it was keeping a +rpc_task pinned for longer than it needed to, and so rather than doing a +full revert, let's just move the cond_resched. + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman +--- + net/sunrpc/xprt.c | 28 +++++++++++++++------------- + 1 file changed, 15 insertions(+), 13 deletions(-) + +--- a/net/sunrpc/xprt.c ++++ b/net/sunrpc/xprt.c +@@ -1603,15 +1603,14 @@ xprt_transmit(struct rpc_task *task) + { + struct rpc_rqst *next, *req = task->tk_rqstp; + struct rpc_xprt *xprt = req->rq_xprt; +- int counter, status; ++ int status; + + spin_lock(&xprt->queue_lock); +- counter = 0; +- while (!list_empty(&xprt->xmit_queue)) { +- if (++counter == 20) ++ for (;;) { ++ next = list_first_entry_or_null(&xprt->xmit_queue, ++ struct rpc_rqst, rq_xmit); ++ if (!next) + break; +- next = list_first_entry(&xprt->xmit_queue, +- struct rpc_rqst, rq_xmit); + xprt_pin_rqst(next); + spin_unlock(&xprt->queue_lock); + status = xprt_request_transmit(next, task); +@@ -1619,13 +1618,16 @@ xprt_transmit(struct rpc_task *task) + status = 0; + spin_lock(&xprt->queue_lock); + xprt_unpin_rqst(next); +- if (status == 0) { +- if (!xprt_request_data_received(task) || +- test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) +- continue; +- } else if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) +- task->tk_status = status; +- break; ++ if (status < 0) { ++ if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) ++ task->tk_status = status; ++ break; ++ } ++ /* Was @task transmitted, and has it received a reply? */ ++ if (xprt_request_data_received(task) && ++ !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) ++ break; ++ cond_resched_lock(&xprt->queue_lock); + } + spin_unlock(&xprt->queue_lock); + }