id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
26ef47e5ba600ead306ee19e0bf56c1bf59213a3
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: ipc4-topology: Add module parameter to ignore the CPC value
Problem Details: Add a new module parameter ipc4_ignore_cpc which can be used to force the kernel to ignore the queried CPC value for all firmware modules and use 0 instead. The CPC lookup is still done to report missing configurations and the debug print is going to be different to be explicit that the CPC is ignored...
```diff diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index eff43635a88f..f2a30cd31378 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -17,6 +17,19 @@ #include "ipc4-topology.h" #include "ops.h" +/* + * The ignore_cpc flag can be used to ignore the CPC ...
2cbd5304ea393f0ca3aeebec2f6554a32ac02ce3
Analyze and fix the following issue in the Linux kernel code: ASoC: pxa: merge DAI call back functions into ops
Problem Details: ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.hoM5o9LV-lkp@intel.com/ Fixes: 446b31e89493 ("ASoC: soc-dai.h: remove unused call back functions") Signed-off-by: Kuninor...
```diff diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 10636506b622..437bfccd04f8 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c @@ -329,6 +329,8 @@ static int pxa2xx_i2s_remove(struct snd_soc_dai *dai) SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) static cons...
979ca1ca1f2c87386deffbeb01767bb40448b4a1
Analyze and fix the following issue in the Linux kernel code: uio: pruss: fix missing iounmap() in pruss_probe()
Problem Details: platform_get_irq() is called after ioremap(), if it fails, iounmap() needs be called in error the path. Fixes: 2fd84b9b839c ("uio: pruss: fix to check return value of platform_get_irq() in pruss_probe()") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230808...
```diff diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index 122c38e2fbbd..77e2dc404885 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -177,7 +177,7 @@ static int pruss_probe(struct platform_device *pdev) ret = platform_get_irq(pdev, 0); if (ret < 0) - goto err_free_ddr_vad...
c83031afaaaa4a1129394439c8cd93ffe94f9970
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: pcie: point invalid TFDs to invalid data
Problem Details: There are occasionally bugs which cause the device to try to use a TFD that it wasn't supposed to, and these are very hard to diagnose. Fill all unused TFDs with a debug command that immediately causes an error to be detected in these cases. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signe...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h index 48ffab22bb7b..90ce8d9b6ad3 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h @@ -29,6 +29,11 @@ enum iwl_debug_cmds { *...
a06320044a30d2ef33fa07f3df5d7411c217d4c0
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: pcie: clean up gen1/gen2 TFD unmap
Problem Details: This is a bit messy right now, there are functions for both, but then gen1 function can actually deal with both gen1 and gen2, due to the confusion about use_tfh/gen2 cleaned up in the previous patch. Fix the common paths to call the right functions and remove handling of gen2 from the gen1 function. ...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 790e5b124740..9ab1b2590dd2 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -1203,7 +1203,11 @@ void iwl_pcie_hcmd_complete(struct iwl_tra...
0c2f92f6a5ac258457e7c9d55c74f14a0f1937cd
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: api: fix a small upper/lower-case typo
Problem Details: The structure name in the docs should be given in all lower case matching the actual C declaration. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230816104355.c06f98055dbb.Ie9267108c57edcbb913f0d0f3...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h index 8fef38139bf6..48ffab22bb7b 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: ...
3a198c95c95da10ad844cbeade2fe40bdf14c411
Analyze and fix the following issue in the Linux kernel code: alx: fix OOB-read compiler warning
Problem Details: The following message shows up when compiling with W=1: In function ‘fortify_memcpy_chk’, inlined from ‘alx_get_ethtool_stats’ at drivers/net/ethernet/atheros/alx/ethtool.c:297:2: ./include/linux/fortify-string.h:592:4: error: call to ‘__read_overflow2_field’ declared with attribute warning: detec...
```diff diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c index b716adacd815..7f6b69a52367 100644 --- a/drivers/net/ethernet/atheros/alx/ethtool.c +++ b/drivers/net/ethernet/atheros/alx/ethtool.c @@ -292,9 +292,8 @@ static void alx_get_ethtool_stats(struct net_device *...
efde97a175e89fceb36cd2c352700661183992bc
Analyze and fix the following issue in the Linux kernel code: tracing: Remove unused function declarations
Problem Details: Commit 9457158bbc0e ("tracing: Fix reset of time stamps during trace_clock changes") left behind tracing_reset_current() declaration. Also commit 6954e415264e ("tracing: Place trace_pid_list logic into abstract functions") removed trace_free_pid_list() implementation but leave declaration. Link: https...
```diff diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 5b1f9e24764a..b6e44a39b4ce 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -604,7 +604,6 @@ trace_buffer_iter(struct trace_iterator *iter, int cpu) int tracer_init(struct tracer *t, struct trace_array *tr); int tracing_is_enabled(v...
6b3cba375917494d5905c9b9c1ea2acdf73922e8
Analyze and fix the following issue in the Linux kernel code: parisc: Fix comment on Elf64 function descriptor
Problem Details: The format of the Elf64 function descriptor is defined by the ABI. Mention the various use cases in the comment. Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h index cc426d365892..140eaa97bf21 100644 --- a/arch/parisc/include/asm/elf.h +++ b/arch/parisc/include/asm/elf.h @@ -163,8 +163,7 @@ typedef struct elf32_fdesc { /* Format for the Elf64 Function descriptor */ typedef struct elf64_fdes...
9f5ba4b3e1b3c123eeca5d2d09161e8720048b5c
Analyze and fix the following issue in the Linux kernel code: parisc: Fix /proc/cpuinfo output for lscpu
Problem Details: The lscpu command is broken since commit cab56b51ec0e ("parisc: Fix device names in /proc/iomem") added the PA pathname to all PA devices, includig the CPUs. lscpu parses /proc/cpuinfo and now believes it found different CPU types since every CPU is listed with an unique identifier (PA pathname). Fix...
```diff diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 762289b9984e..a0e2d37c5b3b 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -378,10 +378,18 @@ int show_cpuinfo (struct seq_file *m, void *v) { unsigned long cpu; + char cpu_name[60], *p; + ...
4aae44f65827f0213a7361cf9c32cfe06114473f
Analyze and fix the following issue in the Linux kernel code: pwm: lpc32xx: Remove handling of PWM channels
Problem Details: Because LPC32xx PWM controllers have only a single output which is registered as the only PWM device/channel per controller, it is known in advance that pwm->hwpwm value is always 0. On basis of this fact simplify the code by removing operations with pwm->hwpwm, there is no controls which require chann...
```diff diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index 86a0ea0f6955..806f0bb3ad6d 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@ -51,10 +51,10 @@ static int lpc32xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, if (duty_cycles > 255) duty_cycles = 25...
5ad1ab30ac0809d2963ddcf39ac34317a24a2f17
Analyze and fix the following issue in the Linux kernel code: drm/display/dp: Fix the DP DSC Receiver cap size
Problem Details: DP DSC Receiver Capabilities are exposed via DPCD 60h-6Fh. Fix the DSC RECEIVER CAP SIZE accordingly. Fixes: ffddc4363c28 ("drm/dp: Add DP DSC DPCD receiver capability size define and missing SHIFT") Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Cc: Manasi Navare <manasi.d.navare@intel.com> Cc: <sta...
```diff diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index 02f2ac4dd2df..e69cece404b3 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -1537,7 +1537,7 @@ enum drm_dp_phy { #define DP_BRANCH_OUI_HEADER_SIZE 0xc #define DP_RECEIVER_CAP_SIZE 0xf -#define DP_D...
367124ebb359539fe237899abc6a9c78c6f793b6
Analyze and fix the following issue in the Linux kernel code: mfd: mxs-lradc: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'soc' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: mxs-lradc.c:145:15: error: cast to smaller integer type 'enum mxs_lradc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore...
```diff diff --git a/drivers/mfd/mxs-lradc.c b/drivers/mfd/mxs-lradc.c index 111d11fd25aa..21f3033d6eb5 100644 --- a/drivers/mfd/mxs-lradc.c +++ b/drivers/mfd/mxs-lradc.c @@ -142,7 +142,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) if (!of_id) return -EINVAL; - lradc->soc = (enum mxs_lradc_id)of_...
4e57d1425c7b9bc8e8be47835ac0afc8a94948d0
Analyze and fix the following issue in the Linux kernel code: mfd: wm31x: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: wm831x-spi.c:36:10: error: cast to smaller integer type 'enum wm831x_parent' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lo...
```diff diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c index 997837f13180..694ddbbf0372 100644 --- a/drivers/mfd/wm831x-i2c.c +++ b/drivers/mfd/wm831x-i2c.c @@ -36,7 +36,7 @@ static int wm831x_i2c_probe(struct i2c_client *i2c) dev_err(&i2c->dev, "Failed to match device\n"); return -ENODEV; ...
5033fb97795f5a21583e77331597cc9dbe7162a9
Analyze and fix the following issue in the Linux kernel code: mfd: wm8994: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: wm8994-core.c:631:19: error: cast to smaller integer type 'enum wm8994_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Charle...
```diff diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 1e4f1694f065..aba7af688175 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -628,7 +628,7 @@ static int wm8994_i2c_probe(struct i2c_client *i2c) if (i2c->dev.of_node) { of_id = of_match_device(wm8994_of_match,...
a2ce000265b78054225403e0815f11c7eefe0d58
Analyze and fix the following issue in the Linux kernel code: mfd: tc3589: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'version' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: tc3589x.c:343:13: error: cast to smaller integer type 'enum tc3589x_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https:/...
```diff diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c index 28125599fea4..db28eb0c8995 100644 --- a/drivers/mfd/tc3589x.c +++ b/drivers/mfd/tc3589x.c @@ -340,7 +340,7 @@ tc3589x_of_probe(struct device *dev, enum tc3589x_version *version) of_id = of_match_device(tc3589x_match, dev); if (!of_id) retur...
aad6c588bdd229034dc1152052f1a1a5aecabb0a
Analyze and fix the following issue in the Linux kernel code: mfd: lp87565: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'dev_type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: lp87565.c:95:23: error: cast to smaller integer type 'enum lp87565_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: htt...
```diff diff --git a/drivers/mfd/lp87565.c b/drivers/mfd/lp87565.c index 88ce4d7c50a7..1b7f8349911d 100644 --- a/drivers/mfd/lp87565.c +++ b/drivers/mfd/lp87565.c @@ -92,7 +92,7 @@ static int lp87565_probe(struct i2c_client *client) of_id = of_match_device(of_lp87565_match_table, &client->dev); if (of_id) - lp87...
b2ee6a378d05016357eba021698f4d3620455312
Analyze and fix the following issue in the Linux kernel code: mfd: hi6421-pmic: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: hi6421-pmic-core.c:62:9: error: cast to smaller integer type 'enum hi6421_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https:/...
```diff diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c index cb5cf4a81c06..a6a890537a1e 100644 --- a/drivers/mfd/hi6421-pmic-core.c +++ b/drivers/mfd/hi6421-pmic-core.c @@ -59,7 +59,7 @@ static int hi6421_pmic_probe(struct platform_device *pdev) id = of_match_device(of_hi6421_pmic_match,...
b1da99664b51c0538bec271e9d9924a3d92e3bd4
Analyze and fix the following issue in the Linux kernel code: mfd: max77541: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: max77541.c:176:18: error: cast to smaller integer type 'enum max7754x_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.k...
```diff diff --git a/drivers/mfd/max77541.c b/drivers/mfd/max77541.c index e147e949c2b3..10c2e274b4af 100644 --- a/drivers/mfd/max77541.c +++ b/drivers/mfd/max77541.c @@ -173,7 +173,7 @@ static int max77541_probe(struct i2c_client *client) i2c_set_clientdata(client, max77541); max77541->i2c = client; - max77541->...
0f28379e3a441a594b820c394654afaf0bd415f1
Analyze and fix the following issue in the Linux kernel code: mfd: max14577: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'dev_type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: max14577.c:406:5: error: cast to smaller integer type 'enum maxim_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-b...
```diff diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c index 25ed8846b7fb..1f4f5002595c 100644 --- a/drivers/mfd/max14577.c +++ b/drivers/mfd/max14577.c @@ -402,8 +402,7 @@ static int max14577_i2c_probe(struct i2c_client *i2c) of_id = of_match_device(max14577_dt_match, &i2c->dev); if (of_id) - m...
4db65f45e0ac1d361f351dbeda4c5660f3a4ea38
Analyze and fix the following issue in the Linux kernel code: mfd: stmpe: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'partnum' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: stmpe-i2c.c:90:13: error: cast to smaller integer type 'enum stmpe_partnum' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lo...
```diff diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index 1d7b401776d1..fe018bedab98 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c @@ -87,7 +87,7 @@ stmpe_i2c_probe(struct i2c_client *i2c) dev_info(&i2c->dev, "matching on node name, compatible is preferred\n"); partnum = id...
b7b53361c80b16ad461dbcb8a93e6e37578bac9b
Analyze and fix the following issue in the Linux kernel code: ceph: make ioctl cmds more readable in debug log
Problem Details: ioctl file 0000000004e6b054 cmd 2148296211 arg 824635143532 The numerical cmd value in the ioctl debug log message is too hard to understand even when you look at it in the code. Make it more readable. [ idryomov: add missing _ in ceph_ioctl_cmd_name() ] Signed-off-by: Xiubo Li <xiubli@redhat.com> R...
```diff diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 9bb37bcab05a..11d37d307382 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -313,11 +313,48 @@ static long ceph_set_encryption_policy(struct file *file, unsigned long arg) return ret; } +static const char *ceph_ioctl_cmd_name(const unsigned int cmd)...
6b5717bd30ab7f35792d20b71211055bdb43e6de
Analyze and fix the following issue in the Linux kernel code: ceph: implement -o test_dummy_encryption mount option
Problem Details: Add support for the test_dummy_encryption mount option. This allows us to test the encrypted codepaths in ceph without having to manually set keys, etc. [ lhenriques: fix potential fsc->fsc_dummy_enc_policy memory leak in ceph_real_mount() ] Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-...
```diff diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c index b17a6ee16cf0..b65e31c5c503 100644 --- a/fs/ceph/crypto.c +++ b/fs/ceph/crypto.c @@ -4,6 +4,7 @@ #include <linux/fscrypt.h> #include "super.h" +#include "mds_client.h" #include "crypto.h" static int ceph_crypt_get_context(struct inode *inode, void *c...
03bc06c7b0bd8d86b9f17f459acaeb1283ba2700
Analyze and fix the following issue in the Linux kernel code: ceph: add new mount option to enable sparse reads
Problem Details: Add a new mount option that has the client issue sparse reads instead of normal ones. The callers now preallocate an sparse extent buffer that the libceph receive code can populate and hand back after the operation completes. After a successful sparse read, we can't use the req->r_result value to dete...
```diff diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 59cbfb80edbd..f45ebe957bbe 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -245,8 +245,10 @@ static void finish_netfs_read(struct ceph_osd_request *req) struct ceph_fs_client *fsc = ceph_inode_to_client(req->r_inode); struct ceph_osd_data *osd_data = os...
442466e04f5f1b4616d3f023ff19166b82e19989
Analyze and fix the following issue in the Linux kernel code: xen/xenbus: Avoid a lockdep warning when adding a watch
Problem Details: The following lockdep warning appears during boot on a Xen dom0 system: [ 96.388794] ====================================================== [ 96.388797] WARNING: possible circular locking dependency detected [ 96.388799] 6.4.0-rc5-default+ #8 Tainted: G EL [ 96.388803] -------------...
```diff diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 12e02eb01f59..028a182bcc9e 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -840,8 +840,8 @@ void xs_suspend(void) { xs_suspend_enter(); - down_write(&xs_watch_rwsem); mutex_lock(&xs_resp...
99b415fe8986803ba0eaf6b8897b16edc8fe7ec2
Analyze and fix the following issue in the Linux kernel code: tg3: Use slab_build_skb() when needed
Problem Details: The tg3 driver will use kmalloc() under some conditions. Check the frag_size and use slab_build_skb() when frag_size is 0. Silences the warning introduced by commit ce098da1497c ("skbuff: Introduce slab_build_skb()"): Use slab_build_skb() instead ... tg3_poll_work+0x638/0xf90 [tg3] Fixes: ce098da1...
```diff diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 5ef073a79ce9..cb2810f175cc 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -6881,7 +6881,10 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) ri->data = NULL; ...
be809424659c2844a2d7ab653aacca4898538023
Analyze and fix the following issue in the Linux kernel code: selftests: bonding: do not set port down before adding to bond
Problem Details: Before adding a port to bond, it need to be set down first. In the lacpdu test the author set the port down specifically. But commit a4abfa627c38 ("net: rtnetlink: Enslave device before bringing it up") changed the operation order, the kernel will set the port down _after_ adding to bond. So all the po...
```diff diff --git a/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh b/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh index 47ab90596acb..6358df5752f9 100755 --- a/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh +++ b/tools/testing/selftests/drivers/net/bondi...
e332938e6fc8117fb9bb1374339cea879b3972d9
Analyze and fix the following issue in the Linux kernel code: samples: ftrace: Replace bti assembly with hint for older compiler
Problem Details: When cross-building the arm64 kernel with allmodconfig using GCC 9.4, the following error occurs on multiple files under samples/ftrace/: /tmp/ccPC1ODs.s: Assembler messages: /tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c' Fix this issue by replacing `bti c` with `hint 34`, whic...
```diff diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c index e5ed08098ff3..e2a6a69352df 100644 --- a/samples/ftrace/ftrace-direct-modify.c +++ b/samples/ftrace/ftrace-direct-modify.c @@ -105,7 +105,7 @@ asm ( " .type my_tramp1, @function\n" " .globl my_tramp1\n" " my_t...
bb9b0e46b84c19d3dd7d453a2da71a0fdc172b31
Analyze and fix the following issue in the Linux kernel code: hv: hyperv.h: Replace one-element array with flexible-array member
Problem Details: One-element and zero-length arrays are deprecated. Replace one-element array in struct vmtransfer_page_packet_header with flexible-array member. This change fixes below warning: [ 2.593788] ================================================================================ [ 2.593908] UBSAN: array-...
```diff diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 1f2bfec4abde..a922d4526de4 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -348,7 +348,7 @@ struct vmtransfer_page_packet_header { u8 sender_owns_set; u8 reserved; u32 range_cnt; - struct vmtransfer_page_range ranges[1...
78e04bbff849b51b56f5925b1945db2c6e128b61
Analyze and fix the following issue in the Linux kernel code: Drivers: hv: vmbus: Don't dereference ACPI root object handle
Problem Details: Since the commit referenced in the Fixes: tag below the VMBus client driver is walking the ACPI namespace up from the VMBus ACPI device to the ACPI namespace root object trying to find Hyper-V MMIO ranges. However, if it is not able to find them it ends trying to walk resources of the ACPI namespace r...
```diff diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 67f95a29aeca..edbb38f6956b 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -2287,7 +2287,8 @@ static int vmbus_acpi_add(struct platform_device *pdev) * Some ancestor of the vmbus acpi device (Gen1 or Gen2 * firmware) is...
7d6612834d176a1343aea4b2f01efa94f1cea68f
Analyze and fix the following issue in the Linux kernel code: soc: kunpeng_hccs: fix some sparse warnings about incorrect type
Problem Details: This patch fixes some sparse warnings about incorrect type. The address about PCC communication space should use '__iomem' tag. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.dH5Muhva-lkp@intel.com/ Fixes: 886bdf9c883b ("soc: hisilicon: Suppor...
```diff diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c index 0d6f6bacd3f6..f3810d9d1caa 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -156,8 +156,8 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev) } if (pcc_c...
213454b3af2e35c2ce9bbfa3e648bcde6d60eac5
Analyze and fix the following issue in the Linux kernel code: drm/i915: Eliminate IS_MTL_DISPLAY_STEP
Problem Details: Stepping-specific display behavior shouldn't be tied to MTL as a platform, but rather specifically to the Xe_LPD+ IP. Future non-MTL platforms may re-use this IP and will need to follow the exact same logic and apply the same workarounds. IS_MTL_DISPLAY_STEP() is dropped in favor of a new macro IS_DI...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index eb630a946343..8198401aa5be 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -72,6 +72,31 @@ struct drm_printer...
5a213086a025349361b5cf75c8fd4591d96a7a99
Analyze and fix the following issue in the Linux kernel code: drm/i915: Eliminate IS_MTL_GRAPHICS_STEP
Problem Details: Several workarounds are guarded by IS_MTL_GRAPHICS_STEP. However none of these workarounds are actually tied to MTL as a platform; they only relate to the Xe_LPG graphics IP, regardless of what platform it appears in. At the moment MTL is the only platform that uses Xe_LPG with IP versions 12.70 and ...
```diff diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 6b01a0b68b97..c3b8a5a378f8 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -20,6 +20,7 @@ #include "skl_scaler.h...
1a70ca71547be051769f0628aa09717694f508f0
Analyze and fix the following issue in the Linux kernel code: interconnect: qcom: bcm-voter: Use enable_maks for keepalive voting
Problem Details: BCMs with an enable_mask expect to only have that specific value written to them. The current implementation only works by miracle for BCMs with enable mask == BIT(0), as the minimal vote we've been using so far just so happens to be equal to that. Use the correct value with keepalive voting. Fixes: ...
```diff diff --git a/drivers/interconnect/qcom/bcm-voter.c b/drivers/interconnect/qcom/bcm-voter.c index d857eb8838b9..a2d437a05a11 100644 --- a/drivers/interconnect/qcom/bcm-voter.c +++ b/drivers/interconnect/qcom/bcm-voter.c @@ -81,10 +81,10 @@ static void bcm_aggregate_mask(struct qcom_icc_bcm *bcm) } if (bcm-...
d93a7cf6ca2cfcd7de5d06f753ce8d5e863316ac
Analyze and fix the following issue in the Linux kernel code: samples/bpf: fix broken map lookup probe
Problem Details: In the commit 7c4cd051add3 ("bpf: Fix syscall's stackmap lookup potential deadlock"), a potential deadlock issue was addressed, which resulted in *_map_lookup_elem not triggering BPF programs. (prior to lookup, bpf_disable_instrumentation() is used) To resolve the broken map lookup probe using "htab_m...
```diff diff --git a/samples/bpf/tracex6.bpf.c b/samples/bpf/tracex6.bpf.c index 6ad82e68f998..9b23b4737cfb 100644 --- a/samples/bpf/tracex6.bpf.c +++ b/samples/bpf/tracex6.bpf.c @@ -1,6 +1,8 @@ #include "vmlinux.h" #include <linux/version.h> #include <bpf/bpf_helpers.h> +#include <bpf/bpf_tracing.h> +#include <bpf/...
92632115fb57ff9e368f256913e96d6fd5abf5ab
Analyze and fix the following issue in the Linux kernel code: samples/bpf: fix bio latency check with tracepoint
Problem Details: Recently, a new tracepoint for the block layer, specifically the block_io_start/done tracepoints, was introduced in commit 5a80bd075f3b ("block: introduce block_io_start/block_io_done tracepoints"). Previously, the kprobe entry used for this purpose was quite unstable and inherently broke relevant pro...
```diff diff --git a/samples/bpf/tracex3.bpf.c b/samples/bpf/tracex3.bpf.c index 7cc60f10d2e5..41f37966f5f5 100644 --- a/samples/bpf/tracex3.bpf.c +++ b/samples/bpf/tracex3.bpf.c @@ -9,6 +9,12 @@ #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h> +struct start_key { + dev_t dev; + u32 _pad; + sector_t sector...
02dabc247ad68b41758bf39f11e2d682b8b32dd7
Analyze and fix the following issue in the Linux kernel code: samples/bpf: fix symbol mismatch by compiler optimization
Problem Details: Currently, multiple kprobe programs are suffering from symbol mismatch due to compiler optimization. These optimizations might induce additional suffix to the symbol name such as '.isra' or '.constprop'. # egrep ' finish_task_switch| __netif_receive_skb_core' /proc/kallsyms ffffffff81135e50 t ...
```diff diff --git a/samples/bpf/offwaketime.bpf.c b/samples/bpf/offwaketime.bpf.c index 8e5105811178..3200a0f44969 100644 --- a/samples/bpf/offwaketime.bpf.c +++ b/samples/bpf/offwaketime.bpf.c @@ -118,7 +118,7 @@ int oncpu(struct trace_event_raw_sched_switch *ctx) /* record previous thread sleep time */ u32 pid =...
4a0ee78890699706f59cc9bdf8283ecaa4e0a141
Analyze and fix the following issue in the Linux kernel code: samples/bpf: unify bpf program suffix to .bpf with tracing programs
Problem Details: Currently, BPF programs typically have a suffix of .bpf.c. However, some programs still utilize a mixture of _kern.c suffix alongside the naming convention. In order to achieve consistency in the naming of these programs, this commit unifies the inconsistency in the naming convention of BPF kernel prog...
```diff diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index b32cb8a62335..f90bcd3696bd 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -124,21 +124,21 @@ always-y := $(tprogs-y) always-y += sockex1_kern.o always-y += sockex2_kern.o always-y += sockex3_kern.o -always-y += tracex1_kern.o +al...
34f6e38f58db9a94718c273edc9ca3fc8b4dba5f
Analyze and fix the following issue in the Linux kernel code: samples/bpf: fix warning with ignored-attributes
Problem Details: Currently, compiling the bpf programs will result the warning with the ignored attribute as follows. This commit fixes the warning by adding cf-protection option. In file included from ./arch/x86/include/asm/linkage.h:6: ./arch/x86/include/asm/ibt.h:77:8: warning: 'nocf_check' attribute ignore...
```diff diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 595b98d825ce..b32cb8a62335 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -440,7 +440,7 @@ $(obj)/%.o: $(src)/%.c -Wno-gnu-variable-sized-type-not-at-end \ -Wno-address-of-packed-member -Wno-tautological-compare \ -Wno-unkn...
13619170303878e1dae86d9a58b039475c957fcf
Analyze and fix the following issue in the Linux kernel code: interconnect: Teach lockdep about icc_bw_lock order
Problem Details: Teach lockdep that icc_bw_lock is needed in code paths that could deadlock if they trigger reclaim. Signed-off-by: Rob Clark <robdclark@chromium.org> Link: https://lore.kernel.org/r/20230807171148.210181-8-robdclark@gmail.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
```diff diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e15a92a79df1..1afbc4f7c6e7 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -1041,13 +1041,21 @@ void icc_sync_state(struct device *dev) } } } + mutex_unlock(&icc_bw_lock); mutex_unlock(&icc_lock...
af42269c3523492d71ebbe11fefae2653e9cdc78
Analyze and fix the following issue in the Linux kernel code: interconnect: Fix locking for runpm vs reclaim
Problem Details: For cases where icc_bw_set() can be called in callbaths that could deadlock against shrinker/reclaim, such as runpm resume, we need to decouple the icc locking. Introduce a new icc_bw_lock for cases where we need to serialize bw aggregation and update to decouple that from paths that require memory al...
```diff diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 5fac448c28fd..e15a92a79df1 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -28,6 +28,7 @@ static LIST_HEAD(icc_providers); static int providers_count; static bool synced_state; static DEFINE_MUTEX(icc_l...
16862f1b2110eca6330e5be6d804e1a08e06a202
Analyze and fix the following issue in the Linux kernel code: interconnect: qcom: sm8450: Enable sync_state
Problem Details: Enable sync_state on sm8450 so that the interconnect votes actually mean anything and aren't just pinned to INT_MAX. Fixes: fafc114a468e ("interconnect: qcom: Add SM8450 interconnect provider driver") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Li...
```diff diff --git a/drivers/interconnect/qcom/sm8450.c b/drivers/interconnect/qcom/sm8450.c index 6ce413f7c10b..eb7e17df32ba 100644 --- a/drivers/interconnect/qcom/sm8450.c +++ b/drivers/interconnect/qcom/sm8450.c @@ -1888,6 +1888,7 @@ static struct platform_driver qnoc_driver = { .driver = { .name = "qnoc-sm8450...
fab610be30dbaa4ef5dcfabe4dc498c557a1b7ad
Analyze and fix the following issue in the Linux kernel code: of: Refactor node and property manipulation function locking
Problem Details: All callers of __of_{add,remove,update}_property() and __of_{attach,detach}_node() wrap the call with the devtree_lock spinlock. Let's move the spinlock into the functions. This allows moving the sysfs update functions into those functions as well. Link: https://lore.kernel.org/r/20230801-dt-changeset...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index 3f9ddd18ff4b..8d93cb6ea9cd 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1551,21 +1551,32 @@ static struct property *__of_remove_property_from_list(struct property **list, s */ int __of_add_property(struct device_node *np, struct property ...
6701c2c76a1ed4bb442235204820cfa24e8d5b9c
Analyze and fix the following issue in the Linux kernel code: of: dynamic: Move dead property list check into property add/update functions
Problem Details: The changeset code checks for a property in the deadprops list when adding/updating a property, but of_add_property() and of_update_property() do not. As the users of these functions are pretty simple, they have not hit this scenario or else the property lists would get corrupted. With this there are ...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index e235f3a57ea8..3f9ddd18ff4b 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1530,6 +1530,20 @@ int of_count_phandle_with_args(const struct device_node *np, const char *list_na } EXPORT_SYMBOL(of_count_phandle_with_args); +static struct prope...
420f0de965a80b7060d23d2c23cddaed4e4ad2eb
Analyze and fix the following issue in the Linux kernel code: of: dynamic: Fix race in getting old property when updating property
Problem Details: __of_update_property() returns the existing property if there is one, but that value is never added to the changeset. Updates work because the existing property was also retrieved before in of_changeset_action(), but that is racy as of_changeset_action() doesn't hold any locks. The property could be ch...
```diff diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index b2b921bcbbcb..38dc536bc64c 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -564,7 +564,7 @@ static int __of_changeset_entry_notify(struct of_changeset_entry *ce, static int __of_changeset_entry_apply(struct of_changeset_entry *ce)...
27a02f265e25a6d6136d07d0187fd02fe1691fd7
Analyze and fix the following issue in the Linux kernel code: of: dynamic: Refactor changeset action printing to common helpers
Problem Details: Several places print the changeset action with node and property details. Refactor these into a common printing helper. The complicating factor is some prints are debug and some are errors. Solve this with a bit of preprocessor magic. Some cases printed the 'cset' which was the changeset entry pointer...
```diff diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 4999636eaa92..b2b921bcbbcb 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -72,27 +72,21 @@ static const char *action_names[] = { [OF_RECONFIG_UPDATE_PROPERTY] = "UPDATE_PROPERTY", }; +#define _do_print(func, prefix, action, nod...
641671d97b9199f1ba35ccc2222d4b189a6a5de5
Analyze and fix the following issue in the Linux kernel code: Revert "scsi: qla2xxx: Fix buffer overrun"
Problem Details: Revert due to Get PLOGI Template failed. This reverts commit b68710a8094fdffe8dd4f7a82c82649f479bb453. Cc: stable@vger.kernel.org Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/20230821130045.34850-9-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhan...
```diff diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index df2c69c08137..82077edfda1f 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5607,7 +5607,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha) __be32 *q; memset(ha->init_cb, 0...
b496953dd0444001b12f425ea07d78c1f47e3193
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix smatch warn for qla_init_iocb_limit()
Problem Details: Fix indentation for warning reported by smatch: drivers/scsi/qla2xxx/qla_init.c:4199 qla_init_iocb_limit() warn: inconsistent indenting Fixes: efa74a62aaa2 ("scsi: qla2xxx: Adjust IOCB resource on qpair create") Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/202308...
```diff diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e733be74de16..df2c69c08137 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4205,7 +4205,7 @@ void qla_init_iocb_limit(scsi_qla_host_t *vha) u8 i; struct qla_hw_data *ha = vha->hw; - ...
0ba0b018f94525a6b32f5930f980ce9b62b72e6f
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Error code did not return to upper layer
Problem Details: TMF was returned with an error code. The error code was not preserved to be returned to upper layer. Instead, the error code from the Marker was returned. Preserve error code from TMF and return it to upper layer. Cc: stable@vger.kernel.org Fixes: da7c21b72aa8 ("scsi: qla2xxx: Fix command flush durin...
```diff diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index d9a7d63001bd..e733be74de16 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -2223,6 +2223,8 @@ __qla2x00_async_tm_cmd(struct tmf_arg *arg) rval = QLA_FUNCTION_FAILED; } } + if (tm_i...
e370b64c7db96384a0886a09a9d80406e4c663d7
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix firmware resource tracking
Problem Details: The storage was not draining I/Os and the work load was not spread out across different CPUs evenly. This led to firmware resource counters getting overrun on the busy CPU. This overrun prevented error recovery from happening in a timely manner. By switching the counter to atomic, it allows the count ...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index f1cf921068e3..9ec39bcd41b5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3770,6 +3770,16 @@ struct qla_fw_resources { u16 pad; }; +struct qla_fw_res { + u16 iocb_total; + u16 ...
6d0b65569c0a10b27c49bacd8d25bcd406003533
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Flush mailbox commands on chip reset
Problem Details: Fix race condition between Interrupt thread and Chip reset thread in trying to flush the same mailbox. With the race condition, the "ha->mbx_intr_comp" will get an extra complete() call. The extra complete call create erroneous mailbox timeout condition when the next mailbox is sent where the mailbox c...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 2007d5bb5f9f..f1cf921068e3 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4418,7 +4418,6 @@ struct qla_hw_data { uint8_t aen_mbx_count; atomic_t num_pend_mbx_stage1; atomic_t num_pend_...
c422fbd5cb58c9a078172ae1e9750971b738a197
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5
Problem Details: The qunipro_g4_sel clear is also needed for new platforms with major version > 5. Fix the version check to take this into account. Fixes: 9c02aa24bf40 ("scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5") Acked-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Nitin Rawat <quic_n...
```diff diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8d6fd4c3324f..c1557d21b027 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -321,7 +321,7 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host) ufs_qcom_cap_qunipro(host) ? QUNIPRO_SE...
84c073fd89de22d5cb09edffb1f692a1964fd584
Analyze and fix the following issue in the Linux kernel code: scsi: target: Fix write perf due to unneeded throttling
Problem Details: The write back throttling (WBT) code checks if REQ_SYNC | REQ_IDLE is set to determine if a write is O_DIRECT vs buffered. If the bits are not set then it assumes it's a buffered write and will throttle LIO if we hit certain metrics. LIO itself is not using the buffer cache and is doing direct I/O, so ...
```diff diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 3d1b511ea284..5937a7ed6989 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -740,11 +740,16 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, ...
d0c89af3130eb4ff962266bb7597690a696f1cbc
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: mcq: Fix the search/wrap around logic
Problem Details: The search and wrap around logic in the ufshcd_mcq_sqe_search() function does not work correctly when the hwq's queue depth is not a power of two number. Correct it so that any queue depth with a positive integer value within the supported range would work. Signed-off-by: "Bao D. Nguyen" <quic_nguyenb...
```diff diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 6fb0e007af63..386674ead7f0 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -580,7 +580,6 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba, { struct ufshcd_lrb *lrbp = &hba->lrb[task_tag]; struct u...
fb2bdd32b231b70e6a3f1054528692f604db25d8
Analyze and fix the following issue in the Linux kernel code: remoteproc: stm32: fix incorrect optional pointers
Problem Details: Compile-testing without CONFIG_OF shows that the of_match_ptr() macro was used incorrectly here: drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable] As in almost every driver, the solution is simply to remove the use of this macro. The same ...
```diff diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 98234b44f038..9d9b13530f78 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev) rproc_free(rproc); } -stati...
1a1975551943f681772720f639ff42fbaa746212
Analyze and fix the following issue in the Linux kernel code: scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock
Problem Details: There is a long call chain that &fip->ctlr_lock is acquired by isr fnic_isr_msix_wq_copy() under hard IRQ context. Thus other process context code acquiring the lock should disable IRQ, otherwise deadlock could happen if the IRQ preempts the execution while the lock is held in process context on the sa...
```diff diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index 5c8d1ba3f8f3..19eee108db02 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -319,16 +319,17 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip) { struct fcoe_fcf *sel; struct fcoe_fcf *fcf...
2d6f70fe175e342d29ee1103523551bb224981d4
Analyze and fix the following issue in the Linux kernel code: scsi: elx: sli4: Remove code duplication
Problem Details: In the function sli_xmit_bls_rsp64_wqe(), the 'if' and 'else' conditions evaluates the same expression and give the same output. Also, params->s_id shall not be equal to U32_MAX. Remove the unused code. This fixes coccinelle warning such as: drivers/scsi/elx/libefc_sli/sli4.c:2320:2-4: WARNING: possib...
```diff diff --git a/drivers/scsi/elx/libefc_sli/sli4.c b/drivers/scsi/elx/libefc_sli/sli4.c index 8f96049f62dd..5e7fb110bc3f 100644 --- a/drivers/scsi/elx/libefc_sli/sli4.c +++ b/drivers/scsi/elx/libefc_sli/sli4.c @@ -2317,12 +2317,8 @@ sli_xmit_bls_rsp64_wqe(struct sli4 *sli, void *buf, SLI4_GENERIC_CONTEXT_VPI <<...
7882541ca06d51a6c12d687827176c16d5e05f65
Analyze and fix the following issue in the Linux kernel code: of/platform: increase refcount of fwnode
Problem Details: commit 0f8e5651095b ("of/platform: Propagate firmware node by calling device_set_node()") use of_fwnode_handle to replace of_node_get, which introduces a side effect that the refcount is not increased. Then the out of tree jailhouse hypervisor enable/disable test will trigger kernel dump in of_overlay_...
```diff diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 0c3475e7d2ff..6a557eb866d0 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -141,7 +141,7 @@ struct platform_device *of_device_alloc(struct device_node *np, } /* setup generic device info */ - device_set_node(&dev->dev, of_f...
cdaac8e7e5a059f9b5e816cda257f08d0abffacd
Analyze and fix the following issue in the Linux kernel code: nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse
Problem Details: A syzbot stress test using a corrupted disk image reported that mark_buffer_dirty() called from __nilfs_mark_inode_dirty() or nilfs_palloc_commit_alloc_entry() may output a kernel warning, and can panic if the kernel is booted with panic_on_warn. This is because nilfs2 keeps buffer pointers in local s...
```diff diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c index 6ce8617b562d..7342de296ec3 100644 --- a/fs/nilfs2/alloc.c +++ b/fs/nilfs2/alloc.c @@ -205,7 +205,8 @@ static int nilfs_palloc_get_block(struct inode *inode, unsigned long blkoff, int ret; spin_lock(lock); - if (prev->bh && blkoff == prev->blkoff) { ...
198430f7f785e072d5d70fe522b6c7abdf41068a
Analyze and fix the following issue in the Linux kernel code: scripts/bloat-o-meter: count weak symbol sizes
Problem Details: Currently, bloat-o-meter does not take into account weak symbols, and thus ignores any size changes in code or data marked __weak. Fix this by handling weak code ("w"/"W") and data ("v"/"V"). Link: https://lkml.kernel.org/r/a1e7abd2571c3bbfe75345d6ee98b276d2d5c39d.1692200010.git.geert+renesas@glider....
```diff diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 36303afa9dfc..888ce286a351 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter @@ -100,12 +100,12 @@ def print_result(symboltype, symbolformat): print("Total: Before=%d, After=%d, chg %+.2f%%" % (otot, ntot, percent)) if args.c:...
0a6b58c5cd0dfd7961e725212f0fc8dfc5d96195
Analyze and fix the following issue in the Linux kernel code: lockdep: fix static memory detection even more
Problem Details: On the parisc architecture, lockdep reports for all static objects which are in the __initdata section (e.g. "setup_done" in devtmpfs, "kthreadd_done" in init/main.c) this warning: INFO: trying to register non-static key. The warning itself is wrong, because those objects are in the __initdata secti...
```diff diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h index a6e8373a5170..3fa87e5e11ab 100644 --- a/arch/x86/include/asm/sections.h +++ b/arch/x86/include/asm/sections.h @@ -2,8 +2,6 @@ #ifndef _ASM_X86_SECTIONS_H #define _ASM_X86_SECTIONS_H -#define arch_is_kernel_initmem_freed arc...
11f956538c07e566bb8edf399c30cccb064df5a3
Analyze and fix the following issue in the Linux kernel code: scripts/gdb/symbols: add specific ko module load command
Problem Details: Patch series "Add GDB memory helper commands", v2. I've created some GDB commands I think useful when I debug some memory issues and kernel module issue. For memory issue, we would like to get slabinfo, slabtrace, page_owner and vmallocinfo to debug the memory issues. For module issue, we would like...
```diff diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index c8047f4441e6..5179edd1b627 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -111,11 +111,12 @@ lx-symbols command.""" return "{textaddr} {sections}".format( textaddr=textaddr, sect...
5b2c73341ae979fff017d8605d74601f86786eef
Analyze and fix the following issue in the Linux kernel code: checkpatch: special case extern struct in .c
Problem Details: "externs should be avoided in .c files" needs an exception for linker symbols, like those that mark the start, stop of many kernel sections. Since checkpatch already checks REALNAME to avoid looking at fragments changing vmlinux.lds.h, add a new else-if block to look at them instead. As a simple heur...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 880fde13d9b8..6aabcc1f66c1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -74,6 +74,8 @@ my $git_command ='export LANGUAGE=en_US.UTF-8; git'; my $tabsize = 8; my ${CONFIG_} = "CONFIG_"; +my %maybe_linker_symbol; # for extern...
62ec2092095b678ff89ce4ba51c2938cd1e8e630
Analyze and fix the following issue in the Linux kernel code: scsi: core: Use 32-bit hostnum in scsi_host_lookup()
Problem Details: Change scsi_host_lookup() hostnum argument type from unsigned short to unsigned int to match the type used everywhere else. Fixes: 6d49f63b415c ("[SCSI] Make host_no an unsigned int") Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Link: https://lore.kernel.org/r/a02497e7-c12b-ef15-47fc-3f0a0b00...
```diff diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 198edf03f929..d7f51b84f3c7 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -537,7 +537,7 @@ EXPORT_SYMBOL(scsi_host_alloc); static int __scsi_host_match(struct device *dev, const void *data) { struct Scsi_Host *p; - const unsigne...
835bc157da689f834d10296d0942aed88b310b4f
Analyze and fix the following issue in the Linux kernel code: mm/kmemleak: use object_cache instead of kmemleak_initialized to check in set_track_prepare()
Problem Details: Patch series "mm/kmemleak: use object_cache instead of kmemleak_initialized", v3. Use object_cache instead of kmemleak_initialized to check in set_track_prepare(), so that memory leaks after kmemleak_init() can be recorded and Rename kmemleak_initialized to kmemleak_late_initialized unreferenced obje...
```diff diff --git a/mm/kmemleak.c b/mm/kmemleak.c index a2d34226e3c8..16fc7b0984b9 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -610,7 +610,12 @@ static noinline depot_stack_handle_t set_track_prepare(void) unsigned long entries[MAX_TRACE]; unsigned int nr_entries; - if (!kmemleak_initialized) + /* + * Use...
daa60ae64c6587e2be2cdf02bca21b59551ee0f6
Analyze and fix the following issue in the Linux kernel code: mm,thp: fix smaps THPeligible output alignment
Problem Details: Extract from current /proc/self/smaps output: Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 0 ProtectionKey: 0 That's not the alignment shown in Documentation/filesystems/proc.rst: it's an ugly artifact from missing out the %8 other fields...
```diff diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index bf25178ae66a..74cbb00422ea 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -854,7 +854,7 @@ static int show_smap(struct seq_file *m, void *v) __show_smap(m, &mss, false); - seq_printf(m, "THPeligible: %d\n", + seq_printf(m, "THPelig...
4b5b7850c9282f9c7e646ec140b84b2d2f0aeeb8
Analyze and fix the following issue in the Linux kernel code: mm,thp: fix nodeN/meminfo output alignment
Problem Details: Add one more space to FileHugePages and FilePmdMapped, so the output is aligned with other rows in /sys/devices/system/node/nodeN/meminfo. Link: https://lkml.kernel.org/r/be861b50-a790-e041-bcb0-2a987dcfd1a@google.com Signed-off-by: Hugh Dickins <hughd@google.com> Reviewed-by: David Hildenbrand <david...
```diff diff --git a/drivers/base/node.c b/drivers/base/node.c index 9de524e56307..8e871ba9162f 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -446,8 +446,8 @@ static ssize_t node_read_meminfo(struct device *dev, "Node %d AnonHugePages: %8lu kB\n" "Node %d ShmemHugePages: %8lu kB\n" ...
8dbbc49345a7452ee59783ed5f5637b5d59532ba
Analyze and fix the following issue in the Linux kernel code: mm,thp: no space after colon in Mem-Info fields
Problem Details: Patch series "mm,thp: fix sloppy text output". Three independent trivial patches, fixing sloppy text output which has annoyed me; but might risk surprising a parser, so any can be dropped. This patch (of 3): The SysRq-m or OOM Mem-Info dmesg showed (long lines containing) ... shmem:NkB shmem_thp: ...
```diff diff --git a/mm/show_mem.c b/mm/show_mem.c index 09c7d036d49e..4b888b18bdde 100644 --- a/mm/show_mem.c +++ b/mm/show_mem.c @@ -251,9 +251,9 @@ static void show_free_areas(unsigned int filter, nodemask_t *nodemask, int max_z " writeback:%lukB" " shmem:%lukB" #ifdef CONFIG_TRANSPARENT_HUGEPAGE - " shme...
6469b66e3f5a38214bf1d1220d54d78d9cd08ebd
Analyze and fix the following issue in the Linux kernel code: selftests: improve vm.memfd_noexec sysctl tests
Problem Details: This adds proper tests for the nesting functionality of vm.memfd_noexec as well as some minor cleanups to spawn_*_thread(). Link: https://lkml.kernel.org/r/20230814-memfd-vm-noexec-uapi-fixes-v2-5-7ff9e3e10ba6@cyphar.com Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Cc: Christian Brauner <brauner@ke...
```diff diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 8b7390ad81d1..3df008677239 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -18,6 +18,7 @@ #include <sys/syscall.h> #include <sys/wait.h> #incl...
9876cfe8ec1cb3c88de31f4d58d57b0e7e22bcc4
Analyze and fix the following issue in the Linux kernel code: memfd: replace ratcheting feature from vm.memfd_noexec with hierarchy
Problem Details: This sysctl has the very unusual behaviour of not allowing any user (even CAP_SYS_ADMIN) to reduce the restriction setting, meaning that if you were to set this sysctl to a more restrictive option in the host pidns you would need to reboot your machine in order to reset it. The justification given in ...
```diff diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 53974d79d98e..f9f9931e02d6 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -39,7 +39,6 @@ struct pid_namespace { int reboot; /* group exit code if this pidns was rebooted */ struct ns_common ns...
434ed3350f57c03a9654fe0619755cc137a58935
Analyze and fix the following issue in the Linux kernel code: memfd: improve userspace warnings for missing exec-related flags
Problem Details: In order to incentivise userspace to switch to passing MFD_EXEC and MFD_NOEXEC_SEAL, we need to provide a warning on each attempt to call memfd_create() without the new flags. pr_warn_once() is not useful because on most systems the one warning is burned up during the boot process (on my system, syste...
```diff diff --git a/mm/memfd.c b/mm/memfd.c index d65485c762de..aa46521057ab 100644 --- a/mm/memfd.c +++ b/mm/memfd.c @@ -315,7 +315,7 @@ SYSCALL_DEFINE2(memfd_create, return -EINVAL; if (!(flags & (MFD_EXEC | MFD_NOEXEC_SEAL))) { - pr_warn_once( + pr_info_ratelimited( "%s[%d]: memfd_create() called witho...
202e14222fadb246dfdf182e67de1518e86a1e20
Analyze and fix the following issue in the Linux kernel code: memfd: do not -EACCES old memfd_create() users with vm.memfd_noexec=2
Problem Details: Given the difficulty of auditing all of userspace to figure out whether every memfd_create() user has switched to passing MFD_EXEC and MFD_NOEXEC_SEAL flags, it seems far less distruptive to make it possible for older programs that don't make use of executable memfds to run under vm.memfd_noexec=2. Ot...
```diff diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index c758809d5bcf..53974d79d98e 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -17,18 +17,10 @@ struct fs_pin; #if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE) -/* - * sysctl for vm.memfd...
99f34659e78b9b781a3248e0b080b4dfca4957e2
Analyze and fix the following issue in the Linux kernel code: selftests: memfd: error out test process when child test fails
Problem Details: Patch series "memfd: cleanups for vm.memfd_noexec", v2. The most critical issue with vm.memfd_noexec=2 (the fact that passing MFD_EXEC would bypass it entirely[1]) has been fixed in Andrew's tree[2], but there are still some outstanding issues that need to be addressed: * vm.memfd_noexec=2 shouldn't...
```diff diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index dbdd9ec5e397..8eb49204f9ea 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -1207,7 +1207,24 @@ static pid_t spawn_newpid_thread(unsigned int flag...
708879a1b44216f6c12a3d61328c5259078fc1b1
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix uffd-stress help information
Problem Details: commit 686a8bb72349("selftests/mm: split uffd tests into uffd-stress and uffd-unit-tests") split uffd tests into uffd-stress and uffd-unit-tests, obviously we need to modify the help information synchronously. Also modify code indentation. Link: https://lkml.kernel.org/r/tencent_64FC724AC5F05568F41BD...
```diff diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index 73ebb97c7026..469e0476af26 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -53,21 +53,21 @@ pthread_attr_t attr; do { typeof(a) __tmp = (a); (a) = (b);...
b7108d66318abf3e060c7839eabcba52e9461568
Analyze and fix the following issue in the Linux kernel code: Multi-gen LRU: skip CMA pages when they are not eligible
Problem Details: This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when they are not available") which skips cma pages reclaim when they are not eligible for the current allocation context. In mglru, such pages are added to the tail of the immediate generation to maintain better LRU order, which is un...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index b4329f93a682..6cbe921ef662 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c } /* ineligible */ - if (zone > sc->reclaim_idx) { + if (zone > sc->reclaim_idx || skip_...
1a8c64e110435e44e71bcd50a75663174b575f22
Analyze and fix the following issue in the Linux kernel code: mm/memory_hotplug: embed vmem_altmap details in memory block
Problem Details: With memmap on memory, some architecture needs more details w.r.t altmap such as base_pfn, end_pfn, etc to unmap vmemmap memory. Instead of computing them again when we remove a memory block, embed vmem_altmap details in struct memory_block if we are using memmap on memory block feature. [yangyinglia...
```diff diff --git a/drivers/base/memory.c b/drivers/base/memory.c index b456ac213610..8191709c9ad2 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -105,7 +105,8 @@ EXPORT_SYMBOL(unregister_memory_notifier); static void memory_block_release(struct device *dev) { struct memory_block *mem = to_memor...
9a9d0b829901125553c36b9512b2a5da4505be31
Analyze and fix the following issue in the Linux kernel code: mm: move dummy_vm_ops out of a header
Problem Details: Otherwise the kernel ends up with multiple copies: $ nm vmlinux | grep dummy_vm_ops ffffffff81e4ea00 d dummy_vm_ops.2 ffffffff81e11760 d dummy_vm_ops.254 ffffffff81e406e0 d dummy_vm_ops.4 ffffffff81e3c780 d dummy_vm_ops.7 While here prefix it with vma_. Link: https://lkml.kernel.org/r/20230806231611....
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 5a6ff9140090..c63ec57a54dc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -751,17 +751,17 @@ static inline struct vm_area_struct *lock_vma_under_rcu(struct mm_struct *mm, #endif /* CONFIG_PER_VMA_LOCK */ +extern const struct vm_operati...
ad9f006351c3368171458ae7ab14d72f031b239f
Analyze and fix the following issue in the Linux kernel code: mm: always lock new vma before inserting into vma tree
Problem Details: While it's not strictly necessary to lock a newly created vma before adding it into the vma tree (as long as no further changes are performed to it), it seems like a good policy to lock it and prevent accidental changes after it becomes visible to the page faults. Lock the vma before adding it into the...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 35b6bc9c7c95..ef584aca1cd3 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -401,6 +401,8 @@ static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma) if (vma_iter_prealloc(&vmi, vma)) return -ENOMEM; + vma_start_write(vma); + vma_iter_store(&vmi, vma); ...
60081bf19b0ec8fa40c589bd361fa2bc763f1050
Analyze and fix the following issue in the Linux kernel code: mm: lock vma explicitly before doing vm_flags_reset and vm_flags_reset_once
Problem Details: Implicit vma locking inside vm_flags_reset() and vm_flags_reset_once() is not obvious and makes it hard to understand where vma locking is happening. Also in some cases (like in dup_userfaultfd()) vma should be locked earlier than vma_flags modification. To make locking more visible, change these funct...
```diff diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c index 709ebd578394..e2d6f9327f77 100644 --- a/arch/powerpc/kvm/book3s_hv_uvmem.c +++ b/arch/powerpc/kvm/book3s_hv_uvmem.c @@ -410,6 +410,7 @@ static int kvmppc_memslot_page_merge(struct kvm *kvm, ret = H_STATE; break; ...
0aa8ea3c5d353d5f0aa1e607f8dc5f43bf6cdf05
Analyze and fix the following issue in the Linux kernel code: mm/compaction: correct comment of fast_find_migrateblock in isolate_migratepages
Problem Details: After 90ed667c03fe5 ("Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"""), we remove skip set in fast_find_migrateblock. Correct comment that fast_find_block is used to avoid isolation_suitable check for pageblock returned from fast_find_migrateblock because fast_find_migratebloc...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index 78826c433ef6..3b204fbaa470 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1987,9 +1987,9 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) block_start_pfn = cc->zone->zone_start_pfn; /* - * fast_find_migrateblock mar...
f720b471fdb35619402293dcd421761fb1942e27
Analyze and fix the following issue in the Linux kernel code: mm: hugetlb: use flush_hugetlb_tlb_range() in move_hugetlb_page_tables()
Problem Details: Archs may need to do special things when flushing hugepage tlb, so use the more applicable flush_hugetlb_tlb_range() instead of flush_tlb_range(). Link: https://lkml.kernel.org/r/20230801023145.17026-2-wangkefeng.wang@huawei.com Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage ba...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 26e87d6cc92f..102f83bd3a9f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5279,9 +5279,9 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma, } if (shared_pmd) - flush_tlb_range(vma, range.start, range.end); + flush_hugetlb_tlb_range(vma, range.sta...
16951789008dc0029b1e073fb1c20c1abb4c6504
Analyze and fix the following issue in the Linux kernel code: mm/compaction: set compact_cached_free_pfn correctly in update_pageblock_skip
Problem Details: Patch series "Fixes and cleanups to compaction", v2. This series contains random fixes and cleanups to free page isolation in compaction. This is based on another compact series[1]. More details can be found in respective patches. This patch (of 4): We will set skip to page block of block_start_p...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index c4d3a3129fd5..6e0c7456026b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1717,7 +1717,8 @@ static void isolate_freepages(struct compact_control *cc) /* Update the skip hint if the full pageblock was scanned */ if (isolate_start_pfn == block_e...
3a1060c2615874bd4d66d72dfdabbc48496ef040
Analyze and fix the following issue in the Linux kernel code: mm/memcg: fix wrong function name above obj_cgroup_charge_zswap()
Problem Details: The correct function name is obj_cgroup_may_zswap(). Correct the comment. Link: https://lkml.kernel.org/r/20230803120021.762279-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Sig...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 56abc4f426f4..da9f983a090e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7777,7 +7777,7 @@ bool obj_cgroup_may_zswap(struct obj_cgroup *objcg) * @objcg: the object cgroup * @size: size of compressed object * - * This forces the charge after obj...
a3235ea2a88b7874204c39ebb20feb712f4dba9d
Analyze and fix the following issue in the Linux kernel code: Multi-gen LRU: fix can_swap in lru_gen_look_around()
Problem Details: walk->can_swap might be invalid since it's not guaranteed to be initialized for the particular lruvec. Instead deduce it from the folio type (anon/file). Link: https://lkml.kernel.org/r/20230802025606.346758-3-kaleshsingh@google.com Fixes: 018ee47f1489 ("mm: multi-gen LRU: exploit locality in rmap") ...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 6eecd291756c..b4329f93a682 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4656,6 +4656,7 @@ void lru_gen_look_around(struct page_vma_mapped_walk *pvmw) pte_t *pte = pvmw->pte; unsigned long addr = pvmw->address; struct folio *folio = pfn_folio(pvmw->pfn); + boo...
bb5e7f234eacf34b65be67ebb3613e3b8cf11b87
Analyze and fix the following issue in the Linux kernel code: Multi-gen LRU: avoid race in inc_min_seq()
Problem Details: inc_max_seq() will try to inc_min_seq() if nr_gens == MAX_NR_GENS. This is because the generations are reused (the last oldest now empty generation will become the next youngest generation). inc_min_seq() is retried until successful, dropping the lru_lock and yielding the CPU on each failure, and reta...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 489a4fc7d9b1..6eecd291756c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4439,7 +4439,7 @@ static void inc_max_seq(struct lruvec *lruvec, bool can_swap, bool force_scan) int prev, next; int type, zone; struct lru_gen_folio *lrugen = &lruvec->lrugen; - +restart...
669281ee7ef731fb5204df9d948669bf32a5e68d
Analyze and fix the following issue in the Linux kernel code: Multi-gen LRU: fix per-zone reclaim
Problem Details: MGLRU has a LRU list for each zone for each type (anon/file) in each generation: long nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES]; The min_seq (oldest generation) can progress independently for each type but the max_seq (youngest generation) is shared for both anon and file. This is to mainta...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 4039620d30fe..489a4fc7d9b1 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4889,7 +4889,8 @@ static int lru_gen_memcg_seg(struct lruvec *lruvec) * the eviction ******************************************************************************/...
0388536ac29104a478c79b3869541524caec28eb
Analyze and fix the following issue in the Linux kernel code: mm:vmscan: fix inaccurate reclaim during proactive reclaim
Problem Details: Before commit f53af4285d77 ("mm: vmscan: fix extreme overreclaim and swap floods"), proactive reclaim will extreme overreclaim sometimes. But proactive reclaim still inaccurate and some extent overreclaim. Problematic case is easy to construct. Allocate lots of anonymous memory (e.g., 20G) in a memc...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 062d925336cb..56abc4f426f4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6686,8 +6686,8 @@ static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf, lru_add_drain_all(); reclaimed = try_to_free_mem_cgroup_pages(memcg, - nr_t...
2a158e956b98e0c5f37b5ce9953048654348ad6b
Analyze and fix the following issue in the Linux kernel code: mm/damon/core-test: add a test for damos_new_filter()
Problem Details: damos_new_filter() was having a bug that not initializing ->list field of the returning damos_filter struct, which results in access to uninitialized memory. Add a unit test for the function. Link: https://lkml.kernel.org/r/20230729203733.38949-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel....
```diff diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index bb07721909e1..4bddbfe243c3 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -341,6 +341,18 @@ static void damon_test_set_attrs(struct kunit *test) KUNIT_EXPECT_EQ(test, damon_set_attrs(c, &invalid_attrs), -EINVAL); } +static void...
ebddd111fcd13fefd7350f77201dfc5605672909
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: avoid unneeded alike_pages calculation
Problem Details: When free_pages is 0, alike_pages is not used. So alike_pages calculation can be avoided by checking free_pages early to save cpu cycles. Also fix typo 'comparable'. It should be 'compatible' here. Link: https://lkml.kernel.org/r/20230801123723.2225543-1-linmiaohe@huawei.com Signed-off-by: Miaohe L...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1eb3864e1dbc..8b17dcbb925d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1833,6 +1833,10 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page, free_pages = move_freepages_block(zone, page, start_type, &movable_pages)...
6e412203eeae68b599fb0a0722961e68f90322df
Analyze and fix the following issue in the Linux kernel code: mm/memory.c: fix some kernel-doc comments
Problem Details: Add description of @mas and @tree_end, remove @mt in unmap_vmas(). to silence the warnings: mm/memory.c:1837: warning: Function parameter or member 'mas' not described in 'unmap_vmas' mm/memory.c:1837: warning: Function parameter or member 'tree_end' not described in 'unmap_vmas' mm/memory.c:1837: wa...
```diff diff --git a/mm/memory.c b/mm/memory.c index f06266464208..1113ee625a94 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1693,10 +1693,11 @@ static void unmap_single_vma(struct mmu_gather *tlb, /** * unmap_vmas - unmap a range of memory covered by a list of vma's * @tlb: address of the caller's struct mmu_ga...
5d241789dfe1c0e5c9b4eb4ae6e48590964b4976
Analyze and fix the following issue in the Linux kernel code: mm/memcg: fix obsolete function name in mem_cgroup_protection()
Problem Details: Commit 45c7f7e1ef17 ("mm, memcg: decouple e{low,min} state mutations from protection checks") changed the function name but not the corresponding comment. Link: https://lkml.kernel.org/r/20230727115934.657787-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Michal Hocko <mho...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 058fb748e128..419e001a02e4 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -582,7 +582,7 @@ static inline void mem_cgroup_protection(struct mem_cgroup *root, /* * There is no reclaim protection applied to...
b68442ebda9c8aca1e1802c169354c8fb31686f1
Analyze and fix the following issue in the Linux kernel code: scsi: ppa: Fix compilation with PPA_DEBUG=1
Problem Details: Fix a regression introduced in February 2003 in Linux 2.5.61 by a patch from Alan Cox titled "fix ppa for new scsi".[1] Link: https://lore.kernel.org/lkml/E18jn1B-0005gQ-00@the-village.bc.nu/ Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Link: https://lore.kernel.org/r/20230807155856.362864-1-al...
```diff diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index 909c49541984..d1f6aa256eba 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -637,7 +637,7 @@ static void ppa_interrupt(struct work_struct *work) case DID_OK: break; case DID_NO_CONNECT: - printk(KERN_DEBUG "ppa: no device at SCSI ID %...
8ae5b3a685dc59a8cf7ccfe0e850999ba9727a3c
Analyze and fix the following issue in the Linux kernel code: nvme-fc: Prevent null pointer dereference in nvme_fc_io_getuuid()
Problem Details: The nvme_fc_fcp_op structure describing an AEN operation is initialized with a null request structure pointer. An FC LLDD may make a call to nvme_fc_io_getuuid passing a pointer to an nvmefc_fcp_req for an AEN operation. Add validation of the request structure pointer before dereference. Signed-off-b...
```diff diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 1cd2bf82319a..a15b37750d6e 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1924,7 +1924,7 @@ char *nvme_fc_io_getuuid(struct nvmefc_fcp_req *req) struct nvme_fc_fcp_op *op = fcp_req_to_fcp_op(req); struct request *rq = o...
6867c7a3320669cbe44b905a3eb35db725c6d470
Analyze and fix the following issue in the Linux kernel code: mm: multi-gen LRU: don't spin during memcg release
Problem Details: When a memcg is in the process of being released mem_cgroup_tryget will fail because its reference count has already reached 0. This can happen during reclaim if the memcg has already been offlined, and we reclaim all remaining pages attributed to the offlined memcg. shrink_many attempts to skip the ...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 3555927df9b5..2fe4a11d63f4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4854,16 +4854,17 @@ void lru_gen_release_memcg(struct mem_cgroup *memcg) spin_lock_irq(&pgdat->memcg_lru.lock); - VM_WARN_ON_ONCE(hlist_nulls_unhashed(&lruvec->lrugen.list)); + if (hli...
e2c1ab070fdc81010ec44634838d24fce9ff9e53
Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: fix unexpected return value in soft_offline_page()
Problem Details: When page_handle_poison() fails to handle the hugepage or free page in retry path, soft_offline_page() will return 0 while -EBUSY is expected in this case. Consequently the user will think soft_offline_page succeeds while it in fact failed. So the user will not try again later in this case. Link: ht...
```diff diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 139b31fdb678..fe121fdb05f7 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2741,10 +2741,13 @@ retry: if (ret > 0) { ret = soft_offline_in_use_page(page); } else if (ret == 0) { - if (!page_handle_poison(page, true, false) && tr...
d59070d1076ec5114edb67c87658aeb1d691d381
Analyze and fix the following issue in the Linux kernel code: radix tree: remove unused variable
Problem Details: Recent versions of clang warn about an unused variable, though older versions saw the 'slot++' as a use and did not warn: radix-tree.c:1136:50: error: parameter 'slot' set but not used [-Werror,-Wunused-but-set-parameter] It's clearly not needed any more, so just remove it. Link: https://lkml.kernel...
```diff diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 1a31065b2036..976b9bd02a1b 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1136,7 +1136,6 @@ static void set_iter_tags(struct radix_tree_iter *iter, void __rcu **radix_tree_iter_resume(void __rcu **slot, struct radix_tree_iter *iter) { - sl...
a50420c79731fc5cf27ad43719c1091e842a2606
Analyze and fix the following issue in the Linux kernel code: mm: add a call to flush_cache_vmap() in vmap_pfn()
Problem Details: flush_cache_vmap() must be called after new vmalloc mappings are installed in the page table in order to allow architectures to make sure the new mapping is visible. It could lead to a panic since on some architectures (like powerpc), the page table walker could see the wrong pte value and trigger a s...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 93cf99aba335..228a4a5312f2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2979,6 +2979,10 @@ void *vmap_pfn(unsigned long *pfns, unsigned int count, pgprot_t prot) free_vm_area(area); return NULL; } + + flush_cache_vmap((unsigned long)area->addr, + (un...
1738b949625c7e17a454b25de33f1f415da3db69
Analyze and fix the following issue in the Linux kernel code: selftests/mm: FOLL_LONGTERM need to be updated to 0x100
Problem Details: After commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h") FOLL_LONGTERM flag value got updated from 0x10000 to 0x100 at include/linux/mm_types.h. As hmm.hmm_device_private.hmm_gup_test uses FOLL_LONGTERM Updating same here as well. Before this change test goes in an infinite as...
```diff diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index 4adaad1b822f..20294553a5dd 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -57,9 +57,14 @@ enum { #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) /* Jus...
f83913f8c5b882a312e72b7669762f8a5c9385e4
Analyze and fix the following issue in the Linux kernel code: nilfs2: fix general protection fault in nilfs_lookup_dirty_data_buffers()
Problem Details: A syzbot stress test reported that create_empty_buffers() called from nilfs_lookup_dirty_data_buffers() can cause a general protection fault. Analysis using its reproducer revealed that the back reference "mapping" from a page/folio has been changed to NULL after dirty page/folio gang lookup in nilfs_...
```diff diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 581691e4be49..7ec16879756e 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -725,6 +725,11 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, struct folio *folio = fbatch.folios[i]; folio_lock(folio); + if (unl...
5805192c7b7257d290474cb1a3897d0567281bbc
Analyze and fix the following issue in the Linux kernel code: mm/gup: handle cont-PTE hugetlb pages correctly in gup_must_unshare() via GUP-fast
Problem Details: In contrast to most other GUP code, GUP-fast common page table walking code like gup_pte_range() also handles hugetlb pages. But in contrast to other hugetlb page table walking code, it does not look at the hugetlb PTE abstraction whereby we have only a single logical hugetlb PTE per hugetlb page, eve...
```diff diff --git a/mm/internal.h b/mm/internal.h index 45383527e8b4..8ed127c1c808 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1004,6 +1004,16 @@ static inline bool gup_must_unshare(struct vm_area_struct *vma, if (IS_ENABLED(CONFIG_HAVE_FAST_GUP)) smp_rmb(); + /* + * During GUP-fast we might not get cal...