Skip to contentSkip to conversation

5.12.17-rc1 review

PATCH In review Greg Kroah-Hartman 9 participants 711 messages Jul 12, 2021 – Jul 13, 2021 Page 5 of 5

Subsystems (8)
lore
Share & tools
lore
author maintainer
#602 lore raw

PATCH 602/700 ASoC: rt715-sdw: use first_hw_init flag on resume

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit dbc07517ab173688ef11234d1099bc1e24e4f14b ]

The intent of the status check on resume was to verify if a SoundWire peripheral reported ATTACHED before waiting for the initialization to complete. This is required to avoid timeouts that will happen with 'ghost' devices that are exposed in the platform firmware but are not populated in hardware.

Unfortunately we used 'hw_init' instead of 'first_hw_init'. Due to another error, the resume operation never timed out, but the volume settings were not properly restored.

---
 sound/soc/codecs/rt715-sdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt715-sdw.c +1 -1
index 71dd3b97a459..157a97acc6c2 100644
@@ -541,7 +541,7 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
 	struct rt715_priv *rt715 = dev_get_drvdata(dev);
 	unsigned long time;
 
-	if (!rt715->hw_init)
+	if (!rt715->first_hw_init)
 		return 0;
 
 	if (!slave->unattach_request)
Signature · 1 line
2.30.2
author maintainer
#603 lore raw

PATCH 603/700 ASoC: rt5682: Fix a problem with error handling in the io init function of the soundwire

In reply to Greg Kroah-Hartman

From: Oder Chiou <[email protected]>

[ Upstream commit 9266d95405ae0c078f188ec8bca3a004631be429 ]

The device checking error should be a jump to pm_runtime_put_autosuspend() as done before returning value.

Fixes 867f8d18df4f ('ASoC: rt5682: fix getting the wrong device id when the suspend_stress_test')
---
 sound/soc/codecs/rt5682-sdw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5682-sdw.c +5 -2
index 6bf1b4c31296..2b0f02e6c977 100644
@@ -408,9 +408,11 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
 		usleep_range(30000, 30005);
 		loop--;
 	}
+
 	if (val != DEVICE_ID) {
 		dev_err(dev, "Device with ID register %x is not rt5682\n", val);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto err_nodev;
 	}
 
 	if (rt5682->first_hw_init) {
@@ -486,10 +488,11 @@ reinit:
 	rt5682->hw_init = true;
 	rt5682->first_hw_init = true;
 
+err_nodev:
 	pm_runtime_mark_last_busy(&slave->dev);
 	pm_runtime_put_autosuspend(&slave->dev);
 
-	dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
+	dev_dbg(&slave->dev, "%s hw_init complete: %d\n", __func__, ret);
 
 	return ret;
 }
Signature · 1 line
2.30.2
author maintainer
#604 lore raw

PATCH 604/700 ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682_DEVICE_ID

In reply to Greg Kroah-Hartman

From: Bard Liao <[email protected]>

[ Upstream commit c0372bc873dd29f325ee908351e0bd5b08d4d608 ]

RT5682_DEVICE_ID is a volatile register, we can not read it in cache only mode.

---
 sound/soc/codecs/rt5682-sdw.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/codecs/rt5682-sdw.c +5 -5
index 2b0f02e6c977..b4649b599eaa 100644
@@ -400,6 +400,11 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
 
 	pm_runtime_get_noresume(&slave->dev);
 
+	if (rt5682->first_hw_init) {
+		regcache_cache_only(rt5682->regmap, false);
+		regcache_cache_bypass(rt5682->regmap, true);
+	}
+
 	while (loop > 0) {
 		regmap_read(rt5682->regmap, RT5682_DEVICE_ID, &val);
 		if (val == DEVICE_ID)
@@ -415,11 +420,6 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
 		goto err_nodev;
 	}
 
-	if (rt5682->first_hw_init) {
-		regcache_cache_only(rt5682->regmap, false);
-		regcache_cache_bypass(rt5682->regmap, true);
-	}
-
 	rt5682_calibrate(rt5682);
 
 	if (rt5682->first_hw_init) {
Signature · 1 line
2.30.2
author maintainer
#605 lore raw

PATCH 605/700 ASoC: mediatek: mtk-btcvsd: Fix an error handling path in mtk_btcvsd_snd_probe()

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit b6052c3c7a78f5e2b9756c92ef77c0b56435f107 ]

If an error occurs after a successful 'of_iomap()' call, it must be undone by a corresponding 'iounmap()' call, as already done in the remove function.

While at it, remove the useless initialization of 'ret' at the beginning of the function.

---
 sound/soc/mediatek/common/mtk-btcvsd.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
sound/soc/mediatek/common/mtk-btcvsd.c +18 -6
index a554c57b6460..6299dee9a6de 100644
@@ -1281,7 +1281,7 @@ static const struct snd_soc_component_driver mtk_btcvsd_snd_platform = {
 
 static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 {
-	int ret = 0;
+	int ret;
 	int irq_id;
 	u32 offset[5] = {0, 0, 0, 0, 0};
 	struct mtk_btcvsd_snd *btcvsd;
@@ -1337,7 +1337,8 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 	btcvsd->bt_sram_bank2_base = of_iomap(dev->of_node, 1);
 	if (!btcvsd->bt_sram_bank2_base) {
 		dev_err(dev, "iomap bt_sram_bank2_base fail\n");
-		return -EIO;
+		ret = -EIO;
+		goto unmap_pkv_err;
 	}
 
 	btcvsd->infra = syscon_regmap_lookup_by_phandle(dev->of_node,
@@ -1345,7 +1346,8 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 	if (IS_ERR(btcvsd->infra)) {
 		dev_err(dev, "cannot find infra controller: %ld\n",
 			PTR_ERR(btcvsd->infra));
-		return PTR_ERR(btcvsd->infra);
+		ret = PTR_ERR(btcvsd->infra);
+		goto unmap_bank2_err;
 	}
 
 	/* get offset */
@@ -1354,7 +1356,7 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 					 ARRAY_SIZE(offset));
 	if (ret) {
 		dev_warn(dev, "%s(), get offset fail, ret %d\n", __func__, ret);
-		return ret;
+		goto unmap_bank2_err;
 	}
 	btcvsd->infra_misc_offset = offset[0];
 	btcvsd->conn_bt_cvsd_mask = offset[1];
@@ -1373,8 +1375,18 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 	mtk_btcvsd_snd_set_state(btcvsd, btcvsd->tx, BT_SCO_STATE_IDLE);
 	mtk_btcvsd_snd_set_state(btcvsd, btcvsd->rx, BT_SCO_STATE_IDLE);
 
-	return devm_snd_soc_register_component(dev, &mtk_btcvsd_snd_platform,
-					       NULL, 0);
+	ret = devm_snd_soc_register_component(dev, &mtk_btcvsd_snd_platform,
+					      NULL, 0);
+	if (ret)
+		goto unmap_bank2_err;
+
+	return 0;
+
+unmap_bank2_err:
+	iounmap(btcvsd->bt_sram_bank2_base);
+unmap_pkv_err:
+	iounmap(btcvsd->bt_pkv_base);
+	return ret;
 }
 
 static int mtk_btcvsd_snd_remove(struct platform_device *pdev)
Signature · 1 line
2.30.2
author maintainer
#606 lore raw

PATCH 606/700 usb: gadget: f_fs: Fix setting of device and driver data cross-references

In reply to Greg Kroah-Hartman

From: Andrew Gabbasov <[email protected]>

[ Upstream commit ecfbd7b9054bddb12cea07fda41bb3a79a7b0149 ]

FunctionFS device structure 'struct ffs_dev' and driver data structure 'struct ffs_data' are bound to each other with cross-reference pointers 'ffs_data->private_data' and 'ffs_dev->ffs_data'. While the first one is supposed to be valid through the whole life of 'struct ffs_data' (and while 'struct ffs_dev' exists non-freed), the second one is cleared in 'ffs_closed()' (called from 'ffs_data_reset()' or the last 'ffs_data_put()'). This can be called several times, alternating in different order with 'ffs_free_inst()', that, if possible, clears the other cross-reference.

As a result, different cases of these calls order may leave stale cross-reference pointers, used when the pointed structure is already freed. Even if it occasionally doesn't cause kernel crash, this error is reported by KASAN-enabled kernel configuration.

For example, the case [last 'ffs_data_put()' - 'ffs_free_inst()'] was fixed by commit cdafb6d8b8da ("usb: gadget: f_fs: Fix use-after-free in ffs_free_inst").

The other case ['ffs_data_reset()' - 'ffs_free_inst()' - 'ffs_data_put()'] now causes KASAN reported error [1], when 'ffs_data_reset()' clears 'ffs_dev->ffs_data', then 'ffs_free_inst()' frees the 'struct ffs_dev', but can't clear 'ffs_data->private_data', which is then accessed in 'ffs_closed()' called from 'ffs_data_put()'. This happens since 'ffs_dev->ffs_data' reference is cleared too early.

Moreover, one more use case, when 'ffs_free_inst()' is called immediately after mounting FunctionFS device (that is before the descriptors are written and 'ffs_ready()' is called), and then 'ffs_data_reset()' or 'ffs_data_put()' is called from accessing "ep0" file or unmounting the device. This causes KASAN error report like [2], since 'ffs_dev->ffs_data' is not yet set when 'ffs_free_inst()' can't properly clear 'ffs_data->private_data', that is later accessed to freed structure.

Fix these (and may be other) cases of stale pointers access by moving setting and clearing of the mentioned cross-references to the single places, setting both of them when 'struct ffs_data' is created and bound to 'struct ffs_dev', and clearing both of them when one of the structures is destroyed. It seems convenient to make this pointer initialization and structures binding in 'ffs_acquire_dev()' and make pointers clearing in 'ffs_release_dev()'. This required some changes in these functions parameters and return types.

Also, 'ffs_release_dev()' calling requires some cleanup, fixing minor issues, like (1) 'ffs_release_dev()' is not called if 'ffs_free_inst()' is called without unmounting the device, and "release_dev" callback is not called at all, or (2) "release_dev" callback is called before "ffs_closed" callback on unmounting, which seems to be not correctly nested with "acquire_dev" and "ffs_ready" callbacks.
Make this cleanup togther with other mentioned 'ffs_release_dev()' changes.

[1]
==================================================================

root@rcar-gen3:~# mkdir /dev/cfs
root@rcar-gen3:~# mkdir /dev/ffs
root@rcar-gen3:~# modprobe libcomposite
root@rcar-gen3:~# mount -t configfs none /dev/cfs
root@rcar-gen3:~# mkdir /dev/cfs/usb_gadget/g1
root@rcar-gen3:~# mkdir /dev/cfs/usb_gadget/g1/functions/ffs.ffs
[   64.340664] file system registered
root@rcar-gen3:~# mount -t functionfs ffs /dev/ffs
root@rcar-gen3:~# cd /dev/ffs
root@rcar-gen3:/dev/ffs# /home/root/ffs-test
ffs-test: info: ep0: writing descriptors (in v2 format)
[   83.181442] read descriptors
[   83.186085] read strings
ffs-test: info: ep0: writing strings
ffs-test: dbg:  ep1: starting
ffs-test: dbg:  ep2: starting
ffs-test: info: ep1: starts
ffs-test: info: ep2: starts
ffs-test: info: ep0: starts

^C

root@rcar-gen3:/dev/ffs# cd /home/root/
root@rcar-gen3:~# rmdir /dev/cfs/usb_gadget/g1/functions/ffs.ffs
[   98.935061] unloading
root@rcar-gen3:~# umount /dev/ffs
[  102.734301] ==================================================================
[  102.742059] BUG: KASAN: use-after-free in ffs_release_dev+0x64/0xa8 [usb_f_fs]
[  102.749683] Write of size 1 at addr ffff0004d46ff549 by task umount/2997
[  102.756709]
[  102.758311] CPU: 0 PID: 2997 Comm: umount Not tainted 5.13.0-rc4+ #8
[  102.764971] Hardware name: Renesas Salvator-X board based on r8a77951 (DT)
[  102.772179] Call trace:
[  102.774779]  dump_backtrace+0x0/0x330
[  102.778653]  show_stack+0x20/0x2c
[  102.782152]  dump_stack+0x11c/0x1ac
[  102.785833]  print_address_description.constprop.0+0x30/0x274
[  102.791862]  kasan_report+0x14c/0x1c8
[  102.795719]  __asan_report_store1_noabort+0x34/0x58
[  102.800840]  ffs_release_dev+0x64/0xa8 [usb_f_fs]
[  102.805801]  ffs_fs_kill_sb+0x50/0x84 [usb_f_fs]
[  102.810663]  deactivate_locked_super+0xa0/0xf0
[  102.815339]  deactivate_super+0x98/0xac
[  102.819378]  cleanup_mnt+0xd0/0x1b0
[  102.823057]  __cleanup_mnt+0x1c/0x28
[  102.826823]  task_work_run+0x104/0x180
[  102.830774]  do_notify_resume+0x458/0x14e0
[  102.835083]  work_pending+0xc/0x5f8
[  102.838762]
[  102.840357] Allocated by task 2988:
[  102.844032]  kasan_save_stack+0x28/0x58
[  102.848071]  kasan_set_track+0x28/0x3c
[  102.852016]  ____kasan_kmalloc+0x84/0x9c
[  102.856142]  __kasan_kmalloc+0x10/0x1c
[  102.860088]  __kmalloc+0x214/0x2f8
[  102.863678]  kzalloc.constprop.0+0x14/0x20 [usb_f_fs]
[  102.868990]  ffs_alloc_inst+0x8c/0x208 [usb_f_fs]
[  102.873942]  try_get_usb_function_instance+0xf0/0x164 [libcomposite]
[  102.880629]  usb_get_function_instance+0x64/0x68 [libcomposite]
[  102.886858]  function_make+0x128/0x1ec [libcomposite]
[  102.892185]  configfs_mkdir+0x330/0x590 [configfs]
[  102.897245]  vfs_mkdir+0x12c/0x1bc
[  102.900835]  do_mkdirat+0x180/0x1d0
[  102.904513]  __arm64_sys_mkdirat+0x80/0x94
[  102.908822]  invoke_syscall+0xf8/0x25c
[  102.912772]  el0_svc_common.constprop.0+0x150/0x1a0
[  102.917891]  do_el0_svc+0xa0/0xd4
[  102.921386]  el0_svc+0x24/0x34
[  102.924613]  el0_sync_handler+0xcc/0x154
[  102.928743]  el0_sync+0x198/0x1c0
[  102.932238]
[  102.933832] Freed by task 2996:
[  102.937144]  kasan_save_stack+0x28/0x58
[  102.941181]  kasan_set_track+0x28/0x3c
[  102.945128]  kasan_set_free_info+0x28/0x4c
[  102.949435]  ____kasan_slab_free+0x104/0x118
[  102.953921]  __kasan_slab_free+0x18/0x24
[  102.958047]  slab_free_freelist_hook+0x148/0x1f0
[  102.962897]  kfree+0x318/0x440
[  102.966123]  ffs_free_inst+0x164/0x2d8 [usb_f_fs]
[  102.971075]  usb_put_function_instance+0x84/0xa4 [libcomposite]
[  102.977302]  ffs_attr_release+0x18/0x24 [usb_f_fs]
[  102.982344]  config_item_put+0x140/0x1a4 [configfs]
[  102.987486]  configfs_rmdir+0x3fc/0x518 [configfs]
[  102.992535]  vfs_rmdir+0x114/0x234
[  102.996122]  do_rmdir+0x274/0x2b0
[  102.999617]  __arm64_sys_unlinkat+0x94/0xc8
[  103.004015]  invoke_syscall+0xf8/0x25c
[  103.007961]  el0_svc_common.constprop.0+0x150/0x1a0
[  103.013080]  do_el0_svc+0xa0/0xd4
[  103.016575]  el0_svc+0x24/0x34
[  103.019801]  el0_sync_handler+0xcc/0x154
[  103.023930]  el0_sync+0x198/0x1c0
[  103.027426]
[  103.029020] The buggy address belongs to the object at ffff0004d46ff500
[  103.029020]  which belongs to the cache kmalloc-128 of size 128
[  103.042079] The buggy address is located 73 bytes inside of
[  103.042079]  128-byte region [ffff0004d46ff500, ffff0004d46ff580)
[  103.054236] The buggy address belongs to the page:
[  103.059262] page:0000000021aa849b refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0004d46fee00 pfn:0x5146fe
[  103.070437] head:0000000021aa849b order:1 compound_mapcount:0
[  103.076456] flags: 0x8000000000010200(slab|head|zone=2)
[  103.081948] raw: 8000000000010200 fffffc0013521a80 0000000d0000000d ffff0004c0002300
[  103.090052] raw: ffff0004d46fee00 000000008020001e 00000001ffffffff 0000000000000000
[  103.098150] page dumped because: kasan: bad access detected
[  103.103985]
[  103.105578] Memory state around the buggy address:
[  103.110602]  ffff0004d46ff400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  103.118161]  ffff0004d46ff480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  103.125726] >ffff0004d46ff500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  103.133284]                                               ^
[  103.139120]  ffff0004d46ff580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  103.146679]  ffff0004d46ff600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  103.154238] ==================================================================
[  103.161792] Disabling lock debugging due to kernel taint
[  103.167319] Unable to handle kernel paging request at virtual address 0037801d6000018e
[  103.175406] Mem abort info:
[  103.178457]   ESR = 0x96000004
[  103.181609]   EC = 0x25: DABT (current EL), IL = 32 bits
[  103.187020]   SET = 0, FnV = 0
[  103.190185]   EA = 0, S1PTW = 0
[  103.193417] Data abort info:
[  103.196385]   ISV = 0, ISS = 0x00000004
[  103.200315]   CM = 0, WnR = 0
[  103.203366] [0037801d6000018e] address between user and kernel address ranges
[  103.210611] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[  103.216231] Modules linked in: usb_f_fs libcomposite configfs ath9k_htc led_class mac80211 libarc4 ath9k_common ath9k_hw ath cfg80211 aes_ce_blk sata_rc4
[  103.259233] CPU: 0 PID: 2997 Comm: umount Tainted: G    B             5.13.0-rc4+ #8
[  103.267031] Hardware name: Renesas Salvator-X board based on r8a77951 (DT)
[  103.273951] pstate: 00000005 (nzcv daif -PAN -UAO -TCO BTYPE=--)
[  103.280001] pc : ffs_data_clear+0x138/0x370 [usb_f_fs]
[  103.285197] lr : ffs_data_clear+0x124/0x370 [usb_f_fs]
[  103.290385] sp : ffff800014777a80
[  103.293725] x29: ffff800014777a80 x28: ffff0004d7649c80 x27: 0000000000000000
[  103.300931] x26: ffff800014777fb0 x25: ffff60009aec9394 x24: ffff0004d7649ca4
[  103.308136] x23: 1fffe0009a3d063a x22: dfff800000000000 x21: ffff0004d1e831d0
[  103.315340] x20: e1c000eb00000bb4 x19: ffff0004d1e83000 x18: 0000000000000000
[  103.322545] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  103.329748] x14: 0720072007200720 x13: 0720072007200720 x12: 1ffff000012ef658
[  103.336952] x11: ffff7000012ef658 x10: 0720072007200720 x9 : ffff800011322648
[  103.344157] x8 : ffff800014777818 x7 : ffff80000977b2c7 x6 : 0000000000000000
[  103.351359] x5 : 0000000000000001 x4 : ffff7000012ef659 x3 : 0000000000000001
[  103.358562] x2 : 0000000000000000 x1 : 1c38001d6000018e x0 : e1c000eb00000c70
[  103.365766] Call trace:
[  103.368235]  ffs_data_clear+0x138/0x370 [usb_f_fs]
[  103.373076]  ffs_data_reset+0x20/0x304 [usb_f_fs]
[  103.377829]  ffs_data_closed+0x1ec/0x244 [usb_f_fs]
[  103.382755]  ffs_fs_kill_sb+0x70/0x84 [usb_f_fs]
[  103.387420]  deactivate_locked_super+0xa0/0xf0
[  103.391905]  deactivate_super+0x98/0xac
[  103.395776]  cleanup_mnt+0xd0/0x1b0
[  103.399299]  __cleanup_mnt+0x1c/0x28
[  103.402906]  task_work_run+0x104/0x180
[  103.406691]  do_notify_resume+0x458/0x14e0
[  103.410823]  work_pending+0xc/0x5f8
[  103.414351] Code: b4000a54 9102f280 12000802 d343fc01 (38f66821)
[  103.420490] ---[ end trace 57b43a50e8244f57 ]---
Segmentation fault
root@rcar-gen3:~#
==================================================================

[2]
==================================================================

root@rcar-gen3:~# mkdir /dev/ffs
root@rcar-gen3:~# modprobe libcomposite
root@rcar-gen3:~#
root@rcar-gen3:~# mount -t configfs none /dev/cfs
root@rcar-gen3:~# mkdir /dev/cfs/usb_gadget/g1
root@rcar-gen3:~# mkdir /dev/cfs/usb_gadget/g1/functions/ffs.ffs
[   54.766480] file system registered
root@rcar-gen3:~# mount -t functionfs ffs /dev/ffs
root@rcar-gen3:~# rmdir /dev/cfs/usb_gadget/g1/functions/ffs.ffs
[   63.197597] unloading
root@rcar-gen3:~# cat /dev/ffs/ep0
cat: read error:[   67.213506] ==================================================================
[   67.222095] BUG: KASAN: use-after-free in ffs_data_clear+0x70/0x370 [usb_f_fs]
[   67.229699] Write of size 1 at addr ffff0004c26e974a by task cat/2994
[   67.236446]
[   67.238045] CPU: 0 PID: 2994 Comm: cat Not tainted 5.13.0-rc4+ #8
[   67.244431] Hardware name: Renesas Salvator-X board based on r8a77951 (DT)
[   67.251624] Call trace:
[   67.254212]  dump_backtrace+0x0/0x330
[   67.258081]  show_stack+0x20/0x2c
[   67.261579]  dump_stack+0x11c/0x1ac
[   67.265260]  print_address_description.constprop.0+0x30/0x274
[   67.271286]  kasan_report+0x14c/0x1c8
[   67.275143]  __asan_report_store1_noabort+0x34/0x58
[   67.280265]  ffs_data_clear+0x70/0x370 [usb_f_fs]
[   67.285220]  ffs_data_reset+0x20/0x304 [usb_f_fs]
[   67.290172]  ffs_data_closed+0x240/0x244 [usb_f_fs]
[   67.295305]  ffs_ep0_release+0x40/0x54 [usb_f_fs]
[   67.300256]  __fput+0x304/0x580
[   67.303576]  ____fput+0x18/0x24
[   67.306893]  task_work_run+0x104/0x180
[   67.310846]  do_notify_resume+0x458/0x14e0
[   67.315154]  work_pending+0xc/0x5f8
[   67.318834]
[   67.320429] Allocated by task 2988:
[   67.324105]  kasan_save_stack+0x28/0x58
[   67.328144]  kasan_set_track+0x28/0x3c
[   67.332090]  ____kasan_kmalloc+0x84/0x9c
[   67.336217]  __kasan_kmalloc+0x10/0x1c
[   67.340163]  __kmalloc+0x214/0x2f8
[   67.343754]  kzalloc.constprop.0+0x14/0x20 [usb_f_fs]
[   67.349066]  ffs_alloc_inst+0x8c/0x208 [usb_f_fs]
[   67.354017]  try_get_usb_function_instance+0xf0/0x164 [libcomposite]
[   67.360705]  usb_get_function_instance+0x64/0x68 [libcomposite]
[   67.366934]  function_make+0x128/0x1ec [libcomposite]
[   67.372260]  configfs_mkdir+0x330/0x590 [configfs]
[   67.377320]  vfs_mkdir+0x12c/0x1bc
[   67.380911]  do_mkdirat+0x180/0x1d0
[   67.384589]  __arm64_sys_mkdirat+0x80/0x94
[   67.388899]  invoke_syscall+0xf8/0x25c
[   67.392850]  el0_svc_common.constprop.0+0x150/0x1a0
[   67.397969]  do_el0_svc+0xa0/0xd4
[   67.401464]  el0_svc+0x24/0x34
[   67.404691]  el0_sync_handler+0xcc/0x154
[   67.408819]  el0_sync+0x198/0x1c0
[   67.412315]
[   67.413909] Freed by task 2993:
[   67.417220]  kasan_save_stack+0x28/0x58
[   67.421257]  kasan_set_track+0x28/0x3c
[   67.425204]  kasan_set_free_info+0x28/0x4c
[   67.429513]  ____kasan_slab_free+0x104/0x118
[   67.434001]  __kasan_slab_free+0x18/0x24
[   67.438128]  slab_free_freelist_hook+0x148/0x1f0
[   67.442978]  kfree+0x318/0x440
[   67.446205]  ffs_free_inst+0x164/0x2d8 [usb_f_fs]
[   67.451156]  usb_put_function_instance+0x84/0xa4 [libcomposite]
[   67.457385]  ffs_attr_release+0x18/0x24 [usb_f_fs]
[   67.462428]  config_item_put+0x140/0x1a4 [configfs]
[   67.467570]  configfs_rmdir+0x3fc/0x518 [configfs]
[   67.472626]  vfs_rmdir+0x114/0x234
[   67.476215]  do_rmdir+0x274/0x2b0
[   67.479710]  __arm64_sys_unlinkat+0x94/0xc8
[   67.484108]  invoke_syscall+0xf8/0x25c
[   67.488055]  el0_svc_common.constprop.0+0x150/0x1a0
[   67.493175]  do_el0_svc+0xa0/0xd4
[   67.496671]  el0_svc+0x24/0x34
[   67.499896]  el0_sync_handler+0xcc/0x154
[   67.504024]  el0_sync+0x198/0x1c0
[   67.507520]
[   67.509114] The buggy address belongs to the object at ffff0004c26e9700
[   67.509114]  which belongs to the cache kmalloc-128 of size 128
[   67.522171] The buggy address is located 74 bytes inside of
[   67.522171]  128-byte region [ffff0004c26e9700, ffff0004c26e9780)
[   67.534328] The buggy address belongs to the page:
[   67.539355] page:000000003177a217 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5026e8
[   67.549175] head:000000003177a217 order:1 compound_mapcount:0
[   67.555195] flags: 0x8000000000010200(slab|head|zone=2)
[   67.560687] raw: 8000000000010200 fffffc0013037100 0000000c00000002 ffff0004c0002300
[   67.568791] raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
[   67.576890] page dumped because: kasan: bad access detected
[   67.582725]
[   67.584318] Memory state around the buggy address:
[   67.589343]  ffff0004c26e9600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   67.596903]  ffff0004c26e9680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   67.604463] >ffff0004c26e9700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   67.612022]                                               ^
[   67.617860]  ffff0004c26e9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   67.625421]  ffff0004c26e9800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   67.632981] ==================================================================
[   67.640535] Disabling lock debugging due to kernel taint
 File descriptor[   67.646100] Unable to handle kernel paging request at virtual address fabb801d4000018d
 in bad state
[   67.655456] Mem abort info:
[   67.659619]   ESR = 0x96000004
[   67.662801]   EC = 0x25: DABT (current EL), IL = 32 bits
[   67.668225]   SET = 0, FnV = 0
[   67.671375]   EA = 0, S1PTW = 0
[   67.674613] Data abort info:
[   67.677587]   ISV = 0, ISS = 0x00000004
[   67.681522]   CM = 0, WnR = 0
[   67.684588] [fabb801d4000018d] address between user and kernel address ranges
[   67.691849] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   67.697470] Modules linked in: usb_f_fs libcomposite configfs ath9k_htc led_class mac80211 libarc4 ath9k_common ath9k_hw ath cfg80211 aes_ce_blk crypto_simd cryptd aes_ce_cipher ghash_ce gf128mul sha2_ce sha1_ce evdev sata_rcar libata xhci_plat_hcd scsi_mod xhci_hcd rene4
[   67.740467] CPU: 0 PID: 2994 Comm: cat Tainted: G    B             5.13.0-rc4+ #8
[   67.748005] Hardware name: Renesas Salvator-X board based on r8a77951 (DT)
[   67.754924] pstate: 00000005 (nzcv daif -PAN -UAO -TCO BTYPE=--)
[   67.760974] pc : ffs_data_clear+0x138/0x370 [usb_f_fs]
[   67.766178] lr : ffs_data_clear+0x124/0x370 [usb_f_fs]
[   67.771365] sp : ffff800014767ad0
[   67.774706] x29: ffff800014767ad0 x28: ffff800009cf91c0 x27: ffff0004c54861a0
[   67.781913] x26: ffff0004dc90b288 x25: 1fffe00099ec10f5 x24: 00000000000a801d
[   67.789118] x23: 1fffe00099f6953a x22: dfff800000000000 x21: ffff0004cfb4a9d0
[   67.796322] x20: d5e000ea00000bb1 x19: ffff0004cfb4a800 x18: 0000000000000000
[   67.803526] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   67.810730] x14: 0720072007200720 x13: 0720072007200720 x12: 1ffff000028ecefa
[   67.817934] x11: ffff7000028ecefa x10: 0720072007200720 x9 : ffff80001132c014
[   67.825137] x8 : ffff8000147677d8 x7 : ffff8000147677d7 x6 : 0000000000000000
[   67.832341] x5 : 0000000000000001 x4 : ffff7000028ecefb x3 : 0000000000000001
[   67.839544] x2 : 0000000000000005 x1 : 1abc001d4000018d x0 : d5e000ea00000c6d
[   67.846748] Call trace:
[   67.849218]  ffs_data_clear+0x138/0x370 [usb_f_fs]
[   67.854058]  ffs_data_reset+0x20/0x304 [usb_f_fs]
[   67.858810]  ffs_data_closed+0x240/0x244 [usb_f_fs]
[   67.863736]  ffs_ep0_release+0x40/0x54 [usb_f_fs]
[   67.868488]  __fput+0x304/0x580
[   67.871665]  ____fput+0x18/0x24
[   67.874837]  task_work_run+0x104/0x180
[   67.878622]  do_notify_resume+0x458/0x14e0
[   67.882754]  work_pending+0xc/0x5f8
[   67.886282] Code: b4000a54 9102f280 12000802 d343fc01 (38f66821)
[   67.892422] ---[ end trace 6d7cedf53d7abbea ]---
Segmentation fault
root@rcar-gen3:~#
==================================================================
Fixes 4b187fceec3c ("usb: gadget: FunctionFS: add devices management code")
Fixes 3262ad824307 ("usb: gadget: f_fs: Stop ffs_closed NULL pointer dereference")
Fixes cdafb6d8b8da ("usb: gadget: f_fs: Fix use-after-free in ffs_free_inst")
---
 drivers/usb/gadget/function/f_fs.c | 65 +++++++++++++++---------------
 1 file changed, 32 insertions(+), 33 deletions(-)
drivers/usb/gadget/function/f_fs.c +32 -33
index f29abc7867d5..366509e89b98 100644
@@ -250,8 +250,8 @@ EXPORT_SYMBOL_GPL(ffs_lock);
 static struct ffs_dev *_ffs_find_dev(const char *name);
 static struct ffs_dev *_ffs_alloc_dev(void);
 static void _ffs_free_dev(struct ffs_dev *dev);
-static void *ffs_acquire_dev(const char *dev_name);
-static void ffs_release_dev(struct ffs_data *ffs_data);
+static int ffs_acquire_dev(const char *dev_name, struct ffs_data *ffs_data);
+static void ffs_release_dev(struct ffs_dev *ffs_dev);
 static int ffs_ready(struct ffs_data *ffs);
 static void ffs_closed(struct ffs_data *ffs);
 
@@ -1554,8 +1554,8 @@ unmapped_value:
 static int ffs_fs_get_tree(struct fs_context *fc)
 {
 	struct ffs_sb_fill_data *ctx = fc->fs_private;
-	void *ffs_dev;
 	struct ffs_data	*ffs;
+	int ret;
 
 	ENTER();
 
@@ -1574,13 +1574,12 @@ static int ffs_fs_get_tree(struct fs_context *fc)
 		return -ENOMEM;
 	}
 
-	ffs_dev = ffs_acquire_dev(ffs->dev_name);
-	if (IS_ERR(ffs_dev)) {
+	ret = ffs_acquire_dev(ffs->dev_name, ffs);
+	if (ret) {
 		ffs_data_put(ffs);
-		return PTR_ERR(ffs_dev);
+		return ret;
 	}
 
-	ffs->private_data = ffs_dev;
 	ctx->ffs_data = ffs;
 	return get_tree_nodev(fc, ffs_sb_fill);
 }
@@ -1591,7 +1590,6 @@ static void ffs_fs_free_fc(struct fs_context *fc)
 
 	if (ctx) {
 		if (ctx->ffs_data) {
-			ffs_release_dev(ctx->ffs_data);
 			ffs_data_put(ctx->ffs_data);
 		}
 
@@ -1630,10 +1628,8 @@ ffs_fs_kill_sb(struct super_block *sb)
 	ENTER();
 
 	kill_litter_super(sb);
-	if (sb->s_fs_info) {
-		ffs_release_dev(sb->s_fs_info);
+	if (sb->s_fs_info)
 		ffs_data_closed(sb->s_fs_info);
-	}
 }
 
 static struct file_system_type ffs_fs_type = {
@@ -1703,6 +1699,7 @@ static void ffs_data_put(struct ffs_data *ffs)
 	if (refcount_dec_and_test(&ffs->ref)) {
 		pr_info("%s(): freeing\n", __func__);
 		ffs_data_clear(ffs);
+		ffs_release_dev(ffs->private_data);
 		BUG_ON(waitqueue_active(&ffs->ev.waitq) ||
 		       swait_active(&ffs->ep0req_completion.wait) ||
 		       waitqueue_active(&ffs->wait));
@@ -3032,6 +3029,7 @@ static inline struct f_fs_opts *ffs_do_functionfs_bind(struct usb_function *f,
 	struct ffs_function *func = ffs_func_from_usb(f);
 	struct f_fs_opts *ffs_opts =
 		container_of(f->fi, struct f_fs_opts, func_inst);
+	struct ffs_data *ffs_data;
 	int ret;
 
 	ENTER();
@@ -3046,12 +3044,13 @@ static inline struct f_fs_opts *ffs_do_functionfs_bind(struct usb_function *f,
 	if (!ffs_opts->no_configfs)
 		ffs_dev_lock();
 	ret = ffs_opts->dev->desc_ready ? 0 : -ENODEV;
-	func->ffs = ffs_opts->dev->ffs_data;
+	ffs_data = ffs_opts->dev->ffs_data;
 	if (!ffs_opts->no_configfs)
 		ffs_dev_unlock();
 	if (ret)
 		return ERR_PTR(ret);
 
+	func->ffs = ffs_data;
 	func->conf = c;
 	func->gadget = c->cdev->gadget;
 
@@ -3506,6 +3505,7 @@ static void ffs_free_inst(struct usb_function_instance *f)
 	struct f_fs_opts *opts;
 
 	opts = to_f_fs_opts(f);
+	ffs_release_dev(opts->dev);
 	ffs_dev_lock();
 	_ffs_free_dev(opts->dev);
 	ffs_dev_unlock();
@@ -3693,47 +3693,48 @@ static void _ffs_free_dev(struct ffs_dev *dev)
 {
 	list_del(&dev->entry);
 
-	/* Clear the private_data pointer to stop incorrect dev access */
-	if (dev->ffs_data)
-		dev->ffs_data->private_data = NULL;
-
 	kfree(dev);
 	if (list_empty(&ffs_devices))
 		functionfs_cleanup();
 }
 
-static void *ffs_acquire_dev(const char *dev_name)
+static int ffs_acquire_dev(const char *dev_name, struct ffs_data *ffs_data)
 {
+	int ret = 0;
 	struct ffs_dev *ffs_dev;
 
 	ENTER();
 	ffs_dev_lock();
 
 	ffs_dev = _ffs_find_dev(dev_name);
-	if (!ffs_dev)
-		ffs_dev = ERR_PTR(-ENOENT);
-	else if (ffs_dev->mounted)
-		ffs_dev = ERR_PTR(-EBUSY);
-	else if (ffs_dev->ffs_acquire_dev_callback &&
-	    ffs_dev->ffs_acquire_dev_callback(ffs_dev))
-		ffs_dev = ERR_PTR(-ENOENT);
-	else
+	if (!ffs_dev) {
+		ret = -ENOENT;
+	} else if (ffs_dev->mounted) {
+		ret = -EBUSY;
+	} else if (ffs_dev->ffs_acquire_dev_callback &&
+		   ffs_dev->ffs_acquire_dev_callback(ffs_dev)) {
+		ret = -ENOENT;
+	} else {
 		ffs_dev->mounted = true;
+		ffs_dev->ffs_data = ffs_data;
+		ffs_data->private_data = ffs_dev;
+	}
 
 	ffs_dev_unlock();
-	return ffs_dev;
+	return ret;
 }
 
-static void ffs_release_dev(struct ffs_data *ffs_data)
+static void ffs_release_dev(struct ffs_dev *ffs_dev)
 {
-	struct ffs_dev *ffs_dev;
-
 	ENTER();
 	ffs_dev_lock();
 
-	ffs_dev = ffs_data->private_data;
-	if (ffs_dev) {
+	if (ffs_dev && ffs_dev->mounted) {
 		ffs_dev->mounted = false;
+		if (ffs_dev->ffs_data) {
+			ffs_dev->ffs_data->private_data = NULL;
+			ffs_dev->ffs_data = NULL;
+		}
 
 		if (ffs_dev->ffs_release_dev_callback)
 			ffs_dev->ffs_release_dev_callback(ffs_dev);
@@ -3761,7 +3762,6 @@ static int ffs_ready(struct ffs_data *ffs)
 	}
 
 	ffs_obj->desc_ready = true;
-	ffs_obj->ffs_data = ffs;
 
 	if (ffs_obj->ffs_ready_callback) {
 		ret = ffs_obj->ffs_ready_callback(ffs);
@@ -3789,7 +3789,6 @@ static void ffs_closed(struct ffs_data *ffs)
 		goto done;
 
 	ffs_obj->desc_ready = false;
-	ffs_obj->ffs_data = NULL;
 
 	if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) &&
 	    ffs_obj->ffs_closed_callback)
Signature · 1 line
2.30.2
author maintainer
#607 lore raw

PATCH 607/700 usb: dwc2: Dont reset the core after setting turnaround time

In reply to Greg Kroah-Hartman

From: Clément Lassieur <[email protected]>

[ Upstream commit aafe93516b8567ab5864e1f4cd3eeabc54fb0e5a ]

Every time the hub signals a reset while we (device) are hsotg->connected, dwc2_hsotg_core_init_disconnected() is called, which in turn calls dwc2_hs_phy_init().

GUSBCFG.USBTrdTim is cleared upon Core Soft Reset, so if hsotg->params.phy_utmi_width is 8-bit, the value of GUSBCFG.USBTrdTim (the default one: 0x5, corresponding to 16-bit) is always different from hsotg->params.phy_utmi_width, thus dwc2_core_reset() is called every time (usbcfg != usbcfg_old), which causes 2 issues:

1) The call to dwc2_core_reset() does another reset 300us after the initial Chirp K of the first reset (which should last at least Tuch = 1ms), and messes up the High-speed Detection Handshake: both hub and device drive current into the D+ and D- lines at the same time.

2) GUSBCFG.USBTrdTim is cleared by the second reset, so its value is always the default one (0x5).

Setting GUSBCFG.USBTrdTim after the potential call to dwc2_core_reset() fixes both issues. It is now set even when select_phy is false because the cost of the Core Soft Reset is removed.

Fixes 1e868545f2bb ("usb: dwc2: gadget: Move gadget phy init into core phy init")
---
 drivers/usb/dwc2/core.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)
drivers/usb/dwc2/core.c +21 -9
index fec17a2d2447..15911ac7582b 100644
@@ -1167,15 +1167,6 @@ static int dwc2_hs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy)
 		usbcfg &= ~(GUSBCFG_ULPI_UTMI_SEL | GUSBCFG_PHYIF16);
 		if (hsotg->params.phy_utmi_width == 16)
 			usbcfg |= GUSBCFG_PHYIF16;
-
-		/* Set turnaround time */
-		if (dwc2_is_device_mode(hsotg)) {
-			usbcfg &= ~GUSBCFG_USBTRDTIM_MASK;
-			if (hsotg->params.phy_utmi_width == 16)
-				usbcfg |= 5 << GUSBCFG_USBTRDTIM_SHIFT;
-			else
-				usbcfg |= 9 << GUSBCFG_USBTRDTIM_SHIFT;
-		}
 		break;
 	default:
 		dev_err(hsotg->dev, "FS PHY selected at HS!\n");
@@ -1197,6 +1188,24 @@ static int dwc2_hs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy)
 	return retval;
 }
 
+static void dwc2_set_turnaround_time(struct dwc2_hsotg *hsotg)
+{
+	u32 usbcfg;
+
+	if (hsotg->params.phy_type != DWC2_PHY_TYPE_PARAM_UTMI)
+		return;
+
+	usbcfg = dwc2_readl(hsotg, GUSBCFG);
+
+	usbcfg &= ~GUSBCFG_USBTRDTIM_MASK;
+	if (hsotg->params.phy_utmi_width == 16)
+		usbcfg |= 5 << GUSBCFG_USBTRDTIM_SHIFT;
+	else
+		usbcfg |= 9 << GUSBCFG_USBTRDTIM_SHIFT;
+
+	dwc2_writel(hsotg, usbcfg, GUSBCFG);
+}
+
 int dwc2_phy_init(struct dwc2_hsotg *hsotg, bool select_phy)
 {
 	u32 usbcfg;
@@ -1214,6 +1223,9 @@ int dwc2_phy_init(struct dwc2_hsotg *hsotg, bool select_phy)
 		retval = dwc2_hs_phy_init(hsotg, select_phy);
 		if (retval)
 			return retval;
+
+		if (dwc2_is_device_mode(hsotg))
+			dwc2_set_turnaround_time(hsotg);
 	}
 
 	if (hsotg->hw_params.hs_phy_type == GHWCFG2_HS_PHY_TYPE_ULPI &&
Signature · 1 line
2.30.2
author maintainer
#608 lore raw

PATCH 608/700 eeprom: idt_89hpesx: Put fwnode in matching case during ->probe()

In reply to Greg Kroah-Hartman

From: Andy Shevchenko <[email protected]>

[ Upstream commit 3f6ee1c095156a74ab2df605af13020f1ce3e600 ]

device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.

Fixes db15d73e5f0e ("eeprom: idt_89hpesx: Support both ACPI and OF probing")
Cc Huy Duong <[email protected]>
---
 drivers/misc/eeprom/idt_89hpesx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/eeprom/idt_89hpesx.c +1 -0
index 81c70e5bc168..45a61a1f9e98 100644
@@ -1161,6 +1161,7 @@ static void idt_get_fw_data(struct idt_89hpesx_dev *pdev)
 	else /* if (!fwnode_property_read_bool(node, "read-only")) */
 		pdev->eero = false;
 
+	fwnode_handle_put(fwnode);
 	dev_info(dev, "EEPROM of %d bytes found by 0x%x",
 		pdev->eesize, pdev->eeaddr);
 }
Signature · 1 line
2.30.2
author maintainer
#609 lore raw

PATCH 609/700 eeprom: idt_89hpesx: Restore printing the unsupported fwnode name

In reply to Greg Kroah-Hartman

From: Andy Shevchenko <[email protected]>

[ Upstream commit e0db3deea73ba418bf5dc21f5a4e32ca87d16dde ]

When iterating over child firmware nodes restore printing the name of ones that are not supported.

While at it, refactor loop body to clearly show that we stop at the first match.

Fixes db15d73e5f0e ("eeprom: idt_89hpesx: Support both ACPI and OF probing")
Cc Huy Duong <[email protected]>
---
 drivers/misc/eeprom/idt_89hpesx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/misc/eeprom/idt_89hpesx.c +3 -4
index 45a61a1f9e98..3e4a594c110b 100644
@@ -1126,11 +1126,10 @@ static void idt_get_fw_data(struct idt_89hpesx_dev *pdev)
 
 	device_for_each_child_node(dev, fwnode) {
 		ee_id = idt_ee_match_id(fwnode);
-		if (!ee_id) {
-			dev_warn(dev, "Skip unsupported EEPROM device");
-			continue;
-		} else
+		if (ee_id)
 			break;
+
+		dev_warn(dev, "Skip unsupported EEPROM device %pfw\n", fwnode);
 	}
 
 	/* If there is no fwnode EEPROM device, then set zero size */
Signature · 1 line
2.30.2
author maintainer
#610 lore raw

PATCH 610/700 thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default()

In reply to Greg Kroah-Hartman

From: Mika Westerberg <[email protected]>

[ Upstream commit a0d36fa1065901f939b04587a09c65303a64ac88 ]

We should not dereference ->dual_link_port if it is NULL and lane bonding is requested. For this reason move lane bonding configuration happen inside the block where ->dual_link_port != NULL.

Fixes 54509f5005ca ("thunderbolt: Add KUnit tests for path walking")
---
 drivers/thunderbolt/test.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/thunderbolt/test.c +7 -7
index 464c2d37b992..e254f8c37cb7 100644
@@ -259,14 +259,14 @@ static struct tb_switch *alloc_dev_default(struct kunit *test,
 	if (port->dual_link_port && upstream_port->dual_link_port) {
 		port->dual_link_port->remote = upstream_port->dual_link_port;
 		upstream_port->dual_link_port->remote = port->dual_link_port;
-	}
 
-	if (bonded) {
-		/* Bonding is used */
-		port->bonded = true;
-		port->dual_link_port->bonded = true;
-		upstream_port->bonded = true;
-		upstream_port->dual_link_port->bonded = true;
+		if (bonded) {
+			/* Bonding is used */
+			port->bonded = true;
+			port->dual_link_port->bonded = true;
+			upstream_port->bonded = true;
+			upstream_port->dual_link_port->bonded = true;
+		}
 	}
 
 	return sw;
Signature · 1 line
2.30.2
author maintainer
#611 lore raw

PATCH 611/700 mtd: spinand: Fix double counting of ECC stats

In reply to Greg Kroah-Hartman

From: Miquel Raynal <[email protected]>

[ Upstream commit c93081b265735db2417f0964718516044d06b1a2 ]

In the raw NAND world, ECC engines increment ecc_stats and the final caller is responsible for returning -EBADMSG if the verification failed.

In the SPI-NAND world it was a bit different until now because there was only one possible ECC engine: the on-die one. Indeed, the spinand_mtd_read() call was incrementing the ecc_stats counters depending on the outcome of spinand_check_ecc_status() directly.

So now let's split the logic like this:
- spinand_check_ecc_status() is specific to the SPI-NAND on-die engine and is kept very simple: it just returns the ECC status (bonus point:
the content of this helper can be overloaded).
- spinand_ondie_ecc_finish_io_req() is the caller of spinand_check_ecc_status() and will increment the counters and eventually return -EBADMSG.
- spinand_mtd_read() is not tied to the on-die ECC implementation and should be able to handle results coming from other ECC engines: it has the responsibility of returning the maximum number of bitflips which happened during the entire operation as this is the only helper that is aware that several pages may be read in a row.

Fixes 945845b54c9c ("mtd: spinand: Instantiate a SPI-NAND on-die ECC engine")
---
 drivers/mtd/nand/spi/core.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/mtd/nand/spi/core.c +11 -6
index 17f63f95f4a2..54ae540bc66b 100644
@@ -290,6 +290,8 @@ static int spinand_ondie_ecc_finish_io_req(struct nand_device *nand,
 {
 	struct spinand_ondie_ecc_conf *engine_conf = nand->ecc.ctx.priv;
 	struct spinand_device *spinand = nand_to_spinand(nand);
+	struct mtd_info *mtd = spinand_to_mtd(spinand);
+	int ret;
 
 	if (req->mode == MTD_OPS_RAW)
 		return 0;
@@ -299,7 +301,13 @@ static int spinand_ondie_ecc_finish_io_req(struct nand_device *nand,
 		return 0;
 
 	/* Finish a page write: check the status, report errors/bitflips */
-	return spinand_check_ecc_status(spinand, engine_conf->status);
+	ret = spinand_check_ecc_status(spinand, engine_conf->status);
+	if (ret == -EBADMSG)
+		mtd->ecc_stats.failed++;
+	else if (ret > 0)
+		mtd->ecc_stats.corrected += ret;
+
+	return ret;
 }
 
 static struct nand_ecc_engine_ops spinand_ondie_ecc_engine_ops = {
@@ -620,13 +628,10 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t from,
 		if (ret < 0 && ret != -EBADMSG)
 			break;
 
-		if (ret == -EBADMSG) {
+		if (ret == -EBADMSG)
 			ecc_failed = true;
-			mtd->ecc_stats.failed++;
-		} else {
-			mtd->ecc_stats.corrected += ret;
+		else
 			max_bitflips = max_t(unsigned int, max_bitflips, ret);
-		}
 
 		ret = 0;
 		ops->retlen += iter.req.datalen;
Signature · 1 line
2.30.2
author maintainer
#612 lore raw

PATCH 612/700 kunit: Fix result propagation for parameterised tests

In reply to Greg Kroah-Hartman

From: David Gow <[email protected]>

[ Upstream commit 384426bd101cb3cd580b18de19d4891ec5ca5bf9 ]

When one parameter of a parameterised test failed, its failure would be propagated to the overall test, but not to the suite result (unless it was the last parameter).

This is because test_case->success was being reset to the test->success result after each parameter was used, so a failing test's result would be overwritten by a non-failing result. The overall test result was handled in a third variable, test_result, but this was discarded after the status line was printed.

Instead, just propagate the result after each parameter run.

Fixes fadb08e7c750 ("kunit: Support for Parameterized Testing")
---
 lib/kunit/test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
lib/kunit/test.c +3 -4
index ec9494e914ef..c2b7248ebc9e 100644
@@ -343,7 +343,7 @@ static void kunit_run_case_catch_errors(struct kunit_suite *suite,
 	context.test_case = test_case;
 	kunit_try_catch_run(try_catch, &context);
 
-	test_case->success = test->success;
+	test_case->success &= test->success;
 }
 
 int kunit_run_tests(struct kunit_suite *suite)
@@ -355,7 +355,7 @@ int kunit_run_tests(struct kunit_suite *suite)
 
 	kunit_suite_for_each_test_case(suite, test_case) {
 		struct kunit test = { .param_value = NULL, .param_index = 0 };
-		bool test_success = true;
+		test_case->success = true;
 
 		if (test_case->generate_params) {
 			/* Get initial param. */
@@ -365,7 +365,6 @@ int kunit_run_tests(struct kunit_suite *suite)
 
 		do {
 			kunit_run_case_catch_errors(suite, test_case, &test);
-			test_success &= test_case->success;
 
 			if (test_case->generate_params) {
 				if (param_desc[0] == '\0') {
@@ -387,7 +386,7 @@ int kunit_run_tests(struct kunit_suite *suite)
 			}
 		} while (test.param_value);
 
-		kunit_print_ok_not_ok(&test, true, test_success,
+		kunit_print_ok_not_ok(&test, true, test_case->success,
 				      kunit_test_case_num(suite, test_case),
 				      test_case->name);
 	}
Signature · 1 line
2.30.2
author maintainer
#613 lore raw

PATCH 613/700 iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit 8f884758966259fa8c50c137ac6d4ce9bb7859db ]

To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned.

Found during an audit of all calls of this function.

Fixes 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support")
Cc Eugen Hristev <[email protected]>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/at91-sama5d2_adc.c +2 -1
index a7826f097b95..d356b515df09 100644
@@ -403,7 +403,8 @@ struct at91_adc_state {
 	struct at91_adc_dma		dma_st;
 	struct at91_adc_touch		touch_st;
 	struct iio_dev			*indio_dev;
-	u16				buffer[AT91_BUFFER_MAX_HWORDS];
+	/* Ensure naturally aligned timestamp */
+	u16				buffer[AT91_BUFFER_MAX_HWORDS] __aligned(8);
 	/*
 	 * lock to prevent concurrent 'single conversion' requests through
 	 * sysfs.
Signature · 1 line
2.30.2
author maintainer
#614 lore raw

PATCH 614/700 iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit afe2a789fbf7acd1a05407fc7839cc08d23825e3 ]

To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned.

Found during an audit of all calls of this function.

Fixes d3bf60450d47 ("iio: hx711: add triggered buffer support")
Cc Andreas Klinger <[email protected]>
---
 drivers/iio/adc/hx711.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/hx711.c +2 -2
index 6a173531d355..f7ee856a6b8b 100644
@@ -86,9 +86,9 @@ struct hx711_data {
 	struct mutex		lock;
 	/*
 	 * triggered buffer
-	 * 2x32-bit channel + 64-bit timestamp
+	 * 2x32-bit channel + 64-bit naturally aligned timestamp
 	 */
-	u32			buffer[4];
+	u32			buffer[4] __aligned(8);
 	/*
 	 * delay after a rising edge on SCK until the data is ready DOUT
 	 * this is dependent on the hx711 where the datasheet tells a
Signature · 1 line
2.30.2
author maintainer
#615 lore raw

PATCH 615/700 iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit 6a6be221b8bd561b053f0701ec752a5ed9007f69 ]

To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned.
Add a comment on why the buffer is the size it is as not immediately obvious.

Found during an audit of all calls of this function.

Fixes 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
Cc Andreas Klinger <[email protected]>
---
 drivers/iio/adc/mxs-lradc-adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/mxs-lradc-adc.c +2 -1
index 30e29f44ebd2..c480cb489c1a 100644
@@ -115,7 +115,8 @@ struct mxs_lradc_adc {
 	struct device		*dev;
 
 	void __iomem		*base;
-	u32			buffer[10];
+	/* Maximum of 8 channels + 8 byte ts */
+	u32			buffer[10] __aligned(8);
 	struct iio_trigger	*trig;
 	struct completion	completion;
 	spinlock_t		lock;
Signature · 1 line
2.30.2
author maintainer
#616 lore raw

PATCH 616/700 iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit 61fa5dfa5f52806f5ce37a0ba5712c271eb22f98 ]

Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted.

Fixes f214ff521fb1 ("iio: ti-ads8688: Update buffer allocation for timestamps")
---
 drivers/iio/adc/ti-ads8688.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/ti-ads8688.c +2 -1
index 16bcb37eebb7..79c803537dc4 100644
@@ -383,7 +383,8 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
 {
 	struct iio_poll_func *pf = p;
 	struct iio_dev *indio_dev = pf->indio_dev;
-	u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
+	/* Ensure naturally aligned timestamp */
+	u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8);
 	int i, j = 0;
 
 	for (i = 0; i < indio_dev->masklength; i++) {
Signature · 1 line
2.30.2
author maintainer
#617 lore raw

PATCH 617/700 iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit b8f939fd20690623cb24845a563e7bc1e4a21482 ]

Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted.

Here an explicit structure is not used, because this buffer is used in a non-trivial way for data repacking.

Fixes 121354b2eceb ("iio: magnetometer: Add driver support for PNI RM3100")
Cc Song Qiang <[email protected]>
---
 drivers/iio/magnetometer/rm3100-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/magnetometer/rm3100-core.c +2 -1
index 7242897a05e9..720234a91db1 100644
@@ -78,7 +78,8 @@ struct rm3100_data {
 	bool use_interrupt;
 	int conversion_time;
 	int scale;
-	u8 buffer[RM3100_SCAN_BYTES];
+	/* Ensure naturally aligned timestamp */
+	u8 buffer[RM3100_SCAN_BYTES] __aligned(8);
 	struct iio_trigger *drdy_trig;
 
 	/*
Signature · 1 line
2.30.2
author maintainer
#618 lore raw

PATCH 618/700 iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit dce793c0ab00c35039028fdcd5ce123805a01361 ]

Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted.

Here an explicit structure is not used, because the holes would necessitate the addition of an explict memset(), to avoid a kernel data leak, making for a less minimal fix.

Found during an audit of all callers of iio_push_to_buffers_with_timestamp()

Fixes 8fe78d5261e7 ("iio: vcnl4000: Add buffer support for VCNL4010/20.")
Cc Mathieu Othacehe <[email protected]>
---
 drivers/iio/light/vcnl4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/vcnl4000.c +1 -1
index fff4b36b8b58..f4feb44903b3 100644
@@ -910,7 +910,7 @@ static irqreturn_t vcnl4010_trigger_handler(int irq, void *p)
 	struct iio_dev *indio_dev = pf->indio_dev;
 	struct vcnl4000_data *data = iio_priv(indio_dev);
 	const unsigned long *active_scan_mask = indio_dev->active_scan_mask;
-	u16 buffer[8] = {0}; /* 1x16-bit + ts */
+	u16 buffer[8] __aligned(8) = {0}; /* 1x16-bit + naturally aligned ts */
 	bool data_read = false;
 	unsigned long isr;
 	int val = 0;
Signature · 1 line
2.30.2
author maintainer
#619 lore raw

PATCH 619/700 ASoC: fsl_spdif: Fix error handler with pm_runtime_enable

In reply to Greg Kroah-Hartman

From: Shengjiu Wang <[email protected]>

[ Upstream commit 28108d71ee11a7232e1102effab3361049dcd3b8 ]

There is error message when defer probe happens:

fsl-spdif-dai 2dab0000.spdif: Unbalanced pm_runtime_enable!

Fix the error handler with pm_runtime_enable and add fsl_spdif_remove() for pm_runtime_disable.

Fixes 9cb2b3796e08 ("ASoC: fsl_spdif: Add pm runtime function")
---
 sound/soc/fsl/fsl_spdif.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_spdif.c +17 -3
index 174e558224d8..e5d366b2a6a4 100644
@@ -1400,16 +1400,29 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 					      &spdif_priv->cpu_dai_drv, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
-		return ret;
+		goto err_pm_disable;
 	}
 
 	ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE);
-	if (ret && ret != -EPROBE_DEFER)
-		dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret);
+	if (ret) {
+		dev_err_probe(&pdev->dev, ret, "imx_pcm_dma_init failed\n");
+		goto err_pm_disable;
+	}
+
+	return ret;
 
+err_pm_disable:
+	pm_runtime_disable(&pdev->dev);
 	return ret;
 }
 
+static int fsl_spdif_remove(struct platform_device *pdev)
+{
+	pm_runtime_disable(&pdev->dev);
+
+	return 0;
+}
+
 #ifdef CONFIG_PM
 static int fsl_spdif_runtime_suspend(struct device *dev)
 {
@@ -1512,6 +1525,7 @@ static struct platform_driver fsl_spdif_driver = {
 		.pm = &fsl_spdif_pm,
 	},
 	.probe = fsl_spdif_probe,
+	.remove = fsl_spdif_remove,
 };
 
 module_platform_driver(fsl_spdif_driver);
Signature · 1 line
2.30.2
author maintainer
#620 lore raw

PATCH 620/700 staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt()

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

[ Upstream commit 4a36e160856db8a8ddd6a3d2e5db5a850ab87f82 ]

There needs to be a check to verify that we don't read beyond the end of "buf". This function is called from do_rx(). The "buf" is the USB transfer_buffer and "len" is "urb->actual_length".

Fixes 61e121047645 ("staging: gdm7240: adding LTE USB driver")
---
 drivers/staging/gdm724x/gdm_lte.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/staging/gdm724x/gdm_lte.c +9 -1
index 571f47d39484..a41af7aa74ec 100644
@@ -677,6 +677,7 @@ static void gdm_lte_multi_sdu_pkt(struct phy_dev *phy_dev, char *buf, int len)
 	struct sdu *sdu = NULL;
 	u8 endian = phy_dev->get_endian(phy_dev->priv_dev);
 	u8 *data = (u8 *)multi_sdu->data;
+	int copied;
 	u16 i = 0;
 	u16 num_packet;
 	u16 hci_len;
@@ -688,6 +689,12 @@ static void gdm_lte_multi_sdu_pkt(struct phy_dev *phy_dev, char *buf, int len)
 	num_packet = gdm_dev16_to_cpu(endian, multi_sdu->num_packet);
 
 	for (i = 0; i < num_packet; i++) {
+		copied = data - multi_sdu->data;
+		if (len < copied + sizeof(*sdu)) {
+			pr_err("rx prevent buffer overflow");
+			return;
+		}
+
 		sdu = (struct sdu *)data;
 
 		cmd_evt  = gdm_dev16_to_cpu(endian, sdu->cmd_evt);
@@ -698,7 +705,8 @@ static void gdm_lte_multi_sdu_pkt(struct phy_dev *phy_dev, char *buf, int len)
 			pr_err("rx sdu wrong hci %04x\n", cmd_evt);
 			return;
 		}
-		if (hci_len < 12) {
+		if (hci_len < 12 ||
+		    len < copied + sizeof(*sdu) + (hci_len - 12)) {
 			pr_err("rx sdu invalid len %d\n", hci_len);
 			return;
 		}
Signature · 1 line
2.30.2
author maintainer
#621 lore raw

PATCH 621/700 staging: gdm724x: check for overflow in gdm_lte_netif_rx()

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

[ Upstream commit 7002b526f4ff1f6da34356e67085caafa6be383a ]

This code assumes that "len" is at least 62 bytes, but we need a check to prevent a read overflow.

Fixes 61e121047645 ("staging: gdm7240: adding LTE USB driver")
---
 drivers/staging/gdm724x/gdm_lte.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/gdm724x/gdm_lte.c +6 -4
index a41af7aa74ec..bd5f87433404 100644
@@ -611,10 +611,12 @@ static void gdm_lte_netif_rx(struct net_device *dev, char *buf,
 						  * bytes (99,130,83,99 dec)
 						  */
 			} __packed;
-			void *addr = buf + sizeof(struct iphdr) +
-				sizeof(struct udphdr) +
-				offsetof(struct dhcp_packet, chaddr);
-			ether_addr_copy(nic->dest_mac_addr, addr);
+			int offset = sizeof(struct iphdr) +
+				     sizeof(struct udphdr) +
+				     offsetof(struct dhcp_packet, chaddr);
+			if (offset + ETH_ALEN > len)
+				return;
+			ether_addr_copy(nic->dest_mac_addr, buf + offset);
 		}
 	}
 
Signature · 1 line
2.30.2
author maintainer
#622 lore raw

PATCH 622/700 staging: rtl8712: fix error handling in r871xu_drv_init

In reply to Greg Kroah-Hartman

From: Pavel Skripkin <[email protected]>

[ Upstream commit d1d3e3cdfda8eb91f0e24be7ec8be1e6e01b3a1c ]

Previous error handling path was unique for all possible errors and there was unnecessary branching. Also, one step for freeing drv_sw was missing. All these problems was fixed by restructuring error handling path.

Also, moved out free_netdev() from r8712_free_drv_sw() for correct error handling.

---
 drivers/staging/rtl8712/os_intfs.c |  4 ----
 drivers/staging/rtl8712/usb_intf.c | 24 ++++++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8712/os_intfs.c +0 -4
index 0c3ae8495afb..2214aca09730 100644
@@ -328,8 +328,6 @@ int r8712_init_drv_sw(struct _adapter *padapter)
 
 void r8712_free_drv_sw(struct _adapter *padapter)
 {
-	struct net_device *pnetdev = padapter->pnetdev;
-
 	r8712_free_cmd_priv(&padapter->cmdpriv);
 	r8712_free_evt_priv(&padapter->evtpriv);
 	r8712_DeInitSwLeds(padapter);
@@ -339,8 +337,6 @@ void r8712_free_drv_sw(struct _adapter *padapter)
 	_r8712_free_sta_priv(&padapter->stapriv);
 	_r8712_free_recv_priv(&padapter->recvpriv);
 	mp871xdeinit(padapter);
-	if (pnetdev)
-		free_netdev(pnetdev);
 }
 
 static void enable_video_mode(struct _adapter *padapter, int cbw40_value)
drivers/staging/rtl8712/usb_intf.c +14 -10
index dc21e7743349..b760bc355937 100644
@@ -361,7 +361,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
 	/* step 1. */
 	pnetdev = r8712_init_netdev();
 	if (!pnetdev)
-		goto error;
+		goto put_dev;
 	padapter = netdev_priv(pnetdev);
 	disable_ht_for_spec_devid(pdid, padapter);
 	pdvobjpriv = &padapter->dvobjpriv;
@@ -381,16 +381,16 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
 	 * initialize the dvobj_priv
 	 */
 	if (!padapter->dvobj_init) {
-		goto error;
+		goto put_dev;
 	} else {
 		status = padapter->dvobj_init(padapter);
 		if (status != _SUCCESS)
-			goto error;
+			goto free_netdev;
 	}
 	/* step 4. */
 	status = r8712_init_drv_sw(padapter);
 	if (status)
-		goto error;
+		goto dvobj_deinit;
 	/* step 5. read efuse/eeprom data and get mac_addr */
 	{
 		int i, offset;
@@ -570,17 +570,20 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
 	}
 	/* step 6. Load the firmware asynchronously */
 	if (rtl871x_load_fw(padapter))
-		goto error;
+		goto deinit_drv_sw;
 	spin_lock_init(&padapter->lock_rx_ff0_filter);
 	mutex_init(&padapter->mutex_start);
 	return 0;
-error:
+
+deinit_drv_sw:
+	r8712_free_drv_sw(padapter);
+dvobj_deinit:
+	padapter->dvobj_deinit(padapter);
+free_netdev:
+	free_netdev(pnetdev);
+put_dev:
 	usb_put_dev(udev);
 	usb_set_intfdata(pusb_intf, NULL);
-	if (padapter && padapter->dvobj_deinit)
-		padapter->dvobj_deinit(padapter);
-	if (pnetdev)
-		free_netdev(pnetdev);
 	return -ENODEV;
 }
 
@@ -612,6 +615,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
 		r8712_stop_drv_timers(padapter);
 		r871x_dev_unload(padapter);
 		r8712_free_drv_sw(padapter);
+		free_netdev(pnetdev);
 
 		/* decrease the reference count of the usb device structure
 		 * when disconnect
Signature · 1 line
2.30.2
author maintainer
#623 lore raw

PATCH 623/700 staging: rtl8712: fix memory leak in rtl871x_load_fw_cb

In reply to Greg Kroah-Hartman

From: Pavel Skripkin <[email protected]>

[ Upstream commit e02a3b945816a77702a2769a70ef5f9b06e49d54 ]

There is a leak in rtl8712 driver.
The problem was in non-freed adapter data if
firmware load failed.

This leak can be reproduced with this code:
https://syzkaller.appspot.com/text?tag=ReproC&x=16612f02d00000,
Autoload must fail (to not hit memory leak reported by syzkaller)

There are 2 possible ways how rtl871x_load_fw_cb() and r871xu_dev_remove() can be called (in case of fw load error).

1st case:

	r871xu_dev_remove() then rtl871x_load_fw_cb()

	In this case r871xu_dev_remove() will wait for
	completion and then will jump to the end, because
	rtl871x_load_fw_cb() set intfdata to NULL:

	if (pnetdev) {
		struct _adapter *padapter = netdev_priv(pnetdev);

		/* never exit with a firmware callback pending */
		wait_for_completion(&padapter->rtl8712_fw_ready);
		pnetdev = usb_get_intfdata(pusb_intf);
		usb_set_intfdata(pusb_intf, NULL);
		if (!pnetdev)
			goto firmware_load_fail;

		... clean up code here ...
	}

2nd case:
rtl871x_load_fw_cb() then r871xu_dev_remove()

In this case pnetdev (from code snippet above) will be zero (because rtl871x_load_fw_cb() set it to NULL) And clean up code won't be executed again.

So, in all cases we need to free adapted data in rtl871x_load_fw_cb(), because disconnect function cannot take care of it. And there won't be any race conditions, because complete() call happens after setting intfdata to NULL.

In previous patch I moved out free_netdev() from r8712_free_drv_sw() and that's why now it's possible to free adapter data and then call complete.

---
 drivers/staging/rtl8712/hal_init.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/staging/rtl8712/hal_init.c +3 -0
index 715f1fe8b472..22974277afa0 100644
@@ -40,7 +40,10 @@ static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context)
 		dev_err(&udev->dev, "r8712u: Firmware request failed\n");
 		usb_put_dev(udev);
 		usb_set_intfdata(usb_intf, NULL);
+		r8712_free_drv_sw(adapter);
+		adapter->dvobj_deinit(adapter);
 		complete(&adapter->rtl8712_fw_ready);
+		free_netdev(adapter->pnetdev);
 		return;
 	}
 	adapter->fw = firmware;
Signature · 1 line
2.30.2
author maintainer
#624 lore raw

PATCH 624/700 coresight: core: Fix use of uninitialized pointer

In reply to Greg Kroah-Hartman

From: Junhao He <[email protected]>

[ Upstream commit d777a8991847729ec4e2a13fcad58c2b00bb19dc ]

Currently the pointer "sink" might be checked before initialized. Fix this by initializing this pointer.

---
 drivers/hwtracing/coresight/coresight-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-core.c +1 -1
index 0062c8935653..237a8c0d6c24 100644
@@ -595,7 +595,7 @@ static struct coresight_device *
 coresight_find_enabled_sink(struct coresight_device *csdev)
 {
 	int i;
-	struct coresight_device *sink;
+	struct coresight_device *sink = NULL;
 
 	if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
 	     csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
Signature · 1 line
2.30.2
author maintainer
#625 lore raw

PATCH 625/700 staging: mt7621-dts: fix pci address for PCI memory range

In reply to Greg Kroah-Hartman

From: Sergio Paracuellos <[email protected]>

[ Upstream commit 5b4f167ef3555ec4c334a8dc89c1b44bb2c6bff5 ]

Driver code call 'devm_of_pci_get_host_bridge_resources' to get resources and properly fill 'bridge->windows' and 'bridge->dma_ranges'. After parsing the ranges and store as resources, at the end it makes a call to pci function 'pci_add_resource_offset' to set the offset for the memory resource. To calculate offset, resource start address subtracts pci address of the range. MT7621 does not need any offset for the memory resource. Moreover, setting an offset got into 'WARN_ON' calls from pci devices driver code. Until now memory range pci_addr was being '0x00000000' and res->start is '0x60000000' but becase pci controller driver was manually setting resources and adding them using pci function 'pci_add_resource' where a zero is passed as offset, things was properly working. Since PCI_IOBASE is defined now for ralink we don't set nothing manually anymore so we have to properly fix PCI address for this range to make things work and the new pci address must be set to '0x60000000'. Doing in this way the subtract result obtain zero as offset and pci device driver code properly works.

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt7621-dts/mt7621.dtsi +1 -1
index 16fc94f65486..b3d08459acc8 100644
@@ -508,7 +508,7 @@
 
 		bus-range = <0 255>;
 		ranges = <
-			0x02000000 0 0x00000000 0x60000000 0 0x10000000 /* pci memory */
+			0x02000000 0 0x60000000 0x60000000 0 0x10000000 /* pci memory */
 			0x01000000 0 0x00000000 0x1e160000 0 0x00010000 /* io space */
 		>;
 
Signature · 1 line
2.30.2
author maintainer
#626 lore raw

PATCH 626/700 usb: phy: tegra: Wait for VBUS wakeup status deassertion on suspend

In reply to Greg Kroah-Hartman

From: Dmitry Osipenko <[email protected]>

[ Upstream commit 6f8d39a8ef55efde414b6e574384acbce70c3119 ]

Some devices need an extra delay after losing VBUS, otherwise VBUS may be detected as active at suspend time, preventing the PHY's suspension by the VBUS detection sensor. This problem was found on Asus Transformer TF700T (Tegra30) tablet device, where the USB PHY wakes up immediately from suspend because VBUS sensor continues to detect VBUS as active after disconnection. We need to poll the PHY's VBUS wakeup status until it's deasserted before suspending PHY in order to fix this minor trouble.

---
 drivers/usb/phy/phy-tegra-usb.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/usb/phy/phy-tegra-usb.c +10 -0
index a48452a6172b..10fafcf9801b 100644
@@ -64,6 +64,7 @@
 #define   A_VBUS_VLD_WAKEUP_EN			BIT(30)
 
 #define USB_PHY_VBUS_WAKEUP_ID			0x408
+#define   VBUS_WAKEUP_STS			BIT(10)
 #define   VBUS_WAKEUP_WAKEUP_EN			BIT(30)
 
 #define USB1_LEGACY_CTRL			0x410
@@ -642,6 +643,15 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy)
 	void __iomem *base = phy->regs;
 	u32 val;
 
+	/*
+	 * Give hardware time to settle down after VBUS disconnection,
+	 * otherwise PHY will immediately wake up from suspend.
+	 */
+	if (phy->wakeup_enabled && phy->mode != USB_DR_MODE_HOST)
+		readl_relaxed_poll_timeout(base + USB_PHY_VBUS_WAKEUP_ID,
+					   val, !(val & VBUS_WAKEUP_STS),
+					   5000, 100000);
+
 	utmi_phy_clk_disable(phy);
 
 	/* PHY won't resume if reset is asserted */
Signature · 1 line
2.30.2
author maintainer
#627 lore raw

PATCH 627/700 usb: phy: tegra: Correct definition of B_SESS_VLD_WAKEUP_EN bit

In reply to Greg Kroah-Hartman

From: Dmitry Osipenko <[email protected]>

[ Upstream commit 7917e90667bc8dce02daa3c2e6df47f6fc9481f7 ]

The B_SESS_VLD_WAKEUP_EN bit 6 was added by a mistake in a previous commit. This bit corresponds to B_SESS_END_WAKEUP_EN, which we don't use. The B_VBUS_VLD_WAKEUP_EN doesn't exist at all and B_SESS_VLD_WAKEUP_EN needs to be in place of it. We don't utilize B-sensors in the driver, so it never was a problem, nevertheless let's correct the definition of the bits.

Fixes 35192007d28d ("usb: phy: tegra: Support waking up from a low power mode")
---
 drivers/usb/phy/phy-tegra-usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/phy/phy-tegra-usb.c +2 -3
index 10fafcf9801b..c0f432d509aa 100644
@@ -58,8 +58,7 @@
 #define   USB_WAKEUP_DEBOUNCE_COUNT(x)		(((x) & 0x7) << 16)
 
 #define USB_PHY_VBUS_SENSORS			0x404
-#define   B_SESS_VLD_WAKEUP_EN			BIT(6)
-#define   B_VBUS_VLD_WAKEUP_EN			BIT(14)
+#define   B_SESS_VLD_WAKEUP_EN			BIT(14)
 #define   A_SESS_VLD_WAKEUP_EN			BIT(22)
 #define   A_VBUS_VLD_WAKEUP_EN			BIT(30)
 
@@ -545,7 +544,7 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
 
 		val = readl_relaxed(base + USB_PHY_VBUS_SENSORS);
 		val &= ~(A_VBUS_VLD_WAKEUP_EN | A_SESS_VLD_WAKEUP_EN);
-		val &= ~(B_VBUS_VLD_WAKEUP_EN | B_SESS_VLD_WAKEUP_EN);
+		val &= ~(B_SESS_VLD_WAKEUP_EN);
 		writel_relaxed(val, base + USB_PHY_VBUS_SENSORS);
 
 		val = readl_relaxed(base + UTMIP_BAT_CHRG_CFG0);
Signature · 1 line
2.30.2
author maintainer
#628 lore raw

PATCH 628/700 serial: 8250: Actually allow UPF_MAGIC_MULTIPLIER baud rates

In reply to Greg Kroah-Hartman

From: Maciej W. Rozycki <[email protected]>

[ Upstream commit 78bcae8616ac277d6cb7f38e211493948ed73e30 ]

Support for magic baud rate divisors of 32770 and 32769 used with SMSC Super I/O chips for extra baud rates of 230400 and 460800 respectively where base rate is 115200[1] has been added around Linux 2.5.64, which predates our repo history, but the origin could be identified as commit 2a717aad772f ("Merge with Linux 2.5.64.") with the old MIPS/Linux repo also at: <git://git.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git>.

Code that is now in serial8250_do_get_divisor' was added back then to serial8250_get_divisor', but that code would only ever trigger if one of the higher baud rates was actually requested, and that cannot ever happen, because the earlier call to serial8250_get_baud_rate' never returns them. This is because it calls uart_get_baud_rate' with the maximum requested being the base rate, that is clk/16 or 115200 for SMSC chips at their nominal clock rate.

Fix it then and allow UPF_MAGIC_MULTIPLIER baud rates to be selected, by requesting the maximum baud rate of clk/4 rather than clk/16 if the flag has been set. Also correct the minimum baud rate, observing that these ports only support actual (non-magic) divisors of up to 32767 only.

[1] "FDC37M81x, PC98/99 Compliant Enhanced Super I/O Controller with Keyboard/Mouse Wake-Up", Standard Microsystems Corporation, Rev. 03/27/2000, Table 31 - "Baud Rates", p. 77

---
 drivers/tty/serial/8250/8250_port.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/tty/serial/8250/8250_port.c +16 -3
index 6e141429c980..6d9c494bed7d 100644
@@ -2635,6 +2635,21 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,
 					     struct ktermios *old)
 {
 	unsigned int tolerance = port->uartclk / 100;
+	unsigned int min;
+	unsigned int max;
+
+	/*
+	 * Handle magic divisors for baud rates above baud_base on SMSC
+	 * Super I/O chips.  Enable custom rates of clk/4 and clk/8, but
+	 * disable divisor values beyond 32767, which are unavailable.
+	 */
+	if (port->flags & UPF_MAGIC_MULTIPLIER) {
+		min = port->uartclk / 16 / UART_DIV_MAX >> 1;
+		max = (port->uartclk + tolerance) / 4;
+	} else {
+		min = port->uartclk / 16 / UART_DIV_MAX;
+		max = (port->uartclk + tolerance) / 16;
+	}
 
 	/*
 	 * Ask the core to calculate the divisor for us.
@@ -2642,9 +2657,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,
 	 * slower than nominal still match standard baud rates without
 	 * causing transmission errors.
 	 */
-	return uart_get_baud_rate(port, termios, old,
-				  port->uartclk / 16 / UART_DIV_MAX,
-				  (port->uartclk + tolerance) / 16);
+	return uart_get_baud_rate(port, termios, old, min, max);
 }
 
 /*
Signature · 1 line
2.30.2
author maintainer
#629 lore raw

PATCH 629/700 iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit ec90b52c07c0403a6db60d752484ec08d605ead0 ]

Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted.

Here an explicit structure is not used, because the holes would necessitate the addition of an explict memset(), to avoid a potential kernel data leak, making for a less minimal fix.

Fixes 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
Cc Parthiban Nallathambi <[email protected]>
---
 drivers/iio/light/vcnl4035.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/light/vcnl4035.c +2 -1
index 73a28e30dddc..1342bbe111ed 100644
@@ -102,7 +102,8 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p)
 	struct iio_poll_func *pf = p;
 	struct iio_dev *indio_dev = pf->indio_dev;
 	struct vcnl4035_data *data = iio_priv(indio_dev);
-	u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)];
+	/* Ensure naturally aligned timestamp */
+	u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)]  __aligned(8);
 	int ret;
 
 	ret = regmap_read(data->regmap, VCNL4035_ALS_DATA, (int *)buffer);
Signature · 1 line
2.30.2
author maintainer
#630 lore raw

PATCH 630/700 iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

In reply to Greg Kroah-Hartman

From: Jonathan Cameron <[email protected]>

[ Upstream commit 92babc9938ebbf4050f2fba774836f7edc16a570 ]

Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted.

Here an explicit structure is not used, because the holes would necessitate the addition of an explict memset(), to avoid a kernel data leak, making for a less minimal fix.

Fixes 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.")
Cc Mathieu Othacehe <[email protected]>
---
 drivers/iio/proximity/isl29501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/proximity/isl29501.c +1 -1
index 90e76451c972..5b6ea783795d 100644
@@ -938,7 +938,7 @@ static irqreturn_t isl29501_trigger_handler(int irq, void *p)
 	struct iio_dev *indio_dev = pf->indio_dev;
 	struct isl29501_private *isl29501 = iio_priv(indio_dev);
 	const unsigned long *active_mask = indio_dev->active_scan_mask;
-	u32 buffer[4] = {}; /* 1x16-bit + ts */
+	u32 buffer[4] __aligned(8) = {}; /* 1x16-bit + naturally aligned ts */
 
 	if (test_bit(ISL29501_DISTANCE_SCAN_INDEX, active_mask))
 		isl29501_register_read(isl29501, REG_DISTANCE, buffer);
Signature · 1 line
2.30.2
author maintainer
#631 lore raw

PATCH 631/700 ASoC: cs42l42: Correct definition of CS42L42_ADC_PDN_MASK

In reply to Greg Kroah-Hartman

From: Richard Fitzgerald <[email protected]>

[ Upstream commit fac165f22ac947b55407cd3a60a2a9824f905235 ]

The definition of CS42L42_ADC_PDN_MASK was incorrectly defined as the HP_PDN bit.

Fixes 2c394ca79604 ("ASoC: Add support for CS42L42 codec")
---
 sound/soc/codecs/cs42l42.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs42l42.h +1 -1
index 866d7c873e3c..ca2019732013 100644
@@ -77,7 +77,7 @@
 #define CS42L42_HP_PDN_SHIFT		3
 #define CS42L42_HP_PDN_MASK		(1 << CS42L42_HP_PDN_SHIFT)
 #define CS42L42_ADC_PDN_SHIFT		2
-#define CS42L42_ADC_PDN_MASK		(1 << CS42L42_HP_PDN_SHIFT)
+#define CS42L42_ADC_PDN_MASK		(1 << CS42L42_ADC_PDN_SHIFT)
 #define CS42L42_PDN_ALL_SHIFT		0
 #define CS42L42_PDN_ALL_MASK		(1 << CS42L42_PDN_ALL_SHIFT)
 
Signature · 1 line
2.30.2
author maintainer
#632 lore raw

PATCH 632/700 of: Fix truncation of memory sizes on 32-bit platforms

In reply to Greg Kroah-Hartman

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 2892d8a00d23d511a0591ac4b2ff3f050ae1f004 ]

Variable "size" has type "phys_addr_t", which can be either 32-bit or 64-bit on 32-bit systems, while "unsigned long" is always 32-bit on 32-bit systems. Hence the cast in

(unsigned long)size / SZ_1M

may truncate a 64-bit size to 32-bit, as casts have a higher operator precedence than divisions.

Fix this by inverting the order of the cast and division, which should be safe for memory blocks smaller than 4 PiB. Note that the division is actually a shift, as SZ_1M is a power-of-two constant, hence there is no need to use div_u64().

While at it, use "%lu" to format "unsigned long".

Fixes e8d9d1f5485b52ec ("drivers: of: add initialization code for static reserved memory")
Fixes 3f0c8206644836e4 ("drivers: of: add initialization code for dynamic reserved memory")
---
 drivers/of/fdt.c             | 8 ++++----
 drivers/of/of_reserved_mem.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/of/fdt.c +4 -4
index adb26aff481d..c485b2c7720d 100644
@@ -511,11 +511,11 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
 
 		if (size &&
 		    early_init_dt_reserve_memory_arch(base, size, nomap) == 0)
-			pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %ld MiB\n",
-				uname, &base, (unsigned long)size / SZ_1M);
+			pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n",
+				uname, &base, (unsigned long)(size / SZ_1M));
 		else
-			pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %ld MiB\n",
-				uname, &base, (unsigned long)size / SZ_1M);
+			pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n",
+				uname, &base, (unsigned long)(size / SZ_1M));
 
 		len -= t_len;
 		if (first) {
drivers/of/of_reserved_mem.c +4 -4
index a7fbc5e37e19..6c95bbdf9265 100644
@@ -134,9 +134,9 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
 			ret = early_init_dt_alloc_reserved_memory_arch(size,
 					align, start, end, nomap, &base);
 			if (ret == 0) {
-				pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n",
+				pr_debug("allocated memory for '%s' node: base %pa, size %lu MiB\n",
 					uname, &base,
-					(unsigned long)size / SZ_1M);
+					(unsigned long)(size / SZ_1M));
 				break;
 			}
 			len -= t_len;
@@ -146,8 +146,8 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
 		ret = early_init_dt_alloc_reserved_memory_arch(size, align,
 							0, 0, nomap, &base);
 		if (ret == 0)
-			pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n",
-				uname, &base, (unsigned long)size / SZ_1M);
+			pr_debug("allocated memory for '%s' node: base %pa, size %lu MiB\n",
+				uname, &base, (unsigned long)(size / SZ_1M));
 	}
 
 	if (base == 0) {
Signature · 1 line
2.30.2
author maintainer
#633 lore raw

PATCH 633/700 mtd: rawnand: marvell: add missing clk_disable_unprepare() on error in marvell_nfc_resume()

In reply to Greg Kroah-Hartman

From: Yang Yingliang <[email protected]>

[ Upstream commit ae94c49527aa9bd3b563349adc4b5617747ca6bd ]

Add clk_disable_unprepare() on error path in marvell_nfc_resume().

Fixes bd9c3f9b3c00 ("mtd: rawnand: marvell: add suspend and resume hooks")
---
 drivers/mtd/nand/raw/marvell_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/marvell_nand.c +3 -1
index 79da6b02e209..f83525a1ab0e 100644
@@ -3030,8 +3030,10 @@ static int __maybe_unused marvell_nfc_resume(struct device *dev)
 		return ret;
 
 	ret = clk_prepare_enable(nfc->reg_clk);
-	if (ret < 0)
+	if (ret < 0) {
+		clk_disable_unprepare(nfc->core_clk);
 		return ret;
+	}
 
 	/*
 	 * Reset nfc->selected_chip so the next command will cause the timing
Signature · 1 line
2.30.2
author maintainer
#634 lore raw

PATCH 634/700 habanalabs: Fix an error handling path in hl_pci_probe()

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 3002f467a0b0a70aec01d9f446da4ac8c6fda10b ]

If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it must be undone by a corresponding 'pci_disable_pcie_error_reporting()' call, as already done in the remove function.

Fixes 2e5eda4681f9 ("habanalabs: PCIe Advanced Error Reporting support")
---
 drivers/misc/habanalabs/common/habanalabs_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/common/habanalabs_drv.c +1 -0
index 032d114f01ea..827140626244 100644
@@ -437,6 +437,7 @@ static int hl_pci_probe(struct pci_dev *pdev,
 	return 0;
 
 disable_device:
+	pci_disable_pcie_error_reporting(pdev);
 	pci_set_drvdata(pdev, NULL);
 	destroy_hdev(hdev);
 
Signature · 1 line
2.30.2
author maintainer
#635 lore raw

PATCH 635/700 scsi: mpt3sas: Fix error return value in _scsih_expander_add()

In reply to Greg Kroah-Hartman

From: Zhen Lei <[email protected]>

[ Upstream commit d6c2ce435ffe23ef7f395ae76ec747414589db46 ]

When an expander does not contain any 'phys', an appropriate error code -1 should be returned, as done elsewhere in this function. However, we currently do not explicitly assign this error code to 'rc'. As a result, 0 was incorrectly returned.

Fixes f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS")
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +3 -1
index ae1973878cc7..7824e77bc6e2 100644
@@ -6883,8 +6883,10 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle)
 		 handle, parent_handle,
 		 (u64)sas_expander->sas_address, sas_expander->num_phys);
 
-	if (!sas_expander->num_phys)
+	if (!sas_expander->num_phys) {
+		rc = -1;
 		goto out_fail;
+	}
 	sas_expander->phy = kcalloc(sas_expander->num_phys,
 	    sizeof(struct _sas_phy), GFP_KERNEL);
 	if (!sas_expander->phy) {
Signature · 1 line
2.30.2
author maintainer
#636 lore raw

PATCH 636/700 soundwire: stream: Fix test for DP prepare complete

In reply to Greg Kroah-Hartman

From: Richard Fitzgerald <[email protected]>

[ Upstream commit 3d3e88e336338834086278236d42039f3cde50e1 ]

In sdw_prep_deprep_slave_ports(), after the wait_for_completion() the DP prepare status register is read. If this indicates that the port is now prepared, the code should continue with the port setup. It is irrelevant whether the wait_for_completion() timed out if the port is now ready.

The previous implementation would always fail if the wait_for_completion() timed out, even if the port was reporting successful prepare.

This patch also fixes a minor bug where the return from sdw_read() was not checked for error - any error code with LSBits clear could be misinterpreted as a successful port prepare.

---
 drivers/soundwire/stream.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/soundwire/stream.c +6 -7
index a418c3c7001c..304ff2ee7d75 100644
@@ -422,7 +422,6 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
 	struct completion *port_ready;
 	struct sdw_dpn_prop *dpn_prop;
 	struct sdw_prepare_ch prep_ch;
-	unsigned int time_left;
 	bool intr = false;
 	int ret = 0, val;
 	u32 addr;
@@ -479,15 +478,15 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
 
 		/* Wait for completion on port ready */
 		port_ready = &s_rt->slave->port_ready[prep_ch.num];
-		time_left = wait_for_completion_timeout(port_ready,
-				msecs_to_jiffies(dpn_prop->ch_prep_timeout));
+		wait_for_completion_timeout(port_ready,
+			msecs_to_jiffies(dpn_prop->ch_prep_timeout));
 
 		val = sdw_read(s_rt->slave, SDW_DPN_PREPARESTATUS(p_rt->num));
-		val &= p_rt->ch_mask;
-		if (!time_left || val) {
+		if ((val < 0) || (val & p_rt->ch_mask)) {
+			ret = (val < 0) ? val : -ETIMEDOUT;
 			dev_err(&s_rt->slave->dev,
-				"Chn prep failed for port:%d\n", prep_ch.num);
-			return -ETIMEDOUT;
+				"Chn prep failed for port %d: %d\n", prep_ch.num, ret);
+			return ret;
 		}
 	}
 
Signature · 1 line
2.30.2
author maintainer
#637 lore raw

PATCH 637/700 phy: uniphier-pcie: Fix updating phy parameters

In reply to Greg Kroah-Hartman

From: Kunihiko Hayashi <[email protected]>

[ Upstream commit 4a90bbb478dbf18ecdec9dcf8eb708e319d24264 ]

The current driver uses a value from register TEST_O as the original value for register TEST_I, though, the value is overwritten by "param", so there is a bug that the original value isn't no longer used.

The value of TEST_O[7:0] should be masked with "mask", replaced with "param", and placed in the bitfield TESTI_DAT_MASK as new TEST_I value.

Fixes c6d9b1324159 ("phy: socionext: add PCIe PHY driver support")
---
 drivers/phy/socionext/phy-uniphier-pcie.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/phy/socionext/phy-uniphier-pcie.c +7 -4
index e4adab375c73..6bdbd1f214dd 100644
@@ -24,11 +24,13 @@
 #define PORT_SEL_1		FIELD_PREP(PORT_SEL_MASK, 1)
 
 #define PCL_PHY_TEST_I		0x2000
-#define PCL_PHY_TEST_O		0x2004
 #define TESTI_DAT_MASK		GENMASK(13, 6)
 #define TESTI_ADR_MASK		GENMASK(5, 1)
 #define TESTI_WR_EN		BIT(0)
 
+#define PCL_PHY_TEST_O		0x2004
+#define TESTO_DAT_MASK		GENMASK(7, 0)
+
 #define PCL_PHY_RESET		0x200c
 #define PCL_PHY_RESET_N_MNMODE	BIT(8)	/* =1:manual */
 #define PCL_PHY_RESET_N		BIT(0)	/* =1:deasssert */
@@ -77,11 +79,12 @@ static void uniphier_pciephy_set_param(struct uniphier_pciephy_priv *priv,
 	val  = FIELD_PREP(TESTI_DAT_MASK, 1);
 	val |= FIELD_PREP(TESTI_ADR_MASK, reg);
 	uniphier_pciephy_testio_write(priv, val);
-	val = readl(priv->base + PCL_PHY_TEST_O);
+	val = readl(priv->base + PCL_PHY_TEST_O) & TESTO_DAT_MASK;
 
 	/* update value */
-	val &= ~FIELD_PREP(TESTI_DAT_MASK, mask);
-	val  = FIELD_PREP(TESTI_DAT_MASK, mask & param);
+	val &= ~mask;
+	val |= mask & param;
+	val = FIELD_PREP(TESTI_DAT_MASK, val);
 	val |= FIELD_PREP(TESTI_ADR_MASK, reg);
 	uniphier_pciephy_testio_write(priv, val);
 	uniphier_pciephy_testio_write(priv, val | TESTI_WR_EN);
Signature · 1 line
2.30.2
author maintainer
#638 lore raw

PATCH 638/700 phy: ti: dm816x: Fix the error handling path in dm816x_usb_phy_probe()

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit f7eedcb8539ddcbb6fe7791f1b4ccf43f905c72f ]

Add an error handling path in the probe to release some resources, as already done in the remove function.

---
 drivers/phy/ti/phy-dm816x-usb.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-dm816x-usb.c +13 -4
index 57adc08a89b2..9fe6ea6fdae5 100644
@@ -242,19 +242,28 @@ static int dm816x_usb_phy_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(phy->dev);
 	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
-	if (IS_ERR(generic_phy))
-		return PTR_ERR(generic_phy);
+	if (IS_ERR(generic_phy)) {
+		error = PTR_ERR(generic_phy);
+		goto clk_unprepare;
+	}
 
 	phy_set_drvdata(generic_phy, phy);
 
 	phy_provider = devm_of_phy_provider_register(phy->dev,
 						     of_phy_simple_xlate);
-	if (IS_ERR(phy_provider))
-		return PTR_ERR(phy_provider);
+	if (IS_ERR(phy_provider)) {
+		error = PTR_ERR(phy_provider);
+		goto clk_unprepare;
+	}
 
 	usb_add_phy_dev(&phy->phy);
 
 	return 0;
+
+clk_unprepare:
+	pm_runtime_disable(phy->dev);
+	clk_unprepare(phy->refclk);
+	return error;
 }
 
 static int dm816x_usb_phy_remove(struct platform_device *pdev)
Signature · 1 line
2.30.2
author maintainer
#639 lore raw

PATCH 639/700 extcon: sm5502: Drop invalid register write in sm5502_reg_data

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

[ Upstream commit d25b224f8e5507879b36a769a6d1324cf163466c ]

When sm5502_init_dev_type() iterates over sm5502_reg_data to initialize the registers it is limited by ARRAY_SIZE(sm5502_reg_data). There is no need to add another empty element to sm5502_reg_data.

Having the additional empty element in sm5502_reg_data will just result in writing 0xff to register 0x00, which does not really make sense.

Fixes 914b881f9452 ("extcon: sm5502: Add support new SM5502 extcon device driver")
---
 drivers/extcon/extcon-sm5502.c | 1 -
 1 file changed, 1 deletion(-)
drivers/extcon/extcon-sm5502.c +0 -1
index 106d4da647bd..5e0718dee03b 100644
@@ -88,7 +88,6 @@ static struct reg_data sm5502_reg_data[] = {
 			| SM5502_REG_INTM2_MHL_MASK,
 		.invert = true,
 	},
-	{ }
 };
 
 /* List of detectable cables */
Signature · 1 line
2.30.2
author maintainer
#640 lore raw

PATCH 640/700 extcon: max8997: Add missing modalias string

In reply to Greg Kroah-Hartman

From: Marek Szyprowski <[email protected]>

[ Upstream commit dc11fc2991e9efbceef93912b83e333d2835fb19 ]

The platform device driver name is "max8997-muic", so advertise it properly in the modalias string. This fixes automated module loading when this driver is compiled as a module.

Fixes b76668ba8a77 ("Extcon: add MAX8997 extcon driver")
---
 drivers/extcon/extcon-max8997.c | 1 +
 1 file changed, 1 insertion(+)
drivers/extcon/extcon-max8997.c +1 -0
index 5c4f7746cbee..64008808675e 100644
@@ -784,3 +784,4 @@ module_platform_driver(max8997_muic_driver);
 MODULE_DESCRIPTION("Maxim MAX8997 Extcon driver");
 MODULE_AUTHOR("Donggeun Kim <[email protected]>");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:max8997-muic");
Signature · 1 line
2.30.2
author maintainer
#641 lore raw

PATCH 641/700 powerpc/powernv: Fix machine check reporting of async store errors

In reply to Greg Kroah-Hartman

From: Nicholas Piggin <[email protected]>

[ Upstream commit 3729e0ec59a20825bd4c8c70996b2df63915e1dd ]

POWER9 and POWER10 asynchronous machine checks due to stores have their cause reported in SRR1 but SRR1[42] is set, which in other cases indicates DSISR cause.

Check for these cases and clear SRR1[42], so the cause matching uses the i-side (SRR1) table.

Fixes 7b9f71f974a1 ("powerpc/64s: POWER9 machine check handler")
Fixes 201220bb0e8c ("powerpc/powernv: Machine check handler for POWER10")
---
 arch/powerpc/kernel/mce_power.c | 48 +++++++++++++++++++++++++++------
 1 file changed, 40 insertions(+), 8 deletions(-)
arch/powerpc/kernel/mce_power.c +40 -8
index 667104d4c455..2fff886c549d 100644
@@ -481,12 +481,11 @@ static int mce_find_instr_ea_and_phys(struct pt_regs *regs, uint64_t *addr,
 	return -1;
 }
 
-static int mce_handle_ierror(struct pt_regs *regs,
+static int mce_handle_ierror(struct pt_regs *regs, unsigned long srr1,
 		const struct mce_ierror_table table[],
 		struct mce_error_info *mce_err, uint64_t *addr,
 		uint64_t *phys_addr)
 {
-	uint64_t srr1 = regs->msr;
 	int handled = 0;
 	int i;
 
@@ -695,19 +694,19 @@ static long mce_handle_ue_error(struct pt_regs *regs,
 }
 
 static long mce_handle_error(struct pt_regs *regs,
+		unsigned long srr1,
 		const struct mce_derror_table dtable[],
 		const struct mce_ierror_table itable[])
 {
 	struct mce_error_info mce_err = { 0 };
 	uint64_t addr, phys_addr = ULONG_MAX;
-	uint64_t srr1 = regs->msr;
 	long handled;
 
 	if (SRR1_MC_LOADSTORE(srr1))
 		handled = mce_handle_derror(regs, dtable, &mce_err, &addr,
 				&phys_addr);
 	else
-		handled = mce_handle_ierror(regs, itable, &mce_err, &addr,
+		handled = mce_handle_ierror(regs, srr1, itable, &mce_err, &addr,
 				&phys_addr);
 
 	if (!handled && mce_err.error_type == MCE_ERROR_TYPE_UE)
@@ -723,16 +722,20 @@ long __machine_check_early_realmode_p7(struct pt_regs *regs)
 	/* P7 DD1 leaves top bits of DSISR undefined */
 	regs->dsisr &= 0x0000ffff;
 
-	return mce_handle_error(regs, mce_p7_derror_table, mce_p7_ierror_table);
+	return mce_handle_error(regs, regs->msr,
+			mce_p7_derror_table, mce_p7_ierror_table);
 }
 
 long __machine_check_early_realmode_p8(struct pt_regs *regs)
 {
-	return mce_handle_error(regs, mce_p8_derror_table, mce_p8_ierror_table);
+	return mce_handle_error(regs, regs->msr,
+			mce_p8_derror_table, mce_p8_ierror_table);
 }
 
 long __machine_check_early_realmode_p9(struct pt_regs *regs)
 {
+	unsigned long srr1 = regs->msr;
+
 	/*
 	 * On POWER9 DD2.1 and below, it's possible to get a machine check
 	 * caused by a paste instruction where only DSISR bit 25 is set. This
@@ -746,10 +749,39 @@ long __machine_check_early_realmode_p9(struct pt_regs *regs)
 	if (SRR1_MC_LOADSTORE(regs->msr) && regs->dsisr == 0x02000000)
 		return 1;
 
-	return mce_handle_error(regs, mce_p9_derror_table, mce_p9_ierror_table);
+	/*
+	 * Async machine check due to bad real address from store or foreign
+	 * link time out comes with the load/store bit (PPC bit 42) set in
+	 * SRR1, but the cause comes in SRR1 not DSISR. Clear bit 42 so we're
+	 * directed to the ierror table so it will find the cause (which
+	 * describes it correctly as a store error).
+	 */
+	if (SRR1_MC_LOADSTORE(srr1) &&
+			((srr1 & 0x081c0000) == 0x08140000 ||
+			 (srr1 & 0x081c0000) == 0x08180000)) {
+		srr1 &= ~PPC_BIT(42);
+	}
+
+	return mce_handle_error(regs, srr1,
+			mce_p9_derror_table, mce_p9_ierror_table);
 }
 
 long __machine_check_early_realmode_p10(struct pt_regs *regs)
 {
-	return mce_handle_error(regs, mce_p10_derror_table, mce_p10_ierror_table);
+	unsigned long srr1 = regs->msr;
+
+	/*
+	 * Async machine check due to bad real address from store comes with
+	 * the load/store bit (PPC bit 42) set in SRR1, but the cause comes in
+	 * SRR1 not DSISR. Clear bit 42 so we're directed to the ierror table
+	 * so it will find the cause (which describes it correctly as a store
+	 * error).
+	 */
+	if (SRR1_MC_LOADSTORE(srr1) &&
+			(srr1 & 0x081c0000) == 0x08140000) {
+		srr1 &= ~PPC_BIT(42);
+	}
+
+	return mce_handle_error(regs, srr1,
+			mce_p10_derror_table, mce_p10_ierror_table);
 }
Signature · 1 line
2.30.2
author maintainer
#642 lore raw

PATCH 642/700 ASoC: atmel-i2s: Set symmetric sample bits

In reply to Greg Kroah-Hartman

From: Codrin Ciubotariu <[email protected]>

[ Upstream commit 489a830a25e1730aebf7ff53430c170db9a1771b ]

The I2S needs to have the same sample bits for both capture and playback streams.

Fixes b543e467d1a9 ("ASoC: atmel-i2s: add driver for the new Atmel I2S controller")
---
 sound/soc/atmel/atmel-i2s.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/atmel/atmel-i2s.c +1 -0
index 7c6187e41f2b..e43acb54296b 100644
@@ -542,6 +542,7 @@ static struct snd_soc_dai_driver atmel_i2s_dai = {
 	},
 	.ops = &atmel_i2s_dai_ops,
 	.symmetric_rate = 1,
+	.symmetric_sample_bits = 1,
 };
 
 static const struct snd_soc_component_driver atmel_i2s_component = {
Signature · 1 line
2.30.2
author maintainer
#643 lore raw

PATCH 643/700 ASoC: atmel-i2s: Fix usage of capture and playback at the same time

In reply to Greg Kroah-Hartman

From: Codrin Ciubotariu <[email protected]>

[ Upstream commit 3b7961a326f8a7e03f54a19f02fedae8d488b80f ]

For both capture and playback streams to work at the same time, only the needed values from a register need to be updated. Also, clocks should be enabled only when the first stream is started and stopped when there is no running stream.

Fixes b543e467d1a9 ("ASoC: atmel-i2s: add driver for the new Atmel I2S controller")
---
 sound/soc/atmel/atmel-i2s.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
sound/soc/atmel/atmel-i2s.c +26 -8
index e43acb54296b..a383c6bef8e0 100644
@@ -200,6 +200,7 @@ struct atmel_i2s_dev {
 	unsigned int				fmt;
 	const struct atmel_i2s_gck_param	*gck_param;
 	const struct atmel_i2s_caps		*caps;
+	int					clk_use_no;
 };
 
 static irqreturn_t atmel_i2s_interrupt(int irq, void *dev_id)
@@ -321,9 +322,16 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
 {
 	struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
 	bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
-	unsigned int mr = 0;
+	unsigned int mr = 0, mr_mask;
 	int ret;
 
+	mr_mask = ATMEL_I2SC_MR_FORMAT_MASK | ATMEL_I2SC_MR_MODE_MASK |
+		ATMEL_I2SC_MR_DATALENGTH_MASK;
+	if (is_playback)
+		mr_mask |= ATMEL_I2SC_MR_TXMONO;
+	else
+		mr_mask |= ATMEL_I2SC_MR_RXMONO;
+
 	switch (dev->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		mr |= ATMEL_I2SC_MR_FORMAT_I2S;
@@ -402,7 +410,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	return regmap_write(dev->regmap, ATMEL_I2SC_MR, mr);
+	return regmap_update_bits(dev->regmap, ATMEL_I2SC_MR, mr_mask, mr);
 }
 
 static int atmel_i2s_switch_mck_generator(struct atmel_i2s_dev *dev,
@@ -495,18 +503,28 @@ static int atmel_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 	is_master = (mr & ATMEL_I2SC_MR_MODE_MASK) == ATMEL_I2SC_MR_MODE_MASTER;
 
 	/* If master starts, enable the audio clock. */
-	if (is_master && mck_enabled)
-		err = atmel_i2s_switch_mck_generator(dev, true);
-	if (err)
-		return err;
+	if (is_master && mck_enabled) {
+		if (!dev->clk_use_no) {
+			err = atmel_i2s_switch_mck_generator(dev, true);
+			if (err)
+				return err;
+		}
+		dev->clk_use_no++;
+	}
 
 	err = regmap_write(dev->regmap, ATMEL_I2SC_CR, cr);
 	if (err)
 		return err;
 
 	/* If master stops, disable the audio clock. */
-	if (is_master && !mck_enabled)
-		err = atmel_i2s_switch_mck_generator(dev, false);
+	if (is_master && !mck_enabled) {
+		if (dev->clk_use_no == 1) {
+			err = atmel_i2s_switch_mck_generator(dev, false);
+			if (err)
+				return err;
+		}
+		dev->clk_use_no--;
+	}
 
 	return err;
 }
Signature · 1 line
2.30.2
author maintainer
#644 lore raw

PATCH 644/700 ASoC: fsl_xcvr: disable all interrupts when suspend happens

In reply to Greg Kroah-Hartman

From: Shengjiu Wang <[email protected]>

[ Upstream commit ea837090b388245744988083313f6e9c7c9b9699 ]

There is an unhandled interrupt after suspend, which cause endless interrupt when system resume, so system may hang.

Disable all interrupts in runtime suspend callback to avoid above issue.

Fixes 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver")
---
 sound/soc/fsl/fsl_xcvr.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
sound/soc/fsl/fsl_xcvr.c +10 -0
index 6dd0a5fcd455..070e3f32859f 100644
@@ -1236,6 +1236,16 @@ static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
 	struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
 	int ret;
 
+	/*
+	 * Clear interrupts, when streams starts or resumes after
+	 * suspend, interrupts are enabled in prepare(), so no need
+	 * to enable interrupts in resume().
+	 */
+	ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0,
+				 FSL_XCVR_IRQ_EARC_ALL, 0);
+	if (ret < 0)
+		dev_err(dev, "Failed to clear IER0: %d\n", ret);
+
 	/* Assert M0+ reset */
 	ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
 				 FSL_XCVR_EXT_CTRL_CORE_RESET,
Signature · 1 line
2.30.2
author maintainer
#645 lore raw

PATCH 645/700 configfs: fix memleak in configfs_release_bin_file

In reply to Greg Kroah-Hartman

From: Chung-Chiang Cheng <[email protected]>

[ Upstream commit 3c252b087de08d3cb32468b54a158bd7ad0ae2f7 ]

When reading binary attributes in progress, buffer->bin_buffer is setup in configfs_read_bin_file() but never freed.

Fixes 03607ace807b4 ("configfs: implement binary attributes")
[hch: move the vfree rather than duplicating it]
---
 fs/configfs/file.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
fs/configfs/file.c +5 -5
index da8351d1e455..4d0825213116 100644
@@ -482,13 +482,13 @@ static int configfs_release_bin_file(struct inode *inode, struct file *file)
 					buffer->bin_buffer_size);
 		}
 		up_read(&frag->frag_sem);
-		/* vfree on NULL is safe */
-		vfree(buffer->bin_buffer);
-		buffer->bin_buffer = NULL;
-		buffer->bin_buffer_size = 0;
-		buffer->needs_read_fill = 1;
 	}
 
+	vfree(buffer->bin_buffer);
+	buffer->bin_buffer = NULL;
+	buffer->bin_buffer_size = 0;
+	buffer->needs_read_fill = 1;
+
 	configfs_release(inode, file);
 	return 0;
 }
Signature · 1 line
2.30.2
author maintainer
#646 lore raw

PATCH 646/700 ASoC: Intel: sof_sdw: add SOF_RT715_DAI_ID_FIX for AlderLake

In reply to Greg Kroah-Hartman

From: Libin Yang <[email protected]>

[ Upstream commit 81cd42e5174ba7918edd3d006406ce21ebaa8507 ]

AlderLake needs the flag SOF_RT715_DAI_ID_FIX if it is using the rt715 DMIC.

---
 sound/soc/intel/boards/sof_sdw.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/sof_sdw.c +1 -0
index ecd3f90f4bbe..dfad2ad129ab 100644
@@ -196,6 +196,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 		},
 		.driver_data = (void *)(SOF_RT711_JD_SRC_JD1 |
 					SOF_SDW_TGL_HDMI |
+					SOF_RT715_DAI_ID_FIX |
 					SOF_SDW_PCH_DMIC),
 	},
 	{}
Signature · 1 line
2.30.2
author maintainer
#647 lore raw

PATCH 647/700 ASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload

In reply to Greg Kroah-Hartman

From: Vamshi Krishna Gopal <[email protected]>

[ Upstream commit 03effde3a2ea1d82c4dd6b634fc6174545d2c34f ]

Brya is another ADL-P product.

AlderLake has support for Bluetooth audio offload capability. Enable the BT-offload quirk for ADL-P Brya and the Intel RVP.

---
 sound/soc/intel/boards/sof_sdw.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
sound/soc/intel/boards/sof_sdw.c +15 -1
index dfad2ad129ab..35ad448902c7 100644
@@ -197,7 +197,21 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 		.driver_data = (void *)(SOF_RT711_JD_SRC_JD1 |
 					SOF_SDW_TGL_HDMI |
 					SOF_RT715_DAI_ID_FIX |
-					SOF_SDW_PCH_DMIC),
+					SOF_SDW_PCH_DMIC |
+					SOF_BT_OFFLOAD_SSP(2) |
+					SOF_SSP_BT_OFFLOAD_PRESENT),
+	},
+	{
+		.callback = sof_sdw_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Brya"),
+		},
+		.driver_data = (void *)(SOF_SDW_TGL_HDMI |
+					SOF_SDW_PCH_DMIC |
+					SOF_SDW_FOUR_SPK |
+					SOF_BT_OFFLOAD_SSP(2) |
+					SOF_SSP_BT_OFFLOAD_PRESENT),
 	},
 	{}
 };
Signature · 1 line
2.30.2
author maintainer
#648 lore raw

PATCH 648/700 ASoC: Intel: sof_sdw: use mach data for ADL RVP DMIC count

In reply to Greg Kroah-Hartman

From: Kai Vehmanen <[email protected]>

[ Upstream commit 505351329d26e684588a6919c0407b8a0f5c3813 ]

On the reference boards, number of PCH dmics may vary and the number should be taken from driver machine data. Remove the SOF_SDW_PCH_DMIC quirk to make DMIC number configurable.

Fixes d25bbe80485f8 ("ASoC: Intel: sof_sdw: add quirk for new ADL-P Rvp")
---
 sound/soc/intel/boards/sof_sdw.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/intel/boards/sof_sdw.c +0 -1
index 35ad448902c7..dd93f663803b 100644
@@ -197,7 +197,6 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 		.driver_data = (void *)(SOF_RT711_JD_SRC_JD1 |
 					SOF_SDW_TGL_HDMI |
 					SOF_RT715_DAI_ID_FIX |
-					SOF_SDW_PCH_DMIC |
 					SOF_BT_OFFLOAD_SSP(2) |
 					SOF_SSP_BT_OFFLOAD_PRESENT),
 	},
Signature · 1 line
2.30.2
author maintainer
#649 lore raw

PATCH 649/700 ASoC: fsl_spdif: Fix unexpected interrupt after suspend

In reply to Greg Kroah-Hartman

From: Shengjiu Wang <[email protected]>

[ Upstream commit a7a0a2feb957e446b2bcf732f245ba04fc8b6314 ]

When system enter suspend, the machine driver suspend callback function will be called, then the cpu driver trigger callback (SNDRV_PCM_TRIGGER_SUSPEND) be called, it would disable the interrupt.

But the machine driver suspend and cpu dai driver suspend order maybe changed, the cpu dai driver's suspend callback is called before machine driver's suppend callback, then the interrupt is not cleared successfully in trigger callback.

So need to clear interrupts in cpu dai driver's suspend callback to avoid such issue.

Fixes 9cb2b3796e08 ("ASoC: fsl_spdif: Add pm runtime function")
---
 sound/soc/fsl/fsl_spdif.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/fsl/fsl_spdif.c +3 -0
index e5d366b2a6a4..6d5e9c0acdb4 100644
@@ -1429,6 +1429,9 @@ static int fsl_spdif_runtime_suspend(struct device *dev)
 	struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
 	int i;
 
+	/* Disable all the interrupts */
+	regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SIE, 0xffffff, 0);
+
 	regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC,
 			&spdif_priv->regcache_srpc);
 	regcache_cache_only(spdif_priv->regmap, true);
Signature · 1 line
2.30.2
author maintainer
#650 lore raw

PATCH 650/700 leds: as3645a: Fix error return code in as3645a_parse_node()

In reply to Greg Kroah-Hartman

From: Zhen Lei <[email protected]>

[ Upstream commit 96a30960a2c5246c8ffebe8a3c9031f9df094d97 ]

Return error code -ENODEV rather than '0' when the indicator node can not be found.

Fixes a56ba8fbcb55 ("media: leds: as3645a: Add LED flash class driver")
---
 drivers/leds/leds-as3645a.c | 1 +
 1 file changed, 1 insertion(+)
drivers/leds/leds-as3645a.c +1 -0
index e8922fa03379..80411d41e802 100644
@@ -545,6 +545,7 @@ static int as3645a_parse_node(struct as3645a *flash,
 	if (!flash->indicator_node) {
 		dev_warn(&flash->client->dev,
 			 "can't find indicator node\n");
+		rval = -ENODEV;
 		goto out_err;
 	}
 
Signature · 1 line
2.30.2
author maintainer
#651 lore raw

PATCH 651/700 leds: ktd2692: Fix an error handling path

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit ee78b9360e14c276f5ceaa4a0d06f790f04ccdad ]

In 'ktd2692_parse_dt()', if an error occurs after a successful 'regulator_enable()' call, we should call 'regulator_enable()'.

This is the same in 'ktd2692_probe()', if an error occurs after a successful 'ktd2692_parse_dt()' call.

Instead of adding 'regulator_enable()' in several places, implement a resource managed solution and simplify the remove function accordingly.

Fixes b7da8c5c725c ("leds: Add ktd2692 flash LED driver")
---
 drivers/leds/leds-ktd2692.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/leds/leds-ktd2692.c +18 -9
index 632f10db4b3f..f341da1503a4 100644
@@ -256,6 +256,17 @@ static void ktd2692_setup(struct ktd2692_context *led)
 				 | KTD2692_REG_FLASH_CURRENT_BASE);
 }
 
+static void regulator_disable_action(void *_data)
+{
+	struct device *dev = _data;
+	struct ktd2692_context *led = dev_get_drvdata(dev);
+	int ret;
+
+	ret = regulator_disable(led->regulator);
+	if (ret)
+		dev_err(dev, "Failed to disable supply: %d\n", ret);
+}
+
 static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
 			    struct ktd2692_led_config_data *cfg)
 {
@@ -286,8 +297,14 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
 
 	if (led->regulator) {
 		ret = regulator_enable(led->regulator);
-		if (ret)
+		if (ret) {
 			dev_err(dev, "Failed to enable supply: %d\n", ret);
+		} else {
+			ret = devm_add_action_or_reset(dev,
+						regulator_disable_action, dev);
+			if (ret)
+				return ret;
+		}
 	}
 
 	child_node = of_get_next_available_child(np, NULL);
@@ -377,17 +394,9 @@ static int ktd2692_probe(struct platform_device *pdev)
 static int ktd2692_remove(struct platform_device *pdev)
 {
 	struct ktd2692_context *led = platform_get_drvdata(pdev);
-	int ret;
 
 	led_classdev_flash_unregister(&led->fled_cdev);
 
-	if (led->regulator) {
-		ret = regulator_disable(led->regulator);
-		if (ret)
-			dev_err(&pdev->dev,
-				"Failed to disable supply: %d\n", ret);
-	}
-
 	mutex_destroy(&led->lock);
 
 	return 0;
Signature · 1 line
2.30.2
author maintainer
#652 lore raw

PATCH 652/700 selftests/ftrace: fix event-no-pid on 1-core machine

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 07b60713b57a8f952d029a2b6849d003d9c16108 ]

When running event-no-pid test on small machines (e.g. cloud 1-core instance), other events might not happen:

+ cat trace
+ cnt=0
+ [ 0 -eq 0 ]
+ fail No other events were recorded
[15] event tracing - restricts events based on pid notrace filtering [FAIL]

Schedule a simple sleep task to be sure that some other process events get recorded.

Fixes ebed9628f5c2 ("selftests/ftrace: Add test to test new set_event_notrace_pid file")
---
 .../testing/selftests/ftrace/test.d/event/event-no-pid.tc  | 7 +++++++
 1 file changed, 7 insertions(+)
tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc +7 -0
index e6eb78f0b954..9933ed24f901 100644
@@ -57,6 +57,10 @@ enable_events() {
     echo 1 > tracing_on
 }
 
+other_task() {
+    sleep .001 || usleep 1 || sleep 1
+}
+
 echo 0 > options/event-fork
 
 do_reset
@@ -94,6 +98,9 @@ child=$!
 echo "child = $child"
 wait $child
 
+# Be sure some other events will happen for small systems (e.g. 1 core)
+other_task
+
 echo 0 > tracing_on
 
 cnt=`count_pid $mypid`
Signature · 1 line
2.30.2
author maintainer
#653 lore raw

PATCH 653/700 serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs

In reply to Greg Kroah-Hartman

From: Vignesh Raghavendra <[email protected]>

[ Upstream commit b67e830d38fa9335d927fe67e812e3ed81b4689c ]

On K3 family of SoCs (which includes AM654 SoC), it is observed that RX TIMEOUT is signalled after RX FIFO has been drained, in which case a dummy read of RX FIFO is required to clear RX TIMEOUT condition. Otherwise, this would lead to an interrupt storm.

Fix this by introducing UART_RX_TIMEOUT_QUIRK flag and doing a dummy read in IRQ handler when RX TIMEOUT is reported with no data in RX FIFO.

---
 drivers/tty/serial/8250/8250_omap.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_omap.c +19 -1
index 3161d3655670..c37468887fd2 100644
@@ -43,6 +43,7 @@
 #define UART_ERRATA_CLOCK_DISABLE	(1 << 3)
 #define	UART_HAS_EFR2			BIT(4)
 #define UART_HAS_RHR_IT_DIS		BIT(5)
+#define UART_RX_TIMEOUT_QUIRK		BIT(6)
 
 #define OMAP_UART_FCR_RX_TRIG		6
 #define OMAP_UART_FCR_TX_TRIG		4
@@ -104,6 +105,9 @@
 #define UART_OMAP_EFR2			0x23
 #define UART_OMAP_EFR2_TIMEOUT_BEHAVE	BIT(6)
 
+/* RX FIFO occupancy indicator */
+#define UART_OMAP_RX_LVL		0x64
+
 struct omap8250_priv {
 	int line;
 	u8 habit;
@@ -611,6 +615,7 @@ static int omap_8250_dma_handle_irq(struct uart_port *port);
 static irqreturn_t omap8250_irq(int irq, void *dev_id)
 {
 	struct uart_port *port = dev_id;
+	struct omap8250_priv *priv = port->private_data;
 	struct uart_8250_port *up = up_to_u8250p(port);
 	unsigned int iir;
 	int ret;
@@ -625,6 +630,18 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id)
 	serial8250_rpm_get(up);
 	iir = serial_port_in(port, UART_IIR);
 	ret = serial8250_handle_irq(port, iir);
+
+	/*
+	 * On K3 SoCs, it is observed that RX TIMEOUT is signalled after
+	 * FIFO has been drained, in which case a dummy read of RX FIFO
+	 * is required to clear RX TIMEOUT condition.
+	 */
+	if (priv->habit & UART_RX_TIMEOUT_QUIRK &&
+	    (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT &&
+	    serial_port_in(port, UART_OMAP_RX_LVL) == 0) {
+		serial_port_in(port, UART_RX);
+	}
+
 	serial8250_rpm_put(up);
 
 	return IRQ_RETVAL(ret);
@@ -1218,7 +1235,8 @@ static struct omap8250_dma_params am33xx_dma = {
 
 static struct omap8250_platdata am654_platdata = {
 	.dma_params	= &am654_dma,
-	.habit		= UART_HAS_EFR2 | UART_HAS_RHR_IT_DIS,
+	.habit		= UART_HAS_EFR2 | UART_HAS_RHR_IT_DIS |
+			  UART_RX_TIMEOUT_QUIRK,
 };
 
 static struct omap8250_platdata am33xx_platdata = {
Signature · 1 line
2.30.2
author maintainer
#654 lore raw

PATCH 654/700 powerpc: Offline CPU in stop_this_cpu()

In reply to Greg Kroah-Hartman

From: Nicholas Piggin <[email protected]>

[ Upstream commit bab26238bbd44d5a4687c0a64fd2c7f2755ea937 ]

printk_safe_flush_on_panic() has special lock breaking code for the case where we panic()ed with the console lock held. It relies on panic IPI causing other CPUs to mark themselves offline.

Do as most other architectures do.

This effectively reverts commit de6e5d38417e ("powerpc: smp_send_stop do not offline stopped CPUs"), unfortunately it may result in some false positive warnings, but the alternative is more situations where we can crash without getting messages out.

Fixes de6e5d38417e ("powerpc: smp_send_stop do not offline stopped CPUs")
---
 arch/powerpc/kernel/smp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/powerpc/kernel/smp.c +11 -0
index 1d7daef1c3b6..216919de87d7 100644
@@ -619,6 +619,8 @@ static void nmi_stop_this_cpu(struct pt_regs *regs)
 	/*
 	 * IRQs are already hard disabled by the smp_handle_nmi_ipi.
 	 */
+	set_cpu_online(smp_processor_id(), false);
+
 	spin_begin();
 	while (1)
 		spin_cpu_relax();
@@ -634,6 +636,15 @@ void smp_send_stop(void)
 static void stop_this_cpu(void *dummy)
 {
 	hard_irq_disable();
+
+	/*
+	 * Offlining CPUs in stop_this_cpu can result in scheduler warnings,
+	 * (see commit de6e5d38417e), but printk_safe_flush_on_panic() wants
+	 * to know other CPUs are offline before it breaks locks to flush
+	 * printk buffers, in case we panic()ed while holding the lock.
+	 */
+	set_cpu_online(smp_processor_id(), false);
+
 	spin_begin();
 	while (1)
 		spin_cpu_relax();
Signature · 1 line
2.30.2
author maintainer
#655 lore raw

PATCH 655/700 powerpc/papr_scm: Properly handle UUID types and API

In reply to Greg Kroah-Hartman

From: Andy Shevchenko <[email protected]>

[ Upstream commit 0e8554b5d7801b0aebc6c348a0a9f7706aa17b3b ]

Parse to and export from UUID own type, before dereferencing. This also fixes wrong comment (Little Endian UUID is something else) and should eliminate the direct strict types assignments.

Fixes 43001c52b603 ("powerpc/papr_scm: Use ibm,unit-guid as the iset cookie")
Fixes 259a948c4ba1 ("powerpc/pseries/scm: Use a specific endian format for storing uuid from the device tree")
---
 arch/powerpc/platforms/pseries/papr_scm.c | 27 +++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)
arch/powerpc/platforms/pseries/papr_scm.c +18 -9
index 835163f54244..0693bc8d70ac 100644
@@ -18,6 +18,7 @@
 #include <asm/plpar_wrappers.h>
 #include <asm/papr_pdsm.h>
 #include <asm/mce.h>
+#include <asm/unaligned.h>
 
 #define BIND_ANY_ADDR (~0ul)
 
@@ -1047,8 +1048,9 @@ static int papr_scm_probe(struct platform_device *pdev)
 	u32 drc_index, metadata_size;
 	u64 blocks, block_size;
 	struct papr_scm_priv *p;
+	u8 uuid_raw[UUID_SIZE];
 	const char *uuid_str;
-	u64 uuid[2];
+	uuid_t uuid;
 	int rc;
 
 	/* check we have all the required DT properties */
@@ -1090,16 +1092,23 @@ static int papr_scm_probe(struct platform_device *pdev)
 	p->is_volatile = !of_property_read_bool(dn, "ibm,cache-flush-required");
 
 	/* We just need to ensure that set cookies are unique across */
-	uuid_parse(uuid_str, (uuid_t *) uuid);
+	uuid_parse(uuid_str, &uuid);
+
 	/*
-	 * cookie1 and cookie2 are not really little endian
-	 * we store a little endian representation of the
-	 * uuid str so that we can compare this with the label
-	 * area cookie irrespective of the endian config with which
-	 * the kernel is built.
+	 * The cookie1 and cookie2 are not really little endian.
+	 * We store a raw buffer representation of the
+	 * uuid string so that we can compare this with the label
+	 * area cookie irrespective of the endian configuration
+	 * with which the kernel is built.
+	 *
+	 * Historically we stored the cookie in the below format.
+	 * for a uuid string 72511b67-0b3b-42fd-8d1d-5be3cae8bcaa
+	 *	cookie1 was 0xfd423b0b671b5172
+	 *	cookie2 was 0xaabce8cae35b1d8d
 	 */
-	p->nd_set.cookie1 = cpu_to_le64(uuid[0]);
-	p->nd_set.cookie2 = cpu_to_le64(uuid[1]);
+	export_uuid(uuid_raw, &uuid);
+	p->nd_set.cookie1 = get_unaligned_le64(&uuid_raw[0]);
+	p->nd_set.cookie2 = get_unaligned_le64(&uuid_raw[8]);
 
 	/* might be zero */
 	p->metadata_size = metadata_size;
Signature · 1 line
2.30.2
author maintainer
#656 lore raw

PATCH 656/700 powerpc/64s: Fix copy-paste data exposure into newly created tasks

In reply to Greg Kroah-Hartman

From: Nicholas Piggin <[email protected]>

[ Upstream commit f35d2f249ef05b9671e7898f09ad89aa78f99122 ]

copy-paste contains implicit "copy buffer" state that can contain arbitrary user data (if the user process executes a copy instruction). This could be snooped by another process if a context switch hits while the state is live. So cp_abort is executed on context switch to clear out possible sensitive data and prevent the leak.

cp_abort is done after the low level _switch(), which means it is never reached by newly created tasks, so they could snoop on this buffer between their first and second context switch.

Fix this by doing the cp_abort before calling _switch. Add some comments which should make the issue harder to miss.

Fixes 07d2a628bc000 ("powerpc/64s: Avoid cpabort in context switch when possible")
---
 arch/powerpc/kernel/process.c | 48 +++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 16 deletions(-)
arch/powerpc/kernel/process.c +32 -16
index 3231c2df9e26..03d7261e1492 100644
@@ -1212,6 +1212,19 @@ struct task_struct *__switch_to(struct task_struct *prev,
 			__flush_tlb_pending(batch);
 		batch->active = 0;
 	}
+
+	/*
+	 * On POWER9 the copy-paste buffer can only paste into
+	 * foreign real addresses, so unprivileged processes can not
+	 * see the data or use it in any way unless they have
+	 * foreign real mappings. If the new process has the foreign
+	 * real address mappings, we must issue a cp_abort to clear
+	 * any state and prevent snooping, corruption or a covert
+	 * channel. ISA v3.1 supports paste into local memory.
+	 */
+	if (new->mm && (cpu_has_feature(CPU_FTR_ARCH_31) ||
+			atomic_read(&new->mm->context.vas_windows)))
+		asm volatile(PPC_CP_ABORT);
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
@@ -1257,30 +1270,33 @@ struct task_struct *__switch_to(struct task_struct *prev,
 
 	last = _switch(old_thread, new_thread);
 
+	/*
+	 * Nothing after _switch will be run for newly created tasks,
+	 * because they switch directly to ret_from_fork/ret_from_kernel_thread
+	 * etc. Code added here should have a comment explaining why that is
+	 * okay.
+	 */
+
 #ifdef CONFIG_PPC_BOOK3S_64
+	/*
+	 * This applies to a process that was context switched while inside
+	 * arch_enter_lazy_mmu_mode(), to re-activate the batch that was
+	 * deactivated above, before _switch(). This will never be the case
+	 * for new tasks.
+	 */
 	if (current_thread_info()->local_flags & _TLF_LAZY_MMU) {
 		current_thread_info()->local_flags &= ~_TLF_LAZY_MMU;
 		batch = this_cpu_ptr(&ppc64_tlb_batch);
 		batch->active = 1;
 	}
 
-	if (current->thread.regs) {
+	/*
+	 * Math facilities are masked out of the child MSR in copy_thread.
+	 * A new task does not need to restore_math because it will
+	 * demand fault them.
+	 */
+	if (current->thread.regs)
 		restore_math(current->thread.regs);
-
-		/*
-		 * On POWER9 the copy-paste buffer can only paste into
-		 * foreign real addresses, so unprivileged processes can not
-		 * see the data or use it in any way unless they have
-		 * foreign real mappings. If the new process has the foreign
-		 * real address mappings, we must issue a cp_abort to clear
-		 * any state and prevent snooping, corruption or a covert
-		 * channel. ISA v3.1 supports paste into local memory.
-		 */
-		if (current->mm &&
-			(cpu_has_feature(CPU_FTR_ARCH_31) ||
-			atomic_read(&current->mm->context.vas_windows)))
-			asm volatile(PPC_CP_ABORT);
-	}
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
 	return last;
Signature · 1 line
2.30.2
author maintainer
#657 lore raw

PATCH 657/700 powerpc/papr_scm: Make perf_stats invisible if perf-stats unavailable

In reply to Greg Kroah-Hartman

From: Vaibhav Jain <[email protected]>

[ Upstream commit ed78f56e1271f108e8af61baeba383dcd77adbec ]

In case performance stats for an nvdimm are not available, reading the 'perf_stats' sysfs file returns an -ENOENT error. A better approach is to make the 'perf_stats' file entirely invisible to indicate that performance stats for an nvdimm are unavailable.

So this patch updates 'papr_nd_attribute_group' to add a 'is_visible' callback implemented as newly introduced 'papr_nd_attribute_visible()' that returns an appropriate mode in case performance stats aren't supported in a given nvdimm.

Also the initialization of 'papr_scm_priv.stat_buffer_len' is moved from papr_scm_nvdimm_init() to papr_scm_probe() so that it value is available when 'papr_nd_attribute_visible()' is called during nvdimm initialization.

Even though 'perf_stats' attribute is available since v5.9, there are no known user-space tools/scripts that are dependent on presence of its sysfs file. Hence I dont expect any user-space breakage with this patch.

Fixes 2d02bf835e57 ("powerpc/papr_scm: Fetch nvdimm performance stats from PHYP")
---
 Documentation/ABI/testing/sysfs-bus-papr-pmem |  8 +++--
 arch/powerpc/platforms/pseries/papr_scm.c     | 35 +++++++++++++------
 2 files changed, 29 insertions(+), 14 deletions(-)
Documentation/ABI/testing/sysfs-bus-papr-pmem +5 -3
index 8316c33862a0..0aa02bf2bde5 100644
@@ -39,9 +39,11 @@ KernelVersion:	v5.9
 Contact:	linuxppc-dev <[email protected]>, [email protected],
 Description:
 		(RO) Report various performance stats related to papr-scm NVDIMM
-		device.  Each stat is reported on a new line with each line
-		composed of a stat-identifier followed by it value. Below are
-		currently known dimm performance stats which are reported:
+		device. This attribute is only available for NVDIMM devices
+		that support reporting NVDIMM performance stats. Each stat is
+		reported on a new line with each line composed of a
+		stat-identifier followed by it value. Below are currently known
+		dimm performance stats which are reported:
 
 		* "CtlResCt" : Controller Reset Count
 		* "CtlResTm" : Controller Reset Elapsed Time
arch/powerpc/platforms/pseries/papr_scm.c +24 -11
index 0693bc8d70ac..057acbb9116d 100644
@@ -868,6 +868,20 @@ static ssize_t flags_show(struct device *dev,
 }
 DEVICE_ATTR_RO(flags);
 
+static umode_t papr_nd_attribute_visible(struct kobject *kobj,
+					 struct attribute *attr, int n)
+{
+	struct device *dev = kobj_to_dev(kobj);
+	struct nvdimm *nvdimm = to_nvdimm(dev);
+	struct papr_scm_priv *p = nvdimm_provider_data(nvdimm);
+
+	/* For if perf-stats not available remove perf_stats sysfs */
+	if (attr == &dev_attr_perf_stats.attr && p->stat_buffer_len == 0)
+		return 0;
+
+	return attr->mode;
+}
+
 /* papr_scm specific dimm attributes */
 static struct attribute *papr_nd_attributes[] = {
 	&dev_attr_flags.attr,
@@ -877,6 +891,7 @@ static struct attribute *papr_nd_attributes[] = {
 
 static struct attribute_group papr_nd_attribute_group = {
 	.name = "papr",
+	.is_visible = papr_nd_attribute_visible,
 	.attrs = papr_nd_attributes,
 };
 
@@ -892,7 +907,6 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
 	struct nd_region_desc ndr_desc;
 	unsigned long dimm_flags;
 	int target_nid, online_nid;
-	ssize_t stat_size;
 
 	p->bus_desc.ndctl = papr_scm_ndctl;
 	p->bus_desc.module = THIS_MODULE;
@@ -963,16 +977,6 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
 	list_add_tail(&p->region_list, &papr_nd_regions);
 	mutex_unlock(&papr_ndr_lock);
 
-	/* Try retriving the stat buffer and see if its supported */
-	stat_size = drc_pmem_query_stats(p, NULL, 0);
-	if (stat_size > 0) {
-		p->stat_buffer_len = stat_size;
-		dev_dbg(&p->pdev->dev, "Max perf-stat size %lu-bytes\n",
-			p->stat_buffer_len);
-	} else {
-		dev_info(&p->pdev->dev, "Dimm performance stats unavailable\n");
-	}
-
 	return 0;
 
 err:	nvdimm_bus_unregister(p->bus);
@@ -1050,6 +1054,7 @@ static int papr_scm_probe(struct platform_device *pdev)
 	struct papr_scm_priv *p;
 	u8 uuid_raw[UUID_SIZE];
 	const char *uuid_str;
+	ssize_t stat_size;
 	uuid_t uuid;
 	int rc;
 
@@ -1133,6 +1138,14 @@ static int papr_scm_probe(struct platform_device *pdev)
 	p->res.name  = pdev->name;
 	p->res.flags = IORESOURCE_MEM;
 
+	/* Try retrieving the stat buffer and see if its supported */
+	stat_size = drc_pmem_query_stats(p, NULL, 0);
+	if (stat_size > 0) {
+		p->stat_buffer_len = stat_size;
+		dev_dbg(&p->pdev->dev, "Max perf-stat size %lu-bytes\n",
+			p->stat_buffer_len);
+	}
+
 	rc = papr_scm_nvdimm_init(p);
 	if (rc)
 		goto err2;
Signature · 1 line
2.30.2
author maintainer
#658 lore raw

PATCH 658/700 powerpc: Fix is_kvm_guest() / kvm_para_available()

In reply to Greg Kroah-Hartman

From: Michael Ellerman <[email protected]>

[ Upstream commit 95839225639ba7c3d8d7231b542728dcf222bf2d ]

Commit a21d1becaa3f ("powerpc: Reintroduce is_kvm_guest() as a fast-path check") added is_kvm_guest() and changed kvm_para_available() to use it.

is_kvm_guest() checks a static key, kvm_guest, and that static key is set in check_kvm_guest().

The problem is check_kvm_guest() is only called on pseries, and even then only in some configurations. That means is_kvm_guest() always returns false on all non-pseries and some pseries depending on configuration. That's a bug.

For PR KVM guests this is noticable because they no longer do live patching of themselves, which can be detected by the omission of a message in dmesg such as:

KVM: Live patching for a fast VM worked

To fix it make check_kvm_guest() an initcall, to ensure it's always called at boot. It needs to be core so that it runs before kvm_guest_init() which is postcore. To be an initcall it needs to return int, where 0 means success, so update that.

We still call it manually in pSeries_smp_probe(), because that runs before init calls are run.

Fixes a21d1becaa3f ("powerpc: Reintroduce is_kvm_guest() as a fast-path check")
---
 arch/powerpc/include/asm/kvm_guest.h |  4 ++--
 arch/powerpc/kernel/firmware.c       | 10 ++++++----
 arch/powerpc/platforms/pseries/smp.c |  4 +++-
 3 files changed, 11 insertions(+), 7 deletions(-)
arch/powerpc/include/asm/kvm_guest.h +2 -2
index 2fca299f7e19..c63105d2c9e7 100644
@@ -16,10 +16,10 @@ static inline bool is_kvm_guest(void)
 	return static_branch_unlikely(&kvm_guest);
 }
 
-bool check_kvm_guest(void);
+int check_kvm_guest(void);
 #else
 static inline bool is_kvm_guest(void) { return false; }
-static inline bool check_kvm_guest(void) { return false; }
+static inline int check_kvm_guest(void) { return 0; }
 #endif
 
 #endif /* _ASM_POWERPC_KVM_GUEST_H_ */
arch/powerpc/kernel/firmware.c +6 -4
index c9e2819b095a..c7022c41cc31 100644
@@ -23,18 +23,20 @@ EXPORT_SYMBOL_GPL(powerpc_firmware_features);
 
 #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
 DEFINE_STATIC_KEY_FALSE(kvm_guest);
-bool check_kvm_guest(void)
+int __init check_kvm_guest(void)
 {
 	struct device_node *hyper_node;
 
 	hyper_node = of_find_node_by_path("/hypervisor");
 	if (!hyper_node)
-		return false;
+		return 0;
 
 	if (!of_device_is_compatible(hyper_node, "linux,kvm"))
-		return false;
+		return 0;
 
 	static_branch_enable(&kvm_guest);
-	return true;
+
+	return 0;
 }
+core_initcall(check_kvm_guest); // before kvm_guest_init()
 #endif
arch/powerpc/platforms/pseries/smp.c +3 -1
index c70b4be9f0a5..096629f54576 100644
@@ -211,7 +211,9 @@ static __init void pSeries_smp_probe(void)
 	if (!cpu_has_feature(CPU_FTR_SMT))
 		return;
 
-	if (check_kvm_guest()) {
+	check_kvm_guest();
+
+	if (is_kvm_guest()) {
 		/*
 		 * KVM emulates doorbells by disabling FSCR[MSGP] so msgsndp
 		 * faults to the hypervisor which then reads the instruction
Signature · 1 line
2.30.2
author maintainer
#659 lore raw

PATCH 659/700 ALSA: firewire-lib: Fix amdtp_domain_start() when no AMDTP_OUT_STREAM stream is found

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 0cbbeaf370221fc469c95945dd3c1198865c5fe4 ]

The intent here is to return an error code if we don't find what we are looking for in the 'list_for_each_entry()' loop.

's' is not NULL if the list is empty or if we scan the complete list. Introduce a new 'found' variable to handle such cases.

---
 sound/firewire/amdtp-stream.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/firewire/amdtp-stream.c +5 -2
index 5805c5de39fb..7a282d8e7148 100644
@@ -1404,14 +1404,17 @@ int amdtp_domain_start(struct amdtp_domain *d, unsigned int ir_delay_cycle)
 	unsigned int queue_size;
 	struct amdtp_stream *s;
 	int cycle;
+	bool found = false;
 	int err;
 
 	// Select an IT context as IRQ target.
 	list_for_each_entry(s, &d->streams, list) {
-		if (s->direction == AMDTP_OUT_STREAM)
+		if (s->direction == AMDTP_OUT_STREAM) {
+			found = true;
 			break;
+		}
 	}
-	if (!s)
+	if (!found)
 		return -ENXIO;
 	d->irq_target = s;
 
Signature · 1 line
2.30.2
author maintainer
#660 lore raw

PATCH 660/700 serial: mvebu-uart: do not allow changing baudrate when uartclk is not available

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

[ Upstream commit ecd6b010d81f97b06b2f64d2d4f50ebf5acddaa9 ]

Testing mvuart->clk for non-error is not enough as mvuart->clk may contain valid clk pointer but when clk_prepare_enable(mvuart->clk) failed then port->uartclk is zero.

When mvuart->clk is not available then port->uartclk is zero too.

Parent clock rate port->uartclk is needed to calculate UART clock divisor and without it is not possible to change baudrate.

So fix test condition when it is possible to change baudrate.

Fixes 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
---
 drivers/tty/serial/mvebu-uart.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/mvebu-uart.c +2 -3
index 908a4ac6b5a7..9638ae6aae79 100644
@@ -445,12 +445,11 @@ static void mvebu_uart_shutdown(struct uart_port *port)
 
 static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud)
 {
-	struct mvebu_uart *mvuart = to_mvuart(port);
 	unsigned int d_divisor, m_divisor;
 	u32 brdv, osamp;
 
-	if (IS_ERR(mvuart->clk))
-		return -PTR_ERR(mvuart->clk);
+	if (!port->uartclk)
+		return -EOPNOTSUPP;
 
 	/*
 	 * The baudrate is derived from the UART clock thanks to two divisors:
Signature · 1 line
2.30.2
author maintainer
#661 lore raw

PATCH 661/700 serial: mvebu-uart: correctly calculate minimal possible baudrate

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

[ Upstream commit deeaf963569a0d9d1b08babb771f61bb501a5704 ]

For default (x16) scheme which is currently used by mvebu-uart.c driver, maximal divisor of UART base clock is 1023*16. Therefore there is limit for minimal supported baudrate. This change calculate it correctly and prevents setting invalid divisor 0 into hardware registers.

Fixes 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
---
 drivers/tty/serial/mvebu-uart.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/tty/serial/mvebu-uart.c +8 -3
index 9638ae6aae79..1e26220c7852 100644
@@ -481,7 +481,7 @@ static void mvebu_uart_set_termios(struct uart_port *port,
 				   struct ktermios *old)
 {
 	unsigned long flags;
-	unsigned int baud;
+	unsigned int baud, min_baud, max_baud;
 
 	spin_lock_irqsave(&port->lock, flags);
 
@@ -500,16 +500,21 @@ static void mvebu_uart_set_termios(struct uart_port *port,
 		port->ignore_status_mask |= STAT_RX_RDY(port) | STAT_BRK_ERR;
 
 	/*
+	 * Maximal divisor is 1023 * 16 when using default (x16) scheme.
 	 * Maximum achievable frequency with simple baudrate divisor is 230400.
 	 * Since the error per bit frame would be of more than 15%, achieving
 	 * higher frequencies would require to implement the fractional divisor
 	 * feature.
 	 */
-	baud = uart_get_baud_rate(port, termios, old, 0, 230400);
+	min_baud = DIV_ROUND_UP(port->uartclk, 1023 * 16);
+	max_baud = 230400;
+
+	baud = uart_get_baud_rate(port, termios, old, min_baud, max_baud);
 	if (mvebu_uart_baud_rate_set(port, baud)) {
 		/* No clock available, baudrate cannot be changed */
 		if (old)
-			baud = uart_get_baud_rate(port, old, NULL, 0, 230400);
+			baud = uart_get_baud_rate(port, old, NULL,
+						  min_baud, max_baud);
 	} else {
 		tty_termios_encode_baud_rate(termios, baud, baud);
 		uart_update_timeout(port, termios->c_cflag, baud);
Signature · 1 line
2.30.2
author maintainer
#662 lore raw

PATCH 662/700 arm64: dts: marvell: armada-37xx: Fix reg for standard variant of UART

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

[ Upstream commit 2cbfdedef39fb5994b8f1e1df068eb8440165975 ]

UART1 (standard variant with DT node name 'uart0') has register space 0x12000-0x12018 and not whole size 0x200. So fix also this in example.

Fixes c737abc193d1 ("arm64: dts: marvell: Fix A37xx UART0 register size")
---
 arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/marvell/armada-37xx.dtsi +1 -1
index 456dcd4a7793..6ffbb099fcac 100644
@@ -134,7 +134,7 @@
 
 			uart0: serial@12000 {
 				compatible = "marvell,armada-3700-uart";
-				reg = <0x12000 0x200>;
+				reg = <0x12000 0x18>;
 				clocks = <&xtalclk>;
 				interrupts =
 				<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.30.2
author maintainer
#663 lore raw

PATCH 663/700 powerpc/64s/interrupt: preserve regs->softe for NMI interrupts

In reply to Greg Kroah-Hartman

From: Nicholas Piggin <[email protected]>

[ Upstream commit 1b0482229c302a3c6afd00d6b3bf0169cf279b44 ]

If an NMI interrupt hits in an implicit soft-masked region, regs->softe is modified to reflect that. This may not be necessary for correctness at the moment, but it is less surprising and it's unhelpful when debugging or adding checks.

Make sure this is changed back to how it was found before returning.

Fixes 4ec5feec1ad0 ("powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled")
---
 arch/powerpc/include/asm/interrupt.h | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/include/asm/interrupt.h +3 -0
index 31ed5356590a..6d15728f0680 100644
@@ -120,6 +120,7 @@ struct interrupt_nmi_state {
 	u8 irq_happened;
 #endif
 	u8 ftrace_enabled;
+	u64 softe;
 #endif
 };
 
@@ -129,6 +130,7 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
 #ifdef CONFIG_PPC_BOOK3S_64
 	state->irq_soft_mask = local_paca->irq_soft_mask;
 	state->irq_happened = local_paca->irq_happened;
+	state->softe = regs->softe;
 
 	/*
 	 * Set IRQS_ALL_DISABLED unconditionally so irqs_disabled() does
@@ -178,6 +180,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
 #ifdef CONFIG_PPC_BOOK3S_64
 	/* Check we didn't change the pending interrupt mask. */
 	WARN_ON_ONCE((state->irq_happened | PACA_IRQ_HARD_DIS) != local_paca->irq_happened);
+	regs->softe = state->softe;
 	local_paca->irq_happened = state->irq_happened;
 	local_paca->irq_soft_mask = state->irq_soft_mask;
 #endif
Signature · 1 line
2.30.2
author maintainer
#664 lore raw

PATCH 664/700 vfio/pci: Handle concurrent vma faults

In reply to Greg Kroah-Hartman

From: Alex Williamson <[email protected]>

[ Upstream commit 6a45ece4c9af473555f01f0f8b97eba56e3c7d0d ]

io_remap_pfn_range() will trigger a BUG_ON if it encounters a populated pte within the mapping range. This can occur because we map the entire vma on fault and multiple faults can be blocked behind the vma_lock. This leads to traces like the one reported below.

We can use our vma_list to test whether a given vma is mapped to avoid this issue.

[ 1591.733256] kernel BUG at mm/memory.c:2177!
[ 1591.739515] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 1591.747381] Modules linked in: vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O)
[ 1591.760536] CPU: 2 PID: 227 Comm: lcore-worker-2 Tainted: G O 5.11.0-rc3+ #1
[ 1591.770735] Hardware name:  , BIOS HixxxxFPGA 1P B600 V121-1
[ 1591.778872] pstate: 40400009 (nZcv daif +PAN -UAO -TCO BTYPE=--)
[ 1591.786134] pc : remap_pfn_range+0x214/0x340
[ 1591.793564] lr : remap_pfn_range+0x1b8/0x340
[ 1591.799117] sp : ffff80001068bbd0
[ 1591.803476] x29: ffff80001068bbd0 x28: 0000042eff6f0000
[ 1591.810404] x27: 0000001100910000 x26: 0000001300910000
[ 1591.817457] x25: 0068000000000fd3 x24: ffffa92f1338e358
[ 1591.825144] x23: 0000001140000000 x22: 0000000000000041
[ 1591.832506] x21: 0000001300910000 x20: ffffa92f141a4000
[ 1591.839520] x19: 0000001100a00000 x18: 0000000000000000
[ 1591.846108] x17: 0000000000000000 x16: ffffa92f11844540
[ 1591.853570] x15: 0000000000000000 x14: 0000000000000000
[ 1591.860768] x13: fffffc0000000000 x12: 0000000000000880
[ 1591.868053] x11: ffff0821bf3d01d0 x10: ffff5ef2abd89000
[ 1591.875932] x9 : ffffa92f12ab0064 x8 : ffffa92f136471c0
[ 1591.883208] x7 : 0000001140910000 x6 : 0000000200000000
[ 1591.890177] x5 : 0000000000000001 x4 : 0000000000000001
[ 1591.896656] x3 : 0000000000000000 x2 : 0168044000000fd3
[ 1591.903215] x1 : ffff082126261880 x0 : fffffc2084989868
[ 1591.910234] Call trace:
[ 1591.914837]  remap_pfn_range+0x214/0x340
[ 1591.921765]  vfio_pci_mmap_fault+0xac/0x130 [vfio_pci]
[ 1591.931200]  __do_fault+0x44/0x12c
[ 1591.937031]  handle_mm_fault+0xcc8/0x1230
[ 1591.942475]  do_page_fault+0x16c/0x484
[ 1591.948635]  do_translation_fault+0xbc/0xd8
[ 1591.954171]  do_mem_abort+0x4c/0xc0
[ 1591.960316]  el0_da+0x40/0x80
[ 1591.965585]  el0_sync_handler+0x168/0x1b0
[ 1591.971608]  el0_sync+0x174/0x180
[ 1591.978312] Code: eb1b027f 540000c0 f9400022 b4fffe02 (d4210000)
---
 drivers/vfio/pci/vfio_pci.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)
drivers/vfio/pci/vfio_pci.c +21 -8
index cb7f2dc09e9d..94b1dc07baee 100644
@@ -1612,6 +1612,7 @@ static vm_fault_t vfio_pci_mmap_fault(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	struct vfio_pci_device *vdev = vma->vm_private_data;
+	struct vfio_pci_mmap_vma *mmap_vma;
 	vm_fault_t ret = VM_FAULT_NOPAGE;
 
 	mutex_lock(&vdev->vma_lock);
@@ -1619,24 +1620,36 @@ static vm_fault_t vfio_pci_mmap_fault(struct vm_fault *vmf)
 
 	if (!__vfio_pci_memory_enabled(vdev)) {
 		ret = VM_FAULT_SIGBUS;
-		mutex_unlock(&vdev->vma_lock);
 		goto up_out;
 	}
 
-	if (__vfio_pci_add_vma(vdev, vma)) {
-		ret = VM_FAULT_OOM;
-		mutex_unlock(&vdev->vma_lock);
-		goto up_out;
+	/*
+	 * We populate the whole vma on fault, so we need to test whether
+	 * the vma has already been mapped, such as for concurrent faults
+	 * to the same vma.  io_remap_pfn_range() will trigger a BUG_ON if
+	 * we ask it to fill the same range again.
+	 */
+	list_for_each_entry(mmap_vma, &vdev->vma_list, vma_next) {
+		if (mmap_vma->vma == vma)
+			goto up_out;
 	}
 
-	mutex_unlock(&vdev->vma_lock);
-
 	if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
-			       vma->vm_end - vma->vm_start, vma->vm_page_prot))
+			       vma->vm_end - vma->vm_start,
+			       vma->vm_page_prot)) {
 		ret = VM_FAULT_SIGBUS;
+		zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start);
+		goto up_out;
+	}
+
+	if (__vfio_pci_add_vma(vdev, vma)) {
+		ret = VM_FAULT_OOM;
+		zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start);
+	}
 
 up_out:
 	up_read(&vdev->memory_lock);
+	mutex_unlock(&vdev->vma_lock);
 	return ret;
 }
 
Signature · 1 line
2.30.2
author maintainer
#665 lore raw

PATCH 665/700 mm/huge_memory.c: remove dedicated macro HPAGE_CACHE_INDEX_MASK

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit b2bd53f18bb7f7cfc91b3bb527d7809376700a8e ]

Patch series "Cleanup and fixup for huge_memory:, v3.

This series contains cleanups to remove dedicated macro and remove unnecessary tlb_remove_page_size() for huge zero pmd. Also this adds missing read-only THP checking for transparent_hugepage_enabled() and avoids discarding hugepage if other processes are mapping it. More details can be found in the respective changelogs.

Thi patch (of 5):

Rewrite the pgoff checking logic to remove macro HPAGE_CACHE_INDEX_MASK which is only used here to simplify the code.

---
 include/linux/huge_mm.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/huge_mm.h +2 -4
index 6686a0baa91d..2a7c58ea5ca9 100644
@@ -155,15 +155,13 @@ static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma)
 
 bool transparent_hugepage_enabled(struct vm_area_struct *vma);
 
-#define HPAGE_CACHE_INDEX_MASK (HPAGE_PMD_NR - 1)
-
 static inline bool transhuge_vma_suitable(struct vm_area_struct *vma,
 		unsigned long haddr)
 {
 	/* Don't have to check pgoff for anonymous vma */
 	if (!vma_is_anonymous(vma)) {
-		if (((vma->vm_start >> PAGE_SHIFT) & HPAGE_CACHE_INDEX_MASK) !=
-			(vma->vm_pgoff & HPAGE_CACHE_INDEX_MASK))
+		if (!IS_ALIGNED((vma->vm_start >> PAGE_SHIFT) - vma->vm_pgoff,
+				HPAGE_PMD_NR))
 			return false;
 	}
 
Signature · 1 line
2.30.2
author maintainer
#666 lore raw

PATCH 666/700 mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled()

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit e6be37b2e7bddfe0c76585ee7c7eee5acc8efeab ]

Since commit 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS"), read-only THP file mapping is supported. But it forgot to add checking for it in transparent_hugepage_enabled(). To fix it, we add checking for read-only THP file mapping and also introduce helper transhuge_vma_enabled() to check whether thp is enabled for specified vma to reduce duplicated code. We rename transparent_hugepage_enabled to transparent_hugepage_active to make the code easier to follow as suggested by David Hildenbrand.

[[email protected]: define transhuge_vma_enabled next to transhuge_vma_suitable]
Fixes 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS")
Cc Alexey Dobriyan <[email protected]>
Cc "Aneesh Kumar K . V" <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Song Liu <[email protected]>
Cc William Kucharski <[email protected]>
Cc Zi Yan <[email protected]>
Cc Mike Kravetz <[email protected]>
---
 fs/proc/task_mmu.c      |  2 +-
 include/linux/huge_mm.h | 57 +++++++++++++++++++++++++----------------
 mm/huge_memory.c        | 11 +++++++-
 mm/khugepaged.c         |  4 +--
 mm/shmem.c              |  3 +--
 5 files changed, 48 insertions(+), 29 deletions(-)
fs/proc/task_mmu.c +1 -1
index e862cab69583..a3f27ccec742 100644
@@ -829,7 +829,7 @@ static int show_smap(struct seq_file *m, void *v)
 	__show_smap(m, &mss, false);
 
 	seq_printf(m, "THPeligible:    %d\n",
-		   transparent_hugepage_enabled(vma));
+		   transparent_hugepage_active(vma));
 
 	if (arch_pkeys_enabled())
 		seq_printf(m, "ProtectionKey:  %8u\n", vma_pkey(vma));
include/linux/huge_mm.h +35 -22

94 lines not on this page · raw message

mm/huge_memory.c +10 -1
index 44c455dbbd63..3120b6952f0d 100644
@@ -63,7 +63,14 @@ static atomic_t huge_zero_refcount;
 struct page *huge_zero_page __read_mostly;
 unsigned long huge_zero_pfn __read_mostly = ~0UL;
 
-bool transparent_hugepage_enabled(struct vm_area_struct *vma)
+static inline bool file_thp_enabled(struct vm_area_struct *vma)
+{
+	return transhuge_vma_enabled(vma, vma->vm_flags) && vma->vm_file &&
+	       !inode_is_open_for_write(vma->vm_file->f_inode) &&
+	       (vma->vm_flags & VM_EXEC);
+}
+
+bool transparent_hugepage_active(struct vm_area_struct *vma)
 {
 	/* The addr is used to check if the vma size fits */
 	unsigned long addr = (vma->vm_end & HPAGE_PMD_MASK) - HPAGE_PMD_SIZE;
@@ -74,6 +81,8 @@ bool transparent_hugepage_enabled(struct vm_area_struct *vma)
 		return __transparent_hugepage_enabled(vma);
 	if (vma_is_shmem(vma))
 		return shmem_huge_enabled(vma);
+	if (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS))
+		return file_thp_enabled(vma);
 
 	return false;
 }
mm/khugepaged.c +1 -3
index 2680d5ffee7f..1259efcd94ca 100644
@@ -442,9 +442,7 @@ static inline int khugepaged_test_exit(struct mm_struct *mm)
 static bool hugepage_vma_check(struct vm_area_struct *vma,
 			       unsigned long vm_flags)
 {
-	/* Explicitly disabled through madvise. */
-	if ((vm_flags & VM_NOHUGEPAGE) ||
-	    test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))
+	if (!transhuge_vma_enabled(vma, vm_flags))
 		return false;
 
 	/* Enabled via shmem mount options or sysfs settings. */
mm/shmem.c +1 -2
index 1a03744240e7..3c39116fd071 100644
@@ -4037,8 +4037,7 @@ bool shmem_huge_enabled(struct vm_area_struct *vma)
 	loff_t i_size;
 	pgoff_t off;
 
-	if ((vma->vm_flags & VM_NOHUGEPAGE) ||
-	    test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))
+	if (!transhuge_vma_enabled(vma, vma->vm_flags))
 		return false;
 	if (shmem_huge == SHMEM_HUGE_FORCE)
 		return true;
Signature · 1 line
2.30.2
author maintainer
#667 lore raw

PATCH 667/700 mm/huge_memory.c: dont discard hugepage if other processes are mapping it

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit babbbdd08af98a59089334eb3effbed5a7a0cf7f ]

If other processes are mapping any other subpages of the hugepage, i.e. in pte-mapped thp case, page_mapcount() will return 1 incorrectly. Then we would discard the page while other processes are still mapping it. Fix it by using total_mapcount() which can tell whether other processes are still mapping it.

Fixes b8d3c4c3009d ("mm/huge_memory.c: don't split THP page when MADV_FREE syscall is called")
Cc Alexey Dobriyan <[email protected]>
Cc "Aneesh Kumar K . V" <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Song Liu <[email protected]>
Cc William Kucharski <[email protected]>
Cc Zi Yan <[email protected]>
Cc Mike Kravetz <[email protected]>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/huge_memory.c +1 -1
index 3120b6952f0d..bc642923e0c9 100644
@@ -1615,7 +1615,7 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
 	 * If other processes are mapping this page, we couldn't discard
 	 * the page unless they all do MADV_FREE so let's skip the page.
 	 */
-	if (page_mapcount(page) != 1)
+	if (total_mapcount(page) != 1)
 		goto out;
 
 	if (!trylock_page(page))
Signature · 1 line
2.30.2
author maintainer
#668 lore raw

PATCH 668/700 hugetlb: remove prep_compound_huge_page cleanup

In reply to Greg Kroah-Hartman

From: Mike Kravetz <[email protected]>

[ Upstream commit 48b8d744ea841b8adf8d07bfe7a2d55f22e4d179 ]

Patch series "Fix prep_compound_gigantic_page ref count adjustment".

These patches address the possible race between prep_compound_gigantic_page and __page_cache_add_speculative as described by Jann Horn in [1].

The first patch simply removes the unnecessary/obsolete helper routine prep_compound_huge_page to make the actual fix a little simpler.

The second patch is the actual fix and has a detailed explanation in the commit message.

This potential issue has existed for almost 10 years and I am unaware of anyone actually hitting the race. I did not cc stable, but would be happy to squash the patches and send to stable if anyone thinks that is a good idea.

[1] https://lore.kernel.org/linux-mm/CAG48ez23q0Jy9cuVnwAe7t_fdhMk2S7N5Hdi-GLcCeq5bsfLxw@mail.gmail.com/

This patch (of 2):

I could not think of a reliable way to recreate the issue for testing. Rather, I 'simulated errors' to exercise all the error paths.

The routine prep_compound_huge_page is a simple wrapper to call either prep_compound_gigantic_page or prep_compound_page. However, it is only called from gather_bootmem_prealloc which only processes gigantic pages. Eliminate the routine and call prep_compound_gigantic_page directly.

---
 mm/hugetlb.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)
mm/hugetlb.c +10 -19
index 7ba7d9b20494..dbf44b92651b 100644
@@ -1313,8 +1313,6 @@ static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
 	return alloc_contig_pages(nr_pages, gfp_mask, nid, nodemask);
 }
 
-static void prep_new_huge_page(struct hstate *h, struct page *page, int nid);
-static void prep_compound_gigantic_page(struct page *page, unsigned int order);
 #else /* !CONFIG_CONTIG_ALLOC */
 static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
 					int nid, nodemask_t *nodemask)
@@ -2504,16 +2502,10 @@ found:
 	return 1;
 }
 
-static void __init prep_compound_huge_page(struct page *page,
-		unsigned int order)
-{
-	if (unlikely(order > (MAX_ORDER - 1)))
-		prep_compound_gigantic_page(page, order);
-	else
-		prep_compound_page(page, order);
-}
-
-/* Put bootmem huge pages into the standard lists after mem_map is up */
+/*
+ * Put bootmem huge pages into the standard lists after mem_map is up.
+ * Note: This only applies to gigantic (order > MAX_ORDER) pages.
+ */
 static void __init gather_bootmem_prealloc(void)
 {
 	struct huge_bootmem_page *m;
@@ -2522,20 +2514,19 @@ static void __init gather_bootmem_prealloc(void)
 		struct page *page = virt_to_page(m);
 		struct hstate *h = m->hstate;
 
+		VM_BUG_ON(!hstate_is_gigantic(h));
 		WARN_ON(page_count(page) != 1);
-		prep_compound_huge_page(page, huge_page_order(h));
+		prep_compound_gigantic_page(page, huge_page_order(h));
 		WARN_ON(PageReserved(page));
 		prep_new_huge_page(h, page, page_to_nid(page));
 		put_page(page); /* free it into the hugepage allocator */
 
 		/*
-		 * If we had gigantic hugepages allocated at boot time, we need
-		 * to restore the 'stolen' pages to totalram_pages in order to
-		 * fix confusing memory reports from free(1) and another
-		 * side-effects, like CommitLimit going negative.
+		 * We need to restore the 'stolen' pages to totalram_pages
+		 * in order to fix confusing memory reports from free(1) and
+		 * other side-effects, like CommitLimit going negative.
 		 */
-		if (hstate_is_gigantic(h))
-			adjust_managed_page_count(page, pages_per_huge_page(h));
+		adjust_managed_page_count(page, pages_per_huge_page(h));
 		cond_resched();
 	}
 }
Signature · 1 line
2.30.2
author maintainer
#669 lore raw

PATCH 669/700 hugetlb: address ref count racing in prep_compound_gigantic_page

In reply to Greg Kroah-Hartman

From: Mike Kravetz <[email protected]>

[ Upstream commit 7118fc2906e2925d7edb5ed9c8a57f2a5f23b849 ]

In [1], Jann Horn points out a possible race between prep_compound_gigantic_page and __page_cache_add_speculative. The root cause of the possible race is prep_compound_gigantic_page uncondittionally setting the ref count of pages to zero. It does this because prep_compound_gigantic_page is handed a 'group' of pages from an allocator and needs to convert that group of pages to a compound page. The ref count of each page in this 'group' is one as set by the allocator. However, the ref count of compound page tail pages must be zero.

The potential race comes about when ref counted pages are returned from the allocator. When this happens, other mm code could also take a reference on the page. __page_cache_add_speculative is one such example. Therefore, prep_compound_gigantic_page can not just set the ref count of pages to zero as it does today. Doing so would lose the reference taken by any other code. This would lead to BUGs in code checking ref counts and could possibly even lead to memory corruption.

There are two possible ways to address this issue.

1) Make all allocators of gigantic groups of pages be able to return a properly constructed compound page.

2) Make prep_compound_gigantic_page be more careful when constructing a compound page.

This patch takes approach 2.

In prep_compound_gigantic_page, use cmpxchg to only set ref count to zero if it is one. If the cmpxchg fails, call synchronize_rcu() in the hope that the extra ref count will be driopped during a rcu grace period. This is not a performance critical code path and the wait should be accceptable. If the ref count is still inflated after the grace period, then undo any modifications made and return an error.

Currently prep_compound_gigantic_page is type void and does not return errors. Modify the two callers to check for and handle error returns. On error, the caller must free the 'group' of pages as they can not be used to form a gigantic page. After freeing pages, the runtime caller (alloc_fresh_huge_page) will retry the allocation once. Boot time allocations can not be retried.

The routine prep_compound_page also unconditionally sets the ref count of compound page tail pages to zero. However, in this case the buddy allocator is constructing a compound page from freshly allocated pages. The ref count on those freshly allocated pages is already zero, so the set_page_count(p, 0) is unnecessary and could lead to confusion. Just remove it.

[1] https://lore.kernel.org/linux-mm/CAG48ez23q0Jy9cuVnwAe7t_fdhMk2S7N5Hdi-GLcCeq5bsfLxw@mail.gmail.com/

Fixes 58a84aa92723 ("thp: set compound tail page _count to zero")
Cc Youquan Song <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Jan Kara <[email protected]>
Cc John Hubbard <[email protected]>
Cc "Kirill A . Shutemov" <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Muchun Song <[email protected]>
---
 mm/hugetlb.c    | 72 +++++++++++++++++++++++++++++++++++++++++++------
 mm/page_alloc.c |  1 -
 2 files changed, 64 insertions(+), 9 deletions(-)
mm/hugetlb.c +64 -8
index dbf44b92651b..9fdcad652c34 100644
@@ -1504,9 +1504,9 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid)
 	spin_unlock(&hugetlb_lock);
 }
 
-static void prep_compound_gigantic_page(struct page *page, unsigned int order)
+static bool prep_compound_gigantic_page(struct page *page, unsigned int order)
 {
-	int i;
+	int i, j;
 	int nr_pages = 1 << order;
 	struct page *p = page + 1;
 
@@ -1528,11 +1528,48 @@ static void prep_compound_gigantic_page(struct page *page, unsigned int order)
 		 * after get_user_pages().
 		 */
 		__ClearPageReserved(p);
+		/*
+		 * Subtle and very unlikely
+		 *
+		 * Gigantic 'page allocators' such as memblock or cma will
+		 * return a set of pages with each page ref counted.  We need
+		 * to turn this set of pages into a compound page with tail
+		 * page ref counts set to zero.  Code such as speculative page
+		 * cache adding could take a ref on a 'to be' tail page.
+		 * We need to respect any increased ref count, and only set
+		 * the ref count to zero if count is currently 1.  If count
+		 * is not 1, we call synchronize_rcu in the hope that a rcu
+		 * grace period will cause ref count to drop and then retry.
+		 * If count is still inflated on retry we return an error and
+		 * must discard the pages.
+		 */
+		if (!page_ref_freeze(p, 1)) {
+			pr_info("HugeTLB unexpected inflated ref count on freshly allocated page\n");
+			synchronize_rcu();
+			if (!page_ref_freeze(p, 1))
+				goto out_error;
+		}
 		set_page_count(p, 0);
 		set_compound_head(p, page);
 	}
 	atomic_set(compound_mapcount_ptr(page), -1);
 	atomic_set(compound_pincount_ptr(page), 0);
+	return true;
+
+out_error:
+	/* undo tail page modifications made above */
+	p = page + 1;
+	for (j = 1; j < i; j++, p = mem_map_next(p, page, j)) {
+		clear_compound_head(p);
+		set_page_refcounted(p);
+	}
+	/* need to clear PG_reserved on remaining tail pages  */
+	for (; j < nr_pages; j++, p = mem_map_next(p, page, j))
+		__ClearPageReserved(p);
+	set_compound_order(page, 0);
+	page[1].compound_nr = 0;
+	__ClearPageHead(page);
+	return false;
 }
 
 /*
@@ -1652,7 +1689,9 @@ static struct page *alloc_fresh_huge_page(struct hstate *h,
 		nodemask_t *node_alloc_noretry)
 {
 	struct page *page;
+	bool retry = false;
 
+retry:
 	if (hstate_is_gigantic(h))
 		page = alloc_gigantic_page(h, gfp_mask, nid, nmask);
 	else
@@ -1661,8 +1700,21 @@ static struct page *alloc_fresh_huge_page(struct hstate *h,
 	if (!page)
 		return NULL;
 
-	if (hstate_is_gigantic(h))
-		prep_compound_gigantic_page(page, huge_page_order(h));
+	if (hstate_is_gigantic(h)) {
+		if (!prep_compound_gigantic_page(page, huge_page_order(h))) {
+			/*
+			 * Rare failure to convert pages to compound page.
+			 * Free pages and try again - ONCE!
+			 */
+			free_gigantic_page(page, huge_page_order(h));
+			if (!retry) {
+				retry = true;
+				goto retry;
+			}
+			pr_warn("HugeTLB page can not be used due to unexpected inflated ref count\n");
+			return NULL;
+		}
+	}
 	prep_new_huge_page(h, page, page_to_nid(page));
 
 	return page;
@@ -2516,10 +2568,14 @@ static void __init gather_bootmem_prealloc(void)
 
 		VM_BUG_ON(!hstate_is_gigantic(h));
 		WARN_ON(page_count(page) != 1);
-		prep_compound_gigantic_page(page, huge_page_order(h));
-		WARN_ON(PageReserved(page));
-		prep_new_huge_page(h, page, page_to_nid(page));
-		put_page(page); /* free it into the hugepage allocator */
+		if (prep_compound_gigantic_page(page, huge_page_order(h))) {
+			WARN_ON(PageReserved(page));
+			prep_new_huge_page(h, page, page_to_nid(page));
+			put_page(page); /* add to the hugepage allocator */
+		} else {
+			free_gigantic_page(page, huge_page_order(h));
+			pr_warn("HugeTLB page can not be used due to unexpected inflated ref count\n");
+		}
 
 		/*
 		 * We need to restore the 'stolen' pages to totalram_pages
mm/page_alloc.c +0 -1
index 382af5377274..fe9b8975e69d 100644
@@ -676,7 +676,6 @@ void prep_compound_page(struct page *page, unsigned int order)
 	__SetPageHead(page);
 	for (i = 1; i < nr_pages; i++) {
 		struct page *p = page + i;
-		set_page_count(p, 0);
 		p->mapping = TAIL_MAPPING;
 		set_compound_head(p, page);
 	}
Signature · 1 line
2.30.2
#670 lore raw

Re: [PATCH 5.12 669/700] hugetlb: address ref count racing in prep_compound_gigantic_page

Quoted 4 lines · Greg Kroah-Hartman

From: Mike Kravetz <[email protected]>

[ Upstream commit 7118fc2906e2925d7edb5ed9c8a57f2a5f23b849 ]

Please do not add or the requisite patch to stable tree.

Although this is a real potential issue, it was only found during code inspection. It has existed for more than 10 years and I am unaware of anyone hitting this in actual use. In addition, this proposed fix will likely be updated/simplified based on more discussions.

Signature · 1 line
Mike Kravetz
author maintainer
#671 lore raw

PATCH 670/700 mm/z3fold: fix potential memory leak in z3fold_destroy_pool()

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit dac0d1cfda56472378d330b1b76b9973557a7b1d ]

There is a memory leak in z3fold_destroy_pool() as it forgets to free_percpu pool->unbuddied. Call free_percpu for pool->unbuddied to fix this issue.

---
 mm/z3fold.c | 1 +
 1 file changed, 1 insertion(+)
mm/z3fold.c +1 -0
index 9d889ad2bb86..56a5551f2ba8 100644
@@ -1059,6 +1059,7 @@ static void z3fold_destroy_pool(struct z3fold_pool *pool)
 	destroy_workqueue(pool->compact_wq);
 	destroy_workqueue(pool->release_wq);
 	z3fold_unregister_migration(pool);
+	free_percpu(pool->unbuddied);
 	kfree(pool);
 }
 
Signature · 1 line
2.30.2
author maintainer
#672 lore raw

PATCH 671/700 mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit 28473d91ff7f686d58047ff55f2fa98ab59114a4 ]

We should use release_z3fold_page_locked() to release z3fold page when it's locked, although it looks harmless to use release_z3fold_page() now.

Fixes dcf5aedb24f8 ("z3fold: stricter locking and more careful reclaim")
Cc Hillf Danton <[email protected]>
---
 mm/z3fold.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/z3fold.c +1 -1
index 56a5551f2ba8..7c417fb8404a 100644
@@ -1383,7 +1383,7 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
 			if (zhdr->foreign_handles ||
 			    test_and_set_bit(PAGE_CLAIMED, &page->private)) {
 				if (kref_put(&zhdr->refcount,
-						release_z3fold_page))
+						release_z3fold_page_locked))
 					atomic64_dec(&pool->pages_nr);
 				else
 					z3fold_page_unlock(zhdr);
Signature · 1 line
2.30.2
author maintainer
#673 lore raw

PATCH 672/700 mm: migrate: fix missing update page_private to hugetlb_page_subpool

In reply to Greg Kroah-Hartman

From: Muchun Song <[email protected]>

[ Upstream commit 6acfb5ba150cf75005ce85e0e25d79ef2fec287c ]

Since commit d6995da31122 ("hugetlb: use page.private for hugetlb specific page flags") converts page.private for hugetlb specific page flags. We should use hugetlb_page_subpool() to get the subpool pointer instead of page_private().

This 'could' prevent the migration of hugetlb pages. page_private(hpage) is now used for hugetlb page specific flags. At migration time, the only flag which could be set is HPageVmemmapOptimized. This flag will only be set if the new vmemmap reduction feature is enabled. In addition, !page_mapping() implies an anonymous mapping. So, this will prevent migration of hugetb pages in anonymous mappings if the vmemmap reduction feature is enabled.

In addition, that if statement checked for the rare race condition of a page being migrated while in the process of being freed. Since that check is now wrong, we could leak hugetlb subpool usage counts.

The commit forgot to update it in the page migration routine. So fix it.

[[email protected]: fix compiler error when !CONFIG_HUGETLB_PAGE reported by Randy]
---
 include/linux/hugetlb.h | 5 +++++
 mm/migrate.c            | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
include/linux/hugetlb.h +5 -0
index 28fa3f9bbbfd..7bbef3f195ae 100644
@@ -862,6 +862,11 @@ static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
 #else	/* CONFIG_HUGETLB_PAGE */
 struct hstate {};
 
+static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage)
+{
+	return NULL;
+}
+
 static inline struct page *alloc_huge_page(struct vm_area_struct *vma,
 					   unsigned long addr,
 					   int avoid_reserve)
mm/migrate.c +1 -1
index 40455e753c5b..3138600cf435 100644
@@ -1315,7 +1315,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
 	 * page_mapping() set, hugetlbfs specific move page routine will not
 	 * be called and we could leak usage counts for subpools.
 	 */
-	if (page_private(hpage) && !page_mapping(hpage)) {
+	if (hugetlb_page_subpool(hpage) && !page_mapping(hpage)) {
 		rc = -EBUSY;
 		goto out_unlock;
 	}
Signature · 1 line
2.30.2
author maintainer
#674 lore raw

PATCH 673/700 mm/zswap.c: fix two bugs in zswap_writeback_entry()

In reply to Greg Kroah-Hartman

From: Miaohe Lin <[email protected]>

[ Upstream commit 46b76f2e09dc35f70aca2f4349eb0d158f53fe93 ]

In the ZSWAP_SWAPCACHE_FAIL and ZSWAP_SWAPCACHE_EXIST case, we forgot to call zpool_unmap_handle() when zpool can't sleep. And we might sleep in zswap_get_swap_cache_page() while zpool can't sleep. To fix all of these, zpool_unmap_handle() should be done before zswap_get_swap_cache_page() when zpool can't sleep.

Fixes fc6697a89f56 ("mm/zswap: add the flag can_sleep_mapped")
Cc Colin Ian King <[email protected]>
Cc Dan Streetman <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Seth Jennings <[email protected]>
Cc Tian Tao <[email protected]>
Cc Vitaly Wool <[email protected]>
---
 mm/zswap.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
mm/zswap.c +7 -10
index 578d9f256920..91f7439fde7f 100644
@@ -967,6 +967,13 @@ static int zswap_writeback_entry(struct zpool *pool, unsigned long handle)
 	spin_unlock(&tree->lock);
 	BUG_ON(offset != entry->offset);
 
+	src = (u8 *)zhdr + sizeof(struct zswap_header);
+	if (!zpool_can_sleep_mapped(pool)) {
+		memcpy(tmp, src, entry->length);
+		src = tmp;
+		zpool_unmap_handle(pool, handle);
+	}
+
 	/* try to allocate swap cache page */
 	switch (zswap_get_swap_cache_page(swpentry, &page)) {
 	case ZSWAP_SWAPCACHE_FAIL: /* no memory or invalidate happened */
@@ -982,17 +989,7 @@ static int zswap_writeback_entry(struct zpool *pool, unsigned long handle)
 	case ZSWAP_SWAPCACHE_NEW: /* page is locked */
 		/* decompress */
 		acomp_ctx = raw_cpu_ptr(entry->pool->acomp_ctx);
-
 		dlen = PAGE_SIZE;
-		src = (u8 *)zhdr + sizeof(struct zswap_header);
-
-		if (!zpool_can_sleep_mapped(pool)) {
-
-			memcpy(tmp, src, entry->length);
-			src = tmp;
-
-			zpool_unmap_handle(pool, handle);
-		}
 
 		mutex_lock(acomp_ctx->mutex);
 		sg_init_one(&input, src, entry->length);
Signature · 1 line
2.30.2
author maintainer
#675 lore raw

PATCH 674/700 lib/math/rational.c: fix divide by zero

In reply to Greg Kroah-Hartman

From: Trent Piepho <[email protected]>

[ Upstream commit 65a0d3c14685663ba111038a35db70f559e39336 ]

If the input is out of the range of the allowed values, either larger than the largest value or closer to zero than the smallest non-zero allowed value, then a division by zero would occur.

In the case of input too large, the division by zero will occur on the first iteration. The best result (largest allowed value) will be found by always choosing the semi-convergent and excluding the denominator based limit when finding it.

In the case of the input too small, the division by zero will occur on the second iteration. The numerator based semi-convergent should not be calculated to avoid the division by zero. But the semi-convergent vs previous convergent test is still needed, which effectively chooses between 0 (the previous convergent) vs the smallest allowed fraction (best semi-convergent) as the result.

Fixes 323dd2c3ed0 ("lib/math/rational.c: fix possible incorrect result from rational fractions helper")
Cc Oskar Schirmer <[email protected]>
Cc Daniel Latypov <[email protected]>
---
 lib/math/rational.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
lib/math/rational.c +11 -5
index 9781d521963d..c0ab51d8fbb9 100644
@@ -12,6 +12,7 @@
 #include <linux/compiler.h>
 #include <linux/export.h>
 #include <linux/minmax.h>
+#include <linux/limits.h>
 
 /*
  * calculate best rational approximation for a given fraction
@@ -78,13 +79,18 @@ void rational_best_approximation(
 		 * found below as 't'.
 		 */
 		if ((n2 > max_numerator) || (d2 > max_denominator)) {
-			unsigned long t = min((max_numerator - n0) / n1,
-					      (max_denominator - d0) / d1);
+			unsigned long t = ULONG_MAX;
 
-			/* This tests if the semi-convergent is closer
-			 * than the previous convergent.
+			if (d1)
+				t = (max_denominator - d0) / d1;
+			if (n1)
+				t = min(t, (max_numerator - n0) / n1);
+
+			/* This tests if the semi-convergent is closer than the previous
+			 * convergent.  If d1 is zero there is no previous convergent as this
+			 * is the 1st iteration, so always choose the semi-convergent.
 			 */
-			if (2u * t > a || (2u * t == a && d0 * dp > d1 * d)) {
+			if (!d1 || 2u * t > a || (2u * t == a && d0 * dp > d1 * d)) {
 				n1 = n0 + t * n1;
 				d1 = d0 + t * d1;
 			}
Signature · 1 line
2.30.2
author maintainer
#676 lore raw

PATCH 675/700 selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random

In reply to Greg Kroah-Hartman

From: Dave Hansen <[email protected]>

[ Upstream commit f36ef407628835a7d7fb3d235b1f1aac7022d9a3 ]

Patch series "selftests/vm/pkeys: Bug fixes and a new test".

There has been a lot of activity on the x86 front around the XSAVE architecture which is used to context-switch processor state (among other things). In addition, AMD has recently joined the protection keys club by adding processor support for PKU.

The AMD implementation helped uncover a kernel bug around the PKRU "init state", which actually applied to Intel's implementation but was just harder to hit. This series adds a test which is expected to help find this class of bug both on AMD and Intel. All the work around pkeys on x86 also uncovered a few bugs in the selftest.

This patch (of 4):

The "random" pkey allocation code currently does the good old:

	srand((unsigned int)time(NULL));

*But*, it unfortunately does this on every random pkey allocation.

There may be thousands of these a second. time() has a one second resolution. So, each time alloc_random_pkey() is called, the PRNG is *RESET* to time(). This is nasty. Normally, if you do:

	srand(<ANYTHING>);
	foo = rand();
	bar = rand();

You'll be quite guaranteed that 'foo' and 'bar' are different. But, if you do:

	srand(1);
	foo = rand();
	srand(1);
	bar = rand();

You are quite guaranteed that 'foo' and 'bar' are the *SAME*. The recent "fix" effectively forced the test case to use the same "random" pkey for the whole test, unless the test run crossed a second boundary.

Only run srand() once at program startup.

This explains some very odd and persistent test failures I've been seeing.

Fixes 6e373263ce07 ("selftests/vm/pkeys: fix alloc_random_pkey() to make it really random")
Cc Ram Pai <[email protected]>
Cc Sandipan Das <[email protected]>
Cc Florian Weimer <[email protected]>
Cc "Desnes A. Nunes do Rosario" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thiago Jung Bauermann <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Michal Suchanek <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/testing/selftests/vm/protection_keys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/vm/protection_keys.c +2 -1
index fdbb602ecf32..9ee0ae5d3e06 100644
@@ -561,7 +561,6 @@ int alloc_random_pkey(void)
 	int nr_alloced = 0;
 	int random_index;
 	memset(alloced_pkeys, 0, sizeof(alloced_pkeys));
-	srand((unsigned int)time(NULL));
 
 	/* allocate every possible key and make a note of which ones we got */
 	max_nr_pkey_allocs = NR_PKEYS;
@@ -1552,6 +1551,8 @@ int main(void)
 	int nr_iterations = 22;
 	int pkeys_supported = is_pkeys_supported();
 
+	srand((unsigned int)time(NULL));
+
 	setup_handlers();
 
 	printf("has pkeys: %d\n", pkeys_supported);
Signature · 1 line
2.30.2
author maintainer
#677 lore raw

PATCH 676/700 selftests/vm/pkeys: handle negative sys_pkey_alloc() return code

In reply to Greg Kroah-Hartman

From: Dave Hansen <[email protected]>

[ Upstream commit bf68294a2ec39ed7fec6a5b45d52034e6983157a ]

The alloc_pkey() sefltest function wraps the sys_pkey_alloc() system call. On success, it updates its "shadow" register value because sys_pkey_alloc() updates the real register.

But, the success check is wrong. pkey_alloc() considers any non-zero return code to indicate success where the pkey register will be modified. This fails to take negative return codes into account.

Consider only a positive return value as a successful call.

Fixes 5f23f6d082a9 ("x86/pkeys: Add self-tests")
Cc Ram Pai <[email protected]>
Cc Sandipan Das <[email protected]>
Cc Florian Weimer <[email protected]>
Cc "Desnes A. Nunes do Rosario" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thiago Jung Bauermann <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Michal Suchanek <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/testing/selftests/vm/protection_keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/protection_keys.c +1 -1
index 9ee0ae5d3e06..356d62fca27f 100644
@@ -510,7 +510,7 @@ int alloc_pkey(void)
 			" shadow: 0x%016llx\n",
 			__func__, __LINE__, ret, __read_pkey_reg(),
 			shadow_pkey_reg);
-	if (ret) {
+	if (ret > 0) {
 		/* clear both the bits: */
 		shadow_pkey_reg = set_pkey_bits(shadow_pkey_reg, ret,
 						~PKEY_MASK);
Signature · 1 line
2.30.2
author maintainer
#678 lore raw

PATCH 677/700 selftests/vm/pkeys: refill shadow register after implicit kernel write

In reply to Greg Kroah-Hartman

From: Dave Hansen <[email protected]>

[ Upstream commit 6039ca254979694c5362dfebadd105e286c397bb ]

The pkey test code keeps a "shadow" of the pkey register around. This ensures that any bugs which might write to the register can be caught more quickly.

Generally, userspace has a good idea when the kernel is going to write to the register. For instance, alloc_pkey() is passed a permission mask. The caller of alloc_pkey() can update the shadow based on the return value and the mask.

But, the kernel can also modify the pkey register in a more sneaky way. For mprotect(PROT_EXEC) mappings, the kernel will allocate a pkey and write the pkey register to create an execute-only mapping. The kernel never tells userspace what key it uses for this.

This can cause the test to fail with messages like:

	protection_keys_64.2: pkey-helpers.h:132: _read_pkey_reg: Assertion `pkey_reg == shadow_pkey_reg' failed.

because the shadow was not updated with the new kernel-set value.

Forcibly update the shadow value immediately after an mprotect().

Fixes 6af17cf89e99 ("x86/pkeys/selftests: Add PROT_EXEC test")
Cc Ram Pai <[email protected]>
Cc Sandipan Das <[email protected]>
Cc Florian Weimer <[email protected]>
Cc "Desnes A. Nunes do Rosario" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thiago Jung Bauermann <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Michal Suchanek <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/testing/selftests/vm/protection_keys.c | 7 +++++++
 1 file changed, 7 insertions(+)
tools/testing/selftests/vm/protection_keys.c +7 -0
index 356d62fca27f..87eecd5ba577 100644
@@ -1448,6 +1448,13 @@ void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey)
 	ret = mprotect(p1, PAGE_SIZE, PROT_EXEC);
 	pkey_assert(!ret);
 
+	/*
+	 * Reset the shadow, assuming that the above mprotect()
+	 * correctly changed PKRU, but to an unknown value since
+	 * the actual alllocated pkey is unknown.
+	 */
+	shadow_pkey_reg = __read_pkey_reg();
+
 	dprintf2("pkey_reg: %016llx\n", read_pkey_reg());
 
 	/* Make sure this is an *instruction* fault */
Signature · 1 line
2.30.2
author maintainer
#679 lore raw

PATCH 678/700 perf llvm: Return -ENOMEM when asprintf() fails

In reply to Greg Kroah-Hartman

From: Arnaldo Carvalho de Melo <[email protected]>

[ Upstream commit c435c166dcf526ac827bc964d82cc0d5e7a1fd0b ]

Zhihao sent a patch but it made llvm__compile_bpf() return what asprintf() returns on error, which is just -1, but since this function returns -errno, fix it by returning -ENOMEM for this case instead.

Fixes cb76371441d098 ("perf llvm: Allow passing options to llc ...")
Fixes 5eab5a7ee032ac ("perf llvm: Display eBPF compiling command ...")
Cc Alexei Starovoitov <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Daniel Borkmann <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Yu Kuai <[email protected]>
---
 tools/perf/util/llvm-utils.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/llvm-utils.c +2 -0
index dbdffb6673fe..0bf6b4d4c90a 100644
@@ -504,6 +504,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
 			goto errout;
 		}
 
+		err = -ENOMEM;
 		if (asprintf(&pipe_template, "%s -emit-llvm | %s -march=bpf %s -filetype=obj -o -",
 			      template, llc_path, opts) < 0) {
 			pr_err("ERROR:\tnot enough memory to setup command line\n");
@@ -524,6 +525,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
 
 	pr_debug("llvm compiling command template: %s\n", template);
 
+	err = -ENOMEM;
 	if (asprintf(&command_echo, "echo -n \"%s\"", template) < 0)
 		goto errout;
 
Signature · 1 line
2.30.2
author maintainer
#680 lore raw

PATCH 679/700 csky: fix syscache.c fallthrough warning

In reply to Greg Kroah-Hartman

From: Randy Dunlap <[email protected]>

[ Upstream commit 0679d29d3e2351a1c3049c26a63ce1959cad5447 ]

This case of the switch statement falls through to the following case. This appears to be on purpose, so declare it as OK.

../arch/csky/mm/syscache.c: In function '__do_sys_cacheflush':
../arch/csky/mm/syscache.c:17:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

   17 |   flush_icache_mm_range(current->mm,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   18 |     (unsigned long)addr,
      |     ~~~~~~~~~~~~~~~~~~~~
   19 |     (unsigned long)addr + bytes);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../arch/csky/mm/syscache.c:20:2: note: here
   20 |  case DCACHE:
      |  ^~~~
Fixes 997153b9a75c ("csky: Add flush_icache_mm to defer flush icache all")
Cc Arnd Bergmann <[email protected]>
---
 arch/csky/mm/syscache.c | 1 +
 1 file changed, 1 insertion(+)
arch/csky/mm/syscache.c +1 -0
index ffade2f9a4c8..4e51d63850c4 100644
@@ -17,6 +17,7 @@ SYSCALL_DEFINE3(cacheflush,
 		flush_icache_mm_range(current->mm,
 				(unsigned long)addr,
 				(unsigned long)addr + bytes);
+		fallthrough;
 	case DCACHE:
 		dcache_wb_range((unsigned long)addr,
 				(unsigned long)addr + bytes);
Signature · 1 line
2.30.2
author maintainer
#681 lore raw

PATCH 680/700 csky: syscache: Fixup duplicate cache flush

In reply to Greg Kroah-Hartman

From: Guo Ren <[email protected]>

[ Upstream commit 6ea42c84f33368eb3fe1ec1bff8d7cb1a5c7b07a ]

The current csky logic of sys_cacheflush is wrong, it'll cause icache flush call dcache flush again. Now fixup it with a conditional "break & fallthrough".

Fixes 997153b9a75c ("csky: Add flush_icache_mm to defer flush icache all")
Fixes 0679d29d3e23 ("csky: fix syscache.c fallthrough warning")
Cc Arnd Bergmann <[email protected]>
---
 arch/csky/mm/syscache.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
arch/csky/mm/syscache.c +7 -5
index 4e51d63850c4..cd847ad62c7e 100644
@@ -12,15 +12,17 @@ SYSCALL_DEFINE3(cacheflush,
 		int, cache)
 {
 	switch (cache) {
-	case ICACHE:
 	case BCACHE:
-		flush_icache_mm_range(current->mm,
-				(unsigned long)addr,
-				(unsigned long)addr + bytes);
-		fallthrough;
 	case DCACHE:
 		dcache_wb_range((unsigned long)addr,
 				(unsigned long)addr + bytes);
+		if (cache != BCACHE)
+			break;
+		fallthrough;
+	case ICACHE:
+		flush_icache_mm_range(current->mm,
+				(unsigned long)addr,
+				(unsigned long)addr + bytes);
 		break;
 	default:
 		return -EINVAL;
Signature · 1 line
2.30.2
author maintainer
#682 lore raw

PATCH 681/700 exfat: handle wrong stream entry size in exfat_readdir()

In reply to Greg Kroah-Hartman

From: Namjae Jeon <[email protected]>

commit 1e5654de0f51890f88abd409ebf4867782431e81 upstream.

The compatibility issue between linux exfat and exfat of some camera company was reported from Florian. In their exfat, if the number of files exceeds any limit, the DataLength in stream entry of the directory is no longer updated. So some files created from camera does not show in linux exfat. because linux exfat doesn't allow that cpos becomes larger than DataLength of stream entry. This patch check DataLength in stream entry only if the type is ALLOC_NO_FAT_CHAIN and add the check ensure that dentry offset does not exceed max dentries size(256 MB) to avoid the circular FAT chain issue.

Fixes ca06197382bd ("exfat: add directory operations")
---
 fs/exfat/dir.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
fs/exfat/dir.c +5 -3
@@ -62,7 +62,7 @@ static void exfat_get_uniname_from_ext_e
 static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_entry *dir_entry)
 {
 	int i, dentries_per_clu, dentries_per_clu_bits = 0, num_ext;
-	unsigned int type, clu_offset;
+	unsigned int type, clu_offset, max_dentries;
 	sector_t sector;
 	struct exfat_chain dir, clu;
 	struct exfat_uni_name uni_name;
@@ -85,6 +85,8 @@ static int exfat_readdir(struct inode *i
 
 	dentries_per_clu = sbi->dentries_per_clu;
 	dentries_per_clu_bits = ilog2(dentries_per_clu);
+	max_dentries = (unsigned int)min_t(u64, MAX_EXFAT_DENTRIES,
+					   (u64)sbi->num_clusters << dentries_per_clu_bits);
 
 	clu_offset = dentry >> dentries_per_clu_bits;
 	exfat_chain_dup(&clu, &dir);
@@ -108,7 +110,7 @@ static int exfat_readdir(struct inode *i
 		}
 	}
 
-	while (clu.dir != EXFAT_EOF_CLUSTER) {
+	while (clu.dir != EXFAT_EOF_CLUSTER && dentry < max_dentries) {
 		i = dentry & (dentries_per_clu - 1);
 
 		for ( ; i < dentries_per_clu; i++, dentry++) {
@@ -244,7 +246,7 @@ static int exfat_iterate(struct file *fi
 	if (err)
 		goto unlock;
 get_new:
-	if (cpos >= i_size_read(inode))
+	if (ei->flags == ALLOC_NO_FAT_CHAIN && cpos >= i_size_read(inode))
 		goto end_of_dir;
 
 	err = exfat_readdir(inode, &cpos, &de);
author maintainer
#683 lore raw

PATCH 682/700 scsi: megaraid_sas: Send all non-RW I/Os for TYPE_ENCLOSURE device through firmware

In reply to Greg Kroah-Hartman

From: Chandrakanth Patil <[email protected]>

commit 79db830162b733f5f3ee80f0673eeeb0245fe38b upstream.

The driver issues all non-ReadWrite I/Os for TYPE_ENCLOSURE devices through the fast path with invalid dev handle. Fast path in turn directs all the I/Os to the firmware. As firmware stopped handling those I/Os from SAS3.5 generation of controllers (Ventura generation and onwards) this will lead to I/O failures.

Switch the driver to issue all the non-ReadWrite I/Os for TYPE_ENCLOSURE devices directly to firmware for SAS3.5 generation of controllers and later.

---
 drivers/scsi/megaraid/megaraid_sas_fusion.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +8 -2
@@ -3167,6 +3167,8 @@ megasas_build_io_fusion(struct megasas_i
 {
 	int sge_count;
 	u8  cmd_type;
+	u16 pd_index = 0;
+	u8 drive_type = 0;
 	struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
 	struct MR_PRIV_DEVICE *mr_device_priv_data;
 	mr_device_priv_data = scp->device->hostdata;
@@ -3201,8 +3203,12 @@ megasas_build_io_fusion(struct megasas_i
 		megasas_build_syspd_fusion(instance, scp, cmd, true);
 		break;
 	case NON_READ_WRITE_SYSPDIO:
-		if (instance->secure_jbod_support ||
-		    mr_device_priv_data->is_tm_capable)
+		pd_index = MEGASAS_PD_INDEX(scp);
+		drive_type = instance->pd_list[pd_index].driveType;
+		if ((instance->secure_jbod_support ||
+		     mr_device_priv_data->is_tm_capable) ||
+		     (instance->adapter_type >= VENTURA_SERIES &&
+		     drive_type == TYPE_ENCLOSURE))
 			megasas_build_syspd_fusion(instance, scp, cmd, false);
 		else
 			megasas_build_syspd_fusion(instance, scp, cmd, true);
author maintainer
#684 lore raw

PATCH 683/700 scsi: fc: Correct RHBA attributes length

In reply to Greg Kroah-Hartman

From: Javed Hasan <[email protected]>

commit 40445fd2c9fa427297acdfcc2c573ff10493f209 upstream.

As per the FC-GS-5 specification, attribute lengths of node_name and manufacturer should in range of "4 to 64 Bytes" only.

Fixes e721eb0616f6 ("scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions")
---
 include/scsi/fc/fc_ms.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/scsi/fc/fc_ms.h +2 -2
@@ -63,8 +63,8 @@ enum fc_fdmi_hba_attr_type {
  * HBA Attribute Length
  */
 #define FC_FDMI_HBA_ATTR_NODENAME_LEN		8
-#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN	80
-#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN	80
+#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN	64
+#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN	64
 #define FC_FDMI_HBA_ATTR_MODEL_LEN		256
 #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN		256
 #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN	256
author maintainer
#685 lore raw

PATCH 684/700 scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd()

In reply to Greg Kroah-Hartman

From: Varun Prakash <[email protected]>

commit 6ecdafaec79d4b3388a5b017245f23a0ff9d852d upstream.

Instead of calling dma_unmap_sg() after completing WRITE I/O, call dma_unmap_sg() before calling target_execute_cmd() to sync the DMA buffer.

---
 drivers/target/iscsi/cxgbit/cxgbit_ddp.c    |   19 ++++++++++---------
 drivers/target/iscsi/cxgbit/cxgbit_target.c |   21 ++++++++++++++++++---
 2 files changed, 28 insertions(+), 12 deletions(-)
drivers/target/iscsi/cxgbit/cxgbit_ddp.c +10 -9
@@ -265,12 +265,13 @@ void cxgbit_unmap_cmd(struct iscsi_conn
 	struct cxgbit_cmd *ccmd = iscsit_priv_cmd(cmd);
 
 	if (ccmd->release) {
-		struct cxgbi_task_tag_info *ttinfo = &ccmd->ttinfo;
-
-		if (ttinfo->sgl) {
+		if (cmd->se_cmd.se_cmd_flags & SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC) {
+			put_page(sg_page(&ccmd->sg));
+		} else {
 			struct cxgbit_sock *csk = conn->context;
 			struct cxgbit_device *cdev = csk->com.cdev;
 			struct cxgbi_ppm *ppm = cdev2ppm(cdev);
+			struct cxgbi_task_tag_info *ttinfo = &ccmd->ttinfo;
 
 			/* Abort the TCP conn if DDP is not complete to
 			 * avoid any possibility of DDP after freeing
@@ -280,14 +281,14 @@ void cxgbit_unmap_cmd(struct iscsi_conn
 				     cmd->se_cmd.data_length))
 				cxgbit_abort_conn(csk);
 
+			if (unlikely(ttinfo->sgl)) {
+				dma_unmap_sg(&ppm->pdev->dev, ttinfo->sgl,
+					     ttinfo->nents, DMA_FROM_DEVICE);
+				ttinfo->nents = 0;
+				ttinfo->sgl = NULL;
+			}
 			cxgbi_ppm_ppod_release(ppm, ttinfo->idx);
-
-			dma_unmap_sg(&ppm->pdev->dev, ttinfo->sgl,
-				     ttinfo->nents, DMA_FROM_DEVICE);
-		} else {
-			put_page(sg_page(&ccmd->sg));
 		}
-
 		ccmd->release = false;
 	}
 }
drivers/target/iscsi/cxgbit/cxgbit_target.c +18 -3
@@ -997,17 +997,18 @@ static int cxgbit_handle_iscsi_dataout(s
 	struct scatterlist *sg_start;
 	struct iscsi_conn *conn = csk->conn;
 	struct iscsi_cmd *cmd = NULL;
+	struct cxgbit_cmd *ccmd;
+	struct cxgbi_task_tag_info *ttinfo;
 	struct cxgbit_lro_pdu_cb *pdu_cb = cxgbit_rx_pdu_cb(csk->skb);
 	struct iscsi_data *hdr = (struct iscsi_data *)pdu_cb->hdr;
 	u32 data_offset = be32_to_cpu(hdr->offset);
-	u32 data_len = pdu_cb->dlen;
+	u32 data_len = ntoh24(hdr->dlength);
 	int rc, sg_nents, sg_off;
 	bool dcrc_err = false;
 
 	if (pdu_cb->flags & PDUCBF_RX_DDP_CMP) {
 		u32 offset = be32_to_cpu(hdr->offset);
 		u32 ddp_data_len;
-		u32 payload_length = ntoh24(hdr->dlength);
 		bool success = false;
 
 		cmd = iscsit_find_cmd_from_itt_or_dump(conn, hdr->itt, 0);
@@ -1022,7 +1023,7 @@ static int cxgbit_handle_iscsi_dataout(s
 		cmd->data_sn = be32_to_cpu(hdr->datasn);
 
 		rc = __iscsit_check_dataout_hdr(conn, (unsigned char *)hdr,
-						cmd, payload_length, &success);
+						cmd, data_len, &success);
 		if (rc < 0)
 			return rc;
 		else if (!success)
@@ -1060,6 +1061,20 @@ static int cxgbit_handle_iscsi_dataout(s
 		cxgbit_skb_copy_to_sg(csk->skb, sg_start, sg_nents, skip);
 	}
 
+	ccmd = iscsit_priv_cmd(cmd);
+	ttinfo = &ccmd->ttinfo;
+
+	if (ccmd->release && ttinfo->sgl &&
+	    (cmd->se_cmd.data_length ==	(cmd->write_data_done + data_len))) {
+		struct cxgbit_device *cdev = csk->com.cdev;
+		struct cxgbi_ppm *ppm = cdev2ppm(cdev);
+
+		dma_unmap_sg(&ppm->pdev->dev, ttinfo->sgl, ttinfo->nents,
+			     DMA_FROM_DEVICE);
+		ttinfo->nents = 0;
+		ttinfo->sgl = NULL;
+	}
+
 check_payload:
 
 	rc = iscsit_check_dataout_payload(cmd, hdr, dcrc_err);
author maintainer
#686 lore raw

PATCH 685/700 scsi: lpfc: Fix unreleased RPIs when NPIV ports are created

In reply to Greg Kroah-Hartman

From: James Smart <[email protected]>

commit 01131e7aae5d30e23e3cdd1eebe51bbc5489ae8f upstream.

While testing NPIV and watching logins and used RPI levels, it was seen the used RPI count was much higher than the number of remote ports discovered.

Code inspection showed that remote port removals on any NPIV instance are releasing the RPI, but not performing an UNREG_RPI with the adapter thus the reference counting never fully drops and the RPI is never fully released. This was happening on NPIV nodes due to a log of fabric ELS's to fabric addresses. This lack of UNREG_RPI was introduced by a prior node rework patch that performed the UNREG_RPI as part of node cleanup.

To resolve the issue, do the following:

- Restore the RPI release code, but move the location to so that it is in line with the new node cleanup design.

- NPIV ports now release the RPI and drop the node when the caller sets the NLP_RELEASE_RPI flag.

- Set the NLP_RELEASE_RPI flag in node cleanup which will trigger a release of RPI to free pool.

- Ensure there's an UNREG_RPI at LOGO completion so that RPI release is completed.

- Stop offline_prep from skipping nodes that are UNUSED. The RPI may not have been released.

- Stop the default RPI handling in lpfc_cmpl_els_rsp() for SLI4.

- Fixed up debugfs RPI displays for better debugging.

Fixes a70e63eee1c1 ("scsi: lpfc: Fix NPIV Fabric Node reference counting")
Cc <[email protected]> # v5.11+
---
 drivers/scsi/lpfc/lpfc_debugfs.c   |    7 ---
 drivers/scsi/lpfc/lpfc_els.c       |   79 +++++++++++++++++++++++++++++--------
 drivers/scsi/lpfc/lpfc_hbadisc.c   |   27 +++++++++++-
 drivers/scsi/lpfc/lpfc_init.c      |    7 ---
 drivers/scsi/lpfc/lpfc_nportdisc.c |   25 +++++++----
 drivers/scsi/lpfc/lpfc_sli.c       |   10 +++-
 6 files changed, 115 insertions(+), 40 deletions(-)
drivers/scsi/lpfc/lpfc_debugfs.c +2 -5
@@ -868,11 +868,8 @@ lpfc_debugfs_nodelist_data(struct lpfc_v
 		len += scnprintf(buf+len, size-len,
 				"WWNN x%llx ",
 				wwn_to_u64(ndlp->nlp_nodename.u.wwn));
-		if (ndlp->nlp_flag & NLP_RPI_REGISTERED)
-			len += scnprintf(buf+len, size-len, "RPI:%03d ",
-					ndlp->nlp_rpi);
-		else
-			len += scnprintf(buf+len, size-len, "RPI:none ");
+		len += scnprintf(buf+len, size-len, "RPI:x%04x ",
+				 ndlp->nlp_rpi);
 		len +=  scnprintf(buf+len, size-len, "flag:x%08x ",
 			ndlp->nlp_flag);
 		if (!ndlp->nlp_type)
drivers/scsi/lpfc/lpfc_els.c +63 -16

145 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_hbadisc.c +25 -2
@@ -4789,12 +4789,17 @@ lpfc_nlp_logo_unreg(struct lpfc_hba *phb
 		ndlp->nlp_defer_did = NLP_EVT_NOTHING_PENDING;
 		lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0);
 	} else {
+		/* NLP_RELEASE_RPI is only set for SLI4 ports. */
 		if (ndlp->nlp_flag & NLP_RELEASE_RPI) {
 			lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi);
+			spin_lock_irq(&ndlp->lock);
 			ndlp->nlp_flag &= ~NLP_RELEASE_RPI;
 			ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR;
+			spin_unlock_irq(&ndlp->lock);
 		}
+		spin_lock_irq(&ndlp->lock);
 		ndlp->nlp_flag &= ~NLP_UNREG_INP;
+		spin_unlock_irq(&ndlp->lock);
 	}
 }
 
@@ -5129,8 +5134,10 @@ lpfc_cleanup_node(struct lpfc_vport *vpo
 	list_del_init(&ndlp->dev_loss_evt.evt_listp);
 	list_del_init(&ndlp->recovery_evt.evt_listp);
 	lpfc_cleanup_vports_rrqs(vport, ndlp);
+
 	if (phba->sli_rev == LPFC_SLI_REV4)
 		ndlp->nlp_flag |= NLP_RELEASE_RPI;
+
 	return 0;
 }
 
@@ -6174,8 +6181,23 @@ lpfc_nlp_release(struct kref *kref)
 	lpfc_cancel_retry_delay_tmo(vport, ndlp);
 	lpfc_cleanup_node(vport, ndlp);
 
-	/* Clear Node key fields to give other threads notice
-	 * that this node memory is not valid anymore.
+	/* Not all ELS transactions have registered the RPI with the port.
+	 * In these cases the rpi usage is temporary and the node is
+	 * released when the WQE is completed.  Catch this case to free the
+	 * RPI to the pool.  Because this node is in the release path, a lock
+	 * is unnecessary.  All references are gone and the node has been
+	 * dequeued.
+	 */
+	if (ndlp->nlp_flag & NLP_RELEASE_RPI) {
+		if (ndlp->nlp_rpi != LPFC_RPI_ALLOC_ERROR &&
+		    !(ndlp->nlp_flag & (NLP_RPI_REGISTERED | NLP_UNREG_INP))) {
+			lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi);
+			ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR;
+		}
+	}
+
+	/* The node is not freed back to memory, it is released to a pool so
+	 * the node fields need to be cleaned up.
 	 */
 	ndlp->vport = NULL;
 	ndlp->nlp_state = NLP_STE_FREED_NODE;
@@ -6255,6 +6277,7 @@ lpfc_nlp_not_used(struct lpfc_nodelist *
 		"node not used:   did:x%x flg:x%x refcnt:x%x",
 		ndlp->nlp_DID, ndlp->nlp_flag,
 		kref_read(&ndlp->kref));
+
 	if (kref_read(&ndlp->kref) == 1)
 		if (lpfc_nlp_put(ndlp))
 			return 1;
drivers/scsi/lpfc/lpfc_init.c +0 -7
@@ -3532,13 +3532,6 @@ lpfc_offline_prep(struct lpfc_hba *phba,
 			list_for_each_entry_safe(ndlp, next_ndlp,
 						 &vports[i]->fc_nodes,
 						 nlp_listp) {
-				if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
-					/* Driver must assume RPI is invalid for
-					 * any unused or inactive node.
-					 */
-					ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR;
-					continue;
-				}
 
 				spin_lock_irq(&ndlp->lock);
 				ndlp->nlp_flag &= ~NLP_NPR_ADISC;
drivers/scsi/lpfc/lpfc_nportdisc.c +17 -8
@@ -557,15 +557,24 @@ lpfc_rcv_plogi(struct lpfc_vport *vport,
 		/* no deferred ACC */
 		kfree(save_iocb);
 
-		/* In order to preserve RPIs, we want to cleanup
-		 * the default RPI the firmware created to rcv
-		 * this ELS request. The only way to do this is
-		 * to register, then unregister the RPI.
+		/* This is an NPIV SLI4 instance that does not need to register
+		 * a default RPI.
 		 */
-		spin_lock_irq(&ndlp->lock);
-		ndlp->nlp_flag |= (NLP_RM_DFLT_RPI | NLP_ACC_REGLOGIN |
-				   NLP_RCV_PLOGI);
-		spin_unlock_irq(&ndlp->lock);
+		if (phba->sli_rev == LPFC_SLI_REV4) {
+			mempool_free(login_mbox, phba->mbox_mem_pool);
+			login_mbox = NULL;
+		} else {
+			/* In order to preserve RPIs, we want to cleanup
+			 * the default RPI the firmware created to rcv
+			 * this ELS request. The only way to do this is
+			 * to register, then unregister the RPI.
+			 */
+			spin_lock_irq(&ndlp->lock);
+			ndlp->nlp_flag |= (NLP_RM_DFLT_RPI | NLP_ACC_REGLOGIN |
+					   NLP_RCV_PLOGI);
+			spin_unlock_irq(&ndlp->lock);
+		}
+
 		stat.un.b.lsRjtRsnCode = LSRJT_INVALID_CMD;
 		stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE;
 		rc = lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb,
drivers/scsi/lpfc/lpfc_sli.c +8 -2
@@ -13628,9 +13628,15 @@ lpfc_sli4_sp_handle_mbox_event(struct lp
 		if (mcqe_status == MB_CQE_STATUS_SUCCESS) {
 			mp = (struct lpfc_dmabuf *)(pmb->ctx_buf);
 			ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
-			/* Reg_LOGIN of dflt RPI was successful. Now lets get
-			 * RID of the PPI using the same mbox buffer.
+
+			/* Reg_LOGIN of dflt RPI was successful. Mark the
+			 * node as having an UNREG_LOGIN in progress to stop
+			 * an unsolicited PLOGI from the same NPortId from
+			 * starting another mailbox transaction.
 			 */
+			spin_lock_irqsave(&ndlp->lock, iflags);
+			ndlp->nlp_flag |= NLP_UNREG_INP;
+			spin_unlock_irqrestore(&ndlp->lock, iflags);
 			lpfc_unreg_login(phba, vport->vpi,
 					 pmbox->un.varWords[0], pmb);
 			pmb->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi;
author maintainer
#687 lore raw

PATCH 686/700 scsi: lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs

In reply to Greg Kroah-Hartman

From: James Smart <[email protected]>

commit 4012baeab6ca22b7f7beb121b6d0da0a62942fdd upstream.

When lpfc is handling a solicited and unsolicited PLOGI with another initiator, the remote initiator is never recovered. The node for the initiator is erroneouosly removed and all resources released.

In lpfc_cmpl_els_plogi(), when lpfc_els_retry() returns a failure code, the driver is calling the state machine with a device remove event because the remote port is not currently registered with the SCSI or NVMe transports. The issue is that on a PLOGI "collision" the driver correctly aborts the solicited PLOGI and allows the unsolicited PLOGI to complete the process, but this process is interrupted with a device_rm event.

Introduce logic in the PLOGI completion to capture the PLOGI collision event and jump out of the routine. This will avoid removal of the node. If there is no collision, the normal node removal will occur.

Fixes 52edb2caf675 ("scsi: lpfc: Remove ndlp when a PLOGI/ADISC/PRLI/REG_RPI ultimately fails")
Cc <[email protected]> # v5.11+
---
 drivers/scsi/lpfc/lpfc_els.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +18 -3
@@ -1985,9 +1985,20 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phb
 			lpfc_disc_state_machine(vport, ndlp, cmdiocb,
 						NLP_EVT_CMPL_PLOGI);
 
-		/* As long as this node is not registered with the scsi or nvme
-		 * transport, it is no longer an active node.  Otherwise
-		 * devloss handles the final cleanup.
+		/* If a PLOGI collision occurred, the node needs to continue
+		 * with the reglogin process.
+		 */
+		spin_lock_irq(&ndlp->lock);
+		if ((ndlp->nlp_flag & (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI)) &&
+		    ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE) {
+			spin_unlock_irq(&ndlp->lock);
+			goto out;
+		}
+		spin_unlock_irq(&ndlp->lock);
+
+		/* No PLOGI collision and the node is not registered with the
+		 * scsi or nvme transport. It is no longer an active node. Just
+		 * start the device remove process.
 		 */
 		if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) {
 			spin_lock_irq(&ndlp->lock);
@@ -4612,6 +4623,10 @@ out:
 	    (vport && vport->port_type == LPFC_NPIV_PORT) &&
 	    ndlp->nlp_flag & NLP_RELEASE_RPI) {
 		lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi);
+		spin_lock_irq(&ndlp->lock);
+		ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR;
+		ndlp->nlp_flag &= ~NLP_RELEASE_RPI;
+		spin_unlock_irq(&ndlp->lock);
 		lpfc_drop_node(vport, ndlp);
 	}
 
author maintainer
#688 lore raw

PATCH 687/700 scsi: libfc: Correct the condition check and invalid argument passed

In reply to Greg Kroah-Hartman

From: Javed Hasan <[email protected]>

commit 8f70328c068f9f5c5db82848724cb276f657b9cd upstream.

Incorrect condition check was leading to data corruption.

---
 drivers/scsi/libfc/fc_encode.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/libfc/fc_encode.h +5 -3
@@ -166,9 +166,11 @@ static inline int fc_ct_ns_fill(struct f
 static inline void fc_ct_ms_fill_attr(struct fc_fdmi_attr_entry *entry,
 				    const char *in, size_t len)
 {
-	int copied = strscpy(entry->value, in, len);
-	if (copied > 0)
-		memset(entry->value, copied, len - copied);
+	int copied;
+
+	copied = strscpy((char *)&entry->value, in, len);
+	if (copied > 0 && (copied + 1) < len)
+		memset((entry->value + copied + 1), 0, len - copied - 1);
 }
 
 /**
author maintainer
#689 lore raw

PATCH 688/700 mailbox: qcom-ipcc: Fix IPCC mbox channel exhaustion

In reply to Greg Kroah-Hartman

From: Sibi Sankar <[email protected]>

commit d6fbfdbc12745ce24bcd348dbf7e652353b3e59c upstream.

Fix IPCC (Inter-Processor Communication Controller) channel exhaustion by setting the channel private data to NULL on mbox shutdown.

Err Logs:
remoteproc: MBA booted without debug policy, loading mpss
remoteproc: glink-edge: failed to acquire IPC channel
remoteproc: failed to probe subdevices for remoteproc: -16

---
 drivers/mailbox/qcom-ipcc.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/mailbox/qcom-ipcc.c +6 -0
@@ -155,6 +155,11 @@ static int qcom_ipcc_mbox_send_data(stru
 	return 0;
 }
 
+static void qcom_ipcc_mbox_shutdown(struct mbox_chan *chan)
+{
+	chan->con_priv = NULL;
+}
+
 static struct mbox_chan *qcom_ipcc_mbox_xlate(struct mbox_controller *mbox,
 					const struct of_phandle_args *ph)
 {
@@ -184,6 +189,7 @@ static struct mbox_chan *qcom_ipcc_mbox_
 
 static const struct mbox_chan_ops ipcc_mbox_chan_ops = {
 	.send_data = qcom_ipcc_mbox_send_data,
+	.shutdown = qcom_ipcc_mbox_shutdown,
 };
 
 static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc)
author maintainer
#690 lore raw

PATCH 689/700 fscrypt: dont ignore minor_hash when hash is 0

In reply to Greg Kroah-Hartman

From: Eric Biggers <[email protected]>

commit 77f30bfcfcf484da7208affd6a9e63406420bf91 upstream.

When initializing a no-key name, fscrypt_fname_disk_to_usr() sets the minor_hash to 0 if the (major) hash is 0.

This doesn't make sense because 0 is a valid hash code, so we shouldn't ignore the filesystem-provided minor_hash in that case. Fix this by removing the special case for 'hash == 0'.

This is an old bug that appears to have originated when the encryption code in ext4 and f2fs was moved into fs/crypto/. The original ext4 and f2fs code passed the hash by pointer instead of by value. So 'if (hash)' actually made sense then, as it was checking whether a pointer was NULL. But now the hashes are passed by value, and filesystems just pass 0 for any hashes they don't have. There is no need to handle this any differently from the hashes actually being 0.

It is difficult to reproduce this bug, as it only made a difference in the case where a filename's 32-bit major hash happened to be 0. However, it probably had the largest chance of causing problems on ubifs, since ubifs uses minor_hash to do lookups of no-key names, in addition to using it as a readdir cookie. ext4 only uses minor_hash as a readdir cookie, and f2fs doesn't use minor_hash at all.

Fixes 0b81d0779072 ("fs crypto: move per-file encryption from f2fs tree to fs/crypto")
Cc <[email protected]> # v4.6+
---
 fs/crypto/fname.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
fs/crypto/fname.c +3 -7
@@ -344,13 +344,9 @@ int fscrypt_fname_disk_to_usr(const stru
 		     offsetof(struct fscrypt_nokey_name, sha256));
 	BUILD_BUG_ON(BASE64_CHARS(FSCRYPT_NOKEY_NAME_MAX) > NAME_MAX);
 
-	if (hash) {
-		nokey_name.dirhash[0] = hash;
-		nokey_name.dirhash[1] = minor_hash;
-	} else {
-		nokey_name.dirhash[0] = 0;
-		nokey_name.dirhash[1] = 0;
-	}
+	nokey_name.dirhash[0] = hash;
+	nokey_name.dirhash[1] = minor_hash;
+
 	if (iname->len <= sizeof(nokey_name.bytes)) {
 		memcpy(nokey_name.bytes, iname->name, iname->len);
 		size = offsetof(struct fscrypt_nokey_name, bytes[iname->len]);
author maintainer
#691 lore raw

PATCH 690/700 fscrypt: fix derivation of SipHash keys on big endian CPUs

In reply to Greg Kroah-Hartman

From: Eric Biggers <[email protected]>

commit 2fc2b430f559fdf32d5d1dd5ceaa40e12fb77bdf upstream.

Typically, the cryptographic APIs that fscrypt uses take keys as byte arrays, which avoids endianness issues. However, siphash_key_t is an exception. It is defined as 'u64 key[2];', i.e. the 128-bit key is expected to be given directly as two 64-bit words in CPU endianness.

fscrypt_derive_dirhash_key() and fscrypt_setup_iv_ino_lblk_32_key() forgot to take this into account. Therefore, the SipHash keys used to index encrypted+casefolded directories differ on big endian vs. little endian platforms, as do the SipHash keys used to hash inode numbers for IV_INO_LBLK_32-encrypted directories. This makes such directories non-portable between these platforms.

Fix this by always using the little endian order. This is a breaking change for big endian platforms, but this should be fine in practice since these features (encrypt+casefold support, and the IV_INO_LBLK_32 flag) aren't known to actually be used on any big endian platforms yet.

Fixes aa408f835d02 ("fscrypt: derive dirhash key for casefolded directories")
Fixes e3b1078bedd3 ("fscrypt: add support for IV_INO_LBLK_32 policies")
Cc <[email protected]> # v5.6+
---
 fs/crypto/keysetup.c |   40 ++++++++++++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 8 deletions(-)
fs/crypto/keysetup.c +32 -8
@@ -210,15 +210,40 @@ out_unlock:
 	return err;
 }
 
+/*
+ * Derive a SipHash key from the given fscrypt master key and the given
+ * application-specific information string.
+ *
+ * Note that the KDF produces a byte array, but the SipHash APIs expect the key
+ * as a pair of 64-bit words.  Therefore, on big endian CPUs we have to do an
+ * endianness swap in order to get the same results as on little endian CPUs.
+ */
+static int fscrypt_derive_siphash_key(const struct fscrypt_master_key *mk,
+				      u8 context, const u8 *info,
+				      unsigned int infolen, siphash_key_t *key)
+{
+	int err;
+
+	err = fscrypt_hkdf_expand(&mk->mk_secret.hkdf, context, info, infolen,
+				  (u8 *)key, sizeof(*key));
+	if (err)
+		return err;
+
+	BUILD_BUG_ON(sizeof(*key) != 16);
+	BUILD_BUG_ON(ARRAY_SIZE(key->key) != 2);
+	le64_to_cpus(&key->key[0]);
+	le64_to_cpus(&key->key[1]);
+	return 0;
+}
+
 int fscrypt_derive_dirhash_key(struct fscrypt_info *ci,
 			       const struct fscrypt_master_key *mk)
 {
 	int err;
 
-	err = fscrypt_hkdf_expand(&mk->mk_secret.hkdf, HKDF_CONTEXT_DIRHASH_KEY,
-				  ci->ci_nonce, FSCRYPT_FILE_NONCE_SIZE,
-				  (u8 *)&ci->ci_dirhash_key,
-				  sizeof(ci->ci_dirhash_key));
+	err = fscrypt_derive_siphash_key(mk, HKDF_CONTEXT_DIRHASH_KEY,
+					 ci->ci_nonce, FSCRYPT_FILE_NONCE_SIZE,
+					 &ci->ci_dirhash_key);
 	if (err)
 		return err;
 	ci->ci_dirhash_key_initialized = true;
@@ -253,10 +278,9 @@ static int fscrypt_setup_iv_ino_lblk_32_
 		if (mk->mk_ino_hash_key_initialized)
 			goto unlock;
 
-		err = fscrypt_hkdf_expand(&mk->mk_secret.hkdf,
-					  HKDF_CONTEXT_INODE_HASH_KEY, NULL, 0,
-					  (u8 *)&mk->mk_ino_hash_key,
-					  sizeof(mk->mk_ino_hash_key));
+		err = fscrypt_derive_siphash_key(mk,
+						 HKDF_CONTEXT_INODE_HASH_KEY,
+						 NULL, 0, &mk->mk_ino_hash_key);
 		if (err)
 			goto unlock;
 		/* pairs with smp_load_acquire() above */
author maintainer
#692 lore raw

PATCH 691/700 tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

In reply to Greg Kroah-Hartman

From: Jarkko Sakkinen <[email protected]>

commit 0178f9d0f60ba07e09bab57381a3ef18e2c1fd7f upstream.

Do not tear down the system when getting invalid status from a TPM chip. This can happen when panic-on-warn is used.

Instead, introduce TPM_TIS_INVALID_STATUS bitflag and use it to trigger once the error reporting per chip. In addition, print out the value of TPM_STS for improved forensics.

---
 drivers/char/tpm/tpm_tis_core.c |   25 ++++++++++++++++++-------
 drivers/char/tpm/tpm_tis_core.h |    3 ++-
 2 files changed, 20 insertions(+), 8 deletions(-)
drivers/char/tpm/tpm_tis_core.c +18 -7
@@ -196,13 +196,24 @@ static u8 tpm_tis_status(struct tpm_chip
 		return 0;
 
 	if (unlikely((status & TPM_STS_READ_ZERO) != 0)) {
-		/*
-		 * If this trips, the chances are the read is
-		 * returning 0xff because the locality hasn't been
-		 * acquired.  Usually because tpm_try_get_ops() hasn't
-		 * been called before doing a TPM operation.
-		 */
-		WARN_ONCE(1, "TPM returned invalid status\n");
+		if  (!test_and_set_bit(TPM_TIS_INVALID_STATUS, &priv->flags)) {
+			/*
+			 * If this trips, the chances are the read is
+			 * returning 0xff because the locality hasn't been
+			 * acquired.  Usually because tpm_try_get_ops() hasn't
+			 * been called before doing a TPM operation.
+			 */
+			dev_err(&chip->dev, "invalid TPM_STS.x 0x%02x, dumping stack for forensics\n",
+				status);
+
+			/*
+			 * Dump stack for forensics, as invalid TPM_STS.x could be
+			 * potentially triggered by impaired tpm_try_get_ops() or
+			 * tpm_find_get_ops().
+			 */
+			dump_stack();
+		}
+
 		return 0;
 	}
 
drivers/char/tpm/tpm_tis_core.h +2 -1
@@ -83,6 +83,7 @@ enum tis_defaults {
 
 enum tpm_tis_flags {
 	TPM_TIS_ITPM_WORKAROUND		= BIT(0),
+	TPM_TIS_INVALID_STATUS		= BIT(1),
 };
 
 struct tpm_tis_data {
@@ -90,7 +91,7 @@ struct tpm_tis_data {
 	int locality;
 	int irq;
 	bool irq_tested;
-	unsigned int flags;
+	unsigned long flags;
 	void __iomem *ilb_base_addr;
 	u16 clkrun_enabled;
 	wait_queue_head_t int_queue;
author maintainer
#693 lore raw

PATCH 692/700 erofs: fix error return code in erofs_read_superblock()

In reply to Greg Kroah-Hartman

From: Wei Yongjun <[email protected]>

commit 0508c1ad0f264a24c4643701823a45f6c9bd8146 upstream.

'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true, thus 0 will return in some error handling cases. Fix to return negative error code -EINVAL instead of 0.

---
 fs/erofs/super.c |    1 +
 1 file changed, 1 insertion(+)
fs/erofs/super.c +1 -0
@@ -155,6 +155,7 @@ static int erofs_read_superblock(struct
 			goto out;
 	}
 
+	ret = -EINVAL;
 	blkszbits = dsb->blkszbits;
 	/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
 	if (blkszbits != LOG_BLOCK_SIZE) {
author maintainer
#694 lore raw

PATCH 693/700 block: return the correct bvec when checking for gaps

In reply to Greg Kroah-Hartman

From: Long Li <[email protected]>

commit c9c9762d4d44dcb1b2ba90cfb4122dc11ceebf31 upstream.

After commit 07173c3ec276 ("block: enable multipage bvecs"), a bvec can have multiple pages. But bio_will_gap() still assumes one page bvec while checking for merging. If the pages in the bvec go across the seg_boundary_mask, this check for merging can potentially succeed if only the 1st page is tested, and can fail if all the pages are tested.

Later, when SCSI builds the SG list the same check for merging is done in __blk_segment_map_sg_merge() with all the pages in the bvec tested. This time the check may fail if the pages in bvec go across the seg_boundary_mask (but tested okay in bio_will_gap() earlier, so those BIOs were merged). If this check fails, we end up with a broken SG list for drivers assuming the SG list not having offsets in intermediate pages. This results in incorrect pages written to the disk.

Fix this by returning the multi-page bvec when testing gaps for merging.

Cc Jens Axboe <[email protected]>
Cc Johannes Thumshirn <[email protected]>
Cc Pavel Begunkov <[email protected]>
Cc Ming Lei <[email protected]>
Cc Tejun Heo <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc Jeffle Xu <[email protected]>
Fixes 07173c3ec276 ("block: enable multipage bvecs")
---
 include/linux/bio.h |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
include/linux/bio.h +4 -8
@@ -44,9 +44,6 @@ static inline unsigned int bio_max_segs(
 #define bio_offset(bio)		bio_iter_offset((bio), (bio)->bi_iter)
 #define bio_iovec(bio)		bio_iter_iovec((bio), (bio)->bi_iter)
 
-#define bio_multiple_segments(bio)				\
-	((bio)->bi_iter.bi_size != bio_iovec(bio).bv_len)
-
 #define bvec_iter_sectors(iter)	((iter).bi_size >> 9)
 #define bvec_iter_end_sector(iter) ((iter).bi_sector + bvec_iter_sectors((iter)))
 
@@ -271,7 +268,7 @@ static inline void bio_clear_flag(struct
 
 static inline void bio_get_first_bvec(struct bio *bio, struct bio_vec *bv)
 {
-	*bv = bio_iovec(bio);
+	*bv = mp_bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter);
 }
 
 static inline void bio_get_last_bvec(struct bio *bio, struct bio_vec *bv)
@@ -279,10 +276,9 @@ static inline void bio_get_last_bvec(str
 	struct bvec_iter iter = bio->bi_iter;
 	int idx;
 
-	if (unlikely(!bio_multiple_segments(bio))) {
-		*bv = bio_iovec(bio);
-		return;
-	}
+	bio_get_first_bvec(bio, bv);
+	if (bv->bv_len == bio->bi_iter.bi_size)
+		return;		/* this bio only has a single bvec */
 
 	bio_advance_iter(bio, &iter, iter.bi_size);
 
author maintainer
#695 lore raw

PATCH 694/700 io_uring: fix blocking inline submission

In reply to Greg Kroah-Hartman

From: Pavel Begunkov <[email protected]>

commit 976517f162a05f4315b2373fd11585c395506259 upstream.

There is a complaint against sys_io_uring_enter() blocking if it submits stdin reads. The problem is in __io_file_supports_async(), which sees that it's a cdev and allows it to be processed inline.

Punt char devices using generic rules of io_file_supports_async(), including checking for presence of *_iter() versions of rw callbacks. Apparently, it will affect most of cdevs with some exceptions like null and zero devices.

---
 fs/io_uring.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
@@ -2683,7 +2683,7 @@ static bool io_file_supports_async(struc
 			return true;
 		return false;
 	}
-	if (S_ISCHR(mode) || S_ISSOCK(mode))
+	if (S_ISSOCK(mode))
 		return true;
 	if (S_ISREG(mode)) {
 		if (IS_ENABLED(CONFIG_BLOCK) &&
author maintainer
#696 lore raw

PATCH 695/700 io_uring: add IOPOLL and reserved field checks to IORING_OP_RENAMEAT

In reply to Greg Kroah-Hartman

From: Jens Axboe <[email protected]>

commit ed7eb2592286ead7d3bfdf8adf65e65392167cc4 upstream.

We can't support IOPOLL with non-pollable request types, and we should check for unused/reserved fields like we do for other request types.

Fixes 80a261fd0032 ("io_uring: add support for IORING_OP_RENAMEAT")
---
 fs/io_uring.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/io_uring.c +4 -0
@@ -3497,6 +3497,10 @@ static int io_renameat_prep(struct io_ki
 	struct io_rename *ren = &req->rename;
 	const char __user *oldf, *newf;
 
+	if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
+		return -EINVAL;
+	if (sqe->ioprio || sqe->buf_index)
+		return -EINVAL;
 	if (unlikely(req->flags & REQ_F_FIXED_FILE))
 		return -EBADF;
 
author maintainer
#697 lore raw

PATCH 696/700 io_uring: add IOPOLL and reserved field checks to IORING_OP_UNLINKAT

In reply to Greg Kroah-Hartman

From: Jens Axboe <[email protected]>

commit 22634bc5620d29765e5199c7b230a372c7ddcda2 upstream.

We can't support IOPOLL with non-pollable request types, and we should check for unused/reserved fields like we do for other request types.

Fixes 14a1143b68ee ("io_uring: add support for IORING_OP_UNLINKAT")
---
 fs/io_uring.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/io_uring.c +4 -0
@@ -3548,6 +3548,10 @@ static int io_unlinkat_prep(struct io_ki
 	struct io_unlink *un = &req->unlink;
 	const char __user *fname;
 
+	if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
+		return -EINVAL;
+	if (sqe->ioprio || sqe->off || sqe->len || sqe->buf_index)
+		return -EINVAL;
 	if (unlikely(req->flags & REQ_F_FIXED_FILE))
 		return -EBADF;
 
author maintainer
#698 lore raw

PATCH 697/700 mmc: block: Disable CMDQ on the ioctl path

In reply to Greg Kroah-Hartman

From: Bean Huo <[email protected]>

commit 70b52f09080565030a530a784f1c9948a7f48ca3 upstream.

According to the eMMC Spec:
"When command queuing is enabled (CMDQ Mode En bit in CMDQ_MODE_EN field is set to ‘1’) class 11 commands are the only method through which data transfer tasks can be issued. Existing data transfer commands, namely CMD18/CMD17 and CMD25/CMD24, are not supported when command queuing is enabled."
which means if CMDQ is enabled, the FFU commands will not be supported. To fix this issue, just simply disable CMDQ on the ioctl path, and re-enable CMDQ once ioctl request is completed.

---
 drivers/mmc/core/block.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mmc/core/block.c +8 -0
@@ -1004,6 +1004,12 @@ static void mmc_blk_issue_drv_op(struct
 
 	switch (mq_rq->drv_op) {
 	case MMC_DRV_OP_IOCTL:
+		if (card->ext_csd.cmdq_en) {
+			ret = mmc_cmdq_disable(card);
+			if (ret)
+				break;
+		}
+		fallthrough;
 	case MMC_DRV_OP_IOCTL_RPMB:
 		idata = mq_rq->drv_op_data;
 		for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) {
@@ -1014,6 +1020,8 @@ static void mmc_blk_issue_drv_op(struct
 		/* Always switch back to main area after RPMB access */
 		if (rpmb_ioctl)
 			mmc_blk_part_switch(card, 0);
+		else if (card->reenable_cmdq && !card->ext_csd.cmdq_en)
+			mmc_cmdq_enable(card);
 		break;
 	case MMC_DRV_OP_BOOT_WP:
 		ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP,
author maintainer
#699 lore raw

PATCH 698/700 mmc: vub3000: fix control-request direction

In reply to Greg Kroah-Hartman

From: Johan Hovold <[email protected]>

commit 3c0bb3107703d2c58f7a0a7a2060bb57bc120326 upstream.

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the SET_ROM_WAIT_STATES request which erroneously used usb_rcvctrlpipe().

Fixes 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver")
---
 drivers/mmc/host/vub300.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/vub300.c +1 -1
@@ -2279,7 +2279,7 @@ static int vub300_probe(struct usb_inter
 	if (retval < 0)
 		goto error5;
 	retval =
-		usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+		usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
 				SET_ROM_WAIT_STATES,
 				USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 				firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
author maintainer
#700 lore raw

PATCH 699/700 media: exynos4-is: remove a now unused integer

In reply to Greg Kroah-Hartman

From: Mauro Carvalho Chehab <[email protected]>

commit 29dd19e3ac7b2a8671ebeac02859232ce0e34f58 upstream.

The usage of pm_runtime_resume_and_get() removed the need of a temporary integer. So, drop it.

Fixes 59f96244af94 ("media: exynos4-is: fix pm_runtime_get_sync() usage count")
---
 drivers/media/platform/exynos4-is/media-dev.c |    1 -
 1 file changed, 1 deletion(-)
drivers/media/platform/exynos4-is/media-dev.c +0 -1
@@ -1282,7 +1282,6 @@ static DEVICE_ATTR(subdev_conf_mode, S_I
 static int cam_clk_prepare(struct clk_hw *hw)
 {
 	struct cam_clk *camclk = to_cam_clk(hw);
-	int ret;
 
 	if (camclk->fmd->pmf == NULL)
 		return -ENODEV;
author maintainer
#701 lore raw

PATCH 700/700 scsi: core: Retry I/O for Notify (Enable Spinup) Required error

In reply to Greg Kroah-Hartman

From: Quat Le <[email protected]>

commit 104739aca4488909175e9e31d5cd7d75b82a2046 upstream.

If the device is power-cycled, it takes time for the initiator to transmit the periodic NOTIFY (ENABLE SPINUP) SAS primitive, and for the device to respond to the primitive to become ACTIVE. Retry the I/O request to allow the device time to become ACTIVE.

---
 drivers/scsi/scsi_lib.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/scsi_lib.c +1 -0
@@ -761,6 +761,7 @@ static void scsi_io_completion_action(st
 				case 0x07: /* operation in progress */
 				case 0x08: /* Long write in progress */
 				case 0x09: /* self test in progress */
+				case 0x11: /* notify (enable spinup) required */
 				case 0x14: /* space allocation in progress */
 				case 0x1a: /* start stop unit in progress */
 				case 0x1b: /* sanitize in progress */
maintainer Tested-by on the v1 series
#702 lore raw
In reply to Greg Kroah-Hartman
Quoted 2,865 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 5.12.17-rc1

Quat Le <[email protected]>
scsi: core: Retry I/O for Notify (Enable Spinup) Required error

Mauro Carvalho Chehab <[email protected]>
media: exynos4-is: remove a now unused integer

Johan Hovold <[email protected]>
mmc: vub3000: fix control-request direction

Bean Huo <[email protected]>
mmc: block: Disable CMDQ on the ioctl path

Jens Axboe <[email protected]>
io_uring: add IOPOLL and reserved field checks to IORING_OP_UNLINKAT

Jens Axboe <[email protected]>
io_uring: add IOPOLL and reserved field checks to IORING_OP_RENAMEAT

Pavel Begunkov <[email protected]>
io_uring: fix blocking inline submission

Long Li <[email protected]>
block: return the correct bvec when checking for gaps

Wei Yongjun <[email protected]>
erofs: fix error return code in erofs_read_superblock()

Jarkko Sakkinen <[email protected]>
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

Eric Biggers <[email protected]>
fscrypt: fix derivation of SipHash keys on big endian CPUs

Eric Biggers <[email protected]>
fscrypt: don't ignore minor_hash when hash is 0

Sibi Sankar <[email protected]>
mailbox: qcom-ipcc: Fix IPCC mbox channel exhaustion

Javed Hasan <[email protected]>
scsi: libfc: Correct the condition check and invalid argument passed

James Smart <[email protected]>
scsi: lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs

James Smart <[email protected]>
scsi: lpfc: Fix unreleased RPIs when NPIV ports are created

Varun Prakash <[email protected]>
scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd()

Javed Hasan <[email protected]>
scsi: fc: Correct RHBA attributes length

Chandrakanth Patil <[email protected]>
scsi: megaraid_sas: Send all non-RW I/Os for TYPE_ENCLOSURE device through firmware

Namjae Jeon <[email protected]>
exfat: handle wrong stream entry size in exfat_readdir()

Guo Ren <[email protected]>
csky: syscache: Fixup duplicate cache flush

Randy Dunlap <[email protected]>
csky: fix syscache.c fallthrough warning

Arnaldo Carvalho de Melo <[email protected]>
perf llvm: Return -ENOMEM when asprintf() fails

Dave Hansen <[email protected]>
selftests/vm/pkeys: refill shadow register after implicit kernel write

Dave Hansen <[email protected]>
selftests/vm/pkeys: handle negative sys_pkey_alloc() return code

Dave Hansen <[email protected]>
selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random

Trent Piepho <[email protected]>
lib/math/rational.c: fix divide by zero

Miaohe Lin <[email protected]>
mm/zswap.c: fix two bugs in zswap_writeback_entry()

Muchun Song <[email protected]>
mm: migrate: fix missing update page_private to hugetlb_page_subpool

Miaohe Lin <[email protected]>
mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page

Miaohe Lin <[email protected]>
mm/z3fold: fix potential memory leak in z3fold_destroy_pool()

Mike Kravetz <[email protected]>
hugetlb: address ref count racing in prep_compound_gigantic_page

Mike Kravetz <[email protected]>
hugetlb: remove prep_compound_huge_page cleanup

Miaohe Lin <[email protected]>
mm/huge_memory.c: don't discard hugepage if other processes are mapping it

Miaohe Lin <[email protected]>
mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled()

Miaohe Lin <[email protected]>
mm/huge_memory.c: remove dedicated macro HPAGE_CACHE_INDEX_MASK

Alex Williamson <[email protected]>
vfio/pci: Handle concurrent vma faults

Nicholas Piggin <[email protected]>

    powerpc/64s/interrupt: preserve regs->softe for NMI interrupts

Pali Rohár <[email protected]>
arm64: dts: marvell: armada-37xx: Fix reg for standard variant of UART

Pali Rohár <[email protected]>
serial: mvebu-uart: correctly calculate minimal possible baudrate

Pali Rohár <[email protected]>
serial: mvebu-uart: do not allow changing baudrate when uartclk is not available

Christophe JAILLET <[email protected]>
ALSA: firewire-lib: Fix 'amdtp_domain_start()' when no AMDTP_OUT_STREAM stream is found

Michael Ellerman <[email protected]>
powerpc: Fix is_kvm_guest() / kvm_para_available()

Vaibhav Jain <[email protected]>
powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

Nicholas Piggin <[email protected]>
powerpc/64s: Fix copy-paste data exposure into newly created tasks

Andy Shevchenko <[email protected]>
powerpc/papr_scm: Properly handle UUID types and API

Nicholas Piggin <[email protected]>
powerpc: Offline CPU in stop_this_cpu()

Vignesh Raghavendra <[email protected]>
serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs

Krzysztof Kozlowski <[email protected]>
selftests/ftrace: fix event-no-pid on 1-core machine

Christophe JAILLET <[email protected]>
leds: ktd2692: Fix an error handling path

Zhen Lei <[email protected]>
leds: as3645a: Fix error return code in as3645a_parse_node()

Shengjiu Wang <[email protected]>
ASoC: fsl_spdif: Fix unexpected interrupt after suspend

Kai Vehmanen <[email protected]>
ASoC: Intel: sof_sdw: use mach data for ADL RVP DMIC count

Vamshi Krishna Gopal <[email protected]>
ASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload

Libin Yang <[email protected]>
ASoC: Intel: sof_sdw: add SOF_RT715_DAI_ID_FIX for AlderLake

Chung-Chiang Cheng <[email protected]>
configfs: fix memleak in configfs_release_bin_file

Shengjiu Wang <[email protected]>
ASoC: fsl_xcvr: disable all interrupts when suspend happens

Codrin Ciubotariu <[email protected]>
ASoC: atmel-i2s: Fix usage of capture and playback at the same time

Codrin Ciubotariu <[email protected]>
ASoC: atmel-i2s: Set symmetric sample bits

Nicholas Piggin <[email protected]>
powerpc/powernv: Fix machine check reporting of async store errors

Marek Szyprowski <[email protected]>
extcon: max8997: Add missing modalias string

Stephan Gerhold <[email protected]>
extcon: sm5502: Drop invalid register write in sm5502_reg_data

Christophe JAILLET <[email protected]>
phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe()

Kunihiko Hayashi <[email protected]>
phy: uniphier-pcie: Fix updating phy parameters

Richard Fitzgerald <[email protected]>
soundwire: stream: Fix test for DP prepare complete

Zhen Lei <[email protected]>
scsi: mpt3sas: Fix error return value in _scsih_expander_add()

Christophe JAILLET <[email protected]>
habanalabs: Fix an error handling path in 'hl_pci_probe()'

Yang Yingliang <[email protected]>
mtd: rawnand: marvell: add missing clk_disable_unprepare() on error in marvell_nfc_resume()

Geert Uytterhoeven <[email protected]>
of: Fix truncation of memory sizes on 32-bit platforms

Richard Fitzgerald <[email protected]>
ASoC: cs42l42: Correct definition of CS42L42_ADC_PDN_MASK

Jonathan Cameron <[email protected]>
iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Maciej W. Rozycki <[email protected]>
serial: 8250: Actually allow UPF_MAGIC_MULTIPLIER baud rates

Dmitry Osipenko <[email protected]>
usb: phy: tegra: Correct definition of B_SESS_VLD_WAKEUP_EN bit

Dmitry Osipenko <[email protected]>
usb: phy: tegra: Wait for VBUS wakeup status deassertion on suspend

Sergio Paracuellos <[email protected]>
staging: mt7621-dts: fix pci address for PCI memory range

Junhao He <[email protected]>
coresight: core: Fix use of uninitialized pointer

Pavel Skripkin <[email protected]>
staging: rtl8712: fix memory leak in rtl871x_load_fw_cb

Pavel Skripkin <[email protected]>
staging: rtl8712: fix error handling in r871xu_drv_init

Dan Carpenter <[email protected]>
staging: gdm724x: check for overflow in gdm_lte_netif_rx()

Dan Carpenter <[email protected]>
staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt()

Shengjiu Wang <[email protected]>
ASoC: fsl_spdif: Fix error handler with pm_runtime_enable

Jonathan Cameron <[email protected]>
iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

David Gow <[email protected]>
kunit: Fix result propagation for parameterised tests

Miquel Raynal <[email protected]>
mtd: spinand: Fix double counting of ECC stats

Mika Westerberg <[email protected]>

    thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default()

Andy Shevchenko <[email protected]>
eeprom: idt_89hpesx: Restore printing the unsupported fwnode name

Andy Shevchenko <[email protected]>

    eeprom: idt_89hpesx: Put fwnode in matching case during ->probe()

Clément Lassieur <[email protected]>
usb: dwc2: Don't reset the core after setting turnaround time

Andrew Gabbasov <[email protected]>
usb: gadget: f_fs: Fix setting of device and driver data cross-references

Christophe JAILLET <[email protected]>
ASoC: mediatek: mtk-btcvsd: Fix an error handling path in 'mtk_btcvsd_snd_probe()'

Bard Liao <[email protected]>
ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682_DEVICE_ID

Oder Chiou <[email protected]>
ASoC: rt5682: Fix a problem with error handling in the io init function of the soundwire

Pierre-Louis Bossart <[email protected]>
ASoC: rt715-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt711-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt700-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt5682-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt1308-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: max98373-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: max98373-sdw: add missing memory allocation check

Srinath Mannam <[email protected]>
iommu/dma: Fix IOVA reserve dma ranges

Kees Cook <[email protected]>
selftests: splice: Adjust for handler fallback removal

Randy Dunlap <[email protected]>
s390: appldata depends on PROC_SYSCTL

Niklas Schnelle <[email protected]>
s390: enable HAVE_IOREMAP_PROT

Alexander Monakov <[email protected]>
iommu/amd: Fix extended features logging

Zhen Lei <[email protected]>
visorbus: fix error return code in visorchipset_init()

Joachim Fenkes <[email protected]>
fsi/sbefifo: Fix reset timeout

Joachim Fenkes <[email protected]>
fsi/sbefifo: Clean up correct FIFO when receiving reset request from SBE

Eddie James <[email protected]>
fsi: occ: Don't accept response from un-initialized OCC

Eddie James <[email protected]>
fsi: scom: Reset the FSI2PIB engine for any error

Colin Ian King <[email protected]>
fsi: core: Fix return of error values on failures

Andreas Kemnade <[email protected]>
mfd: rn5t618: Fix IRQ trigger by changing it to level mode

Randy Dunlap <[email protected]>
mfd: mp2629: Select MFD_CORE to fix build error

Mike Christie <[email protected]>
scsi: iscsi: Flush block work before unblock

Mike Christie <[email protected]>
scsi: iscsi: Fix in-kernel conn failure handling

Mike Christie <[email protected]>
scsi: iscsi: Rel ref after iscsi_lookup_endpoint()

Mike Christie <[email protected]>
scsi: iscsi: Use system_unbound_wq for destroy_work

Mike Christie <[email protected]>
scsi: iscsi: Force immediate failure during shutdown

Mike Christie <[email protected]>
scsi: iscsi: Stop queueing during ep_disconnect

Randy Dunlap <[email protected]>
scsi: FlashPoint: Rename si_flags field

Andy Shevchenko <[email protected]>

    leds: lp50xx: Put fwnode in error case during ->probe()

Andy Shevchenko <[email protected]>
leds: lm3697: Don't spam logs when probe is deferred

Andy Shevchenko <[email protected]>

    leds: lm3692x: Put fwnode in any case during ->probe()

Andy Shevchenko <[email protected]>

    leds: lm36274: Put fwnode in error case during ->probe()

Andy Shevchenko <[email protected]>
leds: lm3532: select regmap I2C API

Andy Shevchenko <[email protected]>
leds: lgm-sso: Fix clock handling

Colin Ian King <[email protected]>

    leds: lgm: Fix spelling mistake "prepate" -> "prepare"

Andy Shevchenko <[email protected]>
leds: class: The -ENOTSUPP should never be seen by user space

Christophe JAILLET <[email protected]>
tty: nozomi: Fix the error handling path of 'nozomi_card_init()'

Christophe JAILLET <[email protected]>
firmware: stratix10-svc: Fix a resource leak in an error handling path

Yu Kuai <[email protected]>
char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol()

Dave Stevenson <[email protected]>
staging: mmal-vchiq: Fix incorrect static vchiq_instance.

Miquel Raynal <[email protected]>
mtd: rawnand: arasan: Ensure proper configuration for the asserted target

Ansuel Smith <[email protected]>
mtd: parsers: qcom: Fix leaking of partition name

Corentin Labbe <[email protected]>
mtd: partitions: redboot: seek fis-index-block in the right node

Adrian Hunter <[email protected]>
perf scripting python: Fix tuple_set_u64()

Zhen Lei <[email protected]>
Input: hil_kbd - fix error return code in hil_dev_connect()

Kuninori Morimoto <[email protected]>
ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()

Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled

Andy Shevchenko <[email protected]>

    backlight: lm3630a_bl: Put fwnode in error case during ->probe()

Yang Yingliang <[email protected]>
ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup()

Yang Yingliang <[email protected]>
ASoC: rk3328: fix missing clk_disable_unprepare() on error in rk3328_platform_probe()

Jonathan Cameron <[email protected]>
iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: cros_ec_sensors: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: chemical: atlas: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: tcs3472: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: tcs3414: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: isl29125: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: bmc150: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: hmc5843: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: as3935: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: pulsed-light: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: srf08: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: humidity: am2315: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: gyro: bmg160: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: vf610: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: ti-ads1015: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: mxc4005: Fix overread of data and alignment issue.

Jonathan Cameron <[email protected]>
iio: accel: kxcjk-1013: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: hid: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: bma220: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: bma180: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Nuno Sa <[email protected]>
iio: adis16475: do not return ints in irq handlers

Nuno Sa <[email protected]>
iio: adis16400: do not return ints in irq handlers

Nuno Sa <[email protected]>
iio: adis_buffer: do not return ints in irq handlers

Arnd Bergmann <[email protected]>
mwifiex: re-fix for unaligned accesses

Sergio Paracuellos <[email protected]>
phy: ralink: phy-mt7621-pci: properly print pointer address

Christophe JAILLET <[email protected]>
tty: nozomi: Fix a resource leak in an error handling function

Dan Carpenter <[email protected]>
serial: 8250_omap: fix a timeout loop condition

Michael Walle <[email protected]>
serial: fsl_lpuart: remove RTSCTS handling from get_mctrl()

Michael Walle <[email protected]>
serial: fsl_lpuart: don't modify arbitrary data on lpuart32

Paul E. McKenney <[email protected]>
rcu: Invoke rcu_spawn_core_kthreads() from rcu_spawn_gp_kthread()

Stephen Boyd <[email protected]>
ASoC: rt5682: Disable irq on shutdown

Andy Shevchenko <[email protected]>
staging: fbtft: Don't spam logs when probe is deferred

Andy Shevchenko <[email protected]>
staging: fbtft: Rectify GPIO handling

Wei Li <[email protected]>
MIPS: Fix PKMAP with 32-bit MIPS huge page support

Leon Romanovsky <[email protected]>
RDMA/core: Always release restrack object

Leon Romanovsky <[email protected]>
RDMA/mlx5: Don't access NULL-cleared mpi pointer

Menglong Dong <[email protected]>
net: tipc: fix FB_MTU eat two pages

Pavel Skripkin <[email protected]>
net: sched: fix warning in tcindex_alloc_perfect_hash

Vadim Fedorenko <[email protected]>
net: lwtunnel: handle MTU calculation in forwading

Muchun Song <[email protected]>
writeback: fix obtain a reference to a freeing memcg css

Ravi Bangoria <[email protected]>
bpf, x86: Fix extable offset calculation

Robert Hancock <[email protected]>
clk: si5341: Update initialization magic

Robert Hancock <[email protected]>
clk: si5341: Check for input clock presence and PLL lock on startup

Robert Hancock <[email protected]>
clk: si5341: Avoid divide errors due to bogus register contents

Robert Hancock <[email protected]>
clk: si5341: Wait for DEVICE_READY on startup

Jonathan Marek <[email protected]>
clk: qcom: clk-alpha-pll: fix CAL_L write in alpha_pll_fabia_prepare

Cristian Ciocaltea <[email protected]>
clk: actions: Fix AHPPREDIV-H-AHB clock chain on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix bisp_factor_table based clocks on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix SD clocks factor table on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix UART clock dividers on Owl S500 SoC

Taniya Das <[email protected]>
clk: qcom: gcc: Add support for a new frequency for SC7280

Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix handling of HCI_LE_Advertising_Set_Terminated event

Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix Set Extended (Scan Response) Data

Luiz Augusto von Dentz <[email protected]>
Bluetooth: mgmt: Fix slab-out-of-bounds in tlv_data_is_valid

Petr Oros <[email protected]>
Revert "be2net: disable bh with spin_lock in be_process_mcc"

Bailey Forrest <[email protected]>
gve: Fix swapped vars when fetching max queues

Håkon Bugge <[email protected]>
RDMA/cma: Fix incorrect Packet Lifetime calculation

Gary Lin <[email protected]>
bpfilter: Specify the log level for the kmsg message

Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix NULL pointer dereference in sja1105_reload_cbs()

Sasha Neftin <[email protected]>
e1000e: Check the PCIm state

Eric Dumazet <[email protected]>
ipv6: fix out-of-bound access in ip6_parse_tlv()

Antoine Tenart <[email protected]>
net: atlantic: fix the macsec key length

Antoine Tenart <[email protected]>
net: phy: mscc: fix macsec key length

Antoine Tenart <[email protected]>
net: macsec: fix the length used to copy the key for offloading

Håkon Bugge <[email protected]>
RDMA/cma: Protect RMW with qp_mutex

Sukadev Bhattiprolu <[email protected]>
ibmvnic: free tx_pool if tso_pool alloc fails

Sukadev Bhattiprolu <[email protected]>

    ibmvnic: set ltb->buff to NULL after freeing

Sukadev Bhattiprolu <[email protected]>
ibmvnic: account for bufs already saved in indir_buf

Sukadev Bhattiprolu <[email protected]>
ibmvnic: clean pending indirect buffs during reset

Dany Madden <[email protected]>
Revert "ibmvnic: remove duplicate napi_schedule call in open function"

Sukadev Bhattiprolu <[email protected]>
Revert "ibmvnic: simplify reset_long_term_buff function"

Jan Sokolowski <[email protected]>
i40e: Fix missing rtnl locking when setting up pf switch

Mateusz Palczewski <[email protected]>
i40e: Fix autoneg disabling for non-10GBaseT links

Dinghao Liu <[email protected]>
i40e: Fix error handling in i40e_vsi_open

Maciej Żenczykowski <[email protected]>
bpf: Do not change gso_size during bpf_skb_change_proto()

Norbert Slusarek <[email protected]>

    can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0

Eric Dumazet <[email protected]>
ipv6: exthdrs: do not blindly use init_net

Jian-Hong Pan <[email protected]>
net: bcmgenet: Fix attaching to PYH failed on RPi 4B

Ping-Ke Shih <[email protected]>
mac80211: remove iwlwifi specific workaround NDPs of null_response

Zhen Lei <[email protected]>
drm/msm/dpu: Fix error return code in dpu_mdss_init()

Zhen Lei <[email protected]>
drm/msm: Fix error return code in msm_drm_init()

Kuogee Hsieh <[email protected]>
drm/msm/dp: handle irq_hpd with sink_count = 0 correctly

John Fastabend <[email protected]>
bpf: Fix null ptr deref with mixed tail calls and subprogs

Eric Dumazet <[email protected]>
ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()

Dongliang Mu <[email protected]>
ieee802154: hwsim: Fix memory leak in hwsim_add_one

Yixing Liu <[email protected]>
RDMA/hns: Fix uninitialized variable

Lang Cheng <[email protected]>
RDMA/hns: Force rewrite inline flag of WQE

Marcelo Ricardo Leitner <[email protected]>
tc-testing: fix list handling

Vignesh Raghavendra <[email protected]>
net: ti: am65-cpsw-nuss: Fix crash when changing number of TX queues

Rafał Miłecki <[email protected]>
net: broadcom: bcm4908_enet: reset DMA rings sw indexes properly

Miao Wang <[email protected]>
net/ipv4: swap flow ports when validating source

Jakub Kicinski <[email protected]>
ip6_tunnel: fix GRE6 segmentation

Bui Quang Minh <[email protected]>
bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc

Eric Dumazet <[email protected]>
vxlan: add missing rcu_read_lock() in neigh_reduce()

Po-Hao Huang <[email protected]>
rtw88: 8822c: fix lc calibration timing

Maciej Żenczykowski <[email protected]>
bpf: Fix regression on BPF_OBJ_GET with non-O_RDWR flags

Luca Coelho <[email protected]>
iwlwifi: increase PNVM load timeout

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: do not allow to delete table with owner by handle

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: skip netlink portID validation if zero

Ayush Sawal <[email protected]>
xfrm: Fix xfrm offload fallback fail case

Eric Dumazet <[email protected]>
pkt_sched: sch_qfq: fix qfq_change_class() error path

Eldar Gasanov <[email protected]>
net: dsa: mv88e6xxx: Fix adding vlan 0

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables_offload: check FLOW_DISSECTOR_KEY_BASIC in VLAN transfer logic

Jakub Kicinski <[email protected]>
tls: prevent oversized sendfile() hangs by ignoring MSG_MORE

Jakub Kicinski <[email protected]>
selftests: tls: fix chacha+bidir tests

Jakub Kicinski <[email protected]>
selftests: tls: clean up uninitialized warnings

Yunsheng Lin <[email protected]>
net: sched: add barrier to ensure correct ordering for lockless qdisc

Antoine Tenart <[email protected]>
vrf: do not push non-ND strict packets with a source LLA through packet taps again

Pavel Skripkin <[email protected]>
net: ethernet: ezchip: fix error handling

Pavel Skripkin <[email protected]>
net: ethernet: ezchip: fix UAF in nps_enet_remove

Pavel Skripkin <[email protected]>
net: ethernet: aeroflex: fix UAF in greth_of_remove

Shayne Chen <[email protected]>
mt76: mt7915: fix rx fcs error count in testmode

Sean Wang <[email protected]>
mt76: mt7921: fix OMAC idx usage

Colin Ian King <[email protected]>
mt76: mt7921: remove redundant check on type

Lorenzo Bianconi <[email protected]>
mt76: connac: alaways wake the device before scanning

Sean Wang <[email protected]>
mt76: mt7921: consider the invalid value for to_rssi

YN Chen <[email protected]>
mt76: connac: fix WoW with disconnetion and bitmap pattern

Sean Wang <[email protected]>
mt76: mt7921: Don't alter Rx path classifier

Lorenzo Bianconi <[email protected]>
mt76: mt7615: fix NULL pointer dereference in tx_prepare_skb()

Lorenzo Bianconi <[email protected]>
mt76: fix possible NULL pointer dereference in mt76_tx

Pavel Machek <[email protected]>
net: pxa168_eth: Fix a potential data race in pxa168_eth_remove

Wang Hai <[email protected]>
samples/bpf: Fix the error return code of xdp_redirect's main()

Wang Hai <[email protected]>
samples/bpf: Fix Segmentation fault for xdp_redirect command

Jack Wang <[email protected]>
RDMA/rtrs-srv: Set minimal max_send_wr and max_recv_wr

Tony Ambardar <[email protected]>
bpf: Fix libelf endian handling in resolv_btfids

Magnus Karlsson <[email protected]>
xsk: Fix broken Tx ring validation

Magnus Karlsson <[email protected]>
xsk: Fix missing validation for skb and unaligned mode

Daniel Xu <[email protected]>
selftests/bpf: Whitelist test_progs.h from .gitignore

Bob Pearson <[email protected]>
RDMA/rxe: Fix qp reference counting for atomic ops

Pablo Neira Ayuso <[email protected]>
netfilter: nft_tproxy: restrict support to TCP and UDP transport protocols

Pablo Neira Ayuso <[email protected]>
netfilter: nft_osf: check for TCP packet before further processing

Pablo Neira Ayuso <[email protected]>
netfilter: nft_exthdr: check for IPv6 packet before further processing

Leon Romanovsky <[email protected]>
RDMA/mlx5: Don't add slave port to unaffiliated list

Liu Shixin <[email protected]>
netlabel: Fix memory leak in netlbl_mgmt_add_common

Johannes Berg <[email protected]>
wil6210: remove erroneous wiphy locking

Seevalamuthu Mariappan <[email protected]>
ath11k: send beacon template after vdev_start/restart during csa

Yang Li <[email protected]>
ath10k: Fix an error code in ath10k_add_interface()

Christophe JAILLET <[email protected]>
ath11k: Fix an error handling path in ath11k_core_fetch_board_data_api_n()

Hang Zhang <[email protected]>
cw1200: Revert unnecessary patches that fix unreal use-after-free bugs

Christophe JAILLET <[email protected]>
brcmsmac: mac80211_if: Fix a resource leak in an error handling path

Matthias Brugger <[email protected]>
brcmfmac: Delete second brcm folder hierarchy

Tong Tiangen <[email protected]>
brcmfmac: Fix a double-free in brcmf_sdio_bus_reset

Alvin Šipraga <[email protected]>
brcmfmac: correctly report average RSSI in station info

Alvin Šipraga <[email protected]>
brcmfmac: fix setting of station info chains bitmask

Zhen Lei <[email protected]>
ssb: Fix error return code in ssb_bus_scan()

Bryan O'Donoghue <[email protected]>
wcn36xx: Move hal_buf allocation to devm_kmalloc in probe

Lucas Stach <[email protected]>
clk: imx8mq: remove SYS PLL 1/2 clock gates

Dongliang Mu <[email protected]>
ieee802154: hwsim: Fix possible memory leak in hwsim_subscribe_all_others

Randy Dunlap <[email protected]>
wireless: carl9170: fix LEDS build errors & warnings

Yang Yingliang <[email protected]>
ath10k: add missing error return code in ath10k_pci_probe()

Yang Yingliang <[email protected]>
ath10k: go to path err_unsupported when chip id is not supported

Zhihao Cheng <[email protected]>
tools/bpftool: Fix error return code in do_batch()

Colin Ian King <[email protected]>
drm: qxl: ensure surf.data is ininitialized

Luca Ceresoli <[email protected]>
clk: vc5: fix output disabling when enabling a FOD

Maxime Ripard <[email protected]>
drm/vc4: hdmi: Fix error path of hpd-gpios

Kees Cook <[email protected]>
drm/pl111: Actually fix CONFIG_VEXPRESS_CONFIG depends

Kamal Heib <[email protected]>
RDMA/rxe: Fix failure during driver load

Kees Cook <[email protected]>
drm/pl111: depend on CONFIG_VEXPRESS_CONFIG

Leon Romanovsky <[email protected]>
RDMA/core: Sanitize WQ state received from the userspace

Boris Sukholitko <[email protected]>
net/sched: act_vlan: Fix modify to allow 0

Xin Long <[email protected]>
xfrm: remove the fragment check for ipv6 beet mode

Dmitry Osipenko <[email protected]>
clk: tegra30: Use 300MHz for video decoder by default

Zhen Lei <[email protected]>
ehea: fix error return code in ehea_restart_qps()

Gioh Kim <[email protected]>

    RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats

Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Check if the queue_depth has changed during a reconnection

Jack Wang <[email protected]>
RDMA/rtrs-srv: Fix memory leak when having multiple sessions

Gioh Kim <[email protected]>
RDMA/rtrs-srv: Fix memory leak of unfreed rtrs_srv_stats object

Gioh Kim <[email protected]>
RDMA/rtrs: Do not reset hb_missed_max after re-connection

Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats

Bart Van Assche <[email protected]>
RDMA/srp: Fix a recently introduced memory leak

Jianguo Wu <[email protected]>
mptcp: generate subflow hmac after mptcp_finish_join()

Jianguo Wu <[email protected]>
mptcp: fix pr_debug in mptcp_token_new_connect

Colin Ian King <[email protected]>
drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result

Christophe JAILLET <[email protected]>
drm/rockchip: lvds: Fix an error handling path

Thomas Hebb <[email protected]>
drm/rockchip: dsi: move all lane config except LCDC mux to bind()

Yang Yingliang <[email protected]>
drm/rockchip: cdn-dp-core: add missing clk_disable_unprepare() on error in cdn_dp_grf_write()

Alex Bee <[email protected]>
drm: rockchip: set alpha_en to 0 if it is not used

Maxime Ripard <[email protected]>
drm/vc4: crtc: Lookup the encoder from the register at boot

Maxime Ripard <[email protected]>
drm/vc4: crtc: Fix vc4_get_crtc_encoder logic

Maxime Ripard <[email protected]>
drm/vc4: crtc: Pass the drm_atomic_state to config_pv

Yang Yingliang <[email protected]>
net: ftgmac100: add missing error return code in ftgmac100_probe()

Aurabindo Pillai <[email protected]>
drm/amd/display: take dc_lock in short pulse handler only

Zhan Liu <[email protected]>
drm/amd/display: Avoid HPD IRQ in GPU reset state

Roman Li <[email protected]>
drm/amd/display: fix potential gpu reset deadlock

Jerome Brunet <[email protected]>
clk: meson: g12a: fix gp0 and hifi ranges

Wei Yongjun <[email protected]>
net: qrtr: ns: Fix error return code in qrtr_ns_init()

Thomas Hellstrom <[email protected]>
drm/vmwgfx: Fix cpu updates of coherent multisample surfaces

Thomas Hellstrom <[email protected]>
drm/vmwgfx: Mark a surface gpu-dirty after the SVGA3dCmdDXGenMips command

Yixian Liu <[email protected]>
RDMA/hns: Remove the condition of light load for posting DWQE

Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a77990: JTAG pins do not have pull-down capabilities

Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a7796: Add missing bias for PRESET# pin

Andy Shevchenko <[email protected]>
net: pch_gbe: Propagate error from devm_gpio_request_one()

Andy Shevchenko <[email protected]>

    net: mvpp2: Put fwnode in error case during ->probe()

Lucas Stach <[email protected]>
drm/imx: ipuv3-plane: fix PRG modifiers after drm managed resource conversion

Philipp Zabel <[email protected]>
drm/imx: ipuv3-plane: do not advertise YUV formats on planes without CSC

Christophe JAILLET <[email protected]>
video: fbdev: imxfb: Fix an error message

Takashi Iwai <[email protected]>
drm/ast: Fix missing conversions to managed API

Yingjie Wang <[email protected]>
drm/amd/dc: Fix a missing check bug in dm_dp_mst_detect()

Douglas Anderson <[email protected]>
drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable()

Robert Foss <[email protected]>
drm/bridge/sii8620: fix dependency on extcon

Sabrina Dubroca <[email protected]>
xfrm: xfrm_state_mtu should return at least 1280 for ipv6

Liu Shixin <[email protected]>
mm/page_alloc: fix counting of managed_pages

Waiman Long <[email protected]>
mm: memcg/slab: properly set up gfp flags for objcg pointer array

Miaohe Lin <[email protected]>
mm/shmem: fix shmem_swapin() race with swapoff

Miaohe Lin <[email protected]>
swap: fix do_swap_page() race with swapoff

Nicolas Saenz Julienne <[email protected]>
mm: mmap_lock: use local locks instead of disabling preemption

Anshuman Khandual <[email protected]>
mm/debug_vm_pgtable: ensure THP availability via has_transparent_hugepage()

Jan Kara <[email protected]>
dax: fix ENOMEM handling in grab_mapping_entry()

Dan Carpenter <[email protected]>
ocfs2: fix snprintf() checking

Ming Lei <[email protected]>

    blk-mq: update hctx->dispatch_busy in case of real scheduler

Edward Hsieh <[email protected]>
block: fix trace completion for chained bio

Chanwoo Choi <[email protected]>
PM / devfreq: passive: Fix get_target_freq when not using required-opp

Rafael J. Wysocki <[email protected]>

    cpufreq: Make cpufreq_online() call driver->offline() on errors

Nathan Chancellor <[email protected]>
ACPI: bgrt: Fix CFI violation

Zhang Yi <[email protected]>
blk-wbt: make sure throttle is enabled properly

Zhang Yi <[email protected]>
blk-wbt: introduce a new disable state to prevent false positive by rwb_enabled()

Randy Dunlap <[email protected]>
EDAC/igen6: fix core dependency

Xiaofei Tan <[email protected]>
ACPI: APEI: fix synchronous external aborts in user-mode

Matti Vaittinen <[email protected]>
extcon: extcon-max8997: Fix IRQ freeing at error path

Tony Lindgren <[email protected]>
clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG

Guoqing Jiang <[email protected]>
md: revert io stats accounting

Christoph Hellwig <[email protected]>
mark pstore-blk as broken

Krzysztof Wilczyński <[email protected]>
ACPI: sysfs: Fix a buffer overrun problem with description_show()

Jing Xiangfeng <[email protected]>
ACPI: tables: FPDT: Add missing acpi_put_table() in acpi_init_fpdt()

Mario Limonciello <[email protected]>
nvme-pci: look for StorageD3Enable on companion ACPI device instead

Praveen Kumar <[email protected]>
x86/hyperv: fix logical processor creation

Ming Lei <[email protected]>
block: avoid double io accounting for flush request

Rafael J. Wysocki <[email protected]>
ACPI: PM / fan: Put fan device IDs into separate header file

YueHaibing <[email protected]>
PM / devfreq: Add missing error code in devfreq_add_device()

Arnd Bergmann <[email protected]>
EDAC/aspeed: Use proper format string for printing resource

Dafna Hirschfeld <[email protected]>
media: mtk-vpu: on suspend, read/write regs only if vpu is running

Philipp Zabel <[email protected]>
media: video-mux: Skip dangling endpoints

Sean Christopherson <[email protected]>
KVM: selftests: Remove errant asm/barrier.h include to fix arm64 build

Hou Wenlong <[email protected]>
KVM: selftests: fix triple fault if ept=0 in dirty_log_test

Zhaoyang Huang <[email protected]>
psi: Fix race between psi_trigger_create/destroy

Herbert Xu <[email protected]>
crypto: nx - Fix RCU warning in nx842_OF_upd_status

Mirko Vogt <mirko-dev|[email protected]>
spi: spi-sun6i: Fix chipselect/clock bug

Peter Zijlstra <[email protected]>
lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING

Peter Zijlstra <[email protected]>
lockdep: Fix wait-type for empty stack

Qais Yousef <[email protected]>
sched/uclamp: Fix uclamp_tg_restrict()

Vincent Donnefort <[email protected]>
sched/rt: Fix Deadline utilization tracking during policy change

Vincent Donnefort <[email protected]>
sched/rt: Fix RT utilization tracking during policy change

Joerg Roedel <[email protected]>
x86/sev: Split up runtime #VC handler for correct state tracking

Joerg Roedel <[email protected]>
x86/sev: Make sure IRQs are disabled while GHCB is active

David Sterba <[email protected]>
btrfs: clear log tree recovering status if starting transaction fails

Axel Lin <[email protected]>
regulator: hi6421v600: Fix setting idle mode

Axel Lin <[email protected]>
regulator: hi655x: Fix pass wrong pointer to config.driver_data

Alexandru Elisei <[email protected]>
KVM: arm64: Don't zero the cycle count register when PMCR_EL0.P is set

Tuan Phan <[email protected]>
perf/arm-cmn: Fix invalid pointer when access dtc object sharing the same IRQ number

Kai Huang <[email protected]>
KVM: x86/mmu: Fix pf_fixed count in tdp_mmu_map_handle_target_level()

Sean Christopherson <[email protected]>
KVM: x86/mmu: Drop redundant trace_kvm_mmu_set_spte() in the TDP MMU

Kai Huang <[email protected]>
KVM: x86/mmu: Fix return value in tdp_mmu_map_handle_target_level()

Sean Christopherson <[email protected]>
KVM: nVMX: Don't clobber nested MMU's A/D status on EPTP switch

Sean Christopherson <[email protected]>
KVM: nVMX: Ensure 64-bit shift when checking VMFUNC bitmap

Sean Christopherson <[email protected]>
KVM: nVMX: Sync all PGDs on nested transition with shadow paging

Guenter Roeck <[email protected]>
hwmon: (max31790) Fix fan speed reporting for fan7..12

Guenter Roeck <[email protected]>
hwmon: (max31722) Remove non-standard ACPI device IDs

Guenter Roeck <[email protected]>
hwmon: (lm70) Revert "hwmon: (lm70) Add support for ACPI"

Jacopo Mondi <[email protected]>

    media: i2c: rdacm21: Power up OV10640 before OV490

Jacopo Mondi <[email protected]>

    media: i2c: rdacm21: Fix OV10640 powerup

Dillon Min <[email protected]>

    media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx

Arnd Bergmann <[email protected]>
media: subdev: remove VIDIOC_DQEVENT_TIME32 handling

Arnd Bergmann <[email protected]>
media: v4l2-core: ignore native time32 ioctls on 64-bit

Anshuman Khandual <[email protected]>
arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan

Zhen Lei <[email protected]>
mmc: usdhi6rol0: fix error return code in usdhi6_probe()

Hongbo Li <[email protected]>
crypto: sm2 - fix a memory leak in sm2

Hangbin Liu <[email protected]>
crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit

Zhang Qilong <[email protected]>
crypto: omap-sham - Fix PM reference leak in omap sham ops

Tong Tiangen <[email protected]>
crypto: nitrox - fix unchecked variable in nitrox_register_interrupts

Axel Lin <[email protected]>
regulator: fan53880: Fix vsel_mask setting for FAN53880_BUCK

Gustavo A. R. Silva <[email protected]>
media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2()

Randy Dunlap <[email protected]>
m68k: atari: Fix ATARI_KBD_CORE kconfig unmet dependency warning

Johan Hovold <[email protected]>
media: gspca/gl860: fix zero-length control requests

Joe Richey <[email protected]>
media: vicodec: Use _BITUL() macro in UAPI headers

Zhen Lei <[email protected]>

    media: tc358743: Fix error return code in tc358743_probe_of()

Dan Carpenter <[email protected]>
media: au0828: fix a NULL vs IS_ERR() check

Lv Yunlong <[email protected]>
media: exynos4-is: Fix a use after free in isp_video_release

Ezequiel Garcia <[email protected]>
media: rkvdec: Fix .buf_prepare

Andy Shevchenko <[email protected]>
media: ipu3-cio2: Fix reference counting when looping over ACPI devices

Valentin Schneider <[email protected]>
sched: Don't defer CPU pick to migration_cpu_stop()

Randy Dunlap <[email protected]>
locking/lockdep: Reduce LOCKDEP dependency list

Sergey Shtylyov <[email protected]>
pata_ep93xx: fix deferred probing

Christophe JAILLET <[email protected]>
media: rc: i2c: Fix an error message

Christophe JAILLET <[email protected]>
crypto: ccp - Fix a resource leak in an error handling path

Suman Anna <[email protected]>
crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe()

Suman Anna <[email protected]>
crypto: sa2ul - Fix leaks on failure paths with sa_dma_init()

Joe Richey <[email protected]>
x86/elf: Use _BITUL() macro in UAPI headers

Mimi Zohar <[email protected]>
evm: fix writing <securityfs>/evm overflow

Sergey Shtylyov <[email protected]>
pata_octeon_cf: avoid WARN_ON() in ata_host_activate()

Josh Poimboeuf <[email protected]>
kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n'

Qais Yousef <[email protected]>
sched/uclamp: Fix locking around cpu_util_update_eff()

Qais Yousef <[email protected]>
sched/uclamp: Fix wrong implementation of cpu.uclamp.min

Randy Dunlap <[email protected]>
media: I2C: change 'RST' to "RSET" to fix multiple build errors

Sergey Shtylyov <[email protected]>
pata_rb532_cf: fix deferred probing

Sergey Shtylyov <[email protected]>
sata_highbank: fix deferred probing

Zhen Lei <[email protected]>
crypto: ux500 - Fix error return code in hash_hw_final()

Corentin Labbe <[email protected]>
crypto: ixp4xx - update IV after requests

Corentin Labbe <[email protected]>
crypto: ixp4xx - dma_unmap the correct address

Mauro Carvalho Chehab <[email protected]>
media: hantro: do a PM resume earlier

Mauro Carvalho Chehab <[email protected]>
media: i2c: ccs-core: return the right error code at suspend

Mauro Carvalho Chehab <[email protected]>
media: s5p_cec: decrement usage count if disabled

Mauro Carvalho Chehab <[email protected]>
media: venus: Rework error fail recover logic

Andy Shevchenko <[email protected]>
spi: Avoid undefined behaviour when counting unused native CSs

Andy Shevchenko <[email protected]>
spi: Allow to have all native CSs in use along with GPIOs

Daniel Axtens <[email protected]>
mm: define default MAX_PTRS_PER_* in include/pgtable.h

Roman Gushchin <[email protected]>
writeback, cgroup: increment isw_nr_in_flight before grabbing an inode

Arnd Bergmann <[email protected]>
ia64: mca_drv: fix incorrect array size calculation

Petr Mladek <[email protected]>
kthread_worker: fix return value when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync()

Ming Lei <[email protected]>
block: fix discard request merge

Shawn Guo <[email protected]>
mailbox: qcom: Use PLATFORM_DEVID_AUTO to register platform device

Jan Kara <[email protected]>
bfq: Remove merged request already in bfq_requests_merged()

Steve French <[email protected]>

    cifs: fix missing spinlock around update to ses->status

Jason Gerecke <[email protected]>
HID: wacom: Correct base usage for capacitive ExpressKey status bits

Steve French <[email protected]>
smb3: fix possible access to uninitialized pointer to DACL

Richard Fitzgerald <[email protected]>
ACPI: tables: Add custom DSDT file as makefile prerequisite

Javier Martinez Canillas <[email protected]>
tpm_tis_spi: add missing SPI device ID entries

Paul E. McKenney <[email protected]>
clocksource: Check per-CPU clock synchronization when marked unstable

Paul E. McKenney <[email protected]>
clocksource: Retry clock read if long delays detected

Zhang Rui <[email protected]>
ACPI: EC: trust DSDT GPE for certain HP laptop

Steve French <[email protected]>
smb3: fix uninitialized value for port in witness protocol move

Paulo Alcantara <[email protected]>
cifs: fix check of dfs interlinks

Ronnie Sahlberg <[email protected]>
cifs: improve fallocate emulation

Haiyang Zhang <[email protected]>
PCI: hv: Add check for hyperv_initialized in init_hv_pci_drv()

Srinivas Pandruvada <[email protected]>
tools/power/x86/intel-speed-select: Fix uncore memory frequency display

Tony Luck <[email protected]>
EDAC/Intel: Do not load EDAC driver when running as a guest

Hannes Reinecke <[email protected]>
nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst()

JK Kim <[email protected]>
nvme-pci: fix var. type for increasing cq_head

Jiapeng Chong <[email protected]>
platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard()

Luke D. Jones <[email protected]>
platform/x86: asus-nb-wmi: Revert "add support for ASUS ROG Zephyrus G14 and G15"

Luke D. Jones <[email protected]>
platform/x86: asus-nb-wmi: Revert "Drop duplicate DMI quirk structures"

Ming Lei <[email protected]>
block: fix race between adding/removing rq qos and normal IO

Pascal Giard <[email protected]>
HID: sony: fix freeze when inserting ghlive ps3/wii dongles

Zoltan Tamas Vajda <[email protected]>
HID: hid-input: add Surface Go battery quirk

Hui Wang <[email protected]>
ACPI: resources: Add checks for ACPI IRQ override

Hanjun Guo <[email protected]>
ACPI: bus: Call kobject_put() in acpi_init() error path

Erik Kaneda <[email protected]>
ACPICA: Fix memory leak caused by _CID repair function

Alexander Aring <[email protected]>
fs: dlm: fix memory leak when fenced

Alexander Aring <[email protected]>
fs: dlm: fix lowcomms_start error case

Jiapeng Chong <[email protected]>
drivers: hv: Fix missing error code in vmbus_connect()

Christian Brauner <[email protected]>
open: don't silently ignore unknown O-flags in openat2()

Richard Fitzgerald <[email protected]>
random32: Fix implicit truncation warning in prandom_seed_state()

Alexander Aring <[email protected]>
fs: dlm: cancel work sync othercon

Alexander Aring <[email protected]>
fs: dlm: reconnect if socket error report occurs

Ming Lei <[email protected]>

    blk-mq: clear stale request in tags->rq[] before freeing one request pool

Ming Lei <[email protected]>

    blk-mq: grab rq->refcount before calling ->fn in blk_mq_tagset_busy_iter

zhangyi (F) <[email protected]>
block_dump: remove block_dump feature in mark_inode_dirty()

Chris Chiu <[email protected]>
ACPI: EC: Make more Asus laptops use ECDT _GPE

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add info for the Goodix GT912 panel of TM800A550L tablets

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add an extra entry for the upside down Goodix touchscreen on Teclast X89 tablets

Hans de Goede <[email protected]>
Input: goodix - platform/x86: touchscreen_dmi - Move upside down quirks to touchscreen_dmi.c

Richard Fitzgerald <[email protected]>
lib: vsprintf: Fix handling of number field widths in vsscanf

YueHaibing <[email protected]>
hv_utils: Fix passing zero to 'PTR_ERR' warning

Mario Limonciello <[email protected]>
ACPI: processor idle: Fix up C-state latency if not ordered

Alex Deucher <[email protected]>
ACPI: PM: s2idle: Add missing LPS0 functions for AMD

Bixuan Cui <[email protected]>
EDAC/ti: Add missing MODULE_DEVICE_TABLE

Dmitry Torokhov <[email protected]>
HID: do not use down_interruptible() when unbinding devices

Luke D Jones <[email protected]>
ACPI: video: use native backlight for GA401/GA502/GA503

Shuah Khan <[email protected]>
media: Fix Media Controller API config checks

Axel Lin <[email protected]>
regulator: da9052: Ensure enough delay time for .set_voltage_time_sel

Hsin-Hsiung Wang <[email protected]>
regulator: mt6358: Fix vdram2 .vsel_mask

Heiko Carstens <[email protected]>
KVM: s390: get rid of register asm usage

Boqun Feng <[email protected]>
lockding/lockdep: Avoid to find wrong lock dep path in check_irq_usage()

Boqun Feng <[email protected]>
locking/lockdep: Fix the dep path printing for backwards BFS

Christophe Leroy <[email protected]>
btrfs: disable build on platforms having page size 256K

Qu Wenruo <[email protected]>
btrfs: don't clear page extent mapped if we're not invalidating the full page

David Sterba <[email protected]>
btrfs: sysfs: fix format string for some discard stats

Josef Bacik <[email protected]>
btrfs: always abort the transaction if we abort a trans handle

Josef Bacik <[email protected]>
btrfs: abort transaction if we fail to update the delayed inode

Josef Bacik <[email protected]>
btrfs: fix error handling in __btrfs_update_delayed_inode

Suraj Jitindar Singh <[email protected]>
KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors

Marc Zyngier <[email protected]>
KVM: arm64: Restore PMU configuration on first run

Jing Xiangfeng <[email protected]>
drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()

Lukasz Luba <[email protected]>
sched/fair: Take thermal pressure into account while estimating energy

Guenter Roeck <[email protected]>
hwmon: (max31790) Fix pwmX_enable attributes

Guenter Roeck <[email protected]>
hwmon: (max31790) Report correct current pwm duty cycles

Steve Longerbeam <[email protected]>
media: imx-csi: Skip first few frames from a BT.656 source

Mauro Carvalho Chehab <[email protected]>
media: siano: fix device register error path

Mauro Carvalho Chehab <[email protected]>
media: dvbdev: fix error logic at dvb_register_device()

Mauro Carvalho Chehab <[email protected]>
media: dvb_net: avoid speculation from net slot

Ard Biesheuvel <[email protected]>
crypto: shash - avoid comparing pointers to exported functions under CFI

Axel Lin <[email protected]>
regulator: mt6315: Fix checking return value of devm_regmap_init_spmi_ext

zpershuai <[email protected]>
spi: meson-spicc: fix memory leak in meson_spicc_probe

zpershuai <[email protected]>
spi: meson-spicc: fix a wrong goto jump for avoiding memory leak.

Andrew Jeffery <[email protected]>
mmc: sdhci-of-aspeed: Turn down a phase correction warning

Zheyu Ma <[email protected]>
mmc: via-sdmmc: add a check against NULL pointer dereference

Krzysztof Kozlowski <[email protected]>
mmc: sdhci-sprd: use sdhci_sprd_writew

Tong Zhang <[email protected]>
memstick: rtsx_usb_ms: fix UAF

Dongliang Mu <[email protected]>
media: dvd_usb: memory leak in cinergyt2_fe_attach

Nick Desaulniers <[email protected]>
Makefile: fix GDB warning with CONFIG_RELR

Kai Ye <[email protected]>
crypto: hisilicon/sec - fixup 3des minimum key size declaration

Evgeny Novikov <[email protected]>
media: st-hva: Fix potential NULL pointer dereferences

Zheyu Ma <[email protected]>
media: bt8xx: Fix a missing check bug in bt878_probe

Lv Yunlong <[email protected]>
media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release

Andrzej Pietrasiewicz <[email protected]>
media: cedrus: Fix .buf_prepare

Andrzej Pietrasiewicz <[email protected]>
media: hantro: Fix .buf_prepare

Igor Matheus Andrade Torrente <[email protected]>
media: em28xx: Fix possible memory leak of em28xx struct

Tong Zhang <[email protected]>
media: bt878: do not schedule tasklet when it is not setup

Dillon Min <[email protected]>
media: i2c: ov2659: Use clk_{prepare_enable,disable_unprepare}() to set xvclk on/off

Roberto Sassu <[email protected]>
ima: Don't remove security.ima if file must not be appraised

Odin Ugedal <[email protected]>
sched/fair: Fix ascii art by relpacing tabs

Tian Tao <[email protected]>
arm64: perf: Convert snprintf to sysfs_emit

Thara Gopinath <[email protected]>
crypto: qce: skcipher: Fix incorrect sg count for dma transfers

Jack Xu <[email protected]>
crypto: qat - remove unused macro in FW loader

Jack Xu <[email protected]>
crypto: qat - check return code of qat_hal_rd_rel_reg()

Laurent Pinchart <[email protected]>
media: imx: imx7_mipi_csis: Fix logging of only error event counters

Anirudh Rayabharam <[email protected]>
media: pvrusb2: fix warning in pvr2_i2c_core_done

Jernej Skrabec <[email protected]>
media: hevc: Fix dependent slice segment flags

Hans Verkuil <[email protected]>
media: cobalt: fix race condition in setting HPD

Pavel Skripkin <[email protected]>
media: cpia2: fix memory leak in cpia2_usb_probe

Valentin Schneider <[email protected]>
sched: Make the idle task quack like a per-CPU kthread

Mauro Carvalho Chehab <[email protected]>

    media: sti: fix obj-$(config) targets

Bixuan Cui <[email protected]>
crypto: nx - add missing MODULE_DEVICE_TABLE

Łukasz Stelmach <[email protected]>
hwrng: exynos - Fix runtime PM imbalance on error

Valentin Schneider <[email protected]>
sched/core: Initialize the idle task with preemption disabled

Zou Wei <[email protected]>
regulator: uniphier: Add missing MODULE_DEVICE_TABLE

Tian Tao <[email protected]>
spi: omap-100k: Fix the length judgment problem

Jay Fang <[email protected]>
spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages()

Jay Fang <[email protected]>
spi: spi-loopback-test: Fix 'tx_buf' might be 'rx_buf'

Mauro Carvalho Chehab <[email protected]>
media: exynos-gsc: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: exynos4-is: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: sti/bdisp: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: sunxi: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: s5p-jpeg: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: mtk-vcodec: fix PM runtime get logic

Mauro Carvalho Chehab <[email protected]>
media: sh_vou: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: am437x: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: s5p: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: mdk-mdp: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: marvel-ccic: fix some issues when getting pm_runtime

Mauro Carvalho Chehab <[email protected]>
media: i2c: imx334: fix the pm runtime get logic

Mauro Carvalho Chehab <[email protected]>
staging: media: rkvdec: fix pm_runtime_get_sync() usage count

Alexey Gladkov <[email protected]>
Add a reference to ucounts for each cred

Charles Keepax <[email protected]>
spi: Make of_register_spi_device also set the fwnode

Lukasz Luba <[email protected]>
thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure

Miklos Szeredi <[email protected]>
fuse: reject internal errno

Miklos Szeredi <[email protected]>

    fuse: check connected before queueing on fpq->io

Miklos Szeredi <[email protected]>
fuse: ignore PG_workingset after stealing

Greg Kurz <[email protected]>
fuse: Fix infinite loop in sget_fc()

Greg Kurz <[email protected]>
fuse: Fix crash if superblock of submount gets killed early

Greg Kurz <[email protected]>
fuse: Fix crash in fuse_dentry_automount() error path

Roberto Sassu <[email protected]>
evm: Refuse EVM_ALLOW_METADATA_WRITES only if an HMAC key is loaded

Roberto Sassu <[email protected]>
evm: Execute evm_inode_init_security() only when an HMAC key is loaded

Kristian Klausen <[email protected]>
loop: Fix missing discard support when using LOOP_CONFIGURE

Kan Liang <[email protected]>
perf/x86/intel: Fix instructions:ppp support in Sapphire Rapids

Kan Liang <[email protected]>
perf/x86/intel: Add more events requires FRONTEND MSR on Sapphire Rapids

Tejas Upadhyay <[email protected]>
x86/gpu: add JasperLake to gen11 early quirks

Michael Ellerman <[email protected]>
powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()

Yun Zhou <[email protected]>
seq_buf: Make trace_seq_putmem_hex() support data longer than 8

Steven Rostedt (VMware) <[email protected]>
tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing

Steven Rostedt (VMware) <[email protected]>
tracing/histograms: Fix parsing of "sym-offset" modifier

Martin Fuzzey <[email protected]>
rsi: fix AP mode with WPA failure due to encrypted EAPOL

Marek Vasut <[email protected]>
rsi: Assign beacon rate settings to the correct rate_info descriptor field

Michael Buesch <[email protected]>
ssb: sdio: Don't overwrite const buffer if block_write fails

Pali Rohár <[email protected]>
ath9k: Fix kernel NULL pointer dereference during ath_reset_internal()

Ondrej Zary <[email protected]>
serial_cs: remove wrong GLOBETROTTER.cis entry

Ondrej Zary <[email protected]>
serial_cs: Add Option International GSM-Ready 56K/ISDN modem

Yoshihiro Shimoda <[email protected]>
serial: sh-sci: Stop dmaengine transfer in sci_stop_tx()

Pali Rohár <[email protected]>
serial: mvebu-uart: fix calculation of clock divisor

Hans de Goede <[email protected]>
iio: accel: bmc150: Don't make the remove function of the second accelerometer unregister itself

Hans de Goede <[email protected]>
iio: accel: bmc150: Fix dereferencing the wrong pointer in bmc150_get/set_second_device

Stephan Gerhold <[email protected]>
iio: accel: bmc150: Fix bma222 scale unit

Stephan Gerhold <[email protected]>
iio: accel: bma180: Fix BMA25x bandwidth register values

Oliver Lang <[email protected]>
iio: ltr501: ltr501_read_ps(): add missing endianness conversion

Oliver Lang <[email protected]>
iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR

Marc Kleine-Budde <[email protected]>
iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too

frank zago <[email protected]>
iio: light: tcs3472: do not free unallocated IRQ

Yang Yingliang <[email protected]>
iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()

Martin Fuzzey <[email protected]>
rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path

Dinh Nguyen <[email protected]>
clk: agilex/stratix10: fix bypass representation

Dinh Nguyen <[email protected]>
clk: agilex/stratix10: remove noc_clk

Dinh Nguyen <[email protected]>
clk: agilex/stratix10/n5x: fix how the bypass_reg is handled

Damien Le Moal <[email protected]>

    clk: k210: Fix k210_clk_set_parent()

Shin'ichiro Kawasaki <[email protected]>
f2fs: Prevent swap file in LFS mode

Daniel Rosenberg <[email protected]>
f2fs: Advertise encrypted casefolding in sysfs

Janosch Frank <[email protected]>
s390: mm: Fix secure storage access exception handling

Vineeth Vijayan <[email protected]>
s390/cio: dont call css_wait_for_slow_path() inside a lock

Sean Christopherson <[email protected]>
KVM: x86: Force all MMUs to reinitialize if guest CPUID is modified

Sean Christopherson <[email protected]>
KVM: x86: Properly reset MMU context at vCPU RESET/INIT

Sean Christopherson <[email protected]>
KVM: x86/mmu: Use MMU's role to detect CR4.SMEP value in nested NPT walk

Sean Christopherson <[email protected]>
KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs

Nathan Chancellor <[email protected]>
KVM: PPC: Book3S HV: Workaround high stack usage with clang

Sean Christopherson <[email protected]>
KVM: nVMX: Handle split-lock #AC exceptions that happen in L2

Robin Murphy <[email protected]>
perf/smmuv3: Don't trample existing events with global filter

Jann Horn <[email protected]>
mm/gup: fix try_grab_compound_head() race with split_huge_page()

Christophe JAILLET <[email protected]>
bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls

Baochen Qiang <[email protected]>
bus: mhi: Wait for M2 state during system resume

Zhang Xiaoxu <[email protected]>
SUNRPC: Should wake up the privileged task firstly.

Zhang Xiaoxu <[email protected]>
SUNRPC: Fix the batch tasks count wraparound.

Abinaya Kalaiselvan <[email protected]>
mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices

Felix Fietkau <[email protected]>
mac80211: remove iwlwifi specific workaround that broke sta NDP tx

Stephane Grosjean <[email protected]>
can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path

Oleksij Rempel <[email protected]>
can: j1939: j1939_sk_init(): set SOCK_RCU_FREE to call sk_destruct() after RCU is done

Oliver Hartkopp <[email protected]>
can: isotp: isotp_release(): omit unintended hrtimer restart on socket release

Oliver Hartkopp <[email protected]>
can: gw: synchronize rcu operations before removing gw job entry

Thadeu Lima de Souza Cascardo <[email protected]>
can: bcm: delay release of struct bcm_op after synchronize_rcu()

Stephen Brennan <[email protected]>
ext4: use ext4_grp_locked_error in mb_find_extent

Pan Dong <[email protected]>
ext4: fix avefreec in find_group_orlov

Zhang Yi <[email protected]>
ext4: remove check for zero nr_to_scan in ext4_es_scan()

Zhang Yi <[email protected]>
ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit

Yang Yingliang <[email protected]>
ext4: return error code when ext4_fill_flex_info() fails

Jan Kara <[email protected]>
ext4: fix overflow in ext4_iomap_alloc()

Anirudh Rayabharam <[email protected]>
ext4: fix kernel infoleak via ext4_extent_header

Zhang Yi <[email protected]>
ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transaction handle

David Sterba <[email protected]>
btrfs: clear defrag status of a root if starting transaction fails

Naohiro Aota <[email protected]>
btrfs: fix unbalanced unlock in qgroup_account_snapshot()

David Sterba <[email protected]>
btrfs: compression: don't try to compress if we don't have enough pages

Filipe Manana <[email protected]>
btrfs: send: fix invalid path for unlink operations after parent orphanization

Johannes Thumshirn <[email protected]>
btrfs: zoned: bail out if we can't read a reliable write pointer

Naohiro Aota <[email protected]>
btrfs: zoned: print message when zone sanity check type fails

Ludovic Desroches <[email protected]>
ARM: dts: at91: sama5d4: fix pinctrl muxing

Linus Walleij <[email protected]>
ARM: dts: ux500: Fix LED probing

Yang Jihong <[email protected]>
arm_pmu: Fix write counter incorrect in ARMv7 big-endian mode

Joerg Roedel <[email protected]>
crypto: ccp - Annotate SEV Firmware file names

Kees Cook <[email protected]>
crypto: nx - Fix memcpy() over-reading in nonce

Alexander Larkin <[email protected]>
Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl

Takashi Iwai <[email protected]>
Input: elants_i2c - fix NULL dereference at probing

Al Viro <[email protected]>
iov_iter_fault_in_readable() should do nothing in xarray case

Al Viro <[email protected]>
copy_page_to_iter(): fix ITER_DISCARD case

Kees Cook <[email protected]>
selftests/lkdtm: Avoid needing explicit sub-shell

Desmond Cheong Zhi Xi <[email protected]>
ntfs: fix validity check for file name attribute

Andreas Gruenbacher <[email protected]>
gfs2: Fix error handling in init_statfs

Andreas Gruenbacher <[email protected]>
gfs2: Fix underflow in gfs2_page_mkwrite

Mike Rapoport <[email protected]>
mm/page_alloc: fix memory map initialization for descending nodes

Zhangjiantao (Kirin, nanjing) <[email protected]>
xhci: solve a double free problem while doing s4

Jing Xiangfeng <[email protected]>
usb: typec: Add the missed altmode_id_remove() in typec_register_altmode()

Kyle Tso <[email protected]>
usb: typec: tcpm: Relax disconnect threshold during power negotiation

Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpci: Fix up sink disconnect thresholds for PD

Minas Harutyunyan <[email protected]>
usb: dwc3: Fix debugfs creation flow

Hannu Hartikainen <[email protected]>
USB: cdc-acm: blacklist Heimann USB Appset device

Moritz Fischer <[email protected]>
usb: renesas-xhci: Fix handling of unknown ROM state

Linyu Yuan <[email protected]>
usb: gadget: eem: fix echo command packet response issue

Pavel Skripkin <[email protected]>
net: can: ems_usb: fix use-after-free in ems_usb_disconnect()

Johan Hovold <[email protected]>
Input: usbtouchscreen - fix control-request directions

Pavel Skripkin <[email protected]>
media: dvb-usb: fix wrong definition

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 830 G8 Notebook PC

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Apply LED fixup for HP Dragonfly G1, too

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix bass speaker DAC mapping for Asus UM431D

Elia Devito <[email protected]>

    ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook x360 830 G8

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Add another ALC236 variant support

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 630 G8

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 445 G8

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 450 G8

Takashi Iwai <[email protected]>
ALSA: intel8x0: Fix breakage at ac97 clock measurement

Takashi Iwai <[email protected]>
ALSA: usb-audio: scarlett2: Fix wrong resume call

Takashi Sakamoto <[email protected]>
ALSA: firewire-motu: fix stream format for MOTU 8pre FireWire

Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix OOB access at proc output

Daehwan Jung <[email protected]>
ALSA: usb-audio: fix rate on Ozone Z90 USB headset

Szymon Janc <[email protected]>
Bluetooth: Remove spurious error message

Connor Abbott <[email protected]>
Bluetooth: btqca: Don't modify firmware contents in-place

Pavel Skripkin <[email protected]>
Bluetooth: hci_qca: fix potential GPF

-------------

Diffstat:

 Documentation/ABI/testing/evm                      |  26 +-
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |   8 +-
 Documentation/admin-guide/kernel-parameters.txt    |   6 +
 Documentation/hwmon/max31790.rst                   |   5 +-
 .../userspace-api/media/v4l/ext-ctrls-codec.rst    |   5 +-
 Makefile                                           |   6 +-
 arch/alpha/kernel/smp.c                            |   1 -
 arch/arc/kernel/smp.c                              |   1 -
 arch/arm/boot/dts/sama5d4.dtsi                     |   2 +-
 arch/arm/boot/dts/ste-href.dtsi                    |   7 +
 arch/arm/kernel/perf_event_v7.c                    |   4 +-
 arch/arm/kernel/smp.c                              |   1 -
 arch/arm64/boot/dts/marvell/armada-37xx.dtsi       |   2 +-
 arch/arm64/include/asm/kvm_host.h                  |   1 +
 arch/arm64/include/asm/mmu_context.h               |   4 +-
 arch/arm64/include/asm/preempt.h                   |   2 +-
 arch/arm64/kernel/perf_event.c                     |   2 +-
 arch/arm64/kernel/setup.c                          |   2 +-
 arch/arm64/kernel/smp.c                            |   1 -
 arch/arm64/kvm/arm.c                               |   4 +
 arch/arm64/kvm/pmu-emul.c                          |   4 +
 arch/csky/kernel/smp.c                             |   1 -
 arch/csky/mm/syscache.c                            |  11 +-
 arch/ia64/kernel/mca_drv.c                         |   2 +-
 arch/ia64/kernel/smpboot.c                         |   1 -
 arch/m68k/Kconfig.machine                          |   3 +
 arch/mips/include/asm/highmem.h                    |   2 +-
 arch/mips/kernel/smp.c                             |   1 -
 arch/openrisc/kernel/smp.c                         |   2 -
 arch/parisc/kernel/smp.c                           |   1 -
 arch/powerpc/include/asm/cputhreads.h              |  30 ++
 arch/powerpc/include/asm/interrupt.h               |   3 +
 arch/powerpc/include/asm/kvm_guest.h               |   4 +-
 arch/powerpc/kernel/firmware.c                     |  10 +-
 arch/powerpc/kernel/mce_power.c                    |  48 +-
 arch/powerpc/kernel/process.c                      |  48 +-
 arch/powerpc/kernel/smp.c                          |  12 +-
 arch/powerpc/kernel/stacktrace.c                   |  26 +-
 arch/powerpc/kvm/book3s_hv.c                       |  13 +-
 arch/powerpc/kvm/book3s_hv_builtin.c               |   2 +-
 arch/powerpc/kvm/book3s_hv_nested.c                |   3 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                |   2 +-
 arch/powerpc/platforms/pseries/papr_scm.c          |  62 ++-
 arch/powerpc/platforms/pseries/smp.c               |   4 +-
 arch/riscv/kernel/smpboot.c                        |   1 -
 arch/s390/Kconfig                                  |   3 +-
 arch/s390/boot/uv.c                                |   1 +
 arch/s390/include/asm/pgtable.h                    |  21 +-
 arch/s390/include/asm/preempt.h                    |   4 +-
 arch/s390/include/asm/uv.h                         |   8 +-
 arch/s390/kernel/smp.c                             |   1 -
 arch/s390/kernel/uv.c                              |  10 +
 arch/s390/kvm/kvm-s390.c                           |  18 +-
 arch/s390/mm/fault.c                               |  26 ++
 arch/sh/kernel/smp.c                               |   2 -
 arch/sparc/kernel/smp_32.c                         |   1 -
 arch/sparc/kernel/smp_64.c                         |   3 -
 arch/x86/crypto/curve25519-x86_64.c                |   2 +-
 arch/x86/entry/entry_64.S                          |   4 +-
 arch/x86/events/intel/core.c                       |   6 +-
 arch/x86/include/asm/idtentry.h                    |  29 +-
 arch/x86/include/asm/kvm_host.h                    |   3 +-
 arch/x86/include/asm/preempt.h                     |   2 +-
 arch/x86/include/uapi/asm/hwcap2.h                 |   6 +-
 arch/x86/kernel/cpu/mshyperv.c                     |   2 +-
 arch/x86/kernel/early-quirks.c                     |   1 +
 arch/x86/kernel/sev-es.c                           | 182 ++++----
 arch/x86/kernel/smpboot.c                          |   1 -
 arch/x86/kernel/tsc.c                              |   3 +-
 arch/x86/kvm/cpuid.c                               |   6 +-
 arch/x86/kvm/hyperv.c                              |   2 +-
 arch/x86/kvm/mmu/mmu.c                             |  22 +-
 arch/x86/kvm/mmu/paging_tmpl.h                     |   3 +-
 arch/x86/kvm/mmu/tdp_mmu.c                         |  13 +-
 arch/x86/kvm/vmx/nested.c                          |  29 +-
 arch/x86/kvm/vmx/vmcs.h                            |   5 +
 arch/x86/kvm/vmx/vmx.c                             |   4 +-
 arch/x86/kvm/vmx/vmx.h                             |   1 +
 arch/x86/kvm/x86.c                                 |  15 +-
 arch/x86/net/bpf_jit_comp.c                        |   2 +-
 arch/xtensa/kernel/smp.c                           |   1 -
 block/bfq-iosched.c                                |  41 +-
 block/bio.c                                        |  13 +-
 block/blk-flush.c                                  |   3 +-
 block/blk-merge.c                                  |   8 +-
 block/blk-mq-tag.c                                 |  49 ++-
 block/blk-mq-tag.h                                 |   6 +
 block/blk-mq.c                                     |  63 ++-
 block/blk-mq.h                                     |   1 +
 block/blk-rq-qos.h                                 |  24 +
 block/blk-wbt.c                                    |  11 +-
 block/blk-wbt.h                                    |   1 +
 crypto/shash.c                                     |  18 +-
 crypto/sm2.c                                       |  24 +-
 drivers/acpi/Makefile                              |   5 +
 drivers/acpi/acpi_fpdt.c                           |   4 +-
 drivers/acpi/acpica/nsrepair2.c                    |   7 +
 drivers/acpi/apei/ghes.c                           |  81 +++-
 drivers/acpi/bgrt.c                                |  57 +--
 drivers/acpi/bus.c                                 |   1 +
 drivers/acpi/device_pm.c                           |   6 +-
 drivers/acpi/device_sysfs.c                        |   2 +-
 drivers/acpi/ec.c                                  |  37 +-
 drivers/acpi/fan.c                                 |   7 +-
 drivers/acpi/fan.h                                 |  13 +
 drivers/acpi/processor_idle.c                      |  40 ++
 drivers/acpi/resource.c                            |   9 +-
 drivers/acpi/video_detect.c                        |  24 +
 drivers/acpi/x86/s2idle.c                          |   4 +
 drivers/ata/pata_ep93xx.c                          |   2 +-
 drivers/ata/pata_octeon_cf.c                       |   5 +-
 drivers/ata/pata_rb532_cf.c                        |   6 +-
 drivers/ata/sata_highbank.c                        |   6 +-
 drivers/block/loop.c                               |   1 +
 drivers/bluetooth/btqca.c                          |  27 +-
 drivers/bluetooth/hci_qca.c                        |   4 +-
 drivers/bus/mhi/core/pm.c                          |   1 +
 drivers/bus/mhi/pci_generic.c                      |   5 +-
 drivers/char/hw_random/exynos-trng.c               |   4 +-
 drivers/char/pcmcia/cm4000_cs.c                    |   4 +
 drivers/char/tpm/tpm_tis_core.c                    |  25 +-
 drivers/char/tpm/tpm_tis_core.h                    |   3 +-
 drivers/char/tpm/tpm_tis_spi_main.c                |   2 +
 drivers/clk/actions/owl-s500.c                     |  75 ++--
 drivers/clk/clk-k210.c                             |   1 +
 drivers/clk/clk-si5341.c                           |  77 +++-
 drivers/clk/clk-versaclock5.c                      |  27 +-
 drivers/clk/imx/clk-imx8mq.c                       |  56 +--
 drivers/clk/meson/g12a.c                           |   2 +-
 drivers/clk/qcom/clk-alpha-pll.c                   |   2 +-
 drivers/clk/qcom/gcc-sc7280.c                      |   1 +
 drivers/clk/socfpga/clk-agilex.c                   |  89 ++--
 drivers/clk/socfpga/clk-periph-s10.c               |  11 +-
 drivers/clk/socfpga/clk-s10.c                      |  87 ++--
 drivers/clk/tegra/clk-tegra30.c                    |   2 +-
 drivers/clocksource/timer-ti-dm.c                  |   6 +
 drivers/cpufreq/cpufreq.c                          |  11 +-
 drivers/crypto/cavium/nitrox/nitrox_isr.c          |   4 +
 drivers/crypto/ccp/sev-dev.c                       |   4 +
 drivers/crypto/ccp/sp-pci.c                        |   6 +-
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |   4 +-
 drivers/crypto/ixp4xx_crypto.c                     |  24 +-
 drivers/crypto/nx/nx-842-pseries.c                 |   9 +-
 drivers/crypto/nx/nx-aes-ctr.c                     |   2 +-
 drivers/crypto/omap-sham.c                         |   4 +-
 drivers/crypto/qat/qat_common/qat_hal.c            |   6 +-
 drivers/crypto/qat/qat_common/qat_uclo.c           |   1 -
 drivers/crypto/qce/skcipher.c                      |  15 +-
 drivers/crypto/sa2ul.c                             |  22 +-
 drivers/crypto/ux500/hash/hash_core.c              |   1 +
 drivers/devfreq/devfreq.c                          |   1 +
 drivers/devfreq/governor_passive.c                 |   3 +-
 drivers/edac/Kconfig                               |   3 +-
 drivers/edac/aspeed_edac.c                         |   4 +-
 drivers/edac/i10nm_base.c                          |   3 +
 drivers/edac/pnd2_edac.c                           |   3 +
 drivers/edac/sb_edac.c                             |   3 +
 drivers/edac/skx_base.c                            |   3 +
 drivers/edac/ti_edac.c                             |   1 +
 drivers/extcon/extcon-max8997.c                    |   3 +-
 drivers/extcon/extcon-sm5502.c                     |   1 -
 drivers/firmware/stratix10-svc.c                   |  22 +-
 drivers/fsi/fsi-core.c                             |   4 +-
 drivers/fsi/fsi-occ.c                              |   1 +
 drivers/fsi/fsi-sbefifo.c                          |  10 +-
 drivers/fsi/fsi-scom.c                             |  16 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  21 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   3 +
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h    |   4 +
 drivers/gpu/drm/ast/ast_main.c                     |   4 +-
 drivers/gpu/drm/bridge/Kconfig                     |   2 +-
 drivers/gpu/drm/drm_bridge.c                       |   3 +
 drivers/gpu/drm/imx/ipuv3-plane.c                  |  57 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c           |   8 +-
 drivers/gpu/drm/msm/dp/dp_catalog.c                |   5 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   |  55 +++
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   2 +
 drivers/gpu/drm/msm/dp/dp_display.c                |  57 ++-
 drivers/gpu/drm/msm/msm_drv.c                      |   1 +
 drivers/gpu/drm/pl111/Kconfig                      |   1 +
 drivers/gpu/drm/qxl/qxl_dumb.c                     |   2 +
 drivers/gpu/drm/rockchip/cdn-dp-core.c             |   1 +
 drivers/gpu/drm/rockchip/cdn-dp-reg.c              |   2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c    |  36 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |   1 +
 drivers/gpu/drm/rockchip/rockchip_lvds.c           |   4 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                     |  63 ++-
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |   4 +-
 .../drm/vmwgfx/device_include/svga3d_surfacedefs.h |   8 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c            |  20 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c            |  13 +
 drivers/hid/hid-core.c                             |  10 +-
 drivers/hid/hid-ids.h                              |   1 +
 drivers/hid/hid-input.c                            |   2 +
 drivers/hid/hid-sony.c                             |  98 ++---
 drivers/hid/wacom_wac.h                            |   2 +-
 drivers/hv/connection.c                            |   4 +-
 drivers/hv/hv_util.c                               |   4 +-
 drivers/hwmon/lm70.c                               |  26 +-
 drivers/hwmon/max31722.c                           |   9 -
 drivers/hwmon/max31790.c                           |  49 ++-
 drivers/hwtracing/coresight/coresight-core.c       |   2 +-
 drivers/iio/accel/bma180.c                         |  19 +-
 drivers/iio/accel/bma220_spi.c                     |  10 +-
 drivers/iio/accel/bmc150-accel-core.c              |  21 +-
 drivers/iio/accel/bmc150-accel-i2c.c               |   2 +-
 drivers/iio/accel/bmc150-accel.h                   |   2 +-
 drivers/iio/accel/hid-sensor-accel-3d.c            |  13 +-
 drivers/iio/accel/kxcjk-1013.c                     |  24 +-
 drivers/iio/accel/mxc4005.c                        |  10 +-
 drivers/iio/accel/stk8312.c                        |  12 +-
 drivers/iio/accel/stk8ba50.c                       |  17 +-
 drivers/iio/adc/at91-sama5d2_adc.c                 |   3 +-
 drivers/iio/adc/hx711.c                            |   4 +-
 drivers/iio/adc/mxs-lradc-adc.c                    |   3 +-
 drivers/iio/adc/ti-ads1015.c                       |  12 +-
 drivers/iio/adc/ti-ads8688.c                       |   3 +-
 drivers/iio/adc/vf610_adc.c                        |  10 +-
 drivers/iio/chemical/atlas-sensor.c                |   4 +-
 drivers/iio/frequency/adf4350.c                    |   6 +-
 drivers/iio/gyro/bmg160_core.c                     |  10 +-
 drivers/iio/humidity/am2315.c                      |  16 +-
 drivers/iio/imu/adis16400.c                        |   3 -
 drivers/iio/imu/adis16475.c                        |   2 +-
 drivers/iio/imu/adis_buffer.c                      |   3 -
 drivers/iio/light/isl29125.c                       |  10 +-
 drivers/iio/light/ltr501.c                         |  15 +-
 drivers/iio/light/tcs3414.c                        |  10 +-
 drivers/iio/light/tcs3472.c                        |  16 +-
 drivers/iio/light/vcnl4000.c                       |   2 +-
 drivers/iio/light/vcnl4035.c                       |   3 +-
 drivers/iio/magnetometer/bmc150_magn.c             |  11 +-
 drivers/iio/magnetometer/hmc5843.h                 |   8 +-
 drivers/iio/magnetometer/hmc5843_core.c            |   4 +-
 drivers/iio/magnetometer/rm3100-core.c             |   3 +-
 drivers/iio/potentiostat/lmp91000.c                |   4 +-
 drivers/iio/proximity/as3935.c                     |  10 +-
 drivers/iio/proximity/isl29501.c                   |   2 +-
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c  |  10 +-
 drivers/iio/proximity/srf08.c                      |  14 +-
 drivers/infiniband/core/cma.c                      |  26 +-
 drivers/infiniband/core/uverbs_cmd.c               |  21 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   7 +-
 drivers/infiniband/hw/hns/hns_roce_mr.c            |   2 +-
 drivers/infiniband/hw/mlx4/qp.c                    |   9 +-
 drivers/infiniband/hw/mlx5/main.c                  |   4 +-
 drivers/infiniband/hw/mlx5/qp.c                    |   6 +-
 drivers/infiniband/sw/rxe/rxe_net.c                |  10 +-
 drivers/infiniband/sw/rxe/rxe_qp.c                 |   1 -
 drivers/infiniband/sw/rxe/rxe_resp.c               |   2 -
 drivers/infiniband/ulp/iser/iscsi_iser.c           |   2 +
 drivers/infiniband/ulp/rtrs/rtrs-clt.c             |  28 +-
 drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c       |   1 +
 drivers/infiniband/ulp/rtrs/rtrs-srv.c             |  39 +-
 drivers/infiniband/ulp/rtrs/rtrs.c                 |   1 -
 drivers/infiniband/ulp/srp/ib_srp.c                |  13 +-
 drivers/input/joydev.c                             |   2 +-
 drivers/input/keyboard/Kconfig                     |   3 -
 drivers/input/keyboard/hil_kbd.c                   |   1 +
 drivers/input/touchscreen/elants_i2c.c             |   6 +-
 drivers/input/touchscreen/goodix.c                 |  52 ---
 drivers/input/touchscreen/usbtouchscreen.c         |   8 +-
 drivers/iommu/amd/init.c                           |   4 +-
 drivers/iommu/dma-iommu.c                          |   6 +-
 drivers/leds/Kconfig                               |   1 +
 drivers/leds/blink/leds-lgm-sso.c                  |  44 +-
 drivers/leds/led-class.c                           |   4 -
 drivers/leds/leds-as3645a.c                        |   1 +
 drivers/leds/leds-ktd2692.c                        |  27 +-
 drivers/leds/leds-lm36274.c                        |   1 +
 drivers/leds/leds-lm3692x.c                        |   8 +-
 drivers/leds/leds-lm3697.c                         |   8 +-
 drivers/leds/leds-lp50xx.c                         |   2 +-
 drivers/mailbox/qcom-apcs-ipc-mailbox.c            |   2 +-
 drivers/mailbox/qcom-ipcc.c                        |   6 +
 drivers/md/md.c                                    |  45 --
 drivers/md/md.h                                    |   1 -
 drivers/media/cec/platform/s5p/s5p_cec.c           |   7 +-
 drivers/media/common/siano/smscoreapi.c            |  22 +-
 drivers/media/common/siano/smscoreapi.h            |   4 +-
 drivers/media/common/siano/smsdvb-main.c           |   4 +
 drivers/media/dvb-core/dvb_net.c                   |  25 +-
 drivers/media/dvb-core/dvbdev.c                    |   3 +
 drivers/media/i2c/ccs/ccs-core.c                   |   2 +-
 drivers/media/i2c/imx334.c                         |   7 +-
 drivers/media/i2c/ir-kbd-i2c.c                     |   4 +-
 drivers/media/i2c/ov2659.c                         |  24 +-
 drivers/media/i2c/rdacm21.c                        |  56 ++-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c           |   6 +-
 drivers/media/i2c/s5c73m3/s5c73m3.h                |   2 +-
 drivers/media/i2c/s5k4ecgx.c                       |  10 +-
 drivers/media/i2c/s5k5baf.c                        |   6 +-
 drivers/media/i2c/s5k6aa.c                         |  10 +-
 drivers/media/i2c/tc358743.c                       |   1 +
 drivers/media/mc/Makefile                          |   2 +-
 drivers/media/pci/bt8xx/bt878.c                    |   6 +-
 drivers/media/pci/cobalt/cobalt-driver.c           |   1 +
 drivers/media/pci/cobalt/cobalt-driver.h           |   7 +-
 drivers/media/pci/intel/ipu3/cio2-bridge.c         |  10 +-
 drivers/media/platform/am437x/am437x-vpfe.c        |  15 +-
 drivers/media/platform/exynos-gsc/gsc-m2m.c        |   4 +-
 drivers/media/platform/exynos4-is/fimc-capture.c   |   6 +-
 drivers/media/platform/exynos4-is/fimc-is.c        |   4 +-
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  10 +-
 drivers/media/platform/exynos4-is/fimc-isp.c       |   7 +-
 drivers/media/platform/exynos4-is/fimc-lite.c      |   5 +-
 drivers/media/platform/exynos4-is/fimc-m2m.c       |   5 +-
 drivers/media/platform/exynos4-is/media-dev.c      |  10 +-
 drivers/media/platform/exynos4-is/mipi-csis.c      |  10 +-
 drivers/media/platform/marvell-ccic/mcam-core.c    |   9 +-
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c       |   6 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c |   4 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c  |   8 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h  |   2 +-
 drivers/media/platform/mtk-vpu/mtk_vpu.c           |   6 +
 drivers/media/platform/qcom/venus/core.c           |  60 ++-
 drivers/media/platform/s5p-g2d/g2d.c               |   3 +
 drivers/media/platform/s5p-jpeg/jpeg-core.c        |   5 +-
 drivers/media/platform/sh_vou.c                    |   6 +-
 drivers/media/platform/sti/bdisp/Makefile          |   2 +-
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c      |   7 +-
 drivers/media/platform/sti/delta/Makefile          |   2 +-
 drivers/media/platform/sti/hva/Makefile            |   2 +-
 drivers/media/platform/sti/hva/hva-hw.c            |   3 +-
 .../platform/sunxi/sun8i-rotate/sun8i_rotate.c     |   2 +-
 drivers/media/platform/video-mux.c                 |  10 +-
 drivers/media/usb/au0828/au0828-core.c             |   4 +-
 drivers/media/usb/cpia2/cpia2.h                    |   1 +
 drivers/media/usb/cpia2/cpia2_core.c               |  12 +
 drivers/media/usb/cpia2/cpia2_usb.c                |  13 +-
 drivers/media/usb/dvb-usb/cinergyT2-core.c         |   2 +
 drivers/media/usb/dvb-usb/cxusb.c                  |   2 +-
 drivers/media/usb/em28xx/em28xx-input.c            |   8 +-
 drivers/media/usb/gspca/gl860/gl860.c              |   4 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c            |   4 +-
 drivers/media/v4l2-core/v4l2-fh.c                  |   1 +
 drivers/media/v4l2-core/v4l2-ioctl.c               |  12 +-
 drivers/media/v4l2-core/v4l2-subdev.c              |  24 -
 drivers/memstick/host/rtsx_usb_ms.c                |  10 +-
 drivers/mfd/Kconfig                                |   1 +
 drivers/mfd/rn5t618.c                              |   2 +-
 drivers/misc/eeprom/idt_89hpesx.c                  |   8 +-
 drivers/misc/habanalabs/common/habanalabs_drv.c    |   1 +
 drivers/mmc/core/block.c                           |   8 +
 drivers/mmc/host/sdhci-of-aspeed.c                 |   2 +-
 drivers/mmc/host/sdhci-sprd.c                      |   1 +
 drivers/mmc/host/usdhi6rol0.c                      |   1 +
 drivers/mmc/host/via-sdmmc.c                       |   3 +
 drivers/mmc/host/vub300.c                          |   2 +-
 drivers/mtd/nand/raw/arasan-nand-controller.c      |  90 ++--
 drivers/mtd/nand/raw/marvell_nand.c                |   4 +-
 drivers/mtd/nand/spi/core.c                        |  17 +-
 drivers/mtd/parsers/qcomsmempart.c                 |  10 +
 drivers/mtd/parsers/redboot.c                      |   7 +-
 drivers/net/can/peak_canfd/peak_canfd.c            |   4 +-
 drivers/net/can/usb/ems_usb.c                      |   3 +-
 drivers/net/dsa/mv88e6xxx/chip.c                   |   6 +-
 drivers/net/dsa/sja1105/sja1105_main.c             |   6 +
 drivers/net/ethernet/aeroflex/greth.c              |   3 +-
 drivers/net/ethernet/aquantia/atlantic/aq_macsec.h |   4 +-
 drivers/net/ethernet/broadcom/bcm4908_enet.c       |   6 +-
 drivers/net/ethernet/broadcom/genet/bcmgenet.c     |   1 +
 drivers/net/ethernet/emulex/benet/be_cmds.c        |   6 +-
 drivers/net/ethernet/emulex/benet/be_main.c        |   2 +
 drivers/net/ethernet/ezchip/nps_enet.c             |   4 +-
 drivers/net/ethernet/faraday/ftgmac100.c           |   6 +-
 drivers/net/ethernet/google/gve/gve_main.c         |   4 +-
 drivers/net/ethernet/ibm/ehea/ehea_main.c          |   9 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 |  99 ++++-
 drivers/net/ethernet/intel/e1000e/netdev.c         |  24 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   3 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  17 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c    |   2 +
 drivers/net/ethernet/marvell/pxa168_eth.c          |   2 +-
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |  10 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |  18 +-
 drivers/net/ieee802154/mac802154_hwsim.c           |  11 +-
 drivers/net/macsec.c                               |   4 +-
 drivers/net/phy/mscc/mscc_macsec.c                 |   2 +-
 drivers/net/phy/mscc/mscc_macsec.h                 |   2 +-
 drivers/net/vrf.c                                  |  14 +-
 drivers/net/vxlan.c                                |   2 +
 drivers/net/wireless/ath/ath10k/mac.c              |   1 +
 drivers/net/wireless/ath/ath10k/pci.c              |  14 +-
 drivers/net/wireless/ath/ath11k/core.c             |   3 +-
 drivers/net/wireless/ath/ath11k/mac.c              |  10 +-
 drivers/net/wireless/ath/ath9k/main.c              |   5 +
 drivers/net/wireless/ath/carl9170/Kconfig          |   8 +-
 drivers/net/wireless/ath/wcn36xx/main.c            |  21 +-
 drivers/net/wireless/ath/wil6210/cfg80211.c        |   2 -
 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |  37 +-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    |   5 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c      |   8 +-
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.h       |   4 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   3 +
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  10 +-
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c    |   4 +
 .../net/wireless/mediatek/mt76/mt7615/pci_mac.c    |   5 +-
 .../net/wireless/mediatek/mt76/mt7615/usb_sdio.c   |   5 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mac.c   |   8 -
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.c   |  11 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.h   |   8 +
 .../net/wireless/mediatek/mt76/mt7915/testmode.c   |  21 +-
 drivers/net/wireless/mediatek/mt76/mt7921/init.c   |  18 -
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c    |  15 +-
 drivers/net/wireless/mediatek/mt76/mt7921/main.c   |  58 +--
 drivers/net/wireless/mediatek/mt76/tx.c            |   2 +-
 drivers/net/wireless/realtek/rtw88/rtw8822c.c      |  22 +-
 drivers/net/wireless/rsi/rsi_91x_hal.c             |   6 +-
 drivers/net/wireless/rsi/rsi_91x_mac80211.c        |   3 -
 drivers/net/wireless/rsi/rsi_91x_mgmt.c            |   3 +-
 drivers/net/wireless/rsi/rsi_main.h                |   1 -
 drivers/net/wireless/st/cw1200/scan.c              |  17 +-
 drivers/nvme/host/pci.c                            |  26 +-
 drivers/nvme/target/fc.c                           |  10 +-
 drivers/of/fdt.c                                   |   8 +-
 drivers/of/of_reserved_mem.c                       |   8 +-
 drivers/pci/controller/pci-hyperv.c                |   3 +
 drivers/perf/arm-cmn.c                             |   2 +-
 drivers/perf/arm_smmuv3_pmu.c                      |  18 +-
 drivers/perf/fsl_imx8_ddr_perf.c                   |   6 +-
 drivers/phy/ralink/phy-mt7621-pci.c                |   4 +-
 drivers/phy/socionext/phy-uniphier-pcie.c          |  11 +-
 drivers/phy/ti/phy-dm816x-usb.c                    |  17 +-
 drivers/pinctrl/renesas/pfc-r8a7796.c              |   3 +-
 drivers/pinctrl/renesas/pfc-r8a77990.c             |   8 +-
 drivers/platform/x86/asus-nb-wmi.c                 |  77 ----
 drivers/platform/x86/toshiba_acpi.c                |   1 +
 drivers/platform/x86/touchscreen_dmi.c             |  85 ++++
 drivers/regulator/da9052-regulator.c               |   3 +-
 drivers/regulator/fan53880.c                       |   2 +-
 drivers/regulator/hi655x-regulator.c               |  16 +-
 drivers/regulator/mt6315-regulator.c               |   4 +-
 drivers/regulator/mt6358-regulator.c               |   2 +-
 drivers/regulator/uniphier-regulator.c             |   1 +
 drivers/rtc/rtc-stm32.c                            |   6 +-
 drivers/s390/cio/chp.c                             |   3 +
 drivers/s390/cio/chsc.c                            |   2 -
 drivers/scsi/FlashPoint.c                          |  32 +-
 drivers/scsi/be2iscsi/be_iscsi.c                   |  19 +-
 drivers/scsi/be2iscsi/be_main.c                    |   1 +
 drivers/scsi/bnx2i/bnx2i_iscsi.c                   |  24 +-
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.c                 |   1 +
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c                 |   1 +
 drivers/scsi/cxgbi/libcxgbi.c                      |  12 +-
 drivers/scsi/libfc/fc_encode.h                     |   8 +-
 drivers/scsi/libiscsi.c                            |  70 ++-
 drivers/scsi/lpfc/lpfc_debugfs.c                   |   7 +-
 drivers/scsi/lpfc/lpfc_els.c                       | 100 ++++-
 drivers/scsi/lpfc/lpfc_hbadisc.c                   |  27 +-
 drivers/scsi/lpfc/lpfc_init.c                      |   7 -
 drivers/scsi/lpfc/lpfc_nportdisc.c                 |  25 +-
 drivers/scsi/lpfc/lpfc_sli.c                       |  10 +-
 drivers/scsi/megaraid/megaraid_sas_fusion.c        |  10 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |   4 +-
 drivers/scsi/qedi/qedi_iscsi.c                     |  26 +-
 drivers/scsi/qla4xxx/ql4_os.c                      |   2 +
 drivers/scsi/scsi_lib.c                            |   1 +
 drivers/scsi/scsi_transport_iscsi.c                | 487 ++++++++++++---------
 drivers/soundwire/stream.c                         |  13 +-
 drivers/spi/spi-loopback-test.c                    |   2 +-
 drivers/spi/spi-meson-spicc.c                      |   8 +-
 drivers/spi/spi-omap-100k.c                        |   2 +-
 drivers/spi/spi-sun6i.c                            |   6 +-
 drivers/spi/spi-topcliff-pch.c                     |   4 +-
 drivers/spi/spi.c                                  |   8 +-
 drivers/ssb/scan.c                                 |   1 +
 drivers/ssb/sdio.c                                 |   1 -
 drivers/staging/fbtft/fb_agm1264k-fl.c             |  20 +-
 drivers/staging/fbtft/fb_bd663474.c                |   4 -
 drivers/staging/fbtft/fb_ili9163.c                 |   4 -
 drivers/staging/fbtft/fb_ili9320.c                 |   1 -
 drivers/staging/fbtft/fb_ili9325.c                 |   4 -
 drivers/staging/fbtft/fb_ili9340.c                 |   1 -
 drivers/staging/fbtft/fb_s6d1121.c                 |   4 -
 drivers/staging/fbtft/fb_sh1106.c                  |   1 -
 drivers/staging/fbtft/fb_ssd1289.c                 |   4 -
 drivers/staging/fbtft/fb_ssd1325.c                 |   2 -
 drivers/staging/fbtft/fb_ssd1331.c                 |   6 +-
 drivers/staging/fbtft/fb_ssd1351.c                 |   1 -
 drivers/staging/fbtft/fb_upd161704.c               |   4 -
 drivers/staging/fbtft/fb_watterott.c               |   1 -
 drivers/staging/fbtft/fbtft-bus.c                  |   3 +-
 drivers/staging/fbtft/fbtft-core.c                 |  25 +-
 drivers/staging/fbtft/fbtft-io.c                   |  12 +-
 drivers/staging/gdm724x/gdm_lte.c                  |  20 +-
 drivers/staging/hikey9xx/hi6421v600-regulator.c    |   9 +-
 drivers/staging/media/hantro/hantro_drv.c          |  33 +-
 drivers/staging/media/hantro/hantro_v4l2.c         |   9 +-
 drivers/staging/media/imx/imx-media-csi.c          |  14 +-
 drivers/staging/media/imx/imx7-mipi-csis.c         |   6 +-
 drivers/staging/media/rkvdec/rkvdec.c              |  12 +-
 drivers/staging/media/sunxi/cedrus/cedrus_h265.c   |   4 +-
 drivers/staging/media/sunxi/cedrus/cedrus_video.c  |   8 +-
 drivers/staging/mt7621-dts/mt7621.dtsi             |   2 +-
 drivers/staging/rtl8712/hal_init.c                 |   3 +
 drivers/staging/rtl8712/os_intfs.c                 |   4 -
 drivers/staging/rtl8712/usb_intf.c                 |  24 +-
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c  |   2 +-
 drivers/target/iscsi/cxgbit/cxgbit_ddp.c           |  19 +-
 drivers/target/iscsi/cxgbit/cxgbit_target.c        |  21 +-
 drivers/thermal/cpufreq_cooling.c                  |   2 +-
 drivers/thunderbolt/test.c                         |  14 +-
 drivers/tty/nozomi.c                               |   9 +-
 drivers/tty/serial/8250/8250_omap.c                |  22 +-
 drivers/tty/serial/8250/8250_port.c                |  19 +-
 drivers/tty/serial/8250/serial_cs.c                |   2 +-
 drivers/tty/serial/fsl_lpuart.c                    |  14 +-
 drivers/tty/serial/mvebu-uart.c                    |  18 +-
 drivers/tty/serial/sh-sci.c                        |   8 +
 drivers/usb/class/cdc-acm.c                        |   5 +
 drivers/usb/dwc2/core.c                            |  30 +-
 drivers/usb/dwc3/core.c                            |   3 +-
 drivers/usb/gadget/function/f_eem.c                |  43 +-
 drivers/usb/gadget/function/f_fs.c                 |  65 ++-
 drivers/usb/host/xhci-mem.c                        |   1 +
 drivers/usb/host/xhci-pci-renesas.c                |  16 +-
 drivers/usb/phy/phy-tegra-usb.c                    |  15 +-
 drivers/usb/typec/class.c                          |   4 +-
 drivers/usb/typec/tcpm/tcpci.c                     |  18 +-
 drivers/usb/typec/tcpm/tcpm.c                      |  30 ++
 drivers/vfio/pci/vfio_pci.c                        |  29 +-
 drivers/video/backlight/lm3630a_bl.c               |   4 +-
 drivers/video/fbdev/imxfb.c                        |   2 +-
 drivers/visorbus/visorchipset.c                    |   6 +-
 fs/btrfs/Kconfig                                   |   2 +
 fs/btrfs/ctree.c                                   |   5 +-
 fs/btrfs/delayed-inode.c                           |  18 +-
 fs/btrfs/extent-tree.c                             |   1 -
 fs/btrfs/inode.c                                   |  16 +-
 fs/btrfs/send.c                                    |  11 +
 fs/btrfs/super.c                                   |  11 -
 fs/btrfs/sysfs.c                                   |   4 +-
 fs/btrfs/transaction.c                             |  16 +-
 fs/btrfs/transaction.h                             |   1 -
 fs/btrfs/tree-log.c                                |   1 +
 fs/btrfs/zoned.c                                   |  18 +
 fs/cifs/cifs_swn.c                                 |  10 +-
 fs/cifs/cifsacl.c                                  |   2 +-
 fs/cifs/cifsglob.h                                 |   3 +-
 fs/cifs/connect.c                                  |   5 +-
 fs/cifs/dfs_cache.c                                |   7 +-
 fs/cifs/smb2ops.c                                  | 133 ++++++
 fs/configfs/file.c                                 |  10 +-
 fs/crypto/fname.c                                  |  10 +-
 fs/crypto/keysetup.c                               |  40 +-
 fs/dax.c                                           |   3 +-
 fs/dlm/config.c                                    |   9 +
 fs/dlm/lowcomms.c                                  |  77 ++--
 fs/erofs/super.c                                   |   1 +
 fs/exec.c                                          |   4 +
 fs/exfat/dir.c                                     |   8 +-
 fs/ext4/extents.c                                  |   3 +
 fs/ext4/extents_status.c                           |   4 +-
 fs/ext4/ialloc.c                                   |  11 +-
 fs/ext4/inode.c                                    |   2 +-
 fs/ext4/mballoc.c                                  |   9 +-
 fs/ext4/super.c                                    |  10 +-
 fs/f2fs/data.c                                     |   6 +
 fs/f2fs/sysfs.c                                    |   8 +
 fs/fs-writeback.c                                  |  39 +-
 fs/fuse/dev.c                                      |  12 +-
 fs/fuse/dir.c                                      |  25 +-
 fs/gfs2/file.c                                     |   4 +-
 fs/gfs2/ops_fstype.c                               |   1 +
 fs/io_uring.c                                      |  10 +-
 fs/ntfs/inode.c                                    |   2 +-
 fs/ocfs2/filecheck.c                               |   6 +-
 fs/ocfs2/stackglue.c                               |   8 +-
 fs/open.c                                          |  14 +-
 fs/proc/task_mmu.c                                 |   2 +-
 fs/pstore/Kconfig                                  |   1 +
 include/asm-generic/pgtable-nop4d.h                |   1 -
 include/asm-generic/preempt.h                      |   2 +-
 include/clocksource/timer-ti-dm.h                  |   1 +
 include/crypto/internal/hash.h                     |   8 +-
 include/dt-bindings/clock/imx8mq-clock.h           |  19 -
 include/linux/bio.h                                |  12 +-
 include/linux/clocksource.h                        |   2 +-
 include/linux/cred.h                               |   2 +
 include/linux/huge_mm.h                            |  59 ++-
 include/linux/hugetlb.h                            |   5 +
 include/linux/iio/common/cros_ec_sensors_core.h    |   2 +-
 include/linux/kthread.h                            |   2 +
 include/linux/mm.h                                 |   1 -
 include/linux/pgtable.h                            |  22 +
 include/linux/prandom.h                            |   2 +-
 include/linux/swap.h                               |   9 +
 include/linux/tracepoint.h                         |  10 +
 include/linux/user_namespace.h                     |   4 +
 include/media/hevc-ctrls.h                         |   3 +-
 include/media/media-dev-allocator.h                |   2 +-
 include/net/bluetooth/hci.h                        |   6 +-
 include/net/bluetooth/hci_core.h                   |   8 +-
 include/net/ip.h                                   |  12 +-
 include/net/ip6_route.h                            |  16 +-
 include/net/macsec.h                               |   2 +-
 include/net/sch_generic.h                          |  12 +
 include/net/tc_act/tc_vlan.h                       |   1 +
 include/net/xfrm.h                                 |   1 +
 include/net/xsk_buff_pool.h                        |   9 +-
 include/scsi/fc/fc_ms.h                            |   4 +-
 include/scsi/libiscsi.h                            |   1 +
 include/scsi/scsi_transport_iscsi.h                |  12 +-
 include/uapi/linux/v4l2-controls.h                 |  23 +-
 init/main.c                                        |   6 +-
 kernel/bpf/devmap.c                                |   4 +-
 kernel/bpf/inode.c                                 |   2 +-
 kernel/bpf/verifier.c                              |   6 +-
 kernel/cred.c                                      |  40 ++
 kernel/fork.c                                      |   8 +-
 kernel/kthread.c                                   |  49 ++-
 kernel/locking/lockdep.c                           | 122 +++++-
 kernel/rcu/tree.c                                  |   2 +-
 kernel/sched/core.c                                |  86 ++--
 kernel/sched/deadline.c                            |   2 +
 kernel/sched/fair.c                                |  19 +-
 kernel/sched/psi.c                                 |  12 +-
 kernel/sched/rt.c                                  |  17 +-
 kernel/smpboot.c                                   |   1 -
 kernel/sys.c                                       |  12 +
 kernel/time/clocksource.c                          | 113 ++++-
 kernel/trace/bpf_trace.c                           |   3 +-
 kernel/trace/trace_events_hist.c                   |   7 +
 kernel/tracepoint.c                                |  33 +-
 kernel/ucount.c                                    |  40 +-
 kernel/user_namespace.c                            |   3 +
 lib/Kconfig.debug                                  |   1 -
 lib/iov_iter.c                                     |   9 +-
 lib/kstrtox.c                                      |  13 +-
 lib/kstrtox.h                                      |   2 +
 lib/kunit/test.c                                   |   7 +-
 lib/locking-selftest.c                             |   1 +
 lib/math/rational.c                                |  16 +-
 lib/seq_buf.c                                      |   4 +-
 lib/vsprintf.c                                     |  82 ++--
 mm/debug_vm_pgtable.c                              |  63 ++-
 mm/gup.c                                           |  58 ++-
 mm/huge_memory.c                                   |  13 +-
 mm/hugetlb.c                                       |  99 +++--
 mm/khugepaged.c                                    |   4 +-
 mm/memcontrol.c                                    |   8 +
 mm/memory.c                                        |  11 +-
 mm/migrate.c                                       |   2 +-
 mm/mmap_lock.c                                     |  33 +-
 mm/page_alloc.c                                    | 107 +++--
 mm/shmem.c                                         |  17 +-
 mm/slab.h                                          |   1 -
 mm/z3fold.c                                        |   3 +-
 mm/zswap.c                                         |  17 +-
 net/bluetooth/hci_event.c                          |  27 +-
 net/bluetooth/hci_request.c                        |  51 ++-
 net/bluetooth/mgmt.c                               |   3 +
 net/bpfilter/main.c                                |   2 +-
 net/can/bcm.c                                      |   7 +-
 net/can/gw.c                                       |   3 +
 net/can/isotp.c                                    |   7 +-
 net/can/j1939/main.c                               |   4 +
 net/can/j1939/socket.c                             |   5 +-
 net/core/filter.c                                  |   4 -
 net/core/sock_map.c                                |   2 +-
 net/ipv4/esp4.c                                    |   2 +-
 net/ipv4/fib_frontend.c                            |   2 +
 net/ipv4/route.c                                   |   3 +-
 net/ipv6/esp6.c                                    |   2 +-
 net/ipv6/exthdrs.c                                 |  31 +-
 net/ipv6/ip6_tunnel.c                              |   4 +-
 net/mac80211/he.c                                  |   4 +-
 net/mac80211/mlme.c                                |   9 -
 net/mac80211/sta_info.c                            |   5 -
 net/mptcp/subflow.c                                |   6 +-
 net/mptcp/token.c                                  |   6 +-
 net/netfilter/nf_tables_api.c                      |  14 +-
 net/netfilter/nf_tables_offload.c                  |  17 +-
 net/netfilter/nft_exthdr.c                         |   3 +
 net/netfilter/nft_osf.c                            |   5 +
 net/netfilter/nft_tproxy.c                         |   9 +-
 net/netlabel/netlabel_mgmt.c                       |  19 +-
 net/qrtr/ns.c                                      |   4 +-
 net/sched/act_vlan.c                               |   7 +-
 net/sched/cls_tcindex.c                            |   2 +-
 net/sched/sch_qfq.c                                |   8 +-
 net/sunrpc/sched.c                                 |  12 +-
 net/tipc/bcast.c                                   |   2 +-
 net/tipc/msg.c                                     |  17 +-
 net/tipc/msg.h                                     |   3 +-
 net/tls/tls_sw.c                                   |   2 +-
 net/xdp/xsk_queue.h                                |  11 +-
 net/xfrm/xfrm_device.c                             |   1 +
 net/xfrm/xfrm_output.c                             |   7 -
 net/xfrm/xfrm_state.c                              |  14 +-
 samples/bpf/xdp_redirect_user.c                    |   4 +-
 scripts/Makefile.build                             |   5 +-
 scripts/tools-support-relr.sh                      |   3 +-
 security/integrity/evm/evm_main.c                  |   5 +-
 security/integrity/evm/evm_secfs.c                 |  13 +-
 security/integrity/ima/ima_appraise.c              |   2 -
 sound/firewire/amdtp-stream.c                      |   7 +-
 sound/firewire/motu/motu-protocol-v2.c             |   5 +-
 sound/pci/hda/patch_realtek.c                      |  49 ++-
 sound/pci/intel8x0.c                               |   2 +-
 sound/soc/atmel/atmel-i2s.c                        |  35 +-
 sound/soc/codecs/cs42l42.h                         |   2 +-
 sound/soc/codecs/max98373-sdw.c                    |  14 +-
 sound/soc/codecs/max98373.h                        |   2 +-
 sound/soc/codecs/rk3328_codec.c                    |  28 +-
 sound/soc/codecs/rt1308-sdw.c                      |   2 +-
 sound/soc/codecs/rt5682-i2c.c                      |   1 +
 sound/soc/codecs/rt5682-sdw.c                      |  19 +-
 sound/soc/codecs/rt700-sdw.c                       |   2 +-
 sound/soc/codecs/rt711-sdw.c                       |   2 +-
 sound/soc/codecs/rt715-sdw.c                       |   2 +-
 sound/soc/fsl/fsl_spdif.c                          |  23 +-
 sound/soc/fsl/fsl_xcvr.c                           |  10 +
 sound/soc/hisilicon/hi6210-i2s.c                   |  14 +-
 sound/soc/intel/boards/sof_sdw.c                   |  16 +-
 sound/soc/mediatek/common/mtk-btcvsd.c             |  24 +-
 sound/soc/sh/rcar/adg.c                            |   4 +-
 sound/usb/format.c                                 |   2 +
 sound/usb/mixer.c                                  |   8 +-
 sound/usb/mixer.h                                  |   1 +
 sound/usb/mixer_scarlett_gen2.c                    |   7 +-
 tools/bpf/bpftool/main.c                           |   4 +-
 tools/bpf/resolve_btfids/main.c                    |   3 +
 tools/perf/util/llvm-utils.c                       |   2 +
 .../util/scripting-engines/trace-event-python.c    | 146 +++---
 tools/power/x86/intel-speed-select/isst-config.c   |  16 +
 tools/power/x86/intel-speed-select/isst-core.c     |  15 +
 tools/power/x86/intel-speed-select/isst-display.c  |   2 +-
 tools/power/x86/intel-speed-select/isst.h          |   2 +
 tools/testing/selftests/bpf/.gitignore             |   1 +
 .../selftests/ftrace/test.d/event/event-no-pid.tc  |   7 +
 tools/testing/selftests/kvm/dirty_log_test.c       |   1 -
 tools/testing/selftests/kvm/lib/kvm_util.c         |   4 -
 tools/testing/selftests/kvm/lib/x86_64/processor.c |   3 +
Quoted 11 lines
 tools/testing/selftests/kvm/steal_time.c           |   2 -
 .../testing/selftests/kvm/x86_64/set_boot_cpu_id.c |   2 -
 tools/testing/selftests/lkdtm/run.sh               |  12 +-
 tools/testing/selftests/net/tls.c                  |  87 ++--
 .../testing/selftests/splice/short_splice_read.sh  | 119 ++++-
 .../selftests/tc-testing/plugin-lib/scapyPlugin.py |   2 +-
 tools/testing/selftests/vm/protection_keys.c       |  12 +-
 743 files changed, 6465 insertions(+), 3314 deletions(-)

All tests passing for Tegra ...

Test results for stable-v5.12:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    104 tests:	104 pass, 0 fail

Linux version: 5.12.17-rc1-g09f2f41ef84e
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Jon

maintainer Tested-by on the v1 series
#703 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.12:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    104 tests:	104 pass, 0 fail

Linux version: 5.12.17-rc1-g09f2f41ef84e
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Jon

Tested-by on the v1 series
#704 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

Build results:

	total: 154 pass: 153 fail: 1
Failed builds:
	riscv32:allmodconfig
Qemu test results:
	total: 462 pass: 462 fail: 0

riscv32 build failure as before, inherited from mainline.

Error log:
cc1: error: '10208' is not a valid offset in '-mstack-protector-guard-offset='

Guenter

Tested-by on the v1 series
#705 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BRCMSTB, using 32-bit and 64-bit ARM kernels:

Signature · 1 line
Florian
Tested-by on the v1 series
#706 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

5.12.17-rc1 Successfully Compiled and booted on my Raspberry PI 4b (8g) (bcm2711)

maintainer Tested-by on the v1 series
#707 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

maintainer Tested-by on the v1 series
#708 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.12:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    104 tests:	104 pass, 0 fail

Linux version: 5.12.17-rc1-gfd3222df4dfe
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Jon

Tested-by Linux Kernel Functional Testing on the v1 series
#709 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

## Build
* kernel: 5.12.17-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.12.y
* git commit: fd3222df4dfe575b8d1fd1aef320a441f3833513
* git describe: v5.12.16-705-gfd3222df4dfe
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.12.y/build/v5.12.16-705-gfd3222df4dfe

## No regressions (compared to v5.12.16-700-g60202d2cb2e2)

## No fixes (compared to v5.12.16-700-g60202d2cb2e2)

## Test result summary
total: 83175, pass: 68018, fail: 1941, skip: 11855, xfail: 1361,

## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 193 total, 193 passed, 0 failed
* arm64: 27 total, 27 passed, 0 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 26 total, 26 passed, 0 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 21 total, 21 passed, 0 failed
* s390: 18 total, 18 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x15: 1 total, 0 passed, 1 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 27 total, 27 passed, 0 failed

## Test suites summary
* fwts
* igt-gpu-tools
* install-android-platform-tools-r2600
* kselftest-
* kselftest-android
* kselftest-bpf
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-vsyscall-mode-native-
* kselftest-vsyscall-mode-none-
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* v4l2-compliance

--
Linaro LKFT
https://lkft.linaro.org

Tested-by Justin M. Forbes on the v1 series
#710 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.12.17 release. There are 700 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 14 Jul 2021 06:02:46 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.17-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.

thanks,

greg k-h

Tested rc1 minus the offending patch against the Fedora build system (aarch64, armv7, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.