Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472571pxj; Mon, 10 May 2021 03:57:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMl7gfdYC70J8oEgYdA3uKIByPl2++a/mx/QAWg6N0F9GQW7FtLR/2u7T4yAtk7nVjxFyy X-Received: by 2002:a02:77d6:: with SMTP id g205mr21400830jac.48.1620644257102; Mon, 10 May 2021 03:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644257; cv=none; d=google.com; s=arc-20160816; b=QzZZefw0KqepGKHU9UIItbo14JL10xEoK3xYZAXjmH/mPSWd6loKwL/VzuITqUooZx OWYRW53sf/2RAFAYBLWhQbNWzxJVVFLP01uPDf9ObA3U0F3vyjSArVc1Ic2o2ZSZYLLE Ni+68LNYakChKeiqA0PSKO/Wrehohk7q6h21+oYR/GnPanv8zRgCCRgWx3MnlBnCrawg ganen1oPcYDbWGxg1ZioDUIuMtXm1FwxaK2tkZys4OjfSyRri48XEwYFy37fbacptlxU MT2YdgKlitbStnUncAKssa2D3D3sdwjfh68qpQHp8EtLc5fMV/SRi/9yAxDuUgaA6uZE 2GBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J7G8j9EjYTu1A1lA6MFYzCNMwUzCzobBjNH5Cs6H2eo=; b=oQ7earkBDDWO/FulAQ89kLz5CjkTWrbysdTYnCc1kSZ8CxMAH3vUoLofpW/rfejojJ W0Iv5SAlEkC7Of71DWjDgCPDzMtkq7fa0iwYb6tOFq8pNzbLZLjxmS53jdsij2qCFqy4 /Ezns76XyQ6d42CFudBgoiN5codZpgjam5+O9KR4lrf7qK/sy8ws8v3mSoR7v89/aIMW san0KP3h8UlDPW4hzjS7vS6I3azqbW3UlIdF3cx4LjY9YA4S2I0SmfaAXkC71wu1UywU 4DXBMurQu4apkfFpcFTU45L9i7NjJ31j1q8w8du4WPWjKbi94CeL4F+brnCFbkBCqbvA 6G1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJEI7AaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si15237505ios.101.2021.05.10.03.57.24; Mon, 10 May 2021 03:57:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJEI7AaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234467AbhEJK4c (ORCPT + 99 others); Mon, 10 May 2021 06:56:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232939AbhEJKot (ORCPT ); Mon, 10 May 2021 06:44:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C57AB60FEF; Mon, 10 May 2021 10:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642858; bh=LA6Ma9Mkff5sGOh44Iak88G5CwKZjRia7yCDTAsBC2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJEI7AaL7ebZx8iSqvhypjEZO2sFRkKpa5zEzILicMvNNWfrnfXdSF6xrmctFiDEw a407bfPn9gRROl8qTnOHMkYmUOde/fgUjvMOAkOK/g13g1iZVWinLHNn4GnYzg51Lw M+HUuIqOCiHUZkCEGlmU+GeJQqhngaiyMCExbDSg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Guennadi Liakhovetski , Bard Liao , Vinod Koul , Sasha Levin Subject: [PATCH 5.10 079/299] soundwire: cadence: only prepare attached devices on clock stop Date: Mon, 10 May 2021 12:17:56 +0200 Message-Id: <20210510102007.541949502@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit 58ef9356260c291a4321e07ff507f31a1d8212af ] We sometimes see COMMAND_IGNORED responses during the clock stop sequence. It turns out we already have information if devices are present on a link, so we should only prepare those when they are attached. In addition, even when COMMAND_IGNORED are received, we should still proceed with the clock stop. The device will not be prepared but that's not a problem. The only case where the clock stop will fail is if the Cadence IP reports an error (including a timeout), or if the devices throw a COMMAND_FAILED response. BugLink: https://github.com/thesofproject/linux/issues/2621 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20210323013707.21455-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/cadence_master.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 580660599f46..c6d421a4b91b 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -1449,10 +1449,12 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake) } /* Prepare slaves for clock stop */ - ret = sdw_bus_prep_clk_stop(&cdns->bus); - if (ret < 0) { - dev_err(cdns->dev, "prepare clock stop failed %d", ret); - return ret; + if (slave_present) { + ret = sdw_bus_prep_clk_stop(&cdns->bus); + if (ret < 0 && ret != -ENODATA) { + dev_err(cdns->dev, "prepare clock stop failed %d\n", ret); + return ret; + } } /* -- 2.30.2