Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp865110rwn; Thu, 15 Sep 2022 07:30:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wetp8ft5Q6uBrBoGLhO6Zq0y2nvz/VE3b7izS76x3S2uLcRfOwziGj6c/Z09+tWxvogJZ X-Received: by 2002:a17:90b:4c46:b0:202:b9c5:2f24 with SMTP id np6-20020a17090b4c4600b00202b9c52f24mr10521503pjb.180.1663252228863; Thu, 15 Sep 2022 07:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663252228; cv=none; d=google.com; s=arc-20160816; b=QCFIQCXPCMAk4gQ4La3TUVMmjm6Z+SywBDg5IsEokWnF2NU7Fwx3CL0uMB0zRiyqiC 6IH//LBfWJtzVBmkByDP4VSXTwUibJJuLmRnCirFl/WLM23kUviMnB9wCdbYnBTyx847 I+xb7MSnTj4M86PKlOzUuxod3EOdmg/iIUEPStaoKwziqXZmQrzwkpsvxFHfQhcX3yPY vJCdhGyfaOFcHQD51FSGcgR150EDi0EOmlu8a7vkjK4xT9EjsrKykbphrie0bfYlD9pz 2KaReoGUa/gIUz8cWMh1Z5wNEKAWXTjeajagizmo2FFCIFxEG5Fj6D8lU43+4XcDOmcm SqXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=l01iLyM36JedOYdbzAtHbSm+ZQiW2nZAjHAJLtQOIws=; b=Q9+jDGMbWcDVdwbZ+J0k03E6qpZVY0sbtB//UNxCHfUm2uwpLVUiHm+4bPClzeipbL AZz9c7RbDrmQcoMEnfCUNtBaFXJbud3bIBf9fXnZWogI2XgGDRklHFEXmtktlLvXAVc+ cGX1bUC2UooYezOk3JyWofcVqGUm/PvM1L9ls6KcTCcDmZ7kPGet8JKQ4be5wnVjXvU6 ZwjxJPXiVuAwc8D/+VMkJkQ5e5dwmtrzglswnjxHyg23jYc+izBoU5LqKDBG/r1I6sfY F/a0jzAEa97hhOKSs+Ce2FYIkHbv7x5RpkjPSFSu0qELHwcRrV91rcbh9wXbPZUfcUmc wdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b=K5TAwaPZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa11-20020a17090b1bcb00b00202c45a05basi7395251pjb.73.2022.09.15.07.30.15; Thu, 15 Sep 2022 07:30:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b=K5TAwaPZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbiIONqL (ORCPT + 99 others); Thu, 15 Sep 2022 09:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiIONpk (ORCPT ); Thu, 15 Sep 2022 09:45:40 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE546E89F; Thu, 15 Sep 2022 06:45:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663249513; bh=l01iLyM36JedOYdbzAtHbSm+ZQiW2nZAjHAJLtQOIws=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=K5TAwaPZbHU8pEC1ODHmVk2rGZNxvX8lP1CrhlLin+uAdeE//NklaLbliGyuO37GS 1aD+jCZlo1q28wPfikTP0ks7osCFIaqDUy2T2ilc+0qWxTJ4lONe3Njl7HZGlO/K08 VKw4qsdaRXa7xW7ULNnDcMlFOQcCRig6u4y+RNNI= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: [PATCH v2 04/11] ASoC: cs42l42: Split probe() and remove() into stages From: =?utf-8?Q?Martin_Povi=C5=A1er?= In-Reply-To: <2839a437-a57a-ffc4-da8e-dde9a9a9a5cc@opensource.cirrus.com> Date: Thu, 15 Sep 2022 15:45:10 +0200 Cc: James Schulman , David Rhodes , Lucas Tanure , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Charles Keepax , ChiYuan Huang , Matt Flax , Lukas Bulwahn , Pierre-Louis Bossart , - , Linux-ALSA , devicetree@vger.kernel.org, Linux Kernel Mailing List , asahi@lists.linux.dev Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220915094444.11434-1-povik+lin@cutebit.org> <20220915094444.11434-5-povik+lin@cutebit.org> <2839a437-a57a-ffc4-da8e-dde9a9a9a5cc@opensource.cirrus.com> To: Richard Fitzgerald , Mark Brown X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 15. 9. 2022, at 14:20, Richard Fitzgerald = wrote: >=20 > On 15/09/2022 10:44, Martin Povi=C5=A1er wrote: >> From: Richard Fitzgerald >> To prepare for adding SoundWire the probe must be split into three >> parts: >> 1) The bus-specific probe >> 2) Common bus-agnostic probe steps >> 3) Initialization of the peripheral registers >> Step (3) must be separate because on SoundWire devices the probe must >> enable power supplies and release reset so that the peripheral can be >> enumerated by the bus, but it isn't possible to access registers = until >> enumeration has completed. >> The call to devm_snd_soc_register_component() must be done at stage = (2) >> so that it can EPROBE_DEFER if necessary. In SoundWire systems stage = (3) >> is not a probe event so a deferral at this stage would not result in >> re-probing dependencies. >> A new init_done flag indicates that the chip has been identified and >> initialized. This is used to prevent cs42l42_remove(), = cs42l42_suspend(), >> cs42l42_restore() and cs42l42_irq_thread() from attempting register >> accesses if the chip was not successfully initialized. Although this >> cannot happen on I2C, because the entire probe would fail, it is >> possible on SoundWire if probe succeeds but the cs42l42 is never >> enumerated. >> Signed-off-by: Richard Fitzgerald >> Signed-off-by: Martin Povi=C5=A1er >> --- >> sound/soc/codecs/cs42l42.c | 127 = +++++++++++++++++++++++++------------ >> sound/soc/codecs/cs42l42.h | 2 + >> 2 files changed, 87 insertions(+), 42 deletions(-) >> diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c >> index 11cb659f03e0..427b29db2252 100644 >> --- a/sound/soc/codecs/cs42l42.c >> +++ b/sound/soc/codecs/cs42l42.c >> @@ -1627,7 +1627,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, = void *data) >> int report =3D 0; >> mutex_lock(&cs42l42->irq_lock); >> - if (cs42l42->suspended) { >> + if (cs42l42->suspended || !cs42l42->init_done) { >> mutex_unlock(&cs42l42->irq_lock); >> return IRQ_NONE; >> } >=20 > This doesn't apply to broonie/for-next. Needs rebasing onto commit: > ea75deef1a73 ("ASoC: cs42l42: Only report button state if there was a > button interrupt") It did apply to broonie/for-6.1 roughly at the time of posting, but since then the merge commit 12e51866c79f ("ASoC/qcom/arm64: Qualcomm ADSP DTS and binding fixes=E2=80=9D) brought in changes into = broonie/for-6.1 from elsewhere, I guess from broonie/for-next. (I am not sure this was intentional.) Since the series still applies in a 3-way automerge (git am -3) on top of the new for-6.1 or for-next, I checked the automerge result and also considering the other commit ea75deef1a73 touches an unrelated part of cs42l42_irq_thread, I am not considering this an issue, that is unless Mark says it is. Martin