diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/agp/intel-agp.c | 97 | ||||
-rw-r--r-- | drivers/char/drm/drm_pciids.h | 5 | ||||
-rw-r--r-- | drivers/char/drm/i915_dma.c | 90 | ||||
-rw-r--r-- | drivers/char/drm/i915_drm.h | 5 | ||||
-rw-r--r-- | drivers/char/drm/i915_drv.h | 2 | ||||
-rw-r--r-- | drivers/char/drm/radeon_ioc32.c | 26 | ||||
-rw-r--r-- | drivers/net/lasi_82596.c | 1 | ||||
-rw-r--r-- | drivers/net/ppp_mppe.c | 10 | ||||
-rw-r--r-- | drivers/parisc/ccio-dma.c | 14 | ||||
-rw-r--r-- | drivers/parisc/eisa.c | 4 | ||||
-rw-r--r-- | drivers/parisc/iommu-helpers.h | 4 | ||||
-rw-r--r-- | drivers/parisc/pdc_stable.c | 2 | ||||
-rw-r--r-- | drivers/parisc/power.c | 1 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 6 | ||||
-rw-r--r-- | drivers/parisc/superio.c | 8 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 2 | ||||
-rw-r--r-- | drivers/video/console/sticore.c | 50 |
17 files changed, 212 insertions, 115 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index d383168b75f..0439ee951a1 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -1810,68 +1810,69 @@ static int find_gmch(u16 device) static const struct intel_driver_description { unsigned int chip_id; unsigned int gmch_chip_id; + unsigned int multi_gmch_chip; /* if we have more gfx chip type on this HB. */ char *name; const struct agp_bridge_driver *driver; const struct agp_bridge_driver *gmch_driver; } intel_agp_chipsets[] = { - { PCI_DEVICE_ID_INTEL_82443LX_0, 0, "440LX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82443BX_0, 0, "440BX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82443GX_0, 0, "440GX", &intel_generic_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, "i810", + { PCI_DEVICE_ID_INTEL_82443LX_0, 0, 0, "440LX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82443BX_0, 0, 0, "440BX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82443GX_0, 0, 0, "440GX", &intel_generic_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, 0, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, "i810", + { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, 0, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, "i810", + { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, 0, "i810", NULL, &intel_810_driver }, - { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, "i815", - &intel_810_driver, &intel_815_driver }, - { PCI_DEVICE_ID_INTEL_82820_HB, 0, "i820", &intel_820_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, "i820", &intel_820_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, "830M", + { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, 0, "i815", + &intel_815_driver, &intel_810_driver }, + { PCI_DEVICE_ID_INTEL_82820_HB, 0, 0, "i820", &intel_820_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, 0, "i820", &intel_820_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, 0, "830M", &intel_830mp_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82840_HB, 0, "i840", &intel_840_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82845_HB, 0, "845G", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, "830M", + { PCI_DEVICE_ID_INTEL_82840_HB, 0, 0, "i840", &intel_840_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82845_HB, 0, 0, "845G", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82850_HB, 0, "i850", &intel_850_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, "855PM", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, "855GM", + { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82860_HB, 0, "i860", &intel_860_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, "865", + { PCI_DEVICE_ID_INTEL_82860_HB, 0, 0, "i860", &intel_860_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, 0, "865", &intel_845_driver, &intel_830_driver }, - { PCI_DEVICE_ID_INTEL_82875_HB, 0, "i875", &intel_845_driver, NULL }, - { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, "915G", + { PCI_DEVICE_ID_INTEL_82875_HB, 0, 0, "i875", &intel_845_driver, NULL }, + { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, 0, "915G", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, "915GM", + { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, 0, "915GM", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, "945G", + { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, "945GM", + { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 1, "945GM", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, "945GME", + { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME", &intel_845_driver, &intel_915_driver }, - { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, "946GZ", + { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, "965G", + { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, 0, "965G", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, "965Q", + { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, 0, "965Q", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, "965G", + { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, "965GM", + { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 1, "965GM", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, "965GME/GLE", + { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE", &intel_845_driver, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL }, - { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL }, - { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, "G33", + { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL }, + { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL }, + { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, 0, "G33", &intel_845_driver, &intel_g33_driver }, - { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, "Q35", + { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, 0, "Q35", &intel_845_driver, &intel_g33_driver }, - { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, "Q33", + { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", &intel_845_driver, &intel_g33_driver }, - { 0, 0, NULL, NULL, NULL } + { 0, 0, 0, NULL, NULL, NULL } }; static int __devinit agp_intel_probe(struct pci_dev *pdev, @@ -1892,10 +1893,19 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, /* In case that multiple models of gfx chip may stand on same host bridge type, this can be sure we detect the right IGD. */ - if ((pdev->device == intel_agp_chipsets[i].chip_id) && - ((intel_agp_chipsets[i].gmch_chip_id == 0) || - find_gmch(intel_agp_chipsets[i].gmch_chip_id))) - break; + if (pdev->device == intel_agp_chipsets[i].chip_id) { + if ((intel_agp_chipsets[i].gmch_chip_id != 0) && + find_gmch(intel_agp_chipsets[i].gmch_chip_id)) { + bridge->driver = + intel_agp_chipsets[i].gmch_driver; + break; + } else if (intel_agp_chipsets[i].multi_gmch_chip) { + continue; + } else { + bridge->driver = intel_agp_chipsets[i].driver; + break; + } + } } if (intel_agp_chipsets[i].name == NULL) { @@ -1906,11 +1916,6 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, return -ENODEV; } - if (intel_agp_chipsets[i].gmch_chip_id != 0) - bridge->driver = intel_agp_chipsets[i].gmch_driver; - else - bridge->driver = intel_agp_chipsets[i].driver; - if (bridge->driver == NULL) { printk(KERN_WARNING PFX "Failed to find bridge device " "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id); diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h index 177ccc07f96..aa6335032d1 100644 --- a/drivers/char/drm/drm_pciids.h +++ b/drivers/char/drm/drm_pciids.h @@ -300,10 +300,15 @@ {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x27a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x27ae, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2972, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x29a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x29b2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x29c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x29d2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0, 0, 0} diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c index 1ba15d9a171..ea52740af4f 100644 --- a/drivers/char/drm/i915_dma.c +++ b/drivers/char/drm/i915_dma.c @@ -35,7 +35,12 @@ dev->pci_device == 0x2982 || \ dev->pci_device == 0x2992 || \ dev->pci_device == 0x29A2 || \ - dev->pci_device == 0x2A02) + dev->pci_device == 0x2A02 || \ + dev->pci_device == 0x2A12) + +#define IS_G33(dev) (dev->pci_device == 0x29b2 || \ + dev->pci_device == 0x29c2 || \ + dev->pci_device == 0x29d2) /* Really want an OS-independent resettable timer. Would like to have * this loop run for (eg) 3 sec, but have the timer reset every time @@ -106,6 +111,12 @@ static int i915_dma_cleanup(drm_device_t * dev) I915_WRITE(0x02080, 0x1ffff000); } + if (dev_priv->status_gfx_addr) { + dev_priv->status_gfx_addr = 0; + drm_core_ioremapfree(&dev_priv->hws_map, dev); + I915_WRITE(0x2080, 0x1ffff000); + } + drm_free(dev->dev_private, sizeof(drm_i915_private_t), DRM_MEM_DRIVER); @@ -179,26 +190,24 @@ static int i915_initialize(drm_device_t * dev, dev_priv->allow_batchbuffer = 1; /* Program Hardware Status Page */ - dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, - 0xffffffff); + if (!IS_G33(dev)) { + dev_priv->status_page_dmah = + drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); + + if (!dev_priv->status_page_dmah) { + dev->dev_private = (void *)dev_priv; + i915_dma_cleanup(dev); + DRM_ERROR("Can not allocate hardware status page\n"); + return DRM_ERR(ENOMEM); + } + dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; + dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; - if (!dev_priv->status_page_dmah) { - dev->dev_private = (void *)dev_priv; - i915_dma_cleanup(dev); - DRM_ERROR("Can not allocate hardware status page\n"); - return DRM_ERR(ENOMEM); + memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + I915_WRITE(0x02080, dev_priv->dma_status_page); } - dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; - dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; - - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); - DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); - - I915_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); - dev->dev_private = (void *)dev_priv; - return 0; } @@ -231,7 +240,10 @@ static int i915_dma_resume(drm_device_t * dev) } DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); - I915_WRITE(0x02080, dev_priv->dma_status_page); + if (dev_priv->status_gfx_addr != 0) + I915_WRITE(0x02080, dev_priv->status_gfx_addr); + else + I915_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); return 0; @@ -739,6 +751,47 @@ static int i915_setparam(DRM_IOCTL_ARGS) return 0; } +static int i915_set_status_page(DRM_IOCTL_ARGS) +{ + DRM_DEVICE; + drm_i915_private_t *dev_priv = dev->dev_private; + drm_i915_hws_addr_t hws; + + if (!dev_priv) { + DRM_ERROR("%s called with no initialization\n", __FUNCTION__); + return DRM_ERR(EINVAL); + } + DRM_COPY_FROM_USER_IOCTL(hws, (drm_i915_hws_addr_t __user *) data, + sizeof(hws)); + printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws.addr); + + dev_priv->status_gfx_addr = hws.addr & (0x1ffff<<12); + + dev_priv->hws_map.offset = dev->agp->agp_info.aper_base + hws.addr; + dev_priv->hws_map.size = 4*1024; + dev_priv->hws_map.type = 0; + dev_priv->hws_map.flags = 0; + dev_priv->hws_map.mtrr = 0; + + drm_core_ioremap(&dev_priv->hws_map, dev); + if (dev_priv->hws_map.handle == NULL) { + dev->dev_private = (void *)dev_priv; + i915_dma_cleanup(dev); + dev_priv->status_gfx_addr = 0; + DRM_ERROR("can not ioremap virtual address for" + " G33 hw status page\n"); + return DRM_ERR(ENOMEM); + } + dev_priv->hw_status_page = dev_priv->hws_map.handle; + + memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + I915_WRITE(0x02080, dev_priv->status_gfx_addr); + DRM_DEBUG("load hws 0x2080 with gfx mem 0x%x\n", + dev_priv->status_gfx_addr); + DRM_DEBUG("load hws at %p\n", dev_priv->hw_status_page); + return 0; +} + int i915_driver_load(drm_device_t *dev, unsigned long flags) { /* i915 has 4 more counters */ @@ -785,6 +838,7 @@ drm_ioctl_desc_t i915_ioctls[] = { [DRM_IOCTL_NR(DRM_I915_SET_VBLANK_PIPE)] = { i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY }, [DRM_IOCTL_NR(DRM_I915_GET_VBLANK_PIPE)] = { i915_vblank_pipe_get, DRM_AUTH }, [DRM_IOCTL_NR(DRM_I915_VBLANK_SWAP)] = {i915_vblank_swap, DRM_AUTH}, + [DRM_IOCTL_NR(DRM_I915_HWS_ADDR)] = {i915_set_status_page, DRM_AUTH}, }; int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); diff --git a/drivers/char/drm/i915_drm.h b/drivers/char/drm/i915_drm.h index 96a468886a7..7b7b68b96f3 100644 --- a/drivers/char/drm/i915_drm.h +++ b/drivers/char/drm/i915_drm.h @@ -142,6 +142,7 @@ typedef struct _drm_i915_sarea { #define DRM_I915_SET_VBLANK_PIPE 0x0d #define DRM_I915_GET_VBLANK_PIPE 0x0e #define DRM_I915_VBLANK_SWAP 0x0f +#define DRM_I915_HWS_ADDR 0x11 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -262,4 +263,8 @@ typedef struct drm_i915_vblank_swap { unsigned int sequence; } drm_i915_vblank_swap_t; +typedef struct drm_i915_hws_addr { + uint64_t addr; +} drm_i915_hws_addr_t; + #endif /* _I915_DRM_H_ */ diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h index 93cdcfe6aa8..85e323acb95 100644 --- a/drivers/char/drm/i915_drv.h +++ b/drivers/char/drm/i915_drv.h @@ -91,6 +91,8 @@ typedef struct drm_i915_private { void *hw_status_page; dma_addr_t dma_status_page; unsigned long counter; + unsigned int status_gfx_addr; + drm_local_map_t hws_map; unsigned int cpp; int back_offset; diff --git a/drivers/char/drm/radeon_ioc32.c b/drivers/char/drm/radeon_ioc32.c index 1f1f9cc055a..04126c2e79a 100644 --- a/drivers/char/drm/radeon_ioc32.c +++ b/drivers/char/drm/radeon_ioc32.c @@ -349,6 +349,31 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd, DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request); } +typedef struct drm_radeon_setparam32 { + int param; + u64 value; +} __attribute__((packed)) drm_radeon_setparam32_t; + +static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, + unsigned long arg) +{ + drm_radeon_setparam32_t req32; + drm_radeon_setparam_t __user *request; + + if (copy_from_user(&req32, (void __user *) arg, sizeof(req32))) + return -EFAULT; + + request = compat_alloc_user_space(sizeof(*request)); + if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) + || __put_user(req32.param, &request->param) + || __put_user((void __user *)(unsigned long)req32.value, + &request->value)) + return -EFAULT; + + return drm_ioctl(file->f_dentry->d_inode, file, + DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request); +} + drm_ioctl_compat_t *radeon_compat_ioctls[] = { [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, @@ -357,6 +382,7 @@ drm_ioctl_compat_t *radeon_compat_ioctls[] = { [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2, [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf, [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam, + [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam, [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc, [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit, }; diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c index 6b49fc4bd1a..741780e14b2 100644 --- a/drivers/net/lasi_82596.c +++ b/drivers/net/lasi_82596.c @@ -83,6 +83,7 @@ #include <linux/init.h> #include <linux/types.h> #include <linux/bitops.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/pgtable.h> diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index d5bdd257465..5ae80bbe2ed 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c @@ -493,14 +493,14 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, /* * Make sure we have enough room to decrypt the packet. - * Note that for our test we only subtract 1 byte whereas in - * mppe_compress() we added 2 bytes (+MPPE_OVHD); - * this is to account for possible PFC. + * To account for possible PFC we should only subtract 1 + * byte whereas in mppe_compress() we added 2 bytes (+MPPE_OVHD); + * However, we assume no PFC, thus subtracting 2 bytes. */ - if (osize < isize - MPPE_OVHD - 1) { + if (osize < isize - MPPE_OVHD - 2) { printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! " "(have: %d need: %d)\n", state->unit, - osize, isize - MPPE_OVHD - 1); + osize, isize - MPPE_OVHD - 2); return DECOMP_ERROR; } osize = isize - MPPE_OVHD - 2; /* assume no PFC */ diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 894fdb9d44c..b3c4dbff26b 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -32,6 +32,7 @@ */ #include <linux/types.h> +#include <linux/kernel.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/spinlock.h> @@ -292,7 +293,6 @@ static int ioc_count; #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) -#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) /* ** Don't worry about the 150% average search length on a miss. @@ -668,7 +668,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) size_t saved_byte_cnt; /* round up to nearest page size */ - saved_byte_cnt = byte_cnt = ROUNDUP(byte_cnt, IOVP_SIZE); + saved_byte_cnt = byte_cnt = ALIGN(byte_cnt, IOVP_SIZE); while(byte_cnt > 0) { /* invalidate one page at a time */ @@ -751,7 +751,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, offset = ((unsigned long) addr) & ~IOVP_MASK; /* round up to nearest IOVP_SIZE */ - size = ROUNDUP(size + offset, IOVP_SIZE); + size = ALIGN(size + offset, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); #ifdef CCIO_MAP_STATS @@ -814,7 +814,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, iova ^= offset; /* clear offset bits */ size += offset; - size = ROUNDUP(size, IOVP_SIZE); + size = ALIGN(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); @@ -1227,7 +1227,7 @@ ccio_get_iotlb_size(struct parisc_device *dev) #endif /* 0 */ /* We *can't* support JAVA (T600). Venture there at your own risk. */ -static struct parisc_device_id ccio_tbl[] = { +static const struct parisc_device_id ccio_tbl[] = { { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ { 0, } @@ -1370,7 +1370,7 @@ ccio_ioc_init(struct ioc *ioc) } } -static void +static void __init ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr) { int result; @@ -1537,7 +1537,7 @@ int ccio_request_resource(const struct parisc_device *dev, * If so, initialize the chip and tell other partners in crime they * have work to do. */ -static int ccio_probe(struct parisc_device *dev) +static int __init ccio_probe(struct parisc_device *dev) { int i; struct ioc *ioc, **ioc_p = &ioc_list; diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 309076b3985..771cef59254 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -307,7 +307,7 @@ static void init_eisa_pic(void) #define is_mongoose(dev) (dev->id.sversion == 0x00076) -static int __devinit eisa_probe(struct parisc_device *dev) +static int __init eisa_probe(struct parisc_device *dev) { int i, result; @@ -387,7 +387,7 @@ static int __devinit eisa_probe(struct parisc_device *dev) return 0; } -static struct parisc_device_id eisa_tbl[] = { +static const struct parisc_device_id eisa_tbl[] = { { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */ { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */ { 0, } diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h index 38d9e1aba1d..0a1f99a2e93 100644 --- a/drivers/parisc/iommu-helpers.h +++ b/drivers/parisc/iommu-helpers.h @@ -138,7 +138,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** exceed DMA_CHUNK_SIZE if we coalesce the ** next entry. */ - if(unlikely(ROUNDUP(dma_len + dma_offset + startsg->length, + if(unlikely(ALIGN(dma_len + dma_offset + startsg->length, IOVP_SIZE) > DMA_CHUNK_SIZE)) break; @@ -158,7 +158,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** Allocate space for DMA stream. */ sg_dma_len(contig_sg) = dma_len; - dma_len = ROUNDUP(dma_len + dma_offset, IOVP_SIZE); + dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE); sg_dma_address(contig_sg) = PIDE_FLAG | (iommu_alloc_range(ioc, dma_len) << IOVP_SHIFT) diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index 815e445c312..924ef060946 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c @@ -1067,7 +1067,7 @@ pdc_stable_init(void) error = subsys_create_file(&stable_subsys, attr); /* register the paths subsys as a subsystem of stable subsys */ - kset_set_kset_s(&paths_subsys, stable_subsys); + kobj_set_kset_s(&paths_subsys, stable_subsys); if ((rc = subsystem_register(&paths_subsys))) goto fail_subsysreg; diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index 6dedbdef710..90cca5e3805 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -41,6 +41,7 @@ #include <linux/reboot.h> #include <linux/sched.h> #include <linux/kthread.h> +#include <linux/pm.h> #include <asm/pdc.h> #include <asm/io.h> diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 322957ac2ad..d044c48323e 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -113,8 +113,6 @@ module_param(sba_reserve_agpgart, int, 0444); MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART"); #endif -#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) - /************************************ ** SBA register read and write support @@ -352,7 +350,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted) ** SBA HW features in the unmap path. */ unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT); - uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o); + uint bitshiftcnt = ALIGN(ioc->res_bitshift, o); unsigned long mask; if (bitshiftcnt >= BITS_PER_LONG) { @@ -779,7 +777,7 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, offset = iova & ~IOVP_MASK; iova ^= offset; /* clear offset bits */ size += offset; - size = ROUNDUP(size, IOVP_SIZE); + size = ALIGN(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 1fd97f7c8b9..a708c329675 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c @@ -389,7 +389,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) return local_irq; } -static void __devinit superio_serial_init(void) +static void __init superio_serial_init(void) { #ifdef CONFIG_SERIAL_8250 int retval; @@ -423,7 +423,7 @@ static void __devinit superio_serial_init(void) } -static void __devinit superio_parport_init(void) +static void __init superio_parport_init(void) { #ifdef CONFIG_PARPORT_PC if (!parport_pc_probe_port(sio_dev.pp_base, @@ -450,7 +450,7 @@ static void superio_fixup_pci(struct pci_dev *pdev) DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); -static int __devinit +static int __init superio_probe(struct pci_dev *dev, const struct pci_device_id *id) { struct superio_device *sio = &sio_dev; @@ -485,7 +485,7 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENODEV; } -static struct pci_device_id superio_tbl[] = { +static const struct pci_device_id superio_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 17bf9937d27..43652ba523e 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -350,7 +350,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, #define PARPORT_GSC_OFFSET 0x800 -static int __initdata parport_count; +static int __devinitdata parport_count; static int __devinit parport_init_chip(struct parisc_device *dev) { diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index 717b360d041..870017d4497 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c @@ -240,7 +240,7 @@ static void sti_flush(unsigned long from, unsigned long len) flush_icache_range(from, from+len); } -void __init +void __devinit sti_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -269,7 +269,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) static char default_sti_path[21] __read_mostly; #ifndef MODULE -static int __init sti_setup(char *str) +static int __devinit sti_setup(char *str) { if (str) strlcpy (default_sti_path, str, sizeof (default_sti_path)); @@ -288,12 +288,12 @@ __setup("sti=", sti_setup); -static char __initdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; -static int __initdata font_index[MAX_STI_ROMS], - font_height[MAX_STI_ROMS], - font_width[MAX_STI_ROMS]; +static char __devinitdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; +static int __devinitdata font_index[MAX_STI_ROMS], + font_height[MAX_STI_ROMS], + font_width[MAX_STI_ROMS]; #ifndef MODULE -static int __init sti_font_setup(char *str) +static int __devinit sti_font_setup(char *str) { char *x; int i = 0; @@ -346,7 +346,7 @@ __setup("sti_font=", sti_font_setup); -static void __init +static void __devinit sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) { struct sti_glob_cfg_ext *cfg; @@ -386,7 +386,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) cfg->sti_mem_addr, sti_mem_request)); } -static void __init +static void __devinit sti_dump_outptr(struct sti_struct *sti) { DPRINTK((KERN_INFO @@ -400,7 +400,7 @@ sti_dump_outptr(struct sti_struct *sti) sti->outptr.attributes)); } -static int __init +static int __devinit sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, unsigned long hpa) { @@ -482,7 +482,7 @@ sti_init_glob_cfg(struct sti_struct *sti, } #ifdef CONFIG_FB -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { const struct font_desc *fbfont; @@ -538,14 +538,14 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) return cooked_font; } #else -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { return NULL; } #endif -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_font(struct sti_cooked_rom *rom, int (*search_font_fnc) (struct sti_cooked_rom *,int,int) ) { @@ -572,7 +572,7 @@ sti_select_font(struct sti_cooked_rom *rom, } -static void __init +static void __devinit sti_dump_rom(struct sti_rom *rom) { printk(KERN_INFO " id %04x-%04x, conforms to spec rev. %d.%02x\n", @@ -590,7 +590,7 @@ sti_dump_rom(struct sti_rom *rom) } -static int __init +static int __devinit sti_cook_fonts(struct sti_cooked_rom *cooked_rom, struct sti_rom *raw_rom) { @@ -625,7 +625,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, } -static int __init +static int __devinit sti_search_font(struct sti_cooked_rom *rom, int height, int width) { struct sti_cooked_font *font; @@ -642,7 +642,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width) #define BMODE_RELOCATE(offset) offset = (offset) / 4; #define BMODE_LAST_ADDR_OFFS 0x50 -static void * __init +static void * __devinit sti_bmode_font_raw(struct sti_cooked_font *f) { unsigned char *n, *p, *q; @@ -660,7 +660,7 @@ sti_bmode_font_raw(struct sti_cooked_font *f) return n + 3; } -static void __init +static void __devinit sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -675,7 +675,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) sti_flush(dest_start, dest_len); } -static struct sti_rom * __init +static struct sti_rom * __devinit sti_get_bmode_rom (unsigned long address) { struct sti_rom *raw; @@ -711,7 +711,7 @@ sti_get_bmode_rom (unsigned long address) return raw; } -struct sti_rom * __init +struct sti_rom * __devinit sti_get_wmode_rom (unsigned long address) { struct sti_rom *raw; @@ -727,7 +727,7 @@ sti_get_wmode_rom (unsigned long address) return raw; } -int __init +int __devinit sti_read_rom(int wordmode, struct sti_struct *sti, unsigned long address) { struct sti_cooked_rom *cooked; @@ -783,7 +783,7 @@ out_err: return 0; } -static struct sti_struct * __init +static struct sti_struct * __devinit sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd) { struct sti_struct *sti; @@ -898,7 +898,7 @@ out_err: return NULL; } -static void __init sticore_check_for_default_sti(struct sti_struct *sti, char *path) +static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path) { if (strcmp (path, default_sti_path) == 0) default_sti = sti; @@ -909,7 +909,7 @@ static void __init sticore_check_for_default_sti(struct sti_struct *sti, char *p * in the additional address field addr[1] while on * older Systems the PDC stores it in page0->proc_sti */ -static int __init sticore_pa_init(struct parisc_device *dev) +static int __devinit sticore_pa_init(struct parisc_device *dev) { char pa_path[21]; struct sti_struct *sti = NULL; @@ -1015,7 +1015,7 @@ static struct parisc_driver pa_sti_driver = { static int sticore_initialized __read_mostly; -static void __init sti_init_roms(void) +static void __devinit sti_init_roms(void) { if (sticore_initialized) return; |