From patchwork Mon Jun 5 04:41:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9765481 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 CC9D760353 for ; Mon, 5 Jun 2017 04:41:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFF4027F8C for ; Mon, 5 Jun 2017 04:41:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B45BA27FB7; Mon, 5 Jun 2017 04:41:45 +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.9 required=2.0 tests=BAYES_00,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 2A0EF27FA6 for ; Mon, 5 Jun 2017 04:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751276AbdFEElo (ORCPT ); Mon, 5 Jun 2017 00:41:44 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:62584 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbdFEElk (ORCPT ); Mon, 5 Jun 2017 00:41:40 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20170605044138epoutp0466fbc895095ffa2aa3a45ed3c43ad4e4~FIA6Zj25C0901509015epoutp04H; Mon, 5 Jun 2017 04:41:38 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.67]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170605044138epcas1p1fc44606d97d5450d3e35f59312706163~FIA6Maqdm1128411284epcas1p1C; Mon, 5 Jun 2017 04:41:38 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id C5.55.12779.101E4395; Mon, 5 Jun 2017 13:41:37 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170605044137epcas1p44c44e94f8514d5115daaa83593d57c98~FIA590SWw2526325263epcas1p4S; Mon, 5 Jun 2017 04:41:37 +0000 (GMT) X-AuditID: b6c32a38-f791a6d0000031eb-c7-5934e1013e39 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 41.F1.02179.101E4395; Mon, 5 Jun 2017 13:41:37 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OR200A0S51CWR90@mmp1.samsung.com>; Mon, 05 Jun 2017 13:41:37 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH 5/6] mmc: dw_mmc: use the 'slot' instead of 'cur_slot' Date: Mon, 05 Jun 2017 13:41:34 +0900 Message-id: <20170605044135.18304-6-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20170605044135.18304-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBKsWRmVeSWpSXmKPExsWy7bCmri7jQ5NIg5YXNhY3frWxWhz5389o cefJelaL42vDHVg87lzbw+bxd9Z+Fo++LasYPT5vkgtgiUq1yUhNTEktUkjNS85PycxLt1Xy Do53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAHa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gkBE4kXbx8xQ9hiEhfurWfrYuTiEBLYxihxZPoWKOcHo8SHOc+ZQKrYBHQktn87 DmaLCMhK/PxzgQ3EZhaIk1h09Cd7FyMHh7CAm8TPSwogJouAqsTVZ7ogJq+AtUTHonSIVfIS C88fARvCKWAjsfruIzBbCKjkSnsT0wRG3gWMDKsYuVILinPTc4uNCgw3MQIDcdthLf8djD/O Rh9iFOBgVOLhlcg0iRRiTSwrrsw9xCjBwawkwlt8HSjEm5JYWZValB9fVJqTWnyI0RTokInM UqLJ+cAoySuJNzSxNDIxMDMzNDIwNlMS550Q+CVCSCA9sSQ1OzW1ILUIpo+Jg1OqgXEiyxP1 BTM3Tp/vGrTc4eiUTyJnvBu6ypw3plQ66jgobZOeaMnQb52ffd23c7vwpZOXYvVUYn61CvX+ 2LFMbgGD5OJvFg85xTp5rzurJxYpWB6KymqZz5b06kDOl45TkeG7I+WZHLgfv2TbVXs6+POx fd+DpuidaEzQ7fP7z3S0LbjE9+ytS0osxRmJhlrMRcWJAG9FMrFaAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170605044137epcas1p44c44e94f8514d5115daaa83593d57c98 X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?7KCV7J6s7ZuIG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SmFlaG9vbiBDaHVuZxtUaXplbiBQbGF0Zm9ybSBMYWIuG1Nh?= =?UTF-8?B?bXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170605044137epcas1p44c44e94f8514d5115daaa83593d57c98 X-RootMTR: 20170605044137epcas1p44c44e94f8514d5115daaa83593d57c98 References: <20170605044135.18304-1-jh80.chung@samsung.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 Remove the 'cur_slot'. Instead, just use 'slot'. There is no multiple slots, so we need to consider only one slot. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc-exynos.c | 4 ++-- drivers/mmc/host/dw_mmc.c | 33 ++++++++++++++++----------------- drivers/mmc/host/dw_mmc.h | 3 --- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 25691cc..3502679 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -157,8 +157,8 @@ static void dw_mci_exynos_set_clksel_timing(struct dw_mci *host, u32 timing) * HOLD register should be bypassed in case there is no phase shift * applied on CMD/DATA that is sent to the card. */ - if (!SDMMC_CLKSEL_GET_DRV_WD3(clksel) && host->cur_slot) - set_bit(DW_MMC_CARD_NO_USE_HOLD, &host->cur_slot->flags); + if (!SDMMC_CLKSEL_GET_DRV_WD3(clksel) && host->slot) + set_bit(DW_MMC_CARD_NO_USE_HOLD, &host->slot->flags); } #ifdef CONFIG_PM diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 8a4fa88..97a8b0c 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -392,7 +392,7 @@ static u32 dw_mci_prep_stop_abort(struct dw_mci *host, struct mmc_command *cmd) cmdr = stop->opcode | SDMMC_CMD_STOP | SDMMC_CMD_RESP_CRC | SDMMC_CMD_RESP_EXP; - if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->cur_slot->flags)) + if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->slot->flags)) cmdr |= SDMMC_CMD_USE_HOLD_REG; return cmdr; @@ -480,7 +480,7 @@ static void dw_mci_dmac_complete_dma(void *arg) if ((host->use_dma == TRANS_MODE_EDMAC) && data && (data->flags & MMC_DATA_READ)) /* Invalidate cache after read */ - dma_sync_sg_for_cpu(mmc_dev(host->cur_slot->mmc), + dma_sync_sg_for_cpu(mmc_dev(host->slot->mmc), data->sg, data->sg_len, DMA_FROM_DEVICE); @@ -820,7 +820,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host, /* Flush cache before write */ if (host->data->flags & MMC_DATA_WRITE) - dma_sync_sg_for_device(mmc_dev(host->cur_slot->mmc), sgl, + dma_sync_sg_for_device(mmc_dev(host->slot->mmc), sgl, sg_elems, DMA_TO_DEVICE); dma_async_issue_pending(host->dms->ch); @@ -1282,7 +1282,6 @@ static void __dw_mci_start_request(struct dw_mci *host, mrq = slot->mrq; - host->cur_slot = slot; host->mrq = mrq; host->pending_events = 0; @@ -1763,7 +1762,7 @@ static bool dw_mci_reset(struct dw_mci *host) ciu_out: /* After a CTRL reset we need to have CIU set clock registers */ - mci_send_cmd(host->cur_slot, SDMMC_CMD_UPD_CLK, 0); + mci_send_cmd(host->slot, SDMMC_CMD_UPD_CLK, 0); return ret; } @@ -1790,11 +1789,11 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq) __acquires(&host->lock) { struct dw_mci_slot *slot; - struct mmc_host *prev_mmc = host->cur_slot->mmc; + struct mmc_host *prev_mmc = host->slot->mmc; WARN_ON(host->cmd || host->data); - host->cur_slot->mrq = NULL; + host->slot->mrq = NULL; host->mrq = NULL; if (!list_empty(&host->queue)) { slot = list_entry(host->queue.next, @@ -1944,7 +1943,7 @@ static void dw_mci_tasklet_func(unsigned long priv) err = dw_mci_command_complete(host, cmd); if (cmd == mrq->sbc && !err) { prev_state = state = STATE_SENDING_CMD; - __dw_mci_start_request(host, host->cur_slot, + __dw_mci_start_request(host, host->slot, mrq->cmd); goto unlock; } @@ -3261,9 +3260,9 @@ int dw_mci_runtime_suspend(struct device *dev) clk_disable_unprepare(host->ciu_clk); - if (host->cur_slot && - (mmc_can_gpio_cd(host->cur_slot->mmc) || - !mmc_card_is_removable(host->cur_slot->mmc))) + if (host->slot && + (mmc_can_gpio_cd(host->slot->mmc) || + !mmc_card_is_removable(host->slot->mmc))) clk_disable_unprepare(host->biu_clk); return 0; @@ -3276,9 +3275,9 @@ int dw_mci_runtime_resume(struct device *dev) struct dw_mci *host = dev_get_drvdata(dev); struct dw_mci_slot *slot = host->slot; - if (host->cur_slot && - (mmc_can_gpio_cd(host->cur_slot->mmc) || - !mmc_card_is_removable(host->cur_slot->mmc))) { + if (host->slot && + (mmc_can_gpio_cd(host->slot->mmc) || + !mmc_card_is_removable(host->slot->mmc))) { ret = clk_prepare_enable(host->biu_clk); if (ret) return ret; @@ -3326,9 +3325,9 @@ int dw_mci_runtime_resume(struct device *dev) return 0; err: - if (host->cur_slot && - (mmc_can_gpio_cd(host->cur_slot->mmc) || - !mmc_card_is_removable(host->cur_slot->mmc))) + if (host->slot && + (mmc_can_gpio_cd(host->slot->mmc) || + !mmc_card_is_removable(host->slot->mmc))) clk_disable_unprepare(host->biu_clk); return ret; diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 1ec8f40..75da375 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -132,7 +132,6 @@ struct dw_mci_dma_slave { * ======= * * @lock is a softirq-safe spinlock protecting @queue as well as - * @cur_slot, @mrq and @state. These must always be updated * at the same time while holding @lock. * * @irq_lock is an irq-safe spinlock protecting the INTMASK register @@ -168,7 +167,6 @@ struct dw_mci { struct scatterlist *sg; struct sg_mapping_iter sg_miter; - struct dw_mci_slot *cur_slot; struct mmc_request *mrq; struct mmc_command *cmd; struct mmc_data *data; @@ -204,7 +202,6 @@ struct dw_mci { u32 bus_hz; u32 current_speed; - u32 num_slots; u32 fifoth_val; u16 verid; struct device *dev;