linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral
@ 2020-12-12 16:07 Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 02/23] drm/tegra: sor: Ensure regulators are disabled on teardown Sasha Levin
                   ` (21 more replies)
  0 siblings, 22 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jon Hunter, Thierry Reding, Sasha Levin, dri-devel, linux-tegra

From: Jon Hunter <jonathanh@nvidia.com>

[ Upstream commit cb7ff314e1d9f3d6c62fa2c392e41174721ed0b3 ]

Deferred probe is an expected return value for tegra_output_probe().
Given that the driver deals with it properly, there's no need to output
a warning that may potentially confuse users.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tegra/sor.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 45b5258c77a29..5d9a7f008fc6c 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3759,10 +3759,9 @@ static int tegra_sor_probe(struct platform_device *pdev)
 		return err;
 
 	err = tegra_output_probe(&sor->output);
-	if (err < 0) {
-		dev_err(&pdev->dev, "failed to probe output: %d\n", err);
-		return err;
-	}
+	if (err < 0)
+		return dev_err_probe(&pdev->dev, err,
+				     "failed to probe output\n");
 
 	if (sor->ops && sor->ops->probe) {
 		err = sor->ops->probe(sor);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 02/23] drm/tegra: sor: Ensure regulators are disabled on teardown
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 03/23] drm/tegra: replace idr_init() by idr_init_base() Sasha Levin
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marc Zyngier, Thierry Reding, Sasha Levin, dri-devel, linux-tegra

From: Marc Zyngier <maz@kernel.org>

[ Upstream commit 5c1d644c09dbc13b2dc652435786e42b05ac1bb7 ]

The Tegra SOR driver uses the devm infrastructure to request regulators,
but enables them without registering them with the infrastructure.

This results in the following splat if probing fails for any odd resaon
(such as dependencies not being available):

[    8.974187] tegra-sor 15580000.sor: cannot get HDMI supply: -517
[    9.414403] tegra-sor 15580000.sor: failed to probe HDMI: -517
[    9.421240] ------------[ cut here ]------------
[    9.425879] WARNING: CPU: 1 PID: 164 at drivers/regulator/core.c:2089 _regulator_put.part.0+0x16c/0x174
[    9.435259] Modules linked in: tegra_drm(E+) cec(E) ahci_tegra(E) drm_kms_helper(E) drm(E) libahci_platform(E) libahci(E) max77620_regulator(E) xhci_tegra(E+) sdhci_tegra(E) xhci_hcd(E) libata(E) sdhci_pltfm(E) cqhci(E) fixed(E) usbcore(E) scsi_mod(E) sdhci(E) host1x(E)
[    9.459211] CPU: 1 PID: 164 Comm: systemd-udevd Tainted: G S    D W   E     5.9.0-rc7-00298-gf6337624c4fe #1980
[    9.469285] Hardware name: NVIDIA Jetson TX2 Developer Kit (DT)
[    9.475202] pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
[    9.480784] pc : _regulator_put.part.0+0x16c/0x174
[    9.485581] lr : regulator_put+0x44/0x60
[    9.489501] sp : ffffffc011d837b0
[    9.492814] x29: ffffffc011d837b0 x28: ffffff81dd085900
[    9.498141] x27: ffffff81de1c8ec0 x26: ffffff81de1c8c10
[    9.503464] x25: ffffff81dd085800 x24: ffffffc008f2c6b0
[    9.508790] x23: ffffffc0117373f0 x22: 0000000000000005
[    9.514101] x21: ffffff81dd085900 x20: ffffffc01172b098
[    9.515822] ata1: SATA link down (SStatus 0 SControl 300)
[    9.519426] x19: ffffff81dd085100 x18: 0000000000000030
[    9.530122] x17: 0000000000000000 x16: 0000000000000000
[    9.535453] x15: 0000000000000000 x14: 000000000000038f
[    9.540777] x13: 0000000000000003 x12: 0000000000000040
[    9.546105] x11: ffffff81eb800000 x10: 0000000000000ae0
[    9.551417] x9 : ffffffc0106fea24 x8 : ffffff81de83e6c0
[    9.556728] x7 : 0000000000000018 x6 : 00000000000003c3
[    9.562064] x5 : 0000000000005660 x4 : 0000000000000000
[    9.567392] x3 : ffffffc01172b388 x2 : ffffff81de83db80
[    9.572702] x1 : 0000000000000000 x0 : 0000000000000001
[    9.578034] Call trace:
[    9.580494]  _regulator_put.part.0+0x16c/0x174
[    9.584940]  regulator_put+0x44/0x60
[    9.588522]  devm_regulator_release+0x20/0x2c
[    9.592885]  release_nodes+0x1c8/0x2c0
[    9.596636]  devres_release_all+0x44/0x6c
[    9.600649]  really_probe+0x1ec/0x504
[    9.604316]  driver_probe_device+0x100/0x170
[    9.608589]  device_driver_attach+0xcc/0xd4
[    9.612774]  __driver_attach+0xb0/0x17c
[    9.616614]  bus_for_each_dev+0x7c/0xd4
[    9.620450]  driver_attach+0x30/0x3c
[    9.624027]  bus_add_driver+0x154/0x250
[    9.627867]  driver_register+0x84/0x140
[    9.631719]  __platform_register_drivers+0xa0/0x180
[    9.636660]  host1x_drm_init+0x60/0x1000 [tegra_drm]
[    9.641629]  do_one_initcall+0x54/0x2d0
[    9.645490]  do_init_module+0x68/0x29c
[    9.649244]  load_module+0x2178/0x26c0
[    9.652997]  __do_sys_finit_module+0xb0/0x120
[    9.657356]  __arm64_sys_finit_module+0x2c/0x40
[    9.661902]  el0_svc_common.constprop.0+0x80/0x240
[    9.666701]  do_el0_svc+0x30/0xa0
[    9.670022]  el0_svc+0x18/0x50
[    9.673081]  el0_sync_handler+0x90/0x318
[    9.677006]  el0_sync+0x158/0x180
[    9.680324] ---[ end trace 90f6c89d62d85ff6 ]---

Instead, let's register a callback that will disable the regulators
on teardown. This allows for the removal of the .remove callbacks,
which are not needed anymore.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tegra/sor.c | 59 +++++++++++++++----------------------
 1 file changed, 24 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 5d9a7f008fc6c..f2a114f14a3db 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -397,7 +397,6 @@ struct tegra_sor;
 struct tegra_sor_ops {
 	const char *name;
 	int (*probe)(struct tegra_sor *sor);
-	int (*remove)(struct tegra_sor *sor);
 	void (*audio_enable)(struct tegra_sor *sor);
 	void (*audio_disable)(struct tegra_sor *sor);
 };
@@ -2942,6 +2941,24 @@ static const struct drm_encoder_helper_funcs tegra_sor_dp_helpers = {
 	.atomic_check = tegra_sor_encoder_atomic_check,
 };
 
+static void tegra_sor_disable_regulator(void *data)
+{
+	struct regulator *reg = data;
+
+	regulator_disable(reg);
+}
+
+static int tegra_sor_enable_regulator(struct tegra_sor *sor, struct regulator *reg)
+{
+	int err;
+
+	err = regulator_enable(reg);
+	if (err)
+		return err;
+
+	return devm_add_action_or_reset(sor->dev, tegra_sor_disable_regulator, reg);
+}
+
 static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 {
 	int err;
@@ -2953,7 +2970,7 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 		return PTR_ERR(sor->avdd_io_supply);
 	}
 
-	err = regulator_enable(sor->avdd_io_supply);
+	err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply);
 	if (err < 0) {
 		dev_err(sor->dev, "failed to enable AVDD I/O supply: %d\n",
 			err);
@@ -2967,7 +2984,7 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 		return PTR_ERR(sor->vdd_pll_supply);
 	}
 
-	err = regulator_enable(sor->vdd_pll_supply);
+	err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply);
 	if (err < 0) {
 		dev_err(sor->dev, "failed to enable VDD PLL supply: %d\n",
 			err);
@@ -2981,7 +2998,7 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 		return PTR_ERR(sor->hdmi_supply);
 	}
 
-	err = regulator_enable(sor->hdmi_supply);
+	err = tegra_sor_enable_regulator(sor, sor->hdmi_supply);
 	if (err < 0) {
 		dev_err(sor->dev, "failed to enable HDMI supply: %d\n", err);
 		return err;
@@ -2992,19 +3009,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	return 0;
 }
 
-static int tegra_sor_hdmi_remove(struct tegra_sor *sor)
-{
-	regulator_disable(sor->hdmi_supply);
-	regulator_disable(sor->vdd_pll_supply);
-	regulator_disable(sor->avdd_io_supply);
-
-	return 0;
-}
-
 static const struct tegra_sor_ops tegra_sor_hdmi_ops = {
 	.name = "HDMI",
 	.probe = tegra_sor_hdmi_probe,
-	.remove = tegra_sor_hdmi_remove,
 	.audio_enable = tegra_sor_hdmi_audio_enable,
 	.audio_disable = tegra_sor_hdmi_audio_disable,
 };
@@ -3017,7 +3024,7 @@ static int tegra_sor_dp_probe(struct tegra_sor *sor)
 	if (IS_ERR(sor->avdd_io_supply))
 		return PTR_ERR(sor->avdd_io_supply);
 
-	err = regulator_enable(sor->avdd_io_supply);
+	err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply);
 	if (err < 0)
 		return err;
 
@@ -3025,25 +3032,16 @@ static int tegra_sor_dp_probe(struct tegra_sor *sor)
 	if (IS_ERR(sor->vdd_pll_supply))
 		return PTR_ERR(sor->vdd_pll_supply);
 
-	err = regulator_enable(sor->vdd_pll_supply);
+	err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply);
 	if (err < 0)
 		return err;
 
 	return 0;
 }
 
-static int tegra_sor_dp_remove(struct tegra_sor *sor)
-{
-	regulator_disable(sor->vdd_pll_supply);
-	regulator_disable(sor->avdd_io_supply);
-
-	return 0;
-}
-
 static const struct tegra_sor_ops tegra_sor_dp_ops = {
 	.name = "DP",
 	.probe = tegra_sor_dp_probe,
-	.remove = tegra_sor_dp_remove,
 };
 
 static int tegra_sor_init(struct host1x_client *client)
@@ -3768,7 +3766,7 @@ static int tegra_sor_probe(struct platform_device *pdev)
 		if (err < 0) {
 			dev_err(&pdev->dev, "failed to probe %s: %d\n",
 				sor->ops->name, err);
-			goto output;
+			goto remove;
 		}
 	}
 
@@ -3949,9 +3947,6 @@ unregister:
 rpm_disable:
 	pm_runtime_disable(&pdev->dev);
 remove:
-	if (sor->ops && sor->ops->remove)
-		sor->ops->remove(sor);
-output:
 	tegra_output_remove(&sor->output);
 	return err;
 }
@@ -3970,12 +3965,6 @@ static int tegra_sor_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 
-	if (sor->ops && sor->ops->remove) {
-		err = sor->ops->remove(sor);
-		if (err < 0)
-			dev_err(&pdev->dev, "failed to remove SOR: %d\n", err);
-	}
-
 	tegra_output_remove(&sor->output);
 
 	return 0;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 03/23] drm/tegra: replace idr_init() by idr_init_base()
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 02/23] drm/tegra: sor: Ensure regulators are disabled on teardown Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 04/23] dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY Sasha Levin
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Deepak R Varma, Thierry Reding, Sasha Levin, dri-devel, linux-tegra

From: Deepak R Varma <mh12gx2825@gmail.com>

[ Upstream commit 41f71629b4c432f8dd47d70ace813be5f79d4d75 ]

idr_init() uses base 0 which is an invalid identifier for this driver.
The new function idr_init_base allows IDR to set the ID lookup from
base 1. This avoids all lookups that otherwise starts from 0 since
0 is always unused.

References: commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient")

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tegra/drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index ba9d1c3e7cacf..e4baf07992a4d 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -90,7 +90,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp)
 	if (!fpriv)
 		return -ENOMEM;
 
-	idr_init(&fpriv->contexts);
+	idr_init_base(&fpriv->contexts, 1);
 	mutex_init(&fpriv->lock);
 	filp->driver_priv = fpriv;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 04/23] dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 02/23] drm/tegra: sor: Ensure regulators are disabled on teardown Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 03/23] drm/tegra: replace idr_init() by idr_init_base() Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 05/23] gfs2: set lockdep subclass for iopen glocks Sasha Levin
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mikulas Patocka, Mike Snitzer, Sasha Levin, dm-devel, linux-raid

From: Mikulas Patocka <mpatocka@redhat.com>

[ Upstream commit a7a10bce8a04f48238a8306ec97d430b77917015 ]

Don't use crypto drivers that have the flag CRYPTO_ALG_ALLOCATES_MEMORY
set. These drivers allocate memory and thus they are not suitable for
block I/O processing.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/md/dm-integrity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 3fc3757def55e..5a7a1b90e671c 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -3462,7 +3462,7 @@ static int get_mac(struct crypto_shash **hash, struct alg_spec *a, char **error,
 	int r;
 
 	if (a->alg_string) {
-		*hash = crypto_alloc_shash(a->alg_string, 0, 0);
+		*hash = crypto_alloc_shash(a->alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY);
 		if (IS_ERR(*hash)) {
 			*error = error_alg;
 			r = PTR_ERR(*hash);
@@ -3519,7 +3519,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error)
 		struct journal_completion comp;
 
 		comp.ic = ic;
-		ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, 0);
+		ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY);
 		if (IS_ERR(ic->journal_crypt)) {
 			*error = "Invalid journal cipher";
 			r = PTR_ERR(ic->journal_crypt);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 05/23] gfs2: set lockdep subclass for iopen glocks
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (2 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 04/23] dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 06/23] ASoC: rt5682: change SAR voltage threshold Sasha Levin
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexander Aring, Andreas Gruenbacher, Sasha Levin, cluster-devel

From: Alexander Aring <aahringo@redhat.com>

[ Upstream commit 515b269d5bd29a986d5e1c0a0cba87fa865a48b4 ]

This patch introduce a new globs attribute to define the subclass of the
glock lockref spinlock. This avoid the following lockdep warning, which
occurs when we lock an inode lock while an iopen lock is held:

============================================
WARNING: possible recursive locking detected
5.10.0-rc3+ #4990 Not tainted
--------------------------------------------
kworker/0:1/12 is trying to acquire lock:
ffff9067d45672d8 (&gl->gl_lockref.lock){+.+.}-{3:3}, at: lockref_get+0x9/0x20

but task is already holding lock:
ffff9067da308588 (&gl->gl_lockref.lock){+.+.}-{3:3}, at: delete_work_func+0x164/0x260

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&gl->gl_lockref.lock);
  lock(&gl->gl_lockref.lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by kworker/0:1/12:
 #0: ffff9067c1bfdd38 ((wq_completion)delete_workqueue){+.+.}-{0:0}, at: process_one_work+0x1b7/0x540
 #1: ffffac594006be70 ((work_completion)(&(&gl->gl_delete)->work)){+.+.}-{0:0}, at: process_one_work+0x1b7/0x540
 #2: ffff9067da308588 (&gl->gl_lockref.lock){+.+.}-{3:3}, at: delete_work_func+0x164/0x260

stack backtrace:
CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.10.0-rc3+ #4990
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
Workqueue: delete_workqueue delete_work_func
Call Trace:
 dump_stack+0x8b/0xb0
 __lock_acquire.cold+0x19e/0x2e3
 lock_acquire+0x150/0x410
 ? lockref_get+0x9/0x20
 _raw_spin_lock+0x27/0x40
 ? lockref_get+0x9/0x20
 lockref_get+0x9/0x20
 delete_work_func+0x188/0x260
 process_one_work+0x237/0x540
 worker_thread+0x4d/0x3b0
 ? process_one_work+0x540/0x540
 kthread+0x127/0x140
 ? __kthread_bind_mask+0x60/0x60
 ret_from_fork+0x22/0x30

Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/gfs2/glock.c  | 1 +
 fs/gfs2/glops.c  | 1 +
 fs/gfs2/incore.h | 1 +
 3 files changed, 3 insertions(+)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 120a4193a75a7..ac14ba220340d 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1038,6 +1038,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
 	gl->gl_node.next = NULL;
 	gl->gl_flags = 0;
 	gl->gl_name = name;
+	lockdep_set_subclass(&gl->gl_lockref.lock, glops->go_subclass);
 	gl->gl_lockref.count = 1;
 	gl->gl_state = LM_ST_UNLOCKED;
 	gl->gl_target = LM_ST_UNLOCKED;
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 138500953b56f..27bffac51ed55 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -751,6 +751,7 @@ const struct gfs2_glock_operations gfs2_iopen_glops = {
 	.go_callback = iopen_go_callback,
 	.go_demote_ok = iopen_go_demote_ok,
 	.go_flags = GLOF_LRU | GLOF_NONDISK,
+	.go_subclass = 1,
 };
 
 const struct gfs2_glock_operations gfs2_flock_glops = {
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 387e99d6eda9e..d167307a36299 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -243,6 +243,7 @@ struct gfs2_glock_operations {
 			const char *fs_id_buf);
 	void (*go_callback)(struct gfs2_glock *gl, bool remote);
 	void (*go_free)(struct gfs2_glock *gl);
+	const int go_subclass;
 	const int go_type;
 	const unsigned long go_flags;
 #define GLOF_ASPACE 1 /* address space attached */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 06/23] ASoC: rt5682: change SAR voltage threshold
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (3 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 05/23] gfs2: set lockdep subclass for iopen glocks Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 07/23] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Sasha Levin
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Shuming Fan, Mark Brown, Sasha Levin, alsa-devel

From: Shuming Fan <shumingf@realtek.com>

[ Upstream commit aa4cb898b80a28a610e26d1513e6dd42d995c225 ]

To fix errors in some 4 poles headset detection cases,
this patch adjusts the voltage threshold for mic detection.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20201126092759.9427-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/rt5682.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index a4713bd6508d5..e260eddb51d96 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -43,6 +43,7 @@ static const struct reg_sequence patch_list[] = {
 	{RT5682_DAC_ADC_DIG_VOL1, 0xa020},
 	{RT5682_I2C_CTRL, 0x000f},
 	{RT5682_PLL2_INTERNAL, 0x8266},
+	{RT5682_SAR_IL_CMD_3, 0x8365},
 };
 
 void rt5682_apply_patch_list(struct rt5682_priv *rt5682, struct device *dev)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 07/23] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (4 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 06/23] ASoC: rt5682: change SAR voltage threshold Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 08/23] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Sasha Levin
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Nicholas Piggin, Aneesh Kumar K . V, Peter Zijlstra,
	Michael Ellerman, Sasha Levin

From: Nicholas Piggin <npiggin@gmail.com>

[ Upstream commit 8ff00399b153440c1c83e20c43020385b416415b ]

powerpc/64s keeps a counter in the mm which counts bits set in
mm_cpumask as well as other things. This means it can't use generic code
to clear bits out of the mask and doesn't adjust the arch specific
counter.

Add an arch override that allows powerpc/64s to use
clear_tasks_mm_cpumask().

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201126102530.691335-4-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/cpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6ff2578ecf17d..2b8d7a5db3837 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -815,6 +815,10 @@ void __init cpuhp_threads_init(void)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
+#ifndef arch_clear_mm_cpumask_cpu
+#define arch_clear_mm_cpumask_cpu(cpu, mm) cpumask_clear_cpu(cpu, mm_cpumask(mm))
+#endif
+
 /**
  * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU
  * @cpu: a CPU id
@@ -850,7 +854,7 @@ void clear_tasks_mm_cpumask(int cpu)
 		t = find_lock_task_mm(p);
 		if (!t)
 			continue;
-		cpumask_clear_cpu(cpu, mm_cpumask(t->mm));
+		arch_clear_mm_cpumask_cpu(cpu, t->mm);
 		task_unlock(t);
 	}
 	rcu_read_unlock();
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 08/23] drm/tegra: sor: Disable clocks on error in tegra_sor_init()
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (5 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 07/23] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 09/23] selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module Sasha Levin
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Qinglang Miao, Thierry Reding, Sasha Levin, dri-devel, linux-tegra

From: Qinglang Miao <miaoqinglang@huawei.com>

[ Upstream commit bf3a3cdcad40e5928a22ea0fd200d17fd6d6308d ]

Fix the missing clk_disable_unprepare() before return from
tegra_sor_init() in the error handling case.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tegra/sor.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index f2a114f14a3db..b83a46df00584 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3143,6 +3143,7 @@ static int tegra_sor_init(struct host1x_client *client)
 		if (err < 0) {
 			dev_err(sor->dev, "failed to deassert SOR reset: %d\n",
 				err);
+			clk_disable_unprepare(sor->clk);
 			return err;
 		}
 
@@ -3150,12 +3151,17 @@ static int tegra_sor_init(struct host1x_client *client)
 	}
 
 	err = clk_prepare_enable(sor->clk_safe);
-	if (err < 0)
+	if (err < 0) {
+		clk_disable_unprepare(sor->clk);
 		return err;
+	}
 
 	err = clk_prepare_enable(sor->clk_dp);
-	if (err < 0)
+	if (err < 0) {
+		clk_disable_unprepare(sor->clk_safe);
+		clk_disable_unprepare(sor->clk);
 		return err;
+	}
 
 	return 0;
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 09/23] selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (6 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 08/23] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 10/23] habanalabs: free host huge va_range if not used Sasha Levin
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Davide Caratti, Jakub Kicinski, Sasha Levin, linux-api

From: Davide Caratti <dcaratti@redhat.com>

[ Upstream commit e14038a7ead09faa180eb072adc4a2157a0b475f ]

a proper kernel configuration for running kselftest can be obtained with:

 $ yes | make kselftest-merge

enable compile support for the 'red' qdisc: otherwise, tdc kselftest fail
when trying to run tdc test items contained in red.json.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://lore.kernel.org/r/cfa23f2d4f672401e6cebca3a321dd1901a9ff07.1606416464.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/tc-testing/config | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/tc-testing/config b/tools/testing/selftests/tc-testing/config
index c33a7aac27ff7..b71828df5a6dd 100644
--- a/tools/testing/selftests/tc-testing/config
+++ b/tools/testing/selftests/tc-testing/config
@@ -59,6 +59,7 @@ CONFIG_NET_IFE_SKBPRIO=m
 CONFIG_NET_IFE_SKBTCINDEX=m
 CONFIG_NET_SCH_FIFO=y
 CONFIG_NET_SCH_ETS=m
+CONFIG_NET_SCH_RED=m
 
 #
 ## Network testing
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 10/23] habanalabs: free host huge va_range if not used
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (7 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 09/23] selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 11/23] habanalabs: put devices before driver removal Sasha Levin
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ofir Bitton, Oded Gabbay, Sasha Levin

From: Ofir Bitton <obitton@habana.ai>

[ Upstream commit c8c39fbd01d42c30454e42c16bcd69c17260b90a ]

If huge range is not valid, driver uses the host range also for
huge page allocations, but driver never frees its allocation.
This introduces a memory leak every time a user closes its context.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/misc/habanalabs/common/memory.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index 5ff4688683fd3..7b839189c0161 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -1616,6 +1616,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx,
 			goto host_hpage_range_err;
 		}
 	} else {
+		kfree(ctx->host_huge_va_range);
 		ctx->host_huge_va_range = ctx->host_va_range;
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 11/23] habanalabs: put devices before driver removal
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (8 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 10/23] habanalabs: free host huge va_range if not used Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 12/23] arm64: syscall: exit userspace before unmasking exceptions Sasha Levin
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ofir Bitton, Oded Gabbay, Sasha Levin

From: Ofir Bitton <obitton@habana.ai>

[ Upstream commit 5555b7c56bdec7a29c789fec27f84d40f52fbdfa ]

Driver never puts its device and control_device objects, hence
a memory leak is introduced every driver removal.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/misc/habanalabs/common/device.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 24b01cce0a384..39fa31d05d9cd 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -227,16 +227,16 @@ delete_cdev_device:
 
 static void device_cdev_sysfs_del(struct hl_device *hdev)
 {
-	/* device_release() won't be called so must free devices explicitly */
-	if (!hdev->cdev_sysfs_created) {
-		kfree(hdev->dev_ctrl);
-		kfree(hdev->dev);
-		return;
-	}
+	if (!hdev->cdev_sysfs_created)
+		goto put_devices;
 
 	hl_sysfs_fini(hdev);
 	cdev_device_del(&hdev->cdev_ctrl, hdev->dev_ctrl);
 	cdev_device_del(&hdev->cdev, hdev->dev);
+
+put_devices:
+	put_device(hdev->dev);
+	put_device(hdev->dev_ctrl);
 }
 
 /*
@@ -1362,9 +1362,9 @@ sw_fini:
 early_fini:
 	device_early_fini(hdev);
 free_dev_ctrl:
-	kfree(hdev->dev_ctrl);
+	put_device(hdev->dev_ctrl);
 free_dev:
-	kfree(hdev->dev);
+	put_device(hdev->dev);
 out_disabled:
 	hdev->disabled = true;
 	if (add_cdev_sysfs_on_err)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 12/23] arm64: syscall: exit userspace before unmasking exceptions
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (9 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 11/23] habanalabs: put devices before driver removal Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 13/23] vxlan: Add needed_headroom for lower device Sasha Levin
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mark Rutland, Catalin Marinas, James Morse, Will Deacon,
	Sasha Levin, linux-arm-kernel

From: Mark Rutland <mark.rutland@arm.com>

[ Upstream commit ca1314d73eed493c49bb1932c60a8605530db2e4 ]

In el0_svc_common() we unmask exceptions before we call user_exit(), and
so there's a window where an IRQ or debug exception can be taken while
RCU is not watching. In do_debug_exception() we account for this in via
debug_exception_{enter,exit}(), but in the el1_irq asm we do not and we
call trace functions which rely on RCU before we have a guarantee that
RCU is watching.

Let's avoid this by having el0_svc_common() exit userspace before
unmasking exceptions, matching what we do for all other EL0 entry paths.
We can use user_exit_irqoff() to avoid the pointless save/restore of IRQ
flags while we're sure exceptions are masked in DAIF.

The workaround for Cortex-A76 erratum 1463225 may trigger a debug
exception before this point, but the debug code invoked in this case is
safe even when RCU is not watching.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201130115950.22492-2-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/kernel/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
index 5f0c04863d2c1..8a4bf00e538c3 100644
--- a/arch/arm64/kernel/syscall.c
+++ b/arch/arm64/kernel/syscall.c
@@ -120,8 +120,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
 	 */
 
 	cortex_a76_erratum_1463225_svc_handler();
+	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
-	user_exit();
 
 	if (has_syscall_work(flags)) {
 		/*
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 13/23] vxlan: Add needed_headroom for lower device
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (10 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 12/23] arm64: syscall: exit userspace before unmasking exceptions Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 14/23] vxlan: Copy needed_tailroom from lowerdev Sasha Levin
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sven Eckelmann, Annika Wickert, Annika Wickert, Jakub Kicinski,
	Sasha Levin, netdev

From: Sven Eckelmann <sven@narfation.org>

[ Upstream commit 0a35dc41fea67ac4495ce7584406bf9557a6e7d0 ]

It was observed that sending data via batadv over vxlan (on top of
wireguard) reduced the performance massively compared to raw ethernet or
batadv on raw ethernet. A check of perf data showed that the
vxlan_build_skb was calling all the time pskb_expand_head to allocate
enough headroom for:

  min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len
  		+ VXLAN_HLEN + iphdr_len;

But the vxlan_config_apply only requested needed headroom for:

  lowerdev->hard_header_len + VXLAN6_HEADROOM or VXLAN_HEADROOM

So it completely ignored the needed_headroom of the lower device. The first
caller of net_dev_xmit could therefore never make sure that enough headroom
was allocated for the rest of the transmit path.

Cc: Annika Wickert <annika.wickert@exaring.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Tested-by: Annika Wickert <aw@awlnx.space>
Link: https://lore.kernel.org/r/20201126125247.1047977-1-sven@narfation.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/vxlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index b248d9e694254..85c4a6bfc7c06 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3802,6 +3802,7 @@ static void vxlan_config_apply(struct net_device *dev,
 		dev->gso_max_segs = lowerdev->gso_max_segs;
 
 		needed_headroom = lowerdev->hard_header_len;
+		needed_headroom += lowerdev->needed_headroom;
 
 		max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM :
 					   VXLAN_HEADROOM);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 14/23] vxlan: Copy needed_tailroom from lowerdev
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (11 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 13/23] vxlan: Add needed_headroom for lower device Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() Sasha Levin
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sven Eckelmann, Jakub Kicinski, Sasha Levin, netdev

From: Sven Eckelmann <sven@narfation.org>

[ Upstream commit a5e74021e84bb5eadf760aaf2c583304f02269be ]

While vxlan doesn't need any extra tailroom, the lowerdev might need it. In
that case, copy it over to reduce the chance for additional (re)allocations
in the transmit path.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20201126125247.1047977-2-sven@narfation.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/vxlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 85c4a6bfc7c06..94e14238fb8a1 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3804,6 +3804,8 @@ static void vxlan_config_apply(struct net_device *dev,
 		needed_headroom = lowerdev->hard_header_len;
 		needed_headroom += lowerdev->needed_headroom;
 
+		dev->needed_tailroom = lowerdev->needed_tailroom;
+
 		max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM :
 					   VXLAN_HEADROOM);
 		if (max_mtu < ETH_MIN_MTU)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (12 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 14/23] vxlan: Copy needed_tailroom from lowerdev Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 18:09   ` Andrea Parri
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 16/23] scsi: mpt3sas: Increase IOCInit request timeout to 30s Sasha Levin
                   ` (7 subsequent siblings)
  21 siblings, 1 reply; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Andrea Parri (Microsoft),
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	Saruhan Karademir, Sasha Levin, devel

From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>

[ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]

Check that the packet is of the expected size at least, don't copy data
past the packet.

Link: https://lore.kernel.org/r/20201118145348.109879-1-parri.andrea@gmail.com
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Reported-by: Saruhan Karademir <skarade@microsoft.com>
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 8f5f5dc863a4a..6779ee4edfee3 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1246,6 +1246,11 @@ static void storvsc_on_channel_callback(void *context)
 		request = (struct storvsc_cmd_request *)
 			((unsigned long)desc->trans_id);
 
+		if (hv_pkt_datalen(desc) < sizeof(struct vstor_packet) - vmscsi_size_delta) {
+			dev_err(&device->device, "Invalid packet len\n");
+			continue;
+		}
+
 		if (request == &stor_device->init_request ||
 		    request == &stor_device->reset_request) {
 			memcpy(&request->vstor_packet, packet,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 16/23] scsi: mpt3sas: Increase IOCInit request timeout to 30s
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (13 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 17/23] dm table: Remove BUG_ON(in_interrupt()) Sasha Levin
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sreekanth Reddy, Martin K . Petersen, Sasha Levin,
	MPT-FusionLinux.pdl, linux-scsi

From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>

[ Upstream commit 85dad327d9b58b4c9ce08189a2707167de392d23 ]

Currently the IOCInit request message timeout is set to 10s. This is not
sufficient in some scenarios such as during HBA FW downgrade operations.

Increase the IOCInit request timeout to 30s.

Link: https://lore.kernel.org/r/20201130082733.26120-1-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 87d05c1950870..d62c1aaf53fbd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -6441,7 +6441,7 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc)
 
 	r = _base_handshake_req_reply_wait(ioc,
 	    sizeof(Mpi2IOCInitRequest_t), (u32 *)&mpi_request,
-	    sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 10);
+	    sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 30);
 
 	if (r != 0) {
 		ioc_err(ioc, "%s: handshake failed (r=%d)\n", __func__, r);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 17/23] dm table: Remove BUG_ON(in_interrupt())
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (14 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 16/23] scsi: mpt3sas: Increase IOCInit request timeout to 30s Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 18/23] iwlwifi: pcie: add one missing entry for AX210 Sasha Levin
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Thomas Gleixner, Sebastian Andrzej Siewior, Mike Snitzer,
	Sasha Levin, dm-devel, linux-raid

From: Thomas Gleixner <tglx@linutronix.de>

[ Upstream commit e7b624183d921b49ef0a96329f21647d38865ee9 ]

The BUG_ON(in_interrupt()) in dm_table_event() is a historic leftover from
a rework of the dm table code which changed the calling context.

Issuing a BUG for a wrong calling context is frowned upon and
in_interrupt() is deprecated and only covering parts of the wrong
contexts. The sanity check for the context is covered by
CONFIG_DEBUG_ATOMIC_SLEEP and other debug facilities already.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/md/dm-table.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 229f461e7def3..36f2556c1d4f1 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1298,12 +1298,6 @@ void dm_table_event_callback(struct dm_table *t,
 
 void dm_table_event(struct dm_table *t)
 {
-	/*
-	 * You can no longer call dm_table_event() from interrupt
-	 * context, use a bottom half instead.
-	 */
-	BUG_ON(in_interrupt());
-
 	mutex_lock(&_event_lock);
 	if (t->event_fn)
 		t->event_fn(t->event_context);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 18/23] iwlwifi: pcie: add one missing entry for AX210
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (15 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 17/23] dm table: Remove BUG_ON(in_interrupt()) Sasha Levin
@ 2020-12-12 16:07 ` Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 19/23] iwlwifi: pcie: add some missing entries " Sasha Levin
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:07 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Luca Coelho, Kalle Valo, Sasha Levin, linux-wireless, netdev

From: Luca Coelho <luciano.coelho@intel.com>

[ Upstream commit 5febcdef30902fa870128b9789b873199f13aff1 ]

The 0x0024 subsytem device ID was missing from the list, so some AX210
devices were not recognized.  Add it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201202143859.308eab4db42c.I3763196cd3f7bb36f3dcabf02ec4e7c4fe859c0f@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index e02bafb8921f6..0a4c7d1b37f0e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -536,6 +536,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 
 	{IWL_PCI_DEVICE(0x2725, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0x0024, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 19/23] iwlwifi: pcie: add some missing entries for AX210
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (16 preceding siblings ...)
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 18/23] iwlwifi: pcie: add one missing entry for AX210 Sasha Levin
@ 2020-12-12 16:08 ` Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 20/23] drm/amd/display: Init clock value by current vbios CLKs Sasha Levin
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Golan Ben Ami, Luca Coelho, Kalle Valo, Sasha Levin,
	linux-wireless, netdev

From: Golan Ben Ami <golan.ben.ami@intel.com>

[ Upstream commit 9b15596c5006d82b2f82810e8cbf80d8c6e7e7b4 ]

Some subsytem device IDs were missing from the list, so some AX210
devices were not recognized.  Add them.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201202143859.a06ba7540449.I7390305d088a49c1043c9b489154fe057989c18f@changeid
Link: https://lore.kernel.org/r/20201121003411.9450-1-ikegami.t@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 0a4c7d1b37f0e..2eeb644981417 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -540,6 +540,11 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 	{IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0xE020, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0xE024, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0x4020, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0x6020, iwlax210_2ax_cfg_ty_gf_a0)},
+	{IWL_PCI_DEVICE(0x2725, 0x6024, iwlax210_2ax_cfg_ty_gf_a0)},
 	{IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)},
 	{IWL_PCI_DEVICE(0x2726, 0x0090, iwlax211_cfg_snj_gf_a0)},
 	{IWL_PCI_DEVICE(0x2726, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)},
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 20/23] drm/amd/display: Init clock value by current vbios CLKs
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (17 preceding siblings ...)
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 19/23] iwlwifi: pcie: add some missing entries " Sasha Levin
@ 2020-12-12 16:08 ` Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 21/23] perf/x86/intel: Check PEBS status correctly Sasha Levin
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Brandon Syu, Tony Cheng, Aurabindo Pillai, Alex Deucher,
	Sasha Levin, dri-devel

From: Brandon Syu <Brandon.Syu@amd.com>

[ Upstream commit 7e0b367db85ef7b91399006253759a024eab7653 ]

[Why]
While booting into OS, driver updates DPP/DISP CLKs.
But init clock value is zero which is invalid.

[How]
Get current clocks value to update init clocks.
To avoid underflow.

Signed-off-by: Brandon Syu <Brandon.Syu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
index 2f8fee05547ac..c001307b0a59a 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
@@ -163,8 +163,17 @@ void rn_update_clocks(struct clk_mgr *clk_mgr_base,
 			new_clocks->dppclk_khz = 100000;
 	}
 
-	if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
-		if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
+	/*
+	 * Temporally ignore thew 0 cases for disp and dpp clks.
+	 * We may have a new feature that requires 0 clks in the future.
+	 */
+	if (new_clocks->dppclk_khz == 0 || new_clocks->dispclk_khz == 0) {
+		new_clocks->dppclk_khz = clk_mgr_base->clks.dppclk_khz;
+		new_clocks->dispclk_khz = clk_mgr_base->clks.dispclk_khz;
+	}
+
+	if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr_base->clks.dppclk_khz)) {
+		if (clk_mgr_base->clks.dppclk_khz > new_clocks->dppclk_khz)
 			dpp_clock_lowered = true;
 		clk_mgr_base->clks.dppclk_khz = new_clocks->dppclk_khz;
 		update_dppclk = true;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 21/23] perf/x86/intel: Check PEBS status correctly
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (18 preceding siblings ...)
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 20/23] drm/amd/display: Init clock value by current vbios CLKs Sasha Levin
@ 2020-12-12 16:08 ` Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 22/23] kbuild: avoid split lines in .mod files Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 23/23] tools/testing/selftests/vm: fix build error Sasha Levin
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Stephane Eranian, Namhyung Kim, Peter Zijlstra, Sasha Levin

From: Stephane Eranian <eranian@google.com>

[ Upstream commit fc17db8aa4c53cbd2d5469bb0521ea0f0a6dbb27 ]

The kernel cannot disambiguate when 2+ PEBS counters overflow at the
same time. This is what the comment for this code suggests.  However,
I see the comparison is done with the unfiltered p->status which is a
copy of IA32_PERF_GLOBAL_STATUS at the time of the sample. This
register contains more than the PEBS counter overflow bits. It also
includes many other bits which could also be set.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201126110922.317681-2-namhyung@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/intel/ds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 404315df1e167..cf12e5a956f7e 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -1913,7 +1913,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
 		 * that caused the PEBS record. It's called collision.
 		 * If collision happened, the record will be dropped.
 		 */
-		if (p->status != (1ULL << bit)) {
+		if (pebs_status != (1ULL << bit)) {
 			for_each_set_bit(i, (unsigned long *)&pebs_status, size)
 				error[i]++;
 			continue;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 22/23] kbuild: avoid split lines in .mod files
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (19 preceding siblings ...)
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 21/23] perf/x86/intel: Check PEBS status correctly Sasha Levin
@ 2020-12-12 16:08 ` Sasha Levin
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 23/23] tools/testing/selftests/vm: fix build error Sasha Levin
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Masahiro Yamada, Sami Tolvanen, Sasha Levin, linux-kbuild

From: Masahiro Yamada <masahiroy@kernel.org>

[ Upstream commit 7d32358be8acb119dcfe39b6cf67ec6d94bf1fe7 ]

"xargs echo" is not a safe way to remove line breaks because the input
may exceed the command line limit and xargs may break it up into
multiple invocations of echo. This should never happen because
scripts/gen_autoksyms.sh expects all undefined symbols are placed in
the second line of .mod files.

One possible way is to replace "xargs echo" with
"sed ':x;N;$!bx;s/\n/ /g'" or something, but I rewrote the code by
using awk because it is more readable.

This issue was reported by Sami Tolvanen; in his Clang LTO patch set,
$(multi-used-m) is no longer an ELF object, but a thin archive that
contains LLVM bitcode files. llvm-nm prints out symbols for each
archive member separately, which results a lot of dupications, in some
places, beyond the system-defined limit.

This problem must be fixed irrespective of LTO, and we must ensure
zero possibility of having this issue.

Link: https://lkml.org/lkml/2020/12/1/1658
Reported-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 scripts/Makefile.build | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a467b93234424..80953d5cce80f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -252,6 +252,9 @@ objtool_dep = $(objtool_obj)					\
 ifdef CONFIG_TRIM_UNUSED_KSYMS
 cmd_gen_ksymdeps = \
 	$(CONFIG_SHELL) $(srctree)/scripts/gen_ksymdeps.sh $@ >> $(dot-target).cmd
+
+# List module undefined symbols
+undefined_syms = $(NM) $< | $(AWK) '$$1 == "U" { printf("%s%s", x++ ? " " : "", $$2) }';
 endif
 
 define rule_cc_o_c
@@ -271,13 +274,6 @@ define rule_as_o_S
 	$(call cmd,modversions_S)
 endef
 
-# List module undefined symbols (or empty line if not enabled)
-ifdef CONFIG_TRIM_UNUSED_KSYMS
-cmd_undef_syms = $(NM) $< | sed -n 's/^  *U //p' | xargs echo
-else
-cmd_undef_syms = echo
-endif
-
 # Built-in and composite module parts
 $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
 	$(call if_changed_rule,cc_o_c)
@@ -285,7 +281,7 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
 
 cmd_mod = { \
 	echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \
-	$(cmd_undef_syms); \
+	$(undefined_syms) echo; \
 	} > $@
 
 $(obj)/%.mod: $(obj)/%.o FORCE
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH AUTOSEL 5.9 23/23] tools/testing/selftests/vm: fix build error
  2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
                   ` (20 preceding siblings ...)
  2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 22/23] kbuild: avoid split lines in .mod files Sasha Levin
@ 2020-12-12 16:08 ` Sasha Levin
  21 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-12 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xingxing Su, Andrew Morton, Shuah Khan, Sandipan Das,
	John Hubbard, Dave Hansen, Kirill A. Shutemov, Brian Geffon,
	Mina Almasry, Linus Torvalds, Sasha Levin, linux-api

From: Xingxing Su <suxingxing@loongson.cn>

[ Upstream commit d8cbe8bfa7df3c680ddfd5e1eee3a5c86d8dc764 ]

Only x86 and PowerPC implement the pkey-xxx.h, and an error was reported
when compiling protection_keys.c.

Add a Arch judgment to compile "protection_keys" in the Makefile.

If other arch implement this, add the arch name to the Makefile.
eg:
    ifneq (,$(findstring $(ARCH),powerpc mips ... ))

Following build errors:

    pkey-helpers.h:93:2: error: #error Architecture not supported
     #error Architecture not supported
    pkey-helpers.h:96:20: error: `PKEY_DISABLE_ACCESS' undeclared
     #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
                        ^
    protection_keys.c:218:45: error: `PKEY_DISABLE_WRITE' undeclared
     pkey_assert(flags & (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE));
                                                ^

Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Sandipan Das <sandipan@linux.ibm.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Mina Almasry <almasrymina@google.com>
Link: https://lkml.kernel.org/r/1606826876-30656-1-git-send-email-suxingxing@loongson.cn
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/vm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index a9026706d597d..ac76a78249739 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -43,9 +43,13 @@ ifeq ($(CAN_BUILD_X86_64),1)
 TEST_GEN_FILES += $(BINARIES_64)
 endif
 else
+
+ifneq (,$(findstring $(ARCH),powerpc))
 TEST_GEN_FILES += protection_keys
 endif
 
+endif
+
 ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64))
 TEST_GEN_FILES += va_128TBswitch
 TEST_GEN_FILES += virtual_address_range
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() Sasha Levin
@ 2020-12-12 18:09   ` Andrea Parri
  2020-12-13 14:05     ` Sasha Levin
  2020-12-14 11:07     ` Dan Carpenter
  0 siblings, 2 replies; 28+ messages in thread
From: Andrea Parri @ 2020-12-12 18:09 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, Saruhan Karademir, devel

Hi Sasha,

On Sat, Dec 12, 2020 at 11:07:56AM -0500, Sasha Levin wrote:
> From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>
> 
> [ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]

FYI, we found that this commit introduced a regression and posted a
revert:

  https://lkml.kernel.org/r/20201211131404.21359-1-parri.andrea@gmail.com

Same comment for the AUTOSEL 5.4, 4.19 and 4.14 you've just posted.

  Andrea


> 
> Check that the packet is of the expected size at least, don't copy data
> past the packet.
> 
> Link: https://lore.kernel.org/r/20201118145348.109879-1-parri.andrea@gmail.com
> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> Reported-by: Saruhan Karademir <skarade@microsoft.com>
> Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/scsi/storvsc_drv.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 8f5f5dc863a4a..6779ee4edfee3 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1246,6 +1246,11 @@ static void storvsc_on_channel_callback(void *context)
>  		request = (struct storvsc_cmd_request *)
>  			((unsigned long)desc->trans_id);
>  
> +		if (hv_pkt_datalen(desc) < sizeof(struct vstor_packet) - vmscsi_size_delta) {
> +			dev_err(&device->device, "Invalid packet len\n");
> +			continue;
> +		}
> +
>  		if (request == &stor_device->init_request ||
>  		    request == &stor_device->reset_request) {
>  			memcpy(&request->vstor_packet, packet,
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-12 18:09   ` Andrea Parri
@ 2020-12-13 14:05     ` Sasha Levin
  2020-12-14 11:07     ` Dan Carpenter
  1 sibling, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-13 14:05 UTC (permalink / raw)
  To: Andrea Parri
  Cc: linux-kernel, stable, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, Saruhan Karademir, devel

On Sat, Dec 12, 2020 at 07:09:01PM +0100, Andrea Parri wrote:
>Hi Sasha,
>
>On Sat, Dec 12, 2020 at 11:07:56AM -0500, Sasha Levin wrote:
>> From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>
>>
>> [ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]
>
>FYI, we found that this commit introduced a regression and posted a
>revert:
>
>  https://lkml.kernel.org/r/20201211131404.21359-1-parri.andrea@gmail.com
>
>Same comment for the AUTOSEL 5.4, 4.19 and 4.14 you've just posted.

I'll drop those, thanks!

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-12 18:09   ` Andrea Parri
  2020-12-13 14:05     ` Sasha Levin
@ 2020-12-14 11:07     ` Dan Carpenter
  2020-12-14 13:06       ` Konstantin Ryabitsev
  1 sibling, 1 reply; 28+ messages in thread
From: Dan Carpenter @ 2020-12-14 11:07 UTC (permalink / raw)
  To: Andrea Parri, Konstantin Ryabitsev, Sasha Levin
  Cc: Martin K. Petersen, linux-scsi, James E.J. Bottomley,
	linux-kernel, stable, devel, Saruhan Karademir

On Sat, Dec 12, 2020 at 07:09:01PM +0100, Andrea Parri wrote:
> Hi Sasha,
> 
> On Sat, Dec 12, 2020 at 11:07:56AM -0500, Sasha Levin wrote:
> > From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>
> > 
> > [ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]
> 
> FYI, we found that this commit introduced a regression and posted a
> revert:
> 
>   https://lkml.kernel.org/r/20201211131404.21359-1-parri.andrea@gmail.com
> 
> Same comment for the AUTOSEL 5.4, 4.19 and 4.14 you've just posted.
> 

Konstantin, is there anyway we could make searching lore.kernel.org
search all the mailing lists?  Right now we can only search one mailing
list at a time.

Part of the stable process should be to search lore.kernel.org for
Fixes: 3b8c72d076c4 ("scsi: storvsc: Validate length of... ")

But, unfortunately, git revert sets people up for failure by not
including a fixes tag so we'd also have to search for:
This reverts commit 3b8c72d076c42bf27284cda7b2b2b522810686f8.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-14 11:07     ` Dan Carpenter
@ 2020-12-14 13:06       ` Konstantin Ryabitsev
  2020-12-14 18:29         ` Sasha Levin
  0 siblings, 1 reply; 28+ messages in thread
From: Konstantin Ryabitsev @ 2020-12-14 13:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andrea Parri, Sasha Levin, Martin K. Petersen, linux-scsi,
	James E.J. Bottomley, linux-kernel, stable, devel,
	Saruhan Karademir

On Mon, Dec 14, 2020 at 02:07:11PM +0300, Dan Carpenter wrote:
> On Sat, Dec 12, 2020 at 07:09:01PM +0100, Andrea Parri wrote:
> > Hi Sasha,
> > 
> > On Sat, Dec 12, 2020 at 11:07:56AM -0500, Sasha Levin wrote:
> > > From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>
> > > 
> > > [ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]
> > 
> > FYI, we found that this commit introduced a regression and posted a
> > revert:
> > 
> >   https://lkml.kernel.org/r/20201211131404.21359-1-parri.andrea@gmail.com
> > 
> > Same comment for the AUTOSEL 5.4, 4.19 and 4.14 you've just posted.
> > 
> 
> Konstantin, is there anyway we could make searching lore.kernel.org
> search all the mailing lists?  Right now we can only search one mailing
> list at a time.

This functionality is coming in the next version of public-inbox and 
should be available on lore.kernel.org within the next little while.

https://lore.kernel.org/workflows/20201201184814.GA32272@dcvr/

-K

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  2020-12-14 13:06       ` Konstantin Ryabitsev
@ 2020-12-14 18:29         ` Sasha Levin
  0 siblings, 0 replies; 28+ messages in thread
From: Sasha Levin @ 2020-12-14 18:29 UTC (permalink / raw)
  To: Dan Carpenter, Andrea Parri, Martin K. Petersen, linux-scsi,
	James E.J. Bottomley, linux-kernel, stable, devel,
	Saruhan Karademir

On Mon, Dec 14, 2020 at 08:06:25AM -0500, Konstantin Ryabitsev wrote:
>On Mon, Dec 14, 2020 at 02:07:11PM +0300, Dan Carpenter wrote:
>> On Sat, Dec 12, 2020 at 07:09:01PM +0100, Andrea Parri wrote:
>> > Hi Sasha,
>> >
>> > On Sat, Dec 12, 2020 at 11:07:56AM -0500, Sasha Levin wrote:
>> > > From: "Andrea Parri (Microsoft)" <parri.andrea@gmail.com>
>> > >
>> > > [ Upstream commit 3b8c72d076c42bf27284cda7b2b2b522810686f8 ]
>> >
>> > FYI, we found that this commit introduced a regression and posted a
>> > revert:
>> >
>> >   https://lkml.kernel.org/r/20201211131404.21359-1-parri.andrea@gmail.com
>> >
>> > Same comment for the AUTOSEL 5.4, 4.19 and 4.14 you've just posted.
>> >
>>
>> Konstantin, is there anyway we could make searching lore.kernel.org
>> search all the mailing lists?  Right now we can only search one mailing
>> list at a time.
>
>This functionality is coming in the next version of public-inbox and
>should be available on lore.kernel.org within the next little while.

That's a good idea Dan; I had something running on linux-next, but I
guess it's not enough and cases such as these sneak in.

I wrote a script to do what you've suggested by simply cloning the repos
on erol.kernel.org locally and then doing a simple search for the
"Fixes:" and revert patterns.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-12-14 18:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-12 16:07 [PATCH AUTOSEL 5.9 01/23] drm/tegra: sor: Don't warn on probe deferral Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 02/23] drm/tegra: sor: Ensure regulators are disabled on teardown Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 03/23] drm/tegra: replace idr_init() by idr_init_base() Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 04/23] dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 05/23] gfs2: set lockdep subclass for iopen glocks Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 06/23] ASoC: rt5682: change SAR voltage threshold Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 07/23] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 08/23] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 09/23] selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 10/23] habanalabs: free host huge va_range if not used Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 11/23] habanalabs: put devices before driver removal Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 12/23] arm64: syscall: exit userspace before unmasking exceptions Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 13/23] vxlan: Add needed_headroom for lower device Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 14/23] vxlan: Copy needed_tailroom from lowerdev Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() Sasha Levin
2020-12-12 18:09   ` Andrea Parri
2020-12-13 14:05     ` Sasha Levin
2020-12-14 11:07     ` Dan Carpenter
2020-12-14 13:06       ` Konstantin Ryabitsev
2020-12-14 18:29         ` Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 16/23] scsi: mpt3sas: Increase IOCInit request timeout to 30s Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 17/23] dm table: Remove BUG_ON(in_interrupt()) Sasha Levin
2020-12-12 16:07 ` [PATCH AUTOSEL 5.9 18/23] iwlwifi: pcie: add one missing entry for AX210 Sasha Levin
2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 19/23] iwlwifi: pcie: add some missing entries " Sasha Levin
2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 20/23] drm/amd/display: Init clock value by current vbios CLKs Sasha Levin
2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 21/23] perf/x86/intel: Check PEBS status correctly Sasha Levin
2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 22/23] kbuild: avoid split lines in .mod files Sasha Levin
2020-12-12 16:08 ` [PATCH AUTOSEL 5.9 23/23] tools/testing/selftests/vm: fix build error Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).