From patchwork Sat Feb 18 11:50:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9581057 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 0CEF96049F for ; Sat, 18 Feb 2017 11:51:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F062628787 for ; Sat, 18 Feb 2017 11:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E258A28778; Sat, 18 Feb 2017 11:51:23 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78B7D28778 for ; Sat, 18 Feb 2017 11:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject: From:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=b7uAPTm+lG+CqGe4x9GKrOXPi2JqFkYMhDf0hQDUOxo=; b=BrivTerDsxaLGG VKVSJTCLzYia63O26vkXa1kkJZ33yYlvEUq02qfIg5y3sDCny55vqDJjK6mpSXGrsCEcHILet1zx3 I9v5ceaV1O9egHso6uCeIkC+I54sYBe5nIdWjENbrXhU0kQDwSty+0SrmozaZx4X+IMPFrkjAx5Hi di+HdOhKCbeRwl7cR3wiZSZ/1MqGg7HyG6xXsyc0Z03SdgFxhAgxfO0H+9vX75CGvNSEdwrWVgot8 Reap8uBhlfudnX/97qI5I6IKxpnvQMAvmCcT0gR4XwDZ7xCl6ju5uxaeaoR9tYrJbHmJPQ3xYwjay 0rSEkAyi3lcHtaofKnlQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cf3Xl-0007oi-UH; Sat, 18 Feb 2017 11:51:13 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cf3Xh-0007m9-Uc for linux-amlogic@lists.infradead.org; Sat, 18 Feb 2017 11:51:11 +0000 Received: by mail-wm0-x243.google.com with SMTP id v77so6580545wmv.0 for ; Sat, 18 Feb 2017 03:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Crg7OAy37gtIv6Nt7smySmEogfsd0L1FlebSGLQHZnw=; b=s4ABeCd2Lu8ZXLUE8gTZ3r7Qi0ID3aZHWM2CryW1hawkmvJsCpIOP1LvSHbnCuckmZ IWzwvM2+H6pLRdrvOm/Oc7qXllfk7QAWrZttX4ISi7vabPfN+1+4nuVa5oRV1SVIJ3U+ BQgmRoTSPs7JqpSbc3m1aszPad0f4P078PKJfrzmhavNIzrtBrnl5uQcWE1XekLej1Qe ulXN2sCdTNj//SDPiL+9h9mRRkw/HBobr+MlZRVtWUsNOpdxP0uCmPHQ/DbJOclh6eRO jv4j5/oXRkRyJ7tNFuSVzMAP6NGFSGufYBw8KR1KHUg/4zCjkHRDMayZs7MnY4xLpCG/ wlHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=Crg7OAy37gtIv6Nt7smySmEogfsd0L1FlebSGLQHZnw=; b=qIZOpThG4DA2GW421GVdlisaen8OqC5FwAz7wn2sbPJVOqQfpm6dL/s16aFMiHx2y+ 7gdyXdHcewtk1WQZ86va7edmNkN0DzjlHsGJSPnLMu/FOK19Kf6w0/BCCTi9POPbszOZ F4H+j1pTZKCO6+6HHOEkL8MhLaex+cBshtwuonj7s8VLeN8w/tF7rxbNf9zcJHiwA65L qhzu2Pg8Qw9p5rvDlpGO6a1a/yE7fep1+0v85dfSfPTKmqK1sl4guCxlCOgvOhmc+/wq DYpa1QrBKA/dpo0Ki44B+2rX5UpflLgPLCG8PILd2xhCfzgkcF+UtB/qaVGbwf3+dipL 5YXg== X-Gm-Message-State: AMke39nk0F8L7v6onQvMgVsflQAeyowlsA07I/1EWjBsdKimtAw4e+KYyYBsC65HN6RMYg== X-Received: by 10.28.24.5 with SMTP id 5mr4835202wmy.1.1487418648314; Sat, 18 Feb 2017 03:50:48 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:7c19:f774:dabe:f95d? (p200300C6EBDC40007C19F774DABEF95D.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:7c19:f774:dabe:f95d]) by smtp.googlemail.com with ESMTPSA id e14sm5393126wmd.14.2017.02.18.03.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 03:50:47 -0800 (PST) To: Ulf Hansson , Kevin Hilman From: Heiner Kallweit Subject: [PATCH v3 1/10] mmc: meson-gx: simplify bounce buffer setting in meson_mmc_start_cmd Message-ID: <583f6496-68a9-b8e1-6b25-1f073f819a3c@gmail.com> Date: Sat, 18 Feb 2017 12:50:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170218_035110_146767_05F4035F X-CRM114-Status: UNSURE ( 8.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Core ensures that there are no commands with cmd->data being set and nothing to transfer. And we don't have to reset bit CMD_CFG_DATA_NUM because cmd_cfg was zero-initialized and this bit isn't set. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v2: - adjusted commit message because branch xfer_bytes == 0 is never reached - added acked-by v3: - no changes --- drivers/mmc/host/meson-gx-mmc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 5a959783..07a7399c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -516,14 +516,7 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) desc->cmd_cfg &= ~CMD_CFG_DATA_WR; } - if (xfer_bytes > 0) { - desc->cmd_cfg &= ~CMD_CFG_DATA_NUM; - desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; - } else { - /* write data to data_addr */ - desc->cmd_cfg |= CMD_CFG_DATA_NUM; - desc->cmd_data = 0; - } + desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; cmd_cfg_timeout = 12; } else {