From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org,
stable-review@kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
Zhenyu Wang <zhenyu.z.wang@intel.com>,
Zhenyu Wang <zhenyuw@linux.intel.com>,
Dave Airlie <airlied@redhat.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 15/52] drm: remove address mask param for drm_pci_alloc()
Date: Thu, 14 Jan 2010 14:26:54 -0800 [thread overview]
Message-ID: <1263508051-7868-15-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1263508051-7868-14-git-send-email-gregkh@suse.de>
From: Zhenyu Wang <zhenyu.z.wang@intel.com>
commit e6be8d9d17bd44061116f601fe2609b3ace7aa69 upstream.
drm_pci_alloc() has input of address mask for setting pci dma
mask on the device, which should be properly setup by drm driver.
And leave it as a param for drm_pci_alloc() would cause confusion
or mistake would corrupt the correct dma mask setting, as seen on
intel hw which set wrong dma mask for hw status page. So remove
it from drm_pci_alloc() function.
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/ati_pcigart.c | 10 ++++++++--
drivers/gpu/drm/drm_bufs.c | 4 ++--
drivers/gpu/drm/drm_pci.c | 8 +-------
drivers/gpu/drm/i915/i915_dma.c | 2 +-
drivers/gpu/drm/i915/i915_gem.c | 2 +-
include/drm/drmP.h | 2 +-
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 628eae3..a1fce68 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -39,8 +39,7 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
struct drm_ati_pcigart_info *gart_info)
{
gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size,
- PAGE_SIZE,
- gart_info->table_mask);
+ PAGE_SIZE);
if (gart_info->table_handle == NULL)
return -ENOMEM;
@@ -112,6 +111,13 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
+ if (pci_set_dma_mask(dev->pdev, gart_info->table_mask)) {
+ DRM_ERROR("fail to set dma mask to 0x%Lx\n",
+ gart_info->table_mask);
+ ret = 1;
+ goto done;
+ }
+
ret = drm_ati_alloc_pcigart_table(dev, gart_info);
if (ret) {
DRM_ERROR("cannot allocate PCI GART page!\n");
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 3d09e30..8417cc4 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
* As we're limiting the address to 2^32-1 (or less),
* casting it down to 32 bits is no problem, but we
* need to point to a 64bit variable first. */
- dmah = drm_pci_alloc(dev, map->size, map->size, 0xffffffffUL);
+ dmah = drm_pci_alloc(dev, map->size, map->size);
if (!dmah) {
kfree(map);
return -ENOMEM;
@@ -885,7 +885,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
while (entry->buf_count < count) {
- dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000, 0xfffffffful);
+ dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000);
if (!dmah) {
/* Set count correctly so we free the proper amount. */
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 577094f..e68ebf9 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -47,8 +47,7 @@
/**
* \brief Allocate a PCI consistent memory block, for DMA.
*/
-drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align,
- dma_addr_t maxaddr)
+drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
{
drm_dma_handle_t *dmah;
#if 1
@@ -63,11 +62,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
if (align > size)
return NULL;
- if (pci_set_dma_mask(dev->pdev, maxaddr) != 0) {
- DRM_ERROR("Setting pci dma mask failed\n");
- return NULL;
- }
-
dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL);
if (!dmah)
return NULL;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index e5b138b..4a553ad 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -123,7 +123,7 @@ static int i915_init_phys_hws(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
/* Program Hardware Status Page */
dev_priv->status_page_dmah =
- drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
+ drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE);
if (!dev_priv->status_page_dmah) {
DRM_ERROR("Can not allocate hardware status page\n");
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3d75c67..df2c625 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4637,7 +4637,7 @@ int i915_gem_init_phys_object(struct drm_device *dev,
phys_obj->id = id;
- phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff);
+ phys_obj->handle = drm_pci_alloc(dev, size, 0);
if (!phys_obj->handle) {
ret = -ENOMEM;
goto kfree_obj;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9d3d684..7ad3faa 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1402,7 +1402,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
struct drm_ati_pcigart_info * gart_info);
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
- size_t align, dma_addr_t maxaddr);
+ size_t align);
extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
--
1.6.6
next prev parent reply other threads:[~2010-01-14 22:28 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 22:25 [00/52] 2.6.32.4-stable review Greg KH
2010-01-14 22:26 ` [PATCH 01/52] untangle the do_mremap() mess Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 02/52] fasync: split 'fasync_helper()' into separate add/remove functions Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 03/52] ASoC: fix params_rate() macro use in several codecs Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 04/52] modules: Skip empty sections when exporting section notes Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 05/52] exofs: simple_write_end does not mark_inode_dirty Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 06/52] Revert "x86: Side-step lguest problem by only building cmpxchg8b_emu for pre-Pentium" Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 07/52] nfsd: make sure data is on disk before calling ->fsync Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 08/52] sunrpc: fix peername failed on closed listener Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 09/52] SUNRPC: Fix up an error return value in gss_import_sec_context_kerberos() Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 10/52] SUNRPC: Fix the return value in gss_import_sec_context() Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 11/52] sunrpc: on successful gss error pipe write, don't return error Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 12/52] drm/i915: Update LVDS connector status when receiving ACPI LID event Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 13/52] drm/i915: fix order of fence release wrt flushing Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 14/52] drm/i915: Permit pinning whilst the device is 'suspended' Greg Kroah-Hartman
2010-01-14 22:26 ` Greg Kroah-Hartman [this message]
2010-01-14 22:26 ` [PATCH 16/52] drm/i915: Enable/disable the dithering for LVDS based on VBT setting Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 17/52] drm/i915: Make the BPC in FDI rx/transcoder be consistent with that in pipeconf on Ironlake Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 18/52] drm/i915: Select the correct BPC for LVDS " Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 19/52] drm/i915: fix unused var Greg Kroah-Hartman
2010-01-14 22:26 ` [PATCH 20/52] rtc_cmos: convert shutdown to new pnp_driver->shutdown Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 21/52] drivers/cpuidle/governors/menu.c: fix undefined reference to `__udivdi3' Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 22/52] cgroups: fix 2.6.32 regression causing BUG_ON() in cgroup_diput() Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 23/52] lib/rational.c needs module.h Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 24/52] dma-debug: allow DMA_BIDIRECTIONAL mappings to be synced with DMA_FROM_DEVICE and Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 25/52] kernel/signal.c: fix kernel information leak with print-fatal-signals=1 Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 26/52] mmc_block: add dev_t initialization check Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 27/52] mmc_block: fix probe error cleanup bug Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 28/52] mmc_block: fix queue cleanup Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 29/52] ALSA: hda - Fix ALC861-VD capture source mixer Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 30/52] ALSA: ac97: Add Dell Dimension 2400 to Headphone/Line Jack Sense blacklist Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 31/52] ALSA: atiixp: Specify codec for Foxconn RC4107MA-RS2 Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 32/52] ASoC: Fix WM8350 DSP mode B configuration Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 33/52] netfilter: ebtables: enforce CAP_NET_ADMIN Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 34/52] netfilter: nf_ct_ftp: fix out of bounds read in update_nl_seq() Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 35/52] hwmon: (coretemp) Fix TjMax for Atom N450/D410/D510 CPUs Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 36/52] hwmon: (adt7462) Fix pin 28 monitoring Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 37/52] quota: Fix dquot_transfer for filesystems different from ext4 Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 38/52] xen: fix hang on suspend Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 39/52] iwlwifi: fix iwl_queue_used bug when read_ptr == write_ptr Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 40/52] ath5k: Fix eeprom checksum check for custom sized eeproms Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 41/52] cfg80211: fix syntax error on user regulatory hints Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 42/52] iwl: off by one bug Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 43/52] mac80211: add missing sanity checks for action frames Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 44/52] drm/i915: remove render reclock support Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 45/52] libertas: Remove carrier signaling from the scan code Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 46/52] kernel/sysctl.c: fix stable merge error in NOMMU mmap_min_addr Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 47/52] mac80211: fix skb buffering issue (and fixes to that) Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 48/52] fix braindamage in audit_tree.c untag_chunk() Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 49/52] fix more leaks in audit_tree.c tag_chunk() Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 50/52] module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 51/52] ipv6: skb_dst() can be NULL in ipv6_hop_jumbo() Greg Kroah-Hartman
2010-01-14 22:27 ` [PATCH 52/52] Linux 2.6.32.4-rc1 Greg Kroah-Hartman
2010-01-14 23:38 ` [Stable-review] [PATCH 15/52] drm: remove address mask param for drm_pci_alloc() Ben Hutchings
2010-01-14 23:45 ` Greg KH
2010-01-15 0:56 ` Zhenyu Wang
2010-01-16 0:15 ` Greg KH
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=1263508051-7868-15-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=zhenyu.z.wang@intel.com \
--cc=zhenyuw@linux.intel.com \
/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