Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3720418pxm; Tue, 1 Mar 2022 04:15:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbOMOM5jzOXbVZ+6eNjttNvfzo/wQf8EC6AhZkTAchkxI/U/d0Z1RVWLfxJn+LsCR3trds X-Received: by 2002:a05:6402:1d8d:b0:408:4a31:9790 with SMTP id dk13-20020a0564021d8d00b004084a319790mr24315943edb.92.1646136911246; Tue, 01 Mar 2022 04:15:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646136911; cv=none; d=google.com; s=arc-20160816; b=KePjeYgEMzRMZxBBCX3nWlFMJYFCtie0A9Dhrb/60Cm//xvuhUxcw7q4H52vakUz6J 25lgBFbqsh/5oBytk/fikpgodAZf6bXg67IQMQza8anQLNDYw5El30Dh2LW4Tml1Rjro U3iz6LT6LJuaTyo38jbtBZTGLgeuHNGxm7zxrWbcVJzjth/GII9vkxb0lyyRShDqVrew xaOcVvcLHrxqnGP2YO7mbL03x0bTHcZrt0R9UpwrVTEg8MjqFpjQFP4vPiyw5WZae6+f TssLTzZL/i38qlIZjBTHZm3YNVTglEYS4OkIFSOe3FnCLq7HxUxtFmpTlS/jwulPlaQV vOWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=muoYT4DaxbnQc9GcInQjEnzeB25UQDuQfv4475/4DHE=; b=XPtETIKO8VMCPWJFHVU6dCyivSLtMNd1IGwMW+i5a7166niIQaNR23rbmfGukgWL6+ ou/kmmXrWma5FUBWdrZhr6COmbpECQDEOHILgkzFseZOK1OCeGKQkEMc8VUttWkxFz+s 75Dy6R1o0/GQqFUG7JtjZFluv0D4OaSVeMsybfrptps3+GSJ41DtpPXX45zWnuaQeLHu BFuVz9Pgz7/PkO2ednvTdpuEdnk/xAk2bYPVCu1CBZVxDdwmiuoG2HlfhnfYPCqobw7P +gdigYNk6iJYZ/tc+K5EyNT5JZThZpq2mByCJH3cgK+XOXG1ccyCTzsibXmyzBB3dLhq HDHg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a1709060a8200b00698d2b0e0b5si7480408ejf.216.2022.03.01.04.14.46; Tue, 01 Mar 2022 04:15:11 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbiCALYd (ORCPT + 99 others); Tue, 1 Mar 2022 06:24:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbiCALYa (ORCPT ); Tue, 1 Mar 2022 06:24:30 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E151D92842; Tue, 1 Mar 2022 03:23:49 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB7B8ED1; Tue, 1 Mar 2022 03:23:49 -0800 (PST) Received: from [10.57.39.47] (unknown [10.57.39.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 373963F73D; Tue, 1 Mar 2022 03:23:48 -0800 (PST) Message-ID: Date: Tue, 1 Mar 2022 11:23:44 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] mmc: host: dw-mmc-rockchip: avoid logspam when cd-broken Content-Language: en-GB To: Peter Geis , Jaehoon Chung , Ulf Hansson , Heiko Stuebner Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220228223642.1136229-1-pgwipeout@gmail.com> From: Robin Murphy In-Reply-To: <20220228223642.1136229-1-pgwipeout@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 2022-02-28 22:36, Peter Geis wrote: > The dw_mmc-rockchip driver drops a large amound of logspam constantly > when the cd-broken flag is enabled. > Set the warning to be debug ratelimited in this case. Isn't this just papering over some fundamental problem with the clock? If it's failing to set the expected rate for communicating with a card, then presumably that's an issue for correct operation in general? The fact that polling for a card makes a lot more of that communication happen seems unrelated :/ Robin. > Signed-off-by: Peter Geis > --- > drivers/mmc/host/dw_mmc-rockchip.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c > index 95d0ec0f5f3a..d0ebf0afa42a 100644 > --- a/drivers/mmc/host/dw_mmc-rockchip.c > +++ b/drivers/mmc/host/dw_mmc-rockchip.c > @@ -50,8 +50,13 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios) > cclkin = ios->clock * RK3288_CLKGEN_DIV; > > ret = clk_set_rate(host->ciu_clk, cclkin); > - if (ret) > - dev_warn(host->dev, "failed to set rate %uHz\n", ios->clock); > + if (ret) { > + /* this screams when card detection is broken */ > + if (host->slot->mmc->caps & MMC_CAP_NEEDS_POLL) > + dev_dbg_ratelimited(host->dev, "failed to set rate %uHz\n", ios->clock); > + else > + dev_warn(host->dev, "failed to set rate %uHz\n", ios->clock); > + } > > bus_hz = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV; > if (bus_hz != host->bus_hz) {