From patchwork Mon Apr 24 07:03:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 9695691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6629B601E9 for ; Mon, 24 Apr 2017 06:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5982A20700 for ; Mon, 24 Apr 2017 06:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E2BE21F61; Mon, 24 Apr 2017 06:57:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B608920700 for ; Mon, 24 Apr 2017 06:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165702AbdDXG5Z (ORCPT ); Mon, 24 Apr 2017 02:57:25 -0400 Received: from mail-db5eur01on0073.outbound.protection.outlook.com ([104.47.2.73]:58434 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1165699AbdDXG5X (ORCPT ); Mon, 24 Apr 2017 02:57:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=awe903f0sHbjGmsZqs1ATYCQ56BaKyfr60brSYjw45Q=; b=NsSnllh6862qp6ryAXjbe/WU1ZCuMbjWBwHpti8slT0/jQgXr+Z5P42eOmBK9idfEyikpmP2Qj+GlV3MIZwoUOxWwYPoJ0p6/sQ6w0+jmG8KV3ymlheMPA3vESnD4fmYbfSLw2PdxwLFvBts9Z1tqUDt0h8J4TFVjHcsLRCLEPA= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=nxp.com; Received: from b51421-server.ap.freescale.net (199.59.226.141) by HE1PR0401MB2330.eurprd04.prod.outlook.com (10.168.32.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Mon, 24 Apr 2017 06:57:14 +0000 From: Haibo Chen To: , CC: , Subject: [PATCH] mmc: debugfs: add runtime pm when cat ios or clock file node Date: Mon, 24 Apr 2017 15:03:13 +0800 Message-ID: <1493017393-13785-1-git-send-email-haibo.chen@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [199.59.226.141] X-ClientProxiedBy: SG2PR03CA0080.apcprd03.prod.outlook.com (10.169.50.48) To HE1PR0401MB2330.eurprd04.prod.outlook.com (10.168.32.149) X-MS-Office365-Filtering-Correlation-Id: 5c9686e3-3d1d-4fe8-5dd3-08d48adf26bf X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:HE1PR0401MB2330; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2330; 3:OShgFQyJh4yUHWb+1zeobabCGKeRn9Yu4L0SwSPs8VdXxPbL37m2uEHTIdnhADi7omsixbgzY/AYRrxskxWQbfkT9qQK4gwaO6LJJHgDrm2luOqY3qnYBiAxzXW/Lu8L8sCh5k0Xzqe5VJDLmkeBQv2E4nhcXusCzKqpSeHv0Dg/sJCRKFEtTZjl2nOMHhRAgjrtOT6hcm3/qVlU6Y4ayl3f5QBgm671zwq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095BWVRA/EHH8GwMAVzJ3wFVfZxVE4Y0wKmIBOrsW6K49F+/SHNy/ZUS+QSynHZiTdwatUct0b7je1OY8WXHCyfCzMfUCNBE894SGfQOVFF6RPR+iHhIrRU66u4e7EOe1MSZtIbE99H94njSiOTFWegdV/kC7/VLBCC1bRgk8ERmAKNdp892/np5elKBBtVzGsR461DskXgHSm2MlqoTDktiopchHNlveGCvbWGoGgQ1yabwlWwoVQ8IZzcNV1ShHG/VDoBothYU+olr6OBB8zTVXY3xN+CBroaJq/8njivde594tDk6toUheKaVVtuPN8VwrFUa0o93fJflS7wNdO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:HE1PR0401MB2330; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2330; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2330; 4:d6dm51uQv+wRCOsT9AQLJV7VXtjiAeh2xFRTMOvH/U947tVcl8k3Y1h4THJJ1Ru5K+pY7JPuAagp0Yvfq8N4W1L2jNXwlhuswXyXAP6/br4cEdE6KPMxgEwi1+UeegmwA+C2//Q7FKAzlDLVM2ZWL6/snt/x0IPoPeIYmgCoNnksiiq6DpTXA7m1LNW5vaB8wFey3IBN5iMesSbC0InEKdByFmKwRfCnq1R2MF5ML3H2IKEidfcU+wFWvsSrS/byOABQKOFaphy2g4OjvfkmQqmLlOjd9XOa8UP+c8kaHA+rg9fngPLO7e1EivzwU1qB8eHwy6zgMybw8QMnlRN4xiH+TVC/X8+uiKtmCL0yLbJx4HKwvke4NE9HqsIgffS1sejAskB+wKFkTtcN3rtGS5xPzfrvwOBFGaaiVIR47VCd0D4svF5qjJSs5ZRZ4d7W+ISolTll2FkZ7mZeEf6N/EIb2QLxeSLcheV1LO3qSHT3E63Ev8uZcm1DkkEmCcr6jZZXsgo96UMvI6jMT/6C2qcP1XTFZyip5TFUuLfmrYe/pZP1GoECVfB/UPCdS+J+ey831vPhKaY1RLGA50kWVwZbz38WCr+XfHf3jmCv3qY/QdNhn5sKHT8YUHS40cUr4q3swQf5O8RiBxUMOmH20IzfNnHEIUuGJ7xVjPk55DA/uENiJUoynuRMghy99OshzkAvSXvXth2KTzKsE2hwKbod/ZdBnz4pu0wRa+hppmvi8hjxvef/6wP5T6vVu98XxP40wg0gb7SKmOZ2EOBKag== X-Forefront-PRVS: 0287BBA78D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39840400002)(39400400002)(39450400003)(39410400002)(39860400002)(305945005)(6512007)(50986999)(54906002)(33646002)(6486002)(42186005)(50466002)(5003940100001)(48376002)(6506006)(7736002)(6116002)(3846002)(36756003)(53936002)(2906002)(25786009)(4326008)(189998001)(81166006)(86362001)(47776003)(50226002)(5660300001)(8676002)(66066001)(38730400002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2330; H:b51421-server.ap.freescale.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2330; 23:+RUhhPgr0MVW0wr4umrpDumWcREsQKsutwl7/+8bGUqA0vPAd7aRJp3JGqrFxIlHAPSIy1hiw4HbcSPvpsgWpx2XBp0NCY4Ybw94dYflF/IHYKAkd2mSFyc0HqR8Bj0sdmJeseMFgFBfFXOyBz/CR2fND2zYr6yojhPiK/heERvWWMjhkg7n7st0l7kEgZNBZI5UkWBGdgg2e5AIrCXXFdVkk5LUP2BudAiD6B2ZFlYQ7cKaOzxY5YYvHw0nPKldD80HR97phLpujg0/WLokGLp45ZjcJMMF7V8fHVhHfqdQ5naQ+tfjvNorfuKb+zZ67SCFGKC1MNICZKkXYPH4dz8cADnwLSCtGlOoMZE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jw6s3uGr5+AASSiH7ayRyhPpPFONIGDn4IJrliznCFDDxGESQzSYy8ioT/adna9U3Pzk7aj4JVMv6yLPO7/favC1U8mbwVvOEJYca6/viohVnQvTUUg5WVb45Axu7vA=; 5:09LGK4ZkwTFTxo4UoLXbW22PPXHBxkIS2n17gatQU1sAGmb5r3YBOOTVqdoBYkOWYQp4rBH2h67M/EBS1yIeUr5/6R7LMaZcSydD8IIzfUWJvpzvi0LO3hkfI7X5UFZ2tL6ti3w4k60P4AnL7iwwwA==; 24:8dYpjWEtHI0X/M9HtuhhdkC3G9eGl+HzMitPqr2b3W1IEtV0YpS0hbNTke6liMI5nk9InWKI4XQwKieaHYpXWZlq+FMNP0baGV3HfSOUBug= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2330; 7:73faiXvt3EDZ9lmqRd17DmrGU+caB12cN5Dp2gS0tjRu5OhQ1o3JLa7uJxMjF60Yi+OBAREhrTXccur/JY3d336khxnf2DmFzJzsZJHaDFOoO7mdxCDTis6q6U4sndW3y/AUAcT9TBR/Su9onS97NPoam8HG9MtcrNcXkQtiE58L876+/CbC3KCAR4BmYm8QnH2M88fwq4eSlM0g2UTAAq7kRtk0VSCU3UpJasOwXJ/jCxccwsS4g/lPbfnzU9L0a8bE6++BtT3LudPgn1PYjPh0LIP2Dzr04wBaabeOJXKOvDBt9c5jaErifsLzUsdCRLtf82dZO4ZojusoQRlxqg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2017 06:57:14.5393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2330 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MMC core code add 'MMC_CAP_RUNTIME_RESUME', postpone the real card resume operation from bus_resume to bus_runtime_resume. So after system resume, for non-removable-card, it still not really resume. At this point, if user cat the ios or clock node, only can get zero data although the mmc/sd card is still present. This patch add mmc_get_card() to make sure card really resume back when user cat ios or clock debugfs file node, then user can get the correct information. Signed-off-by: Haibo Chen --- drivers/mmc/core/debugfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index a1fba57..23ec9d3 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -58,6 +58,9 @@ static int mmc_ios_show(struct seq_file *s, void *data) struct mmc_ios *ios = &host->ios; const char *str; + if (host->card) + mmc_get_card(host->card); + seq_printf(s, "clock:\t\t%u Hz\n", ios->clock); if (host->actual_clock) seq_printf(s, "actual clock:\t%u Hz\n", host->actual_clock); @@ -194,6 +197,9 @@ static int mmc_ios_show(struct seq_file *s, void *data) } seq_printf(s, "driver type:\t%u (%s)\n", ios->drv_type, str); + if (host->card) + mmc_put_card(host->card); + return 0; } @@ -213,7 +219,11 @@ static int mmc_clock_opt_get(void *data, u64 *val) { struct mmc_host *host = data; + if (host->card) + mmc_get_card(host->card); *val = host->ios.clock; + if (host->card) + mmc_put_card(host->card); return 0; }