diff options
44 files changed, 625 insertions, 599 deletions
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS index 0af0e9eed5d6..888ae7b83ae4 100644 --- a/Documentation/arm/OMAP/DSS +++ b/Documentation/arm/OMAP/DSS | |||
| @@ -255,9 +255,10 @@ framebuffer parameters. | |||
| 255 | Kernel boot arguments | 255 | Kernel boot arguments |
| 256 | --------------------- | 256 | --------------------- |
| 257 | 257 | ||
| 258 | vram=<size> | 258 | vram=<size>[,<physaddr>] |
| 259 | - Amount of total VRAM to preallocate. For example, "10M". omapfb | 259 | - Amount of total VRAM to preallocate and optionally a physical start |
| 260 | allocates memory for framebuffers from VRAM. | 260 | memory address. For example, "10M". omapfb allocates memory for |
| 261 | framebuffers from VRAM. | ||
| 261 | 262 | ||
| 262 | omapfb.mode=<display>:<mode>[,...] | 263 | omapfb.mode=<display>:<mode>[,...] |
| 263 | - Default video mode for specified displays. For example, | 264 | - Default video mode for specified displays. For example, |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index d8f36f984faa..6c2f55e05f13 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
| @@ -554,3 +554,13 @@ Why: This is a legacy interface which have been replaced by a more | |||
| 554 | Who: NeilBrown <neilb@suse.de> | 554 | Who: NeilBrown <neilb@suse.de> |
| 555 | 555 | ||
| 556 | ---------------------------- | 556 | ---------------------------- |
| 557 | |||
| 558 | What: i2c_adapter.id | ||
| 559 | When: June 2011 | ||
| 560 | Why: This field is deprecated. I2C device drivers shouldn't change their | ||
| 561 | behavior based on the underlying I2C adapter. Instead, the I2C | ||
| 562 | adapter driver should instantiate the I2C devices and provide the | ||
| 563 | needed platform-specific information. | ||
| 564 | Who: Jean Delvare <khali@linux-fr.org> | ||
| 565 | |||
| 566 | ---------------------------- | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 88b74a75d932..8e6548dbd5db 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -945,7 +945,7 @@ M: Magnus Damm <magnus.damm@gmail.com> | |||
| 945 | L: linux-sh@vger.kernel.org | 945 | L: linux-sh@vger.kernel.org |
| 946 | W: http://oss.renesas.com | 946 | W: http://oss.renesas.com |
| 947 | Q: http://patchwork.kernel.org/project/linux-sh/list/ | 947 | Q: http://patchwork.kernel.org/project/linux-sh/list/ |
| 948 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/genesis-2.6.git | 948 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git rmobile-latest |
| 949 | S: Supported | 949 | S: Supported |
| 950 | F: arch/arm/mach-shmobile/ | 950 | F: arch/arm/mach-shmobile/ |
| 951 | F: drivers/sh/ | 951 | F: drivers/sh/ |
| @@ -2435,6 +2435,7 @@ F: drivers/net/wan/sdla.c | |||
| 2435 | FRAMEBUFFER LAYER | 2435 | FRAMEBUFFER LAYER |
| 2436 | L: linux-fbdev@vger.kernel.org | 2436 | L: linux-fbdev@vger.kernel.org |
| 2437 | W: http://linux-fbdev.sourceforge.net/ | 2437 | W: http://linux-fbdev.sourceforge.net/ |
| 2438 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6.git | ||
| 2438 | S: Orphan | 2439 | S: Orphan |
| 2439 | F: Documentation/fb/ | 2440 | F: Documentation/fb/ |
| 2440 | F: drivers/video/fb* | 2441 | F: drivers/video/fb* |
| @@ -5705,7 +5706,7 @@ M: Paul Mundt <lethal@linux-sh.org> | |||
| 5705 | L: linux-sh@vger.kernel.org | 5706 | L: linux-sh@vger.kernel.org |
| 5706 | W: http://www.linux-sh.org | 5707 | W: http://www.linux-sh.org |
| 5707 | Q: http://patchwork.kernel.org/project/linux-sh/list/ | 5708 | Q: http://patchwork.kernel.org/project/linux-sh/list/ |
| 5708 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git | 5709 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git sh-latest |
| 5709 | S: Supported | 5710 | S: Supported |
| 5710 | F: Documentation/sh/ | 5711 | F: Documentation/sh/ |
| 5711 | F: arch/sh/ | 5712 | F: arch/sh/ |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8ae3d48d504c..db524e75c4a2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -646,7 +646,7 @@ config ARCH_S3C2410 | |||
| 646 | select ARCH_HAS_CPUFREQ | 646 | select ARCH_HAS_CPUFREQ |
| 647 | select HAVE_CLK | 647 | select HAVE_CLK |
| 648 | select ARCH_USES_GETTIMEOFFSET | 648 | select ARCH_USES_GETTIMEOFFSET |
| 649 | select HAVE_S3C2410_I2C | 649 | select HAVE_S3C2410_I2C if I2C |
| 650 | help | 650 | help |
| 651 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 651 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
| 652 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 652 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
| @@ -676,8 +676,8 @@ config ARCH_S3C64XX | |||
| 676 | select S3C_DEV_NAND | 676 | select S3C_DEV_NAND |
| 677 | select USB_ARCH_HAS_OHCI | 677 | select USB_ARCH_HAS_OHCI |
| 678 | select SAMSUNG_GPIOLIB_4BIT | 678 | select SAMSUNG_GPIOLIB_4BIT |
| 679 | select HAVE_S3C2410_I2C | 679 | select HAVE_S3C2410_I2C if I2C |
| 680 | select HAVE_S3C2410_WATCHDOG | 680 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 681 | help | 681 | help |
| 682 | Samsung S3C64XX series based systems | 682 | Samsung S3C64XX series based systems |
| 683 | 683 | ||
| @@ -686,10 +686,10 @@ config ARCH_S5P64X0 | |||
| 686 | select CPU_V6 | 686 | select CPU_V6 |
| 687 | select GENERIC_GPIO | 687 | select GENERIC_GPIO |
| 688 | select HAVE_CLK | 688 | select HAVE_CLK |
| 689 | select HAVE_S3C2410_WATCHDOG | 689 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 690 | select ARCH_USES_GETTIMEOFFSET | 690 | select ARCH_USES_GETTIMEOFFSET |
| 691 | select HAVE_S3C2410_I2C | 691 | select HAVE_S3C2410_I2C if I2C |
| 692 | select HAVE_S3C_RTC | 692 | select HAVE_S3C_RTC if RTC_CLASS |
| 693 | help | 693 | help |
| 694 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, | 694 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, |
| 695 | SMDK6450. | 695 | SMDK6450. |
| @@ -700,7 +700,7 @@ config ARCH_S5P6442 | |||
| 700 | select GENERIC_GPIO | 700 | select GENERIC_GPIO |
| 701 | select HAVE_CLK | 701 | select HAVE_CLK |
| 702 | select ARCH_USES_GETTIMEOFFSET | 702 | select ARCH_USES_GETTIMEOFFSET |
| 703 | select HAVE_S3C2410_WATCHDOG | 703 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 704 | help | 704 | help |
| 705 | Samsung S5P6442 CPU based systems | 705 | Samsung S5P6442 CPU based systems |
| 706 | 706 | ||
| @@ -711,9 +711,9 @@ config ARCH_S5PC100 | |||
| 711 | select CPU_V7 | 711 | select CPU_V7 |
| 712 | select ARM_L1_CACHE_SHIFT_6 | 712 | select ARM_L1_CACHE_SHIFT_6 |
| 713 | select ARCH_USES_GETTIMEOFFSET | 713 | select ARCH_USES_GETTIMEOFFSET |
| 714 | select HAVE_S3C2410_I2C | 714 | select HAVE_S3C2410_I2C if I2C |
| 715 | select HAVE_S3C_RTC | 715 | select HAVE_S3C_RTC if RTC_CLASS |
| 716 | select HAVE_S3C2410_WATCHDOG | 716 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 717 | help | 717 | help |
| 718 | Samsung S5PC100 series based systems | 718 | Samsung S5PC100 series based systems |
| 719 | 719 | ||
| @@ -726,9 +726,9 @@ config ARCH_S5PV210 | |||
| 726 | select ARM_L1_CACHE_SHIFT_6 | 726 | select ARM_L1_CACHE_SHIFT_6 |
| 727 | select ARCH_HAS_CPUFREQ | 727 | select ARCH_HAS_CPUFREQ |
| 728 | select ARCH_USES_GETTIMEOFFSET | 728 | select ARCH_USES_GETTIMEOFFSET |
| 729 | select HAVE_S3C2410_I2C | 729 | select HAVE_S3C2410_I2C if I2C |
| 730 | select HAVE_S3C_RTC | 730 | select HAVE_S3C_RTC if RTC_CLASS |
| 731 | select HAVE_S3C2410_WATCHDOG | 731 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 732 | help | 732 | help |
| 733 | Samsung S5PV210/S5PC110 series based systems | 733 | Samsung S5PV210/S5PC110 series based systems |
| 734 | 734 | ||
| @@ -739,9 +739,9 @@ config ARCH_S5PV310 | |||
| 739 | select GENERIC_GPIO | 739 | select GENERIC_GPIO |
| 740 | select HAVE_CLK | 740 | select HAVE_CLK |
| 741 | select GENERIC_CLOCKEVENTS | 741 | select GENERIC_CLOCKEVENTS |
| 742 | select HAVE_S3C_RTC | 742 | select HAVE_S3C_RTC if RTC_CLASS |
| 743 | select HAVE_S3C2410_I2C | 743 | select HAVE_S3C2410_I2C if I2C |
| 744 | select HAVE_S3C2410_WATCHDOG | 744 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 745 | help | 745 | help |
| 746 | Samsung S5PV310 series based systems | 746 | Samsung S5PV310 series based systems |
| 747 | 747 | ||
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 1ca7bdc6485c..579d2f0f4dd0 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
| @@ -143,7 +143,7 @@ config MACH_SMDK6410 | |||
| 143 | select S3C_DEV_USB_HSOTG | 143 | select S3C_DEV_USB_HSOTG |
| 144 | select S3C_DEV_WDT | 144 | select S3C_DEV_WDT |
| 145 | select SAMSUNG_DEV_KEYPAD | 145 | select SAMSUNG_DEV_KEYPAD |
| 146 | select HAVE_S3C2410_WATCHDOG | 146 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 147 | select S3C64XX_SETUP_SDHCI | 147 | select S3C64XX_SETUP_SDHCI |
| 148 | select S3C64XX_SETUP_I2C1 | 148 | select S3C64XX_SETUP_I2C1 |
| 149 | select S3C64XX_SETUP_IDE | 149 | select S3C64XX_SETUP_IDE |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 32d9e2816e56..d3260542b943 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -163,11 +163,13 @@ static struct mtd_partition nor_flash_partitions[] = { | |||
| 163 | .name = "loader", | 163 | .name = "loader", |
| 164 | .offset = 0x00000000, | 164 | .offset = 0x00000000, |
| 165 | .size = 512 * 1024, | 165 | .size = 512 * 1024, |
| 166 | .mask_flags = MTD_WRITEABLE, | ||
| 166 | }, | 167 | }, |
| 167 | { | 168 | { |
| 168 | .name = "bootenv", | 169 | .name = "bootenv", |
| 169 | .offset = MTDPART_OFS_APPEND, | 170 | .offset = MTDPART_OFS_APPEND, |
| 170 | .size = 512 * 1024, | 171 | .size = 512 * 1024, |
| 172 | .mask_flags = MTD_WRITEABLE, | ||
| 171 | }, | 173 | }, |
| 172 | { | 174 | { |
| 173 | .name = "kernel_ro", | 175 | .name = "kernel_ro", |
| @@ -581,6 +583,10 @@ static int fsi_set_rate(int is_porta, int rate) | |||
| 581 | return -EINVAL; | 583 | return -EINVAL; |
| 582 | 584 | ||
| 583 | switch (rate) { | 585 | switch (rate) { |
| 586 | case 44100: | ||
| 587 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 11283000)); | ||
| 588 | ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; | ||
| 589 | break; | ||
| 584 | case 48000: | 590 | case 48000: |
| 585 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); | 591 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); |
| 586 | clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); | 592 | clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 4cd3cae38e72..30b2f400666a 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
| @@ -98,7 +98,7 @@ static struct intc_vect intca_vectors[] __initdata = { | |||
| 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), | 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), |
| 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), | 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), |
| 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), | 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), |
| 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0), | 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ21A, 0x32a0), |
| 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), | 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), |
| 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), | 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), |
| 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), | 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 15466c096ba5..0972315c3860 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
| @@ -138,7 +138,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 138 | struct acpi_resource_address64 addr; | 138 | struct acpi_resource_address64 addr; |
| 139 | acpi_status status; | 139 | acpi_status status; |
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | struct resource *root, *conflict; | ||
| 142 | u64 start, end; | 141 | u64 start, end; |
| 143 | 142 | ||
| 144 | status = resource_to_addr(acpi_res, &addr); | 143 | status = resource_to_addr(acpi_res, &addr); |
| @@ -146,12 +145,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 146 | return AE_OK; | 145 | return AE_OK; |
| 147 | 146 | ||
| 148 | if (addr.resource_type == ACPI_MEMORY_RANGE) { | 147 | if (addr.resource_type == ACPI_MEMORY_RANGE) { |
| 149 | root = &iomem_resource; | ||
| 150 | flags = IORESOURCE_MEM; | 148 | flags = IORESOURCE_MEM; |
| 151 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) | 149 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) |
| 152 | flags |= IORESOURCE_PREFETCH; | 150 | flags |= IORESOURCE_PREFETCH; |
| 153 | } else if (addr.resource_type == ACPI_IO_RANGE) { | 151 | } else if (addr.resource_type == ACPI_IO_RANGE) { |
| 154 | root = &ioport_resource; | ||
| 155 | flags = IORESOURCE_IO; | 152 | flags = IORESOURCE_IO; |
| 156 | } else | 153 | } else |
| 157 | return AE_OK; | 154 | return AE_OK; |
| @@ -172,25 +169,90 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 172 | return AE_OK; | 169 | return AE_OK; |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | conflict = insert_resource_conflict(root, res); | 172 | info->res_num++; |
| 176 | if (conflict) { | 173 | if (addr.translation_offset) |
| 177 | dev_err(&info->bridge->dev, | 174 | dev_info(&info->bridge->dev, "host bridge window %pR " |
| 178 | "address space collision: host bridge window %pR " | 175 | "(PCI address [%#llx-%#llx])\n", |
| 179 | "conflicts with %s %pR\n", | 176 | res, res->start - addr.translation_offset, |
| 180 | res, conflict->name, conflict); | 177 | res->end - addr.translation_offset); |
| 181 | } else { | 178 | else |
| 182 | pci_bus_add_resource(info->bus, res, 0); | 179 | dev_info(&info->bridge->dev, "host bridge window %pR\n", res); |
| 183 | info->res_num++; | 180 | |
| 184 | if (addr.translation_offset) | 181 | return AE_OK; |
| 185 | dev_info(&info->bridge->dev, "host bridge window %pR " | 182 | } |
| 186 | "(PCI address [%#llx-%#llx])\n", | 183 | |
| 187 | res, res->start - addr.translation_offset, | 184 | static bool resource_contains(struct resource *res, resource_size_t point) |
| 188 | res->end - addr.translation_offset); | 185 | { |
| 186 | if (res->start <= point && point <= res->end) | ||
| 187 | return true; | ||
| 188 | return false; | ||
| 189 | } | ||
| 190 | |||
| 191 | static void coalesce_windows(struct pci_root_info *info, int type) | ||
| 192 | { | ||
| 193 | int i, j; | ||
| 194 | struct resource *res1, *res2; | ||
| 195 | |||
| 196 | for (i = 0; i < info->res_num; i++) { | ||
| 197 | res1 = &info->res[i]; | ||
| 198 | if (!(res1->flags & type)) | ||
| 199 | continue; | ||
| 200 | |||
| 201 | for (j = i + 1; j < info->res_num; j++) { | ||
| 202 | res2 = &info->res[j]; | ||
| 203 | if (!(res2->flags & type)) | ||
| 204 | continue; | ||
| 205 | |||
| 206 | /* | ||
| 207 | * I don't like throwing away windows because then | ||
| 208 | * our resources no longer match the ACPI _CRS, but | ||
| 209 | * the kernel resource tree doesn't allow overlaps. | ||
| 210 | */ | ||
| 211 | if (resource_contains(res1, res2->start) || | ||
| 212 | resource_contains(res1, res2->end) || | ||
| 213 | resource_contains(res2, res1->start) || | ||
| 214 | resource_contains(res2, res1->end)) { | ||
| 215 | res1->start = min(res1->start, res2->start); | ||
| 216 | res1->end = max(res1->end, res2->end); | ||
| 217 | dev_info(&info->bridge->dev, | ||
| 218 | "host bridge window expanded to %pR; %pR ignored\n", | ||
| 219 | res1, res2); | ||
| 220 | res2->flags = 0; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | } | ||
| 224 | } | ||
| 225 | |||
| 226 | static void add_resources(struct pci_root_info *info) | ||
| 227 | { | ||
| 228 | int i; | ||
| 229 | struct resource *res, *root, *conflict; | ||
| 230 | |||
| 231 | if (!pci_use_crs) | ||
| 232 | return; | ||
| 233 | |||
| 234 | coalesce_windows(info, IORESOURCE_MEM); | ||
| 235 | coalesce_windows(info, IORESOURCE_IO); | ||
| 236 | |||
| 237 | for (i = 0; i < info->res_num; i++) { | ||
| 238 | res = &info->res[i]; | ||
| 239 | |||
| 240 | if (res->flags & IORESOURCE_MEM) | ||
| 241 | root = &iomem_resource; | ||
| 242 | else if (res->flags & IORESOURCE_IO) | ||
| 243 | root = &ioport_resource; | ||
| 189 | else | 244 | else |
| 190 | dev_info(&info->bridge->dev, | 245 | continue; |
| 191 | "host bridge window %pR\n", res); | 246 | |
| 247 | conflict = insert_resource_conflict(root, res); | ||
| 248 | if (conflict) | ||
| 249 | dev_err(&info->bridge->dev, | ||
| 250 | "address space collision: host bridge window %pR " | ||
| 251 | "conflicts with %s %pR\n", | ||
| 252 | res, conflict->name, conflict); | ||
| 253 | else | ||
| 254 | pci_bus_add_resource(info->bus, res, 0); | ||
| 192 | } | 255 | } |
| 193 | return AE_OK; | ||
| 194 | } | 256 | } |
| 195 | 257 | ||
| 196 | static void | 258 | static void |
| @@ -224,6 +286,7 @@ get_current_resources(struct acpi_device *device, int busnum, | |||
| 224 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, | 286 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, |
| 225 | &info); | 287 | &info); |
| 226 | 288 | ||
| 289 | add_resources(&info); | ||
| 227 | return; | 290 | return; |
| 228 | 291 | ||
| 229 | name_alloc_fail: | 292 | name_alloc_fail: |
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index f0863bec186f..d72433f2d310 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
| @@ -120,7 +120,7 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 120 | int eax = regs->eax; | 120 | int eax = regs->eax; |
| 121 | 121 | ||
| 122 | #if defined(CONFIG_X86_64) | 122 | #if defined(CONFIG_X86_64) |
| 123 | asm("pushq %%rax\n\t" | 123 | asm volatile("pushq %%rax\n\t" |
| 124 | "movl 0(%%rax),%%edx\n\t" | 124 | "movl 0(%%rax),%%edx\n\t" |
| 125 | "pushq %%rdx\n\t" | 125 | "pushq %%rdx\n\t" |
| 126 | "movl 4(%%rax),%%ebx\n\t" | 126 | "movl 4(%%rax),%%ebx\n\t" |
| @@ -142,11 +142,11 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 142 | "lahf\n\t" | 142 | "lahf\n\t" |
| 143 | "shrl $8,%%eax\n\t" | 143 | "shrl $8,%%eax\n\t" |
| 144 | "andl $1,%%eax\n" | 144 | "andl $1,%%eax\n" |
| 145 | :"=a"(rc), "+m" (*regs) | 145 | :"=a"(rc) |
| 146 | : "a"(regs) | 146 | : "a"(regs) |
| 147 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); | 147 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); |
| 148 | #else | 148 | #else |
| 149 | asm("pushl %%eax\n\t" | 149 | asm volatile("pushl %%eax\n\t" |
| 150 | "movl 0(%%eax),%%edx\n\t" | 150 | "movl 0(%%eax),%%edx\n\t" |
| 151 | "push %%edx\n\t" | 151 | "push %%edx\n\t" |
| 152 | "movl 4(%%eax),%%ebx\n\t" | 152 | "movl 4(%%eax),%%ebx\n\t" |
| @@ -168,7 +168,7 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 168 | "lahf\n\t" | 168 | "lahf\n\t" |
| 169 | "shrl $8,%%eax\n\t" | 169 | "shrl $8,%%eax\n\t" |
| 170 | "andl $1,%%eax\n" | 170 | "andl $1,%%eax\n" |
| 171 | :"=a"(rc), "+m" (*regs) | 171 | :"=a"(rc) |
| 172 | : "a"(regs) | 172 | : "a"(regs) |
| 173 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); | 173 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); |
| 174 | #endif | 174 | #endif |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index d231f683f576..6b4cc567645b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -848,6 +848,18 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
| 848 | goto out_list; | 848 | goto out_list; |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | /* Sanity checks */ | ||
| 852 | if (unlikely(adap->name[0] == '\0')) { | ||
| 853 | pr_err("i2c-core: Attempt to register an adapter with " | ||
| 854 | "no name!\n"); | ||
| 855 | return -EINVAL; | ||
| 856 | } | ||
| 857 | if (unlikely(!adap->algo)) { | ||
| 858 | pr_err("i2c-core: Attempt to register adapter '%s' with " | ||
| 859 | "no algo!\n", adap->name); | ||
| 860 | return -EINVAL; | ||
| 861 | } | ||
| 862 | |||
| 851 | rt_mutex_init(&adap->bus_lock); | 863 | rt_mutex_init(&adap->bus_lock); |
| 852 | mutex_init(&adap->userspace_clients_lock); | 864 | mutex_init(&adap->userspace_clients_lock); |
| 853 | INIT_LIST_HEAD(&adap->userspace_clients); | 865 | INIT_LIST_HEAD(&adap->userspace_clients); |
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index d32a4843fc3a..d7a4833be416 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
| @@ -120,7 +120,6 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, | |||
| 120 | snprintf(priv->adap.name, sizeof(priv->adap.name), | 120 | snprintf(priv->adap.name, sizeof(priv->adap.name), |
| 121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); | 121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); |
| 122 | priv->adap.owner = THIS_MODULE; | 122 | priv->adap.owner = THIS_MODULE; |
| 123 | priv->adap.id = parent->id; | ||
| 124 | priv->adap.algo = &priv->algo; | 123 | priv->adap.algo = &priv->algo; |
| 125 | priv->adap.algo_data = priv; | 124 | priv->adap.algo_data = priv; |
| 126 | priv->adap.dev.parent = &parent->dev; | 125 | priv->adap.dev.parent = &parent->dev; |
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c index 3d88542612ea..74ee172b5bc9 100644 --- a/drivers/media/common/saa7146_i2c.c +++ b/drivers/media/common/saa7146_i2c.c | |||
| @@ -391,7 +391,6 @@ static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, in | |||
| 391 | 391 | ||
| 392 | /*****************************************************************************/ | 392 | /*****************************************************************************/ |
| 393 | /* i2c-adapter helper functions */ | 393 | /* i2c-adapter helper functions */ |
| 394 | #include <linux/i2c-id.h> | ||
| 395 | 394 | ||
| 396 | /* exported algorithm data */ | 395 | /* exported algorithm data */ |
| 397 | static struct i2c_algorithm saa7146_algo = { | 396 | static struct i2c_algorithm saa7146_algo = { |
diff --git a/drivers/media/video/imx074.c b/drivers/media/video/imx074.c index 380e459f899d..27b5dfdfbb93 100644 --- a/drivers/media/video/imx074.c +++ b/drivers/media/video/imx074.c | |||
| @@ -451,7 +451,6 @@ static int imx074_probe(struct i2c_client *client, | |||
| 451 | ret = imx074_video_probe(icd, client); | 451 | ret = imx074_video_probe(icd, client); |
| 452 | if (ret < 0) { | 452 | if (ret < 0) { |
| 453 | icd->ops = NULL; | 453 | icd->ops = NULL; |
| 454 | i2c_set_clientdata(client, NULL); | ||
| 455 | kfree(priv); | 454 | kfree(priv); |
| 456 | return ret; | 455 | return ret; |
| 457 | } | 456 | } |
| @@ -468,7 +467,6 @@ static int imx074_remove(struct i2c_client *client) | |||
| 468 | icd->ops = NULL; | 467 | icd->ops = NULL; |
| 469 | if (icl->free_bus) | 468 | if (icl->free_bus) |
| 470 | icl->free_bus(icl); | 469 | icl->free_bus(icl); |
| 471 | i2c_set_clientdata(client, NULL); | ||
| 472 | client->driver = NULL; | 470 | client->driver = NULL; |
| 473 | kfree(priv); | 471 | kfree(priv); |
| 474 | 472 | ||
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 5a000c65ae98..ce4a75375909 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | #include <linux/errno.h> | 44 | #include <linux/errno.h> |
| 45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
| 46 | #include <linux/i2c.h> | 46 | #include <linux/i2c.h> |
| 47 | #include <linux/i2c-id.h> | ||
| 48 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
| 49 | 48 | ||
| 50 | #include <media/ir-core.h> | 49 | #include <media/ir-core.h> |
diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c index 31f19373bbae..cf93de988068 100644 --- a/drivers/media/video/ov6650.c +++ b/drivers/media/video/ov6650.c | |||
| @@ -1174,7 +1174,6 @@ static int ov6650_probe(struct i2c_client *client, | |||
| 1174 | 1174 | ||
| 1175 | if (ret) { | 1175 | if (ret) { |
| 1176 | icd->ops = NULL; | 1176 | icd->ops = NULL; |
| 1177 | i2c_set_clientdata(client, NULL); | ||
| 1178 | kfree(priv); | 1177 | kfree(priv); |
| 1179 | } | 1178 | } |
| 1180 | 1179 | ||
| @@ -1185,7 +1184,6 @@ static int ov6650_remove(struct i2c_client *client) | |||
| 1185 | { | 1184 | { |
| 1186 | struct ov6650 *priv = to_ov6650(client); | 1185 | struct ov6650 *priv = to_ov6650(client); |
| 1187 | 1186 | ||
| 1188 | i2c_set_clientdata(client, NULL); | ||
| 1189 | kfree(priv); | 1187 | kfree(priv); |
| 1190 | return 0; | 1188 | return 0; |
| 1191 | } | 1189 | } |
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0ed09358027e..644d4cd071cc 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c | |||
| @@ -251,7 +251,6 @@ static int apds9802als_probe(struct i2c_client *client, | |||
| 251 | 251 | ||
| 252 | return res; | 252 | return res; |
| 253 | als_error1: | 253 | als_error1: |
| 254 | i2c_set_clientdata(client, NULL); | ||
| 255 | kfree(data); | 254 | kfree(data); |
| 256 | return res; | 255 | return res; |
| 257 | } | 256 | } |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 5624db8c9ad0..003170ea2e39 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
| @@ -64,17 +64,57 @@ void pci_bus_remove_resources(struct pci_bus *bus) | |||
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static bool pci_bus_resource_better(struct resource *res1, bool pos1, | ||
| 68 | struct resource *res2, bool pos2) | ||
| 69 | { | ||
| 70 | /* If exactly one is positive decode, always prefer that one */ | ||
| 71 | if (pos1 != pos2) | ||
| 72 | return pos1 ? true : false; | ||
| 73 | |||
| 74 | /* Prefer the one that contains the highest address */ | ||
| 75 | if (res1->end != res2->end) | ||
| 76 | return (res1->end > res2->end) ? true : false; | ||
| 77 | |||
| 78 | /* Otherwise, prefer the one with highest "center of gravity" */ | ||
| 79 | if (res1->start != res2->start) | ||
| 80 | return (res1->start > res2->start) ? true : false; | ||
| 81 | |||
| 82 | /* Otherwise, choose one arbitrarily (but consistently) */ | ||
| 83 | return (res1 > res2) ? true : false; | ||
| 84 | } | ||
| 85 | |||
| 86 | static bool pci_bus_resource_positive(struct pci_bus *bus, struct resource *res) | ||
| 87 | { | ||
| 88 | struct pci_bus_resource *bus_res; | ||
| 89 | |||
| 90 | /* | ||
| 91 | * This relies on the fact that pci_bus.resource[] refers to P2P or | ||
| 92 | * CardBus bridge base/limit registers, which are always positively | ||
| 93 | * decoded. The pci_bus.resources list contains host bridge or | ||
| 94 | * subtractively decoded resources. | ||
| 95 | */ | ||
| 96 | list_for_each_entry(bus_res, &bus->resources, list) { | ||
| 97 | if (bus_res->res == res) | ||
| 98 | return (bus_res->flags & PCI_SUBTRACTIVE_DECODE) ? | ||
| 99 | false : true; | ||
| 100 | } | ||
| 101 | return true; | ||
| 102 | } | ||
| 103 | |||
| 67 | /* | 104 | /* |
| 68 | * Find the highest-address bus resource below the cursor "res". If the | 105 | * Find the next-best bus resource after the cursor "res". If the cursor is |
| 69 | * cursor is NULL, return the highest resource. | 106 | * NULL, return the best resource. "Best" means that we prefer positive |
| 107 | * decode regions over subtractive decode, then those at higher addresses. | ||
| 70 | */ | 108 | */ |
| 71 | static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, | 109 | static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, |
| 72 | unsigned int type, | 110 | unsigned int type, |
| 73 | struct resource *res) | 111 | struct resource *res) |
| 74 | { | 112 | { |
| 113 | bool res_pos, r_pos, prev_pos = false; | ||
| 75 | struct resource *r, *prev = NULL; | 114 | struct resource *r, *prev = NULL; |
| 76 | int i; | 115 | int i; |
| 77 | 116 | ||
| 117 | res_pos = pci_bus_resource_positive(bus, res); | ||
| 78 | pci_bus_for_each_resource(bus, r, i) { | 118 | pci_bus_for_each_resource(bus, r, i) { |
| 79 | if (!r) | 119 | if (!r) |
| 80 | continue; | 120 | continue; |
| @@ -82,26 +122,14 @@ static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, | |||
| 82 | if ((r->flags & IORESOURCE_TYPE_BITS) != type) | 122 | if ((r->flags & IORESOURCE_TYPE_BITS) != type) |
| 83 | continue; | 123 | continue; |
| 84 | 124 | ||
| 85 | /* If this resource is at or past the cursor, skip it */ | 125 | r_pos = pci_bus_resource_positive(bus, r); |
| 86 | if (res) { | 126 | if (!res || pci_bus_resource_better(res, res_pos, r, r_pos)) { |
| 87 | if (r == res) | 127 | if (!prev || pci_bus_resource_better(r, r_pos, |
| 88 | continue; | 128 | prev, prev_pos)) { |
| 89 | if (r->end > res->end) | 129 | prev = r; |
| 90 | continue; | 130 | prev_pos = r_pos; |
| 91 | if (r->end == res->end && r->start > res->start) | 131 | } |
| 92 | continue; | ||
| 93 | } | 132 | } |
| 94 | |||
| 95 | if (!prev) | ||
| 96 | prev = r; | ||
| 97 | |||
| 98 | /* | ||
| 99 | * A small resource is higher than a large one that ends at | ||
| 100 | * the same address. | ||
| 101 | */ | ||
| 102 | if (r->end > prev->end || | ||
| 103 | (r->end == prev->end && r->start > prev->start)) | ||
| 104 | prev = r; | ||
| 105 | } | 133 | } |
| 106 | 134 | ||
| 107 | return prev; | 135 | return prev; |
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index 5becbdee4027..2850e64dedae 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c | |||
| @@ -276,6 +276,12 @@ int __init ibmphp_access_ebda (void) | |||
| 276 | 276 | ||
| 277 | for (;;) { | 277 | for (;;) { |
| 278 | offset = next_offset; | 278 | offset = next_offset; |
| 279 | |||
| 280 | /* Make sure what we read is still in the mapped section */ | ||
| 281 | if (WARN(offset > (ebda_sz * 1024 - 4), | ||
| 282 | "ibmphp_ebda: next read is beyond ebda_sz\n")) | ||
| 283 | break; | ||
| 284 | |||
| 279 | next_offset = readw (io_mem + offset); /* offset of next blk */ | 285 | next_offset = readw (io_mem + offset); /* offset of next blk */ |
| 280 | 286 | ||
| 281 | offset += 2; | 287 | offset += 2; |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index b5a7d9bfcb24..95712a375cd5 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
| @@ -705,17 +705,21 @@ void pci_remove_legacy_files(struct pci_bus *b) | |||
| 705 | 705 | ||
| 706 | #ifdef HAVE_PCI_MMAP | 706 | #ifdef HAVE_PCI_MMAP |
| 707 | 707 | ||
| 708 | int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma) | 708 | int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma, |
| 709 | enum pci_mmap_api mmap_api) | ||
| 709 | { | 710 | { |
| 710 | unsigned long nr, start, size; | 711 | unsigned long nr, start, size, pci_start; |
| 711 | 712 | ||
| 713 | if (pci_resource_len(pdev, resno) == 0) | ||
| 714 | return 0; | ||
| 712 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 715 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
| 713 | start = vma->vm_pgoff; | 716 | start = vma->vm_pgoff; |
| 714 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; | 717 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; |
| 715 | if (start < size && size - start >= nr) | 718 | pci_start = (mmap_api == PCI_MMAP_SYSFS) ? |
| 719 | pci_resource_start(pdev, resno) >> PAGE_SHIFT : 0; | ||
| 720 | if (start >= pci_start && start < pci_start + size && | ||
| 721 | start + nr <= pci_start + size) | ||
| 716 | return 1; | 722 | return 1; |
| 717 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", | ||
| 718 | current->comm, start, start+nr, pci_name(pdev), resno, size); | ||
| 719 | return 0; | 723 | return 0; |
| 720 | } | 724 | } |
| 721 | 725 | ||
| @@ -745,8 +749,15 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, | |||
| 745 | if (i >= PCI_ROM_RESOURCE) | 749 | if (i >= PCI_ROM_RESOURCE) |
| 746 | return -ENODEV; | 750 | return -ENODEV; |
| 747 | 751 | ||
| 748 | if (!pci_mmap_fits(pdev, i, vma)) | 752 | if (!pci_mmap_fits(pdev, i, vma, PCI_MMAP_SYSFS)) { |
| 753 | WARN(1, "process \"%s\" tried to map 0x%08lx bytes " | ||
| 754 | "at page 0x%08lx on %s BAR %d (start 0x%16Lx, size 0x%16Lx)\n", | ||
| 755 | current->comm, vma->vm_end-vma->vm_start, vma->vm_pgoff, | ||
| 756 | pci_name(pdev), i, | ||
| 757 | (u64)pci_resource_start(pdev, i), | ||
| 758 | (u64)pci_resource_len(pdev, i)); | ||
| 749 | return -EINVAL; | 759 | return -EINVAL; |
| 760 | } | ||
| 750 | 761 | ||
| 751 | /* pci_mmap_page_range() expects the same kind of entry as coming | 762 | /* pci_mmap_page_range() expects the same kind of entry as coming |
| 752 | * from /proc/bus/pci/ which is a "user visible" value. If this is | 763 | * from /proc/bus/pci/ which is a "user visible" value. If this is |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e98c8104297b..710c8a29be0d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -1007,6 +1007,18 @@ static int __pci_enable_device_flags(struct pci_dev *dev, | |||
| 1007 | int err; | 1007 | int err; |
| 1008 | int i, bars = 0; | 1008 | int i, bars = 0; |
| 1009 | 1009 | ||
| 1010 | /* | ||
| 1011 | * Power state could be unknown at this point, either due to a fresh | ||
| 1012 | * boot or a device removal call. So get the current power state | ||
| 1013 | * so that things like MSI message writing will behave as expected | ||
| 1014 | * (e.g. if the device really is in D0 at enable time). | ||
| 1015 | */ | ||
| 1016 | if (dev->pm_cap) { | ||
| 1017 | u16 pmcsr; | ||
| 1018 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); | ||
| 1019 | dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); | ||
| 1020 | } | ||
| 1021 | |||
| 1010 | if (atomic_add_return(1, &dev->enable_cnt) > 1) | 1022 | if (atomic_add_return(1, &dev->enable_cnt) > 1) |
| 1011 | return 0; /* already enabled */ | 1023 | return 0; /* already enabled */ |
| 1012 | 1024 | ||
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index f5c7c382765f..7d33f6673868 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -22,8 +22,13 @@ extern void pci_remove_firmware_label_files(struct pci_dev *pdev); | |||
| 22 | #endif | 22 | #endif |
| 23 | extern void pci_cleanup_rom(struct pci_dev *dev); | 23 | extern void pci_cleanup_rom(struct pci_dev *dev); |
| 24 | #ifdef HAVE_PCI_MMAP | 24 | #ifdef HAVE_PCI_MMAP |
| 25 | enum pci_mmap_api { | ||
| 26 | PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ | ||
| 27 | PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ | ||
| 28 | }; | ||
| 25 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, | 29 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, |
| 26 | struct vm_area_struct *vma); | 30 | struct vm_area_struct *vmai, |
| 31 | enum pci_mmap_api mmap_api); | ||
| 27 | #endif | 32 | #endif |
| 28 | int pci_probe_reset_function(struct pci_dev *dev); | 33 | int pci_probe_reset_function(struct pci_dev *dev); |
| 29 | 34 | ||
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 297b72c880a1..ea00647f4732 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
| @@ -257,7 +257,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 257 | 257 | ||
| 258 | /* Make sure the caller is mapping a real resource for this device */ | 258 | /* Make sure the caller is mapping a real resource for this device */ |
| 259 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { | 259 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { |
| 260 | if (pci_mmap_fits(dev, i, vma)) | 260 | if (pci_mmap_fits(dev, i, vma, PCI_MMAP_PROCFS)) |
| 261 | break; | 261 | break; |
| 262 | } | 262 | } |
| 263 | 263 | ||
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 5efbd5990ff8..06e41ed93230 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
| @@ -761,7 +761,7 @@ err_unmap: | |||
| 761 | clk_put(rtc->clk); | 761 | clk_put(rtc->clk); |
| 762 | iounmap(rtc->regbase); | 762 | iounmap(rtc->regbase); |
| 763 | err_badmap: | 763 | err_badmap: |
| 764 | release_resource(rtc->res); | 764 | release_mem_region(rtc->res->start, rtc->regsize); |
| 765 | err_badres: | 765 | err_badres: |
| 766 | kfree(rtc); | 766 | kfree(rtc); |
| 767 | 767 | ||
| @@ -786,7 +786,7 @@ static int __exit sh_rtc_remove(struct platform_device *pdev) | |||
| 786 | } | 786 | } |
| 787 | 787 | ||
| 788 | iounmap(rtc->regbase); | 788 | iounmap(rtc->regbase); |
| 789 | release_resource(rtc->res); | 789 | release_mem_region(rtc->res->start, rtc->regsize); |
| 790 | 790 | ||
| 791 | clk_disable(rtc->clk); | 791 | clk_disable(rtc->clk); |
| 792 | clk_put(rtc->clk); | 792 | clk_put(rtc->clk); |
diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c index 09615b51d591..cb12a8e1466b 100644 --- a/drivers/sh/clk/core.c +++ b/drivers/sh/clk/core.c | |||
| @@ -571,7 +571,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, | |||
| 571 | *best_freq = freq_max; | 571 | *best_freq = freq_max; |
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | pr_debug("too low freq %lu, error %lu\n", freq->frequency, | 574 | pr_debug("too low freq %u, error %lu\n", freq->frequency, |
| 575 | target - freq_max); | 575 | target - freq_max); |
| 576 | 576 | ||
| 577 | if (!error) | 577 | if (!error) |
| @@ -591,7 +591,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, | |||
| 591 | *best_freq = freq_min; | 591 | *best_freq = freq_min; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | pr_debug("too high freq %lu, error %lu\n", freq->frequency, | 594 | pr_debug("too high freq %u, error %lu\n", freq->frequency, |
| 595 | freq_min - target); | 595 | freq_min - target); |
| 596 | 596 | ||
| 597 | if (!error) | 597 | if (!error) |
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index e5bf5d3c698e..4e0ff7181164 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c | |||
| @@ -215,7 +215,7 @@ restart: | |||
| 215 | entry = radix_tree_deref_slot((void **)entries[i]); | 215 | entry = radix_tree_deref_slot((void **)entries[i]); |
| 216 | if (unlikely(!entry)) | 216 | if (unlikely(!entry)) |
| 217 | continue; | 217 | continue; |
| 218 | if (unlikely(entry == RADIX_TREE_RETRY)) | 218 | if (radix_tree_deref_retry(entry)) |
| 219 | goto restart; | 219 | goto restart; |
| 220 | 220 | ||
| 221 | irq = create_irq(); | 221 | irq = create_irq(); |
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 75aa7a36307d..4ca45ec7fd84 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/console.h> | 17 | #include <linux/console.h> |
| 18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/i2c-id.h> | ||
| 21 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
| 22 | #include <linux/pci_ids.h> | 21 | #include <linux/pci_ids.h> |
| 23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
| @@ -733,7 +732,6 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 733 | edev: | 732 | edev: |
| 734 | platform_device_unregister(dcon_device); | 733 | platform_device_unregister(dcon_device); |
| 735 | dcon_device = NULL; | 734 | dcon_device = NULL; |
| 736 | i2c_set_clientdata(client, NULL); | ||
| 737 | eirq: | 735 | eirq: |
| 738 | free_irq(DCON_IRQ, &dcon_driver); | 736 | free_irq(DCON_IRQ, &dcon_driver); |
| 739 | einit: | 737 | einit: |
| @@ -757,8 +755,6 @@ static int dcon_remove(struct i2c_client *client) | |||
| 757 | platform_device_unregister(dcon_device); | 755 | platform_device_unregister(dcon_device); |
| 758 | cancel_work_sync(&dcon_work); | 756 | cancel_work_sync(&dcon_work); |
| 759 | 757 | ||
| 760 | i2c_set_clientdata(client, NULL); | ||
| 761 | |||
| 762 | return 0; | 758 | return 0; |
| 763 | } | 759 | } |
| 764 | 760 | ||
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index fed2a72bc6b6..2fd7e5271be9 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
| @@ -554,9 +554,15 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
| 554 | size = PAGE_ALIGN(size); | 554 | size = PAGE_ALIGN(size); |
| 555 | 555 | ||
| 556 | if (paddr) { | 556 | if (paddr) { |
| 557 | if ((paddr & ~PAGE_MASK) || | 557 | if (paddr & ~PAGE_MASK) { |
| 558 | !memblock_is_region_memory(paddr, size)) { | 558 | pr_err("VRAM start address 0x%08x not page aligned\n", |
| 559 | pr_err("Illegal SDRAM region for VRAM\n"); | 559 | paddr); |
| 560 | return; | ||
| 561 | } | ||
| 562 | |||
| 563 | if (!memblock_is_region_memory(paddr, size)) { | ||
| 564 | pr_err("Illegal SDRAM region 0x%08x..0x%08x for VRAM\n", | ||
| 565 | paddr, paddr + size - 1); | ||
| 560 | return; | 566 | return; |
| 561 | } | 567 | } |
| 562 | 568 | ||
| @@ -570,9 +576,12 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
| 570 | return; | 576 | return; |
| 571 | } | 577 | } |
| 572 | } else { | 578 | } else { |
| 573 | paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT); | 579 | paddr = memblock_alloc(size, PAGE_SIZE); |
| 574 | } | 580 | } |
| 575 | 581 | ||
| 582 | memblock_free(paddr, size); | ||
| 583 | memblock_remove(paddr, size); | ||
| 584 | |||
| 576 | omap_vram_add_region(paddr, size); | 585 | omap_vram_add_region(paddr, size); |
| 577 | 586 | ||
| 578 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); | 587 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); |
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c index a0e22ac483a3..167400e2a182 100644 --- a/drivers/video/riva/rivafb-i2c.c +++ b/drivers/video/riva/rivafb-i2c.c | |||
| @@ -94,7 +94,6 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan, | |||
| 94 | 94 | ||
| 95 | strcpy(chan->adapter.name, name); | 95 | strcpy(chan->adapter.name, name); |
| 96 | chan->adapter.owner = THIS_MODULE; | 96 | chan->adapter.owner = THIS_MODULE; |
| 97 | chan->adapter.id = I2C_HW_B_RIVA; | ||
| 98 | chan->adapter.class = i2c_class; | 97 | chan->adapter.class = i2c_class; |
| 99 | chan->adapter.algo_data = &chan->algo; | 98 | chan->adapter.algo_data = &chan->algo; |
| 100 | chan->adapter.dev.parent = &chan->par->pdev->dev; | 99 | chan->adapter.dev.parent = &chan->par->pdev->dev; |
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 55b3077ff6ff..d7df10315d8d 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
| @@ -1071,6 +1071,10 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1071 | if (!hdmi->info) | 1071 | if (!hdmi->info) |
| 1072 | goto out; | 1072 | goto out; |
| 1073 | 1073 | ||
| 1074 | hdmi->monspec.modedb_len = 0; | ||
| 1075 | fb_destroy_modedb(hdmi->monspec.modedb); | ||
| 1076 | hdmi->monspec.modedb = NULL; | ||
| 1077 | |||
| 1074 | acquire_console_sem(); | 1078 | acquire_console_sem(); |
| 1075 | 1079 | ||
| 1076 | /* HDMI disconnect */ | 1080 | /* HDMI disconnect */ |
| @@ -1078,7 +1082,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1078 | 1082 | ||
| 1079 | release_console_sem(); | 1083 | release_console_sem(); |
| 1080 | pm_runtime_put(hdmi->dev); | 1084 | pm_runtime_put(hdmi->dev); |
| 1081 | fb_destroy_modedb(hdmi->monspec.modedb); | ||
| 1082 | } | 1085 | } |
| 1083 | 1086 | ||
| 1084 | out: | 1087 | out: |
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 50963739a409..9b1364723c65 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
| @@ -115,15 +115,16 @@ static const struct fb_videomode default_720p = { | |||
| 115 | .xres = 1280, | 115 | .xres = 1280, |
| 116 | .yres = 720, | 116 | .yres = 720, |
| 117 | 117 | ||
| 118 | .left_margin = 200, | 118 | .left_margin = 220, |
| 119 | .right_margin = 88, | 119 | .right_margin = 110, |
| 120 | .hsync_len = 48, | 120 | .hsync_len = 40, |
| 121 | 121 | ||
| 122 | .upper_margin = 20, | 122 | .upper_margin = 20, |
| 123 | .lower_margin = 5, | 123 | .lower_margin = 5, |
| 124 | .vsync_len = 5, | 124 | .vsync_len = 5, |
| 125 | 125 | ||
| 126 | .pixclock = 13468, | 126 | .pixclock = 13468, |
| 127 | .refresh = 60, | ||
| 127 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, | 128 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, |
| 128 | }; | 129 | }; |
| 129 | 130 | ||
| @@ -1197,6 +1198,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1197 | const struct fb_videomode *mode = cfg->lcd_cfg; | 1198 | const struct fb_videomode *mode = cfg->lcd_cfg; |
| 1198 | unsigned long max_size = 0; | 1199 | unsigned long max_size = 0; |
| 1199 | int k; | 1200 | int k; |
| 1201 | int num_cfg; | ||
| 1200 | 1202 | ||
| 1201 | ch->info = framebuffer_alloc(0, &pdev->dev); | 1203 | ch->info = framebuffer_alloc(0, &pdev->dev); |
| 1202 | if (!ch->info) { | 1204 | if (!ch->info) { |
| @@ -1232,8 +1234,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1232 | info->fix = sh_mobile_lcdc_fix; | 1234 | info->fix = sh_mobile_lcdc_fix; |
| 1233 | info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; | 1235 | info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; |
| 1234 | 1236 | ||
| 1235 | if (!mode) | 1237 | if (!mode) { |
| 1236 | mode = &default_720p; | 1238 | mode = &default_720p; |
| 1239 | num_cfg = 1; | ||
| 1240 | } else { | ||
| 1241 | num_cfg = ch->cfg.num_cfg; | ||
| 1242 | } | ||
| 1243 | |||
| 1244 | fb_videomode_to_modelist(mode, num_cfg, &info->modelist); | ||
| 1237 | 1245 | ||
| 1238 | fb_videomode_to_var(var, mode); | 1246 | fb_videomode_to_var(var, mode); |
| 1239 | /* Default Y virtual resolution is 2x panel size */ | 1247 | /* Default Y virtual resolution is 2x panel size */ |
| @@ -1281,10 +1289,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1281 | 1289 | ||
| 1282 | for (i = 0; i < j; i++) { | 1290 | for (i = 0; i < j; i++) { |
| 1283 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; | 1291 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; |
| 1284 | const struct fb_videomode *mode = ch->cfg.lcd_cfg; | ||
| 1285 | |||
| 1286 | if (!mode) | ||
| 1287 | mode = &default_720p; | ||
| 1288 | 1292 | ||
| 1289 | info = ch->info; | 1293 | info = ch->info; |
| 1290 | 1294 | ||
| @@ -1297,7 +1301,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1297 | } | 1301 | } |
| 1298 | } | 1302 | } |
| 1299 | 1303 | ||
| 1300 | fb_videomode_to_modelist(mode, ch->cfg.num_cfg, &info->modelist); | ||
| 1301 | error = register_framebuffer(info); | 1304 | error = register_framebuffer(info); |
| 1302 | if (error < 0) | 1305 | if (error < 0) |
| 1303 | goto err1; | 1306 | goto err1; |
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index b52f8e4ef1fd..3dde12b0ab06 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
| @@ -4181,6 +4181,9 @@ static void __devinit | |||
| 4181 | sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize, | 4181 | sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize, |
| 4182 | unsigned int min) | 4182 | unsigned int min) |
| 4183 | { | 4183 | { |
| 4184 | if (*mapsize < (min << 20)) | ||
| 4185 | return; | ||
| 4186 | |||
| 4184 | ivideo->video_vbase = ioremap(ivideo->video_base, (*mapsize)); | 4187 | ivideo->video_vbase = ioremap(ivideo->video_base, (*mapsize)); |
| 4185 | 4188 | ||
| 4186 | if(!ivideo->video_vbase) { | 4189 | if(!ivideo->video_vbase) { |
| @@ -4514,7 +4517,7 @@ sisfb_post_sis300(struct pci_dev *pdev) | |||
| 4514 | } else { | 4517 | } else { |
| 4515 | #endif | 4518 | #endif |
| 4516 | /* Need to map max FB size for finding out about RAM size */ | 4519 | /* Need to map max FB size for finding out about RAM size */ |
| 4517 | mapsize = 64 << 20; | 4520 | mapsize = ivideo->video_size; |
| 4518 | sisfb_post_map_vram(ivideo, &mapsize, 4); | 4521 | sisfb_post_map_vram(ivideo, &mapsize, 4); |
| 4519 | 4522 | ||
| 4520 | if(ivideo->video_vbase) { | 4523 | if(ivideo->video_vbase) { |
| @@ -4680,7 +4683,7 @@ sisfb_post_xgi_ramsize(struct sis_video_info *ivideo) | |||
| 4680 | orSISIDXREG(SISSR, 0x20, (0x80 | 0x04)); | 4683 | orSISIDXREG(SISSR, 0x20, (0x80 | 0x04)); |
| 4681 | 4684 | ||
| 4682 | /* Need to map max FB size for finding out about RAM size */ | 4685 | /* Need to map max FB size for finding out about RAM size */ |
| 4683 | mapsize = 256 << 20; | 4686 | mapsize = ivideo->video_size; |
| 4684 | sisfb_post_map_vram(ivideo, &mapsize, 32); | 4687 | sisfb_post_map_vram(ivideo, &mapsize, 32); |
| 4685 | 4688 | ||
| 4686 | if(!ivideo->video_vbase) { | 4689 | if(!ivideo->video_vbase) { |
| @@ -5936,6 +5939,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 5936 | } | 5939 | } |
| 5937 | 5940 | ||
| 5938 | ivideo->video_base = pci_resource_start(pdev, 0); | 5941 | ivideo->video_base = pci_resource_start(pdev, 0); |
| 5942 | ivideo->video_size = pci_resource_len(pdev, 0); | ||
| 5939 | ivideo->mmio_base = pci_resource_start(pdev, 1); | 5943 | ivideo->mmio_base = pci_resource_start(pdev, 1); |
| 5940 | ivideo->mmio_size = pci_resource_len(pdev, 1); | 5944 | ivideo->mmio_size = pci_resource_len(pdev, 1); |
| 5941 | ivideo->SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30; | 5945 | ivideo->SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30; |
diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index 06d582732d34..5ab3839dfcb9 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c | |||
| @@ -138,10 +138,8 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, | |||
| 138 | struct gfs2_inum_host *inum) | 138 | struct gfs2_inum_host *inum) |
| 139 | { | 139 | { |
| 140 | struct gfs2_sbd *sdp = sb->s_fs_info; | 140 | struct gfs2_sbd *sdp = sb->s_fs_info; |
| 141 | struct gfs2_holder i_gh; | ||
| 142 | struct inode *inode; | 141 | struct inode *inode; |
| 143 | struct dentry *dentry; | 142 | struct dentry *dentry; |
| 144 | int error; | ||
| 145 | 143 | ||
| 146 | inode = gfs2_ilookup(sb, inum->no_addr); | 144 | inode = gfs2_ilookup(sb, inum->no_addr); |
| 147 | if (inode) { | 145 | if (inode) { |
| @@ -152,52 +150,16 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, | |||
| 152 | goto out_inode; | 150 | goto out_inode; |
| 153 | } | 151 | } |
| 154 | 152 | ||
| 155 | error = gfs2_glock_nq_num(sdp, inum->no_addr, &gfs2_inode_glops, | 153 | inode = gfs2_lookup_by_inum(sdp, inum->no_addr, &inum->no_formal_ino, |
| 156 | LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | 154 | GFS2_BLKST_DINODE); |
| 157 | if (error) | 155 | if (IS_ERR(inode)) |
| 158 | return ERR_PTR(error); | 156 | return ERR_CAST(inode); |
| 159 | |||
| 160 | error = gfs2_check_blk_type(sdp, inum->no_addr, GFS2_BLKST_DINODE); | ||
| 161 | if (error) | ||
| 162 | goto fail; | ||
| 163 | |||
| 164 | inode = gfs2_inode_lookup(sb, DT_UNKNOWN, inum->no_addr, 0); | ||
| 165 | if (IS_ERR(inode)) { | ||
| 166 | error = PTR_ERR(inode); | ||
| 167 | goto fail; | ||
| 168 | } | ||
| 169 | |||
| 170 | error = gfs2_inode_refresh(GFS2_I(inode)); | ||
| 171 | if (error) { | ||
| 172 | iput(inode); | ||
| 173 | goto fail; | ||
| 174 | } | ||
| 175 | |||
| 176 | /* Pick up the works we bypass in gfs2_inode_lookup */ | ||
| 177 | if (inode->i_state & I_NEW) | ||
| 178 | gfs2_set_iop(inode); | ||
| 179 | |||
| 180 | if (GFS2_I(inode)->i_no_formal_ino != inum->no_formal_ino) { | ||
| 181 | iput(inode); | ||
| 182 | goto fail; | ||
| 183 | } | ||
| 184 | |||
| 185 | error = -EIO; | ||
| 186 | if (GFS2_I(inode)->i_diskflags & GFS2_DIF_SYSTEM) { | ||
| 187 | iput(inode); | ||
| 188 | goto fail; | ||
| 189 | } | ||
| 190 | |||
| 191 | gfs2_glock_dq_uninit(&i_gh); | ||
| 192 | 157 | ||
| 193 | out_inode: | 158 | out_inode: |
| 194 | dentry = d_obtain_alias(inode); | 159 | dentry = d_obtain_alias(inode); |
| 195 | if (!IS_ERR(dentry)) | 160 | if (!IS_ERR(dentry)) |
| 196 | dentry->d_op = &gfs2_dops; | 161 | dentry->d_op = &gfs2_dops; |
| 197 | return dentry; | 162 | return dentry; |
| 198 | fail: | ||
| 199 | gfs2_glock_dq_uninit(&i_gh); | ||
| 200 | return ERR_PTR(error); | ||
| 201 | } | 163 | } |
| 202 | 164 | ||
| 203 | static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid, | 165 | static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid, |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 87778857f099..f92c17704169 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
| @@ -686,21 +686,20 @@ static void delete_work_func(struct work_struct *work) | |||
| 686 | { | 686 | { |
| 687 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); | 687 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); |
| 688 | struct gfs2_sbd *sdp = gl->gl_sbd; | 688 | struct gfs2_sbd *sdp = gl->gl_sbd; |
| 689 | struct gfs2_inode *ip = NULL; | 689 | struct gfs2_inode *ip; |
| 690 | struct inode *inode; | 690 | struct inode *inode; |
| 691 | u64 no_addr = 0; | 691 | u64 no_addr = gl->gl_name.ln_number; |
| 692 | |||
| 693 | ip = gl->gl_object; | ||
| 694 | /* Note: Unsafe to dereference ip as we don't hold right refs/locks */ | ||
| 692 | 695 | ||
| 693 | spin_lock(&gl->gl_spin); | ||
| 694 | ip = (struct gfs2_inode *)gl->gl_object; | ||
| 695 | if (ip) | 696 | if (ip) |
| 696 | no_addr = ip->i_no_addr; | ||
| 697 | spin_unlock(&gl->gl_spin); | ||
| 698 | if (ip) { | ||
| 699 | inode = gfs2_ilookup(sdp->sd_vfs, no_addr); | 697 | inode = gfs2_ilookup(sdp->sd_vfs, no_addr); |
| 700 | if (inode) { | 698 | else |
| 701 | d_prune_aliases(inode); | 699 | inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED); |
| 702 | iput(inode); | 700 | if (inode && !IS_ERR(inode)) { |
| 703 | } | 701 | d_prune_aliases(inode); |
| 702 | iput(inode); | ||
| 704 | } | 703 | } |
| 705 | gfs2_glock_put(gl); | 704 | gfs2_glock_put(gl); |
| 706 | } | 705 | } |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 06370f8bd8cf..e1213f7f9217 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
| @@ -73,49 +73,6 @@ static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) | |||
| 73 | return iget5_locked(sb, hash, iget_test, iget_set, &no_addr); | 73 | return iget5_locked(sb, hash, iget_test, iget_set, &no_addr); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | struct gfs2_skip_data { | ||
| 77 | u64 no_addr; | ||
| 78 | int skipped; | ||
| 79 | }; | ||
| 80 | |||
| 81 | static int iget_skip_test(struct inode *inode, void *opaque) | ||
| 82 | { | ||
| 83 | struct gfs2_inode *ip = GFS2_I(inode); | ||
| 84 | struct gfs2_skip_data *data = opaque; | ||
| 85 | |||
| 86 | if (ip->i_no_addr == data->no_addr) { | ||
| 87 | if (inode->i_state & (I_FREEING|I_WILL_FREE)){ | ||
| 88 | data->skipped = 1; | ||
| 89 | return 0; | ||
| 90 | } | ||
| 91 | return 1; | ||
| 92 | } | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | |||
| 96 | static int iget_skip_set(struct inode *inode, void *opaque) | ||
| 97 | { | ||
| 98 | struct gfs2_inode *ip = GFS2_I(inode); | ||
| 99 | struct gfs2_skip_data *data = opaque; | ||
| 100 | |||
| 101 | if (data->skipped) | ||
| 102 | return 1; | ||
| 103 | inode->i_ino = (unsigned long)(data->no_addr); | ||
| 104 | ip->i_no_addr = data->no_addr; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | static struct inode *gfs2_iget_skip(struct super_block *sb, | ||
| 109 | u64 no_addr) | ||
| 110 | { | ||
| 111 | struct gfs2_skip_data data; | ||
| 112 | unsigned long hash = (unsigned long)no_addr; | ||
| 113 | |||
| 114 | data.no_addr = no_addr; | ||
| 115 | data.skipped = 0; | ||
| 116 | return iget5_locked(sb, hash, iget_skip_test, iget_skip_set, &data); | ||
| 117 | } | ||
| 118 | |||
| 119 | /** | 76 | /** |
| 120 | * GFS2 lookup code fills in vfs inode contents based on info obtained | 77 | * GFS2 lookup code fills in vfs inode contents based on info obtained |
| 121 | * from directory entry inside gfs2_inode_lookup(). This has caused issues | 78 | * from directory entry inside gfs2_inode_lookup(). This has caused issues |
| @@ -243,93 +200,54 @@ fail: | |||
| 243 | return ERR_PTR(error); | 200 | return ERR_PTR(error); |
| 244 | } | 201 | } |
| 245 | 202 | ||
| 246 | /** | 203 | struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
| 247 | * gfs2_process_unlinked_inode - Lookup an unlinked inode for reclamation | 204 | u64 *no_formal_ino, unsigned int blktype) |
| 248 | * and try to reclaim it by doing iput. | ||
| 249 | * | ||
| 250 | * This function assumes no rgrp locks are currently held. | ||
| 251 | * | ||
| 252 | * @sb: The super block | ||
| 253 | * no_addr: The inode number | ||
| 254 | * | ||
| 255 | */ | ||
| 256 | |||
| 257 | void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | ||
| 258 | { | 205 | { |
| 259 | struct gfs2_sbd *sdp; | 206 | struct super_block *sb = sdp->sd_vfs; |
| 260 | struct gfs2_inode *ip; | 207 | struct gfs2_holder i_gh; |
| 261 | struct gfs2_glock *io_gl = NULL; | ||
| 262 | int error; | ||
| 263 | struct gfs2_holder gh; | ||
| 264 | struct inode *inode; | 208 | struct inode *inode; |
| 209 | int error; | ||
| 265 | 210 | ||
| 266 | inode = gfs2_iget_skip(sb, no_addr); | 211 | error = gfs2_glock_nq_num(sdp, no_addr, &gfs2_inode_glops, |
| 267 | 212 | LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | |
| 268 | if (!inode) | 213 | if (error) |
| 269 | return; | 214 | return ERR_PTR(error); |
| 270 | |||
| 271 | /* If it's not a new inode, someone's using it, so leave it alone. */ | ||
| 272 | if (!(inode->i_state & I_NEW)) { | ||
| 273 | iput(inode); | ||
| 274 | return; | ||
| 275 | } | ||
| 276 | |||
| 277 | ip = GFS2_I(inode); | ||
| 278 | sdp = GFS2_SB(inode); | ||
| 279 | ip->i_no_formal_ino = -1; | ||
| 280 | 215 | ||
| 281 | error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl); | 216 | error = gfs2_check_blk_type(sdp, no_addr, blktype); |
| 282 | if (unlikely(error)) | 217 | if (error) |
| 283 | goto fail; | 218 | goto fail; |
| 284 | ip->i_gl->gl_object = ip; | ||
| 285 | 219 | ||
| 286 | error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, &io_gl); | 220 | inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0); |
| 287 | if (unlikely(error)) | 221 | if (IS_ERR(inode)) |
| 288 | goto fail_put; | 222 | goto fail; |
| 289 | |||
| 290 | set_bit(GIF_INVALID, &ip->i_flags); | ||
| 291 | error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, LM_FLAG_TRY | GL_EXACT, | ||
| 292 | &ip->i_iopen_gh); | ||
| 293 | if (unlikely(error)) | ||
| 294 | goto fail_iopen; | ||
| 295 | 223 | ||
| 296 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 224 | error = gfs2_inode_refresh(GFS2_I(inode)); |
| 297 | gfs2_glock_put(io_gl); | 225 | if (error) |
| 298 | io_gl = NULL; | 226 | goto fail_iput; |
| 299 | 227 | ||
| 300 | inode->i_mode = DT2IF(DT_UNKNOWN); | 228 | /* Pick up the works we bypass in gfs2_inode_lookup */ |
| 229 | if (inode->i_state & I_NEW) | ||
| 230 | gfs2_set_iop(inode); | ||
| 301 | 231 | ||
| 302 | /* | 232 | /* Two extra checks for NFS only */ |
| 303 | * We must read the inode in order to work out its type in | 233 | if (no_formal_ino) { |
| 304 | * this case. Note that this doesn't happen often as we normally | 234 | error = -ESTALE; |
| 305 | * know the type beforehand. This code path only occurs during | 235 | if (GFS2_I(inode)->i_no_formal_ino != *no_formal_ino) |
| 306 | * unlinked inode recovery (where it is safe to do this glock, | 236 | goto fail_iput; |
| 307 | * which is not true in the general case). | ||
| 308 | */ | ||
| 309 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, LM_FLAG_TRY, | ||
| 310 | &gh); | ||
| 311 | if (unlikely(error)) | ||
| 312 | goto fail_glock; | ||
| 313 | 237 | ||
| 314 | /* Inode is now uptodate */ | 238 | error = -EIO; |
| 315 | gfs2_glock_dq_uninit(&gh); | 239 | if (GFS2_I(inode)->i_diskflags & GFS2_DIF_SYSTEM) |
| 316 | gfs2_set_iop(inode); | 240 | goto fail_iput; |
| 317 | 241 | ||
| 318 | /* The iput will cause it to be deleted. */ | 242 | error = 0; |
| 319 | iput(inode); | 243 | } |
| 320 | return; | ||
| 321 | 244 | ||
| 322 | fail_glock: | ||
| 323 | gfs2_glock_dq(&ip->i_iopen_gh); | ||
| 324 | fail_iopen: | ||
| 325 | if (io_gl) | ||
| 326 | gfs2_glock_put(io_gl); | ||
| 327 | fail_put: | ||
| 328 | ip->i_gl->gl_object = NULL; | ||
| 329 | gfs2_glock_put(ip->i_gl); | ||
| 330 | fail: | 245 | fail: |
| 331 | iget_failed(inode); | 246 | gfs2_glock_dq_uninit(&i_gh); |
| 332 | return; | 247 | return error ? ERR_PTR(error) : inode; |
| 248 | fail_iput: | ||
| 249 | iput(inode); | ||
| 250 | goto fail; | ||
| 333 | } | 251 | } |
| 334 | 252 | ||
| 335 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | 253 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 6720d7d5fbc6..d8499fadcc53 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
| @@ -99,7 +99,9 @@ err: | |||
| 99 | extern void gfs2_set_iop(struct inode *inode); | 99 | extern void gfs2_set_iop(struct inode *inode); |
| 100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, | 100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, |
| 101 | u64 no_addr, u64 no_formal_ino); | 101 | u64 no_addr, u64 no_formal_ino); |
| 102 | extern void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr); | 102 | extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
| 103 | u64 *no_formal_ino, | ||
| 104 | unsigned int blktype); | ||
| 103 | extern struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr); | 105 | extern struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr); |
| 104 | 106 | ||
| 105 | extern int gfs2_inode_refresh(struct gfs2_inode *ip); | 107 | extern int gfs2_inode_refresh(struct gfs2_inode *ip); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index bef3ab6cf5c1..33c8407b876f 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
| @@ -963,17 +963,18 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al) | |||
| 963 | * The inode, if one has been found, in inode. | 963 | * The inode, if one has been found, in inode. |
| 964 | */ | 964 | */ |
| 965 | 965 | ||
| 966 | static u64 try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, | 966 | static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip) |
| 967 | u64 skip) | ||
| 968 | { | 967 | { |
| 969 | u32 goal = 0, block; | 968 | u32 goal = 0, block; |
| 970 | u64 no_addr; | 969 | u64 no_addr; |
| 971 | struct gfs2_sbd *sdp = rgd->rd_sbd; | 970 | struct gfs2_sbd *sdp = rgd->rd_sbd; |
| 972 | unsigned int n; | 971 | unsigned int n; |
| 972 | struct gfs2_glock *gl; | ||
| 973 | struct gfs2_inode *ip; | ||
| 974 | int error; | ||
| 975 | int found = 0; | ||
| 973 | 976 | ||
| 974 | for(;;) { | 977 | while (goal < rgd->rd_data) { |
| 975 | if (goal >= rgd->rd_data) | ||
| 976 | break; | ||
| 977 | down_write(&sdp->sd_log_flush_lock); | 978 | down_write(&sdp->sd_log_flush_lock); |
| 978 | n = 1; | 979 | n = 1; |
| 979 | block = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED, | 980 | block = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED, |
| @@ -990,11 +991,32 @@ static u64 try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, | |||
| 990 | if (no_addr == skip) | 991 | if (no_addr == skip) |
| 991 | continue; | 992 | continue; |
| 992 | *last_unlinked = no_addr; | 993 | *last_unlinked = no_addr; |
| 993 | return no_addr; | 994 | |
| 995 | error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &gl); | ||
| 996 | if (error) | ||
| 997 | continue; | ||
| 998 | |||
| 999 | /* If the inode is already in cache, we can ignore it here | ||
| 1000 | * because the existing inode disposal code will deal with | ||
| 1001 | * it when all refs have gone away. Accessing gl_object like | ||
| 1002 | * this is not safe in general. Here it is ok because we do | ||
| 1003 | * not dereference the pointer, and we only need an approx | ||
| 1004 | * answer to whether it is NULL or not. | ||
| 1005 | */ | ||
| 1006 | ip = gl->gl_object; | ||
| 1007 | |||
| 1008 | if (ip || queue_work(gfs2_delete_workqueue, &gl->gl_delete) == 0) | ||
| 1009 | gfs2_glock_put(gl); | ||
| 1010 | else | ||
| 1011 | found++; | ||
| 1012 | |||
| 1013 | /* Limit reclaim to sensible number of tasks */ | ||
| 1014 | if (found > 2*NR_CPUS) | ||
| 1015 | return; | ||
| 994 | } | 1016 | } |
| 995 | 1017 | ||
| 996 | rgd->rd_flags &= ~GFS2_RDF_CHECK; | 1018 | rgd->rd_flags &= ~GFS2_RDF_CHECK; |
| 997 | return 0; | 1019 | return; |
| 998 | } | 1020 | } |
| 999 | 1021 | ||
| 1000 | /** | 1022 | /** |
| @@ -1075,11 +1097,9 @@ static void forward_rgrp_set(struct gfs2_sbd *sdp, struct gfs2_rgrpd *rgd) | |||
| 1075 | * Try to acquire rgrp in way which avoids contending with others. | 1097 | * Try to acquire rgrp in way which avoids contending with others. |
| 1076 | * | 1098 | * |
| 1077 | * Returns: errno | 1099 | * Returns: errno |
| 1078 | * unlinked: the block address of an unlinked block to be reclaimed | ||
| 1079 | */ | 1100 | */ |
| 1080 | 1101 | ||
| 1081 | static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | 1102 | static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) |
| 1082 | u64 *last_unlinked) | ||
| 1083 | { | 1103 | { |
| 1084 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1104 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 1085 | struct gfs2_rgrpd *rgd, *begin = NULL; | 1105 | struct gfs2_rgrpd *rgd, *begin = NULL; |
| @@ -1089,7 +1109,6 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1089 | int loops = 0; | 1109 | int loops = 0; |
| 1090 | int error, rg_locked; | 1110 | int error, rg_locked; |
| 1091 | 1111 | ||
| 1092 | *unlinked = 0; | ||
| 1093 | rgd = gfs2_blk2rgrpd(sdp, ip->i_goal); | 1112 | rgd = gfs2_blk2rgrpd(sdp, ip->i_goal); |
| 1094 | 1113 | ||
| 1095 | while (rgd) { | 1114 | while (rgd) { |
| @@ -1106,17 +1125,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1106 | case 0: | 1125 | case 0: |
| 1107 | if (try_rgrp_fit(rgd, al)) | 1126 | if (try_rgrp_fit(rgd, al)) |
| 1108 | goto out; | 1127 | goto out; |
| 1109 | /* If the rg came in already locked, there's no | 1128 | if (rgd->rd_flags & GFS2_RDF_CHECK) |
| 1110 | way we can recover from a failed try_rgrp_unlink | 1129 | try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr); |
| 1111 | because that would require an iput which can only | ||
| 1112 | happen after the rgrp is unlocked. */ | ||
| 1113 | if (!rg_locked && rgd->rd_flags & GFS2_RDF_CHECK) | ||
| 1114 | *unlinked = try_rgrp_unlink(rgd, last_unlinked, | ||
| 1115 | ip->i_no_addr); | ||
| 1116 | if (!rg_locked) | 1130 | if (!rg_locked) |
| 1117 | gfs2_glock_dq_uninit(&al->al_rgd_gh); | 1131 | gfs2_glock_dq_uninit(&al->al_rgd_gh); |
| 1118 | if (*unlinked) | ||
| 1119 | return -EAGAIN; | ||
| 1120 | /* fall through */ | 1132 | /* fall through */ |
| 1121 | case GLR_TRYFAILED: | 1133 | case GLR_TRYFAILED: |
| 1122 | rgd = recent_rgrp_next(rgd); | 1134 | rgd = recent_rgrp_next(rgd); |
| @@ -1145,13 +1157,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1145 | case 0: | 1157 | case 0: |
| 1146 | if (try_rgrp_fit(rgd, al)) | 1158 | if (try_rgrp_fit(rgd, al)) |
| 1147 | goto out; | 1159 | goto out; |
| 1148 | if (!rg_locked && rgd->rd_flags & GFS2_RDF_CHECK) | 1160 | if (rgd->rd_flags & GFS2_RDF_CHECK) |
| 1149 | *unlinked = try_rgrp_unlink(rgd, last_unlinked, | 1161 | try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr); |
| 1150 | ip->i_no_addr); | ||
| 1151 | if (!rg_locked) | 1162 | if (!rg_locked) |
| 1152 | gfs2_glock_dq_uninit(&al->al_rgd_gh); | 1163 | gfs2_glock_dq_uninit(&al->al_rgd_gh); |
| 1153 | if (*unlinked) | ||
| 1154 | return -EAGAIN; | ||
| 1155 | break; | 1164 | break; |
| 1156 | 1165 | ||
| 1157 | case GLR_TRYFAILED: | 1166 | case GLR_TRYFAILED: |
| @@ -1204,12 +1213,12 @@ int gfs2_inplace_reserve_i(struct gfs2_inode *ip, int hold_rindex, | |||
| 1204 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1213 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 1205 | struct gfs2_alloc *al = ip->i_alloc; | 1214 | struct gfs2_alloc *al = ip->i_alloc; |
| 1206 | int error = 0; | 1215 | int error = 0; |
| 1207 | u64 last_unlinked = NO_BLOCK, unlinked; | 1216 | u64 last_unlinked = NO_BLOCK; |
| 1217 | int tries = 0; | ||
| 1208 | 1218 | ||
| 1209 | if (gfs2_assert_warn(sdp, al->al_requested)) | 1219 | if (gfs2_assert_warn(sdp, al->al_requested)) |
| 1210 | return -EINVAL; | 1220 | return -EINVAL; |
| 1211 | 1221 | ||
| 1212 | try_again: | ||
| 1213 | if (hold_rindex) { | 1222 | if (hold_rindex) { |
| 1214 | /* We need to hold the rindex unless the inode we're using is | 1223 | /* We need to hold the rindex unless the inode we're using is |
| 1215 | the rindex itself, in which case it's already held. */ | 1224 | the rindex itself, in which case it's already held. */ |
| @@ -1218,31 +1227,23 @@ try_again: | |||
| 1218 | else if (!sdp->sd_rgrps) /* We may not have the rindex read | 1227 | else if (!sdp->sd_rgrps) /* We may not have the rindex read |
| 1219 | in, so: */ | 1228 | in, so: */ |
| 1220 | error = gfs2_ri_update_special(ip); | 1229 | error = gfs2_ri_update_special(ip); |
| 1230 | if (error) | ||
| 1231 | return error; | ||
| 1221 | } | 1232 | } |
| 1222 | 1233 | ||
| 1223 | if (error) | 1234 | do { |
| 1224 | return error; | 1235 | error = get_local_rgrp(ip, &last_unlinked); |
| 1236 | /* If there is no space, flushing the log may release some */ | ||
| 1237 | if (error) | ||
| 1238 | gfs2_log_flush(sdp, NULL); | ||
| 1239 | } while (error && tries++ < 3); | ||
| 1225 | 1240 | ||
| 1226 | /* Find an rgrp suitable for allocation. If it encounters any unlinked | ||
| 1227 | dinodes along the way, error will equal -EAGAIN and unlinked will | ||
| 1228 | contains it block address. We then need to look up that inode and | ||
| 1229 | try to free it, and try the allocation again. */ | ||
| 1230 | error = get_local_rgrp(ip, &unlinked, &last_unlinked); | ||
| 1231 | if (error) { | 1241 | if (error) { |
| 1232 | if (hold_rindex && ip != GFS2_I(sdp->sd_rindex)) | 1242 | if (hold_rindex && ip != GFS2_I(sdp->sd_rindex)) |
| 1233 | gfs2_glock_dq_uninit(&al->al_ri_gh); | 1243 | gfs2_glock_dq_uninit(&al->al_ri_gh); |
| 1234 | if (error != -EAGAIN) | 1244 | return error; |
| 1235 | return error; | ||
| 1236 | |||
| 1237 | gfs2_process_unlinked_inode(ip->i_inode.i_sb, unlinked); | ||
| 1238 | /* regardless of whether or not gfs2_process_unlinked_inode | ||
| 1239 | was successful, we don't want to repeat it again. */ | ||
| 1240 | last_unlinked = unlinked; | ||
| 1241 | gfs2_log_flush(sdp, NULL); | ||
| 1242 | error = 0; | ||
| 1243 | |||
| 1244 | goto try_again; | ||
| 1245 | } | 1245 | } |
| 1246 | |||
| 1246 | /* no error, so we have the rgrp set in the inode's allocation. */ | 1247 | /* no error, so we have the rgrp set in the inode's allocation. */ |
| 1247 | al->al_file = file; | 1248 | al->al_file = file; |
| 1248 | al->al_line = line; | 1249 | al->al_line = line; |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index d8408217e3bd..1efea3615589 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
| @@ -159,7 +159,9 @@ struct ocfs2_lock_res { | |||
| 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; | 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; |
| 160 | unsigned int l_ro_holders; | 160 | unsigned int l_ro_holders; |
| 161 | unsigned int l_ex_holders; | 161 | unsigned int l_ex_holders; |
| 162 | unsigned char l_level; | 162 | char l_level; |
| 163 | char l_requested; | ||
| 164 | char l_blocking; | ||
| 163 | 165 | ||
| 164 | /* Data packed - type enum ocfs2_lock_type */ | 166 | /* Data packed - type enum ocfs2_lock_type */ |
| 165 | unsigned char l_type; | 167 | unsigned char l_type; |
| @@ -169,8 +171,6 @@ struct ocfs2_lock_res { | |||
| 169 | unsigned char l_action; | 171 | unsigned char l_action; |
| 170 | /* Data packed - enum type ocfs2_unlock_action */ | 172 | /* Data packed - enum type ocfs2_unlock_action */ |
| 171 | unsigned char l_unlock_action; | 173 | unsigned char l_unlock_action; |
| 172 | unsigned char l_requested; | ||
| 173 | unsigned char l_blocking; | ||
| 174 | unsigned int l_pending_gen; | 174 | unsigned int l_pending_gen; |
| 175 | 175 | ||
| 176 | spinlock_t l_lock; | 176 | spinlock_t l_lock; |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index fc295d7ea463..781d4671415f 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -54,7 +54,6 @@ struct aoi_display_offset { | |||
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
| 57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
| 58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 57 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
| 59 | 58 | ||
| 60 | #define MFB_SET_ALPHA 0x80014d00 | 59 | #define MFB_SET_ALPHA 0x80014d00 |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index e844a0b18695..4bef5c557160 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -32,28 +32,6 @@ | |||
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | /* --- Bit algorithm adapters */ | 34 | /* --- Bit algorithm adapters */ |
| 35 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | ||
| 36 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | ||
| 37 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | ||
| 38 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ | 35 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ |
| 39 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | ||
| 40 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
| 41 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | ||
| 42 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | ||
| 43 | #define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | ||
| 44 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | ||
| 45 | |||
| 46 | /* --- SGI adapters */ | ||
| 47 | #define I2C_HW_SGI_VINO 0x160000 | ||
| 48 | |||
| 49 | /* --- SMBus only adapters */ | ||
| 50 | #define I2C_HW_SMBUS_W9968CF 0x04000d | ||
| 51 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | ||
| 52 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | ||
| 53 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | ||
| 54 | |||
| 55 | /* --- Miscellaneous adapters */ | ||
| 56 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | ||
| 57 | #define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ | ||
| 58 | 36 | ||
| 59 | #endif /* LINUX_I2C_ID_H */ | 37 | #endif /* LINUX_I2C_ID_H */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 889b35abaeda..56cfe23ffb39 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -353,7 +353,7 @@ struct i2c_algorithm { | |||
| 353 | */ | 353 | */ |
| 354 | struct i2c_adapter { | 354 | struct i2c_adapter { |
| 355 | struct module *owner; | 355 | struct module *owner; |
| 356 | unsigned int id; | 356 | unsigned int id __deprecated; |
| 357 | unsigned int class; /* classes to allow probing for */ | 357 | unsigned int class; /* classes to allow probing for */ |
| 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
| 359 | void *algo_data; | 359 | void *algo_data; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fc3da9e4da19..b6de9a6f7018 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -17,13 +17,11 @@ | |||
| 17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
| 18 | #include <linux/log2.h> | 18 | #include <linux/log2.h> |
| 19 | #include <linux/typecheck.h> | 19 | #include <linux/typecheck.h> |
| 20 | #include <linux/printk.h> | ||
| 20 | #include <linux/dynamic_debug.h> | 21 | #include <linux/dynamic_debug.h> |
| 21 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
| 22 | #include <asm/bug.h> | 23 | #include <asm/bug.h> |
| 23 | 24 | ||
| 24 | extern const char linux_banner[]; | ||
| 25 | extern const char linux_proc_banner[]; | ||
| 26 | |||
| 27 | #define USHRT_MAX ((u16)(~0U)) | 25 | #define USHRT_MAX ((u16)(~0U)) |
| 28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) | 26 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
| 29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) | 27 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
| @@ -110,31 +108,6 @@ extern const char linux_proc_banner[]; | |||
| 110 | */ | 108 | */ |
| 111 | #define lower_32_bits(n) ((u32)(n)) | 109 | #define lower_32_bits(n) ((u32)(n)) |
| 112 | 110 | ||
| 113 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
| 114 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
| 115 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
| 116 | #define KERN_ERR "<3>" /* error conditions */ | ||
| 117 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
| 118 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
| 119 | #define KERN_INFO "<6>" /* informational */ | ||
| 120 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
| 121 | |||
| 122 | /* Use the default kernel loglevel */ | ||
| 123 | #define KERN_DEFAULT "<d>" | ||
| 124 | /* | ||
| 125 | * Annotation for a "continued" line of log printout (only done after a | ||
| 126 | * line that had no enclosing \n). Only to be used by core/arch code | ||
| 127 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
| 128 | */ | ||
| 129 | #define KERN_CONT "<c>" | ||
| 130 | |||
| 131 | extern int console_printk[]; | ||
| 132 | |||
| 133 | #define console_loglevel (console_printk[0]) | ||
| 134 | #define default_message_loglevel (console_printk[1]) | ||
| 135 | #define minimum_console_loglevel (console_printk[2]) | ||
| 136 | #define default_console_loglevel (console_printk[3]) | ||
| 137 | |||
| 138 | struct completion; | 111 | struct completion; |
| 139 | struct pt_regs; | 112 | struct pt_regs; |
| 140 | struct user; | 113 | struct user; |
| @@ -187,11 +160,6 @@ static inline void might_fault(void) | |||
| 187 | } | 160 | } |
| 188 | #endif | 161 | #endif |
| 189 | 162 | ||
| 190 | struct va_format { | ||
| 191 | const char *fmt; | ||
| 192 | va_list *va; | ||
| 193 | }; | ||
| 194 | |||
| 195 | extern struct atomic_notifier_head panic_notifier_list; | 163 | extern struct atomic_notifier_head panic_notifier_list; |
| 196 | extern long (*panic_blink)(int state); | 164 | extern long (*panic_blink)(int state); |
| 197 | NORET_TYPE void panic(const char * fmt, ...) | 165 | NORET_TYPE void panic(const char * fmt, ...) |
| @@ -245,115 +213,8 @@ extern int func_ptr_is_kernel_text(void *ptr); | |||
| 245 | struct pid; | 213 | struct pid; |
| 246 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 214 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
| 247 | 215 | ||
| 248 | /* | ||
| 249 | * FW_BUG | ||
| 250 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
| 251 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
| 252 | * should be able to fix this issue or at least get a concrete idea of the | ||
| 253 | * problem by reading your message without the need of looking at the kernel | ||
| 254 | * code. | ||
| 255 | * | ||
| 256 | * Use it for definite and high priority BIOS bugs. | ||
| 257 | * | ||
| 258 | * FW_WARN | ||
| 259 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
| 260 | * and medium priority BIOS bugs. | ||
| 261 | * | ||
| 262 | * FW_INFO | ||
| 263 | * Use this one if you want to tell the user or vendor about something | ||
| 264 | * suspicious, but generally harmless related to the firmware. | ||
| 265 | * | ||
| 266 | * Use it for information or very low priority BIOS bugs. | ||
| 267 | */ | ||
| 268 | #define FW_BUG "[Firmware Bug]: " | ||
| 269 | #define FW_WARN "[Firmware Warn]: " | ||
| 270 | #define FW_INFO "[Firmware Info]: " | ||
| 271 | |||
| 272 | /* | ||
| 273 | * HW_ERR | ||
| 274 | * Add this to a message for hardware errors, so that user can report | ||
| 275 | * it to hardware vendor instead of LKML or software vendor. | ||
| 276 | */ | ||
| 277 | #define HW_ERR "[Hardware Error]: " | ||
| 278 | |||
| 279 | #ifdef CONFIG_PRINTK | ||
| 280 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
| 281 | __attribute__ ((format (printf, 1, 0))); | ||
| 282 | asmlinkage int printk(const char * fmt, ...) | ||
| 283 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
| 284 | |||
| 285 | /* | ||
| 286 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
| 287 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
| 288 | * printk_ratelimited() or plain old __ratelimit(). | ||
| 289 | */ | ||
| 290 | extern int __printk_ratelimit(const char *func); | ||
| 291 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
| 292 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
| 293 | unsigned int interval_msec); | ||
| 294 | |||
| 295 | extern int printk_delay_msec; | ||
| 296 | extern int dmesg_restrict; | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
| 300 | */ | ||
| 301 | #define printk_once(x...) ({ \ | ||
| 302 | static bool __print_once; \ | ||
| 303 | \ | ||
| 304 | if (!__print_once) { \ | ||
| 305 | __print_once = true; \ | ||
| 306 | printk(x); \ | ||
| 307 | } \ | ||
| 308 | }) | ||
| 309 | |||
| 310 | void log_buf_kexec_setup(void); | ||
| 311 | #else | ||
| 312 | static inline int vprintk(const char *s, va_list args) | ||
| 313 | __attribute__ ((format (printf, 1, 0))); | ||
| 314 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
| 315 | static inline int printk(const char *s, ...) | ||
| 316 | __attribute__ ((format (printf, 1, 2))); | ||
| 317 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
| 318 | static inline int printk_ratelimit(void) { return 0; } | ||
| 319 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
| 320 | unsigned int interval_msec) \ | ||
| 321 | { return false; } | ||
| 322 | |||
| 323 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 324 | #define printk_once(x...) printk(x) | ||
| 325 | |||
| 326 | static inline void log_buf_kexec_setup(void) | ||
| 327 | { | ||
| 328 | } | ||
| 329 | #endif | ||
| 330 | |||
| 331 | /* | ||
| 332 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
| 333 | * gcc's format and side-effect checking. | ||
| 334 | */ | ||
| 335 | static inline __attribute__ ((format (printf, 1, 2))) | ||
| 336 | int no_printk(const char *s, ...) { return 0; } | ||
| 337 | |||
| 338 | extern int printk_needs_cpu(int cpu); | ||
| 339 | extern void printk_tick(void); | ||
| 340 | |||
| 341 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
| 342 | early_printk(const char *fmt, ...); | ||
| 343 | |||
| 344 | unsigned long int_sqrt(unsigned long); | 216 | unsigned long int_sqrt(unsigned long); |
| 345 | 217 | ||
| 346 | static inline void console_silent(void) | ||
| 347 | { | ||
| 348 | console_loglevel = 0; | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline void console_verbose(void) | ||
| 352 | { | ||
| 353 | if (console_loglevel) | ||
| 354 | console_loglevel = 15; | ||
| 355 | } | ||
| 356 | |||
| 357 | extern void bust_spinlocks(int yes); | 218 | extern void bust_spinlocks(int yes); |
| 358 | extern void wake_up_klogd(void); | 219 | extern void wake_up_klogd(void); |
| 359 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 220 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
| @@ -390,22 +251,6 @@ extern enum system_states { | |||
| 390 | #define TAINT_CRAP 10 | 251 | #define TAINT_CRAP 10 |
| 391 | #define TAINT_FIRMWARE_WORKAROUND 11 | 252 | #define TAINT_FIRMWARE_WORKAROUND 11 |
| 392 | 253 | ||
| 393 | extern void dump_stack(void) __cold; | ||
| 394 | |||
| 395 | enum { | ||
| 396 | DUMP_PREFIX_NONE, | ||
| 397 | DUMP_PREFIX_ADDRESS, | ||
| 398 | DUMP_PREFIX_OFFSET | ||
| 399 | }; | ||
| 400 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
| 401 | int rowsize, int groupsize, | ||
| 402 | char *linebuf, size_t linebuflen, bool ascii); | ||
| 403 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
| 404 | int prefix_type, int rowsize, int groupsize, | ||
| 405 | const void *buf, size_t len, bool ascii); | ||
| 406 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
| 407 | const void *buf, size_t len); | ||
| 408 | |||
| 409 | extern const char hex_asc[]; | 254 | extern const char hex_asc[]; |
| 410 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 255 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
| 411 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 256 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
| @@ -419,94 +264,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 419 | 264 | ||
| 420 | extern int hex_to_bin(char ch); | 265 | extern int hex_to_bin(char ch); |
| 421 | 266 | ||
| 422 | #ifndef pr_fmt | ||
| 423 | #define pr_fmt(fmt) fmt | ||
| 424 | #endif | ||
| 425 | |||
| 426 | #define pr_emerg(fmt, ...) \ | ||
| 427 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 428 | #define pr_alert(fmt, ...) \ | ||
| 429 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 430 | #define pr_crit(fmt, ...) \ | ||
| 431 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 432 | #define pr_err(fmt, ...) \ | ||
| 433 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 434 | #define pr_warning(fmt, ...) \ | ||
| 435 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 436 | #define pr_warn pr_warning | ||
| 437 | #define pr_notice(fmt, ...) \ | ||
| 438 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 439 | #define pr_info(fmt, ...) \ | ||
| 440 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 441 | #define pr_cont(fmt, ...) \ | ||
| 442 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
| 443 | |||
| 444 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
| 445 | #ifdef DEBUG | ||
| 446 | #define pr_devel(fmt, ...) \ | ||
| 447 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 448 | #else | ||
| 449 | #define pr_devel(fmt, ...) \ | ||
| 450 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 451 | #endif | ||
| 452 | |||
| 453 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 454 | #if defined(DEBUG) | ||
| 455 | #define pr_debug(fmt, ...) \ | ||
| 456 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 457 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 458 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
| 459 | #define pr_debug(fmt, ...) \ | ||
| 460 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
| 461 | #else | ||
| 462 | #define pr_debug(fmt, ...) \ | ||
| 463 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 464 | #endif | ||
| 465 | |||
| 466 | /* | ||
| 467 | * ratelimited messages with local ratelimit_state, | ||
| 468 | * no local ratelimit_state used in the !PRINTK case | ||
| 469 | */ | ||
| 470 | #ifdef CONFIG_PRINTK | ||
| 471 | #define printk_ratelimited(fmt, ...) ({ \ | ||
| 472 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 473 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 474 | DEFAULT_RATELIMIT_BURST); \ | ||
| 475 | \ | ||
| 476 | if (__ratelimit(&_rs)) \ | ||
| 477 | printk(fmt, ##__VA_ARGS__); \ | ||
| 478 | }) | ||
| 479 | #else | ||
| 480 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 481 | #define printk_ratelimited printk | ||
| 482 | #endif | ||
| 483 | |||
| 484 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
| 485 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 486 | #define pr_alert_ratelimited(fmt, ...) \ | ||
| 487 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 488 | #define pr_crit_ratelimited(fmt, ...) \ | ||
| 489 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 490 | #define pr_err_ratelimited(fmt, ...) \ | ||
| 491 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 492 | #define pr_warning_ratelimited(fmt, ...) \ | ||
| 493 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 494 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
| 495 | #define pr_notice_ratelimited(fmt, ...) \ | ||
| 496 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 497 | #define pr_info_ratelimited(fmt, ...) \ | ||
| 498 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 499 | /* no pr_cont_ratelimited, don't do that... */ | ||
| 500 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 501 | #if defined(DEBUG) | ||
| 502 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 503 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 504 | #else | ||
| 505 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 506 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
| 507 | ##__VA_ARGS__); 0; }) | ||
| 508 | #endif | ||
| 509 | |||
| 510 | /* | 267 | /* |
| 511 | * General tracing related utility functions - trace_printk(), | 268 | * General tracing related utility functions - trace_printk(), |
| 512 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 269 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
diff --git a/include/linux/printk.h b/include/linux/printk.h new file mode 100644 index 000000000000..b772ca5fbdf0 --- /dev/null +++ b/include/linux/printk.h | |||
| @@ -0,0 +1,248 @@ | |||
| 1 | #ifndef __KERNEL_PRINTK__ | ||
| 2 | #define __KERNEL_PRINTK__ | ||
| 3 | |||
| 4 | extern const char linux_banner[]; | ||
| 5 | extern const char linux_proc_banner[]; | ||
| 6 | |||
| 7 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
| 8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
| 9 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
| 10 | #define KERN_ERR "<3>" /* error conditions */ | ||
| 11 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
| 12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
| 13 | #define KERN_INFO "<6>" /* informational */ | ||
| 14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
| 15 | |||
| 16 | /* Use the default kernel loglevel */ | ||
| 17 | #define KERN_DEFAULT "<d>" | ||
| 18 | /* | ||
| 19 | * Annotation for a "continued" line of log printout (only done after a | ||
| 20 | * line that had no enclosing \n). Only to be used by core/arch code | ||
| 21 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
| 22 | */ | ||
| 23 | #define KERN_CONT "<c>" | ||
| 24 | |||
| 25 | extern int console_printk[]; | ||
| 26 | |||
| 27 | #define console_loglevel (console_printk[0]) | ||
| 28 | #define default_message_loglevel (console_printk[1]) | ||
| 29 | #define minimum_console_loglevel (console_printk[2]) | ||
| 30 | #define default_console_loglevel (console_printk[3]) | ||
| 31 | |||
| 32 | struct va_format { | ||
| 33 | const char *fmt; | ||
| 34 | va_list *va; | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* | ||
| 38 | * FW_BUG | ||
| 39 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
| 40 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
| 41 | * should be able to fix this issue or at least get a concrete idea of the | ||
| 42 | * problem by reading your message without the need of looking at the kernel | ||
| 43 | * code. | ||
| 44 | * | ||
| 45 | * Use it for definite and high priority BIOS bugs. | ||
| 46 | * | ||
| 47 | * FW_WARN | ||
| 48 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
| 49 | * and medium priority BIOS bugs. | ||
| 50 | * | ||
| 51 | * FW_INFO | ||
| 52 | * Use this one if you want to tell the user or vendor about something | ||
| 53 | * suspicious, but generally harmless related to the firmware. | ||
| 54 | * | ||
| 55 | * Use it for information or very low priority BIOS bugs. | ||
| 56 | */ | ||
| 57 | #define FW_BUG "[Firmware Bug]: " | ||
| 58 | #define FW_WARN "[Firmware Warn]: " | ||
| 59 | #define FW_INFO "[Firmware Info]: " | ||
| 60 | |||
| 61 | /* | ||
| 62 | * HW_ERR | ||
| 63 | * Add this to a message for hardware errors, so that user can report | ||
| 64 | * it to hardware vendor instead of LKML or software vendor. | ||
| 65 | */ | ||
| 66 | #define HW_ERR "[Hardware Error]: " | ||
| 67 | |||
| 68 | #ifdef CONFIG_PRINTK | ||
| 69 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
| 70 | __attribute__ ((format (printf, 1, 0))); | ||
| 71 | asmlinkage int printk(const char * fmt, ...) | ||
| 72 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
| 76 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
| 77 | * printk_ratelimited() or plain old __ratelimit(). | ||
| 78 | */ | ||
| 79 | extern int __printk_ratelimit(const char *func); | ||
| 80 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
| 81 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
| 82 | unsigned int interval_msec); | ||
| 83 | |||
| 84 | extern int printk_delay_msec; | ||
| 85 | extern int dmesg_restrict; | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
| 89 | */ | ||
| 90 | #define printk_once(x...) ({ \ | ||
| 91 | static bool __print_once; \ | ||
| 92 | \ | ||
| 93 | if (!__print_once) { \ | ||
| 94 | __print_once = true; \ | ||
| 95 | printk(x); \ | ||
| 96 | } \ | ||
| 97 | }) | ||
| 98 | |||
| 99 | void log_buf_kexec_setup(void); | ||
| 100 | #else | ||
| 101 | static inline int vprintk(const char *s, va_list args) | ||
| 102 | __attribute__ ((format (printf, 1, 0))); | ||
| 103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
| 104 | static inline int printk(const char *s, ...) | ||
| 105 | __attribute__ ((format (printf, 1, 2))); | ||
| 106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
| 107 | static inline int printk_ratelimit(void) { return 0; } | ||
| 108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
| 109 | unsigned int interval_msec) \ | ||
| 110 | { return false; } | ||
| 111 | |||
| 112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 113 | #define printk_once(x...) printk(x) | ||
| 114 | |||
| 115 | static inline void log_buf_kexec_setup(void) | ||
| 116 | { | ||
| 117 | } | ||
| 118 | #endif | ||
| 119 | |||
| 120 | /* | ||
| 121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
| 122 | * gcc's format and side-effect checking. | ||
| 123 | */ | ||
| 124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
| 125 | int no_printk(const char *s, ...) { return 0; } | ||
| 126 | |||
| 127 | extern int printk_needs_cpu(int cpu); | ||
| 128 | extern void printk_tick(void); | ||
| 129 | |||
| 130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
| 131 | early_printk(const char *fmt, ...); | ||
| 132 | |||
| 133 | static inline void console_silent(void) | ||
| 134 | { | ||
| 135 | console_loglevel = 0; | ||
| 136 | } | ||
| 137 | |||
| 138 | static inline void console_verbose(void) | ||
| 139 | { | ||
| 140 | if (console_loglevel) | ||
| 141 | console_loglevel = 15; | ||
| 142 | } | ||
| 143 | |||
| 144 | extern void dump_stack(void) __cold; | ||
| 145 | |||
| 146 | enum { | ||
| 147 | DUMP_PREFIX_NONE, | ||
| 148 | DUMP_PREFIX_ADDRESS, | ||
| 149 | DUMP_PREFIX_OFFSET | ||
| 150 | }; | ||
| 151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
| 152 | int rowsize, int groupsize, | ||
| 153 | char *linebuf, size_t linebuflen, bool ascii); | ||
| 154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
| 155 | int prefix_type, int rowsize, int groupsize, | ||
| 156 | const void *buf, size_t len, bool ascii); | ||
| 157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
| 158 | const void *buf, size_t len); | ||
| 159 | |||
| 160 | #ifndef pr_fmt | ||
| 161 | #define pr_fmt(fmt) fmt | ||
| 162 | #endif | ||
| 163 | |||
| 164 | #define pr_emerg(fmt, ...) \ | ||
| 165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 166 | #define pr_alert(fmt, ...) \ | ||
| 167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 168 | #define pr_crit(fmt, ...) \ | ||
| 169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 170 | #define pr_err(fmt, ...) \ | ||
| 171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 172 | #define pr_warning(fmt, ...) \ | ||
| 173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 174 | #define pr_warn pr_warning | ||
| 175 | #define pr_notice(fmt, ...) \ | ||
| 176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 177 | #define pr_info(fmt, ...) \ | ||
| 178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 179 | #define pr_cont(fmt, ...) \ | ||
| 180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
| 181 | |||
| 182 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
| 183 | #ifdef DEBUG | ||
| 184 | #define pr_devel(fmt, ...) \ | ||
| 185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 186 | #else | ||
| 187 | #define pr_devel(fmt, ...) \ | ||
| 188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 189 | #endif | ||
| 190 | |||
| 191 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 192 | #if defined(DEBUG) | ||
| 193 | #define pr_debug(fmt, ...) \ | ||
| 194 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 195 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 196 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
| 197 | #define pr_debug(fmt, ...) \ | ||
| 198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
| 199 | #else | ||
| 200 | #define pr_debug(fmt, ...) \ | ||
| 201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 202 | #endif | ||
| 203 | |||
| 204 | /* | ||
| 205 | * ratelimited messages with local ratelimit_state, | ||
| 206 | * no local ratelimit_state used in the !PRINTK case | ||
| 207 | */ | ||
| 208 | #ifdef CONFIG_PRINTK | ||
| 209 | #define printk_ratelimited(fmt, ...) ({ \ | ||
| 210 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 211 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 212 | DEFAULT_RATELIMIT_BURST); \ | ||
| 213 | \ | ||
| 214 | if (__ratelimit(&_rs)) \ | ||
| 215 | printk(fmt, ##__VA_ARGS__); \ | ||
| 216 | }) | ||
| 217 | #else | ||
| 218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 219 | #define printk_ratelimited printk | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
| 223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 224 | #define pr_alert_ratelimited(fmt, ...) \ | ||
| 225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 226 | #define pr_crit_ratelimited(fmt, ...) \ | ||
| 227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 228 | #define pr_err_ratelimited(fmt, ...) \ | ||
| 229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 230 | #define pr_warning_ratelimited(fmt, ...) \ | ||
| 231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 232 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
| 233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
| 234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 235 | #define pr_info_ratelimited(fmt, ...) \ | ||
| 236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 237 | /* no pr_cont_ratelimited, don't do that... */ | ||
| 238 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 239 | #if defined(DEBUG) | ||
| 240 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 242 | #else | ||
| 243 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
| 245 | ##__VA_ARGS__); 0; }) | ||
| 246 | #endif | ||
| 247 | |||
| 248 | #endif | ||
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index f656d1a43dc0..5812fefbcedf 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -79,7 +79,7 @@ struct intc_hw_desc { | |||
| 79 | unsigned int nr_subgroups; | 79 | unsigned int nr_subgroups; |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | #define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) | 82 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) |
| 83 | 83 | ||
| 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ |
| 85 | prio_regs, sense_regs, ack_regs) \ | 85 | prio_regs, sense_regs, ack_regs) \ |
| @@ -3273,9 +3273,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, | |||
| 3273 | kfree(n); | 3273 | kfree(n); |
| 3274 | kfree(s); | 3274 | kfree(s); |
| 3275 | } | 3275 | } |
| 3276 | err: | ||
| 3276 | up_write(&slub_lock); | 3277 | up_write(&slub_lock); |
| 3277 | 3278 | ||
| 3278 | err: | ||
| 3279 | if (flags & SLAB_PANIC) | 3279 | if (flags & SLAB_PANIC) |
| 3280 | panic("Cannot create slabcache %s\n", name); | 3280 | panic("Cannot create slabcache %s\n", name); |
| 3281 | else | 3281 | else |
| @@ -3862,6 +3862,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s, | |||
| 3862 | x += sprintf(buf + x, " N%d=%lu", | 3862 | x += sprintf(buf + x, " N%d=%lu", |
| 3863 | node, nodes[node]); | 3863 | node, nodes[node]); |
| 3864 | #endif | 3864 | #endif |
| 3865 | up_read(&slub_lock); | ||
| 3865 | kfree(nodes); | 3866 | kfree(nodes); |
| 3866 | return x + sprintf(buf + x, "\n"); | 3867 | return x + sprintf(buf + x, "\n"); |
| 3867 | } | 3868 | } |
