From patchwork Fri Mar 31 10:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 77720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp471597vqo; Fri, 31 Mar 2023 03:58:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZotFcE2eu3E+IV/pePX+Erj9VRbVmNtmqOJA20uA4R/s7XKKn0TekV2WhzhpEM+c7GvwJ9 X-Received: by 2002:a17:903:1109:b0:1a2:38a3:7958 with SMTP id n9-20020a170903110900b001a238a37958mr28353411plh.1.1680260284518; Fri, 31 Mar 2023 03:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680260284; cv=none; d=google.com; s=arc-20160816; b=CcictDV4XuDZrrIDezkE9eWKTq1ZO92arbQQVCCsxV5EAKqXEFcLFwigEP9NnmnYXv 6rRNX+1Cp2LHyDCCOBxkWopDLO30t5nbmbiSr1iTileRngA8tmR2Jl9pRmvRkvJuSbBa vapu0li+bw+IEBaphDUCkPngkKzZyffGQetbfI2ho/iJUc4WtU9EiQ23kNRuiuaeNQmU jUcsQidEoeXLrrxvZzr7HfWcUnvmb1ubnNdt3W7hP3xU4yLsOz2aZGOs3PCf5LjYn7xv NdkjOlDh0gYNcoEe1XJ7WqgeEomGEffjZltoy7ZCb216uOD65fNsT5tL5S949w8lxY56 4gig== 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=4CnmHFKdPQEHTvZNRYXNIZZMHyo/3bfUyI7H1X7Tf+A=; b=nfCJi3QqA9apDfhcCviMgxN8sUBu9FKrbk5b8meaqqarweqI+jlCRCF3srMKhy6IcY AwEcjp3GgB9L3U9+ov7JjSo0ew7zDJH5QghxyU/jV2tY/oMv+IPbwwT0hF8vTl6FRK5k W2B5T8PrVNWB2BoJ9tG9mGRzWad/RDNiW62Kgy5oTovAHB5W80dmRn2zdexXUM95YXlk yP4l/6UAyqxA2rxhz1fP4eJZ/8mHfR9dqZbriMn3gHkuP+kd/QbqnpVNb1pHk2852nMl +OvJXmfAVKg6eSBxo6nkzoRVGaoTclGvLvrHexmPznj6V5vB+WWxUBGT6bDe3QkLSQjz yvog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Me10YJcx; 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 b7-20020a170902d50700b001a1aa5d3ba4si1969847plg.416.2023.03.31.03.57.52; Fri, 31 Mar 2023 03:58:04 -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=20210112 header.b=Me10YJcx; 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 S231771AbjCaK4n (ORCPT + 99 others); Fri, 31 Mar 2023 06:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbjCaK4Z (ORCPT ); Fri, 31 Mar 2023 06:56:25 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528BF1E730; Fri, 31 Mar 2023 03:56:10 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id o2so20872968plg.4; Fri, 31 Mar 2023 03:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680260170; 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=4CnmHFKdPQEHTvZNRYXNIZZMHyo/3bfUyI7H1X7Tf+A=; b=Me10YJcxdjrStL7uupP5YkyqYD8CoNBSTlFDEE7Xl91kSw8zfTYRgPJ8UxAbp+axGj J7W55RSOeijXPtv3rvhjMps5juGdF7jhvX4XgY+XMqQVLFaBXb7ftygmKHZw8q8KITwP T7EfUuXrMBr5Sh6Ff8ILiUsWYclFc5YIc4b9KuLLDpMMsSWhSR1V320OnQGFK1ul2A5X /5jX6+l99D+yEyI517c4mW8e7MQLBFc79v2u1VPxh6vORcIqg/wsm9K2q8kZkfudvgTV zrSYmffHG71xV++LBMOmiooro/XSQCZNKQnxxPjaphRbpeY0TacIfxbkTROXxJku0OKH Fqew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680260170; 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=4CnmHFKdPQEHTvZNRYXNIZZMHyo/3bfUyI7H1X7Tf+A=; b=AMSu637zqeEDJuKjSh+ry2c6cAT7zZBU7SsTkd7i1TiDHMKgqeD6+ymPLyj18Uahdb VZzD2pz1wCT4mttgeZhitopvEacl9hCc0Ixh8cnEIqOPy+OiAsQO2p+azgi+PwRW7irX yA5+USVxdKVOWe+vDzHpsYsRB5daXpbjeEICkHlPH9BXp+TWW/hrrWIz4IELJcFhWfAm 6CYcHOkDgDFoG+po+/XwPwyTo1XUiGluMNdSjA75cT6yanhss1x26tEFlHTEL/d5Df0A SUhXf8UeQ832w+OPHoWL823uWtlXFsg9UuMAj3xtvhh8oLMUU7+im9crdy1EdCLSmMV4 Ywtg== X-Gm-Message-State: AAQBX9dTSuWZukD8QAdX4B7OvPookqZsseq6djrZlsi4/7YVPkgjBiLV Fj8NjE5umbASVZ07aoh/sfM= X-Received: by 2002:a17:903:247:b0:1a0:4859:19ea with SMTP id j7-20020a170903024700b001a0485919eamr29574732plh.39.1680260169748; Fri, 31 Mar 2023 03:56:09 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e25c-983f-c7ff-3efd-77d9-6c16.emome-ip6.hinet.net. [2001:b400:e25c:983f:c7ff:3efd:77d9:6c16]) by smtp.gmail.com with ESMTPSA id f19-20020a170902e99300b0019acd3151d0sm1287665plb.114.2023.03.31.03.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 03:56:09 -0700 (PDT) From: Victor Shih X-Google-Original-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 V7 01/23] mmc: core: Cleanup printing of speed mode at card insertion Date: Fri, 31 Mar 2023 18:55:24 +0800 Message-Id: <20230331105546.13607-2-victor.shih@genesyslogic.com.tw> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230331105546.13607-1-victor.shih@genesyslogic.com.tw> References: <20230331105546.13607-1-victor.shih@genesyslogic.com.tw> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761880607998175492?= X-GMAIL-MSGID: =?utf-8?q?1761880607998175492?= 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 Signed-off-by: Victor Shih --- 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);