From patchwork Thu Feb 16 19:40:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9578229 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 86F6660209 for ; Thu, 16 Feb 2017 19:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A9472866A for ; Thu, 16 Feb 2017 19:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F6692866D; Thu, 16 Feb 2017 19:43:06 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 E683C2866A for ; Thu, 16 Feb 2017 19:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933219AbdBPTnE (ORCPT ); Thu, 16 Feb 2017 14:43:04 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34534 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932694AbdBPTnE (ORCPT ); Thu, 16 Feb 2017 14:43:04 -0500 Received: by mail-wr0-f195.google.com with SMTP id c4so3247375wrd.1 for ; Thu, 16 Feb 2017 11:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oF/TIBFgbm3aTpTJECM9WXsM2Q+imibr52DrcO4Ozb0=; b=hvNMzkYdceM5B1TyCXQ1QZvxc2nvqDBeEQxRVGB+BxoaIEtxT1D9DBXEgCjx5RclSm QQL5XHz7skiQCIVRDU0f1GZ+Rlcx8BhCOa6+itppzLpW/A0gvsMJyd0Qly/RFym2l5N1 FQjdEXUBqX25pbdgSWKy2O1YBY++BHUi/vSxJkGz0LkgL3bZm4oCIDw2jkdtd5rYf7FK rU86P7KDcNm03ifYB/cQg8TN6QnrYjpLIvbtZBUaEE9ypyj9y9d9ggCRQL62U42qXThd 0tqQvrjPWv08gzTng2z4mO5hqHrHszUYv4iYi7MJcVBWBRRgvlqWkmHCawXUkHKIWFN3 Pq6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oF/TIBFgbm3aTpTJECM9WXsM2Q+imibr52DrcO4Ozb0=; b=Nry9SazP07czFtlv9L+XyPnuBOLw2WqTNNiW0ZXb9pUU7ILw5tlKqXTmo5TXC/xCl9 olXQrO0eo6XZ72MjV//1fM2lPy6Lq2s2FaMMKuujsXfXtJP6gyrxmhCSwP5XLpRixJaH 3Q3ZdX+vOQVVBTcgJVDo1097Ea+zCB7pBRe5I4eKaJivL2zVD8I5e2sLN0CdzPoMQeV4 HBC1JV/eBLr9jnsMtdRPY7/n0qWwmsSzqoIoleYtRMeDhp3At1zecAVIZpdKrJjcRQ/4 0NpEwEyeufiaTbh7FyXmaQ1KPWr1QDudGtCubocPNX4tWLaSZH25bA4y3qUcN5TgIMXo SzOw== X-Gm-Message-State: AMke39lNTcAXk2Dibom3anqvZarnETsZ+Oyx/mQNhCU6A/1Mn6wRIczVIRe0Nq0PUkScfg== X-Received: by 10.223.164.203 with SMTP id h11mr3821924wrb.153.1487274182868; Thu, 16 Feb 2017 11:43:02 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:f02a:ffb3:d41d:abac? (p200300C6EBDC4000F02AFFB3D41DABAC.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f02a:ffb3:d41d:abac]) by smtp.googlemail.com with ESMTPSA id x39sm10195128wrb.3.2017.02.16.11.43.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 11:43:02 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 1/9] mmc: meson-gx: simplify bounce buffer setting in meson_mmc_start_cmd To: Ulf Hansson , Kevin Hilman References: <7d5263e2-9325-dedb-a5f6-954c4a09e977@gmail.com> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: <7673059f-5bd0-a8e4-db3f-4f41370f8a11@gmail.com> Date: Thu, 16 Feb 2017 20:40:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <7d5263e2-9325-dedb-a5f6-954c4a09e977@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 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 --- 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 {