From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7FFDC433E1 for ; Mon, 17 Aug 2020 14:31:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4D9E520729 for ; Mon, 17 Aug 2020 14:31:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="pAc6Nlkj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D9E520729 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9AC3716BF; Mon, 17 Aug 2020 16:30:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9AC3716BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597674672; bh=x1mPW2IlbzKPi21BeGGjuXFp+W8qBk7GLahgZuqMOSw=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pAc6Nlkjy5zve9Kt+3xM0W8ElQF9GzvEqGbm8nvM1Wl9DKuZBOR+IGU7+1rKwDXBU +KE+VurCGYkk8o4DOKNdF5whIrUJrXsnKy6eTH1qWCwiApTOEJ5GeZxPPCdaKGwszj FjU2ALkESw8JtbqzSCR7TeuUOmOei7nBQxXMBB/8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 37EDEF80216; Mon, 17 Aug 2020 16:30:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 43E51F80218; Mon, 17 Aug 2020 16:30:20 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 6BC0AF800EF for ; Mon, 17 Aug 2020 16:30:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6BC0AF800EF IronPort-SDR: /OoT8e+cEP/zfmGFyfs6FPXRC/3uExvjdccauOHVCcfAx7ePCl/zZszqL6/vkcuMHswfXbkKeQ wsp/CfM3xFmA== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="142340537" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="142340537" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 07:30:06 -0700 IronPort-SDR: rb9oDKBZ7Q6nZ+8PBCrPMVYTd0fot1WnZvQ1lnkpz12w55ZRqXvdhKbos46SyzTXYT2iT4PLxf tiCRjcbDK3zQ== X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="292450642" Received: from abhishik-mobl1.amr.corp.intel.com (HELO [10.212.204.20]) ([10.212.204.20]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 07:30:03 -0700 Subject: Re: [PATCH 09/13] soundwire: intel: add CLK_STOP_BUS_RESET support To: Vinod Koul , Bard Liao References: <20200721203723.18305-1-yung-chuan.liao@linux.intel.com> <20200721203723.18305-10-yung-chuan.liao@linux.intel.com> <20200817114729.GP2639@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: <8aac898f-92d3-c907-ebb8-4642a618645b@linux.intel.com> Date: Mon, 17 Aug 2020 09:30:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200817114729.GP2639@vkoul-mobl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org, tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, mengdong.lin@intel.com, slawomir.blauciak@intel.com, sanyog.r.kale@intel.com, rander.wang@linux.intel.com, bard.liao@intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" >> + } else if (clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET) { >> + ret = sdw_cdns_clock_stop(cdns, true); >> + if (ret < 0) { >> + dev_err(dev, "cannot enable clock stop on suspend\n"); >> + return ret; >> + } >> + >> + ret = sdw_cdns_enable_interrupt(cdns, false); >> + if (ret < 0) { >> + dev_err(dev, "cannot disable interrupts on suspend\n"); >> + return ret; >> + } >> + >> + ret = intel_link_power_down(sdw); >> + if (ret) { >> + dev_err(dev, "Link power down failed: %d", ret); >> + return ret; >> + } > > no cleanup on all the error cases here? See above the 'else if' test, the clock stop on suspend will be followed by a bus reset on resume. this is essentially a complete bus restart. The only open here is whether we should actually return an error while suspending, or just log the error and squelch it. We decided to return the status so that the pm_runtime suspend does not proceed: the state remains active which is easier to detect than a single line in a dmesg log.