* [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency
@ 2023-10-08 0:49 Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 02/12] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone Sasha Levin
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: David Thompson, Asmaa Mnebhi, Sebastian Reichel, Sasha Levin, sre,
linux-pm
From: David Thompson <davthompson@nvidia.com>
[ Upstream commit 82f07f1acf417b81e793145c167dd5e156024de4 ]
The BlueField power handling driver (pwr-mlxbf.c) provides
functionality for both BlueField-2 and BlueField-3 based
platforms. This driver also depends on the SoC-specific
BlueField GPIO driver, whether gpio-mlxbf2 or gpio-mlxbf3.
This patch extends the Kconfig definition to include the
dependency on the gpio-mlxbf3 driver, if applicable.
Signed-off-by: David Thompson <davthompson@nvidia.com>
Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
Link: https://lore.kernel.org/r/20230823133743.31275-1-davthompson@nvidia.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/reset/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index a8c46ba5878fe..54201f0374104 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -299,7 +299,7 @@ config NVMEM_REBOOT_MODE
config POWER_MLXBF
tristate "Mellanox BlueField power handling driver"
- depends on (GPIO_MLXBF2 && ACPI)
+ depends on (GPIO_MLXBF2 || GPIO_MLXBF3) && ACPI
help
This driver supports reset or low power mode handling for Mellanox BlueField.
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 02/12] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 03/12] fs-writeback: do not requeue a clean inode having skipped pages Sasha Levin
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tony Lindgren, Ivaylo Dimitrov, Carl Philipp Klemm, Merlijn Wajer,
Pavel Machek, Sebastian Reichel, Sasha Levin, robh+dt,
krzysztof.kozlowski+dt, conor+dt, devicetree
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit 5ad37b5e30433afa7a5513e3eb61f69fa0976785 ]
On mapphone devices we may get lots of noise on the micro-USB port in debug
uart mode until the phy-cpcap-usb driver probes. Let's limit the noise by
using overrun-throttle-ms.
Note that there is also a related separate issue where the charger cable
connected may cause random sysrq requests until phy-cpcap-usb probes that
still remains.
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/motorola-mapphone-common.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
index c7a1f3ffc48ca..bd4731b929da5 100644
--- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi
+++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
@@ -640,6 +640,7 @@ &uart1 {
&uart3 {
interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH
&omap4_pmx_core 0x17c>;
+ overrun-throttle-ms = <500>;
};
&uart4 {
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 03/12] fs-writeback: do not requeue a clean inode having skipped pages
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 02/12] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 04/12] btrfs: prevent transaction block reserve underflow when starting transaction Sasha Levin
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Chunhai Guo, Jan Kara, Christian Brauner, Sasha Levin, viro,
linux-fsdevel
From: Chunhai Guo <guochunhai@vivo.com>
[ Upstream commit be049c3a088d512187407b7fd036cecfab46d565 ]
When writing back an inode and performing an fsync on it concurrently, a
deadlock issue may arise as shown below. In each writeback iteration, a
clean inode is requeued to the wb->b_dirty queue due to non-zero
pages_skipped, without anything actually being written. This causes an
infinite loop and prevents the plug from being flushed, resulting in a
deadlock. We now avoid requeuing the clean inode to prevent this issue.
wb_writeback fsync (inode-Y)
blk_start_plug(&plug)
for (;;) {
iter i-1: some reqs with page-X added into plug->mq_list // f2fs node page-X with PG_writeback
filemap_fdatawrite
__filemap_fdatawrite_range // write inode-Y with sync_mode WB_SYNC_ALL
do_writepages
f2fs_write_data_pages
__f2fs_write_data_pages // wb_sync_req[DATA]++ for WB_SYNC_ALL
f2fs_write_cache_pages
f2fs_write_single_data_page
f2fs_do_write_data_page
f2fs_outplace_write_data
f2fs_update_data_blkaddr
f2fs_wait_on_page_writeback
wait_on_page_writeback // wait for f2fs node page-X
iter i:
progress = __writeback_inodes_wb(wb, work)
. writeback_sb_inodes
. __writeback_single_inode // write inode-Y with sync_mode WB_SYNC_NONE
. . do_writepages
. . f2fs_write_data_pages
. . . __f2fs_write_data_pages // skip writepages due to (wb_sync_req[DATA]>0)
. . . wbc->pages_skipped += get_dirty_pages(inode) // wbc->pages_skipped = 1
. if (!(inode->i_state & I_DIRTY_ALL)) // i_state = I_SYNC | I_SYNC_QUEUED
. total_wrote++; // total_wrote = 1
. requeue_inode // requeue inode-Y to wb->b_dirty queue due to non-zero pages_skipped
if (progress) // progress = 1
continue;
iter i+1:
queue_io
// similar process with iter i, infinite for-loop !
}
blk_finish_plug(&plug) // flush plug won't be called
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Message-Id: <20230916045131.957929-1-guochunhai@vivo.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs-writeback.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index d387708977a50..a5c31a479aacc 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1522,10 +1522,15 @@ static void requeue_inode(struct inode *inode, struct bdi_writeback *wb,
if (wbc->pages_skipped) {
/*
- * writeback is not making progress due to locked
- * buffers. Skip this inode for now.
+ * Writeback is not making progress due to locked buffers.
+ * Skip this inode for now. Although having skipped pages
+ * is odd for clean inodes, it can happen for some
+ * filesystems so handle that gracefully.
*/
- redirty_tail_locked(inode, wb);
+ if (inode->i_state & I_DIRTY_ALL)
+ redirty_tail_locked(inode, wb);
+ else
+ inode_cgwb_move_to_attached(inode, wb);
return;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 04/12] btrfs: prevent transaction block reserve underflow when starting transaction
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 02/12] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 03/12] fs-writeback: do not requeue a clean inode having skipped pages Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 05/12] btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 Sasha Levin
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Filipe Manana, Josef Bacik, David Sterba, Sasha Levin, clm,
linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
[ Upstream commit a7ddeeb079505961355cf0106154da0110f1fdff ]
When starting a transaction, with a non-zero number of items, we reserve
metadata space for that number of items and for delayed refs by doing a
call to btrfs_block_rsv_add(), with the transaction block reserve passed
as the block reserve argument. This reserves metadata space and adds it
to the transaction block reserve. Later we migrate the space we reserved
for delayed references from the transaction block reserve into the delayed
refs block reserve, by calling btrfs_migrate_to_delayed_refs_rsv().
btrfs_migrate_to_delayed_refs_rsv() decrements the number of bytes to
migrate from the source block reserve, and this however may result in an
underflow in case the space added to the transaction block reserve ended
up being used by another task that has not reserved enough space for its
own use - examples are tasks doing reflinks or hole punching because they
end up calling btrfs_replace_file_extents() -> btrfs_drop_extents() and
may need to modify/COW a variable number of leaves/paths, so they keep
trying to use space from the transaction block reserve when they need to
COW an extent buffer, and may end up trying to use more space then they
have reserved (1 unit/path only for removing file extent items).
This can be avoided by simply reserving space first without adding it to
the transaction block reserve, then add the space for delayed refs to the
delayed refs block reserve and finally add the remaining reserved space
to the transaction block reserve. This also makes the code a bit shorter
and simpler. So just do that.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/delayed-ref.c | 9 +--------
fs/btrfs/delayed-ref.h | 1 -
fs/btrfs/transaction.c | 6 +++---
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 36a3debe94930..e08e3852c4788 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -141,24 +141,17 @@ void btrfs_update_delayed_refs_rsv(struct btrfs_trans_handle *trans)
* Transfer bytes to our delayed refs rsv
*
* @fs_info: the filesystem
- * @src: source block rsv to transfer from
* @num_bytes: number of bytes to transfer
*
- * This transfers up to the num_bytes amount from the src rsv to the
+ * This transfers up to the num_bytes amount, previously reserved, to the
* delayed_refs_rsv. Any extra bytes are returned to the space info.
*/
void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
- struct btrfs_block_rsv *src,
u64 num_bytes)
{
struct btrfs_block_rsv *delayed_refs_rsv = &fs_info->delayed_refs_rsv;
u64 to_free = 0;
- spin_lock(&src->lock);
- src->reserved -= num_bytes;
- src->size -= num_bytes;
- spin_unlock(&src->lock);
-
spin_lock(&delayed_refs_rsv->lock);
if (delayed_refs_rsv->size > delayed_refs_rsv->reserved) {
u64 delta = delayed_refs_rsv->size -
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index d6304b690ec4a..712a6315e956b 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -383,7 +383,6 @@ void btrfs_update_delayed_refs_rsv(struct btrfs_trans_handle *trans);
int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info,
enum btrfs_reserve_flush_enum flush);
void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
- struct btrfs_block_rsv *src,
u64 num_bytes);
int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans);
bool btrfs_check_space_for_delayed_refs(struct btrfs_fs_info *fs_info);
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index a555567594418..847eee1e0db6f 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -613,14 +613,14 @@ start_transaction(struct btrfs_root *root, unsigned int num_items,
reloc_reserved = true;
}
- ret = btrfs_block_rsv_add(fs_info, rsv, num_bytes, flush);
+ ret = btrfs_reserve_metadata_bytes(fs_info, rsv, num_bytes, flush);
if (ret)
goto reserve_fail;
if (delayed_refs_bytes) {
- btrfs_migrate_to_delayed_refs_rsv(fs_info, rsv,
- delayed_refs_bytes);
+ btrfs_migrate_to_delayed_refs_rsv(fs_info, delayed_refs_bytes);
num_bytes -= delayed_refs_bytes;
}
+ btrfs_block_rsv_add_bytes(rsv, num_bytes, true);
if (rsv->space_info->force_alloc)
do_chunk_alloc = true;
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 05/12] btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (2 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 04/12] btrfs: prevent transaction block reserve underflow when starting transaction Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 06/12] btrfs: initialize start_slot in btrfs_log_prealloc_extents Sasha Levin
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Filipe Manana, Josef Bacik, David Sterba, Sasha Levin, clm,
linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
[ Upstream commit 1bf76df3fee56d6637718e267f7c34ed70d0c7dc ]
When running a delayed tree reference, if we find a ref count different
from 1, we return -EIO. This isn't an IO error, as it indicates either a
bug in the delayed refs code or a memory corruption, so change the error
code from -EIO to -EUCLEAN. Also tag the branch as 'unlikely' as this is
not expected to ever happen, and change the error message to print the
tree block's bytenr without the parenthesis (and there was a missing space
between the 'block' word and the opening parenthesis), for consistency as
that's the style we used everywhere else.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/extent-tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 08ff10a81cb90..2a7c9088fe1f8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1663,12 +1663,12 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
parent = ref->parent;
ref_root = ref->root;
- if (node->ref_mod != 1) {
+ if (unlikely(node->ref_mod != 1)) {
btrfs_err(trans->fs_info,
- "btree block(%llu) has %d references rather than 1: action %d ref_root %llu parent %llu",
+ "btree block %llu has %d references rather than 1: action %d ref_root %llu parent %llu",
node->bytenr, node->ref_mod, node->action, ref_root,
parent);
- return -EIO;
+ return -EUCLEAN;
}
if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) {
BUG_ON(!extent_op || !extent_op->update_flags);
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 06/12] btrfs: initialize start_slot in btrfs_log_prealloc_extents
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (3 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 05/12] btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 07/12] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Sasha Levin
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Josef Bacik, Jens Axboe, David Sterba, Sasha Levin, clm,
linux-btrfs
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit b4c639f699349880b7918b861e1bd360442ec450 ]
Jens reported a compiler warning when using
CONFIG_CC_OPTIMIZE_FOR_SIZE=y that looks like this
fs/btrfs/tree-log.c: In function ‘btrfs_log_prealloc_extents’:
fs/btrfs/tree-log.c:4828:23: warning: ‘start_slot’ may be used
uninitialized [-Wmaybe-uninitialized]
4828 | ret = copy_items(trans, inode, dst_path, path,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4829 | start_slot, ins_nr, 1, 0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/tree-log.c:4725:13: note: ‘start_slot’ was declared here
4725 | int start_slot;
| ^~~~~~~~~~
The compiler is incorrect, as we only use this code when ins_len > 0,
and when ins_len > 0 we have start_slot properly initialized. However
we generally find the -Wmaybe-uninitialized warnings valuable, so
initialize start_slot to get rid of the warning.
Reported-by: Jens Axboe <axboe@kernel.dk>
Tested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/tree-log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 00be69ce7b90f..451a74a04b99d 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4793,7 +4793,7 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans,
struct extent_buffer *leaf;
int slot;
int ins_nr = 0;
- int start_slot;
+ int start_slot = 0;
int ret;
if (!(inode->flags & BTRFS_INODE_PREALLOC))
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 07/12] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (4 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 06/12] btrfs: initialize start_slot in btrfs_log_prealloc_extents Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 08/12] overlayfs: set ctime when setting mtime and atime Sasha Levin
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Heiner Kallweit, Peter Rosin, Wolfram Sang, Sasha Levin,
linux-i2c
From: Heiner Kallweit <hkallweit1@gmail.com>
[ Upstream commit b13e59e74ff71a1004e0508107e91e9a84fd7388 ]
I2C_CLASS_DEPRECATED is a flag and not an actual class.
There's nothing speaking against both, parent and child, having
I2C_CLASS_DEPRECATED set. Therefore exclude it from the check.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/i2c-mux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 313904be5f3bd..57ff09f18c371 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -341,7 +341,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
priv->adap.lock_ops = &i2c_parent_lock_ops;
/* Sanity check on class */
- if (i2c_mux_parent_classes(parent) & class)
+ if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
dev_err(&parent->dev,
"Segment %d behind mux can't share classes with ancestors\n",
chan_id);
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 08/12] overlayfs: set ctime when setting mtime and atime
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (5 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 07/12] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 09/12] gpio: timberdale: Fix potential deadlock on &tgpio->lock Sasha Levin
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jeff Layton, Nathan Chancellor, Christian Brauner, Amir Goldstein,
Sasha Levin, miklos, linux-unionfs
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit 03dbab3bba5f009d053635c729d1244f2c8bad38 ]
Nathan reported that he was seeing the new warning in
setattr_copy_mgtime pop when starting podman containers. Overlayfs is
trying to set the atime and mtime via notify_change without also
setting the ctime.
POSIX states that when the atime and mtime are updated via utimes() that
we must also update the ctime to the current time. The situation with
overlayfs copy-up is analogies, so add ATTR_CTIME to the bitmask.
notify_change will fill in the value.
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Amir Goldstein <amir73il@gmail.com>
Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/copy_up.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index e6d711f42607b..86d4b6975dbcb 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -300,7 +300,7 @@ static int ovl_set_timestamps(struct ovl_fs *ofs, struct dentry *upperdentry,
{
struct iattr attr = {
.ia_valid =
- ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET,
+ ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_CTIME,
.ia_atime = stat->atime,
.ia_mtime = stat->mtime,
};
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 09/12] gpio: timberdale: Fix potential deadlock on &tgpio->lock
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (6 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 08/12] overlayfs: set ctime when setting mtime and atime Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 10/12] ata: libata-core: Fix compilation warning in ata_dev_config_ncq() Sasha Levin
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Chengfeng Ye, Andy Shevchenko, Bartosz Golaszewski, Sasha Levin,
linus.walleij, brgl, linux-gpio
From: Chengfeng Ye <dg573847474@gmail.com>
[ Upstream commit 9e8bc2dda5a7a8e2babc9975f4b11c9a6196e490 ]
As timbgpio_irq_enable()/timbgpio_irq_disable() callback could be
executed under irq context, it could introduce double locks on
&tgpio->lock if it preempts other execution units requiring
the same locks.
timbgpio_gpio_set()
--> timbgpio_update_bit()
--> spin_lock(&tgpio->lock)
<interrupt>
--> timbgpio_irq_disable()
--> spin_lock_irqsave(&tgpio->lock)
This flaw was found by an experimental static analysis tool I am
developing for irq-related deadlock.
To prevent the potential deadlock, the patch uses spin_lock_irqsave()
on &tgpio->lock inside timbgpio_gpio_set() to prevent the possible
deadlock scenario.
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-timberdale.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index de14949a3fe5a..92c1f2baa4bff 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -43,9 +43,10 @@ static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index,
unsigned offset, bool enabled)
{
struct timbgpio *tgpio = gpiochip_get_data(gpio);
+ unsigned long flags;
u32 reg;
- spin_lock(&tgpio->lock);
+ spin_lock_irqsave(&tgpio->lock, flags);
reg = ioread32(tgpio->membase + offset);
if (enabled)
@@ -54,7 +55,7 @@ static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index,
reg &= ~(1 << index);
iowrite32(reg, tgpio->membase + offset);
- spin_unlock(&tgpio->lock);
+ spin_unlock_irqrestore(&tgpio->lock, flags);
return 0;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 10/12] ata: libata-core: Fix compilation warning in ata_dev_config_ncq()
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (7 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 09/12] gpio: timberdale: Fix potential deadlock on &tgpio->lock Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 11/12] ata: libata-eh: Fix compilation warning in ata_eh_link_report() Sasha Levin
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Damien Le Moal, Hannes Reinecke, Geert Uytterhoeven,
Martin K . Petersen, Sasha Levin, linux-ide
From: Damien Le Moal <dlemoal@kernel.org>
[ Upstream commit ed518d9ba980dc0d27c7d1dea1e627ba001d1977 ]
The 24 bytes length allocated to the ncq_desc string in
ata_dev_config_lba() for ata_dev_config_ncq() to use is too short,
causing the following gcc compilation warnings when compiling with W=1:
drivers/ata/libata-core.c: In function ‘ata_dev_configure’:
drivers/ata/libata-core.c:2378:56: warning: ‘%d’ directive output may be truncated writing between 1 and 2 bytes into a region of size between 1 and 11 [-Wformat-truncation=]
2378 | snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth,
| ^~
In function ‘ata_dev_config_ncq’,
inlined from ‘ata_dev_config_lba’ at drivers/ata/libata-core.c:2649:8,
inlined from ‘ata_dev_configure’ at drivers/ata/libata-core.c:2952:9:
drivers/ata/libata-core.c:2378:41: note: directive argument in the range [1, 32]
2378 | snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-core.c:2378:17: note: ‘snprintf’ output between 16 and 31 bytes into a destination of size 24
2378 | snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2379 | ddepth, aa_desc);
| ~~~~~~~~~~~~~~~~
Avoid these warnings and the potential truncation by changing the size
of the ncq_desc string to 32 characters.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0ba0c3d1613f1..6d4dd5e3b58f3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2366,7 +2366,7 @@ static int ata_dev_config_lba(struct ata_device *dev)
{
const u16 *id = dev->id;
const char *lba_desc;
- char ncq_desc[24];
+ char ncq_desc[32];
int ret;
dev->flags |= ATA_DFLAG_LBA;
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 11/12] ata: libata-eh: Fix compilation warning in ata_eh_link_report()
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (8 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 10/12] ata: libata-core: Fix compilation warning in ata_dev_config_ncq() Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 12/12] tracing: relax trace_event_eval_update() execution with cond_resched() Sasha Levin
2023-10-09 7:37 ` [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Pavel Machek
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Damien Le Moal, Hannes Reinecke, Geert Uytterhoeven,
Martin K . Petersen, Sasha Levin, linux-ide
From: Damien Le Moal <dlemoal@kernel.org>
[ Upstream commit 49728bdc702391902a473b9393f1620eea32acb0 ]
The 6 bytes length of the tries_buf string in ata_eh_link_report() is
too short and results in a gcc compilation warning with W-!:
drivers/ata/libata-eh.c: In function ‘ata_eh_link_report’:
drivers/ata/libata-eh.c:2371:59: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 4 [-Wformat-truncation=]
2371 | snprintf(tries_buf, sizeof(tries_buf), " t%d",
| ^~
drivers/ata/libata-eh.c:2371:56: note: directive argument in the range [-2147483648, 4]
2371 | snprintf(tries_buf, sizeof(tries_buf), " t%d",
| ^~~~~~
drivers/ata/libata-eh.c:2371:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 6
2371 | snprintf(tries_buf, sizeof(tries_buf), " t%d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2372 | ap->eh_tries);
| ~~~~~~~~~~~~~
Avoid this warning by increasing the string size to 16B.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-eh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index a3ae5fc2a42fc..28b1fe644cfee 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2212,7 +2212,7 @@ static void ata_eh_link_report(struct ata_link *link)
struct ata_eh_context *ehc = &link->eh_context;
struct ata_queued_cmd *qc;
const char *frozen, *desc;
- char tries_buf[6] = "";
+ char tries_buf[16] = "";
int tag, nr_failed = 0;
if (ehc->i.flags & ATA_EHI_QUIET)
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 6.1 12/12] tracing: relax trace_event_eval_update() execution with cond_resched()
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (9 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 11/12] ata: libata-eh: Fix compilation warning in ata_eh_link_report() Sasha Levin
@ 2023-10-08 0:49 ` Sasha Levin
2023-10-09 7:37 ` [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Pavel Machek
11 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2023-10-08 0:49 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Clément Léger, Masami Hiramatsu, Atish Patra,
Steven Rostedt, Sasha Levin, linux-trace-kernel
From: Clément Léger <cleger@rivosinc.com>
[ Upstream commit 23cce5f25491968b23fb9c399bbfb25f13870cd9 ]
When kernel is compiled without preemption, the eval_map_work_func()
(which calls trace_event_eval_update()) will not be preempted up to its
complete execution. This can actually cause a problem since if another
CPU call stop_machine(), the call will have to wait for the
eval_map_work_func() function to finish executing in the workqueue
before being able to be scheduled. This problem was observe on a SMP
system at boot time, when the CPU calling the initcalls executed
clocksource_done_booting() which in the end calls stop_machine(). We
observed a 1 second delay because one CPU was executing
eval_map_work_func() and was not preempted by the stop_machine() task.
Adding a call to cond_resched() in trace_event_eval_update() allows
other tasks to be executed and thus continue working asynchronously
like before without blocking any pending task at boot time.
Link: https://lore.kernel.org/linux-trace-kernel/20230929191637.416931-1-cleger@rivosinc.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_events.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 9da418442a063..2e3dce5e2575e 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2777,6 +2777,7 @@ void trace_event_eval_update(struct trace_eval_map **map, int len)
update_event_fields(call, map[i]);
}
}
+ cond_resched();
}
up_write(&trace_event_sem);
}
--
2.40.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
` (10 preceding siblings ...)
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 12/12] tracing: relax trace_event_eval_update() execution with cond_resched() Sasha Levin
@ 2023-10-09 7:37 ` Pavel Machek
11 siblings, 0 replies; 13+ messages in thread
From: Pavel Machek @ 2023-10-09 7:37 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, David Thompson, Asmaa Mnebhi,
Sebastian Reichel, sre, linux-pm
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
hi!
> From: David Thompson <davthompson@nvidia.com>
>
> [ Upstream commit 82f07f1acf417b81e793145c167dd5e156024de4 ]
>
> The BlueField power handling driver (pwr-mlxbf.c) provides
> functionality for both BlueField-2 and BlueField-3 based
> platforms. This driver also depends on the SoC-specific
> BlueField GPIO driver, whether gpio-mlxbf2 or gpio-mlxbf3.
> This patch extends the Kconfig definition to include the
> dependency on the gpio-mlxbf3 driver, if applicable.
There's no GPIO_MLXBF3 in 6.1, please drop.
BR,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-10-09 7:37 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 0:49 [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 02/12] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 03/12] fs-writeback: do not requeue a clean inode having skipped pages Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 04/12] btrfs: prevent transaction block reserve underflow when starting transaction Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 05/12] btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 06/12] btrfs: initialize start_slot in btrfs_log_prealloc_extents Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 07/12] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 08/12] overlayfs: set ctime when setting mtime and atime Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 09/12] gpio: timberdale: Fix potential deadlock on &tgpio->lock Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 10/12] ata: libata-core: Fix compilation warning in ata_dev_config_ncq() Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 11/12] ata: libata-eh: Fix compilation warning in ata_eh_link_report() Sasha Levin
2023-10-08 0:49 ` [PATCH AUTOSEL 6.1 12/12] tracing: relax trace_event_eval_update() execution with cond_resched() Sasha Levin
2023-10-09 7:37 ` [PATCH AUTOSEL 6.1 01/12] pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox