Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3811477rwb; Fri, 30 Sep 2022 08:37:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sZPNvf+KfsvtG7MLjIBoNd5KJUkAkzP7ST+Tdwe587d1KBrx9o3JUZuqhWcLn9sd6VPkz X-Received: by 2002:a63:5a44:0:b0:431:fa3a:f92c with SMTP id k4-20020a635a44000000b00431fa3af92cmr8251621pgm.471.1664552257318; Fri, 30 Sep 2022 08:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664552257; cv=none; d=google.com; s=arc-20160816; b=L/2FZGITd/VeXDkSXKJmyuSfzSUU5tZ8MC4QE8uz3GQ+REFEPlkqcxOeWhveykSQhx aV7PvsGCwvqEf0F3/7DvgjfBqHThMrrRJf2qKOksLrbVdEIQ0J/VSSvlV4T7Qc0xx8QO lDgP1u+i9D1zKwHch4gmyY6j7bLeqB967Uw+zZyNqhcB+mQKY4YeuwaXhcH8T666zmbS ffe5sqvwaAOYIsn/5lp+/3Gpowfgfgfg1kbSYABzxmKVBjlShuND6wBxyUPkr0CUD5Jn GwXcoCR5vGpEf4fI47mauQSg53fLoKHCC9E53u7tZNdOekjWl3q5C1UT9l6eW47auDT9 9/wA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=bkGZlMCLcjGUMJh18RhP4Ctr01ZIOmKFkpG+F89/rcQ=; b=MmijUDggAvj/f71W7pcllcqTgWxjm0gIdeJ73zEnn956mKMU/mQykZzcJpXpLycb8j uCQ6th4Z8/asRfP8syBLb0z8uSO6d0e9aBKbbrmcxS+jE1ZxS1HQ46jWLGOb3CDEO1DQ +MlW8kT/SMa552aIXJY73zylRCVKjPPLjr+HJ6vz+x3YqPqOKo8XmCUnWnIYR4M9KYQW hB+1Vy9KPrGJC8xoYimFhzgRrAMveLRb3D7QKL8c+oR7BEG12SFx0WDshFtKMSu+LAuY s/70UBFg8kiuZD1rLNk1qibUZVfiCwdnTQpcmJVyTopOutWzRWoRyTlwbwwucQhNBzRy pkfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cybBlknO; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170902e74800b001782da3312asi3716270plf.299.2022.09.30.08.37.23; Fri, 30 Sep 2022 08:37:37 -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=@chromium.org header.s=google header.b=cybBlknO; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231281AbiI3PQA (ORCPT + 99 others); Fri, 30 Sep 2022 11:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbiI3PP4 (ORCPT ); Fri, 30 Sep 2022 11:15:56 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4E1DF056 for ; Fri, 30 Sep 2022 08:15:55 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id g1-20020a17090a708100b00203c1c66ae3so4516774pjk.2 for ; Fri, 30 Sep 2022 08:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=bkGZlMCLcjGUMJh18RhP4Ctr01ZIOmKFkpG+F89/rcQ=; b=cybBlknOX9/DfQdo0Xe980ssg21Q5o50iv9PUSvznC2qYrzK2NumO347QdFKTRyOHM FY4hfsYNXFezlLbuarWagHuoz1s+oVb5jXi5mtBx5Hg9andKcny+jCAmaPHHIkYeJkPX Nk2/IL12+8PjMxfSxrf2YNtcvLyJHguO1qIMQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=bkGZlMCLcjGUMJh18RhP4Ctr01ZIOmKFkpG+F89/rcQ=; b=ze2C3v1HGOAbmJrAMN3SPeAlSQXl5NlOSQJfSvtJldQ3ltbuuvJrDl/OZP0W0QlYJF VyOrfz4nxuxB4IVlcCuLyjm2KyF+zVJApVPtNU8hBDFc4kZu3t8RUg9ETX+cMrnFlD7Q 3yi2HBY+RurDiuEp1DTMYyIv7Mc7GpR1/rub7btDUnTcypC6esLjB0yrfGgVRpD+U2hZ XQOkJNJp7gRwjbr/SdhirSWR+mcXUAVMXEgmW6KFEi8pBIF8BHJ7fTVQR5xdjPsxXlyt 5++lGNlubRvYqRzJQxvj99K1ahcoROVutHgjcnMkG8Vp1QbcxeDCxreMfK7PE9Ld3N4w W9rQ== X-Gm-Message-State: ACrzQf3BbUFbpRGTpIaZv+mENGEs/A6h3LDWRLknJPXcmO3WwmxSw+Cd qUvxWp+W4kfSIV1v+h41aQIRh2TeqeY7xA== X-Received: by 2002:a17:90a:9b12:b0:203:9b0:284e with SMTP id f18-20020a17090a9b1200b0020309b0284emr10424274pjp.116.1664550954797; Fri, 30 Sep 2022 08:15:54 -0700 (PDT) Received: from judyhsiao0523.c.googlers.com.com (21.160.199.104.bc.googleusercontent.com. [104.199.160.21]) by smtp.gmail.com with ESMTPSA id z3-20020aa79e43000000b0053b9e5d365bsm1894355pfq.216.2022.09.30.08.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 08:15:54 -0700 (PDT) From: Judy Hsiao To: Heiko Stuebner Cc: Liam Girdwood , Lin Huang , Elaine Zhang , Shunqian Zheng , Rob Herring , Brian Norris , Mark Brown , Jaroslav Kysela , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Judy Hsiao Subject: [PATCH v1] ASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR Date: Fri, 30 Sep 2022 15:15:46 +0000 Message-Id: <20220930151546.2017667-1-judyhsiao@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 1. Uses regmap_read_poll_timeout_atomic to poll I2S_CLR as it is called within a spin lock. 2. Fixes the typo of break condition in regmap_read_poll_timeout_atomic. Fixes: fbb0ec656ee5 ("ASoC: rockchip: i2s: use regmap_read_poll_timeout to poll I2S_CLR") Signed-off-by: Judy Hsiao --- sound/soc/rockchip/rockchip_i2s.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 28c86f5e435e..a8758ad68442 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -162,12 +162,12 @@ static int rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) I2S_CLR_TXC | I2S_CLR_RXC); if (ret < 0) goto end; - ret = regmap_read_poll_timeout(i2s->regmap, - I2S_CLR, - val, - val != 0, - 20, - 200); + ret = regmap_read_poll_timeout_atomic(i2s->regmap, + I2S_CLR, + val, + val == 0, + 20, + 200); if (ret < 0) dev_warn(i2s->dev, "fail to clear: %d\n", ret); } @@ -220,12 +220,12 @@ static int rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) I2S_CLR_TXC | I2S_CLR_RXC); if (ret < 0) goto end; - ret = regmap_read_poll_timeout(i2s->regmap, - I2S_CLR, - val, - val != 0, - 20, - 200); + ret = regmap_read_poll_timeout_atomic(i2s->regmap, + I2S_CLR, + val, + val == 0, + 20, + 200); if (ret < 0) dev_warn(i2s->dev, "fail to clear: %d\n", ret); } -- 2.38.0.rc1.362.ged0d419d3c-goog