diff options
author | Tobias Powalowski <tobias@T-POWA-LX.(none)> | 2009-01-18 20:21:46 +0100 |
---|---|---|
committer | Tobias Powalowski <tobias@T-POWA-LX.(none)> | 2009-01-18 20:21:46 +0100 |
commit | 076b6f31a252f49371dbfffd299d26d1862545d4 (patch) | |
tree | 42bd9f40df506e21c3ff87914dfeb41484e7af75 /patches | |
parent | 22a2c80b8cac3de2055a27edcd9faa2d28084480 (diff) |
' bump to new upstream version'
Diffstat (limited to 'patches')
-rw-r--r-- | patches/drm-915.patch | 97 | ||||
-rw-r--r-- | patches/pat_fix_reserve_mem_type_for_1mb.patch | 51 | ||||
-rw-r--r-- | patches/thinkfinger.patch | 144 |
3 files changed, 292 insertions, 0 deletions
diff --git a/patches/drm-915.patch b/patches/drm-915.patch new file mode 100644 index 0000000..534c584 --- /dev/null +++ b/patches/drm-915.patch @@ -0,0 +1,97 @@ +commit 9f4f07ceb1716d8796089fcef91621c5f07c872a +Author: Jesse Barnes <jbarnes@virtuousgeek.org> +Date: Thu Jan 8 10:42:15 2009 -0800 + + drm/i915: don't enable vblanks on disabled pipes + + In some cases userland may be confused and try to wait on vblank events from + pipes that aren't actually enabled. We shouldn't allow this, so return + -EINVAL if the pipe isn't on. + + Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> + Signed-off-by: Eric Anholt <eric@anholt.net> + +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c +index 69b9a42..81ac2bd 100644 +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -400,6 +400,12 @@ int i915_enable_vblank(struct drm_device *dev, int pipe) + { + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + unsigned long irqflags; ++ int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; ++ u32 pipeconf; ++ ++ pipeconf = I915_READ(pipeconf_reg); ++ if (!(pipeconf & PIPEACONF_ENABLE)) ++ return -EINVAL; + + spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); + if (IS_I965G(dev)) + +commit e1a6fcee467556a7e955fe1f7ccc134dd2f974e7 +Author: Jesse Barnes <jbarnes@virtuousgeek.org> +Date: Tue Jan 6 10:21:24 2009 -0800 + + drm/i915: set vblank enabled flag correctly across IRQ install/uninstall + + In the absence of kernel mode setting, many drivers disable IRQs across VT + switch. The core DRM vblank code is missing a check for this case however; + even after IRQ disable, the vblank code will still have the vblank_enabled + flag set, so unless we track the fact that they're disabled at IRQ uninstall + time, when we VT switch back in we won't actually re-enable them, which means + any apps waiting on vblank before the switch will hang. + + This patch does that and also adds a sanity check to the wait condition to + look for the irq_enabled flag in general, as well as adding a wakeup to the + IRQ uninstall path. + + Fixes fdo bug #18879 with compiz hangs at VT switch. + + Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> + Signed-off-by: Eric Anholt <eric@anholt.net> + +diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c +index 1e787f8..e2f5d23 100644 +--- a/drivers/gpu/drm/drm_irq.c ++++ b/drivers/gpu/drm/drm_irq.c +@@ -259,7 +259,8 @@ EXPORT_SYMBOL(drm_irq_install); + */ + int drm_irq_uninstall(struct drm_device * dev) + { +- int irq_enabled; ++ unsigned long irqflags; ++ int irq_enabled, i; + + if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) + return -EINVAL; +@@ -269,6 +270,16 @@ int drm_irq_uninstall(struct drm_device * dev) + dev->irq_enabled = 0; + mutex_unlock(&dev->struct_mutex); + ++ /* ++ * Wake up any waiters so they don't hang. ++ */ ++ spin_lock_irqsave(&dev->vbl_lock, irqflags); ++ for (i = 0; i < dev->num_crtcs; i++) { ++ DRM_WAKEUP(&dev->vbl_queue[i]); ++ dev->vblank_enabled[i] = 0; ++ } ++ spin_unlock_irqrestore(&dev->vbl_lock, irqflags); ++ + if (!irq_enabled) + return -EINVAL; + +@@ -617,8 +628,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data, + DRM_DEBUG("waiting on vblank count %d, crtc %d\n", + vblwait->request.sequence, crtc); + DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, +- ((drm_vblank_count(dev, crtc) +- - vblwait->request.sequence) <= (1 << 23))); ++ (((drm_vblank_count(dev, crtc) - ++ vblwait->request.sequence) <= (1 << 23)) || ++ !dev->irq_enabled)); + + if (ret != -EINTR) { + struct timeval now; + diff --git a/patches/pat_fix_reserve_mem_type_for_1mb.patch b/patches/pat_fix_reserve_mem_type_for_1mb.patch new file mode 100644 index 0000000..120f99e --- /dev/null +++ b/patches/pat_fix_reserve_mem_type_for_1mb.patch @@ -0,0 +1,51 @@ +[patch] x86, pat: fix reserve_memtype() for legacy 1MB range + +Thierry Vignaud reported: +> On P4 with an SiS motherboard (video card is a SiS 651) +> X server fails to start with error: +> xf86MapVidMem: Could not mmap framebuffer (0x00000000,0x2000) (Invalid +> argument) + +Here X is trying to map first 8KB of memory using /dev/mem. Existing +code treats first 0-4KB of memory as non-RAM and 4KB-8KB as RAM. Recent +code changes don't allow to map memory with different attributes +at the same time. + +Fix this by treating the first 1MB legacy region as special and always +track the attribute requests with in this region using linear linked +list (and don't bother if the range is RAM or non-RAM or mixed) + +Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> +Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> +--- + +diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c +index 85cbd3c..c959a4d 100644 +--- a/arch/x86/mm/pat.c ++++ b/arch/x86/mm/pat.c +@@ -333,11 +333,20 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, + req_type & _PAGE_CACHE_MASK); + } + +- is_range_ram = pagerange_is_ram(start, end); +- if (is_range_ram == 1) +- return reserve_ram_pages_type(start, end, req_type, new_type); +- else if (is_range_ram < 0) +- return -EINVAL; ++ /* ++ * For legacy reasons, some parts of the physical address range in the ++ * legacy 1MB region is treated as non-RAM (even when listed as RAM in ++ * the e820 tables). So we will track the memory attributes of this ++ * legacy 1MB region using the linear memtype_list always. ++ */ ++ if (end >= ISA_END_ADDRESS) { ++ is_range_ram = pagerange_is_ram(start, end); ++ if (is_range_ram == 1) ++ return reserve_ram_pages_type(start, end, req_type, ++ new_type); ++ else if (is_range_ram < 0) ++ return -EINVAL; ++ } + + new = kmalloc(sizeof(struct memtype), GFP_KERNEL); + if (!new) diff --git a/patches/thinkfinger.patch b/patches/thinkfinger.patch new file mode 100644 index 0000000..6b5e314 --- /dev/null +++ b/patches/thinkfinger.patch @@ -0,0 +1,144 @@ +Index: 2.6.28/drivers/usb/core/usb.h +=================================================================== +--- 2.6.28.orig/drivers/usb/core/usb.h ++++ 2.6.28/drivers/usb/core/usb.h +@@ -10,7 +10,9 @@ extern int usb_create_ep_files(struct de + extern void usb_remove_ep_files(struct usb_host_endpoint *endpoint); + + extern void usb_enable_endpoint(struct usb_device *dev, +- struct usb_host_endpoint *ep); ++ struct usb_host_endpoint *ep, bool reset_toggle); ++extern void usb_enable_interface(struct usb_device *dev, ++ struct usb_interface *intf, bool reset_toggles); + extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr); + extern void usb_disable_interface(struct usb_device *dev, + struct usb_interface *intf); +Index: 2.6.28/drivers/usb/core/driver.c +=================================================================== +--- 2.6.28.orig/drivers/usb/core/driver.c ++++ 2.6.28/drivers/usb/core/driver.c +@@ -279,9 +279,12 @@ static int usb_unbind_interface(struct d + * altsetting means creating new endpoint device entries). + * When either of these happens, defer the Set-Interface. + */ +- if (intf->cur_altsetting->desc.bAlternateSetting == 0) +- ; /* Already in altsetting 0 so skip Set-Interface */ +- else if (!error && intf->dev.power.status == DPM_ON) ++ if (intf->cur_altsetting->desc.bAlternateSetting == 0) { ++ /* Already in altsetting 0 so skip Set-Interface. ++ * Just re-enable it without affecting the endpoint toggles. ++ */ ++ usb_enable_interface(udev, intf, false); ++ } else if (!error && intf->dev.power.status == DPM_ON) + usb_set_interface(udev, intf->altsetting[0]. + desc.bInterfaceNumber, 0); + else +Index: 2.6.28/drivers/usb/core/message.c +=================================================================== +--- 2.6.28.orig/drivers/usb/core/message.c ++++ 2.6.28/drivers/usb/core/message.c +@@ -1113,22 +1113,26 @@ void usb_disable_device(struct usb_devic + * usb_enable_endpoint - Enable an endpoint for USB communications + * @dev: the device whose interface is being enabled + * @ep: the endpoint ++ * @reset_toggle: flag to set the endpoint's toggle back to 0 + * +- * Resets the endpoint toggle, and sets dev->ep_{in,out} pointers. ++ * Resets the endpoint toggle if asked, and sets dev->ep_{in,out} pointers. + * For control endpoints, both the input and output sides are handled. + */ +-void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep) ++void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep, ++ bool reset_toggle) + { + int epnum = usb_endpoint_num(&ep->desc); + int is_out = usb_endpoint_dir_out(&ep->desc); + int is_control = usb_endpoint_xfer_control(&ep->desc); + + if (is_out || is_control) { +- usb_settoggle(dev, epnum, 1, 0); ++ if (reset_toggle) ++ usb_settoggle(dev, epnum, 1, 0); + dev->ep_out[epnum] = ep; + } + if (!is_out || is_control) { +- usb_settoggle(dev, epnum, 0, 0); ++ if (reset_toggle) ++ usb_settoggle(dev, epnum, 0, 0); + dev->ep_in[epnum] = ep; + } + ep->enabled = 1; +@@ -1138,17 +1142,18 @@ void usb_enable_endpoint(struct usb_devi + * usb_enable_interface - Enable all the endpoints for an interface + * @dev: the device whose interface is being enabled + * @intf: pointer to the interface descriptor ++ * @reset_toggles: flag to set the endpoints' toggles back to 0 + * + * Enables all the endpoints for the interface's current altsetting. + */ +-static void usb_enable_interface(struct usb_device *dev, +- struct usb_interface *intf) ++void usb_enable_interface(struct usb_device *dev, ++ struct usb_interface *intf, bool reset_toggles) + { + struct usb_host_interface *alt = intf->cur_altsetting; + int i; + + for (i = 0; i < alt->desc.bNumEndpoints; ++i) +- usb_enable_endpoint(dev, &alt->endpoint[i]); ++ usb_enable_endpoint(dev, &alt->endpoint[i], reset_toggles); + } + + /** +@@ -1271,7 +1276,7 @@ int usb_set_interface(struct usb_device + * during the SETUP stage - hence EP0 toggles are "don't care" here. + * (Likewise, EP0 never "halts" on well designed devices.) + */ +- usb_enable_interface(dev, iface); ++ usb_enable_interface(dev, iface, true); + if (device_is_registered(&iface->dev)) + usb_create_sysfs_intf_files(iface); + +@@ -1346,7 +1351,7 @@ int usb_reset_configuration(struct usb_d + alt = &intf->altsetting[0]; + + intf->cur_altsetting = alt; +- usb_enable_interface(dev, intf); ++ usb_enable_interface(dev, intf, true); + if (device_is_registered(&intf->dev)) + usb_create_sysfs_intf_files(intf); + } +@@ -1604,7 +1609,7 @@ free_interfaces: + alt = &intf->altsetting[0]; + + intf->cur_altsetting = alt; +- usb_enable_interface(dev, intf); ++ usb_enable_interface(dev, intf, true); + intf->dev.parent = &dev->dev; + intf->dev.driver = NULL; + intf->dev.bus = &usb_bus_type; +Index: 2.6.28/drivers/usb/core/usb.c +=================================================================== +--- 2.6.28.orig/drivers/usb/core/usb.c ++++ 2.6.28/drivers/usb/core/usb.c +@@ -362,7 +362,7 @@ struct usb_device *usb_alloc_dev(struct + dev->ep0.desc.bLength = USB_DT_ENDPOINT_SIZE; + dev->ep0.desc.bDescriptorType = USB_DT_ENDPOINT; + /* ep0 maxpacket comes later, from device descriptor */ +- usb_enable_endpoint(dev, &dev->ep0); ++ usb_enable_endpoint(dev, &dev->ep0, true); + dev->can_submit = 1; + + /* Save readable and stable topology id, distinguishing devices +Index: 2.6.28/drivers/usb/core/hub.c +=================================================================== +--- 2.6.28.orig/drivers/usb/core/hub.c ++++ 2.6.28/drivers/usb/core/hub.c +@@ -2385,7 +2385,7 @@ void usb_ep0_reinit(struct usb_device *u + { + usb_disable_endpoint(udev, 0 + USB_DIR_IN); + usb_disable_endpoint(udev, 0 + USB_DIR_OUT); +- usb_enable_endpoint(udev, &udev->ep0); ++ usb_enable_endpoint(udev, &udev->ep0, true); + } + EXPORT_SYMBOL_GPL(usb_ep0_reinit); |