From: Greg Kroah-Hartman Date: Sat, 22 Apr 2023 15:32:57 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.14.314~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44e86fd7932c305ff16313014e4f2137bcf0f682;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: powerpc-doc-fix-htmldocs-errors.patch pwm-meson-explicitly-set-.polarity-in-.get_state.patch xfs-drop-submit-side-trans-alloc-for-append-ioends.patch --- diff --git a/queue-5.10/powerpc-doc-fix-htmldocs-errors.patch b/queue-5.10/powerpc-doc-fix-htmldocs-errors.patch new file mode 100644 index 00000000000..6ecf352b080 --- /dev/null +++ b/queue-5.10/powerpc-doc-fix-htmldocs-errors.patch @@ -0,0 +1,88 @@ +From f50da6edbf1ebf35dd8070847bfab5cb988d472b Mon Sep 17 00:00:00 2001 +From: "Aneesh Kumar K.V" +Date: Wed, 25 Aug 2021 09:54:47 +0530 +Subject: powerpc/doc: Fix htmldocs errors + +From: Aneesh Kumar K.V + +commit f50da6edbf1ebf35dd8070847bfab5cb988d472b upstream. + +Fix make htmldocs related errors with the newly added associativity.rst +doc file. + +Reported-by: Stephen Rothwell +Tested-by: Stephen Rothwell # build test +Signed-off-by: Aneesh Kumar K.V +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210825042447.106219-1-aneesh.kumar@linux.ibm.com +Cc: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/powerpc/associativity.rst | 29 +++++++++++++++-------------- + Documentation/powerpc/index.rst | 1 + + 2 files changed, 16 insertions(+), 14 deletions(-) + +--- a/Documentation/powerpc/associativity.rst ++++ b/Documentation/powerpc/associativity.rst +@@ -1,6 +1,6 @@ + ============================ + NUMA resource associativity +-============================= ++============================ + + Associativity represents the groupings of the various platform resources into + domains of substantially similar mean performance relative to resources outside +@@ -20,11 +20,11 @@ A value of 1 indicates the usage of Form + bit 2 of byte 5 in the "ibm,architecture-vec-5" property is used. + + Form 0 +------ ++------ + Form 0 associativity supports only two NUMA distances (LOCAL and REMOTE). + + Form 1 +------ ++------ + With Form 1 a combination of ibm,associativity-reference-points, and ibm,associativity + device tree properties are used to determine the NUMA distance between resource groups/domains. + +@@ -78,17 +78,18 @@ numa-lookup-index-table. + + For ex: + ibm,numa-lookup-index-table = <3 0 8 40>; +-ibm,numa-distace-table = <9>, /bits/ 8 < 10 20 80 +- 20 10 160 +- 80 160 10>; +- | 0 8 40 +---|------------ +- | +-0 | 10 20 80 +- | +-8 | 20 10 160 +- | +-40| 80 160 10 ++ibm,numa-distace-table = <9>, /bits/ 8 < 10 20 80 20 10 160 80 160 10>; ++ ++:: ++ ++ | 0 8 40 ++ --|------------ ++ | ++ 0 | 10 20 80 ++ | ++ 8 | 20 10 160 ++ | ++ 40| 80 160 10 + + A possible "ibm,associativity" property for resources in node 0, 8 and 40 + +--- a/Documentation/powerpc/index.rst ++++ b/Documentation/powerpc/index.rst +@@ -7,6 +7,7 @@ powerpc + .. toctree:: + :maxdepth: 1 + ++ associativity + booting + bootwrapper + cpu_families diff --git a/queue-5.10/pwm-meson-explicitly-set-.polarity-in-.get_state.patch b/queue-5.10/pwm-meson-explicitly-set-.polarity-in-.get_state.patch new file mode 100644 index 00000000000..f138060a22c --- /dev/null +++ b/queue-5.10/pwm-meson-explicitly-set-.polarity-in-.get_state.patch @@ -0,0 +1,62 @@ +From 8caa81eb950cb2e9d2d6959b37d853162d197f57 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Wed, 22 Mar 2023 22:45:44 +0100 +Subject: pwm: meson: Explicitly set .polarity in .get_state() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit 8caa81eb950cb2e9d2d6959b37d853162d197f57 upstream. + +The driver only supports normal polarity. Complete the implementation of +.get_state() by setting .polarity accordingly. + +This fixes a regression that was possible since commit c73a3107624d +("pwm: Handle .get_state() failures") which stopped to zero-initialize +the state passed to the .get_state() callback. This was reported at +https://forum.odroid.com/viewtopic.php?f=177&t=46360 . While this was an +unintended side effect, the real issue is the driver's callback not +setting the polarity. + +There is a complicating fact, that the .apply() callback fakes support +for inversed polarity. This is not (and cannot) be matched by +.get_state(). As fixing this isn't easy, only point it out in a comment +to prevent authors of other drivers from copying that approach. + +Fixes: c375bcbaabdb ("pwm: meson: Read the full hardware state in meson_pwm_get_state()") +Reported-by: Munehisa Kamata +Acked-by: Martin Blumenstingl +Link: https://lore.kernel.org/r/20230310191405.2606296-1-u.kleine-koenig@pengutronix.de +Signed-off-by: Uwe Kleine-König +Signed-off-by: Thierry Reding +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pwm/pwm-meson.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/pwm/pwm-meson.c ++++ b/drivers/pwm/pwm-meson.c +@@ -168,6 +168,12 @@ static int meson_pwm_calc(struct meson_p + duty = state->duty_cycle; + period = state->period; + ++ /* ++ * Note this is wrong. The result is an output wave that isn't really ++ * inverted and so is wrongly identified by .get_state as normal. ++ * Fixing this needs some care however as some machines might rely on ++ * this. ++ */ + if (state->polarity == PWM_POLARITY_INVERSED) + duty = period - duty; + +@@ -304,6 +310,8 @@ static int meson_pwm_apply(struct pwm_ch + meson_pwm_enable(meson, pwm); + } + ++ state->polarity = PWM_POLARITY_NORMAL; ++ + return 0; + } + diff --git a/queue-5.10/series b/queue-5.10/series index 72cd4724671..7e44199f179 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -25,3 +25,6 @@ net-dsa-b53-mmap-add-phy-ops.patch s390-ptrace-fix-ptrace_get_last_break-error-handling.patch nvme-tcp-fix-a-possible-uaf-when-failing-to-allocate.patch xen-netback-use-same-error-messages-for-same-errors.patch +powerpc-doc-fix-htmldocs-errors.patch +pwm-meson-explicitly-set-.polarity-in-.get_state.patch +xfs-drop-submit-side-trans-alloc-for-append-ioends.patch diff --git a/queue-5.10/xfs-drop-submit-side-trans-alloc-for-append-ioends.patch b/queue-5.10/xfs-drop-submit-side-trans-alloc-for-append-ioends.patch new file mode 100644 index 00000000000..977fc9bfc8a --- /dev/null +++ b/queue-5.10/xfs-drop-submit-side-trans-alloc-for-append-ioends.patch @@ -0,0 +1,139 @@ +From 7cd3099f4925d7c15887d1940ebd65acd66100f5 Mon Sep 17 00:00:00 2001 +From: Brian Foster +Date: Fri, 9 Apr 2021 10:27:43 -0700 +Subject: xfs: drop submit side trans alloc for append ioends + +From: Brian Foster + +commit 7cd3099f4925d7c15887d1940ebd65acd66100f5 upstream. + +Per-inode ioend completion batching has a log reservation deadlock +vector between preallocated append transactions and transactions +that are acquired at completion time for other purposes (i.e., +unwritten extent conversion or COW fork remaps). For example, if the +ioend completion workqueue task executes on a batch of ioends that +are sorted such that an append ioend sits at the tail, it's possible +for the outstanding append transaction reservation to block +allocation of transactions required to process preceding ioends in +the list. + +Append ioend completion is historically the common path for on-disk +inode size updates. While file extending writes may have completed +sometime earlier, the on-disk inode size is only updated after +successful writeback completion. These transactions are preallocated +serially from writeback context to mitigate concurrency and +associated log reservation pressure across completions processed by +multi-threaded workqueue tasks. + +However, now that delalloc blocks unconditionally map to unwritten +extents at physical block allocation time, size updates via append +ioends are relatively rare. This means that inode size updates most +commonly occur as part of the preexisting completion time +transaction to convert unwritten extents. As a result, there is no +longer a strong need to preallocate size update transactions. + +Remove the preallocation of inode size update transactions to avoid +the ioend completion processing log reservation deadlock. Instead, +continue to send all potential size extending ioends to workqueue +context for completion and allocate the transaction from that +context. This ensures that no outstanding log reservation is owned +by the ioend completion worker task when it begins to process +ioends. + +Signed-off-by: Brian Foster +Reviewed-by: Christoph Hellwig +Reviewed-by: Darrick J. Wong +Signed-off-by: Darrick J. Wong +Reported-by: Christian Theune +Link: https://lore.kernel.org/linux-xfs/CAOQ4uxjj2UqA0h4Y31NbmpHksMhVrXfXjLG4Tnz3zq_UR-3gSA@mail.gmail.com/ +Signed-off-by: Amir Goldstein +Acked-by: Darrick J. Wong +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_aops.c | 45 +++------------------------------------------ + 1 file changed, 3 insertions(+), 42 deletions(-) + +--- a/fs/xfs/xfs_aops.c ++++ b/fs/xfs/xfs_aops.c +@@ -39,33 +39,6 @@ static inline bool xfs_ioend_is_append(s + XFS_I(ioend->io_inode)->i_d.di_size; + } + +-STATIC int +-xfs_setfilesize_trans_alloc( +- struct iomap_ioend *ioend) +-{ +- struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; +- struct xfs_trans *tp; +- int error; +- +- error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp); +- if (error) +- return error; +- +- ioend->io_private = tp; +- +- /* +- * We may pass freeze protection with a transaction. So tell lockdep +- * we released it. +- */ +- __sb_writers_release(ioend->io_inode->i_sb, SB_FREEZE_FS); +- /* +- * We hand off the transaction to the completion thread now, so +- * clear the flag here. +- */ +- xfs_trans_clear_context(tp); +- return 0; +-} +- + /* + * Update on-disk file size now that data has been written to disk. + */ +@@ -191,12 +164,10 @@ xfs_end_ioend( + error = xfs_reflink_end_cow(ip, offset, size); + else if (ioend->io_type == IOMAP_UNWRITTEN) + error = xfs_iomap_write_unwritten(ip, offset, size, false); +- else +- ASSERT(!xfs_ioend_is_append(ioend) || ioend->io_private); + ++ if (!error && xfs_ioend_is_append(ioend)) ++ error = xfs_setfilesize(ip, ioend->io_offset, ioend->io_size); + done: +- if (ioend->io_private) +- error = xfs_setfilesize_ioend(ioend, error); + iomap_finish_ioends(ioend, error); + memalloc_nofs_restore(nofs_flag); + } +@@ -246,7 +217,7 @@ xfs_end_io( + + static inline bool xfs_ioend_needs_workqueue(struct iomap_ioend *ioend) + { +- return ioend->io_private || ++ return xfs_ioend_is_append(ioend) || + ioend->io_type == IOMAP_UNWRITTEN || + (ioend->io_flags & IOMAP_F_SHARED); + } +@@ -259,8 +230,6 @@ xfs_end_bio( + struct xfs_inode *ip = XFS_I(ioend->io_inode); + unsigned long flags; + +- ASSERT(xfs_ioend_needs_workqueue(ioend)); +- + spin_lock_irqsave(&ip->i_ioend_lock, flags); + if (list_empty(&ip->i_ioend_list)) + WARN_ON_ONCE(!queue_work(ip->i_mount->m_unwritten_workqueue, +@@ -510,14 +479,6 @@ xfs_prepare_ioend( + ioend->io_offset, ioend->io_size); + } + +- /* Reserve log space if we might write beyond the on-disk inode size. */ +- if (!status && +- ((ioend->io_flags & IOMAP_F_SHARED) || +- ioend->io_type != IOMAP_UNWRITTEN) && +- xfs_ioend_is_append(ioend) && +- !ioend->io_private) +- status = xfs_setfilesize_trans_alloc(ioend); +- + memalloc_nofs_restore(nofs_flag); + + if (xfs_ioend_needs_workqueue(ioend))