From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbbJSVeb (ORCPT ); Mon, 19 Oct 2015 17:34:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:35177 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbbJSVea (ORCPT ); Mon, 19 Oct 2015 17:34:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,704,1437462000"; d="scan'208";a="830685274" From: "Williams, Dan J" To: "thellstrom@vmware.com" CC: "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "syeh@vmware.com" , "airlied@linux.ie" Subject: Re: [PATCH] drm/vmwgfx: switch from ioremap_cache to memremap Thread-Topic: [PATCH] drm/vmwgfx: switch from ioremap_cache to memremap Thread-Index: AQHRBT8t1WpP3+StG0GqllnVa+O7H55pWA2AgABp5IKAAARvvYAKEEIA Date: Mon, 19 Oct 2015 21:34:11 +0000 Message-ID: <1445290450.27395.2.camel@intel.com> References: <20151012223527.34143.87313.stgit@dwillia2-desk3.jf.intel.com> <561C9427.8020001@vmware.com> <561D4F65.5080908@vmware.com> <561D52FE.5080304@vmware.com> In-Reply-To: <561D52FE.5080304@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t9JLYaCA011529 On Tue, 2015-10-13 at 20:52 +0200, Thomas Hellstrom wrote: > > Ok, I'll make local read_fifo() and write_fifo() macros to make this > > explicit. Are these names ok with you? > > Sure. > So I ended up just leaving the __iomem annotation on mmio_virt for now until the implementation can be converted to use explicit barriers where necessary. 8<----- Subject: drm/vmwgfx: switch from ioremap_cache to memremap From: Dan Williams Per commit 2e586a7e017a "drm/vmwgfx: Map the fifo as cached" the driver expects the fifo registers to be cacheable. In preparation for deprecating ioremap_cache() convert its usage in vmwgfx to memremap(). Cc: David Airlie Cc: Thomas Hellstrom Cc: Sinclair Yeh Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dan Williams --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 2c7a25c71af2..33e9eda77bad 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -752,8 +752,14 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); dev_priv->active_master = &dev_priv->fbdev_master; - dev_priv->mmio_virt = ioremap_cache(dev_priv->mmio_start, - dev_priv->mmio_size); + /* + * Force __iomem for this mapping until the implied compiler + * barriers and {READ|WRITE}_ONCE semantics from the + * io{read|write}32() accessors can be replaced with explicit + * barriers. + */ + dev_priv->mmio_virt = (void __iomem *) memremap(dev_priv->mmio_start, + dev_priv->mmio_size, MEMREMAP_WB); if (unlikely(dev_priv->mmio_virt == NULL)) { ret = -ENOMEM; @@ -907,7 +913,7 @@ out_no_irq: out_no_device: ttm_object_device_release(&dev_priv->tdev); out_err4: - iounmap(dev_priv->mmio_virt); + memunmap((void __force *) dev_priv->mmio_virt); out_err3: vmw_ttm_global_release(dev_priv); out_err0: @@ -958,7 +964,7 @@ static int vmw_driver_unload(struct drm_device *dev) pci_release_regions(dev->pdev); ttm_object_device_release(&dev_priv->tdev); - iounmap(dev_priv->mmio_virt); + memunmap((void __force *) dev_priv->mmio_virt); if (dev_priv->ctx.staged_bindings) vmw_binding_state_free(dev_priv->ctx.staged_bindings); vmw_ttm_global_release(dev_priv); {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I