Skip to contentSkip to conversation

5.13.9-rc1 review

PATCH In review Greg Kroah-Hartman 8 participants 46 messages Aug 6, 2021 – Aug 9, 2021

Subsystems (4)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/35 drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"

In reply to Greg Kroah-Hartman

From: Jason Ekstrand <[email protected]>

commit c9d9fdbc108af8915d3f497bbdf3898bf8f321b8 upstream.

This reverts 686c7c35abc2 ("drm/i915/gem: Asynchronous cmdparser"). The justification for this commit in the git history was a vague comment about getting it out from under the struct_mutex. While this may improve perf for some workloads on Gen7 platforms where we rely on the command parser for features such as indirect rendering, no numbers were provided to prove such an improvement. It claims to closed two gitlab/bugzilla issues but with no explanation whatsoever as to why or what bug it's fixing.

Meanwhile, by moving command parsing off to an async callback, it leaves us with a problem of what to do on error. When things were synchronous, EXECBUFFER2 would fail with an error code if parsing failed. When moving it to async, we needed another way to handle that error and the solution employed was to set an error on the dma_fence and then trust that said error gets propagated to the client eventually. Moving back to synchronous will help us untangle the fence error propagation mess.

This also reverts most of 0edbb9ba1bfe ("drm/i915: Move cmd parser pinning to execbuffer") which is a refactor of some of our allocation paths for asynchronous parsing. Now that everything is synchronous, we don't need it.

v2 (Daniel Vetter):
- Add stabel Cc and Fixes tag

Cc <[email protected]> # v5.6+
Fixes 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")
Cc Maarten Lankhorst <[email protected]>
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 227 +-----------------
 .../i915/gem/selftests/i915_gem_execbuffer.c  |   4 +
 drivers/gpu/drm/i915/i915_cmd_parser.c        | 118 +++++----
 drivers/gpu/drm/i915/i915_drv.h               |   7 +-
 4 files changed, 91 insertions(+), 265 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +13 -214
index 5964e67c7d36..305c320f9a83 100644
@@ -25,10 +25,8 @@
 #include "i915_gem_clflush.h"
 #include "i915_gem_context.h"
 #include "i915_gem_ioctls.h"
-#include "i915_sw_fence_work.h"
 #include "i915_trace.h"
 #include "i915_user_extensions.h"
-#include "i915_memcpy.h"
 
 struct eb_vma {
 	struct i915_vma *vma;
@@ -1456,6 +1454,10 @@ static u32 *reloc_gpu(struct i915_execbuffer *eb,
 		int err;
 		struct intel_engine_cs *engine = eb->engine;
 
+		/* If we need to copy for the cmdparser, we will stall anyway */
+		if (eb_use_cmdparser(eb))
+			return ERR_PTR(-EWOULDBLOCK);
+
 		if (!reloc_can_use_engine(engine)) {
 			engine = engine->gt->engine_class[COPY_ENGINE_CLASS][0];
 			if (!engine)
@@ -2372,217 +2374,6 @@ shadow_batch_pin(struct i915_execbuffer *eb,
 	return vma;
 }
 
-struct eb_parse_work {
-	struct dma_fence_work base;
-	struct intel_engine_cs *engine;
-	struct i915_vma *batch;
-	struct i915_vma *shadow;
-	struct i915_vma *trampoline;
-	unsigned long batch_offset;
-	unsigned long batch_length;
-	unsigned long *jump_whitelist;
-	const void *batch_map;
-	void *shadow_map;
-};
-
-static int __eb_parse(struct dma_fence_work *work)
-{
-	struct eb_parse_work *pw = container_of(work, typeof(*pw), base);
-	int ret;
-	bool cookie;
-
-	cookie = dma_fence_begin_signalling();
-	ret = intel_engine_cmd_parser(pw->engine,
-				      pw->batch,
-				      pw->batch_offset,
-				      pw->batch_length,
-				      pw->shadow,
-				      pw->jump_whitelist,
-				      pw->shadow_map,
-				      pw->batch_map);
-	dma_fence_end_signalling(cookie);
-
-	return ret;
-}
-
-static void __eb_parse_release(struct dma_fence_work *work)
-{
-	struct eb_parse_work *pw = container_of(work, typeof(*pw), base);
-
-	if (!IS_ERR_OR_NULL(pw->jump_whitelist))
-		kfree(pw->jump_whitelist);
-
-	if (pw->batch_map)
-		i915_gem_object_unpin_map(pw->batch->obj);
-	else
-		i915_gem_object_unpin_pages(pw->batch->obj);
-
-	i915_gem_object_unpin_map(pw->shadow->obj);
-
-	if (pw->trampoline)
-		i915_active_release(&pw->trampoline->active);
-	i915_active_release(&pw->shadow->active);
-	i915_active_release(&pw->batch->active);
-}
-
-static const struct dma_fence_work_ops eb_parse_ops = {
-	.name = "eb_parse",
-	.work = __eb_parse,
-	.release = __eb_parse_release,
-};
-
-static inline int
-__parser_mark_active(struct i915_vma *vma,
-		     struct intel_timeline *tl,
-		     struct dma_fence *fence)
-{
-	struct intel_gt_buffer_pool_node *node = vma->private;
-
-	return i915_active_ref(&node->active, tl->fence_context, fence);
-}
-
-static int
-parser_mark_active(struct eb_parse_work *pw, struct intel_timeline *tl)
-{
-	int err;
-
-	mutex_lock(&tl->mutex);
-
-	err = __parser_mark_active(pw->shadow, tl, &pw->base.dma);
-	if (err)
-		goto unlock;
-
-	if (pw->trampoline) {
-		err = __parser_mark_active(pw->trampoline, tl, &pw->base.dma);
-		if (err)
-			goto unlock;
-	}
-
-unlock:
-	mutex_unlock(&tl->mutex);
-	return err;
-}
-
-static int eb_parse_pipeline(struct i915_execbuffer *eb,
-			     struct i915_vma *shadow,
-			     struct i915_vma *trampoline)
-{
-	struct eb_parse_work *pw;
-	struct drm_i915_gem_object *batch = eb->batch->vma->obj;
-	bool needs_clflush;
-	int err;
-
-	GEM_BUG_ON(overflows_type(eb->batch_start_offset, pw->batch_offset));
-	GEM_BUG_ON(overflows_type(eb->batch_len, pw->batch_length));
-
-	pw = kzalloc(sizeof(*pw), GFP_KERNEL);
-	if (!pw)
-		return -ENOMEM;
-
-	err = i915_active_acquire(&eb->batch->vma->active);
-	if (err)
-		goto err_free;
-
-	err = i915_active_acquire(&shadow->active);
-	if (err)
-		goto err_batch;
-
-	if (trampoline) {
-		err = i915_active_acquire(&trampoline->active);
-		if (err)
-			goto err_shadow;
-	}
-
-	pw->shadow_map = i915_gem_object_pin_map(shadow->obj, I915_MAP_WB);
-	if (IS_ERR(pw->shadow_map)) {
-		err = PTR_ERR(pw->shadow_map);
-		goto err_trampoline;
-	}
-
-	needs_clflush =
-		!(batch->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ);
-
-	pw->batch_map = ERR_PTR(-ENODEV);
-	if (needs_clflush && i915_has_memcpy_from_wc())
-		pw->batch_map = i915_gem_object_pin_map(batch, I915_MAP_WC);
-
-	if (IS_ERR(pw->batch_map)) {
-		err = i915_gem_object_pin_pages(batch);
-		if (err)
-			goto err_unmap_shadow;
-		pw->batch_map = NULL;
-	}
-
-	pw->jump_whitelist =
-		intel_engine_cmd_parser_alloc_jump_whitelist(eb->batch_len,
-							     trampoline);
-	if (IS_ERR(pw->jump_whitelist)) {
-		err = PTR_ERR(pw->jump_whitelist);
-		goto err_unmap_batch;
-	}
-
-	dma_fence_work_init(&pw->base, &eb_parse_ops);
-
-	pw->engine = eb->engine;
-	pw->batch = eb->batch->vma;
-	pw->batch_offset = eb->batch_start_offset;
-	pw->batch_length = eb->batch_len;
-	pw->shadow = shadow;
-	pw->trampoline = trampoline;
-
-	/* Mark active refs early for this worker, in case we get interrupted */
-	err = parser_mark_active(pw, eb->context->timeline);
-	if (err)
-		goto err_commit;
-
-	err = dma_resv_reserve_shared(pw->batch->resv, 1);
-	if (err)
-		goto err_commit;
-
-	err = dma_resv_reserve_shared(shadow->resv, 1);
-	if (err)
-		goto err_commit;
-
-	/* Wait for all writes (and relocs) into the batch to complete */
-	err = i915_sw_fence_await_reservation(&pw->base.chain,
-					      pw->batch->resv, NULL, false,
-					      0, I915_FENCE_GFP);
-	if (err < 0)
-		goto err_commit;
-
-	/* Keep the batch alive and unwritten as we parse */
-	dma_resv_add_shared_fence(pw->batch->resv, &pw->base.dma);
-
-	/* Force execution to wait for completion of the parser */
-	dma_resv_add_excl_fence(shadow->resv, &pw->base.dma);
-
-	dma_fence_work_commit_imm(&pw->base);
-	return 0;
-
-err_commit:
-	i915_sw_fence_set_error_once(&pw->base.chain, err);
-	dma_fence_work_commit_imm(&pw->base);
-	return err;
-
-err_unmap_batch:
-	if (pw->batch_map)
-		i915_gem_object_unpin_map(batch);
-	else
-		i915_gem_object_unpin_pages(batch);
-err_unmap_shadow:
-	i915_gem_object_unpin_map(shadow->obj);
-err_trampoline:
-	if (trampoline)
-		i915_active_release(&trampoline->active);
-err_shadow:
-	i915_active_release(&shadow->active);
-err_batch:
-	i915_active_release(&eb->batch->vma->active);
-err_free:
-	kfree(pw);
-	return err;
-}
-
 static struct i915_vma *eb_dispatch_secure(struct i915_execbuffer *eb, struct i915_vma *vma)
 {
 	/*
@@ -2672,7 +2463,15 @@ static int eb_parse(struct i915_execbuffer *eb)
 		goto err_trampoline;
 	}
 
-	err = eb_parse_pipeline(eb, shadow, trampoline);
+	err = dma_resv_reserve_shared(shadow->resv, 1);
+	if (err)
+		goto err_trampoline;
+
+	err = intel_engine_cmd_parser(eb->engine,
+				      eb->batch->vma,
+				      eb->batch_start_offset,
+				      eb->batch_len,
+				      shadow, trampoline);
 	if (err)
 		goto err_unpin_batch;
 
drivers/gpu/drm/i915/gem/selftests/i915_gem_execbuffer.c +4 -0
index 4df505e4c53a..16162fc2782d 100644
@@ -125,6 +125,10 @@ static int igt_gpu_reloc(void *arg)
 	intel_gt_pm_get(&eb.i915->gt);
 
 	for_each_uabi_engine(eb.engine, eb.i915) {
+		if (intel_engine_requires_cmd_parser(eb.engine) ||
+		    intel_engine_using_cmd_parser(eb.engine))
+			continue;
+
 		reloc_cache_init(&eb.reloc_cache, eb.i915);
 		memset(map, POISON_INUSE, 4096);
 
drivers/gpu/drm/i915/i915_cmd_parser.c +73 -45

187 lines not on this page · raw message

drivers/gpu/drm/i915/i915_drv.h +1 -6
index 69e43bf91a15..4c041e670904 100644
@@ -1881,17 +1881,12 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type);
 int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv);
 int intel_engine_init_cmd_parser(struct intel_engine_cs *engine);
 void intel_engine_cleanup_cmd_parser(struct intel_engine_cs *engine);
-unsigned long *intel_engine_cmd_parser_alloc_jump_whitelist(u32 batch_length,
-							    bool trampoline);
-
 int intel_engine_cmd_parser(struct intel_engine_cs *engine,
 			    struct i915_vma *batch,
 			    unsigned long batch_offset,
 			    unsigned long batch_length,
 			    struct i915_vma *shadow,
-			    unsigned long *jump_whitelist,
-			    void *shadow_map,
-			    const void *batch_map);
+			    bool trampoline);
 #define I915_CMD_PARSER_TRAMPOLINE_SIZE 8
 
 /* intel_device_info.c */
Signature · 1 line
2.30.2
author maintainer
#14 lore raw

PATCH 12/35 ASoC: Intel: boards: create sof-maxim-common module

In reply to Greg Kroah-Hartman

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

[ Upstream commit 9c5046e4b3e736eec5b9a8f1d59c07bb0ed78a7a ]

sof_maxim_common.o is linked twice, move to a dedicated module.

Also clean-up interfaces to use a consistent 'max_98373' prefix for all symbols.

---
 sound/soc/intel/boards/Kconfig            |  5 +++++
 sound/soc/intel/boards/Makefile           |  6 ++++--
 sound/soc/intel/boards/sof_maxim_common.c | 24 ++++++++++++++++-------
 sound/soc/intel/boards/sof_maxim_common.h |  6 +++---
 sound/soc/intel/boards/sof_rt5682.c       |  5 +++--
 sound/soc/intel/boards/sof_sdw.c          |  1 +
 sound/soc/intel/boards/sof_sdw_max98373.c |  4 ++--
 7 files changed, 35 insertions(+), 16 deletions(-)
sound/soc/intel/boards/Kconfig +5 -0
index ec4d754eb348..ceeb618bd950 100644
@@ -29,6 +29,9 @@ config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
 config SND_SOC_INTEL_HDA_DSP_COMMON
 	tristate
 
+config SND_SOC_INTEL_SOF_MAXIM_COMMON
+	tristate
+
 if SND_SOC_INTEL_CATPT
 
 config SND_SOC_INTEL_HASWELL_MACH
@@ -469,6 +472,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
 	select SND_SOC_INTEL_HDA_DSP_COMMON
+	select SND_SOC_INTEL_SOF_MAXIM_COMMON
 	help
 	   This adds support for ASoC machine driver for SOF platforms
 	   with rt5682 codec.
@@ -579,6 +583,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
 	select SND_SOC_RT5682_SDW
 	select SND_SOC_DMIC
 	select SND_SOC_INTEL_HDA_DSP_COMMON
+	select SND_SOC_INTEL_SOF_MAXIM_COMMON
 	help
 	  Add support for Intel SoundWire-based platforms connected to
 	  MAX98373, RT700, RT711, RT1308 and RT715
sound/soc/intel/boards/Makefile +4 -2
index a48ee9b74e73..855296e8dfb8 100644
@@ -19,7 +19,7 @@ snd-soc-sst-byt-cht-cx2072x-objs := bytcht_cx2072x.o
 snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o
 snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o
 snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
-snd-soc-sof_rt5682-objs := sof_rt5682.o sof_maxim_common.o sof_realtek_common.o
+snd-soc-sof_rt5682-objs := sof_rt5682.o sof_realtek_common.o
 snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o
 snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o
 snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o
@@ -38,7 +38,6 @@ snd-soc-sof-sdw-objs += sof_sdw.o				\
 			sof_sdw_rt5682.o sof_sdw_rt700.o	\
 			sof_sdw_rt711.o sof_sdw_rt711_sdca.o 	\
 			sof_sdw_rt715.o	sof_sdw_rt715_sdca.o 	\
-			sof_maxim_common.o                      \
 			sof_sdw_dmic.o sof_sdw_hdmi.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
 obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
@@ -78,3 +77,6 @@ obj-$(CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH) += snd-soc-sof-sdw.o
 # common modules
 snd-soc-intel-hda-dsp-common-objs := hda_dsp_common.o
 obj-$(CONFIG_SND_SOC_INTEL_HDA_DSP_COMMON) += snd-soc-intel-hda-dsp-common.o
+
+snd-soc-intel-sof-maxim-common-objs += sof_maxim_common.o
+obj-$(CONFIG_SND_SOC_INTEL_SOF_MAXIM_COMMON) += snd-soc-intel-sof-maxim-common.o
sound/soc/intel/boards/sof_maxim_common.c +17 -7
index 437d20562753..7c4af6ec58e8 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 //
 // Copyright(c) 2020 Intel Corporation. All rights reserved.
+#include <linux/module.h>
 #include <linux/string.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
@@ -16,6 +17,7 @@ const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
 	{ "Left Spk", NULL, "Left BE_OUT" },
 	{ "Right Spk", NULL, "Right BE_OUT" },
 };
+EXPORT_SYMBOL_NS(max_98373_dapm_routes, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
 static struct snd_soc_codec_conf max_98373_codec_conf[] = {
 	{
@@ -38,9 +40,10 @@ struct snd_soc_dai_link_component max_98373_components[] = {
 		.dai_name = MAX_98373_CODEC_DAI,
 	},
 };
+EXPORT_SYMBOL_NS(max_98373_components, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
-static int max98373_hw_params(struct snd_pcm_substream *substream,
-			      struct snd_pcm_hw_params *params)
+static int max_98373_hw_params(struct snd_pcm_substream *substream,
+			       struct snd_pcm_hw_params *params)
 {
 	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_soc_dai *codec_dai;
@@ -59,7 +62,7 @@ static int max98373_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-int max98373_trigger(struct snd_pcm_substream *substream, int cmd)
+int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
 {
 	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_soc_dai *codec_dai;
@@ -102,13 +105,15 @@ int max98373_trigger(struct snd_pcm_substream *substream, int cmd)
 
 	return ret;
 }
+EXPORT_SYMBOL_NS(max_98373_trigger, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
 struct snd_soc_ops max_98373_ops = {
-	.hw_params = max98373_hw_params,
-	.trigger = max98373_trigger,
+	.hw_params = max_98373_hw_params,
+	.trigger = max_98373_trigger,
 };
+EXPORT_SYMBOL_NS(max_98373_ops, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
-int max98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
+int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	int ret;
@@ -119,9 +124,14 @@ int max98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
 		dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
 	return ret;
 }
+EXPORT_SYMBOL_NS(max_98373_spk_codec_init, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
-void sof_max98373_codec_conf(struct snd_soc_card *card)
+void max_98373_set_codec_conf(struct snd_soc_card *card)
 {
 	card->codec_conf = max_98373_codec_conf;
 	card->num_configs = ARRAY_SIZE(max_98373_codec_conf);
 }
+EXPORT_SYMBOL_NS(max_98373_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
+
+MODULE_DESCRIPTION("ASoC Intel SOF Maxim helpers");
+MODULE_LICENSE("GPL");
sound/soc/intel/boards/sof_maxim_common.h +3 -3
index 5240b1c9d379..566a664d5a63 100644
@@ -20,8 +20,8 @@ extern struct snd_soc_dai_link_component max_98373_components[2];
 extern struct snd_soc_ops max_98373_ops;
 extern const struct snd_soc_dapm_route max_98373_dapm_routes[];
 
-int max98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd);
-void sof_max98373_codec_conf(struct snd_soc_card *card);
-int max98373_trigger(struct snd_pcm_substream *substream, int cmd);
+int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd);
+void max_98373_set_codec_conf(struct snd_soc_card *card);
+int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
 
 #endif /* __SOF_MAXIM_COMMON_H */
sound/soc/intel/boards/sof_rt5682.c +3 -2
index 52401cc0de92..78262c659983 100644
@@ -742,7 +742,7 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 				SOF_MAX98373_SPEAKER_AMP_PRESENT) {
 			links[id].codecs = max_98373_components;
 			links[id].num_codecs = ARRAY_SIZE(max_98373_components);
-			links[id].init = max98373_spk_codec_init;
+			links[id].init = max_98373_spk_codec_init;
 			links[id].ops = &max_98373_ops;
 			/* feedback stream */
 			links[id].dpcm_capture = 1;
@@ -863,7 +863,7 @@ static int sof_audio_probe(struct platform_device *pdev)
 		sof_audio_card_rt5682.num_links++;
 
 	if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT)
-		sof_max98373_codec_conf(&sof_audio_card_rt5682);
+		max_98373_set_codec_conf(&sof_audio_card_rt5682);
 	else if (sof_rt5682_quirk & SOF_RT1011_SPEAKER_AMP_PRESENT)
 		sof_rt1011_codec_conf(&sof_audio_card_rt5682);
 	else if (sof_rt5682_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT)
@@ -995,3 +995,4 @@ MODULE_ALIAS("platform:cml_rt1015_rt5682");
 MODULE_ALIAS("platform:tgl_rt1011_rt5682");
 MODULE_ALIAS("platform:jsl_rt5682_rt1015p");
 MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
+MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON);
sound/soc/intel/boards/sof_sdw.c +1 -0
index 5e4d26e9bb7d..3ca7e1ab48ab 100644
@@ -1319,3 +1319,4 @@ MODULE_AUTHOR("Pierre-Louis Bossart <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:sof_sdw");
 MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
+MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON);
sound/soc/intel/boards/sof_sdw_max98373.c +2 -2
index cfdf970c5800..0e7ed906b341 100644
@@ -64,7 +64,7 @@ static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd)
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		/* enable max98373 first */
-		ret = max98373_trigger(substream, cmd);
+		ret = max_98373_trigger(substream, cmd);
 		if (ret < 0)
 			break;
 
@@ -77,7 +77,7 @@ static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd)
 		if (ret < 0)
 			break;
 
-		ret = max98373_trigger(substream, cmd);
+		ret = max_98373_trigger(substream, cmd);
 		break;
 	default:
 		ret = -EINVAL;
Signature · 1 line
2.30.2
author maintainer
#13 lore raw

PATCH 11/35 ASoC: Intel: boards: handle hda-dsp-common as a module

In reply to Greg Kroah-Hartman

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

hda-dsp-common.o is linked multiple times due to copy/paste and inertia. Move to a dedicated module with a namespace.

---
 sound/soc/intel/boards/Kconfig                | 13 ++++++++++
 sound/soc/intel/boards/Makefile               | 24 +++++++++++--------
 sound/soc/intel/boards/bxt_da7219_max98357a.c |  1 +
 sound/soc/intel/boards/bxt_rt298.c            |  1 +
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |  1 +
 sound/soc/intel/boards/ehl_rt5660.c           |  1 +
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  1 +
 sound/soc/intel/boards/hda_dsp_common.c       |  5 ++++
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |  1 +
 sound/soc/intel/boards/sof_da7219_max98373.c  |  1 +
 sound/soc/intel/boards/sof_pcm512x.c          |  1 +
 sound/soc/intel/boards/sof_rt5682.c           |  1 +
 sound/soc/intel/boards/sof_sdw.c              |  1 +
 13 files changed, 42 insertions(+), 10 deletions(-)
sound/soc/intel/boards/Kconfig +13 -0
index 58379393b8e4..ec4d754eb348 100644
@@ -26,6 +26,9 @@ config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
 	  interface.
 	  If unsure select N.
 
+config SND_SOC_INTEL_HDA_DSP_COMMON
+	tristate
+
 if SND_SOC_INTEL_CATPT
 
 config SND_SOC_INTEL_HASWELL_MACH
@@ -278,6 +281,7 @@ config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
 	select SND_SOC_MAX98390
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 
 config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
 	tristate
@@ -304,6 +308,7 @@ config SND_SOC_INTEL_BXT_RT298_MACH
 	select SND_SOC_RT298
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	   This adds support for ASoC machine driver for Broxton platforms
 	   with RT286 I2S audio codec.
@@ -422,6 +427,7 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH
 	select SND_SOC_MAX98357A
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	   This adds support for ASoC machine driver for Geminilake platforms
 	   with RT5682 + MAX98357A I2S audio codec.
@@ -437,6 +443,7 @@ config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
 	depends on SND_HDA_CODEC_HDMI
 	depends on GPIOLIB
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	select SND_SOC_DMIC
 	# SND_SOC_HDAC_HDA is already selected
 	help
@@ -461,6 +468,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH
 	select SND_SOC_RT5682_I2C
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	   This adds support for ASoC machine driver for SOF platforms
 	   with rt5682 codec.
@@ -473,6 +481,7 @@ config SND_SOC_INTEL_SOF_PCM512x_MACH
 	depends on (SND_SOC_SOF_HDA_AUDIO_CODEC && (MFD_INTEL_LPSS || COMPILE_TEST)) ||\
 		   (SND_SOC_SOF_BAYTRAIL && (X86_INTEL_LPSS || COMPILE_TEST))
 	depends on SND_HDA_CODEC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	select SND_SOC_PCM512x_I2C
 	help
 	  This adds support for ASoC machine driver for SOF platforms
@@ -504,6 +513,7 @@ config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH
 	select SND_SOC_RT5682_I2C
 	select SND_SOC_DMIC
 	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	  This adds support for ASoC machine driver for SOF platform with
 	  RT1011 + RT5682 I2S codec.
@@ -519,6 +529,7 @@ config SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH
 	depends on I2C && ACPI && GPIOLIB
 	depends on MFD_INTEL_LPSS || COMPILE_TEST
 	depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	select SND_SOC_DA7219
 	select SND_SOC_MAX98373_I2C
 	select SND_SOC_DMIC
@@ -539,6 +550,7 @@ config SND_SOC_INTEL_EHL_RT5660_MACH
 	depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
 	select SND_SOC_RT5660
 	select SND_SOC_DMIC
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	  This adds support for ASoC machine driver for Elkhart Lake
 	  platform with RT5660 I2S audio codec.
@@ -566,6 +578,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
 	select SND_SOC_RT715_SDCA_SDW
 	select SND_SOC_RT5682_SDW
 	select SND_SOC_DMIC
+	select SND_SOC_INTEL_HDA_DSP_COMMON
 	help
 	  Add support for Intel SoundWire-based platforms connected to
 	  MAX98373, RT700, RT711, RT1308 and RT715
sound/soc/intel/boards/Makefile +14 -10
index 616c5fbab7d5..a48ee9b74e73 100644
@@ -3,11 +3,11 @@ snd-soc-sst-haswell-objs := haswell.o
 snd-soc-sst-bdw-rt5650-mach-objs := bdw-rt5650.o
 snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o
 snd-soc-sst-broadwell-objs := broadwell.o
-snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o hda_dsp_common.o
-snd-soc-sst-bxt-rt298-objs := bxt_rt298.o hda_dsp_common.o
-snd-soc-sst-sof-pcm512x-objs := sof_pcm512x.o hda_dsp_common.o
+snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o
+snd-soc-sst-bxt-rt298-objs := bxt_rt298.o
+snd-soc-sst-sof-pcm512x-objs := sof_pcm512x.o
 snd-soc-sst-sof-wm8804-objs := sof_wm8804.o
-snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o hda_dsp_common.o
+snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o
 snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o
 snd-soc-sst-bytcr-rt5651-objs := bytcr_rt5651.o
 snd-soc-sst-bytcr-wm5102-objs := bytcr_wm5102.o
@@ -19,19 +19,19 @@ snd-soc-sst-byt-cht-cx2072x-objs := bytcht_cx2072x.o
 snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o
 snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o
 snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
-snd-soc-sof_rt5682-objs := sof_rt5682.o hda_dsp_common.o sof_maxim_common.o sof_realtek_common.o
-snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o hda_dsp_common.o
+snd-soc-sof_rt5682-objs := sof_rt5682.o sof_maxim_common.o sof_realtek_common.o
+snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o
 snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o
 snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o
 snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o
 snd-soc-kbl_rt5663_rt5514_max98927-objs := kbl_rt5663_rt5514_max98927.o
 snd-soc-kbl_rt5660-objs := kbl_rt5660.o
 snd-soc-skl_rt286-objs := skl_rt286.o
-snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_common.o
+snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o
 snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o
 snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o
-snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o hda_dsp_common.o
-snd-soc-ehl-rt5660-objs := ehl_rt5660.o hda_dsp_common.o
+snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o
+snd-soc-ehl-rt5660-objs := ehl_rt5660.o
 snd-soc-sof-sdw-objs += sof_sdw.o				\
 			sof_sdw_max98373.o			\
 			sof_sdw_rt1308.o sof_sdw_rt1316.o	\
@@ -39,7 +39,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o				\
 			sof_sdw_rt711.o sof_sdw_rt711_sdca.o 	\
 			sof_sdw_rt715.o	sof_sdw_rt715_sdca.o 	\
 			sof_maxim_common.o                      \
-			sof_sdw_dmic.o sof_sdw_hdmi.o hda_dsp_common.o
+			sof_sdw_dmic.o sof_sdw_hdmi.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
 obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
 obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON) += snd-soc-sst-bxt-da7219_max98357a.o
@@ -74,3 +74,7 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o
 obj-$(CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH) += snd-soc-ehl-rt5660.o
 obj-$(CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH) += snd-soc-sof-sdw.o
+
+# common modules
+snd-soc-intel-hda-dsp-common-objs := hda_dsp_common.o
+obj-$(CONFIG_SND_SOC_INTEL_HDA_DSP_COMMON) += snd-soc-intel-hda-dsp-common.o
sound/soc/intel/boards/bxt_da7219_max98357a.c +1 -0
index 9ffef396f8f2..07ae950b0127 100644
@@ -869,3 +869,4 @@ MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:bxt_da7219_max98357a");
 MODULE_ALIAS("platform:glk_da7219_max98357a");
 MODULE_ALIAS("platform:cml_da7219_max98357a");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/bxt_rt298.c +1 -0
index 0f3157dfa838..32a776fa0b86 100644
@@ -667,3 +667,4 @@ MODULE_DESCRIPTION("Intel SST Audio for Broxton");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:bxt_alc298s_i2s");
 MODULE_ALIAS("platform:glk_alc298s_i2s");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/cml_rt1011_rt5682.c +1 -0
index 14813beb33d1..27615acddacd 100644
@@ -594,3 +594,4 @@ MODULE_AUTHOR("Shuming Fan <[email protected]>");
 MODULE_AUTHOR("Mac Chiang <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:cml_rt1011_rt5682");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/ehl_rt5660.c +1 -0
index 7c0d4e915406..b9b72d05b335 100644
@@ -321,3 +321,4 @@ MODULE_DESCRIPTION("ASoC Intel(R) Elkhartlake + rt5660 Machine driver");
 MODULE_AUTHOR("[email protected]");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:ehl_rt5660");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/glk_rt5682_max98357a.c +1 -0
index 62cca511522e..19e2ff90886a 100644
@@ -642,3 +642,4 @@ MODULE_AUTHOR("Naveen Manohar <[email protected]>");
 MODULE_AUTHOR("Harsha Priya <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:glk_rt5682_max98357a");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/hda_dsp_common.c +5 -0
index 91ad2a0ad1ce..efdc4bc4bb1f 100644
@@ -2,6 +2,7 @@
 //
 // Copyright(c) 2019 Intel Corporation. All rights reserved.
 
+#include <linux/module.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
 #include <sound/hda_codec.h>
@@ -82,5 +83,9 @@ int hda_dsp_hdmi_build_controls(struct snd_soc_card *card,
 
 	return err;
 }
+EXPORT_SYMBOL_NS(hda_dsp_hdmi_build_controls, SND_SOC_INTEL_HDA_DSP_COMMON);
 
 #endif
+
+MODULE_DESCRIPTION("ASoC Intel HDMI helpers");
+MODULE_LICENSE("GPL");
sound/soc/intel/boards/skl_hda_dsp_generic.c +1 -0
index bc50eda297ab..f4b4eeca3e03 100644
@@ -258,3 +258,4 @@ MODULE_DESCRIPTION("SKL/KBL/BXT/APL HDA Generic Machine driver");
 MODULE_AUTHOR("Rakesh Ughreja <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:skl_hda_dsp_generic");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/sof_da7219_max98373.c +1 -0
index 8d1ad892e86b..2116d70d1ea8 100644
@@ -458,3 +458,4 @@ MODULE_AUTHOR("Yong Zhi <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:sof_da7219_max98360a");
 MODULE_ALIAS("platform:sof_da7219_max98373");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/sof_pcm512x.c +1 -0
index d2b0456236c7..8620d4f38493 100644
@@ -437,3 +437,4 @@ MODULE_DESCRIPTION("ASoC Intel(R) SOF + PCM512x Machine driver");
 MODULE_AUTHOR("Pierre-Louis Bossart");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:sof_pcm512x");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/sof_rt5682.c +1 -0
index cf1d053733e2..52401cc0de92 100644
@@ -994,3 +994,4 @@ MODULE_ALIAS("platform:jsl_rt5682_max98360a");
 MODULE_ALIAS("platform:cml_rt1015_rt5682");
 MODULE_ALIAS("platform:tgl_rt1011_rt5682");
 MODULE_ALIAS("platform:jsl_rt5682_rt1015p");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
sound/soc/intel/boards/sof_sdw.c +1 -0
index 5827a16773c9..5e4d26e9bb7d 100644
@@ -1318,3 +1318,4 @@ MODULE_AUTHOR("Rander Wang <[email protected]>");
 MODULE_AUTHOR("Pierre-Louis Bossart <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:sof_sdw");
+MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
Signature · 1 line
2.30.2
author maintainer
#15 lore raw

PATCH 13/35 ASoC: Intel: boards: fix xrun issue on platform with max98373

In reply to Greg Kroah-Hartman

From: Rander Wang <[email protected]>

[ Upstream commit 33c8516841ea4fa12fdb8961711bf95095c607ee ]

On TGL platform with max98373 codec the trigger start sequence is fe first, then codec component and sdw link is the last. Recently a delay was introduced in max98373 codec driver and this resulted to the start of sdw stream transmission was delayed and the data transmitted by fw can't be consumed by sdw controller, so xrun happened.

Adding delay in trigger function is a bad idea. This patch enable spk pin in prepare function and disable it in hw_free to avoid xrun issue caused by delay in trigger.

---
 sound/soc/intel/boards/sof_sdw_max98373.c | 81 +++++++++++++++--------
 1 file changed, 53 insertions(+), 28 deletions(-)
sound/soc/intel/boards/sof_sdw_max98373.c +53 -28
index 0e7ed906b341..25daef910aee 100644
@@ -55,43 +55,68 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd)
 	return ret;
 }
 
-static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd)
+static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enable)
 {
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+	struct snd_soc_dai *codec_dai;
+	struct snd_soc_dai *cpu_dai;
 	int ret;
+	int j;
 
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		/* enable max98373 first */
-		ret = max_98373_trigger(substream, cmd);
-		if (ret < 0)
-			break;
-
-		ret = sdw_trigger(substream, cmd);
-		break;
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		ret = sdw_trigger(substream, cmd);
-		if (ret < 0)
-			break;
-
-		ret = max_98373_trigger(substream, cmd);
-		break;
-	default:
-		ret = -EINVAL;
-		break;
+	/* set spk pin by playback only */
+	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		return 0;
+
+	cpu_dai = asoc_rtd_to_cpu(rtd, 0);
+	for_each_rtd_codec_dais(rtd, j, codec_dai) {
+		struct snd_soc_dapm_context *dapm =
+				snd_soc_component_get_dapm(cpu_dai->component);
+		char pin_name[16];
+
+		snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
+			 codec_dai->component->name_prefix);
+
+		if (enable)
+			ret = snd_soc_dapm_enable_pin(dapm, pin_name);
+		else
+			ret = snd_soc_dapm_disable_pin(dapm, pin_name);
+
+		if (!ret)
+			snd_soc_dapm_sync(dapm);
 	}
 
-	return ret;
+	return 0;
+}
+
+static int mx8373_sdw_prepare(struct snd_pcm_substream *substream)
+{
+	int ret = 0;
+
+	/* according to soc_pcm_prepare dai link prepare is called first */
+	ret = sdw_prepare(substream);
+	if (ret < 0)
+		return ret;
+
+	return mx8373_enable_spk_pin(substream, true);
+}
+
+static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream)
+{
+	int ret = 0;
+
+	/* according to soc_pcm_hw_free dai link free is called first */
+	ret = sdw_hw_free(substream);
+	if (ret < 0)
+		return ret;
+
+	return mx8373_enable_spk_pin(substream, false);
 }
 
 static const struct snd_soc_ops max_98373_sdw_ops = {
 	.startup = sdw_startup,
-	.prepare = sdw_prepare,
-	.trigger = max98373_sdw_trigger,
-	.hw_free = sdw_hw_free,
+	.prepare = mx8373_sdw_prepare,
+	.trigger = sdw_trigger,
+	.hw_free = mx8373_sdw_hw_free,
 	.shutdown = sdw_shutdown,
 };
 
Signature · 1 line
2.30.2
author maintainer
#16 lore raw

PATCH 14/35 regulator: rtmv20: Fix wrong mask for strobe-polarity-high

In reply to Greg Kroah-Hartman

From: ChiYuan Huang <[email protected]>

[ Upstream commit 2b6a761be079f9fa8abf3157b5679a6f38885db4 ]

Fix wrong mask for strobe-polarity-high.

In-reply-to: <CAFRkauB=0KwrJW19nJTTagdHhBR=V2R8YFWG3R3oVXt=rBRsqw@mail.gmail.com>

---
 drivers/regulator/rtmv20-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/rtmv20-regulator.c +1 -1
index 4bca64de0f67..2ee334174e2b 100644
@@ -37,7 +37,7 @@
 #define RTMV20_WIDTH2_MASK	GENMASK(7, 0)
 #define RTMV20_LBPLVL_MASK	GENMASK(3, 0)
 #define RTMV20_LBPEN_MASK	BIT(7)
-#define RTMV20_STROBEPOL_MASK	BIT(1)
+#define RTMV20_STROBEPOL_MASK	BIT(0)
 #define RTMV20_VSYNPOL_MASK	BIT(1)
 #define RTMV20_FSINEN_MASK	BIT(7)
 #define RTMV20_ESEN_MASK	BIT(6)
Signature · 1 line
2.30.2
author maintainer
#17 lore raw

PATCH 15/35 regulator: rt5033: Fix n_voltages settings for BUCK and LDO

In reply to Greg Kroah-Hartman

From: Axel Lin <[email protected]>

[ Upstream commit 6549c46af8551b346bcc0b9043f93848319acd5c ]

For linear regulators, the n_voltages should be (max - min) / step + 1.

Buck voltage from 1v to 3V, per step 100mV, and vout mask is 0x1f. If value is from 20 to 31, the voltage will all be fixed to 3V. And LDO also, just vout range is different from 1.2v to 3v, step is the same. If value is from 18 to 31, the voltage will also be fixed to 3v.

---
 include/linux/mfd/rt5033-private.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/mfd/rt5033-private.h +2 -2
index 2d1895c3efbf..40a0c2dfb80f 100644
@@ -200,13 +200,13 @@ enum rt5033_reg {
 #define RT5033_REGULATOR_BUCK_VOLTAGE_MIN		1000000U
 #define RT5033_REGULATOR_BUCK_VOLTAGE_MAX		3000000U
 #define RT5033_REGULATOR_BUCK_VOLTAGE_STEP		100000U
-#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM		32
+#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM		21
 
 /* RT5033 regulator LDO output voltage uV */
 #define RT5033_REGULATOR_LDO_VOLTAGE_MIN		1200000U
 #define RT5033_REGULATOR_LDO_VOLTAGE_MAX		3000000U
 #define RT5033_REGULATOR_LDO_VOLTAGE_STEP		100000U
-#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM		32
+#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM		19
 
 /* RT5033 regulator SAFE LDO output voltage uV */
 #define RT5033_REGULATOR_SAFE_LDO_VOLTAGE		4900000U
Signature · 1 line
2.30.2
author maintainer
#18 lore raw

PATCH 16/35 spi: stm32h7: fix full duplex irq handler handling

In reply to Greg Kroah-Hartman

From: Alain Volmat <[email protected]>

[ Upstream commit e4a5c19888a5f8a9390860ca493e643be58c8791 ]

In case of Full-Duplex mode, DXP flag is set when RXP and TXP flags are set. But to avoid 2 different handlings, just add TXP and RXP flag in the mask instead of DXP, and then keep the initial handling of TXP and RXP events.
Also rephrase comment about EOTIE which is one of the interrupt enable bits. It is not triggered by any event.

---
 drivers/spi/spi-stm32.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/spi/spi-stm32.c +9 -6
index a92a28933edb..05618a618939 100644
@@ -884,15 +884,18 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
 	ier = readl_relaxed(spi->base + STM32H7_SPI_IER);
 
 	mask = ier;
-	/* EOTIE is triggered on EOT, SUSP and TXC events. */
+	/*
+	 * EOTIE enables irq from EOT, SUSP and TXC events. We need to set
+	 * SUSP to acknowledge it later. TXC is automatically cleared
+	 */
+
 	mask |= STM32H7_SPI_SR_SUSP;
 	/*
-	 * When TXTF is set, DXPIE and TXPIE are cleared. So in case of
-	 * Full-Duplex, need to poll RXP event to know if there are remaining
-	 * data, before disabling SPI.
+	 * DXPIE is set in Full-Duplex, one IT will be raised if TXP and RXP
+	 * are set. So in case of Full-Duplex, need to poll TXP and RXP event.
 	 */
-	if (spi->rx_buf && !spi->cur_usedma)
-		mask |= STM32H7_SPI_SR_RXP;
+	if ((spi->cur_comm == SPI_FULL_DUPLEX) && !spi->cur_usedma)
+		mask |= STM32H7_SPI_SR_TXP | STM32H7_SPI_SR_RXP;
 
 	if (!(sr & mask)) {
 		dev_warn(spi->dev, "spurious IT (sr=0x%08x, ier=0x%08x)\n",
Signature · 1 line
2.30.2
author maintainer
#19 lore raw

PATCH 17/35 ASoC: tlv320aic31xx: fix reversed bclk/wclk master bits

In reply to Greg Kroah-Hartman

From: Kyle Russell <[email protected]>

[ Upstream commit 9cf76a72af6ab81030dea6481b1d7bdd814fbdaf ]

These are backwards from Table 7-71 of the TLV320AIC3100 spec [1].

This was broken in 12eb4d66ba2e when BCLK_MASTER and WCLK_MASTER were converted from 0x08 and 0x04 to BIT(2) and BIT(3), respectively.

-#define AIC31XX_BCLK_MASTER 0x08
-#define AIC31XX_WCLK_MASTER 0x04
+#define AIC31XX_BCLK_MASTER BIT(2)
+#define AIC31XX_WCLK_MASTER BIT(3)

Probably just a typo since the defines were not listed in bit order.

[1] https://www.ti.com/lit/gpn/tlv320aic3100

---
 sound/soc/codecs/tlv320aic31xx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tlv320aic31xx.h +2 -2
index 81952984613d..2513922a0292 100644
@@ -151,8 +151,8 @@ struct aic31xx_pdata {
 #define AIC31XX_WORD_LEN_24BITS		0x02
 #define AIC31XX_WORD_LEN_32BITS		0x03
 #define AIC31XX_IFACE1_MASTER_MASK	GENMASK(3, 2)
-#define AIC31XX_BCLK_MASTER		BIT(2)
-#define AIC31XX_WCLK_MASTER		BIT(3)
+#define AIC31XX_BCLK_MASTER		BIT(3)
+#define AIC31XX_WCLK_MASTER		BIT(2)
 
 /* AIC31XX_DATA_OFFSET */
 #define AIC31XX_DATA_OFFSET_MASK	GENMASK(7, 0)
Signature · 1 line
2.30.2
author maintainer
#20 lore raw

PATCH 18/35 regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register

In reply to Greg Kroah-Hartman

From: Axel Lin <[email protected]>

[ Upstream commit ea986908ccfcc53204a03bb0841227e1b26578c4 ]

If use dev->parent, the regulator_unregister will not be called when this driver is unloaded. Fix it by using dev instead.

---
 drivers/regulator/mtk-dvfsrc-regulator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/regulator/mtk-dvfsrc-regulator.c +1 -2
index d3d876198d6e..234af3a66c77 100644
@@ -179,8 +179,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev)
 	for (i = 0; i < regulator_init_data->size; i++) {
 		config.dev = dev->parent;
 		config.driver_data = (mt_regulators + i);
-		rdev = devm_regulator_register(dev->parent,
-					       &(mt_regulators + i)->desc,
+		rdev = devm_regulator_register(dev, &(mt_regulators + i)->desc,
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(dev, "failed to register %s\n",
Signature · 1 line
2.30.2
author maintainer
#21 lore raw

PATCH 19/35 r8152: Fix potential PM refcount imbalance

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

[ Upstream commit 9c23aa51477a37f8b56c3c40192248db0663c196 ]

rtl8152_close() takes the refcount via usb_autopm_get_interface() but it doesn't release when RTL8152_UNPLUG test hits. This may lead to the imbalance of PM refcount. This patch addresses it.

---
 drivers/net/usb/r8152.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/r8152.c +2 -1
index e25bfb7021ed..8dcc55e4a5bc 100644
@@ -6761,9 +6761,10 @@ static int rtl8152_close(struct net_device *netdev)
 		tp->rtl_ops.down(tp);
 
 		mutex_unlock(&tp->control);
+	}
 
+	if (!res)
 		usb_autopm_put_interface(tp->intf);
-	}
 
 	free_all_mem(tp);
 
Signature · 1 line
2.30.2
author maintainer
#2 lore raw

PATCH 2/35 Revert "drm/i915: Propagate errors on awaiting already signaled fences"

In reply to Greg Kroah-Hartman

From: Jason Ekstrand <[email protected]>

commit 3761baae908a7b5012be08d70fa553cc2eb82305 upstream.

This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7. Ever since that commit, we've been having issues where a hang in one client can propagate to another. In particular, a hang in an app can propagate to the X server which causes the whole desktop to lock up.

Error propagation along fences sound like a good idea, but as your bug shows, surprising consequences, since propagating errors across security boundaries is not a good thing.

What we do have is track the hangs on the ctx, and report information to userspace using RESET_STATS. That's how arb_robustness works. Also, if my understanding is still correct, the EIO from execbuf is when your context is banned (because not recoverable or too many hangs). And in all these cases it's up to userspace to figure out what is all impacted and should be reported to the application, that's not on the kernel to guess and automatically propagate.

What's more, we're also building more features on top of ctx error reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the userspace fence wait also relies on that mechanism. So it is the path going forward for reporting gpu hangs and resets to userspace.

So all together that's why I think we should just bury this idea again as not quite the direction we want to go to, hence why I think the revert is the right option here.

For backporters: Please note that you _must_ have a backport of
https://lore.kernel.org/dri-devel/[email protected]/
for otherwise backporting just this patch opens up a security bug.

v2: Augment commit message. Also restore Jason's sob that I accidentally lost.

v3: Add a note for backporters

Cc <[email protected]> # v5.6+
Cc Jason Ekstrand <[email protected]>
Cc Marcin Slusarz <[email protected]>
Fixes 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences")
(cherry picked from commit 93a2711cddd5760e2f0f901817d71c93183c3b87)
---
 drivers/gpu/drm/i915/i915_request.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_request.c +2 -6
index bec9c3652188..59d48a6a83d2 100644
@@ -1426,10 +1426,8 @@ i915_request_await_execution(struct i915_request *rq,
 
 	do {
 		fence = *child++;
-		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
-			i915_sw_fence_set_error_once(&rq->submit, fence->error);
+		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
 			continue;
-		}
 
 		if (fence->context == rq->fence.context)
 			continue;
@@ -1527,10 +1525,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence)
 
 	do {
 		fence = *child++;
-		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
-			i915_sw_fence_set_error_once(&rq->submit, fence->error);
+		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
 			continue;
-		}
 
 		/*
 		 * Requests on the same timeline are explicitly ordered, along
Signature · 1 line
2.30.2
author maintainer
#22 lore raw

PATCH 20/35 r8152: Fix a deadlock by doubly PM resume

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

[ Upstream commit 776ac63a986d211286230c4fd70f85390eabedcd ]

r8152 driver sets up the MAC address at reset-resume, while rtl8152_set_mac_address() has the temporary autopm get/put. This may lead to a deadlock as the PM lock has been already taken for the execution of the runtime PM callback.

This patch adds the workaround to avoid the superfluous autpm when called from rtl8152_reset_resume().

---
 drivers/net/usb/r8152.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/net/usb/r8152.c +18 -9
index 8dcc55e4a5bc..2cf763b4ea84 100644
@@ -1550,7 +1550,8 @@ static int
 rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u32 speed, u8 duplex,
 		  u32 advertising);
 
-static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
+static int __rtl8152_set_mac_address(struct net_device *netdev, void *p,
+				     bool in_resume)
 {
 	struct r8152 *tp = netdev_priv(netdev);
 	struct sockaddr *addr = p;
@@ -1559,9 +1560,11 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
 	if (!is_valid_ether_addr(addr->sa_data))
 		goto out1;
 
-	ret = usb_autopm_get_interface(tp->intf);
-	if (ret < 0)
-		goto out1;
+	if (!in_resume) {
+		ret = usb_autopm_get_interface(tp->intf);
+		if (ret < 0)
+			goto out1;
+	}
 
 	mutex_lock(&tp->control);
 
@@ -1573,11 +1576,17 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
 
 	mutex_unlock(&tp->control);
 
-	usb_autopm_put_interface(tp->intf);
+	if (!in_resume)
+		usb_autopm_put_interface(tp->intf);
 out1:
 	return ret;
 }
 
+static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
+{
+	return __rtl8152_set_mac_address(netdev, p, false);
+}
+
 /* Devices containing proper chips can support a persistent
  * host system provided MAC address.
  * Examples of this are Dell TB15 and Dell WD15 docks
@@ -1696,7 +1705,7 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
 	return ret;
 }
 
-static int set_ethernet_addr(struct r8152 *tp)
+static int set_ethernet_addr(struct r8152 *tp, bool in_resume)
 {
 	struct net_device *dev = tp->netdev;
 	struct sockaddr sa;
@@ -1709,7 +1718,7 @@ static int set_ethernet_addr(struct r8152 *tp)
 	if (tp->version == RTL_VER_01)
 		ether_addr_copy(dev->dev_addr, sa.sa_data);
 	else
-		ret = rtl8152_set_mac_address(dev, &sa);
+		ret = __rtl8152_set_mac_address(dev, &sa, in_resume);
 
 	return ret;
 }
@@ -8442,7 +8451,7 @@ static int rtl8152_reset_resume(struct usb_interface *intf)
 	clear_bit(SELECTIVE_SUSPEND, &tp->flags);
 	tp->rtl_ops.init(tp);
 	queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
-	set_ethernet_addr(tp);
+	set_ethernet_addr(tp, true);
 	return rtl8152_resume(intf);
 }
 
@@ -9562,7 +9571,7 @@ static int rtl8152_probe(struct usb_interface *intf,
 	tp->rtl_fw.retry = true;
 #endif
 	queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
-	set_ethernet_addr(tp);
+	set_ethernet_addr(tp, false);
 
 	usb_set_intfdata(intf, tp);
 
Signature · 1 line
2.30.2
author maintainer
#23 lore raw

PATCH 21/35 qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()

In reply to Greg Kroah-Hartman

From: Jia He <[email protected]>

[ Upstream commit 6206b7981a36476f4695d661ae139f7db36a802d ]

Liajian reported a bug_on hit on a ThunderX2 arm64 server with FastLinQ QL41000 ethernet controller:

 BUG: scheduling while atomic: kworker/0:4/531/0x00000200
  [qed_probe:488()]hw prepare failed
  kernel BUG at mm/vmalloc.c:2355!
  Internal error: Oops - BUG: 0 [#1] SMP
  CPU: 0 PID: 531 Comm: kworker/0:4 Tainted: G W 5.4.0-77-generic #86-Ubuntu
  pstate: 00400009 (nzcv daif +PAN -UAO)
 Call trace:
  vunmap+0x4c/0x50
  iounmap+0x48/0x58
  qed_free_pci+0x60/0x80 [qed]
  qed_probe+0x35c/0x688 [qed]
  __qede_probe+0x88/0x5c8 [qede]
  qede_probe+0x60/0xe0 [qede]
  local_pci_probe+0x48/0xa0
  work_for_cpu_fn+0x24/0x38
  process_one_work+0x1d0/0x468
  worker_thread+0x238/0x4e0
  kthread+0xf0/0x118
  ret_from_fork+0x10/0x18

In this case, qed_hw_prepare() returns error due to hw/fw error, but in theory work queue should be in process context instead of interrupt.

The root cause might be the unpaired spin_{un}lock_bh() in _qed_mcp_cmd_and_union(), which causes botton half is disabled incorrectly.

---
 drivers/net/ethernet/qlogic/qed/qed_mcp.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_mcp.c +17 -6
index cd882c453394..caeef25c89bb 100644
@@ -474,14 +474,18 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
 
 		spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
 
-		if (!qed_mcp_has_pending_cmd(p_hwfn))
+		if (!qed_mcp_has_pending_cmd(p_hwfn)) {
+			spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 			break;
+		}
 
 		rc = qed_mcp_update_pending_cmd(p_hwfn, p_ptt);
-		if (!rc)
+		if (!rc) {
+			spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 			break;
-		else if (rc != -EAGAIN)
+		} else if (rc != -EAGAIN) {
 			goto err;
+		}
 
 		spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 
@@ -498,6 +502,8 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
 		return -EAGAIN;
 	}
 
+	spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
+
 	/* Send the mailbox command */
 	qed_mcp_reread_offsets(p_hwfn, p_ptt);
 	seq_num = ++p_hwfn->mcp_info->drv_mb_seq;
@@ -524,14 +530,18 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
 
 		spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
 
-		if (p_cmd_elem->b_is_completed)
+		if (p_cmd_elem->b_is_completed) {
+			spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 			break;
+		}
 
 		rc = qed_mcp_update_pending_cmd(p_hwfn, p_ptt);
-		if (!rc)
+		if (!rc) {
+			spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 			break;
-		else if (rc != -EAGAIN)
+		} else if (rc != -EAGAIN) {
 			goto err;
+		}
 
 		spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 	} while (++cnt < max_retries);
@@ -554,6 +564,7 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
 		return -EAGAIN;
 	}
 
+	spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
 	qed_mcp_cmd_del_elem(p_hwfn, p_cmd_elem);
 	spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
 
Signature · 1 line
2.30.2
author maintainer
#24 lore raw

PATCH 22/35 ASoC: rt5682: Fix the issue of garbled recording after powerd_dbus_suspend

In reply to Greg Kroah-Hartman

From: Oder Chiou <[email protected]>

[ Upstream commit 6a503e1c455316fd0bfd8188c0a62cce7c5525ca ]

While using the DMIC recording, the garbled data will be captured by the DMIC. It is caused by the critical power of PLL closed in the jack detect function.

---
 sound/soc/codecs/rt5682.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5682.c +6 -2
index e4c91571abae..abcd6f483788 100644
@@ -973,10 +973,14 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
 		rt5682_enable_push_button_irq(component, false);
 		snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
 			RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_LOW);
-		if (!snd_soc_dapm_get_pin_status(dapm, "MICBIAS"))
+		if (!snd_soc_dapm_get_pin_status(dapm, "MICBIAS") &&
+			!snd_soc_dapm_get_pin_status(dapm, "PLL1") &&
+			!snd_soc_dapm_get_pin_status(dapm, "PLL2B"))
 			snd_soc_component_update_bits(component,
 				RT5682_PWR_ANLG_1, RT5682_PWR_MB, 0);
-		if (!snd_soc_dapm_get_pin_status(dapm, "Vref2"))
+		if (!snd_soc_dapm_get_pin_status(dapm, "Vref2") &&
+			!snd_soc_dapm_get_pin_status(dapm, "PLL1") &&
+			!snd_soc_dapm_get_pin_status(dapm, "PLL2B"))
 			snd_soc_component_update_bits(component,
 				RT5682_PWR_ANLG_1, RT5682_PWR_VREF2, 0);
 		snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
Signature · 1 line
2.30.2
author maintainer
#25 lore raw

PATCH 23/35 net: Fix zero-copy head len calculation.

In reply to Greg Kroah-Hartman

From: Pravin B Shelar <[email protected]>

[ Upstream commit a17ad0961706244dce48ec941f7e476a38c0e727 ]

In some cases skb head could be locked and entire header data is pulled from skb. When skb_zerocopy() called in such cases, following BUG is triggered. This patch fixes it by copying entire skb in such cases.
This could be optimized incase this is performance bottleneck.

---8<---
kernel BUG at net/core/skbuff.c:2961!
invalid opcode: 0000 [#1] SMP PTI

CPU: 2 PID: 0 Comm: swapper/2 Tainted: G           OE     5.4.0-77-generic #86-Ubuntu
Hardware name: OpenStack Foundation OpenStack Nova, BIOS 1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:skb_zerocopy+0x37a/0x3a0
RSP: 0018:ffffbcc70013ca38 EFLAGS: 00010246
Call Trace:
 <IRQ>
 queue_userspace_packet+0x2af/0x5e0 [openvswitch]
 ovs_dp_upcall+0x3d/0x60 [openvswitch]
 ovs_dp_process_packet+0x125/0x150 [openvswitch]
 ovs_vport_receive+0x77/0xd0 [openvswitch]
 netdev_port_receive+0x87/0x130 [openvswitch]
 netdev_frame_hook+0x4b/0x60 [openvswitch]
 __netif_receive_skb_core+0x2b4/0xc90
 __netif_receive_skb_one_core+0x3f/0xa0
 __netif_receive_skb+0x18/0x60
 process_backlog+0xa9/0x160
 net_rx_action+0x142/0x390
 __do_softirq+0xe1/0x2d6
 irq_exit+0xae/0xb0
 do_IRQ+0x5a/0xf0
 common_interrupt+0xf/0xf

Code that triggered BUG:
int
skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen)

{
        int i, j = 0;
        int plen = 0; /* length of skb->head fragment */
        int ret;
        struct page *page;
        unsigned int offset;

        BUG_ON(!from->head_frag && !hlen);
---
 net/core/skbuff.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/skbuff.c +4 -1
index 30ca61d91b69..17b93177a68f 100644
@@ -3006,8 +3006,11 @@ skb_zerocopy_headlen(const struct sk_buff *from)
 
 	if (!from->head_frag ||
 	    skb_headlen(from) < L1_CACHE_BYTES ||
-	    skb_shinfo(from)->nr_frags >= MAX_SKB_FRAGS)
+	    skb_shinfo(from)->nr_frags >= MAX_SKB_FRAGS) {
 		hlen = skb_headlen(from);
+		if (!hlen)
+			hlen = from->len;
+	}
 
 	if (skb_has_frag_list(from))
 		hlen = from->len;
Signature · 1 line
2.30.2
author maintainer
#12 lore raw

PATCH 10/35 net: dsa: sja1105: fix address learning getting disabled on the CPU port

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit b0b33b048dcfbd7da82c3cde4fab02751dfab4d6 ]

In May 2019 when commit 640f763f98c2 ("net: dsa: sja1105: Add support for Spanning Tree Protocol") was introduced, the comment that "STP does not get called for the CPU port" was true. This changed after commit 0394a63acfe2 ("net: dsa: enable and disable all ports") in August 2019 and went largely unnoticed, because the sja1105_bridge_stp_state_set() method did nothing different compared to the static setup done by sja1105_init_mac_settings().

With the ability to turn address learning off introduced by the blamed commit, there is a new priv->learn_ena port mask in the driver. When sja1105_bridge_stp_state_set() gets called and we are in BR_STATE_LEARNING or later, address learning is enabled or not depending on priv->learn_ena & BIT(port).

So what happens is that priv->learn_ena is not being set from anywhere for the CPU port, and the static configuration done by sja1105_init_mac_settings() is being overwritten.

To solve this, acknowledge that the static configuration of STP state is no longer necessary because the STP state is being set by the DSA core now, but what is necessary is to set priv->learn_ena for the CPU port.

Fixes 4d9423549501 ("net: dsa: sja1105: offload bridge port flags to device")
---
 drivers/net/dsa/sja1105/sja1105_main.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/net/dsa/sja1105/sja1105_main.c +6 -8
index ebb6966eba8e..5b7947832b87 100644
@@ -130,14 +130,12 @@ static int sja1105_init_mac_settings(struct sja1105_private *priv)
 
 	for (i = 0; i < ds->num_ports; i++) {
 		mac[i] = default_mac;
-		if (i == dsa_upstream_port(priv->ds, i)) {
-			/* STP doesn't get called for CPU port, so we need to
-			 * set the I/O parameters statically.
-			 */
-			mac[i].dyn_learn = true;
-			mac[i].ingress = true;
-			mac[i].egress = true;
-		}
+
+		/* Let sja1105_bridge_stp_state_set() keep address learning
+		 * enabled for the CPU port.
+		 */
+		if (dsa_is_cpu_port(ds, i))
+			priv->learn_ena |= BIT(i);
 	}
 
 	return 0;
Signature · 1 line
2.30.2
author maintainer
#26 lore raw

PATCH 24/35 ASoC: ti: j721e-evm: Fix unbalanced domain activity tracking during startup

In reply to Greg Kroah-Hartman

From: Peter Ujfalusi <[email protected]>

[ Upstream commit 78d2a05ef22e7b5863b01e073dd6a06b3979bb00 ]

In case of an error within j721e_audio_startup() the domain->active must be decremented to avoid unbalanced counter.

---
 sound/soc/ti/j721e-evm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
sound/soc/ti/j721e-evm.c +11 -5
index a7c0484d44ec..017c4ad11ca6 100644
@@ -278,23 +278,29 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream)
 					  j721e_rule_rate, &priv->rate_range,
 					  SNDRV_PCM_HW_PARAM_RATE, -1);
 
-	mutex_unlock(&priv->mutex);
 
 	if (ret)
-		return ret;
+		goto out;
 
 	/* Reset TDM slots to 32 */
 	ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32);
 	if (ret && ret != -ENOTSUPP)
-		return ret;
+		goto out;
 
 	for_each_rtd_codec_dais(rtd, i, codec_dai) {
 		ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32);
 		if (ret && ret != -ENOTSUPP)
-			return ret;
+			goto out;
 	}
 
-	return 0;
+	if (ret == -ENOTSUPP)
+		ret = 0;
+out:
+	if (ret)
+		domain->active--;
+	mutex_unlock(&priv->mutex);
+
+	return ret;
 }
 
 static int j721e_audio_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.30.2
author maintainer
#27 lore raw

PATCH 25/35 ASoC: ti: j721e-evm: Check for not initialized parent_clk_id

In reply to Greg Kroah-Hartman

From: Peter Ujfalusi <[email protected]>

[ Upstream commit 82d28b67f780910f816fe1cfb0f676fc38c4cbb3 ]

During probe the parent_clk_id is set to -1 which should not be used to array index within hsdiv_rates[].

---
 sound/soc/ti/j721e-evm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/j721e-evm.c +1 -1
index 017c4ad11ca6..265bbc5a2f96 100644
@@ -197,7 +197,7 @@ static int j721e_configure_refclk(struct j721e_priv *priv,
 		return ret;
 	}
 
-	if (priv->hsdiv_rates[domain->parent_clk_id] != scki) {
+	if (domain->parent_clk_id == -1 || priv->hsdiv_rates[domain->parent_clk_id] != scki) {
 		dev_dbg(priv->dev,
 			"%s configuration for %u Hz: %s, %dxFS (SCKI: %u Hz)\n",
 			audio_domain == J721E_AUDIO_DOMAIN_CPB ? "CPB" : "IVI",
Signature · 1 line
2.30.2
author maintainer
#28 lore raw

PATCH 26/35 efi/mokvar: Reserve the table only if it is in boot services data

In reply to Greg Kroah-Hartman

From: Borislav Petkov <[email protected]>

[ Upstream commit 47e1e233e9d822dfda068383fb9a616451bda703 ]

One of the SUSE QA tests triggered:

localhost kernel: efi: Failed to lookup EFI memory descriptor for 0x000000003dcf8000

which comes from x86's version of efi_arch_mem_reserve() trying to reserve a memory region. Usually, that function expects EFI_BOOT_SERVICES_DATA memory descriptors but the above case is for the MOKvar table which is allocated in the EFI shim as runtime services.

That lead to a fix changing the allocation of that table to boot services.

However, that fix broke booting SEV guests with that shim leading to this kernel fix

8d651ee9c71b ("x86/ioremap: Map EFI-reserved memory as encrypted for SEV")

which extended the ioremap hint to map reserved EFI boot services as decrypted too.

However, all that wasn't needed, IMO, because that error message in efi_arch_mem_reserve() was innocuous in this case - if the MOKvar table is not in boot services, then it doesn't need to be reserved in the first place because it is, well, in runtime services which *should* be reserved anyway.

So do that reservation for the MOKvar table only if it is allocated in boot services data. I couldn't find any requirement about where that table should be allocated in, unlike the ESRT which allocation is mandated to be done in boot services data by the UEFI spec.

---
 drivers/firmware/efi/mokvar-table.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/efi/mokvar-table.c +4 -1
index d8bc01340686..38722d2009e2 100644
@@ -180,7 +180,10 @@ void __init efi_mokvar_table_init(void)
 		pr_err("EFI MOKvar config table is not valid\n");
 		return;
 	}
-	efi_mem_reserve(efi.mokvar_table, map_size_needed);
+
+	if (md.type == EFI_BOOT_SERVICES_DATA)
+		efi_mem_reserve(efi.mokvar_table, map_size_needed);
+
 	efi_mokvar_table_size = map_size_needed;
 }
 
Signature · 1 line
2.30.2
author maintainer
#29 lore raw

PATCH 27/35 nvme: fix nvme_setup_command metadata trace event

In reply to Greg Kroah-Hartman

From: Keith Busch <[email protected]>

[ Upstream commit 234211b8dd161fa25f192c78d5a8d2dd6bf920a0 ]

The metadata address is set after the trace event, so the trace is not capturing anything useful. Rather than logging the memory address, it's useful to know if the command carries a metadata payload, so change the trace event to log that true/false state instead.

---
 drivers/nvme/host/trace.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/nvme/host/trace.h +3 -3
index daaf700eae79..35bac7a25422 100644
@@ -56,7 +56,7 @@ TRACE_EVENT(nvme_setup_cmd,
 		__field(u8, fctype)
 		__field(u16, cid)
 		__field(u32, nsid)
-		__field(u64, metadata)
+		__field(bool, metadata)
 		__array(u8, cdw10, 24)
 	    ),
 	    TP_fast_assign(
@@ -66,13 +66,13 @@ TRACE_EVENT(nvme_setup_cmd,
 		__entry->flags = cmd->common.flags;
 		__entry->cid = cmd->common.command_id;
 		__entry->nsid = le32_to_cpu(cmd->common.nsid);
-		__entry->metadata = le64_to_cpu(cmd->common.metadata);
+		__entry->metadata = !!blk_integrity_rq(req);
 		__entry->fctype = cmd->fabrics.fctype;
 		__assign_disk_name(__entry->disk, req->rq_disk);
 		memcpy(__entry->cdw10, &cmd->common.cdw10,
 			sizeof(__entry->cdw10));
 	    ),
-	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)",
+	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
 		      __entry->ctrl_id, __print_disk_name(__entry->disk),
 		      __entry->qid, __entry->cid, __entry->nsid,
 		      __entry->flags, __entry->metadata,
Signature · 1 line
2.30.2
author maintainer
#30 lore raw

PATCH 28/35 drm/amd/display: Fix comparison error in dcn21 DML

In reply to Greg Kroah-Hartman

From: Victor Lu <[email protected]>

[ Upstream commit ec3102dc6b36c692104c4a0546d4119de59a3bc1 ]

[why]
A comparison error made it possible to not iterate through all the specified prefetch modes.

[how]
Correct "<" to "<="

---
 drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c +1 -1
index 398210d1af34..f49743929357 100644
@@ -4889,7 +4889,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 				}
 			} while ((locals->PrefetchSupported[i][j] != true || locals->VRatioInPrefetchSupported[i][j] != true)
 					&& (mode_lib->vba.NextMaxVStartup != mode_lib->vba.MaxMaxVStartup[0][0]
-						|| mode_lib->vba.NextPrefetchMode < mode_lib->vba.MaxPrefetchMode));
+						|| mode_lib->vba.NextPrefetchMode <= mode_lib->vba.MaxPrefetchMode));
 
 			if (locals->PrefetchSupported[i][j] == true && locals->VRatioInPrefetchSupported[i][j] == true) {
 				mode_lib->vba.BandwidthAvailableForImmediateFlip = locals->ReturnBWPerState[i][0];
Signature · 1 line
2.30.2
author maintainer
#31 lore raw

PATCH 29/35 drm/amd/display: Fix max vstartup calculation for modes with borders

In reply to Greg Kroah-Hartman

From: Nicholas Kazlauskas <[email protected]>

[ Upstream commit d7940911fc0754d99b208f0e3098762d39f403a0 ]

[Why]
Vertical and horizontal borders in timings are treated as increasing the active area - vblank and hblank actually shrink.

Our input into DML does not include these borders so it incorrectly assumes it has more time than available for vstartup and tmdl calculations for some modes with borders.

An example of such a timing would be 640x480@72Hz:

h_total: 832
h_border_left: 8
h_addressable: 640
h_border_right: 8
h_front_porch: 16
h_sync_width: 40
v_total: 520
v_border_top: 8
v_addressable: 480
v_border_bottom: 8
v_front_porch: 1
v_sync_width: 3
pix_clk_100hz: 315000

[How]
Include borders as part of destination vactive/hactive.

This change DCN20+ so it has wide impact, but the destination vactive and hactive are only really used for vstartup calculation anyway.

Most modes do not have vertical or horizontal borders.

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +4 -2
index d7d70b9bb387..81f583733fa8 100644
@@ -2093,8 +2093,10 @@ int dcn20_populate_dml_pipes_from_context(
 				- timing->v_border_bottom;
 		pipes[pipe_cnt].pipe.dest.htotal = timing->h_total;
 		pipes[pipe_cnt].pipe.dest.vtotal = v_total;
-		pipes[pipe_cnt].pipe.dest.hactive = timing->h_addressable;
-		pipes[pipe_cnt].pipe.dest.vactive = timing->v_addressable;
+		pipes[pipe_cnt].pipe.dest.hactive =
+			timing->h_addressable + timing->h_border_left + timing->h_border_right;
+		pipes[pipe_cnt].pipe.dest.vactive =
+			timing->v_addressable + timing->v_border_top + timing->v_border_bottom;
 		pipes[pipe_cnt].pipe.dest.interlaced = timing->flags.INTERLACE;
 		pipes[pipe_cnt].pipe.dest.pixel_rate_mhz = timing->pix_clk_100hz/10000.0;
 		if (timing->timing_3d_format == TIMING_3D_FORMAT_HW_FRAME_PACKING)
Signature · 1 line
2.30.2
author maintainer
#3 lore raw

PATCH 3/35 power: supply: ab8500: Call battery population once

In reply to Greg Kroah-Hartman

From: Linus Walleij <[email protected]>

[ Upstream commit 7e2bb83c617f8fccc04db7d03f105a06b9d491a9 ]

The code was calling ab8500_bm_of_probe() in four different spots effectively overwriting the same configuration three times. This was done because probe order was uncertain.

Since we now used componentized probe, call it only once while probing the main charging component.

---
 drivers/power/supply/ab8500_btemp.c    | 7 -------
 drivers/power/supply/ab8500_fg.c       | 6 ------
 drivers/power/supply/abx500_chargalg.c | 7 -------
 3 files changed, 20 deletions(-)
drivers/power/supply/ab8500_btemp.c +0 -7
index 4df305c767c5..dbdcff32f353 100644
@@ -983,7 +983,6 @@ static const struct component_ops ab8500_btemp_component_ops = {
 
 static int ab8500_btemp_probe(struct platform_device *pdev)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct power_supply_config psy_cfg = {};
 	struct device *dev = &pdev->dev;
 	struct ab8500_btemp *di;
@@ -996,12 +995,6 @@ static int ab8500_btemp_probe(struct platform_device *pdev)
 
 	di->bm = &ab8500_bm_data;
 
-	ret = ab8500_bm_of_probe(dev, np, di->bm);
-	if (ret) {
-		dev_err(dev, "failed to get battery information\n");
-		return ret;
-	}
-
 	/* get parent data */
 	di->dev = dev;
 	di->parent = dev_get_drvdata(pdev->dev.parent);
drivers/power/supply/ab8500_fg.c +0 -6
index 46c718e9ebb7..146a5f03818f 100644
@@ -3058,12 +3058,6 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 
 	di->bm = &ab8500_bm_data;
 
-	ret = ab8500_bm_of_probe(dev, np, di->bm);
-	if (ret) {
-		dev_err(dev, "failed to get battery information\n");
-		return ret;
-	}
-
 	mutex_init(&di->cc_lock);
 
 	/* get parent data */
drivers/power/supply/abx500_chargalg.c +0 -7
index 599684ce0e4b..a17849bfacbf 100644
@@ -2002,7 +2002,6 @@ static const struct component_ops abx500_chargalg_component_ops = {
 static int abx500_chargalg_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
 	struct power_supply_config psy_cfg = {};
 	struct abx500_chargalg *di;
 	int ret = 0;
@@ -2013,12 +2012,6 @@ static int abx500_chargalg_probe(struct platform_device *pdev)
 
 	di->bm = &ab8500_bm_data;
 
-	ret = ab8500_bm_of_probe(dev, np, di->bm);
-	if (ret) {
-		dev_err(dev, "failed to get battery information\n");
-		return ret;
-	}
-
 	/* get device struct and parent */
 	di->dev = dev;
 	di->parent = dev_get_drvdata(pdev->dev.parent);
Signature · 1 line
2.30.2
author maintainer
#32 lore raw

PATCH 30/35 io_uring: never attempt iopoll reissue from release path

In reply to Greg Kroah-Hartman

From: Jens Axboe <[email protected]>

[ Upstream commit 3c30ef0f78cfb36fdb13753794b0384cf7e37cc9 ]

There are two reasons why this shouldn't be done:

1) Ring is exiting, and we're canceling requests anyway. Any request should be canceled anyway. In theory, this could iterate for a number of times if someone else is also driving the target block queue into request starvation, however the likelihood of this happening is miniscule.

2) If the original task decided to pass the ring to another task, then we don't want to be reissuing from this context as it may be an unrelated task or context. No assumptions should be made about the context in which ->release() is run. This can only happen for pure read/write, and we'll get -EFAULT on them anyway.

---
 fs/io_uring.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
fs/io_uring.c +7 -7
index d465e9997157..86f609fa761c 100644
@@ -2252,7 +2252,7 @@ static inline bool io_run_task_work(void)
  * Find and free completed poll iocbs
  */
 static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
-			       struct list_head *done)
+			       struct list_head *done, bool resubmit)
 {
 	struct req_batch rb;
 	struct io_kiocb *req;
@@ -2267,7 +2267,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
 		req = list_first_entry(done, struct io_kiocb, inflight_entry);
 		list_del(&req->inflight_entry);
 
-		if (READ_ONCE(req->result) == -EAGAIN &&
+		if (READ_ONCE(req->result) == -EAGAIN && resubmit &&
 		    !(req->flags & REQ_F_DONT_REISSUE)) {
 			req->iopoll_completed = 0;
 			req_ref_get(req);
@@ -2291,7 +2291,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
 }
 
 static int io_do_iopoll(struct io_ring_ctx *ctx, unsigned int *nr_events,
-			long min)
+			long min, bool resubmit)
 {
 	struct io_kiocb *req, *tmp;
 	LIST_HEAD(done);
@@ -2334,7 +2334,7 @@ static int io_do_iopoll(struct io_ring_ctx *ctx, unsigned int *nr_events,
 	}
 
 	if (!list_empty(&done))
-		io_iopoll_complete(ctx, nr_events, &done);
+		io_iopoll_complete(ctx, nr_events, &done, resubmit);
 
 	return ret;
 }
@@ -2352,7 +2352,7 @@ static void io_iopoll_try_reap_events(struct io_ring_ctx *ctx)
 	while (!list_empty(&ctx->iopoll_list)) {
 		unsigned int nr_events = 0;
 
-		io_do_iopoll(ctx, &nr_events, 0);
+		io_do_iopoll(ctx, &nr_events, 0, false);
 
 		/* let it sleep and repeat later if can't complete a request */
 		if (nr_events == 0)
@@ -2410,7 +2410,7 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
 			if (list_empty(&ctx->iopoll_list))
 				break;
 		}
-		ret = io_do_iopoll(ctx, &nr_events, min);
+		ret = io_do_iopoll(ctx, &nr_events, min, true);
 	} while (!ret && nr_events < min && !need_resched());
 out:
 	mutex_unlock(&ctx->uring_lock);
@@ -6804,7 +6804,7 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries)
 
 		mutex_lock(&ctx->uring_lock);
 		if (!list_empty(&ctx->iopoll_list))
-			io_do_iopoll(ctx, &nr_events, 0);
+			io_do_iopoll(ctx, &nr_events, 0, true);
 
 		/*
 		 * Don't submit if refs are dying, good for io_uring_register(),
Signature · 1 line
2.30.2
author maintainer
#33 lore raw

PATCH 31/35 io_uring: explicitly catch any illegal async queue attempt

In reply to Greg Kroah-Hartman

From: Jens Axboe <[email protected]>

[ Upstream commit 991468dcf198bb87f24da330676724a704912b47 ]

Catch an illegal case to queue async from an unrelated task that got the ring fd passed to it. This should not be possible to hit, but better be proactive and catch it explicitly. io-wq is extended to check for early IO_WQ_WORK_CANCEL being set on a work item as well, so it can run the request through the normal cancelation path.

---
 fs/io-wq.c    |  7 ++++++-
 fs/io_uring.c | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
fs/io-wq.c +6 -1
index 60f58efdb5f4..9efecdf025b9 100644
@@ -736,7 +736,12 @@ static void io_wqe_enqueue(struct io_wqe *wqe, struct io_wq_work *work)
 	int work_flags;
 	unsigned long flags;
 
-	if (test_bit(IO_WQ_BIT_EXIT, &wqe->wq->state)) {
+	/*
+	 * If io-wq is exiting for this task, or if the request has explicitly
+	 * been marked as one that should not get executed, cancel it here.
+	 */
+	if (test_bit(IO_WQ_BIT_EXIT, &wqe->wq->state) ||
+	    (work->flags & IO_WQ_WORK_CANCEL)) {
 		io_run_cancel(work, wqe);
 		return;
 	}
fs/io_uring.c +11 -0
index 86f609fa761c..32f3df13a812 100644
@@ -1282,6 +1282,17 @@ static void io_queue_async_work(struct io_kiocb *req)
 
 	/* init ->work of the whole link before punting */
 	io_prep_async_link(req);
+
+	/*
+	 * Not expected to happen, but if we do have a bug where this _can_
+	 * happen, catch it here and ensure the request is marked as
+	 * canceled. That will make io-wq go through the usual work cancel
+	 * procedure rather than attempt to run this request (or create a new
+	 * worker for it).
+	 */
+	if (WARN_ON_ONCE(!same_thread_group(req->task, current)))
+		req->work.flags |= IO_WQ_WORK_CANCEL;
+
 	trace_io_uring_queue_async_work(ctx, io_wq_is_hashed(&req->work), req,
 					&req->work, req->flags);
 	io_wq_enqueue(tctx->io_wq, &req->work);
Signature · 1 line
2.30.2
author maintainer
#34 lore raw

PATCH 32/35 Revert "spi: mediatek: fix fifo rx mode"

In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

This reverts commit 09b8cc7810587257e5f82080884001301e1a1ba9 which is commit 3a70dd2d050331ee4cf5ad9d5c0a32d83ead9a43 upstream.

It has been found to have problems.

---
 drivers/spi/spi-mt65xx.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/spi/spi-mt65xx.c +3 -13
@@ -427,23 +427,13 @@ static int mtk_spi_fifo_transfer(struct
 	mtk_spi_setup_packet(master);
 
 	cnt = xfer->len / 4;
-	if (xfer->tx_buf)
-		iowrite32_rep(mdata->base + SPI_TX_DATA_REG, xfer->tx_buf, cnt);
-
-	if (xfer->rx_buf)
-		ioread32_rep(mdata->base + SPI_RX_DATA_REG, xfer->rx_buf, cnt);
+	iowrite32_rep(mdata->base + SPI_TX_DATA_REG, xfer->tx_buf, cnt);
 
 	remainder = xfer->len % 4;
 	if (remainder > 0) {
 		reg_val = 0;
-		if (xfer->tx_buf) {
-			memcpy(&reg_val, xfer->tx_buf + (cnt * 4), remainder);
-			writel(reg_val, mdata->base + SPI_TX_DATA_REG);
-		}
-		if (xfer->rx_buf) {
-			reg_val = readl(mdata->base + SPI_RX_DATA_REG);
-			memcpy(xfer->rx_buf + (cnt * 4), &reg_val, remainder);
-		}
+		memcpy(&reg_val, xfer->tx_buf + (cnt * 4), remainder);
+		writel(reg_val, mdata->base + SPI_TX_DATA_REG);
 	}
 
 	mtk_spi_enable_transfer(master);
author maintainer
#37 lore raw

PATCH 33/35 Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled"

In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

This reverts commit c19a2820df32b94d1d4fb65e96ae36f97dddda56 which is commit 0ea9fd001a14ebc294f112b0361a4e601551d508 upstream.

It has been reported to have problems:

	https://lore.kernel.org/linux-bluetooth/[email protected]/
---
 net/bluetooth/hci_core.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
net/bluetooth/hci_core.c +8 -8
@@ -1721,6 +1721,14 @@ int hci_dev_do_close(struct hci_dev *hde
 
 	BT_DBG("%s %p", hdev->name, hdev);
 
+	if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
+	    !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
+	    test_bit(HCI_UP, &hdev->flags)) {
+		/* Execute vendor specific shutdown routine */
+		if (hdev->shutdown)
+			hdev->shutdown(hdev);
+	}
+
 	cancel_delayed_work(&hdev->power_off);
 
 	hci_request_cancel_all(hdev);
@@ -1797,14 +1805,6 @@ int hci_dev_do_close(struct hci_dev *hde
 		clear_bit(HCI_INIT, &hdev->flags);
 	}
 
-	if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
-	    !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
-	    test_bit(HCI_UP, &hdev->flags)) {
-		/* Execute vendor specific shutdown routine */
-		if (hdev->shutdown)
-			hdev->shutdown(hdev);
-	}
-
 	/* flush cmd  work */
 	flush_work(&hdev->cmd_work);
 
author maintainer
#38 lore raw

PATCH 34/35 Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout"

In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

This reverts commit 5e65819a006ec8a8df2f8639dc26ef0cfaa95ae7 which is commit cb011044e34c293e139570ce5c01aed66a34345c upstream.

It is reported to cause problems with systems and probably should not have been backported in the first place :(

---
 drivers/watchdog/iTCO_wdt.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/watchdog/iTCO_wdt.c +3 -9
@@ -71,8 +71,6 @@
 #define TCOBASE(p)	((p)->tco_res->start)
 /* SMI Control and Enable Register */
 #define SMI_EN(p)	((p)->smi_res->start)
-#define TCO_EN		(1 << 13)
-#define GBL_SMI_EN	(1 << 0)
 
 #define TCO_RLD(p)	(TCOBASE(p) + 0x00) /* TCO Timer Reload/Curr. Value */
 #define TCOv1_TMR(p)	(TCOBASE(p) + 0x01) /* TCOv1 Timer Initial Value*/
@@ -357,12 +355,8 @@ static int iTCO_wdt_set_timeout(struct w
 
 	tmrval = seconds_to_ticks(p, t);
 
-	/*
-	 * If TCO SMIs are off, the timer counts down twice before rebooting.
-	 * Otherwise, the BIOS generally reboots when the SMI triggers.
-	 */
-	if (p->smi_res &&
-	    (SMI_EN(p) & (TCO_EN | GBL_SMI_EN)) != (TCO_EN | GBL_SMI_EN))
+	/* For TCO v1 the timer counts down twice before rebooting */
+	if (p->iTCO_version == 1)
 		tmrval /= 2;
 
 	/* from the specs: */
@@ -527,7 +521,7 @@ static int iTCO_wdt_probe(struct platfor
 		 * Disables TCO logic generating an SMI#
 		 */
 		val32 = inl(SMI_EN(p));
-		val32 &= ~TCO_EN;	/* Turn off SMI clearing watchdog */
+		val32 &= 0xffffdfff;	/* Turn off SMI clearing watchdog */
 		outl(val32, SMI_EN(p));
 	}
 
author maintainer
#4 lore raw

PATCH 4/35 skmsg: Increase sk->sk_drops when dropping packets

In reply to Greg Kroah-Hartman

From: Cong Wang <[email protected]>

[ Upstream commit 781dd0431eb549f9cb1fdddf91a50d985febe884 ]

It is hard to observe packet drops without increasing relevant drop counters, here we should increase sk->sk_drops which is a protocol-independent counter. Fortunately psock is always associated with a struct sock, we can just use psock->sk.

---
 net/core/skmsg.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
net/core/skmsg.c +14 -8
index 45b3a3adc886..d428368a0d87 100644
@@ -607,6 +607,12 @@ static int sk_psock_handle_skb(struct sk_psock *psock, struct sk_buff *skb,
 	return sk_psock_skb_ingress(psock, skb);
 }
 
+static void sock_drop(struct sock *sk, struct sk_buff *skb)
+{
+	sk_drops_add(sk, skb);
+	kfree_skb(skb);
+}
+
 static void sk_psock_backlog(struct work_struct *work)
 {
 	struct sk_psock *psock = container_of(work, struct sk_psock, work);
@@ -646,7 +652,7 @@ static void sk_psock_backlog(struct work_struct *work)
 				/* Hard errors break pipe and stop xmit. */
 				sk_psock_report_error(psock, ret ? -ret : EPIPE);
 				sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED);
-				kfree_skb(skb);
+				sock_drop(psock->sk, skb);
 				goto end;
 			}
 			off += ret;
@@ -737,7 +743,7 @@ static void __sk_psock_zap_ingress(struct sk_psock *psock)
 
 	while ((skb = skb_dequeue(&psock->ingress_skb)) != NULL) {
 		skb_bpf_redirect_clear(skb);
-		kfree_skb(skb);
+		sock_drop(psock->sk, skb);
 	}
 	__sk_psock_purge_ingress_msg(psock);
 }
@@ -863,7 +869,7 @@ static int sk_psock_skb_redirect(struct sk_buff *skb)
 	 * return code, but then didn't set a redirect interface.
 	 */
 	if (unlikely(!sk_other)) {
-		kfree_skb(skb);
+		sock_drop(from->sk, skb);
 		return -EIO;
 	}
 	psock_other = sk_psock(sk_other);
@@ -873,14 +879,14 @@ static int sk_psock_skb_redirect(struct sk_buff *skb)
 	 */
 	if (!psock_other || sock_flag(sk_other, SOCK_DEAD)) {
 		skb_bpf_redirect_clear(skb);
-		kfree_skb(skb);
+		sock_drop(from->sk, skb);
 		return -EIO;
 	}
 	spin_lock_bh(&psock_other->ingress_lock);
 	if (!sk_psock_test_state(psock_other, SK_PSOCK_TX_ENABLED)) {
 		spin_unlock_bh(&psock_other->ingress_lock);
 		skb_bpf_redirect_clear(skb);
-		kfree_skb(skb);
+		sock_drop(from->sk, skb);
 		return -EIO;
 	}
 
@@ -970,7 +976,7 @@ static int sk_psock_verdict_apply(struct sk_psock *psock, struct sk_buff *skb,
 	case __SK_DROP:
 	default:
 out_free:
-		kfree_skb(skb);
+		sock_drop(psock->sk, skb);
 	}
 
 	return err;
@@ -1005,7 +1011,7 @@ static void sk_psock_strp_read(struct strparser *strp, struct sk_buff *skb)
 	sk = strp->sk;
 	psock = sk_psock(sk);
 	if (unlikely(!psock)) {
-		kfree_skb(skb);
+		sock_drop(sk, skb);
 		goto out;
 	}
 	prog = READ_ONCE(psock->progs.stream_verdict);
@@ -1126,7 +1132,7 @@ static int sk_psock_verdict_recv(read_descriptor_t *desc, struct sk_buff *skb,
 	psock = sk_psock(sk);
 	if (unlikely(!psock)) {
 		len = 0;
-		kfree_skb(skb);
+		sock_drop(sk, skb);
 		goto out;
 	}
 	prog = READ_ONCE(psock->progs.stream_verdict);
Signature · 1 line
2.30.2
author maintainer
#5 lore raw

PATCH 5/35 skmsg: Pass source psock to sk_psock_skb_redirect()

In reply to Greg Kroah-Hartman

From: Cong Wang <[email protected]>

[ Upstream commit 42830571f1fd9751b3fbf38084bbb253320e185f ]

sk_psock_skb_redirect() only takes skb as a parameter, we will need to know where this skb is from, so just pass the source psock to this function as a new parameter. This patch prepares for the next one.

---
 net/core/skmsg.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
net/core/skmsg.c +6 -5
index d428368a0d87..b088fe07fc00 100644
@@ -859,7 +859,7 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
 }
 EXPORT_SYMBOL_GPL(sk_psock_msg_verdict);
 
-static int sk_psock_skb_redirect(struct sk_buff *skb)
+static int sk_psock_skb_redirect(struct sk_psock *from, struct sk_buff *skb)
 {
 	struct sk_psock *psock_other;
 	struct sock *sk_other;
@@ -896,11 +896,12 @@ static int sk_psock_skb_redirect(struct sk_buff *skb)
 	return 0;
 }
 
-static void sk_psock_tls_verdict_apply(struct sk_buff *skb, struct sock *sk, int verdict)
+static void sk_psock_tls_verdict_apply(struct sk_buff *skb,
+				       struct sk_psock *from, int verdict)
 {
 	switch (verdict) {
 	case __SK_REDIRECT:
-		sk_psock_skb_redirect(skb);
+		sk_psock_skb_redirect(from, skb);
 		break;
 	case __SK_PASS:
 	case __SK_DROP:
@@ -924,7 +925,7 @@ int sk_psock_tls_strp_read(struct sk_psock *psock, struct sk_buff *skb)
 		ret = sk_psock_map_verd(ret, skb_bpf_redirect_fetch(skb));
 		skb->sk = NULL;
 	}
-	sk_psock_tls_verdict_apply(skb, psock->sk, ret);
+	sk_psock_tls_verdict_apply(skb, psock, ret);
 	rcu_read_unlock();
 	return ret;
 }
@@ -971,7 +972,7 @@ static int sk_psock_verdict_apply(struct sk_psock *psock, struct sk_buff *skb,
 		}
 		break;
 	case __SK_REDIRECT:
-		err = sk_psock_skb_redirect(skb);
+		err = sk_psock_skb_redirect(psock, skb);
 		break;
 	case __SK_DROP:
 	default:
Signature · 1 line
2.30.2
author maintainer
#6 lore raw

PATCH 6/35 bpf, sockmap: On cleanup we additionally need to remove cached skb

In reply to Greg Kroah-Hartman

From: John Fastabend <[email protected]>

[ Upstream commit 476d98018f32e68e7c5d4e8456940cf2b6d66f10 ]

Its possible if a socket is closed and the receive thread is under memory pressure it may have cached a skb. We need to ensure these skbs are free'd along with the normal ingress_skb queue.

Before 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()") tear down and backlog processing both had sock_lock for the common case of socket close or unhash. So it was not possible to have both running in parrallel so all we would need is the kfree in those kernels.

But, latest kernels include the commit 799aa7f98d5e and this requires a bit more work. Without the ingress_lock guarding reading/writing the state->skb case its possible the tear down could run before the state update causing it to leak memory or worse when the backlog reads the state it could potentially run interleaved with the tear down and we might end up free'ing the state->skb from tear down side but already have the reference from backlog side. To resolve such races we wrap accesses in ingress_lock on both sides serializing tear down and backlog case. In both cases this only happens after an EAGAIN error case so having an extra lock in place is likely fine. The normal path will skip the locks.

Note, we check state->skb before grabbing lock. This works because we can only enqueue with the mutex we hold already. Avoiding a race on adding state->skb after the check. And if tear down path is running that is also fine if the tear down path then removes state->skb we will simply set skb=NULL and the subsequent goto is skipped. This slight complication avoids locking in normal case.

With this fix we no longer see this warning splat from tcp side on socket close when we hit the above case with redirect to ingress self.

[224913.935822] WARNING: CPU: 3 PID: 32100 at net/core/stream.c:208 sk_stream_kill_queues+0x212/0x220
[224913.935841] Modules linked in: fuse overlay bpf_preload x86_pkg_temp_thermal intel_uncore wmi_bmof squashfs sch_fq_codel efivarfs ip_tables x_tables uas xhci_pci ixgbe mdio xfrm_algo xhci_hcd wmi
[224913.935897] CPU: 3 PID: 32100 Comm: fgs-bench Tainted: G          I       5.14.0-rc1alu+ #181
[224913.935908] Hardware name: Dell Inc. Precision 5820 Tower/002KVM, BIOS 1.9.2 01/24/2019
[224913.935914] RIP: 0010:sk_stream_kill_queues+0x212/0x220
[224913.935923] Code: 8b 83 20 02 00 00 85 c0 75 20 5b 5d 41 5c 41 5d 41 5e 41 5f c3 48 89 df e8 2b 11 fe ff eb c3 0f 0b e9 7c ff ff ff 0f 0b eb ce <0f> 0b 5b 5d 41 5c 41 5d 41 5e 41 5f c3 90 0f 1f 44 00 00 41 57 41
[224913.935932] RSP: 0018:ffff88816271fd38 EFLAGS: 00010206
[224913.935941] RAX: 0000000000000ae8 RBX: ffff88815acd5240 RCX: dffffc0000000000
[224913.935948] RDX: 0000000000000003 RSI: 0000000000000ae8 RDI: ffff88815acd5460
[224913.935954] RBP: ffff88815acd5460 R08: ffffffff955c0ae8 R09: fffffbfff2e6f543
[224913.935961] R10: ffffffff9737aa17 R11: fffffbfff2e6f542 R12: ffff88815acd5390
[224913.935967] R13: ffff88815acd5480 R14: ffffffff98d0c080 R15: ffffffff96267500
[224913.935974] FS:  00007f86e6bd1700(0000) GS:ffff888451cc0000(0000) knlGS:0000000000000000
[224913.935981] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[224913.935988] CR2: 000000c0008eb000 CR3: 00000001020e0005 CR4: 00000000003706e0
[224913.935994] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[224913.936000] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[224913.936007] Call Trace:
[224913.936016]  inet_csk_destroy_sock+0xba/0x1f0
[224913.936033]  __tcp_close+0x620/0x790
[224913.936047]  tcp_close+0x20/0x80
[224913.936056]  inet_release+0x8f/0xf0
[224913.936070]  __sock_release+0x72/0x120
[224913.936083]  sock_close+0x14/0x20
---
 net/core/skmsg.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)
net/core/skmsg.c +29 -6
index b088fe07fc00..7e7205e93258 100644
@@ -613,23 +613,42 @@ static void sock_drop(struct sock *sk, struct sk_buff *skb)
 	kfree_skb(skb);
 }
 
+static void sk_psock_skb_state(struct sk_psock *psock,
+			       struct sk_psock_work_state *state,
+			       struct sk_buff *skb,
+			       int len, int off)
+{
+	spin_lock_bh(&psock->ingress_lock);
+	if (sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) {
+		state->skb = skb;
+		state->len = len;
+		state->off = off;
+	} else {
+		sock_drop(psock->sk, skb);
+	}
+	spin_unlock_bh(&psock->ingress_lock);
+}
+
 static void sk_psock_backlog(struct work_struct *work)
 {
 	struct sk_psock *psock = container_of(work, struct sk_psock, work);
 	struct sk_psock_work_state *state = &psock->work_state;
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
 	bool ingress;
 	u32 len, off;
 	int ret;
 
 	mutex_lock(&psock->work_mutex);
-	if (state->skb) {
+	if (unlikely(state->skb)) {
+		spin_lock_bh(&psock->ingress_lock);
 		skb = state->skb;
 		len = state->len;
 		off = state->off;
 		state->skb = NULL;
-		goto start;
+		spin_unlock_bh(&psock->ingress_lock);
 	}
+	if (skb)
+		goto start;
 
 	while ((skb = skb_dequeue(&psock->ingress_skb))) {
 		len = skb->len;
@@ -644,9 +663,8 @@ static void sk_psock_backlog(struct work_struct *work)
 							  len, ingress);
 			if (ret <= 0) {
 				if (ret == -EAGAIN) {
-					state->skb = skb;
-					state->len = len;
-					state->off = off;
+					sk_psock_skb_state(psock, state, skb,
+							   len, off);
 					goto end;
 				}
 				/* Hard errors break pipe and stop xmit. */
@@ -745,6 +763,11 @@ static void __sk_psock_zap_ingress(struct sk_psock *psock)
 		skb_bpf_redirect_clear(skb);
 		sock_drop(psock->sk, skb);
 	}
+	kfree_skb(psock->work_state.skb);
+	/* We null the skb here to ensure that calls to sk_psock_backlog
+	 * do not pick up the free'd skb.
+	 */
+	psock->work_state.skb = NULL;
 	__sk_psock_purge_ingress_msg(psock);
 }
 
Signature · 1 line
2.30.2
author maintainer
#9 lore raw

PATCH 7/35 cifs: use helpers when parsing uid/gid mount options and validate them

In reply to Greg Kroah-Hartman

From: Ronnie Sahlberg <[email protected]>

[ Upstream commit e0a3cbcd5cef00cace01546cc6eaaa3b31940da9 ]

Use the nice helpers to initialize and the uid/gid/cred_uid when passed as mount arguments.

---
 fs/cifs/fs_context.c | 24 +++++++++++++++++++-----
 fs/cifs/fs_context.h |  1 +
 2 files changed, 20 insertions(+), 5 deletions(-)
fs/cifs/fs_context.c +19 -5
index 92d4ab029c91..553adfbcc22a 100644
@@ -322,7 +322,6 @@ smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx
 	new_ctx->UNC = NULL;
 	new_ctx->source = NULL;
 	new_ctx->iocharset = NULL;
-
 	/*
 	 * Make sure to stay in sync with smb3_cleanup_fs_context_contents()
 	 */
@@ -792,6 +791,8 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 	int i, opt;
 	bool is_smb3 = !strcmp(fc->fs_type->name, "smb3");
 	bool skip_parsing = false;
+	kuid_t uid;
+	kgid_t gid;
 
 	cifs_dbg(FYI, "CIFS: parsing cifs mount option '%s'\n", param->key);
 
@@ -904,18 +905,31 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 		}
 		break;
 	case Opt_uid:
-		ctx->linux_uid.val = result.uint_32;
+		uid = make_kuid(current_user_ns(), result.uint_32);
+		if (!uid_valid(uid))
+			goto cifs_parse_mount_err;
+		ctx->linux_uid = uid;
 		ctx->uid_specified = true;
 		break;
 	case Opt_cruid:
-		ctx->cred_uid.val = result.uint_32;
+		uid = make_kuid(current_user_ns(), result.uint_32);
+		if (!uid_valid(uid))
+			goto cifs_parse_mount_err;
+		ctx->cred_uid = uid;
+		ctx->cruid_specified = true;
 		break;
 	case Opt_backupgid:
-		ctx->backupgid.val = result.uint_32;
+		gid = make_kgid(current_user_ns(), result.uint_32);
+		if (!gid_valid(gid))
+			goto cifs_parse_mount_err;
+		ctx->backupgid = gid;
 		ctx->backupgid_specified = true;
 		break;
 	case Opt_gid:
-		ctx->linux_gid.val = result.uint_32;
+		gid = make_kgid(current_user_ns(), result.uint_32);
+		if (!gid_valid(gid))
+			goto cifs_parse_mount_err;
+		ctx->linux_gid = gid;
 		ctx->gid_specified = true;
 		break;
 	case Opt_port:
fs/cifs/fs_context.h +1 -0
index 2a71c8e411ac..b6243972edf3 100644
@@ -155,6 +155,7 @@ enum cifs_param {
 
 struct smb3_fs_context {
 	bool uid_specified;
+	bool cruid_specified;
 	bool gid_specified;
 	bool sloppy;
 	bool got_ip;
Signature · 1 line
2.30.2
author maintainer
#10 lore raw

PATCH 8/35 cifs: add missing parsing of backupuid

In reply to Greg Kroah-Hartman

From: Ronnie Sahlberg <[email protected]>

[ Upstream commit b946dbcfa4df80ec81b442964e07ad37000cc059 ]

We lost parsing of backupuid in the switch to new mount API. Add it back.

---
 fs/cifs/fs_context.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/cifs/fs_context.c +7 -0
index 553adfbcc22a..72742eb1df4a 100644
@@ -918,6 +918,13 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 		ctx->cred_uid = uid;
 		ctx->cruid_specified = true;
 		break;
+	case Opt_backupuid:
+		uid = make_kuid(current_user_ns(), result.uint_32);
+		if (!uid_valid(uid))
+			goto cifs_parse_mount_err;
+		ctx->backupuid = uid;
+		ctx->backupuid_specified = true;
+		break;
 	case Opt_backupgid:
 		gid = make_kgid(current_user_ns(), result.uint_32);
 		if (!gid_valid(gid))
Signature · 1 line
2.30.2
author maintainer
#11 lore raw

PATCH 9/35 net: dsa: sja1105: parameterize the number of ports

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit 542043e91df452ed09f382d8c41cdf3788f31b5e ]

The sja1105 driver will gain support for the next-gen SJA1110 switch, which is very similar except for the fact it has more than 5 ports.

So we need to replace the hardcoded SJA1105_NUM_PORTS in this driver with ds->num_ports. This patch is as mechanical as possible (save for the fact that ds->num_ports is not an integer constant expression).

---
 drivers/net/dsa/sja1105/sja1105_clocking.c |  3 +-
 drivers/net/dsa/sja1105/sja1105_flower.c   |  9 ++--
 drivers/net/dsa/sja1105/sja1105_main.c     | 61 +++++++++++++---------
 drivers/net/dsa/sja1105/sja1105_spi.c      |  4 +-
 drivers/net/dsa/sja1105/sja1105_tas.c      | 14 ++---
 5 files changed, 53 insertions(+), 38 deletions(-)
drivers/net/dsa/sja1105/sja1105_clocking.c +2 -1
index 2a9b8a6a5306..f54b4d03a002 100644
@@ -721,9 +721,10 @@ int sja1105_clocking_setup_port(struct sja1105_private *priv, int port)
 
 int sja1105_clocking_setup(struct sja1105_private *priv)
 {
+	struct dsa_switch *ds = priv->ds;
 	int port, rc;
 
-	for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+	for (port = 0; port < ds->num_ports; port++) {
 		rc = sja1105_clocking_setup_port(priv, port);
 		if (rc < 0)
 			return rc;
drivers/net/dsa/sja1105/sja1105_flower.c +5 -4
index 973761132fc3..77c54126b3fc 100644
@@ -35,6 +35,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv,
 {
 	struct sja1105_rule *rule = sja1105_rule_find(priv, cookie);
 	struct sja1105_l2_policing_entry *policing;
+	struct dsa_switch *ds = priv->ds;
 	bool new_rule = false;
 	unsigned long p;
 	int rc;
@@ -59,7 +60,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv,
 
 	policing = priv->static_config.tables[BLK_IDX_L2_POLICING].entries;
 
-	if (policing[(SJA1105_NUM_PORTS * SJA1105_NUM_TC) + port].sharindx != port) {
+	if (policing[(ds->num_ports * SJA1105_NUM_TC) + port].sharindx != port) {
 		NL_SET_ERR_MSG_MOD(extack,
 				   "Port already has a broadcast policer");
 		rc = -EEXIST;
@@ -72,7 +73,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv,
 	 * point to the newly allocated policer
 	 */
 	for_each_set_bit(p, &rule->port_mask, SJA1105_NUM_PORTS) {
-		int bcast = (SJA1105_NUM_PORTS * SJA1105_NUM_TC) + p;
+		int bcast = (ds->num_ports * SJA1105_NUM_TC) + p;
 
 		policing[bcast].sharindx = rule->bcast_pol.sharindx;
 	}
@@ -435,7 +436,7 @@ int sja1105_cls_flower_del(struct dsa_switch *ds, int port,
 	policing = priv->static_config.tables[BLK_IDX_L2_POLICING].entries;
 
 	if (rule->type == SJA1105_RULE_BCAST_POLICER) {
-		int bcast = (SJA1105_NUM_PORTS * SJA1105_NUM_TC) + port;
+		int bcast = (ds->num_ports * SJA1105_NUM_TC) + port;
 
 		old_sharindx = policing[bcast].sharindx;
 		policing[bcast].sharindx = port;
@@ -486,7 +487,7 @@ void sja1105_flower_setup(struct dsa_switch *ds)
 
 	INIT_LIST_HEAD(&priv->flow_block.rules);
 
-	for (port = 0; port < SJA1105_NUM_PORTS; port++)
+	for (port = 0; port < ds->num_ports; port++)
 		priv->flow_block.l2_policer_used[port] = true;
 }
 
drivers/net/dsa/sja1105/sja1105_main.c +36 -25

220 lines not on this page · raw message

drivers/net/dsa/sja1105/sja1105_spi.c +2 -2
index f7a1514f81e8..923d617cbec6 100644
@@ -339,10 +339,10 @@ int static_config_buf_prepare_for_upload(struct sja1105_private *priv,
 
 int sja1105_static_config_upload(struct sja1105_private *priv)
 {
-	unsigned long port_bitmap = GENMASK_ULL(SJA1105_NUM_PORTS - 1, 0);
 	struct sja1105_static_config *config = &priv->static_config;
 	const struct sja1105_regs *regs = priv->info->regs;
 	struct device *dev = &priv->spidev->dev;
+	struct dsa_switch *ds = priv->ds;
 	struct sja1105_status status;
 	int rc, retries = RETRIES;
 	u8 *config_buf;
@@ -363,7 +363,7 @@ int sja1105_static_config_upload(struct sja1105_private *priv)
 	 * Tx on all ports and waiting for current packet to drain.
 	 * Otherwise, the PHY will see an unterminated Ethernet packet.
 	 */
-	rc = sja1105_inhibit_tx(priv, port_bitmap, true);
+	rc = sja1105_inhibit_tx(priv, GENMASK_ULL(ds->num_ports - 1, 0), true);
 	if (rc < 0) {
 		dev_err(dev, "Failed to inhibit Tx on ports\n");
 		rc = -ENXIO;
drivers/net/dsa/sja1105/sja1105_tas.c +8 -6
index 31d8acff1f01..e6153848a950 100644
@@ -27,7 +27,7 @@ static int sja1105_tas_set_runtime_params(struct sja1105_private *priv)
 
 	tas_data->enabled = false;
 
-	for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+	for (port = 0; port < ds->num_ports; port++) {
 		const struct tc_taprio_qopt_offload *offload;
 
 		offload = tas_data->offload[port];
@@ -164,6 +164,7 @@ int sja1105_init_scheduling(struct sja1105_private *priv)
 	struct sja1105_tas_data *tas_data = &priv->tas_data;
 	struct sja1105_gating_config *gating_cfg = &tas_data->gating_cfg;
 	struct sja1105_schedule_entry *schedule;
+	struct dsa_switch *ds = priv->ds;
 	struct sja1105_table *table;
 	int schedule_start_idx;
 	s64 entry_point_delta;
@@ -207,7 +208,7 @@ int sja1105_init_scheduling(struct sja1105_private *priv)
 	}
 
 	/* Figure out the dimensioning of the problem */
-	for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+	for (port = 0; port < ds->num_ports; port++) {
 		if (tas_data->offload[port]) {
 			num_entries += tas_data->offload[port]->num_entries;
 			num_cycles++;
@@ -269,7 +270,7 @@ int sja1105_init_scheduling(struct sja1105_private *priv)
 	schedule_entry_points_params->clksrc = SJA1105_TAS_CLKSRC_PTP;
 	schedule_entry_points_params->actsubsch = num_cycles - 1;
 
-	for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+	for (port = 0; port < ds->num_ports; port++) {
 		const struct tc_taprio_qopt_offload *offload;
 		/* Relative base time */
 		s64 rbt;
@@ -468,6 +469,7 @@ bool sja1105_gating_check_conflicts(struct sja1105_private *priv, int port,
 	struct sja1105_gating_config *gating_cfg = &priv->tas_data.gating_cfg;
 	size_t num_entries = gating_cfg->num_entries;
 	struct tc_taprio_qopt_offload *dummy;
+	struct dsa_switch *ds = priv->ds;
 	struct sja1105_gate_entry *e;
 	bool conflict;
 	int i = 0;
@@ -491,7 +493,7 @@ bool sja1105_gating_check_conflicts(struct sja1105_private *priv, int port,
 	if (port != -1) {
 		conflict = sja1105_tas_check_conflicts(priv, port, dummy);
 	} else {
-		for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+		for (port = 0; port < ds->num_ports; port++) {
 			conflict = sja1105_tas_check_conflicts(priv, port,
 							       dummy);
 			if (conflict)
@@ -554,7 +556,7 @@ int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port,
 		}
 	}
 
-	for (other_port = 0; other_port < SJA1105_NUM_PORTS; other_port++) {
+	for (other_port = 0; other_port < ds->num_ports; other_port++) {
 		if (other_port == port)
 			continue;
 
@@ -885,7 +887,7 @@ void sja1105_tas_teardown(struct dsa_switch *ds)
 
 	cancel_work_sync(&priv->tas_data.tas_work);
 
-	for (port = 0; port < SJA1105_NUM_PORTS; port++) {
+	for (port = 0; port < ds->num_ports; port++) {
 		offload = priv->tas_data.offload[port];
 		if (!offload)
 			continue;
Signature · 1 line
2.30.2

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 5.13.9-rc1 review

This is the start of the stable review cycle for the 5.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +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.13.9-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.13.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 5.13.9-rc1

Stylon Wang <[email protected]>
drm/amd/display: Fix ASSR regression on embedded panels

Greg Kroah-Hartman <[email protected]>
Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout"

Greg Kroah-Hartman <[email protected]>
Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled"

Greg Kroah-Hartman <[email protected]>
Revert "spi: mediatek: fix fifo rx mode"

Jens Axboe <[email protected]>
io_uring: explicitly catch any illegal async queue attempt

Jens Axboe <[email protected]>
io_uring: never attempt iopoll reissue from release path

Nicholas Kazlauskas <[email protected]>
drm/amd/display: Fix max vstartup calculation for modes with borders

Victor Lu <[email protected]>
drm/amd/display: Fix comparison error in dcn21 DML

Keith Busch <[email protected]>
nvme: fix nvme_setup_command metadata trace event

Borislav Petkov <[email protected]>
efi/mokvar: Reserve the table only if it is in boot services data

Peter Ujfalusi <[email protected]>
ASoC: ti: j721e-evm: Check for not initialized parent_clk_id

Peter Ujfalusi <[email protected]>
ASoC: ti: j721e-evm: Fix unbalanced domain activity tracking during startup

Pravin B Shelar <[email protected]>
net: Fix zero-copy head len calculation.

Oder Chiou <[email protected]>
ASoC: rt5682: Fix the issue of garbled recording after powerd_dbus_suspend

Jia He <[email protected]>
qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()

Takashi Iwai <[email protected]>
r8152: Fix a deadlock by doubly PM resume

Takashi Iwai <[email protected]>
r8152: Fix potential PM refcount imbalance

Axel Lin <[email protected]>
regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register

Kyle Russell <[email protected]>
ASoC: tlv320aic31xx: fix reversed bclk/wclk master bits

Alain Volmat <[email protected]>
spi: stm32h7: fix full duplex irq handler handling

Axel Lin <[email protected]>
regulator: rt5033: Fix n_voltages settings for BUCK and LDO

ChiYuan Huang <[email protected]>
regulator: rtmv20: Fix wrong mask for strobe-polarity-high

Rander Wang <[email protected]>
ASoC: Intel: boards: fix xrun issue on platform with max98373

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: boards: create sof-maxim-common module

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: boards: handle hda-dsp-common as a module

Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix address learning getting disabled on the CPU port

Vladimir Oltean <[email protected]>
net: dsa: sja1105: parameterize the number of ports

Ronnie Sahlberg <[email protected]>
cifs: add missing parsing of backupuid

Ronnie Sahlberg <[email protected]>
cifs: use helpers when parsing uid/gid mount options and validate them

John Fastabend <[email protected]>
bpf, sockmap: On cleanup we additionally need to remove cached skb

Cong Wang <[email protected]>
skmsg: Pass source psock to sk_psock_skb_redirect()

Cong Wang <[email protected]>

    skmsg: Increase sk->sk_drops when dropping packets

Linus Walleij <[email protected]>
power: supply: ab8500: Call battery population once

Jason Ekstrand <[email protected]>
Revert "drm/i915: Propagate errors on awaiting already signaled fences"

Jason Ekstrand <[email protected]>
drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"

-------------

Diffstat:

 Makefile                                           |   4 +-
 drivers/firmware/efi/mokvar-table.c                |   5 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   3 -
 .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.c  |   6 +-
 .../amd/display/dc/dml/dcn21/display_mode_vba_21.c |   2 +-
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c     | 227 ++-------------------
 .../drm/i915/gem/selftests/i915_gem_execbuffer.c   |   4 +
 drivers/gpu/drm/i915/i915_cmd_parser.c             | 118 +++++++----
 drivers/gpu/drm/i915/i915_drv.h                    |   7 +-
 drivers/gpu/drm/i915/i915_request.c                |   8 +-
 drivers/net/dsa/sja1105/sja1105_clocking.c         |   3 +-
 drivers/net/dsa/sja1105/sja1105_flower.c           |   9 +-
 drivers/net/dsa/sja1105/sja1105_main.c             |  75 ++++---
 drivers/net/dsa/sja1105/sja1105_spi.c              |   4 +-
 drivers/net/dsa/sja1105/sja1105_tas.c              |  14 +-
 drivers/net/ethernet/qlogic/qed/qed_mcp.c          |  23 ++-
 drivers/net/usb/r8152.c                            |  30 ++-
 drivers/nvme/host/trace.h                          |   6 +-
 drivers/power/supply/ab8500_btemp.c                |   7 -
 drivers/power/supply/ab8500_fg.c                   |   6 -
 drivers/power/supply/abx500_chargalg.c             |   7 -
 drivers/regulator/mtk-dvfsrc-regulator.c           |   3 +-
 drivers/regulator/rtmv20-regulator.c               |   2 +-
 drivers/spi/spi-mt65xx.c                           |  16 +-
 drivers/spi/spi-stm32.c                            |  15 +-
 drivers/watchdog/iTCO_wdt.c                        |  12 +-
 fs/cifs/fs_context.c                               |  31 ++-
 fs/cifs/fs_context.h                               |   1 +
 fs/io-wq.c                                         |   7 +-
 fs/io_uring.c                                      |  25 ++-
 include/linux/mfd/rt5033-private.h                 |   4 +-
 net/bluetooth/hci_core.c                           |  16 +-
 net/core/skbuff.c                                  |   5 +-
 net/core/skmsg.c                                   |  68 ++++--
 sound/soc/codecs/rt5682.c                          |   8 +-
 sound/soc/codecs/tlv320aic31xx.h                   |   4 +-
 sound/soc/intel/boards/Kconfig                     |  18 ++
 sound/soc/intel/boards/Makefile                    |  28 ++-
 sound/soc/intel/boards/bxt_da7219_max98357a.c      |   1 +
 sound/soc/intel/boards/bxt_rt298.c                 |   1 +
 sound/soc/intel/boards/cml_rt1011_rt5682.c         |   1 +
 sound/soc/intel/boards/ehl_rt5660.c                |   1 +
 sound/soc/intel/boards/glk_rt5682_max98357a.c      |   1 +
 sound/soc/intel/boards/hda_dsp_common.c            |   5 +
 sound/soc/intel/boards/skl_hda_dsp_generic.c       |   1 +
 sound/soc/intel/boards/sof_da7219_max98373.c       |   1 +
 sound/soc/intel/boards/sof_maxim_common.c          |  24 ++-
 sound/soc/intel/boards/sof_maxim_common.h          |   6 +-
 sound/soc/intel/boards/sof_pcm512x.c               |   1 +
 sound/soc/intel/boards/sof_rt5682.c                |   6 +-
 sound/soc/intel/boards/sof_sdw.c                   |   2 +
 sound/soc/intel/boards/sof_sdw_max98373.c          |  81 +++++---
 sound/soc/ti/j721e-evm.c                           |  18 +-
 53 files changed, 481 insertions(+), 500 deletions(-)
author maintainer
#39 lore raw

PATCH 35/35 drm/amd/display: Fix ASSR regression on embedded panels

From: Stylon Wang <[email protected]>

commit 6be50f5d83adc9541de3d5be26e968182b5ac150 upstream.

[Why]
Regression found in some embedded panels traces back to the earliest upstreamed ASSR patch. The changed code flow are causing problems with some panels.

[How]
- Change ASSR enabling code while preserving original code flow as much as possible
- Simplify the code on guarding with internal display flag

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +0 -3
@@ -1675,9 +1675,6 @@ static enum dp_panel_mode try_enable_ass
 	} else
 		panel_mode = DP_PANEL_MODE_DEFAULT;
 
-#else
-	/* turn off ASSR if the implementation is not compiled in */
-	panel_mode = DP_PANEL_MODE_DEFAULT;
 #endif
 	return panel_mode;
 }
Tested-by on the v1 series
#40 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.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +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.13.9-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.13.y
and the diffstat can be found below.

thanks,

greg k-h

5.13.9-rc1 Successfully Compiled and booted on my Raspberry PI 4b (8g) (bcm2711)

maintainer Tested-by on the v1 series
#41 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.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +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.13.9-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.13.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.13:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    110 tests:	110 pass, 0 fail

Linux version: 5.13.9-rc1-g1eb1590ab470
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

#35 lore raw

Re: [PATCH 5.13 32/35] Revert "spi: mediatek: fix fifo rx mode"

In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

This reverts commit 09b8cc7810587257e5f82080884001301e1a1ba9 which is commit 3a70dd2d050331ee4cf5ad9d5c0a32d83ead9a43 upstream.

It has been found to have problems.

Quoted 7 lines

The problem with the reverted patch has now been fixed in the mainline kernel with commit 0d5c3954b35e ("spi: mediatek: Fix fifo transfer"). So an alternative to this revert might be to apply commit 0d5c3954b35e instead.

Thanks,
Guenter

Tested-by on the v1 series
#42 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.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +0000. Anything received after that time might be too late.

Build results:

	total: 154 pass: 154 fail: 0
Qemu test results:
	total: 481 pass: 481 fail: 0

Guenter

Tested-by Justin M. Forbes on the v1 series
#43 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.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +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.13.9-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.13.y
and the diffstat can be found below.

thanks,

greg k-h

Tested rc1 against the Fedora build system (aarch64, armv7, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.

author maintainer
#36 lore raw

Re: [PATCH 5.13 32/35] Revert "spi: mediatek: fix fifo rx mode"

In reply to Guenter Roeck
Quoted 16 lines · Guenter Roeck
Quoted 7 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

This reverts commit 09b8cc7810587257e5f82080884001301e1a1ba9 which is commit 3a70dd2d050331ee4cf5ad9d5c0a32d83ead9a43 upstream.

It has been found to have problems.

Quoted 7 lines
Quoted 4 lines

The problem with the reverted patch has now been fixed in the mainline kernel with commit 0d5c3954b35e ("spi: mediatek: Fix fifo transfer"). So an alternative to this revert might be to apply commit 0d5c3954b35e instead.

Good idea, I'll go drop this revert and add that change instead.

thanks,

greg k-h

Tested-by on the v1 series
#44 lore raw
In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +0000. Anything received after that time might be too late.

Compiled, booted, with no regressions

Aakash Hemdri

#7 lore raw

Re: [PATCH 5.13 06/35] bpf, sockmap: On cleanup we additionally need to remove cached skb

In reply to Greg Kroah-Hartman

While running packetdrill test suite on qemu aarch64 the following warning noticed with stable-rc 5.13.9-rc1 kernel intermittently.

Quoted 4 lines · Greg Kroah-Hartman

From: John Fastabend <[email protected]>

[ Upstream commit 476d98018f32e68e7c5d4e8456940cf2b6d66f10 ]

<trim>

Quoted 8 lines

With this fix we no longer see this warning splat from tcp side on socket close when we hit the above case with redirect to ingress self.

[224913.935822] WARNING: CPU: 3 PID: 32100 at net/core/stream.c:208 sk_stream_kill_queues+0x212/0x220
[224913.935841] Modules linked in: fuse overlay bpf_preload x86_pkg_temp_thermal intel_uncore wmi_bmof squashfs sch_fq_codel efivarfs ip_tables x_tables uas xhci_pci ixgbe mdio xfrm_algo xhci_hcd wmi
[224913.935897] CPU: 3 PID: 32100 Comm: fgs-bench Tainted: G          I       5.14.0-rc1alu+ #181
[224913.935908] Hardware name: Dell Inc. Precision 5820 Tower/002KVM, BIOS 1.9.2 01/24/2019
[224913.935914] RIP: 0010:sk_stream_kill_queues+0x212/0x220

steps to reproduce:
-------------------

# boot qemu aarch64 with stable-rc 5.13.9-rc1 kernel
# /usr/bin/qemu-system-aarch64 -cpu max -machine virt,accel=kvm
-nographic -net nic,model=virtio,macaddr=BC:DD:AD:CC:09:01 -net tap -m
4096 -monitor none -kernel kernel/Image.gz --append "console=ttyAMA0
root=/dev/vda rw" -hda
rpb-console-image-lkft-juno-20210525221209.rootfs.ext4 -m 4096 -smp 4
-nographic

# Run test

#  cd ./automated/linux/packetdrill/
#  ./configure
#  make all
#  python3 ./packetdrill/run_all.py -v -l -L

## Build
* kernel: 5.13.9-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.13.y
* git commit: 1eb1590ab470d5f73dd2d20a7196bca35fa3d3e7
* git describe: v5.13.8-36-g1eb1590ab470
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.13.y/build/v5.13.8-36-g1eb1590ab470

Crash log:
-----------
INFO: Skip installing package dependency for packetdrill /opt/packetdrill /lava-3242370/0/tests/1_packetdrill/automated/linux/packetdrill

[   11.329564] tun: Universal TUN/TAP device driver, 1.6
[   14.801347] TCP: tun0: Driver has suspect GRO implementation, TCP
performance may be compromised.
[   15.113626] ------------[ cut here ]------------
[   15.115380] WARNING: CPU: 3 PID: 671 at net/core/stream.c:207
sk_stream_kill_queues+0x104/0x130
[   15.118527] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.120361] CPU: 3 PID: 671 Comm: packetdrill Not tainted 5.13.9-rc1 #1
[   15.122587] Hardware name: linux,dummy-virt (DT)
[   15.124123] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[   15.126117] pc : sk_stream_kill_queues+0x104/0x130
[   15.127764] lr : inet_csk_destroy_sock+0x68/0x130
[   15.129326] sp : ffff8000109f36d0
[   15.130484] x29: ffff8000109f36d0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.132807] x26: 0000000000000001 x25: ffffa05141000900 x24: ffff6f1e0b51dc40
[   15.136643] x23: 0000000000000000 x22: 0000000000000000 x21: ffff6f1e11e7e054
[   15.139117] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.141494] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.143903] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.146292] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa051410d5148
[   15.148660] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : 0000000000000202
[   15.151071] x5 : ffff6f1e08a0dd00 x4 : 0000000000000004 x3 : 0000000000000007
[   15.153435] x2 : ffff6f1e08a0e560 x1 : 0000000000000180 x0 : 00000000fffffe80
[   15.155835] Call trace:
[   15.156675]  sk_stream_kill_queues+0x104/0x130
[   15.163667]  inet_csk_destroy_sock+0x68/0x130
[   15.165139]  tcp_done+0x120/0x1b0
[   15.166274]  tcp_reset+0x74/0x130
[   15.167445]  tcp_validate_incoming+0x394/0x510
[   15.168953]  tcp_rcv_state_process+0x2d8/0x15c0
[   15.170512]  tcp_v4_do_rcv+0x15c/0x2d4
[   15.171798]  tcp_v4_rcv+0x9c0/0xaa4
[   15.173009]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.174597]  ip_local_deliver_finish+0x74/0x90
[   15.176103]  ip_local_deliver+0x88/0x130
[   15.177429]  ip_rcv+0x7c/0x130
[   15.178512]  __netif_receive_skb_one_core+0x60/0x8c
[   15.180143]  __netif_receive_skb+0x20/0x70
[   15.181527]  netif_receive_skb+0x48/0x1e0
[   15.182930]  tun_get_user+0xbe4/0xd70 [tun]
[   15.184368]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.185936]  do_iter_readv_writev+0x100/0x1a4
[   15.187448]  do_iter_write+0x98/0x1fc
[   15.188735]  vfs_writev+0xb4/0x170
[   15.189956]  do_writev+0x7c/0x140
[   15.191115]  __arm64_sys_writev+0x2c/0x40
[   15.192481]  invoke_syscall+0x50/0x120
[   15.193754]  el0_svc_common.constprop.0+0xf4/0x104
[   15.195391]  do_el0_svc+0x34/0x9c
[   15.196558]  el0_svc+0x2c/0x54
[   15.197653]  el0_sync_handler+0xa4/0x130
[   15.199054]  el0_sync+0x198/0x1c0
[   15.200182] ---[ end trace c9faa1be6c93e4fb ]---
[   15.201864] ------------[ cut here ]------------
[   15.203404] WARNING: CPU: 3 PID: 671 at net/core/stream.c:208
sk_stream_kill_queues+0x110/0x130
[   15.206141] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.207976] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.210542] Hardware name: linux,dummy-virt (DT)
[   15.212029] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[   15.213947] pc : sk_stream_kill_queues+0x110/0x130
[   15.215546] lr : inet_csk_destroy_sock+0x68/0x130
[   15.217097] sp : ffff8000109f36d0
[   15.218204] x29: ffff8000109f36d0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.220548] x26: 0000000000000001 x25: ffffa05141000900 x24: ffff6f1e0b51dc40
[   15.223012] x23: 0000000000000000 x22: 0000000000000000 x21: ffff6f1e11e7e054
[   15.225350] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.227705] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.230042] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.232454] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa051410d5148
[   15.234896] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : 0000000000000202
[   15.237544] x5 : ffff6f1e08a0dd00 x4 : 0000000000000004 x3 : 0000000000000007
[   15.239933] x2 : ffff6f1e08a0e560 x1 : 0000000000000180 x0 : 0000000000000180
[   15.242315] Call trace:
[   15.243203]  sk_stream_kill_queues+0x110/0x130
[   15.244721]  inet_csk_destroy_sock+0x68/0x130
[   15.246191]  tcp_done+0x120/0x1b0
[   15.247388]  tcp_reset+0x74/0x130
[   15.248540]  tcp_validate_incoming+0x394/0x510
[   15.250057]  tcp_rcv_state_process+0x2d8/0x15c0
[   15.251636]  tcp_v4_do_rcv+0x15c/0x2d4
[   15.252908]  tcp_v4_rcv+0x9c0/0xaa4
[   15.254095]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.255643]  ip_local_deliver_finish+0x74/0x90
[   15.257138]  ip_local_deliver+0x88/0x130
[   15.258516]  ip_rcv+0x7c/0x130
[   15.259573]  __netif_receive_skb_one_core+0x60/0x8c
[   15.261561]  __netif_receive_skb+0x20/0x70
[   15.263355]  netif_receive_skb+0x48/0x1e0
[   15.264721]  tun_get_user+0xbe4/0xd70 [tun]
[   15.266110]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.267704]  do_iter_readv_writev+0x100/0x1a4
[   15.269162]  do_iter_write+0x98/0x1fc
[   15.270721]  vfs_writev+0xb4/0x170
[   15.271948]  do_writev+0x7c/0x140
[   15.273120]  __arm64_sys_writev+0x2c/0x40
[   15.274527]  invoke_syscall+0x50/0x120
[   15.275805]  el0_svc_common.constprop.0+0xf4/0x104
[   15.277278]  do_el0_svc+0x34/0x9c
[   15.278832]  el0_svc+0x2c/0x54
[   15.280081]  el0_sync_handler+0xa4/0x130
[   15.281614]  el0_sync+0x198/0x1c0
[   15.282899] ---[ end trace c9faa1be6c93e4fc ]---
[   15.284650] ------------[ cut here ]------------
[   15.286116] WARNING: CPU: 3 PID: 671 at net/ipv4/af_inet.c:156
inet_sock_destruct+0x190/0x1b0
[   15.288999] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.290884] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.294511] Hardware name: linux,dummy-virt (DT)
[   15.296041] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   15.298073] pc : inet_sock_destruct+0x190/0x1b0
[   15.299743] lr : __sk_destruct+0x38/0x23c
[   15.301154] sp : ffff8000109f37c0
[   15.302291] x29: ffff8000109f37c0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.304703] x26: 0000000000000001 x25: ffffa05141000900 x24: ffffa05142a8be80
[   15.307100] x23: 0000000000000000 x22: ffff6f1e08a0dd08 x21: ffff6f1e08a0dc80
[   15.309419] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.311764] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.314056] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.316392] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa05141003acc
[   15.318680] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : ffff6f1e08a0ddbc
[   15.320920] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffffceccfd9db000
[   15.323197] x2 : ffff6f1e02c00810 x1 : 0000000000000180 x0 : 00000000fffffe80
[   15.325465] Call trace:
[   15.326270]  inet_sock_destruct+0x190/0x1b0
[   15.327643]  __sk_destruct+0x38/0x23c
[   15.328842]  __sk_free+0x80/0x120
[   15.329923]  sk_free+0x68/0x90
[   15.330941]  sock_put+0x5c/0x80
[   15.331963]  tcp_v4_rcv+0xa40/0xaa4
[   15.333091]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.334585]  ip_local_deliver_finish+0x74/0x90
[   15.336000]  ip_local_deliver+0x88/0x130
[   15.337273]  ip_rcv+0x7c/0x130
[   15.338277]  __netif_receive_skb_one_core+0x60/0x8c
[   15.339869]  __netif_receive_skb+0x20/0x70
[   15.341221]  netif_receive_skb+0x48/0x1e0
[   15.342558]  tun_get_user+0xbe4/0xd70 [tun]
[   15.343929]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.345395]  do_iter_readv_writev+0x100/0x1a4
[   15.346831]  do_iter_write+0x98/0x1fc
[   15.348025]  vfs_writev+0xb4/0x170
[   15.349136]  do_writev+0x7c/0x140
[   15.350224]  __arm64_sys_writev+0x2c/0x40
[   15.351556]  invoke_syscall+0x50/0x120
[   15.352789]  el0_svc_common.constprop.0+0xf4/0x104
[   15.354335]  do_el0_svc+0x34/0x9c
[   15.355451]  el0_svc+0x2c/0x54
[   15.356460]  el0_sync_handler+0xa4/0x130
[   15.357740]  el0_sync+0x198/0x1c0
[   15.358861] ---[ end trace c9faa1be6c93e4fd ]---
[   15.360555] ------------[ cut here ]------------
[   15.361959] WARNING: CPU: 3 PID: 671 at net/ipv4/af_inet.c:157
inet_sock_destruct+0x16c/0x1b0
[   15.364603] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.366276] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.373031] Hardware name: linux,dummy-virt (DT)
[   15.377359] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   15.381502] pc : inet_sock_destruct+0x16c/0x1b0
[   15.384348] lr : __sk_destruct+0x38/0x23c
[   15.387724] sp : ffff8000109f37c0
[   15.388842] x29: ffff8000109f37c0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.391840] x26: 0000000000000001 x25: ffffa05141000900 x24: ffffa05142a8be80
[   15.394837] x23: 0000000000000000 x22: ffff6f1e08a0dd08 x21: ffff6f1e08a0dc80
[   15.398292] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.401315] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.403655] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.405967] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa05141003acc
[   15.408287] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : ffff6f1e08a0ddbc
[   15.410616] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffffceccfd9db000
[   15.412969] x2 : ffff6f1e02c00810 x1 : 0000000000000180 x0 : 0000000000000180
[   15.415332] Call trace:
[   15.416187]  inet_sock_destruct+0x16c/0x1b0
[   15.417551]  __sk_destruct+0x38/0x23c
[   15.418793]  __sk_free+0x80/0x120
[   15.419886]  sk_free+0x68/0x90
[   15.420916]  sock_put+0x5c/0x80
[   15.421974]  tcp_v4_rcv+0xa40/0xaa4
[   15.423182]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.424649]  ip_local_deliver_finish+0x74/0x90
[   15.426214]  ip_local_deliver+0x88/0x130
[   15.427869]  ip_rcv+0x7c/0x130
[   15.428884]  __netif_receive_skb_one_core+0x60/0x8c
[   15.430545]  __netif_receive_skb+0x20/0x70
[   15.432679]  netif_receive_skb+0x48/0x1e0
[   15.435651]  tun_get_user+0xbe4/0xd70 [tun]
[   15.437662]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.439835]  do_iter_readv_writev+0x100/0x1a4
[   15.441836]  do_iter_write+0x98/0x1fc
[   15.443588]  vfs_writev+0xb4/0x170
[   15.445150]  do_writev+0x7c/0x140
[   15.446713]  __arm64_sys_writev+0x2c/0x40
[   15.448639]  invoke_syscall+0x50/0x120
[   15.450373]  el0_svc_common.constprop.0+0xf4/0x104
[   15.452642]  do_el0_svc+0x34/0x9c
[   15.454230]  el0_svc+0x2c/0x54
[   15.455743]  el0_sync_handler+0xa4/0x130
[   15.457486]  el0_sync+0x198/0x1c0
[   15.458659] ---[ end trace c9faa1be6c93e4fe ]---

--
Linaro LKFT
https://lkft.linaro.org

Tested-by Linux Kernel Functional Testing on the v1 series
#45 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.13.9 release. There are 35 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 Sun, 08 Aug 2021 08:11:03 +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.13.9-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.13.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.

NOTE: Found an intermittent warning on qemu aarch64 and reported.
https://lore.kernel.org/stable/CA+G9fYuH=KQaCpbBuYV0EEXtVcF7hTr+x6C5zmyUeNqVwLneYQ@mail.gmail.com/

## Build
* kernel: 5.13.9-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.13.y
* git commit: 1eb1590ab470d5f73dd2d20a7196bca35fa3d3e7
* git describe: v5.13.8-36-g1eb1590ab470
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.13.y/build/v5.13.8-36-g1eb1590ab470

## No regressions (compared to v5.13.8)

## No fixes (compared to v5.13.8)

## Test result summary
total: 84738, pass: 69760, fail: 1654, skip: 12066, xfail: 1258

## 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
* ssuite
* v4l2-compliance

--
Linaro LKFT
https://lkft.linaro.org

#8 lore raw

Re: [PATCH 5.13 06/35] bpf, sockmap: On cleanup we additionally need to remove cached skb

In reply to Naresh Kamboju
Quoted 38 lines · Naresh Kamboju

While running packetdrill test suite on qemu aarch64 the following warning noticed with stable-rc 5.13.9-rc1 kernel intermittently.

Quoted 4 lines · Greg Kroah-Hartman

From: John Fastabend <[email protected]>

[ Upstream commit 476d98018f32e68e7c5d4e8456940cf2b6d66f10 ]

<trim>

Quoted 8 lines

With this fix we no longer see this warning splat from tcp side on socket close when we hit the above case with redirect to ingress self.

[224913.935822] WARNING: CPU: 3 PID: 32100 at net/core/stream.c:208 sk_stream_kill_queues+0x212/0x220
[224913.935841] Modules linked in: fuse overlay bpf_preload x86_pkg_temp_thermal intel_uncore wmi_bmof squashfs sch_fq_codel efivarfs ip_tables x_tables uas xhci_pci ixgbe mdio xfrm_algo xhci_hcd wmi
[224913.935897] CPU: 3 PID: 32100 Comm: fgs-bench Tainted: G          I       5.14.0-rc1alu+ #181
[224913.935908] Hardware name: Dell Inc. Precision 5820 Tower/002KVM, BIOS 1.9.2 01/24/2019
[224913.935914] RIP: 0010:sk_stream_kill_queues+0x212/0x220

steps to reproduce:
-------------------

# boot qemu aarch64 with stable-rc 5.13.9-rc1 kernel
# /usr/bin/qemu-system-aarch64 -cpu max -machine virt,accel=kvm
-nographic -net nic,model=virtio,macaddr=BC:DD:AD:CC:09:01 -net tap -m
4096 -monitor none -kernel kernel/Image.gz --append "console=ttyAMA0
root=/dev/vda rw" -hda
rpb-console-image-lkft-juno-20210525221209.rootfs.ext4 -m 4096 -smp 4
-nographic

# Run test

#  cd ./automated/linux/packetdrill/
#  ./configure
#  make all
#  python3 ./packetdrill/run_all.py -v -l -L
Quoted 8 lines

## Build
* kernel: 5.13.9-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.13.y
* git commit: 1eb1590ab470d5f73dd2d20a7196bca35fa3d3e7
* git describe: v5.13.8-36-g1eb1590ab470
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.13.y/build/v5.13.8-36-g1eb1590ab470

Hi Naresh,

The fix here should only be visible with sockmap BPF programs running. The trace below doesn't seem to have any of the BPF calls. I tried to parse the test details, but I didn't see how packetdrill and the BPF tests are related. The test that would be relevant linked here seems to be passing in your case.

https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.13.y/build/v5.13.8-36-g1eb1590ab470/testrun/5382761/suite/kselftest-bpf/test/bpf.test_sockmap/details/

Am I correct in assuming that you bisected to this patch somehow, but did not have any BPF programs running?

Thanks,
John

Quoted 214 lines

Crash log:
-----------
INFO: Skip installing package dependency for packetdrill /opt/packetdrill /lava-3242370/0/tests/1_packetdrill/automated/linux/packetdrill

[   11.329564] tun: Universal TUN/TAP device driver, 1.6
[   14.801347] TCP: tun0: Driver has suspect GRO implementation, TCP
performance may be compromised.
[   15.113626] ------------[ cut here ]------------
[   15.115380] WARNING: CPU: 3 PID: 671 at net/core/stream.c:207
sk_stream_kill_queues+0x104/0x130
[   15.118527] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.120361] CPU: 3 PID: 671 Comm: packetdrill Not tainted 5.13.9-rc1 #1
[   15.122587] Hardware name: linux,dummy-virt (DT)
[   15.124123] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[   15.126117] pc : sk_stream_kill_queues+0x104/0x130
[   15.127764] lr : inet_csk_destroy_sock+0x68/0x130
[   15.129326] sp : ffff8000109f36d0
[   15.130484] x29: ffff8000109f36d0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.132807] x26: 0000000000000001 x25: ffffa05141000900 x24: ffff6f1e0b51dc40
[   15.136643] x23: 0000000000000000 x22: 0000000000000000 x21: ffff6f1e11e7e054
[   15.139117] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.141494] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.143903] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.146292] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa051410d5148
[   15.148660] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : 0000000000000202
[   15.151071] x5 : ffff6f1e08a0dd00 x4 : 0000000000000004 x3 : 0000000000000007
[   15.153435] x2 : ffff6f1e08a0e560 x1 : 0000000000000180 x0 : 00000000fffffe80
[   15.155835] Call trace:
[   15.156675]  sk_stream_kill_queues+0x104/0x130
[   15.163667]  inet_csk_destroy_sock+0x68/0x130
[   15.165139]  tcp_done+0x120/0x1b0
[   15.166274]  tcp_reset+0x74/0x130
[   15.167445]  tcp_validate_incoming+0x394/0x510
[   15.168953]  tcp_rcv_state_process+0x2d8/0x15c0
[   15.170512]  tcp_v4_do_rcv+0x15c/0x2d4
[   15.171798]  tcp_v4_rcv+0x9c0/0xaa4
[   15.173009]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.174597]  ip_local_deliver_finish+0x74/0x90
[   15.176103]  ip_local_deliver+0x88/0x130
[   15.177429]  ip_rcv+0x7c/0x130
[   15.178512]  __netif_receive_skb_one_core+0x60/0x8c
[   15.180143]  __netif_receive_skb+0x20/0x70
[   15.181527]  netif_receive_skb+0x48/0x1e0
[   15.182930]  tun_get_user+0xbe4/0xd70 [tun]
[   15.184368]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.185936]  do_iter_readv_writev+0x100/0x1a4
[   15.187448]  do_iter_write+0x98/0x1fc
[   15.188735]  vfs_writev+0xb4/0x170
[   15.189956]  do_writev+0x7c/0x140
[   15.191115]  __arm64_sys_writev+0x2c/0x40
[   15.192481]  invoke_syscall+0x50/0x120
[   15.193754]  el0_svc_common.constprop.0+0xf4/0x104
[   15.195391]  do_el0_svc+0x34/0x9c
[   15.196558]  el0_svc+0x2c/0x54
[   15.197653]  el0_sync_handler+0xa4/0x130
[   15.199054]  el0_sync+0x198/0x1c0
[   15.200182] ---[ end trace c9faa1be6c93e4fb ]---
[   15.201864] ------------[ cut here ]------------
[   15.203404] WARNING: CPU: 3 PID: 671 at net/core/stream.c:208
sk_stream_kill_queues+0x110/0x130
[   15.206141] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.207976] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.210542] Hardware name: linux,dummy-virt (DT)
[   15.212029] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[   15.213947] pc : sk_stream_kill_queues+0x110/0x130
[   15.215546] lr : inet_csk_destroy_sock+0x68/0x130
[   15.217097] sp : ffff8000109f36d0
[   15.218204] x29: ffff8000109f36d0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.220548] x26: 0000000000000001 x25: ffffa05141000900 x24: ffff6f1e0b51dc40
[   15.223012] x23: 0000000000000000 x22: 0000000000000000 x21: ffff6f1e11e7e054
[   15.225350] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.227705] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.230042] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.232454] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa051410d5148
[   15.234896] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : 0000000000000202
[   15.237544] x5 : ffff6f1e08a0dd00 x4 : 0000000000000004 x3 : 0000000000000007
[   15.239933] x2 : ffff6f1e08a0e560 x1 : 0000000000000180 x0 : 0000000000000180
[   15.242315] Call trace:
[   15.243203]  sk_stream_kill_queues+0x110/0x130
[   15.244721]  inet_csk_destroy_sock+0x68/0x130
[   15.246191]  tcp_done+0x120/0x1b0
[   15.247388]  tcp_reset+0x74/0x130
[   15.248540]  tcp_validate_incoming+0x394/0x510
[   15.250057]  tcp_rcv_state_process+0x2d8/0x15c0
[   15.251636]  tcp_v4_do_rcv+0x15c/0x2d4
[   15.252908]  tcp_v4_rcv+0x9c0/0xaa4
[   15.254095]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.255643]  ip_local_deliver_finish+0x74/0x90
[   15.257138]  ip_local_deliver+0x88/0x130
[   15.258516]  ip_rcv+0x7c/0x130
[   15.259573]  __netif_receive_skb_one_core+0x60/0x8c
[   15.261561]  __netif_receive_skb+0x20/0x70
[   15.263355]  netif_receive_skb+0x48/0x1e0
[   15.264721]  tun_get_user+0xbe4/0xd70 [tun]
[   15.266110]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.267704]  do_iter_readv_writev+0x100/0x1a4
[   15.269162]  do_iter_write+0x98/0x1fc
[   15.270721]  vfs_writev+0xb4/0x170
[   15.271948]  do_writev+0x7c/0x140
[   15.273120]  __arm64_sys_writev+0x2c/0x40
[   15.274527]  invoke_syscall+0x50/0x120
[   15.275805]  el0_svc_common.constprop.0+0xf4/0x104
[   15.277278]  do_el0_svc+0x34/0x9c
[   15.278832]  el0_svc+0x2c/0x54
[   15.280081]  el0_sync_handler+0xa4/0x130
[   15.281614]  el0_sync+0x198/0x1c0
[   15.282899] ---[ end trace c9faa1be6c93e4fc ]---
[   15.284650] ------------[ cut here ]------------
[   15.286116] WARNING: CPU: 3 PID: 671 at net/ipv4/af_inet.c:156
inet_sock_destruct+0x190/0x1b0
[   15.288999] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.290884] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.294511] Hardware name: linux,dummy-virt (DT)
[   15.296041] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   15.298073] pc : inet_sock_destruct+0x190/0x1b0
[   15.299743] lr : __sk_destruct+0x38/0x23c
[   15.301154] sp : ffff8000109f37c0
[   15.302291] x29: ffff8000109f37c0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.304703] x26: 0000000000000001 x25: ffffa05141000900 x24: ffffa05142a8be80
[   15.307100] x23: 0000000000000000 x22: ffff6f1e08a0dd08 x21: ffff6f1e08a0dc80
[   15.309419] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.311764] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.314056] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.316392] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa05141003acc
[   15.318680] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : ffff6f1e08a0ddbc
[   15.320920] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffffceccfd9db000
[   15.323197] x2 : ffff6f1e02c00810 x1 : 0000000000000180 x0 : 00000000fffffe80
[   15.325465] Call trace:
[   15.326270]  inet_sock_destruct+0x190/0x1b0
[   15.327643]  __sk_destruct+0x38/0x23c
[   15.328842]  __sk_free+0x80/0x120
[   15.329923]  sk_free+0x68/0x90
[   15.330941]  sock_put+0x5c/0x80
[   15.331963]  tcp_v4_rcv+0xa40/0xaa4
[   15.333091]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.334585]  ip_local_deliver_finish+0x74/0x90
[   15.336000]  ip_local_deliver+0x88/0x130
[   15.337273]  ip_rcv+0x7c/0x130
[   15.338277]  __netif_receive_skb_one_core+0x60/0x8c
[   15.339869]  __netif_receive_skb+0x20/0x70
[   15.341221]  netif_receive_skb+0x48/0x1e0
[   15.342558]  tun_get_user+0xbe4/0xd70 [tun]
[   15.343929]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.345395]  do_iter_readv_writev+0x100/0x1a4
[   15.346831]  do_iter_write+0x98/0x1fc
[   15.348025]  vfs_writev+0xb4/0x170
[   15.349136]  do_writev+0x7c/0x140
[   15.350224]  __arm64_sys_writev+0x2c/0x40
[   15.351556]  invoke_syscall+0x50/0x120
[   15.352789]  el0_svc_common.constprop.0+0xf4/0x104
[   15.354335]  do_el0_svc+0x34/0x9c
[   15.355451]  el0_svc+0x2c/0x54
[   15.356460]  el0_sync_handler+0xa4/0x130
[   15.357740]  el0_sync+0x198/0x1c0
[   15.358861] ---[ end trace c9faa1be6c93e4fd ]---
[   15.360555] ------------[ cut here ]------------
[   15.361959] WARNING: CPU: 3 PID: 671 at net/ipv4/af_inet.c:157
inet_sock_destruct+0x16c/0x1b0
[   15.364603] Modules linked in: tun crct10dif_ce rfkill fuse
[   15.366276] CPU: 3 PID: 671 Comm: packetdrill Tainted: G        W
      5.13.9-rc1 #1
[   15.373031] Hardware name: linux,dummy-virt (DT)
[   15.377359] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   15.381502] pc : inet_sock_destruct+0x16c/0x1b0
[   15.384348] lr : __sk_destruct+0x38/0x23c
[   15.387724] sp : ffff8000109f37c0
[   15.388842] x29: ffff8000109f37c0 x28: 0000000000000005 x27: fffffffffffffff2
[   15.391840] x26: 0000000000000001 x25: ffffa05141000900 x24: ffffa05142a8be80
[   15.394837] x23: 0000000000000000 x22: ffff6f1e08a0dd08 x21: ffff6f1e08a0dc80
[   15.398292] x20: ffff6f1e08a0dd30 x19: ffff6f1e08a0dc80 x18: 0000000000000000
[   15.401315] x17: 0000000000000000 x16: 0000000000000000 x15: 00000000238ecea0
[   15.403655] x14: 0000000000000000 x13: 000000000000dd86 x12: 000000007ffff000
[   15.405967] x11: 0000000000000004 x10: 0000000000000000 x9 : ffffa05141003acc
[   15.408287] x8 : 0000000000000000 x7 : ffffffffd3039400 x6 : ffff6f1e08a0ddbc
[   15.410616] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffffceccfd9db000
[   15.412969] x2 : ffff6f1e02c00810 x1 : 0000000000000180 x0 : 0000000000000180
[   15.415332] Call trace:
[   15.416187]  inet_sock_destruct+0x16c/0x1b0
[   15.417551]  __sk_destruct+0x38/0x23c
[   15.418793]  __sk_free+0x80/0x120
[   15.419886]  sk_free+0x68/0x90
[   15.420916]  sock_put+0x5c/0x80
[   15.421974]  tcp_v4_rcv+0xa40/0xaa4
[   15.423182]  ip_protocol_deliver_rcu+0x4c/0x184
[   15.424649]  ip_local_deliver_finish+0x74/0x90
[   15.426214]  ip_local_deliver+0x88/0x130
[   15.427869]  ip_rcv+0x7c/0x130
[   15.428884]  __netif_receive_skb_one_core+0x60/0x8c
[   15.430545]  __netif_receive_skb+0x20/0x70
[   15.432679]  netif_receive_skb+0x48/0x1e0
[   15.435651]  tun_get_user+0xbe4/0xd70 [tun]
[   15.437662]  tun_chr_write_iter+0x68/0xf0 [tun]
[   15.439835]  do_iter_readv_writev+0x100/0x1a4
[   15.441836]  do_iter_write+0x98/0x1fc
[   15.443588]  vfs_writev+0xb4/0x170
[   15.445150]  do_writev+0x7c/0x140
[   15.446713]  __arm64_sys_writev+0x2c/0x40
[   15.448639]  invoke_syscall+0x50/0x120
[   15.450373]  el0_svc_common.constprop.0+0xf4/0x104
[   15.452642]  do_el0_svc+0x34/0x9c
[   15.454230]  el0_svc+0x2c/0x54
[   15.455743]  el0_sync_handler+0xa4/0x130
[   15.457486]  el0_sync+0x198/0x1c0
[   15.458659] ---[ end trace c9faa1be6c93e4fe ]---

--
Linaro LKFT
https://lkft.linaro.org