diff options
author | Dave Airlie <airlied@redhat.com> | 2011-03-15 21:34:41 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-03-15 21:34:41 -0400 |
commit | 38f1cff0863809587b5fd10ecd0c24c8b543a48c (patch) | |
tree | 7cf6eb88cdc938c3683209d38311e711a1119400 /drivers | |
parent | 4819d2e4310796c4e9eef674499af9b9caf36b5a (diff) | |
parent | 5359533801e3dd3abca5b7d3d985b0b33fd9fe8b (diff) |
Merge commit '5359533801e3dd3abca5b7d3d985b0b33fd9fe8b' into drm-core-next
This commit changed an internal radeon structure, that meant a new driver
in -next had to be fixed up, merge in the commit and fix up the driver.
Also fixes a trivial nouveau merge.
Conflicts:
drivers/gpu/drm/nouveau/nouveau_mem.c
Diffstat (limited to 'drivers')
107 files changed, 931 insertions, 362 deletions
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 54784bb42cec..edc25867ad9d 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -416,10 +416,15 @@ struct acpi_gpe_handler_info { | |||
416 | u8 originally_enabled; /* True if GPE was originally enabled */ | 416 | u8 originally_enabled; /* True if GPE was originally enabled */ |
417 | }; | 417 | }; |
418 | 418 | ||
419 | struct acpi_gpe_notify_object { | ||
420 | struct acpi_namespace_node *node; | ||
421 | struct acpi_gpe_notify_object *next; | ||
422 | }; | ||
423 | |||
419 | union acpi_gpe_dispatch_info { | 424 | union acpi_gpe_dispatch_info { |
420 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ | 425 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ |
421 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ | 426 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ |
422 | struct acpi_namespace_node *device_node; /* Parent _PRW device for implicit notify */ | 427 | struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */ |
423 | }; | 428 | }; |
424 | 429 | ||
425 | /* | 430 | /* |
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index 14988a86066f..f4725212eb48 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
@@ -457,6 +457,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
457 | acpi_status status; | 457 | acpi_status status; |
458 | struct acpi_gpe_event_info *local_gpe_event_info; | 458 | struct acpi_gpe_event_info *local_gpe_event_info; |
459 | struct acpi_evaluate_info *info; | 459 | struct acpi_evaluate_info *info; |
460 | struct acpi_gpe_notify_object *notify_object; | ||
460 | 461 | ||
461 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); | 462 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); |
462 | 463 | ||
@@ -508,10 +509,18 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
508 | * from this thread -- because handlers may in turn run other | 509 | * from this thread -- because handlers may in turn run other |
509 | * control methods. | 510 | * control methods. |
510 | */ | 511 | */ |
511 | status = | 512 | status = acpi_ev_queue_notify_request( |
512 | acpi_ev_queue_notify_request(local_gpe_event_info->dispatch. | 513 | local_gpe_event_info->dispatch.device.node, |
513 | device_node, | 514 | ACPI_NOTIFY_DEVICE_WAKE); |
514 | ACPI_NOTIFY_DEVICE_WAKE); | 515 | |
516 | notify_object = local_gpe_event_info->dispatch.device.next; | ||
517 | while (ACPI_SUCCESS(status) && notify_object) { | ||
518 | status = acpi_ev_queue_notify_request( | ||
519 | notify_object->node, | ||
520 | ACPI_NOTIFY_DEVICE_WAKE); | ||
521 | notify_object = notify_object->next; | ||
522 | } | ||
523 | |||
515 | break; | 524 | break; |
516 | 525 | ||
517 | case ACPI_GPE_DISPATCH_METHOD: | 526 | case ACPI_GPE_DISPATCH_METHOD: |
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index 3b20a3401b64..52aaff3df562 100644 --- a/drivers/acpi/acpica/evxfgpe.c +++ b/drivers/acpi/acpica/evxfgpe.c | |||
@@ -198,7 +198,9 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device, | |||
198 | acpi_status status = AE_BAD_PARAMETER; | 198 | acpi_status status = AE_BAD_PARAMETER; |
199 | struct acpi_gpe_event_info *gpe_event_info; | 199 | struct acpi_gpe_event_info *gpe_event_info; |
200 | struct acpi_namespace_node *device_node; | 200 | struct acpi_namespace_node *device_node; |
201 | struct acpi_gpe_notify_object *notify_object; | ||
201 | acpi_cpu_flags flags; | 202 | acpi_cpu_flags flags; |
203 | u8 gpe_dispatch_mask; | ||
202 | 204 | ||
203 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); | 205 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); |
204 | 206 | ||
@@ -221,27 +223,49 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device, | |||
221 | goto unlock_and_exit; | 223 | goto unlock_and_exit; |
222 | } | 224 | } |
223 | 225 | ||
226 | if (wake_device == ACPI_ROOT_OBJECT) { | ||
227 | goto out; | ||
228 | } | ||
229 | |||
224 | /* | 230 | /* |
225 | * If there is no method or handler for this GPE, then the | 231 | * If there is no method or handler for this GPE, then the |
226 | * wake_device will be notified whenever this GPE fires (aka | 232 | * wake_device will be notified whenever this GPE fires (aka |
227 | * "implicit notify") Note: The GPE is assumed to be | 233 | * "implicit notify") Note: The GPE is assumed to be |
228 | * level-triggered (for windows compatibility). | 234 | * level-triggered (for windows compatibility). |
229 | */ | 235 | */ |
230 | if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == | 236 | gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK; |
231 | ACPI_GPE_DISPATCH_NONE) && (wake_device != ACPI_ROOT_OBJECT)) { | 237 | if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE |
238 | && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) { | ||
239 | goto out; | ||
240 | } | ||
232 | 241 | ||
233 | /* Validate wake_device is of type Device */ | 242 | /* Validate wake_device is of type Device */ |
234 | 243 | ||
235 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, | 244 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); |
236 | wake_device); | 245 | if (device_node->type != ACPI_TYPE_DEVICE) { |
237 | if (device_node->type != ACPI_TYPE_DEVICE) { | 246 | goto unlock_and_exit; |
238 | goto unlock_and_exit; | 247 | } |
239 | } | 248 | |
249 | if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) { | ||
240 | gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | | 250 | gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | |
241 | ACPI_GPE_LEVEL_TRIGGERED); | 251 | ACPI_GPE_LEVEL_TRIGGERED); |
242 | gpe_event_info->dispatch.device_node = device_node; | 252 | gpe_event_info->dispatch.device.node = device_node; |
253 | gpe_event_info->dispatch.device.next = NULL; | ||
254 | } else { | ||
255 | /* There are multiple devices to notify implicitly. */ | ||
256 | |||
257 | notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object)); | ||
258 | if (!notify_object) { | ||
259 | status = AE_NO_MEMORY; | ||
260 | goto unlock_and_exit; | ||
261 | } | ||
262 | |||
263 | notify_object->node = device_node; | ||
264 | notify_object->next = gpe_event_info->dispatch.device.next; | ||
265 | gpe_event_info->dispatch.device.next = notify_object; | ||
243 | } | 266 | } |
244 | 267 | ||
268 | out: | ||
245 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; | 269 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; |
246 | status = AE_OK; | 270 | status = AE_OK; |
247 | 271 | ||
diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c index 5df67f1d6c61..384f7abcff77 100644 --- a/drivers/acpi/debugfs.c +++ b/drivers/acpi/debugfs.c | |||
@@ -26,7 +26,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, | |||
26 | size_t count, loff_t *ppos) | 26 | size_t count, loff_t *ppos) |
27 | { | 27 | { |
28 | static char *buf; | 28 | static char *buf; |
29 | static int uncopied_bytes; | 29 | static u32 max_size; |
30 | static u32 uncopied_bytes; | ||
31 | |||
30 | struct acpi_table_header table; | 32 | struct acpi_table_header table; |
31 | acpi_status status; | 33 | acpi_status status; |
32 | 34 | ||
@@ -37,19 +39,24 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, | |||
37 | if (copy_from_user(&table, user_buf, | 39 | if (copy_from_user(&table, user_buf, |
38 | sizeof(struct acpi_table_header))) | 40 | sizeof(struct acpi_table_header))) |
39 | return -EFAULT; | 41 | return -EFAULT; |
40 | uncopied_bytes = table.length; | 42 | uncopied_bytes = max_size = table.length; |
41 | buf = kzalloc(uncopied_bytes, GFP_KERNEL); | 43 | buf = kzalloc(max_size, GFP_KERNEL); |
42 | if (!buf) | 44 | if (!buf) |
43 | return -ENOMEM; | 45 | return -ENOMEM; |
44 | } | 46 | } |
45 | 47 | ||
46 | if (uncopied_bytes < count) { | 48 | if (buf == NULL) |
47 | kfree(buf); | 49 | return -EINVAL; |
50 | |||
51 | if ((*ppos > max_size) || | ||
52 | (*ppos + count > max_size) || | ||
53 | (*ppos + count < count) || | ||
54 | (count > uncopied_bytes)) | ||
48 | return -EINVAL; | 55 | return -EINVAL; |
49 | } | ||
50 | 56 | ||
51 | if (copy_from_user(buf + (*ppos), user_buf, count)) { | 57 | if (copy_from_user(buf + (*ppos), user_buf, count)) { |
52 | kfree(buf); | 58 | kfree(buf); |
59 | buf = NULL; | ||
53 | return -EFAULT; | 60 | return -EFAULT; |
54 | } | 61 | } |
55 | 62 | ||
@@ -59,6 +66,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, | |||
59 | if (!uncopied_bytes) { | 66 | if (!uncopied_bytes) { |
60 | status = acpi_install_method(buf); | 67 | status = acpi_install_method(buf); |
61 | kfree(buf); | 68 | kfree(buf); |
69 | buf = NULL; | ||
62 | if (ACPI_FAILURE(status)) | 70 | if (ACPI_FAILURE(status)) |
63 | return -EINVAL; | 71 | return -EINVAL; |
64 | add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); | 72 | add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 49e6a545eb63..dbf31ec9114d 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -78,7 +78,6 @@ | |||
78 | 78 | ||
79 | #include <asm/uaccess.h> | 79 | #include <asm/uaccess.h> |
80 | 80 | ||
81 | static DEFINE_MUTEX(loop_mutex); | ||
82 | static LIST_HEAD(loop_devices); | 81 | static LIST_HEAD(loop_devices); |
83 | static DEFINE_MUTEX(loop_devices_mutex); | 82 | static DEFINE_MUTEX(loop_devices_mutex); |
84 | 83 | ||
@@ -1501,11 +1500,9 @@ static int lo_open(struct block_device *bdev, fmode_t mode) | |||
1501 | { | 1500 | { |
1502 | struct loop_device *lo = bdev->bd_disk->private_data; | 1501 | struct loop_device *lo = bdev->bd_disk->private_data; |
1503 | 1502 | ||
1504 | mutex_lock(&loop_mutex); | ||
1505 | mutex_lock(&lo->lo_ctl_mutex); | 1503 | mutex_lock(&lo->lo_ctl_mutex); |
1506 | lo->lo_refcnt++; | 1504 | lo->lo_refcnt++; |
1507 | mutex_unlock(&lo->lo_ctl_mutex); | 1505 | mutex_unlock(&lo->lo_ctl_mutex); |
1508 | mutex_unlock(&loop_mutex); | ||
1509 | 1506 | ||
1510 | return 0; | 1507 | return 0; |
1511 | } | 1508 | } |
@@ -1515,7 +1512,6 @@ static int lo_release(struct gendisk *disk, fmode_t mode) | |||
1515 | struct loop_device *lo = disk->private_data; | 1512 | struct loop_device *lo = disk->private_data; |
1516 | int err; | 1513 | int err; |
1517 | 1514 | ||
1518 | mutex_lock(&loop_mutex); | ||
1519 | mutex_lock(&lo->lo_ctl_mutex); | 1515 | mutex_lock(&lo->lo_ctl_mutex); |
1520 | 1516 | ||
1521 | if (--lo->lo_refcnt) | 1517 | if (--lo->lo_refcnt) |
@@ -1540,7 +1536,6 @@ static int lo_release(struct gendisk *disk, fmode_t mode) | |||
1540 | out: | 1536 | out: |
1541 | mutex_unlock(&lo->lo_ctl_mutex); | 1537 | mutex_unlock(&lo->lo_ctl_mutex); |
1542 | out_unlocked: | 1538 | out_unlocked: |
1543 | mutex_unlock(&loop_mutex); | ||
1544 | return 0; | 1539 | return 0; |
1545 | } | 1540 | } |
1546 | 1541 | ||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 7855f9f45b8e..62787e30d508 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -900,6 +900,14 @@ static void sender(void *send_info, | |||
900 | printk("**Enqueue: %d.%9.9d\n", t.tv_sec, t.tv_usec); | 900 | printk("**Enqueue: %d.%9.9d\n", t.tv_sec, t.tv_usec); |
901 | #endif | 901 | #endif |
902 | 902 | ||
903 | /* | ||
904 | * last_timeout_jiffies is updated here to avoid | ||
905 | * smi_timeout() handler passing very large time_diff | ||
906 | * value to smi_event_handler() that causes | ||
907 | * the send command to abort. | ||
908 | */ | ||
909 | smi_info->last_timeout_jiffies = jiffies; | ||
910 | |||
903 | mod_timer(&smi_info->si_timer, jiffies + SI_TIMEOUT_JIFFIES); | 911 | mod_timer(&smi_info->si_timer, jiffies + SI_TIMEOUT_JIFFIES); |
904 | 912 | ||
905 | if (smi_info->thread) | 913 | if (smi_info->thread) |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 490393186338..84b164d1eb2b 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -388,6 +388,10 @@ static void discard_port_data(struct port *port) | |||
388 | unsigned int len; | 388 | unsigned int len; |
389 | int ret; | 389 | int ret; |
390 | 390 | ||
391 | if (!port->portdev) { | ||
392 | /* Device has been unplugged. vqs are already gone. */ | ||
393 | return; | ||
394 | } | ||
391 | vq = port->in_vq; | 395 | vq = port->in_vq; |
392 | if (port->inbuf) | 396 | if (port->inbuf) |
393 | buf = port->inbuf; | 397 | buf = port->inbuf; |
@@ -470,6 +474,10 @@ static void reclaim_consumed_buffers(struct port *port) | |||
470 | void *buf; | 474 | void *buf; |
471 | unsigned int len; | 475 | unsigned int len; |
472 | 476 | ||
477 | if (!port->portdev) { | ||
478 | /* Device has been unplugged. vqs are already gone. */ | ||
479 | return; | ||
480 | } | ||
473 | while ((buf = virtqueue_get_buf(port->out_vq, &len))) { | 481 | while ((buf = virtqueue_get_buf(port->out_vq, &len))) { |
474 | kfree(buf); | 482 | kfree(buf); |
475 | port->outvq_full = false; | 483 | port->outvq_full = false; |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1109f6848a43..5cb4d09919d6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1919,8 +1919,10 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
1919 | 1919 | ||
1920 | ret = sysdev_driver_register(&cpu_sysdev_class, | 1920 | ret = sysdev_driver_register(&cpu_sysdev_class, |
1921 | &cpufreq_sysdev_driver); | 1921 | &cpufreq_sysdev_driver); |
1922 | if (ret) | ||
1923 | goto err_null_driver; | ||
1922 | 1924 | ||
1923 | if ((!ret) && !(cpufreq_driver->flags & CPUFREQ_STICKY)) { | 1925 | if (!(cpufreq_driver->flags & CPUFREQ_STICKY)) { |
1924 | int i; | 1926 | int i; |
1925 | ret = -ENODEV; | 1927 | ret = -ENODEV; |
1926 | 1928 | ||
@@ -1935,21 +1937,22 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
1935 | if (ret) { | 1937 | if (ret) { |
1936 | dprintk("no CPU initialized for driver %s\n", | 1938 | dprintk("no CPU initialized for driver %s\n", |
1937 | driver_data->name); | 1939 | driver_data->name); |
1938 | sysdev_driver_unregister(&cpu_sysdev_class, | 1940 | goto err_sysdev_unreg; |
1939 | &cpufreq_sysdev_driver); | ||
1940 | |||
1941 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | ||
1942 | cpufreq_driver = NULL; | ||
1943 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | ||
1944 | } | 1941 | } |
1945 | } | 1942 | } |
1946 | 1943 | ||
1947 | if (!ret) { | 1944 | register_hotcpu_notifier(&cpufreq_cpu_notifier); |
1948 | register_hotcpu_notifier(&cpufreq_cpu_notifier); | 1945 | dprintk("driver %s up and running\n", driver_data->name); |
1949 | dprintk("driver %s up and running\n", driver_data->name); | 1946 | cpufreq_debug_enable_ratelimit(); |
1950 | cpufreq_debug_enable_ratelimit(); | ||
1951 | } | ||
1952 | 1947 | ||
1948 | return 0; | ||
1949 | err_sysdev_unreg: | ||
1950 | sysdev_driver_unregister(&cpu_sysdev_class, | ||
1951 | &cpufreq_sysdev_driver); | ||
1952 | err_null_driver: | ||
1953 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | ||
1954 | cpufreq_driver = NULL; | ||
1955 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | ||
1953 | return ret; | 1956 | return ret; |
1954 | } | 1957 | } |
1955 | EXPORT_SYMBOL_GPL(cpufreq_register_driver); | 1958 | EXPORT_SYMBOL_GPL(cpufreq_register_driver); |
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index d421f9d58d46..950720473967 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -677,7 +677,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) | |||
677 | struct drm_crtc_helper_funcs *crtc_funcs; | 677 | struct drm_crtc_helper_funcs *crtc_funcs; |
678 | u16 *red, *green, *blue, *transp; | 678 | u16 *red, *green, *blue, *transp; |
679 | struct drm_crtc *crtc; | 679 | struct drm_crtc *crtc; |
680 | int i, rc = 0; | 680 | int i, j, rc = 0; |
681 | int start; | 681 | int start; |
682 | 682 | ||
683 | for (i = 0; i < fb_helper->crtc_count; i++) { | 683 | for (i = 0; i < fb_helper->crtc_count; i++) { |
@@ -690,7 +690,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) | |||
690 | transp = cmap->transp; | 690 | transp = cmap->transp; |
691 | start = cmap->start; | 691 | start = cmap->start; |
692 | 692 | ||
693 | for (i = 0; i < cmap->len; i++) { | 693 | for (j = 0; j < cmap->len; j++) { |
694 | u16 hred, hgreen, hblue, htransp = 0xffff; | 694 | u16 hred, hgreen, hblue, htransp = 0xffff; |
695 | 695 | ||
696 | hred = *red++; | 696 | hred = *red++; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 363f66ca5d33..f39ac3a0fa93 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1566,7 +1566,17 @@ | |||
1566 | 1566 | ||
1567 | /* Backlight control */ | 1567 | /* Backlight control */ |
1568 | #define BLC_PWM_CTL 0x61254 | 1568 | #define BLC_PWM_CTL 0x61254 |
1569 | #define BACKLIGHT_MODULATION_FREQ_SHIFT (17) | ||
1569 | #define BLC_PWM_CTL2 0x61250 /* 965+ only */ | 1570 | #define BLC_PWM_CTL2 0x61250 /* 965+ only */ |
1571 | #define BLM_COMBINATION_MODE (1 << 30) | ||
1572 | /* | ||
1573 | * This is the most significant 15 bits of the number of backlight cycles in a | ||
1574 | * complete cycle of the modulated backlight control. | ||
1575 | * | ||
1576 | * The actual value is this field multiplied by two. | ||
1577 | */ | ||
1578 | #define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) | ||
1579 | #define BLM_LEGACY_MODE (1 << 16) | ||
1570 | /* | 1580 | /* |
1571 | * This is the number of cycles out of the backlight modulation cycle for which | 1581 | * This is the number of cycles out of the backlight modulation cycle for which |
1572 | * the backlight is on. | 1582 | * the backlight is on. |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 4e5ff593413d..a06ff07a4d3b 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -30,6 +30,8 @@ | |||
30 | 30 | ||
31 | #include "intel_drv.h" | 31 | #include "intel_drv.h" |
32 | 32 | ||
33 | #define PCI_LBPC 0xf4 /* legacy/combination backlight modes */ | ||
34 | |||
33 | void | 35 | void |
34 | intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, | 36 | intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, |
35 | struct drm_display_mode *adjusted_mode) | 37 | struct drm_display_mode *adjusted_mode) |
@@ -110,6 +112,19 @@ done: | |||
110 | dev_priv->pch_pf_size = (width << 16) | height; | 112 | dev_priv->pch_pf_size = (width << 16) | height; |
111 | } | 113 | } |
112 | 114 | ||
115 | static int is_backlight_combination_mode(struct drm_device *dev) | ||
116 | { | ||
117 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
118 | |||
119 | if (INTEL_INFO(dev)->gen >= 4) | ||
120 | return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; | ||
121 | |||
122 | if (IS_GEN2(dev)) | ||
123 | return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
113 | static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv) | 128 | static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv) |
114 | { | 129 | { |
115 | u32 val; | 130 | u32 val; |
@@ -166,6 +181,9 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev) | |||
166 | if (INTEL_INFO(dev)->gen < 4) | 181 | if (INTEL_INFO(dev)->gen < 4) |
167 | max &= ~1; | 182 | max &= ~1; |
168 | } | 183 | } |
184 | |||
185 | if (is_backlight_combination_mode(dev)) | ||
186 | max *= 0xff; | ||
169 | } | 187 | } |
170 | 188 | ||
171 | DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); | 189 | DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); |
@@ -183,6 +201,14 @@ u32 intel_panel_get_backlight(struct drm_device *dev) | |||
183 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | 201 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; |
184 | if (IS_PINEVIEW(dev)) | 202 | if (IS_PINEVIEW(dev)) |
185 | val >>= 1; | 203 | val >>= 1; |
204 | |||
205 | if (is_backlight_combination_mode(dev)){ | ||
206 | u8 lbpc; | ||
207 | |||
208 | val &= ~1; | ||
209 | pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); | ||
210 | val *= lbpc; | ||
211 | } | ||
186 | } | 212 | } |
187 | 213 | ||
188 | DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); | 214 | DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); |
@@ -205,6 +231,16 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) | |||
205 | 231 | ||
206 | if (HAS_PCH_SPLIT(dev)) | 232 | if (HAS_PCH_SPLIT(dev)) |
207 | return intel_pch_panel_set_backlight(dev, level); | 233 | return intel_pch_panel_set_backlight(dev, level); |
234 | |||
235 | if (is_backlight_combination_mode(dev)){ | ||
236 | u32 max = intel_panel_get_max_backlight(dev); | ||
237 | u8 lbpc; | ||
238 | |||
239 | lbpc = level * 0xfe / max + 1; | ||
240 | level /= lbpc; | ||
241 | pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); | ||
242 | } | ||
243 | |||
208 | tmp = I915_READ(BLC_PWM_CTL); | 244 | tmp = I915_READ(BLC_PWM_CTL); |
209 | if (IS_PINEVIEW(dev)) { | 245 | if (IS_PINEVIEW(dev)) { |
210 | tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); | 246 | tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c index 1ef39be996ed..ce38e97b9428 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c | |||
@@ -83,7 +83,8 @@ nouveau_dma_init(struct nouveau_channel *chan) | |||
83 | return ret; | 83 | return ret; |
84 | 84 | ||
85 | /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */ | 85 | /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */ |
86 | ret = nouveau_notifier_alloc(chan, NvNotify0, 32, &chan->m2mf_ntfy); | 86 | ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfd0, 0x1000, |
87 | &chan->m2mf_ntfy); | ||
87 | if (ret) | 88 | if (ret) |
88 | return ret; | 89 | return ret; |
89 | 90 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 8efefed58c15..06111887b789 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -853,7 +853,8 @@ extern const struct ttm_mem_type_manager_func nouveau_gart_manager; | |||
853 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); | 853 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); |
854 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); | 854 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); |
855 | extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, | 855 | extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, |
856 | int cout, uint32_t *offset); | 856 | int cout, uint32_t start, uint32_t end, |
857 | uint32_t *offset); | ||
857 | extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); | 858 | extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); |
858 | extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, | 859 | extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, |
859 | struct drm_file *); | 860 | struct drm_file *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 02b48d183f4a..2683377f4131 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
@@ -759,8 +759,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, | |||
759 | ret = vram->get(dev, mem->num_pages << PAGE_SHIFT, | 759 | ret = vram->get(dev, mem->num_pages << PAGE_SHIFT, |
760 | mem->page_alignment << PAGE_SHIFT, size_nc, | 760 | mem->page_alignment << PAGE_SHIFT, size_nc, |
761 | (nvbo->tile_flags >> 8) & 0x3ff, &node); | 761 | (nvbo->tile_flags >> 8) & 0x3ff, &node); |
762 | if (ret) | 762 | if (ret) { |
763 | return ret; | 763 | mem->mm_node = NULL; |
764 | return (ret == -ENOSPC) ? 0 : ret; | ||
765 | } | ||
764 | 766 | ||
765 | node->page_shift = 12; | 767 | node->page_shift = 12; |
766 | if (nvbo->vma.node) | 768 | if (nvbo->vma.node) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mm.c b/drivers/gpu/drm/nouveau/nouveau_mm.c index 8844b50c3e54..7609756b6faf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mm.c +++ b/drivers/gpu/drm/nouveau/nouveau_mm.c | |||
@@ -123,7 +123,7 @@ nouveau_mm_get(struct nouveau_mm *rmm, int type, u32 size, u32 size_nc, | |||
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | return -ENOMEM; | 126 | return -ENOSPC; |
127 | } | 127 | } |
128 | 128 | ||
129 | int | 129 | int |
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index a86f27655fc4..7ba3fc0b30c1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
@@ -95,7 +95,8 @@ nouveau_notifier_gpuobj_dtor(struct drm_device *dev, | |||
95 | 95 | ||
96 | int | 96 | int |
97 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | 97 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, |
98 | int size, uint32_t *b_offset) | 98 | int size, uint32_t start, uint32_t end, |
99 | uint32_t *b_offset) | ||
99 | { | 100 | { |
100 | struct drm_device *dev = chan->dev; | 101 | struct drm_device *dev = chan->dev; |
101 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 102 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
@@ -104,9 +105,10 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | |||
104 | uint32_t offset; | 105 | uint32_t offset; |
105 | int target, ret; | 106 | int target, ret; |
106 | 107 | ||
107 | mem = drm_mm_search_free(&chan->notifier_heap, size, 0, 0); | 108 | mem = drm_mm_search_free_in_range(&chan->notifier_heap, size, 0, |
109 | start, end, 0); | ||
108 | if (mem) | 110 | if (mem) |
109 | mem = drm_mm_get_block(mem, size, 0); | 111 | mem = drm_mm_get_block_range(mem, size, 0, start, end); |
110 | if (!mem) { | 112 | if (!mem) { |
111 | NV_ERROR(dev, "Channel %d notifier block full\n", chan->id); | 113 | NV_ERROR(dev, "Channel %d notifier block full\n", chan->id); |
112 | return -ENOMEM; | 114 | return -ENOMEM; |
@@ -182,7 +184,8 @@ nouveau_ioctl_notifier_alloc(struct drm_device *dev, void *data, | |||
182 | if (IS_ERR(chan)) | 184 | if (IS_ERR(chan)) |
183 | return PTR_ERR(chan); | 185 | return PTR_ERR(chan); |
184 | 186 | ||
185 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, &na->offset); | 187 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, 0, 0x1000, |
188 | &na->offset); | ||
186 | nouveau_channel_put(&chan); | 189 | nouveau_channel_put(&chan); |
187 | return ret; | 190 | return ret; |
188 | } | 191 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index 306d4b1f585f..a6f8aa651fc6 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
@@ -403,16 +403,24 @@ nv50_instmem_unmap(struct nouveau_gpuobj *gpuobj) | |||
403 | void | 403 | void |
404 | nv50_instmem_flush(struct drm_device *dev) | 404 | nv50_instmem_flush(struct drm_device *dev) |
405 | { | 405 | { |
406 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
407 | |||
408 | spin_lock(&dev_priv->ramin_lock); | ||
406 | nv_wr32(dev, 0x00330c, 0x00000001); | 409 | nv_wr32(dev, 0x00330c, 0x00000001); |
407 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) | 410 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) |
408 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 411 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
412 | spin_unlock(&dev_priv->ramin_lock); | ||
409 | } | 413 | } |
410 | 414 | ||
411 | void | 415 | void |
412 | nv84_instmem_flush(struct drm_device *dev) | 416 | nv84_instmem_flush(struct drm_device *dev) |
413 | { | 417 | { |
418 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
419 | |||
420 | spin_lock(&dev_priv->ramin_lock); | ||
414 | nv_wr32(dev, 0x070000, 0x00000001); | 421 | nv_wr32(dev, 0x070000, 0x00000001); |
415 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) | 422 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) |
416 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 423 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
424 | spin_unlock(&dev_priv->ramin_lock); | ||
417 | } | 425 | } |
418 | 426 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index b23794c8859b..4fd3432b5b8d 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c | |||
@@ -173,7 +173,11 @@ nv50_vm_flush(struct nouveau_vm *vm) | |||
173 | void | 173 | void |
174 | nv50_vm_flush_engine(struct drm_device *dev, int engine) | 174 | nv50_vm_flush_engine(struct drm_device *dev, int engine) |
175 | { | 175 | { |
176 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
177 | |||
178 | spin_lock(&dev_priv->ramin_lock); | ||
176 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); | 179 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); |
177 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) | 180 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) |
178 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); | 181 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); |
182 | spin_unlock(&dev_priv->ramin_lock); | ||
179 | } | 183 | } |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 789441ed9837..b9427e689cf3 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2194,7 +2194,6 @@ int evergreen_mc_init(struct radeon_device *rdev) | |||
2194 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; | 2194 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; |
2195 | } | 2195 | } |
2196 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 2196 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
2197 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
2198 | r700_vram_gtt_location(rdev, &rdev->mc); | 2197 | r700_vram_gtt_location(rdev, &rdev->mc); |
2199 | radeon_update_bandwidth_info(rdev); | 2198 | radeon_update_bandwidth_info(rdev); |
2200 | 2199 | ||
@@ -2934,7 +2933,7 @@ static int evergreen_startup(struct radeon_device *rdev) | |||
2934 | /* XXX: ontario has problems blitting to gart at the moment */ | 2933 | /* XXX: ontario has problems blitting to gart at the moment */ |
2935 | if (rdev->family == CHIP_PALM) { | 2934 | if (rdev->family == CHIP_PALM) { |
2936 | rdev->asic->copy = NULL; | 2935 | rdev->asic->copy = NULL; |
2937 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 2936 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
2938 | } | 2937 | } |
2939 | 2938 | ||
2940 | /* allocate wb buffer */ | 2939 | /* allocate wb buffer */ |
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index 3218287f4c51..ba06a69c6de8 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c | |||
@@ -623,7 +623,7 @@ done: | |||
623 | dev_err(rdev->dev, "(%d) pin blit object failed\n", r); | 623 | dev_err(rdev->dev, "(%d) pin blit object failed\n", r); |
624 | return r; | 624 | return r; |
625 | } | 625 | } |
626 | rdev->mc.active_vram_size = rdev->mc.real_vram_size; | 626 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
627 | return 0; | 627 | return 0; |
628 | } | 628 | } |
629 | 629 | ||
@@ -631,7 +631,7 @@ void evergreen_blit_fini(struct radeon_device *rdev) | |||
631 | { | 631 | { |
632 | int r; | 632 | int r; |
633 | 633 | ||
634 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 634 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
635 | if (rdev->r600_blit.shader_obj == NULL) | 635 | if (rdev->r600_blit.shader_obj == NULL) |
636 | return; | 636 | return; |
637 | /* If we can't reserve the bo, unref should be enough to destroy | 637 | /* If we can't reserve the bo, unref should be enough to destroy |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 8c199c49731b..7aade20f63a8 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1039,7 +1039,7 @@ static void cayman_cp_enable(struct radeon_device *rdev, bool enable) | |||
1039 | if (enable) | 1039 | if (enable) |
1040 | WREG32(CP_ME_CNTL, 0); | 1040 | WREG32(CP_ME_CNTL, 0); |
1041 | else { | 1041 | else { |
1042 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 1042 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
1043 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); | 1043 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); |
1044 | WREG32(SCRATCH_UMSK, 0); | 1044 | WREG32(SCRATCH_UMSK, 0); |
1045 | } | 1045 | } |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 93fa735c8c1a..e372f9e1e5ce 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -70,23 +70,6 @@ MODULE_FIRMWARE(FIRMWARE_R520); | |||
70 | 70 | ||
71 | void r100_pre_page_flip(struct radeon_device *rdev, int crtc) | 71 | void r100_pre_page_flip(struct radeon_device *rdev, int crtc) |
72 | { | 72 | { |
73 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; | ||
74 | u32 tmp; | ||
75 | |||
76 | /* make sure flip is at vb rather than hb */ | ||
77 | tmp = RREG32(RADEON_CRTC_OFFSET_CNTL + radeon_crtc->crtc_offset); | ||
78 | tmp &= ~RADEON_CRTC_OFFSET_FLIP_CNTL; | ||
79 | /* make sure pending bit is asserted */ | ||
80 | tmp |= RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN; | ||
81 | WREG32(RADEON_CRTC_OFFSET_CNTL + radeon_crtc->crtc_offset, tmp); | ||
82 | |||
83 | /* set pageflip to happen as late as possible in the vblank interval. | ||
84 | * same field for crtc1/2 | ||
85 | */ | ||
86 | tmp = RREG32(RADEON_CRTC_GEN_CNTL); | ||
87 | tmp &= ~RADEON_CRTC_VSTAT_MODE_MASK; | ||
88 | WREG32(RADEON_CRTC_GEN_CNTL, tmp); | ||
89 | |||
90 | /* enable the pflip int */ | 73 | /* enable the pflip int */ |
91 | radeon_irq_kms_pflip_irq_get(rdev, crtc); | 74 | radeon_irq_kms_pflip_irq_get(rdev, crtc); |
92 | } | 75 | } |
@@ -1041,7 +1024,7 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) | |||
1041 | return r; | 1024 | return r; |
1042 | } | 1025 | } |
1043 | rdev->cp.ready = true; | 1026 | rdev->cp.ready = true; |
1044 | rdev->mc.active_vram_size = rdev->mc.real_vram_size; | 1027 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
1045 | return 0; | 1028 | return 0; |
1046 | } | 1029 | } |
1047 | 1030 | ||
@@ -1059,7 +1042,7 @@ void r100_cp_fini(struct radeon_device *rdev) | |||
1059 | void r100_cp_disable(struct radeon_device *rdev) | 1042 | void r100_cp_disable(struct radeon_device *rdev) |
1060 | { | 1043 | { |
1061 | /* Disable ring */ | 1044 | /* Disable ring */ |
1062 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 1045 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
1063 | rdev->cp.ready = false; | 1046 | rdev->cp.ready = false; |
1064 | WREG32(RADEON_CP_CSQ_MODE, 0); | 1047 | WREG32(RADEON_CP_CSQ_MODE, 0); |
1065 | WREG32(RADEON_CP_CSQ_CNTL, 0); | 1048 | WREG32(RADEON_CP_CSQ_CNTL, 0); |
@@ -2329,7 +2312,6 @@ void r100_vram_init_sizes(struct radeon_device *rdev) | |||
2329 | /* FIXME we don't use the second aperture yet when we could use it */ | 2312 | /* FIXME we don't use the second aperture yet when we could use it */ |
2330 | if (rdev->mc.visible_vram_size > rdev->mc.aper_size) | 2313 | if (rdev->mc.visible_vram_size > rdev->mc.aper_size) |
2331 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 2314 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
2332 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
2333 | config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); | 2315 | config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); |
2334 | if (rdev->flags & RADEON_IS_IGP) { | 2316 | if (rdev->flags & RADEON_IS_IGP) { |
2335 | uint32_t tom; | 2317 | uint32_t tom; |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index b409b24207a1..12fdebf9aed8 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1256,7 +1256,6 @@ int r600_mc_init(struct radeon_device *rdev) | |||
1256 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); | 1256 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); |
1257 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); | 1257 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); |
1258 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1258 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
1259 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
1260 | r600_vram_gtt_location(rdev, &rdev->mc); | 1259 | r600_vram_gtt_location(rdev, &rdev->mc); |
1261 | 1260 | ||
1262 | if (rdev->flags & RADEON_IS_IGP) { | 1261 | if (rdev->flags & RADEON_IS_IGP) { |
@@ -1938,7 +1937,7 @@ void r600_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v) | |||
1938 | */ | 1937 | */ |
1939 | void r600_cp_stop(struct radeon_device *rdev) | 1938 | void r600_cp_stop(struct radeon_device *rdev) |
1940 | { | 1939 | { |
1941 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 1940 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
1942 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); | 1941 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); |
1943 | WREG32(SCRATCH_UMSK, 0); | 1942 | WREG32(SCRATCH_UMSK, 0); |
1944 | } | 1943 | } |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index 2fed91750126..9aa74c3f8cb6 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
@@ -558,7 +558,7 @@ done: | |||
558 | dev_err(rdev->dev, "(%d) pin blit object failed\n", r); | 558 | dev_err(rdev->dev, "(%d) pin blit object failed\n", r); |
559 | return r; | 559 | return r; |
560 | } | 560 | } |
561 | rdev->mc.active_vram_size = rdev->mc.real_vram_size; | 561 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
562 | return 0; | 562 | return 0; |
563 | } | 563 | } |
564 | 564 | ||
@@ -566,7 +566,7 @@ void r600_blit_fini(struct radeon_device *rdev) | |||
566 | { | 566 | { |
567 | int r; | 567 | int r; |
568 | 568 | ||
569 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 569 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
570 | if (rdev->r600_blit.shader_obj == NULL) | 570 | if (rdev->r600_blit.shader_obj == NULL) |
571 | return; | 571 | return; |
572 | /* If we can't reserve the bo, unref should be enough to destroy | 572 | /* If we can't reserve the bo, unref should be enough to destroy |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 6989e3422e87..cfe3af1a7935 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -357,7 +357,6 @@ struct radeon_mc { | |||
357 | * about vram size near mc fb location */ | 357 | * about vram size near mc fb location */ |
358 | u64 mc_vram_size; | 358 | u64 mc_vram_size; |
359 | u64 visible_vram_size; | 359 | u64 visible_vram_size; |
360 | u64 active_vram_size; | ||
361 | u64 gtt_size; | 360 | u64 gtt_size; |
362 | u64 gtt_start; | 361 | u64 gtt_start; |
363 | u64 gtt_end; | 362 | u64 gtt_end; |
@@ -1492,6 +1491,7 @@ extern void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *m | |||
1492 | extern void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); | 1491 | extern void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); |
1493 | extern int radeon_resume_kms(struct drm_device *dev); | 1492 | extern int radeon_resume_kms(struct drm_device *dev); |
1494 | extern int radeon_suspend_kms(struct drm_device *dev, pm_message_t state); | 1493 | extern int radeon_suspend_kms(struct drm_device *dev, pm_message_t state); |
1494 | extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size); | ||
1495 | 1495 | ||
1496 | /* | 1496 | /* |
1497 | * r600 functions used by radeon_encoder.c | 1497 | * r600 functions used by radeon_encoder.c |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 3c5d140d2efb..eb888ee5f674 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -834,6 +834,9 @@ static struct radeon_asic sumo_asic = { | |||
834 | .pm_finish = &evergreen_pm_finish, | 834 | .pm_finish = &evergreen_pm_finish, |
835 | .pm_init_profile = &rs780_pm_init_profile, | 835 | .pm_init_profile = &rs780_pm_init_profile, |
836 | .pm_get_dynpm_state = &r600_pm_get_dynpm_state, | 836 | .pm_get_dynpm_state = &r600_pm_get_dynpm_state, |
837 | .pre_page_flip = &evergreen_pre_page_flip, | ||
838 | .page_flip = &evergreen_page_flip, | ||
839 | .post_page_flip = &evergreen_post_page_flip, | ||
837 | }; | 840 | }; |
838 | 841 | ||
839 | static struct radeon_asic btc_asic = { | 842 | static struct radeon_asic btc_asic = { |
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index a419b67d8401..723cd19cd22f 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
@@ -151,9 +151,12 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data, | |||
151 | { | 151 | { |
152 | struct radeon_device *rdev = dev->dev_private; | 152 | struct radeon_device *rdev = dev->dev_private; |
153 | struct drm_radeon_gem_info *args = data; | 153 | struct drm_radeon_gem_info *args = data; |
154 | struct ttm_mem_type_manager *man; | ||
155 | |||
156 | man = &rdev->mman.bdev.man[TTM_PL_VRAM]; | ||
154 | 157 | ||
155 | args->vram_size = rdev->mc.real_vram_size; | 158 | args->vram_size = rdev->mc.real_vram_size; |
156 | args->vram_visible = rdev->mc.real_vram_size; | 159 | args->vram_visible = (u64)man->size << PAGE_SHIFT; |
157 | if (rdev->stollen_vga_memory) | 160 | if (rdev->stollen_vga_memory) |
158 | args->vram_visible -= radeon_bo_size(rdev->stollen_vga_memory); | 161 | args->vram_visible -= radeon_bo_size(rdev->stollen_vga_memory); |
159 | args->vram_visible -= radeon_fbdev_total_size(rdev); | 162 | args->vram_visible -= radeon_fbdev_total_size(rdev); |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index 9ae599eb2e6d..66c9af1b3d96 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c | |||
@@ -443,7 +443,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, | |||
443 | (target_fb->bits_per_pixel * 8)); | 443 | (target_fb->bits_per_pixel * 8)); |
444 | crtc_pitch |= crtc_pitch << 16; | 444 | crtc_pitch |= crtc_pitch << 16; |
445 | 445 | ||
446 | 446 | crtc_offset_cntl |= RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN; | |
447 | if (tiling_flags & RADEON_TILING_MACRO) { | 447 | if (tiling_flags & RADEON_TILING_MACRO) { |
448 | if (ASIC_IS_R300(rdev)) | 448 | if (ASIC_IS_R300(rdev)) |
449 | crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN | | 449 | crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN | |
@@ -502,6 +502,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, | |||
502 | gen_cntl_val = RREG32(gen_cntl_reg); | 502 | gen_cntl_val = RREG32(gen_cntl_reg); |
503 | gen_cntl_val &= ~(0xf << 8); | 503 | gen_cntl_val &= ~(0xf << 8); |
504 | gen_cntl_val |= (format << 8); | 504 | gen_cntl_val |= (format << 8); |
505 | gen_cntl_val &= ~RADEON_CRTC_VSTAT_MODE_MASK; | ||
505 | WREG32(gen_cntl_reg, gen_cntl_val); | 506 | WREG32(gen_cntl_reg, gen_cntl_val); |
506 | 507 | ||
507 | crtc_offset = (u32)base; | 508 | crtc_offset = (u32)base; |
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index e446979e0e0a..60125ddba1e9 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -589,6 +589,20 @@ void radeon_ttm_fini(struct radeon_device *rdev) | |||
589 | DRM_INFO("radeon: ttm finalized\n"); | 589 | DRM_INFO("radeon: ttm finalized\n"); |
590 | } | 590 | } |
591 | 591 | ||
592 | /* this should only be called at bootup or when userspace | ||
593 | * isn't running */ | ||
594 | void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size) | ||
595 | { | ||
596 | struct ttm_mem_type_manager *man; | ||
597 | |||
598 | if (!rdev->mman.initialized) | ||
599 | return; | ||
600 | |||
601 | man = &rdev->mman.bdev.man[TTM_PL_VRAM]; | ||
602 | /* this just adjusts TTM size idea, which sets lpfn to the correct value */ | ||
603 | man->size = size >> PAGE_SHIFT; | ||
604 | } | ||
605 | |||
592 | static struct vm_operations_struct radeon_ttm_vm_ops; | 606 | static struct vm_operations_struct radeon_ttm_vm_ops; |
593 | static const struct vm_operations_struct *ttm_vm_ops = NULL; | 607 | static const struct vm_operations_struct *ttm_vm_ops = NULL; |
594 | 608 | ||
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 5afe294ed51f..8af4679db23e 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -751,7 +751,6 @@ void rs600_mc_init(struct radeon_device *rdev) | |||
751 | rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); | 751 | rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); |
752 | rdev->mc.mc_vram_size = rdev->mc.real_vram_size; | 752 | rdev->mc.mc_vram_size = rdev->mc.real_vram_size; |
753 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 753 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
754 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
755 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 754 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
756 | base = RREG32_MC(R_000004_MC_FB_LOCATION); | 755 | base = RREG32_MC(R_000004_MC_FB_LOCATION); |
757 | base = G_000004_MC_FB_START(base) << 16; | 756 | base = G_000004_MC_FB_START(base) << 16; |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 6638c8e4c81b..66c949b7c18c 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -157,7 +157,6 @@ void rs690_mc_init(struct radeon_device *rdev) | |||
157 | rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); | 157 | rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); |
158 | rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); | 158 | rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); |
159 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 159 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
160 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
161 | base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); | 160 | base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); |
162 | base = G_000100_MC_FB_START(base) << 16; | 161 | base = G_000100_MC_FB_START(base) << 16; |
163 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 162 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index ee5541c6a623..4cc7b717fedd 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -307,7 +307,7 @@ static void rv770_mc_program(struct radeon_device *rdev) | |||
307 | */ | 307 | */ |
308 | void r700_cp_stop(struct radeon_device *rdev) | 308 | void r700_cp_stop(struct radeon_device *rdev) |
309 | { | 309 | { |
310 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 310 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); |
311 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); | 311 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); |
312 | WREG32(SCRATCH_UMSK, 0); | 312 | WREG32(SCRATCH_UMSK, 0); |
313 | } | 313 | } |
@@ -1123,7 +1123,6 @@ int rv770_mc_init(struct radeon_device *rdev) | |||
1123 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); | 1123 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); |
1124 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); | 1124 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); |
1125 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1125 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
1126 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
1127 | r700_vram_gtt_location(rdev, &rdev->mc); | 1126 | r700_vram_gtt_location(rdev, &rdev->mc); |
1128 | radeon_update_bandwidth_info(rdev); | 1127 | radeon_update_bandwidth_info(rdev); |
1129 | 1128 | ||
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 2e067dd2ee51..50ea1f43bdc1 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
31 | #include <linux/ktime.h> | 31 | #include <linux/ktime.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | #define PCH_EVENT_SET 0 /* I2C Interrupt Event Set Status */ | 34 | #define PCH_EVENT_SET 0 /* I2C Interrupt Event Set Status */ |
34 | #define PCH_EVENT_NONE 1 /* I2C Interrupt Event Clear Status */ | 35 | #define PCH_EVENT_NONE 1 /* I2C Interrupt Event Clear Status */ |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index ef3bcb1ce864..61653f079671 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
@@ -249,7 +249,7 @@ static struct i2c_adapter ocores_adapter = { | |||
249 | static int ocores_i2c_of_probe(struct platform_device* pdev, | 249 | static int ocores_i2c_of_probe(struct platform_device* pdev, |
250 | struct ocores_i2c* i2c) | 250 | struct ocores_i2c* i2c) |
251 | { | 251 | { |
252 | __be32* val; | 252 | const __be32* val; |
253 | 253 | ||
254 | val = of_get_property(pdev->dev.of_node, "regstep", NULL); | 254 | val = of_get_property(pdev->dev.of_node, "regstep", NULL); |
255 | if (!val) { | 255 | if (!val) { |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 829a2a1029f7..58a58c7eaa17 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -378,9 +378,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev) | |||
378 | * REVISIT: Some wkup sources might not be needed. | 378 | * REVISIT: Some wkup sources might not be needed. |
379 | */ | 379 | */ |
380 | dev->westate = OMAP_I2C_WE_ALL; | 380 | dev->westate = OMAP_I2C_WE_ALL; |
381 | if (dev->rev < OMAP_I2C_REV_ON_4430) | 381 | omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate); |
382 | omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, | ||
383 | dev->westate); | ||
384 | } | 382 | } |
385 | } | 383 | } |
386 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); | 384 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 1fa091e05690..4a5c4a44ffb1 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/notifier.h> | 62 | #include <linux/notifier.h> |
63 | #include <linux/cpu.h> | 63 | #include <linux/cpu.h> |
64 | #include <asm/mwait.h> | 64 | #include <asm/mwait.h> |
65 | #include <asm/msr.h> | ||
65 | 66 | ||
66 | #define INTEL_IDLE_VERSION "0.4" | 67 | #define INTEL_IDLE_VERSION "0.4" |
67 | #define PREFIX "intel_idle: " | 68 | #define PREFIX "intel_idle: " |
@@ -85,6 +86,12 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); | |||
85 | static struct cpuidle_state *cpuidle_state_table; | 86 | static struct cpuidle_state *cpuidle_state_table; |
86 | 87 | ||
87 | /* | 88 | /* |
89 | * Hardware C-state auto-demotion may not always be optimal. | ||
90 | * Indicate which enable bits to clear here. | ||
91 | */ | ||
92 | static unsigned long long auto_demotion_disable_flags; | ||
93 | |||
94 | /* | ||
88 | * Set this flag for states where the HW flushes the TLB for us | 95 | * Set this flag for states where the HW flushes the TLB for us |
89 | * and so we don't need cross-calls to keep it consistent. | 96 | * and so we don't need cross-calls to keep it consistent. |
90 | * If this flag is set, SW flushes the TLB, so even if the | 97 | * If this flag is set, SW flushes the TLB, so even if the |
@@ -281,6 +288,15 @@ static struct notifier_block setup_broadcast_notifier = { | |||
281 | .notifier_call = setup_broadcast_cpuhp_notify, | 288 | .notifier_call = setup_broadcast_cpuhp_notify, |
282 | }; | 289 | }; |
283 | 290 | ||
291 | static void auto_demotion_disable(void *dummy) | ||
292 | { | ||
293 | unsigned long long msr_bits; | ||
294 | |||
295 | rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); | ||
296 | msr_bits &= ~auto_demotion_disable_flags; | ||
297 | wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); | ||
298 | } | ||
299 | |||
284 | /* | 300 | /* |
285 | * intel_idle_probe() | 301 | * intel_idle_probe() |
286 | */ | 302 | */ |
@@ -324,11 +340,17 @@ static int intel_idle_probe(void) | |||
324 | case 0x25: /* Westmere */ | 340 | case 0x25: /* Westmere */ |
325 | case 0x2C: /* Westmere */ | 341 | case 0x2C: /* Westmere */ |
326 | cpuidle_state_table = nehalem_cstates; | 342 | cpuidle_state_table = nehalem_cstates; |
343 | auto_demotion_disable_flags = | ||
344 | (NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE); | ||
327 | break; | 345 | break; |
328 | 346 | ||
329 | case 0x1C: /* 28 - Atom Processor */ | 347 | case 0x1C: /* 28 - Atom Processor */ |
348 | cpuidle_state_table = atom_cstates; | ||
349 | break; | ||
350 | |||
330 | case 0x26: /* 38 - Lincroft Atom Processor */ | 351 | case 0x26: /* 38 - Lincroft Atom Processor */ |
331 | cpuidle_state_table = atom_cstates; | 352 | cpuidle_state_table = atom_cstates; |
353 | auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE; | ||
332 | break; | 354 | break; |
333 | 355 | ||
334 | case 0x2A: /* SNB */ | 356 | case 0x2A: /* SNB */ |
@@ -436,6 +458,8 @@ static int intel_idle_cpuidle_devices_init(void) | |||
436 | return -EIO; | 458 | return -EIO; |
437 | } | 459 | } |
438 | } | 460 | } |
461 | if (auto_demotion_disable_flags) | ||
462 | smp_call_function(auto_demotion_disable, NULL, 1); | ||
439 | 463 | ||
440 | return 0; | 464 | return 0; |
441 | } | 465 | } |
diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c index 18f8798442fa..7bd5baa547be 100644 --- a/drivers/isdn/hardware/eicon/istream.c +++ b/drivers/isdn/hardware/eicon/istream.c | |||
@@ -62,7 +62,7 @@ void diva_xdi_provide_istream_info (ADAPTER* a, | |||
62 | stream interface. | 62 | stream interface. |
63 | If synchronous service was requested, then function | 63 | If synchronous service was requested, then function |
64 | does return amount of data written to stream. | 64 | does return amount of data written to stream. |
65 | 'final' does indicate that pice of data to be written is | 65 | 'final' does indicate that piece of data to be written is |
66 | final part of frame (necessary only by structured datatransfer) | 66 | final part of frame (necessary only by structured datatransfer) |
67 | return 0 if zero lengh packet was written | 67 | return 0 if zero lengh packet was written |
68 | return -1 if stream is full | 68 | return -1 if stream is full |
diff --git a/drivers/media/common/tuners/tda8290.c b/drivers/media/common/tuners/tda8290.c index bc6a67768af1..8c4852114eeb 100644 --- a/drivers/media/common/tuners/tda8290.c +++ b/drivers/media/common/tuners/tda8290.c | |||
@@ -658,13 +658,13 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props) | |||
658 | #define TDA8290_ID 0x89 | 658 | #define TDA8290_ID 0x89 |
659 | u8 reg = 0x1f, id; | 659 | u8 reg = 0x1f, id; |
660 | struct i2c_msg msg_read[] = { | 660 | struct i2c_msg msg_read[] = { |
661 | { .addr = 0x4b, .flags = 0, .len = 1, .buf = ® }, | 661 | { .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = ® }, |
662 | { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, | 662 | { .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id }, |
663 | }; | 663 | }; |
664 | 664 | ||
665 | /* detect tda8290 */ | 665 | /* detect tda8290 */ |
666 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { | 666 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { |
667 | printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", | 667 | printk(KERN_WARNING "%s: couldn't read register 0x%02x\n", |
668 | __func__, reg); | 668 | __func__, reg); |
669 | return -ENODEV; | 669 | return -ENODEV; |
670 | } | 670 | } |
@@ -685,13 +685,13 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props) | |||
685 | #define TDA8295C2_ID 0x8b | 685 | #define TDA8295C2_ID 0x8b |
686 | u8 reg = 0x2f, id; | 686 | u8 reg = 0x2f, id; |
687 | struct i2c_msg msg_read[] = { | 687 | struct i2c_msg msg_read[] = { |
688 | { .addr = 0x4b, .flags = 0, .len = 1, .buf = ® }, | 688 | { .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = ® }, |
689 | { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, | 689 | { .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id }, |
690 | }; | 690 | }; |
691 | 691 | ||
692 | /* detect tda8290 */ | 692 | /* detect tda8295 */ |
693 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { | 693 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { |
694 | printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", | 694 | printk(KERN_WARNING "%s: couldn't read register 0x%02x\n", |
695 | __func__, reg); | 695 | __func__, reg); |
696 | return -ENODEV; | 696 | return -ENODEV; |
697 | } | 697 | } |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index defd83964ce2..193cdb77b76a 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -870,6 +870,23 @@ static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) | |||
870 | return 0; | 870 | return 0; |
871 | } | 871 | } |
872 | 872 | ||
873 | static int stk7700p_pid_filter(struct dvb_usb_adapter *adapter, int index, | ||
874 | u16 pid, int onoff) | ||
875 | { | ||
876 | struct dib0700_state *st = adapter->dev->priv; | ||
877 | if (st->is_dib7000pc) | ||
878 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); | ||
879 | return dib7000m_pid_filter(adapter->fe, index, pid, onoff); | ||
880 | } | ||
881 | |||
882 | static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) | ||
883 | { | ||
884 | struct dib0700_state *st = adapter->dev->priv; | ||
885 | if (st->is_dib7000pc) | ||
886 | return dib7000p_pid_filter_ctrl(adapter->fe, onoff); | ||
887 | return dib7000m_pid_filter_ctrl(adapter->fe, onoff); | ||
888 | } | ||
889 | |||
873 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) | 890 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
874 | { | 891 | { |
875 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); | 892 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
@@ -1875,8 +1892,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1875 | { | 1892 | { |
1876 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | 1893 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
1877 | .pid_filter_count = 32, | 1894 | .pid_filter_count = 32, |
1878 | .pid_filter = stk70x0p_pid_filter, | 1895 | .pid_filter = stk7700p_pid_filter, |
1879 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, | 1896 | .pid_filter_ctrl = stk7700p_pid_filter_ctrl, |
1880 | .frontend_attach = stk7700p_frontend_attach, | 1897 | .frontend_attach = stk7700p_frontend_attach, |
1881 | .tuner_attach = stk7700p_tuner_attach, | 1898 | .tuner_attach = stk7700p_tuner_attach, |
1882 | 1899 | ||
diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c index 9eea4188303b..46ccd01a7696 100644 --- a/drivers/media/dvb/dvb-usb/lmedm04.c +++ b/drivers/media/dvb/dvb-usb/lmedm04.c | |||
@@ -659,7 +659,7 @@ static int lme2510_download_firmware(struct usb_device *dev, | |||
659 | } | 659 | } |
660 | 660 | ||
661 | /* Default firmware for LME2510C */ | 661 | /* Default firmware for LME2510C */ |
662 | const char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw"; | 662 | char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw"; |
663 | 663 | ||
664 | static void lme_coldreset(struct usb_device *dev) | 664 | static void lme_coldreset(struct usb_device *dev) |
665 | { | 665 | { |
@@ -1006,7 +1006,7 @@ static struct dvb_usb_device_properties lme2510c_properties = { | |||
1006 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 1006 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
1007 | .usb_ctrl = DEVICE_SPECIFIC, | 1007 | .usb_ctrl = DEVICE_SPECIFIC, |
1008 | .download_firmware = lme2510_download_firmware, | 1008 | .download_firmware = lme2510_download_firmware, |
1009 | .firmware = lme_firmware, | 1009 | .firmware = (const char *)&lme_firmware, |
1010 | .size_of_priv = sizeof(struct lme2510_state), | 1010 | .size_of_priv = sizeof(struct lme2510_state), |
1011 | .num_adapters = 1, | 1011 | .num_adapters = 1, |
1012 | .adapter = { | 1012 | .adapter = { |
@@ -1109,5 +1109,5 @@ module_exit(lme2510_module_exit); | |||
1109 | 1109 | ||
1110 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 1110 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
1111 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); | 1111 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); |
1112 | MODULE_VERSION("1.74"); | 1112 | MODULE_VERSION("1.75"); |
1113 | MODULE_LICENSE("GPL"); | 1113 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/frontends/dib7000m.c b/drivers/media/dvb/frontends/dib7000m.c index c7f5ccf54aa5..289a79837f24 100644 --- a/drivers/media/dvb/frontends/dib7000m.c +++ b/drivers/media/dvb/frontends/dib7000m.c | |||
@@ -1285,6 +1285,25 @@ struct i2c_adapter * dib7000m_get_i2c_master(struct dvb_frontend *demod, enum di | |||
1285 | } | 1285 | } |
1286 | EXPORT_SYMBOL(dib7000m_get_i2c_master); | 1286 | EXPORT_SYMBOL(dib7000m_get_i2c_master); |
1287 | 1287 | ||
1288 | int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff) | ||
1289 | { | ||
1290 | struct dib7000m_state *state = fe->demodulator_priv; | ||
1291 | u16 val = dib7000m_read_word(state, 294 + state->reg_offs) & 0xffef; | ||
1292 | val |= (onoff & 0x1) << 4; | ||
1293 | dprintk("PID filter enabled %d", onoff); | ||
1294 | return dib7000m_write_word(state, 294 + state->reg_offs, val); | ||
1295 | } | ||
1296 | EXPORT_SYMBOL(dib7000m_pid_filter_ctrl); | ||
1297 | |||
1298 | int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff) | ||
1299 | { | ||
1300 | struct dib7000m_state *state = fe->demodulator_priv; | ||
1301 | dprintk("PID filter: index %x, PID %d, OnOff %d", id, pid, onoff); | ||
1302 | return dib7000m_write_word(state, 300 + state->reg_offs + id, | ||
1303 | onoff ? (1 << 13) | pid : 0); | ||
1304 | } | ||
1305 | EXPORT_SYMBOL(dib7000m_pid_filter); | ||
1306 | |||
1288 | #if 0 | 1307 | #if 0 |
1289 | /* used with some prototype boards */ | 1308 | /* used with some prototype boards */ |
1290 | int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, | 1309 | int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, |
diff --git a/drivers/media/dvb/frontends/dib7000m.h b/drivers/media/dvb/frontends/dib7000m.h index 113819ce9f0d..81fcf2241c64 100644 --- a/drivers/media/dvb/frontends/dib7000m.h +++ b/drivers/media/dvb/frontends/dib7000m.h | |||
@@ -46,6 +46,8 @@ extern struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap, | |||
46 | extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *, | 46 | extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *, |
47 | enum dibx000_i2c_interface, | 47 | enum dibx000_i2c_interface, |
48 | int); | 48 | int); |
49 | extern int dib7000m_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff); | ||
50 | extern int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff); | ||
49 | #else | 51 | #else |
50 | static inline | 52 | static inline |
51 | struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap, | 53 | struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap, |
@@ -63,6 +65,19 @@ struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *demod, | |||
63 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 65 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
64 | return NULL; | 66 | return NULL; |
65 | } | 67 | } |
68 | static inline int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, | ||
69 | u16 pid, u8 onoff) | ||
70 | { | ||
71 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | ||
72 | return -ENODEV; | ||
73 | } | ||
74 | |||
75 | static inline int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, | ||
76 | uint8_t onoff) | ||
77 | { | ||
78 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | ||
79 | return -ENODEV; | ||
80 | } | ||
66 | #endif | 81 | #endif |
67 | 82 | ||
68 | /* TODO | 83 | /* TODO |
diff --git a/drivers/media/dvb/mantis/mantis_pci.c b/drivers/media/dvb/mantis/mantis_pci.c index 59feeb84aec7..10a432a79d00 100644 --- a/drivers/media/dvb/mantis/mantis_pci.c +++ b/drivers/media/dvb/mantis/mantis_pci.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/pgtable.h> | ||
26 | #include <asm/page.h> | 25 | #include <asm/page.h> |
27 | #include <linux/kmod.h> | 26 | #include <linux/kmod.h> |
28 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c index 73230ff93b8a..01f258a2a57a 100644 --- a/drivers/media/rc/ir-raw.c +++ b/drivers/media/rc/ir-raw.c | |||
@@ -112,7 +112,7 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type) | |||
112 | { | 112 | { |
113 | ktime_t now; | 113 | ktime_t now; |
114 | s64 delta; /* ns */ | 114 | s64 delta; /* ns */ |
115 | struct ir_raw_event ev; | 115 | DEFINE_IR_RAW_EVENT(ev); |
116 | int rc = 0; | 116 | int rc = 0; |
117 | 117 | ||
118 | if (!dev->raw) | 118 | if (!dev->raw) |
@@ -125,7 +125,6 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type) | |||
125 | * being called for the first time, note that delta can't | 125 | * being called for the first time, note that delta can't |
126 | * possibly be negative. | 126 | * possibly be negative. |
127 | */ | 127 | */ |
128 | ev.duration = 0; | ||
129 | if (delta > IR_MAX_DURATION || !dev->raw->last_type) | 128 | if (delta > IR_MAX_DURATION || !dev->raw->last_type) |
130 | type |= IR_START_EVENT; | 129 | type |= IR_START_EVENT; |
131 | else | 130 | else |
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 6df0a4980645..e4f8eac7f717 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
@@ -148,6 +148,7 @@ enum mceusb_model_type { | |||
148 | MCE_GEN2_TX_INV, | 148 | MCE_GEN2_TX_INV, |
149 | POLARIS_EVK, | 149 | POLARIS_EVK, |
150 | CX_HYBRID_TV, | 150 | CX_HYBRID_TV, |
151 | MULTIFUNCTION, | ||
151 | }; | 152 | }; |
152 | 153 | ||
153 | struct mceusb_model { | 154 | struct mceusb_model { |
@@ -155,9 +156,10 @@ struct mceusb_model { | |||
155 | u32 mce_gen2:1; | 156 | u32 mce_gen2:1; |
156 | u32 mce_gen3:1; | 157 | u32 mce_gen3:1; |
157 | u32 tx_mask_normal:1; | 158 | u32 tx_mask_normal:1; |
158 | u32 is_polaris:1; | ||
159 | u32 no_tx:1; | 159 | u32 no_tx:1; |
160 | 160 | ||
161 | int ir_intfnum; | ||
162 | |||
161 | const char *rc_map; /* Allow specify a per-board map */ | 163 | const char *rc_map; /* Allow specify a per-board map */ |
162 | const char *name; /* per-board name */ | 164 | const char *name; /* per-board name */ |
163 | }; | 165 | }; |
@@ -179,7 +181,6 @@ static const struct mceusb_model mceusb_model[] = { | |||
179 | .tx_mask_normal = 1, | 181 | .tx_mask_normal = 1, |
180 | }, | 182 | }, |
181 | [POLARIS_EVK] = { | 183 | [POLARIS_EVK] = { |
182 | .is_polaris = 1, | ||
183 | /* | 184 | /* |
184 | * In fact, the EVK is shipped without | 185 | * In fact, the EVK is shipped without |
185 | * remotes, but we should have something handy, | 186 | * remotes, but we should have something handy, |
@@ -189,10 +190,13 @@ static const struct mceusb_model mceusb_model[] = { | |||
189 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", | 190 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", |
190 | }, | 191 | }, |
191 | [CX_HYBRID_TV] = { | 192 | [CX_HYBRID_TV] = { |
192 | .is_polaris = 1, | ||
193 | .no_tx = 1, /* tx isn't wired up at all */ | 193 | .no_tx = 1, /* tx isn't wired up at all */ |
194 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", | 194 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", |
195 | }, | 195 | }, |
196 | [MULTIFUNCTION] = { | ||
197 | .mce_gen2 = 1, | ||
198 | .ir_intfnum = 2, | ||
199 | }, | ||
196 | }; | 200 | }; |
197 | 201 | ||
198 | static struct usb_device_id mceusb_dev_table[] = { | 202 | static struct usb_device_id mceusb_dev_table[] = { |
@@ -216,8 +220,9 @@ static struct usb_device_id mceusb_dev_table[] = { | |||
216 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, | 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, |
217 | /* Philips/Spinel plus IR transceiver for ASUS */ | 221 | /* Philips/Spinel plus IR transceiver for ASUS */ |
218 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, | 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, |
219 | /* Realtek MCE IR Receiver */ | 223 | /* Realtek MCE IR Receiver and card reader */ |
220 | { USB_DEVICE(VENDOR_REALTEK, 0x0161) }, | 224 | { USB_DEVICE(VENDOR_REALTEK, 0x0161), |
225 | .driver_info = MULTIFUNCTION }, | ||
221 | /* SMK/Toshiba G83C0004D410 */ | 226 | /* SMK/Toshiba G83C0004D410 */ |
222 | { USB_DEVICE(VENDOR_SMK, 0x031d), | 227 | { USB_DEVICE(VENDOR_SMK, 0x031d), |
223 | .driver_info = MCE_GEN2_TX_INV }, | 228 | .driver_info = MCE_GEN2_TX_INV }, |
@@ -1101,7 +1106,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, | |||
1101 | bool is_gen3; | 1106 | bool is_gen3; |
1102 | bool is_microsoft_gen1; | 1107 | bool is_microsoft_gen1; |
1103 | bool tx_mask_normal; | 1108 | bool tx_mask_normal; |
1104 | bool is_polaris; | 1109 | int ir_intfnum; |
1105 | 1110 | ||
1106 | dev_dbg(&intf->dev, "%s called\n", __func__); | 1111 | dev_dbg(&intf->dev, "%s called\n", __func__); |
1107 | 1112 | ||
@@ -1110,13 +1115,11 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, | |||
1110 | is_gen3 = mceusb_model[model].mce_gen3; | 1115 | is_gen3 = mceusb_model[model].mce_gen3; |
1111 | is_microsoft_gen1 = mceusb_model[model].mce_gen1; | 1116 | is_microsoft_gen1 = mceusb_model[model].mce_gen1; |
1112 | tx_mask_normal = mceusb_model[model].tx_mask_normal; | 1117 | tx_mask_normal = mceusb_model[model].tx_mask_normal; |
1113 | is_polaris = mceusb_model[model].is_polaris; | 1118 | ir_intfnum = mceusb_model[model].ir_intfnum; |
1114 | 1119 | ||
1115 | if (is_polaris) { | 1120 | /* There are multi-function devices with non-IR interfaces */ |
1116 | /* Interface 0 is IR */ | 1121 | if (idesc->desc.bInterfaceNumber != ir_intfnum) |
1117 | if (idesc->desc.bInterfaceNumber) | 1122 | return -ENODEV; |
1118 | return -ENODEV; | ||
1119 | } | ||
1120 | 1123 | ||
1121 | /* step through the endpoints to find first bulk in and out endpoint */ | 1124 | /* step through the endpoints to find first bulk in and out endpoint */ |
1122 | for (i = 0; i < idesc->desc.bNumEndpoints; ++i) { | 1125 | for (i = 0; i < idesc->desc.bNumEndpoints; ++i) { |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 273d9d674792..d4d64492a057 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -385,8 +385,9 @@ static void nvt_cir_regs_init(struct nvt_dev *nvt) | |||
385 | 385 | ||
386 | static void nvt_cir_wake_regs_init(struct nvt_dev *nvt) | 386 | static void nvt_cir_wake_regs_init(struct nvt_dev *nvt) |
387 | { | 387 | { |
388 | /* set number of bytes needed for wake key comparison (default 67) */ | 388 | /* set number of bytes needed for wake from s3 (default 65) */ |
389 | nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_LEN, CIR_WAKE_FIFO_CMP_DEEP); | 389 | nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_CMP_BYTES, |
390 | CIR_WAKE_FIFO_CMP_DEEP); | ||
390 | 391 | ||
391 | /* set tolerance/variance allowed per byte during wake compare */ | 392 | /* set tolerance/variance allowed per byte during wake compare */ |
392 | nvt_cir_wake_reg_write(nvt, CIR_WAKE_CMP_TOLERANCE, | 393 | nvt_cir_wake_reg_write(nvt, CIR_WAKE_CMP_TOLERANCE, |
diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h index 1df82351cb03..048135eea702 100644 --- a/drivers/media/rc/nuvoton-cir.h +++ b/drivers/media/rc/nuvoton-cir.h | |||
@@ -305,8 +305,11 @@ struct nvt_dev { | |||
305 | #define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20 | 305 | #define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20 |
306 | #define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10 | 306 | #define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10 |
307 | 307 | ||
308 | /* CIR Wake FIFO buffer is 67 bytes long */ | 308 | /* |
309 | #define CIR_WAKE_FIFO_LEN 67 | 309 | * The CIR Wake FIFO buffer is 67 bytes long, but the stock remote wakes |
310 | * the system comparing only 65 bytes (fails with this set to 67) | ||
311 | */ | ||
312 | #define CIR_WAKE_FIFO_CMP_BYTES 65 | ||
310 | /* CIR Wake byte comparison tolerance */ | 313 | /* CIR Wake byte comparison tolerance */ |
311 | #define CIR_WAKE_CMP_TOLERANCE 5 | 314 | #define CIR_WAKE_CMP_TOLERANCE 5 |
312 | 315 | ||
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 512a2f4ada0e..5b4422ef4e6d 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -850,7 +850,7 @@ static ssize_t store_protocols(struct device *device, | |||
850 | count++; | 850 | count++; |
851 | } else { | 851 | } else { |
852 | for (i = 0; i < ARRAY_SIZE(proto_names); i++) { | 852 | for (i = 0; i < ARRAY_SIZE(proto_names); i++) { |
853 | if (!strncasecmp(tmp, proto_names[i].name, strlen(proto_names[i].name))) { | 853 | if (!strcasecmp(tmp, proto_names[i].name)) { |
854 | tmp += strlen(proto_names[i].name); | 854 | tmp += strlen(proto_names[i].name); |
855 | mask = proto_names[i].type; | 855 | mask = proto_names[i].type; |
856 | break; | 856 | break; |
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index e41e4ad5cc40..9c475c600fc9 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c | |||
@@ -1758,7 +1758,12 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
1758 | if (rc < 0) | 1758 | if (rc < 0) |
1759 | return rc; | 1759 | return rc; |
1760 | 1760 | ||
1761 | return videobuf_reqbufs(&fh->vb_vidq, rb); | 1761 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1762 | rc = videobuf_reqbufs(&fh->vb_vidq, rb); | ||
1763 | else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | ||
1764 | rc = videobuf_reqbufs(&fh->vb_vbiq, rb); | ||
1765 | |||
1766 | return rc; | ||
1762 | } | 1767 | } |
1763 | 1768 | ||
1764 | static int vidioc_querybuf(struct file *file, void *priv, | 1769 | static int vidioc_querybuf(struct file *file, void *priv, |
@@ -1772,7 +1777,12 @@ static int vidioc_querybuf(struct file *file, void *priv, | |||
1772 | if (rc < 0) | 1777 | if (rc < 0) |
1773 | return rc; | 1778 | return rc; |
1774 | 1779 | ||
1775 | return videobuf_querybuf(&fh->vb_vidq, b); | 1780 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1781 | rc = videobuf_querybuf(&fh->vb_vidq, b); | ||
1782 | else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | ||
1783 | rc = videobuf_querybuf(&fh->vb_vbiq, b); | ||
1784 | |||
1785 | return rc; | ||
1776 | } | 1786 | } |
1777 | 1787 | ||
1778 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) | 1788 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
@@ -1785,7 +1795,12 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1785 | if (rc < 0) | 1795 | if (rc < 0) |
1786 | return rc; | 1796 | return rc; |
1787 | 1797 | ||
1788 | return videobuf_qbuf(&fh->vb_vidq, b); | 1798 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1799 | rc = videobuf_qbuf(&fh->vb_vidq, b); | ||
1800 | else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | ||
1801 | rc = videobuf_qbuf(&fh->vb_vbiq, b); | ||
1802 | |||
1803 | return rc; | ||
1789 | } | 1804 | } |
1790 | 1805 | ||
1791 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | 1806 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
@@ -1806,7 +1821,12 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1806 | dev->greenscreen_detected = 0; | 1821 | dev->greenscreen_detected = 0; |
1807 | } | 1822 | } |
1808 | 1823 | ||
1809 | return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); | 1824 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1825 | rc = videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); | ||
1826 | else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | ||
1827 | rc = videobuf_dqbuf(&fh->vb_vbiq, b, file->f_flags & O_NONBLOCK); | ||
1828 | |||
1829 | return rc; | ||
1810 | } | 1830 | } |
1811 | 1831 | ||
1812 | static struct v4l2_file_operations au0828_v4l_fops = { | 1832 | static struct v4l2_file_operations au0828_v4l_fops = { |
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c index 87177733cf92..68ad1963f421 100644 --- a/drivers/media/video/cx18/cx18-cards.c +++ b/drivers/media/video/cx18/cx18-cards.c | |||
@@ -95,6 +95,53 @@ static const struct cx18_card cx18_card_hvr1600_esmt = { | |||
95 | .i2c = &cx18_i2c_std, | 95 | .i2c = &cx18_i2c_std, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static const struct cx18_card cx18_card_hvr1600_s5h1411 = { | ||
99 | .type = CX18_CARD_HVR_1600_S5H1411, | ||
100 | .name = "Hauppauge HVR-1600", | ||
101 | .comment = "Simultaneous Digital and Analog TV capture supported\n", | ||
102 | .v4l2_capabilities = CX18_CAP_ENCODER, | ||
103 | .hw_audio_ctrl = CX18_HW_418_AV, | ||
104 | .hw_muxer = CX18_HW_CS5345, | ||
105 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER | | ||
106 | CX18_HW_CS5345 | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL | | ||
107 | CX18_HW_Z8F0811_IR_HAUP, | ||
108 | .video_inputs = { | ||
109 | { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE7 }, | ||
110 | { CX18_CARD_INPUT_SVIDEO1, 1, CX18_AV_SVIDEO1 }, | ||
111 | { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE3 }, | ||
112 | { CX18_CARD_INPUT_SVIDEO2, 2, CX18_AV_SVIDEO2 }, | ||
113 | { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE4 }, | ||
114 | }, | ||
115 | .audio_inputs = { | ||
116 | { CX18_CARD_INPUT_AUD_TUNER, | ||
117 | CX18_AV_AUDIO8, CS5345_IN_1 | CS5345_MCLK_1_5 }, | ||
118 | { CX18_CARD_INPUT_LINE_IN1, | ||
119 | CX18_AV_AUDIO_SERIAL1, CS5345_IN_2 }, | ||
120 | { CX18_CARD_INPUT_LINE_IN2, | ||
121 | CX18_AV_AUDIO_SERIAL1, CS5345_IN_3 }, | ||
122 | }, | ||
123 | .radio_input = { CX18_CARD_INPUT_AUD_TUNER, | ||
124 | CX18_AV_AUDIO_SERIAL1, CS5345_IN_4 }, | ||
125 | .ddr = { | ||
126 | /* ESMT M13S128324A-5B memory */ | ||
127 | .chip_config = 0x003, | ||
128 | .refresh = 0x30c, | ||
129 | .timing1 = 0x44220e82, | ||
130 | .timing2 = 0x08, | ||
131 | .tune_lane = 0, | ||
132 | .initial_emrs = 0, | ||
133 | }, | ||
134 | .gpio_init.initial_value = 0x3001, | ||
135 | .gpio_init.direction = 0x3001, | ||
136 | .gpio_i2c_slave_reset = { | ||
137 | .active_lo_mask = 0x3001, | ||
138 | .msecs_asserted = 10, | ||
139 | .msecs_recovery = 40, | ||
140 | .ir_reset_mask = 0x0001, | ||
141 | }, | ||
142 | .i2c = &cx18_i2c_std, | ||
143 | }; | ||
144 | |||
98 | static const struct cx18_card cx18_card_hvr1600_samsung = { | 145 | static const struct cx18_card cx18_card_hvr1600_samsung = { |
99 | .type = CX18_CARD_HVR_1600_SAMSUNG, | 146 | .type = CX18_CARD_HVR_1600_SAMSUNG, |
100 | .name = "Hauppauge HVR-1600 (Preproduction)", | 147 | .name = "Hauppauge HVR-1600 (Preproduction)", |
@@ -523,7 +570,8 @@ static const struct cx18_card *cx18_card_list[] = { | |||
523 | &cx18_card_toshiba_qosmio_dvbt, | 570 | &cx18_card_toshiba_qosmio_dvbt, |
524 | &cx18_card_leadtek_pvr2100, | 571 | &cx18_card_leadtek_pvr2100, |
525 | &cx18_card_leadtek_dvr3100h, | 572 | &cx18_card_leadtek_dvr3100h, |
526 | &cx18_card_gotview_dvd3 | 573 | &cx18_card_gotview_dvd3, |
574 | &cx18_card_hvr1600_s5h1411 | ||
527 | }; | 575 | }; |
528 | 576 | ||
529 | const struct cx18_card *cx18_get_card(u16 index) | 577 | const struct cx18_card *cx18_get_card(u16 index) |
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 944af8adbe0c..b1c3cbd92743 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -157,6 +157,7 @@ MODULE_PARM_DESC(cardtype, | |||
157 | "\t\t\t 7 = Leadtek WinFast PVR2100\n" | 157 | "\t\t\t 7 = Leadtek WinFast PVR2100\n" |
158 | "\t\t\t 8 = Leadtek WinFast DVR3100 H\n" | 158 | "\t\t\t 8 = Leadtek WinFast DVR3100 H\n" |
159 | "\t\t\t 9 = GoTView PCI DVD3 Hybrid\n" | 159 | "\t\t\t 9 = GoTView PCI DVD3 Hybrid\n" |
160 | "\t\t\t 10 = Hauppauge HVR 1600 (S5H1411)\n" | ||
160 | "\t\t\t 0 = Autodetect (default)\n" | 161 | "\t\t\t 0 = Autodetect (default)\n" |
161 | "\t\t\t-1 = Ignore this card\n\t\t"); | 162 | "\t\t\t-1 = Ignore this card\n\t\t"); |
162 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); | 163 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); |
@@ -337,6 +338,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) | |||
337 | switch (cx->card->type) { | 338 | switch (cx->card->type) { |
338 | case CX18_CARD_HVR_1600_ESMT: | 339 | case CX18_CARD_HVR_1600_ESMT: |
339 | case CX18_CARD_HVR_1600_SAMSUNG: | 340 | case CX18_CARD_HVR_1600_SAMSUNG: |
341 | case CX18_CARD_HVR_1600_S5H1411: | ||
340 | tveeprom_hauppauge_analog(&c, tv, eedata); | 342 | tveeprom_hauppauge_analog(&c, tv, eedata); |
341 | break; | 343 | break; |
342 | case CX18_CARD_YUAN_MPC718: | 344 | case CX18_CARD_YUAN_MPC718: |
@@ -365,7 +367,25 @@ static void cx18_process_eeprom(struct cx18 *cx) | |||
365 | from the model number. Use the cardtype module option if you | 367 | from the model number. Use the cardtype module option if you |
366 | have one of these preproduction models. */ | 368 | have one of these preproduction models. */ |
367 | switch (tv.model) { | 369 | switch (tv.model) { |
368 | case 74000 ... 74999: | 370 | case 74301: /* Retail models */ |
371 | case 74321: | ||
372 | case 74351: /* OEM models */ | ||
373 | case 74361: | ||
374 | /* Digital side is s5h1411/tda18271 */ | ||
375 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_S5H1411); | ||
376 | break; | ||
377 | case 74021: /* Retail models */ | ||
378 | case 74031: | ||
379 | case 74041: | ||
380 | case 74141: | ||
381 | case 74541: /* OEM models */ | ||
382 | case 74551: | ||
383 | case 74591: | ||
384 | case 74651: | ||
385 | case 74691: | ||
386 | case 74751: | ||
387 | case 74891: | ||
388 | /* Digital side is s5h1409/mxl5005s */ | ||
369 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); | 389 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
370 | break; | 390 | break; |
371 | case 0x718: | 391 | case 0x718: |
@@ -377,7 +397,8 @@ static void cx18_process_eeprom(struct cx18 *cx) | |||
377 | CX18_ERR("Invalid EEPROM\n"); | 397 | CX18_ERR("Invalid EEPROM\n"); |
378 | return; | 398 | return; |
379 | default: | 399 | default: |
380 | CX18_ERR("Unknown model %d, defaulting to HVR-1600\n", tv.model); | 400 | CX18_ERR("Unknown model %d, defaulting to original HVR-1600 " |
401 | "(cardtype=1)\n", tv.model); | ||
381 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); | 402 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
382 | break; | 403 | break; |
383 | } | 404 | } |
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 306caac6d3fc..f736679d2517 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -85,7 +85,8 @@ | |||
85 | #define CX18_CARD_LEADTEK_PVR2100 6 /* Leadtek WinFast PVR2100 */ | 85 | #define CX18_CARD_LEADTEK_PVR2100 6 /* Leadtek WinFast PVR2100 */ |
86 | #define CX18_CARD_LEADTEK_DVR3100H 7 /* Leadtek WinFast DVR3100 H */ | 86 | #define CX18_CARD_LEADTEK_DVR3100H 7 /* Leadtek WinFast DVR3100 H */ |
87 | #define CX18_CARD_GOTVIEW_PCI_DVD3 8 /* GoTView PCI DVD3 Hybrid */ | 87 | #define CX18_CARD_GOTVIEW_PCI_DVD3 8 /* GoTView PCI DVD3 Hybrid */ |
88 | #define CX18_CARD_LAST 8 | 88 | #define CX18_CARD_HVR_1600_S5H1411 9 /* Hauppauge HVR 1600 s5h1411/tda18271*/ |
89 | #define CX18_CARD_LAST 9 | ||
89 | 90 | ||
90 | #define CX18_ENC_STREAM_TYPE_MPG 0 | 91 | #define CX18_ENC_STREAM_TYPE_MPG 0 |
91 | #define CX18_ENC_STREAM_TYPE_TS 1 | 92 | #define CX18_ENC_STREAM_TYPE_TS 1 |
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index f0381d62518d..f41922bd4020 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include "cx18-gpio.h" | 29 | #include "cx18-gpio.h" |
30 | #include "s5h1409.h" | 30 | #include "s5h1409.h" |
31 | #include "mxl5005s.h" | 31 | #include "mxl5005s.h" |
32 | #include "s5h1411.h" | ||
33 | #include "tda18271.h" | ||
32 | #include "zl10353.h" | 34 | #include "zl10353.h" |
33 | 35 | ||
34 | #include <linux/firmware.h> | 36 | #include <linux/firmware.h> |
@@ -77,6 +79,32 @@ static struct s5h1409_config hauppauge_hvr1600_config = { | |||
77 | }; | 79 | }; |
78 | 80 | ||
79 | /* | 81 | /* |
82 | * CX18_CARD_HVR_1600_S5H1411 | ||
83 | */ | ||
84 | static struct s5h1411_config hcw_s5h1411_config = { | ||
85 | .output_mode = S5H1411_SERIAL_OUTPUT, | ||
86 | .gpio = S5H1411_GPIO_OFF, | ||
87 | .vsb_if = S5H1411_IF_44000, | ||
88 | .qam_if = S5H1411_IF_4000, | ||
89 | .inversion = S5H1411_INVERSION_ON, | ||
90 | .status_mode = S5H1411_DEMODLOCKING, | ||
91 | .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | ||
92 | }; | ||
93 | |||
94 | static struct tda18271_std_map hauppauge_tda18271_std_map = { | ||
95 | .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3, | ||
96 | .if_lvl = 6, .rfagc_top = 0x37 }, | ||
97 | .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0, | ||
98 | .if_lvl = 6, .rfagc_top = 0x37 }, | ||
99 | }; | ||
100 | |||
101 | static struct tda18271_config hauppauge_tda18271_config = { | ||
102 | .std_map = &hauppauge_tda18271_std_map, | ||
103 | .gate = TDA18271_GATE_DIGITAL, | ||
104 | .output_opt = TDA18271_OUTPUT_LT_OFF, | ||
105 | }; | ||
106 | |||
107 | /* | ||
80 | * CX18_CARD_LEADTEK_DVR3100H | 108 | * CX18_CARD_LEADTEK_DVR3100H |
81 | */ | 109 | */ |
82 | /* Information/confirmation of proper config values provided by Terry Wu */ | 110 | /* Information/confirmation of proper config values provided by Terry Wu */ |
@@ -244,6 +272,7 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) | |||
244 | switch (cx->card->type) { | 272 | switch (cx->card->type) { |
245 | case CX18_CARD_HVR_1600_ESMT: | 273 | case CX18_CARD_HVR_1600_ESMT: |
246 | case CX18_CARD_HVR_1600_SAMSUNG: | 274 | case CX18_CARD_HVR_1600_SAMSUNG: |
275 | case CX18_CARD_HVR_1600_S5H1411: | ||
247 | v = cx18_read_reg(cx, CX18_REG_DMUX_NUM_PORT_0_CONTROL); | 276 | v = cx18_read_reg(cx, CX18_REG_DMUX_NUM_PORT_0_CONTROL); |
248 | v |= 0x00400000; /* Serial Mode */ | 277 | v |= 0x00400000; /* Serial Mode */ |
249 | v |= 0x00002000; /* Data Length - Byte */ | 278 | v |= 0x00002000; /* Data Length - Byte */ |
@@ -455,6 +484,15 @@ static int dvb_register(struct cx18_stream *stream) | |||
455 | ret = 0; | 484 | ret = 0; |
456 | } | 485 | } |
457 | break; | 486 | break; |
487 | case CX18_CARD_HVR_1600_S5H1411: | ||
488 | dvb->fe = dvb_attach(s5h1411_attach, | ||
489 | &hcw_s5h1411_config, | ||
490 | &cx->i2c_adap[0]); | ||
491 | if (dvb->fe != NULL) | ||
492 | dvb_attach(tda18271_attach, dvb->fe, | ||
493 | 0x60, &cx->i2c_adap[0], | ||
494 | &hauppauge_tda18271_config); | ||
495 | break; | ||
458 | case CX18_CARD_LEADTEK_DVR3100H: | 496 | case CX18_CARD_LEADTEK_DVR3100H: |
459 | dvb->fe = dvb_attach(zl10353_attach, | 497 | dvb->fe = dvb_attach(zl10353_attach, |
460 | &leadtek_dvr3100h_demod, | 498 | &leadtek_dvr3100h_demod, |
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c index ed3d8f55029b..307ff543c254 100644 --- a/drivers/media/video/cx23885/cx23885-i2c.c +++ b/drivers/media/video/cx23885/cx23885-i2c.c | |||
@@ -122,10 +122,6 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
122 | 122 | ||
123 | if (!i2c_wait_done(i2c_adap)) | 123 | if (!i2c_wait_done(i2c_adap)) |
124 | goto eio; | 124 | goto eio; |
125 | if (!i2c_slave_did_ack(i2c_adap)) { | ||
126 | retval = -ENXIO; | ||
127 | goto err; | ||
128 | } | ||
129 | if (i2c_debug) { | 125 | if (i2c_debug) { |
130 | printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); | 126 | printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); |
131 | if (!(ctrl & I2C_NOSTOP)) | 127 | if (!(ctrl & I2C_NOSTOP)) |
@@ -158,7 +154,6 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
158 | 154 | ||
159 | eio: | 155 | eio: |
160 | retval = -EIO; | 156 | retval = -EIO; |
161 | err: | ||
162 | if (i2c_debug) | 157 | if (i2c_debug) |
163 | printk(KERN_ERR " ERR: %d\n", retval); | 158 | printk(KERN_ERR " ERR: %d\n", retval); |
164 | return retval; | 159 | return retval; |
@@ -209,10 +204,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
209 | 204 | ||
210 | if (!i2c_wait_done(i2c_adap)) | 205 | if (!i2c_wait_done(i2c_adap)) |
211 | goto eio; | 206 | goto eio; |
212 | if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) { | ||
213 | retval = -ENXIO; | ||
214 | goto err; | ||
215 | } | ||
216 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; | 207 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; |
217 | if (i2c_debug) { | 208 | if (i2c_debug) { |
218 | dprintk(1, " %02x", msg->buf[cnt]); | 209 | dprintk(1, " %02x", msg->buf[cnt]); |
@@ -224,7 +215,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
224 | 215 | ||
225 | eio: | 216 | eio: |
226 | retval = -EIO; | 217 | retval = -EIO; |
227 | err: | ||
228 | if (i2c_debug) | 218 | if (i2c_debug) |
229 | printk(KERN_ERR " ERR: %d\n", retval); | 219 | printk(KERN_ERR " ERR: %d\n", retval); |
230 | return retval; | 220 | return retval; |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 6fc09dd41b9d..35796e035247 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -2015,7 +2015,8 @@ static int cx25840_probe(struct i2c_client *client, | |||
2015 | kfree(state); | 2015 | kfree(state); |
2016 | return err; | 2016 | return err; |
2017 | } | 2017 | } |
2018 | v4l2_ctrl_cluster(2, &state->volume); | 2018 | if (!is_cx2583x(state)) |
2019 | v4l2_ctrl_cluster(2, &state->volume); | ||
2019 | v4l2_ctrl_handler_setup(&state->hdl); | 2020 | v4l2_ctrl_handler_setup(&state->hdl); |
2020 | 2021 | ||
2021 | if (client->dev.platform_data) { | 2022 | if (client->dev.platform_data) { |
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index 9b4faf009196..9c29e964d400 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
@@ -628,22 +628,66 @@ static void ivtv_irq_enc_pio_complete(struct ivtv *itv) | |||
628 | static void ivtv_irq_dma_err(struct ivtv *itv) | 628 | static void ivtv_irq_dma_err(struct ivtv *itv) |
629 | { | 629 | { |
630 | u32 data[CX2341X_MBOX_MAX_DATA]; | 630 | u32 data[CX2341X_MBOX_MAX_DATA]; |
631 | u32 status; | ||
631 | 632 | ||
632 | del_timer(&itv->dma_timer); | 633 | del_timer(&itv->dma_timer); |
634 | |||
633 | ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, 2, data); | 635 | ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, 2, data); |
636 | status = read_reg(IVTV_REG_DMASTATUS); | ||
634 | IVTV_DEBUG_WARN("DMA ERROR %08x %08x %08x %d\n", data[0], data[1], | 637 | IVTV_DEBUG_WARN("DMA ERROR %08x %08x %08x %d\n", data[0], data[1], |
635 | read_reg(IVTV_REG_DMASTATUS), itv->cur_dma_stream); | 638 | status, itv->cur_dma_stream); |
636 | write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS); | 639 | /* |
640 | * We do *not* write back to the IVTV_REG_DMASTATUS register to | ||
641 | * clear the error status, if either the encoder write (0x02) or | ||
642 | * decoder read (0x01) bus master DMA operation do not indicate | ||
643 | * completed. We can race with the DMA engine, which may have | ||
644 | * transitioned to completed status *after* we read the register. | ||
645 | * Setting a IVTV_REG_DMASTATUS flag back to "busy" status, after the | ||
646 | * DMA engine has completed, will cause the DMA engine to stop working. | ||
647 | */ | ||
648 | status &= 0x3; | ||
649 | if (status == 0x3) | ||
650 | write_reg(status, IVTV_REG_DMASTATUS); | ||
651 | |||
637 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) && | 652 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) && |
638 | itv->cur_dma_stream >= 0 && itv->cur_dma_stream < IVTV_MAX_STREAMS) { | 653 | itv->cur_dma_stream >= 0 && itv->cur_dma_stream < IVTV_MAX_STREAMS) { |
639 | struct ivtv_stream *s = &itv->streams[itv->cur_dma_stream]; | 654 | struct ivtv_stream *s = &itv->streams[itv->cur_dma_stream]; |
640 | 655 | ||
641 | /* retry */ | 656 | if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) { |
642 | if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) | 657 | /* retry */ |
658 | /* | ||
659 | * FIXME - handle cases of DMA error similar to | ||
660 | * encoder below, except conditioned on status & 0x1 | ||
661 | */ | ||
643 | ivtv_dma_dec_start(s); | 662 | ivtv_dma_dec_start(s); |
644 | else | 663 | return; |
645 | ivtv_dma_enc_start(s); | 664 | } else { |
646 | return; | 665 | if ((status & 0x2) == 0) { |
666 | /* | ||
667 | * CX2341x Bus Master DMA write is ongoing. | ||
668 | * Reset the timer and let it complete. | ||
669 | */ | ||
670 | itv->dma_timer.expires = | ||
671 | jiffies + msecs_to_jiffies(600); | ||
672 | add_timer(&itv->dma_timer); | ||
673 | return; | ||
674 | } | ||
675 | |||
676 | if (itv->dma_retries < 3) { | ||
677 | /* | ||
678 | * CX2341x Bus Master DMA write has ended. | ||
679 | * Retry the write, starting with the first | ||
680 | * xfer segment. Just retrying the current | ||
681 | * segment is not sufficient. | ||
682 | */ | ||
683 | s->sg_processed = 0; | ||
684 | itv->dma_retries++; | ||
685 | ivtv_dma_enc_start_xfer(s); | ||
686 | return; | ||
687 | } | ||
688 | /* Too many retries, give up on this one */ | ||
689 | } | ||
690 | |||
647 | } | 691 | } |
648 | if (test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { | 692 | if (test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { |
649 | ivtv_udma_start(itv); | 693 | ivtv_udma_start(itv); |
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index c179041d91f8..e7e717800ee2 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
@@ -1011,7 +1011,6 @@ static int m2mtest_remove(struct platform_device *pdev) | |||
1011 | v4l2_m2m_release(dev->m2m_dev); | 1011 | v4l2_m2m_release(dev->m2m_dev); |
1012 | del_timer_sync(&dev->timer); | 1012 | del_timer_sync(&dev->timer); |
1013 | video_unregister_device(dev->vfd); | 1013 | video_unregister_device(dev->vfd); |
1014 | video_device_release(dev->vfd); | ||
1015 | v4l2_device_unregister(&dev->v4l2_dev); | 1014 | v4l2_device_unregister(&dev->v4l2_dev); |
1016 | kfree(dev); | 1015 | kfree(dev); |
1017 | 1016 | ||
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index b63f8cafa671..561909b65ce6 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/usb.h> | 57 | #include <linux/usb.h> |
58 | 58 | ||
59 | #define S2255_MAJOR_VERSION 1 | 59 | #define S2255_MAJOR_VERSION 1 |
60 | #define S2255_MINOR_VERSION 20 | 60 | #define S2255_MINOR_VERSION 21 |
61 | #define S2255_RELEASE 0 | 61 | #define S2255_RELEASE 0 |
62 | #define S2255_VERSION KERNEL_VERSION(S2255_MAJOR_VERSION, \ | 62 | #define S2255_VERSION KERNEL_VERSION(S2255_MAJOR_VERSION, \ |
63 | S2255_MINOR_VERSION, \ | 63 | S2255_MINOR_VERSION, \ |
@@ -312,9 +312,9 @@ struct s2255_fh { | |||
312 | }; | 312 | }; |
313 | 313 | ||
314 | /* current cypress EEPROM firmware version */ | 314 | /* current cypress EEPROM firmware version */ |
315 | #define S2255_CUR_USB_FWVER ((3 << 8) | 6) | 315 | #define S2255_CUR_USB_FWVER ((3 << 8) | 11) |
316 | /* current DSP FW version */ | 316 | /* current DSP FW version */ |
317 | #define S2255_CUR_DSP_FWVER 8 | 317 | #define S2255_CUR_DSP_FWVER 10102 |
318 | /* Need DSP version 5+ for video status feature */ | 318 | /* Need DSP version 5+ for video status feature */ |
319 | #define S2255_MIN_DSP_STATUS 5 | 319 | #define S2255_MIN_DSP_STATUS 5 |
320 | #define S2255_MIN_DSP_COLORFILTER 8 | 320 | #define S2255_MIN_DSP_COLORFILTER 8 |
@@ -492,9 +492,11 @@ static void planar422p_to_yuv_packed(const unsigned char *in, | |||
492 | 492 | ||
493 | static void s2255_reset_dsppower(struct s2255_dev *dev) | 493 | static void s2255_reset_dsppower(struct s2255_dev *dev) |
494 | { | 494 | { |
495 | s2255_vendor_req(dev, 0x40, 0x0b0b, 0x0b0b, NULL, 0, 1); | 495 | s2255_vendor_req(dev, 0x40, 0x0b0b, 0x0b01, NULL, 0, 1); |
496 | msleep(10); | 496 | msleep(10); |
497 | s2255_vendor_req(dev, 0x50, 0x0000, 0x0000, NULL, 0, 1); | 497 | s2255_vendor_req(dev, 0x50, 0x0000, 0x0000, NULL, 0, 1); |
498 | msleep(600); | ||
499 | s2255_vendor_req(dev, 0x10, 0x0000, 0x0000, NULL, 0, 1); | ||
498 | return; | 500 | return; |
499 | } | 501 | } |
500 | 502 | ||
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 6a1f94042612..c45e6305b26f 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -143,9 +143,9 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
143 | unsigned long flags; | 143 | unsigned long flags; |
144 | struct asic3 *asic; | 144 | struct asic3 *asic; |
145 | 145 | ||
146 | desc->chip->ack(irq); | 146 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
147 | 147 | ||
148 | asic = desc->handler_data; | 148 | asic = get_irq_data(irq); |
149 | 149 | ||
150 | for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { | 150 | for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { |
151 | u32 status; | 151 | u32 status; |
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c index 33c923d215c7..fdd8a1b8bc67 100644 --- a/drivers/mfd/davinci_voicecodec.c +++ b/drivers/mfd/davinci_voicecodec.c | |||
@@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
118 | 118 | ||
119 | /* Voice codec interface client */ | 119 | /* Voice codec interface client */ |
120 | cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; | 120 | cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; |
121 | cell->name = "davinci_vcif"; | 121 | cell->name = "davinci-vcif"; |
122 | cell->driver_data = davinci_vc; | 122 | cell->driver_data = davinci_vc; |
123 | 123 | ||
124 | /* Voice codec CQ93VC client */ | 124 | /* Voice codec CQ93VC client */ |
125 | cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; | 125 | cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; |
126 | cell->name = "cq93vc"; | 126 | cell->name = "cq93vc-codec"; |
127 | cell->driver_data = davinci_vc; | 127 | cell->driver_data = davinci_vc; |
128 | 128 | ||
129 | ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, | 129 | ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, |
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index 627cf577b16d..e9018d1394ee 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
@@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client, | |||
150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, | 150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, |
151 | int len, uint8_t *val) | 151 | int len, uint8_t *val) |
152 | { | 152 | { |
153 | int ret; | 153 | int ret, i; |
154 | 154 | ||
155 | ret = i2c_smbus_write_i2c_block_data(client, reg, len, val); | 155 | for (i = 0; i < len; i++) { |
156 | if (ret < 0) { | 156 | ret = __tps6586x_write(client, reg + i, *(val + i)); |
157 | dev_err(&client->dev, "failed writings to 0x%02x\n", reg); | 157 | if (ret < 0) |
158 | return ret; | 158 | return ret; |
159 | } | 159 | } |
160 | 160 | ||
161 | return 0; | 161 | return 0; |
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 000cb414a78a..92b85e28a15e 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c | |||
@@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) | |||
385 | idev->close = ucb1x00_ts_close; | 385 | idev->close = ucb1x00_ts_close; |
386 | 386 | ||
387 | __set_bit(EV_ABS, idev->evbit); | 387 | __set_bit(EV_ABS, idev->evbit); |
388 | __set_bit(ABS_X, idev->absbit); | ||
389 | __set_bit(ABS_Y, idev->absbit); | ||
390 | __set_bit(ABS_PRESSURE, idev->absbit); | ||
391 | 388 | ||
392 | input_set_drvdata(idev, ts); | 389 | input_set_drvdata(idev, ts); |
393 | 390 | ||
391 | ucb1x00_adc_enable(ts->ucb); | ||
392 | ts->x_res = ucb1x00_ts_read_xres(ts); | ||
393 | ts->y_res = ucb1x00_ts_read_yres(ts); | ||
394 | ucb1x00_adc_disable(ts->ucb); | ||
395 | |||
396 | input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0); | ||
397 | input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0); | ||
398 | input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0); | ||
399 | |||
394 | err = input_register_device(idev); | 400 | err = input_register_device(idev); |
395 | if (err) | 401 | if (err) |
396 | goto fail; | 402 | goto fail; |
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 41233c7fa581..f4016a075fd6 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev) | |||
246 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | 246 | struct wm8994 *wm8994 = dev_get_drvdata(dev); |
247 | int ret; | 247 | int ret; |
248 | 248 | ||
249 | /* Don't actually go through with the suspend if the CODEC is | ||
250 | * still active (eg, for audio passthrough from CP. */ | ||
251 | ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1); | ||
252 | if (ret < 0) { | ||
253 | dev_err(dev, "Failed to read power status: %d\n", ret); | ||
254 | } else if (ret & WM8994_VMID_SEL_MASK) { | ||
255 | dev_dbg(dev, "CODEC still active, ignoring suspend\n"); | ||
256 | return 0; | ||
257 | } | ||
258 | |||
249 | /* GPIO configuration state is saved here since we may be configuring | 259 | /* GPIO configuration state is saved here since we may be configuring |
250 | * the GPIO alternate functions even if we're not using the gpiolib | 260 | * the GPIO alternate functions even if we're not using the gpiolib |
251 | * driver for them. | 261 | * driver for them. |
@@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev) | |||
261 | if (ret < 0) | 271 | if (ret < 0) |
262 | dev_err(dev, "Failed to save LDO registers: %d\n", ret); | 272 | dev_err(dev, "Failed to save LDO registers: %d\n", ret); |
263 | 273 | ||
274 | wm8994->suspended = true; | ||
275 | |||
264 | ret = regulator_bulk_disable(wm8994->num_supplies, | 276 | ret = regulator_bulk_disable(wm8994->num_supplies, |
265 | wm8994->supplies); | 277 | wm8994->supplies); |
266 | if (ret != 0) { | 278 | if (ret != 0) { |
@@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev) | |||
276 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | 288 | struct wm8994 *wm8994 = dev_get_drvdata(dev); |
277 | int ret; | 289 | int ret; |
278 | 290 | ||
291 | /* We may have lied to the PM core about suspending */ | ||
292 | if (!wm8994->suspended) | ||
293 | return 0; | ||
294 | |||
279 | ret = regulator_bulk_enable(wm8994->num_supplies, | 295 | ret = regulator_bulk_enable(wm8994->num_supplies, |
280 | wm8994->supplies); | 296 | wm8994->supplies); |
281 | if (ret != 0) { | 297 | if (ret != 0) { |
@@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev) | |||
298 | if (ret < 0) | 314 | if (ret < 0) |
299 | dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); | 315 | dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); |
300 | 316 | ||
317 | wm8994->suspended = false; | ||
318 | |||
301 | return 0; | 319 | return 0; |
302 | } | 320 | } |
303 | #endif | 321 | #endif |
diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c index 63ee4c1a5315..b6e1c9a6679e 100644 --- a/drivers/misc/bmp085.c +++ b/drivers/misc/bmp085.c | |||
@@ -449,6 +449,7 @@ static const struct i2c_device_id bmp085_id[] = { | |||
449 | { "bmp085", 0 }, | 449 | { "bmp085", 0 }, |
450 | { } | 450 | { } |
451 | }; | 451 | }; |
452 | MODULE_DEVICE_TABLE(i2c, bmp085_id); | ||
452 | 453 | ||
453 | static struct i2c_driver bmp085_driver = { | 454 | static struct i2c_driver bmp085_driver = { |
454 | .driver = { | 455 | .driver = { |
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 6625c057be05..150b5f3cd401 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1529,7 +1529,7 @@ void mmc_rescan(struct work_struct *work) | |||
1529 | * still present | 1529 | * still present |
1530 | */ | 1530 | */ |
1531 | if (host->bus_ops && host->bus_ops->detect && !host->bus_dead | 1531 | if (host->bus_ops && host->bus_ops->detect && !host->bus_dead |
1532 | && mmc_card_is_removable(host)) | 1532 | && !(host->caps & MMC_CAP_NONREMOVABLE)) |
1533 | host->bus_ops->detect(host); | 1533 | host->bus_ops->detect(host); |
1534 | 1534 | ||
1535 | /* | 1535 | /* |
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 5c4a54d9b6a4..ebc62ad4cc56 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -792,7 +792,6 @@ int mmc_attach_sdio(struct mmc_host *host) | |||
792 | */ | 792 | */ |
793 | mmc_release_host(host); | 793 | mmc_release_host(host); |
794 | err = mmc_add_card(host->card); | 794 | err = mmc_add_card(host->card); |
795 | mmc_claim_host(host); | ||
796 | if (err) | 795 | if (err) |
797 | goto remove_added; | 796 | goto remove_added; |
798 | 797 | ||
@@ -805,12 +804,12 @@ int mmc_attach_sdio(struct mmc_host *host) | |||
805 | goto remove_added; | 804 | goto remove_added; |
806 | } | 805 | } |
807 | 806 | ||
807 | mmc_claim_host(host); | ||
808 | return 0; | 808 | return 0; |
809 | 809 | ||
810 | 810 | ||
811 | remove_added: | 811 | remove_added: |
812 | /* Remove without lock if the device has been added. */ | 812 | /* Remove without lock if the device has been added. */ |
813 | mmc_release_host(host); | ||
814 | mmc_sdio_remove(host); | 813 | mmc_sdio_remove(host); |
815 | mmc_claim_host(host); | 814 | mmc_claim_host(host); |
816 | remove: | 815 | remove: |
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 653c62475cb6..7897d114b290 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * (you will need to reboot afterwards) */ | 22 | * (you will need to reboot afterwards) */ |
23 | /* #define BNX2X_STOP_ON_ERROR */ | 23 | /* #define BNX2X_STOP_ON_ERROR */ |
24 | 24 | ||
25 | #define DRV_MODULE_VERSION "1.62.00-5" | 25 | #define DRV_MODULE_VERSION "1.62.00-6" |
26 | #define DRV_MODULE_RELDATE "2011/01/30" | 26 | #define DRV_MODULE_RELDATE "2011/01/30" |
27 | #define BNX2X_BC_VER 0x040200 | 27 | #define BNX2X_BC_VER 0x040200 |
28 | 28 | ||
@@ -1613,19 +1613,23 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, | |||
1613 | #define BNX2X_BTR 4 | 1613 | #define BNX2X_BTR 4 |
1614 | #define MAX_SPQ_PENDING 8 | 1614 | #define MAX_SPQ_PENDING 8 |
1615 | 1615 | ||
1616 | 1616 | /* CMNG constants, as derived from system spec calculations */ | |
1617 | /* CMNG constants | 1617 | /* default MIN rate in case VNIC min rate is configured to zero - 100Mbps */ |
1618 | derived from lab experiments, and not from system spec calculations !!! */ | 1618 | #define DEF_MIN_RATE 100 |
1619 | #define DEF_MIN_RATE 100 | ||
1620 | /* resolution of the rate shaping timer - 100 usec */ | 1619 | /* resolution of the rate shaping timer - 100 usec */ |
1621 | #define RS_PERIODIC_TIMEOUT_USEC 100 | 1620 | #define RS_PERIODIC_TIMEOUT_USEC 100 |
1622 | /* resolution of fairness algorithm in usecs - | ||
1623 | coefficient for calculating the actual t fair */ | ||
1624 | #define T_FAIR_COEF 10000000 | ||
1625 | /* number of bytes in single QM arbitration cycle - | 1621 | /* number of bytes in single QM arbitration cycle - |
1626 | coefficient for calculating the fairness timer */ | 1622 | * coefficient for calculating the fairness timer */ |
1627 | #define QM_ARB_BYTES 40000 | 1623 | #define QM_ARB_BYTES 160000 |
1628 | #define FAIR_MEM 2 | 1624 | /* resolution of Min algorithm 1:100 */ |
1625 | #define MIN_RES 100 | ||
1626 | /* how many bytes above threshold for the minimal credit of Min algorithm*/ | ||
1627 | #define MIN_ABOVE_THRESH 32768 | ||
1628 | /* Fairness algorithm integration time coefficient - | ||
1629 | * for calculating the actual Tfair */ | ||
1630 | #define T_FAIR_COEF ((MIN_ABOVE_THRESH + QM_ARB_BYTES) * 8 * MIN_RES) | ||
1631 | /* Memory of fairness algorithm . 2 cycles */ | ||
1632 | #define FAIR_MEM 2 | ||
1629 | 1633 | ||
1630 | 1634 | ||
1631 | #define ATTN_NIG_FOR_FUNC (1L << 8) | 1635 | #define ATTN_NIG_FOR_FUNC (1L << 8) |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 710ce5d04c53..93798129061b 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -259,10 +259,44 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, | |||
259 | #endif | 259 | #endif |
260 | } | 260 | } |
261 | 261 | ||
262 | /* Timestamp option length allowed for TPA aggregation: | ||
263 | * | ||
264 | * nop nop kind length echo val | ||
265 | */ | ||
266 | #define TPA_TSTAMP_OPT_LEN 12 | ||
267 | /** | ||
268 | * Calculate the approximate value of the MSS for this | ||
269 | * aggregation using the first packet of it. | ||
270 | * | ||
271 | * @param bp | ||
272 | * @param parsing_flags Parsing flags from the START CQE | ||
273 | * @param len_on_bd Total length of the first packet for the | ||
274 | * aggregation. | ||
275 | */ | ||
276 | static inline u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags, | ||
277 | u16 len_on_bd) | ||
278 | { | ||
279 | /* TPA arrgregation won't have an IP options and TCP options | ||
280 | * other than timestamp. | ||
281 | */ | ||
282 | u16 hdrs_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct tcphdr); | ||
283 | |||
284 | |||
285 | /* Check if there was a TCP timestamp, if there is it's will | ||
286 | * always be 12 bytes length: nop nop kind length echo val. | ||
287 | * | ||
288 | * Otherwise FW would close the aggregation. | ||
289 | */ | ||
290 | if (parsing_flags & PARSING_FLAGS_TIME_STAMP_EXIST_FLAG) | ||
291 | hdrs_len += TPA_TSTAMP_OPT_LEN; | ||
292 | |||
293 | return len_on_bd - hdrs_len; | ||
294 | } | ||
295 | |||
262 | static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | 296 | static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
263 | struct sk_buff *skb, | 297 | struct sk_buff *skb, |
264 | struct eth_fast_path_rx_cqe *fp_cqe, | 298 | struct eth_fast_path_rx_cqe *fp_cqe, |
265 | u16 cqe_idx) | 299 | u16 cqe_idx, u16 parsing_flags) |
266 | { | 300 | { |
267 | struct sw_rx_page *rx_pg, old_rx_pg; | 301 | struct sw_rx_page *rx_pg, old_rx_pg; |
268 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); | 302 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); |
@@ -275,8 +309,8 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
275 | 309 | ||
276 | /* This is needed in order to enable forwarding support */ | 310 | /* This is needed in order to enable forwarding support */ |
277 | if (frag_size) | 311 | if (frag_size) |
278 | skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE, | 312 | skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp, parsing_flags, |
279 | max(frag_size, (u32)len_on_bd)); | 313 | len_on_bd); |
280 | 314 | ||
281 | #ifdef BNX2X_STOP_ON_ERROR | 315 | #ifdef BNX2X_STOP_ON_ERROR |
282 | if (pages > min_t(u32, 8, MAX_SKB_FRAGS)*SGE_PAGE_SIZE*PAGES_PER_SGE) { | 316 | if (pages > min_t(u32, 8, MAX_SKB_FRAGS)*SGE_PAGE_SIZE*PAGES_PER_SGE) { |
@@ -344,6 +378,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
344 | if (likely(new_skb)) { | 378 | if (likely(new_skb)) { |
345 | /* fix ip xsum and give it to the stack */ | 379 | /* fix ip xsum and give it to the stack */ |
346 | /* (no need to map the new skb) */ | 380 | /* (no need to map the new skb) */ |
381 | u16 parsing_flags = | ||
382 | le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags); | ||
347 | 383 | ||
348 | prefetch(skb); | 384 | prefetch(skb); |
349 | prefetch(((char *)(skb)) + L1_CACHE_BYTES); | 385 | prefetch(((char *)(skb)) + L1_CACHE_BYTES); |
@@ -373,9 +409,9 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
373 | } | 409 | } |
374 | 410 | ||
375 | if (!bnx2x_fill_frag_skb(bp, fp, skb, | 411 | if (!bnx2x_fill_frag_skb(bp, fp, skb, |
376 | &cqe->fast_path_cqe, cqe_idx)) { | 412 | &cqe->fast_path_cqe, cqe_idx, |
377 | if ((le16_to_cpu(cqe->fast_path_cqe. | 413 | parsing_flags)) { |
378 | pars_flags.flags) & PARSING_FLAGS_VLAN)) | 414 | if (parsing_flags & PARSING_FLAGS_VLAN) |
379 | __vlan_hwaccel_put_tag(skb, | 415 | __vlan_hwaccel_put_tag(skb, |
380 | le16_to_cpu(cqe->fast_path_cqe. | 416 | le16_to_cpu(cqe->fast_path_cqe. |
381 | vlan_tag)); | 417 | vlan_tag)); |
@@ -703,19 +739,20 @@ u16 bnx2x_get_mf_speed(struct bnx2x *bp) | |||
703 | { | 739 | { |
704 | u16 line_speed = bp->link_vars.line_speed; | 740 | u16 line_speed = bp->link_vars.line_speed; |
705 | if (IS_MF(bp)) { | 741 | if (IS_MF(bp)) { |
706 | u16 maxCfg = (bp->mf_config[BP_VN(bp)] & | 742 | u16 maxCfg = bnx2x_extract_max_cfg(bp, |
707 | FUNC_MF_CFG_MAX_BW_MASK) >> | 743 | bp->mf_config[BP_VN(bp)]); |
708 | FUNC_MF_CFG_MAX_BW_SHIFT; | 744 | |
709 | /* Calculate the current MAX line speed limit for the DCC | 745 | /* Calculate the current MAX line speed limit for the MF |
710 | * capable devices | 746 | * devices |
711 | */ | 747 | */ |
712 | if (IS_MF_SD(bp)) { | 748 | if (IS_MF_SI(bp)) |
749 | line_speed = (line_speed * maxCfg) / 100; | ||
750 | else { /* SD mode */ | ||
713 | u16 vn_max_rate = maxCfg * 100; | 751 | u16 vn_max_rate = maxCfg * 100; |
714 | 752 | ||
715 | if (vn_max_rate < line_speed) | 753 | if (vn_max_rate < line_speed) |
716 | line_speed = vn_max_rate; | 754 | line_speed = vn_max_rate; |
717 | } else /* IS_MF_SI(bp)) */ | 755 | } |
718 | line_speed = (line_speed * maxCfg) / 100; | ||
719 | } | 756 | } |
720 | 757 | ||
721 | return line_speed; | 758 | return line_speed; |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h index 03eb4d68e6bb..326ba44b3ded 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.h +++ b/drivers/net/bnx2x/bnx2x_cmn.h | |||
@@ -1044,4 +1044,24 @@ static inline void storm_memset_cmng(struct bnx2x *bp, | |||
1044 | void bnx2x_acquire_phy_lock(struct bnx2x *bp); | 1044 | void bnx2x_acquire_phy_lock(struct bnx2x *bp); |
1045 | void bnx2x_release_phy_lock(struct bnx2x *bp); | 1045 | void bnx2x_release_phy_lock(struct bnx2x *bp); |
1046 | 1046 | ||
1047 | /** | ||
1048 | * Extracts MAX BW part from MF configuration. | ||
1049 | * | ||
1050 | * @param bp | ||
1051 | * @param mf_cfg | ||
1052 | * | ||
1053 | * @return u16 | ||
1054 | */ | ||
1055 | static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, u32 mf_cfg) | ||
1056 | { | ||
1057 | u16 max_cfg = (mf_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> | ||
1058 | FUNC_MF_CFG_MAX_BW_SHIFT; | ||
1059 | if (!max_cfg) { | ||
1060 | BNX2X_ERR("Illegal configuration detected for Max BW - " | ||
1061 | "using 100 instead\n"); | ||
1062 | max_cfg = 100; | ||
1063 | } | ||
1064 | return max_cfg; | ||
1065 | } | ||
1066 | |||
1047 | #endif /* BNX2X_CMN_H */ | 1067 | #endif /* BNX2X_CMN_H */ |
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c index 5b44a8b48509..ef2919987a10 100644 --- a/drivers/net/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/bnx2x/bnx2x_ethtool.c | |||
@@ -238,7 +238,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
238 | speed |= (cmd->speed_hi << 16); | 238 | speed |= (cmd->speed_hi << 16); |
239 | 239 | ||
240 | if (IS_MF_SI(bp)) { | 240 | if (IS_MF_SI(bp)) { |
241 | u32 param = 0; | 241 | u32 param = 0, part; |
242 | u32 line_speed = bp->link_vars.line_speed; | 242 | u32 line_speed = bp->link_vars.line_speed; |
243 | 243 | ||
244 | /* use 10G if no link detected */ | 244 | /* use 10G if no link detected */ |
@@ -251,9 +251,11 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
251 | REQ_BC_VER_4_SET_MF_BW); | 251 | REQ_BC_VER_4_SET_MF_BW); |
252 | return -EINVAL; | 252 | return -EINVAL; |
253 | } | 253 | } |
254 | if (line_speed < speed) { | 254 | part = (speed * 100) / line_speed; |
255 | BNX2X_DEV_INFO("New speed should be less or equal " | 255 | if (line_speed < speed || !part) { |
256 | "to actual line speed\n"); | 256 | BNX2X_DEV_INFO("Speed setting should be in a range " |
257 | "from 1%% to 100%% " | ||
258 | "of actual line speed\n"); | ||
257 | return -EINVAL; | 259 | return -EINVAL; |
258 | } | 260 | } |
259 | /* load old values */ | 261 | /* load old values */ |
@@ -263,8 +265,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
263 | param &= FUNC_MF_CFG_MIN_BW_MASK; | 265 | param &= FUNC_MF_CFG_MIN_BW_MASK; |
264 | 266 | ||
265 | /* set new MAX value */ | 267 | /* set new MAX value */ |
266 | param |= (((speed * 100) / line_speed) | 268 | param |= (part << FUNC_MF_CFG_MAX_BW_SHIFT) |
267 | << FUNC_MF_CFG_MAX_BW_SHIFT) | ||
268 | & FUNC_MF_CFG_MAX_BW_MASK; | 269 | & FUNC_MF_CFG_MAX_BW_MASK; |
269 | 270 | ||
270 | bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, param); | 271 | bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, param); |
@@ -1781,9 +1782,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp) | |||
1781 | { 0x100, 0x350 }, /* manuf_info */ | 1782 | { 0x100, 0x350 }, /* manuf_info */ |
1782 | { 0x450, 0xf0 }, /* feature_info */ | 1783 | { 0x450, 0xf0 }, /* feature_info */ |
1783 | { 0x640, 0x64 }, /* upgrade_key_info */ | 1784 | { 0x640, 0x64 }, /* upgrade_key_info */ |
1784 | { 0x6a4, 0x64 }, | ||
1785 | { 0x708, 0x70 }, /* manuf_key_info */ | 1785 | { 0x708, 0x70 }, /* manuf_key_info */ |
1786 | { 0x778, 0x70 }, | ||
1787 | { 0, 0 } | 1786 | { 0, 0 } |
1788 | }; | 1787 | }; |
1789 | __be32 buf[0x350 / 4]; | 1788 | __be32 buf[0x350 / 4]; |
@@ -1933,11 +1932,11 @@ static void bnx2x_self_test(struct net_device *dev, | |||
1933 | buf[4] = 1; | 1932 | buf[4] = 1; |
1934 | etest->flags |= ETH_TEST_FL_FAILED; | 1933 | etest->flags |= ETH_TEST_FL_FAILED; |
1935 | } | 1934 | } |
1936 | if (bp->port.pmf) | 1935 | |
1937 | if (bnx2x_link_test(bp, is_serdes) != 0) { | 1936 | if (bnx2x_link_test(bp, is_serdes) != 0) { |
1938 | buf[5] = 1; | 1937 | buf[5] = 1; |
1939 | etest->flags |= ETH_TEST_FL_FAILED; | 1938 | etest->flags |= ETH_TEST_FL_FAILED; |
1940 | } | 1939 | } |
1941 | 1940 | ||
1942 | #ifdef BNX2X_EXTRA_DEBUG | 1941 | #ifdef BNX2X_EXTRA_DEBUG |
1943 | bnx2x_panic_dump(bp); | 1942 | bnx2x_panic_dump(bp); |
diff --git a/drivers/net/bnx2x/bnx2x_init.h b/drivers/net/bnx2x/bnx2x_init.h index 5a268e9a0895..fa6dbe3f2058 100644 --- a/drivers/net/bnx2x/bnx2x_init.h +++ b/drivers/net/bnx2x/bnx2x_init.h | |||
@@ -241,7 +241,7 @@ static const struct { | |||
241 | /* Block IGU, MISC, PXP and PXP2 parity errors as long as we don't | 241 | /* Block IGU, MISC, PXP and PXP2 parity errors as long as we don't |
242 | * want to handle "system kill" flow at the moment. | 242 | * want to handle "system kill" flow at the moment. |
243 | */ | 243 | */ |
244 | BLOCK_PRTY_INFO(PXP, 0x3ffffff, 0x3ffffff, 0x3ffffff, 0x3ffffff), | 244 | BLOCK_PRTY_INFO(PXP, 0x7ffffff, 0x3ffffff, 0x3ffffff, 0x7ffffff), |
245 | BLOCK_PRTY_INFO_0(PXP2, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), | 245 | BLOCK_PRTY_INFO_0(PXP2, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), |
246 | BLOCK_PRTY_INFO_1(PXP2, 0x7ff, 0x7f, 0x7f, 0x7ff), | 246 | BLOCK_PRTY_INFO_1(PXP2, 0x7ff, 0x7f, 0x7f, 0x7ff), |
247 | BLOCK_PRTY_INFO(HC, 0x7, 0x7, 0x7, 0), | 247 | BLOCK_PRTY_INFO(HC, 0x7, 0x7, 0x7, 0), |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index d584d32c747d..032ae184b605 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -1974,13 +1974,22 @@ static void bnx2x_init_vn_minmax(struct bnx2x *bp, int vn) | |||
1974 | vn_max_rate = 0; | 1974 | vn_max_rate = 0; |
1975 | 1975 | ||
1976 | } else { | 1976 | } else { |
1977 | u32 maxCfg = bnx2x_extract_max_cfg(bp, vn_cfg); | ||
1978 | |||
1977 | vn_min_rate = ((vn_cfg & FUNC_MF_CFG_MIN_BW_MASK) >> | 1979 | vn_min_rate = ((vn_cfg & FUNC_MF_CFG_MIN_BW_MASK) >> |
1978 | FUNC_MF_CFG_MIN_BW_SHIFT) * 100; | 1980 | FUNC_MF_CFG_MIN_BW_SHIFT) * 100; |
1979 | /* If min rate is zero - set it to 1 */ | 1981 | /* If fairness is enabled (not all min rates are zeroes) and |
1982 | if current min rate is zero - set it to 1. | ||
1983 | This is a requirement of the algorithm. */ | ||
1980 | if (bp->vn_weight_sum && (vn_min_rate == 0)) | 1984 | if (bp->vn_weight_sum && (vn_min_rate == 0)) |
1981 | vn_min_rate = DEF_MIN_RATE; | 1985 | vn_min_rate = DEF_MIN_RATE; |
1982 | vn_max_rate = ((vn_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> | 1986 | |
1983 | FUNC_MF_CFG_MAX_BW_SHIFT) * 100; | 1987 | if (IS_MF_SI(bp)) |
1988 | /* maxCfg in percents of linkspeed */ | ||
1989 | vn_max_rate = (bp->link_vars.line_speed * maxCfg) / 100; | ||
1990 | else | ||
1991 | /* maxCfg is absolute in 100Mb units */ | ||
1992 | vn_max_rate = maxCfg * 100; | ||
1984 | } | 1993 | } |
1985 | 1994 | ||
1986 | DP(NETIF_MSG_IFUP, | 1995 | DP(NETIF_MSG_IFUP, |
@@ -2006,7 +2015,8 @@ static void bnx2x_init_vn_minmax(struct bnx2x *bp, int vn) | |||
2006 | m_fair_vn.vn_credit_delta = | 2015 | m_fair_vn.vn_credit_delta = |
2007 | max_t(u32, (vn_min_rate * (T_FAIR_COEF / | 2016 | max_t(u32, (vn_min_rate * (T_FAIR_COEF / |
2008 | (8 * bp->vn_weight_sum))), | 2017 | (8 * bp->vn_weight_sum))), |
2009 | (bp->cmng.fair_vars.fair_threshold * 2)); | 2018 | (bp->cmng.fair_vars.fair_threshold + |
2019 | MIN_ABOVE_THRESH)); | ||
2010 | DP(NETIF_MSG_IFUP, "m_fair_vn.vn_credit_delta %d\n", | 2020 | DP(NETIF_MSG_IFUP, "m_fair_vn.vn_credit_delta %d\n", |
2011 | m_fair_vn.vn_credit_delta); | 2021 | m_fair_vn.vn_credit_delta); |
2012 | } | 2022 | } |
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c index bda60d590fa8..3445ded6674f 100644 --- a/drivers/net/bnx2x/bnx2x_stats.c +++ b/drivers/net/bnx2x/bnx2x_stats.c | |||
@@ -1239,14 +1239,14 @@ void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) | |||
1239 | if (unlikely(bp->panic)) | 1239 | if (unlikely(bp->panic)) |
1240 | return; | 1240 | return; |
1241 | 1241 | ||
1242 | bnx2x_stats_stm[bp->stats_state][event].action(bp); | ||
1243 | |||
1242 | /* Protect a state change flow */ | 1244 | /* Protect a state change flow */ |
1243 | spin_lock_bh(&bp->stats_lock); | 1245 | spin_lock_bh(&bp->stats_lock); |
1244 | state = bp->stats_state; | 1246 | state = bp->stats_state; |
1245 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; | 1247 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; |
1246 | spin_unlock_bh(&bp->stats_lock); | 1248 | spin_unlock_bh(&bp->stats_lock); |
1247 | 1249 | ||
1248 | bnx2x_stats_stm[state][event].action(bp); | ||
1249 | |||
1250 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) | 1250 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) |
1251 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", | 1251 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", |
1252 | state, event, bp->stats_state); | 1252 | state, event, bp->stats_state); |
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 5157e15e96eb..aeea9f9ff6e8 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c | |||
@@ -633,6 +633,7 @@ static const struct net_device_ops softing_netdev_ops = { | |||
633 | }; | 633 | }; |
634 | 634 | ||
635 | static const struct can_bittiming_const softing_btr_const = { | 635 | static const struct can_bittiming_const softing_btr_const = { |
636 | .name = "softing", | ||
636 | .tseg1_min = 1, | 637 | .tseg1_min = 1, |
637 | .tseg1_max = 16, | 638 | .tseg1_max = 16, |
638 | .tseg2_min = 1, | 639 | .tseg2_min = 1, |
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 7ff170cbc7dc..302be4aa69d6 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -2760,6 +2760,8 @@ static u32 cnic_service_bnx2_queues(struct cnic_dev *dev) | |||
2760 | u32 status_idx = (u16) *cp->kcq1.status_idx_ptr; | 2760 | u32 status_idx = (u16) *cp->kcq1.status_idx_ptr; |
2761 | int kcqe_cnt; | 2761 | int kcqe_cnt; |
2762 | 2762 | ||
2763 | /* status block index must be read before reading other fields */ | ||
2764 | rmb(); | ||
2763 | cp->kwq_con_idx = *cp->kwq_con_idx_ptr; | 2765 | cp->kwq_con_idx = *cp->kwq_con_idx_ptr; |
2764 | 2766 | ||
2765 | while ((kcqe_cnt = cnic_get_kcqes(dev, &cp->kcq1))) { | 2767 | while ((kcqe_cnt = cnic_get_kcqes(dev, &cp->kcq1))) { |
@@ -2770,6 +2772,8 @@ static u32 cnic_service_bnx2_queues(struct cnic_dev *dev) | |||
2770 | barrier(); | 2772 | barrier(); |
2771 | if (status_idx != *cp->kcq1.status_idx_ptr) { | 2773 | if (status_idx != *cp->kcq1.status_idx_ptr) { |
2772 | status_idx = (u16) *cp->kcq1.status_idx_ptr; | 2774 | status_idx = (u16) *cp->kcq1.status_idx_ptr; |
2775 | /* status block index must be read first */ | ||
2776 | rmb(); | ||
2773 | cp->kwq_con_idx = *cp->kwq_con_idx_ptr; | 2777 | cp->kwq_con_idx = *cp->kwq_con_idx_ptr; |
2774 | } else | 2778 | } else |
2775 | break; | 2779 | break; |
@@ -2888,6 +2892,8 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info) | |||
2888 | u32 last_status = *info->status_idx_ptr; | 2892 | u32 last_status = *info->status_idx_ptr; |
2889 | int kcqe_cnt; | 2893 | int kcqe_cnt; |
2890 | 2894 | ||
2895 | /* status block index must be read before reading the KCQ */ | ||
2896 | rmb(); | ||
2891 | while ((kcqe_cnt = cnic_get_kcqes(dev, info))) { | 2897 | while ((kcqe_cnt = cnic_get_kcqes(dev, info))) { |
2892 | 2898 | ||
2893 | service_kcqes(dev, kcqe_cnt); | 2899 | service_kcqes(dev, kcqe_cnt); |
@@ -2898,6 +2904,8 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info) | |||
2898 | break; | 2904 | break; |
2899 | 2905 | ||
2900 | last_status = *info->status_idx_ptr; | 2906 | last_status = *info->status_idx_ptr; |
2907 | /* status block index must be read before reading the KCQ */ | ||
2908 | rmb(); | ||
2901 | } | 2909 | } |
2902 | return last_status; | 2910 | return last_status; |
2903 | } | 2911 | } |
@@ -2906,26 +2914,35 @@ static void cnic_service_bnx2x_bh(unsigned long data) | |||
2906 | { | 2914 | { |
2907 | struct cnic_dev *dev = (struct cnic_dev *) data; | 2915 | struct cnic_dev *dev = (struct cnic_dev *) data; |
2908 | struct cnic_local *cp = dev->cnic_priv; | 2916 | struct cnic_local *cp = dev->cnic_priv; |
2909 | u32 status_idx; | 2917 | u32 status_idx, new_status_idx; |
2910 | 2918 | ||
2911 | if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags))) | 2919 | if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags))) |
2912 | return; | 2920 | return; |
2913 | 2921 | ||
2914 | status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1); | 2922 | while (1) { |
2923 | status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1); | ||
2915 | 2924 | ||
2916 | CNIC_WR16(dev, cp->kcq1.io_addr, cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); | 2925 | CNIC_WR16(dev, cp->kcq1.io_addr, |
2926 | cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); | ||
2917 | 2927 | ||
2918 | if (BNX2X_CHIP_IS_E2(cp->chip_id)) { | 2928 | if (!BNX2X_CHIP_IS_E2(cp->chip_id)) { |
2919 | status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2); | 2929 | cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID, |
2930 | status_idx, IGU_INT_ENABLE, 1); | ||
2931 | break; | ||
2932 | } | ||
2933 | |||
2934 | new_status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2); | ||
2935 | |||
2936 | if (new_status_idx != status_idx) | ||
2937 | continue; | ||
2920 | 2938 | ||
2921 | CNIC_WR16(dev, cp->kcq2.io_addr, cp->kcq2.sw_prod_idx + | 2939 | CNIC_WR16(dev, cp->kcq2.io_addr, cp->kcq2.sw_prod_idx + |
2922 | MAX_KCQ_IDX); | 2940 | MAX_KCQ_IDX); |
2923 | 2941 | ||
2924 | cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF, | 2942 | cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF, |
2925 | status_idx, IGU_INT_ENABLE, 1); | 2943 | status_idx, IGU_INT_ENABLE, 1); |
2926 | } else { | 2944 | |
2927 | cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID, | 2945 | break; |
2928 | status_idx, IGU_INT_ENABLE, 1); | ||
2929 | } | 2946 | } |
2930 | } | 2947 | } |
2931 | 2948 | ||
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 2a628d17d178..7018bfe408a4 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -1008,7 +1008,7 @@ static void emac_rx_handler(void *token, int len, int status) | |||
1008 | int ret; | 1008 | int ret; |
1009 | 1009 | ||
1010 | /* free and bail if we are shutting down */ | 1010 | /* free and bail if we are shutting down */ |
1011 | if (unlikely(!netif_running(ndev))) { | 1011 | if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { |
1012 | dev_kfree_skb_any(skb); | 1012 | dev_kfree_skb_any(skb); |
1013 | return; | 1013 | return; |
1014 | } | 1014 | } |
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index 9d8a20b72fa9..8318ea06cb6d 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c | |||
@@ -337,8 +337,6 @@ static int dnet_mii_init(struct dnet *bp) | |||
337 | for (i = 0; i < PHY_MAX_ADDR; i++) | 337 | for (i = 0; i < PHY_MAX_ADDR; i++) |
338 | bp->mii_bus->irq[i] = PHY_POLL; | 338 | bp->mii_bus->irq[i] = PHY_POLL; |
339 | 339 | ||
340 | platform_set_drvdata(bp->dev, bp->mii_bus); | ||
341 | |||
342 | if (mdiobus_register(bp->mii_bus)) { | 340 | if (mdiobus_register(bp->mii_bus)) { |
343 | err = -ENXIO; | 341 | err = -ENXIO; |
344 | goto err_out_free_mdio_irq; | 342 | goto err_out_free_mdio_irq; |
@@ -863,6 +861,7 @@ static int __devinit dnet_probe(struct platform_device *pdev) | |||
863 | bp = netdev_priv(dev); | 861 | bp = netdev_priv(dev); |
864 | bp->dev = dev; | 862 | bp->dev = dev; |
865 | 863 | ||
864 | platform_set_drvdata(pdev, dev); | ||
866 | SET_NETDEV_DEV(dev, &pdev->dev); | 865 | SET_NETDEV_DEV(dev, &pdev->dev); |
867 | 866 | ||
868 | spin_lock_init(&bp->lock); | 867 | spin_lock_init(&bp->lock); |
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h index 55c1711f1688..33e7c45a4fe4 100644 --- a/drivers/net/e1000/e1000_osdep.h +++ b/drivers/net/e1000/e1000_osdep.h | |||
@@ -42,7 +42,8 @@ | |||
42 | #define GBE_CONFIG_RAM_BASE \ | 42 | #define GBE_CONFIG_RAM_BASE \ |
43 | ((unsigned int)(CONFIG_RAM_BASE + GBE_CONFIG_OFFSET)) | 43 | ((unsigned int)(CONFIG_RAM_BASE + GBE_CONFIG_OFFSET)) |
44 | 44 | ||
45 | #define GBE_CONFIG_BASE_VIRT phys_to_virt(GBE_CONFIG_RAM_BASE) | 45 | #define GBE_CONFIG_BASE_VIRT \ |
46 | ((void __iomem *)phys_to_virt(GBE_CONFIG_RAM_BASE)) | ||
46 | 47 | ||
47 | #define GBE_CONFIG_FLASH_WRITE(base, offset, count, data) \ | 48 | #define GBE_CONFIG_FLASH_WRITE(base, offset, count, data) \ |
48 | (iowrite16_rep(base + offset, data, count)) | 49 | (iowrite16_rep(base + offset, data, count)) |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 3fa110ddb041..2e5022849f18 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -5967,7 +5967,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5967 | /* APME bit in EEPROM is mapped to WUC.APME */ | 5967 | /* APME bit in EEPROM is mapped to WUC.APME */ |
5968 | eeprom_data = er32(WUC); | 5968 | eeprom_data = er32(WUC); |
5969 | eeprom_apme_mask = E1000_WUC_APME; | 5969 | eeprom_apme_mask = E1000_WUC_APME; |
5970 | if (eeprom_data & E1000_WUC_PHY_WAKE) | 5970 | if ((hw->mac.type > e1000_ich10lan) && |
5971 | (eeprom_data & E1000_WUC_PHY_WAKE)) | ||
5971 | adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP; | 5972 | adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP; |
5972 | } else if (adapter->flags & FLAG_APME_IN_CTRL3) { | 5973 | } else if (adapter->flags & FLAG_APME_IN_CTRL3) { |
5973 | if (adapter->flags & FLAG_APME_CHECK_PORT_B && | 5974 | if (adapter->flags & FLAG_APME_CHECK_PORT_B && |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 2a71373719ae..cd0282d5d40f 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -74,7 +74,8 @@ static struct platform_device_id fec_devtype[] = { | |||
74 | }, { | 74 | }, { |
75 | .name = "imx28-fec", | 75 | .name = "imx28-fec", |
76 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME, | 76 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME, |
77 | } | 77 | }, |
78 | { } | ||
78 | }; | 79 | }; |
79 | 80 | ||
80 | static unsigned char macaddr[ETH_ALEN]; | 81 | static unsigned char macaddr[ETH_ALEN]; |
diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c index 74486a8b009a..af3822f9ea9a 100644 --- a/drivers/net/igbvf/vf.c +++ b/drivers/net/igbvf/vf.c | |||
@@ -220,7 +220,7 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) | |||
220 | * The parameter rar_count will usually be hw->mac.rar_entry_count | 220 | * The parameter rar_count will usually be hw->mac.rar_entry_count |
221 | * unless there are workarounds that change this. | 221 | * unless there are workarounds that change this. |
222 | **/ | 222 | **/ |
223 | void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, | 223 | static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, |
224 | u8 *mc_addr_list, u32 mc_addr_count, | 224 | u8 *mc_addr_list, u32 mc_addr_count, |
225 | u32 rar_used_count, u32 rar_count) | 225 | u32 rar_used_count, u32 rar_count) |
226 | { | 226 | { |
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index f69e73e2191e..79ccb54ab00c 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -260,7 +260,7 @@ static int macb_mii_init(struct macb *bp) | |||
260 | for (i = 0; i < PHY_MAX_ADDR; i++) | 260 | for (i = 0; i < PHY_MAX_ADDR; i++) |
261 | bp->mii_bus->irq[i] = PHY_POLL; | 261 | bp->mii_bus->irq[i] = PHY_POLL; |
262 | 262 | ||
263 | platform_set_drvdata(bp->dev, bp->mii_bus); | 263 | dev_set_drvdata(&bp->dev->dev, bp->mii_bus); |
264 | 264 | ||
265 | if (mdiobus_register(bp->mii_bus)) | 265 | if (mdiobus_register(bp->mii_bus)) |
266 | goto err_out_free_mdio_irq; | 266 | goto err_out_free_mdio_irq; |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 9226cda4d054..530ab5a10bd3 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -691,6 +691,7 @@ static struct pcmcia_device_id fmvj18x_ids[] = { | |||
691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0105, 0x0e0a), | 691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0105, 0x0e0a), |
692 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0e01), | 692 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0e01), |
693 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0a05), | 693 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0a05), |
694 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0b05), | ||
694 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x1101), | 695 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x1101), |
695 | PCMCIA_DEVICE_NULL, | 696 | PCMCIA_DEVICE_NULL, |
696 | }; | 697 | }; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index ef2133b16f8c..7ffdb80adf40 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
27 | #include <linux/firmware.h> | 27 | #include <linux/firmware.h> |
28 | #include <linux/pci-aspm.h> | ||
28 | 29 | ||
29 | #include <asm/system.h> | 30 | #include <asm/system.h> |
30 | #include <asm/io.h> | 31 | #include <asm/io.h> |
@@ -3020,6 +3021,11 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3020 | mii->reg_num_mask = 0x1f; | 3021 | mii->reg_num_mask = 0x1f; |
3021 | mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII); | 3022 | mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII); |
3022 | 3023 | ||
3024 | /* disable ASPM completely as that cause random device stop working | ||
3025 | * problems as well as full system hangs for some PCIe devices users */ | ||
3026 | pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | | ||
3027 | PCIE_LINK_STATE_CLKPM); | ||
3028 | |||
3023 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ | 3029 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ |
3024 | rc = pci_enable_device(pdev); | 3030 | rc = pci_enable_device(pdev); |
3025 | if (rc < 0) { | 3031 | if (rc < 0) { |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 42daf98ba736..35b28f42d208 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3856,9 +3856,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3856 | memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); | 3856 | memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); |
3857 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 3857 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
3858 | 3858 | ||
3859 | /* device is off until link detection */ | ||
3860 | netif_carrier_off(dev); | ||
3861 | |||
3862 | return dev; | 3859 | return dev; |
3863 | } | 3860 | } |
3864 | 3861 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 5ab3084eb9cb..07b1633b7f3f 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -219,8 +219,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) | |||
219 | struct tx_buf *tx_buf = NULL; | 219 | struct tx_buf *tx_buf = NULL; |
220 | struct sk_buff *nskb = NULL; | 220 | struct sk_buff *nskb = NULL; |
221 | int ret = 0, i; | 221 | int ret = 0, i; |
222 | u16 *hdr, tx_skb_cnt = 0; | 222 | u16 tx_skb_cnt = 0; |
223 | u8 *buf; | 223 | u8 *buf; |
224 | __le16 *hdr; | ||
224 | 225 | ||
225 | if (hif_dev->tx.tx_skb_cnt == 0) | 226 | if (hif_dev->tx.tx_skb_cnt == 0) |
226 | return 0; | 227 | return 0; |
@@ -245,9 +246,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) | |||
245 | 246 | ||
246 | buf = tx_buf->buf; | 247 | buf = tx_buf->buf; |
247 | buf += tx_buf->offset; | 248 | buf += tx_buf->offset; |
248 | hdr = (u16 *)buf; | 249 | hdr = (__le16 *)buf; |
249 | *hdr++ = nskb->len; | 250 | *hdr++ = cpu_to_le16(nskb->len); |
250 | *hdr++ = ATH_USB_TX_STREAM_MODE_TAG; | 251 | *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG); |
251 | buf += 4; | 252 | buf += 4; |
252 | memcpy(buf, nskb->data, nskb->len); | 253 | memcpy(buf, nskb->data, nskb->len); |
253 | tx_buf->len = nskb->len + 4; | 254 | tx_buf->len = nskb->len + 4; |
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 180170d3ce25..2915b11edefb 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -885,7 +885,7 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) | |||
885 | struct ath_common *common = ath9k_hw_common(ah); | 885 | struct ath_common *common = ath9k_hw_common(ah); |
886 | 886 | ||
887 | if (!(ints & ATH9K_INT_GLOBAL)) | 887 | if (!(ints & ATH9K_INT_GLOBAL)) |
888 | ath9k_hw_enable_interrupts(ah); | 888 | ath9k_hw_disable_interrupts(ah); |
889 | 889 | ||
890 | ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); | 890 | ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); |
891 | 891 | ||
@@ -963,7 +963,8 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) | |||
963 | REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); | 963 | REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); |
964 | } | 964 | } |
965 | 965 | ||
966 | ath9k_hw_enable_interrupts(ah); | 966 | if (ints & ATH9K_INT_GLOBAL) |
967 | ath9k_hw_enable_interrupts(ah); | ||
967 | 968 | ||
968 | return; | 969 | return; |
969 | } | 970 | } |
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index 537732e5964f..f82c400be288 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c | |||
@@ -118,6 +118,8 @@ static struct usb_device_id carl9170_usb_ids[] = { | |||
118 | { USB_DEVICE(0x057c, 0x8402) }, | 118 | { USB_DEVICE(0x057c, 0x8402) }, |
119 | /* Qwest/Actiontec 802AIN Wireless N USB Network Adapter */ | 119 | /* Qwest/Actiontec 802AIN Wireless N USB Network Adapter */ |
120 | { USB_DEVICE(0x1668, 0x1200) }, | 120 | { USB_DEVICE(0x1668, 0x1200) }, |
121 | /* Airlive X.USB a/b/g/n */ | ||
122 | { USB_DEVICE(0x1b75, 0x9170) }, | ||
121 | 123 | ||
122 | /* terminate */ | 124 | /* terminate */ |
123 | {} | 125 | {} |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 79ab0a6b1386..537fb8c84e3a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "iwl-agn-debugfs.h" | 51 | #include "iwl-agn-debugfs.h" |
52 | 52 | ||
53 | /* Highest firmware API version supported */ | 53 | /* Highest firmware API version supported */ |
54 | #define IWL5000_UCODE_API_MAX 2 | 54 | #define IWL5000_UCODE_API_MAX 5 |
55 | #define IWL5150_UCODE_API_MAX 2 | 55 | #define IWL5150_UCODE_API_MAX 2 |
56 | 56 | ||
57 | /* Lowest firmware API version supported */ | 57 | /* Lowest firmware API version supported */ |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 21713a7638c4..9b344a921e74 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -98,6 +98,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
98 | {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ | 98 | {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ |
99 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 99 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
100 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ | 100 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ |
101 | {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ | ||
101 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 102 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
102 | {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */ | 103 | {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */ |
103 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ | 104 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 848cc2cce247..518542b4bf9e 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -2597,6 +2597,9 @@ static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
2597 | __le32 mode; | 2597 | __le32 mode; |
2598 | int ret; | 2598 | int ret; |
2599 | 2599 | ||
2600 | if (priv->device_type != RNDIS_BCM4320B) | ||
2601 | return -ENOTSUPP; | ||
2602 | |||
2600 | netdev_dbg(usbdev->net, "%s(): %s, %d\n", __func__, | 2603 | netdev_dbg(usbdev->net, "%s(): %s, %d\n", __func__, |
2601 | enabled ? "enabled" : "disabled", | 2604 | enabled ? "enabled" : "disabled", |
2602 | timeout); | 2605 | timeout); |
diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c index 28295d0a50f6..4d87b5dc9284 100644 --- a/drivers/of/pdt.c +++ b/drivers/of/pdt.c | |||
@@ -36,19 +36,55 @@ unsigned int of_pdt_unique_id __initdata; | |||
36 | (p)->unique_id = of_pdt_unique_id++; \ | 36 | (p)->unique_id = of_pdt_unique_id++; \ |
37 | } while (0) | 37 | } while (0) |
38 | 38 | ||
39 | static inline const char *of_pdt_node_name(struct device_node *dp) | 39 | static char * __init of_pdt_build_full_name(struct device_node *dp) |
40 | { | 40 | { |
41 | return dp->path_component_name; | 41 | int len, ourlen, plen; |
42 | char *n; | ||
43 | |||
44 | dp->path_component_name = build_path_component(dp); | ||
45 | |||
46 | plen = strlen(dp->parent->full_name); | ||
47 | ourlen = strlen(dp->path_component_name); | ||
48 | len = ourlen + plen + 2; | ||
49 | |||
50 | n = prom_early_alloc(len); | ||
51 | strcpy(n, dp->parent->full_name); | ||
52 | if (!of_node_is_root(dp->parent)) { | ||
53 | strcpy(n + plen, "/"); | ||
54 | plen++; | ||
55 | } | ||
56 | strcpy(n + plen, dp->path_component_name); | ||
57 | |||
58 | return n; | ||
42 | } | 59 | } |
43 | 60 | ||
44 | #else | 61 | #else /* CONFIG_SPARC */ |
45 | 62 | ||
46 | static inline void of_pdt_incr_unique_id(void *p) { } | 63 | static inline void of_pdt_incr_unique_id(void *p) { } |
47 | static inline void irq_trans_init(struct device_node *dp) { } | 64 | static inline void irq_trans_init(struct device_node *dp) { } |
48 | 65 | ||
49 | static inline const char *of_pdt_node_name(struct device_node *dp) | 66 | static char * __init of_pdt_build_full_name(struct device_node *dp) |
50 | { | 67 | { |
51 | return dp->name; | 68 | static int failsafe_id = 0; /* for generating unique names on failure */ |
69 | char *buf; | ||
70 | int len; | ||
71 | |||
72 | if (of_pdt_prom_ops->pkg2path(dp->phandle, NULL, 0, &len)) | ||
73 | goto failsafe; | ||
74 | |||
75 | buf = prom_early_alloc(len + 1); | ||
76 | if (of_pdt_prom_ops->pkg2path(dp->phandle, buf, len, &len)) | ||
77 | goto failsafe; | ||
78 | return buf; | ||
79 | |||
80 | failsafe: | ||
81 | buf = prom_early_alloc(strlen(dp->parent->full_name) + | ||
82 | strlen(dp->name) + 16); | ||
83 | sprintf(buf, "%s/%s@unknown%i", | ||
84 | of_node_is_root(dp->parent) ? "" : dp->parent->full_name, | ||
85 | dp->name, failsafe_id++); | ||
86 | pr_err("%s: pkg2path failed; assigning %s\n", __func__, buf); | ||
87 | return buf; | ||
52 | } | 88 | } |
53 | 89 | ||
54 | #endif /* !CONFIG_SPARC */ | 90 | #endif /* !CONFIG_SPARC */ |
@@ -132,47 +168,6 @@ static char * __init of_pdt_get_one_property(phandle node, const char *name) | |||
132 | return buf; | 168 | return buf; |
133 | } | 169 | } |
134 | 170 | ||
135 | static char * __init of_pdt_try_pkg2path(phandle node) | ||
136 | { | ||
137 | char *res, *buf = NULL; | ||
138 | int len; | ||
139 | |||
140 | if (!of_pdt_prom_ops->pkg2path) | ||
141 | return NULL; | ||
142 | |||
143 | if (of_pdt_prom_ops->pkg2path(node, buf, 0, &len)) | ||
144 | return NULL; | ||
145 | buf = prom_early_alloc(len + 1); | ||
146 | if (of_pdt_prom_ops->pkg2path(node, buf, len, &len)) { | ||
147 | pr_err("%s: package-to-path failed\n", __func__); | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | res = strrchr(buf, '/'); | ||
152 | if (!res) { | ||
153 | pr_err("%s: couldn't find / in %s\n", __func__, buf); | ||
154 | return NULL; | ||
155 | } | ||
156 | return res+1; | ||
157 | } | ||
158 | |||
159 | /* | ||
160 | * When fetching the node's name, first try using package-to-path; if | ||
161 | * that fails (either because the arch hasn't supplied a PROM callback, | ||
162 | * or some other random failure), fall back to just looking at the node's | ||
163 | * 'name' property. | ||
164 | */ | ||
165 | static char * __init of_pdt_build_name(phandle node) | ||
166 | { | ||
167 | char *buf; | ||
168 | |||
169 | buf = of_pdt_try_pkg2path(node); | ||
170 | if (!buf) | ||
171 | buf = of_pdt_get_one_property(node, "name"); | ||
172 | |||
173 | return buf; | ||
174 | } | ||
175 | |||
176 | static struct device_node * __init of_pdt_create_node(phandle node, | 171 | static struct device_node * __init of_pdt_create_node(phandle node, |
177 | struct device_node *parent) | 172 | struct device_node *parent) |
178 | { | 173 | { |
@@ -187,7 +182,7 @@ static struct device_node * __init of_pdt_create_node(phandle node, | |||
187 | 182 | ||
188 | kref_init(&dp->kref); | 183 | kref_init(&dp->kref); |
189 | 184 | ||
190 | dp->name = of_pdt_build_name(node); | 185 | dp->name = of_pdt_get_one_property(node, "name"); |
191 | dp->type = of_pdt_get_one_property(node, "device_type"); | 186 | dp->type = of_pdt_get_one_property(node, "device_type"); |
192 | dp->phandle = node; | 187 | dp->phandle = node; |
193 | 188 | ||
@@ -198,26 +193,6 @@ static struct device_node * __init of_pdt_create_node(phandle node, | |||
198 | return dp; | 193 | return dp; |
199 | } | 194 | } |
200 | 195 | ||
201 | static char * __init of_pdt_build_full_name(struct device_node *dp) | ||
202 | { | ||
203 | int len, ourlen, plen; | ||
204 | char *n; | ||
205 | |||
206 | plen = strlen(dp->parent->full_name); | ||
207 | ourlen = strlen(of_pdt_node_name(dp)); | ||
208 | len = ourlen + plen + 2; | ||
209 | |||
210 | n = prom_early_alloc(len); | ||
211 | strcpy(n, dp->parent->full_name); | ||
212 | if (!of_node_is_root(dp->parent)) { | ||
213 | strcpy(n + plen, "/"); | ||
214 | plen++; | ||
215 | } | ||
216 | strcpy(n + plen, of_pdt_node_name(dp)); | ||
217 | |||
218 | return n; | ||
219 | } | ||
220 | |||
221 | static struct device_node * __init of_pdt_build_tree(struct device_node *parent, | 196 | static struct device_node * __init of_pdt_build_tree(struct device_node *parent, |
222 | phandle node, | 197 | phandle node, |
223 | struct device_node ***nextp) | 198 | struct device_node ***nextp) |
@@ -240,9 +215,6 @@ static struct device_node * __init of_pdt_build_tree(struct device_node *parent, | |||
240 | *(*nextp) = dp; | 215 | *(*nextp) = dp; |
241 | *nextp = &dp->allnext; | 216 | *nextp = &dp->allnext; |
242 | 217 | ||
243 | #if defined(CONFIG_SPARC) | ||
244 | dp->path_component_name = build_path_component(dp); | ||
245 | #endif | ||
246 | dp->full_name = of_pdt_build_full_name(dp); | 218 | dp->full_name = of_pdt_build_full_name(dp); |
247 | 219 | ||
248 | dp->child = of_pdt_build_tree(dp, | 220 | dp->child = of_pdt_build_tree(dp, |
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c index c3f72192af66..a52039564e74 100644 --- a/drivers/pcmcia/pxa2xx_colibri.c +++ b/drivers/pcmcia/pxa2xx_colibri.c | |||
@@ -181,6 +181,9 @@ static int __init colibri_pcmcia_init(void) | |||
181 | { | 181 | { |
182 | int ret; | 182 | int ret; |
183 | 183 | ||
184 | if (!machine_is_colibri() && !machine_is_colibri320()) | ||
185 | return -ENODEV; | ||
186 | |||
184 | colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | 187 | colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); |
185 | if (!colibri_pcmcia_device) | 188 | if (!colibri_pcmcia_device) |
186 | return -ENOMEM; | 189 | return -ENOMEM; |
diff --git a/drivers/pps/generators/Kconfig b/drivers/pps/generators/Kconfig index f3a73dd77660..e4c4f3dc0728 100644 --- a/drivers/pps/generators/Kconfig +++ b/drivers/pps/generators/Kconfig | |||
@@ -6,7 +6,7 @@ comment "PPS generators support" | |||
6 | 6 | ||
7 | config PPS_GENERATOR_PARPORT | 7 | config PPS_GENERATOR_PARPORT |
8 | tristate "Parallel port PPS signal generator" | 8 | tristate "Parallel port PPS signal generator" |
9 | depends on PARPORT | 9 | depends on PARPORT && BROKEN |
10 | help | 10 | help |
11 | If you say yes here you get support for a PPS signal generator which | 11 | If you say yes here you get support for a PPS signal generator which |
12 | utilizes STROBE pin of a parallel port to send PPS signals. It uses | 12 | utilizes STROBE pin of a parallel port to send PPS signals. It uses |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index cf953ecbfca9..b80fa2882408 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -77,18 +77,20 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | /* Update control registers */ | 79 | /* Update control registers */ |
80 | static void s3c_rtc_setaie(int to) | 80 | static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) |
81 | { | 81 | { |
82 | unsigned int tmp; | 82 | unsigned int tmp; |
83 | 83 | ||
84 | pr_debug("%s: aie=%d\n", __func__, to); | 84 | pr_debug("%s: aie=%d\n", __func__, enabled); |
85 | 85 | ||
86 | tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; | 86 | tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; |
87 | 87 | ||
88 | if (to) | 88 | if (enabled) |
89 | tmp |= S3C2410_RTCALM_ALMEN; | 89 | tmp |= S3C2410_RTCALM_ALMEN; |
90 | 90 | ||
91 | writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); | 91 | writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); |
92 | |||
93 | return 0; | ||
92 | } | 94 | } |
93 | 95 | ||
94 | static int s3c_rtc_setpie(struct device *dev, int enabled) | 96 | static int s3c_rtc_setpie(struct device *dev, int enabled) |
@@ -308,7 +310,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
308 | 310 | ||
309 | writeb(alrm_en, base + S3C2410_RTCALM); | 311 | writeb(alrm_en, base + S3C2410_RTCALM); |
310 | 312 | ||
311 | s3c_rtc_setaie(alrm->enabled); | 313 | s3c_rtc_setaie(dev, alrm->enabled); |
312 | 314 | ||
313 | return 0; | 315 | return 0; |
314 | } | 316 | } |
@@ -440,7 +442,7 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev) | |||
440 | rtc_device_unregister(rtc); | 442 | rtc_device_unregister(rtc); |
441 | 443 | ||
442 | s3c_rtc_setpie(&dev->dev, 0); | 444 | s3c_rtc_setpie(&dev->dev, 0); |
443 | s3c_rtc_setaie(0); | 445 | s3c_rtc_setaie(&dev->dev, 0); |
444 | 446 | ||
445 | clk_disable(rtc_clk); | 447 | clk_disable(rtc_clk); |
446 | clk_put(rtc_clk); | 448 | clk_put(rtc_clk); |
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index c881a14fa5dd..1f6a4d894e73 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c | |||
@@ -62,8 +62,8 @@ static int xpram_devs; | |||
62 | /* | 62 | /* |
63 | * Parameter parsing functions. | 63 | * Parameter parsing functions. |
64 | */ | 64 | */ |
65 | static int __initdata devs = XPRAM_DEVS; | 65 | static int devs = XPRAM_DEVS; |
66 | static char __initdata *sizes[XPRAM_MAX_DEVS]; | 66 | static char *sizes[XPRAM_MAX_DEVS]; |
67 | 67 | ||
68 | module_param(devs, int, 0); | 68 | module_param(devs, int, 0); |
69 | module_param_array(sizes, charp, NULL, 0); | 69 | module_param_array(sizes, charp, NULL, 0); |
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index 8cd58e412b5e..5ad44daef73b 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c | |||
@@ -460,7 +460,8 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file, | |||
460 | unsigned int cmd, unsigned long arg) | 460 | unsigned int cmd, unsigned long arg) |
461 | { | 461 | { |
462 | void __user *argp; | 462 | void __user *argp; |
463 | int ct, perm; | 463 | unsigned int ct; |
464 | int perm; | ||
464 | 465 | ||
465 | argp = (void __user *)arg; | 466 | argp = (void __user *)arg; |
466 | 467 | ||
diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h index 7a242f073632..267b54e8ff5a 100644 --- a/drivers/s390/char/tape.h +++ b/drivers/s390/char/tape.h | |||
@@ -280,6 +280,14 @@ tape_do_io_free(struct tape_device *device, struct tape_request *request) | |||
280 | return rc; | 280 | return rc; |
281 | } | 281 | } |
282 | 282 | ||
283 | static inline void | ||
284 | tape_do_io_async_free(struct tape_device *device, struct tape_request *request) | ||
285 | { | ||
286 | request->callback = (void *) tape_free_request; | ||
287 | request->callback_data = NULL; | ||
288 | tape_do_io_async(device, request); | ||
289 | } | ||
290 | |||
283 | extern int tape_oper_handler(int irq, int status); | 291 | extern int tape_oper_handler(int irq, int status); |
284 | extern void tape_noper_handler(int irq, int status); | 292 | extern void tape_noper_handler(int irq, int status); |
285 | extern int tape_open(struct tape_device *); | 293 | extern int tape_open(struct tape_device *); |
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index c17f35b6136a..c26511171ffe 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c | |||
@@ -53,23 +53,11 @@ static void tape_34xx_delete_sbid_from(struct tape_device *, int); | |||
53 | * Medium sense for 34xx tapes. There is no 'real' medium sense call. | 53 | * Medium sense for 34xx tapes. There is no 'real' medium sense call. |
54 | * So we just do a normal sense. | 54 | * So we just do a normal sense. |
55 | */ | 55 | */ |
56 | static int | 56 | static void __tape_34xx_medium_sense(struct tape_request *request) |
57 | tape_34xx_medium_sense(struct tape_device *device) | ||
58 | { | 57 | { |
59 | struct tape_request *request; | 58 | struct tape_device *device = request->device; |
60 | unsigned char *sense; | 59 | unsigned char *sense; |
61 | int rc; | ||
62 | |||
63 | request = tape_alloc_request(1, 32); | ||
64 | if (IS_ERR(request)) { | ||
65 | DBF_EXCEPTION(6, "MSEN fail\n"); | ||
66 | return PTR_ERR(request); | ||
67 | } | ||
68 | |||
69 | request->op = TO_MSEN; | ||
70 | tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); | ||
71 | 60 | ||
72 | rc = tape_do_io_interruptible(device, request); | ||
73 | if (request->rc == 0) { | 61 | if (request->rc == 0) { |
74 | sense = request->cpdata; | 62 | sense = request->cpdata; |
75 | 63 | ||
@@ -88,15 +76,47 @@ tape_34xx_medium_sense(struct tape_device *device) | |||
88 | device->tape_generic_status |= GMT_WR_PROT(~0); | 76 | device->tape_generic_status |= GMT_WR_PROT(~0); |
89 | else | 77 | else |
90 | device->tape_generic_status &= ~GMT_WR_PROT(~0); | 78 | device->tape_generic_status &= ~GMT_WR_PROT(~0); |
91 | } else { | 79 | } else |
92 | DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n", | 80 | DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n", |
93 | request->rc); | 81 | request->rc); |
94 | } | ||
95 | tape_free_request(request); | 82 | tape_free_request(request); |
83 | } | ||
84 | |||
85 | static int tape_34xx_medium_sense(struct tape_device *device) | ||
86 | { | ||
87 | struct tape_request *request; | ||
88 | int rc; | ||
89 | |||
90 | request = tape_alloc_request(1, 32); | ||
91 | if (IS_ERR(request)) { | ||
92 | DBF_EXCEPTION(6, "MSEN fail\n"); | ||
93 | return PTR_ERR(request); | ||
94 | } | ||
96 | 95 | ||
96 | request->op = TO_MSEN; | ||
97 | tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); | ||
98 | rc = tape_do_io_interruptible(device, request); | ||
99 | __tape_34xx_medium_sense(request); | ||
97 | return rc; | 100 | return rc; |
98 | } | 101 | } |
99 | 102 | ||
103 | static void tape_34xx_medium_sense_async(struct tape_device *device) | ||
104 | { | ||
105 | struct tape_request *request; | ||
106 | |||
107 | request = tape_alloc_request(1, 32); | ||
108 | if (IS_ERR(request)) { | ||
109 | DBF_EXCEPTION(6, "MSEN fail\n"); | ||
110 | return; | ||
111 | } | ||
112 | |||
113 | request->op = TO_MSEN; | ||
114 | tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); | ||
115 | request->callback = (void *) __tape_34xx_medium_sense; | ||
116 | request->callback_data = NULL; | ||
117 | tape_do_io_async(device, request); | ||
118 | } | ||
119 | |||
100 | struct tape_34xx_work { | 120 | struct tape_34xx_work { |
101 | struct tape_device *device; | 121 | struct tape_device *device; |
102 | enum tape_op op; | 122 | enum tape_op op; |
@@ -109,6 +129,9 @@ struct tape_34xx_work { | |||
109 | * is inserted but cannot call tape_do_io* from an interrupt context. | 129 | * is inserted but cannot call tape_do_io* from an interrupt context. |
110 | * Maybe that's useful for other actions we want to start from the | 130 | * Maybe that's useful for other actions we want to start from the |
111 | * interrupt handler. | 131 | * interrupt handler. |
132 | * Note: the work handler is called by the system work queue. The tape | ||
133 | * commands started by the handler need to be asynchrounous, otherwise | ||
134 | * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq). | ||
112 | */ | 135 | */ |
113 | static void | 136 | static void |
114 | tape_34xx_work_handler(struct work_struct *work) | 137 | tape_34xx_work_handler(struct work_struct *work) |
@@ -119,7 +142,7 @@ tape_34xx_work_handler(struct work_struct *work) | |||
119 | 142 | ||
120 | switch(p->op) { | 143 | switch(p->op) { |
121 | case TO_MSEN: | 144 | case TO_MSEN: |
122 | tape_34xx_medium_sense(device); | 145 | tape_34xx_medium_sense_async(device); |
123 | break; | 146 | break; |
124 | default: | 147 | default: |
125 | DBF_EVENT(3, "T34XX: internal error: unknown work\n"); | 148 | DBF_EVENT(3, "T34XX: internal error: unknown work\n"); |
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index fbe361fcd2c0..de2e99e0a71b 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -329,17 +329,17 @@ out: | |||
329 | /* | 329 | /* |
330 | * Enable encryption | 330 | * Enable encryption |
331 | */ | 331 | */ |
332 | static int tape_3592_enable_crypt(struct tape_device *device) | 332 | static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device) |
333 | { | 333 | { |
334 | struct tape_request *request; | 334 | struct tape_request *request; |
335 | char *data; | 335 | char *data; |
336 | 336 | ||
337 | DBF_EVENT(6, "tape_3592_enable_crypt\n"); | 337 | DBF_EVENT(6, "tape_3592_enable_crypt\n"); |
338 | if (!crypt_supported(device)) | 338 | if (!crypt_supported(device)) |
339 | return -ENOSYS; | 339 | return ERR_PTR(-ENOSYS); |
340 | request = tape_alloc_request(2, 72); | 340 | request = tape_alloc_request(2, 72); |
341 | if (IS_ERR(request)) | 341 | if (IS_ERR(request)) |
342 | return PTR_ERR(request); | 342 | return request; |
343 | data = request->cpdata; | 343 | data = request->cpdata; |
344 | memset(data,0,72); | 344 | memset(data,0,72); |
345 | 345 | ||
@@ -354,23 +354,42 @@ static int tape_3592_enable_crypt(struct tape_device *device) | |||
354 | request->op = TO_CRYPT_ON; | 354 | request->op = TO_CRYPT_ON; |
355 | tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); | 355 | tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); |
356 | tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); | 356 | tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); |
357 | return request; | ||
358 | } | ||
359 | |||
360 | static int tape_3592_enable_crypt(struct tape_device *device) | ||
361 | { | ||
362 | struct tape_request *request; | ||
363 | |||
364 | request = __tape_3592_enable_crypt(device); | ||
365 | if (IS_ERR(request)) | ||
366 | return PTR_ERR(request); | ||
357 | return tape_do_io_free(device, request); | 367 | return tape_do_io_free(device, request); |
358 | } | 368 | } |
359 | 369 | ||
370 | static void tape_3592_enable_crypt_async(struct tape_device *device) | ||
371 | { | ||
372 | struct tape_request *request; | ||
373 | |||
374 | request = __tape_3592_enable_crypt(device); | ||
375 | if (!IS_ERR(request)) | ||
376 | tape_do_io_async_free(device, request); | ||
377 | } | ||
378 | |||
360 | /* | 379 | /* |
361 | * Disable encryption | 380 | * Disable encryption |
362 | */ | 381 | */ |
363 | static int tape_3592_disable_crypt(struct tape_device *device) | 382 | static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device) |
364 | { | 383 | { |
365 | struct tape_request *request; | 384 | struct tape_request *request; |
366 | char *data; | 385 | char *data; |
367 | 386 | ||
368 | DBF_EVENT(6, "tape_3592_disable_crypt\n"); | 387 | DBF_EVENT(6, "tape_3592_disable_crypt\n"); |
369 | if (!crypt_supported(device)) | 388 | if (!crypt_supported(device)) |
370 | return -ENOSYS; | 389 | return ERR_PTR(-ENOSYS); |
371 | request = tape_alloc_request(2, 72); | 390 | request = tape_alloc_request(2, 72); |
372 | if (IS_ERR(request)) | 391 | if (IS_ERR(request)) |
373 | return PTR_ERR(request); | 392 | return request; |
374 | data = request->cpdata; | 393 | data = request->cpdata; |
375 | memset(data,0,72); | 394 | memset(data,0,72); |
376 | 395 | ||
@@ -383,9 +402,28 @@ static int tape_3592_disable_crypt(struct tape_device *device) | |||
383 | tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); | 402 | tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); |
384 | tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); | 403 | tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); |
385 | 404 | ||
405 | return request; | ||
406 | } | ||
407 | |||
408 | static int tape_3592_disable_crypt(struct tape_device *device) | ||
409 | { | ||
410 | struct tape_request *request; | ||
411 | |||
412 | request = __tape_3592_disable_crypt(device); | ||
413 | if (IS_ERR(request)) | ||
414 | return PTR_ERR(request); | ||
386 | return tape_do_io_free(device, request); | 415 | return tape_do_io_free(device, request); |
387 | } | 416 | } |
388 | 417 | ||
418 | static void tape_3592_disable_crypt_async(struct tape_device *device) | ||
419 | { | ||
420 | struct tape_request *request; | ||
421 | |||
422 | request = __tape_3592_disable_crypt(device); | ||
423 | if (!IS_ERR(request)) | ||
424 | tape_do_io_async_free(device, request); | ||
425 | } | ||
426 | |||
389 | /* | 427 | /* |
390 | * IOCTL: Set encryption status | 428 | * IOCTL: Set encryption status |
391 | */ | 429 | */ |
@@ -457,8 +495,7 @@ tape_3590_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg) | |||
457 | /* | 495 | /* |
458 | * SENSE Medium: Get Sense data about medium state | 496 | * SENSE Medium: Get Sense data about medium state |
459 | */ | 497 | */ |
460 | static int | 498 | static int tape_3590_sense_medium(struct tape_device *device) |
461 | tape_3590_sense_medium(struct tape_device *device) | ||
462 | { | 499 | { |
463 | struct tape_request *request; | 500 | struct tape_request *request; |
464 | 501 | ||
@@ -470,6 +507,18 @@ tape_3590_sense_medium(struct tape_device *device) | |||
470 | return tape_do_io_free(device, request); | 507 | return tape_do_io_free(device, request); |
471 | } | 508 | } |
472 | 509 | ||
510 | static void tape_3590_sense_medium_async(struct tape_device *device) | ||
511 | { | ||
512 | struct tape_request *request; | ||
513 | |||
514 | request = tape_alloc_request(1, 128); | ||
515 | if (IS_ERR(request)) | ||
516 | return; | ||
517 | request->op = TO_MSEN; | ||
518 | tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata); | ||
519 | tape_do_io_async_free(device, request); | ||
520 | } | ||
521 | |||
473 | /* | 522 | /* |
474 | * MTTELL: Tell block. Return the number of block relative to current file. | 523 | * MTTELL: Tell block. Return the number of block relative to current file. |
475 | */ | 524 | */ |
@@ -546,15 +595,14 @@ tape_3590_read_opposite(struct tape_device *device, | |||
546 | * 2. The attention msg is written to the "read subsystem data" buffer. | 595 | * 2. The attention msg is written to the "read subsystem data" buffer. |
547 | * In this case we probably should print it to the console. | 596 | * In this case we probably should print it to the console. |
548 | */ | 597 | */ |
549 | static int | 598 | static void tape_3590_read_attmsg_async(struct tape_device *device) |
550 | tape_3590_read_attmsg(struct tape_device *device) | ||
551 | { | 599 | { |
552 | struct tape_request *request; | 600 | struct tape_request *request; |
553 | char *buf; | 601 | char *buf; |
554 | 602 | ||
555 | request = tape_alloc_request(3, 4096); | 603 | request = tape_alloc_request(3, 4096); |
556 | if (IS_ERR(request)) | 604 | if (IS_ERR(request)) |
557 | return PTR_ERR(request); | 605 | return; |
558 | request->op = TO_READ_ATTMSG; | 606 | request->op = TO_READ_ATTMSG; |
559 | buf = request->cpdata; | 607 | buf = request->cpdata; |
560 | buf[0] = PREP_RD_SS_DATA; | 608 | buf[0] = PREP_RD_SS_DATA; |
@@ -562,12 +610,15 @@ tape_3590_read_attmsg(struct tape_device *device) | |||
562 | tape_ccw_cc(request->cpaddr, PERFORM_SS_FUNC, 12, buf); | 610 | tape_ccw_cc(request->cpaddr, PERFORM_SS_FUNC, 12, buf); |
563 | tape_ccw_cc(request->cpaddr + 1, READ_SS_DATA, 4096 - 12, buf + 12); | 611 | tape_ccw_cc(request->cpaddr + 1, READ_SS_DATA, 4096 - 12, buf + 12); |
564 | tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL); | 612 | tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL); |
565 | return tape_do_io_free(device, request); | 613 | tape_do_io_async_free(device, request); |
566 | } | 614 | } |
567 | 615 | ||
568 | /* | 616 | /* |
569 | * These functions are used to schedule follow-up actions from within an | 617 | * These functions are used to schedule follow-up actions from within an |
570 | * interrupt context (like unsolicited interrupts). | 618 | * interrupt context (like unsolicited interrupts). |
619 | * Note: the work handler is called by the system work queue. The tape | ||
620 | * commands started by the handler need to be asynchrounous, otherwise | ||
621 | * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq). | ||
571 | */ | 622 | */ |
572 | struct work_handler_data { | 623 | struct work_handler_data { |
573 | struct tape_device *device; | 624 | struct tape_device *device; |
@@ -583,16 +634,16 @@ tape_3590_work_handler(struct work_struct *work) | |||
583 | 634 | ||
584 | switch (p->op) { | 635 | switch (p->op) { |
585 | case TO_MSEN: | 636 | case TO_MSEN: |
586 | tape_3590_sense_medium(p->device); | 637 | tape_3590_sense_medium_async(p->device); |
587 | break; | 638 | break; |
588 | case TO_READ_ATTMSG: | 639 | case TO_READ_ATTMSG: |
589 | tape_3590_read_attmsg(p->device); | 640 | tape_3590_read_attmsg_async(p->device); |
590 | break; | 641 | break; |
591 | case TO_CRYPT_ON: | 642 | case TO_CRYPT_ON: |
592 | tape_3592_enable_crypt(p->device); | 643 | tape_3592_enable_crypt_async(p->device); |
593 | break; | 644 | break; |
594 | case TO_CRYPT_OFF: | 645 | case TO_CRYPT_OFF: |
595 | tape_3592_disable_crypt(p->device); | 646 | tape_3592_disable_crypt_async(p->device); |
596 | break; | 647 | break; |
597 | default: | 648 | default: |
598 | DBF_EVENT(3, "T3590: work handler undefined for " | 649 | DBF_EVENT(3, "T3590: work handler undefined for " |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9045c52abd25..fb2bb35c62cb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -443,7 +443,7 @@ static void scsi_run_queue(struct request_queue *q) | |||
443 | &sdev->request_queue->queue_flags); | 443 | &sdev->request_queue->queue_flags); |
444 | if (flagset) | 444 | if (flagset) |
445 | queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue); | 445 | queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue); |
446 | __blk_run_queue(sdev->request_queue); | 446 | __blk_run_queue(sdev->request_queue, false); |
447 | if (flagset) | 447 | if (flagset) |
448 | queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue); | 448 | queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue); |
449 | spin_unlock(sdev->request_queue->queue_lock); | 449 | spin_unlock(sdev->request_queue->queue_lock); |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 998c01be3234..5c3ccfc6b622 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -3829,7 +3829,7 @@ fc_bsg_goose_queue(struct fc_rport *rport) | |||
3829 | !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags); | 3829 | !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags); |
3830 | if (flagset) | 3830 | if (flagset) |
3831 | queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q); | 3831 | queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q); |
3832 | __blk_run_queue(rport->rqst_q); | 3832 | __blk_run_queue(rport->rqst_q, false); |
3833 | if (flagset) | 3833 | if (flagset) |
3834 | queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q); | 3834 | queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q); |
3835 | spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags); | 3835 | spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags); |
diff --git a/drivers/tty/serial/serial_cs.c b/drivers/tty/serial/serial_cs.c index 93760b2ea172..1ef4df9bf7e4 100644 --- a/drivers/tty/serial/serial_cs.c +++ b/drivers/tty/serial/serial_cs.c | |||
@@ -712,6 +712,7 @@ static struct pcmcia_device_id serial_ids[] = { | |||
712 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "Xircom", "CreditCard Ethernet+Modem II", 0x2e3ee845, 0xeca401bf), | 712 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "Xircom", "CreditCard Ethernet+Modem II", 0x2e3ee845, 0xeca401bf), |
713 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0e01), | 713 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0e01), |
714 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0a05), | 714 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0a05), |
715 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0b05), | ||
715 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x1101), | 716 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x1101), |
716 | PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0104, 0x0070), | 717 | PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0104, 0x0070), |
717 | PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0101, 0x0562), | 718 | PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0101, 0x0562), |
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index 3c6e1a058745..5e1495097ec3 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c | |||
@@ -346,14 +346,19 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req) | |||
346 | 346 | ||
347 | if (unlikely(!skb)) | 347 | if (unlikely(!skb)) |
348 | break; | 348 | break; |
349 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 0, | ||
350 | req->actual); | ||
351 | page = NULL; | ||
352 | 349 | ||
353 | if (req->actual < req->length) { /* Last fragment */ | 350 | if (skb->len == 0) { /* First fragment */ |
354 | skb->protocol = htons(ETH_P_PHONET); | 351 | skb->protocol = htons(ETH_P_PHONET); |
355 | skb_reset_mac_header(skb); | 352 | skb_reset_mac_header(skb); |
356 | pskb_pull(skb, 1); | 353 | /* Can't use pskb_pull() on page in IRQ */ |
354 | memcpy(skb_put(skb, 1), page_address(page), 1); | ||
355 | } | ||
356 | |||
357 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, | ||
358 | skb->len == 0, req->actual); | ||
359 | page = NULL; | ||
360 | |||
361 | if (req->actual < req->length) { /* Last fragment */ | ||
357 | skb->dev = dev; | 362 | skb->dev = dev; |
358 | dev->stats.rx_packets++; | 363 | dev->stats.rx_packets++; |
359 | dev->stats.rx_bytes += skb->len; | 364 | dev->stats.rx_bytes += skb->len; |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index e8f4f36fdf0b..a6f21b891f68 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/of.h> | 30 | #include <linux/of.h> |
31 | #include <linux/of_platform.h> | 31 | #include <linux/of_platform.h> |
32 | #include <linux/of_address.h> | ||
32 | 33 | ||
33 | /** | 34 | /** |
34 | * ehci_xilinx_of_setup - Initialize the device for ehci_reset() | 35 | * ehci_xilinx_of_setup - Initialize the device for ehci_reset() |
diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c index 8010aaeb5adb..dd0e84a9bd2f 100644 --- a/drivers/video/backlight/ltv350qv.c +++ b/drivers/video/backlight/ltv350qv.c | |||
@@ -239,11 +239,15 @@ static int __devinit ltv350qv_probe(struct spi_device *spi) | |||
239 | lcd->spi = spi; | 239 | lcd->spi = spi; |
240 | lcd->power = FB_BLANK_POWERDOWN; | 240 | lcd->power = FB_BLANK_POWERDOWN; |
241 | lcd->buffer = kzalloc(8, GFP_KERNEL); | 241 | lcd->buffer = kzalloc(8, GFP_KERNEL); |
242 | if (!lcd->buffer) { | ||
243 | ret = -ENOMEM; | ||
244 | goto out_free_lcd; | ||
245 | } | ||
242 | 246 | ||
243 | ld = lcd_device_register("ltv350qv", &spi->dev, lcd, <v_ops); | 247 | ld = lcd_device_register("ltv350qv", &spi->dev, lcd, <v_ops); |
244 | if (IS_ERR(ld)) { | 248 | if (IS_ERR(ld)) { |
245 | ret = PTR_ERR(ld); | 249 | ret = PTR_ERR(ld); |
246 | goto out_free_lcd; | 250 | goto out_free_buffer; |
247 | } | 251 | } |
248 | lcd->ld = ld; | 252 | lcd->ld = ld; |
249 | 253 | ||
@@ -257,6 +261,8 @@ static int __devinit ltv350qv_probe(struct spi_device *spi) | |||
257 | 261 | ||
258 | out_unregister: | 262 | out_unregister: |
259 | lcd_device_unregister(ld); | 263 | lcd_device_unregister(ld); |
264 | out_free_buffer: | ||
265 | kfree(lcd->buffer); | ||
260 | out_free_lcd: | 266 | out_free_lcd: |
261 | kfree(lcd); | 267 | kfree(lcd); |
262 | return ret; | 268 | return ret; |
@@ -268,6 +274,7 @@ static int __devexit ltv350qv_remove(struct spi_device *spi) | |||
268 | 274 | ||
269 | ltv350qv_power(lcd, FB_BLANK_POWERDOWN); | 275 | ltv350qv_power(lcd, FB_BLANK_POWERDOWN); |
270 | lcd_device_unregister(lcd->ld); | 276 | lcd_device_unregister(lcd->ld); |
277 | kfree(lcd->buffer); | ||
271 | kfree(lcd); | 278 | kfree(lcd); |
272 | 279 | ||
273 | return 0; | 280 | return 0; |
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c index c7d67e9a7465..79906255eeb6 100644 --- a/drivers/watchdog/sbc_fitpc2_wdt.c +++ b/drivers/watchdog/sbc_fitpc2_wdt.c | |||
@@ -201,11 +201,14 @@ static struct miscdevice fitpc2_wdt_miscdev = { | |||
201 | static int __init fitpc2_wdt_init(void) | 201 | static int __init fitpc2_wdt_init(void) |
202 | { | 202 | { |
203 | int err; | 203 | int err; |
204 | const char *brd_name; | ||
204 | 205 | ||
205 | if (!strstr(dmi_get_system_info(DMI_BOARD_NAME), "SBC-FITPC2")) | 206 | brd_name = dmi_get_system_info(DMI_BOARD_NAME); |
207 | |||
208 | if (!brd_name || !strstr(brd_name, "SBC-FITPC2")) | ||
206 | return -ENODEV; | 209 | return -ENODEV; |
207 | 210 | ||
208 | pr_info("%s found\n", dmi_get_system_info(DMI_BOARD_NAME)); | 211 | pr_info("%s found\n", brd_name); |
209 | 212 | ||
210 | if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) { | 213 | if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) { |
211 | pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT); | 214 | pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT); |