diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-06-22 14:32:04 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-06-22 14:32:04 -0400 |
commit | 0e789314f8c0b50bd19bf08dc5624b9604d60183 (patch) | |
tree | 64b6b9655e944284937f5eeff643f0754f35d0af /drivers/char | |
parent | f5dec51172b81db226a23f309bc737ad021af35b (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Merge commit 'v2.6.35-rc3' into for-linus
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 1 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 46 | ||||
-rw-r--r-- | drivers/char/agp/uninorth-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/n_gsm.c | 9 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 14 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 4 |
6 files changed, 60 insertions, 16 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index f09fc0e2062d..7cfcc629a7fd 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -1123,6 +1123,7 @@ source "drivers/s390/char/Kconfig" | |||
1123 | 1123 | ||
1124 | config RAMOOPS | 1124 | config RAMOOPS |
1125 | tristate "Log panic/oops to a RAM buffer" | 1125 | tristate "Log panic/oops to a RAM buffer" |
1126 | depends on HAS_IOMEM | ||
1126 | default n | 1127 | default n |
1127 | help | 1128 | help |
1128 | This enables panic and oops messages to be logged to a circular | 1129 | This enables panic and oops messages to be logged to a circular |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index e8ea6825822c..9344216183a4 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1059,7 +1059,7 @@ static void intel_i9xx_setup_flush(void) | |||
1059 | } | 1059 | } |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | static int intel_i915_configure(void) | 1062 | static int intel_i9xx_configure(void) |
1063 | { | 1063 | { |
1064 | struct aper_size_info_fixed *current_size; | 1064 | struct aper_size_info_fixed *current_size; |
1065 | u32 temp; | 1065 | u32 temp; |
@@ -1207,6 +1207,38 @@ static int intel_i9xx_fetch_size(void) | |||
1207 | return 0; | 1207 | return 0; |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | static int intel_i915_get_gtt_size(void) | ||
1211 | { | ||
1212 | int size; | ||
1213 | |||
1214 | if (IS_G33) { | ||
1215 | u16 gmch_ctrl; | ||
1216 | |||
1217 | /* G33's GTT size defined in gmch_ctrl */ | ||
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | ||
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | ||
1220 | case G33_PGETBL_SIZE_1M: | ||
1221 | size = 1024; | ||
1222 | break; | ||
1223 | case G33_PGETBL_SIZE_2M: | ||
1224 | size = 2048; | ||
1225 | break; | ||
1226 | default: | ||
1227 | dev_info(&agp_bridge->dev->dev, | ||
1228 | "unknown page table size 0x%x, assuming 512KB\n", | ||
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | ||
1230 | size = 512; | ||
1231 | } | ||
1232 | } else { | ||
1233 | /* On previous hardware, the GTT size was just what was | ||
1234 | * required to map the aperture. | ||
1235 | */ | ||
1236 | size = agp_bridge->driver->fetch_size(); | ||
1237 | } | ||
1238 | |||
1239 | return KB(size); | ||
1240 | } | ||
1241 | |||
1210 | /* The intel i915 automatically initializes the agp aperture during POST. | 1242 | /* The intel i915 automatically initializes the agp aperture during POST. |
1211 | * Use the memory already set aside for in the GTT. | 1243 | * Use the memory already set aside for in the GTT. |
1212 | */ | 1244 | */ |
@@ -1216,7 +1248,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
1216 | struct aper_size_info_fixed *size; | 1248 | struct aper_size_info_fixed *size; |
1217 | int num_entries; | 1249 | int num_entries; |
1218 | u32 temp, temp2; | 1250 | u32 temp, temp2; |
1219 | int gtt_map_size = 256 * 1024; | 1251 | int gtt_map_size; |
1220 | 1252 | ||
1221 | size = agp_bridge->current_size; | 1253 | size = agp_bridge->current_size; |
1222 | page_order = size->page_order; | 1254 | page_order = size->page_order; |
@@ -1226,8 +1258,8 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
1226 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); | 1258 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); |
1227 | pci_read_config_dword(intel_private.pcidev, I915_PTEADDR, &temp2); | 1259 | pci_read_config_dword(intel_private.pcidev, I915_PTEADDR, &temp2); |
1228 | 1260 | ||
1229 | if (IS_G33) | 1261 | gtt_map_size = intel_i915_get_gtt_size(); |
1230 | gtt_map_size = 1024 * 1024; /* 1M on G33 */ | 1262 | |
1231 | intel_private.gtt = ioremap(temp2, gtt_map_size); | 1263 | intel_private.gtt = ioremap(temp2, gtt_map_size); |
1232 | if (!intel_private.gtt) | 1264 | if (!intel_private.gtt) |
1233 | return -ENOMEM; | 1265 | return -ENOMEM; |
@@ -1422,7 +1454,7 @@ static const struct agp_bridge_driver intel_915_driver = { | |||
1422 | .size_type = FIXED_APER_SIZE, | 1454 | .size_type = FIXED_APER_SIZE, |
1423 | .num_aperture_sizes = 4, | 1455 | .num_aperture_sizes = 4, |
1424 | .needs_scratch_page = true, | 1456 | .needs_scratch_page = true, |
1425 | .configure = intel_i915_configure, | 1457 | .configure = intel_i9xx_configure, |
1426 | .fetch_size = intel_i9xx_fetch_size, | 1458 | .fetch_size = intel_i9xx_fetch_size, |
1427 | .cleanup = intel_i915_cleanup, | 1459 | .cleanup = intel_i915_cleanup, |
1428 | .mask_memory = intel_i810_mask_memory, | 1460 | .mask_memory = intel_i810_mask_memory, |
@@ -1455,7 +1487,7 @@ static const struct agp_bridge_driver intel_i965_driver = { | |||
1455 | .size_type = FIXED_APER_SIZE, | 1487 | .size_type = FIXED_APER_SIZE, |
1456 | .num_aperture_sizes = 4, | 1488 | .num_aperture_sizes = 4, |
1457 | .needs_scratch_page = true, | 1489 | .needs_scratch_page = true, |
1458 | .configure = intel_i915_configure, | 1490 | .configure = intel_i9xx_configure, |
1459 | .fetch_size = intel_i9xx_fetch_size, | 1491 | .fetch_size = intel_i9xx_fetch_size, |
1460 | .cleanup = intel_i915_cleanup, | 1492 | .cleanup = intel_i915_cleanup, |
1461 | .mask_memory = intel_i965_mask_memory, | 1493 | .mask_memory = intel_i965_mask_memory, |
@@ -1488,7 +1520,7 @@ static const struct agp_bridge_driver intel_g33_driver = { | |||
1488 | .size_type = FIXED_APER_SIZE, | 1520 | .size_type = FIXED_APER_SIZE, |
1489 | .num_aperture_sizes = 4, | 1521 | .num_aperture_sizes = 4, |
1490 | .needs_scratch_page = true, | 1522 | .needs_scratch_page = true, |
1491 | .configure = intel_i915_configure, | 1523 | .configure = intel_i9xx_configure, |
1492 | .fetch_size = intel_i9xx_fetch_size, | 1524 | .fetch_size = intel_i9xx_fetch_size, |
1493 | .cleanup = intel_i915_cleanup, | 1525 | .cleanup = intel_i915_cleanup, |
1494 | .mask_memory = intel_i965_mask_memory, | 1526 | .mask_memory = intel_i965_mask_memory, |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 95db71360d24..f845a8f718b3 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -415,7 +415,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge) | |||
415 | bridge->gatt_table_real = (u32 *) table; | 415 | bridge->gatt_table_real = (u32 *) table; |
416 | /* Need to clear out any dirty data still sitting in caches */ | 416 | /* Need to clear out any dirty data still sitting in caches */ |
417 | flush_dcache_range((unsigned long)table, | 417 | flush_dcache_range((unsigned long)table, |
418 | (unsigned long)(table_end + PAGE_SIZE)); | 418 | (unsigned long)table_end + 1); |
419 | bridge->gatt_table = vmap(pages, (1 << page_order), 0, PAGE_KERNEL_NCG); | 419 | bridge->gatt_table = vmap(pages, (1 << page_order), 0, PAGE_KERNEL_NCG); |
420 | 420 | ||
421 | if (bridge->gatt_table == NULL) | 421 | if (bridge->gatt_table == NULL) |
diff --git a/drivers/char/n_gsm.c b/drivers/char/n_gsm.c index c4161d5e053d..e4089c432f15 100644 --- a/drivers/char/n_gsm.c +++ b/drivers/char/n_gsm.c | |||
@@ -904,9 +904,7 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm) | |||
904 | int len; | 904 | int len; |
905 | /* Priority ordering: We should do priority with RR of the groups */ | 905 | /* Priority ordering: We should do priority with RR of the groups */ |
906 | int i = 1; | 906 | int i = 1; |
907 | unsigned long flags; | ||
908 | 907 | ||
909 | spin_lock_irqsave(&gsm->tx_lock, flags); | ||
910 | while (i < NUM_DLCI) { | 908 | while (i < NUM_DLCI) { |
911 | struct gsm_dlci *dlci; | 909 | struct gsm_dlci *dlci; |
912 | 910 | ||
@@ -927,7 +925,6 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm) | |||
927 | if (len == 0) | 925 | if (len == 0) |
928 | i++; | 926 | i++; |
929 | } | 927 | } |
930 | spin_unlock_irqrestore(&gsm->tx_lock, flags); | ||
931 | } | 928 | } |
932 | 929 | ||
933 | /** | 930 | /** |
@@ -2230,12 +2227,16 @@ static int gsmld_open(struct tty_struct *tty) | |||
2230 | static void gsmld_write_wakeup(struct tty_struct *tty) | 2227 | static void gsmld_write_wakeup(struct tty_struct *tty) |
2231 | { | 2228 | { |
2232 | struct gsm_mux *gsm = tty->disc_data; | 2229 | struct gsm_mux *gsm = tty->disc_data; |
2230 | unsigned long flags; | ||
2233 | 2231 | ||
2234 | /* Queue poll */ | 2232 | /* Queue poll */ |
2235 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 2233 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
2236 | gsm_data_kick(gsm); | 2234 | gsm_data_kick(gsm); |
2237 | if (gsm->tx_bytes < TX_THRESH_LO) | 2235 | if (gsm->tx_bytes < TX_THRESH_LO) { |
2236 | spin_lock_irqsave(&gsm->tx_lock, flags); | ||
2238 | gsm_dlci_data_sweep(gsm); | 2237 | gsm_dlci_data_sweep(gsm); |
2238 | spin_unlock_irqrestore(&gsm->tx_lock, flags); | ||
2239 | } | ||
2239 | } | 2240 | } |
2240 | 2241 | ||
2241 | /** | 2242 | /** |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8c99bf1b5e9f..942a9826bd23 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -529,6 +529,10 @@ static bool will_write_block(struct port *port) | |||
529 | { | 529 | { |
530 | bool ret; | 530 | bool ret; |
531 | 531 | ||
532 | if (!port->guest_connected) { | ||
533 | /* Port got hot-unplugged. Let's exit. */ | ||
534 | return false; | ||
535 | } | ||
532 | if (!port->host_connected) | 536 | if (!port->host_connected) |
533 | return true; | 537 | return true; |
534 | 538 | ||
@@ -1099,6 +1103,13 @@ static int remove_port(struct port *port) | |||
1099 | { | 1103 | { |
1100 | struct port_buffer *buf; | 1104 | struct port_buffer *buf; |
1101 | 1105 | ||
1106 | if (port->guest_connected) { | ||
1107 | port->guest_connected = false; | ||
1108 | port->host_connected = false; | ||
1109 | wake_up_interruptible(&port->waitqueue); | ||
1110 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); | ||
1111 | } | ||
1112 | |||
1102 | spin_lock_irq(&port->portdev->ports_lock); | 1113 | spin_lock_irq(&port->portdev->ports_lock); |
1103 | list_del(&port->list); | 1114 | list_del(&port->list); |
1104 | spin_unlock_irq(&port->portdev->ports_lock); | 1115 | spin_unlock_irq(&port->portdev->ports_lock); |
@@ -1120,9 +1131,6 @@ static int remove_port(struct port *port) | |||
1120 | hvc_remove(port->cons.hvc); | 1131 | hvc_remove(port->cons.hvc); |
1121 | #endif | 1132 | #endif |
1122 | } | 1133 | } |
1123 | if (port->guest_connected) | ||
1124 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); | ||
1125 | |||
1126 | sysfs_remove_group(&port->dev->kobj, &port_attribute_group); | 1134 | sysfs_remove_group(&port->dev->kobj, &port_attribute_group); |
1127 | device_destroy(pdrvdata.class, port->dev->devt); | 1135 | device_destroy(pdrvdata.class, port->dev->devt); |
1128 | cdev_del(&port->cdev); | 1136 | cdev_del(&port->cdev); |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 6aa10284104a..cb19dbc52136 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -1303,7 +1303,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
1303 | if (!perm) | 1303 | if (!perm) |
1304 | goto eperm; | 1304 | goto eperm; |
1305 | ret = copy_from_user(&ui, up, sizeof(struct unimapinit)); | 1305 | ret = copy_from_user(&ui, up, sizeof(struct unimapinit)); |
1306 | if (!ret) | 1306 | if (ret) |
1307 | ret = -EFAULT; | ||
1308 | else | ||
1307 | con_clear_unimap(vc, &ui); | 1309 | con_clear_unimap(vc, &ui); |
1308 | break; | 1310 | break; |
1309 | } | 1311 | } |