diff options
Diffstat (limited to 'drivers')
98 files changed, 962 insertions, 629 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index d7d77d4a402c..ae6b6c43cff9 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
| @@ -309,17 +309,19 @@ static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL); | |||
| 309 | * Block size attribute stuff | 309 | * Block size attribute stuff |
| 310 | */ | 310 | */ |
| 311 | static ssize_t | 311 | static ssize_t |
| 312 | print_block_size(struct class *class, char *buf) | 312 | print_block_size(struct sysdev_class *class, |
| 313 | struct sysdev_class_attribute *class_attr, | ||
| 314 | char *buf) | ||
| 313 | { | 315 | { |
| 314 | return sprintf(buf, "%lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); | 316 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); |
| 315 | } | 317 | } |
| 316 | 318 | ||
| 317 | static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); | 319 | static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); |
| 318 | 320 | ||
| 319 | static int block_size_init(void) | 321 | static int block_size_init(void) |
| 320 | { | 322 | { |
| 321 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 323 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
| 322 | &class_attr_block_size_bytes.attr); | 324 | &attr_block_size_bytes.attr); |
| 323 | } | 325 | } |
| 324 | 326 | ||
| 325 | /* | 327 | /* |
| @@ -330,7 +332,9 @@ static int block_size_init(void) | |||
| 330 | */ | 332 | */ |
| 331 | #ifdef CONFIG_ARCH_MEMORY_PROBE | 333 | #ifdef CONFIG_ARCH_MEMORY_PROBE |
| 332 | static ssize_t | 334 | static ssize_t |
| 333 | memory_probe_store(struct class *class, const char *buf, size_t count) | 335 | memory_probe_store(struct sysdev_class *class, |
| 336 | struct sysdev_class_attribute *class_attr, | ||
| 337 | const char *buf, size_t count) | ||
| 334 | { | 338 | { |
| 335 | u64 phys_addr; | 339 | u64 phys_addr; |
| 336 | int nid; | 340 | int nid; |
| @@ -346,12 +350,12 @@ memory_probe_store(struct class *class, const char *buf, size_t count) | |||
| 346 | 350 | ||
| 347 | return count; | 351 | return count; |
| 348 | } | 352 | } |
| 349 | static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); | 353 | static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); |
| 350 | 354 | ||
| 351 | static int memory_probe_init(void) | 355 | static int memory_probe_init(void) |
| 352 | { | 356 | { |
| 353 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 357 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
| 354 | &class_attr_probe.attr); | 358 | &attr_probe.attr); |
| 355 | } | 359 | } |
| 356 | #else | 360 | #else |
| 357 | static inline int memory_probe_init(void) | 361 | static inline int memory_probe_init(void) |
| @@ -367,7 +371,9 @@ static inline int memory_probe_init(void) | |||
| 367 | 371 | ||
| 368 | /* Soft offline a page */ | 372 | /* Soft offline a page */ |
| 369 | static ssize_t | 373 | static ssize_t |
| 370 | store_soft_offline_page(struct class *class, const char *buf, size_t count) | 374 | store_soft_offline_page(struct sysdev_class *class, |
| 375 | struct sysdev_class_attribute *class_attr, | ||
| 376 | const char *buf, size_t count) | ||
| 371 | { | 377 | { |
| 372 | int ret; | 378 | int ret; |
| 373 | u64 pfn; | 379 | u64 pfn; |
| @@ -384,7 +390,9 @@ store_soft_offline_page(struct class *class, const char *buf, size_t count) | |||
| 384 | 390 | ||
| 385 | /* Forcibly offline a page, including killing processes. */ | 391 | /* Forcibly offline a page, including killing processes. */ |
| 386 | static ssize_t | 392 | static ssize_t |
| 387 | store_hard_offline_page(struct class *class, const char *buf, size_t count) | 393 | store_hard_offline_page(struct sysdev_class *class, |
| 394 | struct sysdev_class_attribute *class_attr, | ||
| 395 | const char *buf, size_t count) | ||
| 388 | { | 396 | { |
| 389 | int ret; | 397 | int ret; |
| 390 | u64 pfn; | 398 | u64 pfn; |
| @@ -397,18 +405,18 @@ store_hard_offline_page(struct class *class, const char *buf, size_t count) | |||
| 397 | return ret ? ret : count; | 405 | return ret ? ret : count; |
| 398 | } | 406 | } |
| 399 | 407 | ||
| 400 | static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); | 408 | static SYSDEV_CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); |
| 401 | static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); | 409 | static SYSDEV_CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); |
| 402 | 410 | ||
| 403 | static __init int memory_fail_init(void) | 411 | static __init int memory_fail_init(void) |
| 404 | { | 412 | { |
| 405 | int err; | 413 | int err; |
| 406 | 414 | ||
| 407 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 415 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
| 408 | &class_attr_soft_offline_page.attr); | 416 | &attr_soft_offline_page.attr); |
| 409 | if (!err) | 417 | if (!err) |
| 410 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 418 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
| 411 | &class_attr_hard_offline_page.attr); | 419 | &attr_hard_offline_page.attr); |
| 412 | return err; | 420 | return err; |
| 413 | } | 421 | } |
| 414 | #else | 422 | #else |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 30c36ac2cd00..3999a5f25f38 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
| @@ -2460,10 +2460,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
| 2460 | &bridge->mode); | 2460 | &bridge->mode); |
| 2461 | } | 2461 | } |
| 2462 | 2462 | ||
| 2463 | if (bridge->driver->mask_memory == intel_i965_mask_memory) | 2463 | if (bridge->driver->mask_memory == intel_i965_mask_memory) { |
| 2464 | if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36))) | 2464 | if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36))) |
| 2465 | dev_err(&intel_private.pcidev->dev, | 2465 | dev_err(&intel_private.pcidev->dev, |
| 2466 | "set gfx device dma mask 36bit failed!\n"); | 2466 | "set gfx device dma mask 36bit failed!\n"); |
| 2467 | else | ||
| 2468 | pci_set_consistent_dma_mask(intel_private.pcidev, | ||
| 2469 | DMA_BIT_MASK(36)); | ||
| 2470 | } | ||
| 2467 | 2471 | ||
| 2468 | pci_set_drvdata(pdev, bridge); | 2472 | pci_set_drvdata(pdev, bridge); |
| 2469 | return agp_add_bridge(bridge); | 2473 | return agp_add_bridge(bridge); |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index bdaef8e94021..64fe0a793efd 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
| @@ -114,7 +114,7 @@ static struct virtio_device_id id_table[] = { | |||
| 114 | { 0 }, | 114 | { 0 }, |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | static struct virtio_driver virtio_rng = { | 117 | static struct virtio_driver virtio_rng_driver = { |
| 118 | .driver.name = KBUILD_MODNAME, | 118 | .driver.name = KBUILD_MODNAME, |
| 119 | .driver.owner = THIS_MODULE, | 119 | .driver.owner = THIS_MODULE, |
| 120 | .id_table = id_table, | 120 | .id_table = id_table, |
| @@ -124,12 +124,12 @@ static struct virtio_driver virtio_rng = { | |||
| 124 | 124 | ||
| 125 | static int __init init(void) | 125 | static int __init init(void) |
| 126 | { | 126 | { |
| 127 | return register_virtio_driver(&virtio_rng); | 127 | return register_virtio_driver(&virtio_rng_driver); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static void __exit fini(void) | 130 | static void __exit fini(void) |
| 131 | { | 131 | { |
| 132 | unregister_virtio_driver(&virtio_rng); | 132 | unregister_virtio_driver(&virtio_rng_driver); |
| 133 | } | 133 | } |
| 134 | module_init(init); | 134 | module_init(init); |
| 135 | module_exit(fini); | 135 | module_exit(fini); |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index c5facd951dda..000dc67b85b7 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
| @@ -197,7 +197,7 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw) | |||
| 197 | edac_printk(KERN_DEBUG, EDAC_MC, | 197 | edac_printk(KERN_DEBUG, EDAC_MC, |
| 198 | "pci-read, sdram scrub control value: %d \n", scrubval); | 198 | "pci-read, sdram scrub control value: %d \n", scrubval); |
| 199 | 199 | ||
| 200 | for (i = 0; ARRAY_SIZE(scrubrates); i++) { | 200 | for (i = 0; i < ARRAY_SIZE(scrubrates); i++) { |
| 201 | if (scrubrates[i].scrubval == scrubval) { | 201 | if (scrubrates[i].scrubval == scrubval) { |
| 202 | *bw = scrubrates[i].bandwidth; | 202 | *bw = scrubrates[i].bandwidth; |
| 203 | status = 0; | 203 | status = 0; |
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index 77a9579d7167..adc10a2ac5f6 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
| @@ -577,7 +577,13 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, | |||
| 577 | debugf0("\tUncorrected bits= 0x%x\n", ue_errors); | 577 | debugf0("\tUncorrected bits= 0x%x\n", ue_errors); |
| 578 | 578 | ||
| 579 | branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd); | 579 | branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd); |
| 580 | channel = branch; | 580 | |
| 581 | /* | ||
| 582 | * According with i5000 datasheet, bit 28 has no significance | ||
| 583 | * for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD | ||
| 584 | */ | ||
| 585 | channel = branch & 2; | ||
| 586 | |||
| 581 | bank = NREC_BANK(info->nrecmema); | 587 | bank = NREC_BANK(info->nrecmema); |
| 582 | rank = NREC_RANK(info->nrecmema); | 588 | rank = NREC_RANK(info->nrecmema); |
| 583 | rdwr = NREC_RDWR(info->nrecmema); | 589 | rdwr = NREC_RDWR(info->nrecmema); |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 077313f0d47f..7d0f00a935fa 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -702,7 +702,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
| 702 | if (encoder->crtc != crtc) | 702 | if (encoder->crtc != crtc) |
| 703 | continue; | 703 | continue; |
| 704 | 704 | ||
| 705 | DRM_INFO("%s: set mode %s %x\n", drm_get_encoder_name(encoder), | 705 | DRM_DEBUG("%s: set mode %s %x\n", drm_get_encoder_name(encoder), |
| 706 | mode->name, mode->base.id); | 706 | mode->name, mode->base.id); |
| 707 | encoder_funcs = encoder->helper_private; | 707 | encoder_funcs = encoder->helper_private; |
| 708 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); | 708 | encoder_funcs->mode_set(encoder, mode, adjusted_mode); |
| @@ -1032,7 +1032,8 @@ bool drm_helper_initial_config(struct drm_device *dev) | |||
| 1032 | /* | 1032 | /* |
| 1033 | * we shouldn't end up with no modes here. | 1033 | * we shouldn't end up with no modes here. |
| 1034 | */ | 1034 | */ |
| 1035 | printk(KERN_INFO "No connectors reported conncted with modes\n"); | 1035 | if (count == 0) |
| 1036 | printk(KERN_INFO "No connectors reported connected with modes\n"); | ||
| 1036 | 1037 | ||
| 1037 | drm_setup_crtcs(dev); | 1038 | drm_setup_crtcs(dev); |
| 1038 | 1039 | ||
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index bbe47812e4b6..e660ac07f3b2 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -134,6 +134,10 @@ static int i915_init_phys_hws(struct drm_device *dev) | |||
| 134 | 134 | ||
| 135 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); | 135 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); |
| 136 | 136 | ||
| 137 | if (IS_I965G(dev)) | ||
| 138 | dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) & | ||
| 139 | 0xf0; | ||
| 140 | |||
| 137 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); | 141 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); |
| 138 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); | 142 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); |
| 139 | return 0; | 143 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index be631cc3e4dc..46d88965852a 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -45,6 +45,9 @@ module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); | |||
| 45 | unsigned int i915_powersave = 1; | 45 | unsigned int i915_powersave = 1; |
| 46 | module_param_named(powersave, i915_powersave, int, 0400); | 46 | module_param_named(powersave, i915_powersave, int, 0400); |
| 47 | 47 | ||
| 48 | unsigned int i915_lvds_downclock = 0; | ||
| 49 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); | ||
| 50 | |||
| 48 | static struct drm_driver driver; | 51 | static struct drm_driver driver; |
| 49 | 52 | ||
| 50 | #define INTEL_VGA_DEVICE(id, info) { \ | 53 | #define INTEL_VGA_DEVICE(id, info) { \ |
| @@ -464,8 +467,11 @@ static struct drm_driver driver = { | |||
| 464 | .lastclose = i915_driver_lastclose, | 467 | .lastclose = i915_driver_lastclose, |
| 465 | .preclose = i915_driver_preclose, | 468 | .preclose = i915_driver_preclose, |
| 466 | .postclose = i915_driver_postclose, | 469 | .postclose = i915_driver_postclose, |
| 470 | |||
| 471 | /* Used in place of i915_pm_ops for non-DRIVER_MODESET */ | ||
| 467 | .suspend = i915_suspend, | 472 | .suspend = i915_suspend, |
| 468 | .resume = i915_resume, | 473 | .resume = i915_resume, |
| 474 | |||
| 469 | .device_is_agp = i915_driver_device_is_agp, | 475 | .device_is_agp = i915_driver_device_is_agp, |
| 470 | .enable_vblank = i915_enable_vblank, | 476 | .enable_vblank = i915_enable_vblank, |
| 471 | .disable_vblank = i915_disable_vblank, | 477 | .disable_vblank = i915_disable_vblank, |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 29dd67626967..2c1669488b5a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -283,6 +283,7 @@ typedef struct drm_i915_private { | |||
| 283 | unsigned int lvds_use_ssc:1; | 283 | unsigned int lvds_use_ssc:1; |
| 284 | unsigned int edp_support:1; | 284 | unsigned int edp_support:1; |
| 285 | int lvds_ssc_freq; | 285 | int lvds_ssc_freq; |
| 286 | int edp_bpp; | ||
| 286 | 287 | ||
| 287 | struct notifier_block lid_notifier; | 288 | struct notifier_block lid_notifier; |
| 288 | 289 | ||
| @@ -722,6 +723,7 @@ extern struct drm_ioctl_desc i915_ioctls[]; | |||
| 722 | extern int i915_max_ioctl; | 723 | extern int i915_max_ioctl; |
| 723 | extern unsigned int i915_fbpercrtc; | 724 | extern unsigned int i915_fbpercrtc; |
| 724 | extern unsigned int i915_powersave; | 725 | extern unsigned int i915_powersave; |
| 726 | extern unsigned int i915_lvds_downclock; | ||
| 725 | 727 | ||
| 726 | extern void i915_save_display(struct drm_device *dev); | 728 | extern void i915_save_display(struct drm_device *dev); |
| 727 | extern void i915_restore_display(struct drm_device *dev); | 729 | extern void i915_restore_display(struct drm_device *dev); |
| @@ -864,6 +866,7 @@ int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptib | |||
| 864 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); | 866 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
| 865 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, | 867 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, |
| 866 | int write); | 868 | int write); |
| 869 | int i915_gem_object_set_to_display_plane(struct drm_gem_object *obj); | ||
| 867 | int i915_gem_attach_phys_object(struct drm_device *dev, | 870 | int i915_gem_attach_phys_object(struct drm_device *dev, |
| 868 | struct drm_gem_object *obj, int id); | 871 | struct drm_gem_object *obj, int id); |
| 869 | void i915_gem_detach_phys_object(struct drm_device *dev, | 872 | void i915_gem_detach_phys_object(struct drm_device *dev, |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 2748609f05b3..0c67924ca80c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -2837,6 +2837,57 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) | |||
| 2837 | return 0; | 2837 | return 0; |
| 2838 | } | 2838 | } |
| 2839 | 2839 | ||
| 2840 | /* | ||
| 2841 | * Prepare buffer for display plane. Use uninterruptible for possible flush | ||
| 2842 | * wait, as in modesetting process we're not supposed to be interrupted. | ||
| 2843 | */ | ||
| 2844 | int | ||
| 2845 | i915_gem_object_set_to_display_plane(struct drm_gem_object *obj) | ||
| 2846 | { | ||
| 2847 | struct drm_device *dev = obj->dev; | ||
| 2848 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
| 2849 | uint32_t old_write_domain, old_read_domains; | ||
| 2850 | int ret; | ||
| 2851 | |||
| 2852 | /* Not valid to be called on unbound objects. */ | ||
| 2853 | if (obj_priv->gtt_space == NULL) | ||
| 2854 | return -EINVAL; | ||
| 2855 | |||
| 2856 | i915_gem_object_flush_gpu_write_domain(obj); | ||
| 2857 | |||
| 2858 | /* Wait on any GPU rendering and flushing to occur. */ | ||
| 2859 | if (obj_priv->active) { | ||
| 2860 | #if WATCH_BUF | ||
| 2861 | DRM_INFO("%s: object %p wait for seqno %08x\n", | ||
| 2862 | __func__, obj, obj_priv->last_rendering_seqno); | ||
| 2863 | #endif | ||
| 2864 | ret = i915_do_wait_request(dev, obj_priv->last_rendering_seqno, 0); | ||
| 2865 | if (ret != 0) | ||
| 2866 | return ret; | ||
| 2867 | } | ||
| 2868 | |||
| 2869 | old_write_domain = obj->write_domain; | ||
| 2870 | old_read_domains = obj->read_domains; | ||
| 2871 | |||
| 2872 | obj->read_domains &= I915_GEM_DOMAIN_GTT; | ||
| 2873 | |||
| 2874 | i915_gem_object_flush_cpu_write_domain(obj); | ||
| 2875 | |||
| 2876 | /* It should now be out of any other write domains, and we can update | ||
| 2877 | * the domain values for our changes. | ||
| 2878 | */ | ||
| 2879 | BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_GTT) != 0); | ||
| 2880 | obj->read_domains |= I915_GEM_DOMAIN_GTT; | ||
| 2881 | obj->write_domain = I915_GEM_DOMAIN_GTT; | ||
| 2882 | obj_priv->dirty = 1; | ||
| 2883 | |||
| 2884 | trace_i915_gem_object_change_domain(obj, | ||
| 2885 | old_read_domains, | ||
| 2886 | old_write_domain); | ||
| 2887 | |||
| 2888 | return 0; | ||
| 2889 | } | ||
| 2890 | |||
| 2840 | /** | 2891 | /** |
| 2841 | * Moves a single object to the CPU read, and possibly write domain. | 2892 | * Moves a single object to the CPU read, and possibly write domain. |
| 2842 | * | 2893 | * |
| @@ -4000,8 +4051,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
| 4000 | "back to user (%d)\n", | 4051 | "back to user (%d)\n", |
| 4001 | args->buffer_count, ret); | 4052 | args->buffer_count, ret); |
| 4002 | } | 4053 | } |
| 4003 | } else { | ||
| 4004 | DRM_ERROR("i915_gem_do_execbuffer returns %d\n", ret); | ||
| 4005 | } | 4054 | } |
| 4006 | 4055 | ||
| 4007 | drm_free_large(exec_list); | 4056 | drm_free_large(exec_list); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 7cd8110051b6..89a071a3e6fb 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -274,7 +274,6 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
| 274 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 274 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
| 275 | int ret = IRQ_NONE; | 275 | int ret = IRQ_NONE; |
| 276 | u32 de_iir, gt_iir, de_ier, pch_iir; | 276 | u32 de_iir, gt_iir, de_ier, pch_iir; |
| 277 | u32 new_de_iir, new_gt_iir, new_pch_iir; | ||
| 278 | struct drm_i915_master_private *master_priv; | 277 | struct drm_i915_master_private *master_priv; |
| 279 | 278 | ||
| 280 | /* disable master interrupt before clearing iir */ | 279 | /* disable master interrupt before clearing iir */ |
| @@ -286,51 +285,42 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
| 286 | gt_iir = I915_READ(GTIIR); | 285 | gt_iir = I915_READ(GTIIR); |
| 287 | pch_iir = I915_READ(SDEIIR); | 286 | pch_iir = I915_READ(SDEIIR); |
| 288 | 287 | ||
| 289 | for (;;) { | 288 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) |
| 290 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) | 289 | goto done; |
| 291 | break; | ||
| 292 | |||
| 293 | ret = IRQ_HANDLED; | ||
| 294 | 290 | ||
| 295 | /* should clear PCH hotplug event before clear CPU irq */ | 291 | ret = IRQ_HANDLED; |
| 296 | I915_WRITE(SDEIIR, pch_iir); | ||
| 297 | new_pch_iir = I915_READ(SDEIIR); | ||
| 298 | 292 | ||
| 299 | I915_WRITE(DEIIR, de_iir); | 293 | if (dev->primary->master) { |
| 300 | new_de_iir = I915_READ(DEIIR); | 294 | master_priv = dev->primary->master->driver_priv; |
| 301 | I915_WRITE(GTIIR, gt_iir); | 295 | if (master_priv->sarea_priv) |
| 302 | new_gt_iir = I915_READ(GTIIR); | 296 | master_priv->sarea_priv->last_dispatch = |
| 303 | 297 | READ_BREADCRUMB(dev_priv); | |
| 304 | if (dev->primary->master) { | 298 | } |
| 305 | master_priv = dev->primary->master->driver_priv; | ||
| 306 | if (master_priv->sarea_priv) | ||
| 307 | master_priv->sarea_priv->last_dispatch = | ||
| 308 | READ_BREADCRUMB(dev_priv); | ||
| 309 | } | ||
| 310 | |||
| 311 | if (gt_iir & GT_USER_INTERRUPT) { | ||
| 312 | u32 seqno = i915_get_gem_seqno(dev); | ||
| 313 | dev_priv->mm.irq_gem_seqno = seqno; | ||
| 314 | trace_i915_gem_request_complete(dev, seqno); | ||
| 315 | DRM_WAKEUP(&dev_priv->irq_queue); | ||
| 316 | dev_priv->hangcheck_count = 0; | ||
| 317 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | ||
| 318 | } | ||
| 319 | 299 | ||
| 320 | if (de_iir & DE_GSE) | 300 | if (gt_iir & GT_USER_INTERRUPT) { |
| 321 | ironlake_opregion_gse_intr(dev); | 301 | u32 seqno = i915_get_gem_seqno(dev); |
| 302 | dev_priv->mm.irq_gem_seqno = seqno; | ||
| 303 | trace_i915_gem_request_complete(dev, seqno); | ||
| 304 | DRM_WAKEUP(&dev_priv->irq_queue); | ||
| 305 | dev_priv->hangcheck_count = 0; | ||
| 306 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | ||
| 307 | } | ||
| 322 | 308 | ||
| 323 | /* check event from PCH */ | 309 | if (de_iir & DE_GSE) |
| 324 | if ((de_iir & DE_PCH_EVENT) && | 310 | ironlake_opregion_gse_intr(dev); |
| 325 | (pch_iir & SDE_HOTPLUG_MASK)) { | ||
| 326 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); | ||
| 327 | } | ||
| 328 | 311 | ||
| 329 | de_iir = new_de_iir; | 312 | /* check event from PCH */ |
| 330 | gt_iir = new_gt_iir; | 313 | if ((de_iir & DE_PCH_EVENT) && |
| 331 | pch_iir = new_pch_iir; | 314 | (pch_iir & SDE_HOTPLUG_MASK)) { |
| 315 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); | ||
| 332 | } | 316 | } |
| 333 | 317 | ||
| 318 | /* should clear PCH hotplug event before clear CPU irq */ | ||
| 319 | I915_WRITE(SDEIIR, pch_iir); | ||
| 320 | I915_WRITE(GTIIR, gt_iir); | ||
| 321 | I915_WRITE(DEIIR, de_iir); | ||
| 322 | |||
| 323 | done: | ||
| 334 | I915_WRITE(DEIER, de_ier); | 324 | I915_WRITE(DEIER, de_ier); |
| 335 | (void)I915_READ(DEIER); | 325 | (void)I915_READ(DEIER); |
| 336 | 326 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 149d360d64a3..847006c5218e 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -1815,7 +1815,7 @@ | |||
| 1815 | #define DSPFW_PLANEB_SHIFT 8 | 1815 | #define DSPFW_PLANEB_SHIFT 8 |
| 1816 | #define DSPFW2 0x70038 | 1816 | #define DSPFW2 0x70038 |
| 1817 | #define DSPFW_CURSORA_MASK 0x00003f00 | 1817 | #define DSPFW_CURSORA_MASK 0x00003f00 |
| 1818 | #define DSPFW_CURSORA_SHIFT 16 | 1818 | #define DSPFW_CURSORA_SHIFT 8 |
| 1819 | #define DSPFW3 0x7003c | 1819 | #define DSPFW3 0x7003c |
| 1820 | #define DSPFW_HPLL_SR_EN (1<<31) | 1820 | #define DSPFW_HPLL_SR_EN (1<<31) |
| 1821 | #define DSPFW_CURSOR_SR_SHIFT 24 | 1821 | #define DSPFW_CURSOR_SR_SHIFT 24 |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index f27567747580..15fbc1b5a83e 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #define SLAVE_ADDR1 0x70 | 33 | #define SLAVE_ADDR1 0x70 |
| 34 | #define SLAVE_ADDR2 0x72 | 34 | #define SLAVE_ADDR2 0x72 |
| 35 | 35 | ||
| 36 | static int panel_type; | ||
| 37 | |||
| 36 | static void * | 38 | static void * |
| 37 | find_section(struct bdb_header *bdb, int section_id) | 39 | find_section(struct bdb_header *bdb, int section_id) |
| 38 | { | 40 | { |
| @@ -128,6 +130,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
| 128 | dev_priv->lvds_dither = lvds_options->pixel_dither; | 130 | dev_priv->lvds_dither = lvds_options->pixel_dither; |
| 129 | if (lvds_options->panel_type == 0xff) | 131 | if (lvds_options->panel_type == 0xff) |
| 130 | return; | 132 | return; |
| 133 | panel_type = lvds_options->panel_type; | ||
| 131 | 134 | ||
| 132 | lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); | 135 | lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); |
| 133 | if (!lvds_lfp_data) | 136 | if (!lvds_lfp_data) |
| @@ -197,7 +200,8 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
| 197 | memset(temp_mode, 0, sizeof(*temp_mode)); | 200 | memset(temp_mode, 0, sizeof(*temp_mode)); |
| 198 | } | 201 | } |
| 199 | kfree(temp_mode); | 202 | kfree(temp_mode); |
| 200 | if (temp_downclock < panel_fixed_mode->clock) { | 203 | if (temp_downclock < panel_fixed_mode->clock && |
| 204 | i915_lvds_downclock) { | ||
| 201 | dev_priv->lvds_downclock_avail = 1; | 205 | dev_priv->lvds_downclock_avail = 1; |
| 202 | dev_priv->lvds_downclock = temp_downclock; | 206 | dev_priv->lvds_downclock = temp_downclock; |
| 203 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", | 207 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", |
| @@ -405,6 +409,34 @@ parse_driver_features(struct drm_i915_private *dev_priv, | |||
| 405 | } | 409 | } |
| 406 | 410 | ||
| 407 | static void | 411 | static void |
| 412 | parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) | ||
| 413 | { | ||
| 414 | struct bdb_edp *edp; | ||
| 415 | |||
| 416 | edp = find_section(bdb, BDB_EDP); | ||
| 417 | if (!edp) { | ||
| 418 | if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp_support) { | ||
| 419 | DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported,\ | ||
| 420 | assume 18bpp panel color depth.\n"); | ||
| 421 | dev_priv->edp_bpp = 18; | ||
| 422 | } | ||
| 423 | return; | ||
| 424 | } | ||
| 425 | |||
| 426 | switch ((edp->color_depth >> (panel_type * 2)) & 3) { | ||
| 427 | case EDP_18BPP: | ||
| 428 | dev_priv->edp_bpp = 18; | ||
| 429 | break; | ||
| 430 | case EDP_24BPP: | ||
| 431 | dev_priv->edp_bpp = 24; | ||
| 432 | break; | ||
| 433 | case EDP_30BPP: | ||
| 434 | dev_priv->edp_bpp = 30; | ||
| 435 | break; | ||
| 436 | } | ||
| 437 | } | ||
| 438 | |||
| 439 | static void | ||
| 408 | parse_device_mapping(struct drm_i915_private *dev_priv, | 440 | parse_device_mapping(struct drm_i915_private *dev_priv, |
| 409 | struct bdb_header *bdb) | 441 | struct bdb_header *bdb) |
| 410 | { | 442 | { |
| @@ -521,6 +553,7 @@ intel_init_bios(struct drm_device *dev) | |||
| 521 | parse_sdvo_device_mapping(dev_priv, bdb); | 553 | parse_sdvo_device_mapping(dev_priv, bdb); |
| 522 | parse_device_mapping(dev_priv, bdb); | 554 | parse_device_mapping(dev_priv, bdb); |
| 523 | parse_driver_features(dev_priv, bdb); | 555 | parse_driver_features(dev_priv, bdb); |
| 556 | parse_edp(dev_priv, bdb); | ||
| 524 | 557 | ||
| 525 | pci_unmap_rom(pdev, bios); | 558 | pci_unmap_rom(pdev, bios); |
| 526 | 559 | ||
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h index 425ac9d7f724..4c18514f6f80 100644 --- a/drivers/gpu/drm/i915/intel_bios.h +++ b/drivers/gpu/drm/i915/intel_bios.h | |||
| @@ -98,6 +98,7 @@ struct vbios_data { | |||
| 98 | #define BDB_SDVO_LVDS_PNP_IDS 24 | 98 | #define BDB_SDVO_LVDS_PNP_IDS 24 |
| 99 | #define BDB_SDVO_LVDS_POWER_SEQ 25 | 99 | #define BDB_SDVO_LVDS_POWER_SEQ 25 |
| 100 | #define BDB_TV_OPTIONS 26 | 100 | #define BDB_TV_OPTIONS 26 |
| 101 | #define BDB_EDP 27 | ||
| 101 | #define BDB_LVDS_OPTIONS 40 | 102 | #define BDB_LVDS_OPTIONS 40 |
| 102 | #define BDB_LVDS_LFP_DATA_PTRS 41 | 103 | #define BDB_LVDS_LFP_DATA_PTRS 41 |
| 103 | #define BDB_LVDS_LFP_DATA 42 | 104 | #define BDB_LVDS_LFP_DATA 42 |
| @@ -426,6 +427,45 @@ struct bdb_driver_features { | |||
| 426 | u8 custom_vbt_version; | 427 | u8 custom_vbt_version; |
| 427 | } __attribute__((packed)); | 428 | } __attribute__((packed)); |
| 428 | 429 | ||
| 430 | #define EDP_18BPP 0 | ||
| 431 | #define EDP_24BPP 1 | ||
| 432 | #define EDP_30BPP 2 | ||
| 433 | #define EDP_RATE_1_62 0 | ||
| 434 | #define EDP_RATE_2_7 1 | ||
| 435 | #define EDP_LANE_1 0 | ||
| 436 | #define EDP_LANE_2 1 | ||
| 437 | #define EDP_LANE_4 3 | ||
| 438 | #define EDP_PREEMPHASIS_NONE 0 | ||
| 439 | #define EDP_PREEMPHASIS_3_5dB 1 | ||
| 440 | #define EDP_PREEMPHASIS_6dB 2 | ||
| 441 | #define EDP_PREEMPHASIS_9_5dB 3 | ||
| 442 | #define EDP_VSWING_0_4V 0 | ||
| 443 | #define EDP_VSWING_0_6V 1 | ||
| 444 | #define EDP_VSWING_0_8V 2 | ||
| 445 | #define EDP_VSWING_1_2V 3 | ||
| 446 | |||
| 447 | struct edp_power_seq { | ||
| 448 | u16 t3; | ||
| 449 | u16 t7; | ||
| 450 | u16 t9; | ||
| 451 | u16 t10; | ||
| 452 | u16 t12; | ||
| 453 | } __attribute__ ((packed)); | ||
| 454 | |||
| 455 | struct edp_link_params { | ||
| 456 | u8 rate:4; | ||
| 457 | u8 lanes:4; | ||
| 458 | u8 preemphasis:4; | ||
| 459 | u8 vswing:4; | ||
| 460 | } __attribute__ ((packed)); | ||
| 461 | |||
| 462 | struct bdb_edp { | ||
| 463 | struct edp_power_seq power_seqs[16]; | ||
| 464 | u32 color_depth; | ||
| 465 | u32 sdrrs_msa_timing_delay; | ||
| 466 | struct edp_link_params link_params[16]; | ||
| 467 | } __attribute__ ((packed)); | ||
| 468 | |||
| 429 | bool intel_init_bios(struct drm_device *dev); | 469 | bool intel_init_bios(struct drm_device *dev); |
| 430 | 470 | ||
| 431 | /* | 471 | /* |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 002612fae717..45da78ef4a92 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -70,8 +70,6 @@ struct intel_limit { | |||
| 70 | intel_p2_t p2; | 70 | intel_p2_t p2; |
| 71 | bool (* find_pll)(const intel_limit_t *, struct drm_crtc *, | 71 | bool (* find_pll)(const intel_limit_t *, struct drm_crtc *, |
| 72 | int, int, intel_clock_t *); | 72 | int, int, intel_clock_t *); |
| 73 | bool (* find_reduced_pll)(const intel_limit_t *, struct drm_crtc *, | ||
| 74 | int, int, intel_clock_t *); | ||
| 75 | }; | 73 | }; |
| 76 | 74 | ||
| 77 | #define I8XX_DOT_MIN 25000 | 75 | #define I8XX_DOT_MIN 25000 |
| @@ -243,11 +241,11 @@ struct intel_limit { | |||
| 243 | #define IRONLAKE_VCO_MIN 1760000 | 241 | #define IRONLAKE_VCO_MIN 1760000 |
| 244 | #define IRONLAKE_VCO_MAX 3510000 | 242 | #define IRONLAKE_VCO_MAX 3510000 |
| 245 | #define IRONLAKE_N_MIN 1 | 243 | #define IRONLAKE_N_MIN 1 |
| 246 | #define IRONLAKE_N_MAX 5 | 244 | #define IRONLAKE_N_MAX 6 |
| 247 | #define IRONLAKE_M_MIN 79 | 245 | #define IRONLAKE_M_MIN 79 |
| 248 | #define IRONLAKE_M_MAX 118 | 246 | #define IRONLAKE_M_MAX 127 |
| 249 | #define IRONLAKE_M1_MIN 12 | 247 | #define IRONLAKE_M1_MIN 12 |
| 250 | #define IRONLAKE_M1_MAX 23 | 248 | #define IRONLAKE_M1_MAX 22 |
| 251 | #define IRONLAKE_M2_MIN 5 | 249 | #define IRONLAKE_M2_MIN 5 |
| 252 | #define IRONLAKE_M2_MAX 9 | 250 | #define IRONLAKE_M2_MAX 9 |
| 253 | #define IRONLAKE_P_SDVO_DAC_MIN 5 | 251 | #define IRONLAKE_P_SDVO_DAC_MIN 5 |
| @@ -274,9 +272,6 @@ static bool | |||
| 274 | intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 272 | intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
| 275 | int target, int refclk, intel_clock_t *best_clock); | 273 | int target, int refclk, intel_clock_t *best_clock); |
| 276 | static bool | 274 | static bool |
| 277 | intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | ||
| 278 | int target, int refclk, intel_clock_t *best_clock); | ||
| 279 | static bool | ||
| 280 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 275 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
| 281 | int target, int refclk, intel_clock_t *best_clock); | 276 | int target, int refclk, intel_clock_t *best_clock); |
| 282 | 277 | ||
| @@ -299,7 +294,6 @@ static const intel_limit_t intel_limits_i8xx_dvo = { | |||
| 299 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, | 294 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, |
| 300 | .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, | 295 | .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, |
| 301 | .find_pll = intel_find_best_PLL, | 296 | .find_pll = intel_find_best_PLL, |
| 302 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 303 | }; | 297 | }; |
| 304 | 298 | ||
| 305 | static const intel_limit_t intel_limits_i8xx_lvds = { | 299 | static const intel_limit_t intel_limits_i8xx_lvds = { |
| @@ -314,7 +308,6 @@ static const intel_limit_t intel_limits_i8xx_lvds = { | |||
| 314 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, | 308 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, |
| 315 | .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, | 309 | .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, |
| 316 | .find_pll = intel_find_best_PLL, | 310 | .find_pll = intel_find_best_PLL, |
| 317 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 318 | }; | 311 | }; |
| 319 | 312 | ||
| 320 | static const intel_limit_t intel_limits_i9xx_sdvo = { | 313 | static const intel_limit_t intel_limits_i9xx_sdvo = { |
| @@ -329,7 +322,6 @@ static const intel_limit_t intel_limits_i9xx_sdvo = { | |||
| 329 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, | 322 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, |
| 330 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, | 323 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, |
| 331 | .find_pll = intel_find_best_PLL, | 324 | .find_pll = intel_find_best_PLL, |
| 332 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 333 | }; | 325 | }; |
| 334 | 326 | ||
| 335 | static const intel_limit_t intel_limits_i9xx_lvds = { | 327 | static const intel_limit_t intel_limits_i9xx_lvds = { |
| @@ -347,7 +339,6 @@ static const intel_limit_t intel_limits_i9xx_lvds = { | |||
| 347 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, | 339 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, |
| 348 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, | 340 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, |
| 349 | .find_pll = intel_find_best_PLL, | 341 | .find_pll = intel_find_best_PLL, |
| 350 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 351 | }; | 342 | }; |
| 352 | 343 | ||
| 353 | /* below parameter and function is for G4X Chipset Family*/ | 344 | /* below parameter and function is for G4X Chipset Family*/ |
| @@ -365,7 +356,6 @@ static const intel_limit_t intel_limits_g4x_sdvo = { | |||
| 365 | .p2_fast = G4X_P2_SDVO_FAST | 356 | .p2_fast = G4X_P2_SDVO_FAST |
| 366 | }, | 357 | }, |
| 367 | .find_pll = intel_g4x_find_best_PLL, | 358 | .find_pll = intel_g4x_find_best_PLL, |
| 368 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
| 369 | }; | 359 | }; |
| 370 | 360 | ||
| 371 | static const intel_limit_t intel_limits_g4x_hdmi = { | 361 | static const intel_limit_t intel_limits_g4x_hdmi = { |
| @@ -382,7 +372,6 @@ static const intel_limit_t intel_limits_g4x_hdmi = { | |||
| 382 | .p2_fast = G4X_P2_HDMI_DAC_FAST | 372 | .p2_fast = G4X_P2_HDMI_DAC_FAST |
| 383 | }, | 373 | }, |
| 384 | .find_pll = intel_g4x_find_best_PLL, | 374 | .find_pll = intel_g4x_find_best_PLL, |
| 385 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
| 386 | }; | 375 | }; |
| 387 | 376 | ||
| 388 | static const intel_limit_t intel_limits_g4x_single_channel_lvds = { | 377 | static const intel_limit_t intel_limits_g4x_single_channel_lvds = { |
| @@ -407,7 +396,6 @@ static const intel_limit_t intel_limits_g4x_single_channel_lvds = { | |||
| 407 | .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST | 396 | .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST |
| 408 | }, | 397 | }, |
| 409 | .find_pll = intel_g4x_find_best_PLL, | 398 | .find_pll = intel_g4x_find_best_PLL, |
| 410 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
| 411 | }; | 399 | }; |
| 412 | 400 | ||
| 413 | static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { | 401 | static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { |
| @@ -432,7 +420,6 @@ static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { | |||
| 432 | .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST | 420 | .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST |
| 433 | }, | 421 | }, |
| 434 | .find_pll = intel_g4x_find_best_PLL, | 422 | .find_pll = intel_g4x_find_best_PLL, |
| 435 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
| 436 | }; | 423 | }; |
| 437 | 424 | ||
| 438 | static const intel_limit_t intel_limits_g4x_display_port = { | 425 | static const intel_limit_t intel_limits_g4x_display_port = { |
| @@ -470,7 +457,6 @@ static const intel_limit_t intel_limits_pineview_sdvo = { | |||
| 470 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, | 457 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, |
| 471 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, | 458 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, |
| 472 | .find_pll = intel_find_best_PLL, | 459 | .find_pll = intel_find_best_PLL, |
| 473 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 474 | }; | 460 | }; |
| 475 | 461 | ||
| 476 | static const intel_limit_t intel_limits_pineview_lvds = { | 462 | static const intel_limit_t intel_limits_pineview_lvds = { |
| @@ -486,7 +472,6 @@ static const intel_limit_t intel_limits_pineview_lvds = { | |||
| 486 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, | 472 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, |
| 487 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, | 473 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, |
| 488 | .find_pll = intel_find_best_PLL, | 474 | .find_pll = intel_find_best_PLL, |
| 489 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
| 490 | }; | 475 | }; |
| 491 | 476 | ||
| 492 | static const intel_limit_t intel_limits_ironlake_sdvo = { | 477 | static const intel_limit_t intel_limits_ironlake_sdvo = { |
| @@ -768,46 +753,6 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
| 768 | return (err != target); | 753 | return (err != target); |
| 769 | } | 754 | } |
| 770 | 755 | ||
| 771 | |||
| 772 | static bool | ||
| 773 | intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | ||
| 774 | int target, int refclk, intel_clock_t *best_clock) | ||
| 775 | |||
| 776 | { | ||
| 777 | struct drm_device *dev = crtc->dev; | ||
| 778 | intel_clock_t clock; | ||
| 779 | int err = target; | ||
| 780 | bool found = false; | ||
| 781 | |||
| 782 | memcpy(&clock, best_clock, sizeof(intel_clock_t)); | ||
| 783 | |||
| 784 | for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) { | ||
| 785 | for (clock.m2 = limit->m2.min; clock.m2 <= limit->m2.max; clock.m2++) { | ||
| 786 | /* m1 is always 0 in Pineview */ | ||
| 787 | if (clock.m2 >= clock.m1 && !IS_PINEVIEW(dev)) | ||
| 788 | break; | ||
| 789 | for (clock.n = limit->n.min; clock.n <= limit->n.max; | ||
| 790 | clock.n++) { | ||
| 791 | int this_err; | ||
| 792 | |||
| 793 | intel_clock(dev, refclk, &clock); | ||
| 794 | |||
| 795 | if (!intel_PLL_is_valid(crtc, &clock)) | ||
| 796 | continue; | ||
| 797 | |||
| 798 | this_err = abs(clock.dot - target); | ||
| 799 | if (this_err < err) { | ||
| 800 | *best_clock = clock; | ||
| 801 | err = this_err; | ||
| 802 | found = true; | ||
| 803 | } | ||
| 804 | } | ||
| 805 | } | ||
| 806 | } | ||
| 807 | |||
| 808 | return found; | ||
| 809 | } | ||
| 810 | |||
| 811 | static bool | 756 | static bool |
| 812 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 757 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
| 813 | int target, int refclk, intel_clock_t *best_clock) | 758 | int target, int refclk, intel_clock_t *best_clock) |
| @@ -1262,7 +1207,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1262 | return ret; | 1207 | return ret; |
| 1263 | } | 1208 | } |
| 1264 | 1209 | ||
| 1265 | ret = i915_gem_object_set_to_gtt_domain(obj, 1); | 1210 | ret = i915_gem_object_set_to_display_plane(obj); |
| 1266 | if (ret != 0) { | 1211 | if (ret != 0) { |
| 1267 | i915_gem_object_unpin(obj); | 1212 | i915_gem_object_unpin(obj); |
| 1268 | mutex_unlock(&dev->struct_mutex); | 1213 | mutex_unlock(&dev->struct_mutex); |
| @@ -2910,10 +2855,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 2910 | return -EINVAL; | 2855 | return -EINVAL; |
| 2911 | } | 2856 | } |
| 2912 | 2857 | ||
| 2913 | if (is_lvds && limit->find_reduced_pll && | 2858 | if (is_lvds && dev_priv->lvds_downclock_avail) { |
| 2914 | dev_priv->lvds_downclock_avail) { | 2859 | has_reduced_clock = limit->find_pll(limit, crtc, |
| 2915 | memcpy(&reduced_clock, &clock, sizeof(intel_clock_t)); | ||
| 2916 | has_reduced_clock = limit->find_reduced_pll(limit, crtc, | ||
| 2917 | dev_priv->lvds_downclock, | 2860 | dev_priv->lvds_downclock, |
| 2918 | refclk, | 2861 | refclk, |
| 2919 | &reduced_clock); | 2862 | &reduced_clock); |
| @@ -2981,6 +2924,21 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 2981 | temp |= PIPE_8BPC; | 2924 | temp |= PIPE_8BPC; |
| 2982 | else | 2925 | else |
| 2983 | temp |= PIPE_6BPC; | 2926 | temp |= PIPE_6BPC; |
| 2927 | } else if (is_edp) { | ||
| 2928 | switch (dev_priv->edp_bpp/3) { | ||
| 2929 | case 8: | ||
| 2930 | temp |= PIPE_8BPC; | ||
| 2931 | break; | ||
| 2932 | case 10: | ||
| 2933 | temp |= PIPE_10BPC; | ||
| 2934 | break; | ||
| 2935 | case 6: | ||
| 2936 | temp |= PIPE_6BPC; | ||
| 2937 | break; | ||
| 2938 | case 12: | ||
| 2939 | temp |= PIPE_12BPC; | ||
| 2940 | break; | ||
| 2941 | } | ||
| 2984 | } else | 2942 | } else |
| 2985 | temp |= PIPE_8BPC; | 2943 | temp |= PIPE_8BPC; |
| 2986 | I915_WRITE(pipeconf_reg, temp); | 2944 | I915_WRITE(pipeconf_reg, temp); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1349d9fd01c4..439506cefc14 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -125,9 +125,15 @@ intel_dp_link_clock(uint8_t link_bw) | |||
| 125 | 125 | ||
| 126 | /* I think this is a fiction */ | 126 | /* I think this is a fiction */ |
| 127 | static int | 127 | static int |
| 128 | intel_dp_link_required(int pixel_clock) | 128 | intel_dp_link_required(struct drm_device *dev, |
| 129 | struct intel_output *intel_output, int pixel_clock) | ||
| 129 | { | 130 | { |
| 130 | return pixel_clock * 3; | 131 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 132 | |||
| 133 | if (IS_eDP(intel_output)) | ||
| 134 | return (pixel_clock * dev_priv->edp_bpp) / 8; | ||
| 135 | else | ||
| 136 | return pixel_clock * 3; | ||
| 131 | } | 137 | } |
| 132 | 138 | ||
| 133 | static int | 139 | static int |
| @@ -138,7 +144,8 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
| 138 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output)); | 144 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output)); |
| 139 | int max_lanes = intel_dp_max_lane_count(intel_output); | 145 | int max_lanes = intel_dp_max_lane_count(intel_output); |
| 140 | 146 | ||
| 141 | if (intel_dp_link_required(mode->clock) > max_link_clock * max_lanes) | 147 | if (intel_dp_link_required(connector->dev, intel_output, mode->clock) |
| 148 | > max_link_clock * max_lanes) | ||
| 142 | return MODE_CLOCK_HIGH; | 149 | return MODE_CLOCK_HIGH; |
| 143 | 150 | ||
| 144 | if (mode->clock < 10000) | 151 | if (mode->clock < 10000) |
| @@ -492,7 +499,8 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 492 | for (clock = 0; clock <= max_clock; clock++) { | 499 | for (clock = 0; clock <= max_clock; clock++) { |
| 493 | int link_avail = intel_dp_link_clock(bws[clock]) * lane_count; | 500 | int link_avail = intel_dp_link_clock(bws[clock]) * lane_count; |
| 494 | 501 | ||
| 495 | if (intel_dp_link_required(mode->clock) <= link_avail) { | 502 | if (intel_dp_link_required(encoder->dev, intel_output, mode->clock) |
| 503 | <= link_avail) { | ||
| 496 | dp_priv->link_bw = bws[clock]; | 504 | dp_priv->link_bw = bws[clock]; |
| 497 | dp_priv->lane_count = lane_count; | 505 | dp_priv->lane_count = lane_count; |
| 498 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); | 506 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); |
| @@ -1289,53 +1297,7 @@ intel_dp_hot_plug(struct intel_output *intel_output) | |||
| 1289 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) | 1297 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) |
| 1290 | intel_dp_check_link_status(intel_output); | 1298 | intel_dp_check_link_status(intel_output); |
| 1291 | } | 1299 | } |
| 1292 | /* | 1300 | |
| 1293 | * Enumerate the child dev array parsed from VBT to check whether | ||
| 1294 | * the given DP is present. | ||
| 1295 | * If it is present, return 1. | ||
| 1296 | * If it is not present, return false. | ||
| 1297 | * If no child dev is parsed from VBT, it is assumed that the given | ||
| 1298 | * DP is present. | ||
| 1299 | */ | ||
| 1300 | static int dp_is_present_in_vbt(struct drm_device *dev, int dp_reg) | ||
| 1301 | { | ||
| 1302 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1303 | struct child_device_config *p_child; | ||
| 1304 | int i, dp_port, ret; | ||
| 1305 | |||
| 1306 | if (!dev_priv->child_dev_num) | ||
| 1307 | return 1; | ||
| 1308 | |||
| 1309 | dp_port = 0; | ||
| 1310 | if (dp_reg == DP_B || dp_reg == PCH_DP_B) | ||
| 1311 | dp_port = PORT_IDPB; | ||
| 1312 | else if (dp_reg == DP_C || dp_reg == PCH_DP_C) | ||
| 1313 | dp_port = PORT_IDPC; | ||
| 1314 | else if (dp_reg == DP_D || dp_reg == PCH_DP_D) | ||
| 1315 | dp_port = PORT_IDPD; | ||
| 1316 | |||
| 1317 | ret = 0; | ||
| 1318 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
| 1319 | p_child = dev_priv->child_dev + i; | ||
| 1320 | /* | ||
| 1321 | * If the device type is not DP, continue. | ||
| 1322 | */ | ||
| 1323 | if (p_child->device_type != DEVICE_TYPE_DP && | ||
| 1324 | p_child->device_type != DEVICE_TYPE_eDP) | ||
| 1325 | continue; | ||
| 1326 | /* Find the eDP port */ | ||
| 1327 | if (dp_reg == DP_A && p_child->device_type == DEVICE_TYPE_eDP) { | ||
| 1328 | ret = 1; | ||
| 1329 | break; | ||
| 1330 | } | ||
| 1331 | /* Find the DP port */ | ||
| 1332 | if (p_child->dvo_port == dp_port) { | ||
| 1333 | ret = 1; | ||
| 1334 | break; | ||
| 1335 | } | ||
| 1336 | } | ||
| 1337 | return ret; | ||
| 1338 | } | ||
| 1339 | void | 1301 | void |
| 1340 | intel_dp_init(struct drm_device *dev, int output_reg) | 1302 | intel_dp_init(struct drm_device *dev, int output_reg) |
| 1341 | { | 1303 | { |
| @@ -1345,10 +1307,6 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
| 1345 | struct intel_dp_priv *dp_priv; | 1307 | struct intel_dp_priv *dp_priv; |
| 1346 | const char *name = NULL; | 1308 | const char *name = NULL; |
| 1347 | 1309 | ||
| 1348 | if (!dp_is_present_in_vbt(dev, output_reg)) { | ||
| 1349 | DRM_DEBUG_KMS("DP is not present. Ignore it\n"); | ||
| 1350 | return; | ||
| 1351 | } | ||
| 1352 | intel_output = kcalloc(sizeof(struct intel_output) + | 1310 | intel_output = kcalloc(sizeof(struct intel_output) + |
| 1353 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); | 1311 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); |
| 1354 | if (!intel_output) | 1312 | if (!intel_output) |
| @@ -1373,11 +1331,10 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
| 1373 | else if (output_reg == DP_D || output_reg == PCH_DP_D) | 1331 | else if (output_reg == DP_D || output_reg == PCH_DP_D) |
| 1374 | intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); | 1332 | intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); |
| 1375 | 1333 | ||
| 1376 | if (IS_eDP(intel_output)) { | 1334 | if (IS_eDP(intel_output)) |
| 1377 | intel_output->crtc_mask = (1 << 1); | ||
| 1378 | intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT); | 1335 | intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT); |
| 1379 | } else | 1336 | |
| 1380 | intel_output->crtc_mask = (1 << 0) | (1 << 1); | 1337 | intel_output->crtc_mask = (1 << 0) | (1 << 1); |
| 1381 | connector->interlace_allowed = true; | 1338 | connector->interlace_allowed = true; |
| 1382 | connector->doublescan_allowed = 0; | 1339 | connector->doublescan_allowed = 0; |
| 1383 | 1340 | ||
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 06431941b233..0e268deed761 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
| @@ -225,52 +225,6 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = { | |||
| 225 | .destroy = intel_hdmi_enc_destroy, | 225 | .destroy = intel_hdmi_enc_destroy, |
| 226 | }; | 226 | }; |
| 227 | 227 | ||
| 228 | /* | ||
| 229 | * Enumerate the child dev array parsed from VBT to check whether | ||
| 230 | * the given HDMI is present. | ||
| 231 | * If it is present, return 1. | ||
| 232 | * If it is not present, return false. | ||
| 233 | * If no child dev is parsed from VBT, it assumes that the given | ||
| 234 | * HDMI is present. | ||
| 235 | */ | ||
| 236 | static int hdmi_is_present_in_vbt(struct drm_device *dev, int hdmi_reg) | ||
| 237 | { | ||
| 238 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 239 | struct child_device_config *p_child; | ||
| 240 | int i, hdmi_port, ret; | ||
| 241 | |||
| 242 | if (!dev_priv->child_dev_num) | ||
| 243 | return 1; | ||
| 244 | |||
| 245 | if (hdmi_reg == SDVOB) | ||
| 246 | hdmi_port = DVO_B; | ||
| 247 | else if (hdmi_reg == SDVOC) | ||
| 248 | hdmi_port = DVO_C; | ||
| 249 | else if (hdmi_reg == HDMIB) | ||
| 250 | hdmi_port = DVO_B; | ||
| 251 | else if (hdmi_reg == HDMIC) | ||
| 252 | hdmi_port = DVO_C; | ||
| 253 | else if (hdmi_reg == HDMID) | ||
| 254 | hdmi_port = DVO_D; | ||
| 255 | else | ||
| 256 | return 0; | ||
| 257 | |||
| 258 | ret = 0; | ||
| 259 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
| 260 | p_child = dev_priv->child_dev + i; | ||
| 261 | /* | ||
| 262 | * If the device type is not HDMI, continue. | ||
| 263 | */ | ||
| 264 | if (p_child->device_type != DEVICE_TYPE_HDMI) | ||
| 265 | continue; | ||
| 266 | /* Find the HDMI port */ | ||
| 267 | if (p_child->dvo_port == hdmi_port) { | ||
| 268 | ret = 1; | ||
| 269 | break; | ||
| 270 | } | ||
| 271 | } | ||
| 272 | return ret; | ||
| 273 | } | ||
| 274 | void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | 228 | void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) |
| 275 | { | 229 | { |
| 276 | struct drm_i915_private *dev_priv = dev->dev_private; | 230 | struct drm_i915_private *dev_priv = dev->dev_private; |
| @@ -278,10 +232,6 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | |||
| 278 | struct intel_output *intel_output; | 232 | struct intel_output *intel_output; |
| 279 | struct intel_hdmi_priv *hdmi_priv; | 233 | struct intel_hdmi_priv *hdmi_priv; |
| 280 | 234 | ||
| 281 | if (!hdmi_is_present_in_vbt(dev, sdvox_reg)) { | ||
| 282 | DRM_DEBUG_KMS("HDMI is not present. Ignored it \n"); | ||
| 283 | return; | ||
| 284 | } | ||
| 285 | intel_output = kcalloc(sizeof(struct intel_output) + | 235 | intel_output = kcalloc(sizeof(struct intel_output) + |
| 286 | sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL); | 236 | sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL); |
| 287 | if (!intel_output) | 237 | if (!intel_output) |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index f4b4aa242df1..aa74e59bec61 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -602,6 +602,20 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, | |||
| 602 | /* Some lid devices report incorrect lid status, assume they're connected */ | 602 | /* Some lid devices report incorrect lid status, assume they're connected */ |
| 603 | static const struct dmi_system_id bad_lid_status[] = { | 603 | static const struct dmi_system_id bad_lid_status[] = { |
| 604 | { | 604 | { |
| 605 | .ident = "Compaq nx9020", | ||
| 606 | .matches = { | ||
| 607 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 608 | DMI_MATCH(DMI_BOARD_NAME, "3084"), | ||
| 609 | }, | ||
| 610 | }, | ||
| 611 | { | ||
| 612 | .ident = "Samsung SX20S", | ||
| 613 | .matches = { | ||
| 614 | DMI_MATCH(DMI_SYS_VENDOR, "Phoenix Technologies LTD"), | ||
| 615 | DMI_MATCH(DMI_BOARD_NAME, "SX20S"), | ||
| 616 | }, | ||
| 617 | }, | ||
| 618 | { | ||
| 605 | .ident = "Aspire One", | 619 | .ident = "Aspire One", |
| 606 | .matches = { | 620 | .matches = { |
| 607 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 621 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
| @@ -912,7 +926,8 @@ static void intel_find_lvds_downclock(struct drm_device *dev, | |||
| 912 | } | 926 | } |
| 913 | } | 927 | } |
| 914 | mutex_unlock(&dev->mode_config.mutex); | 928 | mutex_unlock(&dev->mode_config.mutex); |
| 915 | if (temp_downclock < panel_fixed_mode->clock) { | 929 | if (temp_downclock < panel_fixed_mode->clock && |
| 930 | i915_lvds_downclock) { | ||
| 916 | /* We found the downclock for LVDS. */ | 931 | /* We found the downclock for LVDS. */ |
| 917 | dev_priv->lvds_downclock_avail = 1; | 932 | dev_priv->lvds_downclock_avail = 1; |
| 918 | dev_priv->lvds_downclock = temp_downclock; | 933 | dev_priv->lvds_downclock = temp_downclock; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index de5144c8c153..eaacfd0920df 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -462,14 +462,63 @@ static int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode) | |||
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | /** | 464 | /** |
| 465 | * Don't check status code from this as it switches the bus back to the | 465 | * Try to read the response after issuie the DDC switch command. But it |
| 466 | * SDVO chips which defeats the purpose of doing a bus switch in the first | 466 | * is noted that we must do the action of reading response and issuing DDC |
| 467 | * place. | 467 | * switch command in one I2C transaction. Otherwise when we try to start |
| 468 | * another I2C transaction after issuing the DDC bus switch, it will be | ||
| 469 | * switched to the internal SDVO register. | ||
| 468 | */ | 470 | */ |
| 469 | static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, | 471 | static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, |
| 470 | u8 target) | 472 | u8 target) |
| 471 | { | 473 | { |
| 472 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_CONTROL_BUS_SWITCH, &target, 1); | 474 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; |
| 475 | u8 out_buf[2], cmd_buf[2], ret_value[2], ret; | ||
| 476 | struct i2c_msg msgs[] = { | ||
| 477 | { | ||
| 478 | .addr = sdvo_priv->slave_addr >> 1, | ||
| 479 | .flags = 0, | ||
| 480 | .len = 2, | ||
| 481 | .buf = out_buf, | ||
| 482 | }, | ||
| 483 | /* the following two are to read the response */ | ||
| 484 | { | ||
| 485 | .addr = sdvo_priv->slave_addr >> 1, | ||
| 486 | .flags = 0, | ||
| 487 | .len = 1, | ||
| 488 | .buf = cmd_buf, | ||
| 489 | }, | ||
| 490 | { | ||
| 491 | .addr = sdvo_priv->slave_addr >> 1, | ||
| 492 | .flags = I2C_M_RD, | ||
| 493 | .len = 1, | ||
| 494 | .buf = ret_value, | ||
| 495 | }, | ||
| 496 | }; | ||
| 497 | |||
| 498 | intel_sdvo_debug_write(intel_output, SDVO_CMD_SET_CONTROL_BUS_SWITCH, | ||
| 499 | &target, 1); | ||
| 500 | /* write the DDC switch command argument */ | ||
| 501 | intel_sdvo_write_byte(intel_output, SDVO_I2C_ARG_0, target); | ||
| 502 | |||
| 503 | out_buf[0] = SDVO_I2C_OPCODE; | ||
| 504 | out_buf[1] = SDVO_CMD_SET_CONTROL_BUS_SWITCH; | ||
| 505 | cmd_buf[0] = SDVO_I2C_CMD_STATUS; | ||
| 506 | cmd_buf[1] = 0; | ||
| 507 | ret_value[0] = 0; | ||
| 508 | ret_value[1] = 0; | ||
| 509 | |||
| 510 | ret = i2c_transfer(intel_output->i2c_bus, msgs, 3); | ||
| 511 | if (ret != 3) { | ||
| 512 | /* failure in I2C transfer */ | ||
| 513 | DRM_DEBUG_KMS("I2c transfer returned %d\n", ret); | ||
| 514 | return; | ||
| 515 | } | ||
| 516 | if (ret_value[0] != SDVO_CMD_STATUS_SUCCESS) { | ||
| 517 | DRM_DEBUG_KMS("DDC switch command returns response %d\n", | ||
| 518 | ret_value[0]); | ||
| 519 | return; | ||
| 520 | } | ||
| 521 | return; | ||
| 473 | } | 522 | } |
| 474 | 523 | ||
| 475 | static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1) | 524 | static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1) |
| @@ -1579,6 +1628,32 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | |||
| 1579 | edid = drm_get_edid(&intel_output->base, | 1628 | edid = drm_get_edid(&intel_output->base, |
| 1580 | intel_output->ddc_bus); | 1629 | intel_output->ddc_bus); |
| 1581 | 1630 | ||
| 1631 | /* This is only applied to SDVO cards with multiple outputs */ | ||
| 1632 | if (edid == NULL && intel_sdvo_multifunc_encoder(intel_output)) { | ||
| 1633 | uint8_t saved_ddc, temp_ddc; | ||
| 1634 | saved_ddc = sdvo_priv->ddc_bus; | ||
| 1635 | temp_ddc = sdvo_priv->ddc_bus >> 1; | ||
| 1636 | /* | ||
| 1637 | * Don't use the 1 as the argument of DDC bus switch to get | ||
| 1638 | * the EDID. It is used for SDVO SPD ROM. | ||
| 1639 | */ | ||
| 1640 | while(temp_ddc > 1) { | ||
| 1641 | sdvo_priv->ddc_bus = temp_ddc; | ||
| 1642 | edid = drm_get_edid(&intel_output->base, | ||
| 1643 | intel_output->ddc_bus); | ||
| 1644 | if (edid) { | ||
| 1645 | /* | ||
| 1646 | * When we can get the EDID, maybe it is the | ||
| 1647 | * correct DDC bus. Update it. | ||
| 1648 | */ | ||
| 1649 | sdvo_priv->ddc_bus = temp_ddc; | ||
| 1650 | break; | ||
| 1651 | } | ||
| 1652 | temp_ddc >>= 1; | ||
| 1653 | } | ||
| 1654 | if (edid == NULL) | ||
| 1655 | sdvo_priv->ddc_bus = saved_ddc; | ||
| 1656 | } | ||
| 1582 | /* when there is no edid and no monitor is connected with VGA | 1657 | /* when there is no edid and no monitor is connected with VGA |
| 1583 | * port, try to use the CRT ddc to read the EDID for DVI-connector | 1658 | * port, try to use the CRT ddc to read the EDID for DVI-connector |
| 1584 | */ | 1659 | */ |
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 1d5b9b7b033f..552ec110b741 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
| @@ -1840,8 +1840,6 @@ intel_tv_init(struct drm_device *dev) | |||
| 1840 | drm_connector_attach_property(connector, | 1840 | drm_connector_attach_property(connector, |
| 1841 | dev->mode_config.tv_bottom_margin_property, | 1841 | dev->mode_config.tv_bottom_margin_property, |
| 1842 | tv_priv->margin[TV_MARGIN_BOTTOM]); | 1842 | tv_priv->margin[TV_MARGIN_BOTTOM]); |
| 1843 | |||
| 1844 | dev_priv->hotplug_supported_mask |= TV_HOTPLUG_INT_STATUS; | ||
| 1845 | out: | 1843 | out: |
| 1846 | drm_sysfs_connector_add(connector); | 1844 | drm_sysfs_connector_add(connector); |
| 1847 | } | 1845 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index c0651991c3e4..f5ff3490929f 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -2729,7 +2729,7 @@ restart_ih: | |||
| 2729 | } | 2729 | } |
| 2730 | break; | 2730 | break; |
| 2731 | default: | 2731 | default: |
| 2732 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2732 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
| 2733 | break; | 2733 | break; |
| 2734 | } | 2734 | } |
| 2735 | break; | 2735 | break; |
| @@ -2749,7 +2749,7 @@ restart_ih: | |||
| 2749 | } | 2749 | } |
| 2750 | break; | 2750 | break; |
| 2751 | default: | 2751 | default: |
| 2752 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2752 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
| 2753 | break; | 2753 | break; |
| 2754 | } | 2754 | } |
| 2755 | break; | 2755 | break; |
| @@ -2798,7 +2798,7 @@ restart_ih: | |||
| 2798 | } | 2798 | } |
| 2799 | break; | 2799 | break; |
| 2800 | default: | 2800 | default: |
| 2801 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2801 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
| 2802 | break; | 2802 | break; |
| 2803 | } | 2803 | } |
| 2804 | break; | 2804 | break; |
| @@ -2812,7 +2812,7 @@ restart_ih: | |||
| 2812 | DRM_DEBUG("IH: CP EOP\n"); | 2812 | DRM_DEBUG("IH: CP EOP\n"); |
| 2813 | break; | 2813 | break; |
| 2814 | default: | 2814 | default: |
| 2815 | DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); | 2815 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
| 2816 | break; | 2816 | break; |
| 2817 | } | 2817 | } |
| 2818 | 2818 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 7914455c96ca..579c8920e081 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -687,6 +687,9 @@ radeon_combios_get_tv_info(struct radeon_device *rdev) | |||
| 687 | uint16_t tv_info; | 687 | uint16_t tv_info; |
| 688 | enum radeon_tv_std tv_std = TV_STD_NTSC; | 688 | enum radeon_tv_std tv_std = TV_STD_NTSC; |
| 689 | 689 | ||
| 690 | if (rdev->bios == NULL) | ||
| 691 | return tv_std; | ||
| 692 | |||
| 690 | tv_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); | 693 | tv_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); |
| 691 | if (tv_info) { | 694 | if (tv_info) { |
| 692 | if (RBIOS8(tv_info + 6) == 'T') { | 695 | if (RBIOS8(tv_info + 6) == 'T') { |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 9da10dd5df80..55266416fa47 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -900,10 +900,18 @@ static void radeon_dvi_force(struct drm_connector *connector) | |||
| 900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, | 900 | static int radeon_dvi_mode_valid(struct drm_connector *connector, |
| 901 | struct drm_display_mode *mode) | 901 | struct drm_display_mode *mode) |
| 902 | { | 902 | { |
| 903 | struct drm_device *dev = connector->dev; | ||
| 904 | struct radeon_device *rdev = dev->dev_private; | ||
| 903 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 905 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 904 | 906 | ||
| 905 | /* XXX check mode bandwidth */ | 907 | /* XXX check mode bandwidth */ |
| 906 | 908 | ||
| 909 | /* clocks over 135 MHz have heat issues with DVI on RV100 */ | ||
| 910 | if (radeon_connector->use_digital && | ||
| 911 | (rdev->family == CHIP_RV100) && | ||
| 912 | (mode->clock > 135000)) | ||
| 913 | return MODE_CLOCK_HIGH; | ||
| 914 | |||
| 907 | if (radeon_connector->use_digital && (mode->clock > 165000)) { | 915 | if (radeon_connector->use_digital && (mode->clock > 165000)) { |
| 908 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || | 916 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || |
| 909 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || | 917 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 981508ff7037..38e45e231ef5 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
| @@ -46,6 +46,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 46 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 46 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
| 47 | uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man; | 47 | uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man; |
| 48 | int panel_pwr_delay = 2000; | 48 | int panel_pwr_delay = 2000; |
| 49 | bool is_mac = false; | ||
| 49 | DRM_DEBUG("\n"); | 50 | DRM_DEBUG("\n"); |
| 50 | 51 | ||
| 51 | if (radeon_encoder->enc_priv) { | 52 | if (radeon_encoder->enc_priv) { |
| @@ -58,6 +59,15 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 58 | } | 59 | } |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 62 | /* macs (and possibly some x86 oem systems?) wire up LVDS strangely | ||
| 63 | * Taken from radeonfb. | ||
| 64 | */ | ||
| 65 | if ((rdev->mode_info.connector_table == CT_IBOOK) || | ||
| 66 | (rdev->mode_info.connector_table == CT_POWERBOOK_EXTERNAL) || | ||
| 67 | (rdev->mode_info.connector_table == CT_POWERBOOK_INTERNAL) || | ||
| 68 | (rdev->mode_info.connector_table == CT_POWERBOOK_VGA)) | ||
| 69 | is_mac = true; | ||
| 70 | |||
| 61 | switch (mode) { | 71 | switch (mode) { |
| 62 | case DRM_MODE_DPMS_ON: | 72 | case DRM_MODE_DPMS_ON: |
| 63 | disp_pwr_man = RREG32(RADEON_DISP_PWR_MAN); | 73 | disp_pwr_man = RREG32(RADEON_DISP_PWR_MAN); |
| @@ -74,6 +84,8 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 74 | 84 | ||
| 75 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); | 85 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); |
| 76 | lvds_gen_cntl |= (RADEON_LVDS_ON | RADEON_LVDS_EN | RADEON_LVDS_DIGON | RADEON_LVDS_BLON); | 86 | lvds_gen_cntl |= (RADEON_LVDS_ON | RADEON_LVDS_EN | RADEON_LVDS_DIGON | RADEON_LVDS_BLON); |
| 87 | if (is_mac) | ||
| 88 | lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; | ||
| 77 | lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS); | 89 | lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS); |
| 78 | udelay(panel_pwr_delay * 1000); | 90 | udelay(panel_pwr_delay * 1000); |
| 79 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | 91 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); |
| @@ -85,7 +97,14 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 85 | WREG32_PLL_P(RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); | 97 | WREG32_PLL_P(RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); |
| 86 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); | 98 | lvds_gen_cntl = RREG32(RADEON_LVDS_GEN_CNTL); |
| 87 | lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; | 99 | lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; |
| 88 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN | RADEON_LVDS_DIGON); | 100 | if (is_mac) { |
| 101 | lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN; | ||
| 102 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | ||
| 103 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); | ||
| 104 | } else { | ||
| 105 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | ||
| 106 | lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN | RADEON_LVDS_DIGON); | ||
| 107 | } | ||
| 89 | udelay(panel_pwr_delay * 1000); | 108 | udelay(panel_pwr_delay * 1000); |
| 90 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | 109 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); |
| 91 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); | 110 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); |
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 3b0c07b444a2..58b5adf974ca 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
| @@ -215,7 +215,10 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo, | |||
| 215 | rbo = container_of(bo, struct radeon_bo, tbo); | 215 | rbo = container_of(bo, struct radeon_bo, tbo); |
| 216 | switch (bo->mem.mem_type) { | 216 | switch (bo->mem.mem_type) { |
| 217 | case TTM_PL_VRAM: | 217 | case TTM_PL_VRAM: |
| 218 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); | 218 | if (rbo->rdev->cp.ready == false) |
| 219 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_CPU); | ||
| 220 | else | ||
| 221 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); | ||
| 219 | break; | 222 | break; |
| 220 | case TTM_PL_TT: | 223 | case TTM_PL_TT: |
| 221 | default: | 224 | default: |
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 4b96e7a898cf..5b4d66dc1a05 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
| @@ -431,6 +431,13 @@ static const struct hid_device_id apple_devices[] = { | |||
| 431 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | 431 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
| 432 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), | 432 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), |
| 433 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | 433 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
| 434 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | ||
| 435 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
| 436 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | ||
| 437 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | ||
| 438 | APPLE_ISO_KEYBOARD }, | ||
| 439 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), | ||
| 440 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
| 434 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), | 441 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), |
| 435 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 442 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
| 436 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), | 443 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 80792d38d25c..eabe5f87c6c1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1285,6 +1285,9 @@ static const struct hid_device_id hid_blacklist[] = { | |||
| 1285 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, | 1285 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, |
| 1286 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, | 1286 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, |
| 1287 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, | 1287 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, |
| 1288 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, | ||
| 1289 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, | ||
| 1290 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, | ||
| 1288 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | 1291 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, |
| 1289 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | 1292 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
| 1290 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, | 1293 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, |
| @@ -1553,6 +1556,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
| 1553 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, | 1556 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, |
| 1554 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, | 1557 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, |
| 1555 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, | 1558 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, |
| 1559 | { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) }, | ||
| 1556 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, | 1560 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, |
| 1557 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, | 1561 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, |
| 1558 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, | 1562 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 3839340e293a..010368e649ed 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -88,6 +88,9 @@ | |||
| 88 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 | 88 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236 |
| 89 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 | 89 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237 |
| 90 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 | 90 | #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 |
| 91 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 | ||
| 92 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a | ||
| 93 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b | ||
| 91 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a | 94 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a |
| 92 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b | 95 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b |
| 93 | #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241 | 96 | #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241 |
| @@ -166,6 +169,9 @@ | |||
| 166 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | 169 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f |
| 167 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | 170 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 |
| 168 | 171 | ||
| 172 | #define USB_VENDOR_ID_ETT 0x0664 | ||
| 173 | #define USB_DEVICE_ID_TC5UH 0x0309 | ||
| 174 | |||
| 169 | #define USB_VENDOR_ID_EZKEY 0x0518 | 175 | #define USB_VENDOR_ID_EZKEY 0x0518 |
| 170 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 176 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
| 171 | 177 | ||
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 5b222eed0692..510dd1340597 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c | |||
| @@ -39,7 +39,17 @@ | |||
| 39 | * | 39 | * |
| 40 | * 3. 135 byte report descriptor | 40 | * 3. 135 byte report descriptor |
| 41 | * Report #4 has an array field with logical range 0..17 instead of 1..14. | 41 | * Report #4 has an array field with logical range 0..17 instead of 1..14. |
| 42 | * | ||
| 43 | * 4. 171 byte report descriptor | ||
| 44 | * Report #3 has an array field with logical range 0..1 instead of 1..3. | ||
| 42 | */ | 45 | */ |
| 46 | static inline void samsung_dev_trace(struct hid_device *hdev, | ||
| 47 | unsigned int rsize) | ||
| 48 | { | ||
| 49 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | ||
| 50 | "descriptor\n", rsize); | ||
| 51 | } | ||
| 52 | |||
| 43 | static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 53 | static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
| 44 | unsigned int rsize) | 54 | unsigned int rsize) |
| 45 | { | 55 | { |
| @@ -47,8 +57,7 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 47 | rdesc[177] == 0x75 && rdesc[178] == 0x30 && | 57 | rdesc[177] == 0x75 && rdesc[178] == 0x30 && |
| 48 | rdesc[179] == 0x95 && rdesc[180] == 0x01 && | 58 | rdesc[179] == 0x95 && rdesc[180] == 0x01 && |
| 49 | rdesc[182] == 0x40) { | 59 | rdesc[182] == 0x40) { |
| 50 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 60 | samsung_dev_trace(hdev, 184); |
| 51 | "descriptor\n", 184); | ||
| 52 | rdesc[176] = 0xff; | 61 | rdesc[176] = 0xff; |
| 53 | rdesc[178] = 0x08; | 62 | rdesc[178] = 0x08; |
| 54 | rdesc[180] = 0x06; | 63 | rdesc[180] = 0x06; |
| @@ -56,17 +65,21 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 56 | } else | 65 | } else |
| 57 | if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 && | 66 | if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 && |
| 58 | rdesc[194] == 0x25 && rdesc[195] == 0x12) { | 67 | rdesc[194] == 0x25 && rdesc[195] == 0x12) { |
| 59 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 68 | samsung_dev_trace(hdev, 203); |
| 60 | "descriptor\n", 203); | ||
| 61 | rdesc[193] = 0x1; | 69 | rdesc[193] = 0x1; |
| 62 | rdesc[195] = 0xf; | 70 | rdesc[195] = 0xf; |
| 63 | } else | 71 | } else |
| 64 | if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 && | 72 | if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 && |
| 65 | rdesc[126] == 0x25 && rdesc[127] == 0x11) { | 73 | rdesc[126] == 0x25 && rdesc[127] == 0x11) { |
| 66 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 74 | samsung_dev_trace(hdev, 135); |
| 67 | "descriptor\n", 135); | ||
| 68 | rdesc[125] = 0x1; | 75 | rdesc[125] = 0x1; |
| 69 | rdesc[127] = 0xe; | 76 | rdesc[127] = 0xe; |
| 77 | } else | ||
| 78 | if (rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 && | ||
| 79 | rdesc[162] == 0x25 && rdesc[163] == 0x01) { | ||
| 80 | samsung_dev_trace(hdev, 171); | ||
| 81 | rdesc[161] = 0x1; | ||
| 82 | rdesc[163] = 0x3; | ||
| 70 | } | 83 | } |
| 71 | } | 84 | } |
| 72 | 85 | ||
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 747542172242..12dcda529201 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
| @@ -142,6 +142,7 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report, | |||
| 142 | wdata->butstate = rw; | 142 | wdata->butstate = rw; |
| 143 | input_report_key(input, BTN_0, rw & 0x02); | 143 | input_report_key(input, BTN_0, rw & 0x02); |
| 144 | input_report_key(input, BTN_1, rw & 0x01); | 144 | input_report_key(input, BTN_1, rw & 0x01); |
| 145 | input_report_key(input, BTN_TOOL_FINGER, 0xf0); | ||
| 145 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); | 146 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); |
| 146 | input_sync(input); | 147 | input_sync(input); |
| 147 | } | 148 | } |
| @@ -196,6 +197,9 @@ static int wacom_probe(struct hid_device *hdev, | |||
| 196 | /* Pad */ | 197 | /* Pad */ |
| 197 | input->evbit[0] |= BIT(EV_MSC); | 198 | input->evbit[0] |= BIT(EV_MSC); |
| 198 | input->mscbit[0] |= BIT(MSC_SERIAL); | 199 | input->mscbit[0] |= BIT(MSC_SERIAL); |
| 200 | set_bit(BTN_0, input->keybit); | ||
| 201 | set_bit(BTN_1, input->keybit); | ||
| 202 | set_bit(BTN_TOOL_FINGER, input->keybit); | ||
| 199 | 203 | ||
| 200 | /* Distance, rubber and mouse */ | 204 | /* Distance, rubber and mouse */ |
| 201 | input->absbit[0] |= BIT(ABS_DISTANCE); | 205 | input->absbit[0] |= BIT(ABS_DISTANCE); |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index dee6706038aa..258c639571b5 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -59,7 +59,8 @@ static void evdev_pass_event(struct evdev_client *client, | |||
| 59 | client->head &= EVDEV_BUFFER_SIZE - 1; | 59 | client->head &= EVDEV_BUFFER_SIZE - 1; |
| 60 | spin_unlock(&client->buffer_lock); | 60 | spin_unlock(&client->buffer_lock); |
| 61 | 61 | ||
| 62 | kill_fasync(&client->fasync, SIGIO, POLL_IN); | 62 | if (event->type == EV_SYN) |
| 63 | kill_fasync(&client->fasync, SIGIO, POLL_IN); | ||
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | /* | 66 | /* |
diff --git a/drivers/input/input.c b/drivers/input/input.c index ab060710688f..30b503b8d67b 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
| 25 | #include <linux/rcupdate.h> | 25 | #include <linux/rcupdate.h> |
| 26 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
| 27 | #include "input-compat.h" | ||
| 27 | 28 | ||
| 28 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); | 29 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); |
| 29 | MODULE_DESCRIPTION("Input core"); | 30 | MODULE_DESCRIPTION("Input core"); |
| @@ -764,6 +765,40 @@ static int input_attach_handler(struct input_dev *dev, struct input_handler *han | |||
| 764 | return error; | 765 | return error; |
| 765 | } | 766 | } |
| 766 | 767 | ||
| 768 | #ifdef CONFIG_COMPAT | ||
| 769 | |||
| 770 | static int input_bits_to_string(char *buf, int buf_size, | ||
| 771 | unsigned long bits, bool skip_empty) | ||
| 772 | { | ||
| 773 | int len = 0; | ||
| 774 | |||
| 775 | if (INPUT_COMPAT_TEST) { | ||
| 776 | u32 dword = bits >> 32; | ||
| 777 | if (dword || !skip_empty) | ||
| 778 | len += snprintf(buf, buf_size, "%x ", dword); | ||
| 779 | |||
| 780 | dword = bits & 0xffffffffUL; | ||
| 781 | if (dword || !skip_empty || len) | ||
| 782 | len += snprintf(buf + len, max(buf_size - len, 0), | ||
| 783 | "%x", dword); | ||
| 784 | } else { | ||
| 785 | if (bits || !skip_empty) | ||
| 786 | len += snprintf(buf, buf_size, "%lx", bits); | ||
| 787 | } | ||
| 788 | |||
| 789 | return len; | ||
| 790 | } | ||
| 791 | |||
| 792 | #else /* !CONFIG_COMPAT */ | ||
| 793 | |||
| 794 | static int input_bits_to_string(char *buf, int buf_size, | ||
| 795 | unsigned long bits, bool skip_empty) | ||
| 796 | { | ||
| 797 | return bits || !skip_empty ? | ||
| 798 | snprintf(buf, buf_size, "%lx", bits) : 0; | ||
| 799 | } | ||
| 800 | |||
| 801 | #endif | ||
| 767 | 802 | ||
| 768 | #ifdef CONFIG_PROC_FS | 803 | #ifdef CONFIG_PROC_FS |
| 769 | 804 | ||
| @@ -832,14 +867,25 @@ static void input_seq_print_bitmap(struct seq_file *seq, const char *name, | |||
| 832 | unsigned long *bitmap, int max) | 867 | unsigned long *bitmap, int max) |
| 833 | { | 868 | { |
| 834 | int i; | 869 | int i; |
| 835 | 870 | bool skip_empty = true; | |
| 836 | for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) | 871 | char buf[18]; |
| 837 | if (bitmap[i]) | ||
| 838 | break; | ||
| 839 | 872 | ||
| 840 | seq_printf(seq, "B: %s=", name); | 873 | seq_printf(seq, "B: %s=", name); |
| 841 | for (; i >= 0; i--) | 874 | |
| 842 | seq_printf(seq, "%lx%s", bitmap[i], i > 0 ? " " : ""); | 875 | for (i = BITS_TO_LONGS(max) - 1; i >= 0; i--) { |
| 876 | if (input_bits_to_string(buf, sizeof(buf), | ||
| 877 | bitmap[i], skip_empty)) { | ||
| 878 | skip_empty = false; | ||
| 879 | seq_printf(seq, "%s%s", buf, i > 0 ? " " : ""); | ||
| 880 | } | ||
| 881 | } | ||
| 882 | |||
| 883 | /* | ||
| 884 | * If no output was produced print a single 0. | ||
| 885 | */ | ||
| 886 | if (skip_empty) | ||
| 887 | seq_puts(seq, "0"); | ||
| 888 | |||
| 843 | seq_putc(seq, '\n'); | 889 | seq_putc(seq, '\n'); |
| 844 | } | 890 | } |
| 845 | 891 | ||
| @@ -1128,14 +1174,23 @@ static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap, | |||
| 1128 | { | 1174 | { |
| 1129 | int i; | 1175 | int i; |
| 1130 | int len = 0; | 1176 | int len = 0; |
| 1177 | bool skip_empty = true; | ||
| 1178 | |||
| 1179 | for (i = BITS_TO_LONGS(max) - 1; i >= 0; i--) { | ||
| 1180 | len += input_bits_to_string(buf + len, max(buf_size - len, 0), | ||
| 1181 | bitmap[i], skip_empty); | ||
| 1182 | if (len) { | ||
| 1183 | skip_empty = false; | ||
| 1184 | if (i > 0) | ||
| 1185 | len += snprintf(buf + len, max(buf_size - len, 0), " "); | ||
| 1186 | } | ||
| 1187 | } | ||
| 1131 | 1188 | ||
| 1132 | for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) | 1189 | /* |
| 1133 | if (bitmap[i]) | 1190 | * If no output was produced print a single 0. |
| 1134 | break; | 1191 | */ |
| 1135 | 1192 | if (len == 0) | |
| 1136 | for (; i >= 0; i--) | 1193 | len = snprintf(buf, buf_size, "%d", 0); |
| 1137 | len += snprintf(buf + len, max(buf_size - len, 0), | ||
| 1138 | "%lx%s", bitmap[i], i > 0 ? " " : ""); | ||
| 1139 | 1194 | ||
| 1140 | if (add_cr) | 1195 | if (add_cr) |
| 1141 | len += snprintf(buf + len, max(buf_size - len, 0), "\n"); | 1196 | len += snprintf(buf + len, max(buf_size - len, 0), "\n"); |
| @@ -1150,7 +1205,8 @@ static ssize_t input_dev_show_cap_##bm(struct device *dev, \ | |||
| 1150 | { \ | 1205 | { \ |
| 1151 | struct input_dev *input_dev = to_input_dev(dev); \ | 1206 | struct input_dev *input_dev = to_input_dev(dev); \ |
| 1152 | int len = input_print_bitmap(buf, PAGE_SIZE, \ | 1207 | int len = input_print_bitmap(buf, PAGE_SIZE, \ |
| 1153 | input_dev->bm##bit, ev##_MAX, 1); \ | 1208 | input_dev->bm##bit, ev##_MAX, \ |
| 1209 | true); \ | ||
| 1154 | return min_t(int, len, PAGE_SIZE); \ | 1210 | return min_t(int, len, PAGE_SIZE); \ |
| 1155 | } \ | 1211 | } \ |
| 1156 | static DEVICE_ATTR(bm, S_IRUGO, input_dev_show_cap_##bm, NULL) | 1212 | static DEVICE_ATTR(bm, S_IRUGO, input_dev_show_cap_##bm, NULL) |
| @@ -1214,7 +1270,7 @@ static int input_add_uevent_bm_var(struct kobj_uevent_env *env, | |||
| 1214 | 1270 | ||
| 1215 | len = input_print_bitmap(&env->buf[env->buflen - 1], | 1271 | len = input_print_bitmap(&env->buf[env->buflen - 1], |
| 1216 | sizeof(env->buf) - env->buflen, | 1272 | sizeof(env->buf) - env->buflen, |
| 1217 | bitmap, max, 0); | 1273 | bitmap, max, false); |
| 1218 | if (len >= (sizeof(env->buf) - env->buflen)) | 1274 | if (len >= (sizeof(env->buf) - env->buflen)) |
| 1219 | return -ENOMEM; | 1275 | return -ENOMEM; |
| 1220 | 1276 | ||
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index 67c207f5b1a1..45ac70eae0aa 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c | |||
| @@ -277,7 +277,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | #ifdef RESET_WORKS | 279 | #ifdef RESET_WORKS |
| 280 | if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) || | 280 | if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) && |
| 281 | (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) { | 281 | (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) { |
| 282 | err = -ENODEV; | 282 | err = -ENODEV; |
| 283 | goto fail2; | 283 | goto fail2; |
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 482cb1204e43..8a28fb7846dc 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
| @@ -446,7 +446,7 @@ static void xpad_irq_in(struct urb *urb) | |||
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | exit: | 448 | exit: |
| 449 | retval = usb_submit_urb (urb, GFP_ATOMIC); | 449 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
| 450 | if (retval) | 450 | if (retval) |
| 451 | err ("%s - usb_submit_urb failed with result %d", | 451 | err ("%s - usb_submit_urb failed with result %d", |
| 452 | __func__, retval); | 452 | __func__, retval); |
| @@ -571,7 +571,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data, | |||
| 571 | xpad->odata[6] = 0x00; | 571 | xpad->odata[6] = 0x00; |
| 572 | xpad->odata[7] = 0x00; | 572 | xpad->odata[7] = 0x00; |
| 573 | xpad->irq_out->transfer_buffer_length = 8; | 573 | xpad->irq_out->transfer_buffer_length = 8; |
| 574 | usb_submit_urb(xpad->irq_out, GFP_KERNEL); | 574 | usb_submit_urb(xpad->irq_out, GFP_ATOMIC); |
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | return 0; | 577 | return 0; |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 1f5e2ce327d6..7b4056292eaf 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
| @@ -225,8 +225,10 @@ struct atkbd { | |||
| 225 | 225 | ||
| 226 | struct delayed_work event_work; | 226 | struct delayed_work event_work; |
| 227 | unsigned long event_jiffies; | 227 | unsigned long event_jiffies; |
| 228 | struct mutex event_mutex; | ||
| 229 | unsigned long event_mask; | 228 | unsigned long event_mask; |
| 229 | |||
| 230 | /* Serializes reconnect(), attr->set() and event work */ | ||
| 231 | struct mutex mutex; | ||
| 230 | }; | 232 | }; |
| 231 | 233 | ||
| 232 | /* | 234 | /* |
| @@ -577,7 +579,7 @@ static void atkbd_event_work(struct work_struct *work) | |||
| 577 | { | 579 | { |
| 578 | struct atkbd *atkbd = container_of(work, struct atkbd, event_work.work); | 580 | struct atkbd *atkbd = container_of(work, struct atkbd, event_work.work); |
| 579 | 581 | ||
| 580 | mutex_lock(&atkbd->event_mutex); | 582 | mutex_lock(&atkbd->mutex); |
| 581 | 583 | ||
| 582 | if (!atkbd->enabled) { | 584 | if (!atkbd->enabled) { |
| 583 | /* | 585 | /* |
| @@ -596,7 +598,7 @@ static void atkbd_event_work(struct work_struct *work) | |||
| 596 | atkbd_set_repeat_rate(atkbd); | 598 | atkbd_set_repeat_rate(atkbd); |
| 597 | } | 599 | } |
| 598 | 600 | ||
| 599 | mutex_unlock(&atkbd->event_mutex); | 601 | mutex_unlock(&atkbd->mutex); |
| 600 | } | 602 | } |
| 601 | 603 | ||
| 602 | /* | 604 | /* |
| @@ -612,7 +614,7 @@ static void atkbd_schedule_event_work(struct atkbd *atkbd, int event_bit) | |||
| 612 | 614 | ||
| 613 | atkbd->event_jiffies = jiffies; | 615 | atkbd->event_jiffies = jiffies; |
| 614 | set_bit(event_bit, &atkbd->event_mask); | 616 | set_bit(event_bit, &atkbd->event_mask); |
| 615 | wmb(); | 617 | mb(); |
| 616 | schedule_delayed_work(&atkbd->event_work, delay); | 618 | schedule_delayed_work(&atkbd->event_work, delay); |
| 617 | } | 619 | } |
| 618 | 620 | ||
| @@ -849,13 +851,20 @@ static void atkbd_disconnect(struct serio *serio) | |||
| 849 | { | 851 | { |
| 850 | struct atkbd *atkbd = serio_get_drvdata(serio); | 852 | struct atkbd *atkbd = serio_get_drvdata(serio); |
| 851 | 853 | ||
| 854 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | ||
| 855 | |||
| 852 | atkbd_disable(atkbd); | 856 | atkbd_disable(atkbd); |
| 853 | 857 | ||
| 854 | /* make sure we don't have a command in flight */ | 858 | input_unregister_device(atkbd->dev); |
| 859 | |||
| 860 | /* | ||
| 861 | * Make sure we don't have a command in flight. | ||
| 862 | * Note that since atkbd->enabled is false event work will keep | ||
| 863 | * rescheduling itself until it gets canceled and will not try | ||
| 864 | * accessing freed input device or serio port. | ||
| 865 | */ | ||
| 855 | cancel_delayed_work_sync(&atkbd->event_work); | 866 | cancel_delayed_work_sync(&atkbd->event_work); |
| 856 | 867 | ||
| 857 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | ||
| 858 | input_unregister_device(atkbd->dev); | ||
| 859 | serio_close(serio); | 868 | serio_close(serio); |
| 860 | serio_set_drvdata(serio, NULL); | 869 | serio_set_drvdata(serio, NULL); |
| 861 | kfree(atkbd); | 870 | kfree(atkbd); |
| @@ -1087,7 +1096,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
| 1087 | atkbd->dev = dev; | 1096 | atkbd->dev = dev; |
| 1088 | ps2_init(&atkbd->ps2dev, serio); | 1097 | ps2_init(&atkbd->ps2dev, serio); |
| 1089 | INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); | 1098 | INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); |
| 1090 | mutex_init(&atkbd->event_mutex); | 1099 | mutex_init(&atkbd->mutex); |
| 1091 | 1100 | ||
| 1092 | switch (serio->id.type) { | 1101 | switch (serio->id.type) { |
| 1093 | 1102 | ||
| @@ -1160,19 +1169,23 @@ static int atkbd_reconnect(struct serio *serio) | |||
| 1160 | { | 1169 | { |
| 1161 | struct atkbd *atkbd = serio_get_drvdata(serio); | 1170 | struct atkbd *atkbd = serio_get_drvdata(serio); |
| 1162 | struct serio_driver *drv = serio->drv; | 1171 | struct serio_driver *drv = serio->drv; |
| 1172 | int retval = -1; | ||
| 1163 | 1173 | ||
| 1164 | if (!atkbd || !drv) { | 1174 | if (!atkbd || !drv) { |
| 1165 | printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); | 1175 | printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); |
| 1166 | return -1; | 1176 | return -1; |
| 1167 | } | 1177 | } |
| 1168 | 1178 | ||
| 1179 | mutex_lock(&atkbd->mutex); | ||
| 1180 | |||
| 1169 | atkbd_disable(atkbd); | 1181 | atkbd_disable(atkbd); |
| 1170 | 1182 | ||
| 1171 | if (atkbd->write) { | 1183 | if (atkbd->write) { |
| 1172 | if (atkbd_probe(atkbd)) | 1184 | if (atkbd_probe(atkbd)) |
| 1173 | return -1; | 1185 | goto out; |
| 1186 | |||
| 1174 | if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra)) | 1187 | if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra)) |
| 1175 | return -1; | 1188 | goto out; |
| 1176 | 1189 | ||
| 1177 | atkbd_activate(atkbd); | 1190 | atkbd_activate(atkbd); |
| 1178 | 1191 | ||
| @@ -1190,8 +1203,11 @@ static int atkbd_reconnect(struct serio *serio) | |||
| 1190 | } | 1203 | } |
| 1191 | 1204 | ||
| 1192 | atkbd_enable(atkbd); | 1205 | atkbd_enable(atkbd); |
| 1206 | retval = 0; | ||
| 1193 | 1207 | ||
| 1194 | return 0; | 1208 | out: |
| 1209 | mutex_unlock(&atkbd->mutex); | ||
| 1210 | return retval; | ||
| 1195 | } | 1211 | } |
| 1196 | 1212 | ||
| 1197 | static struct serio_device_id atkbd_serio_ids[] = { | 1213 | static struct serio_device_id atkbd_serio_ids[] = { |
| @@ -1235,47 +1251,28 @@ static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, | |||
| 1235 | ssize_t (*handler)(struct atkbd *, char *)) | 1251 | ssize_t (*handler)(struct atkbd *, char *)) |
| 1236 | { | 1252 | { |
| 1237 | struct serio *serio = to_serio_port(dev); | 1253 | struct serio *serio = to_serio_port(dev); |
| 1238 | int retval; | 1254 | struct atkbd *atkbd = serio_get_drvdata(serio); |
| 1239 | |||
| 1240 | retval = serio_pin_driver(serio); | ||
| 1241 | if (retval) | ||
| 1242 | return retval; | ||
| 1243 | |||
| 1244 | if (serio->drv != &atkbd_drv) { | ||
| 1245 | retval = -ENODEV; | ||
| 1246 | goto out; | ||
| 1247 | } | ||
| 1248 | |||
| 1249 | retval = handler((struct atkbd *)serio_get_drvdata(serio), buf); | ||
| 1250 | 1255 | ||
| 1251 | out: | 1256 | return handler(atkbd, buf); |
| 1252 | serio_unpin_driver(serio); | ||
| 1253 | return retval; | ||
| 1254 | } | 1257 | } |
| 1255 | 1258 | ||
| 1256 | static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count, | 1259 | static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count, |
| 1257 | ssize_t (*handler)(struct atkbd *, const char *, size_t)) | 1260 | ssize_t (*handler)(struct atkbd *, const char *, size_t)) |
| 1258 | { | 1261 | { |
| 1259 | struct serio *serio = to_serio_port(dev); | 1262 | struct serio *serio = to_serio_port(dev); |
| 1260 | struct atkbd *atkbd; | 1263 | struct atkbd *atkbd = serio_get_drvdata(serio); |
| 1261 | int retval; | 1264 | int retval; |
| 1262 | 1265 | ||
| 1263 | retval = serio_pin_driver(serio); | 1266 | retval = mutex_lock_interruptible(&atkbd->mutex); |
| 1264 | if (retval) | 1267 | if (retval) |
| 1265 | return retval; | 1268 | return retval; |
| 1266 | 1269 | ||
| 1267 | if (serio->drv != &atkbd_drv) { | ||
| 1268 | retval = -ENODEV; | ||
| 1269 | goto out; | ||
| 1270 | } | ||
| 1271 | |||
| 1272 | atkbd = serio_get_drvdata(serio); | ||
| 1273 | atkbd_disable(atkbd); | 1270 | atkbd_disable(atkbd); |
| 1274 | retval = handler(atkbd, buf, count); | 1271 | retval = handler(atkbd, buf, count); |
| 1275 | atkbd_enable(atkbd); | 1272 | atkbd_enable(atkbd); |
| 1276 | 1273 | ||
| 1277 | out: | 1274 | mutex_unlock(&atkbd->mutex); |
| 1278 | serio_unpin_driver(serio); | 1275 | |
| 1279 | return retval; | 1276 | return retval; |
| 1280 | } | 1277 | } |
| 1281 | 1278 | ||
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index 6e52d855f637..d410d7a52f1d 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c | |||
| @@ -174,6 +174,14 @@ static int __init davinci_ks_probe(struct platform_device *pdev) | |||
| 174 | struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; | 174 | struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; |
| 175 | int error, i; | 175 | int error, i; |
| 176 | 176 | ||
| 177 | if (pdata->device_enable) { | ||
| 178 | error = pdata->device_enable(dev); | ||
| 179 | if (error < 0) { | ||
| 180 | dev_dbg(dev, "device enable function failed\n"); | ||
| 181 | return error; | ||
| 182 | } | ||
| 183 | } | ||
| 184 | |||
| 177 | if (!pdata->keymap) { | 185 | if (!pdata->keymap) { |
| 178 | dev_dbg(dev, "no keymap from pdata\n"); | 186 | dev_dbg(dev, "no keymap from pdata\n"); |
| 179 | return -EINVAL; | 187 | return -EINVAL; |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 0d1d33468b43..4f8fe0886b2a 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
| @@ -139,6 +139,7 @@ struct tp_finger { | |||
| 139 | /* trackpad finger data size, empirically at least ten fingers */ | 139 | /* trackpad finger data size, empirically at least ten fingers */ |
| 140 | #define SIZEOF_FINGER sizeof(struct tp_finger) | 140 | #define SIZEOF_FINGER sizeof(struct tp_finger) |
| 141 | #define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER) | 141 | #define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER) |
| 142 | #define MAX_FINGER_ORIENTATION 16384 | ||
| 142 | 143 | ||
| 143 | /* device-specific parameters */ | 144 | /* device-specific parameters */ |
| 144 | struct bcm5974_param { | 145 | struct bcm5974_param { |
| @@ -284,6 +285,26 @@ static void setup_events_to_report(struct input_dev *input_dev, | |||
| 284 | input_set_abs_params(input_dev, ABS_Y, | 285 | input_set_abs_params(input_dev, ABS_Y, |
| 285 | 0, cfg->y.dim, cfg->y.fuzz, 0); | 286 | 0, cfg->y.dim, cfg->y.fuzz, 0); |
| 286 | 287 | ||
| 288 | /* finger touch area */ | ||
| 289 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | ||
| 290 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
| 291 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, | ||
| 292 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
| 293 | /* finger approach area */ | ||
| 294 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, | ||
| 295 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
| 296 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, | ||
| 297 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
| 298 | /* finger orientation */ | ||
| 299 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, | ||
| 300 | -MAX_FINGER_ORIENTATION, | ||
| 301 | MAX_FINGER_ORIENTATION, 0, 0); | ||
| 302 | /* finger position */ | ||
| 303 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | ||
| 304 | cfg->x.devmin, cfg->x.devmax, 0, 0); | ||
| 305 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | ||
| 306 | cfg->y.devmin, cfg->y.devmax, 0, 0); | ||
| 307 | |||
| 287 | __set_bit(EV_KEY, input_dev->evbit); | 308 | __set_bit(EV_KEY, input_dev->evbit); |
| 288 | __set_bit(BTN_TOUCH, input_dev->keybit); | 309 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 289 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | 310 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
| @@ -310,13 +331,29 @@ static int report_bt_state(struct bcm5974 *dev, int size) | |||
| 310 | return 0; | 331 | return 0; |
| 311 | } | 332 | } |
| 312 | 333 | ||
| 334 | static void report_finger_data(struct input_dev *input, | ||
| 335 | const struct bcm5974_config *cfg, | ||
| 336 | const struct tp_finger *f) | ||
| 337 | { | ||
| 338 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major)); | ||
| 339 | input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor)); | ||
| 340 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major)); | ||
| 341 | input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor)); | ||
| 342 | input_report_abs(input, ABS_MT_ORIENTATION, | ||
| 343 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); | ||
| 344 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); | ||
| 345 | input_report_abs(input, ABS_MT_POSITION_Y, | ||
| 346 | cfg->y.devmin + cfg->y.devmax - raw2int(f->abs_y)); | ||
| 347 | input_mt_sync(input); | ||
| 348 | } | ||
| 349 | |||
| 313 | /* report trackpad data as logical trackpad state */ | 350 | /* report trackpad data as logical trackpad state */ |
| 314 | static int report_tp_state(struct bcm5974 *dev, int size) | 351 | static int report_tp_state(struct bcm5974 *dev, int size) |
| 315 | { | 352 | { |
| 316 | const struct bcm5974_config *c = &dev->cfg; | 353 | const struct bcm5974_config *c = &dev->cfg; |
| 317 | const struct tp_finger *f; | 354 | const struct tp_finger *f; |
| 318 | struct input_dev *input = dev->input; | 355 | struct input_dev *input = dev->input; |
| 319 | int raw_p, raw_w, raw_x, raw_y, raw_n; | 356 | int raw_p, raw_w, raw_x, raw_y, raw_n, i; |
| 320 | int ptest, origin, ibt = 0, nmin = 0, nmax = 0; | 357 | int ptest, origin, ibt = 0, nmin = 0, nmax = 0; |
| 321 | int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0; | 358 | int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0; |
| 322 | 359 | ||
| @@ -329,6 +366,11 @@ static int report_tp_state(struct bcm5974 *dev, int size) | |||
| 329 | 366 | ||
| 330 | /* always track the first finger; when detached, start over */ | 367 | /* always track the first finger; when detached, start over */ |
| 331 | if (raw_n) { | 368 | if (raw_n) { |
| 369 | |||
| 370 | /* report raw trackpad data */ | ||
| 371 | for (i = 0; i < raw_n; i++) | ||
| 372 | report_finger_data(input, c, &f[i]); | ||
| 373 | |||
| 332 | raw_p = raw2int(f->force_major); | 374 | raw_p = raw2int(f->force_major); |
| 333 | raw_w = raw2int(f->size_major); | 375 | raw_w = raw2int(f->size_major); |
| 334 | raw_x = raw2int(f->abs_x); | 376 | raw_x = raw2int(f->abs_x); |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 401ac6b6edd4..9774bdfaa482 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
| @@ -627,8 +627,15 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
| 627 | synaptics_hardware = true; | 627 | synaptics_hardware = true; |
| 628 | 628 | ||
| 629 | if (max_proto > PSMOUSE_IMEX) { | 629 | if (max_proto > PSMOUSE_IMEX) { |
| 630 | if (!set_properties || synaptics_init(psmouse) == 0) | 630 | /* |
| 631 | * Try activating protocol, but check if support is enabled first, since | ||
| 632 | * we try detecting Synaptics even when protocol is disabled. | ||
| 633 | */ | ||
| 634 | if (synaptics_supported() && | ||
| 635 | (!set_properties || synaptics_init(psmouse) == 0)) { | ||
| 631 | return PSMOUSE_SYNAPTICS; | 636 | return PSMOUSE_SYNAPTICS; |
| 637 | } | ||
| 638 | |||
| 632 | /* | 639 | /* |
| 633 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). | 640 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). |
| 634 | * Unfortunately Logitech/Genius probes confuse some firmware versions so | 641 | * Unfortunately Logitech/Genius probes confuse some firmware versions so |
| @@ -683,19 +690,6 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
| 683 | max_proto = PSMOUSE_IMEX; | 690 | max_proto = PSMOUSE_IMEX; |
| 684 | } | 691 | } |
| 685 | 692 | ||
| 686 | /* | ||
| 687 | * Try Finger Sensing Pad | ||
| 688 | */ | ||
| 689 | if (max_proto > PSMOUSE_IMEX) { | ||
| 690 | if (fsp_detect(psmouse, set_properties) == 0) { | ||
| 691 | if (!set_properties || fsp_init(psmouse) == 0) | ||
| 692 | return PSMOUSE_FSP; | ||
| 693 | /* | ||
| 694 | * Init failed, try basic relative protocols | ||
| 695 | */ | ||
| 696 | max_proto = PSMOUSE_IMEX; | ||
| 697 | } | ||
| 698 | } | ||
| 699 | 693 | ||
| 700 | if (max_proto > PSMOUSE_IMEX) { | 694 | if (max_proto > PSMOUSE_IMEX) { |
| 701 | if (genius_detect(psmouse, set_properties) == 0) | 695 | if (genius_detect(psmouse, set_properties) == 0) |
| @@ -712,6 +706,21 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
| 712 | } | 706 | } |
| 713 | 707 | ||
| 714 | /* | 708 | /* |
| 709 | * Try Finger Sensing Pad. We do it here because its probe upsets | ||
| 710 | * Trackpoint devices (causing TP_READ_ID command to time out). | ||
| 711 | */ | ||
| 712 | if (max_proto > PSMOUSE_IMEX) { | ||
| 713 | if (fsp_detect(psmouse, set_properties) == 0) { | ||
| 714 | if (!set_properties || fsp_init(psmouse) == 0) | ||
| 715 | return PSMOUSE_FSP; | ||
| 716 | /* | ||
| 717 | * Init failed, try basic relative protocols | ||
| 718 | */ | ||
| 719 | max_proto = PSMOUSE_IMEX; | ||
| 720 | } | ||
| 721 | } | ||
| 722 | |||
| 723 | /* | ||
| 715 | * Reset to defaults in case the device got confused by extended | 724 | * Reset to defaults in case the device got confused by extended |
| 716 | * protocol probes. Note that we follow up with full reset because | 725 | * protocol probes. Note that we follow up with full reset because |
| 717 | * some mice put themselves to sleep when they see PSMOUSE_RESET_DIS. | 726 | * some mice put themselves to sleep when they see PSMOUSE_RESET_DIS. |
| @@ -1450,24 +1459,10 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *de | |||
| 1450 | struct serio *serio = to_serio_port(dev); | 1459 | struct serio *serio = to_serio_port(dev); |
| 1451 | struct psmouse_attribute *attr = to_psmouse_attr(devattr); | 1460 | struct psmouse_attribute *attr = to_psmouse_attr(devattr); |
| 1452 | struct psmouse *psmouse; | 1461 | struct psmouse *psmouse; |
| 1453 | int retval; | ||
| 1454 | |||
| 1455 | retval = serio_pin_driver(serio); | ||
| 1456 | if (retval) | ||
| 1457 | return retval; | ||
| 1458 | |||
| 1459 | if (serio->drv != &psmouse_drv) { | ||
| 1460 | retval = -ENODEV; | ||
| 1461 | goto out; | ||
| 1462 | } | ||
| 1463 | 1462 | ||
| 1464 | psmouse = serio_get_drvdata(serio); | 1463 | psmouse = serio_get_drvdata(serio); |
| 1465 | 1464 | ||
| 1466 | retval = attr->show(psmouse, attr->data, buf); | 1465 | return attr->show(psmouse, attr->data, buf); |
| 1467 | |||
| 1468 | out: | ||
| 1469 | serio_unpin_driver(serio); | ||
| 1470 | return retval; | ||
| 1471 | } | 1466 | } |
| 1472 | 1467 | ||
| 1473 | ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *devattr, | 1468 | ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *devattr, |
| @@ -1478,18 +1473,9 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev | |||
| 1478 | struct psmouse *psmouse, *parent = NULL; | 1473 | struct psmouse *psmouse, *parent = NULL; |
| 1479 | int retval; | 1474 | int retval; |
| 1480 | 1475 | ||
| 1481 | retval = serio_pin_driver(serio); | ||
| 1482 | if (retval) | ||
| 1483 | return retval; | ||
| 1484 | |||
| 1485 | if (serio->drv != &psmouse_drv) { | ||
| 1486 | retval = -ENODEV; | ||
| 1487 | goto out_unpin; | ||
| 1488 | } | ||
| 1489 | |||
| 1490 | retval = mutex_lock_interruptible(&psmouse_mutex); | 1476 | retval = mutex_lock_interruptible(&psmouse_mutex); |
| 1491 | if (retval) | 1477 | if (retval) |
| 1492 | goto out_unpin; | 1478 | goto out; |
| 1493 | 1479 | ||
| 1494 | psmouse = serio_get_drvdata(serio); | 1480 | psmouse = serio_get_drvdata(serio); |
| 1495 | 1481 | ||
| @@ -1519,8 +1505,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev | |||
| 1519 | 1505 | ||
| 1520 | out_unlock: | 1506 | out_unlock: |
| 1521 | mutex_unlock(&psmouse_mutex); | 1507 | mutex_unlock(&psmouse_mutex); |
| 1522 | out_unpin: | 1508 | out: |
| 1523 | serio_unpin_driver(serio); | ||
| 1524 | return retval; | 1509 | return retval; |
| 1525 | } | 1510 | } |
| 1526 | 1511 | ||
| @@ -1582,9 +1567,7 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co | |||
| 1582 | } | 1567 | } |
| 1583 | 1568 | ||
| 1584 | mutex_unlock(&psmouse_mutex); | 1569 | mutex_unlock(&psmouse_mutex); |
| 1585 | serio_unpin_driver(serio); | ||
| 1586 | serio_unregister_child_port(serio); | 1570 | serio_unregister_child_port(serio); |
| 1587 | serio_pin_driver_uninterruptible(serio); | ||
| 1588 | mutex_lock(&psmouse_mutex); | 1571 | mutex_lock(&psmouse_mutex); |
| 1589 | 1572 | ||
| 1590 | if (serio->drv != &psmouse_drv) { | 1573 | if (serio->drv != &psmouse_drv) { |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 77b9fd0b3fbf..81a6b81cb2fe 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * Finger Sensing Pad PS/2 mouse driver. | 2 | * Finger Sensing Pad PS/2 mouse driver. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. | 4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. |
| 5 | * Copyright (C) 2005-2009 Tai-hwa Liang, Sentelic Corporation. | 5 | * Copyright (C) 2005-2010 Tai-hwa Liang, Sentelic Corporation. |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
| @@ -658,9 +658,9 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) | |||
| 658 | if (packet[3] & BIT(1)) | 658 | if (packet[3] & BIT(1)) |
| 659 | button_status |= 0x0f; /* wheel up */ | 659 | button_status |= 0x0f; /* wheel up */ |
| 660 | if (packet[3] & BIT(2)) | 660 | if (packet[3] & BIT(2)) |
| 661 | button_status |= BIT(5);/* horizontal left */ | 661 | button_status |= BIT(4);/* horizontal left */ |
| 662 | if (packet[3] & BIT(3)) | 662 | if (packet[3] & BIT(3)) |
| 663 | button_status |= BIT(4);/* horizontal right */ | 663 | button_status |= BIT(5);/* horizontal right */ |
| 664 | /* push back to packet queue */ | 664 | /* push back to packet queue */ |
| 665 | if (button_status != 0) | 665 | if (button_status != 0) |
| 666 | packet[3] = button_status; | 666 | packet[3] = button_status; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 05689e732191..d3f5243fa093 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -743,6 +743,11 @@ int synaptics_init(struct psmouse *psmouse) | |||
| 743 | return -1; | 743 | return -1; |
| 744 | } | 744 | } |
| 745 | 745 | ||
| 746 | bool synaptics_supported(void) | ||
| 747 | { | ||
| 748 | return true; | ||
| 749 | } | ||
| 750 | |||
| 746 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 751 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
| 747 | 752 | ||
| 748 | void __init synaptics_module_init(void) | 753 | void __init synaptics_module_init(void) |
| @@ -754,5 +759,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
| 754 | return -ENOSYS; | 759 | return -ENOSYS; |
| 755 | } | 760 | } |
| 756 | 761 | ||
| 762 | bool synaptics_supported(void) | ||
| 763 | { | ||
| 764 | return false; | ||
| 765 | } | ||
| 766 | |||
| 757 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 767 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
| 758 | 768 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 838e7f2c9b30..f0f40a331dc8 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
| @@ -109,5 +109,6 @@ void synaptics_module_init(void); | |||
| 109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); | 109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); |
| 110 | int synaptics_init(struct psmouse *psmouse); | 110 | int synaptics_init(struct psmouse *psmouse); |
| 111 | void synaptics_reset(struct psmouse *psmouse); | 111 | void synaptics_reset(struct psmouse *psmouse); |
| 112 | bool synaptics_supported(void); | ||
| 112 | 113 | ||
| 113 | #endif /* _SYNAPTICS_H */ | 114 | #endif /* _SYNAPTICS_H */ |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 64b688daf48a..2a5982e532f8 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -524,6 +524,13 @@ static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = { | |||
| 524 | */ | 524 | */ |
| 525 | static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { | 525 | static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { |
| 526 | { | 526 | { |
| 527 | /* Acer Aspire 5610 */ | ||
| 528 | .matches = { | ||
| 529 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 530 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), | ||
| 531 | }, | ||
| 532 | }, | ||
| 533 | { | ||
| 527 | /* Acer Aspire 5630 */ | 534 | /* Acer Aspire 5630 */ |
| 528 | .matches = { | 535 | .matches = { |
| 529 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 536 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index cebbd9079d53..d6ee28f6ea08 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
| @@ -582,7 +582,6 @@ extern s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | |||
| 582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); | 582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); |
| 583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | 583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, |
| 584 | u16 data); | 584 | u16 data); |
| 585 | extern s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow); | ||
| 586 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); | 585 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); |
| 587 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); | 586 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); |
| 588 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); | 587 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index ad08cf3f40c0..8b6ecd127889 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
| @@ -138,6 +138,10 @@ | |||
| 138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ | 138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ |
| 139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ | 139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ |
| 140 | 140 | ||
| 141 | /* KMRN Mode Control */ | ||
| 142 | #define HV_KMRN_MODE_CTRL PHY_REG(769, 16) | ||
| 143 | #define HV_KMRN_MDIO_SLOW 0x0400 | ||
| 144 | |||
| 141 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ | 145 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ |
| 142 | /* Offset 04h HSFSTS */ | 146 | /* Offset 04h HSFSTS */ |
| 143 | union ich8_hws_flash_status { | 147 | union ich8_hws_flash_status { |
| @@ -219,6 +223,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); | |||
| 219 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); | 223 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); |
| 220 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); | 224 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); |
| 221 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | 225 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); |
| 226 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | ||
| 222 | 227 | ||
| 223 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 228 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
| 224 | { | 229 | { |
| @@ -270,7 +275,21 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 270 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 275 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
| 271 | 276 | ||
| 272 | phy->id = e1000_phy_unknown; | 277 | phy->id = e1000_phy_unknown; |
| 273 | e1000e_get_phy_id(hw); | 278 | ret_val = e1000e_get_phy_id(hw); |
| 279 | if (ret_val) | ||
| 280 | goto out; | ||
| 281 | if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) { | ||
| 282 | /* | ||
| 283 | * In case the PHY needs to be in mdio slow mode (eg. 82577), | ||
| 284 | * set slow mode and try to get the PHY id again. | ||
| 285 | */ | ||
| 286 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
| 287 | if (ret_val) | ||
| 288 | goto out; | ||
| 289 | ret_val = e1000e_get_phy_id(hw); | ||
| 290 | if (ret_val) | ||
| 291 | goto out; | ||
| 292 | } | ||
| 274 | phy->type = e1000e_get_phy_type_from_id(phy->id); | 293 | phy->type = e1000e_get_phy_type_from_id(phy->id); |
| 275 | 294 | ||
| 276 | switch (phy->type) { | 295 | switch (phy->type) { |
| @@ -292,6 +311,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 292 | break; | 311 | break; |
| 293 | } | 312 | } |
| 294 | 313 | ||
| 314 | out: | ||
| 295 | return ret_val; | 315 | return ret_val; |
| 296 | } | 316 | } |
| 297 | 317 | ||
| @@ -1076,16 +1096,44 @@ out: | |||
| 1076 | 1096 | ||
| 1077 | 1097 | ||
| 1078 | /** | 1098 | /** |
| 1099 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
| 1100 | * @hw: pointer to the HW structure | ||
| 1101 | **/ | ||
| 1102 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) | ||
| 1103 | { | ||
| 1104 | s32 ret_val; | ||
| 1105 | u16 data; | ||
| 1106 | |||
| 1107 | ret_val = e1e_rphy(hw, HV_KMRN_MODE_CTRL, &data); | ||
| 1108 | if (ret_val) | ||
| 1109 | return ret_val; | ||
| 1110 | |||
| 1111 | data |= HV_KMRN_MDIO_SLOW; | ||
| 1112 | |||
| 1113 | ret_val = e1e_wphy(hw, HV_KMRN_MODE_CTRL, data); | ||
| 1114 | |||
| 1115 | return ret_val; | ||
| 1116 | } | ||
| 1117 | |||
| 1118 | /** | ||
| 1079 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be | 1119 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
| 1080 | * done after every PHY reset. | 1120 | * done after every PHY reset. |
| 1081 | **/ | 1121 | **/ |
| 1082 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | 1122 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) |
| 1083 | { | 1123 | { |
| 1084 | s32 ret_val = 0; | 1124 | s32 ret_val = 0; |
| 1125 | u16 phy_data; | ||
| 1085 | 1126 | ||
| 1086 | if (hw->mac.type != e1000_pchlan) | 1127 | if (hw->mac.type != e1000_pchlan) |
| 1087 | return ret_val; | 1128 | return ret_val; |
| 1088 | 1129 | ||
| 1130 | /* Set MDIO slow mode before any other MDIO access */ | ||
| 1131 | if (hw->phy.type == e1000_phy_82577) { | ||
| 1132 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
| 1133 | if (ret_val) | ||
| 1134 | goto out; | ||
| 1135 | } | ||
| 1136 | |||
| 1089 | if (((hw->phy.type == e1000_phy_82577) && | 1137 | if (((hw->phy.type == e1000_phy_82577) && |
| 1090 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || | 1138 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || |
| 1091 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { | 1139 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { |
| @@ -1118,16 +1166,32 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | |||
| 1118 | 1166 | ||
| 1119 | hw->phy.addr = 1; | 1167 | hw->phy.addr = 1; |
| 1120 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); | 1168 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); |
| 1169 | hw->phy.ops.release(hw); | ||
| 1121 | if (ret_val) | 1170 | if (ret_val) |
| 1122 | goto out; | 1171 | goto out; |
| 1123 | hw->phy.ops.release(hw); | ||
| 1124 | 1172 | ||
| 1125 | /* | 1173 | /* |
| 1126 | * Configure the K1 Si workaround during phy reset assuming there is | 1174 | * Configure the K1 Si workaround during phy reset assuming there is |
| 1127 | * link so that it disables K1 if link is in 1Gbps. | 1175 | * link so that it disables K1 if link is in 1Gbps. |
| 1128 | */ | 1176 | */ |
| 1129 | ret_val = e1000_k1_gig_workaround_hv(hw, true); | 1177 | ret_val = e1000_k1_gig_workaround_hv(hw, true); |
| 1178 | if (ret_val) | ||
| 1179 | goto out; | ||
| 1130 | 1180 | ||
| 1181 | /* Workaround for link disconnects on a busy hub in half duplex */ | ||
| 1182 | ret_val = hw->phy.ops.acquire(hw); | ||
| 1183 | if (ret_val) | ||
| 1184 | goto out; | ||
| 1185 | ret_val = hw->phy.ops.read_reg_locked(hw, | ||
| 1186 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
| 1187 | &phy_data); | ||
| 1188 | if (ret_val) | ||
| 1189 | goto release; | ||
| 1190 | ret_val = hw->phy.ops.write_reg_locked(hw, | ||
| 1191 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
| 1192 | phy_data & 0x00FF); | ||
| 1193 | release: | ||
| 1194 | hw->phy.ops.release(hw); | ||
| 1131 | out: | 1195 | out: |
| 1132 | return ret_val; | 1196 | return ret_val; |
| 1133 | } | 1197 | } |
| @@ -1184,6 +1248,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
| 1184 | /* Allow time for h/w to get to a quiescent state after reset */ | 1248 | /* Allow time for h/w to get to a quiescent state after reset */ |
| 1185 | mdelay(10); | 1249 | mdelay(10); |
| 1186 | 1250 | ||
| 1251 | /* Perform any necessary post-reset workarounds */ | ||
| 1187 | if (hw->mac.type == e1000_pchlan) { | 1252 | if (hw->mac.type == e1000_pchlan) { |
| 1188 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 1253 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
| 1189 | if (ret_val) | 1254 | if (ret_val) |
| @@ -2484,6 +2549,10 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
| 2484 | if (!ret_val) | 2549 | if (!ret_val) |
| 2485 | e1000_release_swflag_ich8lan(hw); | 2550 | e1000_release_swflag_ich8lan(hw); |
| 2486 | 2551 | ||
| 2552 | /* Perform any necessary post-reset workarounds */ | ||
| 2553 | if (hw->mac.type == e1000_pchlan) | ||
| 2554 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
| 2555 | |||
| 2487 | if (ctrl & E1000_CTRL_PHY_RST) | 2556 | if (ctrl & E1000_CTRL_PHY_RST) |
| 2488 | ret_val = hw->phy.ops.get_cfg_done(hw); | 2557 | ret_val = hw->phy.ops.get_cfg_done(hw); |
| 2489 | 2558 | ||
| @@ -2528,9 +2597,6 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
| 2528 | kab |= E1000_KABGTXD_BGSQLBIAS; | 2597 | kab |= E1000_KABGTXD_BGSQLBIAS; |
| 2529 | ew32(KABGTXD, kab); | 2598 | ew32(KABGTXD, kab); |
| 2530 | 2599 | ||
| 2531 | if (hw->mac.type == e1000_pchlan) | ||
| 2532 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
| 2533 | |||
| 2534 | out: | 2600 | out: |
| 2535 | return ret_val; | 2601 | return ret_val; |
| 2536 | } | 2602 | } |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 55a2c0acfee7..7f3ceb9dad6a 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
| @@ -152,32 +152,9 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw) | |||
| 152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) | 152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) |
| 153 | goto out; | 153 | goto out; |
| 154 | 154 | ||
| 155 | /* | ||
| 156 | * If the PHY ID is still unknown, we may have an 82577 | ||
| 157 | * without link. We will try again after setting Slow MDIC | ||
| 158 | * mode. No harm in trying again in this case since the PHY | ||
| 159 | * ID is unknown at this point anyway. | ||
| 160 | */ | ||
| 161 | ret_val = phy->ops.acquire(hw); | ||
| 162 | if (ret_val) | ||
| 163 | goto out; | ||
| 164 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
| 165 | if (ret_val) | ||
| 166 | goto out; | ||
| 167 | phy->ops.release(hw); | ||
| 168 | |||
| 169 | retry_count++; | 155 | retry_count++; |
| 170 | } | 156 | } |
| 171 | out: | 157 | out: |
| 172 | /* Revert to MDIO fast mode, if applicable */ | ||
| 173 | if (retry_count) { | ||
| 174 | ret_val = phy->ops.acquire(hw); | ||
| 175 | if (ret_val) | ||
| 176 | return ret_val; | ||
| 177 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | ||
| 178 | phy->ops.release(hw); | ||
| 179 | } | ||
| 180 | |||
| 181 | return ret_val; | 158 | return ret_val; |
| 182 | } | 159 | } |
| 183 | 160 | ||
| @@ -2791,38 +2768,6 @@ static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) | |||
| 2791 | } | 2768 | } |
| 2792 | 2769 | ||
| 2793 | /** | 2770 | /** |
| 2794 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
| 2795 | * @hw: pointer to the HW structure | ||
| 2796 | * @slow: true for slow mode, false for normal mode | ||
| 2797 | * | ||
| 2798 | * Assumes semaphore already acquired. | ||
| 2799 | **/ | ||
| 2800 | s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow) | ||
| 2801 | { | ||
| 2802 | s32 ret_val = 0; | ||
| 2803 | u16 data = 0; | ||
| 2804 | |||
| 2805 | /* Set MDIO mode - page 769, register 16: 0x2580==slow, 0x2180==fast */ | ||
| 2806 | hw->phy.addr = 1; | ||
| 2807 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, | ||
| 2808 | (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); | ||
| 2809 | if (ret_val) | ||
| 2810 | goto out; | ||
| 2811 | |||
| 2812 | ret_val = e1000e_write_phy_reg_mdic(hw, BM_CS_CTRL1, | ||
| 2813 | (0x2180 | (slow << 10))); | ||
| 2814 | if (ret_val) | ||
| 2815 | goto out; | ||
| 2816 | |||
| 2817 | /* dummy read when reverting to fast mode - throw away result */ | ||
| 2818 | if (!slow) | ||
| 2819 | ret_val = e1000e_read_phy_reg_mdic(hw, BM_CS_CTRL1, &data); | ||
| 2820 | |||
| 2821 | out: | ||
| 2822 | return ret_val; | ||
| 2823 | } | ||
| 2824 | |||
| 2825 | /** | ||
| 2826 | * __e1000_read_phy_reg_hv - Read HV PHY register | 2771 | * __e1000_read_phy_reg_hv - Read HV PHY register |
| 2827 | * @hw: pointer to the HW structure | 2772 | * @hw: pointer to the HW structure |
| 2828 | * @offset: register offset to be read | 2773 | * @offset: register offset to be read |
| @@ -2839,7 +2784,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
| 2839 | s32 ret_val; | 2784 | s32 ret_val; |
| 2840 | u16 page = BM_PHY_REG_PAGE(offset); | 2785 | u16 page = BM_PHY_REG_PAGE(offset); |
| 2841 | u16 reg = BM_PHY_REG_NUM(offset); | 2786 | u16 reg = BM_PHY_REG_NUM(offset); |
| 2842 | bool in_slow_mode = false; | ||
| 2843 | 2787 | ||
| 2844 | if (!locked) { | 2788 | if (!locked) { |
| 2845 | ret_val = hw->phy.ops.acquire(hw); | 2789 | ret_val = hw->phy.ops.acquire(hw); |
| @@ -2847,16 +2791,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
| 2847 | return ret_val; | 2791 | return ret_val; |
| 2848 | } | 2792 | } |
| 2849 | 2793 | ||
| 2850 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
| 2851 | if ((hw->phy.type == e1000_phy_82577) && | ||
| 2852 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
| 2853 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
| 2854 | if (ret_val) | ||
| 2855 | goto out; | ||
| 2856 | |||
| 2857 | in_slow_mode = true; | ||
| 2858 | } | ||
| 2859 | |||
| 2860 | /* Page 800 works differently than the rest so it has its own func */ | 2794 | /* Page 800 works differently than the rest so it has its own func */ |
| 2861 | if (page == BM_WUC_PAGE) { | 2795 | if (page == BM_WUC_PAGE) { |
| 2862 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2796 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
| @@ -2893,10 +2827,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
| 2893 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2827 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
| 2894 | data); | 2828 | data); |
| 2895 | out: | 2829 | out: |
| 2896 | /* Revert to MDIO fast mode, if applicable */ | ||
| 2897 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
| 2898 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
| 2899 | |||
| 2900 | if (!locked) | 2830 | if (!locked) |
| 2901 | hw->phy.ops.release(hw); | 2831 | hw->phy.ops.release(hw); |
| 2902 | 2832 | ||
| @@ -2948,7 +2878,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
| 2948 | s32 ret_val; | 2878 | s32 ret_val; |
| 2949 | u16 page = BM_PHY_REG_PAGE(offset); | 2879 | u16 page = BM_PHY_REG_PAGE(offset); |
| 2950 | u16 reg = BM_PHY_REG_NUM(offset); | 2880 | u16 reg = BM_PHY_REG_NUM(offset); |
| 2951 | bool in_slow_mode = false; | ||
| 2952 | 2881 | ||
| 2953 | if (!locked) { | 2882 | if (!locked) { |
| 2954 | ret_val = hw->phy.ops.acquire(hw); | 2883 | ret_val = hw->phy.ops.acquire(hw); |
| @@ -2956,16 +2885,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
| 2956 | return ret_val; | 2885 | return ret_val; |
| 2957 | } | 2886 | } |
| 2958 | 2887 | ||
| 2959 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
| 2960 | if ((hw->phy.type == e1000_phy_82577) && | ||
| 2961 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
| 2962 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
| 2963 | if (ret_val) | ||
| 2964 | goto out; | ||
| 2965 | |||
| 2966 | in_slow_mode = true; | ||
| 2967 | } | ||
| 2968 | |||
| 2969 | /* Page 800 works differently than the rest so it has its own func */ | 2888 | /* Page 800 works differently than the rest so it has its own func */ |
| 2970 | if (page == BM_WUC_PAGE) { | 2889 | if (page == BM_WUC_PAGE) { |
| 2971 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2890 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
| @@ -3019,10 +2938,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
| 3019 | data); | 2938 | data); |
| 3020 | 2939 | ||
| 3021 | out: | 2940 | out: |
| 3022 | /* Revert to MDIO fast mode, if applicable */ | ||
| 3023 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
| 3024 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
| 3025 | |||
| 3026 | if (!locked) | 2941 | if (!locked) |
| 3027 | hw->phy.ops.release(hw); | 2942 | hw->phy.ops.release(hw); |
| 3028 | 2943 | ||
diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 21b41f42b61c..bfef0ebcba9a 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ################################################################################ | 1 | ################################################################################ |
| 2 | # | 2 | # |
| 3 | # Intel 10 Gigabit PCI Express Linux driver | 3 | # Intel 10 Gigabit PCI Express Linux driver |
| 4 | # Copyright(c) 1999 - 2009 Intel Corporation. | 4 | # Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | # | 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
| 7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 8da8eb535084..303e7bd39b67 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 204177d78cec..3103f4165311 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 538340527aa6..b49bd6b9feb7 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 688b8ca5da32..21f158f79dd0 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index 27f3214bed2e..dfff0ffaa502 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c index a1562287342f..9aea4f04bbd2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.c +++ b/drivers/net/ixgbe/ixgbe_dcb.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h index 64a9fa15c059..5caafd4afbc3 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.h +++ b/drivers/net/ixgbe/ixgbe_dcb.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c index f30263898ebc..f0e9279d4669 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.h b/drivers/net/ixgbe/ixgbe_dcb_82598.h index ebbe53c352a7..cc728fa092e2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c index ec8a252636d3..4f7a26ab411e 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ixgbe/ixgbe_dcb_82599.h index 9e5e2827e4af..0f3f791e1e1d 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 3c7a79a7d7c6..56f37f66b696 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 0bd49d3b9f65..d77961fc75f9 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index da32a108a7b4..e9a20c88c155 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h index de8ff53187da..abf4b2b3f252 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ixgbe/ixgbe_fcoe.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2ad754c864cf..9c9202f40b10 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
| @@ -52,7 +52,7 @@ static const char ixgbe_driver_string[] = | |||
| 52 | 52 | ||
| 53 | #define DRV_VERSION "2.0.44-k2" | 53 | #define DRV_VERSION "2.0.44-k2" |
| 54 | const char ixgbe_driver_version[] = DRV_VERSION; | 54 | const char ixgbe_driver_version[] = DRV_VERSION; |
| 55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2009 Intel Corporation."; | 55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2010 Intel Corporation."; |
| 56 | 56 | ||
| 57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
| 58 | [board_82598] = &ixgbe_82598_info, | 58 | [board_82598] = &ixgbe_82598_info, |
| @@ -5576,6 +5576,10 @@ static void ixgbe_netpoll(struct net_device *netdev) | |||
| 5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
| 5577 | int i; | 5577 | int i; |
| 5578 | 5578 | ||
| 5579 | /* if interface is down do nothing */ | ||
| 5580 | if (test_bit(__IXGBE_DOWN, &adapter->state)) | ||
| 5581 | return; | ||
| 5582 | |||
| 5579 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 5583 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
| 5580 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | 5584 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { |
| 5581 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 5585 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 9ecad17522c3..1c1efd386956 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h index 9b700f5bf1ed..9cf5f3b4cc5d 100644 --- a/drivers/net/ixgbe/ixgbe_phy.h +++ b/drivers/net/ixgbe/ixgbe_phy.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 84650c6ebe03..9eafddfa1b97 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
| 4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 683353b904c7..0d4eba7266ec 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
| @@ -142,8 +142,9 @@ static int efx_mcdi_poll(struct efx_nic *efx) | |||
| 142 | if (spins != 0) { | 142 | if (spins != 0) { |
| 143 | --spins; | 143 | --spins; |
| 144 | udelay(1); | 144 | udelay(1); |
| 145 | } else | 145 | } else { |
| 146 | schedule(); | 146 | schedule_timeout_uninterruptible(1); |
| 147 | } | ||
| 147 | 148 | ||
| 148 | time = get_seconds(); | 149 | time = get_seconds(); |
| 149 | 150 | ||
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index af3933579790..250c8827b842 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
| @@ -79,10 +79,14 @@ struct efx_loopback_state { | |||
| 79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) | 79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) |
| 80 | { | 80 | { |
| 81 | int rc = 0; | 81 | int rc = 0; |
| 82 | int devad = __ffs(efx->mdio.mmds); | 82 | int devad; |
| 83 | u16 physid1, physid2; | 83 | u16 physid1, physid2; |
| 84 | 84 | ||
| 85 | if (efx->phy_type == PHY_TYPE_NONE) | 85 | if (efx->mdio.mode_support & MDIO_SUPPORTS_C45) |
| 86 | devad = __ffs(efx->mdio.mmds); | ||
| 87 | else if (efx->mdio.mode_support & MDIO_SUPPORTS_C22) | ||
| 88 | devad = MDIO_DEVAD_NONE; | ||
| 89 | else | ||
| 86 | return 0; | 90 | return 0; |
| 87 | 91 | ||
| 88 | mutex_lock(&efx->mac_lock); | 92 | mutex_lock(&efx->mac_lock); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 3a74d2168598..7f82b0238e08 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
| 5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) |
| 6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
| 7 | * Copyright (C) 2005-2009 Broadcom Corporation. | 7 | * Copyright (C) 2005-2010 Broadcom Corporation. |
| 8 | * | 8 | * |
| 9 | * Firmware is: | 9 | * Firmware is: |
| 10 | * Derived from proprietary unpublished source code, | 10 | * Derived from proprietary unpublished source code, |
| @@ -68,8 +68,8 @@ | |||
| 68 | 68 | ||
| 69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
| 70 | #define PFX DRV_MODULE_NAME ": " | 70 | #define PFX DRV_MODULE_NAME ": " |
| 71 | #define DRV_MODULE_VERSION "3.105" | 71 | #define DRV_MODULE_VERSION "3.106" |
| 72 | #define DRV_MODULE_RELDATE "December 2, 2009" | 72 | #define DRV_MODULE_RELDATE "January 12, 2010" |
| 73 | 73 | ||
| 74 | #define TG3_DEF_MAC_MODE 0 | 74 | #define TG3_DEF_MAC_MODE 0 |
| 75 | #define TG3_DEF_RX_MODE 0 | 75 | #define TG3_DEF_RX_MODE 0 |
| @@ -1037,7 +1037,11 @@ static void tg3_mdio_start(struct tg3 *tp) | |||
| 1037 | else | 1037 | else |
| 1038 | tp->phy_addr = 1; | 1038 | tp->phy_addr = 1; |
| 1039 | 1039 | ||
| 1040 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | 1040 | if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) |
| 1041 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | ||
| 1042 | else | ||
| 1043 | is_serdes = tr32(TG3_CPMU_PHY_STRAP) & | ||
| 1044 | TG3_CPMU_PHY_STRAP_IS_SERDES; | ||
| 1041 | if (is_serdes) | 1045 | if (is_serdes) |
| 1042 | tp->phy_addr += 7; | 1046 | tp->phy_addr += 7; |
| 1043 | } else | 1047 | } else |
| @@ -4693,8 +4697,9 @@ next_pkt: | |||
| 4693 | (*post_ptr)++; | 4697 | (*post_ptr)++; |
| 4694 | 4698 | ||
| 4695 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { | 4699 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { |
| 4696 | u32 idx = *post_ptr % TG3_RX_RING_SIZE; | 4700 | tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE; |
| 4697 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx); | 4701 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, |
| 4702 | tpr->rx_std_prod_idx); | ||
| 4698 | work_mask &= ~RXD_OPAQUE_RING_STD; | 4703 | work_mask &= ~RXD_OPAQUE_RING_STD; |
| 4699 | rx_std_posted = 0; | 4704 | rx_std_posted = 0; |
| 4700 | } | 4705 | } |
| @@ -7742,7 +7747,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
| 7742 | ((u64) tpr->rx_std_mapping >> 32)); | 7747 | ((u64) tpr->rx_std_mapping >> 32)); |
| 7743 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, | 7748 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, |
| 7744 | ((u64) tpr->rx_std_mapping & 0xffffffff)); | 7749 | ((u64) tpr->rx_std_mapping & 0xffffffff)); |
| 7745 | if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) | 7750 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) |
| 7746 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, | 7751 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, |
| 7747 | NIC_SRAM_RX_BUFFER_DESC); | 7752 | NIC_SRAM_RX_BUFFER_DESC); |
| 7748 | 7753 | ||
| @@ -12122,7 +12127,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
| 12122 | 12127 | ||
| 12123 | tp->phy_id = eeprom_phy_id; | 12128 | tp->phy_id = eeprom_phy_id; |
| 12124 | if (eeprom_phy_serdes) { | 12129 | if (eeprom_phy_serdes) { |
| 12125 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) | 12130 | if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
| 12131 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
| 12126 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; | 12132 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; |
| 12127 | else | 12133 | else |
| 12128 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 12134 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
| @@ -13384,6 +13390,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
| 13384 | if (err) | 13390 | if (err) |
| 13385 | return err; | 13391 | return err; |
| 13386 | 13392 | ||
| 13393 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
| 13394 | (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 || | ||
| 13395 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) | ||
| 13396 | return -ENOTSUPP; | ||
| 13397 | |||
| 13387 | /* Initialize data/descriptor byte/word swapping. */ | 13398 | /* Initialize data/descriptor byte/word swapping. */ |
| 13388 | val = tr32(GRC_MODE); | 13399 | val = tr32(GRC_MODE); |
| 13389 | val &= GRC_MODE_HOST_STACKUP; | 13400 | val &= GRC_MODE_HOST_STACKUP; |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index cd30889650f8..8a167912902b 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
| 5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) |
| 6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
| 7 | * Copyright (C) 2007-2010 Broadcom Corporation. | ||
| 7 | */ | 8 | */ |
| 8 | 9 | ||
| 9 | #ifndef _T3_H | 10 | #ifndef _T3_H |
| @@ -1054,6 +1055,8 @@ | |||
| 1054 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 | 1055 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 |
| 1055 | #define TG3_CPMU_MUTEX_GNT 0x00003660 | 1056 | #define TG3_CPMU_MUTEX_GNT 0x00003660 |
| 1056 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 | 1057 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 |
| 1058 | #define TG3_CPMU_PHY_STRAP 0x00003664 | ||
| 1059 | #define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 | ||
| 1057 | /* 0x3664 --> 0x3800 unused */ | 1060 | /* 0x3664 --> 0x3800 unused */ |
| 1058 | 1061 | ||
| 1059 | /* Mbuf cluster free registers */ | 1062 | /* Mbuf cluster free registers */ |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 5d1c8677f180..6a3f4da7fb48 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
| @@ -97,7 +97,7 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
| 97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
| 98 | int ret; | 98 | int ret; |
| 99 | u16 val; | 99 | u16 val; |
| 100 | u32 cksum, offset; | 100 | u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX; |
| 101 | 101 | ||
| 102 | /* | 102 | /* |
| 103 | * Read values from EEPROM and store them in the capability structure | 103 | * Read values from EEPROM and store them in the capability structure |
| @@ -116,12 +116,38 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
| 116 | * Validate the checksum of the EEPROM date. There are some | 116 | * Validate the checksum of the EEPROM date. There are some |
| 117 | * devices with invalid EEPROMs. | 117 | * devices with invalid EEPROMs. |
| 118 | */ | 118 | */ |
| 119 | for (cksum = 0, offset = 0; offset < AR5K_EEPROM_INFO_MAX; offset++) { | 119 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_UPPER, val); |
| 120 | if (val) { | ||
| 121 | eep_max = (val & AR5K_EEPROM_SIZE_UPPER_MASK) << | ||
| 122 | AR5K_EEPROM_SIZE_ENDLOC_SHIFT; | ||
| 123 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_LOWER, val); | ||
| 124 | eep_max = (eep_max | val) - AR5K_EEPROM_INFO_BASE; | ||
| 125 | |||
| 126 | /* | ||
| 127 | * Fail safe check to prevent stupid loops due | ||
| 128 | * to busted EEPROMs. XXX: This value is likely too | ||
| 129 | * big still, waiting on a better value. | ||
| 130 | */ | ||
| 131 | if (eep_max > (3 * AR5K_EEPROM_INFO_MAX)) { | ||
| 132 | ATH5K_ERR(ah->ah_sc, "Invalid max custom EEPROM size: " | ||
| 133 | "%d (0x%04x) max expected: %d (0x%04x)\n", | ||
| 134 | eep_max, eep_max, | ||
| 135 | 3 * AR5K_EEPROM_INFO_MAX, | ||
| 136 | 3 * AR5K_EEPROM_INFO_MAX); | ||
| 137 | return -EIO; | ||
| 138 | } | ||
| 139 | } | ||
| 140 | |||
| 141 | for (cksum = 0, offset = 0; offset < eep_max; offset++) { | ||
| 120 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); | 142 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); |
| 121 | cksum ^= val; | 143 | cksum ^= val; |
| 122 | } | 144 | } |
| 123 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { | 145 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { |
| 124 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM checksum 0x%04x\n", cksum); | 146 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM " |
| 147 | "checksum: 0x%04x eep_max: 0x%04x (%s)\n", | ||
| 148 | cksum, eep_max, | ||
| 149 | eep_max == AR5K_EEPROM_INFO_MAX ? | ||
| 150 | "default size" : "custom size"); | ||
| 125 | return -EIO; | 151 | return -EIO; |
| 126 | } | 152 | } |
| 127 | 153 | ||
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h index 0123f3521a0b..473a483bb9c3 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.h +++ b/drivers/net/wireless/ath/ath5k/eeprom.h | |||
| @@ -37,6 +37,14 @@ | |||
| 37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 | 37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 |
| 38 | 38 | ||
| 39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ | 39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ |
| 40 | |||
| 41 | /* FLASH(EEPROM) Defines for AR531X chips */ | ||
| 42 | #define AR5K_EEPROM_SIZE_LOWER 0x1b /* size info -- lower */ | ||
| 43 | #define AR5K_EEPROM_SIZE_UPPER 0x1c /* size info -- upper */ | ||
| 44 | #define AR5K_EEPROM_SIZE_UPPER_MASK 0xfff0 | ||
| 45 | #define AR5K_EEPROM_SIZE_UPPER_SHIFT 4 | ||
| 46 | #define AR5K_EEPROM_SIZE_ENDLOC_SHIFT 12 | ||
| 47 | |||
| 40 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ | 48 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ |
| 41 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ | 49 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ |
| 42 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) | 50 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) |
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 03a1106ad725..5774cea23a3b 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig | |||
| @@ -25,7 +25,7 @@ config ATH9K | |||
| 25 | 25 | ||
| 26 | config ATH9K_DEBUGFS | 26 | config ATH9K_DEBUGFS |
| 27 | bool "Atheros ath9k debugging" | 27 | bool "Atheros ath9k debugging" |
| 28 | depends on ATH9K | 28 | depends on ATH9K && DEBUG_FS |
| 29 | ---help--- | 29 | ---help--- |
| 30 | Say Y, if you need access to ath9k's statistics for | 30 | Say Y, if you need access to ath9k's statistics for |
| 31 | interrupts, rate control, etc. | 31 | interrupts, rate control, etc. |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e2cef2ff5d8f..1597a42731ed 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
| @@ -33,11 +33,11 @@ struct ath_node; | |||
| 33 | 33 | ||
| 34 | /* Macro to expand scalars to 64-bit objects */ | 34 | /* Macro to expand scalars to 64-bit objects */ |
| 35 | 35 | ||
| 36 | #define ito64(x) (sizeof(x) == 8) ? \ | 36 | #define ito64(x) (sizeof(x) == 1) ? \ |
| 37 | (((unsigned long long int)(x)) & (0xff)) : \ | 37 | (((unsigned long long int)(x)) & (0xff)) : \ |
| 38 | (sizeof(x) == 16) ? \ | 38 | (sizeof(x) == 2) ? \ |
| 39 | (((unsigned long long int)(x)) & 0xffff) : \ | 39 | (((unsigned long long int)(x)) & 0xffff) : \ |
| 40 | ((sizeof(x) == 32) ? \ | 40 | ((sizeof(x) == 4) ? \ |
| 41 | (((unsigned long long int)(x)) & 0xffffffff) : \ | 41 | (((unsigned long long int)(x)) & 0xffffffff) : \ |
| 42 | (unsigned long long int)(x)) | 42 | (unsigned long long int)(x)) |
| 43 | 43 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 484c5fdf7c2a..9b4b8b5c7574 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
| @@ -1961,7 +1961,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
| 1961 | struct ieee80211_tx_info *info; | 1961 | struct ieee80211_tx_info *info; |
| 1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
| 1963 | u32 status = le32_to_cpu(tx_resp->u.status); | 1963 | u32 status = le32_to_cpu(tx_resp->u.status); |
| 1964 | int tid = MAX_TID_COUNT; | 1964 | int uninitialized_var(tid); |
| 1965 | int sta_id; | 1965 | int sta_id; |
| 1966 | int freed; | 1966 | int freed; |
| 1967 | u8 *qc = NULL; | 1967 | u8 *qc = NULL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 574d36658702..5461f105bd2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
| @@ -2344,6 +2344,21 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
| 2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
| 2345 | } | 2345 | } |
| 2346 | 2346 | ||
| 2347 | static inline void iwl_set_no_assoc(struct iwl_priv *priv) | ||
| 2348 | { | ||
| 2349 | priv->assoc_id = 0; | ||
| 2350 | iwl_led_disassociate(priv); | ||
| 2351 | /* | ||
| 2352 | * inform the ucode that there is no longer an | ||
| 2353 | * association and that no more packets should be | ||
| 2354 | * sent | ||
| 2355 | */ | ||
| 2356 | priv->staging_rxon.filter_flags &= | ||
| 2357 | ~RXON_FILTER_ASSOC_MSK; | ||
| 2358 | priv->staging_rxon.assoc_id = 0; | ||
| 2359 | iwlcore_commit_rxon(priv); | ||
| 2360 | } | ||
| 2361 | |||
| 2347 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | 2362 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) |
| 2348 | void iwl_bss_info_changed(struct ieee80211_hw *hw, | 2363 | void iwl_bss_info_changed(struct ieee80211_hw *hw, |
| 2349 | struct ieee80211_vif *vif, | 2364 | struct ieee80211_vif *vif, |
| @@ -2475,20 +2490,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
| 2475 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; | 2490 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; |
| 2476 | if (!iwl_is_rfkill(priv)) | 2491 | if (!iwl_is_rfkill(priv)) |
| 2477 | priv->cfg->ops->lib->post_associate(priv); | 2492 | priv->cfg->ops->lib->post_associate(priv); |
| 2478 | } else { | 2493 | } else |
| 2479 | priv->assoc_id = 0; | 2494 | iwl_set_no_assoc(priv); |
| 2480 | iwl_led_disassociate(priv); | ||
| 2481 | |||
| 2482 | /* | ||
| 2483 | * inform the ucode that there is no longer an | ||
| 2484 | * association and that no more packets should be | ||
| 2485 | * send | ||
| 2486 | */ | ||
| 2487 | priv->staging_rxon.filter_flags &= | ||
| 2488 | ~RXON_FILTER_ASSOC_MSK; | ||
| 2489 | priv->staging_rxon.assoc_id = 0; | ||
| 2490 | iwlcore_commit_rxon(priv); | ||
| 2491 | } | ||
| 2492 | } | 2495 | } |
| 2493 | 2496 | ||
| 2494 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { | 2497 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { |
| @@ -2503,12 +2506,14 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
| 2503 | } | 2506 | } |
| 2504 | } | 2507 | } |
| 2505 | 2508 | ||
| 2506 | if ((changes & BSS_CHANGED_BEACON_ENABLED) && | 2509 | if (changes & BSS_CHANGED_BEACON_ENABLED) { |
| 2507 | vif->bss_conf.enable_beacon) { | 2510 | if (vif->bss_conf.enable_beacon) { |
| 2508 | memcpy(priv->staging_rxon.bssid_addr, | 2511 | memcpy(priv->staging_rxon.bssid_addr, |
| 2509 | bss_conf->bssid, ETH_ALEN); | 2512 | bss_conf->bssid, ETH_ALEN); |
| 2510 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); | 2513 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); |
| 2511 | iwlcore_config_ap(priv); | 2514 | iwlcore_config_ap(priv); |
| 2515 | } else | ||
| 2516 | iwl_set_no_assoc(priv); | ||
| 2512 | } | 2517 | } |
| 2513 | 2518 | ||
| 2514 | mutex_unlock(&priv->mutex); | 2519 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 165d1f6e2dd9..3822cf53e368 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
| @@ -711,7 +711,7 @@ extern void iwl_txq_ctx_stop(struct iwl_priv *priv); | |||
| 711 | extern int iwl_queue_space(const struct iwl_queue *q); | 711 | extern int iwl_queue_space(const struct iwl_queue *q); |
| 712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) | 712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) |
| 713 | { | 713 | { |
| 714 | return q->write_ptr > q->read_ptr ? | 714 | return q->write_ptr >= q->read_ptr ? |
| 715 | (i >= q->read_ptr && i < q->write_ptr) : | 715 | (i >= q->read_ptr && i < q->write_ptr) : |
| 716 | !(i < q->read_ptr && i >= q->write_ptr); | 716 | !(i < q->read_ptr && i >= q->write_ptr); |
| 717 | } | 717 | } |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 59d49159cf2a..59f92105b0c2 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
| @@ -3157,8 +3157,10 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw, | |||
| 3157 | /* Clear unsupported feature flags */ | 3157 | /* Clear unsupported feature flags */ |
| 3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; | 3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; |
| 3159 | 3159 | ||
| 3160 | if (mwl8k_fw_lock(hw)) | 3160 | if (mwl8k_fw_lock(hw)) { |
| 3161 | kfree(cmd); | ||
| 3161 | return; | 3162 | return; |
| 3163 | } | ||
| 3162 | 3164 | ||
| 3163 | if (priv->sniffer_enabled) { | 3165 | if (priv->sniffer_enabled) { |
| 3164 | mwl8k_enable_sniffer(hw, 0); | 3166 | mwl8k_enable_sniffer(hw, 0); |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 27bf887f1453..9deae41cb784 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
| @@ -340,7 +340,7 @@ static int rt2800_blink_set(struct led_classdev *led_cdev, | |||
| 340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); | 340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); |
| 341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); | 341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); |
| 342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); | 342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); |
| 343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 12); | 343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 3); |
| 344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); | 344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); |
| 345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); | 345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); |
| 346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); | 346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 4d841c07c970..dcfc8c25d1a7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
| @@ -113,6 +113,12 @@ | |||
| 113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) | 113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) |
| 114 | 114 | ||
| 115 | /* | 115 | /* |
| 116 | * Constants for extra TX headroom for alignment purposes. | ||
| 117 | */ | ||
| 118 | #define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */ | ||
| 119 | #define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */ | ||
| 120 | |||
| 121 | /* | ||
| 116 | * Standard timing and size defines. | 122 | * Standard timing and size defines. |
| 117 | * These values should follow the ieee80211 specifications. | 123 | * These values should follow the ieee80211 specifications. |
| 118 | */ | 124 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 06c43ca39bf8..265e66dba552 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
| @@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 686 | /* | 686 | /* |
| 687 | * Initialize extra TX headroom required. | 687 | * Initialize extra TX headroom required. |
| 688 | */ | 688 | */ |
| 689 | rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; | 689 | rt2x00dev->hw->extra_tx_headroom = |
| 690 | max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM, | ||
| 691 | rt2x00dev->ops->extra_tx_headroom); | ||
| 692 | |||
| 693 | /* | ||
| 694 | * Take TX headroom required for alignment into account. | ||
| 695 | */ | ||
| 696 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) | ||
| 697 | rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE; | ||
| 698 | else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) | ||
| 699 | rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE; | ||
| 690 | 700 | ||
| 691 | /* | 701 | /* |
| 692 | * Register HW. | 702 | * Register HW. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 239afc7a9c0b..9915a09141ef 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
| @@ -104,7 +104,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
| 104 | * is also mapped to the DMA so it can be used for transfering | 104 | * is also mapped to the DMA so it can be used for transfering |
| 105 | * additional descriptor information to the hardware. | 105 | * additional descriptor information to the hardware. |
| 106 | */ | 106 | */ |
| 107 | skb_push(skb, rt2x00dev->hw->extra_tx_headroom); | 107 | skb_push(skb, rt2x00dev->ops->extra_tx_headroom); |
| 108 | 108 | ||
| 109 | skbdesc->skb_dma = | 109 | skbdesc->skb_dma = |
| 110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); | 110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); |
| @@ -112,7 +112,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
| 112 | /* | 112 | /* |
| 113 | * Restore data pointer to original location again. | 113 | * Restore data pointer to original location again. |
| 114 | */ | 114 | */ |
| 115 | skb_pull(skb, rt2x00dev->hw->extra_tx_headroom); | 115 | skb_pull(skb, rt2x00dev->ops->extra_tx_headroom); |
| 116 | 116 | ||
| 117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; | 117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; |
| 118 | } | 118 | } |
| @@ -134,7 +134,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
| 134 | * by the driver, but it was actually mapped to DMA. | 134 | * by the driver, but it was actually mapped to DMA. |
| 135 | */ | 135 | */ |
| 136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, | 136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, |
| 137 | skb->len + rt2x00dev->hw->extra_tx_headroom, | 137 | skb->len + rt2x00dev->ops->extra_tx_headroom, |
| 138 | DMA_TO_DEVICE); | 138 | DMA_TO_DEVICE); |
| 139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; | 139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; |
| 140 | } | 140 | } |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 8ebf5c33955d..f14deb0c8514 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
| @@ -987,12 +987,13 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw, | |||
| 987 | changed_flags &= SUPPORTED_FIF_FLAGS; | 987 | changed_flags &= SUPPORTED_FIF_FLAGS; |
| 988 | *new_flags &= SUPPORTED_FIF_FLAGS; | 988 | *new_flags &= SUPPORTED_FIF_FLAGS; |
| 989 | 989 | ||
| 990 | /* changed_flags is always populated but this driver | 990 | /* |
| 991 | * doesn't support all FIF flags so its possible we don't | 991 | * If multicast parameter (as returned by zd_op_prepare_multicast) |
| 992 | * need to do anything */ | 992 | * has changed, no bit in changed_flags is set. To handle this |
| 993 | if (!changed_flags) | 993 | * situation, we do not return if changed_flags is 0. If we do so, |
| 994 | return; | 994 | * we will have some issue with IPv6 which uses multicast for link |
| 995 | 995 | * layer address resolution. | |
| 996 | */ | ||
| 996 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) | 997 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) |
| 997 | zd_mc_add_all(&hash); | 998 | zd_mc_add_all(&hash); |
| 998 | 999 | ||
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 5819dc02a143..1c500c462225 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <asm/debug.h> | 23 | #include <asm/debug.h> |
| 24 | #include <asm/idals.h> | 24 | #include <asm/idals.h> |
| 25 | #include <asm/ebcdic.h> | 25 | #include <asm/ebcdic.h> |
| 26 | #include <asm/compat.h> | ||
| 26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
| 27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
| 28 | #include <asm/cio.h> | 29 | #include <asm/cio.h> |
| @@ -2844,13 +2845,16 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) | |||
| 2844 | rc = -EFAULT; | 2845 | rc = -EFAULT; |
| 2845 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) | 2846 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) |
| 2846 | goto out; | 2847 | goto out; |
| 2847 | #ifndef CONFIG_64BIT | 2848 | if (is_compat_task() || sizeof(long) == 4) { |
| 2848 | /* Make sure pointers are sane even on 31 bit. */ | 2849 | /* Make sure pointers are sane even on 31 bit. */ |
| 2849 | if ((usrparm.psf_data >> 32) != 0 || (usrparm.rssd_result >> 32) != 0) { | ||
| 2850 | rc = -EINVAL; | 2850 | rc = -EINVAL; |
| 2851 | goto out; | 2851 | if ((usrparm.psf_data >> 32) != 0) |
| 2852 | goto out; | ||
| 2853 | if ((usrparm.rssd_result >> 32) != 0) | ||
| 2854 | goto out; | ||
| 2855 | usrparm.psf_data &= 0x7fffffffULL; | ||
| 2856 | usrparm.rssd_result &= 0x7fffffffULL; | ||
| 2852 | } | 2857 | } |
| 2853 | #endif | ||
| 2854 | /* alloc I/O data area */ | 2858 | /* alloc I/O data area */ |
| 2855 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); | 2859 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); |
| 2856 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); | 2860 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); |
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 478bcdb90b6f..fc7b30b4a255 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
| 18 | #include <linux/blkpg.h> | 18 | #include <linux/blkpg.h> |
| 19 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
| 20 | 20 | #include <asm/compat.h> | |
| 21 | #include <asm/ccwdev.h> | 21 | #include <asm/ccwdev.h> |
| 22 | #include <asm/cmb.h> | 22 | #include <asm/cmb.h> |
| 23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
| @@ -358,9 +358,8 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) | |||
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, | 360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, |
| 361 | unsigned long arg) | 361 | struct cmbdata __user *argp) |
| 362 | { | 362 | { |
| 363 | struct cmbdata __user *argp = (void __user *) arg; | ||
| 364 | size_t size = _IOC_SIZE(cmd); | 363 | size_t size = _IOC_SIZE(cmd); |
| 365 | struct cmbdata data; | 364 | struct cmbdata data; |
| 366 | int ret; | 365 | int ret; |
| @@ -376,7 +375,12 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
| 376 | unsigned int cmd, unsigned long arg) | 375 | unsigned int cmd, unsigned long arg) |
| 377 | { | 376 | { |
| 378 | struct dasd_block *block = bdev->bd_disk->private_data; | 377 | struct dasd_block *block = bdev->bd_disk->private_data; |
| 379 | void __user *argp = (void __user *)arg; | 378 | void __user *argp; |
| 379 | |||
| 380 | if (is_compat_task()) | ||
| 381 | argp = compat_ptr(arg); | ||
| 382 | else | ||
| 383 | argp = (void __user *)arg; | ||
| 380 | 384 | ||
| 381 | if (!block) | 385 | if (!block) |
| 382 | return -ENODEV; | 386 | return -ENODEV; |
| @@ -414,7 +418,7 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
| 414 | case BIODASDCMFDISABLE: | 418 | case BIODASDCMFDISABLE: |
| 415 | return disable_cmf(block->base->cdev); | 419 | return disable_cmf(block->base->cdev); |
| 416 | case BIODASDREADALLCMB: | 420 | case BIODASDREADALLCMB: |
| 417 | return dasd_ioctl_readall_cmb(block, cmd, arg); | 421 | return dasd_ioctl_readall_cmb(block, cmd, argp); |
| 418 | default: | 422 | default: |
| 419 | /* if the discipline has an ioctl method try it. */ | 423 | /* if the discipline has an ioctl method try it. */ |
| 420 | if (block->base->discipline->ioctl) { | 424 | if (block->base->discipline->ioctl) { |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 9d61683b5633..59ec073724bf 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
| @@ -1037,22 +1037,6 @@ static void tty3215_flush_buffer(struct tty_struct *tty) | |||
| 1037 | } | 1037 | } |
| 1038 | 1038 | ||
| 1039 | /* | 1039 | /* |
| 1040 | * Currently we don't have any io controls for 3215 ttys | ||
| 1041 | */ | ||
| 1042 | static int tty3215_ioctl(struct tty_struct *tty, struct file * file, | ||
| 1043 | unsigned int cmd, unsigned long arg) | ||
| 1044 | { | ||
| 1045 | if (tty->flags & (1 << TTY_IO_ERROR)) | ||
| 1046 | return -EIO; | ||
| 1047 | |||
| 1048 | switch (cmd) { | ||
| 1049 | default: | ||
| 1050 | return -ENOIOCTLCMD; | ||
| 1051 | } | ||
| 1052 | return 0; | ||
| 1053 | } | ||
| 1054 | |||
| 1055 | /* | ||
| 1056 | * Disable reading from a 3215 tty | 1040 | * Disable reading from a 3215 tty |
| 1057 | */ | 1041 | */ |
| 1058 | static void tty3215_throttle(struct tty_struct * tty) | 1042 | static void tty3215_throttle(struct tty_struct * tty) |
| @@ -1117,7 +1101,6 @@ static const struct tty_operations tty3215_ops = { | |||
| 1117 | .write_room = tty3215_write_room, | 1101 | .write_room = tty3215_write_room, |
| 1118 | .chars_in_buffer = tty3215_chars_in_buffer, | 1102 | .chars_in_buffer = tty3215_chars_in_buffer, |
| 1119 | .flush_buffer = tty3215_flush_buffer, | 1103 | .flush_buffer = tty3215_flush_buffer, |
| 1120 | .ioctl = tty3215_ioctl, | ||
| 1121 | .throttle = tty3215_throttle, | 1104 | .throttle = tty3215_throttle, |
| 1122 | .unthrottle = tty3215_unthrottle, | 1105 | .unthrottle = tty3215_unthrottle, |
| 1123 | .stop = tty3215_stop, | 1106 | .stop = tty3215_stop, |
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 247b2b934728..31c59b0d6df0 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/smp_lock.h> | 16 | #include <linux/smp_lock.h> |
| 17 | 17 | ||
| 18 | #include <asm/compat.h> | ||
| 18 | #include <asm/ccwdev.h> | 19 | #include <asm/ccwdev.h> |
| 19 | #include <asm/cio.h> | 20 | #include <asm/cio.h> |
| 20 | #include <asm/ebcdic.h> | 21 | #include <asm/ebcdic.h> |
| @@ -322,6 +323,7 @@ fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *o | |||
| 322 | static long | 323 | static long |
| 323 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 324 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
| 324 | { | 325 | { |
| 326 | char __user *argp; | ||
| 325 | struct fs3270 *fp; | 327 | struct fs3270 *fp; |
| 326 | struct raw3270_iocb iocb; | 328 | struct raw3270_iocb iocb; |
| 327 | int rc; | 329 | int rc; |
| @@ -329,6 +331,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
| 329 | fp = filp->private_data; | 331 | fp = filp->private_data; |
| 330 | if (!fp) | 332 | if (!fp) |
| 331 | return -ENODEV; | 333 | return -ENODEV; |
| 334 | if (is_compat_task()) | ||
| 335 | argp = compat_ptr(arg); | ||
| 336 | else | ||
| 337 | argp = (char __user *)arg; | ||
| 332 | rc = 0; | 338 | rc = 0; |
| 333 | mutex_lock(&fs3270_mutex); | 339 | mutex_lock(&fs3270_mutex); |
| 334 | switch (cmd) { | 340 | switch (cmd) { |
| @@ -339,10 +345,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
| 339 | fp->write_command = arg; | 345 | fp->write_command = arg; |
| 340 | break; | 346 | break; |
| 341 | case TUBGETI: | 347 | case TUBGETI: |
| 342 | rc = put_user(fp->read_command, (char __user *) arg); | 348 | rc = put_user(fp->read_command, argp); |
| 343 | break; | 349 | break; |
| 344 | case TUBGETO: | 350 | case TUBGETO: |
| 345 | rc = put_user(fp->write_command,(char __user *) arg); | 351 | rc = put_user(fp->write_command, argp); |
| 346 | break; | 352 | break; |
| 347 | case TUBGETMOD: | 353 | case TUBGETMOD: |
| 348 | iocb.model = fp->view.model; | 354 | iocb.model = fp->view.model; |
| @@ -351,8 +357,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
| 351 | iocb.pf_cnt = 24; | 357 | iocb.pf_cnt = 24; |
| 352 | iocb.re_cnt = 20; | 358 | iocb.re_cnt = 20; |
| 353 | iocb.map = 0; | 359 | iocb.map = 0; |
| 354 | if (copy_to_user((char __user *) arg, &iocb, | 360 | if (copy_to_user(argp, &iocb, sizeof(struct raw3270_iocb))) |
| 355 | sizeof(struct raw3270_iocb))) | ||
| 356 | rc = -EFAULT; | 361 | rc = -EFAULT; |
| 357 | break; | 362 | break; |
| 358 | } | 363 | } |
| @@ -511,8 +516,8 @@ static const struct file_operations fs3270_fops = { | |||
| 511 | .write = fs3270_write, /* write */ | 516 | .write = fs3270_write, /* write */ |
| 512 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ | 517 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ |
| 513 | .compat_ioctl = fs3270_ioctl, /* ioctl */ | 518 | .compat_ioctl = fs3270_ioctl, /* ioctl */ |
| 514 | .open = fs3270_open, /* open */ | 519 | .open = fs3270_open, /* open */ |
| 515 | .release = fs3270_close, /* release */ | 520 | .release = fs3270_close, /* release */ |
| 516 | }; | 521 | }; |
| 517 | 522 | ||
| 518 | /* | 523 | /* |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 96816149368a..8d3d720737da 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
| @@ -46,8 +46,6 @@ | |||
| 46 | */ | 46 | */ |
| 47 | static int tapeblock_open(struct block_device *, fmode_t); | 47 | static int tapeblock_open(struct block_device *, fmode_t); |
| 48 | static int tapeblock_release(struct gendisk *, fmode_t); | 48 | static int tapeblock_release(struct gendisk *, fmode_t); |
| 49 | static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int, | ||
| 50 | unsigned long); | ||
| 51 | static int tapeblock_medium_changed(struct gendisk *); | 49 | static int tapeblock_medium_changed(struct gendisk *); |
| 52 | static int tapeblock_revalidate_disk(struct gendisk *); | 50 | static int tapeblock_revalidate_disk(struct gendisk *); |
| 53 | 51 | ||
| @@ -55,7 +53,6 @@ static const struct block_device_operations tapeblock_fops = { | |||
| 55 | .owner = THIS_MODULE, | 53 | .owner = THIS_MODULE, |
| 56 | .open = tapeblock_open, | 54 | .open = tapeblock_open, |
| 57 | .release = tapeblock_release, | 55 | .release = tapeblock_release, |
| 58 | .ioctl = tapeblock_ioctl, | ||
| 59 | .media_changed = tapeblock_medium_changed, | 56 | .media_changed = tapeblock_medium_changed, |
| 60 | .revalidate_disk = tapeblock_revalidate_disk, | 57 | .revalidate_disk = tapeblock_revalidate_disk, |
| 61 | }; | 58 | }; |
| @@ -416,42 +413,6 @@ tapeblock_release(struct gendisk *disk, fmode_t mode) | |||
| 416 | } | 413 | } |
| 417 | 414 | ||
| 418 | /* | 415 | /* |
| 419 | * Support of some generic block device IOCTLs. | ||
| 420 | */ | ||
| 421 | static int | ||
| 422 | tapeblock_ioctl( | ||
| 423 | struct block_device * bdev, | ||
| 424 | fmode_t mode, | ||
| 425 | unsigned int command, | ||
| 426 | unsigned long arg | ||
| 427 | ) { | ||
| 428 | int rc; | ||
| 429 | int minor; | ||
| 430 | struct gendisk *disk = bdev->bd_disk; | ||
| 431 | struct tape_device *device; | ||
| 432 | |||
| 433 | rc = 0; | ||
| 434 | BUG_ON(!disk); | ||
| 435 | device = disk->private_data; | ||
| 436 | BUG_ON(!device); | ||
| 437 | minor = MINOR(bdev->bd_dev); | ||
| 438 | |||
| 439 | DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); | ||
| 440 | DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); | ||
| 441 | |||
| 442 | switch (command) { | ||
| 443 | /* Refuse some IOCTL calls without complaining (mount). */ | ||
| 444 | case 0x5310: /* CDROMMULTISESSION */ | ||
| 445 | rc = -EINVAL; | ||
| 446 | break; | ||
| 447 | default: | ||
| 448 | rc = -EINVAL; | ||
| 449 | } | ||
| 450 | |||
| 451 | return rc; | ||
| 452 | } | ||
| 453 | |||
| 454 | /* | ||
| 455 | * Initialize block device frontend. | 416 | * Initialize block device frontend. |
| 456 | */ | 417 | */ |
| 457 | int | 418 | int |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 2125ec7d95f0..539045acaad4 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
| 19 | #include <linux/mtio.h> | 19 | #include <linux/mtio.h> |
| 20 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
| 21 | #include <linux/compat.h> | ||
| 21 | 22 | ||
| 22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
| 23 | 24 | ||
| @@ -37,8 +38,9 @@ static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t | |||
| 37 | static int tapechar_open(struct inode *,struct file *); | 38 | static int tapechar_open(struct inode *,struct file *); |
| 38 | static int tapechar_release(struct inode *,struct file *); | 39 | static int tapechar_release(struct inode *,struct file *); |
| 39 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); | 40 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); |
| 40 | static long tapechar_compat_ioctl(struct file *, unsigned int, | 41 | #ifdef CONFIG_COMPAT |
| 41 | unsigned long); | 42 | static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); |
| 43 | #endif | ||
| 42 | 44 | ||
| 43 | static const struct file_operations tape_fops = | 45 | static const struct file_operations tape_fops = |
| 44 | { | 46 | { |
| @@ -46,7 +48,9 @@ static const struct file_operations tape_fops = | |||
| 46 | .read = tapechar_read, | 48 | .read = tapechar_read, |
| 47 | .write = tapechar_write, | 49 | .write = tapechar_write, |
| 48 | .unlocked_ioctl = tapechar_ioctl, | 50 | .unlocked_ioctl = tapechar_ioctl, |
| 51 | #ifdef CONFIG_COMPAT | ||
| 49 | .compat_ioctl = tapechar_compat_ioctl, | 52 | .compat_ioctl = tapechar_compat_ioctl, |
| 53 | #endif | ||
| 50 | .open = tapechar_open, | 54 | .open = tapechar_open, |
| 51 | .release = tapechar_release, | 55 | .release = tapechar_release, |
| 52 | }; | 56 | }; |
| @@ -457,15 +461,22 @@ tapechar_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
| 457 | return rc; | 461 | return rc; |
| 458 | } | 462 | } |
| 459 | 463 | ||
| 464 | #ifdef CONFIG_COMPAT | ||
| 460 | static long | 465 | static long |
| 461 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | 466 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) |
| 462 | { | 467 | { |
| 463 | struct tape_device *device = filp->private_data; | 468 | struct tape_device *device = filp->private_data; |
| 464 | int rval = -ENOIOCTLCMD; | 469 | int rval = -ENOIOCTLCMD; |
| 470 | unsigned long argp; | ||
| 465 | 471 | ||
| 472 | /* The 'arg' argument of any ioctl function may only be used for | ||
| 473 | * pointers because of the compat pointer conversion. | ||
| 474 | * Consider this when adding new ioctls. | ||
| 475 | */ | ||
| 476 | argp = (unsigned long) compat_ptr(data); | ||
| 466 | if (device->discipline->ioctl_fn) { | 477 | if (device->discipline->ioctl_fn) { |
| 467 | mutex_lock(&device->mutex); | 478 | mutex_lock(&device->mutex); |
| 468 | rval = device->discipline->ioctl_fn(device, no, data); | 479 | rval = device->discipline->ioctl_fn(device, no, argp); |
| 469 | mutex_unlock(&device->mutex); | 480 | mutex_unlock(&device->mutex); |
| 470 | if (rval == -EINVAL) | 481 | if (rval == -EINVAL) |
| 471 | rval = -ENOIOCTLCMD; | 482 | rval = -ENOIOCTLCMD; |
| @@ -473,6 +484,7 @@ tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
| 473 | 484 | ||
| 474 | return rval; | 485 | return rval; |
| 475 | } | 486 | } |
| 487 | #endif /* CONFIG_COMPAT */ | ||
| 476 | 488 | ||
| 477 | /* | 489 | /* |
| 478 | * Initialize character device frontend. | 490 | * Initialize character device frontend. |
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index a6087cec55b4..921dcda77676 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
| 21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 22 | #include <asm/compat.h> | ||
| 22 | #include <asm/cpcmd.h> | 23 | #include <asm/cpcmd.h> |
| 23 | #include <asm/debug.h> | 24 | #include <asm/debug.h> |
| 24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
| @@ -139,21 +140,26 @@ vmcp_write(struct file *file, const char __user *buff, size_t count, | |||
| 139 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 140 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
| 140 | { | 141 | { |
| 141 | struct vmcp_session *session; | 142 | struct vmcp_session *session; |
| 143 | int __user *argp; | ||
| 142 | int temp; | 144 | int temp; |
| 143 | 145 | ||
| 144 | session = (struct vmcp_session *)file->private_data; | 146 | session = (struct vmcp_session *)file->private_data; |
| 147 | if (is_compat_task()) | ||
| 148 | argp = compat_ptr(arg); | ||
| 149 | else | ||
| 150 | argp = (int __user *)arg; | ||
| 145 | if (mutex_lock_interruptible(&session->mutex)) | 151 | if (mutex_lock_interruptible(&session->mutex)) |
| 146 | return -ERESTARTSYS; | 152 | return -ERESTARTSYS; |
| 147 | switch (cmd) { | 153 | switch (cmd) { |
| 148 | case VMCP_GETCODE: | 154 | case VMCP_GETCODE: |
| 149 | temp = session->resp_code; | 155 | temp = session->resp_code; |
| 150 | mutex_unlock(&session->mutex); | 156 | mutex_unlock(&session->mutex); |
| 151 | return put_user(temp, (int __user *)arg); | 157 | return put_user(temp, argp); |
| 152 | case VMCP_SETBUF: | 158 | case VMCP_SETBUF: |
| 153 | free_pages((unsigned long)session->response, | 159 | free_pages((unsigned long)session->response, |
| 154 | get_order(session->bufsize)); | 160 | get_order(session->bufsize)); |
| 155 | session->response=NULL; | 161 | session->response=NULL; |
| 156 | temp = get_user(session->bufsize, (int __user *)arg); | 162 | temp = get_user(session->bufsize, argp); |
| 157 | if (get_order(session->bufsize) > 8) { | 163 | if (get_order(session->bufsize) > 8) { |
| 158 | session->bufsize = PAGE_SIZE; | 164 | session->bufsize = PAGE_SIZE; |
| 159 | temp = -EINVAL; | 165 | temp = -EINVAL; |
| @@ -163,7 +169,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 163 | case VMCP_GETSIZE: | 169 | case VMCP_GETSIZE: |
| 164 | temp = session->resp_size; | 170 | temp = session->resp_size; |
| 165 | mutex_unlock(&session->mutex); | 171 | mutex_unlock(&session->mutex); |
| 166 | return put_user(temp, (int __user *)arg); | 172 | return put_user(temp, argp); |
| 167 | default: | 173 | default: |
| 168 | mutex_unlock(&session->mutex); | 174 | mutex_unlock(&session->mutex); |
| 169 | return -ENOIOCTLCMD; | 175 | return -ENOIOCTLCMD; |
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index cc5144b6f9d9..c84ac9443079 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
| 13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
| 14 | 14 | ||
| 15 | #include <asm/compat.h> | ||
| 15 | #include <asm/cio.h> | 16 | #include <asm/cio.h> |
| 16 | #include <asm/chsc.h> | 17 | #include <asm/chsc.h> |
| 17 | #include <asm/isc.h> | 18 | #include <asm/isc.h> |
| @@ -770,24 +771,30 @@ out_free: | |||
| 770 | static long chsc_ioctl(struct file *filp, unsigned int cmd, | 771 | static long chsc_ioctl(struct file *filp, unsigned int cmd, |
| 771 | unsigned long arg) | 772 | unsigned long arg) |
| 772 | { | 773 | { |
| 774 | void __user *argp; | ||
| 775 | |||
| 773 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); | 776 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); |
| 777 | if (is_compat_task()) | ||
| 778 | argp = compat_ptr(arg); | ||
| 779 | else | ||
| 780 | argp = (void __user *)arg; | ||
| 774 | switch (cmd) { | 781 | switch (cmd) { |
| 775 | case CHSC_START: | 782 | case CHSC_START: |
| 776 | return chsc_ioctl_start((void __user *)arg); | 783 | return chsc_ioctl_start(argp); |
| 777 | case CHSC_INFO_CHANNEL_PATH: | 784 | case CHSC_INFO_CHANNEL_PATH: |
| 778 | return chsc_ioctl_info_channel_path((void __user *)arg); | 785 | return chsc_ioctl_info_channel_path(argp); |
| 779 | case CHSC_INFO_CU: | 786 | case CHSC_INFO_CU: |
| 780 | return chsc_ioctl_info_cu((void __user *)arg); | 787 | return chsc_ioctl_info_cu(argp); |
| 781 | case CHSC_INFO_SCH_CU: | 788 | case CHSC_INFO_SCH_CU: |
| 782 | return chsc_ioctl_info_sch_cu((void __user *)arg); | 789 | return chsc_ioctl_info_sch_cu(argp); |
| 783 | case CHSC_INFO_CI: | 790 | case CHSC_INFO_CI: |
| 784 | return chsc_ioctl_conf_info((void __user *)arg); | 791 | return chsc_ioctl_conf_info(argp); |
| 785 | case CHSC_INFO_CCL: | 792 | case CHSC_INFO_CCL: |
| 786 | return chsc_ioctl_conf_comp_list((void __user *)arg); | 793 | return chsc_ioctl_conf_comp_list(argp); |
| 787 | case CHSC_INFO_CPD: | 794 | case CHSC_INFO_CPD: |
| 788 | return chsc_ioctl_chpd((void __user *)arg); | 795 | return chsc_ioctl_chpd(argp); |
| 789 | case CHSC_INFO_DCAL: | 796 | case CHSC_INFO_DCAL: |
| 790 | return chsc_ioctl_dcal((void __user *)arg); | 797 | return chsc_ioctl_dcal(argp); |
| 791 | default: /* unknown ioctl number */ | 798 | default: /* unknown ioctl number */ |
| 792 | return -ENOIOCTLCMD; | 799 | return -ENOIOCTLCMD; |
| 793 | } | 800 | } |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 0d4d18bdd45c..c68be24e27d9 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
| @@ -393,10 +393,12 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt) | |||
| 393 | * u_mult_inv > 128 bytes. | 393 | * u_mult_inv > 128 bytes. |
| 394 | */ | 394 | */ |
| 395 | if (copied == 0) { | 395 | if (copied == 0) { |
| 396 | int len; | 396 | unsigned int len; |
| 397 | spin_unlock_bh(&zcrypt_device_lock); | 397 | spin_unlock_bh(&zcrypt_device_lock); |
| 398 | /* len is max 256 / 2 - 120 = 8 */ | 398 | /* len is max 256 / 2 - 120 = 8 */ |
| 399 | len = crt->inputdatalength / 2 - 120; | 399 | len = crt->inputdatalength / 2 - 120; |
| 400 | if (len > sizeof(z1)) | ||
| 401 | return -EFAULT; | ||
| 400 | z1 = z2 = z3 = 0; | 402 | z1 = z2 = z3 = 0; |
| 401 | if (copy_from_user(&z1, crt->np_prime, len) || | 403 | if (copy_from_user(&z1, crt->np_prime, len) || |
| 402 | copy_from_user(&z2, crt->bp_key, len) || | 404 | copy_from_user(&z2, crt->bp_key, len) || |
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index 36ede02ceacf..b5496a19d967 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
| @@ -354,6 +354,8 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
| 354 | { "FUJ02E5", 0 }, | 354 | { "FUJ02E5", 0 }, |
| 355 | /* Fujitsu P-series tablet PC device */ | 355 | /* Fujitsu P-series tablet PC device */ |
| 356 | { "FUJ02E6", 0 }, | 356 | { "FUJ02E6", 0 }, |
| 357 | /* Fujitsu Wacom 2FGT Tablet PC device */ | ||
| 358 | { "FUJ02E7", 0 }, | ||
| 357 | /* | 359 | /* |
| 358 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in | 360 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in |
| 359 | * disguise) | 361 | * disguise) |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 37f0de9dd9ce..42f3333c4ad0 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -1052,7 +1052,18 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
| 1052 | sci_port->port.ops = &sci_uart_ops; | 1052 | sci_port->port.ops = &sci_uart_ops; |
| 1053 | sci_port->port.iotype = UPIO_MEM; | 1053 | sci_port->port.iotype = UPIO_MEM; |
| 1054 | sci_port->port.line = index; | 1054 | sci_port->port.line = index; |
| 1055 | sci_port->port.fifosize = 1; | 1055 | |
| 1056 | switch (p->type) { | ||
| 1057 | case PORT_SCIFA: | ||
| 1058 | sci_port->port.fifosize = 64; | ||
| 1059 | break; | ||
| 1060 | case PORT_SCIF: | ||
| 1061 | sci_port->port.fifosize = 16; | ||
| 1062 | break; | ||
| 1063 | default: | ||
| 1064 | sci_port->port.fifosize = 1; | ||
| 1065 | break; | ||
| 1066 | } | ||
| 1056 | 1067 | ||
| 1057 | if (dev) { | 1068 | if (dev) { |
| 1058 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; | 1069 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; |
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index adf9632c6b1f..53cb722c45a0 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
| @@ -211,21 +211,23 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, | |||
| 211 | 211 | ||
| 212 | /** | 212 | /** |
| 213 | * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. | 213 | * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. |
| 214 | * @id: window id. | ||
| 215 | * @sfb: The hardware state. | 214 | * @sfb: The hardware state. |
| 216 | * @pixclock: The pixel clock wanted, in picoseconds. | 215 | * @pixclock: The pixel clock wanted, in picoseconds. |
| 217 | * | 216 | * |
| 218 | * Given the specified pixel clock, work out the necessary divider to get | 217 | * Given the specified pixel clock, work out the necessary divider to get |
| 219 | * close to the output frequency. | 218 | * close to the output frequency. |
| 220 | */ | 219 | */ |
| 221 | static int s3c_fb_calc_pixclk(unsigned char id, struct s3c_fb *sfb, unsigned int pixclk) | 220 | static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) |
| 222 | { | 221 | { |
| 223 | struct s3c_fb_pd_win *win = sfb->pdata->win[id]; | ||
| 224 | unsigned long clk = clk_get_rate(sfb->bus_clk); | 222 | unsigned long clk = clk_get_rate(sfb->bus_clk); |
| 223 | unsigned long long tmp; | ||
| 225 | unsigned int result; | 224 | unsigned int result; |
| 226 | 225 | ||
| 227 | pixclk *= win->win_mode.refresh; | 226 | tmp = (unsigned long long)clk; |
| 228 | result = clk / pixclk; | 227 | tmp *= pixclk; |
| 228 | |||
| 229 | do_div(tmp, 1000000000UL); | ||
| 230 | result = (unsigned int)tmp / 1000; | ||
| 229 | 231 | ||
| 230 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", | 232 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", |
| 231 | pixclk, clk, result, clk / result); | 233 | pixclk, clk, result, clk / result); |
| @@ -301,7 +303,7 @@ static int s3c_fb_set_par(struct fb_info *info) | |||
| 301 | /* use window 0 as the basis for the lcd output timings */ | 303 | /* use window 0 as the basis for the lcd output timings */ |
| 302 | 304 | ||
| 303 | if (win_no == 0) { | 305 | if (win_no == 0) { |
| 304 | clkdiv = s3c_fb_calc_pixclk(win_no, sfb, var->pixclock); | 306 | clkdiv = s3c_fb_calc_pixclk(sfb, var->pixclock); |
| 305 | 307 | ||
| 306 | data = sfb->pdata->vidcon0; | 308 | data = sfb->pdata->vidcon0; |
| 307 | data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); | 309 | data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); |
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 9d4f3a49ba4a..d5077dfa9e00 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c | |||
| @@ -137,7 +137,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height, | |||
| 137 | tmp, dst_pitch); | 137 | tmp, dst_pitch); |
| 138 | return -EINVAL; | 138 | return -EINVAL; |
| 139 | } | 139 | } |
| 140 | tmp = (tmp >> 3) | (dst_pitch << (16 - 3)); | 140 | tmp = VIA_PITCH_ENABLE | (tmp >> 3) | (dst_pitch << (16 - 3)); |
| 141 | writel(tmp, engine + 0x38); | 141 | writel(tmp, engine + 0x38); |
| 142 | 142 | ||
| 143 | if (op == VIA_BITBLT_FILL) | 143 | if (op == VIA_BITBLT_FILL) |
| @@ -352,6 +352,9 @@ int viafb_init_engine(struct fb_info *info) | |||
| 352 | viapar->shared->vq_vram_addr = viapar->fbmem_free; | 352 | viapar->shared->vq_vram_addr = viapar->fbmem_free; |
| 353 | viapar->fbmem_used += VQ_SIZE; | 353 | viapar->fbmem_used += VQ_SIZE; |
| 354 | 354 | ||
| 355 | /* Init 2D engine reg to reset 2D engine */ | ||
| 356 | writel(0x0, engine + VIA_REG_KEYCONTROL); | ||
| 357 | |||
| 355 | /* Init AGP and VQ regs */ | 358 | /* Init AGP and VQ regs */ |
| 356 | switch (chip_name) { | 359 | switch (chip_name) { |
| 357 | case UNICHROME_K8M890: | 360 | case UNICHROME_K8M890: |
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index d8df17a7d5fc..3028e7ddc3b5 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
| @@ -177,16 +177,15 @@ static int viafb_set_par(struct fb_info *info) | |||
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | if (vmode_index != VIA_RES_INVALID) { | 179 | if (vmode_index != VIA_RES_INVALID) { |
| 180 | viafb_setmode(vmode_index, info->var.xres, info->var.yres, | ||
| 181 | info->var.bits_per_pixel, vmode_index1, | ||
| 182 | viafb_second_xres, viafb_second_yres, viafb_bpp1); | ||
| 183 | |||
| 184 | viafb_update_fix(info); | 180 | viafb_update_fix(info); |
| 185 | viafb_bpp = info->var.bits_per_pixel; | 181 | viafb_bpp = info->var.bits_per_pixel; |
| 186 | if (info->var.accel_flags & FB_ACCELF_TEXT) | 182 | if (info->var.accel_flags & FB_ACCELF_TEXT) |
| 187 | info->flags &= ~FBINFO_HWACCEL_DISABLED; | 183 | info->flags &= ~FBINFO_HWACCEL_DISABLED; |
| 188 | else | 184 | else |
| 189 | info->flags |= FBINFO_HWACCEL_DISABLED; | 185 | info->flags |= FBINFO_HWACCEL_DISABLED; |
| 186 | viafb_setmode(vmode_index, info->var.xres, info->var.yres, | ||
| 187 | info->var.bits_per_pixel, vmode_index1, | ||
| 188 | viafb_second_xres, viafb_second_yres, viafb_bpp1); | ||
| 190 | } | 189 | } |
| 191 | 190 | ||
| 192 | return 0; | 191 | return 0; |
| @@ -872,7 +871,9 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
| 872 | if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) | 871 | if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) |
| 873 | return -ENODEV; | 872 | return -ENODEV; |
| 874 | 873 | ||
| 875 | if (chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) | 874 | /* LCD ouput does not support hw cursors (at least on VN896) */ |
| 875 | if ((chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) || | ||
| 876 | viafb_LCD_ON) | ||
| 876 | return -ENODEV; | 877 | return -ENODEV; |
| 877 | 878 | ||
| 878 | viafb_show_hw_cursor(info, HW_Cursor_OFF); | 879 | viafb_show_hw_cursor(info, HW_Cursor_OFF); |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 9dd588042880..505be88c82ae 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
| @@ -266,7 +266,7 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev) | |||
| 266 | 266 | ||
| 267 | static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; | 267 | static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; |
| 268 | 268 | ||
| 269 | static struct virtio_driver virtio_balloon = { | 269 | static struct virtio_driver virtio_balloon_driver = { |
| 270 | .feature_table = features, | 270 | .feature_table = features, |
| 271 | .feature_table_size = ARRAY_SIZE(features), | 271 | .feature_table_size = ARRAY_SIZE(features), |
| 272 | .driver.name = KBUILD_MODNAME, | 272 | .driver.name = KBUILD_MODNAME, |
| @@ -279,12 +279,12 @@ static struct virtio_driver virtio_balloon = { | |||
| 279 | 279 | ||
| 280 | static int __init init(void) | 280 | static int __init init(void) |
| 281 | { | 281 | { |
| 282 | return register_virtio_driver(&virtio_balloon); | 282 | return register_virtio_driver(&virtio_balloon_driver); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static void __exit fini(void) | 285 | static void __exit fini(void) |
| 286 | { | 286 | { |
| 287 | unregister_virtio_driver(&virtio_balloon); | 287 | unregister_virtio_driver(&virtio_balloon_driver); |
| 288 | } | 288 | } |
| 289 | module_init(init); | 289 | module_init(init); |
| 290 | module_exit(fini); | 290 | module_exit(fini); |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index c4997930afc7..5d42d55e299b 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
| @@ -102,15 +102,15 @@ static void do_suspend(void) | |||
| 102 | goto out_thaw; | 102 | goto out_thaw; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
| 106 | xs_suspend(); | ||
| 107 | |||
| 105 | err = dpm_suspend_noirq(PMSG_SUSPEND); | 108 | err = dpm_suspend_noirq(PMSG_SUSPEND); |
| 106 | if (err) { | 109 | if (err) { |
| 107 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); | 110 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); |
| 108 | goto out_resume; | 111 | goto out_resume; |
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
| 112 | xs_suspend(); | ||
| 113 | |||
| 114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); | 114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); |
| 115 | 115 | ||
| 116 | dpm_resume_noirq(PMSG_RESUME); | 116 | dpm_resume_noirq(PMSG_RESUME); |
| @@ -120,13 +120,13 @@ static void do_suspend(void) | |||
| 120 | cancelled = 1; | 120 | cancelled = 1; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | out_resume: | ||
| 123 | if (!cancelled) { | 124 | if (!cancelled) { |
| 124 | xen_arch_resume(); | 125 | xen_arch_resume(); |
| 125 | xs_resume(); | 126 | xs_resume(); |
| 126 | } else | 127 | } else |
| 127 | xs_suspend_cancel(); | 128 | xs_suspend_cancel(); |
| 128 | 129 | ||
| 129 | out_resume: | ||
| 130 | dpm_resume_end(PMSG_RESUME); | 130 | dpm_resume_end(PMSG_RESUME); |
| 131 | 131 | ||
| 132 | /* Make sure timer events get retriggered on all CPUs */ | 132 | /* Make sure timer events get retriggered on all CPUs */ |
