id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
a5a6dd2624698b6e3045c3a1450874d8c790d5d9
Analyze and fix the following issue in the Linux kernel code: PCI/PM: Extend D3hot delay for NVIDIA HDA controllers
Problem Details: Assignment of NVIDIA Ampere-based GPUs have seen a regression since the below referenced commit, where the reduced D3hot transition delay appears to introduce a small window where a D3hot->D0 transition followed by a bus reset can wedge the device. The entire device is subsequently unavailable, return...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 44cab813bf95..f4e2a88729fd 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1939,6 +1939,19 @@ static void quirk_radeon_pm(struct pci_dev *dev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x6741, quirk_radeon_pm); +/* + * NVIDIA...
d57fd4926ab81ad5749c6950047ea40863a52e18
Analyze and fix the following issue in the Linux kernel code: perf cpumap: Remove initializations done in perf_cpu_map__alloc()
Problem Details: When extracting this patch from Ian's original patch I forgot to remove the setting of ->nr and ->refcnt, no need to do those initializations again as those are done in perf_cpu_map__alloc() already, duh. Cc: Ian Rogers <irogers@google.com> Fixes: 1f94479edb4decdc ("libperf: Make perf_cpu_map__alloc()...
```diff diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 072831f0cad4..7008705d745c 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -163,13 +163,8 @@ struct perf_cpu_map *perf_cpu_map__empty_new(int nr) struct perf_cpu_map *cpus = perf_cpu_map__alloc(nr); if (cpus != ...
6afd9dc1a4b158456c072580f0851b4dbaaa02f1
Analyze and fix the following issue in the Linux kernel code: Drivers: hv: Don't remap addresses that are above shared_gpa_boundary
Problem Details: With the vTOM bit now treated as a protection flag and not part of the physical address, avoid remapping physical addresses with vTOM set since technically such addresses aren't valid. Use ioremap_cache() instead of memremap() to ensure that the mapping provides decrypted access, which will correctly ...
```diff diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index edbc67ec1f3e..a5f9474f08e1 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -63,7 +63,10 @@ static int hyperv_init_ghcb(void) * memory boundary and map it here. */ rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa); -...
1c34890273a020d61d6127ade3f68ed1cb21c16a
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_mqs: move of_node_put() to the correct location
Problem Details: of_node_put() should have been done directly after mqs_priv->regmap = syscon_node_to_regmap(gpr_np); otherwise it creates a reference leak on the success path. To fix this, of_node_put() is moved to the correct location, and change all the gotos to direct returns. Fixes: a9d273671440 ("ASoC: fsl_mqs:...
```diff diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c index 3fb3d3e4d09a..49ae7f6267d3 100644 --- a/sound/soc/fsl/fsl_mqs.c +++ b/sound/soc/fsl/fsl_mqs.c @@ -210,10 +210,10 @@ static int fsl_mqs_probe(struct platform_device *pdev) } mqs_priv->regmap = syscon_node_to_regmap(gpr_np); + of_node_p...
a9b867f68e89a54fcac334b77e6d243e872573c9
Analyze and fix the following issue in the Linux kernel code: libperf: Add reference count checking macros
Problem Details: The macros serve as a way to debug use of a reference counted struct. The macros add a memory allocated pointer that is interposed between the reference counted original struct at a get and freed by a put. The pointer replaces the original struct, so use of the struct name via APIs remains unchanged....
```diff diff --git a/tools/lib/perf/include/internal/rc_check.h b/tools/lib/perf/include/internal/rc_check.h new file mode 100644 index 000000000000..c0626d8beb59 --- /dev/null +++ b/tools/lib/perf/include/internal/rc_check.h @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __LIBPERF...
f372463124df5f980de6ee0cd6000a3e43df0e01
Analyze and fix the following issue in the Linux kernel code: btrfs: mark btrfs_assertfail() __noreturn
Problem Details: Fixes a bunch of warnings including: vmlinux.o: warning: objtool: select_reloc_root+0x314: unreachable instruction vmlinux.o: warning: objtool: finish_inode_if_needed+0x15b1: unreachable instruction vmlinux.o: warning: objtool: get_bio_sector_nr+0x259: unreachable instruction vmlinux.o: warnin...
```diff diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c index fde5aaa6e7c9..310a05cf95ef 100644 --- a/fs/btrfs/messages.c +++ b/fs/btrfs/messages.c @@ -253,7 +253,7 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, #endif #ifdef CONFIG_BTRFS_ASSERT -void __cold btrfs_assertfa...
8ba7d5f5ba931be68a94b8c91bcced1622934e7a
Analyze and fix the following issue in the Linux kernel code: btrfs: fix uninitialized variable warnings
Problem Details: There are some warnings on older compilers (gcc 10, 7) or non-x86_64 architectures (aarch64). As btrfs wants to enable -Wmaybe-uninitialized by default, fix the warnings even though it's not necessary on recent compilers (gcc 12+). ../fs/btrfs/volumes.c: In function ‘btrfs_init_new_device’: ../fs/btr...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index e5c963bb873d..af2e153543a5 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1875,7 +1875,7 @@ static int get_cur_inode_state(struct send_ctx *sctx, u64 ino, u64 gen, int left_ret; int right_ret; u64 left_gen; - u64 right_gen; + u64 right_gen = 0; ...
5d3e4f1d5123d79932177c3e7461a968f412775a
Analyze and fix the following issue in the Linux kernel code: btrfs: use log root when iterating over index keys when logging directory
Problem Details: When logging dir dentries of a directory, we iterate over the subvolume tree to find dir index keys on leaves modified in the current transaction. This however is heavy on locking, since btrfs_search_forward() may often keep locks on extent buffers for quite a while when walking the tree to find a suit...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d746ebf841fd..9b212e8c70cc 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5399,45 +5399,34 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans, while (true) { struct inode *vfs_inode; - struct extent_buffer *lea...
fa4b8cb1738097586f49ec66cd3656cef47ac143
Analyze and fix the following issue in the Linux kernel code: btrfs: avoid iterating over all indexes when logging directory
Problem Details: When logging a directory, after copying all directory index items from the subvolume tree to the log tree, we iterate over the subvolume tree to find all dir index items that are located in leaves COWed (or created) in the current transaction. If we keep logging a directory several times during the sam...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index bb4984480669..ec2ae4406c16 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -142,11 +142,22 @@ struct btrfs_inode { /* a local copy of root's last_log_commit */ int last_log_commit; - /* - * Total number of bytes pendin...
8eb3dd17eadd21a340cb658c7252d4ad5788baa4
Analyze and fix the following issue in the Linux kernel code: btrfs: dev-replace: error out if we have unrepaired metadata error during
Problem Details: [BUG] Even before the scrub rework, if we have some corrupted metadata failed to be repaired during replace, we still continue replacing and let it finish just as there is nothing wrong: BTRFS info (device dm-4): dev_replace from /dev/mapper/test-scratch1 (devid 1) to /dev/mapper/test-scratch2 starte...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 41cba9646931..836725a19661 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1656,14 +1656,33 @@ static void scrub_submit_initial_read(struct scrub_ctx *sctx, btrfs_submit_bio(bbio, mirror); } -static void flush_scrub_stripes(struct scrub_ctx *s...
cfe3445a58658b2a142a9ba5f5de69d91c56a297
Analyze and fix the following issue in the Linux kernel code: btrfs: set default discard iops_limit to 1000
Problem Details: Previously, the default was a relatively conservative 10. This results in a 100ms delay, so with ~300 discards in a commit, it takes the full 30s till the next commit to finish the discards. On a workstation, this results in the disk never going idle, wasting power/battery, etc. Set the default to 100...
```diff diff --git a/fs/btrfs/discard.c b/fs/btrfs/discard.c index 317aeff6c1da..0bc526f5fcd9 100644 --- a/fs/btrfs/discard.c +++ b/fs/btrfs/discard.c @@ -60,7 +60,7 @@ #define BTRFS_DISCARD_TARGET_MSEC (6 * 60 * 60UL * MSEC_PER_SEC) #define BTRFS_DISCARD_MIN_DELAY_MSEC (1UL) #define BTRFS_DISCARD_MAX_DELAY_MSEC (10...
c86c00c6935505929cc9adb29ddb85e48c71f828
Analyze and fix the following issue in the Linux kernel code: i40e: fix i40e_setup_misc_vector() error handling
Problem Details: Add error handling of i40e_setup_misc_vector() in i40e_rebuild(). In case interrupt vectors setup fails do not re-open vsi-s and do not bring up vf-s, we have no interrupts to serve a traffic anyway. Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 6313575a4b6c..7c30abd0dfc2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11059,8 +11059,11 @@ static void i40e_rebuild(struct i40e_pf *pf,...
4aa35a0130d6b8afbefc9ef530a521fb0fb9b8e1
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/therm: Move an assignment statement behind a null pointer check in two functions
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the functions “nvkm_fanpwm_create” and “nvkm_fantog_create”. Thus avoid the risk for undefined behaviour by moving the assignment for the data structure member “fan” behind two null...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c index 340f37a299dc..b13ba9b2f6be 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c @@ -98,10 +98,10 @@ nvkm_fanpwm_create(st...
488c1ce6a8f3d46e20440b2e240e096a20259fcc
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/pci: Move a variable assignment behind condition checks in nvkm_pcie_set_link()
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvkm_pcie_set_link”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “subdev” behind some condition checks. This issue was detec...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c index d71e5db5028a..b295f100e1c1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c @@ -114,7 +114,7 @@ nvkm_pcie_init(struct nvkm_pci *pci) ...
41239aa4f751fbc39481a4af726faa347a26da83
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/clk: Move a variable assignment behind a null pointer check in nvkm_pstate_new()
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvkm_pstate_new”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “cstate” behind the null pointer check. This issue was detecte...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c index da07a2fbef06..178dc56909c2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c @@ -417,7 +417,6 @@ nvkm_pstate_new(struct nvkm_clk *clk,...
5149545dbcbb15105312014201b9c0aa859c6044
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/bios/power_budget: Move an expression into a macro call parameter in nvbios_power_budget_header()
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvbios_power_budget_header”. Thus avoid the risk for undefined behaviour by moving the usage of an expression into a parameter for a macro call in one if branch. This...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/power_budget.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/power_budget.c index 03d2f970a29f..2ba992bdb19d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/power_budget.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/power_budget.c @@ -59,7 +59,6 @@ int...
e1b570db8687c993e7a87516387a3bb3b5e63ac6
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/debugfs: Move a variable assignment behind a null pointer check in nouveau_debugfs_pstate_get()
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nouveau_debugfs_pstate_get”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “ctrl” behind the null pointer check. This issue wa...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 44e26b6e74c7..a859a086f308 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -73,13 +73,14 @@ nouveau_debugfs_pstate_get(struct seq_file *m, void *data...
3778724bec53a3585cde6aed8c75ae3f085c3dcb
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/debugfs: Move an expression into a function call parameter in nouveau_debugfs_pstate_set()
Problem Details: The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nouveau_debugfs_pstate_set”. Thus avoid the risk for undefined behaviour by moving the usage of an expression into a parameter for a function call at the end. This is...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 2a36d1ca8fda..44e26b6e74c7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -144,7 +144,6 @@ nouveau_debugfs_pstate_set(struct file *file, const char ...
8485d093b076e59baff424552e8aecfc5bd2d261
Analyze and fix the following issue in the Linux kernel code: i40e: fix accessing vsi->active_filters without holding lock
Problem Details: Fix accessing vsi->active_filters without holding the mac_filter_hash_lock. Move vsi->active_filters = 0 inside critical section and move clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state) after the critical section to ensure the new filters from other threads can be added only after filters cleaning i...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 228cd502bb48..6313575a4b6c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -14133,15 +14133,15 @@ static int i40e_add_vsi(struct i40e_vsi *vs...
3d32aaa7e66d5c1479a3c31d6c2c5d45dd0d3b89
Analyze and fix the following issue in the Linux kernel code: dm ioctl: fix nested locking in table_clear() to remove deadlock concern
Problem Details: syzkaller found the following problematic rwsem locking (with write lock already held): down_read+0x9d/0x450 kernel/locking/rwsem.c:1509 dm_get_inactive_table+0x2b/0xc0 drivers/md/dm-ioctl.c:773 __dev_status+0x4fd/0x7c0 drivers/md/dm-ioctl.c:844 table_clear+0x197/0x280 drivers/md/dm-ioctl.c:1537 ...
```diff diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 50a1259294d1..7d5c9c582ed2 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1556,11 +1556,12 @@ static int table_clear(struct file *filp, struct dm_ioctl *param, size_t param_s has_new_map = true; } - param->flags &= ~DM_I...
54765392a1b9533235c718e5956ebd97379fb200
Analyze and fix the following issue in the Linux kernel code: btrfs: scrub: introduce helper to queue a stripe for scrub
Problem Details: The new helper, queue_scrub_stripe(), would try to queue a stripe for scrub. If all stripes are already in use, we will submit all the existing ones and wait for them to finish. Currently we would queue up to 8 stripes, to enlarge the blocksize to 512KiB to improve the performance. Sectors repaired o...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 5c21e25c83f4..d5d5cd68ac2e 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -50,6 +50,7 @@ struct scrub_ctx; */ #define SCRUB_SECTORS_PER_BIO 32 /* 128KiB per bio for 4KiB pages */ #define SCRUB_BIOS_PER_SCTX 64 /* 8MiB per device in flight for 4...
1f16033c992971d5a630a038bd0ca8a5067527ef
Analyze and fix the following issue in the Linux kernel code: btrfs: warn for any missed cleanup at btrfs_close_one_device
Problem Details: During my recent search for the root cause of a reported bug, I realized that it's a good idea to issue a warning for missed cleanup instead of using debug-only assertions. Since most installations run with debug off, missed cleanups and premature calls to close could go unnoticed. However, these issue...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index eead4a1f53b7..0e3677650a78 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1150,10 +1150,10 @@ static void btrfs_close_one_device(struct btrfs_device *device) device->last_flush_error = 0; /* Verify the device is back in a pristine st...
3480373ebdf7625ee29bee6508c9fc4ae70c00bf
Analyze and fix the following issue in the Linux kernel code: btrfs, block: move REQ_CGROUP_PUNT to btrfs
Problem Details: REQ_CGROUP_PUNT is a bit annoying as it is hard to follow and adds a branch to the bio submission hot path. To fix this, export blkcg_punt_bio_submit and let btrfs call it directly. Add a new REQ_FS_PRIVATE flag for btrfs to indicate to it's own low-level bio submission code that a punt to the cgroup...
```diff diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index bd50b55bdb61..9f5f3263c178 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1688,24 +1688,27 @@ out_unlock: } EXPORT_SYMBOL_GPL(blkcg_policy_unregister); -bool __blkcg_punt_bio_submit(struct bio *bio) +/* + * When a shared kthread issues...
896d7c1a90f33e9c6ee9002d53980dde4d8b99ee
Analyze and fix the following issue in the Linux kernel code: btrfs: also use kthread_associate_blkcg for uncompressible ranges
Problem Details: submit_one_async_extent needs to use submit_one_async_extent no matter if the range it handles ends up beeing compressed or not as the deadlock risk due to cgroup thottling is the same. Call kthread_associate_blkcg earlier to cover submit_uncompressed_range case as well. Signed-off-by: Christoph Hell...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5db8b6cffb24..5c216cab2076 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -983,6 +983,9 @@ static int submit_one_async_extent(struct btrfs_inode *inode, u64 start = async_extent->start; u64 end = async_extent->start + async_extent->ram_size - 1...
0f69d1f4d62444bc1e7bdbcbea7c646ddcc35a58
Analyze and fix the following issue in the Linux kernel code: btrfs: correctly calculate delayed ref bytes when starting transaction
Problem Details: When starting a transaction, we are assuming the number of bytes used for each delayed ref update matches the number of bytes used for each item update, that is the return value of: btrfs_calc_insert_metadata_size(fs_info, num_items) However that is not correct when we are using the free space tre...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index c497886d30e6..8b6a99b8d7f6 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -601,15 +601,16 @@ start_transaction(struct btrfs_root *root, unsigned int num_items, /* * We want to reserve all the bytes we may need all at ...
b73a6fd1b1efd799c6e3d14a922887f4453fea17
Analyze and fix the following issue in the Linux kernel code: btrfs: split partial dio bios before submit
Problem Details: If an application is doing direct io to a btrfs file and experiences a page fault reading from the write buffer, iomap will issue a partial bio, and allow the fs to keep going. However, there was a subtle bug in this code path in the btrfs dio iomap implementation that led to the partial write ending u...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 26aeb4f000f5..d069cde28af5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7714,6 +7714,24 @@ static void btrfs_dio_submit_io(const struct iomap_iter *iter, struct bio *bio, dip->bytes = bio->bi_iter.bi_size; dio_data->submitted += bio->bi_it...
5630e2bcfe22392611a88a2a1e6240ff910c480c
Analyze and fix the following issue in the Linux kernel code: btrfs: use a constant for the number of metadata units needed for an unlink
Problem Details: Instead of hard coding the number of metadata units for an unlink operation in a couple places, define a macro and use it instead. This eliminates the problem of one place getting out of sync with the other, such as recently fixed by the previous patch in the series ("btrfs: fix calculation of the glob...
```diff diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c index 6edcb32ed4c9..b4a1f1bc340f 100644 --- a/fs/btrfs/block-rsv.c +++ b/fs/btrfs/block-rsv.c @@ -350,14 +350,15 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info) /* * But we also want to reserve enough space so we can do the fal...
ba4ec8fbce6c8b629a26d78cdd4a308cd0a503ca
Analyze and fix the following issue in the Linux kernel code: btrfs: fix calculation of the global block reserve's size
Problem Details: At btrfs_update_global_block_rsv(), we are assuming an unlink operation uses 5 metadata units, but that's not true anymore, it uses 6 since the commit bca4ad7c0b54 ("btrfs: reserve correct number of items for unlink and rmdir"). So update the code and comments to consider 6 units. Reviewed-by: Josef B...
```diff diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c index 90b8088e8fac..6edcb32ed4c9 100644 --- a/fs/btrfs/block-rsv.c +++ b/fs/btrfs/block-rsv.c @@ -350,14 +350,14 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info) /* * But we also want to reserve enough space so we can do the fal...
b13d57db90b859dadb33ccdb3716c9c3ed0a825d
Analyze and fix the following issue in the Linux kernel code: btrfs: calculate correct amount of space for delayed reference when evicting
Problem Details: When evicting an inode, we are incorrectly calculating the amount of space required for a single delayed reference in case the free space tree is enabled. We have to multiply by 2 the result of btrfs_calc_insert_metadata_size(). We should be calculating according to the size update and space release of...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 912d5f4aafbc..2e181a0a6f37 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5230,7 +5230,7 @@ static struct btrfs_trans_handle *evict_refill_and_join(struct btrfs_root *root, { struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_trans_h...
007145ff644cc9a2b2b0c3c88ba68824274fcb12
Analyze and fix the following issue in the Linux kernel code: btrfs: accurately calculate number of delayed refs when flushing
Problem Details: When flushing a limited number of delayed references (FLUSH_DELAYED_REFS_NR state), we are assuming each delayed reference is holding a number of bytes matching the needed space for inserting for a single metadata item (the result of btrfs_calc_insert_metadata_size()). That is not correct when using th...
```diff diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 5eb161d96e35..f36b16ee0a02 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -550,6 +550,30 @@ static inline u64 calc_reclaim_items_nr(struct btrfs_fs_info *fs_info, return nr; } +static inline u64 calc_delayed_refs_nr(struct ...
1d0df22a29329105079ba3ded8a569583dd7366d
Analyze and fix the following issue in the Linux kernel code: btrfs: calculate the right space for a single delayed ref when refilling
Problem Details: When refilling the delayed block reserve we are incorrectly computing the amount of bytes for a single delayed reference if the free space tree is being used. In that case we should double the calculated amount. Everywhere else we compute the correct amount, like when updating the delayed block reserve...
```diff diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index bf2ce51e5086..b58a7e30d37c 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -186,6 +186,17 @@ int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info, u64 num_bytes = 0; int ret = -ENOSPC; + /* + * We have to ch...
9d0d47d5c3c5b53d444ecf7022bedc5553c544c0
Analyze and fix the following issue in the Linux kernel code: btrfs: update flush method assertion when reserving space
Problem Details: When reserving space, at space-info.c:__reserve_bytes(), we assert that either the current task is not holding a transacion handle, or, if it is, that the flush method is not BTRFS_RESERVE_FLUSH_ALL. This is because that flush method can trigger transaction commits, and therefore could lead to a deadlo...
```diff diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 3eecce86f63f..379a0e778dfb 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -1603,7 +1603,18 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info, bool pending_tickets; ASSERT(orig_bytes); - ASSERT(!current->journal_i...
b93fa4acbb57470d48de381ec4aef3f481b32d67
Analyze and fix the following issue in the Linux kernel code: btrfs: remove check for NULL block reserve at btrfs_block_rsv_check()
Problem Details: The block reserve passed to btrfs_block_rsv_check() is never NULL, so remove the check. In case it can ever become NULL in the future, then we'll get a pretty obvious and clear NULL pointer dereference crash and stack trace. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana ...
```diff diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c index 5367a14d44d2..364a3d11bf88 100644 --- a/fs/btrfs/block-rsv.c +++ b/fs/btrfs/block-rsv.c @@ -232,9 +232,6 @@ int btrfs_block_rsv_check(struct btrfs_block_rsv *block_rsv, int min_percent) u64 num_bytes = 0; int ret = -ENOSPC; - if (!block_rsv) -...
4e0527deb31191b300380c98fb80757eb591f6f1
Analyze and fix the following issue in the Linux kernel code: btrfs: pass a bool to btrfs_block_rsv_migrate() at evict_refill_and_join()
Problem Details: The last argument of btrfs_block_rsv_migrate() is a boolean, but we are passing an integer, with a value of 1, to it at evict_refill_and_join(). While this is not a bug, due to type conversion, it's a lot more clear to simply pass the boolean true value instead. So just do that. Reviewed-by: Josef Bac...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 76d93b9e94a9..7bae75973a4d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5268,7 +5268,7 @@ static struct btrfs_trans_handle *evict_refill_and_join(struct btrfs_root *root, trans->block_rsv = &fs_info->trans_block_rsv; trans->bytes_reserved ...
d1cc579383191fe6c3f1eeac45eb50b8976d38de
Analyze and fix the following issue in the Linux kernel code: btrfs: sysfs: relax bg_reclaim_threshold for debugging purposes
Problem Details: Currently, /sys/fs/btrfs/<UUID>/bg_reclaim_threshold is limited to 0 (disable) or [50 .. 100]%, so we need to fill 50% of a device to start the auto reclaim process. It is cumbersome to do so when we want to shake out possible race issues of normal write vs reclaim. Relax the threshold check under the...
```diff diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 37fc58a7f27e..25294e624851 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1262,8 +1262,13 @@ static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj, if (ret) return ret; +#ifdef CONFIG_BTRFS_DEBUG + if (thresh != 0 && (thresh ...
0f202b256a141e6c94398dcf262d4abdf8dff978
Analyze and fix the following issue in the Linux kernel code: btrfs: avoid repetitive define BTRFS_FEATURE_INCOMPAT_SUPP
Problem Details: BTRFS_FEATURE_INCOMPAT_SUPP is defined twice, once under CONFIG_BTRFS_DEBUG and once without it, resulting in repetitive code. The reason for this is to add experimental features under CONFIG_BTRFS_DEBUG. To avoid repetitive code, add a common list BTRFS_FEATURE_INCOMPAT_SUPP_STABLE, and append experi...
```diff diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h index 24cd49229408..abe5b3475a9d 100644 --- a/fs/btrfs/fs.h +++ b/fs/btrfs/fs.h @@ -193,11 +193,7 @@ enum { #define BTRFS_FEATURE_COMPAT_RO_SAFE_SET 0ULL #define BTRFS_FEATURE_COMPAT_RO_SAFE_CLEAR 0ULL -#ifdef CONFIG_BTRFS_DEBUG -/* - * Extent tree v2 supported onl...
5f50fa918f0c1740eb294f9ed532e26a7f1d0cb4
Analyze and fix the following issue in the Linux kernel code: btrfs: do not use replace target device as an extra mirror
Problem Details: [BUG] Currently btrfs can use dev-replace device as an extra mirror for read-repair. But it can lead to NODATASUM corruption in the following case: There is a RAID1 data chunk, and dev-replace is running from dev2 to dev0. |//| = Replaced data X X+1MB X+2MB Dev 2: | |...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b7e1d7dc4509..4714d371b1b9 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5783,13 +5783,6 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len) */ ret = map->num_stripes; free_extent_map(em); - - down_read(&...
4871c33baf56b13559f1e7cb7c065df07c3f068e
Analyze and fix the following issue in the Linux kernel code: btrfs: open_ctree() error handling cleanup
Problem Details: Currently open_ctree() still uses two variables for error handling, err and ret. This can be confusing and missing some errors and does not conform to current coding style. This patch will fix the problems by: - Use only ret for error handling - Add proper ret assignment Originally we rely on the ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 851792edf01f..8aff348369d7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3353,14 +3353,11 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device struct btrfs_root *tree_root; struct btrfs_root *chunk_root;...
7b31e0451d0be0e52bf0d7879066b39d9bd064fe
Analyze and fix the following issue in the Linux kernel code: btrfs: dev-replace: properly follow its read mode
Problem Details: [BUG] Although dev replace ioctl has a way to specify the mode on whether we should read from the source device, it's not properly followed. # mkfs.btrfs -f -d raid1 -m raid1 $dev1 $dev2 # mount $dev1 $mnt # xfs_io -f -c "pwrite 0 32M" $mnt/file # sync # btrfs replace start -r -f 1 $dev3 $mnt An...
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 91aeac36ebc9..c83ac6b80c2f 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -423,11 +423,6 @@ static int scrub_sectors(struct scrub_ctx *sctx, u64 logical, u32 len, static void scrub_bio_end_io(struct bio *bio); static void scrub_bio_end_io_worker(...
544fe4a903ce71fb8ecbc159db6f245ef3f691fe
Analyze and fix the following issue in the Linux kernel code: btrfs: embed a btrfs_bio into struct compressed_bio
Problem Details: Embed a btrfs_bio into struct compressed_bio. This avoids potential (so far theoretical) deadlocks due to nesting of btrfs_bioset allocations for the original read bio and the compressed bio, and avoids an extra memory allocation in the I/O path. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wd...
```diff diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index f42f31f22d13..cd0cfa8fdb8c 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -37,6 +37,8 @@ #include "file-item.h" #include "super.h" +struct bio_set btrfs_compressed_bioset; + static const char* const btrfs_compress_types...
a97699d1d610710fb0103addaac3b590716f2de4
Analyze and fix the following issue in the Linux kernel code: btrfs: replace map_lookup->stripe_len by BTRFS_STRIPE_LEN
Problem Details: Currently btrfs doesn't support stripe lengths other than 64KiB. This is already set in the tree-checker. There is really no meaning to record that fixed value in map_lookup for now, and can all be replaced with BTRFS_STRIPE_LEN. Furthermore we can use the fix stripe length to do the following optimi...
```diff diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 5fc670c27f86..b27474731e7b 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1977,12 +1977,12 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, map = em->map_lookup; data_stripe_length = em->orig_bl...
9a93b5a35388aabb061212e906221a540ffdb965
Analyze and fix the following issue in the Linux kernel code: btrfs: abort the transaction if we get an error during snapshot drop
Problem Details: We were seeing weird errors when we were testing our btrfs backports before we had the incorrect level check fix. These errors appeared to be improper error handling, but error injection testing uncovered that the errors were a result of corruption that occurred from improper error handling during sna...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 30720ea94a82..6b6c59e6805c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5708,12 +5708,14 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) ret = walk_down_tree(trans, root, path, wc);...
6989627db074a3db0ca297657bcb8709d8c888c0
Analyze and fix the following issue in the Linux kernel code: btrfs: drop root refs properly when orphan cleanup fails
Problem Details: When we mount the file system we do something like this: while (1) { lookup fs roots; for (i = 0; i < num_roots; i++) { ret = btrfs_orphan_cleanup(roots[i]); if (ret) break; btrfs_put_root(roots[i]); } } for (; i < num_roots; i++) btrfs_put_root(roots[i]); As you can see if ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9e1596bb208d..d9f66f411c02 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4404,12 +4404,12 @@ int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) root_objectid = gang[i]->root_key.objectid; err = btrfs_orphan_cleanup(gang[i])...
9cf14029d5fb42126b332aea708b787be9a5079e
Analyze and fix the following issue in the Linux kernel code: btrfs: handle errors from btrfs_read_node_slot in split
Problem Details: While investigating a problem with error injection I tripped over curious behavior in the node/leaf splitting code. If we get an EIO when trying to read either the left or right leaf/node for splitting we'll simply treat the node as if it were full and continue on. The end result of this isn't too ba...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index a1c109d7956a..e1045e6d5e84 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1064,11 +1064,14 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, BTRFS_NODEPTRS_PER_BLOCK(fs_info) / 4) return 0; - left = btrfs_read_node_...
13b98989c81a64b6674f017324b37bedf158567e
Analyze and fix the following issue in the Linux kernel code: btrfs: use btrfs_handle_fs_error in btrfs_fill_super
Problem Details: While trying to track down a lost EIO problem I hit the following assertion while doing my error injection testing BTRFS warning (device nvme1n1): transaction 1609 (with 180224 dirty metadata bytes) is not committed assertion failed: !found, in fs/btrfs/disk-io.c:4456 ------------[ cut here ]---...
```diff diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 366fb4cde145..03aaf8de9cab 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1158,6 +1158,7 @@ static int btrfs_fill_super(struct super_block *sb, inode = btrfs_iget(sb, BTRFS_FIRST_FREE_OBJECTID, fs_info->fs_root); if (IS_ERR(inode)) { err = ...
3d2892e05086d09aecf14ea64b2debbf495e313c
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: connac: fix txd multicast rate setting
Problem Details: The vif->bss_conf.mcast_rate should be applied to multicast data frame only. Fixes: 182071cdd594 ("mt76: connac: move connac2_mac_write_txwi in mt76_connac module") Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c index bd4ce2c7742d..a51a2d4ff2f8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c @@ -558,7 +558,8 @@ void mt76_con...
3d78c46423c6567ed25ca033e086865b1b4d5ae1
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921e: stop chip reset worker in unregister hook
Problem Details: If the chip reset worker is triggered during the remove process, the chip DMA may not be properly pushed back to the idle state. This can lead to corruption of the DMA flow due to the chip reset. Therefore, it is necessary to stop the chip reset before the DMA is finalized. To avoid resetting the chip...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index 40bea17cc440..1c727870bbdb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -113,9 +113,10 @@ static void mt7921e_unregister_d...
87714bf6ed1589813e473db5471e6e9857755764
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921e: improve reliability of dma reset
Problem Details: The hardware team has advised the driver that it is necessary to first put WFDMA into an idle state before resetting the WFDMA. Otherwise, the WFDMA may enter an unknown state where it cannot be polled with the right state successfully. To ensure that the DMA can work properly while a stressful cold re...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c index 28207172c4ef..f0a80c2b476a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c @@ -66,22 +66,6 @@ static void mt7921_dma_prefetch(st...
5c47cdebbaeb7724df6f9f46917c93e53f791547
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: fix missing unwind goto in `mt7921u_probe`
Problem Details: `mt7921u_dma_init` can only return zero or negative number according to its definition. When it returns non-zero number, there exists an error and this function should handle this error rather than return directly. Fixes: 0d2afe09fad5 ("mt76: mt7921: add mt7921u driver") Signed-off-by: Jiefeng Li <jie...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c index 9b05e4577cdf..1f302c430339 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c @@ -259,7 +259,7 @@ static int mt7921u_probe(struct u...
12db28c3ef31f719bd18fa186a40bb152e6a527c
Analyze and fix the following issue in the Linux kernel code: mt76: mt7921: fix kernel panic by accessing unallocated eeprom.data
Problem Details: The MT7921 driver no longer uses eeprom.data, but the relevant code has not been removed completely since commit 16d98b548365 ("mt76: mt7921: rely on mcu_get_nic_capability"). This could result in potential invalid memory access. To fix the kernel panic issue in mt7921, it is necessary to avoid access...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 259b6ea88be4..c69ce6df4956 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -15,24 +15,6 @@ static bool mt7921_disable_clc; m...
03eb52dd78cab08f13925aeec8315fbdbcba3253
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: add Netgear AXE3000 (A8000) support
Problem Details: Issue: Though the Netgear AXE3000 (A8000) is based on the mt7921 chipset because of the unique USB VID:PID combination this device does not initialize/register. Thus making it not plug and play. Fix: Adds support for the Netgear AXE3000 (A8000) based on the Mediatek mt7921au chipset. The method of act...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c index 46118421ef28..9b05e4577cdf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c @@ -18,6 +18,9 @@ static const struct usb_device_id m...
268079896060b224cb0a42eb6ca0d0a0836c46bb
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7915: drop redundant prefix of mt7915_txpower_puts()
Problem Details: Just a cosmetic patch to drop redundant prefix for txpower ouput text. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c index 5a46813a59ea..879884ead660 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c @@ -958,10 +958,10 @@ mt7915_xmit_que...
23792cedaff02351b57bddd8957fc917fa88f2e0
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: fix 6GHz high channel not be scanned
Problem Details: mt76 scan command only support 64 channels currently. If the channel count is larger than 64(for 2+5+6GHz), some channels will not be scanned. Hence change the scan type to full channel scan in case of the command cannot include proper list for chip. Fixes: 399090ef9605 ("mt76: mt76_connac: move hw_sc...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 008ece1b16f8..cb27885b5da7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1678,8 +1678,16 @@ int mt76_c...
c397fc1e6365a2a9e5540a85b2c1d4ea412aa0e2
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921e: fix probe timeout after reboot
Problem Details: In system warm reboot scene, due to the polling timeout(now 1000us) is too short to wait dma idle in time, it may make driver probe fail with error code -ETIMEDOUT. Meanwhile, we also found the dma may take around 70ms to enter idle state. Change the polling idle timeout to 100ms to avoid the probabili...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c index 1d85c0c10049..28207172c4ef 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c @@ -90,9 +90,9 @@ static int mt7921_dma_disable(struc...
09d4d6da1b65d09414e7bce61459593f3c80ead1
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921e: Set memory space enable in PCI_COMMAND if unset
Problem Details: When the BIOS has been configured for Fast Boot, systems with mt7921e have non-functional wifi. Turning on Fast boot caused both bus master enable and memory space enable bits in PCI_COMMAND not to get configured. The mt7921 driver already sets bus master enable, but explicitly check and set memory a...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index b520cd258170..974412b6f76a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -262,6 +262,7 @@ static int mt7921_pci_probe(struc...
a5af1481a85679a9812f728ee5cf64ee7edbe669
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: use driver flags rather than mac80211 flags to mcu
Problem Details: FIF_* flags from mac80211 is not ABI. mt7921 should not pass it into mcu directly. Remap FIF_* to driver defined flags as mcu command input. Fixes: c222f77fd421 ("wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistent") Signed-off-by: Neil Chen <yn.chen@mediatek.com> Signed-off-by: Deren W...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index a72964e7a807..f1d537a7705a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -703,10 +703,25 @@ static void mt7921_configur...
72fc0df3006ce5c109f9c68f0724e44c47b4ec7b
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: fix eeprom tx path bitfields
Problem Details: Swap the tx path bitfields of band1 and band2 to read correct setting. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix F...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h index 5571881f639b..0c749774f6b1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h +++ b/drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h @@ -31,11 +31,11 @@ enum mt7996_eeprom_fi...
8b14ce24a0297175bc4ebdf26d45a22b5a33847f
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: fix pointer calculation in ie countdown event
Problem Details: Fix the tail and data pointers. The rxd->len in mt7996_mcu_rxd does not include the length of general rxd. It only includes the length of firmware event rxd. Use skb->length to get the correct length. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index bb95fdda0eba..29ff4c191a3c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -422,7 +422,8 @@ mt7996_mcu_ie_countdown(struct mt...
d0b6f86fdbefa62fd4ad2acd1aea6c45f9b518ba
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: let non-bufferable MMPDUs use correct hw queue
Problem Details: Pass qid into mt7996_mac_write_txwi() to let the tx descriptor of non-bufferable MMPDUs be filled with correct hw queue index. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietk...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index d811b4e01800..f1414a448023 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -982,8 +982,9 @@ mt7996_mac_write_txwi_80211(struc...
d51425190805d47aecc1910b272e65476dd3b937
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Fix failures of checksum Kunit tests
Problem Details: Scott reports that when the new GSS krb5 Kunit tests are built as a separate module and loaded, the RFC 6803 and RFC 8009 checksum tests all fail, even though they pass when run under kunit.py. It appears that passing a buffer backed by static const memory to gss_krb5_checksum() is a problem. A printk...
```diff diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c index aa6ec4e858aa..95ca783795c5 100644 --- a/net/sunrpc/auth_gss/gss_krb5_test.c +++ b/net/sunrpc/auth_gss/gss_krb5_test.c @@ -73,7 +73,6 @@ static void checksum_case(struct kunit *test) { const struct gss_krb5_test_param...
5b8ccdfb943f6a03c676d2ea816dd38c149e920b
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: add missing locking to protect against concurrent rx/status calls
Problem Details: According to the documentation, ieee80211_rx_list must not run concurrently with ieee80211_tx_status (or its variants). Cc: stable@vger.kernel.org Fixes: 88046b2c9f6d ("mt76: add support for reporting tx status with skb") Reported-by: Brian Coverstone <brian@mainsequence.net> Signed-off-by: Felix Fiet...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 738d7e1569bf..6c0174313d09 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -578,7 +578,9 @@ free: free_skb: status.skb = tx_info.skb; hw = mt76_tx_s...
9e47dd9f64a47ae00ca0123017584c37209ee900
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: handle failure of vzalloc in mt7615_coredump_work
Problem Details: vzalloc may fails, dump might be null and will cause illegal address access later. Link: https://lore.kernel.org/all/Y%2Fy5Asxw3T3m4jCw@lore-desk Fixes: d2bf7959d9c0 ("mt76: mt7663: introduce coredump support") Signed-off-by: Kang Chen <void0red@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index a95602473359..6d6b46d7bd1a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -2380,7 +2380,7 @@ void mt7615_coredump_work(struc...
9c97df11dfe68b548a47744ba9fa6beddcfba2bc
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7915: rework init flow in mt7915_thermal_init()
Problem Details: If kernel do not enable CONFIG_HWMON, it may cause thermal initialization to be done with temperature value 0 and then can not transmit. This commit fixes it by setting trigger/restore temperature before checking CONFIG_HWMON. Fixes: 7d12b38ab6f6 ("wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throt...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 4f3efc942a4d..71ccefd39cb2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -203,6 +203,10 @@ static int mt7915_thermal_in...
90fb69212c60e26ef70ed0e8532b116c7649ac88
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7915: expose device tree match table
Problem Details: On MT7986 the WiFi driver currently does not get automatically loaded, requiring manual modprobing because the device tree compatibles are not exported into metadata. Add the missing MODULE_DEVICE_TABLE macro to fix this. Fixes: 99ad32a4ca3a2 ("mt76: mt7915: add support for MT7986") Signed-off-by: Lo...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c index 2ac0a0f2859c..32c137066e7f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c @@ -1239,6 +1239,8 @@ static const struct of_device_i...
63a3724632464559d1e98d90d2c63d43ec6ef6f5
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: fix radiotap bitfield
Problem Details: The 11be generation's radiotap bitfields were wrongly copy-and-pasted from 11ax driver, so fix them accordingly. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index c9a9f0e31771..3c3506c7c87a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -260,12 +260,9 @@ mt7996_mac_decode_he_radiotap_ru...
cdc215c2c8d74b3c8886650e979b47f16c1f7f92
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7915: unlock on error in mt7915_thermal_temp_store()
Problem Details: Drop the lock before returning -EINVAL. Fixes: ecaccdae7a7e ("wifi: mt76: mt7915: rework mt7915_thermal_temp_store()") Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 5e288116b1b0..4f3efc942a4d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -89,6 +89,7 @@ static ssize_t mt7915_thermal_t...
df5e5bfdb1d52c5524f21e34488a37f3fe2badad
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7996: Remove unneeded semicolon
Problem Details: ./drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:3136:3-4: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4059 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delr...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index dbe30832fd88..8ad51cbfdbe8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -3133,7 +3133,7 @@ int mt7996_mcu_get_chip_config(...
9270270d62191b7549296721e8d5f3dc0df01563
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: fix PCI DMA hang after reboot
Problem Details: mt7921 just stop some workers and clean up chip status before reboot. In stress test, there are working activities still running at the period of .shutdown callback and that would cause some hosts cannot recover DMA after reboot. To avoid the floating state in reboot, we use mt7921_pci_remove() to full...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index cb72ded37256..1a8a54a46dcc 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -509,17 +509,7 @@ failed: static void mt7921_pc...
fcc51acfebb85dbc3ab1bea3ce4997d7c0a3a38d
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: mt7921: fix wrong command to set STA channel
Problem Details: Should not use AND operator to check vif type NL80211_IFTYPE_MONITOR, and that will cause we go into sniffer command for both STA and MONITOR mode. However, the sniffer command would set channel properly (with some extra options), the STA mode still works even if using the wrong command. Fix vif type ...
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 75eaf86c6a78..a72964e7a807 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -1695,7 +1695,7 @@ static void mt7921_ctx_iter...
532f0482fc577a78c0086893ab39acb406ac3e65
Analyze and fix the following issue in the Linux kernel code: wifi: mt76: remove redundent MCU_UNI_CMD_* definitions
Problem Details: clear redundent definitions only Fixes: 5b55b6da982c ("wifi: mt76: mt7921: add unified ROC cmd/event support") Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
```diff diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h index a5e6ee4daf92..40a99e0caded 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h @@ -967,9 +967,6 @@ enum { DEV_...
7363d6bedc000f6f9d09cfe498da2f3aca653778
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout()
Problem Details: Commit 41d351f29528 ("drm/nouveau: stop using ttm_bo_wait") converted from ttm_bo_wait_ctx() to dma_resv_wait_timeout(). However, dma_resv_wait_timeout() returns greater than zero on success as opposed to ttm_bo_wait_ctx(). As a result, relocs will fail and log errors even when it was a success. Chang...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index f77e44958037..ab9062e50977 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -645,7 +645,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli, struct drm_...
257aedb72e731082ab514058e57b132f0b29d707
Analyze and fix the following issue in the Linux kernel code: drivers/perf: hisi: add NULL check for name
Problem Details: When allocations fails that can be NULL now. If the name provided is NULL, then the initialization process of the PMU type and dev will be skipped in function perf_pmu_register(). Consequently, the PMU will not be able to register into the kernel. Moreover, in the case of unregister the PMU, the funct...
```diff diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index 8a3d74ddcd6d..ffb039d05d07 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -499,13 +499,6 @@ static int hisi_ddrc_pmu_probe(struct pl...
e04e4b6e01e71978d5df92a5f25b472e1827b46b
Analyze and fix the following issue in the Linux kernel code: wifi: ath9k: fix per-packet TX-power cap for TPC
Problem Details: Fix incorrect usage of plain rate_idx as index into the max (power) per rate lookup table. For transmit power control (TPC), the ath9k driver maintains internal tables (in struct ath_hw) to store the max allowed power level per rate. They are used to limit a given TX-power according to regulatory and ...
```diff diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index ef9a8e0b75e6..f6f2ab7a63ff 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -34,6 +34,12 @@ #define NUM_SYMBOLS_PER_USEC(_usec) (_usec >> 2) #define NUM_SYMBOLS_PER...
41e02bf4ae32cf2ac47b08b4caaa9c1a032e4ce7
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix undefined behavior with __fls in dp
Problem Details: "__fls" would have an undefined behavior if the argument is passed as "0". Hence, added changes to handle the same. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com> Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com> S...
```diff diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index ab6b18de6371..847da167a41c 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -3598,7 +3598,7 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, goto ...
c55c0e91c813589dc55bea6bf9a9fbfaa10ae41d
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: fix ifdef to also consider nf_tables=m
Problem Details: nftables can be built as a module, so fix the preprocessor conditional accordingly. Fixes: 478b360a47b7 ("netfilter: nf_tables: fix nf_trace always-on with XT_TRACE=n") Reported-by: Florian Fainelli <f.fainelli@gmail.com> Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Florian Westphal <f...
```diff diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1ec3530c8191..dbcaac8b6966 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4713,7 +4713,7 @@ static inline void nf_reset_ct(struct sk_buff *skb) static inline void nf_reset_trace(struct sk_buff *skb) { -#if IS_ENABLED(CO...
3a133f7c51b20d5d330d5424f3ef0dc283992500
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: Fix Embedded Controller access on X380 Yoga
Problem Details: On the X380 Yoga, the `ECRD` and `ECWR` ACPI objects cannot be used for accessing the Embedded Controller: instead of a method that reads from the EC's memory, `ECRD` is the name of a location in high memory. This meant that trying to call them would fail with the following message: ACPI: \_SB.PCI0....
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 32c10457399e..826c522ed1c0 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -11691,6 +11691,7 @@ static int __init thinkpad_acpi_module_init(void) { const struct dmi_s...
5c690db63b45c6c4c4932b13173af71df369dba5
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: Disable Spectral scan upon removing interface
Problem Details: Host might receive spectral events during interface down sequence and this might create below errors. failed to handle dma buf release event -22 failed to handle dma buf release event -22 Fix this by disabling spectral config during remove interface. Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-0086...
```diff diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index c0dc3e387aad..4447fd4bd68f 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6685,6 +6685,11 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw, ...
9fde30562840837e4e2138bc3f88dba2b9963d98
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: coex: Add path control register to monitor list
Problem Details: Chips use similar hardware for path control, but could different path/antenna configuration. Add these register to monitor, if there are wrong settings, these register can help to debug. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: K...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b.c b/drivers/net/wireless/realtek/rtw89/rtw8852b.c index c9a9f28b056c..ea4a4dc63312 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852b.c @@ -364,7 +364,9 @@ static const struct rtw89_btc_fbtc_mreg r...
deb1b2aed763828b54a5be9be76c3a43c295f9f0
Analyze and fix the following issue in the Linux kernel code: wifi: rtw89: fix power save function in WoWLAN mode
Problem Details: In WoWLAN Mode, it's expected that WiFi chip could enter power save mode only after all setting is finished, but current wow_enter_lps function break the rule and may lead to WoWLAN function fail in low probability, so fix it. Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Ping...
```diff diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index d144903c60b3..8459a7bfa32f 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -2503,7 +2503,7 @@ static void rtw89_vif_enter_lps(struct rtw89_dev *rtwde...
afa965a45e01e541cdbe5c8018226eff117610f0
Analyze and fix the following issue in the Linux kernel code: drm/rockchip: vop2: fix suspend/resume
Problem Details: During a suspend/resume cycle the VO power domain will be disabled and the VOP2 registers will reset to their default values. After that the cached register values will be out of sync and the read/modify/write operations we do on the window registers will result in bogus values written. Fix this by re-...
```diff diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index ba3b81789509..d9daa686b014 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -215,6 +215,8 @@ struct vop2 { struct vop2_win win[]; }; ...
338469d677e5d426f5ada88761f16f6d2c7c1981
Analyze and fix the following issue in the Linux kernel code: net/sched: clear actions pointer in miss cookie init fail
Problem Details: Palash reports a UAF when using a modified version of syzkaller[1]. When 'tcf_exts_miss_cookie_base_alloc()' fails in 'tcf_exts_init_ex()' a call to 'tcf_exts_destroy()' is made to free up the tcf_exts resources. In flower, a call to '__fl_put()' when 'tcf_exts_init_ex()' fails is made; Then calling '...
```diff diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 2a6b6be0811b..35785a36c802 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3235,6 +3235,9 @@ int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, err_miss_alloc: tcf_exts_destroy(exts); +#ifdef CONFIG_NET_CLS_AC...
99676a5766412f3936c55b9d18565d248e5463ee
Analyze and fix the following issue in the Linux kernel code: net: lan966x: Fix lan966x_ifh_get
Problem Details: From time to time, it was observed that the nanosecond part of the received timestamp, which is extracted from the IFH, it was actually bigger than 1 second. So then when actually calculating the full received timestamp, based on the nanosecond part from IFH and the second part which is read from HW, i...
```diff diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 9be6462f1cc5..2b6e046e1d10 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -605,7 +605,7 @@ static u6...
d7f5e83913d1bcd50968972a7b50e49c9a14b2af
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: Drop RTC clock-frequency on rk3588-rock-5b
Problem Details: The hym8563 RTC driver doesn't handle the 'clock-frequency' property, which is also indicated by the following dtbs_check warning: rk3588-rock-5b.dtb: rtc@51: Unevaluated properties are not allowed ('clock-frequency' was unexpected) From schema: Documentation/devicetree/bindings/rtc/haoyu,hym8563....
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index 88b9f7ddf291..62750beb12aa 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -60,7 +60,6 @@ compatible = "haoyu,hym8563"; ...
f6e7ac4c35a28aef0be93b32c533ae678ad0b9e7
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd: pmc: Fix memory leak in amd_pmc_stb_debugfs_open_v2()
Problem Details: Function amd_pmc_stb_debugfs_open_v2() may be called when the STB debug mechanism enabled. When amd_pmc_send_cmd() fails, the 'buf' needs to be released. Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn> Link: https://lore.kernel.org/r/20230412093734.1126410-1-jiangfeng@kylinos.cn Reviewed-by: Hans de...
```diff diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c index 877b629e5cae..14d3ff425300 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc.c @@ -265,6 +265,7 @@ static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) dev->msg_port = 0; ...
9ec71b52cc6b72ca13258f942b16f3207e3d6502
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: move debug buffer allocation failure to info verbosity
Problem Details: This is noising the kernel log and customers asked to hush it down. We can live with this message in "info" verbosity. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230416154301.0a7f557aa2a0.If9db47...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 546737320a57..898d5dcf1012 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -803,7 +803,7 @@ static void iwl_dbg_tlv_updat...
28965ec0b5d9112585f725660e2ff13218505ace
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: make the loop for card preparation effective
Problem Details: Since we didn't reset t to 0, only the first iteration of the loop did checked the ready bit several times. From the second iteration and on, we just tested the bit once and continued to the next iteration. Reported-and-tested-by: Lorenzo Zolfanelli <lorenzo@zolfa.nl> Link: https://bugzilla.kernel.org...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index c5446b82c6c7..b281850fbf7a 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -599,7 +599,6 @@ static int iwl_pcie_set_hw_ready(...
6f2c5f38a7917a04a43494eda48aa71da97484e3
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: use correct sta mask to remove queue
Problem Details: When we remove a queue we need to use the currently active firmware stations in the mask, not the deflink one. Fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230416154301.01cdd2153418.I176d...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index c5d25772159b..819e05a6f651 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -299,7 +299,7 @@ int iwl_mvm_mld_add_aux_sta(s...
85eb75c34eadb892d89e506619c6c49b194a392b
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: avoid iterating over an un-initialized list
Problem Details: The initiator smooth list is initialized only in iwl_mvm_up(), but is cleared in iwl_mvm_mac_stop. This may result in iterating over the list before it was initialized in case iwl_mvm_up() failed early. Fix it by moving the list initialization to an earlier stage. Fixes: b68bd2e3143a ("iwlwifi: mvm: A...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 3f5cc6bf3f1c..b35c96cf7ad2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1727,8 +1727,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) iwl_mvm_t...
69e1089316271f7651a3a7ce3b3509405f5b2b8a
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: Fix _iwl_mvm_get_scan_type()
Problem Details: The usage of the 'dtim_period' value was wrong, as it is only a multiplier of the beacon interval, and thus, beacon interval should also be considered. Fix it. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 7ac9bdbfe194..38b68827a4bd 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -240,8 +240,9 @@ iwl_mvm_scan_type _iwl_mvm_get_scan_type(...
0af637b5719fee09d006e83e1eecd235f7bc62f3
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: fix getting lowest TX rate for MLO
Problem Details: In iwl_mvm_mac_ctxt_get_lowest_rate() we were still accessing vif->bss_conf without any multi-link provisions, and also the info->band, both of which isn't valid in MLO. Fix the code to look at the correct link. In case of EAPOL transmissions for the initial 4-way-HS, look up the correct link here as ...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 20db9fc2e61a..389eef453d17 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -874,13 +874,40 @@ u8 iwl_mvm_mac_ctxt_get...
ab4f869fba6119997f7630d600049762a2b014fa
Analyze and fix the following issue in the Linux kernel code: drm/panel: otm8009a: Set backlight parent to panel device
Problem Details: This is the logical place to put the backlight device, and it also fixes a kernel crash if the MIPI host is removed. Previously the backlight device would be unregistered twice when this happened - once as a child of the MIPI host through `mipi_dsi_host_unregister`, and once when the panel device is de...
```diff diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index b4729a94c34a..898b892f1143 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -471,7 +471,7 @@ static int otm8009a_probe(str...
bd4b28189469492df2b962d737842c311ce2659c
Analyze and fix the following issue in the Linux kernel code: sctp: delete the obsolete code for the host name address param
Problem Details: In the latest RFC9260, the Host Name Address param has been deprecated. For INIT chunk: Note 3: An INIT chunk MUST NOT contain the Host Name Address parameter. The receiver of an INIT chunk containing a Host Name Address parameter MUST send an ABORT chunk and MAY include an "Unresolvable Addr...
```diff diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index a0933efd93c3..070c9458fff4 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1711,7 +1711,6 @@ struct sctp_association { __u16 ecn_capable:1, /* Can peer do ECN? */ ipv4_address:1, /* Peer under...
5dd45b66742a1f3cfa9a92dc0ac8714c7708ee6c
Analyze and fix the following issue in the Linux kernel code: drm/panel: novatek-nt35950: Improve error handling
Problem Details: In a very peculiar case when probing and registering with the secondary DSI host succeeds, but the OF backlight or DSI attachment fails, the primary DSI device is automatically cleaned up, but the secondary one is not, leading to -EEXIST when the driver core tries to handle -EPROBE_DEFER. Unregister t...
```diff diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c index abf752b36a52..7498fc6258bb 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c @@ -585,8 +585,11 @@ static int nt35950_probe(struct mipi_dsi...
0fcd72df8847d3a62eb34a084862157ce0564a94
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: join: fix ShellCheck warnings
Problem Details: Most of the code had an issue according to ShellCheck. That's mainly due to the fact it incorrectly believes most of the code was unreachable because it's invoked by variable name, see how the "tests" array is used. Once SC2317 has been ignored, three small warnings were still visible: - SC2155: De...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index fafd19ec7e1f..26310c17b4c6 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -6,6 +6,10 @@ # address all other issues detected...
e1c71f8f918047ce822dc19b42ab1261ed259fd1
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix fast wake AUX sync len
Problem Details: Fast wake should use 8 SYNC pulses for the preamble and 10-16 SYNC pulses for the precharge. Reduce our fast wake SYNC count to match the maximum value. We also use the maximum precharge length for normal AUX transactions. Cc: stable@vger.kernel.org Cc: Jouni Högander <jouni.hogander@intel.com> Signed...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c index 5a176bfb10a2..30c98810e28b 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c @@ -163,7 +163,7 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *...
a80bb8e7233b2ad6ff119646b6e33fb3edcec37b
Analyze and fix the following issue in the Linux kernel code: sfc: Fix use-after-free due to selftest_work
Problem Details: There is a use-after-free scenario that is: When the NIC is down, user set mac address or vlan tag to VF, the xxx_set_vf_mac() or xxx_set_vf_vlan() will invoke efx_net_stop() and efx_net_open(), since netif_running() is false, the port will not start and keep port_enabled false, but selftest_work is s...
```diff diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 884d8d168862..1eceffa02b55 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -541,7 +541,6 @@ int efx_net_open(struct net_device *net_dev) else efx->state = STATE_NET_UP; - efx_selftest_as...
c6d6ef3ee3b6118dae6b32816e43c790f81079b2
Analyze and fix the following issue in the Linux kernel code: net: phy: micrel: Fix PTP_PF_PEROUT for lan8841
Problem Details: If the 1PPS output was enabled and then lan8841 was configured to be a follower, then target clock which is used to generate the 1PPS was not configure correctly. The problem was that for each adjustments of the time, also the nanosecond part of the target clock was changed. Therefore the initial nanos...
```diff diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 2184b1e859ae..602e5a46b796 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -3761,7 +3761,7 @@ static int lan8841_ptp_update_target(struct kszphy_ptp_priv *ptp_priv, const struct timespec64 *ts) { return l...
853618d5886bf94812f31228091cd37d308230f7
Analyze and fix the following issue in the Linux kernel code: virtio_net: bugfix overflow inside xdp_linearize_page()
Problem Details: Here we copy the data from the original buf to the new page. But we not check that it may be overflow. As long as the size received(including vnethdr) is greater than 3840 (PAGE_SIZE -VIRTIO_XDP_HEADROOM). Then the memcpy will overflow. And this is completely possible, as long as the MTU is large, su...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 2396c28c0122..ea1bd4bb326d 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -814,8 +814,13 @@ static struct page *xdp_linearize_page(struct receive_queue *rq, int page_off, unsigned int *len) {...
e28f6966ac8021d8b677fe3839361db8c9344206
Analyze and fix the following issue in the Linux kernel code: dma-buf/dma-resv.c: fix a typo
Problem Details: The dma_resv_wait_timeout() function return a value greater than zero on success. Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/...
```diff diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index 2a594b754af1..b6f71eb00866 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -660,7 +660,7 @@ EXPORT_SYMBOL_GPL(dma_resv_get_singleton); * dma_resv_lock() already * RETURNS * Returns -ERESTARTSYS if interr...
803033c148f754f32da1b93926c49c22731ec485
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix memory leaks in i915 selftests
Problem Details: This patch fixes memory leaks on error escapes in function fake_get_pages Fixes: c3bfba9a2225 ("drm/i915: Check for integer truncation on scatterlist creation") Signed-off-by: Cong Liu <liucong2@kylinos.cn> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux....
```diff diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 5361ce70d3f2..154801f1c468 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -69,8 +69,10 @@ static int fake_get_pages(struct drm_i915_...