From patchwork Thu Jan 14 12:08:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 8031201 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 032C09F32E for ; Thu, 14 Jan 2016 12:08:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D98EC2042B for ; Thu, 14 Jan 2016 12:08:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B09D20426 for ; Thu, 14 Jan 2016 12:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753745AbcANMIf (ORCPT ); Thu, 14 Jan 2016 07:08:35 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:58381 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbcANMIe (ORCPT ); Thu, 14 Jan 2016 07:08:34 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O0X00VHUZ281A50@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Thu, 14 Jan 2016 21:08:32 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id D2.08.04949.FBF87965; Thu, 14 Jan 2016 21:08:32 +0900 (KST) X-AuditID: cbfee68d-f79646d000001355-67-56978fbfdeeb Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 52.5F.13906.FBF87965; Thu, 14 Jan 2016 21:08:31 +0900 (KST) Received: from [10.113.62.216] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O0X005GIZ27HTL0@mmp2.samsung.com>; Thu, 14 Jan 2016 21:08:31 +0900 (KST) Message-id: <56978FBF.1080509@samsung.com> Date: Thu, 14 Jan 2016 21:08:31 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: Ulf Hansson , Ludovic Desroches , Sonic Zhang , Krzysztof Kozlowski , Benjamin Herrenschmidt , Fabio Estevam , Robert Jarzmik , Ben Dooks , Hans de Goede , Adrian Hunter Subject: [RFC PATCH] mmc: remove the MMC_DATA_STREAM flag Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRmVeSWpSXmKPExsWyRsSkRPdA//QwgwMzmS1OPlnDZjFp3QEm iw9NrcwWs7p0Ld4cn85k8fzfD3aLI//7GS0OzUy2mPVG2OLO1mY2i+Nrwx24PV5ddfRY8Gsr i8ffVS+YPfrXfWb1+He4n8lj56y77B6L97xk8uh508LqcefaHjaP9/uusnl83iQXwB3FZZOS mpNZllqkb5fAlXFm1UzmggXuFV3/G5kbGK9adTFyckgImEgsOv2TEcIWk7hwbz0biC0ksIJR on99KEzN/bu3mLoYuYDisxgl/rVPY4UoesAoMeOjZxcjBwevgJbE6481IGEWAVWJ9b9eg5Ww CehIbP92nAnEFhUIk3iwbi9YnFdAUOLH5HssIK0iAtYSzb9lQcYzC2xhlvgy4TLYPcIClhIH z6xlA6lhFlCXmDIlFyTMLCAvsXnNW2aQegmBVg6JeRvfsEPsFZD4NvkQ2EwJAVmJTQeYIc6X lDi44gbLBEaRWUg2z0KYOgvJ1AWMzKsYRVMLkguKk9KLDPWKE3OLS/PS9ZLzczcxA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xJnLf2UmSYkEB6YklqdmpqQWoRTB8TB6dUA+PxhfWdD+Mf2DNlTX9WKO511FMsX27CJOuF C+6+60zt3j7puPL6Cx9vnc6Uk0/YcXy1DH/vaambH/e5RTdE30u+fXf+07K1BQWZNRr2XuVh soELF8XwdZ8ztbcU57f0Sbj99ZtZ6cEM69Xpwv456n8fMV/8/853zRaOk4VLjdL0N6sK3zWc 5qrEUpyRaKjFXFScCADjIL81FQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's not set to MMC_DATA_STREAM anywhere. It seems that it had used with CMD11/20. But now CMD11/20 didn't also use. I didn't know what is exactly, so i sent the patch as just RFC. If i get some comments for this, i will resend the patch after separate to each host controller. If MMC_DATA_STREAM can be removed, then flags of data should be then one of MMC_DATA_READ and MMC_DATA_WRITE. Signed-off-by: Jaehoon Chung Acked-by: Ludovic Desroches --- drivers/mmc/card/block.c | 6 +++--- drivers/mmc/host/atmel-mci.c | 9 ++------- drivers/mmc/host/bfin_sdh.c | 3 --- drivers/mmc/host/davinci_mmc.c | 15 +++------------ drivers/mmc/host/dw_mmc.c | 2 -- drivers/mmc/host/jz4740_mmc.c | 2 -- drivers/mmc/host/mxcmmc.c | 3 --- drivers/mmc/host/pxamci.c | 6 ------ drivers/mmc/host/s3cmci.c | 3 +-- drivers/mmc/host/sunxi-mmc.c | 5 ----- include/linux/mmc/core.h | 1 - 11 files changed, 9 insertions(+), 46 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 5914263..e7449cb 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1525,13 +1525,13 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, } if (rq_data_dir(req) == READ) { brq->cmd.opcode = readcmd; - brq->data.flags |= MMC_DATA_READ; + brq->data.flags = MMC_DATA_READ; if (brq->mrq.stop) brq->stop.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; } else { brq->cmd.opcode = writecmd; - brq->data.flags |= MMC_DATA_WRITE; + brq->data.flags = MMC_DATA_WRITE; if (brq->mrq.stop) brq->stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; @@ -1800,7 +1800,7 @@ static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq, brq->data.blksz = 512; brq->data.blocks = packed->blocks + hdr_blocks; - brq->data.flags |= MMC_DATA_WRITE; + brq->data.flags = MMC_DATA_WRITE; brq->stop.opcode = MMC_STOP_TRANSMISSION; brq->stop.arg = 0; diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index a36ebda..e0c8c51 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -849,9 +849,7 @@ static u32 atmci_prepare_command(struct mmc_host *mmc, if (cmd->opcode == SD_IO_RW_EXTENDED) { cmdr |= ATMCI_CMDR_SDIO_BLOCK; } else { - if (data->flags & MMC_DATA_STREAM) - cmdr |= ATMCI_CMDR_STREAM; - else if (data->blocks > 1) + if (data->blocks > 1) cmdr |= ATMCI_CMDR_MULTI_BLOCK; else cmdr |= ATMCI_CMDR_BLOCK; @@ -1372,10 +1370,7 @@ static void atmci_start_request(struct atmel_mci *host, host->stop_cmdr |= ATMCI_CMDR_STOP_XFER; if (!(data->flags & MMC_DATA_WRITE)) host->stop_cmdr |= ATMCI_CMDR_TRDIR_READ; - if (data->flags & MMC_DATA_STREAM) - host->stop_cmdr |= ATMCI_CMDR_STREAM; - else - host->stop_cmdr |= ATMCI_CMDR_MULTI_BLOCK; + host->stop_cmdr |= ATMCI_CMDR_MULTI_BLOCK; } /* diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c index 2b7f37e..526231e 100644 --- a/drivers/mmc/host/bfin_sdh.c +++ b/drivers/mmc/host/bfin_sdh.c @@ -126,9 +126,6 @@ static int sdh_setup_data(struct sdh_host *host, struct mmc_data *data) length = data->blksz * data->blocks; bfin_write_SDH_DATA_LGTH(length); - if (data->flags & MMC_DATA_STREAM) - data_ctl |= DTX_MODE; - if (data->flags & MMC_DATA_READ) data_ctl |= DTX_DIR; /* Only supports power-of-2 block size */ diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index ea2a2eb..693144e 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -346,10 +346,6 @@ static void mmc_davinci_start_command(struct mmc_davinci_host *host, if (cmd->data) cmd_reg |= MMCCMD_WDATX; - /* Setting whether stream or block transfer */ - if (cmd->flags & MMC_DATA_STREAM) - cmd_reg |= MMCCMD_STRMTP; - /* Setting whether data read or write */ if (host->data_dir == DAVINCI_MMC_DATADIR_WRITE) cmd_reg |= MMCCMD_DTRW; @@ -568,8 +564,7 @@ mmc_davinci_prepare_data(struct mmc_davinci_host *host, struct mmc_request *req) return; } - dev_dbg(mmc_dev(host->mmc), "%s %s, %d blocks of %d bytes\n", - (data->flags & MMC_DATA_STREAM) ? "stream" : "block", + dev_dbg(mmc_dev(host->mmc), "%s, %d blocks of %d bytes\n", (data->flags & MMC_DATA_WRITE) ? "write" : "read", data->blocks, data->blksz); dev_dbg(mmc_dev(host->mmc), " DTO %d cycles + %d ns\n", @@ -584,22 +579,18 @@ mmc_davinci_prepare_data(struct mmc_davinci_host *host, struct mmc_request *req) writel(data->blksz, host->base + DAVINCI_MMCBLEN); /* Configure the FIFO */ - switch (data->flags & MMC_DATA_WRITE) { - case MMC_DATA_WRITE: + if (data->flags & MMC_DATA_WRITE) { host->data_dir = DAVINCI_MMC_DATADIR_WRITE; writel(fifo_lev | MMCFIFOCTL_FIFODIR_WR | MMCFIFOCTL_FIFORST, host->base + DAVINCI_MMCFIFOCTL); writel(fifo_lev | MMCFIFOCTL_FIFODIR_WR, host->base + DAVINCI_MMCFIFOCTL); - break; - - default: + } else { host->data_dir = DAVINCI_MMC_DATADIR_READ; writel(fifo_lev | MMCFIFOCTL_FIFODIR_RD | MMCFIFOCTL_FIFORST, host->base + DAVINCI_MMCFIFOCTL); writel(fifo_lev | MMCFIFOCTL_FIFODIR_RD, host->base + DAVINCI_MMCFIFOCTL); - break; } host->buffer = NULL; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index fddbcb6..b542c42 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -290,8 +290,6 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) data = cmd->data; if (data) { cmdr |= SDMMC_CMD_DAT_EXP; - if (data->flags & MMC_DATA_STREAM) - cmdr |= SDMMC_CMD_STRM_MODE; if (data->flags & MMC_DATA_WRITE) cmdr |= SDMMC_CMD_DAT_WR; } diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index 76e8bce..03ddf0e 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -660,8 +660,6 @@ static void jz4740_mmc_send_command(struct jz4740_mmc_host *host, cmdat |= JZ_MMC_CMDAT_DATA_EN; if (cmd->data->flags & MMC_DATA_WRITE) cmdat |= JZ_MMC_CMDAT_WRITE; - if (cmd->data->flags & MMC_DATA_STREAM) - cmdat |= JZ_MMC_CMDAT_STREAM; if (host->use_dma) cmdat |= JZ_MMC_CMDAT_DMA_EN; diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index d110f9e..3d1ea5e 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -307,9 +307,6 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) enum dma_transfer_direction slave_dirn; int i, nents; - if (data->flags & MMC_DATA_STREAM) - nob = 0xffff; - host->data = data; data->bytes_xfered = 0; diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index ce08896..4285d3a 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -191,9 +191,6 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) host->data = data; - if (data->flags & MMC_DATA_STREAM) - nob = 0xffff; - writel(nob, host->base + MMC_NOB); writel(data->blksz, host->base + MMC_BLKLEN); @@ -443,9 +440,6 @@ static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq) cmdat |= CMDAT_DATAEN | CMDAT_DMAEN; if (mrq->data->flags & MMC_DATA_WRITE) cmdat |= CMDAT_WRITE; - - if (mrq->data->flags & MMC_DATA_STREAM) - cmdat |= CMDAT_STREAM; } pxamci_start_cmd(host, mrq->cmd, cmdat); diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 6291d50..39814f3 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1014,8 +1014,7 @@ static int s3cmci_setup_data(struct s3cmci_host *host, struct mmc_data *data) if (host->bus_width == MMC_BUS_WIDTH_4) dcon |= S3C2410_SDIDCON_WIDEBUS; - if (!(data->flags & MMC_DATA_STREAM)) - dcon |= S3C2410_SDIDCON_BLOCKMODE; + dcon |= S3C2410_SDIDCON_BLOCKMODE; if (data->flags & MMC_DATA_WRITE) { dcon |= S3C2410_SDIDCON_TXAFTERRESP; diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 83de82b..d61c58e 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -815,11 +815,6 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) if ((cmd->flags & MMC_CMD_MASK) == MMC_CMD_ADTC) { cmd_val |= SDXC_DATA_EXPIRE | SDXC_WAIT_PRE_OVER; - if (cmd->data->flags & MMC_DATA_STREAM) { - imask |= SDXC_AUTO_COMMAND_DONE; - cmd_val |= SDXC_SEQUENCE_MODE | - SDXC_SEND_AUTO_STOP; - } if (cmd->data->stop) { imask |= SDXC_AUTO_COMMAND_DONE; diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 37967b6..b01e77d 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -113,7 +113,6 @@ struct mmc_data { #define MMC_DATA_WRITE (1 << 8) #define MMC_DATA_READ (1 << 9) -#define MMC_DATA_STREAM (1 << 10) unsigned int bytes_xfered;