public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs
@ 2023-03-22  3:55 Bard Liao
  2023-03-22  3:55 ` [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses Bard Liao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bard Liao @ 2023-03-22  3:55 UTC (permalink / raw)
  To: alsa-devel, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

There are a couple of duplicate logs which makes harder than needed to
follow the error flows. Add __func__ or make the log unique.
This series also changed some uses of "dev_err(bus->dev," where the stream
may depend on multiple managers/buses.

v2:
- Split the original patch into two patches

Pierre-Louis Bossart (2):
  soundwire: stream: remove bus->dev from logs on multiple buses
  soundwire: stream: uniquify dev_err() logs

 drivers/soundwire/stream.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

-- 
2.25.1


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

* [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses
  2023-03-22  3:55 [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs Bard Liao
@ 2023-03-22  3:55 ` Bard Liao
  2023-03-22  3:55 ` [PATCH v2 2/2] soundwire: stream: uniquify dev_err() logs Bard Liao
  2023-03-31 13:15 ` [PATCH v2 0/2] " Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Bard Liao @ 2023-03-22  3:55 UTC (permalink / raw)
  To: alsa-devel, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

A stream may depend on multiple managers/buses, e.g. for the multiple
amplifier case. It's incorrect to use bus->dev in this case.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 drivers/soundwire/stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 136b6850a3f0..f903394ff2cf 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -1389,7 +1389,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
 
 	ret = do_bank_switch(stream);
 	if (ret < 0) {
-		dev_err(bus->dev, "Bank switch failed: %d\n", ret);
+		pr_err("Bank switch failed: %d\n", ret);
 		goto restore_params;
 	}
 
@@ -1497,7 +1497,7 @@ static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
 
 	ret = do_bank_switch(stream);
 	if (ret < 0) {
-		dev_err(bus->dev, "Bank switch failed: %d\n", ret);
+		pr_err("Bank switch failed: %d\n", ret);
 		return ret;
 	}
 
-- 
2.25.1


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

* [PATCH v2 2/2] soundwire: stream: uniquify dev_err() logs
  2023-03-22  3:55 [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs Bard Liao
  2023-03-22  3:55 ` [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses Bard Liao
@ 2023-03-22  3:55 ` Bard Liao
  2023-03-31 13:15 ` [PATCH v2 0/2] " Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Bard Liao @ 2023-03-22  3:55 UTC (permalink / raw)
  To: alsa-devel, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

There are a couple of duplicate logs which makes harder than needed to
follow the error flows. Add __func__ or make the log unique.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 drivers/soundwire/stream.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index f903394ff2cf..c2191c07442b 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -1389,7 +1389,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
 
 	ret = do_bank_switch(stream);
 	if (ret < 0) {
-		pr_err("Bank switch failed: %d\n", ret);
+		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
 		goto restore_params;
 	}
 
@@ -1477,7 +1477,7 @@ static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
 		/* Program params */
 		ret = sdw_program_params(bus, false);
 		if (ret < 0) {
-			dev_err(bus->dev, "Program params failed: %d\n", ret);
+			dev_err(bus->dev, "%s: Program params failed: %d\n", __func__, ret);
 			return ret;
 		}
 
@@ -1497,7 +1497,7 @@ static int _sdw_enable_stream(struct sdw_stream_runtime *stream)
 
 	ret = do_bank_switch(stream);
 	if (ret < 0) {
-		pr_err("Bank switch failed: %d\n", ret);
+		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
 		return ret;
 	}
 
@@ -1567,14 +1567,14 @@ static int _sdw_disable_stream(struct sdw_stream_runtime *stream)
 		/* Program params */
 		ret = sdw_program_params(bus, false);
 		if (ret < 0) {
-			dev_err(bus->dev, "Program params failed: %d\n", ret);
+			dev_err(bus->dev, "%s: Program params failed: %d\n", __func__, ret);
 			return ret;
 		}
 	}
 
 	ret = do_bank_switch(stream);
 	if (ret < 0) {
-		pr_err("Bank switch failed: %d\n", ret);
+		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
 		return ret;
 	}
 
@@ -1664,7 +1664,7 @@ static int _sdw_deprepare_stream(struct sdw_stream_runtime *stream)
 		/* Program params */
 		ret = sdw_program_params(bus, false);
 		if (ret < 0) {
-			dev_err(bus->dev, "Program params failed: %d\n", ret);
+			dev_err(bus->dev, "%s: Program params failed: %d\n", __func__, ret);
 			return ret;
 		}
 	}
@@ -1893,7 +1893,8 @@ int sdw_stream_add_master(struct sdw_bus *bus,
 
 	m_rt = sdw_master_rt_alloc(bus, stream);
 	if (!m_rt) {
-		dev_err(bus->dev, "Master runtime alloc failed for stream:%s\n", stream->name);
+		dev_err(bus->dev, "%s: Master runtime alloc failed for stream:%s\n",
+			__func__, stream->name);
 		ret = -ENOMEM;
 		goto unlock;
 	}
@@ -2012,7 +2013,8 @@ int sdw_stream_add_slave(struct sdw_slave *slave,
 	 */
 	m_rt = sdw_master_rt_alloc(slave->bus, stream);
 	if (!m_rt) {
-		dev_err(&slave->dev, "Master runtime alloc failed for stream:%s\n", stream->name);
+		dev_err(&slave->dev, "%s: Master runtime alloc failed for stream:%s\n",
+			__func__, stream->name);
 		ret = -ENOMEM;
 		goto unlock;
 	}
-- 
2.25.1


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

* Re: [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs
  2023-03-22  3:55 [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs Bard Liao
  2023-03-22  3:55 ` [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses Bard Liao
  2023-03-22  3:55 ` [PATCH v2 2/2] soundwire: stream: uniquify dev_err() logs Bard Liao
@ 2023-03-31 13:15 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-03-31 13:15 UTC (permalink / raw)
  To: Bard Liao; +Cc: alsa-devel, linux-kernel, pierre-louis.bossart, bard.liao

On 22-03-23, 11:55, Bard Liao wrote:
> There are a couple of duplicate logs which makes harder than needed to
> follow the error flows. Add __func__ or make the log unique.
> This series also changed some uses of "dev_err(bus->dev," where the stream
> may depend on multiple managers/buses.

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2023-03-31 13:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22  3:55 [PATCH v2 0/2] soundwire: stream: uniquify dev_err() logs Bard Liao
2023-03-22  3:55 ` [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses Bard Liao
2023-03-22  3:55 ` [PATCH v2 2/2] soundwire: stream: uniquify dev_err() logs Bard Liao
2023-03-31 13:15 ` [PATCH v2 0/2] " Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox