Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp424328rdb; Fri, 17 Nov 2023 02:52:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDiDRfXg8WbqmrS8bLB5ncusVPezFdnGs4/iaUOvon099YBc3EJjOoah1ui6RKqZvflS4T X-Received: by 2002:a05:6a20:be1b:b0:187:db43:d1b1 with SMTP id ge27-20020a056a20be1b00b00187db43d1b1mr3361619pzb.24.1700218350967; Fri, 17 Nov 2023 02:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700218350; cv=none; d=google.com; s=arc-20160816; b=Tkl9xXUeCE+SaM+bgWs+XID9FtkKCgcXX0F1vm0tpRB7wUzqZjBsA6Vf2bTdD6zLBM kZ1aGq2kjyPGB1dVfy8nrHRYqOkSbNKyD72jCYp5wfjJPscyDO18Y8iJn4Dm8wHGyceY cLL1BNHh+P/9Op2QLAM7ClBAvONELkfK7flzC7nL6d0HKnyJgprlmu/hPuRYDJNzUsOY KIVxbXqxkjCIPPu6InleFNxoHRqDXHKiwVktVj/tt1FyrXaGz4ec9Yxb2yXXdYN6BxjS L90z3tXRBP1+DHYjTRyn9+w/7E3jJHl0DQg5tHqa3C1T5vR7kqUly4xzM+6UCasRkiva +wNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=aOnhfMhQ8ywLqjdb9/65uRtIbUiORGE+C3/Bf4quGCw=; fh=E9dRX3P9+1ACoiVN3TLqgt71N7WLrYiSbf3DtPzMktQ=; b=0IxbApuEpmNDUeIoH6fYXU46PNkymn1JruOfRkA+OfyaVEkv9vifyi5WLsQBAglgN6 FAqepVyNWxdQKaGg5v6ZgCL6L4U9NA9mX1Lcry1exXCEOQkSnmnvgFAETGon9Gwiv7Qd bERuf4HIkqoZjP0MTTdckIcUX1r1vPweWfedWVGl2HKrZmJv6fcfzbM8wOBEv20CB1mR 06s7Zkf2xDs/8IP1LQc/bC+sXusyxfhfPrGlQsPIPJUgAbwc0tDhCMy9Y/qn9BJrf4A3 A+POvmdwGyhdcu8mjHNaHXRERU7zoLY0dcbCba0hf3BCj/R9Wn41gQZdyWsKh/6gwB4x r/Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ldE4Ewcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k134-20020a62848c000000b006bd9ff6dab2si1651579pfd.377.2023.11.17.02.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:52:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ldE4Ewcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E8E5180BC503; Fri, 17 Nov 2023 02:51:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346097AbjKQKvE (ORCPT + 99 others); Fri, 17 Nov 2023 05:51:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbjKQKup (ORCPT ); Fri, 17 Nov 2023 05:50:45 -0500 Received: from mail-vk1-xa2a.google.com (mail-vk1-xa2a.google.com [IPv6:2607:f8b0:4864:20::a2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61065D57; Fri, 17 Nov 2023 02:50:33 -0800 (PST) Received: by mail-vk1-xa2a.google.com with SMTP id 71dfb90a1353d-4ac20c41e82so684094e0c.1; Fri, 17 Nov 2023 02:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700218232; x=1700823032; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aOnhfMhQ8ywLqjdb9/65uRtIbUiORGE+C3/Bf4quGCw=; b=ldE4EwcqbHvN+uMNqFPhdKRR0HVcsdQbxALMfJkmbG0xWWfym5Ex4he0wZAVm98I2c HGXLxoKPQ5FlbV8MFRU6NQ0hf+CxLCsP2U3W9IzMLocoMCArg5CterQ9ZYhmU89GWyk9 R5aQB9ZdauhkVfIXSQRONlaWKePrqY8WBLTWnBXB5wxkmEt6ubzZESxCndBraSU7QeaD xA+Sg0yGWNeaCYtFw/iAHkufj85pxUl8xhFIWTWTWYK7feq7ZDGwLBUU1XhI/wMAQQN/ L5KA8bpXuXG7snw+eBBLNfVl8uIBm3+TX05lfrbofjLaeS6bAlcOLMY6zoy49lizbGUk MOKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700218232; x=1700823032; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aOnhfMhQ8ywLqjdb9/65uRtIbUiORGE+C3/Bf4quGCw=; b=dOBfn76UmPlG6tqSDYmJ2jcpE1sbxN1wlUqyImYz3YCPQ9H/TkdIIUVtYKOuRq9Wqv 9GA67SW2qKSOFZge8QAq1jixBnTHUKUxVQ7z8IMnXvt99clduI2xq32i7ZfaRhbykVm3 uC3TGN0a97wk9lSz7ElJx0nwUN2Pwq/dH49BPnWiXBuuASGTjlEg33P3V23c0Lj7MjFM 5s+LYFTtCWNy5oxouJHBoj6mbbMgL9pSa7sgNjCanlZo5w+muRcLmG3zYFHQ4KZUAJqT 9jTenaJO0F52AeXc1hMLT0Qj5UsQbDNCYLutkmP67tQxOLp9YmAwJzyeY0vPOZNm7P7V 0ebA== X-Gm-Message-State: AOJu0YwFe+I6c/XdzNqi2PMWKfjjqiLOwfssxc+bfizWFH9GzD2cg9it 3TUXSIllPIAUlVGTMRbD3/wMIwbEr3dDkJWNyOYvOC7lSOA= X-Received: by 2002:a05:6122:3125:b0:4a4:cd2:5ebe with SMTP id cg37-20020a056122312500b004a40cd25ebemr20392885vkb.12.1700218231823; Fri, 17 Nov 2023 02:50:31 -0800 (PST) MIME-Version: 1.0 References: <20230915094351.11120-1-victorshihgli@gmail.com> <20230915094351.11120-21-victorshihgli@gmail.com> In-Reply-To: From: Victor Shih Date: Fri, 17 Nov 2023 18:50:19 +0800 Message-ID: Subject: Re: [PATCH V12 20/23] mmc: sdhci-uhs2: add add_host() and others to set up the driver To: Ulf Hansson Cc: adrian.hunter@intel.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, takahiro.akashi@linaro.org, dlunev@chromium.org, Ben Chuang , Victor Shih Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:51:22 -0800 (PST) On Thu, Oct 5, 2023 at 7:39=E2=80=AFPM Ulf Hansson = wrote: > > On Fri, 15 Sept 2023 at 11:44, Victor Shih wrot= e: > > > > From: Victor Shih > > > > This is a UHS-II version of sdhci's add_host/remove_host operation. > > Any sdhci drivers which are capable of handling UHS-II cards must > > call those functions instead of the corresponding sdhci's. > > > > Signed-off-by: Ben Chuang > > Signed-off-by: AKASHI Takahiro > > Signed-off-by: Victor Shih > > Acked-by: Adrian Hunter > > [...] > > Just a few nitpicks, see below. > > > +static void __sdhci_uhs2_add_host_v4(struct sdhci_host *host, u32 caps= 1) > > +{ > > + struct mmc_host *mmc; > > + u32 max_current_caps2; > > + > > + mmc =3D host->mmc; > > + > > + /* Support UHS2 */ > > + if (caps1 & SDHCI_SUPPORT_UHS2) > > + mmc->caps2 |=3D MMC_CAP2_SD_UHS2; > > + > > + max_current_caps2 =3D sdhci_readl(host, SDHCI_MAX_CURRENT_1); > > + > > + if ((caps1 & SDHCI_CAN_VDD2_180) && > > + !max_current_caps2 && > > + !IS_ERR(mmc->supply.vmmc2)) { > > + /* UHS2 - VDD2 */ > > + int curr =3D regulator_get_current_limit(mmc->supply.vm= mc2); > > As I also stated in another reply, please use vqmmc2 instead, which we > added in patch4. > Hi, Ulf I will update this in version 13. Thanks, Victor Shih > > + > > + if (curr > 0) { > > + /* convert to SDHCI_MAX_CURRENT format */ > > + curr =3D curr / 1000; /* convert to mA */ > > + curr =3D curr / SDHCI_MAX_CURRENT_MULTIPLIER; > > + curr =3D min_t(u32, curr, SDHCI_MAX_CURRENT_LIM= IT); > > + max_current_caps2 =3D curr; > > + } > > + } > > + > > + if (!(caps1 & SDHCI_CAN_VDD2_180)) > > + mmc->caps2 &=3D ~MMC_CAP2_SD_UHS2; > > +} > > + > > +static int sdhci_uhs2_host_ops_init(struct sdhci_host *host); > > Please try to re-order the code so this declaration isn't needed. > Hi, Ulf I will update this in version 13. Thanks, Victor Shih > > + > > +static void __sdhci_uhs2_remove_host(struct sdhci_host *host, int dead= ) > > +{ > > + if (!sdhci_uhs2_mode(host)) > > + return; > > + > > + if (!dead) > > + sdhci_uhs2_reset(host, SDHCI_UHS2_SW_RESET_FULL); > > +} > > + > > [...] > > Kind regards > Uffe