From patchwork Wed Feb 6 19:47:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2106581 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 7D0A73FCFC for ; Wed, 6 Feb 2013 19:47:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758072Ab3BFTrY (ORCPT ); Wed, 6 Feb 2013 14:47:24 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:49595 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757638Ab3BFTrW (ORCPT ); Wed, 6 Feb 2013 14:47:22 -0500 Received: from axis700.grange (dslb-178-006-240-079.pools.arcor-ip.net [178.6.240.79]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MekHI-1UIdRB3Nfc-00OV0Z; Wed, 06 Feb 2013 20:47:06 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id ECC6740BC8; Wed, 6 Feb 2013 20:47:04 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1U3AxU-0004qb-QE; Wed, 06 Feb 2013 20:47:04 +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 , Guennadi Liakhovetski , Paul Mundt Subject: [PATCH v3 13/13] mmc: tmio: add barriers to IO operations Date: Wed, 6 Feb 2013 20:47:00 +0100 Message-Id: <1360180020-18555-14-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1360180020-18555-1-git-send-email-g.liakhovetski@gmx.de> References: <1360180020-18555-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:JjsxHAJLhT1Aib8a2ZCFCkhtU/f54de/eZUQIJOSOpF BDsdaDNLiAAB1yAS3to4zfdG9WrgYX9tsee+rpY4RjwKHdzNJD egWe6PZ+4OR5wOV1JSGn1aTFn8fok/OW+xOnWBHEPMH9XRu4NP OC7DEHWHZmKgXd4x8Gs7+lH3MdRBTXuGLFx2KDkd1Muci0Vz75 gmikQguBiU56QB+tFF+wX1wR/Lde9454Ru8luiH9c36fkNuKvi 7AhrwnjjbnfaqAmHAgXJQwNtjfegRAno23aSdOWMRlJz6gwP5S tU4JsuPc3dw1uf2RjdHaFAZ3QtheAbYqXY5w4UM52rM8EIsUPv TvI4v1GFaAtoLfnMPp8rlDMq+li1D4xJn5OQYth0Bw5mstQRzA zPoxxiMl5TmBg== 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. Signed-off-by: Guennadi Liakhovetski Cc: Paul Mundt Reviewed-by: Paul Mundt --- v3: use iowrite16_rep() and ioread16_rep() for consistency. 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)); }