From patchwork Thu Jul 30 16:54:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6904961 Return-Path: X-Original-To: patchwork-linux-arm@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 1458C9F38B for ; Thu, 30 Jul 2015 17:03:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BEF720429 for ; Thu, 30 Jul 2015 17:03:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EC3520498 for ; Thu, 30 Jul 2015 17:03:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKrCk-0000pg-SC; Thu, 30 Jul 2015 17:01:14 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKrBx-0007hE-0K for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2015 17:00:26 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 30 Jul 2015 10:00:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,577,1432623600"; d="scan'208";a="773395758" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.11]) by fmsmga002.fm.intel.com with ESMTP; 30 Jul 2015 10:00:04 -0700 Subject: [PATCH v3 08/24] gma500: switch from acpi_os_ioremap to memremap From: Dan Williams To: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com Date: Thu, 30 Jul 2015 12:54:23 -0400 Message-ID: <20150730165423.33962.91402.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150730165155.33962.64121.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150730165155.33962.64121.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150730_100025_330376_E2A2877E X-CRM114-Status: GOOD ( 15.25 ) X-Spam-Score: -8.3 (--------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, toshi.kani@hp.com, linux-nvdimm@lists.01.org, David Airlie , mcgrof@suse.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rmk+kernel@arm.linux.org.uk, hch@lst.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 gma500 expects the OpRegion to be cached (i.e. not __iomem), so explicitly map it with memremap rather than the implied cache setting of acpi_os_ioremap(). Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dan Williams --- drivers/gpu/drm/gma500/opregion.c | 8 ++++---- drivers/gpu/drm/gma500/psb_drv.h | 2 +- drivers/gpu/drm/gma500/psb_lid.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c index ab696ca7eeec..7672ac4d4217 100644 --- a/drivers/gpu/drm/gma500/opregion.c +++ b/drivers/gpu/drm/gma500/opregion.c @@ -297,7 +297,7 @@ void psb_intel_opregion_fini(struct drm_device *dev) cancel_work_sync(&opregion->asle_work); /* just clear all opregion memory pointers now */ - iounmap(opregion->header); + memunmap(opregion->header); opregion->header = NULL; opregion->acpi = NULL; opregion->swsci = NULL; @@ -310,8 +310,8 @@ int psb_intel_opregion_setup(struct drm_device *dev) struct drm_psb_private *dev_priv = dev->dev_private; struct psb_intel_opregion *opregion = &dev_priv->opregion; u32 opregion_phy, mboxes; - void __iomem *base; int err = 0; + void *base; pci_read_config_dword(dev->pdev, PCI_ASLS, &opregion_phy); if (opregion_phy == 0) { @@ -322,7 +322,7 @@ int psb_intel_opregion_setup(struct drm_device *dev) INIT_WORK(&opregion->asle_work, psb_intel_opregion_asle_work); DRM_DEBUG("OpRegion detected at 0x%8x\n", opregion_phy); - base = acpi_os_ioremap(opregion_phy, 8*1024); + base = memremap(opregion_phy, 8*1024, MEMREMAP_WB); if (!base) return -ENOMEM; @@ -351,7 +351,7 @@ int psb_intel_opregion_setup(struct drm_device *dev) return 0; err_out: - iounmap(base); + memunmap(base); return err; } diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h index e38057b91865..189f57135d47 100644 --- a/drivers/gpu/drm/gma500/psb_drv.h +++ b/drivers/gpu/drm/gma500/psb_drv.h @@ -253,7 +253,7 @@ struct psb_intel_opregion { struct opregion_swsci *swsci; struct opregion_asle *asle; void *vbt; - u32 __iomem *lid_state; + u32 *lid_state; struct work_struct asle_work; }; diff --git a/drivers/gpu/drm/gma500/psb_lid.c b/drivers/gpu/drm/gma500/psb_lid.c index 1d2ebb5e530f..6b1b9d0741df 100644 --- a/drivers/gpu/drm/gma500/psb_lid.c +++ b/drivers/gpu/drm/gma500/psb_lid.c @@ -28,14 +28,14 @@ static void psb_lid_timer_func(unsigned long data) struct drm_psb_private * dev_priv = (struct drm_psb_private *)data; struct drm_device *dev = (struct drm_device *)dev_priv->dev; struct timer_list *lid_timer = &dev_priv->lid_timer; + u32 *lid_state = dev_priv->opregion.lid_state; unsigned long irq_flags; - u32 __iomem *lid_state = dev_priv->opregion.lid_state; u32 pp_status; - if (readl(lid_state) == dev_priv->lid_last_state) + if (*lid_state == dev_priv->lid_last_state) goto lid_timer_schedule; - if ((readl(lid_state)) & 0x01) { + if ((*lid_state) & 0x01) { /*lid state is open*/ REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON); do { @@ -58,7 +58,7 @@ static void psb_lid_timer_func(unsigned long data) pp_status = REG_READ(PP_STATUS); } while ((pp_status & PP_ON) == 0); } - dev_priv->lid_last_state = readl(lid_state); + dev_priv->lid_last_state = *lid_state; lid_timer_schedule: spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);