Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge 3.16-rc4 into driver-core-next

We want the lz* fixes here to do more work with them.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+1256 -510
+2 -12
Documentation/trace/postprocess/trace-vmscan-postprocess.pl
··· 47 47 use constant HIGH_NR_SCANNED => 22; 48 48 use constant HIGH_NR_TAKEN => 23; 49 49 use constant HIGH_NR_RECLAIMED => 24; 50 - use constant HIGH_NR_CONTIG_DIRTY => 25; 51 50 52 51 my %perprocesspid; 53 52 my %perprocess; ··· 104 105 my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; 105 106 my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; 106 107 my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; 107 - my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; 108 + my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) file=([0-9]*)'; 108 109 my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; 109 110 my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; 110 111 my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; ··· 199 200 $regex_lru_isolate_default, 200 201 "isolate_mode", "order", 201 202 "nr_requested", "nr_scanned", "nr_taken", 202 - "contig_taken", "contig_dirty", "contig_failed"); 203 + "file"); 203 204 $regex_lru_shrink_inactive = generate_traceevent_regex( 204 205 "vmscan/mm_vmscan_lru_shrink_inactive", 205 206 $regex_lru_shrink_inactive_default, ··· 374 375 } 375 376 my $isolate_mode = $1; 376 377 my $nr_scanned = $4; 377 - my $nr_contig_dirty = $7; 378 378 379 379 # To closer match vmstat scanning statistics, only count isolate_both 380 380 # and isolate_inactive as scanning. isolate_active is rotation ··· 383 385 if ($isolate_mode != 2) { 384 386 $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; 385 387 } 386 - $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; 387 388 } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { 388 389 $details = $6; 389 390 if ($details !~ /$regex_lru_shrink_inactive/o) { ··· 534 537 if ($count != 0) { 535 538 print "wakeup-$order=$count "; 536 539 } 537 - } 538 - } 539 - if ($stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}) { 540 - print " "; 541 - my $count = $stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}; 542 - if ($count != 0) { 543 - print "contig-dirty=$count "; 544 540 } 545 541 } 546 542
+32 -25
MAINTAINERS
··· 943 943 S: Maintained 944 944 T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git 945 945 F: arch/arm/mach-imx/ 946 + F: arch/arm/mach-mxs/ 946 947 F: arch/arm/boot/dts/imx* 947 948 F: arch/arm/configs/imx*_defconfig 948 - 949 - ARM/FREESCALE MXS ARM ARCHITECTURE 950 - M: Shawn Guo <shawn.guo@linaro.org> 951 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 952 - S: Maintained 953 - T: git git://git.linaro.org/people/shawnguo/linux-2.6.git 954 - F: arch/arm/mach-mxs/ 955 949 956 950 ARM/GLOMATION GESBC9312SX MACHINE SUPPORT 957 951 M: Lennert Buytenhek <kernel@wantstofly.org> ··· 1046 1052 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1047 1053 S: Maintained 1048 1054 F: arch/arm/mach-keystone/ 1049 - F: drivers/clk/keystone/ 1050 1055 T: git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git 1056 + 1057 + ARM/TEXAS INSTRUMENT KEYSTONE CLOCK FRAMEWORK 1058 + M: Santosh Shilimkar <santosh.shilimkar@ti.com> 1059 + L: linux-kernel@vger.kernel.org 1060 + S: Maintained 1061 + F: drivers/clk/keystone/ 1062 + 1063 + ARM/TEXAS INSTRUMENT KEYSTONE ClOCKSOURCE 1064 + M: Santosh Shilimkar <santosh.shilimkar@ti.com> 1065 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1066 + L: linux-kernel@vger.kernel.org 1067 + S: Maintained 1068 + F: drivers/clocksource/timer-keystone.c 1069 + 1070 + ARM/TEXAS INSTRUMENT KEYSTONE RESET DRIVER 1071 + M: Santosh Shilimkar <santosh.shilimkar@ti.com> 1072 + L: linux-kernel@vger.kernel.org 1073 + S: Maintained 1074 + F: drivers/power/reset/keystone-reset.c 1075 + 1076 + ARM/TEXAS INSTRUMENT AEMIF/EMIF DRIVERS 1077 + M: Santosh Shilimkar <santosh.shilimkar@ti.com> 1078 + L: linux-kernel@vger.kernel.org 1079 + S: Maintained 1080 + F: drivers/memory/*emif* 1051 1081 1052 1082 ARM/LOGICPD PXA270 MACHINE SUPPORT 1053 1083 M: Lennert Buytenhek <kernel@wantstofly.org> ··· 5530 5512 F: arch/arm/mach-lpc32xx/ 5531 5513 5532 5514 LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 5533 - M: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com> 5534 - M: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> 5535 - M: support@lsi.com 5536 - L: DL-MPTFusionLinux@lsi.com 5515 + M: Nagalakshmi Nandigama <nagalakshmi.nandigama@avagotech.com> 5516 + M: Praveen Krishnamoorthy <praveen.krishnamoorthy@avagotech.com> 5517 + M: Sreekanth Reddy <sreekanth.reddy@avagotech.com> 5518 + M: Abhijit Mahajan <abhijit.mahajan@avagotech.com> 5519 + L: MPT-FusionLinux.pdl@avagotech.com 5537 5520 L: linux-scsi@vger.kernel.org 5538 5521 W: http://www.lsilogic.com/support 5539 5522 S: Supported ··· 9425 9406 F: drivers/usb/host/isp116x* 9426 9407 F: include/linux/usb/isp116x.h 9427 9408 9428 - USB KAWASAKI LSI DRIVER 9429 - M: Oliver Neukum <oliver@neukum.org> 9430 - L: linux-usb@vger.kernel.org 9431 - S: Maintained 9432 - F: drivers/usb/serial/kl5kusb105.* 9433 - 9434 9409 USB MASS STORAGE DRIVER 9435 9410 M: Matthew Dharm <mdharm-usb@one-eyed-alien.net> 9436 9411 L: linux-usb@vger.kernel.org ··· 9451 9438 S: Maintained 9452 9439 F: Documentation/usb/ohci.txt 9453 9440 F: drivers/usb/host/ohci* 9454 - 9455 - USB OPTION-CARD DRIVER 9456 - M: Matthias Urlichs <smurf@smurf.noris.de> 9457 - L: linux-usb@vger.kernel.org 9458 - S: Maintained 9459 - F: drivers/usb/serial/option.c 9460 9441 9461 9442 USB PEGASUS DRIVER 9462 9443 M: Petko Manolov <petkan@nucleusys.com> ··· 9484 9477 F: drivers/net/usb/rtl8150.c 9485 9478 9486 9479 USB SERIAL SUBSYSTEM 9487 - M: Johan Hovold <jhovold@gmail.com> 9480 + M: Johan Hovold <johan@kernel.org> 9488 9481 L: linux-usb@vger.kernel.org 9489 9482 S: Maintained 9490 9483 F: Documentation/usb/usb-serial.txt
+4 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 16 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc3 4 + EXTRAVERSION = -rc4 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION* ··· 126 126 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make 127 127 @: 128 128 129 + # Fake the "Entering directory" message once, so that IDEs/editors are 130 + # able to understand relative filenames. 129 131 sub-make: FORCE 132 + @echo "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" 130 133 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ 131 134 KBUILD_SRC=$(CURDIR) \ 132 135 KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
+4
arch/arm/boot/dts/am43x-epos-evm.dts
··· 319 319 phy-mode = "rmii"; 320 320 }; 321 321 322 + &phy_sel { 323 + rmii-clock-ext; 324 + }; 325 + 322 326 &i2c0 { 323 327 status = "okay"; 324 328 pinctrl-names = "default";
+11 -1
arch/arm/boot/dts/dra7.dtsi
··· 773 773 clocks = <&qspi_gfclk_div>; 774 774 clock-names = "fck"; 775 775 num-cs = <4>; 776 - interrupts = <0 343 0x4>; 777 776 status = "disabled"; 778 777 }; 779 778 ··· 981 982 gpmc,num-waitpins = <2>; 982 983 #address-cells = <2>; 983 984 #size-cells = <1>; 985 + status = "disabled"; 986 + }; 987 + 988 + atl: atl@4843c000 { 989 + compatible = "ti,dra7-atl"; 990 + reg = <0x4843c000 0x3ff>; 991 + ti,hwmods = "atl"; 992 + ti,provided-clocks = <&atl_clkin0_ck>, <&atl_clkin1_ck>, 993 + <&atl_clkin2_ck>, <&atl_clkin3_ck>; 994 + clocks = <&atl_gfclk_mux>; 995 + clock-names = "fck"; 984 996 status = "disabled"; 985 997 }; 986 998 };
+8 -8
arch/arm/boot/dts/dra7xx-clocks.dtsi
··· 10 10 &cm_core_aon_clocks { 11 11 atl_clkin0_ck: atl_clkin0_ck { 12 12 #clock-cells = <0>; 13 - compatible = "fixed-clock"; 14 - clock-frequency = <0>; 13 + compatible = "ti,dra7-atl-clock"; 14 + clocks = <&atl_gfclk_mux>; 15 15 }; 16 16 17 17 atl_clkin1_ck: atl_clkin1_ck { 18 18 #clock-cells = <0>; 19 - compatible = "fixed-clock"; 20 - clock-frequency = <0>; 19 + compatible = "ti,dra7-atl-clock"; 20 + clocks = <&atl_gfclk_mux>; 21 21 }; 22 22 23 23 atl_clkin2_ck: atl_clkin2_ck { 24 24 #clock-cells = <0>; 25 - compatible = "fixed-clock"; 26 - clock-frequency = <0>; 25 + compatible = "ti,dra7-atl-clock"; 26 + clocks = <&atl_gfclk_mux>; 27 27 }; 28 28 29 29 atl_clkin3_ck: atl_clkin3_ck { 30 30 #clock-cells = <0>; 31 - compatible = "fixed-clock"; 32 - clock-frequency = <0>; 31 + compatible = "ti,dra7-atl-clock"; 32 + clocks = <&atl_gfclk_mux>; 33 33 }; 34 34 35 35 hdmi_clkin_ck: hdmi_clkin_ck {
+6
arch/arm/boot/dts/omap3-beagle-xm.dts
··· 251 251 codec { 252 252 }; 253 253 }; 254 + 255 + twl_power: power { 256 + compatible = "ti,twl4030-power-beagleboard-xm", "ti,twl4030-power-idle-osc-off"; 257 + ti,use_poweroff; 258 + }; 254 259 }; 255 260 }; 256 261 ··· 306 301 }; 307 302 308 303 &uart3 { 304 + interrupts-extended = <&intc 74 &omap3_pmx_core OMAP3_UART3_RX>; 309 305 pinctrl-names = "default"; 310 306 pinctrl-0 = <&uart3_pins>; 311 307 };
+7
arch/arm/boot/dts/omap3-evm-common.dtsi
··· 50 50 gpios = <&twl_gpio 18 GPIO_ACTIVE_LOW>; 51 51 }; 52 52 53 + &twl { 54 + twl_power: power { 55 + compatible = "ti,twl4030-power-omap3-evm", "ti,twl4030-power-idle"; 56 + ti,use_poweroff; 57 + }; 58 + }; 59 + 53 60 &i2c2 { 54 61 clock-frequency = <400000>; 55 62 };
+5
arch/arm/boot/dts/omap3-n900.dts
··· 351 351 compatible = "ti,twl4030-audio"; 352 352 ti,enable-vibra = <1>; 353 353 }; 354 + 355 + twl_power: power { 356 + compatible = "ti,twl4030-power-n900", "ti,twl4030-power-idle-osc-off"; 357 + ti,use_poweroff; 358 + }; 354 359 }; 355 360 356 361 &twl_keypad {
-1
arch/arm/boot/dts/omap5.dtsi
··· 45 45 46 46 operating-points = < 47 47 /* kHz uV */ 48 - 500000 880000 49 48 1000000 1060000 50 49 1500000 1250000 51 50 >;
+1 -1
arch/arm/configs/bcm_defconfig
··· 94 94 CONFIG_BACKLIGHT_PWM=y 95 95 # CONFIG_USB_SUPPORT is not set 96 96 CONFIG_MMC=y 97 - CONFIG_MMC_UNSAFE_RESUME=y 98 97 CONFIG_MMC_BLOCK_MINORS=32 99 98 CONFIG_MMC_TEST=y 100 99 CONFIG_MMC_SDHCI=y 100 + CONFIG_MMC_SDHCI_PLTFM=y 101 101 CONFIG_MMC_SDHCI_BCM_KONA=y 102 102 CONFIG_NEW_LEDS=y 103 103 CONFIG_LEDS_CLASS=y
+2 -1
arch/arm/configs/multi_v7_defconfig
··· 223 223 CONFIG_POWER_RESET_SUN6I=y 224 224 CONFIG_SENSORS_LM90=y 225 225 CONFIG_THERMAL=y 226 - CONFIG_DOVE_THERMAL=y 227 226 CONFIG_ARMADA_THERMAL=y 228 227 CONFIG_WATCHDOG=y 229 228 CONFIG_ORION_WATCHDOG=y 230 229 CONFIG_SUNXI_WATCHDOG=y 231 230 CONFIG_MFD_AS3722=y 231 + CONFIG_MFD_BCM590XX=y 232 232 CONFIG_MFD_CROS_EC=y 233 233 CONFIG_MFD_CROS_EC_SPI=y 234 234 CONFIG_MFD_MAX8907=y ··· 240 240 CONFIG_REGULATOR_VIRTUAL_CONSUMER=y 241 241 CONFIG_REGULATOR_AB8500=y 242 242 CONFIG_REGULATOR_AS3722=y 243 + CONFIG_REGULATOR_BCM590XX=y 243 244 CONFIG_REGULATOR_GPIO=y 244 245 CONFIG_REGULATOR_MAX8907=y 245 246 CONFIG_REGULATOR_PALMAS=y
+1 -1
arch/arm/mach-mvebu/Makefile
··· 7 7 obj-y += system-controller.o mvebu-soc-id.o 8 8 9 9 ifeq ($(CONFIG_MACH_MVEBU_V7),y) 10 - obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o 10 + obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o pmsu_ll.o 11 11 obj-$(CONFIG_SMP) += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o 12 12 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 13 13 endif
+19 -10
arch/arm/mach-mvebu/board-v7.c
··· 23 23 #include <linux/mbus.h> 24 24 #include <linux/signal.h> 25 25 #include <linux/slab.h> 26 + #include <linux/irqchip.h> 26 27 #include <asm/hardware/cache-l2x0.h> 27 28 #include <asm/mach/arch.h> 28 29 #include <asm/mach/map.h> ··· 72 71 return 1; 73 72 } 74 73 75 - static void __init mvebu_timer_and_clk_init(void) 74 + static void __init mvebu_init_irq(void) 76 75 { 77 - of_clk_init(NULL); 78 - clocksource_of_init(); 76 + irqchip_init(); 79 77 mvebu_scu_enable(); 80 78 coherency_init(); 81 79 BUG_ON(mvebu_mbus_dt_init(coherency_available())); 80 + } 82 81 83 - if (of_machine_is_compatible("marvell,armada375")) 84 - hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, 85 - "imprecise external abort"); 82 + static void __init external_abort_quirk(void) 83 + { 84 + u32 dev, rev; 85 + 86 + if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV) 87 + return; 88 + 89 + hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, 90 + "imprecise external abort"); 86 91 } 87 92 88 93 static void __init i2c_quirk(void) ··· 176 169 { 177 170 if (of_machine_is_compatible("plathome,openblocks-ax3-4")) 178 171 i2c_quirk(); 179 - if (of_machine_is_compatible("marvell,a375-db")) 172 + if (of_machine_is_compatible("marvell,a375-db")) { 173 + external_abort_quirk(); 180 174 thermal_quirk(); 175 + } 181 176 182 177 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 183 178 } ··· 194 185 .l2c_aux_mask = ~0, 195 186 .smp = smp_ops(armada_xp_smp_ops), 196 187 .init_machine = mvebu_dt_init, 197 - .init_time = mvebu_timer_and_clk_init, 188 + .init_irq = mvebu_init_irq, 198 189 .restart = mvebu_restart, 199 190 .dt_compat = armada_370_xp_dt_compat, 200 191 MACHINE_END ··· 207 198 DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") 208 199 .l2c_aux_val = 0, 209 200 .l2c_aux_mask = ~0, 210 - .init_time = mvebu_timer_and_clk_init, 201 + .init_irq = mvebu_init_irq, 211 202 .init_machine = mvebu_dt_init, 212 203 .restart = mvebu_restart, 213 204 .dt_compat = armada_375_dt_compat, ··· 222 213 DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") 223 214 .l2c_aux_val = 0, 224 215 .l2c_aux_mask = ~0, 225 - .init_time = mvebu_timer_and_clk_init, 216 + .init_irq = mvebu_init_irq, 226 217 .restart = mvebu_restart, 227 218 .dt_compat = armada_38x_dt_compat, 228 219 MACHINE_END
+2 -7
arch/arm/mach-mvebu/pmsu.c
··· 66 66 extern void ll_disable_coherency(void); 67 67 extern void ll_enable_coherency(void); 68 68 69 + extern void armada_370_xp_cpu_resume(void); 70 + 69 71 static struct platform_device armada_xp_cpuidle_device = { 70 72 .name = "cpuidle-armada-370-xp", 71 73 }; ··· 140 138 reg = readl(pmsu_mp_base + L2C_NFABRIC_PM_CTL); 141 139 reg |= L2C_NFABRIC_PM_CTL_PWR_DOWN; 142 140 writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL); 143 - } 144 - 145 - static void armada_370_xp_cpu_resume(void) 146 - { 147 - asm volatile("bl ll_add_cpu_to_smp_group\n\t" 148 - "bl ll_enable_coherency\n\t" 149 - "b cpu_resume\n\t"); 150 141 } 151 142 152 143 /* No locking is needed because we only access per-CPU registers */
+25
arch/arm/mach-mvebu/pmsu_ll.S
··· 1 + /* 2 + * Copyright (C) 2014 Marvell 3 + * 4 + * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 5 + * Gregory Clement <gregory.clement@free-electrons.com> 6 + * 7 + * This file is licensed under the terms of the GNU General Public 8 + * License version 2. This program is licensed "as is" without any 9 + * warranty of any kind, whether express or implied. 10 + */ 11 + 12 + #include <linux/linkage.h> 13 + #include <asm/assembler.h> 14 + 15 + /* 16 + * This is the entry point through which CPUs exiting cpuidle deep 17 + * idle state are going. 18 + */ 19 + ENTRY(armada_370_xp_cpu_resume) 20 + ARM_BE8(setend be ) @ go BE8 if entered LE 21 + bl ll_add_cpu_to_smp_group 22 + bl ll_enable_coherency 23 + b cpu_resume 24 + ENDPROC(armada_370_xp_cpu_resume) 25 +
+4 -2
arch/arm/mach-omap2/Makefile
··· 110 110 obj-$(CONFIG_ARCH_OMAP2) += prm2xxx_3xxx.o prm2xxx.o cm2xxx.o 111 111 obj-$(CONFIG_ARCH_OMAP3) += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o 112 112 obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o 113 - obj-$(CONFIG_SOC_AM33XX) += prm33xx.o cm33xx.o 114 113 omap-prcm-4-5-common = cminst44xx.o cm44xx.o prm44xx.o \ 115 114 prcm_mpu44xx.o prminst44xx.o \ 116 115 vc44xx_data.o vp44xx_data.o 117 116 obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) 118 117 obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) 119 118 obj-$(CONFIG_SOC_DRA7XX) += $(omap-prcm-4-5-common) 120 - obj-$(CONFIG_SOC_AM43XX) += $(omap-prcm-4-5-common) 119 + am33xx-43xx-prcm-common += prm33xx.o cm33xx.o 120 + obj-$(CONFIG_SOC_AM33XX) += $(am33xx-43xx-prcm-common) 121 + obj-$(CONFIG_SOC_AM43XX) += $(omap-prcm-4-5-common) \ 122 + $(am33xx-43xx-prcm-common) 121 123 122 124 # OMAP voltage domains 123 125 voltagedomain-common := voltage.o vc.o vp.o
+1 -1
arch/arm/mach-omap2/cm33xx.h
··· 380 380 void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs); 381 381 void am33xx_cm_clkdm_force_wakeup(u16 inst, u16 cdoffs); 382 382 383 - #ifdef CONFIG_SOC_AM33XX 383 + #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) 384 384 extern int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs, 385 385 u16 clkctrl_offs); 386 386 extern void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs,
-1
arch/arm/mach-omap2/common.h
··· 248 248 } 249 249 #endif 250 250 251 - extern void __init gic_init_irq(void); 252 251 extern void gic_dist_disable(void); 253 252 extern void gic_dist_enable(void); 254 253 extern bool gic_dist_disabled(void);
+12
arch/arm/mach-omap2/id.c
··· 649 649 } 650 650 break; 651 651 652 + case 0xb9bc: 653 + switch (rev) { 654 + case 0: 655 + omap_revision = DRA722_REV_ES1_0; 656 + break; 657 + default: 658 + /* If we have no new revisions */ 659 + omap_revision = DRA722_REV_ES1_0; 660 + break; 661 + } 662 + break; 663 + 652 664 default: 653 665 /* Unknown default to latest silicon rev as default*/ 654 666 pr_warn("%s: unknown idcode=0x%08x (hawkeye=0x%08x,rev=0x%d)\n",
+4 -2
arch/arm/mach-omap2/mux.c
··· 183 183 m0_entry = mux->muxnames[0]; 184 184 185 185 /* First check for full name in mode0.muxmode format */ 186 - if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) 187 - continue; 186 + if (mode0_len) 187 + if (strncmp(muxname, m0_entry, mode0_len) || 188 + (strlen(m0_entry) != mode0_len)) 189 + continue; 188 190 189 191 /* Then check for muxmode only */ 190 192 for (i = 0; i < OMAP_MUX_NR_MODES; i++) {
-20
arch/arm/mach-omap2/omap4-common.c
··· 102 102 {} 103 103 #endif 104 104 105 - void __init gic_init_irq(void) 106 - { 107 - void __iomem *omap_irq_base; 108 - 109 - /* Static mapping, never released */ 110 - gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); 111 - BUG_ON(!gic_dist_base_addr); 112 - 113 - twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_4K); 114 - BUG_ON(!twd_base); 115 - 116 - /* Static mapping, never released */ 117 - omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); 118 - BUG_ON(!omap_irq_base); 119 - 120 - omap_wakeupgen_init(); 121 - 122 - gic_init(0, 29, gic_dist_base_addr, omap_irq_base); 123 - } 124 - 125 105 void gic_dist_disable(void) 126 106 { 127 107 if (gic_dist_base_addr)
+3 -3
arch/arm/mach-omap2/omap_hwmod.c
··· 4251 4251 soc_ops.enable_module = _omap4_enable_module; 4252 4252 soc_ops.disable_module = _omap4_disable_module; 4253 4253 soc_ops.wait_target_ready = _omap4_wait_target_ready; 4254 - soc_ops.assert_hardreset = _omap4_assert_hardreset; 4255 - soc_ops.deassert_hardreset = _omap4_deassert_hardreset; 4256 - soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted; 4254 + soc_ops.assert_hardreset = _am33xx_assert_hardreset; 4255 + soc_ops.deassert_hardreset = _am33xx_deassert_hardreset; 4256 + soc_ops.is_hardreset_asserted = _am33xx_is_hardreset_asserted; 4257 4257 soc_ops.init_clkdm = _init_clkdm; 4258 4258 } else if (soc_is_am33xx()) { 4259 4259 soc_ops.enable_module = _am33xx_enable_module;
+73
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
··· 2020 2020 }, 2021 2021 }; 2022 2022 2023 + /* 2024 + * 'ocp2scp' class 2025 + * bridge to transform ocp interface protocol to scp (serial control port) 2026 + * protocol 2027 + */ 2028 + /* ocp2scp3 */ 2029 + static struct omap_hwmod omap54xx_ocp2scp3_hwmod; 2030 + /* l4_cfg -> ocp2scp3 */ 2031 + static struct omap_hwmod_ocp_if omap54xx_l4_cfg__ocp2scp3 = { 2032 + .master = &omap54xx_l4_cfg_hwmod, 2033 + .slave = &omap54xx_ocp2scp3_hwmod, 2034 + .clk = "l4_root_clk_div", 2035 + .user = OCP_USER_MPU | OCP_USER_SDMA, 2036 + }; 2037 + 2038 + static struct omap_hwmod omap54xx_ocp2scp3_hwmod = { 2039 + .name = "ocp2scp3", 2040 + .class = &omap54xx_ocp2scp_hwmod_class, 2041 + .clkdm_name = "l3init_clkdm", 2042 + .prcm = { 2043 + .omap4 = { 2044 + .clkctrl_offs = OMAP54XX_CM_L3INIT_OCP2SCP3_CLKCTRL_OFFSET, 2045 + .context_offs = OMAP54XX_RM_L3INIT_OCP2SCP3_CONTEXT_OFFSET, 2046 + .modulemode = MODULEMODE_HWCTRL, 2047 + }, 2048 + }, 2049 + }; 2050 + 2051 + /* 2052 + * 'sata' class 2053 + * sata: serial ata interface gen2 compliant ( 1 rx/ 1 tx) 2054 + */ 2055 + 2056 + static struct omap_hwmod_class_sysconfig omap54xx_sata_sysc = { 2057 + .sysc_offs = 0x0000, 2058 + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), 2059 + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2060 + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 2061 + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 2062 + .sysc_fields = &omap_hwmod_sysc_type2, 2063 + }; 2064 + 2065 + static struct omap_hwmod_class omap54xx_sata_hwmod_class = { 2066 + .name = "sata", 2067 + .sysc = &omap54xx_sata_sysc, 2068 + }; 2069 + 2070 + /* sata */ 2071 + static struct omap_hwmod omap54xx_sata_hwmod = { 2072 + .name = "sata", 2073 + .class = &omap54xx_sata_hwmod_class, 2074 + .clkdm_name = "l3init_clkdm", 2075 + .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, 2076 + .main_clk = "func_48m_fclk", 2077 + .mpu_rt_idx = 1, 2078 + .prcm = { 2079 + .omap4 = { 2080 + .clkctrl_offs = OMAP54XX_CM_L3INIT_SATA_CLKCTRL_OFFSET, 2081 + .context_offs = OMAP54XX_RM_L3INIT_SATA_CONTEXT_OFFSET, 2082 + .modulemode = MODULEMODE_SWCTRL, 2083 + }, 2084 + }, 2085 + }; 2086 + 2087 + /* l4_cfg -> sata */ 2088 + static struct omap_hwmod_ocp_if omap54xx_l4_cfg__sata = { 2089 + .master = &omap54xx_l4_cfg_hwmod, 2090 + .slave = &omap54xx_sata_hwmod, 2091 + .clk = "l3_iclk_div", 2092 + .user = OCP_USER_MPU | OCP_USER_SDMA, 2093 + }; 2023 2094 2024 2095 /* 2025 2096 * Interfaces ··· 2836 2765 &omap54xx_l4_cfg__usb_tll_hs, 2837 2766 &omap54xx_l4_cfg__usb_otg_ss, 2838 2767 &omap54xx_l4_wkup__wd_timer2, 2768 + &omap54xx_l4_cfg__ocp2scp3, 2769 + &omap54xx_l4_cfg__sata, 2839 2770 NULL, 2840 2771 }; 2841 2772
+1
arch/arm/mach-omap2/soc.h
··· 462 462 #define DRA7XX_CLASS 0x07000000 463 463 #define DRA752_REV_ES1_0 (DRA7XX_CLASS | (0x52 << 16) | (0x10 << 8)) 464 464 #define DRA752_REV_ES1_1 (DRA7XX_CLASS | (0x52 << 16) | (0x11 << 8)) 465 + #define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8)) 465 466 466 467 void omap2xxx_check_revision(void); 467 468 void omap3xxx_check_revision(void);
+77
arch/arm/mach-sunxi/sunxi.c
··· 12 12 13 13 #include <linux/clk-provider.h> 14 14 #include <linux/clocksource.h> 15 + #include <linux/delay.h> 16 + #include <linux/kernel.h> 17 + #include <linux/init.h> 18 + #include <linux/of_address.h> 19 + #include <linux/of_irq.h> 20 + #include <linux/of_platform.h> 21 + #include <linux/io.h> 22 + #include <linux/reboot.h> 15 23 16 24 #include <asm/mach/arch.h> 25 + #include <asm/mach/map.h> 26 + #include <asm/system_misc.h> 27 + 28 + #define SUN4I_WATCHDOG_CTRL_REG 0x00 29 + #define SUN4I_WATCHDOG_CTRL_RESTART BIT(0) 30 + #define SUN4I_WATCHDOG_MODE_REG 0x04 31 + #define SUN4I_WATCHDOG_MODE_ENABLE BIT(0) 32 + #define SUN4I_WATCHDOG_MODE_RESET_ENABLE BIT(1) 33 + 34 + #define SUN6I_WATCHDOG1_IRQ_REG 0x00 35 + #define SUN6I_WATCHDOG1_CTRL_REG 0x10 36 + #define SUN6I_WATCHDOG1_CTRL_RESTART BIT(0) 37 + #define SUN6I_WATCHDOG1_CONFIG_REG 0x14 38 + #define SUN6I_WATCHDOG1_CONFIG_RESTART BIT(0) 39 + #define SUN6I_WATCHDOG1_CONFIG_IRQ BIT(1) 40 + #define SUN6I_WATCHDOG1_MODE_REG 0x18 41 + #define SUN6I_WATCHDOG1_MODE_ENABLE BIT(0) 42 + 43 + static void __iomem *wdt_base; 44 + 45 + static void sun4i_restart(enum reboot_mode mode, const char *cmd) 46 + { 47 + if (!wdt_base) 48 + return; 49 + 50 + /* Enable timer and set reset bit in the watchdog */ 51 + writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE, 52 + wdt_base + SUN4I_WATCHDOG_MODE_REG); 53 + 54 + /* 55 + * Restart the watchdog. The default (and lowest) interval 56 + * value for the watchdog is 0.5s. 57 + */ 58 + writel(SUN4I_WATCHDOG_CTRL_RESTART, wdt_base + SUN4I_WATCHDOG_CTRL_REG); 59 + 60 + while (1) { 61 + mdelay(5); 62 + writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE, 63 + wdt_base + SUN4I_WATCHDOG_MODE_REG); 64 + } 65 + } 66 + 67 + static struct of_device_id sunxi_restart_ids[] = { 68 + { .compatible = "allwinner,sun4i-a10-wdt" }, 69 + { /*sentinel*/ } 70 + }; 71 + 72 + static void sunxi_setup_restart(void) 73 + { 74 + struct device_node *np; 75 + 76 + np = of_find_matching_node(NULL, sunxi_restart_ids); 77 + if (WARN(!np, "unable to setup watchdog restart")) 78 + return; 79 + 80 + wdt_base = of_iomap(np, 0); 81 + WARN(!wdt_base, "failed to map watchdog base address"); 82 + } 83 + 84 + static void __init sunxi_dt_init(void) 85 + { 86 + sunxi_setup_restart(); 87 + 88 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 89 + } 17 90 18 91 static const char * const sunxi_board_dt_compat[] = { 19 92 "allwinner,sun4i-a10", ··· 96 23 }; 97 24 98 25 DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") 26 + .init_machine = sunxi_dt_init, 99 27 .dt_compat = sunxi_board_dt_compat, 28 + .restart = sun4i_restart, 100 29 MACHINE_END 101 30 102 31 static const char * const sun6i_board_dt_compat[] = { ··· 126 51 }; 127 52 128 53 DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family") 54 + .init_machine = sunxi_dt_init, 129 55 .dt_compat = sun7i_board_dt_compat, 56 + .restart = sun4i_restart, 130 57 MACHINE_END
+1 -1
arch/arm64/include/asm/pgtable.h
··· 292 292 #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ 293 293 PMD_TYPE_SECT) 294 294 295 - #ifdef ARM64_64K_PAGES 295 + #ifdef CONFIG_ARM64_64K_PAGES 296 296 #define pud_sect(pud) (0) 297 297 #else 298 298 #define pud_sect(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \
+4
arch/arm64/include/asm/ptrace.h
··· 21 21 22 22 #include <uapi/asm/ptrace.h> 23 23 24 + /* Current Exception Level values, as contained in CurrentEL */ 25 + #define CurrentEL_EL1 (1 << 2) 26 + #define CurrentEL_EL2 (2 << 2) 27 + 24 28 /* AArch32-specific ptrace requests */ 25 29 #define COMPAT_PTRACE_GETREGS 12 26 30 #define COMPAT_PTRACE_SETREGS 13
+1 -2
arch/arm64/kernel/efi-entry.S
··· 78 78 79 79 /* Turn off Dcache and MMU */ 80 80 mrs x0, CurrentEL 81 - cmp x0, #PSR_MODE_EL2t 82 - ccmp x0, #PSR_MODE_EL2h, #0x4, ne 81 + cmp x0, #CurrentEL_EL2 83 82 b.ne 1f 84 83 mrs x0, sctlr_el2 85 84 bic x0, x0, #1 << 0 // clear SCTLR.M
+1 -2
arch/arm64/kernel/head.S
··· 270 270 */ 271 271 ENTRY(el2_setup) 272 272 mrs x0, CurrentEL 273 - cmp x0, #PSR_MODE_EL2t 274 - ccmp x0, #PSR_MODE_EL2h, #0x4, ne 273 + cmp x0, #CurrentEL_EL2 275 274 b.ne 1f 276 275 mrs x0, sctlr_el2 277 276 CPU_BE( orr x0, x0, #(1 << 25) ) // Set the EE bit for EL2
+2 -1
arch/arm64/mm/flush.c
··· 79 79 return; 80 80 81 81 if (!test_and_set_bit(PG_dcache_clean, &page->flags)) { 82 - __flush_dcache_area(page_address(page), PAGE_SIZE); 82 + __flush_dcache_area(page_address(page), 83 + PAGE_SIZE << compound_order(page)); 83 84 __flush_icache_all(); 84 85 } else if (icache_is_aivivt()) { 85 86 __flush_icache_all();
+1
arch/mips/kvm/kvm_mips.c
··· 384 384 385 385 kfree(vcpu->arch.guest_ebase); 386 386 kfree(vcpu->arch.kseg0_commpage); 387 + kfree(vcpu); 387 388 } 388 389 389 390 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
+1
arch/s390/include/uapi/asm/Kbuild
··· 36 36 header-y += socket.h 37 37 header-y += sockios.h 38 38 header-y += sclp_ctl.h 39 + header-y += sie.h 39 40 header-y += stat.h 40 41 header-y += statfs.h 41 42 header-y += swab.h
+12 -14
arch/s390/include/uapi/asm/sie.h
··· 1 1 #ifndef _UAPI_ASM_S390_SIE_H 2 2 #define _UAPI_ASM_S390_SIE_H 3 3 4 - #include <asm/sigp.h> 5 - 6 4 #define diagnose_codes \ 7 5 { 0x10, "DIAG (0x10) release pages" }, \ 8 6 { 0x44, "DIAG (0x44) time slice end" }, \ ··· 11 13 { 0x500, "DIAG (0x500) KVM virtio functions" }, \ 12 14 { 0x501, "DIAG (0x501) KVM breakpoint" } 13 15 14 - #define sigp_order_codes \ 15 - { SIGP_SENSE, "SIGP sense" }, \ 16 - { SIGP_EXTERNAL_CALL, "SIGP external call" }, \ 17 - { SIGP_EMERGENCY_SIGNAL, "SIGP emergency signal" }, \ 18 - { SIGP_STOP, "SIGP stop" }, \ 19 - { SIGP_STOP_AND_STORE_STATUS, "SIGP stop and store status" }, \ 20 - { SIGP_SET_ARCHITECTURE, "SIGP set architecture" }, \ 21 - { SIGP_SET_PREFIX, "SIGP set prefix" }, \ 22 - { SIGP_SENSE_RUNNING, "SIGP sense running" }, \ 23 - { SIGP_RESTART, "SIGP restart" }, \ 24 - { SIGP_INITIAL_CPU_RESET, "SIGP initial cpu reset" }, \ 25 - { SIGP_STORE_STATUS_AT_ADDRESS, "SIGP store status at address" } 16 + #define sigp_order_codes \ 17 + { 0x01, "SIGP sense" }, \ 18 + { 0x02, "SIGP external call" }, \ 19 + { 0x03, "SIGP emergency signal" }, \ 20 + { 0x05, "SIGP stop" }, \ 21 + { 0x06, "SIGP restart" }, \ 22 + { 0x09, "SIGP stop and store status" }, \ 23 + { 0x0b, "SIGP initial cpu reset" }, \ 24 + { 0x0d, "SIGP set prefix" }, \ 25 + { 0x0e, "SIGP store status at address" }, \ 26 + { 0x12, "SIGP set architecture" }, \ 27 + { 0x15, "SIGP sense running" } 26 28 27 29 #define icpt_prog_codes \ 28 30 { 0x0001, "Prog Operation" }, \
+2 -2
arch/x86/include/asm/kvm_host.h
··· 95 95 #define KVM_REFILL_PAGES 25 96 96 #define KVM_MAX_CPUID_ENTRIES 80 97 97 #define KVM_NR_FIXED_MTRR_REGION 88 98 - #define KVM_NR_VAR_MTRR 8 98 + #define KVM_NR_VAR_MTRR 10 99 99 100 100 #define ASYNC_PF_PER_VCPU 64 101 101 ··· 461 461 bool nmi_injected; /* Trying to inject an NMI this entry */ 462 462 463 463 struct mtrr_state_type mtrr_state; 464 - u32 pat; 464 + u64 pat; 465 465 466 466 unsigned switch_db_regs; 467 467 unsigned long db[KVM_NR_DB_REGS];
+16
arch/x86/include/asm/ptrace.h
··· 231 231 232 232 #define ARCH_HAS_USER_SINGLE_STEP_INFO 233 233 234 + /* 235 + * When hitting ptrace_stop(), we cannot return using SYSRET because 236 + * that does not restore the full CPU state, only a minimal set. The 237 + * ptracer can change arbitrary register values, which is usually okay 238 + * because the usual ptrace stops run off the signal delivery path which 239 + * forces IRET; however, ptrace_event() stops happen in arbitrary places 240 + * in the kernel and don't force IRET path. 241 + * 242 + * So force IRET path after a ptrace stop. 243 + */ 244 + #define arch_ptrace_stop_needed(code, info) \ 245 + ({ \ 246 + set_thread_flag(TIF_NOTIFY_RESUME); \ 247 + false; \ 248 + }) 249 + 234 250 struct user_desc; 235 251 extern int do_get_thread_area(struct task_struct *p, int idx, 236 252 struct user_desc __user *info);
+1
arch/x86/kvm/svm.c
··· 1462 1462 */ 1463 1463 if (var->unusable) 1464 1464 var->db = 0; 1465 + var->dpl = to_svm(vcpu)->vmcb->save.cpl; 1465 1466 break; 1466 1467 } 1467 1468 }
+1 -1
arch/x86/kvm/x86.c
··· 1898 1898 if (!(data & HV_X64_MSR_TSC_REFERENCE_ENABLE)) 1899 1899 break; 1900 1900 gfn = data >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT; 1901 - if (kvm_write_guest(kvm, data, 1901 + if (kvm_write_guest(kvm, gfn << HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT, 1902 1902 &tsc_ref, sizeof(tsc_ref))) 1903 1903 return 1; 1904 1904 mark_page_dirty(kvm, gfn);
+4 -1
drivers/block/zram/zram_drv.c
··· 622 622 memset(&zram->stats, 0, sizeof(zram->stats)); 623 623 624 624 zram->disksize = 0; 625 - if (reset_capacity) 625 + if (reset_capacity) { 626 626 set_capacity(zram->disk, 0); 627 + revalidate_disk(zram->disk); 628 + } 627 629 up_write(&zram->init_lock); 628 630 } 629 631 ··· 666 664 zram->comp = comp; 667 665 zram->disksize = disksize; 668 666 set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); 667 + revalidate_disk(zram->disk); 669 668 up_write(&zram->init_lock); 670 669 return len; 671 670
drivers/gpu/drm/drm_drv.c
+9 -3
drivers/gpu/drm/i2c/tda998x_drv.c
··· 810 810 tda998x_encoder_mode_valid(struct drm_encoder *encoder, 811 811 struct drm_display_mode *mode) 812 812 { 813 + if (mode->clock > 150000) 814 + return MODE_CLOCK_HIGH; 815 + if (mode->htotal >= BIT(13)) 816 + return MODE_BAD_HVALUE; 817 + if (mode->vtotal >= BIT(11)) 818 + return MODE_BAD_VVALUE; 813 819 return MODE_OK; 814 820 } 815 821 ··· 1054 1048 return i; 1055 1049 } 1056 1050 } else { 1057 - for (i = 10; i > 0; i--) { 1058 - msleep(10); 1051 + for (i = 100; i > 0; i--) { 1052 + msleep(1); 1059 1053 ret = reg_read(priv, REG_INT_FLAGS_2); 1060 1054 if (ret < 0) 1061 1055 return ret; ··· 1189 1183 tda998x_encoder_destroy(struct drm_encoder *encoder) 1190 1184 { 1191 1185 struct tda998x_priv *priv = to_tda998x_priv(encoder); 1192 - drm_i2c_encoder_destroy(encoder); 1193 1186 1194 1187 /* disable all IRQs and free the IRQ handler */ 1195 1188 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); ··· 1198 1193 1199 1194 if (priv->cec) 1200 1195 i2c_unregister_device(priv->cec); 1196 + drm_i2c_encoder_destroy(encoder); 1201 1197 kfree(priv); 1202 1198 } 1203 1199
+26 -1
drivers/gpu/drm/i915/intel_display.c
··· 2087 2087 static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv, 2088 2088 enum plane plane, enum pipe pipe) 2089 2089 { 2090 + struct drm_device *dev = dev_priv->dev; 2090 2091 struct intel_crtc *intel_crtc = 2091 2092 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 2092 2093 int reg; ··· 2107 2106 2108 2107 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); 2109 2108 intel_flush_primary_plane(dev_priv, plane); 2109 + 2110 + /* 2111 + * BDW signals flip done immediately if the plane 2112 + * is disabled, even if the plane enable is already 2113 + * armed to occur at the next vblank :( 2114 + */ 2115 + if (IS_BROADWELL(dev)) 2116 + intel_wait_for_vblank(dev, intel_crtc->pipe); 2110 2117 } 2111 2118 2112 2119 /** ··· 11097 11088 return names[output]; 11098 11089 } 11099 11090 11091 + static bool intel_crt_present(struct drm_device *dev) 11092 + { 11093 + struct drm_i915_private *dev_priv = dev->dev_private; 11094 + 11095 + if (IS_ULT(dev)) 11096 + return false; 11097 + 11098 + if (IS_CHERRYVIEW(dev)) 11099 + return false; 11100 + 11101 + if (IS_VALLEYVIEW(dev) && !dev_priv->vbt.int_crt_support) 11102 + return false; 11103 + 11104 + return true; 11105 + } 11106 + 11100 11107 static void intel_setup_outputs(struct drm_device *dev) 11101 11108 { 11102 11109 struct drm_i915_private *dev_priv = dev->dev_private; ··· 11121 11096 11122 11097 intel_lvds_init(dev); 11123 11098 11124 - if (!IS_ULT(dev) && !IS_CHERRYVIEW(dev) && dev_priv->vbt.int_crt_support) 11099 + if (intel_crt_present(dev)) 11125 11100 intel_crt_init(dev); 11126 11101 11127 11102 if (HAS_DDI(dev)) {
+29
drivers/gpu/drm/i915/intel_pm.c
··· 3209 3209 */ 3210 3210 static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) 3211 3211 { 3212 + struct drm_device *dev = dev_priv->dev; 3213 + 3214 + /* Latest VLV doesn't need to force the gfx clock */ 3215 + if (dev->pdev->revision >= 0xd) { 3216 + valleyview_set_rps(dev_priv->dev, dev_priv->rps.min_freq_softlimit); 3217 + return; 3218 + } 3219 + 3212 3220 /* 3213 3221 * When we are idle. Drop to min voltage state. 3214 3222 */ ··· 6045 6037 return 0; 6046 6038 } 6047 6039 EXPORT_SYMBOL_GPL(i915_release_power_well); 6040 + 6041 + /* 6042 + * Private interface for the audio driver to get CDCLK in kHz. 6043 + * 6044 + * Caller must request power well using i915_request_power_well() prior to 6045 + * making the call. 6046 + */ 6047 + int i915_get_cdclk_freq(void) 6048 + { 6049 + struct drm_i915_private *dev_priv; 6050 + 6051 + if (!hsw_pwr) 6052 + return -ENODEV; 6053 + 6054 + dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6055 + power_domains); 6056 + 6057 + return intel_ddi_get_cdclk_freq(dev_priv); 6058 + } 6059 + EXPORT_SYMBOL_GPL(i915_get_cdclk_freq); 6060 + 6048 6061 6049 6062 #define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1) 6050 6063
+8
drivers/gpu/drm/i915/intel_sprite.c
··· 691 691 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 692 692 693 693 /* 694 + * BDW signals flip done immediately if the plane 695 + * is disabled, even if the plane enable is already 696 + * armed to occur at the next vblank :( 697 + */ 698 + if (IS_BROADWELL(dev)) 699 + intel_wait_for_vblank(dev, intel_crtc->pipe); 700 + 701 + /* 694 702 * FIXME IPS should be fine as long as one plane is 695 703 * enabled, but in practice it seems to have problems 696 704 * when going from primary only to sprite only and vice
+7 -5
drivers/gpu/drm/radeon/atombios_dp.c
··· 403 403 { 404 404 struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv; 405 405 u8 msg[DP_DPCD_SIZE]; 406 - int ret, i; 406 + int ret; 407 + 408 + char dpcd_hex_dump[DP_DPCD_SIZE * 3]; 407 409 408 410 ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg, 409 411 DP_DPCD_SIZE); 410 412 if (ret > 0) { 411 413 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 412 - DRM_DEBUG_KMS("DPCD: "); 413 - for (i = 0; i < DP_DPCD_SIZE; i++) 414 - DRM_DEBUG_KMS("%02x ", msg[i]); 415 - DRM_DEBUG_KMS("\n"); 414 + 415 + hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->dpcd), 416 + 32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false); 417 + DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump); 416 418 417 419 radeon_dp_probe_oui(radeon_connector); 418 420
+1 -1
drivers/gpu/drm/radeon/cikd.h
··· 1752 1752 #define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */ 1753 1753 #define EOP_TCL1_ACTION_EN (1 << 16) 1754 1754 #define EOP_TC_ACTION_EN (1 << 17) /* L2 */ 1755 + #define EOP_TCL2_VOLATILE (1 << 24) 1755 1756 #define EOP_CACHE_POLICY(x) ((x) << 25) 1756 1757 /* 0 - LRU 1757 1758 * 1 - Stream 1758 1759 * 2 - Bypass 1759 1760 */ 1760 - #define EOP_TCL2_VOLATILE (1 << 27) 1761 1761 #define DATA_SEL(x) ((x) << 29) 1762 1762 /* 0 - discard 1763 1763 * 1 - send low 32bit data
+1 -1
drivers/gpu/drm/radeon/cypress_dpm.c
··· 1551 1551 1552 1552 table->voltageMaskTable.highMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 0; 1553 1553 table->voltageMaskTable.lowMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 1554 - cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); 1554 + cpu_to_be32(eg_pi->vddci_voltage_table.mask_low); 1555 1555 } 1556 1556 1557 1557 return 0;
+1 -1
drivers/gpu/drm/radeon/kv_dpm.c
··· 2726 2726 pi->caps_sclk_ds = true; 2727 2727 pi->enable_auto_thermal_throttling = true; 2728 2728 pi->disable_nb_ps3_in_battery = false; 2729 - pi->bapm_enable = false; 2729 + pi->bapm_enable = true; 2730 2730 pi->voltage_drop_t = 0; 2731 2731 pi->caps_sclk_throttle_low_notification = false; 2732 2732 pi->caps_fps = false; /* true? */
+1 -1
drivers/gpu/drm/radeon/ni_dpm.c
··· 1315 1315 1316 1316 table->voltageMaskTable.highMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 0; 1317 1317 table->voltageMaskTable.lowMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 1318 - cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); 1318 + cpu_to_be32(eg_pi->vddci_voltage_table.mask_low); 1319 1319 } 1320 1320 } 1321 1321
+1 -4
drivers/gpu/drm/radeon/radeon.h
··· 102 102 extern int radeon_hard_reset; 103 103 extern int radeon_vm_size; 104 104 extern int radeon_vm_block_size; 105 + extern int radeon_deep_color; 105 106 106 107 /* 107 108 * Copy from radeon_drv.h so we don't have to include both and have conflicting ··· 749 748 struct evergreen_irq_stat_regs evergreen; 750 749 struct cik_irq_stat_regs cik; 751 750 }; 752 - 753 - #define RADEON_MAX_HPD_PINS 7 754 - #define RADEON_MAX_CRTCS 6 755 - #define RADEON_MAX_AFMT_BLOCKS 7 756 751 757 752 struct radeon_irq { 758 753 bool installed;
+9 -1
drivers/gpu/drm/radeon/radeon_atombios.c
··· 1227 1227 rdev->clock.default_dispclk = 1228 1228 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq); 1229 1229 if (rdev->clock.default_dispclk == 0) { 1230 - if (ASIC_IS_DCE5(rdev)) 1230 + if (ASIC_IS_DCE6(rdev)) 1231 + rdev->clock.default_dispclk = 60000; /* 600 Mhz */ 1232 + else if (ASIC_IS_DCE5(rdev)) 1231 1233 rdev->clock.default_dispclk = 54000; /* 540 Mhz */ 1232 1234 else 1233 1235 rdev->clock.default_dispclk = 60000; /* 600 Mhz */ 1236 + } 1237 + /* set a reasonable default for DP */ 1238 + if (ASIC_IS_DCE6(rdev) && (rdev->clock.default_dispclk < 53900)) { 1239 + DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n", 1240 + rdev->clock.default_dispclk / 100); 1241 + rdev->clock.default_dispclk = 60000; 1234 1242 } 1235 1243 rdev->clock.dp_extclk = 1236 1244 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
+3
drivers/gpu/drm/radeon/radeon_connectors.c
··· 199 199 } 200 200 } 201 201 202 + if ((radeon_deep_color == 0) && (bpc > 8)) 203 + bpc = 8; 204 + 202 205 DRM_DEBUG("%s: Display bpc=%d, returned bpc=%d\n", 203 206 connector->name, connector->display_info.bpc, bpc); 204 207
+14 -5
drivers/gpu/drm/radeon/radeon_display.c
··· 285 285 void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id) 286 286 { 287 287 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; 288 - struct radeon_flip_work *work; 289 288 unsigned long flags; 290 289 u32 update_pending; 291 290 int vpos, hpos; ··· 294 295 return; 295 296 296 297 spin_lock_irqsave(&rdev->ddev->event_lock, flags); 297 - work = radeon_crtc->flip_work; 298 - if (work == NULL) { 298 + if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) { 299 + DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != " 300 + "RADEON_FLIP_SUBMITTED(%d)\n", 301 + radeon_crtc->flip_status, 302 + RADEON_FLIP_SUBMITTED); 299 303 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 300 304 return; 301 305 } ··· 346 344 347 345 spin_lock_irqsave(&rdev->ddev->event_lock, flags); 348 346 work = radeon_crtc->flip_work; 349 - if (work == NULL) { 347 + if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) { 348 + DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != " 349 + "RADEON_FLIP_SUBMITTED(%d)\n", 350 + radeon_crtc->flip_status, 351 + RADEON_FLIP_SUBMITTED); 350 352 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 351 353 return; 352 354 } 353 355 354 356 /* Pageflip completed. Clean up. */ 357 + radeon_crtc->flip_status = RADEON_FLIP_NONE; 355 358 radeon_crtc->flip_work = NULL; 356 359 357 360 /* wakeup userspace */ ··· 483 476 /* do the flip (mmio) */ 484 477 radeon_page_flip(rdev, radeon_crtc->crtc_id, base); 485 478 479 + radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; 486 480 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 487 481 up_read(&rdev->exclusive_lock); 488 482 ··· 552 544 /* We borrow the event spin lock for protecting flip_work */ 553 545 spin_lock_irqsave(&crtc->dev->event_lock, flags); 554 546 555 - if (radeon_crtc->flip_work) { 547 + if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { 556 548 DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); 557 549 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 558 550 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); ··· 560 552 kfree(work); 561 553 return -EBUSY; 562 554 } 555 + radeon_crtc->flip_status = RADEON_FLIP_PENDING; 563 556 radeon_crtc->flip_work = work; 564 557 565 558 /* update crtc fb */
+4
drivers/gpu/drm/radeon/radeon_drv.c
··· 175 175 int radeon_hard_reset = 0; 176 176 int radeon_vm_size = 4096; 177 177 int radeon_vm_block_size = 9; 178 + int radeon_deep_color = 0; 178 179 179 180 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); 180 181 module_param_named(no_wb, radeon_no_wb, int, 0444); ··· 248 247 249 248 MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)"); 250 249 module_param_named(vm_block_size, radeon_vm_block_size, int, 0444); 250 + 251 + MODULE_PARM_DESC(deep_color, "Deep Color support (1 = enable, 0 = disable (default))"); 252 + module_param_named(deep_color, radeon_deep_color, int, 0444); 251 253 252 254 static struct pci_device_id pciidlist[] = { 253 255 radeon_PCI_IDS
+13 -2
drivers/gpu/drm/radeon/radeon_mode.h
··· 46 46 #define to_radeon_encoder(x) container_of(x, struct radeon_encoder, base) 47 47 #define to_radeon_framebuffer(x) container_of(x, struct radeon_framebuffer, base) 48 48 49 + #define RADEON_MAX_HPD_PINS 7 50 + #define RADEON_MAX_CRTCS 6 51 + #define RADEON_MAX_AFMT_BLOCKS 7 52 + 49 53 enum radeon_rmx_type { 50 54 RMX_OFF, 51 55 RMX_FULL, ··· 237 233 struct card_info *atom_card_info; 238 234 enum radeon_connector_table connector_table; 239 235 bool mode_config_initialized; 240 - struct radeon_crtc *crtcs[6]; 241 - struct radeon_afmt *afmt[7]; 236 + struct radeon_crtc *crtcs[RADEON_MAX_CRTCS]; 237 + struct radeon_afmt *afmt[RADEON_MAX_AFMT_BLOCKS]; 242 238 /* DVI-I properties */ 243 239 struct drm_property *coherent_mode_property; 244 240 /* DAC enable load detect */ ··· 306 302 uint16_t amount; 307 303 }; 308 304 305 + enum radeon_flip_status { 306 + RADEON_FLIP_NONE, 307 + RADEON_FLIP_PENDING, 308 + RADEON_FLIP_SUBMITTED 309 + }; 310 + 309 311 struct radeon_crtc { 310 312 struct drm_crtc base; 311 313 int crtc_id; ··· 337 327 /* page flipping */ 338 328 struct workqueue_struct *flip_queue; 339 329 struct radeon_flip_work *flip_work; 330 + enum radeon_flip_status flip_status; 340 331 /* pll sharing */ 341 332 struct radeon_atom_ss ss; 342 333 bool ss_enabled;
+4 -2
drivers/gpu/drm/radeon/radeon_pm.c
··· 73 73 rdev->pm.dpm.ac_power = true; 74 74 else 75 75 rdev->pm.dpm.ac_power = false; 76 - if (rdev->asic->dpm.enable_bapm) 77 - radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power); 76 + if (rdev->family == CHIP_ARUBA) { 77 + if (rdev->asic->dpm.enable_bapm) 78 + radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power); 79 + } 78 80 mutex_unlock(&rdev->pm.mutex); 79 81 } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) { 80 82 if (rdev->pm.profile == PM_PROFILE_AUTO) {
+2 -2
drivers/gpu/drm/radeon/radeon_vm.c
··· 495 495 mutex_unlock(&vm->mutex); 496 496 497 497 r = radeon_bo_create(rdev, RADEON_VM_PTE_COUNT * 8, 498 - RADEON_GPU_PAGE_SIZE, false, 498 + RADEON_GPU_PAGE_SIZE, true, 499 499 RADEON_GEM_DOMAIN_VRAM, NULL, &pt); 500 500 if (r) 501 501 return r; ··· 992 992 return -ENOMEM; 993 993 } 994 994 995 - r = radeon_bo_create(rdev, pd_size, align, false, 995 + r = radeon_bo_create(rdev, pd_size, align, true, 996 996 RADEON_GEM_DOMAIN_VRAM, NULL, 997 997 &vm->page_directory); 998 998 if (r)
+9 -1
drivers/gpu/drm/radeon/trinity_dpm.c
··· 1874 1874 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) 1875 1875 pi->at[i] = TRINITY_AT_DFLT; 1876 1876 1877 - pi->enable_bapm = false; 1877 + /* There are stability issues reported on latops with 1878 + * bapm installed when switching between AC and battery 1879 + * power. At the same time, some desktop boards hang 1880 + * if it's not enabled and dpm is enabled. 1881 + */ 1882 + if (rdev->flags & RADEON_IS_MOBILITY) 1883 + pi->enable_bapm = false; 1884 + else 1885 + pi->enable_bapm = true; 1878 1886 pi->enable_nbps_policy = true; 1879 1887 pi->enable_sclk_ds = true; 1880 1888 pi->enable_gfx_power_gating = true;
-1
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 179 179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); 180 180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); 181 181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); 182 - vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length); 183 182 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 184 183 } 185 184
+6 -2
drivers/iio/adc/ad799x.c
··· 427 427 int ret; 428 428 struct ad799x_state *st = iio_priv(indio_dev); 429 429 430 + if (val < 0 || val > RES_MASK(chan->scan_type.realbits)) 431 + return -EINVAL; 432 + 430 433 mutex_lock(&indio_dev->mlock); 431 434 ret = ad799x_i2c_write16(st, ad799x_threshold_reg(chan, dir, info), 432 - val); 435 + val << chan->scan_type.shift); 433 436 mutex_unlock(&indio_dev->mlock); 434 437 435 438 return ret; ··· 455 452 mutex_unlock(&indio_dev->mlock); 456 453 if (ret < 0) 457 454 return ret; 458 - *val = valin; 455 + *val = (valin >> chan->scan_type.shift) & 456 + RES_MASK(chan->scan_type.realbits); 459 457 460 458 return IIO_VAL_INT; 461 459 }
+4 -2
drivers/iio/inkern.c
··· 183 183 else if (name && index >= 0) { 184 184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", 185 185 np->full_name, name ? name : "", index); 186 - return chan; 186 + return NULL; 187 187 } 188 188 189 189 /* ··· 193 193 */ 194 194 np = np->parent; 195 195 if (np && !of_get_property(np, "io-channel-ranges", NULL)) 196 - break; 196 + return NULL; 197 197 } 198 + 198 199 return chan; 199 200 } 200 201 ··· 318 317 if (channel != NULL) 319 318 return channel; 320 319 } 320 + 321 321 return iio_channel_get_sys(name, channel_name); 322 322 } 323 323 EXPORT_SYMBOL_GPL(iio_channel_get);
+15 -2
drivers/irqchip/irq-armada-370-xp.c
··· 334 334 335 335 static void armada_xp_mpic_smp_cpu_init(void) 336 336 { 337 + u32 control; 338 + int nr_irqs, i; 339 + 340 + control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL); 341 + nr_irqs = (control >> 2) & 0x3ff; 342 + 343 + for (i = 0; i < nr_irqs; i++) 344 + writel(i, per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS); 345 + 337 346 /* Clear pending IPIs */ 338 347 writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); 339 348 ··· 483 474 struct device_node *parent) 484 475 { 485 476 struct resource main_int_res, per_cpu_int_res; 486 - int parent_irq; 477 + int parent_irq, nr_irqs, i; 487 478 u32 control; 488 479 489 480 BUG_ON(of_address_to_resource(node, 0, &main_int_res)); ··· 505 496 BUG_ON(!per_cpu_int_base); 506 497 507 498 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL); 499 + nr_irqs = (control >> 2) & 0x3ff; 500 + 501 + for (i = 0; i < nr_irqs; i++) 502 + writel(i, main_int_base + ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS); 508 503 509 504 armada_370_xp_mpic_domain = 510 - irq_domain_add_linear(node, (control >> 2) & 0x3ff, 505 + irq_domain_add_linear(node, nr_irqs, 511 506 &armada_370_xp_mpic_irq_ops, NULL); 512 507 513 508 BUG_ON(!armada_370_xp_mpic_domain);
+1 -1
drivers/irqchip/irq-brcmstb-l2.c
··· 150 150 151 151 /* Allocate a single Generic IRQ chip for this node */ 152 152 ret = irq_alloc_domain_generic_chips(data->domain, 32, 1, 153 - np->full_name, handle_level_irq, clr, 0, 0); 153 + np->full_name, handle_edge_irq, clr, 0, 0); 154 154 if (ret) { 155 155 pr_err("failed to allocate generic irq chip\n"); 156 156 goto out_free_domain;
+1 -1
drivers/irqchip/spear-shirq.c
··· 125 125 }; 126 126 127 127 static struct spear_shirq spear320_shirq_ras3 = { 128 - .irq_nr = 3, 128 + .irq_nr = 7, 129 129 .irq_bit_off = 0, 130 130 .invalid_irq = 1, 131 131 .regs = {
+14 -1
drivers/md/md.c
··· 5599 5599 if (mddev->in_sync) 5600 5600 info.state = (1<<MD_SB_CLEAN); 5601 5601 if (mddev->bitmap && mddev->bitmap_info.offset) 5602 - info.state = (1<<MD_SB_BITMAP_PRESENT); 5602 + info.state |= (1<<MD_SB_BITMAP_PRESENT); 5603 5603 info.active_disks = insync; 5604 5604 info.working_disks = working; 5605 5605 info.failed_disks = failed; ··· 7501 7501 rdev->recovery_offset < j) 7502 7502 j = rdev->recovery_offset; 7503 7503 rcu_read_unlock(); 7504 + 7505 + /* If there is a bitmap, we need to make sure all 7506 + * writes that started before we added a spare 7507 + * complete before we start doing a recovery. 7508 + * Otherwise the write might complete and (via 7509 + * bitmap_endwrite) set a bit in the bitmap after the 7510 + * recovery has checked that bit and skipped that 7511 + * region. 7512 + */ 7513 + if (mddev->bitmap) { 7514 + mddev->pers->quiesce(mddev, 1); 7515 + mddev->pers->quiesce(mddev, 0); 7516 + } 7504 7517 } 7505 7518 7506 7519 printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev));
+15
drivers/of/fdt.c
··· 880 880 const u64 phys_offset = __pa(PAGE_OFFSET); 881 881 base &= PAGE_MASK; 882 882 size &= PAGE_MASK; 883 + 884 + if (sizeof(phys_addr_t) < sizeof(u64)) { 885 + if (base > ULONG_MAX) { 886 + pr_warning("Ignoring memory block 0x%llx - 0x%llx\n", 887 + base, base + size); 888 + return; 889 + } 890 + 891 + if (base + size > ULONG_MAX) { 892 + pr_warning("Ignoring memory range 0x%lx - 0x%llx\n", 893 + ULONG_MAX, base + size); 894 + size = ULONG_MAX - base; 895 + } 896 + } 897 + 883 898 if (base + size < phys_offset) { 884 899 pr_warning("Ignoring memory block 0x%llx - 0x%llx\n", 885 900 base, base + size);
+2
drivers/scsi/be2iscsi/be_main.c
··· 4198 4198 kfree(phba->ep_array); 4199 4199 phba->ep_array = NULL; 4200 4200 ret = -ENOMEM; 4201 + 4202 + goto free_memory; 4201 4203 } 4202 4204 4203 4205 for (i = 0; i < phba->params.cxns_per_ctrl; i++) {
+1 -3
drivers/scsi/be2iscsi/be_mgmt.c
··· 1008 1008 BE2_IPV6 : BE2_IPV4 ; 1009 1009 1010 1010 rc = mgmt_get_if_info(phba, ip_type, &if_info); 1011 - if (rc) { 1012 - kfree(if_info); 1011 + if (rc) 1013 1012 return rc; 1014 - } 1015 1013 1016 1014 if (boot_proto == ISCSI_BOOTPROTO_DHCP) { 1017 1015 if (if_info->dhcp_state) {
+4 -12
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
··· 516 516 skb_pull(skb, sizeof(struct fcoe_hdr)); 517 517 fr_len = skb->len - sizeof(struct fcoe_crc_eof); 518 518 519 - stats = per_cpu_ptr(lport->stats, get_cpu()); 520 - stats->RxFrames++; 521 - stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; 522 - 523 519 fp = (struct fc_frame *)skb; 524 520 fc_frame_init(fp); 525 521 fr_dev(fp) = lport; 526 522 fr_sof(fp) = hp->fcoe_sof; 527 523 if (skb_copy_bits(skb, fr_len, &crc_eof, sizeof(crc_eof))) { 528 - put_cpu(); 529 524 kfree_skb(skb); 530 525 return; 531 526 } 532 527 fr_eof(fp) = crc_eof.fcoe_eof; 533 528 fr_crc(fp) = crc_eof.fcoe_crc32; 534 529 if (pskb_trim(skb, fr_len)) { 535 - put_cpu(); 536 530 kfree_skb(skb); 537 531 return; 538 532 } ··· 538 544 port = lport_priv(vn_port); 539 545 if (!ether_addr_equal(port->data_src_addr, dest_mac)) { 540 546 BNX2FC_HBA_DBG(lport, "fpma mismatch\n"); 541 - put_cpu(); 542 547 kfree_skb(skb); 543 548 return; 544 549 } ··· 545 552 if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && 546 553 fh->fh_type == FC_TYPE_FCP) { 547 554 /* Drop FCP data. We dont this in L2 path */ 548 - put_cpu(); 549 555 kfree_skb(skb); 550 556 return; 551 557 } ··· 554 562 case ELS_LOGO: 555 563 if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI) { 556 564 /* drop non-FIP LOGO */ 557 - put_cpu(); 558 565 kfree_skb(skb); 559 566 return; 560 567 } ··· 563 572 564 573 if (fh->fh_r_ctl == FC_RCTL_BA_ABTS) { 565 574 /* Drop incoming ABTS */ 566 - put_cpu(); 567 575 kfree_skb(skb); 568 576 return; 569 577 } 578 + 579 + stats = per_cpu_ptr(lport->stats, smp_processor_id()); 580 + stats->RxFrames++; 581 + stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; 570 582 571 583 if (le32_to_cpu(fr_crc(fp)) != 572 584 ~crc32(~0, skb->data, fr_len)) { ··· 577 583 printk(KERN_WARNING PFX "dropping frame with " 578 584 "CRC error\n"); 579 585 stats->InvalidCRCCount++; 580 - put_cpu(); 581 586 kfree_skb(skb); 582 587 return; 583 588 } 584 - put_cpu(); 585 589 fc_exch_recv(lport, fp); 586 590 } 587 591
+2
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 282 282 arr_sz, GFP_KERNEL); 283 283 if (!cmgr->free_list_lock) { 284 284 printk(KERN_ERR PFX "failed to alloc free_list_lock\n"); 285 + kfree(cmgr->free_list); 286 + cmgr->free_list = NULL; 285 287 goto mem_err; 286 288 } 287 289
+12 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 185 185 if (crq->valid & 0x80) { 186 186 if (++queue->cur == queue->size) 187 187 queue->cur = 0; 188 + 189 + /* Ensure the read of the valid bit occurs before reading any 190 + * other bits of the CRQ entry 191 + */ 192 + rmb(); 188 193 } else 189 194 crq = NULL; 190 195 spin_unlock_irqrestore(&queue->lock, flags); ··· 208 203 { 209 204 struct vio_dev *vdev = to_vio_dev(hostdata->dev); 210 205 206 + /* 207 + * Ensure the command buffer is flushed to memory before handing it 208 + * over to the VIOS to prevent it from fetching any stale data. 209 + */ 210 + mb(); 211 211 return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2); 212 212 } 213 213 ··· 807 797 evt->hostdata->dev); 808 798 if (evt->cmnd_done) 809 799 evt->cmnd_done(evt->cmnd); 810 - } else if (evt->done) 800 + } else if (evt->done && evt->crq.format != VIOSRP_MAD_FORMAT && 801 + evt->iu.srp.login_req.opcode != SRP_LOGIN_REQ) 811 802 evt->done(evt); 812 803 free_event_struct(&evt->hostdata->pool, evt); 813 804 spin_lock_irqsave(hostdata->host->host_lock, flags);
+10 -3
drivers/scsi/pm8001/pm8001_init.c
··· 677 677 * pm8001_get_phy_settings_info : Read phy setting values. 678 678 * @pm8001_ha : our hba. 679 679 */ 680 - void pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha) 680 + static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha) 681 681 { 682 682 683 683 #ifdef PM8001_READ_VPD ··· 691 691 payload.offset = 0; 692 692 payload.length = 4096; 693 693 payload.func_specific = kzalloc(4096, GFP_KERNEL); 694 + if (!payload.func_specific) 695 + return -ENOMEM; 694 696 /* Read phy setting values from flash */ 695 697 PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload); 696 698 wait_for_completion(&completion); 697 699 pm8001_set_phy_profile(pm8001_ha, sizeof(u8), payload.func_specific); 700 + kfree(payload.func_specific); 698 701 #endif 702 + return 0; 699 703 } 700 704 701 705 #ifdef PM8001_USE_MSIX ··· 883 879 pm8001_init_sas_add(pm8001_ha); 884 880 /* phy setting support for motherboard controller */ 885 881 if (pdev->subsystem_vendor != PCI_VENDOR_ID_ADAPTEC2 && 886 - pdev->subsystem_vendor != 0) 887 - pm8001_get_phy_settings_info(pm8001_ha); 882 + pdev->subsystem_vendor != 0) { 883 + rc = pm8001_get_phy_settings_info(pm8001_ha); 884 + if (rc) 885 + goto err_out_shost; 886 + } 888 887 pm8001_post_sas_ha_init(shost, chip); 889 888 rc = sas_register_ha(SHOST_TO_SAS_HA(shost)); 890 889 if (rc)
+11 -6
drivers/scsi/qla2xxx/qla_target.c
··· 1128 1128 ctio->u.status1.flags = 1129 1129 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 1130 1130 CTIO7_FLAGS_TERMINATE); 1131 - ctio->u.status1.ox_id = entry->fcp_hdr_le.ox_id; 1131 + ctio->u.status1.ox_id = cpu_to_le16(entry->fcp_hdr_le.ox_id); 1132 1132 1133 1133 qla2x00_start_iocbs(vha, vha->req); 1134 1134 ··· 1262 1262 { 1263 1263 struct atio_from_isp *atio = &mcmd->orig_iocb.atio; 1264 1264 struct ctio7_to_24xx *ctio; 1265 + uint16_t temp; 1265 1266 1266 1267 ql_dbg(ql_dbg_tgt, ha, 0xe008, 1267 1268 "Sending task mgmt CTIO7 (ha=%p, atio=%p, resp_code=%x\n", ··· 1293 1292 ctio->u.status1.flags = (atio->u.isp24.attr << 9) | 1294 1293 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 1295 1294 CTIO7_FLAGS_SEND_STATUS); 1296 - ctio->u.status1.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 1295 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 1296 + ctio->u.status1.ox_id = cpu_to_le16(temp); 1297 1297 ctio->u.status1.scsi_status = 1298 1298 __constant_cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID); 1299 1299 ctio->u.status1.response_len = __constant_cpu_to_le16(8); ··· 1515 1513 struct ctio7_to_24xx *pkt; 1516 1514 struct qla_hw_data *ha = vha->hw; 1517 1515 struct atio_from_isp *atio = &prm->cmd->atio; 1516 + uint16_t temp; 1518 1517 1519 1518 pkt = (struct ctio7_to_24xx *)vha->req->ring_ptr; 1520 1519 prm->pkt = pkt; ··· 1544 1541 pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0]; 1545 1542 pkt->exchange_addr = atio->u.isp24.exchange_addr; 1546 1543 pkt->u.status0.flags |= (atio->u.isp24.attr << 9); 1547 - pkt->u.status0.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 1544 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 1545 + pkt->u.status0.ox_id = cpu_to_le16(temp); 1548 1546 pkt->u.status0.relative_offset = cpu_to_le32(prm->cmd->offset); 1549 1547 1550 1548 ql_dbg(ql_dbg_tgt, vha, 0xe00c, 1551 1549 "qla_target(%d): handle(cmd) -> %08x, timeout %d, ox_id %#x\n", 1552 - vha->vp_idx, pkt->handle, QLA_TGT_TIMEOUT, 1553 - le16_to_cpu(pkt->u.status0.ox_id)); 1550 + vha->vp_idx, pkt->handle, QLA_TGT_TIMEOUT, temp); 1554 1551 return 0; 1555 1552 } 1556 1553 ··· 2622 2619 struct qla_hw_data *ha = vha->hw; 2623 2620 request_t *pkt; 2624 2621 int ret = 0; 2622 + uint16_t temp; 2625 2623 2626 2624 ql_dbg(ql_dbg_tgt, vha, 0xe01c, "Sending TERM EXCH CTIO (ha=%p)\n", ha); 2627 2625 ··· 2659 2655 ctio24->u.status1.flags = (atio->u.isp24.attr << 9) | 2660 2656 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 2661 2657 CTIO7_FLAGS_TERMINATE); 2662 - ctio24->u.status1.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 2658 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 2659 + ctio24->u.status1.ox_id = cpu_to_le16(temp); 2663 2660 2664 2661 /* Most likely, it isn't needed */ 2665 2662 ctio24->u.status1.residual = get_unaligned((uint32_t *)
+2 -2
drivers/scsi/qla2xxx/qla_target.h
··· 443 443 uint16_t reserved1; 444 444 __le16 flags; 445 445 uint32_t residual; 446 - uint16_t ox_id; 446 + __le16 ox_id; 447 447 uint16_t scsi_status; 448 448 uint32_t relative_offset; 449 449 uint32_t reserved2; ··· 458 458 uint16_t sense_length; 459 459 uint16_t flags; 460 460 uint32_t residual; 461 - uint16_t ox_id; 461 + __le16 ox_id; 462 462 uint16_t scsi_status; 463 463 uint16_t response_len; 464 464 uint16_t reserved;
+10 -10
drivers/scsi/scsi_error.c
··· 131 131 "aborting command %p\n", scmd)); 132 132 rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd); 133 133 if (rtn == SUCCESS) { 134 - scmd->result |= DID_TIME_OUT << 16; 134 + set_host_byte(scmd, DID_TIME_OUT); 135 135 if (scsi_host_eh_past_deadline(sdev->host)) { 136 136 SCSI_LOG_ERROR_RECOVERY(3, 137 137 scmd_printk(KERN_INFO, scmd, ··· 167 167 scmd_printk(KERN_WARNING, scmd, 168 168 "scmd %p terminate " 169 169 "aborted command\n", scmd)); 170 - scmd->result |= DID_TIME_OUT << 16; 170 + set_host_byte(scmd, DID_TIME_OUT); 171 171 scsi_finish_command(scmd); 172 172 } 173 173 } ··· 287 287 else if (host->hostt->eh_timed_out) 288 288 rtn = host->hostt->eh_timed_out(scmd); 289 289 290 - if (rtn == BLK_EH_NOT_HANDLED && !host->hostt->no_async_abort) 291 - if (scsi_abort_command(scmd) == SUCCESS) 290 + if (rtn == BLK_EH_NOT_HANDLED) { 291 + if (!host->hostt->no_async_abort && 292 + scsi_abort_command(scmd) == SUCCESS) 292 293 return BLK_EH_NOT_HANDLED; 293 294 294 - scmd->result |= DID_TIME_OUT << 16; 295 - 296 - if (unlikely(rtn == BLK_EH_NOT_HANDLED && 297 - !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) 298 - rtn = BLK_EH_HANDLED; 295 + set_host_byte(scmd, DID_TIME_OUT); 296 + if (!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD)) 297 + rtn = BLK_EH_HANDLED; 298 + } 299 299 300 300 return rtn; 301 301 } ··· 1777 1777 break; 1778 1778 case DID_ABORT: 1779 1779 if (scmd->eh_eflags & SCSI_EH_ABORT_SCHEDULED) { 1780 - scmd->result |= DID_TIME_OUT << 16; 1780 + set_host_byte(scmd, DID_TIME_OUT); 1781 1781 return SUCCESS; 1782 1782 } 1783 1783 case DID_NO_CONNECT:
+1
drivers/scsi/scsi_transport_fc.c
··· 2549 2549 fc_flush_devloss(shost); 2550 2550 if (!cancel_delayed_work(&rport->dev_loss_work)) 2551 2551 fc_flush_devloss(shost); 2552 + cancel_work_sync(&rport->scan_work); 2552 2553 spin_lock_irqsave(shost->host_lock, flags); 2553 2554 rport->flags &= ~FC_RPORT_DEVLOSS_PENDING; 2554 2555 }
+4 -1
drivers/scsi/sd.c
··· 2441 2441 } 2442 2442 2443 2443 sdkp->DPOFUA = (data.device_specific & 0x10) != 0; 2444 - if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) { 2444 + if (sdp->broken_fua) { 2445 + sd_first_printk(KERN_NOTICE, sdkp, "Disabling FUA\n"); 2446 + sdkp->DPOFUA = 0; 2447 + } else if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) { 2445 2448 sd_first_printk(KERN_NOTICE, sdkp, 2446 2449 "Uses READ/WRITE(6), disabling FUA\n"); 2447 2450 sdkp->DPOFUA = 0;
+25 -1
drivers/scsi/virtio_scsi.c
··· 237 237 virtscsi_vq_done(vscsi, req_vq, virtscsi_complete_cmd); 238 238 }; 239 239 240 + static void virtscsi_poll_requests(struct virtio_scsi *vscsi) 241 + { 242 + int i, num_vqs; 243 + 244 + num_vqs = vscsi->num_queues; 245 + for (i = 0; i < num_vqs; i++) 246 + virtscsi_vq_done(vscsi, &vscsi->req_vqs[i], 247 + virtscsi_complete_cmd); 248 + } 249 + 240 250 static void virtscsi_complete_free(struct virtio_scsi *vscsi, void *buf) 241 251 { 242 252 struct virtio_scsi_cmd *cmd = buf; ··· 263 253 virtscsi_vq_done(vscsi, &vscsi->ctrl_vq, virtscsi_complete_free); 264 254 }; 265 255 256 + static void virtscsi_handle_event(struct work_struct *work); 257 + 266 258 static int virtscsi_kick_event(struct virtio_scsi *vscsi, 267 259 struct virtio_scsi_event_node *event_node) 268 260 { ··· 272 260 struct scatterlist sg; 273 261 unsigned long flags; 274 262 263 + INIT_WORK(&event_node->work, virtscsi_handle_event); 275 264 sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); 276 265 277 266 spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags); ··· 390 377 { 391 378 struct virtio_scsi_event_node *event_node = buf; 392 379 393 - INIT_WORK(&event_node->work, virtscsi_handle_event); 394 380 schedule_work(&event_node->work); 395 381 } 396 382 ··· 600 588 if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK || 601 589 cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) 602 590 ret = SUCCESS; 591 + 592 + /* 593 + * The spec guarantees that all requests related to the TMF have 594 + * been completed, but the callback might not have run yet if 595 + * we're using independent interrupts (e.g. MSI). Poll the 596 + * virtqueues once. 597 + * 598 + * In the abort case, sc->scsi_done will do nothing, because 599 + * the block layer must have detected a timeout and as a result 600 + * REQ_ATOM_COMPLETE has been set. 601 + */ 602 + virtscsi_poll_requests(vscsi); 603 603 604 604 out: 605 605 mempool_free(cmd, virtscsi_cmd_pool);
+2 -2
drivers/staging/iio/adc/ad7291.c
··· 465 465 struct ad7291_platform_data *pdata = client->dev.platform_data; 466 466 struct ad7291_chip_info *chip; 467 467 struct iio_dev *indio_dev; 468 - int ret = 0; 468 + int ret; 469 469 470 470 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); 471 471 if (!indio_dev) ··· 475 475 if (pdata && pdata->use_external_ref) { 476 476 chip->reg = devm_regulator_get(&client->dev, "vref"); 477 477 if (IS_ERR(chip->reg)) 478 - return ret; 478 + return PTR_ERR(chip->reg); 479 479 480 480 ret = regulator_enable(chip->reg); 481 481 if (ret)
+4 -2
drivers/staging/tidspbridge/core/tiomap3430.c
··· 280 280 OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL); 281 281 282 282 /* Wait until the state has moved to ON */ 283 - while (*pdata->dsp_prm_read(OMAP3430_IVA2_MOD, OMAP2_PM_PWSTST)& 284 - OMAP_INTRANSITION_MASK); 283 + while ((*pdata->dsp_prm_read)(OMAP3430_IVA2_MOD, 284 + OMAP2_PM_PWSTST) & 285 + OMAP_INTRANSITION_MASK) 286 + ; 285 287 /* Disable Automatic transition */ 286 288 (*pdata->dsp_cm_write)(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, 287 289 OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
+7
drivers/usb/chipidea/udc.c
··· 1321 1321 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); 1322 1322 struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req); 1323 1323 unsigned long flags; 1324 + struct td_node *node, *tmpnode; 1324 1325 1325 1326 if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY || 1326 1327 hwep->ep.desc == NULL || list_empty(&hwreq->queue) || ··· 1331 1330 spin_lock_irqsave(hwep->lock, flags); 1332 1331 1333 1332 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); 1333 + 1334 + list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { 1335 + dma_pool_free(hwep->td_pool, node->ptr, node->dma); 1336 + list_del(&node->td); 1337 + kfree(node); 1338 + } 1334 1339 1335 1340 /* pop request */ 1336 1341 list_del_init(&hwreq->queue);
+1
drivers/usb/dwc3/Kconfig
··· 45 45 config USB_DWC3_OMAP 46 46 tristate "Texas Instruments OMAP5 and similar Platforms" 47 47 depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST) 48 + depends on OF 48 49 default USB_DWC3 49 50 help 50 51 Some platforms from Texas Instruments like OMAP5, DRA7xxx and
+14 -3
drivers/usb/dwc3/dwc3-omap.c
··· 322 322 { 323 323 struct platform_device *pdev = to_platform_device(dev); 324 324 325 - platform_device_unregister(pdev); 325 + of_device_unregister(pdev); 326 326 327 327 return 0; 328 328 } ··· 599 599 { 600 600 struct dwc3_omap *omap = dev_get_drvdata(dev); 601 601 602 - dwc3_omap_disable_irqs(omap); 602 + dwc3_omap_write_irqmisc_set(omap, 0x00); 603 603 604 604 return 0; 605 605 } ··· 607 607 static void dwc3_omap_complete(struct device *dev) 608 608 { 609 609 struct dwc3_omap *omap = dev_get_drvdata(dev); 610 + u32 reg; 610 611 611 - dwc3_omap_enable_irqs(omap); 612 + reg = (USBOTGSS_IRQMISC_OEVT | 613 + USBOTGSS_IRQMISC_DRVVBUS_RISE | 614 + USBOTGSS_IRQMISC_CHRGVBUS_RISE | 615 + USBOTGSS_IRQMISC_DISCHRGVBUS_RISE | 616 + USBOTGSS_IRQMISC_IDPULLUP_RISE | 617 + USBOTGSS_IRQMISC_DRVVBUS_FALL | 618 + USBOTGSS_IRQMISC_CHRGVBUS_FALL | 619 + USBOTGSS_IRQMISC_DISCHRGVBUS_FALL | 620 + USBOTGSS_IRQMISC_IDPULLUP_FALL); 621 + 622 + dwc3_omap_write_irqmisc_set(omap, reg); 612 623 } 613 624 614 625 static int dwc3_omap_suspend(struct device *dev)
+4 -4
drivers/usb/dwc3/gadget.c
··· 828 828 length, last ? " last" : "", 829 829 chain ? " chain" : ""); 830 830 831 - /* Skip the LINK-TRB on ISOC */ 832 - if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) && 833 - usb_endpoint_xfer_isoc(dep->endpoint.desc)) 834 - dep->free_slot++; 835 831 836 832 trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK]; 837 833 ··· 839 843 } 840 844 841 845 dep->free_slot++; 846 + /* Skip the LINK-TRB on ISOC */ 847 + if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) && 848 + usb_endpoint_xfer_isoc(dep->endpoint.desc)) 849 + dep->free_slot++; 842 850 843 851 trb->size = DWC3_TRB_SIZE_LENGTH(length); 844 852 trb->bpl = lower_32_bits(dma);
+19 -18
drivers/usb/gadget/configfs.c
··· 1145 1145 .store_attribute = usb_os_desc_attr_store, 1146 1146 }; 1147 1147 1148 - static ssize_t rndis_grp_compatible_id_show(struct usb_os_desc *desc, 1149 - char *page) 1148 + static ssize_t interf_grp_compatible_id_show(struct usb_os_desc *desc, 1149 + char *page) 1150 1150 { 1151 1151 memcpy(page, desc->ext_compat_id, 8); 1152 1152 return 8; 1153 1153 } 1154 1154 1155 - static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc, 1156 - const char *page, size_t len) 1155 + static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc, 1156 + const char *page, size_t len) 1157 1157 { 1158 1158 int l; 1159 1159 ··· 1171 1171 return len; 1172 1172 } 1173 1173 1174 - static struct usb_os_desc_attribute rndis_grp_attr_compatible_id = 1174 + static struct usb_os_desc_attribute interf_grp_attr_compatible_id = 1175 1175 __CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR, 1176 - rndis_grp_compatible_id_show, 1177 - rndis_grp_compatible_id_store); 1176 + interf_grp_compatible_id_show, 1177 + interf_grp_compatible_id_store); 1178 1178 1179 - static ssize_t rndis_grp_sub_compatible_id_show(struct usb_os_desc *desc, 1180 - char *page) 1179 + static ssize_t interf_grp_sub_compatible_id_show(struct usb_os_desc *desc, 1180 + char *page) 1181 1181 { 1182 1182 memcpy(page, desc->ext_compat_id + 8, 8); 1183 1183 return 8; 1184 1184 } 1185 1185 1186 - static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc, 1187 - const char *page, size_t len) 1186 + static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc, 1187 + const char *page, size_t len) 1188 1188 { 1189 1189 int l; 1190 1190 ··· 1202 1202 return len; 1203 1203 } 1204 1204 1205 - static struct usb_os_desc_attribute rndis_grp_attr_sub_compatible_id = 1205 + static struct usb_os_desc_attribute interf_grp_attr_sub_compatible_id = 1206 1206 __CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR, 1207 - rndis_grp_sub_compatible_id_show, 1208 - rndis_grp_sub_compatible_id_store); 1207 + interf_grp_sub_compatible_id_show, 1208 + interf_grp_sub_compatible_id_store); 1209 1209 1210 1210 static struct configfs_attribute *interf_grp_attrs[] = { 1211 - &rndis_grp_attr_compatible_id.attr, 1212 - &rndis_grp_attr_sub_compatible_id.attr, 1211 + &interf_grp_attr_compatible_id.attr, 1212 + &interf_grp_attr_sub_compatible_id.attr, 1213 1213 NULL 1214 1214 }; 1215 1215 1216 1216 int usb_os_desc_prepare_interf_dir(struct config_group *parent, 1217 1217 int n_interf, 1218 1218 struct usb_os_desc **desc, 1219 + char **names, 1219 1220 struct module *owner) 1220 1221 { 1221 1222 struct config_group **f_default_groups, *os_desc_group, ··· 1258 1257 d = desc[n_interf]; 1259 1258 d->owner = owner; 1260 1259 config_group_init_type_name(&d->group, "", interface_type); 1261 - config_item_set_name(&d->group.cg_item, "interface.%d", 1262 - n_interf); 1260 + config_item_set_name(&d->group.cg_item, "interface.%s", 1261 + names[n_interf]); 1263 1262 interface_groups[n_interf] = &d->group; 1264 1263 } 1265 1264
+1
drivers/usb/gadget/configfs.h
··· 8 8 int usb_os_desc_prepare_interf_dir(struct config_group *parent, 9 9 int n_interf, 10 10 struct usb_os_desc **desc, 11 + char **names, 11 12 struct module *owner); 12 13 13 14 static inline struct usb_os_desc *to_usb_os_desc(struct config_item *item)
+7 -5
drivers/usb/gadget/f_fs.c
··· 1483 1483 ffs->ep0req->context = ffs; 1484 1484 1485 1485 lang = ffs->stringtabs; 1486 - for (lang = ffs->stringtabs; *lang; ++lang) { 1487 - struct usb_string *str = (*lang)->strings; 1488 - int id = first_id; 1489 - for (; str->s; ++id, ++str) 1490 - str->id = id; 1486 + if (lang) { 1487 + for (; *lang; ++lang) { 1488 + struct usb_string *str = (*lang)->strings; 1489 + int id = first_id; 1490 + for (; str->s; ++id, ++str) 1491 + str->id = id; 1492 + } 1491 1493 } 1492 1494 1493 1495 ffs->gadget = cdev->gadget;
+4 -2
drivers/usb/gadget/f_rndis.c
··· 687 687 f->os_desc_table = kzalloc(sizeof(*f->os_desc_table), 688 688 GFP_KERNEL); 689 689 if (!f->os_desc_table) 690 - return PTR_ERR(f->os_desc_table); 690 + return -ENOMEM; 691 691 f->os_desc_n = 1; 692 692 f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc; 693 693 } ··· 905 905 { 906 906 struct f_rndis_opts *opts; 907 907 struct usb_os_desc *descs[1]; 908 + char *names[1]; 908 909 909 910 opts = kzalloc(sizeof(*opts), GFP_KERNEL); 910 911 if (!opts) ··· 923 922 INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop); 924 923 925 924 descs[0] = &opts->rndis_os_desc; 925 + names[0] = "rndis"; 926 926 usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs, 927 - THIS_MODULE); 927 + names, THIS_MODULE); 928 928 config_group_init_type_name(&opts->func_inst.group, "", 929 929 &rndis_func_type); 930 930
+3 -2
drivers/usb/gadget/gr_udc.c
··· 1532 1532 "%s mode: multiple trans./microframe not valid\n", 1533 1533 (mode == 2 ? "Bulk" : "Control")); 1534 1534 return -EINVAL; 1535 - } else if (nt == 0x11) { 1536 - dev_err(dev->dev, "Invalid value for trans./microframe\n"); 1535 + } else if (nt == 0x3) { 1536 + dev_err(dev->dev, 1537 + "Invalid value 0x3 for additional trans./microframe\n"); 1537 1538 return -EINVAL; 1538 1539 } else if ((nt + 1) * max > buffer_size) { 1539 1540 dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n",
+6 -1
drivers/usb/gadget/inode.c
··· 1264 1264 1265 1265 kfree (dev->buf); 1266 1266 dev->buf = NULL; 1267 - put_dev (dev); 1268 1267 1268 + /* other endpoints were all decoupled from this device */ 1269 + spin_lock_irq(&dev->lock); 1270 + dev->state = STATE_DEV_DISABLED; 1271 + spin_unlock_irq(&dev->lock); 1272 + 1273 + put_dev (dev); 1269 1274 return 0; 1270 1275 } 1271 1276
+3
drivers/usb/gadget/u_ether.c
··· 1120 1120 1121 1121 DBG(dev, "%s\n", __func__); 1122 1122 1123 + netif_tx_lock(dev->net); 1123 1124 netif_stop_queue(dev->net); 1125 + netif_tx_unlock(dev->net); 1126 + 1124 1127 netif_carrier_off(dev->net); 1125 1128 1126 1129 /* disable endpoints, forcing (synchronous) completion
+1 -1
drivers/usb/host/Kconfig
··· 176 176 177 177 config USB_EHCI_MSM 178 178 tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller" 179 - depends on ARCH_MSM 179 + depends on ARCH_MSM || ARCH_QCOM 180 180 select USB_EHCI_ROOT_HUB_TT 181 181 ---help--- 182 182 Enables support for the USB Host controller present on the
+4 -1
drivers/usb/host/xhci-hub.c
··· 22 22 23 23 24 24 #include <linux/slab.h> 25 + #include <linux/device.h> 25 26 #include <asm/unaligned.h> 26 27 27 28 #include "xhci.h" ··· 1140 1139 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME 1141 1140 * is enabled, so also enable remote wake here. 1142 1141 */ 1143 - if (hcd->self.root_hub->do_remote_wakeup) { 1142 + if (hcd->self.root_hub->do_remote_wakeup 1143 + && device_may_wakeup(hcd->self.controller)) { 1144 + 1144 1145 if (t1 & PORT_CONNECT) { 1145 1146 t2 |= PORT_WKOC_E | PORT_WKDISC_E; 1146 1147 t2 &= ~PORT_WKCONN_E;
+6 -3
drivers/usb/host/xhci-ring.c
··· 1433 1433 xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); 1434 1434 break; 1435 1435 case TRB_RESET_DEV: 1436 - WARN_ON(slot_id != TRB_TO_SLOT_ID( 1437 - le32_to_cpu(cmd_trb->generic.field[3]))); 1436 + /* SLOT_ID field in reset device cmd completion event TRB is 0. 1437 + * Use the SLOT_ID from the command TRB instead (xhci 4.6.11) 1438 + */ 1439 + slot_id = TRB_TO_SLOT_ID( 1440 + le32_to_cpu(cmd_trb->generic.field[3])); 1438 1441 xhci_handle_cmd_reset_dev(xhci, slot_id, event); 1439 1442 break; 1440 1443 case TRB_NEC_GET_FW: ··· 3537 3534 return 0; 3538 3535 3539 3536 max_burst = urb->ep->ss_ep_comp.bMaxBurst; 3540 - return roundup(total_packet_count, max_burst + 1) - 1; 3537 + return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1; 3541 3538 } 3542 3539 3543 3540 /*
+7 -3
drivers/usb/host/xhci.c
··· 936 936 */ 937 937 int xhci_resume(struct xhci_hcd *xhci, bool hibernated) 938 938 { 939 - u32 command, temp = 0; 939 + u32 command, temp = 0, status; 940 940 struct usb_hcd *hcd = xhci_to_hcd(xhci); 941 941 struct usb_hcd *secondary_hcd; 942 942 int retval = 0; ··· 1054 1054 1055 1055 done: 1056 1056 if (retval == 0) { 1057 - usb_hcd_resume_root_hub(hcd); 1058 - usb_hcd_resume_root_hub(xhci->shared_hcd); 1057 + /* Resume root hubs only when have pending events. */ 1058 + status = readl(&xhci->op_regs->status); 1059 + if (status & STS_EINT) { 1060 + usb_hcd_resume_root_hub(hcd); 1061 + usb_hcd_resume_root_hub(xhci->shared_hcd); 1062 + } 1059 1063 } 1060 1064 1061 1065 /*
+6 -17
drivers/usb/musb/musb_am335x.c
··· 19 19 return ret; 20 20 } 21 21 22 - static int of_remove_populated_child(struct device *dev, void *d) 23 - { 24 - struct platform_device *pdev = to_platform_device(dev); 25 - 26 - of_device_unregister(pdev); 27 - return 0; 28 - } 29 - 30 - static int am335x_child_remove(struct platform_device *pdev) 31 - { 32 - device_for_each_child(&pdev->dev, NULL, of_remove_populated_child); 33 - pm_runtime_disable(&pdev->dev); 34 - return 0; 35 - } 36 - 37 22 static const struct of_device_id am335x_child_of_match[] = { 38 23 { .compatible = "ti,am33xx-usb" }, 39 24 { }, ··· 27 42 28 43 static struct platform_driver am335x_child_driver = { 29 44 .probe = am335x_child_probe, 30 - .remove = am335x_child_remove, 31 45 .driver = { 32 46 .name = "am335x-usb-childs", 33 47 .of_match_table = am335x_child_of_match, 34 48 }, 35 49 }; 36 50 37 - module_platform_driver(am335x_child_driver); 51 + static int __init am335x_child_init(void) 52 + { 53 + return platform_driver_register(&am335x_child_driver); 54 + } 55 + module_init(am335x_child_init); 56 + 38 57 MODULE_DESCRIPTION("AM33xx child devices"); 39 58 MODULE_LICENSE("GPL v2");
+1 -1
drivers/usb/musb/musb_core.c
··· 849 849 } 850 850 851 851 /* handle babble condition */ 852 - if (int_usb & MUSB_INTR_BABBLE) 852 + if (int_usb & MUSB_INTR_BABBLE && is_host_active(musb)) 853 853 schedule_work(&musb->recover_work); 854 854 855 855 #if 0
+1 -1
drivers/usb/musb/musb_cppi41.c
··· 318 318 } 319 319 list_add_tail(&cppi41_channel->tx_check, 320 320 &controller->early_tx_list); 321 - if (!hrtimer_active(&controller->early_tx)) { 321 + if (!hrtimer_is_queued(&controller->early_tx)) { 322 322 hrtimer_start_range_ns(&controller->early_tx, 323 323 ktime_set(0, 140 * NSEC_PER_USEC), 324 324 40 * NSEC_PER_USEC,
+4 -5
drivers/usb/musb/musb_dsps.c
··· 494 494 struct dsps_glue *glue = dev_get_drvdata(dev->parent); 495 495 const struct dsps_musb_wrapper *wrp = glue->wrp; 496 496 void __iomem *ctrl_base = musb->ctrl_base; 497 - void __iomem *base = musb->mregs; 498 497 u32 reg; 499 498 500 - reg = dsps_readl(base, wrp->mode); 499 + reg = dsps_readl(ctrl_base, wrp->mode); 501 500 502 501 switch (mode) { 503 502 case MUSB_HOST: ··· 509 510 */ 510 511 reg |= (1 << wrp->iddig_mux); 511 512 512 - dsps_writel(base, wrp->mode, reg); 513 + dsps_writel(ctrl_base, wrp->mode, reg); 513 514 dsps_writel(ctrl_base, wrp->phy_utmi, 0x02); 514 515 break; 515 516 case MUSB_PERIPHERAL: ··· 522 523 */ 523 524 reg |= (1 << wrp->iddig_mux); 524 525 525 - dsps_writel(base, wrp->mode, reg); 526 + dsps_writel(ctrl_base, wrp->mode, reg); 526 527 break; 527 528 case MUSB_OTG: 528 - dsps_writel(base, wrp->phy_utmi, 0x02); 529 + dsps_writel(ctrl_base, wrp->phy_utmi, 0x02); 529 530 break; 530 531 default: 531 532 dev_err(glue->dev, "unsupported mode %d\n", mode);
-1
drivers/usb/musb/ux500.c
··· 274 274 musb->dev.parent = &pdev->dev; 275 275 musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; 276 276 musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; 277 - musb->dev.of_node = pdev->dev.of_node; 278 277 279 278 glue->dev = &pdev->dev; 280 279 glue->musb = musb;
+3 -1
drivers/usb/phy/phy-msm-usb.c
··· 1229 1229 motg->chg_state = USB_CHG_STATE_UNDEFINED; 1230 1230 motg->chg_type = USB_INVALID_CHARGER; 1231 1231 } 1232 - pm_runtime_put_sync(otg->phy->dev); 1232 + 1233 + if (otg->phy->state == OTG_STATE_B_IDLE) 1234 + pm_runtime_put_sync(otg->phy->dev); 1233 1235 break; 1234 1236 case OTG_STATE_B_PERIPHERAL: 1235 1237 dev_dbg(otg->phy->dev, "OTG_STATE_B_PERIPHERAL state\n");
+8
drivers/usb/renesas_usbhs/fifo.c
··· 681 681 usbhs_pipe_number(pipe), 682 682 pkt->length, pkt->actual, *is_done, pkt->zero); 683 683 684 + /* 685 + * Transmission end 686 + */ 687 + if (*is_done) { 688 + if (usbhs_pipe_is_dcp(pipe)) 689 + usbhs_dcp_control_transfer_done(pipe); 690 + } 691 + 684 692 usbhs_fifo_read_busy: 685 693 usbhsf_fifo_unselect(pipe, fifo); 686 694
+5 -2
drivers/usb/serial/ftdi_sio.c
··· 1566 1566 struct usb_device *udev = serial->dev; 1567 1567 1568 1568 struct usb_interface *interface = serial->interface; 1569 - struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; 1569 + struct usb_endpoint_descriptor *ep_desc; 1570 1570 1571 1571 unsigned num_endpoints; 1572 - int i; 1572 + unsigned i; 1573 1573 1574 1574 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1575 1575 dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 1576 + 1577 + if (!num_endpoints) 1578 + return; 1576 1579 1577 1580 /* NOTE: some customers have programmed FT232R/FT245R devices 1578 1581 * with an endpoint size of 0 - not good. In this case, we
+20 -6
drivers/usb/serial/option.c
··· 352 352 /* Zoom */ 353 353 #define ZOOM_PRODUCT_4597 0x9607 354 354 355 + /* SpeedUp SU9800 usb 3g modem */ 356 + #define SPEEDUP_PRODUCT_SU9800 0x9800 357 + 355 358 /* Haier products */ 356 359 #define HAIER_VENDOR_ID 0x201e 357 360 #define HAIER_PRODUCT_CE100 0x2009 ··· 375 372 /* Olivetti products */ 376 373 #define OLIVETTI_VENDOR_ID 0x0b3c 377 374 #define OLIVETTI_PRODUCT_OLICARD100 0xc000 375 + #define OLIVETTI_PRODUCT_OLICARD120 0xc001 376 + #define OLIVETTI_PRODUCT_OLICARD140 0xc002 378 377 #define OLIVETTI_PRODUCT_OLICARD145 0xc003 378 + #define OLIVETTI_PRODUCT_OLICARD155 0xc004 379 379 #define OLIVETTI_PRODUCT_OLICARD200 0xc005 380 + #define OLIVETTI_PRODUCT_OLICARD160 0xc00a 380 381 #define OLIVETTI_PRODUCT_OLICARD500 0xc00b 381 382 382 383 /* Celot products */ ··· 1584 1577 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), 1585 1578 .driver_info = (kernel_ulong_t)&four_g_w14_blacklist 1586 1579 }, 1580 + { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, 1587 1581 { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, 1588 1582 { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, 1589 1583 { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, ··· 1619 1611 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, 1620 1612 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ 1621 1613 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, 1622 - 1623 - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, 1614 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), 1615 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1616 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), 1617 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1618 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD140), 1619 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1624 1620 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, 1621 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD155), 1622 + .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, 1625 1623 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), 1626 - .driver_info = (kernel_ulong_t)&net_intf6_blacklist 1627 - }, 1624 + .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, 1625 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD160), 1626 + .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, 1628 1627 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), 1629 - .driver_info = (kernel_ulong_t)&net_intf4_blacklist 1630 - }, 1628 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1631 1629 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ 1632 1630 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ 1633 1631 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
+4
drivers/usb/storage/scsiglue.c
··· 256 256 if (us->fflags & US_FL_WRITE_CACHE) 257 257 sdev->wce_default_on = 1; 258 258 259 + /* A few buggy USB-ATA bridges don't understand FUA */ 260 + if (us->fflags & US_FL_BROKEN_FUA) 261 + sdev->broken_fua = 1; 262 + 259 263 } else { 260 264 261 265 /* Non-disk-type devices don't need to blacklist any pages
+7
drivers/usb/storage/unusual_devs.h
··· 1936 1936 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1937 1937 US_FL_IGNORE_RESIDUE ), 1938 1938 1939 + /* Reported by Michael Büsch <m@bues.ch> */ 1940 + UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0114, 1941 + "JMicron", 1942 + "USB to ATA/ATAPI Bridge", 1943 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1944 + US_FL_BROKEN_FUA ), 1945 + 1939 1946 /* Reported by Alexandre Oliva <oliva@lsd.ic.unicamp.br> 1940 1947 * JMicron responds to USN and several other SCSI ioctls with a 1941 1948 * residue that causes subsequent I/O requests to fail. */
+2
drivers/video/fbdev/atmel_lcdfb.c
··· 1057 1057 goto put_display_node; 1058 1058 } 1059 1059 1060 + INIT_LIST_HEAD(&pdata->pwr_gpios); 1060 1061 ret = -ENOMEM; 1061 1062 for (i = 0; i < of_gpio_named_count(display_np, "atmel,power-control-gpio"); i++) { 1062 1063 gpio = of_get_named_gpio_flags(display_np, "atmel,power-control-gpio", ··· 1083 1082 dev_err(dev, "set direction output gpio %d failed\n", gpio); 1084 1083 goto put_display_node; 1085 1084 } 1085 + list_add(&og->list, &pdata->pwr_gpios); 1086 1086 } 1087 1087 1088 1088 if (is_gpio_power)
+1 -1
drivers/video/fbdev/bfin_adv7393fb.c
··· 408 408 /* Workaround "PPI Does Not Start Properly In Specific Mode" */ 409 409 if (ANOMALY_05000400) { 410 410 ret = gpio_request_one(P_IDENT(P_PPI0_FS3), GPIOF_OUT_INIT_LOW, 411 - "PPI0_FS3") 411 + "PPI0_FS3"); 412 412 if (ret) { 413 413 dev_err(&client->dev, "PPI0_FS3 GPIO request failed\n"); 414 414 ret = -EBUSY;
+5 -3
drivers/video/fbdev/omap2/dss/omapdss-boot-init.c
··· 121 121 { 122 122 struct dss_conv_node *n = kmalloc(sizeof(struct dss_conv_node), 123 123 GFP_KERNEL); 124 - n->node = node; 125 - n->root = root; 126 - list_add(&n->list, &dss_conv_list); 124 + if (n) { 125 + n->node = node; 126 + n->root = root; 127 + list_add(&n->list, &dss_conv_list); 128 + } 127 129 } 128 130 129 131 static bool __init omapdss_list_contains(const struct device_node *node)
-2
drivers/video/fbdev/vt8500lcdfb.c
··· 474 474 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 475 475 release_mem_region(res->start, resource_size(res)); 476 476 477 - kfree(fbi); 478 - 479 477 return 0; 480 478 } 481 479
+1 -1
fs/autofs4/inode.c
··· 210 210 int pipefd; 211 211 struct autofs_sb_info *sbi; 212 212 struct autofs_info *ino; 213 - int pgrp; 213 + int pgrp = 0; 214 214 bool pgrp_set = false; 215 215 int ret = -EINVAL; 216 216
+1 -1
fs/btrfs/compression.c
··· 821 821 822 822 spin_lock(workspace_lock); 823 823 if (*num_workspace < num_online_cpus()) { 824 - list_add_tail(workspace, idle_workspace); 824 + list_add(workspace, idle_workspace); 825 825 (*num_workspace)++; 826 826 spin_unlock(workspace_lock); 827 827 goto wake;
+5
fs/btrfs/dev-replace.c
··· 36 36 #include "check-integrity.h" 37 37 #include "rcu-string.h" 38 38 #include "dev-replace.h" 39 + #include "sysfs.h" 39 40 40 41 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, 41 42 int scrub_ret); ··· 562 561 if (fs_info->fs_devices->latest_bdev == src_device->bdev) 563 562 fs_info->fs_devices->latest_bdev = tgt_device->bdev; 564 563 list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list); 564 + 565 + /* replace the sysfs entry */ 566 + btrfs_kobj_rm_device(fs_info, src_device); 567 + btrfs_kobj_add_device(fs_info, tgt_device); 565 568 566 569 btrfs_rm_dev_replace_blocked(fs_info); 567 570
+4 -1
fs/btrfs/disk-io.c
··· 369 369 out: 370 370 unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1, 371 371 &cached_state, GFP_NOFS); 372 - btrfs_tree_read_unlock_blocking(eb); 372 + if (need_lock) 373 + btrfs_tree_read_unlock_blocking(eb); 373 374 return ret; 374 375 } 375 376 ··· 2905 2904 if (ret) 2906 2905 goto fail_qgroup; 2907 2906 2907 + mutex_lock(&fs_info->cleaner_mutex); 2908 2908 ret = btrfs_recover_relocation(tree_root); 2909 + mutex_unlock(&fs_info->cleaner_mutex); 2909 2910 if (ret < 0) { 2910 2911 printk(KERN_WARNING 2911 2912 "BTRFS: failed to recover relocation\n");
+1 -4
fs/btrfs/extent-tree.c
··· 5678 5678 struct btrfs_caching_control *next; 5679 5679 struct btrfs_caching_control *caching_ctl; 5680 5680 struct btrfs_block_group_cache *cache; 5681 - struct btrfs_space_info *space_info; 5682 5681 5683 5682 down_write(&fs_info->commit_root_sem); 5684 5683 ··· 5699 5700 fs_info->pinned_extents = &fs_info->freed_extents[0]; 5700 5701 5701 5702 up_write(&fs_info->commit_root_sem); 5702 - 5703 - list_for_each_entry_rcu(space_info, &fs_info->space_info, list) 5704 - percpu_counter_set(&space_info->total_bytes_pinned, 0); 5705 5703 5706 5704 update_global_block_rsv(fs_info); 5707 5705 } ··· 5737 5741 spin_lock(&cache->lock); 5738 5742 cache->pinned -= len; 5739 5743 space_info->bytes_pinned -= len; 5744 + percpu_counter_add(&space_info->total_bytes_pinned, -len); 5740 5745 if (cache->ro) { 5741 5746 space_info->bytes_readonly += len; 5742 5747 readonly = true;
+19 -18
fs/btrfs/ioctl.c
··· 136 136 void btrfs_update_iflags(struct inode *inode) 137 137 { 138 138 struct btrfs_inode *ip = BTRFS_I(inode); 139 - 140 - inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC); 139 + unsigned int new_fl = 0; 141 140 142 141 if (ip->flags & BTRFS_INODE_SYNC) 143 - inode->i_flags |= S_SYNC; 142 + new_fl |= S_SYNC; 144 143 if (ip->flags & BTRFS_INODE_IMMUTABLE) 145 - inode->i_flags |= S_IMMUTABLE; 144 + new_fl |= S_IMMUTABLE; 146 145 if (ip->flags & BTRFS_INODE_APPEND) 147 - inode->i_flags |= S_APPEND; 146 + new_fl |= S_APPEND; 148 147 if (ip->flags & BTRFS_INODE_NOATIME) 149 - inode->i_flags |= S_NOATIME; 148 + new_fl |= S_NOATIME; 150 149 if (ip->flags & BTRFS_INODE_DIRSYNC) 151 - inode->i_flags |= S_DIRSYNC; 150 + new_fl |= S_DIRSYNC; 151 + 152 + set_mask_bits(&inode->i_flags, 153 + S_SYNC | S_APPEND | S_IMMUTABLE | S_NOATIME | S_DIRSYNC, 154 + new_fl); 152 155 } 153 156 154 157 /* ··· 3142 3139 static void clone_update_extent_map(struct inode *inode, 3143 3140 const struct btrfs_trans_handle *trans, 3144 3141 const struct btrfs_path *path, 3145 - struct btrfs_file_extent_item *fi, 3146 3142 const u64 hole_offset, 3147 3143 const u64 hole_len) 3148 3144 { ··· 3156 3154 return; 3157 3155 } 3158 3156 3159 - if (fi) { 3157 + if (path) { 3158 + struct btrfs_file_extent_item *fi; 3159 + 3160 + fi = btrfs_item_ptr(path->nodes[0], path->slots[0], 3161 + struct btrfs_file_extent_item); 3160 3162 btrfs_extent_item_to_extent_map(inode, path, fi, false, em); 3161 3163 em->generation = -1; 3162 3164 if (btrfs_file_extent_type(path->nodes[0], fi) == ··· 3514 3508 btrfs_item_ptr_offset(leaf, slot), 3515 3509 size); 3516 3510 inode_add_bytes(inode, datal); 3517 - extent = btrfs_item_ptr(leaf, slot, 3518 - struct btrfs_file_extent_item); 3519 3511 } 3520 3512 3521 3513 /* If we have an implicit hole (NO_HOLES feature). */ 3522 3514 if (drop_start < new_key.offset) 3523 3515 clone_update_extent_map(inode, trans, 3524 - path, NULL, drop_start, 3516 + NULL, drop_start, 3525 3517 new_key.offset - drop_start); 3526 3518 3527 - clone_update_extent_map(inode, trans, path, 3528 - extent, 0, 0); 3519 + clone_update_extent_map(inode, trans, path, 0, 0); 3529 3520 3530 3521 btrfs_mark_buffer_dirty(leaf); 3531 3522 btrfs_release_path(path); ··· 3565 3562 btrfs_end_transaction(trans, root); 3566 3563 goto out; 3567 3564 } 3565 + clone_update_extent_map(inode, trans, NULL, last_dest_end, 3566 + destoff + len - last_dest_end); 3568 3567 ret = clone_finish_inode_update(trans, inode, destoff + len, 3569 3568 destoff, olen); 3570 - if (ret) 3571 - goto out; 3572 - clone_update_extent_map(inode, trans, path, NULL, last_dest_end, 3573 - destoff + len - last_dest_end); 3574 3569 } 3575 3570 3576 3571 out:
+5 -4
fs/btrfs/print-tree.c
··· 54 54 btrfs_extent_data_ref_count(eb, ref)); 55 55 } 56 56 57 - static void print_extent_item(struct extent_buffer *eb, int slot) 57 + static void print_extent_item(struct extent_buffer *eb, int slot, int type) 58 58 { 59 59 struct btrfs_extent_item *ei; 60 60 struct btrfs_extent_inline_ref *iref; ··· 63 63 struct btrfs_disk_key key; 64 64 unsigned long end; 65 65 unsigned long ptr; 66 - int type; 67 66 u32 item_size = btrfs_item_size_nr(eb, slot); 68 67 u64 flags; 69 68 u64 offset; ··· 87 88 btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), 88 89 flags); 89 90 90 - if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { 91 + if ((type == BTRFS_EXTENT_ITEM_KEY) && 92 + flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { 91 93 struct btrfs_tree_block_info *info; 92 94 info = (struct btrfs_tree_block_info *)(ei + 1); 93 95 btrfs_tree_block_key(eb, info, &key); ··· 223 223 btrfs_disk_root_refs(l, ri)); 224 224 break; 225 225 case BTRFS_EXTENT_ITEM_KEY: 226 - print_extent_item(l, i); 226 + case BTRFS_METADATA_ITEM_KEY: 227 + print_extent_item(l, i, type); 227 228 break; 228 229 case BTRFS_TREE_BLOCK_REF_KEY: 229 230 printk(KERN_INFO "\t\ttree block backref\n");
+3 -2
fs/btrfs/raid56.c
··· 1956 1956 * pages are going to be uptodate. 1957 1957 */ 1958 1958 for (stripe = 0; stripe < bbio->num_stripes; stripe++) { 1959 - if (rbio->faila == stripe || 1960 - rbio->failb == stripe) 1959 + if (rbio->faila == stripe || rbio->failb == stripe) { 1960 + atomic_inc(&rbio->bbio->error); 1961 1961 continue; 1962 + } 1962 1963 1963 1964 for (pagenr = 0; pagenr < nr_pages; pagenr++) { 1964 1965 struct page *p;
+6 -1
fs/btrfs/super.c
··· 522 522 case Opt_ssd_spread: 523 523 btrfs_set_and_info(root, SSD_SPREAD, 524 524 "use spread ssd allocation scheme"); 525 + btrfs_set_opt(info->mount_opt, SSD); 525 526 break; 526 527 case Opt_nossd: 527 - btrfs_clear_and_info(root, NOSSD, 528 + btrfs_set_and_info(root, NOSSD, 528 529 "not using ssd allocation scheme"); 529 530 btrfs_clear_opt(info->mount_opt, SSD); 530 531 break; ··· 1468 1467 goto restore; 1469 1468 1470 1469 /* recover relocation */ 1470 + mutex_lock(&fs_info->cleaner_mutex); 1471 1471 ret = btrfs_recover_relocation(root); 1472 + mutex_unlock(&fs_info->cleaner_mutex); 1472 1473 if (ret) 1473 1474 goto restore; 1474 1475 ··· 1810 1807 head = &cur_devices->devices; 1811 1808 list_for_each_entry(dev, head, dev_list) { 1812 1809 if (dev->missing) 1810 + continue; 1811 + if (!dev->name) 1813 1812 continue; 1814 1813 if (!first_dev || dev->devid < first_dev->devid) 1815 1814 first_dev = dev;
+29 -3
fs/btrfs/sysfs.c
··· 605 605 } 606 606 } 607 607 608 - static int add_device_membership(struct btrfs_fs_info *fs_info) 608 + int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info, 609 + struct btrfs_device *one_device) 610 + { 611 + struct hd_struct *disk; 612 + struct kobject *disk_kobj; 613 + 614 + if (!fs_info->device_dir_kobj) 615 + return -EINVAL; 616 + 617 + if (one_device) { 618 + disk = one_device->bdev->bd_part; 619 + disk_kobj = &part_to_dev(disk)->kobj; 620 + 621 + sysfs_remove_link(fs_info->device_dir_kobj, 622 + disk_kobj->name); 623 + } 624 + 625 + return 0; 626 + } 627 + 628 + int btrfs_kobj_add_device(struct btrfs_fs_info *fs_info, 629 + struct btrfs_device *one_device) 609 630 { 610 631 int error = 0; 611 632 struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; 612 633 struct btrfs_device *dev; 613 634 614 - fs_info->device_dir_kobj = kobject_create_and_add("devices", 635 + if (!fs_info->device_dir_kobj) 636 + fs_info->device_dir_kobj = kobject_create_and_add("devices", 615 637 &fs_info->super_kobj); 638 + 616 639 if (!fs_info->device_dir_kobj) 617 640 return -ENOMEM; 618 641 ··· 644 621 struct kobject *disk_kobj; 645 622 646 623 if (!dev->bdev) 624 + continue; 625 + 626 + if (one_device && one_device != dev) 647 627 continue; 648 628 649 629 disk = dev->bdev->bd_part; ··· 692 666 if (error) 693 667 goto failure; 694 668 695 - error = add_device_membership(fs_info); 669 + error = btrfs_kobj_add_device(fs_info, NULL); 696 670 if (error) 697 671 goto failure; 698 672
+4
fs/btrfs/sysfs.h
··· 66 66 extern const char * const btrfs_feature_set_names[3]; 67 67 extern struct kobj_type space_info_ktype; 68 68 extern struct kobj_type btrfs_raid_ktype; 69 + int btrfs_kobj_add_device(struct btrfs_fs_info *fs_info, 70 + struct btrfs_device *one_device); 71 + int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info, 72 + struct btrfs_device *one_device); 69 73 #endif /* _BTRFS_SYSFS_H_ */
+5 -7
fs/btrfs/transaction.c
··· 386 386 bool reloc_reserved = false; 387 387 int ret; 388 388 389 + /* Send isn't supposed to start transactions. */ 390 + ASSERT(current->journal_info != (void *)BTRFS_SEND_TRANS_STUB); 391 + 389 392 if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) 390 393 return ERR_PTR(-EROFS); 391 394 392 - if (current->journal_info && 393 - current->journal_info != (void *)BTRFS_SEND_TRANS_STUB) { 395 + if (current->journal_info) { 394 396 WARN_ON(type & TRANS_EXTWRITERS); 395 397 h = current->journal_info; 396 398 h->use_count++; ··· 493 491 smp_mb(); 494 492 if (cur_trans->state >= TRANS_STATE_BLOCKED && 495 493 may_wait_transaction(root, type)) { 494 + current->journal_info = h; 496 495 btrfs_commit_transaction(h, root); 497 496 goto again; 498 497 } ··· 1618 1615 int ret; 1619 1616 1620 1617 ret = btrfs_run_delayed_items(trans, root); 1621 - /* 1622 - * running the delayed items may have added new refs. account 1623 - * them now so that they hinder processing of more delayed refs 1624 - * as little as possible. 1625 - */ 1626 1618 if (ret) 1627 1619 return ret; 1628 1620
+25 -5
fs/btrfs/volumes.c
··· 40 40 #include "rcu-string.h" 41 41 #include "math.h" 42 42 #include "dev-replace.h" 43 + #include "sysfs.h" 43 44 44 45 static int init_first_rw_device(struct btrfs_trans_handle *trans, 45 46 struct btrfs_root *root, ··· 555 554 * This is ok to do without rcu read locked because we hold the 556 555 * uuid mutex so nothing we touch in here is going to disappear. 557 556 */ 558 - name = rcu_string_strdup(orig_dev->name->str, GFP_NOFS); 559 - if (!name) { 560 - kfree(device); 561 - goto error; 557 + if (orig_dev->name) { 558 + name = rcu_string_strdup(orig_dev->name->str, GFP_NOFS); 559 + if (!name) { 560 + kfree(device); 561 + goto error; 562 + } 563 + rcu_assign_pointer(device->name, name); 562 564 } 563 - rcu_assign_pointer(device->name, name); 564 565 565 566 list_add(&device->dev_list, &fs_devices->devices); 566 567 device->fs_devices = fs_devices; ··· 1683 1680 if (device->bdev) 1684 1681 device->fs_devices->open_devices--; 1685 1682 1683 + /* remove sysfs entry */ 1684 + btrfs_kobj_rm_device(root->fs_info, device); 1685 + 1686 1686 call_rcu(&device->rcu, free_device); 1687 1687 1688 1688 num_devices = btrfs_super_num_devices(root->fs_info->super_copy) - 1; ··· 2149 2143 total_bytes = btrfs_super_num_devices(root->fs_info->super_copy); 2150 2144 btrfs_set_super_num_devices(root->fs_info->super_copy, 2151 2145 total_bytes + 1); 2146 + 2147 + /* add sysfs device entry */ 2148 + btrfs_kobj_add_device(root->fs_info, device); 2149 + 2152 2150 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); 2153 2151 2154 2152 if (seeding_dev) { 2153 + char fsid_buf[BTRFS_UUID_UNPARSED_SIZE]; 2155 2154 ret = init_first_rw_device(trans, root, device); 2156 2155 if (ret) { 2157 2156 btrfs_abort_transaction(trans, root, ret); ··· 2167 2156 btrfs_abort_transaction(trans, root, ret); 2168 2157 goto error_trans; 2169 2158 } 2159 + 2160 + /* Sprouting would change fsid of the mounted root, 2161 + * so rename the fsid on the sysfs 2162 + */ 2163 + snprintf(fsid_buf, BTRFS_UUID_UNPARSED_SIZE, "%pU", 2164 + root->fs_info->fsid); 2165 + if (kobject_rename(&root->fs_info->super_kobj, fsid_buf)) 2166 + goto error_trans; 2170 2167 } else { 2171 2168 ret = btrfs_add_device(trans, root, device); 2172 2169 if (ret) { ··· 2224 2205 unlock_chunks(root); 2225 2206 btrfs_end_transaction(trans, root); 2226 2207 rcu_string_free(device->name); 2208 + btrfs_kobj_rm_device(root->fs_info, device); 2227 2209 kfree(device); 2228 2210 error: 2229 2211 blkdev_put(bdev, FMODE_EXCL);
+1 -1
fs/btrfs/zlib.c
··· 136 136 if (workspace->def_strm.total_in > 8192 && 137 137 workspace->def_strm.total_in < 138 138 workspace->def_strm.total_out) { 139 - ret = -EIO; 139 + ret = -E2BIG; 140 140 goto out; 141 141 } 142 142 /* we need another page for writing out. Test this
+16
fs/ext4/balloc.c
··· 194 194 if (!ext4_group_desc_csum_verify(sb, block_group, gdp)) { 195 195 ext4_error(sb, "Checksum bad for group %u", block_group); 196 196 grp = ext4_get_group_info(sb, block_group); 197 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp)) 198 + percpu_counter_sub(&sbi->s_freeclusters_counter, 199 + grp->bb_free); 197 200 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state); 201 + if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { 202 + int count; 203 + count = ext4_free_inodes_count(sb, gdp); 204 + percpu_counter_sub(&sbi->s_freeinodes_counter, 205 + count); 206 + } 198 207 set_bit(EXT4_GROUP_INFO_IBITMAP_CORRUPT_BIT, &grp->bb_state); 199 208 return; 200 209 } ··· 368 359 { 369 360 ext4_fsblk_t blk; 370 361 struct ext4_group_info *grp = ext4_get_group_info(sb, block_group); 362 + struct ext4_sb_info *sbi = EXT4_SB(sb); 371 363 372 364 if (buffer_verified(bh)) 373 365 return; ··· 379 369 ext4_unlock_group(sb, block_group); 380 370 ext4_error(sb, "bg %u: block %llu: invalid block bitmap", 381 371 block_group, blk); 372 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp)) 373 + percpu_counter_sub(&sbi->s_freeclusters_counter, 374 + grp->bb_free); 382 375 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state); 383 376 return; 384 377 } ··· 389 376 desc, bh))) { 390 377 ext4_unlock_group(sb, block_group); 391 378 ext4_error(sb, "bg %u: bad block bitmap checksum", block_group); 379 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp)) 380 + percpu_counter_sub(&sbi->s_freeclusters_counter, 381 + grp->bb_free); 392 382 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state); 393 383 return; 394 384 }
+23
fs/ext4/ialloc.c
··· 71 71 struct ext4_group_desc *gdp) 72 72 { 73 73 struct ext4_group_info *grp; 74 + struct ext4_sb_info *sbi = EXT4_SB(sb); 74 75 J_ASSERT_BH(bh, buffer_locked(bh)); 75 76 76 77 /* If checksum is bad mark all blocks and inodes use to prevent ··· 79 78 if (!ext4_group_desc_csum_verify(sb, block_group, gdp)) { 80 79 ext4_error(sb, "Checksum bad for group %u", block_group); 81 80 grp = ext4_get_group_info(sb, block_group); 81 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp)) 82 + percpu_counter_sub(&sbi->s_freeclusters_counter, 83 + grp->bb_free); 82 84 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state); 85 + if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { 86 + int count; 87 + count = ext4_free_inodes_count(sb, gdp); 88 + percpu_counter_sub(&sbi->s_freeinodes_counter, 89 + count); 90 + } 83 91 set_bit(EXT4_GROUP_INFO_IBITMAP_CORRUPT_BIT, &grp->bb_state); 84 92 return 0; 85 93 } ··· 126 116 struct buffer_head *bh = NULL; 127 117 ext4_fsblk_t bitmap_blk; 128 118 struct ext4_group_info *grp; 119 + struct ext4_sb_info *sbi = EXT4_SB(sb); 129 120 130 121 desc = ext4_get_group_desc(sb, block_group, NULL); 131 122 if (!desc) ··· 196 185 ext4_error(sb, "Corrupt inode bitmap - block_group = %u, " 197 186 "inode_bitmap = %llu", block_group, bitmap_blk); 198 187 grp = ext4_get_group_info(sb, block_group); 188 + if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { 189 + int count; 190 + count = ext4_free_inodes_count(sb, desc); 191 + percpu_counter_sub(&sbi->s_freeinodes_counter, 192 + count); 193 + } 199 194 set_bit(EXT4_GROUP_INFO_IBITMAP_CORRUPT_BIT, &grp->bb_state); 200 195 return NULL; 201 196 } ··· 338 321 fatal = err; 339 322 } else { 340 323 ext4_error(sb, "bit already cleared for inode %lu", ino); 324 + if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { 325 + int count; 326 + count = ext4_free_inodes_count(sb, gdp); 327 + percpu_counter_sub(&sbi->s_freeinodes_counter, 328 + count); 329 + } 341 330 set_bit(EXT4_GROUP_INFO_IBITMAP_CORRUPT_BIT, &grp->bb_state); 342 331 } 343 332
+19 -5
fs/ext4/indirect.c
··· 389 389 return 0; 390 390 failed: 391 391 for (; i >= 0; i--) { 392 - if (i != indirect_blks && branch[i].bh) 392 + /* 393 + * We want to ext4_forget() only freshly allocated indirect 394 + * blocks. Buffer for new_blocks[i-1] is at branch[i].bh and 395 + * buffer at branch[0].bh is indirect block / inode already 396 + * existing before ext4_alloc_branch() was called. 397 + */ 398 + if (i > 0 && i != indirect_blks && branch[i].bh) 393 399 ext4_forget(handle, 1, inode, branch[i].bh, 394 400 branch[i].bh->b_blocknr); 395 401 ext4_free_blocks(handle, inode, NULL, new_blocks[i], ··· 1316 1310 blk = *i_data; 1317 1311 if (level > 0) { 1318 1312 ext4_lblk_t first2; 1313 + ext4_lblk_t count2; 1314 + 1319 1315 bh = sb_bread(inode->i_sb, le32_to_cpu(blk)); 1320 1316 if (!bh) { 1321 1317 EXT4_ERROR_INODE_BLOCK(inode, le32_to_cpu(blk), 1322 1318 "Read failure"); 1323 1319 return -EIO; 1324 1320 } 1325 - first2 = (first > offset) ? first - offset : 0; 1321 + if (first > offset) { 1322 + first2 = first - offset; 1323 + count2 = count; 1324 + } else { 1325 + first2 = 0; 1326 + count2 = count - (offset - first); 1327 + } 1326 1328 ret = free_hole_blocks(handle, inode, bh, 1327 1329 (__le32 *)bh->b_data, level - 1, 1328 - first2, count - offset, 1330 + first2, count2, 1329 1331 inode->i_sb->s_blocksize >> 2); 1330 1332 if (ret) { 1331 1333 brelse(bh); ··· 1343 1329 if (level == 0 || 1344 1330 (bh && all_zeroes((__le32 *)bh->b_data, 1345 1331 (__le32 *)bh->b_data + addr_per_block))) { 1346 - ext4_free_data(handle, inode, parent_bh, &blk, &blk+1); 1347 - *i_data = 0; 1332 + ext4_free_data(handle, inode, parent_bh, 1333 + i_data, i_data + 1); 1348 1334 } 1349 1335 brelse(bh); 1350 1336 bh = NULL;
+8
fs/ext4/mballoc.c
··· 722 722 void *buddy, void *bitmap, ext4_group_t group) 723 723 { 724 724 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 725 + struct ext4_sb_info *sbi = EXT4_SB(sb); 725 726 ext4_grpblk_t max = EXT4_CLUSTERS_PER_GROUP(sb); 726 727 ext4_grpblk_t i = 0; 727 728 ext4_grpblk_t first; ··· 760 759 * corrupt and update bb_free using bitmap value 761 760 */ 762 761 grp->bb_free = free; 762 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp)) 763 + percpu_counter_sub(&sbi->s_freeclusters_counter, 764 + grp->bb_free); 763 765 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state); 764 766 } 765 767 mb_set_largest_free_order(sb, grp); ··· 1435 1431 right_is_free = !mb_test_bit(last + 1, e4b->bd_bitmap); 1436 1432 1437 1433 if (unlikely(block != -1)) { 1434 + struct ext4_sb_info *sbi = EXT4_SB(sb); 1438 1435 ext4_fsblk_t blocknr; 1439 1436 1440 1437 blocknr = ext4_group_first_block_no(sb, e4b->bd_group); ··· 1446 1441 "freeing already freed block " 1447 1442 "(bit %u); block bitmap corrupt.", 1448 1443 block); 1444 + if (!EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)) 1445 + percpu_counter_sub(&sbi->s_freeclusters_counter, 1446 + e4b->bd_info->bb_free); 1449 1447 /* Mark the block group as corrupt. */ 1450 1448 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, 1451 1449 &e4b->bd_info->bb_state);
+55 -14
fs/kernfs/file.c
··· 39 39 struct list_head files; /* goes through kernfs_open_file.list */ 40 40 }; 41 41 42 + /* 43 + * kernfs_notify() may be called from any context and bounces notifications 44 + * through a work item. To minimize space overhead in kernfs_node, the 45 + * pending queue is implemented as a singly linked list of kernfs_nodes. 46 + * The list is terminated with the self pointer so that whether a 47 + * kernfs_node is on the list or not can be determined by testing the next 48 + * pointer for NULL. 49 + */ 50 + #define KERNFS_NOTIFY_EOL ((void *)&kernfs_notify_list) 51 + 52 + static DEFINE_SPINLOCK(kernfs_notify_lock); 53 + static struct kernfs_node *kernfs_notify_list = KERNFS_NOTIFY_EOL; 54 + 42 55 static struct kernfs_open_file *kernfs_of(struct file *file) 43 56 { 44 57 return ((struct seq_file *)file->private_data)->private; ··· 796 783 return DEFAULT_POLLMASK|POLLERR|POLLPRI; 797 784 } 798 785 799 - /** 800 - * kernfs_notify - notify a kernfs file 801 - * @kn: file to notify 802 - * 803 - * Notify @kn such that poll(2) on @kn wakes up. 804 - */ 805 - void kernfs_notify(struct kernfs_node *kn) 786 + static void kernfs_notify_workfn(struct work_struct *work) 806 787 { 807 - struct kernfs_root *root = kernfs_root(kn); 788 + struct kernfs_node *kn; 808 789 struct kernfs_open_node *on; 809 790 struct kernfs_super_info *info; 810 - unsigned long flags; 811 - 812 - if (WARN_ON(kernfs_type(kn) != KERNFS_FILE)) 791 + repeat: 792 + /* pop one off the notify_list */ 793 + spin_lock_irq(&kernfs_notify_lock); 794 + kn = kernfs_notify_list; 795 + if (kn == KERNFS_NOTIFY_EOL) { 796 + spin_unlock_irq(&kernfs_notify_lock); 813 797 return; 798 + } 799 + kernfs_notify_list = kn->attr.notify_next; 800 + kn->attr.notify_next = NULL; 801 + spin_unlock_irq(&kernfs_notify_lock); 814 802 815 803 /* kick poll */ 816 - spin_lock_irqsave(&kernfs_open_node_lock, flags); 804 + spin_lock_irq(&kernfs_open_node_lock); 817 805 818 806 on = kn->attr.open; 819 807 if (on) { ··· 822 808 wake_up_interruptible(&on->poll); 823 809 } 824 810 825 - spin_unlock_irqrestore(&kernfs_open_node_lock, flags); 811 + spin_unlock_irq(&kernfs_open_node_lock); 826 812 827 813 /* kick fsnotify */ 828 814 mutex_lock(&kernfs_mutex); 829 815 830 - list_for_each_entry(info, &root->supers, node) { 816 + list_for_each_entry(info, &kernfs_root(kn)->supers, node) { 831 817 struct inode *inode; 832 818 struct dentry *dentry; 833 819 ··· 847 833 } 848 834 849 835 mutex_unlock(&kernfs_mutex); 836 + kernfs_put(kn); 837 + goto repeat; 838 + } 839 + 840 + /** 841 + * kernfs_notify - notify a kernfs file 842 + * @kn: file to notify 843 + * 844 + * Notify @kn such that poll(2) on @kn wakes up. Maybe be called from any 845 + * context. 846 + */ 847 + void kernfs_notify(struct kernfs_node *kn) 848 + { 849 + static DECLARE_WORK(kernfs_notify_work, kernfs_notify_workfn); 850 + unsigned long flags; 851 + 852 + if (WARN_ON(kernfs_type(kn) != KERNFS_FILE)) 853 + return; 854 + 855 + spin_lock_irqsave(&kernfs_notify_lock, flags); 856 + if (!kn->attr.notify_next) { 857 + kernfs_get(kn); 858 + kn->attr.notify_next = kernfs_notify_list; 859 + kernfs_notify_list = kn; 860 + schedule_work(&kernfs_notify_work); 861 + } 862 + spin_unlock_irqrestore(&kernfs_notify_lock, flags); 850 863 } 851 864 EXPORT_SYMBOL_GPL(kernfs_notify); 852 865
+2 -1
fs/mbcache.c
··· 73 73 #include <linux/mbcache.h> 74 74 #include <linux/init.h> 75 75 #include <linux/blockgroup_lock.h> 76 + #include <linux/log2.h> 76 77 77 78 #ifdef MB_CACHE_DEBUG 78 79 # define mb_debug(f...) do { \ ··· 94 93 95 94 #define MB_CACHE_WRITER ((unsigned short)~0U >> 1) 96 95 97 - #define MB_CACHE_ENTRY_LOCK_BITS __builtin_log2(NR_BG_LOCKS) 96 + #define MB_CACHE_ENTRY_LOCK_BITS ilog2(NR_BG_LOCKS) 98 97 #define MB_CACHE_ENTRY_LOCK_INDEX(ce) \ 99 98 (hash_long((unsigned long)ce, MB_CACHE_ENTRY_LOCK_BITS)) 100 99
-9
fs/nfsd/nfs4proc.c
··· 617 617 618 618 switch (create->cr_type) { 619 619 case NF4LNK: 620 - /* ugh! we have to null-terminate the linktext, or 621 - * vfs_symlink() will choke. it is always safe to 622 - * null-terminate by brute force, since at worst we 623 - * will overwrite the first byte of the create namelen 624 - * in the XDR buffer, which has already been extracted 625 - * during XDR decode. 626 - */ 627 - create->cr_linkname[create->cr_linklen] = 0; 628 - 629 620 status = nfsd_symlink(rqstp, &cstate->current_fh, 630 621 create->cr_name, create->cr_namelen, 631 622 create->cr_linkname, create->cr_linklen,
+13 -2
fs/nfsd/nfs4xdr.c
··· 600 600 READ_BUF(4); 601 601 create->cr_linklen = be32_to_cpup(p++); 602 602 READ_BUF(create->cr_linklen); 603 - SAVEMEM(create->cr_linkname, create->cr_linklen); 603 + /* 604 + * The VFS will want a null-terminated string, and 605 + * null-terminating in place isn't safe since this might 606 + * end on a page boundary: 607 + */ 608 + create->cr_linkname = 609 + kmalloc(create->cr_linklen + 1, GFP_KERNEL); 610 + if (!create->cr_linkname) 611 + return nfserr_jukebox; 612 + memcpy(create->cr_linkname, p, create->cr_linklen); 613 + create->cr_linkname[create->cr_linklen] = '\0'; 614 + defer_free(argp, kfree, create->cr_linkname); 604 615 break; 605 616 case NF4BLK: 606 617 case NF4CHR: ··· 3278 3267 3279 3268 wire_count = htonl(maxcount); 3280 3269 write_bytes_to_xdr_buf(xdr->buf, length_offset, &wire_count, 4); 3281 - xdr_truncate_encode(xdr, length_offset + 4 + maxcount); 3270 + xdr_truncate_encode(xdr, length_offset + 4 + ALIGN(maxcount, 4)); 3282 3271 if (maxcount & 3) 3283 3272 write_bytes_to_xdr_buf(xdr->buf, length_offset + 4 + maxcount, 3284 3273 &zero, 4 - (maxcount&3));
+2 -20
fs/proc/stat.c
··· 184 184 185 185 static int stat_open(struct inode *inode, struct file *file) 186 186 { 187 - size_t size = 1024 + 128 * num_possible_cpus(); 188 - char *buf; 189 - struct seq_file *m; 190 - int res; 187 + size_t size = 1024 + 128 * num_online_cpus(); 191 188 192 189 /* minimum size to display an interrupt count : 2 bytes */ 193 190 size += 2 * nr_irqs; 194 - 195 - /* don't ask for more than the kmalloc() max size */ 196 - if (size > KMALLOC_MAX_SIZE) 197 - size = KMALLOC_MAX_SIZE; 198 - buf = kmalloc(size, GFP_KERNEL); 199 - if (!buf) 200 - return -ENOMEM; 201 - 202 - res = single_open(file, show_stat, NULL); 203 - if (!res) { 204 - m = file->private_data; 205 - m->buf = buf; 206 - m->size = ksize(buf); 207 - } else 208 - kfree(buf); 209 - return res; 191 + return single_open_size(file, show_stat, NULL, size); 210 192 } 211 193 212 194 static const struct file_operations proc_stat_operations = {
+21 -9
fs/seq_file.c
··· 8 8 #include <linux/fs.h> 9 9 #include <linux/export.h> 10 10 #include <linux/seq_file.h> 11 + #include <linux/vmalloc.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/cred.h> 14 + #include <linux/mm.h> 13 15 14 16 #include <asm/uaccess.h> 15 17 #include <asm/page.h> ··· 30 28 static void seq_set_overflow(struct seq_file *m) 31 29 { 32 30 m->count = m->size; 31 + } 32 + 33 + static void *seq_buf_alloc(unsigned long size) 34 + { 35 + void *buf; 36 + 37 + buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); 38 + if (!buf && size > PAGE_SIZE) 39 + buf = vmalloc(size); 40 + return buf; 33 41 } 34 42 35 43 /** ··· 108 96 return 0; 109 97 } 110 98 if (!m->buf) { 111 - m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); 99 + m->buf = seq_buf_alloc(m->size = PAGE_SIZE); 112 100 if (!m->buf) 113 101 return -ENOMEM; 114 102 } ··· 147 135 148 136 Eoverflow: 149 137 m->op->stop(m, p); 150 - kfree(m->buf); 138 + kvfree(m->buf); 151 139 m->count = 0; 152 - m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); 140 + m->buf = seq_buf_alloc(m->size <<= 1); 153 141 return !m->buf ? -ENOMEM : -EAGAIN; 154 142 } 155 143 ··· 204 192 205 193 /* grab buffer if we didn't have one */ 206 194 if (!m->buf) { 207 - m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); 195 + m->buf = seq_buf_alloc(m->size = PAGE_SIZE); 208 196 if (!m->buf) 209 197 goto Enomem; 210 198 } ··· 244 232 if (m->count < m->size) 245 233 goto Fill; 246 234 m->op->stop(m, p); 247 - kfree(m->buf); 235 + kvfree(m->buf); 248 236 m->count = 0; 249 - m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); 237 + m->buf = seq_buf_alloc(m->size <<= 1); 250 238 if (!m->buf) 251 239 goto Enomem; 252 240 m->version = 0; ··· 362 350 int seq_release(struct inode *inode, struct file *file) 363 351 { 364 352 struct seq_file *m = file->private_data; 365 - kfree(m->buf); 353 + kvfree(m->buf); 366 354 kfree(m); 367 355 return 0; 368 356 } ··· 617 605 int single_open_size(struct file *file, int (*show)(struct seq_file *, void *), 618 606 void *data, size_t size) 619 607 { 620 - char *buf = kmalloc(size, GFP_KERNEL); 608 + char *buf = seq_buf_alloc(size); 621 609 int ret; 622 610 if (!buf) 623 611 return -ENOMEM; 624 612 ret = single_open(file, show, data); 625 613 if (ret) { 626 - kfree(buf); 614 + kvfree(buf); 627 615 return ret; 628 616 } 629 617 ((struct seq_file *)file->private_data)->buf = buf;
+1
include/drm/i915_powerwell.h
··· 32 32 /* For use by hda_i915 driver */ 33 33 extern int i915_request_power_well(void); 34 34 extern int i915_release_power_well(void); 35 + extern int i915_get_cdclk_freq(void); 35 36 36 37 #endif /* _I915_POWERWELL_H_ */
+1
include/linux/kernfs.h
··· 91 91 const struct kernfs_ops *ops; 92 92 struct kernfs_open_node *open; 93 93 loff_t size; 94 + struct kernfs_node *notify_next; /* for kernfs_notify() */ 94 95 }; 95 96 96 97 /*
+3
include/linux/ptrace.h
··· 334 334 * calling arch_ptrace_stop() when it would be superfluous. For example, 335 335 * if the thread has not been back to user mode since the last stop, the 336 336 * thread state might indicate that nothing needs to be done. 337 + * 338 + * This is guaranteed to be invoked once before a task stops for ptrace and 339 + * may include arch-specific operations necessary prior to a ptrace stop. 337 340 */ 338 341 #define arch_ptrace_stop_needed(code, info) (0) 339 342 #endif
+3 -1
include/linux/usb_usual.h
··· 70 70 US_FLAG(NEEDS_CAP16, 0x00400000) \ 71 71 /* cannot handle READ_CAPACITY_10 */ \ 72 72 US_FLAG(IGNORE_UAS, 0x00800000) \ 73 - /* Device advertises UAS but it is broken */ 73 + /* Device advertises UAS but it is broken */ \ 74 + US_FLAG(BROKEN_FUA, 0x01000000) \ 75 + /* Cannot handle FUA in WRITE or READ CDBs */ \ 74 76 75 77 #define US_FLAG(name, value) US_FL_##name = value , 76 78 enum { US_DO_ALL_FLAGS };
+1 -1
include/scsi/scsi_cmnd.h
··· 318 318 319 319 static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd) 320 320 { 321 - unsigned int xfer_len = blk_rq_bytes(scmd->request); 321 + unsigned int xfer_len = scsi_out(scmd)->length; 322 322 unsigned int prot_op = scsi_get_prot_op(scmd); 323 323 unsigned int sector_size = scmd->device->sector_size; 324 324
+1
include/scsi/scsi_device.h
··· 173 173 unsigned is_visible:1; /* is the device visible in sysfs */ 174 174 unsigned wce_default_on:1; /* Cache is ON by default */ 175 175 unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ 176 + unsigned broken_fua:1; /* Don't set FUA bit */ 176 177 177 178 atomic_t disk_events_disable_depth; /* disable depth for disk events */ 178 179
+1
include/uapi/linux/btrfs.h
··· 38 38 #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) 39 39 #define BTRFS_FSID_SIZE 16 40 40 #define BTRFS_UUID_SIZE 16 41 + #define BTRFS_UUID_UNPARSED_SIZE 37 41 42 42 43 #define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0) 43 44
+7
include/uapi/linux/usb/functionfs.h
··· 33 33 __u8 bInterval; 34 34 } __attribute__((packed)); 35 35 36 + /* Legacy format, deprecated as of 3.14. */ 37 + struct usb_functionfs_descs_head { 38 + __le32 magic; 39 + __le32 length; 40 + __le32 fs_count; 41 + __le32 hs_count; 42 + } __attribute__((packed, deprecated)); 36 43 37 44 /* 38 45 * Descriptors format:
+3 -3
kernel/events/uprobes.c
··· 846 846 { 847 847 int err; 848 848 849 - if (!consumer_del(uprobe, uc)) /* WARN? */ 849 + if (WARN_ON(!consumer_del(uprobe, uc))) 850 850 return; 851 851 852 852 err = register_for_each_vma(uprobe, NULL); ··· 927 927 int ret = -ENOENT; 928 928 929 929 uprobe = find_uprobe(inode, offset); 930 - if (!uprobe) 930 + if (WARN_ON(!uprobe)) 931 931 return ret; 932 932 933 933 down_write(&uprobe->register_rwsem); ··· 952 952 struct uprobe *uprobe; 953 953 954 954 uprobe = find_uprobe(inode, offset); 955 - if (!uprobe) 955 + if (WARN_ON(!uprobe)) 956 956 return; 957 957 958 958 down_write(&uprobe->register_rwsem);
+2 -2
kernel/irq/irqdesc.c
··· 455 455 */ 456 456 void irq_free_hwirqs(unsigned int from, int cnt) 457 457 { 458 - int i; 458 + int i, j; 459 459 460 - for (i = from; cnt > 0; i++, cnt--) { 460 + for (i = from, j = cnt; j > 0; i++, j--) { 461 461 irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE); 462 462 arch_teardown_hwirq(i); 463 463 }
+18 -26
kernel/printk/printk.c
··· 1416 1416 /* 1417 1417 * Can we actually use the console at this time on this cpu? 1418 1418 * 1419 - * Console drivers may assume that per-cpu resources have been allocated. So 1420 - * unless they're explicitly marked as being able to cope (CON_ANYTIME) don't 1421 - * call them until this CPU is officially up. 1419 + * Console drivers may assume that per-cpu resources have 1420 + * been allocated. So unless they're explicitly marked as 1421 + * being able to cope (CON_ANYTIME) don't call them until 1422 + * this CPU is officially up. 1422 1423 */ 1423 1424 static inline int can_use_console(unsigned int cpu) 1424 1425 { ··· 1432 1431 * console_lock held, and 'console_locked' set) if it 1433 1432 * is successful, false otherwise. 1434 1433 */ 1435 - static int console_trylock_for_printk(void) 1434 + static int console_trylock_for_printk(unsigned int cpu) 1436 1435 { 1437 - unsigned int cpu = smp_processor_id(); 1438 - 1439 1436 if (!console_trylock()) 1440 1437 return 0; 1441 1438 /* ··· 1608 1609 */ 1609 1610 if (!oops_in_progress && !lockdep_recursing(current)) { 1610 1611 recursion_bug = 1; 1611 - local_irq_restore(flags); 1612 - return 0; 1612 + goto out_restore_irqs; 1613 1613 } 1614 1614 zap_locks(); 1615 1615 } ··· 1716 1718 1717 1719 logbuf_cpu = UINT_MAX; 1718 1720 raw_spin_unlock(&logbuf_lock); 1719 - lockdep_on(); 1720 - local_irq_restore(flags); 1721 1721 1722 1722 /* If called from the scheduler, we can not call up(). */ 1723 - if (in_sched) 1724 - return printed_len; 1723 + if (!in_sched) { 1724 + /* 1725 + * Try to acquire and then immediately release the console 1726 + * semaphore. The release will print out buffers and wake up 1727 + * /dev/kmsg and syslog() users. 1728 + */ 1729 + if (console_trylock_for_printk(this_cpu)) 1730 + console_unlock(); 1731 + } 1725 1732 1726 - /* 1727 - * Disable preemption to avoid being preempted while holding 1728 - * console_sem which would prevent anyone from printing to console 1729 - */ 1730 - preempt_disable(); 1731 - /* 1732 - * Try to acquire and then immediately release the console semaphore. 1733 - * The release will print out buffers and wake up /dev/kmsg and syslog() 1734 - * users. 1735 - */ 1736 - if (console_trylock_for_printk()) 1737 - console_unlock(); 1738 - preempt_enable(); 1739 - 1733 + lockdep_on(); 1734 + out_restore_irqs: 1735 + local_irq_restore(flags); 1740 1736 return printed_len; 1741 1737 } 1742 1738 EXPORT_SYMBOL(vprintk_emit);
-2
kernel/trace/trace.c
··· 1396 1396 1397 1397 arch_spin_unlock(&global_trace.max_lock); 1398 1398 1399 - ftrace_start(); 1400 1399 out: 1401 1400 raw_spin_unlock_irqrestore(&global_trace.start_lock, flags); 1402 1401 } ··· 1442 1443 struct ring_buffer *buffer; 1443 1444 unsigned long flags; 1444 1445 1445 - ftrace_stop(); 1446 1446 raw_spin_lock_irqsave(&global_trace.start_lock, flags); 1447 1447 if (global_trace.stop_count++) 1448 1448 goto out;
+27 -19
kernel/trace/trace_uprobe.c
··· 893 893 int ret; 894 894 895 895 if (file) { 896 + if (tu->tp.flags & TP_FLAG_PROFILE) 897 + return -EINTR; 898 + 896 899 link = kmalloc(sizeof(*link), GFP_KERNEL); 897 900 if (!link) 898 901 return -ENOMEM; ··· 904 901 list_add_tail_rcu(&link->list, &tu->tp.files); 905 902 906 903 tu->tp.flags |= TP_FLAG_TRACE; 907 - } else 908 - tu->tp.flags |= TP_FLAG_PROFILE; 904 + } else { 905 + if (tu->tp.flags & TP_FLAG_TRACE) 906 + return -EINTR; 909 907 910 - ret = uprobe_buffer_enable(); 911 - if (ret < 0) 912 - return ret; 908 + tu->tp.flags |= TP_FLAG_PROFILE; 909 + } 913 910 914 911 WARN_ON(!uprobe_filter_is_empty(&tu->filter)); 915 912 916 913 if (enabled) 917 914 return 0; 918 915 916 + ret = uprobe_buffer_enable(); 917 + if (ret) 918 + goto err_flags; 919 + 919 920 tu->consumer.filter = filter; 920 921 ret = uprobe_register(tu->inode, tu->offset, &tu->consumer); 921 - if (ret) { 922 - if (file) { 923 - list_del(&link->list); 924 - kfree(link); 925 - tu->tp.flags &= ~TP_FLAG_TRACE; 926 - } else 927 - tu->tp.flags &= ~TP_FLAG_PROFILE; 928 - } 922 + if (ret) 923 + goto err_buffer; 929 924 925 + return 0; 926 + 927 + err_buffer: 928 + uprobe_buffer_disable(); 929 + 930 + err_flags: 931 + if (file) { 932 + list_del(&link->list); 933 + kfree(link); 934 + tu->tp.flags &= ~TP_FLAG_TRACE; 935 + } else { 936 + tu->tp.flags &= ~TP_FLAG_PROFILE; 937 + } 930 938 return ret; 931 939 } 932 940 ··· 1214 1200 udd.bp_addr = instruction_pointer(regs); 1215 1201 1216 1202 current->utask->vaddr = (unsigned long) &udd; 1217 - 1218 - #ifdef CONFIG_PERF_EVENTS 1219 - if ((tu->tp.flags & TP_FLAG_TRACE) == 0 && 1220 - !uprobe_perf_filter(&tu->consumer, 0, current->mm)) 1221 - return UPROBE_HANDLER_REMOVE; 1222 - #endif 1223 1203 1224 1204 if (WARN_ON_ONCE(!uprobe_cpu_buffer)) 1225 1205 return 0;
+5 -1
lib/lz4/lz4_decompress.c
··· 192 192 int s = 255; 193 193 while ((ip < iend) && (s == 255)) { 194 194 s = *ip++; 195 + if (unlikely(length > (size_t)(length + s))) 196 + goto _output_error; 195 197 length += s; 196 198 } 197 199 } ··· 234 232 if (length == ML_MASK) { 235 233 while (ip < iend) { 236 234 int s = *ip++; 235 + if (unlikely(length > (size_t)(length + s))) 236 + goto _output_error; 237 237 length += s; 238 238 if (s == 255) 239 239 continue; ··· 288 284 289 285 /* write overflow error detected */ 290 286 _output_error: 291 - return (int) (-(((char *) ip) - source)); 287 + return -1; 292 288 } 293 289 294 290 int lz4_decompress(const unsigned char *src, size_t *src_len,
+5 -4
mm/memory-failure.c
··· 895 895 struct page *hpage = *hpagep; 896 896 struct page *ppage; 897 897 898 - if (PageReserved(p) || PageSlab(p)) 898 + if (PageReserved(p) || PageSlab(p) || !PageLRU(p)) 899 899 return SWAP_SUCCESS; 900 900 901 901 /* ··· 1159 1159 action_result(pfn, "free buddy, 2nd try", DELAYED); 1160 1160 return 0; 1161 1161 } 1162 - action_result(pfn, "non LRU", IGNORED); 1163 - put_page(p); 1164 - return -EBUSY; 1165 1162 } 1166 1163 } 1167 1164 ··· 1190 1193 put_page(hpage); 1191 1194 return 0; 1192 1195 } 1196 + 1197 + if (!PageHuge(p) && !PageTransTail(p) && !PageLRU(p)) 1198 + goto identify_page_state; 1193 1199 1194 1200 /* 1195 1201 * For error on the tail page, we should set PG_hwpoison ··· 1243 1243 goto out; 1244 1244 } 1245 1245 1246 + identify_page_state: 1246 1247 res = -EBUSY; 1247 1248 /* 1248 1249 * The first check uses the current page flags which may not have any
+2 -1
mm/msync.c
··· 78 78 goto out_unlock; 79 79 } 80 80 file = vma->vm_file; 81 - fstart = start + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); 81 + fstart = (start - vma->vm_start) + 82 + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); 82 83 fend = fstart + (min(end, vma->vm_end) - start) - 1; 83 84 start = vma->vm_end; 84 85 if ((flags & MS_SYNC) && file &&
+14 -2
mm/page_alloc.c
··· 816 816 set_page_count(p, 0); 817 817 } while (++p, --i); 818 818 819 - set_page_refcounted(page); 820 819 set_pageblock_migratetype(page, MIGRATE_CMA); 821 - __free_pages(page, pageblock_order); 820 + 821 + if (pageblock_order >= MAX_ORDER) { 822 + i = pageblock_nr_pages; 823 + p = page; 824 + do { 825 + set_page_refcounted(p); 826 + __free_pages(p, MAX_ORDER - 1); 827 + p += MAX_ORDER_NR_PAGES; 828 + } while (i -= MAX_ORDER_NR_PAGES); 829 + } else { 830 + set_page_refcounted(page); 831 + __free_pages(page, pageblock_order); 832 + } 833 + 822 834 adjust_managed_page_count(page, pageblock_nr_pages); 823 835 } 824 836 #endif
+10 -5
mm/shmem.c
··· 1029 1029 goto failed; 1030 1030 } 1031 1031 1032 + if (page && sgp == SGP_WRITE) 1033 + mark_page_accessed(page); 1034 + 1032 1035 /* fallocated page? */ 1033 1036 if (page && !PageUptodate(page)) { 1034 1037 if (sgp != SGP_READ) ··· 1113 1110 shmem_recalc_inode(inode); 1114 1111 spin_unlock(&info->lock); 1115 1112 1113 + if (sgp == SGP_WRITE) 1114 + mark_page_accessed(page); 1115 + 1116 1116 delete_from_swap_cache(page); 1117 1117 set_page_dirty(page); 1118 1118 swap_free(swap); ··· 1142 1136 1143 1137 __SetPageSwapBacked(page); 1144 1138 __set_page_locked(page); 1139 + if (sgp == SGP_WRITE) 1140 + init_page_accessed(page); 1141 + 1145 1142 error = mem_cgroup_charge_file(page, current->mm, 1146 1143 gfp & GFP_RECLAIM_MASK); 1147 1144 if (error) ··· 1421 1412 loff_t pos, unsigned len, unsigned flags, 1422 1413 struct page **pagep, void **fsdata) 1423 1414 { 1424 - int ret; 1425 1415 struct inode *inode = mapping->host; 1426 1416 pgoff_t index = pos >> PAGE_CACHE_SHIFT; 1427 - ret = shmem_getpage(inode, index, pagep, SGP_WRITE, NULL); 1428 - if (ret == 0 && *pagep) 1429 - init_page_accessed(*pagep); 1430 - return ret; 1417 + return shmem_getpage(inode, index, pagep, SGP_WRITE, NULL); 1431 1418 } 1432 1419 1433 1420 static int
+3 -3
mm/slub.c
··· 1881 1881 1882 1882 new.frozen = 0; 1883 1883 1884 - if (!new.inuse && n->nr_partial > s->min_partial) 1884 + if (!new.inuse && n->nr_partial >= s->min_partial) 1885 1885 m = M_FREE; 1886 1886 else if (new.freelist) { 1887 1887 m = M_PARTIAL; ··· 1992 1992 new.freelist, new.counters, 1993 1993 "unfreezing slab")); 1994 1994 1995 - if (unlikely(!new.inuse && n->nr_partial > s->min_partial)) { 1995 + if (unlikely(!new.inuse && n->nr_partial >= s->min_partial)) { 1996 1996 page->next = discard_page; 1997 1997 discard_page = page; 1998 1998 } else { ··· 2620 2620 return; 2621 2621 } 2622 2622 2623 - if (unlikely(!new.inuse && n->nr_partial > s->min_partial)) 2623 + if (unlikely(!new.inuse && n->nr_partial >= s->min_partial)) 2624 2624 goto slab_empty; 2625 2625 2626 2626 /*
+55
sound/pci/hda/hda_i915.c
··· 20 20 #include <linux/module.h> 21 21 #include <sound/core.h> 22 22 #include <drm/i915_powerwell.h> 23 + #include "hda_priv.h" 23 24 #include "hda_i915.h" 25 + 26 + /* Intel HSW/BDW display HDA controller Extended Mode registers. 27 + * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display 28 + * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N 29 + * The values will be lost when the display power well is disabled. 30 + */ 31 + #define ICH6_REG_EM4 0x100c 32 + #define ICH6_REG_EM5 0x1010 24 33 25 34 static int (*get_power)(void); 26 35 static int (*put_power)(void); 36 + static int (*get_cdclk)(void); 27 37 28 38 int hda_display_power(bool enable) 29 39 { ··· 47 37 else 48 38 return put_power(); 49 39 } 40 + 41 + void haswell_set_bclk(struct azx *chip) 42 + { 43 + int cdclk_freq; 44 + unsigned int bclk_m, bclk_n; 45 + 46 + if (!get_cdclk) 47 + return; 48 + 49 + cdclk_freq = get_cdclk(); 50 + switch (cdclk_freq) { 51 + case 337500: 52 + bclk_m = 16; 53 + bclk_n = 225; 54 + break; 55 + 56 + case 450000: 57 + default: /* default CDCLK 450MHz */ 58 + bclk_m = 4; 59 + bclk_n = 75; 60 + break; 61 + 62 + case 540000: 63 + bclk_m = 4; 64 + bclk_n = 90; 65 + break; 66 + 67 + case 675000: 68 + bclk_m = 8; 69 + bclk_n = 225; 70 + break; 71 + } 72 + 73 + azx_writew(chip, EM4, bclk_m); 74 + azx_writew(chip, EM5, bclk_n); 75 + } 76 + 50 77 51 78 int hda_i915_init(void) 52 79 { ··· 102 55 return -ENODEV; 103 56 } 104 57 58 + get_cdclk = symbol_request(i915_get_cdclk_freq); 59 + if (!get_cdclk) /* may have abnormal BCLK and audio playback rate */ 60 + pr_warn("hda-i915: get_cdclk symbol get fail\n"); 61 + 105 62 pr_debug("HDA driver get symbol successfully from i915 module\n"); 106 63 107 64 return err; ··· 120 69 if (put_power) { 121 70 symbol_put(i915_release_power_well); 122 71 put_power = NULL; 72 + } 73 + if (get_cdclk) { 74 + symbol_put(i915_get_cdclk_freq); 75 + get_cdclk = NULL; 123 76 } 124 77 125 78 return 0;
+2
sound/pci/hda/hda_i915.h
··· 18 18 19 19 #ifdef CONFIG_SND_HDA_I915 20 20 int hda_display_power(bool enable); 21 + void haswell_set_bclk(struct azx *chip); 21 22 int hda_i915_init(void); 22 23 int hda_i915_exit(void); 23 24 #else 24 25 static inline int hda_display_power(bool enable) { return 0; } 26 + static inline void haswell_set_bclk(struct azx *chip) { return; } 25 27 static inline int hda_i915_init(void) 26 28 { 27 29 return -ENODEV;
+9 -41
sound/pci/hda/hda_intel.c
··· 62 62 #include <linux/vga_switcheroo.h> 63 63 #include <linux/firmware.h> 64 64 #include "hda_codec.h" 65 - #include "hda_i915.h" 66 65 #include "hda_controller.h" 67 66 #include "hda_priv.h" 67 + #include "hda_i915.h" 68 68 69 69 70 70 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; ··· 288 288 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 289 289 }; 290 290 291 - 292 - /* Intel HSW/BDW display HDA controller Extended Mode registers. 293 - * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display 294 - * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N 295 - * The values will be lost when the display power well is disabled. 296 - */ 297 - #define ICH6_REG_EM4 0x100c 298 - #define ICH6_REG_EM5 0x1010 299 - 300 291 struct hda_intel { 301 292 struct azx chip; 302 - 303 - /* HSW/BDW display HDA controller to restore BCLK from CDCLK */ 304 - unsigned int bclk_m; 305 - unsigned int bclk_n; 306 293 }; 307 294 308 295 ··· 585 598 #define azx_del_card_list(chip) /* NOP */ 586 599 #endif /* CONFIG_PM */ 587 600 588 - static void haswell_save_bclk(struct azx *chip) 589 - { 590 - struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 591 - 592 - hda->bclk_m = azx_readw(chip, EM4); 593 - hda->bclk_n = azx_readw(chip, EM5); 594 - } 595 - 596 - static void haswell_restore_bclk(struct azx *chip) 597 - { 598 - struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 599 - 600 - azx_writew(chip, EM4, hda->bclk_m); 601 - azx_writew(chip, EM5, hda->bclk_n); 602 - } 603 - 604 601 #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) 605 602 /* 606 603 * power management ··· 612 641 chip->irq = -1; 613 642 } 614 643 615 - /* Save BCLK M/N values before they become invalid in D3. 616 - * Will test if display power well can be released now. 617 - */ 618 - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 619 - haswell_save_bclk(chip); 620 - 621 644 if (chip->msi) 622 645 pci_disable_msi(chip->pci); 623 646 pci_disable_device(pci); ··· 633 668 634 669 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 635 670 hda_display_power(true); 636 - haswell_restore_bclk(chip); 671 + haswell_set_bclk(chip); 637 672 } 638 673 pci_set_power_state(pci, PCI_D0); 639 674 pci_restore_state(pci); ··· 678 713 azx_stop_chip(chip); 679 714 azx_enter_link_reset(chip); 680 715 azx_clear_irq_pending(chip); 681 - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 682 - haswell_save_bclk(chip); 716 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 683 717 hda_display_power(false); 684 - } 718 + 685 719 return 0; 686 720 } 687 721 ··· 700 736 701 737 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 702 738 hda_display_power(true); 703 - haswell_restore_bclk(chip); 739 + haswell_set_bclk(chip); 704 740 } 705 741 706 742 /* Read STATESTS before controller reset */ ··· 1390 1426 1391 1427 /* initialize chip */ 1392 1428 azx_init_pci(chip); 1429 + 1430 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 1431 + haswell_set_bclk(chip); 1432 + 1393 1433 azx_init_chip(chip, (probe_only[dev] & 2) == 0); 1394 1434 1395 1435 /* codec detection */
+13
sound/pci/hda/patch_realtek.c
··· 4880 4880 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 4881 4881 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), 4882 4882 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 4883 + SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 4883 4884 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4884 4885 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4885 4886 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 5082 5081 {0x16, 0x21014020}, 5083 5082 {0x18, 0x411111f0}, 5084 5083 {0x19, 0x21a19030}, 5084 + {0x1a, 0x411111f0}, 5085 + {0x1b, 0x411111f0}, 5086 + {0x1d, 0x40700001}, 5087 + {0x1e, 0x411111f0}), 5088 + SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 5089 + {0x12, 0x40000000}, 5090 + {0x13, 0x90a60140}, 5091 + {0x14, 0x90170110}, 5092 + {0x15, 0x0221401f}, 5093 + {0x16, 0x411111f0}, 5094 + {0x18, 0x411111f0}, 5095 + {0x19, 0x411111f0}, 5085 5096 {0x1a, 0x411111f0}, 5086 5097 {0x1b, 0x411111f0}, 5087 5098 {0x1d, 0x40700001},
+1 -1
tools/testing/selftests/cpu-hotplug/Makefile
··· 1 1 all: 2 2 3 3 run_tests: 4 - @/bin/sh ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" 4 + @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" 5 5 6 6 clean:
+5
tools/testing/selftests/ipc/msgque.c
··· 193 193 int msg, pid, err; 194 194 struct msgque_data msgque; 195 195 196 + if (getuid() != 0) { 197 + printf("Please run the test as root - Exiting.\n"); 198 + exit(1); 199 + } 200 + 196 201 msgque.key = ftok(argv[0], 822155650); 197 202 if (msgque.key == -1) { 198 203 printf("Can't make key\n");
+1 -1
tools/testing/selftests/memory-hotplug/Makefile
··· 1 1 all: 2 2 3 3 run_tests: 4 - @/bin/sh ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" 4 + @/bin/bash ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" 5 5 6 6 clean:
+2 -2
tools/usb/ffs-test.c
··· 116 116 .header = { 117 117 .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), 118 118 .length = cpu_to_le32(sizeof descriptors), 119 - .fs_count = 3, 120 - .hs_count = 3, 119 + .fs_count = cpu_to_le32(3), 120 + .hs_count = cpu_to_le32(3), 121 121 }, 122 122 .fs_descs = { 123 123 .intf = {