diff options
35 files changed, 170 insertions, 131 deletions
diff --git a/Documentation/fb/imacfb.txt b/Documentation/fb/efifb.txt index 316ec9bb7de..a59916c29b3 100644 --- a/Documentation/fb/imacfb.txt +++ b/Documentation/fb/efifb.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | What is imacfb? | 2 | What is efifb? |
3 | =============== | 3 | =============== |
4 | 4 | ||
5 | This is a generic EFI platform driver for Intel based Apple computers. | 5 | This is a generic EFI platform driver for Intel based Apple computers. |
6 | Imacfb is only for EFI booted Intel Macs. | 6 | efifb is only for EFI booted Intel Macs. |
7 | 7 | ||
8 | Supported Hardware | 8 | Supported Hardware |
9 | ================== | 9 | ================== |
@@ -16,16 +16,16 @@ MacMini | |||
16 | How to use it? | 16 | How to use it? |
17 | ============== | 17 | ============== |
18 | 18 | ||
19 | Imacfb does not have any kind of autodetection of your machine. | 19 | efifb does not have any kind of autodetection of your machine. |
20 | You have to add the following kernel parameters in your elilo.conf: | 20 | You have to add the following kernel parameters in your elilo.conf: |
21 | Macbook : | 21 | Macbook : |
22 | video=imacfb:macbook | 22 | video=efifb:macbook |
23 | MacMini : | 23 | MacMini : |
24 | video=imacfb:mini | 24 | video=efifb:mini |
25 | Macbook Pro 15", iMac 17" : | 25 | Macbook Pro 15", iMac 17" : |
26 | video=imacfb:i17 | 26 | video=efifb:i17 |
27 | Macbook Pro 17", iMac 20" : | 27 | Macbook Pro 17", iMac 20" : |
28 | video=imacfb:i20 | 28 | video=efifb:i20 |
29 | 29 | ||
30 | -- | 30 | -- |
31 | Edgar Hucek <gimli@dark-green.com> | 31 | Edgar Hucek <gimli@dark-green.com> |
diff --git a/arch/frv/include/asm/segment.h b/arch/frv/include/asm/segment.h index e3616a6f941..a2320a4a004 100644 --- a/arch/frv/include/asm/segment.h +++ b/arch/frv/include/asm/segment.h | |||
@@ -21,12 +21,12 @@ typedef struct { | |||
21 | 21 | ||
22 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | 22 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) |
23 | 23 | ||
24 | #define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL) | ||
25 | |||
26 | #ifdef CONFIG_MMU | 24 | #ifdef CONFIG_MMU |
27 | #define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) | 25 | #define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) |
26 | #define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL) | ||
28 | #else | 27 | #else |
29 | #define USER_DS KERNEL_DS | 28 | #define USER_DS MAKE_MM_SEG(memory_end) |
29 | #define KERNEL_DS MAKE_MM_SEG(0xe0000000UL) | ||
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define get_ds() (KERNEL_DS) | 32 | #define get_ds() (KERNEL_DS) |
diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h index 53650c958f4..0b67ec5b441 100644 --- a/arch/frv/include/asm/uaccess.h +++ b/arch/frv/include/asm/uaccess.h | |||
@@ -27,8 +27,6 @@ | |||
27 | #define VERIFY_READ 0 | 27 | #define VERIFY_READ 0 |
28 | #define VERIFY_WRITE 1 | 28 | #define VERIFY_WRITE 1 |
29 | 29 | ||
30 | #define __addr_ok(addr) ((unsigned long)(addr) < get_addr_limit()) | ||
31 | |||
32 | /* | 30 | /* |
33 | * check that a range of addresses falls within the current address limit | 31 | * check that a range of addresses falls within the current address limit |
34 | */ | 32 | */ |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 9e3af307aae..eb5ff0531cf 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -3341,6 +3341,7 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id) | |||
3341 | printk(KERN_WARNING | 3341 | printk(KERN_WARNING |
3342 | "cciss: controller cciss%d failed, stopping.\n", | 3342 | "cciss: controller cciss%d failed, stopping.\n", |
3343 | h->ctlr); | 3343 | h->ctlr); |
3344 | spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); | ||
3344 | fail_all_cmds(h->ctlr); | 3345 | fail_all_cmds(h->ctlr); |
3345 | return IRQ_HANDLED; | 3346 | return IRQ_HANDLED; |
3346 | } | 3347 | } |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 6c32fbf0716..56b27671adc 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -2021,8 +2021,6 @@ static int __init rs_init(void) | |||
2021 | state->baud_base = amiga_colorclock; | 2021 | state->baud_base = amiga_colorclock; |
2022 | state->xmit_fifo_size = 1; | 2022 | state->xmit_fifo_size = 1; |
2023 | 2023 | ||
2024 | local_irq_save(flags); | ||
2025 | |||
2026 | /* set ISRs, and then disable the rx interrupts */ | 2024 | /* set ISRs, and then disable the rx interrupts */ |
2027 | error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); | 2025 | error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); |
2028 | if (error) | 2026 | if (error) |
@@ -2033,6 +2031,8 @@ static int __init rs_init(void) | |||
2033 | if (error) | 2031 | if (error) |
2034 | goto fail_free_irq; | 2032 | goto fail_free_irq; |
2035 | 2033 | ||
2034 | local_irq_save(flags); | ||
2035 | |||
2036 | /* turn off Rx and Tx interrupts */ | 2036 | /* turn off Rx and Tx interrupts */ |
2037 | custom.intena = IF_RBF | IF_TBE; | 2037 | custom.intena = IF_RBF | IF_TBE; |
2038 | mb(); | 2038 | mb(); |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 1f3215ac085..f54dab8acdc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -225,6 +225,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file, | |||
225 | * outside of main memory. | 225 | * outside of main memory. |
226 | * | 226 | * |
227 | */ | 227 | */ |
228 | #ifdef pgprot_noncached | ||
228 | static int uncached_access(struct file *file, unsigned long addr) | 229 | static int uncached_access(struct file *file, unsigned long addr) |
229 | { | 230 | { |
230 | #if defined(CONFIG_IA64) | 231 | #if defined(CONFIG_IA64) |
@@ -251,6 +252,7 @@ static int uncached_access(struct file *file, unsigned long addr) | |||
251 | return addr >= __pa(high_memory); | 252 | return addr >= __pa(high_memory); |
252 | #endif | 253 | #endif |
253 | } | 254 | } |
255 | #endif | ||
254 | 256 | ||
255 | static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 257 | static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
256 | unsigned long size, pgprot_t vma_prot) | 258 | unsigned long size, pgprot_t vma_prot) |
@@ -710,11 +712,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig) | |||
710 | switch (orig) { | 712 | switch (orig) { |
711 | case SEEK_CUR: | 713 | case SEEK_CUR: |
712 | offset += file->f_pos; | 714 | offset += file->f_pos; |
713 | if ((unsigned long long)offset < | ||
714 | (unsigned long long)file->f_pos) { | ||
715 | ret = -EOVERFLOW; | ||
716 | break; | ||
717 | } | ||
718 | case SEEK_SET: | 715 | case SEEK_SET: |
719 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ | 716 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ |
720 | if ((unsigned long long)offset >= ~0xFFFULL) { | 717 | if ((unsigned long long)offset >= ~0xFFFULL) { |
@@ -908,6 +905,9 @@ static int __init chr_dev_init(void) | |||
908 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); | 905 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); |
909 | 906 | ||
910 | mem_class = class_create(THIS_MODULE, "mem"); | 907 | mem_class = class_create(THIS_MODULE, "mem"); |
908 | if (IS_ERR(mem_class)) | ||
909 | return PTR_ERR(mem_class); | ||
910 | |||
911 | mem_class->devnode = mem_devnode; | 911 | mem_class->devnode = mem_devnode; |
912 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { | 912 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { |
913 | if (!devlist[minor].name) | 913 | if (!devlist[minor].name) |
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 95c9f54f3d3..47023053ee8 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -1768,7 +1768,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, | |||
1768 | int len, lsr; | 1768 | int len, lsr; |
1769 | 1769 | ||
1770 | len = mxser_chars_in_buffer(tty); | 1770 | len = mxser_chars_in_buffer(tty); |
1771 | spin_lock(&info->slock); | 1771 | spin_lock_irq(&info->slock); |
1772 | lsr = inb(info->ioaddr + UART_LSR) & UART_LSR_THRE; | 1772 | lsr = inb(info->ioaddr + UART_LSR) & UART_LSR_THRE; |
1773 | spin_unlock_irq(&info->slock); | 1773 | spin_unlock_irq(&info->slock); |
1774 | len += (lsr ? 0 : 1); | 1774 | len += (lsr ? 0 : 1); |
@@ -1778,12 +1778,12 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, | |||
1778 | case MOXA_ASPP_MON: { | 1778 | case MOXA_ASPP_MON: { |
1779 | int mcr, status; | 1779 | int mcr, status; |
1780 | 1780 | ||
1781 | spin_lock(&info->slock); | 1781 | spin_lock_irq(&info->slock); |
1782 | status = mxser_get_msr(info->ioaddr, 1, tty->index); | 1782 | status = mxser_get_msr(info->ioaddr, 1, tty->index); |
1783 | mxser_check_modem_status(tty, info, status); | 1783 | mxser_check_modem_status(tty, info, status); |
1784 | 1784 | ||
1785 | mcr = inb(info->ioaddr + UART_MCR); | 1785 | mcr = inb(info->ioaddr + UART_MCR); |
1786 | spin_unlock(&info->slock); | 1786 | spin_unlock_irq(&info->slock); |
1787 | 1787 | ||
1788 | if (mcr & MOXA_MUST_MCR_XON_FLAG) | 1788 | if (mcr & MOXA_MUST_MCR_XON_FLAG) |
1789 | info->mon_data.hold_reason &= ~NPPI_NOTIFY_XOFFHOLD; | 1789 | info->mon_data.hold_reason &= ~NPPI_NOTIFY_XOFFHOLD; |
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index d331c59b571..8756ab0daa8 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -248,6 +248,7 @@ static const struct file_operations raw_fops = { | |||
248 | .aio_read = generic_file_aio_read, | 248 | .aio_read = generic_file_aio_read, |
249 | .write = do_sync_write, | 249 | .write = do_sync_write, |
250 | .aio_write = blkdev_aio_write, | 250 | .aio_write = blkdev_aio_write, |
251 | .fsync = blkdev_fsync, | ||
251 | .open = raw_open, | 252 | .open = raw_open, |
252 | .release= raw_release, | 253 | .release= raw_release, |
253 | .ioctl = raw_ioctl, | 254 | .ioctl = raw_ioctl, |
diff --git a/drivers/gpio/timbgpio.c b/drivers/gpio/timbgpio.c index ac4d0f0ea02..ddd053108a1 100644 --- a/drivers/gpio/timbgpio.c +++ b/drivers/gpio/timbgpio.c | |||
@@ -131,6 +131,7 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger) | |||
131 | unsigned long flags; | 131 | unsigned long flags; |
132 | u32 lvr, flr, bflr = 0; | 132 | u32 lvr, flr, bflr = 0; |
133 | u32 ver; | 133 | u32 ver; |
134 | int ret = 0; | ||
134 | 135 | ||
135 | if (offset < 0 || offset > tgpio->gpio.ngpio) | 136 | if (offset < 0 || offset > tgpio->gpio.ngpio) |
136 | return -EINVAL; | 137 | return -EINVAL; |
@@ -154,8 +155,10 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger) | |||
154 | } | 155 | } |
155 | 156 | ||
156 | if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { | 157 | if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { |
157 | if (ver < 3) | 158 | if (ver < 3) { |
158 | return -EINVAL; | 159 | ret = -EINVAL; |
160 | goto out; | ||
161 | } | ||
159 | else { | 162 | else { |
160 | flr |= 1 << offset; | 163 | flr |= 1 << offset; |
161 | bflr |= 1 << offset; | 164 | bflr |= 1 << offset; |
@@ -175,9 +178,10 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger) | |||
175 | iowrite32(bflr, tgpio->membase + TGPIO_BFLR); | 178 | iowrite32(bflr, tgpio->membase + TGPIO_BFLR); |
176 | 179 | ||
177 | iowrite32(1 << offset, tgpio->membase + TGPIO_ICR); | 180 | iowrite32(1 << offset, tgpio->membase + TGPIO_ICR); |
178 | spin_unlock_irqrestore(&tgpio->lock, flags); | ||
179 | 181 | ||
180 | return 0; | 182 | out: |
183 | spin_unlock_irqrestore(&tgpio->lock, flags); | ||
184 | return ret; | ||
181 | } | 185 | } |
182 | 186 | ||
183 | static void timbgpio_irq(unsigned int irq, struct irq_desc *desc) | 187 | static void timbgpio_irq(unsigned int irq, struct irq_desc *desc) |
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index c092354591b..ce8897933a8 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c | |||
@@ -210,6 +210,7 @@ int wf_register_control(struct wf_control *new_ct) | |||
210 | kref_init(&new_ct->ref); | 210 | kref_init(&new_ct->ref); |
211 | list_add(&new_ct->link, &wf_controls); | 211 | list_add(&new_ct->link, &wf_controls); |
212 | 212 | ||
213 | sysfs_attr_init(&new_ct->attr.attr); | ||
213 | new_ct->attr.attr.name = new_ct->name; | 214 | new_ct->attr.attr.name = new_ct->name; |
214 | new_ct->attr.attr.mode = 0644; | 215 | new_ct->attr.attr.mode = 0644; |
215 | new_ct->attr.show = wf_show_control; | 216 | new_ct->attr.show = wf_show_control; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 6c23456e0bd..71f50565f63 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -423,10 +423,12 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) | |||
423 | 423 | ||
424 | dip = kzalloc(sizeof(*dip),GFP_KERNEL); | 424 | dip = kzalloc(sizeof(*dip),GFP_KERNEL); |
425 | if (!dip) return; | 425 | if (!dip) return; |
426 | sysfs_attr_init(&dip->attr_debugcmd.attr); | ||
426 | dip->attr_debugcmd.attr.name = "debugcmd"; | 427 | dip->attr_debugcmd.attr.name = "debugcmd"; |
427 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; | 428 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; |
428 | dip->attr_debugcmd.show = debugcmd_show; | 429 | dip->attr_debugcmd.show = debugcmd_show; |
429 | dip->attr_debugcmd.store = debugcmd_store; | 430 | dip->attr_debugcmd.store = debugcmd_store; |
431 | sysfs_attr_init(&dip->attr_debuginfo.attr); | ||
430 | dip->attr_debuginfo.attr.name = "debuginfo"; | 432 | dip->attr_debuginfo.attr.name = "debuginfo"; |
431 | dip->attr_debuginfo.attr.mode = S_IRUGO; | 433 | dip->attr_debuginfo.attr.mode = S_IRUGO; |
432 | dip->attr_debuginfo.show = debuginfo_show; | 434 | dip->attr_debuginfo.show = debuginfo_show; |
@@ -644,6 +646,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
644 | return; | 646 | return; |
645 | } | 647 | } |
646 | 648 | ||
649 | sysfs_attr_init(&sfp->attr_v4l_minor_number.attr); | ||
647 | sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; | 650 | sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; |
648 | sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; | 651 | sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; |
649 | sfp->attr_v4l_minor_number.show = v4l_minor_number_show; | 652 | sfp->attr_v4l_minor_number.show = v4l_minor_number_show; |
@@ -658,6 +661,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
658 | sfp->v4l_minor_number_created_ok = !0; | 661 | sfp->v4l_minor_number_created_ok = !0; |
659 | } | 662 | } |
660 | 663 | ||
664 | sysfs_attr_init(&sfp->attr_v4l_radio_minor_number.attr); | ||
661 | sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number"; | 665 | sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number"; |
662 | sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO; | 666 | sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO; |
663 | sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show; | 667 | sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show; |
@@ -672,6 +676,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
672 | sfp->v4l_radio_minor_number_created_ok = !0; | 676 | sfp->v4l_radio_minor_number_created_ok = !0; |
673 | } | 677 | } |
674 | 678 | ||
679 | sysfs_attr_init(&sfp->attr_unit_number.attr); | ||
675 | sfp->attr_unit_number.attr.name = "unit_number"; | 680 | sfp->attr_unit_number.attr.name = "unit_number"; |
676 | sfp->attr_unit_number.attr.mode = S_IRUGO; | 681 | sfp->attr_unit_number.attr.mode = S_IRUGO; |
677 | sfp->attr_unit_number.show = unit_number_show; | 682 | sfp->attr_unit_number.show = unit_number_show; |
@@ -685,6 +690,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
685 | sfp->unit_number_created_ok = !0; | 690 | sfp->unit_number_created_ok = !0; |
686 | } | 691 | } |
687 | 692 | ||
693 | sysfs_attr_init(&sfp->attr_bus_info.attr); | ||
688 | sfp->attr_bus_info.attr.name = "bus_info_str"; | 694 | sfp->attr_bus_info.attr.name = "bus_info_str"; |
689 | sfp->attr_bus_info.attr.mode = S_IRUGO; | 695 | sfp->attr_bus_info.attr.mode = S_IRUGO; |
690 | sfp->attr_bus_info.show = bus_info_show; | 696 | sfp->attr_bus_info.show = bus_info_show; |
@@ -699,6 +705,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
699 | sfp->bus_info_created_ok = !0; | 705 | sfp->bus_info_created_ok = !0; |
700 | } | 706 | } |
701 | 707 | ||
708 | sysfs_attr_init(&sfp->attr_hdw_name.attr); | ||
702 | sfp->attr_hdw_name.attr.name = "device_hardware_type"; | 709 | sfp->attr_hdw_name.attr.name = "device_hardware_type"; |
703 | sfp->attr_hdw_name.attr.mode = S_IRUGO; | 710 | sfp->attr_hdw_name.attr.mode = S_IRUGO; |
704 | sfp->attr_hdw_name.show = hdw_name_show; | 711 | sfp->attr_hdw_name.show = hdw_name_show; |
@@ -713,6 +720,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
713 | sfp->hdw_name_created_ok = !0; | 720 | sfp->hdw_name_created_ok = !0; |
714 | } | 721 | } |
715 | 722 | ||
723 | sysfs_attr_init(&sfp->attr_hdw_desc.attr); | ||
716 | sfp->attr_hdw_desc.attr.name = "device_hardware_description"; | 724 | sfp->attr_hdw_desc.attr.name = "device_hardware_description"; |
717 | sfp->attr_hdw_desc.attr.mode = S_IRUGO; | 725 | sfp->attr_hdw_desc.attr.mode = S_IRUGO; |
718 | sfp->attr_hdw_desc.show = hdw_desc_show; | 726 | sfp->attr_hdw_desc.show = hdw_desc_show; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0affadca..e9caf694c59 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -1179,15 +1179,10 @@ static void omap_hsmmc_detect(struct work_struct *work) | |||
1179 | carddetect = -ENOSYS; | 1179 | carddetect = -ENOSYS; |
1180 | } | 1180 | } |
1181 | 1181 | ||
1182 | if (carddetect) { | 1182 | if (carddetect) |
1183 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); | 1183 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); |
1184 | } else { | 1184 | else |
1185 | mmc_host_enable(host->mmc); | ||
1186 | omap_hsmmc_reset_controller_fsm(host, SRD); | ||
1187 | mmc_host_lazy_disable(host->mmc); | ||
1188 | |||
1189 | mmc_detect_change(host->mmc, (HZ * 50) / 1000); | 1185 | mmc_detect_change(host->mmc, (HZ * 50) / 1000); |
1190 | } | ||
1191 | } | 1186 | } |
1192 | 1187 | ||
1193 | /* | 1188 | /* |
diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c index 1190bad4297..2f795ce2b93 100644 --- a/drivers/platform/x86/intel_menlow.c +++ b/drivers/platform/x86/intel_menlow.c | |||
@@ -397,6 +397,7 @@ static int intel_menlow_add_one_attribute(char *name, int mode, void *show, | |||
397 | if (!attr) | 397 | if (!attr) |
398 | return -ENOMEM; | 398 | return -ENOMEM; |
399 | 399 | ||
400 | sysfs_attr_init(&attr->attr.attr); /* That is consistent naming :D */ | ||
400 | attr->attr.attr.name = name; | 401 | attr->attr.attr.name = name; |
401 | attr->attr.attr.mode = mode; | 402 | attr->attr.attr.mode = mode; |
402 | attr->attr.show = show; | 403 | attr->attr.show = show; |
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index c77f6f72f95..d71fe61db1d 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -384,21 +384,26 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
384 | struct rtc_device *rtc; | 384 | struct rtc_device *rtc; |
385 | struct rtc_plat_data *pdata = NULL; | 385 | struct rtc_plat_data *pdata = NULL; |
386 | u32 reg; | 386 | u32 reg; |
387 | int ret, rate; | 387 | unsigned long rate; |
388 | int ret; | ||
388 | 389 | ||
389 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 390 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
390 | if (!res) | 391 | if (!res) |
391 | return -ENODEV; | 392 | return -ENODEV; |
392 | 393 | ||
393 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); | 394 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
394 | if (!pdata) | 395 | if (!pdata) |
395 | return -ENOMEM; | 396 | return -ENOMEM; |
396 | 397 | ||
397 | pdata->ioaddr = ioremap(res->start, resource_size(res)); | 398 | if (!devm_request_mem_region(&pdev->dev, res->start, |
399 | resource_size(res), pdev->name)) | ||
400 | return -EBUSY; | ||
401 | |||
402 | pdata->ioaddr = devm_ioremap(&pdev->dev, res->start, | ||
403 | resource_size(res)); | ||
398 | 404 | ||
399 | clk = clk_get(&pdev->dev, "ckil"); | 405 | clk = clk_get(&pdev->dev, "ckil"); |
400 | if (IS_ERR(clk)) { | 406 | if (IS_ERR(clk)) { |
401 | iounmap(pdata->ioaddr); | ||
402 | ret = PTR_ERR(clk); | 407 | ret = PTR_ERR(clk); |
403 | goto exit_free_pdata; | 408 | goto exit_free_pdata; |
404 | } | 409 | } |
@@ -413,8 +418,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
413 | else if (rate == 38400) | 418 | else if (rate == 38400) |
414 | reg = RTC_INPUT_CLK_38400HZ; | 419 | reg = RTC_INPUT_CLK_38400HZ; |
415 | else { | 420 | else { |
416 | dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n", | 421 | dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n", rate); |
417 | clk_get_rate(clk)); | ||
418 | ret = -EINVAL; | 422 | ret = -EINVAL; |
419 | goto exit_free_pdata; | 423 | goto exit_free_pdata; |
420 | } | 424 | } |
@@ -450,8 +454,8 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
450 | pdata->irq = platform_get_irq(pdev, 0); | 454 | pdata->irq = platform_get_irq(pdev, 0); |
451 | 455 | ||
452 | if (pdata->irq >= 0 && | 456 | if (pdata->irq >= 0 && |
453 | request_irq(pdata->irq, mxc_rtc_interrupt, IRQF_SHARED, | 457 | devm_request_irq(&pdev->dev, pdata->irq, mxc_rtc_interrupt, |
454 | pdev->name, pdev) < 0) { | 458 | IRQF_SHARED, pdev->name, pdev) < 0) { |
455 | dev_warn(&pdev->dev, "interrupt not available.\n"); | 459 | dev_warn(&pdev->dev, "interrupt not available.\n"); |
456 | pdata->irq = -1; | 460 | pdata->irq = -1; |
457 | } | 461 | } |
@@ -459,10 +463,10 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
459 | return 0; | 463 | return 0; |
460 | 464 | ||
461 | exit_put_clk: | 465 | exit_put_clk: |
466 | clk_disable(pdata->clk); | ||
462 | clk_put(pdata->clk); | 467 | clk_put(pdata->clk); |
463 | 468 | ||
464 | exit_free_pdata: | 469 | exit_free_pdata: |
465 | kfree(pdata); | ||
466 | 470 | ||
467 | return ret; | 471 | return ret; |
468 | } | 472 | } |
@@ -473,12 +477,8 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev) | |||
473 | 477 | ||
474 | rtc_device_unregister(pdata->rtc); | 478 | rtc_device_unregister(pdata->rtc); |
475 | 479 | ||
476 | if (pdata->irq >= 0) | ||
477 | free_irq(pdata->irq, pdev); | ||
478 | |||
479 | clk_disable(pdata->clk); | 480 | clk_disable(pdata->clk); |
480 | clk_put(pdata->clk); | 481 | clk_put(pdata->clk); |
481 | kfree(pdata); | ||
482 | platform_set_drvdata(pdev, NULL); | 482 | platform_set_drvdata(pdev, NULL); |
483 | 483 | ||
484 | return 0; | 484 | return 0; |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 9b6297f07b8..13c72c62932 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -506,6 +506,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
506 | tz->temp_input.attr.attr.name = tz->temp_input.name; | 506 | tz->temp_input.attr.attr.name = tz->temp_input.name; |
507 | tz->temp_input.attr.attr.mode = 0444; | 507 | tz->temp_input.attr.attr.mode = 0444; |
508 | tz->temp_input.attr.show = temp_input_show; | 508 | tz->temp_input.attr.show = temp_input_show; |
509 | sysfs_attr_init(&tz->temp_input.attr.attr); | ||
509 | result = device_create_file(hwmon->device, &tz->temp_input.attr); | 510 | result = device_create_file(hwmon->device, &tz->temp_input.attr); |
510 | if (result) | 511 | if (result) |
511 | goto unregister_hwmon_device; | 512 | goto unregister_hwmon_device; |
@@ -518,6 +519,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
518 | tz->temp_crit.attr.attr.name = tz->temp_crit.name; | 519 | tz->temp_crit.attr.attr.name = tz->temp_crit.name; |
519 | tz->temp_crit.attr.attr.mode = 0444; | 520 | tz->temp_crit.attr.attr.mode = 0444; |
520 | tz->temp_crit.attr.show = temp_crit_show; | 521 | tz->temp_crit.attr.show = temp_crit_show; |
522 | sysfs_attr_init(&tz->temp_crit.attr.attr); | ||
521 | result = device_create_file(hwmon->device, | 523 | result = device_create_file(hwmon->device, |
522 | &tz->temp_crit.attr); | 524 | &tz->temp_crit.attr); |
523 | if (result) | 525 | if (result) |
@@ -726,6 +728,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, | |||
726 | goto release_idr; | 728 | goto release_idr; |
727 | 729 | ||
728 | sprintf(dev->attr_name, "cdev%d_trip_point", dev->id); | 730 | sprintf(dev->attr_name, "cdev%d_trip_point", dev->id); |
731 | sysfs_attr_init(&dev->attr.attr); | ||
729 | dev->attr.attr.name = dev->attr_name; | 732 | dev->attr.attr.name = dev->attr_name; |
730 | dev->attr.attr.mode = 0444; | 733 | dev->attr.attr.mode = 0444; |
731 | dev->attr.show = thermal_cooling_device_trip_point_show; | 734 | dev->attr.show = thermal_cooling_device_trip_point_show; |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 4637bcbe03a..994358a4f30 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -1536,6 +1536,7 @@ static int __devinit fsl_diu_probe(struct of_device *ofdev, | |||
1536 | goto error; | 1536 | goto error; |
1537 | } | 1537 | } |
1538 | 1538 | ||
1539 | sysfs_attr_init(&machine_data->dev_attr.attr); | ||
1539 | machine_data->dev_attr.attr.name = "monitor"; | 1540 | machine_data->dev_attr.attr.name = "monitor"; |
1540 | machine_data->dev_attr.attr.mode = S_IRUGO|S_IWUSR; | 1541 | machine_data->dev_attr.attr.mode = S_IRUGO|S_IWUSR; |
1541 | machine_data->dev_attr.show = show_monitor; | 1542 | machine_data->dev_attr.show = show_monitor; |
diff --git a/drivers/video/mb862xx/mb862xxfb_accel.c b/drivers/video/mb862xx/mb862xxfb_accel.c index 841424912ec..fe92eed6da7 100644 --- a/drivers/video/mb862xx/mb862xxfb_accel.c +++ b/drivers/video/mb862xx/mb862xxfb_accel.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Fujitsu Carmine/Coral-P(A)/Lime framebuffer driver acceleration support | 4 | * Fujitsu Carmine/Coral-P(A)/Lime framebuffer driver acceleration support |
5 | * | 5 | * |
6 | * (C) 2007 Alexander Shishkin <virtuoso@slind.org> | 6 | * (C) 2007 Alexander Shishkin <virtuoso@slind.org> |
7 | * (C) 2009 Valentin Sitdikov <valentin.sitdikov@siemens.com> | 7 | * (C) 2009 Valentin Sitdikov <v.sitdikov@gmail.com> |
8 | * (C) 2009 Siemens AG | 8 | * (C) 2009 Siemens AG |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/module.h> | ||
19 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
20 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
21 | #if defined(CONFIG_OF) | 22 | #if defined(CONFIG_OF) |
@@ -330,3 +331,5 @@ void mb862xxfb_init_accel(struct fb_info *info, int xres) | |||
330 | info->fix.accel = 0xff; /*FIXME: add right define */ | 331 | info->fix.accel = 0xff; /*FIXME: add right define */ |
331 | } | 332 | } |
332 | EXPORT_SYMBOL(mb862xxfb_init_accel); | 333 | EXPORT_SYMBOL(mb862xxfb_init_accel); |
334 | |||
335 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index 54ac91dc070..0cadf7aee27 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
@@ -225,7 +225,7 @@ static int __init vesafb_setup(char *options) | |||
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |
227 | 227 | ||
228 | static int __devinit vesafb_probe(struct platform_device *dev) | 228 | static int __init vesafb_probe(struct platform_device *dev) |
229 | { | 229 | { |
230 | struct fb_info *info; | 230 | struct fb_info *info; |
231 | int i, err; | 231 | int i, err; |
@@ -476,7 +476,6 @@ err: | |||
476 | } | 476 | } |
477 | 477 | ||
478 | static struct platform_driver vesafb_driver = { | 478 | static struct platform_driver vesafb_driver = { |
479 | .probe = vesafb_probe, | ||
480 | .driver = { | 479 | .driver = { |
481 | .name = "vesafb", | 480 | .name = "vesafb", |
482 | }, | 481 | }, |
@@ -492,20 +491,21 @@ static int __init vesafb_init(void) | |||
492 | /* ignore error return of fb_get_options */ | 491 | /* ignore error return of fb_get_options */ |
493 | fb_get_options("vesafb", &option); | 492 | fb_get_options("vesafb", &option); |
494 | vesafb_setup(option); | 493 | vesafb_setup(option); |
495 | ret = platform_driver_register(&vesafb_driver); | ||
496 | 494 | ||
497 | if (!ret) { | 495 | vesafb_device = platform_device_alloc("vesafb", 0); |
498 | vesafb_device = platform_device_alloc("vesafb", 0); | 496 | if (!vesafb_device) |
497 | return -ENOMEM; | ||
499 | 498 | ||
500 | if (vesafb_device) | 499 | ret = platform_device_add(vesafb_device); |
501 | ret = platform_device_add(vesafb_device); | 500 | if (!ret) { |
502 | else | 501 | ret = platform_driver_probe(&vesafb_driver, vesafb_probe); |
503 | ret = -ENOMEM; | 502 | if (ret) |
503 | platform_device_del(vesafb_device); | ||
504 | } | ||
504 | 505 | ||
505 | if (ret) { | 506 | if (ret) { |
506 | platform_device_put(vesafb_device); | 507 | platform_device_put(vesafb_device); |
507 | platform_driver_unregister(&vesafb_driver); | 508 | vesafb_device = NULL; |
508 | } | ||
509 | } | 509 | } |
510 | 510 | ||
511 | return ret; | 511 | return ret; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index d11d0289f3d..2a6d0193f13 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -404,7 +404,7 @@ static loff_t block_llseek(struct file *file, loff_t offset, int origin) | |||
404 | * NULL first argument is nfsd_sync_dir() and that's not a directory. | 404 | * NULL first argument is nfsd_sync_dir() and that's not a directory. |
405 | */ | 405 | */ |
406 | 406 | ||
407 | static int block_fsync(struct file *filp, struct dentry *dentry, int datasync) | 407 | int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync) |
408 | { | 408 | { |
409 | struct block_device *bdev = I_BDEV(filp->f_mapping->host); | 409 | struct block_device *bdev = I_BDEV(filp->f_mapping->host); |
410 | int error; | 410 | int error; |
@@ -418,6 +418,7 @@ static int block_fsync(struct file *filp, struct dentry *dentry, int datasync) | |||
418 | error = 0; | 418 | error = 0; |
419 | return error; | 419 | return error; |
420 | } | 420 | } |
421 | EXPORT_SYMBOL(blkdev_fsync); | ||
421 | 422 | ||
422 | /* | 423 | /* |
423 | * pseudo-fs | 424 | * pseudo-fs |
@@ -1481,7 +1482,7 @@ const struct file_operations def_blk_fops = { | |||
1481 | .aio_read = generic_file_aio_read, | 1482 | .aio_read = generic_file_aio_read, |
1482 | .aio_write = blkdev_aio_write, | 1483 | .aio_write = blkdev_aio_write, |
1483 | .mmap = generic_file_mmap, | 1484 | .mmap = generic_file_mmap, |
1484 | .fsync = block_fsync, | 1485 | .fsync = blkdev_fsync, |
1485 | .unlocked_ioctl = block_ioctl, | 1486 | .unlocked_ioctl = block_ioctl, |
1486 | #ifdef CONFIG_COMPAT | 1487 | #ifdef CONFIG_COMPAT |
1487 | .compat_ioctl = compat_blkdev_ioctl, | 1488 | .compat_ioctl = compat_blkdev_ioctl, |
diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c index 46435f3aae6..4765190d537 100644 --- a/fs/fscache/stats.c +++ b/fs/fscache/stats.c | |||
@@ -165,8 +165,8 @@ static int fscache_stats_show(struct seq_file *m, void *v) | |||
165 | atomic_read(&fscache_n_object_lookups), | 165 | atomic_read(&fscache_n_object_lookups), |
166 | atomic_read(&fscache_n_object_lookups_negative), | 166 | atomic_read(&fscache_n_object_lookups_negative), |
167 | atomic_read(&fscache_n_object_lookups_positive), | 167 | atomic_read(&fscache_n_object_lookups_positive), |
168 | atomic_read(&fscache_n_object_lookups_timed_out), | 168 | atomic_read(&fscache_n_object_created), |
169 | atomic_read(&fscache_n_object_created)); | 169 | atomic_read(&fscache_n_object_lookups_timed_out)); |
170 | 170 | ||
171 | seq_printf(m, "Updates: n=%u nul=%u run=%u\n", | 171 | seq_printf(m, "Updates: n=%u nul=%u run=%u\n", |
172 | atomic_read(&fscache_n_updates), | 172 | atomic_read(&fscache_n_updates), |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index a05a669510a..070553427dd 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -662,31 +662,18 @@ static u64 huge_pte_to_pagemap_entry(pte_t pte, int offset) | |||
662 | return pme; | 662 | return pme; |
663 | } | 663 | } |
664 | 664 | ||
665 | static int pagemap_hugetlb_range(pte_t *pte, unsigned long addr, | 665 | /* This function walks within one hugetlb entry in the single call */ |
666 | unsigned long end, struct mm_walk *walk) | 666 | static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, |
667 | unsigned long addr, unsigned long end, | ||
668 | struct mm_walk *walk) | ||
667 | { | 669 | { |
668 | struct vm_area_struct *vma; | ||
669 | struct pagemapread *pm = walk->private; | 670 | struct pagemapread *pm = walk->private; |
670 | struct hstate *hs = NULL; | ||
671 | int err = 0; | 671 | int err = 0; |
672 | u64 pfn; | ||
672 | 673 | ||
673 | vma = find_vma(walk->mm, addr); | ||
674 | if (vma) | ||
675 | hs = hstate_vma(vma); | ||
676 | for (; addr != end; addr += PAGE_SIZE) { | 674 | for (; addr != end; addr += PAGE_SIZE) { |
677 | u64 pfn = PM_NOT_PRESENT; | 675 | int offset = (addr & ~hmask) >> PAGE_SHIFT; |
678 | 676 | pfn = huge_pte_to_pagemap_entry(*pte, offset); | |
679 | if (vma && (addr >= vma->vm_end)) { | ||
680 | vma = find_vma(walk->mm, addr); | ||
681 | if (vma) | ||
682 | hs = hstate_vma(vma); | ||
683 | } | ||
684 | |||
685 | if (vma && (vma->vm_start <= addr) && is_vm_hugetlb_page(vma)) { | ||
686 | /* calculate pfn of the "raw" page in the hugepage. */ | ||
687 | int offset = (addr & ~huge_page_mask(hs)) >> PAGE_SHIFT; | ||
688 | pfn = huge_pte_to_pagemap_entry(*pte, offset); | ||
689 | } | ||
690 | err = add_to_pagemap(addr, pfn, pm); | 677 | err = add_to_pagemap(addr, pfn, pm); |
691 | if (err) | 678 | if (err) |
692 | return err; | 679 | return err; |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index b7938987923..b796eab5ca7 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -21,9 +21,6 @@ | |||
21 | (bit) < (size); \ | 21 | (bit) < (size); \ |
22 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | 22 | (bit) = find_next_bit((addr), (size), (bit) + 1)) |
23 | 23 | ||
24 | /* Temporary */ | ||
25 | #define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size) | ||
26 | |||
27 | static __inline__ int get_bitmask_order(unsigned int count) | 24 | static __inline__ int get_bitmask_order(unsigned int count) |
28 | { | 25 | { |
29 | int order; | 26 | int order; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 10b8dedcd18..39d57bc6cc7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2212,6 +2212,7 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
2212 | /* fs/block_dev.c */ | 2212 | /* fs/block_dev.c */ |
2213 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2213 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
2214 | unsigned long nr_segs, loff_t pos); | 2214 | unsigned long nr_segs, loff_t pos); |
2215 | extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); | ||
2215 | 2216 | ||
2216 | /* fs/splice.c */ | 2217 | /* fs/splice.c */ |
2217 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2218 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7f070746336..9365227dbaf 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -426,7 +426,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
426 | .burst = DEFAULT_RATELIMIT_BURST, \ | 426 | .burst = DEFAULT_RATELIMIT_BURST, \ |
427 | }; \ | 427 | }; \ |
428 | \ | 428 | \ |
429 | if (!__ratelimit(&_rs)) \ | 429 | if (__ratelimit(&_rs)) \ |
430 | printk(fmt, ##__VA_ARGS__); \ | 430 | printk(fmt, ##__VA_ARGS__); \ |
431 | }) | 431 | }) |
432 | #else | 432 | #else |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index ece0b1c3381..e117b1aee69 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -86,7 +86,8 @@ union { \ | |||
86 | */ | 86 | */ |
87 | #define INIT_KFIFO(name) \ | 87 | #define INIT_KFIFO(name) \ |
88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ | 88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ |
89 | sizeof(struct kfifo), name##kfifo_buffer) | 89 | sizeof(struct kfifo), \ |
90 | name##kfifo_buffer + sizeof(struct kfifo)) | ||
90 | 91 | ||
91 | /** | 92 | /** |
92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | 93 | * DEFINE_KFIFO - macro to define and initialize a kfifo |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e70f21beb4b..462acaf36f3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -783,8 +783,8 @@ struct mm_walk { | |||
783 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); | 783 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); |
784 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); | 784 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); |
785 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); | 785 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); |
786 | int (*hugetlb_entry)(pte_t *, unsigned long, unsigned long, | 786 | int (*hugetlb_entry)(pte_t *, unsigned long, |
787 | struct mm_walk *); | 787 | unsigned long, unsigned long, struct mm_walk *); |
788 | struct mm_struct *mm; | 788 | struct mm_struct *mm; |
789 | void *private; | 789 | void *private; |
790 | }; | 790 | }; |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 30b08136fdf..aef22ae2af4 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -39,6 +39,7 @@ enum { | |||
39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | 41 | PCG_ACCT_LRU, /* page has been accounted for */ |
42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | #define TESTPCGFLAG(uname, lname) \ | 45 | #define TESTPCGFLAG(uname, lname) \ |
@@ -73,6 +74,11 @@ CLEARPCGFLAG(AcctLRU, ACCT_LRU) | |||
73 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | 74 | TESTPCGFLAG(AcctLRU, ACCT_LRU) |
74 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | 75 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) |
75 | 76 | ||
77 | |||
78 | SETPCGFLAG(FileMapped, FILE_MAPPED) | ||
79 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | ||
80 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | ||
81 | |||
76 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 82 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
77 | { | 83 | { |
78 | return page_to_nid(pc->page); | 84 | return page_to_nid(pc->page); |
diff --git a/kernel/exit.c b/kernel/exit.c index cce59cb5ee6..7f2683a10ac 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -953,7 +953,8 @@ NORET_TYPE void do_exit(long code) | |||
953 | 953 | ||
954 | acct_update_integrals(tsk); | 954 | acct_update_integrals(tsk); |
955 | /* sync mm's RSS info before statistics gathering */ | 955 | /* sync mm's RSS info before statistics gathering */ |
956 | sync_mm_rss(tsk, tsk->mm); | 956 | if (tsk->mm) |
957 | sync_mm_rss(tsk, tsk->mm); | ||
957 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 958 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
958 | if (group_dead) { | 959 | if (group_dead) { |
959 | hrtimer_cancel(&tsk->signal->real_timer); | 960 | hrtimer_cancel(&tsk->signal->real_timer); |
diff --git a/kernel/fork.c b/kernel/fork.c index 4799c5f0e6d..44b0791b0a2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1052,6 +1052,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1052 | p->prev_utime = cputime_zero; | 1052 | p->prev_utime = cputime_zero; |
1053 | p->prev_stime = cputime_zero; | 1053 | p->prev_stime = cputime_zero; |
1054 | #endif | 1054 | #endif |
1055 | #if defined(SPLIT_RSS_COUNTING) | ||
1056 | memset(&p->rss_stat, 0, sizeof(p->rss_stat)); | ||
1057 | #endif | ||
1055 | 1058 | ||
1056 | p->default_timer_slack_ns = current->timer_slack_ns; | 1059 | p->default_timer_slack_ns = current->timer_slack_ns; |
1057 | 1060 | ||
diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 09f5ce1810d..027a03f4c56 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c | |||
@@ -16,9 +16,14 @@ | |||
16 | /* | 16 | /* |
17 | * __ratelimit - rate limiting | 17 | * __ratelimit - rate limiting |
18 | * @rs: ratelimit_state data | 18 | * @rs: ratelimit_state data |
19 | * @func: name of calling function | ||
19 | * | 20 | * |
20 | * This enforces a rate limit: not more than @rs->ratelimit_burst callbacks | 21 | * This enforces a rate limit: not more than @rs->burst callbacks |
21 | * in every @rs->ratelimit_jiffies | 22 | * in every @rs->interval |
23 | * | ||
24 | * RETURNS: | ||
25 | * 0 means callbacks will be suppressed. | ||
26 | * 1 means go ahead and do it. | ||
22 | */ | 27 | */ |
23 | int ___ratelimit(struct ratelimit_state *rs, const char *func) | 28 | int ___ratelimit(struct ratelimit_state *rs, const char *func) |
24 | { | 29 | { |
@@ -35,7 +40,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) | |||
35 | * the entity that is holding the lock already: | 40 | * the entity that is holding the lock already: |
36 | */ | 41 | */ |
37 | if (!spin_trylock_irqsave(&rs->lock, flags)) | 42 | if (!spin_trylock_irqsave(&rs->lock, flags)) |
38 | return 1; | 43 | return 0; |
39 | 44 | ||
40 | if (!rs->begin) | 45 | if (!rs->begin) |
41 | rs->begin = jiffies; | 46 | rs->begin = jiffies; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9ed760dc744..f4ede99c8b9 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1359,16 +1359,19 @@ void mem_cgroup_update_file_mapped(struct page *page, int val) | |||
1359 | 1359 | ||
1360 | lock_page_cgroup(pc); | 1360 | lock_page_cgroup(pc); |
1361 | mem = pc->mem_cgroup; | 1361 | mem = pc->mem_cgroup; |
1362 | if (!mem) | 1362 | if (!mem || !PageCgroupUsed(pc)) |
1363 | goto done; | ||
1364 | |||
1365 | if (!PageCgroupUsed(pc)) | ||
1366 | goto done; | 1363 | goto done; |
1367 | 1364 | ||
1368 | /* | 1365 | /* |
1369 | * Preemption is already disabled. We can use __this_cpu_xxx | 1366 | * Preemption is already disabled. We can use __this_cpu_xxx |
1370 | */ | 1367 | */ |
1371 | __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED], val); | 1368 | if (val > 0) { |
1369 | __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); | ||
1370 | SetPageCgroupFileMapped(pc); | ||
1371 | } else { | ||
1372 | __this_cpu_dec(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); | ||
1373 | ClearPageCgroupFileMapped(pc); | ||
1374 | } | ||
1372 | 1375 | ||
1373 | done: | 1376 | done: |
1374 | unlock_page_cgroup(pc); | 1377 | unlock_page_cgroup(pc); |
@@ -1801,16 +1804,13 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem, | |||
1801 | static void __mem_cgroup_move_account(struct page_cgroup *pc, | 1804 | static void __mem_cgroup_move_account(struct page_cgroup *pc, |
1802 | struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge) | 1805 | struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge) |
1803 | { | 1806 | { |
1804 | struct page *page; | ||
1805 | |||
1806 | VM_BUG_ON(from == to); | 1807 | VM_BUG_ON(from == to); |
1807 | VM_BUG_ON(PageLRU(pc->page)); | 1808 | VM_BUG_ON(PageLRU(pc->page)); |
1808 | VM_BUG_ON(!PageCgroupLocked(pc)); | 1809 | VM_BUG_ON(!PageCgroupLocked(pc)); |
1809 | VM_BUG_ON(!PageCgroupUsed(pc)); | 1810 | VM_BUG_ON(!PageCgroupUsed(pc)); |
1810 | VM_BUG_ON(pc->mem_cgroup != from); | 1811 | VM_BUG_ON(pc->mem_cgroup != from); |
1811 | 1812 | ||
1812 | page = pc->page; | 1813 | if (PageCgroupFileMapped(pc)) { |
1813 | if (page_mapped(page) && !PageAnon(page)) { | ||
1814 | /* Update mapped_file data for mem_cgroup */ | 1814 | /* Update mapped_file data for mem_cgroup */ |
1815 | preempt_disable(); | 1815 | preempt_disable(); |
1816 | __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); | 1816 | __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); |
diff --git a/mm/memory.c b/mm/memory.c index 1d2ea39260e..833952d8b74 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -125,13 +125,12 @@ core_initcall(init_zero_pfn); | |||
125 | 125 | ||
126 | #if defined(SPLIT_RSS_COUNTING) | 126 | #if defined(SPLIT_RSS_COUNTING) |
127 | 127 | ||
128 | void __sync_task_rss_stat(struct task_struct *task, struct mm_struct *mm) | 128 | static void __sync_task_rss_stat(struct task_struct *task, struct mm_struct *mm) |
129 | { | 129 | { |
130 | int i; | 130 | int i; |
131 | 131 | ||
132 | for (i = 0; i < NR_MM_COUNTERS; i++) { | 132 | for (i = 0; i < NR_MM_COUNTERS; i++) { |
133 | if (task->rss_stat.count[i]) { | 133 | if (task->rss_stat.count[i]) { |
134 | BUG_ON(!mm); | ||
135 | add_mm_counter(mm, i, task->rss_stat.count[i]); | 134 | add_mm_counter(mm, i, task->rss_stat.count[i]); |
136 | task->rss_stat.count[i] = 0; | 135 | task->rss_stat.count[i] = 0; |
137 | } | 136 | } |
diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 7b47a57b664..8b1a2ce21ee 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c | |||
@@ -80,6 +80,37 @@ static int walk_pud_range(pgd_t *pgd, unsigned long addr, unsigned long end, | |||
80 | return err; | 80 | return err; |
81 | } | 81 | } |
82 | 82 | ||
83 | #ifdef CONFIG_HUGETLB_PAGE | ||
84 | static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr, | ||
85 | unsigned long end) | ||
86 | { | ||
87 | unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h); | ||
88 | return boundary < end ? boundary : end; | ||
89 | } | ||
90 | |||
91 | static int walk_hugetlb_range(struct vm_area_struct *vma, | ||
92 | unsigned long addr, unsigned long end, | ||
93 | struct mm_walk *walk) | ||
94 | { | ||
95 | struct hstate *h = hstate_vma(vma); | ||
96 | unsigned long next; | ||
97 | unsigned long hmask = huge_page_mask(h); | ||
98 | pte_t *pte; | ||
99 | int err = 0; | ||
100 | |||
101 | do { | ||
102 | next = hugetlb_entry_end(h, addr, end); | ||
103 | pte = huge_pte_offset(walk->mm, addr & hmask); | ||
104 | if (pte && walk->hugetlb_entry) | ||
105 | err = walk->hugetlb_entry(pte, hmask, addr, next, walk); | ||
106 | if (err) | ||
107 | return err; | ||
108 | } while (addr = next, addr != end); | ||
109 | |||
110 | return 0; | ||
111 | } | ||
112 | #endif | ||
113 | |||
83 | /** | 114 | /** |
84 | * walk_page_range - walk a memory map's page tables with a callback | 115 | * walk_page_range - walk a memory map's page tables with a callback |
85 | * @mm: memory map to walk | 116 | * @mm: memory map to walk |
@@ -128,20 +159,16 @@ int walk_page_range(unsigned long addr, unsigned long end, | |||
128 | vma = find_vma(walk->mm, addr); | 159 | vma = find_vma(walk->mm, addr); |
129 | #ifdef CONFIG_HUGETLB_PAGE | 160 | #ifdef CONFIG_HUGETLB_PAGE |
130 | if (vma && is_vm_hugetlb_page(vma)) { | 161 | if (vma && is_vm_hugetlb_page(vma)) { |
131 | pte_t *pte; | ||
132 | struct hstate *hs; | ||
133 | |||
134 | if (vma->vm_end < next) | 162 | if (vma->vm_end < next) |
135 | next = vma->vm_end; | 163 | next = vma->vm_end; |
136 | hs = hstate_vma(vma); | 164 | /* |
137 | pte = huge_pte_offset(walk->mm, | 165 | * Hugepage is very tightly coupled with vma, so |
138 | addr & huge_page_mask(hs)); | 166 | * walk through hugetlb entries within a given vma. |
139 | if (pte && !huge_pte_none(huge_ptep_get(pte)) | 167 | */ |
140 | && walk->hugetlb_entry) | 168 | err = walk_hugetlb_range(vma, addr, next, walk); |
141 | err = walk->hugetlb_entry(pte, addr, | ||
142 | next, walk); | ||
143 | if (err) | 169 | if (err) |
144 | break; | 170 | break; |
171 | pgd = pgd_offset(walk->mm, next); | ||
145 | continue; | 172 | continue; |
146 | } | 173 | } |
147 | #endif | 174 | #endif |
diff --git a/mm/readahead.c b/mm/readahead.c index 999b54bb462..dfa9a1a03a1 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -503,7 +503,7 @@ void page_cache_sync_readahead(struct address_space *mapping, | |||
503 | return; | 503 | return; |
504 | 504 | ||
505 | /* be dumb */ | 505 | /* be dumb */ |
506 | if (filp->f_mode & FMODE_RANDOM) { | 506 | if (filp && (filp->f_mode & FMODE_RANDOM)) { |
507 | force_page_cache_readahead(mapping, filp, offset, req_size); | 507 | force_page_cache_readahead(mapping, filp, offset, req_size); |
508 | return; | 508 | return; |
509 | } | 509 | } |
diff --git a/mm/vmscan.c b/mm/vmscan.c index e0e5f15bb72..3ff3311447f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1535,13 +1535,6 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc, | |||
1535 | unsigned long ap, fp; | 1535 | unsigned long ap, fp; |
1536 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc); | 1536 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc); |
1537 | 1537 | ||
1538 | /* If we have no swap space, do not bother scanning anon pages. */ | ||
1539 | if (!sc->may_swap || (nr_swap_pages <= 0)) { | ||
1540 | percent[0] = 0; | ||
1541 | percent[1] = 100; | ||
1542 | return; | ||
1543 | } | ||
1544 | |||
1545 | anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) + | 1538 | anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) + |
1546 | zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON); | 1539 | zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON); |
1547 | file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) + | 1540 | file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) + |
@@ -1639,20 +1632,22 @@ static void shrink_zone(int priority, struct zone *zone, | |||
1639 | unsigned long nr_reclaimed = sc->nr_reclaimed; | 1632 | unsigned long nr_reclaimed = sc->nr_reclaimed; |
1640 | unsigned long nr_to_reclaim = sc->nr_to_reclaim; | 1633 | unsigned long nr_to_reclaim = sc->nr_to_reclaim; |
1641 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc); | 1634 | struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc); |
1635 | int noswap = 0; | ||
1642 | 1636 | ||
1643 | get_scan_ratio(zone, sc, percent); | 1637 | /* If we have no swap space, do not bother scanning anon pages. */ |
1638 | if (!sc->may_swap || (nr_swap_pages <= 0)) { | ||
1639 | noswap = 1; | ||
1640 | percent[0] = 0; | ||
1641 | percent[1] = 100; | ||
1642 | } else | ||
1643 | get_scan_ratio(zone, sc, percent); | ||
1644 | 1644 | ||
1645 | for_each_evictable_lru(l) { | 1645 | for_each_evictable_lru(l) { |
1646 | int file = is_file_lru(l); | 1646 | int file = is_file_lru(l); |
1647 | unsigned long scan; | 1647 | unsigned long scan; |
1648 | 1648 | ||
1649 | if (percent[file] == 0) { | ||
1650 | nr[l] = 0; | ||
1651 | continue; | ||
1652 | } | ||
1653 | |||
1654 | scan = zone_nr_lru_pages(zone, sc, l); | 1649 | scan = zone_nr_lru_pages(zone, sc, l); |
1655 | if (priority) { | 1650 | if (priority || noswap) { |
1656 | scan >>= priority; | 1651 | scan >>= priority; |
1657 | scan = (scan * percent[file]) / 100; | 1652 | scan = (scan * percent[file]) / 100; |
1658 | } | 1653 | } |