From patchwork Mon Jan 7 10:11:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 10750255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33FCF13B5 for ; Mon, 7 Jan 2019 10:12:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 212BB28A7D for ; Mon, 7 Jan 2019 10:12:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FB6528A6C; Mon, 7 Jan 2019 10:12:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B012428A81 for ; Mon, 7 Jan 2019 10:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbfAGKMN (ORCPT ); Mon, 7 Jan 2019 05:12:13 -0500 Received: from mail-eopbgr130073.outbound.protection.outlook.com ([40.107.13.73]:43744 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726540AbfAGKMM (ORCPT ); Mon, 7 Jan 2019 05:12:12 -0500 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:X-MS-Exchange-SenderADCheck; bh=srXtc9kwWUPkulCJC1emgCvVfAmwcsf3dg5A1SGAp+s=; b=vL9LsINzg/o+DyJ39GRgOuKBhuqKRd7JIRoGkKxKxxuIUJ4XRuzoyYh4CPIFXmX870FySqJ51w7GG+P6BqhdtOQxVtWbh/XcJgNRvh3HLspHYRFykHc74tAEy3fU/rckIY+UK3fUQMyufR7U96Cotyw/Y2pDt9Rcz4iwlf0JYXY= Received: from VI1PR04MB5040.eurprd04.prod.outlook.com (20.177.50.97) by VI1PR04MB2126.eurprd04.prod.outlook.com (10.166.43.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.7; Mon, 7 Jan 2019 10:11:36 +0000 Received: from VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::ed39:18ba:6fbc:d025]) by VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::ed39:18ba:6fbc:d025%2]) with mapi id 15.20.1495.011; Mon, 7 Jan 2019 10:11:36 +0000 From: BOUGH CHEN To: "ulf.hansson@linaro.org" , "adrian.hunter@intel.com" CC: dl-linux-imx , "linux-mmc@vger.kernel.org" Subject: [PATCH 3/5] mmc: sdhci: correct the maximum timeout when enable CMDQ Thread-Topic: [PATCH 3/5] mmc: sdhci: correct the maximum timeout when enable CMDQ Thread-Index: AQHUpnFf0k4aq6J5202HNLbnC1EGrA== Date: Mon, 7 Jan 2019 10:11:36 +0000 Message-ID: <20190107101757.27647-3-haibo.chen@nxp.com> References: <20190107101757.27647-1-haibo.chen@nxp.com> In-Reply-To: <20190107101757.27647-1-haibo.chen@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: HK2PR04CA0052.apcprd04.prod.outlook.com (2603:1096:202:14::20) To VI1PR04MB5040.eurprd04.prod.outlook.com (2603:10a6:803:59::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB2126;6:VpaWzylXqTcnGAXxVgup/ZbL9/YR8QKrl2KqUcJ9xM21noduDfxPfcxXKQ1gxlJzjiHlY7lnX5jn40k8pdFgzZXIyvIqD+tpHDcEXa4JrQBDFfmYw8JlYt3QJLutFcIUV8/2uyhM9jIh7riOmSFTjg/YoWzEVlqY67hrKo9HthD+aJTLkWUG6KtthKzqseNxmsU3An0UNXzu+tQUXZxQj74O9tEA+TiUm3W4FfCN5mTOQcqLebUtVeCtMaPa2kpKegbrtOUog4fL8dhhU+IIbHIMrLLHZQR3YEOsyjKcJ2VtbYVvLY2Wbeu+Y5R21H8eNRrH16kNgrymF3nMv8FTujRjag5MzEJbVK3CkA+xARBjzdBaUqiYGYHVabHqq/nGjuabEcmxPvGHkPDB4X+BfRKCuM2HBAIqzr+IdwGBM9n8/NJhFxszV3WQaMXzqUAsZmJPnVdYhqBZB0DFNGEERA==;5:u0/xpMQ74lqbRDqsylYSVkzQAEFJ7f+tgmSSsF+BJmhe19mF9OQZWWuxHce7c6w7jG35DS3GMUdIz6R80FrGYQPWcE37tDCsic5HnpM3lVL9sQo6JxTGBKyy1yd7Bs0ew3Xt4bpSj87yzZNYWvuearb7iJoD7NyCssDuXHnCjXp20eiXqNMBlMWL3WGJ02V+5HL9BeSo/038VtoS/J5JwQ==;7:6cEcgQXocipnNdYXFBxqsP1WB152tdwgo9cQq6gcTokV4UWukGRg5eJHoBMdHFToWPMMXiN+7qVL1SjpJlZHkkv0MseO2UZMNK6XH8yEOC/x4NhSA8sy5/AvbEQ71gck4WLF6ZqkNga20D5wSTDZnw== x-ms-office365-filtering-correlation-id: 46deda34-09c3-4a40-83d6-08d674888170 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB2126; x-ms-traffictypediagnostic: VI1PR04MB2126: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(10201501046)(3231475)(944501520)(52105112)(93006095)(93001095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB2126;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB2126; x-forefront-prvs: 0910AAF391 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(366004)(136003)(396003)(376002)(346002)(199004)(189003)(8676002)(76176011)(81156014)(81166006)(50226002)(305945005)(5660300001)(106356001)(52116002)(110136005)(71200400001)(2501003)(54906003)(486006)(8936002)(4326008)(102836004)(478600001)(7736002)(316002)(14454004)(256004)(71190400001)(86362001)(105586002)(3846002)(6116002)(186003)(6512007)(53936002)(386003)(99286004)(6506007)(97736004)(26005)(2616005)(11346002)(476003)(66066001)(6436002)(36756003)(25786009)(53346004)(68736007)(446003)(1076003)(6486002)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB2126;H:VI1PR04MB5040.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: P7Sqr+310PhmUBqfWPgKe5nBkXATBye0bBNECbBJ+xugIqtRFJVtHEXSNV9EtSFXXungFcPV3MFtOptZmtJbFvk8lfkL756P+VtH9NxsrCvZOPwj2yGmYiCHnuGxdSabmQ7qfVx5wIlkvwL3G092ElHrs12s1Z7kKy8vmEPc77iXEi236ZrU3B8JXKKSZqqLsUUwR9mYZFUW7tV3QhUT3Bb7RRiSeWQRVYmnE2GOvkxL+kChvAmJ/6GANfy52WKzLCgQip1hZQn3dBMjHqb4ouWIampB7gqaPwxkdE4IJlpodlJSQhjsgj4ku4027+L0 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46deda34-09c3-4a40-83d6-08d674888170 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2019 10:11:33.1449 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB2126 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 Change to use sdhci_set_timeout() to set the maximum timeout, so that the host can use it's own set_timeout() callback to set the maximum timeout if the host has. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3c188a7a9b66..d481f6aa36ec 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -867,7 +867,7 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd, bool *too_big) { u8 count; - struct mmc_data *data = cmd->data; + struct mmc_data *data; unsigned target_timeout, current_timeout; *too_big = true; @@ -881,6 +881,11 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd, if (host->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL) return 0xE; + /* Unspecified command, asume max */ + if (cmd == NULL) + return 0xE; + + data = cmd->data; /* Unspecified timeout, assume max */ if (!data && !cmd->busy_timeout) return 0xE; @@ -3319,7 +3324,7 @@ void sdhci_cqe_enable(struct mmc_host *mmc) SDHCI_BLOCK_SIZE); /* Set maximum timeout */ - sdhci_writeb(host, 0xE, SDHCI_TIMEOUT_CONTROL); + sdhci_set_timeout(host, NULL); host->ier = host->cqe_ier;