diff options
Diffstat (limited to 'drivers')
58 files changed, 374 insertions, 822 deletions
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c index 2934475d67d..61ea70742d4 100644 --- a/drivers/acpi/motherboard.c +++ b/drivers/acpi/motherboard.c @@ -43,7 +43,7 @@ ACPI_MODULE_NAME ("acpi_motherboard") */ #define IS_RESERVED_ADDR(base, len) \ (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ - && ((base) + (len) > 0x1000)) + && ((base) + (len) > PCIBIOS_MIN_IO)) /* * Clearing the flag (IORESOURCE_BUSY) allows drivers to use diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 7289da3c4db..0d11d6e6abd 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -71,7 +71,7 @@ EXPORT_SYMBOL(acpi_in_debugger); extern char line_buf[80]; #endif /*ENABLE_DEBUGGER*/ -int acpi_specific_hotkey_enabled; +int acpi_specific_hotkey_enabled = TRUE; EXPORT_SYMBOL(acpi_specific_hotkey_enabled); static unsigned int acpi_irq_irq; @@ -1162,11 +1162,11 @@ __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup); int __init acpi_hotkey_setup(char *str) { - acpi_specific_hotkey_enabled = TRUE; + acpi_specific_hotkey_enabled = FALSE; return 1; } -__setup("acpi_specific_hotkey", acpi_hotkey_setup); +__setup("acpi_generic_hotkey", acpi_hotkey_setup); /* * max_cstate is defined in the base kernel so modules can diff --git a/drivers/base/class.c b/drivers/base/class.c index 479c1257088..0154a1623b2 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -299,6 +299,11 @@ static void class_dev_release(struct kobject * kobj) pr_debug("device class '%s': release.\n", cd->class_id); + if (cd->devt_attr) { + kfree(cd->devt_attr); + cd->devt_attr = NULL; + } + if (cls->release) cls->release(cd); else { @@ -591,11 +596,8 @@ void class_device_del(struct class_device *class_dev) if (class_dev->dev) sysfs_remove_link(&class_dev->kobj, "device"); - if (class_dev->devt_attr) { + if (class_dev->devt_attr) class_device_remove_file(class_dev, class_dev->devt_attr); - kfree(class_dev->devt_attr); - class_dev->devt_attr = NULL; - } class_device_remove_attrs(class_dev); kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 42187381506..850a78c9c4b 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) static int mmap_kmem(struct file * file, struct vm_area_struct * vma) { - unsigned long long val; + unsigned long pfn; + + /* Turn a kernel-virtual address into a physical page frame */ + pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; + /* * RED-PEN: on some architectures there is more mapped memory * 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) * * RED-PEN: vmalloc is not supported right now. */ - if (!pfn_valid(vma->vm_pgoff)) + if (!pfn_valid(pfn)) return -EIO; - val = (u64)vma->vm_pgoff << PAGE_SHIFT; - vma->vm_pgoff = __pa(val) >> PAGE_SHIFT; + + vma->vm_pgoff = pfn; return mmap_mem(file, vma); } diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index f975dab1ddf..a13395e2c37 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c @@ -1,5 +1,5 @@ /* - * i8xx_tco 0.07: TCO timer driver for i8xx chipsets + * i8xx_tco: TCO timer driver for i8xx chipsets * * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. * http://www.kernelconcepts.de @@ -63,6 +63,9 @@ * 20050128 Wim Van Sebroeck <wim@iguana.be> * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW * chipsets. Also added support for the "undocumented" ICH7 chipset. + * 20050807 Wim Van Sebroeck <wim@iguana.be> + * 0.08 Make sure that the watchdog is only "armed" when started. + * (Kernel Bug 4251) */ /* @@ -87,7 +90,7 @@ #include "i8xx_tco.h" /* Module and version information */ -#define TCO_VERSION "0.07" +#define TCO_VERSION "0.08" #define TCO_MODULE_NAME "i8xx TCO timer" #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION #define PFX TCO_MODULE_NAME ": " @@ -125,10 +128,18 @@ static int tco_timer_start (void) unsigned char val; spin_lock(&tco_lock); + + /* disable chipset's NO_REBOOT bit */ + pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); + val &= 0xfd; + pci_write_config_byte (i8xx_tco_pci, 0xd4, val); + + /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */ val = inb (TCO1_CNT + 1); val &= 0xf7; outb (val, TCO1_CNT + 1); val = inb (TCO1_CNT + 1); + spin_unlock(&tco_lock); if (val & 0x08) @@ -138,13 +149,20 @@ static int tco_timer_start (void) static int tco_timer_stop (void) { - unsigned char val; + unsigned char val, val1; spin_lock(&tco_lock); + /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */ val = inb (TCO1_CNT + 1); val |= 0x08; outb (val, TCO1_CNT + 1); val = inb (TCO1_CNT + 1); + + /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ + pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); + val1 |= 0x02; + pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); + spin_unlock(&tco_lock); if ((val & 0x08) == 0) @@ -155,6 +173,7 @@ static int tco_timer_stop (void) static int tco_timer_keepalive (void) { spin_lock(&tco_lock); + /* Reload the timer by writing to the TCO Timer Reload register */ outb (0x01, TCO1_RLD); spin_unlock(&tco_lock); return 0; @@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void) printk (KERN_ERR PFX "failed to get TCOBASE address\n"); return 0; } - /* - * Check chipset's NO_REBOOT bit - */ + + /* Check chipset's NO_REBOOT bit */ pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); if (val1 & 0x02) { val1 &= 0xfd; @@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void) return 0; /* Cannot reset NO_REBOOT bit */ } } + /* Disable reboots untill the watchdog starts */ + val1 |= 0x02; + pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); + /* Set the TCO_EN bit in SMI_EN register */ if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", @@ -505,17 +527,10 @@ out: static void __exit watchdog_cleanup (void) { - u8 val; - /* Stop the timer before we leave */ if (!nowayout) tco_timer_stop (); - /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ - pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); - val |= 0x02; - pci_write_config_byte (i8xx_tco_pci, 0xd4, val); - /* Deregister */ misc_deregister (&i8xx_tco_miscdev); unregister_reboot_notifier(&i8xx_tco_notifier); diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 1c99536b673..fa503ed9f86 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c @@ -23,8 +23,8 @@ #include <asm/sibyte/sb1250_smbus.h> static struct i2c_algo_sibyte_data sibyte_board_data[2] = { - { NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) }, - { NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) } + { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) }, + { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) } }; static struct i2c_adapter sibyte_board_adapter[2] = { diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index f9c1acb4ed6..c9d3a00a3c0 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) goto failed; g = alloc_disk_node(1 << PARTN_BITS, - pcibus_to_node(drive->hwif->pci_dev->bus)); + hwif_to_node(drive->hwif)); if (!g) goto out_free_idkp; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 94daf40ae32..c1128ae5cd2 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) } #endif /* MAX_HWIFS > 1 */ -static inline int hwif_to_node(ide_hwif_t *hwif) -{ - if (hwif->pci_dev) - return pcibus_to_node(hwif->pci_dev->bus); - else - /* Add ways to determine the node of other busses here */ - return -1; -} - /* * init request queue */ diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index 1ab5f2dc8a2..70f051894a3 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c @@ -275,9 +275,9 @@ static int __init ns558_init(void) static void __exit ns558_exit(void) { - struct ns558 *ns558; + struct ns558 *ns558, *safe; - list_for_each_entry(ns558, &ns558_list, node) { + list_for_each_entry_safe(ns558, safe, &ns558_list, node) { gameport_unregister_port(ns558->gameport); release_region(ns558->io & ~(ns558->size - 1), ns558->size); kfree(ns558); diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index e83256d0fd1..a50a41f6f79 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig @@ -188,7 +188,7 @@ config DVB_BCM3510 support this frontend. config DVB_LGDT330X - tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)" + tristate "LG Electronics LGDT3302/LGDT3303 based" depends on DVB_CORE help 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 c48e7c11d70..1f1cd7a8d50 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) } } -#ifdef MUTE_TDA9887 -static int i2c_write_ntsc_demod (struct lgdt330x_state* state, u8 buf[2]) -{ - struct i2c_msg msg = - { .addr = 0x43, - .flags = 0, - .buf = buf, - .len = 2 }; - int err; - - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { - printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, msg.buf[0], msg.buf[1], err); - if (err < 0) - return err; - else - return -EREMOTEIO; - } - return 0; -} - -static void fiddle_with_ntsc_if_demod(struct lgdt330x_state* state) -{ - // Experimental code - u8 buf0[] = {0x00, 0x20}; - u8 buf1[] = {0x01, 0x00}; - u8 buf2[] = {0x02, 0x00}; - - i2c_write_ntsc_demod(state, buf0); - i2c_write_ntsc_demod(state, buf1); - i2c_write_ntsc_demod(state, buf2); -} -#endif static int lgdt330x_init(struct dvb_frontend* fe) { @@ -267,9 +235,6 @@ static int lgdt330x_init(struct dvb_frontend* fe) chip_name = "LGDT3303"; err = i2c_write_demod_bytes(state, lgdt3303_init_data, sizeof(lgdt3303_init_data)); -#ifdef MUTE_TDA9887 - fiddle_with_ntsc_if_demod(state); -#endif break; default: chip_name = "undefined"; @@ -772,7 +737,7 @@ error: static struct dvb_frontend_ops lgdt3302_ops = { .info = { - .name= "LG Electronics LGDT3302/LGDT3303 VSB/QAM Frontend", + .name= "LG Electronics LGDT3302 VSB/QAM Frontend", .type = FE_ATSC, .frequency_min= 54000000, .frequency_max= 858000000, diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 06e8eb19a05..43a942a29c2 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig @@ -53,6 +53,9 @@ config I2O_CONFIG To compile this support as a module, choose M here: the module will be called i2o_config. + Note: If you want to use the new API you have to download the + i2o_config patch from http://i2o.shadowconnect.com/ + config I2O_CONFIG_OLD_IOCTL bool "Enable ioctls (OBSOLETE)" depends on I2O_CONFIG diff --git a/drivers/message/i2o/config-osm.c b/drivers/message/i2o/config-osm.c index fe2e7afc9ea..af32ab4e90c 100644 --- a/drivers/message/i2o/config-osm.c +++ b/drivers/message/i2o/config-osm.c @@ -30,503 +30,9 @@ static struct i2o_driver i2o_config_driver; -/* Special file operations for sysfs */ -struct fops_attribute { - struct bin_attribute bin; - struct file_operations fops; -}; - -/** - * sysfs_read_dummy - */ -static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset, - size_t count) -{ - return 0; -}; - -/** - * sysfs_write_dummy - */ -static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset, - size_t count) -{ - return 0; -}; - -/** - * sysfs_create_fops_file - Creates attribute with special file operations - * @kobj: kobject which should contains the attribute - * @attr: attributes which should be used to create file - * - * First creates attribute @attr in kobject @kobj. If it is the first time - * this function is called, merge old fops from sysfs with new one and - * write it back. Afterwords the new fops will be set for the created - * attribute. - * - * Returns 0 on success or negative error code on failure. - */ -static int sysfs_create_fops_file(struct kobject *kobj, - struct fops_attribute *attr) -{ - struct file_operations tmp, *fops; - struct dentry *d; - struct qstr qstr; - int rc; - - fops = &attr->fops; - - if (fops->read) - attr->bin.read = sysfs_read_dummy; - - if (fops->write) - attr->bin.write = sysfs_write_dummy; - - if ((rc = sysfs_create_bin_file(kobj, &attr->bin))) - return rc; - - qstr.name = attr->bin.attr.name; - qstr.len = strlen(qstr.name); - qstr.hash = full_name_hash(qstr.name, qstr.len); - - if ((d = lookup_hash(&qstr, kobj->dentry))) { - if (!fops->owner) { - memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp)); - if (fops->read) - tmp.read = fops->read; - if (fops->write) - tmp.write = fops->write; - memcpy(fops, &tmp, sizeof(tmp)); - } - - d->d_inode->i_fop = fops; - } else - sysfs_remove_bin_file(kobj, &attr->bin); - - return -ENOENT; -}; - -/** - * sysfs_remove_fops_file - Remove attribute with special file operations - * @kobj: kobject which contains the attribute - * @attr: attributes which are used to create file - * - * Only wrapper arround sysfs_remove_bin_file() - * - * Returns 0 on success or negative error code on failure. - */ -static inline int sysfs_remove_fops_file(struct kobject *kobj, - struct fops_attribute *attr) -{ - return sysfs_remove_bin_file(kobj, &attr->bin); -}; - -/** - * i2o_config_read_hrt - Returns the HRT of the controller - * @kob: kernel object handle - * @buf: buffer into which the HRT should be copied - * @off: file offset - * @count: number of bytes to read - * - * Put @count bytes starting at @off into @buf from the HRT of the I2O - * controller corresponding to @kobj. - * - * Returns number of bytes copied into buffer. - */ -static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf, - loff_t offset, size_t count) -{ - struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; - i2o_hrt *hrt = c->hrt.virt; - - u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4; - - if (offset > size) - return 0; - - if (offset + count > size) - count = size - offset; - - memcpy(buf, (u8 *) hrt + offset, count); - - return count; -}; - -/** - * i2o_config_read_lct - Returns the LCT of the controller - * @kob: kernel object handle - * @buf: buffer into which the LCT should be copied - * @off: file offset - * @count: number of bytes to read - * - * Put @count bytes starting at @off into @buf from the LCT of the I2O - * controller corresponding to @kobj. - * - * Returns number of bytes copied into buffer. - */ -static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf, - loff_t offset, size_t count) -{ - struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; - u32 size = c->lct->table_size * 4; - - if (offset > size) - return 0; - - if (offset + count > size) - count = size - offset; - - memcpy(buf, (u8 *) c->lct + offset, count); - - return count; -}; - -#define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \ -static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \ - return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \ -};\ -\ -static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \ - return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \ -}; \ -\ -static struct fops_attribute i2o_config_attr_##_name = { \ - .bin = { .attr = { .name = __stringify(_name), .mode = _mode, \ - .owner = THIS_MODULE }, \ - .size = 0, }, \ - .fops = { .write = i2o_config_##_name##_write, \ - .read = i2o_config_##_name##_read} \ -}; - -#ifdef CONFIG_I2O_EXT_ADAPTEC - -/** - * i2o_config_dpt_reagion - Converts type and id to flash region - * @swtype: type of software module reading - * @swid: id of software which should be read - * - * Converts type and id from I2O spec to the matching region for DPT / - * Adaptec controllers. - * - * Returns region which match type and id or -1 on error. - */ -static u32 i2o_config_dpt_region(u8 swtype, u8 swid) -{ - switch (swtype) { - case I2O_SOFTWARE_MODULE_IRTOS: - /* - * content: operation firmware - * region size: - * 0xbc000 for 2554, 3754, 2564, 3757 - * 0x170000 for 2865 - * 0x17c000 for 3966 - */ - if (!swid) - return 0; - - break; - - case I2O_SOFTWARE_MODULE_IOP_PRIVATE: - /* - * content: BIOS and SMOR - * BIOS size: first 0x8000 bytes - * region size: - * 0x40000 for 2554, 3754, 2564, 3757 - * 0x80000 for 2865, 3966 - */ - if (!swid) - return 1; - - break; - - case I2O_SOFTWARE_MODULE_IOP_CONFIG: - switch (swid) { - case 0: - /* - * content: NVRAM defaults - * region size: 0x2000 bytes - */ - return 2; - case 1: - /* - * content: serial number - * region size: 0x2000 bytes - */ - return 3; - } - break; - } - - return -1; -}; - -#endif - -/** - * i2o_config_sw_read - Read a software module from controller - * @file: file pointer - * @buf: buffer into which the data should be copied - * @count: number of bytes to read - * @off: file offset - * @swtype: type of software module reading - * @swid: id of software which should be read - * - * Transfers @count bytes at offset @offset from IOP into buffer using - * type @swtype and id @swid as described in I2O spec. - * - * Returns number of bytes copied into buffer or error code on failure. - */ -static ssize_t i2o_config_sw_read(struct file *file, char __user * buf, - size_t count, loff_t * offset, u8 swtype, - u32 swid) -{ - struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; - struct kobject *kobj = sd->s_element; - struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; - u32 m, function = I2O_CMD_SW_UPLOAD; - struct i2o_dma buffer; - struct i2o_message __iomem *msg; - u32 __iomem *mptr; - int rc, status; - - m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); - if (m == I2O_QUEUE_EMPTY) - return -EBUSY; - - mptr = &msg->body[3]; - - if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) { - i2o_msg_nop(c, m); - return rc; - } -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (c->adaptec) { - mptr = &msg->body[4]; - function = I2O_CMD_PRIVATE; - - writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); - - writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ, - &msg->body[0]); - writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); - writel(*offset, &msg->body[2]); - writel(count, &msg->body[3]); - } else -#endif - writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); - - writel(0xD0000000 | count, mptr++); - writel(buffer.phys, mptr); - - writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); - writel(i2o_config_driver.context, &msg->u.head[2]); - writel(0, &msg->u.head[3]); - -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (!c->adaptec) -#endif - { - writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); - writel(0, &msg->body[1]); - writel(swid, &msg->body[2]); - } - - status = i2o_msg_post_wait_mem(c, m, 60, &buffer); - - if (status == I2O_POST_WAIT_OK) { - if (!(rc = copy_to_user(buf, buffer.virt, count))) { - rc = count; - *offset += count; - } - } else - rc = -EIO; - - if (status != -ETIMEDOUT) - i2o_dma_free(&c->pdev->dev, &buffer); - - return rc; -}; - -/** - * i2o_config_sw_write - Write a software module to controller - * @file: file pointer - * @buf: buffer into which the data should be copied - * @count: number of bytes to read - * @off: file offset - * @swtype: type of software module writing - * @swid: id of software which should be written - * - * Transfers @count bytes at offset @offset from buffer to IOP using - * type @swtype and id @swid as described in I2O spec. - * - * Returns number of bytes copied from buffer or error code on failure. - */ -static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf, - size_t count, loff_t * offset, u8 swtype, - u32 swid) -{ - struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; - struct kobject *kobj = sd->s_element; - struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; - u32 m, function = I2O_CMD_SW_DOWNLOAD; - struct i2o_dma buffer; - struct i2o_message __iomem *msg; - u32 __iomem *mptr; - int rc, status; - - m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); - if (m == I2O_QUEUE_EMPTY) - return -EBUSY; - - mptr = &msg->body[3]; - - if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) - goto nop_msg; - - if ((rc = copy_from_user(buffer.virt, buf, count))) - goto free_buffer; - -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (c->adaptec) { - mptr = &msg->body[4]; - function = I2O_CMD_PRIVATE; - - writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); - - writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE, - &msg->body[0]); - writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); - writel(*offset, &msg->body[2]); - writel(count, &msg->body[3]); - } else -#endif - writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); - - writel(0xD4000000 | count, mptr++); - writel(buffer.phys, mptr); - - writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); - writel(i2o_config_driver.context, &msg->u.head[2]); - writel(0, &msg->u.head[3]); - -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (!c->adaptec) -#endif - { - writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); - writel(0, &msg->body[1]); - writel(swid, &msg->body[2]); - } - - status = i2o_msg_post_wait_mem(c, m, 60, &buffer); - - if (status != -ETIMEDOUT) - i2o_dma_free(&c->pdev->dev, &buffer); - - if (status != I2O_POST_WAIT_OK) - return -EIO; - - *offset += count; - - return count; - - free_buffer: - i2o_dma_free(&c->pdev->dev, &buffer); - - nop_msg: - i2o_msg_nop(c, m); - - return rc; -}; - -/* attribute for HRT in sysfs */ -static struct bin_attribute i2o_config_hrt_attr = { - .attr = { - .name = "hrt", - .mode = S_IRUGO, - .owner = THIS_MODULE}, - .size = 0, - .read = i2o_config_read_hrt -}; - -/* attribute for LCT in sysfs */ -static struct bin_attribute i2o_config_lct_attr = { - .attr = { - .name = "lct", - .mode = S_IRUGO, - .owner = THIS_MODULE}, - .size = 0, - .read = i2o_config_read_lct -}; - -/* IRTOS firmware access */ -I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0); - -#ifdef CONFIG_I2O_EXT_ADAPTEC - -/* - * attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec - * controllers - */ -I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0); -I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0); -I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1); - -#endif - -/** - * i2o_config_notify_controller_add - Notify of added controller - * @c: the controller which was added - * - * If a I2O controller is added, we catch the notification to add sysfs - * entries. - */ -static void i2o_config_notify_controller_add(struct i2o_controller *c) -{ - struct kobject *kobj = &c->exec->device.kobj; - - sysfs_create_bin_file(kobj, &i2o_config_hrt_attr); - sysfs_create_bin_file(kobj, &i2o_config_lct_attr); - - sysfs_create_fops_file(kobj, &i2o_config_attr_irtos); -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (c->adaptec) { - sysfs_create_fops_file(kobj, &i2o_config_attr_bios); - sysfs_create_fops_file(kobj, &i2o_config_attr_nvram); - sysfs_create_fops_file(kobj, &i2o_config_attr_serial); - } -#endif -}; - -/** - * i2o_config_notify_controller_remove - Notify of removed controller - * @c: the controller which was removed - * - * If a I2O controller is removed, we catch the notification to remove the - * sysfs entries. - */ -static void i2o_config_notify_controller_remove(struct i2o_controller *c) -{ - struct kobject *kobj = &c->exec->device.kobj; - -#ifdef CONFIG_I2O_EXT_ADAPTEC - if (c->adaptec) { - sysfs_remove_fops_file(kobj, &i2o_config_attr_serial); - sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram); - sysfs_remove_fops_file(kobj, &i2o_config_attr_bios); - } -#endif - sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos); - - sysfs_remove_bin_file(kobj, &i2o_config_lct_attr); - sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr); -}; - /* Config OSM driver struct */ static struct i2o_driver i2o_config_driver = { .name = OSM_NAME, - .notify_controller_add = i2o_config_notify_controller_add, - .notify_controller_remove = i2o_config_notify_controller_remove }; #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index 7a60fd7be8a..66c03e88257 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c @@ -32,6 +32,8 @@ #include <linux/i2o.h> #include "core.h" +#define OSM_DESCRIPTION "I2O-subsystem" + /* PCI device id table for all I2O controllers */ static struct pci_device_id __devinitdata i2o_pci_ids[] = { {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, @@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c) if (c->base.virt) iounmap(c->base.virt); + + pci_release_regions(c->pdev); } /** @@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) struct device *dev = &pdev->dev; int i; + if (pci_request_regions(pdev, OSM_DESCRIPTION)) { + printk(KERN_ERR "%s: device already claimed\n", c->name); + return -ENODEV; + } + for (i = 0; i < 6; i++) { /* Skip I/O spaces */ if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { @@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) c->base.virt = ioremap_nocache(c->base.phys, c->base.len); if (!c->base.virt) { printk(KERN_ERR "%s: Unable to map controller.\n", c->name); + i2o_pci_free(c); return -ENOMEM; } diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 8b487ed1069..974f2f36bdb 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -42,7 +42,7 @@ #include "wbsd.h" #define DRIVER_NAME "wbsd" -#define DRIVER_VERSION "1.2" +#define DRIVER_VERSION "1.3" #ifdef CONFIG_MMC_DEBUG #define DBG(x...) \ diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e5d2c3c7ce..b82fd15d089 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) struct e1000_adapter *adapter = netdev_priv(netdev); disable_irq(adapter->pdev->irq); e1000_intr(adapter->pdev->irq, netdev, NULL); + e1000_clean_tx_irq(adapter); enable_irq(adapter->pdev->irq); } #endif diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index e44f8e9055e..f9e3be96963 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -130,12 +130,11 @@ struct sixpack { #define AX25_6PACK_HEADER_LEN 0 -static void sp_start_tx_timer(struct sixpack *); static void sixpack_decode(struct sixpack *, unsigned char[], int); static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); /* - * perform the persistence/slottime algorithm for CSMA access. If the + * Perform the persistence/slottime algorithm for CSMA access. If the * persistence check was successful, write the data to the serial driver. * Note that in case of DAMA operation, the data is not sent here. */ @@ -143,7 +142,7 @@ static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); static void sp_xmit_on_air(unsigned long channel) { struct sixpack *sp = (struct sixpack *) channel; - int actual; + int actual, when = sp->slottime; static unsigned char random; random = random * 17 + 41; @@ -159,20 +158,10 @@ static void sp_xmit_on_air(unsigned long channel) sp->tty->driver->write(sp->tty, &sp->led_state, 1); sp->status2 = 0; } else - sp_start_tx_timer(sp); + mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); } /* ----> 6pack timer interrupt handler and friends. <---- */ -static void sp_start_tx_timer(struct sixpack *sp) -{ - int when = sp->slottime; - - del_timer(&sp->tx_t); - sp->tx_t.data = (unsigned long) sp; - sp->tx_t.function = sp_xmit_on_air; - sp->tx_t.expires = jiffies + ((when + 1) * HZ) / 100; - add_timer(&sp->tx_t); -} /* Encapsulate one AX.25 frame and stuff into a TTY queue. */ 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) sp->xleft = count; sp->xhead = sp->xbuff; sp->status2 = count; - if (sp->duplex == 0) - sp_start_tx_timer(sp); + sp_xmit_on_air((unsigned long)sp); } return; diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 46b294a1241..2b92b9e8c91 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ #ifndef _PCIEHP_H diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index df4915dbc32..cafc7eadcf8 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 0dbcf04aa35..0e094760152 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1cda30bd6e4..7a0e27f0e06 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 723b12c0bb7..33b539b34f7 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehprm.h b/drivers/pci/hotplug/pciehprm.h index 966775ffb0f..05f20fbc5f5 100644 --- a/drivers/pci/hotplug/pciehprm.h +++ b/drivers/pci/hotplug/pciehprm.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c index 57f4e6d1b27..305b47ec2f2 100644 --- a/drivers/pci/hotplug/pciehprm_acpi.c +++ b/drivers/pci/hotplug/pciehprm_acpi.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <dely.l.sy@intel.com> + * Send feedback to <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c index 79a0aa6238e..3622965f896 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.c +++ b/drivers/pci/hotplug/pciehprm_nonacpi.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.h b/drivers/pci/hotplug/pciehprm_nonacpi.h index 87c90e85ede..b10603b0e95 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.h +++ b/drivers/pci/hotplug/pciehprm_nonacpi.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index 67b6a3370ce..fe4d653da18 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> * */ #ifndef _SHPCHP_H diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index a70a5c5705f..6f7d8a29957 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 490a9553a06..783b5abb071 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 38c5d906669..8d98410bf1c 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index 90113e9cd69..d867099114e 100644 --- a/drivers/pci/hotplug/shpchp_pci.c +++ b/drivers/pci/hotplug/shpchp_pci.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm.h b/drivers/pci/hotplug/shpchprm.h index 88aeb978c91..057b192ce58 100644 --- a/drivers/pci/hotplug/shpchprm.h +++ b/drivers/pci/hotplug/shpchprm.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c index 7957cdc72cd..d37b31658ed 100644 --- a/drivers/pci/hotplug/shpchprm_acpi.c +++ b/drivers/pci/hotplug/shpchprm_acpi.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <dely.l.sy@intel.com> + * Send feedback to <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c index 37fa77a9828..ba6c549c9b9 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.c +++ b/drivers/pci/hotplug/shpchprm_legacy.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm_legacy.h b/drivers/pci/hotplug/shpchprm_legacy.h index 29ccea5e57e..21bda74ddfa 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.h +++ b/drivers/pci/hotplug/shpchprm_legacy.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c index 88f4d9f4188..5f75ef7f3df 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.c +++ b/drivers/pci/hotplug/shpchprm_nonacpi.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.h b/drivers/pci/hotplug/shpchprm_nonacpi.h index 6bc8668023c..cddaaa5ee1b 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.h +++ b/drivers/pci/hotplug/shpchprm_nonacpi.h @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> + * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */ diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index b5ab9aa6ff7..2b85aa39f95 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) } } -static void disable_msi_mode(struct pci_dev *dev, int pos, int type) +void disable_msi_mode(struct pci_dev *dev, int pos, int type) { u16 control; @@ -699,6 +699,9 @@ int pci_enable_msi(struct pci_dev* dev) if (!pci_msi_enable || !dev) return status; + if (dev->no_msi) + return status; + temp = dev->irq; if ((status = msi_init()) < 0) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index d94d7af4f7a..d00168b1f66 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -47,6 +47,12 @@ extern int pci_msi_quirk; #define pci_msi_quirk 0 #endif +#ifdef CONFIG_PCI_MSI +void disable_msi_mode(struct pci_dev *dev, int pos, int type); +#else +static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { } +#endif + extern int pcie_mch_quirk; extern struct device_attribute pci_dev_attrs[]; extern struct class_device_attribute class_device_attr_cpuaffinity; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a9160ad1658..bb36bb69803 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 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch ); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch ); + +/* + * It's possible for the MSI to get corrupted if shpc and acpi + * are used together on certain PXH-based systems. + */ +static void __devinit quirk_pcie_pxh(struct pci_dev *dev) +{ + disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI), + PCI_CAP_ID_MSI); + dev->no_msi = 1; + + printk(KERN_WARNING "PCI: PXH quirk detected, " + "disabling MSI for SHPC device\n"); +} +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_0, quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_1, quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); + + static void __devinit quirk_netmos(struct pci_dev *dev) { 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 b8a2c7353b0..d44205d52bf 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c @@ -7,6 +7,7 @@ #define __KERNEL_SYSCALLS__ #include <linux/kernel.h> +#include <linux/kthread.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/delay.h> @@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task; static int kenvctrld(void *__unused) { - daemonize("kenvctrld"); - allow_signal(SIGKILL); - kenvctrld_task = current; - printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); last_warning_jiffies = jiffies - WARN_INTERVAL; for (;;) { @@ -470,7 +467,7 @@ static int kenvctrld(void *__unused) struct bbc_fan_control *fp; msleep_interruptible(POLL_INTERVAL); - if (signal_pending(current)) + if (kthread_should_stop()) break; for (tp = all_bbc_temps; tp; tp = tp->next) { @@ -577,7 +574,6 @@ int bbc_envctrl_init(void) int temp_index = 0; int fan_index = 0; int devidx = 0; - int err = 0; while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { if (!strcmp(echild->prom_name, "temperature")) @@ -585,9 +581,13 @@ int bbc_envctrl_init(void) if (!strcmp(echild->prom_name, "fan-control")) attach_one_fan(echild, fan_index++); } - if (temp_index != 0 && fan_index != 0) - err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); - return err; + if (temp_index != 0 && fan_index != 0) { + kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); + if (IS_ERR(kenvctrld_task)) + return PTR_ERR(kenvctrld_task); + } + + return 0; } static void destroy_one_temp(struct bbc_cpu_temperature *tp) @@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void) struct bbc_cpu_temperature *tp; struct bbc_fan_control *fp; - if (kenvctrld_task != NULL) { - force_sig(SIGKILL, kenvctrld_task); - for (;;) { - struct task_struct *p; - int found = 0; - - read_lock(&tasklist_lock); - for_each_process(p) { - if (p == kenvctrld_task) { - found = 1; - break; - } - } - read_unlock(&tasklist_lock); - if (!found) - break; - msleep(1000); - } - kenvctrld_task = NULL; - } + kthread_stop(kenvctrld_task); tp = all_bbc_temps; while (tp != NULL) { diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 9a8c572554f..d765cc1bf06 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -24,6 +24,7 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> +#include <linux/kthread.h> #include <linux/errno.h> #include <linux/delay.h> #include <linux/ioport.h> @@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused) poll_interval = 5000; /* TODO env_mon_interval */ - daemonize("kenvctrld"); - allow_signal(SIGKILL); - - kenvctrld_task = current; - printk(KERN_INFO "envctrl: %s starting...\n", current->comm); for (;;) { - if(msleep_interruptible(poll_interval)) - break; + msleep_interruptible(poll_interval); + if (kthread_should_stop()) + break; + for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { if (0 < envctrl_read_cpu_info(whichcpu, cputemp, ENVCTRL_CPUTEMP_MON, @@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused) static int __init envctrl_init(void) { -#ifdef CONFIG_PCI struct linux_ebus *ebus = NULL; struct linux_ebus_device *edev = NULL; struct linux_ebus_child *edev_child = NULL; @@ -1118,9 +1115,11 @@ done: i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); } - err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); - if (err < 0) + kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); + if (IS_ERR(kenvctrld_task)) { + err = PTR_ERR(kenvctrld_task); goto out_deregister; + } return 0; @@ -1133,37 +1132,13 @@ out_iounmap: kfree(i2c_childlist[i].tables); } return err; -#else - return -ENODEV; -#endif } static void __exit envctrl_cleanup(void) { int i; - if (NULL != kenvctrld_task) { - force_sig(SIGKILL, kenvctrld_task); - for (;;) { - struct task_struct *p; - int found = 0; - - read_lock(&tasklist_lock); - for_each_process(p) { - if (p == kenvctrld_task) { - found = 1; - break; - } - } - read_unlock(&tasklist_lock); - - if (!found) - break; - - msleep(1000); - } - kenvctrld_task = NULL; - } + kthread_stop(kenvctrld_task); iounmap(i2c); misc_deregister(&envctrl_dev); diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 929170dcd3c..600ba120286 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -183,7 +183,7 @@ * cross a page boundy. */ #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) -#define VIRTX_LEN (sizeof(void *) * DC395x_MAX_SG_LISTENTRY) + struct SGentry { u32 address; /* bus! address */ @@ -235,7 +235,6 @@ struct ScsiReqBlk { u8 sg_count; /* No of HW sg entries for this request */ u8 sg_index; /* Index of HW sg entry for this request */ u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ - void **virt_map; unsigned char *virt_addr; /* Virtual address of current transfer position */ /* @@ -1022,14 +1021,14 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, reqlen, cmd->request_buffer, cmd->use_sg, srb->sg_count); + srb->virt_addr = page_address(sl->page); for (i = 0; i < srb->sg_count; i++) { - u32 seglen = (u32)sg_dma_len(sl + i); - sgp[i].address = (u32)sg_dma_address(sl + i); + u32 busaddr = (u32)sg_dma_address(&sl[i]); + u32 seglen = (u32)sl[i].length; + sgp[i].address = busaddr; sgp[i].length = seglen; srb->total_xfer_length += seglen; - srb->virt_map[i] = kmap(sl[i].page); } - srb->virt_addr = srb->virt_map[0]; sgp += srb->sg_count - 1; /* @@ -1976,7 +1975,6 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) int segment = cmd->use_sg; u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ struct SGentry *psge = srb->segment_x + srb->sg_index; - void **virt = srb->virt_map; dprintkdbg(DBG_0, "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) /* We have to walk the scatterlist to find it */ sg = (struct scatterlist *)cmd->request_buffer; - idx = 0; while (segment--) { unsigned long mask = ~((unsigned long)sg->length - 1) & PAGE_MASK; if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { - srb->virt_addr = virt[idx] + (psge->address & ~PAGE_MASK); + srb->virt_addr = (page_address(sg->page) + + psge->address - + (psge->address & PAGE_MASK)); return; } ++sg; - ++idx; } 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, DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); } /* - * calculate all the residue data that not yet transfered + * calculate all the residue data that not yet tranfered * SCSI transfer counter + left in SCSI FIFO data * * .....TRM_S1040_SCSI_COUNTER (24bits) @@ -3269,7 +3267,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) struct scsi_cmnd *cmd = srb->cmd; enum dma_data_direction dir = cmd->sc_data_direction; if (cmd->use_sg && dir != PCI_DMA_NONE) { - int i; /* unmap DC395x SG list */ dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", srb->sg_bus_addr, SEGMENTX_LEN); @@ -3279,8 +3276,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", cmd->use_sg, cmd->request_buffer); /* unmap the sg segments */ - for (i = 0; i < srb->sg_count; i++) - kunmap(virt_to_page(srb->virt_map[i])); pci_unmap_sg(acb->dev, (struct scatterlist *)cmd->request_buffer, cmd->use_sg, dir); @@ -3327,7 +3322,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, if (cmd->use_sg) { struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; - ptr = (struct ScsiInqData *)(srb->virt_map[0] + sg->offset); + ptr = (struct ScsiInqData *)(page_address(sg->page) + sg->offset); } else { ptr = (struct ScsiInqData *)(cmd->request_buffer); } @@ -4262,9 +4257,8 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb) const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) - kfree(acb->srb_array[i].segment_x); - - vfree(acb->srb_array[0].virt_map); + if (acb->srb_array[i].segment_x) + kfree(acb->srb_array[i].segment_x); } @@ -4280,12 +4274,9 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) int srb_idx = 0; unsigned i = 0; struct SGentry *ptr; - void **virt_array; - for (i = 0; i < DC395x_MAX_SRB_CNT; i++) { + for (i = 0; i < DC395x_MAX_SRB_CNT; i++) acb->srb_array[i].segment_x = NULL; - acb->srb_array[i].virt_map = NULL; - } dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); while (pages--) { @@ -4306,19 +4297,6 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) ptr + (i * DC395x_MAX_SG_LISTENTRY); else dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); - - virt_array = vmalloc((DC395x_MAX_SRB_CNT + 1) * DC395x_MAX_SG_LISTENTRY * sizeof(void*)); - - if (!virt_array) { - adapter_sg_tables_free(acb); - return 1; - } - - for (i = 0; i < DC395x_MAX_SRB_CNT + 1; i++) { - acb->srb_array[i].virt_map = virt_array; - virt_array += DC395x_MAX_SG_LISTENTRY; - } - return 0; } diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index e2370529c63..7235f94f119 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 raptorFlag = TRUE; } - + if (pci_request_regions(pDev, "dpt_i2o")) { + PERROR("dpti: adpt_config_hba: pci request region failed\n"); + return -EINVAL; + } base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); if (!base_addr_virt) { + pci_release_regions(pDev); PERROR("dpti: adpt_config_hba: io remap failed\n"); return -EINVAL; } @@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev if (!msg_addr_virt) { PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); iounmap(base_addr_virt); + pci_release_regions(pDev); return -EINVAL; } } else { @@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev iounmap(msg_addr_virt); } iounmap(base_addr_virt); + pci_release_regions(pDev); return -ENOMEM; } memset(pHba, 0, sizeof(adpt_hba)); @@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) up(&adpt_configuration_lock); iounmap(pHba->base_addr_virt); + pci_release_regions(pHba->pDev); if(pHba->msg_addr_virt != pHba->base_addr_virt){ iounmap(pHba->msg_addr_virt); } diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 794fb559efb..6a75ec2187f 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) * appropriate place */ host->host_failed--; + INIT_LIST_HEAD(&host->eh_cmd_q); DPRINTK("EXIT\n"); return 0; diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index 140cea05de3..efd7d7a6113 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) for (i = 0; i < last; i++) { buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); - total_len += sg[i].length; + total_len += sg_dma_len(&sg[i]); } buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); sgt_len = idx * 4; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 2d3c4ac475f..48edd67982a 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, unsigned long flags; const int size = sizeof(struct scsi_target) + shost->transportt->target_size; - struct scsi_target *starget = kmalloc(size, GFP_ATOMIC); + struct scsi_target *starget; struct scsi_target *found_target; + /* + * Obtain the real parent from the transport. The transport + * is allowed to fail (no error) if there is nothing at that + * target id. + */ + if (shost->transportt->target_parent) { + spin_lock_irqsave(shost->host_lock, flags); + parent = shost->transportt->target_parent(shost, channel, id); + spin_unlock_irqrestore(shost->host_lock, flags); + if (!parent) + return NULL; + } + + starget = kmalloc(size, GFP_KERNEL); if (!starget) { printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); return NULL; diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 35d1c1e8e34..e6412fce423 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, return &i->rport_attr_cont.ac == cont; } + +/* + * Must be called with shost->host_lock held + */ +static struct device *fc_target_parent(struct Scsi_Host *shost, + int channel, uint id) +{ + struct fc_rport *rport; + + list_for_each_entry(rport, &fc_host_rports(shost), peers) + if ((rport->channel == channel) && + (rport->scsi_target_id == id)) + return &rport->dev; + + return NULL; +} + struct scsi_transport_template * fc_attach_transport(struct fc_function_template *ft) { @@ -1057,6 +1074,8 @@ fc_attach_transport(struct fc_function_template *ft) /* Transport uses the shost workq for scsi scanning */ i->t.create_work_queue = 1; + + i->t.target_parent = fc_target_parent; /* * Setup SCSI Target Attributes. diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h index 5f6187baad8..73c8a088c16 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h @@ -40,13 +40,15 @@ #define TX_NUM_FIFO 4 #define TX_BUF_SIZE 32 +#define SCC_WAIT_CLOSING 100 + struct uart_cpm_port { struct uart_port port; - u16 rx_nrfifos; + u16 rx_nrfifos; u16 rx_fifosize; - u16 tx_nrfifos; + u16 tx_nrfifos; u16 tx_fifosize; - smc_t *smcp; + smc_t *smcp; smc_uart_t *smcup; scc_t *sccp; scc_uart_t *sccup; @@ -67,6 +69,8 @@ struct uart_cpm_port { int bits; /* Keep track of 'odd' SMC2 wirings */ int is_portb; + /* wait on close if needed */ + int wait_closing; }; 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 29db677d428..d639ac92a11 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -9,9 +9,10 @@ * * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) - * + * * Copyright (C) 2004 Freescale Semiconductor, Inc. * (C) 2004 Intracom, S.A. + * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> * * This program is free software; you can redistribute it and/or modify * 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); /**************************************************************/ +static inline unsigned long cpu2cpm_addr(void *addr) +{ + if ((unsigned long)addr >= CPM_ADDR) + return (unsigned long)addr; + return virt_to_bus(addr); +} + +static inline void *cpm2cpu_addr(unsigned long addr) +{ + if (addr >= CPM_ADDR) + return (void *)addr; + return bus_to_virt(addr); +} + /* - * Check, if transmit buffers are processed + * Check, if transmit buffers are processed */ static unsigned int cpm_uart_tx_empty(struct uart_port *port) { @@ -143,15 +158,18 @@ static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start) } if (cpm_uart_tx_pump(port) != 0) { - if (IS_SMC(pinfo)) + if (IS_SMC(pinfo)) { smcp->smc_smcm |= SMCM_TX; - else + smcp->smc_smcmr |= SMCMR_TEN; + } else { sccp->scc_sccm |= UART_SCCM_TX; + pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT; + } } } /* - * Stop receiver + * Stop receiver */ static void cpm_uart_stop_rx(struct uart_port *port) { @@ -176,7 +194,7 @@ static void cpm_uart_enable_ms(struct uart_port *port) } /* - * Generate a break. + * Generate a break. */ static void cpm_uart_break_ctl(struct uart_port *port, int break_state) { @@ -231,7 +249,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) /* get number of characters, and check spce in flip-buffer */ i = bdp->cbd_datlen; - /* If we have not enough room in tty flip buffer, then we try + /* If we have not enough room in tty flip buffer, then we try * later, which will be the next rx-interrupt or a timeout */ 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) } /* get pointer */ - cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr); + cp = cpm2cpu_addr(bdp->cbd_bufaddr); /* loop through the buffer */ while (i-- > 0) { @@ -265,13 +283,14 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) } /* End while (i--) */ /* This BD is ready to be used again. Clear status. get next */ - bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); + bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); bdp->cbd_sc |= BD_SC_EMPTY; if (bdp->cbd_sc & BD_SC_WRAP) bdp = pinfo->rx_bd_base; else bdp++; + } /* End for (;;) */ /* Write back buffer pointer */ @@ -336,22 +355,22 @@ static irqreturn_t cpm_uart_int(int irq, void *data, struct pt_regs *regs) if (IS_SMC(pinfo)) { events = smcp->smc_smce; + smcp->smc_smce = events; if (events & SMCM_BRKE) uart_handle_break(port); if (events & SMCM_RX) cpm_uart_int_rx(port, regs); if (events & SMCM_TX) cpm_uart_int_tx(port, regs); - smcp->smc_smce = events; } else { events = sccp->scc_scce; + sccp->scc_scce = events; if (events & UART_SCCM_BRKE) uart_handle_break(port); if (events & UART_SCCM_RX) cpm_uart_int_rx(port, regs); if (events & UART_SCCM_TX) cpm_uart_int_tx(port, regs); - sccp->scc_scce = events; } return (events) ? IRQ_HANDLED : IRQ_NONE; } @@ -360,6 +379,7 @@ static int cpm_uart_startup(struct uart_port *port) { int retval; struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; + int line = pinfo - cpm_uart_ports; pr_debug("CPM uart[%d]:startup\n", port->line); @@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_port *port) pinfo->sccp->scc_sccm |= UART_SCCM_RX; } + if (!(pinfo->flags & FLAG_CONSOLE)) + cpm_line_cr_cmd(line,CPM_CR_INIT_TRX); return 0; } +inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) +{ + unsigned long target_jiffies = jiffies + pinfo->wait_closing; + + while (!time_after(jiffies, target_jiffies)) + schedule(); +} + /* * Shutdown the uart */ @@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uart_port *port) /* If the port is not the console, disable Rx and Tx. */ if (!(pinfo->flags & FLAG_CONSOLE)) { + /* Wait for all the BDs marked sent */ + while(!cpm_uart_tx_empty(port)) + schedule_timeout(2); + if(pinfo->wait_closing) + cpm_uart_wait_until_send(pinfo); + /* Stop uarts */ if (IS_SMC(pinfo)) { volatile smc_t *smcp = pinfo->smcp; @@ -502,7 +538,7 @@ static void cpm_uart_set_termios(struct uart_port *port, */ if ((termios->c_cflag & CREAD) == 0) port->read_status_mask &= ~BD_SC_EMPTY; - + spin_lock_irqsave(&port->lock, flags); /* 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) /* Pick next descriptor and fill from buffer */ bdp = pinfo->tx_cur; - p = bus_to_virt(bdp->cbd_bufaddr); + p = cpm2cpu_addr(bdp->cbd_bufaddr); + *p++ = xmit->buf[xmit->tail]; bdp->cbd_datlen = 1; bdp->cbd_sc |= BD_SC_READY; @@ -595,7 +632,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { count = 0; - p = bus_to_virt(bdp->cbd_bufaddr); + p = cpm2cpu_addr(bdp->cbd_bufaddr); while (count < pinfo->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); @@ -606,6 +643,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) } bdp->cbd_datlen = count; bdp->cbd_sc |= BD_SC_READY; + __asm__("eieio"); /* Get next BD. */ if (bdp->cbd_sc & BD_SC_WRAP) bdp = pinfo->tx_bd_base; @@ -643,12 +681,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) mem_addr = pinfo->mem_addr; bdp = pinfo->rx_cur = pinfo->rx_bd_base; for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { - bdp->cbd_bufaddr = virt_to_bus(mem_addr); + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; mem_addr += pinfo->rx_fifosize; } - - bdp->cbd_bufaddr = virt_to_bus(mem_addr); + + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; /* Set the physical address of the host memory @@ -658,12 +696,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); bdp = pinfo->tx_cur = pinfo->tx_bd_base; for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { - bdp->cbd_bufaddr = virt_to_bus(mem_addr); + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); bdp->cbd_sc = BD_SC_INTRPT; mem_addr += pinfo->tx_fifosize; } - - bdp->cbd_bufaddr = virt_to_bus(mem_addr); + + bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; } @@ -763,6 +801,8 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) /* Using idle charater time requires some additional tuning. */ up->smc_mrblr = pinfo->rx_fifosize; up->smc_maxidl = pinfo->rx_fifosize; + up->smc_brklen = 0; + up->smc_brkec = 0; up->smc_brkcr = 1; cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); @@ -796,7 +836,7 @@ static int cpm_uart_request_port(struct uart_port *port) /* * Setup any port IO, connect any baud rate generators, * etc. This is expected to be handled by board - * dependant code + * dependant code */ if (pinfo->set_lineif) pinfo->set_lineif(pinfo); @@ -815,6 +855,10 @@ static int cpm_uart_request_port(struct uart_port *port) return ret; cpm_uart_initbd(pinfo); + if (IS_SMC(pinfo)) + cpm_uart_init_smc(pinfo); + else + cpm_uart_init_scc(pinfo); return 0; } @@ -869,7 +913,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { .flags = FLAG_SMC, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = smc1_lineif, }, @@ -883,7 +927,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { .flags = FLAG_SMC, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = smc2_lineif, #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 @@ -899,9 +943,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { }, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = scc1_lineif, + .wait_closing = SCC_WAIT_CLOSING, }, [UART_SCC2] = { .port = { @@ -912,9 +957,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { }, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = scc2_lineif, + .wait_closing = SCC_WAIT_CLOSING, }, [UART_SCC3] = { .port = { @@ -925,9 +971,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { }, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = scc3_lineif, + .wait_closing = SCC_WAIT_CLOSING, }, [UART_SCC4] = { .port = { @@ -938,9 +985,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { }, .tx_nrfifos = TX_NUM_FIFO, .tx_fifosize = TX_BUF_SIZE, - .rx_nrfifos = RX_NUM_FIFO, + .rx_nrfifos = RX_NUM_FIFO, .rx_fifosize = RX_BUF_SIZE, .set_lineif = scc4_lineif, + .wait_closing = SCC_WAIT_CLOSING, }, }; @@ -983,11 +1031,8 @@ static void cpm_uart_console_write(struct console *co, const char *s, * If the buffer address is in the CPM DPRAM, don't * convert it. */ - if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) - cp = (unsigned char *) (bdp->cbd_bufaddr); - else - cp = bus_to_virt(bdp->cbd_bufaddr); - + cp = cpm2cpu_addr(bdp->cbd_bufaddr); + *cp = *s; bdp->cbd_datlen = 1; @@ -1003,10 +1048,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, while ((bdp->cbd_sc & BD_SC_READY) != 0) ; - if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) - cp = (unsigned char *) (bdp->cbd_bufaddr); - else - cp = bus_to_virt(bdp->cbd_bufaddr); + cp = cpm2cpu_addr(bdp->cbd_bufaddr); *cp = 13; bdp->cbd_datlen = 1; @@ -1045,7 +1087,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) port = (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; pinfo = (struct uart_cpm_port *)port; - + pinfo->flags |= FLAG_CONSOLE; if (options) { @@ -1062,7 +1104,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) /* * Setup any port IO, connect any baud rate generators, * etc. This is expected to be handled by board - * dependant code + * dependant code */ if (pinfo->set_lineif) pinfo->set_lineif(pinfo); @@ -1092,14 +1134,14 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) return 0; } -extern struct uart_driver cpm_reg; +static struct uart_driver cpm_reg; static struct console cpm_scc_uart_console = { - .name "ttyCPM", - .write cpm_uart_console_write, - .device uart_console_device, - .setup cpm_uart_console_setup, - .flags CON_PRINTBUFFER, - .index -1, + .name = "ttyCPM", + .write = cpm_uart_console_write, + .device = uart_console_device, + .setup = cpm_uart_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, .data = &cpm_reg, }; diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 8efbd6d1d6a..4b0786e7eb7 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c @@ -5,7 +5,7 @@ * * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) - * + * * Copyright (C) 2004 Freescale Semiconductor, Inc. * (C) 2004 Intracom, S.A. * @@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) void smc1_lineif(struct uart_cpm_port *pinfo) { volatile cpm8xx_t *cp = cpmp; + + (void)cp; /* fix warning */ +#if defined (CONFIG_MPC885ADS) + /* Enable SMC1 transceivers */ + { + cp->cp_pepar |= 0x000000c0; + cp->cp_pedir &= ~0x000000c0; + cp->cp_peso &= ~0x00000040; + cp->cp_peso |= 0x00000080; + } +#elif defined (CONFIG_MPC86XADS) unsigned int iobits = 0x000000c0; if (!pinfo->is_portb) { @@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; } - -#ifdef CONFIG_MPC885ADS - /* Enable SMC1 transceivers */ - { - volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4); - uint tmp; - - tmp = in_be32(bcsr1); - tmp &= ~BCSR1_RS232EN_1; - out_be32(bcsr1, tmp); - iounmap(bcsr1); - } #endif - pinfo->brg = 1; } void smc2_lineif(struct uart_cpm_port *pinfo) { -#ifdef CONFIG_MPC885ADS volatile cpm8xx_t *cp = cpmp; - volatile uint __iomem *bcsr1; - uint tmp; + (void)cp; /* fix warning */ +#if defined (CONFIG_MPC885ADS) cp->cp_pepar |= 0x00000c00; cp->cp_pedir &= ~0x00000c00; cp->cp_peso &= ~0x00000400; cp->cp_peso |= 0x00000800; +#elif defined (CONFIG_MPC86XADS) + unsigned int iobits = 0x00000c00; + + if (!pinfo->is_portb) { + cp->cp_pbpar |= iobits; + cp->cp_pbdir &= ~iobits; + cp->cp_pbodr &= ~iobits; + } else { + ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; + ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; + ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; + } - /* Enable SMC2 transceivers */ - bcsr1 = ioremap(BCSR1, 4); - tmp = in_be32(bcsr1); - tmp &= ~BCSR1_RS232EN_2; - out_be32(bcsr1, tmp); - iounmap(bcsr1); #endif pinfo->brg = 2; @@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) } /* - * Allocate DP-Ram and memory buffers. We need to allocate a transmit and + * Allocate DP-Ram and memory buffers. We need to allocate a transmit and * receive buffer descriptors from dual port ram, and a character * buffer area from host mem. If we are allocating for the console we need * to do it from bootmem @@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); if (is_con) { + /* was hostalloc but changed cause it blows away the */ + /* large tlb mapping when pinning the kernel area */ mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); dma_addr = 0; } else diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index 02412e31a46..3b266af3048 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) goto exit; } - x = le16_to_cpu(*(__le16 *) &data[2]); - y = le16_to_cpu(*(__le16 *) &data[4]); - input_regs(dev, regs); if (data[1] & 0x10) { /* in prox */ @@ -373,15 +370,17 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) } } - if (data[1] & 0x80) { + if (data[1] & 0x90) { + x = le16_to_cpu(*(__le16 *) &data[2]); + y = le16_to_cpu(*(__le16 *) &data[4]); input_report_abs(dev, ABS_X, x); input_report_abs(dev, ABS_Y, y); - } - if (wacom->tool[0] != BTN_TOOL_MOUSE) { - input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); - input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - input_report_key(dev, BTN_STYLUS, data[1] & 0x02); - input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); + if (wacom->tool[0] != BTN_TOOL_MOUSE) { + input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); + input_report_key(dev, BTN_TOUCH, data[1] & 0x01); + input_report_key(dev, BTN_STYLUS, data[1] & 0x02); + input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); + } } 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) /* Cintiq doesn't send data when RDY bit isn't set */ if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) - return; + goto exit; if (wacom->features->type >= INTUOS3) { 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 aa9d00808e4..508a21028db 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c @@ -2,6 +2,8 @@ * The USB Monitor, inspired by Dave Harding's USBMon. * * mon_main.c: Main file, module initiation and exit, registrations, etc. + * + * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) */ #include <linux/kernel.h> @@ -311,7 +313,7 @@ static int __init mon_init(void) mondir = debugfs_create_dir("usbmon", NULL); if (IS_ERR(mondir)) { - printk(KERN_NOTICE TAG ": debugs is not available\n"); + printk(KERN_NOTICE TAG ": debugfs is not available\n"); return -ENODEV; } if (mondir == NULL) { diff --git a/drivers/usb/mon/usb_mon.h b/drivers/usb/mon/usb_mon.h index ed35c18a5c4..9b06784d2c4 100644 --- a/drivers/usb/mon/usb_mon.h +++ b/drivers/usb/mon/usb_mon.h @@ -1,5 +1,7 @@ /* * The USB Monitor, inspired by Dave Harding's USBMon. + * + * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) */ #ifndef __USB_MON_H diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2e19f6dd72..4ff853fbe0b 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) int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) { - int err; + int err, flags = info->flags; if (var->activate & FB_ACTIVATE_INV_MODE) { struct fb_videomode mode1, mode2; @@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) !list_empty(&info->modelist)) err = fb_add_videomode(&mode, &info->modelist); - if (!err && info->flags & FBINFO_MISC_USEREVENT) { + if (!err && (flags & FBINFO_MISC_USEREVENT)) { struct fb_event event; info->flags &= ~FBINFO_MISC_USEREVENT; diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 298bc9cd99e..a112a178685 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) return -ENODEV; } - /* Map the fb and MMIO regions */ - dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache - (dinfo->aperture.physical, dinfo->aperture.size); - if (!dinfo->aperture.virtual) { - ERR_MSG("Cannot remap FB region.\n"); - cleanup(dinfo); - return -ENODEV; - } - dinfo->mmio_base = - (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, - INTEL_REG_SIZE); - if (!dinfo->mmio_base) { - ERR_MSG("Cannot remap MMIO region.\n"); - cleanup(dinfo); - return -ENODEV; - } - /* Get the chipset info. */ dinfo->pci_chipset = pdev->device; @@ -630,9 +613,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) dinfo->accel = 0; } + if (MB(voffset) < stolen_size) + offset = (stolen_size >> 12); + else + offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; + /* Framebuffer parameters - Use all the stolen memory if >= vram */ - if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { + if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); + dinfo->fb.offset = 0; dinfo->fbmem_gart = 0; } else { dinfo->fb.size = MB(vram); @@ -663,11 +652,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) return -ENODEV; } - if (MB(voffset) < stolen_size) - offset = (stolen_size >> 12); - else - offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; - /* set the mem offsets - set them after the already used pages */ if (dinfo->accel) { 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) + (dinfo->cursor.size >> 12); } + /* Map the fb and MMIO regions */ + /* ioremap only up to the end of used aperture */ + dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache + (dinfo->aperture.physical, (dinfo->fb.offset << 12) + + dinfo->fb.size); + if (!dinfo->aperture.virtual) { + ERR_MSG("Cannot remap FB region.\n"); + cleanup(dinfo); + return -ENODEV; + } + + dinfo->mmio_base = + (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, + INTEL_REG_SIZE); + if (!dinfo->mmio_base) { + ERR_MSG("Cannot remap MMIO region.\n"); + cleanup(dinfo); + return -ENODEV; + } + /* Allocate memories (which aren't stolen) */ if (dinfo->accel) { if (!(dinfo->gtt_ring_mem = diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 16e37a535d8..30112816420 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -717,6 +717,9 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); + /* enable LCD controller clock */ + pxa_set_cken(CKEN16_LCD, 1); + /* Sequence from 11.7.10 */ LCCR3 = fbi->reg_lccr3; LCCR2 = fbi->reg_lccr2; @@ -750,6 +753,9 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) schedule_timeout(20 * HZ / 1000); remove_wait_queue(&fbi->ctrlr_wait, &wait); + + /* disable LCD controller clock */ + pxa_set_cken(CKEN16_LCD, 0); } /* @@ -1299,8 +1305,6 @@ int __init pxafb_probe(struct device *dev) ret = -ENOMEM; goto failed; } - /* enable LCD controller clock */ - pxa_set_cken(CKEN16_LCD, 1); ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); if (ret) { diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 8a9c4282250..0bbf029b1ef 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) * Return 0 - device(s) present, 1 - no devices present. */ if (w1_reset_bus(dev)) { - dev_info(&dev->dev, "No devices present on the wire.\n"); + dev_dbg(&dev->dev, "No devices present on the wire.\n"); break; } |