From patchwork Fri Feb 15 15:14:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2148461 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 935A63FE80 for ; Fri, 15 Feb 2013 15:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758755Ab3BOPOR (ORCPT ); Fri, 15 Feb 2013 10:14:17 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:55744 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755769Ab3BOPOO (ORCPT ); Fri, 15 Feb 2013 10:14:14 -0500 Received: from axis700.grange (dslb-188-109-033-039.pools.arcor-ip.net [188.109.33.39]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MM2cS-1TyfMG2ZAq-008KxL; Fri, 15 Feb 2013 16:14:13 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 750DE40BC9; Fri, 15 Feb 2013 16:14:10 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1U6MzK-0004k9-AR; Fri, 15 Feb 2013 16:14:10 +0100 From: Guennadi Liakhovetski To: linux-mmc@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, linux-sh@vger.kernel.org, Magnus Damm , Simon Horman , Arnd Bergmann , Guennadi Liakhovetski Subject: [PATCH v4 13/13] mmc: tmio: add barriers to IO operations Date: Fri, 15 Feb 2013 16:14:02 +0100 Message-Id: <1360941242-18153-14-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1360941242-18153-1-git-send-email-g.liakhovetski@gmx.de> References: <1360941242-18153-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:KPzd9U8uPxEa05yDCkqUDoH54qgZWOTp+N02hhwrkGa 6Oaq0vMuRuuWQrdeJjInrsgXAj4EP7E2zSB8Gq7lP2C3xe1jdj +lLEm5lzpT6FtVRiz5M04CJXn8iIOJB17/6qOa4RAHiFQWPO+V HjIGYAuNZqZbDYVLlgQITqmu2JsB2F/51BiE4+0rc9UyltbfOq lZzjITlCi9USiKJcqpQQa9xG4xIkN1BTCoiIjLRSH1r/tT3dHb ZyekrjFGzoaTBpwt70GjgbfsNXhLWUCIWVSV56Y3P/kHMmqBo2 3XYTQ+M1iLuMOKAeToTVk2VZ4v+j7c+QqxM9VHk0UfvArFeHNI 1D++OYfuY+kfU/AlAT02Zaa8RpMN1XlhVs6Yfc/faRF08/az+r FGUwtKcfOVrcwAhV2s1cAnw6X7gCWiHTPk= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Without barriers SDIO operations fail with runtime PM enabled. Reviewed-by: Paul Mundt Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/host/tmio_mmc.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index d857f5c..a10ebd0 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -159,19 +159,20 @@ int tmio_mmc_host_runtime_resume(struct device *dev); static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) { - return readw(host->ctl + (addr << host->bus_shift)); + return ioread16(host->ctl + (addr << host->bus_shift)); } static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr, u16 *buf, int count) { - readsw(host->ctl + (addr << host->bus_shift), buf, count); + wmb(); + ioread16_rep(host->ctl + (addr << host->bus_shift), buf, count); } static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr) { - return readw(host->ctl + (addr << host->bus_shift)) | - readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16; + return ioread16(host->ctl + (addr << host->bus_shift)) | + ioread16(host->ctl + ((addr + 2) << host->bus_shift)) << 16; } static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val) @@ -181,19 +182,20 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val */ if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr)) return; - writew(val, host->ctl + (addr << host->bus_shift)); + iowrite16(val, host->ctl + (addr << host->bus_shift)); } static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr, u16 *buf, int count) { - writesw(host->ctl + (addr << host->bus_shift), buf, count); + iowrite16_rep(host->ctl + (addr << host->bus_shift), buf, count); + wmb(); } static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val) { - writew(val, host->ctl + (addr << host->bus_shift)); - writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); + iowrite16(val, host->ctl + (addr << host->bus_shift)); + iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); }