Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2614198yba; Mon, 15 Apr 2019 15:54:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzna1Twb8nlJi0VqIs6Bd6zscBO5cpS7vbwpI3/+ollMULErROk0BIWcPBu4bmL6DHzBI8N X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr75151396plp.74.1555368845036; Mon, 15 Apr 2019 15:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555368845; cv=none; d=google.com; s=arc-20160816; b=vIOVLVkmXP6755+CFYcILq/fdATaX3may20wMPkN7vVpwpgbpR6LtAoWc3qi3ee9Lm QZqP55hkK9ShUdxJeUHS86IAndb+G8Ks1oHscWhEzsuwKeNwlcdRredmzzzR5FGuDrht RrYaBg//sOCtWtXMYPeh2WwudslEjVyOi5127wotlYya80FgrrsT99mcSNBEGoC8ZA9z ZljJCHVgrYWwLlBK5EuFa6fKaOrf7d1i8/Uqb9BgF8zM4K/YvXvatd+WNN0+fqSYWB/6 6q0zLyRoEK/HYiOt0n23B1rXHrQmxGG3UEizFl5Kmy530d1yYEilZUkRzrZym55SyUSY G0jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dCSkPH4TEhOz2CVPriVw70SoAjwKpU3zKt3o48+f2Wk=; b=hMAl7g5RmWYqDVyRqbF0xCIGvG9IVFFKbpGTOfsjO5Cr0EUY06pD3SV4Xal1PPtHdy xtg2R+QvUz74+MGMT4UdJ0w6b9c7pFcSca+a9mFjLtoI+t1M9yBOa+Zh433C59sB9hOE v++VV57l4XF78EXRh1/p2CH/03dMrImk3xFda4EoiVdb+j0nH71QiA/pHcN7isBk+dnW bf3VWGSwghxRQOGnocYiKk8yB0dA+pbYKTsXIvRdRXCp/9a5Zye5bBk01dvnX+7WkU4g YGPK8QPaiWD+ev8/62bZQwpGZ0iN+7Wj4jbwVtYTJ1wAF+NZyeQov6VCLQA6/hqqW67H PpIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WoXuGsbR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si45102889pls.228.2019.04.15.15.53.48; Mon, 15 Apr 2019 15:54:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WoXuGsbR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728233AbfDOWxK (ORCPT + 99 others); Mon, 15 Apr 2019 18:53:10 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:53419 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbfDOWxG (ORCPT ); Mon, 15 Apr 2019 18:53:06 -0400 Received: by mail-it1-f194.google.com with SMTP id y204so29959215itf.3 for ; Mon, 15 Apr 2019 15:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCSkPH4TEhOz2CVPriVw70SoAjwKpU3zKt3o48+f2Wk=; b=WoXuGsbRkxzkwFjOGTtN8Hqe2wRfRX/dbzNn8LpwMLZX/HIIy0/Ap2Ki2F8YaNhDAz Fr/bI0g7oKJevTzjCeEOrgCWj4RCpvSJ0vIkDhX+kL67FjCA4Kb920O0HFS2L4mUddVX e78632JsQl/VIlJxuSJQwOmebj6lgM8gYau8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dCSkPH4TEhOz2CVPriVw70SoAjwKpU3zKt3o48+f2Wk=; b=DNZIo14TiYepMG3r5x+yTNODbwSkoOjabKfhV0MBNidi5VGJx12ay6nZJ3feolzc/3 48PMNbZTEo4Zex8ZNkrvSHHefNi2/AAsOAcsW9G1zDaAMBhOYtOibnkiTLdFv9+mjaYD KDwaE3Z9p7ySkv0MSAaIMFsMb1VUrT5kwxPgjAtc8NV844zKk66z1HjKt4pTV6iml88Y UCibcQGaG0y4e6+0Pc/5lVPeGLbQDpROSmSmBNX3likkItxeSoXO/nI9RMHTUDvvrB98 kzsBSyz8Rn4hXE9wDKFnPXRETMfJJNUcruRXx/XfdooWRiUvvObeqYrEx9Lah2Pp0N38 jl/Q== X-Gm-Message-State: APjAAAW5zxb7hxfayeJ7fEOQSarKflWmoJ5VjbaPecC7iMN6cLTSxRdE c63oM4cjS9ZaDzPnoYphVoQPkw== X-Received: by 2002:a24:13c7:: with SMTP id 190mr28753654itz.9.1555368785341; Mon, 15 Apr 2019 15:53:05 -0700 (PDT) Received: from localhost ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id o203sm8021762itd.1.2019.04.15.15.53.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:53:04 -0700 (PDT) From: Raul E Rangel To: linux-mmc@vger.kernel.org, linux-trace-devel@vger.kernel.org Cc: djkurtz@chromium.org, zwisler@chromium.org, Raul E Rangel , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v1 3/4] mmc: core: Add trace event for SD OCR response Date: Mon, 15 Apr 2019 16:52:40 -0600 Message-Id: <20190415225241.70088-3-rrangel@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190415225241.70088-1-rrangel@chromium.org> References: <20190415225241.70088-1-rrangel@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Example: ocr_request: mmc0: 0x51200000 SDHC or SDXC Supported (HCS) | Maximum Performance (XPC) | Switch to 1.8V (S18R) | 3.3 ~ 3.4 ocr_response: mmc0: 0xff8000 2.7 ~ 2.8 | 2.8 ~ 2.9 | 2.9 ~ 3.0 | 3.0 ~ 3.1 | 3.1 ~ 3.2 | 3.2 ~ 3.3 | 3.3 ~ 3.4 | 3.4 ~ 3.5 | 3.5 ~ 3.6 Signed-off-by: Raul E Rangel --- drivers/mmc/core/sd_ops.c | 6 +++ include/trace/events/mmc.h | 91 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index 0bb0b8419016..4cf0f040f896 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -19,6 +19,8 @@ #include #include +#include + #include "core.h" #include "sd_ops.h" @@ -130,11 +132,15 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) cmd.arg = ocr; cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; + trace_sd_ocr_request(host, ocr); + for (i = 100; i; i--) { err = mmc_wait_for_app_cmd(host, NULL, &cmd); if (err) break; + trace_sd_ocr_response(host, cmd.resp[0]); + /* if we're just probing, do a single pass */ if (ocr == 0) break; diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index cad604ee800f..fa82c010ae4e 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -10,6 +10,97 @@ #include #include +#define SD_OCR_REQUEST \ + {SD_OCR_CCS, "SDHC or SDXC Supported (HCS)"}, \ + {SD_OCR_XPC, "Maximum Performance (XPC)"}, \ + {SD_ROCR_S18A, "Switch to 1.8V (S18R)"}, \ + {MMC_VDD_165_195, "1.65 - 1.95"}, \ + {MMC_VDD_20_21, "2.0 ~ 2.1"}, \ + {MMC_VDD_21_22, "2.1 ~ 2.2"}, \ + {MMC_VDD_22_23, "2.2 ~ 2.3"}, \ + {MMC_VDD_23_24, "2.3 ~ 2.4"}, \ + {MMC_VDD_24_25, "2.4 ~ 2.5"}, \ + {MMC_VDD_25_26, "2.5 ~ 2.6"}, \ + {MMC_VDD_26_27, "2.6 ~ 2.7"}, \ + {MMC_VDD_27_28, "2.7 ~ 2.8"}, \ + {MMC_VDD_28_29, "2.8 ~ 2.9"}, \ + {MMC_VDD_29_30, "2.9 ~ 3.0"}, \ + {MMC_VDD_30_31, "3.0 ~ 3.1"}, \ + {MMC_VDD_31_32, "3.1 ~ 3.2"}, \ + {MMC_VDD_32_33, "3.2 ~ 3.3"}, \ + {MMC_VDD_33_34, "3.3 ~ 3.4"}, \ + {MMC_VDD_34_35, "3.4 ~ 3.5"}, \ + {MMC_VDD_35_36, "3.5 ~ 3.6"} \ + +TRACE_EVENT(sd_ocr_request, + + TP_PROTO(struct mmc_host *host, u32 ocr), + + TP_ARGS(host, ocr), + + TP_STRUCT__entry( + __field(u32, ocr) + __string(name, mmc_hostname(host)) + ), + + TP_fast_assign( + __entry->ocr = ocr; + __assign_str(name, mmc_hostname(host)); + ), + + TP_printk("%s: %#x %s", + __get_str(name), + __entry->ocr, + __print_flags(__entry->ocr, " | ", SD_OCR_REQUEST) + ) +); + +#define SD_OCR_RESPONSE \ + {MMC_CARD_BUSY, "Ready"}, \ + {SD_OCR_CCS, "SDHC or SDXC (CCS)"}, \ + {(1<<29), "UHS-II Card"}, \ + {SD_ROCR_S18A, "1.8V Accepted (S18A)"}, \ + {MMC_VDD_165_195, "1.65 - 1.95"}, \ + {MMC_VDD_20_21, "2.0 ~ 2.1"}, \ + {MMC_VDD_21_22, "2.1 ~ 2.2"}, \ + {MMC_VDD_22_23, "2.2 ~ 2.3"}, \ + {MMC_VDD_23_24, "2.3 ~ 2.4"}, \ + {MMC_VDD_24_25, "2.4 ~ 2.5"}, \ + {MMC_VDD_25_26, "2.5 ~ 2.6"}, \ + {MMC_VDD_26_27, "2.6 ~ 2.7"}, \ + {MMC_VDD_27_28, "2.7 ~ 2.8"}, \ + {MMC_VDD_28_29, "2.8 ~ 2.9"}, \ + {MMC_VDD_29_30, "2.9 ~ 3.0"}, \ + {MMC_VDD_30_31, "3.0 ~ 3.1"}, \ + {MMC_VDD_31_32, "3.1 ~ 3.2"}, \ + {MMC_VDD_32_33, "3.2 ~ 3.3"}, \ + {MMC_VDD_33_34, "3.3 ~ 3.4"}, \ + {MMC_VDD_34_35, "3.4 ~ 3.5"}, \ + {MMC_VDD_35_36, "3.5 ~ 3.6"} + +TRACE_EVENT(sd_ocr_response, + + TP_PROTO(struct mmc_host *host, u32 ocr), + + TP_ARGS(host, ocr), + + TP_STRUCT__entry( + __field(u32, ocr) + __string(name, mmc_hostname(host)) + ), + + TP_fast_assign( + __entry->ocr = ocr; + __assign_str(name, mmc_hostname(host)); + ), + + TP_printk("%s: %#x %s", + __get_str(name), + __entry->ocr, + __print_flags(__entry->ocr, " | ", SD_OCR_RESPONSE) + ) +); + TRACE_EVENT(sd_scr, TP_PROTO(struct mmc_card *card, struct sd_scr *scr), -- 2.21.0.392.gf8f6787159e-goog