From patchwork Fri Jul 21 10:13:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 123756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp110033vqg; Fri, 21 Jul 2023 03:35:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlECsQJi8GcUWTwfqSHukks5XJjwqltqgqOxzXFyKarqD5x/PaAdtXGK1dyj9qEEucoX/Uvu X-Received: by 2002:a05:6a00:b89:b0:668:74e9:8efb with SMTP id g9-20020a056a000b8900b0066874e98efbmr1505113pfj.8.1689935733302; Fri, 21 Jul 2023 03:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689935733; cv=none; d=google.com; s=arc-20160816; b=sNhNVgq5y4BGXE/kS7I/QKfbek8td685r5SML7NrQ6/j4oo8PvmZVS688mcx1ruZCU N+ofKnwmpd8u2F4ykFZnf6prdVReOUHlqK6qn+EiJkUg1aiYx42yPLedr1bXXr/Itskk E5aK0JBfy/u2f/it1byno4+GelaOgT2zEifa9Sw5pacLFXe9HHhTIubdb5p4K3X6AlJl kSLRKoRTlMbS49r9TdEDwxnfg3C5xckdYBqqInx1l6aOjWian+QzFfZ3Od613OEyMO7A 4LLHoWnVxZXg9i2upSKuYaYL+I/ZsxrAnjrFANzy8y6hpAP8JH7Y8IgX/3+2xdEf4hk/ ygbA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o2oO47JttJauMS9op7r59Sk9d5IhHxC/WR3Byj6UFmc=; fh=aZbD6vIoztiNqTfT9U0ALtDeO+En2lq/Pmnvw9tY2p0=; b=YyvauYNZSoO1nrTYOUSqSI2w7CCP8APUcR46KSa6WH6tVzUGGtbJPLWUDzqjgAOrVE vtcfWpvVqT/9fQLETMCMWif24coo6ZjzUq6VxRTLE1cww+lskjrfTJ4XnV4fAErOzb2C kPGqwf3RtijNd17o40jJVuM3DqATcusuNSjGfQWbK9UhOCULrgb7JMTxpOrHTEEjDAeP 2z8j0JlA//0YLr1oV5S/TPaOfBZafL6ibmSl6DpEh8Uk5UcTeViWdR6/DDkxyDo7JgwL y5dkoSW8NVXRBOOm95dwuYFBEBZ59w/+gGLCxmvyEW1WlbtmEQkgzBl1yOnPwyUOjsyv arXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eQud2r05; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020a056a00149500b00681c3725a98si2947513pfu.82.2023.07.21.03.35.20; Fri, 21 Jul 2023 03:35:33 -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=@gmail.com header.s=20221208 header.b=eQud2r05; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbjGUKO1 (ORCPT + 99 others); Fri, 21 Jul 2023 06:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbjGUKOU (ORCPT ); Fri, 21 Jul 2023 06:14:20 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1CE730EF; Fri, 21 Jul 2023 03:14:13 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-66869feb7d1so1143080b3a.3; Fri, 21 Jul 2023 03:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689934453; x=1690539253; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o2oO47JttJauMS9op7r59Sk9d5IhHxC/WR3Byj6UFmc=; b=eQud2r05AtpMbJhkcpsn2AYVmnywid6N05q362ok/1y3zyefovRPfqWtdmdUB+tWNd Ha8lB+wvDGdk5x4pJqVSxgP9v5Zs3u0GdtfrW5d7gJAixjjbKET6iyNfPWU0vRhytYoY mN/Fp7g0iSYQ8BGkEqi/0Kx4OM8x6FBsGIHXpLW3eRlO7P4aK8ccllTD0uTkhJO8G3zO QQIc+8PxBSFNZntviKSu9y/xuLvGrepPcAfXc6rtvvo7sTH4jIM9oJpo5zsVo+zEq65I HxEe2RLRKH0X1gmplJHZW/d6JcVrP4bgJAVMzRZF+O3pKvYr27ZV2PiJ8bT0lP8OmJWV T8aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689934453; x=1690539253; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o2oO47JttJauMS9op7r59Sk9d5IhHxC/WR3Byj6UFmc=; b=PUvRPd5SfBdOqwWSwmG/UQdi5gv+Ou3m5Nkw8X0aqLzu3TIzLBDaqPDDxPTqCXMjnc pXezGB2mEpPhHsXq3/Cp2g5ilWoX03odke2gICWTtmDPJIVUc/Sfc6GXSgYl5Kp8k6H7 o6eLlrFZP4jn83ktWCIEAMDnpRjVCHDO+4tTIWsQUKUXwU0sLt/0zEqmXMKTlyD+RfZK iSfZyo0Qe+iXGmA6u+MoM2tXBw4ZWmJHFboBnTTDEmmfIyNWKVWJOXegR5VKy/zmyreu iSdoIqRjEWDTgCSZYeAosOsd9c4M8ptlNyPo6+TPKtxv/KNgBIbOxtx77MEIc3L3UALy F1Ww== X-Gm-Message-State: ABy/qLYxitnrZnqy1fSHqXVe1Q/D8DTBNoKqmUs6TIj/DS4z277wFMA3 v454f4qPjYE44vnV9M9d5uk= X-Received: by 2002:a05:6a20:13c6:b0:127:72c3:fd60 with SMTP id ho6-20020a056a2013c600b0012772c3fd60mr1099642pzc.1.1689934453211; Fri, 21 Jul 2023 03:14:13 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e23e-6b0d-6c46-3684-497a-06ee.emome-ip6.hinet.net. [2001:b400:e23e:6b0d:6c46:3684:497a:6ee]) by smtp.gmail.com with ESMTPSA id y1-20020a170902b48100b001b86492d724sm3050719plr.223.2023.07.21.03.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 03:14:12 -0700 (PDT) From: Victor Shih To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: 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, Victor Shih Subject: [PATCH V9 01/23] mmc: core: Cleanup printing of speed mode at card insertion Date: Fri, 21 Jul 2023 18:13:27 +0800 Message-Id: <20230721101349.12387-2-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230721101349.12387-1-victorshihgli@gmail.com> References: <20230721101349.12387-1-victorshihgli@gmail.com> MIME-Version: 1.0 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772026051622080626 X-GMAIL-MSGID: 1772026051622080626 From: Ulf Hansson The current print of the bus speed mode in mmc_add_card() has grown over the years and is now difficult to parse. Let's clean up the code and also take the opportunity to properly announce "DDR" for eMMCs as "high speed DDR", which is according to the eMMC spec. Signed-off-by: Ulf Hansson --- drivers/mmc/core/bus.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 2c3074a605fc..cf32cf135781 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -299,6 +299,7 @@ int mmc_add_card(struct mmc_card *card) { int ret; const char *type; + const char *speed_mode = ""; const char *uhs_bus_speed_mode = ""; static const char *const uhs_speeds[] = { [UHS_SDR12_BUS_SPEED] = "SDR12 ", @@ -337,27 +338,30 @@ int mmc_add_card(struct mmc_card *card) break; } + if (mmc_card_hs(card)) + speed_mode = "high speed "; + else if (mmc_card_uhs(card)) + speed_mode = "ultra high speed "; + else if (mmc_card_ddr52(card)) + speed_mode = "high speed DDR "; + else if (mmc_card_hs200(card)) + speed_mode = "HS200 "; + else if (mmc_card_hs400es(card)) + speed_mode = "HS400 Enhanced strobe "; + else if (mmc_card_hs400(card)) + speed_mode = "HS400 "; + if (mmc_card_uhs(card) && (card->sd_bus_speed < ARRAY_SIZE(uhs_speeds))) uhs_bus_speed_mode = uhs_speeds[card->sd_bus_speed]; - if (mmc_host_is_spi(card->host)) { - pr_info("%s: new %s%s%s card on SPI\n", - mmc_hostname(card->host), - mmc_card_hs(card) ? "high speed " : "", - mmc_card_ddr52(card) ? "DDR " : "", - type); - } else { - pr_info("%s: new %s%s%s%s%s%s card at address %04x\n", - mmc_hostname(card->host), - mmc_card_uhs(card) ? "ultra high speed " : - (mmc_card_hs(card) ? "high speed " : ""), - mmc_card_hs400(card) ? "HS400 " : - (mmc_card_hs200(card) ? "HS200 " : ""), - mmc_card_hs400es(card) ? "Enhanced strobe " : "", - mmc_card_ddr52(card) ? "DDR " : "", + if (mmc_host_is_spi(card->host)) + pr_info("%s: new %s%s card on SPI\n", + mmc_hostname(card->host), speed_mode, type); + else + pr_info("%s: new %s%s%s card at address %04x\n", + mmc_hostname(card->host), speed_mode, uhs_bus_speed_mode, type, card->rca); - } mmc_add_card_debugfs(card); card->dev.of_node = mmc_of_find_child_device(card->host, 0);