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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E81C83F2C for ; Tue, 5 Sep 2023 16:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243787AbjIEQte (ORCPT ); Tue, 5 Sep 2023 12:49:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354035AbjIEJXk (ORCPT ); Tue, 5 Sep 2023 05:23:40 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1966CE9 for ; Tue, 5 Sep 2023 02:23:37 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3858Ps8D028086; Tue, 5 Sep 2023 04:23:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=PODMain02222019; bh=A5TyNX6jAAZJVYx 1al7IpQ/nzgp4zrymgxX3vCsoSPo=; b=mCULNmPqss2LMG2708SMYkk5yL64WzV NxHdskX3tsW/hlrV35bBslHn6qWM0M64w6BvsDhe0Lcka9JKNAqA8UryJw8IYRoe z+KkmX0Sq+yJFs8vktUhpOmTnL+2DhCoY3tuUr82A1IdYj+o+2x8XNZEB1lNymHh wgwkydse8QJkuEt/DR6ME6y9pQ8hY/LVR3Avfj43EfM+OZvo9svwyFLRopefRKiI a0Ar8AQ6Zd1/E/k0VCWvEASo4imNKdVv3XBnlmZHCWtE8MsL/2dVEvbHaZR3osC4 xbHwJc6DgnkM+w8Uqg3kVnBxPPWX4zWyIFjZjidoejh15s/2hWREArQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3sv1fhtrr0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Sep 2023 04:23:23 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 5 Sep 2023 10:23:21 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Tue, 5 Sep 2023 10:23:21 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 8CC2215B9; Tue, 5 Sep 2023 09:23:21 +0000 (UTC) Date: Tue, 5 Sep 2023 09:23:21 +0000 From: Charles Keepax To: Cristian Ciocaltea CC: James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai , "Liam Girdwood" , Mark Brown , "Stefan Binding" , , , , Subject: Re: [PATCH 2/9] ASoC: cs35l41: Handle mdsync_up reg write errors Message-ID: <20230905092321.GE103419@ediswmail.ad.cirrus.com> References: <20230902210621.1184693-1-cristian.ciocaltea@collabora.com> <20230902210621.1184693-3-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230902210621.1184693-3-cristian.ciocaltea@collabora.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-ORIG-GUID: 1_U13ttigB6Vwz3pa-MygkYcswIclzem X-Proofpoint-GUID: 1_U13ttigB6Vwz3pa-MygkYcswIclzem X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 03, 2023 at 12:06:14AM +0300, Cristian Ciocaltea wrote: > The return code of regmap_multi_reg_write() call related to "MDSYNC up" > sequence is shadowed by the subsequent regmap_read_poll_timeout() > invocation, which will hit a timeout in case the write operation above > fails. > > Make sure cs35l41_global_enable() returns the correct error code instead > of -ETIMEDOUT. > > Additionally, to be able to distinguish between the timeouts of > wait_for_completion_timeout() and regmap_read_poll_timeout(), print an > error message for the former and return immediately. This also avoids > having to wait unnecessarily for the second time. > > Fixes: f8264c759208 ("ALSA: cs35l41: Poll for Power Up/Down rather than waiting a fixed delay") > Signed-off-by: Cristian Ciocaltea > --- Acked-by: Charles Keepax Thanks, Charles