]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Nov 2021 15:39:39 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Nov 2021 15:39:39 +0000 (16:39 +0100)
added patches:
pci-add-pci_exp_devctl_payload_-macros.patch
sunrpc-partial-revert-of-commit-6f9f17287e78.patch

queue-5.4/pci-add-pci_exp_devctl_payload_-macros.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/sunrpc-partial-revert-of-commit-6f9f17287e78.patch [new file with mode: 0644]

diff --git a/queue-5.4/pci-add-pci_exp_devctl_payload_-macros.patch b/queue-5.4/pci-add-pci_exp_devctl_payload_-macros.patch
new file mode 100644 (file)
index 0000000..e316828
--- /dev/null
@@ -0,0 +1,41 @@
+From 460275f124fb072dca218a6b43b6370eebbab20d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
+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 <pali@kernel.org>
+
+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 <pali@kernel.org>
+Signed-off-by: Marek Behún <kabel@kernel.org>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Reviewed-by: Marek Behún <kabel@kernel.org>
+Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -502,6 +502,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 */
index 08e2f4d0c59e3388c93b6391e2dde7b9183befb5..5e0771555a93c72b5f28445e40f69690dd044485 100644 (file)
@@ -351,3 +351,5 @@ s390-cio-check-the-subchannel-validity-for-dev_busid.patch
 s390-tape-fix-timer-initialization-in-tape_std_assign.patch
 s390-cio-make-ccw_device_dma_-more-robust.patch
 powerpc-powernv-prd-unregister-opal_msg_prd2-notifier-during-module-unload.patch
+pci-add-pci_exp_devctl_payload_-macros.patch
+sunrpc-partial-revert-of-commit-6f9f17287e78.patch
diff --git a/queue-5.4/sunrpc-partial-revert-of-commit-6f9f17287e78.patch b/queue-5.4/sunrpc-partial-revert-of-commit-6f9f17287e78.patch
new file mode 100644 (file)
index 0000000..4f53cd8
--- /dev/null
@@ -0,0 +1,71 @@
+From ea7a1019d8baf8503ecd6e3ec8436dec283569e6 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 12 Jul 2021 09:52:59 -0400
+Subject: SUNRPC: Partial revert of commit 6f9f17287e78
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+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 <trond.myklebust@hammerspace.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sunrpc/xprt.c |   28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+--- a/net/sunrpc/xprt.c
++++ b/net/sunrpc/xprt.c
+@@ -1538,15 +1538,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);
+@@ -1554,13 +1553,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);
+ }