Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2833435rdb; Wed, 15 Nov 2023 11:51:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEq8uNNtMNyBgiu1AEd6v4XdTwhhHVL2w8ktArdRtxmd8TYg7Qx6aGmULBoCX4Dl3h3eqvm X-Received: by 2002:a17:90b:390c:b0:280:29e8:4379 with SMTP id ob12-20020a17090b390c00b0028029e84379mr12378432pjb.34.1700077898534; Wed, 15 Nov 2023 11:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700077898; cv=none; d=google.com; s=arc-20160816; b=ChQbIKl8SjzK7Tzf2vQnfDpx+/Qz87f0MeI0auxAhE48WRd0erzd5MvCjycNs4l9kU uYKR7p782bY+kHL23Riv7/nELZcX4QYh1IdMhQcXV/loa9AATCEXieq9/pI2VN8ro0wK t6ODG9tp5wAOsqv6QmZE4NygIEDCpJqLGv+x1VUekdVwNiwE2eaTGpguEOousf+dz4SA keTDRLZJEIJrcpkSGZlPxcVmkuvur1rEsrAwRUBOovqygzQC7FjQvNWjlId6uA2urAwO BSI70xhQqJSnjhgfdnxm6mSWLrLleUWS02eEH8WVi24GbI8CGHceeIXlAKJAYFRqzQDr FSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=L6y9O8UNNsImXcfrIDPmuZhWZTA92x2spXOwvRrUumY=; fh=nNaLkbBBRcuJbi1O9kaFnkcZWsAEJKZEbYFWJt7S0GQ=; b=SB3pEAZaXEfRFfPO1j9+G3W6ecyvvnpVL0UgPO6azW0XxoFsapMnBNEcX8I2pmv5JX CLbs/q/xRJ9z4VmpWzJpU+3YErqAUHfiaCf8BUg0brX7xxXuKWG2FCbgQjnHQbR777LD ue8tZrQ4VT5FhUrbqKbZgG5R1VprrxOtHFg7aNdBEpfMf3k0WiVp7uxJq6DlsLqewgUj j/JyCjj5NkXmJ2JASbp9Aj1gD/EEYvA18lZewleARLCoC1xS16CaoSPsQ3rK2aldxXxd zptGUDoyXuKxxxp2H3iBkB/U4mdTnPsJvozM70mSdbQ0jUghXzJTEPYgRCb3yhDNL16E Fl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ERrwPOZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o15-20020a17090a9f8f00b00280708b2eaasi352444pjp.158.2023.11.15.11.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 11:51:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ERrwPOZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D8A728093F4A; Wed, 15 Nov 2023 11:51:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbjKOTvX (ORCPT + 99 others); Wed, 15 Nov 2023 14:51:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235435AbjKOTvV (ORCPT ); Wed, 15 Nov 2023 14:51:21 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844BAAB; Wed, 15 Nov 2023 11:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700077878; x=1731613878; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ngiPfeziv8PT2BpwQ1I8V9zHtCUA2oybBprQ4dI1p18=; b=ERrwPOZZo5J9JMwCDDOziEKjTFyJL9QKbG+UZCfZGQRMMdh2LXvBLNiv s0TpFMLQJCT3ikWBgm3aTpFabujzQg47gi18Hp1KuTr1n8vi0AwhoLb0E wr00hyjoetxG/t7DOpyFlQx/eRaEWaH26G/ZI/WVyN/DZF9txiJ4rRO96 SeoN7qlVRyl58rhpmfSE53Xu2ex14RlxQ11tEJV0B5Gu+Mid+sBJNaNRM O9SkdlEBga1/GNRn4JFwfcBb2+glar9jBqlDASnOsVRl41Lc24nZafM/b d1uZLdBTuWIGoAmD89HXLn6iaIwst7iquebIGldYRyUCff8Hu4VduMNp4 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="477165501" X-IronPort-AV: E=Sophos;i="6.03,305,1694761200"; d="scan'208";a="477165501" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 11:51:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="741528085" X-IronPort-AV: E=Sophos;i="6.03,305,1694761200"; d="scan'208";a="741528085" Received: from ipaliych-mobl2.amr.corp.intel.com (HELO [10.212.183.137]) ([10.212.183.137]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 11:51:15 -0800 Message-ID: <05147111-e46b-42a5-9e99-ec289e61730f@linux.intel.com> Date: Wed, 15 Nov 2023 13:51:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] soundwire: amd: add an error code check in amd_sdw_clock_stop_exit Content-Language: en-US To: "Mukunda,Vijendar" , Su Hui , vkoul@kernel.org, yung-chuan.liao@linux.intel.com, sanyog.r.kale@intel.com, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org References: <20231115095407.1059704-1-suhui@nfschina.com> <3e461bb5-fa6b-4729-8ff5-ccc1d2887066@linux.intel.com> <5729c613-182b-43d2-a2ed-caff046b68e7@amd.com> From: Pierre-Louis Bossart In-Reply-To: <5729c613-182b-43d2-a2ed-caff046b68e7@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 11:51:35 -0800 (PST) >>> diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c >>> index 3a99f6dcdfaf..f391b541f4b7 100644 >>> --- a/drivers/soundwire/amd_manager.c >>> +++ b/drivers/soundwire/amd_manager.c >>> @@ -1029,6 +1029,10 @@ static int amd_sdw_clock_stop_exit(struct amd_sdw_manager *amd_manager) >>> ret = readl_poll_timeout(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL, val, >>> (val & AMD_SDW_CLK_RESUME_DONE), ACP_DELAY_US, >>> AMD_SDW_TIMEOUT); >>> + if (ret) >>> + dev_err(amd_manager->dev, "%s: timed out: %pe\n", __func__, >>> + ERR_PTR(ret)); >> Is this really the desired behavior? >> >> This patch fixes the static analysis issue by logging the error code, >> but does it make sense to continue resuming here and trying to exit from >> the clock stop mode? >> >> At this point a bus reset might be a more relevant behavior... > As per earlier discussion, when we sent the initial patch series, > It was communicated that even clock stop sequence fails, > return '0' in suspend/resume callbacks that why we returned > status as zero. clock stop is for suspend and clock stop exit for resume. Different problems. > In this scenario, it's not continuing resume when clock stop exit > sequence fails. Even In Intel's case, if the clock stop sequence fails, > just code is exiting from that sequence. that's right, in the Intel SoundWire drivers we never prevent the pm_runtime suspend from happening, and discard any errors. In the resume step we do a bus reset anyways. But that's different here, this is the clock stop exit which happens on resume and IIRC there is no bus reset. If the resume fails, what is the expected behavior? If you keep going then you are going to have other issues down the road. >> >>> if (val & AMD_SDW_CLK_RESUME_DONE) { >>> writel(0, amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL); >>> ret = sdw_bus_exit_clk_stop(&amd_manager->bus); >