Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp864356pxf; Wed, 7 Apr 2021 13:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0RTAQ1zbGXY5fV5Xlx+0Ae5/QTWS+E4JllZcooEHj6Wo6FIcCSvgotco/qv4tMCmM+eQi X-Received: by 2002:a17:906:8692:: with SMTP id g18mr1681669ejx.23.1617827807335; Wed, 07 Apr 2021 13:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617827807; cv=none; d=google.com; s=arc-20160816; b=0sGciD7mxcW8ZSmXFeP5JprvPqT9lkJEuJbfWe6UPF8B02q8Ui6xDRdM0gwaFTW3hz 0o6IhpXG2ohfK/HSUDlq2tGPHoJtoRnD3KvvQlBpis3AXsoShbioy71Bp8JRSKh4h4Bk UZny7pYwt0QAwJBRvKwf4DATLsnn4XTXvlvxnb9FEPix4v2T95aeOEB+kyzTNRqfVd3a Fbg18j0X44Bn0djT2dDcNOAWHB485Y+JtRtpfqNbaYJZ+ttsLL1BaBjlZepRMBSgLNLx qczIzBGzpEG+0fH2bH5B1EFOdz4Fbqjp/yvcCQDXmfmeLWawJElwpGpmIDEtpTHOd1zU L7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id; bh=hxZH5Eo1DJbgxqp+IXfknnbGuvcV2LYW4Ynl4NQY+KQ=; b=I0NK+3mUTHBuFyUmfzHpKAwgmrSm68dhEtqQZnMPKSE0m6m3Q7E06U9K2VJYo/OEiz Bb9Jgzt12Dpj903jz6XvwrtmMmORwj6e9KMpnAJqyJ+HKtJDjH9u9+1tbNxwg1wiuDqe a/cTM8Ki+YJFNx2xK/bHh/l4HypF/O/BKpxE/CrZcCYFwZMZi30ODk3jiGyw/zNqHe0/ qrFUPWGjRGTWCliimp76hNZZBo0RH5fHss02UTFNvrDmsZQhY8k3r4URCLuJHmySKP6P lVTW+M+hjps5tdyNoZJAqyLSrwNGQAVv3pNIBBoUkw1zIMMLvPIWQ1xJphDt2q3ERD8O EqIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si11304822edb.202.2021.04.07.13.36.23; Wed, 07 Apr 2021 13:36:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349697AbhDGIr3 (ORCPT + 99 others); Wed, 7 Apr 2021 04:47:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:36716 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349662AbhDGIqo (ORCPT ); Wed, 7 Apr 2021 04:46:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8FC34AFAA; Wed, 7 Apr 2021 08:44:41 +0000 (UTC) Message-ID: <25e9fc3bedd8f97dd151b1f36d752f032c6ec628.camel@suse.de> Subject: Re: [PATCH 2/3] mmc: sdhci-iproc: Cap min clock frequency on BCM2711 From: Nicolas Saenz Julienne To: Stefan Wahren , Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Ray Jui , Scott Branden , Ulf Hansson , Stefan Wahren , Matthias Brugger , Adrian Hunter , Ray Jui , Scott Branden Cc: f.fainelli@gmail.com, phil@raspberrypi.com, tim.gover@raspberrypi.com, alcooperx@gmail.com, linux-kernel@vger.kernel.org, robh@kernel.org Date: Wed, 07 Apr 2021 10:44:39 +0200 In-Reply-To: <2d40b062-5809-15ce-b9d1-651644ff6e22@i2se.com> References: <20210406104802.20898-1-nsaenz@kernel.org> <20210406104802.20898-3-nsaenz@kernel.org> <2d40b062-5809-15ce-b9d1-651644ff6e22@i2se.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-tGvxp0AIZJH+Ku21vLzc" User-Agent: Evolution 3.40.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-tGvxp0AIZJH+Ku21vLzc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2021-04-06 at 19:59 +0200, Stefan Wahren wrote: > Hi Nicolas, >=20 > Am 06.04.21 um 12:48 schrieb Nicolas Saenz Julienne: > > There is a known bug on BCM2711's SDHCI core integration where the > > controller will hang when the difference between the core clock and the > > bus clock is too great. Specifically this can be reproduced under the > > following conditions: > >=20 > > - No SD card plugged in, polling thread is running, probing cards at > > =C2=A0=C2=A0100KHz. > > - BCM2711's core clock configured at 500MHz or more. > >=20 > > So set 200MHz as the minimum clock frequency available for that board. > i think it should be 200 kHz? Of course... Sorry for that. Regards, Nicolas > >=20 > > For more information on the issue see this: > > https://lore.kernel.org/linux-mmc/20210322185816.27582-1-nsaenz@kernel.= org/T/#m11f2783a09b581da6b8a15f302625b43a6ecdeca > >=20 > > Fixes: f84e411c85be ("mmc: sdhci-iproc: Add support for emmc2 of the BC= M2711") > > Signed-off-by: Nicolas Saenz Julienne > > --- > > =C2=A0drivers/mmc/host/sdhci-iproc.c | 18 ++++++++++++++++++ > > =C2=A01 file changed, 18 insertions(+) > >=20 > > diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-ip= roc.c > > index ddeaf8e1f72f..1ef888e91f73 100644 > > --- a/drivers/mmc/host/sdhci-iproc.c > > +++ b/drivers/mmc/host/sdhci-iproc.c > > @@ -173,6 +173,23 @@ static unsigned int sdhci_iproc_get_max_clock(stru= ct sdhci_host *host) > > =C2=A0 return pltfm_host->clock; > > =C2=A0} > > =C2=A0 > >=20 > > +/* > > + * There is a known bug on BCM2711's SDHCI core integration where the > > + * controller will hang when the difference between the core clock and= the bus > > + * clock is too great. Specifically this can be reproduced under the f= ollowing > > + * conditions: > > + * > > + * - No SD card plugged in, polling thread is running, probing cards = at > > + * 100KHz. > > + * - BCM2711's core clock configured at 500MHz or more > > + * > > + * So we set 200MHz as the minimum clock frequency available for that = SoC. > > + */ > > +static unsigned int sdhci_iproc_bcm2711_get_min_clock(struct sdhci_hos= t *host) > > +{ > > + return 200000; > > +} > > + > > =C2=A0static const struct sdhci_ops sdhci_iproc_ops =3D { > > =C2=A0 .set_clock =3D sdhci_set_clock, > > =C2=A0 .get_max_clock =3D sdhci_iproc_get_max_clock, > > @@ -271,6 +288,7 @@ static const struct sdhci_ops sdhci_iproc_bcm2711_o= ps =3D { > > =C2=A0 .set_clock =3D sdhci_set_clock, > > =C2=A0 .set_power =3D sdhci_set_power_and_bus_voltage, > > =C2=A0 .get_max_clock =3D sdhci_iproc_get_max_clock, > > + .get_min_clock =3D sdhci_iproc_bcm2711_get_min_clock, > > =C2=A0 .set_bus_width =3D sdhci_set_bus_width, > > =C2=A0 .reset =3D sdhci_reset, > > =C2=A0 .set_uhs_signaling =3D sdhci_set_uhs_signaling, --=-tGvxp0AIZJH+Ku21vLzc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmBtcPcACgkQlfZmHno8 x/52Jgf+N8kWfn+v2p/Ij2knXikk1L0/UbLfSkffUvHLSJ3lSSqzbHoS5cWE5cWT Bw1ln4+GmxoCVmJcBlHwsML5w+IgV5mw5AhYnnGLVfb9kAKyxDKupRdE2GcrKMA7 dYPd4Pd6vzGl244qEcHC2If/zy3oEoWrRs/Kci/6lvithzqxB4IOPV3aKRIEc+sS PRKt2j+jEv3NO9r08YvnU9shK4muX5VH29gp+x8s+VlW1yRKCj0L5PJ1Au5y7AcF gX8IvW+YVRY8z7fYhh8MnKEk0WVV1qvOk3Zyfut4P/wfwCzIcA2Yb7/Bvd7EgXz0 NTKjPFG+Fhc4l1TuNoc4xmR1eFKDKA== =afNN -----END PGP SIGNATURE----- --=-tGvxp0AIZJH+Ku21vLzc--