diff options
128 files changed, 1169 insertions, 769 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-mtd b/Documentation/ABI/testing/sysfs-class-mtd index db1ad7e34fc3..938ef71e2035 100644 --- a/Documentation/ABI/testing/sysfs-class-mtd +++ b/Documentation/ABI/testing/sysfs-class-mtd | |||
@@ -142,13 +142,14 @@ KernelVersion: 3.4 | |||
142 | Contact: linux-mtd@lists.infradead.org | 142 | Contact: linux-mtd@lists.infradead.org |
143 | Description: | 143 | Description: |
144 | This allows the user to examine and adjust the criteria by which | 144 | This allows the user to examine and adjust the criteria by which |
145 | mtd returns -EUCLEAN from mtd_read(). If the maximum number of | 145 | mtd returns -EUCLEAN from mtd_read() and mtd_read_oob(). If the |
146 | bit errors that were corrected on any single region comprising | 146 | maximum number of bit errors that were corrected on any single |
147 | an ecc step (as reported by the driver) equals or exceeds this | 147 | region comprising an ecc step (as reported by the driver) equals |
148 | value, -EUCLEAN is returned. Otherwise, absent an error, 0 is | 148 | or exceeds this value, -EUCLEAN is returned. Otherwise, absent |
149 | returned. Higher layers (e.g., UBI) use this return code as an | 149 | an error, 0 is returned. Higher layers (e.g., UBI) use this |
150 | indication that an erase block may be degrading and should be | 150 | return code as an indication that an erase block may be |
151 | scrutinized as a candidate for being marked as bad. | 151 | degrading and should be scrutinized as a candidate for being |
152 | marked as bad. | ||
152 | 153 | ||
153 | The initial value may be specified by the flash device driver. | 154 | The initial value may be specified by the flash device driver. |
154 | If not, then the default value is ecc_strength. | 155 | If not, then the default value is ecc_strength. |
@@ -167,7 +168,7 @@ Description: | |||
167 | block degradation, but high enough to avoid the consequences of | 168 | block degradation, but high enough to avoid the consequences of |
168 | a persistent return value of -EUCLEAN on devices where sticky | 169 | a persistent return value of -EUCLEAN on devices where sticky |
169 | bitflips occur. Note that if bitflip_threshold exceeds | 170 | bitflips occur. Note that if bitflip_threshold exceeds |
170 | ecc_strength, -EUCLEAN is never returned by mtd_read(). | 171 | ecc_strength, -EUCLEAN is never returned by the read operations. |
171 | Conversely, if bitflip_threshold is zero, -EUCLEAN is always | 172 | Conversely, if bitflip_threshold is zero, -EUCLEAN is always |
172 | returned, absent a hard error. | 173 | returned, absent a hard error. |
173 | 174 | ||
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 676bc46f9c52..cda0dfb6769a 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
@@ -3988,7 +3988,7 @@ interface and may change in the future.</para> | |||
3988 | from RGB to Y'CbCr color space. | 3988 | from RGB to Y'CbCr color space. |
3989 | </entry> | 3989 | </entry> |
3990 | </row> | 3990 | </row> |
3991 | <row id = "v4l2-jpeg-chroma-subsampling"> | 3991 | <row> |
3992 | <entrytbl spanname="descr" cols="2"> | 3992 | <entrytbl spanname="descr" cols="2"> |
3993 | <tbody valign="top"> | 3993 | <tbody valign="top"> |
3994 | <row> | 3994 | <row> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml index e3d5afcdafbb..0a4b90fcf2da 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | |||
@@ -284,13 +284,6 @@ These controls are described in <xref | |||
284 | processing controls. These controls are described in <xref | 284 | processing controls. These controls are described in <xref |
285 | linkend="image-process-controls" />.</entry> | 285 | linkend="image-process-controls" />.</entry> |
286 | </row> | 286 | </row> |
287 | <row> | ||
288 | <entry><constant>V4L2_CTRL_CLASS_JPEG</constant></entry> | ||
289 | <entry>0x9d0000</entry> | ||
290 | <entry>The class containing JPEG compression controls. | ||
291 | These controls are described in <xref | ||
292 | linkend="jpeg-controls" />.</entry> | ||
293 | </row> | ||
294 | </tbody> | 287 | </tbody> |
295 | </tgroup> | 288 | </tgroup> |
296 | </table> | 289 | </table> |
diff --git a/MAINTAINERS b/MAINTAINERS index 03df1d15ebf3..d1d9ae6173b8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4857,6 +4857,7 @@ M: Kevin Hilman <khilman@ti.com> | |||
4857 | L: linux-omap@vger.kernel.org | 4857 | L: linux-omap@vger.kernel.org |
4858 | S: Maintained | 4858 | S: Maintained |
4859 | F: arch/arm/*omap*/*pm* | 4859 | F: arch/arm/*omap*/*pm* |
4860 | F: drivers/cpufreq/omap-cpufreq.c | ||
4860 | 4861 | ||
4861 | OMAP POWERDOMAIN/CLOCKDOMAIN SOC ADAPTATION LAYER SUPPORT | 4862 | OMAP POWERDOMAIN/CLOCKDOMAIN SOC ADAPTATION LAYER SUPPORT |
4862 | M: Rajendra Nayak <rnayak@ti.com> | 4863 | M: Rajendra Nayak <rnayak@ti.com> |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index 9854ff4279e0..11828e632532 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -176,7 +176,6 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y | |||
176 | CONFIG_USB_DEVICEFS=y | 176 | CONFIG_USB_DEVICEFS=y |
177 | CONFIG_USB_SUSPEND=y | 177 | CONFIG_USB_SUSPEND=y |
178 | CONFIG_USB_MON=y | 178 | CONFIG_USB_MON=y |
179 | CONFIG_USB_EHCI_HCD=y | ||
180 | CONFIG_USB_WDM=y | 179 | CONFIG_USB_WDM=y |
181 | CONFIG_USB_STORAGE=y | 180 | CONFIG_USB_STORAGE=y |
182 | CONFIG_USB_LIBUSUAL=y | 181 | CONFIG_USB_LIBUSUAL=y |
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index f7b58609bad8..6227e9505c2d 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -31,12 +31,16 @@ | |||
31 | * | 31 | * |
32 | * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this | 32 | * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this |
33 | * clockdomain. (Currently, this applies to OMAP3 clockdomains only.) | 33 | * clockdomain. (Currently, this applies to OMAP3 clockdomains only.) |
34 | * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is | ||
35 | * active whenever the MPU is active. True for interconnects and | ||
36 | * the WKUP clockdomains. | ||
34 | */ | 37 | */ |
35 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 38 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
36 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | 39 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) |
37 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) | 40 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) |
38 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | 41 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) |
39 | #define CLKDM_NO_AUTODEPS (1 << 4) | 42 | #define CLKDM_NO_AUTODEPS (1 << 4) |
43 | #define CLKDM_ACTIVE_WITH_MPU (1 << 5) | ||
40 | 44 | ||
41 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | 45 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) |
42 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | 46 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c index 839145e1cfbe..4972219653ce 100644 --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | |||
@@ -88,4 +88,5 @@ struct clockdomain wkup_common_clkdm = { | |||
88 | .name = "wkup_clkdm", | 88 | .name = "wkup_clkdm", |
89 | .pwrdm = { .name = "wkup_pwrdm" }, | 89 | .pwrdm = { .name = "wkup_pwrdm" }, |
90 | .dep_bit = OMAP_EN_WKUP_SHIFT, | 90 | .dep_bit = OMAP_EN_WKUP_SHIFT, |
91 | .flags = CLKDM_ACTIVE_WITH_MPU, | ||
91 | }; | 92 | }; |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index c53425847493..7f2133abe7d3 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -381,7 +381,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = { | |||
381 | .cm_inst = OMAP4430_PRM_WKUP_CM_INST, | 381 | .cm_inst = OMAP4430_PRM_WKUP_CM_INST, |
382 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, | 382 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, |
383 | .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, | 383 | .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, |
384 | .flags = CLKDM_CAN_HWSUP, | 384 | .flags = CLKDM_CAN_HWSUP | CLKDM_ACTIVE_WITH_MPU, |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static struct clockdomain emu_sys_44xx_clkdm = { | 387 | static struct clockdomain emu_sys_44xx_clkdm = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 773193670ea2..2d710f50fca2 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1124,15 +1124,18 @@ static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap | |||
1124 | * _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG | 1124 | * _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG |
1125 | * @oh: struct omap_hwmod * | 1125 | * @oh: struct omap_hwmod * |
1126 | * | 1126 | * |
1127 | * If module is marked as SWSUP_SIDLE, force the module out of slave | 1127 | * Ensure that the OCP_SYSCONFIG register for the IP block represented |
1128 | * idle; otherwise, configure it for smart-idle. If module is marked | 1128 | * by @oh is set to indicate to the PRCM that the IP block is active. |
1129 | * as SWSUP_MSUSPEND, force the module out of master standby; | 1129 | * Usually this means placing the module into smart-idle mode and |
1130 | * otherwise, configure it for smart-standby. No return value. | 1130 | * smart-standby, but if there is a bug in the automatic idle handling |
1131 | * for the IP block, it may need to be placed into the force-idle or | ||
1132 | * no-idle variants of these modes. No return value. | ||
1131 | */ | 1133 | */ |
1132 | static void _enable_sysc(struct omap_hwmod *oh) | 1134 | static void _enable_sysc(struct omap_hwmod *oh) |
1133 | { | 1135 | { |
1134 | u8 idlemode, sf; | 1136 | u8 idlemode, sf; |
1135 | u32 v; | 1137 | u32 v; |
1138 | bool clkdm_act; | ||
1136 | 1139 | ||
1137 | if (!oh->class->sysc) | 1140 | if (!oh->class->sysc) |
1138 | return; | 1141 | return; |
@@ -1141,8 +1144,16 @@ static void _enable_sysc(struct omap_hwmod *oh) | |||
1141 | sf = oh->class->sysc->sysc_flags; | 1144 | sf = oh->class->sysc->sysc_flags; |
1142 | 1145 | ||
1143 | if (sf & SYSC_HAS_SIDLEMODE) { | 1146 | if (sf & SYSC_HAS_SIDLEMODE) { |
1144 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? | 1147 | clkdm_act = ((oh->clkdm && |
1145 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; | 1148 | oh->clkdm->flags & CLKDM_ACTIVE_WITH_MPU) || |
1149 | (oh->_clk && oh->_clk->clkdm && | ||
1150 | oh->_clk->clkdm->flags & CLKDM_ACTIVE_WITH_MPU)); | ||
1151 | if (clkdm_act && !(oh->class->sysc->idlemodes & | ||
1152 | (SIDLE_SMART | SIDLE_SMART_WKUP))) | ||
1153 | idlemode = HWMOD_IDLEMODE_FORCE; | ||
1154 | else | ||
1155 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? | ||
1156 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; | ||
1146 | _set_slave_idlemode(oh, idlemode, &v); | 1157 | _set_slave_idlemode(oh, idlemode, &v); |
1147 | } | 1158 | } |
1148 | 1159 | ||
@@ -1208,8 +1219,13 @@ static void _idle_sysc(struct omap_hwmod *oh) | |||
1208 | sf = oh->class->sysc->sysc_flags; | 1219 | sf = oh->class->sysc->sysc_flags; |
1209 | 1220 | ||
1210 | if (sf & SYSC_HAS_SIDLEMODE) { | 1221 | if (sf & SYSC_HAS_SIDLEMODE) { |
1211 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? | 1222 | /* XXX What about HWMOD_IDLEMODE_SMART_WKUP? */ |
1212 | HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; | 1223 | if (oh->flags & HWMOD_SWSUP_SIDLE || |
1224 | !(oh->class->sysc->idlemodes & | ||
1225 | (SIDLE_SMART | SIDLE_SMART_WKUP))) | ||
1226 | idlemode = HWMOD_IDLEMODE_FORCE; | ||
1227 | else | ||
1228 | idlemode = HWMOD_IDLEMODE_SMART; | ||
1213 | _set_slave_idlemode(oh, idlemode, &v); | 1229 | _set_slave_idlemode(oh, idlemode, &v); |
1214 | } | 1230 | } |
1215 | 1231 | ||
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index e859fcdb3d58..fde0d23121dc 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c | |||
@@ -22,8 +22,13 @@ | |||
22 | #include <mach/common.h> | 22 | #include <mach/common.h> |
23 | #include <mach/emev2.h> | 23 | #include <mach/emev2.h> |
24 | 24 | ||
25 | #ifdef CONFIG_ARCH_SH73A0 | ||
25 | #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \ | 26 | #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \ |
26 | of_machine_is_compatible("renesas,sh73a0")) | 27 | of_machine_is_compatible("renesas,sh73a0")) |
28 | #else | ||
29 | #define is_sh73a0() (0) | ||
30 | #endif | ||
31 | |||
27 | #define is_r8a7779() machine_is_marzen() | 32 | #define is_r8a7779() machine_is_marzen() |
28 | 33 | ||
29 | #ifdef CONFIG_ARCH_EMEV2 | 34 | #ifdef CONFIG_ARCH_EMEV2 |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 1509a3cb5833..4fd93f5c49ec 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -625,11 +625,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
625 | &ab8500_device, | 625 | &ab8500_device, |
626 | }; | 626 | }; |
627 | 627 | ||
628 | static struct platform_device *snowball_of_platform_devs[] __initdata = { | ||
629 | &snowball_led_dev, | ||
630 | &snowball_key_dev, | ||
631 | }; | ||
632 | |||
633 | static void __init mop500_init_machine(void) | 628 | static void __init mop500_init_machine(void) |
634 | { | 629 | { |
635 | struct device *parent = NULL; | 630 | struct device *parent = NULL; |
@@ -769,6 +764,11 @@ MACHINE_END | |||
769 | 764 | ||
770 | #ifdef CONFIG_MACH_UX500_DT | 765 | #ifdef CONFIG_MACH_UX500_DT |
771 | 766 | ||
767 | static struct platform_device *snowball_of_platform_devs[] __initdata = { | ||
768 | &snowball_led_dev, | ||
769 | &snowball_key_dev, | ||
770 | }; | ||
771 | |||
772 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | 772 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { |
773 | /* Requires DMA and call-back bindings. */ | 773 | /* Requires DMA and call-back bindings. */ |
774 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), | 774 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), |
@@ -786,6 +786,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | |||
786 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), | 786 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), |
787 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), | 787 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), |
788 | OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), | 788 | OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), |
789 | /* Requires device name bindings. */ | ||
790 | OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), | ||
789 | {}, | 791 | {}, |
790 | }; | 792 | }; |
791 | 793 | ||
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 741e71feca78..66e7f00884ab 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c | |||
@@ -63,8 +63,10 @@ static void __init ux500_timer_init(void) | |||
63 | 63 | ||
64 | /* TODO: Once MTU has been DT:ed place code above into else. */ | 64 | /* TODO: Once MTU has been DT:ed place code above into else. */ |
65 | if (of_have_populated_dt()) { | 65 | if (of_have_populated_dt()) { |
66 | #ifdef CONFIG_OF | ||
66 | np = of_find_matching_node(NULL, prcmu_timer_of_match); | 67 | np = of_find_matching_node(NULL, prcmu_timer_of_match); |
67 | if (!np) | 68 | if (!np) |
69 | #endif | ||
68 | goto dt_fail; | 70 | goto dt_fail; |
69 | 71 | ||
70 | tmp_base = of_iomap(np, 0); | 72 | tmp_base = of_iomap(np, 0); |
diff --git a/arch/h8300/include/asm/pgtable.h b/arch/h8300/include/asm/pgtable.h index a09230a08e02..62ef17676b40 100644 --- a/arch/h8300/include/asm/pgtable.h +++ b/arch/h8300/include/asm/pgtable.h | |||
@@ -70,4 +70,7 @@ extern int is_in_rom(unsigned long); | |||
70 | #define VMALLOC_END 0xffffffff | 70 | #define VMALLOC_END 0xffffffff |
71 | 71 | ||
72 | #define arch_enter_lazy_cpu_mode() do {} while (0) | 72 | #define arch_enter_lazy_cpu_mode() do {} while (0) |
73 | |||
74 | #include <asm-generic/pgtable.h> | ||
75 | |||
73 | #endif /* _H8300_PGTABLE_H */ | 76 | #endif /* _H8300_PGTABLE_H */ |
diff --git a/arch/h8300/include/asm/uaccess.h b/arch/h8300/include/asm/uaccess.h index 356068cd0879..8725d1ad4272 100644 --- a/arch/h8300/include/asm/uaccess.h +++ b/arch/h8300/include/asm/uaccess.h | |||
@@ -100,7 +100,6 @@ extern int __put_user_bad(void); | |||
100 | break; \ | 100 | break; \ |
101 | default: \ | 101 | default: \ |
102 | __gu_err = __get_user_bad(); \ | 102 | __gu_err = __get_user_bad(); \ |
103 | __gu_val = 0; \ | ||
104 | break; \ | 103 | break; \ |
105 | } \ | 104 | } \ |
106 | (x) = __gu_val; \ | 105 | (x) = __gu_val; \ |
@@ -159,4 +158,6 @@ clear_user(void *to, unsigned long n) | |||
159 | return 0; | 158 | return 0; |
160 | } | 159 | } |
161 | 160 | ||
161 | #define __clear_user clear_user | ||
162 | |||
162 | #endif /* _H8300_UACCESS_H */ | 163 | #endif /* _H8300_UACCESS_H */ |
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c index fca10378701b..5adaadaf9218 100644 --- a/arch/h8300/kernel/signal.c +++ b/arch/h8300/kernel/signal.c | |||
@@ -447,7 +447,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
447 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 447 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
448 | * mistake. | 448 | * mistake. |
449 | */ | 449 | */ |
450 | statis void do_signal(struct pt_regs *regs) | 450 | static void do_signal(struct pt_regs *regs) |
451 | { | 451 | { |
452 | siginfo_t info; | 452 | siginfo_t info; |
453 | int signr; | 453 | int signr; |
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index 32263a138aa6..e0f74191d553 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/profile.h> | 27 | #include <linux/profile.h> |
28 | 28 | ||
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/irq_regs.h> | ||
30 | #include <asm/timer.h> | 31 | #include <asm/timer.h> |
31 | 32 | ||
32 | #define TICK_SIZE (tick_nsec / 1000) | 33 | #define TICK_SIZE (tick_nsec / 1000) |
diff --git a/arch/mn10300/include/asm/ptrace.h b/arch/mn10300/include/asm/ptrace.h index 55b79ef10028..44251b974f1d 100644 --- a/arch/mn10300/include/asm/ptrace.h +++ b/arch/mn10300/include/asm/ptrace.h | |||
@@ -81,9 +81,6 @@ struct pt_regs { | |||
81 | #define PTRACE_GETFPREGS 14 | 81 | #define PTRACE_GETFPREGS 14 |
82 | #define PTRACE_SETFPREGS 15 | 82 | #define PTRACE_SETFPREGS 15 |
83 | 83 | ||
84 | /* options set using PTRACE_SETOPTIONS */ | ||
85 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | ||
86 | |||
87 | #ifdef __KERNEL__ | 84 | #ifdef __KERNEL__ |
88 | 85 | ||
89 | #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) | 86 | #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) |
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h index 08251d6f6b11..ac519bbd42ff 100644 --- a/arch/mn10300/include/asm/thread_info.h +++ b/arch/mn10300/include/asm/thread_info.h | |||
@@ -123,7 +123,7 @@ static inline unsigned long current_stack_pointer(void) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | #ifndef CONFIG_KGDB | 125 | #ifndef CONFIG_KGDB |
126 | void arch_release_thread_info(struct thread_info *ti) | 126 | void arch_release_thread_info(struct thread_info *ti); |
127 | #endif | 127 | #endif |
128 | #define get_thread_info(ti) get_task_struct((ti)->task) | 128 | #define get_thread_info(ti) get_task_struct((ti)->task) |
129 | #define put_thread_info(ti) put_task_struct((ti)->task) | 129 | #define put_thread_info(ti) put_task_struct((ti)->task) |
diff --git a/arch/mn10300/include/asm/timex.h b/arch/mn10300/include/asm/timex.h index bd4e90dfe6c2..f8e66425cbf8 100644 --- a/arch/mn10300/include/asm/timex.h +++ b/arch/mn10300/include/asm/timex.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #ifndef _ASM_TIMEX_H | 11 | #ifndef _ASM_TIMEX_H |
12 | #define _ASM_TIMEX_H | 12 | #define _ASM_TIMEX_H |
13 | 13 | ||
14 | #include <asm/hardirq.h> | ||
15 | #include <unit/timex.h> | 14 | #include <unit/timex.h> |
16 | 15 | ||
17 | #define TICK_SIZE (tick_nsec / 1000) | 16 | #define TICK_SIZE (tick_nsec / 1000) |
@@ -30,16 +29,6 @@ static inline cycles_t get_cycles(void) | |||
30 | extern int init_clockevents(void); | 29 | extern int init_clockevents(void); |
31 | extern int init_clocksource(void); | 30 | extern int init_clocksource(void); |
32 | 31 | ||
33 | static inline void setup_jiffies_interrupt(int irq, | ||
34 | struct irqaction *action) | ||
35 | { | ||
36 | u16 tmp; | ||
37 | setup_irq(irq, action); | ||
38 | set_intr_level(irq, NUM2GxICR_LEVEL(CONFIG_TIMER_IRQ_LEVEL)); | ||
39 | GxICR(irq) |= GxICR_ENABLE | GxICR_DETECT | GxICR_REQUEST; | ||
40 | tmp = GxICR(irq); | ||
41 | } | ||
42 | |||
43 | #endif /* __KERNEL__ */ | 32 | #endif /* __KERNEL__ */ |
44 | 33 | ||
45 | #endif /* _ASM_TIMEX_H */ | 34 | #endif /* _ASM_TIMEX_H */ |
diff --git a/arch/mn10300/kernel/cevt-mn10300.c b/arch/mn10300/kernel/cevt-mn10300.c index 69cae0260786..ccce35e3e179 100644 --- a/arch/mn10300/kernel/cevt-mn10300.c +++ b/arch/mn10300/kernel/cevt-mn10300.c | |||
@@ -70,6 +70,16 @@ static void event_handler(struct clock_event_device *dev) | |||
70 | { | 70 | { |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline void setup_jiffies_interrupt(int irq, | ||
74 | struct irqaction *action) | ||
75 | { | ||
76 | u16 tmp; | ||
77 | setup_irq(irq, action); | ||
78 | set_intr_level(irq, NUM2GxICR_LEVEL(CONFIG_TIMER_IRQ_LEVEL)); | ||
79 | GxICR(irq) |= GxICR_ENABLE | GxICR_DETECT | GxICR_REQUEST; | ||
80 | tmp = GxICR(irq); | ||
81 | } | ||
82 | |||
73 | int __init init_clockevents(void) | 83 | int __init init_clockevents(void) |
74 | { | 84 | { |
75 | struct clock_event_device *cd; | 85 | struct clock_event_device *cd; |
diff --git a/arch/mn10300/kernel/internal.h b/arch/mn10300/kernel/internal.h index a5ac755dd69f..2df440105a80 100644 --- a/arch/mn10300/kernel/internal.h +++ b/arch/mn10300/kernel/internal.h | |||
@@ -9,6 +9,8 @@ | |||
9 | * 2 of the Licence, or (at your option) any later version. | 9 | * 2 of the Licence, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/irqreturn.h> | ||
13 | |||
12 | struct clocksource; | 14 | struct clocksource; |
13 | struct clock_event_device; | 15 | struct clock_event_device; |
14 | 16 | ||
diff --git a/arch/mn10300/kernel/irq.c b/arch/mn10300/kernel/irq.c index 2381df83bd00..35932a8de8b8 100644 --- a/arch/mn10300/kernel/irq.c +++ b/arch/mn10300/kernel/irq.c | |||
@@ -170,9 +170,9 @@ mn10300_cpupic_setaffinity(struct irq_data *d, const struct cpumask *mask, | |||
170 | case SC1TXIRQ: | 170 | case SC1TXIRQ: |
171 | #ifdef CONFIG_MN10300_TTYSM1_TIMER12 | 171 | #ifdef CONFIG_MN10300_TTYSM1_TIMER12 |
172 | case TM12IRQ: | 172 | case TM12IRQ: |
173 | #elif CONFIG_MN10300_TTYSM1_TIMER9 | 173 | #elif defined(CONFIG_MN10300_TTYSM1_TIMER9) |
174 | case TM9IRQ: | 174 | case TM9IRQ: |
175 | #elif CONFIG_MN10300_TTYSM1_TIMER3 | 175 | #elif defined(CONFIG_MN10300_TTYSM1_TIMER3) |
176 | case TM3IRQ: | 176 | case TM3IRQ: |
177 | #endif /* CONFIG_MN10300_TTYSM1_TIMER12 */ | 177 | #endif /* CONFIG_MN10300_TTYSM1_TIMER12 */ |
178 | #endif /* CONFIG_MN10300_TTYSM1 */ | 178 | #endif /* CONFIG_MN10300_TTYSM1 */ |
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c index 94a9c6d53e1b..b900e5afa0ae 100644 --- a/arch/mn10300/kernel/traps.c +++ b/arch/mn10300/kernel/traps.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/kdebug.h> | 26 | #include <linux/kdebug.h> |
27 | #include <linux/bug.h> | 27 | #include <linux/bug.h> |
28 | #include <linux/irq.h> | 28 | #include <linux/irq.h> |
29 | #include <linux/export.h> | ||
29 | #include <asm/processor.h> | 30 | #include <asm/processor.h> |
30 | #include <linux/uaccess.h> | 31 | #include <linux/uaccess.h> |
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
diff --git a/arch/mn10300/mm/dma-alloc.c b/arch/mn10300/mm/dma-alloc.c index 159acb02cfd4..e244ebe637e1 100644 --- a/arch/mn10300/mm/dma-alloc.c +++ b/arch/mn10300/mm/dma-alloc.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
17 | #include <linux/gfp.h> | 17 | #include <linux/gfp.h> |
18 | #include <linux/export.h> | ||
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
19 | 20 | ||
20 | static unsigned long pci_sram_allocated = 0xbc000000; | 21 | static unsigned long pci_sram_allocated = 0xbc000000; |
diff --git a/arch/mn10300/unit-asb2303/include/unit/timex.h b/arch/mn10300/unit-asb2303/include/unit/timex.h index cc18fe7d8b90..c37f9832cf17 100644 --- a/arch/mn10300/unit-asb2303/include/unit/timex.h +++ b/arch/mn10300/unit-asb2303/include/unit/timex.h | |||
@@ -11,10 +11,6 @@ | |||
11 | #ifndef _ASM_UNIT_TIMEX_H | 11 | #ifndef _ASM_UNIT_TIMEX_H |
12 | #define _ASM_UNIT_TIMEX_H | 12 | #define _ASM_UNIT_TIMEX_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <linux/irq.h> | ||
16 | #endif /* __ASSEMBLY__ */ | ||
17 | |||
18 | #include <asm/timer-regs.h> | 14 | #include <asm/timer-regs.h> |
19 | #include <unit/clock.h> | 15 | #include <unit/clock.h> |
20 | #include <asm/param.h> | 16 | #include <asm/param.h> |
diff --git a/arch/mn10300/unit-asb2303/smc91111.c b/arch/mn10300/unit-asb2303/smc91111.c index 43c246439413..53677694b165 100644 --- a/arch/mn10300/unit-asb2303/smc91111.c +++ b/arch/mn10300/unit-asb2303/smc91111.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | 16 | ||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/irq.h> | ||
18 | #include <asm/timex.h> | 19 | #include <asm/timex.h> |
19 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
20 | #include <asm/intctl-regs.h> | 21 | #include <asm/intctl-regs.h> |
diff --git a/arch/mn10300/unit-asb2305/include/unit/timex.h b/arch/mn10300/unit-asb2305/include/unit/timex.h index 758af30d1a16..4cefc224f448 100644 --- a/arch/mn10300/unit-asb2305/include/unit/timex.h +++ b/arch/mn10300/unit-asb2305/include/unit/timex.h | |||
@@ -11,10 +11,6 @@ | |||
11 | #ifndef _ASM_UNIT_TIMEX_H | 11 | #ifndef _ASM_UNIT_TIMEX_H |
12 | #define _ASM_UNIT_TIMEX_H | 12 | #define _ASM_UNIT_TIMEX_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <linux/irq.h> | ||
16 | #endif /* __ASSEMBLY__ */ | ||
17 | |||
18 | #include <asm/timer-regs.h> | 14 | #include <asm/timer-regs.h> |
19 | #include <unit/clock.h> | 15 | #include <unit/clock.h> |
20 | #include <asm/param.h> | 16 | #include <asm/param.h> |
diff --git a/arch/mn10300/unit-asb2305/unit-init.c b/arch/mn10300/unit-asb2305/unit-init.c index e1becd6b7571..bc4adfaf815c 100644 --- a/arch/mn10300/unit-asb2305/unit-init.c +++ b/arch/mn10300/unit-asb2305/unit-init.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/irq.h> | ||
16 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
17 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
18 | #include <asm/intctl-regs.h> | 19 | #include <asm/intctl-regs.h> |
diff --git a/arch/mn10300/unit-asb2364/include/unit/timex.h b/arch/mn10300/unit-asb2364/include/unit/timex.h index ddb7ed010706..42f32db75087 100644 --- a/arch/mn10300/unit-asb2364/include/unit/timex.h +++ b/arch/mn10300/unit-asb2364/include/unit/timex.h | |||
@@ -11,10 +11,6 @@ | |||
11 | #ifndef _ASM_UNIT_TIMEX_H | 11 | #ifndef _ASM_UNIT_TIMEX_H |
12 | #define _ASM_UNIT_TIMEX_H | 12 | #define _ASM_UNIT_TIMEX_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <linux/irq.h> | ||
16 | #endif /* __ASSEMBLY__ */ | ||
17 | |||
18 | #include <asm/timer-regs.h> | 14 | #include <asm/timer-regs.h> |
19 | #include <unit/clock.h> | 15 | #include <unit/clock.h> |
20 | #include <asm/param.h> | 16 | #include <asm/param.h> |
diff --git a/arch/powerpc/kvm/book3s_pr_papr.c b/arch/powerpc/kvm/book3s_pr_papr.c index 3ff9013d6e79..ee02b30878ed 100644 --- a/arch/powerpc/kvm/book3s_pr_papr.c +++ b/arch/powerpc/kvm/book3s_pr_papr.c | |||
@@ -241,6 +241,7 @@ int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd) | |||
241 | case H_PUT_TCE: | 241 | case H_PUT_TCE: |
242 | return kvmppc_h_pr_put_tce(vcpu); | 242 | return kvmppc_h_pr_put_tce(vcpu); |
243 | case H_CEDE: | 243 | case H_CEDE: |
244 | vcpu->arch.shared->msr |= MSR_EE; | ||
244 | kvm_vcpu_block(vcpu); | 245 | kvm_vcpu_block(vcpu); |
245 | clear_bit(KVM_REQ_UNHALT, &vcpu->requests); | 246 | clear_bit(KVM_REQ_UNHALT, &vcpu->requests); |
246 | vcpu->stat.halt_wakeup++; | 247 | vcpu->stat.halt_wakeup++; |
diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h index e136d28d1d2e..4d48f1436a63 100644 --- a/arch/sh/include/asm/io_noioport.h +++ b/arch/sh/include/asm/io_noioport.h | |||
@@ -19,9 +19,20 @@ static inline u32 inl(unsigned long addr) | |||
19 | return -1; | 19 | return -1; |
20 | } | 20 | } |
21 | 21 | ||
22 | #define outb(x, y) BUG() | 22 | static inline void outb(unsigned char x, unsigned long port) |
23 | #define outw(x, y) BUG() | 23 | { |
24 | #define outl(x, y) BUG() | 24 | BUG(); |
25 | } | ||
26 | |||
27 | static inline void outw(unsigned short x, unsigned long port) | ||
28 | { | ||
29 | BUG(); | ||
30 | } | ||
31 | |||
32 | static inline void outl(unsigned int x, unsigned long port) | ||
33 | { | ||
34 | BUG(); | ||
35 | } | ||
25 | 36 | ||
26 | #define inb_p(addr) inb(addr) | 37 | #define inb_p(addr) inb(addr) |
27 | #define inw_p(addr) inw(addr) | 38 | #define inw_p(addr) inw(addr) |
diff --git a/arch/sh/kernel/cpu/sh3/serial-sh7720.c b/arch/sh/kernel/cpu/sh3/serial-sh7720.c index 8832c526cdf9..c4a0336660dd 100644 --- a/arch/sh/kernel/cpu/sh3/serial-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/serial-sh7720.c | |||
@@ -2,7 +2,7 @@ | |||
2 | #include <linux/serial_core.h> | 2 | #include <linux/serial_core.h> |
3 | #include <linux/io.h> | 3 | #include <linux/io.h> |
4 | #include <cpu/serial.h> | 4 | #include <cpu/serial.h> |
5 | #include <asm/gpio.h> | 5 | #include <cpu/gpio.h> |
6 | 6 | ||
7 | static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag) | 7 | static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag) |
8 | { | 8 | { |
diff --git a/arch/tile/kernel/backtrace.c b/arch/tile/kernel/backtrace.c index 9092ce8aa6b4..f8b74ca83b92 100644 --- a/arch/tile/kernel/backtrace.c +++ b/arch/tile/kernel/backtrace.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <asm/byteorder.h> | ||
17 | #include <asm/backtrace.h> | 18 | #include <asm/backtrace.h> |
18 | #include <asm/tile-desc.h> | 19 | #include <asm/tile-desc.h> |
19 | #include <arch/abi.h> | 20 | #include <arch/abi.h> |
@@ -336,8 +337,12 @@ static void find_caller_pc_and_caller_sp(CallerLocation *location, | |||
336 | bytes_to_prefetch / sizeof(tile_bundle_bits); | 337 | bytes_to_prefetch / sizeof(tile_bundle_bits); |
337 | } | 338 | } |
338 | 339 | ||
339 | /* Decode the next bundle. */ | 340 | /* |
340 | bundle.bits = prefetched_bundles[next_bundle++]; | 341 | * Decode the next bundle. |
342 | * TILE always stores instruction bundles in little-endian | ||
343 | * mode, even when the chip is running in big-endian mode. | ||
344 | */ | ||
345 | bundle.bits = le64_to_cpu(prefetched_bundles[next_bundle++]); | ||
341 | bundle.num_insns = | 346 | bundle.num_insns = |
342 | parse_insn_tile(bundle.bits, pc, bundle.insns); | 347 | parse_insn_tile(bundle.bits, pc, bundle.insns); |
343 | num_info_ops = bt_get_info_ops(&bundle, info_operands); | 348 | num_info_ops = bt_get_info_ops(&bundle, info_operands); |
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 7515cf0e1805..08a18d0dcc5a 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -139,6 +139,15 @@ static int addr_to_vsyscall_nr(unsigned long addr) | |||
139 | return nr; | 139 | return nr; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int vsyscall_seccomp(struct task_struct *tsk, int syscall_nr) | ||
143 | { | ||
144 | if (!seccomp_mode(&tsk->seccomp)) | ||
145 | return 0; | ||
146 | task_pt_regs(tsk)->orig_ax = syscall_nr; | ||
147 | task_pt_regs(tsk)->ax = syscall_nr; | ||
148 | return __secure_computing(syscall_nr); | ||
149 | } | ||
150 | |||
142 | static bool write_ok_or_segv(unsigned long ptr, size_t size) | 151 | static bool write_ok_or_segv(unsigned long ptr, size_t size) |
143 | { | 152 | { |
144 | /* | 153 | /* |
@@ -174,6 +183,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
174 | int vsyscall_nr; | 183 | int vsyscall_nr; |
175 | int prev_sig_on_uaccess_error; | 184 | int prev_sig_on_uaccess_error; |
176 | long ret; | 185 | long ret; |
186 | int skip; | ||
177 | 187 | ||
178 | /* | 188 | /* |
179 | * No point in checking CS -- the only way to get here is a user mode | 189 | * No point in checking CS -- the only way to get here is a user mode |
@@ -205,9 +215,6 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
205 | } | 215 | } |
206 | 216 | ||
207 | tsk = current; | 217 | tsk = current; |
208 | if (seccomp_mode(&tsk->seccomp)) | ||
209 | do_exit(SIGKILL); | ||
210 | |||
211 | /* | 218 | /* |
212 | * With a real vsyscall, page faults cause SIGSEGV. We want to | 219 | * With a real vsyscall, page faults cause SIGSEGV. We want to |
213 | * preserve that behavior to make writing exploits harder. | 220 | * preserve that behavior to make writing exploits harder. |
@@ -222,8 +229,13 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
222 | * address 0". | 229 | * address 0". |
223 | */ | 230 | */ |
224 | ret = -EFAULT; | 231 | ret = -EFAULT; |
232 | skip = 0; | ||
225 | switch (vsyscall_nr) { | 233 | switch (vsyscall_nr) { |
226 | case 0: | 234 | case 0: |
235 | skip = vsyscall_seccomp(tsk, __NR_gettimeofday); | ||
236 | if (skip) | ||
237 | break; | ||
238 | |||
227 | if (!write_ok_or_segv(regs->di, sizeof(struct timeval)) || | 239 | if (!write_ok_or_segv(regs->di, sizeof(struct timeval)) || |
228 | !write_ok_or_segv(regs->si, sizeof(struct timezone))) | 240 | !write_ok_or_segv(regs->si, sizeof(struct timezone))) |
229 | break; | 241 | break; |
@@ -234,6 +246,10 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
234 | break; | 246 | break; |
235 | 247 | ||
236 | case 1: | 248 | case 1: |
249 | skip = vsyscall_seccomp(tsk, __NR_time); | ||
250 | if (skip) | ||
251 | break; | ||
252 | |||
237 | if (!write_ok_or_segv(regs->di, sizeof(time_t))) | 253 | if (!write_ok_or_segv(regs->di, sizeof(time_t))) |
238 | break; | 254 | break; |
239 | 255 | ||
@@ -241,6 +257,10 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
241 | break; | 257 | break; |
242 | 258 | ||
243 | case 2: | 259 | case 2: |
260 | skip = vsyscall_seccomp(tsk, __NR_getcpu); | ||
261 | if (skip) | ||
262 | break; | ||
263 | |||
244 | if (!write_ok_or_segv(regs->di, sizeof(unsigned)) || | 264 | if (!write_ok_or_segv(regs->di, sizeof(unsigned)) || |
245 | !write_ok_or_segv(regs->si, sizeof(unsigned))) | 265 | !write_ok_or_segv(regs->si, sizeof(unsigned))) |
246 | break; | 266 | break; |
@@ -253,6 +273,12 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
253 | 273 | ||
254 | current_thread_info()->sig_on_uaccess_error = prev_sig_on_uaccess_error; | 274 | current_thread_info()->sig_on_uaccess_error = prev_sig_on_uaccess_error; |
255 | 275 | ||
276 | if (skip) { | ||
277 | if ((long)regs->ax <= 0L) /* seccomp errno emulation */ | ||
278 | goto do_ret; | ||
279 | goto done; /* seccomp trace/trap */ | ||
280 | } | ||
281 | |||
256 | if (ret == -EFAULT) { | 282 | if (ret == -EFAULT) { |
257 | /* Bad news -- userspace fed a bad pointer to a vsyscall. */ | 283 | /* Bad news -- userspace fed a bad pointer to a vsyscall. */ |
258 | warn_bad_vsyscall(KERN_INFO, regs, | 284 | warn_bad_vsyscall(KERN_INFO, regs, |
@@ -271,10 +297,11 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
271 | 297 | ||
272 | regs->ax = ret; | 298 | regs->ax = ret; |
273 | 299 | ||
300 | do_ret: | ||
274 | /* Emulate a ret instruction. */ | 301 | /* Emulate a ret instruction. */ |
275 | regs->ip = caller; | 302 | regs->ip = caller; |
276 | regs->sp += 8; | 303 | regs->sp += 8; |
277 | 304 | done: | |
278 | return true; | 305 | return true; |
279 | 306 | ||
280 | sigsegv: | 307 | sigsegv: |
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 9b306e550e3f..2c8d6a3d250a 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -277,7 +277,7 @@ void xtensa_elf_core_copy_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs) | |||
277 | 277 | ||
278 | /* Don't leak any random bits. */ | 278 | /* Don't leak any random bits. */ |
279 | 279 | ||
280 | memset(elfregs, 0, sizeof (elfregs)); | 280 | memset(elfregs, 0, sizeof(*elfregs)); |
281 | 281 | ||
282 | /* Note: PS.EXCM is not set while user task is running; its | 282 | /* Note: PS.EXCM is not set while user task is running; its |
283 | * being set in regs->ps is for exception handling convenience. | 283 | * being set in regs->ps is for exception handling convenience. |
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 0ed85cac3231..615996a36bed 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
@@ -95,18 +95,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
95 | return_ACPI_STATUS(status); | 95 | return_ACPI_STATUS(status); |
96 | } | 96 | } |
97 | 97 | ||
98 | if (sleep_state != ACPI_STATE_S5) { | ||
99 | /* | ||
100 | * Disable BM arbitration. This feature is contained within an | ||
101 | * optional register (PM2 Control), so ignore a BAD_ADDRESS | ||
102 | * exception. | ||
103 | */ | ||
104 | status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1); | ||
105 | if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { | ||
106 | return_ACPI_STATUS(status); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | /* | 98 | /* |
111 | * 1) Disable/Clear all GPEs | 99 | * 1) Disable/Clear all GPEs |
112 | * 2) Enable all wakeup GPEs | 100 | * 2) Enable all wakeup GPEs |
@@ -364,16 +352,6 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) | |||
364 | [ACPI_EVENT_POWER_BUTTON]. | 352 | [ACPI_EVENT_POWER_BUTTON]. |
365 | status_register_id, ACPI_CLEAR_STATUS); | 353 | status_register_id, ACPI_CLEAR_STATUS); |
366 | 354 | ||
367 | /* | ||
368 | * Enable BM arbitration. This feature is contained within an | ||
369 | * optional register (PM2 Control), so ignore a BAD_ADDRESS | ||
370 | * exception. | ||
371 | */ | ||
372 | status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0); | ||
373 | if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { | ||
374 | return_ACPI_STATUS(status); | ||
375 | } | ||
376 | |||
377 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); | 355 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); |
378 | return_ACPI_STATUS(status); | 356 | return_ACPI_STATUS(status); |
379 | } | 357 | } |
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c index 0749f9630869..11f29c82253c 100644 --- a/drivers/gpio/gpio-tps65910.c +++ b/drivers/gpio/gpio-tps65910.c | |||
@@ -149,7 +149,9 @@ static int __devinit tps65910_gpio_probe(struct platform_device *pdev) | |||
149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; | 149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; |
150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; | 150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; |
151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; | 151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; |
152 | #ifdef CONFIG_OF_GPIO | ||
152 | tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; | 153 | tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; |
154 | #endif | ||
153 | if (pdata && pdata->gpio_base) | 155 | if (pdata && pdata->gpio_base) |
154 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; | 156 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; |
155 | else | 157 | else |
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index fa10f847f7db..585344b6d338 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -517,6 +517,12 @@ static const struct hid_device_id apple_devices[] = { | |||
517 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | 517 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
518 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | 518 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), |
519 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | 519 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
520 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
521 | .driver_data = APPLE_HAS_FN }, | ||
522 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
523 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | ||
524 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
525 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | ||
520 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | 526 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), |
521 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 527 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
522 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | 528 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 6ac0286b5375..4c87276c8ddb 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1503,6 +1503,9 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1503 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | 1503 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, |
1504 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | 1504 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, |
1505 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | 1505 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, |
1506 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
1507 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
1508 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
1506 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, | 1509 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, |
1507 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, | 1510 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, |
1508 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, | 1511 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, |
@@ -1995,6 +1998,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1995 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) }, | 1998 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) }, |
1996 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, | 1999 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, |
1997 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, | 2000 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, |
2001 | { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) }, | ||
1998 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, | 2002 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, |
1999 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, | 2003 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, |
2000 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, | 2004 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, |
@@ -2089,6 +2093,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { | |||
2089 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | 2093 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, |
2090 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | 2094 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, |
2091 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | 2095 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, |
2096 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
2097 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
2098 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
2092 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | 2099 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, |
2093 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | 2100 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
2094 | { } | 2101 | { } |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index d1cdd2d28409..875ff451842b 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -125,6 +125,9 @@ | |||
125 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c | 125 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c |
126 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d | 126 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d |
127 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e | 127 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e |
128 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
129 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
130 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
128 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 | 131 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 |
129 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a | 132 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a |
130 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b | 133 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b |
@@ -518,6 +521,9 @@ | |||
518 | #define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 | 521 | #define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 |
519 | #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL 0x0007 | 522 | #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL 0x0007 |
520 | 523 | ||
524 | #define USB_VENDOR_ID_MADCATZ 0x0738 | ||
525 | #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 | ||
526 | |||
521 | #define USB_VENDOR_ID_MCC 0x09db | 527 | #define USB_VENDOR_ID_MCC 0x09db |
522 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 | 528 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 |
523 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a | 529 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index e7701d99f8e8..f1de3979181f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -2341,7 +2341,7 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
2341 | 2341 | ||
2342 | /* Start monitoring */ | 2342 | /* Start monitoring */ |
2343 | it87_write_value(data, IT87_REG_CONFIG, | 2343 | it87_write_value(data, IT87_REG_CONFIG, |
2344 | (it87_read_value(data, IT87_REG_CONFIG) & 0x36) | 2344 | (it87_read_value(data, IT87_REG_CONFIG) & 0x3e) |
2345 | | (update_vbat ? 0x41 : 0x01)); | 2345 | | (update_vbat ? 0x41 : 0x01)); |
2346 | } | 2346 | } |
2347 | 2347 | ||
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index ee16fb67b7ae..83811e45d633 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -142,6 +142,7 @@ static const struct xpad_device { | |||
142 | { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, | 142 | { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, |
143 | { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, | 143 | { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, |
144 | { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, | 144 | { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, |
145 | { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, | ||
145 | { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, | 146 | { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, |
146 | { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, | 147 | { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, |
147 | { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, | 148 | { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, |
@@ -164,6 +165,7 @@ static const struct xpad_device { | |||
164 | { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | 165 | { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, |
165 | { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | 166 | { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
166 | { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | 167 | { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
168 | { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | ||
167 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, | 169 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, |
168 | { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } | 170 | { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } |
169 | }; | 171 | }; |
@@ -238,12 +240,14 @@ static struct usb_device_id xpad_table [] = { | |||
238 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ | 240 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ |
239 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ | 241 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ |
240 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ | 242 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ |
243 | { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ | ||
241 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ | 244 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ |
242 | XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ | 245 | XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ |
243 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ | 246 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ |
244 | XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ | 247 | XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ |
245 | XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ | 248 | XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ |
246 | XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ | 249 | XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ |
250 | XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ | ||
247 | { } | 251 | { } |
248 | }; | 252 | }; |
249 | 253 | ||
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 2cf681d98c0d..d528c23e194f 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -79,6 +79,10 @@ | |||
79 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 | 79 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 |
80 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 | 80 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 |
81 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 | 81 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 |
82 | /* MacbookPro10,1 (unibody, June 2012) */ | ||
83 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
84 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
85 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
82 | 86 | ||
83 | #define BCM5974_DEVICE(prod) { \ | 87 | #define BCM5974_DEVICE(prod) { \ |
84 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | 88 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ |
@@ -128,6 +132,10 @@ static const struct usb_device_id bcm5974_table[] = { | |||
128 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), | 132 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), |
129 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), | 133 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), |
130 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | 134 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), |
135 | /* MacbookPro10,1 */ | ||
136 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
137 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
138 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
131 | /* Terminating entry */ | 139 | /* Terminating entry */ |
132 | {} | 140 | {} |
133 | }; | 141 | }; |
@@ -354,6 +362,18 @@ static const struct bcm5974_config bcm5974_config_table[] = { | |||
354 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, | 362 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, |
355 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } | 363 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } |
356 | }, | 364 | }, |
365 | { | ||
366 | USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI, | ||
367 | USB_DEVICE_ID_APPLE_WELLSPRING7_ISO, | ||
368 | USB_DEVICE_ID_APPLE_WELLSPRING7_JIS, | ||
369 | HAS_INTEGRATED_BUTTON, | ||
370 | 0x84, sizeof(struct bt_data), | ||
371 | 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
372 | { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, | ||
373 | { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, | ||
374 | { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, | ||
375 | { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } | ||
376 | }, | ||
357 | {} | 377 | {} |
358 | }; | 378 | }; |
359 | 379 | ||
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 00a67326c193..39eab73b01ae 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -243,6 +243,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
243 | if (minor == MAX_DVB_MINORS) { | 243 | if (minor == MAX_DVB_MINORS) { |
244 | kfree(dvbdevfops); | 244 | kfree(dvbdevfops); |
245 | kfree(dvbdev); | 245 | kfree(dvbdev); |
246 | up_write(&minor_rwsem); | ||
246 | mutex_unlock(&dvbdev_register_lock); | 247 | mutex_unlock(&dvbdev_register_lock); |
247 | return -EINVAL; | 248 | return -EINVAL; |
248 | } | 249 | } |
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 342c2c8c1ddf..54ee34872d14 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -232,7 +232,7 @@ MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver"); | |||
232 | 232 | ||
233 | static bool txandrx; /* default = 0 */ | 233 | static bool txandrx; /* default = 0 */ |
234 | module_param(txandrx, bool, 0444); | 234 | module_param(txandrx, bool, 0444); |
235 | MODULE_PARM_DESC(invert, "Allow simultaneous TX and RX"); | 235 | MODULE_PARM_DESC(txandrx, "Allow simultaneous TX and RX"); |
236 | 236 | ||
237 | static unsigned int wake_sc = 0x800F040C; | 237 | static unsigned int wake_sc = 0x800F040C; |
238 | module_param(wake_sc, uint, 0644); | 238 | module_param(wake_sc, uint, 0644); |
@@ -1032,6 +1032,8 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1032 | data->dev->tx_ir = wbcir_tx; | 1032 | data->dev->tx_ir = wbcir_tx; |
1033 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
1034 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
1035 | data->dev->timeout = MS_TO_NS(100); | ||
1036 | data->dev->allowed_protos = RC_TYPE_ALL; | ||
1035 | 1037 | ||
1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | 1038 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { |
1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | 1039 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", |
diff --git a/drivers/media/video/cx231xx/cx231xx-audio.c b/drivers/media/video/cx231xx/cx231xx-audio.c index 068f78dc5d13..b4c99c7270cf 100644 --- a/drivers/media/video/cx231xx/cx231xx-audio.c +++ b/drivers/media/video/cx231xx/cx231xx-audio.c | |||
@@ -307,7 +307,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev) | |||
307 | urb->context = dev; | 307 | urb->context = dev; |
308 | urb->pipe = usb_rcvisocpipe(dev->udev, | 308 | urb->pipe = usb_rcvisocpipe(dev->udev, |
309 | dev->adev.end_point_addr); | 309 | dev->adev.end_point_addr); |
310 | urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 310 | urb->transfer_flags = URB_ISO_ASAP; |
311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
312 | urb->interval = 1; | 312 | urb->interval = 1; |
313 | urb->complete = cx231xx_audio_isocirq; | 313 | urb->complete = cx231xx_audio_isocirq; |
@@ -368,7 +368,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev) | |||
368 | urb->context = dev; | 368 | urb->context = dev; |
369 | urb->pipe = usb_rcvbulkpipe(dev->udev, | 369 | urb->pipe = usb_rcvbulkpipe(dev->udev, |
370 | dev->adev.end_point_addr); | 370 | dev->adev.end_point_addr); |
371 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 371 | urb->transfer_flags = 0; |
372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
373 | urb->complete = cx231xx_audio_bulkirq; | 373 | urb->complete = cx231xx_audio_bulkirq; |
374 | urb->transfer_buffer_length = sb_size; | 374 | urb->transfer_buffer_length = sb_size; |
diff --git a/drivers/media/video/cx231xx/cx231xx-vbi.c b/drivers/media/video/cx231xx/cx231xx-vbi.c index 3d15314e1f88..ac7db52f404f 100644 --- a/drivers/media/video/cx231xx/cx231xx-vbi.c +++ b/drivers/media/video/cx231xx/cx231xx-vbi.c | |||
@@ -448,7 +448,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets, | |||
448 | return -ENOMEM; | 448 | return -ENOMEM; |
449 | } | 449 | } |
450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; | 450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; |
451 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 451 | urb->transfer_flags = 0; |
452 | 452 | ||
453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = | 453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = |
454 | kzalloc(sb_size, GFP_KERNEL); | 454 | kzalloc(sb_size, GFP_KERNEL); |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 13739e002a63..080e11157e5f 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -127,22 +127,37 @@ struct cx23885_board cx23885_boards[] = { | |||
127 | }, | 127 | }, |
128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { | 128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { |
129 | .name = "Hauppauge WinTV-HVR1250", | 129 | .name = "Hauppauge WinTV-HVR1250", |
130 | .porta = CX23885_ANALOG_VIDEO, | ||
130 | .portc = CX23885_MPEG_DVB, | 131 | .portc = CX23885_MPEG_DVB, |
132 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
133 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
134 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
135 | .tuner_bus = 1, | ||
136 | #endif | ||
137 | .force_bff = 1, | ||
131 | .input = {{ | 138 | .input = {{ |
139 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
132 | .type = CX23885_VMUX_TELEVISION, | 140 | .type = CX23885_VMUX_TELEVISION, |
133 | .vmux = 0, | 141 | .vmux = CX25840_VIN7_CH3 | |
142 | CX25840_VIN5_CH2 | | ||
143 | CX25840_VIN2_CH1, | ||
144 | .amux = CX25840_AUDIO8, | ||
134 | .gpio0 = 0xff00, | 145 | .gpio0 = 0xff00, |
135 | }, { | 146 | }, { |
136 | .type = CX23885_VMUX_DEBUG, | 147 | #endif |
137 | .vmux = 0, | ||
138 | .gpio0 = 0xff01, | ||
139 | }, { | ||
140 | .type = CX23885_VMUX_COMPOSITE1, | 148 | .type = CX23885_VMUX_COMPOSITE1, |
141 | .vmux = 1, | 149 | .vmux = CX25840_VIN7_CH3 | |
150 | CX25840_VIN4_CH2 | | ||
151 | CX25840_VIN6_CH1, | ||
152 | .amux = CX25840_AUDIO7, | ||
142 | .gpio0 = 0xff02, | 153 | .gpio0 = 0xff02, |
143 | }, { | 154 | }, { |
144 | .type = CX23885_VMUX_SVIDEO, | 155 | .type = CX23885_VMUX_SVIDEO, |
145 | .vmux = 2, | 156 | .vmux = CX25840_VIN7_CH3 | |
157 | CX25840_VIN4_CH2 | | ||
158 | CX25840_VIN8_CH1 | | ||
159 | CX25840_SVIDEO_ON, | ||
160 | .amux = CX25840_AUDIO7, | ||
146 | .gpio0 = 0xff02, | 161 | .gpio0 = 0xff02, |
147 | } }, | 162 | } }, |
148 | }, | 163 | }, |
@@ -267,7 +282,55 @@ struct cx23885_board cx23885_boards[] = { | |||
267 | }, | 282 | }, |
268 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { | 283 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { |
269 | .name = "Hauppauge WinTV-HVR1255", | 284 | .name = "Hauppauge WinTV-HVR1255", |
285 | .porta = CX23885_ANALOG_VIDEO, | ||
286 | .portc = CX23885_MPEG_DVB, | ||
287 | .tuner_type = TUNER_ABSENT, | ||
288 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
289 | .force_bff = 1, | ||
290 | .input = {{ | ||
291 | .type = CX23885_VMUX_TELEVISION, | ||
292 | .vmux = CX25840_VIN7_CH3 | | ||
293 | CX25840_VIN5_CH2 | | ||
294 | CX25840_VIN2_CH1 | | ||
295 | CX25840_DIF_ON, | ||
296 | .amux = CX25840_AUDIO8, | ||
297 | }, { | ||
298 | .type = CX23885_VMUX_COMPOSITE1, | ||
299 | .vmux = CX25840_VIN7_CH3 | | ||
300 | CX25840_VIN4_CH2 | | ||
301 | CX25840_VIN6_CH1, | ||
302 | .amux = CX25840_AUDIO7, | ||
303 | }, { | ||
304 | .type = CX23885_VMUX_SVIDEO, | ||
305 | .vmux = CX25840_VIN7_CH3 | | ||
306 | CX25840_VIN4_CH2 | | ||
307 | CX25840_VIN8_CH1 | | ||
308 | CX25840_SVIDEO_ON, | ||
309 | .amux = CX25840_AUDIO7, | ||
310 | } }, | ||
311 | }, | ||
312 | [CX23885_BOARD_HAUPPAUGE_HVR1255_22111] = { | ||
313 | .name = "Hauppauge WinTV-HVR1255", | ||
314 | .porta = CX23885_ANALOG_VIDEO, | ||
270 | .portc = CX23885_MPEG_DVB, | 315 | .portc = CX23885_MPEG_DVB, |
316 | .tuner_type = TUNER_ABSENT, | ||
317 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
318 | .force_bff = 1, | ||
319 | .input = {{ | ||
320 | .type = CX23885_VMUX_TELEVISION, | ||
321 | .vmux = CX25840_VIN7_CH3 | | ||
322 | CX25840_VIN5_CH2 | | ||
323 | CX25840_VIN2_CH1 | | ||
324 | CX25840_DIF_ON, | ||
325 | .amux = CX25840_AUDIO8, | ||
326 | }, { | ||
327 | .type = CX23885_VMUX_SVIDEO, | ||
328 | .vmux = CX25840_VIN7_CH3 | | ||
329 | CX25840_VIN4_CH2 | | ||
330 | CX25840_VIN8_CH1 | | ||
331 | CX25840_SVIDEO_ON, | ||
332 | .amux = CX25840_AUDIO7, | ||
333 | } }, | ||
271 | }, | 334 | }, |
272 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { | 335 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { |
273 | .name = "Hauppauge WinTV-HVR1210", | 336 | .name = "Hauppauge WinTV-HVR1210", |
@@ -624,7 +687,7 @@ struct cx23885_subid cx23885_subids[] = { | |||
624 | }, { | 687 | }, { |
625 | .subvendor = 0x0070, | 688 | .subvendor = 0x0070, |
626 | .subdevice = 0x2259, | 689 | .subdevice = 0x2259, |
627 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, | 690 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255_22111, |
628 | }, { | 691 | }, { |
629 | .subvendor = 0x0070, | 692 | .subvendor = 0x0070, |
630 | .subdevice = 0x2291, | 693 | .subdevice = 0x2291, |
@@ -900,7 +963,7 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) | |||
900 | struct cx23885_dev *dev = port->dev; | 963 | struct cx23885_dev *dev = port->dev; |
901 | u32 bitmask = 0; | 964 | u32 bitmask = 0; |
902 | 965 | ||
903 | if (command == XC2028_RESET_CLK) | 966 | if ((command == XC2028_RESET_CLK) || (command == XC2028_I2C_FLUSH)) |
904 | return 0; | 967 | return 0; |
905 | 968 | ||
906 | if (command != 0) { | 969 | if (command != 0) { |
@@ -1130,6 +1193,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
1130 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1193 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1131 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1194 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1132 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1195 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1196 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1133 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1197 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1134 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ | 1198 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ |
1135 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ | 1199 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ |
@@ -1267,6 +1331,7 @@ int cx23885_ir_init(struct cx23885_dev *dev) | |||
1267 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | 1331 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
1268 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1332 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1269 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1333 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1334 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1270 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1335 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1271 | /* FIXME: Implement me */ | 1336 | /* FIXME: Implement me */ |
1272 | break; | 1337 | break; |
@@ -1424,6 +1489,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1424 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1489 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1425 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1490 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1426 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1491 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1492 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1427 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1493 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1428 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1494 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1429 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1495 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
@@ -1511,6 +1577,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1511 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1577 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1512 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1578 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1513 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1579 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1580 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1514 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1581 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1515 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1582 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
1516 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1583 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
@@ -1526,10 +1593,10 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1526 | */ | 1593 | */ |
1527 | switch (dev->board) { | 1594 | switch (dev->board) { |
1528 | case CX23885_BOARD_TEVII_S470: | 1595 | case CX23885_BOARD_TEVII_S470: |
1529 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
1530 | /* Currently only enabled for the integrated IR controller */ | 1596 | /* Currently only enabled for the integrated IR controller */ |
1531 | if (!enable_885_ir) | 1597 | if (!enable_885_ir) |
1532 | break; | 1598 | break; |
1599 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
1533 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 1600 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
1534 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 1601 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
1535 | case CX23885_BOARD_HAUPPAUGE_HVR1700: | 1602 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
@@ -1539,6 +1606,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1539 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: | 1606 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
1540 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: | 1607 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
1541 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1608 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
1609 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
1610 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1542 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1611 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1543 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1612 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1544 | case CX23885_BOARD_MYGICA_X8506: | 1613 | case CX23885_BOARD_MYGICA_X8506: |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index a80a92c47455..cd542684ba02 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -712,6 +712,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
712 | } | 712 | } |
713 | break; | 713 | break; |
714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
715 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
715 | i2c_bus = &dev->i2c_bus[0]; | 716 | i2c_bus = &dev->i2c_bus[0]; |
716 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 717 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
717 | &hcw_s5h1411_config, | 718 | &hcw_s5h1411_config, |
@@ -721,6 +722,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
721 | 0x60, &dev->i2c_bus[1].i2c_adap, | 722 | 0x60, &dev->i2c_bus[1].i2c_adap, |
722 | &hauppauge_tda18271_config); | 723 | &hauppauge_tda18271_config); |
723 | } | 724 | } |
725 | |||
726 | tda18271_attach(&dev->ts1.analog_fe, | ||
727 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
728 | &hauppauge_tda18271_config); | ||
729 | |||
724 | break; | 730 | break; |
725 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 731 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
726 | i2c_bus = &dev->i2c_bus[0]; | 732 | i2c_bus = &dev->i2c_bus[0]; |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index c654bdc7ccb2..22f8e7fbd665 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -505,6 +505,9 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) | |||
505 | 505 | ||
506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || | 506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || |
507 | (dev->board == CX23885_BOARD_MPX885) || | 507 | (dev->board == CX23885_BOARD_MPX885) || |
508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1250) || | ||
509 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
510 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) || | ||
508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { | 511 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { |
509 | /* Configure audio routing */ | 512 | /* Configure audio routing */ |
510 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, | 513 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, |
@@ -1578,7 +1581,9 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev, | |||
1578 | 1581 | ||
1579 | fe = vfe->dvb.frontend; | 1582 | fe = vfe->dvb.frontend; |
1580 | 1583 | ||
1581 | if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) | 1584 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) || |
1585 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
1586 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111)) | ||
1582 | fe = &dev->ts1.analog_fe; | 1587 | fe = &dev->ts1.analog_fe; |
1583 | 1588 | ||
1584 | if (fe && fe->ops.tuner_ops.set_analog_params) { | 1589 | if (fe && fe->ops.tuner_ops.set_analog_params) { |
@@ -1608,6 +1613,8 @@ int cx23885_set_frequency(struct file *file, void *priv, | |||
1608 | int ret; | 1613 | int ret; |
1609 | 1614 | ||
1610 | switch (dev->board) { | 1615 | switch (dev->board) { |
1616 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
1617 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1611 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1618 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1612 | ret = cx23885_set_freq_via_ops(dev, f); | 1619 | ret = cx23885_set_freq_via_ops(dev, f); |
1613 | break; | 1620 | break; |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index d884784a1c85..13c37ec07ae7 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -90,6 +90,7 @@ | |||
90 | #define CX23885_BOARD_MYGICA_X8507 33 | 90 | #define CX23885_BOARD_MYGICA_X8507 33 |
91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 | 91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 |
92 | #define CX23885_BOARD_TEVII_S471 35 | 92 | #define CX23885_BOARD_TEVII_S471 35 |
93 | #define CX23885_BOARD_HAUPPAUGE_HVR1255_22111 36 | ||
93 | 94 | ||
94 | #define GPIO_0 0x00000001 | 95 | #define GPIO_0 0x00000001 |
95 | #define GPIO_1 0x00000002 | 96 | #define GPIO_1 0x00000002 |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index fc1ff69cffd0..d8eac3e30a7e 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -84,7 +84,7 @@ MODULE_PARM_DESC(debug, "Debugging messages [0=Off (default) 1=On]"); | |||
84 | 84 | ||
85 | 85 | ||
86 | /* ----------------------------------------------------------------------- */ | 86 | /* ----------------------------------------------------------------------- */ |
87 | static void cx23885_std_setup(struct i2c_client *client); | 87 | static void cx23888_std_setup(struct i2c_client *client); |
88 | 88 | ||
89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) | 89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) |
90 | { | 90 | { |
@@ -638,10 +638,13 @@ static void cx23885_initialize(struct i2c_client *client) | |||
638 | finish_wait(&state->fw_wait, &wait); | 638 | finish_wait(&state->fw_wait, &wait); |
639 | destroy_workqueue(q); | 639 | destroy_workqueue(q); |
640 | 640 | ||
641 | /* Call the cx23885 specific std setup func, we no longer rely on | 641 | /* Call the cx23888 specific std setup func, we no longer rely on |
642 | * the generic cx24840 func. | 642 | * the generic cx24840 func. |
643 | */ | 643 | */ |
644 | cx23885_std_setup(client); | 644 | if (is_cx23888(state)) |
645 | cx23888_std_setup(client); | ||
646 | else | ||
647 | cx25840_std_setup(client); | ||
645 | 648 | ||
646 | /* (re)set input */ | 649 | /* (re)set input */ |
647 | set_input(client, state->vid_input, state->aud_input); | 650 | set_input(client, state->vid_input, state->aud_input); |
@@ -1103,9 +1106,23 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
1103 | 1106 | ||
1104 | cx25840_write4(client, 0x410, 0xffff0dbf); | 1107 | cx25840_write4(client, 0x410, 0xffff0dbf); |
1105 | cx25840_write4(client, 0x414, 0x00137d03); | 1108 | cx25840_write4(client, 0x414, 0x00137d03); |
1106 | cx25840_write4(client, 0x418, 0x01008080); | 1109 | |
1110 | /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is | ||
1111 | CHROMA_CTRL */ | ||
1112 | if (is_cx23888(state)) | ||
1113 | cx25840_write4(client, 0x418, 0x01008080); | ||
1114 | else | ||
1115 | cx25840_write4(client, 0x418, 0x01000000); | ||
1116 | |||
1107 | cx25840_write4(client, 0x41c, 0x00000000); | 1117 | cx25840_write4(client, 0x41c, 0x00000000); |
1108 | cx25840_write4(client, 0x420, 0x001c3e0f); | 1118 | |
1119 | /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is | ||
1120 | CRUSH_CTRL */ | ||
1121 | if (is_cx23888(state)) | ||
1122 | cx25840_write4(client, 0x420, 0x001c3e0f); | ||
1123 | else | ||
1124 | cx25840_write4(client, 0x420, 0x001c8282); | ||
1125 | |||
1109 | cx25840_write4(client, 0x42c, 0x42600000); | 1126 | cx25840_write4(client, 0x42c, 0x42600000); |
1110 | cx25840_write4(client, 0x430, 0x0000039b); | 1127 | cx25840_write4(client, 0x430, 0x0000039b); |
1111 | cx25840_write4(client, 0x438, 0x00000000); | 1128 | cx25840_write4(client, 0x438, 0x00000000); |
@@ -1233,7 +1250,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
1233 | cx25840_write4(client, 0x8d0, 0x1f063870); | 1250 | cx25840_write4(client, 0x8d0, 0x1f063870); |
1234 | } | 1251 | } |
1235 | 1252 | ||
1236 | if (is_cx2388x(state)) { | 1253 | if (is_cx23888(state)) { |
1237 | /* HVR1850 */ | 1254 | /* HVR1850 */ |
1238 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ | 1255 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ |
1239 | /* - Channel 1 src - Parallel1 (Merlin out) */ | 1256 | /* - Channel 1 src - Parallel1 (Merlin out) */ |
@@ -1298,8 +1315,8 @@ static int set_v4lstd(struct i2c_client *client) | |||
1298 | } | 1315 | } |
1299 | cx25840_and_or(client, 0x400, ~0xf, fmt); | 1316 | cx25840_and_or(client, 0x400, ~0xf, fmt); |
1300 | cx25840_and_or(client, 0x403, ~0x3, pal_m); | 1317 | cx25840_and_or(client, 0x403, ~0x3, pal_m); |
1301 | if (is_cx2388x(state)) | 1318 | if (is_cx23888(state)) |
1302 | cx23885_std_setup(client); | 1319 | cx23888_std_setup(client); |
1303 | else | 1320 | else |
1304 | cx25840_std_setup(client); | 1321 | cx25840_std_setup(client); |
1305 | if (!is_cx2583x(state)) | 1322 | if (!is_cx2583x(state)) |
@@ -1312,6 +1329,7 @@ static int set_v4lstd(struct i2c_client *client) | |||
1312 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | 1329 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) |
1313 | { | 1330 | { |
1314 | struct v4l2_subdev *sd = to_sd(ctrl); | 1331 | struct v4l2_subdev *sd = to_sd(ctrl); |
1332 | struct cx25840_state *state = to_state(sd); | ||
1315 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1333 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1316 | 1334 | ||
1317 | switch (ctrl->id) { | 1335 | switch (ctrl->id) { |
@@ -1324,12 +1342,20 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | |||
1324 | break; | 1342 | break; |
1325 | 1343 | ||
1326 | case V4L2_CID_SATURATION: | 1344 | case V4L2_CID_SATURATION: |
1327 | cx25840_write(client, 0x420, ctrl->val << 1); | 1345 | if (is_cx23888(state)) { |
1328 | cx25840_write(client, 0x421, ctrl->val << 1); | 1346 | cx25840_write(client, 0x418, ctrl->val << 1); |
1347 | cx25840_write(client, 0x419, ctrl->val << 1); | ||
1348 | } else { | ||
1349 | cx25840_write(client, 0x420, ctrl->val << 1); | ||
1350 | cx25840_write(client, 0x421, ctrl->val << 1); | ||
1351 | } | ||
1329 | break; | 1352 | break; |
1330 | 1353 | ||
1331 | case V4L2_CID_HUE: | 1354 | case V4L2_CID_HUE: |
1332 | cx25840_write(client, 0x422, ctrl->val); | 1355 | if (is_cx23888(state)) |
1356 | cx25840_write(client, 0x41a, ctrl->val); | ||
1357 | else | ||
1358 | cx25840_write(client, 0x422, ctrl->val); | ||
1333 | break; | 1359 | break; |
1334 | 1360 | ||
1335 | default: | 1361 | default: |
@@ -1354,11 +1380,21 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt | |||
1354 | fmt->field = V4L2_FIELD_INTERLACED; | 1380 | fmt->field = V4L2_FIELD_INTERLACED; |
1355 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; | 1381 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; |
1356 | 1382 | ||
1357 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | 1383 | if (is_cx23888(state)) { |
1358 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | 1384 | Vsrc = (cx25840_read(client, 0x42a) & 0x3f) << 4; |
1385 | Vsrc |= (cx25840_read(client, 0x429) & 0xf0) >> 4; | ||
1386 | } else { | ||
1387 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | ||
1388 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | ||
1389 | } | ||
1359 | 1390 | ||
1360 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | 1391 | if (is_cx23888(state)) { |
1361 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | 1392 | Hsrc = (cx25840_read(client, 0x426) & 0x3f) << 4; |
1393 | Hsrc |= (cx25840_read(client, 0x425) & 0xf0) >> 4; | ||
1394 | } else { | ||
1395 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | ||
1396 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | ||
1397 | } | ||
1362 | 1398 | ||
1363 | Vlines = fmt->height + (is_50Hz ? 4 : 7); | 1399 | Vlines = fmt->height + (is_50Hz ? 4 : 7); |
1364 | 1400 | ||
@@ -1782,8 +1818,8 @@ static int cx25840_s_video_routing(struct v4l2_subdev *sd, | |||
1782 | struct cx25840_state *state = to_state(sd); | 1818 | struct cx25840_state *state = to_state(sd); |
1783 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1819 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1784 | 1820 | ||
1785 | if (is_cx2388x(state)) | 1821 | if (is_cx23888(state)) |
1786 | cx23885_std_setup(client); | 1822 | cx23888_std_setup(client); |
1787 | 1823 | ||
1788 | return set_input(client, input, state->aud_input); | 1824 | return set_input(client, input, state->aud_input); |
1789 | } | 1825 | } |
@@ -1794,8 +1830,8 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd, | |||
1794 | struct cx25840_state *state = to_state(sd); | 1830 | struct cx25840_state *state = to_state(sd); |
1795 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1831 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1796 | 1832 | ||
1797 | if (is_cx2388x(state)) | 1833 | if (is_cx23888(state)) |
1798 | cx23885_std_setup(client); | 1834 | cx23888_std_setup(client); |
1799 | return set_input(client, state->vid_input, input); | 1835 | return set_input(client, state->vid_input, input); |
1800 | } | 1836 | } |
1801 | 1837 | ||
@@ -4939,7 +4975,7 @@ void cx23885_dif_setup(struct i2c_client *client, u32 ifHz) | |||
4939 | } | 4975 | } |
4940 | } | 4976 | } |
4941 | 4977 | ||
4942 | static void cx23885_std_setup(struct i2c_client *client) | 4978 | static void cx23888_std_setup(struct i2c_client *client) |
4943 | { | 4979 | { |
4944 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); | 4980 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); |
4945 | v4l2_std_id std = state->std; | 4981 | v4l2_std_id std = state->std; |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 92da7c28b6f0..862c6575c557 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -2893,7 +2893,7 @@ static void request_module_async(struct work_struct *work) | |||
2893 | 2893 | ||
2894 | if (dev->board.has_dvb) | 2894 | if (dev->board.has_dvb) |
2895 | request_module("em28xx-dvb"); | 2895 | request_module("em28xx-dvb"); |
2896 | if (dev->board.has_ir_i2c && !disable_ir) | 2896 | if (dev->board.ir_codes && !disable_ir) |
2897 | request_module("em28xx-rc"); | 2897 | request_module("em28xx-rc"); |
2898 | } | 2898 | } |
2899 | 2899 | ||
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 41f9a254b245..637bde8aca28 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -83,6 +83,7 @@ | |||
83 | #define CSICR1_INV_DATA (1 << 3) | 83 | #define CSICR1_INV_DATA (1 << 3) |
84 | #define CSICR1_INV_PCLK (1 << 2) | 84 | #define CSICR1_INV_PCLK (1 << 2) |
85 | #define CSICR1_REDGE (1 << 1) | 85 | #define CSICR1_REDGE (1 << 1) |
86 | #define CSICR1_FMT_MASK (CSICR1_PACK_DIR | CSICR1_SWAP16_EN) | ||
86 | 87 | ||
87 | #define SHIFT_STATFF_LEVEL 22 | 88 | #define SHIFT_STATFF_LEVEL 22 |
88 | #define SHIFT_RXFF_LEVEL 19 | 89 | #define SHIFT_RXFF_LEVEL 19 |
@@ -230,6 +231,7 @@ struct mx2_prp_cfg { | |||
230 | u32 src_pixel; | 231 | u32 src_pixel; |
231 | u32 ch1_pixel; | 232 | u32 ch1_pixel; |
232 | u32 irq_flags; | 233 | u32 irq_flags; |
234 | u32 csicr1; | ||
233 | }; | 235 | }; |
234 | 236 | ||
235 | /* prp resizing parameters */ | 237 | /* prp resizing parameters */ |
@@ -330,6 +332,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
330 | .ch1_pixel = 0x2ca00565, /* RGB565 */ | 332 | .ch1_pixel = 0x2ca00565, /* RGB565 */ |
331 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH1WERR | | 333 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH1WERR | |
332 | PRP_INTR_CH1FC | PRP_INTR_LBOVF, | 334 | PRP_INTR_CH1FC | PRP_INTR_LBOVF, |
335 | .csicr1 = 0, | ||
333 | } | 336 | } |
334 | }, | 337 | }, |
335 | { | 338 | { |
@@ -343,6 +346,21 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
343 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | 346 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | |
344 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | 347 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | |
345 | PRP_INTR_CH2OVF, | 348 | PRP_INTR_CH2OVF, |
349 | .csicr1 = CSICR1_PACK_DIR, | ||
350 | } | ||
351 | }, | ||
352 | { | ||
353 | .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, | ||
354 | .out_fmt = V4L2_PIX_FMT_YUV420, | ||
355 | .cfg = { | ||
356 | .channel = 2, | ||
357 | .in_fmt = PRP_CNTL_DATA_IN_YUV422, | ||
358 | .out_fmt = PRP_CNTL_CH2_OUT_YUV420, | ||
359 | .src_pixel = 0x22000888, /* YUV422 (YUYV) */ | ||
360 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | ||
361 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | ||
362 | PRP_INTR_CH2OVF, | ||
363 | .csicr1 = CSICR1_SWAP16_EN, | ||
346 | } | 364 | } |
347 | }, | 365 | }, |
348 | }; | 366 | }; |
@@ -1015,14 +1033,14 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1015 | return ret; | 1033 | return ret; |
1016 | } | 1034 | } |
1017 | 1035 | ||
1036 | csicr1 = (csicr1 & ~CSICR1_FMT_MASK) | pcdev->emma_prp->cfg.csicr1; | ||
1037 | |||
1018 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) | 1038 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) |
1019 | csicr1 |= CSICR1_REDGE; | 1039 | csicr1 |= CSICR1_REDGE; |
1020 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) | 1040 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) |
1021 | csicr1 |= CSICR1_SOF_POL; | 1041 | csicr1 |= CSICR1_SOF_POL; |
1022 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) | 1042 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) |
1023 | csicr1 |= CSICR1_HSYNC_POL; | 1043 | csicr1 |= CSICR1_HSYNC_POL; |
1024 | if (pcdev->platform_flags & MX2_CAMERA_SWAP16) | ||
1025 | csicr1 |= CSICR1_SWAP16_EN; | ||
1026 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) | 1044 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) |
1027 | csicr1 |= CSICR1_EXT_VSYNC; | 1045 | csicr1 |= CSICR1_EXT_VSYNC; |
1028 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) | 1046 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) |
@@ -1033,8 +1051,6 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1033 | csicr1 |= CSICR1_GCLK_MODE; | 1051 | csicr1 |= CSICR1_GCLK_MODE; |
1034 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) | 1052 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) |
1035 | csicr1 |= CSICR1_INV_DATA; | 1053 | csicr1 |= CSICR1_INV_DATA; |
1036 | if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB) | ||
1037 | csicr1 |= CSICR1_PACK_DIR; | ||
1038 | 1054 | ||
1039 | pcdev->csicr1 = csicr1; | 1055 | pcdev->csicr1 = csicr1; |
1040 | 1056 | ||
@@ -1109,7 +1125,8 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1109 | return 0; | 1125 | return 0; |
1110 | } | 1126 | } |
1111 | 1127 | ||
1112 | if (code == V4L2_MBUS_FMT_YUYV8_2X8) { | 1128 | if (code == V4L2_MBUS_FMT_YUYV8_2X8 || |
1129 | code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1113 | formats++; | 1130 | formats++; |
1114 | if (xlate) { | 1131 | if (xlate) { |
1115 | /* | 1132 | /* |
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c index 8a4935ecc655..dd91da26f1b0 100644 --- a/drivers/media/video/omap3isp/isppreview.c +++ b/drivers/media/video/omap3isp/isppreview.c | |||
@@ -888,12 +888,12 @@ static const struct preview_update update_attrs[] = { | |||
888 | preview_config_contrast, | 888 | preview_config_contrast, |
889 | NULL, | 889 | NULL, |
890 | offsetof(struct prev_params, contrast), | 890 | offsetof(struct prev_params, contrast), |
891 | 0, true, | 891 | 0, 0, true, |
892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { | 892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { |
893 | preview_config_brightness, | 893 | preview_config_brightness, |
894 | NULL, | 894 | NULL, |
895 | offsetof(struct prev_params, brightness), | 895 | offsetof(struct prev_params, brightness), |
896 | 0, true, | 896 | 0, 0, true, |
897 | }, | 897 | }, |
898 | }; | 898 | }; |
899 | 899 | ||
@@ -1102,7 +1102,7 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active) | |||
1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; | 1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; |
1103 | u32 features; | 1103 | u32 features; |
1104 | 1104 | ||
1105 | if (format->code == V4L2_MBUS_FMT_Y10_1X10) { | 1105 | if (format->code != V4L2_MBUS_FMT_Y10_1X10) { |
1106 | sph -= 2; | 1106 | sph -= 2; |
1107 | eph += 2; | 1107 | eph += 2; |
1108 | slv -= 2; | 1108 | slv -= 2; |
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index c370c2d87c17..b4c679b3fb0f 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 354574591908..725812aa0c30 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
@@ -350,7 +350,8 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, | |||
350 | if (pixm) | 350 | if (pixm) |
351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); | 351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); |
352 | else | 352 | else |
353 | sizes[i] = size; | 353 | sizes[i] = max_t(u32, size, frame->payload[i]); |
354 | |||
354 | allocators[i] = ctx->fimc_dev->alloc_ctx; | 355 | allocators[i] = ctx->fimc_dev->alloc_ctx; |
355 | } | 356 | } |
356 | 357 | ||
@@ -479,37 +480,39 @@ static int fimc_capture_set_default_format(struct fimc_dev *fimc); | |||
479 | static int fimc_capture_open(struct file *file) | 480 | static int fimc_capture_open(struct file *file) |
480 | { | 481 | { |
481 | struct fimc_dev *fimc = video_drvdata(file); | 482 | struct fimc_dev *fimc = video_drvdata(file); |
482 | int ret = v4l2_fh_open(file); | 483 | int ret; |
483 | |||
484 | if (ret) | ||
485 | return ret; | ||
486 | 484 | ||
487 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); | 485 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); |
488 | 486 | ||
489 | /* Return if the corresponding video mem2mem node is already opened. */ | ||
490 | if (fimc_m2m_active(fimc)) | 487 | if (fimc_m2m_active(fimc)) |
491 | return -EBUSY; | 488 | return -EBUSY; |
492 | 489 | ||
493 | set_bit(ST_CAPT_BUSY, &fimc->state); | 490 | set_bit(ST_CAPT_BUSY, &fimc->state); |
494 | pm_runtime_get_sync(&fimc->pdev->dev); | 491 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
492 | if (ret < 0) | ||
493 | return ret; | ||
495 | 494 | ||
496 | if (++fimc->vid_cap.refcnt == 1) { | 495 | ret = v4l2_fh_open(file); |
497 | ret = fimc_pipeline_initialize(&fimc->pipeline, | 496 | if (ret) |
498 | &fimc->vid_cap.vfd->entity, true); | 497 | return ret; |
499 | if (ret < 0) { | ||
500 | dev_err(&fimc->pdev->dev, | ||
501 | "Video pipeline initialization failed\n"); | ||
502 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
503 | fimc->vid_cap.refcnt--; | ||
504 | v4l2_fh_release(file); | ||
505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
506 | return ret; | ||
507 | } | ||
508 | ret = fimc_capture_ctrls_create(fimc); | ||
509 | 498 | ||
510 | if (!ret && !fimc->vid_cap.user_subdev_api) | 499 | if (++fimc->vid_cap.refcnt != 1) |
511 | ret = fimc_capture_set_default_format(fimc); | 500 | return 0; |
501 | |||
502 | ret = fimc_pipeline_initialize(&fimc->pipeline, | ||
503 | &fimc->vid_cap.vfd->entity, true); | ||
504 | if (ret < 0) { | ||
505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
506 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
507 | fimc->vid_cap.refcnt--; | ||
508 | v4l2_fh_release(file); | ||
509 | return ret; | ||
512 | } | 510 | } |
511 | ret = fimc_capture_ctrls_create(fimc); | ||
512 | |||
513 | if (!ret && !fimc->vid_cap.user_subdev_api) | ||
514 | ret = fimc_capture_set_default_format(fimc); | ||
515 | |||
513 | return ret; | 516 | return ret; |
514 | } | 517 | } |
515 | 518 | ||
@@ -818,9 +821,6 @@ static int fimc_cap_g_fmt_mplane(struct file *file, void *fh, | |||
818 | struct fimc_dev *fimc = video_drvdata(file); | 821 | struct fimc_dev *fimc = video_drvdata(file); |
819 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; | 822 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; |
820 | 823 | ||
821 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
822 | return -EINVAL; | ||
823 | |||
824 | return fimc_fill_format(&ctx->d_frame, f); | 824 | return fimc_fill_format(&ctx->d_frame, f); |
825 | } | 825 | } |
826 | 826 | ||
@@ -833,9 +833,6 @@ static int fimc_cap_try_fmt_mplane(struct file *file, void *fh, | |||
833 | struct v4l2_mbus_framefmt mf; | 833 | struct v4l2_mbus_framefmt mf; |
834 | struct fimc_fmt *ffmt = NULL; | 834 | struct fimc_fmt *ffmt = NULL; |
835 | 835 | ||
836 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
837 | return -EINVAL; | ||
838 | |||
839 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { | 836 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { |
840 | fimc_capture_try_format(ctx, &pix->width, &pix->height, | 837 | fimc_capture_try_format(ctx, &pix->width, &pix->height, |
841 | NULL, &pix->pixelformat, | 838 | NULL, &pix->pixelformat, |
@@ -887,8 +884,6 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
887 | struct fimc_fmt *s_fmt = NULL; | 884 | struct fimc_fmt *s_fmt = NULL; |
888 | int ret, i; | 885 | int ret, i; |
889 | 886 | ||
890 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
891 | return -EINVAL; | ||
892 | if (vb2_is_busy(&fimc->vid_cap.vbq)) | 887 | if (vb2_is_busy(&fimc->vid_cap.vbq)) |
893 | return -EBUSY; | 888 | return -EBUSY; |
894 | 889 | ||
@@ -924,10 +919,10 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
924 | pix->width = mf->width; | 919 | pix->width = mf->width; |
925 | pix->height = mf->height; | 920 | pix->height = mf->height; |
926 | } | 921 | } |
922 | |||
927 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); | 923 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); |
928 | for (i = 0; i < ff->fmt->colplanes; i++) | 924 | for (i = 0; i < ff->fmt->colplanes; i++) |
929 | ff->payload[i] = | 925 | ff->payload[i] = pix->plane_fmt[i].sizeimage; |
930 | (pix->width * pix->height * ff->fmt->depth[i]) / 8; | ||
931 | 926 | ||
932 | set_frame_bounds(ff, pix->width, pix->height); | 927 | set_frame_bounds(ff, pix->width, pix->height); |
933 | /* Reset the composition rectangle if not yet configured */ | 928 | /* Reset the composition rectangle if not yet configured */ |
@@ -1045,18 +1040,22 @@ static int fimc_cap_streamon(struct file *file, void *priv, | |||
1045 | { | 1040 | { |
1046 | struct fimc_dev *fimc = video_drvdata(file); | 1041 | struct fimc_dev *fimc = video_drvdata(file); |
1047 | struct fimc_pipeline *p = &fimc->pipeline; | 1042 | struct fimc_pipeline *p = &fimc->pipeline; |
1043 | struct v4l2_subdev *sd = p->subdevs[IDX_SENSOR]; | ||
1048 | int ret; | 1044 | int ret; |
1049 | 1045 | ||
1050 | if (fimc_capture_active(fimc)) | 1046 | if (fimc_capture_active(fimc)) |
1051 | return -EBUSY; | 1047 | return -EBUSY; |
1052 | 1048 | ||
1053 | media_entity_pipeline_start(&p->subdevs[IDX_SENSOR]->entity, | 1049 | ret = media_entity_pipeline_start(&sd->entity, p->m_pipeline); |
1054 | p->m_pipeline); | 1050 | if (ret < 0) |
1051 | return ret; | ||
1055 | 1052 | ||
1056 | if (fimc->vid_cap.user_subdev_api) { | 1053 | if (fimc->vid_cap.user_subdev_api) { |
1057 | ret = fimc_pipeline_validate(fimc); | 1054 | ret = fimc_pipeline_validate(fimc); |
1058 | if (ret) | 1055 | if (ret < 0) { |
1056 | media_entity_pipeline_stop(&sd->entity); | ||
1059 | return ret; | 1057 | return ret; |
1058 | } | ||
1060 | } | 1059 | } |
1061 | return vb2_streamon(&fimc->vid_cap.vbq, type); | 1060 | return vb2_streamon(&fimc->vid_cap.vbq, type); |
1062 | } | 1061 | } |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index 92fc5a20fb76..a4646ca1d56f 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
@@ -153,7 +153,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
153 | .colplanes = 2, | 153 | .colplanes = 2, |
154 | .flags = FMT_FLAGS_M2M, | 154 | .flags = FMT_FLAGS_M2M, |
155 | }, { | 155 | }, { |
156 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr", | 156 | .name = "YUV 4:2:0 non-contig. 2p, Y/CbCr", |
157 | .fourcc = V4L2_PIX_FMT_NV12M, | 157 | .fourcc = V4L2_PIX_FMT_NV12M, |
158 | .color = FIMC_FMT_YCBCR420, | 158 | .color = FIMC_FMT_YCBCR420, |
159 | .depth = { 8, 4 }, | 159 | .depth = { 8, 4 }, |
@@ -161,7 +161,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
161 | .colplanes = 2, | 161 | .colplanes = 2, |
162 | .flags = FMT_FLAGS_M2M, | 162 | .flags = FMT_FLAGS_M2M, |
163 | }, { | 163 | }, { |
164 | .name = "YUV 4:2:0 non-contiguous 3-planar, Y/Cb/Cr", | 164 | .name = "YUV 4:2:0 non-contig. 3p, Y/Cb/Cr", |
165 | .fourcc = V4L2_PIX_FMT_YUV420M, | 165 | .fourcc = V4L2_PIX_FMT_YUV420M, |
166 | .color = FIMC_FMT_YCBCR420, | 166 | .color = FIMC_FMT_YCBCR420, |
167 | .depth = { 8, 2, 2 }, | 167 | .depth = { 8, 2, 2 }, |
@@ -169,7 +169,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
169 | .colplanes = 3, | 169 | .colplanes = 3, |
170 | .flags = FMT_FLAGS_M2M, | 170 | .flags = FMT_FLAGS_M2M, |
171 | }, { | 171 | }, { |
172 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr, tiled", | 172 | .name = "YUV 4:2:0 non-contig. 2p, tiled", |
173 | .fourcc = V4L2_PIX_FMT_NV12MT, | 173 | .fourcc = V4L2_PIX_FMT_NV12MT, |
174 | .color = FIMC_FMT_YCBCR420, | 174 | .color = FIMC_FMT_YCBCR420, |
175 | .depth = { 8, 4 }, | 175 | .depth = { 8, 4 }, |
@@ -641,7 +641,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
641 | if (!ctrls->ready) | 641 | if (!ctrls->ready) |
642 | return; | 642 | return; |
643 | 643 | ||
644 | mutex_lock(&ctrls->handler.lock); | 644 | mutex_lock(ctrls->handler.lock); |
645 | v4l2_ctrl_activate(ctrls->rotate, active); | 645 | v4l2_ctrl_activate(ctrls->rotate, active); |
646 | v4l2_ctrl_activate(ctrls->hflip, active); | 646 | v4l2_ctrl_activate(ctrls->hflip, active); |
647 | v4l2_ctrl_activate(ctrls->vflip, active); | 647 | v4l2_ctrl_activate(ctrls->vflip, active); |
@@ -660,7 +660,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
660 | ctx->hflip = 0; | 660 | ctx->hflip = 0; |
661 | ctx->vflip = 0; | 661 | ctx->vflip = 0; |
662 | } | 662 | } |
663 | mutex_unlock(&ctrls->handler.lock); | 663 | mutex_unlock(ctrls->handler.lock); |
664 | } | 664 | } |
665 | 665 | ||
666 | /* Update maximum value of the alpha color control */ | 666 | /* Update maximum value of the alpha color control */ |
@@ -741,8 +741,8 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
741 | pix->width = width; | 741 | pix->width = width; |
742 | 742 | ||
743 | for (i = 0; i < pix->num_planes; ++i) { | 743 | for (i = 0; i < pix->num_planes; ++i) { |
744 | u32 bpl = pix->plane_fmt[i].bytesperline; | 744 | struct v4l2_plane_pix_format *plane_fmt = &pix->plane_fmt[i]; |
745 | u32 *sizeimage = &pix->plane_fmt[i].sizeimage; | 745 | u32 bpl = plane_fmt->bytesperline; |
746 | 746 | ||
747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) | 747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) |
748 | bpl = pix->width; /* Planar */ | 748 | bpl = pix->width; /* Planar */ |
@@ -754,8 +754,9 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
754 | if (i == 0) /* Same bytesperline for each plane. */ | 754 | if (i == 0) /* Same bytesperline for each plane. */ |
755 | bytesperline = bpl; | 755 | bytesperline = bpl; |
756 | 756 | ||
757 | pix->plane_fmt[i].bytesperline = bytesperline; | 757 | plane_fmt->bytesperline = bytesperline; |
758 | *sizeimage = (pix->width * pix->height * fmt->depth[i]) / 8; | 758 | plane_fmt->sizeimage = max((pix->width * pix->height * |
759 | fmt->depth[i]) / 8, plane_fmt->sizeimage); | ||
759 | } | 760 | } |
760 | } | 761 | } |
761 | 762 | ||
diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c index 400d701aef04..74ff310db30c 100644 --- a/drivers/media/video/s5p-fimc/fimc-lite.c +++ b/drivers/media/video/s5p-fimc/fimc-lite.c | |||
@@ -451,34 +451,44 @@ static void fimc_lite_clear_event_counters(struct fimc_lite *fimc) | |||
451 | static int fimc_lite_open(struct file *file) | 451 | static int fimc_lite_open(struct file *file) |
452 | { | 452 | { |
453 | struct fimc_lite *fimc = video_drvdata(file); | 453 | struct fimc_lite *fimc = video_drvdata(file); |
454 | int ret = v4l2_fh_open(file); | 454 | int ret; |
455 | 455 | ||
456 | if (ret) | 456 | if (mutex_lock_interruptible(&fimc->lock)) |
457 | return ret; | 457 | return -ERESTARTSYS; |
458 | 458 | ||
459 | set_bit(ST_FLITE_IN_USE, &fimc->state); | 459 | set_bit(ST_FLITE_IN_USE, &fimc->state); |
460 | pm_runtime_get_sync(&fimc->pdev->dev); | 460 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
461 | if (ret < 0) | ||
462 | goto done; | ||
461 | 463 | ||
462 | if (++fimc->ref_count != 1 || fimc->out_path != FIMC_IO_DMA) | 464 | ret = v4l2_fh_open(file); |
463 | return ret; | 465 | if (ret < 0) |
466 | goto done; | ||
464 | 467 | ||
465 | ret = fimc_pipeline_initialize(&fimc->pipeline, &fimc->vfd->entity, | 468 | if (++fimc->ref_count == 1 && fimc->out_path == FIMC_IO_DMA) { |
466 | true); | 469 | ret = fimc_pipeline_initialize(&fimc->pipeline, |
467 | if (ret < 0) { | 470 | &fimc->vfd->entity, true); |
468 | v4l2_err(fimc->vfd, "Video pipeline initialization failed\n"); | 471 | if (ret < 0) { |
469 | pm_runtime_put_sync(&fimc->pdev->dev); | 472 | pm_runtime_put_sync(&fimc->pdev->dev); |
470 | fimc->ref_count--; | 473 | fimc->ref_count--; |
471 | v4l2_fh_release(file); | 474 | v4l2_fh_release(file); |
472 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 475 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
473 | } | 476 | } |
474 | 477 | ||
475 | fimc_lite_clear_event_counters(fimc); | 478 | fimc_lite_clear_event_counters(fimc); |
479 | } | ||
480 | done: | ||
481 | mutex_unlock(&fimc->lock); | ||
476 | return ret; | 482 | return ret; |
477 | } | 483 | } |
478 | 484 | ||
479 | static int fimc_lite_close(struct file *file) | 485 | static int fimc_lite_close(struct file *file) |
480 | { | 486 | { |
481 | struct fimc_lite *fimc = video_drvdata(file); | 487 | struct fimc_lite *fimc = video_drvdata(file); |
488 | int ret; | ||
489 | |||
490 | if (mutex_lock_interruptible(&fimc->lock)) | ||
491 | return -ERESTARTSYS; | ||
482 | 492 | ||
483 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { | 493 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { |
484 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 494 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
@@ -492,20 +502,39 @@ static int fimc_lite_close(struct file *file) | |||
492 | if (fimc->ref_count == 0) | 502 | if (fimc->ref_count == 0) |
493 | vb2_queue_release(&fimc->vb_queue); | 503 | vb2_queue_release(&fimc->vb_queue); |
494 | 504 | ||
495 | return v4l2_fh_release(file); | 505 | ret = v4l2_fh_release(file); |
506 | |||
507 | mutex_unlock(&fimc->lock); | ||
508 | return ret; | ||
496 | } | 509 | } |
497 | 510 | ||
498 | static unsigned int fimc_lite_poll(struct file *file, | 511 | static unsigned int fimc_lite_poll(struct file *file, |
499 | struct poll_table_struct *wait) | 512 | struct poll_table_struct *wait) |
500 | { | 513 | { |
501 | struct fimc_lite *fimc = video_drvdata(file); | 514 | struct fimc_lite *fimc = video_drvdata(file); |
502 | return vb2_poll(&fimc->vb_queue, file, wait); | 515 | int ret; |
516 | |||
517 | if (mutex_lock_interruptible(&fimc->lock)) | ||
518 | return POLL_ERR; | ||
519 | |||
520 | ret = vb2_poll(&fimc->vb_queue, file, wait); | ||
521 | mutex_unlock(&fimc->lock); | ||
522 | |||
523 | return ret; | ||
503 | } | 524 | } |
504 | 525 | ||
505 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) | 526 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) |
506 | { | 527 | { |
507 | struct fimc_lite *fimc = video_drvdata(file); | 528 | struct fimc_lite *fimc = video_drvdata(file); |
508 | return vb2_mmap(&fimc->vb_queue, vma); | 529 | int ret; |
530 | |||
531 | if (mutex_lock_interruptible(&fimc->lock)) | ||
532 | return -ERESTARTSYS; | ||
533 | |||
534 | ret = vb2_mmap(&fimc->vb_queue, vma); | ||
535 | mutex_unlock(&fimc->lock); | ||
536 | |||
537 | return ret; | ||
509 | } | 538 | } |
510 | 539 | ||
511 | static const struct v4l2_file_operations fimc_lite_fops = { | 540 | static const struct v4l2_file_operations fimc_lite_fops = { |
@@ -762,7 +791,9 @@ static int fimc_lite_streamon(struct file *file, void *priv, | |||
762 | if (fimc_lite_active(fimc)) | 791 | if (fimc_lite_active(fimc)) |
763 | return -EBUSY; | 792 | return -EBUSY; |
764 | 793 | ||
765 | media_entity_pipeline_start(&sensor->entity, p->m_pipeline); | 794 | ret = media_entity_pipeline_start(&sensor->entity, p->m_pipeline); |
795 | if (ret < 0) | ||
796 | return ret; | ||
766 | 797 | ||
767 | ret = fimc_pipeline_validate(fimc); | 798 | ret = fimc_pipeline_validate(fimc); |
768 | if (ret) { | 799 | if (ret) { |
@@ -1508,7 +1539,7 @@ static int fimc_lite_suspend(struct device *dev) | |||
1508 | return 0; | 1539 | return 0; |
1509 | 1540 | ||
1510 | ret = fimc_lite_stop_capture(fimc, suspend); | 1541 | ret = fimc_lite_stop_capture(fimc, suspend); |
1511 | if (ret) | 1542 | if (ret < 0 || !fimc_lite_active(fimc)) |
1512 | return ret; | 1543 | return ret; |
1513 | 1544 | ||
1514 | return fimc_pipeline_shutdown(&fimc->pipeline); | 1545 | return fimc_pipeline_shutdown(&fimc->pipeline); |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c index 6753c45631b8..52cef4865423 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c | |||
@@ -193,9 +193,13 @@ int __fimc_pipeline_shutdown(struct fimc_pipeline *p) | |||
193 | 193 | ||
194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) | 194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) |
195 | { | 195 | { |
196 | struct media_entity *me = &p->subdevs[IDX_SENSOR]->entity; | 196 | struct media_entity *me; |
197 | int ret; | 197 | int ret; |
198 | 198 | ||
199 | if (!p || !p->subdevs[IDX_SENSOR]) | ||
200 | return -EINVAL; | ||
201 | |||
202 | me = &p->subdevs[IDX_SENSOR]->entity; | ||
199 | mutex_lock(&me->parent->graph_mutex); | 203 | mutex_lock(&me->parent->graph_mutex); |
200 | ret = __fimc_pipeline_shutdown(p); | 204 | ret = __fimc_pipeline_shutdown(p); |
201 | mutex_unlock(&me->parent->graph_mutex); | 205 | mutex_unlock(&me->parent->graph_mutex); |
@@ -498,12 +502,12 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd) | |||
498 | * @source: the source entity to create links to all fimc entities from | 502 | * @source: the source entity to create links to all fimc entities from |
499 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null | 503 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null |
500 | * @pad: the source entity pad index | 504 | * @pad: the source entity pad index |
501 | * @fimc_id: index of the fimc device for which link should be enabled | 505 | * @link_mask: bitmask of the fimc devices for which link should be enabled |
502 | */ | 506 | */ |
503 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | 507 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, |
504 | struct media_entity *source, | 508 | struct media_entity *source, |
505 | struct v4l2_subdev *sensor, | 509 | struct v4l2_subdev *sensor, |
506 | int pad, int fimc_id) | 510 | int pad, int link_mask) |
507 | { | 511 | { |
508 | struct fimc_sensor_info *s_info; | 512 | struct fimc_sensor_info *s_info; |
509 | struct media_entity *sink; | 513 | struct media_entity *sink; |
@@ -520,7 +524,7 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
520 | if (!fmd->fimc[i]->variant->has_cam_if) | 524 | if (!fmd->fimc[i]->variant->has_cam_if) |
521 | continue; | 525 | continue; |
522 | 526 | ||
523 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 527 | flags = ((1 << i) & link_mask) ? MEDIA_LNK_FL_ENABLED : 0; |
524 | 528 | ||
525 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; | 529 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; |
526 | ret = media_entity_create_link(source, pad, sink, | 530 | ret = media_entity_create_link(source, pad, sink, |
@@ -552,7 +556,10 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
552 | if (!fmd->fimc_lite[i]) | 556 | if (!fmd->fimc_lite[i]) |
553 | continue; | 557 | continue; |
554 | 558 | ||
555 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 559 | if (link_mask & (1 << (i + FIMC_MAX_DEVS))) |
560 | flags = MEDIA_LNK_FL_ENABLED; | ||
561 | else | ||
562 | flags = 0; | ||
556 | 563 | ||
557 | sink = &fmd->fimc_lite[i]->subdev.entity; | 564 | sink = &fmd->fimc_lite[i]->subdev.entity; |
558 | ret = media_entity_create_link(source, pad, sink, | 565 | ret = media_entity_create_link(source, pad, sink, |
@@ -614,9 +621,8 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
614 | struct s5p_fimc_isp_info *pdata; | 621 | struct s5p_fimc_isp_info *pdata; |
615 | struct fimc_sensor_info *s_info; | 622 | struct fimc_sensor_info *s_info; |
616 | struct media_entity *source, *sink; | 623 | struct media_entity *source, *sink; |
617 | int i, pad, fimc_id = 0; | 624 | int i, pad, fimc_id = 0, ret = 0; |
618 | int ret = 0; | 625 | u32 flags, link_mask = 0; |
619 | u32 flags; | ||
620 | 626 | ||
621 | for (i = 0; i < fmd->num_sensors; i++) { | 627 | for (i = 0; i < fmd->num_sensors; i++) { |
622 | if (fmd->sensor[i].subdev == NULL) | 628 | if (fmd->sensor[i].subdev == NULL) |
@@ -668,19 +674,20 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
668 | if (source == NULL) | 674 | if (source == NULL) |
669 | continue; | 675 | continue; |
670 | 676 | ||
677 | link_mask = 1 << fimc_id++; | ||
671 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, | 678 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, |
672 | pad, fimc_id++); | 679 | pad, link_mask); |
673 | } | 680 | } |
674 | 681 | ||
675 | fimc_id = 0; | ||
676 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { | 682 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { |
677 | if (fmd->csis[i].sd == NULL) | 683 | if (fmd->csis[i].sd == NULL) |
678 | continue; | 684 | continue; |
679 | source = &fmd->csis[i].sd->entity; | 685 | source = &fmd->csis[i].sd->entity; |
680 | pad = CSIS_PAD_SOURCE; | 686 | pad = CSIS_PAD_SOURCE; |
681 | 687 | ||
688 | link_mask = 1 << fimc_id++; | ||
682 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, | 689 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, |
683 | pad, fimc_id++); | 690 | pad, link_mask); |
684 | } | 691 | } |
685 | 692 | ||
686 | /* Create immutable links between each FIMC's subdev and video node */ | 693 | /* Create immutable links between each FIMC's subdev and video node */ |
@@ -734,8 +741,8 @@ static void fimc_md_put_clocks(struct fimc_md *fmd) | |||
734 | } | 741 | } |
735 | 742 | ||
736 | static int __fimc_md_set_camclk(struct fimc_md *fmd, | 743 | static int __fimc_md_set_camclk(struct fimc_md *fmd, |
737 | struct fimc_sensor_info *s_info, | 744 | struct fimc_sensor_info *s_info, |
738 | bool on) | 745 | bool on) |
739 | { | 746 | { |
740 | struct s5p_fimc_isp_info *pdata = s_info->pdata; | 747 | struct s5p_fimc_isp_info *pdata = s_info->pdata; |
741 | struct fimc_camclk_info *camclk; | 748 | struct fimc_camclk_info *camclk; |
@@ -744,12 +751,10 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
744 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) | 751 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) |
745 | return -EINVAL; | 752 | return -EINVAL; |
746 | 753 | ||
747 | if (s_info->clk_on == on) | ||
748 | return 0; | ||
749 | camclk = &fmd->camclk[pdata->clk_id]; | 754 | camclk = &fmd->camclk[pdata->clk_id]; |
750 | 755 | ||
751 | dbg("camclk %d, f: %lu, clk: %p, on: %d", | 756 | dbg("camclk %d, f: %lu, use_count: %d, on: %d", |
752 | pdata->clk_id, pdata->clk_frequency, camclk, on); | 757 | pdata->clk_id, pdata->clk_frequency, camclk->use_count, on); |
753 | 758 | ||
754 | if (on) { | 759 | if (on) { |
755 | if (camclk->use_count > 0 && | 760 | if (camclk->use_count > 0 && |
@@ -760,11 +765,9 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
760 | clk_set_rate(camclk->clock, pdata->clk_frequency); | 765 | clk_set_rate(camclk->clock, pdata->clk_frequency); |
761 | camclk->frequency = pdata->clk_frequency; | 766 | camclk->frequency = pdata->clk_frequency; |
762 | ret = clk_enable(camclk->clock); | 767 | ret = clk_enable(camclk->clock); |
768 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
769 | clk_get_rate(camclk->clock)); | ||
763 | } | 770 | } |
764 | s_info->clk_on = 1; | ||
765 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
766 | clk_get_rate(camclk->clock)); | ||
767 | |||
768 | return ret; | 771 | return ret; |
769 | } | 772 | } |
770 | 773 | ||
@@ -773,7 +776,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
773 | 776 | ||
774 | if (--camclk->use_count == 0) { | 777 | if (--camclk->use_count == 0) { |
775 | clk_disable(camclk->clock); | 778 | clk_disable(camclk->clock); |
776 | s_info->clk_on = 0; | ||
777 | dbg("Disabled camclk %d", pdata->clk_id); | 779 | dbg("Disabled camclk %d", pdata->clk_id); |
778 | } | 780 | } |
779 | return ret; | 781 | return ret; |
@@ -789,8 +791,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
789 | * devices to which sensors can be attached, either directly or through | 791 | * devices to which sensors can be attached, either directly or through |
790 | * the MIPI CSI receiver. The clock is allowed here to be used by | 792 | * the MIPI CSI receiver. The clock is allowed here to be used by |
791 | * multiple sensors concurrently if they use same frequency. | 793 | * multiple sensors concurrently if they use same frequency. |
792 | * The per sensor subdev clk_on attribute helps to synchronize accesses | ||
793 | * to the sclk_cam clocks from the video and media device nodes. | ||
794 | * This function should only be called when the graph mutex is held. | 794 | * This function should only be called when the graph mutex is held. |
795 | */ | 795 | */ |
796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) | 796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.h b/drivers/media/video/s5p-fimc/fimc-mdevice.h index 3b8a3492a176..1f5dbaff5442 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.h +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.h | |||
@@ -47,7 +47,6 @@ struct fimc_camclk_info { | |||
47 | * @pdata: sensor's atrributes passed as media device's platform data | 47 | * @pdata: sensor's atrributes passed as media device's platform data |
48 | * @subdev: image sensor v4l2 subdev | 48 | * @subdev: image sensor v4l2 subdev |
49 | * @host: fimc device the sensor is currently linked to | 49 | * @host: fimc device the sensor is currently linked to |
50 | * @clk_on: sclk_cam clock's state associated with this subdev | ||
51 | * | 50 | * |
52 | * This data structure applies to image sensor and the writeback subdevs. | 51 | * This data structure applies to image sensor and the writeback subdevs. |
53 | */ | 52 | */ |
@@ -55,7 +54,6 @@ struct fimc_sensor_info { | |||
55 | struct s5p_fimc_isp_info *pdata; | 54 | struct s5p_fimc_isp_info *pdata; |
56 | struct v4l2_subdev *subdev; | 55 | struct v4l2_subdev *subdev; |
57 | struct fimc_dev *host; | 56 | struct fimc_dev *host; |
58 | bool clk_on; | ||
59 | }; | 57 | }; |
60 | 58 | ||
61 | /** | 59 | /** |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c index 4dd32fc8fd82..feea867f318c 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c | |||
@@ -996,6 +996,7 @@ int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
996 | 996 | ||
997 | for (i = 0; i < NUM_CTRLS; i++) { | 997 | for (i = 0; i < NUM_CTRLS; i++) { |
998 | if (IS_MFC51_PRIV(controls[i].id)) { | 998 | if (IS_MFC51_PRIV(controls[i].id)) { |
999 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
999 | cfg.ops = &s5p_mfc_dec_ctrl_ops; | 1000 | cfg.ops = &s5p_mfc_dec_ctrl_ops; |
1000 | cfg.id = controls[i].id; | 1001 | cfg.id = controls[i].id; |
1001 | cfg.min = controls[i].minimum; | 1002 | cfg.min = controls[i].minimum; |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index 03d83340e7fb..158b78989b89 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c | |||
@@ -1773,6 +1773,7 @@ int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
1773 | } | 1773 | } |
1774 | for (i = 0; i < NUM_CTRLS; i++) { | 1774 | for (i = 0; i < NUM_CTRLS; i++) { |
1775 | if (IS_MFC51_PRIV(controls[i].id)) { | 1775 | if (IS_MFC51_PRIV(controls[i].id)) { |
1776 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
1776 | cfg.ops = &s5p_mfc_enc_ctrl_ops; | 1777 | cfg.ops = &s5p_mfc_enc_ctrl_ops; |
1777 | cfg.id = controls[i].id; | 1778 | cfg.id = controls[i].id; |
1778 | cfg.min = controls[i].minimum; | 1779 | cfg.min = controls[i].minimum; |
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c index e8c93c89265a..9cf5bda35fbe 100644 --- a/drivers/media/video/smiapp/smiapp-core.c +++ b/drivers/media/video/smiapp/smiapp-core.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/device.h> | 31 | #include <linux/device.h> |
32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | #include <linux/slab.h> | ||
34 | #include <linux/regulator/consumer.h> | 35 | #include <linux/regulator/consumer.h> |
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
36 | #include <linux/v4l2-mediabus.h> | 37 | #include <linux/v4l2-mediabus.h> |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index e129c820df7d..92144ed1ad46 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -286,6 +286,7 @@ config TWL6040_CORE | |||
286 | depends on I2C=y && GENERIC_HARDIRQS | 286 | depends on I2C=y && GENERIC_HARDIRQS |
287 | select MFD_CORE | 287 | select MFD_CORE |
288 | select REGMAP_I2C | 288 | select REGMAP_I2C |
289 | select IRQ_DOMAIN | ||
289 | default n | 290 | default n |
290 | help | 291 | help |
291 | Say yes here if you want support for Texas Instruments TWL6040 audio | 292 | Say yes here if you want support for Texas Instruments TWL6040 audio |
diff --git a/drivers/mfd/ab5500-core.h b/drivers/mfd/ab5500-core.h deleted file mode 100644 index 63b30b17e4f3..000000000000 --- a/drivers/mfd/ab5500-core.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 ST-Ericsson | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * Shared definitions and data structures for the AB5500 MFD driver | ||
5 | */ | ||
6 | |||
7 | /* Read/write operation values. */ | ||
8 | #define AB5500_PERM_RD (0x01) | ||
9 | #define AB5500_PERM_WR (0x02) | ||
10 | |||
11 | /* Read/write permissions. */ | ||
12 | #define AB5500_PERM_RO (AB5500_PERM_RD) | ||
13 | #define AB5500_PERM_RW (AB5500_PERM_RD | AB5500_PERM_WR) | ||
14 | |||
15 | #define AB5500_MASK_BASE (0x60) | ||
16 | #define AB5500_MASK_END (0x79) | ||
17 | #define AB5500_CHIP_ID (0x20) | ||
18 | |||
19 | /** | ||
20 | * struct ab5500_reg_range | ||
21 | * @first: the first address of the range | ||
22 | * @last: the last address of the range | ||
23 | * @perm: access permissions for the range | ||
24 | */ | ||
25 | struct ab5500_reg_range { | ||
26 | u8 first; | ||
27 | u8 last; | ||
28 | u8 perm; | ||
29 | }; | ||
30 | |||
31 | /** | ||
32 | * struct ab5500_i2c_ranges | ||
33 | * @count: the number of ranges in the list | ||
34 | * @range: the list of register ranges | ||
35 | */ | ||
36 | struct ab5500_i2c_ranges { | ||
37 | u8 nranges; | ||
38 | u8 bankid; | ||
39 | const struct ab5500_reg_range *range; | ||
40 | }; | ||
41 | |||
42 | /** | ||
43 | * struct ab5500_i2c_banks | ||
44 | * @count: the number of ranges in the list | ||
45 | * @range: the list of register ranges | ||
46 | */ | ||
47 | struct ab5500_i2c_banks { | ||
48 | u8 nbanks; | ||
49 | const struct ab5500_i2c_ranges *bank; | ||
50 | }; | ||
51 | |||
52 | /** | ||
53 | * struct ab5500_bank | ||
54 | * @slave_addr: I2C slave_addr found in AB5500 specification | ||
55 | * @name: Documentation name of the bank. For reference | ||
56 | */ | ||
57 | struct ab5500_bank { | ||
58 | u8 slave_addr; | ||
59 | const char *name; | ||
60 | }; | ||
61 | |||
62 | static const struct ab5500_bank bankinfo[AB5500_NUM_BANKS] = { | ||
63 | [AB5500_BANK_VIT_IO_I2C_CLK_TST_OTP] = { | ||
64 | AB5500_ADDR_VIT_IO_I2C_CLK_TST_OTP, "VIT_IO_I2C_CLK_TST_OTP"}, | ||
65 | [AB5500_BANK_VDDDIG_IO_I2C_CLK_TST] = { | ||
66 | AB5500_ADDR_VDDDIG_IO_I2C_CLK_TST, "VDDDIG_IO_I2C_CLK_TST"}, | ||
67 | [AB5500_BANK_VDENC] = {AB5500_ADDR_VDENC, "VDENC"}, | ||
68 | [AB5500_BANK_SIM_USBSIM] = {AB5500_ADDR_SIM_USBSIM, "SIM_USBSIM"}, | ||
69 | [AB5500_BANK_LED] = {AB5500_ADDR_LED, "LED"}, | ||
70 | [AB5500_BANK_ADC] = {AB5500_ADDR_ADC, "ADC"}, | ||
71 | [AB5500_BANK_RTC] = {AB5500_ADDR_RTC, "RTC"}, | ||
72 | [AB5500_BANK_STARTUP] = {AB5500_ADDR_STARTUP, "STARTUP"}, | ||
73 | [AB5500_BANK_DBI_ECI] = {AB5500_ADDR_DBI_ECI, "DBI-ECI"}, | ||
74 | [AB5500_BANK_CHG] = {AB5500_ADDR_CHG, "CHG"}, | ||
75 | [AB5500_BANK_FG_BATTCOM_ACC] = { | ||
76 | AB5500_ADDR_FG_BATTCOM_ACC, "FG_BATCOM_ACC"}, | ||
77 | [AB5500_BANK_USB] = {AB5500_ADDR_USB, "USB"}, | ||
78 | [AB5500_BANK_IT] = {AB5500_ADDR_IT, "IT"}, | ||
79 | [AB5500_BANK_VIBRA] = {AB5500_ADDR_VIBRA, "VIBRA"}, | ||
80 | [AB5500_BANK_AUDIO_HEADSETUSB] = { | ||
81 | AB5500_ADDR_AUDIO_HEADSETUSB, "AUDIO_HEADSETUSB"}, | ||
82 | }; | ||
83 | |||
84 | int ab5500_get_register_interruptible_raw(struct ab5500 *ab, u8 bank, u8 reg, | ||
85 | u8 *value); | ||
86 | int ab5500_mask_and_set_register_interruptible_raw(struct ab5500 *ab, u8 bank, | ||
87 | u8 reg, u8 bitmask, u8 bitvalues); | ||
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 3fcdab3eb8eb..03df422feb76 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c | |||
@@ -49,10 +49,72 @@ static struct regmap_config mc13xxx_regmap_spi_config = { | |||
49 | .reg_bits = 7, | 49 | .reg_bits = 7, |
50 | .pad_bits = 1, | 50 | .pad_bits = 1, |
51 | .val_bits = 24, | 51 | .val_bits = 24, |
52 | .write_flag_mask = 0x80, | ||
52 | 53 | ||
53 | .max_register = MC13XXX_NUMREGS, | 54 | .max_register = MC13XXX_NUMREGS, |
54 | 55 | ||
55 | .cache_type = REGCACHE_NONE, | 56 | .cache_type = REGCACHE_NONE, |
57 | .use_single_rw = 1, | ||
58 | }; | ||
59 | |||
60 | static int mc13xxx_spi_read(void *context, const void *reg, size_t reg_size, | ||
61 | void *val, size_t val_size) | ||
62 | { | ||
63 | unsigned char w[4] = { *((unsigned char *) reg), 0, 0, 0}; | ||
64 | unsigned char r[4]; | ||
65 | unsigned char *p = val; | ||
66 | struct device *dev = context; | ||
67 | struct spi_device *spi = to_spi_device(dev); | ||
68 | struct spi_transfer t = { | ||
69 | .tx_buf = w, | ||
70 | .rx_buf = r, | ||
71 | .len = 4, | ||
72 | }; | ||
73 | |||
74 | struct spi_message m; | ||
75 | int ret; | ||
76 | |||
77 | if (val_size != 3 || reg_size != 1) | ||
78 | return -ENOTSUPP; | ||
79 | |||
80 | spi_message_init(&m); | ||
81 | spi_message_add_tail(&t, &m); | ||
82 | ret = spi_sync(spi, &m); | ||
83 | |||
84 | memcpy(p, &r[1], 3); | ||
85 | |||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | static int mc13xxx_spi_write(void *context, const void *data, size_t count) | ||
90 | { | ||
91 | struct device *dev = context; | ||
92 | struct spi_device *spi = to_spi_device(dev); | ||
93 | |||
94 | if (count != 4) | ||
95 | return -ENOTSUPP; | ||
96 | |||
97 | return spi_write(spi, data, count); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * We cannot use regmap-spi generic bus implementation here. | ||
102 | * The MC13783 chip will get corrupted if CS signal is deasserted | ||
103 | * and on i.Mx31 SoC (the target SoC for MC13783 PMIC) the SPI controller | ||
104 | * has the following errata (DSPhl22960): | ||
105 | * "The CSPI negates SS when the FIFO becomes empty with | ||
106 | * SSCTL= 0. Software cannot guarantee that the FIFO will not | ||
107 | * drain because of higher priority interrupts and the | ||
108 | * non-realtime characteristics of the operating system. As a | ||
109 | * result, the SS will negate before all of the data has been | ||
110 | * transferred to/from the peripheral." | ||
111 | * We workaround this by accessing the SPI controller with a | ||
112 | * single transfert. | ||
113 | */ | ||
114 | |||
115 | static struct regmap_bus regmap_mc13xxx_bus = { | ||
116 | .write = mc13xxx_spi_write, | ||
117 | .read = mc13xxx_spi_read, | ||
56 | }; | 118 | }; |
57 | 119 | ||
58 | static int mc13xxx_spi_probe(struct spi_device *spi) | 120 | static int mc13xxx_spi_probe(struct spi_device *spi) |
@@ -73,12 +135,13 @@ static int mc13xxx_spi_probe(struct spi_device *spi) | |||
73 | 135 | ||
74 | dev_set_drvdata(&spi->dev, mc13xxx); | 136 | dev_set_drvdata(&spi->dev, mc13xxx); |
75 | spi->mode = SPI_MODE_0 | SPI_CS_HIGH; | 137 | spi->mode = SPI_MODE_0 | SPI_CS_HIGH; |
76 | spi->bits_per_word = 32; | ||
77 | 138 | ||
78 | mc13xxx->dev = &spi->dev; | 139 | mc13xxx->dev = &spi->dev; |
79 | mutex_init(&mc13xxx->lock); | 140 | mutex_init(&mc13xxx->lock); |
80 | 141 | ||
81 | mc13xxx->regmap = regmap_init_spi(spi, &mc13xxx_regmap_spi_config); | 142 | mc13xxx->regmap = regmap_init(&spi->dev, ®map_mc13xxx_bus, &spi->dev, |
143 | &mc13xxx_regmap_spi_config); | ||
144 | |||
82 | if (IS_ERR(mc13xxx->regmap)) { | 145 | if (IS_ERR(mc13xxx->regmap)) { |
83 | ret = PTR_ERR(mc13xxx->regmap); | 146 | ret = PTR_ERR(mc13xxx->regmap); |
84 | dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", | 147 | dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", |
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 7e96bb229724..41088ecbb2a9 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/gpio.h> | ||
28 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
29 | #include <plat/usb.h> | 30 | #include <plat/usb.h> |
30 | #include <linux/pm_runtime.h> | 31 | #include <linux/pm_runtime.h> |
@@ -500,8 +501,21 @@ static void omap_usbhs_init(struct device *dev) | |||
500 | dev_dbg(dev, "starting TI HSUSB Controller\n"); | 501 | dev_dbg(dev, "starting TI HSUSB Controller\n"); |
501 | 502 | ||
502 | pm_runtime_get_sync(dev); | 503 | pm_runtime_get_sync(dev); |
503 | spin_lock_irqsave(&omap->lock, flags); | ||
504 | 504 | ||
505 | if (pdata->ehci_data->phy_reset) { | ||
506 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
507 | gpio_request_one(pdata->ehci_data->reset_gpio_port[0], | ||
508 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
509 | |||
510 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
511 | gpio_request_one(pdata->ehci_data->reset_gpio_port[1], | ||
512 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
513 | |||
514 | /* Hold the PHY in RESET for enough time till DIR is high */ | ||
515 | udelay(10); | ||
516 | } | ||
517 | |||
518 | spin_lock_irqsave(&omap->lock, flags); | ||
505 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); | 519 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); |
506 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); | 520 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); |
507 | 521 | ||
@@ -581,9 +595,39 @@ static void omap_usbhs_init(struct device *dev) | |||
581 | } | 595 | } |
582 | 596 | ||
583 | spin_unlock_irqrestore(&omap->lock, flags); | 597 | spin_unlock_irqrestore(&omap->lock, flags); |
598 | |||
599 | if (pdata->ehci_data->phy_reset) { | ||
600 | /* Hold the PHY in RESET for enough time till | ||
601 | * PHY is settled and ready | ||
602 | */ | ||
603 | udelay(10); | ||
604 | |||
605 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
606 | gpio_set_value_cansleep | ||
607 | (pdata->ehci_data->reset_gpio_port[0], 1); | ||
608 | |||
609 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
610 | gpio_set_value_cansleep | ||
611 | (pdata->ehci_data->reset_gpio_port[1], 1); | ||
612 | } | ||
613 | |||
584 | pm_runtime_put_sync(dev); | 614 | pm_runtime_put_sync(dev); |
585 | } | 615 | } |
586 | 616 | ||
617 | static void omap_usbhs_deinit(struct device *dev) | ||
618 | { | ||
619 | struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); | ||
620 | struct usbhs_omap_platform_data *pdata = &omap->platdata; | ||
621 | |||
622 | if (pdata->ehci_data->phy_reset) { | ||
623 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
624 | gpio_free(pdata->ehci_data->reset_gpio_port[0]); | ||
625 | |||
626 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
627 | gpio_free(pdata->ehci_data->reset_gpio_port[1]); | ||
628 | } | ||
629 | } | ||
630 | |||
587 | 631 | ||
588 | /** | 632 | /** |
589 | * usbhs_omap_probe - initialize TI-based HCDs | 633 | * usbhs_omap_probe - initialize TI-based HCDs |
@@ -767,6 +811,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev) | |||
767 | goto end_probe; | 811 | goto end_probe; |
768 | 812 | ||
769 | err_alloc: | 813 | err_alloc: |
814 | omap_usbhs_deinit(&pdev->dev); | ||
770 | iounmap(omap->tll_base); | 815 | iounmap(omap->tll_base); |
771 | 816 | ||
772 | err_tll: | 817 | err_tll: |
@@ -818,6 +863,7 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev) | |||
818 | { | 863 | { |
819 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); | 864 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); |
820 | 865 | ||
866 | omap_usbhs_deinit(&pdev->dev); | ||
821 | iounmap(omap->tll_base); | 867 | iounmap(omap->tll_base); |
822 | iounmap(omap->uhh_base); | 868 | iounmap(omap->uhh_base); |
823 | clk_put(omap->init_60m_fclk); | 869 | clk_put(omap->init_60m_fclk); |
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 00c0aba7eba0..c4a69f193a1d 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c | |||
@@ -356,7 +356,14 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c, | |||
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | ret = regmap_add_irq_chip(palmas->regmap[1], palmas->irq, | 359 | /* Change IRQ into clear on read mode for efficiency */ |
360 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); | ||
361 | addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL); | ||
362 | reg = PALMAS_INT_CTRL_INT_CLEAR; | ||
363 | |||
364 | regmap_write(palmas->regmap[slave], addr, reg); | ||
365 | |||
366 | ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, | ||
360 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip, | 367 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip, |
361 | &palmas->irq_data); | 368 | &palmas->irq_data); |
362 | if (ret < 0) | 369 | if (ret < 0) |
@@ -441,6 +448,9 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c, | |||
441 | goto err; | 448 | goto err; |
442 | } | 449 | } |
443 | 450 | ||
451 | children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata; | ||
452 | children[PALMAS_PMIC_ID].pdata_size = sizeof(*pdata->pmic_pdata); | ||
453 | |||
444 | ret = mfd_add_devices(palmas->dev, -1, | 454 | ret = mfd_add_devices(palmas->dev, -1, |
445 | children, ARRAY_SIZE(palmas_children), | 455 | children, ARRAY_SIZE(palmas_children), |
446 | NULL, regmap_irq_chip_get_base(palmas->irq_data)); | 456 | NULL, regmap_irq_chip_get_base(palmas->irq_data)); |
@@ -472,6 +482,7 @@ static const struct i2c_device_id palmas_i2c_id[] = { | |||
472 | { "twl6035", }, | 482 | { "twl6035", }, |
473 | { "twl6037", }, | 483 | { "twl6037", }, |
474 | { "tps65913", }, | 484 | { "tps65913", }, |
485 | { /* end */ } | ||
475 | }; | 486 | }; |
476 | MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); | 487 | MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); |
477 | 488 | ||
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 7de13891e49e..783fcd7365bc 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -1147,7 +1147,7 @@ static int mei_pci_resume(struct device *device) | |||
1147 | err = request_threaded_irq(pdev->irq, | 1147 | err = request_threaded_irq(pdev->irq, |
1148 | NULL, | 1148 | NULL, |
1149 | mei_interrupt_thread_handler, | 1149 | mei_interrupt_thread_handler, |
1150 | 0, mei_driver_name, dev); | 1150 | IRQF_ONESHOT, mei_driver_name, dev); |
1151 | else | 1151 | else |
1152 | err = request_threaded_irq(pdev->irq, | 1152 | err = request_threaded_irq(pdev->irq, |
1153 | mei_interrupt_quick_handler, | 1153 | mei_interrupt_quick_handler, |
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 17bbacb1b4b1..87b251ab6ec5 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -452,9 +452,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part, | |||
452 | 452 | ||
453 | if (msg->activate_gru_mq_desc_gpa != | 453 | if (msg->activate_gru_mq_desc_gpa != |
454 | part_uv->activate_gru_mq_desc_gpa) { | 454 | part_uv->activate_gru_mq_desc_gpa) { |
455 | spin_lock_irqsave(&part_uv->flags_lock, irq_flags); | 455 | spin_lock(&part_uv->flags_lock); |
456 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; | 456 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; |
457 | spin_unlock_irqrestore(&part_uv->flags_lock, irq_flags); | 457 | spin_unlock(&part_uv->flags_lock); |
458 | part_uv->activate_gru_mq_desc_gpa = | 458 | part_uv->activate_gru_mq_desc_gpa = |
459 | msg->activate_gru_mq_desc_gpa; | 459 | msg->activate_gru_mq_desc_gpa; |
460 | } | 460 | } |
diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c index f13e38deceac..8f5dc08d6598 100644 --- a/drivers/mmc/core/cd-gpio.c +++ b/drivers/mmc/core/cd-gpio.c | |||
@@ -50,8 +50,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio) | |||
50 | goto egpioreq; | 50 | goto egpioreq; |
51 | 51 | ||
52 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, | 52 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, |
53 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 53 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | |
54 | cd->label, host); | 54 | IRQF_ONESHOT, cd->label, host); |
55 | if (ret < 0) | 55 | if (ret < 0) |
56 | goto eirqreq; | 56 | goto eirqreq; |
57 | 57 | ||
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 258b203397aa..4f4489aa6bae 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -717,10 +717,6 @@ static int mmc_select_powerclass(struct mmc_card *card, | |||
717 | card->ext_csd.generic_cmd6_time); | 717 | card->ext_csd.generic_cmd6_time); |
718 | } | 718 | } |
719 | 719 | ||
720 | if (err) | ||
721 | pr_err("%s: power class selection for ext_csd_bus_width %d" | ||
722 | " failed\n", mmc_hostname(card->host), bus_width); | ||
723 | |||
724 | return err; | 720 | return err; |
725 | } | 721 | } |
726 | 722 | ||
@@ -1104,7 +1100,9 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1104 | EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4; | 1100 | EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4; |
1105 | err = mmc_select_powerclass(card, ext_csd_bits, ext_csd); | 1101 | err = mmc_select_powerclass(card, ext_csd_bits, ext_csd); |
1106 | if (err) | 1102 | if (err) |
1107 | goto err; | 1103 | pr_warning("%s: power class selection to bus width %d" |
1104 | " failed\n", mmc_hostname(card->host), | ||
1105 | 1 << bus_width); | ||
1108 | } | 1106 | } |
1109 | 1107 | ||
1110 | /* | 1108 | /* |
@@ -1136,7 +1134,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1136 | err = mmc_select_powerclass(card, ext_csd_bits[idx][0], | 1134 | err = mmc_select_powerclass(card, ext_csd_bits[idx][0], |
1137 | ext_csd); | 1135 | ext_csd); |
1138 | if (err) | 1136 | if (err) |
1139 | goto err; | 1137 | pr_warning("%s: power class selection to " |
1138 | "bus width %d failed\n", | ||
1139 | mmc_hostname(card->host), | ||
1140 | 1 << bus_width); | ||
1140 | 1141 | ||
1141 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | 1142 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
1142 | EXT_CSD_BUS_WIDTH, | 1143 | EXT_CSD_BUS_WIDTH, |
@@ -1164,7 +1165,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1164 | err = mmc_select_powerclass(card, ext_csd_bits[idx][1], | 1165 | err = mmc_select_powerclass(card, ext_csd_bits[idx][1], |
1165 | ext_csd); | 1166 | ext_csd); |
1166 | if (err) | 1167 | if (err) |
1167 | goto err; | 1168 | pr_warning("%s: power class selection to " |
1169 | "bus width %d ddr %d failed\n", | ||
1170 | mmc_hostname(card->host), | ||
1171 | 1 << bus_width, ddr); | ||
1168 | 1172 | ||
1169 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | 1173 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
1170 | EXT_CSD_BUS_WIDTH, | 1174 | EXT_CSD_BUS_WIDTH, |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index a05b7b444d4f..a6cad5caba78 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -920,12 +920,12 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, | |||
920 | */ | 920 | */ |
921 | memset(chip->oob_poi, ~0, mtd->oobsize); | 921 | memset(chip->oob_poi, ~0, mtd->oobsize); |
922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; | 922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; |
923 | |||
924 | read_page_swap_end(this, buf, mtd->writesize, | ||
925 | this->payload_virt, this->payload_phys, | ||
926 | nfc_geo->payload_size, | ||
927 | payload_virt, payload_phys); | ||
928 | } | 923 | } |
924 | |||
925 | read_page_swap_end(this, buf, mtd->writesize, | ||
926 | this->payload_virt, this->payload_phys, | ||
927 | nfc_geo->payload_size, | ||
928 | payload_virt, payload_phys); | ||
929 | exit_nfc: | 929 | exit_nfc: |
930 | return ret; | 930 | return ret; |
931 | } | 931 | } |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index c58e6a93f445..6acc790c2fbb 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -273,6 +273,26 @@ static struct nand_ecclayout nandv2_hw_eccoob_4k = { | |||
273 | 273 | ||
274 | static const char *part_probes[] = { "RedBoot", "cmdlinepart", "ofpart", NULL }; | 274 | static const char *part_probes[] = { "RedBoot", "cmdlinepart", "ofpart", NULL }; |
275 | 275 | ||
276 | static void memcpy32_fromio(void *trg, const void __iomem *src, size_t size) | ||
277 | { | ||
278 | int i; | ||
279 | u32 *t = trg; | ||
280 | const __iomem u32 *s = src; | ||
281 | |||
282 | for (i = 0; i < (size >> 2); i++) | ||
283 | *t++ = __raw_readl(s++); | ||
284 | } | ||
285 | |||
286 | static void memcpy32_toio(void __iomem *trg, const void *src, int size) | ||
287 | { | ||
288 | int i; | ||
289 | u32 __iomem *t = trg; | ||
290 | const u32 *s = src; | ||
291 | |||
292 | for (i = 0; i < (size >> 2); i++) | ||
293 | __raw_writel(*s++, t++); | ||
294 | } | ||
295 | |||
276 | static int check_int_v3(struct mxc_nand_host *host) | 296 | static int check_int_v3(struct mxc_nand_host *host) |
277 | { | 297 | { |
278 | uint32_t tmp; | 298 | uint32_t tmp; |
@@ -519,7 +539,7 @@ static void send_read_id_v3(struct mxc_nand_host *host) | |||
519 | 539 | ||
520 | wait_op_done(host, true); | 540 | wait_op_done(host, true); |
521 | 541 | ||
522 | memcpy_fromio(host->data_buf, host->main_area0, 16); | 542 | memcpy32_fromio(host->data_buf, host->main_area0, 16); |
523 | } | 543 | } |
524 | 544 | ||
525 | /* Request the NANDFC to perform a read of the NAND device ID. */ | 545 | /* Request the NANDFC to perform a read of the NAND device ID. */ |
@@ -535,7 +555,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host) | |||
535 | /* Wait for operation to complete */ | 555 | /* Wait for operation to complete */ |
536 | wait_op_done(host, true); | 556 | wait_op_done(host, true); |
537 | 557 | ||
538 | memcpy_fromio(host->data_buf, host->main_area0, 16); | 558 | memcpy32_fromio(host->data_buf, host->main_area0, 16); |
539 | 559 | ||
540 | if (this->options & NAND_BUSWIDTH_16) { | 560 | if (this->options & NAND_BUSWIDTH_16) { |
541 | /* compress the ID info */ | 561 | /* compress the ID info */ |
@@ -797,16 +817,16 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom) | |||
797 | 817 | ||
798 | if (bfrom) { | 818 | if (bfrom) { |
799 | for (i = 0; i < n - 1; i++) | 819 | for (i = 0; i < n - 1; i++) |
800 | memcpy_fromio(d + i * j, s + i * t, j); | 820 | memcpy32_fromio(d + i * j, s + i * t, j); |
801 | 821 | ||
802 | /* the last section */ | 822 | /* the last section */ |
803 | memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j); | 823 | memcpy32_fromio(d + i * j, s + i * t, mtd->oobsize - i * j); |
804 | } else { | 824 | } else { |
805 | for (i = 0; i < n - 1; i++) | 825 | for (i = 0; i < n - 1; i++) |
806 | memcpy_toio(&s[i * t], &d[i * j], j); | 826 | memcpy32_toio(&s[i * t], &d[i * j], j); |
807 | 827 | ||
808 | /* the last section */ | 828 | /* the last section */ |
809 | memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j); | 829 | memcpy32_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j); |
810 | } | 830 | } |
811 | } | 831 | } |
812 | 832 | ||
@@ -1070,7 +1090,8 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1070 | 1090 | ||
1071 | host->devtype_data->send_page(mtd, NFC_OUTPUT); | 1091 | host->devtype_data->send_page(mtd, NFC_OUTPUT); |
1072 | 1092 | ||
1073 | memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize); | 1093 | memcpy32_fromio(host->data_buf, host->main_area0, |
1094 | mtd->writesize); | ||
1074 | copy_spare(mtd, true); | 1095 | copy_spare(mtd, true); |
1075 | break; | 1096 | break; |
1076 | 1097 | ||
@@ -1086,7 +1107,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1086 | break; | 1107 | break; |
1087 | 1108 | ||
1088 | case NAND_CMD_PAGEPROG: | 1109 | case NAND_CMD_PAGEPROG: |
1089 | memcpy_toio(host->main_area0, host->data_buf, mtd->writesize); | 1110 | memcpy32_toio(host->main_area0, host->data_buf, mtd->writesize); |
1090 | copy_spare(mtd, false); | 1111 | copy_spare(mtd, false); |
1091 | host->devtype_data->send_page(mtd, NFC_INPUT); | 1112 | host->devtype_data->send_page(mtd, NFC_INPUT); |
1092 | host->devtype_data->send_cmd(host, command, true); | 1113 | host->devtype_data->send_cmd(host, command, true); |
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 6cc8fbfabb8e..cf0cd3146817 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/vmalloc.h> | 30 | #include <linux/vmalloc.h> |
31 | #include <asm/div64.h> | 31 | #include <linux/math64.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/errno.h> | 33 | #include <linux/errno.h> |
34 | #include <linux/string.h> | 34 | #include <linux/string.h> |
@@ -546,12 +546,6 @@ static char *get_partition_name(int i) | |||
546 | return kstrdup(buf, GFP_KERNEL); | 546 | return kstrdup(buf, GFP_KERNEL); |
547 | } | 547 | } |
548 | 548 | ||
549 | static uint64_t divide(uint64_t n, uint32_t d) | ||
550 | { | ||
551 | do_div(n, d); | ||
552 | return n; | ||
553 | } | ||
554 | |||
555 | /* | 549 | /* |
556 | * Initialize the nandsim structure. | 550 | * Initialize the nandsim structure. |
557 | * | 551 | * |
@@ -580,7 +574,7 @@ static int init_nandsim(struct mtd_info *mtd) | |||
580 | ns->geom.oobsz = mtd->oobsize; | 574 | ns->geom.oobsz = mtd->oobsize; |
581 | ns->geom.secsz = mtd->erasesize; | 575 | ns->geom.secsz = mtd->erasesize; |
582 | ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; | 576 | ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; |
583 | ns->geom.pgnum = divide(ns->geom.totsz, ns->geom.pgsz); | 577 | ns->geom.pgnum = div_u64(ns->geom.totsz, ns->geom.pgsz); |
584 | ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; | 578 | ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; |
585 | ns->geom.secshift = ffs(ns->geom.secsz) - 1; | 579 | ns->geom.secshift = ffs(ns->geom.secsz) - 1; |
586 | ns->geom.pgshift = chip->page_shift; | 580 | ns->geom.pgshift = chip->page_shift; |
@@ -921,7 +915,7 @@ static int setup_wear_reporting(struct mtd_info *mtd) | |||
921 | 915 | ||
922 | if (!rptwear) | 916 | if (!rptwear) |
923 | return 0; | 917 | return 0; |
924 | wear_eb_count = divide(mtd->size, mtd->erasesize); | 918 | wear_eb_count = div_u64(mtd->size, mtd->erasesize); |
925 | mem = wear_eb_count * sizeof(unsigned long); | 919 | mem = wear_eb_count * sizeof(unsigned long); |
926 | if (mem / sizeof(unsigned long) != wear_eb_count) { | 920 | if (mem / sizeof(unsigned long) != wear_eb_count) { |
927 | NS_ERR("Too many erase blocks for wear reporting\n"); | 921 | NS_ERR("Too many erase blocks for wear reporting\n"); |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 3132ea068d95..e44f8c2d239d 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l | |||
317 | for(; lookup->compatible != NULL; lookup++) { | 317 | for(; lookup->compatible != NULL; lookup++) { |
318 | if (!of_device_is_compatible(np, lookup->compatible)) | 318 | if (!of_device_is_compatible(np, lookup->compatible)) |
319 | continue; | 319 | continue; |
320 | if (of_address_to_resource(np, 0, &res)) | 320 | if (!of_address_to_resource(np, 0, &res)) |
321 | continue; | 321 | if (res.start != lookup->phys_addr) |
322 | if (res.start != lookup->phys_addr) | 322 | continue; |
323 | continue; | ||
324 | pr_debug("%s: devname=%s\n", np->full_name, lookup->name); | 323 | pr_debug("%s: devname=%s\n", np->full_name, lookup->name); |
325 | return lookup; | 324 | return lookup; |
326 | } | 325 | } |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index bf0cee629b60..099f46cd8e87 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -748,6 +748,18 @@ static int pci_pm_suspend_noirq(struct device *dev) | |||
748 | 748 | ||
749 | pci_pm_set_unknown_state(pci_dev); | 749 | pci_pm_set_unknown_state(pci_dev); |
750 | 750 | ||
751 | /* | ||
752 | * Some BIOSes from ASUS have a bug: If a USB EHCI host controller's | ||
753 | * PCI COMMAND register isn't 0, the BIOS assumes that the controller | ||
754 | * hasn't been quiesced and tries to turn it off. If the controller | ||
755 | * is already in D3, this can hang or cause memory corruption. | ||
756 | * | ||
757 | * Since the value of the COMMAND register doesn't matter once the | ||
758 | * device has been suspended, we can safely set it to 0 here. | ||
759 | */ | ||
760 | if (pci_dev->class == PCI_CLASS_SERIAL_USB_EHCI) | ||
761 | pci_write_config_word(pci_dev, PCI_COMMAND, 0); | ||
762 | |||
751 | return 0; | 763 | return 0; |
752 | } | 764 | } |
753 | 765 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 77cb54a65cde..447e83472c01 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1744,11 +1744,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev) | |||
1744 | if (target_state == PCI_POWER_ERROR) | 1744 | if (target_state == PCI_POWER_ERROR) |
1745 | return -EIO; | 1745 | return -EIO; |
1746 | 1746 | ||
1747 | /* Some devices mustn't be in D3 during system sleep */ | ||
1748 | if (target_state == PCI_D3hot && | ||
1749 | (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP)) | ||
1750 | return 0; | ||
1751 | |||
1752 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); | 1747 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); |
1753 | 1748 | ||
1754 | error = pci_set_power_state(dev, target_state); | 1749 | error = pci_set_power_state(dev, target_state); |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 194b243a2817..2a7521677541 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -2929,32 +2929,6 @@ static void __devinit disable_igfx_irq(struct pci_dev *dev) | |||
2929 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); | 2929 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); |
2930 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); | 2930 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); |
2931 | 2931 | ||
2932 | /* | ||
2933 | * The Intel 6 Series/C200 Series chipset's EHCI controllers on many | ||
2934 | * ASUS motherboards will cause memory corruption or a system crash | ||
2935 | * if they are in D3 while the system is put into S3 sleep. | ||
2936 | */ | ||
2937 | static void __devinit asus_ehci_no_d3(struct pci_dev *dev) | ||
2938 | { | ||
2939 | const char *sys_info; | ||
2940 | static const char good_Asus_board[] = "P8Z68-V"; | ||
2941 | |||
2942 | if (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP) | ||
2943 | return; | ||
2944 | if (dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK) | ||
2945 | return; | ||
2946 | sys_info = dmi_get_system_info(DMI_BOARD_NAME); | ||
2947 | if (sys_info && memcmp(sys_info, good_Asus_board, | ||
2948 | sizeof(good_Asus_board) - 1) == 0) | ||
2949 | return; | ||
2950 | |||
2951 | dev_info(&dev->dev, "broken D3 during system sleep on ASUS\n"); | ||
2952 | dev->dev_flags |= PCI_DEV_FLAGS_NO_D3_DURING_SLEEP; | ||
2953 | device_set_wakeup_capable(&dev->dev, false); | ||
2954 | } | ||
2955 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c26, asus_ehci_no_d3); | ||
2956 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c2d, asus_ehci_no_d3); | ||
2957 | |||
2958 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, | 2932 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, |
2959 | struct pci_fixup *end) | 2933 | struct pci_fixup *end) |
2960 | { | 2934 | { |
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 4bcf9ca2818a..370889d0489b 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mfd/abx500.h> | 17 | #include <linux/mfd/abx500.h> |
18 | #include <linux/mfd/abx500/ab8500.h> | 18 | #include <linux/mfd/abx500/ab8500.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/of.h> | ||
20 | 21 | ||
21 | #define AB8500_RTC_SOFF_STAT_REG 0x00 | 22 | #define AB8500_RTC_SOFF_STAT_REG 0x00 |
22 | #define AB8500_RTC_CC_CONF_REG 0x01 | 23 | #define AB8500_RTC_CC_CONF_REG 0x01 |
@@ -422,7 +423,7 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) | |||
422 | } | 423 | } |
423 | 424 | ||
424 | err = request_threaded_irq(irq, NULL, rtc_alarm_handler, | 425 | err = request_threaded_irq(irq, NULL, rtc_alarm_handler, |
425 | IRQF_NO_SUSPEND, "ab8500-rtc", rtc); | 426 | IRQF_NO_SUSPEND | IRQF_ONESHOT, "ab8500-rtc", rtc); |
426 | if (err < 0) { | 427 | if (err < 0) { |
427 | rtc_device_unregister(rtc); | 428 | rtc_device_unregister(rtc); |
428 | return err; | 429 | return err; |
@@ -430,7 +431,6 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) | |||
430 | 431 | ||
431 | platform_set_drvdata(pdev, rtc); | 432 | platform_set_drvdata(pdev, rtc); |
432 | 433 | ||
433 | |||
434 | err = ab8500_sysfs_rtc_register(&pdev->dev); | 434 | err = ab8500_sysfs_rtc_register(&pdev->dev); |
435 | if (err) { | 435 | if (err) { |
436 | dev_err(&pdev->dev, "sysfs RTC failed to register\n"); | 436 | dev_err(&pdev->dev, "sysfs RTC failed to register\n"); |
@@ -454,10 +454,16 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev) | |||
454 | return 0; | 454 | return 0; |
455 | } | 455 | } |
456 | 456 | ||
457 | static const struct of_device_id ab8500_rtc_match[] = { | ||
458 | { .compatible = "stericsson,ab8500-rtc", }, | ||
459 | {} | ||
460 | }; | ||
461 | |||
457 | static struct platform_driver ab8500_rtc_driver = { | 462 | static struct platform_driver ab8500_rtc_driver = { |
458 | .driver = { | 463 | .driver = { |
459 | .name = "ab8500-rtc", | 464 | .name = "ab8500-rtc", |
460 | .owner = THIS_MODULE, | 465 | .owner = THIS_MODULE, |
466 | .of_match_table = ab8500_rtc_match, | ||
461 | }, | 467 | }, |
462 | .probe = ab8500_rtc_probe, | 468 | .probe = ab8500_rtc_probe, |
463 | .remove = __devexit_p(ab8500_rtc_remove), | 469 | .remove = __devexit_p(ab8500_rtc_remove), |
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 5e1d64ee5228..e3e50d69baf8 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -202,10 +202,11 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | |||
202 | struct platform_device *pdev = dev_id; | 202 | struct platform_device *pdev = dev_id; |
203 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); | 203 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); |
204 | void __iomem *ioaddr = pdata->ioaddr; | 204 | void __iomem *ioaddr = pdata->ioaddr; |
205 | unsigned long flags; | ||
205 | u32 status; | 206 | u32 status; |
206 | u32 events = 0; | 207 | u32 events = 0; |
207 | 208 | ||
208 | spin_lock_irq(&pdata->rtc->irq_lock); | 209 | spin_lock_irqsave(&pdata->rtc->irq_lock, flags); |
209 | status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); | 210 | status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); |
210 | /* clear interrupt sources */ | 211 | /* clear interrupt sources */ |
211 | writew(status, ioaddr + RTC_RTCISR); | 212 | writew(status, ioaddr + RTC_RTCISR); |
@@ -224,7 +225,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | |||
224 | events |= (RTC_PF | RTC_IRQF); | 225 | events |= (RTC_PF | RTC_IRQF); |
225 | 226 | ||
226 | rtc_update_irq(pdata->rtc, 1, events); | 227 | rtc_update_irq(pdata->rtc, 1, events); |
227 | spin_unlock_irq(&pdata->rtc->irq_lock); | 228 | spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags); |
228 | 229 | ||
229 | return IRQ_HANDLED; | 230 | return IRQ_HANDLED; |
230 | } | 231 | } |
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index 1f76320e545b..e2785479113c 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c | |||
@@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(struct platform_device *pdev) | |||
458 | clk_disable(config->clk); | 458 | clk_disable(config->clk); |
459 | clk_put(config->clk); | 459 | clk_put(config->clk); |
460 | iounmap(config->ioaddr); | 460 | iounmap(config->ioaddr); |
461 | kfree(config); | ||
462 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 461 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
463 | if (res) | 462 | if (res) |
464 | release_mem_region(res->start, resource_size(res)); | 463 | release_mem_region(res->start, resource_size(res)); |
465 | platform_set_drvdata(pdev, NULL); | 464 | platform_set_drvdata(pdev, NULL); |
466 | rtc_device_unregister(config->rtc); | 465 | rtc_device_unregister(config->rtc); |
466 | kfree(config); | ||
467 | 467 | ||
468 | return 0; | 468 | return 0; |
469 | } | 469 | } |
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 258abeabf624..c5d06fe83bba 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c | |||
@@ -510,7 +510,7 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) | |||
510 | } | 510 | } |
511 | 511 | ||
512 | ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, | 512 | ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, |
513 | IRQF_TRIGGER_RISING, | 513 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, |
514 | dev_name(&rtc->dev), rtc); | 514 | dev_name(&rtc->dev), rtc); |
515 | if (ret < 0) { | 515 | if (ret < 0) { |
516 | dev_err(&pdev->dev, "IRQ is not free.\n"); | 516 | dev_err(&pdev->dev, "IRQ is not free.\n"); |
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c index 532d212b6b2c..393e7ce8e95a 100644 --- a/drivers/scsi/aic94xx/aic94xx_task.c +++ b/drivers/scsi/aic94xx/aic94xx_task.c | |||
@@ -201,7 +201,7 @@ static void asd_get_response_tasklet(struct asd_ascb *ascb, | |||
201 | 201 | ||
202 | if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) { | 202 | if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) { |
203 | resp->frame_len = le16_to_cpu(*(__le16 *)(r+6)); | 203 | resp->frame_len = le16_to_cpu(*(__le16 *)(r+6)); |
204 | memcpy(&resp->ending_fis[0], r+16, 24); | 204 | memcpy(&resp->ending_fis[0], r+16, ATA_RESP_FIS_SIZE); |
205 | ts->buf_valid_size = sizeof(*resp); | 205 | ts->buf_valid_size = sizeof(*resp); |
206 | } | 206 | } |
207 | } | 207 | } |
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index 0c53c28dc3d3..7e77cf620291 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h | |||
@@ -350,6 +350,7 @@ struct bnx2i_hba { | |||
350 | struct pci_dev *pcidev; | 350 | struct pci_dev *pcidev; |
351 | struct net_device *netdev; | 351 | struct net_device *netdev; |
352 | void __iomem *regview; | 352 | void __iomem *regview; |
353 | resource_size_t reg_base; | ||
353 | 354 | ||
354 | u32 age; | 355 | u32 age; |
355 | unsigned long cnic_dev_type; | 356 | unsigned long cnic_dev_type; |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index ece47e502282..86a12b48e477 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -2724,7 +2724,6 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) | |||
2724 | goto arm_cq; | 2724 | goto arm_cq; |
2725 | } | 2725 | } |
2726 | 2726 | ||
2727 | reg_base = ep->hba->netdev->base_addr; | ||
2728 | if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && | 2727 | if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && |
2729 | (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { | 2728 | (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { |
2730 | config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); | 2729 | config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); |
@@ -2740,7 +2739,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) | |||
2740 | /* 5709 device in normal node and 5706/5708 devices */ | 2739 | /* 5709 device in normal node and 5706/5708 devices */ |
2741 | reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); | 2740 | reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); |
2742 | 2741 | ||
2743 | ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, | 2742 | ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, |
2744 | MB_KERNEL_CTX_SIZE); | 2743 | MB_KERNEL_CTX_SIZE); |
2745 | if (!ep->qp.ctx_base) | 2744 | if (!ep->qp.ctx_base) |
2746 | return -ENOMEM; | 2745 | return -ENOMEM; |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index f8d516b53161..621538b8b544 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -811,13 +811,13 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) | |||
811 | bnx2i_identify_device(hba); | 811 | bnx2i_identify_device(hba); |
812 | bnx2i_setup_host_queue_size(hba, shost); | 812 | bnx2i_setup_host_queue_size(hba, shost); |
813 | 813 | ||
814 | hba->reg_base = pci_resource_start(hba->pcidev, 0); | ||
814 | if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) { | 815 | if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) { |
815 | hba->regview = ioremap_nocache(hba->netdev->base_addr, | 816 | hba->regview = pci_iomap(hba->pcidev, 0, BNX2_MQ_CONFIG2); |
816 | BNX2_MQ_CONFIG2); | ||
817 | if (!hba->regview) | 817 | if (!hba->regview) |
818 | goto ioreg_map_err; | 818 | goto ioreg_map_err; |
819 | } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) { | 819 | } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) { |
820 | hba->regview = ioremap_nocache(hba->netdev->base_addr, 4096); | 820 | hba->regview = pci_iomap(hba->pcidev, 0, 4096); |
821 | if (!hba->regview) | 821 | if (!hba->regview) |
822 | goto ioreg_map_err; | 822 | goto ioreg_map_err; |
823 | } | 823 | } |
@@ -884,7 +884,7 @@ cid_que_err: | |||
884 | bnx2i_free_mp_bdt(hba); | 884 | bnx2i_free_mp_bdt(hba); |
885 | mp_bdt_mem_err: | 885 | mp_bdt_mem_err: |
886 | if (hba->regview) { | 886 | if (hba->regview) { |
887 | iounmap(hba->regview); | 887 | pci_iounmap(hba->pcidev, hba->regview); |
888 | hba->regview = NULL; | 888 | hba->regview = NULL; |
889 | } | 889 | } |
890 | ioreg_map_err: | 890 | ioreg_map_err: |
@@ -910,7 +910,7 @@ void bnx2i_free_hba(struct bnx2i_hba *hba) | |||
910 | pci_dev_put(hba->pcidev); | 910 | pci_dev_put(hba->pcidev); |
911 | 911 | ||
912 | if (hba->regview) { | 912 | if (hba->regview) { |
913 | iounmap(hba->regview); | 913 | pci_iounmap(hba->pcidev, hba->regview); |
914 | hba->regview = NULL; | 914 | hba->regview = NULL; |
915 | } | 915 | } |
916 | bnx2i_free_mp_bdt(hba); | 916 | bnx2i_free_mp_bdt(hba); |
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 441d88ad99a7..d109cc3a17b6 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -139,12 +139,12 @@ static void sas_ata_task_done(struct sas_task *task) | |||
139 | if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD || | 139 | if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD || |
140 | ((stat->stat == SAM_STAT_CHECK_CONDITION && | 140 | ((stat->stat == SAM_STAT_CHECK_CONDITION && |
141 | dev->sata_dev.command_set == ATAPI_COMMAND_SET))) { | 141 | dev->sata_dev.command_set == ATAPI_COMMAND_SET))) { |
142 | ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf); | 142 | memcpy(dev->sata_dev.fis, resp->ending_fis, ATA_RESP_FIS_SIZE); |
143 | 143 | ||
144 | if (!link->sactive) { | 144 | if (!link->sactive) { |
145 | qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command); | 145 | qc->err_mask |= ac_err_mask(dev->sata_dev.fis[2]); |
146 | } else { | 146 | } else { |
147 | link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.tf.command); | 147 | link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]); |
148 | if (unlikely(link->eh_info.err_mask)) | 148 | if (unlikely(link->eh_info.err_mask)) |
149 | qc->flags |= ATA_QCFLAG_FAILED; | 149 | qc->flags |= ATA_QCFLAG_FAILED; |
150 | } | 150 | } |
@@ -161,8 +161,8 @@ static void sas_ata_task_done(struct sas_task *task) | |||
161 | qc->flags |= ATA_QCFLAG_FAILED; | 161 | qc->flags |= ATA_QCFLAG_FAILED; |
162 | } | 162 | } |
163 | 163 | ||
164 | dev->sata_dev.tf.feature = 0x04; /* status err */ | 164 | dev->sata_dev.fis[3] = 0x04; /* status err */ |
165 | dev->sata_dev.tf.command = ATA_ERR; | 165 | dev->sata_dev.fis[2] = ATA_ERR; |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
@@ -269,7 +269,7 @@ static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) | |||
269 | { | 269 | { |
270 | struct domain_device *dev = qc->ap->private_data; | 270 | struct domain_device *dev = qc->ap->private_data; |
271 | 271 | ||
272 | memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf)); | 272 | ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf); |
273 | return true; | 273 | return true; |
274 | } | 274 | } |
275 | 275 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 8fd398dffced..ee469274a3fe 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -500,6 +500,8 @@ retry: | |||
500 | goto retry; | 500 | goto retry; |
501 | } | 501 | } |
502 | if (!desc->reslength) { /* zero length read */ | 502 | if (!desc->reslength) { /* zero length read */ |
503 | dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__); | ||
504 | clear_bit(WDM_READ, &desc->flags); | ||
503 | spin_unlock_irq(&desc->iuspin); | 505 | spin_unlock_irq(&desc->iuspin); |
504 | goto retry; | 506 | goto retry; |
505 | } | 507 | } |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 25a7422ee657..8fb484984c86 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2324,12 +2324,16 @@ static unsigned hub_is_wusb(struct usb_hub *hub) | |||
2324 | static int hub_port_reset(struct usb_hub *hub, int port1, | 2324 | static int hub_port_reset(struct usb_hub *hub, int port1, |
2325 | struct usb_device *udev, unsigned int delay, bool warm); | 2325 | struct usb_device *udev, unsigned int delay, bool warm); |
2326 | 2326 | ||
2327 | /* Is a USB 3.0 port in the Inactive state? */ | 2327 | /* Is a USB 3.0 port in the Inactive or Complinance Mode state? |
2328 | static bool hub_port_inactive(struct usb_hub *hub, u16 portstatus) | 2328 | * Port worm reset is required to recover |
2329 | */ | ||
2330 | static bool hub_port_warm_reset_required(struct usb_hub *hub, u16 portstatus) | ||
2329 | { | 2331 | { |
2330 | return hub_is_superspeed(hub->hdev) && | 2332 | return hub_is_superspeed(hub->hdev) && |
2331 | (portstatus & USB_PORT_STAT_LINK_STATE) == | 2333 | (((portstatus & USB_PORT_STAT_LINK_STATE) == |
2332 | USB_SS_PORT_LS_SS_INACTIVE; | 2334 | USB_SS_PORT_LS_SS_INACTIVE) || |
2335 | ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
2336 | USB_SS_PORT_LS_COMP_MOD)) ; | ||
2333 | } | 2337 | } |
2334 | 2338 | ||
2335 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, | 2339 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, |
@@ -2365,7 +2369,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
2365 | * | 2369 | * |
2366 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 | 2370 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 |
2367 | */ | 2371 | */ |
2368 | if (hub_port_inactive(hub, portstatus)) { | 2372 | if (hub_port_warm_reset_required(hub, portstatus)) { |
2369 | int ret; | 2373 | int ret; |
2370 | 2374 | ||
2371 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) | 2375 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) |
@@ -4408,9 +4412,7 @@ static void hub_events(void) | |||
4408 | /* Warm reset a USB3 protocol port if it's in | 4412 | /* Warm reset a USB3 protocol port if it's in |
4409 | * SS.Inactive state. | 4413 | * SS.Inactive state. |
4410 | */ | 4414 | */ |
4411 | if (hub_is_superspeed(hub->hdev) && | 4415 | if (hub_port_warm_reset_required(hub, portstatus)) { |
4412 | (portstatus & USB_PORT_STAT_LINK_STATE) | ||
4413 | == USB_SS_PORT_LS_SS_INACTIVE) { | ||
4414 | dev_dbg(hub_dev, "warm reset port %d\n", i); | 4416 | dev_dbg(hub_dev, "warm reset port %d\n", i); |
4415 | hub_port_reset(hub, i, NULL, | 4417 | hub_port_reset(hub, i, NULL, |
4416 | HUB_BH_RESET_TIME, true); | 4418 | HUB_BH_RESET_TIME, true); |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 17cfb8a1131c..c30435499a02 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -281,14 +281,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
281 | } | 281 | } |
282 | } | 282 | } |
283 | 283 | ||
284 | /* Hold PHYs in reset while initializing EHCI controller */ | ||
284 | if (pdata->phy_reset) { | 285 | if (pdata->phy_reset) { |
285 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | 286 | if (gpio_is_valid(pdata->reset_gpio_port[0])) |
286 | gpio_request_one(pdata->reset_gpio_port[0], | 287 | gpio_set_value_cansleep(pdata->reset_gpio_port[0], 0); |
287 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
288 | 288 | ||
289 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | 289 | if (gpio_is_valid(pdata->reset_gpio_port[1])) |
290 | gpio_request_one(pdata->reset_gpio_port[1], | 290 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 0); |
291 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
292 | 291 | ||
293 | /* Hold the PHY in RESET for enough time till DIR is high */ | 292 | /* Hold the PHY in RESET for enough time till DIR is high */ |
294 | udelay(10); | 293 | udelay(10); |
@@ -330,6 +329,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
330 | omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params); | 329 | omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params); |
331 | 330 | ||
332 | ehci_reset(omap_ehci); | 331 | ehci_reset(omap_ehci); |
332 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
333 | if (ret) { | ||
334 | dev_err(dev, "failed to add hcd with err %d\n", ret); | ||
335 | goto err_add_hcd; | ||
336 | } | ||
333 | 337 | ||
334 | if (pdata->phy_reset) { | 338 | if (pdata->phy_reset) { |
335 | /* Hold the PHY in RESET for enough time till | 339 | /* Hold the PHY in RESET for enough time till |
@@ -344,12 +348,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
344 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1); | 348 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1); |
345 | } | 349 | } |
346 | 350 | ||
347 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
348 | if (ret) { | ||
349 | dev_err(dev, "failed to add hcd with err %d\n", ret); | ||
350 | goto err_add_hcd; | ||
351 | } | ||
352 | |||
353 | /* root ports should always stay powered */ | 351 | /* root ports should always stay powered */ |
354 | ehci_port_power(omap_ehci, 1); | 352 | ehci_port_power(omap_ehci, 1); |
355 | 353 | ||
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 2732ef660c5c..7b01094d7993 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -462,6 +462,42 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, | |||
462 | } | 462 | } |
463 | } | 463 | } |
464 | 464 | ||
465 | /* Updates Link Status for super Speed port */ | ||
466 | static void xhci_hub_report_link_state(u32 *status, u32 status_reg) | ||
467 | { | ||
468 | u32 pls = status_reg & PORT_PLS_MASK; | ||
469 | |||
470 | /* resume state is a xHCI internal state. | ||
471 | * Do not report it to usb core. | ||
472 | */ | ||
473 | if (pls == XDEV_RESUME) | ||
474 | return; | ||
475 | |||
476 | /* When the CAS bit is set then warm reset | ||
477 | * should be performed on port | ||
478 | */ | ||
479 | if (status_reg & PORT_CAS) { | ||
480 | /* The CAS bit can be set while the port is | ||
481 | * in any link state. | ||
482 | * Only roothubs have CAS bit, so we | ||
483 | * pretend to be in compliance mode | ||
484 | * unless we're already in compliance | ||
485 | * or the inactive state. | ||
486 | */ | ||
487 | if (pls != USB_SS_PORT_LS_COMP_MOD && | ||
488 | pls != USB_SS_PORT_LS_SS_INACTIVE) { | ||
489 | pls = USB_SS_PORT_LS_COMP_MOD; | ||
490 | } | ||
491 | /* Return also connection bit - | ||
492 | * hub state machine resets port | ||
493 | * when this bit is set. | ||
494 | */ | ||
495 | pls |= USB_PORT_STAT_CONNECTION; | ||
496 | } | ||
497 | /* update status field */ | ||
498 | *status |= pls; | ||
499 | } | ||
500 | |||
465 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | 501 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, |
466 | u16 wIndex, char *buf, u16 wLength) | 502 | u16 wIndex, char *buf, u16 wLength) |
467 | { | 503 | { |
@@ -606,13 +642,9 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
606 | else | 642 | else |
607 | status |= USB_PORT_STAT_POWER; | 643 | status |= USB_PORT_STAT_POWER; |
608 | } | 644 | } |
609 | /* Port Link State */ | 645 | /* Update Port Link State for super speed ports*/ |
610 | if (hcd->speed == HCD_USB3) { | 646 | if (hcd->speed == HCD_USB3) { |
611 | /* resume state is a xHCI internal state. | 647 | xhci_hub_report_link_state(&status, temp); |
612 | * Do not report it to usb core. | ||
613 | */ | ||
614 | if ((temp & PORT_PLS_MASK) != XDEV_RESUME) | ||
615 | status |= (temp & PORT_PLS_MASK); | ||
616 | } | 648 | } |
617 | if (bus_state->port_c_suspend & (1 << wIndex)) | 649 | if (bus_state->port_c_suspend & (1 << wIndex)) |
618 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; | 650 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 23b4aefd1036..8275645889da 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -885,6 +885,17 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, | |||
885 | num_trbs_free_temp = ep_ring->num_trbs_free; | 885 | num_trbs_free_temp = ep_ring->num_trbs_free; |
886 | dequeue_temp = ep_ring->dequeue; | 886 | dequeue_temp = ep_ring->dequeue; |
887 | 887 | ||
888 | /* If we get two back-to-back stalls, and the first stalled transfer | ||
889 | * ends just before a link TRB, the dequeue pointer will be left on | ||
890 | * the link TRB by the code in the while loop. So we have to update | ||
891 | * the dequeue pointer one segment further, or we'll jump off | ||
892 | * the segment into la-la-land. | ||
893 | */ | ||
894 | if (last_trb(xhci, ep_ring, ep_ring->deq_seg, ep_ring->dequeue)) { | ||
895 | ep_ring->deq_seg = ep_ring->deq_seg->next; | ||
896 | ep_ring->dequeue = ep_ring->deq_seg->trbs; | ||
897 | } | ||
898 | |||
888 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { | 899 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { |
889 | /* We have more usable TRBs */ | 900 | /* We have more usable TRBs */ |
890 | ep_ring->num_trbs_free++; | 901 | ep_ring->num_trbs_free++; |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index de3d6e3e57be..55c0785810c9 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -341,7 +341,11 @@ struct xhci_op_regs { | |||
341 | #define PORT_PLC (1 << 22) | 341 | #define PORT_PLC (1 << 22) |
342 | /* port configure error change - port failed to configure its link partner */ | 342 | /* port configure error change - port failed to configure its link partner */ |
343 | #define PORT_CEC (1 << 23) | 343 | #define PORT_CEC (1 << 23) |
344 | /* bit 24 reserved */ | 344 | /* Cold Attach Status - xHC can set this bit to report device attached during |
345 | * Sx state. Warm port reset should be perfomed to clear this bit and move port | ||
346 | * to connected state. | ||
347 | */ | ||
348 | #define PORT_CAS (1 << 24) | ||
345 | /* wake on connect (enable) */ | 349 | /* wake on connect (enable) */ |
346 | #define PORT_WKCONN_E (1 << 25) | 350 | #define PORT_WKCONN_E (1 << 25) |
347 | /* wake on disconnect (enable) */ | 351 | /* wake on disconnect (enable) */ |
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index 81423f7361db..d47eb06fe463 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c | |||
@@ -222,14 +222,6 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
222 | metro_priv->throttled = 0; | 222 | metro_priv->throttled = 0; |
223 | spin_unlock_irqrestore(&metro_priv->lock, flags); | 223 | spin_unlock_irqrestore(&metro_priv->lock, flags); |
224 | 224 | ||
225 | /* | ||
226 | * Force low_latency on so that our tty_push actually forces the data | ||
227 | * through, otherwise it is scheduled, and with high data rates (like | ||
228 | * with OHCI) data can get lost. | ||
229 | */ | ||
230 | if (tty) | ||
231 | tty->low_latency = 1; | ||
232 | |||
233 | /* Clear the urb pipe. */ | 225 | /* Clear the urb pipe. */ |
234 | usb_clear_halt(serial->dev, port->interrupt_in_urb->pipe); | 226 | usb_clear_halt(serial->dev, port->interrupt_in_urb->pipe); |
235 | 227 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index adf8ce72be50..417ab1b0aa30 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -497,6 +497,15 @@ static void option_instat_callback(struct urb *urb); | |||
497 | 497 | ||
498 | /* MediaTek products */ | 498 | /* MediaTek products */ |
499 | #define MEDIATEK_VENDOR_ID 0x0e8d | 499 | #define MEDIATEK_VENDOR_ID 0x0e8d |
500 | #define MEDIATEK_PRODUCT_DC_1COM 0x00a0 | ||
501 | #define MEDIATEK_PRODUCT_DC_4COM 0x00a5 | ||
502 | #define MEDIATEK_PRODUCT_DC_5COM 0x00a4 | ||
503 | #define MEDIATEK_PRODUCT_7208_1COM 0x7101 | ||
504 | #define MEDIATEK_PRODUCT_7208_2COM 0x7102 | ||
505 | #define MEDIATEK_PRODUCT_FP_1COM 0x0003 | ||
506 | #define MEDIATEK_PRODUCT_FP_2COM 0x0023 | ||
507 | #define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 | ||
508 | #define MEDIATEK_PRODUCT_FPDC_2COM 0x0033 | ||
500 | 509 | ||
501 | /* Cellient products */ | 510 | /* Cellient products */ |
502 | #define CELLIENT_VENDOR_ID 0x2692 | 511 | #define CELLIENT_VENDOR_ID 0x2692 |
@@ -554,6 +563,10 @@ static const struct option_blacklist_info net_intf1_blacklist = { | |||
554 | .reserved = BIT(1), | 563 | .reserved = BIT(1), |
555 | }; | 564 | }; |
556 | 565 | ||
566 | static const struct option_blacklist_info net_intf2_blacklist = { | ||
567 | .reserved = BIT(2), | ||
568 | }; | ||
569 | |||
557 | static const struct option_blacklist_info net_intf3_blacklist = { | 570 | static const struct option_blacklist_info net_intf3_blacklist = { |
558 | .reserved = BIT(3), | 571 | .reserved = BIT(3), |
559 | }; | 572 | }; |
@@ -1099,6 +1112,8 @@ static const struct usb_device_id option_ids[] = { | |||
1099 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, | 1112 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, |
1100 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, | 1113 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, |
1101 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, | 1114 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, |
1115 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff), | ||
1116 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | ||
1102 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, | 1117 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, |
1103 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, | 1118 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, |
1104 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, | 1119 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, |
@@ -1240,6 +1255,17 @@ static const struct usb_device_id option_ids[] = { | |||
1240 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, | 1255 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, |
1241 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, | 1256 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, |
1242 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ | 1257 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ |
1258 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_1COM, 0x0a, 0x00, 0x00) }, | ||
1259 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x02, 0x01) }, | ||
1260 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x00, 0x00) }, | ||
1261 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x02, 0x01) }, | ||
1262 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x00, 0x00) }, | ||
1263 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_1COM, 0x02, 0x00, 0x00) }, | ||
1264 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_2COM, 0x02, 0x02, 0x01) }, | ||
1265 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_1COM, 0x0a, 0x00, 0x00) }, | ||
1266 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, | ||
1267 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, | ||
1268 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, | ||
1243 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | 1269 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, |
1244 | { } /* Terminating entry */ | 1270 | { } /* Terminating entry */ |
1245 | }; | 1271 | }; |
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 5066eee10ccf..58bd9c27369d 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/suspend.h> | ||
35 | 36 | ||
36 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
37 | 38 | ||
@@ -201,6 +202,28 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) | |||
201 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ | 202 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ |
202 | 203 | ||
203 | /* PLATFORM DEVICE */ | 204 | /* PLATFORM DEVICE */ |
205 | static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d) | ||
206 | { | ||
207 | DSSDBG("pm notif %lu\n", v); | ||
208 | |||
209 | switch (v) { | ||
210 | case PM_SUSPEND_PREPARE: | ||
211 | DSSDBG("suspending displays\n"); | ||
212 | return dss_suspend_all_devices(); | ||
213 | |||
214 | case PM_POST_SUSPEND: | ||
215 | DSSDBG("resuming displays\n"); | ||
216 | return dss_resume_all_devices(); | ||
217 | |||
218 | default: | ||
219 | return 0; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | static struct notifier_block omap_dss_pm_notif_block = { | ||
224 | .notifier_call = omap_dss_pm_notif, | ||
225 | }; | ||
226 | |||
204 | static int __init omap_dss_probe(struct platform_device *pdev) | 227 | static int __init omap_dss_probe(struct platform_device *pdev) |
205 | { | 228 | { |
206 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 229 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
@@ -224,6 +247,8 @@ static int __init omap_dss_probe(struct platform_device *pdev) | |||
224 | else if (pdata->default_device) | 247 | else if (pdata->default_device) |
225 | core.default_display_name = pdata->default_device->name; | 248 | core.default_display_name = pdata->default_device->name; |
226 | 249 | ||
250 | register_pm_notifier(&omap_dss_pm_notif_block); | ||
251 | |||
227 | return 0; | 252 | return 0; |
228 | 253 | ||
229 | err_debugfs: | 254 | err_debugfs: |
@@ -233,6 +258,8 @@ err_debugfs: | |||
233 | 258 | ||
234 | static int omap_dss_remove(struct platform_device *pdev) | 259 | static int omap_dss_remove(struct platform_device *pdev) |
235 | { | 260 | { |
261 | unregister_pm_notifier(&omap_dss_pm_notif_block); | ||
262 | |||
236 | dss_uninitialize_debugfs(); | 263 | dss_uninitialize_debugfs(); |
237 | 264 | ||
238 | dss_uninit_overlays(pdev); | 265 | dss_uninit_overlays(pdev); |
@@ -247,25 +274,9 @@ static void omap_dss_shutdown(struct platform_device *pdev) | |||
247 | dss_disable_all_devices(); | 274 | dss_disable_all_devices(); |
248 | } | 275 | } |
249 | 276 | ||
250 | static int omap_dss_suspend(struct platform_device *pdev, pm_message_t state) | ||
251 | { | ||
252 | DSSDBG("suspend %d\n", state.event); | ||
253 | |||
254 | return dss_suspend_all_devices(); | ||
255 | } | ||
256 | |||
257 | static int omap_dss_resume(struct platform_device *pdev) | ||
258 | { | ||
259 | DSSDBG("resume\n"); | ||
260 | |||
261 | return dss_resume_all_devices(); | ||
262 | } | ||
263 | |||
264 | static struct platform_driver omap_dss_driver = { | 277 | static struct platform_driver omap_dss_driver = { |
265 | .remove = omap_dss_remove, | 278 | .remove = omap_dss_remove, |
266 | .shutdown = omap_dss_shutdown, | 279 | .shutdown = omap_dss_shutdown, |
267 | .suspend = omap_dss_suspend, | ||
268 | .resume = omap_dss_resume, | ||
269 | .driver = { | 280 | .driver = { |
270 | .name = "omapdss", | 281 | .name = "omapdss", |
271 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 4749ac356469..397d4eee11bb 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -384,7 +384,7 @@ void dispc_runtime_put(void) | |||
384 | DSSDBG("dispc_runtime_put\n"); | 384 | DSSDBG("dispc_runtime_put\n"); |
385 | 385 | ||
386 | r = pm_runtime_put_sync(&dispc.pdev->dev); | 386 | r = pm_runtime_put_sync(&dispc.pdev->dev); |
387 | WARN_ON(r < 0); | 387 | WARN_ON(r < 0 && r != -ENOSYS); |
388 | } | 388 | } |
389 | 389 | ||
390 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) | 390 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index ca8382d346e9..14ce8cc079e3 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -1075,7 +1075,7 @@ void dsi_runtime_put(struct platform_device *dsidev) | |||
1075 | DSSDBG("dsi_runtime_put\n"); | 1075 | DSSDBG("dsi_runtime_put\n"); |
1076 | 1076 | ||
1077 | r = pm_runtime_put_sync(&dsi->pdev->dev); | 1077 | r = pm_runtime_put_sync(&dsi->pdev->dev); |
1078 | WARN_ON(r < 0); | 1078 | WARN_ON(r < 0 && r != -ENOSYS); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | /* source clock for DSI PLL. this could also be PCLKFREE */ | 1081 | /* source clock for DSI PLL. this could also be PCLKFREE */ |
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 770632359a17..d2b57197b292 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
@@ -731,7 +731,7 @@ static void dss_runtime_put(void) | |||
731 | DSSDBG("dss_runtime_put\n"); | 731 | DSSDBG("dss_runtime_put\n"); |
732 | 732 | ||
733 | r = pm_runtime_put_sync(&dss.pdev->dev); | 733 | r = pm_runtime_put_sync(&dss.pdev->dev); |
734 | WARN_ON(r < 0 && r != -EBUSY); | 734 | WARN_ON(r < 0 && r != -ENOSYS && r != -EBUSY); |
735 | } | 735 | } |
736 | 736 | ||
737 | /* DEBUGFS */ | 737 | /* DEBUGFS */ |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 8195c7166d20..26a2430a7028 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -138,7 +138,7 @@ static void hdmi_runtime_put(void) | |||
138 | DSSDBG("hdmi_runtime_put\n"); | 138 | DSSDBG("hdmi_runtime_put\n"); |
139 | 139 | ||
140 | r = pm_runtime_put_sync(&hdmi.pdev->dev); | 140 | r = pm_runtime_put_sync(&hdmi.pdev->dev); |
141 | WARN_ON(r < 0); | 141 | WARN_ON(r < 0 && r != -ENOSYS); |
142 | } | 142 | } |
143 | 143 | ||
144 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) | 144 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) |
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 3d8c206e90e5..7985fa12b9b4 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -141,7 +141,7 @@ static void rfbi_runtime_put(void) | |||
141 | DSSDBG("rfbi_runtime_put\n"); | 141 | DSSDBG("rfbi_runtime_put\n"); |
142 | 142 | ||
143 | r = pm_runtime_put_sync(&rfbi.pdev->dev); | 143 | r = pm_runtime_put_sync(&rfbi.pdev->dev); |
144 | WARN_ON(r < 0); | 144 | WARN_ON(r < 0 && r != -ENOSYS); |
145 | } | 145 | } |
146 | 146 | ||
147 | void rfbi_bus_lock(void) | 147 | void rfbi_bus_lock(void) |
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 2b8973931ff4..3907c8b6ecbc 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
@@ -402,7 +402,7 @@ static void venc_runtime_put(void) | |||
402 | DSSDBG("venc_runtime_put\n"); | 402 | DSSDBG("venc_runtime_put\n"); |
403 | 403 | ||
404 | r = pm_runtime_put_sync(&venc.pdev->dev); | 404 | r = pm_runtime_put_sync(&venc.pdev->dev); |
405 | WARN_ON(r < 0); | 405 | WARN_ON(r < 0 && r != -ENOSYS); |
406 | } | 406 | } |
407 | 407 | ||
408 | static const struct venc_config *venc_timings_to_config( | 408 | static const struct venc_config *venc_timings_to_config( |
diff --git a/fs/buffer.c b/fs/buffer.c index 838a9cf246bd..c7062c896d7c 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -1036,6 +1036,9 @@ grow_buffers(struct block_device *bdev, sector_t block, int size) | |||
1036 | static struct buffer_head * | 1036 | static struct buffer_head * |
1037 | __getblk_slow(struct block_device *bdev, sector_t block, int size) | 1037 | __getblk_slow(struct block_device *bdev, sector_t block, int size) |
1038 | { | 1038 | { |
1039 | int ret; | ||
1040 | struct buffer_head *bh; | ||
1041 | |||
1039 | /* Size must be multiple of hard sectorsize */ | 1042 | /* Size must be multiple of hard sectorsize */ |
1040 | if (unlikely(size & (bdev_logical_block_size(bdev)-1) || | 1043 | if (unlikely(size & (bdev_logical_block_size(bdev)-1) || |
1041 | (size < 512 || size > PAGE_SIZE))) { | 1044 | (size < 512 || size > PAGE_SIZE))) { |
@@ -1048,20 +1051,21 @@ __getblk_slow(struct block_device *bdev, sector_t block, int size) | |||
1048 | return NULL; | 1051 | return NULL; |
1049 | } | 1052 | } |
1050 | 1053 | ||
1051 | for (;;) { | 1054 | retry: |
1052 | struct buffer_head * bh; | 1055 | bh = __find_get_block(bdev, block, size); |
1053 | int ret; | 1056 | if (bh) |
1057 | return bh; | ||
1054 | 1058 | ||
1059 | ret = grow_buffers(bdev, block, size); | ||
1060 | if (ret == 0) { | ||
1061 | free_more_memory(); | ||
1062 | goto retry; | ||
1063 | } else if (ret > 0) { | ||
1055 | bh = __find_get_block(bdev, block, size); | 1064 | bh = __find_get_block(bdev, block, size); |
1056 | if (bh) | 1065 | if (bh) |
1057 | return bh; | 1066 | return bh; |
1058 | |||
1059 | ret = grow_buffers(bdev, block, size); | ||
1060 | if (ret < 0) | ||
1061 | return NULL; | ||
1062 | if (ret == 0) | ||
1063 | free_more_memory(); | ||
1064 | } | 1067 | } |
1068 | return NULL; | ||
1065 | } | 1069 | } |
1066 | 1070 | ||
1067 | /* | 1071 | /* |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index a3d81ebf6d86..0038b32cb362 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -738,22 +738,21 @@ static int | |||
738 | fat_encode_fh(struct inode *inode, __u32 *fh, int *lenp, struct inode *parent) | 738 | fat_encode_fh(struct inode *inode, __u32 *fh, int *lenp, struct inode *parent) |
739 | { | 739 | { |
740 | int len = *lenp; | 740 | int len = *lenp; |
741 | u32 ipos_h, ipos_m, ipos_l; | 741 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); |
742 | loff_t i_pos; | ||
742 | 743 | ||
743 | if (len < 5) { | 744 | if (len < 5) { |
744 | *lenp = 5; | 745 | *lenp = 5; |
745 | return 255; /* no room */ | 746 | return 255; /* no room */ |
746 | } | 747 | } |
747 | 748 | ||
748 | ipos_h = MSDOS_I(inode)->i_pos >> 8; | 749 | i_pos = fat_i_pos_read(sbi, inode); |
749 | ipos_m = (MSDOS_I(inode)->i_pos & 0xf0) << 24; | ||
750 | ipos_l = (MSDOS_I(inode)->i_pos & 0x0f) << 28; | ||
751 | *lenp = 5; | 750 | *lenp = 5; |
752 | fh[0] = inode->i_ino; | 751 | fh[0] = inode->i_ino; |
753 | fh[1] = inode->i_generation; | 752 | fh[1] = inode->i_generation; |
754 | fh[2] = ipos_h; | 753 | fh[2] = i_pos >> 8; |
755 | fh[3] = ipos_m | MSDOS_I(inode)->i_logstart; | 754 | fh[3] = ((i_pos & 0xf0) << 24) | MSDOS_I(inode)->i_logstart; |
756 | fh[4] = ipos_l; | 755 | fh[4] = (i_pos & 0x0f) << 28; |
757 | if (parent) | 756 | if (parent) |
758 | fh[4] |= MSDOS_I(parent)->i_logstart; | 757 | fh[4] |= MSDOS_I(parent)->i_logstart; |
759 | return 3; | 758 | return 3; |
diff --git a/fs/locks.c b/fs/locks.c index 814c51d0de47..fce6238d52c1 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1465,7 +1465,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp) | |||
1465 | case F_WRLCK: | 1465 | case F_WRLCK: |
1466 | return generic_add_lease(filp, arg, flp); | 1466 | return generic_add_lease(filp, arg, flp); |
1467 | default: | 1467 | default: |
1468 | BUG(); | 1468 | return -EINVAL; |
1469 | } | 1469 | } |
1470 | } | 1470 | } |
1471 | EXPORT_SYMBOL(generic_setlease); | 1471 | EXPORT_SYMBOL(generic_setlease); |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 9a4cbfc85d81..48253372ab1d 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -484,6 +484,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | |||
484 | 484 | ||
485 | list_for_each_entry_safe(req, tmp, &reqs, wb_list) { | 485 | list_for_each_entry_safe(req, tmp, &reqs, wb_list) { |
486 | if (!nfs_pageio_add_request(&desc, req)) { | 486 | if (!nfs_pageio_add_request(&desc, req)) { |
487 | nfs_list_remove_request(req); | ||
487 | nfs_list_add_request(req, &failed); | 488 | nfs_list_add_request(req, &failed); |
488 | spin_lock(cinfo.lock); | 489 | spin_lock(cinfo.lock); |
489 | dreq->flags = 0; | 490 | dreq->flags = 0; |
@@ -494,8 +495,11 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | |||
494 | } | 495 | } |
495 | nfs_pageio_complete(&desc); | 496 | nfs_pageio_complete(&desc); |
496 | 497 | ||
497 | while (!list_empty(&failed)) | 498 | while (!list_empty(&failed)) { |
499 | req = nfs_list_entry(failed.next); | ||
500 | nfs_list_remove_request(req); | ||
498 | nfs_unlock_and_release_request(req); | 501 | nfs_unlock_and_release_request(req); |
502 | } | ||
499 | 503 | ||
500 | if (put_dreq(dreq)) | 504 | if (put_dreq(dreq)) |
501 | nfs_direct_write_complete(dreq, dreq->inode); | 505 | nfs_direct_write_complete(dreq, dreq->inode); |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 906f09c7d842..06228192f64e 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2860,6 +2860,8 @@ static struct dentry *nfs4_try_mount(int flags, const char *dev_name, | |||
2860 | 2860 | ||
2861 | dfprintk(MOUNT, "--> nfs4_try_mount()\n"); | 2861 | dfprintk(MOUNT, "--> nfs4_try_mount()\n"); |
2862 | 2862 | ||
2863 | mount_info->fill_super = nfs4_fill_super; | ||
2864 | |||
2863 | export_path = data->nfs_server.export_path; | 2865 | export_path = data->nfs_server.export_path; |
2864 | data->nfs_server.export_path = "/"; | 2866 | data->nfs_server.export_path = "/"; |
2865 | root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info, | 2867 | root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info, |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 98513c8ed589..7602783d7f41 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1950,7 +1950,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, | |||
1950 | if (ret < 0) | 1950 | if (ret < 0) |
1951 | mlog_errno(ret); | 1951 | mlog_errno(ret); |
1952 | 1952 | ||
1953 | if (file->f_flags & O_SYNC) | 1953 | if (file && (file->f_flags & O_SYNC)) |
1954 | handle->h_sync = 1; | 1954 | handle->h_sync = 1; |
1955 | 1955 | ||
1956 | ocfs2_commit_trans(osb, handle); | 1956 | ocfs2_commit_trans(osb, handle); |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index fbb0b478a346..d5378d028589 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -110,6 +110,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
110 | 110 | ||
111 | /* prevent the page from being discarded on memory pressure */ | 111 | /* prevent the page from being discarded on memory pressure */ |
112 | SetPageDirty(page); | 112 | SetPageDirty(page); |
113 | SetPageUptodate(page); | ||
113 | 114 | ||
114 | unlock_page(page); | 115 | unlock_page(page); |
115 | put_page(page); | 116 | put_page(page); |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 324fe08ea3b1..6d6795d46a75 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -91,6 +91,11 @@ extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, | |||
91 | unsigned long size, | 91 | unsigned long size, |
92 | unsigned long align, | 92 | unsigned long align, |
93 | unsigned long goal); | 93 | unsigned long goal); |
94 | void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | ||
95 | unsigned long size, | ||
96 | unsigned long align, | ||
97 | unsigned long goal, | ||
98 | unsigned long limit); | ||
94 | extern void *__alloc_bootmem_low(unsigned long size, | 99 | extern void *__alloc_bootmem_low(unsigned long size, |
95 | unsigned long align, | 100 | unsigned long align, |
96 | unsigned long goal); | 101 | unsigned long goal); |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index a6bb10235148..19dc455b4f3d 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -50,9 +50,7 @@ phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, | |||
50 | phys_addr_t size, phys_addr_t align, int nid); | 50 | phys_addr_t size, phys_addr_t align, int nid); |
51 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, | 51 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, |
52 | phys_addr_t size, phys_addr_t align); | 52 | phys_addr_t size, phys_addr_t align); |
53 | int memblock_free_reserved_regions(void); | 53 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); |
54 | int memblock_reserve_reserved_regions(void); | ||
55 | |||
56 | void memblock_allow_resize(void); | 54 | void memblock_allow_resize(void); |
57 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); | 55 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); |
58 | int memblock_add(phys_addr_t base, phys_addr_t size); | 56 | int memblock_add(phys_addr_t base, phys_addr_t size); |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2427706f78b4..68c569fcbb66 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -694,7 +694,7 @@ typedef struct pglist_data { | |||
694 | range, including holes */ | 694 | range, including holes */ |
695 | int node_id; | 695 | int node_id; |
696 | wait_queue_head_t kswapd_wait; | 696 | wait_queue_head_t kswapd_wait; |
697 | struct task_struct *kswapd; | 697 | struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ |
698 | int kswapd_max_order; | 698 | int kswapd_max_order; |
699 | enum zone_type classzone_idx; | 699 | enum zone_type classzone_idx; |
700 | } pg_data_t; | 700 | } pg_data_t; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index fefb4e19bf6a..d8c379dba6ad 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -176,8 +176,6 @@ enum pci_dev_flags { | |||
176 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | 176 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, |
177 | /* Provide indication device is assigned by a Virtual Machine Manager */ | 177 | /* Provide indication device is assigned by a Virtual Machine Manager */ |
178 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, | 178 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, |
179 | /* Device causes system crash if in D3 during S3 sleep */ | ||
180 | PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8, | ||
181 | }; | 179 | }; |
182 | 180 | ||
183 | enum pci_irq_reroute_variant { | 181 | enum pci_irq_reroute_variant { |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index f4f1c96dca72..10ce74f589c5 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -163,6 +163,8 @@ enum ata_command_set { | |||
163 | ATAPI_COMMAND_SET = 1, | 163 | ATAPI_COMMAND_SET = 1, |
164 | }; | 164 | }; |
165 | 165 | ||
166 | #define ATA_RESP_FIS_SIZE 24 | ||
167 | |||
166 | struct sata_device { | 168 | struct sata_device { |
167 | enum ata_command_set command_set; | 169 | enum ata_command_set command_set; |
168 | struct smp_resp rps_resp; /* report_phy_sata_resp */ | 170 | struct smp_resp rps_resp; /* report_phy_sata_resp */ |
@@ -171,7 +173,7 @@ struct sata_device { | |||
171 | 173 | ||
172 | struct ata_port *ap; | 174 | struct ata_port *ap; |
173 | struct ata_host ata_host; | 175 | struct ata_host ata_host; |
174 | struct ata_taskfile tf; | 176 | u8 fis[ATA_RESP_FIS_SIZE]; |
175 | }; | 177 | }; |
176 | 178 | ||
177 | enum { | 179 | enum { |
@@ -537,7 +539,7 @@ enum exec_status { | |||
537 | */ | 539 | */ |
538 | struct ata_task_resp { | 540 | struct ata_task_resp { |
539 | u16 frame_len; | 541 | u16 frame_len; |
540 | u8 ending_fis[24]; /* dev to host or data-in */ | 542 | u8 ending_fis[ATA_RESP_FIS_SIZE]; /* dev to host or data-in */ |
541 | }; | 543 | }; |
542 | 544 | ||
543 | #define SAS_STATUS_BUF_SIZE 96 | 545 | #define SAS_STATUS_BUF_SIZE 96 |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 1e1198546c72..ac06cc595890 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -134,10 +134,16 @@ struct scsi_cmnd { | |||
134 | 134 | ||
135 | static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) | 135 | static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) |
136 | { | 136 | { |
137 | struct scsi_driver **sdp; | ||
138 | |||
137 | if (!cmd->request->rq_disk) | 139 | if (!cmd->request->rq_disk) |
138 | return NULL; | 140 | return NULL; |
139 | 141 | ||
140 | return *(struct scsi_driver **)cmd->request->rq_disk->private_data; | 142 | sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data; |
143 | if (!sdp) | ||
144 | return NULL; | ||
145 | |||
146 | return *sdp; | ||
141 | } | 147 | } |
142 | 148 | ||
143 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); | 149 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
diff --git a/kernel/printk.c b/kernel/printk.c index dba18211685e..177fa49357a5 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -194,8 +194,10 @@ static int console_may_schedule; | |||
194 | */ | 194 | */ |
195 | 195 | ||
196 | enum log_flags { | 196 | enum log_flags { |
197 | LOG_DEFAULT = 0, | 197 | LOG_NOCONS = 1, /* already flushed, do not print to console */ |
198 | LOG_NOCONS = 1, /* already flushed, do not print to console */ | 198 | LOG_NEWLINE = 2, /* text ended with a newline */ |
199 | LOG_PREFIX = 4, /* text started with a prefix */ | ||
200 | LOG_CONT = 8, /* text is a fragment of a continuation line */ | ||
199 | }; | 201 | }; |
200 | 202 | ||
201 | struct log { | 203 | struct log { |
@@ -217,6 +219,8 @@ static DEFINE_RAW_SPINLOCK(logbuf_lock); | |||
217 | /* the next printk record to read by syslog(READ) or /proc/kmsg */ | 219 | /* the next printk record to read by syslog(READ) or /proc/kmsg */ |
218 | static u64 syslog_seq; | 220 | static u64 syslog_seq; |
219 | static u32 syslog_idx; | 221 | static u32 syslog_idx; |
222 | static enum log_flags syslog_prev; | ||
223 | static size_t syslog_partial; | ||
220 | 224 | ||
221 | /* index and sequence number of the first record stored in the buffer */ | 225 | /* index and sequence number of the first record stored in the buffer */ |
222 | static u64 log_first_seq; | 226 | static u64 log_first_seq; |
@@ -430,20 +434,20 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
430 | ret = mutex_lock_interruptible(&user->lock); | 434 | ret = mutex_lock_interruptible(&user->lock); |
431 | if (ret) | 435 | if (ret) |
432 | return ret; | 436 | return ret; |
433 | raw_spin_lock(&logbuf_lock); | 437 | raw_spin_lock_irq(&logbuf_lock); |
434 | while (user->seq == log_next_seq) { | 438 | while (user->seq == log_next_seq) { |
435 | if (file->f_flags & O_NONBLOCK) { | 439 | if (file->f_flags & O_NONBLOCK) { |
436 | ret = -EAGAIN; | 440 | ret = -EAGAIN; |
437 | raw_spin_unlock(&logbuf_lock); | 441 | raw_spin_unlock_irq(&logbuf_lock); |
438 | goto out; | 442 | goto out; |
439 | } | 443 | } |
440 | 444 | ||
441 | raw_spin_unlock(&logbuf_lock); | 445 | raw_spin_unlock_irq(&logbuf_lock); |
442 | ret = wait_event_interruptible(log_wait, | 446 | ret = wait_event_interruptible(log_wait, |
443 | user->seq != log_next_seq); | 447 | user->seq != log_next_seq); |
444 | if (ret) | 448 | if (ret) |
445 | goto out; | 449 | goto out; |
446 | raw_spin_lock(&logbuf_lock); | 450 | raw_spin_lock_irq(&logbuf_lock); |
447 | } | 451 | } |
448 | 452 | ||
449 | if (user->seq < log_first_seq) { | 453 | if (user->seq < log_first_seq) { |
@@ -451,7 +455,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
451 | user->idx = log_first_idx; | 455 | user->idx = log_first_idx; |
452 | user->seq = log_first_seq; | 456 | user->seq = log_first_seq; |
453 | ret = -EPIPE; | 457 | ret = -EPIPE; |
454 | raw_spin_unlock(&logbuf_lock); | 458 | raw_spin_unlock_irq(&logbuf_lock); |
455 | goto out; | 459 | goto out; |
456 | } | 460 | } |
457 | 461 | ||
@@ -465,7 +469,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
465 | for (i = 0; i < msg->text_len; i++) { | 469 | for (i = 0; i < msg->text_len; i++) { |
466 | unsigned char c = log_text(msg)[i]; | 470 | unsigned char c = log_text(msg)[i]; |
467 | 471 | ||
468 | if (c < ' ' || c >= 128) | 472 | if (c < ' ' || c >= 127 || c == '\\') |
469 | len += sprintf(user->buf + len, "\\x%02x", c); | 473 | len += sprintf(user->buf + len, "\\x%02x", c); |
470 | else | 474 | else |
471 | user->buf[len++] = c; | 475 | user->buf[len++] = c; |
@@ -489,7 +493,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
489 | continue; | 493 | continue; |
490 | } | 494 | } |
491 | 495 | ||
492 | if (c < ' ' || c >= 128) { | 496 | if (c < ' ' || c >= 127 || c == '\\') { |
493 | len += sprintf(user->buf + len, "\\x%02x", c); | 497 | len += sprintf(user->buf + len, "\\x%02x", c); |
494 | continue; | 498 | continue; |
495 | } | 499 | } |
@@ -501,7 +505,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
501 | 505 | ||
502 | user->idx = log_next(user->idx); | 506 | user->idx = log_next(user->idx); |
503 | user->seq++; | 507 | user->seq++; |
504 | raw_spin_unlock(&logbuf_lock); | 508 | raw_spin_unlock_irq(&logbuf_lock); |
505 | 509 | ||
506 | if (len > count) { | 510 | if (len > count) { |
507 | ret = -EINVAL; | 511 | ret = -EINVAL; |
@@ -528,7 +532,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) | |||
528 | if (offset) | 532 | if (offset) |
529 | return -ESPIPE; | 533 | return -ESPIPE; |
530 | 534 | ||
531 | raw_spin_lock(&logbuf_lock); | 535 | raw_spin_lock_irq(&logbuf_lock); |
532 | switch (whence) { | 536 | switch (whence) { |
533 | case SEEK_SET: | 537 | case SEEK_SET: |
534 | /* the first record */ | 538 | /* the first record */ |
@@ -552,7 +556,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) | |||
552 | default: | 556 | default: |
553 | ret = -EINVAL; | 557 | ret = -EINVAL; |
554 | } | 558 | } |
555 | raw_spin_unlock(&logbuf_lock); | 559 | raw_spin_unlock_irq(&logbuf_lock); |
556 | return ret; | 560 | return ret; |
557 | } | 561 | } |
558 | 562 | ||
@@ -566,14 +570,14 @@ static unsigned int devkmsg_poll(struct file *file, poll_table *wait) | |||
566 | 570 | ||
567 | poll_wait(file, &log_wait, wait); | 571 | poll_wait(file, &log_wait, wait); |
568 | 572 | ||
569 | raw_spin_lock(&logbuf_lock); | 573 | raw_spin_lock_irq(&logbuf_lock); |
570 | if (user->seq < log_next_seq) { | 574 | if (user->seq < log_next_seq) { |
571 | /* return error when data has vanished underneath us */ | 575 | /* return error when data has vanished underneath us */ |
572 | if (user->seq < log_first_seq) | 576 | if (user->seq < log_first_seq) |
573 | ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI; | 577 | ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI; |
574 | ret = POLLIN|POLLRDNORM; | 578 | ret = POLLIN|POLLRDNORM; |
575 | } | 579 | } |
576 | raw_spin_unlock(&logbuf_lock); | 580 | raw_spin_unlock_irq(&logbuf_lock); |
577 | 581 | ||
578 | return ret; | 582 | return ret; |
579 | } | 583 | } |
@@ -597,10 +601,10 @@ static int devkmsg_open(struct inode *inode, struct file *file) | |||
597 | 601 | ||
598 | mutex_init(&user->lock); | 602 | mutex_init(&user->lock); |
599 | 603 | ||
600 | raw_spin_lock(&logbuf_lock); | 604 | raw_spin_lock_irq(&logbuf_lock); |
601 | user->idx = log_first_idx; | 605 | user->idx = log_first_idx; |
602 | user->seq = log_first_seq; | 606 | user->seq = log_first_seq; |
603 | raw_spin_unlock(&logbuf_lock); | 607 | raw_spin_unlock_irq(&logbuf_lock); |
604 | 608 | ||
605 | file->private_data = user; | 609 | file->private_data = user; |
606 | return 0; | 610 | return 0; |
@@ -818,15 +822,18 @@ static size_t print_time(u64 ts, char *buf) | |||
818 | static size_t print_prefix(const struct log *msg, bool syslog, char *buf) | 822 | static size_t print_prefix(const struct log *msg, bool syslog, char *buf) |
819 | { | 823 | { |
820 | size_t len = 0; | 824 | size_t len = 0; |
825 | unsigned int prefix = (msg->facility << 3) | msg->level; | ||
821 | 826 | ||
822 | if (syslog) { | 827 | if (syslog) { |
823 | if (buf) { | 828 | if (buf) { |
824 | len += sprintf(buf, "<%u>", msg->level); | 829 | len += sprintf(buf, "<%u>", prefix); |
825 | } else { | 830 | } else { |
826 | len += 3; | 831 | len += 3; |
827 | if (msg->level > 9) | 832 | if (prefix > 999) |
828 | len++; | 833 | len += 3; |
829 | if (msg->level > 99) | 834 | else if (prefix > 99) |
835 | len += 2; | ||
836 | else if (prefix > 9) | ||
830 | len++; | 837 | len++; |
831 | } | 838 | } |
832 | } | 839 | } |
@@ -835,13 +842,26 @@ static size_t print_prefix(const struct log *msg, bool syslog, char *buf) | |||
835 | return len; | 842 | return len; |
836 | } | 843 | } |
837 | 844 | ||
838 | static size_t msg_print_text(const struct log *msg, bool syslog, | 845 | static size_t msg_print_text(const struct log *msg, enum log_flags prev, |
839 | char *buf, size_t size) | 846 | bool syslog, char *buf, size_t size) |
840 | { | 847 | { |
841 | const char *text = log_text(msg); | 848 | const char *text = log_text(msg); |
842 | size_t text_size = msg->text_len; | 849 | size_t text_size = msg->text_len; |
850 | bool prefix = true; | ||
851 | bool newline = true; | ||
843 | size_t len = 0; | 852 | size_t len = 0; |
844 | 853 | ||
854 | if ((prev & LOG_CONT) && !(msg->flags & LOG_PREFIX)) | ||
855 | prefix = false; | ||
856 | |||
857 | if (msg->flags & LOG_CONT) { | ||
858 | if ((prev & LOG_CONT) && !(prev & LOG_NEWLINE)) | ||
859 | prefix = false; | ||
860 | |||
861 | if (!(msg->flags & LOG_NEWLINE)) | ||
862 | newline = false; | ||
863 | } | ||
864 | |||
845 | do { | 865 | do { |
846 | const char *next = memchr(text, '\n', text_size); | 866 | const char *next = memchr(text, '\n', text_size); |
847 | size_t text_len; | 867 | size_t text_len; |
@@ -859,16 +879,22 @@ static size_t msg_print_text(const struct log *msg, bool syslog, | |||
859 | text_len + 1>= size - len) | 879 | text_len + 1>= size - len) |
860 | break; | 880 | break; |
861 | 881 | ||
862 | len += print_prefix(msg, syslog, buf + len); | 882 | if (prefix) |
883 | len += print_prefix(msg, syslog, buf + len); | ||
863 | memcpy(buf + len, text, text_len); | 884 | memcpy(buf + len, text, text_len); |
864 | len += text_len; | 885 | len += text_len; |
865 | buf[len++] = '\n'; | 886 | if (next || newline) |
887 | buf[len++] = '\n'; | ||
866 | } else { | 888 | } else { |
867 | /* SYSLOG_ACTION_* buffer size only calculation */ | 889 | /* SYSLOG_ACTION_* buffer size only calculation */ |
868 | len += print_prefix(msg, syslog, NULL); | 890 | if (prefix) |
869 | len += text_len + 1; | 891 | len += print_prefix(msg, syslog, NULL); |
892 | len += text_len; | ||
893 | if (next || newline) | ||
894 | len++; | ||
870 | } | 895 | } |
871 | 896 | ||
897 | prefix = true; | ||
872 | text = next; | 898 | text = next; |
873 | } while (text); | 899 | } while (text); |
874 | 900 | ||
@@ -887,22 +913,35 @@ static int syslog_print(char __user *buf, int size) | |||
887 | 913 | ||
888 | while (size > 0) { | 914 | while (size > 0) { |
889 | size_t n; | 915 | size_t n; |
916 | size_t skip; | ||
890 | 917 | ||
891 | raw_spin_lock_irq(&logbuf_lock); | 918 | raw_spin_lock_irq(&logbuf_lock); |
892 | if (syslog_seq < log_first_seq) { | 919 | if (syslog_seq < log_first_seq) { |
893 | /* messages are gone, move to first one */ | 920 | /* messages are gone, move to first one */ |
894 | syslog_seq = log_first_seq; | 921 | syslog_seq = log_first_seq; |
895 | syslog_idx = log_first_idx; | 922 | syslog_idx = log_first_idx; |
923 | syslog_prev = 0; | ||
924 | syslog_partial = 0; | ||
896 | } | 925 | } |
897 | if (syslog_seq == log_next_seq) { | 926 | if (syslog_seq == log_next_seq) { |
898 | raw_spin_unlock_irq(&logbuf_lock); | 927 | raw_spin_unlock_irq(&logbuf_lock); |
899 | break; | 928 | break; |
900 | } | 929 | } |
930 | |||
931 | skip = syslog_partial; | ||
901 | msg = log_from_idx(syslog_idx); | 932 | msg = log_from_idx(syslog_idx); |
902 | n = msg_print_text(msg, true, text, LOG_LINE_MAX); | 933 | n = msg_print_text(msg, syslog_prev, true, text, LOG_LINE_MAX); |
903 | if (n <= size) { | 934 | if (n - syslog_partial <= size) { |
935 | /* message fits into buffer, move forward */ | ||
904 | syslog_idx = log_next(syslog_idx); | 936 | syslog_idx = log_next(syslog_idx); |
905 | syslog_seq++; | 937 | syslog_seq++; |
938 | syslog_prev = msg->flags; | ||
939 | n -= syslog_partial; | ||
940 | syslog_partial = 0; | ||
941 | } else if (!len){ | ||
942 | /* partial read(), remember position */ | ||
943 | n = size; | ||
944 | syslog_partial += n; | ||
906 | } else | 945 | } else |
907 | n = 0; | 946 | n = 0; |
908 | raw_spin_unlock_irq(&logbuf_lock); | 947 | raw_spin_unlock_irq(&logbuf_lock); |
@@ -910,17 +949,15 @@ static int syslog_print(char __user *buf, int size) | |||
910 | if (!n) | 949 | if (!n) |
911 | break; | 950 | break; |
912 | 951 | ||
913 | len += n; | 952 | if (copy_to_user(buf, text + skip, n)) { |
914 | size -= n; | ||
915 | buf += n; | ||
916 | n = copy_to_user(buf - n, text, n); | ||
917 | |||
918 | if (n) { | ||
919 | len -= n; | ||
920 | if (!len) | 953 | if (!len) |
921 | len = -EFAULT; | 954 | len = -EFAULT; |
922 | break; | 955 | break; |
923 | } | 956 | } |
957 | |||
958 | len += n; | ||
959 | size -= n; | ||
960 | buf += n; | ||
924 | } | 961 | } |
925 | 962 | ||
926 | kfree(text); | 963 | kfree(text); |
@@ -941,6 +978,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
941 | u64 next_seq; | 978 | u64 next_seq; |
942 | u64 seq; | 979 | u64 seq; |
943 | u32 idx; | 980 | u32 idx; |
981 | enum log_flags prev; | ||
944 | 982 | ||
945 | if (clear_seq < log_first_seq) { | 983 | if (clear_seq < log_first_seq) { |
946 | /* messages are gone, move to first available one */ | 984 | /* messages are gone, move to first available one */ |
@@ -954,10 +992,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
954 | */ | 992 | */ |
955 | seq = clear_seq; | 993 | seq = clear_seq; |
956 | idx = clear_idx; | 994 | idx = clear_idx; |
995 | prev = 0; | ||
957 | while (seq < log_next_seq) { | 996 | while (seq < log_next_seq) { |
958 | struct log *msg = log_from_idx(idx); | 997 | struct log *msg = log_from_idx(idx); |
959 | 998 | ||
960 | len += msg_print_text(msg, true, NULL, 0); | 999 | len += msg_print_text(msg, prev, true, NULL, 0); |
961 | idx = log_next(idx); | 1000 | idx = log_next(idx); |
962 | seq++; | 1001 | seq++; |
963 | } | 1002 | } |
@@ -965,10 +1004,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
965 | /* move first record forward until length fits into the buffer */ | 1004 | /* move first record forward until length fits into the buffer */ |
966 | seq = clear_seq; | 1005 | seq = clear_seq; |
967 | idx = clear_idx; | 1006 | idx = clear_idx; |
1007 | prev = 0; | ||
968 | while (len > size && seq < log_next_seq) { | 1008 | while (len > size && seq < log_next_seq) { |
969 | struct log *msg = log_from_idx(idx); | 1009 | struct log *msg = log_from_idx(idx); |
970 | 1010 | ||
971 | len -= msg_print_text(msg, true, NULL, 0); | 1011 | len -= msg_print_text(msg, prev, true, NULL, 0); |
972 | idx = log_next(idx); | 1012 | idx = log_next(idx); |
973 | seq++; | 1013 | seq++; |
974 | } | 1014 | } |
@@ -977,17 +1017,19 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
977 | next_seq = log_next_seq; | 1017 | next_seq = log_next_seq; |
978 | 1018 | ||
979 | len = 0; | 1019 | len = 0; |
1020 | prev = 0; | ||
980 | while (len >= 0 && seq < next_seq) { | 1021 | while (len >= 0 && seq < next_seq) { |
981 | struct log *msg = log_from_idx(idx); | 1022 | struct log *msg = log_from_idx(idx); |
982 | int textlen; | 1023 | int textlen; |
983 | 1024 | ||
984 | textlen = msg_print_text(msg, true, text, LOG_LINE_MAX); | 1025 | textlen = msg_print_text(msg, prev, true, text, LOG_LINE_MAX); |
985 | if (textlen < 0) { | 1026 | if (textlen < 0) { |
986 | len = textlen; | 1027 | len = textlen; |
987 | break; | 1028 | break; |
988 | } | 1029 | } |
989 | idx = log_next(idx); | 1030 | idx = log_next(idx); |
990 | seq++; | 1031 | seq++; |
1032 | prev = msg->flags; | ||
991 | 1033 | ||
992 | raw_spin_unlock_irq(&logbuf_lock); | 1034 | raw_spin_unlock_irq(&logbuf_lock); |
993 | if (copy_to_user(buf + len, text, textlen)) | 1035 | if (copy_to_user(buf + len, text, textlen)) |
@@ -1000,6 +1042,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
1000 | /* messages are gone, move to next one */ | 1042 | /* messages are gone, move to next one */ |
1001 | seq = log_first_seq; | 1043 | seq = log_first_seq; |
1002 | idx = log_first_idx; | 1044 | idx = log_first_idx; |
1045 | prev = 0; | ||
1003 | } | 1046 | } |
1004 | } | 1047 | } |
1005 | } | 1048 | } |
@@ -1018,7 +1061,6 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
1018 | { | 1061 | { |
1019 | bool clear = false; | 1062 | bool clear = false; |
1020 | static int saved_console_loglevel = -1; | 1063 | static int saved_console_loglevel = -1; |
1021 | static DEFINE_MUTEX(syslog_mutex); | ||
1022 | int error; | 1064 | int error; |
1023 | 1065 | ||
1024 | error = check_syslog_permissions(type, from_file); | 1066 | error = check_syslog_permissions(type, from_file); |
@@ -1045,17 +1087,11 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
1045 | error = -EFAULT; | 1087 | error = -EFAULT; |
1046 | goto out; | 1088 | goto out; |
1047 | } | 1089 | } |
1048 | error = mutex_lock_interruptible(&syslog_mutex); | ||
1049 | if (error) | ||
1050 | goto out; | ||
1051 | error = wait_event_interruptible(log_wait, | 1090 | error = wait_event_interruptible(log_wait, |
1052 | syslog_seq != log_next_seq); | 1091 | syslog_seq != log_next_seq); |
1053 | if (error) { | 1092 | if (error) |
1054 | mutex_unlock(&syslog_mutex); | ||
1055 | goto out; | 1093 | goto out; |
1056 | } | ||
1057 | error = syslog_print(buf, len); | 1094 | error = syslog_print(buf, len); |
1058 | mutex_unlock(&syslog_mutex); | ||
1059 | break; | 1095 | break; |
1060 | /* Read/clear last kernel messages */ | 1096 | /* Read/clear last kernel messages */ |
1061 | case SYSLOG_ACTION_READ_CLEAR: | 1097 | case SYSLOG_ACTION_READ_CLEAR: |
@@ -1111,6 +1147,8 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
1111 | /* messages are gone, move to first one */ | 1147 | /* messages are gone, move to first one */ |
1112 | syslog_seq = log_first_seq; | 1148 | syslog_seq = log_first_seq; |
1113 | syslog_idx = log_first_idx; | 1149 | syslog_idx = log_first_idx; |
1150 | syslog_prev = 0; | ||
1151 | syslog_partial = 0; | ||
1114 | } | 1152 | } |
1115 | if (from_file) { | 1153 | if (from_file) { |
1116 | /* | 1154 | /* |
@@ -1120,19 +1158,20 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
1120 | */ | 1158 | */ |
1121 | error = log_next_idx - syslog_idx; | 1159 | error = log_next_idx - syslog_idx; |
1122 | } else { | 1160 | } else { |
1123 | u64 seq; | 1161 | u64 seq = syslog_seq; |
1124 | u32 idx; | 1162 | u32 idx = syslog_idx; |
1163 | enum log_flags prev = syslog_prev; | ||
1125 | 1164 | ||
1126 | error = 0; | 1165 | error = 0; |
1127 | seq = syslog_seq; | ||
1128 | idx = syslog_idx; | ||
1129 | while (seq < log_next_seq) { | 1166 | while (seq < log_next_seq) { |
1130 | struct log *msg = log_from_idx(idx); | 1167 | struct log *msg = log_from_idx(idx); |
1131 | 1168 | ||
1132 | error += msg_print_text(msg, true, NULL, 0); | 1169 | error += msg_print_text(msg, prev, true, NULL, 0); |
1133 | idx = log_next(idx); | 1170 | idx = log_next(idx); |
1134 | seq++; | 1171 | seq++; |
1172 | prev = msg->flags; | ||
1135 | } | 1173 | } |
1174 | error -= syslog_partial; | ||
1136 | } | 1175 | } |
1137 | raw_spin_unlock_irq(&logbuf_lock); | 1176 | raw_spin_unlock_irq(&logbuf_lock); |
1138 | break; | 1177 | break; |
@@ -1400,10 +1439,9 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1400 | static char textbuf[LOG_LINE_MAX]; | 1439 | static char textbuf[LOG_LINE_MAX]; |
1401 | char *text = textbuf; | 1440 | char *text = textbuf; |
1402 | size_t text_len; | 1441 | size_t text_len; |
1442 | enum log_flags lflags = 0; | ||
1403 | unsigned long flags; | 1443 | unsigned long flags; |
1404 | int this_cpu; | 1444 | int this_cpu; |
1405 | bool newline = false; | ||
1406 | bool prefix = false; | ||
1407 | int printed_len = 0; | 1445 | int printed_len = 0; |
1408 | 1446 | ||
1409 | boot_delay_msec(); | 1447 | boot_delay_msec(); |
@@ -1442,7 +1480,7 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1442 | recursion_bug = 0; | 1480 | recursion_bug = 0; |
1443 | printed_len += strlen(recursion_msg); | 1481 | printed_len += strlen(recursion_msg); |
1444 | /* emit KERN_CRIT message */ | 1482 | /* emit KERN_CRIT message */ |
1445 | log_store(0, 2, LOG_DEFAULT, 0, | 1483 | log_store(0, 2, LOG_PREFIX|LOG_NEWLINE, 0, |
1446 | NULL, 0, recursion_msg, printed_len); | 1484 | NULL, 0, recursion_msg, printed_len); |
1447 | } | 1485 | } |
1448 | 1486 | ||
@@ -1455,7 +1493,7 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1455 | /* mark and strip a trailing newline */ | 1493 | /* mark and strip a trailing newline */ |
1456 | if (text_len && text[text_len-1] == '\n') { | 1494 | if (text_len && text[text_len-1] == '\n') { |
1457 | text_len--; | 1495 | text_len--; |
1458 | newline = true; | 1496 | lflags |= LOG_NEWLINE; |
1459 | } | 1497 | } |
1460 | 1498 | ||
1461 | /* strip syslog prefix and extract log level or control flags */ | 1499 | /* strip syslog prefix and extract log level or control flags */ |
@@ -1465,7 +1503,7 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1465 | if (level == -1) | 1503 | if (level == -1) |
1466 | level = text[1] - '0'; | 1504 | level = text[1] - '0'; |
1467 | case 'd': /* KERN_DEFAULT */ | 1505 | case 'd': /* KERN_DEFAULT */ |
1468 | prefix = true; | 1506 | lflags |= LOG_PREFIX; |
1469 | case 'c': /* KERN_CONT */ | 1507 | case 'c': /* KERN_CONT */ |
1470 | text += 3; | 1508 | text += 3; |
1471 | text_len -= 3; | 1509 | text_len -= 3; |
@@ -1475,22 +1513,20 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1475 | if (level == -1) | 1513 | if (level == -1) |
1476 | level = default_message_loglevel; | 1514 | level = default_message_loglevel; |
1477 | 1515 | ||
1478 | if (dict) { | 1516 | if (dict) |
1479 | prefix = true; | 1517 | lflags |= LOG_PREFIX|LOG_NEWLINE; |
1480 | newline = true; | ||
1481 | } | ||
1482 | 1518 | ||
1483 | if (!newline) { | 1519 | if (!(lflags & LOG_NEWLINE)) { |
1484 | /* | 1520 | /* |
1485 | * Flush the conflicting buffer. An earlier newline was missing, | 1521 | * Flush the conflicting buffer. An earlier newline was missing, |
1486 | * or another task also prints continuation lines. | 1522 | * or another task also prints continuation lines. |
1487 | */ | 1523 | */ |
1488 | if (cont.len && (prefix || cont.owner != current)) | 1524 | if (cont.len && (lflags & LOG_PREFIX || cont.owner != current)) |
1489 | cont_flush(); | 1525 | cont_flush(); |
1490 | 1526 | ||
1491 | /* buffer line if possible, otherwise store it right away */ | 1527 | /* buffer line if possible, otherwise store it right away */ |
1492 | if (!cont_add(facility, level, text, text_len)) | 1528 | if (!cont_add(facility, level, text, text_len)) |
1493 | log_store(facility, level, LOG_DEFAULT, 0, | 1529 | log_store(facility, level, lflags | LOG_CONT, 0, |
1494 | dict, dictlen, text, text_len); | 1530 | dict, dictlen, text, text_len); |
1495 | } else { | 1531 | } else { |
1496 | bool stored = false; | 1532 | bool stored = false; |
@@ -1502,13 +1538,13 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1502 | * flush it out and store this line separately. | 1538 | * flush it out and store this line separately. |
1503 | */ | 1539 | */ |
1504 | if (cont.len && cont.owner == current) { | 1540 | if (cont.len && cont.owner == current) { |
1505 | if (!prefix) | 1541 | if (!(lflags & LOG_PREFIX)) |
1506 | stored = cont_add(facility, level, text, text_len); | 1542 | stored = cont_add(facility, level, text, text_len); |
1507 | cont_flush(); | 1543 | cont_flush(); |
1508 | } | 1544 | } |
1509 | 1545 | ||
1510 | if (!stored) | 1546 | if (!stored) |
1511 | log_store(facility, level, LOG_DEFAULT, 0, | 1547 | log_store(facility, level, lflags, 0, |
1512 | dict, dictlen, text, text_len); | 1548 | dict, dictlen, text, text_len); |
1513 | } | 1549 | } |
1514 | printed_len += text_len; | 1550 | printed_len += text_len; |
@@ -1607,8 +1643,8 @@ static struct cont { | |||
1607 | static struct log *log_from_idx(u32 idx) { return NULL; } | 1643 | static struct log *log_from_idx(u32 idx) { return NULL; } |
1608 | static u32 log_next(u32 idx) { return 0; } | 1644 | static u32 log_next(u32 idx) { return 0; } |
1609 | static void call_console_drivers(int level, const char *text, size_t len) {} | 1645 | static void call_console_drivers(int level, const char *text, size_t len) {} |
1610 | static size_t msg_print_text(const struct log *msg, bool syslog, | 1646 | static size_t msg_print_text(const struct log *msg, enum log_flags prev, |
1611 | char *buf, size_t size) { return 0; } | 1647 | bool syslog, char *buf, size_t size) { return 0; } |
1612 | static size_t cont_print_text(char *text, size_t size) { return 0; } | 1648 | static size_t cont_print_text(char *text, size_t size) { return 0; } |
1613 | 1649 | ||
1614 | #endif /* CONFIG_PRINTK */ | 1650 | #endif /* CONFIG_PRINTK */ |
@@ -1884,6 +1920,7 @@ void wake_up_klogd(void) | |||
1884 | /* the next printk record to write to the console */ | 1920 | /* the next printk record to write to the console */ |
1885 | static u64 console_seq; | 1921 | static u64 console_seq; |
1886 | static u32 console_idx; | 1922 | static u32 console_idx; |
1923 | static enum log_flags console_prev; | ||
1887 | 1924 | ||
1888 | /** | 1925 | /** |
1889 | * console_unlock - unlock the console system | 1926 | * console_unlock - unlock the console system |
@@ -1944,6 +1981,7 @@ again: | |||
1944 | /* messages are gone, move to first one */ | 1981 | /* messages are gone, move to first one */ |
1945 | console_seq = log_first_seq; | 1982 | console_seq = log_first_seq; |
1946 | console_idx = log_first_idx; | 1983 | console_idx = log_first_idx; |
1984 | console_prev = 0; | ||
1947 | } | 1985 | } |
1948 | skip: | 1986 | skip: |
1949 | if (console_seq == log_next_seq) | 1987 | if (console_seq == log_next_seq) |
@@ -1957,14 +1995,21 @@ skip: | |||
1957 | */ | 1995 | */ |
1958 | console_idx = log_next(console_idx); | 1996 | console_idx = log_next(console_idx); |
1959 | console_seq++; | 1997 | console_seq++; |
1998 | /* | ||
1999 | * We will get here again when we register a new | ||
2000 | * CON_PRINTBUFFER console. Clear the flag so we | ||
2001 | * will properly dump everything later. | ||
2002 | */ | ||
2003 | msg->flags &= ~LOG_NOCONS; | ||
1960 | goto skip; | 2004 | goto skip; |
1961 | } | 2005 | } |
1962 | 2006 | ||
1963 | level = msg->level; | 2007 | level = msg->level; |
1964 | len = msg_print_text(msg, false, text, sizeof(text)); | 2008 | len = msg_print_text(msg, console_prev, false, |
1965 | 2009 | text, sizeof(text)); | |
1966 | console_idx = log_next(console_idx); | 2010 | console_idx = log_next(console_idx); |
1967 | console_seq++; | 2011 | console_seq++; |
2012 | console_prev = msg->flags; | ||
1968 | raw_spin_unlock(&logbuf_lock); | 2013 | raw_spin_unlock(&logbuf_lock); |
1969 | 2014 | ||
1970 | stop_critical_timings(); /* don't trace print latency */ | 2015 | stop_critical_timings(); /* don't trace print latency */ |
@@ -2227,6 +2272,7 @@ void register_console(struct console *newcon) | |||
2227 | raw_spin_lock_irqsave(&logbuf_lock, flags); | 2272 | raw_spin_lock_irqsave(&logbuf_lock, flags); |
2228 | console_seq = syslog_seq; | 2273 | console_seq = syslog_seq; |
2229 | console_idx = syslog_idx; | 2274 | console_idx = syslog_idx; |
2275 | console_prev = syslog_prev; | ||
2230 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); | 2276 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); |
2231 | /* | 2277 | /* |
2232 | * We're about to replay the log buffer. Only do this to the | 2278 | * We're about to replay the log buffer. Only do this to the |
@@ -2520,8 +2566,7 @@ bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, | |||
2520 | } | 2566 | } |
2521 | 2567 | ||
2522 | msg = log_from_idx(dumper->cur_idx); | 2568 | msg = log_from_idx(dumper->cur_idx); |
2523 | l = msg_print_text(msg, syslog, | 2569 | l = msg_print_text(msg, 0, syslog, line, size); |
2524 | line, size); | ||
2525 | 2570 | ||
2526 | dumper->cur_idx = log_next(dumper->cur_idx); | 2571 | dumper->cur_idx = log_next(dumper->cur_idx); |
2527 | dumper->cur_seq++; | 2572 | dumper->cur_seq++; |
@@ -2561,6 +2606,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2561 | u32 idx; | 2606 | u32 idx; |
2562 | u64 next_seq; | 2607 | u64 next_seq; |
2563 | u32 next_idx; | 2608 | u32 next_idx; |
2609 | enum log_flags prev; | ||
2564 | size_t l = 0; | 2610 | size_t l = 0; |
2565 | bool ret = false; | 2611 | bool ret = false; |
2566 | 2612 | ||
@@ -2583,23 +2629,27 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2583 | /* calculate length of entire buffer */ | 2629 | /* calculate length of entire buffer */ |
2584 | seq = dumper->cur_seq; | 2630 | seq = dumper->cur_seq; |
2585 | idx = dumper->cur_idx; | 2631 | idx = dumper->cur_idx; |
2632 | prev = 0; | ||
2586 | while (seq < dumper->next_seq) { | 2633 | while (seq < dumper->next_seq) { |
2587 | struct log *msg = log_from_idx(idx); | 2634 | struct log *msg = log_from_idx(idx); |
2588 | 2635 | ||
2589 | l += msg_print_text(msg, true, NULL, 0); | 2636 | l += msg_print_text(msg, prev, true, NULL, 0); |
2590 | idx = log_next(idx); | 2637 | idx = log_next(idx); |
2591 | seq++; | 2638 | seq++; |
2639 | prev = msg->flags; | ||
2592 | } | 2640 | } |
2593 | 2641 | ||
2594 | /* move first record forward until length fits into the buffer */ | 2642 | /* move first record forward until length fits into the buffer */ |
2595 | seq = dumper->cur_seq; | 2643 | seq = dumper->cur_seq; |
2596 | idx = dumper->cur_idx; | 2644 | idx = dumper->cur_idx; |
2645 | prev = 0; | ||
2597 | while (l > size && seq < dumper->next_seq) { | 2646 | while (l > size && seq < dumper->next_seq) { |
2598 | struct log *msg = log_from_idx(idx); | 2647 | struct log *msg = log_from_idx(idx); |
2599 | 2648 | ||
2600 | l -= msg_print_text(msg, true, NULL, 0); | 2649 | l -= msg_print_text(msg, prev, true, NULL, 0); |
2601 | idx = log_next(idx); | 2650 | idx = log_next(idx); |
2602 | seq++; | 2651 | seq++; |
2652 | prev = msg->flags; | ||
2603 | } | 2653 | } |
2604 | 2654 | ||
2605 | /* last message in next interation */ | 2655 | /* last message in next interation */ |
@@ -2607,14 +2657,14 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2607 | next_idx = idx; | 2657 | next_idx = idx; |
2608 | 2658 | ||
2609 | l = 0; | 2659 | l = 0; |
2660 | prev = 0; | ||
2610 | while (seq < dumper->next_seq) { | 2661 | while (seq < dumper->next_seq) { |
2611 | struct log *msg = log_from_idx(idx); | 2662 | struct log *msg = log_from_idx(idx); |
2612 | 2663 | ||
2613 | l += msg_print_text(msg, syslog, | 2664 | l += msg_print_text(msg, prev, syslog, buf + l, size - l); |
2614 | buf + l, size - l); | ||
2615 | |||
2616 | idx = log_next(idx); | 2665 | idx = log_next(idx); |
2617 | seq++; | 2666 | seq++; |
2667 | prev = msg->flags; | ||
2618 | } | 2668 | } |
2619 | 2669 | ||
2620 | dumper->next_seq = next_seq; | 2670 | dumper->next_seq = next_seq; |
diff --git a/kernel/sys.c b/kernel/sys.c index e0c8ffc50d7f..2d39a84cd857 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1788,7 +1788,6 @@ SYSCALL_DEFINE1(umask, int, mask) | |||
1788 | #ifdef CONFIG_CHECKPOINT_RESTORE | 1788 | #ifdef CONFIG_CHECKPOINT_RESTORE |
1789 | static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | 1789 | static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) |
1790 | { | 1790 | { |
1791 | struct vm_area_struct *vma; | ||
1792 | struct file *exe_file; | 1791 | struct file *exe_file; |
1793 | struct dentry *dentry; | 1792 | struct dentry *dentry; |
1794 | int err; | 1793 | int err; |
@@ -1816,13 +1815,17 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | |||
1816 | down_write(&mm->mmap_sem); | 1815 | down_write(&mm->mmap_sem); |
1817 | 1816 | ||
1818 | /* | 1817 | /* |
1819 | * Forbid mm->exe_file change if there are mapped other files. | 1818 | * Forbid mm->exe_file change if old file still mapped. |
1820 | */ | 1819 | */ |
1821 | err = -EBUSY; | 1820 | err = -EBUSY; |
1822 | for (vma = mm->mmap; vma; vma = vma->vm_next) { | 1821 | if (mm->exe_file) { |
1823 | if (vma->vm_file && !path_equal(&vma->vm_file->f_path, | 1822 | struct vm_area_struct *vma; |
1824 | &exe_file->f_path)) | 1823 | |
1825 | goto exit_unlock; | 1824 | for (vma = mm->mmap; vma; vma = vma->vm_next) |
1825 | if (vma->vm_file && | ||
1826 | path_equal(&vma->vm_file->f_path, | ||
1827 | &mm->exe_file->f_path)) | ||
1828 | goto exit_unlock; | ||
1826 | } | 1829 | } |
1827 | 1830 | ||
1828 | /* | 1831 | /* |
@@ -1835,6 +1838,7 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | |||
1835 | if (test_and_set_bit(MMF_EXE_FILE_CHANGED, &mm->flags)) | 1838 | if (test_and_set_bit(MMF_EXE_FILE_CHANGED, &mm->flags)) |
1836 | goto exit_unlock; | 1839 | goto exit_unlock; |
1837 | 1840 | ||
1841 | err = 0; | ||
1838 | set_mm_exe_file(mm, exe_file); | 1842 | set_mm_exe_file(mm, exe_file); |
1839 | exit_unlock: | 1843 | exit_unlock: |
1840 | up_write(&mm->mmap_sem); | 1844 | up_write(&mm->mmap_sem); |
diff --git a/mm/bootmem.c b/mm/bootmem.c index ec4fcb7a56c8..73096630cb35 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
@@ -698,7 +698,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, | |||
698 | return ___alloc_bootmem(size, align, goal, limit); | 698 | return ___alloc_bootmem(size, align, goal, limit); |
699 | } | 699 | } |
700 | 700 | ||
701 | static void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | 701 | void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, |
702 | unsigned long size, unsigned long align, | 702 | unsigned long size, unsigned long align, |
703 | unsigned long goal, unsigned long limit) | 703 | unsigned long goal, unsigned long limit) |
704 | { | 704 | { |
diff --git a/mm/compaction.c b/mm/compaction.c index 7ea259d82a99..2f42d9528539 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -701,8 +701,11 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
701 | if (err) { | 701 | if (err) { |
702 | putback_lru_pages(&cc->migratepages); | 702 | putback_lru_pages(&cc->migratepages); |
703 | cc->nr_migratepages = 0; | 703 | cc->nr_migratepages = 0; |
704 | if (err == -ENOMEM) { | ||
705 | ret = COMPACT_PARTIAL; | ||
706 | goto out; | ||
707 | } | ||
704 | } | 708 | } |
705 | |||
706 | } | 709 | } |
707 | 710 | ||
708 | out: | 711 | out: |
diff --git a/mm/memblock.c b/mm/memblock.c index d4382095f8bd..5cc6731b00cc 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -143,30 +143,6 @@ phys_addr_t __init_memblock memblock_find_in_range(phys_addr_t start, | |||
143 | MAX_NUMNODES); | 143 | MAX_NUMNODES); |
144 | } | 144 | } |
145 | 145 | ||
146 | /* | ||
147 | * Free memblock.reserved.regions | ||
148 | */ | ||
149 | int __init_memblock memblock_free_reserved_regions(void) | ||
150 | { | ||
151 | if (memblock.reserved.regions == memblock_reserved_init_regions) | ||
152 | return 0; | ||
153 | |||
154 | return memblock_free(__pa(memblock.reserved.regions), | ||
155 | sizeof(struct memblock_region) * memblock.reserved.max); | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * Reserve memblock.reserved.regions | ||
160 | */ | ||
161 | int __init_memblock memblock_reserve_reserved_regions(void) | ||
162 | { | ||
163 | if (memblock.reserved.regions == memblock_reserved_init_regions) | ||
164 | return 0; | ||
165 | |||
166 | return memblock_reserve(__pa(memblock.reserved.regions), | ||
167 | sizeof(struct memblock_region) * memblock.reserved.max); | ||
168 | } | ||
169 | |||
170 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) | 146 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) |
171 | { | 147 | { |
172 | type->total_size -= type->regions[r].size; | 148 | type->total_size -= type->regions[r].size; |
@@ -184,6 +160,18 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u | |||
184 | } | 160 | } |
185 | } | 161 | } |
186 | 162 | ||
163 | phys_addr_t __init_memblock get_allocated_memblock_reserved_regions_info( | ||
164 | phys_addr_t *addr) | ||
165 | { | ||
166 | if (memblock.reserved.regions == memblock_reserved_init_regions) | ||
167 | return 0; | ||
168 | |||
169 | *addr = __pa(memblock.reserved.regions); | ||
170 | |||
171 | return PAGE_ALIGN(sizeof(struct memblock_region) * | ||
172 | memblock.reserved.max); | ||
173 | } | ||
174 | |||
187 | /** | 175 | /** |
188 | * memblock_double_array - double the size of the memblock regions array | 176 | * memblock_double_array - double the size of the memblock regions array |
189 | * @type: memblock type of the regions array being doubled | 177 | * @type: memblock type of the regions array being doubled |
@@ -204,6 +192,7 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, | |||
204 | phys_addr_t new_area_size) | 192 | phys_addr_t new_area_size) |
205 | { | 193 | { |
206 | struct memblock_region *new_array, *old_array; | 194 | struct memblock_region *new_array, *old_array; |
195 | phys_addr_t old_alloc_size, new_alloc_size; | ||
207 | phys_addr_t old_size, new_size, addr; | 196 | phys_addr_t old_size, new_size, addr; |
208 | int use_slab = slab_is_available(); | 197 | int use_slab = slab_is_available(); |
209 | int *in_slab; | 198 | int *in_slab; |
@@ -217,6 +206,12 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, | |||
217 | /* Calculate new doubled size */ | 206 | /* Calculate new doubled size */ |
218 | old_size = type->max * sizeof(struct memblock_region); | 207 | old_size = type->max * sizeof(struct memblock_region); |
219 | new_size = old_size << 1; | 208 | new_size = old_size << 1; |
209 | /* | ||
210 | * We need to allocated new one align to PAGE_SIZE, | ||
211 | * so we can free them completely later. | ||
212 | */ | ||
213 | old_alloc_size = PAGE_ALIGN(old_size); | ||
214 | new_alloc_size = PAGE_ALIGN(new_size); | ||
220 | 215 | ||
221 | /* Retrieve the slab flag */ | 216 | /* Retrieve the slab flag */ |
222 | if (type == &memblock.memory) | 217 | if (type == &memblock.memory) |
@@ -245,11 +240,11 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, | |||
245 | 240 | ||
246 | addr = memblock_find_in_range(new_area_start + new_area_size, | 241 | addr = memblock_find_in_range(new_area_start + new_area_size, |
247 | memblock.current_limit, | 242 | memblock.current_limit, |
248 | new_size, sizeof(phys_addr_t)); | 243 | new_alloc_size, PAGE_SIZE); |
249 | if (!addr && new_area_size) | 244 | if (!addr && new_area_size) |
250 | addr = memblock_find_in_range(0, | 245 | addr = memblock_find_in_range(0, |
251 | min(new_area_start, memblock.current_limit), | 246 | min(new_area_start, memblock.current_limit), |
252 | new_size, sizeof(phys_addr_t)); | 247 | new_alloc_size, PAGE_SIZE); |
253 | 248 | ||
254 | new_array = addr ? __va(addr) : 0; | 249 | new_array = addr ? __va(addr) : 0; |
255 | } | 250 | } |
@@ -279,13 +274,13 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, | |||
279 | kfree(old_array); | 274 | kfree(old_array); |
280 | else if (old_array != memblock_memory_init_regions && | 275 | else if (old_array != memblock_memory_init_regions && |
281 | old_array != memblock_reserved_init_regions) | 276 | old_array != memblock_reserved_init_regions) |
282 | memblock_free(__pa(old_array), old_size); | 277 | memblock_free(__pa(old_array), old_alloc_size); |
283 | 278 | ||
284 | /* Reserve the new array if that comes from the memblock. | 279 | /* Reserve the new array if that comes from the memblock. |
285 | * Otherwise, we needn't do it | 280 | * Otherwise, we needn't do it |
286 | */ | 281 | */ |
287 | if (!use_slab) | 282 | if (!use_slab) |
288 | BUG_ON(memblock_reserve(addr, new_size)); | 283 | BUG_ON(memblock_reserve(addr, new_alloc_size)); |
289 | 284 | ||
290 | /* Update slab flag */ | 285 | /* Update slab flag */ |
291 | *in_slab = use_slab; | 286 | *in_slab = use_slab; |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0d7e3ec8e0f3..427bb291dd0f 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -618,7 +618,7 @@ int __ref add_memory(int nid, u64 start, u64 size) | |||
618 | pgdat = hotadd_new_pgdat(nid, start); | 618 | pgdat = hotadd_new_pgdat(nid, start); |
619 | ret = -ENOMEM; | 619 | ret = -ENOMEM; |
620 | if (!pgdat) | 620 | if (!pgdat) |
621 | goto out; | 621 | goto error; |
622 | new_pgdat = 1; | 622 | new_pgdat = 1; |
623 | } | 623 | } |
624 | 624 | ||
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index d23415c001bc..405573010f99 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -105,27 +105,35 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end) | |||
105 | __free_pages_bootmem(pfn_to_page(i), 0); | 105 | __free_pages_bootmem(pfn_to_page(i), 0); |
106 | } | 106 | } |
107 | 107 | ||
108 | static unsigned long __init __free_memory_core(phys_addr_t start, | ||
109 | phys_addr_t end) | ||
110 | { | ||
111 | unsigned long start_pfn = PFN_UP(start); | ||
112 | unsigned long end_pfn = min_t(unsigned long, | ||
113 | PFN_DOWN(end), max_low_pfn); | ||
114 | |||
115 | if (start_pfn > end_pfn) | ||
116 | return 0; | ||
117 | |||
118 | __free_pages_memory(start_pfn, end_pfn); | ||
119 | |||
120 | return end_pfn - start_pfn; | ||
121 | } | ||
122 | |||
108 | unsigned long __init free_low_memory_core_early(int nodeid) | 123 | unsigned long __init free_low_memory_core_early(int nodeid) |
109 | { | 124 | { |
110 | unsigned long count = 0; | 125 | unsigned long count = 0; |
111 | phys_addr_t start, end; | 126 | phys_addr_t start, end, size; |
112 | u64 i; | 127 | u64 i; |
113 | 128 | ||
114 | /* free reserved array temporarily so that it's treated as free area */ | 129 | for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL) |
115 | memblock_free_reserved_regions(); | 130 | count += __free_memory_core(start, end); |
116 | 131 | ||
117 | for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL) { | 132 | /* free range that is used for reserved array if we allocate it */ |
118 | unsigned long start_pfn = PFN_UP(start); | 133 | size = get_allocated_memblock_reserved_regions_info(&start); |
119 | unsigned long end_pfn = min_t(unsigned long, | 134 | if (size) |
120 | PFN_DOWN(end), max_low_pfn); | 135 | count += __free_memory_core(start, start + size); |
121 | if (start_pfn < end_pfn) { | ||
122 | __free_pages_memory(start_pfn, end_pfn); | ||
123 | count += end_pfn - start_pfn; | ||
124 | } | ||
125 | } | ||
126 | 136 | ||
127 | /* put region array back? */ | ||
128 | memblock_reserve_reserved_regions(); | ||
129 | return count; | 137 | return count; |
130 | } | 138 | } |
131 | 139 | ||
@@ -274,7 +282,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, | |||
274 | return ___alloc_bootmem(size, align, goal, limit); | 282 | return ___alloc_bootmem(size, align, goal, limit); |
275 | } | 283 | } |
276 | 284 | ||
277 | static void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | 285 | void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, |
278 | unsigned long size, | 286 | unsigned long size, |
279 | unsigned long align, | 287 | unsigned long align, |
280 | unsigned long goal, | 288 | unsigned long goal, |
diff --git a/mm/shmem.c b/mm/shmem.c index 4ce02e0673db..bd106361be4b 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -264,46 +264,55 @@ static int shmem_radix_tree_replace(struct address_space *mapping, | |||
264 | } | 264 | } |
265 | 265 | ||
266 | /* | 266 | /* |
267 | * Sometimes, before we decide whether to proceed or to fail, we must check | ||
268 | * that an entry was not already brought back from swap by a racing thread. | ||
269 | * | ||
270 | * Checking page is not enough: by the time a SwapCache page is locked, it | ||
271 | * might be reused, and again be SwapCache, using the same swap as before. | ||
272 | */ | ||
273 | static bool shmem_confirm_swap(struct address_space *mapping, | ||
274 | pgoff_t index, swp_entry_t swap) | ||
275 | { | ||
276 | void *item; | ||
277 | |||
278 | rcu_read_lock(); | ||
279 | item = radix_tree_lookup(&mapping->page_tree, index); | ||
280 | rcu_read_unlock(); | ||
281 | return item == swp_to_radix_entry(swap); | ||
282 | } | ||
283 | |||
284 | /* | ||
267 | * Like add_to_page_cache_locked, but error if expected item has gone. | 285 | * Like add_to_page_cache_locked, but error if expected item has gone. |
268 | */ | 286 | */ |
269 | static int shmem_add_to_page_cache(struct page *page, | 287 | static int shmem_add_to_page_cache(struct page *page, |
270 | struct address_space *mapping, | 288 | struct address_space *mapping, |
271 | pgoff_t index, gfp_t gfp, void *expected) | 289 | pgoff_t index, gfp_t gfp, void *expected) |
272 | { | 290 | { |
273 | int error = 0; | 291 | int error; |
274 | 292 | ||
275 | VM_BUG_ON(!PageLocked(page)); | 293 | VM_BUG_ON(!PageLocked(page)); |
276 | VM_BUG_ON(!PageSwapBacked(page)); | 294 | VM_BUG_ON(!PageSwapBacked(page)); |
277 | 295 | ||
296 | page_cache_get(page); | ||
297 | page->mapping = mapping; | ||
298 | page->index = index; | ||
299 | |||
300 | spin_lock_irq(&mapping->tree_lock); | ||
278 | if (!expected) | 301 | if (!expected) |
279 | error = radix_tree_preload(gfp & GFP_RECLAIM_MASK); | 302 | error = radix_tree_insert(&mapping->page_tree, index, page); |
303 | else | ||
304 | error = shmem_radix_tree_replace(mapping, index, expected, | ||
305 | page); | ||
280 | if (!error) { | 306 | if (!error) { |
281 | page_cache_get(page); | 307 | mapping->nrpages++; |
282 | page->mapping = mapping; | 308 | __inc_zone_page_state(page, NR_FILE_PAGES); |
283 | page->index = index; | 309 | __inc_zone_page_state(page, NR_SHMEM); |
284 | 310 | spin_unlock_irq(&mapping->tree_lock); | |
285 | spin_lock_irq(&mapping->tree_lock); | 311 | } else { |
286 | if (!expected) | 312 | page->mapping = NULL; |
287 | error = radix_tree_insert(&mapping->page_tree, | 313 | spin_unlock_irq(&mapping->tree_lock); |
288 | index, page); | 314 | page_cache_release(page); |
289 | else | ||
290 | error = shmem_radix_tree_replace(mapping, index, | ||
291 | expected, page); | ||
292 | if (!error) { | ||
293 | mapping->nrpages++; | ||
294 | __inc_zone_page_state(page, NR_FILE_PAGES); | ||
295 | __inc_zone_page_state(page, NR_SHMEM); | ||
296 | spin_unlock_irq(&mapping->tree_lock); | ||
297 | } else { | ||
298 | page->mapping = NULL; | ||
299 | spin_unlock_irq(&mapping->tree_lock); | ||
300 | page_cache_release(page); | ||
301 | } | ||
302 | if (!expected) | ||
303 | radix_tree_preload_end(); | ||
304 | } | 315 | } |
305 | if (error) | ||
306 | mem_cgroup_uncharge_cache_page(page); | ||
307 | return error; | 316 | return error; |
308 | } | 317 | } |
309 | 318 | ||
@@ -1124,9 +1133,9 @@ repeat: | |||
1124 | /* We have to do this with page locked to prevent races */ | 1133 | /* We have to do this with page locked to prevent races */ |
1125 | lock_page(page); | 1134 | lock_page(page); |
1126 | if (!PageSwapCache(page) || page_private(page) != swap.val || | 1135 | if (!PageSwapCache(page) || page_private(page) != swap.val || |
1127 | page->mapping) { | 1136 | !shmem_confirm_swap(mapping, index, swap)) { |
1128 | error = -EEXIST; /* try again */ | 1137 | error = -EEXIST; /* try again */ |
1129 | goto failed; | 1138 | goto unlock; |
1130 | } | 1139 | } |
1131 | if (!PageUptodate(page)) { | 1140 | if (!PageUptodate(page)) { |
1132 | error = -EIO; | 1141 | error = -EIO; |
@@ -1142,9 +1151,12 @@ repeat: | |||
1142 | 1151 | ||
1143 | error = mem_cgroup_cache_charge(page, current->mm, | 1152 | error = mem_cgroup_cache_charge(page, current->mm, |
1144 | gfp & GFP_RECLAIM_MASK); | 1153 | gfp & GFP_RECLAIM_MASK); |
1145 | if (!error) | 1154 | if (!error) { |
1146 | error = shmem_add_to_page_cache(page, mapping, index, | 1155 | error = shmem_add_to_page_cache(page, mapping, index, |
1147 | gfp, swp_to_radix_entry(swap)); | 1156 | gfp, swp_to_radix_entry(swap)); |
1157 | /* We already confirmed swap, and make no allocation */ | ||
1158 | VM_BUG_ON(error); | ||
1159 | } | ||
1148 | if (error) | 1160 | if (error) |
1149 | goto failed; | 1161 | goto failed; |
1150 | 1162 | ||
@@ -1181,11 +1193,18 @@ repeat: | |||
1181 | __set_page_locked(page); | 1193 | __set_page_locked(page); |
1182 | error = mem_cgroup_cache_charge(page, current->mm, | 1194 | error = mem_cgroup_cache_charge(page, current->mm, |
1183 | gfp & GFP_RECLAIM_MASK); | 1195 | gfp & GFP_RECLAIM_MASK); |
1184 | if (!error) | ||
1185 | error = shmem_add_to_page_cache(page, mapping, index, | ||
1186 | gfp, NULL); | ||
1187 | if (error) | 1196 | if (error) |
1188 | goto decused; | 1197 | goto decused; |
1198 | error = radix_tree_preload(gfp & GFP_RECLAIM_MASK); | ||
1199 | if (!error) { | ||
1200 | error = shmem_add_to_page_cache(page, mapping, index, | ||
1201 | gfp, NULL); | ||
1202 | radix_tree_preload_end(); | ||
1203 | } | ||
1204 | if (error) { | ||
1205 | mem_cgroup_uncharge_cache_page(page); | ||
1206 | goto decused; | ||
1207 | } | ||
1189 | lru_cache_add_anon(page); | 1208 | lru_cache_add_anon(page); |
1190 | 1209 | ||
1191 | spin_lock(&info->lock); | 1210 | spin_lock(&info->lock); |
@@ -1245,14 +1264,10 @@ decused: | |||
1245 | unacct: | 1264 | unacct: |
1246 | shmem_unacct_blocks(info->flags, 1); | 1265 | shmem_unacct_blocks(info->flags, 1); |
1247 | failed: | 1266 | failed: |
1248 | if (swap.val && error != -EINVAL) { | 1267 | if (swap.val && error != -EINVAL && |
1249 | struct page *test = find_get_page(mapping, index); | 1268 | !shmem_confirm_swap(mapping, index, swap)) |
1250 | if (test && !radix_tree_exceptional_entry(test)) | 1269 | error = -EEXIST; |
1251 | page_cache_release(test); | 1270 | unlock: |
1252 | /* Have another try if the entry has changed */ | ||
1253 | if (test != swp_to_radix_entry(swap)) | ||
1254 | error = -EEXIST; | ||
1255 | } | ||
1256 | if (page) { | 1271 | if (page) { |
1257 | unlock_page(page); | 1272 | unlock_page(page); |
1258 | page_cache_release(page); | 1273 | page_cache_release(page); |
@@ -1264,7 +1279,7 @@ failed: | |||
1264 | spin_unlock(&info->lock); | 1279 | spin_unlock(&info->lock); |
1265 | goto repeat; | 1280 | goto repeat; |
1266 | } | 1281 | } |
1267 | if (error == -EEXIST) | 1282 | if (error == -EEXIST) /* from above or from radix_tree_insert */ |
1268 | goto repeat; | 1283 | goto repeat; |
1269 | return error; | 1284 | return error; |
1270 | } | 1285 | } |
@@ -1692,98 +1707,6 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos, | |||
1692 | return error; | 1707 | return error; |
1693 | } | 1708 | } |
1694 | 1709 | ||
1695 | /* | ||
1696 | * llseek SEEK_DATA or SEEK_HOLE through the radix_tree. | ||
1697 | */ | ||
1698 | static pgoff_t shmem_seek_hole_data(struct address_space *mapping, | ||
1699 | pgoff_t index, pgoff_t end, int origin) | ||
1700 | { | ||
1701 | struct page *page; | ||
1702 | struct pagevec pvec; | ||
1703 | pgoff_t indices[PAGEVEC_SIZE]; | ||
1704 | bool done = false; | ||
1705 | int i; | ||
1706 | |||
1707 | pagevec_init(&pvec, 0); | ||
1708 | pvec.nr = 1; /* start small: we may be there already */ | ||
1709 | while (!done) { | ||
1710 | pvec.nr = shmem_find_get_pages_and_swap(mapping, index, | ||
1711 | pvec.nr, pvec.pages, indices); | ||
1712 | if (!pvec.nr) { | ||
1713 | if (origin == SEEK_DATA) | ||
1714 | index = end; | ||
1715 | break; | ||
1716 | } | ||
1717 | for (i = 0; i < pvec.nr; i++, index++) { | ||
1718 | if (index < indices[i]) { | ||
1719 | if (origin == SEEK_HOLE) { | ||
1720 | done = true; | ||
1721 | break; | ||
1722 | } | ||
1723 | index = indices[i]; | ||
1724 | } | ||
1725 | page = pvec.pages[i]; | ||
1726 | if (page && !radix_tree_exceptional_entry(page)) { | ||
1727 | if (!PageUptodate(page)) | ||
1728 | page = NULL; | ||
1729 | } | ||
1730 | if (index >= end || | ||
1731 | (page && origin == SEEK_DATA) || | ||
1732 | (!page && origin == SEEK_HOLE)) { | ||
1733 | done = true; | ||
1734 | break; | ||
1735 | } | ||
1736 | } | ||
1737 | shmem_deswap_pagevec(&pvec); | ||
1738 | pagevec_release(&pvec); | ||
1739 | pvec.nr = PAGEVEC_SIZE; | ||
1740 | cond_resched(); | ||
1741 | } | ||
1742 | return index; | ||
1743 | } | ||
1744 | |||
1745 | static loff_t shmem_file_llseek(struct file *file, loff_t offset, int origin) | ||
1746 | { | ||
1747 | struct address_space *mapping; | ||
1748 | struct inode *inode; | ||
1749 | pgoff_t start, end; | ||
1750 | loff_t new_offset; | ||
1751 | |||
1752 | if (origin != SEEK_DATA && origin != SEEK_HOLE) | ||
1753 | return generic_file_llseek_size(file, offset, origin, | ||
1754 | MAX_LFS_FILESIZE); | ||
1755 | mapping = file->f_mapping; | ||
1756 | inode = mapping->host; | ||
1757 | mutex_lock(&inode->i_mutex); | ||
1758 | /* We're holding i_mutex so we can access i_size directly */ | ||
1759 | |||
1760 | if (offset < 0) | ||
1761 | offset = -EINVAL; | ||
1762 | else if (offset >= inode->i_size) | ||
1763 | offset = -ENXIO; | ||
1764 | else { | ||
1765 | start = offset >> PAGE_CACHE_SHIFT; | ||
1766 | end = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | ||
1767 | new_offset = shmem_seek_hole_data(mapping, start, end, origin); | ||
1768 | new_offset <<= PAGE_CACHE_SHIFT; | ||
1769 | if (new_offset > offset) { | ||
1770 | if (new_offset < inode->i_size) | ||
1771 | offset = new_offset; | ||
1772 | else if (origin == SEEK_DATA) | ||
1773 | offset = -ENXIO; | ||
1774 | else | ||
1775 | offset = inode->i_size; | ||
1776 | } | ||
1777 | } | ||
1778 | |||
1779 | if (offset >= 0 && offset != file->f_pos) { | ||
1780 | file->f_pos = offset; | ||
1781 | file->f_version = 0; | ||
1782 | } | ||
1783 | mutex_unlock(&inode->i_mutex); | ||
1784 | return offset; | ||
1785 | } | ||
1786 | |||
1787 | static long shmem_fallocate(struct file *file, int mode, loff_t offset, | 1710 | static long shmem_fallocate(struct file *file, int mode, loff_t offset, |
1788 | loff_t len) | 1711 | loff_t len) |
1789 | { | 1712 | { |
@@ -2787,7 +2710,7 @@ static const struct address_space_operations shmem_aops = { | |||
2787 | static const struct file_operations shmem_file_operations = { | 2710 | static const struct file_operations shmem_file_operations = { |
2788 | .mmap = shmem_mmap, | 2711 | .mmap = shmem_mmap, |
2789 | #ifdef CONFIG_TMPFS | 2712 | #ifdef CONFIG_TMPFS |
2790 | .llseek = shmem_file_llseek, | 2713 | .llseek = generic_file_llseek, |
2791 | .read = do_sync_read, | 2714 | .read = do_sync_read, |
2792 | .write = do_sync_write, | 2715 | .write = do_sync_write, |
2793 | .aio_read = shmem_file_aio_read, | 2716 | .aio_read = shmem_file_aio_read, |
diff --git a/mm/sparse.c b/mm/sparse.c index 6a4bf9160e85..c7bb952400c8 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -275,8 +275,9 @@ static unsigned long * __init | |||
275 | sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, | 275 | sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, |
276 | unsigned long size) | 276 | unsigned long size) |
277 | { | 277 | { |
278 | pg_data_t *host_pgdat; | 278 | unsigned long goal, limit; |
279 | unsigned long goal; | 279 | unsigned long *p; |
280 | int nid; | ||
280 | /* | 281 | /* |
281 | * A page may contain usemaps for other sections preventing the | 282 | * A page may contain usemaps for other sections preventing the |
282 | * page being freed and making a section unremovable while | 283 | * page being freed and making a section unremovable while |
@@ -287,10 +288,17 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, | |||
287 | * from the same section as the pgdat where possible to avoid | 288 | * from the same section as the pgdat where possible to avoid |
288 | * this problem. | 289 | * this problem. |
289 | */ | 290 | */ |
290 | goal = __pa(pgdat) & PAGE_SECTION_MASK; | 291 | goal = __pa(pgdat) & (PAGE_SECTION_MASK << PAGE_SHIFT); |
291 | host_pgdat = NODE_DATA(early_pfn_to_nid(goal >> PAGE_SHIFT)); | 292 | limit = goal + (1UL << PA_SECTION_SHIFT); |
292 | return __alloc_bootmem_node_nopanic(host_pgdat, size, | 293 | nid = early_pfn_to_nid(goal >> PAGE_SHIFT); |
293 | SMP_CACHE_BYTES, goal); | 294 | again: |
295 | p = ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, | ||
296 | SMP_CACHE_BYTES, goal, limit); | ||
297 | if (!p && limit) { | ||
298 | limit = 0; | ||
299 | goto again; | ||
300 | } | ||
301 | return p; | ||
294 | } | 302 | } |
295 | 303 | ||
296 | static void __init check_usemap_section_nr(int nid, unsigned long *usemap) | 304 | static void __init check_usemap_section_nr(int nid, unsigned long *usemap) |
diff --git a/mm/vmscan.c b/mm/vmscan.c index eeb3bc9d1d36..661576324c7f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2955,14 +2955,17 @@ int kswapd_run(int nid) | |||
2955 | } | 2955 | } |
2956 | 2956 | ||
2957 | /* | 2957 | /* |
2958 | * Called by memory hotplug when all memory in a node is offlined. | 2958 | * Called by memory hotplug when all memory in a node is offlined. Caller must |
2959 | * hold lock_memory_hotplug(). | ||
2959 | */ | 2960 | */ |
2960 | void kswapd_stop(int nid) | 2961 | void kswapd_stop(int nid) |
2961 | { | 2962 | { |
2962 | struct task_struct *kswapd = NODE_DATA(nid)->kswapd; | 2963 | struct task_struct *kswapd = NODE_DATA(nid)->kswapd; |
2963 | 2964 | ||
2964 | if (kswapd) | 2965 | if (kswapd) { |
2965 | kthread_stop(kswapd); | 2966 | kthread_stop(kswapd); |
2967 | NODE_DATA(nid)->kswapd = NULL; | ||
2968 | } | ||
2966 | } | 2969 | } |
2967 | 2970 | ||
2968 | static int __init kswapd_init(void) | 2971 | static int __init kswapd_init(void) |
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index b1e091ae2f37..23a41a9f8db9 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c | |||
@@ -334,6 +334,11 @@ static int assigned_device_enable_host_intx(struct kvm *kvm, | |||
334 | } | 334 | } |
335 | 335 | ||
336 | #ifdef __KVM_HAVE_MSI | 336 | #ifdef __KVM_HAVE_MSI |
337 | static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id) | ||
338 | { | ||
339 | return IRQ_WAKE_THREAD; | ||
340 | } | ||
341 | |||
337 | static int assigned_device_enable_host_msi(struct kvm *kvm, | 342 | static int assigned_device_enable_host_msi(struct kvm *kvm, |
338 | struct kvm_assigned_dev_kernel *dev) | 343 | struct kvm_assigned_dev_kernel *dev) |
339 | { | 344 | { |
@@ -346,7 +351,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm, | |||
346 | } | 351 | } |
347 | 352 | ||
348 | dev->host_irq = dev->dev->irq; | 353 | dev->host_irq = dev->dev->irq; |
349 | if (request_threaded_irq(dev->host_irq, NULL, | 354 | if (request_threaded_irq(dev->host_irq, kvm_assigned_dev_msi, |
350 | kvm_assigned_dev_thread_msi, 0, | 355 | kvm_assigned_dev_thread_msi, 0, |
351 | dev->irq_name, dev)) { | 356 | dev->irq_name, dev)) { |
352 | pci_disable_msi(dev->dev); | 357 | pci_disable_msi(dev->dev); |
@@ -358,6 +363,11 @@ static int assigned_device_enable_host_msi(struct kvm *kvm, | |||
358 | #endif | 363 | #endif |
359 | 364 | ||
360 | #ifdef __KVM_HAVE_MSIX | 365 | #ifdef __KVM_HAVE_MSIX |
366 | static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id) | ||
367 | { | ||
368 | return IRQ_WAKE_THREAD; | ||
369 | } | ||
370 | |||
361 | static int assigned_device_enable_host_msix(struct kvm *kvm, | 371 | static int assigned_device_enable_host_msix(struct kvm *kvm, |
362 | struct kvm_assigned_dev_kernel *dev) | 372 | struct kvm_assigned_dev_kernel *dev) |
363 | { | 373 | { |
@@ -374,7 +384,8 @@ static int assigned_device_enable_host_msix(struct kvm *kvm, | |||
374 | 384 | ||
375 | for (i = 0; i < dev->entries_nr; i++) { | 385 | for (i = 0; i < dev->entries_nr; i++) { |
376 | r = request_threaded_irq(dev->host_msix_entries[i].vector, | 386 | r = request_threaded_irq(dev->host_msix_entries[i].vector, |
377 | NULL, kvm_assigned_dev_thread_msix, | 387 | kvm_assigned_dev_msix, |
388 | kvm_assigned_dev_thread_msix, | ||
378 | 0, dev->irq_name, dev); | 389 | 0, dev->irq_name, dev); |
379 | if (r) | 390 | if (r) |
380 | goto err; | 391 | goto err; |