From patchwork Wed Mar 22 03:55:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liao, Bard" X-Patchwork-Id: 666173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0924DC6FD1C for ; Wed, 22 Mar 2023 03:42:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 69304820; Wed, 22 Mar 2023 04:41:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 69304820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1679456531; bh=RJz7FcUe9hColoZIPnIl1BZwjUCTD5+hSuVxXnTu59g=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PGp9UTpuVOKbY96mysSMcsWph0OysdU6ybs27aAsemeRT9I7usCpyr4wyYqcmPwOg pn/pkJwp/tYJ9v1iL040gLKHiFKQR8eZTJsvhXepo0XBBYfiOtI2gdDvtDXOvWI5Lh Rp26BPnkldjizfw7Sxih+QHgaoaYlPDgh1w+7lbM= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CDD35F8027B; Wed, 22 Mar 2023 04:40:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E79E9F80482; Wed, 22 Mar 2023 04:40:54 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D6CF5F80093 for ; Wed, 22 Mar 2023 04:40:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D6CF5F80093 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=O+WX4I1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679456449; x=1710992449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RJz7FcUe9hColoZIPnIl1BZwjUCTD5+hSuVxXnTu59g=; b=O+WX4I1DnYzqlaeZt6ehDDAMAHRatwBXpyS4kGoBHRsQ9ebnv89b7nN0 jdwmht4H8TGXIuqf9hTSjSe2f4+w68slnjLCOA8Kuu++efnlvOqxssNLK RP3UJOSmcM2HgT9BBBCpiMnza8eFTc+eTmEyR0n4JnNO1c+2uC4tsbsQ+ 1R1QHB8Aq7YWdKN16IJANmJ1MaXImDOcFmYc4S67vO5Zs9oYg9Hn8uFb8 XxtLUwDn5y4BlbXselDCYvvnReAVeNdB3au5MVVa4dbfeagNbll8UgwQS 9VcQwwQ85al2rk2qHBA5sPh/1kKhTlxlh9Uk6gEMZ+Ytjis1vUVgS3xaU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="404002937" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="404002937" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 20:40:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="792377967" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="792377967" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 20:40:25 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH v2 1/2] soundwire: stream: remove bus->dev from logs on multiple buses Date: Wed, 22 Mar 2023 11:55:23 +0800 Message-Id: <20230322035524.1509029-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322035524.1509029-1-yung-chuan.liao@linux.intel.com> References: <20230322035524.1509029-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: Y3WITODAJY3HTF2DJM72ZKWNDXA5J5LG X-Message-ID-Hash: Y3WITODAJY3HTF2DJM72ZKWNDXA5J5LG X-MailFrom: yung-chuan.liao@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Pierre-Louis Bossart 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 Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- 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; } From patchwork Wed Mar 22 03:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liao, Bard" X-Patchwork-Id: 665928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B578CC6FD1F for ; Wed, 22 Mar 2023 03:42:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4829682B; Wed, 22 Mar 2023 04:41:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4829682B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1679456561; bh=7oltbiDa+C99YUXbLVwjWGGyIggLLejPqDsKsg5dlbo=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=J9Ga7bfMYv3n0dwj5ajKVvR8pyGk9Fy0Lq3qnQazDBnAyhib2EKOfkwWeCevPSmsD EUGQ27uWN9yrtPxD5+ASnFdjCX/ch0X1lj+i1E8acbZfONbMmTRBNeEBNxq50oqJI5 IwxVRdIkS2JIpbCH64W3dkjy218BPVx3j/VOk/o4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 64FF0F804FE; Wed, 22 Mar 2023 04:41:01 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CB621F802E8; Wed, 22 Mar 2023 04:40:56 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 10269F8027B for ; Wed, 22 Mar 2023 04:40:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 10269F8027B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=gwDeIrM4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679456449; x=1710992449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7oltbiDa+C99YUXbLVwjWGGyIggLLejPqDsKsg5dlbo=; b=gwDeIrM4dRVecmuktCoahOFEg1W8ubORBWuW8J7XJYQPVoB59X930OpW 2NmDbLPt5rcX233zE2iJAzFVlJ8Y6tyuPI+NZLYkbGTSm8fpnReSK9+kU d2LjjPGb2HMCGBDWabS/TaT/4nEiihvByTefnnnQN8qHOBILiBzR5Lz3L wItEAZ8Dr0f60RrlwK15Nq8MHeuRhePwMi41mzBu93CC2IATBgXOFaGk6 ZP/ZfhTgxX/5eKKBTxl99FFueTrARMvAzCXfPdFBNy0pbG4XtmINBJh2g p7me0Qm7eLp3rAD3TtuLEwrnL+wKh6kN/75wj+xlAwr95JwiyJXwV1hiL Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="404002941" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="404002941" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 20:40:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="792377975" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="792377975" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 20:40:27 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH v2 2/2] soundwire: stream: uniquify dev_err() logs Date: Wed, 22 Mar 2023 11:55:24 +0800 Message-Id: <20230322035524.1509029-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322035524.1509029-1-yung-chuan.liao@linux.intel.com> References: <20230322035524.1509029-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: GY6F5TYOZ2YP7DDWZH37XZLBJX72BJZT X-Message-ID-Hash: GY6F5TYOZ2YP7DDWZH37XZLBJX72BJZT X-MailFrom: yung-chuan.liao@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Pierre-Louis Bossart 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 Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- 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; }