diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-17 09:37:55 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-17 09:37:55 -0400 |
commit | 327b6b08d6ab3bf5488120ba02ed2fe06b09efe6 (patch) | |
tree | 592b0ebc2f5f18dac0bdc0fd6ba87d2c8b07b232 /drivers | |
parent | c973b112c76c9d8fd042991128f218a738cc8d0a (diff) | |
parent | 2ad56496627630ebc99f06af5f81ca23e17e014e (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers')
58 files changed, 374 insertions, 822 deletions
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c index 2934475d67d6..61ea70742d49 100644 --- a/drivers/acpi/motherboard.c +++ b/drivers/acpi/motherboard.c | |||
@@ -43,7 +43,7 @@ ACPI_MODULE_NAME ("acpi_motherboard") | |||
43 | */ | 43 | */ |
44 | #define IS_RESERVED_ADDR(base, len) \ | 44 | #define IS_RESERVED_ADDR(base, len) \ |
45 | (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ | 45 | (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ |
46 | && ((base) + (len) > 0x1000)) | 46 | && ((base) + (len) > PCIBIOS_MIN_IO)) |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Clearing the flag (IORESOURCE_BUSY) allows drivers to use | 49 | * Clearing the flag (IORESOURCE_BUSY) allows drivers to use |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 7289da3c4db6..0d11d6e6abd6 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(acpi_in_debugger); | |||
71 | extern char line_buf[80]; | 71 | extern char line_buf[80]; |
72 | #endif /*ENABLE_DEBUGGER*/ | 72 | #endif /*ENABLE_DEBUGGER*/ |
73 | 73 | ||
74 | int acpi_specific_hotkey_enabled; | 74 | int acpi_specific_hotkey_enabled = TRUE; |
75 | EXPORT_SYMBOL(acpi_specific_hotkey_enabled); | 75 | EXPORT_SYMBOL(acpi_specific_hotkey_enabled); |
76 | 76 | ||
77 | static unsigned int acpi_irq_irq; | 77 | static unsigned int acpi_irq_irq; |
@@ -1162,11 +1162,11 @@ __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup); | |||
1162 | int __init | 1162 | int __init |
1163 | acpi_hotkey_setup(char *str) | 1163 | acpi_hotkey_setup(char *str) |
1164 | { | 1164 | { |
1165 | acpi_specific_hotkey_enabled = TRUE; | 1165 | acpi_specific_hotkey_enabled = FALSE; |
1166 | return 1; | 1166 | return 1; |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | __setup("acpi_specific_hotkey", acpi_hotkey_setup); | 1169 | __setup("acpi_generic_hotkey", acpi_hotkey_setup); |
1170 | 1170 | ||
1171 | /* | 1171 | /* |
1172 | * max_cstate is defined in the base kernel so modules can | 1172 | * max_cstate is defined in the base kernel so modules can |
diff --git a/drivers/base/class.c b/drivers/base/class.c index 479c12570881..0154a1623b21 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -299,6 +299,11 @@ static void class_dev_release(struct kobject * kobj) | |||
299 | 299 | ||
300 | pr_debug("device class '%s': release.\n", cd->class_id); | 300 | pr_debug("device class '%s': release.\n", cd->class_id); |
301 | 301 | ||
302 | if (cd->devt_attr) { | ||
303 | kfree(cd->devt_attr); | ||
304 | cd->devt_attr = NULL; | ||
305 | } | ||
306 | |||
302 | if (cls->release) | 307 | if (cls->release) |
303 | cls->release(cd); | 308 | cls->release(cd); |
304 | else { | 309 | else { |
@@ -591,11 +596,8 @@ void class_device_del(struct class_device *class_dev) | |||
591 | 596 | ||
592 | if (class_dev->dev) | 597 | if (class_dev->dev) |
593 | sysfs_remove_link(&class_dev->kobj, "device"); | 598 | sysfs_remove_link(&class_dev->kobj, "device"); |
594 | if (class_dev->devt_attr) { | 599 | if (class_dev->devt_attr) |
595 | class_device_remove_file(class_dev, class_dev->devt_attr); | 600 | class_device_remove_file(class_dev, class_dev->devt_attr); |
596 | kfree(class_dev->devt_attr); | ||
597 | class_dev->devt_attr = NULL; | ||
598 | } | ||
599 | class_device_remove_attrs(class_dev); | 601 | class_device_remove_attrs(class_dev); |
600 | 602 | ||
601 | kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); | 603 | kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 42187381506b..850a78c9c4bc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -261,7 +261,11 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma) | |||
261 | 261 | ||
262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | 262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) |
263 | { | 263 | { |
264 | unsigned long long val; | 264 | unsigned long pfn; |
265 | |||
266 | /* Turn a kernel-virtual address into a physical page frame */ | ||
267 | pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; | ||
268 | |||
265 | /* | 269 | /* |
266 | * RED-PEN: on some architectures there is more mapped memory | 270 | * RED-PEN: on some architectures there is more mapped memory |
267 | * than available in mem_map which pfn_valid checks | 271 | * than available in mem_map which pfn_valid checks |
@@ -269,10 +273,10 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | |||
269 | * | 273 | * |
270 | * RED-PEN: vmalloc is not supported right now. | 274 | * RED-PEN: vmalloc is not supported right now. |
271 | */ | 275 | */ |
272 | if (!pfn_valid(vma->vm_pgoff)) | 276 | if (!pfn_valid(pfn)) |
273 | return -EIO; | 277 | return -EIO; |
274 | val = (u64)vma->vm_pgoff << PAGE_SHIFT; | 278 | |
275 | vma->vm_pgoff = __pa(val) >> PAGE_SHIFT; | 279 | vma->vm_pgoff = pfn; |
276 | return mmap_mem(file, vma); | 280 | return mmap_mem(file, vma); |
277 | } | 281 | } |
278 | 282 | ||
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index f975dab1ddf9..a13395e2c372 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * i8xx_tco 0.07: TCO timer driver for i8xx chipsets | 2 | * i8xx_tco: TCO timer driver for i8xx chipsets |
3 | * | 3 | * |
4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. | 4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. |
5 | * http://www.kernelconcepts.de | 5 | * http://www.kernelconcepts.de |
@@ -63,6 +63,9 @@ | |||
63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> | 63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> |
64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW | 64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW |
65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. | 65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. |
66 | * 20050807 Wim Van Sebroeck <wim@iguana.be> | ||
67 | * 0.08 Make sure that the watchdog is only "armed" when started. | ||
68 | * (Kernel Bug 4251) | ||
66 | */ | 69 | */ |
67 | 70 | ||
68 | /* | 71 | /* |
@@ -87,7 +90,7 @@ | |||
87 | #include "i8xx_tco.h" | 90 | #include "i8xx_tco.h" |
88 | 91 | ||
89 | /* Module and version information */ | 92 | /* Module and version information */ |
90 | #define TCO_VERSION "0.07" | 93 | #define TCO_VERSION "0.08" |
91 | #define TCO_MODULE_NAME "i8xx TCO timer" | 94 | #define TCO_MODULE_NAME "i8xx TCO timer" |
92 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 95 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
93 | #define PFX TCO_MODULE_NAME ": " | 96 | #define PFX TCO_MODULE_NAME ": " |
@@ -125,10 +128,18 @@ static int tco_timer_start (void) | |||
125 | unsigned char val; | 128 | unsigned char val; |
126 | 129 | ||
127 | spin_lock(&tco_lock); | 130 | spin_lock(&tco_lock); |
131 | |||
132 | /* disable chipset's NO_REBOOT bit */ | ||
133 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
134 | val &= 0xfd; | ||
135 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
136 | |||
137 | /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */ | ||
128 | val = inb (TCO1_CNT + 1); | 138 | val = inb (TCO1_CNT + 1); |
129 | val &= 0xf7; | 139 | val &= 0xf7; |
130 | outb (val, TCO1_CNT + 1); | 140 | outb (val, TCO1_CNT + 1); |
131 | val = inb (TCO1_CNT + 1); | 141 | val = inb (TCO1_CNT + 1); |
142 | |||
132 | spin_unlock(&tco_lock); | 143 | spin_unlock(&tco_lock); |
133 | 144 | ||
134 | if (val & 0x08) | 145 | if (val & 0x08) |
@@ -138,13 +149,20 @@ static int tco_timer_start (void) | |||
138 | 149 | ||
139 | static int tco_timer_stop (void) | 150 | static int tco_timer_stop (void) |
140 | { | 151 | { |
141 | unsigned char val; | 152 | unsigned char val, val1; |
142 | 153 | ||
143 | spin_lock(&tco_lock); | 154 | spin_lock(&tco_lock); |
155 | /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */ | ||
144 | val = inb (TCO1_CNT + 1); | 156 | val = inb (TCO1_CNT + 1); |
145 | val |= 0x08; | 157 | val |= 0x08; |
146 | outb (val, TCO1_CNT + 1); | 158 | outb (val, TCO1_CNT + 1); |
147 | val = inb (TCO1_CNT + 1); | 159 | val = inb (TCO1_CNT + 1); |
160 | |||
161 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
162 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | ||
163 | val1 |= 0x02; | ||
164 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
165 | |||
148 | spin_unlock(&tco_lock); | 166 | spin_unlock(&tco_lock); |
149 | 167 | ||
150 | if ((val & 0x08) == 0) | 168 | if ((val & 0x08) == 0) |
@@ -155,6 +173,7 @@ static int tco_timer_stop (void) | |||
155 | static int tco_timer_keepalive (void) | 173 | static int tco_timer_keepalive (void) |
156 | { | 174 | { |
157 | spin_lock(&tco_lock); | 175 | spin_lock(&tco_lock); |
176 | /* Reload the timer by writing to the TCO Timer Reload register */ | ||
158 | outb (0x01, TCO1_RLD); | 177 | outb (0x01, TCO1_RLD); |
159 | spin_unlock(&tco_lock); | 178 | spin_unlock(&tco_lock); |
160 | return 0; | 179 | return 0; |
@@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
417 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); | 436 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); |
418 | return 0; | 437 | return 0; |
419 | } | 438 | } |
420 | /* | 439 | |
421 | * Check chipset's NO_REBOOT bit | 440 | /* Check chipset's NO_REBOOT bit */ |
422 | */ | ||
423 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | 441 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); |
424 | if (val1 & 0x02) { | 442 | if (val1 & 0x02) { |
425 | val1 &= 0xfd; | 443 | val1 &= 0xfd; |
@@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
430 | return 0; /* Cannot reset NO_REBOOT bit */ | 448 | return 0; /* Cannot reset NO_REBOOT bit */ |
431 | } | 449 | } |
432 | } | 450 | } |
451 | /* Disable reboots untill the watchdog starts */ | ||
452 | val1 |= 0x02; | ||
453 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
454 | |||
433 | /* Set the TCO_EN bit in SMI_EN register */ | 455 | /* Set the TCO_EN bit in SMI_EN register */ |
434 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { | 456 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { |
435 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | 457 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", |
@@ -505,17 +527,10 @@ out: | |||
505 | 527 | ||
506 | static void __exit watchdog_cleanup (void) | 528 | static void __exit watchdog_cleanup (void) |
507 | { | 529 | { |
508 | u8 val; | ||
509 | |||
510 | /* Stop the timer before we leave */ | 530 | /* Stop the timer before we leave */ |
511 | if (!nowayout) | 531 | if (!nowayout) |
512 | tco_timer_stop (); | 532 | tco_timer_stop (); |
513 | 533 | ||
514 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
515 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
516 | val |= 0x02; | ||
517 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
518 | |||
519 | /* Deregister */ | 534 | /* Deregister */ |
520 | misc_deregister (&i8xx_tco_miscdev); | 535 | misc_deregister (&i8xx_tco_miscdev); |
521 | unregister_reboot_notifier(&i8xx_tco_notifier); | 536 | unregister_reboot_notifier(&i8xx_tco_notifier); |
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 1c99536b673b..fa503ed9f86d 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <asm/sibyte/sb1250_smbus.h> | 23 | #include <asm/sibyte/sb1250_smbus.h> |
24 | 24 | ||
25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { | 25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { |
26 | { NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) }, | 26 | { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) }, |
27 | { NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) } | 27 | { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) } |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static struct i2c_adapter sibyte_board_adapter[2] = { | 30 | static struct i2c_adapter sibyte_board_adapter[2] = { |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index f9c1acb4ed6a..c9d3a00a3c0c 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device *dev) | |||
1220 | goto failed; | 1220 | goto failed; |
1221 | 1221 | ||
1222 | g = alloc_disk_node(1 << PARTN_BITS, | 1222 | g = alloc_disk_node(1 << PARTN_BITS, |
1223 | pcibus_to_node(drive->hwif->pci_dev->bus)); | 1223 | hwif_to_node(drive->hwif)); |
1224 | if (!g) | 1224 | if (!g) |
1225 | goto out_free_idkp; | 1225 | goto out_free_idkp; |
1226 | 1226 | ||
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 94daf40ae323..c1128ae5cd2f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -960,15 +960,6 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) | |||
960 | } | 960 | } |
961 | #endif /* MAX_HWIFS > 1 */ | 961 | #endif /* MAX_HWIFS > 1 */ |
962 | 962 | ||
963 | static inline int hwif_to_node(ide_hwif_t *hwif) | ||
964 | { | ||
965 | if (hwif->pci_dev) | ||
966 | return pcibus_to_node(hwif->pci_dev->bus); | ||
967 | else | ||
968 | /* Add ways to determine the node of other busses here */ | ||
969 | return -1; | ||
970 | } | ||
971 | |||
972 | /* | 963 | /* |
973 | * init request queue | 964 | * init request queue |
974 | */ | 965 | */ |
diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index 1ab5f2dc8a2a..70f051894a3c 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c | |||
@@ -275,9 +275,9 @@ static int __init ns558_init(void) | |||
275 | 275 | ||
276 | static void __exit ns558_exit(void) | 276 | static void __exit ns558_exit(void) |
277 | { | 277 | { |
278 | struct ns558 *ns558; | 278 | struct ns558 *ns558, *safe; |
279 | 279 | ||
280 | list_for_each_entry(ns558, &ns558_list, node) { | 280 | list_for_each_entry_safe(ns558, safe, &ns558_list, node) { |
281 | gameport_unregister_port(ns558->gameport); | 281 | gameport_unregister_port(ns558->gameport); |
282 | release_region(ns558->io & ~(ns558->size - 1), ns558->size); | 282 | release_region(ns558->io & ~(ns558->size - 1), ns558->size); |
283 | kfree(ns558); | 283 | kfree(ns558); |
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index e83256d0fd14..a50a41f6f79d 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
@@ -188,7 +188,7 @@ config DVB_BCM3510 | |||
188 | support this frontend. | 188 | support this frontend. |
189 | 189 | ||
190 | config DVB_LGDT330X | 190 | config DVB_LGDT330X |
191 | tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)" | 191 | tristate "LG Electronics LGDT3302/LGDT3303 based" |
192 | depends on DVB_CORE | 192 | depends on DVB_CORE |
193 | help | 193 | help |
194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want | 194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want |
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index c48e7c11d708..1f1cd7a8d500 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c | |||
@@ -172,38 +172,6 @@ static int lgdt330x_SwReset(struct lgdt330x_state* state) | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
175 | #ifdef MUTE_TDA9887 | ||
176 | static int i2c_write_ntsc_demod (struct lgdt330x_state* state, u8 buf[2]) | ||
177 | { | ||
178 | struct i2c_msg msg = | ||
179 | { .addr = 0x43, | ||
180 | .flags = 0, | ||
181 | .buf = buf, | ||
182 | .len = 2 }; | ||
183 | int err; | ||
184 | |||
185 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | ||
186 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, msg.buf[0], msg.buf[1], err); | ||
187 | if (err < 0) | ||
188 | return err; | ||
189 | else | ||
190 | return -EREMOTEIO; | ||
191 | } | ||
192 | return 0; | ||
193 | } | ||
194 | |||
195 | static void fiddle_with_ntsc_if_demod(struct lgdt330x_state* state) | ||
196 | { | ||
197 | // Experimental code | ||
198 | u8 buf0[] = {0x00, 0x20}; | ||
199 | u8 buf1[] = {0x01, 0x00}; | ||
200 | u8 buf2[] = {0x02, 0x00}; | ||
201 | |||
202 | i2c_write_ntsc_demod(state, buf0); | ||
203 | i2c_write_ntsc_demod(state, buf1); | ||
204 | i2c_write_ntsc_demod(state, buf2); | ||
205 | } | ||
206 | #endif | ||
207 | 175 | ||
208 | static int lgdt330x_init(struct dvb_frontend* fe) | 176 | static int lgdt330x_init(struct dvb_frontend* fe) |
209 | { | 177 | { |
@@ -267,9 +235,6 @@ static int lgdt330x_init(struct dvb_frontend* fe) | |||
267 | chip_name = "LGDT3303"; | 235 | chip_name = "LGDT3303"; |
268 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, | 236 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, |
269 | sizeof(lgdt3303_init_data)); | 237 | sizeof(lgdt3303_init_data)); |
270 | #ifdef MUTE_TDA9887 | ||
271 | fiddle_with_ntsc_if_demod(state); | ||
272 | #endif | ||
273 | break; | 238 | break; |
274 | default: | 239 | default: |
275 | chip_name = "undefined"; | 240 | chip_name = "undefined"; |
@@ -772,7 +737,7 @@ error: | |||
772 | 737 | ||
773 | static struct dvb_frontend_ops lgdt3302_ops = { | 738 | static struct dvb_frontend_ops lgdt3302_ops = { |
774 | .info = { | 739 | .info = { |
775 | .name= "LG Electronics LGDT3302/LGDT3303 VSB/QAM Frontend", | 740 | .name= "LG Electronics LGDT3302 VSB/QAM Frontend", |
776 | .type = FE_ATSC, | 741 | .type = FE_ATSC, |
777 | .frequency_min= 54000000, | 742 | .frequency_min= 54000000, |
778 | .frequency_max= 858000000, | 743 | .frequency_max= 858000000, |
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 06e8eb19a05c..43a942a29c2e 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
@@ -53,6 +53,9 @@ config I2O_CONFIG | |||
53 | To compile this support as a module, choose M here: the | 53 | To compile this support as a module, choose M here: the |
54 | module will be called i2o_config. | 54 | module will be called i2o_config. |
55 | 55 | ||
56 | Note: If you want to use the new API you have to download the | ||
57 | i2o_config patch from http://i2o.shadowconnect.com/ | ||
58 | |||
56 | config I2O_CONFIG_OLD_IOCTL | 59 | config I2O_CONFIG_OLD_IOCTL |
57 | bool "Enable ioctls (OBSOLETE)" | 60 | bool "Enable ioctls (OBSOLETE)" |
58 | depends on I2O_CONFIG | 61 | depends on I2O_CONFIG |
diff --git a/drivers/message/i2o/config-osm.c b/drivers/message/i2o/config-osm.c index fe2e7afc9eae..af32ab4e90cd 100644 --- a/drivers/message/i2o/config-osm.c +++ b/drivers/message/i2o/config-osm.c | |||
@@ -30,503 +30,9 @@ | |||
30 | 30 | ||
31 | static struct i2o_driver i2o_config_driver; | 31 | static struct i2o_driver i2o_config_driver; |
32 | 32 | ||
33 | /* Special file operations for sysfs */ | ||
34 | struct fops_attribute { | ||
35 | struct bin_attribute bin; | ||
36 | struct file_operations fops; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * sysfs_read_dummy | ||
41 | */ | ||
42 | static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
43 | size_t count) | ||
44 | { | ||
45 | return 0; | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * sysfs_write_dummy | ||
50 | */ | ||
51 | static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
52 | size_t count) | ||
53 | { | ||
54 | return 0; | ||
55 | }; | ||
56 | |||
57 | /** | ||
58 | * sysfs_create_fops_file - Creates attribute with special file operations | ||
59 | * @kobj: kobject which should contains the attribute | ||
60 | * @attr: attributes which should be used to create file | ||
61 | * | ||
62 | * First creates attribute @attr in kobject @kobj. If it is the first time | ||
63 | * this function is called, merge old fops from sysfs with new one and | ||
64 | * write it back. Afterwords the new fops will be set for the created | ||
65 | * attribute. | ||
66 | * | ||
67 | * Returns 0 on success or negative error code on failure. | ||
68 | */ | ||
69 | static int sysfs_create_fops_file(struct kobject *kobj, | ||
70 | struct fops_attribute *attr) | ||
71 | { | ||
72 | struct file_operations tmp, *fops; | ||
73 | struct dentry *d; | ||
74 | struct qstr qstr; | ||
75 | int rc; | ||
76 | |||
77 | fops = &attr->fops; | ||
78 | |||
79 | if (fops->read) | ||
80 | attr->bin.read = sysfs_read_dummy; | ||
81 | |||
82 | if (fops->write) | ||
83 | attr->bin.write = sysfs_write_dummy; | ||
84 | |||
85 | if ((rc = sysfs_create_bin_file(kobj, &attr->bin))) | ||
86 | return rc; | ||
87 | |||
88 | qstr.name = attr->bin.attr.name; | ||
89 | qstr.len = strlen(qstr.name); | ||
90 | qstr.hash = full_name_hash(qstr.name, qstr.len); | ||
91 | |||
92 | if ((d = lookup_hash(&qstr, kobj->dentry))) { | ||
93 | if (!fops->owner) { | ||
94 | memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp)); | ||
95 | if (fops->read) | ||
96 | tmp.read = fops->read; | ||
97 | if (fops->write) | ||
98 | tmp.write = fops->write; | ||
99 | memcpy(fops, &tmp, sizeof(tmp)); | ||
100 | } | ||
101 | |||
102 | d->d_inode->i_fop = fops; | ||
103 | } else | ||
104 | sysfs_remove_bin_file(kobj, &attr->bin); | ||
105 | |||
106 | return -ENOENT; | ||
107 | }; | ||
108 | |||
109 | /** | ||
110 | * sysfs_remove_fops_file - Remove attribute with special file operations | ||
111 | * @kobj: kobject which contains the attribute | ||
112 | * @attr: attributes which are used to create file | ||
113 | * | ||
114 | * Only wrapper arround sysfs_remove_bin_file() | ||
115 | * | ||
116 | * Returns 0 on success or negative error code on failure. | ||
117 | */ | ||
118 | static inline int sysfs_remove_fops_file(struct kobject *kobj, | ||
119 | struct fops_attribute *attr) | ||
120 | { | ||
121 | return sysfs_remove_bin_file(kobj, &attr->bin); | ||
122 | }; | ||
123 | |||
124 | /** | ||
125 | * i2o_config_read_hrt - Returns the HRT of the controller | ||
126 | * @kob: kernel object handle | ||
127 | * @buf: buffer into which the HRT should be copied | ||
128 | * @off: file offset | ||
129 | * @count: number of bytes to read | ||
130 | * | ||
131 | * Put @count bytes starting at @off into @buf from the HRT of the I2O | ||
132 | * controller corresponding to @kobj. | ||
133 | * | ||
134 | * Returns number of bytes copied into buffer. | ||
135 | */ | ||
136 | static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf, | ||
137 | loff_t offset, size_t count) | ||
138 | { | ||
139 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
140 | i2o_hrt *hrt = c->hrt.virt; | ||
141 | |||
142 | u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4; | ||
143 | |||
144 | if (offset > size) | ||
145 | return 0; | ||
146 | |||
147 | if (offset + count > size) | ||
148 | count = size - offset; | ||
149 | |||
150 | memcpy(buf, (u8 *) hrt + offset, count); | ||
151 | |||
152 | return count; | ||
153 | }; | ||
154 | |||
155 | /** | ||
156 | * i2o_config_read_lct - Returns the LCT of the controller | ||
157 | * @kob: kernel object handle | ||
158 | * @buf: buffer into which the LCT should be copied | ||
159 | * @off: file offset | ||
160 | * @count: number of bytes to read | ||
161 | * | ||
162 | * Put @count bytes starting at @off into @buf from the LCT of the I2O | ||
163 | * controller corresponding to @kobj. | ||
164 | * | ||
165 | * Returns number of bytes copied into buffer. | ||
166 | */ | ||
167 | static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf, | ||
168 | loff_t offset, size_t count) | ||
169 | { | ||
170 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
171 | u32 size = c->lct->table_size * 4; | ||
172 | |||
173 | if (offset > size) | ||
174 | return 0; | ||
175 | |||
176 | if (offset + count > size) | ||
177 | count = size - offset; | ||
178 | |||
179 | memcpy(buf, (u8 *) c->lct + offset, count); | ||
180 | |||
181 | return count; | ||
182 | }; | ||
183 | |||
184 | #define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \ | ||
185 | static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \ | ||
186 | return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \ | ||
187 | };\ | ||
188 | \ | ||
189 | static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \ | ||
190 | return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \ | ||
191 | }; \ | ||
192 | \ | ||
193 | static struct fops_attribute i2o_config_attr_##_name = { \ | ||
194 | .bin = { .attr = { .name = __stringify(_name), .mode = _mode, \ | ||
195 | .owner = THIS_MODULE }, \ | ||
196 | .size = 0, }, \ | ||
197 | .fops = { .write = i2o_config_##_name##_write, \ | ||
198 | .read = i2o_config_##_name##_read} \ | ||
199 | }; | ||
200 | |||
201 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
202 | |||
203 | /** | ||
204 | * i2o_config_dpt_reagion - Converts type and id to flash region | ||
205 | * @swtype: type of software module reading | ||
206 | * @swid: id of software which should be read | ||
207 | * | ||
208 | * Converts type and id from I2O spec to the matching region for DPT / | ||
209 | * Adaptec controllers. | ||
210 | * | ||
211 | * Returns region which match type and id or -1 on error. | ||
212 | */ | ||
213 | static u32 i2o_config_dpt_region(u8 swtype, u8 swid) | ||
214 | { | ||
215 | switch (swtype) { | ||
216 | case I2O_SOFTWARE_MODULE_IRTOS: | ||
217 | /* | ||
218 | * content: operation firmware | ||
219 | * region size: | ||
220 | * 0xbc000 for 2554, 3754, 2564, 3757 | ||
221 | * 0x170000 for 2865 | ||
222 | * 0x17c000 for 3966 | ||
223 | */ | ||
224 | if (!swid) | ||
225 | return 0; | ||
226 | |||
227 | break; | ||
228 | |||
229 | case I2O_SOFTWARE_MODULE_IOP_PRIVATE: | ||
230 | /* | ||
231 | * content: BIOS and SMOR | ||
232 | * BIOS size: first 0x8000 bytes | ||
233 | * region size: | ||
234 | * 0x40000 for 2554, 3754, 2564, 3757 | ||
235 | * 0x80000 for 2865, 3966 | ||
236 | */ | ||
237 | if (!swid) | ||
238 | return 1; | ||
239 | |||
240 | break; | ||
241 | |||
242 | case I2O_SOFTWARE_MODULE_IOP_CONFIG: | ||
243 | switch (swid) { | ||
244 | case 0: | ||
245 | /* | ||
246 | * content: NVRAM defaults | ||
247 | * region size: 0x2000 bytes | ||
248 | */ | ||
249 | return 2; | ||
250 | case 1: | ||
251 | /* | ||
252 | * content: serial number | ||
253 | * region size: 0x2000 bytes | ||
254 | */ | ||
255 | return 3; | ||
256 | } | ||
257 | break; | ||
258 | } | ||
259 | |||
260 | return -1; | ||
261 | }; | ||
262 | |||
263 | #endif | ||
264 | |||
265 | /** | ||
266 | * i2o_config_sw_read - Read a software module from controller | ||
267 | * @file: file pointer | ||
268 | * @buf: buffer into which the data should be copied | ||
269 | * @count: number of bytes to read | ||
270 | * @off: file offset | ||
271 | * @swtype: type of software module reading | ||
272 | * @swid: id of software which should be read | ||
273 | * | ||
274 | * Transfers @count bytes at offset @offset from IOP into buffer using | ||
275 | * type @swtype and id @swid as described in I2O spec. | ||
276 | * | ||
277 | * Returns number of bytes copied into buffer or error code on failure. | ||
278 | */ | ||
279 | static ssize_t i2o_config_sw_read(struct file *file, char __user * buf, | ||
280 | size_t count, loff_t * offset, u8 swtype, | ||
281 | u32 swid) | ||
282 | { | ||
283 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
284 | struct kobject *kobj = sd->s_element; | ||
285 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
286 | u32 m, function = I2O_CMD_SW_UPLOAD; | ||
287 | struct i2o_dma buffer; | ||
288 | struct i2o_message __iomem *msg; | ||
289 | u32 __iomem *mptr; | ||
290 | int rc, status; | ||
291 | |||
292 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
293 | if (m == I2O_QUEUE_EMPTY) | ||
294 | return -EBUSY; | ||
295 | |||
296 | mptr = &msg->body[3]; | ||
297 | |||
298 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) { | ||
299 | i2o_msg_nop(c, m); | ||
300 | return rc; | ||
301 | } | ||
302 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
303 | if (c->adaptec) { | ||
304 | mptr = &msg->body[4]; | ||
305 | function = I2O_CMD_PRIVATE; | ||
306 | |||
307 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
308 | |||
309 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ, | ||
310 | &msg->body[0]); | ||
311 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
312 | writel(*offset, &msg->body[2]); | ||
313 | writel(count, &msg->body[3]); | ||
314 | } else | ||
315 | #endif | ||
316 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
317 | |||
318 | writel(0xD0000000 | count, mptr++); | ||
319 | writel(buffer.phys, mptr); | ||
320 | |||
321 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
322 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
323 | writel(0, &msg->u.head[3]); | ||
324 | |||
325 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
326 | if (!c->adaptec) | ||
327 | #endif | ||
328 | { | ||
329 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
330 | writel(0, &msg->body[1]); | ||
331 | writel(swid, &msg->body[2]); | ||
332 | } | ||
333 | |||
334 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
335 | |||
336 | if (status == I2O_POST_WAIT_OK) { | ||
337 | if (!(rc = copy_to_user(buf, buffer.virt, count))) { | ||
338 | rc = count; | ||
339 | *offset += count; | ||
340 | } | ||
341 | } else | ||
342 | rc = -EIO; | ||
343 | |||
344 | if (status != -ETIMEDOUT) | ||
345 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
346 | |||
347 | return rc; | ||
348 | }; | ||
349 | |||
350 | /** | ||
351 | * i2o_config_sw_write - Write a software module to controller | ||
352 | * @file: file pointer | ||
353 | * @buf: buffer into which the data should be copied | ||
354 | * @count: number of bytes to read | ||
355 | * @off: file offset | ||
356 | * @swtype: type of software module writing | ||
357 | * @swid: id of software which should be written | ||
358 | * | ||
359 | * Transfers @count bytes at offset @offset from buffer to IOP using | ||
360 | * type @swtype and id @swid as described in I2O spec. | ||
361 | * | ||
362 | * Returns number of bytes copied from buffer or error code on failure. | ||
363 | */ | ||
364 | static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf, | ||
365 | size_t count, loff_t * offset, u8 swtype, | ||
366 | u32 swid) | ||
367 | { | ||
368 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
369 | struct kobject *kobj = sd->s_element; | ||
370 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
371 | u32 m, function = I2O_CMD_SW_DOWNLOAD; | ||
372 | struct i2o_dma buffer; | ||
373 | struct i2o_message __iomem *msg; | ||
374 | u32 __iomem *mptr; | ||
375 | int rc, status; | ||
376 | |||
377 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
378 | if (m == I2O_QUEUE_EMPTY) | ||
379 | return -EBUSY; | ||
380 | |||
381 | mptr = &msg->body[3]; | ||
382 | |||
383 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) | ||
384 | goto nop_msg; | ||
385 | |||
386 | if ((rc = copy_from_user(buffer.virt, buf, count))) | ||
387 | goto free_buffer; | ||
388 | |||
389 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
390 | if (c->adaptec) { | ||
391 | mptr = &msg->body[4]; | ||
392 | function = I2O_CMD_PRIVATE; | ||
393 | |||
394 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
395 | |||
396 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE, | ||
397 | &msg->body[0]); | ||
398 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
399 | writel(*offset, &msg->body[2]); | ||
400 | writel(count, &msg->body[3]); | ||
401 | } else | ||
402 | #endif | ||
403 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
404 | |||
405 | writel(0xD4000000 | count, mptr++); | ||
406 | writel(buffer.phys, mptr); | ||
407 | |||
408 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
409 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
410 | writel(0, &msg->u.head[3]); | ||
411 | |||
412 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
413 | if (!c->adaptec) | ||
414 | #endif | ||
415 | { | ||
416 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
417 | writel(0, &msg->body[1]); | ||
418 | writel(swid, &msg->body[2]); | ||
419 | } | ||
420 | |||
421 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
422 | |||
423 | if (status != -ETIMEDOUT) | ||
424 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
425 | |||
426 | if (status != I2O_POST_WAIT_OK) | ||
427 | return -EIO; | ||
428 | |||
429 | *offset += count; | ||
430 | |||
431 | return count; | ||
432 | |||
433 | free_buffer: | ||
434 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
435 | |||
436 | nop_msg: | ||
437 | i2o_msg_nop(c, m); | ||
438 | |||
439 | return rc; | ||
440 | }; | ||
441 | |||
442 | /* attribute for HRT in sysfs */ | ||
443 | static struct bin_attribute i2o_config_hrt_attr = { | ||
444 | .attr = { | ||
445 | .name = "hrt", | ||
446 | .mode = S_IRUGO, | ||
447 | .owner = THIS_MODULE}, | ||
448 | .size = 0, | ||
449 | .read = i2o_config_read_hrt | ||
450 | }; | ||
451 | |||
452 | /* attribute for LCT in sysfs */ | ||
453 | static struct bin_attribute i2o_config_lct_attr = { | ||
454 | .attr = { | ||
455 | .name = "lct", | ||
456 | .mode = S_IRUGO, | ||
457 | .owner = THIS_MODULE}, | ||
458 | .size = 0, | ||
459 | .read = i2o_config_read_lct | ||
460 | }; | ||
461 | |||
462 | /* IRTOS firmware access */ | ||
463 | I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0); | ||
464 | |||
465 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
466 | |||
467 | /* | ||
468 | * attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec | ||
469 | * controllers | ||
470 | */ | ||
471 | I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0); | ||
472 | I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0); | ||
473 | I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1); | ||
474 | |||
475 | #endif | ||
476 | |||
477 | /** | ||
478 | * i2o_config_notify_controller_add - Notify of added controller | ||
479 | * @c: the controller which was added | ||
480 | * | ||
481 | * If a I2O controller is added, we catch the notification to add sysfs | ||
482 | * entries. | ||
483 | */ | ||
484 | static void i2o_config_notify_controller_add(struct i2o_controller *c) | ||
485 | { | ||
486 | struct kobject *kobj = &c->exec->device.kobj; | ||
487 | |||
488 | sysfs_create_bin_file(kobj, &i2o_config_hrt_attr); | ||
489 | sysfs_create_bin_file(kobj, &i2o_config_lct_attr); | ||
490 | |||
491 | sysfs_create_fops_file(kobj, &i2o_config_attr_irtos); | ||
492 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
493 | if (c->adaptec) { | ||
494 | sysfs_create_fops_file(kobj, &i2o_config_attr_bios); | ||
495 | sysfs_create_fops_file(kobj, &i2o_config_attr_nvram); | ||
496 | sysfs_create_fops_file(kobj, &i2o_config_attr_serial); | ||
497 | } | ||
498 | #endif | ||
499 | }; | ||
500 | |||
501 | /** | ||
502 | * i2o_config_notify_controller_remove - Notify of removed controller | ||
503 | * @c: the controller which was removed | ||
504 | * | ||
505 | * If a I2O controller is removed, we catch the notification to remove the | ||
506 | * sysfs entries. | ||
507 | */ | ||
508 | static void i2o_config_notify_controller_remove(struct i2o_controller *c) | ||
509 | { | ||
510 | struct kobject *kobj = &c->exec->device.kobj; | ||
511 | |||
512 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
513 | if (c->adaptec) { | ||
514 | sysfs_remove_fops_file(kobj, &i2o_config_attr_serial); | ||
515 | sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram); | ||
516 | sysfs_remove_fops_file(kobj, &i2o_config_attr_bios); | ||
517 | } | ||
518 | #endif | ||
519 | sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos); | ||
520 | |||
521 | sysfs_remove_bin_file(kobj, &i2o_config_lct_attr); | ||
522 | sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr); | ||
523 | }; | ||
524 | |||
525 | /* Config OSM driver struct */ | 33 | /* Config OSM driver struct */ |
526 | static struct i2o_driver i2o_config_driver = { | 34 | static struct i2o_driver i2o_config_driver = { |
527 | .name = OSM_NAME, | 35 | .name = OSM_NAME, |
528 | .notify_controller_add = i2o_config_notify_controller_add, | ||
529 | .notify_controller_remove = i2o_config_notify_controller_remove | ||
530 | }; | 36 | }; |
531 | 37 | ||
532 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | 38 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL |
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index 7a60fd7be8ad..66c03e882570 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/i2o.h> | 32 | #include <linux/i2o.h> |
33 | #include "core.h" | 33 | #include "core.h" |
34 | 34 | ||
35 | #define OSM_DESCRIPTION "I2O-subsystem" | ||
36 | |||
35 | /* PCI device id table for all I2O controllers */ | 37 | /* PCI device id table for all I2O controllers */ |
36 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { | 38 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { |
37 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, | 39 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, |
@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c) | |||
66 | 68 | ||
67 | if (c->base.virt) | 69 | if (c->base.virt) |
68 | iounmap(c->base.virt); | 70 | iounmap(c->base.virt); |
71 | |||
72 | pci_release_regions(c->pdev); | ||
69 | } | 73 | } |
70 | 74 | ||
71 | /** | 75 | /** |
@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
84 | struct device *dev = &pdev->dev; | 88 | struct device *dev = &pdev->dev; |
85 | int i; | 89 | int i; |
86 | 90 | ||
91 | if (pci_request_regions(pdev, OSM_DESCRIPTION)) { | ||
92 | printk(KERN_ERR "%s: device already claimed\n", c->name); | ||
93 | return -ENODEV; | ||
94 | } | ||
95 | |||
87 | for (i = 0; i < 6; i++) { | 96 | for (i = 0; i < 6; i++) { |
88 | /* Skip I/O spaces */ | 97 | /* Skip I/O spaces */ |
89 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { | 98 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { |
@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
138 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); | 147 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); |
139 | if (!c->base.virt) { | 148 | if (!c->base.virt) { |
140 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); | 149 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); |
150 | i2o_pci_free(c); | ||
141 | return -ENOMEM; | 151 | return -ENOMEM; |
142 | } | 152 | } |
143 | 153 | ||
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 8b487ed1069c..974f2f36bdbe 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "wbsd.h" | 42 | #include "wbsd.h" |
43 | 43 | ||
44 | #define DRIVER_NAME "wbsd" | 44 | #define DRIVER_NAME "wbsd" |
45 | #define DRIVER_VERSION "1.2" | 45 | #define DRIVER_VERSION "1.3" |
46 | 46 | ||
47 | #ifdef CONFIG_MMC_DEBUG | 47 | #ifdef CONFIG_MMC_DEBUG |
48 | #define DBG(x...) \ | 48 | #define DBG(x...) \ |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e5d2c3c7ce4..b82fd15d0891 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3789,6 +3789,7 @@ e1000_netpoll(struct net_device *netdev) | |||
3789 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3789 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3790 | disable_irq(adapter->pdev->irq); | 3790 | disable_irq(adapter->pdev->irq); |
3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); | 3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); |
3792 | e1000_clean_tx_irq(adapter); | ||
3792 | enable_irq(adapter->pdev->irq); | 3793 | enable_irq(adapter->pdev->irq); |
3793 | } | 3794 | } |
3794 | #endif | 3795 | #endif |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index e44f8e9055ef..f9e3be96963c 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -130,12 +130,11 @@ struct sixpack { | |||
130 | 130 | ||
131 | #define AX25_6PACK_HEADER_LEN 0 | 131 | #define AX25_6PACK_HEADER_LEN 0 |
132 | 132 | ||
133 | static void sp_start_tx_timer(struct sixpack *); | ||
134 | static void sixpack_decode(struct sixpack *, unsigned char[], int); | 133 | static void sixpack_decode(struct sixpack *, unsigned char[], int); |
135 | static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); | 134 | static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); |
136 | 135 | ||
137 | /* | 136 | /* |
138 | * perform the persistence/slottime algorithm for CSMA access. If the | 137 | * Perform the persistence/slottime algorithm for CSMA access. If the |
139 | * persistence check was successful, write the data to the serial driver. | 138 | * persistence check was successful, write the data to the serial driver. |
140 | * Note that in case of DAMA operation, the data is not sent here. | 139 | * Note that in case of DAMA operation, the data is not sent here. |
141 | */ | 140 | */ |
@@ -143,7 +142,7 @@ static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); | |||
143 | static void sp_xmit_on_air(unsigned long channel) | 142 | static void sp_xmit_on_air(unsigned long channel) |
144 | { | 143 | { |
145 | struct sixpack *sp = (struct sixpack *) channel; | 144 | struct sixpack *sp = (struct sixpack *) channel; |
146 | int actual; | 145 | int actual, when = sp->slottime; |
147 | static unsigned char random; | 146 | static unsigned char random; |
148 | 147 | ||
149 | random = random * 17 + 41; | 148 | random = random * 17 + 41; |
@@ -159,20 +158,10 @@ static void sp_xmit_on_air(unsigned long channel) | |||
159 | sp->tty->driver->write(sp->tty, &sp->led_state, 1); | 158 | sp->tty->driver->write(sp->tty, &sp->led_state, 1); |
160 | sp->status2 = 0; | 159 | sp->status2 = 0; |
161 | } else | 160 | } else |
162 | sp_start_tx_timer(sp); | 161 | mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); |
163 | } | 162 | } |
164 | 163 | ||
165 | /* ----> 6pack timer interrupt handler and friends. <---- */ | 164 | /* ----> 6pack timer interrupt handler and friends. <---- */ |
166 | static void sp_start_tx_timer(struct sixpack *sp) | ||
167 | { | ||
168 | int when = sp->slottime; | ||
169 | |||
170 | del_timer(&sp->tx_t); | ||
171 | sp->tx_t.data = (unsigned long) sp; | ||
172 | sp->tx_t.function = sp_xmit_on_air; | ||
173 | sp->tx_t.expires = jiffies + ((when + 1) * HZ) / 100; | ||
174 | add_timer(&sp->tx_t); | ||
175 | } | ||
176 | 165 | ||
177 | /* Encapsulate one AX.25 frame and stuff into a TTY queue. */ | 166 | /* Encapsulate one AX.25 frame and stuff into a TTY queue. */ |
178 | static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) | 167 | static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) |
@@ -243,8 +232,7 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) | |||
243 | sp->xleft = count; | 232 | sp->xleft = count; |
244 | sp->xhead = sp->xbuff; | 233 | sp->xhead = sp->xbuff; |
245 | sp->status2 = count; | 234 | sp->status2 = count; |
246 | if (sp->duplex == 0) | 235 | sp_xmit_on_air((unsigned long)sp); |
247 | sp_start_tx_timer(sp); | ||
248 | } | 236 | } |
249 | 237 | ||
250 | return; | 238 | return; |
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 46b294a12418..2b92b9e8c910 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | #ifndef _PCIEHP_H | 29 | #ifndef _PCIEHP_H |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index df4915dbc321..cafc7eadcf80 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 0dbcf04aa35e..0e0947601526 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1cda30bd6e47..7a0e27f0e063 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 723b12c0bb7c..33b539b34f7e 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm.h b/drivers/pci/hotplug/pciehprm.h index 966775ffb0ff..05f20fbc5f50 100644 --- a/drivers/pci/hotplug/pciehprm.h +++ b/drivers/pci/hotplug/pciehprm.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c index 57f4e6d1b27c..305b47ec2f2c 100644 --- a/drivers/pci/hotplug/pciehprm_acpi.c +++ b/drivers/pci/hotplug/pciehprm_acpi.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | * | 22 | * |
23 | * Send feedback to <dely.l.sy@intel.com> | 23 | * Send feedback to <kristen.c.accardi@intel.com> |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c index 79a0aa6238ef..3622965f8961 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.c +++ b/drivers/pci/hotplug/pciehprm_nonacpi.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.h b/drivers/pci/hotplug/pciehprm_nonacpi.h index 87c90e85ede9..b10603b0e958 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.h +++ b/drivers/pci/hotplug/pciehprm_nonacpi.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index 67b6a3370ceb..fe4d653da188 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | #ifndef _SHPCHP_H | 29 | #ifndef _SHPCHP_H |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index a70a5c5705f2..6f7d8a29957a 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 490a9553a062..783b5abb0717 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 38c5d9066697..8d98410bf1c0 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index 90113e9cd69b..d867099114ec 100644 --- a/drivers/pci/hotplug/shpchp_pci.c +++ b/drivers/pci/hotplug/shpchp_pci.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm.h b/drivers/pci/hotplug/shpchprm.h index 88aeb978c911..057b192ce589 100644 --- a/drivers/pci/hotplug/shpchprm.h +++ b/drivers/pci/hotplug/shpchprm.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c index 7957cdc72cd0..d37b31658edf 100644 --- a/drivers/pci/hotplug/shpchprm_acpi.c +++ b/drivers/pci/hotplug/shpchprm_acpi.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | * | 22 | * |
23 | * Send feedback to <dely.l.sy@intel.com> | 23 | * Send feedback to <kristen.c.accardi@intel.com> |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
diff --git a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c index 37fa77a98289..ba6c549c9b9d 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.c +++ b/drivers/pci/hotplug/shpchprm_legacy.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_legacy.h b/drivers/pci/hotplug/shpchprm_legacy.h index 29ccea5e57e5..21bda74ddfa5 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.h +++ b/drivers/pci/hotplug/shpchprm_legacy.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c index 88f4d9f41886..5f75ef7f3df2 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.c +++ b/drivers/pci/hotplug/shpchprm_nonacpi.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.h b/drivers/pci/hotplug/shpchprm_nonacpi.h index 6bc8668023c3..cddaaa5ee1b3 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.h +++ b/drivers/pci/hotplug/shpchprm_nonacpi.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index b5ab9aa6ff7c..2b85aa39f954 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -453,7 +453,7 @@ static void enable_msi_mode(struct pci_dev *dev, int pos, int type) | |||
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | static void disable_msi_mode(struct pci_dev *dev, int pos, int type) | 456 | void disable_msi_mode(struct pci_dev *dev, int pos, int type) |
457 | { | 457 | { |
458 | u16 control; | 458 | u16 control; |
459 | 459 | ||
@@ -699,6 +699,9 @@ int pci_enable_msi(struct pci_dev* dev) | |||
699 | if (!pci_msi_enable || !dev) | 699 | if (!pci_msi_enable || !dev) |
700 | return status; | 700 | return status; |
701 | 701 | ||
702 | if (dev->no_msi) | ||
703 | return status; | ||
704 | |||
702 | temp = dev->irq; | 705 | temp = dev->irq; |
703 | 706 | ||
704 | if ((status = msi_init()) < 0) | 707 | if ((status = msi_init()) < 0) |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index d94d7af4f7a0..d00168b1f662 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -47,6 +47,12 @@ extern int pci_msi_quirk; | |||
47 | #define pci_msi_quirk 0 | 47 | #define pci_msi_quirk 0 |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #ifdef CONFIG_PCI_MSI | ||
51 | void disable_msi_mode(struct pci_dev *dev, int pos, int type); | ||
52 | #else | ||
53 | static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { } | ||
54 | #endif | ||
55 | |||
50 | extern int pcie_mch_quirk; | 56 | extern int pcie_mch_quirk; |
51 | extern struct device_attribute pci_dev_attrs[]; | 57 | extern struct device_attribute pci_dev_attrs[]; |
52 | extern struct class_device_attribute class_device_attr_cpuaffinity; | 58 | extern struct class_device_attribute class_device_attr_cpuaffinity; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a9160ad16581..bb36bb69803f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1291,6 +1291,27 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quir | |||
1291 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch ); | 1291 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch ); |
1292 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch ); | 1292 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch ); |
1293 | 1293 | ||
1294 | |||
1295 | /* | ||
1296 | * It's possible for the MSI to get corrupted if shpc and acpi | ||
1297 | * are used together on certain PXH-based systems. | ||
1298 | */ | ||
1299 | static void __devinit quirk_pcie_pxh(struct pci_dev *dev) | ||
1300 | { | ||
1301 | disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI), | ||
1302 | PCI_CAP_ID_MSI); | ||
1303 | dev->no_msi = 1; | ||
1304 | |||
1305 | printk(KERN_WARNING "PCI: PXH quirk detected, " | ||
1306 | "disabling MSI for SHPC device\n"); | ||
1307 | } | ||
1308 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_0, quirk_pcie_pxh); | ||
1309 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_1, quirk_pcie_pxh); | ||
1310 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pcie_pxh); | ||
1311 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); | ||
1312 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); | ||
1313 | |||
1314 | |||
1294 | static void __devinit quirk_netmos(struct pci_dev *dev) | 1315 | static void __devinit quirk_netmos(struct pci_dev *dev) |
1295 | { | 1316 | { |
1296 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; | 1317 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; |
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index b8a2c7353b0a..d44205d52bf3 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #define __KERNEL_SYSCALLS__ | 7 | #define __KERNEL_SYSCALLS__ |
8 | 8 | ||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/kthread.h> | ||
10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
11 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
12 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task; | |||
459 | 460 | ||
460 | static int kenvctrld(void *__unused) | 461 | static int kenvctrld(void *__unused) |
461 | { | 462 | { |
462 | daemonize("kenvctrld"); | ||
463 | allow_signal(SIGKILL); | ||
464 | kenvctrld_task = current; | ||
465 | |||
466 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); | 463 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); |
467 | last_warning_jiffies = jiffies - WARN_INTERVAL; | 464 | last_warning_jiffies = jiffies - WARN_INTERVAL; |
468 | for (;;) { | 465 | for (;;) { |
@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused) | |||
470 | struct bbc_fan_control *fp; | 467 | struct bbc_fan_control *fp; |
471 | 468 | ||
472 | msleep_interruptible(POLL_INTERVAL); | 469 | msleep_interruptible(POLL_INTERVAL); |
473 | if (signal_pending(current)) | 470 | if (kthread_should_stop()) |
474 | break; | 471 | break; |
475 | 472 | ||
476 | for (tp = all_bbc_temps; tp; tp = tp->next) { | 473 | for (tp = all_bbc_temps; tp; tp = tp->next) { |
@@ -577,7 +574,6 @@ int bbc_envctrl_init(void) | |||
577 | int temp_index = 0; | 574 | int temp_index = 0; |
578 | int fan_index = 0; | 575 | int fan_index = 0; |
579 | int devidx = 0; | 576 | int devidx = 0; |
580 | int err = 0; | ||
581 | 577 | ||
582 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { | 578 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { |
583 | if (!strcmp(echild->prom_name, "temperature")) | 579 | if (!strcmp(echild->prom_name, "temperature")) |
@@ -585,9 +581,13 @@ int bbc_envctrl_init(void) | |||
585 | if (!strcmp(echild->prom_name, "fan-control")) | 581 | if (!strcmp(echild->prom_name, "fan-control")) |
586 | attach_one_fan(echild, fan_index++); | 582 | attach_one_fan(echild, fan_index++); |
587 | } | 583 | } |
588 | if (temp_index != 0 && fan_index != 0) | 584 | if (temp_index != 0 && fan_index != 0) { |
589 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 585 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
590 | return err; | 586 | if (IS_ERR(kenvctrld_task)) |
587 | return PTR_ERR(kenvctrld_task); | ||
588 | } | ||
589 | |||
590 | return 0; | ||
591 | } | 591 | } |
592 | 592 | ||
593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) | 593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) |
@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void) | |||
607 | struct bbc_cpu_temperature *tp; | 607 | struct bbc_cpu_temperature *tp; |
608 | struct bbc_fan_control *fp; | 608 | struct bbc_fan_control *fp; |
609 | 609 | ||
610 | if (kenvctrld_task != NULL) { | 610 | kthread_stop(kenvctrld_task); |
611 | force_sig(SIGKILL, kenvctrld_task); | ||
612 | for (;;) { | ||
613 | struct task_struct *p; | ||
614 | int found = 0; | ||
615 | |||
616 | read_lock(&tasklist_lock); | ||
617 | for_each_process(p) { | ||
618 | if (p == kenvctrld_task) { | ||
619 | found = 1; | ||
620 | break; | ||
621 | } | ||
622 | } | ||
623 | read_unlock(&tasklist_lock); | ||
624 | if (!found) | ||
625 | break; | ||
626 | msleep(1000); | ||
627 | } | ||
628 | kenvctrld_task = NULL; | ||
629 | } | ||
630 | 611 | ||
631 | tp = all_bbc_temps; | 612 | tp = all_bbc_temps; |
632 | while (tp != NULL) { | 613 | while (tp != NULL) { |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 9a8c572554f5..d765cc1bf060 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/config.h> | 24 | #include <linux/config.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/kthread.h> | ||
27 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused) | |||
1010 | 1011 | ||
1011 | poll_interval = 5000; /* TODO env_mon_interval */ | 1012 | poll_interval = 5000; /* TODO env_mon_interval */ |
1012 | 1013 | ||
1013 | daemonize("kenvctrld"); | ||
1014 | allow_signal(SIGKILL); | ||
1015 | |||
1016 | kenvctrld_task = current; | ||
1017 | |||
1018 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); | 1014 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); |
1019 | for (;;) { | 1015 | for (;;) { |
1020 | if(msleep_interruptible(poll_interval)) | 1016 | msleep_interruptible(poll_interval); |
1021 | break; | ||
1022 | 1017 | ||
1018 | if (kthread_should_stop()) | ||
1019 | break; | ||
1020 | |||
1023 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { | 1021 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { |
1024 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, | 1022 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, |
1025 | ENVCTRL_CPUTEMP_MON, | 1023 | ENVCTRL_CPUTEMP_MON, |
@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused) | |||
1041 | 1039 | ||
1042 | static int __init envctrl_init(void) | 1040 | static int __init envctrl_init(void) |
1043 | { | 1041 | { |
1044 | #ifdef CONFIG_PCI | ||
1045 | struct linux_ebus *ebus = NULL; | 1042 | struct linux_ebus *ebus = NULL; |
1046 | struct linux_ebus_device *edev = NULL; | 1043 | struct linux_ebus_device *edev = NULL; |
1047 | struct linux_ebus_child *edev_child = NULL; | 1044 | struct linux_ebus_child *edev_child = NULL; |
@@ -1118,9 +1115,11 @@ done: | |||
1118 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); | 1115 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); |
1119 | } | 1116 | } |
1120 | 1117 | ||
1121 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 1118 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
1122 | if (err < 0) | 1119 | if (IS_ERR(kenvctrld_task)) { |
1120 | err = PTR_ERR(kenvctrld_task); | ||
1123 | goto out_deregister; | 1121 | goto out_deregister; |
1122 | } | ||
1124 | 1123 | ||
1125 | return 0; | 1124 | return 0; |
1126 | 1125 | ||
@@ -1133,37 +1132,13 @@ out_iounmap: | |||
1133 | kfree(i2c_childlist[i].tables); | 1132 | kfree(i2c_childlist[i].tables); |
1134 | } | 1133 | } |
1135 | return err; | 1134 | return err; |
1136 | #else | ||
1137 | return -ENODEV; | ||
1138 | #endif | ||
1139 | } | 1135 | } |
1140 | 1136 | ||
1141 | static void __exit envctrl_cleanup(void) | 1137 | static void __exit envctrl_cleanup(void) |
1142 | { | 1138 | { |
1143 | int i; | 1139 | int i; |
1144 | 1140 | ||
1145 | if (NULL != kenvctrld_task) { | 1141 | kthread_stop(kenvctrld_task); |
1146 | force_sig(SIGKILL, kenvctrld_task); | ||
1147 | for (;;) { | ||
1148 | struct task_struct *p; | ||
1149 | int found = 0; | ||
1150 | |||
1151 | read_lock(&tasklist_lock); | ||
1152 | for_each_process(p) { | ||
1153 | if (p == kenvctrld_task) { | ||
1154 | found = 1; | ||
1155 | break; | ||
1156 | } | ||
1157 | } | ||
1158 | read_unlock(&tasklist_lock); | ||
1159 | |||
1160 | if (!found) | ||
1161 | break; | ||
1162 | |||
1163 | msleep(1000); | ||
1164 | } | ||
1165 | kenvctrld_task = NULL; | ||
1166 | } | ||
1167 | 1142 | ||
1168 | iounmap(i2c); | 1143 | iounmap(i2c); |
1169 | misc_deregister(&envctrl_dev); | 1144 | misc_deregister(&envctrl_dev); |
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 929170dcd3cb..600ba1202864 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -183,7 +183,7 @@ | |||
183 | * cross a page boundy. | 183 | * cross a page boundy. |
184 | */ | 184 | */ |
185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) | 185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) |
186 | #define VIRTX_LEN (sizeof(void *) * DC395x_MAX_SG_LISTENTRY) | 186 | |
187 | 187 | ||
188 | struct SGentry { | 188 | struct SGentry { |
189 | u32 address; /* bus! address */ | 189 | u32 address; /* bus! address */ |
@@ -235,7 +235,6 @@ struct ScsiReqBlk { | |||
235 | u8 sg_count; /* No of HW sg entries for this request */ | 235 | u8 sg_count; /* No of HW sg entries for this request */ |
236 | u8 sg_index; /* Index of HW sg entry for this request */ | 236 | u8 sg_index; /* Index of HW sg entry for this request */ |
237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ | 237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ |
238 | void **virt_map; | ||
239 | unsigned char *virt_addr; /* Virtual address of current transfer position */ | 238 | unsigned char *virt_addr; /* Virtual address of current transfer position */ |
240 | 239 | ||
241 | /* | 240 | /* |
@@ -1022,14 +1021,14 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, | |||
1022 | reqlen, cmd->request_buffer, cmd->use_sg, | 1021 | reqlen, cmd->request_buffer, cmd->use_sg, |
1023 | srb->sg_count); | 1022 | srb->sg_count); |
1024 | 1023 | ||
1024 | srb->virt_addr = page_address(sl->page); | ||
1025 | for (i = 0; i < srb->sg_count; i++) { | 1025 | for (i = 0; i < srb->sg_count; i++) { |
1026 | u32 seglen = (u32)sg_dma_len(sl + i); | 1026 | u32 busaddr = (u32)sg_dma_address(&sl[i]); |
1027 | sgp[i].address = (u32)sg_dma_address(sl + i); | 1027 | u32 seglen = (u32)sl[i].length; |
1028 | sgp[i].address = busaddr; | ||
1028 | sgp[i].length = seglen; | 1029 | sgp[i].length = seglen; |
1029 | srb->total_xfer_length += seglen; | 1030 | srb->total_xfer_length += seglen; |
1030 | srb->virt_map[i] = kmap(sl[i].page); | ||
1031 | } | 1031 | } |
1032 | srb->virt_addr = srb->virt_map[0]; | ||
1033 | sgp += srb->sg_count - 1; | 1032 | sgp += srb->sg_count - 1; |
1034 | 1033 | ||
1035 | /* | 1034 | /* |
@@ -1976,7 +1975,6 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
1976 | int segment = cmd->use_sg; | 1975 | int segment = cmd->use_sg; |
1977 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ | 1976 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ |
1978 | struct SGentry *psge = srb->segment_x + srb->sg_index; | 1977 | struct SGentry *psge = srb->segment_x + srb->sg_index; |
1979 | void **virt = srb->virt_map; | ||
1980 | 1978 | ||
1981 | dprintkdbg(DBG_0, | 1979 | dprintkdbg(DBG_0, |
1982 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", | 1980 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", |
@@ -2016,16 +2014,16 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
2016 | 2014 | ||
2017 | /* We have to walk the scatterlist to find it */ | 2015 | /* We have to walk the scatterlist to find it */ |
2018 | sg = (struct scatterlist *)cmd->request_buffer; | 2016 | sg = (struct scatterlist *)cmd->request_buffer; |
2019 | idx = 0; | ||
2020 | while (segment--) { | 2017 | while (segment--) { |
2021 | unsigned long mask = | 2018 | unsigned long mask = |
2022 | ~((unsigned long)sg->length - 1) & PAGE_MASK; | 2019 | ~((unsigned long)sg->length - 1) & PAGE_MASK; |
2023 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { | 2020 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { |
2024 | srb->virt_addr = virt[idx] + (psge->address & ~PAGE_MASK); | 2021 | srb->virt_addr = (page_address(sg->page) |
2022 | + psge->address - | ||
2023 | (psge->address & PAGE_MASK)); | ||
2025 | return; | 2024 | return; |
2026 | } | 2025 | } |
2027 | ++sg; | 2026 | ++sg; |
2028 | ++idx; | ||
2029 | } | 2027 | } |
2030 | 2028 | ||
2031 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); | 2029 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); |
@@ -2151,7 +2149,7 @@ static void data_out_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, | |||
2151 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); | 2149 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); |
2152 | } | 2150 | } |
2153 | /* | 2151 | /* |
2154 | * calculate all the residue data that not yet transfered | 2152 | * calculate all the residue data that not yet tranfered |
2155 | * SCSI transfer counter + left in SCSI FIFO data | 2153 | * SCSI transfer counter + left in SCSI FIFO data |
2156 | * | 2154 | * |
2157 | * .....TRM_S1040_SCSI_COUNTER (24bits) | 2155 | * .....TRM_S1040_SCSI_COUNTER (24bits) |
@@ -3269,7 +3267,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3269 | struct scsi_cmnd *cmd = srb->cmd; | 3267 | struct scsi_cmnd *cmd = srb->cmd; |
3270 | enum dma_data_direction dir = cmd->sc_data_direction; | 3268 | enum dma_data_direction dir = cmd->sc_data_direction; |
3271 | if (cmd->use_sg && dir != PCI_DMA_NONE) { | 3269 | if (cmd->use_sg && dir != PCI_DMA_NONE) { |
3272 | int i; | ||
3273 | /* unmap DC395x SG list */ | 3270 | /* unmap DC395x SG list */ |
3274 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", | 3271 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", |
3275 | srb->sg_bus_addr, SEGMENTX_LEN); | 3272 | srb->sg_bus_addr, SEGMENTX_LEN); |
@@ -3279,8 +3276,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3279 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", | 3276 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", |
3280 | cmd->use_sg, cmd->request_buffer); | 3277 | cmd->use_sg, cmd->request_buffer); |
3281 | /* unmap the sg segments */ | 3278 | /* unmap the sg segments */ |
3282 | for (i = 0; i < srb->sg_count; i++) | ||
3283 | kunmap(virt_to_page(srb->virt_map[i])); | ||
3284 | pci_unmap_sg(acb->dev, | 3279 | pci_unmap_sg(acb->dev, |
3285 | (struct scatterlist *)cmd->request_buffer, | 3280 | (struct scatterlist *)cmd->request_buffer, |
3286 | cmd->use_sg, dir); | 3281 | cmd->use_sg, dir); |
@@ -3327,7 +3322,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, | |||
3327 | 3322 | ||
3328 | if (cmd->use_sg) { | 3323 | if (cmd->use_sg) { |
3329 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; | 3324 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; |
3330 | ptr = (struct ScsiInqData *)(srb->virt_map[0] + sg->offset); | 3325 | ptr = (struct ScsiInqData *)(page_address(sg->page) + sg->offset); |
3331 | } else { | 3326 | } else { |
3332 | ptr = (struct ScsiInqData *)(cmd->request_buffer); | 3327 | ptr = (struct ScsiInqData *)(cmd->request_buffer); |
3333 | } | 3328 | } |
@@ -4262,9 +4257,8 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb) | |||
4262 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; | 4257 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; |
4263 | 4258 | ||
4264 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) | 4259 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) |
4265 | kfree(acb->srb_array[i].segment_x); | 4260 | if (acb->srb_array[i].segment_x) |
4266 | 4261 | kfree(acb->srb_array[i].segment_x); | |
4267 | vfree(acb->srb_array[0].virt_map); | ||
4268 | } | 4262 | } |
4269 | 4263 | ||
4270 | 4264 | ||
@@ -4280,12 +4274,9 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4280 | int srb_idx = 0; | 4274 | int srb_idx = 0; |
4281 | unsigned i = 0; | 4275 | unsigned i = 0; |
4282 | struct SGentry *ptr; | 4276 | struct SGentry *ptr; |
4283 | void **virt_array; | ||
4284 | 4277 | ||
4285 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) { | 4278 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) |
4286 | acb->srb_array[i].segment_x = NULL; | 4279 | acb->srb_array[i].segment_x = NULL; |
4287 | acb->srb_array[i].virt_map = NULL; | ||
4288 | } | ||
4289 | 4280 | ||
4290 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); | 4281 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); |
4291 | while (pages--) { | 4282 | while (pages--) { |
@@ -4306,19 +4297,6 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4306 | ptr + (i * DC395x_MAX_SG_LISTENTRY); | 4297 | ptr + (i * DC395x_MAX_SG_LISTENTRY); |
4307 | else | 4298 | else |
4308 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); | 4299 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); |
4309 | |||
4310 | virt_array = vmalloc((DC395x_MAX_SRB_CNT + 1) * DC395x_MAX_SG_LISTENTRY * sizeof(void*)); | ||
4311 | |||
4312 | if (!virt_array) { | ||
4313 | adapter_sg_tables_free(acb); | ||
4314 | return 1; | ||
4315 | } | ||
4316 | |||
4317 | for (i = 0; i < DC395x_MAX_SRB_CNT + 1; i++) { | ||
4318 | acb->srb_array[i].virt_map = virt_array; | ||
4319 | virt_array += DC395x_MAX_SG_LISTENTRY; | ||
4320 | } | ||
4321 | |||
4322 | return 0; | 4300 | return 0; |
4323 | } | 4301 | } |
4324 | 4302 | ||
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index e2370529c632..7235f94f1191 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
907 | raptorFlag = TRUE; | 907 | raptorFlag = TRUE; |
908 | } | 908 | } |
909 | 909 | ||
910 | 910 | if (pci_request_regions(pDev, "dpt_i2o")) { | |
911 | PERROR("dpti: adpt_config_hba: pci request region failed\n"); | ||
912 | return -EINVAL; | ||
913 | } | ||
911 | base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); | 914 | base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); |
912 | if (!base_addr_virt) { | 915 | if (!base_addr_virt) { |
916 | pci_release_regions(pDev); | ||
913 | PERROR("dpti: adpt_config_hba: io remap failed\n"); | 917 | PERROR("dpti: adpt_config_hba: io remap failed\n"); |
914 | return -EINVAL; | 918 | return -EINVAL; |
915 | } | 919 | } |
@@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
919 | if (!msg_addr_virt) { | 923 | if (!msg_addr_virt) { |
920 | PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); | 924 | PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); |
921 | iounmap(base_addr_virt); | 925 | iounmap(base_addr_virt); |
926 | pci_release_regions(pDev); | ||
922 | return -EINVAL; | 927 | return -EINVAL; |
923 | } | 928 | } |
924 | } else { | 929 | } else { |
@@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
932 | iounmap(msg_addr_virt); | 937 | iounmap(msg_addr_virt); |
933 | } | 938 | } |
934 | iounmap(base_addr_virt); | 939 | iounmap(base_addr_virt); |
940 | pci_release_regions(pDev); | ||
935 | return -ENOMEM; | 941 | return -ENOMEM; |
936 | } | 942 | } |
937 | memset(pHba, 0, sizeof(adpt_hba)); | 943 | memset(pHba, 0, sizeof(adpt_hba)); |
@@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1027 | up(&adpt_configuration_lock); | 1033 | up(&adpt_configuration_lock); |
1028 | 1034 | ||
1029 | iounmap(pHba->base_addr_virt); | 1035 | iounmap(pHba->base_addr_virt); |
1036 | pci_release_regions(pHba->pDev); | ||
1030 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ | 1037 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ |
1031 | iounmap(pHba->msg_addr_virt); | 1038 | iounmap(pHba->msg_addr_virt); |
1032 | } | 1039 | } |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 794fb559efb0..6a75ec2187fd 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -385,6 +385,7 @@ int ata_scsi_error(struct Scsi_Host *host) | |||
385 | * appropriate place | 385 | * appropriate place |
386 | */ | 386 | */ |
387 | host->host_failed--; | 387 | host->host_failed--; |
388 | INIT_LIST_HEAD(&host->eh_cmd_q); | ||
388 | 389 | ||
389 | DPRINTK("EXIT\n"); | 390 | DPRINTK("EXIT\n"); |
390 | return 0; | 391 | return 0; |
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index 140cea05de3f..efd7d7a61135 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -468,7 +468,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
468 | for (i = 0; i < last; i++) { | 468 | for (i = 0; i < last; i++) { |
469 | buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); | 469 | buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); |
470 | buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); | 470 | buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); |
471 | total_len += sg[i].length; | 471 | total_len += sg_dma_len(&sg[i]); |
472 | } | 472 | } |
473 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); | 473 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); |
474 | sgt_len = idx * 4; | 474 | sgt_len = idx * 4; |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 2d3c4ac475f2..48edd67982a5 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -336,9 +336,23 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
336 | unsigned long flags; | 336 | unsigned long flags; |
337 | const int size = sizeof(struct scsi_target) | 337 | const int size = sizeof(struct scsi_target) |
338 | + shost->transportt->target_size; | 338 | + shost->transportt->target_size; |
339 | struct scsi_target *starget = kmalloc(size, GFP_ATOMIC); | 339 | struct scsi_target *starget; |
340 | struct scsi_target *found_target; | 340 | struct scsi_target *found_target; |
341 | 341 | ||
342 | /* | ||
343 | * Obtain the real parent from the transport. The transport | ||
344 | * is allowed to fail (no error) if there is nothing at that | ||
345 | * target id. | ||
346 | */ | ||
347 | if (shost->transportt->target_parent) { | ||
348 | spin_lock_irqsave(shost->host_lock, flags); | ||
349 | parent = shost->transportt->target_parent(shost, channel, id); | ||
350 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
351 | if (!parent) | ||
352 | return NULL; | ||
353 | } | ||
354 | |||
355 | starget = kmalloc(size, GFP_KERNEL); | ||
342 | if (!starget) { | 356 | if (!starget) { |
343 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); | 357 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); |
344 | return NULL; | 358 | return NULL; |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 35d1c1e8e345..e6412fce423c 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -1022,6 +1022,23 @@ static int fc_rport_match(struct attribute_container *cont, | |||
1022 | return &i->rport_attr_cont.ac == cont; | 1022 | return &i->rport_attr_cont.ac == cont; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | |||
1026 | /* | ||
1027 | * Must be called with shost->host_lock held | ||
1028 | */ | ||
1029 | static struct device *fc_target_parent(struct Scsi_Host *shost, | ||
1030 | int channel, uint id) | ||
1031 | { | ||
1032 | struct fc_rport *rport; | ||
1033 | |||
1034 | list_for_each_entry(rport, &fc_host_rports(shost), peers) | ||
1035 | if ((rport->channel == channel) && | ||
1036 | (rport->scsi_target_id == id)) | ||
1037 | return &rport->dev; | ||
1038 | |||
1039 | return NULL; | ||
1040 | } | ||
1041 | |||
1025 | struct scsi_transport_template * | 1042 | struct scsi_transport_template * |
1026 | fc_attach_transport(struct fc_function_template *ft) | 1043 | fc_attach_transport(struct fc_function_template *ft) |
1027 | { | 1044 | { |
@@ -1057,6 +1074,8 @@ fc_attach_transport(struct fc_function_template *ft) | |||
1057 | 1074 | ||
1058 | /* Transport uses the shost workq for scsi scanning */ | 1075 | /* Transport uses the shost workq for scsi scanning */ |
1059 | i->t.create_work_queue = 1; | 1076 | i->t.create_work_queue = 1; |
1077 | |||
1078 | i->t.target_parent = fc_target_parent; | ||
1060 | 1079 | ||
1061 | /* | 1080 | /* |
1062 | * Setup SCSI Target Attributes. | 1081 | * Setup SCSI Target Attributes. |
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h index 5f6187baad86..73c8a088c160 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h | |||
@@ -40,13 +40,15 @@ | |||
40 | #define TX_NUM_FIFO 4 | 40 | #define TX_NUM_FIFO 4 |
41 | #define TX_BUF_SIZE 32 | 41 | #define TX_BUF_SIZE 32 |
42 | 42 | ||
43 | #define SCC_WAIT_CLOSING 100 | ||
44 | |||
43 | struct uart_cpm_port { | 45 | struct uart_cpm_port { |
44 | struct uart_port port; | 46 | struct uart_port port; |
45 | u16 rx_nrfifos; | 47 | u16 rx_nrfifos; |
46 | u16 rx_fifosize; | 48 | u16 rx_fifosize; |
47 | u16 tx_nrfifos; | 49 | u16 tx_nrfifos; |
48 | u16 tx_fifosize; | 50 | u16 tx_fifosize; |
49 | smc_t *smcp; | 51 | smc_t *smcp; |
50 | smc_uart_t *smcup; | 52 | smc_uart_t *smcup; |
51 | scc_t *sccp; | 53 | scc_t *sccp; |
52 | scc_uart_t *sccup; | 54 | scc_uart_t *sccup; |
@@ -67,6 +69,8 @@ struct uart_cpm_port { | |||
67 | int bits; | 69 | int bits; |
68 | /* Keep track of 'odd' SMC2 wirings */ | 70 | /* Keep track of 'odd' SMC2 wirings */ |
69 | int is_portb; | 71 | int is_portb; |
72 | /* wait on close if needed */ | ||
73 | int wait_closing; | ||
70 | }; | 74 | }; |
71 | 75 | ||
72 | extern int cpm_uart_port_map[UART_NR]; | 76 | extern int cpm_uart_port_map[UART_NR]; |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 29db677d4284..d639ac92a117 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -9,9 +9,10 @@ | |||
9 | * | 9 | * |
10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
12 | * | 12 | * |
13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
14 | * (C) 2004 Intracom, S.A. | 14 | * (C) 2004 Intracom, S.A. |
15 | * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> | ||
15 | * | 16 | * |
16 | * This program is free software; you can redistribute it and/or modify | 17 | * This program is free software; you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License as published by | 18 | * it under the terms of the GNU General Public License as published by |
@@ -70,8 +71,22 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo); | |||
70 | 71 | ||
71 | /**************************************************************/ | 72 | /**************************************************************/ |
72 | 73 | ||
74 | static inline unsigned long cpu2cpm_addr(void *addr) | ||
75 | { | ||
76 | if ((unsigned long)addr >= CPM_ADDR) | ||
77 | return (unsigned long)addr; | ||
78 | return virt_to_bus(addr); | ||
79 | } | ||
80 | |||
81 | static inline void *cpm2cpu_addr(unsigned long addr) | ||
82 | { | ||
83 | if (addr >= CPM_ADDR) | ||
84 | return (void *)addr; | ||
85 | return bus_to_virt(addr); | ||
86 | } | ||
87 | |||
73 | /* | 88 | /* |
74 | * Check, if transmit buffers are processed | 89 | * Check, if transmit buffers are processed |
75 | */ | 90 | */ |
76 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) | 91 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) |
77 | { | 92 | { |
@@ -143,15 +158,18 @@ static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start) | |||
143 | } | 158 | } |
144 | 159 | ||
145 | if (cpm_uart_tx_pump(port) != 0) { | 160 | if (cpm_uart_tx_pump(port) != 0) { |
146 | if (IS_SMC(pinfo)) | 161 | if (IS_SMC(pinfo)) { |
147 | smcp->smc_smcm |= SMCM_TX; | 162 | smcp->smc_smcm |= SMCM_TX; |
148 | else | 163 | smcp->smc_smcmr |= SMCMR_TEN; |
164 | } else { | ||
149 | sccp->scc_sccm |= UART_SCCM_TX; | 165 | sccp->scc_sccm |= UART_SCCM_TX; |
166 | pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT; | ||
167 | } | ||
150 | } | 168 | } |
151 | } | 169 | } |
152 | 170 | ||
153 | /* | 171 | /* |
154 | * Stop receiver | 172 | * Stop receiver |
155 | */ | 173 | */ |
156 | static void cpm_uart_stop_rx(struct uart_port *port) | 174 | static void cpm_uart_stop_rx(struct uart_port *port) |
157 | { | 175 | { |
@@ -176,7 +194,7 @@ static void cpm_uart_enable_ms(struct uart_port *port) | |||
176 | } | 194 | } |
177 | 195 | ||
178 | /* | 196 | /* |
179 | * Generate a break. | 197 | * Generate a break. |
180 | */ | 198 | */ |
181 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) | 199 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) |
182 | { | 200 | { |
@@ -231,7 +249,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
231 | /* get number of characters, and check spce in flip-buffer */ | 249 | /* get number of characters, and check spce in flip-buffer */ |
232 | i = bdp->cbd_datlen; | 250 | i = bdp->cbd_datlen; |
233 | 251 | ||
234 | /* If we have not enough room in tty flip buffer, then we try | 252 | /* If we have not enough room in tty flip buffer, then we try |
235 | * later, which will be the next rx-interrupt or a timeout | 253 | * later, which will be the next rx-interrupt or a timeout |
236 | */ | 254 | */ |
237 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { | 255 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { |
@@ -243,7 +261,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
243 | } | 261 | } |
244 | 262 | ||
245 | /* get pointer */ | 263 | /* get pointer */ |
246 | cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr); | 264 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
247 | 265 | ||
248 | /* loop through the buffer */ | 266 | /* loop through the buffer */ |
249 | while (i-- > 0) { | 267 | while (i-- > 0) { |
@@ -265,13 +283,14 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
265 | } /* End while (i--) */ | 283 | } /* End while (i--) */ |
266 | 284 | ||
267 | /* This BD is ready to be used again. Clear status. get next */ | 285 | /* This BD is ready to be used again. Clear status. get next */ |
268 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); | 286 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); |
269 | bdp->cbd_sc |= BD_SC_EMPTY; | 287 | bdp->cbd_sc |= BD_SC_EMPTY; |
270 | 288 | ||
271 | if (bdp->cbd_sc & BD_SC_WRAP) | 289 | if (bdp->cbd_sc & BD_SC_WRAP) |
272 | bdp = pinfo->rx_bd_base; | 290 | bdp = pinfo->rx_bd_base; |
273 | else | 291 | else |
274 | bdp++; | 292 | bdp++; |
293 | |||
275 | } /* End for (;;) */ | 294 | } /* End for (;;) */ |
276 | 295 | ||
277 | /* Write back buffer pointer */ | 296 | /* Write back buffer pointer */ |
@@ -336,22 +355,22 @@ static irqreturn_t cpm_uart_int(int irq, void *data, struct pt_regs *regs) | |||
336 | 355 | ||
337 | if (IS_SMC(pinfo)) { | 356 | if (IS_SMC(pinfo)) { |
338 | events = smcp->smc_smce; | 357 | events = smcp->smc_smce; |
358 | smcp->smc_smce = events; | ||
339 | if (events & SMCM_BRKE) | 359 | if (events & SMCM_BRKE) |
340 | uart_handle_break(port); | 360 | uart_handle_break(port); |
341 | if (events & SMCM_RX) | 361 | if (events & SMCM_RX) |
342 | cpm_uart_int_rx(port, regs); | 362 | cpm_uart_int_rx(port, regs); |
343 | if (events & SMCM_TX) | 363 | if (events & SMCM_TX) |
344 | cpm_uart_int_tx(port, regs); | 364 | cpm_uart_int_tx(port, regs); |
345 | smcp->smc_smce = events; | ||
346 | } else { | 365 | } else { |
347 | events = sccp->scc_scce; | 366 | events = sccp->scc_scce; |
367 | sccp->scc_scce = events; | ||
348 | if (events & UART_SCCM_BRKE) | 368 | if (events & UART_SCCM_BRKE) |
349 | uart_handle_break(port); | 369 | uart_handle_break(port); |
350 | if (events & UART_SCCM_RX) | 370 | if (events & UART_SCCM_RX) |
351 | cpm_uart_int_rx(port, regs); | 371 | cpm_uart_int_rx(port, regs); |
352 | if (events & UART_SCCM_TX) | 372 | if (events & UART_SCCM_TX) |
353 | cpm_uart_int_tx(port, regs); | 373 | cpm_uart_int_tx(port, regs); |
354 | sccp->scc_scce = events; | ||
355 | } | 374 | } |
356 | return (events) ? IRQ_HANDLED : IRQ_NONE; | 375 | return (events) ? IRQ_HANDLED : IRQ_NONE; |
357 | } | 376 | } |
@@ -360,6 +379,7 @@ static int cpm_uart_startup(struct uart_port *port) | |||
360 | { | 379 | { |
361 | int retval; | 380 | int retval; |
362 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; | 381 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; |
382 | int line = pinfo - cpm_uart_ports; | ||
363 | 383 | ||
364 | pr_debug("CPM uart[%d]:startup\n", port->line); | 384 | pr_debug("CPM uart[%d]:startup\n", port->line); |
365 | 385 | ||
@@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_port *port) | |||
376 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; | 396 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; |
377 | } | 397 | } |
378 | 398 | ||
399 | if (!(pinfo->flags & FLAG_CONSOLE)) | ||
400 | cpm_line_cr_cmd(line,CPM_CR_INIT_TRX); | ||
379 | return 0; | 401 | return 0; |
380 | } | 402 | } |
381 | 403 | ||
404 | inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) | ||
405 | { | ||
406 | unsigned long target_jiffies = jiffies + pinfo->wait_closing; | ||
407 | |||
408 | while (!time_after(jiffies, target_jiffies)) | ||
409 | schedule(); | ||
410 | } | ||
411 | |||
382 | /* | 412 | /* |
383 | * Shutdown the uart | 413 | * Shutdown the uart |
384 | */ | 414 | */ |
@@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uart_port *port) | |||
394 | 424 | ||
395 | /* If the port is not the console, disable Rx and Tx. */ | 425 | /* If the port is not the console, disable Rx and Tx. */ |
396 | if (!(pinfo->flags & FLAG_CONSOLE)) { | 426 | if (!(pinfo->flags & FLAG_CONSOLE)) { |
427 | /* Wait for all the BDs marked sent */ | ||
428 | while(!cpm_uart_tx_empty(port)) | ||
429 | schedule_timeout(2); | ||
430 | if(pinfo->wait_closing) | ||
431 | cpm_uart_wait_until_send(pinfo); | ||
432 | |||
397 | /* Stop uarts */ | 433 | /* Stop uarts */ |
398 | if (IS_SMC(pinfo)) { | 434 | if (IS_SMC(pinfo)) { |
399 | volatile smc_t *smcp = pinfo->smcp; | 435 | volatile smc_t *smcp = pinfo->smcp; |
@@ -502,7 +538,7 @@ static void cpm_uart_set_termios(struct uart_port *port, | |||
502 | */ | 538 | */ |
503 | if ((termios->c_cflag & CREAD) == 0) | 539 | if ((termios->c_cflag & CREAD) == 0) |
504 | port->read_status_mask &= ~BD_SC_EMPTY; | 540 | port->read_status_mask &= ~BD_SC_EMPTY; |
505 | 541 | ||
506 | spin_lock_irqsave(&port->lock, flags); | 542 | spin_lock_irqsave(&port->lock, flags); |
507 | 543 | ||
508 | /* Start bit has not been added (so don't, because we would just | 544 | /* Start bit has not been added (so don't, because we would just |
@@ -569,7 +605,8 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
569 | /* Pick next descriptor and fill from buffer */ | 605 | /* Pick next descriptor and fill from buffer */ |
570 | bdp = pinfo->tx_cur; | 606 | bdp = pinfo->tx_cur; |
571 | 607 | ||
572 | p = bus_to_virt(bdp->cbd_bufaddr); | 608 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
609 | |||
573 | *p++ = xmit->buf[xmit->tail]; | 610 | *p++ = xmit->buf[xmit->tail]; |
574 | bdp->cbd_datlen = 1; | 611 | bdp->cbd_datlen = 1; |
575 | bdp->cbd_sc |= BD_SC_READY; | 612 | bdp->cbd_sc |= BD_SC_READY; |
@@ -595,7 +632,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
595 | 632 | ||
596 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { | 633 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { |
597 | count = 0; | 634 | count = 0; |
598 | p = bus_to_virt(bdp->cbd_bufaddr); | 635 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
599 | while (count < pinfo->tx_fifosize) { | 636 | while (count < pinfo->tx_fifosize) { |
600 | *p++ = xmit->buf[xmit->tail]; | 637 | *p++ = xmit->buf[xmit->tail]; |
601 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 638 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
@@ -606,6 +643,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
606 | } | 643 | } |
607 | bdp->cbd_datlen = count; | 644 | bdp->cbd_datlen = count; |
608 | bdp->cbd_sc |= BD_SC_READY; | 645 | bdp->cbd_sc |= BD_SC_READY; |
646 | __asm__("eieio"); | ||
609 | /* Get next BD. */ | 647 | /* Get next BD. */ |
610 | if (bdp->cbd_sc & BD_SC_WRAP) | 648 | if (bdp->cbd_sc & BD_SC_WRAP) |
611 | bdp = pinfo->tx_bd_base; | 649 | bdp = pinfo->tx_bd_base; |
@@ -643,12 +681,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
643 | mem_addr = pinfo->mem_addr; | 681 | mem_addr = pinfo->mem_addr; |
644 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; | 682 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; |
645 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { | 683 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { |
646 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 684 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
647 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; | 685 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; |
648 | mem_addr += pinfo->rx_fifosize; | 686 | mem_addr += pinfo->rx_fifosize; |
649 | } | 687 | } |
650 | 688 | ||
651 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 689 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
652 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; | 690 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; |
653 | 691 | ||
654 | /* Set the physical address of the host memory | 692 | /* Set the physical address of the host memory |
@@ -658,12 +696,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
658 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); | 696 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); |
659 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; | 697 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; |
660 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { | 698 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { |
661 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 699 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
662 | bdp->cbd_sc = BD_SC_INTRPT; | 700 | bdp->cbd_sc = BD_SC_INTRPT; |
663 | mem_addr += pinfo->tx_fifosize; | 701 | mem_addr += pinfo->tx_fifosize; |
664 | } | 702 | } |
665 | 703 | ||
666 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 704 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
667 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; | 705 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; |
668 | } | 706 | } |
669 | 707 | ||
@@ -763,6 +801,8 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) | |||
763 | /* Using idle charater time requires some additional tuning. */ | 801 | /* Using idle charater time requires some additional tuning. */ |
764 | up->smc_mrblr = pinfo->rx_fifosize; | 802 | up->smc_mrblr = pinfo->rx_fifosize; |
765 | up->smc_maxidl = pinfo->rx_fifosize; | 803 | up->smc_maxidl = pinfo->rx_fifosize; |
804 | up->smc_brklen = 0; | ||
805 | up->smc_brkec = 0; | ||
766 | up->smc_brkcr = 1; | 806 | up->smc_brkcr = 1; |
767 | 807 | ||
768 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); | 808 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); |
@@ -796,7 +836,7 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
796 | /* | 836 | /* |
797 | * Setup any port IO, connect any baud rate generators, | 837 | * Setup any port IO, connect any baud rate generators, |
798 | * etc. This is expected to be handled by board | 838 | * etc. This is expected to be handled by board |
799 | * dependant code | 839 | * dependant code |
800 | */ | 840 | */ |
801 | if (pinfo->set_lineif) | 841 | if (pinfo->set_lineif) |
802 | pinfo->set_lineif(pinfo); | 842 | pinfo->set_lineif(pinfo); |
@@ -815,6 +855,10 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
815 | return ret; | 855 | return ret; |
816 | 856 | ||
817 | cpm_uart_initbd(pinfo); | 857 | cpm_uart_initbd(pinfo); |
858 | if (IS_SMC(pinfo)) | ||
859 | cpm_uart_init_smc(pinfo); | ||
860 | else | ||
861 | cpm_uart_init_scc(pinfo); | ||
818 | 862 | ||
819 | return 0; | 863 | return 0; |
820 | } | 864 | } |
@@ -869,7 +913,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
869 | .flags = FLAG_SMC, | 913 | .flags = FLAG_SMC, |
870 | .tx_nrfifos = TX_NUM_FIFO, | 914 | .tx_nrfifos = TX_NUM_FIFO, |
871 | .tx_fifosize = TX_BUF_SIZE, | 915 | .tx_fifosize = TX_BUF_SIZE, |
872 | .rx_nrfifos = RX_NUM_FIFO, | 916 | .rx_nrfifos = RX_NUM_FIFO, |
873 | .rx_fifosize = RX_BUF_SIZE, | 917 | .rx_fifosize = RX_BUF_SIZE, |
874 | .set_lineif = smc1_lineif, | 918 | .set_lineif = smc1_lineif, |
875 | }, | 919 | }, |
@@ -883,7 +927,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
883 | .flags = FLAG_SMC, | 927 | .flags = FLAG_SMC, |
884 | .tx_nrfifos = TX_NUM_FIFO, | 928 | .tx_nrfifos = TX_NUM_FIFO, |
885 | .tx_fifosize = TX_BUF_SIZE, | 929 | .tx_fifosize = TX_BUF_SIZE, |
886 | .rx_nrfifos = RX_NUM_FIFO, | 930 | .rx_nrfifos = RX_NUM_FIFO, |
887 | .rx_fifosize = RX_BUF_SIZE, | 931 | .rx_fifosize = RX_BUF_SIZE, |
888 | .set_lineif = smc2_lineif, | 932 | .set_lineif = smc2_lineif, |
889 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 | 933 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 |
@@ -899,9 +943,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
899 | }, | 943 | }, |
900 | .tx_nrfifos = TX_NUM_FIFO, | 944 | .tx_nrfifos = TX_NUM_FIFO, |
901 | .tx_fifosize = TX_BUF_SIZE, | 945 | .tx_fifosize = TX_BUF_SIZE, |
902 | .rx_nrfifos = RX_NUM_FIFO, | 946 | .rx_nrfifos = RX_NUM_FIFO, |
903 | .rx_fifosize = RX_BUF_SIZE, | 947 | .rx_fifosize = RX_BUF_SIZE, |
904 | .set_lineif = scc1_lineif, | 948 | .set_lineif = scc1_lineif, |
949 | .wait_closing = SCC_WAIT_CLOSING, | ||
905 | }, | 950 | }, |
906 | [UART_SCC2] = { | 951 | [UART_SCC2] = { |
907 | .port = { | 952 | .port = { |
@@ -912,9 +957,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
912 | }, | 957 | }, |
913 | .tx_nrfifos = TX_NUM_FIFO, | 958 | .tx_nrfifos = TX_NUM_FIFO, |
914 | .tx_fifosize = TX_BUF_SIZE, | 959 | .tx_fifosize = TX_BUF_SIZE, |
915 | .rx_nrfifos = RX_NUM_FIFO, | 960 | .rx_nrfifos = RX_NUM_FIFO, |
916 | .rx_fifosize = RX_BUF_SIZE, | 961 | .rx_fifosize = RX_BUF_SIZE, |
917 | .set_lineif = scc2_lineif, | 962 | .set_lineif = scc2_lineif, |
963 | .wait_closing = SCC_WAIT_CLOSING, | ||
918 | }, | 964 | }, |
919 | [UART_SCC3] = { | 965 | [UART_SCC3] = { |
920 | .port = { | 966 | .port = { |
@@ -925,9 +971,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
925 | }, | 971 | }, |
926 | .tx_nrfifos = TX_NUM_FIFO, | 972 | .tx_nrfifos = TX_NUM_FIFO, |
927 | .tx_fifosize = TX_BUF_SIZE, | 973 | .tx_fifosize = TX_BUF_SIZE, |
928 | .rx_nrfifos = RX_NUM_FIFO, | 974 | .rx_nrfifos = RX_NUM_FIFO, |
929 | .rx_fifosize = RX_BUF_SIZE, | 975 | .rx_fifosize = RX_BUF_SIZE, |
930 | .set_lineif = scc3_lineif, | 976 | .set_lineif = scc3_lineif, |
977 | .wait_closing = SCC_WAIT_CLOSING, | ||
931 | }, | 978 | }, |
932 | [UART_SCC4] = { | 979 | [UART_SCC4] = { |
933 | .port = { | 980 | .port = { |
@@ -938,9 +985,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
938 | }, | 985 | }, |
939 | .tx_nrfifos = TX_NUM_FIFO, | 986 | .tx_nrfifos = TX_NUM_FIFO, |
940 | .tx_fifosize = TX_BUF_SIZE, | 987 | .tx_fifosize = TX_BUF_SIZE, |
941 | .rx_nrfifos = RX_NUM_FIFO, | 988 | .rx_nrfifos = RX_NUM_FIFO, |
942 | .rx_fifosize = RX_BUF_SIZE, | 989 | .rx_fifosize = RX_BUF_SIZE, |
943 | .set_lineif = scc4_lineif, | 990 | .set_lineif = scc4_lineif, |
991 | .wait_closing = SCC_WAIT_CLOSING, | ||
944 | }, | 992 | }, |
945 | }; | 993 | }; |
946 | 994 | ||
@@ -983,11 +1031,8 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
983 | * If the buffer address is in the CPM DPRAM, don't | 1031 | * If the buffer address is in the CPM DPRAM, don't |
984 | * convert it. | 1032 | * convert it. |
985 | */ | 1033 | */ |
986 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1034 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
987 | cp = (unsigned char *) (bdp->cbd_bufaddr); | 1035 | |
988 | else | ||
989 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
990 | |||
991 | *cp = *s; | 1036 | *cp = *s; |
992 | 1037 | ||
993 | bdp->cbd_datlen = 1; | 1038 | bdp->cbd_datlen = 1; |
@@ -1003,10 +1048,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1003 | while ((bdp->cbd_sc & BD_SC_READY) != 0) | 1048 | while ((bdp->cbd_sc & BD_SC_READY) != 0) |
1004 | ; | 1049 | ; |
1005 | 1050 | ||
1006 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1051 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
1007 | cp = (unsigned char *) (bdp->cbd_bufaddr); | ||
1008 | else | ||
1009 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
1010 | 1052 | ||
1011 | *cp = 13; | 1053 | *cp = 13; |
1012 | bdp->cbd_datlen = 1; | 1054 | bdp->cbd_datlen = 1; |
@@ -1045,7 +1087,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1045 | port = | 1087 | port = |
1046 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | 1088 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; |
1047 | pinfo = (struct uart_cpm_port *)port; | 1089 | pinfo = (struct uart_cpm_port *)port; |
1048 | 1090 | ||
1049 | pinfo->flags |= FLAG_CONSOLE; | 1091 | pinfo->flags |= FLAG_CONSOLE; |
1050 | 1092 | ||
1051 | if (options) { | 1093 | if (options) { |
@@ -1062,7 +1104,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1062 | /* | 1104 | /* |
1063 | * Setup any port IO, connect any baud rate generators, | 1105 | * Setup any port IO, connect any baud rate generators, |
1064 | * etc. This is expected to be handled by board | 1106 | * etc. This is expected to be handled by board |
1065 | * dependant code | 1107 | * dependant code |
1066 | */ | 1108 | */ |
1067 | if (pinfo->set_lineif) | 1109 | if (pinfo->set_lineif) |
1068 | pinfo->set_lineif(pinfo); | 1110 | pinfo->set_lineif(pinfo); |
@@ -1092,14 +1134,14 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1092 | return 0; | 1134 | return 0; |
1093 | } | 1135 | } |
1094 | 1136 | ||
1095 | extern struct uart_driver cpm_reg; | 1137 | static struct uart_driver cpm_reg; |
1096 | static struct console cpm_scc_uart_console = { | 1138 | static struct console cpm_scc_uart_console = { |
1097 | .name "ttyCPM", | 1139 | .name = "ttyCPM", |
1098 | .write cpm_uart_console_write, | 1140 | .write = cpm_uart_console_write, |
1099 | .device uart_console_device, | 1141 | .device = uart_console_device, |
1100 | .setup cpm_uart_console_setup, | 1142 | .setup = cpm_uart_console_setup, |
1101 | .flags CON_PRINTBUFFER, | 1143 | .flags = CON_PRINTBUFFER, |
1102 | .index -1, | 1144 | .index = -1, |
1103 | .data = &cpm_reg, | 1145 | .data = &cpm_reg, |
1104 | }; | 1146 | }; |
1105 | 1147 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 8efbd6d1d6a4..4b0786e7eb7f 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
8 | * | 8 | * |
9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
10 | * (C) 2004 Intracom, S.A. | 10 | * (C) 2004 Intracom, S.A. |
11 | * | 11 | * |
@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) | |||
82 | void smc1_lineif(struct uart_cpm_port *pinfo) | 82 | void smc1_lineif(struct uart_cpm_port *pinfo) |
83 | { | 83 | { |
84 | volatile cpm8xx_t *cp = cpmp; | 84 | volatile cpm8xx_t *cp = cpmp; |
85 | |||
86 | (void)cp; /* fix warning */ | ||
87 | #if defined (CONFIG_MPC885ADS) | ||
88 | /* Enable SMC1 transceivers */ | ||
89 | { | ||
90 | cp->cp_pepar |= 0x000000c0; | ||
91 | cp->cp_pedir &= ~0x000000c0; | ||
92 | cp->cp_peso &= ~0x00000040; | ||
93 | cp->cp_peso |= 0x00000080; | ||
94 | } | ||
95 | #elif defined (CONFIG_MPC86XADS) | ||
85 | unsigned int iobits = 0x000000c0; | 96 | unsigned int iobits = 0x000000c0; |
86 | 97 | ||
87 | if (!pinfo->is_portb) { | 98 | if (!pinfo->is_portb) { |
@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) | |||
93 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | 104 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; |
94 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | 105 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; |
95 | } | 106 | } |
96 | |||
97 | #ifdef CONFIG_MPC885ADS | ||
98 | /* Enable SMC1 transceivers */ | ||
99 | { | ||
100 | volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4); | ||
101 | uint tmp; | ||
102 | |||
103 | tmp = in_be32(bcsr1); | ||
104 | tmp &= ~BCSR1_RS232EN_1; | ||
105 | out_be32(bcsr1, tmp); | ||
106 | iounmap(bcsr1); | ||
107 | } | ||
108 | #endif | 107 | #endif |
109 | |||
110 | pinfo->brg = 1; | 108 | pinfo->brg = 1; |
111 | } | 109 | } |
112 | 110 | ||
113 | void smc2_lineif(struct uart_cpm_port *pinfo) | 111 | void smc2_lineif(struct uart_cpm_port *pinfo) |
114 | { | 112 | { |
115 | #ifdef CONFIG_MPC885ADS | ||
116 | volatile cpm8xx_t *cp = cpmp; | 113 | volatile cpm8xx_t *cp = cpmp; |
117 | volatile uint __iomem *bcsr1; | ||
118 | uint tmp; | ||
119 | 114 | ||
115 | (void)cp; /* fix warning */ | ||
116 | #if defined (CONFIG_MPC885ADS) | ||
120 | cp->cp_pepar |= 0x00000c00; | 117 | cp->cp_pepar |= 0x00000c00; |
121 | cp->cp_pedir &= ~0x00000c00; | 118 | cp->cp_pedir &= ~0x00000c00; |
122 | cp->cp_peso &= ~0x00000400; | 119 | cp->cp_peso &= ~0x00000400; |
123 | cp->cp_peso |= 0x00000800; | 120 | cp->cp_peso |= 0x00000800; |
121 | #elif defined (CONFIG_MPC86XADS) | ||
122 | unsigned int iobits = 0x00000c00; | ||
123 | |||
124 | if (!pinfo->is_portb) { | ||
125 | cp->cp_pbpar |= iobits; | ||
126 | cp->cp_pbdir &= ~iobits; | ||
127 | cp->cp_pbodr &= ~iobits; | ||
128 | } else { | ||
129 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; | ||
130 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | ||
131 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | ||
132 | } | ||
124 | 133 | ||
125 | /* Enable SMC2 transceivers */ | ||
126 | bcsr1 = ioremap(BCSR1, 4); | ||
127 | tmp = in_be32(bcsr1); | ||
128 | tmp &= ~BCSR1_RS232EN_2; | ||
129 | out_be32(bcsr1, tmp); | ||
130 | iounmap(bcsr1); | ||
131 | #endif | 134 | #endif |
132 | 135 | ||
133 | pinfo->brg = 2; | 136 | pinfo->brg = 2; |
@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) | |||
158 | } | 161 | } |
159 | 162 | ||
160 | /* | 163 | /* |
161 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and | 164 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and |
162 | * receive buffer descriptors from dual port ram, and a character | 165 | * receive buffer descriptors from dual port ram, and a character |
163 | * buffer area from host mem. If we are allocating for the console we need | 166 | * buffer area from host mem. If we are allocating for the console we need |
164 | * to do it from bootmem | 167 | * to do it from bootmem |
@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
185 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + | 188 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + |
186 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); | 189 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); |
187 | if (is_con) { | 190 | if (is_con) { |
191 | /* was hostalloc but changed cause it blows away the */ | ||
192 | /* large tlb mapping when pinning the kernel area */ | ||
188 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); | 193 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); |
189 | dma_addr = 0; | 194 | dma_addr = 0; |
190 | } else | 195 | } else |
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index 02412e31a46b..3b266af3048a 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
342 | goto exit; | 342 | goto exit; |
343 | } | 343 | } |
344 | 344 | ||
345 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
346 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
347 | |||
348 | input_regs(dev, regs); | 345 | input_regs(dev, regs); |
349 | 346 | ||
350 | if (data[1] & 0x10) { /* in prox */ | 347 | if (data[1] & 0x10) { /* in prox */ |
@@ -373,15 +370,17 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
373 | } | 370 | } |
374 | } | 371 | } |
375 | 372 | ||
376 | if (data[1] & 0x80) { | 373 | if (data[1] & 0x90) { |
374 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
375 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
377 | input_report_abs(dev, ABS_X, x); | 376 | input_report_abs(dev, ABS_X, x); |
378 | input_report_abs(dev, ABS_Y, y); | 377 | input_report_abs(dev, ABS_Y, y); |
379 | } | 378 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
380 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { | 379 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
381 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); | 380 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
382 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); | 381 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); |
383 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); | 382 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); |
384 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); | 383 | } |
385 | } | 384 | } |
386 | 385 | ||
387 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); | 386 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); |
@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
568 | 567 | ||
569 | /* Cintiq doesn't send data when RDY bit isn't set */ | 568 | /* Cintiq doesn't send data when RDY bit isn't set */ |
570 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) | 569 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) |
571 | return; | 570 | goto exit; |
572 | 571 | ||
573 | if (wacom->features->type >= INTUOS3) { | 572 | if (wacom->features->type >= INTUOS3) { |
574 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); | 573 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index aa9d00808e4e..508a21028db4 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c | |||
@@ -2,6 +2,8 @@ | |||
2 | * The USB Monitor, inspired by Dave Harding's USBMon. | 2 | * The USB Monitor, inspired by Dave Harding's USBMon. |
3 | * | 3 | * |
4 | * mon_main.c: Main file, module initiation and exit, registrations, etc. | 4 | * mon_main.c: Main file, module initiation and exit, registrations, etc. |
5 | * | ||
6 | * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) | ||
5 | */ | 7 | */ |
6 | 8 | ||
7 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
@@ -311,7 +313,7 @@ static int __init mon_init(void) | |||
311 | 313 | ||
312 | mondir = debugfs_create_dir("usbmon", NULL); | 314 | mondir = debugfs_create_dir("usbmon", NULL); |
313 | if (IS_ERR(mondir)) { | 315 | if (IS_ERR(mondir)) { |
314 | printk(KERN_NOTICE TAG ": debugs is not available\n"); | 316 | printk(KERN_NOTICE TAG ": debugfs is not available\n"); |
315 | return -ENODEV; | 317 | return -ENODEV; |
316 | } | 318 | } |
317 | if (mondir == NULL) { | 319 | if (mondir == NULL) { |
diff --git a/drivers/usb/mon/usb_mon.h b/drivers/usb/mon/usb_mon.h index ed35c18a5c44..9b06784d2c48 100644 --- a/drivers/usb/mon/usb_mon.h +++ b/drivers/usb/mon/usb_mon.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * The USB Monitor, inspired by Dave Harding's USBMon. | 2 | * The USB Monitor, inspired by Dave Harding's USBMon. |
3 | * | ||
4 | * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) | ||
3 | */ | 5 | */ |
4 | 6 | ||
5 | #ifndef __USB_MON_H | 7 | #ifndef __USB_MON_H |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2e19f6dd72c..4ff853fbe0be 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -628,7 +628,7 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | |||
628 | int | 628 | int |
629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | 629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) |
630 | { | 630 | { |
631 | int err; | 631 | int err, flags = info->flags; |
632 | 632 | ||
633 | if (var->activate & FB_ACTIVATE_INV_MODE) { | 633 | if (var->activate & FB_ACTIVATE_INV_MODE) { |
634 | struct fb_videomode mode1, mode2; | 634 | struct fb_videomode mode1, mode2; |
@@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
682 | !list_empty(&info->modelist)) | 682 | !list_empty(&info->modelist)) |
683 | err = fb_add_videomode(&mode, &info->modelist); | 683 | err = fb_add_videomode(&mode, &info->modelist); |
684 | 684 | ||
685 | if (!err && info->flags & FBINFO_MISC_USEREVENT) { | 685 | if (!err && (flags & FBINFO_MISC_USEREVENT)) { |
686 | struct fb_event event; | 686 | struct fb_event event; |
687 | 687 | ||
688 | info->flags &= ~FBINFO_MISC_USEREVENT; | 688 | info->flags &= ~FBINFO_MISC_USEREVENT; |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 298bc9cd99e7..a112a1786855 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -583,23 +583,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | /* Map the fb and MMIO regions */ | ||
587 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
588 | (dinfo->aperture.physical, dinfo->aperture.size); | ||
589 | if (!dinfo->aperture.virtual) { | ||
590 | ERR_MSG("Cannot remap FB region.\n"); | ||
591 | cleanup(dinfo); | ||
592 | return -ENODEV; | ||
593 | } | ||
594 | dinfo->mmio_base = | ||
595 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
596 | INTEL_REG_SIZE); | ||
597 | if (!dinfo->mmio_base) { | ||
598 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
599 | cleanup(dinfo); | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
603 | /* Get the chipset info. */ | 586 | /* Get the chipset info. */ |
604 | dinfo->pci_chipset = pdev->device; | 587 | dinfo->pci_chipset = pdev->device; |
605 | 588 | ||
@@ -630,9 +613,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
630 | dinfo->accel = 0; | 613 | dinfo->accel = 0; |
631 | } | 614 | } |
632 | 615 | ||
616 | if (MB(voffset) < stolen_size) | ||
617 | offset = (stolen_size >> 12); | ||
618 | else | ||
619 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
620 | |||
633 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ | 621 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ |
634 | if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { | 622 | if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { |
635 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); | 623 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); |
624 | dinfo->fb.offset = 0; | ||
636 | dinfo->fbmem_gart = 0; | 625 | dinfo->fbmem_gart = 0; |
637 | } else { | 626 | } else { |
638 | dinfo->fb.size = MB(vram); | 627 | dinfo->fb.size = MB(vram); |
@@ -663,11 +652,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
663 | return -ENODEV; | 652 | return -ENODEV; |
664 | } | 653 | } |
665 | 654 | ||
666 | if (MB(voffset) < stolen_size) | ||
667 | offset = (stolen_size >> 12); | ||
668 | else | ||
669 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
670 | |||
671 | /* set the mem offsets - set them after the already used pages */ | 655 | /* set the mem offsets - set them after the already used pages */ |
672 | if (dinfo->accel) { | 656 | if (dinfo->accel) { |
673 | dinfo->ring.offset = offset + gtt_info.current_memory; | 657 | dinfo->ring.offset = offset + gtt_info.current_memory; |
@@ -682,6 +666,26 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
682 | + (dinfo->cursor.size >> 12); | 666 | + (dinfo->cursor.size >> 12); |
683 | } | 667 | } |
684 | 668 | ||
669 | /* Map the fb and MMIO regions */ | ||
670 | /* ioremap only up to the end of used aperture */ | ||
671 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
672 | (dinfo->aperture.physical, (dinfo->fb.offset << 12) | ||
673 | + dinfo->fb.size); | ||
674 | if (!dinfo->aperture.virtual) { | ||
675 | ERR_MSG("Cannot remap FB region.\n"); | ||
676 | cleanup(dinfo); | ||
677 | return -ENODEV; | ||
678 | } | ||
679 | |||
680 | dinfo->mmio_base = | ||
681 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
682 | INTEL_REG_SIZE); | ||
683 | if (!dinfo->mmio_base) { | ||
684 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
685 | cleanup(dinfo); | ||
686 | return -ENODEV; | ||
687 | } | ||
688 | |||
685 | /* Allocate memories (which aren't stolen) */ | 689 | /* Allocate memories (which aren't stolen) */ |
686 | if (dinfo->accel) { | 690 | if (dinfo->accel) { |
687 | if (!(dinfo->gtt_ring_mem = | 691 | if (!(dinfo->gtt_ring_mem = |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 16e37a535d85..30112816420c 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -717,6 +717,9 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) | |||
717 | DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); | 717 | DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); |
718 | DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); | 718 | DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); |
719 | 719 | ||
720 | /* enable LCD controller clock */ | ||
721 | pxa_set_cken(CKEN16_LCD, 1); | ||
722 | |||
720 | /* Sequence from 11.7.10 */ | 723 | /* Sequence from 11.7.10 */ |
721 | LCCR3 = fbi->reg_lccr3; | 724 | LCCR3 = fbi->reg_lccr3; |
722 | LCCR2 = fbi->reg_lccr2; | 725 | LCCR2 = fbi->reg_lccr2; |
@@ -750,6 +753,9 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) | |||
750 | 753 | ||
751 | schedule_timeout(20 * HZ / 1000); | 754 | schedule_timeout(20 * HZ / 1000); |
752 | remove_wait_queue(&fbi->ctrlr_wait, &wait); | 755 | remove_wait_queue(&fbi->ctrlr_wait, &wait); |
756 | |||
757 | /* disable LCD controller clock */ | ||
758 | pxa_set_cken(CKEN16_LCD, 0); | ||
753 | } | 759 | } |
754 | 760 | ||
755 | /* | 761 | /* |
@@ -1299,8 +1305,6 @@ int __init pxafb_probe(struct device *dev) | |||
1299 | ret = -ENOMEM; | 1305 | ret = -ENOMEM; |
1300 | goto failed; | 1306 | goto failed; |
1301 | } | 1307 | } |
1302 | /* enable LCD controller clock */ | ||
1303 | pxa_set_cken(CKEN16_LCD, 1); | ||
1304 | 1308 | ||
1305 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); | 1309 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); |
1306 | if (ret) { | 1310 | if (ret) { |
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 8a9c42822502..0bbf029b1ef1 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -593,7 +593,7 @@ void w1_search(struct w1_master *dev, w1_slave_found_callback cb) | |||
593 | * Return 0 - device(s) present, 1 - no devices present. | 593 | * Return 0 - device(s) present, 1 - no devices present. |
594 | */ | 594 | */ |
595 | if (w1_reset_bus(dev)) { | 595 | if (w1_reset_bus(dev)) { |
596 | dev_info(&dev->dev, "No devices present on the wire.\n"); | 596 | dev_dbg(&dev->dev, "No devices present on the wire.\n"); |
597 | break; | 597 | break; |
598 | } | 598 | } |
599 | 599 | ||