id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
227f51743b61fe3f6fc481f0fb8086bf8c49b8c9
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Fix the max WQE size for static WQE support
Problem Details: When variable size WQE is supported, max_qp_sges reported is more than 6. For devices that supports variable size WQE, the Send WQE size calculation is wrong when an an older library that doesn't support variable size WQE is used. Set the WQE size to 128 when static WQE is supported. Fixes: de1d364c3...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index ecee691ed1e0..460f33914825 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -1006,23 +1006,22 @@ static int bnxt_re_setup_swqe_size(struct bnxt_re_qp *qp,...
c6b2b5c86d448630cea58bf6fdfc761da3e3efb5
Analyze and fix the following issue in the Linux kernel code: RDMA/bnxt_re: Fix the compatibility flag for variable size WQE
Problem Details: For older adapters that doesn't support variable size WQE, driver is wrongly reporting that variable WQE is supported, when the latest library is used. Report the variable WQE capability only if the driver supports it. Fixes: 10a104c0debb ("RDMA/bnxt_re: Enable variable size WQEs for user space appli...
```diff diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 82c1f3b2f825..ecee691ed1e0 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -4272,7 +4272,8 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ...
7ebb00cea49db641b458edef0ede389f7004821d
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix MR cache temp entries cleanup
Problem Details: Fix the cleanup of the temp cache entries that are dynamically created in the MR cache. The cleanup of the temp cache entries is currently scheduled only when a new entry is created. Since in the cleanup of the entries only the mkeys are destroyed and the cache entry stays in the cache, subsequent reg...
```diff diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index c0b1a9cd752b..5505eb70939b 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -802,6 +802,7 @@ struct mlx5_cache_ent { u8 is_tmp:1; u8 disabled:1; u8 fill_to_high_wat...
ee6d57a2e13d11ce9050cfc3e3b69ef707a44a63
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Limit usage of over-sized mkeys from the MR cache
Problem Details: When searching the MR cache for suitable cache entries, don't use mkeys larger than twice the size required for the MR. This should ensure the usage of mkeys closer to the minimal required size and reduce memory waste. On driver init we create entries for mkeys with clear attributes and powers of 2 si...
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 0f90086327fc..81644bb75054 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -49,6 +49,7 @@ enum { MAX_PENDING_REG_MR = 8, }; +#define MLX5_MR_CACHE_PERSISTENT_ENTRY_MIN_DESCS 4 #define...
6f5cd6ac9a4201e4ba6f10b76a9da8044d6e38b0
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix counter update on MR cache mkey creation
Problem Details: After an mkey is created, update the counter for pending mkeys before reshceduling the work that is filling the cache. Rescheduling the work with a full MR cache entry and a wrong 'pending' counter will cause us to miss disabling the fill_to_high_water flag. Thus leaving the cache full but with an ind...
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 511d50491352..0f90086327fc 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -214,9 +214,9 @@ static void create_mkey_callback(int status, struct mlx5_async_work *context) spin_lock_irqsa...
e77127ff6416b17e0b3e630ac46ee5c9a6570f57
Analyze and fix the following issue in the Linux kernel code: RDMA/erdma: Return QP state in erdma_query_qp
Problem Details: Fix qp_state and cur_qp_state to return correct values in struct ib_qp_attr. Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation") Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com> Link: https://patch.msgid.link/20240902112920.58749-4-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky...
```diff diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c index 1d2ae83af0d3..51d619edb6c5 100644 --- a/drivers/infiniband/hw/erdma/erdma_verbs.c +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c @@ -1544,11 +1544,31 @@ int erdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_...
f2710d95724ebbfa35d6d4b82017eeab70994509
Analyze and fix the following issue in the Linux kernel code: drm/xe: Don't keep stale pointer to bo->ggtt_node
Problem Details: When we fail to map a BO in the GGTT, we release our GGTT node placeholder, but leave stale bo->ggtt_node pointer to it, which triggers an assert immediately followed by a crash, due to UAF: [ ] xe 0000:00:02.0: [drm] Assertion `bo->ggtt_node->base.size == bo->size` failed! [ ] WARNING: CPU: 4 PID: 12...
```diff diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index f3fca5565d32..2895f154654c 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -619,16 +619,19 @@ static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo, bo->ggtt_node = xe_ggtt_node_in...
27717f8b17c098c4373ddb8fe89e1a1899c7779d
Analyze and fix the following issue in the Linux kernel code: igb: Always call igb_xdp_ring_update_tail() under Tx lock
Problem Details: Always call igb_xdp_ring_update_tail() under __netif_tx_lock, add a comment and lockdep assert to indicate that. This is needed to share the same TX ring between XDP, XSK and slow paths. Furthermore, the current XDP implementation is racy on tail updates. Fixes: 9cbc948b5a20 ("igb: add XDP support") S...
```diff diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 9dc7c60838ed..1ef4cb871452 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -33,6 +33,7 @@ #include <linux/bpf_trace.h> #include <linux/pm_runtime.h...
d2940002b0aa42898de815a1453b29d440292386
Analyze and fix the following issue in the Linux kernel code: ice: fix VSI lists confusion when adding VLANs
Problem Details: The description of function ice_find_vsi_list_entry says: Search VSI list map with VSI count 1 However, since the blamed commit (see Fixes below), the function no longer checks vsi_count. This causes a problem in ice_add_vlan_internal, where the decision to share VSI lists between filter rules relie...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 0160f0bae8d6..79d91e95358c 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -3264,7 +3264,7 @@ ice_find_vsi_list_entry(struct ice_hw *hw, u8 r...
e6501fc38a7590fc014d7bb5c406974d32c0530f
Analyze and fix the following issue in the Linux kernel code: ice: stop calling pci_disable_device() as we use pcim
Problem Details: Our driver uses devres to manage resources, in particular we call pcim_enable_device(), what also means we express the intent to get automatic pci_disable_device() call at driver removal. Manual calls to pci_disable_device() misuse the API. Recent commit (see "Fixes" tag) has changed the removal actio...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index c7db88b517da..ea780d468579 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5363,7 +5363,6 @@ err_load: ice_deinit(pf); err_init: ice_adapter_pu...
e843cf7b34fe2e0c1afc55e1f3057375c9b77a14
Analyze and fix the following issue in the Linux kernel code: ice: fix accounting for filters shared by multiple VSIs
Problem Details: When adding a switch filter (such as a MAC or VLAN filter), it is expected that the driver will detect the case where the filter already exists, and return -EEXIST. This is used by calling code such as ice_vc_add_mac_addr, and ice_vsi_add_vlan to avoid incrementing the accounting fields such as vsi->nu...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index fe8847184cb1..0160f0bae8d6 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -3194,7 +3194,7 @@ ice_add_update_vsi_list(struct ice_hw *hw, ...
9debb703e14939dfafa5d403f27c4feb2e9f6501
Analyze and fix the following issue in the Linux kernel code: ice: Fix lldp packets dropping after changing the number of channels
Problem Details: After vsi setup refactor commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") ice_cfg_sw_lldp function which removes rx rule directing LLDP packets to vsi is moved from ice_vsi_release to ice_vsi_decfg function. ice_vsi_decfg is used in more cases than just in vsi_release resulting i...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 737c00b02dd0..2405e5ed9128 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2413,13 +2413,6 @@ void ice_vsi_decfg(struct ice_vsi *vsi) struct ice_pf *p...
20471071f198c8626dbe3951ac9834055b387844
Analyze and fix the following issue in the Linux kernel code: hwmon: (pmbus) Conditionally clear individual status bits for pmbus rev >= 1.2
Problem Details: The current implementation of pmbus_show_boolean assumes that all devices support write-back operation of status register to clear pending warnings or faults. Since clearing individual bits in the status registers was only introduced in PMBus specification 1.2, this operation may not be supported by so...
```diff diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h index fb442fae7b3e..0bea603994e7 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h @@ -418,6 +418,12 @@ enum pmbus_sensor_classes { enum pmbus_data_format { linear = 0, ieee754, direct, vid }; enum vrm_version { vr...
33297cef3101d950cec0033a0dce0a2d2bd59999
Analyze and fix the following issue in the Linux kernel code: platform/x86: panasonic-laptop: Allocate 1 entry extra in the sinf array
Problem Details: Some DSDT-s have an off-by-one bug where the SINF package count is one higher than the SQTY reported value, allocate 1 entry extra. Also make the SQTY <-> SINF package count mismatch error more verbose to help debugging similar issues in the future. This fixes the panasonic-laptop driver failing to p...
```diff diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 39044119d2a6..ebd81846e2d5 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -337,7 +337,8 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc) } ...
f52e98d16e9bd7dd2b3aef8e38db5cbc9899d6a4
Analyze and fix the following issue in the Linux kernel code: platform/x86: panasonic-laptop: Fix SINF array out of bounds accesses
Problem Details: The panasonic laptop code in various places uses the SINF array with index values of 0 - SINF_CUR_BRIGHT(0x0d) without checking that the SINF array is big enough. Not all panasonic laptops have this many SINF array entries, for example the Toughbook CF-18 model only has 10 SINF array entries. So it on...
```diff diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index cf845ee1c7b1..39044119d2a6 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -773,6 +773,24 @@ static DEVICE_ATTR_RW(dc_brightness); static DEVICE_ATTR_RW(cur...
ceb29504dd80ebdfc09adb942c9ef8d12d4612ca
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix arg to pci_iomap()
Problem Details: Commit 2d8865b27724 ("drm/xe: Move BAR definitions to dedicated file") moved the BAR definition to the header, but replaced the wrong arg in the pci_iomap() function - the last arg is actuall the length, not the BAR. Luckily GTTMMADR_BAR == 0, so it still works. Fix the argument to avoid confusion. Cc...
```diff diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index 3fd462fda625..4aae30880bc6 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -157,15 +157,14 @@ int xe_mmio_init(struct xe_device *xe) { struct xe_tile *root_tile = xe_device_get_root_tile(xe); stru...
b09c71f3e8413ac0a9749f9d0d06f6f0d0b2cc65
Analyze and fix the following issue in the Linux kernel code: ASoC: atmel: mchp-i2s-mcc: Remove interface name from stream_name
Problem Details: Remove the interface name from the stream_name. The interface name (and the index of the interface) can be set in DT using the sound-name-prefix string property. [andrei.simion@microchip: Adjust the commit title] Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Andrei...
```diff diff --git a/sound/soc/atmel/mchp-i2s-mcc.c b/sound/soc/atmel/mchp-i2s-mcc.c index 35a56b266b8d..f40508668ac5 100644 --- a/sound/soc/atmel/mchp-i2s-mcc.c +++ b/sound/soc/atmel/mchp-i2s-mcc.c @@ -936,14 +936,14 @@ static const struct snd_soc_dai_ops mchp_i2s_mcc_dai_ops = { static struct snd_soc_dai_driver mc...
130eb72d3cb38a629205a2a192800b4b1b9bc5c9
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: fix the right check and simplify code
Problem Details: In the file drivers/base/platform.c, the return description of platform_get_irq is 'non-zero IRQ number on success, negative error number on failure.', so the check is wrong, fix it. And when get irq failed, the function platform_get_irq logs an error message. Fixes: 5e2404493f9f ("ASoC: codecs: add M...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c index df6dd8c5bbe5..4ec86b71dd88 100644 --- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c +++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c @@ -2155,11 +2155,11 @@ static int mt8365_afe_pcm_dev_probe(struct platfo...
3fc3e45fcdeaad4b7660b560fcbc827eb733f58e
Analyze and fix the following issue in the Linux kernel code: erofs: fix error handling in z_erofs_init_decompressor
Problem Details: If we get a failure at the first decompressor init (i = 0), the clean up while loop could enter infinite loop due to wrong while check. Check the value of i now to see if we need any clean up at all. Fixes: 5a7cce827ee9 ("erofs: refine z_erofs_{init,exit}_subsystem()") Reported-by: liujinbao1 <liujinb...
```diff diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index c2253b6a5416..eb318c7ddd80 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c @@ -539,7 +539,7 @@ int __init z_erofs_init_decompressor(void) for (i = 0; i < Z_EROFS_COMPRESSION_MAX; ++i) { err = z_erofs_decomp[i] ? z_erofs...
9ed50b8231e37b1ae863f5dec8153b98d9f389b4
Analyze and fix the following issue in the Linux kernel code: erofs: fix incorrect symlink detection in fast symlink
Problem Details: Fast symlink can be used if the on-disk symlink data is stored in the same block as the on-disk inode, so we don’t need to trigger another I/O for symlink data. However, currently fs correction could be reported _incorrectly_ if inode xattrs are too large. In fact, these should be valid images althou...
```diff diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index 419432be3223..4e3ea6689cb4 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -178,12 +178,14 @@ static int erofs_fill_symlink(struct inode *inode, void *kaddr, unsigned int m_pofs) { struct erofs_inode *vi = EROFS_I(inode); - unsigned int...
26f204380a3c182e5adf1a798db0724d6111b597
Analyze and fix the following issue in the Linux kernel code: fs: Fix file_set_fowner LSM hook inconsistencies
Problem Details: The fcntl's F_SETOWN command sets the process that handle SIGIO/SIGURG for the related file descriptor. Before this change, the file_set_fowner LSM hook was always called, ignoring the VFS logic which may not actually change the process that handles SIGIO (e.g. TUN, TTY, dnotify), nor update the relat...
```diff diff --git a/fs/fcntl.c b/fs/fcntl.c index 300e5d9ad913..c28dc6c005f1 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -87,8 +87,8 @@ static int setfl(int fd, struct file * filp, unsigned int arg) return error; } -static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, - ...
36fa259b214c37bbae3e0b7a47e7fb49cb0ab462
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Allow build coverage
Problem Details: There is no build time dependency on anything specific to ARCH_MEDIATEK so enable COMPILE_TEST builds. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Tested-by: Nathan Chancellor <nathan@kernel.org> # build Signe...
```diff diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index e6f7a5a49794..3033e2d3fe16 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -301,7 +301,7 @@ config SND_SOC_MT8195_MT6359 config SND_SOC_MT8365 tristate "ASoC support for MediaTek MT8365 chip" - depends on...
d70ce6d3105a6bd02b1708c399105631643a550a
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Remove unused DMIC IIR coefficient configuration
Problem Details: Nothing ever calls mt8365_dai_load_dmic_iirc_coeff_table() so the compiler warns about an unused static function. While it seems likely that something should be calling the function I don't know what and this is breaking -Werror builds like allmodconfig so let's just remove it. It can be added again al...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-dai-dmic.c b/sound/soc/mediatek/mt8365/mt8365-dai-dmic.c index a3bf54751420..f9945c2a2cd1 100644 --- a/sound/soc/mediatek/mt8365/mt8365-dai-dmic.c +++ b/sound/soc/mediatek/mt8365/mt8365-dai-dmic.c @@ -108,36 +108,6 @@ static void mt8365_dai_disable_dmic(struct mtk_b...
067d832806225cfaabeec8f5f683b7e2bc508a6d
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Remove unused variables
Problem Details: Silence compiler warnings by removing unused variables. Reported-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Nathan Chancellor <nathan@kernel.org> # build S...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c index 54d2112d2e92..21b1319a6c28 100644 --- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c +++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c @@ -651,7 +651,6 @@ static int mt8365_afe_fe_hw_free(struct snd_pcm_subst...
63157d994025639075b3faa372976a96186322c1
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Make non-exported functions static
Problem Details: The compilers warn if functions without a prototype are not static so add appropriate static declarations. Reported-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-clk.c b/sound/soc/mediatek/mt8365/mt8365-afe-clk.c index 300d1f0ae660..8a0af2ea8546 100644 --- a/sound/soc/mediatek/mt8365/mt8365-afe-clk.c +++ b/sound/soc/mediatek/mt8365/mt8365-afe-clk.c @@ -295,7 +295,7 @@ int mt8365_afe_disable_afe_on(struct mtk_base_afe *af...
3e61df7d2ff67875c770a7f548038054d05a0f15
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Remove unused prototype for mt8365_afe_clk_group_48k()
Problem Details: The function is not used outside of the file it is defined and the equivalent function for 44.1kHz is not prototyped so remove the prototype for this function. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Teste...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-common.h b/sound/soc/mediatek/mt8365/mt8365-afe-common.h index 1fa87e54a57f..731406e15ac7 100644 --- a/sound/soc/mediatek/mt8365/mt8365-afe-common.h +++ b/sound/soc/mediatek/mt8365/mt8365-afe-common.h @@ -421,7 +421,6 @@ static inline u32 AutoRstThLo(unsigned in...
1b084d8e3b98ca460b815cff14617719ebe605ad
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Remove spurious unsigned long casts
Problem Details: The regmap APIs take unsigned ints not unsigned longs so casting their arguments to unsigned longs is not a good choice, the constants being cast here are all unsigned ints anyway. Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c index 5003fe5e5ccf..6b4d8b7e24ca 100644 --- a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c +++ b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c @@ -385,7 +385,7 @@ static int mt8365_afe_set_2nd_i2s_asrc(struct mtk_bas...
d01c6a398750aae265c17859b57d7409a6d9181d
Analyze and fix the following issue in the Linux kernel code: ASoC: mt8365: Open code BIT() to avoid spurious warnings
Problem Details: The mt8365 driver uses bits.h to define bitfields but BIT() uses unsigned long constants so does not play well with being bitwise negated and converted to an unsigned int, the compiler complains about width reduction on a number of architectures. Just open code the shifting to avoid the issue. Generat...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-reg.h b/sound/soc/mediatek/mt8365/mt8365-reg.h index b7334c2e64ed..b763cddc93db 100644 --- a/sound/soc/mediatek/mt8365/mt8365-reg.h +++ b/sound/soc/mediatek/mt8365/mt8365-reg.h @@ -734,57 +734,57 @@ #define AFE_IRQ_STATUS_BITS 0x3ff /* AUDIO_TOP_CON0 (0x0000) *...
3e5b2e81f17f176a4d451c1dd1794e64644319c4
Analyze and fix the following issue in the Linux kernel code: printk: Export match_devname_and_update_preferred_console()
Problem Details: When building serial_base as a module, modpost fails with the following error message: ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined! Export the symbol to allow using it from modules. Reported-by: kernel test robot <lkp@intel.com> Clos...
```diff diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index c22b07049c38..6ff8d47e145f 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2620,6 +2620,7 @@ int match_devname_and_update_preferred_console(const char *devname, return -ENOENT; } +EXPORT_SYMBOL_GPL(match_devname_and_upd...
f011c9cf04c06f16b24f583d313d3c012e589e50
Analyze and fix the following issue in the Linux kernel code: io_uring/sqpoll: do not allow pinning outside of cpuset
Problem Details: The submit queue polling threads are userland threads that just never exit to the userland. When creating the thread with IORING_SETUP_SQ_AFF, the affinity of the poller thread is set to the cpu specified in sq_thread_cpu. However, this CPU can be outside of the cpuset defined by the cgroup cpuset cont...
```diff diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index e545bf240d35..272df9d00f45 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/audit.h> #include <linux/security.h> +#include <linux/cpuset.h> #include <linux/io_uring.h> #include <uapi/l...
3079fb09ddac159bd8bb87f6f15b924e265f8d4d
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8186-corsola: Disable DPI display interface
Problem Details: The DPI display interface feeds the external display pipeline. However the pipeline representation is currently incomplete. Efforts are still under way to come up with a way to represent the "creative" repurposing of the DP bridge chip's internal output mux, which is meant to support USB type-C orienta...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi index 0c4a26117428..682c6ad2574d 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi @@ -353,7 +353,8 @@ pinctrl-names = "default", ...
51bc68debab9e30b50c6352315950f3cfc309b32
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8195: Correct clock order for dp_intf*
Problem Details: The clocks for dp_intf* device nodes are given in the wrong order, causing the binding validation to fail. Fixes: 6c2503b5856a ("arm64: dts: mt8195: Add dp-intf nodes") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.ker...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 989e8ac545ac..e89ba384c4aa 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -3252,10 +3252,10 @@ compatible = "mediatek,mt8195-dp-intf"; reg = <0 ...
684d28feb8546d1e9597aa363c3bfcf52fe250b7
Analyze and fix the following issue in the Linux kernel code: debugobjects: Fix conditions in fill_pool()
Problem Details: fill_pool() uses 'obj_pool_min_free' to decide whether objects should be handed back to the kmem cache. But 'obj_pool_min_free' records the lowest historical value of the number of objects in the object pool and not the minimum number of objects which should be kept in the pool. Use 'debug_objects_poo...
```diff diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 7226fdb5e129..6329a86edcf1 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -142,13 +142,14 @@ static void fill_pool(void) * READ_ONCE()s pair with the WRITE_ONCE()s in pool_lock critical * sections. */ - while (READ_ONCE(obj_nr_tofr...
e4757c710ba27a1d499cf5941fc3950e9e542731
Analyze and fix the following issue in the Linux kernel code: debugobjects: Fix the compilation attributes of some global variables
Problem Details: 1. Both debug_objects_pool_min_level and debug_objects_pool_size are read-only after initialization, change attribute '__read_mostly' to '__ro_after_init', and remove '__data_racy'. 2. Many global variables are read in the debug_stats_show() function, but didn't mask KCSAN's detection. Add '_...
```diff diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 7cea91e193a8..7226fdb5e129 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -70,10 +70,10 @@ static HLIST_HEAD(obj_to_free); * made at debug_stats_show(). Both obj_pool_min_free and obj_pool_max_used * can be off. */ -static int obj_p...
19eb465c969f3d6ed1b98506d3e470e863b41e16
Analyze and fix the following issue in the Linux kernel code: iommu/arm-smmu-qcom: apply num_context_bank fixes for SDM630 / SDM660
Problem Details: The Qualcomm SDM630 / SDM660 platform requires the same kind of workaround as MSM8998: some IOMMUs have context banks reserved by firmware / TZ, touching those banks resets the board. Apply the num_context_bank workaround to those two SMMU devices in order to allow them to be used by Linux. Fixes: b8...
```diff diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index 087fb4f6f4d3..6372f3e25c4b 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -286,8 +286,15 @@ static int qcom_smmu_cfg_probe(struct arm_smmu_devic...
5b04d44d5c74e4d8aab1678496b84700b4b343fe
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Fix missing call to phy_power_off() in error handling
Problem Details: Fix missing call to phy_power_off() in the error path of imx6_pcie_host_init(). Remove unnecessary check for imx6_pcie->phy as the PHY API already handles NULL pointers. Fixes: cbcf8722b523 ("phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()") Link: https://lore.kernel.o...
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 3b739aa7c516..eaec471c4623 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -953,7 +953,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) ret = phy_power_...
5cb3aa92c7cf182940ae575c3f450d3708af087c
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI
Problem Details: Correct occasional MSI triggering failures in i.MX8MP PCIe EP by applying the correct hardware outbound alignment requirement. The i.MX platform has a restriction about outbound address translation. The pci-epc-mem uses page_size to manage it. Set the correct page_size for i.MX platform to meet the ha...
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 42fd17fbadfa..3b739aa7c516 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1113,6 +1113,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, if (imx6_che...
5214ff221a14cadab1e2ee29499750fd5e884feb
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Fix establish link failure in EP mode for i.MX8MM and i.MX8MP
Problem Details: Add IMX6_PCIE_FLAG_HAS_APP_RESET flag to IMX8MM_EP and IMX8MP_EP drvdata. This flag was overlooked during code restructuring. It is crucial to release the app-reset from the System Reset Controller before initiating LTSSM to rectify the issue. Fixes: 0c9651c21f2a ("PCI: imx6: Simplify reset handling ...
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 964d67756eb2..42fd17fbadfa 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1562,7 +1562,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { }, [IMX8MM_EP] ...
59100eb248c0b15585affa546c7f6834b30eb5a4
Analyze and fix the following issue in the Linux kernel code: PCI: Use an error code with PCIe failed link retraining
Problem Details: Given how the call place in pcie_wait_for_link_delay() got structured now, and that pcie_retrain_link() returns a potentially useful error code, convert pcie_failed_link_retrain() to return an error code rather than a boolean status, fixing handling at the call site mentioned. Update the other call si...
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 5618a8927aa9..d46652760b11 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1324,7 +1324,7 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout) if (delay > PCI_RESET_WAIT) { if (retrain) { retrain = false; -...
712e49c967064a3a7a5738c6f65ac540a3f6a1df
Analyze and fix the following issue in the Linux kernel code: PCI: Correct error reporting with PCIe failed link retraining
Problem Details: Only return successful completion status from pcie_failed_link_retrain() if retraining has actually been done, preventing excessive delays from being triggered at call sites in a hope that communication will finally be established with the downstream device where in fact nothing has been done about the...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index ee86793109ff..4d5483e9f63f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -78,7 +78,8 @@ * again to remove any residual state, ignoring the result as it's supposed * to fail anyway. * - * Return TRUE if the link has been succe...
f68dea13405c94381d08f42dbf0416261622bdad
Analyze and fix the following issue in the Linux kernel code: PCI: Revert to the original speed after PCIe failed link retraining
Problem Details: When `pcie_failed_link_retrain' has failed to retrain the link by hand it leaves the link speed restricted to 2.5GT/s, which will then affect any device that has been plugged in later on, which may not suffer from the problem that caused the speed restriction to have been attempted. Consequently such a...
```diff diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a2ce4e08edf5..ee86793109ff 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -66,7 +66,7 @@ * apply this erratum workaround to any downstream ports as long as they * support Link Active reporting and have the Link Control 2 registe...
28fbfaf6bd1df94cccf1a5c009fe26b9bdccc2b6
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: Use non-SG allocation for the communication buffers
Problem Details: The azx_bus->dma_type is referred only for allocating the communication buffers like CORB/RIRB, and the allocation size is small. Hence it doesn't have to be S/G buffer allocation, which is an obvious overkill. Use the standard SNDRV_DMA_TYPE_DEV_WC instead. This was changed to SNDRV_DMA_TYPE_DEV_WC...
```diff diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b79020adce63..edeaf3ee273c 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1821,7 +1821,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, /* use the non-cached pages in non-snoop mode */ ...
8037ac08c2bbb3186f83a5a924f52d1048dbaec5
Analyze and fix the following issue in the Linux kernel code: PCI: Clear the LBMS bit after a link retrain
Problem Details: The LBMS bit, where implemented, is set by hardware either in response to the completion of retraining caused by writing 1 to the Retrain Link bit or whenever hardware has changed the link speed or width in attempt to correct unreliable link operation. It is never cleared by hardware other than by sof...
```diff diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e3a49f66982d..5618a8927aa9 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4717,7 +4717,15 @@ int pcie_retrain_link(struct pci_dev *pdev, bool use_lt) pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_RL); } - return pcie_w...
2c6a7bff2a2eb2d7f183fbe1e9800ae278f415c7
Analyze and fix the following issue in the Linux kernel code: bcachefs: Switch gc bucket array to a genradix
Problem Details: A user with a 30 tb device is overflowing the INT_MAX limit on vmalloc allocations... Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index a4773b034f91..ad4df0ad26eb 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -542,7 +542,7 @@ struct bch_dev { * gc_gens_lock, for device resize - holding any is sufficient for * access: Or rcu_read_lock(), but only for d...
f1625637b85191a0ac6f9ebf2b30d8b335f08547
Analyze and fix the following issue in the Linux kernel code: bcachefs: Assert that we don't lock nodes when !trans->locked
Problem Details: We rely on the trans->locked to know if a trans has nodes locked for assertions about deadlocks; there can't be more than one trans in the same process that is locked. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h index dd0a2a1aa2bc..7c07f9fa9add 100644 --- a/fs/bcachefs/btree_locking.h +++ b/fs/bcachefs/btree_locking.h @@ -218,14 +218,12 @@ static inline int __btree_node_lock_nopath(struct btree_trans *trans, bool lock_may_not_fail, uns...
d89b35d83ee398bda2b4294ef7c6a2ab663044cf
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a spelling error in docs
Problem Details: Signed-off-by: Xiaxi Shen <shenxiaxi26@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/Documentation/filesystems/bcachefs/CodingStyle.rst b/Documentation/filesystems/bcachefs/CodingStyle.rst index 0c45829a4899..01de555e21d8 100644 --- a/Documentation/filesystems/bcachefs/CodingStyle.rst +++ b/Documentation/filesystems/bcachefs/CodingStyle.rst @@ -175,7 +175,7 @@ errors in our thinkin...
4d05a083b34f8f31a095402e75cc156fd9c3b257
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix macro definition allocate_dropping_locks
Problem Details: The macro allocate_dropping_locks accepts a parameter _trans, but it was not used, rather the variable trans was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun <sunjunchao2870@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@li...
```diff diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h index 140c7b831233..6d87e57745da 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -885,7 +885,7 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *); _ret = 0; \ if (unlikely(!_p)) { ...
ba8c52e2b115b88a5d5836485c1945f86df3ba5d
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix macro definition allocate_dropping_locks_errcode
Problem Details: The macro allocate_dropping_locks_errocode accepts a parameter _trans, but it was not used, rather the variable trans was directly used, which may be a local variable inside a function that calls the macros. Signed-off-by: Julian Sun <sunjunchao2870@gmail.com> Signed-off-by: Kent Overstreet <kent.over...
```diff diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h index 2ad90f40325a..140c7b831233 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -872,7 +872,7 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *); \ if (bch2_err_matches(_ret, ENOM...
abbfc4db50e27ab0d7b5315452bc8faa5eeb19df
Analyze and fix the following issue in the Linux kernel code: bcachefs: Add check for btree_path ref overflow
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 2e84d22e17bd..95afa35833bb 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1010,9 +1010,9 @@ retry_all: * the same position: */ if (trans->paths[idx].uptodate) { - __btree_path_get(&trans->paths[idx], fa...
2c377d8a71db32d4125d30b3641f2bc51c6850ca
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix btree_key_cache sysfs knob
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index f393023a3ae2..33f2a64c14c9 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -461,7 +461,7 @@ STORE(bch2_fs) sc.gfp_mask = GFP_KERNEL; sc.nr_to_scan = strtoul_or_return(buf); - c->btree_key_cache.shrink->scan_objects(c->btree_cach...
082330c361944a234db42750792b491f3b76d43b
Analyze and fix the following issue in the Linux kernel code: bcachefs: allocate inode by using alloc_inode_sb()
Problem Details: The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). It will also fix [1] to avoid the NULL pointer dereference BUG in list_lru_add() when CONFIG_MEMCG is enabled. Links: [1]: https://lore.kernel.org/all/20589721-46c0-4344-b2ef-6ab48bbe2ea5@linu...
```diff diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 2505daaec458..cb71d05a32bc 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -293,7 +293,8 @@ static struct inode *bch2_alloc_inode(struct super_block *sb) static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c) { - struct bch_inode_info ...
5396e5af3c1032b659bd6b1c1ec18e8af275a746
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix format specifier in bch2_btree_key_cache_to_text()
Problem Details: When building for a 32-bit architecture, for which 'size_t' is 'unsigned int', there is a compiler warning due to use of '%lu': In file included from fs/bcachefs/vstructs.h:5, from fs/bcachefs/bcachefs_format.h:80, from fs/bcachefs/bcachefs.h:207, ...
```diff diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c index 3048adde9284..2e49ca71194f 100644 --- a/fs/bcachefs/btree_key_cache.c +++ b/fs/bcachefs/btree_key_cache.c @@ -793,7 +793,7 @@ void bch2_btree_key_cache_to_text(struct printbuf *out, struct btree_key_cache * prt_printf(out, "skipp...
54f7702466b3a10b9a81e3c1c2c9da33df7a655f
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix deadlock in __wait_on_freeing_inode()
Problem Details: We can't call __wait_on_freeing_inode() with btree locks held; we're waiting on another thread that's in evict(), and before it clears that bit it needs to write that inode to flush timestamps - deadlock. Fixing this involves a fair amount of re-jiggering to plumb a new transaction restart. Signed-of...
```diff diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index fa88993c9e8b..2505daaec458 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -190,7 +190,8 @@ struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *c, subvol_inum inum return rhashtable_lookup_fast(&c->vfs_inodes_table, &inum, bch2_vfs_inodes...
36f0af4f44a4e465b0af4bf188d780511c1ca189
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix sysfs rebalance duration waited formatting
Problem Details: cat /sys/fs/bcachefs/*/internal/rebalance_status waiting io wait duration: 13.5 GiB io wait remaining: 627 MiB duration waited: 1392 m duration waited was increasing at a rate of about 14 times the expected rate. div_u64 takes a u32 divisor, but u->nsecs (from time_units[]) can be bigger tha...
```diff diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 1b8554460af4..a6c9c96955f1 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -360,7 +360,7 @@ void bch2_pr_time_units(struct printbuf *out, u64 ns) { const struct time_unit *u = bch2_pick_time_units(ns); - prt_printf(out, "%llu %s", div_u...
a3ed1cc4136df01e74a8b6df8c562db69e752bad
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix negative timespecs
Problem Details: This fixes two problems in the handling of negative times: • rem is signed, but the rem * c->sb.nsec_per_time_unit operation produced a bogus unsigned result, because s32 * u32 = u32. • The timespec was not normalized (it could contain more than a billion nanoseconds). For example, { .tv_sec...
```diff diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index 0c7086e00d18..81c4d935cca8 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -1195,12 +1195,15 @@ static inline bool btree_id_cached(const struct bch_fs *c, enum btree_id btree) static inline struct timespec64 bch2_time_to_tim...
5a6e43af1e5341a11a719270cef9d846b0bbfaa5
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix ca->io_ref usage
Problem Details: ca->io_ref does not protect against the filesystem going way, c->write_ref does. Much like 0b50b7313ef2 bcachefs: Fix refcounting in discard path the other async paths need fixing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index ba46f1c1d78a..dc3a4024aab6 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1968,8 +1968,8 @@ static void bch2_do_discards_fast_work(struct work_struct *work) break; } - bch2_write_ref_...
e62d39332d4b9400a69ba902797aa17a1a0037e7
Analyze and fix the following issue in the Linux kernel code: xfrm: policy: Restore dir assignments in xfrm_hash_rebuild()
Problem Details: Clang warns (or errors with CONFIG_WERROR): net/xfrm/xfrm_policy.c:1286:8: error: variable 'dir' is uninitialized when used here [-Werror,-Wuninitialized] 1286 | if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) { | ^~~ net/xfrm/xfrm_policy.c:1257:9: ...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 31c14457fdaf..428ee83fe298 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1283,6 +1283,7 @@ static void xfrm_hash_rebuild(struct work_struct *work) if (xfrm_policy_is_dead_or_sk(policy)) continue; + dir = xfrm_pol...
6a13f5afd39d17320316dbb8dd533fe7c6a613e6
Analyze and fix the following issue in the Linux kernel code: xfrm: policy: fix null dereference
Problem Details: Julian Wiedmann says: > + if (!xfrm_pol_hold_rcu(ret)) Coverity spotted that ^^^ needs a s/ret/pol fix-up: > CID 1599386: Null pointer dereferences (FORWARD_NULL) > Passing null pointer "ret" to "xfrm_pol_hold_rcu", which dereferences it. Ditch the bogus 'ret' variable. Fixes: 563d5ca93e88 ("...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 6336baa8a93c..31c14457fdaf 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -4429,7 +4429,7 @@ EXPORT_SYMBOL_GPL(xfrm_audit_policy_delete); static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *sel, ...
6d7c6ae1efb1ff68bc01d79d94fdf0388f86cdd8
Analyze and fix the following issue in the Linux kernel code: wifi: wilc1000: fix potential RCU dereference issue in wilc_parse_join_bss_param
Problem Details: In the `wilc_parse_join_bss_param` function, the TSF field of the `ies` structure is accessed after the RCU read-side critical section is unlocked. According to RCU usage rules, this is illegal. Reusing this pointer can lead to unpredictable behavior, including accessing memory that has been updated or...
```diff diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 3c48e1a57b24..bba53307b960 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -384,6 +384,7 @@ wilc_parse_join_bss_param(struct cfg80211...
498365e52bebcbc36a93279fe7e9d6aec8479cee
Analyze and fix the following issue in the Linux kernel code: wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_cmd_802_11_scan_ext()
Problem Details: Replace one-element array with a flexible-array member in `struct host_cmd_ds_802_11_scan_ext`. With this, fix the following warning: elo 16 17:51:58 surfacebook kernel: ------------[ cut here ]------------ elo 16 17:51:58 surfacebook kernel: memcpy: detected field-spanning write (size 243) of single...
```diff diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index e91def0afa14..d03129d5d24e 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -1627,7 +1627,7 @@ struct host_cmd_ds_802_11_scan_rsp { struct host_cmd...
7ab6512e7942889c0962588355cb92424a690be6
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: Correct logic on stopping an HVS channel
Problem Details: When factoring out __vc4_hvs_stop_channel, the logic got inverted from if (condition) // stop channel to if (condition) goto out //stop channel out: and also changed the exact register writes used to stop the channel. Correct the logic so that the channel is actually stopped, and revert to t...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 93e7edd8b084..2a366a607fcc 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -427,13 +427,11 @@ void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan) if (!drm_dev_enter(drm, &idx)) r...
d285bb622ebdfaa84f51df3a1abccb87036157ea
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: Remove incorrect limit from hvs_dlist debugfs function
Problem Details: The debugfs function to dump dlists aborted at 256 bytes, when actually the dlist memory is generally significantly larger but varies based on SoC. We already have the correct limit in __vc4_hvs_alloc, so store it for use in the debugfs dlist function. Fixes: c6dac00340fc ("drm/vc4: hvs: Add debugfs ...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 717fd1140561..6908b36d5953 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -315,6 +315,7 @@ struct vc4_hvs { struct platform_device *pdev; void __iomem *regs; u32 __iomem *dlist; + unsigned i...
6d5f76e0544b04ec5bdd2a09c19d90aeeb2cd479
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: Fix dlist debug not resetting the next entry pointer
Problem Details: The debug function to display the dlists didn't reset next_entry_start when starting each display, so resulting in not stopping the list at the correct place. Fixes: c6dac00340fc ("drm/vc4: hvs: Add debugfs node that dumps the current display lists") Reviewed-by: Maxime Ripard <mripard@kernel.org> Lin...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 8dab59341a82..bdc70b629054 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -110,7 +110,7 @@ static int vc4_hvs_debugfs_dlist(struct seq_file *m, void *data) struct vc4_dev *vc4 = to_vc4_dev(dev);...
223ee2567a55e4f80315c768d2969e6a3b9fb23d
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hdmi: Avoid hang with debug registers when suspended
Problem Details: Trying to read /sys/kernel/debug/dri/1/hdmi1_regs when the hdmi is disconnected results in a fatal system hang. This is due to the pm suspend code disabling the dvp clock. That is just a gate of the 108MHz clock in DVP_HT_RPI_MISC_CONFIG, which results in accesses hanging AXI bus. Protect against thi...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 60cbf1d4c7dd..28792dfa8c55 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -147,6 +147,8 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) if (!drm_dev_enter(drm, &idx)) ...
52efe364d1968ee3e3ed45eb44eb924b63635315
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: Don't write gamma luts on 2711
Problem Details: The gamma block has changed in 2711, therefore writing the lut in vc4_hvs_lut_load is incorrect. Whilst the gamma property isn't created for 2711, it is called from vc4_hvs_init_channel, so abort if attempted. Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5") Reviewed-by: Maxime Ripar...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 3a5d9ba3a67a..8dab59341a82 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -222,6 +222,9 @@ static void vc4_hvs_lut_load(struct vc4_hvs *hvs, if (!drm_dev_enter(drm, &idx)) return; + if (hvs...
6184b9446d43d36615b75683967a3bbfb06c2d20
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: Print error if we fail an allocation
Problem Details: We need to allocate a few additional structures when checking our atomic_state, especially related to hardware SRAM that will hold the plane descriptors (DLIST) and the current line context (LBM) during composition. Since those allocation can fail, let's add some error message in that case to help deb...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index e37851e13474..3a5d9ba3a67a 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -475,8 +475,10 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) ret = drm_mm_insert_no...
b6d7a953969eef2d30d1213c5f8c565eb8b27f2e
Analyze and fix the following issue in the Linux kernel code: drm/vc4: hvs: More logging for dlist generation
Problem Details: DLIST generation can get pretty tricky and there's not a lot of debug in the driver to help. Let's add a few more to track the generated DLIST size. Signed-off-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/202...
```diff diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 32ecc26a749a..e37851e13474 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -456,11 +456,21 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) if (hweight32(crtc_st...
b787a33864121a565aeb0e88561bf6062a19f99c
Analyze and fix the following issue in the Linux kernel code: spi: geni-qcom: Fix incorrect free_irq() sequence
Problem Details: In spi_geni_remove(), the free_irq() sequence is different from that on the probe error path. And the IRQ will still remain and it's interrupt handler may use the dma channel after release dma channel and before free irq, which is not secure, fix it. Fixes: b59c122484ec ("spi: spi-geni-qcom: Add suppo...
```diff diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index fef522fece1b..6f4057330444 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -1170,9 +1170,9 @@ static void spi_geni_remove(struct platform_device *pdev) /* Unregister _before_ disabling pm_runtime() so we...
89e362c883c65ff94b76b9862285f63545fb5274
Analyze and fix the following issue in the Linux kernel code: spi: geni-qcom: Undo runtime PM changes at driver exit time
Problem Details: It's important to undo pm_runtime_use_autosuspend() with pm_runtime_dont_use_autosuspend() at driver exit time unless driver initially enabled pm_runtime with devm_pm_runtime_enable() (which handles it for you). Hence, switch to devm_pm_runtime_enable() to fix it, so the pm_runtime_disable() in probe ...
```diff diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 37ef8c40b276..fef522fece1b 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -1110,25 +1110,27 @@ static int spi_geni_probe(struct platform_device *pdev) spin_lock_init(&mas->lock); pm_runtime_use_autosu...
876dec03fdfb7eeb592d01a95ba292c9e53b324b
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8365: remove unused mt8365_i2s_hd_str
Problem Details: The mt8365_i2s_enum and mt8365_i2s_hd_str variables are not used anywhere, but cause a warning when building with C=1 or when enabling -Wunused-const-variable: sound/soc/mediatek/mt8365/mt8365-dai-i2s.c:781:27: error: 'mt8365_i2s_hd_str' defined but not used [-Werror=unused-const-variable=] 781 | st...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c index 5003fe5e5ccf..b4d4d6705c86 100644 --- a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c +++ b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c @@ -777,13 +777,6 @@ static struct snd_soc_dai_driver mtk_dai_i2s_driver[...
6b31d6a4ca3b4d8abfb39127130889f9a9a38aa1
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8365: include linux/bitfield.h
Problem Details: On x86, the header is not already included implicitly, breaking compile-testing: In file included from sound/soc/mediatek/mt8365/mt8365-afe-common.h:19, from sound/soc/mediatek/mt8365/mt8365-afe-pcm.c:18: sound/soc/mediatek/mt8365/mt8365-afe-pcm.c: In function 'mt8365_afe_cm2_mux_conn...
```diff diff --git a/sound/soc/mediatek/mt8365/mt8365-reg.h b/sound/soc/mediatek/mt8365/mt8365-reg.h index b7334c2e64ed..1051718c29f3 100644 --- a/sound/soc/mediatek/mt8365/mt8365-reg.h +++ b/sound/soc/mediatek/mt8365/mt8365-reg.h @@ -10,6 +10,8 @@ #ifndef _MT8365_REG_H_ #define _MT8365_REG_H_ +#include <linux/bitf...
af5e317175858603f950e51fe6377027fdd6eb79
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2781: fix to save the dsp bin file name into the correct array in case name_prefix is not NULL
Problem Details: fix to save the dsp bin file name into the correct array, coef_binaryname, instead of rca_binaryname, in case name_prefix is not NULL. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20240907001540.944-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel....
```diff diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index e79d613745b4..cf8bc7ede6c7 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -502,7 +502,7 @@ static void tasdevice_fw_ready(const struct firmware *fmw, */ tas_priv->fw_state = TASDEVICE_RCA...
73048a832587520c6222bacbe1bc7121409d8861
Analyze and fix the following issue in the Linux kernel code: optee: Fix a NULL vs IS_ERR() check
Problem Details: The tee_shm_get_va() function never returns NULL, it returns error pointers. Update the check to match. Fixes: f0c8431568ee ("optee: probe RPMB device using RPMB subsystem") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Link: https://l...
```diff diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index a4b49fd1d46d..ebbbd42b0e3e 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c @@ -332,7 +332,7 @@ static void handle_rpc_func_rpmb_probe_next(struct tee_context *ctx, } buf = tee_shm_get_va(params[1].u.memref.shm, ...
ea5ff5d351b520524019f7ff7f9ce418de2dad87
Analyze and fix the following issue in the Linux kernel code: dma-buf: heaps: Fix off-by-one in CMA heap fault handler
Problem Details: Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps: Don't track CMA dma-buf pages under RssFile") it was possible to obtain a mapping larger than the buffer size via mremap and bypass the overflow check in dma_buf_mmap_internal. When using such a mapping to attempt to fault past the ...
```diff diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index c384004b918e..93be88b805fe 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -165,7 +165,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf) struct vm_area_struct *vma = vmf-...
d53c35931b95b707df3b6cff061ff975843837d5
Analyze and fix the following issue in the Linux kernel code: dt-bindings: mtd: ti, gpmc-nand: support partitions node
Problem Details: Allow fixed-partitions to be specified through a partitions node. Fixes the below dtbs_check warning: arch/arm64/boot/dts/ti/k3-am642-evm-nand.dtb: nand@0,0: Unevaluated properties are not allowed ('partitions' was unexpected) Signed-off-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Rob Herring...
```diff diff --git a/Documentation/devicetree/bindings/mtd/ti,gpmc-nand.yaml b/Documentation/devicetree/bindings/mtd/ti,gpmc-nand.yaml index 115682fa81b7..00540302bcae 100644 --- a/Documentation/devicetree/bindings/mtd/ti,gpmc-nand.yaml +++ b/Documentation/devicetree/bindings/mtd/ti,gpmc-nand.yaml @@ -61,12 +61,9 @@ pr...
2073ae37d550ea32e8545edaa94ef10b4fef7235
Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: mtk: Fix init error path
Problem Details: Reviewing a series converting the for_each_chil_of_node() loops into their _scoped variants made me realize there was no cleanup of the already registered NAND devices upon error which may leak memory on systems with more than a chip when this error occurs. We should call the _nand_chips_cleanup() func...
```diff diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c index bf845dd16737..586868b4139f 100644 --- a/drivers/mtd/nand/raw/mtk_nand.c +++ b/drivers/mtd/nand/raw/mtk_nand.c @@ -1453,8 +1453,10 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc) for_each_child...
9d301de12da6e1bb069a9835c38359b8e8135121
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: use two-phase skb reclamation in ieee80211_do_stop()
Problem Details: Since '__dev_queue_xmit()' should be called with interrupts enabled, the following backtrace: ieee80211_do_stop() ... spin_lock_irqsave(&local->queue_stop_reason_lock, flags) ... ieee80211_free_txskb() ieee80211_report_used_skb() ieee80211_report_ack_skb() cfg80211_mgmt_tx_status_ext() ...
```diff diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index e074de893ed6..6ef0990d3d29 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -462,6 +462,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do { struct ieee80211_local *local = sdata->local; unsigne...
15ea13b1b1fbf6364d4cd568e65e4c8479632999
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors
Problem Details: Although not reproduced in practice, these two cases may be considered by UBSAN as off-by-one errors. So fix them in the same way as in commit a26a5107bc52 ("wifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan()"). Fixes: 807f8a8c3004 ("cfg80211/nl80211: add support for scheduled scans") Fixes: 5...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8bad3c6db39d..9ab777e0bd4d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9778,7 +9778,8 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev, return ERR_PTR(-ENOMEM); if (n_ssids) - request->s...
8f088541991bc1716a5ed570456d218241303851
Analyze and fix the following issue in the Linux kernel code: net: sysfs: Fix weird usage of class's namespace relevant fields
Problem Details: Device class has two namespace relevant fields which are associated by the following usage: struct class { ... const struct kobj_ns_type_operations *ns_type; const void *(*namespace)(const struct device *dev); ... } if (dev->class && dev->class->ns_type) dev->class->namespace(dev); The usage loo...
```diff diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 0648dbf0e234..05cf5347f25e 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1060,7 +1060,7 @@ static const void *rx_queue_namespace(const struct kobject *kobj) struct device *dev = &queue->dev->dev; const void *ns = NULL; - if ...
2b29ac68e786d8d16772bb92eee88ed7beda5d0d
Analyze and fix the following issue in the Linux kernel code: net: ethernet: fs_enet: cosmetic cleanups
Problem Details: Due to the age of the driver and the slow recent activity on it, the code has taken some layers of dust. Clean the main driver file up so that it passes checkpatch and also conforms with the net coding style. Changes include : - Re-ordering of the variable declarations for RCT - Fixing the comment s...
```diff diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 5bfdd43ffdeb..2b48a2a5e32d 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -81,15 +81,14 @@ static vo...
b3c9e65eb227269ed72a115ba22f4f51b4e62b4d
Analyze and fix the following issue in the Linux kernel code: net: hsr: remove seqnr_lock
Problem Details: syzbot found a new splat [1]. Instead of adding yet another spin_lock_bh(&hsr->seqnr_lock) / spin_unlock_bh(&hsr->seqnr_lock) pair, remove seqnr_lock and use atomic_t for hsr->sequence_nr and hsr->sup_sequence_nr. This also avoid a race in hsr_fill_info(). Also remove interlink_sequence_nr which is ...
```diff diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index e4cc6b78dcfc..ac56784c327c 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -231,9 +231,7 @@ static netdev_tx_t hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev) skb->dev = master->dev; skb_reset_mac_header(skb); skb_...
54df34c5a2439b481f066476e67bfa21a0a640e5
Analyze and fix the following issue in the Linux kernel code: drm/i915/bios: fix printk format width
Problem Details: s/0x04%x/0x%04x/ to use 0 prefixed width 4 instead of printing 04 verbatim. Fixes: 51f5748179d4 ("drm/i915/bios: create fake child devices on missing VBT") Cc: stable@vger.kernel.org # v5.13+ Reviewed-by: Vandita Kulkarni <vandita.kulkarni@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index cd32c9cd38a9..daa4b9535123 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -2949,7 +2949,7 @@ init_vbt_missing_defaults(struct intel_display *display...
4e1b5586051f0e9aef9b0ca375ef2cd1a8987e0c
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: fix kernel-doc for per-link data
Problem Details: There cannot be brackets in kernel-doc, remove them. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 62c16f219a73 ("wifi: cfg80211: move DFS related members to links[] in wireless_dev") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index efdea667cb92..69ec1eb41a09 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -6217,11 +6217,11 @@ enum ieee80211_ap_reg_power { * unprotected beacon report * @links: array of %IEEE80211_MLD_MAX_NUM_LINKS elements containing...
b1daf3f8475fa2a4ffc1668043de738241f95d1d
Analyze and fix the following issue in the Linux kernel code: docs:filesystems: fix spelling and grammar mistakes in iomap design page
Problem Details: Signed-off-by: Dennis Lam <dennis.lamerice@gmail.com> Link: https://lore.kernel.org/r/20240908172841.9616-2-dennis.lamerice@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
```diff diff --git a/Documentation/filesystems/iomap/design.rst b/Documentation/filesystems/iomap/design.rst index f8ee3427bc1a..e2d34085dd0e 100644 --- a/Documentation/filesystems/iomap/design.rst +++ b/Documentation/filesystems/iomap/design.rst @@ -142,9 +142,9 @@ Definitions * **pure overwrite**: A write operation...
698e7d1680544ef114203b0cf656faa0c1216ebc
Analyze and fix the following issue in the Linux kernel code: proc: Fix typo in the comment
Problem Details: The deference here confuses me. Maybe here want to say that because show_fd_locks() does not dereference the files pointer, using the stale value of the files pointer is safe. Correctly spelled comments make it easier for the reader to understand the code. replace 'deferences' with 'dereferences' in...
```diff diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 586bbc84ca04..7baafb1eba13 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -59,7 +59,7 @@ static int seq_show(struct seq_file *m, void *v) real_mount(file->f_path.mnt)->mnt_id, file_inode(file)->i_ino); - /* show_fd_locks() never deferences files so a...
d24449864da5838936669618356b0e30ca2999c3
Analyze and fix the following issue in the Linux kernel code: parisc: Fix 64-bit userspace syscall path
Problem Details: Currently the glibc isn't yet ported to 64-bit for hppa, so there is no usable userspace available yet. But it's possible to manually build a static 64-bit binary and run that for testing. One such 64-bit test program is available at http://ftp.parisc-linux.org/src/64bit.tar.gz and it shows various iss...
```diff diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 1f51aa9c8230..0fa81bf1466b 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -243,10 +243,10 @@ linux_gateway_entry: #ifdef CONFIG_64BIT ldil L%sys_call_table, %r1 - or,= %r2,%r2,%r2 - addil L%(sys_...
f31b256994acec6929306dfa86ac29716e7503d6
Analyze and fix the following issue in the Linux kernel code: parisc: Fix stack start for ADDR_NO_RANDOMIZE personality
Problem Details: Fix the stack start address calculation for the parisc architecture in setup_arg_pages() when address randomization is disabled. When the ADDR_NO_RANDOMIZE process personality is disabled there is no need to add additional space for the stack. Note that this patch touches code inside an #ifdef CONFIG_S...
```diff diff --git a/fs/exec.c b/fs/exec.c index 50e76cc633c4..00c968a739c3 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -813,7 +813,8 @@ int setup_arg_pages(struct linux_binprm *bprm, stack_base = calc_max_stack_size(stack_base); /* Add space for stack randomization. */ - stack_base += (STACK_RND_MASK << PAGE_SHIFT...
9c100bc3ec13914f9911a937ec5b38182a5c3d64
Analyze and fix the following issue in the Linux kernel code: can: rockchip_canfd: rkcanfd_timestamp_init(): fix 64 bit division on 32 bit platforms
Problem Details: On some 32-bit platforms (at least on parisc), the compiler generates a call to __divdi3() from the u32 by 3 division in rkcanfd_timestamp_init(), which results in the following linker error: | ERROR: modpost: "__divdi3" [drivers/net/can/rockchip/rockchip_canfd.ko] undefined! As this code doesn't run...
```diff diff --git a/drivers/net/can/rockchip/rockchip_canfd-timestamp.c b/drivers/net/can/rockchip/rockchip_canfd-timestamp.c index 81cccc5fd838..fb1a8f4e6217 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-timestamp.c +++ b/drivers/net/can/rockchip/rockchip_canfd-timestamp.c @@ -71,7 +71,7 @@ void rkcanfd_timest...
9a0e4c18cdec39b1d724703180e29156d86bb94b
Analyze and fix the following issue in the Linux kernel code: can: rockchip_canfd: fix return type of rkcanfd_start_xmit()
Problem Details: With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG), indirect call targets are validated against the expected function pointer prototype to make sure the call target is valid to help mitigate ROP attacks. If they are not identical, there is a failure at run time, which manifests as eith...
```diff diff --git a/drivers/net/can/rockchip/rockchip_canfd-tx.c b/drivers/net/can/rockchip/rockchip_canfd-tx.c index f954f38b955f..865a15e033a9 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-tx.c +++ b/drivers/net/can/rockchip/rockchip_canfd-tx.c @@ -63,7 +63,7 @@ void rkcanfd_xmit_retry(struct rkcanfd_priv *pr...
aa99969ef591ca44cbafb320ceceb106792baee3
Analyze and fix the following issue in the Linux kernel code: m68k: remove trailing space after \n newline
Problem Details: There is a extraneous space after a newline in a pr_debug message. Remove it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
```diff diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c index 37fb663559b4..c926da9d5ec2 100644 --- a/arch/m68k/kernel/setup_no.c +++ b/arch/m68k/kernel/setup_no.c @@ -138,7 +138,7 @@ void __init setup_arch(char **cmdline_p) pr_debug("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n", ...
61f2e8a3a94175dbbaad6a54f381b2a505324610
Analyze and fix the following issue in the Linux kernel code: riscv: dts: starfive: jh7110-common: Fix lower rate of CPUfreq by setting PLL0 rate to 1.5GHz
Problem Details: CPUfreq supports 4 cpu frequency loads on 375/500/750/1500MHz. But now PLL0 rate is 1GHz and the cpu frequency loads become 250/333/500/1000MHz in fact. The PLL0 rate should be default set to 1.5GHz and set the cpu_core rate to 500MHz in safe. Fixes: e2c510d6d630 ("riscv: dts: starfive: Add cpu scali...
```diff diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi index ca2d44d59d48..c7771b3b6475 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi @@ -365,6 +365,12 @@ }; }; +&syscrg { + assigned...
bd7c8ff9fef4b21a97f9b30a7364845ee6eaaf23
Analyze and fix the following issue in the Linux kernel code: treewide: Fix wrong singular form of jiffies in comments
Problem Details: There are several comments all over the place, which uses a wrong singular form of jiffies. Replace 'jiffie' by 'jiffy'. No functional change. Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Geert Uytterhoeven <geert@linux-m68...
```diff diff --git a/Documentation/admin-guide/media/vivid.rst b/Documentation/admin-guide/media/vivid.rst index 1306f19ecb5a..c9d301ab46a3 100644 --- a/Documentation/admin-guide/media/vivid.rst +++ b/Documentation/admin-guide/media/vivid.rst @@ -328,7 +328,7 @@ and an HDMI input, one input for each input type. Those a...
9139f93209d1ffd7f489ab19dee01b7c3a1a43d2
Analyze and fix the following issue in the Linux kernel code: rcu/nocb: Fix RT throttling hrtimer armed from offline CPU
Problem Details: After a CPU is marked offline and until it reaches its final trip to idle, rcuo has several opportunities to be woken up, either because a callback has been queued in the meantime or because rcutree_report_cpu_dead() has issued the final deferred NOCB wake up. If RCU-boosting is enabled, RCU kthreads ...
```diff diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 857024ee0349..e3cf354f7a7f 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -216,7 +216,10 @@ static bool __wake_nocb_gp(struct rcu_data *rdp_gp, raw_spin_unlock_irqrestore(&rdp_gp->nocb_gp_lock, flags); if (needwake) { ...
d5c4546062fd6f5dbce575c7ea52ad66d1968678
Analyze and fix the following issue in the Linux kernel code: net: sched: consistently use rcu_replace_pointer() in taprio_change()
Problem Details: According to Vinicius (and carefully looking through the whole https://syzkaller.appspot.com/bug?extid=b65e0af58423fc8a73aa once again), txtime branch of 'taprio_change()' is not going to race against 'advance_sched()'. But using 'rcu_replace_pointer()' in the former may be a good idea as well. Sugges...
```diff diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index cc2df9f8c14a..8498d0606b24 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1952,7 +1952,9 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, goto unlock; } - rcu_assign_pointer(q->admin_sched, new_a...
37ed8e75c66099ffeca1fb51c7cc7999ec4315ac
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: h5: NanoPi Neo Plus2: Fix regulators
Problem Details: Added the main board 5 V supply regulator, a 2.5 V supply regulator for GMAC PHY IO and correct vin-supply elements. Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Link: https://lore.kernel.org/r/20240905-nanopi-neo-plus2-regfix-v3-1-1895dff...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts index b69032c44557..dee4cd82636b 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts @...
a02e98bebc15f1d973c2a62005be9456a657e2b6
Analyze and fix the following issue in the Linux kernel code: mtip32xx: Remove redundant null pointer checks in mtip_hw_debugfs_init()
Problem Details: Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant. Since debugfs_create_file() can deal with a ERR_PTR() style pointer, drop the check. Since mtip_hw_debugfs_init does not pay attention to the return value, its return type can be cha...
```diff diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index c6ef0546ffc9..11901f2812ad 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2269,25 +2269,12 @@ static const struct file_operations mtip_flags_fops = { .llseek = no_llseek, }; ...
dde60e7d103bf6cf820b2c4c4bb5658bad1759a9
Analyze and fix the following issue in the Linux kernel code: kbuild: remove recent dependency on "truncate" program
Problem Details: Remove the recently-added dependency on the truncate program for building the kernel. truncate is not available when building the kernel under Yocto. It could be added, but it would be better just to avoid the unnecessary dependency. Fixes: 1472464c6248 ("kbuild: avoid scripts/kallsyms parsing /dev/nu...
```diff diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 070a319140e8..c27b4e969f20 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -215,7 +215,7 @@ kallsymso= strip_debug= if is_enabled CONFIG_KALLSYMS; then - truncate -s0 .tmp_vmlinux.kallsyms0.syms + true > .tmp_vmlinux....
4929f5b95f6b20ae10f2c409fb2ca58253e73706
Analyze and fix the following issue in the Linux kernel code: kbuild: add debug package to pacman PKGBUILD
Problem Details: Add a new debug package to the PKGBUILD for the pacman-pkg target. The debug package includes the non-stripped vmlinux file with debug symbols for kernel debugging and profiling. The file is installed at /usr/src/debug/${pkgbase}, with a symbolic link at /usr/lib/modules/$(uname -r)/build/vmlinux. The ...
```diff diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD index 839cd5e634d2..f83493838cf9 100644 --- a/scripts/package/PKGBUILD +++ b/scripts/package/PKGBUILD @@ -5,7 +5,7 @@ pkgbase=${PACMAN_PKGBASE:-linux-upstream} pkgname=("${pkgbase}") -_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers} ...
d647bdf4d080208b71a205ec19a1c9f18ca83f00
Analyze and fix the following issue in the Linux kernel code: ata: libata: Fix W=1 compilation warning
Problem Details: Commit c494708d1f68 ("ata: libata: Cleanup libata-transport") inadvertently changed the name of the link argument to ata_link in the kdoc description of ata_tlink_add(), causing warnings to be issue when compiling with W=1: drivers/ata/libata-transport.c:690: warning: Function parameter or struct memb...
```diff diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index d9a1888eac34..e898be49df6b 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -679,7 +679,7 @@ void ata_tlink_delete(struct ata_link *link) /** * ata_tlink_add -- initialize an ATA link tra...
54001d0f2fdbc7852136a00f3e6fc395a9547ae5
Analyze and fix the following issue in the Linux kernel code: net: tls: wait for async completion on last message
Problem Details: When asynchronous encryption is used KTLS sends out the final data at proto->close time. This becomes problematic when the task calling close() receives a signal. In this case it can happen that tcp_sendmsg_locked() called at close time returns -ERESTARTSYS and the final data is not sent. The describe...
```diff diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 305a412785f5..bbf26cc4f6ee 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1201,7 +1201,7 @@ trim_sgl: if (!num_async) { goto send_end; - } else if (num_zc) { + } else if (num_zc || eor) { int err; /* Wait for pending encryptions to ...