diff options
92 files changed, 1718 insertions, 658 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 59203e77ce9e..ff8e763eaa50 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3598,6 +3598,49 @@ F: drivers/hid/hid-hyperv.c | |||
| 3598 | F: drivers/net/hyperv/ | 3598 | F: drivers/net/hyperv/ |
| 3599 | F: drivers/staging/hv/ | 3599 | F: drivers/staging/hv/ |
| 3600 | 3600 | ||
| 3601 | I2C OVER PARALLEL PORT | ||
| 3602 | M: Jean Delvare <khali@linux-fr.org> | ||
| 3603 | L: linux-i2c@vger.kernel.org | ||
| 3604 | S: Maintained | ||
| 3605 | F: Documentation/i2c/busses/i2c-parport | ||
| 3606 | F: Documentation/i2c/busses/i2c-parport-light | ||
| 3607 | F: drivers/i2c/busses/i2c-parport.c | ||
| 3608 | F: drivers/i2c/busses/i2c-parport-light.c | ||
| 3609 | |||
| 3610 | I2C/SMBUS CONTROLLER DRIVERS FOR PC | ||
| 3611 | M: Jean Delvare <khali@linux-fr.org> | ||
| 3612 | L: linux-i2c@vger.kernel.org | ||
| 3613 | S: Maintained | ||
| 3614 | F: Documentation/i2c/busses/i2c-ali1535 | ||
| 3615 | F: Documentation/i2c/busses/i2c-ali1563 | ||
| 3616 | F: Documentation/i2c/busses/i2c-ali15x3 | ||
| 3617 | F: Documentation/i2c/busses/i2c-amd756 | ||
| 3618 | F: Documentation/i2c/busses/i2c-amd8111 | ||
| 3619 | F: Documentation/i2c/busses/i2c-i801 | ||
| 3620 | F: Documentation/i2c/busses/i2c-nforce2 | ||
| 3621 | F: Documentation/i2c/busses/i2c-piix4 | ||
| 3622 | F: Documentation/i2c/busses/i2c-sis5595 | ||
| 3623 | F: Documentation/i2c/busses/i2c-sis630 | ||
| 3624 | F: Documentation/i2c/busses/i2c-sis96x | ||
| 3625 | F: Documentation/i2c/busses/i2c-via | ||
| 3626 | F: Documentation/i2c/busses/i2c-viapro | ||
| 3627 | F: drivers/i2c/busses/i2c-ali1535.c | ||
| 3628 | F: drivers/i2c/busses/i2c-ali1563.c | ||
| 3629 | F: drivers/i2c/busses/i2c-ali15x3.c | ||
| 3630 | F: drivers/i2c/busses/i2c-amd756.c | ||
| 3631 | F: drivers/i2c/busses/i2c-amd756-s4882.c | ||
| 3632 | F: drivers/i2c/busses/i2c-amd8111.c | ||
| 3633 | F: drivers/i2c/busses/i2c-i801.c | ||
| 3634 | F: drivers/i2c/busses/i2c-isch.c | ||
| 3635 | F: drivers/i2c/busses/i2c-nforce2.c | ||
| 3636 | F: drivers/i2c/busses/i2c-nforce2-s4985.c | ||
| 3637 | F: drivers/i2c/busses/i2c-piix4.c | ||
| 3638 | F: drivers/i2c/busses/i2c-sis5595.c | ||
| 3639 | F: drivers/i2c/busses/i2c-sis630.c | ||
| 3640 | F: drivers/i2c/busses/i2c-sis96x.c | ||
| 3641 | F: drivers/i2c/busses/i2c-via.c | ||
| 3642 | F: drivers/i2c/busses/i2c-viapro.c | ||
| 3643 | |||
| 3601 | I2C/SMBUS STUB DRIVER | 3644 | I2C/SMBUS STUB DRIVER |
| 3602 | M: "Mark M. Hoffman" <mhoffman@lightlink.com> | 3645 | M: "Mark M. Hoffman" <mhoffman@lightlink.com> |
| 3603 | L: linux-i2c@vger.kernel.org | 3646 | L: linux-i2c@vger.kernel.org |
| @@ -3605,9 +3648,8 @@ S: Maintained | |||
| 3605 | F: drivers/i2c/busses/i2c-stub.c | 3648 | F: drivers/i2c/busses/i2c-stub.c |
| 3606 | 3649 | ||
| 3607 | I2C SUBSYSTEM | 3650 | I2C SUBSYSTEM |
| 3608 | M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org> | 3651 | M: Wolfram Sang <w.sang@pengutronix.de> |
| 3609 | M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org> | 3652 | M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org> |
| 3610 | M: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de> | ||
| 3611 | L: linux-i2c@vger.kernel.org | 3653 | L: linux-i2c@vger.kernel.org |
| 3612 | W: http://i2c.wiki.kernel.org/ | 3654 | W: http://i2c.wiki.kernel.org/ |
| 3613 | T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ | 3655 | T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ |
| @@ -3618,6 +3660,13 @@ F: drivers/i2c/ | |||
| 3618 | F: include/linux/i2c.h | 3660 | F: include/linux/i2c.h |
| 3619 | F: include/linux/i2c-*.h | 3661 | F: include/linux/i2c-*.h |
| 3620 | 3662 | ||
| 3663 | I2C-TAOS-EVM DRIVER | ||
| 3664 | M: Jean Delvare <khali@linux-fr.org> | ||
| 3665 | L: linux-i2c@vger.kernel.org | ||
| 3666 | S: Maintained | ||
| 3667 | F: Documentation/i2c/busses/i2c-taos-evm | ||
| 3668 | F: drivers/i2c/busses/i2c-taos-evm.c | ||
| 3669 | |||
| 3621 | I2C-TINY-USB DRIVER | 3670 | I2C-TINY-USB DRIVER |
| 3622 | M: Till Harbaum <till@harbaum.org> | 3671 | M: Till Harbaum <till@harbaum.org> |
| 3623 | L: linux-i2c@vger.kernel.org | 3672 | L: linux-i2c@vger.kernel.org |
| @@ -7887,13 +7936,6 @@ M: Roger Luethi <rl@hellgate.ch> | |||
| 7887 | S: Maintained | 7936 | S: Maintained |
| 7888 | F: drivers/net/ethernet/via/via-rhine.c | 7937 | F: drivers/net/ethernet/via/via-rhine.c |
| 7889 | 7938 | ||
| 7890 | VIAPRO SMBUS DRIVER | ||
| 7891 | M: Jean Delvare <khali@linux-fr.org> | ||
| 7892 | L: linux-i2c@vger.kernel.org | ||
| 7893 | S: Maintained | ||
| 7894 | F: Documentation/i2c/busses/i2c-viapro | ||
| 7895 | F: drivers/i2c/busses/i2c-viapro.c | ||
| 7896 | |||
| 7897 | VIA SD/MMC CARD CONTROLLER DRIVER | 7939 | VIA SD/MMC CARD CONTROLLER DRIVER |
| 7898 | M: Bruce Chang <brucechang@via.com.tw> | 7940 | M: Bruce Chang <brucechang@via.com.tw> |
| 7899 | M: Harald Welte <HaraldWelte@viatech.com> | 7941 | M: Harald Welte <HaraldWelte@viatech.com> |
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 54f6116697f7..d2f05a608274 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h | |||
| @@ -222,7 +222,7 @@ extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot | |||
| 222 | extern void __iounmap(volatile void __iomem *addr); | 222 | extern void __iounmap(volatile void __iomem *addr); |
| 223 | 223 | ||
| 224 | #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) | 224 | #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) |
| 225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) | 225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) |
| 226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) | 226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) |
| 227 | 227 | ||
| 228 | #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) | 228 | #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) |
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index 0f3b4581d925..75fd13d289b9 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h | |||
| @@ -38,7 +38,8 @@ | |||
| 38 | #define PMD_SECT_S (_AT(pmdval_t, 3) << 8) | 38 | #define PMD_SECT_S (_AT(pmdval_t, 3) << 8) |
| 39 | #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) | 39 | #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) |
| 40 | #define PMD_SECT_NG (_AT(pmdval_t, 1) << 11) | 40 | #define PMD_SECT_NG (_AT(pmdval_t, 1) << 11) |
| 41 | #define PMD_SECT_XN (_AT(pmdval_t, 1) << 54) | 41 | #define PMD_SECT_PXN (_AT(pmdval_t, 1) << 53) |
| 42 | #define PMD_SECT_UXN (_AT(pmdval_t, 1) << 54) | ||
| 42 | 43 | ||
| 43 | /* | 44 | /* |
| 44 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). | 45 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). |
| @@ -57,7 +58,8 @@ | |||
| 57 | #define PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ | 58 | #define PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ |
| 58 | #define PTE_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ | 59 | #define PTE_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ |
| 59 | #define PTE_NG (_AT(pteval_t, 1) << 11) /* nG */ | 60 | #define PTE_NG (_AT(pteval_t, 1) << 11) /* nG */ |
| 60 | #define PTE_XN (_AT(pteval_t, 1) << 54) /* XN */ | 61 | #define PTE_PXN (_AT(pteval_t, 1) << 53) /* Privileged XN */ |
| 62 | #define PTE_UXN (_AT(pteval_t, 1) << 54) /* User XN */ | ||
| 61 | 63 | ||
| 62 | /* | 64 | /* |
| 63 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). | 65 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 8960239be722..14aba2db6776 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
| @@ -62,23 +62,23 @@ extern pgprot_t pgprot_default; | |||
| 62 | 62 | ||
| 63 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) | 63 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) |
| 64 | 64 | ||
| 65 | #define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_XN | PTE_RDONLY) | 65 | #define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 66 | #define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN) | 66 | #define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN) |
| 67 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG) | 67 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN) |
| 68 | #define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 68 | #define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 69 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY) | 69 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
| 70 | #define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 70 | #define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 71 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY) | 71 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
| 72 | #define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_XN | PTE_DIRTY) | 72 | #define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_PXN | PTE_UXN | PTE_DIRTY) |
| 73 | #define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_DIRTY) | 73 | #define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_UXN | PTE_DIRTY) |
| 74 | 74 | ||
| 75 | #define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_XN | PTE_RDONLY) | 75 | #define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 76 | #define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN) | 76 | #define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN) |
| 77 | #define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG) | 77 | #define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN) |
| 78 | #define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 78 | #define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 79 | #define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY) | 79 | #define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
| 80 | #define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 80 | #define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
| 81 | #define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY) | 81 | #define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
| 82 | 82 | ||
| 83 | #endif /* __ASSEMBLY__ */ | 83 | #endif /* __ASSEMBLY__ */ |
| 84 | 84 | ||
| @@ -130,10 +130,10 @@ extern struct page *empty_zero_page; | |||
| 130 | #define pte_young(pte) (pte_val(pte) & PTE_AF) | 130 | #define pte_young(pte) (pte_val(pte) & PTE_AF) |
| 131 | #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) | 131 | #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) |
| 132 | #define pte_write(pte) (!(pte_val(pte) & PTE_RDONLY)) | 132 | #define pte_write(pte) (!(pte_val(pte) & PTE_RDONLY)) |
| 133 | #define pte_exec(pte) (!(pte_val(pte) & PTE_XN)) | 133 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) |
| 134 | 134 | ||
| 135 | #define pte_present_exec_user(pte) \ | 135 | #define pte_present_exec_user(pte) \ |
| 136 | ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_XN)) == \ | 136 | ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == \ |
| 137 | (PTE_VALID | PTE_USER)) | 137 | (PTE_VALID | PTE_USER)) |
| 138 | 138 | ||
| 139 | #define PTE_BIT_FUNC(fn,op) \ | 139 | #define PTE_BIT_FUNC(fn,op) \ |
| @@ -262,7 +262,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) | |||
| 262 | 262 | ||
| 263 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 263 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
| 264 | { | 264 | { |
| 265 | const pteval_t mask = PTE_USER | PTE_XN | PTE_RDONLY; | 265 | const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY; |
| 266 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); | 266 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); |
| 267 | return pte; | 267 | return pte; |
| 268 | } | 268 | } |
diff --git a/arch/mips/cavium-octeon/executive/cvmx-l2c.c b/arch/mips/cavium-octeon/executive/cvmx-l2c.c index d38246e33ddb..9f883bf76953 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-l2c.c +++ b/arch/mips/cavium-octeon/executive/cvmx-l2c.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | * measurement, and debugging facilities. | 30 | * measurement, and debugging facilities. |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include <linux/irqflags.h> | ||
| 33 | #include <asm/octeon/cvmx.h> | 34 | #include <asm/octeon/cvmx.h> |
| 34 | #include <asm/octeon/cvmx-l2c.h> | 35 | #include <asm/octeon/cvmx-l2c.h> |
| 35 | #include <asm/octeon/cvmx-spinlock.h> | 36 | #include <asm/octeon/cvmx-spinlock.h> |
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 82ad35ce2b45..46ac73abd5ee 100644 --- a/arch/mips/include/asm/bitops.h +++ b/arch/mips/include/asm/bitops.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <linux/irqflags.h> | ||
| 18 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 19 | #include <asm/barrier.h> | 18 | #include <asm/barrier.h> |
| 20 | #include <asm/byteorder.h> /* sigh ... */ | 19 | #include <asm/byteorder.h> /* sigh ... */ |
| @@ -44,6 +43,24 @@ | |||
| 44 | #define smp_mb__before_clear_bit() smp_mb__before_llsc() | 43 | #define smp_mb__before_clear_bit() smp_mb__before_llsc() |
| 45 | #define smp_mb__after_clear_bit() smp_llsc_mb() | 44 | #define smp_mb__after_clear_bit() smp_llsc_mb() |
| 46 | 45 | ||
| 46 | |||
| 47 | /* | ||
| 48 | * These are the "slower" versions of the functions and are in bitops.c. | ||
| 49 | * These functions call raw_local_irq_{save,restore}(). | ||
| 50 | */ | ||
| 51 | void __mips_set_bit(unsigned long nr, volatile unsigned long *addr); | ||
| 52 | void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr); | ||
| 53 | void __mips_change_bit(unsigned long nr, volatile unsigned long *addr); | ||
| 54 | int __mips_test_and_set_bit(unsigned long nr, | ||
| 55 | volatile unsigned long *addr); | ||
| 56 | int __mips_test_and_set_bit_lock(unsigned long nr, | ||
| 57 | volatile unsigned long *addr); | ||
| 58 | int __mips_test_and_clear_bit(unsigned long nr, | ||
| 59 | volatile unsigned long *addr); | ||
| 60 | int __mips_test_and_change_bit(unsigned long nr, | ||
| 61 | volatile unsigned long *addr); | ||
| 62 | |||
| 63 | |||
| 47 | /* | 64 | /* |
| 48 | * set_bit - Atomically set a bit in memory | 65 | * set_bit - Atomically set a bit in memory |
| 49 | * @nr: the bit to set | 66 | * @nr: the bit to set |
| @@ -57,7 +74,7 @@ | |||
| 57 | static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | 74 | static inline void set_bit(unsigned long nr, volatile unsigned long *addr) |
| 58 | { | 75 | { |
| 59 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 76 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
| 60 | unsigned short bit = nr & SZLONG_MASK; | 77 | int bit = nr & SZLONG_MASK; |
| 61 | unsigned long temp; | 78 | unsigned long temp; |
| 62 | 79 | ||
| 63 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 80 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
| @@ -92,17 +109,8 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
| 92 | : "=&r" (temp), "+m" (*m) | 109 | : "=&r" (temp), "+m" (*m) |
| 93 | : "ir" (1UL << bit)); | 110 | : "ir" (1UL << bit)); |
| 94 | } while (unlikely(!temp)); | 111 | } while (unlikely(!temp)); |
| 95 | } else { | 112 | } else |
| 96 | volatile unsigned long *a = addr; | 113 | __mips_set_bit(nr, addr); |
| 97 | unsigned long mask; | ||
| 98 | unsigned long flags; | ||
| 99 | |||
| 100 | a += nr >> SZLONG_LOG; | ||
| 101 | mask = 1UL << bit; | ||
| 102 | raw_local_irq_save(flags); | ||
| 103 | *a |= mask; | ||
| 104 | raw_local_irq_restore(flags); | ||
| 105 | } | ||
| 106 | } | 114 | } |
| 107 | 115 | ||
| 108 | /* | 116 | /* |
| @@ -118,7 +126,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
| 118 | static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | 126 | static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) |
| 119 | { | 127 | { |
| 120 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 128 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
| 121 | unsigned short bit = nr & SZLONG_MASK; | 129 | int bit = nr & SZLONG_MASK; |
| 122 | unsigned long temp; | 130 | unsigned long temp; |
| 123 | 131 | ||
| 124 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 132 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
| @@ -153,17 +161,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
| 153 | : "=&r" (temp), "+m" (*m) | 161 | : "=&r" (temp), "+m" (*m) |
| 154 | : "ir" (~(1UL << bit))); | 162 | : "ir" (~(1UL << bit))); |
| 155 | } while (unlikely(!temp)); | 163 | } while (unlikely(!temp)); |
| 156 | } else { | 164 | } else |
| 157 | volatile unsigned long *a = addr; | 165 | __mips_clear_bit(nr, addr); |
| 158 | unsigned long mask; | ||
| 159 | unsigned long flags; | ||
| 160 | |||
| 161 | a += nr >> SZLONG_LOG; | ||
| 162 | mask = 1UL << bit; | ||
| 163 | raw_local_irq_save(flags); | ||
| 164 | *a &= ~mask; | ||
| 165 | raw_local_irq_restore(flags); | ||
| 166 | } | ||
| 167 | } | 166 | } |
| 168 | 167 | ||
| 169 | /* | 168 | /* |
| @@ -191,7 +190,7 @@ static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *ad | |||
| 191 | */ | 190 | */ |
| 192 | static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | 191 | static inline void change_bit(unsigned long nr, volatile unsigned long *addr) |
| 193 | { | 192 | { |
| 194 | unsigned short bit = nr & SZLONG_MASK; | 193 | int bit = nr & SZLONG_MASK; |
| 195 | 194 | ||
| 196 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 195 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
| 197 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 196 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
| @@ -220,17 +219,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
| 220 | : "=&r" (temp), "+m" (*m) | 219 | : "=&r" (temp), "+m" (*m) |
| 221 | : "ir" (1UL << bit)); | 220 | : "ir" (1UL << bit)); |
| 222 | } while (unlikely(!temp)); | 221 | } while (unlikely(!temp)); |
| 223 | } else { | 222 | } else |
| 224 | volatile unsigned long *a = addr; | 223 | __mips_change_bit(nr, addr); |
| 225 | unsigned long mask; | ||
| 226 | unsigned long flags; | ||
| 227 | |||
| 228 | a += nr >> SZLONG_LOG; | ||
| 229 | mask = 1UL << bit; | ||
| 230 | raw_local_irq_save(flags); | ||
| 231 | *a ^= mask; | ||
| 232 | raw_local_irq_restore(flags); | ||
| 233 | } | ||
| 234 | } | 224 | } |
| 235 | 225 | ||
| 236 | /* | 226 | /* |
| @@ -244,7 +234,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
| 244 | static inline int test_and_set_bit(unsigned long nr, | 234 | static inline int test_and_set_bit(unsigned long nr, |
| 245 | volatile unsigned long *addr) | 235 | volatile unsigned long *addr) |
| 246 | { | 236 | { |
| 247 | unsigned short bit = nr & SZLONG_MASK; | 237 | int bit = nr & SZLONG_MASK; |
| 248 | unsigned long res; | 238 | unsigned long res; |
| 249 | 239 | ||
| 250 | smp_mb__before_llsc(); | 240 | smp_mb__before_llsc(); |
| @@ -281,18 +271,8 @@ static inline int test_and_set_bit(unsigned long nr, | |||
| 281 | } while (unlikely(!res)); | 271 | } while (unlikely(!res)); |
| 282 | 272 | ||
| 283 | res = temp & (1UL << bit); | 273 | res = temp & (1UL << bit); |
| 284 | } else { | 274 | } else |
| 285 | volatile unsigned long *a = addr; | 275 | res = __mips_test_and_set_bit(nr, addr); |
| 286 | unsigned long mask; | ||
| 287 | unsigned long flags; | ||
| 288 | |||
| 289 | a += nr >> SZLONG_LOG; | ||
| 290 | mask = 1UL << bit; | ||
| 291 | raw_local_irq_save(flags); | ||
| 292 | res = (mask & *a); | ||
| 293 | *a |= mask; | ||
| 294 | raw_local_irq_restore(flags); | ||
| 295 | } | ||
| 296 | 276 | ||
| 297 | smp_llsc_mb(); | 277 | smp_llsc_mb(); |
| 298 | 278 | ||
| @@ -310,7 +290,7 @@ static inline int test_and_set_bit(unsigned long nr, | |||
| 310 | static inline int test_and_set_bit_lock(unsigned long nr, | 290 | static inline int test_and_set_bit_lock(unsigned long nr, |
| 311 | volatile unsigned long *addr) | 291 | volatile unsigned long *addr) |
| 312 | { | 292 | { |
| 313 | unsigned short bit = nr & SZLONG_MASK; | 293 | int bit = nr & SZLONG_MASK; |
| 314 | unsigned long res; | 294 | unsigned long res; |
| 315 | 295 | ||
| 316 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 296 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
| @@ -345,18 +325,8 @@ static inline int test_and_set_bit_lock(unsigned long nr, | |||
| 345 | } while (unlikely(!res)); | 325 | } while (unlikely(!res)); |
| 346 | 326 | ||
| 347 | res = temp & (1UL << bit); | 327 | res = temp & (1UL << bit); |
| 348 | } else { | 328 | } else |
| 349 | volatile unsigned long *a = addr; | 329 | res = __mips_test_and_set_bit_lock(nr, addr); |
| 350 | unsigned long mask; | ||
| 351 | unsigned long flags; | ||
| 352 | |||
| 353 | a += nr >> SZLONG_LOG; | ||
| 354 | mask = 1UL << bit; | ||
| 355 | raw_local_irq_save(flags); | ||
| 356 | res = (mask & *a); | ||
| 357 | *a |= mask; | ||
| 358 | raw_local_irq_restore(flags); | ||
| 359 | } | ||
| 360 | 330 | ||
| 361 | smp_llsc_mb(); | 331 | smp_llsc_mb(); |
| 362 | 332 | ||
| @@ -373,7 +343,7 @@ static inline int test_and_set_bit_lock(unsigned long nr, | |||
| 373 | static inline int test_and_clear_bit(unsigned long nr, | 343 | static inline int test_and_clear_bit(unsigned long nr, |
| 374 | volatile unsigned long *addr) | 344 | volatile unsigned long *addr) |
| 375 | { | 345 | { |
| 376 | unsigned short bit = nr & SZLONG_MASK; | 346 | int bit = nr & SZLONG_MASK; |
| 377 | unsigned long res; | 347 | unsigned long res; |
| 378 | 348 | ||
| 379 | smp_mb__before_llsc(); | 349 | smp_mb__before_llsc(); |
| @@ -428,18 +398,8 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
| 428 | } while (unlikely(!res)); | 398 | } while (unlikely(!res)); |
| 429 | 399 | ||
| 430 | res = temp & (1UL << bit); | 400 | res = temp & (1UL << bit); |
| 431 | } else { | 401 | } else |
| 432 | volatile unsigned long *a = addr; | 402 | res = __mips_test_and_clear_bit(nr, addr); |
| 433 | unsigned long mask; | ||
| 434 | unsigned long flags; | ||
| 435 | |||
| 436 | a += nr >> SZLONG_LOG; | ||
| 437 | mask = 1UL << bit; | ||
| 438 | raw_local_irq_save(flags); | ||
| 439 | res = (mask & *a); | ||
| 440 | *a &= ~mask; | ||
| 441 | raw_local_irq_restore(flags); | ||
| 442 | } | ||
| 443 | 403 | ||
| 444 | smp_llsc_mb(); | 404 | smp_llsc_mb(); |
| 445 | 405 | ||
| @@ -457,7 +417,7 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
| 457 | static inline int test_and_change_bit(unsigned long nr, | 417 | static inline int test_and_change_bit(unsigned long nr, |
| 458 | volatile unsigned long *addr) | 418 | volatile unsigned long *addr) |
| 459 | { | 419 | { |
| 460 | unsigned short bit = nr & SZLONG_MASK; | 420 | int bit = nr & SZLONG_MASK; |
| 461 | unsigned long res; | 421 | unsigned long res; |
| 462 | 422 | ||
| 463 | smp_mb__before_llsc(); | 423 | smp_mb__before_llsc(); |
| @@ -494,18 +454,8 @@ static inline int test_and_change_bit(unsigned long nr, | |||
| 494 | } while (unlikely(!res)); | 454 | } while (unlikely(!res)); |
| 495 | 455 | ||
| 496 | res = temp & (1UL << bit); | 456 | res = temp & (1UL << bit); |
| 497 | } else { | 457 | } else |
| 498 | volatile unsigned long *a = addr; | 458 | res = __mips_test_and_change_bit(nr, addr); |
| 499 | unsigned long mask; | ||
| 500 | unsigned long flags; | ||
| 501 | |||
| 502 | a += nr >> SZLONG_LOG; | ||
| 503 | mask = 1UL << bit; | ||
| 504 | raw_local_irq_save(flags); | ||
| 505 | res = (mask & *a); | ||
| 506 | *a ^= mask; | ||
| 507 | raw_local_irq_restore(flags); | ||
| 508 | } | ||
| 509 | 459 | ||
| 510 | smp_llsc_mb(); | 460 | smp_llsc_mb(); |
| 511 | 461 | ||
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 58277e0e9cd4..3c5d1464b7bd 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
| @@ -290,7 +290,7 @@ struct compat_shmid64_ds { | |||
| 290 | 290 | ||
| 291 | static inline int is_compat_task(void) | 291 | static inline int is_compat_task(void) |
| 292 | { | 292 | { |
| 293 | return test_thread_flag(TIF_32BIT); | 293 | return test_thread_flag(TIF_32BIT_ADDR); |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | #endif /* _ASM_COMPAT_H */ | 296 | #endif /* _ASM_COMPAT_H */ |
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 29d9c23c20c7..ff2e0345e013 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/irqflags.h> | ||
| 18 | 19 | ||
| 19 | #include <asm/addrspace.h> | 20 | #include <asm/addrspace.h> |
| 20 | #include <asm/bug.h> | 21 | #include <asm/bug.h> |
diff --git a/arch/mips/include/asm/irqflags.h b/arch/mips/include/asm/irqflags.h index 309cbcd6909c..9f3384c789d7 100644 --- a/arch/mips/include/asm/irqflags.h +++ b/arch/mips/include/asm/irqflags.h | |||
| @@ -16,83 +16,13 @@ | |||
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <asm/hazards.h> | 17 | #include <asm/hazards.h> |
| 18 | 18 | ||
| 19 | __asm__( | 19 | #if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC) |
| 20 | " .macro arch_local_irq_enable \n" | ||
| 21 | " .set push \n" | ||
| 22 | " .set reorder \n" | ||
| 23 | " .set noat \n" | ||
| 24 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 25 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
| 26 | " ori $1, 0x400 \n" | ||
| 27 | " xori $1, 0x400 \n" | ||
| 28 | " mtc0 $1, $2, 1 \n" | ||
| 29 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 30 | " ei \n" | ||
| 31 | #else | ||
| 32 | " mfc0 $1,$12 \n" | ||
| 33 | " ori $1,0x1f \n" | ||
| 34 | " xori $1,0x1e \n" | ||
| 35 | " mtc0 $1,$12 \n" | ||
| 36 | #endif | ||
| 37 | " irq_enable_hazard \n" | ||
| 38 | " .set pop \n" | ||
| 39 | " .endm"); | ||
| 40 | 20 | ||
| 41 | extern void smtc_ipi_replay(void); | ||
| 42 | |||
| 43 | static inline void arch_local_irq_enable(void) | ||
| 44 | { | ||
| 45 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 46 | /* | ||
| 47 | * SMTC kernel needs to do a software replay of queued | ||
| 48 | * IPIs, at the cost of call overhead on each local_irq_enable() | ||
| 49 | */ | ||
| 50 | smtc_ipi_replay(); | ||
| 51 | #endif | ||
| 52 | __asm__ __volatile__( | ||
| 53 | "arch_local_irq_enable" | ||
| 54 | : /* no outputs */ | ||
| 55 | : /* no inputs */ | ||
| 56 | : "memory"); | ||
| 57 | } | ||
| 58 | |||
| 59 | |||
| 60 | /* | ||
| 61 | * For cli() we have to insert nops to make sure that the new value | ||
| 62 | * has actually arrived in the status register before the end of this | ||
| 63 | * macro. | ||
| 64 | * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs | ||
| 65 | * no nops at all. | ||
| 66 | */ | ||
| 67 | /* | ||
| 68 | * For TX49, operating only IE bit is not enough. | ||
| 69 | * | ||
| 70 | * If mfc0 $12 follows store and the mfc0 is last instruction of a | ||
| 71 | * page and fetching the next instruction causes TLB miss, the result | ||
| 72 | * of the mfc0 might wrongly contain EXL bit. | ||
| 73 | * | ||
| 74 | * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 | ||
| 75 | * | ||
| 76 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | ||
| 77 | */ | ||
| 78 | __asm__( | 21 | __asm__( |
| 79 | " .macro arch_local_irq_disable\n" | 22 | " .macro arch_local_irq_disable\n" |
| 80 | " .set push \n" | 23 | " .set push \n" |
| 81 | " .set noat \n" | 24 | " .set noat \n" |
| 82 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 83 | " mfc0 $1, $2, 1 \n" | ||
| 84 | " ori $1, 0x400 \n" | ||
| 85 | " .set noreorder \n" | ||
| 86 | " mtc0 $1, $2, 1 \n" | ||
| 87 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 88 | " di \n" | 25 | " di \n" |
| 89 | #else | ||
| 90 | " mfc0 $1,$12 \n" | ||
| 91 | " ori $1,0x1f \n" | ||
| 92 | " xori $1,0x1f \n" | ||
| 93 | " .set noreorder \n" | ||
| 94 | " mtc0 $1,$12 \n" | ||
| 95 | #endif | ||
| 96 | " irq_disable_hazard \n" | 26 | " irq_disable_hazard \n" |
| 97 | " .set pop \n" | 27 | " .set pop \n" |
| 98 | " .endm \n"); | 28 | " .endm \n"); |
| @@ -106,46 +36,14 @@ static inline void arch_local_irq_disable(void) | |||
| 106 | : "memory"); | 36 | : "memory"); |
| 107 | } | 37 | } |
| 108 | 38 | ||
| 109 | __asm__( | ||
| 110 | " .macro arch_local_save_flags flags \n" | ||
| 111 | " .set push \n" | ||
| 112 | " .set reorder \n" | ||
| 113 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 114 | " mfc0 \\flags, $2, 1 \n" | ||
| 115 | #else | ||
| 116 | " mfc0 \\flags, $12 \n" | ||
| 117 | #endif | ||
| 118 | " .set pop \n" | ||
| 119 | " .endm \n"); | ||
| 120 | |||
| 121 | static inline unsigned long arch_local_save_flags(void) | ||
| 122 | { | ||
| 123 | unsigned long flags; | ||
| 124 | asm volatile("arch_local_save_flags %0" : "=r" (flags)); | ||
| 125 | return flags; | ||
| 126 | } | ||
| 127 | 39 | ||
| 128 | __asm__( | 40 | __asm__( |
| 129 | " .macro arch_local_irq_save result \n" | 41 | " .macro arch_local_irq_save result \n" |
| 130 | " .set push \n" | 42 | " .set push \n" |
| 131 | " .set reorder \n" | 43 | " .set reorder \n" |
| 132 | " .set noat \n" | 44 | " .set noat \n" |
| 133 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 134 | " mfc0 \\result, $2, 1 \n" | ||
| 135 | " ori $1, \\result, 0x400 \n" | ||
| 136 | " .set noreorder \n" | ||
| 137 | " mtc0 $1, $2, 1 \n" | ||
| 138 | " andi \\result, \\result, 0x400 \n" | ||
| 139 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 140 | " di \\result \n" | 45 | " di \\result \n" |
| 141 | " andi \\result, 1 \n" | 46 | " andi \\result, 1 \n" |
| 142 | #else | ||
| 143 | " mfc0 \\result, $12 \n" | ||
| 144 | " ori $1, \\result, 0x1f \n" | ||
| 145 | " xori $1, 0x1f \n" | ||
| 146 | " .set noreorder \n" | ||
| 147 | " mtc0 $1, $12 \n" | ||
| 148 | #endif | ||
| 149 | " irq_disable_hazard \n" | 47 | " irq_disable_hazard \n" |
| 150 | " .set pop \n" | 48 | " .set pop \n" |
| 151 | " .endm \n"); | 49 | " .endm \n"); |
| @@ -160,61 +58,37 @@ static inline unsigned long arch_local_irq_save(void) | |||
| 160 | return flags; | 58 | return flags; |
| 161 | } | 59 | } |
| 162 | 60 | ||
| 61 | |||
| 163 | __asm__( | 62 | __asm__( |
| 164 | " .macro arch_local_irq_restore flags \n" | 63 | " .macro arch_local_irq_restore flags \n" |
| 165 | " .set push \n" | 64 | " .set push \n" |
| 166 | " .set noreorder \n" | 65 | " .set noreorder \n" |
| 167 | " .set noat \n" | 66 | " .set noat \n" |
| 168 | #ifdef CONFIG_MIPS_MT_SMTC | 67 | #if defined(CONFIG_IRQ_CPU) |
| 169 | "mfc0 $1, $2, 1 \n" | ||
| 170 | "andi \\flags, 0x400 \n" | ||
| 171 | "ori $1, 0x400 \n" | ||
| 172 | "xori $1, 0x400 \n" | ||
| 173 | "or \\flags, $1 \n" | ||
| 174 | "mtc0 \\flags, $2, 1 \n" | ||
| 175 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
| 176 | /* | 68 | /* |
| 177 | * Slow, but doesn't suffer from a relatively unlikely race | 69 | * Slow, but doesn't suffer from a relatively unlikely race |
| 178 | * condition we're having since days 1. | 70 | * condition we're having since days 1. |
| 179 | */ | 71 | */ |
| 180 | " beqz \\flags, 1f \n" | 72 | " beqz \\flags, 1f \n" |
| 181 | " di \n" | 73 | " di \n" |
| 182 | " ei \n" | 74 | " ei \n" |
| 183 | "1: \n" | 75 | "1: \n" |
| 184 | #elif defined(CONFIG_CPU_MIPSR2) | 76 | #else |
| 185 | /* | 77 | /* |
| 186 | * Fast, dangerous. Life is fun, life is good. | 78 | * Fast, dangerous. Life is fun, life is good. |
| 187 | */ | 79 | */ |
| 188 | " mfc0 $1, $12 \n" | 80 | " mfc0 $1, $12 \n" |
| 189 | " ins $1, \\flags, 0, 1 \n" | 81 | " ins $1, \\flags, 0, 1 \n" |
| 190 | " mtc0 $1, $12 \n" | 82 | " mtc0 $1, $12 \n" |
| 191 | #else | ||
| 192 | " mfc0 $1, $12 \n" | ||
| 193 | " andi \\flags, 1 \n" | ||
| 194 | " ori $1, 0x1f \n" | ||
| 195 | " xori $1, 0x1f \n" | ||
| 196 | " or \\flags, $1 \n" | ||
| 197 | " mtc0 \\flags, $12 \n" | ||
| 198 | #endif | 83 | #endif |
| 199 | " irq_disable_hazard \n" | 84 | " irq_disable_hazard \n" |
| 200 | " .set pop \n" | 85 | " .set pop \n" |
| 201 | " .endm \n"); | 86 | " .endm \n"); |
| 202 | 87 | ||
| 203 | |||
| 204 | static inline void arch_local_irq_restore(unsigned long flags) | 88 | static inline void arch_local_irq_restore(unsigned long flags) |
| 205 | { | 89 | { |
| 206 | unsigned long __tmp1; | 90 | unsigned long __tmp1; |
| 207 | 91 | ||
| 208 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 209 | /* | ||
| 210 | * SMTC kernel needs to do a software replay of queued | ||
| 211 | * IPIs, at the cost of branch and call overhead on each | ||
| 212 | * local_irq_restore() | ||
| 213 | */ | ||
| 214 | if (unlikely(!(flags & 0x0400))) | ||
| 215 | smtc_ipi_replay(); | ||
| 216 | #endif | ||
| 217 | |||
| 218 | __asm__ __volatile__( | 92 | __asm__ __volatile__( |
| 219 | "arch_local_irq_restore\t%0" | 93 | "arch_local_irq_restore\t%0" |
| 220 | : "=r" (__tmp1) | 94 | : "=r" (__tmp1) |
| @@ -232,6 +106,75 @@ static inline void __arch_local_irq_restore(unsigned long flags) | |||
| 232 | : "0" (flags) | 106 | : "0" (flags) |
| 233 | : "memory"); | 107 | : "memory"); |
| 234 | } | 108 | } |
| 109 | #else | ||
| 110 | /* Functions that require preempt_{dis,en}able() are in mips-atomic.c */ | ||
| 111 | void arch_local_irq_disable(void); | ||
| 112 | unsigned long arch_local_irq_save(void); | ||
| 113 | void arch_local_irq_restore(unsigned long flags); | ||
| 114 | void __arch_local_irq_restore(unsigned long flags); | ||
| 115 | #endif /* if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC) */ | ||
| 116 | |||
| 117 | |||
| 118 | __asm__( | ||
| 119 | " .macro arch_local_irq_enable \n" | ||
| 120 | " .set push \n" | ||
| 121 | " .set reorder \n" | ||
| 122 | " .set noat \n" | ||
| 123 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 124 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
| 125 | " ori $1, 0x400 \n" | ||
| 126 | " xori $1, 0x400 \n" | ||
| 127 | " mtc0 $1, $2, 1 \n" | ||
| 128 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 129 | " ei \n" | ||
| 130 | #else | ||
| 131 | " mfc0 $1,$12 \n" | ||
| 132 | " ori $1,0x1f \n" | ||
| 133 | " xori $1,0x1e \n" | ||
| 134 | " mtc0 $1,$12 \n" | ||
| 135 | #endif | ||
| 136 | " irq_enable_hazard \n" | ||
| 137 | " .set pop \n" | ||
| 138 | " .endm"); | ||
| 139 | |||
| 140 | extern void smtc_ipi_replay(void); | ||
| 141 | |||
| 142 | static inline void arch_local_irq_enable(void) | ||
| 143 | { | ||
| 144 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 145 | /* | ||
| 146 | * SMTC kernel needs to do a software replay of queued | ||
| 147 | * IPIs, at the cost of call overhead on each local_irq_enable() | ||
| 148 | */ | ||
| 149 | smtc_ipi_replay(); | ||
| 150 | #endif | ||
| 151 | __asm__ __volatile__( | ||
| 152 | "arch_local_irq_enable" | ||
| 153 | : /* no outputs */ | ||
| 154 | : /* no inputs */ | ||
| 155 | : "memory"); | ||
| 156 | } | ||
| 157 | |||
| 158 | |||
| 159 | __asm__( | ||
| 160 | " .macro arch_local_save_flags flags \n" | ||
| 161 | " .set push \n" | ||
| 162 | " .set reorder \n" | ||
| 163 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 164 | " mfc0 \\flags, $2, 1 \n" | ||
| 165 | #else | ||
| 166 | " mfc0 \\flags, $12 \n" | ||
| 167 | #endif | ||
| 168 | " .set pop \n" | ||
| 169 | " .endm \n"); | ||
| 170 | |||
| 171 | static inline unsigned long arch_local_save_flags(void) | ||
| 172 | { | ||
| 173 | unsigned long flags; | ||
| 174 | asm volatile("arch_local_save_flags %0" : "=r" (flags)); | ||
| 175 | return flags; | ||
| 176 | } | ||
| 177 | |||
| 235 | 178 | ||
| 236 | static inline int arch_irqs_disabled_flags(unsigned long flags) | 179 | static inline int arch_irqs_disabled_flags(unsigned long flags) |
| 237 | { | 180 | { |
| @@ -245,7 +188,7 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) | |||
| 245 | #endif | 188 | #endif |
| 246 | } | 189 | } |
| 247 | 190 | ||
| 248 | #endif | 191 | #endif /* #ifndef __ASSEMBLY__ */ |
| 249 | 192 | ||
| 250 | /* | 193 | /* |
| 251 | * Do the CPU's IRQ-state tracing from assembly code. | 194 | * Do the CPU's IRQ-state tracing from assembly code. |
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 8debe9e91754..18806a52061c 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h | |||
| @@ -112,12 +112,6 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
| 112 | #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ | 112 | #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ |
| 113 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ | 113 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ |
| 114 | 114 | ||
| 115 | #ifdef CONFIG_MIPS32_O32 | ||
| 116 | #define TIF_32BIT TIF_32BIT_REGS | ||
| 117 | #elif defined(CONFIG_MIPS32_N32) | ||
| 118 | #define TIF_32BIT _TIF_32BIT_ADDR | ||
| 119 | #endif /* CONFIG_MIPS32_O32 */ | ||
| 120 | |||
| 121 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 115 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| 122 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 116 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
| 123 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 117 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index c4a82e841c73..eeddc58802e1 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile | |||
| @@ -2,8 +2,9 @@ | |||
| 2 | # Makefile for MIPS-specific library files.. | 2 | # Makefile for MIPS-specific library files.. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | lib-y += csum_partial.o delay.o memcpy.o memset.o \ | 5 | lib-y += bitops.o csum_partial.o delay.o memcpy.o memset.o \ |
| 6 | strlen_user.o strncpy_user.o strnlen_user.o uncached.o | 6 | mips-atomic.o strlen_user.o strncpy_user.o \ |
| 7 | strnlen_user.o uncached.o | ||
| 7 | 8 | ||
| 8 | obj-y += iomap.o | 9 | obj-y += iomap.o |
| 9 | obj-$(CONFIG_PCI) += iomap-pci.o | 10 | obj-$(CONFIG_PCI) += iomap-pci.o |
diff --git a/arch/mips/lib/bitops.c b/arch/mips/lib/bitops.c new file mode 100644 index 000000000000..239a9c957b02 --- /dev/null +++ b/arch/mips/lib/bitops.c | |||
| @@ -0,0 +1,179 @@ | |||
| 1 | /* | ||
| 2 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 3 | * License. See the file "COPYING" in the main directory of this archive | ||
| 4 | * for more details. | ||
| 5 | * | ||
| 6 | * Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) | ||
| 7 | * Copyright (c) 1999, 2000 Silicon Graphics, Inc. | ||
| 8 | */ | ||
| 9 | #include <linux/bitops.h> | ||
| 10 | #include <linux/irqflags.h> | ||
| 11 | #include <linux/export.h> | ||
| 12 | |||
| 13 | |||
| 14 | /** | ||
| 15 | * __mips_set_bit - Atomically set a bit in memory. This is called by | ||
| 16 | * set_bit() if it cannot find a faster solution. | ||
| 17 | * @nr: the bit to set | ||
| 18 | * @addr: the address to start counting from | ||
| 19 | */ | ||
| 20 | void __mips_set_bit(unsigned long nr, volatile unsigned long *addr) | ||
| 21 | { | ||
| 22 | volatile unsigned long *a = addr; | ||
| 23 | unsigned bit = nr & SZLONG_MASK; | ||
| 24 | unsigned long mask; | ||
| 25 | unsigned long flags; | ||
| 26 | |||
| 27 | a += nr >> SZLONG_LOG; | ||
| 28 | mask = 1UL << bit; | ||
| 29 | raw_local_irq_save(flags); | ||
| 30 | *a |= mask; | ||
| 31 | raw_local_irq_restore(flags); | ||
| 32 | } | ||
| 33 | EXPORT_SYMBOL(__mips_set_bit); | ||
| 34 | |||
| 35 | |||
| 36 | /** | ||
| 37 | * __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if | ||
| 38 | * it cannot find a faster solution. | ||
| 39 | * @nr: Bit to clear | ||
| 40 | * @addr: Address to start counting from | ||
| 41 | */ | ||
| 42 | void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
| 43 | { | ||
| 44 | volatile unsigned long *a = addr; | ||
| 45 | unsigned bit = nr & SZLONG_MASK; | ||
| 46 | unsigned long mask; | ||
| 47 | unsigned long flags; | ||
| 48 | |||
| 49 | a += nr >> SZLONG_LOG; | ||
| 50 | mask = 1UL << bit; | ||
| 51 | raw_local_irq_save(flags); | ||
| 52 | *a &= ~mask; | ||
| 53 | raw_local_irq_restore(flags); | ||
| 54 | } | ||
| 55 | EXPORT_SYMBOL(__mips_clear_bit); | ||
| 56 | |||
| 57 | |||
| 58 | /** | ||
| 59 | * __mips_change_bit - Toggle a bit in memory. This is called by change_bit() | ||
| 60 | * if it cannot find a faster solution. | ||
| 61 | * @nr: Bit to change | ||
| 62 | * @addr: Address to start counting from | ||
| 63 | */ | ||
| 64 | void __mips_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
| 65 | { | ||
| 66 | volatile unsigned long *a = addr; | ||
| 67 | unsigned bit = nr & SZLONG_MASK; | ||
| 68 | unsigned long mask; | ||
| 69 | unsigned long flags; | ||
| 70 | |||
| 71 | a += nr >> SZLONG_LOG; | ||
| 72 | mask = 1UL << bit; | ||
| 73 | raw_local_irq_save(flags); | ||
| 74 | *a ^= mask; | ||
| 75 | raw_local_irq_restore(flags); | ||
| 76 | } | ||
| 77 | EXPORT_SYMBOL(__mips_change_bit); | ||
| 78 | |||
| 79 | |||
| 80 | /** | ||
| 81 | * __mips_test_and_set_bit - Set a bit and return its old value. This is | ||
| 82 | * called by test_and_set_bit() if it cannot find a faster solution. | ||
| 83 | * @nr: Bit to set | ||
| 84 | * @addr: Address to count from | ||
| 85 | */ | ||
| 86 | int __mips_test_and_set_bit(unsigned long nr, | ||
| 87 | volatile unsigned long *addr) | ||
| 88 | { | ||
| 89 | volatile unsigned long *a = addr; | ||
| 90 | unsigned bit = nr & SZLONG_MASK; | ||
| 91 | unsigned long mask; | ||
| 92 | unsigned long flags; | ||
| 93 | unsigned long res; | ||
| 94 | |||
| 95 | a += nr >> SZLONG_LOG; | ||
| 96 | mask = 1UL << bit; | ||
| 97 | raw_local_irq_save(flags); | ||
| 98 | res = (mask & *a); | ||
| 99 | *a |= mask; | ||
| 100 | raw_local_irq_restore(flags); | ||
| 101 | return res; | ||
| 102 | } | ||
| 103 | EXPORT_SYMBOL(__mips_test_and_set_bit); | ||
| 104 | |||
| 105 | |||
| 106 | /** | ||
| 107 | * __mips_test_and_set_bit_lock - Set a bit and return its old value. This is | ||
| 108 | * called by test_and_set_bit_lock() if it cannot find a faster solution. | ||
| 109 | * @nr: Bit to set | ||
| 110 | * @addr: Address to count from | ||
| 111 | */ | ||
| 112 | int __mips_test_and_set_bit_lock(unsigned long nr, | ||
| 113 | volatile unsigned long *addr) | ||
| 114 | { | ||
| 115 | volatile unsigned long *a = addr; | ||
| 116 | unsigned bit = nr & SZLONG_MASK; | ||
| 117 | unsigned long mask; | ||
| 118 | unsigned long flags; | ||
| 119 | unsigned long res; | ||
| 120 | |||
| 121 | a += nr >> SZLONG_LOG; | ||
| 122 | mask = 1UL << bit; | ||
| 123 | raw_local_irq_save(flags); | ||
| 124 | res = (mask & *a); | ||
| 125 | *a |= mask; | ||
| 126 | raw_local_irq_restore(flags); | ||
| 127 | return res; | ||
| 128 | } | ||
| 129 | EXPORT_SYMBOL(__mips_test_and_set_bit_lock); | ||
| 130 | |||
| 131 | |||
| 132 | /** | ||
| 133 | * __mips_test_and_clear_bit - Clear a bit and return its old value. This is | ||
| 134 | * called by test_and_clear_bit() if it cannot find a faster solution. | ||
| 135 | * @nr: Bit to clear | ||
| 136 | * @addr: Address to count from | ||
| 137 | */ | ||
| 138 | int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
| 139 | { | ||
| 140 | volatile unsigned long *a = addr; | ||
| 141 | unsigned bit = nr & SZLONG_MASK; | ||
| 142 | unsigned long mask; | ||
| 143 | unsigned long flags; | ||
| 144 | unsigned long res; | ||
| 145 | |||
| 146 | a += nr >> SZLONG_LOG; | ||
| 147 | mask = 1UL << bit; | ||
| 148 | raw_local_irq_save(flags); | ||
| 149 | res = (mask & *a); | ||
| 150 | *a &= ~mask; | ||
| 151 | raw_local_irq_restore(flags); | ||
| 152 | return res; | ||
| 153 | } | ||
| 154 | EXPORT_SYMBOL(__mips_test_and_clear_bit); | ||
| 155 | |||
| 156 | |||
| 157 | /** | ||
| 158 | * __mips_test_and_change_bit - Change a bit and return its old value. This is | ||
| 159 | * called by test_and_change_bit() if it cannot find a faster solution. | ||
| 160 | * @nr: Bit to change | ||
| 161 | * @addr: Address to count from | ||
| 162 | */ | ||
| 163 | int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
| 164 | { | ||
| 165 | volatile unsigned long *a = addr; | ||
| 166 | unsigned bit = nr & SZLONG_MASK; | ||
| 167 | unsigned long mask; | ||
| 168 | unsigned long flags; | ||
| 169 | unsigned long res; | ||
| 170 | |||
| 171 | a += nr >> SZLONG_LOG; | ||
| 172 | mask = 1UL << bit; | ||
| 173 | raw_local_irq_save(flags); | ||
| 174 | res = (mask & *a); | ||
| 175 | *a ^= mask; | ||
| 176 | raw_local_irq_restore(flags); | ||
| 177 | return res; | ||
| 178 | } | ||
| 179 | EXPORT_SYMBOL(__mips_test_and_change_bit); | ||
diff --git a/arch/mips/lib/mips-atomic.c b/arch/mips/lib/mips-atomic.c new file mode 100644 index 000000000000..e091430dbeb1 --- /dev/null +++ b/arch/mips/lib/mips-atomic.c | |||
| @@ -0,0 +1,176 @@ | |||
| 1 | /* | ||
| 2 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 3 | * License. See the file "COPYING" in the main directory of this archive | ||
| 4 | * for more details. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle | ||
| 7 | * Copyright (C) 1996 by Paul M. Antoine | ||
| 8 | * Copyright (C) 1999 Silicon Graphics | ||
| 9 | * Copyright (C) 2000 MIPS Technologies, Inc. | ||
| 10 | */ | ||
| 11 | #include <asm/irqflags.h> | ||
| 12 | #include <asm/hazards.h> | ||
| 13 | #include <linux/compiler.h> | ||
| 14 | #include <linux/preempt.h> | ||
| 15 | #include <linux/export.h> | ||
| 16 | |||
| 17 | #if !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC) | ||
| 18 | |||
| 19 | /* | ||
| 20 | * For cli() we have to insert nops to make sure that the new value | ||
| 21 | * has actually arrived in the status register before the end of this | ||
| 22 | * macro. | ||
| 23 | * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs | ||
| 24 | * no nops at all. | ||
| 25 | */ | ||
| 26 | /* | ||
| 27 | * For TX49, operating only IE bit is not enough. | ||
| 28 | * | ||
| 29 | * If mfc0 $12 follows store and the mfc0 is last instruction of a | ||
| 30 | * page and fetching the next instruction causes TLB miss, the result | ||
| 31 | * of the mfc0 might wrongly contain EXL bit. | ||
| 32 | * | ||
| 33 | * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 | ||
| 34 | * | ||
| 35 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | ||
| 36 | */ | ||
| 37 | __asm__( | ||
| 38 | " .macro arch_local_irq_disable\n" | ||
| 39 | " .set push \n" | ||
| 40 | " .set noat \n" | ||
| 41 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 42 | " mfc0 $1, $2, 1 \n" | ||
| 43 | " ori $1, 0x400 \n" | ||
| 44 | " .set noreorder \n" | ||
| 45 | " mtc0 $1, $2, 1 \n" | ||
| 46 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 47 | /* see irqflags.h for inline function */ | ||
| 48 | #else | ||
| 49 | " mfc0 $1,$12 \n" | ||
| 50 | " ori $1,0x1f \n" | ||
| 51 | " xori $1,0x1f \n" | ||
| 52 | " .set noreorder \n" | ||
| 53 | " mtc0 $1,$12 \n" | ||
| 54 | #endif | ||
| 55 | " irq_disable_hazard \n" | ||
| 56 | " .set pop \n" | ||
| 57 | " .endm \n"); | ||
| 58 | |||
| 59 | void arch_local_irq_disable(void) | ||
| 60 | { | ||
| 61 | preempt_disable(); | ||
| 62 | __asm__ __volatile__( | ||
| 63 | "arch_local_irq_disable" | ||
| 64 | : /* no outputs */ | ||
| 65 | : /* no inputs */ | ||
| 66 | : "memory"); | ||
| 67 | preempt_enable(); | ||
| 68 | } | ||
| 69 | EXPORT_SYMBOL(arch_local_irq_disable); | ||
| 70 | |||
| 71 | |||
| 72 | __asm__( | ||
| 73 | " .macro arch_local_irq_save result \n" | ||
| 74 | " .set push \n" | ||
| 75 | " .set reorder \n" | ||
| 76 | " .set noat \n" | ||
| 77 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 78 | " mfc0 \\result, $2, 1 \n" | ||
| 79 | " ori $1, \\result, 0x400 \n" | ||
| 80 | " .set noreorder \n" | ||
| 81 | " mtc0 $1, $2, 1 \n" | ||
| 82 | " andi \\result, \\result, 0x400 \n" | ||
| 83 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 84 | /* see irqflags.h for inline function */ | ||
| 85 | #else | ||
| 86 | " mfc0 \\result, $12 \n" | ||
| 87 | " ori $1, \\result, 0x1f \n" | ||
| 88 | " xori $1, 0x1f \n" | ||
| 89 | " .set noreorder \n" | ||
| 90 | " mtc0 $1, $12 \n" | ||
| 91 | #endif | ||
| 92 | " irq_disable_hazard \n" | ||
| 93 | " .set pop \n" | ||
| 94 | " .endm \n"); | ||
| 95 | |||
| 96 | unsigned long arch_local_irq_save(void) | ||
| 97 | { | ||
| 98 | unsigned long flags; | ||
| 99 | preempt_disable(); | ||
| 100 | asm volatile("arch_local_irq_save\t%0" | ||
| 101 | : "=r" (flags) | ||
| 102 | : /* no inputs */ | ||
| 103 | : "memory"); | ||
| 104 | preempt_enable(); | ||
| 105 | return flags; | ||
| 106 | } | ||
| 107 | EXPORT_SYMBOL(arch_local_irq_save); | ||
| 108 | |||
| 109 | |||
| 110 | __asm__( | ||
| 111 | " .macro arch_local_irq_restore flags \n" | ||
| 112 | " .set push \n" | ||
| 113 | " .set noreorder \n" | ||
| 114 | " .set noat \n" | ||
| 115 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 116 | "mfc0 $1, $2, 1 \n" | ||
| 117 | "andi \\flags, 0x400 \n" | ||
| 118 | "ori $1, 0x400 \n" | ||
| 119 | "xori $1, 0x400 \n" | ||
| 120 | "or \\flags, $1 \n" | ||
| 121 | "mtc0 \\flags, $2, 1 \n" | ||
| 122 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
| 123 | /* see irqflags.h for inline function */ | ||
| 124 | #elif defined(CONFIG_CPU_MIPSR2) | ||
| 125 | /* see irqflags.h for inline function */ | ||
| 126 | #else | ||
| 127 | " mfc0 $1, $12 \n" | ||
| 128 | " andi \\flags, 1 \n" | ||
| 129 | " ori $1, 0x1f \n" | ||
| 130 | " xori $1, 0x1f \n" | ||
| 131 | " or \\flags, $1 \n" | ||
| 132 | " mtc0 \\flags, $12 \n" | ||
| 133 | #endif | ||
| 134 | " irq_disable_hazard \n" | ||
| 135 | " .set pop \n" | ||
| 136 | " .endm \n"); | ||
| 137 | |||
| 138 | void arch_local_irq_restore(unsigned long flags) | ||
| 139 | { | ||
| 140 | unsigned long __tmp1; | ||
| 141 | |||
| 142 | #ifdef CONFIG_MIPS_MT_SMTC | ||
| 143 | /* | ||
| 144 | * SMTC kernel needs to do a software replay of queued | ||
| 145 | * IPIs, at the cost of branch and call overhead on each | ||
| 146 | * local_irq_restore() | ||
| 147 | */ | ||
| 148 | if (unlikely(!(flags & 0x0400))) | ||
| 149 | smtc_ipi_replay(); | ||
| 150 | #endif | ||
| 151 | preempt_disable(); | ||
| 152 | __asm__ __volatile__( | ||
| 153 | "arch_local_irq_restore\t%0" | ||
| 154 | : "=r" (__tmp1) | ||
| 155 | : "0" (flags) | ||
| 156 | : "memory"); | ||
| 157 | preempt_enable(); | ||
| 158 | } | ||
| 159 | EXPORT_SYMBOL(arch_local_irq_restore); | ||
| 160 | |||
| 161 | |||
| 162 | void __arch_local_irq_restore(unsigned long flags) | ||
| 163 | { | ||
| 164 | unsigned long __tmp1; | ||
| 165 | |||
| 166 | preempt_disable(); | ||
| 167 | __asm__ __volatile__( | ||
| 168 | "arch_local_irq_restore\t%0" | ||
| 169 | : "=r" (__tmp1) | ||
| 170 | : "0" (flags) | ||
| 171 | : "memory"); | ||
| 172 | preempt_enable(); | ||
| 173 | } | ||
| 174 | EXPORT_SYMBOL(__arch_local_irq_restore); | ||
| 175 | |||
| 176 | #endif /* !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC) */ | ||
diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c index 80562b81f0f2..74732177851c 100644 --- a/arch/mips/mti-malta/malta-platform.c +++ b/arch/mips/mti-malta/malta-platform.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
| 30 | #include <linux/mtd/physmap.h> | 30 | #include <linux/mtd/physmap.h> |
| 31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
| 32 | #include <asm/mips-boards/maltaint.h> | ||
| 32 | #include <mtd/mtd-abi.h> | 33 | #include <mtd/mtd-abi.h> |
| 33 | 34 | ||
| 34 | #define SMC_PORT(base, int) \ | 35 | #define SMC_PORT(base, int) \ |
| @@ -48,7 +49,7 @@ static struct plat_serial8250_port uart8250_data[] = { | |||
| 48 | SMC_PORT(0x2F8, 3), | 49 | SMC_PORT(0x2F8, 3), |
| 49 | { | 50 | { |
| 50 | .mapbase = 0x1f000900, /* The CBUS UART */ | 51 | .mapbase = 0x1f000900, /* The CBUS UART */ |
| 51 | .irq = MIPS_CPU_IRQ_BASE + 2, | 52 | .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2, |
| 52 | .uartclk = 3686400, /* Twice the usual clk! */ | 53 | .uartclk = 3686400, /* Twice the usual clk! */ |
| 53 | .iotype = UPIO_MEM32, | 54 | .iotype = UPIO_MEM32, |
| 54 | .flags = CBUS_UART_FLAGS, | 55 | .flags = CBUS_UART_FLAGS, |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 5dba755a43e6..d385f396dfee 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
| @@ -96,6 +96,7 @@ config S390 | |||
| 96 | select HAVE_MEMBLOCK_NODE_MAP | 96 | select HAVE_MEMBLOCK_NODE_MAP |
| 97 | select HAVE_CMPXCHG_LOCAL | 97 | select HAVE_CMPXCHG_LOCAL |
| 98 | select HAVE_CMPXCHG_DOUBLE | 98 | select HAVE_CMPXCHG_DOUBLE |
| 99 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB | ||
| 99 | select HAVE_VIRT_CPU_ACCOUNTING | 100 | select HAVE_VIRT_CPU_ACCOUNTING |
| 100 | select VIRT_CPU_ACCOUNTING | 101 | select VIRT_CPU_ACCOUNTING |
| 101 | select ARCH_DISCARD_MEMBLOCK | 102 | select ARCH_DISCARD_MEMBLOCK |
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index a34a9d612fc0..18cd6b592650 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | #define PSW32_MASK_CC 0x00003000UL | 20 | #define PSW32_MASK_CC 0x00003000UL |
| 21 | #define PSW32_MASK_PM 0x00000f00UL | 21 | #define PSW32_MASK_PM 0x00000f00UL |
| 22 | 22 | ||
| 23 | #define PSW32_MASK_USER 0x00003F00UL | 23 | #define PSW32_MASK_USER 0x0000FF00UL |
| 24 | 24 | ||
| 25 | #define PSW32_ADDR_AMODE 0x80000000UL | 25 | #define PSW32_ADDR_AMODE 0x80000000UL |
| 26 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL | 26 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL |
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 9ca305383760..9935cbd6a46f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
| @@ -8,6 +8,9 @@ struct cpu; | |||
| 8 | 8 | ||
| 9 | #ifdef CONFIG_SCHED_BOOK | 9 | #ifdef CONFIG_SCHED_BOOK |
| 10 | 10 | ||
| 11 | extern unsigned char cpu_socket_id[NR_CPUS]; | ||
| 12 | #define topology_physical_package_id(cpu) (cpu_socket_id[cpu]) | ||
| 13 | |||
| 11 | extern unsigned char cpu_core_id[NR_CPUS]; | 14 | extern unsigned char cpu_core_id[NR_CPUS]; |
| 12 | extern cpumask_t cpu_core_map[NR_CPUS]; | 15 | extern cpumask_t cpu_core_map[NR_CPUS]; |
| 13 | 16 | ||
diff --git a/arch/s390/include/uapi/asm/ptrace.h b/arch/s390/include/uapi/asm/ptrace.h index 705588a16d70..a5ca214b34fd 100644 --- a/arch/s390/include/uapi/asm/ptrace.h +++ b/arch/s390/include/uapi/asm/ptrace.h | |||
| @@ -239,7 +239,7 @@ typedef struct | |||
| 239 | #define PSW_MASK_EA 0x00000000UL | 239 | #define PSW_MASK_EA 0x00000000UL |
| 240 | #define PSW_MASK_BA 0x00000000UL | 240 | #define PSW_MASK_BA 0x00000000UL |
| 241 | 241 | ||
| 242 | #define PSW_MASK_USER 0x00003F00UL | 242 | #define PSW_MASK_USER 0x0000FF00UL |
| 243 | 243 | ||
| 244 | #define PSW_ADDR_AMODE 0x80000000UL | 244 | #define PSW_ADDR_AMODE 0x80000000UL |
| 245 | #define PSW_ADDR_INSN 0x7FFFFFFFUL | 245 | #define PSW_ADDR_INSN 0x7FFFFFFFUL |
| @@ -269,7 +269,7 @@ typedef struct | |||
| 269 | #define PSW_MASK_EA 0x0000000100000000UL | 269 | #define PSW_MASK_EA 0x0000000100000000UL |
| 270 | #define PSW_MASK_BA 0x0000000080000000UL | 270 | #define PSW_MASK_BA 0x0000000080000000UL |
| 271 | 271 | ||
| 272 | #define PSW_MASK_USER 0x00003F8180000000UL | 272 | #define PSW_MASK_USER 0x0000FF8180000000UL |
| 273 | 273 | ||
| 274 | #define PSW_ADDR_AMODE 0x0000000000000000UL | 274 | #define PSW_ADDR_AMODE 0x0000000000000000UL |
| 275 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL | 275 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index a1e8a8694bb7..593fcc9253fc 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
| @@ -309,6 +309,10 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) | |||
| 309 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 309 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
| 310 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 | | 310 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 | |
| 311 | (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE); | 311 | (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE); |
| 312 | /* Check for invalid user address space control. */ | ||
| 313 | if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
| 314 | regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
| 315 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 312 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); | 316 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); |
| 313 | for (i = 0; i < NUM_GPRS; i++) | 317 | for (i = 0; i < NUM_GPRS; i++) |
| 314 | regs->gprs[i] = (__u64) regs32.gprs[i]; | 318 | regs->gprs[i] = (__u64) regs32.gprs[i]; |
| @@ -481,7 +485,10 @@ static int setup_frame32(int sig, struct k_sigaction *ka, | |||
| 481 | 485 | ||
| 482 | /* Set up registers for signal handler */ | 486 | /* Set up registers for signal handler */ |
| 483 | regs->gprs[15] = (__force __u64) frame; | 487 | regs->gprs[15] = (__force __u64) frame; |
| 484 | regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | 488 | /* Force 31 bit amode and default user address space control. */ |
| 489 | regs->psw.mask = PSW_MASK_BA | | ||
| 490 | (psw_user_bits & PSW_MASK_ASC) | | ||
| 491 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 485 | regs->psw.addr = (__force __u64) ka->sa.sa_handler; | 492 | regs->psw.addr = (__force __u64) ka->sa.sa_handler; |
| 486 | 493 | ||
| 487 | regs->gprs[2] = map_signal(sig); | 494 | regs->gprs[2] = map_signal(sig); |
| @@ -549,7 +556,10 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 549 | 556 | ||
| 550 | /* Set up registers for signal handler */ | 557 | /* Set up registers for signal handler */ |
| 551 | regs->gprs[15] = (__force __u64) frame; | 558 | regs->gprs[15] = (__force __u64) frame; |
| 552 | regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | 559 | /* Force 31 bit amode and default user address space control. */ |
| 560 | regs->psw.mask = PSW_MASK_BA | | ||
| 561 | (psw_user_bits & PSW_MASK_ASC) | | ||
| 562 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 553 | regs->psw.addr = (__u64) ka->sa.sa_handler; | 563 | regs->psw.addr = (__u64) ka->sa.sa_handler; |
| 554 | 564 | ||
| 555 | regs->gprs[2] = map_signal(sig); | 565 | regs->gprs[2] = map_signal(sig); |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index c13a2a37ef00..d1259d875074 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
| @@ -136,6 +136,10 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
| 136 | /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */ | 136 | /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */ |
| 137 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 137 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
| 138 | (user_sregs.regs.psw.mask & PSW_MASK_USER); | 138 | (user_sregs.regs.psw.mask & PSW_MASK_USER); |
| 139 | /* Check for invalid user address space control. */ | ||
| 140 | if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
| 141 | regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
| 142 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 139 | /* Check for invalid amode */ | 143 | /* Check for invalid amode */ |
| 140 | if (regs->psw.mask & PSW_MASK_EA) | 144 | if (regs->psw.mask & PSW_MASK_EA) |
| 141 | regs->psw.mask |= PSW_MASK_BA; | 145 | regs->psw.mask |= PSW_MASK_BA; |
| @@ -273,7 +277,10 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
| 273 | 277 | ||
| 274 | /* Set up registers for signal handler */ | 278 | /* Set up registers for signal handler */ |
| 275 | regs->gprs[15] = (unsigned long) frame; | 279 | regs->gprs[15] = (unsigned long) frame; |
| 276 | regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | 280 | /* Force default amode and default user address space control. */ |
| 281 | regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
| 282 | (psw_user_bits & PSW_MASK_ASC) | | ||
| 283 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 277 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | 284 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; |
| 278 | 285 | ||
| 279 | regs->gprs[2] = map_signal(sig); | 286 | regs->gprs[2] = map_signal(sig); |
| @@ -346,7 +353,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 346 | 353 | ||
| 347 | /* Set up registers for signal handler */ | 354 | /* Set up registers for signal handler */ |
| 348 | regs->gprs[15] = (unsigned long) frame; | 355 | regs->gprs[15] = (unsigned long) frame; |
| 349 | regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | 356 | /* Force default amode and default user address space control. */ |
| 357 | regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
| 358 | (psw_user_bits & PSW_MASK_ASC) | | ||
| 359 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
| 350 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | 360 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; |
| 351 | 361 | ||
| 352 | regs->gprs[2] = map_signal(sig); | 362 | regs->gprs[2] = map_signal(sig); |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 54d93f4b6818..dd55f7c20104 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
| @@ -40,6 +40,7 @@ static DEFINE_SPINLOCK(topology_lock); | |||
| 40 | static struct mask_info core_info; | 40 | static struct mask_info core_info; |
| 41 | cpumask_t cpu_core_map[NR_CPUS]; | 41 | cpumask_t cpu_core_map[NR_CPUS]; |
| 42 | unsigned char cpu_core_id[NR_CPUS]; | 42 | unsigned char cpu_core_id[NR_CPUS]; |
| 43 | unsigned char cpu_socket_id[NR_CPUS]; | ||
| 43 | 44 | ||
| 44 | static struct mask_info book_info; | 45 | static struct mask_info book_info; |
| 45 | cpumask_t cpu_book_map[NR_CPUS]; | 46 | cpumask_t cpu_book_map[NR_CPUS]; |
| @@ -83,11 +84,12 @@ static struct mask_info *add_cpus_to_mask(struct topology_cpu *tl_cpu, | |||
| 83 | cpumask_set_cpu(lcpu, &book->mask); | 84 | cpumask_set_cpu(lcpu, &book->mask); |
| 84 | cpu_book_id[lcpu] = book->id; | 85 | cpu_book_id[lcpu] = book->id; |
| 85 | cpumask_set_cpu(lcpu, &core->mask); | 86 | cpumask_set_cpu(lcpu, &core->mask); |
| 87 | cpu_core_id[lcpu] = rcpu; | ||
| 86 | if (one_core_per_cpu) { | 88 | if (one_core_per_cpu) { |
| 87 | cpu_core_id[lcpu] = rcpu; | 89 | cpu_socket_id[lcpu] = rcpu; |
| 88 | core = core->next; | 90 | core = core->next; |
| 89 | } else { | 91 | } else { |
| 90 | cpu_core_id[lcpu] = core->id; | 92 | cpu_socket_id[lcpu] = core->id; |
| 91 | } | 93 | } |
| 92 | smp_cpu_set_polarization(lcpu, tl_cpu->pp); | 94 | smp_cpu_set_polarization(lcpu, tl_cpu->pp); |
| 93 | } | 95 | } |
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 8b8285310b5a..1f5315d1215c 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
| @@ -180,8 +180,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
| 180 | addr = start; | 180 | addr = start; |
| 181 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 181 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
| 182 | end = start + len; | 182 | end = start + len; |
| 183 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 183 | if ((end < start) || (end > TASK_SIZE)) |
| 184 | (void __user *)start, len))) | ||
| 185 | return 0; | 184 | return 0; |
| 186 | 185 | ||
| 187 | local_irq_save(flags); | 186 | local_irq_save(flags); |
| @@ -229,7 +228,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
| 229 | addr = start; | 228 | addr = start; |
| 230 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 229 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
| 231 | end = start + len; | 230 | end = start + len; |
| 232 | if (end < start) | 231 | if ((end < start) || (end > TASK_SIZE)) |
| 233 | goto slow_irqon; | 232 | goto slow_irqon; |
| 234 | 233 | ||
| 235 | /* | 234 | /* |
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index e5c5473e69ce..c4fbb21e802b 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig | |||
| @@ -16,6 +16,8 @@ config UNICORE32 | |||
| 16 | select ARCH_WANT_FRAME_POINTERS | 16 | select ARCH_WANT_FRAME_POINTERS |
| 17 | select GENERIC_IOMAP | 17 | select GENERIC_IOMAP |
| 18 | select MODULES_USE_ELF_REL | 18 | select MODULES_USE_ELF_REL |
| 19 | select GENERIC_KERNEL_THREAD | ||
| 20 | select GENERIC_KERNEL_EXECVE | ||
| 19 | help | 21 | help |
| 20 | UniCore-32 is 32-bit Instruction Set Architecture, | 22 | UniCore-32 is 32-bit Instruction Set Architecture, |
| 21 | including a series of low-power-consumption RISC chip | 23 | including a series of low-power-consumption RISC chip |
| @@ -64,6 +66,9 @@ config GENERIC_CALIBRATE_DELAY | |||
| 64 | config ARCH_MAY_HAVE_PC_FDC | 66 | config ARCH_MAY_HAVE_PC_FDC |
| 65 | bool | 67 | bool |
| 66 | 68 | ||
| 69 | config ZONE_DMA | ||
| 70 | def_bool y | ||
| 71 | |||
| 67 | config NEED_DMA_MAP_STATE | 72 | config NEED_DMA_MAP_STATE |
| 68 | def_bool y | 73 | def_bool y |
| 69 | 74 | ||
| @@ -216,7 +221,7 @@ config PUV3_GPIO | |||
| 216 | bool | 221 | bool |
| 217 | depends on !ARCH_FPGA | 222 | depends on !ARCH_FPGA |
| 218 | select GENERIC_GPIO | 223 | select GENERIC_GPIO |
| 219 | select GPIO_SYSFS if EXPERIMENTAL | 224 | select GPIO_SYSFS |
| 220 | default y | 225 | default y |
| 221 | 226 | ||
| 222 | if PUV3_NB0916 | 227 | if PUV3_NB0916 |
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index c910c9857e11..601e92f18af6 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | include include/asm-generic/Kbuild.asm | ||
| 2 | 1 | ||
| 3 | generic-y += atomic.h | 2 | generic-y += atomic.h |
| 4 | generic-y += auxvec.h | 3 | generic-y += auxvec.h |
diff --git a/arch/unicore32/include/asm/bug.h b/arch/unicore32/include/asm/bug.h index b1ff8cadb086..93a56f3e2344 100644 --- a/arch/unicore32/include/asm/bug.h +++ b/arch/unicore32/include/asm/bug.h | |||
| @@ -19,9 +19,4 @@ extern void die(const char *msg, struct pt_regs *regs, int err); | |||
| 19 | extern void uc32_notify_die(const char *str, struct pt_regs *regs, | 19 | extern void uc32_notify_die(const char *str, struct pt_regs *regs, |
| 20 | struct siginfo *info, unsigned long err, unsigned long trap); | 20 | struct siginfo *info, unsigned long err, unsigned long trap); |
| 21 | 21 | ||
| 22 | extern asmlinkage void __backtrace(void); | ||
| 23 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | ||
| 24 | |||
| 25 | extern void __show_regs(struct pt_regs *); | ||
| 26 | |||
| 27 | #endif /* __UNICORE_BUG_H__ */ | 22 | #endif /* __UNICORE_BUG_H__ */ |
diff --git a/arch/unicore32/include/asm/cmpxchg.h b/arch/unicore32/include/asm/cmpxchg.h index df4d5acfd19f..8e797ad4fa24 100644 --- a/arch/unicore32/include/asm/cmpxchg.h +++ b/arch/unicore32/include/asm/cmpxchg.h | |||
| @@ -35,7 +35,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | |||
| 35 | : "memory", "cc"); | 35 | : "memory", "cc"); |
| 36 | break; | 36 | break; |
| 37 | default: | 37 | default: |
| 38 | ret = __xchg_bad_pointer(); | 38 | __xchg_bad_pointer(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | return ret; | 41 | return ret; |
diff --git a/arch/unicore32/include/asm/kvm_para.h b/arch/unicore32/include/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b957..000000000000 --- a/arch/unicore32/include/asm/kvm_para.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/kvm_para.h> | ||
diff --git a/arch/unicore32/include/asm/processor.h b/arch/unicore32/include/asm/processor.h index 14382cb09657..4eaa42167667 100644 --- a/arch/unicore32/include/asm/processor.h +++ b/arch/unicore32/include/asm/processor.h | |||
| @@ -72,11 +72,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
| 72 | 72 | ||
| 73 | #define cpu_relax() barrier() | 73 | #define cpu_relax() barrier() |
| 74 | 74 | ||
| 75 | /* | ||
| 76 | * Create a new kernel thread | ||
| 77 | */ | ||
| 78 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | ||
| 79 | |||
| 80 | #define task_pt_regs(p) \ | 75 | #define task_pt_regs(p) \ |
| 81 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) | 76 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) |
| 82 | 77 | ||
diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index b9caf9b0997b..726749dab52f 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h | |||
| @@ -12,80 +12,10 @@ | |||
| 12 | #ifndef __UNICORE_PTRACE_H__ | 12 | #ifndef __UNICORE_PTRACE_H__ |
| 13 | #define __UNICORE_PTRACE_H__ | 13 | #define __UNICORE_PTRACE_H__ |
| 14 | 14 | ||
| 15 | #define PTRACE_GET_THREAD_AREA 22 | 15 | #include <uapi/asm/ptrace.h> |
| 16 | |||
| 17 | /* | ||
| 18 | * PSR bits | ||
| 19 | */ | ||
| 20 | #define USER_MODE 0x00000010 | ||
| 21 | #define REAL_MODE 0x00000011 | ||
| 22 | #define INTR_MODE 0x00000012 | ||
| 23 | #define PRIV_MODE 0x00000013 | ||
| 24 | #define ABRT_MODE 0x00000017 | ||
| 25 | #define EXTN_MODE 0x0000001b | ||
| 26 | #define SUSR_MODE 0x0000001f | ||
| 27 | #define MODE_MASK 0x0000001f | ||
| 28 | #define PSR_R_BIT 0x00000040 | ||
| 29 | #define PSR_I_BIT 0x00000080 | ||
| 30 | #define PSR_V_BIT 0x10000000 | ||
| 31 | #define PSR_C_BIT 0x20000000 | ||
| 32 | #define PSR_Z_BIT 0x40000000 | ||
| 33 | #define PSR_S_BIT 0x80000000 | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Groups of PSR bits | ||
| 37 | */ | ||
| 38 | #define PSR_f 0xff000000 /* Flags */ | ||
| 39 | #define PSR_c 0x000000ff /* Control */ | ||
| 40 | 16 | ||
| 41 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
| 42 | 18 | ||
| 43 | /* | ||
| 44 | * This struct defines the way the registers are stored on the | ||
| 45 | * stack during a system call. Note that sizeof(struct pt_regs) | ||
| 46 | * has to be a multiple of 8. | ||
| 47 | */ | ||
| 48 | struct pt_regs { | ||
| 49 | unsigned long uregs[34]; | ||
| 50 | }; | ||
| 51 | |||
| 52 | #define UCreg_asr uregs[32] | ||
| 53 | #define UCreg_pc uregs[31] | ||
| 54 | #define UCreg_lr uregs[30] | ||
| 55 | #define UCreg_sp uregs[29] | ||
| 56 | #define UCreg_ip uregs[28] | ||
| 57 | #define UCreg_fp uregs[27] | ||
| 58 | #define UCreg_26 uregs[26] | ||
| 59 | #define UCreg_25 uregs[25] | ||
| 60 | #define UCreg_24 uregs[24] | ||
| 61 | #define UCreg_23 uregs[23] | ||
| 62 | #define UCreg_22 uregs[22] | ||
| 63 | #define UCreg_21 uregs[21] | ||
| 64 | #define UCreg_20 uregs[20] | ||
| 65 | #define UCreg_19 uregs[19] | ||
| 66 | #define UCreg_18 uregs[18] | ||
| 67 | #define UCreg_17 uregs[17] | ||
| 68 | #define UCreg_16 uregs[16] | ||
| 69 | #define UCreg_15 uregs[15] | ||
| 70 | #define UCreg_14 uregs[14] | ||
| 71 | #define UCreg_13 uregs[13] | ||
| 72 | #define UCreg_12 uregs[12] | ||
| 73 | #define UCreg_11 uregs[11] | ||
| 74 | #define UCreg_10 uregs[10] | ||
| 75 | #define UCreg_09 uregs[9] | ||
| 76 | #define UCreg_08 uregs[8] | ||
| 77 | #define UCreg_07 uregs[7] | ||
| 78 | #define UCreg_06 uregs[6] | ||
| 79 | #define UCreg_05 uregs[5] | ||
| 80 | #define UCreg_04 uregs[4] | ||
| 81 | #define UCreg_03 uregs[3] | ||
| 82 | #define UCreg_02 uregs[2] | ||
| 83 | #define UCreg_01 uregs[1] | ||
| 84 | #define UCreg_00 uregs[0] | ||
| 85 | #define UCreg_ORIG_00 uregs[33] | ||
| 86 | |||
| 87 | #ifdef __KERNEL__ | ||
| 88 | |||
| 89 | #define user_mode(regs) \ | 19 | #define user_mode(regs) \ |
| 90 | (processor_mode(regs) == USER_MODE) | 20 | (processor_mode(regs) == USER_MODE) |
| 91 | 21 | ||
| @@ -125,9 +55,5 @@ static inline int valid_user_regs(struct pt_regs *regs) | |||
| 125 | 55 | ||
| 126 | #define instruction_pointer(regs) ((regs)->UCreg_pc) | 56 | #define instruction_pointer(regs) ((regs)->UCreg_pc) |
| 127 | 57 | ||
| 128 | #endif /* __KERNEL__ */ | ||
| 129 | |||
| 130 | #endif /* __ASSEMBLY__ */ | 58 | #endif /* __ASSEMBLY__ */ |
| 131 | |||
| 132 | #endif | 59 | #endif |
| 133 | |||
diff --git a/arch/unicore32/include/uapi/asm/Kbuild b/arch/unicore32/include/uapi/asm/Kbuild index baebb3da1d44..0514d7ad6855 100644 --- a/arch/unicore32/include/uapi/asm/Kbuild +++ b/arch/unicore32/include/uapi/asm/Kbuild | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
| 3 | 3 | ||
| 4 | header-y += byteorder.h | ||
| 5 | header-y += kvm_para.h | ||
| 6 | header-y += ptrace.h | ||
| 7 | header-y += sigcontext.h | ||
| 8 | header-y += unistd.h | ||
| 9 | |||
| 10 | generic-y += kvm_para.h | ||
diff --git a/arch/unicore32/include/asm/byteorder.h b/arch/unicore32/include/uapi/asm/byteorder.h index ebe1b3fef3e3..ebe1b3fef3e3 100644 --- a/arch/unicore32/include/asm/byteorder.h +++ b/arch/unicore32/include/uapi/asm/byteorder.h | |||
diff --git a/arch/unicore32/include/uapi/asm/ptrace.h b/arch/unicore32/include/uapi/asm/ptrace.h new file mode 100644 index 000000000000..187aa2e98a53 --- /dev/null +++ b/arch/unicore32/include/uapi/asm/ptrace.h | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/unicore32/include/asm/ptrace.h | ||
| 3 | * | ||
| 4 | * Code specific to PKUnity SoC and UniCore ISA | ||
| 5 | * | ||
| 6 | * Copyright (C) 2001-2010 GUAN Xue-tao | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | #ifndef _UAPI__UNICORE_PTRACE_H__ | ||
| 13 | #define _UAPI__UNICORE_PTRACE_H__ | ||
| 14 | |||
| 15 | #define PTRACE_GET_THREAD_AREA 22 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * PSR bits | ||
| 19 | */ | ||
| 20 | #define USER_MODE 0x00000010 | ||
| 21 | #define REAL_MODE 0x00000011 | ||
| 22 | #define INTR_MODE 0x00000012 | ||
| 23 | #define PRIV_MODE 0x00000013 | ||
| 24 | #define ABRT_MODE 0x00000017 | ||
| 25 | #define EXTN_MODE 0x0000001b | ||
| 26 | #define SUSR_MODE 0x0000001f | ||
| 27 | #define MODE_MASK 0x0000001f | ||
| 28 | #define PSR_R_BIT 0x00000040 | ||
| 29 | #define PSR_I_BIT 0x00000080 | ||
| 30 | #define PSR_V_BIT 0x10000000 | ||
| 31 | #define PSR_C_BIT 0x20000000 | ||
| 32 | #define PSR_Z_BIT 0x40000000 | ||
| 33 | #define PSR_S_BIT 0x80000000 | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Groups of PSR bits | ||
| 37 | */ | ||
| 38 | #define PSR_f 0xff000000 /* Flags */ | ||
| 39 | #define PSR_c 0x000000ff /* Control */ | ||
| 40 | |||
| 41 | #ifndef __ASSEMBLY__ | ||
| 42 | |||
| 43 | /* | ||
| 44 | * This struct defines the way the registers are stored on the | ||
| 45 | * stack during a system call. Note that sizeof(struct pt_regs) | ||
| 46 | * has to be a multiple of 8. | ||
| 47 | */ | ||
| 48 | struct pt_regs { | ||
| 49 | unsigned long uregs[34]; | ||
| 50 | }; | ||
| 51 | |||
| 52 | #define UCreg_asr uregs[32] | ||
| 53 | #define UCreg_pc uregs[31] | ||
| 54 | #define UCreg_lr uregs[30] | ||
| 55 | #define UCreg_sp uregs[29] | ||
| 56 | #define UCreg_ip uregs[28] | ||
| 57 | #define UCreg_fp uregs[27] | ||
| 58 | #define UCreg_26 uregs[26] | ||
| 59 | #define UCreg_25 uregs[25] | ||
| 60 | #define UCreg_24 uregs[24] | ||
| 61 | #define UCreg_23 uregs[23] | ||
| 62 | #define UCreg_22 uregs[22] | ||
| 63 | #define UCreg_21 uregs[21] | ||
| 64 | #define UCreg_20 uregs[20] | ||
| 65 | #define UCreg_19 uregs[19] | ||
| 66 | #define UCreg_18 uregs[18] | ||
| 67 | #define UCreg_17 uregs[17] | ||
| 68 | #define UCreg_16 uregs[16] | ||
| 69 | #define UCreg_15 uregs[15] | ||
| 70 | #define UCreg_14 uregs[14] | ||
| 71 | #define UCreg_13 uregs[13] | ||
| 72 | #define UCreg_12 uregs[12] | ||
| 73 | #define UCreg_11 uregs[11] | ||
| 74 | #define UCreg_10 uregs[10] | ||
| 75 | #define UCreg_09 uregs[9] | ||
| 76 | #define UCreg_08 uregs[8] | ||
| 77 | #define UCreg_07 uregs[7] | ||
| 78 | #define UCreg_06 uregs[6] | ||
| 79 | #define UCreg_05 uregs[5] | ||
| 80 | #define UCreg_04 uregs[4] | ||
| 81 | #define UCreg_03 uregs[3] | ||
| 82 | #define UCreg_02 uregs[2] | ||
| 83 | #define UCreg_01 uregs[1] | ||
| 84 | #define UCreg_00 uregs[0] | ||
| 85 | #define UCreg_ORIG_00 uregs[33] | ||
| 86 | |||
| 87 | |||
| 88 | #endif /* __ASSEMBLY__ */ | ||
| 89 | |||
| 90 | #endif /* _UAPI__UNICORE_PTRACE_H__ */ | ||
diff --git a/arch/unicore32/include/asm/sigcontext.h b/arch/unicore32/include/uapi/asm/sigcontext.h index 6a2d7671c052..6a2d7671c052 100644 --- a/arch/unicore32/include/asm/sigcontext.h +++ b/arch/unicore32/include/uapi/asm/sigcontext.h | |||
diff --git a/arch/unicore32/include/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 2abcf61c615d..d18a3be89b38 100644 --- a/arch/unicore32/include/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h | |||
| @@ -12,3 +12,4 @@ | |||
| 12 | 12 | ||
| 13 | /* Use the standard ABI for syscalls. */ | 13 | /* Use the standard ABI for syscalls. */ |
| 14 | #include <asm-generic/unistd.h> | 14 | #include <asm-generic/unistd.h> |
| 15 | #define __ARCH_WANT_SYS_EXECVE | ||
diff --git a/arch/unicore32/kernel/entry.S b/arch/unicore32/kernel/entry.S index dcb87ab19ddd..7049350c790f 100644 --- a/arch/unicore32/kernel/entry.S +++ b/arch/unicore32/kernel/entry.S | |||
| @@ -573,17 +573,16 @@ ENDPROC(ret_to_user) | |||
| 573 | */ | 573 | */ |
| 574 | ENTRY(ret_from_fork) | 574 | ENTRY(ret_from_fork) |
| 575 | b.l schedule_tail | 575 | b.l schedule_tail |
| 576 | get_thread_info tsk | ||
| 577 | ldw r1, [tsk+], #TI_FLAGS @ check for syscall tracing | ||
| 578 | mov why, #1 | ||
| 579 | cand.a r1, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | ||
| 580 | beq ret_slow_syscall | ||
| 581 | mov r1, sp | ||
| 582 | mov r0, #1 @ trace exit [IP = 1] | ||
| 583 | b.l syscall_trace | ||
| 584 | b ret_slow_syscall | 576 | b ret_slow_syscall |
| 585 | ENDPROC(ret_from_fork) | 577 | ENDPROC(ret_from_fork) |
| 586 | 578 | ||
| 579 | ENTRY(ret_from_kernel_thread) | ||
| 580 | b.l schedule_tail | ||
| 581 | mov r0, r5 | ||
| 582 | adr lr, ret_slow_syscall | ||
| 583 | mov pc, r4 | ||
| 584 | ENDPROC(ret_from_kernel_thread) | ||
| 585 | |||
| 587 | /*============================================================================= | 586 | /*============================================================================= |
| 588 | * SWI handler | 587 | * SWI handler |
| 589 | *----------------------------------------------------------------------------- | 588 | *----------------------------------------------------------------------------- |
| @@ -669,11 +668,6 @@ __cr_alignment: | |||
| 669 | #endif | 668 | #endif |
| 670 | .ltorg | 669 | .ltorg |
| 671 | 670 | ||
| 672 | ENTRY(sys_execve) | ||
| 673 | add r3, sp, #S_OFF | ||
| 674 | b __sys_execve | ||
| 675 | ENDPROC(sys_execve) | ||
| 676 | |||
| 677 | ENTRY(sys_clone) | 671 | ENTRY(sys_clone) |
| 678 | add ip, sp, #S_OFF | 672 | add ip, sp, #S_OFF |
| 679 | stw ip, [sp+], #4 | 673 | stw ip, [sp+], #4 |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index b008586dad75..a8fe265ce2c0 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
| @@ -258,6 +258,7 @@ void release_thread(struct task_struct *dead_task) | |||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
| 261 | asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); | ||
| 261 | 262 | ||
| 262 | int | 263 | int |
| 263 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
| @@ -266,17 +267,22 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
| 266 | struct thread_info *thread = task_thread_info(p); | 267 | struct thread_info *thread = task_thread_info(p); |
| 267 | struct pt_regs *childregs = task_pt_regs(p); | 268 | struct pt_regs *childregs = task_pt_regs(p); |
| 268 | 269 | ||
| 269 | *childregs = *regs; | ||
| 270 | childregs->UCreg_00 = 0; | ||
| 271 | childregs->UCreg_sp = stack_start; | ||
| 272 | |||
| 273 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 270 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
| 274 | thread->cpu_context.sp = (unsigned long)childregs; | 271 | thread->cpu_context.sp = (unsigned long)childregs; |
| 275 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | 272 | if (unlikely(!regs)) { |
| 276 | 273 | thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread; | |
| 277 | if (clone_flags & CLONE_SETTLS) | 274 | thread->cpu_context.r4 = stack_start; |
| 278 | childregs->UCreg_16 = regs->UCreg_03; | 275 | thread->cpu_context.r5 = stk_sz; |
| 276 | memset(childregs, 0, sizeof(struct pt_regs)); | ||
| 277 | } else { | ||
| 278 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | ||
| 279 | *childregs = *regs; | ||
| 280 | childregs->UCreg_00 = 0; | ||
| 281 | childregs->UCreg_sp = stack_start; | ||
| 279 | 282 | ||
| 283 | if (clone_flags & CLONE_SETTLS) | ||
| 284 | childregs->UCreg_16 = regs->UCreg_03; | ||
| 285 | } | ||
| 280 | return 0; | 286 | return 0; |
| 281 | } | 287 | } |
| 282 | 288 | ||
| @@ -305,42 +311,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fp) | |||
| 305 | } | 311 | } |
| 306 | EXPORT_SYMBOL(dump_fpu); | 312 | EXPORT_SYMBOL(dump_fpu); |
| 307 | 313 | ||
| 308 | /* | ||
| 309 | * Shuffle the argument into the correct register before calling the | ||
| 310 | * thread function. r1 is the thread argument, r2 is the pointer to | ||
| 311 | * the thread function, and r3 points to the exit function. | ||
| 312 | */ | ||
| 313 | asm(".pushsection .text\n" | ||
| 314 | " .align\n" | ||
| 315 | " .type kernel_thread_helper, #function\n" | ||
| 316 | "kernel_thread_helper:\n" | ||
| 317 | " mov.a asr, r7\n" | ||
| 318 | " mov r0, r4\n" | ||
| 319 | " mov lr, r6\n" | ||
| 320 | " mov pc, r5\n" | ||
| 321 | " .size kernel_thread_helper, . - kernel_thread_helper\n" | ||
| 322 | " .popsection"); | ||
| 323 | |||
| 324 | /* | ||
| 325 | * Create a kernel thread. | ||
| 326 | */ | ||
| 327 | pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
| 328 | { | ||
| 329 | struct pt_regs regs; | ||
| 330 | |||
| 331 | memset(®s, 0, sizeof(regs)); | ||
| 332 | |||
| 333 | regs.UCreg_04 = (unsigned long)arg; | ||
| 334 | regs.UCreg_05 = (unsigned long)fn; | ||
| 335 | regs.UCreg_06 = (unsigned long)do_exit; | ||
| 336 | regs.UCreg_07 = PRIV_MODE; | ||
| 337 | regs.UCreg_pc = (unsigned long)kernel_thread_helper; | ||
| 338 | regs.UCreg_asr = regs.UCreg_07 | PSR_I_BIT; | ||
| 339 | |||
| 340 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | ||
| 341 | } | ||
| 342 | EXPORT_SYMBOL(kernel_thread); | ||
| 343 | |||
| 344 | unsigned long get_wchan(struct task_struct *p) | 314 | unsigned long get_wchan(struct task_struct *p) |
| 345 | { | 315 | { |
| 346 | struct stackframe frame; | 316 | struct stackframe frame; |
diff --git a/arch/unicore32/kernel/setup.h b/arch/unicore32/kernel/setup.h index f23955028a18..30f749da8f73 100644 --- a/arch/unicore32/kernel/setup.h +++ b/arch/unicore32/kernel/setup.h | |||
| @@ -30,4 +30,10 @@ extern char __vectors_start[], __vectors_end[]; | |||
| 30 | extern void kernel_thread_helper(void); | 30 | extern void kernel_thread_helper(void); |
| 31 | 31 | ||
| 32 | extern void __init early_signal_init(void); | 32 | extern void __init early_signal_init(void); |
| 33 | |||
| 34 | extern asmlinkage void __backtrace(void); | ||
| 35 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | ||
| 36 | |||
| 37 | extern void __show_regs(struct pt_regs *); | ||
| 38 | |||
| 33 | #endif | 39 | #endif |
diff --git a/arch/unicore32/kernel/sys.c b/arch/unicore32/kernel/sys.c index fabdee96110b..9680134b31f0 100644 --- a/arch/unicore32/kernel/sys.c +++ b/arch/unicore32/kernel/sys.c | |||
| @@ -42,69 +42,6 @@ asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
| 42 | parent_tid, child_tid); | 42 | parent_tid, child_tid); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | /* sys_execve() executes a new program. | ||
| 46 | * This is called indirectly via a small wrapper | ||
| 47 | */ | ||
| 48 | asmlinkage long __sys_execve(const char __user *filename, | ||
| 49 | const char __user *const __user *argv, | ||
| 50 | const char __user *const __user *envp, | ||
| 51 | struct pt_regs *regs) | ||
| 52 | { | ||
| 53 | int error; | ||
| 54 | struct filename *fn; | ||
| 55 | |||
| 56 | fn = getname(filename); | ||
| 57 | error = PTR_ERR(fn); | ||
| 58 | if (IS_ERR(fn)) | ||
| 59 | goto out; | ||
| 60 | error = do_execve(fn->name, argv, envp, regs); | ||
| 61 | putname(fn); | ||
| 62 | out: | ||
| 63 | return error; | ||
| 64 | } | ||
| 65 | |||
| 66 | int kernel_execve(const char *filename, | ||
| 67 | const char *const argv[], | ||
| 68 | const char *const envp[]) | ||
| 69 | { | ||
| 70 | struct pt_regs regs; | ||
| 71 | int ret; | ||
| 72 | |||
| 73 | memset(®s, 0, sizeof(struct pt_regs)); | ||
| 74 | ret = do_execve(filename, | ||
| 75 | (const char __user *const __user *)argv, | ||
| 76 | (const char __user *const __user *)envp, ®s); | ||
| 77 | if (ret < 0) | ||
| 78 | goto out; | ||
| 79 | |||
| 80 | /* | ||
| 81 | * Save argc to the register structure for userspace. | ||
| 82 | */ | ||
| 83 | regs.UCreg_00 = ret; | ||
| 84 | |||
| 85 | /* | ||
| 86 | * We were successful. We won't be returning to our caller, but | ||
| 87 | * instead to user space by manipulating the kernel stack. | ||
| 88 | */ | ||
| 89 | asm("add r0, %0, %1\n\t" | ||
| 90 | "mov r1, %2\n\t" | ||
| 91 | "mov r2, %3\n\t" | ||
| 92 | "mov r22, #0\n\t" /* not a syscall */ | ||
| 93 | "mov r23, %0\n\t" /* thread structure */ | ||
| 94 | "b.l memmove\n\t" /* copy regs to top of stack */ | ||
| 95 | "mov sp, r0\n\t" /* reposition stack pointer */ | ||
| 96 | "b ret_to_user" | ||
| 97 | : | ||
| 98 | : "r" (current_thread_info()), | ||
| 99 | "Ir" (THREAD_START_SP - sizeof(regs)), | ||
| 100 | "r" (®s), | ||
| 101 | "Ir" (sizeof(regs)) | ||
| 102 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); | ||
| 103 | |||
| 104 | out: | ||
| 105 | return ret; | ||
| 106 | } | ||
| 107 | |||
| 108 | /* Note: used by the compat code even in 64-bit Linux. */ | 45 | /* Note: used by the compat code even in 64-bit Linux. */ |
| 109 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, | 46 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, |
| 110 | unsigned long, prot, unsigned long, flags, | 47 | unsigned long, prot, unsigned long, flags, |
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index 2eeb9c04cab0..f9b5c10bccee 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c | |||
| @@ -168,7 +168,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma) | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr, | 170 | static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr, |
| 171 | struct task_struct *tsk) | 171 | unsigned int flags, struct task_struct *tsk) |
| 172 | { | 172 | { |
| 173 | struct vm_area_struct *vma; | 173 | struct vm_area_struct *vma; |
| 174 | int fault; | 174 | int fault; |
| @@ -194,14 +194,7 @@ good_area: | |||
| 194 | * If for any reason at all we couldn't handle the fault, make | 194 | * If for any reason at all we couldn't handle the fault, make |
| 195 | * sure we exit gracefully rather than endlessly redo the fault. | 195 | * sure we exit gracefully rather than endlessly redo the fault. |
| 196 | */ | 196 | */ |
| 197 | fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, | 197 | fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
| 198 | (!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0); | ||
| 199 | if (unlikely(fault & VM_FAULT_ERROR)) | ||
| 200 | return fault; | ||
| 201 | if (fault & VM_FAULT_MAJOR) | ||
| 202 | tsk->maj_flt++; | ||
| 203 | else | ||
| 204 | tsk->min_flt++; | ||
| 205 | return fault; | 198 | return fault; |
| 206 | 199 | ||
| 207 | check_stack: | 200 | check_stack: |
| @@ -216,6 +209,8 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
| 216 | struct task_struct *tsk; | 209 | struct task_struct *tsk; |
| 217 | struct mm_struct *mm; | 210 | struct mm_struct *mm; |
| 218 | int fault, sig, code; | 211 | int fault, sig, code; |
| 212 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | ||
| 213 | ((!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0); | ||
| 219 | 214 | ||
| 220 | tsk = current; | 215 | tsk = current; |
| 221 | mm = tsk->mm; | 216 | mm = tsk->mm; |
| @@ -236,6 +231,7 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
| 236 | if (!user_mode(regs) | 231 | if (!user_mode(regs) |
| 237 | && !search_exception_tables(regs->UCreg_pc)) | 232 | && !search_exception_tables(regs->UCreg_pc)) |
| 238 | goto no_context; | 233 | goto no_context; |
| 234 | retry: | ||
| 239 | down_read(&mm->mmap_sem); | 235 | down_read(&mm->mmap_sem); |
| 240 | } else { | 236 | } else { |
| 241 | /* | 237 | /* |
| @@ -251,7 +247,28 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
| 251 | #endif | 247 | #endif |
| 252 | } | 248 | } |
| 253 | 249 | ||
| 254 | fault = __do_pf(mm, addr, fsr, tsk); | 250 | fault = __do_pf(mm, addr, fsr, flags, tsk); |
| 251 | |||
| 252 | /* If we need to retry but a fatal signal is pending, handle the | ||
| 253 | * signal first. We do not need to release the mmap_sem because | ||
| 254 | * it would already be released in __lock_page_or_retry in | ||
| 255 | * mm/filemap.c. */ | ||
| 256 | if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) | ||
| 257 | return 0; | ||
| 258 | |||
| 259 | if (!(fault & VM_FAULT_ERROR) && (flags & FAULT_FLAG_ALLOW_RETRY)) { | ||
| 260 | if (fault & VM_FAULT_MAJOR) | ||
| 261 | tsk->maj_flt++; | ||
| 262 | else | ||
| 263 | tsk->min_flt++; | ||
| 264 | if (fault & VM_FAULT_RETRY) { | ||
| 265 | /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk | ||
| 266 | * of starvation. */ | ||
| 267 | flags &= ~FAULT_FLAG_ALLOW_RETRY; | ||
| 268 | goto retry; | ||
| 269 | } | ||
| 270 | } | ||
| 271 | |||
| 255 | up_read(&mm->mmap_sem); | 272 | up_read(&mm->mmap_sem); |
| 256 | 273 | ||
| 257 | /* | 274 | /* |
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index a10e46016851..58fc51488828 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h | |||
| @@ -24,6 +24,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu) | |||
| 24 | { | 24 | { |
| 25 | struct kvm_cpuid_entry2 *best; | 25 | struct kvm_cpuid_entry2 *best; |
| 26 | 26 | ||
| 27 | if (!static_cpu_has(X86_FEATURE_XSAVE)) | ||
| 28 | return 0; | ||
| 29 | |||
| 27 | best = kvm_find_cpuid_entry(vcpu, 1, 0); | 30 | best = kvm_find_cpuid_entry(vcpu, 1, 0); |
| 28 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); | 31 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); |
| 29 | } | 32 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 224a7e78cb6c..4f7641756be2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -5781,6 +5781,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
| 5781 | int pending_vec, max_bits, idx; | 5781 | int pending_vec, max_bits, idx; |
| 5782 | struct desc_ptr dt; | 5782 | struct desc_ptr dt; |
| 5783 | 5783 | ||
| 5784 | if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE)) | ||
| 5785 | return -EINVAL; | ||
| 5786 | |||
| 5784 | dt.size = sregs->idt.limit; | 5787 | dt.size = sregs->idt.limit; |
| 5785 | dt.address = sregs->idt.base; | 5788 | dt.address = sregs->idt.base; |
| 5786 | kvm_x86_ops->set_idt(vcpu, &dt); | 5789 | kvm_x86_ops->set_idt(vcpu, &dt); |
diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index ca4a25ed844c..e2c17d187d98 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c | |||
| @@ -40,7 +40,7 @@ void u8500_clk_init(void) | |||
| 40 | CLK_IS_ROOT|CLK_IGNORE_UNUSED, | 40 | CLK_IS_ROOT|CLK_IGNORE_UNUSED, |
| 41 | 32768); | 41 | 32768); |
| 42 | clk_register_clkdev(clk, "clk32k", NULL); | 42 | clk_register_clkdev(clk, "clk32k", NULL); |
| 43 | clk_register_clkdev(clk, NULL, "rtc-pl031"); | 43 | clk_register_clkdev(clk, "apb_pclk", "rtc-pl031"); |
| 44 | 44 | ||
| 45 | /* PRCMU clocks */ | 45 | /* PRCMU clocks */ |
| 46 | fw_version = prcmu_get_fw_version(); | 46 | fw_version = prcmu_get_fw_version(); |
| @@ -228,10 +228,17 @@ void u8500_clk_init(void) | |||
| 228 | 228 | ||
| 229 | clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE, | 229 | clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE, |
| 230 | BIT(2), 0); | 230 | BIT(2), 0); |
| 231 | clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1"); | ||
| 232 | |||
| 231 | clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE, | 233 | clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE, |
| 232 | BIT(3), 0); | 234 | BIT(3), 0); |
| 235 | clk_register_clkdev(clk, "apb_pclk", "msp0"); | ||
| 236 | clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.0"); | ||
| 237 | |||
| 233 | clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE, | 238 | clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE, |
| 234 | BIT(4), 0); | 239 | BIT(4), 0); |
| 240 | clk_register_clkdev(clk, "apb_pclk", "msp1"); | ||
| 241 | clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.1"); | ||
| 235 | 242 | ||
| 236 | clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", U8500_CLKRST1_BASE, | 243 | clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", U8500_CLKRST1_BASE, |
| 237 | BIT(5), 0); | 244 | BIT(5), 0); |
| @@ -239,6 +246,7 @@ void u8500_clk_init(void) | |||
| 239 | 246 | ||
| 240 | clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE, | 247 | clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE, |
| 241 | BIT(6), 0); | 248 | BIT(6), 0); |
| 249 | clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2"); | ||
| 242 | 250 | ||
| 243 | clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE, | 251 | clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE, |
| 244 | BIT(7), 0); | 252 | BIT(7), 0); |
| @@ -246,6 +254,7 @@ void u8500_clk_init(void) | |||
| 246 | 254 | ||
| 247 | clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", U8500_CLKRST1_BASE, | 255 | clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", U8500_CLKRST1_BASE, |
| 248 | BIT(8), 0); | 256 | BIT(8), 0); |
| 257 | clk_register_clkdev(clk, "apb_pclk", "slimbus0"); | ||
| 249 | 258 | ||
| 250 | clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", U8500_CLKRST1_BASE, | 259 | clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", U8500_CLKRST1_BASE, |
| 251 | BIT(9), 0); | 260 | BIT(9), 0); |
| @@ -255,11 +264,16 @@ void u8500_clk_init(void) | |||
| 255 | 264 | ||
| 256 | clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE, | 265 | clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE, |
| 257 | BIT(10), 0); | 266 | BIT(10), 0); |
| 267 | clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4"); | ||
| 268 | |||
| 258 | clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE, | 269 | clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE, |
| 259 | BIT(11), 0); | 270 | BIT(11), 0); |
| 271 | clk_register_clkdev(clk, "apb_pclk", "msp3"); | ||
| 272 | clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.3"); | ||
| 260 | 273 | ||
| 261 | clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE, | 274 | clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE, |
| 262 | BIT(0), 0); | 275 | BIT(0), 0); |
| 276 | clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3"); | ||
| 263 | 277 | ||
| 264 | clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE, | 278 | clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE, |
| 265 | BIT(1), 0); | 279 | BIT(1), 0); |
| @@ -279,12 +293,13 @@ void u8500_clk_init(void) | |||
| 279 | 293 | ||
| 280 | clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", U8500_CLKRST2_BASE, | 294 | clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", U8500_CLKRST2_BASE, |
| 281 | BIT(5), 0); | 295 | BIT(5), 0); |
| 296 | clk_register_clkdev(clk, "apb_pclk", "msp2"); | ||
| 297 | clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.2"); | ||
| 282 | 298 | ||
| 283 | clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", U8500_CLKRST2_BASE, | 299 | clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", U8500_CLKRST2_BASE, |
| 284 | BIT(6), 0); | 300 | BIT(6), 0); |
| 285 | clk_register_clkdev(clk, "apb_pclk", "sdi1"); | 301 | clk_register_clkdev(clk, "apb_pclk", "sdi1"); |
| 286 | 302 | ||
| 287 | |||
| 288 | clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE, | 303 | clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE, |
| 289 | BIT(7), 0); | 304 | BIT(7), 0); |
| 290 | clk_register_clkdev(clk, "apb_pclk", "sdi3"); | 305 | clk_register_clkdev(clk, "apb_pclk", "sdi3"); |
| @@ -316,10 +331,15 @@ void u8500_clk_init(void) | |||
| 316 | 331 | ||
| 317 | clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE, | 332 | clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE, |
| 318 | BIT(1), 0); | 333 | BIT(1), 0); |
| 334 | clk_register_clkdev(clk, "apb_pclk", "ssp0"); | ||
| 335 | |||
| 319 | clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE, | 336 | clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE, |
| 320 | BIT(2), 0); | 337 | BIT(2), 0); |
| 338 | clk_register_clkdev(clk, "apb_pclk", "ssp1"); | ||
| 339 | |||
| 321 | clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE, | 340 | clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE, |
| 322 | BIT(3), 0); | 341 | BIT(3), 0); |
| 342 | clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0"); | ||
| 323 | 343 | ||
| 324 | clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE, | 344 | clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE, |
| 325 | BIT(4), 0); | 345 | BIT(4), 0); |
| @@ -401,10 +421,17 @@ void u8500_clk_init(void) | |||
| 401 | 421 | ||
| 402 | clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk", | 422 | clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk", |
| 403 | U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE); | 423 | U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE); |
| 424 | clk_register_clkdev(clk, NULL, "nmk-i2c.1"); | ||
| 425 | |||
| 404 | clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk", | 426 | clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk", |
| 405 | U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE); | 427 | U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE); |
| 428 | clk_register_clkdev(clk, NULL, "msp0"); | ||
| 429 | clk_register_clkdev(clk, NULL, "ux500-msp-i2s.0"); | ||
| 430 | |||
| 406 | clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk", | 431 | clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk", |
| 407 | U8500_CLKRST1_BASE, BIT(4), CLK_SET_RATE_GATE); | 432 | U8500_CLKRST1_BASE, BIT(4), CLK_SET_RATE_GATE); |
| 433 | clk_register_clkdev(clk, NULL, "msp1"); | ||
| 434 | clk_register_clkdev(clk, NULL, "ux500-msp-i2s.1"); | ||
| 408 | 435 | ||
| 409 | clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk", | 436 | clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk", |
| 410 | U8500_CLKRST1_BASE, BIT(5), CLK_SET_RATE_GATE); | 437 | U8500_CLKRST1_BASE, BIT(5), CLK_SET_RATE_GATE); |
| @@ -412,17 +439,25 @@ void u8500_clk_init(void) | |||
| 412 | 439 | ||
| 413 | clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk", | 440 | clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk", |
| 414 | U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE); | 441 | U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE); |
| 442 | clk_register_clkdev(clk, NULL, "nmk-i2c.2"); | ||
| 443 | |||
| 415 | clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk", | 444 | clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk", |
| 416 | U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE); | 445 | U8500_CLKRST1_BASE, BIT(8), CLK_SET_RATE_GATE); |
| 417 | /* FIXME: Redefinition of BIT(3). */ | 446 | clk_register_clkdev(clk, NULL, "slimbus0"); |
| 447 | |||
| 418 | clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk", | 448 | clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk", |
| 419 | U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE); | 449 | U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE); |
| 450 | clk_register_clkdev(clk, NULL, "nmk-i2c.4"); | ||
| 451 | |||
| 420 | clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk", | 452 | clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk", |
| 421 | U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE); | 453 | U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE); |
| 454 | clk_register_clkdev(clk, NULL, "msp3"); | ||
| 455 | clk_register_clkdev(clk, NULL, "ux500-msp-i2s.3"); | ||
| 422 | 456 | ||
| 423 | /* Periph2 */ | 457 | /* Periph2 */ |
| 424 | clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk", | 458 | clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk", |
| 425 | U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE); | 459 | U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE); |
| 460 | clk_register_clkdev(clk, NULL, "nmk-i2c.3"); | ||
| 426 | 461 | ||
| 427 | clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk", | 462 | clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk", |
| 428 | U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE); | 463 | U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE); |
| @@ -430,6 +465,8 @@ void u8500_clk_init(void) | |||
| 430 | 465 | ||
| 431 | clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk", | 466 | clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk", |
| 432 | U8500_CLKRST2_BASE, BIT(3), CLK_SET_RATE_GATE); | 467 | U8500_CLKRST2_BASE, BIT(3), CLK_SET_RATE_GATE); |
| 468 | clk_register_clkdev(clk, NULL, "msp2"); | ||
| 469 | clk_register_clkdev(clk, NULL, "ux500-msp-i2s.2"); | ||
| 433 | 470 | ||
| 434 | clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk", | 471 | clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk", |
| 435 | U8500_CLKRST2_BASE, BIT(4), CLK_SET_RATE_GATE); | 472 | U8500_CLKRST2_BASE, BIT(4), CLK_SET_RATE_GATE); |
| @@ -450,10 +487,15 @@ void u8500_clk_init(void) | |||
| 450 | /* Periph3 */ | 487 | /* Periph3 */ |
| 451 | clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk", | 488 | clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk", |
| 452 | U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE); | 489 | U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE); |
| 490 | clk_register_clkdev(clk, NULL, "ssp0"); | ||
| 491 | |||
| 453 | clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk", | 492 | clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk", |
| 454 | U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE); | 493 | U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE); |
| 494 | clk_register_clkdev(clk, NULL, "ssp1"); | ||
| 495 | |||
| 455 | clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk", | 496 | clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk", |
| 456 | U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE); | 497 | U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE); |
| 498 | clk_register_clkdev(clk, NULL, "nmk-i2c.0"); | ||
| 457 | 499 | ||
| 458 | clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk", | 500 | clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk", |
| 459 | U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE); | 501 | U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE); |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index b726b478a4f5..6345878ae1e7 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
| @@ -143,7 +143,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode) | |||
| 143 | int old_dpms; | 143 | int old_dpms; |
| 144 | 144 | ||
| 145 | /* PCH platforms and VLV only support on/off. */ | 145 | /* PCH platforms and VLV only support on/off. */ |
| 146 | if (INTEL_INFO(dev)->gen < 5 && mode != DRM_MODE_DPMS_ON) | 146 | if (INTEL_INFO(dev)->gen >= 5 && mode != DRM_MODE_DPMS_ON) |
| 147 | mode = DRM_MODE_DPMS_OFF; | 147 | mode = DRM_MODE_DPMS_OFF; |
| 148 | 148 | ||
| 149 | if (mode == connector->dpms) | 149 | if (mode == connector->dpms) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 461a637f1ef7..4154bcd7a070 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -3841,6 +3841,17 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
| 3841 | } | 3841 | } |
| 3842 | } | 3842 | } |
| 3843 | 3843 | ||
| 3844 | if (intel_encoder->type == INTEL_OUTPUT_EDP) { | ||
| 3845 | /* Use VBT settings if we have an eDP panel */ | ||
| 3846 | unsigned int edp_bpc = dev_priv->edp.bpp / 3; | ||
| 3847 | |||
| 3848 | if (edp_bpc < display_bpc) { | ||
| 3849 | DRM_DEBUG_KMS("clamping display bpc (was %d) to eDP (%d)\n", display_bpc, edp_bpc); | ||
| 3850 | display_bpc = edp_bpc; | ||
| 3851 | } | ||
| 3852 | continue; | ||
| 3853 | } | ||
| 3854 | |||
| 3844 | /* | 3855 | /* |
| 3845 | * HDMI is either 12 or 8, so if the display lets 10bpc sneak | 3856 | * HDMI is either 12 or 8, so if the display lets 10bpc sneak |
| 3846 | * through, clamp it down. (Note: >12bpc will be caught below.) | 3857 | * through, clamp it down. (Note: >12bpc will be caught below.) |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 79d308da29ff..c600fb06e25e 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -2382,6 +2382,18 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) | |||
| 2382 | return true; | 2382 | return true; |
| 2383 | } | 2383 | } |
| 2384 | 2384 | ||
| 2385 | static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) | ||
| 2386 | { | ||
| 2387 | struct drm_device *dev = intel_sdvo->base.base.dev; | ||
| 2388 | struct drm_connector *connector, *tmp; | ||
| 2389 | |||
| 2390 | list_for_each_entry_safe(connector, tmp, | ||
| 2391 | &dev->mode_config.connector_list, head) { | ||
| 2392 | if (intel_attached_encoder(connector) == &intel_sdvo->base) | ||
| 2393 | intel_sdvo_destroy(connector); | ||
| 2394 | } | ||
| 2395 | } | ||
| 2396 | |||
| 2385 | static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, | 2397 | static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, |
| 2386 | struct intel_sdvo_connector *intel_sdvo_connector, | 2398 | struct intel_sdvo_connector *intel_sdvo_connector, |
| 2387 | int type) | 2399 | int type) |
| @@ -2705,7 +2717,8 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | |||
| 2705 | intel_sdvo->caps.output_flags) != true) { | 2717 | intel_sdvo->caps.output_flags) != true) { |
| 2706 | DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", | 2718 | DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", |
| 2707 | SDVO_NAME(intel_sdvo)); | 2719 | SDVO_NAME(intel_sdvo)); |
| 2708 | goto err; | 2720 | /* Output_setup can leave behind connectors! */ |
| 2721 | goto err_output; | ||
| 2709 | } | 2722 | } |
| 2710 | 2723 | ||
| 2711 | /* Only enable the hotplug irq if we need it, to work around noisy | 2724 | /* Only enable the hotplug irq if we need it, to work around noisy |
| @@ -2718,12 +2731,12 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | |||
| 2718 | 2731 | ||
| 2719 | /* Set the input timing to the screen. Assume always input 0. */ | 2732 | /* Set the input timing to the screen. Assume always input 0. */ |
| 2720 | if (!intel_sdvo_set_target_input(intel_sdvo)) | 2733 | if (!intel_sdvo_set_target_input(intel_sdvo)) |
| 2721 | goto err; | 2734 | goto err_output; |
| 2722 | 2735 | ||
| 2723 | if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, | 2736 | if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, |
| 2724 | &intel_sdvo->pixel_clock_min, | 2737 | &intel_sdvo->pixel_clock_min, |
| 2725 | &intel_sdvo->pixel_clock_max)) | 2738 | &intel_sdvo->pixel_clock_max)) |
| 2726 | goto err; | 2739 | goto err_output; |
| 2727 | 2740 | ||
| 2728 | DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " | 2741 | DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " |
| 2729 | "clock range %dMHz - %dMHz, " | 2742 | "clock range %dMHz - %dMHz, " |
| @@ -2743,6 +2756,9 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | |||
| 2743 | (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N'); | 2756 | (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N'); |
| 2744 | return true; | 2757 | return true; |
| 2745 | 2758 | ||
| 2759 | err_output: | ||
| 2760 | intel_sdvo_output_cleanup(intel_sdvo); | ||
| 2761 | |||
| 2746 | err: | 2762 | err: |
| 2747 | drm_encoder_cleanup(&intel_encoder->base); | 2763 | drm_encoder_cleanup(&intel_encoder->base); |
| 2748 | i2c_del_adapter(&intel_sdvo->ddc); | 2764 | i2c_del_adapter(&intel_sdvo->ddc); |
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index ba498f8e47a2..010bae19554a 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
| @@ -1625,7 +1625,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) | |||
| 1625 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0); | 1625 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0); |
| 1626 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0); | 1626 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0); |
| 1627 | /* some early dce3.2 boards have a bug in their transmitter control table */ | 1627 | /* some early dce3.2 boards have a bug in their transmitter control table */ |
| 1628 | if ((rdev->family != CHIP_RV710) || (rdev->family != CHIP_RV730)) | 1628 | if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730)) |
| 1629 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); | 1629 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); |
| 1630 | } | 1630 | } |
| 1631 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { | 1631 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 860dc4813e99..bd2a3b40cd12 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
| @@ -749,7 +749,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, | |||
| 749 | /* clear the pages coming from the pool if requested */ | 749 | /* clear the pages coming from the pool if requested */ |
| 750 | if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) { | 750 | if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) { |
| 751 | list_for_each_entry(p, &plist, lru) { | 751 | list_for_each_entry(p, &plist, lru) { |
| 752 | clear_page(page_address(p)); | 752 | if (PageHighMem(p)) |
| 753 | clear_highpage(p); | ||
| 754 | else | ||
| 755 | clear_page(page_address(p)); | ||
| 753 | } | 756 | } |
| 754 | } | 757 | } |
| 755 | 758 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index bf8260133ea9..7d759a430294 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c | |||
| @@ -308,9 +308,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) | |||
| 308 | if (unlikely(to_page == NULL)) | 308 | if (unlikely(to_page == NULL)) |
| 309 | goto out_err; | 309 | goto out_err; |
| 310 | 310 | ||
| 311 | preempt_disable(); | ||
| 312 | copy_highpage(to_page, from_page); | 311 | copy_highpage(to_page, from_page); |
| 313 | preempt_enable(); | ||
| 314 | page_cache_release(from_page); | 312 | page_cache_release(from_page); |
| 315 | } | 313 | } |
| 316 | 314 | ||
| @@ -358,9 +356,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) | |||
| 358 | ret = PTR_ERR(to_page); | 356 | ret = PTR_ERR(to_page); |
| 359 | goto out_err; | 357 | goto out_err; |
| 360 | } | 358 | } |
| 361 | preempt_disable(); | ||
| 362 | copy_highpage(to_page, from_page); | 359 | copy_highpage(to_page, from_page); |
| 363 | preempt_enable(); | ||
| 364 | set_page_dirty(to_page); | 360 | set_page_dirty(to_page); |
| 365 | mark_page_accessed(to_page); | 361 | mark_page_accessed(to_page); |
| 366 | page_cache_release(to_page); | 362 | page_cache_release(to_page); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index b07ca2e4d04b..7290811f89be 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | |||
| @@ -110,6 +110,8 @@ int vmw_get_cap_3d_ioctl(struct drm_device *dev, void *data, | |||
| 110 | memcpy_fromio(bounce, &fifo_mem[SVGA_FIFO_3D_CAPS], size); | 110 | memcpy_fromio(bounce, &fifo_mem[SVGA_FIFO_3D_CAPS], size); |
| 111 | 111 | ||
| 112 | ret = copy_to_user(buffer, bounce, size); | 112 | ret = copy_to_user(buffer, bounce, size); |
| 113 | if (ret) | ||
| 114 | ret = -EFAULT; | ||
| 113 | vfree(bounce); | 115 | vfree(bounce); |
| 114 | 116 | ||
| 115 | if (unlikely(ret != 0)) | 117 | if (unlikely(ret != 0)) |
diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index f676c01bb471..6fcd466d0825 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c | |||
| @@ -46,9 +46,9 @@ static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 46 | rdesc[559] = 0x45; | 46 | rdesc[559] = 0x45; |
| 47 | } | 47 | } |
| 48 | /* the same as above (s/usage/physical/) */ | 48 | /* the same as above (s/usage/physical/) */ |
| 49 | if ((quirks & MS_RDESC_3K) && *rsize == 106 && | 49 | if ((quirks & MS_RDESC_3K) && *rsize == 106 && rdesc[94] == 0x19 && |
| 50 | !memcmp((char []){ 0x19, 0x00, 0x29, 0xff }, | 50 | rdesc[95] == 0x00 && rdesc[96] == 0x29 && |
| 51 | &rdesc[94], 4)) { | 51 | rdesc[97] == 0xff) { |
| 52 | rdesc[94] = 0x35; | 52 | rdesc[94] = 0x35; |
| 53 | rdesc[96] = 0x45; | 53 | rdesc[96] = 0x45; |
| 54 | } | 54 | } |
diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 5f097f309b9f..7fa5b24b16db 100644 --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c | |||
| @@ -169,7 +169,7 @@ static int __devinit i2c_mux_pinctrl_probe(struct platform_device *pdev) | |||
| 169 | mux->busses = devm_kzalloc(&pdev->dev, | 169 | mux->busses = devm_kzalloc(&pdev->dev, |
| 170 | sizeof(mux->busses) * mux->pdata->bus_count, | 170 | sizeof(mux->busses) * mux->pdata->bus_count, |
| 171 | GFP_KERNEL); | 171 | GFP_KERNEL); |
| 172 | if (!mux->states) { | 172 | if (!mux->busses) { |
| 173 | dev_err(&pdev->dev, "Cannot allocate busses\n"); | 173 | dev_err(&pdev->dev, "Cannot allocate busses\n"); |
| 174 | ret = -ENOMEM; | 174 | ret = -ENOMEM; |
| 175 | goto err; | 175 | goto err; |
diff --git a/drivers/leds/ledtrig-cpu.c b/drivers/leds/ledtrig-cpu.c index b312056da14d..4239b3955ff0 100644 --- a/drivers/leds/ledtrig-cpu.c +++ b/drivers/leds/ledtrig-cpu.c | |||
| @@ -33,8 +33,6 @@ | |||
| 33 | struct led_trigger_cpu { | 33 | struct led_trigger_cpu { |
| 34 | char name[MAX_NAME_LEN]; | 34 | char name[MAX_NAME_LEN]; |
| 35 | struct led_trigger *_trig; | 35 | struct led_trigger *_trig; |
| 36 | struct mutex lock; | ||
| 37 | int lock_is_inited; | ||
| 38 | }; | 36 | }; |
| 39 | 37 | ||
| 40 | static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig); | 38 | static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig); |
| @@ -50,12 +48,6 @@ void ledtrig_cpu(enum cpu_led_event ledevt) | |||
| 50 | { | 48 | { |
| 51 | struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig); | 49 | struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig); |
| 52 | 50 | ||
| 53 | /* mutex lock should be initialized before calling mutex_call() */ | ||
| 54 | if (!trig->lock_is_inited) | ||
| 55 | return; | ||
| 56 | |||
| 57 | mutex_lock(&trig->lock); | ||
| 58 | |||
| 59 | /* Locate the correct CPU LED */ | 51 | /* Locate the correct CPU LED */ |
| 60 | switch (ledevt) { | 52 | switch (ledevt) { |
| 61 | case CPU_LED_IDLE_END: | 53 | case CPU_LED_IDLE_END: |
| @@ -75,8 +67,6 @@ void ledtrig_cpu(enum cpu_led_event ledevt) | |||
| 75 | /* Will leave the LED as it is */ | 67 | /* Will leave the LED as it is */ |
| 76 | break; | 68 | break; |
| 77 | } | 69 | } |
| 78 | |||
| 79 | mutex_unlock(&trig->lock); | ||
| 80 | } | 70 | } |
| 81 | EXPORT_SYMBOL(ledtrig_cpu); | 71 | EXPORT_SYMBOL(ledtrig_cpu); |
| 82 | 72 | ||
| @@ -117,14 +107,9 @@ static int __init ledtrig_cpu_init(void) | |||
| 117 | for_each_possible_cpu(cpu) { | 107 | for_each_possible_cpu(cpu) { |
| 118 | struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); | 108 | struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); |
| 119 | 109 | ||
| 120 | mutex_init(&trig->lock); | ||
| 121 | |||
| 122 | snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); | 110 | snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); |
| 123 | 111 | ||
| 124 | mutex_lock(&trig->lock); | ||
| 125 | led_trigger_register_simple(trig->name, &trig->_trig); | 112 | led_trigger_register_simple(trig->name, &trig->_trig); |
| 126 | trig->lock_is_inited = 1; | ||
| 127 | mutex_unlock(&trig->lock); | ||
| 128 | } | 113 | } |
| 129 | 114 | ||
| 130 | register_syscore_ops(&ledtrig_cpu_syscore_ops); | 115 | register_syscore_ops(&ledtrig_cpu_syscore_ops); |
| @@ -142,15 +127,9 @@ static void __exit ledtrig_cpu_exit(void) | |||
| 142 | for_each_possible_cpu(cpu) { | 127 | for_each_possible_cpu(cpu) { |
| 143 | struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); | 128 | struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); |
| 144 | 129 | ||
| 145 | mutex_lock(&trig->lock); | ||
| 146 | |||
| 147 | led_trigger_unregister_simple(trig->_trig); | 130 | led_trigger_unregister_simple(trig->_trig); |
| 148 | trig->_trig = NULL; | 131 | trig->_trig = NULL; |
| 149 | memset(trig->name, 0, MAX_NAME_LEN); | 132 | memset(trig->name, 0, MAX_NAME_LEN); |
| 150 | trig->lock_is_inited = 0; | ||
| 151 | |||
| 152 | mutex_unlock(&trig->lock); | ||
| 153 | mutex_destroy(&trig->lock); | ||
| 154 | } | 133 | } |
| 155 | 134 | ||
| 156 | unregister_syscore_ops(&ledtrig_cpu_syscore_ops); | 135 | unregister_syscore_ops(&ledtrig_cpu_syscore_ops); |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5c4829cba6a6..e872c8be080e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -1381,22 +1381,14 @@ struct regulator *regulator_get_exclusive(struct device *dev, const char *id) | |||
| 1381 | } | 1381 | } |
| 1382 | EXPORT_SYMBOL_GPL(regulator_get_exclusive); | 1382 | EXPORT_SYMBOL_GPL(regulator_get_exclusive); |
| 1383 | 1383 | ||
| 1384 | /** | 1384 | /* Locks held by regulator_put() */ |
| 1385 | * regulator_put - "free" the regulator source | 1385 | static void _regulator_put(struct regulator *regulator) |
| 1386 | * @regulator: regulator source | ||
| 1387 | * | ||
| 1388 | * Note: drivers must ensure that all regulator_enable calls made on this | ||
| 1389 | * regulator source are balanced by regulator_disable calls prior to calling | ||
| 1390 | * this function. | ||
| 1391 | */ | ||
| 1392 | void regulator_put(struct regulator *regulator) | ||
| 1393 | { | 1386 | { |
| 1394 | struct regulator_dev *rdev; | 1387 | struct regulator_dev *rdev; |
| 1395 | 1388 | ||
| 1396 | if (regulator == NULL || IS_ERR(regulator)) | 1389 | if (regulator == NULL || IS_ERR(regulator)) |
| 1397 | return; | 1390 | return; |
| 1398 | 1391 | ||
| 1399 | mutex_lock(®ulator_list_mutex); | ||
| 1400 | rdev = regulator->rdev; | 1392 | rdev = regulator->rdev; |
| 1401 | 1393 | ||
| 1402 | debugfs_remove_recursive(regulator->debugfs); | 1394 | debugfs_remove_recursive(regulator->debugfs); |
| @@ -1412,6 +1404,20 @@ void regulator_put(struct regulator *regulator) | |||
| 1412 | rdev->exclusive = 0; | 1404 | rdev->exclusive = 0; |
| 1413 | 1405 | ||
| 1414 | module_put(rdev->owner); | 1406 | module_put(rdev->owner); |
| 1407 | } | ||
| 1408 | |||
| 1409 | /** | ||
| 1410 | * regulator_put - "free" the regulator source | ||
| 1411 | * @regulator: regulator source | ||
| 1412 | * | ||
| 1413 | * Note: drivers must ensure that all regulator_enable calls made on this | ||
| 1414 | * regulator source are balanced by regulator_disable calls prior to calling | ||
| 1415 | * this function. | ||
| 1416 | */ | ||
| 1417 | void regulator_put(struct regulator *regulator) | ||
| 1418 | { | ||
| 1419 | mutex_lock(®ulator_list_mutex); | ||
| 1420 | _regulator_put(regulator); | ||
| 1415 | mutex_unlock(®ulator_list_mutex); | 1421 | mutex_unlock(®ulator_list_mutex); |
| 1416 | } | 1422 | } |
| 1417 | EXPORT_SYMBOL_GPL(regulator_put); | 1423 | EXPORT_SYMBOL_GPL(regulator_put); |
| @@ -1974,7 +1980,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | |||
| 1974 | if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { | 1980 | if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { |
| 1975 | ret = regulator_get_voltage(regulator); | 1981 | ret = regulator_get_voltage(regulator); |
| 1976 | if (ret >= 0) | 1982 | if (ret >= 0) |
| 1977 | return (min_uV >= ret && ret <= max_uV); | 1983 | return (min_uV <= ret && ret <= max_uV); |
| 1978 | else | 1984 | else |
| 1979 | return ret; | 1985 | return ret; |
| 1980 | } | 1986 | } |
| @@ -3365,7 +3371,7 @@ regulator_register(const struct regulator_desc *regulator_desc, | |||
| 3365 | if (ret != 0) { | 3371 | if (ret != 0) { |
| 3366 | rdev_err(rdev, "Failed to request enable GPIO%d: %d\n", | 3372 | rdev_err(rdev, "Failed to request enable GPIO%d: %d\n", |
| 3367 | config->ena_gpio, ret); | 3373 | config->ena_gpio, ret); |
| 3368 | goto clean; | 3374 | goto wash; |
| 3369 | } | 3375 | } |
| 3370 | 3376 | ||
| 3371 | rdev->ena_gpio = config->ena_gpio; | 3377 | rdev->ena_gpio = config->ena_gpio; |
| @@ -3445,10 +3451,11 @@ unset_supplies: | |||
| 3445 | 3451 | ||
| 3446 | scrub: | 3452 | scrub: |
| 3447 | if (rdev->supply) | 3453 | if (rdev->supply) |
| 3448 | regulator_put(rdev->supply); | 3454 | _regulator_put(rdev->supply); |
| 3449 | if (rdev->ena_gpio) | 3455 | if (rdev->ena_gpio) |
| 3450 | gpio_free(rdev->ena_gpio); | 3456 | gpio_free(rdev->ena_gpio); |
| 3451 | kfree(rdev->constraints); | 3457 | kfree(rdev->constraints); |
| 3458 | wash: | ||
| 3452 | device_unregister(&rdev->dev); | 3459 | device_unregister(&rdev->dev); |
| 3453 | /* device core frees rdev */ | 3460 | /* device core frees rdev */ |
| 3454 | rdev = ERR_PTR(ret); | 3461 | rdev = ERR_PTR(ret); |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 9ffb6d5f17aa..4ed343e4eb41 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | #define RAW3215_NR_CCWS 3 | 44 | #define RAW3215_NR_CCWS 3 |
| 45 | #define RAW3215_TIMEOUT HZ/10 /* time for delayed output */ | 45 | #define RAW3215_TIMEOUT HZ/10 /* time for delayed output */ |
| 46 | 46 | ||
| 47 | #define RAW3215_FIXED 1 /* 3215 console device is not be freed */ | ||
| 48 | #define RAW3215_WORKING 4 /* set if a request is being worked on */ | 47 | #define RAW3215_WORKING 4 /* set if a request is being worked on */ |
| 49 | #define RAW3215_THROTTLED 8 /* set if reading is disabled */ | 48 | #define RAW3215_THROTTLED 8 /* set if reading is disabled */ |
| 50 | #define RAW3215_STOPPED 16 /* set if writing is disabled */ | 49 | #define RAW3215_STOPPED 16 /* set if writing is disabled */ |
| @@ -339,8 +338,10 @@ static void raw3215_wakeup(unsigned long data) | |||
| 339 | struct tty_struct *tty; | 338 | struct tty_struct *tty; |
| 340 | 339 | ||
| 341 | tty = tty_port_tty_get(&raw->port); | 340 | tty = tty_port_tty_get(&raw->port); |
| 342 | tty_wakeup(tty); | 341 | if (tty) { |
| 343 | tty_kref_put(tty); | 342 | tty_wakeup(tty); |
| 343 | tty_kref_put(tty); | ||
| 344 | } | ||
| 344 | } | 345 | } |
| 345 | 346 | ||
| 346 | /* | 347 | /* |
| @@ -629,8 +630,7 @@ static void raw3215_shutdown(struct raw3215_info *raw) | |||
| 629 | DECLARE_WAITQUEUE(wait, current); | 630 | DECLARE_WAITQUEUE(wait, current); |
| 630 | unsigned long flags; | 631 | unsigned long flags; |
| 631 | 632 | ||
| 632 | if (!(raw->port.flags & ASYNC_INITIALIZED) || | 633 | if (!(raw->port.flags & ASYNC_INITIALIZED)) |
| 633 | (raw->flags & RAW3215_FIXED)) | ||
| 634 | return; | 634 | return; |
| 635 | /* Wait for outstanding requests, then free irq */ | 635 | /* Wait for outstanding requests, then free irq */ |
| 636 | spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); | 636 | spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); |
| @@ -926,8 +926,6 @@ static int __init con3215_init(void) | |||
| 926 | dev_set_drvdata(&cdev->dev, raw); | 926 | dev_set_drvdata(&cdev->dev, raw); |
| 927 | cdev->handler = raw3215_irq; | 927 | cdev->handler = raw3215_irq; |
| 928 | 928 | ||
| 929 | raw->flags |= RAW3215_FIXED; | ||
| 930 | |||
| 931 | /* Request the console irq */ | 929 | /* Request the console irq */ |
| 932 | if (raw3215_startup(raw) != 0) { | 930 | if (raw3215_startup(raw) != 0) { |
| 933 | raw3215_free_info(raw); | 931 | raw3215_free_info(raw); |
diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h index f2ffd963f1c3..d0cafd637199 100644 --- a/drivers/staging/android/android_alarm.h +++ b/drivers/staging/android/android_alarm.h | |||
| @@ -51,12 +51,10 @@ enum android_alarm_return_flags { | |||
| 51 | #define ANDROID_ALARM_WAIT _IO('a', 1) | 51 | #define ANDROID_ALARM_WAIT _IO('a', 1) |
| 52 | 52 | ||
| 53 | #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) | 53 | #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) |
| 54 | #define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size) | ||
| 55 | |||
| 56 | /* Set alarm */ | 54 | /* Set alarm */ |
| 57 | #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) | 55 | #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) |
| 58 | #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) | 56 | #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) |
| 59 | #define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec) | 57 | #define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) |
| 60 | #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) | 58 | #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) |
| 61 | #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) | 59 | #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) |
| 62 | #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) | 60 | #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) |
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index a5dec1ca1b82..13ee53bd0bf6 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c | |||
| @@ -424,7 +424,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
| 424 | { | 424 | { |
| 425 | struct hvc_struct *hp = tty->driver_data; | 425 | struct hvc_struct *hp = tty->driver_data; |
| 426 | unsigned long flags; | 426 | unsigned long flags; |
| 427 | int temp_open_count; | ||
| 428 | 427 | ||
| 429 | if (!hp) | 428 | if (!hp) |
| 430 | return; | 429 | return; |
| @@ -444,7 +443,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
| 444 | return; | 443 | return; |
| 445 | } | 444 | } |
| 446 | 445 | ||
| 447 | temp_open_count = hp->port.count; | ||
| 448 | hp->port.count = 0; | 446 | hp->port.count = 0; |
| 449 | spin_unlock_irqrestore(&hp->port.lock, flags); | 447 | spin_unlock_irqrestore(&hp->port.lock, flags); |
| 450 | tty_port_tty_set(&hp->port, NULL); | 448 | tty_port_tty_set(&hp->port, NULL); |
| @@ -453,11 +451,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
| 453 | 451 | ||
| 454 | if (hp->ops->notifier_hangup) | 452 | if (hp->ops->notifier_hangup) |
| 455 | hp->ops->notifier_hangup(hp, hp->data); | 453 | hp->ops->notifier_hangup(hp, hp->data); |
| 456 | |||
| 457 | while(temp_open_count) { | ||
| 458 | --temp_open_count; | ||
| 459 | tty_port_put(&hp->port); | ||
| 460 | } | ||
| 461 | } | 454 | } |
| 462 | 455 | ||
| 463 | /* | 456 | /* |
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 2bc28a59d385..1ab1d2c66de4 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
| @@ -1239,6 +1239,7 @@ static int __devexit max310x_remove(struct spi_device *spi) | |||
| 1239 | static const struct spi_device_id max310x_id_table[] = { | 1239 | static const struct spi_device_id max310x_id_table[] = { |
| 1240 | { "max3107", MAX310X_TYPE_MAX3107 }, | 1240 | { "max3107", MAX310X_TYPE_MAX3107 }, |
| 1241 | { "max3108", MAX310X_TYPE_MAX3108 }, | 1241 | { "max3108", MAX310X_TYPE_MAX3108 }, |
| 1242 | { } | ||
| 1242 | }; | 1243 | }; |
| 1243 | MODULE_DEVICE_TABLE(spi, max310x_id_table); | 1244 | MODULE_DEVICE_TABLE(spi, max310x_id_table); |
| 1244 | 1245 | ||
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 1e741bca0265..f034716190ff 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -2151,8 +2151,15 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum); | |||
| 2151 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) | 2151 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) |
| 2152 | { | 2152 | { |
| 2153 | struct usb_hcd *hcd = __hcd; | 2153 | struct usb_hcd *hcd = __hcd; |
| 2154 | unsigned long flags; | ||
| 2154 | irqreturn_t rc; | 2155 | irqreturn_t rc; |
| 2155 | 2156 | ||
| 2157 | /* IRQF_DISABLED doesn't work correctly with shared IRQs | ||
| 2158 | * when the first handler doesn't use it. So let's just | ||
| 2159 | * assume it's never used. | ||
| 2160 | */ | ||
| 2161 | local_irq_save(flags); | ||
| 2162 | |||
| 2156 | if (unlikely(HCD_DEAD(hcd) || !HCD_HW_ACCESSIBLE(hcd))) | 2163 | if (unlikely(HCD_DEAD(hcd) || !HCD_HW_ACCESSIBLE(hcd))) |
| 2157 | rc = IRQ_NONE; | 2164 | rc = IRQ_NONE; |
| 2158 | else if (hcd->driver->irq(hcd) == IRQ_NONE) | 2165 | else if (hcd->driver->irq(hcd) == IRQ_NONE) |
| @@ -2160,6 +2167,7 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd) | |||
| 2160 | else | 2167 | else |
| 2161 | rc = IRQ_HANDLED; | 2168 | rc = IRQ_HANDLED; |
| 2162 | 2169 | ||
| 2170 | local_irq_restore(flags); | ||
| 2163 | return rc; | 2171 | return rc; |
| 2164 | } | 2172 | } |
| 2165 | EXPORT_SYMBOL_GPL(usb_hcd_irq); | 2173 | EXPORT_SYMBOL_GPL(usb_hcd_irq); |
| @@ -2347,6 +2355,14 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd, | |||
| 2347 | int retval; | 2355 | int retval; |
| 2348 | 2356 | ||
| 2349 | if (hcd->driver->irq) { | 2357 | if (hcd->driver->irq) { |
| 2358 | |||
| 2359 | /* IRQF_DISABLED doesn't work as advertised when used together | ||
| 2360 | * with IRQF_SHARED. As usb_hcd_irq() will always disable | ||
| 2361 | * interrupts we can remove it here. | ||
| 2362 | */ | ||
| 2363 | if (irqflags & IRQF_SHARED) | ||
| 2364 | irqflags &= ~IRQF_DISABLED; | ||
| 2365 | |||
| 2350 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", | 2366 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", |
| 2351 | hcd->driver->description, hcd->self.busnum); | 2367 | hcd->driver->description, hcd->self.busnum); |
| 2352 | retval = request_irq(irqnum, &usb_hcd_irq, irqflags, | 2368 | retval = request_irq(irqnum, &usb_hcd_irq, irqflags, |
diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index e426ad626d74..4bfa78af379c 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/usb/ehci_def.h> | 20 | #include <linux/usb/ehci_def.h> |
| 21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
| 22 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
| 23 | #include <linux/kconfig.h> | ||
| 23 | #include <linux/kgdb.h> | 24 | #include <linux/kgdb.h> |
| 24 | #include <linux/kthread.h> | 25 | #include <linux/kthread.h> |
| 25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
| @@ -614,12 +615,6 @@ err: | |||
| 614 | return -ENODEV; | 615 | return -ENODEV; |
| 615 | } | 616 | } |
| 616 | 617 | ||
| 617 | int dbgp_external_startup(struct usb_hcd *hcd) | ||
| 618 | { | ||
| 619 | return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup(); | ||
| 620 | } | ||
| 621 | EXPORT_SYMBOL_GPL(dbgp_external_startup); | ||
| 622 | |||
| 623 | static int ehci_reset_port(int port) | 618 | static int ehci_reset_port(int port) |
| 624 | { | 619 | { |
| 625 | u32 portsc; | 620 | u32 portsc; |
| @@ -979,6 +974,7 @@ struct console early_dbgp_console = { | |||
| 979 | .index = -1, | 974 | .index = -1, |
| 980 | }; | 975 | }; |
| 981 | 976 | ||
| 977 | #if IS_ENABLED(CONFIG_USB_EHCI_HCD) | ||
| 982 | int dbgp_reset_prep(struct usb_hcd *hcd) | 978 | int dbgp_reset_prep(struct usb_hcd *hcd) |
| 983 | { | 979 | { |
| 984 | int ret = xen_dbgp_reset_prep(hcd); | 980 | int ret = xen_dbgp_reset_prep(hcd); |
| @@ -1007,6 +1003,13 @@ int dbgp_reset_prep(struct usb_hcd *hcd) | |||
| 1007 | } | 1003 | } |
| 1008 | EXPORT_SYMBOL_GPL(dbgp_reset_prep); | 1004 | EXPORT_SYMBOL_GPL(dbgp_reset_prep); |
| 1009 | 1005 | ||
| 1006 | int dbgp_external_startup(struct usb_hcd *hcd) | ||
| 1007 | { | ||
| 1008 | return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup(); | ||
| 1009 | } | ||
| 1010 | EXPORT_SYMBOL_GPL(dbgp_external_startup); | ||
| 1011 | #endif /* USB_EHCI_HCD */ | ||
| 1012 | |||
| 1010 | #ifdef CONFIG_KGDB | 1013 | #ifdef CONFIG_KGDB |
| 1011 | 1014 | ||
| 1012 | static char kgdbdbgp_buf[DBGP_MAX_PACKET]; | 1015 | static char kgdbdbgp_buf[DBGP_MAX_PACKET]; |
diff --git a/drivers/usb/host/ehci-ls1x.c b/drivers/usb/host/ehci-ls1x.c index ca759652626b..aa0f328922df 100644 --- a/drivers/usb/host/ehci-ls1x.c +++ b/drivers/usb/host/ehci-ls1x.c | |||
| @@ -113,7 +113,7 @@ static int ehci_hcd_ls1x_probe(struct platform_device *pdev) | |||
| 113 | goto err_put_hcd; | 113 | goto err_put_hcd; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | 116 | ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); |
| 117 | if (ret) | 117 | if (ret) |
| 118 | goto err_put_hcd; | 118 | goto err_put_hcd; |
| 119 | 119 | ||
diff --git a/drivers/usb/host/ohci-xls.c b/drivers/usb/host/ohci-xls.c index 84201cd1a472..41e378f17c66 100644 --- a/drivers/usb/host/ohci-xls.c +++ b/drivers/usb/host/ohci-xls.c | |||
| @@ -56,7 +56,7 @@ static int ohci_xls_probe_internal(const struct hc_driver *driver, | |||
| 56 | goto err3; | 56 | goto err3; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | retval = usb_add_hcd(hcd, irq, IRQF_SHARED); | 59 | retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); |
| 60 | if (retval != 0) | 60 | if (retval != 0) |
| 61 | goto err4; | 61 | goto err4; |
| 62 | return retval; | 62 | return retval; |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index d0b87e7b4abf..b6b84dacc791 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -707,11 +707,12 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 707 | fifo_count = musb_readw(epio, MUSB_RXCOUNT); | 707 | fifo_count = musb_readw(epio, MUSB_RXCOUNT); |
| 708 | 708 | ||
| 709 | /* | 709 | /* |
| 710 | * use mode 1 only if we expect data of at least ep packet_sz | 710 | * Enable Mode 1 on RX transfers only when short_not_ok flag |
| 711 | * and have not yet received a short packet | 711 | * is set. Currently short_not_ok flag is set only from |
| 712 | * file_storage and f_mass_storage drivers | ||
| 712 | */ | 713 | */ |
| 713 | if ((request->length - request->actual >= musb_ep->packet_sz) && | 714 | |
| 714 | (fifo_count >= musb_ep->packet_sz)) | 715 | if (request->short_not_ok && fifo_count == musb_ep->packet_sz) |
| 715 | use_mode_1 = 1; | 716 | use_mode_1 = 1; |
| 716 | else | 717 | else |
| 717 | use_mode_1 = 0; | 718 | use_mode_1 = 0; |
| @@ -727,6 +728,27 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 727 | c = musb->dma_controller; | 728 | c = musb->dma_controller; |
| 728 | channel = musb_ep->dma; | 729 | channel = musb_ep->dma; |
| 729 | 730 | ||
| 731 | /* We use DMA Req mode 0 in rx_csr, and DMA controller operates in | ||
| 732 | * mode 0 only. So we do not get endpoint interrupts due to DMA | ||
| 733 | * completion. We only get interrupts from DMA controller. | ||
| 734 | * | ||
| 735 | * We could operate in DMA mode 1 if we knew the size of the tranfer | ||
| 736 | * in advance. For mass storage class, request->length = what the host | ||
| 737 | * sends, so that'd work. But for pretty much everything else, | ||
| 738 | * request->length is routinely more than what the host sends. For | ||
| 739 | * most these gadgets, end of is signified either by a short packet, | ||
| 740 | * or filling the last byte of the buffer. (Sending extra data in | ||
| 741 | * that last pckate should trigger an overflow fault.) But in mode 1, | ||
| 742 | * we don't get DMA completion interrupt for short packets. | ||
| 743 | * | ||
| 744 | * Theoretically, we could enable DMAReq irq (MUSB_RXCSR_DMAMODE = 1), | ||
| 745 | * to get endpoint interrupt on every DMA req, but that didn't seem | ||
| 746 | * to work reliably. | ||
| 747 | * | ||
| 748 | * REVISIT an updated g_file_storage can set req->short_not_ok, which | ||
| 749 | * then becomes usable as a runtime "use mode 1" hint... | ||
| 750 | */ | ||
| 751 | |||
| 730 | /* Experimental: Mode1 works with mass storage use cases */ | 752 | /* Experimental: Mode1 works with mass storage use cases */ |
| 731 | if (use_mode_1) { | 753 | if (use_mode_1) { |
| 732 | csr |= MUSB_RXCSR_AUTOCLEAR; | 754 | csr |= MUSB_RXCSR_AUTOCLEAR; |
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index d62a91fedc22..0e62f504410e 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c | |||
| @@ -65,7 +65,7 @@ static int __devinit ux500_probe(struct platform_device *pdev) | |||
| 65 | struct platform_device *musb; | 65 | struct platform_device *musb; |
| 66 | struct ux500_glue *glue; | 66 | struct ux500_glue *glue; |
| 67 | struct clk *clk; | 67 | struct clk *clk; |
| 68 | 68 | int musbid; | |
| 69 | int ret = -ENOMEM; | 69 | int ret = -ENOMEM; |
| 70 | 70 | ||
| 71 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); | 71 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); |
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig index d8c8a42bff3e..6223062d5d1b 100644 --- a/drivers/usb/otg/Kconfig +++ b/drivers/usb/otg/Kconfig | |||
| @@ -58,7 +58,7 @@ config USB_ULPI_VIEWPORT | |||
| 58 | 58 | ||
| 59 | config TWL4030_USB | 59 | config TWL4030_USB |
| 60 | tristate "TWL4030 USB Transceiver Driver" | 60 | tristate "TWL4030 USB Transceiver Driver" |
| 61 | depends on TWL4030_CORE && REGULATOR_TWL4030 | 61 | depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS |
| 62 | select USB_OTG_UTILS | 62 | select USB_OTG_UTILS |
| 63 | help | 63 | help |
| 64 | Enable this to support the USB OTG transceiver on TWL4030 | 64 | Enable this to support the USB OTG transceiver on TWL4030 |
| @@ -68,7 +68,7 @@ config TWL4030_USB | |||
| 68 | 68 | ||
| 69 | config TWL6030_USB | 69 | config TWL6030_USB |
| 70 | tristate "TWL6030 USB Transceiver Driver" | 70 | tristate "TWL6030 USB Transceiver Driver" |
| 71 | depends on TWL4030_CORE && OMAP_USB2 | 71 | depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS |
| 72 | select USB_OTG_UTILS | 72 | select USB_OTG_UTILS |
| 73 | help | 73 | help |
| 74 | Enable this to support the USB OTG transceiver on TWL6030 | 74 | Enable this to support the USB OTG transceiver on TWL6030 |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 7179b0c5f814..cff8dd5b462d 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
| @@ -2430,7 +2430,7 @@ static void keyspan_release(struct usb_serial *serial) | |||
| 2430 | static int keyspan_port_probe(struct usb_serial_port *port) | 2430 | static int keyspan_port_probe(struct usb_serial_port *port) |
| 2431 | { | 2431 | { |
| 2432 | struct usb_serial *serial = port->serial; | 2432 | struct usb_serial *serial = port->serial; |
| 2433 | struct keyspan_port_private *s_priv; | 2433 | struct keyspan_serial_private *s_priv; |
| 2434 | struct keyspan_port_private *p_priv; | 2434 | struct keyspan_port_private *p_priv; |
| 2435 | const struct keyspan_device_details *d_details; | 2435 | const struct keyspan_device_details *d_details; |
| 2436 | struct callbacks *cback; | 2436 | struct callbacks *cback; |
| @@ -2445,7 +2445,6 @@ static int keyspan_port_probe(struct usb_serial_port *port) | |||
| 2445 | if (!p_priv) | 2445 | if (!p_priv) |
| 2446 | return -ENOMEM; | 2446 | return -ENOMEM; |
| 2447 | 2447 | ||
| 2448 | s_priv = usb_get_serial_data(port->serial); | ||
| 2449 | p_priv->device_details = d_details; | 2448 | p_priv->device_details = d_details; |
| 2450 | 2449 | ||
| 2451 | /* Setup values for the various callback routines */ | 2450 | /* Setup values for the various callback routines */ |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5dee7d61241e..edc64bb6f457 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -158,6 +158,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 158 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 | 158 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 |
| 159 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 | 159 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 |
| 160 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 | 160 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 |
| 161 | #define NOVATELWIRELESS_PRODUCT_E362 0x9010 | ||
| 161 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | 162 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 |
| 162 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | 163 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 |
| 163 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 164 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
| @@ -193,6 +194,9 @@ static void option_instat_callback(struct urb *urb); | |||
| 193 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 | 194 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 |
| 194 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 | 195 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 |
| 195 | 196 | ||
| 197 | #define DELL_PRODUCT_5800_MINICARD_VZW 0x8195 /* Novatel E362 */ | ||
| 198 | #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */ | ||
| 199 | |||
| 196 | #define KYOCERA_VENDOR_ID 0x0c88 | 200 | #define KYOCERA_VENDOR_ID 0x0c88 |
| 197 | #define KYOCERA_PRODUCT_KPC650 0x17da | 201 | #define KYOCERA_PRODUCT_KPC650 0x17da |
| 198 | #define KYOCERA_PRODUCT_KPC680 0x180a | 202 | #define KYOCERA_PRODUCT_KPC680 0x180a |
| @@ -283,6 +287,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 283 | /* ALCATEL PRODUCTS */ | 287 | /* ALCATEL PRODUCTS */ |
| 284 | #define ALCATEL_VENDOR_ID 0x1bbb | 288 | #define ALCATEL_VENDOR_ID 0x1bbb |
| 285 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 | 289 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 |
| 290 | #define ALCATEL_PRODUCT_X220_X500D 0x0017 | ||
| 286 | 291 | ||
| 287 | #define PIRELLI_VENDOR_ID 0x1266 | 292 | #define PIRELLI_VENDOR_ID 0x1266 |
| 288 | #define PIRELLI_PRODUCT_C100_1 0x1002 | 293 | #define PIRELLI_PRODUCT_C100_1 0x1002 |
| @@ -706,6 +711,7 @@ static const struct usb_device_id option_ids[] = { | |||
| 706 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | 711 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, |
| 707 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | 712 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ |
| 708 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | 713 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, |
| 714 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) }, | ||
| 709 | 715 | ||
| 710 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 716 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
| 711 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 717 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
| @@ -728,6 +734,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 728 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 734 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
| 729 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 735 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
| 730 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 736 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
| 737 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
| 738 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
| 731 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ | 739 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ |
| 732 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 740 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
| 733 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | 741 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, |
| @@ -1157,6 +1165,7 @@ static const struct usb_device_id option_ids[] = { | |||
| 1157 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), | 1165 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
| 1158 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist | 1166 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist |
| 1159 | }, | 1167 | }, |
| 1168 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, | ||
| 1160 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 1169 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
| 1161 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | 1170 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, |
| 1162 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), | 1171 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 61a73ad1a187..a3e9c095f0d8 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
| @@ -455,9 +455,6 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, | |||
| 455 | struct usb_serial *serial = port->serial; | 455 | struct usb_serial *serial = port->serial; |
| 456 | struct urb *urb; | 456 | struct urb *urb; |
| 457 | 457 | ||
| 458 | if (endpoint == -1) | ||
| 459 | return NULL; /* endpoint not needed */ | ||
| 460 | |||
| 461 | urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ | 458 | urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ |
| 462 | if (urb == NULL) { | 459 | if (urb == NULL) { |
| 463 | dev_dbg(&serial->interface->dev, | 460 | dev_dbg(&serial->interface->dev, |
| @@ -489,6 +486,9 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | |||
| 489 | init_usb_anchor(&portdata->delayed); | 486 | init_usb_anchor(&portdata->delayed); |
| 490 | 487 | ||
| 491 | for (i = 0; i < N_IN_URB; i++) { | 488 | for (i = 0; i < N_IN_URB; i++) { |
| 489 | if (!port->bulk_in_size) | ||
| 490 | break; | ||
| 491 | |||
| 492 | buffer = (u8 *)__get_free_page(GFP_KERNEL); | 492 | buffer = (u8 *)__get_free_page(GFP_KERNEL); |
| 493 | if (!buffer) | 493 | if (!buffer) |
| 494 | goto bail_out_error; | 494 | goto bail_out_error; |
| @@ -502,8 +502,8 @@ int usb_wwan_port_probe(struct usb_serial_port *port) | |||
| 502 | } | 502 | } |
| 503 | 503 | ||
| 504 | for (i = 0; i < N_OUT_URB; i++) { | 504 | for (i = 0; i < N_OUT_URB; i++) { |
| 505 | if (port->bulk_out_endpointAddress == -1) | 505 | if (!port->bulk_out_size) |
| 506 | continue; | 506 | break; |
| 507 | 507 | ||
| 508 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); | 508 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); |
| 509 | if (!buffer) | 509 | if (!buffer) |
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index a40da07e93d6..947fbe06c3b1 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
| @@ -161,6 +161,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) | |||
| 161 | 161 | ||
| 162 | while (s < e) { | 162 | while (s < e) { |
| 163 | unsigned long flags; | 163 | unsigned long flags; |
| 164 | u64 id; | ||
| 164 | 165 | ||
| 165 | if (c > psinfo->bufsize) | 166 | if (c > psinfo->bufsize) |
| 166 | c = psinfo->bufsize; | 167 | c = psinfo->bufsize; |
| @@ -172,7 +173,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) | |||
| 172 | spin_lock_irqsave(&psinfo->buf_lock, flags); | 173 | spin_lock_irqsave(&psinfo->buf_lock, flags); |
| 173 | } | 174 | } |
| 174 | memcpy(psinfo->buf, s, c); | 175 | memcpy(psinfo->buf, s, c); |
| 175 | psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo); | 176 | psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, c, psinfo); |
| 176 | spin_unlock_irqrestore(&psinfo->buf_lock, flags); | 177 | spin_unlock_irqrestore(&psinfo->buf_lock, flags); |
| 177 | s += c; | 178 | s += c; |
| 178 | c = e - s; | 179 | c = e - s; |
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index 28ec13af28d9..2dcf3d473fec 100644 --- a/fs/ubifs/find.c +++ b/fs/ubifs/find.c | |||
| @@ -681,8 +681,16 @@ int ubifs_find_free_leb_for_idx(struct ubifs_info *c) | |||
| 681 | if (!lprops) { | 681 | if (!lprops) { |
| 682 | lprops = ubifs_fast_find_freeable(c); | 682 | lprops = ubifs_fast_find_freeable(c); |
| 683 | if (!lprops) { | 683 | if (!lprops) { |
| 684 | ubifs_assert(c->freeable_cnt == 0); | 684 | /* |
| 685 | if (c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { | 685 | * The first condition means the following: go scan the |
| 686 | * LPT if there are uncategorized lprops, which means | ||
| 687 | * there may be freeable LEBs there (UBIFS does not | ||
| 688 | * store the information about freeable LEBs in the | ||
| 689 | * master node). | ||
| 690 | */ | ||
| 691 | if (c->in_a_category_cnt != c->main_lebs || | ||
| 692 | c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { | ||
| 693 | ubifs_assert(c->freeable_cnt == 0); | ||
| 686 | lprops = scan_for_leb_for_idx(c); | 694 | lprops = scan_for_leb_for_idx(c); |
| 687 | if (IS_ERR(lprops)) { | 695 | if (IS_ERR(lprops)) { |
| 688 | err = PTR_ERR(lprops); | 696 | err = PTR_ERR(lprops); |
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index e5a2a35a46dc..46190a7c42a6 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c | |||
| @@ -300,8 +300,11 @@ void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops, | |||
| 300 | default: | 300 | default: |
| 301 | ubifs_assert(0); | 301 | ubifs_assert(0); |
| 302 | } | 302 | } |
| 303 | |||
| 303 | lprops->flags &= ~LPROPS_CAT_MASK; | 304 | lprops->flags &= ~LPROPS_CAT_MASK; |
| 304 | lprops->flags |= cat; | 305 | lprops->flags |= cat; |
| 306 | c->in_a_category_cnt += 1; | ||
| 307 | ubifs_assert(c->in_a_category_cnt <= c->main_lebs); | ||
| 305 | } | 308 | } |
| 306 | 309 | ||
| 307 | /** | 310 | /** |
| @@ -334,6 +337,9 @@ static void ubifs_remove_from_cat(struct ubifs_info *c, | |||
| 334 | default: | 337 | default: |
| 335 | ubifs_assert(0); | 338 | ubifs_assert(0); |
| 336 | } | 339 | } |
| 340 | |||
| 341 | c->in_a_category_cnt -= 1; | ||
| 342 | ubifs_assert(c->in_a_category_cnt >= 0); | ||
| 337 | } | 343 | } |
| 338 | 344 | ||
| 339 | /** | 345 | /** |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 5486346d0a3f..d133c276fe05 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
| @@ -1183,6 +1183,8 @@ struct ubifs_debug_info; | |||
| 1183 | * @freeable_list: list of freeable non-index LEBs (free + dirty == @leb_size) | 1183 | * @freeable_list: list of freeable non-index LEBs (free + dirty == @leb_size) |
| 1184 | * @frdi_idx_list: list of freeable index LEBs (free + dirty == @leb_size) | 1184 | * @frdi_idx_list: list of freeable index LEBs (free + dirty == @leb_size) |
| 1185 | * @freeable_cnt: number of freeable LEBs in @freeable_list | 1185 | * @freeable_cnt: number of freeable LEBs in @freeable_list |
| 1186 | * @in_a_category_cnt: count of lprops which are in a certain category, which | ||
| 1187 | * basically meants that they were loaded from the flash | ||
| 1186 | * | 1188 | * |
| 1187 | * @ltab_lnum: LEB number of LPT's own lprops table | 1189 | * @ltab_lnum: LEB number of LPT's own lprops table |
| 1188 | * @ltab_offs: offset of LPT's own lprops table | 1190 | * @ltab_offs: offset of LPT's own lprops table |
| @@ -1412,6 +1414,7 @@ struct ubifs_info { | |||
| 1412 | struct list_head freeable_list; | 1414 | struct list_head freeable_list; |
| 1413 | struct list_head frdi_idx_list; | 1415 | struct list_head frdi_idx_list; |
| 1414 | int freeable_cnt; | 1416 | int freeable_cnt; |
| 1417 | int in_a_category_cnt; | ||
| 1415 | 1418 | ||
| 1416 | int ltab_lnum; | 1419 | int ltab_lnum; |
| 1417 | int ltab_offs; | 1420 | int ltab_offs; |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index c12731582920..f9f5e9eeb9dd 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk); | |||
| 335 | struct clk_hw *__clk_get_hw(struct clk *clk); | 335 | struct clk_hw *__clk_get_hw(struct clk *clk); |
| 336 | u8 __clk_get_num_parents(struct clk *clk); | 336 | u8 __clk_get_num_parents(struct clk *clk); |
| 337 | struct clk *__clk_get_parent(struct clk *clk); | 337 | struct clk *__clk_get_parent(struct clk *clk); |
| 338 | inline int __clk_get_enable_count(struct clk *clk); | 338 | int __clk_get_enable_count(struct clk *clk); |
| 339 | inline int __clk_get_prepare_count(struct clk *clk); | 339 | int __clk_get_prepare_count(struct clk *clk); |
| 340 | unsigned long __clk_get_rate(struct clk *clk); | 340 | unsigned long __clk_get_rate(struct clk *clk); |
| 341 | unsigned long __clk_get_flags(struct clk *clk); | 341 | unsigned long __clk_get_flags(struct clk *clk); |
| 342 | int __clk_is_enabled(struct clk *clk); | 342 | int __clk_is_enabled(struct clk *clk); |
diff --git a/kernel/futex.c b/kernel/futex.c index 3717e7b306e0..20ef219bbe9b 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -716,7 +716,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb, | |||
| 716 | struct futex_pi_state **ps, | 716 | struct futex_pi_state **ps, |
| 717 | struct task_struct *task, int set_waiters) | 717 | struct task_struct *task, int set_waiters) |
| 718 | { | 718 | { |
| 719 | int lock_taken, ret, ownerdied = 0; | 719 | int lock_taken, ret, force_take = 0; |
| 720 | u32 uval, newval, curval, vpid = task_pid_vnr(task); | 720 | u32 uval, newval, curval, vpid = task_pid_vnr(task); |
| 721 | 721 | ||
| 722 | retry: | 722 | retry: |
| @@ -755,17 +755,15 @@ retry: | |||
| 755 | newval = curval | FUTEX_WAITERS; | 755 | newval = curval | FUTEX_WAITERS; |
| 756 | 756 | ||
| 757 | /* | 757 | /* |
| 758 | * There are two cases, where a futex might have no owner (the | 758 | * Should we force take the futex? See below. |
| 759 | * owner TID is 0): OWNER_DIED. We take over the futex in this | ||
| 760 | * case. We also do an unconditional take over, when the owner | ||
| 761 | * of the futex died. | ||
| 762 | * | ||
| 763 | * This is safe as we are protected by the hash bucket lock ! | ||
| 764 | */ | 759 | */ |
| 765 | if (unlikely(ownerdied || !(curval & FUTEX_TID_MASK))) { | 760 | if (unlikely(force_take)) { |
| 766 | /* Keep the OWNER_DIED bit */ | 761 | /* |
| 762 | * Keep the OWNER_DIED and the WAITERS bit and set the | ||
| 763 | * new TID value. | ||
| 764 | */ | ||
| 767 | newval = (curval & ~FUTEX_TID_MASK) | vpid; | 765 | newval = (curval & ~FUTEX_TID_MASK) | vpid; |
| 768 | ownerdied = 0; | 766 | force_take = 0; |
| 769 | lock_taken = 1; | 767 | lock_taken = 1; |
| 770 | } | 768 | } |
| 771 | 769 | ||
| @@ -775,7 +773,7 @@ retry: | |||
| 775 | goto retry; | 773 | goto retry; |
| 776 | 774 | ||
| 777 | /* | 775 | /* |
| 778 | * We took the lock due to owner died take over. | 776 | * We took the lock due to forced take over. |
| 779 | */ | 777 | */ |
| 780 | if (unlikely(lock_taken)) | 778 | if (unlikely(lock_taken)) |
| 781 | return 1; | 779 | return 1; |
| @@ -790,20 +788,25 @@ retry: | |||
| 790 | switch (ret) { | 788 | switch (ret) { |
| 791 | case -ESRCH: | 789 | case -ESRCH: |
| 792 | /* | 790 | /* |
| 793 | * No owner found for this futex. Check if the | 791 | * We failed to find an owner for this |
| 794 | * OWNER_DIED bit is set to figure out whether | 792 | * futex. So we have no pi_state to block |
| 795 | * this is a robust futex or not. | 793 | * on. This can happen in two cases: |
| 794 | * | ||
| 795 | * 1) The owner died | ||
| 796 | * 2) A stale FUTEX_WAITERS bit | ||
| 797 | * | ||
| 798 | * Re-read the futex value. | ||
| 796 | */ | 799 | */ |
| 797 | if (get_futex_value_locked(&curval, uaddr)) | 800 | if (get_futex_value_locked(&curval, uaddr)) |
| 798 | return -EFAULT; | 801 | return -EFAULT; |
| 799 | 802 | ||
| 800 | /* | 803 | /* |
| 801 | * We simply start over in case of a robust | 804 | * If the owner died or we have a stale |
| 802 | * futex. The code above will take the futex | 805 | * WAITERS bit the owner TID in the user space |
| 803 | * and return happy. | 806 | * futex is 0. |
| 804 | */ | 807 | */ |
| 805 | if (curval & FUTEX_OWNER_DIED) { | 808 | if (!(curval & FUTEX_TID_MASK)) { |
| 806 | ownerdied = 1; | 809 | force_take = 1; |
| 807 | goto retry; | 810 | goto retry; |
| 808 | } | 811 | } |
| 809 | default: | 812 | default: |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index bd2e09895553..cdd48600e02a 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -12,7 +12,7 @@ extern "C" { | |||
| 12 | 12 | ||
| 13 | #include <assert.h> | 13 | #include <assert.h> |
| 14 | #include <stdio.h> | 14 | #include <stdio.h> |
| 15 | #include <sys/queue.h> | 15 | #include "list.h" |
| 16 | #ifndef __cplusplus | 16 | #ifndef __cplusplus |
| 17 | #include <stdbool.h> | 17 | #include <stdbool.h> |
| 18 | #endif | 18 | #endif |
| @@ -175,12 +175,11 @@ struct menu { | |||
| 175 | #define MENU_ROOT 0x0002 | 175 | #define MENU_ROOT 0x0002 |
| 176 | 176 | ||
| 177 | struct jump_key { | 177 | struct jump_key { |
| 178 | CIRCLEQ_ENTRY(jump_key) entries; | 178 | struct list_head entries; |
| 179 | size_t offset; | 179 | size_t offset; |
| 180 | struct menu *target; | 180 | struct menu *target; |
| 181 | int index; | 181 | int index; |
| 182 | }; | 182 | }; |
| 183 | CIRCLEQ_HEAD(jk_head, jump_key); | ||
| 184 | 183 | ||
| 185 | #define JUMP_NB 9 | 184 | #define JUMP_NB 9 |
| 186 | 185 | ||
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h new file mode 100644 index 000000000000..0ae730be5f49 --- /dev/null +++ b/scripts/kconfig/list.h | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | #ifndef LIST_H | ||
| 2 | #define LIST_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copied from include/linux/... | ||
| 6 | */ | ||
| 7 | |||
| 8 | #undef offsetof | ||
| 9 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | ||
| 10 | |||
| 11 | /** | ||
| 12 | * container_of - cast a member of a structure out to the containing structure | ||
| 13 | * @ptr: the pointer to the member. | ||
| 14 | * @type: the type of the container struct this is embedded in. | ||
| 15 | * @member: the name of the member within the struct. | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | #define container_of(ptr, type, member) ({ \ | ||
| 19 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | ||
| 20 | (type *)( (char *)__mptr - offsetof(type,member) );}) | ||
| 21 | |||
| 22 | |||
| 23 | struct list_head { | ||
| 24 | struct list_head *next, *prev; | ||
| 25 | }; | ||
| 26 | |||
| 27 | |||
| 28 | #define LIST_HEAD_INIT(name) { &(name), &(name) } | ||
| 29 | |||
| 30 | #define LIST_HEAD(name) \ | ||
| 31 | struct list_head name = LIST_HEAD_INIT(name) | ||
| 32 | |||
| 33 | /** | ||
| 34 | * list_entry - get the struct for this entry | ||
| 35 | * @ptr: the &struct list_head pointer. | ||
| 36 | * @type: the type of the struct this is embedded in. | ||
| 37 | * @member: the name of the list_struct within the struct. | ||
| 38 | */ | ||
| 39 | #define list_entry(ptr, type, member) \ | ||
| 40 | container_of(ptr, type, member) | ||
| 41 | |||
| 42 | /** | ||
| 43 | * list_for_each_entry - iterate over list of given type | ||
| 44 | * @pos: the type * to use as a loop cursor. | ||
| 45 | * @head: the head for your list. | ||
| 46 | * @member: the name of the list_struct within the struct. | ||
| 47 | */ | ||
| 48 | #define list_for_each_entry(pos, head, member) \ | ||
| 49 | for (pos = list_entry((head)->next, typeof(*pos), member); \ | ||
| 50 | &pos->member != (head); \ | ||
| 51 | pos = list_entry(pos->member.next, typeof(*pos), member)) | ||
| 52 | |||
| 53 | /** | ||
| 54 | * list_empty - tests whether a list is empty | ||
| 55 | * @head: the list to test. | ||
| 56 | */ | ||
| 57 | static inline int list_empty(const struct list_head *head) | ||
| 58 | { | ||
| 59 | return head->next == head; | ||
| 60 | } | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Insert a new entry between two known consecutive entries. | ||
| 64 | * | ||
| 65 | * This is only for internal list manipulation where we know | ||
| 66 | * the prev/next entries already! | ||
| 67 | */ | ||
| 68 | static inline void __list_add(struct list_head *_new, | ||
| 69 | struct list_head *prev, | ||
| 70 | struct list_head *next) | ||
| 71 | { | ||
| 72 | next->prev = _new; | ||
| 73 | _new->next = next; | ||
| 74 | _new->prev = prev; | ||
| 75 | prev->next = _new; | ||
| 76 | } | ||
| 77 | |||
| 78 | /** | ||
| 79 | * list_add_tail - add a new entry | ||
| 80 | * @new: new entry to be added | ||
| 81 | * @head: list head to add it before | ||
| 82 | * | ||
| 83 | * Insert a new entry before the specified head. | ||
| 84 | * This is useful for implementing queues. | ||
| 85 | */ | ||
| 86 | static inline void list_add_tail(struct list_head *_new, struct list_head *head) | ||
| 87 | { | ||
| 88 | __list_add(_new, head->prev, head); | ||
| 89 | } | ||
| 90 | |||
| 91 | #endif | ||
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 1d1c08537f1e..ef1a7381f956 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
| @@ -21,9 +21,9 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu)); | |||
| 21 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); | 21 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); |
| 22 | P(menu_has_help,bool,(struct menu *menu)); | 22 | P(menu_has_help,bool,(struct menu *menu)); |
| 23 | P(menu_get_help,const char *,(struct menu *menu)); | 23 | P(menu_get_help,const char *,(struct menu *menu)); |
| 24 | P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head | 24 | P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head |
| 25 | *head)); | 25 | *head)); |
| 26 | P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head | 26 | P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head |
| 27 | *head)); | 27 | *head)); |
| 28 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); | 28 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); |
| 29 | 29 | ||
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 48f67448af7b..53975cf87608 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -312,7 +312,7 @@ static void set_config_filename(const char *config_filename) | |||
| 312 | 312 | ||
| 313 | 313 | ||
| 314 | struct search_data { | 314 | struct search_data { |
| 315 | struct jk_head *head; | 315 | struct list_head *head; |
| 316 | struct menu **targets; | 316 | struct menu **targets; |
| 317 | int *keys; | 317 | int *keys; |
| 318 | }; | 318 | }; |
| @@ -323,7 +323,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data) | |||
| 323 | struct jump_key *pos; | 323 | struct jump_key *pos; |
| 324 | int k = 0; | 324 | int k = 0; |
| 325 | 325 | ||
| 326 | CIRCLEQ_FOREACH(pos, data->head, entries) { | 326 | list_for_each_entry(pos, data->head, entries) { |
| 327 | if (pos->offset >= start && pos->offset < end) { | 327 | if (pos->offset >= start && pos->offset < end) { |
| 328 | char header[4]; | 328 | char header[4]; |
| 329 | 329 | ||
| @@ -375,7 +375,7 @@ again: | |||
| 375 | 375 | ||
| 376 | sym_arr = sym_re_search(dialog_input); | 376 | sym_arr = sym_re_search(dialog_input); |
| 377 | do { | 377 | do { |
| 378 | struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head); | 378 | LIST_HEAD(head); |
| 379 | struct menu *targets[JUMP_NB]; | 379 | struct menu *targets[JUMP_NB]; |
| 380 | int keys[JUMP_NB + 1], i; | 380 | int keys[JUMP_NB + 1], i; |
| 381 | struct search_data data = { | 381 | struct search_data data = { |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index a3cade659f89..e98a05c8e508 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
| @@ -508,7 +508,7 @@ const char *menu_get_help(struct menu *menu) | |||
| 508 | } | 508 | } |
| 509 | 509 | ||
| 510 | static void get_prompt_str(struct gstr *r, struct property *prop, | 510 | static void get_prompt_str(struct gstr *r, struct property *prop, |
| 511 | struct jk_head *head) | 511 | struct list_head *head) |
| 512 | { | 512 | { |
| 513 | int i, j; | 513 | int i, j; |
| 514 | struct menu *submenu[8], *menu, *location = NULL; | 514 | struct menu *submenu[8], *menu, *location = NULL; |
| @@ -544,12 +544,13 @@ static void get_prompt_str(struct gstr *r, struct property *prop, | |||
| 544 | } else | 544 | } else |
| 545 | jump->target = location; | 545 | jump->target = location; |
| 546 | 546 | ||
| 547 | if (CIRCLEQ_EMPTY(head)) | 547 | if (list_empty(head)) |
| 548 | jump->index = 0; | 548 | jump->index = 0; |
| 549 | else | 549 | else |
| 550 | jump->index = CIRCLEQ_LAST(head)->index + 1; | 550 | jump->index = list_entry(head->prev, struct jump_key, |
| 551 | entries)->index + 1; | ||
| 551 | 552 | ||
| 552 | CIRCLEQ_INSERT_TAIL(head, jump, entries); | 553 | list_add_tail(&jump->entries, head); |
| 553 | } | 554 | } |
| 554 | 555 | ||
| 555 | if (i > 0) { | 556 | if (i > 0) { |
| @@ -573,7 +574,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop, | |||
| 573 | /* | 574 | /* |
| 574 | * head is optional and may be NULL | 575 | * head is optional and may be NULL |
| 575 | */ | 576 | */ |
| 576 | void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head) | 577 | void get_symbol_str(struct gstr *r, struct symbol *sym, |
| 578 | struct list_head *head) | ||
| 577 | { | 579 | { |
| 578 | bool hit; | 580 | bool hit; |
| 579 | struct property *prop; | 581 | struct property *prop; |
| @@ -612,7 +614,7 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head) | |||
| 612 | str_append(r, "\n\n"); | 614 | str_append(r, "\n\n"); |
| 613 | } | 615 | } |
| 614 | 616 | ||
| 615 | struct gstr get_relations_str(struct symbol **sym_arr, struct jk_head *head) | 617 | struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head) |
| 616 | { | 618 | { |
| 617 | struct symbol *sym; | 619 | struct symbol *sym; |
| 618 | struct gstr res = str_new(); | 620 | struct gstr res = str_new(); |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 842c254396db..b08d20c66c2e 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
| @@ -164,8 +164,8 @@ static void dev_exception_clean(struct dev_cgroup *dev_cgroup) | |||
| 164 | struct dev_exception_item *ex, *tmp; | 164 | struct dev_exception_item *ex, *tmp; |
| 165 | 165 | ||
| 166 | list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { | 166 | list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { |
| 167 | list_del(&ex->list); | 167 | list_del_rcu(&ex->list); |
| 168 | kfree(ex); | 168 | kfree_rcu(ex, rcu); |
| 169 | } | 169 | } |
| 170 | } | 170 | } |
| 171 | 171 | ||
| @@ -298,7 +298,7 @@ static int may_access(struct dev_cgroup *dev_cgroup, | |||
| 298 | struct dev_exception_item *ex; | 298 | struct dev_exception_item *ex; |
| 299 | bool match = false; | 299 | bool match = false; |
| 300 | 300 | ||
| 301 | list_for_each_entry(ex, &dev_cgroup->exceptions, list) { | 301 | list_for_each_entry_rcu(ex, &dev_cgroup->exceptions, list) { |
| 302 | if ((refex->type & DEV_BLOCK) && !(ex->type & DEV_BLOCK)) | 302 | if ((refex->type & DEV_BLOCK) && !(ex->type & DEV_BLOCK)) |
| 303 | continue; | 303 | continue; |
| 304 | if ((refex->type & DEV_CHAR) && !(ex->type & DEV_CHAR)) | 304 | if ((refex->type & DEV_CHAR) && !(ex->type & DEV_CHAR)) |
| @@ -352,6 +352,8 @@ static int parent_has_perm(struct dev_cgroup *childcg, | |||
| 352 | */ | 352 | */ |
| 353 | static inline int may_allow_all(struct dev_cgroup *parent) | 353 | static inline int may_allow_all(struct dev_cgroup *parent) |
| 354 | { | 354 | { |
| 355 | if (!parent) | ||
| 356 | return 1; | ||
| 355 | return parent->behavior == DEVCG_DEFAULT_ALLOW; | 357 | return parent->behavior == DEVCG_DEFAULT_ALLOW; |
| 356 | } | 358 | } |
| 357 | 359 | ||
| @@ -376,11 +378,14 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup, | |||
| 376 | int count, rc; | 378 | int count, rc; |
| 377 | struct dev_exception_item ex; | 379 | struct dev_exception_item ex; |
| 378 | struct cgroup *p = devcgroup->css.cgroup; | 380 | struct cgroup *p = devcgroup->css.cgroup; |
| 379 | struct dev_cgroup *parent = cgroup_to_devcgroup(p->parent); | 381 | struct dev_cgroup *parent = NULL; |
| 380 | 382 | ||
| 381 | if (!capable(CAP_SYS_ADMIN)) | 383 | if (!capable(CAP_SYS_ADMIN)) |
| 382 | return -EPERM; | 384 | return -EPERM; |
| 383 | 385 | ||
| 386 | if (p->parent) | ||
| 387 | parent = cgroup_to_devcgroup(p->parent); | ||
| 388 | |||
| 384 | memset(&ex, 0, sizeof(ex)); | 389 | memset(&ex, 0, sizeof(ex)); |
| 385 | b = buffer; | 390 | b = buffer; |
| 386 | 391 | ||
| @@ -391,11 +396,14 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup, | |||
| 391 | if (!may_allow_all(parent)) | 396 | if (!may_allow_all(parent)) |
| 392 | return -EPERM; | 397 | return -EPERM; |
| 393 | dev_exception_clean(devcgroup); | 398 | dev_exception_clean(devcgroup); |
| 399 | devcgroup->behavior = DEVCG_DEFAULT_ALLOW; | ||
| 400 | if (!parent) | ||
| 401 | break; | ||
| 402 | |||
| 394 | rc = dev_exceptions_copy(&devcgroup->exceptions, | 403 | rc = dev_exceptions_copy(&devcgroup->exceptions, |
| 395 | &parent->exceptions); | 404 | &parent->exceptions); |
| 396 | if (rc) | 405 | if (rc) |
| 397 | return rc; | 406 | return rc; |
| 398 | devcgroup->behavior = DEVCG_DEFAULT_ALLOW; | ||
| 399 | break; | 407 | break; |
| 400 | case DEVCG_DENY: | 408 | case DEVCG_DENY: |
| 401 | dev_exception_clean(devcgroup); | 409 | dev_exception_clean(devcgroup); |
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 50169bcfd903..7266020c16cb 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
| @@ -2581,9 +2581,14 @@ static u8 snd_es1968_tea575x_get_pins(struct snd_tea575x *tea) | |||
| 2581 | struct es1968 *chip = tea->private_data; | 2581 | struct es1968 *chip = tea->private_data; |
| 2582 | unsigned long io = chip->io_port + GPIO_DATA; | 2582 | unsigned long io = chip->io_port + GPIO_DATA; |
| 2583 | u16 val = inw(io); | 2583 | u16 val = inw(io); |
| 2584 | 2584 | u8 ret; | |
| 2585 | return (val & STR_DATA) ? TEA575X_DATA : 0 | | 2585 | |
| 2586 | (val & STR_MOST) ? TEA575X_MOST : 0; | 2586 | ret = 0; |
| 2587 | if (val & STR_DATA) | ||
| 2588 | ret |= TEA575X_DATA; | ||
| 2589 | if (val & STR_MOST) | ||
| 2590 | ret |= TEA575X_MOST; | ||
| 2591 | return ret; | ||
| 2587 | } | 2592 | } |
| 2588 | 2593 | ||
| 2589 | static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool output) | 2594 | static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool output) |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index cc2e91d15538..c5806f89be1e 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
| @@ -767,9 +767,14 @@ static u8 snd_fm801_tea575x_get_pins(struct snd_tea575x *tea) | |||
| 767 | struct fm801 *chip = tea->private_data; | 767 | struct fm801 *chip = tea->private_data; |
| 768 | unsigned short reg = inw(FM801_REG(chip, GPIO_CTRL)); | 768 | unsigned short reg = inw(FM801_REG(chip, GPIO_CTRL)); |
| 769 | struct snd_fm801_tea575x_gpio gpio = *get_tea575x_gpio(chip); | 769 | struct snd_fm801_tea575x_gpio gpio = *get_tea575x_gpio(chip); |
| 770 | 770 | u8 ret; | |
| 771 | return (reg & FM801_GPIO_GP(gpio.data)) ? TEA575X_DATA : 0 | | 771 | |
| 772 | (reg & FM801_GPIO_GP(gpio.most)) ? TEA575X_MOST : 0; | 772 | ret = 0; |
| 773 | if (reg & FM801_GPIO_GP(gpio.data)) | ||
| 774 | ret |= TEA575X_DATA; | ||
| 775 | if (reg & FM801_GPIO_GP(gpio.most)) | ||
| 776 | ret |= TEA575X_MOST; | ||
| 777 | return ret; | ||
| 773 | } | 778 | } |
| 774 | 779 | ||
| 775 | static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output) | 780 | static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output) |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c0ce3b1f04b4..68fd49294b26 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -5407,6 +5407,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
| 5407 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | 5407 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 5408 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | 5408 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
| 5409 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), | 5409 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), |
| 5410 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), | ||
| 5410 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), | 5411 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 5411 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | 5412 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), |
| 5412 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), | 5413 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), |
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 4d8db3685e96..97a81051e88d 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c | |||
| @@ -773,7 +773,6 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
| 773 | { | 773 | { |
| 774 | struct snd_soc_codec *codec = codec_dai->codec; | 774 | struct snd_soc_codec *codec = codec_dai->codec; |
| 775 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); | 775 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); |
| 776 | int ret = 0; | ||
| 777 | u8 iface = 0; | 776 | u8 iface = 0; |
| 778 | 777 | ||
| 779 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 778 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
| @@ -822,7 +821,7 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
| 822 | case SND_SOC_DAIFMT_NB_IF: | 821 | case SND_SOC_DAIFMT_NB_IF: |
| 823 | break; | 822 | break; |
| 824 | default: | 823 | default: |
| 825 | ret = -EINVAL; | 824 | return -EINVAL; |
| 826 | } | 825 | } |
| 827 | cs42l52->config.format = iface; | 826 | cs42l52->config.format = iface; |
| 828 | snd_soc_write(codec, CS42L52_IFACE_CTL1, cs42l52->config.format); | 827 | snd_soc_write(codec, CS42L52_IFACE_CTL1, cs42l52->config.format); |
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 1722b586bdba..7394e73fa43c 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
| @@ -42,6 +42,556 @@ static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); | |||
| 42 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); | 42 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); |
| 43 | static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); | 43 | static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); |
| 44 | 44 | ||
| 45 | static const struct reg_default wm5102_sysclk_reva_patch[] = { | ||
| 46 | { 0x3000, 0x2225 }, | ||
| 47 | { 0x3001, 0x3a03 }, | ||
| 48 | { 0x3002, 0x0225 }, | ||
| 49 | { 0x3003, 0x0801 }, | ||
| 50 | { 0x3004, 0x6249 }, | ||
| 51 | { 0x3005, 0x0c04 }, | ||
| 52 | { 0x3006, 0x0225 }, | ||
| 53 | { 0x3007, 0x5901 }, | ||
| 54 | { 0x3008, 0xe249 }, | ||
| 55 | { 0x3009, 0x030d }, | ||
| 56 | { 0x300a, 0x0249 }, | ||
| 57 | { 0x300b, 0x2c01 }, | ||
| 58 | { 0x300c, 0xe249 }, | ||
| 59 | { 0x300d, 0x4342 }, | ||
| 60 | { 0x300e, 0xe249 }, | ||
| 61 | { 0x300f, 0x73c0 }, | ||
| 62 | { 0x3010, 0x4249 }, | ||
| 63 | { 0x3011, 0x0c00 }, | ||
| 64 | { 0x3012, 0x0225 }, | ||
| 65 | { 0x3013, 0x1f01 }, | ||
| 66 | { 0x3014, 0x0225 }, | ||
| 67 | { 0x3015, 0x1e01 }, | ||
| 68 | { 0x3016, 0x0225 }, | ||
| 69 | { 0x3017, 0xfa00 }, | ||
| 70 | { 0x3018, 0x0000 }, | ||
| 71 | { 0x3019, 0xf000 }, | ||
| 72 | { 0x301a, 0x0000 }, | ||
| 73 | { 0x301b, 0xf000 }, | ||
| 74 | { 0x301c, 0x0000 }, | ||
| 75 | { 0x301d, 0xf000 }, | ||
| 76 | { 0x301e, 0x0000 }, | ||
| 77 | { 0x301f, 0xf000 }, | ||
| 78 | { 0x3020, 0x0000 }, | ||
| 79 | { 0x3021, 0xf000 }, | ||
| 80 | { 0x3022, 0x0000 }, | ||
| 81 | { 0x3023, 0xf000 }, | ||
| 82 | { 0x3024, 0x0000 }, | ||
| 83 | { 0x3025, 0xf000 }, | ||
| 84 | { 0x3026, 0x0000 }, | ||
| 85 | { 0x3027, 0xf000 }, | ||
| 86 | { 0x3028, 0x0000 }, | ||
| 87 | { 0x3029, 0xf000 }, | ||
| 88 | { 0x302a, 0x0000 }, | ||
| 89 | { 0x302b, 0xf000 }, | ||
| 90 | { 0x302c, 0x0000 }, | ||
| 91 | { 0x302d, 0xf000 }, | ||
| 92 | { 0x302e, 0x0000 }, | ||
| 93 | { 0x302f, 0xf000 }, | ||
| 94 | { 0x3030, 0x0225 }, | ||
| 95 | { 0x3031, 0x1a01 }, | ||
| 96 | { 0x3032, 0x0225 }, | ||
| 97 | { 0x3033, 0x1e00 }, | ||
| 98 | { 0x3034, 0x0225 }, | ||
| 99 | { 0x3035, 0x1f00 }, | ||
| 100 | { 0x3036, 0x6225 }, | ||
| 101 | { 0x3037, 0xf800 }, | ||
| 102 | { 0x3038, 0x0000 }, | ||
| 103 | { 0x3039, 0xf000 }, | ||
| 104 | { 0x303a, 0x0000 }, | ||
| 105 | { 0x303b, 0xf000 }, | ||
| 106 | { 0x303c, 0x0000 }, | ||
| 107 | { 0x303d, 0xf000 }, | ||
| 108 | { 0x303e, 0x0000 }, | ||
| 109 | { 0x303f, 0xf000 }, | ||
| 110 | { 0x3040, 0x2226 }, | ||
| 111 | { 0x3041, 0x3a03 }, | ||
| 112 | { 0x3042, 0x0226 }, | ||
| 113 | { 0x3043, 0x0801 }, | ||
| 114 | { 0x3044, 0x6249 }, | ||
| 115 | { 0x3045, 0x0c06 }, | ||
| 116 | { 0x3046, 0x0226 }, | ||
| 117 | { 0x3047, 0x5901 }, | ||
| 118 | { 0x3048, 0xe249 }, | ||
| 119 | { 0x3049, 0x030d }, | ||
| 120 | { 0x304a, 0x0249 }, | ||
| 121 | { 0x304b, 0x2c01 }, | ||
| 122 | { 0x304c, 0xe249 }, | ||
| 123 | { 0x304d, 0x4342 }, | ||
| 124 | { 0x304e, 0xe249 }, | ||
| 125 | { 0x304f, 0x73c0 }, | ||
| 126 | { 0x3050, 0x4249 }, | ||
| 127 | { 0x3051, 0x0c00 }, | ||
| 128 | { 0x3052, 0x0226 }, | ||
| 129 | { 0x3053, 0x1f01 }, | ||
| 130 | { 0x3054, 0x0226 }, | ||
| 131 | { 0x3055, 0x1e01 }, | ||
| 132 | { 0x3056, 0x0226 }, | ||
| 133 | { 0x3057, 0xfa00 }, | ||
| 134 | { 0x3058, 0x0000 }, | ||
| 135 | { 0x3059, 0xf000 }, | ||
| 136 | { 0x305a, 0x0000 }, | ||
| 137 | { 0x305b, 0xf000 }, | ||
| 138 | { 0x305c, 0x0000 }, | ||
| 139 | { 0x305d, 0xf000 }, | ||
| 140 | { 0x305e, 0x0000 }, | ||
| 141 | { 0x305f, 0xf000 }, | ||
| 142 | { 0x3060, 0x0000 }, | ||
| 143 | { 0x3061, 0xf000 }, | ||
| 144 | { 0x3062, 0x0000 }, | ||
| 145 | { 0x3063, 0xf000 }, | ||
| 146 | { 0x3064, 0x0000 }, | ||
| 147 | { 0x3065, 0xf000 }, | ||
| 148 | { 0x3066, 0x0000 }, | ||
| 149 | { 0x3067, 0xf000 }, | ||
| 150 | { 0x3068, 0x0000 }, | ||
| 151 | { 0x3069, 0xf000 }, | ||
| 152 | { 0x306a, 0x0000 }, | ||
| 153 | { 0x306b, 0xf000 }, | ||
| 154 | { 0x306c, 0x0000 }, | ||
| 155 | { 0x306d, 0xf000 }, | ||
| 156 | { 0x306e, 0x0000 }, | ||
| 157 | { 0x306f, 0xf000 }, | ||
| 158 | { 0x3070, 0x0226 }, | ||
| 159 | { 0x3071, 0x1a01 }, | ||
| 160 | { 0x3072, 0x0226 }, | ||
| 161 | { 0x3073, 0x1e00 }, | ||
| 162 | { 0x3074, 0x0226 }, | ||
| 163 | { 0x3075, 0x1f00 }, | ||
| 164 | { 0x3076, 0x6226 }, | ||
| 165 | { 0x3077, 0xf800 }, | ||
| 166 | { 0x3078, 0x0000 }, | ||
| 167 | { 0x3079, 0xf000 }, | ||
| 168 | { 0x307a, 0x0000 }, | ||
| 169 | { 0x307b, 0xf000 }, | ||
| 170 | { 0x307c, 0x0000 }, | ||
| 171 | { 0x307d, 0xf000 }, | ||
| 172 | { 0x307e, 0x0000 }, | ||
| 173 | { 0x307f, 0xf000 }, | ||
| 174 | { 0x3080, 0x2227 }, | ||
| 175 | { 0x3081, 0x3a03 }, | ||
| 176 | { 0x3082, 0x0227 }, | ||
| 177 | { 0x3083, 0x0801 }, | ||
| 178 | { 0x3084, 0x6255 }, | ||
| 179 | { 0x3085, 0x0c04 }, | ||
| 180 | { 0x3086, 0x0227 }, | ||
| 181 | { 0x3087, 0x5901 }, | ||
| 182 | { 0x3088, 0xe255 }, | ||
| 183 | { 0x3089, 0x030d }, | ||
| 184 | { 0x308a, 0x0255 }, | ||
| 185 | { 0x308b, 0x2c01 }, | ||
| 186 | { 0x308c, 0xe255 }, | ||
| 187 | { 0x308d, 0x4342 }, | ||
| 188 | { 0x308e, 0xe255 }, | ||
| 189 | { 0x308f, 0x73c0 }, | ||
| 190 | { 0x3090, 0x4255 }, | ||
| 191 | { 0x3091, 0x0c00 }, | ||
| 192 | { 0x3092, 0x0227 }, | ||
| 193 | { 0x3093, 0x1f01 }, | ||
| 194 | { 0x3094, 0x0227 }, | ||
| 195 | { 0x3095, 0x1e01 }, | ||
| 196 | { 0x3096, 0x0227 }, | ||
| 197 | { 0x3097, 0xfa00 }, | ||
| 198 | { 0x3098, 0x0000 }, | ||
| 199 | { 0x3099, 0xf000 }, | ||
| 200 | { 0x309a, 0x0000 }, | ||
| 201 | { 0x309b, 0xf000 }, | ||
| 202 | { 0x309c, 0x0000 }, | ||
| 203 | { 0x309d, 0xf000 }, | ||
| 204 | { 0x309e, 0x0000 }, | ||
| 205 | { 0x309f, 0xf000 }, | ||
| 206 | { 0x30a0, 0x0000 }, | ||
| 207 | { 0x30a1, 0xf000 }, | ||
| 208 | { 0x30a2, 0x0000 }, | ||
| 209 | { 0x30a3, 0xf000 }, | ||
| 210 | { 0x30a4, 0x0000 }, | ||
| 211 | { 0x30a5, 0xf000 }, | ||
| 212 | { 0x30a6, 0x0000 }, | ||
| 213 | { 0x30a7, 0xf000 }, | ||
| 214 | { 0x30a8, 0x0000 }, | ||
| 215 | { 0x30a9, 0xf000 }, | ||
| 216 | { 0x30aa, 0x0000 }, | ||
| 217 | { 0x30ab, 0xf000 }, | ||
| 218 | { 0x30ac, 0x0000 }, | ||
| 219 | { 0x30ad, 0xf000 }, | ||
| 220 | { 0x30ae, 0x0000 }, | ||
| 221 | { 0x30af, 0xf000 }, | ||
| 222 | { 0x30b0, 0x0227 }, | ||
| 223 | { 0x30b1, 0x1a01 }, | ||
| 224 | { 0x30b2, 0x0227 }, | ||
| 225 | { 0x30b3, 0x1e00 }, | ||
| 226 | { 0x30b4, 0x0227 }, | ||
| 227 | { 0x30b5, 0x1f00 }, | ||
| 228 | { 0x30b6, 0x6227 }, | ||
| 229 | { 0x30b7, 0xf800 }, | ||
| 230 | { 0x30b8, 0x0000 }, | ||
| 231 | { 0x30b9, 0xf000 }, | ||
| 232 | { 0x30ba, 0x0000 }, | ||
| 233 | { 0x30bb, 0xf000 }, | ||
| 234 | { 0x30bc, 0x0000 }, | ||
| 235 | { 0x30bd, 0xf000 }, | ||
| 236 | { 0x30be, 0x0000 }, | ||
| 237 | { 0x30bf, 0xf000 }, | ||
| 238 | { 0x30c0, 0x2228 }, | ||
| 239 | { 0x30c1, 0x3a03 }, | ||
| 240 | { 0x30c2, 0x0228 }, | ||
| 241 | { 0x30c3, 0x0801 }, | ||
| 242 | { 0x30c4, 0x6255 }, | ||
| 243 | { 0x30c5, 0x0c06 }, | ||
| 244 | { 0x30c6, 0x0228 }, | ||
| 245 | { 0x30c7, 0x5901 }, | ||
| 246 | { 0x30c8, 0xe255 }, | ||
| 247 | { 0x30c9, 0x030d }, | ||
| 248 | { 0x30ca, 0x0255 }, | ||
| 249 | { 0x30cb, 0x2c01 }, | ||
| 250 | { 0x30cc, 0xe255 }, | ||
| 251 | { 0x30cd, 0x4342 }, | ||
| 252 | { 0x30ce, 0xe255 }, | ||
| 253 | { 0x30cf, 0x73c0 }, | ||
| 254 | { 0x30d0, 0x4255 }, | ||
| 255 | { 0x30d1, 0x0c00 }, | ||
| 256 | { 0x30d2, 0x0228 }, | ||
| 257 | { 0x30d3, 0x1f01 }, | ||
| 258 | { 0x30d4, 0x0228 }, | ||
| 259 | { 0x30d5, 0x1e01 }, | ||
| 260 | { 0x30d6, 0x0228 }, | ||
| 261 | { 0x30d7, 0xfa00 }, | ||
| 262 | { 0x30d8, 0x0000 }, | ||
| 263 | { 0x30d9, 0xf000 }, | ||
| 264 | { 0x30da, 0x0000 }, | ||
| 265 | { 0x30db, 0xf000 }, | ||
| 266 | { 0x30dc, 0x0000 }, | ||
| 267 | { 0x30dd, 0xf000 }, | ||
| 268 | { 0x30de, 0x0000 }, | ||
| 269 | { 0x30df, 0xf000 }, | ||
| 270 | { 0x30e0, 0x0000 }, | ||
| 271 | { 0x30e1, 0xf000 }, | ||
| 272 | { 0x30e2, 0x0000 }, | ||
| 273 | { 0x30e3, 0xf000 }, | ||
| 274 | { 0x30e4, 0x0000 }, | ||
| 275 | { 0x30e5, 0xf000 }, | ||
| 276 | { 0x30e6, 0x0000 }, | ||
| 277 | { 0x30e7, 0xf000 }, | ||
| 278 | { 0x30e8, 0x0000 }, | ||
| 279 | { 0x30e9, 0xf000 }, | ||
| 280 | { 0x30ea, 0x0000 }, | ||
| 281 | { 0x30eb, 0xf000 }, | ||
| 282 | { 0x30ec, 0x0000 }, | ||
| 283 | { 0x30ed, 0xf000 }, | ||
| 284 | { 0x30ee, 0x0000 }, | ||
| 285 | { 0x30ef, 0xf000 }, | ||
| 286 | { 0x30f0, 0x0228 }, | ||
| 287 | { 0x30f1, 0x1a01 }, | ||
| 288 | { 0x30f2, 0x0228 }, | ||
| 289 | { 0x30f3, 0x1e00 }, | ||
| 290 | { 0x30f4, 0x0228 }, | ||
| 291 | { 0x30f5, 0x1f00 }, | ||
| 292 | { 0x30f6, 0x6228 }, | ||
| 293 | { 0x30f7, 0xf800 }, | ||
| 294 | { 0x30f8, 0x0000 }, | ||
| 295 | { 0x30f9, 0xf000 }, | ||
| 296 | { 0x30fa, 0x0000 }, | ||
| 297 | { 0x30fb, 0xf000 }, | ||
| 298 | { 0x30fc, 0x0000 }, | ||
| 299 | { 0x30fd, 0xf000 }, | ||
| 300 | { 0x30fe, 0x0000 }, | ||
| 301 | { 0x30ff, 0xf000 }, | ||
| 302 | { 0x3100, 0x222b }, | ||
| 303 | { 0x3101, 0x3a03 }, | ||
| 304 | { 0x3102, 0x222b }, | ||
| 305 | { 0x3103, 0x5803 }, | ||
| 306 | { 0x3104, 0xe26f }, | ||
| 307 | { 0x3105, 0x030d }, | ||
| 308 | { 0x3106, 0x626f }, | ||
| 309 | { 0x3107, 0x2c01 }, | ||
| 310 | { 0x3108, 0xe26f }, | ||
| 311 | { 0x3109, 0x4342 }, | ||
| 312 | { 0x310a, 0xe26f }, | ||
| 313 | { 0x310b, 0x73c0 }, | ||
| 314 | { 0x310c, 0x026f }, | ||
| 315 | { 0x310d, 0x0c00 }, | ||
| 316 | { 0x310e, 0x022b }, | ||
| 317 | { 0x310f, 0x1f01 }, | ||
| 318 | { 0x3110, 0x022b }, | ||
| 319 | { 0x3111, 0x1e01 }, | ||
| 320 | { 0x3112, 0x022b }, | ||
| 321 | { 0x3113, 0xfa00 }, | ||
| 322 | { 0x3114, 0x0000 }, | ||
| 323 | { 0x3115, 0xf000 }, | ||
| 324 | { 0x3116, 0x0000 }, | ||
| 325 | { 0x3117, 0xf000 }, | ||
| 326 | { 0x3118, 0x0000 }, | ||
| 327 | { 0x3119, 0xf000 }, | ||
| 328 | { 0x311a, 0x0000 }, | ||
| 329 | { 0x311b, 0xf000 }, | ||
| 330 | { 0x311c, 0x0000 }, | ||
| 331 | { 0x311d, 0xf000 }, | ||
| 332 | { 0x311e, 0x0000 }, | ||
| 333 | { 0x311f, 0xf000 }, | ||
| 334 | { 0x3120, 0x022b }, | ||
| 335 | { 0x3121, 0x0a01 }, | ||
| 336 | { 0x3122, 0x022b }, | ||
| 337 | { 0x3123, 0x1e00 }, | ||
| 338 | { 0x3124, 0x022b }, | ||
| 339 | { 0x3125, 0x1f00 }, | ||
| 340 | { 0x3126, 0x622b }, | ||
| 341 | { 0x3127, 0xf800 }, | ||
| 342 | { 0x3128, 0x0000 }, | ||
| 343 | { 0x3129, 0xf000 }, | ||
| 344 | { 0x312a, 0x0000 }, | ||
| 345 | { 0x312b, 0xf000 }, | ||
| 346 | { 0x312c, 0x0000 }, | ||
| 347 | { 0x312d, 0xf000 }, | ||
| 348 | { 0x312e, 0x0000 }, | ||
| 349 | { 0x312f, 0xf000 }, | ||
| 350 | { 0x3130, 0x0000 }, | ||
| 351 | { 0x3131, 0xf000 }, | ||
| 352 | { 0x3132, 0x0000 }, | ||
| 353 | { 0x3133, 0xf000 }, | ||
| 354 | { 0x3134, 0x0000 }, | ||
| 355 | { 0x3135, 0xf000 }, | ||
| 356 | { 0x3136, 0x0000 }, | ||
| 357 | { 0x3137, 0xf000 }, | ||
| 358 | { 0x3138, 0x0000 }, | ||
| 359 | { 0x3139, 0xf000 }, | ||
| 360 | { 0x313a, 0x0000 }, | ||
| 361 | { 0x313b, 0xf000 }, | ||
| 362 | { 0x313c, 0x0000 }, | ||
| 363 | { 0x313d, 0xf000 }, | ||
| 364 | { 0x313e, 0x0000 }, | ||
| 365 | { 0x313f, 0xf000 }, | ||
| 366 | { 0x3140, 0x0000 }, | ||
| 367 | { 0x3141, 0xf000 }, | ||
| 368 | { 0x3142, 0x0000 }, | ||
| 369 | { 0x3143, 0xf000 }, | ||
| 370 | { 0x3144, 0x0000 }, | ||
| 371 | { 0x3145, 0xf000 }, | ||
| 372 | { 0x3146, 0x0000 }, | ||
| 373 | { 0x3147, 0xf000 }, | ||
| 374 | { 0x3148, 0x0000 }, | ||
| 375 | { 0x3149, 0xf000 }, | ||
| 376 | { 0x314a, 0x0000 }, | ||
| 377 | { 0x314b, 0xf000 }, | ||
| 378 | { 0x314c, 0x0000 }, | ||
| 379 | { 0x314d, 0xf000 }, | ||
| 380 | { 0x314e, 0x0000 }, | ||
| 381 | { 0x314f, 0xf000 }, | ||
| 382 | { 0x3150, 0x0000 }, | ||
| 383 | { 0x3151, 0xf000 }, | ||
| 384 | { 0x3152, 0x0000 }, | ||
| 385 | { 0x3153, 0xf000 }, | ||
| 386 | { 0x3154, 0x0000 }, | ||
| 387 | { 0x3155, 0xf000 }, | ||
| 388 | { 0x3156, 0x0000 }, | ||
| 389 | { 0x3157, 0xf000 }, | ||
| 390 | { 0x3158, 0x0000 }, | ||
| 391 | { 0x3159, 0xf000 }, | ||
| 392 | { 0x315a, 0x0000 }, | ||
| 393 | { 0x315b, 0xf000 }, | ||
| 394 | { 0x315c, 0x0000 }, | ||
| 395 | { 0x315d, 0xf000 }, | ||
| 396 | { 0x315e, 0x0000 }, | ||
| 397 | { 0x315f, 0xf000 }, | ||
| 398 | { 0x3160, 0x0000 }, | ||
| 399 | { 0x3161, 0xf000 }, | ||
| 400 | { 0x3162, 0x0000 }, | ||
| 401 | { 0x3163, 0xf000 }, | ||
| 402 | { 0x3164, 0x0000 }, | ||
| 403 | { 0x3165, 0xf000 }, | ||
| 404 | { 0x3166, 0x0000 }, | ||
| 405 | { 0x3167, 0xf000 }, | ||
| 406 | { 0x3168, 0x0000 }, | ||
| 407 | { 0x3169, 0xf000 }, | ||
| 408 | { 0x316a, 0x0000 }, | ||
| 409 | { 0x316b, 0xf000 }, | ||
| 410 | { 0x316c, 0x0000 }, | ||
| 411 | { 0x316d, 0xf000 }, | ||
| 412 | { 0x316e, 0x0000 }, | ||
| 413 | { 0x316f, 0xf000 }, | ||
| 414 | { 0x3170, 0x0000 }, | ||
| 415 | { 0x3171, 0xf000 }, | ||
| 416 | { 0x3172, 0x0000 }, | ||
| 417 | { 0x3173, 0xf000 }, | ||
| 418 | { 0x3174, 0x0000 }, | ||
| 419 | { 0x3175, 0xf000 }, | ||
| 420 | { 0x3176, 0x0000 }, | ||
| 421 | { 0x3177, 0xf000 }, | ||
| 422 | { 0x3178, 0x0000 }, | ||
| 423 | { 0x3179, 0xf000 }, | ||
| 424 | { 0x317a, 0x0000 }, | ||
| 425 | { 0x317b, 0xf000 }, | ||
| 426 | { 0x317c, 0x0000 }, | ||
| 427 | { 0x317d, 0xf000 }, | ||
| 428 | { 0x317e, 0x0000 }, | ||
| 429 | { 0x317f, 0xf000 }, | ||
| 430 | { 0x3180, 0x2001 }, | ||
| 431 | { 0x3181, 0xf101 }, | ||
| 432 | { 0x3182, 0x0000 }, | ||
| 433 | { 0x3183, 0xf000 }, | ||
| 434 | { 0x3184, 0x0000 }, | ||
| 435 | { 0x3185, 0xf000 }, | ||
| 436 | { 0x3186, 0x0000 }, | ||
| 437 | { 0x3187, 0xf000 }, | ||
| 438 | { 0x3188, 0x0000 }, | ||
| 439 | { 0x3189, 0xf000 }, | ||
| 440 | { 0x318a, 0x0000 }, | ||
| 441 | { 0x318b, 0xf000 }, | ||
| 442 | { 0x318c, 0x0000 }, | ||
| 443 | { 0x318d, 0xf000 }, | ||
| 444 | { 0x318e, 0x0000 }, | ||
| 445 | { 0x318f, 0xf000 }, | ||
| 446 | { 0x3190, 0x0000 }, | ||
| 447 | { 0x3191, 0xf000 }, | ||
| 448 | { 0x3192, 0x0000 }, | ||
| 449 | { 0x3193, 0xf000 }, | ||
| 450 | { 0x3194, 0x0000 }, | ||
| 451 | { 0x3195, 0xf000 }, | ||
| 452 | { 0x3196, 0x0000 }, | ||
| 453 | { 0x3197, 0xf000 }, | ||
| 454 | { 0x3198, 0x0000 }, | ||
| 455 | { 0x3199, 0xf000 }, | ||
| 456 | { 0x319a, 0x0000 }, | ||
| 457 | { 0x319b, 0xf000 }, | ||
| 458 | { 0x319c, 0x0000 }, | ||
| 459 | { 0x319d, 0xf000 }, | ||
| 460 | { 0x319e, 0x0000 }, | ||
| 461 | { 0x319f, 0xf000 }, | ||
| 462 | { 0x31a0, 0x0000 }, | ||
| 463 | { 0x31a1, 0xf000 }, | ||
| 464 | { 0x31a2, 0x0000 }, | ||
| 465 | { 0x31a3, 0xf000 }, | ||
| 466 | { 0x31a4, 0x0000 }, | ||
| 467 | { 0x31a5, 0xf000 }, | ||
| 468 | { 0x31a6, 0x0000 }, | ||
| 469 | { 0x31a7, 0xf000 }, | ||
| 470 | { 0x31a8, 0x0000 }, | ||
| 471 | { 0x31a9, 0xf000 }, | ||
| 472 | { 0x31aa, 0x0000 }, | ||
| 473 | { 0x31ab, 0xf000 }, | ||
| 474 | { 0x31ac, 0x0000 }, | ||
| 475 | { 0x31ad, 0xf000 }, | ||
| 476 | { 0x31ae, 0x0000 }, | ||
| 477 | { 0x31af, 0xf000 }, | ||
| 478 | { 0x31b0, 0x0000 }, | ||
| 479 | { 0x31b1, 0xf000 }, | ||
| 480 | { 0x31b2, 0x0000 }, | ||
| 481 | { 0x31b3, 0xf000 }, | ||
| 482 | { 0x31b4, 0x0000 }, | ||
| 483 | { 0x31b5, 0xf000 }, | ||
| 484 | { 0x31b6, 0x0000 }, | ||
| 485 | { 0x31b7, 0xf000 }, | ||
| 486 | { 0x31b8, 0x0000 }, | ||
| 487 | { 0x31b9, 0xf000 }, | ||
| 488 | { 0x31ba, 0x0000 }, | ||
| 489 | { 0x31bb, 0xf000 }, | ||
| 490 | { 0x31bc, 0x0000 }, | ||
| 491 | { 0x31bd, 0xf000 }, | ||
| 492 | { 0x31be, 0x0000 }, | ||
| 493 | { 0x31bf, 0xf000 }, | ||
| 494 | { 0x31c0, 0x0000 }, | ||
| 495 | { 0x31c1, 0xf000 }, | ||
| 496 | { 0x31c2, 0x0000 }, | ||
| 497 | { 0x31c3, 0xf000 }, | ||
| 498 | { 0x31c4, 0x0000 }, | ||
| 499 | { 0x31c5, 0xf000 }, | ||
| 500 | { 0x31c6, 0x0000 }, | ||
| 501 | { 0x31c7, 0xf000 }, | ||
| 502 | { 0x31c8, 0x0000 }, | ||
| 503 | { 0x31c9, 0xf000 }, | ||
| 504 | { 0x31ca, 0x0000 }, | ||
| 505 | { 0x31cb, 0xf000 }, | ||
| 506 | { 0x31cc, 0x0000 }, | ||
| 507 | { 0x31cd, 0xf000 }, | ||
| 508 | { 0x31ce, 0x0000 }, | ||
| 509 | { 0x31cf, 0xf000 }, | ||
| 510 | { 0x31d0, 0x0000 }, | ||
| 511 | { 0x31d1, 0xf000 }, | ||
| 512 | { 0x31d2, 0x0000 }, | ||
| 513 | { 0x31d3, 0xf000 }, | ||
| 514 | { 0x31d4, 0x0000 }, | ||
| 515 | { 0x31d5, 0xf000 }, | ||
| 516 | { 0x31d6, 0x0000 }, | ||
| 517 | { 0x31d7, 0xf000 }, | ||
| 518 | { 0x31d8, 0x0000 }, | ||
| 519 | { 0x31d9, 0xf000 }, | ||
| 520 | { 0x31da, 0x0000 }, | ||
| 521 | { 0x31db, 0xf000 }, | ||
| 522 | { 0x31dc, 0x0000 }, | ||
| 523 | { 0x31dd, 0xf000 }, | ||
| 524 | { 0x31de, 0x0000 }, | ||
| 525 | { 0x31df, 0xf000 }, | ||
| 526 | { 0x31e0, 0x0000 }, | ||
| 527 | { 0x31e1, 0xf000 }, | ||
| 528 | { 0x31e2, 0x0000 }, | ||
| 529 | { 0x31e3, 0xf000 }, | ||
| 530 | { 0x31e4, 0x0000 }, | ||
| 531 | { 0x31e5, 0xf000 }, | ||
| 532 | { 0x31e6, 0x0000 }, | ||
| 533 | { 0x31e7, 0xf000 }, | ||
| 534 | { 0x31e8, 0x0000 }, | ||
| 535 | { 0x31e9, 0xf000 }, | ||
| 536 | { 0x31ea, 0x0000 }, | ||
| 537 | { 0x31eb, 0xf000 }, | ||
| 538 | { 0x31ec, 0x0000 }, | ||
| 539 | { 0x31ed, 0xf000 }, | ||
| 540 | { 0x31ee, 0x0000 }, | ||
| 541 | { 0x31ef, 0xf000 }, | ||
| 542 | { 0x31f0, 0x0000 }, | ||
| 543 | { 0x31f1, 0xf000 }, | ||
| 544 | { 0x31f2, 0x0000 }, | ||
| 545 | { 0x31f3, 0xf000 }, | ||
| 546 | { 0x31f4, 0x0000 }, | ||
| 547 | { 0x31f5, 0xf000 }, | ||
| 548 | { 0x31f6, 0x0000 }, | ||
| 549 | { 0x31f7, 0xf000 }, | ||
| 550 | { 0x31f8, 0x0000 }, | ||
| 551 | { 0x31f9, 0xf000 }, | ||
| 552 | { 0x31fa, 0x0000 }, | ||
| 553 | { 0x31fb, 0xf000 }, | ||
| 554 | { 0x31fc, 0x0000 }, | ||
| 555 | { 0x31fd, 0xf000 }, | ||
| 556 | { 0x31fe, 0x0000 }, | ||
| 557 | { 0x31ff, 0xf000 }, | ||
| 558 | { 0x024d, 0xff50 }, | ||
| 559 | { 0x0252, 0xff50 }, | ||
| 560 | { 0x0259, 0x0112 }, | ||
| 561 | { 0x025e, 0x0112 }, | ||
| 562 | }; | ||
| 563 | |||
| 564 | static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, | ||
| 565 | struct snd_kcontrol *kcontrol, int event) | ||
| 566 | { | ||
| 567 | struct snd_soc_codec *codec = w->codec; | ||
| 568 | struct arizona *arizona = dev_get_drvdata(codec->dev); | ||
| 569 | struct regmap *regmap = codec->control_data; | ||
| 570 | const struct reg_default *patch = NULL; | ||
| 571 | int i, patch_size; | ||
| 572 | |||
| 573 | switch (arizona->rev) { | ||
| 574 | case 0: | ||
| 575 | patch = wm5102_sysclk_reva_patch; | ||
| 576 | patch_size = ARRAY_SIZE(wm5102_sysclk_reva_patch); | ||
| 577 | break; | ||
| 578 | } | ||
| 579 | |||
| 580 | switch (event) { | ||
| 581 | case SND_SOC_DAPM_POST_PMU: | ||
| 582 | if (patch) | ||
| 583 | for (i = 0; i < patch_size; i++) | ||
| 584 | regmap_write(regmap, patch[i].reg, | ||
| 585 | patch[i].def); | ||
| 586 | break; | ||
| 587 | |||
| 588 | default: | ||
| 589 | break; | ||
| 590 | } | ||
| 591 | |||
| 592 | return 0; | ||
| 593 | } | ||
| 594 | |||
| 45 | static const struct snd_kcontrol_new wm5102_snd_controls[] = { | 595 | static const struct snd_kcontrol_new wm5102_snd_controls[] = { |
| 46 | SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL, | 596 | SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL, |
| 47 | ARIZONA_IN1_OSR_SHIFT, 1, 0), | 597 | ARIZONA_IN1_OSR_SHIFT, 1, 0), |
| @@ -297,7 +847,7 @@ static const struct snd_kcontrol_new wm5102_aec_loopback_mux = | |||
| 297 | 847 | ||
| 298 | static const struct snd_soc_dapm_widget wm5102_dapm_widgets[] = { | 848 | static const struct snd_soc_dapm_widget wm5102_dapm_widgets[] = { |
| 299 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, | 849 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, |
| 300 | 0, NULL, 0), | 850 | 0, wm5102_sysclk_ev, SND_SOC_DAPM_POST_PMU), |
| 301 | SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1, | 851 | SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1, |
| 302 | ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0), | 852 | ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0), |
| 303 | SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK, | 853 | SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK, |
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 5421fd9fbcb5..4c0a8e496131 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c | |||
| @@ -782,7 +782,7 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream, | |||
| 782 | wm8978->mclk_idx = -1; | 782 | wm8978->mclk_idx = -1; |
| 783 | f_sel = wm8978->f_mclk; | 783 | f_sel = wm8978->f_mclk; |
| 784 | } else { | 784 | } else { |
| 785 | if (!wm8978->f_pllout) { | 785 | if (!wm8978->f_opclk) { |
| 786 | /* We only enter here, if OPCLK is not used */ | 786 | /* We only enter here, if OPCLK is not used */ |
| 787 | int ret = wm8978_configure_pll(codec); | 787 | int ret = wm8978_configure_pll(codec); |
| 788 | if (ret < 0) | 788 | if (ret < 0) |
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index aa037b292f3d..c294fbb523fc 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
| @@ -523,16 +523,24 @@ static int mxs_saif_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 523 | 523 | ||
| 524 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 524 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
| 525 | /* | 525 | /* |
| 526 | * write a data to saif data register to trigger | 526 | * write data to saif data register to trigger |
| 527 | * the transfer | 527 | * the transfer. |
| 528 | * For 24-bit format the 32-bit FIFO register stores | ||
| 529 | * only one channel, so we need to write twice. | ||
| 530 | * This is also safe for the other non 24-bit formats. | ||
| 528 | */ | 531 | */ |
| 529 | __raw_writel(0, saif->base + SAIF_DATA); | 532 | __raw_writel(0, saif->base + SAIF_DATA); |
| 533 | __raw_writel(0, saif->base + SAIF_DATA); | ||
| 530 | } else { | 534 | } else { |
| 531 | /* | 535 | /* |
| 532 | * read a data from saif data register to trigger | 536 | * read data from saif data register to trigger |
| 533 | * the receive | 537 | * the receive. |
| 538 | * For 24-bit format the 32-bit FIFO register stores | ||
| 539 | * only one channel, so we need to read twice. | ||
| 540 | * This is also safe for the other non 24-bit formats. | ||
| 534 | */ | 541 | */ |
| 535 | __raw_readl(saif->base + SAIF_DATA); | 542 | __raw_readl(saif->base + SAIF_DATA); |
| 543 | __raw_readl(saif->base + SAIF_DATA); | ||
| 536 | } | 544 | } |
| 537 | 545 | ||
| 538 | master_saif->ongoing = 1; | 546 | master_saif->ongoing = 1; |
| @@ -812,3 +820,4 @@ module_platform_driver(mxs_saif_driver); | |||
| 812 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); | 820 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); |
| 813 | MODULE_DESCRIPTION("MXS ASoC SAIF driver"); | 821 | MODULE_DESCRIPTION("MXS ASoC SAIF driver"); |
| 814 | MODULE_LICENSE("GPL"); | 822 | MODULE_LICENSE("GPL"); |
| 823 | MODULE_ALIAS("platform:mxs-saif"); | ||
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index e7b83179aca2..3c7c3a59ed39 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig | |||
| @@ -207,6 +207,8 @@ config SND_SOC_BELLS | |||
| 207 | select SND_SOC_WM5102 | 207 | select SND_SOC_WM5102 |
| 208 | select SND_SOC_WM5110 | 208 | select SND_SOC_WM5110 |
| 209 | select SND_SOC_WM9081 | 209 | select SND_SOC_WM9081 |
| 210 | select SND_SOC_WM0010 | ||
| 211 | select SND_SOC_WM1250_EV1 | ||
| 210 | 212 | ||
| 211 | config SND_SOC_LOWLAND | 213 | config SND_SOC_LOWLAND |
| 212 | tristate "Audio support for Wolfson Lowland" | 214 | tristate "Audio support for Wolfson Lowland" |
diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index b0d46d63d55e..b56b9a3c6169 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c | |||
| @@ -247,7 +247,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = { | |||
| 247 | { | 247 | { |
| 248 | .name = "Sub", | 248 | .name = "Sub", |
| 249 | .stream_name = "Sub", | 249 | .stream_name = "Sub", |
| 250 | .cpu_dai_name = "wm5110-aif3", | 250 | .cpu_dai_name = "wm5102-aif3", |
| 251 | .codec_dai_name = "wm9081-hifi", | 251 | .codec_dai_name = "wm9081-hifi", |
| 252 | .codec_name = "wm9081.1-006c", | 252 | .codec_name = "wm9081.1-006c", |
| 253 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 253 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d1198627fc40..10d21be383f6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -2786,8 +2786,9 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, | |||
| 2786 | val = (ucontrol->value.integer.value[0] + min) & mask; | 2786 | val = (ucontrol->value.integer.value[0] + min) & mask; |
| 2787 | val = val << shift; | 2787 | val = val << shift; |
| 2788 | 2788 | ||
| 2789 | if (snd_soc_update_bits_locked(codec, reg, val_mask, val)) | 2789 | err = snd_soc_update_bits_locked(codec, reg, val_mask, val); |
| 2790 | return err; | 2790 | if (err < 0) |
| 2791 | return err; | ||
| 2791 | 2792 | ||
| 2792 | if (snd_soc_volsw_is_stereo(mc)) { | 2793 | if (snd_soc_volsw_is_stereo(mc)) { |
| 2793 | val_mask = mask << rshift; | 2794 | val_mask = mask << rshift; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d0a4be38dc0f..6e35bcae02df 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -3745,7 +3745,7 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card) | |||
| 3745 | { | 3745 | { |
| 3746 | struct snd_soc_codec *codec; | 3746 | struct snd_soc_codec *codec; |
| 3747 | 3747 | ||
| 3748 | list_for_each_entry(codec, &card->codec_dev_list, list) { | 3748 | list_for_each_entry(codec, &card->codec_dev_list, card_list) { |
| 3749 | soc_dapm_shutdown_codec(&codec->dapm); | 3749 | soc_dapm_shutdown_codec(&codec->dapm); |
| 3750 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) | 3750 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) |
| 3751 | snd_soc_dapm_set_bias_level(&codec->dapm, | 3751 | snd_soc_dapm_set_bias_level(&codec->dapm, |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 282f0fc9fed1..dbf7999d18b4 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
| @@ -559,9 +559,11 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, | |||
| 559 | return; | 559 | return; |
| 560 | 560 | ||
| 561 | card = chip->card; | 561 | card = chip->card; |
| 562 | mutex_lock(®ister_mutex); | ||
| 563 | down_write(&chip->shutdown_rwsem); | 562 | down_write(&chip->shutdown_rwsem); |
| 564 | chip->shutdown = 1; | 563 | chip->shutdown = 1; |
| 564 | up_write(&chip->shutdown_rwsem); | ||
| 565 | |||
| 566 | mutex_lock(®ister_mutex); | ||
| 565 | chip->num_interfaces--; | 567 | chip->num_interfaces--; |
| 566 | if (chip->num_interfaces <= 0) { | 568 | if (chip->num_interfaces <= 0) { |
| 567 | snd_card_disconnect(card); | 569 | snd_card_disconnect(card); |
| @@ -582,11 +584,9 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, | |||
| 582 | snd_usb_mixer_disconnect(p); | 584 | snd_usb_mixer_disconnect(p); |
| 583 | } | 585 | } |
| 584 | usb_chip[chip->index] = NULL; | 586 | usb_chip[chip->index] = NULL; |
| 585 | up_write(&chip->shutdown_rwsem); | ||
| 586 | mutex_unlock(®ister_mutex); | 587 | mutex_unlock(®ister_mutex); |
| 587 | snd_card_free_when_closed(card); | 588 | snd_card_free_when_closed(card); |
| 588 | } else { | 589 | } else { |
| 589 | up_write(&chip->shutdown_rwsem); | ||
| 590 | mutex_unlock(®ister_mutex); | 590 | mutex_unlock(®ister_mutex); |
| 591 | } | 591 | } |
| 592 | } | 592 | } |
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 2655ae9a3ad8..ea095abbe97e 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c | |||
| @@ -206,8 +206,10 @@ int get_msr(int cpu, off_t offset, unsigned long long *msr) | |||
| 206 | retval = pread(fd, msr, sizeof *msr, offset); | 206 | retval = pread(fd, msr, sizeof *msr, offset); |
| 207 | close(fd); | 207 | close(fd); |
| 208 | 208 | ||
| 209 | if (retval != sizeof *msr) | 209 | if (retval != sizeof *msr) { |
| 210 | fprintf(stderr, "%s offset 0x%zx read failed\n", pathname, offset); | ||
| 210 | return -1; | 211 | return -1; |
| 212 | } | ||
| 211 | 213 | ||
| 212 | return 0; | 214 | return 0; |
| 213 | } | 215 | } |
| @@ -1101,7 +1103,9 @@ void turbostat_loop() | |||
| 1101 | 1103 | ||
| 1102 | restart: | 1104 | restart: |
| 1103 | retval = for_all_cpus(get_counters, EVEN_COUNTERS); | 1105 | retval = for_all_cpus(get_counters, EVEN_COUNTERS); |
| 1104 | if (retval) { | 1106 | if (retval < -1) { |
| 1107 | exit(retval); | ||
| 1108 | } else if (retval == -1) { | ||
| 1105 | re_initialize(); | 1109 | re_initialize(); |
| 1106 | goto restart; | 1110 | goto restart; |
| 1107 | } | 1111 | } |
| @@ -1114,7 +1118,9 @@ restart: | |||
| 1114 | } | 1118 | } |
| 1115 | sleep(interval_sec); | 1119 | sleep(interval_sec); |
| 1116 | retval = for_all_cpus(get_counters, ODD_COUNTERS); | 1120 | retval = for_all_cpus(get_counters, ODD_COUNTERS); |
| 1117 | if (retval) { | 1121 | if (retval < -1) { |
| 1122 | exit(retval); | ||
| 1123 | } else if (retval == -1) { | ||
| 1118 | re_initialize(); | 1124 | re_initialize(); |
| 1119 | goto restart; | 1125 | goto restart; |
| 1120 | } | 1126 | } |
| @@ -1126,7 +1132,9 @@ restart: | |||
| 1126 | flush_stdout(); | 1132 | flush_stdout(); |
| 1127 | sleep(interval_sec); | 1133 | sleep(interval_sec); |
| 1128 | retval = for_all_cpus(get_counters, EVEN_COUNTERS); | 1134 | retval = for_all_cpus(get_counters, EVEN_COUNTERS); |
| 1129 | if (retval) { | 1135 | if (retval < -1) { |
| 1136 | exit(retval); | ||
| 1137 | } else if (retval == -1) { | ||
| 1130 | re_initialize(); | 1138 | re_initialize(); |
| 1131 | goto restart; | 1139 | goto restart; |
| 1132 | } | 1140 | } |
| @@ -1545,8 +1553,11 @@ void turbostat_init() | |||
| 1545 | int fork_it(char **argv) | 1553 | int fork_it(char **argv) |
| 1546 | { | 1554 | { |
| 1547 | pid_t child_pid; | 1555 | pid_t child_pid; |
| 1556 | int status; | ||
| 1548 | 1557 | ||
| 1549 | for_all_cpus(get_counters, EVEN_COUNTERS); | 1558 | status = for_all_cpus(get_counters, EVEN_COUNTERS); |
| 1559 | if (status) | ||
| 1560 | exit(status); | ||
| 1550 | /* clear affinity side-effect of get_counters() */ | 1561 | /* clear affinity side-effect of get_counters() */ |
| 1551 | sched_setaffinity(0, cpu_present_setsize, cpu_present_set); | 1562 | sched_setaffinity(0, cpu_present_setsize, cpu_present_set); |
| 1552 | gettimeofday(&tv_even, (struct timezone *)NULL); | 1563 | gettimeofday(&tv_even, (struct timezone *)NULL); |
| @@ -1556,7 +1567,6 @@ int fork_it(char **argv) | |||
| 1556 | /* child */ | 1567 | /* child */ |
| 1557 | execvp(argv[0], argv); | 1568 | execvp(argv[0], argv); |
| 1558 | } else { | 1569 | } else { |
| 1559 | int status; | ||
| 1560 | 1570 | ||
| 1561 | /* parent */ | 1571 | /* parent */ |
| 1562 | if (child_pid == -1) { | 1572 | if (child_pid == -1) { |
| @@ -1568,7 +1578,7 @@ int fork_it(char **argv) | |||
| 1568 | signal(SIGQUIT, SIG_IGN); | 1578 | signal(SIGQUIT, SIG_IGN); |
| 1569 | if (waitpid(child_pid, &status, 0) == -1) { | 1579 | if (waitpid(child_pid, &status, 0) == -1) { |
| 1570 | perror("wait"); | 1580 | perror("wait"); |
| 1571 | exit(1); | 1581 | exit(status); |
| 1572 | } | 1582 | } |
| 1573 | } | 1583 | } |
| 1574 | /* | 1584 | /* |
| @@ -1585,7 +1595,7 @@ int fork_it(char **argv) | |||
| 1585 | 1595 | ||
| 1586 | fprintf(stderr, "%.6f sec\n", tv_delta.tv_sec + tv_delta.tv_usec/1000000.0); | 1596 | fprintf(stderr, "%.6f sec\n", tv_delta.tv_sec + tv_delta.tv_usec/1000000.0); |
| 1587 | 1597 | ||
| 1588 | return 0; | 1598 | return status; |
| 1589 | } | 1599 | } |
| 1590 | 1600 | ||
| 1591 | void cmdline(int argc, char **argv) | 1601 | void cmdline(int argc, char **argv) |
| @@ -1594,7 +1604,7 @@ void cmdline(int argc, char **argv) | |||
| 1594 | 1604 | ||
| 1595 | progname = argv[0]; | 1605 | progname = argv[0]; |
| 1596 | 1606 | ||
| 1597 | while ((opt = getopt(argc, argv, "+pPSvisc:sC:m:M:")) != -1) { | 1607 | while ((opt = getopt(argc, argv, "+pPSvi:sc:sC:m:M:")) != -1) { |
| 1598 | switch (opt) { | 1608 | switch (opt) { |
| 1599 | case 'p': | 1609 | case 'p': |
| 1600 | show_core_only++; | 1610 | show_core_only++; |
