From patchwork Mon Jan 28 22:36:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alamy Liu X-Patchwork-Id: 10784973 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 2AB3D1390 for ; Mon, 28 Jan 2019 22:36:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1780F2B230 for ; Mon, 28 Jan 2019 22:36:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09F7B2B26F; Mon, 28 Jan 2019 22:36:58 +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,FREEMAIL_FROM,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 B76BD2B230 for ; Mon, 28 Jan 2019 22:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbfA1Wg5 (ORCPT ); Mon, 28 Jan 2019 17:36:57 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36441 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfA1Wg4 (ORCPT ); Mon, 28 Jan 2019 17:36:56 -0500 Received: by mail-pf1-f194.google.com with SMTP id b85so8682915pfc.3 for ; Mon, 28 Jan 2019 14:36:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EGaVf28KQQ0R2S6vfsVu0HCs6MySjISxtykerEMR7gM=; b=na/Ot8G+8MI971bc6VkHB/XjbHgkjrLb7KZTWs57PSibjUS5uOlvXFS5COZY8LLPDd qnDLuwhXasM+N5VmPPXBwDIHafD5Pv/a07bEWAMqUzy5D5DNJtr4HG/wb+42orZH3Wua RHIXr+b7UmgSavFhvrqplBa/wzhXQ1k5Les+MIPeoDH5esH0LvCIAgzFiKbZ3rXbRjSH bu/HbR6nd7GgdBv+csX8enN8Tz99HJkfQ9hGcNjcbvPfD30rxS4UxEjbSFHgXSHxTaVE j/8JN2yZXh4tt3WLfbduNPTh5EUsqNAgErwb3wXTIItGmAAq71IK+1utEEDDyrSPe6NJ LZhg== 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; bh=EGaVf28KQQ0R2S6vfsVu0HCs6MySjISxtykerEMR7gM=; b=gpZ2uJRjr//xNP1u4cDK+29qfMyjYOZ8xinv3DuyLNjBoYCXFRDa71VbYVaIx9hxt3 k1m/g+xvtgGnzB3+bnZ7J8J3sTUMkysWvmyZmmw8QoHZx3A8gIs3KWk7YvB4rGeFUtX0 2fCysY1aE610RPExsXlrzBGhwLpAUsgB6o2zMrjkyYwDyF+AwQx4Iws11s9MhrafaRvd 1zpxbkyOBmuNUSYy9VwUnDvJFuNupREMfAE5WOyHGneeAfpeFezfcnRNfQusbT+EE98D qsc/gXgY0MVY7gmxoIYuxXdKf9EW2RPe/Fc4F/v4R3j6iOutrgEmTurgA/+1CZZZYa2v fvmA== X-Gm-Message-State: AJcUukcnRxUUR7sGx2gMAA2Va7dqMTtQDpC2huW24hCr3x4VJSx61COJ vxO5fTd0VatWKEor4saJAC0= X-Google-Smtp-Source: ALg8bN6p2y1LWGku748b8HywjE4dBPbnw6b0l/jKt+xNQC3Vy3jRpw8S1UV0TqNUhxPIpOyVUrXS0w== X-Received: by 2002:a62:6385:: with SMTP id x127mr23955994pfb.15.1548715016226; Mon, 28 Jan 2019 14:36:56 -0800 (PST) Received: from localhost.localdomain ([216.13.234.27]) by smtp.gmail.com with ESMTPSA id z9sm84174279pfd.99.2019.01.28.14.36.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 14:36:55 -0800 (PST) From: Alamy Liu To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, Venkat Gopalakrishnan , Alamy Liu Subject: [PATCH 1/2] mmc: cqhci: replace NUM_SLOTS with cq_host->num_slots Date: Mon, 28 Jan 2019 14:36:53 -0800 Message-Id: <20190128223654.18209-1-alamy.liu@gmail.com> X-Mailer: git-send-email 2.17.1 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 Prevent to use fixed value (NUM_SLOTS) after it had been determined and saved in a variable (cq_host->num_slots). Signed-off-by: Alamy Liu --- drivers/mmc/host/cqhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c index 159270e947..26d63594b7 100644 --- a/drivers/mmc/host/cqhci.c +++ b/drivers/mmc/host/cqhci.c @@ -699,7 +699,7 @@ static void cqhci_error_irq(struct mmc_host *mmc, u32 status, int cmd_error, * The only way to guarantee forward progress is to mark at * least one task in error, so if none is indicated, pick one. */ - for (tag = 0; tag < NUM_SLOTS; tag++) { + for (tag = 0; tag < cq_host->num_slots; tag++) { slot = &cq_host->slot[tag]; if (!slot->mrq) continue; From patchwork Mon Jan 28 22:36:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alamy Liu X-Patchwork-Id: 10784975 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 039876C2 for ; Mon, 28 Jan 2019 22:36:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6BB32B26D for ; Mon, 28 Jan 2019 22:36:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D804D2B230; Mon, 28 Jan 2019 22:36:58 +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,FREEMAIL_FROM,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 806AB2B230 for ; Mon, 28 Jan 2019 22:36:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbfA1Wg5 (ORCPT ); Mon, 28 Jan 2019 17:36:57 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38577 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfA1Wg5 (ORCPT ); Mon, 28 Jan 2019 17:36:57 -0500 Received: by mail-pl1-f193.google.com with SMTP id e5so8404524plb.5 for ; Mon, 28 Jan 2019 14:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h+sbqrLenk60F3eDSH1lBbRS/HpdojEGX59+/RMk3xw=; b=khHI3Lz3gcrkP2tR6UlYLsSzN31JCMM1geDm7YJoT1nbi1m62R9w4R5y4Qd0aLR3Lg Kep8pDWW+dx8VEcf8ghRC9MIl9RzLCockzfn/YTpB8ijRTzvO6z9/hJxhWHbEGpRGQkD u8wdtoKm9yagw/wN0frYqG7/n0KgJWiuOEa9LWKVZBihChu5OhWFrVgnSCB75QqM7F82 12dPRZAYRLz1XfToHBryr+v3kkFYnpds82IplmCZ7rrIbecCe8XXo+vUGCIDqZz2Lcrx nLv/OLTiOz7VwvMPuiQC1wMh+EDMSwnaJNaPce1geyrZRC5An6LrZBhGoMqUCBlNeItU V47w== 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; bh=h+sbqrLenk60F3eDSH1lBbRS/HpdojEGX59+/RMk3xw=; b=BVRq9URN4B7YH2pi1YUzUvVaWJaDHLlMTYTS2DXDU0Gg0BWf+Fh8b6O7DQjrSgQVNG SwD5mHfZjn7p8ROIlPjcl8fzotEkS6jAcPERvKb52EVgKARFzcs9Kgfn384JFs1JBew8 tasxzC0pTluuOjv3/wfkAy4F0xvDETD/3qMlW0T5lvAZRsnoRS6+JHH/YwXrIMawEvU5 htEbfpaSYho9fu/mQs44ScT3YXbU8lLnbC5s0aYK/WDVn0LmtPn/GdLiipMXJYkuB8H4 EwnVZgky15IsasGEN0z3OutDEwDOD94dNT9aeCcmuDOVQBSD39NcQ4jnlVtVmV2mWxcq LBpw== X-Gm-Message-State: AJcUukeMvR3HgTbdqMGWb7GAQW24ku9s8apWlBMfg09JHxlfnww9F6ci kyaFeGMy3MTA18olZSLu0G0= X-Google-Smtp-Source: ALg8bN5I5tMo2uJdc29ivSdekVqnSwz/qbYOsd63bqle3jT7Y8EPN75atp6ZT3HhVmpVJZIzrYfNTw== X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr23346739plb.239.1548715016985; Mon, 28 Jan 2019 14:36:56 -0800 (PST) Received: from localhost.localdomain ([216.13.234.27]) by smtp.gmail.com with ESMTPSA id z9sm84174279pfd.99.2019.01.28.14.36.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 14:36:56 -0800 (PST) From: Alamy Liu To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, Venkat Gopalakrishnan , Alamy Liu Subject: [PATCH 2/2] mmc: cqhci: replace DCMD_SLOT with cq_host->dcmd_slot Date: Mon, 28 Jan 2019 14:36:54 -0800 Message-Id: <20190128223654.18209-2-alamy.liu@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128223654.18209-1-alamy.liu@gmail.com> References: <20190128223654.18209-1-alamy.liu@gmail.com> 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 Prevent to use fixed value (DCMD_SLOT) after it had been determined and saved in a variable (cq_host->dcmd). Signed-off-by: Alamy Liu --- drivers/mmc/host/cqhci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c index 26d63594b7..4cc7863c13 100644 --- a/drivers/mmc/host/cqhci.c +++ b/drivers/mmc/host/cqhci.c @@ -76,7 +76,8 @@ static void setup_trans_desc(struct cqhci_host *cq_host, u8 tag) if (cq_host->link_desc_len > 8) *(link_temp + 8) = 0; - if (tag == DCMD_SLOT && (cq_host->mmc->caps2 & MMC_CAP2_CQE_DCMD)) { + if ((tag == cq_host->dcmd_slot) + && (cq_host->mmc->caps2 & MMC_CAP2_CQE_DCMD)) { *link_temp = CQHCI_VALID(0) | CQHCI_ACT(0) | CQHCI_END(1); return; } @@ -548,9 +549,9 @@ static void cqhci_post_req(struct mmc_host *host, struct mmc_request *mrq) } } -static inline int cqhci_tag(struct mmc_request *mrq) +static inline int cqhci_tag(struct mmc_request *mrq, struct cqhci_host *cq_host) { - return mrq->cmd ? DCMD_SLOT : mrq->tag; + return mrq->cmd ? cq_host->dcmd_slot : mrq->tag; } static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq) @@ -558,8 +559,8 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq) int err = 0; u64 data = 0; u64 *task_desc = NULL; - int tag = cqhci_tag(mrq); struct cqhci_host *cq_host = mmc->cqe_private; + int tag = cqhci_tag(mrq, cq_host); unsigned long flags; if (!cq_host->enabled) { @@ -824,7 +825,7 @@ static bool cqhci_timeout(struct mmc_host *mmc, struct mmc_request *mrq, bool *recovery_needed) { struct cqhci_host *cq_host = mmc->cqe_private; - int tag = cqhci_tag(mrq); + int tag = cqhci_tag(mrq, cq_host); struct cqhci_slot *slot = &cq_host->slot[tag]; unsigned long flags; bool timed_out;