diff options
253 files changed, 1927 insertions, 1295 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 03ca210406ed..e4b57756b9f5 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -539,3 +539,13 @@ When: 3.6 | |||
539 | Why: setitimer is not returning -EFAULT if user pointer is NULL. This | 539 | Why: setitimer is not returning -EFAULT if user pointer is NULL. This |
540 | violates the spec. | 540 | violates the spec. |
541 | Who: Sasikantha Babu <sasikanth.v19@gmail.com> | 541 | Who: Sasikantha Babu <sasikanth.v19@gmail.com> |
542 | |||
543 | ---------------------------- | ||
544 | |||
545 | What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls | ||
546 | When: 3.7 | ||
547 | Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated | ||
548 | for about 4 years and they are not used by any mainline driver. | ||
549 | There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide | ||
550 | similar functionality. | ||
551 | Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | ||
diff --git a/MAINTAINERS b/MAINTAINERS index c369da4543aa..85018f365ac7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1968,7 +1968,9 @@ S: Maintained | |||
1968 | F: drivers/net/ethernet/ti/cpmac.c | 1968 | F: drivers/net/ethernet/ti/cpmac.c |
1969 | 1969 | ||
1970 | CPU FREQUENCY DRIVERS | 1970 | CPU FREQUENCY DRIVERS |
1971 | M: Rafael J. Wysocki <rjw@sisk.pl> | ||
1971 | L: cpufreq@vger.kernel.org | 1972 | L: cpufreq@vger.kernel.org |
1973 | L: linux-pm@vger.kernel.org | ||
1972 | S: Maintained | 1974 | S: Maintained |
1973 | F: drivers/cpufreq/ | 1975 | F: drivers/cpufreq/ |
1974 | F: include/linux/cpufreq.h | 1976 | F: include/linux/cpufreq.h |
@@ -4034,6 +4036,7 @@ F: Documentation/scsi/53c700.txt | |||
4034 | F: drivers/scsi/53c700* | 4036 | F: drivers/scsi/53c700* |
4035 | 4037 | ||
4036 | LED SUBSYSTEM | 4038 | LED SUBSYSTEM |
4039 | M: Bryan Wu <bryan.wu@canonical.com> | ||
4037 | M: Richard Purdie <rpurdie@rpsys.net> | 4040 | M: Richard Purdie <rpurdie@rpsys.net> |
4038 | S: Maintained | 4041 | S: Maintained |
4039 | F: drivers/leds/ | 4042 | F: drivers/leds/ |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 4 | 2 | PATCHLEVEL = 4 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Saber-toothed Squirrel | 5 | NAME = Saber-toothed Squirrel |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index e81c35f936b5..b8df521fb68e 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -232,6 +232,9 @@ config MACH_ARMLEX4210 | |||
232 | config MACH_UNIVERSAL_C210 | 232 | config MACH_UNIVERSAL_C210 |
233 | bool "Mobile UNIVERSAL_C210 Board" | 233 | bool "Mobile UNIVERSAL_C210 Board" |
234 | select CPU_EXYNOS4210 | 234 | select CPU_EXYNOS4210 |
235 | select S5P_HRT | ||
236 | select CLKSRC_MMIO | ||
237 | select HAVE_SCHED_CLOCK | ||
235 | select S5P_GPIO_INT | 238 | select S5P_GPIO_INT |
236 | select S5P_DEV_FIMC0 | 239 | select S5P_DEV_FIMC0 |
237 | select S5P_DEV_FIMC1 | 240 | select S5P_DEV_FIMC1 |
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c index 5cd7a8b8868c..7ac6ff4c46bd 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c | |||
@@ -678,7 +678,7 @@ static struct clk exynos5_clk_pdma1 = { | |||
678 | .name = "dma", | 678 | .name = "dma", |
679 | .devname = "dma-pl330.1", | 679 | .devname = "dma-pl330.1", |
680 | .enable = exynos5_clk_ip_fsys_ctrl, | 680 | .enable = exynos5_clk_ip_fsys_ctrl, |
681 | .ctrlbit = (1 << 1), | 681 | .ctrlbit = (1 << 2), |
682 | }; | 682 | }; |
683 | 683 | ||
684 | static struct clk exynos5_clk_mdma1 = { | 684 | static struct clk exynos5_clk_mdma1 = { |
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index cb2b027f09a6..a34036eb8ba2 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <plat/pd.h> | 40 | #include <plat/pd.h> |
41 | #include <plat/regs-fb-v4.h> | 41 | #include <plat/regs-fb-v4.h> |
42 | #include <plat/fimc-core.h> | 42 | #include <plat/fimc-core.h> |
43 | #include <plat/s5p-time.h> | ||
43 | #include <plat/camport.h> | 44 | #include <plat/camport.h> |
44 | #include <plat/mipi_csis.h> | 45 | #include <plat/mipi_csis.h> |
45 | 46 | ||
@@ -1063,6 +1064,7 @@ static void __init universal_map_io(void) | |||
1063 | exynos_init_io(NULL, 0); | 1064 | exynos_init_io(NULL, 0); |
1064 | s3c24xx_init_clocks(24000000); | 1065 | s3c24xx_init_clocks(24000000); |
1065 | s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); | 1066 | s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); |
1067 | s5p_set_timer_source(S5P_PWM2, S5P_PWM4); | ||
1066 | } | 1068 | } |
1067 | 1069 | ||
1068 | static void s5p_tv_setup(void) | 1070 | static void s5p_tv_setup(void) |
@@ -1113,7 +1115,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | |||
1113 | .map_io = universal_map_io, | 1115 | .map_io = universal_map_io, |
1114 | .handle_irq = gic_handle_irq, | 1116 | .handle_irq = gic_handle_irq, |
1115 | .init_machine = universal_machine_init, | 1117 | .init_machine = universal_machine_init, |
1116 | .timer = &exynos4_timer, | 1118 | .timer = &s5p_timer, |
1117 | .reserve = &universal_reserve, | 1119 | .reserve = &universal_reserve, |
1118 | .restart = exynos4_restart, | 1120 | .restart = exynos4_restart, |
1119 | MACHINE_END | 1121 | MACHINE_END |
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c index 37c2de9b6f26..a7b9415d30f8 100644 --- a/arch/arm/mach-prima2/irq.c +++ b/arch/arm/mach-prima2/irq.c | |||
@@ -42,7 +42,8 @@ sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) | |||
42 | static __init void sirfsoc_irq_init(void) | 42 | static __init void sirfsoc_irq_init(void) |
43 | { | 43 | { |
44 | sirfsoc_alloc_gc(sirfsoc_intc_base, 0, 32); | 44 | sirfsoc_alloc_gc(sirfsoc_intc_base, 0, 32); |
45 | sirfsoc_alloc_gc(sirfsoc_intc_base + 4, 32, SIRFSOC_INTENAL_IRQ_END - 32); | 45 | sirfsoc_alloc_gc(sirfsoc_intc_base + 4, 32, |
46 | SIRFSOC_INTENAL_IRQ_END + 1 - 32); | ||
46 | 47 | ||
47 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); | 48 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); |
48 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); | 49 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); |
@@ -68,7 +69,8 @@ void __init sirfsoc_of_irq_init(void) | |||
68 | if (!sirfsoc_intc_base) | 69 | if (!sirfsoc_intc_base) |
69 | panic("unable to map intc cpu registers\n"); | 70 | panic("unable to map intc cpu registers\n"); |
70 | 71 | ||
71 | irq_domain_add_legacy(np, 32, 0, 0, &irq_domain_simple_ops, NULL); | 72 | irq_domain_add_legacy(np, SIRFSOC_INTENAL_IRQ_END + 1, 0, 0, |
73 | &irq_domain_simple_ops, NULL); | ||
72 | 74 | ||
73 | of_node_put(np); | 75 | of_node_put(np); |
74 | 76 | ||
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index cb224a344af0..0891ec6e27f5 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -365,23 +365,13 @@ static struct platform_device mipidsi0_device = { | |||
365 | }; | 365 | }; |
366 | 366 | ||
367 | /* SDHI0 */ | 367 | /* SDHI0 */ |
368 | static irqreturn_t ag5evm_sdhi0_gpio_cd(int irq, void *arg) | ||
369 | { | ||
370 | struct device *dev = arg; | ||
371 | struct sh_mobile_sdhi_info *info = dev->platform_data; | ||
372 | struct tmio_mmc_data *pdata = info->pdata; | ||
373 | |||
374 | tmio_mmc_cd_wakeup(pdata); | ||
375 | |||
376 | return IRQ_HANDLED; | ||
377 | } | ||
378 | |||
379 | static struct sh_mobile_sdhi_info sdhi0_info = { | 368 | static struct sh_mobile_sdhi_info sdhi0_info = { |
380 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, | 369 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, |
381 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, | 370 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, |
382 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, | 371 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, |
383 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, | 372 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, |
384 | .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, | 373 | .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, |
374 | .cd_gpio = GPIO_PORT251, | ||
385 | }; | 375 | }; |
386 | 376 | ||
387 | static struct resource sdhi0_resources[] = { | 377 | static struct resource sdhi0_resources[] = { |
@@ -557,7 +547,6 @@ static void __init ag5evm_init(void) | |||
557 | lcd_backlight_reset(); | 547 | lcd_backlight_reset(); |
558 | 548 | ||
559 | /* enable SDHI0 on CN15 [SD I/F] */ | 549 | /* enable SDHI0 on CN15 [SD I/F] */ |
560 | gpio_request(GPIO_FN_SDHICD0, NULL); | ||
561 | gpio_request(GPIO_FN_SDHIWP0, NULL); | 550 | gpio_request(GPIO_FN_SDHIWP0, NULL); |
562 | gpio_request(GPIO_FN_SDHICMD0, NULL); | 551 | gpio_request(GPIO_FN_SDHICMD0, NULL); |
563 | gpio_request(GPIO_FN_SDHICLK0, NULL); | 552 | gpio_request(GPIO_FN_SDHICLK0, NULL); |
@@ -566,13 +555,6 @@ static void __init ag5evm_init(void) | |||
566 | gpio_request(GPIO_FN_SDHID0_1, NULL); | 555 | gpio_request(GPIO_FN_SDHID0_1, NULL); |
567 | gpio_request(GPIO_FN_SDHID0_0, NULL); | 556 | gpio_request(GPIO_FN_SDHID0_0, NULL); |
568 | 557 | ||
569 | if (!request_irq(intcs_evt2irq(0x3c0), ag5evm_sdhi0_gpio_cd, | ||
570 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, | ||
571 | "sdhi0 cd", &sdhi0_device.dev)) | ||
572 | sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD; | ||
573 | else | ||
574 | pr_warn("Unable to setup SDHI0 GPIO IRQ\n"); | ||
575 | |||
576 | /* enable SDHI1 on CN4 [WLAN I/F] */ | 558 | /* enable SDHI1 on CN4 [WLAN I/F] */ |
577 | gpio_request(GPIO_FN_SDHICLK1, NULL); | 559 | gpio_request(GPIO_FN_SDHICLK1, NULL); |
578 | gpio_request(GPIO_FN_SDHICMD1_PU, NULL); | 560 | gpio_request(GPIO_FN_SDHICMD1_PU, NULL); |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index f49e28abe0ab..8c6202bb6aeb 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -1011,21 +1011,12 @@ static int slot_cn7_get_cd(struct platform_device *pdev) | |||
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | /* SDHI0 */ | 1013 | /* SDHI0 */ |
1014 | static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg) | ||
1015 | { | ||
1016 | struct device *dev = arg; | ||
1017 | struct sh_mobile_sdhi_info *info = dev->platform_data; | ||
1018 | struct tmio_mmc_data *pdata = info->pdata; | ||
1019 | |||
1020 | tmio_mmc_cd_wakeup(pdata); | ||
1021 | |||
1022 | return IRQ_HANDLED; | ||
1023 | } | ||
1024 | |||
1025 | static struct sh_mobile_sdhi_info sdhi0_info = { | 1014 | static struct sh_mobile_sdhi_info sdhi0_info = { |
1026 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, | 1015 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, |
1027 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, | 1016 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, |
1017 | .tmio_flags = TMIO_MMC_USE_GPIO_CD, | ||
1028 | .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, | 1018 | .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, |
1019 | .cd_gpio = GPIO_PORT172, | ||
1029 | }; | 1020 | }; |
1030 | 1021 | ||
1031 | static struct resource sdhi0_resources[] = { | 1022 | static struct resource sdhi0_resources[] = { |
@@ -1384,7 +1375,6 @@ static void __init mackerel_init(void) | |||
1384 | { | 1375 | { |
1385 | u32 srcr4; | 1376 | u32 srcr4; |
1386 | struct clk *clk; | 1377 | struct clk *clk; |
1387 | int ret; | ||
1388 | 1378 | ||
1389 | /* External clock source */ | 1379 | /* External clock source */ |
1390 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); | 1380 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); |
@@ -1481,7 +1471,6 @@ static void __init mackerel_init(void) | |||
1481 | irq_set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); | 1471 | irq_set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); |
1482 | 1472 | ||
1483 | /* enable SDHI0 */ | 1473 | /* enable SDHI0 */ |
1484 | gpio_request(GPIO_FN_SDHICD0, NULL); | ||
1485 | gpio_request(GPIO_FN_SDHIWP0, NULL); | 1474 | gpio_request(GPIO_FN_SDHIWP0, NULL); |
1486 | gpio_request(GPIO_FN_SDHICMD0, NULL); | 1475 | gpio_request(GPIO_FN_SDHICMD0, NULL); |
1487 | gpio_request(GPIO_FN_SDHICLK0, NULL); | 1476 | gpio_request(GPIO_FN_SDHICLK0, NULL); |
@@ -1490,13 +1479,6 @@ static void __init mackerel_init(void) | |||
1490 | gpio_request(GPIO_FN_SDHID0_1, NULL); | 1479 | gpio_request(GPIO_FN_SDHID0_1, NULL); |
1491 | gpio_request(GPIO_FN_SDHID0_0, NULL); | 1480 | gpio_request(GPIO_FN_SDHID0_0, NULL); |
1492 | 1481 | ||
1493 | ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd, | ||
1494 | IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev); | ||
1495 | if (!ret) | ||
1496 | sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD; | ||
1497 | else | ||
1498 | pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret); | ||
1499 | |||
1500 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) | 1482 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) |
1501 | /* enable SDHI1 */ | 1483 | /* enable SDHI1 */ |
1502 | gpio_request(GPIO_FN_SDHICMD1, NULL); | 1484 | gpio_request(GPIO_FN_SDHICMD1, NULL); |
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index 6ac015c89206..b202c1272526 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S | |||
@@ -16,6 +16,59 @@ | |||
16 | 16 | ||
17 | __CPUINIT | 17 | __CPUINIT |
18 | 18 | ||
19 | /* Cache invalidation nicked from arch/arm/mach-imx/head-v7.S, thanks! | ||
20 | * | ||
21 | * The secondary kernel init calls v7_flush_dcache_all before it enables | ||
22 | * the L1; however, the L1 comes out of reset in an undefined state, so | ||
23 | * the clean + invalidate performed by v7_flush_dcache_all causes a bunch | ||
24 | * of cache lines with uninitialized data and uninitialized tags to get | ||
25 | * written out to memory, which does really unpleasant things to the main | ||
26 | * processor. We fix this by performing an invalidate, rather than a | ||
27 | * clean + invalidate, before jumping into the kernel. | ||
28 | * | ||
29 | * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs | ||
30 | * to be called for both secondary cores startup and primary core resume | ||
31 | * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S. | ||
32 | */ | ||
33 | ENTRY(v7_invalidate_l1) | ||
34 | mov r0, #0 | ||
35 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | ||
36 | mcr p15, 2, r0, c0, c0, 0 | ||
37 | mrc p15, 1, r0, c0, c0, 0 | ||
38 | |||
39 | ldr r1, =0x7fff | ||
40 | and r2, r1, r0, lsr #13 | ||
41 | |||
42 | ldr r1, =0x3ff | ||
43 | |||
44 | and r3, r1, r0, lsr #3 @ NumWays - 1 | ||
45 | add r2, r2, #1 @ NumSets | ||
46 | |||
47 | and r0, r0, #0x7 | ||
48 | add r0, r0, #4 @ SetShift | ||
49 | |||
50 | clz r1, r3 @ WayShift | ||
51 | add r4, r3, #1 @ NumWays | ||
52 | 1: sub r2, r2, #1 @ NumSets-- | ||
53 | mov r3, r4 @ Temp = NumWays | ||
54 | 2: subs r3, r3, #1 @ Temp-- | ||
55 | mov r5, r3, lsl r1 | ||
56 | mov r6, r2, lsl r0 | ||
57 | orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift) | ||
58 | mcr p15, 0, r5, c7, c6, 2 | ||
59 | bgt 2b | ||
60 | cmp r2, #0 | ||
61 | bgt 1b | ||
62 | dsb | ||
63 | isb | ||
64 | mov pc, lr | ||
65 | ENDPROC(v7_invalidate_l1) | ||
66 | |||
67 | ENTRY(shmobile_invalidate_start) | ||
68 | bl v7_invalidate_l1 | ||
69 | b secondary_startup | ||
70 | ENDPROC(shmobile_invalidate_start) | ||
71 | |||
19 | /* | 72 | /* |
20 | * Reset vector for secondary CPUs. | 73 | * Reset vector for secondary CPUs. |
21 | * This will be mapped at address 0 by SBAR register. | 74 | * This will be mapped at address 0 by SBAR register. |
@@ -24,4 +77,5 @@ | |||
24 | .align 12 | 77 | .align 12 |
25 | ENTRY(shmobile_secondary_vector) | 78 | ENTRY(shmobile_secondary_vector) |
26 | ldr pc, 1f | 79 | ldr pc, 1f |
27 | 1: .long secondary_startup - PAGE_OFFSET + PLAT_PHYS_OFFSET | 80 | 1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET |
81 | ENDPROC(shmobile_secondary_vector) | ||
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 83ad3fe0a75f..c85e6ecda606 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -4,7 +4,6 @@ | |||
4 | extern void shmobile_earlytimer_init(void); | 4 | extern void shmobile_earlytimer_init(void); |
5 | extern struct sys_timer shmobile_timer; | 5 | extern struct sys_timer shmobile_timer; |
6 | struct twd_local_timer; | 6 | struct twd_local_timer; |
7 | void shmobile_twd_init(struct twd_local_timer *twd_local_timer); | ||
8 | extern void shmobile_setup_console(void); | 7 | extern void shmobile_setup_console(void); |
9 | extern void shmobile_secondary_vector(void); | 8 | extern void shmobile_secondary_vector(void); |
10 | extern int shmobile_platform_cpu_kill(unsigned int cpu); | 9 | extern int shmobile_platform_cpu_kill(unsigned int cpu); |
@@ -82,5 +81,6 @@ extern int r8a7779_platform_cpu_kill(unsigned int cpu); | |||
82 | extern void r8a7779_secondary_init(unsigned int cpu); | 81 | extern void r8a7779_secondary_init(unsigned int cpu); |
83 | extern int r8a7779_boot_secondary(unsigned int cpu); | 82 | extern int r8a7779_boot_secondary(unsigned int cpu); |
84 | extern void r8a7779_smp_prepare_cpus(void); | 83 | extern void r8a7779_smp_prepare_cpus(void); |
84 | extern void r8a7779_register_twd(void); | ||
85 | 85 | ||
86 | #endif /* __ARCH_MACH_COMMON_H */ | 86 | #endif /* __ARCH_MACH_COMMON_H */ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 12c6f529ab89..e98e46f6cf55 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -262,10 +262,14 @@ void __init r8a7779_add_standard_devices(void) | |||
262 | ARRAY_SIZE(r8a7779_late_devices)); | 262 | ARRAY_SIZE(r8a7779_late_devices)); |
263 | } | 263 | } |
264 | 264 | ||
265 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ | ||
266 | void __init __weak r8a7779_register_twd(void) { } | ||
267 | |||
265 | static void __init r8a7779_earlytimer_init(void) | 268 | static void __init r8a7779_earlytimer_init(void) |
266 | { | 269 | { |
267 | r8a7779_clock_init(); | 270 | r8a7779_clock_init(); |
268 | shmobile_earlytimer_init(); | 271 | shmobile_earlytimer_init(); |
272 | r8a7779_register_twd(); | ||
269 | } | 273 | } |
270 | 274 | ||
271 | void __init r8a7779_add_early_devices(void) | 275 | void __init r8a7779_add_early_devices(void) |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 5bebffc10455..04a0dfe75493 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -688,10 +688,14 @@ void __init sh73a0_add_standard_devices(void) | |||
688 | ARRAY_SIZE(sh73a0_late_devices)); | 688 | ARRAY_SIZE(sh73a0_late_devices)); |
689 | } | 689 | } |
690 | 690 | ||
691 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ | ||
692 | void __init __weak sh73a0_register_twd(void) { } | ||
693 | |||
691 | static void __init sh73a0_earlytimer_init(void) | 694 | static void __init sh73a0_earlytimer_init(void) |
692 | { | 695 | { |
693 | sh73a0_clock_init(); | 696 | sh73a0_clock_init(); |
694 | shmobile_earlytimer_init(); | 697 | shmobile_earlytimer_init(); |
698 | sh73a0_register_twd(); | ||
695 | } | 699 | } |
696 | 700 | ||
697 | void __init sh73a0_add_early_devices(void) | 701 | void __init sh73a0_add_early_devices(void) |
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index b62e19d4c9af..6d1d0238cbf7 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c | |||
@@ -64,8 +64,15 @@ static void __iomem *scu_base_addr(void) | |||
64 | static DEFINE_SPINLOCK(scu_lock); | 64 | static DEFINE_SPINLOCK(scu_lock); |
65 | static unsigned long tmp; | 65 | static unsigned long tmp; |
66 | 66 | ||
67 | #ifdef CONFIG_HAVE_ARM_TWD | ||
67 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | 68 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); |
68 | 69 | ||
70 | void __init r8a7779_register_twd(void) | ||
71 | { | ||
72 | twd_local_timer_register(&twd_local_timer); | ||
73 | } | ||
74 | #endif | ||
75 | |||
69 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | 76 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) |
70 | { | 77 | { |
71 | void __iomem *scu_base = scu_base_addr(); | 78 | void __iomem *scu_base = scu_base_addr(); |
@@ -84,7 +91,6 @@ unsigned int __init r8a7779_get_core_count(void) | |||
84 | { | 91 | { |
85 | void __iomem *scu_base = scu_base_addr(); | 92 | void __iomem *scu_base = scu_base_addr(); |
86 | 93 | ||
87 | shmobile_twd_init(&twd_local_timer); | ||
88 | return scu_get_core_count(scu_base); | 94 | return scu_get_core_count(scu_base); |
89 | } | 95 | } |
90 | 96 | ||
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 14ad8b052f1a..e36c41c4ab40 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c | |||
@@ -42,7 +42,13 @@ static void __iomem *scu_base_addr(void) | |||
42 | static DEFINE_SPINLOCK(scu_lock); | 42 | static DEFINE_SPINLOCK(scu_lock); |
43 | static unsigned long tmp; | 43 | static unsigned long tmp; |
44 | 44 | ||
45 | #ifdef CONFIG_HAVE_ARM_TWD | ||
45 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | 46 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); |
47 | void __init sh73a0_register_twd(void) | ||
48 | { | ||
49 | twd_local_timer_register(&twd_local_timer); | ||
50 | } | ||
51 | #endif | ||
46 | 52 | ||
47 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | 53 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) |
48 | { | 54 | { |
@@ -62,7 +68,6 @@ unsigned int __init sh73a0_get_core_count(void) | |||
62 | { | 68 | { |
63 | void __iomem *scu_base = scu_base_addr(); | 69 | void __iomem *scu_base = scu_base_addr(); |
64 | 70 | ||
65 | shmobile_twd_init(&twd_local_timer); | ||
66 | return scu_get_core_count(scu_base); | 71 | return scu_get_core_count(scu_base); |
67 | } | 72 | } |
68 | 73 | ||
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index 2fba5f3d1c8a..8b79e7917a23 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c | |||
@@ -46,15 +46,6 @@ static void __init shmobile_timer_init(void) | |||
46 | { | 46 | { |
47 | } | 47 | } |
48 | 48 | ||
49 | void __init shmobile_twd_init(struct twd_local_timer *twd_local_timer) | ||
50 | { | ||
51 | #ifdef CONFIG_HAVE_ARM_TWD | ||
52 | int err = twd_local_timer_register(twd_local_timer); | ||
53 | if (err) | ||
54 | pr_err("twd_local_timer_register failed %d\n", err); | ||
55 | #endif | ||
56 | } | ||
57 | |||
58 | struct sys_timer shmobile_timer = { | 49 | struct sys_timer shmobile_timer = { |
59 | .init = shmobile_timer_init, | 50 | .init = shmobile_timer_init, |
60 | }; | 51 | }; |
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c index fef66a7486ed..f07488e0bd32 100644 --- a/arch/arm/mach-tegra/flowctrl.c +++ b/arch/arm/mach-tegra/flowctrl.c | |||
@@ -53,10 +53,10 @@ static void flowctrl_update(u8 offset, u32 value) | |||
53 | 53 | ||
54 | void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) | 54 | void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) |
55 | { | 55 | { |
56 | return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); | 56 | return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); |
57 | } | 57 | } |
58 | 58 | ||
59 | void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) | 59 | void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) |
60 | { | 60 | { |
61 | return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); | 61 | return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); |
62 | } | 62 | } |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index f07467533365..5bb48356d217 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -247,7 +247,9 @@ good_area: | |||
247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); | 247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
248 | 248 | ||
249 | check_stack: | 249 | check_stack: |
250 | if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) | 250 | /* Don't allow expansion below FIRST_USER_ADDRESS */ |
251 | if (vma->vm_flags & VM_GROWSDOWN && | ||
252 | addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr)) | ||
251 | goto good_area; | 253 | goto good_area; |
252 | out: | 254 | out: |
253 | return fault; | 255 | return fault; |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 2c7cf2f9c837..aa78de8bfdd3 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -489,7 +489,8 @@ static void __init build_mem_type_table(void) | |||
489 | */ | 489 | */ |
490 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { | 490 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { |
491 | mem_types[i].prot_pte |= PTE_EXT_AF; | 491 | mem_types[i].prot_pte |= PTE_EXT_AF; |
492 | mem_types[i].prot_sect |= PMD_SECT_AF; | 492 | if (mem_types[i].prot_sect) |
493 | mem_types[i].prot_sect |= PMD_SECT_AF; | ||
493 | } | 494 | } |
494 | kern_pgprot |= PTE_EXT_AF; | 495 | kern_pgprot |= PTE_EXT_AF; |
495 | vecs_pgprot |= PTE_EXT_AF; | 496 | vecs_pgprot |= PTE_EXT_AF; |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index bc683b8219b5..b0197b2c857d 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/cpu.h> | 12 | #include <linux/cpu.h> |
13 | #include <linux/cpu_pm.h> | 13 | #include <linux/cpu_pm.h> |
14 | #include <linux/hardirq.h> | ||
14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
15 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
16 | #include <linux/signal.h> | 17 | #include <linux/signal.h> |
@@ -432,7 +433,10 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
432 | 433 | ||
433 | static void vfp_enable(void *unused) | 434 | static void vfp_enable(void *unused) |
434 | { | 435 | { |
435 | u32 access = get_copro_access(); | 436 | u32 access; |
437 | |||
438 | BUG_ON(preemptible()); | ||
439 | access = get_copro_access(); | ||
436 | 440 | ||
437 | /* | 441 | /* |
438 | * Enable full access to VFP (cp10 and cp11) | 442 | * Enable full access to VFP (cp10 and cp11) |
@@ -573,12 +577,6 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp, | |||
573 | * entry. | 577 | * entry. |
574 | */ | 578 | */ |
575 | hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK); | 579 | hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK); |
576 | |||
577 | /* | ||
578 | * Disable VFP in the hwstate so that we can detect if it gets | ||
579 | * used. | ||
580 | */ | ||
581 | hwstate->fpexc &= ~FPEXC_EN; | ||
582 | return 0; | 580 | return 0; |
583 | } | 581 | } |
584 | 582 | ||
@@ -591,12 +589,8 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp, | |||
591 | unsigned long fpexc; | 589 | unsigned long fpexc; |
592 | int err = 0; | 590 | int err = 0; |
593 | 591 | ||
594 | /* | 592 | /* Disable VFP to avoid corrupting the new thread state. */ |
595 | * If VFP has been used, then disable it to avoid corrupting | 593 | vfp_flush_hwstate(thread); |
596 | * the new thread state. | ||
597 | */ | ||
598 | if (hwstate->fpexc & FPEXC_EN) | ||
599 | vfp_flush_hwstate(thread); | ||
600 | 594 | ||
601 | /* | 595 | /* |
602 | * Copy the floating point registers. There can be unused | 596 | * Copy the floating point registers. There can be unused |
@@ -657,7 +651,7 @@ static int __init vfp_init(void) | |||
657 | unsigned int cpu_arch = cpu_architecture(); | 651 | unsigned int cpu_arch = cpu_architecture(); |
658 | 652 | ||
659 | if (cpu_arch >= CPU_ARCH_ARMv6) | 653 | if (cpu_arch >= CPU_ARCH_ARMv6) |
660 | vfp_enable(NULL); | 654 | on_each_cpu(vfp_enable, NULL, 1); |
661 | 655 | ||
662 | /* | 656 | /* |
663 | * First check that there is a VFP that we can use. | 657 | * First check that there is a VFP that we can use. |
@@ -678,8 +672,6 @@ static int __init vfp_init(void) | |||
678 | } else { | 672 | } else { |
679 | hotcpu_notifier(vfp_hotplug, 0); | 673 | hotcpu_notifier(vfp_hotplug, 0); |
680 | 674 | ||
681 | smp_call_function(vfp_enable, NULL, 1); | ||
682 | |||
683 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ | 675 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ |
684 | printk("implementor %02x architecture %d part %02x variant %x rev %x\n", | 676 | printk("implementor %02x architecture %d part %02x variant %x rev %x\n", |
685 | (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, | 677 | (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, |
diff --git a/arch/m68k/platform/520x/config.c b/arch/m68k/platform/520x/config.c index 235947844f27..09df4b89e8be 100644 --- a/arch/m68k/platform/520x/config.c +++ b/arch/m68k/platform/520x/config.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | /***************************************************************************/ | 23 | /***************************************************************************/ |
24 | 24 | ||
25 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 25 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
26 | 26 | ||
27 | static void __init m520x_qspi_init(void) | 27 | static void __init m520x_qspi_init(void) |
28 | { | 28 | { |
@@ -35,7 +35,7 @@ static void __init m520x_qspi_init(void) | |||
35 | writew(par, MCF_GPIO_PAR_UART); | 35 | writew(par, MCF_GPIO_PAR_UART); |
36 | } | 36 | } |
37 | 37 | ||
38 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 38 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
39 | 39 | ||
40 | /***************************************************************************/ | 40 | /***************************************************************************/ |
41 | 41 | ||
@@ -79,7 +79,7 @@ void __init config_BSP(char *commandp, int size) | |||
79 | mach_sched_init = hw_timer_init; | 79 | mach_sched_init = hw_timer_init; |
80 | m520x_uarts_init(); | 80 | m520x_uarts_init(); |
81 | m520x_fec_init(); | 81 | m520x_fec_init(); |
82 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 82 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
83 | m520x_qspi_init(); | 83 | m520x_qspi_init(); |
84 | #endif | 84 | #endif |
85 | } | 85 | } |
diff --git a/arch/m68k/platform/523x/config.c b/arch/m68k/platform/523x/config.c index c8b405d5a961..d47dfd8f50a2 100644 --- a/arch/m68k/platform/523x/config.c +++ b/arch/m68k/platform/523x/config.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | /***************************************************************************/ | 23 | /***************************************************************************/ |
24 | 24 | ||
25 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 25 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
26 | 26 | ||
27 | static void __init m523x_qspi_init(void) | 27 | static void __init m523x_qspi_init(void) |
28 | { | 28 | { |
@@ -36,7 +36,7 @@ static void __init m523x_qspi_init(void) | |||
36 | writew(par, MCFGPIO_PAR_TIMER); | 36 | writew(par, MCFGPIO_PAR_TIMER); |
37 | } | 37 | } |
38 | 38 | ||
39 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 39 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
40 | 40 | ||
41 | /***************************************************************************/ | 41 | /***************************************************************************/ |
42 | 42 | ||
@@ -58,7 +58,7 @@ void __init config_BSP(char *commandp, int size) | |||
58 | { | 58 | { |
59 | mach_sched_init = hw_timer_init; | 59 | mach_sched_init = hw_timer_init; |
60 | m523x_fec_init(); | 60 | m523x_fec_init(); |
61 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 61 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
62 | m523x_qspi_init(); | 62 | m523x_qspi_init(); |
63 | #endif | 63 | #endif |
64 | } | 64 | } |
diff --git a/arch/m68k/platform/5249/config.c b/arch/m68k/platform/5249/config.c index bbf05135bb98..300e729a58d0 100644 --- a/arch/m68k/platform/5249/config.c +++ b/arch/m68k/platform/5249/config.c | |||
@@ -51,7 +51,7 @@ static struct platform_device *m5249_devices[] __initdata = { | |||
51 | 51 | ||
52 | /***************************************************************************/ | 52 | /***************************************************************************/ |
53 | 53 | ||
54 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 54 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
55 | 55 | ||
56 | static void __init m5249_qspi_init(void) | 56 | static void __init m5249_qspi_init(void) |
57 | { | 57 | { |
@@ -61,7 +61,7 @@ static void __init m5249_qspi_init(void) | |||
61 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); | 61 | mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); |
62 | } | 62 | } |
63 | 63 | ||
64 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 64 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
65 | 65 | ||
66 | /***************************************************************************/ | 66 | /***************************************************************************/ |
67 | 67 | ||
@@ -90,7 +90,7 @@ void __init config_BSP(char *commandp, int size) | |||
90 | #ifdef CONFIG_M5249C3 | 90 | #ifdef CONFIG_M5249C3 |
91 | m5249_smc91x_init(); | 91 | m5249_smc91x_init(); |
92 | #endif | 92 | #endif |
93 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 93 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
94 | m5249_qspi_init(); | 94 | m5249_qspi_init(); |
95 | #endif | 95 | #endif |
96 | } | 96 | } |
diff --git a/arch/m68k/platform/527x/config.c b/arch/m68k/platform/527x/config.c index f91a53294c35..b3cb378c5e94 100644 --- a/arch/m68k/platform/527x/config.c +++ b/arch/m68k/platform/527x/config.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | /***************************************************************************/ | 24 | /***************************************************************************/ |
25 | 25 | ||
26 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 26 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
27 | 27 | ||
28 | static void __init m527x_qspi_init(void) | 28 | static void __init m527x_qspi_init(void) |
29 | { | 29 | { |
@@ -42,7 +42,7 @@ static void __init m527x_qspi_init(void) | |||
42 | #endif | 42 | #endif |
43 | } | 43 | } |
44 | 44 | ||
45 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 45 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
46 | 46 | ||
47 | /***************************************************************************/ | 47 | /***************************************************************************/ |
48 | 48 | ||
@@ -90,7 +90,7 @@ void __init config_BSP(char *commandp, int size) | |||
90 | mach_sched_init = hw_timer_init; | 90 | mach_sched_init = hw_timer_init; |
91 | m527x_uarts_init(); | 91 | m527x_uarts_init(); |
92 | m527x_fec_init(); | 92 | m527x_fec_init(); |
93 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 93 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
94 | m527x_qspi_init(); | 94 | m527x_qspi_init(); |
95 | #endif | 95 | #endif |
96 | } | 96 | } |
diff --git a/arch/m68k/platform/528x/config.c b/arch/m68k/platform/528x/config.c index d4492926614c..c5f11ba49be5 100644 --- a/arch/m68k/platform/528x/config.c +++ b/arch/m68k/platform/528x/config.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | /***************************************************************************/ | 25 | /***************************************************************************/ |
26 | 26 | ||
27 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 27 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
28 | 28 | ||
29 | static void __init m528x_qspi_init(void) | 29 | static void __init m528x_qspi_init(void) |
30 | { | 30 | { |
@@ -32,7 +32,7 @@ static void __init m528x_qspi_init(void) | |||
32 | __raw_writeb(0x07, MCFGPIO_PQSPAR); | 32 | __raw_writeb(0x07, MCFGPIO_PQSPAR); |
33 | } | 33 | } |
34 | 34 | ||
35 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 35 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
36 | 36 | ||
37 | /***************************************************************************/ | 37 | /***************************************************************************/ |
38 | 38 | ||
@@ -98,7 +98,7 @@ void __init config_BSP(char *commandp, int size) | |||
98 | mach_sched_init = hw_timer_init; | 98 | mach_sched_init = hw_timer_init; |
99 | m528x_uarts_init(); | 99 | m528x_uarts_init(); |
100 | m528x_fec_init(); | 100 | m528x_fec_init(); |
101 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 101 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
102 | m528x_qspi_init(); | 102 | m528x_qspi_init(); |
103 | #endif | 103 | #endif |
104 | } | 104 | } |
diff --git a/arch/m68k/platform/532x/config.c b/arch/m68k/platform/532x/config.c index 2bec3477b739..37082d02f2bd 100644 --- a/arch/m68k/platform/532x/config.c +++ b/arch/m68k/platform/532x/config.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | /***************************************************************************/ | 31 | /***************************************************************************/ |
32 | 32 | ||
33 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 33 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
34 | 34 | ||
35 | static void __init m532x_qspi_init(void) | 35 | static void __init m532x_qspi_init(void) |
36 | { | 36 | { |
@@ -38,7 +38,7 @@ static void __init m532x_qspi_init(void) | |||
38 | writew(0x01f0, MCF_GPIO_PAR_QSPI); | 38 | writew(0x01f0, MCF_GPIO_PAR_QSPI); |
39 | } | 39 | } |
40 | 40 | ||
41 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 41 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
42 | 42 | ||
43 | /***************************************************************************/ | 43 | /***************************************************************************/ |
44 | 44 | ||
@@ -77,7 +77,7 @@ void __init config_BSP(char *commandp, int size) | |||
77 | mach_sched_init = hw_timer_init; | 77 | mach_sched_init = hw_timer_init; |
78 | m532x_uarts_init(); | 78 | m532x_uarts_init(); |
79 | m532x_fec_init(); | 79 | m532x_fec_init(); |
80 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 80 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
81 | m532x_qspi_init(); | 81 | m532x_qspi_init(); |
82 | #endif | 82 | #endif |
83 | 83 | ||
diff --git a/arch/m68k/platform/coldfire/device.c b/arch/m68k/platform/coldfire/device.c index 7af97362b95c..3aa77ddea89d 100644 --- a/arch/m68k/platform/coldfire/device.c +++ b/arch/m68k/platform/coldfire/device.c | |||
@@ -121,7 +121,7 @@ static struct platform_device mcf_fec1 = { | |||
121 | #endif /* MCFFEC_BASE1 */ | 121 | #endif /* MCFFEC_BASE1 */ |
122 | #endif /* CONFIG_FEC */ | 122 | #endif /* CONFIG_FEC */ |
123 | 123 | ||
124 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 124 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
125 | /* | 125 | /* |
126 | * The ColdFire QSPI module is an SPI protocol hardware block used | 126 | * The ColdFire QSPI module is an SPI protocol hardware block used |
127 | * on a number of different ColdFire CPUs. | 127 | * on a number of different ColdFire CPUs. |
@@ -274,7 +274,7 @@ static struct platform_device mcf_qspi = { | |||
274 | .resource = mcf_qspi_resources, | 274 | .resource = mcf_qspi_resources, |
275 | .dev.platform_data = &mcf_qspi_data, | 275 | .dev.platform_data = &mcf_qspi_data, |
276 | }; | 276 | }; |
277 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ | 277 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ |
278 | 278 | ||
279 | static struct platform_device *mcf_devices[] __initdata = { | 279 | static struct platform_device *mcf_devices[] __initdata = { |
280 | &mcf_uart, | 280 | &mcf_uart, |
@@ -284,7 +284,7 @@ static struct platform_device *mcf_devices[] __initdata = { | |||
284 | &mcf_fec1, | 284 | &mcf_fec1, |
285 | #endif | 285 | #endif |
286 | #endif | 286 | #endif |
287 | #ifdef CONFIG_SPI_COLDFIRE_QSPI | 287 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |
288 | &mcf_qspi, | 288 | &mcf_qspi, |
289 | #endif | 289 | #endif |
290 | }; | 290 | }; |
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c index 910dddf65e44..9cd69ad6aa02 100644 --- a/arch/mn10300/kernel/smp.c +++ b/arch/mn10300/kernel/smp.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
25 | #include <linux/profile.h> | 25 | #include <linux/profile.h> |
26 | #include <linux/smp.h> | 26 | #include <linux/smp.h> |
27 | #include <linux/cpu.h> | ||
27 | #include <asm/tlbflush.h> | 28 | #include <asm/tlbflush.h> |
28 | #include <asm/bitops.h> | 29 | #include <asm/bitops.h> |
29 | #include <asm/processor.h> | 30 | #include <asm/processor.h> |
@@ -38,7 +39,6 @@ | |||
38 | #include "internal.h" | 39 | #include "internal.h" |
39 | 40 | ||
40 | #ifdef CONFIG_HOTPLUG_CPU | 41 | #ifdef CONFIG_HOTPLUG_CPU |
41 | #include <linux/cpu.h> | ||
42 | #include <asm/cacheflush.h> | 42 | #include <asm/cacheflush.h> |
43 | 43 | ||
44 | static unsigned long sleep_mode[NR_CPUS]; | 44 | static unsigned long sleep_mode[NR_CPUS]; |
@@ -874,10 +874,13 @@ static void __init smp_online(void) | |||
874 | 874 | ||
875 | cpu = smp_processor_id(); | 875 | cpu = smp_processor_id(); |
876 | 876 | ||
877 | local_irq_enable(); | 877 | notify_cpu_starting(cpu); |
878 | 878 | ||
879 | ipi_call_lock(); | ||
879 | set_cpu_online(cpu, true); | 880 | set_cpu_online(cpu, true); |
880 | smp_wmb(); | 881 | ipi_call_unlock(); |
882 | |||
883 | local_irq_enable(); | ||
881 | } | 884 | } |
882 | 885 | ||
883 | /** | 886 | /** |
diff --git a/arch/parisc/include/asm/hardware.h b/arch/parisc/include/asm/hardware.h index 4e9626836bab..d1d864b81bae 100644 --- a/arch/parisc/include/asm/hardware.h +++ b/arch/parisc/include/asm/hardware.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _PARISC_HARDWARE_H | 2 | #define _PARISC_HARDWARE_H |
3 | 3 | ||
4 | #include <linux/mod_devicetable.h> | 4 | #include <linux/mod_devicetable.h> |
5 | #include <asm/pdc.h> | ||
6 | 5 | ||
7 | #define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID | 6 | #define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID |
8 | #define HVERSION_ANY_ID PA_HVERSION_ANY_ID | 7 | #define HVERSION_ANY_ID PA_HVERSION_ANY_ID |
@@ -95,12 +94,14 @@ struct bc_module { | |||
95 | #define HPHW_MC 15 | 94 | #define HPHW_MC 15 |
96 | #define HPHW_FAULTY 31 | 95 | #define HPHW_FAULTY 31 |
97 | 96 | ||
97 | struct parisc_device_id; | ||
98 | 98 | ||
99 | /* hardware.c: */ | 99 | /* hardware.c: */ |
100 | extern const char *parisc_hardware_description(struct parisc_device_id *id); | 100 | extern const char *parisc_hardware_description(struct parisc_device_id *id); |
101 | extern enum cpu_type parisc_get_cpu_type(unsigned long hversion); | 101 | extern enum cpu_type parisc_get_cpu_type(unsigned long hversion); |
102 | 102 | ||
103 | struct pci_dev; | 103 | struct pci_dev; |
104 | struct hardware_path; | ||
104 | 105 | ||
105 | /* drivers.c: */ | 106 | /* drivers.c: */ |
106 | extern struct parisc_device *alloc_pa_dev(unsigned long hpa, | 107 | extern struct parisc_device *alloc_pa_dev(unsigned long hpa, |
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h index a84cc1f925f6..4e0e7dbf0f3f 100644 --- a/arch/parisc/include/asm/page.h +++ b/arch/parisc/include/asm/page.h | |||
@@ -160,5 +160,11 @@ extern int npmem_ranges; | |||
160 | 160 | ||
161 | #include <asm-generic/memory_model.h> | 161 | #include <asm-generic/memory_model.h> |
162 | #include <asm-generic/getorder.h> | 162 | #include <asm-generic/getorder.h> |
163 | #include <asm/pdc.h> | ||
164 | |||
165 | #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) | ||
166 | |||
167 | /* DEFINITION OF THE ZERO-PAGE (PAG0) */ | ||
168 | /* based on work by Jason Eckhardt (jason@equator.com) */ | ||
163 | 169 | ||
164 | #endif /* _PARISC_PAGE_H */ | 170 | #endif /* _PARISC_PAGE_H */ |
diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h index 4ca510b3c6f8..7f0f2d23059d 100644 --- a/arch/parisc/include/asm/pdc.h +++ b/arch/parisc/include/asm/pdc.h | |||
@@ -343,8 +343,6 @@ | |||
343 | 343 | ||
344 | #ifdef __KERNEL__ | 344 | #ifdef __KERNEL__ |
345 | 345 | ||
346 | #include <asm/page.h> /* for __PAGE_OFFSET */ | ||
347 | |||
348 | extern int pdc_type; | 346 | extern int pdc_type; |
349 | 347 | ||
350 | /* Values for pdc_type */ | 348 | /* Values for pdc_type */ |
@@ -677,11 +675,6 @@ static inline char * os_id_to_string(u16 os_id) { | |||
677 | 675 | ||
678 | #endif /* __KERNEL__ */ | 676 | #endif /* __KERNEL__ */ |
679 | 677 | ||
680 | #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) | ||
681 | |||
682 | /* DEFINITION OF THE ZERO-PAGE (PAG0) */ | ||
683 | /* based on work by Jason Eckhardt (jason@equator.com) */ | ||
684 | |||
685 | /* flags of the device_path */ | 678 | /* flags of the device_path */ |
686 | #define PF_AUTOBOOT 0x80 | 679 | #define PF_AUTOBOOT 0x80 |
687 | #define PF_AUTOSEARCH 0x40 | 680 | #define PF_AUTOSEARCH 0x40 |
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index 22dadeb58695..ee99f2339356 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -44,6 +44,8 @@ struct vm_area_struct; | |||
44 | 44 | ||
45 | #endif /* !__ASSEMBLY__ */ | 45 | #endif /* !__ASSEMBLY__ */ |
46 | 46 | ||
47 | #include <asm/page.h> | ||
48 | |||
47 | #define pte_ERROR(e) \ | 49 | #define pte_ERROR(e) \ |
48 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) | 50 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) |
49 | #define pmd_ERROR(e) \ | 51 | #define pmd_ERROR(e) \ |
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h index 804aa28ab1d6..3516e0b27044 100644 --- a/arch/parisc/include/asm/spinlock.h +++ b/arch/parisc/include/asm/spinlock.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_SPINLOCK_H | 1 | #ifndef __ASM_SPINLOCK_H |
2 | #define __ASM_SPINLOCK_H | 2 | #define __ASM_SPINLOCK_H |
3 | 3 | ||
4 | #include <asm/barrier.h> | ||
5 | #include <asm/ldcw.h> | ||
4 | #include <asm/processor.h> | 6 | #include <asm/processor.h> |
5 | #include <asm/spinlock_types.h> | 7 | #include <asm/spinlock_types.h> |
6 | 8 | ||
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 0b3393381a81..47341aa208f2 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/init.h> | 50 | #include <linux/init.h> |
51 | #include <linux/major.h> | 51 | #include <linux/major.h> |
52 | #include <linux/tty.h> | 52 | #include <linux/tty.h> |
53 | #include <asm/page.h> /* for PAGE0 */ | ||
53 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ | 54 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ |
54 | 55 | ||
55 | static DEFINE_SPINLOCK(pdc_console_lock); | 56 | static DEFINE_SPINLOCK(pdc_console_lock); |
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 0bb1d63907f8..4dc7b7942b4c 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/bitops.h> | 32 | #include <linux/bitops.h> |
33 | #include <linux/ftrace.h> | 33 | #include <linux/ftrace.h> |
34 | #include <linux/cpu.h> | ||
34 | 35 | ||
35 | #include <linux/atomic.h> | 36 | #include <linux/atomic.h> |
36 | #include <asm/current.h> | 37 | #include <asm/current.h> |
@@ -295,8 +296,13 @@ smp_cpu_init(int cpunum) | |||
295 | 296 | ||
296 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); | 297 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); |
297 | machine_halt(); | 298 | machine_halt(); |
298 | } | 299 | } |
300 | |||
301 | notify_cpu_starting(cpunum); | ||
302 | |||
303 | ipi_call_lock(); | ||
299 | set_cpu_online(cpunum, true); | 304 | set_cpu_online(cpunum, true); |
305 | ipi_call_unlock(); | ||
300 | 306 | ||
301 | /* Initialise the idle task for this CPU */ | 307 | /* Initialise the idle task for this CPU */ |
302 | atomic_inc(&init_mm.mm_count); | 308 | atomic_inc(&init_mm.mm_count); |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 7c0774397b89..70e105d62423 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
32 | #include <asm/page.h> | ||
32 | #include <asm/param.h> | 33 | #include <asm/param.h> |
33 | #include <asm/pdc.h> | 34 | #include <asm/pdc.h> |
34 | #include <asm/led.h> | 35 | #include <asm/led.h> |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index aa795ccef294..fd07f43d6622 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -81,12 +81,13 @@ struct kvmppc_vcpu_book3s { | |||
81 | u64 sdr1; | 81 | u64 sdr1; |
82 | u64 hior; | 82 | u64 hior; |
83 | u64 msr_mask; | 83 | u64 msr_mask; |
84 | u64 vsid_next; | ||
85 | #ifdef CONFIG_PPC_BOOK3S_32 | 84 | #ifdef CONFIG_PPC_BOOK3S_32 |
86 | u32 vsid_pool[VSID_POOL_SIZE]; | 85 | u32 vsid_pool[VSID_POOL_SIZE]; |
86 | u32 vsid_next; | ||
87 | #else | 87 | #else |
88 | u64 vsid_first; | 88 | u64 proto_vsid_first; |
89 | u64 vsid_max; | 89 | u64 proto_vsid_max; |
90 | u64 proto_vsid_next; | ||
90 | #endif | 91 | #endif |
91 | int context_id[SID_CONTEXTS]; | 92 | int context_id[SID_CONTEXTS]; |
92 | 93 | ||
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index fc6015027a86..ef2074c3e906 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -588,23 +588,19 @@ _GLOBAL(ret_from_except_lite) | |||
588 | fast_exc_return_irq: | 588 | fast_exc_return_irq: |
589 | restore: | 589 | restore: |
590 | /* | 590 | /* |
591 | * This is the main kernel exit path, we first check if we | 591 | * This is the main kernel exit path. First we check if we |
592 | * have to change our interrupt state. | 592 | * are about to re-enable interrupts |
593 | */ | 593 | */ |
594 | ld r5,SOFTE(r1) | 594 | ld r5,SOFTE(r1) |
595 | lbz r6,PACASOFTIRQEN(r13) | 595 | lbz r6,PACASOFTIRQEN(r13) |
596 | cmpwi cr1,r5,0 | 596 | cmpwi cr0,r5,0 |
597 | cmpw cr0,r5,r6 | 597 | beq restore_irq_off |
598 | beq cr0,4f | ||
599 | 598 | ||
600 | /* We do, handle disable first, which is easy */ | 599 | /* We are enabling, were we already enabled ? Yes, just return */ |
601 | bne cr1,3f; | 600 | cmpwi cr0,r6,1 |
602 | li r0,0 | 601 | beq cr0,do_restore |
603 | stb r0,PACASOFTIRQEN(r13); | ||
604 | TRACE_DISABLE_INTS | ||
605 | b 4f | ||
606 | 602 | ||
607 | 3: /* | 603 | /* |
608 | * We are about to soft-enable interrupts (we are hard disabled | 604 | * We are about to soft-enable interrupts (we are hard disabled |
609 | * at this point). We check if there's anything that needs to | 605 | * at this point). We check if there's anything that needs to |
610 | * be replayed first. | 606 | * be replayed first. |
@@ -626,7 +622,7 @@ restore_no_replay: | |||
626 | /* | 622 | /* |
627 | * Final return path. BookE is handled in a different file | 623 | * Final return path. BookE is handled in a different file |
628 | */ | 624 | */ |
629 | 4: | 625 | do_restore: |
630 | #ifdef CONFIG_PPC_BOOK3E | 626 | #ifdef CONFIG_PPC_BOOK3E |
631 | b .exception_return_book3e | 627 | b .exception_return_book3e |
632 | #else | 628 | #else |
@@ -700,6 +696,25 @@ fast_exception_return: | |||
700 | #endif /* CONFIG_PPC_BOOK3E */ | 696 | #endif /* CONFIG_PPC_BOOK3E */ |
701 | 697 | ||
702 | /* | 698 | /* |
699 | * We are returning to a context with interrupts soft disabled. | ||
700 | * | ||
701 | * However, we may also about to hard enable, so we need to | ||
702 | * make sure that in this case, we also clear PACA_IRQ_HARD_DIS | ||
703 | * or that bit can get out of sync and bad things will happen | ||
704 | */ | ||
705 | restore_irq_off: | ||
706 | ld r3,_MSR(r1) | ||
707 | lbz r7,PACAIRQHAPPENED(r13) | ||
708 | andi. r0,r3,MSR_EE | ||
709 | beq 1f | ||
710 | rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS | ||
711 | stb r7,PACAIRQHAPPENED(r13) | ||
712 | 1: li r0,0 | ||
713 | stb r0,PACASOFTIRQEN(r13); | ||
714 | TRACE_DISABLE_INTS | ||
715 | b do_restore | ||
716 | |||
717 | /* | ||
703 | * Something did happen, check if a re-emit is needed | 718 | * Something did happen, check if a re-emit is needed |
704 | * (this also clears paca->irq_happened) | 719 | * (this also clears paca->irq_happened) |
705 | */ | 720 | */ |
@@ -748,6 +763,9 @@ restore_check_irq_replay: | |||
748 | #endif /* CONFIG_PPC_BOOK3E */ | 763 | #endif /* CONFIG_PPC_BOOK3E */ |
749 | 1: b .ret_from_except /* What else to do here ? */ | 764 | 1: b .ret_from_except /* What else to do here ? */ |
750 | 765 | ||
766 | |||
767 | |||
768 | 3: | ||
751 | do_work: | 769 | do_work: |
752 | #ifdef CONFIG_PREEMPT | 770 | #ifdef CONFIG_PREEMPT |
753 | andi. r0,r3,MSR_PR /* Returning to user mode? */ | 771 | andi. r0,r3,MSR_PR /* Returning to user mode? */ |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index c6c6f3b7f8cd..641da9e868ce 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -229,6 +229,19 @@ notrace void arch_local_irq_restore(unsigned long en) | |||
229 | */ | 229 | */ |
230 | if (unlikely(irq_happened != PACA_IRQ_HARD_DIS)) | 230 | if (unlikely(irq_happened != PACA_IRQ_HARD_DIS)) |
231 | __hard_irq_disable(); | 231 | __hard_irq_disable(); |
232 | #ifdef CONFIG_TRACE_IRQFLAG | ||
233 | else { | ||
234 | /* | ||
235 | * We should already be hard disabled here. We had bugs | ||
236 | * where that wasn't the case so let's dbl check it and | ||
237 | * warn if we are wrong. Only do that when IRQ tracing | ||
238 | * is enabled as mfmsr() can be costly. | ||
239 | */ | ||
240 | if (WARN_ON(mfmsr() & MSR_EE)) | ||
241 | __hard_irq_disable(); | ||
242 | } | ||
243 | #endif /* CONFIG_TRACE_IRQFLAG */ | ||
244 | |||
232 | set_soft_enabled(0); | 245 | set_soft_enabled(0); |
233 | 246 | ||
234 | /* | 247 | /* |
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 6f87f39a1ac2..10fc8ec9d2a8 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c | |||
@@ -194,14 +194,14 @@ static struct kvmppc_sid_map *create_sid_map(struct kvm_vcpu *vcpu, u64 gvsid) | |||
194 | backwards_map = !backwards_map; | 194 | backwards_map = !backwards_map; |
195 | 195 | ||
196 | /* Uh-oh ... out of mappings. Let's flush! */ | 196 | /* Uh-oh ... out of mappings. Let's flush! */ |
197 | if (vcpu_book3s->vsid_next == vcpu_book3s->vsid_max) { | 197 | if (vcpu_book3s->proto_vsid_next == vcpu_book3s->proto_vsid_max) { |
198 | vcpu_book3s->vsid_next = vcpu_book3s->vsid_first; | 198 | vcpu_book3s->proto_vsid_next = vcpu_book3s->proto_vsid_first; |
199 | memset(vcpu_book3s->sid_map, 0, | 199 | memset(vcpu_book3s->sid_map, 0, |
200 | sizeof(struct kvmppc_sid_map) * SID_MAP_NUM); | 200 | sizeof(struct kvmppc_sid_map) * SID_MAP_NUM); |
201 | kvmppc_mmu_pte_flush(vcpu, 0, 0); | 201 | kvmppc_mmu_pte_flush(vcpu, 0, 0); |
202 | kvmppc_mmu_flush_segments(vcpu); | 202 | kvmppc_mmu_flush_segments(vcpu); |
203 | } | 203 | } |
204 | map->host_vsid = vcpu_book3s->vsid_next++; | 204 | map->host_vsid = vsid_scramble(vcpu_book3s->proto_vsid_next++, 256M); |
205 | 205 | ||
206 | map->guest_vsid = gvsid; | 206 | map->guest_vsid = gvsid; |
207 | map->valid = true; | 207 | map->valid = true; |
@@ -319,9 +319,10 @@ int kvmppc_mmu_init(struct kvm_vcpu *vcpu) | |||
319 | return -1; | 319 | return -1; |
320 | vcpu3s->context_id[0] = err; | 320 | vcpu3s->context_id[0] = err; |
321 | 321 | ||
322 | vcpu3s->vsid_max = ((vcpu3s->context_id[0] + 1) << USER_ESID_BITS) - 1; | 322 | vcpu3s->proto_vsid_max = ((vcpu3s->context_id[0] + 1) |
323 | vcpu3s->vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; | 323 | << USER_ESID_BITS) - 1; |
324 | vcpu3s->vsid_next = vcpu3s->vsid_first; | 324 | vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; |
325 | vcpu3s->proto_vsid_next = vcpu3s->proto_vsid_first; | ||
325 | 326 | ||
326 | kvmppc_mmu_hpte_init(vcpu); | 327 | kvmppc_mmu_hpte_init(vcpu); |
327 | 328 | ||
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index def880aea63a..cec4daddbf31 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c | |||
@@ -463,6 +463,7 @@ long kvmppc_h_bulk_remove(struct kvm_vcpu *vcpu) | |||
463 | /* insert R and C bits from PTE */ | 463 | /* insert R and C bits from PTE */ |
464 | rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C); | 464 | rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C); |
465 | args[j] |= rcbits << (56 - 5); | 465 | args[j] |= rcbits << (56 - 5); |
466 | hp[0] = 0; | ||
466 | continue; | 467 | continue; |
467 | } | 468 | } |
468 | 469 | ||
diff --git a/arch/powerpc/kvm/book3s_segment.S b/arch/powerpc/kvm/book3s_segment.S index 0676ae249b9f..6e6e9cef34a8 100644 --- a/arch/powerpc/kvm/book3s_segment.S +++ b/arch/powerpc/kvm/book3s_segment.S | |||
@@ -197,7 +197,8 @@ kvmppc_interrupt: | |||
197 | /* Save guest PC and MSR */ | 197 | /* Save guest PC and MSR */ |
198 | #ifdef CONFIG_PPC64 | 198 | #ifdef CONFIG_PPC64 |
199 | BEGIN_FTR_SECTION | 199 | BEGIN_FTR_SECTION |
200 | andi. r0,r12,0x2 | 200 | andi. r0, r12, 0x2 |
201 | cmpwi cr1, r0, 0 | ||
201 | beq 1f | 202 | beq 1f |
202 | mfspr r3,SPRN_HSRR0 | 203 | mfspr r3,SPRN_HSRR0 |
203 | mfspr r4,SPRN_HSRR1 | 204 | mfspr r4,SPRN_HSRR1 |
@@ -250,6 +251,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | |||
250 | beq ld_last_prev_inst | 251 | beq ld_last_prev_inst |
251 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT | 252 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT |
252 | beq- ld_last_inst | 253 | beq- ld_last_inst |
254 | #ifdef CONFIG_PPC64 | ||
255 | BEGIN_FTR_SECTION | ||
256 | cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST | ||
257 | beq- ld_last_inst | ||
258 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
259 | #endif | ||
253 | 260 | ||
254 | b no_ld_last_inst | 261 | b no_ld_last_inst |
255 | 262 | ||
@@ -316,23 +323,17 @@ no_dcbz32_off: | |||
316 | * Having set up SRR0/1 with the address where we want | 323 | * Having set up SRR0/1 with the address where we want |
317 | * to continue with relocation on (potentially in module | 324 | * to continue with relocation on (potentially in module |
318 | * space), we either just go straight there with rfi[d], | 325 | * space), we either just go straight there with rfi[d], |
319 | * or we jump to an interrupt handler with bctr if there | 326 | * or we jump to an interrupt handler if there is an |
320 | * is an interrupt to be handled first. In the latter | 327 | * interrupt to be handled first. In the latter case, |
321 | * case, the rfi[d] at the end of the interrupt handler | 328 | * the rfi[d] at the end of the interrupt handler will |
322 | * will get us back to where we want to continue. | 329 | * get us back to where we want to continue. |
323 | */ | 330 | */ |
324 | 331 | ||
325 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL | ||
326 | beq 1f | ||
327 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
328 | beq 1f | ||
329 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
330 | 1: mtctr r12 | ||
331 | |||
332 | /* Register usage at this point: | 332 | /* Register usage at this point: |
333 | * | 333 | * |
334 | * R1 = host R1 | 334 | * R1 = host R1 |
335 | * R2 = host R2 | 335 | * R2 = host R2 |
336 | * R10 = raw exit handler id | ||
336 | * R12 = exit handler id | 337 | * R12 = exit handler id |
337 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) | 338 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) |
338 | * SVCPU.* = guest * | 339 | * SVCPU.* = guest * |
@@ -342,12 +343,25 @@ no_dcbz32_off: | |||
342 | PPC_LL r6, HSTATE_HOST_MSR(r13) | 343 | PPC_LL r6, HSTATE_HOST_MSR(r13) |
343 | PPC_LL r8, HSTATE_VMHANDLER(r13) | 344 | PPC_LL r8, HSTATE_VMHANDLER(r13) |
344 | 345 | ||
345 | /* Restore host msr -> SRR1 */ | 346 | #ifdef CONFIG_PPC64 |
347 | BEGIN_FTR_SECTION | ||
348 | beq cr1, 1f | ||
349 | mtspr SPRN_HSRR1, r6 | ||
350 | mtspr SPRN_HSRR0, r8 | ||
351 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
352 | #endif | ||
353 | 1: /* Restore host msr -> SRR1 */ | ||
346 | mtsrr1 r6 | 354 | mtsrr1 r6 |
347 | /* Load highmem handler address */ | 355 | /* Load highmem handler address */ |
348 | mtsrr0 r8 | 356 | mtsrr0 r8 |
349 | 357 | ||
350 | /* RFI into the highmem handler, or jump to interrupt handler */ | 358 | /* RFI into the highmem handler, or jump to interrupt handler */ |
351 | beqctr | 359 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL |
360 | beqa BOOK3S_INTERRUPT_EXTERNAL | ||
361 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
362 | beqa BOOK3S_INTERRUPT_DECREMENTER | ||
363 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
364 | beqa BOOK3S_INTERRUPT_PERFMON | ||
365 | |||
352 | RFI | 366 | RFI |
353 | kvmppc_handler_trampoline_exit_end: | 367 | kvmppc_handler_trampoline_exit_end: |
diff --git a/arch/sh/boards/board-edosk7705.c b/arch/sh/boards/board-edosk7705.c index 541d8a281035..0a531a1f6e23 100644 --- a/arch/sh/boards/board-edosk7705.c +++ b/arch/sh/boards/board-edosk7705.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/smc91x.h> | 15 | #include <linux/smc91x.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <asm/machvec.h> | 17 | #include <asm/machvec.h> |
17 | #include <asm/sizes.h> | 18 | #include <asm/sizes.h> |
18 | 19 | ||
@@ -20,7 +21,7 @@ | |||
20 | #define SMC_IO_OFFSET 0x300 | 21 | #define SMC_IO_OFFSET 0x300 |
21 | #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) | 22 | #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) |
22 | 23 | ||
23 | #define ETHERNET_IRQ 0x09 | 24 | #define ETHERNET_IRQ evt2irq(0x320) |
24 | 25 | ||
25 | static void __init sh_edosk7705_init_irq(void) | 26 | static void __init sh_edosk7705_init_irq(void) |
26 | { | 27 | { |
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c index e9656a2cc4cc..d4871d274fb9 100644 --- a/arch/sh/boards/board-edosk7760.c +++ b/arch/sh/boards/board-edosk7760.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/smc91x.h> | 24 | #include <linux/smc91x.h> |
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/sh_intc.h> | ||
26 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
27 | #include <linux/mtd/physmap.h> | 28 | #include <linux/mtd/physmap.h> |
28 | #include <asm/machvec.h> | 29 | #include <asm/machvec.h> |
@@ -40,8 +41,6 @@ | |||
40 | #define SMC_IO_OFFSET 0x300 | 41 | #define SMC_IO_OFFSET 0x300 |
41 | #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) | 42 | #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) |
42 | 43 | ||
43 | #define ETHERNET_IRQ 5 | ||
44 | |||
45 | /* NOR flash */ | 44 | /* NOR flash */ |
46 | static struct mtd_partition edosk7760_nor_flash_partitions[] = { | 45 | static struct mtd_partition edosk7760_nor_flash_partitions[] = { |
47 | { | 46 | { |
@@ -99,8 +98,8 @@ static struct resource sh7760_i2c1_res[] = { | |||
99 | .end = SH7760_I2C1_MMIOEND, | 98 | .end = SH7760_I2C1_MMIOEND, |
100 | .flags = IORESOURCE_MEM, | 99 | .flags = IORESOURCE_MEM, |
101 | },{ | 100 | },{ |
102 | .start = SH7760_I2C1_IRQ, | 101 | .start = evt2irq(0x9e0), |
103 | .end = SH7760_I2C1_IRQ, | 102 | .end = evt2irq(0x9e0), |
104 | .flags = IORESOURCE_IRQ, | 103 | .flags = IORESOURCE_IRQ, |
105 | }, | 104 | }, |
106 | }; | 105 | }; |
@@ -122,8 +121,8 @@ static struct resource sh7760_i2c0_res[] = { | |||
122 | .end = SH7760_I2C0_MMIOEND, | 121 | .end = SH7760_I2C0_MMIOEND, |
123 | .flags = IORESOURCE_MEM, | 122 | .flags = IORESOURCE_MEM, |
124 | }, { | 123 | }, { |
125 | .start = SH7760_I2C0_IRQ, | 124 | .start = evt2irq(0x9c0), |
126 | .end = SH7760_I2C0_IRQ, | 125 | .end = evt2irq(0x9c0), |
127 | .flags = IORESOURCE_IRQ, | 126 | .flags = IORESOURCE_IRQ, |
128 | }, | 127 | }, |
129 | }; | 128 | }; |
@@ -150,8 +149,8 @@ static struct resource smc91x_res[] = { | |||
150 | .flags = IORESOURCE_MEM, | 149 | .flags = IORESOURCE_MEM, |
151 | }, | 150 | }, |
152 | [1] = { | 151 | [1] = { |
153 | .start = ETHERNET_IRQ, | 152 | .start = evt2irq(0x2a0), |
154 | .end = ETHERNET_IRQ, | 153 | .end = evt2irq(0x2a0), |
155 | .flags = IORESOURCE_IRQ , | 154 | .flags = IORESOURCE_IRQ , |
156 | } | 155 | } |
157 | }; | 156 | }; |
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c index b3ae9d38cbc0..6cba0a7068bc 100644 --- a/arch/sh/boards/board-espt.c +++ b/arch/sh/boards/board-espt.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mtd/physmap.h> | 14 | #include <linux/mtd/physmap.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/sh_eth.h> | 16 | #include <linux/sh_eth.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include <asm/machvec.h> | 18 | #include <asm/machvec.h> |
18 | #include <asm/sizes.h> | 19 | #include <asm/sizes.h> |
19 | 20 | ||
@@ -71,7 +72,7 @@ static struct resource sh_eth_resources[] = { | |||
71 | .flags = IORESOURCE_MEM, | 72 | .flags = IORESOURCE_MEM, |
72 | }, { | 73 | }, { |
73 | 74 | ||
74 | .start = 57, /* irq number */ | 75 | .start = evt2irq(0x920), /* irq number */ |
75 | .flags = IORESOURCE_IRQ, | 76 | .flags = IORESOURCE_IRQ, |
76 | }, | 77 | }, |
77 | }; | 78 | }; |
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c index b2ca1d9948fb..90568f9de3a4 100644 --- a/arch/sh/boards/board-magicpanelr2.c +++ b/arch/sh/boards/board-magicpanelr2.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
20 | #include <linux/mtd/physmap.h> | 20 | #include <linux/mtd/physmap.h> |
21 | #include <linux/mtd/map.h> | 21 | #include <linux/mtd/map.h> |
22 | #include <linux/sh_intc.h> | ||
22 | #include <mach/magicpanelr2.h> | 23 | #include <mach/magicpanelr2.h> |
23 | #include <asm/heartbeat.h> | 24 | #include <asm/heartbeat.h> |
24 | #include <cpu/sh7720.h> | 25 | #include <cpu/sh7720.h> |
@@ -245,8 +246,8 @@ static struct resource smsc911x_resources[] = { | |||
245 | .flags = IORESOURCE_MEM, | 246 | .flags = IORESOURCE_MEM, |
246 | }, | 247 | }, |
247 | [1] = { | 248 | [1] = { |
248 | .start = 35, | 249 | .start = evt2irq(0x660), |
249 | .end = 35, | 250 | .end = evt2irq(0x660), |
250 | .flags = IORESOURCE_IRQ, | 251 | .flags = IORESOURCE_IRQ, |
251 | }, | 252 | }, |
252 | }; | 253 | }; |
@@ -358,17 +359,17 @@ static void __init init_mpr2_IRQ(void) | |||
358 | { | 359 | { |
359 | plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */ | 360 | plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */ |
360 | 361 | ||
361 | irq_set_irq_type(32, IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */ | 362 | irq_set_irq_type(evt2irq(0x600), IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */ |
362 | irq_set_irq_type(33, IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */ | 363 | irq_set_irq_type(evt2irq(0x620), IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */ |
363 | irq_set_irq_type(34, IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */ | 364 | irq_set_irq_type(evt2irq(0x640), IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */ |
364 | irq_set_irq_type(35, IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */ | 365 | irq_set_irq_type(evt2irq(0x660), IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */ |
365 | irq_set_irq_type(36, IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */ | 366 | irq_set_irq_type(evt2irq(0x680), IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */ |
366 | irq_set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */ | 367 | irq_set_irq_type(evt2irq(0x6a0), IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */ |
367 | 368 | ||
368 | intc_set_priority(32, 13); /* IRQ0 CAN1 */ | 369 | intc_set_priority(evt2irq(0x600), 13); /* IRQ0 CAN1 */ |
369 | intc_set_priority(33, 13); /* IRQ0 CAN2 */ | 370 | intc_set_priority(evt2irq(0x620), 13); /* IRQ0 CAN2 */ |
370 | intc_set_priority(34, 13); /* IRQ0 CAN3 */ | 371 | intc_set_priority(evt2irq(0x640), 13); /* IRQ0 CAN3 */ |
371 | intc_set_priority(35, 6); /* IRQ3 SMSC9115 */ | 372 | intc_set_priority(evt2irq(0x660), 6); /* IRQ3 SMSC9115 */ |
372 | } | 373 | } |
373 | 374 | ||
374 | /* | 375 | /* |
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c index 24b1ee410daa..5087f8bb4cff 100644 --- a/arch/sh/boards/board-sh7757lcr.c +++ b/arch/sh/boards/board-sh7757lcr.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mmc/sh_mmcif.h> | 19 | #include <linux/mmc/sh_mmcif.h> |
20 | #include <linux/mmc/sh_mobile_sdhi.h> | 20 | #include <linux/mmc/sh_mobile_sdhi.h> |
21 | #include <linux/sh_eth.h> | 21 | #include <linux/sh_eth.h> |
22 | #include <linux/sh_intc.h> | ||
22 | #include <linux/usb/renesas_usbhs.h> | 23 | #include <linux/usb/renesas_usbhs.h> |
23 | #include <cpu/sh7757.h> | 24 | #include <cpu/sh7757.h> |
24 | #include <asm/heartbeat.h> | 25 | #include <asm/heartbeat.h> |
@@ -65,8 +66,8 @@ static struct resource sh_eth0_resources[] = { | |||
65 | .end = 0xfef001ff, | 66 | .end = 0xfef001ff, |
66 | .flags = IORESOURCE_MEM, | 67 | .flags = IORESOURCE_MEM, |
67 | }, { | 68 | }, { |
68 | .start = 84, | 69 | .start = evt2irq(0xc80), |
69 | .end = 84, | 70 | .end = evt2irq(0xc80), |
70 | .flags = IORESOURCE_IRQ, | 71 | .flags = IORESOURCE_IRQ, |
71 | }, | 72 | }, |
72 | }; | 73 | }; |
@@ -94,8 +95,8 @@ static struct resource sh_eth1_resources[] = { | |||
94 | .end = 0xfef009ff, | 95 | .end = 0xfef009ff, |
95 | .flags = IORESOURCE_MEM, | 96 | .flags = IORESOURCE_MEM, |
96 | }, { | 97 | }, { |
97 | .start = 84, | 98 | .start = evt2irq(0xc80), |
98 | .end = 84, | 99 | .end = evt2irq(0xc80), |
99 | .flags = IORESOURCE_IRQ, | 100 | .flags = IORESOURCE_IRQ, |
100 | }, | 101 | }, |
101 | }; | 102 | }; |
@@ -139,8 +140,8 @@ static struct resource sh_eth_giga0_resources[] = { | |||
139 | .end = 0xfee01fff, | 140 | .end = 0xfee01fff, |
140 | .flags = IORESOURCE_MEM, | 141 | .flags = IORESOURCE_MEM, |
141 | }, { | 142 | }, { |
142 | .start = 315, | 143 | .start = evt2irq(0x2960), |
143 | .end = 315, | 144 | .end = evt2irq(0x2960), |
144 | .flags = IORESOURCE_IRQ, | 145 | .flags = IORESOURCE_IRQ, |
145 | }, | 146 | }, |
146 | }; | 147 | }; |
@@ -174,8 +175,8 @@ static struct resource sh_eth_giga1_resources[] = { | |||
174 | .end = 0xfee01fff, | 175 | .end = 0xfee01fff, |
175 | .flags = IORESOURCE_MEM, | 176 | .flags = IORESOURCE_MEM, |
176 | }, { | 177 | }, { |
177 | .start = 316, | 178 | .start = evt2irq(0x2980), |
178 | .end = 316, | 179 | .end = evt2irq(0x2980), |
179 | .flags = IORESOURCE_IRQ, | 180 | .flags = IORESOURCE_IRQ, |
180 | }, | 181 | }, |
181 | }; | 182 | }; |
@@ -206,11 +207,11 @@ static struct resource sh_mmcif_resources[] = { | |||
206 | .flags = IORESOURCE_MEM, | 207 | .flags = IORESOURCE_MEM, |
207 | }, | 208 | }, |
208 | [1] = { | 209 | [1] = { |
209 | .start = 211, | 210 | .start = evt2irq(0x1c60), |
210 | .flags = IORESOURCE_IRQ, | 211 | .flags = IORESOURCE_IRQ, |
211 | }, | 212 | }, |
212 | [2] = { | 213 | [2] = { |
213 | .start = 212, | 214 | .start = evt2irq(0x1c80), |
214 | .flags = IORESOURCE_IRQ, | 215 | .flags = IORESOURCE_IRQ, |
215 | }, | 216 | }, |
216 | }; | 217 | }; |
@@ -248,7 +249,7 @@ static struct resource sdhi_resources[] = { | |||
248 | .flags = IORESOURCE_MEM, | 249 | .flags = IORESOURCE_MEM, |
249 | }, | 250 | }, |
250 | [1] = { | 251 | [1] = { |
251 | .start = 20, | 252 | .start = evt2irq(0x480), |
252 | .flags = IORESOURCE_IRQ, | 253 | .flags = IORESOURCE_IRQ, |
253 | }, | 254 | }, |
254 | }; | 255 | }; |
@@ -284,8 +285,8 @@ static struct resource usb0_resources[] = { | |||
284 | .flags = IORESOURCE_MEM, | 285 | .flags = IORESOURCE_MEM, |
285 | }, | 286 | }, |
286 | [1] = { | 287 | [1] = { |
287 | .start = 50, | 288 | .start = evt2irq(0x840), |
288 | .end = 50, | 289 | .end = evt2irq(0x840), |
289 | .flags = IORESOURCE_IRQ, | 290 | .flags = IORESOURCE_IRQ, |
290 | }, | 291 | }, |
291 | }; | 292 | }; |
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c index d0d6221d7c2e..2c4771ee84cd 100644 --- a/arch/sh/boards/board-sh7785lcr.c +++ b/arch/sh/boards/board-sh7785lcr.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/i2c-pca-platform.h> | 20 | #include <linux/i2c-pca-platform.h> |
21 | #include <linux/i2c-algo-pca.h> | 21 | #include <linux/i2c-algo-pca.h> |
22 | #include <linux/usb/r8a66597.h> | 22 | #include <linux/usb/r8a66597.h> |
23 | #include <linux/sh_intc.h> | ||
23 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
25 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
@@ -105,8 +106,8 @@ static struct resource r8a66597_usb_host_resources[] = { | |||
105 | .flags = IORESOURCE_MEM, | 106 | .flags = IORESOURCE_MEM, |
106 | }, | 107 | }, |
107 | [1] = { | 108 | [1] = { |
108 | .start = 2, | 109 | .start = evt2irq(0x240), |
109 | .end = 2, | 110 | .end = evt2irq(0x240), |
110 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 111 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
111 | }, | 112 | }, |
112 | }; | 113 | }; |
@@ -135,7 +136,7 @@ static struct resource sm501_resources[] = { | |||
135 | .flags = IORESOURCE_MEM, | 136 | .flags = IORESOURCE_MEM, |
136 | }, | 137 | }, |
137 | [2] = { | 138 | [2] = { |
138 | .start = 10, | 139 | .start = evt2irq(0x340), |
139 | .flags = IORESOURCE_IRQ, | 140 | .flags = IORESOURCE_IRQ, |
140 | }, | 141 | }, |
141 | }; | 142 | }; |
@@ -223,8 +224,8 @@ static struct resource i2c_proto_resources[] = { | |||
223 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, | 224 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, |
224 | }, | 225 | }, |
225 | [1] = { | 226 | [1] = { |
226 | .start = 12, | 227 | .start = evt2irq(0x380), |
227 | .end = 12, | 228 | .end = evt2irq(0x380), |
228 | .flags = IORESOURCE_IRQ, | 229 | .flags = IORESOURCE_IRQ, |
229 | }, | 230 | }, |
230 | }; | 231 | }; |
@@ -236,8 +237,8 @@ static struct resource i2c_resources[] = { | |||
236 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, | 237 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, |
237 | }, | 238 | }, |
238 | [1] = { | 239 | [1] = { |
239 | .start = 12, | 240 | .start = evt2irq(0x380), |
240 | .end = 12, | 241 | .end = evt2irq(0x380), |
241 | .flags = IORESOURCE_IRQ, | 242 | .flags = IORESOURCE_IRQ, |
242 | }, | 243 | }, |
243 | }; | 244 | }; |
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c index 24e3316c5c17..b52abcc5259a 100644 --- a/arch/sh/boards/board-urquell.c +++ b/arch/sh/boards/board-urquell.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/sh_intc.h> | ||
23 | #include <mach/urquell.h> | 24 | #include <mach/urquell.h> |
24 | #include <cpu/sh7786.h> | 25 | #include <cpu/sh7786.h> |
25 | #include <asm/heartbeat.h> | 26 | #include <asm/heartbeat.h> |
@@ -78,7 +79,7 @@ static struct resource smc91x_eth_resources[] = { | |||
78 | .flags = IORESOURCE_MEM, | 79 | .flags = IORESOURCE_MEM, |
79 | }, | 80 | }, |
80 | [1] = { | 81 | [1] = { |
81 | .start = 11, | 82 | .start = evt2irq(0x360), |
82 | .flags = IORESOURCE_IRQ, | 83 | .flags = IORESOURCE_IRQ, |
83 | }, | 84 | }, |
84 | }; | 85 | }; |
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 8cf02e343333..f33ebf447073 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/smsc911x.h> | 23 | #include <linux/smsc911x.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | #include <linux/sh_intc.h> | ||
26 | #include <media/ov772x.h> | 27 | #include <media/ov772x.h> |
27 | #include <media/soc_camera.h> | 28 | #include <media/soc_camera.h> |
28 | #include <media/soc_camera_platform.h> | 29 | #include <media/soc_camera_platform.h> |
@@ -47,8 +48,8 @@ static struct resource smsc9118_resources[] = { | |||
47 | .flags = IORESOURCE_MEM, | 48 | .flags = IORESOURCE_MEM, |
48 | }, | 49 | }, |
49 | [1] = { | 50 | [1] = { |
50 | .start = 35, | 51 | .start = evt2irq(0x660), |
51 | .end = 35, | 52 | .end = evt2irq(0x660), |
52 | .flags = IORESOURCE_IRQ, | 53 | .flags = IORESOURCE_IRQ, |
53 | } | 54 | } |
54 | }; | 55 | }; |
@@ -166,7 +167,7 @@ static int ap320_wvga_set_brightness(int brightness) | |||
166 | __raw_writew(0, FPGA_BKLREG); | 167 | __raw_writew(0, FPGA_BKLREG); |
167 | gpio_set_value(GPIO_PTS3, 1); | 168 | gpio_set_value(GPIO_PTS3, 1); |
168 | } | 169 | } |
169 | 170 | ||
170 | return 0; | 171 | return 0; |
171 | } | 172 | } |
172 | 173 | ||
@@ -236,7 +237,7 @@ static struct resource lcdc_resources[] = { | |||
236 | .flags = IORESOURCE_MEM, | 237 | .flags = IORESOURCE_MEM, |
237 | }, | 238 | }, |
238 | [1] = { | 239 | [1] = { |
239 | .start = 28, | 240 | .start = evt2irq(0x580), |
240 | .flags = IORESOURCE_IRQ, | 241 | .flags = IORESOURCE_IRQ, |
241 | }, | 242 | }, |
242 | }; | 243 | }; |
@@ -404,7 +405,7 @@ static struct resource ceu_resources[] = { | |||
404 | .flags = IORESOURCE_MEM, | 405 | .flags = IORESOURCE_MEM, |
405 | }, | 406 | }, |
406 | [1] = { | 407 | [1] = { |
407 | .start = 52, | 408 | .start = evt2irq(0x880), |
408 | .flags = IORESOURCE_IRQ, | 409 | .flags = IORESOURCE_IRQ, |
409 | }, | 410 | }, |
410 | [2] = { | 411 | [2] = { |
@@ -430,7 +431,7 @@ static struct resource sdhi0_cn3_resources[] = { | |||
430 | .flags = IORESOURCE_MEM, | 431 | .flags = IORESOURCE_MEM, |
431 | }, | 432 | }, |
432 | [1] = { | 433 | [1] = { |
433 | .start = 100, | 434 | .start = evt2irq(0xe80), |
434 | .flags = IORESOURCE_IRQ, | 435 | .flags = IORESOURCE_IRQ, |
435 | }, | 436 | }, |
436 | }; | 437 | }; |
@@ -457,7 +458,7 @@ static struct resource sdhi1_cn7_resources[] = { | |||
457 | .flags = IORESOURCE_MEM, | 458 | .flags = IORESOURCE_MEM, |
458 | }, | 459 | }, |
459 | [1] = { | 460 | [1] = { |
460 | .start = 23, | 461 | .start = evt2irq(0x4e0), |
461 | .flags = IORESOURCE_IRQ, | 462 | .flags = IORESOURCE_IRQ, |
462 | }, | 463 | }, |
463 | }; | 464 | }; |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index d12fe9ddf3da..63002c8a0ec8 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
30 | #include <linux/input/sh_keysc.h> | 30 | #include <linux/input/sh_keysc.h> |
31 | #include <linux/sh_eth.h> | 31 | #include <linux/sh_eth.h> |
32 | #include <linux/sh_intc.h> | ||
32 | #include <linux/videodev2.h> | 33 | #include <linux/videodev2.h> |
33 | #include <video/sh_mobile_lcdc.h> | 34 | #include <video/sh_mobile_lcdc.h> |
34 | #include <sound/sh_fsi.h> | 35 | #include <sound/sh_fsi.h> |
@@ -137,7 +138,7 @@ static struct resource sh_eth_resources[] = { | |||
137 | .flags = IORESOURCE_MEM, | 138 | .flags = IORESOURCE_MEM, |
138 | }, | 139 | }, |
139 | [1] = { | 140 | [1] = { |
140 | .start = 91, | 141 | .start = evt2irq(0xd60), |
141 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 142 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
142 | }, | 143 | }, |
143 | }; | 144 | }; |
@@ -178,8 +179,8 @@ static struct resource usb0_host_resources[] = { | |||
178 | .flags = IORESOURCE_MEM, | 179 | .flags = IORESOURCE_MEM, |
179 | }, | 180 | }, |
180 | [1] = { | 181 | [1] = { |
181 | .start = 65, | 182 | .start = evt2irq(0xa20), |
182 | .end = 65, | 183 | .end = evt2irq(0xa20), |
183 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 184 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
184 | }, | 185 | }, |
185 | }; | 186 | }; |
@@ -214,8 +215,8 @@ static struct resource usb1_common_resources[] = { | |||
214 | .flags = IORESOURCE_MEM, | 215 | .flags = IORESOURCE_MEM, |
215 | }, | 216 | }, |
216 | [1] = { | 217 | [1] = { |
217 | .start = 66, | 218 | .start = evt2irq(0xa40), |
218 | .end = 66, | 219 | .end = evt2irq(0xa40), |
219 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 220 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
220 | }, | 221 | }, |
221 | }; | 222 | }; |
@@ -261,8 +262,8 @@ static struct resource usbhs_resources[] = { | |||
261 | .flags = IORESOURCE_MEM, | 262 | .flags = IORESOURCE_MEM, |
262 | }, | 263 | }, |
263 | [1] = { | 264 | [1] = { |
264 | .start = 66, | 265 | .start = evt2irq(0xa40), |
265 | .end = 66, | 266 | .end = evt2irq(0xa40), |
266 | .flags = IORESOURCE_IRQ, | 267 | .flags = IORESOURCE_IRQ, |
267 | }, | 268 | }, |
268 | }; | 269 | }; |
@@ -348,7 +349,7 @@ static struct resource lcdc_resources[] = { | |||
348 | .flags = IORESOURCE_MEM, | 349 | .flags = IORESOURCE_MEM, |
349 | }, | 350 | }, |
350 | [1] = { | 351 | [1] = { |
351 | .start = 106, | 352 | .start = evt2irq(0xf40), |
352 | .flags = IORESOURCE_IRQ, | 353 | .flags = IORESOURCE_IRQ, |
353 | }, | 354 | }, |
354 | }; | 355 | }; |
@@ -375,7 +376,7 @@ static struct resource ceu0_resources[] = { | |||
375 | .flags = IORESOURCE_MEM, | 376 | .flags = IORESOURCE_MEM, |
376 | }, | 377 | }, |
377 | [1] = { | 378 | [1] = { |
378 | .start = 52, | 379 | .start = evt2irq(0x880), |
379 | .flags = IORESOURCE_IRQ, | 380 | .flags = IORESOURCE_IRQ, |
380 | }, | 381 | }, |
381 | [2] = { | 382 | [2] = { |
@@ -406,7 +407,7 @@ static struct resource ceu1_resources[] = { | |||
406 | .flags = IORESOURCE_MEM, | 407 | .flags = IORESOURCE_MEM, |
407 | }, | 408 | }, |
408 | [1] = { | 409 | [1] = { |
409 | .start = 63, | 410 | .start = evt2irq(0x9e0), |
410 | .flags = IORESOURCE_IRQ, | 411 | .flags = IORESOURCE_IRQ, |
411 | }, | 412 | }, |
412 | [2] = { | 413 | [2] = { |
@@ -437,7 +438,7 @@ static struct i2c_board_info i2c1_devices[] = { | |||
437 | }, | 438 | }, |
438 | { | 439 | { |
439 | I2C_BOARD_INFO("lis3lv02d", 0x1c), | 440 | I2C_BOARD_INFO("lis3lv02d", 0x1c), |
440 | .irq = 33, | 441 | .irq = evt2irq(0x620), |
441 | } | 442 | } |
442 | }; | 443 | }; |
443 | 444 | ||
@@ -463,7 +464,7 @@ static struct resource keysc_resources[] = { | |||
463 | .flags = IORESOURCE_MEM, | 464 | .flags = IORESOURCE_MEM, |
464 | }, | 465 | }, |
465 | [1] = { | 466 | [1] = { |
466 | .start = 79, | 467 | .start = evt2irq(0xbe0), |
467 | .flags = IORESOURCE_IRQ, | 468 | .flags = IORESOURCE_IRQ, |
468 | }, | 469 | }, |
469 | }; | 470 | }; |
@@ -479,7 +480,8 @@ static struct platform_device keysc_device = { | |||
479 | }; | 480 | }; |
480 | 481 | ||
481 | /* TouchScreen */ | 482 | /* TouchScreen */ |
482 | #define IRQ0 32 | 483 | #define IRQ0 evt2irq(0x600) |
484 | |||
483 | static int ts_get_pendown_state(void) | 485 | static int ts_get_pendown_state(void) |
484 | { | 486 | { |
485 | int val = 0; | 487 | int val = 0; |
@@ -544,7 +546,7 @@ static struct resource sdhi0_resources[] = { | |||
544 | .flags = IORESOURCE_MEM, | 546 | .flags = IORESOURCE_MEM, |
545 | }, | 547 | }, |
546 | [1] = { | 548 | [1] = { |
547 | .start = 100, | 549 | .start = evt2irq(0xe80), |
548 | .flags = IORESOURCE_IRQ, | 550 | .flags = IORESOURCE_IRQ, |
549 | }, | 551 | }, |
550 | }; | 552 | }; |
@@ -588,7 +590,7 @@ static struct resource sdhi1_resources[] = { | |||
588 | .flags = IORESOURCE_MEM, | 590 | .flags = IORESOURCE_MEM, |
589 | }, | 591 | }, |
590 | [1] = { | 592 | [1] = { |
591 | .start = 23, | 593 | .start = evt2irq(0x4e0), |
592 | .flags = IORESOURCE_IRQ, | 594 | .flags = IORESOURCE_IRQ, |
593 | }, | 595 | }, |
594 | }; | 596 | }; |
@@ -653,7 +655,7 @@ static struct resource msiof0_resources[] = { | |||
653 | .flags = IORESOURCE_MEM, | 655 | .flags = IORESOURCE_MEM, |
654 | }, | 656 | }, |
655 | [1] = { | 657 | [1] = { |
656 | .start = 84, | 658 | .start = evt2irq(0xc80), |
657 | .flags = IORESOURCE_IRQ, | 659 | .flags = IORESOURCE_IRQ, |
658 | }, | 660 | }, |
659 | }; | 661 | }; |
@@ -794,7 +796,7 @@ static struct resource fsi_resources[] = { | |||
794 | .flags = IORESOURCE_MEM, | 796 | .flags = IORESOURCE_MEM, |
795 | }, | 797 | }, |
796 | [1] = { | 798 | [1] = { |
797 | .start = 108, | 799 | .start = evt2irq(0xf80), |
798 | .flags = IORESOURCE_IRQ, | 800 | .flags = IORESOURCE_IRQ, |
799 | }, | 801 | }, |
800 | }; | 802 | }; |
@@ -818,7 +820,7 @@ static struct resource irda_resources[] = { | |||
818 | .flags = IORESOURCE_MEM, | 820 | .flags = IORESOURCE_MEM, |
819 | }, | 821 | }, |
820 | [1] = { | 822 | [1] = { |
821 | .start = 20, | 823 | .start = evt2irq(0x480), |
822 | .flags = IORESOURCE_IRQ, | 824 | .flags = IORESOURCE_IRQ, |
823 | }, | 825 | }, |
824 | }; | 826 | }; |
@@ -855,7 +857,7 @@ static struct resource sh_vou_resources[] = { | |||
855 | .flags = IORESOURCE_MEM, | 857 | .flags = IORESOURCE_MEM, |
856 | }, | 858 | }, |
857 | [1] = { | 859 | [1] = { |
858 | .start = 55, | 860 | .start = evt2irq(0x8e0), |
859 | .flags = IORESOURCE_IRQ, | 861 | .flags = IORESOURCE_IRQ, |
860 | }, | 862 | }, |
861 | }; | 863 | }; |
@@ -891,12 +893,12 @@ static struct resource sh_mmcif_resources[] = { | |||
891 | }, | 893 | }, |
892 | [1] = { | 894 | [1] = { |
893 | /* MMC2I */ | 895 | /* MMC2I */ |
894 | .start = 29, | 896 | .start = evt2irq(0x5a0), |
895 | .flags = IORESOURCE_IRQ, | 897 | .flags = IORESOURCE_IRQ, |
896 | }, | 898 | }, |
897 | [2] = { | 899 | [2] = { |
898 | /* MMC3I */ | 900 | /* MMC3I */ |
899 | .start = 30, | 901 | .start = evt2irq(0x5c0), |
900 | .flags = IORESOURCE_IRQ, | 902 | .flags = IORESOURCE_IRQ, |
901 | }, | 903 | }, |
902 | }; | 904 | }; |
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c index 8c9add5f4cfa..db34cad1b76c 100644 --- a/arch/sh/boards/mach-hp6xx/setup.c +++ b/arch/sh/boards/mach-hp6xx/setup.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <sound/sh_dac_audio.h> | 17 | #include <sound/sh_dac_audio.h> |
17 | #include <asm/hd64461.h> | 18 | #include <asm/hd64461.h> |
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
@@ -35,7 +36,7 @@ static struct resource cf_ide_resources[] = { | |||
35 | .flags = IORESOURCE_MEM, | 36 | .flags = IORESOURCE_MEM, |
36 | }, | 37 | }, |
37 | [2] = { | 38 | [2] = { |
38 | .start = 77, | 39 | .start = evt2irq(0xba0), |
39 | .flags = IORESOURCE_IRQ, | 40 | .flags = IORESOURCE_IRQ, |
40 | }, | 41 | }, |
41 | }; | 42 | }; |
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index d04a55d3b877..158c9176e42a 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/usb/r8a66597.h> | 24 | #include <linux/usb/r8a66597.h> |
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | #include <linux/sh_intc.h> | ||
26 | #include <media/rj54n1cb0c.h> | 27 | #include <media/rj54n1cb0c.h> |
27 | #include <media/soc_camera.h> | 28 | #include <media/soc_camera.h> |
28 | #include <media/sh_mobile_ceu.h> | 29 | #include <media/sh_mobile_ceu.h> |
@@ -110,7 +111,7 @@ static struct resource kfr2r09_sh_keysc_resources[] = { | |||
110 | .flags = IORESOURCE_MEM, | 111 | .flags = IORESOURCE_MEM, |
111 | }, | 112 | }, |
112 | [1] = { | 113 | [1] = { |
113 | .start = 79, | 114 | .start = evt2irq(0xbe0), |
114 | .flags = IORESOURCE_IRQ, | 115 | .flags = IORESOURCE_IRQ, |
115 | }, | 116 | }, |
116 | }; | 117 | }; |
@@ -175,7 +176,7 @@ static struct resource kfr2r09_sh_lcdc_resources[] = { | |||
175 | .flags = IORESOURCE_MEM, | 176 | .flags = IORESOURCE_MEM, |
176 | }, | 177 | }, |
177 | [1] = { | 178 | [1] = { |
178 | .start = 106, | 179 | .start = evt2irq(0xf40), |
179 | .flags = IORESOURCE_IRQ, | 180 | .flags = IORESOURCE_IRQ, |
180 | }, | 181 | }, |
181 | }; | 182 | }; |
@@ -200,8 +201,8 @@ static struct resource kfr2r09_usb0_gadget_resources[] = { | |||
200 | .flags = IORESOURCE_MEM, | 201 | .flags = IORESOURCE_MEM, |
201 | }, | 202 | }, |
202 | [1] = { | 203 | [1] = { |
203 | .start = 65, | 204 | .start = evtirq(0xa20), |
204 | .end = 65, | 205 | .end = evtirq(0xa20), |
205 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 206 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
206 | }, | 207 | }, |
207 | }; | 208 | }; |
@@ -230,8 +231,8 @@ static struct resource kfr2r09_ceu_resources[] = { | |||
230 | .flags = IORESOURCE_MEM, | 231 | .flags = IORESOURCE_MEM, |
231 | }, | 232 | }, |
232 | [1] = { | 233 | [1] = { |
233 | .start = 52, | 234 | .start = evt2irq(0x880), |
234 | .end = 52, | 235 | .end = evt2irq(0x880), |
235 | .flags = IORESOURCE_IRQ, | 236 | .flags = IORESOURCE_IRQ, |
236 | }, | 237 | }, |
237 | [2] = { | 238 | [2] = { |
@@ -348,7 +349,7 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = { | |||
348 | .flags = IORESOURCE_MEM, | 349 | .flags = IORESOURCE_MEM, |
349 | }, | 350 | }, |
350 | [1] = { | 351 | [1] = { |
351 | .start = 100, | 352 | .start = evt2irq(0xe80), |
352 | .flags = IORESOURCE_IRQ, | 353 | .flags = IORESOURCE_IRQ, |
353 | }, | 354 | }, |
354 | }; | 355 | }; |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index ff6f69c6906e..34cd0c5ff2e1 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
24 | #include <linux/videodev2.h> | 24 | #include <linux/videodev2.h> |
25 | #include <linux/sh_intc.h> | ||
25 | #include <video/sh_mobile_lcdc.h> | 26 | #include <video/sh_mobile_lcdc.h> |
26 | #include <media/sh_mobile_ceu.h> | 27 | #include <media/sh_mobile_ceu.h> |
27 | #include <media/ov772x.h> | 28 | #include <media/ov772x.h> |
@@ -54,7 +55,7 @@ static struct resource smc91x_eth_resources[] = { | |||
54 | .flags = IORESOURCE_MEM, | 55 | .flags = IORESOURCE_MEM, |
55 | }, | 56 | }, |
56 | [1] = { | 57 | [1] = { |
57 | .start = 32, /* IRQ0 */ | 58 | .start = evt2irq(0x600), /* IRQ0 */ |
58 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 59 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
59 | }, | 60 | }, |
60 | }; | 61 | }; |
@@ -88,7 +89,7 @@ static struct resource sh_keysc_resources[] = { | |||
88 | .flags = IORESOURCE_MEM, | 89 | .flags = IORESOURCE_MEM, |
89 | }, | 90 | }, |
90 | [1] = { | 91 | [1] = { |
91 | .start = 79, | 92 | .start = evt2irq(0xbe0), |
92 | .flags = IORESOURCE_IRQ, | 93 | .flags = IORESOURCE_IRQ, |
93 | }, | 94 | }, |
94 | }; | 95 | }; |
@@ -285,7 +286,7 @@ static struct resource migor_lcdc_resources[] = { | |||
285 | .flags = IORESOURCE_MEM, | 286 | .flags = IORESOURCE_MEM, |
286 | }, | 287 | }, |
287 | [1] = { | 288 | [1] = { |
288 | .start = 28, | 289 | .start = evt2irq(0x580), |
289 | .flags = IORESOURCE_IRQ, | 290 | .flags = IORESOURCE_IRQ, |
290 | }, | 291 | }, |
291 | }; | 292 | }; |
@@ -368,7 +369,7 @@ static struct resource migor_ceu_resources[] = { | |||
368 | .flags = IORESOURCE_MEM, | 369 | .flags = IORESOURCE_MEM, |
369 | }, | 370 | }, |
370 | [1] = { | 371 | [1] = { |
371 | .start = 52, | 372 | .start = evt2irq(0x880), |
372 | .flags = IORESOURCE_IRQ, | 373 | .flags = IORESOURCE_IRQ, |
373 | }, | 374 | }, |
374 | [2] = { | 375 | [2] = { |
@@ -394,7 +395,7 @@ static struct resource sdhi_cn9_resources[] = { | |||
394 | .flags = IORESOURCE_MEM, | 395 | .flags = IORESOURCE_MEM, |
395 | }, | 396 | }, |
396 | [1] = { | 397 | [1] = { |
397 | .start = 100, | 398 | .start = evt2irq(0xe80), |
398 | .flags = IORESOURCE_IRQ, | 399 | .flags = IORESOURCE_IRQ, |
399 | }, | 400 | }, |
400 | }; | 401 | }; |
@@ -420,7 +421,7 @@ static struct i2c_board_info migor_i2c_devices[] = { | |||
420 | }, | 421 | }, |
421 | { | 422 | { |
422 | I2C_BOARD_INFO("migor_ts", 0x51), | 423 | I2C_BOARD_INFO("migor_ts", 0x51), |
423 | .irq = 38, /* IRQ6 */ | 424 | .irq = evt2irq(0x6c0), /* IRQ6 */ |
424 | }, | 425 | }, |
425 | { | 426 | { |
426 | I2C_BOARD_INFO("wm8978", 0x1a), | 427 | I2C_BOARD_INFO("wm8978", 0x1a), |
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c index e1963fecd761..8f7f0550cfde 100644 --- a/arch/sh/boards/mach-se/7722/setup.c +++ b/arch/sh/boards/mach-se/7722/setup.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
17 | #include <linux/input/sh_keysc.h> | 17 | #include <linux/input/sh_keysc.h> |
18 | #include <linux/smc91x.h> | 18 | #include <linux/smc91x.h> |
19 | #include <linux/sh_intc.h> | ||
19 | #include <mach-se/mach/se7722.h> | 20 | #include <mach-se/mach/se7722.h> |
20 | #include <mach-se/mach/mrshpc.h> | 21 | #include <mach-se/mach/mrshpc.h> |
21 | #include <asm/machvec.h> | 22 | #include <asm/machvec.h> |
@@ -114,7 +115,7 @@ static struct resource sh_keysc_resources[] = { | |||
114 | .flags = IORESOURCE_MEM, | 115 | .flags = IORESOURCE_MEM, |
115 | }, | 116 | }, |
116 | [1] = { | 117 | [1] = { |
117 | .start = 79, | 118 | .start = evt2irq(0xbe0), |
118 | .flags = IORESOURCE_IRQ, | 119 | .flags = IORESOURCE_IRQ, |
119 | }, | 120 | }, |
120 | }; | 121 | }; |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index c540b16547c3..479cdf876fda 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/input/sh_keysc.h> | 24 | #include <linux/input/sh_keysc.h> |
25 | #include <linux/usb/r8a66597.h> | 25 | #include <linux/usb/r8a66597.h> |
26 | #include <linux/sh_eth.h> | 26 | #include <linux/sh_eth.h> |
27 | #include <linux/sh_intc.h> | ||
27 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
28 | #include <video/sh_mobile_lcdc.h> | 29 | #include <video/sh_mobile_lcdc.h> |
29 | #include <media/sh_mobile_ceu.h> | 30 | #include <media/sh_mobile_ceu.h> |
@@ -197,7 +198,7 @@ static struct resource lcdc_resources[] = { | |||
197 | .flags = IORESOURCE_MEM, | 198 | .flags = IORESOURCE_MEM, |
198 | }, | 199 | }, |
199 | [1] = { | 200 | [1] = { |
200 | .start = 106, | 201 | .start = evt2irq(0xf40), |
201 | .flags = IORESOURCE_IRQ, | 202 | .flags = IORESOURCE_IRQ, |
202 | }, | 203 | }, |
203 | }; | 204 | }; |
@@ -224,7 +225,7 @@ static struct resource ceu0_resources[] = { | |||
224 | .flags = IORESOURCE_MEM, | 225 | .flags = IORESOURCE_MEM, |
225 | }, | 226 | }, |
226 | [1] = { | 227 | [1] = { |
227 | .start = 52, | 228 | .start = evt2irq(0x880), |
228 | .flags = IORESOURCE_IRQ, | 229 | .flags = IORESOURCE_IRQ, |
229 | }, | 230 | }, |
230 | [2] = { | 231 | [2] = { |
@@ -255,7 +256,7 @@ static struct resource ceu1_resources[] = { | |||
255 | .flags = IORESOURCE_MEM, | 256 | .flags = IORESOURCE_MEM, |
256 | }, | 257 | }, |
257 | [1] = { | 258 | [1] = { |
258 | .start = 63, | 259 | .start = evt2irq(0x9e0), |
259 | .flags = IORESOURCE_IRQ, | 260 | .flags = IORESOURCE_IRQ, |
260 | }, | 261 | }, |
261 | [2] = { | 262 | [2] = { |
@@ -289,7 +290,7 @@ static struct resource fsi_resources[] = { | |||
289 | .flags = IORESOURCE_MEM, | 290 | .flags = IORESOURCE_MEM, |
290 | }, | 291 | }, |
291 | [1] = { | 292 | [1] = { |
292 | .start = 108, | 293 | .start = evt2irq(0xf80), |
293 | .flags = IORESOURCE_IRQ, | 294 | .flags = IORESOURCE_IRQ, |
294 | }, | 295 | }, |
295 | }; | 296 | }; |
@@ -343,7 +344,7 @@ static struct resource keysc_resources[] = { | |||
343 | .flags = IORESOURCE_MEM, | 344 | .flags = IORESOURCE_MEM, |
344 | }, | 345 | }, |
345 | [1] = { | 346 | [1] = { |
346 | .start = 79, | 347 | .start = evt2irq(0xbe0), |
347 | .flags = IORESOURCE_IRQ, | 348 | .flags = IORESOURCE_IRQ, |
348 | }, | 349 | }, |
349 | }; | 350 | }; |
@@ -366,7 +367,7 @@ static struct resource sh_eth_resources[] = { | |||
366 | .flags = IORESOURCE_MEM, | 367 | .flags = IORESOURCE_MEM, |
367 | }, | 368 | }, |
368 | [1] = { | 369 | [1] = { |
369 | .start = 91, | 370 | .start = evt2irq(0xd60), |
370 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 371 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
371 | }, | 372 | }, |
372 | }; | 373 | }; |
@@ -397,8 +398,8 @@ static struct resource sh7724_usb0_host_resources[] = { | |||
397 | .flags = IORESOURCE_MEM, | 398 | .flags = IORESOURCE_MEM, |
398 | }, | 399 | }, |
399 | [1] = { | 400 | [1] = { |
400 | .start = 65, | 401 | .start = evt2irq(0xa20), |
401 | .end = 65, | 402 | .end = evt2irq(0xa20), |
402 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 403 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
403 | }, | 404 | }, |
404 | }; | 405 | }; |
@@ -426,8 +427,8 @@ static struct resource sh7724_usb1_gadget_resources[] = { | |||
426 | .flags = IORESOURCE_MEM, | 427 | .flags = IORESOURCE_MEM, |
427 | }, | 428 | }, |
428 | [1] = { | 429 | [1] = { |
429 | .start = 66, | 430 | .start = evt2irq(0xa40), |
430 | .end = 66, | 431 | .end = evt2irq(0xa40), |
431 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 432 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
432 | }, | 433 | }, |
433 | }; | 434 | }; |
@@ -452,7 +453,7 @@ static struct resource sdhi0_cn7_resources[] = { | |||
452 | .flags = IORESOURCE_MEM, | 453 | .flags = IORESOURCE_MEM, |
453 | }, | 454 | }, |
454 | [1] = { | 455 | [1] = { |
455 | .start = 100, | 456 | .start = evt2irq(0xe80), |
456 | .flags = IORESOURCE_IRQ, | 457 | .flags = IORESOURCE_IRQ, |
457 | }, | 458 | }, |
458 | }; | 459 | }; |
@@ -481,7 +482,7 @@ static struct resource sdhi1_cn8_resources[] = { | |||
481 | .flags = IORESOURCE_MEM, | 482 | .flags = IORESOURCE_MEM, |
482 | }, | 483 | }, |
483 | [1] = { | 484 | [1] = { |
484 | .start = 23, | 485 | .start = evt2irq(0x4e0), |
485 | .flags = IORESOURCE_IRQ, | 486 | .flags = IORESOURCE_IRQ, |
486 | }, | 487 | }, |
487 | }; | 488 | }; |
@@ -511,7 +512,7 @@ static struct resource irda_resources[] = { | |||
511 | .flags = IORESOURCE_MEM, | 512 | .flags = IORESOURCE_MEM, |
512 | }, | 513 | }, |
513 | [1] = { | 514 | [1] = { |
514 | .start = 20, | 515 | .start = evt2irq(0x480), |
515 | .flags = IORESOURCE_IRQ, | 516 | .flags = IORESOURCE_IRQ, |
516 | }, | 517 | }, |
517 | }; | 518 | }; |
@@ -549,7 +550,7 @@ static struct resource sh_vou_resources[] = { | |||
549 | .flags = IORESOURCE_MEM, | 550 | .flags = IORESOURCE_MEM, |
550 | }, | 551 | }, |
551 | [1] = { | 552 | [1] = { |
552 | .start = 55, | 553 | .start = evt2irq(0x8e0), |
553 | .flags = IORESOURCE_IRQ, | 554 | .flags = IORESOURCE_IRQ, |
554 | }, | 555 | }, |
555 | }; | 556 | }; |
@@ -595,6 +596,7 @@ static struct i2c_board_info i2c0_devices[] = { | |||
595 | #define EEPROM_DATA 0xBA20600C | 596 | #define EEPROM_DATA 0xBA20600C |
596 | #define EEPROM_STAT 0xBA206010 | 597 | #define EEPROM_STAT 0xBA206010 |
597 | #define EEPROM_STRT 0xBA206014 | 598 | #define EEPROM_STRT 0xBA206014 |
599 | |||
598 | static int __init sh_eth_is_eeprom_ready(void) | 600 | static int __init sh_eth_is_eeprom_ready(void) |
599 | { | 601 | { |
600 | int t = 10000; | 602 | int t = 10000; |
@@ -651,7 +653,6 @@ extern char ms7724se_sdram_enter_end; | |||
651 | extern char ms7724se_sdram_leave_start; | 653 | extern char ms7724se_sdram_leave_start; |
652 | extern char ms7724se_sdram_leave_end; | 654 | extern char ms7724se_sdram_leave_end; |
653 | 655 | ||
654 | |||
655 | static int __init arch_setup(void) | 656 | static int __init arch_setup(void) |
656 | { | 657 | { |
657 | /* enable I2C device */ | 658 | /* enable I2C device */ |
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c index dd036f1661db..36e8b88cd04e 100644 --- a/arch/sh/boards/mach-sh7763rdp/setup.c +++ b/arch/sh/boards/mach-sh7763rdp/setup.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/fb.h> | 18 | #include <linux/fb.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sh_eth.h> | 20 | #include <linux/sh_eth.h> |
21 | #include <linux/sh_intc.h> | ||
21 | #include <mach/sh7763rdp.h> | 22 | #include <mach/sh7763rdp.h> |
22 | #include <asm/sh7760fb.h> | 23 | #include <asm/sh7760fb.h> |
23 | 24 | ||
@@ -67,7 +68,7 @@ static struct platform_device sh7763rdp_nor_flash_device = { | |||
67 | * SH-Ether | 68 | * SH-Ether |
68 | * | 69 | * |
69 | * SH Ether of SH7763 has multi IRQ handling. | 70 | * SH Ether of SH7763 has multi IRQ handling. |
70 | * (57,58,59 -> 57) | 71 | * (0x920,0x940,0x960 -> 0x920) |
71 | */ | 72 | */ |
72 | static struct resource sh_eth_resources[] = { | 73 | static struct resource sh_eth_resources[] = { |
73 | { | 74 | { |
@@ -79,7 +80,7 @@ static struct resource sh_eth_resources[] = { | |||
79 | .end = 0xFEE01FFF, | 80 | .end = 0xFEE01FFF, |
80 | .flags = IORESOURCE_MEM, | 81 | .flags = IORESOURCE_MEM, |
81 | }, { | 82 | }, { |
82 | .start = 57, /* irq number */ | 83 | .start = evt2irq(0x920), /* irq number */ |
83 | .flags = IORESOURCE_IRQ, | 84 | .flags = IORESOURCE_IRQ, |
84 | }, | 85 | }, |
85 | }; | 86 | }; |
diff --git a/arch/sh/drivers/pci/fixups-landisk.c b/arch/sh/drivers/pci/fixups-landisk.c index ecb1d1060638..db5b40a98e62 100644 --- a/arch/sh/drivers/pci/fixups-landisk.c +++ b/arch/sh/drivers/pci/fixups-landisk.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include "pci-sh4.h" | 18 | #include "pci-sh4.h" |
18 | 19 | ||
19 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF | 20 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF |
@@ -27,7 +28,7 @@ int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | |||
27 | * slot2: pin1-4 = irq7,8,5,6 | 28 | * slot2: pin1-4 = irq7,8,5,6 |
28 | * slot3: pin1-4 = irq8,5,6,7 | 29 | * slot3: pin1-4 = irq8,5,6,7 |
29 | */ | 30 | */ |
30 | int irq = ((slot + pin - 1) & 0x3) + 5; | 31 | int irq = ((slot + pin - 1) & 0x3) + evt2irq(0x2a0); |
31 | 32 | ||
32 | if ((slot | (pin - 1)) > 0x3) { | 33 | if ((slot | (pin - 1)) > 0x3) { |
33 | printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", | 34 | printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", |
diff --git a/arch/sh/drivers/pci/fixups-r7780rp.c b/arch/sh/drivers/pci/fixups-r7780rp.c index f9370dce0b70..57ed3f09d0c2 100644 --- a/arch/sh/drivers/pci/fixups-r7780rp.c +++ b/arch/sh/drivers/pci/fixups-r7780rp.c | |||
@@ -12,13 +12,10 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/sh_intc.h> | ||
15 | #include "pci-sh4.h" | 16 | #include "pci-sh4.h" |
16 | 17 | ||
17 | static char irq_tab[] __initdata = { | ||
18 | 65, 66, 67, 68, | ||
19 | }; | ||
20 | |||
21 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | 18 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) |
22 | { | 19 | { |
23 | return irq_tab[slot]; | 20 | return evt2irq(0xa20) + slot; |
24 | } | 21 | } |
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c index 0b8472501b88..c0a015ae6ecf 100644 --- a/arch/sh/drivers/pci/fixups-sdk7780.c +++ b/arch/sh/drivers/pci/fixups-sdk7780.c | |||
@@ -13,18 +13,28 @@ | |||
13 | */ | 13 | */ |
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include "pci-sh4.h" | 17 | #include "pci-sh4.h" |
17 | 18 | ||
19 | #define IRQ_INTA evt2irq(0xa20) | ||
20 | #define IRQ_INTB evt2irq(0xa40) | ||
21 | #define IRQ_INTC evt2irq(0xa60) | ||
22 | #define IRQ_INTD evt2irq(0xa80) | ||
23 | |||
18 | /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ | 24 | /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ |
19 | static char sdk7780_irq_tab[4][16] __initdata = { | 25 | static char sdk7780_irq_tab[4][16] __initdata = { |
20 | /* INTA */ | 26 | /* INTA */ |
21 | { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | 27 | { IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1, |
28 | -1, -1, -1, -1, -1, -1 }, | ||
22 | /* INTB */ | 29 | /* INTB */ |
23 | { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | 30 | { IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1, |
31 | -1, -1, -1, -1 }, | ||
24 | /* INTC */ | 32 | /* INTC */ |
25 | { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | 33 | { IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1, |
34 | -1, -1, -1, -1 }, | ||
26 | /* INTD */ | 35 | /* INTD */ |
27 | { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | 36 | { IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
37 | -1, -1, -1 }, | ||
28 | }; | 38 | }; |
29 | 39 | ||
30 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | 40 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) |
diff --git a/arch/sh/drivers/pci/fixups-se7751.c b/arch/sh/drivers/pci/fixups-se7751.c index 2ec146c3fa44..84a88ca92008 100644 --- a/arch/sh/drivers/pci/fixups-se7751.c +++ b/arch/sh/drivers/pci/fixups-se7751.c | |||
@@ -4,13 +4,14 @@ | |||
4 | #include <linux/delay.h> | 4 | #include <linux/delay.h> |
5 | #include <linux/pci.h> | 5 | #include <linux/pci.h> |
6 | #include <linux/io.h> | 6 | #include <linux/io.h> |
7 | #include <linux/sh_intc.h> | ||
7 | #include "pci-sh4.h" | 8 | #include "pci-sh4.h" |
8 | 9 | ||
9 | int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin) | 10 | int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin) |
10 | { | 11 | { |
11 | switch (slot) { | 12 | switch (slot) { |
12 | case 0: return 13; | 13 | case 0: return evt2irq(0x3a0); |
13 | case 1: return 13; /* AMD Ethernet controller */ | 14 | case 1: return evt2irq(0x3a0); /* AMD Ethernet controller */ |
14 | case 2: return -1; | 15 | case 2: return -1; |
15 | case 3: return -1; | 16 | case 3: return -1; |
16 | case 4: return -1; | 17 | case 4: return -1; |
diff --git a/arch/sh/drivers/pci/fixups-sh03.c b/arch/sh/drivers/pci/fixups-sh03.c index 1615e5906168..16207bef9f52 100644 --- a/arch/sh/drivers/pci/fixups-sh03.c +++ b/arch/sh/drivers/pci/fixups-sh03.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/init.h> | 2 | #include <linux/init.h> |
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/pci.h> | 4 | #include <linux/pci.h> |
5 | #include <linux/sh_intc.h> | ||
5 | 6 | ||
6 | int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 7 | int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
7 | { | 8 | { |
@@ -9,21 +10,21 @@ int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
9 | 10 | ||
10 | if (dev->bus->number == 0) { | 11 | if (dev->bus->number == 0) { |
11 | switch (slot) { | 12 | switch (slot) { |
12 | case 4: return 5; /* eth0 */ | 13 | case 4: return evt2irq(0x2a0); /* eth0 */ |
13 | case 8: return 5; /* eth1 */ | 14 | case 8: return evt2irq(0x2a0); /* eth1 */ |
14 | case 6: return 2; /* PCI bridge */ | 15 | case 6: return evt2irq(0x240); /* PCI bridge */ |
15 | default: | 16 | default: |
16 | printk(KERN_ERR "PCI: Bad IRQ mapping request " | 17 | printk(KERN_ERR "PCI: Bad IRQ mapping request " |
17 | "for slot %d\n", slot); | 18 | "for slot %d\n", slot); |
18 | return 2; | 19 | return evt2irq(0x240); |
19 | } | 20 | } |
20 | } else { | 21 | } else { |
21 | switch (pin) { | 22 | switch (pin) { |
22 | case 0: irq = 2; break; | 23 | case 0: irq = evt2irq(0x240); break; |
23 | case 1: irq = 2; break; | 24 | case 1: irq = evt2irq(0x240); break; |
24 | case 2: irq = 2; break; | 25 | case 2: irq = evt2irq(0x240); break; |
25 | case 3: irq = 2; break; | 26 | case 3: irq = evt2irq(0x240); break; |
26 | case 4: irq = 2; break; | 27 | case 4: irq = evt2irq(0x240); break; |
27 | default: irq = -1; break; | 28 | default: irq = -1; break; |
28 | } | 29 | } |
29 | } | 30 | } |
diff --git a/arch/sh/drivers/pci/fixups-snapgear.c b/arch/sh/drivers/pci/fixups-snapgear.c index 4a093c648d12..6e33ba4cd076 100644 --- a/arch/sh/drivers/pci/fixups-snapgear.c +++ b/arch/sh/drivers/pci/fixups-snapgear.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/sh_intc.h> | ||
19 | #include "pci-sh4.h" | 20 | #include "pci-sh4.h" |
20 | 21 | ||
21 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | 22 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) |
@@ -24,11 +25,11 @@ int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | |||
24 | 25 | ||
25 | switch (slot) { | 26 | switch (slot) { |
26 | case 8: /* the PCI bridge */ break; | 27 | case 8: /* the PCI bridge */ break; |
27 | case 11: irq = 8; break; /* USB */ | 28 | case 11: irq = evt2irq(0x300); break; /* USB */ |
28 | case 12: irq = 11; break; /* PCMCIA */ | 29 | case 12: irq = evt2irq(0x360); break; /* PCMCIA */ |
29 | case 13: irq = 5; break; /* eth0 */ | 30 | case 13: irq = evt2irq(0x2a0); break; /* eth0 */ |
30 | case 14: irq = 8; break; /* eth1 */ | 31 | case 14: irq = evt2irq(0x300); break; /* eth1 */ |
31 | case 15: irq = 11; break; /* safenet (unused) */ | 32 | case 15: irq = evt2irq(0x360); break; /* safenet (unused) */ |
32 | } | 33 | } |
33 | 34 | ||
34 | printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n", | 35 | printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n", |
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index 4df27c4fbf99..c045142f7338 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/sh_clk.h> | 20 | #include <linux/sh_clk.h> |
21 | #include <linux/sh_intc.h> | ||
21 | #include "pcie-sh7786.h" | 22 | #include "pcie-sh7786.h" |
22 | #include <asm/sizes.h> | 23 | #include <asm/sizes.h> |
23 | 24 | ||
@@ -468,7 +469,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port) | |||
468 | 469 | ||
469 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | 470 | int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) |
470 | { | 471 | { |
471 | return 71; | 472 | return evt2irq(0xae0); |
472 | } | 473 | } |
473 | 474 | ||
474 | static int __init sh7786_pcie_core_init(void) | 475 | static int __init sh7786_pcie_core_init(void) |
diff --git a/arch/sh/include/asm/i2c-sh7760.h b/arch/sh/include/asm/i2c-sh7760.h index 24182116711f..69fee1239b03 100644 --- a/arch/sh/include/asm/i2c-sh7760.h +++ b/arch/sh/include/asm/i2c-sh7760.h | |||
@@ -9,11 +9,9 @@ | |||
9 | 9 | ||
10 | #define SH7760_I2C0_MMIO 0xFE140000 | 10 | #define SH7760_I2C0_MMIO 0xFE140000 |
11 | #define SH7760_I2C0_MMIOEND 0xFE14003B | 11 | #define SH7760_I2C0_MMIOEND 0xFE14003B |
12 | #define SH7760_I2C0_IRQ 62 | ||
13 | 12 | ||
14 | #define SH7760_I2C1_MMIO 0xFE150000 | 13 | #define SH7760_I2C1_MMIO 0xFE150000 |
15 | #define SH7760_I2C1_MMIOEND 0xFE15003B | 14 | #define SH7760_I2C1_MMIOEND 0xFE15003B |
16 | #define SH7760_I2C1_IRQ 63 | ||
17 | 15 | ||
18 | struct sh7760_i2c_platdata { | 16 | struct sh7760_i2c_platdata { |
19 | unsigned int speed_khz; | 17 | unsigned int speed_khz; |
diff --git a/arch/sh/include/cpu-sh3/cpu/dma.h b/arch/sh/include/cpu-sh3/cpu/dma.h index 24e28b91c9d5..27a90ad0bcec 100644 --- a/arch/sh/include/cpu-sh3/cpu/dma.h +++ b/arch/sh/include/cpu-sh3/cpu/dma.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_CPU_SH3_DMA_H | 1 | #ifndef __ASM_CPU_SH3_DMA_H |
2 | #define __ASM_CPU_SH3_DMA_H | 2 | #define __ASM_CPU_SH3_DMA_H |
3 | 3 | ||
4 | #include <linux/sh_intc.h> | ||
5 | |||
4 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 6 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
5 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 7 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
6 | defined(CONFIG_CPU_SUBTYPE_SH7710) || \ | 8 | defined(CONFIG_CPU_SUBTYPE_SH7710) || \ |
@@ -10,8 +12,8 @@ | |||
10 | #define SH_DMAC_BASE0 0xa4000020 | 12 | #define SH_DMAC_BASE0 0xa4000020 |
11 | #endif | 13 | #endif |
12 | 14 | ||
13 | #define DMTE0_IRQ 48 | 15 | #define DMTE0_IRQ evt2irq(0x800) |
14 | #define DMTE4_IRQ 76 | 16 | #define DMTE4_IRQ evt2irq(0xb80) |
15 | 17 | ||
16 | /* Definitions for the SuperH DMAC */ | 18 | /* Definitions for the SuperH DMAC */ |
17 | #define TM_BURST 0x00000020 | 19 | #define TM_BURST 0x00000020 |
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h index 9647e681fd27..f280410c93ae 100644 --- a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h +++ b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h | |||
@@ -1,75 +1,77 @@ | |||
1 | #ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H | 1 | #ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H |
2 | #define __ASM_SH_CPU_SH4_DMA_SH7780_H | 2 | #define __ASM_SH_CPU_SH4_DMA_SH7780_H |
3 | 3 | ||
4 | #include <linux/sh_intc.h> | ||
5 | |||
4 | #if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ | 6 | #if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ |
5 | defined(CONFIG_CPU_SUBTYPE_SH7730) | 7 | defined(CONFIG_CPU_SUBTYPE_SH7730) |
6 | #define DMTE0_IRQ 48 | 8 | #define DMTE0_IRQ evt2irq(0x800) |
7 | #define DMTE4_IRQ 76 | 9 | #define DMTE4_IRQ evt2irq(0xb80) |
8 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | 10 | #define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/ |
9 | #define SH_DMAC_BASE0 0xFE008020 | 11 | #define SH_DMAC_BASE0 0xFE008020 |
10 | #define SH_DMARS_BASE0 0xFE009000 | 12 | #define SH_DMARS_BASE0 0xFE009000 |
11 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | 13 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) |
12 | #define DMTE0_IRQ 48 | 14 | #define DMTE0_IRQ evt2irq(0x800) |
13 | #define DMTE4_IRQ 76 | 15 | #define DMTE4_IRQ evt2irq(0xb80) |
14 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | 16 | #define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/ |
15 | #define SH_DMAC_BASE0 0xFE008020 | 17 | #define SH_DMAC_BASE0 0xFE008020 |
16 | #define SH_DMARS_BASE0 0xFE009000 | 18 | #define SH_DMARS_BASE0 0xFE009000 |
17 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | 19 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ |
18 | defined(CONFIG_CPU_SUBTYPE_SH7764) | 20 | defined(CONFIG_CPU_SUBTYPE_SH7764) |
19 | #define DMTE0_IRQ 34 | 21 | #define DMTE0_IRQ evt2irq(0x640) |
20 | #define DMTE4_IRQ 44 | 22 | #define DMTE4_IRQ evt2irq(0x780) |
21 | #define DMAE0_IRQ 38 | 23 | #define DMAE0_IRQ evt2irq(0x6c0) |
22 | #define SH_DMAC_BASE0 0xFF608020 | 24 | #define SH_DMAC_BASE0 0xFF608020 |
23 | #define SH_DMARS_BASE0 0xFF609000 | 25 | #define SH_DMARS_BASE0 0xFF609000 |
24 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) | 26 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) |
25 | #define DMTE0_IRQ 48 /* DMAC0A*/ | 27 | #define DMTE0_IRQ evt2irq(0x800) /* DMAC0A*/ |
26 | #define DMTE4_IRQ 76 /* DMAC0B */ | 28 | #define DMTE4_IRQ evt2irq(0xb80) /* DMAC0B */ |
27 | #define DMTE6_IRQ 40 | 29 | #define DMTE6_IRQ evt2irq(0x700) |
28 | #define DMTE8_IRQ 42 /* DMAC1A */ | 30 | #define DMTE8_IRQ evt2irq(0x740) /* DMAC1A */ |
29 | #define DMTE9_IRQ 43 | 31 | #define DMTE9_IRQ evt2irq(0x760) |
30 | #define DMTE10_IRQ 72 /* DMAC1B */ | 32 | #define DMTE10_IRQ evt2irq(0xb00) /* DMAC1B */ |
31 | #define DMTE11_IRQ 73 | 33 | #define DMTE11_IRQ evt2irq(0xb20) |
32 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | 34 | #define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/ |
33 | #define DMAE1_IRQ 74 /* DMA Error IRQ*/ | 35 | #define DMAE1_IRQ evt2irq(0xb40) /* DMA Error IRQ*/ |
34 | #define SH_DMAC_BASE0 0xFE008020 | 36 | #define SH_DMAC_BASE0 0xFE008020 |
35 | #define SH_DMAC_BASE1 0xFDC08020 | 37 | #define SH_DMAC_BASE1 0xFDC08020 |
36 | #define SH_DMARS_BASE0 0xFDC09000 | 38 | #define SH_DMARS_BASE0 0xFDC09000 |
37 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) | 39 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) |
38 | #define DMTE0_IRQ 48 /* DMAC0A*/ | 40 | #define DMTE0_IRQ evt2irq(0x800) /* DMAC0A*/ |
39 | #define DMTE4_IRQ 76 /* DMAC0B */ | 41 | #define DMTE4_IRQ evt2irq(0xb80) /* DMAC0B */ |
40 | #define DMTE6_IRQ 40 | 42 | #define DMTE6_IRQ evt2irq(0x700) |
41 | #define DMTE8_IRQ 42 /* DMAC1A */ | 43 | #define DMTE8_IRQ evt2irq(0x740) /* DMAC1A */ |
42 | #define DMTE9_IRQ 43 | 44 | #define DMTE9_IRQ evt2irq(0x760) |
43 | #define DMTE10_IRQ 72 /* DMAC1B */ | 45 | #define DMTE10_IRQ evt2irq(0xb00) /* DMAC1B */ |
44 | #define DMTE11_IRQ 73 | 46 | #define DMTE11_IRQ evt2irq(0xb20) |
45 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | 47 | #define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/ |
46 | #define DMAE1_IRQ 74 /* DMA Error IRQ*/ | 48 | #define DMAE1_IRQ evt2irq(0xb40) /* DMA Error IRQ*/ |
47 | #define SH_DMAC_BASE0 0xFE008020 | 49 | #define SH_DMAC_BASE0 0xFE008020 |
48 | #define SH_DMAC_BASE1 0xFDC08020 | 50 | #define SH_DMAC_BASE1 0xFDC08020 |
49 | #define SH_DMARS_BASE0 0xFE009000 | 51 | #define SH_DMARS_BASE0 0xFE009000 |
50 | #define SH_DMARS_BASE1 0xFDC09000 | 52 | #define SH_DMARS_BASE1 0xFDC09000 |
51 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | 53 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) |
52 | #define DMTE0_IRQ 34 | 54 | #define DMTE0_IRQ evt2irq(0x640) |
53 | #define DMTE4_IRQ 44 | 55 | #define DMTE4_IRQ evt2irq(0x780) |
54 | #define DMTE6_IRQ 46 | 56 | #define DMTE6_IRQ evt2irq(0x7c0) |
55 | #define DMTE8_IRQ 92 | 57 | #define DMTE8_IRQ evt2irq(0xd80) |
56 | #define DMTE9_IRQ 93 | 58 | #define DMTE9_IRQ evt2irq(0xda0) |
57 | #define DMTE10_IRQ 94 | 59 | #define DMTE10_IRQ evt2irq(0xdc0) |
58 | #define DMTE11_IRQ 95 | 60 | #define DMTE11_IRQ evt2irq(0xde0) |
59 | #define DMAE0_IRQ 38 /* DMA Error IRQ */ | 61 | #define DMAE0_IRQ evt2irq(0x6c0) /* DMA Error IRQ */ |
60 | #define SH_DMAC_BASE0 0xFC808020 | 62 | #define SH_DMAC_BASE0 0xFC808020 |
61 | #define SH_DMAC_BASE1 0xFC818020 | 63 | #define SH_DMAC_BASE1 0xFC818020 |
62 | #define SH_DMARS_BASE0 0xFC809000 | 64 | #define SH_DMARS_BASE0 0xFC809000 |
63 | #else /* SH7785 */ | 65 | #else /* SH7785 */ |
64 | #define DMTE0_IRQ 33 | 66 | #define DMTE0_IRQ evt2irq(0x620) |
65 | #define DMTE4_IRQ 37 | 67 | #define DMTE4_IRQ evt2irq(0x6a0) |
66 | #define DMTE6_IRQ 52 | 68 | #define DMTE6_IRQ evt2irq(0x880) |
67 | #define DMTE8_IRQ 54 | 69 | #define DMTE8_IRQ evt2irq(0x8c0) |
68 | #define DMTE9_IRQ 55 | 70 | #define DMTE9_IRQ evt2irq(0x8e0) |
69 | #define DMTE10_IRQ 56 | 71 | #define DMTE10_IRQ evt2irq(0x900) |
70 | #define DMTE11_IRQ 57 | 72 | #define DMTE11_IRQ evt2irq(0x920) |
71 | #define DMAE0_IRQ 39 /* DMA Error IRQ0 */ | 73 | #define DMAE0_IRQ evt2irq(0x6e0) /* DMA Error IRQ0 */ |
72 | #define DMAE1_IRQ 58 /* DMA Error IRQ1 */ | 74 | #define DMAE1_IRQ evt2irq(0x940) /* DMA Error IRQ1 */ |
73 | #define SH_DMAC_BASE0 0xFC808020 | 75 | #define SH_DMAC_BASE0 0xFC808020 |
74 | #define SH_DMAC_BASE1 0xFCC08020 | 76 | #define SH_DMAC_BASE1 0xFCC08020 |
75 | #define SH_DMARS_BASE0 0xFC809000 | 77 | #define SH_DMARS_BASE0 0xFC809000 |
diff --git a/arch/sh/include/cpu-sh4/cpu/dma.h b/arch/sh/include/cpu-sh4/cpu/dma.h index ca747e93c2ed..9d32e2dd2554 100644 --- a/arch/sh/include/cpu-sh4/cpu/dma.h +++ b/arch/sh/include/cpu-sh4/cpu/dma.h | |||
@@ -8,13 +8,16 @@ | |||
8 | #include <cpu/dma-sh4a.h> | 8 | #include <cpu/dma-sh4a.h> |
9 | 9 | ||
10 | #else /* CONFIG_CPU_SH4A */ | 10 | #else /* CONFIG_CPU_SH4A */ |
11 | |||
12 | #include <linux/sh_intc.h> | ||
13 | |||
11 | /* | 14 | /* |
12 | * SH7750/SH7751/SH7760 | 15 | * SH7750/SH7751/SH7760 |
13 | */ | 16 | */ |
14 | #define DMTE0_IRQ 34 | 17 | #define DMTE0_IRQ evt2irq(0x640) |
15 | #define DMTE4_IRQ 44 | 18 | #define DMTE4_IRQ evt2irq(0x780) |
16 | #define DMTE6_IRQ 46 | 19 | #define DMTE6_IRQ evt2irq(0x7c0) |
17 | #define DMAE0_IRQ 38 | 20 | #define DMAE0_IRQ evt2irq(0x6c0) |
18 | 21 | ||
19 | #define SH_DMAC_BASE0 0xffa00000 | 22 | #define SH_DMAC_BASE0 0xffa00000 |
20 | #define SH_DMAC_BASE1 0xffa00070 | 23 | #define SH_DMAC_BASE1 0xffa00070 |
diff --git a/arch/sh/include/mach-common/mach/hp6xx.h b/arch/sh/include/mach-common/mach/hp6xx.h index bcc301ac12f4..6aaaf8596e6a 100644 --- a/arch/sh/include/mach-common/mach/hp6xx.h +++ b/arch/sh/include/mach-common/mach/hp6xx.h | |||
@@ -9,10 +9,11 @@ | |||
9 | * for more details. | 9 | * for more details. |
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | #include <linux/sh_intc.h> | ||
12 | 13 | ||
13 | #define HP680_BTN_IRQ 32 /* IRQ0_IRQ */ | 14 | #define HP680_BTN_IRQ evt2irq(0x600) /* IRQ0_IRQ */ |
14 | #define HP680_TS_IRQ 35 /* IRQ3_IRQ */ | 15 | #define HP680_TS_IRQ evt2irq(0x660) /* IRQ3_IRQ */ |
15 | #define HP680_HD64461_IRQ 36 /* IRQ4_IRQ */ | 16 | #define HP680_HD64461_IRQ evt2irq(0x680) /* IRQ4_IRQ */ |
16 | 17 | ||
17 | #define DAC_LCD_BRIGHTNESS 0 | 18 | #define DAC_LCD_BRIGHTNESS 0 |
18 | #define DAC_SPEAKER_VOLUME 1 | 19 | #define DAC_SPEAKER_VOLUME 1 |
diff --git a/arch/sh/include/mach-common/mach/lboxre2.h b/arch/sh/include/mach-common/mach/lboxre2.h index e6d160504923..3a4dcc5c74ee 100644 --- a/arch/sh/include/mach-common/mach/lboxre2.h +++ b/arch/sh/include/mach-common/mach/lboxre2.h | |||
@@ -11,13 +11,14 @@ | |||
11 | * for more details. | 11 | * for more details. |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | #include <linux/sh_intc.h> | ||
14 | 15 | ||
15 | #define IRQ_CF1 9 /* CF1 */ | 16 | #define IRQ_CF1 evt2irq(0x320) /* CF1 */ |
16 | #define IRQ_CF0 10 /* CF0 */ | 17 | #define IRQ_CF0 evt2irq(0x340) /* CF0 */ |
17 | #define IRQ_INTD 11 /* INTD */ | 18 | #define IRQ_INTD evt2irq(0x360) /* INTD */ |
18 | #define IRQ_ETH1 12 /* Ether1 */ | 19 | #define IRQ_ETH1 evt2irq(0x380) /* Ether1 */ |
19 | #define IRQ_ETH0 13 /* Ether0 */ | 20 | #define IRQ_ETH0 evt2irq(0x3a0) /* Ether0 */ |
20 | #define IRQ_INTA 14 /* INTA */ | 21 | #define IRQ_INTA evt2irq(0x3c0) /* INTA */ |
21 | 22 | ||
22 | void init_lboxre2_IRQ(void); | 23 | void init_lboxre2_IRQ(void); |
23 | 24 | ||
diff --git a/arch/sh/include/mach-common/mach/sdk7780.h b/arch/sh/include/mach-common/mach/sdk7780.h index 697dc865f21b..ce64e02e9b50 100644 --- a/arch/sh/include/mach-common/mach/sdk7780.h +++ b/arch/sh/include/mach-common/mach/sdk7780.h | |||
@@ -11,6 +11,7 @@ | |||
11 | * License. See the file "COPYING" in the main directory of this archive | 11 | * License. See the file "COPYING" in the main directory of this archive |
12 | * for more details. | 12 | * for more details. |
13 | */ | 13 | */ |
14 | #include <linux/sh_intc.h> | ||
14 | #include <asm/addrspace.h> | 15 | #include <asm/addrspace.h> |
15 | 16 | ||
16 | /* Box specific addresses. */ | 17 | /* Box specific addresses. */ |
@@ -67,9 +68,9 @@ | |||
67 | 68 | ||
68 | #define SDK7780_NR_IRL 15 | 69 | #define SDK7780_NR_IRL 15 |
69 | /* IDE/ATA interrupt */ | 70 | /* IDE/ATA interrupt */ |
70 | #define IRQ_CFCARD 14 | 71 | #define IRQ_CFCARD evt2irq(0x3c0) |
71 | /* SMC interrupt */ | 72 | /* SMC interrupt */ |
72 | #define IRQ_ETHERNET 6 | 73 | #define IRQ_ETHERNET evt2irq(0x2c0) |
73 | 74 | ||
74 | 75 | ||
75 | /* arch/sh/boards/renesas/sdk7780/irq.c */ | 76 | /* arch/sh/boards/renesas/sdk7780/irq.c */ |
diff --git a/arch/sh/include/mach-common/mach/titan.h b/arch/sh/include/mach-common/mach/titan.h index 4a674d27cbb8..fa3cd801cf2e 100644 --- a/arch/sh/include/mach-common/mach/titan.h +++ b/arch/sh/include/mach-common/mach/titan.h | |||
@@ -4,14 +4,16 @@ | |||
4 | #ifndef _ASM_SH_TITAN_H | 4 | #ifndef _ASM_SH_TITAN_H |
5 | #define _ASM_SH_TITAN_H | 5 | #define _ASM_SH_TITAN_H |
6 | 6 | ||
7 | #include <linux/sh_intc.h> | ||
8 | |||
7 | #define __IO_PREFIX titan | 9 | #define __IO_PREFIX titan |
8 | #include <asm/io_generic.h> | 10 | #include <asm/io_generic.h> |
9 | 11 | ||
10 | /* IRQ assignments */ | 12 | /* IRQ assignments */ |
11 | #define TITAN_IRQ_WAN 2 /* eth0 (WAN) */ | 13 | #define TITAN_IRQ_WAN evt2irq(0x240) /* eth0 (WAN) */ |
12 | #define TITAN_IRQ_LAN 5 /* eth1 (LAN) */ | 14 | #define TITAN_IRQ_LAN evt2irq(0x2a0) /* eth1 (LAN) */ |
13 | #define TITAN_IRQ_MPCIA 8 /* mPCI A */ | 15 | #define TITAN_IRQ_MPCIA evt2irq(0x300) /* mPCI A */ |
14 | #define TITAN_IRQ_MPCIB 11 /* mPCI B */ | 16 | #define TITAN_IRQ_MPCIB evt2irq(0x360) /* mPCI B */ |
15 | #define TITAN_IRQ_USB 11 /* USB */ | 17 | #define TITAN_IRQ_USB evt2irq(0x360) /* USB */ |
16 | 18 | ||
17 | #endif /* __ASM_SH_TITAN_H */ | 19 | #endif /* __ASM_SH_TITAN_H */ |
diff --git a/arch/sh/include/mach-landisk/mach/iodata_landisk.h b/arch/sh/include/mach-landisk/mach/iodata_landisk.h index f432773a9571..ceeea48cc7af 100644 --- a/arch/sh/include/mach-landisk/mach/iodata_landisk.h +++ b/arch/sh/include/mach-landisk/mach/iodata_landisk.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * | 8 | * |
9 | * IO-DATA LANDISK support | 9 | * IO-DATA LANDISK support |
10 | */ | 10 | */ |
11 | #include <linux/sh_intc.h> | ||
11 | 12 | ||
12 | /* Box specific addresses. */ | 13 | /* Box specific addresses. */ |
13 | 14 | ||
@@ -25,15 +26,15 @@ | |||
25 | #define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */ | 26 | #define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */ |
26 | #define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */ | 27 | #define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */ |
27 | 28 | ||
28 | #define IRQ_PCIINTA 5 /* PCI INTA IRQ */ | 29 | #define IRQ_PCIINTA evt2irq(0x2a0) /* PCI INTA IRQ */ |
29 | #define IRQ_PCIINTB 6 /* PCI INTB IRQ */ | 30 | #define IRQ_PCIINTB evt2irq(0x2c0) /* PCI INTB IRQ */ |
30 | #define IRQ_PCIINTC 7 /* PCI INTC IRQ */ | 31 | #define IRQ_PCIINTC evt2irq(0x2e0) /* PCI INTC IRQ */ |
31 | #define IRQ_PCIINTD 8 /* PCI INTD IRQ */ | 32 | #define IRQ_PCIINTD evt2irq(0x300) /* PCI INTD IRQ */ |
32 | #define IRQ_ATA 9 /* ATA IRQ */ | 33 | #define IRQ_ATA evt2irq(0x320) /* ATA IRQ */ |
33 | #define IRQ_FATA 10 /* FATA IRQ */ | 34 | #define IRQ_FATA evt2irq(0x340) /* FATA IRQ */ |
34 | #define IRQ_POWER 11 /* Power Switch IRQ */ | 35 | #define IRQ_POWER evt2irq(0x360) /* Power Switch IRQ */ |
35 | #define IRQ_BUTTON 12 /* USL-5P Button IRQ */ | 36 | #define IRQ_BUTTON evt2irq(0x380) /* USL-5P Button IRQ */ |
36 | #define IRQ_FAULT 13 /* USL-5P Fault IRQ */ | 37 | #define IRQ_FAULT evt2irq(0x3a0) /* USL-5P Fault IRQ */ |
37 | 38 | ||
38 | void init_landisk_IRQ(void); | 39 | void init_landisk_IRQ(void); |
39 | 40 | ||
diff --git a/arch/sh/include/mach-se/mach/se.h b/arch/sh/include/mach-se/mach/se.h index 14be91c5a2f0..8a6d44b4987b 100644 --- a/arch/sh/include/mach-se/mach/se.h +++ b/arch/sh/include/mach-se/mach/se.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Hitachi SolutionEngine support | 9 | * Hitachi SolutionEngine support |
10 | */ | 10 | */ |
11 | #include <linux/sh_intc.h> | ||
11 | 12 | ||
12 | /* Box specific addresses. */ | 13 | /* Box specific addresses. */ |
13 | 14 | ||
@@ -82,16 +83,16 @@ | |||
82 | #define INTC_IPRD 0xa4000018UL | 83 | #define INTC_IPRD 0xa4000018UL |
83 | #define INTC_IPRE 0xa400001aUL | 84 | #define INTC_IPRE 0xa400001aUL |
84 | 85 | ||
85 | #define IRQ0_IRQ 32 | 86 | #define IRQ0_IRQ evt2irq(0x600) |
86 | #define IRQ1_IRQ 33 | 87 | #define IRQ1_IRQ evt2irq(0x620) |
87 | #endif | 88 | #endif |
88 | 89 | ||
89 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) | 90 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) |
90 | #define IRQ_STNIC 12 | 91 | #define IRQ_STNIC evt2irq(0x380) |
91 | #define IRQ_CFCARD 14 | 92 | #define IRQ_CFCARD evt2irq(0x3c0) |
92 | #else | 93 | #else |
93 | #define IRQ_STNIC 10 | 94 | #define IRQ_STNIC evt2irq(0x340) |
94 | #define IRQ_CFCARD 7 | 95 | #define IRQ_CFCARD evt2irq(0x2e0) |
95 | #endif | 96 | #endif |
96 | 97 | ||
97 | /* SH Ether support (SH7710/SH7712) */ | 98 | /* SH Ether support (SH7710/SH7712) */ |
@@ -105,9 +106,9 @@ | |||
105 | # define PHY_ID 0x01 | 106 | # define PHY_ID 0x01 |
106 | #endif | 107 | #endif |
107 | /* Ether IRQ */ | 108 | /* Ether IRQ */ |
108 | #define SH_ETH0_IRQ 80 | 109 | #define SH_ETH0_IRQ evt2irq(0xc00) |
109 | #define SH_ETH1_IRQ 81 | 110 | #define SH_ETH1_IRQ evt2irq(0xc20) |
110 | #define SH_TSU_IRQ 82 | 111 | #define SH_TSU_IRQ evt2irq(0xc40) |
111 | 112 | ||
112 | void init_se_IRQ(void); | 113 | void init_se_IRQ(void); |
113 | 114 | ||
diff --git a/arch/sh/include/mach-se/mach/se7343.h b/arch/sh/include/mach-se/mach/se7343.h index 8d8170d6cc43..50b5d575dff0 100644 --- a/arch/sh/include/mach-se/mach/se7343.h +++ b/arch/sh/include/mach-se/mach/se7343.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * | 8 | * |
9 | * SH-Mobile SolutionEngine 7343 support | 9 | * SH-Mobile SolutionEngine 7343 support |
10 | */ | 10 | */ |
11 | #include <linux/sh_intc.h> | ||
11 | 12 | ||
12 | /* Box specific addresses. */ | 13 | /* Box specific addresses. */ |
13 | 14 | ||
@@ -118,10 +119,10 @@ | |||
118 | #define FPGA_IN 0xb1400000 | 119 | #define FPGA_IN 0xb1400000 |
119 | #define FPGA_OUT 0xb1400002 | 120 | #define FPGA_OUT 0xb1400002 |
120 | 121 | ||
121 | #define IRQ0_IRQ 32 | 122 | #define IRQ0_IRQ evt2irq(0x600) |
122 | #define IRQ1_IRQ 33 | 123 | #define IRQ1_IRQ evt2irq(0x620) |
123 | #define IRQ4_IRQ 36 | 124 | #define IRQ4_IRQ evt2irq(0x680) |
124 | #define IRQ5_IRQ 37 | 125 | #define IRQ5_IRQ evt2irq(0x6a0) |
125 | 126 | ||
126 | #define SE7343_FPGA_IRQ_MRSHPC0 0 | 127 | #define SE7343_FPGA_IRQ_MRSHPC0 0 |
127 | #define SE7343_FPGA_IRQ_MRSHPC1 1 | 128 | #define SE7343_FPGA_IRQ_MRSHPC1 1 |
diff --git a/arch/sh/include/mach-se/mach/se7721.h b/arch/sh/include/mach-se/mach/se7721.h index b957f6041193..eabd0538de44 100644 --- a/arch/sh/include/mach-se/mach/se7721.h +++ b/arch/sh/include/mach-se/mach/se7721.h | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | #ifndef __ASM_SH_SE7721_H | 12 | #ifndef __ASM_SH_SE7721_H |
13 | #define __ASM_SH_SE7721_H | 13 | #define __ASM_SH_SE7721_H |
14 | |||
15 | #include <linux/sh_intc.h> | ||
14 | #include <asm/addrspace.h> | 16 | #include <asm/addrspace.h> |
15 | 17 | ||
16 | /* Box specific addresses. */ | 18 | /* Box specific addresses. */ |
@@ -49,9 +51,9 @@ | |||
49 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) | 51 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) |
50 | 52 | ||
51 | #define PA_LED 0xB6800000 /* 8bit LED */ | 53 | #define PA_LED 0xB6800000 /* 8bit LED */ |
52 | #define PA_FPGA 0xB7000000 /* FPGA base address */ | 54 | #define PA_FPGA 0xB7000000 /* FPGA base address */ |
53 | 55 | ||
54 | #define MRSHPC_IRQ0 10 | 56 | #define MRSHPC_IRQ0 evt2irq(0x340) |
55 | 57 | ||
56 | #define FPGA_ILSR1 (PA_FPGA + 0x02) | 58 | #define FPGA_ILSR1 (PA_FPGA + 0x02) |
57 | #define FPGA_ILSR2 (PA_FPGA + 0x03) | 59 | #define FPGA_ILSR2 (PA_FPGA + 0x03) |
diff --git a/arch/sh/include/mach-se/mach/se7722.h b/arch/sh/include/mach-se/mach/se7722.h index 16505bfb8a9e..201081ebdbce 100644 --- a/arch/sh/include/mach-se/mach/se7722.h +++ b/arch/sh/include/mach-se/mach/se7722.h | |||
@@ -13,6 +13,7 @@ | |||
13 | * for more details. | 13 | * for more details. |
14 | * | 14 | * |
15 | */ | 15 | */ |
16 | #include <linux/sh_intc.h> | ||
16 | #include <asm/addrspace.h> | 17 | #include <asm/addrspace.h> |
17 | 18 | ||
18 | /* Box specific addresses. */ | 19 | /* Box specific addresses. */ |
@@ -31,7 +32,7 @@ | |||
31 | 32 | ||
32 | #define PA_PERIPHERAL 0xB0000000 | 33 | #define PA_PERIPHERAL 0xB0000000 |
33 | 34 | ||
34 | #define PA_PCIC PA_PERIPHERAL /* MR-SHPC-01 PCMCIA */ | 35 | #define PA_PCIC PA_PERIPHERAL /* MR-SHPC-01 PCMCIA */ |
35 | #define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) /* MR-SHPC-01 PCMCIA controller */ | 36 | #define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) /* MR-SHPC-01 PCMCIA controller */ |
36 | #define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) /* MR-SHPC-01 memory window base */ | 37 | #define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) /* MR-SHPC-01 memory window base */ |
37 | #define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) /* MR-SHPC-01 attribute window base */ | 38 | #define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) /* MR-SHPC-01 attribute window base */ |
@@ -51,7 +52,7 @@ | |||
51 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) | 52 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) |
52 | 53 | ||
53 | #define PA_LED (PA_PERIPHERAL + 0x00800000) /* 8bit LED */ | 54 | #define PA_LED (PA_PERIPHERAL + 0x00800000) /* 8bit LED */ |
54 | #define PA_FPGA (PA_PERIPHERAL + 0x01800000) /* FPGA base address */ | 55 | #define PA_FPGA (PA_PERIPHERAL + 0x01800000) /* FPGA base address */ |
55 | 56 | ||
56 | #define PA_LAN (PA_AREA6_IO + 0) /* SMC LAN91C111 */ | 57 | #define PA_LAN (PA_AREA6_IO + 0) /* SMC LAN91C111 */ |
57 | /* GPIO */ | 58 | /* GPIO */ |
@@ -77,8 +78,8 @@ | |||
77 | #define PORT_HIZCRC 0xA405015CUL | 78 | #define PORT_HIZCRC 0xA405015CUL |
78 | 79 | ||
79 | /* IRQ */ | 80 | /* IRQ */ |
80 | #define IRQ0_IRQ 32 | 81 | #define IRQ0_IRQ evt2irq(0x600) |
81 | #define IRQ1_IRQ 33 | 82 | #define IRQ1_IRQ evt2irq(0x620) |
82 | 83 | ||
83 | #define IRQ01_MODE 0xb1800000 | 84 | #define IRQ01_MODE 0xb1800000 |
84 | #define IRQ01_STS 0xb1800004 | 85 | #define IRQ01_STS 0xb1800004 |
diff --git a/arch/sh/include/mach-se/mach/se7724.h b/arch/sh/include/mach-se/mach/se7724.h index 29514a39d0f5..be842dd1ca02 100644 --- a/arch/sh/include/mach-se/mach/se7724.h +++ b/arch/sh/include/mach-se/mach/se7724.h | |||
@@ -18,6 +18,7 @@ | |||
18 | * for more details. | 18 | * for more details. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | #include <linux/sh_intc.h> | ||
21 | #include <asm/addrspace.h> | 22 | #include <asm/addrspace.h> |
22 | 23 | ||
23 | /* SH Eth */ | 24 | /* SH Eth */ |
@@ -35,9 +36,9 @@ | |||
35 | #define IRQ2_MR (0xba200028) | 36 | #define IRQ2_MR (0xba200028) |
36 | 37 | ||
37 | /* IRQ */ | 38 | /* IRQ */ |
38 | #define IRQ0_IRQ 32 | 39 | #define IRQ0_IRQ evt2irq(0x600) |
39 | #define IRQ1_IRQ 33 | 40 | #define IRQ1_IRQ evt2irq(0x620) |
40 | #define IRQ2_IRQ 34 | 41 | #define IRQ2_IRQ evt2irq(0x640) |
41 | 42 | ||
42 | /* Bits in IRQ012 registers */ | 43 | /* Bits in IRQ012 registers */ |
43 | #define SE7724_FPGA_IRQ_BASE 220 | 44 | #define SE7724_FPGA_IRQ_BASE 220 |
diff --git a/arch/sh/include/mach-se/mach/se7751.h b/arch/sh/include/mach-se/mach/se7751.h index b36792ac5d66..271871793d59 100644 --- a/arch/sh/include/mach-se/mach/se7751.h +++ b/arch/sh/include/mach-se/mach/se7751.h | |||
@@ -11,6 +11,7 @@ | |||
11 | * Modified for 7751 Solution Engine by | 11 | * Modified for 7751 Solution Engine by |
12 | * Ian da Silva and Jeremy Siegel, 2001. | 12 | * Ian da Silva and Jeremy Siegel, 2001. |
13 | */ | 13 | */ |
14 | #include <linux/sh_intc.h> | ||
14 | 15 | ||
15 | /* Box specific addresses. */ | 16 | /* Box specific addresses. */ |
16 | 17 | ||
@@ -63,7 +64,7 @@ | |||
63 | #define BCR_ILCRF (PA_BCR + 10) | 64 | #define BCR_ILCRF (PA_BCR + 10) |
64 | #define BCR_ILCRG (PA_BCR + 12) | 65 | #define BCR_ILCRG (PA_BCR + 12) |
65 | 66 | ||
66 | #define IRQ_79C973 13 | 67 | #define IRQ_79C973 evt2irq(0x3a0) |
67 | 68 | ||
68 | void init_7751se_IRQ(void); | 69 | void init_7751se_IRQ(void); |
69 | 70 | ||
diff --git a/arch/sh/include/mach-se/mach/se7780.h b/arch/sh/include/mach-se/mach/se7780.h index 40e9b41458cd..bde357cf81bd 100644 --- a/arch/sh/include/mach-se/mach/se7780.h +++ b/arch/sh/include/mach-se/mach/se7780.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * License. See the file "COPYING" in the main directory of this archive | 12 | * License. See the file "COPYING" in the main directory of this archive |
13 | * for more details. | 13 | * for more details. |
14 | */ | 14 | */ |
15 | #include <linux/sh_intc.h> | ||
15 | #include <asm/addrspace.h> | 16 | #include <asm/addrspace.h> |
16 | 17 | ||
17 | /* Box specific addresses. */ | 18 | /* Box specific addresses. */ |
@@ -80,13 +81,13 @@ | |||
80 | #define IRQPOS_PCCPW (0 * 4) | 81 | #define IRQPOS_PCCPW (0 * 4) |
81 | 82 | ||
82 | /* IDE interrupt */ | 83 | /* IDE interrupt */ |
83 | #define IRQ_IDE0 67 /* iVDR */ | 84 | #define IRQ_IDE0 evt2irq(0xa60) /* iVDR */ |
84 | 85 | ||
85 | /* SMC interrupt */ | 86 | /* SMC interrupt */ |
86 | #define SMC_IRQ 8 | 87 | #define SMC_IRQ evt2irq(0x300) |
87 | 88 | ||
88 | /* SM501 interrupt */ | 89 | /* SM501 interrupt */ |
89 | #define SM501_IRQ 0 | 90 | #define SM501_IRQ evt2irq(0x200) |
90 | 91 | ||
91 | /* interrupt pin */ | 92 | /* interrupt pin */ |
92 | #define IRQPIN_EXTINT1 0 /* IRQ0 pin */ | 93 | #define IRQPIN_EXTINT1 0 /* IRQ0 pin */ |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index 97416a597dd8..03e4c96f2b11 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include <asm/rtc.h> | 18 | #include <asm/rtc.h> |
18 | #include <cpu/serial.h> | 19 | #include <cpu/serial.h> |
19 | 20 | ||
@@ -114,7 +115,7 @@ static struct resource rtc_resources[] = { | |||
114 | .flags = IORESOURCE_IO, | 115 | .flags = IORESOURCE_IO, |
115 | }, | 116 | }, |
116 | [1] = { | 117 | [1] = { |
117 | .start = 20, | 118 | .start = evt2irq(0x480), |
118 | .flags = IORESOURCE_IRQ, | 119 | .flags = IORESOURCE_IRQ, |
119 | }, | 120 | }, |
120 | }; | 121 | }; |
@@ -146,7 +147,7 @@ static struct resource tmu0_resources[] = { | |||
146 | .flags = IORESOURCE_MEM, | 147 | .flags = IORESOURCE_MEM, |
147 | }, | 148 | }, |
148 | [1] = { | 149 | [1] = { |
149 | .start = 16, | 150 | .start = evt2irq(0x400), |
150 | .flags = IORESOURCE_IRQ, | 151 | .flags = IORESOURCE_IRQ, |
151 | }, | 152 | }, |
152 | }; | 153 | }; |
@@ -174,7 +175,7 @@ static struct resource tmu1_resources[] = { | |||
174 | .flags = IORESOURCE_MEM, | 175 | .flags = IORESOURCE_MEM, |
175 | }, | 176 | }, |
176 | [1] = { | 177 | [1] = { |
177 | .start = 17, | 178 | .start = evt2irq(0x420), |
178 | .flags = IORESOURCE_IRQ, | 179 | .flags = IORESOURCE_IRQ, |
179 | }, | 180 | }, |
180 | }; | 181 | }; |
@@ -201,7 +202,7 @@ static struct resource tmu2_resources[] = { | |||
201 | .flags = IORESOURCE_MEM, | 202 | .flags = IORESOURCE_MEM, |
202 | }, | 203 | }, |
203 | [1] = { | 204 | [1] = { |
204 | .start = 18, | 205 | .start = evt2irq(0x440), |
205 | .flags = IORESOURCE_IRQ, | 206 | .flags = IORESOURCE_IRQ, |
206 | }, | 207 | }, |
207 | }; | 208 | }; |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index 50f95a32a8c5..ba26cd9ce69b 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/serial.h> | 19 | #include <linux/serial.h> |
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | 21 | #include <linux/sh_timer.h> |
22 | #include <linux/sh_intc.h> | ||
22 | #include <cpu/serial.h> | 23 | #include <cpu/serial.h> |
23 | 24 | ||
24 | enum { | 25 | enum { |
@@ -95,7 +96,7 @@ static struct resource rtc_resources[] = { | |||
95 | .flags = IORESOURCE_IO, | 96 | .flags = IORESOURCE_IO, |
96 | }, | 97 | }, |
97 | [1] = { | 98 | [1] = { |
98 | .start = 20, | 99 | .start = evt2irq(0x480), |
99 | .flags = IORESOURCE_IRQ, | 100 | .flags = IORESOURCE_IRQ, |
100 | }, | 101 | }, |
101 | }; | 102 | }; |
@@ -114,7 +115,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
114 | .scscr = SCSCR_TE | SCSCR_RE, | 115 | .scscr = SCSCR_TE | SCSCR_RE, |
115 | .scbrr_algo_id = SCBRR_ALGO_2, | 116 | .scbrr_algo_id = SCBRR_ALGO_2, |
116 | .type = PORT_SCI, | 117 | .type = PORT_SCI, |
117 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x4E0)), | 118 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)), |
118 | .ops = &sh770x_sci_port_ops, | 119 | .ops = &sh770x_sci_port_ops, |
119 | .regshift = 1, | 120 | .regshift = 1, |
120 | }; | 121 | }; |
@@ -184,7 +185,7 @@ static struct resource tmu0_resources[] = { | |||
184 | .flags = IORESOURCE_MEM, | 185 | .flags = IORESOURCE_MEM, |
185 | }, | 186 | }, |
186 | [1] = { | 187 | [1] = { |
187 | .start = 16, | 188 | .start = evt2irq(0x400), |
188 | .flags = IORESOURCE_IRQ, | 189 | .flags = IORESOURCE_IRQ, |
189 | }, | 190 | }, |
190 | }; | 191 | }; |
@@ -212,7 +213,7 @@ static struct resource tmu1_resources[] = { | |||
212 | .flags = IORESOURCE_MEM, | 213 | .flags = IORESOURCE_MEM, |
213 | }, | 214 | }, |
214 | [1] = { | 215 | [1] = { |
215 | .start = 17, | 216 | .start = evt2irq(0x420), |
216 | .flags = IORESOURCE_IRQ, | 217 | .flags = IORESOURCE_IRQ, |
217 | }, | 218 | }, |
218 | }; | 219 | }; |
@@ -239,7 +240,7 @@ static struct resource tmu2_resources[] = { | |||
239 | .flags = IORESOURCE_MEM, | 240 | .flags = IORESOURCE_MEM, |
240 | }, | 241 | }, |
241 | [1] = { | 242 | [1] = { |
242 | .start = 18, | 243 | .start = evt2irq(0x440), |
243 | .flags = IORESOURCE_IRQ, | 244 | .flags = IORESOURCE_IRQ, |
244 | }, | 245 | }, |
245 | }; | 246 | }; |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 7ef248731820..93c9c5e24a7a 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include <asm/rtc.h> | 18 | #include <asm/rtc.h> |
18 | 19 | ||
19 | enum { | 20 | enum { |
@@ -77,7 +78,7 @@ static struct resource rtc_resources[] = { | |||
77 | .flags = IORESOURCE_IO, | 78 | .flags = IORESOURCE_IO, |
78 | }, | 79 | }, |
79 | [1] = { | 80 | [1] = { |
80 | .start = 20, | 81 | .start = evt2irq(0x480), |
81 | .flags = IORESOURCE_IRQ, | 82 | .flags = IORESOURCE_IRQ, |
82 | }, | 83 | }, |
83 | }; | 84 | }; |
@@ -121,7 +122,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
121 | SCSCR_CKE1 | SCSCR_CKE0, | 122 | SCSCR_CKE1 | SCSCR_CKE0, |
122 | .scbrr_algo_id = SCBRR_ALGO_2, | 123 | .scbrr_algo_id = SCBRR_ALGO_2, |
123 | .type = PORT_SCIF, | 124 | .type = PORT_SCIF, |
124 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), | 125 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), |
125 | }; | 126 | }; |
126 | 127 | ||
127 | static struct platform_device scif1_device = { | 128 | static struct platform_device scif1_device = { |
@@ -145,7 +146,7 @@ static struct resource tmu0_resources[] = { | |||
145 | .flags = IORESOURCE_MEM, | 146 | .flags = IORESOURCE_MEM, |
146 | }, | 147 | }, |
147 | [1] = { | 148 | [1] = { |
148 | .start = 16, | 149 | .start = evt2irq(0x400), |
149 | .flags = IORESOURCE_IRQ, | 150 | .flags = IORESOURCE_IRQ, |
150 | }, | 151 | }, |
151 | }; | 152 | }; |
@@ -173,7 +174,7 @@ static struct resource tmu1_resources[] = { | |||
173 | .flags = IORESOURCE_MEM, | 174 | .flags = IORESOURCE_MEM, |
174 | }, | 175 | }, |
175 | [1] = { | 176 | [1] = { |
176 | .start = 17, | 177 | .start = evt2irq(0x420), |
177 | .flags = IORESOURCE_IRQ, | 178 | .flags = IORESOURCE_IRQ, |
178 | }, | 179 | }, |
179 | }; | 180 | }; |
@@ -200,7 +201,7 @@ static struct resource tmu2_resources[] = { | |||
200 | .flags = IORESOURCE_MEM, | 201 | .flags = IORESOURCE_MEM, |
201 | }, | 202 | }, |
202 | [1] = { | 203 | [1] = { |
203 | .start = 18, | 204 | .start = evt2irq(0x440), |
204 | .flags = IORESOURCE_IRQ, | 205 | .flags = IORESOURCE_IRQ, |
205 | }, | 206 | }, |
206 | }; | 207 | }; |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index b2557485d0ce..0c2f1b2c2e19 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | 21 | #include <linux/sh_timer.h> |
22 | #include <linux/sh_intc.h> | ||
22 | #include <asm/rtc.h> | 23 | #include <asm/rtc.h> |
23 | #include <cpu/serial.h> | 24 | #include <cpu/serial.h> |
24 | 25 | ||
@@ -30,7 +31,7 @@ static struct resource rtc_resources[] = { | |||
30 | }, | 31 | }, |
31 | [1] = { | 32 | [1] = { |
32 | /* Shared Period/Carry/Alarm IRQ */ | 33 | /* Shared Period/Carry/Alarm IRQ */ |
33 | .start = 20, | 34 | .start = evt2irq(0x480), |
34 | .flags = IORESOURCE_IRQ, | 35 | .flags = IORESOURCE_IRQ, |
35 | }, | 36 | }, |
36 | }; | 37 | }; |
@@ -55,7 +56,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
55 | .scscr = SCSCR_RE | SCSCR_TE, | 56 | .scscr = SCSCR_RE | SCSCR_TE, |
56 | .scbrr_algo_id = SCBRR_ALGO_4, | 57 | .scbrr_algo_id = SCBRR_ALGO_4, |
57 | .type = PORT_SCIF, | 58 | .type = PORT_SCIF, |
58 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 59 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
59 | .ops = &sh7720_sci_port_ops, | 60 | .ops = &sh7720_sci_port_ops, |
60 | .regtype = SCIx_SH7705_SCIF_REGTYPE, | 61 | .regtype = SCIx_SH7705_SCIF_REGTYPE, |
61 | }; | 62 | }; |
@@ -74,7 +75,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
74 | .scscr = SCSCR_RE | SCSCR_TE, | 75 | .scscr = SCSCR_RE | SCSCR_TE, |
75 | .scbrr_algo_id = SCBRR_ALGO_4, | 76 | .scbrr_algo_id = SCBRR_ALGO_4, |
76 | .type = PORT_SCIF, | 77 | .type = PORT_SCIF, |
77 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC20)), | 78 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), |
78 | .ops = &sh7720_sci_port_ops, | 79 | .ops = &sh7720_sci_port_ops, |
79 | .regtype = SCIx_SH7705_SCIF_REGTYPE, | 80 | .regtype = SCIx_SH7705_SCIF_REGTYPE, |
80 | }; | 81 | }; |
@@ -94,13 +95,14 @@ static struct resource usb_ohci_resources[] = { | |||
94 | .flags = IORESOURCE_MEM, | 95 | .flags = IORESOURCE_MEM, |
95 | }, | 96 | }, |
96 | [1] = { | 97 | [1] = { |
97 | .start = 67, | 98 | .start = evt2irq(0xa60), |
98 | .end = 67, | 99 | .end = evt2irq(0xa60), |
99 | .flags = IORESOURCE_IRQ, | 100 | .flags = IORESOURCE_IRQ, |
100 | }, | 101 | }, |
101 | }; | 102 | }; |
102 | 103 | ||
103 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | 104 | static u64 usb_ohci_dma_mask = 0xffffffffUL; |
105 | |||
104 | static struct platform_device usb_ohci_device = { | 106 | static struct platform_device usb_ohci_device = { |
105 | .name = "sh_ohci", | 107 | .name = "sh_ohci", |
106 | .id = -1, | 108 | .id = -1, |
@@ -121,8 +123,8 @@ static struct resource usbf_resources[] = { | |||
121 | }, | 123 | }, |
122 | [1] = { | 124 | [1] = { |
123 | .name = "sh_udc", | 125 | .name = "sh_udc", |
124 | .start = 65, | 126 | .start = evt2irq(0xa20), |
125 | .end = 65, | 127 | .end = evt2irq(0xa20), |
126 | .flags = IORESOURCE_IRQ, | 128 | .flags = IORESOURCE_IRQ, |
127 | }, | 129 | }, |
128 | }; | 130 | }; |
@@ -152,7 +154,7 @@ static struct resource cmt0_resources[] = { | |||
152 | .flags = IORESOURCE_MEM, | 154 | .flags = IORESOURCE_MEM, |
153 | }, | 155 | }, |
154 | [1] = { | 156 | [1] = { |
155 | .start = 104, | 157 | .start = evt2irq(0xf00), |
156 | .flags = IORESOURCE_IRQ, | 158 | .flags = IORESOURCE_IRQ, |
157 | }, | 159 | }, |
158 | }; | 160 | }; |
@@ -179,7 +181,7 @@ static struct resource cmt1_resources[] = { | |||
179 | .flags = IORESOURCE_MEM, | 181 | .flags = IORESOURCE_MEM, |
180 | }, | 182 | }, |
181 | [1] = { | 183 | [1] = { |
182 | .start = 104, | 184 | .start = evt2irq(0xf00), |
183 | .flags = IORESOURCE_IRQ, | 185 | .flags = IORESOURCE_IRQ, |
184 | }, | 186 | }, |
185 | }; | 187 | }; |
@@ -206,7 +208,7 @@ static struct resource cmt2_resources[] = { | |||
206 | .flags = IORESOURCE_MEM, | 208 | .flags = IORESOURCE_MEM, |
207 | }, | 209 | }, |
208 | [1] = { | 210 | [1] = { |
209 | .start = 104, | 211 | .start = evt2irq(0xf00), |
210 | .flags = IORESOURCE_IRQ, | 212 | .flags = IORESOURCE_IRQ, |
211 | }, | 213 | }, |
212 | }; | 214 | }; |
@@ -233,7 +235,7 @@ static struct resource cmt3_resources[] = { | |||
233 | .flags = IORESOURCE_MEM, | 235 | .flags = IORESOURCE_MEM, |
234 | }, | 236 | }, |
235 | [1] = { | 237 | [1] = { |
236 | .start = 104, | 238 | .start = evt2irq(0xf00), |
237 | .flags = IORESOURCE_IRQ, | 239 | .flags = IORESOURCE_IRQ, |
238 | }, | 240 | }, |
239 | }; | 241 | }; |
@@ -260,7 +262,7 @@ static struct resource cmt4_resources[] = { | |||
260 | .flags = IORESOURCE_MEM, | 262 | .flags = IORESOURCE_MEM, |
261 | }, | 263 | }, |
262 | [1] = { | 264 | [1] = { |
263 | .start = 104, | 265 | .start = evt2irq(0xf00), |
264 | .flags = IORESOURCE_IRQ, | 266 | .flags = IORESOURCE_IRQ, |
265 | }, | 267 | }, |
266 | }; | 268 | }; |
@@ -288,7 +290,7 @@ static struct resource tmu0_resources[] = { | |||
288 | .flags = IORESOURCE_MEM, | 290 | .flags = IORESOURCE_MEM, |
289 | }, | 291 | }, |
290 | [1] = { | 292 | [1] = { |
291 | .start = 16, | 293 | .start = evt2irq(0x400), |
292 | .flags = IORESOURCE_IRQ, | 294 | .flags = IORESOURCE_IRQ, |
293 | }, | 295 | }, |
294 | }; | 296 | }; |
@@ -316,7 +318,7 @@ static struct resource tmu1_resources[] = { | |||
316 | .flags = IORESOURCE_MEM, | 318 | .flags = IORESOURCE_MEM, |
317 | }, | 319 | }, |
318 | [1] = { | 320 | [1] = { |
319 | .start = 17, | 321 | .start = evt2irq(0x420), |
320 | .flags = IORESOURCE_IRQ, | 322 | .flags = IORESOURCE_IRQ, |
321 | }, | 323 | }, |
322 | }; | 324 | }; |
@@ -343,7 +345,7 @@ static struct resource tmu2_resources[] = { | |||
343 | .flags = IORESOURCE_MEM, | 345 | .flags = IORESOURCE_MEM, |
344 | }, | 346 | }, |
345 | [1] = { | 347 | [1] = { |
346 | .start = 18, | 348 | .start = evt2irq(0x440), |
347 | .flags = IORESOURCE_IRQ, | 349 | .flags = IORESOURCE_IRQ, |
348 | }, | 350 | }, |
349 | }; | 351 | }; |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c index 5b2833159b7d..2a5320aa73bb 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | 18 | ||
18 | static struct plat_sci_port scif0_platform_data = { | 19 | static struct plat_sci_port scif0_platform_data = { |
@@ -21,7 +22,10 @@ static struct plat_sci_port scif0_platform_data = { | |||
21 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 22 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
22 | .scbrr_algo_id = SCBRR_ALGO_2, | 23 | .scbrr_algo_id = SCBRR_ALGO_2, |
23 | .type = PORT_SCIF, | 24 | .type = PORT_SCIF, |
24 | .irqs = { 40, 41, 43, 42 }, | 25 | .irqs = { evt2irq(0x700), |
26 | evt2irq(0x720), | ||
27 | evt2irq(0x760), | ||
28 | evt2irq(0x740) }, | ||
25 | }; | 29 | }; |
26 | 30 | ||
27 | static struct platform_device scif0_device = { | 31 | static struct platform_device scif0_device = { |
@@ -45,7 +49,7 @@ static struct resource tmu0_resources[] = { | |||
45 | .flags = IORESOURCE_MEM, | 49 | .flags = IORESOURCE_MEM, |
46 | }, | 50 | }, |
47 | [1] = { | 51 | [1] = { |
48 | .start = 16, | 52 | .start = evt2irq(0x400), |
49 | .flags = IORESOURCE_IRQ, | 53 | .flags = IORESOURCE_IRQ, |
50 | }, | 54 | }, |
51 | }; | 55 | }; |
@@ -73,7 +77,7 @@ static struct resource tmu1_resources[] = { | |||
73 | .flags = IORESOURCE_MEM, | 77 | .flags = IORESOURCE_MEM, |
74 | }, | 78 | }, |
75 | [1] = { | 79 | [1] = { |
76 | .start = 17, | 80 | .start = evt2irq(0x420), |
77 | .flags = IORESOURCE_IRQ, | 81 | .flags = IORESOURCE_IRQ, |
78 | }, | 82 | }, |
79 | }; | 83 | }; |
@@ -100,7 +104,7 @@ static struct resource tmu2_resources[] = { | |||
100 | .flags = IORESOURCE_MEM, | 104 | .flags = IORESOURCE_MEM, |
101 | }, | 105 | }, |
102 | [1] = { | 106 | [1] = { |
103 | .start = 18, | 107 | .start = evt2irq(0x440), |
104 | .flags = IORESOURCE_IRQ, | 108 | .flags = IORESOURCE_IRQ, |
105 | }, | 109 | }, |
106 | }; | 110 | }; |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index 56b3bdc0b285..04a45512596f 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <linux/serial_sci.h> | 17 | #include <linux/serial_sci.h> |
17 | #include <generated/machtypes.h> | 18 | #include <generated/machtypes.h> |
18 | 19 | ||
@@ -24,7 +25,7 @@ static struct resource rtc_resources[] = { | |||
24 | }, | 25 | }, |
25 | [1] = { | 26 | [1] = { |
26 | /* Shared Period/Carry/Alarm IRQ */ | 27 | /* Shared Period/Carry/Alarm IRQ */ |
27 | .start = 20, | 28 | .start = evt2irq(0x480), |
28 | .flags = IORESOURCE_IRQ, | 29 | .flags = IORESOURCE_IRQ, |
29 | }, | 30 | }, |
30 | }; | 31 | }; |
@@ -43,7 +44,7 @@ static struct plat_sci_port sci_platform_data = { | |||
43 | .scscr = SCSCR_TE | SCSCR_RE, | 44 | .scscr = SCSCR_TE | SCSCR_RE, |
44 | .scbrr_algo_id = SCBRR_ALGO_2, | 45 | .scbrr_algo_id = SCBRR_ALGO_2, |
45 | .type = PORT_SCI, | 46 | .type = PORT_SCI, |
46 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xE40)), | 47 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)), |
47 | .regshift = 2, | 48 | .regshift = 2, |
48 | }; | 49 | }; |
49 | 50 | ||
@@ -85,7 +86,7 @@ static struct resource tmu0_resources[] = { | |||
85 | .flags = IORESOURCE_MEM, | 86 | .flags = IORESOURCE_MEM, |
86 | }, | 87 | }, |
87 | [1] = { | 88 | [1] = { |
88 | .start = 16, | 89 | .start = evt2irq(0x400), |
89 | .flags = IORESOURCE_IRQ, | 90 | .flags = IORESOURCE_IRQ, |
90 | }, | 91 | }, |
91 | }; | 92 | }; |
@@ -113,7 +114,7 @@ static struct resource tmu1_resources[] = { | |||
113 | .flags = IORESOURCE_MEM, | 114 | .flags = IORESOURCE_MEM, |
114 | }, | 115 | }, |
115 | [1] = { | 116 | [1] = { |
116 | .start = 17, | 117 | .start = evt2irq(0x420), |
117 | .flags = IORESOURCE_IRQ, | 118 | .flags = IORESOURCE_IRQ, |
118 | }, | 119 | }, |
119 | }; | 120 | }; |
@@ -140,7 +141,7 @@ static struct resource tmu2_resources[] = { | |||
140 | .flags = IORESOURCE_MEM, | 141 | .flags = IORESOURCE_MEM, |
141 | }, | 142 | }, |
142 | [1] = { | 143 | [1] = { |
143 | .start = 18, | 144 | .start = evt2irq(0x440), |
144 | .flags = IORESOURCE_IRQ, | 145 | .flags = IORESOURCE_IRQ, |
145 | }, | 146 | }, |
146 | }; | 147 | }; |
@@ -172,7 +173,7 @@ static struct resource tmu3_resources[] = { | |||
172 | .flags = IORESOURCE_MEM, | 173 | .flags = IORESOURCE_MEM, |
173 | }, | 174 | }, |
174 | [1] = { | 175 | [1] = { |
175 | .start = 72, | 176 | .start = evt2irq(0xb00), |
176 | .flags = IORESOURCE_IRQ, | 177 | .flags = IORESOURCE_IRQ, |
177 | }, | 178 | }, |
178 | }; | 179 | }; |
@@ -199,7 +200,7 @@ static struct resource tmu4_resources[] = { | |||
199 | .flags = IORESOURCE_MEM, | 200 | .flags = IORESOURCE_MEM, |
200 | }, | 201 | }, |
201 | [1] = { | 202 | [1] = { |
202 | .start = 76, | 203 | .start = evt2irq(0xb80), |
203 | .flags = IORESOURCE_IRQ, | 204 | .flags = IORESOURCE_IRQ, |
204 | }, | 205 | }, |
205 | }; | 206 | }; |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c index c0b4c774700e..98e075ada44e 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <linux/sh_timer.h> | 13 | #include <linux/sh_timer.h> |
14 | #include <linux/sh_intc.h> | ||
14 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
15 | #include <linux/io.h> | 16 | #include <linux/io.h> |
16 | 17 | ||
@@ -132,7 +133,10 @@ static struct plat_sci_port scif0_platform_data = { | |||
132 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 133 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
133 | .scbrr_algo_id = SCBRR_ALGO_2, | 134 | .scbrr_algo_id = SCBRR_ALGO_2, |
134 | .type = PORT_SCIF, | 135 | .type = PORT_SCIF, |
135 | .irqs = { 52, 53, 55, 54 }, | 136 | .irqs = { evt2irq(0x880), |
137 | evt2irq(0x8a0), | ||
138 | evt2irq(0x8e0), | ||
139 | evt2irq(0x8c0) }, | ||
136 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 140 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
137 | }; | 141 | }; |
138 | 142 | ||
@@ -150,7 +154,10 @@ static struct plat_sci_port scif1_platform_data = { | |||
150 | .type = PORT_SCIF, | 154 | .type = PORT_SCIF, |
151 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 155 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
152 | .scbrr_algo_id = SCBRR_ALGO_2, | 156 | .scbrr_algo_id = SCBRR_ALGO_2, |
153 | .irqs = { 72, 73, 75, 74 }, | 157 | .irqs = { evt2irq(0xb00), |
158 | evt2irq(0xb20), | ||
159 | evt2irq(0xb60), | ||
160 | evt2irq(0xb40) }, | ||
154 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 161 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
155 | }; | 162 | }; |
156 | 163 | ||
@@ -168,7 +175,10 @@ static struct plat_sci_port scif2_platform_data = { | |||
168 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 175 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
169 | .scbrr_algo_id = SCBRR_ALGO_2, | 176 | .scbrr_algo_id = SCBRR_ALGO_2, |
170 | .type = PORT_SCIF, | 177 | .type = PORT_SCIF, |
171 | .irqs = { 76, 77, 79, 78 }, | 178 | .irqs = { evt2irq(0xb80), |
179 | evt2irq(0xba0), | ||
180 | evt2irq(0xbe0), | ||
181 | evt2irq(0xbc0) }, | ||
172 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 182 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
173 | }; | 183 | }; |
174 | 184 | ||
@@ -186,7 +196,9 @@ static struct plat_sci_port scif3_platform_data = { | |||
186 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 196 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
187 | .scbrr_algo_id = SCBRR_ALGO_2, | 197 | .scbrr_algo_id = SCBRR_ALGO_2, |
188 | .type = PORT_SCI, | 198 | .type = PORT_SCI, |
189 | .irqs = { 80, 81, 82, 0 }, | 199 | .irqs = { evt2irq(0xc00), |
200 | evt2irq(0xc20), | ||
201 | evt2irq(0xc40), }, | ||
190 | .regshift = 2, | 202 | .regshift = 2, |
191 | }; | 203 | }; |
192 | 204 | ||
@@ -211,7 +223,7 @@ static struct resource tmu0_resources[] = { | |||
211 | .flags = IORESOURCE_MEM, | 223 | .flags = IORESOURCE_MEM, |
212 | }, | 224 | }, |
213 | [1] = { | 225 | [1] = { |
214 | .start = 16, | 226 | .start = evt2irq(0x400), |
215 | .flags = IORESOURCE_IRQ, | 227 | .flags = IORESOURCE_IRQ, |
216 | }, | 228 | }, |
217 | }; | 229 | }; |
@@ -239,7 +251,7 @@ static struct resource tmu1_resources[] = { | |||
239 | .flags = IORESOURCE_MEM, | 251 | .flags = IORESOURCE_MEM, |
240 | }, | 252 | }, |
241 | [1] = { | 253 | [1] = { |
242 | .start = 17, | 254 | .start = evt2irq(0x420), |
243 | .flags = IORESOURCE_IRQ, | 255 | .flags = IORESOURCE_IRQ, |
244 | }, | 256 | }, |
245 | }; | 257 | }; |
@@ -266,7 +278,7 @@ static struct resource tmu2_resources[] = { | |||
266 | .flags = IORESOURCE_MEM, | 278 | .flags = IORESOURCE_MEM, |
267 | }, | 279 | }, |
268 | [1] = { | 280 | [1] = { |
269 | .start = 18, | 281 | .start = evt2irq(0x440), |
270 | .flags = IORESOURCE_IRQ, | 282 | .flags = IORESOURCE_IRQ, |
271 | }, | 283 | }, |
272 | }; | 284 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c index 5773643b8a53..b91ea8300a3e 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/uio_driver.h> | 14 | #include <linux/uio_driver.h> |
15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <asm/clock.h> | 17 | #include <asm/clock.h> |
17 | 18 | ||
18 | /* Serial */ | 19 | /* Serial */ |
@@ -22,7 +23,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
22 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, | 23 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, |
23 | .scbrr_algo_id = SCBRR_ALGO_2, | 24 | .scbrr_algo_id = SCBRR_ALGO_2, |
24 | .type = PORT_SCIF, | 25 | .type = PORT_SCIF, |
25 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 26 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
26 | }; | 27 | }; |
27 | 28 | ||
28 | static struct platform_device scif0_device = { | 29 | static struct platform_device scif0_device = { |
@@ -39,7 +40,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
39 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, | 40 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, |
40 | .scbrr_algo_id = SCBRR_ALGO_2, | 41 | .scbrr_algo_id = SCBRR_ALGO_2, |
41 | .type = PORT_SCIF, | 42 | .type = PORT_SCIF, |
42 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC20)), | 43 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), |
43 | }; | 44 | }; |
44 | 45 | ||
45 | static struct platform_device scif1_device = { | 46 | static struct platform_device scif1_device = { |
@@ -56,7 +57,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
56 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, | 57 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, |
57 | .scbrr_algo_id = SCBRR_ALGO_2, | 58 | .scbrr_algo_id = SCBRR_ALGO_2, |
58 | .type = PORT_SCIF, | 59 | .type = PORT_SCIF, |
59 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC40)), | 60 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), |
60 | }; | 61 | }; |
61 | 62 | ||
62 | static struct platform_device scif2_device = { | 63 | static struct platform_device scif2_device = { |
@@ -73,7 +74,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
73 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, | 74 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, |
74 | .scbrr_algo_id = SCBRR_ALGO_2, | 75 | .scbrr_algo_id = SCBRR_ALGO_2, |
75 | .type = PORT_SCIF, | 76 | .type = PORT_SCIF, |
76 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC60)), | 77 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc60)), |
77 | }; | 78 | }; |
78 | 79 | ||
79 | static struct platform_device scif3_device = { | 80 | static struct platform_device scif3_device = { |
@@ -92,8 +93,8 @@ static struct resource iic0_resources[] = { | |||
92 | .flags = IORESOURCE_MEM, | 93 | .flags = IORESOURCE_MEM, |
93 | }, | 94 | }, |
94 | [1] = { | 95 | [1] = { |
95 | .start = 96, | 96 | .start = evt2irq(0xe00), |
96 | .end = 99, | 97 | .end = evt2irq(0xe60), |
97 | .flags = IORESOURCE_IRQ, | 98 | .flags = IORESOURCE_IRQ, |
98 | }, | 99 | }, |
99 | }; | 100 | }; |
@@ -113,8 +114,8 @@ static struct resource iic1_resources[] = { | |||
113 | .flags = IORESOURCE_MEM, | 114 | .flags = IORESOURCE_MEM, |
114 | }, | 115 | }, |
115 | [1] = { | 116 | [1] = { |
116 | .start = 44, | 117 | .start = evt2irq(0x780), |
117 | .end = 47, | 118 | .end = evt2irq(0x7e0), |
118 | .flags = IORESOURCE_IRQ, | 119 | .flags = IORESOURCE_IRQ, |
119 | }, | 120 | }, |
120 | }; | 121 | }; |
@@ -129,7 +130,7 @@ static struct platform_device iic1_device = { | |||
129 | static struct uio_info vpu_platform_data = { | 130 | static struct uio_info vpu_platform_data = { |
130 | .name = "VPU4", | 131 | .name = "VPU4", |
131 | .version = "0", | 132 | .version = "0", |
132 | .irq = 60, | 133 | .irq = evt2irq(0x980), |
133 | }; | 134 | }; |
134 | 135 | ||
135 | static struct resource vpu_resources[] = { | 136 | static struct resource vpu_resources[] = { |
@@ -157,7 +158,7 @@ static struct platform_device vpu_device = { | |||
157 | static struct uio_info veu_platform_data = { | 158 | static struct uio_info veu_platform_data = { |
158 | .name = "VEU", | 159 | .name = "VEU", |
159 | .version = "0", | 160 | .version = "0", |
160 | .irq = 54, | 161 | .irq = evt2irq(0x8c0), |
161 | }; | 162 | }; |
162 | 163 | ||
163 | static struct resource veu_resources[] = { | 164 | static struct resource veu_resources[] = { |
@@ -185,7 +186,7 @@ static struct platform_device veu_device = { | |||
185 | static struct uio_info jpu_platform_data = { | 186 | static struct uio_info jpu_platform_data = { |
186 | .name = "JPU", | 187 | .name = "JPU", |
187 | .version = "0", | 188 | .version = "0", |
188 | .irq = 27, | 189 | .irq = evt2irq(0x560), |
189 | }; | 190 | }; |
190 | 191 | ||
191 | static struct resource jpu_resources[] = { | 192 | static struct resource jpu_resources[] = { |
@@ -224,7 +225,7 @@ static struct resource cmt_resources[] = { | |||
224 | .flags = IORESOURCE_MEM, | 225 | .flags = IORESOURCE_MEM, |
225 | }, | 226 | }, |
226 | [1] = { | 227 | [1] = { |
227 | .start = 104, | 228 | .start = evt2irq(0xf00), |
228 | .flags = IORESOURCE_IRQ, | 229 | .flags = IORESOURCE_IRQ, |
229 | }, | 230 | }, |
230 | }; | 231 | }; |
@@ -252,7 +253,7 @@ static struct resource tmu0_resources[] = { | |||
252 | .flags = IORESOURCE_MEM, | 253 | .flags = IORESOURCE_MEM, |
253 | }, | 254 | }, |
254 | [1] = { | 255 | [1] = { |
255 | .start = 16, | 256 | .start = evt2irq(0x400), |
256 | .flags = IORESOURCE_IRQ, | 257 | .flags = IORESOURCE_IRQ, |
257 | }, | 258 | }, |
258 | }; | 259 | }; |
@@ -280,7 +281,7 @@ static struct resource tmu1_resources[] = { | |||
280 | .flags = IORESOURCE_MEM, | 281 | .flags = IORESOURCE_MEM, |
281 | }, | 282 | }, |
282 | [1] = { | 283 | [1] = { |
283 | .start = 17, | 284 | .start = evt2irq(0x420), |
284 | .flags = IORESOURCE_IRQ, | 285 | .flags = IORESOURCE_IRQ, |
285 | }, | 286 | }, |
286 | }; | 287 | }; |
@@ -307,7 +308,7 @@ static struct resource tmu2_resources[] = { | |||
307 | .flags = IORESOURCE_MEM, | 308 | .flags = IORESOURCE_MEM, |
308 | }, | 309 | }, |
309 | [1] = { | 310 | [1] = { |
310 | .start = 18, | 311 | .start = evt2irq(0x440), |
311 | .flags = IORESOURCE_IRQ, | 312 | .flags = IORESOURCE_IRQ, |
312 | }, | 313 | }, |
313 | }; | 314 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index 20f9e366a814..0bd09d51419f 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/uio_driver.h> | 16 | #include <linux/uio_driver.h> |
17 | #include <linux/sh_timer.h> | 17 | #include <linux/sh_timer.h> |
18 | #include <linux/sh_intc.h> | ||
18 | #include <linux/usb/r8a66597.h> | 19 | #include <linux/usb/r8a66597.h> |
19 | #include <asm/clock.h> | 20 | #include <asm/clock.h> |
20 | 21 | ||
@@ -25,7 +26,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
25 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 26 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
26 | .scbrr_algo_id = SCBRR_ALGO_2, | 27 | .scbrr_algo_id = SCBRR_ALGO_2, |
27 | .type = PORT_SCIF, | 28 | .type = PORT_SCIF, |
28 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 29 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
29 | }; | 30 | }; |
30 | 31 | ||
31 | static struct platform_device scif0_device = { | 32 | static struct platform_device scif0_device = { |
@@ -44,8 +45,8 @@ static struct resource iic_resources[] = { | |||
44 | .flags = IORESOURCE_MEM, | 45 | .flags = IORESOURCE_MEM, |
45 | }, | 46 | }, |
46 | [1] = { | 47 | [1] = { |
47 | .start = 96, | 48 | .start = evt2irq(0xe00), |
48 | .end = 99, | 49 | .end = evt2irq(0xe60), |
49 | .flags = IORESOURCE_IRQ, | 50 | .flags = IORESOURCE_IRQ, |
50 | }, | 51 | }, |
51 | }; | 52 | }; |
@@ -68,8 +69,8 @@ static struct resource usb_host_resources[] = { | |||
68 | .flags = IORESOURCE_MEM, | 69 | .flags = IORESOURCE_MEM, |
69 | }, | 70 | }, |
70 | [1] = { | 71 | [1] = { |
71 | .start = 65, | 72 | .start = evt2irq(0xa20), |
72 | .end = 65, | 73 | .end = evt2irq(0xa20), |
73 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 74 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
74 | }, | 75 | }, |
75 | }; | 76 | }; |
@@ -89,7 +90,7 @@ static struct platform_device usb_host_device = { | |||
89 | static struct uio_info vpu_platform_data = { | 90 | static struct uio_info vpu_platform_data = { |
90 | .name = "VPU5", | 91 | .name = "VPU5", |
91 | .version = "0", | 92 | .version = "0", |
92 | .irq = 60, | 93 | .irq = evt2irq(0x980), |
93 | }; | 94 | }; |
94 | 95 | ||
95 | static struct resource vpu_resources[] = { | 96 | static struct resource vpu_resources[] = { |
@@ -117,7 +118,7 @@ static struct platform_device vpu_device = { | |||
117 | static struct uio_info veu0_platform_data = { | 118 | static struct uio_info veu0_platform_data = { |
118 | .name = "VEU", | 119 | .name = "VEU", |
119 | .version = "0", | 120 | .version = "0", |
120 | .irq = 54, | 121 | .irq = evt2irq(0x8c0), |
121 | }; | 122 | }; |
122 | 123 | ||
123 | static struct resource veu0_resources[] = { | 124 | static struct resource veu0_resources[] = { |
@@ -145,7 +146,7 @@ static struct platform_device veu0_device = { | |||
145 | static struct uio_info veu1_platform_data = { | 146 | static struct uio_info veu1_platform_data = { |
146 | .name = "VEU", | 147 | .name = "VEU", |
147 | .version = "0", | 148 | .version = "0", |
148 | .irq = 27, | 149 | .irq = evt2irq(0x560), |
149 | }; | 150 | }; |
150 | 151 | ||
151 | static struct resource veu1_resources[] = { | 152 | static struct resource veu1_resources[] = { |
@@ -184,7 +185,7 @@ static struct resource cmt_resources[] = { | |||
184 | .flags = IORESOURCE_MEM, | 185 | .flags = IORESOURCE_MEM, |
185 | }, | 186 | }, |
186 | [1] = { | 187 | [1] = { |
187 | .start = 104, | 188 | .start = evt2irq(0xf00), |
188 | .flags = IORESOURCE_IRQ, | 189 | .flags = IORESOURCE_IRQ, |
189 | }, | 190 | }, |
190 | }; | 191 | }; |
@@ -240,7 +241,7 @@ static struct resource tmu1_resources[] = { | |||
240 | .flags = IORESOURCE_MEM, | 241 | .flags = IORESOURCE_MEM, |
241 | }, | 242 | }, |
242 | [1] = { | 243 | [1] = { |
243 | .start = 17, | 244 | .start = evt2irq(0x420), |
244 | .flags = IORESOURCE_IRQ, | 245 | .flags = IORESOURCE_IRQ, |
245 | }, | 246 | }, |
246 | }; | 247 | }; |
@@ -267,7 +268,7 @@ static struct resource tmu2_resources[] = { | |||
267 | .flags = IORESOURCE_MEM, | 268 | .flags = IORESOURCE_MEM, |
268 | }, | 269 | }, |
269 | [1] = { | 270 | [1] = { |
270 | .start = 18, | 271 | .start = evt2irq(0x440), |
271 | .flags = IORESOURCE_IRQ, | 272 | .flags = IORESOURCE_IRQ, |
272 | }, | 273 | }, |
273 | }; | 274 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 34b2ee5805d3..0f5a21907da6 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <linux/uio_driver.h> | 17 | #include <linux/uio_driver.h> |
17 | #include <linux/usb/m66592.h> | 18 | #include <linux/usb/m66592.h> |
18 | 19 | ||
@@ -147,20 +148,20 @@ static struct resource sh7722_dmae_resources[] = { | |||
147 | }, | 148 | }, |
148 | { | 149 | { |
149 | .name = "error_irq", | 150 | .name = "error_irq", |
150 | .start = 78, | 151 | .start = evt2irq(0xbc0), |
151 | .end = 78, | 152 | .end = evt2irq(0xbc0), |
152 | .flags = IORESOURCE_IRQ, | 153 | .flags = IORESOURCE_IRQ, |
153 | }, | 154 | }, |
154 | { | 155 | { |
155 | /* IRQ for channels 0-3 */ | 156 | /* IRQ for channels 0-3 */ |
156 | .start = 48, | 157 | .start = evt2irq(0x800), |
157 | .end = 51, | 158 | .end = evt2irq(0x860), |
158 | .flags = IORESOURCE_IRQ, | 159 | .flags = IORESOURCE_IRQ, |
159 | }, | 160 | }, |
160 | { | 161 | { |
161 | /* IRQ for channels 4-5 */ | 162 | /* IRQ for channels 4-5 */ |
162 | .start = 76, | 163 | .start = evt2irq(0xb80), |
163 | .end = 77, | 164 | .end = evt2irq(0xba0), |
164 | .flags = IORESOURCE_IRQ, | 165 | .flags = IORESOURCE_IRQ, |
165 | }, | 166 | }, |
166 | }; | 167 | }; |
@@ -182,7 +183,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
182 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 183 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
183 | .scbrr_algo_id = SCBRR_ALGO_2, | 184 | .scbrr_algo_id = SCBRR_ALGO_2, |
184 | .type = PORT_SCIF, | 185 | .type = PORT_SCIF, |
185 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 186 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
186 | .ops = &sh7722_sci_port_ops, | 187 | .ops = &sh7722_sci_port_ops, |
187 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 188 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
188 | }; | 189 | }; |
@@ -201,7 +202,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
201 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 202 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
202 | .scbrr_algo_id = SCBRR_ALGO_2, | 203 | .scbrr_algo_id = SCBRR_ALGO_2, |
203 | .type = PORT_SCIF, | 204 | .type = PORT_SCIF, |
204 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC20)), | 205 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), |
205 | .ops = &sh7722_sci_port_ops, | 206 | .ops = &sh7722_sci_port_ops, |
206 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 207 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
207 | }; | 208 | }; |
@@ -220,7 +221,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
220 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 221 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
221 | .scbrr_algo_id = SCBRR_ALGO_2, | 222 | .scbrr_algo_id = SCBRR_ALGO_2, |
222 | .type = PORT_SCIF, | 223 | .type = PORT_SCIF, |
223 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC40)), | 224 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), |
224 | .ops = &sh7722_sci_port_ops, | 225 | .ops = &sh7722_sci_port_ops, |
225 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 226 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
226 | }; | 227 | }; |
@@ -241,17 +242,17 @@ static struct resource rtc_resources[] = { | |||
241 | }, | 242 | }, |
242 | [1] = { | 243 | [1] = { |
243 | /* Period IRQ */ | 244 | /* Period IRQ */ |
244 | .start = 45, | 245 | .start = evt2irq(0x7a0), |
245 | .flags = IORESOURCE_IRQ, | 246 | .flags = IORESOURCE_IRQ, |
246 | }, | 247 | }, |
247 | [2] = { | 248 | [2] = { |
248 | /* Carry IRQ */ | 249 | /* Carry IRQ */ |
249 | .start = 46, | 250 | .start = evt2irq(0x7c0), |
250 | .flags = IORESOURCE_IRQ, | 251 | .flags = IORESOURCE_IRQ, |
251 | }, | 252 | }, |
252 | [3] = { | 253 | [3] = { |
253 | /* Alarm IRQ */ | 254 | /* Alarm IRQ */ |
254 | .start = 44, | 255 | .start = evt2irq(0x780), |
255 | .flags = IORESOURCE_IRQ, | 256 | .flags = IORESOURCE_IRQ, |
256 | }, | 257 | }, |
257 | }; | 258 | }; |
@@ -275,8 +276,8 @@ static struct resource usbf_resources[] = { | |||
275 | .flags = IORESOURCE_MEM, | 276 | .flags = IORESOURCE_MEM, |
276 | }, | 277 | }, |
277 | [1] = { | 278 | [1] = { |
278 | .start = 65, | 279 | .start = evt2irq(0xa20), |
279 | .end = 65, | 280 | .end = evt2irq(0xa20), |
280 | .flags = IORESOURCE_IRQ, | 281 | .flags = IORESOURCE_IRQ, |
281 | }, | 282 | }, |
282 | }; | 283 | }; |
@@ -301,8 +302,8 @@ static struct resource iic_resources[] = { | |||
301 | .flags = IORESOURCE_MEM, | 302 | .flags = IORESOURCE_MEM, |
302 | }, | 303 | }, |
303 | [1] = { | 304 | [1] = { |
304 | .start = 96, | 305 | .start = evt2irq(0xe00), |
305 | .end = 99, | 306 | .end = evt2irq(0xe60), |
306 | .flags = IORESOURCE_IRQ, | 307 | .flags = IORESOURCE_IRQ, |
307 | }, | 308 | }, |
308 | }; | 309 | }; |
@@ -317,7 +318,7 @@ static struct platform_device iic_device = { | |||
317 | static struct uio_info vpu_platform_data = { | 318 | static struct uio_info vpu_platform_data = { |
318 | .name = "VPU4", | 319 | .name = "VPU4", |
319 | .version = "0", | 320 | .version = "0", |
320 | .irq = 60, | 321 | .irq = evt2irq(0x980), |
321 | }; | 322 | }; |
322 | 323 | ||
323 | static struct resource vpu_resources[] = { | 324 | static struct resource vpu_resources[] = { |
@@ -345,7 +346,7 @@ static struct platform_device vpu_device = { | |||
345 | static struct uio_info veu_platform_data = { | 346 | static struct uio_info veu_platform_data = { |
346 | .name = "VEU", | 347 | .name = "VEU", |
347 | .version = "0", | 348 | .version = "0", |
348 | .irq = 54, | 349 | .irq = evt2irq(0x8c0), |
349 | }; | 350 | }; |
350 | 351 | ||
351 | static struct resource veu_resources[] = { | 352 | static struct resource veu_resources[] = { |
@@ -373,7 +374,7 @@ static struct platform_device veu_device = { | |||
373 | static struct uio_info jpu_platform_data = { | 374 | static struct uio_info jpu_platform_data = { |
374 | .name = "JPU", | 375 | .name = "JPU", |
375 | .version = "0", | 376 | .version = "0", |
376 | .irq = 27, | 377 | .irq = evt2irq(0x560), |
377 | }; | 378 | }; |
378 | 379 | ||
379 | static struct resource jpu_resources[] = { | 380 | static struct resource jpu_resources[] = { |
@@ -412,7 +413,7 @@ static struct resource cmt_resources[] = { | |||
412 | .flags = IORESOURCE_MEM, | 413 | .flags = IORESOURCE_MEM, |
413 | }, | 414 | }, |
414 | [1] = { | 415 | [1] = { |
415 | .start = 104, | 416 | .start = evt2irq(0xf00), |
416 | .flags = IORESOURCE_IRQ, | 417 | .flags = IORESOURCE_IRQ, |
417 | }, | 418 | }, |
418 | }; | 419 | }; |
@@ -440,7 +441,7 @@ static struct resource tmu0_resources[] = { | |||
440 | .flags = IORESOURCE_MEM, | 441 | .flags = IORESOURCE_MEM, |
441 | }, | 442 | }, |
442 | [1] = { | 443 | [1] = { |
443 | .start = 16, | 444 | .start = evt2irq(0x400), |
444 | .flags = IORESOURCE_IRQ, | 445 | .flags = IORESOURCE_IRQ, |
445 | }, | 446 | }, |
446 | }; | 447 | }; |
@@ -468,7 +469,7 @@ static struct resource tmu1_resources[] = { | |||
468 | .flags = IORESOURCE_MEM, | 469 | .flags = IORESOURCE_MEM, |
469 | }, | 470 | }, |
470 | [1] = { | 471 | [1] = { |
471 | .start = 17, | 472 | .start = evt2irq(0x420), |
472 | .flags = IORESOURCE_IRQ, | 473 | .flags = IORESOURCE_IRQ, |
473 | }, | 474 | }, |
474 | }; | 475 | }; |
@@ -525,7 +526,7 @@ static struct resource siu_resources[] = { | |||
525 | .flags = IORESOURCE_MEM, | 526 | .flags = IORESOURCE_MEM, |
526 | }, | 527 | }, |
527 | [1] = { | 528 | [1] = { |
528 | .start = 108, | 529 | .start = evt2irq(0xf80), |
529 | .flags = IORESOURCE_IRQ, | 530 | .flags = IORESOURCE_IRQ, |
530 | }, | 531 | }, |
531 | }; | 532 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index 3c1da7e3067d..28d6fd835fe0 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/uio_driver.h> | 15 | #include <linux/uio_driver.h> |
16 | #include <linux/usb/r8a66597.h> | 16 | #include <linux/usb/r8a66597.h> |
17 | #include <linux/sh_timer.h> | 17 | #include <linux/sh_timer.h> |
18 | #include <linux/sh_intc.h> | ||
18 | #include <linux/io.h> | 19 | #include <linux/io.h> |
19 | #include <asm/clock.h> | 20 | #include <asm/clock.h> |
20 | #include <asm/mmzone.h> | 21 | #include <asm/mmzone.h> |
@@ -28,7 +29,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
28 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 29 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
29 | .scbrr_algo_id = SCBRR_ALGO_2, | 30 | .scbrr_algo_id = SCBRR_ALGO_2, |
30 | .type = PORT_SCIF, | 31 | .type = PORT_SCIF, |
31 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 32 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
32 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 33 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -47,7 +48,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
47 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 48 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
48 | .scbrr_algo_id = SCBRR_ALGO_2, | 49 | .scbrr_algo_id = SCBRR_ALGO_2, |
49 | .type = PORT_SCIF, | 50 | .type = PORT_SCIF, |
50 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC20)), | 51 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), |
51 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 52 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
52 | }; | 53 | }; |
53 | 54 | ||
@@ -66,7 +67,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
66 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 67 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
67 | .scbrr_algo_id = SCBRR_ALGO_2, | 68 | .scbrr_algo_id = SCBRR_ALGO_2, |
68 | .type = PORT_SCIF, | 69 | .type = PORT_SCIF, |
69 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC40)), | 70 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), |
70 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 71 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
71 | }; | 72 | }; |
72 | 73 | ||
@@ -85,7 +86,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
85 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 86 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
86 | .scbrr_algo_id = SCBRR_ALGO_3, | 87 | .scbrr_algo_id = SCBRR_ALGO_3, |
87 | .type = PORT_SCIFA, | 88 | .type = PORT_SCIFA, |
88 | .irqs = { 56, 56, 56, 56 }, | 89 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), |
89 | }; | 90 | }; |
90 | 91 | ||
91 | static struct platform_device scif3_device = { | 92 | static struct platform_device scif3_device = { |
@@ -103,7 +104,7 @@ static struct plat_sci_port scif4_platform_data = { | |||
103 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 104 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
104 | .scbrr_algo_id = SCBRR_ALGO_3, | 105 | .scbrr_algo_id = SCBRR_ALGO_3, |
105 | .type = PORT_SCIFA, | 106 | .type = PORT_SCIFA, |
106 | .irqs = { 88, 88, 88, 88 }, | 107 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)), |
107 | }; | 108 | }; |
108 | 109 | ||
109 | static struct platform_device scif4_device = { | 110 | static struct platform_device scif4_device = { |
@@ -121,7 +122,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
121 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 122 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
122 | .scbrr_algo_id = SCBRR_ALGO_3, | 123 | .scbrr_algo_id = SCBRR_ALGO_3, |
123 | .type = PORT_SCIFA, | 124 | .type = PORT_SCIFA, |
124 | .irqs = { 109, 109, 109, 109 }, | 125 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)), |
125 | }; | 126 | }; |
126 | 127 | ||
127 | static struct platform_device scif5_device = { | 128 | static struct platform_device scif5_device = { |
@@ -135,7 +136,7 @@ static struct platform_device scif5_device = { | |||
135 | static struct uio_info vpu_platform_data = { | 136 | static struct uio_info vpu_platform_data = { |
136 | .name = "VPU5", | 137 | .name = "VPU5", |
137 | .version = "0", | 138 | .version = "0", |
138 | .irq = 60, | 139 | .irq = evt2irq(0x980), |
139 | }; | 140 | }; |
140 | 141 | ||
141 | static struct resource vpu_resources[] = { | 142 | static struct resource vpu_resources[] = { |
@@ -163,7 +164,7 @@ static struct platform_device vpu_device = { | |||
163 | static struct uio_info veu0_platform_data = { | 164 | static struct uio_info veu0_platform_data = { |
164 | .name = "VEU2H", | 165 | .name = "VEU2H", |
165 | .version = "0", | 166 | .version = "0", |
166 | .irq = 54, | 167 | .irq = evt2irq(0x8c0), |
167 | }; | 168 | }; |
168 | 169 | ||
169 | static struct resource veu0_resources[] = { | 170 | static struct resource veu0_resources[] = { |
@@ -191,7 +192,7 @@ static struct platform_device veu0_device = { | |||
191 | static struct uio_info veu1_platform_data = { | 192 | static struct uio_info veu1_platform_data = { |
192 | .name = "VEU2H", | 193 | .name = "VEU2H", |
193 | .version = "0", | 194 | .version = "0", |
194 | .irq = 27, | 195 | .irq = evt2irq(0x560), |
195 | }; | 196 | }; |
196 | 197 | ||
197 | static struct resource veu1_resources[] = { | 198 | static struct resource veu1_resources[] = { |
@@ -230,7 +231,7 @@ static struct resource cmt_resources[] = { | |||
230 | .flags = IORESOURCE_MEM, | 231 | .flags = IORESOURCE_MEM, |
231 | }, | 232 | }, |
232 | [1] = { | 233 | [1] = { |
233 | .start = 104, | 234 | .start = evt2irq(0xf00), |
234 | .flags = IORESOURCE_IRQ, | 235 | .flags = IORESOURCE_IRQ, |
235 | }, | 236 | }, |
236 | }; | 237 | }; |
@@ -258,7 +259,7 @@ static struct resource tmu0_resources[] = { | |||
258 | .flags = IORESOURCE_MEM, | 259 | .flags = IORESOURCE_MEM, |
259 | }, | 260 | }, |
260 | [1] = { | 261 | [1] = { |
261 | .start = 16, | 262 | .start = evt2irq(0x400), |
262 | .flags = IORESOURCE_IRQ, | 263 | .flags = IORESOURCE_IRQ, |
263 | }, | 264 | }, |
264 | }; | 265 | }; |
@@ -286,7 +287,7 @@ static struct resource tmu1_resources[] = { | |||
286 | .flags = IORESOURCE_MEM, | 287 | .flags = IORESOURCE_MEM, |
287 | }, | 288 | }, |
288 | [1] = { | 289 | [1] = { |
289 | .start = 17, | 290 | .start = evt2irq(0x420), |
290 | .flags = IORESOURCE_IRQ, | 291 | .flags = IORESOURCE_IRQ, |
291 | }, | 292 | }, |
292 | }; | 293 | }; |
@@ -313,7 +314,7 @@ static struct resource tmu2_resources[] = { | |||
313 | .flags = IORESOURCE_MEM, | 314 | .flags = IORESOURCE_MEM, |
314 | }, | 315 | }, |
315 | [1] = { | 316 | [1] = { |
316 | .start = 18, | 317 | .start = evt2irq(0x440), |
317 | .flags = IORESOURCE_IRQ, | 318 | .flags = IORESOURCE_IRQ, |
318 | }, | 319 | }, |
319 | }; | 320 | }; |
@@ -340,7 +341,7 @@ static struct resource tmu3_resources[] = { | |||
340 | .flags = IORESOURCE_MEM, | 341 | .flags = IORESOURCE_MEM, |
341 | }, | 342 | }, |
342 | [1] = { | 343 | [1] = { |
343 | .start = 57, | 344 | .start = evt2irq(0x920), |
344 | .flags = IORESOURCE_IRQ, | 345 | .flags = IORESOURCE_IRQ, |
345 | }, | 346 | }, |
346 | }; | 347 | }; |
@@ -367,7 +368,7 @@ static struct resource tmu4_resources[] = { | |||
367 | .flags = IORESOURCE_MEM, | 368 | .flags = IORESOURCE_MEM, |
368 | }, | 369 | }, |
369 | [1] = { | 370 | [1] = { |
370 | .start = 58, | 371 | .start = evt2irq(0x940), |
371 | .flags = IORESOURCE_IRQ, | 372 | .flags = IORESOURCE_IRQ, |
372 | }, | 373 | }, |
373 | }; | 374 | }; |
@@ -394,7 +395,7 @@ static struct resource tmu5_resources[] = { | |||
394 | .flags = IORESOURCE_MEM, | 395 | .flags = IORESOURCE_MEM, |
395 | }, | 396 | }, |
396 | [1] = { | 397 | [1] = { |
397 | .start = 57, | 398 | .start = evt2irq(0x920), |
398 | .flags = IORESOURCE_IRQ, | 399 | .flags = IORESOURCE_IRQ, |
399 | }, | 400 | }, |
400 | }; | 401 | }; |
@@ -417,17 +418,17 @@ static struct resource rtc_resources[] = { | |||
417 | }, | 418 | }, |
418 | [1] = { | 419 | [1] = { |
419 | /* Period IRQ */ | 420 | /* Period IRQ */ |
420 | .start = 69, | 421 | .start = evt2irq(0xaa0), |
421 | .flags = IORESOURCE_IRQ, | 422 | .flags = IORESOURCE_IRQ, |
422 | }, | 423 | }, |
423 | [2] = { | 424 | [2] = { |
424 | /* Carry IRQ */ | 425 | /* Carry IRQ */ |
425 | .start = 70, | 426 | .start = evt2irq(0xac0), |
426 | .flags = IORESOURCE_IRQ, | 427 | .flags = IORESOURCE_IRQ, |
427 | }, | 428 | }, |
428 | [3] = { | 429 | [3] = { |
429 | /* Alarm IRQ */ | 430 | /* Alarm IRQ */ |
430 | .start = 68, | 431 | .start = evt2irq(0xa80), |
431 | .flags = IORESOURCE_IRQ, | 432 | .flags = IORESOURCE_IRQ, |
432 | }, | 433 | }, |
433 | }; | 434 | }; |
@@ -450,8 +451,8 @@ static struct resource sh7723_usb_host_resources[] = { | |||
450 | .flags = IORESOURCE_MEM, | 451 | .flags = IORESOURCE_MEM, |
451 | }, | 452 | }, |
452 | [1] = { | 453 | [1] = { |
453 | .start = 65, | 454 | .start = evt2irq(0xa20), |
454 | .end = 65, | 455 | .end = evt2irq(0xa20), |
455 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | 456 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, |
456 | }, | 457 | }, |
457 | }; | 458 | }; |
@@ -476,8 +477,8 @@ static struct resource iic_resources[] = { | |||
476 | .flags = IORESOURCE_MEM, | 477 | .flags = IORESOURCE_MEM, |
477 | }, | 478 | }, |
478 | [1] = { | 479 | [1] = { |
479 | .start = 96, | 480 | .start = evt2irq(0xe00), |
480 | .end = 99, | 481 | .end = evt2irq(0xe60), |
481 | .flags = IORESOURCE_IRQ, | 482 | .flags = IORESOURCE_IRQ, |
482 | }, | 483 | }, |
483 | }; | 484 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 20623baeb1c6..26b74c2f9496 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/uio_driver.h> | 20 | #include <linux/uio_driver.h> |
21 | #include <linux/sh_dma.h> | 21 | #include <linux/sh_dma.h> |
22 | #include <linux/sh_timer.h> | 22 | #include <linux/sh_timer.h> |
23 | #include <linux/sh_intc.h> | ||
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | #include <linux/notifier.h> | 25 | #include <linux/notifier.h> |
25 | 26 | ||
@@ -215,20 +216,20 @@ static struct resource sh7724_dmae0_resources[] = { | |||
215 | }, | 216 | }, |
216 | { | 217 | { |
217 | .name = "error_irq", | 218 | .name = "error_irq", |
218 | .start = 78, | 219 | .start = evt2irq(0xbc0), |
219 | .end = 78, | 220 | .end = evt2irq(0xbc0), |
220 | .flags = IORESOURCE_IRQ, | 221 | .flags = IORESOURCE_IRQ, |
221 | }, | 222 | }, |
222 | { | 223 | { |
223 | /* IRQ for channels 0-3 */ | 224 | /* IRQ for channels 0-3 */ |
224 | .start = 48, | 225 | .start = evt2irq(0x800), |
225 | .end = 51, | 226 | .end = evt2irq(0x860), |
226 | .flags = IORESOURCE_IRQ, | 227 | .flags = IORESOURCE_IRQ, |
227 | }, | 228 | }, |
228 | { | 229 | { |
229 | /* IRQ for channels 4-5 */ | 230 | /* IRQ for channels 4-5 */ |
230 | .start = 76, | 231 | .start = evt2irq(0xb80), |
231 | .end = 77, | 232 | .end = evt2irq(0xba0), |
232 | .flags = IORESOURCE_IRQ, | 233 | .flags = IORESOURCE_IRQ, |
233 | }, | 234 | }, |
234 | }; | 235 | }; |
@@ -249,20 +250,20 @@ static struct resource sh7724_dmae1_resources[] = { | |||
249 | }, | 250 | }, |
250 | { | 251 | { |
251 | .name = "error_irq", | 252 | .name = "error_irq", |
252 | .start = 74, | 253 | .start = evt2irq(0xb40), |
253 | .end = 74, | 254 | .end = evt2irq(0xb40), |
254 | .flags = IORESOURCE_IRQ, | 255 | .flags = IORESOURCE_IRQ, |
255 | }, | 256 | }, |
256 | { | 257 | { |
257 | /* IRQ for channels 0-3 */ | 258 | /* IRQ for channels 0-3 */ |
258 | .start = 40, | 259 | .start = evt2irq(0x700), |
259 | .end = 43, | 260 | .end = evt2irq(0x760), |
260 | .flags = IORESOURCE_IRQ, | 261 | .flags = IORESOURCE_IRQ, |
261 | }, | 262 | }, |
262 | { | 263 | { |
263 | /* IRQ for channels 4-5 */ | 264 | /* IRQ for channels 4-5 */ |
264 | .start = 72, | 265 | .start = evt2irq(0xb00), |
265 | .end = 73, | 266 | .end = evt2irq(0xb20), |
266 | .flags = IORESOURCE_IRQ, | 267 | .flags = IORESOURCE_IRQ, |
267 | }, | 268 | }, |
268 | }; | 269 | }; |
@@ -295,7 +296,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
295 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 296 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
296 | .scbrr_algo_id = SCBRR_ALGO_2, | 297 | .scbrr_algo_id = SCBRR_ALGO_2, |
297 | .type = PORT_SCIF, | 298 | .type = PORT_SCIF, |
298 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC00)), | 299 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), |
299 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 300 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
300 | }; | 301 | }; |
301 | 302 | ||
@@ -314,7 +315,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
314 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 315 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
315 | .scbrr_algo_id = SCBRR_ALGO_2, | 316 | .scbrr_algo_id = SCBRR_ALGO_2, |
316 | .type = PORT_SCIF, | 317 | .type = PORT_SCIF, |
317 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC20)), | 318 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), |
318 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 319 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
319 | }; | 320 | }; |
320 | 321 | ||
@@ -333,7 +334,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
333 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 334 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
334 | .scbrr_algo_id = SCBRR_ALGO_2, | 335 | .scbrr_algo_id = SCBRR_ALGO_2, |
335 | .type = PORT_SCIF, | 336 | .type = PORT_SCIF, |
336 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xC40)), | 337 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), |
337 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 338 | .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
338 | }; | 339 | }; |
339 | 340 | ||
@@ -352,7 +353,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
352 | .scscr = SCSCR_RE | SCSCR_TE, | 353 | .scscr = SCSCR_RE | SCSCR_TE, |
353 | .scbrr_algo_id = SCBRR_ALGO_3, | 354 | .scbrr_algo_id = SCBRR_ALGO_3, |
354 | .type = PORT_SCIFA, | 355 | .type = PORT_SCIFA, |
355 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), | 356 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), |
356 | }; | 357 | }; |
357 | 358 | ||
358 | static struct platform_device scif3_device = { | 359 | static struct platform_device scif3_device = { |
@@ -370,7 +371,7 @@ static struct plat_sci_port scif4_platform_data = { | |||
370 | .scscr = SCSCR_RE | SCSCR_TE, | 371 | .scscr = SCSCR_RE | SCSCR_TE, |
371 | .scbrr_algo_id = SCBRR_ALGO_3, | 372 | .scbrr_algo_id = SCBRR_ALGO_3, |
372 | .type = PORT_SCIFA, | 373 | .type = PORT_SCIFA, |
373 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xD00)), | 374 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)), |
374 | }; | 375 | }; |
375 | 376 | ||
376 | static struct platform_device scif4_device = { | 377 | static struct platform_device scif4_device = { |
@@ -388,7 +389,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
388 | .scscr = SCSCR_RE | SCSCR_TE, | 389 | .scscr = SCSCR_RE | SCSCR_TE, |
389 | .scbrr_algo_id = SCBRR_ALGO_3, | 390 | .scbrr_algo_id = SCBRR_ALGO_3, |
390 | .type = PORT_SCIFA, | 391 | .type = PORT_SCIFA, |
391 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xFA0)), | 392 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)), |
392 | }; | 393 | }; |
393 | 394 | ||
394 | static struct platform_device scif5_device = { | 395 | static struct platform_device scif5_device = { |
@@ -408,17 +409,17 @@ static struct resource rtc_resources[] = { | |||
408 | }, | 409 | }, |
409 | [1] = { | 410 | [1] = { |
410 | /* Period IRQ */ | 411 | /* Period IRQ */ |
411 | .start = 69, | 412 | .start = evt2irq(0xaa0), |
412 | .flags = IORESOURCE_IRQ, | 413 | .flags = IORESOURCE_IRQ, |
413 | }, | 414 | }, |
414 | [2] = { | 415 | [2] = { |
415 | /* Carry IRQ */ | 416 | /* Carry IRQ */ |
416 | .start = 70, | 417 | .start = evt2irq(0xac0), |
417 | .flags = IORESOURCE_IRQ, | 418 | .flags = IORESOURCE_IRQ, |
418 | }, | 419 | }, |
419 | [3] = { | 420 | [3] = { |
420 | /* Alarm IRQ */ | 421 | /* Alarm IRQ */ |
421 | .start = 68, | 422 | .start = evt2irq(0xa80), |
422 | .flags = IORESOURCE_IRQ, | 423 | .flags = IORESOURCE_IRQ, |
423 | }, | 424 | }, |
424 | }; | 425 | }; |
@@ -439,8 +440,8 @@ static struct resource iic0_resources[] = { | |||
439 | .flags = IORESOURCE_MEM, | 440 | .flags = IORESOURCE_MEM, |
440 | }, | 441 | }, |
441 | [1] = { | 442 | [1] = { |
442 | .start = 96, | 443 | .start = evt2irq(0xe00), |
443 | .end = 99, | 444 | .end = evt2irq(0xe60), |
444 | .flags = IORESOURCE_IRQ, | 445 | .flags = IORESOURCE_IRQ, |
445 | }, | 446 | }, |
446 | }; | 447 | }; |
@@ -461,8 +462,8 @@ static struct resource iic1_resources[] = { | |||
461 | .flags = IORESOURCE_MEM, | 462 | .flags = IORESOURCE_MEM, |
462 | }, | 463 | }, |
463 | [1] = { | 464 | [1] = { |
464 | .start = 92, | 465 | .start = evt2irq(0xd80), |
465 | .end = 95, | 466 | .end = evt2irq(0xde0), |
466 | .flags = IORESOURCE_IRQ, | 467 | .flags = IORESOURCE_IRQ, |
467 | }, | 468 | }, |
468 | }; | 469 | }; |
@@ -478,7 +479,7 @@ static struct platform_device iic1_device = { | |||
478 | static struct uio_info vpu_platform_data = { | 479 | static struct uio_info vpu_platform_data = { |
479 | .name = "VPU5F", | 480 | .name = "VPU5F", |
480 | .version = "0", | 481 | .version = "0", |
481 | .irq = 60, | 482 | .irq = evt2irq(0x980), |
482 | }; | 483 | }; |
483 | 484 | ||
484 | static struct resource vpu_resources[] = { | 485 | static struct resource vpu_resources[] = { |
@@ -507,7 +508,7 @@ static struct platform_device vpu_device = { | |||
507 | static struct uio_info veu0_platform_data = { | 508 | static struct uio_info veu0_platform_data = { |
508 | .name = "VEU3F0", | 509 | .name = "VEU3F0", |
509 | .version = "0", | 510 | .version = "0", |
510 | .irq = 83, | 511 | .irq = evt2irq(0xc60), |
511 | }; | 512 | }; |
512 | 513 | ||
513 | static struct resource veu0_resources[] = { | 514 | static struct resource veu0_resources[] = { |
@@ -536,7 +537,7 @@ static struct platform_device veu0_device = { | |||
536 | static struct uio_info veu1_platform_data = { | 537 | static struct uio_info veu1_platform_data = { |
537 | .name = "VEU3F1", | 538 | .name = "VEU3F1", |
538 | .version = "0", | 539 | .version = "0", |
539 | .irq = 54, | 540 | .irq = evt2irq(0x8c0), |
540 | }; | 541 | }; |
541 | 542 | ||
542 | static struct resource veu1_resources[] = { | 543 | static struct resource veu1_resources[] = { |
@@ -633,7 +634,7 @@ static struct resource cmt_resources[] = { | |||
633 | .flags = IORESOURCE_MEM, | 634 | .flags = IORESOURCE_MEM, |
634 | }, | 635 | }, |
635 | [1] = { | 636 | [1] = { |
636 | .start = 104, | 637 | .start = evt2irq(0xf00), |
637 | .flags = IORESOURCE_IRQ, | 638 | .flags = IORESOURCE_IRQ, |
638 | }, | 639 | }, |
639 | }; | 640 | }; |
@@ -661,7 +662,7 @@ static struct resource tmu0_resources[] = { | |||
661 | .flags = IORESOURCE_MEM, | 662 | .flags = IORESOURCE_MEM, |
662 | }, | 663 | }, |
663 | [1] = { | 664 | [1] = { |
664 | .start = 16, | 665 | .start = evt2irq(0x400), |
665 | .flags = IORESOURCE_IRQ, | 666 | .flags = IORESOURCE_IRQ, |
666 | }, | 667 | }, |
667 | }; | 668 | }; |
@@ -689,7 +690,7 @@ static struct resource tmu1_resources[] = { | |||
689 | .flags = IORESOURCE_MEM, | 690 | .flags = IORESOURCE_MEM, |
690 | }, | 691 | }, |
691 | [1] = { | 692 | [1] = { |
692 | .start = 17, | 693 | .start = evt2irq(0x420), |
693 | .flags = IORESOURCE_IRQ, | 694 | .flags = IORESOURCE_IRQ, |
694 | }, | 695 | }, |
695 | }; | 696 | }; |
@@ -716,7 +717,7 @@ static struct resource tmu2_resources[] = { | |||
716 | .flags = IORESOURCE_MEM, | 717 | .flags = IORESOURCE_MEM, |
717 | }, | 718 | }, |
718 | [1] = { | 719 | [1] = { |
719 | .start = 18, | 720 | .start = evt2irq(0x440), |
720 | .flags = IORESOURCE_IRQ, | 721 | .flags = IORESOURCE_IRQ, |
721 | }, | 722 | }, |
722 | }; | 723 | }; |
@@ -744,7 +745,7 @@ static struct resource tmu3_resources[] = { | |||
744 | .flags = IORESOURCE_MEM, | 745 | .flags = IORESOURCE_MEM, |
745 | }, | 746 | }, |
746 | [1] = { | 747 | [1] = { |
747 | .start = 57, | 748 | .start = evt2irq(0x920), |
748 | .flags = IORESOURCE_IRQ, | 749 | .flags = IORESOURCE_IRQ, |
749 | }, | 750 | }, |
750 | }; | 751 | }; |
@@ -771,7 +772,7 @@ static struct resource tmu4_resources[] = { | |||
771 | .flags = IORESOURCE_MEM, | 772 | .flags = IORESOURCE_MEM, |
772 | }, | 773 | }, |
773 | [1] = { | 774 | [1] = { |
774 | .start = 58, | 775 | .start = evt2irq(0x940), |
775 | .flags = IORESOURCE_IRQ, | 776 | .flags = IORESOURCE_IRQ, |
776 | }, | 777 | }, |
777 | }; | 778 | }; |
@@ -798,7 +799,7 @@ static struct resource tmu5_resources[] = { | |||
798 | .flags = IORESOURCE_MEM, | 799 | .flags = IORESOURCE_MEM, |
799 | }, | 800 | }, |
800 | [1] = { | 801 | [1] = { |
801 | .start = 57, | 802 | .start = evt2irq(0x920), |
802 | .flags = IORESOURCE_IRQ, | 803 | .flags = IORESOURCE_IRQ, |
803 | }, | 804 | }, |
804 | }; | 805 | }; |
@@ -817,7 +818,7 @@ static struct platform_device tmu5_device = { | |||
817 | static struct uio_info jpu_platform_data = { | 818 | static struct uio_info jpu_platform_data = { |
818 | .name = "JPU", | 819 | .name = "JPU", |
819 | .version = "0", | 820 | .version = "0", |
820 | .irq = 27, | 821 | .irq = evt2irq(0x560), |
821 | }; | 822 | }; |
822 | 823 | ||
823 | static struct resource jpu_resources[] = { | 824 | static struct resource jpu_resources[] = { |
@@ -846,7 +847,7 @@ static struct platform_device jpu_device = { | |||
846 | static struct uio_info spu0_platform_data = { | 847 | static struct uio_info spu0_platform_data = { |
847 | .name = "SPU2DSP0", | 848 | .name = "SPU2DSP0", |
848 | .version = "0", | 849 | .version = "0", |
849 | .irq = 86, | 850 | .irq = evt2irq(0xcc0), |
850 | }; | 851 | }; |
851 | 852 | ||
852 | static struct resource spu0_resources[] = { | 853 | static struct resource spu0_resources[] = { |
@@ -875,7 +876,7 @@ static struct platform_device spu0_device = { | |||
875 | static struct uio_info spu1_platform_data = { | 876 | static struct uio_info spu1_platform_data = { |
876 | .name = "SPU2DSP1", | 877 | .name = "SPU2DSP1", |
877 | .version = "0", | 878 | .version = "0", |
878 | .irq = 87, | 879 | .irq = evt2irq(0xce0), |
879 | }; | 880 | }; |
880 | 881 | ||
881 | static struct resource spu1_resources[] = { | 882 | static struct resource spu1_resources[] = { |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index fe45e4cb183d..a7708425afa9 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
19 | #include <linux/sh_timer.h> | 19 | #include <linux/sh_timer.h> |
20 | #include <linux/sh_dma.h> | 20 | #include <linux/sh_dma.h> |
21 | 21 | #include <linux/sh_intc.h> | |
22 | #include <cpu/dma-register.h> | 22 | #include <cpu/dma-register.h> |
23 | #include <cpu/sh7757.h> | 23 | #include <cpu/sh7757.h> |
24 | 24 | ||
@@ -45,7 +45,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
45 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 45 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
46 | .scbrr_algo_id = SCBRR_ALGO_2, | 46 | .scbrr_algo_id = SCBRR_ALGO_2, |
47 | .type = PORT_SCIF, | 47 | .type = PORT_SCIF, |
48 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xB80)), | 48 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static struct platform_device scif3_device = { | 51 | static struct platform_device scif3_device = { |
@@ -86,7 +86,7 @@ static struct resource tmu0_resources[] = { | |||
86 | .flags = IORESOURCE_MEM, | 86 | .flags = IORESOURCE_MEM, |
87 | }, | 87 | }, |
88 | [1] = { | 88 | [1] = { |
89 | .start = 28, | 89 | .start = evt2irq(0x580), |
90 | .flags = IORESOURCE_IRQ, | 90 | .flags = IORESOURCE_IRQ, |
91 | }, | 91 | }, |
92 | }; | 92 | }; |
@@ -114,7 +114,7 @@ static struct resource tmu1_resources[] = { | |||
114 | .flags = IORESOURCE_MEM, | 114 | .flags = IORESOURCE_MEM, |
115 | }, | 115 | }, |
116 | [1] = { | 116 | [1] = { |
117 | .start = 29, | 117 | .start = evt2irq(0x5a0), |
118 | .flags = IORESOURCE_IRQ, | 118 | .flags = IORESOURCE_IRQ, |
119 | }, | 119 | }, |
120 | }; | 120 | }; |
@@ -136,7 +136,7 @@ static struct resource spi0_resources[] = { | |||
136 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, | 136 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, |
137 | }, | 137 | }, |
138 | [1] = { | 138 | [1] = { |
139 | .start = 86, | 139 | .start = evt2irq(0xcc0), |
140 | .flags = IORESOURCE_IRQ, | 140 | .flags = IORESOURCE_IRQ, |
141 | }, | 141 | }, |
142 | }; | 142 | }; |
@@ -466,8 +466,8 @@ static struct resource sh7757_dmae0_resources[] = { | |||
466 | }, | 466 | }, |
467 | { | 467 | { |
468 | .name = "error_irq", | 468 | .name = "error_irq", |
469 | .start = 34, | 469 | .start = evt2irq(0x640), |
470 | .end = 34, | 470 | .end = evt2irq(0x640), |
471 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 471 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
472 | }, | 472 | }, |
473 | }; | 473 | }; |
@@ -488,56 +488,56 @@ static struct resource sh7757_dmae1_resources[] = { | |||
488 | }, | 488 | }, |
489 | { | 489 | { |
490 | .name = "error_irq", | 490 | .name = "error_irq", |
491 | .start = 34, | 491 | .start = evt2irq(0x640), |
492 | .end = 34, | 492 | .end = evt2irq(0x640), |
493 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 493 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
494 | }, | 494 | }, |
495 | { | 495 | { |
496 | /* IRQ for channels 4 */ | 496 | /* IRQ for channels 4 */ |
497 | .start = 46, | 497 | .start = evt2irq(0x7c0), |
498 | .end = 46, | 498 | .end = evt2irq(0x7c0), |
499 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 499 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
500 | }, | 500 | }, |
501 | { | 501 | { |
502 | /* IRQ for channels 5 */ | 502 | /* IRQ for channels 5 */ |
503 | .start = 46, | 503 | .start = evt2irq(0x7c0), |
504 | .end = 46, | 504 | .end = evt2irq(0x7c0), |
505 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 505 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
506 | }, | 506 | }, |
507 | { | 507 | { |
508 | /* IRQ for channels 6 */ | 508 | /* IRQ for channels 6 */ |
509 | .start = 88, | 509 | .start = evt2irq(0xd00), |
510 | .end = 88, | 510 | .end = evt2irq(0xd00), |
511 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 511 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
512 | }, | 512 | }, |
513 | { | 513 | { |
514 | /* IRQ for channels 7 */ | 514 | /* IRQ for channels 7 */ |
515 | .start = 88, | 515 | .start = evt2irq(0xd00), |
516 | .end = 88, | 516 | .end = evt2irq(0xd00), |
517 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 517 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
518 | }, | 518 | }, |
519 | { | 519 | { |
520 | /* IRQ for channels 8 */ | 520 | /* IRQ for channels 8 */ |
521 | .start = 88, | 521 | .start = evt2irq(0xd00), |
522 | .end = 88, | 522 | .end = evt2irq(0xd00), |
523 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 523 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
524 | }, | 524 | }, |
525 | { | 525 | { |
526 | /* IRQ for channels 9 */ | 526 | /* IRQ for channels 9 */ |
527 | .start = 88, | 527 | .start = evt2irq(0xd00), |
528 | .end = 88, | 528 | .end = evt2irq(0xd00), |
529 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 529 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
530 | }, | 530 | }, |
531 | { | 531 | { |
532 | /* IRQ for channels 10 */ | 532 | /* IRQ for channels 10 */ |
533 | .start = 88, | 533 | .start = evt2irq(0xd00), |
534 | .end = 88, | 534 | .end = evt2irq(0xd00), |
535 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 535 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
536 | }, | 536 | }, |
537 | { | 537 | { |
538 | /* IRQ for channels 11 */ | 538 | /* IRQ for channels 11 */ |
539 | .start = 88, | 539 | .start = evt2irq(0xd00), |
540 | .end = 88, | 540 | .end = evt2irq(0xd00), |
541 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 541 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
542 | }, | 542 | }, |
543 | }; | 543 | }; |
@@ -558,20 +558,20 @@ static struct resource sh7757_dmae2_resources[] = { | |||
558 | }, | 558 | }, |
559 | { | 559 | { |
560 | .name = "error_irq", | 560 | .name = "error_irq", |
561 | .start = 323, | 561 | .start = evt2irq(0x2a60), |
562 | .end = 323, | 562 | .end = evt2irq(0x2a60), |
563 | .flags = IORESOURCE_IRQ, | 563 | .flags = IORESOURCE_IRQ, |
564 | }, | 564 | }, |
565 | { | 565 | { |
566 | /* IRQ for channels 12 to 16 */ | 566 | /* IRQ for channels 12 to 16 */ |
567 | .start = 272, | 567 | .start = evt2irq(0x2400), |
568 | .end = 276, | 568 | .end = evt2irq(0x2480), |
569 | .flags = IORESOURCE_IRQ, | 569 | .flags = IORESOURCE_IRQ, |
570 | }, | 570 | }, |
571 | { | 571 | { |
572 | /* IRQ for channel 17 */ | 572 | /* IRQ for channel 17 */ |
573 | .start = 279, | 573 | .start = evt2irq(0x24e0), |
574 | .end = 279, | 574 | .end = evt2irq(0x24e0), |
575 | .flags = IORESOURCE_IRQ, | 575 | .flags = IORESOURCE_IRQ, |
576 | }, | 576 | }, |
577 | }; | 577 | }; |
@@ -592,20 +592,20 @@ static struct resource sh7757_dmae3_resources[] = { | |||
592 | }, | 592 | }, |
593 | { | 593 | { |
594 | .name = "error_irq", | 594 | .name = "error_irq", |
595 | .start = 324, | 595 | .start = evt2irq(0x2a80), |
596 | .end = 324, | 596 | .end = evt2irq(0x2a80), |
597 | .flags = IORESOURCE_IRQ, | 597 | .flags = IORESOURCE_IRQ, |
598 | }, | 598 | }, |
599 | { | 599 | { |
600 | /* IRQ for channels 18 to 22 */ | 600 | /* IRQ for channels 18 to 22 */ |
601 | .start = 280, | 601 | .start = evt2irq(0x2500), |
602 | .end = 284, | 602 | .end = evt2irq(0x2580), |
603 | .flags = IORESOURCE_IRQ, | 603 | .flags = IORESOURCE_IRQ, |
604 | }, | 604 | }, |
605 | { | 605 | { |
606 | /* IRQ for channel 23 */ | 606 | /* IRQ for channel 23 */ |
607 | .start = 288, | 607 | .start = evt2irq(0x2600), |
608 | .end = 288, | 608 | .end = evt2irq(0x2600), |
609 | .flags = IORESOURCE_IRQ, | 609 | .flags = IORESOURCE_IRQ, |
610 | }, | 610 | }, |
611 | }; | 611 | }; |
@@ -668,7 +668,7 @@ static struct resource spi1_resources[] = { | |||
668 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, | 668 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, |
669 | }, | 669 | }, |
670 | { | 670 | { |
671 | .start = 54, | 671 | .start = evt2irq(0x8c0), |
672 | .flags = IORESOURCE_IRQ, | 672 | .flags = IORESOURCE_IRQ, |
673 | }, | 673 | }, |
674 | }; | 674 | }; |
@@ -687,7 +687,7 @@ static struct resource rspi_resources[] = { | |||
687 | .flags = IORESOURCE_MEM, | 687 | .flags = IORESOURCE_MEM, |
688 | }, | 688 | }, |
689 | { | 689 | { |
690 | .start = 220, | 690 | .start = evt2irq(0x1d80), |
691 | .flags = IORESOURCE_IRQ, | 691 | .flags = IORESOURCE_IRQ, |
692 | }, | 692 | }, |
693 | }; | 693 | }; |
@@ -706,8 +706,8 @@ static struct resource usb_ehci_resources[] = { | |||
706 | .flags = IORESOURCE_MEM, | 706 | .flags = IORESOURCE_MEM, |
707 | }, | 707 | }, |
708 | [1] = { | 708 | [1] = { |
709 | .start = 57, | 709 | .start = evt2irq(0x920), |
710 | .end = 57, | 710 | .end = evt2irq(0x920), |
711 | .flags = IORESOURCE_IRQ, | 711 | .flags = IORESOURCE_IRQ, |
712 | }, | 712 | }, |
713 | }; | 713 | }; |
@@ -730,8 +730,8 @@ static struct resource usb_ohci_resources[] = { | |||
730 | .flags = IORESOURCE_MEM, | 730 | .flags = IORESOURCE_MEM, |
731 | }, | 731 | }, |
732 | [1] = { | 732 | [1] = { |
733 | .start = 57, | 733 | .start = evt2irq(0x920), |
734 | .end = 57, | 734 | .end = evt2irq(0x920), |
735 | .flags = IORESOURCE_IRQ, | 735 | .flags = IORESOURCE_IRQ, |
736 | }, | 736 | }, |
737 | }; | 737 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c index 197e4c9a4a01..bd0a8fbe610f 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | ||
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | #include <linux/serial_sci.h> | 18 | #include <linux/serial_sci.h> |
18 | 19 | ||
@@ -40,7 +41,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
40 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 41 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
41 | .scbrr_algo_id = SCBRR_ALGO_2, | 42 | .scbrr_algo_id = SCBRR_ALGO_2, |
42 | .type = PORT_SCIF, | 43 | .type = PORT_SCIF, |
43 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xB80)), | 44 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), |
44 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 45 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
45 | }; | 46 | }; |
46 | 47 | ||
@@ -58,7 +59,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
58 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 59 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
59 | .scbrr_algo_id = SCBRR_ALGO_2, | 60 | .scbrr_algo_id = SCBRR_ALGO_2, |
60 | .type = PORT_SCIF, | 61 | .type = PORT_SCIF, |
61 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xF00)), | 62 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xf00)), |
62 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 63 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
63 | }; | 64 | }; |
64 | 65 | ||
@@ -78,7 +79,7 @@ static struct resource rtc_resources[] = { | |||
78 | }, | 79 | }, |
79 | [1] = { | 80 | [1] = { |
80 | /* Shared Period/Carry/Alarm IRQ */ | 81 | /* Shared Period/Carry/Alarm IRQ */ |
81 | .start = 20, | 82 | .start = evt2irq(0x480), |
82 | .flags = IORESOURCE_IRQ, | 83 | .flags = IORESOURCE_IRQ, |
83 | }, | 84 | }, |
84 | }; | 85 | }; |
@@ -97,13 +98,14 @@ static struct resource usb_ohci_resources[] = { | |||
97 | .flags = IORESOURCE_MEM, | 98 | .flags = IORESOURCE_MEM, |
98 | }, | 99 | }, |
99 | [1] = { | 100 | [1] = { |
100 | .start = 83, | 101 | .start = evt2irq(0xc60), |
101 | .end = 83, | 102 | .end = evt2irq(0xc60), |
102 | .flags = IORESOURCE_IRQ, | 103 | .flags = IORESOURCE_IRQ, |
103 | }, | 104 | }, |
104 | }; | 105 | }; |
105 | 106 | ||
106 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | 107 | static u64 usb_ohci_dma_mask = 0xffffffffUL; |
108 | |||
107 | static struct platform_device usb_ohci_device = { | 109 | static struct platform_device usb_ohci_device = { |
108 | .name = "sh_ohci", | 110 | .name = "sh_ohci", |
109 | .id = -1, | 111 | .id = -1, |
@@ -122,8 +124,8 @@ static struct resource usbf_resources[] = { | |||
122 | .flags = IORESOURCE_MEM, | 124 | .flags = IORESOURCE_MEM, |
123 | }, | 125 | }, |
124 | [1] = { | 126 | [1] = { |
125 | .start = 84, | 127 | .start = evt2irq(0xc80), |
126 | .end = 84, | 128 | .end = evt2irq(0xc80), |
127 | .flags = IORESOURCE_IRQ, | 129 | .flags = IORESOURCE_IRQ, |
128 | }, | 130 | }, |
129 | }; | 131 | }; |
@@ -152,7 +154,7 @@ static struct resource tmu0_resources[] = { | |||
152 | .flags = IORESOURCE_MEM, | 154 | .flags = IORESOURCE_MEM, |
153 | }, | 155 | }, |
154 | [1] = { | 156 | [1] = { |
155 | .start = 28, | 157 | .start = evt2irq(0x580), |
156 | .flags = IORESOURCE_IRQ, | 158 | .flags = IORESOURCE_IRQ, |
157 | }, | 159 | }, |
158 | }; | 160 | }; |
@@ -180,7 +182,7 @@ static struct resource tmu1_resources[] = { | |||
180 | .flags = IORESOURCE_MEM, | 182 | .flags = IORESOURCE_MEM, |
181 | }, | 183 | }, |
182 | [1] = { | 184 | [1] = { |
183 | .start = 29, | 185 | .start = evt2irq(0x5a0), |
184 | .flags = IORESOURCE_IRQ, | 186 | .flags = IORESOURCE_IRQ, |
185 | }, | 187 | }, |
186 | }; | 188 | }; |
@@ -207,7 +209,7 @@ static struct resource tmu2_resources[] = { | |||
207 | .flags = IORESOURCE_MEM, | 209 | .flags = IORESOURCE_MEM, |
208 | }, | 210 | }, |
209 | [1] = { | 211 | [1] = { |
210 | .start = 30, | 212 | .start = evt2irq(0x5c0), |
211 | .flags = IORESOURCE_IRQ, | 213 | .flags = IORESOURCE_IRQ, |
212 | }, | 214 | }, |
213 | }; | 215 | }; |
@@ -234,7 +236,7 @@ static struct resource tmu3_resources[] = { | |||
234 | .flags = IORESOURCE_MEM, | 236 | .flags = IORESOURCE_MEM, |
235 | }, | 237 | }, |
236 | [1] = { | 238 | [1] = { |
237 | .start = 96, | 239 | .start = evt2irq(0xe00), |
238 | .flags = IORESOURCE_IRQ, | 240 | .flags = IORESOURCE_IRQ, |
239 | }, | 241 | }, |
240 | }; | 242 | }; |
@@ -261,7 +263,7 @@ static struct resource tmu4_resources[] = { | |||
261 | .flags = IORESOURCE_MEM, | 263 | .flags = IORESOURCE_MEM, |
262 | }, | 264 | }, |
263 | [1] = { | 265 | [1] = { |
264 | .start = 97, | 266 | .start = evt2irq(0xe20), |
265 | .flags = IORESOURCE_IRQ, | 267 | .flags = IORESOURCE_IRQ, |
266 | }, | 268 | }, |
267 | }; | 269 | }; |
@@ -288,7 +290,7 @@ static struct resource tmu5_resources[] = { | |||
288 | .flags = IORESOURCE_MEM, | 290 | .flags = IORESOURCE_MEM, |
289 | }, | 291 | }, |
290 | [1] = { | 292 | [1] = { |
291 | .start = 98, | 293 | .start = evt2irq(0xe40), |
292 | .flags = IORESOURCE_IRQ, | 294 | .flags = IORESOURCE_IRQ, |
293 | }, | 295 | }, |
294 | }; | 296 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c index 46ea8703d18a..256ea7a45164 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/sh_timer.h> | 14 | #include <linux/sh_timer.h> |
15 | #include <linux/sh_intc.h> | ||
15 | #include <linux/io.h> | 16 | #include <linux/io.h> |
16 | 17 | ||
17 | static struct plat_sci_port scif0_platform_data = { | 18 | static struct plat_sci_port scif0_platform_data = { |
@@ -20,7 +21,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
20 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 21 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
21 | .scbrr_algo_id = SCBRR_ALGO_2, | 22 | .scbrr_algo_id = SCBRR_ALGO_2, |
22 | .type = PORT_SCIF, | 23 | .type = PORT_SCIF, |
23 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9A0)), | 24 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)), |
24 | }; | 25 | }; |
25 | 26 | ||
26 | static struct platform_device scif0_device = { | 27 | static struct platform_device scif0_device = { |
@@ -37,7 +38,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
37 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 38 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
38 | .scbrr_algo_id = SCBRR_ALGO_2, | 39 | .scbrr_algo_id = SCBRR_ALGO_2, |
39 | .type = PORT_SCIF, | 40 | .type = PORT_SCIF, |
40 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9C0)), | 41 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)), |
41 | }; | 42 | }; |
42 | 43 | ||
43 | static struct platform_device scif1_device = { | 44 | static struct platform_device scif1_device = { |
@@ -54,7 +55,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
54 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 55 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
55 | .scbrr_algo_id = SCBRR_ALGO_2, | 56 | .scbrr_algo_id = SCBRR_ALGO_2, |
56 | .type = PORT_SCIF, | 57 | .type = PORT_SCIF, |
57 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9E0)), | 58 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)), |
58 | }; | 59 | }; |
59 | 60 | ||
60 | static struct platform_device scif2_device = { | 61 | static struct platform_device scif2_device = { |
@@ -71,7 +72,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
71 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 72 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
72 | .scbrr_algo_id = SCBRR_ALGO_2, | 73 | .scbrr_algo_id = SCBRR_ALGO_2, |
73 | .type = PORT_SCIF, | 74 | .type = PORT_SCIF, |
74 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xA00)), | 75 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xa00)), |
75 | }; | 76 | }; |
76 | 77 | ||
77 | static struct platform_device scif3_device = { | 78 | static struct platform_device scif3_device = { |
@@ -88,7 +89,7 @@ static struct plat_sci_port scif4_platform_data = { | |||
88 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 89 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
89 | .scbrr_algo_id = SCBRR_ALGO_2, | 90 | .scbrr_algo_id = SCBRR_ALGO_2, |
90 | .type = PORT_SCIF, | 91 | .type = PORT_SCIF, |
91 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xA20)), | 92 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xa20)), |
92 | }; | 93 | }; |
93 | 94 | ||
94 | static struct platform_device scif4_device = { | 95 | static struct platform_device scif4_device = { |
@@ -105,7 +106,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
105 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 106 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
106 | .scbrr_algo_id = SCBRR_ALGO_2, | 107 | .scbrr_algo_id = SCBRR_ALGO_2, |
107 | .type = PORT_SCIF, | 108 | .type = PORT_SCIF, |
108 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xA40)), | 109 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xa40)), |
109 | }; | 110 | }; |
110 | 111 | ||
111 | static struct platform_device scif5_device = { | 112 | static struct platform_device scif5_device = { |
@@ -122,7 +123,7 @@ static struct plat_sci_port scif6_platform_data = { | |||
122 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 123 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
123 | .scbrr_algo_id = SCBRR_ALGO_2, | 124 | .scbrr_algo_id = SCBRR_ALGO_2, |
124 | .type = PORT_SCIF, | 125 | .type = PORT_SCIF, |
125 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xA60)), | 126 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xa60)), |
126 | }; | 127 | }; |
127 | 128 | ||
128 | static struct platform_device scif6_device = { | 129 | static struct platform_device scif6_device = { |
@@ -139,7 +140,7 @@ static struct plat_sci_port scif7_platform_data = { | |||
139 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 140 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
140 | .scbrr_algo_id = SCBRR_ALGO_2, | 141 | .scbrr_algo_id = SCBRR_ALGO_2, |
141 | .type = PORT_SCIF, | 142 | .type = PORT_SCIF, |
142 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xA80)), | 143 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xa80)), |
143 | }; | 144 | }; |
144 | 145 | ||
145 | static struct platform_device scif7_device = { | 146 | static struct platform_device scif7_device = { |
@@ -156,7 +157,7 @@ static struct plat_sci_port scif8_platform_data = { | |||
156 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 157 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
157 | .scbrr_algo_id = SCBRR_ALGO_2, | 158 | .scbrr_algo_id = SCBRR_ALGO_2, |
158 | .type = PORT_SCIF, | 159 | .type = PORT_SCIF, |
159 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xAA0)), | 160 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xaa0)), |
160 | }; | 161 | }; |
161 | 162 | ||
162 | static struct platform_device scif8_device = { | 163 | static struct platform_device scif8_device = { |
@@ -173,7 +174,7 @@ static struct plat_sci_port scif9_platform_data = { | |||
173 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, | 174 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, |
174 | .scbrr_algo_id = SCBRR_ALGO_2, | 175 | .scbrr_algo_id = SCBRR_ALGO_2, |
175 | .type = PORT_SCIF, | 176 | .type = PORT_SCIF, |
176 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xAC0)), | 177 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xac0)), |
177 | }; | 178 | }; |
178 | 179 | ||
179 | static struct platform_device scif9_device = { | 180 | static struct platform_device scif9_device = { |
@@ -197,7 +198,7 @@ static struct resource tmu0_resources[] = { | |||
197 | .flags = IORESOURCE_MEM, | 198 | .flags = IORESOURCE_MEM, |
198 | }, | 199 | }, |
199 | [1] = { | 200 | [1] = { |
200 | .start = 16, | 201 | .start = evt2irq(0x400), |
201 | .flags = IORESOURCE_IRQ, | 202 | .flags = IORESOURCE_IRQ, |
202 | }, | 203 | }, |
203 | }; | 204 | }; |
@@ -225,7 +226,7 @@ static struct resource tmu1_resources[] = { | |||
225 | .flags = IORESOURCE_MEM, | 226 | .flags = IORESOURCE_MEM, |
226 | }, | 227 | }, |
227 | [1] = { | 228 | [1] = { |
228 | .start = 17, | 229 | .start = evt2irq(0x420), |
229 | .flags = IORESOURCE_IRQ, | 230 | .flags = IORESOURCE_IRQ, |
230 | }, | 231 | }, |
231 | }; | 232 | }; |
@@ -252,7 +253,7 @@ static struct resource tmu2_resources[] = { | |||
252 | .flags = IORESOURCE_MEM, | 253 | .flags = IORESOURCE_MEM, |
253 | }, | 254 | }, |
254 | [1] = { | 255 | [1] = { |
255 | .start = 18, | 256 | .start = evt2irq(0x440), |
256 | .flags = IORESOURCE_IRQ, | 257 | .flags = IORESOURCE_IRQ, |
257 | }, | 258 | }, |
258 | }; | 259 | }; |
@@ -279,7 +280,7 @@ static struct resource tmu3_resources[] = { | |||
279 | .flags = IORESOURCE_MEM, | 280 | .flags = IORESOURCE_MEM, |
280 | }, | 281 | }, |
281 | [1] = { | 282 | [1] = { |
282 | .start = 19, | 283 | .start = evt2irq(0x460), |
283 | .flags = IORESOURCE_IRQ, | 284 | .flags = IORESOURCE_IRQ, |
284 | }, | 285 | }, |
285 | }; | 286 | }; |
@@ -306,7 +307,7 @@ static struct resource tmu4_resources[] = { | |||
306 | .flags = IORESOURCE_MEM, | 307 | .flags = IORESOURCE_MEM, |
307 | }, | 308 | }, |
308 | [1] = { | 309 | [1] = { |
309 | .start = 20, | 310 | .start = evt2irq(0x480), |
310 | .flags = IORESOURCE_IRQ, | 311 | .flags = IORESOURCE_IRQ, |
311 | }, | 312 | }, |
312 | }; | 313 | }; |
@@ -333,7 +334,7 @@ static struct resource tmu5_resources[] = { | |||
333 | .flags = IORESOURCE_MEM, | 334 | .flags = IORESOURCE_MEM, |
334 | }, | 335 | }, |
335 | [1] = { | 336 | [1] = { |
336 | .start = 21, | 337 | .start = evt2irq(0x4a0), |
337 | .flags = IORESOURCE_IRQ, | 338 | .flags = IORESOURCE_IRQ, |
338 | }, | 339 | }, |
339 | }; | 340 | }; |
@@ -360,7 +361,7 @@ static struct resource tmu6_resources[] = { | |||
360 | .flags = IORESOURCE_MEM, | 361 | .flags = IORESOURCE_MEM, |
361 | }, | 362 | }, |
362 | [1] = { | 363 | [1] = { |
363 | .start = 22, | 364 | .start = evt2irq(0x4c0), |
364 | .flags = IORESOURCE_IRQ, | 365 | .flags = IORESOURCE_IRQ, |
365 | }, | 366 | }, |
366 | }; | 367 | }; |
@@ -387,7 +388,7 @@ static struct resource tmu7_resources[] = { | |||
387 | .flags = IORESOURCE_MEM, | 388 | .flags = IORESOURCE_MEM, |
388 | }, | 389 | }, |
389 | [1] = { | 390 | [1] = { |
390 | .start = 23, | 391 | .start = evt2irq(0x4e0), |
391 | .flags = IORESOURCE_IRQ, | 392 | .flags = IORESOURCE_IRQ, |
392 | }, | 393 | }, |
393 | }; | 394 | }; |
@@ -414,7 +415,7 @@ static struct resource tmu8_resources[] = { | |||
414 | .flags = IORESOURCE_MEM, | 415 | .flags = IORESOURCE_MEM, |
415 | }, | 416 | }, |
416 | [1] = { | 417 | [1] = { |
417 | .start = 24, | 418 | .start = evt2irq(0x500), |
418 | .flags = IORESOURCE_IRQ, | 419 | .flags = IORESOURCE_IRQ, |
419 | }, | 420 | }, |
420 | }; | 421 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c index d431b0052d0c..de45b704687a 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
15 | #include <linux/sh_dma.h> | 15 | #include <linux/sh_dma.h> |
16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include <cpu/dma-register.h> | 18 | #include <cpu/dma-register.h> |
18 | 19 | ||
19 | static struct plat_sci_port scif0_platform_data = { | 20 | static struct plat_sci_port scif0_platform_data = { |
@@ -22,7 +23,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
22 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 23 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
23 | .scbrr_algo_id = SCBRR_ALGO_1, | 24 | .scbrr_algo_id = SCBRR_ALGO_1, |
24 | .type = PORT_SCIF, | 25 | .type = PORT_SCIF, |
25 | .irqs = { 40, 40, 40, 40 }, | 26 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), |
26 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 27 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
27 | }; | 28 | }; |
28 | 29 | ||
@@ -40,7 +41,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
40 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 41 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
41 | .scbrr_algo_id = SCBRR_ALGO_1, | 42 | .scbrr_algo_id = SCBRR_ALGO_1, |
42 | .type = PORT_SCIF, | 43 | .type = PORT_SCIF, |
43 | .irqs = { 76, 76, 76, 76 }, | 44 | .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), |
44 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 45 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
45 | }; | 46 | }; |
46 | 47 | ||
@@ -65,7 +66,7 @@ static struct resource tmu0_resources[] = { | |||
65 | .flags = IORESOURCE_MEM, | 66 | .flags = IORESOURCE_MEM, |
66 | }, | 67 | }, |
67 | [1] = { | 68 | [1] = { |
68 | .start = 28, | 69 | .start = evt2irq(0x580), |
69 | .flags = IORESOURCE_IRQ, | 70 | .flags = IORESOURCE_IRQ, |
70 | }, | 71 | }, |
71 | }; | 72 | }; |
@@ -93,7 +94,7 @@ static struct resource tmu1_resources[] = { | |||
93 | .flags = IORESOURCE_MEM, | 94 | .flags = IORESOURCE_MEM, |
94 | }, | 95 | }, |
95 | [1] = { | 96 | [1] = { |
96 | .start = 29, | 97 | .start = evt2irq(0x5a0), |
97 | .flags = IORESOURCE_IRQ, | 98 | .flags = IORESOURCE_IRQ, |
98 | }, | 99 | }, |
99 | }; | 100 | }; |
@@ -120,7 +121,7 @@ static struct resource tmu2_resources[] = { | |||
120 | .flags = IORESOURCE_MEM, | 121 | .flags = IORESOURCE_MEM, |
121 | }, | 122 | }, |
122 | [1] = { | 123 | [1] = { |
123 | .start = 30, | 124 | .start = evt2irq(0x5c0), |
124 | .flags = IORESOURCE_IRQ, | 125 | .flags = IORESOURCE_IRQ, |
125 | }, | 126 | }, |
126 | }; | 127 | }; |
@@ -147,7 +148,7 @@ static struct resource tmu3_resources[] = { | |||
147 | .flags = IORESOURCE_MEM, | 148 | .flags = IORESOURCE_MEM, |
148 | }, | 149 | }, |
149 | [1] = { | 150 | [1] = { |
150 | .start = 96, | 151 | .start = evt2irq(0xe00), |
151 | .flags = IORESOURCE_IRQ, | 152 | .flags = IORESOURCE_IRQ, |
152 | }, | 153 | }, |
153 | }; | 154 | }; |
@@ -174,7 +175,7 @@ static struct resource tmu4_resources[] = { | |||
174 | .flags = IORESOURCE_MEM, | 175 | .flags = IORESOURCE_MEM, |
175 | }, | 176 | }, |
176 | [1] = { | 177 | [1] = { |
177 | .start = 97, | 178 | .start = evt2irq(0xe20), |
178 | .flags = IORESOURCE_IRQ, | 179 | .flags = IORESOURCE_IRQ, |
179 | }, | 180 | }, |
180 | }; | 181 | }; |
@@ -201,7 +202,7 @@ static struct resource tmu5_resources[] = { | |||
201 | .flags = IORESOURCE_MEM, | 202 | .flags = IORESOURCE_MEM, |
202 | }, | 203 | }, |
203 | [1] = { | 204 | [1] = { |
204 | .start = 98, | 205 | .start = evt2irq(0xe40), |
205 | .flags = IORESOURCE_IRQ, | 206 | .flags = IORESOURCE_IRQ, |
206 | }, | 207 | }, |
207 | }; | 208 | }; |
@@ -224,7 +225,7 @@ static struct resource rtc_resources[] = { | |||
224 | }, | 225 | }, |
225 | [1] = { | 226 | [1] = { |
226 | /* Shared Period/Carry/Alarm IRQ */ | 227 | /* Shared Period/Carry/Alarm IRQ */ |
227 | .start = 20, | 228 | .start = evt2irq(0x480), |
228 | .flags = IORESOURCE_IRQ, | 229 | .flags = IORESOURCE_IRQ, |
229 | }, | 230 | }, |
230 | }; | 231 | }; |
@@ -321,10 +322,13 @@ static struct resource sh7780_dmae0_resources[] = { | |||
321 | .flags = IORESOURCE_MEM, | 322 | .flags = IORESOURCE_MEM, |
322 | }, | 323 | }, |
323 | { | 324 | { |
324 | /* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */ | 325 | /* |
326 | * Real DMA error vector is 0x6c0, and channel | ||
327 | * vectors are 0x640-0x6a0, 0x780-0x7a0 | ||
328 | */ | ||
325 | .name = "error_irq", | 329 | .name = "error_irq", |
326 | .start = 34, | 330 | .start = evt2irq(0x640), |
327 | .end = 34, | 331 | .end = evt2irq(0x640), |
328 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 332 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
329 | }, | 333 | }, |
330 | }; | 334 | }; |
@@ -338,10 +342,13 @@ static struct resource sh7780_dmae1_resources[] = { | |||
338 | }, | 342 | }, |
339 | /* DMAC1 has no DMARS */ | 343 | /* DMAC1 has no DMARS */ |
340 | { | 344 | { |
341 | /* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */ | 345 | /* |
346 | * Real DMA error vector is 0x6c0, and channel | ||
347 | * vectors are 0x7c0-0x7e0, 0xd80-0xde0 | ||
348 | */ | ||
342 | .name = "error_irq", | 349 | .name = "error_irq", |
343 | .start = 46, | 350 | .start = evt2irq(0x7c0), |
344 | .end = 46, | 351 | .end = evt2irq(0x7c0), |
345 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 352 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
346 | }, | 353 | }, |
347 | }; | 354 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 304339fe7a24..0968ecb962e6 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/sh_dma.h> | 16 | #include <linux/sh_dma.h> |
17 | #include <linux/sh_timer.h> | 17 | #include <linux/sh_timer.h> |
18 | #include <linux/sh_intc.h> | ||
18 | #include <asm/mmzone.h> | 19 | #include <asm/mmzone.h> |
19 | #include <cpu/dma-register.h> | 20 | #include <cpu/dma-register.h> |
20 | 21 | ||
@@ -78,7 +79,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
78 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 79 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
79 | .scbrr_algo_id = SCBRR_ALGO_1, | 80 | .scbrr_algo_id = SCBRR_ALGO_1, |
80 | .type = PORT_SCIF, | 81 | .type = PORT_SCIF, |
81 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9A0)), | 82 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)), |
82 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 83 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
83 | }; | 84 | }; |
84 | 85 | ||
@@ -96,7 +97,7 @@ static struct plat_sci_port scif4_platform_data = { | |||
96 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 97 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
97 | .scbrr_algo_id = SCBRR_ALGO_1, | 98 | .scbrr_algo_id = SCBRR_ALGO_1, |
98 | .type = PORT_SCIF, | 99 | .type = PORT_SCIF, |
99 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9C0)), | 100 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)), |
100 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 101 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
101 | }; | 102 | }; |
102 | 103 | ||
@@ -114,7 +115,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
114 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 115 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
115 | .scbrr_algo_id = SCBRR_ALGO_1, | 116 | .scbrr_algo_id = SCBRR_ALGO_1, |
116 | .type = PORT_SCIF, | 117 | .type = PORT_SCIF, |
117 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9E0)), | 118 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)), |
118 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 119 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -139,7 +140,7 @@ static struct resource tmu0_resources[] = { | |||
139 | .flags = IORESOURCE_MEM, | 140 | .flags = IORESOURCE_MEM, |
140 | }, | 141 | }, |
141 | [1] = { | 142 | [1] = { |
142 | .start = 28, | 143 | .start = evt2irq(0x580), |
143 | .flags = IORESOURCE_IRQ, | 144 | .flags = IORESOURCE_IRQ, |
144 | }, | 145 | }, |
145 | }; | 146 | }; |
@@ -167,7 +168,7 @@ static struct resource tmu1_resources[] = { | |||
167 | .flags = IORESOURCE_MEM, | 168 | .flags = IORESOURCE_MEM, |
168 | }, | 169 | }, |
169 | [1] = { | 170 | [1] = { |
170 | .start = 29, | 171 | .start = evt2irq(0x5a0), |
171 | .flags = IORESOURCE_IRQ, | 172 | .flags = IORESOURCE_IRQ, |
172 | }, | 173 | }, |
173 | }; | 174 | }; |
@@ -194,7 +195,7 @@ static struct resource tmu2_resources[] = { | |||
194 | .flags = IORESOURCE_MEM, | 195 | .flags = IORESOURCE_MEM, |
195 | }, | 196 | }, |
196 | [1] = { | 197 | [1] = { |
197 | .start = 30, | 198 | .start = evt2irq(0x5c0), |
198 | .flags = IORESOURCE_IRQ, | 199 | .flags = IORESOURCE_IRQ, |
199 | }, | 200 | }, |
200 | }; | 201 | }; |
@@ -221,7 +222,7 @@ static struct resource tmu3_resources[] = { | |||
221 | .flags = IORESOURCE_MEM, | 222 | .flags = IORESOURCE_MEM, |
222 | }, | 223 | }, |
223 | [1] = { | 224 | [1] = { |
224 | .start = 96, | 225 | .start = evt2irq(0xe00), |
225 | .flags = IORESOURCE_IRQ, | 226 | .flags = IORESOURCE_IRQ, |
226 | }, | 227 | }, |
227 | }; | 228 | }; |
@@ -248,7 +249,7 @@ static struct resource tmu4_resources[] = { | |||
248 | .flags = IORESOURCE_MEM, | 249 | .flags = IORESOURCE_MEM, |
249 | }, | 250 | }, |
250 | [1] = { | 251 | [1] = { |
251 | .start = 97, | 252 | .start = evt2irq(0xe20), |
252 | .flags = IORESOURCE_IRQ, | 253 | .flags = IORESOURCE_IRQ, |
253 | }, | 254 | }, |
254 | }; | 255 | }; |
@@ -275,7 +276,7 @@ static struct resource tmu5_resources[] = { | |||
275 | .flags = IORESOURCE_MEM, | 276 | .flags = IORESOURCE_MEM, |
276 | }, | 277 | }, |
277 | [1] = { | 278 | [1] = { |
278 | .start = 98, | 279 | .start = evt2irq(0xe40), |
279 | .flags = IORESOURCE_IRQ, | 280 | .flags = IORESOURCE_IRQ, |
280 | }, | 281 | }, |
281 | }; | 282 | }; |
@@ -375,10 +376,13 @@ static struct resource sh7785_dmae0_resources[] = { | |||
375 | .flags = IORESOURCE_MEM, | 376 | .flags = IORESOURCE_MEM, |
376 | }, | 377 | }, |
377 | { | 378 | { |
378 | /* Real DMA error IRQ is 39, and channel IRQs are 33-38 */ | 379 | /* |
380 | * Real DMA error vector is 0x6e0, and channel | ||
381 | * vectors are 0x620-0x6c0 | ||
382 | */ | ||
379 | .name = "error_irq", | 383 | .name = "error_irq", |
380 | .start = 33, | 384 | .start = evt2irq(0x620), |
381 | .end = 33, | 385 | .end = evt2irq(0x620), |
382 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 386 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
383 | }, | 387 | }, |
384 | }; | 388 | }; |
@@ -392,10 +396,13 @@ static struct resource sh7785_dmae1_resources[] = { | |||
392 | }, | 396 | }, |
393 | /* DMAC1 has no DMARS */ | 397 | /* DMAC1 has no DMARS */ |
394 | { | 398 | { |
395 | /* Real DMA error IRQ is 58, and channel IRQs are 52-57 */ | 399 | /* |
400 | * Real DMA error vector is 0x940, and channel | ||
401 | * vectors are 0x880-0x920 | ||
402 | */ | ||
396 | .name = "error_irq", | 403 | .name = "error_irq", |
397 | .start = 52, | 404 | .start = evt2irq(0x880), |
398 | .end = 52, | 405 | .end = evt2irq(0x880), |
399 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | 406 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, |
400 | }, | 407 | }, |
401 | }; | 408 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index 9befe2dcf45e..2e6952f87848 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c | |||
@@ -32,7 +32,10 @@ static struct plat_sci_port scif0_platform_data = { | |||
32 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 32 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
33 | .scbrr_algo_id = SCBRR_ALGO_1, | 33 | .scbrr_algo_id = SCBRR_ALGO_1, |
34 | .type = PORT_SCIF, | 34 | .type = PORT_SCIF, |
35 | .irqs = { 40, 41, 43, 42 }, | 35 | .irqs = { evt2irq(0x700), |
36 | evt2irq(0x720), | ||
37 | evt2irq(0x760), | ||
38 | evt2irq(0x740) }, | ||
36 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 39 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
37 | }; | 40 | }; |
38 | 41 | ||
@@ -125,7 +128,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
125 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, | 128 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, |
126 | .scbrr_algo_id = SCBRR_ALGO_1, | 129 | .scbrr_algo_id = SCBRR_ALGO_1, |
127 | .type = PORT_SCIF, | 130 | .type = PORT_SCIF, |
128 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x8A0)), | 131 | .irqs = SCIx_IRQ_MUXED(evt2irq(0x8a0)), |
129 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 132 | .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
130 | }; | 133 | }; |
131 | 134 | ||
@@ -150,7 +153,7 @@ static struct resource tmu0_resources[] = { | |||
150 | .flags = IORESOURCE_MEM, | 153 | .flags = IORESOURCE_MEM, |
151 | }, | 154 | }, |
152 | [1] = { | 155 | [1] = { |
153 | .start = 16, | 156 | .start = evt2irq(0x400), |
154 | .flags = IORESOURCE_IRQ, | 157 | .flags = IORESOURCE_IRQ, |
155 | }, | 158 | }, |
156 | }; | 159 | }; |
@@ -178,7 +181,7 @@ static struct resource tmu1_resources[] = { | |||
178 | .flags = IORESOURCE_MEM, | 181 | .flags = IORESOURCE_MEM, |
179 | }, | 182 | }, |
180 | [1] = { | 183 | [1] = { |
181 | .start = 17, | 184 | .start = evt2irq(0x420), |
182 | .flags = IORESOURCE_IRQ, | 185 | .flags = IORESOURCE_IRQ, |
183 | }, | 186 | }, |
184 | }; | 187 | }; |
@@ -205,7 +208,7 @@ static struct resource tmu2_resources[] = { | |||
205 | .flags = IORESOURCE_MEM, | 208 | .flags = IORESOURCE_MEM, |
206 | }, | 209 | }, |
207 | [1] = { | 210 | [1] = { |
208 | .start = 18, | 211 | .start = evt2irq(0x440), |
209 | .flags = IORESOURCE_IRQ, | 212 | .flags = IORESOURCE_IRQ, |
210 | }, | 213 | }, |
211 | }; | 214 | }; |
@@ -232,7 +235,7 @@ static struct resource tmu3_resources[] = { | |||
232 | .flags = IORESOURCE_MEM, | 235 | .flags = IORESOURCE_MEM, |
233 | }, | 236 | }, |
234 | [1] = { | 237 | [1] = { |
235 | .start = 20, | 238 | .start = evt2irq(0x480), |
236 | .flags = IORESOURCE_IRQ, | 239 | .flags = IORESOURCE_IRQ, |
237 | }, | 240 | }, |
238 | }; | 241 | }; |
@@ -259,7 +262,7 @@ static struct resource tmu4_resources[] = { | |||
259 | .flags = IORESOURCE_MEM, | 262 | .flags = IORESOURCE_MEM, |
260 | }, | 263 | }, |
261 | [1] = { | 264 | [1] = { |
262 | .start = 21, | 265 | .start = evt2irq(0x4a0), |
263 | .flags = IORESOURCE_IRQ, | 266 | .flags = IORESOURCE_IRQ, |
264 | }, | 267 | }, |
265 | }; | 268 | }; |
@@ -286,7 +289,7 @@ static struct resource tmu5_resources[] = { | |||
286 | .flags = IORESOURCE_MEM, | 289 | .flags = IORESOURCE_MEM, |
287 | }, | 290 | }, |
288 | [1] = { | 291 | [1] = { |
289 | .start = 22, | 292 | .start = evt2irq(0x4c0), |
290 | .flags = IORESOURCE_IRQ, | 293 | .flags = IORESOURCE_IRQ, |
291 | }, | 294 | }, |
292 | }; | 295 | }; |
@@ -313,7 +316,7 @@ static struct resource tmu6_resources[] = { | |||
313 | .flags = IORESOURCE_MEM, | 316 | .flags = IORESOURCE_MEM, |
314 | }, | 317 | }, |
315 | [1] = { | 318 | [1] = { |
316 | .start = 45, | 319 | .start = evt2irq(0x7a0), |
317 | .flags = IORESOURCE_IRQ, | 320 | .flags = IORESOURCE_IRQ, |
318 | }, | 321 | }, |
319 | }; | 322 | }; |
@@ -340,7 +343,7 @@ static struct resource tmu7_resources[] = { | |||
340 | .flags = IORESOURCE_MEM, | 343 | .flags = IORESOURCE_MEM, |
341 | }, | 344 | }, |
342 | [1] = { | 345 | [1] = { |
343 | .start = 45, | 346 | .start = evt2irq(0x7a0), |
344 | .flags = IORESOURCE_IRQ, | 347 | .flags = IORESOURCE_IRQ, |
345 | }, | 348 | }, |
346 | }; | 349 | }; |
@@ -367,7 +370,7 @@ static struct resource tmu8_resources[] = { | |||
367 | .flags = IORESOURCE_MEM, | 370 | .flags = IORESOURCE_MEM, |
368 | }, | 371 | }, |
369 | [1] = { | 372 | [1] = { |
370 | .start = 45, | 373 | .start = evt2irq(0x7a0), |
371 | .flags = IORESOURCE_IRQ, | 374 | .flags = IORESOURCE_IRQ, |
372 | }, | 375 | }, |
373 | }; | 376 | }; |
@@ -394,7 +397,7 @@ static struct resource tmu9_resources[] = { | |||
394 | .flags = IORESOURCE_MEM, | 397 | .flags = IORESOURCE_MEM, |
395 | }, | 398 | }, |
396 | [1] = { | 399 | [1] = { |
397 | .start = 46, | 400 | .start = evt2irq(0x7c0), |
398 | .flags = IORESOURCE_IRQ, | 401 | .flags = IORESOURCE_IRQ, |
399 | }, | 402 | }, |
400 | }; | 403 | }; |
@@ -421,7 +424,7 @@ static struct resource tmu10_resources[] = { | |||
421 | .flags = IORESOURCE_MEM, | 424 | .flags = IORESOURCE_MEM, |
422 | }, | 425 | }, |
423 | [1] = { | 426 | [1] = { |
424 | .start = 46, | 427 | .start = evt2irq(0x7c0), |
425 | .flags = IORESOURCE_IRQ, | 428 | .flags = IORESOURCE_IRQ, |
426 | }, | 429 | }, |
427 | }; | 430 | }; |
@@ -448,7 +451,7 @@ static struct resource tmu11_resources[] = { | |||
448 | .flags = IORESOURCE_MEM, | 451 | .flags = IORESOURCE_MEM, |
449 | }, | 452 | }, |
450 | [1] = { | 453 | [1] = { |
451 | .start = 46, | 454 | .start = evt2irq(0x7c0), |
452 | .flags = IORESOURCE_IRQ, | 455 | .flags = IORESOURCE_IRQ, |
453 | }, | 456 | }, |
454 | }; | 457 | }; |
@@ -550,8 +553,8 @@ static struct resource usb_ehci_resources[] = { | |||
550 | .flags = IORESOURCE_MEM, | 553 | .flags = IORESOURCE_MEM, |
551 | }, | 554 | }, |
552 | [1] = { | 555 | [1] = { |
553 | .start = 77, | 556 | .start = evt2irq(0xba0), |
554 | .end = 77, | 557 | .end = evt2irq(0xba0), |
555 | .flags = IORESOURCE_IRQ, | 558 | .flags = IORESOURCE_IRQ, |
556 | }, | 559 | }, |
557 | }; | 560 | }; |
@@ -574,8 +577,8 @@ static struct resource usb_ohci_resources[] = { | |||
574 | .flags = IORESOURCE_MEM, | 577 | .flags = IORESOURCE_MEM, |
575 | }, | 578 | }, |
576 | [1] = { | 579 | [1] = { |
577 | .start = 77, | 580 | .start = evt2irq(0xba0), |
578 | .end = 77, | 581 | .end = evt2irq(0xba0), |
579 | .flags = IORESOURCE_IRQ, | 582 | .flags = IORESOURCE_IRQ, |
580 | }, | 583 | }, |
581 | }; | 584 | }; |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index bb208806dc1a..7ca7dd20fb08 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <linux/sh_intc.h> | ||
17 | #include <cpu/shx3.h> | 18 | #include <cpu/shx3.h> |
18 | #include <asm/mmzone.h> | 19 | #include <asm/mmzone.h> |
19 | 20 | ||
@@ -32,7 +33,10 @@ static struct plat_sci_port scif0_platform_data = { | |||
32 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 33 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
33 | .scbrr_algo_id = SCBRR_ALGO_2, | 34 | .scbrr_algo_id = SCBRR_ALGO_2, |
34 | .type = PORT_SCIF, | 35 | .type = PORT_SCIF, |
35 | .irqs = { 40, 41, 43, 42 }, | 36 | .irqs = { evt2irq(0x700), |
37 | evt2irq(0x720), | ||
38 | evt2irq(0x760), | ||
39 | evt2irq(0x740) }, | ||
36 | }; | 40 | }; |
37 | 41 | ||
38 | static struct platform_device scif0_device = { | 42 | static struct platform_device scif0_device = { |
@@ -49,7 +53,10 @@ static struct plat_sci_port scif1_platform_data = { | |||
49 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 53 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
50 | .scbrr_algo_id = SCBRR_ALGO_2, | 54 | .scbrr_algo_id = SCBRR_ALGO_2, |
51 | .type = PORT_SCIF, | 55 | .type = PORT_SCIF, |
52 | .irqs = { 44, 45, 47, 46 }, | 56 | .irqs = { evt2irq(0x780), |
57 | evt2irq(0x7a0), | ||
58 | evt2irq(0x7e0), | ||
59 | evt2irq(0x7c0) }, | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | static struct platform_device scif1_device = { | 62 | static struct platform_device scif1_device = { |
@@ -66,7 +73,10 @@ static struct plat_sci_port scif2_platform_data = { | |||
66 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 73 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
67 | .scbrr_algo_id = SCBRR_ALGO_2, | 74 | .scbrr_algo_id = SCBRR_ALGO_2, |
68 | .type = PORT_SCIF, | 75 | .type = PORT_SCIF, |
69 | .irqs = { 52, 53, 55, 54 }, | 76 | .irqs = { evt2irq(0x880), |
77 | evt2irq(0x8a0), | ||
78 | evt2irq(0x8e0), | ||
79 | evt2irq(0x8c0) }, | ||
70 | }; | 80 | }; |
71 | 81 | ||
72 | static struct platform_device scif2_device = { | 82 | static struct platform_device scif2_device = { |
@@ -90,7 +100,7 @@ static struct resource tmu0_resources[] = { | |||
90 | .flags = IORESOURCE_MEM, | 100 | .flags = IORESOURCE_MEM, |
91 | }, | 101 | }, |
92 | [1] = { | 102 | [1] = { |
93 | .start = 16, | 103 | .start = evt2irq(0x400), |
94 | .flags = IORESOURCE_IRQ, | 104 | .flags = IORESOURCE_IRQ, |
95 | }, | 105 | }, |
96 | }; | 106 | }; |
@@ -118,7 +128,7 @@ static struct resource tmu1_resources[] = { | |||
118 | .flags = IORESOURCE_MEM, | 128 | .flags = IORESOURCE_MEM, |
119 | }, | 129 | }, |
120 | [1] = { | 130 | [1] = { |
121 | .start = 17, | 131 | .start = evt2irq(0x420), |
122 | .flags = IORESOURCE_IRQ, | 132 | .flags = IORESOURCE_IRQ, |
123 | }, | 133 | }, |
124 | }; | 134 | }; |
@@ -145,7 +155,7 @@ static struct resource tmu2_resources[] = { | |||
145 | .flags = IORESOURCE_MEM, | 155 | .flags = IORESOURCE_MEM, |
146 | }, | 156 | }, |
147 | [1] = { | 157 | [1] = { |
148 | .start = 18, | 158 | .start = evt2irq(0x440), |
149 | .flags = IORESOURCE_IRQ, | 159 | .flags = IORESOURCE_IRQ, |
150 | }, | 160 | }, |
151 | }; | 161 | }; |
@@ -172,7 +182,7 @@ static struct resource tmu3_resources[] = { | |||
172 | .flags = IORESOURCE_MEM, | 182 | .flags = IORESOURCE_MEM, |
173 | }, | 183 | }, |
174 | [1] = { | 184 | [1] = { |
175 | .start = 19, | 185 | .start = evt2irq(0x460), |
176 | .flags = IORESOURCE_IRQ, | 186 | .flags = IORESOURCE_IRQ, |
177 | }, | 187 | }, |
178 | }; | 188 | }; |
@@ -199,7 +209,7 @@ static struct resource tmu4_resources[] = { | |||
199 | .flags = IORESOURCE_MEM, | 209 | .flags = IORESOURCE_MEM, |
200 | }, | 210 | }, |
201 | [1] = { | 211 | [1] = { |
202 | .start = 20, | 212 | .start = evt2irq(0x480), |
203 | .flags = IORESOURCE_IRQ, | 213 | .flags = IORESOURCE_IRQ, |
204 | }, | 214 | }, |
205 | }; | 215 | }; |
@@ -226,7 +236,7 @@ static struct resource tmu5_resources[] = { | |||
226 | .flags = IORESOURCE_MEM, | 236 | .flags = IORESOURCE_MEM, |
227 | }, | 237 | }, |
228 | [1] = { | 238 | [1] = { |
229 | .start = 21, | 239 | .start = evt2irq(0x4a0), |
230 | .flags = IORESOURCE_IRQ, | 240 | .flags = IORESOURCE_IRQ, |
231 | }, | 241 | }, |
232 | }; | 242 | }; |
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 38d48a59879c..9708851a8b9f 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c | |||
@@ -269,4 +269,4 @@ static int __init sunfire_init(void) | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | subsys_initcall(sunfire_init); | 272 | fs_initcall(sunfire_init); |
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S index b57a5942ba64..874162a11ceb 100644 --- a/arch/sparc/mm/ultra.S +++ b/arch/sparc/mm/ultra.S | |||
@@ -495,11 +495,11 @@ xcall_fetch_glob_regs: | |||
495 | stx %o7, [%g1 + GR_SNAP_O7] | 495 | stx %o7, [%g1 + GR_SNAP_O7] |
496 | stx %i7, [%g1 + GR_SNAP_I7] | 496 | stx %i7, [%g1 + GR_SNAP_I7] |
497 | /* Don't try this at home kids... */ | 497 | /* Don't try this at home kids... */ |
498 | rdpr %cwp, %g2 | 498 | rdpr %cwp, %g3 |
499 | sub %g2, 1, %g7 | 499 | sub %g3, 1, %g7 |
500 | wrpr %g7, %cwp | 500 | wrpr %g7, %cwp |
501 | mov %i7, %g7 | 501 | mov %i7, %g7 |
502 | wrpr %g2, %cwp | 502 | wrpr %g3, %cwp |
503 | stx %g7, [%g1 + GR_SNAP_RPC] | 503 | stx %g7, [%g1 + GR_SNAP_RPC] |
504 | sethi %hi(trap_block), %g7 | 504 | sethi %hi(trap_block), %g7 |
505 | or %g7, %lo(trap_block), %g7 | 505 | or %g7, %lo(trap_block), %g7 |
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h index bc4f562bd459..7594764d8a69 100644 --- a/arch/tile/include/asm/thread_info.h +++ b/arch/tile/include/asm/thread_info.h | |||
@@ -100,9 +100,14 @@ extern void cpu_idle_on_new_stack(struct thread_info *old_ti, | |||
100 | 100 | ||
101 | #else /* __ASSEMBLY__ */ | 101 | #else /* __ASSEMBLY__ */ |
102 | 102 | ||
103 | /* how to get the thread information struct from ASM */ | 103 | /* |
104 | * How to get the thread information struct from assembly. | ||
105 | * Note that we use different macros since different architectures | ||
106 | * have different semantics in their "mm" instruction and we would | ||
107 | * like to guarantee that the macro expands to exactly one instruction. | ||
108 | */ | ||
104 | #ifdef __tilegx__ | 109 | #ifdef __tilegx__ |
105 | #define GET_THREAD_INFO(reg) move reg, sp; mm reg, zero, LOG2_THREAD_SIZE, 63 | 110 | #define EXTRACT_THREAD_INFO(reg) mm reg, zero, LOG2_THREAD_SIZE, 63 |
106 | #else | 111 | #else |
107 | #define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31 | 112 | #define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31 |
108 | #endif | 113 | #endif |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index 77763ccd5a7d..cdef6e5ec022 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
@@ -403,19 +403,17 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
403 | * Set up registers for signal handler. | 403 | * Set up registers for signal handler. |
404 | * Registers that we don't modify keep the value they had from | 404 | * Registers that we don't modify keep the value they had from |
405 | * user-space at the time we took the signal. | 405 | * user-space at the time we took the signal. |
406 | * We always pass siginfo and mcontext, regardless of SA_SIGINFO, | ||
407 | * since some things rely on this (e.g. glibc's debug/segfault.c). | ||
406 | */ | 408 | */ |
407 | regs->pc = ptr_to_compat_reg(ka->sa.sa_handler); | 409 | regs->pc = ptr_to_compat_reg(ka->sa.sa_handler); |
408 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ | 410 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ |
409 | regs->sp = ptr_to_compat_reg(frame); | 411 | regs->sp = ptr_to_compat_reg(frame); |
410 | regs->lr = restorer; | 412 | regs->lr = restorer; |
411 | regs->regs[0] = (unsigned long) usig; | 413 | regs->regs[0] = (unsigned long) usig; |
412 | 414 | regs->regs[1] = ptr_to_compat_reg(&frame->info); | |
413 | if (ka->sa.sa_flags & SA_SIGINFO) { | 415 | regs->regs[2] = ptr_to_compat_reg(&frame->uc); |
414 | /* Need extra arguments, so mark to restore caller-saves. */ | 416 | regs->flags |= PT_FLAGS_CALLER_SAVES; |
415 | regs->regs[1] = ptr_to_compat_reg(&frame->info); | ||
416 | regs->regs[2] = ptr_to_compat_reg(&frame->uc); | ||
417 | regs->flags |= PT_FLAGS_CALLER_SAVES; | ||
418 | } | ||
419 | 417 | ||
420 | /* | 418 | /* |
421 | * Notify any tracer that was single-stepping it. | 419 | * Notify any tracer that was single-stepping it. |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 5d56a1ef5ba5..6943515100f8 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
@@ -839,6 +839,18 @@ STD_ENTRY(interrupt_return) | |||
839 | FEEDBACK_REENTER(interrupt_return) | 839 | FEEDBACK_REENTER(interrupt_return) |
840 | 840 | ||
841 | /* | 841 | /* |
842 | * Use r33 to hold whether we have already loaded the callee-saves | ||
843 | * into ptregs. We don't want to do it twice in this loop, since | ||
844 | * then we'd clobber whatever changes are made by ptrace, etc. | ||
845 | * Get base of stack in r32. | ||
846 | */ | ||
847 | { | ||
848 | GET_THREAD_INFO(r32) | ||
849 | movei r33, 0 | ||
850 | } | ||
851 | |||
852 | .Lretry_work_pending: | ||
853 | /* | ||
842 | * Disable interrupts so as to make sure we don't | 854 | * Disable interrupts so as to make sure we don't |
843 | * miss an interrupt that sets any of the thread flags (like | 855 | * miss an interrupt that sets any of the thread flags (like |
844 | * need_resched or sigpending) between sampling and the iret. | 856 | * need_resched or sigpending) between sampling and the iret. |
@@ -848,9 +860,6 @@ STD_ENTRY(interrupt_return) | |||
848 | IRQ_DISABLE(r20, r21) | 860 | IRQ_DISABLE(r20, r21) |
849 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ | 861 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ |
850 | 862 | ||
851 | /* Get base of stack in r32; note r30/31 are used as arguments here. */ | ||
852 | GET_THREAD_INFO(r32) | ||
853 | |||
854 | 863 | ||
855 | /* Check to see if there is any work to do before returning to user. */ | 864 | /* Check to see if there is any work to do before returning to user. */ |
856 | { | 865 | { |
@@ -866,16 +875,18 @@ STD_ENTRY(interrupt_return) | |||
866 | 875 | ||
867 | /* | 876 | /* |
868 | * Make sure we have all the registers saved for signal | 877 | * Make sure we have all the registers saved for signal |
869 | * handling or single-step. Call out to C code to figure out | 878 | * handling, notify-resume, or single-step. Call out to C |
870 | * exactly what we need to do for each flag bit, then if | 879 | * code to figure out exactly what we need to do for each flag bit, |
871 | * necessary, reload the flags and recheck. | 880 | * then if necessary, reload the flags and recheck. |
872 | */ | 881 | */ |
873 | push_extra_callee_saves r0 | ||
874 | { | 882 | { |
875 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) | 883 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) |
876 | jal do_work_pending | 884 | bnz r33, 1f |
877 | } | 885 | } |
878 | bnz r0, .Lresume_userspace | 886 | push_extra_callee_saves r0 |
887 | movei r33, 1 | ||
888 | 1: jal do_work_pending | ||
889 | bnz r0, .Lretry_work_pending | ||
879 | 890 | ||
880 | /* | 891 | /* |
881 | * In the NMI case we | 892 | * In the NMI case we |
@@ -1180,10 +1191,12 @@ handle_syscall: | |||
1180 | add r20, r20, tp | 1191 | add r20, r20, tp |
1181 | lw r21, r20 | 1192 | lw r21, r20 |
1182 | addi r21, r21, 1 | 1193 | addi r21, r21, 1 |
1183 | sw r20, r21 | 1194 | { |
1195 | sw r20, r21 | ||
1196 | GET_THREAD_INFO(r31) | ||
1197 | } | ||
1184 | 1198 | ||
1185 | /* Trace syscalls, if requested. */ | 1199 | /* Trace syscalls, if requested. */ |
1186 | GET_THREAD_INFO(r31) | ||
1187 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET | 1200 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET |
1188 | lw r30, r31 | 1201 | lw r30, r31 |
1189 | andi r30, r30, _TIF_SYSCALL_TRACE | 1202 | andi r30, r30, _TIF_SYSCALL_TRACE |
@@ -1362,7 +1375,10 @@ handle_ill: | |||
1362 | 3: | 1375 | 3: |
1363 | /* set PC and continue */ | 1376 | /* set PC and continue */ |
1364 | lw r26, r24 | 1377 | lw r26, r24 |
1365 | sw r28, r26 | 1378 | { |
1379 | sw r28, r26 | ||
1380 | GET_THREAD_INFO(r0) | ||
1381 | } | ||
1366 | 1382 | ||
1367 | /* | 1383 | /* |
1368 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. | 1384 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. |
@@ -1370,7 +1386,6 @@ handle_ill: | |||
1370 | * need to clear it here and can't really impose on all other arches. | 1386 | * need to clear it here and can't really impose on all other arches. |
1371 | * So what's another write between friends? | 1387 | * So what's another write between friends? |
1372 | */ | 1388 | */ |
1373 | GET_THREAD_INFO(r0) | ||
1374 | 1389 | ||
1375 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET | 1390 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET |
1376 | { | 1391 | { |
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index 49d9d6621682..30ae76e50c44 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S | |||
@@ -647,6 +647,20 @@ STD_ENTRY(interrupt_return) | |||
647 | FEEDBACK_REENTER(interrupt_return) | 647 | FEEDBACK_REENTER(interrupt_return) |
648 | 648 | ||
649 | /* | 649 | /* |
650 | * Use r33 to hold whether we have already loaded the callee-saves | ||
651 | * into ptregs. We don't want to do it twice in this loop, since | ||
652 | * then we'd clobber whatever changes are made by ptrace, etc. | ||
653 | */ | ||
654 | { | ||
655 | movei r33, 0 | ||
656 | move r32, sp | ||
657 | } | ||
658 | |||
659 | /* Get base of stack in r32. */ | ||
660 | EXTRACT_THREAD_INFO(r32) | ||
661 | |||
662 | .Lretry_work_pending: | ||
663 | /* | ||
650 | * Disable interrupts so as to make sure we don't | 664 | * Disable interrupts so as to make sure we don't |
651 | * miss an interrupt that sets any of the thread flags (like | 665 | * miss an interrupt that sets any of the thread flags (like |
652 | * need_resched or sigpending) between sampling and the iret. | 666 | * need_resched or sigpending) between sampling and the iret. |
@@ -656,9 +670,6 @@ STD_ENTRY(interrupt_return) | |||
656 | IRQ_DISABLE(r20, r21) | 670 | IRQ_DISABLE(r20, r21) |
657 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ | 671 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ |
658 | 672 | ||
659 | /* Get base of stack in r32; note r30/31 are used as arguments here. */ | ||
660 | GET_THREAD_INFO(r32) | ||
661 | |||
662 | 673 | ||
663 | /* Check to see if there is any work to do before returning to user. */ | 674 | /* Check to see if there is any work to do before returning to user. */ |
664 | { | 675 | { |
@@ -674,16 +685,18 @@ STD_ENTRY(interrupt_return) | |||
674 | 685 | ||
675 | /* | 686 | /* |
676 | * Make sure we have all the registers saved for signal | 687 | * Make sure we have all the registers saved for signal |
677 | * handling or single-step. Call out to C code to figure out | 688 | * handling or notify-resume. Call out to C code to figure out |
678 | * exactly what we need to do for each flag bit, then if | 689 | * exactly what we need to do for each flag bit, then if |
679 | * necessary, reload the flags and recheck. | 690 | * necessary, reload the flags and recheck. |
680 | */ | 691 | */ |
681 | push_extra_callee_saves r0 | ||
682 | { | 692 | { |
683 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) | 693 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) |
684 | jal do_work_pending | 694 | bnez r33, 1f |
685 | } | 695 | } |
686 | bnez r0, .Lresume_userspace | 696 | push_extra_callee_saves r0 |
697 | movei r33, 1 | ||
698 | 1: jal do_work_pending | ||
699 | bnez r0, .Lretry_work_pending | ||
687 | 700 | ||
688 | /* | 701 | /* |
689 | * In the NMI case we | 702 | * In the NMI case we |
@@ -968,11 +981,16 @@ handle_syscall: | |||
968 | shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET) | 981 | shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET) |
969 | add r20, r20, tp | 982 | add r20, r20, tp |
970 | ld4s r21, r20 | 983 | ld4s r21, r20 |
971 | addi r21, r21, 1 | 984 | { |
972 | st4 r20, r21 | 985 | addi r21, r21, 1 |
986 | move r31, sp | ||
987 | } | ||
988 | { | ||
989 | st4 r20, r21 | ||
990 | EXTRACT_THREAD_INFO(r31) | ||
991 | } | ||
973 | 992 | ||
974 | /* Trace syscalls, if requested. */ | 993 | /* Trace syscalls, if requested. */ |
975 | GET_THREAD_INFO(r31) | ||
976 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET | 994 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET |
977 | ld r30, r31 | 995 | ld r30, r31 |
978 | andi r30, r30, _TIF_SYSCALL_TRACE | 996 | andi r30, r30, _TIF_SYSCALL_TRACE |
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 2d5ef617bb39..54e6c64b85cc 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -567,6 +567,10 @@ struct task_struct *__sched _switch_to(struct task_struct *prev, | |||
567 | */ | 567 | */ |
568 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) | 568 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) |
569 | { | 569 | { |
570 | /* If we enter in kernel mode, do nothing and exit the caller loop. */ | ||
571 | if (!user_mode(regs)) | ||
572 | return 0; | ||
573 | |||
570 | if (thread_info_flags & _TIF_NEED_RESCHED) { | 574 | if (thread_info_flags & _TIF_NEED_RESCHED) { |
571 | schedule(); | 575 | schedule(); |
572 | return 1; | 576 | return 1; |
@@ -589,8 +593,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) | |||
589 | return 1; | 593 | return 1; |
590 | } | 594 | } |
591 | if (thread_info_flags & _TIF_SINGLESTEP) { | 595 | if (thread_info_flags & _TIF_SINGLESTEP) { |
592 | if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0) | 596 | single_step_once(regs); |
593 | single_step_once(regs); | ||
594 | return 0; | 597 | return 0; |
595 | } | 598 | } |
596 | panic("work_pending: bad flags %#x\n", thread_info_flags); | 599 | panic("work_pending: bad flags %#x\n", thread_info_flags); |
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 734c3767cfac..183922e13de1 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h | |||
@@ -170,6 +170,9 @@ static inline int kvm_para_available(void) | |||
170 | unsigned int eax, ebx, ecx, edx; | 170 | unsigned int eax, ebx, ecx, edx; |
171 | char signature[13]; | 171 | char signature[13]; |
172 | 172 | ||
173 | if (boot_cpu_data.cpuid_level < 0) | ||
174 | return 0; /* So we don't blow up on old processors */ | ||
175 | |||
173 | cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); | 176 | cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); |
174 | memcpy(signature + 0, &ebx, 4); | 177 | memcpy(signature + 0, &ebx, 4); |
175 | memcpy(signature + 4, &ecx, 4); | 178 | memcpy(signature + 4, &ecx, 4); |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index a415b1f44365..7c439fe4941b 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -593,7 +593,7 @@ void __init acpi_set_irq_model_ioapic(void) | |||
593 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 593 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
594 | #include <acpi/processor.h> | 594 | #include <acpi/processor.h> |
595 | 595 | ||
596 | static void __cpuinitdata acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | 596 | static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) |
597 | { | 597 | { |
598 | #ifdef CONFIG_ACPI_NUMA | 598 | #ifdef CONFIG_ACPI_NUMA |
599 | int nid; | 599 | int nid; |
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c index 3ca42d0e43a2..0327e2b3c408 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c | |||
@@ -147,12 +147,6 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) | |||
147 | 147 | ||
148 | memset(csig, 0, sizeof(*csig)); | 148 | memset(csig, 0, sizeof(*csig)); |
149 | 149 | ||
150 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | ||
151 | cpu_has(c, X86_FEATURE_IA64)) { | ||
152 | pr_err("CPU%d not a capable Intel processor\n", cpu_num); | ||
153 | return -1; | ||
154 | } | ||
155 | |||
156 | csig->sig = cpuid_eax(0x00000001); | 150 | csig->sig = cpuid_eax(0x00000001); |
157 | 151 | ||
158 | if ((c->x86_model >= 5) || (c->x86 > 6)) { | 152 | if ((c->x86_model >= 5) || (c->x86 > 6)) { |
@@ -463,6 +457,14 @@ static struct microcode_ops microcode_intel_ops = { | |||
463 | 457 | ||
464 | struct microcode_ops * __init init_intel_microcode(void) | 458 | struct microcode_ops * __init init_intel_microcode(void) |
465 | { | 459 | { |
460 | struct cpuinfo_x86 *c = &cpu_data(0); | ||
461 | |||
462 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | ||
463 | cpu_has(c, X86_FEATURE_IA64)) { | ||
464 | pr_err("Intel CPU family 0x%x not supported\n", c->x86); | ||
465 | return NULL; | ||
466 | } | ||
467 | |||
466 | return µcode_intel_ops; | 468 | return µcode_intel_ops; |
467 | } | 469 | } |
468 | 470 | ||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 3263b68cdfa3..3188da3df8da 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -250,6 +250,10 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) | |||
250 | return -ENODEV; | 250 | return -ENODEV; |
251 | } | 251 | } |
252 | 252 | ||
253 | /* For D3cold we should execute _PS3, not _PS4. */ | ||
254 | if (state == ACPI_STATE_D3_COLD) | ||
255 | object_name[3] = '3'; | ||
256 | |||
253 | /* | 257 | /* |
254 | * Transition Power | 258 | * Transition Power |
255 | * ---------------- | 259 | * ---------------- |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 330bb4d75852..0500f719f63e 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -660,7 +660,7 @@ int acpi_power_on_resources(struct acpi_device *device, int state) | |||
660 | 660 | ||
661 | int acpi_power_transition(struct acpi_device *device, int state) | 661 | int acpi_power_transition(struct acpi_device *device, int state) |
662 | { | 662 | { |
663 | int result; | 663 | int result = 0; |
664 | 664 | ||
665 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) | 665 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) |
666 | return -EINVAL; | 666 | return -EINVAL; |
@@ -679,8 +679,11 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
679 | * (e.g. so the device doesn't lose power while transitioning). Then, | 679 | * (e.g. so the device doesn't lose power while transitioning). Then, |
680 | * we dereference all power resources used in the current list. | 680 | * we dereference all power resources used in the current list. |
681 | */ | 681 | */ |
682 | result = acpi_power_on_list(&device->power.states[state].resources); | 682 | if (state < ACPI_STATE_D3_COLD) |
683 | if (!result) | 683 | result = acpi_power_on_list( |
684 | &device->power.states[state].resources); | ||
685 | |||
686 | if (!result && device->power.state < ACPI_STATE_D3_COLD) | ||
684 | acpi_power_off_list( | 687 | acpi_power_off_list( |
685 | &device->power.states[device->power.state].resources); | 688 | &device->power.states[device->power.state].resources); |
686 | 689 | ||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7417267e88fa..85cbfdccc97c 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -908,6 +908,10 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) | |||
908 | device->power.states[ACPI_STATE_D3].flags.valid = 1; | 908 | device->power.states[ACPI_STATE_D3].flags.valid = 1; |
909 | device->power.states[ACPI_STATE_D3].power = 0; | 909 | device->power.states[ACPI_STATE_D3].power = 0; |
910 | 910 | ||
911 | /* Set D3cold's explicit_set flag if _PS3 exists. */ | ||
912 | if (device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set) | ||
913 | device->power.states[ACPI_STATE_D3_COLD].flags.explicit_set = 1; | ||
914 | |||
911 | acpi_bus_init_power(device); | 915 | acpi_bus_init_power(device); |
912 | 916 | ||
913 | return 0; | 917 | return 0; |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index abfaacaaf346..946166e13953 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -2297,7 +2297,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms | |||
2297 | return; | 2297 | return; |
2298 | } | 2298 | } |
2299 | 2299 | ||
2300 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { | 2300 | if (!capable(CAP_SYS_ADMIN)) { |
2301 | retcode = ERR_PERM; | 2301 | retcode = ERR_PERM; |
2302 | goto fail; | 2302 | goto fail; |
2303 | } | 2303 | } |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ddf86b6500b7..cdf2f5451c76 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev) | |||
1895 | 1895 | ||
1896 | /* Get port open/close status on the host */ | 1896 | /* Get port open/close status on the host */ |
1897 | send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); | 1897 | send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); |
1898 | |||
1899 | /* | ||
1900 | * If a port was open at the time of suspending, we | ||
1901 | * have to let the host know that it's still open. | ||
1902 | */ | ||
1903 | if (port->guest_connected) | ||
1904 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); | ||
1898 | } | 1905 | } |
1899 | return 0; | 1906 | return 0; |
1900 | } | 1907 | } |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index ab9abb46d01a..dd414d9350ef 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -164,6 +164,7 @@ config CRYPTO_DEV_MV_CESA | |||
164 | select CRYPTO_ALGAPI | 164 | select CRYPTO_ALGAPI |
165 | select CRYPTO_AES | 165 | select CRYPTO_AES |
166 | select CRYPTO_BLKCIPHER2 | 166 | select CRYPTO_BLKCIPHER2 |
167 | select CRYPTO_HASH | ||
167 | help | 168 | help |
168 | This driver allows you to utilize the Cryptographic Engines and | 169 | This driver allows you to utilize the Cryptographic Engines and |
169 | Security Accelerator (CESA) which can be found on the Marvell Orion | 170 | Security Accelerator (CESA) which can be found on the Marvell Orion |
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 445fdf811695..bf0d7e4e345b 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -245,7 +245,9 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) | |||
245 | dev_vdbg(chan2dev(&atchan->chan_common), | 245 | dev_vdbg(chan2dev(&atchan->chan_common), |
246 | "descriptor %u complete\n", txd->cookie); | 246 | "descriptor %u complete\n", txd->cookie); |
247 | 247 | ||
248 | dma_cookie_complete(txd); | 248 | /* mark the descriptor as complete for non cyclic cases only */ |
249 | if (!atc_chan_is_cyclic(atchan)) | ||
250 | dma_cookie_complete(txd); | ||
249 | 251 | ||
250 | /* move children to free_list */ | 252 | /* move children to free_list */ |
251 | list_splice_init(&desc->tx_list, &atchan->free_list); | 253 | list_splice_init(&desc->tx_list, &atchan->free_list); |
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index e6f133b78dc2..f6e9b572b998 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c | |||
@@ -703,7 +703,9 @@ static void ep93xx_dma_tasklet(unsigned long data) | |||
703 | desc = ep93xx_dma_get_active(edmac); | 703 | desc = ep93xx_dma_get_active(edmac); |
704 | if (desc) { | 704 | if (desc) { |
705 | if (desc->complete) { | 705 | if (desc->complete) { |
706 | dma_cookie_complete(&desc->txd); | 706 | /* mark descriptor complete for non cyclic case only */ |
707 | if (!test_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags)) | ||
708 | dma_cookie_complete(&desc->txd); | ||
707 | list_splice_init(&edmac->active, &list); | 709 | list_splice_init(&edmac->active, &list); |
708 | } | 710 | } |
709 | callback = desc->txd.callback; | 711 | callback = desc->txd.callback; |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 2ee6e23930ad..fa3fb21e60be 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -2322,7 +2322,8 @@ static void pl330_tasklet(unsigned long data) | |||
2322 | /* Pick up ripe tomatoes */ | 2322 | /* Pick up ripe tomatoes */ |
2323 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) | 2323 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) |
2324 | if (desc->status == DONE) { | 2324 | if (desc->status == DONE) { |
2325 | dma_cookie_complete(&desc->txd); | 2325 | if (pch->cyclic) |
2326 | dma_cookie_complete(&desc->txd); | ||
2326 | list_move_tail(&desc->node, &list); | 2327 | list_move_tail(&desc->node, &list); |
2327 | } | 2328 | } |
2328 | 2329 | ||
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 1adc2ec1e383..4461540653a8 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -965,18 +965,15 @@ static void omap_gpio_mod_init(struct gpio_bank *bank) | |||
965 | } | 965 | } |
966 | 966 | ||
967 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); | 967 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); |
968 | _gpio_rmw(base, bank->regs->irqstatus, l, | 968 | _gpio_rmw(base, bank->regs->irqstatus, l, !bank->regs->irqenable_inv); |
969 | bank->regs->irqenable_inv == false); | ||
970 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->debounce_en != 0); | ||
971 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->ctrl != 0); | ||
972 | if (bank->regs->debounce_en) | 969 | if (bank->regs->debounce_en) |
973 | _gpio_rmw(base, bank->regs->debounce_en, 0, 1); | 970 | __raw_writel(0, base + bank->regs->debounce_en); |
974 | 971 | ||
975 | /* Save OE default value (0xffffffff) in the context */ | 972 | /* Save OE default value (0xffffffff) in the context */ |
976 | bank->context.oe = __raw_readl(bank->base + bank->regs->direction); | 973 | bank->context.oe = __raw_readl(bank->base + bank->regs->direction); |
977 | /* Initialize interface clk ungated, module enabled */ | 974 | /* Initialize interface clk ungated, module enabled */ |
978 | if (bank->regs->ctrl) | 975 | if (bank->regs->ctrl) |
979 | _gpio_rmw(base, bank->regs->ctrl, 0, 1); | 976 | __raw_writel(0, base + bank->regs->ctrl); |
980 | } | 977 | } |
981 | 978 | ||
982 | static __devinit void | 979 | static __devinit void |
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index e8729cc2ba2b..2cd958e0b822 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c | |||
@@ -230,16 +230,12 @@ static void pch_gpio_setup(struct pch_gpio *chip) | |||
230 | 230 | ||
231 | static int pch_irq_type(struct irq_data *d, unsigned int type) | 231 | static int pch_irq_type(struct irq_data *d, unsigned int type) |
232 | { | 232 | { |
233 | u32 im; | ||
234 | u32 __iomem *im_reg; | ||
235 | u32 ien; | ||
236 | u32 im_pos; | ||
237 | int ch; | ||
238 | unsigned long flags; | ||
239 | u32 val; | ||
240 | int irq = d->irq; | ||
241 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 233 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
242 | struct pch_gpio *chip = gc->private; | 234 | struct pch_gpio *chip = gc->private; |
235 | u32 im, im_pos, val; | ||
236 | u32 __iomem *im_reg; | ||
237 | unsigned long flags; | ||
238 | int ch, irq = d->irq; | ||
243 | 239 | ||
244 | ch = irq - chip->irq_base; | 240 | ch = irq - chip->irq_base; |
245 | if (irq <= chip->irq_base + 7) { | 241 | if (irq <= chip->irq_base + 7) { |
@@ -270,30 +266,22 @@ static int pch_irq_type(struct irq_data *d, unsigned int type) | |||
270 | case IRQ_TYPE_LEVEL_LOW: | 266 | case IRQ_TYPE_LEVEL_LOW: |
271 | val = PCH_LEVEL_L; | 267 | val = PCH_LEVEL_L; |
272 | break; | 268 | break; |
273 | case IRQ_TYPE_PROBE: | ||
274 | goto end; | ||
275 | default: | 269 | default: |
276 | dev_warn(chip->dev, "%s: unknown type(%dd)", | 270 | goto unlock; |
277 | __func__, type); | ||
278 | goto end; | ||
279 | } | 271 | } |
280 | 272 | ||
281 | /* Set interrupt mode */ | 273 | /* Set interrupt mode */ |
282 | im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); | 274 | im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); |
283 | iowrite32(im | (val << (im_pos * 4)), im_reg); | 275 | iowrite32(im | (val << (im_pos * 4)), im_reg); |
284 | 276 | ||
285 | /* iclr */ | 277 | /* And the handler */ |
286 | iowrite32(BIT(ch), &chip->reg->iclr); | 278 | if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) |
279 | __irq_set_handler_locked(d->irq, handle_level_irq); | ||
280 | else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) | ||
281 | __irq_set_handler_locked(d->irq, handle_edge_irq); | ||
287 | 282 | ||
288 | /* IMASKCLR */ | 283 | unlock: |
289 | iowrite32(BIT(ch), &chip->reg->imaskclr); | ||
290 | |||
291 | /* Enable interrupt */ | ||
292 | ien = ioread32(&chip->reg->ien); | ||
293 | iowrite32(ien | BIT(ch), &chip->reg->ien); | ||
294 | end: | ||
295 | spin_unlock_irqrestore(&chip->spinlock, flags); | 284 | spin_unlock_irqrestore(&chip->spinlock, flags); |
296 | |||
297 | return 0; | 285 | return 0; |
298 | } | 286 | } |
299 | 287 | ||
@@ -313,18 +301,24 @@ static void pch_irq_mask(struct irq_data *d) | |||
313 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); | 301 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); |
314 | } | 302 | } |
315 | 303 | ||
304 | static void pch_irq_ack(struct irq_data *d) | ||
305 | { | ||
306 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
307 | struct pch_gpio *chip = gc->private; | ||
308 | |||
309 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->iclr); | ||
310 | } | ||
311 | |||
316 | static irqreturn_t pch_gpio_handler(int irq, void *dev_id) | 312 | static irqreturn_t pch_gpio_handler(int irq, void *dev_id) |
317 | { | 313 | { |
318 | struct pch_gpio *chip = dev_id; | 314 | struct pch_gpio *chip = dev_id; |
319 | u32 reg_val = ioread32(&chip->reg->istatus); | 315 | u32 reg_val = ioread32(&chip->reg->istatus); |
320 | int i; | 316 | int i, ret = IRQ_NONE; |
321 | int ret = IRQ_NONE; | ||
322 | 317 | ||
323 | for (i = 0; i < gpio_pins[chip->ioh]; i++) { | 318 | for (i = 0; i < gpio_pins[chip->ioh]; i++) { |
324 | if (reg_val & BIT(i)) { | 319 | if (reg_val & BIT(i)) { |
325 | dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", | 320 | dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", |
326 | __func__, i, irq, reg_val); | 321 | __func__, i, irq, reg_val); |
327 | iowrite32(BIT(i), &chip->reg->iclr); | ||
328 | generic_handle_irq(chip->irq_base + i); | 322 | generic_handle_irq(chip->irq_base + i); |
329 | ret = IRQ_HANDLED; | 323 | ret = IRQ_HANDLED; |
330 | } | 324 | } |
@@ -343,6 +337,7 @@ static __devinit void pch_gpio_alloc_generic_chip(struct pch_gpio *chip, | |||
343 | gc->private = chip; | 337 | gc->private = chip; |
344 | ct = gc->chip_types; | 338 | ct = gc->chip_types; |
345 | 339 | ||
340 | ct->chip.irq_ack = pch_irq_ack; | ||
346 | ct->chip.irq_mask = pch_irq_mask; | 341 | ct->chip.irq_mask = pch_irq_mask; |
347 | ct->chip.irq_unmask = pch_irq_unmask; | 342 | ct->chip.irq_unmask = pch_irq_unmask; |
348 | ct->chip.irq_set_type = pch_irq_type; | 343 | ct->chip.irq_set_type = pch_irq_type; |
@@ -357,6 +352,7 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
357 | s32 ret; | 352 | s32 ret; |
358 | struct pch_gpio *chip; | 353 | struct pch_gpio *chip; |
359 | int irq_base; | 354 | int irq_base; |
355 | u32 msk; | ||
360 | 356 | ||
361 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | 357 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
362 | if (chip == NULL) | 358 | if (chip == NULL) |
@@ -408,8 +404,13 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
408 | } | 404 | } |
409 | chip->irq_base = irq_base; | 405 | chip->irq_base = irq_base; |
410 | 406 | ||
407 | /* Mask all interrupts, but enable them */ | ||
408 | msk = (1 << gpio_pins[chip->ioh]) - 1; | ||
409 | iowrite32(msk, &chip->reg->imask); | ||
410 | iowrite32(msk, &chip->reg->ien); | ||
411 | |||
411 | ret = request_irq(pdev->irq, pch_gpio_handler, | 412 | ret = request_irq(pdev->irq, pch_gpio_handler, |
412 | IRQF_SHARED, KBUILD_MODNAME, chip); | 413 | IRQF_SHARED, KBUILD_MODNAME, chip); |
413 | if (ret != 0) { | 414 | if (ret != 0) { |
414 | dev_err(&pdev->dev, | 415 | dev_err(&pdev->dev, |
415 | "%s request_irq failed\n", __func__); | 416 | "%s request_irq failed\n", __func__); |
@@ -418,8 +419,6 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
418 | 419 | ||
419 | pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); | 420 | pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); |
420 | 421 | ||
421 | /* Initialize interrupt ien register */ | ||
422 | iowrite32(0, &chip->reg->ien); | ||
423 | end: | 422 | end: |
424 | return 0; | 423 | return 0; |
425 | 424 | ||
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 19d6fc0229c3..e991d9171961 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -452,12 +452,14 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = { | |||
452 | }; | 452 | }; |
453 | #endif | 453 | #endif |
454 | 454 | ||
455 | #if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5) | ||
455 | static struct samsung_gpio_cfg exynos_gpio_cfg = { | 456 | static struct samsung_gpio_cfg exynos_gpio_cfg = { |
456 | .set_pull = exynos_gpio_setpull, | 457 | .set_pull = exynos_gpio_setpull, |
457 | .get_pull = exynos_gpio_getpull, | 458 | .get_pull = exynos_gpio_getpull, |
458 | .set_config = samsung_gpio_setcfg_4bit, | 459 | .set_config = samsung_gpio_setcfg_4bit, |
459 | .get_config = samsung_gpio_getcfg_4bit, | 460 | .get_config = samsung_gpio_getcfg_4bit, |
460 | }; | 461 | }; |
462 | #endif | ||
461 | 463 | ||
462 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) | 464 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) |
463 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { | 465 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { |
@@ -2123,8 +2125,8 @@ static struct samsung_gpio_chip s5pv210_gpios_4bit[] = { | |||
2123 | * uses the above macro and depends on the banks being listed in order here. | 2125 | * uses the above macro and depends on the banks being listed in order here. |
2124 | */ | 2126 | */ |
2125 | 2127 | ||
2126 | static struct samsung_gpio_chip exynos4_gpios_1[] = { | ||
2127 | #ifdef CONFIG_ARCH_EXYNOS4 | 2128 | #ifdef CONFIG_ARCH_EXYNOS4 |
2129 | static struct samsung_gpio_chip exynos4_gpios_1[] = { | ||
2128 | { | 2130 | { |
2129 | .chip = { | 2131 | .chip = { |
2130 | .base = EXYNOS4_GPA0(0), | 2132 | .base = EXYNOS4_GPA0(0), |
@@ -2222,11 +2224,11 @@ static struct samsung_gpio_chip exynos4_gpios_1[] = { | |||
2222 | .label = "GPF3", | 2224 | .label = "GPF3", |
2223 | }, | 2225 | }, |
2224 | }, | 2226 | }, |
2225 | #endif | ||
2226 | }; | 2227 | }; |
2228 | #endif | ||
2227 | 2229 | ||
2228 | static struct samsung_gpio_chip exynos4_gpios_2[] = { | ||
2229 | #ifdef CONFIG_ARCH_EXYNOS4 | 2230 | #ifdef CONFIG_ARCH_EXYNOS4 |
2231 | static struct samsung_gpio_chip exynos4_gpios_2[] = { | ||
2230 | { | 2232 | { |
2231 | .chip = { | 2233 | .chip = { |
2232 | .base = EXYNOS4_GPJ0(0), | 2234 | .base = EXYNOS4_GPJ0(0), |
@@ -2367,11 +2369,11 @@ static struct samsung_gpio_chip exynos4_gpios_2[] = { | |||
2367 | .to_irq = samsung_gpiolib_to_irq, | 2369 | .to_irq = samsung_gpiolib_to_irq, |
2368 | }, | 2370 | }, |
2369 | }, | 2371 | }, |
2370 | #endif | ||
2371 | }; | 2372 | }; |
2373 | #endif | ||
2372 | 2374 | ||
2373 | static struct samsung_gpio_chip exynos4_gpios_3[] = { | ||
2374 | #ifdef CONFIG_ARCH_EXYNOS4 | 2375 | #ifdef CONFIG_ARCH_EXYNOS4 |
2376 | static struct samsung_gpio_chip exynos4_gpios_3[] = { | ||
2375 | { | 2377 | { |
2376 | .chip = { | 2378 | .chip = { |
2377 | .base = EXYNOS4_GPZ(0), | 2379 | .base = EXYNOS4_GPZ(0), |
@@ -2379,8 +2381,8 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = { | |||
2379 | .label = "GPZ", | 2381 | .label = "GPZ", |
2380 | }, | 2382 | }, |
2381 | }, | 2383 | }, |
2382 | #endif | ||
2383 | }; | 2384 | }; |
2385 | #endif | ||
2384 | 2386 | ||
2385 | #ifdef CONFIG_ARCH_EXYNOS5 | 2387 | #ifdef CONFIG_ARCH_EXYNOS5 |
2386 | static struct samsung_gpio_chip exynos5_gpios_1[] = { | 2388 | static struct samsung_gpio_chip exynos5_gpios_1[] = { |
@@ -2719,7 +2721,9 @@ static __init int samsung_gpiolib_init(void) | |||
2719 | { | 2721 | { |
2720 | struct samsung_gpio_chip *chip; | 2722 | struct samsung_gpio_chip *chip; |
2721 | int i, nr_chips; | 2723 | int i, nr_chips; |
2724 | #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) | ||
2722 | void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; | 2725 | void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; |
2726 | #endif | ||
2723 | int group = 0; | 2727 | int group = 0; |
2724 | 2728 | ||
2725 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); | 2729 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); |
@@ -2971,6 +2975,7 @@ static __init int samsung_gpiolib_init(void) | |||
2971 | 2975 | ||
2972 | return 0; | 2976 | return 0; |
2973 | 2977 | ||
2978 | #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) | ||
2974 | err_ioremap4: | 2979 | err_ioremap4: |
2975 | iounmap(gpio_base3); | 2980 | iounmap(gpio_base3); |
2976 | err_ioremap3: | 2981 | err_ioremap3: |
@@ -2979,6 +2984,7 @@ err_ioremap2: | |||
2979 | iounmap(gpio_base1); | 2984 | iounmap(gpio_base1); |
2980 | err_ioremap1: | 2985 | err_ioremap1: |
2981 | return -ENOMEM; | 2986 | return -ENOMEM; |
2987 | #endif | ||
2982 | } | 2988 | } |
2983 | core_initcall(samsung_gpiolib_init); | 2989 | core_initcall(samsung_gpiolib_init); |
2984 | 2990 | ||
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c index d8433f2d53bc..73973fdbd8be 100644 --- a/drivers/leds/leds-netxbig.c +++ b/drivers/leds/leds-netxbig.c | |||
@@ -112,7 +112,7 @@ err_free_addr: | |||
112 | return err; | 112 | return err; |
113 | } | 113 | } |
114 | 114 | ||
115 | static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) | 115 | static void gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) |
116 | { | 116 | { |
117 | int i; | 117 | int i; |
118 | 118 | ||
@@ -294,7 +294,7 @@ static ssize_t netxbig_led_sata_show(struct device *dev, | |||
294 | 294 | ||
295 | static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); | 295 | static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); |
296 | 296 | ||
297 | static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) | 297 | static void delete_netxbig_led(struct netxbig_led_data *led_dat) |
298 | { | 298 | { |
299 | if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) | 299 | if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) |
300 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); | 300 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); |
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 2f0a14421a73..01cf89ec6944 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c | |||
@@ -255,7 +255,7 @@ err_free_cmd: | |||
255 | return ret; | 255 | return ret; |
256 | } | 256 | } |
257 | 257 | ||
258 | static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) | 258 | static void delete_ns2_led(struct ns2_led_data *led_dat) |
259 | { | 259 | { |
260 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); | 260 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); |
261 | led_classdev_unregister(&led_dat->cdev); | 261 | led_classdev_unregister(&led_dat->cdev); |
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 1f23e048f077..08d9a207259a 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c | |||
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) | |||
134 | { | 134 | { |
135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); | 135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); |
136 | 136 | ||
137 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) | 137 | if (!capable(CAP_SYS_ADMIN)) |
138 | return; | 138 | return; |
139 | 139 | ||
140 | spin_lock(&receiving_list_lock); | 140 | spin_lock(&receiving_list_lock); |
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 922a3385eead..754f38f8a692 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m) | |||
718 | return 0; | 718 | return 0; |
719 | 719 | ||
720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); | 720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); |
721 | request_module("scsi_dh_%s", m->hw_handler_name); | 721 | if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), |
722 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { | 722 | "scsi_dh_%s", m->hw_handler_name)) { |
723 | ti->error = "unknown hardware handler type"; | 723 | ti->error = "unknown hardware handler type"; |
724 | ret = -EINVAL; | 724 | ret = -EINVAL; |
725 | goto fail; | 725 | goto fail; |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 213ae32a0fc4..2fd87b544a93 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -279,8 +279,10 @@ static void __cell_release(struct cell *cell, struct bio_list *inmates) | |||
279 | 279 | ||
280 | hlist_del(&cell->list); | 280 | hlist_del(&cell->list); |
281 | 281 | ||
282 | bio_list_add(inmates, cell->holder); | 282 | if (inmates) { |
283 | bio_list_merge(inmates, &cell->bios); | 283 | bio_list_add(inmates, cell->holder); |
284 | bio_list_merge(inmates, &cell->bios); | ||
285 | } | ||
284 | 286 | ||
285 | mempool_free(cell, prison->cell_pool); | 287 | mempool_free(cell, prison->cell_pool); |
286 | } | 288 | } |
@@ -303,9 +305,10 @@ static void cell_release(struct cell *cell, struct bio_list *bios) | |||
303 | */ | 305 | */ |
304 | static void __cell_release_singleton(struct cell *cell, struct bio *bio) | 306 | static void __cell_release_singleton(struct cell *cell, struct bio *bio) |
305 | { | 307 | { |
306 | hlist_del(&cell->list); | ||
307 | BUG_ON(cell->holder != bio); | 308 | BUG_ON(cell->holder != bio); |
308 | BUG_ON(!bio_list_empty(&cell->bios)); | 309 | BUG_ON(!bio_list_empty(&cell->bios)); |
310 | |||
311 | __cell_release(cell, NULL); | ||
309 | } | 312 | } |
310 | 313 | ||
311 | static void cell_release_singleton(struct cell *cell, struct bio *bio) | 314 | static void cell_release_singleton(struct cell *cell, struct bio *bio) |
@@ -1177,6 +1180,7 @@ static void no_space(struct cell *cell) | |||
1177 | static void process_discard(struct thin_c *tc, struct bio *bio) | 1180 | static void process_discard(struct thin_c *tc, struct bio *bio) |
1178 | { | 1181 | { |
1179 | int r; | 1182 | int r; |
1183 | unsigned long flags; | ||
1180 | struct pool *pool = tc->pool; | 1184 | struct pool *pool = tc->pool; |
1181 | struct cell *cell, *cell2; | 1185 | struct cell *cell, *cell2; |
1182 | struct cell_key key, key2; | 1186 | struct cell_key key, key2; |
@@ -1218,7 +1222,9 @@ static void process_discard(struct thin_c *tc, struct bio *bio) | |||
1218 | m->bio = bio; | 1222 | m->bio = bio; |
1219 | 1223 | ||
1220 | if (!ds_add_work(&pool->all_io_ds, &m->list)) { | 1224 | if (!ds_add_work(&pool->all_io_ds, &m->list)) { |
1225 | spin_lock_irqsave(&pool->lock, flags); | ||
1221 | list_add(&m->list, &pool->prepared_discards); | 1226 | list_add(&m->list, &pool->prepared_discards); |
1227 | spin_unlock_irqrestore(&pool->lock, flags); | ||
1222 | wake_worker(pool); | 1228 | wake_worker(pool); |
1223 | } | 1229 | } |
1224 | } else { | 1230 | } else { |
@@ -2626,8 +2632,10 @@ static int thin_endio(struct dm_target *ti, | |||
2626 | if (h->all_io_entry) { | 2632 | if (h->all_io_entry) { |
2627 | INIT_LIST_HEAD(&work); | 2633 | INIT_LIST_HEAD(&work); |
2628 | ds_dec(h->all_io_entry, &work); | 2634 | ds_dec(h->all_io_entry, &work); |
2635 | spin_lock_irqsave(&pool->lock, flags); | ||
2629 | list_for_each_entry_safe(m, tmp, &work, list) | 2636 | list_for_each_entry_safe(m, tmp, &work, list) |
2630 | list_add(&m->list, &pool->prepared_discards); | 2637 | list_add(&m->list, &pool->prepared_discards); |
2638 | spin_unlock_irqrestore(&pool->lock, flags); | ||
2631 | } | 2639 | } |
2632 | 2640 | ||
2633 | mempool_free(h, pool->endio_hook_pool); | 2641 | mempool_free(h, pool->endio_hook_pool); |
@@ -2759,6 +2767,6 @@ static void dm_thin_exit(void) | |||
2759 | module_init(dm_thin_init); | 2767 | module_init(dm_thin_init); |
2760 | module_exit(dm_thin_exit); | 2768 | module_exit(dm_thin_exit); |
2761 | 2769 | ||
2762 | MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); | 2770 | MODULE_DESCRIPTION(DM_NAME " thin provisioning target"); |
2763 | MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); | 2771 | MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); |
2764 | MODULE_LICENSE("GPL"); | 2772 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 477eb2e180c0..01233d855eb2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev) | |||
391 | synchronize_rcu(); | 391 | synchronize_rcu(); |
392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); | 392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); |
393 | mddev->pers->quiesce(mddev, 1); | 393 | mddev->pers->quiesce(mddev, 1); |
394 | |||
395 | del_timer_sync(&mddev->safemode_timer); | ||
394 | } | 396 | } |
395 | EXPORT_SYMBOL_GPL(mddev_suspend); | 397 | EXPORT_SYMBOL_GPL(mddev_suspend); |
396 | 398 | ||
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index c8dbb84d5357..3e7b1548111a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -3164,12 +3164,40 @@ raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks) | |||
3164 | return size << conf->chunk_shift; | 3164 | return size << conf->chunk_shift; |
3165 | } | 3165 | } |
3166 | 3166 | ||
3167 | static void calc_sectors(struct r10conf *conf, sector_t size) | ||
3168 | { | ||
3169 | /* Calculate the number of sectors-per-device that will | ||
3170 | * actually be used, and set conf->dev_sectors and | ||
3171 | * conf->stride | ||
3172 | */ | ||
3173 | |||
3174 | size = size >> conf->chunk_shift; | ||
3175 | sector_div(size, conf->far_copies); | ||
3176 | size = size * conf->raid_disks; | ||
3177 | sector_div(size, conf->near_copies); | ||
3178 | /* 'size' is now the number of chunks in the array */ | ||
3179 | /* calculate "used chunks per device" */ | ||
3180 | size = size * conf->copies; | ||
3181 | |||
3182 | /* We need to round up when dividing by raid_disks to | ||
3183 | * get the stride size. | ||
3184 | */ | ||
3185 | size = DIV_ROUND_UP_SECTOR_T(size, conf->raid_disks); | ||
3186 | |||
3187 | conf->dev_sectors = size << conf->chunk_shift; | ||
3188 | |||
3189 | if (conf->far_offset) | ||
3190 | conf->stride = 1 << conf->chunk_shift; | ||
3191 | else { | ||
3192 | sector_div(size, conf->near_copies); | ||
3193 | conf->stride = size << conf->chunk_shift; | ||
3194 | } | ||
3195 | } | ||
3167 | 3196 | ||
3168 | static struct r10conf *setup_conf(struct mddev *mddev) | 3197 | static struct r10conf *setup_conf(struct mddev *mddev) |
3169 | { | 3198 | { |
3170 | struct r10conf *conf = NULL; | 3199 | struct r10conf *conf = NULL; |
3171 | int nc, fc, fo; | 3200 | int nc, fc, fo; |
3172 | sector_t stride, size; | ||
3173 | int err = -EINVAL; | 3201 | int err = -EINVAL; |
3174 | 3202 | ||
3175 | if (mddev->new_chunk_sectors < (PAGE_SIZE >> 9) || | 3203 | if (mddev->new_chunk_sectors < (PAGE_SIZE >> 9) || |
@@ -3219,28 +3247,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) | |||
3219 | if (!conf->r10bio_pool) | 3247 | if (!conf->r10bio_pool) |
3220 | goto out; | 3248 | goto out; |
3221 | 3249 | ||
3222 | size = mddev->dev_sectors >> conf->chunk_shift; | 3250 | calc_sectors(conf, mddev->dev_sectors); |
3223 | sector_div(size, fc); | ||
3224 | size = size * conf->raid_disks; | ||
3225 | sector_div(size, nc); | ||
3226 | /* 'size' is now the number of chunks in the array */ | ||
3227 | /* calculate "used chunks per device" in 'stride' */ | ||
3228 | stride = size * conf->copies; | ||
3229 | |||
3230 | /* We need to round up when dividing by raid_disks to | ||
3231 | * get the stride size. | ||
3232 | */ | ||
3233 | stride += conf->raid_disks - 1; | ||
3234 | sector_div(stride, conf->raid_disks); | ||
3235 | |||
3236 | conf->dev_sectors = stride << conf->chunk_shift; | ||
3237 | |||
3238 | if (fo) | ||
3239 | stride = 1; | ||
3240 | else | ||
3241 | sector_div(stride, fc); | ||
3242 | conf->stride = stride << conf->chunk_shift; | ||
3243 | |||
3244 | 3251 | ||
3245 | spin_lock_init(&conf->device_lock); | 3252 | spin_lock_init(&conf->device_lock); |
3246 | INIT_LIST_HEAD(&conf->retry_list); | 3253 | INIT_LIST_HEAD(&conf->retry_list); |
@@ -3468,7 +3475,8 @@ static int raid10_resize(struct mddev *mddev, sector_t sectors) | |||
3468 | mddev->recovery_cp = oldsize; | 3475 | mddev->recovery_cp = oldsize; |
3469 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 3476 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
3470 | } | 3477 | } |
3471 | mddev->dev_sectors = sectors; | 3478 | calc_sectors(conf, sectors); |
3479 | mddev->dev_sectors = conf->dev_sectors; | ||
3472 | mddev->resync_max_sectors = size; | 3480 | mddev->resync_max_sectors = size; |
3473 | return 0; | 3481 | return 0; |
3474 | } | 3482 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 0f64d7182657..cb888d835a89 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -1921,6 +1921,10 @@ static int dtv_set_frontend(struct dvb_frontend *fe) | |||
1921 | } else { | 1921 | } else { |
1922 | /* default values */ | 1922 | /* default values */ |
1923 | switch (c->delivery_system) { | 1923 | switch (c->delivery_system) { |
1924 | case SYS_DVBS: | ||
1925 | case SYS_DVBS2: | ||
1926 | case SYS_ISDBS: | ||
1927 | case SYS_TURBO: | ||
1924 | case SYS_DVBC_ANNEX_A: | 1928 | case SYS_DVBC_ANNEX_A: |
1925 | case SYS_DVBC_ANNEX_C: | 1929 | case SYS_DVBC_ANNEX_C: |
1926 | fepriv->min_delay = HZ / 20; | 1930 | fepriv->min_delay = HZ / 20; |
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 860c112e0fd2..bef5296173c9 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c | |||
@@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
1018 | 1018 | ||
1019 | spin_lock_init(&dev->hw_lock); | 1019 | spin_lock_init(&dev->hw_lock); |
1020 | 1020 | ||
1021 | /* claim the resources */ | ||
1022 | error = -EBUSY; | ||
1023 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
1024 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
1025 | dev->hw_io = -1; | ||
1026 | dev->irq = -1; | ||
1027 | goto error; | ||
1028 | } | ||
1029 | |||
1030 | dev->irq = pnp_irq(pnp_dev, 0); | ||
1031 | if (request_irq(dev->irq, ene_isr, | ||
1032 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
1033 | dev->irq = -1; | ||
1034 | goto error; | ||
1035 | } | ||
1036 | |||
1037 | pnp_set_drvdata(pnp_dev, dev); | 1021 | pnp_set_drvdata(pnp_dev, dev); |
1038 | dev->pnp_dev = pnp_dev; | 1022 | dev->pnp_dev = pnp_dev; |
1039 | 1023 | ||
@@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
1086 | device_set_wakeup_capable(&pnp_dev->dev, true); | 1070 | device_set_wakeup_capable(&pnp_dev->dev, true); |
1087 | device_set_wakeup_enable(&pnp_dev->dev, true); | 1071 | device_set_wakeup_enable(&pnp_dev->dev, true); |
1088 | 1072 | ||
1073 | /* claim the resources */ | ||
1074 | error = -EBUSY; | ||
1075 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
1076 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
1077 | dev->hw_io = -1; | ||
1078 | dev->irq = -1; | ||
1079 | goto error; | ||
1080 | } | ||
1081 | |||
1082 | dev->irq = pnp_irq(pnp_dev, 0); | ||
1083 | if (request_irq(dev->irq, ene_isr, | ||
1084 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
1085 | dev->irq = -1; | ||
1086 | goto error; | ||
1087 | } | ||
1088 | |||
1089 | error = rc_register_device(rdev); | 1089 | error = rc_register_device(rdev); |
1090 | if (error < 0) | 1090 | if (error < 0) |
1091 | goto error; | 1091 | goto error; |
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 392d4be91f8f..4a3a238bcfbc 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c | |||
@@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) | |||
197 | /* | 197 | /* |
198 | * Newer reviews of this chipset uses port 8 instead of 5 | 198 | * Newer reviews of this chipset uses port 8 instead of 5 |
199 | */ | 199 | */ |
200 | if ((chip != 0x0408) || (chip != 0x0804)) | 200 | if ((chip != 0x0408) && (chip != 0x0804)) |
201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; | 201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; |
202 | else | 202 | else |
203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; | 203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; |
@@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
514 | 514 | ||
515 | spin_lock_init(&fintek->fintek_lock); | 515 | spin_lock_init(&fintek->fintek_lock); |
516 | 516 | ||
517 | ret = -EBUSY; | ||
518 | /* now claim resources */ | ||
519 | if (!request_region(fintek->cir_addr, | ||
520 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
521 | goto failure; | ||
522 | |||
523 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
524 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
525 | goto failure; | ||
526 | |||
527 | pnp_set_drvdata(pdev, fintek); | 517 | pnp_set_drvdata(pdev, fintek); |
528 | fintek->pdev = pdev; | 518 | fintek->pdev = pdev; |
529 | 519 | ||
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
558 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ | 548 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ |
559 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); | 549 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); |
560 | 550 | ||
551 | ret = -EBUSY; | ||
552 | /* now claim resources */ | ||
553 | if (!request_region(fintek->cir_addr, | ||
554 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
555 | goto failure; | ||
556 | |||
557 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
558 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
559 | goto failure; | ||
560 | |||
561 | ret = rc_register_device(rdev); | 561 | ret = rc_register_device(rdev); |
562 | if (ret) | 562 | if (ret) |
563 | goto failure; | 563 | goto failure; |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 682009d76cdf..0e49c99abf68 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1515 | /* initialize raw event */ | 1515 | /* initialize raw event */ |
1516 | init_ir_raw_event(&itdev->rawir); | 1516 | init_ir_raw_event(&itdev->rawir); |
1517 | 1517 | ||
1518 | ret = -EBUSY; | ||
1519 | /* now claim resources */ | ||
1520 | if (!request_region(itdev->cir_addr, | ||
1521 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1522 | goto failure; | ||
1523 | |||
1524 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1525 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1526 | goto failure; | ||
1527 | |||
1528 | /* set driver data into the pnp device */ | 1518 | /* set driver data into the pnp device */ |
1529 | pnp_set_drvdata(pdev, itdev); | 1519 | pnp_set_drvdata(pdev, itdev); |
1530 | itdev->pdev = pdev; | 1520 | itdev->pdev = pdev; |
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1600 | rdev->driver_name = ITE_DRIVER_NAME; | 1590 | rdev->driver_name = ITE_DRIVER_NAME; |
1601 | rdev->map_name = RC_MAP_RC6_MCE; | 1591 | rdev->map_name = RC_MAP_RC6_MCE; |
1602 | 1592 | ||
1593 | ret = -EBUSY; | ||
1594 | /* now claim resources */ | ||
1595 | if (!request_region(itdev->cir_addr, | ||
1596 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1597 | goto failure; | ||
1598 | |||
1599 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1600 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1601 | goto failure; | ||
1602 | |||
1603 | ret = rc_register_device(rdev); | 1603 | ret = rc_register_device(rdev); |
1604 | if (ret) | 1604 | if (ret) |
1605 | goto failure; | 1605 | goto failure; |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 144f3f55d765..8b2c071ac0ab 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1021 | spin_lock_init(&nvt->nvt_lock); | 1021 | spin_lock_init(&nvt->nvt_lock); |
1022 | spin_lock_init(&nvt->tx.lock); | 1022 | spin_lock_init(&nvt->tx.lock); |
1023 | 1023 | ||
1024 | ret = -EBUSY; | ||
1025 | /* now claim resources */ | ||
1026 | if (!request_region(nvt->cir_addr, | ||
1027 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1028 | goto failure; | ||
1029 | |||
1030 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
1031 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1032 | goto failure; | ||
1033 | |||
1034 | if (!request_region(nvt->cir_wake_addr, | ||
1035 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1036 | goto failure; | ||
1037 | |||
1038 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
1039 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1040 | goto failure; | ||
1041 | |||
1042 | pnp_set_drvdata(pdev, nvt); | 1024 | pnp_set_drvdata(pdev, nvt); |
1043 | nvt->pdev = pdev; | 1025 | nvt->pdev = pdev; |
1044 | 1026 | ||
@@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1085 | rdev->tx_resolution = XYZ; | 1067 | rdev->tx_resolution = XYZ; |
1086 | #endif | 1068 | #endif |
1087 | 1069 | ||
1070 | ret = -EBUSY; | ||
1071 | /* now claim resources */ | ||
1072 | if (!request_region(nvt->cir_addr, | ||
1073 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1074 | goto failure; | ||
1075 | |||
1076 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
1077 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1078 | goto failure; | ||
1079 | |||
1080 | if (!request_region(nvt->cir_wake_addr, | ||
1081 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1082 | goto failure; | ||
1083 | |||
1084 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
1085 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1086 | goto failure; | ||
1087 | |||
1088 | ret = rc_register_device(rdev); | 1088 | ret = rc_register_device(rdev); |
1089 | if (ret) | 1089 | if (ret) |
1090 | goto failure; | 1090 | goto failure; |
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index af526586fa26..342c2c8c1ddf 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", | 991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", |
992 | data->wbase, data->ebase, data->sbase, data->irq); | 992 | data->wbase, data->ebase, data->sbase, data->irq); |
993 | 993 | ||
994 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
995 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
996 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
997 | err = -EBUSY; | ||
998 | goto exit_free_data; | ||
999 | } | ||
1000 | |||
1001 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
1002 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1003 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
1004 | err = -EBUSY; | ||
1005 | goto exit_release_wbase; | ||
1006 | } | ||
1007 | |||
1008 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
1009 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1010 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
1011 | err = -EBUSY; | ||
1012 | goto exit_release_ebase; | ||
1013 | } | ||
1014 | |||
1015 | err = request_irq(data->irq, wbcir_irq_handler, | ||
1016 | IRQF_DISABLED, DRVNAME, device); | ||
1017 | if (err) { | ||
1018 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
1019 | err = -EBUSY; | ||
1020 | goto exit_release_sbase; | ||
1021 | } | ||
1022 | |||
1023 | led_trigger_register_simple("cir-tx", &data->txtrigger); | 994 | led_trigger_register_simple("cir-tx", &data->txtrigger); |
1024 | if (!data->txtrigger) { | 995 | if (!data->txtrigger) { |
1025 | err = -ENOMEM; | 996 | err = -ENOMEM; |
1026 | goto exit_free_irq; | 997 | goto exit_free_data; |
1027 | } | 998 | } |
1028 | 999 | ||
1029 | led_trigger_register_simple("cir-rx", &data->rxtrigger); | 1000 | led_trigger_register_simple("cir-rx", &data->rxtrigger); |
@@ -1062,9 +1033,38 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1062 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
1063 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
1064 | 1035 | ||
1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1038 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
1039 | err = -EBUSY; | ||
1040 | goto exit_free_rc; | ||
1041 | } | ||
1042 | |||
1043 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
1044 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1045 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
1046 | err = -EBUSY; | ||
1047 | goto exit_release_wbase; | ||
1048 | } | ||
1049 | |||
1050 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
1051 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1052 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
1053 | err = -EBUSY; | ||
1054 | goto exit_release_ebase; | ||
1055 | } | ||
1056 | |||
1057 | err = request_irq(data->irq, wbcir_irq_handler, | ||
1058 | IRQF_DISABLED, DRVNAME, device); | ||
1059 | if (err) { | ||
1060 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
1061 | err = -EBUSY; | ||
1062 | goto exit_release_sbase; | ||
1063 | } | ||
1064 | |||
1065 | err = rc_register_device(data->dev); | 1065 | err = rc_register_device(data->dev); |
1066 | if (err) | 1066 | if (err) |
1067 | goto exit_free_rc; | 1067 | goto exit_free_irq; |
1068 | 1068 | ||
1069 | device_init_wakeup(&device->dev, 1); | 1069 | device_init_wakeup(&device->dev, 1); |
1070 | 1070 | ||
@@ -1072,14 +1072,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1072 | 1072 | ||
1073 | return 0; | 1073 | return 0; |
1074 | 1074 | ||
1075 | exit_free_rc: | ||
1076 | rc_free_device(data->dev); | ||
1077 | exit_unregister_led: | ||
1078 | led_classdev_unregister(&data->led); | ||
1079 | exit_unregister_rxtrigger: | ||
1080 | led_trigger_unregister_simple(data->rxtrigger); | ||
1081 | exit_unregister_txtrigger: | ||
1082 | led_trigger_unregister_simple(data->txtrigger); | ||
1083 | exit_free_irq: | 1075 | exit_free_irq: |
1084 | free_irq(data->irq, device); | 1076 | free_irq(data->irq, device); |
1085 | exit_release_sbase: | 1077 | exit_release_sbase: |
@@ -1088,6 +1080,14 @@ exit_release_ebase: | |||
1088 | release_region(data->ebase, EHFUNC_IOMEM_LEN); | 1080 | release_region(data->ebase, EHFUNC_IOMEM_LEN); |
1089 | exit_release_wbase: | 1081 | exit_release_wbase: |
1090 | release_region(data->wbase, WAKEUP_IOMEM_LEN); | 1082 | release_region(data->wbase, WAKEUP_IOMEM_LEN); |
1083 | exit_free_rc: | ||
1084 | rc_free_device(data->dev); | ||
1085 | exit_unregister_led: | ||
1086 | led_classdev_unregister(&data->led); | ||
1087 | exit_unregister_rxtrigger: | ||
1088 | led_trigger_unregister_simple(data->rxtrigger); | ||
1089 | exit_unregister_txtrigger: | ||
1090 | led_trigger_unregister_simple(data->txtrigger); | ||
1091 | exit_free_data: | 1091 | exit_free_data: |
1092 | kfree(data); | 1092 | kfree(data); |
1093 | pnp_set_drvdata(device, NULL); | 1093 | pnp_set_drvdata(device, NULL); |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index db8e5084df06..863c755dd2b7 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -2923,6 +2923,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
2923 | * not the JPEG end of frame ('ff d9'). | 2923 | * not the JPEG end of frame ('ff d9'). |
2924 | */ | 2924 | */ |
2925 | 2925 | ||
2926 | /* count the packets and their size */ | ||
2927 | sd->npkt++; | ||
2928 | sd->pktsz += len; | ||
2929 | |||
2926 | /*fixme: assumption about the following code: | 2930 | /*fixme: assumption about the following code: |
2927 | * - there can be only one marker in a packet | 2931 | * - there can be only one marker in a packet |
2928 | */ | 2932 | */ |
@@ -2945,10 +2949,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
2945 | data += i; | 2949 | data += i; |
2946 | } | 2950 | } |
2947 | 2951 | ||
2948 | /* count the packets and their size */ | ||
2949 | sd->npkt++; | ||
2950 | sd->pktsz += len; | ||
2951 | |||
2952 | /* search backwards if there is a marker in the packet */ | 2952 | /* search backwards if there is a marker in the packet */ |
2953 | for (i = len - 1; --i >= 0; ) { | 2953 | for (i = len - 1; --i >= 0; ) { |
2954 | if (data[i] != 0xff) { | 2954 | if (data[i] != 0xff) { |
diff --git a/drivers/media/video/marvell-ccic/mmp-driver.c b/drivers/media/video/marvell-ccic/mmp-driver.c index d23552323f45..c4c17fe76c0d 100644 --- a/drivers/media/video/marvell-ccic/mmp-driver.c +++ b/drivers/media/video/marvell-ccic/mmp-driver.c | |||
@@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev) | |||
181 | INIT_LIST_HEAD(&cam->devlist); | 181 | INIT_LIST_HEAD(&cam->devlist); |
182 | 182 | ||
183 | mcam = &cam->mcam; | 183 | mcam = &cam->mcam; |
184 | mcam->platform = MHP_Armada610; | ||
185 | mcam->plat_power_up = mmpcam_power_up; | 184 | mcam->plat_power_up = mmpcam_power_up; |
186 | mcam->plat_power_down = mmpcam_power_down; | 185 | mcam->plat_power_down = mmpcam_power_down; |
187 | mcam->dev = &pdev->dev; | 186 | mcam->dev = &pdev->dev; |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index b06efd208328..7e9b2c612b03 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
@@ -246,28 +246,37 @@ int fimc_capture_resume(struct fimc_dev *fimc) | |||
246 | 246 | ||
247 | } | 247 | } |
248 | 248 | ||
249 | static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane) | 249 | static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, |
250 | { | ||
251 | if (!fr || plane >= fr->fmt->memplanes) | ||
252 | return 0; | ||
253 | return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8; | ||
254 | } | ||
255 | |||
256 | static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, | ||
257 | unsigned int *num_buffers, unsigned int *num_planes, | 250 | unsigned int *num_buffers, unsigned int *num_planes, |
258 | unsigned int sizes[], void *allocators[]) | 251 | unsigned int sizes[], void *allocators[]) |
259 | { | 252 | { |
253 | const struct v4l2_pix_format_mplane *pixm = NULL; | ||
260 | struct fimc_ctx *ctx = vq->drv_priv; | 254 | struct fimc_ctx *ctx = vq->drv_priv; |
261 | struct fimc_fmt *fmt = ctx->d_frame.fmt; | 255 | struct fimc_frame *frame = &ctx->d_frame; |
256 | struct fimc_fmt *fmt = frame->fmt; | ||
257 | unsigned long wh; | ||
262 | int i; | 258 | int i; |
263 | 259 | ||
264 | if (!fmt) | 260 | if (pfmt) { |
261 | pixm = &pfmt->fmt.pix_mp; | ||
262 | fmt = fimc_find_format(&pixm->pixelformat, NULL, | ||
263 | FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1); | ||
264 | wh = pixm->width * pixm->height; | ||
265 | } else { | ||
266 | wh = frame->f_width * frame->f_height; | ||
267 | } | ||
268 | |||
269 | if (fmt == NULL) | ||
265 | return -EINVAL; | 270 | return -EINVAL; |
266 | 271 | ||
267 | *num_planes = fmt->memplanes; | 272 | *num_planes = fmt->memplanes; |
268 | 273 | ||
269 | for (i = 0; i < fmt->memplanes; i++) { | 274 | for (i = 0; i < fmt->memplanes; i++) { |
270 | sizes[i] = get_plane_size(&ctx->d_frame, i); | 275 | unsigned int size = (wh * fmt->depth[i]) / 8; |
276 | if (pixm) | ||
277 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); | ||
278 | else | ||
279 | sizes[i] = size; | ||
271 | allocators[i] = ctx->fimc_dev->alloc_ctx; | 280 | allocators[i] = ctx->fimc_dev->alloc_ctx; |
272 | } | 281 | } |
273 | 282 | ||
@@ -1383,7 +1392,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd, | |||
1383 | fimc_capture_try_crop(ctx, r, crop->pad); | 1392 | fimc_capture_try_crop(ctx, r, crop->pad); |
1384 | 1393 | ||
1385 | if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { | 1394 | if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { |
1386 | mutex_lock(&fimc->lock); | 1395 | mutex_unlock(&fimc->lock); |
1387 | *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; | 1396 | *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; |
1388 | return 0; | 1397 | return 0; |
1389 | } | 1398 | } |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index e184e650022a..e09ba7b0076e 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
@@ -1048,14 +1048,14 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh, | |||
1048 | * @mask: the color flags to match | 1048 | * @mask: the color flags to match |
1049 | * @index: offset in the fimc_formats array, ignored if negative | 1049 | * @index: offset in the fimc_formats array, ignored if negative |
1050 | */ | 1050 | */ |
1051 | struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, | 1051 | struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, |
1052 | unsigned int mask, int index) | 1052 | unsigned int mask, int index) |
1053 | { | 1053 | { |
1054 | struct fimc_fmt *fmt, *def_fmt = NULL; | 1054 | struct fimc_fmt *fmt, *def_fmt = NULL; |
1055 | unsigned int i; | 1055 | unsigned int i; |
1056 | int id = 0; | 1056 | int id = 0; |
1057 | 1057 | ||
1058 | if (index >= ARRAY_SIZE(fimc_formats)) | 1058 | if (index >= (int)ARRAY_SIZE(fimc_formats)) |
1059 | return NULL; | 1059 | return NULL; |
1060 | 1060 | ||
1061 | for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { | 1061 | for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h index a18291e648e2..84fd83550bd7 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.h +++ b/drivers/media/video/s5p-fimc/fimc-core.h | |||
@@ -718,7 +718,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx); | |||
718 | int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); | 718 | int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); |
719 | void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | 719 | void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, |
720 | struct v4l2_pix_format_mplane *pix); | 720 | struct v4l2_pix_format_mplane *pix); |
721 | struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, | 721 | struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, |
722 | unsigned int mask, int index); | 722 | unsigned int mask, int index); |
723 | 723 | ||
724 | int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, | 724 | int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, |
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index eb25756a07af..aedb970d13f6 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
@@ -530,7 +530,10 @@ static int soc_camera_open(struct file *file) | |||
530 | if (icl->reset) | 530 | if (icl->reset) |
531 | icl->reset(icd->pdev); | 531 | icl->reset(icd->pdev); |
532 | 532 | ||
533 | /* Don't mess with the host during probe */ | ||
534 | mutex_lock(&ici->host_lock); | ||
533 | ret = ici->ops->add(icd); | 535 | ret = ici->ops->add(icd); |
536 | mutex_unlock(&ici->host_lock); | ||
534 | if (ret < 0) { | 537 | if (ret < 0) { |
535 | dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); | 538 | dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); |
536 | goto eiciadd; | 539 | goto eiciadd; |
@@ -956,7 +959,7 @@ static void scan_add_host(struct soc_camera_host *ici) | |||
956 | { | 959 | { |
957 | struct soc_camera_device *icd; | 960 | struct soc_camera_device *icd; |
958 | 961 | ||
959 | mutex_lock(&list_lock); | 962 | mutex_lock(&ici->host_lock); |
960 | 963 | ||
961 | list_for_each_entry(icd, &devices, list) { | 964 | list_for_each_entry(icd, &devices, list) { |
962 | if (icd->iface == ici->nr) { | 965 | if (icd->iface == ici->nr) { |
@@ -967,7 +970,7 @@ static void scan_add_host(struct soc_camera_host *ici) | |||
967 | } | 970 | } |
968 | } | 971 | } |
969 | 972 | ||
970 | mutex_unlock(&list_lock); | 973 | mutex_unlock(&ici->host_lock); |
971 | } | 974 | } |
972 | 975 | ||
973 | #ifdef CONFIG_I2C_BOARDINFO | 976 | #ifdef CONFIG_I2C_BOARDINFO |
@@ -1313,6 +1316,7 @@ int soc_camera_host_register(struct soc_camera_host *ici) | |||
1313 | list_add_tail(&ici->list, &hosts); | 1316 | list_add_tail(&ici->list, &hosts); |
1314 | mutex_unlock(&list_lock); | 1317 | mutex_unlock(&list_lock); |
1315 | 1318 | ||
1319 | mutex_init(&ici->host_lock); | ||
1316 | scan_add_host(ici); | 1320 | scan_add_host(ici); |
1317 | 1321 | ||
1318 | return 0; | 1322 | return 0; |
diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c index f17ad98fcc5f..4b7132660a93 100644 --- a/drivers/media/video/videobuf2-dma-contig.c +++ b/drivers/media/video/videobuf2-dma-contig.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
16 | 16 | ||
17 | #include <media/videobuf2-core.h> | 17 | #include <media/videobuf2-core.h> |
18 | #include <media/videobuf2-dma-contig.h> | ||
18 | #include <media/videobuf2-memops.h> | 19 | #include <media/videobuf2-memops.h> |
19 | 20 | ||
20 | struct vb2_dc_conf { | 21 | struct vb2_dc_conf { |
@@ -85,7 +86,7 @@ static void *vb2_dma_contig_vaddr(void *buf_priv) | |||
85 | { | 86 | { |
86 | struct vb2_dc_buf *buf = buf_priv; | 87 | struct vb2_dc_buf *buf = buf_priv; |
87 | if (!buf) | 88 | if (!buf) |
88 | return 0; | 89 | return NULL; |
89 | 90 | ||
90 | return buf->vaddr; | 91 | return buf->vaddr; |
91 | } | 92 | } |
diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c index c41cb60245d6..504cd4cbe29e 100644 --- a/drivers/media/video/videobuf2-memops.c +++ b/drivers/media/video/videobuf2-memops.c | |||
@@ -55,6 +55,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma) | |||
55 | 55 | ||
56 | return vma_copy; | 56 | return vma_copy; |
57 | } | 57 | } |
58 | EXPORT_SYMBOL_GPL(vb2_get_vma); | ||
58 | 59 | ||
59 | /** | 60 | /** |
60 | * vb2_put_userptr() - release a userspace virtual memory area | 61 | * vb2_put_userptr() - release a userspace virtual memory area |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 58fc65f5c817..f2f482bec573 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -376,7 +376,7 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode) | |||
376 | * Make a fake call to mtd_read_fact_prot_reg() to check if OTP | 376 | * Make a fake call to mtd_read_fact_prot_reg() to check if OTP |
377 | * operations are supported. | 377 | * operations are supported. |
378 | */ | 378 | */ |
379 | if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) | 379 | if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP) |
380 | return -EOPNOTSUPP; | 380 | return -EOPNOTSUPP; |
381 | 381 | ||
382 | switch (mode) { | 382 | switch (mode) { |
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 73416951f4c1..861ca8f7e47d 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c | |||
@@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev) | |||
212 | /* Link the private data with the MTD structure */ | 212 | /* Link the private data with the MTD structure */ |
213 | ams_delta_mtd->priv = this; | 213 | ams_delta_mtd->priv = this; |
214 | 214 | ||
215 | if (!request_mem_region(res->start, resource_size(res), | 215 | /* |
216 | dev_name(&pdev->dev))) { | 216 | * Don't try to request the memory region from here, |
217 | dev_err(&pdev->dev, "request_mem_region failed\n"); | 217 | * it should have been already requested from the |
218 | err = -EBUSY; | 218 | * gpio-omap driver and requesting it again would fail. |
219 | goto out_free; | 219 | */ |
220 | } | ||
221 | 220 | ||
222 | io_base = ioremap(res->start, resource_size(res)); | 221 | io_base = ioremap(res->start, resource_size(res)); |
223 | if (io_base == NULL) { | 222 | if (io_base == NULL) { |
224 | dev_err(&pdev->dev, "ioremap failed\n"); | 223 | dev_err(&pdev->dev, "ioremap failed\n"); |
225 | err = -EIO; | 224 | err = -EIO; |
226 | goto out_release_io; | 225 | goto out_free; |
227 | } | 226 | } |
228 | 227 | ||
229 | this->priv = io_base; | 228 | this->priv = io_base; |
@@ -271,8 +270,6 @@ out_gpio: | |||
271 | platform_set_drvdata(pdev, NULL); | 270 | platform_set_drvdata(pdev, NULL); |
272 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | 271 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); |
273 | iounmap(io_base); | 272 | iounmap(io_base); |
274 | out_release_io: | ||
275 | release_mem_region(res->start, resource_size(res)); | ||
276 | out_free: | 273 | out_free: |
277 | kfree(ams_delta_mtd); | 274 | kfree(ams_delta_mtd); |
278 | out: | 275 | out: |
@@ -285,7 +282,6 @@ out_free: | |||
285 | static int __devexit ams_delta_cleanup(struct platform_device *pdev) | 282 | static int __devexit ams_delta_cleanup(struct platform_device *pdev) |
286 | { | 283 | { |
287 | void __iomem *io_base = platform_get_drvdata(pdev); | 284 | void __iomem *io_base = platform_get_drvdata(pdev); |
288 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
289 | 285 | ||
290 | /* Release resources, unregister device */ | 286 | /* Release resources, unregister device */ |
291 | nand_release(ams_delta_mtd); | 287 | nand_release(ams_delta_mtd); |
@@ -293,7 +289,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev) | |||
293 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); | 289 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); |
294 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | 290 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); |
295 | iounmap(io_base); | 291 | iounmap(io_base); |
296 | release_mem_region(res->start, resource_size(res)); | ||
297 | 292 | ||
298 | /* Free the MTD device structure */ | 293 | /* Free the MTD device structure */ |
299 | kfree(ams_delta_mtd); | 294 | kfree(ams_delta_mtd); |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 793b00138275..3463b469e657 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2173,9 +2173,10 @@ re_arm: | |||
2173 | * received frames (loopback). Since only the payload is given to this | 2173 | * received frames (loopback). Since only the payload is given to this |
2174 | * function, it check for loopback. | 2174 | * function, it check for loopback. |
2175 | */ | 2175 | */ |
2176 | static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) | 2176 | static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) |
2177 | { | 2177 | { |
2178 | struct port *port; | 2178 | struct port *port; |
2179 | int ret = RX_HANDLER_ANOTHER; | ||
2179 | 2180 | ||
2180 | if (length >= sizeof(struct lacpdu)) { | 2181 | if (length >= sizeof(struct lacpdu)) { |
2181 | 2182 | ||
@@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2184 | if (!port->slave) { | 2185 | if (!port->slave) { |
2185 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", | 2186 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", |
2186 | slave->dev->name, slave->dev->master->name); | 2187 | slave->dev->name, slave->dev->master->name); |
2187 | return; | 2188 | return ret; |
2188 | } | 2189 | } |
2189 | 2190 | ||
2190 | switch (lacpdu->subtype) { | 2191 | switch (lacpdu->subtype) { |
2191 | case AD_TYPE_LACPDU: | 2192 | case AD_TYPE_LACPDU: |
2193 | ret = RX_HANDLER_CONSUMED; | ||
2192 | pr_debug("Received LACPDU on port %d\n", | 2194 | pr_debug("Received LACPDU on port %d\n", |
2193 | port->actor_port_number); | 2195 | port->actor_port_number); |
2194 | /* Protect against concurrent state machines */ | 2196 | /* Protect against concurrent state machines */ |
@@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2198 | break; | 2200 | break; |
2199 | 2201 | ||
2200 | case AD_TYPE_MARKER: | 2202 | case AD_TYPE_MARKER: |
2203 | ret = RX_HANDLER_CONSUMED; | ||
2201 | // No need to convert fields to Little Endian since we don't use the marker's fields. | 2204 | // No need to convert fields to Little Endian since we don't use the marker's fields. |
2202 | 2205 | ||
2203 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2206 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
@@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2219 | } | 2222 | } |
2220 | } | 2223 | } |
2221 | } | 2224 | } |
2225 | return ret; | ||
2222 | } | 2226 | } |
2223 | 2227 | ||
2224 | /** | 2228 | /** |
@@ -2456,18 +2460,20 @@ out: | |||
2456 | return NETDEV_TX_OK; | 2460 | return NETDEV_TX_OK; |
2457 | } | 2461 | } |
2458 | 2462 | ||
2459 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 2463 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
2460 | struct slave *slave) | 2464 | struct slave *slave) |
2461 | { | 2465 | { |
2466 | int ret = RX_HANDLER_ANOTHER; | ||
2462 | if (skb->protocol != PKT_TYPE_LACPDU) | 2467 | if (skb->protocol != PKT_TYPE_LACPDU) |
2463 | return; | 2468 | return ret; |
2464 | 2469 | ||
2465 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | 2470 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) |
2466 | return; | 2471 | return ret; |
2467 | 2472 | ||
2468 | read_lock(&bond->lock); | 2473 | read_lock(&bond->lock); |
2469 | bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); | 2474 | ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); |
2470 | read_unlock(&bond->lock); | 2475 | read_unlock(&bond->lock); |
2476 | return ret; | ||
2471 | } | 2477 | } |
2472 | 2478 | ||
2473 | /* | 2479 | /* |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 235b2cc58b28..5ee7e3c45db7 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave); | |||
274 | void bond_3ad_handle_link_change(struct slave *slave, char link); | 274 | void bond_3ad_handle_link_change(struct slave *slave, char link); |
275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); | 275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); |
276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); | 276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); |
277 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 277 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
278 | struct slave *slave); | 278 | struct slave *slave); |
279 | int bond_3ad_set_carrier(struct bonding *bond); | 279 | int bond_3ad_set_carrier(struct bonding *bond); |
280 | void bond_3ad_update_lacp_rate(struct bonding *bond); | 280 | void bond_3ad_update_lacp_rate(struct bonding *bond); |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 9abfde479316..2e1f8066f1a8 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -342,26 +342,26 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
342 | _unlock_rx_hashtbl_bh(bond); | 342 | _unlock_rx_hashtbl_bh(bond); |
343 | } | 343 | } |
344 | 344 | ||
345 | static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, | 345 | static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, |
346 | struct slave *slave) | 346 | struct slave *slave) |
347 | { | 347 | { |
348 | struct arp_pkt *arp; | 348 | struct arp_pkt *arp; |
349 | 349 | ||
350 | if (skb->protocol != cpu_to_be16(ETH_P_ARP)) | 350 | if (skb->protocol != cpu_to_be16(ETH_P_ARP)) |
351 | return; | 351 | goto out; |
352 | 352 | ||
353 | arp = (struct arp_pkt *) skb->data; | 353 | arp = (struct arp_pkt *) skb->data; |
354 | if (!arp) { | 354 | if (!arp) { |
355 | pr_debug("Packet has no ARP data\n"); | 355 | pr_debug("Packet has no ARP data\n"); |
356 | return; | 356 | goto out; |
357 | } | 357 | } |
358 | 358 | ||
359 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) | 359 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) |
360 | return; | 360 | goto out; |
361 | 361 | ||
362 | if (skb->len < sizeof(struct arp_pkt)) { | 362 | if (skb->len < sizeof(struct arp_pkt)) { |
363 | pr_debug("Packet is too small to be an ARP\n"); | 363 | pr_debug("Packet is too small to be an ARP\n"); |
364 | return; | 364 | goto out; |
365 | } | 365 | } |
366 | 366 | ||
367 | if (arp->op_code == htons(ARPOP_REPLY)) { | 367 | if (arp->op_code == htons(ARPOP_REPLY)) { |
@@ -369,6 +369,8 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, | |||
369 | rlb_update_entry_from_arp(bond, arp); | 369 | rlb_update_entry_from_arp(bond, arp); |
370 | pr_debug("Server received an ARP Reply from client\n"); | 370 | pr_debug("Server received an ARP Reply from client\n"); |
371 | } | 371 | } |
372 | out: | ||
373 | return RX_HANDLER_ANOTHER; | ||
372 | } | 374 | } |
373 | 375 | ||
374 | /* Caller must hold bond lock for read */ | 376 | /* Caller must hold bond lock for read */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 62d2409bb293..bc13b3d77432 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1444 | struct sk_buff *skb = *pskb; | 1444 | struct sk_buff *skb = *pskb; |
1445 | struct slave *slave; | 1445 | struct slave *slave; |
1446 | struct bonding *bond; | 1446 | struct bonding *bond; |
1447 | void (*recv_probe)(struct sk_buff *, struct bonding *, | 1447 | int (*recv_probe)(struct sk_buff *, struct bonding *, |
1448 | struct slave *); | 1448 | struct slave *); |
1449 | int ret = RX_HANDLER_ANOTHER; | ||
1449 | 1450 | ||
1450 | skb = skb_share_check(skb, GFP_ATOMIC); | 1451 | skb = skb_share_check(skb, GFP_ATOMIC); |
1451 | if (unlikely(!skb)) | 1452 | if (unlikely(!skb)) |
@@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1464 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); | 1465 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); |
1465 | 1466 | ||
1466 | if (likely(nskb)) { | 1467 | if (likely(nskb)) { |
1467 | recv_probe(nskb, bond, slave); | 1468 | ret = recv_probe(nskb, bond, slave); |
1468 | dev_kfree_skb(nskb); | 1469 | dev_kfree_skb(nskb); |
1470 | if (ret == RX_HANDLER_CONSUMED) { | ||
1471 | consume_skb(skb); | ||
1472 | return ret; | ||
1473 | } | ||
1469 | } | 1474 | } |
1470 | } | 1475 | } |
1471 | 1476 | ||
@@ -1487,7 +1492,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1487 | memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); | 1492 | memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); |
1488 | } | 1493 | } |
1489 | 1494 | ||
1490 | return RX_HANDLER_ANOTHER; | 1495 | return ret; |
1491 | } | 1496 | } |
1492 | 1497 | ||
1493 | /* enslave device <slave> to bond device <master> */ | 1498 | /* enslave device <slave> to bond device <master> */ |
@@ -2723,7 +2728,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2723 | } | 2728 | } |
2724 | } | 2729 | } |
2725 | 2730 | ||
2726 | static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | 2731 | static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, |
2727 | struct slave *slave) | 2732 | struct slave *slave) |
2728 | { | 2733 | { |
2729 | struct arphdr *arp; | 2734 | struct arphdr *arp; |
@@ -2731,7 +2736,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | |||
2731 | __be32 sip, tip; | 2736 | __be32 sip, tip; |
2732 | 2737 | ||
2733 | if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) | 2738 | if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) |
2734 | return; | 2739 | return RX_HANDLER_ANOTHER; |
2735 | 2740 | ||
2736 | read_lock(&bond->lock); | 2741 | read_lock(&bond->lock); |
2737 | 2742 | ||
@@ -2776,6 +2781,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | |||
2776 | 2781 | ||
2777 | out_unlock: | 2782 | out_unlock: |
2778 | read_unlock(&bond->lock); | 2783 | read_unlock(&bond->lock); |
2784 | return RX_HANDLER_ANOTHER; | ||
2779 | } | 2785 | } |
2780 | 2786 | ||
2781 | /* | 2787 | /* |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 9f2bae6616d3..4581aa5ccaba 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -218,7 +218,7 @@ struct bonding { | |||
218 | struct slave *primary_slave; | 218 | struct slave *primary_slave; |
219 | bool force_primary; | 219 | bool force_primary; |
220 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ | 220 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ |
221 | void (*recv_probe)(struct sk_buff *, struct bonding *, | 221 | int (*recv_probe)(struct sk_buff *, struct bonding *, |
222 | struct slave *); | 222 | struct slave *); |
223 | rwlock_t lock; | 223 | rwlock_t lock; |
224 | rwlock_t curr_slave_lock; | 224 | rwlock_t curr_slave_lock; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index e077d2508727..6af310195bae 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) | |||
9122 | return bnx2x_prev_mcp_done(bp); | 9122 | return bnx2x_prev_mcp_done(bp); |
9123 | } | 9123 | } |
9124 | 9124 | ||
9125 | /* previous driver DMAE transaction may have occurred when pre-boot stage ended | ||
9126 | * and boot began, or when kdump kernel was loaded. Either case would invalidate | ||
9127 | * the addresses of the transaction, resulting in was-error bit set in the pci | ||
9128 | * causing all hw-to-host pcie transactions to timeout. If this happened we want | ||
9129 | * to clear the interrupt which detected this from the pglueb and the was done | ||
9130 | * bit | ||
9131 | */ | ||
9132 | static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp) | ||
9133 | { | ||
9134 | u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS); | ||
9135 | if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) { | ||
9136 | BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing"); | ||
9137 | REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp)); | ||
9138 | } | ||
9139 | } | ||
9140 | |||
9125 | static int __devinit bnx2x_prev_unload(struct bnx2x *bp) | 9141 | static int __devinit bnx2x_prev_unload(struct bnx2x *bp) |
9126 | { | 9142 | { |
9127 | int time_counter = 10; | 9143 | int time_counter = 10; |
9128 | u32 rc, fw, hw_lock_reg, hw_lock_val; | 9144 | u32 rc, fw, hw_lock_reg, hw_lock_val; |
9129 | BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); | 9145 | BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); |
9130 | 9146 | ||
9131 | /* Release previously held locks */ | 9147 | /* clear hw from errors which may have resulted from an interrupted |
9148 | * dmae transaction. | ||
9149 | */ | ||
9150 | bnx2x_prev_interrupted_dmae(bp); | ||
9151 | |||
9152 | /* Release previously held locks */ | ||
9132 | hw_lock_reg = (BP_FUNC(bp) <= 5) ? | 9153 | hw_lock_reg = (BP_FUNC(bp) <= 5) ? |
9133 | (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : | 9154 | (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : |
9134 | (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); | 9155 | (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index c9069a28832b..f4d2da0db1b1 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -3335,6 +3335,8 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3335 | goto out_shutdown_ports; | 3335 | goto out_shutdown_ports; |
3336 | } | 3336 | } |
3337 | 3337 | ||
3338 | /* Handle any events that might be pending. */ | ||
3339 | tasklet_hi_schedule(&adapter->neq_tasklet); | ||
3338 | 3340 | ||
3339 | ret = 0; | 3341 | ret = 0; |
3340 | goto out; | 3342 | goto out; |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 4348b6fd44fa..8d8908d2a9b1 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -493,7 +493,11 @@ out: | |||
493 | static void e1000_down_and_stop(struct e1000_adapter *adapter) | 493 | static void e1000_down_and_stop(struct e1000_adapter *adapter) |
494 | { | 494 | { |
495 | set_bit(__E1000_DOWN, &adapter->flags); | 495 | set_bit(__E1000_DOWN, &adapter->flags); |
496 | cancel_work_sync(&adapter->reset_task); | 496 | |
497 | /* Only kill reset task if adapter is not resetting */ | ||
498 | if (!test_bit(__E1000_RESETTING, &adapter->flags)) | ||
499 | cancel_work_sync(&adapter->reset_task); | ||
500 | |||
497 | cancel_delayed_work_sync(&adapter->watchdog_task); | 501 | cancel_delayed_work_sync(&adapter->watchdog_task); |
498 | cancel_delayed_work_sync(&adapter->phy_info_task); | 502 | cancel_delayed_work_sync(&adapter->phy_info_task); |
499 | cancel_delayed_work_sync(&adapter->fifo_stall_task); | 503 | cancel_delayed_work_sync(&adapter->fifo_stall_task); |
@@ -3380,7 +3384,7 @@ static void e1000_dump(struct e1000_adapter *adapter) | |||
3380 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { | 3384 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { |
3381 | struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); | 3385 | struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); |
3382 | struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; | 3386 | struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; |
3383 | struct my_u { u64 a; u64 b; }; | 3387 | struct my_u { __le64 a; __le64 b; }; |
3384 | struct my_u *u = (struct my_u *)tx_desc; | 3388 | struct my_u *u = (struct my_u *)tx_desc; |
3385 | const char *type; | 3389 | const char *type; |
3386 | 3390 | ||
@@ -3424,7 +3428,7 @@ rx_ring_summary: | |||
3424 | for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { | 3428 | for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { |
3425 | struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); | 3429 | struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); |
3426 | struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; | 3430 | struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; |
3427 | struct my_u { u64 a; u64 b; }; | 3431 | struct my_u { __le64 a; __le64 b; }; |
3428 | struct my_u *u = (struct my_u *)rx_desc; | 3432 | struct my_u *u = (struct my_u *)rx_desc; |
3429 | const char *type; | 3433 | const char *type; |
3430 | 3434 | ||
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 5ec31598ee47..8683ca4748c8 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -1111,9 +1111,12 @@ msi_only: | |||
1111 | adapter->flags |= IGB_FLAG_HAS_MSI; | 1111 | adapter->flags |= IGB_FLAG_HAS_MSI; |
1112 | out: | 1112 | out: |
1113 | /* Notify the stack of the (possibly) reduced queue counts. */ | 1113 | /* Notify the stack of the (possibly) reduced queue counts. */ |
1114 | rtnl_lock(); | ||
1114 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 1115 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
1115 | return netif_set_real_num_rx_queues(adapter->netdev, | 1116 | err = netif_set_real_num_rx_queues(adapter->netdev, |
1116 | adapter->num_rx_queues); | 1117 | adapter->num_rx_queues); |
1118 | rtnl_unlock(); | ||
1119 | return err; | ||
1117 | } | 1120 | } |
1118 | 1121 | ||
1119 | /** | 1122 | /** |
@@ -2771,8 +2774,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter, | |||
2771 | 2774 | ||
2772 | txdctl |= E1000_TXDCTL_QUEUE_ENABLE; | 2775 | txdctl |= E1000_TXDCTL_QUEUE_ENABLE; |
2773 | wr32(E1000_TXDCTL(reg_idx), txdctl); | 2776 | wr32(E1000_TXDCTL(reg_idx), txdctl); |
2774 | |||
2775 | netdev_tx_reset_queue(txring_txq(ring)); | ||
2776 | } | 2777 | } |
2777 | 2778 | ||
2778 | /** | 2779 | /** |
@@ -3282,6 +3283,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring) | |||
3282 | igb_unmap_and_free_tx_resource(tx_ring, buffer_info); | 3283 | igb_unmap_and_free_tx_resource(tx_ring, buffer_info); |
3283 | } | 3284 | } |
3284 | 3285 | ||
3286 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
3287 | |||
3285 | size = sizeof(struct igb_tx_buffer) * tx_ring->count; | 3288 | size = sizeof(struct igb_tx_buffer) * tx_ring->count; |
3286 | memset(tx_ring->tx_buffer_info, 0, size); | 3289 | memset(tx_ring->tx_buffer_info, 0, size); |
3287 | 3290 | ||
@@ -6796,18 +6799,7 @@ static int igb_resume(struct device *dev) | |||
6796 | pci_enable_wake(pdev, PCI_D3hot, 0); | 6799 | pci_enable_wake(pdev, PCI_D3hot, 0); |
6797 | pci_enable_wake(pdev, PCI_D3cold, 0); | 6800 | pci_enable_wake(pdev, PCI_D3cold, 0); |
6798 | 6801 | ||
6799 | if (!rtnl_is_locked()) { | 6802 | if (igb_init_interrupt_scheme(adapter)) { |
6800 | /* | ||
6801 | * shut up ASSERT_RTNL() warning in | ||
6802 | * netif_set_real_num_tx/rx_queues. | ||
6803 | */ | ||
6804 | rtnl_lock(); | ||
6805 | err = igb_init_interrupt_scheme(adapter); | ||
6806 | rtnl_unlock(); | ||
6807 | } else { | ||
6808 | err = igb_init_interrupt_scheme(adapter); | ||
6809 | } | ||
6810 | if (err) { | ||
6811 | dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); | 6803 | dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); |
6812 | return -ENOMEM; | 6804 | return -ENOMEM; |
6813 | } | 6805 | } |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 74e192107f9a..81b155589532 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -574,9 +574,6 @@ extern struct ixgbe_info ixgbe_82599_info; | |||
574 | extern struct ixgbe_info ixgbe_X540_info; | 574 | extern struct ixgbe_info ixgbe_X540_info; |
575 | #ifdef CONFIG_IXGBE_DCB | 575 | #ifdef CONFIG_IXGBE_DCB |
576 | extern const struct dcbnl_rtnl_ops dcbnl_ops; | 576 | extern const struct dcbnl_rtnl_ops dcbnl_ops; |
577 | extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg, | ||
578 | struct ixgbe_dcb_config *dst_dcb_cfg, | ||
579 | int tc_max); | ||
580 | #endif | 577 | #endif |
581 | 578 | ||
582 | extern char ixgbe_driver_name[]; | 579 | extern char ixgbe_driver_name[]; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index 652e4b09546d..32e5c02ff6d0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -44,18 +44,26 @@ | |||
44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ | 44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ |
45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ | 45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ |
46 | 46 | ||
47 | int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg, | 47 | static int ixgbe_copy_dcb_cfg(struct ixgbe_adapter *adapter, int tc_max) |
48 | struct ixgbe_dcb_config *dcfg, int tc_max) | ||
49 | { | 48 | { |
49 | struct ixgbe_dcb_config *scfg = &adapter->temp_dcb_cfg; | ||
50 | struct ixgbe_dcb_config *dcfg = &adapter->dcb_cfg; | ||
50 | struct tc_configuration *src = NULL; | 51 | struct tc_configuration *src = NULL; |
51 | struct tc_configuration *dst = NULL; | 52 | struct tc_configuration *dst = NULL; |
52 | int i, j; | 53 | int i, j; |
53 | int tx = DCB_TX_CONFIG; | 54 | int tx = DCB_TX_CONFIG; |
54 | int rx = DCB_RX_CONFIG; | 55 | int rx = DCB_RX_CONFIG; |
55 | int changes = 0; | 56 | int changes = 0; |
57 | #ifdef IXGBE_FCOE | ||
58 | struct dcb_app app = { | ||
59 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
60 | .protocol = ETH_P_FCOE, | ||
61 | }; | ||
62 | u8 up = dcb_getapp(adapter->netdev, &app); | ||
56 | 63 | ||
57 | if (!scfg || !dcfg) | 64 | if (up && !(up & (1 << adapter->fcoe.up))) |
58 | return changes; | 65 | changes |= BIT_APP_UPCHG; |
66 | #endif | ||
59 | 67 | ||
60 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { | 68 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { |
61 | src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; | 69 | src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; |
@@ -332,28 +340,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
332 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 340 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
333 | int ret = DCB_NO_HW_CHG; | 341 | int ret = DCB_NO_HW_CHG; |
334 | int i; | 342 | int i; |
335 | #ifdef IXGBE_FCOE | ||
336 | struct dcb_app app = { | ||
337 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
338 | .protocol = ETH_P_FCOE, | ||
339 | }; | ||
340 | u8 up; | ||
341 | |||
342 | /* In IEEE mode, use the IEEE Ethertype selector value */ | ||
343 | if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) { | ||
344 | app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE; | ||
345 | up = dcb_ieee_getapp_mask(netdev, &app); | ||
346 | } else { | ||
347 | up = dcb_getapp(netdev, &app); | ||
348 | } | ||
349 | #endif | ||
350 | 343 | ||
351 | /* Fail command if not in CEE mode */ | 344 | /* Fail command if not in CEE mode */ |
352 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) | 345 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) |
353 | return ret; | 346 | return ret; |
354 | 347 | ||
355 | adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, | 348 | adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(adapter, |
356 | &adapter->dcb_cfg, | ||
357 | MAX_TRAFFIC_CLASS); | 349 | MAX_TRAFFIC_CLASS); |
358 | if (!adapter->dcb_set_bitmap) | 350 | if (!adapter->dcb_set_bitmap) |
359 | return ret; | 351 | return ret; |
@@ -440,8 +432,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
440 | * FCoE is using changes. This happens if the APP info | 432 | * FCoE is using changes. This happens if the APP info |
441 | * changes or the up2tc mapping is updated. | 433 | * changes or the up2tc mapping is updated. |
442 | */ | 434 | */ |
443 | if ((up && !(up & (1 << adapter->fcoe.up))) || | 435 | if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) { |
444 | (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) { | 436 | struct dcb_app app = { |
437 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
438 | .protocol = ETH_P_FCOE, | ||
439 | }; | ||
440 | u8 up = dcb_getapp(netdev, &app); | ||
441 | |||
445 | adapter->fcoe.up = ffs(up) - 1; | 442 | adapter->fcoe.up = ffs(up) - 1; |
446 | ixgbe_dcbnl_devreset(netdev); | 443 | ixgbe_dcbnl_devreset(netdev); |
447 | ret = DCB_HW_CHG_RST; | 444 | ret = DCB_HW_CHG_RST; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 31a2bf76a346..cfe7d269590c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -1780,6 +1780,8 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring, | |||
1780 | rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); | 1780 | rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
1784 | |||
1783 | /* re-map buffers to ring, store next to clean values */ | 1785 | /* re-map buffers to ring, store next to clean values */ |
1784 | ixgbe_alloc_rx_buffers(rx_ring, count); | 1786 | ixgbe_alloc_rx_buffers(rx_ring, count); |
1785 | rx_ring->next_to_clean = rx_ntc; | 1787 | rx_ring->next_to_clean = rx_ntc; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 88f6b2e9b72d..467948e9ecd9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -2671,8 +2671,6 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter, | |||
2671 | /* enable queue */ | 2671 | /* enable queue */ |
2672 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); | 2672 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); |
2673 | 2673 | ||
2674 | netdev_tx_reset_queue(txring_txq(ring)); | ||
2675 | |||
2676 | /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ | 2674 | /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ |
2677 | if (hw->mac.type == ixgbe_mac_82598EB && | 2675 | if (hw->mac.type == ixgbe_mac_82598EB && |
2678 | !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) | 2676 | !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) |
@@ -4167,6 +4165,8 @@ static void ixgbe_clean_tx_ring(struct ixgbe_ring *tx_ring) | |||
4167 | ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); | 4165 | ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); |
4168 | } | 4166 | } |
4169 | 4167 | ||
4168 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
4169 | |||
4170 | size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; | 4170 | size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; |
4171 | memset(tx_ring->tx_buffer_info, 0, size); | 4171 | memset(tx_ring->tx_buffer_info, 0, size); |
4172 | 4172 | ||
@@ -4418,8 +4418,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
4418 | adapter->dcb_cfg.pfc_mode_enable = false; | 4418 | adapter->dcb_cfg.pfc_mode_enable = false; |
4419 | adapter->dcb_set_bitmap = 0x00; | 4419 | adapter->dcb_set_bitmap = 0x00; |
4420 | adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; | 4420 | adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; |
4421 | ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg, | 4421 | memcpy(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, |
4422 | MAX_TRAFFIC_CLASS); | 4422 | sizeof(adapter->temp_dcb_cfg)); |
4423 | 4423 | ||
4424 | #endif | 4424 | #endif |
4425 | 4425 | ||
@@ -4866,10 +4866,12 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4866 | netif_device_detach(netdev); | 4866 | netif_device_detach(netdev); |
4867 | 4867 | ||
4868 | if (netif_running(netdev)) { | 4868 | if (netif_running(netdev)) { |
4869 | rtnl_lock(); | ||
4869 | ixgbe_down(adapter); | 4870 | ixgbe_down(adapter); |
4870 | ixgbe_free_irq(adapter); | 4871 | ixgbe_free_irq(adapter); |
4871 | ixgbe_free_all_tx_resources(adapter); | 4872 | ixgbe_free_all_tx_resources(adapter); |
4872 | ixgbe_free_all_rx_resources(adapter); | 4873 | ixgbe_free_all_rx_resources(adapter); |
4874 | rtnl_unlock(); | ||
4873 | } | 4875 | } |
4874 | 4876 | ||
4875 | ixgbe_clear_interrupt_scheme(adapter); | 4877 | ixgbe_clear_interrupt_scheme(adapter); |
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index f8dda009d3c0..5e313e9a252f 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -618,10 +618,8 @@ static void ks8851_irq_work(struct work_struct *work) | |||
618 | netif_dbg(ks, intr, ks->netdev, | 618 | netif_dbg(ks, intr, ks->netdev, |
619 | "%s: status 0x%04x\n", __func__, status); | 619 | "%s: status 0x%04x\n", __func__, status); |
620 | 620 | ||
621 | if (status & IRQ_LCI) { | 621 | if (status & IRQ_LCI) |
622 | /* should do something about checking link status */ | ||
623 | handled |= IRQ_LCI; | 622 | handled |= IRQ_LCI; |
624 | } | ||
625 | 623 | ||
626 | if (status & IRQ_LDI) { | 624 | if (status & IRQ_LDI) { |
627 | u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); | 625 | u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); |
@@ -684,6 +682,9 @@ static void ks8851_irq_work(struct work_struct *work) | |||
684 | 682 | ||
685 | mutex_unlock(&ks->lock); | 683 | mutex_unlock(&ks->lock); |
686 | 684 | ||
685 | if (status & IRQ_LCI) | ||
686 | mii_check_link(&ks->mii); | ||
687 | |||
687 | if (status & IRQ_TXI) | 688 | if (status & IRQ_TXI) |
688 | netif_wake_queue(ks->netdev); | 689 | netif_wake_queue(ks->netdev); |
689 | 690 | ||
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h index dd14915f54bb..ba781747d174 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | |||
@@ -584,7 +584,6 @@ struct pch_gbe_hw_stats { | |||
584 | /** | 584 | /** |
585 | * struct pch_gbe_adapter - board specific private data structure | 585 | * struct pch_gbe_adapter - board specific private data structure |
586 | * @stats_lock: Spinlock structure for status | 586 | * @stats_lock: Spinlock structure for status |
587 | * @tx_queue_lock: Spinlock structure for transmit | ||
588 | * @ethtool_lock: Spinlock structure for ethtool | 587 | * @ethtool_lock: Spinlock structure for ethtool |
589 | * @irq_sem: Semaphore for interrupt | 588 | * @irq_sem: Semaphore for interrupt |
590 | * @netdev: Pointer of network device structure | 589 | * @netdev: Pointer of network device structure |
@@ -609,7 +608,6 @@ struct pch_gbe_hw_stats { | |||
609 | 608 | ||
610 | struct pch_gbe_adapter { | 609 | struct pch_gbe_adapter { |
611 | spinlock_t stats_lock; | 610 | spinlock_t stats_lock; |
612 | spinlock_t tx_queue_lock; | ||
613 | spinlock_t ethtool_lock; | 611 | spinlock_t ethtool_lock; |
614 | atomic_t irq_sem; | 612 | atomic_t irq_sem; |
615 | struct net_device *netdev; | 613 | struct net_device *netdev; |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index 8035e5ff6e06..1e38d502a062 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | |||
@@ -640,14 +640,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw) | |||
640 | */ | 640 | */ |
641 | static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) | 641 | static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) |
642 | { | 642 | { |
643 | int size; | 643 | adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL); |
644 | |||
645 | size = (int)sizeof(struct pch_gbe_tx_ring); | ||
646 | adapter->tx_ring = kzalloc(size, GFP_KERNEL); | ||
647 | if (!adapter->tx_ring) | 644 | if (!adapter->tx_ring) |
648 | return -ENOMEM; | 645 | return -ENOMEM; |
649 | size = (int)sizeof(struct pch_gbe_rx_ring); | 646 | |
650 | adapter->rx_ring = kzalloc(size, GFP_KERNEL); | 647 | adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL); |
651 | if (!adapter->rx_ring) { | 648 | if (!adapter->rx_ring) { |
652 | kfree(adapter->tx_ring); | 649 | kfree(adapter->tx_ring); |
653 | return -ENOMEM; | 650 | return -ENOMEM; |
@@ -1162,7 +1159,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, | |||
1162 | struct sk_buff *tmp_skb; | 1159 | struct sk_buff *tmp_skb; |
1163 | unsigned int frame_ctrl; | 1160 | unsigned int frame_ctrl; |
1164 | unsigned int ring_num; | 1161 | unsigned int ring_num; |
1165 | unsigned long flags; | ||
1166 | 1162 | ||
1167 | /*-- Set frame control --*/ | 1163 | /*-- Set frame control --*/ |
1168 | frame_ctrl = 0; | 1164 | frame_ctrl = 0; |
@@ -1211,14 +1207,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, | |||
1211 | } | 1207 | } |
1212 | } | 1208 | } |
1213 | } | 1209 | } |
1214 | spin_lock_irqsave(&tx_ring->tx_lock, flags); | 1210 | |
1215 | ring_num = tx_ring->next_to_use; | 1211 | ring_num = tx_ring->next_to_use; |
1216 | if (unlikely((ring_num + 1) == tx_ring->count)) | 1212 | if (unlikely((ring_num + 1) == tx_ring->count)) |
1217 | tx_ring->next_to_use = 0; | 1213 | tx_ring->next_to_use = 0; |
1218 | else | 1214 | else |
1219 | tx_ring->next_to_use = ring_num + 1; | 1215 | tx_ring->next_to_use = ring_num + 1; |
1220 | 1216 | ||
1221 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | 1217 | |
1222 | buffer_info = &tx_ring->buffer_info[ring_num]; | 1218 | buffer_info = &tx_ring->buffer_info[ring_num]; |
1223 | tmp_skb = buffer_info->skb; | 1219 | tmp_skb = buffer_info->skb; |
1224 | 1220 | ||
@@ -1518,7 +1514,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter, | |||
1518 | &rx_ring->rx_buff_pool_logic, | 1514 | &rx_ring->rx_buff_pool_logic, |
1519 | GFP_KERNEL); | 1515 | GFP_KERNEL); |
1520 | if (!rx_ring->rx_buff_pool) { | 1516 | if (!rx_ring->rx_buff_pool) { |
1521 | pr_err("Unable to allocate memory for the receive poll buffer\n"); | 1517 | pr_err("Unable to allocate memory for the receive pool buffer\n"); |
1522 | return -ENOMEM; | 1518 | return -ENOMEM; |
1523 | } | 1519 | } |
1524 | memset(rx_ring->rx_buff_pool, 0, size); | 1520 | memset(rx_ring->rx_buff_pool, 0, size); |
@@ -1637,15 +1633,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter, | |||
1637 | pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", | 1633 | pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", |
1638 | cleaned_count); | 1634 | cleaned_count); |
1639 | /* Recover from running out of Tx resources in xmit_frame */ | 1635 | /* Recover from running out of Tx resources in xmit_frame */ |
1636 | spin_lock(&tx_ring->tx_lock); | ||
1640 | if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { | 1637 | if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { |
1641 | netif_wake_queue(adapter->netdev); | 1638 | netif_wake_queue(adapter->netdev); |
1642 | adapter->stats.tx_restart_count++; | 1639 | adapter->stats.tx_restart_count++; |
1643 | pr_debug("Tx wake queue\n"); | 1640 | pr_debug("Tx wake queue\n"); |
1644 | } | 1641 | } |
1645 | spin_lock(&adapter->tx_queue_lock); | 1642 | |
1646 | tx_ring->next_to_clean = i; | 1643 | tx_ring->next_to_clean = i; |
1647 | spin_unlock(&adapter->tx_queue_lock); | 1644 | |
1648 | pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); | 1645 | pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); |
1646 | spin_unlock(&tx_ring->tx_lock); | ||
1649 | return cleaned; | 1647 | return cleaned; |
1650 | } | 1648 | } |
1651 | 1649 | ||
@@ -2037,7 +2035,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter) | |||
2037 | return -ENOMEM; | 2035 | return -ENOMEM; |
2038 | } | 2036 | } |
2039 | spin_lock_init(&adapter->hw.miim_lock); | 2037 | spin_lock_init(&adapter->hw.miim_lock); |
2040 | spin_lock_init(&adapter->tx_queue_lock); | ||
2041 | spin_lock_init(&adapter->stats_lock); | 2038 | spin_lock_init(&adapter->stats_lock); |
2042 | spin_lock_init(&adapter->ethtool_lock); | 2039 | spin_lock_init(&adapter->ethtool_lock); |
2043 | atomic_set(&adapter->irq_sem, 0); | 2040 | atomic_set(&adapter->irq_sem, 0); |
@@ -2142,10 +2139,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2142 | tx_ring->next_to_use, tx_ring->next_to_clean); | 2139 | tx_ring->next_to_use, tx_ring->next_to_clean); |
2143 | return NETDEV_TX_BUSY; | 2140 | return NETDEV_TX_BUSY; |
2144 | } | 2141 | } |
2145 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | ||
2146 | 2142 | ||
2147 | /* CRC,ITAG no support */ | 2143 | /* CRC,ITAG no support */ |
2148 | pch_gbe_tx_queue(adapter, tx_ring, skb); | 2144 | pch_gbe_tx_queue(adapter, tx_ring, skb); |
2145 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | ||
2149 | return NETDEV_TX_OK; | 2146 | return NETDEV_TX_OK; |
2150 | } | 2147 | } |
2151 | 2148 | ||
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index f54509377efa..ce6b44d1f252 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -61,8 +61,12 @@ | |||
61 | #define R8169_MSG_DEFAULT \ | 61 | #define R8169_MSG_DEFAULT \ |
62 | (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) | 62 | (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) |
63 | 63 | ||
64 | #define TX_BUFFS_AVAIL(tp) \ | 64 | #define TX_SLOTS_AVAIL(tp) \ |
65 | (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) | 65 | (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx) |
66 | |||
67 | /* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */ | ||
68 | #define TX_FRAGS_READY_FOR(tp,nr_frags) \ | ||
69 | (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1)) | ||
66 | 70 | ||
67 | /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). | 71 | /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). |
68 | The RTL chips use a 64 element hash table based on the Ethernet CRC. */ | 72 | The RTL chips use a 64 element hash table based on the Ethernet CRC. */ |
@@ -5115,7 +5119,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5115 | u32 opts[2]; | 5119 | u32 opts[2]; |
5116 | int frags; | 5120 | int frags; |
5117 | 5121 | ||
5118 | if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { | 5122 | if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) { |
5119 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); | 5123 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); |
5120 | goto err_stop_0; | 5124 | goto err_stop_0; |
5121 | } | 5125 | } |
@@ -5169,7 +5173,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5169 | 5173 | ||
5170 | mmiowb(); | 5174 | mmiowb(); |
5171 | 5175 | ||
5172 | if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { | 5176 | if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { |
5173 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must | 5177 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must |
5174 | * not miss a ring update when it notices a stopped queue. | 5178 | * not miss a ring update when it notices a stopped queue. |
5175 | */ | 5179 | */ |
@@ -5183,7 +5187,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5183 | * can't. | 5187 | * can't. |
5184 | */ | 5188 | */ |
5185 | smp_mb(); | 5189 | smp_mb(); |
5186 | if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) | 5190 | if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) |
5187 | netif_wake_queue(dev); | 5191 | netif_wake_queue(dev); |
5188 | } | 5192 | } |
5189 | 5193 | ||
@@ -5306,7 +5310,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) | |||
5306 | */ | 5310 | */ |
5307 | smp_mb(); | 5311 | smp_mb(); |
5308 | if (netif_queue_stopped(dev) && | 5312 | if (netif_queue_stopped(dev) && |
5309 | (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { | 5313 | TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { |
5310 | netif_wake_queue(dev); | 5314 | netif_wake_queue(dev); |
5311 | } | 5315 | } |
5312 | /* | 5316 | /* |
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 3cbfbffe3f00..4a0005342e65 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -1349,7 +1349,7 @@ static int efx_probe_interrupts(struct efx_nic *efx) | |||
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | /* RSS might be usable on VFs even if it is disabled on the PF */ | 1351 | /* RSS might be usable on VFs even if it is disabled on the PF */ |
1352 | efx->rss_spread = (efx->n_rx_channels > 1 ? | 1352 | efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ? |
1353 | efx->n_rx_channels : efx_vf_size(efx)); | 1353 | efx->n_rx_channels : efx_vf_size(efx)); |
1354 | 1354 | ||
1355 | return 0; | 1355 | return 0; |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index f975afdc315c..025367a94add 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -259,7 +259,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
259 | 259 | ||
260 | xmit_world: | 260 | xmit_world: |
261 | skb->ip_summed = ip_summed; | 261 | skb->ip_summed = ip_summed; |
262 | skb_set_dev(skb, vlan->lowerdev); | 262 | skb->dev = vlan->lowerdev; |
263 | return dev_queue_xmit(skb); | 263 | return dev_queue_xmit(skb); |
264 | } | 264 | } |
265 | 265 | ||
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 0427c6561c84..cb8fd5069dbe 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/etherdevice.h> | 1 | #include <linux/etherdevice.h> |
2 | #include <linux/if_macvlan.h> | 2 | #include <linux/if_macvlan.h> |
3 | #include <linux/if_vlan.h> | ||
3 | #include <linux/interrupt.h> | 4 | #include <linux/interrupt.h> |
4 | #include <linux/nsproxy.h> | 5 | #include <linux/nsproxy.h> |
5 | #include <linux/compat.h> | 6 | #include <linux/compat.h> |
@@ -759,6 +760,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
759 | struct macvlan_dev *vlan; | 760 | struct macvlan_dev *vlan; |
760 | int ret; | 761 | int ret; |
761 | int vnet_hdr_len = 0; | 762 | int vnet_hdr_len = 0; |
763 | int vlan_offset = 0; | ||
764 | int copied; | ||
762 | 765 | ||
763 | if (q->flags & IFF_VNET_HDR) { | 766 | if (q->flags & IFF_VNET_HDR) { |
764 | struct virtio_net_hdr vnet_hdr; | 767 | struct virtio_net_hdr vnet_hdr; |
@@ -773,18 +776,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
773 | if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) | 776 | if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) |
774 | return -EFAULT; | 777 | return -EFAULT; |
775 | } | 778 | } |
779 | copied = vnet_hdr_len; | ||
780 | |||
781 | if (!vlan_tx_tag_present(skb)) | ||
782 | len = min_t(int, skb->len, len); | ||
783 | else { | ||
784 | int copy; | ||
785 | struct { | ||
786 | __be16 h_vlan_proto; | ||
787 | __be16 h_vlan_TCI; | ||
788 | } veth; | ||
789 | veth.h_vlan_proto = htons(ETH_P_8021Q); | ||
790 | veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb)); | ||
791 | |||
792 | vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto); | ||
793 | len = min_t(int, skb->len + VLAN_HLEN, len); | ||
794 | |||
795 | copy = min_t(int, vlan_offset, len); | ||
796 | ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy); | ||
797 | len -= copy; | ||
798 | copied += copy; | ||
799 | if (ret || !len) | ||
800 | goto done; | ||
801 | |||
802 | copy = min_t(int, sizeof(veth), len); | ||
803 | ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy); | ||
804 | len -= copy; | ||
805 | copied += copy; | ||
806 | if (ret || !len) | ||
807 | goto done; | ||
808 | } | ||
776 | 809 | ||
777 | len = min_t(int, skb->len, len); | 810 | ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len); |
778 | 811 | copied += len; | |
779 | ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len); | ||
780 | 812 | ||
813 | done: | ||
781 | rcu_read_lock_bh(); | 814 | rcu_read_lock_bh(); |
782 | vlan = rcu_dereference_bh(q->vlan); | 815 | vlan = rcu_dereference_bh(q->vlan); |
783 | if (vlan) | 816 | if (vlan) |
784 | macvlan_count_rx(vlan, len, ret == 0, 0); | 817 | macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0); |
785 | rcu_read_unlock_bh(); | 818 | rcu_read_unlock_bh(); |
786 | 819 | ||
787 | return ret ? ret : (len + vnet_hdr_len); | 820 | return ret ? ret : copied; |
788 | } | 821 | } |
789 | 822 | ||
790 | static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, | 823 | static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 90a30026a931..425e201f597c 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -83,6 +83,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
83 | struct cdc_state *info = (void *) &dev->data; | 83 | struct cdc_state *info = (void *) &dev->data; |
84 | int status; | 84 | int status; |
85 | int rndis; | 85 | int rndis; |
86 | bool android_rndis_quirk = false; | ||
86 | struct usb_driver *driver = driver_of(intf); | 87 | struct usb_driver *driver = driver_of(intf); |
87 | struct usb_cdc_mdlm_desc *desc = NULL; | 88 | struct usb_cdc_mdlm_desc *desc = NULL; |
88 | struct usb_cdc_mdlm_detail_desc *detail = NULL; | 89 | struct usb_cdc_mdlm_detail_desc *detail = NULL; |
@@ -195,6 +196,11 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
195 | info->control, | 196 | info->control, |
196 | info->u->bSlaveInterface0, | 197 | info->u->bSlaveInterface0, |
197 | info->data); | 198 | info->data); |
199 | /* fall back to hard-wiring for RNDIS */ | ||
200 | if (rndis) { | ||
201 | android_rndis_quirk = true; | ||
202 | goto next_desc; | ||
203 | } | ||
198 | goto bad_desc; | 204 | goto bad_desc; |
199 | } | 205 | } |
200 | if (info->control != intf) { | 206 | if (info->control != intf) { |
@@ -271,11 +277,15 @@ next_desc: | |||
271 | /* Microsoft ActiveSync based and some regular RNDIS devices lack the | 277 | /* Microsoft ActiveSync based and some regular RNDIS devices lack the |
272 | * CDC descriptors, so we'll hard-wire the interfaces and not check | 278 | * CDC descriptors, so we'll hard-wire the interfaces and not check |
273 | * for descriptors. | 279 | * for descriptors. |
280 | * | ||
281 | * Some Android RNDIS devices have a CDC Union descriptor pointing | ||
282 | * to non-existing interfaces. Ignore that and attempt the same | ||
283 | * hard-wired 0 and 1 interfaces. | ||
274 | */ | 284 | */ |
275 | if (rndis && !info->u) { | 285 | if (rndis && (!info->u || android_rndis_quirk)) { |
276 | info->control = usb_ifnum_to_if(dev->udev, 0); | 286 | info->control = usb_ifnum_to_if(dev->udev, 0); |
277 | info->data = usb_ifnum_to_if(dev->udev, 1); | 287 | info->data = usb_ifnum_to_if(dev->udev, 1); |
278 | if (!info->control || !info->data) { | 288 | if (!info->control || !info->data || info->control != intf) { |
279 | dev_dbg(&intf->dev, | 289 | dev_dbg(&intf->dev, |
280 | "rndis: master #0/%p slave #1/%p\n", | 290 | "rndis: master #0/%p slave #1/%p\n", |
281 | info->control, | 291 | info->control, |
@@ -475,6 +485,7 @@ static const struct driver_info wwan_info = { | |||
475 | /*-------------------------------------------------------------------------*/ | 485 | /*-------------------------------------------------------------------------*/ |
476 | 486 | ||
477 | #define HUAWEI_VENDOR_ID 0x12D1 | 487 | #define HUAWEI_VENDOR_ID 0x12D1 |
488 | #define NOVATEL_VENDOR_ID 0x1410 | ||
478 | 489 | ||
479 | static const struct usb_device_id products [] = { | 490 | static const struct usb_device_id products [] = { |
480 | /* | 491 | /* |
@@ -592,6 +603,21 @@ static const struct usb_device_id products [] = { | |||
592 | * because of bugs/quirks in a given product (like Zaurus, above). | 603 | * because of bugs/quirks in a given product (like Zaurus, above). |
593 | */ | 604 | */ |
594 | { | 605 | { |
606 | /* Novatel USB551L */ | ||
607 | /* This match must come *before* the generic CDC-ETHER match so that | ||
608 | * we get FLAG_WWAN set on the device, since it's descriptors are | ||
609 | * generic CDC-ETHER. | ||
610 | */ | ||
611 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | ||
612 | | USB_DEVICE_ID_MATCH_PRODUCT | ||
613 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
614 | .idVendor = NOVATEL_VENDOR_ID, | ||
615 | .idProduct = 0xB001, | ||
616 | .bInterfaceClass = USB_CLASS_COMM, | ||
617 | .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, | ||
618 | .bInterfaceProtocol = USB_CDC_PROTO_NONE, | ||
619 | .driver_info = (unsigned long)&wwan_info, | ||
620 | }, { | ||
595 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, | 621 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, |
596 | USB_CDC_PROTO_NONE), | 622 | USB_CDC_PROTO_NONE), |
597 | .driver_info = (unsigned long) &cdc_info, | 623 | .driver_info = (unsigned long) &cdc_info, |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 2d927fb4adf4..b38db48b1ce0 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -282,17 +282,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu) | |||
282 | } | 282 | } |
283 | EXPORT_SYMBOL_GPL(usbnet_change_mtu); | 283 | EXPORT_SYMBOL_GPL(usbnet_change_mtu); |
284 | 284 | ||
285 | /* The caller must hold list->lock */ | ||
286 | static void __usbnet_queue_skb(struct sk_buff_head *list, | ||
287 | struct sk_buff *newsk, enum skb_state state) | ||
288 | { | ||
289 | struct skb_data *entry = (struct skb_data *) newsk->cb; | ||
290 | |||
291 | __skb_queue_tail(list, newsk); | ||
292 | entry->state = state; | ||
293 | } | ||
294 | |||
285 | /*-------------------------------------------------------------------------*/ | 295 | /*-------------------------------------------------------------------------*/ |
286 | 296 | ||
287 | /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from | 297 | /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from |
288 | * completion callbacks. 2.5 should have fixed those bugs... | 298 | * completion callbacks. 2.5 should have fixed those bugs... |
289 | */ | 299 | */ |
290 | 300 | ||
291 | static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list) | 301 | static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb, |
302 | struct sk_buff_head *list, enum skb_state state) | ||
292 | { | 303 | { |
293 | unsigned long flags; | 304 | unsigned long flags; |
305 | enum skb_state old_state; | ||
306 | struct skb_data *entry = (struct skb_data *) skb->cb; | ||
294 | 307 | ||
295 | spin_lock_irqsave(&list->lock, flags); | 308 | spin_lock_irqsave(&list->lock, flags); |
309 | old_state = entry->state; | ||
310 | entry->state = state; | ||
296 | __skb_unlink(skb, list); | 311 | __skb_unlink(skb, list); |
297 | spin_unlock(&list->lock); | 312 | spin_unlock(&list->lock); |
298 | spin_lock(&dev->done.lock); | 313 | spin_lock(&dev->done.lock); |
@@ -300,6 +315,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea | |||
300 | if (dev->done.qlen == 1) | 315 | if (dev->done.qlen == 1) |
301 | tasklet_schedule(&dev->bh); | 316 | tasklet_schedule(&dev->bh); |
302 | spin_unlock_irqrestore(&dev->done.lock, flags); | 317 | spin_unlock_irqrestore(&dev->done.lock, flags); |
318 | return old_state; | ||
303 | } | 319 | } |
304 | 320 | ||
305 | /* some work can't be done in tasklets, so we use keventd | 321 | /* some work can't be done in tasklets, so we use keventd |
@@ -340,7 +356,6 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
340 | entry = (struct skb_data *) skb->cb; | 356 | entry = (struct skb_data *) skb->cb; |
341 | entry->urb = urb; | 357 | entry->urb = urb; |
342 | entry->dev = dev; | 358 | entry->dev = dev; |
343 | entry->state = rx_start; | ||
344 | entry->length = 0; | 359 | entry->length = 0; |
345 | 360 | ||
346 | usb_fill_bulk_urb (urb, dev->udev, dev->in, | 361 | usb_fill_bulk_urb (urb, dev->udev, dev->in, |
@@ -372,7 +387,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
372 | tasklet_schedule (&dev->bh); | 387 | tasklet_schedule (&dev->bh); |
373 | break; | 388 | break; |
374 | case 0: | 389 | case 0: |
375 | __skb_queue_tail (&dev->rxq, skb); | 390 | __usbnet_queue_skb(&dev->rxq, skb, rx_start); |
376 | } | 391 | } |
377 | } else { | 392 | } else { |
378 | netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); | 393 | netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); |
@@ -423,16 +438,17 @@ static void rx_complete (struct urb *urb) | |||
423 | struct skb_data *entry = (struct skb_data *) skb->cb; | 438 | struct skb_data *entry = (struct skb_data *) skb->cb; |
424 | struct usbnet *dev = entry->dev; | 439 | struct usbnet *dev = entry->dev; |
425 | int urb_status = urb->status; | 440 | int urb_status = urb->status; |
441 | enum skb_state state; | ||
426 | 442 | ||
427 | skb_put (skb, urb->actual_length); | 443 | skb_put (skb, urb->actual_length); |
428 | entry->state = rx_done; | 444 | state = rx_done; |
429 | entry->urb = NULL; | 445 | entry->urb = NULL; |
430 | 446 | ||
431 | switch (urb_status) { | 447 | switch (urb_status) { |
432 | /* success */ | 448 | /* success */ |
433 | case 0: | 449 | case 0: |
434 | if (skb->len < dev->net->hard_header_len) { | 450 | if (skb->len < dev->net->hard_header_len) { |
435 | entry->state = rx_cleanup; | 451 | state = rx_cleanup; |
436 | dev->net->stats.rx_errors++; | 452 | dev->net->stats.rx_errors++; |
437 | dev->net->stats.rx_length_errors++; | 453 | dev->net->stats.rx_length_errors++; |
438 | netif_dbg(dev, rx_err, dev->net, | 454 | netif_dbg(dev, rx_err, dev->net, |
@@ -471,7 +487,7 @@ static void rx_complete (struct urb *urb) | |||
471 | "rx throttle %d\n", urb_status); | 487 | "rx throttle %d\n", urb_status); |
472 | } | 488 | } |
473 | block: | 489 | block: |
474 | entry->state = rx_cleanup; | 490 | state = rx_cleanup; |
475 | entry->urb = urb; | 491 | entry->urb = urb; |
476 | urb = NULL; | 492 | urb = NULL; |
477 | break; | 493 | break; |
@@ -482,17 +498,18 @@ block: | |||
482 | // FALLTHROUGH | 498 | // FALLTHROUGH |
483 | 499 | ||
484 | default: | 500 | default: |
485 | entry->state = rx_cleanup; | 501 | state = rx_cleanup; |
486 | dev->net->stats.rx_errors++; | 502 | dev->net->stats.rx_errors++; |
487 | netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); | 503 | netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); |
488 | break; | 504 | break; |
489 | } | 505 | } |
490 | 506 | ||
491 | defer_bh(dev, skb, &dev->rxq); | 507 | state = defer_bh(dev, skb, &dev->rxq, state); |
492 | 508 | ||
493 | if (urb) { | 509 | if (urb) { |
494 | if (netif_running (dev->net) && | 510 | if (netif_running (dev->net) && |
495 | !test_bit (EVENT_RX_HALT, &dev->flags)) { | 511 | !test_bit (EVENT_RX_HALT, &dev->flags) && |
512 | state != unlink_start) { | ||
496 | rx_submit (dev, urb, GFP_ATOMIC); | 513 | rx_submit (dev, urb, GFP_ATOMIC); |
497 | usb_mark_last_busy(dev->udev); | 514 | usb_mark_last_busy(dev->udev); |
498 | return; | 515 | return; |
@@ -579,16 +596,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq); | |||
579 | static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) | 596 | static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) |
580 | { | 597 | { |
581 | unsigned long flags; | 598 | unsigned long flags; |
582 | struct sk_buff *skb, *skbnext; | 599 | struct sk_buff *skb; |
583 | int count = 0; | 600 | int count = 0; |
584 | 601 | ||
585 | spin_lock_irqsave (&q->lock, flags); | 602 | spin_lock_irqsave (&q->lock, flags); |
586 | skb_queue_walk_safe(q, skb, skbnext) { | 603 | while (!skb_queue_empty(q)) { |
587 | struct skb_data *entry; | 604 | struct skb_data *entry; |
588 | struct urb *urb; | 605 | struct urb *urb; |
589 | int retval; | 606 | int retval; |
590 | 607 | ||
591 | entry = (struct skb_data *) skb->cb; | 608 | skb_queue_walk(q, skb) { |
609 | entry = (struct skb_data *) skb->cb; | ||
610 | if (entry->state != unlink_start) | ||
611 | goto found; | ||
612 | } | ||
613 | break; | ||
614 | found: | ||
615 | entry->state = unlink_start; | ||
592 | urb = entry->urb; | 616 | urb = entry->urb; |
593 | 617 | ||
594 | /* | 618 | /* |
@@ -1039,8 +1063,7 @@ static void tx_complete (struct urb *urb) | |||
1039 | } | 1063 | } |
1040 | 1064 | ||
1041 | usb_autopm_put_interface_async(dev->intf); | 1065 | usb_autopm_put_interface_async(dev->intf); |
1042 | entry->state = tx_done; | 1066 | (void) defer_bh(dev, skb, &dev->txq, tx_done); |
1043 | defer_bh(dev, skb, &dev->txq); | ||
1044 | } | 1067 | } |
1045 | 1068 | ||
1046 | /*-------------------------------------------------------------------------*/ | 1069 | /*-------------------------------------------------------------------------*/ |
@@ -1096,7 +1119,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1096 | entry = (struct skb_data *) skb->cb; | 1119 | entry = (struct skb_data *) skb->cb; |
1097 | entry->urb = urb; | 1120 | entry->urb = urb; |
1098 | entry->dev = dev; | 1121 | entry->dev = dev; |
1099 | entry->state = tx_start; | ||
1100 | entry->length = length; | 1122 | entry->length = length; |
1101 | 1123 | ||
1102 | usb_fill_bulk_urb (urb, dev->udev, dev->out, | 1124 | usb_fill_bulk_urb (urb, dev->udev, dev->out, |
@@ -1155,7 +1177,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1155 | break; | 1177 | break; |
1156 | case 0: | 1178 | case 0: |
1157 | net->trans_start = jiffies; | 1179 | net->trans_start = jiffies; |
1158 | __skb_queue_tail (&dev->txq, skb); | 1180 | __usbnet_queue_skb(&dev->txq, skb, tx_start); |
1159 | if (dev->txq.qlen >= TX_QLEN (dev)) | 1181 | if (dev->txq.qlen >= TX_QLEN (dev)) |
1160 | netif_stop_queue (net); | 1182 | netif_stop_queue (net); |
1161 | } | 1183 | } |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index af8acc85f4bb..cbefe671bcc6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -492,7 +492,9 @@ static void virtnet_napi_enable(struct virtnet_info *vi) | |||
492 | * We synchronize against interrupts via NAPI_STATE_SCHED */ | 492 | * We synchronize against interrupts via NAPI_STATE_SCHED */ |
493 | if (napi_schedule_prep(&vi->napi)) { | 493 | if (napi_schedule_prep(&vi->napi)) { |
494 | virtqueue_disable_cb(vi->rvq); | 494 | virtqueue_disable_cb(vi->rvq); |
495 | local_bh_disable(); | ||
495 | __napi_schedule(&vi->napi); | 496 | __napi_schedule(&vi->napi); |
497 | local_bh_enable(); | ||
496 | } | 498 | } |
497 | } | 499 | } |
498 | 500 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index deb6cfb2959a..600aca9fe6b1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -373,7 +373,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | |||
373 | else | 373 | else |
374 | spur_subchannel_sd = 0; | 374 | spur_subchannel_sd = 0; |
375 | 375 | ||
376 | spur_freq_sd = (freq_offset << 9) / 11; | 376 | spur_freq_sd = ((freq_offset + 10) << 9) / 11; |
377 | 377 | ||
378 | } else { | 378 | } else { |
379 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, | 379 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, |
@@ -382,7 +382,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | |||
382 | else | 382 | else |
383 | spur_subchannel_sd = 1; | 383 | spur_subchannel_sd = 1; |
384 | 384 | ||
385 | spur_freq_sd = (freq_offset << 9) / 11; | 385 | spur_freq_sd = ((freq_offset - 10) << 9) / 11; |
386 | 386 | ||
387 | } | 387 | } |
388 | 388 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index eb3829b03cd3..e2b34e1563f4 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -2637,6 +2637,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data) | |||
2637 | /* after stopping the bus, exit thread */ | 2637 | /* after stopping the bus, exit thread */ |
2638 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); | 2638 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); |
2639 | bus->dpc_tsk = NULL; | 2639 | bus->dpc_tsk = NULL; |
2640 | spin_lock_irqsave(&bus->dpc_tl_lock, flags); | ||
2640 | break; | 2641 | break; |
2641 | } | 2642 | } |
2642 | 2643 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index f4b84d1596e3..22474608a70b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
773 | struct sk_buff *skb; | 773 | struct sk_buff *skb; |
774 | __le16 fc = hdr->frame_control; | 774 | __le16 fc = hdr->frame_control; |
775 | struct iwl_rxon_context *ctx; | 775 | struct iwl_rxon_context *ctx; |
776 | struct page *p; | 776 | unsigned int hdrlen, fraglen; |
777 | int offset; | ||
778 | 777 | ||
779 | /* We only process data packets if the interface is open */ | 778 | /* We only process data packets if the interface is open */ |
780 | if (unlikely(!priv->is_open)) { | 779 | if (unlikely(!priv->is_open)) { |
@@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
788 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) | 787 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) |
789 | return; | 788 | return; |
790 | 789 | ||
791 | skb = dev_alloc_skb(128); | 790 | /* Dont use dev_alloc_skb(), we'll have enough headroom once |
791 | * ieee80211_hdr pulled. | ||
792 | */ | ||
793 | skb = alloc_skb(128, GFP_ATOMIC); | ||
792 | if (!skb) { | 794 | if (!skb) { |
793 | IWL_ERR(priv, "dev_alloc_skb failed\n"); | 795 | IWL_ERR(priv, "alloc_skb failed\n"); |
794 | return; | 796 | return; |
795 | } | 797 | } |
798 | hdrlen = min_t(unsigned int, len, skb_tailroom(skb)); | ||
799 | memcpy(skb_put(skb, hdrlen), hdr, hdrlen); | ||
800 | fraglen = len - hdrlen; | ||
796 | 801 | ||
797 | offset = (void *)hdr - rxb_addr(rxb); | 802 | if (fraglen) { |
798 | p = rxb_steal_page(rxb); | 803 | int offset = (void *)hdr + hdrlen - rxb_addr(rxb); |
799 | skb_add_rx_frag(skb, 0, p, offset, len, len); | ||
800 | 804 | ||
805 | skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset, | ||
806 | fraglen, rxb->truesize); | ||
807 | } | ||
801 | iwl_update_stats(priv, false, fc, len); | 808 | iwl_update_stats(priv, false, fc, len); |
802 | 809 | ||
803 | /* | 810 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index 8b1a7988e176..aa7aea168138 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -374,8 +374,9 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans, | |||
374 | if (WARN_ON(!rxb)) | 374 | if (WARN_ON(!rxb)) |
375 | return; | 375 | return; |
376 | 376 | ||
377 | rxcb.truesize = PAGE_SIZE << hw_params(trans).rx_page_order; | ||
377 | dma_unmap_page(trans->dev, rxb->page_dma, | 378 | dma_unmap_page(trans->dev, rxb->page_dma, |
378 | PAGE_SIZE << hw_params(trans).rx_page_order, | 379 | rxcb.truesize, |
379 | DMA_FROM_DEVICE); | 380 | DMA_FROM_DEVICE); |
380 | 381 | ||
381 | rxcb._page = rxb->page; | 382 | rxcb._page = rxb->page; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 0c81cbaa8088..fdf97886a5e4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -260,6 +260,7 @@ static inline void iwl_free_resp(struct iwl_host_cmd *cmd) | |||
260 | 260 | ||
261 | struct iwl_rx_cmd_buffer { | 261 | struct iwl_rx_cmd_buffer { |
262 | struct page *_page; | 262 | struct page *_page; |
263 | unsigned int truesize; | ||
263 | }; | 264 | }; |
264 | 265 | ||
265 | static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) | 266 | static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index cc15fdb36060..67f9430ee197 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1851,14 +1851,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1851 | /*like read eeprom and so on */ | 1851 | /*like read eeprom and so on */ |
1852 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 1852 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
1853 | 1853 | ||
1854 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
1855 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
1856 | err = -ENODEV; | ||
1857 | goto fail3; | ||
1858 | } | ||
1859 | |||
1860 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
1861 | |||
1862 | /*aspm */ | 1854 | /*aspm */ |
1863 | rtl_pci_init_aspm(hw); | 1855 | rtl_pci_init_aspm(hw); |
1864 | 1856 | ||
@@ -1877,6 +1869,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1877 | goto fail3; | 1869 | goto fail3; |
1878 | } | 1870 | } |
1879 | 1871 | ||
1872 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
1873 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
1874 | err = -ENODEV; | ||
1875 | goto fail3; | ||
1876 | } | ||
1877 | |||
1878 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
1879 | |||
1880 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); | 1880 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); |
1881 | if (err) { | 1881 | if (err) { |
1882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index d04dbda13f5a..a6049d7d51b3 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
971 | rtlpriv->cfg->ops->read_chip_version(hw); | 971 | rtlpriv->cfg->ops->read_chip_version(hw); |
972 | /*like read eeprom and so on */ | 972 | /*like read eeprom and so on */ |
973 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 973 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
974 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
975 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
976 | goto error_out; | ||
977 | } | ||
978 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
979 | err = _rtl_usb_init(hw); | 974 | err = _rtl_usb_init(hw); |
980 | if (err) | 975 | if (err) |
981 | goto error_out; | 976 | goto error_out; |
@@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
987 | "Can't allocate sw for mac80211\n"); | 982 | "Can't allocate sw for mac80211\n"); |
988 | goto error_out; | 983 | goto error_out; |
989 | } | 984 | } |
985 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
986 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
987 | goto error_out; | ||
988 | } | ||
989 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
990 | 990 | ||
991 | return 0; | 991 | return 0; |
992 | error_out: | 992 | error_out: |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 8644d5372e7f..42cfcd9eb9aa 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/ropes.h> | 44 | #include <asm/ropes.h> |
45 | #include <asm/mckinley.h> /* for proc_mckinley_root */ | 45 | #include <asm/mckinley.h> /* for proc_mckinley_root */ |
46 | #include <asm/runway.h> /* for proc_runway_root */ | 46 | #include <asm/runway.h> /* for proc_runway_root */ |
47 | #include <asm/page.h> /* for PAGE0 */ | ||
47 | #include <asm/pdc.h> /* for PDC_MODEL_* */ | 48 | #include <asm/pdc.h> /* for PDC_MODEL_* */ |
48 | #include <asm/pdcpat.h> /* for is_pdc_pat() */ | 49 | #include <asm/pdcpat.h> /* for is_pdc_pat() */ |
49 | #include <asm/parisc-device.h> | 50 | #include <asm/parisc-device.h> |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 1929c0c63b75..61e2fefeedab 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
223 | [PCI_D0] = ACPI_STATE_D0, | 223 | [PCI_D0] = ACPI_STATE_D0, |
224 | [PCI_D1] = ACPI_STATE_D1, | 224 | [PCI_D1] = ACPI_STATE_D1, |
225 | [PCI_D2] = ACPI_STATE_D2, | 225 | [PCI_D2] = ACPI_STATE_D2, |
226 | [PCI_D3hot] = ACPI_STATE_D3_HOT, | 226 | [PCI_D3hot] = ACPI_STATE_D3, |
227 | [PCI_D3cold] = ACPI_STATE_D3 | 227 | [PCI_D3cold] = ACPI_STATE_D3 |
228 | }; | 228 | }; |
229 | int error = -EINVAL; | 229 | int error = -EINVAL; |
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c index 375eb04c16ea..6fff68020488 100644 --- a/drivers/ptp/ptp_pch.c +++ b/drivers/ptp/ptp_pch.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/ptp_clock_kernel.h> | 32 | #include <linux/ptp_clock_kernel.h> |
33 | #include <linux/slab.h> | ||
33 | 34 | ||
34 | #define STATION_ADDR_LEN 20 | 35 | #define STATION_ADDR_LEN 20 |
35 | #define PCI_DEVICE_ID_PCH_1588 0x8819 | 36 | #define PCI_DEVICE_ID_PCH_1588 0x8819 |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ee15c68fb519..e756a0df3664 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i) | |||
354 | { | 354 | { |
355 | struct rproc *rproc = rvdev->rproc; | 355 | struct rproc *rproc = rvdev->rproc; |
356 | 356 | ||
357 | for (i--; i > 0; i--) { | 357 | for (i--; i >= 0; i--) { |
358 | struct rproc_vring *rvring = &rvdev->vring[i]; | 358 | struct rproc_vring *rvring = &rvdev->vring[i]; |
359 | int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); | 359 | int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); |
360 | 360 | ||
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 351dc0b86fab..a3a056a9db67 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, | |||
218 | 218 | ||
219 | if (!shost->shost_gendev.parent) | 219 | if (!shost->shost_gendev.parent) |
220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; | 220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; |
221 | if (!dma_dev) | ||
222 | dma_dev = shost->shost_gendev.parent; | ||
223 | |||
221 | shost->dma_dev = dma_dev; | 224 | shost->dma_dev = dma_dev; |
222 | 225 | ||
223 | error = device_add(&shost->shost_gendev); | 226 | error = device_add(&shost->shost_gendev); |
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index f74cc0602f3b..bc3cc6d91117 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -1367,6 +1367,9 @@ qla2x00_read_optrom(struct fc_bsg_job *bsg_job) | |||
1367 | struct qla_hw_data *ha = vha->hw; | 1367 | struct qla_hw_data *ha = vha->hw; |
1368 | int rval = 0; | 1368 | int rval = 0; |
1369 | 1369 | ||
1370 | if (ha->flags.isp82xx_reset_hdlr_active) | ||
1371 | return -EBUSY; | ||
1372 | |||
1370 | rval = qla2x00_optrom_setup(bsg_job, vha, 0); | 1373 | rval = qla2x00_optrom_setup(bsg_job, vha, 0); |
1371 | if (rval) | 1374 | if (rval) |
1372 | return rval; | 1375 | return rval; |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 897731b93df2..62324a1d5573 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * | Mailbox commands | 0x113e | 0x112c-0x112e | | 15 | * | Mailbox commands | 0x113e | 0x112c-0x112e | |
16 | * | | | 0x113a | | 16 | * | | | 0x113a | |
17 | * | Device Discovery | 0x2086 | 0x2020-0x2022 | | 17 | * | Device Discovery | 0x2086 | 0x2020-0x2022 | |
18 | * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | | 18 | * | Queue Command and IO tracing | 0x3030 | 0x3006,0x3008 | |
19 | * | | | 0x302d-0x302e | | 19 | * | | | 0x302d-0x302e | |
20 | * | DPC Thread | 0x401c | | | 20 | * | DPC Thread | 0x401c | | |
21 | * | Async Events | 0x505d | 0x502b-0x502f | | 21 | * | Async Events | 0x505d | 0x502b-0x502f | |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f79844ce7122..ce42288049b5 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -1715,13 +1715,24 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
1715 | res = DID_ERROR << 16; | 1715 | res = DID_ERROR << 16; |
1716 | break; | 1716 | break; |
1717 | } | 1717 | } |
1718 | } else { | 1718 | } else if (lscsi_status != SAM_STAT_TASK_SET_FULL && |
1719 | lscsi_status != SAM_STAT_BUSY) { | ||
1720 | /* | ||
1721 | * scsi status of task set and busy are considered to be | ||
1722 | * task not completed. | ||
1723 | */ | ||
1724 | |||
1719 | ql_dbg(ql_dbg_io, fcport->vha, 0x301f, | 1725 | ql_dbg(ql_dbg_io, fcport->vha, 0x301f, |
1720 | "Dropped frame(s) detected (0x%x " | 1726 | "Dropped frame(s) detected (0x%x " |
1721 | "of 0x%x bytes).\n", resid, scsi_bufflen(cp)); | 1727 | "of 0x%x bytes).\n", resid, |
1728 | scsi_bufflen(cp)); | ||
1722 | 1729 | ||
1723 | res = DID_ERROR << 16 | lscsi_status; | 1730 | res = DID_ERROR << 16 | lscsi_status; |
1724 | goto check_scsi_status; | 1731 | goto check_scsi_status; |
1732 | } else { | ||
1733 | ql_dbg(ql_dbg_io, fcport->vha, 0x3030, | ||
1734 | "scsi_status: 0x%x, lscsi_status: 0x%x\n", | ||
1735 | scsi_status, lscsi_status); | ||
1725 | } | 1736 | } |
1726 | 1737 | ||
1727 | res = DID_OK << 16 | lscsi_status; | 1738 | res = DID_OK << 16 | lscsi_status; |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index f0528539bbbc..de722a933438 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -3125,6 +3125,7 @@ qla82xx_need_reset_handler(scsi_qla_host_t *vha) | |||
3125 | ql_log(ql_log_info, vha, 0x00b7, | 3125 | ql_log(ql_log_info, vha, 0x00b7, |
3126 | "HW State: COLD/RE-INIT.\n"); | 3126 | "HW State: COLD/RE-INIT.\n"); |
3127 | qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); | 3127 | qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); |
3128 | qla82xx_set_rst_ready(ha); | ||
3128 | if (ql2xmdenable) { | 3129 | if (ql2xmdenable) { |
3129 | if (qla82xx_md_collect(vha)) | 3130 | if (qla82xx_md_collect(vha)) |
3130 | ql_log(ql_log_warn, vha, 0xb02c, | 3131 | ql_log(ql_log_warn, vha, 0xb02c, |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a2f999273a5f..7db803377c64 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -3577,9 +3577,25 @@ void qla2x00_relogin(struct scsi_qla_host *vha) | |||
3577 | continue; | 3577 | continue; |
3578 | /* Attempt a retry. */ | 3578 | /* Attempt a retry. */ |
3579 | status = 1; | 3579 | status = 1; |
3580 | } else | 3580 | } else { |
3581 | status = qla2x00_fabric_login(vha, | 3581 | status = qla2x00_fabric_login(vha, |
3582 | fcport, &next_loopid); | 3582 | fcport, &next_loopid); |
3583 | if (status == QLA_SUCCESS) { | ||
3584 | int status2; | ||
3585 | uint8_t opts; | ||
3586 | |||
3587 | opts = 0; | ||
3588 | if (fcport->flags & | ||
3589 | FCF_FCP2_DEVICE) | ||
3590 | opts |= BIT_1; | ||
3591 | status2 = | ||
3592 | qla2x00_get_port_database( | ||
3593 | vha, fcport, | ||
3594 | opts); | ||
3595 | if (status2 != QLA_SUCCESS) | ||
3596 | status = 1; | ||
3597 | } | ||
3598 | } | ||
3583 | } else | 3599 | } else |
3584 | status = qla2x00_local_device_login(vha, | 3600 | status = qla2x00_local_device_login(vha, |
3585 | fcport); | 3601 | fcport); |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 3c13c0a6be63..a683e766d1ae 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -1017,6 +1017,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) | |||
1017 | !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) | 1017 | !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) |
1018 | return; | 1018 | return; |
1019 | 1019 | ||
1020 | if (ha->flags.isp82xx_reset_hdlr_active) | ||
1021 | return; | ||
1022 | |||
1020 | ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, | 1023 | ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, |
1021 | ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); | 1024 | ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); |
1022 | if (hdr.version == __constant_cpu_to_le16(0xffff)) | 1025 | if (hdr.version == __constant_cpu_to_le16(0xffff)) |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 29d780c38040..f5fdb16bec9b 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
@@ -7,9 +7,9 @@ | |||
7 | /* | 7 | /* |
8 | * Driver version | 8 | * Driver version |
9 | */ | 9 | */ |
10 | #define QLA2XXX_VERSION "8.03.07.13-k" | 10 | #define QLA2XXX_VERSION "8.04.00.03-k" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 3 | 13 | #define QLA_DRIVER_MINOR_VER 4 |
14 | #define QLA_DRIVER_PATCH_VER 7 | 14 | #define QLA_DRIVER_PATCH_VER 0 |
15 | #define QLA_DRIVER_BETA_VER 3 | 15 | #define QLA_DRIVER_BETA_VER 3 |
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index efccd72c4a3e..1b3843117268 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c | |||
@@ -175,7 +175,8 @@ static void virtscsi_complete_free(void *buf) | |||
175 | 175 | ||
176 | if (cmd->comp) | 176 | if (cmd->comp) |
177 | complete_all(cmd->comp); | 177 | complete_all(cmd->comp); |
178 | mempool_free(cmd, virtscsi_cmd_pool); | 178 | else |
179 | mempool_free(cmd, virtscsi_cmd_pool); | ||
179 | } | 180 | } |
180 | 181 | ||
181 | static void virtscsi_ctrl_done(struct virtqueue *vq) | 182 | static void virtscsi_ctrl_done(struct virtqueue *vq) |
@@ -311,21 +312,22 @@ out: | |||
311 | static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) | 312 | static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) |
312 | { | 313 | { |
313 | DECLARE_COMPLETION_ONSTACK(comp); | 314 | DECLARE_COMPLETION_ONSTACK(comp); |
314 | int ret; | 315 | int ret = FAILED; |
315 | 316 | ||
316 | cmd->comp = ∁ | 317 | cmd->comp = ∁ |
317 | ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, | 318 | if (virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, |
318 | sizeof cmd->req.tmf, sizeof cmd->resp.tmf, | 319 | sizeof cmd->req.tmf, sizeof cmd->resp.tmf, |
319 | GFP_NOIO); | 320 | GFP_NOIO) < 0) |
320 | if (ret < 0) | 321 | goto out; |
321 | return FAILED; | ||
322 | 322 | ||
323 | wait_for_completion(&comp); | 323 | wait_for_completion(&comp); |
324 | if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK && | 324 | if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK || |
325 | cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) | 325 | cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) |
326 | return FAILED; | 326 | ret = SUCCESS; |
327 | 327 | ||
328 | return SUCCESS; | 328 | out: |
329 | mempool_free(cmd, virtscsi_cmd_pool); | ||
330 | return ret; | ||
329 | } | 331 | } |
330 | 332 | ||
331 | static int virtscsi_device_reset(struct scsi_cmnd *sc) | 333 | static int virtscsi_device_reset(struct scsi_cmnd *sc) |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 7ed58e2df791..f286955331a2 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -169,6 +169,7 @@ static struct se_device *fd_create_virtdevice( | |||
169 | inode = file->f_mapping->host; | 169 | inode = file->f_mapping->host; |
170 | if (S_ISBLK(inode->i_mode)) { | 170 | if (S_ISBLK(inode->i_mode)) { |
171 | struct request_queue *q; | 171 | struct request_queue *q; |
172 | unsigned long long dev_size; | ||
172 | /* | 173 | /* |
173 | * Setup the local scope queue_limits from struct request_queue->limits | 174 | * Setup the local scope queue_limits from struct request_queue->limits |
174 | * to pass into transport_add_device_to_core_hba() as struct se_dev_limits. | 175 | * to pass into transport_add_device_to_core_hba() as struct se_dev_limits. |
@@ -183,13 +184,12 @@ static struct se_device *fd_create_virtdevice( | |||
183 | * one (1) logical sector from underlying struct block_device | 184 | * one (1) logical sector from underlying struct block_device |
184 | */ | 185 | */ |
185 | fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); | 186 | fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); |
186 | fd_dev->fd_dev_size = (i_size_read(file->f_mapping->host) - | 187 | dev_size = (i_size_read(file->f_mapping->host) - |
187 | fd_dev->fd_block_size); | 188 | fd_dev->fd_block_size); |
188 | 189 | ||
189 | pr_debug("FILEIO: Using size: %llu bytes from struct" | 190 | pr_debug("FILEIO: Using size: %llu bytes from struct" |
190 | " block_device blocks: %llu logical_block_size: %d\n", | 191 | " block_device blocks: %llu logical_block_size: %d\n", |
191 | fd_dev->fd_dev_size, | 192 | dev_size, div_u64(dev_size, fd_dev->fd_block_size), |
192 | div_u64(fd_dev->fd_dev_size, fd_dev->fd_block_size), | ||
193 | fd_dev->fd_block_size); | 193 | fd_dev->fd_block_size); |
194 | } else { | 194 | } else { |
195 | if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { | 195 | if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { |
@@ -605,10 +605,20 @@ static u32 fd_get_device_type(struct se_device *dev) | |||
605 | static sector_t fd_get_blocks(struct se_device *dev) | 605 | static sector_t fd_get_blocks(struct se_device *dev) |
606 | { | 606 | { |
607 | struct fd_dev *fd_dev = dev->dev_ptr; | 607 | struct fd_dev *fd_dev = dev->dev_ptr; |
608 | unsigned long long blocks_long = div_u64(fd_dev->fd_dev_size, | 608 | struct file *f = fd_dev->fd_file; |
609 | dev->se_sub_dev->se_dev_attrib.block_size); | 609 | struct inode *i = f->f_mapping->host; |
610 | unsigned long long dev_size; | ||
611 | /* | ||
612 | * When using a file that references an underlying struct block_device, | ||
613 | * ensure dev_size is always based on the current inode size in order | ||
614 | * to handle underlying block_device resize operations. | ||
615 | */ | ||
616 | if (S_ISBLK(i->i_mode)) | ||
617 | dev_size = (i_size_read(i) - fd_dev->fd_block_size); | ||
618 | else | ||
619 | dev_size = fd_dev->fd_dev_size; | ||
610 | 620 | ||
611 | return blocks_long; | 621 | return div_u64(dev_size, dev->se_sub_dev->se_dev_attrib.block_size); |
612 | } | 622 | } |
613 | 623 | ||
614 | static struct se_subsystem_api fileio_template = { | 624 | static struct se_subsystem_api fileio_template = { |
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 86f0c3b5d500..c3148b10b4b3 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -220,6 +220,9 @@ int target_scsi2_reservation_release(struct se_task *task) | |||
220 | if (dev->dev_reserved_node_acl != sess->se_node_acl) | 220 | if (dev->dev_reserved_node_acl != sess->se_node_acl) |
221 | goto out_unlock; | 221 | goto out_unlock; |
222 | 222 | ||
223 | if (dev->dev_res_bin_isid != sess->sess_bin_isid) | ||
224 | goto out_unlock; | ||
225 | |||
223 | dev->dev_reserved_node_acl = NULL; | 226 | dev->dev_reserved_node_acl = NULL; |
224 | dev->dev_flags &= ~DF_SPC2_RESERVATIONS; | 227 | dev->dev_flags &= ~DF_SPC2_RESERVATIONS; |
225 | if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) { | 228 | if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) { |
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 70c3ffb981e7..e320ec24aa1b 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -60,7 +60,6 @@ static void core_clear_initiator_node_from_tpg( | |||
60 | int i; | 60 | int i; |
61 | struct se_dev_entry *deve; | 61 | struct se_dev_entry *deve; |
62 | struct se_lun *lun; | 62 | struct se_lun *lun; |
63 | struct se_lun_acl *acl, *acl_tmp; | ||
64 | 63 | ||
65 | spin_lock_irq(&nacl->device_list_lock); | 64 | spin_lock_irq(&nacl->device_list_lock); |
66 | for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { | 65 | for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { |
@@ -81,28 +80,7 @@ static void core_clear_initiator_node_from_tpg( | |||
81 | core_update_device_list_for_node(lun, NULL, deve->mapped_lun, | 80 | core_update_device_list_for_node(lun, NULL, deve->mapped_lun, |
82 | TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); | 81 | TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); |
83 | 82 | ||
84 | spin_lock(&lun->lun_acl_lock); | ||
85 | list_for_each_entry_safe(acl, acl_tmp, | ||
86 | &lun->lun_acl_list, lacl_list) { | ||
87 | if (!strcmp(acl->initiatorname, nacl->initiatorname) && | ||
88 | (acl->mapped_lun == deve->mapped_lun)) | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | if (!acl) { | ||
93 | pr_err("Unable to locate struct se_lun_acl for %s," | ||
94 | " mapped_lun: %u\n", nacl->initiatorname, | ||
95 | deve->mapped_lun); | ||
96 | spin_unlock(&lun->lun_acl_lock); | ||
97 | spin_lock_irq(&nacl->device_list_lock); | ||
98 | continue; | ||
99 | } | ||
100 | |||
101 | list_del(&acl->lacl_list); | ||
102 | spin_unlock(&lun->lun_acl_lock); | ||
103 | |||
104 | spin_lock_irq(&nacl->device_list_lock); | 83 | spin_lock_irq(&nacl->device_list_lock); |
105 | kfree(acl); | ||
106 | } | 84 | } |
107 | spin_unlock_irq(&nacl->device_list_lock); | 85 | spin_unlock_irq(&nacl->device_list_lock); |
108 | } | 86 | } |
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 29ca20dbd335..3b0c4e32ed7b 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c | |||
@@ -2044,7 +2044,7 @@ int vt_do_kdskled(int console, int cmd, unsigned long arg, int perm) | |||
2044 | kbd->default_ledflagstate = ((arg >> 4) & 7); | 2044 | kbd->default_ledflagstate = ((arg >> 4) & 7); |
2045 | set_leds(); | 2045 | set_leds(); |
2046 | spin_unlock_irqrestore(&kbd_event_lock, flags); | 2046 | spin_unlock_irqrestore(&kbd_event_lock, flags); |
2047 | break; | 2047 | return 0; |
2048 | 2048 | ||
2049 | /* the ioctls below only set the lights, not the functions */ | 2049 | /* the ioctls below only set the lights, not the functions */ |
2050 | /* for those, see KDGKBLED and KDSKBLED above */ | 2050 | /* for those, see KDGKBLED and KDSKBLED above */ |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 1f21d2a1e528..5c170100de9c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/if_arp.h> | 24 | #include <linux/if_arp.h> |
25 | #include <linux/if_tun.h> | 25 | #include <linux/if_tun.h> |
26 | #include <linux/if_macvlan.h> | 26 | #include <linux/if_macvlan.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
29 | 30 | ||
@@ -283,8 +284,12 @@ static int peek_head_len(struct sock *sk) | |||
283 | 284 | ||
284 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); | 285 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); |
285 | head = skb_peek(&sk->sk_receive_queue); | 286 | head = skb_peek(&sk->sk_receive_queue); |
286 | if (likely(head)) | 287 | if (likely(head)) { |
287 | len = head->len; | 288 | len = head->len; |
289 | if (vlan_tx_tag_present(head)) | ||
290 | len += VLAN_HLEN; | ||
291 | } | ||
292 | |||
288 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); | 293 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); |
289 | return len; | 294 | return len; |
290 | } | 295 | } |
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index 6468a297e341..39571f9e0162 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c | |||
@@ -22,7 +22,9 @@ | |||
22 | #include <linux/font.h> | 22 | #include <linux/font.h> |
23 | 23 | ||
24 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
25 | #include <asm/page.h> | ||
25 | #include <asm/parisc-device.h> | 26 | #include <asm/parisc-device.h> |
27 | #include <asm/pdc.h> | ||
26 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
27 | #include <asm/grfioctl.h> | 29 | #include <asm/grfioctl.h> |
28 | 30 | ||
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 26e83d7fdd6f..b0e2a4261afe 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c | |||
@@ -73,7 +73,7 @@ static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *ns | |||
73 | struct uvesafb_task *utask; | 73 | struct uvesafb_task *utask; |
74 | struct uvesafb_ktask *task; | 74 | struct uvesafb_ktask *task; |
75 | 75 | ||
76 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) | 76 | if (!capable(CAP_SYS_ADMIN)) |
77 | return; | 77 | return; |
78 | 78 | ||
79 | if (msg->seq >= UVESAFB_TASKS_MAX) | 79 | if (msg->seq >= UVESAFB_TASKS_MAX) |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index c2d05a8279fd..8807fe501d20 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -390,6 +390,7 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev) | |||
390 | /* There might be pages left in the balloon: free them. */ | 390 | /* There might be pages left in the balloon: free them. */ |
391 | while (vb->num_pages) | 391 | while (vb->num_pages) |
392 | leak_balloon(vb, vb->num_pages); | 392 | leak_balloon(vb, vb->num_pages); |
393 | update_balloon_size(vb); | ||
393 | 394 | ||
394 | /* Now we reset the device so we can clean up the queues. */ | 395 | /* Now we reset the device so we can clean up the queues. */ |
395 | vdev->config->reset(vdev); | 396 | vdev->config->reset(vdev); |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index ca6a3796a33b..541ef81f6ae8 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -699,7 +699,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) | |||
699 | * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate | 699 | * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate |
700 | * the cached file length | 700 | * the cached file length |
701 | */ | 701 | */ |
702 | if (origin != SEEK_SET || origin != SEEK_CUR) { | 702 | if (origin != SEEK_SET && origin != SEEK_CUR) { |
703 | int rc; | 703 | int rc; |
704 | struct inode *inode = file->f_path.dentry->d_inode; | 704 | struct inode *inode = file->f_path.dentry->d_inode; |
705 | 705 | ||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5dcc55197fb3..e0b56d7a19c5 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -164,7 +164,8 @@ static const match_table_t cifs_mount_option_tokens = { | |||
164 | { Opt_sign, "sign" }, | 164 | { Opt_sign, "sign" }, |
165 | { Opt_seal, "seal" }, | 165 | { Opt_seal, "seal" }, |
166 | { Opt_direct, "direct" }, | 166 | { Opt_direct, "direct" }, |
167 | { Opt_direct, "forceddirectio" }, | 167 | { Opt_direct, "directio" }, |
168 | { Opt_direct, "forcedirectio" }, | ||
168 | { Opt_strictcache, "strictcache" }, | 169 | { Opt_strictcache, "strictcache" }, |
169 | { Opt_noac, "noac" }, | 170 | { Opt_noac, "noac" }, |
170 | { Opt_fsc, "fsc" }, | 171 | { Opt_fsc, "fsc" }, |
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index ad271c70aa25..5a2dec2b064c 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
@@ -234,8 +234,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) | |||
234 | return 0; | 234 | return 0; |
235 | 235 | ||
236 | jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); | 236 | jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); |
237 | spin_lock(&c->erase_completion_lock); | ||
238 | mutex_lock(&c->alloc_sem); | 237 | mutex_lock(&c->alloc_sem); |
238 | spin_lock(&c->erase_completion_lock); | ||
239 | } | 239 | } |
240 | 240 | ||
241 | /* First, work out which block we're garbage-collecting */ | 241 | /* First, work out which block we're garbage-collecting */ |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 2d60492d6df8..1030a716d155 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -747,6 +747,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, pte_t pte) | |||
747 | else if (pte_present(pte)) | 747 | else if (pte_present(pte)) |
748 | *pme = make_pme(PM_PFRAME(pte_pfn(pte)) | 748 | *pme = make_pme(PM_PFRAME(pte_pfn(pte)) |
749 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); | 749 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); |
750 | else | ||
751 | *pme = make_pme(PM_NOT_PRESENT); | ||
750 | } | 752 | } |
751 | 753 | ||
752 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 754 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
@@ -761,6 +763,8 @@ static void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, | |||
761 | if (pmd_present(pmd)) | 763 | if (pmd_present(pmd)) |
762 | *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) | 764 | *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) |
763 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); | 765 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); |
766 | else | ||
767 | *pme = make_pme(PM_NOT_PRESENT); | ||
764 | } | 768 | } |
765 | #else | 769 | #else |
766 | static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, | 770 | static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, |
@@ -801,8 +805,10 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | |||
801 | 805 | ||
802 | /* check to see if we've left 'vma' behind | 806 | /* check to see if we've left 'vma' behind |
803 | * and need a new, higher one */ | 807 | * and need a new, higher one */ |
804 | if (vma && (addr >= vma->vm_end)) | 808 | if (vma && (addr >= vma->vm_end)) { |
805 | vma = find_vma(walk->mm, addr); | 809 | vma = find_vma(walk->mm, addr); |
810 | pme = make_pme(PM_NOT_PRESENT); | ||
811 | } | ||
806 | 812 | ||
807 | /* check that 'vma' actually covers this address, | 813 | /* check that 'vma' actually covers this address, |
808 | * and that it isn't a huge page vma */ | 814 | * and that it isn't a huge page vma */ |
@@ -830,6 +836,8 @@ static void huge_pte_to_pagemap_entry(pagemap_entry_t *pme, | |||
830 | if (pte_present(pte)) | 836 | if (pte_present(pte)) |
831 | *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) | 837 | *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) |
832 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); | 838 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); |
839 | else | ||
840 | *pme = make_pme(PM_NOT_PRESENT); | ||
833 | } | 841 | } |
834 | 842 | ||
835 | /* This function walks within one hugetlb entry in the single call */ | 843 | /* This function walks within one hugetlb entry in the single call */ |
@@ -839,7 +847,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, | |||
839 | { | 847 | { |
840 | struct pagemapread *pm = walk->private; | 848 | struct pagemapread *pm = walk->private; |
841 | int err = 0; | 849 | int err = 0; |
842 | pagemap_entry_t pme = make_pme(PM_NOT_PRESENT); | 850 | pagemap_entry_t pme; |
843 | 851 | ||
844 | for (; addr != end; addr += PAGE_SIZE) { | 852 | for (; addr != end; addr += PAGE_SIZE) { |
845 | int offset = (addr & ~hmask) >> PAGE_SHIFT; | 853 | int offset = (addr & ~hmask) >> PAGE_SHIFT; |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 8a1835855faa..fe5136d81454 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -159,7 +159,8 @@ static inline void eth_hw_addr_random(struct net_device *dev) | |||
159 | * @addr1: Pointer to a six-byte array containing the Ethernet address | 159 | * @addr1: Pointer to a six-byte array containing the Ethernet address |
160 | * @addr2: Pointer other six-byte array containing the Ethernet address | 160 | * @addr2: Pointer other six-byte array containing the Ethernet address |
161 | * | 161 | * |
162 | * Compare two ethernet addresses, returns 0 if equal | 162 | * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise. |
163 | * Unlike memcmp(), it doesn't return a value suitable for sorting. | ||
163 | */ | 164 | */ |
164 | static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) | 165 | static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) |
165 | { | 166 | { |
@@ -184,10 +185,10 @@ static inline unsigned long zap_last_2bytes(unsigned long value) | |||
184 | * @addr1: Pointer to an array of 8 bytes | 185 | * @addr1: Pointer to an array of 8 bytes |
185 | * @addr2: Pointer to an other array of 8 bytes | 186 | * @addr2: Pointer to an other array of 8 bytes |
186 | * | 187 | * |
187 | * Compare two ethernet addresses, returns 0 if equal. | 188 | * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise. |
188 | * Same result than "memcmp(addr1, addr2, ETH_ALEN)" but without conditional | 189 | * Unlike memcmp(), it doesn't return a value suitable for sorting. |
189 | * branches, and possibly long word memory accesses on CPU allowing cheap | 190 | * The function doesn't need any conditional branches and possibly uses |
190 | * unaligned memory reads. | 191 | * word memory accesses on CPU allowing cheap unaligned memory reads. |
191 | * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2} | 192 | * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2} |
192 | * | 193 | * |
193 | * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits. | 194 | * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits. |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 5f3f3be5af09..176a939d1547 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -179,6 +179,7 @@ enum { | |||
179 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 179 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
180 | TRACE_EVENT_FL_CAP_ANY_BIT, | 180 | TRACE_EVENT_FL_CAP_ANY_BIT, |
181 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | 181 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, |
182 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, | ||
182 | }; | 183 | }; |
183 | 184 | ||
184 | enum { | 185 | enum { |
@@ -187,6 +188,7 @@ enum { | |||
187 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 188 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
188 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | 189 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), |
189 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | 190 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), |
191 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), | ||
190 | }; | 192 | }; |
191 | 193 | ||
192 | struct ftrace_event_call { | 194 | struct ftrace_event_call { |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5cbaa20f1659..33900a53c990 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1403,15 +1403,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
1403 | return 0; | 1403 | return 0; |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | #ifndef CONFIG_NET_NS | ||
1407 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1408 | { | ||
1409 | skb->dev = dev; | ||
1410 | } | ||
1411 | #else /* CONFIG_NET_NS */ | ||
1412 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
1413 | #endif | ||
1414 | |||
1415 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1406 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
1416 | { | 1407 | { |
1417 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1408 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index 05a5d72680be..230a290e1973 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -99,6 +99,22 @@ struct ip_set_hash { | |||
99 | #endif | 99 | #endif |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static size_t | ||
103 | htable_size(u8 hbits) | ||
104 | { | ||
105 | size_t hsize; | ||
106 | |||
107 | /* We must fit both into u32 in jhash and size_t */ | ||
108 | if (hbits > 31) | ||
109 | return 0; | ||
110 | hsize = jhash_size(hbits); | ||
111 | if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket) | ||
112 | < hsize) | ||
113 | return 0; | ||
114 | |||
115 | return hsize * sizeof(struct hbucket) + sizeof(struct htable); | ||
116 | } | ||
117 | |||
102 | /* Compute htable_bits from the user input parameter hashsize */ | 118 | /* Compute htable_bits from the user input parameter hashsize */ |
103 | static u8 | 119 | static u8 |
104 | htable_bits(u32 hashsize) | 120 | htable_bits(u32 hashsize) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 605b0aa8d852..76f439647c4b 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *); | |||
191 | enum skb_state { | 191 | enum skb_state { |
192 | illegal = 0, | 192 | illegal = 0, |
193 | tx_start, tx_done, | 193 | tx_start, tx_done, |
194 | rx_start, rx_done, rx_cleanup | 194 | rx_start, rx_done, rx_cleanup, |
195 | unlink_start | ||
195 | }; | 196 | }; |
196 | 197 | ||
197 | struct skb_data { /* skb->cb is one of these */ | 198 | struct skb_data { /* skb->cb is one of these */ |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b5c2b6cb0d81..cad374bdcf4b 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -59,7 +59,8 @@ struct soc_camera_device { | |||
59 | struct soc_camera_host { | 59 | struct soc_camera_host { |
60 | struct v4l2_device v4l2_dev; | 60 | struct v4l2_device v4l2_dev; |
61 | struct list_head list; | 61 | struct list_head list; |
62 | unsigned char nr; /* Host number */ | 62 | struct mutex host_lock; /* Protect during probing */ |
63 | unsigned char nr; /* Host number */ | ||
63 | void *priv; | 64 | void *priv; |
64 | const char *drv_name; | 65 | const char *drv_name; |
65 | struct soc_camera_host_ops *ops; | 66 | struct soc_camera_host_ops *ops; |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 262ebd1747d4..a65910bda381 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -191,6 +191,7 @@ struct bt_sock { | |||
191 | struct list_head accept_q; | 191 | struct list_head accept_q; |
192 | struct sock *parent; | 192 | struct sock *parent; |
193 | u32 defer_setup; | 193 | u32 defer_setup; |
194 | bool suspended; | ||
194 | }; | 195 | }; |
195 | 196 | ||
196 | struct bt_sock_list { | 197 | struct bt_sock_list { |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 6ee44b24864a..a2ef81466b00 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -704,4 +704,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr) | |||
704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); | 704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); |
705 | } | 705 | } |
706 | 706 | ||
707 | /* The cookie is always 0 since this is how it's used in the | ||
708 | * pmtu code. | ||
709 | */ | ||
710 | static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) | ||
711 | { | ||
712 | if (t->dst && !dst_check(t->dst, 0)) { | ||
713 | dst_release(t->dst); | ||
714 | t->dst = NULL; | ||
715 | } | ||
716 | |||
717 | return t->dst; | ||
718 | } | ||
719 | |||
707 | #endif /* __net_sctp_h__ */ | 720 | #endif /* __net_sctp_h__ */ |
diff --git a/kernel/compat.c b/kernel/compat.c index 74ff8498809a..d2c67aa49ae6 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -372,25 +372,54 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set) | |||
372 | 372 | ||
373 | #ifdef __ARCH_WANT_SYS_SIGPROCMASK | 373 | #ifdef __ARCH_WANT_SYS_SIGPROCMASK |
374 | 374 | ||
375 | asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set, | 375 | /* |
376 | compat_old_sigset_t __user *oset) | 376 | * sys_sigprocmask SIG_SETMASK sets the first (compat) word of the |
377 | * blocked set of signals to the supplied signal set | ||
378 | */ | ||
379 | static inline void compat_sig_setmask(sigset_t *blocked, compat_sigset_word set) | ||
377 | { | 380 | { |
378 | old_sigset_t s; | 381 | memcpy(blocked->sig, &set, sizeof(set)); |
379 | long ret; | 382 | } |
380 | mm_segment_t old_fs; | ||
381 | 383 | ||
382 | if (set && get_user(s, set)) | 384 | asmlinkage long compat_sys_sigprocmask(int how, |
383 | return -EFAULT; | 385 | compat_old_sigset_t __user *nset, |
384 | old_fs = get_fs(); | 386 | compat_old_sigset_t __user *oset) |
385 | set_fs(KERNEL_DS); | 387 | { |
386 | ret = sys_sigprocmask(how, | 388 | old_sigset_t old_set, new_set; |
387 | set ? (old_sigset_t __user *) &s : NULL, | 389 | sigset_t new_blocked; |
388 | oset ? (old_sigset_t __user *) &s : NULL); | 390 | |
389 | set_fs(old_fs); | 391 | old_set = current->blocked.sig[0]; |
390 | if (ret == 0) | 392 | |
391 | if (oset) | 393 | if (nset) { |
392 | ret = put_user(s, oset); | 394 | if (get_user(new_set, nset)) |
393 | return ret; | 395 | return -EFAULT; |
396 | new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP)); | ||
397 | |||
398 | new_blocked = current->blocked; | ||
399 | |||
400 | switch (how) { | ||
401 | case SIG_BLOCK: | ||
402 | sigaddsetmask(&new_blocked, new_set); | ||
403 | break; | ||
404 | case SIG_UNBLOCK: | ||
405 | sigdelsetmask(&new_blocked, new_set); | ||
406 | break; | ||
407 | case SIG_SETMASK: | ||
408 | compat_sig_setmask(&new_blocked, new_set); | ||
409 | break; | ||
410 | default: | ||
411 | return -EINVAL; | ||
412 | } | ||
413 | |||
414 | set_current_blocked(&new_blocked); | ||
415 | } | ||
416 | |||
417 | if (oset) { | ||
418 | if (put_user(old_set, oset)) | ||
419 | return -EFAULT; | ||
420 | } | ||
421 | |||
422 | return 0; | ||
394 | } | 423 | } |
395 | 424 | ||
396 | #endif | 425 | #endif |
diff --git a/kernel/fork.c b/kernel/fork.c index b9372a0bff18..687a15d56243 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/audit.h> | 47 | #include <linux/audit.h> |
48 | #include <linux/memcontrol.h> | 48 | #include <linux/memcontrol.h> |
49 | #include <linux/ftrace.h> | 49 | #include <linux/ftrace.h> |
50 | #include <linux/proc_fs.h> | ||
50 | #include <linux/profile.h> | 51 | #include <linux/profile.h> |
51 | #include <linux/rmap.h> | 52 | #include <linux/rmap.h> |
52 | #include <linux/ksm.h> | 53 | #include <linux/ksm.h> |
@@ -1464,6 +1465,8 @@ bad_fork_cleanup_io: | |||
1464 | if (p->io_context) | 1465 | if (p->io_context) |
1465 | exit_io_context(p); | 1466 | exit_io_context(p); |
1466 | bad_fork_cleanup_namespaces: | 1467 | bad_fork_cleanup_namespaces: |
1468 | if (unlikely(clone_flags & CLONE_NEWPID)) | ||
1469 | pid_ns_release_proc(p->nsproxy->pid_ns); | ||
1467 | exit_task_namespaces(p); | 1470 | exit_task_namespaces(p); |
1468 | bad_fork_cleanup_mm: | 1471 | bad_fork_cleanup_mm: |
1469 | if (p->mm) | 1472 | if (p->mm) |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 6080f6bc8c33..3914c1e03cff 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -518,6 +518,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
518 | out_unlock: | 518 | out_unlock: |
519 | raw_spin_unlock(&desc->lock); | 519 | raw_spin_unlock(&desc->lock); |
520 | } | 520 | } |
521 | EXPORT_SYMBOL(handle_edge_irq); | ||
521 | 522 | ||
522 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER | 523 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER |
523 | /** | 524 | /** |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index d86e254b95eb..192a302d6cfd 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
@@ -112,6 +112,7 @@ struct irq_desc *irq_to_desc(unsigned int irq) | |||
112 | { | 112 | { |
113 | return radix_tree_lookup(&irq_desc_tree, irq); | 113 | return radix_tree_lookup(&irq_desc_tree, irq); |
114 | } | 114 | } |
115 | EXPORT_SYMBOL(irq_to_desc); | ||
115 | 116 | ||
116 | static void delete_irq_desc(unsigned int irq) | 117 | static void delete_irq_desc(unsigned int irq) |
117 | { | 118 | { |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 0533a688ce22..e5212ae294f6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -6382,6 +6382,8 @@ static int __sdt_alloc(const struct cpumask *cpu_map) | |||
6382 | if (!sg) | 6382 | if (!sg) |
6383 | return -ENOMEM; | 6383 | return -ENOMEM; |
6384 | 6384 | ||
6385 | sg->next = sg; | ||
6386 | |||
6385 | *per_cpu_ptr(sdd->sg, j) = sg; | 6387 | *per_cpu_ptr(sdd->sg, j) = sg; |
6386 | 6388 | ||
6387 | sgp = kzalloc_node(sizeof(struct sched_group_power), | 6389 | sgp = kzalloc_node(sizeof(struct sched_group_power), |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 079a93ae8a9d..29111da1d100 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -294,6 +294,9 @@ static int __ftrace_set_clr_event(const char *match, const char *sub, | |||
294 | if (!call->name || !call->class || !call->class->reg) | 294 | if (!call->name || !call->class || !call->class->reg) |
295 | continue; | 295 | continue; |
296 | 296 | ||
297 | if (call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) | ||
298 | continue; | ||
299 | |||
297 | if (match && | 300 | if (match && |
298 | strcmp(match, call->name) != 0 && | 301 | strcmp(match, call->name) != 0 && |
299 | strcmp(match, call->class->system) != 0) | 302 | strcmp(match, call->class->system) != 0) |
@@ -1164,7 +1167,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
1164 | return -1; | 1167 | return -1; |
1165 | } | 1168 | } |
1166 | 1169 | ||
1167 | if (call->class->reg) | 1170 | if (call->class->reg && !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE)) |
1168 | trace_create_file("enable", 0644, call->dir, call, | 1171 | trace_create_file("enable", 0644, call->dir, call, |
1169 | enable); | 1172 | enable); |
1170 | 1173 | ||
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 3dd15e8bc856..e039906b037d 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -180,6 +180,7 @@ struct ftrace_event_call __used event_##call = { \ | |||
180 | .event.type = etype, \ | 180 | .event.type = etype, \ |
181 | .class = &event_class_ftrace_##call, \ | 181 | .class = &event_class_ftrace_##call, \ |
182 | .print_fmt = print, \ | 182 | .print_fmt = print, \ |
183 | .flags = TRACE_EVENT_FL_IGNORE_ENABLE, \ | ||
183 | }; \ | 184 | }; \ |
184 | struct ftrace_event_call __used \ | 185 | struct ftrace_event_call __used \ |
185 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; | 186 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 5a16423a512c..ae8f708e3d75 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2498,7 +2498,6 @@ retry_avoidcopy: | |||
2498 | if (outside_reserve) { | 2498 | if (outside_reserve) { |
2499 | BUG_ON(huge_pte_none(pte)); | 2499 | BUG_ON(huge_pte_none(pte)); |
2500 | if (unmap_ref_private(mm, vma, old_page, address)) { | 2500 | if (unmap_ref_private(mm, vma, old_page, address)) { |
2501 | BUG_ON(page_count(old_page) != 1); | ||
2502 | BUG_ON(huge_pte_none(pte)); | 2501 | BUG_ON(huge_pte_none(pte)); |
2503 | spin_lock(&mm->page_table_lock); | 2502 | spin_lock(&mm->page_table_lock); |
2504 | ptep = huge_pte_offset(mm, address & huge_page_mask(h)); | 2503 | ptep = huge_pte_offset(mm, address & huge_page_mask(h)); |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 31ab9c3f0178..b659260c56ad 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4507,6 +4507,12 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp, | |||
4507 | swap_buffers: | 4507 | swap_buffers: |
4508 | /* Swap primary and spare array */ | 4508 | /* Swap primary and spare array */ |
4509 | thresholds->spare = thresholds->primary; | 4509 | thresholds->spare = thresholds->primary; |
4510 | /* If all events are unregistered, free the spare array */ | ||
4511 | if (!new) { | ||
4512 | kfree(thresholds->spare); | ||
4513 | thresholds->spare = NULL; | ||
4514 | } | ||
4515 | |||
4510 | rcu_assign_pointer(thresholds->primary, new); | 4516 | rcu_assign_pointer(thresholds->primary, new); |
4511 | 4517 | ||
4512 | /* To be sure that nobody uses thresholds */ | 4518 | /* To be sure that nobody uses thresholds */ |
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index e53bb8a256b1..1983fb1c7026 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -82,8 +82,7 @@ void __init free_bootmem_late(unsigned long addr, unsigned long size) | |||
82 | 82 | ||
83 | static void __init __free_pages_memory(unsigned long start, unsigned long end) | 83 | static void __init __free_pages_memory(unsigned long start, unsigned long end) |
84 | { | 84 | { |
85 | int i; | 85 | unsigned long i, start_aligned, end_aligned; |
86 | unsigned long start_aligned, end_aligned; | ||
87 | int order = ilog2(BITS_PER_LONG); | 86 | int order = ilog2(BITS_PER_LONG); |
88 | 87 | ||
89 | start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1); | 88 | start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a712fb9e04ce..918330f71dba 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5203,7 +5203,7 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, | |||
5203 | int ret; | 5203 | int ret; |
5204 | 5204 | ||
5205 | ret = proc_dointvec_minmax(table, write, buffer, length, ppos); | 5205 | ret = proc_dointvec_minmax(table, write, buffer, length, ppos); |
5206 | if (!write || (ret == -EINVAL)) | 5206 | if (!write || (ret < 0)) |
5207 | return ret; | 5207 | return ret; |
5208 | for_each_populated_zone(zone) { | 5208 | for_each_populated_zone(zone) { |
5209 | for_each_possible_cpu(cpu) { | 5209 | for_each_possible_cpu(cpu) { |
diff --git a/mm/percpu.c b/mm/percpu.c index f921fdfb5430..bb4be7435ce3 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1650,6 +1650,16 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, | |||
1650 | areas[group] = ptr; | 1650 | areas[group] = ptr; |
1651 | 1651 | ||
1652 | base = min(ptr, base); | 1652 | base = min(ptr, base); |
1653 | } | ||
1654 | |||
1655 | /* | ||
1656 | * Copy data and free unused parts. This should happen after all | ||
1657 | * allocations are complete; otherwise, we may end up with | ||
1658 | * overlapping groups. | ||
1659 | */ | ||
1660 | for (group = 0; group < ai->nr_groups; group++) { | ||
1661 | struct pcpu_group_info *gi = &ai->groups[group]; | ||
1662 | void *ptr = areas[group]; | ||
1653 | 1663 | ||
1654 | for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { | 1664 | for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { |
1655 | if (gi->cpu_map[i] == NR_CPUS) { | 1665 | if (gi->cpu_map[i] == NR_CPUS) { |
@@ -1885,6 +1895,8 @@ void __init setup_per_cpu_areas(void) | |||
1885 | fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); | 1895 | fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); |
1886 | if (!ai || !fc) | 1896 | if (!ai || !fc) |
1887 | panic("Failed to allocate memory for percpu areas."); | 1897 | panic("Failed to allocate memory for percpu areas."); |
1898 | /* kmemleak tracks the percpu allocations separately */ | ||
1899 | kmemleak_free(fc); | ||
1888 | 1900 | ||
1889 | ai->dyn_size = unit_size; | 1901 | ai->dyn_size = unit_size; |
1890 | ai->unit_size = unit_size; | 1902 | ai->unit_size = unit_size; |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 9988d4abb372..9757c193c86b 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -157,7 +157,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, | |||
157 | skb = __vlan_hwaccel_put_tag(skb, vlan_tci); | 157 | skb = __vlan_hwaccel_put_tag(skb, vlan_tci); |
158 | } | 158 | } |
159 | 159 | ||
160 | skb_set_dev(skb, vlan_dev_priv(dev)->real_dev); | 160 | skb->dev = vlan_dev_priv(dev)->real_dev; |
161 | len = skb->len; | 161 | len = skb->len; |
162 | if (netpoll_tx_running(dev)) | 162 | if (netpoll_tx_running(dev)) |
163 | return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev); | 163 | return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev); |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 72eb187a5f60..6fb68a9743af 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -450,7 +450,7 @@ unsigned int bt_sock_poll(struct file *file, struct socket *sock, poll_table *wa | |||
450 | sk->sk_state == BT_CONFIG) | 450 | sk->sk_state == BT_CONFIG) |
451 | return mask; | 451 | return mask; |
452 | 452 | ||
453 | if (sock_writeable(sk)) | 453 | if (!bt_sk(sk)->suspended && sock_writeable(sk)) |
454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; | 454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; |
455 | else | 455 | else |
456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); | 456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index edfd61addcec..d6dc44cd15b0 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2784,6 +2784,14 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
2784 | if (conn) { | 2784 | if (conn) { |
2785 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); | 2785 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); |
2786 | 2786 | ||
2787 | hci_dev_lock(hdev); | ||
2788 | if (test_bit(HCI_MGMT, &hdev->dev_flags) && | ||
2789 | !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) | ||
2790 | mgmt_device_connected(hdev, &conn->dst, conn->type, | ||
2791 | conn->dst_type, 0, NULL, 0, | ||
2792 | conn->dev_class); | ||
2793 | hci_dev_unlock(hdev); | ||
2794 | |||
2787 | /* Send to upper protocol */ | 2795 | /* Send to upper protocol */ |
2788 | l2cap_recv_acldata(conn, skb, flags); | 2796 | l2cap_recv_acldata(conn, skb, flags); |
2789 | return; | 2797 | return; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 6c065254afc0..1266f78fa8e3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2039,6 +2039,12 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
2039 | 2039 | ||
2040 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | 2040 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
2041 | 2041 | ||
2042 | if (ev->status && conn->state == BT_CONNECTED) { | ||
2043 | hci_acl_disconn(conn, 0x13); | ||
2044 | hci_conn_put(conn); | ||
2045 | goto unlock; | ||
2046 | } | ||
2047 | |||
2042 | if (conn->state == BT_CONFIG) { | 2048 | if (conn->state == BT_CONFIG) { |
2043 | if (!ev->status) | 2049 | if (!ev->status) |
2044 | conn->state = BT_CONNECTED; | 2050 | conn->state = BT_CONNECTED; |
@@ -2049,6 +2055,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
2049 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); | 2055 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); |
2050 | } | 2056 | } |
2051 | 2057 | ||
2058 | unlock: | ||
2052 | hci_dev_unlock(hdev); | 2059 | hci_dev_unlock(hdev); |
2053 | } | 2060 | } |
2054 | 2061 | ||
@@ -2102,7 +2109,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff | |||
2102 | goto unlock; | 2109 | goto unlock; |
2103 | } | 2110 | } |
2104 | 2111 | ||
2105 | if (!ev->status) { | 2112 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
2106 | struct hci_cp_remote_name_req cp; | 2113 | struct hci_cp_remote_name_req cp; |
2107 | memset(&cp, 0, sizeof(cp)); | 2114 | memset(&cp, 0, sizeof(cp)); |
2108 | bacpy(&cp.bdaddr, &conn->dst); | 2115 | bacpy(&cp.bdaddr, &conn->dst); |
@@ -2871,7 +2878,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b | |||
2871 | if (conn->state != BT_CONFIG) | 2878 | if (conn->state != BT_CONFIG) |
2872 | goto unlock; | 2879 | goto unlock; |
2873 | 2880 | ||
2874 | if (!ev->status) { | 2881 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
2875 | struct hci_cp_remote_name_req cp; | 2882 | struct hci_cp_remote_name_req cp; |
2876 | memset(&cp, 0, sizeof(cp)); | 2883 | memset(&cp, 0, sizeof(cp)); |
2877 | bacpy(&cp.bdaddr, &conn->dst); | 2884 | bacpy(&cp.bdaddr, &conn->dst); |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 94552b33d528..6f9c25b633a6 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -4589,6 +4589,11 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
4589 | 4589 | ||
4590 | if (!status && (chan->state == BT_CONNECTED || | 4590 | if (!status && (chan->state == BT_CONNECTED || |
4591 | chan->state == BT_CONFIG)) { | 4591 | chan->state == BT_CONFIG)) { |
4592 | struct sock *sk = chan->sk; | ||
4593 | |||
4594 | bt_sk(sk)->suspended = false; | ||
4595 | sk->sk_state_change(sk); | ||
4596 | |||
4592 | l2cap_check_encryption(chan, encrypt); | 4597 | l2cap_check_encryption(chan, encrypt); |
4593 | l2cap_chan_unlock(chan); | 4598 | l2cap_chan_unlock(chan); |
4594 | continue; | 4599 | continue; |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 29122ed28ea9..04e7c172d49c 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -592,10 +592,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
592 | sk->sk_state = BT_CONFIG; | 592 | sk->sk_state = BT_CONFIG; |
593 | chan->state = BT_CONFIG; | 593 | chan->state = BT_CONFIG; |
594 | 594 | ||
595 | /* or for ACL link, under defer_setup time */ | 595 | /* or for ACL link */ |
596 | } else if (sk->sk_state == BT_CONNECT2 && | 596 | } else if ((sk->sk_state == BT_CONNECT2 && |
597 | bt_sk(sk)->defer_setup) { | 597 | bt_sk(sk)->defer_setup) || |
598 | err = l2cap_chan_check_security(chan); | 598 | sk->sk_state == BT_CONNECTED) { |
599 | if (!l2cap_chan_check_security(chan)) | ||
600 | bt_sk(sk)->suspended = true; | ||
601 | else | ||
602 | sk->sk_state_change(sk); | ||
599 | } else { | 603 | } else { |
600 | err = -EINVAL; | 604 | err = -EINVAL; |
601 | } | 605 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 9bb8f87c4cda..99e1d759f41e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1617,10 +1617,14 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
1617 | return NET_RX_DROP; | 1617 | return NET_RX_DROP; |
1618 | } | 1618 | } |
1619 | skb->skb_iif = 0; | 1619 | skb->skb_iif = 0; |
1620 | skb_set_dev(skb, dev); | 1620 | skb->dev = dev; |
1621 | skb_dst_drop(skb); | ||
1621 | skb->tstamp.tv64 = 0; | 1622 | skb->tstamp.tv64 = 0; |
1622 | skb->pkt_type = PACKET_HOST; | 1623 | skb->pkt_type = PACKET_HOST; |
1623 | skb->protocol = eth_type_trans(skb, dev); | 1624 | skb->protocol = eth_type_trans(skb, dev); |
1625 | skb->mark = 0; | ||
1626 | secpath_reset(skb); | ||
1627 | nf_reset(skb); | ||
1624 | return netif_rx(skb); | 1628 | return netif_rx(skb); |
1625 | } | 1629 | } |
1626 | EXPORT_SYMBOL_GPL(dev_forward_skb); | 1630 | EXPORT_SYMBOL_GPL(dev_forward_skb); |
@@ -1869,36 +1873,6 @@ void netif_device_attach(struct net_device *dev) | |||
1869 | } | 1873 | } |
1870 | EXPORT_SYMBOL(netif_device_attach); | 1874 | EXPORT_SYMBOL(netif_device_attach); |
1871 | 1875 | ||
1872 | /** | ||
1873 | * skb_dev_set -- assign a new device to a buffer | ||
1874 | * @skb: buffer for the new device | ||
1875 | * @dev: network device | ||
1876 | * | ||
1877 | * If an skb is owned by a device already, we have to reset | ||
1878 | * all data private to the namespace a device belongs to | ||
1879 | * before assigning it a new device. | ||
1880 | */ | ||
1881 | #ifdef CONFIG_NET_NS | ||
1882 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1883 | { | ||
1884 | skb_dst_drop(skb); | ||
1885 | if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) { | ||
1886 | secpath_reset(skb); | ||
1887 | nf_reset(skb); | ||
1888 | skb_init_secmark(skb); | ||
1889 | skb->mark = 0; | ||
1890 | skb->priority = 0; | ||
1891 | skb->nf_trace = 0; | ||
1892 | skb->ipvs_property = 0; | ||
1893 | #ifdef CONFIG_NET_SCHED | ||
1894 | skb->tc_index = 0; | ||
1895 | #endif | ||
1896 | } | ||
1897 | skb->dev = dev; | ||
1898 | } | ||
1899 | EXPORT_SYMBOL(skb_set_dev); | ||
1900 | #endif /* CONFIG_NET_NS */ | ||
1901 | |||
1902 | static void skb_warn_bad_offload(const struct sk_buff *skb) | 1876 | static void skb_warn_bad_offload(const struct sk_buff *skb) |
1903 | { | 1877 | { |
1904 | static const netdev_features_t null_features = 0; | 1878 | static const netdev_features_t null_features = 0; |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 4d8ce93cd503..77a59980b579 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1931,7 +1931,7 @@ static int pktgen_device_event(struct notifier_block *unused, | |||
1931 | { | 1931 | { |
1932 | struct net_device *dev = ptr; | 1932 | struct net_device *dev = ptr; |
1933 | 1933 | ||
1934 | if (!net_eq(dev_net(dev), &init_net)) | 1934 | if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting) |
1935 | return NOTIFY_DONE; | 1935 | return NOTIFY_DONE; |
1936 | 1936 | ||
1937 | /* It is OK that we do not hold the group lock right now, | 1937 | /* It is OK that we do not hold the group lock right now, |
@@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void) | |||
3755 | { | 3755 | { |
3756 | struct pktgen_thread *t; | 3756 | struct pktgen_thread *t; |
3757 | struct list_head *q, *n; | 3757 | struct list_head *q, *n; |
3758 | struct list_head list; | ||
3758 | 3759 | ||
3759 | /* Stop all interfaces & threads */ | 3760 | /* Stop all interfaces & threads */ |
3760 | pktgen_exiting = true; | 3761 | pktgen_exiting = true; |
3761 | 3762 | ||
3762 | list_for_each_safe(q, n, &pktgen_threads) { | 3763 | mutex_lock(&pktgen_thread_lock); |
3764 | list_splice(&list, &pktgen_threads); | ||
3765 | mutex_unlock(&pktgen_thread_lock); | ||
3766 | |||
3767 | list_for_each_safe(q, n, &list) { | ||
3763 | t = list_entry(q, struct pktgen_thread, th_list); | 3768 | t = list_entry(q, struct pktgen_thread, th_list); |
3769 | list_del(&t->th_list); | ||
3764 | kthread_stop(t->tsk); | 3770 | kthread_stop(t->tsk); |
3765 | kfree(t); | 3771 | kfree(t); |
3766 | } | 3772 | } |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index bce36f1a37b4..30b88d7b4bd6 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1370,6 +1370,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l, | |||
1370 | 1370 | ||
1371 | if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) | 1371 | if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) |
1372 | continue; | 1372 | continue; |
1373 | if (fi->fib_dead) | ||
1374 | continue; | ||
1373 | if (fa->fa_info->fib_scope < flp->flowi4_scope) | 1375 | if (fa->fa_info->fib_scope < flp->flowi4_scope) |
1374 | continue; | 1376 | continue; |
1375 | fib_alias_accessed(fa); | 1377 | fib_alias_accessed(fa); |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1272a88c2a63..6589e11d57b6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -851,8 +851,7 @@ new_segment: | |||
851 | wait_for_sndbuf: | 851 | wait_for_sndbuf: |
852 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); | 852 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); |
853 | wait_for_memory: | 853 | wait_for_memory: |
854 | if (copied) | 854 | tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); |
855 | tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); | ||
856 | 855 | ||
857 | if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) | 856 | if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) |
858 | goto do_error; | 857 | goto do_error; |
diff --git a/net/netfilter/ipset/ip_set_hash_ip.c b/net/netfilter/ipset/ip_set_hash_ip.c index 5139dea6019e..828ce46cb34b 100644 --- a/net/netfilter/ipset/ip_set_hash_ip.c +++ b/net/netfilter/ipset/ip_set_hash_ip.c | |||
@@ -364,6 +364,7 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
364 | { | 364 | { |
365 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 365 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
366 | u8 netmask, hbits; | 366 | u8 netmask, hbits; |
367 | size_t hsize; | ||
367 | struct ip_set_hash *h; | 368 | struct ip_set_hash *h; |
368 | 369 | ||
369 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 370 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
@@ -405,9 +406,12 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
405 | h->timeout = IPSET_NO_TIMEOUT; | 406 | h->timeout = IPSET_NO_TIMEOUT; |
406 | 407 | ||
407 | hbits = htable_bits(hashsize); | 408 | hbits = htable_bits(hashsize); |
408 | h->table = ip_set_alloc( | 409 | hsize = htable_size(hbits); |
409 | sizeof(struct htable) | 410 | if (hsize == 0) { |
410 | + jhash_size(hbits) * sizeof(struct hbucket)); | 411 | kfree(h); |
412 | return -ENOMEM; | ||
413 | } | ||
414 | h->table = ip_set_alloc(hsize); | ||
411 | if (!h->table) { | 415 | if (!h->table) { |
412 | kfree(h); | 416 | kfree(h); |
413 | return -ENOMEM; | 417 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipport.c b/net/netfilter/ipset/ip_set_hash_ipport.c index 9c27e249c171..e8dbb498af8f 100644 --- a/net/netfilter/ipset/ip_set_hash_ipport.c +++ b/net/netfilter/ipset/ip_set_hash_ipport.c | |||
@@ -449,6 +449,7 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
449 | struct ip_set_hash *h; | 449 | struct ip_set_hash *h; |
450 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 450 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
451 | u8 hbits; | 451 | u8 hbits; |
452 | size_t hsize; | ||
452 | 453 | ||
453 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 454 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
454 | return -IPSET_ERR_INVALID_FAMILY; | 455 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -476,9 +477,12 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
476 | h->timeout = IPSET_NO_TIMEOUT; | 477 | h->timeout = IPSET_NO_TIMEOUT; |
477 | 478 | ||
478 | hbits = htable_bits(hashsize); | 479 | hbits = htable_bits(hashsize); |
479 | h->table = ip_set_alloc( | 480 | hsize = htable_size(hbits); |
480 | sizeof(struct htable) | 481 | if (hsize == 0) { |
481 | + jhash_size(hbits) * sizeof(struct hbucket)); | 482 | kfree(h); |
483 | return -ENOMEM; | ||
484 | } | ||
485 | h->table = ip_set_alloc(hsize); | ||
482 | if (!h->table) { | 486 | if (!h->table) { |
483 | kfree(h); | 487 | kfree(h); |
484 | return -ENOMEM; | 488 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportip.c b/net/netfilter/ipset/ip_set_hash_ipportip.c index 9134057c0728..52f79d8ef741 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportip.c +++ b/net/netfilter/ipset/ip_set_hash_ipportip.c | |||
@@ -467,6 +467,7 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
467 | struct ip_set_hash *h; | 467 | struct ip_set_hash *h; |
468 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 468 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
469 | u8 hbits; | 469 | u8 hbits; |
470 | size_t hsize; | ||
470 | 471 | ||
471 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 472 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
472 | return -IPSET_ERR_INVALID_FAMILY; | 473 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -494,9 +495,12 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
494 | h->timeout = IPSET_NO_TIMEOUT; | 495 | h->timeout = IPSET_NO_TIMEOUT; |
495 | 496 | ||
496 | hbits = htable_bits(hashsize); | 497 | hbits = htable_bits(hashsize); |
497 | h->table = ip_set_alloc( | 498 | hsize = htable_size(hbits); |
498 | sizeof(struct htable) | 499 | if (hsize == 0) { |
499 | + jhash_size(hbits) * sizeof(struct hbucket)); | 500 | kfree(h); |
501 | return -ENOMEM; | ||
502 | } | ||
503 | h->table = ip_set_alloc(hsize); | ||
500 | if (!h->table) { | 504 | if (!h->table) { |
501 | kfree(h); | 505 | kfree(h); |
502 | return -ENOMEM; | 506 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportnet.c b/net/netfilter/ipset/ip_set_hash_ipportnet.c index 5d05e6969862..97583f5af745 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportnet.c +++ b/net/netfilter/ipset/ip_set_hash_ipportnet.c | |||
@@ -616,6 +616,7 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
616 | struct ip_set_hash *h; | 616 | struct ip_set_hash *h; |
617 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 617 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
618 | u8 hbits; | 618 | u8 hbits; |
619 | size_t hsize; | ||
619 | 620 | ||
620 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 621 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
621 | return -IPSET_ERR_INVALID_FAMILY; | 622 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -645,9 +646,12 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
645 | h->timeout = IPSET_NO_TIMEOUT; | 646 | h->timeout = IPSET_NO_TIMEOUT; |
646 | 647 | ||
647 | hbits = htable_bits(hashsize); | 648 | hbits = htable_bits(hashsize); |
648 | h->table = ip_set_alloc( | 649 | hsize = htable_size(hbits); |
649 | sizeof(struct htable) | 650 | if (hsize == 0) { |
650 | + jhash_size(hbits) * sizeof(struct hbucket)); | 651 | kfree(h); |
652 | return -ENOMEM; | ||
653 | } | ||
654 | h->table = ip_set_alloc(hsize); | ||
651 | if (!h->table) { | 655 | if (!h->table) { |
652 | kfree(h); | 656 | kfree(h); |
653 | return -ENOMEM; | 657 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_net.c b/net/netfilter/ipset/ip_set_hash_net.c index 7c3d945517cf..1721cdecc9f9 100644 --- a/net/netfilter/ipset/ip_set_hash_net.c +++ b/net/netfilter/ipset/ip_set_hash_net.c | |||
@@ -460,6 +460,7 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
460 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 460 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
461 | struct ip_set_hash *h; | 461 | struct ip_set_hash *h; |
462 | u8 hbits; | 462 | u8 hbits; |
463 | size_t hsize; | ||
463 | 464 | ||
464 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 465 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
465 | return -IPSET_ERR_INVALID_FAMILY; | 466 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -489,9 +490,12 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
489 | h->timeout = IPSET_NO_TIMEOUT; | 490 | h->timeout = IPSET_NO_TIMEOUT; |
490 | 491 | ||
491 | hbits = htable_bits(hashsize); | 492 | hbits = htable_bits(hashsize); |
492 | h->table = ip_set_alloc( | 493 | hsize = htable_size(hbits); |
493 | sizeof(struct htable) | 494 | if (hsize == 0) { |
494 | + jhash_size(hbits) * sizeof(struct hbucket)); | 495 | kfree(h); |
496 | return -ENOMEM; | ||
497 | } | ||
498 | h->table = ip_set_alloc(hsize); | ||
495 | if (!h->table) { | 499 | if (!h->table) { |
496 | kfree(h); | 500 | kfree(h); |
497 | return -ENOMEM; | 501 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_netiface.c b/net/netfilter/ipset/ip_set_hash_netiface.c index f24037ff4322..33bafc97ca6d 100644 --- a/net/netfilter/ipset/ip_set_hash_netiface.c +++ b/net/netfilter/ipset/ip_set_hash_netiface.c | |||
@@ -722,6 +722,7 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
722 | struct ip_set_hash *h; | 722 | struct ip_set_hash *h; |
723 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 723 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
724 | u8 hbits; | 724 | u8 hbits; |
725 | size_t hsize; | ||
725 | 726 | ||
726 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 727 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
727 | return -IPSET_ERR_INVALID_FAMILY; | 728 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -752,9 +753,12 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
752 | h->ahash_max = AHASH_MAX_SIZE; | 753 | h->ahash_max = AHASH_MAX_SIZE; |
753 | 754 | ||
754 | hbits = htable_bits(hashsize); | 755 | hbits = htable_bits(hashsize); |
755 | h->table = ip_set_alloc( | 756 | hsize = htable_size(hbits); |
756 | sizeof(struct htable) | 757 | if (hsize == 0) { |
757 | + jhash_size(hbits) * sizeof(struct hbucket)); | 758 | kfree(h); |
759 | return -ENOMEM; | ||
760 | } | ||
761 | h->table = ip_set_alloc(hsize); | ||
758 | if (!h->table) { | 762 | if (!h->table) { |
759 | kfree(h); | 763 | kfree(h); |
760 | return -ENOMEM; | 764 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_netport.c b/net/netfilter/ipset/ip_set_hash_netport.c index ce2e77100b64..3a5e198641d6 100644 --- a/net/netfilter/ipset/ip_set_hash_netport.c +++ b/net/netfilter/ipset/ip_set_hash_netport.c | |||
@@ -572,6 +572,7 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
572 | struct ip_set_hash *h; | 572 | struct ip_set_hash *h; |
573 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 573 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
574 | u8 hbits; | 574 | u8 hbits; |
575 | size_t hsize; | ||
575 | 576 | ||
576 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 577 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
577 | return -IPSET_ERR_INVALID_FAMILY; | 578 | return -IPSET_ERR_INVALID_FAMILY; |
@@ -601,9 +602,12 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
601 | h->timeout = IPSET_NO_TIMEOUT; | 602 | h->timeout = IPSET_NO_TIMEOUT; |
602 | 603 | ||
603 | hbits = htable_bits(hashsize); | 604 | hbits = htable_bits(hashsize); |
604 | h->table = ip_set_alloc( | 605 | hsize = htable_size(hbits); |
605 | sizeof(struct htable) | 606 | if (hsize == 0) { |
606 | + jhash_size(hbits) * sizeof(struct hbucket)); | 607 | kfree(h); |
608 | return -ENOMEM; | ||
609 | } | ||
610 | h->table = ip_set_alloc(hsize); | ||
607 | if (!h->table) { | 611 | if (!h->table) { |
608 | kfree(h); | 612 | kfree(h); |
609 | return -ENOMEM; | 613 | return -ENOMEM; |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index e44e631ea952..e66341ec455c 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -321,7 +321,7 @@ static int queue_userspace_packet(int dp_ifindex, struct sk_buff *skb, | |||
321 | return -ENOMEM; | 321 | return -ENOMEM; |
322 | 322 | ||
323 | nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); | 323 | nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); |
324 | if (!skb) | 324 | if (!nskb) |
325 | return -ENOMEM; | 325 | return -ENOMEM; |
326 | 326 | ||
327 | nskb->vlan_tci = 0; | 327 | nskb->vlan_tci = 0; |
@@ -421,6 +421,19 @@ static int validate_sample(const struct nlattr *attr, | |||
421 | return validate_actions(actions, key, depth + 1); | 421 | return validate_actions(actions, key, depth + 1); |
422 | } | 422 | } |
423 | 423 | ||
424 | static int validate_tp_port(const struct sw_flow_key *flow_key) | ||
425 | { | ||
426 | if (flow_key->eth.type == htons(ETH_P_IP)) { | ||
427 | if (flow_key->ipv4.tp.src && flow_key->ipv4.tp.dst) | ||
428 | return 0; | ||
429 | } else if (flow_key->eth.type == htons(ETH_P_IPV6)) { | ||
430 | if (flow_key->ipv6.tp.src && flow_key->ipv6.tp.dst) | ||
431 | return 0; | ||
432 | } | ||
433 | |||
434 | return -EINVAL; | ||
435 | } | ||
436 | |||
424 | static int validate_set(const struct nlattr *a, | 437 | static int validate_set(const struct nlattr *a, |
425 | const struct sw_flow_key *flow_key) | 438 | const struct sw_flow_key *flow_key) |
426 | { | 439 | { |
@@ -462,18 +475,13 @@ static int validate_set(const struct nlattr *a, | |||
462 | if (flow_key->ip.proto != IPPROTO_TCP) | 475 | if (flow_key->ip.proto != IPPROTO_TCP) |
463 | return -EINVAL; | 476 | return -EINVAL; |
464 | 477 | ||
465 | if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) | 478 | return validate_tp_port(flow_key); |
466 | return -EINVAL; | ||
467 | |||
468 | break; | ||
469 | 479 | ||
470 | case OVS_KEY_ATTR_UDP: | 480 | case OVS_KEY_ATTR_UDP: |
471 | if (flow_key->ip.proto != IPPROTO_UDP) | 481 | if (flow_key->ip.proto != IPPROTO_UDP) |
472 | return -EINVAL; | 482 | return -EINVAL; |
473 | 483 | ||
474 | if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) | 484 | return validate_tp_port(flow_key); |
475 | return -EINVAL; | ||
476 | break; | ||
477 | 485 | ||
478 | default: | 486 | default: |
479 | return -EINVAL; | 487 | return -EINVAL; |
@@ -1641,10 +1649,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1641 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, | 1649 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, |
1642 | OVS_VPORT_CMD_NEW); | 1650 | OVS_VPORT_CMD_NEW); |
1643 | if (IS_ERR(reply)) { | 1651 | if (IS_ERR(reply)) { |
1644 | err = PTR_ERR(reply); | ||
1645 | netlink_set_err(init_net.genl_sock, 0, | 1652 | netlink_set_err(init_net.genl_sock, 0, |
1646 | ovs_dp_vport_multicast_group.id, err); | 1653 | ovs_dp_vport_multicast_group.id, PTR_ERR(reply)); |
1647 | return 0; | 1654 | goto exit_unlock; |
1648 | } | 1655 | } |
1649 | 1656 | ||
1650 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1657 | genl_notify(reply, genl_info_net(info), info->snd_pid, |
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 1252c3081ef1..2a11ec2383ee 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -183,7 +183,8 @@ void ovs_flow_used(struct sw_flow *flow, struct sk_buff *skb) | |||
183 | u8 tcp_flags = 0; | 183 | u8 tcp_flags = 0; |
184 | 184 | ||
185 | if (flow->key.eth.type == htons(ETH_P_IP) && | 185 | if (flow->key.eth.type == htons(ETH_P_IP) && |
186 | flow->key.ip.proto == IPPROTO_TCP) { | 186 | flow->key.ip.proto == IPPROTO_TCP && |
187 | likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { | ||
187 | u8 *tcp = (u8 *)tcp_hdr(skb); | 188 | u8 *tcp = (u8 *)tcp_hdr(skb); |
188 | tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK; | 189 | tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK; |
189 | } | 190 | } |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 817174eb5f41..8fc4dcd294ab 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -377,9 +377,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
377 | */ | 377 | */ |
378 | skb_set_owner_w(nskb, sk); | 378 | skb_set_owner_w(nskb, sk); |
379 | 379 | ||
380 | /* The 'obsolete' field of dst is set to 2 when a dst is freed. */ | 380 | if (!sctp_transport_dst_check(tp)) { |
381 | if (!dst || (dst->obsolete > 1)) { | ||
382 | dst_release(dst); | ||
383 | sctp_transport_route(tp, NULL, sctp_sk(sk)); | 381 | sctp_transport_route(tp, NULL, sctp_sk(sk)); |
384 | if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) { | 382 | if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) { |
385 | sctp_assoc_sync_pmtu(asoc); | 383 | sctp_assoc_sync_pmtu(asoc); |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 3889330b7b04..b026ba0c6992 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -226,23 +226,6 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) | |||
226 | transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; | 226 | transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; |
227 | } | 227 | } |
228 | 228 | ||
229 | /* this is a complete rip-off from __sk_dst_check | ||
230 | * the cookie is always 0 since this is how it's used in the | ||
231 | * pmtu code | ||
232 | */ | ||
233 | static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) | ||
234 | { | ||
235 | struct dst_entry *dst = t->dst; | ||
236 | |||
237 | if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) { | ||
238 | dst_release(t->dst); | ||
239 | t->dst = NULL; | ||
240 | return NULL; | ||
241 | } | ||
242 | |||
243 | return dst; | ||
244 | } | ||
245 | |||
246 | void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) | 229 | void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) |
247 | { | 230 | { |
248 | struct dst_entry *dst; | 231 | struct dst_entry *dst; |
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index ca8cad8251c7..782bfe1b6465 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c | |||
@@ -242,12 +242,13 @@ EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor); | |||
242 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) | 242 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) |
243 | { | 243 | { |
244 | struct gss_api_mech *pos = NULL; | 244 | struct gss_api_mech *pos = NULL; |
245 | int i = 0; | 245 | int j, i = 0; |
246 | 246 | ||
247 | spin_lock(®istered_mechs_lock); | 247 | spin_lock(®istered_mechs_lock); |
248 | list_for_each_entry(pos, ®istered_mechs, gm_list) { | 248 | list_for_each_entry(pos, ®istered_mechs, gm_list) { |
249 | array_ptr[i] = pos->gm_pfs->pseudoflavor; | 249 | for (j=0; j < pos->gm_pf_num; j++) { |
250 | i++; | 250 | array_ptr[i++] = pos->gm_pfs[j].pseudoflavor; |
251 | } | ||
251 | } | 252 | } |
252 | spin_unlock(®istered_mechs_lock); | 253 | spin_unlock(®istered_mechs_lock); |
253 | return i; | 254 | return i; |
diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c index 64417a733220..d8c670c9d62c 100644 --- a/sound/pci/echoaudio/echoaudio_dsp.c +++ b/sound/pci/echoaudio/echoaudio_dsp.c | |||
@@ -475,7 +475,7 @@ static int load_firmware(struct echoaudio *chip) | |||
475 | const struct firmware *fw; | 475 | const struct firmware *fw; |
476 | int box_type, err; | 476 | int box_type, err; |
477 | 477 | ||
478 | if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page)) | 478 | if (snd_BUG_ON(!chip->comm_page)) |
479 | return -EPERM; | 479 | return -EPERM; |
480 | 480 | ||
481 | /* See if the ASIC is present and working - only if the DSP is already loaded */ | 481 | /* See if the ASIC is present and working - only if the DSP is already loaded */ |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 7a8fcc4c15f8..841475cc13b6 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -5444,10 +5444,6 @@ int snd_hda_suspend(struct hda_bus *bus) | |||
5444 | list_for_each_entry(codec, &bus->codec_list, list) { | 5444 | list_for_each_entry(codec, &bus->codec_list, list) { |
5445 | if (hda_codec_is_power_on(codec)) | 5445 | if (hda_codec_is_power_on(codec)) |
5446 | hda_call_codec_suspend(codec); | 5446 | hda_call_codec_suspend(codec); |
5447 | else /* forcibly change the power to D3 even if not used */ | ||
5448 | hda_set_power_state(codec, | ||
5449 | codec->afg ? codec->afg : codec->mfg, | ||
5450 | AC_PWRST_D3); | ||
5451 | if (codec->patch_ops.post_suspend) | 5447 | if (codec->patch_ops.post_suspend) |
5452 | codec->patch_ops.post_suspend(codec); | 5448 | codec->patch_ops.post_suspend(codec); |
5453 | } | 5449 | } |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index c19e71a94e1b..1f350522bed4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -783,11 +783,13 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
783 | { | 783 | { |
784 | struct azx *chip = bus->private_data; | 784 | struct azx *chip = bus->private_data; |
785 | unsigned long timeout; | 785 | unsigned long timeout; |
786 | unsigned long loopcounter; | ||
786 | int do_poll = 0; | 787 | int do_poll = 0; |
787 | 788 | ||
788 | again: | 789 | again: |
789 | timeout = jiffies + msecs_to_jiffies(1000); | 790 | timeout = jiffies + msecs_to_jiffies(1000); |
790 | for (;;) { | 791 | |
792 | for (loopcounter = 0;; loopcounter++) { | ||
791 | if (chip->polling_mode || do_poll) { | 793 | if (chip->polling_mode || do_poll) { |
792 | spin_lock_irq(&chip->reg_lock); | 794 | spin_lock_irq(&chip->reg_lock); |
793 | azx_update_rirb(chip); | 795 | azx_update_rirb(chip); |
@@ -803,7 +805,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
803 | } | 805 | } |
804 | if (time_after(jiffies, timeout)) | 806 | if (time_after(jiffies, timeout)) |
805 | break; | 807 | break; |
806 | if (bus->needs_damn_long_delay) | 808 | if (bus->needs_damn_long_delay || loopcounter > 3000) |
807 | msleep(2); /* temporary workaround */ | 809 | msleep(2); /* temporary workaround */ |
808 | else { | 810 | else { |
809 | udelay(10); | 811 | udelay(10); |
@@ -2351,6 +2353,17 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2351 | * power management | 2353 | * power management |
2352 | */ | 2354 | */ |
2353 | 2355 | ||
2356 | static int snd_hda_codecs_inuse(struct hda_bus *bus) | ||
2357 | { | ||
2358 | struct hda_codec *codec; | ||
2359 | |||
2360 | list_for_each_entry(codec, &bus->codec_list, list) { | ||
2361 | if (snd_hda_codec_needs_resume(codec)) | ||
2362 | return 1; | ||
2363 | } | ||
2364 | return 0; | ||
2365 | } | ||
2366 | |||
2354 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) | 2367 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) |
2355 | { | 2368 | { |
2356 | struct snd_card *card = pci_get_drvdata(pci); | 2369 | struct snd_card *card = pci_get_drvdata(pci); |
@@ -2397,7 +2410,8 @@ static int azx_resume(struct pci_dev *pci) | |||
2397 | return -EIO; | 2410 | return -EIO; |
2398 | azx_init_pci(chip); | 2411 | azx_init_pci(chip); |
2399 | 2412 | ||
2400 | azx_init_chip(chip, 1); | 2413 | if (snd_hda_codecs_inuse(chip->bus)) |
2414 | azx_init_chip(chip, 1); | ||
2401 | 2415 | ||
2402 | snd_hda_resume(chip->bus); | 2416 | snd_hda_resume(chip->bus); |
2403 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2417 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 818f90bc7d57..7810913d07a0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -5405,6 +5405,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
5405 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", | 5405 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
5406 | ALC882_FIXUP_ACER_ASPIRE_4930G), | 5406 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
5407 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), | 5407 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
5408 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", | ||
5409 | ALC882_FIXUP_ACER_ASPIRE_4930G), | ||
5408 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), | 5410 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
5409 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), | 5411 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
5410 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), | 5412 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
@@ -5438,6 +5440,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
5438 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), | 5440 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), |
5439 | 5441 | ||
5440 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), | 5442 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
5443 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), | ||
5441 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), | 5444 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
5442 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), | 5445 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), |
5443 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), | 5446 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
@@ -5638,13 +5641,13 @@ static int patch_alc262(struct hda_codec *codec) | |||
5638 | snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); | 5641 | snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); |
5639 | } | 5642 | } |
5640 | #endif | 5643 | #endif |
5641 | alc_auto_parse_customize_define(codec); | ||
5642 | |||
5643 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | 5644 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
5644 | 5645 | ||
5645 | alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); | 5646 | alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); |
5646 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | 5647 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); |
5647 | 5648 | ||
5649 | alc_auto_parse_customize_define(codec); | ||
5650 | |||
5648 | /* automatic parse from the BIOS config */ | 5651 | /* automatic parse from the BIOS config */ |
5649 | err = alc262_parse_auto_config(codec); | 5652 | err = alc262_parse_auto_config(codec); |
5650 | if (err < 0) | 5653 | if (err < 0) |
@@ -6249,8 +6252,6 @@ static int patch_alc269(struct hda_codec *codec) | |||
6249 | 6252 | ||
6250 | spec->mixer_nid = 0x0b; | 6253 | spec->mixer_nid = 0x0b; |
6251 | 6254 | ||
6252 | alc_auto_parse_customize_define(codec); | ||
6253 | |||
6254 | err = alc_codec_rename_from_preset(codec); | 6255 | err = alc_codec_rename_from_preset(codec); |
6255 | if (err < 0) | 6256 | if (err < 0) |
6256 | goto error; | 6257 | goto error; |
@@ -6283,6 +6284,8 @@ static int patch_alc269(struct hda_codec *codec) | |||
6283 | alc269_fixup_tbl, alc269_fixups); | 6284 | alc269_fixup_tbl, alc269_fixups); |
6284 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | 6285 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); |
6285 | 6286 | ||
6287 | alc_auto_parse_customize_define(codec); | ||
6288 | |||
6286 | /* automatic parse from the BIOS config */ | 6289 | /* automatic parse from the BIOS config */ |
6287 | err = alc269_parse_auto_config(codec); | 6290 | err = alc269_parse_auto_config(codec); |
6288 | if (err < 0) | 6291 | if (err < 0) |
@@ -6859,8 +6862,6 @@ static int patch_alc662(struct hda_codec *codec) | |||
6859 | /* handle multiple HPs as is */ | 6862 | /* handle multiple HPs as is */ |
6860 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | 6863 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
6861 | 6864 | ||
6862 | alc_auto_parse_customize_define(codec); | ||
6863 | |||
6864 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 6865 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
6865 | 6866 | ||
6866 | err = alc_codec_rename_from_preset(codec); | 6867 | err = alc_codec_rename_from_preset(codec); |
@@ -6877,6 +6878,9 @@ static int patch_alc662(struct hda_codec *codec) | |||
6877 | alc_pick_fixup(codec, alc662_fixup_models, | 6878 | alc_pick_fixup(codec, alc662_fixup_models, |
6878 | alc662_fixup_tbl, alc662_fixups); | 6879 | alc662_fixup_tbl, alc662_fixups); |
6879 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | 6880 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); |
6881 | |||
6882 | alc_auto_parse_customize_define(codec); | ||
6883 | |||
6880 | /* automatic parse from the BIOS config */ | 6884 | /* automatic parse from the BIOS config */ |
6881 | err = alc662_parse_auto_config(codec); | 6885 | err = alc662_parse_auto_config(codec); |
6882 | if (err < 0) | 6886 | if (err < 0) |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 4742cac26aa9..2cb1e08f962a 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4415,9 +4415,9 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4415 | def_conf = get_defcfg_connect(def_conf); | 4415 | def_conf = get_defcfg_connect(def_conf); |
4416 | /* skip any ports that don't have jacks since presence | 4416 | /* skip any ports that don't have jacks since presence |
4417 | * detection is useless */ | 4417 | * detection is useless */ |
4418 | if (def_conf != AC_JACK_PORT_COMPLEX) { | 4418 | if (def_conf != AC_JACK_PORT_NONE && |
4419 | if (def_conf != AC_JACK_PORT_NONE) | 4419 | !is_jack_detectable(codec, nid)) { |
4420 | stac_toggle_power_map(codec, nid, 1); | 4420 | stac_toggle_power_map(codec, nid, 1); |
4421 | continue; | 4421 | continue; |
4422 | } | 4422 | } |
4423 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { | 4423 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index b68cdec03b9e..0b2aea2ce172 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -5170,6 +5170,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp) | |||
5170 | strcpy(hw->name, "HDSP hwdep interface"); | 5170 | strcpy(hw->name, "HDSP hwdep interface"); |
5171 | 5171 | ||
5172 | hw->ops.ioctl = snd_hdsp_hwdep_ioctl; | 5172 | hw->ops.ioctl = snd_hdsp_hwdep_ioctl; |
5173 | hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl; | ||
5173 | 5174 | ||
5174 | return 0; | 5175 | return 0; |
5175 | } | 5176 | } |
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 07c44b71f096..3686417f5ea5 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c | |||
@@ -568,22 +568,22 @@ static const struct snd_kcontrol_new cs42l73_snd_controls[] = { | |||
568 | attn_tlv), | 568 | attn_tlv), |
569 | 569 | ||
570 | SOC_SINGLE_TLV("SPK-IP Mono Volume", | 570 | SOC_SINGLE_TLV("SPK-IP Mono Volume", |
571 | CS42L73_SPKMIPMA, 0, 0x3E, 1, attn_tlv), | 571 | CS42L73_SPKMIPMA, 0, 0x3F, 1, attn_tlv), |
572 | SOC_SINGLE_TLV("SPK-XSP Mono Volume", | 572 | SOC_SINGLE_TLV("SPK-XSP Mono Volume", |
573 | CS42L73_SPKMXSPA, 0, 0x3E, 1, attn_tlv), | 573 | CS42L73_SPKMXSPA, 0, 0x3F, 1, attn_tlv), |
574 | SOC_SINGLE_TLV("SPK-ASP Mono Volume", | 574 | SOC_SINGLE_TLV("SPK-ASP Mono Volume", |
575 | CS42L73_SPKMASPA, 0, 0x3E, 1, attn_tlv), | 575 | CS42L73_SPKMASPA, 0, 0x3F, 1, attn_tlv), |
576 | SOC_SINGLE_TLV("SPK-VSP Mono Volume", | 576 | SOC_SINGLE_TLV("SPK-VSP Mono Volume", |
577 | CS42L73_SPKMVSPMA, 0, 0x3E, 1, attn_tlv), | 577 | CS42L73_SPKMVSPMA, 0, 0x3F, 1, attn_tlv), |
578 | 578 | ||
579 | SOC_SINGLE_TLV("ESL-IP Mono Volume", | 579 | SOC_SINGLE_TLV("ESL-IP Mono Volume", |
580 | CS42L73_ESLMIPMA, 0, 0x3E, 1, attn_tlv), | 580 | CS42L73_ESLMIPMA, 0, 0x3F, 1, attn_tlv), |
581 | SOC_SINGLE_TLV("ESL-XSP Mono Volume", | 581 | SOC_SINGLE_TLV("ESL-XSP Mono Volume", |
582 | CS42L73_ESLMXSPA, 0, 0x3E, 1, attn_tlv), | 582 | CS42L73_ESLMXSPA, 0, 0x3F, 1, attn_tlv), |
583 | SOC_SINGLE_TLV("ESL-ASP Mono Volume", | 583 | SOC_SINGLE_TLV("ESL-ASP Mono Volume", |
584 | CS42L73_ESLMASPA, 0, 0x3E, 1, attn_tlv), | 584 | CS42L73_ESLMASPA, 0, 0x3F, 1, attn_tlv), |
585 | SOC_SINGLE_TLV("ESL-VSP Mono Volume", | 585 | SOC_SINGLE_TLV("ESL-VSP Mono Volume", |
586 | CS42L73_ESLMVSPMA, 0, 0x3E, 1, attn_tlv), | 586 | CS42L73_ESLMVSPMA, 0, 0x3F, 1, attn_tlv), |
587 | 587 | ||
588 | SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), | 588 | SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), |
589 | 589 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 6c1fe3afd4b5..2de12ebe43b5 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1144,7 +1144,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, | |||
1144 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1144 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
1145 | WM8994_AIF2DACL_ENA | | 1145 | WM8994_AIF2DACL_ENA | |
1146 | WM8994_AIF2DACR_ENA, 0); | 1146 | WM8994_AIF2DACR_ENA, 0); |
1147 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1147 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, |
1148 | WM8994_AIF2ADCL_ENA | | 1148 | WM8994_AIF2ADCL_ENA | |
1149 | WM8994_AIF2ADCR_ENA, 0); | 1149 | WM8994_AIF2ADCR_ENA, 0); |
1150 | 1150 | ||
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c index 9d9ad8d61c0a..8526e1edaf45 100644 --- a/sound/soc/sh/migor.c +++ b/sound/soc/sh/migor.c | |||
@@ -35,7 +35,7 @@ static unsigned long siumckb_recalc(struct clk *clk) | |||
35 | return codec_freq; | 35 | return codec_freq; |
36 | } | 36 | } |
37 | 37 | ||
38 | static struct clk_ops siumckb_clk_ops = { | 38 | static struct sh_clk_ops siumckb_clk_ops = { |
39 | .recalc = siumckb_recalc, | 39 | .recalc = siumckb_recalc, |
40 | }; | 40 | }; |
41 | 41 | ||
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 9bf3fc759344..92271d32bc30 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -774,10 +774,10 @@ $(OUTPUT)perf.o perf.spec \ | |||
774 | # over the general rule for .o | 774 | # over the general rule for .o |
775 | 775 | ||
776 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS | 776 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS |
777 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | 777 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $< |
778 | 778 | ||
779 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS | 779 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS |
780 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | 780 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $< |
781 | 781 | ||
782 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS | 782 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS |
783 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 783 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c941bb640f49..1e5e9b270f5e 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -283,6 +283,8 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, | |||
283 | { | 283 | { |
284 | struct perf_event_attr *attr = &evsel->attr; | 284 | struct perf_event_attr *attr = &evsel->attr; |
285 | struct xyarray *group_fd = NULL; | 285 | struct xyarray *group_fd = NULL; |
286 | bool exclude_guest_missing = false; | ||
287 | int ret; | ||
286 | 288 | ||
287 | if (group && evsel != first) | 289 | if (group && evsel != first) |
288 | group_fd = first->fd; | 290 | group_fd = first->fd; |
@@ -293,16 +295,39 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, | |||
293 | 295 | ||
294 | attr->inherit = !no_inherit; | 296 | attr->inherit = !no_inherit; |
295 | 297 | ||
296 | if (system_wide) | 298 | retry: |
297 | return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, | 299 | if (exclude_guest_missing) |
300 | evsel->attr.exclude_guest = evsel->attr.exclude_host = 0; | ||
301 | |||
302 | if (system_wide) { | ||
303 | ret = perf_evsel__open_per_cpu(evsel, evsel_list->cpus, | ||
298 | group, group_fd); | 304 | group, group_fd); |
305 | if (ret) | ||
306 | goto check_ret; | ||
307 | return 0; | ||
308 | } | ||
309 | |||
299 | if (!target_pid && !target_tid && (!group || evsel == first)) { | 310 | if (!target_pid && !target_tid && (!group || evsel == first)) { |
300 | attr->disabled = 1; | 311 | attr->disabled = 1; |
301 | attr->enable_on_exec = 1; | 312 | attr->enable_on_exec = 1; |
302 | } | 313 | } |
303 | 314 | ||
304 | return perf_evsel__open_per_thread(evsel, evsel_list->threads, | 315 | ret = perf_evsel__open_per_thread(evsel, evsel_list->threads, |
305 | group, group_fd); | 316 | group, group_fd); |
317 | if (!ret) | ||
318 | return 0; | ||
319 | /* fall through */ | ||
320 | check_ret: | ||
321 | if (ret && errno == EINVAL) { | ||
322 | if (!exclude_guest_missing && | ||
323 | (evsel->attr.exclude_guest || evsel->attr.exclude_host)) { | ||
324 | pr_debug("Old kernel, cannot exclude " | ||
325 | "guest or host samples.\n"); | ||
326 | exclude_guest_missing = true; | ||
327 | goto retry; | ||
328 | } | ||
329 | } | ||
330 | return ret; | ||
306 | } | 331 | } |
307 | 332 | ||
308 | /* | 333 | /* |
@@ -463,8 +488,13 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
463 | 488 | ||
464 | list_for_each_entry(counter, &evsel_list->entries, node) { | 489 | list_for_each_entry(counter, &evsel_list->entries, node) { |
465 | if (create_perf_stat_counter(counter, first) < 0) { | 490 | if (create_perf_stat_counter(counter, first) < 0) { |
491 | /* | ||
492 | * PPC returns ENXIO for HW counters until 2.6.37 | ||
493 | * (behavior changed with commit b0a873e). | ||
494 | */ | ||
466 | if (errno == EINVAL || errno == ENOSYS || | 495 | if (errno == EINVAL || errno == ENOSYS || |
467 | errno == ENOENT || errno == EOPNOTSUPP) { | 496 | errno == ENOENT || errno == EOPNOTSUPP || |
497 | errno == ENXIO) { | ||
468 | if (verbose) | 498 | if (verbose) |
469 | ui__warning("%s event is not supported by the kernel.\n", | 499 | ui__warning("%s event is not supported by the kernel.\n", |
470 | event_name(counter)); | 500 | event_name(counter)); |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 4c7c2d73251f..c0b70c697a36 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -296,7 +296,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, | |||
296 | if (mkdir_p(filename, 0755)) | 296 | if (mkdir_p(filename, 0755)) |
297 | goto out_free; | 297 | goto out_free; |
298 | 298 | ||
299 | snprintf(filename + len, sizeof(filename) - len, "/%s", sbuild_id); | 299 | snprintf(filename + len, size - len, "/%s", sbuild_id); |
300 | 300 | ||
301 | if (access(filename, F_OK)) { | 301 | if (access(filename, F_OK)) { |
302 | if (is_kallsyms) { | 302 | if (is_kallsyms) { |