From: Dan Williams <dan.j.williams@intel.com>
To: linux-kernel@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>,
linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH 08/20] gma500: switch from acpi_os_ioremap to memremap
Date: Fri, 09 Oct 2015 18:16:19 -0400 [thread overview]
Message-ID: <20151009221619.32203.41564.stgit@dwillia2-desk3.jf.intel.com> (raw)
In-Reply-To: <20151009221537.32203.5867.stgit@dwillia2-desk3.jf.intel.com>
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 <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
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);
next prev parent reply other threads:[~2015-10-09 22:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 22:15 [PATCH 00/20] tree-wide convert to memremap() Dan Williams
2015-10-09 22:15 ` [PATCH 01/20] x86: introduce arch_memremap() Dan Williams
2015-10-09 22:15 ` [PATCH 02/20] arm: " Dan Williams
2015-10-09 22:15 ` [PATCH 03/20] ia64: " Dan Williams
2015-10-09 22:15 ` [PATCH 04/20] sh: " Dan Williams
2015-10-09 22:16 ` [PATCH 05/20] m68k: " Dan Williams
2015-10-09 22:16 ` [PATCH 06/20] arm: switch from ioremap_cache to memremap Dan Williams
2015-10-09 22:16 ` [PATCH 07/20] x86: " Dan Williams
2015-10-09 22:16 ` Dan Williams [this message]
2015-10-09 22:16 ` [PATCH 09/20] i915: switch from acpi_os_ioremap " Dan Williams
2015-10-12 7:01 ` [Intel-gfx] " Daniel Vetter
2015-10-12 21:12 ` Williams, Dan J
2015-10-13 8:24 ` Daniel Vetter
2015-10-13 16:24 ` Dan Williams
2015-10-14 7:33 ` Daniel Vetter
2015-10-09 22:16 ` [PATCH 10/20] acpi: switch from ioremap_cache " Dan Williams
2015-10-09 22:16 ` [PATCH 11/20] sound, skylake: " Dan Williams
2015-10-19 15:26 ` Mark Brown
2015-10-19 15:34 ` Takashi Iwai
2015-10-19 16:08 ` Mark Brown
2015-10-19 16:59 ` Dan Williams
2015-10-09 22:16 ` [PATCH 12/20] memconsole: fix __iomem mishandling, switch " Dan Williams
2015-10-09 22:16 ` [PATCH 13/20] intel-iommu: switch from ioremap_cache " Dan Williams
2015-10-12 21:58 ` Joerg Roedel
2015-10-12 22:05 ` Dan Williams
2015-10-12 22:19 ` Dan Williams
2015-10-14 13:22 ` Joerg Roedel
2015-10-09 22:16 ` [PATCH 14/20] pxa2xx-flash: " Dan Williams
2015-10-12 17:58 ` Brian Norris
2015-10-12 20:31 ` Brian Norris
2015-10-12 20:36 ` Dan Williams
2015-10-09 22:16 ` [PATCH 15/20] sfi: " Dan Williams
2015-10-09 22:17 ` [PATCH 16/20] fbdev: switch from ioremap_wt " Dan Williams
2015-10-09 22:17 ` [PATCH 17/20] arch: kill ioremap_cached() Dan Williams
2015-10-09 22:17 ` [PATCH 18/20] arch: kill ioremap_fullcache() Dan Williams
2015-10-09 22:17 ` [PATCH 19/20] arch: remove ioremap_cache, replace with arch_memremap Dan Williams
2015-10-09 22:17 ` [PATCH 20/20] arch: remove ioremap_wt, optionally " Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151009221619.32203.41564.stgit@dwillia2-desk3.jf.intel.com \
--to=dan.j.williams@intel.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome