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

Merge 3.16-rc2 into staging-next

We want the staging fixes here as well.

+7718 -4327
+2 -2
Documentation/DocBook/media/Makefile
··· 202 202 203 203 $(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES) 204 204 @$($(quiet)gen_xml) 205 - @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/) 206 - @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/) 205 + @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/v4l/*xml $(MEDIA_OBJ_DIR)/) 206 + @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/dvb/*xml $(MEDIA_OBJ_DIR)/) 207 207 208 208 $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/uapi/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml 209 209 @$($(quiet)gen_xml)
+42
Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
··· 1 + * Rockchip RK3xxx I2C controller 2 + 3 + This driver interfaces with the native I2C controller present in Rockchip 4 + RK3xxx SoCs. 5 + 6 + Required properties : 7 + 8 + - reg : Offset and length of the register set for the device 9 + - compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c" or 10 + "rockchip,rk3288-i2c". 11 + - interrupts : interrupt number 12 + - clocks : parent clock 13 + 14 + Required on RK3066, RK3188 : 15 + 16 + - rockchip,grf : the phandle of the syscon node for the general register 17 + file (GRF) 18 + - on those SoCs an alias with the correct I2C bus ID (bit offset in the GRF) 19 + is also required. 20 + 21 + Optional properties : 22 + 23 + - clock-frequency : SCL frequency to use (in Hz). If omitted, 100kHz is used. 24 + 25 + Example: 26 + 27 + aliases { 28 + i2c0 = &i2c0; 29 + } 30 + 31 + i2c0: i2c@2002d000 { 32 + compatible = "rockchip,rk3188-i2c"; 33 + reg = <0x2002d000 0x1000>; 34 + interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + 38 + rockchip,grf = <&grf>; 39 + 40 + clock-names = "i2c"; 41 + clocks = <&cru PCLK_I2C0>; 42 + };
+41
Documentation/devicetree/bindings/i2c/i2c-sunxi-p2wi.txt
··· 1 + 2 + * Allwinner P2WI (Push/Pull 2 Wire Interface) controller 3 + 4 + Required properties : 5 + 6 + - reg : Offset and length of the register set for the device. 7 + - compatible : Should one of the following: 8 + - "allwinner,sun6i-a31-p2wi" 9 + - interrupts : The interrupt line connected to the P2WI peripheral. 10 + - clocks : The gate clk connected to the P2WI peripheral. 11 + - resets : The reset line connected to the P2WI peripheral. 12 + 13 + Optional properties : 14 + 15 + - clock-frequency : Desired P2WI bus clock frequency in Hz. If not set the 16 + default frequency is 100kHz 17 + 18 + A P2WI may contain one child node encoding a P2WI slave device. 19 + 20 + Slave device properties: 21 + Required properties: 22 + - reg : the I2C slave address used during the initialization 23 + process to switch from I2C to P2WI mode 24 + 25 + Example: 26 + 27 + p2wi@01f03400 { 28 + compatible = "allwinner,sun6i-a31-p2wi"; 29 + reg = <0x01f03400 0x400>; 30 + interrupts = <0 39 4>; 31 + clocks = <&apb0_gates 3>; 32 + clock-frequency = <6000000>; 33 + resets = <&apb0_rst 3>; 34 + 35 + axp221: pmic@68 { 36 + compatible = "x-powers,axp221"; 37 + reg = <0x68>; 38 + 39 + /* ... */ 40 + }; 41 + };
+1 -1
Documentation/kbuild/makefiles.txt
··· 1171 1171 obvious reason. 1172 1172 1173 1173 dtc 1174 - Create flattend device tree blob object suitable for linking 1174 + Create flattened device tree blob object suitable for linking 1175 1175 into vmlinux. Device tree blobs linked into vmlinux are placed 1176 1176 in an init section in the image. Platform code *must* copy the 1177 1177 blob to non-init memory prior to calling unflatten_device_tree().
+10 -4
Documentation/kernel-parameters.txt
··· 1474 1474 js= [HW,JOY] Analog joystick 1475 1475 See Documentation/input/joystick.txt. 1476 1476 1477 + kaslr/nokaslr [X86] 1478 + Enable/disable kernel and module base offset ASLR 1479 + (Address Space Layout Randomization) if built into 1480 + the kernel. When CONFIG_HIBERNATION is selected, 1481 + kASLR is disabled by default. When kASLR is enabled, 1482 + hibernation will be disabled. 1483 + 1477 1484 keepinitrd [HW,ARM] 1478 1485 1479 1486 kernelcore=nn[KMG] [KNL,X86,IA-64,PPC] This parameter ··· 2117 2110 noapic [SMP,APIC] Tells the kernel to not make use of any 2118 2111 IOAPICs that may be present in the system. 2119 2112 2120 - nokaslr [X86] 2121 - Disable kernel and module base offset ASLR (Address 2122 - Space Layout Randomization) if built into the kernel. 2123 - 2124 2113 noautogroup Disable scheduler automatic task group creation. 2125 2114 2126 2115 nobats [PPC] Do not use BATs for mapping kernel lowmem ··· 2186 2183 interrupt wake-up latency, which may improve performance 2187 2184 in certain environments such as networked servers or 2188 2185 real-time systems. 2186 + 2187 + nohibernate [HIBERNATION] Disable hibernation and resume. 2189 2188 2190 2189 nohz= [KNL] Boottime enable/disable dynamic ticks 2191 2190 Valid arguments: on, off ··· 2985 2980 noresume Don't check if there's a hibernation image 2986 2981 present during boot. 2987 2982 nocompress Don't compress/decompress hibernation images. 2983 + no Disable hibernation and resume. 2988 2984 2989 2985 retain_initrd [RAM] Keep initrd memory after extraction 2990 2986
+4 -3
Documentation/thermal/nouveau_thermal
··· 4 4 Supported chips: 5 5 * NV43+ 6 6 7 - Authors: Martin Peres (mupuf) <martin.peres@labri.fr> 7 + Authors: Martin Peres (mupuf) <martin.peres@free.fr> 8 8 9 9 Description 10 10 --------- ··· 68 68 69 69 NOTE: Be sure to use the manual mode if you want to drive the fan speed manually 70 70 71 - NOTE2: Not all fan management modes may be supported on all chipsets. We are 72 - working on it. 71 + NOTE2: When operating in manual mode outside the vbios-defined 72 + [PWM_min, PWM_max] range, the reported fan speed (RPM) may not be accurate 73 + depending on your hardware. 73 74 74 75 Bug reports 75 76 ---------
+11 -2
MAINTAINERS
··· 6960 6960 M: Guan Xuetao <gxt@mprc.pku.edu.cn> 6961 6961 W: http://mprc.pku.edu.cn/~guanxuetao/linux 6962 6962 S: Maintained 6963 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.git 6963 + T: git git://github.com/gxt/linux.git 6964 6964 F: drivers/input/serio/i8042-unicore32io.h 6965 6965 F: drivers/i2c/busses/i2c-puv3.c 6966 6966 F: drivers/video/fb-puv3.c ··· 7948 7948 7949 7949 SECURITY SUBSYSTEM 7950 7950 M: James Morris <james.l.morris@oracle.com> 7951 + M: Serge E. Hallyn <serge@hallyn.com> 7951 7952 L: linux-security-module@vger.kernel.org (suggested Cc:) 7952 7953 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git 7953 7954 W: http://kernsec.org/ ··· 9269 9268 M: Guan Xuetao <gxt@mprc.pku.edu.cn> 9270 9269 W: http://mprc.pku.edu.cn/~guanxuetao/linux 9271 9270 S: Maintained 9272 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.git 9271 + T: git git://github.com/gxt/linux.git 9273 9272 F: arch/unicore32/ 9274 9273 9275 9274 UNIFDEF ··· 9735 9734 L: virtualization@lists.linux-foundation.org 9736 9735 S: Supported 9737 9736 F: arch/x86/kernel/cpu/vmware.c 9737 + 9738 + VMWARE BALLOON DRIVER 9739 + M: Xavier Deguillard <xdeguillard@vmware.com> 9740 + M: Philip Moltmann <moltmann@vmware.com> 9741 + M: "VMware, Inc." <pv-drivers@vmware.com> 9742 + L: linux-kernel@vger.kernel.org 9743 + S: Maintained 9744 + F: drivers/misc/vmw_balloon.c 9738 9745 9739 9746 VMWARE VMXNET3 ETHERNET DRIVER 9740 9747 M: Shreyas Bhatewara <sbhatewara@vmware.com>
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 16 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc1 4 + EXTRAVERSION = -rc2 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION*
+1 -19
arch/arm/Kconfig
··· 175 175 config ARCH_HAS_ILOG2_U64 176 176 bool 177 177 178 - config ARCH_HAS_CPUFREQ 179 - bool 180 - help 181 - Internal node to signify that the ARCH has CPUFREQ support 182 - and that the relevant menu configurations are displayed for 183 - it. 184 - 185 178 config ARCH_HAS_BANDGAP 186 179 bool 187 180 ··· 311 318 312 319 config ARCH_INTEGRATOR 313 320 bool "ARM Ltd. Integrator family" 314 - select ARCH_HAS_CPUFREQ 315 321 select ARM_AMBA 316 322 select ARM_PATCH_PHYS_VIRT 317 323 select AUTO_ZRELADDR ··· 530 538 531 539 config ARCH_KIRKWOOD 532 540 bool "Marvell Kirkwood" 533 - select ARCH_HAS_CPUFREQ 534 541 select ARCH_REQUIRE_GPIOLIB 535 542 select CPU_FEROCEON 536 543 select GENERIC_CLOCKEVENTS ··· 628 637 config ARCH_PXA 629 638 bool "PXA2xx/PXA3xx-based" 630 639 depends on MMU 631 - select ARCH_HAS_CPUFREQ 632 640 select ARCH_MTD_XIP 633 641 select ARCH_REQUIRE_GPIOLIB 634 642 select ARM_CPU_SUSPEND if PM ··· 697 707 698 708 config ARCH_SA1100 699 709 bool "SA1100-based" 700 - select ARCH_HAS_CPUFREQ 701 710 select ARCH_MTD_XIP 702 711 select ARCH_REQUIRE_GPIOLIB 703 712 select ARCH_SPARSEMEM_ENABLE ··· 714 725 715 726 config ARCH_S3C24XX 716 727 bool "Samsung S3C24XX SoCs" 717 - select ARCH_HAS_CPUFREQ 718 728 select ARCH_REQUIRE_GPIOLIB 719 729 select ATAGS 720 730 select CLKDEV_LOOKUP ··· 734 746 735 747 config ARCH_S3C64XX 736 748 bool "Samsung S3C64XX" 737 - select ARCH_HAS_CPUFREQ 738 749 select ARCH_REQUIRE_GPIOLIB 739 750 select ARM_AMBA 740 751 select ARM_VIC ··· 796 809 797 810 config ARCH_S5PV210 798 811 bool "Samsung S5PV210/S5PC110" 799 - select ARCH_HAS_CPUFREQ 800 812 select ARCH_HAS_HOLES_MEMORYMODEL 801 813 select ARCH_SPARSEMEM_ENABLE 802 814 select ATAGS ··· 831 845 config ARCH_OMAP1 832 846 bool "TI OMAP1" 833 847 depends on MMU 834 - select ARCH_HAS_CPUFREQ 835 848 select ARCH_HAS_HOLES_MEMORYMODEL 836 849 select ARCH_OMAP 837 850 select ARCH_REQUIRE_GPIOLIB ··· 994 1009 995 1010 source "arch/arm/mach-sa1100/Kconfig" 996 1011 997 - source "arch/arm/plat-samsung/Kconfig" 998 - 999 1012 source "arch/arm/mach-socfpga/Kconfig" 1000 1013 1001 1014 source "arch/arm/mach-spear/Kconfig" ··· 1011 1028 source "arch/arm/mach-s5pv210/Kconfig" 1012 1029 1013 1030 source "arch/arm/mach-exynos/Kconfig" 1031 + source "arch/arm/plat-samsung/Kconfig" 1014 1032 1015 1033 source "arch/arm/mach-shmobile/Kconfig" 1016 1034 ··· 2093 2109 2094 2110 menu "CPU Power Management" 2095 2111 2096 - if ARCH_HAS_CPUFREQ 2097 2112 source "drivers/cpufreq/Kconfig" 2098 - endif 2099 2113 2100 2114 source "drivers/cpuidle/Kconfig" 2101 2115
+2
arch/arm/boot/dts/armada-375-db.dts
··· 91 91 marvell,nand-keep-config; 92 92 marvell,nand-enable-arbiter; 93 93 nand-on-flash-bbt; 94 + nand-ecc-strength = <4>; 95 + nand-ecc-step-size = <512>; 94 96 95 97 partition@0 { 96 98 label = "U-Boot";
+2
arch/arm/boot/dts/armada-385-db.dts
··· 98 98 marvell,nand-keep-config; 99 99 marvell,nand-enable-arbiter; 100 100 nand-on-flash-bbt; 101 + nand-ecc-strength = <4>; 102 + nand-ecc-step-size = <512>; 101 103 102 104 partition@0 { 103 105 label = "U-Boot";
+1 -1
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
··· 25 25 26 26 memory { 27 27 device_type = "memory"; 28 - reg = <0 0x00000000 0 0xC0000000>; /* 3 GB */ 28 + reg = <0 0x00000000 0 0x40000000>; /* 1 GB soldered on */ 29 29 }; 30 30 31 31 soc {
+1
arch/arm/configs/multi_v7_defconfig
··· 300 300 CONFIG_MMC_BLOCK_MINORS=16 301 301 CONFIG_MMC_ARMMMCI=y 302 302 CONFIG_MMC_SDHCI=y 303 + CONFIG_MMC_SDHCI_PLTFM=y 303 304 CONFIG_MMC_SDHCI_OF_ARASAN=y 304 305 CONFIG_MMC_SDHCI_ESDHC_IMX=y 305 306 CONFIG_MMC_SDHCI_DOVE=y
+1
arch/arm/configs/omap2plus_defconfig
··· 32 32 CONFIG_SOC_AM33XX=y 33 33 CONFIG_SOC_AM43XX=y 34 34 CONFIG_SOC_DRA7XX=y 35 + CONFIG_CACHE_L2X0=y 35 36 CONFIG_ARM_THUMBEE=y 36 37 CONFIG_ARM_ERRATA_411920=y 37 38 CONFIG_SMP=y
+1 -1
arch/arm/include/asm/ftrace.h
··· 52 52 53 53 #endif 54 54 55 - #define ftrace_return_addr(n) return_address(n) 55 + #define ftrace_return_address(n) return_address(n) 56 56 57 57 #endif /* ifndef __ASSEMBLY__ */ 58 58
+3 -4
arch/arm/mach-bcm/Kconfig
··· 1 - config ARCH_BCM 1 + menuconfig ARCH_BCM 2 2 bool "Broadcom SoC Support" if ARCH_MULTI_V6_V7 3 3 help 4 4 This enables support for Broadcom ARM based SoC chips 5 5 6 - menu "Broadcom SoC Selection" 7 - depends on ARCH_BCM 6 + if ARCH_BCM 8 7 9 8 config ARCH_BCM_MOBILE 10 9 bool "Broadcom Mobile SoC Support" if ARCH_MULTI_V7 ··· 87 88 different SoC or with the older BCM47XX and BCM53XX based 88 89 network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx 89 90 90 - endmenu 91 + endif
+1 -5
arch/arm/mach-berlin/Kconfig
··· 1 - config ARCH_BERLIN 1 + menuconfig ARCH_BERLIN 2 2 bool "Marvell Berlin SoCs" if ARCH_MULTI_V7 3 3 select ARCH_REQUIRE_GPIOLIB 4 4 select ARM_GIC ··· 8 8 select PINCTRL 9 9 10 10 if ARCH_BERLIN 11 - 12 - menu "Marvell Berlin SoC variants" 13 11 14 12 config MACH_BERLIN_BG2 15 13 bool "Marvell Armada 1500 (BG2)" ··· 27 29 select CACHE_L2X0 28 30 select HAVE_ARM_TWD if SMP 29 31 select PINCTRL_BERLIN_BG2Q 30 - 31 - endmenu 32 32 33 33 endif
+3 -4
arch/arm/mach-cns3xxx/Kconfig
··· 1 - config ARCH_CNS3XXX 1 + menuconfig ARCH_CNS3XXX 2 2 bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 3 3 select ARM_GIC 4 4 select PCI_DOMAINS if PCI 5 5 help 6 6 Support for Cavium Networks CNS3XXX platform. 7 7 8 - menu "CNS3XXX platform type" 9 - depends on ARCH_CNS3XXX 8 + if ARCH_CNS3XXX 10 9 11 10 config MACH_CNS3420VB 12 11 bool "Support for CNS3420 Validation Board" ··· 16 17 This is a platform with an on-board ARM11 MPCore and has support 17 18 for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc. 18 19 19 - endmenu 20 + endif
-1
arch/arm/mach-davinci/Kconfig
··· 39 39 config ARCH_DAVINCI_DA850 40 40 bool "DA850/OMAP-L138/AM18x based system" 41 41 select ARCH_DAVINCI_DA8XX 42 - select ARCH_HAS_CPUFREQ 43 42 select CP_INTC 44 43 45 44 config ARCH_DAVINCI_DA8XX
+1 -6
arch/arm/mach-exynos/Kconfig
··· 7 7 8 8 # Configuration options for the EXYNOS4 9 9 10 - config ARCH_EXYNOS 10 + menuconfig ARCH_EXYNOS 11 11 bool "Samsung EXYNOS" if ARCH_MULTI_V7 12 12 select ARCH_HAS_BANDGAP 13 - select ARCH_HAS_CPUFREQ 14 13 select ARCH_HAS_HOLES_MEMORYMODEL 15 14 select ARCH_REQUIRE_GPIOLIB 16 15 select ARM_AMBA ··· 28 29 Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5) 29 30 30 31 if ARCH_EXYNOS 31 - 32 - menu "SAMSUNG EXYNOS SoCs Support" 33 32 34 33 config ARCH_EXYNOS3 35 34 bool "SAMSUNG EXYNOS3" ··· 114 117 bool "SAMSUNG EXYNOS5800" 115 118 default y 116 119 depends on SOC_EXYNOS5420 117 - 118 - endmenu 119 120 120 121 config EXYNOS5420_MCPM 121 122 bool "Exynos5420 Multi-Cluster PM support"
+1
arch/arm/mach-exynos/common.h
··· 118 118 extern void __iomem *sysram_base_addr; 119 119 void exynos_init_io(void); 120 120 void exynos_restart(enum reboot_mode mode, const char *cmd); 121 + void exynos_sysram_init(void); 121 122 void exynos_cpuidle_init(void); 122 123 void exynos_cpufreq_init(void); 123 124 void exynos_init_late(void);
+30 -1
arch/arm/mach-exynos/exynos.c
··· 184 184 platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); 185 185 } 186 186 187 + void __iomem *sysram_base_addr; 188 + void __iomem *sysram_ns_base_addr; 189 + 190 + void __init exynos_sysram_init(void) 191 + { 192 + struct device_node *node; 193 + 194 + for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { 195 + if (!of_device_is_available(node)) 196 + continue; 197 + sysram_base_addr = of_iomap(node, 0); 198 + break; 199 + } 200 + 201 + for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { 202 + if (!of_device_is_available(node)) 203 + continue; 204 + sysram_ns_base_addr = of_iomap(node, 0); 205 + break; 206 + } 207 + } 208 + 187 209 void __init exynos_init_late(void) 188 210 { 189 211 if (of_machine_is_compatible("samsung,exynos5440")) ··· 220 198 int depth, void *data) 221 199 { 222 200 struct map_desc iodesc; 223 - __be32 *reg; 201 + const __be32 *reg; 224 202 int len; 225 203 226 204 if (!of_flat_dt_is_compatible(node, "samsung,exynos4210-chipid") && ··· 292 270 } 293 271 } 294 272 } 273 + 274 + /* 275 + * This is called from smp_prepare_cpus if we've built for SMP, but 276 + * we still need to set it up for PM and firmware ops if not. 277 + */ 278 + if (!IS_ENABLED(SMP)) 279 + exynos_sysram_init(); 295 280 296 281 exynos_cpuidle_init(); 297 282 exynos_cpufreq_init();
+2 -24
arch/arm/mach-exynos/platsmp.c
··· 32 32 33 33 extern void exynos4_secondary_startup(void); 34 34 35 - void __iomem *sysram_base_addr; 36 - void __iomem *sysram_ns_base_addr; 37 - 38 - static void __init exynos_smp_prepare_sysram(void) 39 - { 40 - struct device_node *node; 41 - 42 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { 43 - if (!of_device_is_available(node)) 44 - continue; 45 - sysram_base_addr = of_iomap(node, 0); 46 - break; 47 - } 48 - 49 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { 50 - if (!of_device_is_available(node)) 51 - continue; 52 - sysram_ns_base_addr = of_iomap(node, 0); 53 - break; 54 - } 55 - } 56 - 57 35 static inline void __iomem *cpu_boot_reg_base(void) 58 36 { 59 37 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) ··· 212 234 { 213 235 int i; 214 236 237 + exynos_sysram_init(); 238 + 215 239 if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9) 216 240 scu_enable(scu_base_addr()); 217 - 218 - exynos_smp_prepare_sysram(); 219 241 220 242 /* 221 243 * Write the address of secondary startup into the
-1
arch/arm/mach-highbank/Kconfig
··· 1 1 config ARCH_HIGHBANK 2 2 bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7 3 3 select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE 4 - select ARCH_HAS_CPUFREQ 5 4 select ARCH_HAS_HOLES_MEMORYMODEL 6 5 select ARCH_HAS_OPP 7 6 select ARCH_SUPPORTS_BIG_ENDIAN
+3 -7
arch/arm/mach-imx/Kconfig
··· 1 - config ARCH_MXC 1 + menuconfig ARCH_MXC 2 2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 3 - select ARCH_HAS_CPUFREQ 4 3 select ARCH_HAS_OPP 5 4 select ARCH_REQUIRE_GPIOLIB 6 5 select ARM_CPU_SUSPEND if PM ··· 12 13 help 13 14 Support for Freescale MXC/iMX-based family of processors 14 15 15 - menu "Freescale i.MX support" 16 - depends on ARCH_MXC 16 + if ARCH_MXC 17 17 18 18 config MXC_TZIC 19 19 bool ··· 97 99 98 100 config SOC_IMX27 99 101 bool 100 - select ARCH_HAS_CPUFREQ 101 102 select ARCH_HAS_OPP 102 103 select CPU_ARM926T 103 104 select IMX_HAVE_IOMUX_V1 ··· 121 124 122 125 config SOC_IMX5 123 126 bool 124 - select ARCH_HAS_CPUFREQ 125 127 select ARCH_HAS_OPP 126 128 select ARCH_MXC_IOMUX_V3 127 129 select MXC_TZIC ··· 782 786 783 787 source "arch/arm/mach-imx/devices/Kconfig" 784 788 785 - endmenu 789 + endif
+1 -1
arch/arm/mach-integrator/Kconfig
··· 28 28 bool 29 29 30 30 config INTEGRATOR_IMPD1 31 - tristate "Include support for Integrator/IM-PD1" 31 + bool "Include support for Integrator/IM-PD1" 32 32 depends on ARCH_INTEGRATOR_AP 33 33 select ARCH_REQUIRE_GPIOLIB 34 34 select ARM_VIC
+11 -1
arch/arm/mach-integrator/impd1.c
··· 308 308 */ 309 309 #define IMPD1_VALID_IRQS 0x00000bffU 310 310 311 - static int __init impd1_probe(struct lm_device *dev) 311 + /* 312 + * As this module is bool, it is OK to have this as __init_refok() - no 313 + * probe calls will be done after the initial system bootup, as devices 314 + * are discovered as part of the machine startup. 315 + */ 316 + static int __init_refok impd1_probe(struct lm_device *dev) 312 317 { 313 318 struct impd1_module *impd1; 314 319 int irq_base; ··· 402 397 static struct lm_driver impd1_driver = { 403 398 .drv = { 404 399 .name = "impd1", 400 + /* 401 + * As we're dropping the probe() function, suppress driver 402 + * binding from sysfs. 403 + */ 404 + .suppress_bind_attrs = true, 405 405 }, 406 406 .probe = impd1_probe, 407 407 .remove = impd1_remove,
+1
arch/arm/mach-keystone/Kconfig
··· 1 1 config ARCH_KEYSTONE 2 2 bool "Texas Instruments Keystone Devices" 3 3 depends on ARCH_MULTI_V7 4 + depends on ARM_PATCH_PHYS_VIRT 4 5 select ARM_GIC 5 6 select HAVE_ARM_ARCH_TIMER 6 7 select CLKSRC_MMIO
+1 -1
arch/arm/mach-moxart/Kconfig
··· 1 - config ARCH_MOXART 1 + menuconfig ARCH_MOXART 2 2 bool "MOXA ART SoC" if ARCH_MULTI_V4 3 3 select CPU_FA526 4 4 select ARM_DMA_MEM_BUFFERABLE
+1 -6
arch/arm/mach-mvebu/Kconfig
··· 1 - config ARCH_MVEBU 1 + menuconfig ARCH_MVEBU 2 2 bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5) 3 3 select ARCH_SUPPORTS_BIG_ENDIAN 4 4 select CLKSRC_MMIO ··· 12 12 select PCI_QUIRKS if PCI 13 13 14 14 if ARCH_MVEBU 15 - 16 - menu "Marvell EBU SoC variants" 17 15 18 16 config MACH_MVEBU_V7 19 17 bool ··· 82 84 83 85 config MACH_KIRKWOOD 84 86 bool "Marvell Kirkwood boards" if ARCH_MULTI_V5 85 - select ARCH_HAS_CPUFREQ 86 87 select ARCH_REQUIRE_GPIOLIB 87 88 select CPU_FEROCEON 88 89 select KIRKWOOD_CLK ··· 93 96 help 94 97 Say 'Y' here if you want your kernel to support boards based 95 98 on the Marvell Kirkwood device tree. 96 - 97 - endmenu 98 99 99 100 endif
+1 -3
arch/arm/mach-nomadik/Kconfig
··· 1 - config ARCH_NOMADIK 1 + menuconfig ARCH_NOMADIK 2 2 bool "ST-Ericsson Nomadik" 3 3 depends on ARCH_MULTI_V5 4 4 select ARCH_REQUIRE_GPIOLIB ··· 15 15 Support for the Nomadik platform by ST-Ericsson 16 16 17 17 if ARCH_NOMADIK 18 - menu "Nomadik boards" 19 18 20 19 config MACH_NOMADIK_8815NHK 21 20 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" ··· 23 24 select I2C_ALGOBIT 24 25 select I2C_NOMADIK 25 26 26 - endmenu 27 27 endif 28 28 29 29 config NOMADIK_8815
+5 -2
arch/arm/mach-omap2/Kconfig
··· 1 + menu "TI OMAP/AM/DM/DRA Family" 2 + depends on ARCH_MULTI_V6 || ARCH_MULTI_V7 3 + 1 4 config ARCH_OMAP 2 5 bool 3 6 ··· 31 28 select ARM_CPU_SUSPEND if PM 32 29 select ARM_ERRATA_720789 33 30 select ARM_GIC 34 - select CACHE_L2X0 35 31 select HAVE_ARM_SCU if SMP 36 32 select HAVE_ARM_TWD if SMP 37 33 select OMAP_INTERCONNECT ··· 82 80 config ARCH_OMAP2PLUS 83 81 bool 84 82 select ARCH_HAS_BANDGAP 85 - select ARCH_HAS_CPUFREQ 86 83 select ARCH_HAS_HOLES_MEMORYMODEL 87 84 select ARCH_OMAP 88 85 select ARCH_REQUIRE_GPIOLIB ··· 344 343 endmenu 345 344 346 345 endif 346 + 347 + endmenu
+7
arch/arm/mach-omap2/common.h
··· 91 91 extern void omap3_secure_sync32k_timer_init(void); 92 92 extern void omap3_gptimer_timer_init(void); 93 93 extern void omap4_local_timer_init(void); 94 + #ifdef CONFIG_CACHE_L2X0 94 95 int omap_l2_cache_init(void); 96 + #else 97 + static inline int omap_l2_cache_init(void) 98 + { 99 + return 0; 100 + } 101 + #endif 95 102 extern void omap5_realtime_timer_init(void); 96 103 97 104 void omap2420_init_early(void);
+2 -4
arch/arm/mach-prima2/Kconfig
··· 1 - config ARCH_SIRF 1 + menuconfig ARCH_SIRF 2 2 bool "CSR SiRF" if ARCH_MULTI_V7 3 3 select ARCH_HAS_RESET_CONTROLLER 4 4 select ARCH_REQUIRE_GPIOLIB ··· 11 11 12 12 if ARCH_SIRF 13 13 14 - menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" 14 + comment "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" 15 15 16 16 config ARCH_ATLAS6 17 17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" ··· 36 36 select SMP_ON_UP if SMP 37 37 help 38 38 Support for CSR SiRFSoC ARM Cortex A9 Platform 39 - 40 - endmenu 41 39 42 40 config SIRF_IRQ 43 41 bool
+1 -5
arch/arm/mach-qcom/Kconfig
··· 1 - config ARCH_QCOM 1 + menuconfig ARCH_QCOM 2 2 bool "Qualcomm Support" if ARCH_MULTI_V7 3 3 select ARCH_REQUIRE_GPIOLIB 4 4 select ARM_GIC ··· 11 11 12 12 if ARCH_QCOM 13 13 14 - menu "Qualcomm SoC Selection" 15 - 16 14 config ARCH_MSM8X60 17 15 bool "Enable support for MSM8X60" 18 16 select CLKSRC_QCOM ··· 22 24 config ARCH_MSM8974 23 25 bool "Enable support for MSM8974" 24 26 select HAVE_ARM_ARCH_TIMER 25 - 26 - endmenu 27 27 28 28 config QCOM_SCM 29 29 bool
+1 -1
arch/arm/mach-s3c24xx/Kconfig
··· 117 117 Compile in platform device definition for Samsung TouchScreen. 118 118 119 119 config S3C24XX_DMA 120 - bool "S3C2410 DMA support" 120 + bool "S3C2410 DMA support (deprecated)" 121 121 select S3C_DMA 122 122 help 123 123 S3C2410 DMA support. This is needed for drivers like sound which
+2 -2
arch/arm/mach-s3c64xx/Kconfig
··· 18 18 Enable S3C6410 CPU support 19 19 20 20 config S3C64XX_PL080 21 - bool "S3C64XX DMA using generic PL08x driver" 21 + def_bool DMADEVICES 22 + select ARM_AMBA 22 23 select AMBA_PL08X 23 - select SAMSUNG_DMADEV 24 24 25 25 config S3C64XX_SETUP_SDHCI 26 26 bool
+4 -2
arch/arm/mach-s5p64x0/Kconfig
··· 9 9 10 10 config CPU_S5P6440 11 11 bool 12 + select ARM_AMBA 13 + select PL330_DMA if DMADEVICES 12 14 select S5P_SLEEP if PM 13 - select SAMSUNG_DMADEV 14 15 select SAMSUNG_WAKEMASK if PM 15 16 help 16 17 Enable S5P6440 CPU support 17 18 18 19 config CPU_S5P6450 19 20 bool 21 + select ARM_AMBA 22 + select PL330_DMA if DMADEVICES 20 23 select S5P_SLEEP if PM 21 - select SAMSUNG_DMADEV 22 24 select SAMSUNG_WAKEMASK if PM 23 25 help 24 26 Enable S5P6450 CPU support
+2 -1
arch/arm/mach-s5pc100/Kconfig
··· 9 9 10 10 config CPU_S5PC100 11 11 bool 12 + select ARM_AMBA 13 + select PL330_DMA if DMADEVICES 12 14 select S5P_EXT_INT 13 - select SAMSUNG_DMADEV 14 15 help 15 16 Enable S5PC100 CPU support 16 17
+2 -1
arch/arm/mach-s5pv210/Kconfig
··· 11 11 12 12 config CPU_S5PV210 13 13 bool 14 + select ARM_AMBA 15 + select PL330_DMA if DMADEVICES 14 16 select S5P_EXT_INT 15 17 select S5P_PM if PM 16 18 select S5P_SLEEP if PM 17 - select SAMSUNG_DMADEV 18 19 help 19 20 Enable S5PV210 CPU support 20 21
+2 -4
arch/arm/mach-shmobile/Kconfig
··· 1 1 config ARCH_SHMOBILE 2 2 bool 3 3 4 - config ARCH_SHMOBILE_MULTI 4 + menuconfig ARCH_SHMOBILE_MULTI 5 5 bool "Renesas ARM SoCs" if ARCH_MULTI_V7 6 6 depends on MMU 7 7 select ARCH_SHMOBILE ··· 15 15 16 16 if ARCH_SHMOBILE_MULTI 17 17 18 - comment "Renesas ARM SoCs System Type" 18 + #comment "Renesas ARM SoCs System Type" 19 19 20 20 config ARCH_EMEV2 21 21 bool "Emma Mobile EV2" ··· 85 85 select CPU_V7 86 86 select SH_CLK_CPG 87 87 select RENESAS_IRQC 88 - select ARCH_HAS_CPUFREQ 89 88 select ARCH_HAS_OPP 90 89 select SYS_SUPPORTS_SH_CMT 91 90 select SYS_SUPPORTS_SH_TMU ··· 263 264 config MACH_KZM9G 264 265 bool "KZM-A9-GT board" 265 266 depends on ARCH_SH73A0 266 - select ARCH_HAS_CPUFREQ 267 267 select ARCH_HAS_OPP 268 268 select ARCH_REQUIRE_GPIOLIB 269 269 select REGULATOR_FIXED_VOLTAGE if REGULATOR
-1
arch/arm/mach-spear/Kconfig
··· 14 14 config ARCH_SPEAR13XX 15 15 bool "ST SPEAr13xx" 16 16 depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE 17 - select ARCH_HAS_CPUFREQ 18 17 select ARM_GIC 19 18 select GPIO_SPEAR_SPICS 20 19 select HAVE_ARM_SCU if SMP
+1 -1
arch/arm/mach-sti/Kconfig
··· 1 1 menuconfig ARCH_STI 2 - bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7 2 + bool "STMicroelectronics Consumer Electronics SOCs" if ARCH_MULTI_V7 3 3 select ARM_GIC 4 4 select ARM_GLOBAL_TIMER 5 5 select PINCTRL
+3 -5
arch/arm/mach-tegra/Kconfig
··· 1 - config ARCH_TEGRA 1 + menuconfig ARCH_TEGRA 2 2 bool "NVIDIA Tegra" if ARCH_MULTI_V7 3 - select ARCH_HAS_CPUFREQ 4 3 select ARCH_REQUIRE_GPIOLIB 5 4 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 6 5 select ARM_GIC ··· 15 16 help 16 17 This enables support for NVIDIA Tegra based systems. 17 18 18 - menu "NVIDIA Tegra options" 19 - depends on ARCH_TEGRA 19 + if ARCH_TEGRA 20 20 21 21 config ARCH_TEGRA_2x_SOC 22 22 bool "Enable support for Tegra20 family" ··· 67 69 which controls AHB bus master arbitration and some 68 70 performance parameters(priority, prefech size). 69 71 70 - endmenu 72 + endif
+1 -5
arch/arm/mach-u300/Kconfig
··· 1 - config ARCH_U300 1 + menuconfig ARCH_U300 2 2 bool "ST-Ericsson U300 Series" if ARCH_MULTI_V5 3 3 depends on MMU 4 4 select ARCH_REQUIRE_GPIOLIB ··· 15 15 Support for ST-Ericsson U300 series mobile platforms. 16 16 17 17 if ARCH_U300 18 - 19 - menu "ST-Ericsson AB U300/U335 Platform" 20 18 21 19 config MACH_U300 22 20 depends on ARCH_U300 ··· 40 42 to test reference designs. If you're not testing SPI, 41 43 you don't need it. Selecting this will activate the 42 44 SPI framework and ARM PL022 support. 43 - 44 - endmenu 45 45 46 46 endif
+1 -6
arch/arm/mach-ux500/Kconfig
··· 1 - config ARCH_U8500 1 + menuconfig ARCH_U8500 2 2 bool "ST-Ericsson U8500 Series" if ARCH_MULTI_V7 3 3 depends on MMU 4 4 select AB8500_CORE 5 5 select ABX500_CORE 6 - select ARCH_HAS_CPUFREQ 7 6 select ARCH_REQUIRE_GPIOLIB 8 7 select ARM_AMBA 9 8 select ARM_ERRATA_754322 ··· 32 33 select PINCTRL_AB8540 33 34 select REGULATOR 34 35 select REGULATOR_DB8500_PRCMU 35 - 36 - menu "Ux500 target platform (boards)" 37 36 38 37 config MACH_MOP500 39 38 bool "U8500 Development platform, MOP500 versions" ··· 64 67 At least one platform needs to be selected in order to build 65 68 a working kernel. If everything else is disabled, this 66 69 automatically enables MACH_MOP500. 67 - 68 - endmenu 69 70 70 71 config UX500_DEBUG_UART 71 72 int "Ux500 UART to use for low-level debug"
+3 -5
arch/arm/mach-vexpress/Kconfig
··· 1 - config ARCH_VEXPRESS 1 + menuconfig ARCH_VEXPRESS 2 2 bool "ARM Ltd. Versatile Express family" if ARCH_MULTI_V7 3 3 select ARCH_REQUIRE_GPIOLIB 4 4 select ARCH_SUPPORTS_BIG_ENDIAN ··· 37 37 platforms. The traditional (ATAGs) boot method is not usable on 38 38 these boards with this option. 39 39 40 - menu "Versatile Express platform type" 41 - depends on ARCH_VEXPRESS 40 + if ARCH_VEXPRESS 42 41 43 42 config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA 44 43 bool "Enable A5 and A9 only errata work-arounds" ··· 64 65 65 66 config ARCH_VEXPRESS_SPC 66 67 bool "Versatile Express Serial Power Controller (SPC)" 67 - select ARCH_HAS_CPUFREQ 68 68 select ARCH_HAS_OPP 69 69 select PM_OPP 70 70 help ··· 81 83 Support for CPU and cluster power management on Versatile Express 82 84 with a TC2 (A15x2 A7x3) big.LITTLE core tile. 83 85 84 - endmenu 86 + endif
-1
arch/arm/mach-vt8500/Kconfig
··· 1 1 config ARCH_VT8500 2 2 bool 3 - select ARCH_HAS_CPUFREQ 4 3 select ARCH_REQUIRE_GPIOLIB 5 4 select CLKDEV_LOOKUP 6 5 select VT8500_TIMER
-1
arch/arm/mach-zynq/Kconfig
··· 1 1 config ARCH_ZYNQ 2 2 bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 3 - select ARCH_HAS_CPUFREQ 4 3 select ARCH_HAS_OPP 5 4 select ARCH_SUPPORTS_BIG_ENDIAN 6 5 select ARM_AMBA
+8 -20
arch/arm/plat-samsung/Kconfig
··· 35 35 Base platform power management code for samsung code 36 36 37 37 if PLAT_SAMSUNG 38 + menu "Samsung Common options" 38 39 39 40 # boot configurations 40 41 41 42 comment "Boot options" 42 43 43 - config S3C_BOOT_ERROR_RESET 44 - bool "S3C Reboot on decompression error" 45 - help 46 - Say y here to use the watchdog to reset the system if the 47 - kernel decompressor detects an error during decompression. 48 - 49 - config S3C_BOOT_UART_FORCE_FIFO 50 - bool "Force UART FIFO on during boot process" 51 - default y 52 - help 53 - Say Y here to force the UART FIFOs on during the kernel 54 - uncompressor 55 - 56 - 57 44 config S3C_LOWLEVEL_UART_PORT 58 45 int "S3C UART to use for low-level messages" 46 + depends on ARCH_S3C64XX 59 47 default 0 60 48 help 61 49 Choice of which UART port to use for the low-level messages, ··· 395 407 Include legacy GPIO power management code for platforms not using 396 408 pinctrl-samsung driver. 397 409 398 - endif 399 - 400 410 config SAMSUNG_DMADEV 401 - bool 402 - select ARM_AMBA 411 + bool "Use legacy Samsung DMA abstraction" 412 + depends on CPU_S5PV210 || CPU_S5PC100 || ARCH_S5P64X0 || ARCH_S3C64XX 403 413 select DMADEVICES 404 - select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \ 405 - CPU_S5P6450 || CPU_S5P6440) 414 + default y 406 415 help 407 416 Use DMA device engine for PL330 DMAC. 417 + 418 + endif 408 419 409 420 config S5P_DEV_MFC 410 421 bool ··· 490 503 default "2" if DEBUG_S3C_UART2 491 504 default "3" if DEBUG_S3C_UART3 492 505 506 + endmenu 493 507 endif
+2 -1
arch/arm64/Kconfig
··· 1 1 config ARM64 2 2 def_bool y 3 3 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 4 - select ARCH_USE_CMPXCHG_LOCKREF 4 + select ARCH_HAS_OPP 5 5 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST 6 + select ARCH_USE_CMPXCHG_LOCKREF 6 7 select ARCH_WANT_OPTIONAL_GPIOLIB 7 8 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 8 9 select ARCH_WANT_FRAME_POINTERS
+4
arch/arm64/boot/dts/apm-mustang.dts
··· 24 24 reg = < 0x1 0x00000000 0x0 0x80000000 >; /* Updated by bootloader */ 25 25 }; 26 26 }; 27 + 28 + &serial0 { 29 + status = "ok"; 30 + };
+35 -1
arch/arm64/boot/dts/apm-storm.dtsi
··· 273 273 }; 274 274 275 275 serial0: serial@1c020000 { 276 + status = "disabled"; 276 277 device_type = "serial"; 277 - compatible = "ns16550"; 278 + compatible = "ns16550a"; 278 279 reg = <0 0x1c020000 0x0 0x1000>; 279 280 reg-shift = <2>; 280 281 clock-frequency = <10000000>; /* Updated by bootloader */ 281 282 interrupt-parent = <&gic>; 282 283 interrupts = <0x0 0x4c 0x4>; 284 + }; 285 + 286 + serial1: serial@1c021000 { 287 + status = "disabled"; 288 + device_type = "serial"; 289 + compatible = "ns16550a"; 290 + reg = <0 0x1c021000 0x0 0x1000>; 291 + reg-shift = <2>; 292 + clock-frequency = <10000000>; /* Updated by bootloader */ 293 + interrupt-parent = <&gic>; 294 + interrupts = <0x0 0x4d 0x4>; 295 + }; 296 + 297 + serial2: serial@1c022000 { 298 + status = "disabled"; 299 + device_type = "serial"; 300 + compatible = "ns16550a"; 301 + reg = <0 0x1c022000 0x0 0x1000>; 302 + reg-shift = <2>; 303 + clock-frequency = <10000000>; /* Updated by bootloader */ 304 + interrupt-parent = <&gic>; 305 + interrupts = <0x0 0x4e 0x4>; 306 + }; 307 + 308 + serial3: serial@1c023000 { 309 + status = "disabled"; 310 + device_type = "serial"; 311 + compatible = "ns16550a"; 312 + reg = <0 0x1c023000 0x0 0x1000>; 313 + reg-shift = <2>; 314 + clock-frequency = <10000000>; /* Updated by bootloader */ 315 + interrupt-parent = <&gic>; 316 + interrupts = <0x0 0x4f 0x4>; 283 317 }; 284 318 285 319 phy1: phy@1f21a000 {
+15
arch/arm64/configs/defconfig
··· 6 6 CONFIG_HIGH_RES_TIMERS=y 7 7 CONFIG_BSD_PROCESS_ACCT=y 8 8 CONFIG_BSD_PROCESS_ACCT_V3=y 9 + CONFIG_TASKSTATS=y 10 + CONFIG_TASK_DELAY_ACCT=y 11 + CONFIG_TASK_XACCT=y 12 + CONFIG_TASK_IO_ACCOUNTING=y 9 13 CONFIG_IKCONFIG=y 10 14 CONFIG_IKCONFIG_PROC=y 11 15 CONFIG_LOG_BUF_SHIFT=14 16 + CONFIG_RESOURCE_COUNTERS=y 17 + CONFIG_MEMCG=y 18 + CONFIG_MEMCG_SWAP=y 19 + CONFIG_MEMCG_KMEM=y 20 + CONFIG_CGROUP_HUGETLB=y 12 21 # CONFIG_UTS_NS is not set 13 22 # CONFIG_IPC_NS is not set 14 23 # CONFIG_PID_NS is not set ··· 36 27 CONFIG_ARCH_XGENE=y 37 28 CONFIG_SMP=y 38 29 CONFIG_PREEMPT=y 30 + CONFIG_KSM=y 39 31 CONFIG_TRANSPARENT_HUGEPAGE=y 40 32 CONFIG_CMA=y 41 33 CONFIG_CMDLINE="console=ttyAMA0" ··· 55 45 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 56 46 CONFIG_DEVTMPFS=y 57 47 CONFIG_DMA_CMA=y 48 + CONFIG_BLK_DEV_LOOP=y 58 49 CONFIG_VIRTIO_BLK=y 59 50 # CONFIG_SCSI_PROC_FS is not set 60 51 CONFIG_BLK_DEV_SD=y ··· 64 53 CONFIG_PATA_PLATFORM=y 65 54 CONFIG_PATA_OF_PLATFORM=y 66 55 CONFIG_NETDEVICES=y 56 + CONFIG_TUN=y 67 57 CONFIG_SMC91X=y 68 58 CONFIG_SMSC911X=y 69 59 # CONFIG_WLAN is not set ··· 97 85 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 98 86 # CONFIG_EXT3_FS_XATTR is not set 99 87 CONFIG_EXT4_FS=y 88 + CONFIG_FANOTIFY=y 89 + CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y 100 90 CONFIG_FUSE_FS=y 101 91 CONFIG_CUSE=y 102 92 CONFIG_VFAT_FS=y ··· 118 104 CONFIG_LOCKUP_DETECTOR=y 119 105 # CONFIG_SCHED_DEBUG is not set 120 106 # CONFIG_FTRACE is not set 107 + CONFIG_SECURITY=y 121 108 CONFIG_CRYPTO_ANSI_CPRNG=y 122 109 CONFIG_ARM64_CRYPTO=y 123 110 CONFIG_CRYPTO_SHA1_ARM64_CE=y
+40 -56
arch/arm64/crypto/ghash-ce-core.S
··· 3 3 * 4 4 * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> 5 5 * 6 - * Based on arch/x86/crypto/ghash-pmullni-intel_asm.S 7 - * 8 - * Copyright (c) 2009 Intel Corp. 9 - * Author: Huang Ying <ying.huang@intel.com> 10 - * Vinodh Gopal 11 - * Erdinc Ozturk 12 - * Deniz Karakoyunlu 13 - * 14 6 * This program is free software; you can redistribute it and/or modify it 15 7 * under the terms of the GNU General Public License version 2 as published 16 8 * by the Free Software Foundation. ··· 11 19 #include <linux/linkage.h> 12 20 #include <asm/assembler.h> 13 21 14 - DATA .req v0 15 - SHASH .req v1 16 - IN1 .req v2 22 + SHASH .req v0 23 + SHASH2 .req v1 17 24 T1 .req v2 18 25 T2 .req v3 19 - T3 .req v4 20 - VZR .req v5 26 + MASK .req v4 27 + XL .req v5 28 + XM .req v6 29 + XH .req v7 30 + IN1 .req v7 21 31 22 32 .text 23 33 .arch armv8-a+crypto ··· 29 35 * struct ghash_key const *k, const char *head) 30 36 */ 31 37 ENTRY(pmull_ghash_update) 32 - ld1 {DATA.16b}, [x1] 33 38 ld1 {SHASH.16b}, [x3] 34 - eor VZR.16b, VZR.16b, VZR.16b 39 + ld1 {XL.16b}, [x1] 40 + movi MASK.16b, #0xe1 41 + ext SHASH2.16b, SHASH.16b, SHASH.16b, #8 42 + shl MASK.2d, MASK.2d, #57 43 + eor SHASH2.16b, SHASH2.16b, SHASH.16b 35 44 36 45 /* do the head block first, if supplied */ 37 46 cbz x4, 0f 38 - ld1 {IN1.2d}, [x4] 47 + ld1 {T1.2d}, [x4] 39 48 b 1f 40 49 41 - 0: ld1 {IN1.2d}, [x2], #16 50 + 0: ld1 {T1.2d}, [x2], #16 42 51 sub w0, w0, #1 43 - 1: ext IN1.16b, IN1.16b, IN1.16b, #8 44 - CPU_LE( rev64 IN1.16b, IN1.16b ) 45 - eor DATA.16b, DATA.16b, IN1.16b 46 52 47 - /* multiply DATA by SHASH in GF(2^128) */ 48 - ext T2.16b, DATA.16b, DATA.16b, #8 49 - ext T3.16b, SHASH.16b, SHASH.16b, #8 50 - eor T2.16b, T2.16b, DATA.16b 51 - eor T3.16b, T3.16b, SHASH.16b 53 + 1: /* multiply XL by SHASH in GF(2^128) */ 54 + CPU_LE( rev64 T1.16b, T1.16b ) 52 55 53 - pmull2 T1.1q, SHASH.2d, DATA.2d // a1 * b1 54 - pmull DATA.1q, SHASH.1d, DATA.1d // a0 * b0 55 - pmull T2.1q, T2.1d, T3.1d // (a1 + a0)(b1 + b0) 56 - eor T2.16b, T2.16b, T1.16b // (a0 * b1) + (a1 * b0) 57 - eor T2.16b, T2.16b, DATA.16b 58 - 59 - ext T3.16b, VZR.16b, T2.16b, #8 60 - ext T2.16b, T2.16b, VZR.16b, #8 61 - eor DATA.16b, DATA.16b, T3.16b 62 - eor T1.16b, T1.16b, T2.16b // <T1:DATA> is result of 63 - // carry-less multiplication 64 - 65 - /* first phase of the reduction */ 66 - shl T3.2d, DATA.2d, #1 67 - eor T3.16b, T3.16b, DATA.16b 68 - shl T3.2d, T3.2d, #5 69 - eor T3.16b, T3.16b, DATA.16b 70 - shl T3.2d, T3.2d, #57 71 - ext T2.16b, VZR.16b, T3.16b, #8 72 - ext T3.16b, T3.16b, VZR.16b, #8 73 - eor DATA.16b, DATA.16b, T2.16b 74 - eor T1.16b, T1.16b, T3.16b 75 - 76 - /* second phase of the reduction */ 77 - ushr T2.2d, DATA.2d, #5 78 - eor T2.16b, T2.16b, DATA.16b 79 - ushr T2.2d, T2.2d, #1 80 - eor T2.16b, T2.16b, DATA.16b 81 - ushr T2.2d, T2.2d, #1 56 + ext T2.16b, XL.16b, XL.16b, #8 57 + ext IN1.16b, T1.16b, T1.16b, #8 82 58 eor T1.16b, T1.16b, T2.16b 83 - eor DATA.16b, DATA.16b, T1.16b 59 + eor XL.16b, XL.16b, IN1.16b 60 + 61 + pmull2 XH.1q, SHASH.2d, XL.2d // a1 * b1 62 + eor T1.16b, T1.16b, XL.16b 63 + pmull XL.1q, SHASH.1d, XL.1d // a0 * b0 64 + pmull XM.1q, SHASH2.1d, T1.1d // (a1 + a0)(b1 + b0) 65 + 66 + ext T1.16b, XL.16b, XH.16b, #8 67 + eor T2.16b, XL.16b, XH.16b 68 + eor XM.16b, XM.16b, T1.16b 69 + eor XM.16b, XM.16b, T2.16b 70 + pmull T2.1q, XL.1d, MASK.1d 71 + 72 + mov XH.d[0], XM.d[1] 73 + mov XM.d[1], XL.d[0] 74 + 75 + eor XL.16b, XM.16b, T2.16b 76 + ext T2.16b, XL.16b, XL.16b, #8 77 + pmull XL.1q, XL.1d, MASK.1d 78 + eor T2.16b, T2.16b, XH.16b 79 + eor XL.16b, XL.16b, T2.16b 84 80 85 81 cbnz w0, 0b 86 82 87 - st1 {DATA.16b}, [x1] 83 + st1 {XL.16b}, [x1] 88 84 ret 89 85 ENDPROC(pmull_ghash_update)
+3 -2
arch/arm64/crypto/ghash-ce-glue.c
··· 67 67 blocks = len / GHASH_BLOCK_SIZE; 68 68 len %= GHASH_BLOCK_SIZE; 69 69 70 - kernel_neon_begin_partial(6); 70 + kernel_neon_begin_partial(8); 71 71 pmull_ghash_update(blocks, ctx->digest, src, key, 72 72 partial ? ctx->buf : NULL); 73 73 kernel_neon_end(); 74 74 src += blocks * GHASH_BLOCK_SIZE; 75 + partial = 0; 75 76 } 76 77 if (len) 77 78 memcpy(ctx->buf + partial, src, len); ··· 89 88 90 89 memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial); 91 90 92 - kernel_neon_begin_partial(6); 91 + kernel_neon_begin_partial(8); 93 92 pmull_ghash_update(1, ctx->digest, ctx->buf, key, NULL); 94 93 kernel_neon_end(); 95 94 }
-1
arch/arm64/include/asm/Kbuild
··· 30 30 generic-y += mutex.h 31 31 generic-y += pci.h 32 32 generic-y += poll.h 33 - generic-y += posix_types.h 34 33 generic-y += preempt.h 35 34 generic-y += resource.h 36 35 generic-y += rwsem.h
-2
arch/arm64/include/asm/dma-mapping.h
··· 26 26 #include <xen/xen.h> 27 27 #include <asm/xen/hypervisor.h> 28 28 29 - #define ARCH_HAS_DMA_GET_REQUIRED_MASK 30 - 31 29 #define DMA_ERROR_CODE (~(dma_addr_t)0) 32 30 extern struct dma_map_ops *dma_ops; 33 31 extern struct dma_map_ops coherent_swiotlb_dma_ops;
+1 -1
arch/arm64/include/asm/pgtable.h
··· 246 246 #define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) 247 247 #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) 248 248 #define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) 249 - #define pmd_mknotpresent(pmd) (__pmd(pmd_val(pmd) &= ~PMD_TYPE_MASK)) 249 + #define pmd_mknotpresent(pmd) (__pmd(pmd_val(pmd) & ~PMD_TYPE_MASK)) 250 250 251 251 #define __HAVE_ARCH_PMD_WRITE 252 252 #define pmd_write(pmd) pte_write(pmd_pte(pmd))
+10
arch/arm64/include/uapi/asm/posix_types.h
··· 1 + #ifndef __ASM_POSIX_TYPES_H 2 + #define __ASM_POSIX_TYPES_H 3 + 4 + typedef unsigned short __kernel_old_uid_t; 5 + typedef unsigned short __kernel_old_gid_t; 6 + #define __kernel_old_uid_t __kernel_old_uid_t 7 + 8 + #include <asm-generic/posix_types.h> 9 + 10 + #endif /* __ASM_POSIX_TYPES_H */
+1 -1
arch/arm64/include/uapi/asm/sigcontext.h
··· 58 58 59 59 struct esr_context { 60 60 struct _aarch64_ctx head; 61 - u64 esr; 61 + __u64 esr; 62 62 }; 63 63 64 64 #endif /* _UAPI__ASM_SIGCONTEXT_H */
+1 -1
arch/arm64/kernel/entry-ftrace.S
··· 205 205 * 206 206 * Run ftrace_return_to_handler() before going back to parent. 207 207 * @fp is checked against the value passed by ftrace_graph_caller() 208 - * only when CONFIG_FUNCTION_GRAPH_FP_TEST is enabled. 208 + * only when CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST is enabled. 209 209 */ 210 210 ENTRY(return_to_handler) 211 211 str x0, [sp, #-16]!
-1
arch/arm64/kernel/entry.S
··· 279 279 */ 280 280 mrs x0, far_el1 281 281 enable_dbg 282 - mov x1, x25 283 282 mov x2, sp 284 283 b do_sp_pc_abort 285 284 el1_undef:
+22 -8
arch/arm64/kernel/ptrace.c
··· 655 655 reg = task_pt_regs(target)->regs[idx]; 656 656 } 657 657 658 - ret = copy_to_user(ubuf, &reg, sizeof(reg)); 659 - if (ret) 660 - break; 658 + if (kbuf) { 659 + memcpy(kbuf, &reg, sizeof(reg)); 660 + kbuf += sizeof(reg); 661 + } else { 662 + ret = copy_to_user(ubuf, &reg, sizeof(reg)); 663 + if (ret) 664 + break; 661 665 662 - ubuf += sizeof(reg); 666 + ubuf += sizeof(reg); 667 + } 663 668 } 664 669 665 670 return ret; ··· 694 689 unsigned int idx = start + i; 695 690 compat_ulong_t reg; 696 691 697 - ret = copy_from_user(&reg, ubuf, sizeof(reg)); 698 - if (ret) 699 - return ret; 692 + if (kbuf) { 693 + memcpy(&reg, kbuf, sizeof(reg)); 694 + kbuf += sizeof(reg); 695 + } else { 696 + ret = copy_from_user(&reg, ubuf, sizeof(reg)); 697 + if (ret) 698 + return ret; 700 699 701 - ubuf += sizeof(reg); 700 + ubuf += sizeof(reg); 701 + } 702 702 703 703 switch (idx) { 704 704 case 15: ··· 837 827 compat_ulong_t val) 838 828 { 839 829 int ret; 830 + mm_segment_t old_fs = get_fs(); 840 831 841 832 if (off & 3 || off >= COMPAT_USER_SZ) 842 833 return -EIO; ··· 845 834 if (off >= sizeof(compat_elf_gregset_t)) 846 835 return 0; 847 836 837 + set_fs(KERNEL_DS); 848 838 ret = copy_regset_from_user(tsk, &user_aarch32_view, 849 839 REGSET_COMPAT_GPR, off, 850 840 sizeof(compat_ulong_t), 851 841 &val); 842 + set_fs(old_fs); 843 + 852 844 return ret; 853 845 } 854 846
+8 -2
arch/arm64/mm/init.c
··· 71 71 /* 4GB maximum for 32-bit only capable devices */ 72 72 if (IS_ENABLED(CONFIG_ZONE_DMA)) { 73 73 unsigned long max_dma_phys = 74 - (unsigned long)dma_to_phys(NULL, DMA_BIT_MASK(32) + 1); 74 + (unsigned long)(dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1); 75 75 max_dma = max(min, min(max, max_dma_phys >> PAGE_SHIFT)); 76 76 zone_size[ZONE_DMA] = max_dma - min; 77 77 } ··· 126 126 127 127 void __init arm64_memblock_init(void) 128 128 { 129 + phys_addr_t dma_phys_limit = 0; 130 + 129 131 /* Register the kernel text, kernel data and initrd with memblock */ 130 132 memblock_reserve(__pa(_text), _end - _text); 131 133 #ifdef CONFIG_BLK_DEV_INITRD ··· 143 141 memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); 144 142 145 143 early_init_fdt_scan_reserved_mem(); 146 - dma_contiguous_reserve(0); 144 + 145 + /* 4GB maximum for 32-bit only capable devices */ 146 + if (IS_ENABLED(CONFIG_ZONE_DMA)) 147 + dma_phys_limit = dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1; 148 + dma_contiguous_reserve(dma_phys_limit); 147 149 148 150 memblock_allow_resize(); 149 151 memblock_dump_all();
+37 -27
arch/ia64/hp/common/sba_iommu.c
··· 242 242 struct pci_dev *sac_only_dev; 243 243 }; 244 244 245 - static struct ioc *ioc_list; 245 + static struct ioc *ioc_list, *ioc_found; 246 246 static int reserve_sba_gart = 1; 247 247 248 248 static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t); ··· 1809 1809 { SX2000_IOC_ID, "sx2000", NULL }, 1810 1810 }; 1811 1811 1812 - static struct ioc * 1813 - ioc_init(unsigned long hpa, void *handle) 1812 + static void ioc_init(unsigned long hpa, struct ioc *ioc) 1814 1813 { 1815 - struct ioc *ioc; 1816 1814 struct ioc_iommu *info; 1817 - 1818 - ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); 1819 - if (!ioc) 1820 - return NULL; 1821 1815 1822 1816 ioc->next = ioc_list; 1823 1817 ioc_list = ioc; 1824 1818 1825 - ioc->handle = handle; 1826 1819 ioc->ioc_hpa = ioremap(hpa, 0x1000); 1827 1820 1828 1821 ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID); ··· 1856 1863 "%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n", 1857 1864 ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF, 1858 1865 hpa, ioc->iov_size >> 20, ioc->ibase); 1859 - 1860 - return ioc; 1861 1866 } 1862 1867 1863 1868 ··· 2022 2031 #endif 2023 2032 } 2024 2033 2025 - static int 2026 - acpi_sba_ioc_add(struct acpi_device *device, 2027 - const struct acpi_device_id *not_used) 2034 + static void acpi_sba_ioc_add(struct ioc *ioc) 2028 2035 { 2029 - struct ioc *ioc; 2036 + acpi_handle handle = ioc->handle; 2030 2037 acpi_status status; 2031 2038 u64 hpa, length; 2032 2039 struct acpi_device_info *adi; 2033 2040 2034 - status = hp_acpi_csr_space(device->handle, &hpa, &length); 2041 + ioc_found = ioc->next; 2042 + status = hp_acpi_csr_space(handle, &hpa, &length); 2035 2043 if (ACPI_FAILURE(status)) 2036 - return 1; 2044 + goto err; 2037 2045 2038 - status = acpi_get_object_info(device->handle, &adi); 2046 + status = acpi_get_object_info(handle, &adi); 2039 2047 if (ACPI_FAILURE(status)) 2040 - return 1; 2048 + goto err; 2041 2049 2042 2050 /* 2043 2051 * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI ··· 2057 2067 if (!iovp_shift) 2058 2068 iovp_shift = 12; 2059 2069 2060 - ioc = ioc_init(hpa, device->handle); 2061 - if (!ioc) 2062 - return 1; 2063 - 2070 + ioc_init(hpa, ioc); 2064 2071 /* setup NUMA node association */ 2065 - sba_map_ioc_to_node(ioc, device->handle); 2066 - return 0; 2072 + sba_map_ioc_to_node(ioc, handle); 2073 + return; 2074 + 2075 + err: 2076 + kfree(ioc); 2067 2077 } 2068 2078 2069 2079 static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { ··· 2071 2081 {"HWP0004", 0}, 2072 2082 {"", 0}, 2073 2083 }; 2084 + 2085 + static int acpi_sba_ioc_attach(struct acpi_device *device, 2086 + const struct acpi_device_id *not_used) 2087 + { 2088 + struct ioc *ioc; 2089 + 2090 + ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); 2091 + if (!ioc) 2092 + return -ENOMEM; 2093 + 2094 + ioc->next = ioc_found; 2095 + ioc_found = ioc; 2096 + ioc->handle = device->handle; 2097 + return 1; 2098 + } 2099 + 2100 + 2074 2101 static struct acpi_scan_handler acpi_sba_ioc_handler = { 2075 2102 .ids = hp_ioc_iommu_device_ids, 2076 - .attach = acpi_sba_ioc_add, 2103 + .attach = acpi_sba_ioc_attach, 2077 2104 }; 2078 2105 2079 2106 static int __init acpi_sba_ioc_init_acpi(void) ··· 2125 2118 #endif 2126 2119 2127 2120 /* 2128 - * ioc_list should be populated by the acpi_sba_ioc_handler's .attach() 2121 + * ioc_found should be populated by the acpi_sba_ioc_handler's .attach() 2129 2122 * routine, but that only happens if acpi_scan_init() has already run. 2130 2123 */ 2124 + while (ioc_found) 2125 + acpi_sba_ioc_add(ioc_found); 2126 + 2131 2127 if (!ioc_list) { 2132 2128 #ifdef CONFIG_IA64_GENERIC 2133 2129 /*
+3 -2
arch/s390/configs/default_defconfig
··· 45 45 CONFIG_UNIXWARE_DISKLABEL=y 46 46 CONFIG_CFQ_GROUP_IOSCHED=y 47 47 CONFIG_DEFAULT_DEADLINE=y 48 - CONFIG_MARCH_Z9_109=y 48 + CONFIG_MARCH_Z196=y 49 + CONFIG_TUNE_ZEC12=y 49 50 CONFIG_NR_CPUS=256 50 51 CONFIG_PREEMPT=y 51 52 CONFIG_HZ_100=y ··· 241 240 CONFIG_NF_CONNTRACK_IPV4=m 242 241 # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set 243 242 CONFIG_NF_TABLES_IPV4=m 244 - CONFIG_NFT_REJECT_IPV4=m 245 243 CONFIG_NFT_CHAIN_ROUTE_IPV4=m 246 244 CONFIG_NFT_CHAIN_NAT_IPV4=m 247 245 CONFIG_NF_TABLES_ARP=m ··· 456 456 CONFIG_WATCHDOG=y 457 457 CONFIG_WATCHDOG_NOWAYOUT=y 458 458 CONFIG_SOFT_WATCHDOG=m 459 + CONFIG_DIAG288_WATCHDOG=m 459 460 # CONFIG_HID is not set 460 461 # CONFIG_USB_SUPPORT is not set 461 462 CONFIG_INFINIBAND=m
+3 -2
arch/s390/configs/gcov_defconfig
··· 45 45 CONFIG_UNIXWARE_DISKLABEL=y 46 46 CONFIG_CFQ_GROUP_IOSCHED=y 47 47 CONFIG_DEFAULT_DEADLINE=y 48 - CONFIG_MARCH_Z9_109=y 48 + CONFIG_MARCH_Z196=y 49 + CONFIG_TUNE_ZEC12=y 49 50 CONFIG_NR_CPUS=256 50 51 CONFIG_HZ_100=y 51 52 CONFIG_MEMORY_HOTPLUG=y ··· 239 238 CONFIG_NF_CONNTRACK_IPV4=m 240 239 # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set 241 240 CONFIG_NF_TABLES_IPV4=m 242 - CONFIG_NFT_REJECT_IPV4=m 243 241 CONFIG_NFT_CHAIN_ROUTE_IPV4=m 244 242 CONFIG_NFT_CHAIN_NAT_IPV4=m 245 243 CONFIG_NF_TABLES_ARP=m ··· 453 453 CONFIG_WATCHDOG=y 454 454 CONFIG_WATCHDOG_NOWAYOUT=y 455 455 CONFIG_SOFT_WATCHDOG=m 456 + CONFIG_DIAG288_WATCHDOG=m 456 457 # CONFIG_HID is not set 457 458 # CONFIG_USB_SUPPORT is not set 458 459 CONFIG_INFINIBAND=m
+3 -2
arch/s390/configs/performance_defconfig
··· 43 43 CONFIG_UNIXWARE_DISKLABEL=y 44 44 CONFIG_CFQ_GROUP_IOSCHED=y 45 45 CONFIG_DEFAULT_DEADLINE=y 46 - CONFIG_MARCH_Z9_109=y 46 + CONFIG_MARCH_Z196=y 47 + CONFIG_TUNE_ZEC12=y 47 48 CONFIG_NR_CPUS=256 48 49 CONFIG_HZ_100=y 49 50 CONFIG_MEMORY_HOTPLUG=y ··· 237 236 CONFIG_NF_CONNTRACK_IPV4=m 238 237 # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set 239 238 CONFIG_NF_TABLES_IPV4=m 240 - CONFIG_NFT_REJECT_IPV4=m 241 239 CONFIG_NFT_CHAIN_ROUTE_IPV4=m 242 240 CONFIG_NFT_CHAIN_NAT_IPV4=m 243 241 CONFIG_NF_TABLES_ARP=m ··· 451 451 CONFIG_WATCHDOG=y 452 452 CONFIG_WATCHDOG_NOWAYOUT=y 453 453 CONFIG_SOFT_WATCHDOG=m 454 + CONFIG_DIAG288_WATCHDOG=m 454 455 # CONFIG_HID is not set 455 456 # CONFIG_USB_SUPPORT is not set 456 457 CONFIG_INFINIBAND=m
+2 -1
arch/s390/configs/zfcpdump_defconfig
··· 8 8 CONFIG_PARTITION_ADVANCED=y 9 9 CONFIG_IBM_PARTITION=y 10 10 CONFIG_DEFAULT_DEADLINE=y 11 - CONFIG_MARCH_Z9_109=y 11 + CONFIG_MARCH_Z196=y 12 + CONFIG_TUNE_ZEC12=y 12 13 # CONFIG_COMPAT is not set 13 14 CONFIG_NR_CPUS=2 14 15 # CONFIG_HOTPLUG_CPU is not set
+7 -1
arch/s390/defconfig
··· 135 135 CONFIG_LOCK_STAT=y 136 136 CONFIG_DEBUG_LOCKDEP=y 137 137 CONFIG_DEBUG_ATOMIC_SLEEP=y 138 - CONFIG_DEBUG_WRITECOUNT=y 139 138 CONFIG_DEBUG_LIST=y 139 + CONFIG_DEBUG_PI_LIST=y 140 140 CONFIG_DEBUG_SG=y 141 141 CONFIG_DEBUG_NOTIFIERS=y 142 142 CONFIG_PROVE_RCU=y ··· 199 199 CONFIG_CRYPTO_DES_S390=m 200 200 CONFIG_CRYPTO_AES_S390=m 201 201 CONFIG_CRC7=m 202 + # CONFIG_XZ_DEC_X86 is not set 203 + # CONFIG_XZ_DEC_POWERPC is not set 204 + # CONFIG_XZ_DEC_IA64 is not set 205 + # CONFIG_XZ_DEC_ARM is not set 206 + # CONFIG_XZ_DEC_ARMTHUMB is not set 207 + # CONFIG_XZ_DEC_SPARC is not set 202 208 CONFIG_CMM=m
+15 -16
arch/s390/include/asm/mmu_context.h
··· 33 33 34 34 static inline void set_user_asce(struct mm_struct *mm) 35 35 { 36 - pgd_t *pgd = mm->pgd; 37 - 38 - S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd); 39 - set_fs(current->thread.mm_segment); 36 + S390_lowcore.user_asce = mm->context.asce_bits | __pa(mm->pgd); 37 + if (current->thread.mm_segment.ar4) 38 + __ctl_load(S390_lowcore.user_asce, 7, 7); 40 39 set_cpu_flag(CIF_ASCE); 41 40 } 42 41 ··· 69 70 /* Clear old ASCE by loading the kernel ASCE. */ 70 71 __ctl_load(S390_lowcore.kernel_asce, 1, 1); 71 72 __ctl_load(S390_lowcore.kernel_asce, 7, 7); 72 - /* Delay loading of the new ASCE to control registers CR1 & CR7 */ 73 - set_cpu_flag(CIF_ASCE); 74 73 atomic_inc(&next->context.attach_count); 75 74 atomic_dec(&prev->context.attach_count); 76 75 if (MACHINE_HAS_TLB_LC) 77 76 cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask); 77 + S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd); 78 78 } 79 79 80 80 #define finish_arch_post_lock_switch finish_arch_post_lock_switch ··· 82 84 struct task_struct *tsk = current; 83 85 struct mm_struct *mm = tsk->mm; 84 86 85 - if (!mm) 86 - return; 87 - preempt_disable(); 88 - while (atomic_read(&mm->context.attach_count) >> 16) 89 - cpu_relax(); 87 + load_kernel_asce(); 88 + if (mm) { 89 + preempt_disable(); 90 + while (atomic_read(&mm->context.attach_count) >> 16) 91 + cpu_relax(); 90 92 91 - cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm)); 92 - set_user_asce(mm); 93 - if (mm->context.flush_mm) 94 - __tlb_flush_mm(mm); 95 - preempt_enable(); 93 + cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm)); 94 + if (mm->context.flush_mm) 95 + __tlb_flush_mm(mm); 96 + preempt_enable(); 97 + } 98 + set_fs(current->thread.mm_segment); 96 99 } 97 100 98 101 #define enter_lazy_tlb(mm,tsk) do { } while (0)
-4
arch/s390/include/asm/switch_to.h
··· 134 134 prev = __switch_to(prev,next); \ 135 135 } while (0) 136 136 137 - #define finish_arch_switch(prev) do { \ 138 - set_fs(current->thread.mm_segment); \ 139 - } while (0) 140 - 141 137 #endif /* __ASM_SWITCH_TO_H */
+6 -2
arch/s390/include/uapi/asm/ucontext.h
··· 16 16 struct ucontext *uc_link; 17 17 stack_t uc_stack; 18 18 _sigregs uc_mcontext; 19 - unsigned long uc_sigmask[2]; 19 + sigset_t uc_sigmask; 20 + /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ 21 + unsigned char __unused[128 - sizeof(sigset_t)]; 20 22 unsigned long uc_gprs_high[16]; 21 23 }; 22 24 ··· 29 27 struct ucontext *uc_link; 30 28 stack_t uc_stack; 31 29 _sigregs uc_mcontext; 32 - sigset_t uc_sigmask; /* mask last for extensibility */ 30 + sigset_t uc_sigmask; 31 + /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ 32 + unsigned char __unused[128 - sizeof(sigset_t)]; 33 33 }; 34 34 35 35 #endif /* !_ASM_S390_UCONTEXT_H */
+3 -1
arch/s390/kernel/compat_linux.h
··· 69 69 __u32 uc_link; /* pointer */ 70 70 compat_stack_t uc_stack; 71 71 _sigregs32 uc_mcontext; 72 - compat_sigset_t uc_sigmask; /* mask last for extensibility */ 72 + compat_sigset_t uc_sigmask; 73 + /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ 74 + unsigned char __unused[128 - sizeof(compat_sigset_t)]; 73 75 }; 74 76 75 77 struct stat64_emu31;
+3 -3
arch/sparc/crypto/aes_glue.c
··· 124 124 u64 *output, unsigned int len, 125 125 u64 *iv); 126 126 127 - struct aes_ops aes128_ops = { 127 + static struct aes_ops aes128_ops = { 128 128 .encrypt = aes_sparc64_encrypt_128, 129 129 .decrypt = aes_sparc64_decrypt_128, 130 130 .load_encrypt_keys = aes_sparc64_load_encrypt_keys_128, ··· 136 136 .ctr_crypt = aes_sparc64_ctr_crypt_128, 137 137 }; 138 138 139 - struct aes_ops aes192_ops = { 139 + static struct aes_ops aes192_ops = { 140 140 .encrypt = aes_sparc64_encrypt_192, 141 141 .decrypt = aes_sparc64_decrypt_192, 142 142 .load_encrypt_keys = aes_sparc64_load_encrypt_keys_192, ··· 148 148 .ctr_crypt = aes_sparc64_ctr_crypt_192, 149 149 }; 150 150 151 - struct aes_ops aes256_ops = { 151 + static struct aes_ops aes256_ops = { 152 152 .encrypt = aes_sparc64_encrypt_256, 153 153 .decrypt = aes_sparc64_decrypt_256, 154 154 .load_encrypt_keys = aes_sparc64_load_encrypt_keys_256,
+4 -4
arch/sparc/include/asm/atomic_32.h
··· 20 20 21 21 #define ATOMIC_INIT(i) { (i) } 22 22 23 - extern int __atomic_add_return(int, atomic_t *); 24 - extern int atomic_cmpxchg(atomic_t *, int, int); 23 + int __atomic_add_return(int, atomic_t *); 24 + int atomic_cmpxchg(atomic_t *, int, int); 25 25 #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 26 - extern int __atomic_add_unless(atomic_t *, int, int); 27 - extern void atomic_set(atomic_t *, int); 26 + int __atomic_add_unless(atomic_t *, int, int); 27 + void atomic_set(atomic_t *, int); 28 28 29 29 #define atomic_read(v) (*(volatile int *)&(v)->counter) 30 30
+9 -9
arch/sparc/include/asm/atomic_64.h
··· 20 20 #define atomic_set(v, i) (((v)->counter) = i) 21 21 #define atomic64_set(v, i) (((v)->counter) = i) 22 22 23 - extern void atomic_add(int, atomic_t *); 24 - extern void atomic64_add(long, atomic64_t *); 25 - extern void atomic_sub(int, atomic_t *); 26 - extern void atomic64_sub(long, atomic64_t *); 23 + void atomic_add(int, atomic_t *); 24 + void atomic64_add(long, atomic64_t *); 25 + void atomic_sub(int, atomic_t *); 26 + void atomic64_sub(long, atomic64_t *); 27 27 28 - extern int atomic_add_ret(int, atomic_t *); 29 - extern long atomic64_add_ret(long, atomic64_t *); 30 - extern int atomic_sub_ret(int, atomic_t *); 31 - extern long atomic64_sub_ret(long, atomic64_t *); 28 + int atomic_add_ret(int, atomic_t *); 29 + long atomic64_add_ret(long, atomic64_t *); 30 + int atomic_sub_ret(int, atomic_t *); 31 + long atomic64_sub_ret(long, atomic64_t *); 32 32 33 33 #define atomic_dec_return(v) atomic_sub_ret(1, v) 34 34 #define atomic64_dec_return(v) atomic64_sub_ret(1, v) ··· 107 107 108 108 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 109 109 110 - extern long atomic64_dec_if_positive(atomic64_t *v); 110 + long atomic64_dec_if_positive(atomic64_t *v); 111 111 112 112 #endif /* !(__ARCH_SPARC64_ATOMIC__) */
+7
arch/sparc/include/asm/auxio.h
··· 1 1 #ifndef ___ASM_SPARC_AUXIO_H 2 2 #define ___ASM_SPARC_AUXIO_H 3 + 4 + #ifndef __ASSEMBLY__ 5 + 6 + extern void __iomem *auxio_register; 7 + 8 + #endif /* ifndef __ASSEMBLY__ */ 9 + 3 10 #if defined(__sparc__) && defined(__arch64__) 4 11 #include <asm/auxio_64.h> 5 12 #else
+3 -3
arch/sparc/include/asm/auxio_32.h
··· 34 34 * NOTE: these routines are implementation dependent-- 35 35 * understand the hardware you are querying! 36 36 */ 37 - extern void set_auxio(unsigned char bits_on, unsigned char bits_off); 38 - extern unsigned char get_auxio(void); /* .../asm/floppy.h */ 37 + void set_auxio(unsigned char bits_on, unsigned char bits_off); 38 + unsigned char get_auxio(void); /* .../asm/floppy.h */ 39 39 40 40 /* 41 41 * The following routines are provided for driver-compatibility ··· 78 78 79 79 80 80 /* AUXIO2 (Power Off Control) */ 81 - extern __volatile__ unsigned char * auxio_power_register; 81 + extern volatile u8 __iomem *auxio_power_register; 82 82 83 83 #define AUXIO_POWER_DETECT_FAILURE 32 84 84 #define AUXIO_POWER_CLEAR_FAILURE 2
+2 -4
arch/sparc/include/asm/auxio_64.h
··· 75 75 76 76 #ifndef __ASSEMBLY__ 77 77 78 - extern void __iomem *auxio_register; 79 - 80 78 #define AUXIO_LTE_ON 1 81 79 #define AUXIO_LTE_OFF 0 82 80 ··· 82 84 * 83 85 * on - AUXIO_LTE_ON or AUXIO_LTE_OFF 84 86 */ 85 - extern void auxio_set_lte(int on); 87 + void auxio_set_lte(int on); 86 88 87 89 #define AUXIO_LED_ON 1 88 90 #define AUXIO_LED_OFF 0 ··· 91 93 * 92 94 * on - AUXIO_LED_ON or AUXIO_LED_OFF 93 95 */ 94 - extern void auxio_set_led(int on); 96 + void auxio_set_led(int on); 95 97 96 98 #endif /* ifndef __ASSEMBLY__ */ 97 99
+3 -3
arch/sparc/include/asm/bitext.h
··· 20 20 int num_colors; 21 21 }; 22 22 23 - extern int bit_map_string_get(struct bit_map *t, int len, int align); 24 - extern void bit_map_clear(struct bit_map *t, int offset, int len); 25 - extern void bit_map_init(struct bit_map *t, unsigned long *map, int size); 23 + int bit_map_string_get(struct bit_map *t, int len, int align); 24 + void bit_map_clear(struct bit_map *t, int offset, int len); 25 + void bit_map_init(struct bit_map *t, unsigned long *map, int size); 26 26 27 27 #endif /* defined(_SPARC_BITEXT_H) */
+3 -3
arch/sparc/include/asm/bitops_32.h
··· 18 18 #error only <linux/bitops.h> can be included directly 19 19 #endif 20 20 21 - extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); 22 - extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); 23 - extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask); 21 + unsigned long ___set_bit(unsigned long *addr, unsigned long mask); 22 + unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); 23 + unsigned long ___change_bit(unsigned long *addr, unsigned long mask); 24 24 25 25 /* 26 26 * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'
+12 -12
arch/sparc/include/asm/bitops_64.h
··· 15 15 #include <asm/byteorder.h> 16 16 #include <asm/barrier.h> 17 17 18 - extern int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); 19 - extern int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); 20 - extern int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); 21 - extern void set_bit(unsigned long nr, volatile unsigned long *addr); 22 - extern void clear_bit(unsigned long nr, volatile unsigned long *addr); 23 - extern void change_bit(unsigned long nr, volatile unsigned long *addr); 18 + int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); 19 + int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); 20 + int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); 21 + void set_bit(unsigned long nr, volatile unsigned long *addr); 22 + void clear_bit(unsigned long nr, volatile unsigned long *addr); 23 + void change_bit(unsigned long nr, volatile unsigned long *addr); 24 24 25 25 #include <asm-generic/bitops/non-atomic.h> 26 26 ··· 30 30 31 31 #ifdef __KERNEL__ 32 32 33 - extern int ffs(int x); 34 - extern unsigned long __ffs(unsigned long); 33 + int ffs(int x); 34 + unsigned long __ffs(unsigned long); 35 35 36 36 #include <asm-generic/bitops/ffz.h> 37 37 #include <asm-generic/bitops/sched.h> ··· 41 41 * of bits set) of a N-bit word 42 42 */ 43 43 44 - extern unsigned long __arch_hweight64(__u64 w); 45 - extern unsigned int __arch_hweight32(unsigned int w); 46 - extern unsigned int __arch_hweight16(unsigned int w); 47 - extern unsigned int __arch_hweight8(unsigned int w); 44 + unsigned long __arch_hweight64(__u64 w); 45 + unsigned int __arch_hweight32(unsigned int w); 46 + unsigned int __arch_hweight16(unsigned int w); 47 + unsigned int __arch_hweight8(unsigned int w); 48 48 49 49 #include <asm-generic/bitops/const_hweight.h> 50 50 #include <asm-generic/bitops/lock.h>
+1 -1
arch/sparc/include/asm/btext.h
··· 1 1 #ifndef _SPARC_BTEXT_H 2 2 #define _SPARC_BTEXT_H 3 3 4 - extern int btext_find_display(void); 4 + int btext_find_display(void); 5 5 6 6 #endif /* _SPARC_BTEXT_H */
+2 -2
arch/sparc/include/asm/bug.h
··· 5 5 #include <linux/compiler.h> 6 6 7 7 #ifdef CONFIG_DEBUG_BUGVERBOSE 8 - extern void do_BUG(const char *file, int line); 8 + void do_BUG(const char *file, int line); 9 9 #define BUG() do { \ 10 10 do_BUG(__FILE__, __LINE__); \ 11 11 __builtin_trap(); \ ··· 20 20 #include <asm-generic/bug.h> 21 21 22 22 struct pt_regs; 23 - extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn)); 23 + void __noreturn die_if_kernel(char *str, struct pt_regs *regs); 24 24 25 25 #endif
+4 -4
arch/sparc/include/asm/cacheflush_32.h
··· 36 36 #define flush_page_for_dma(addr) \ 37 37 sparc32_cachetlb_ops->page_for_dma(addr) 38 38 39 - extern void sparc_flush_page_to_ram(struct page *page); 39 + void sparc_flush_page_to_ram(struct page *page); 40 40 41 41 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 42 42 #define flush_dcache_page(page) sparc_flush_page_to_ram(page) ··· 51 51 * way the windows are all clean for the next process and the stack 52 52 * frames are up to date. 53 53 */ 54 - extern void flush_user_windows(void); 55 - extern void kill_user_windows(void); 56 - extern void flushw_all(void); 54 + void flush_user_windows(void); 55 + void kill_user_windows(void); 56 + void flushw_all(void); 57 57 58 58 #endif /* _SPARC_CACHEFLUSH_H */
+12 -12
arch/sparc/include/asm/cacheflush_64.h
··· 10 10 /* Cache flush operations. */ 11 11 #define flushw_all() __asm__ __volatile__("flushw") 12 12 13 - extern void __flushw_user(void); 13 + void __flushw_user(void); 14 14 #define flushw_user() __flushw_user() 15 15 16 16 #define flush_user_windows flushw_user ··· 30 30 * use block commit stores (which invalidate icache lines) during 31 31 * module load, so we need this. 32 32 */ 33 - extern void flush_icache_range(unsigned long start, unsigned long end); 34 - extern void __flush_icache_page(unsigned long); 33 + void flush_icache_range(unsigned long start, unsigned long end); 34 + void __flush_icache_page(unsigned long); 35 35 36 - extern void __flush_dcache_page(void *addr, int flush_icache); 37 - extern void flush_dcache_page_impl(struct page *page); 36 + void __flush_dcache_page(void *addr, int flush_icache); 37 + void flush_dcache_page_impl(struct page *page); 38 38 #ifdef CONFIG_SMP 39 - extern void smp_flush_dcache_page_impl(struct page *page, int cpu); 40 - extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page); 39 + void smp_flush_dcache_page_impl(struct page *page, int cpu); 40 + void flush_dcache_page_all(struct mm_struct *mm, struct page *page); 41 41 #else 42 42 #define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page) 43 43 #define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page) 44 44 #endif 45 45 46 - extern void __flush_dcache_range(unsigned long start, unsigned long end); 46 + void __flush_dcache_range(unsigned long start, unsigned long end); 47 47 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 48 - extern void flush_dcache_page(struct page *page); 48 + void flush_dcache_page(struct page *page); 49 49 50 50 #define flush_icache_page(vma, pg) do { } while(0) 51 51 #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 52 52 53 - extern void flush_ptrace_access(struct vm_area_struct *, struct page *, 54 - unsigned long uaddr, void *kaddr, 55 - unsigned long len, int write); 53 + void flush_ptrace_access(struct vm_area_struct *, struct page *, 54 + unsigned long uaddr, void *kaddr, 55 + unsigned long len, int write); 56 56 57 57 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 58 58 do { \
+2 -2
arch/sparc/include/asm/checksum_32.h
··· 29 29 * 30 30 * it's best to have buff aligned on a 32-bit boundary 31 31 */ 32 - extern __wsum csum_partial(const void *buff, int len, __wsum sum); 32 + __wsum csum_partial(const void *buff, int len, __wsum sum); 33 33 34 34 /* the same as csum_partial, but copies from fs:src while it 35 35 * checksums ··· 38 38 * better 64-bit) boundary 39 39 */ 40 40 41 - extern unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *); 41 + unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *); 42 42 43 43 static inline __wsum 44 44 csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
+16 -16
arch/sparc/include/asm/checksum_64.h
··· 29 29 * 30 30 * it's best to have buff aligned on a 32-bit boundary 31 31 */ 32 - extern __wsum csum_partial(const void * buff, int len, __wsum sum); 32 + __wsum csum_partial(const void * buff, int len, __wsum sum); 33 33 34 34 /* the same as csum_partial, but copies from user space while it 35 35 * checksums ··· 37 37 * here even more important to align src and dst on a 32-bit (or even 38 38 * better 64-bit) boundary 39 39 */ 40 - extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, 41 - int len, __wsum sum); 40 + __wsum csum_partial_copy_nocheck(const void *src, void *dst, 41 + int len, __wsum sum); 42 42 43 - extern long __csum_partial_copy_from_user(const void __user *src, 44 - void *dst, int len, 45 - __wsum sum); 43 + long __csum_partial_copy_from_user(const void __user *src, 44 + void *dst, int len, 45 + __wsum sum); 46 46 47 47 static inline __wsum 48 48 csum_partial_copy_from_user(const void __user *src, ··· 59 59 * Copy and checksum to user 60 60 */ 61 61 #define HAVE_CSUM_COPY_USER 62 - extern long __csum_partial_copy_to_user(const void *src, 63 - void __user *dst, int len, 64 - __wsum sum); 62 + long __csum_partial_copy_to_user(const void *src, 63 + void __user *dst, int len, 64 + __wsum sum); 65 65 66 66 static inline __wsum 67 67 csum_and_copy_to_user(const void *src, ··· 77 77 /* ihl is always 5 or greater, almost always is 5, and iph is word aligned 78 78 * the majority of the time. 79 79 */ 80 - extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); 80 + __sum16 ip_fast_csum(const void *iph, unsigned int ihl); 81 81 82 82 /* Fold a partial checksum without adding pseudo headers. */ 83 83 static inline __sum16 csum_fold(__wsum sum) ··· 96 96 } 97 97 98 98 static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, 99 - unsigned int len, 100 - unsigned short proto, 101 - __wsum sum) 99 + unsigned int len, 100 + unsigned short proto, 101 + __wsum sum) 102 102 { 103 103 __asm__ __volatile__( 104 104 " addcc %1, %0, %0\n" ··· 116 116 * returns a 16-bit checksum, already complemented 117 117 */ 118 118 static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, 119 - unsigned short len, 120 - unsigned short proto, 121 - __wsum sum) 119 + unsigned short len, 120 + unsigned short proto, 121 + __wsum sum) 122 122 { 123 123 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); 124 124 }
+3 -3
arch/sparc/include/asm/cmpxchg_32.h
··· 20 20 return val; 21 21 } 22 22 23 - extern void __xchg_called_with_bad_pointer(void); 23 + void __xchg_called_with_bad_pointer(void); 24 24 25 25 static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) 26 26 { ··· 45 45 #define __HAVE_ARCH_CMPXCHG 1 46 46 47 47 /* bug catcher for when unsupported size is used - won't link */ 48 - extern void __cmpxchg_called_with_bad_pointer(void); 48 + void __cmpxchg_called_with_bad_pointer(void); 49 49 /* we only need to support cmpxchg of a u32 on sparc */ 50 - extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); 50 + unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); 51 51 52 52 /* don't worry...optimizer will get rid of most of this */ 53 53 static inline unsigned long
+2 -2
arch/sparc/include/asm/cmpxchg_64.h
··· 42 42 43 43 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 44 44 45 - extern void __xchg_called_with_bad_pointer(void); 45 + void __xchg_called_with_bad_pointer(void); 46 46 47 47 static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, 48 48 int size) ··· 91 91 92 92 /* This function doesn't exist, so you'll get a linker error 93 93 if something tries to do an invalid cmpxchg(). */ 94 - extern void __cmpxchg_called_with_bad_pointer(void); 94 + void __cmpxchg_called_with_bad_pointer(void); 95 95 96 96 static inline unsigned long 97 97 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+10
arch/sparc/include/asm/cpudata.h
··· 1 1 #ifndef ___ASM_SPARC_CPUDATA_H 2 2 #define ___ASM_SPARC_CPUDATA_H 3 + 4 + #ifndef __ASSEMBLY__ 5 + 6 + #include <linux/threads.h> 7 + #include <linux/percpu.h> 8 + 9 + extern const struct seq_operations cpuinfo_op; 10 + 11 + #endif /* !(__ASSEMBLY__) */ 12 + 3 13 #if defined(__sparc__) && defined(__arch64__) 4 14 #include <asm/cpudata_64.h> 5 15 #else
-5
arch/sparc/include/asm/cpudata_64.h
··· 8 8 9 9 #ifndef __ASSEMBLY__ 10 10 11 - #include <linux/percpu.h> 12 - #include <linux/threads.h> 13 - 14 11 typedef struct { 15 12 /* Dcache line 1 */ 16 13 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ ··· 31 34 DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); 32 35 #define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu)) 33 36 #define local_cpu_data() __get_cpu_var(__cpu_data) 34 - 35 - extern const struct seq_operations cpuinfo_op; 36 37 37 38 #endif /* !(__ASSEMBLY__) */ 38 39
+2 -2
arch/sparc/include/asm/delay_32.h
··· 20 20 } 21 21 22 22 /* This is too messy with inline asm on the Sparc. */ 23 - extern void __udelay(unsigned long usecs, unsigned long lpj); 24 - extern void __ndelay(unsigned long nsecs, unsigned long lpj); 23 + void __udelay(unsigned long usecs, unsigned long lpj); 24 + void __ndelay(unsigned long nsecs, unsigned long lpj); 25 25 26 26 #ifdef CONFIG_SMP 27 27 #define __udelay_val cpu_data(smp_processor_id()).udelay_val
+2 -2
arch/sparc/include/asm/delay_64.h
··· 8 8 9 9 #ifndef __ASSEMBLY__ 10 10 11 - extern void __delay(unsigned long loops); 12 - extern void udelay(unsigned long usecs); 11 + void __delay(unsigned long loops); 12 + void udelay(unsigned long usecs); 13 13 #define mdelay(n) udelay((n) * 1000) 14 14 15 15 #endif /* !__ASSEMBLY__ */
+1 -1
arch/sparc/include/asm/device.h
··· 19 19 int numa_node; 20 20 }; 21 21 22 - extern void of_propagate_archdata(struct platform_device *bus); 22 + void of_propagate_archdata(struct platform_device *bus); 23 23 24 24 struct pdev_archdata { 25 25 struct resource resource[PROMREG_MAX];
+1 -1
arch/sparc/include/asm/dma-mapping.h
··· 7 7 8 8 #define DMA_ERROR_CODE (~(dma_addr_t)0x0) 9 9 10 - extern int dma_supported(struct device *dev, u64 mask); 10 + int dma_supported(struct device *dev, u64 mask); 11 11 12 12 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 13 13 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+8 -8
arch/sparc/include/asm/ebus_dma.h
··· 22 22 unsigned char name[64]; 23 23 }; 24 24 25 - extern int ebus_dma_register(struct ebus_dma_info *p); 26 - extern int ebus_dma_irq_enable(struct ebus_dma_info *p, int on); 27 - extern void ebus_dma_unregister(struct ebus_dma_info *p); 28 - extern int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr, 25 + int ebus_dma_register(struct ebus_dma_info *p); 26 + int ebus_dma_irq_enable(struct ebus_dma_info *p, int on); 27 + void ebus_dma_unregister(struct ebus_dma_info *p); 28 + int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr, 29 29 size_t len); 30 - extern void ebus_dma_prepare(struct ebus_dma_info *p, int write); 31 - extern unsigned int ebus_dma_residue(struct ebus_dma_info *p); 32 - extern unsigned int ebus_dma_addr(struct ebus_dma_info *p); 33 - extern void ebus_dma_enable(struct ebus_dma_info *p, int on); 30 + void ebus_dma_prepare(struct ebus_dma_info *p, int write); 31 + unsigned int ebus_dma_residue(struct ebus_dma_info *p); 32 + unsigned int ebus_dma_addr(struct ebus_dma_info *p); 33 + void ebus_dma_enable(struct ebus_dma_info *p, int on); 34 34 35 35 #endif /* __ASM_SPARC_EBUS_DMA_H */
+3 -11
arch/sparc/include/asm/floppy_32.h
··· 9 9 #include <linux/of.h> 10 10 #include <linux/of_device.h> 11 11 12 - #include <asm/page.h> 13 12 #include <asm/pgtable.h> 14 13 #include <asm/idprom.h> 15 14 #include <asm/oplib.h> 16 15 #include <asm/auxio.h> 16 + #include <asm/setup.h> 17 + #include <asm/page.h> 17 18 #include <asm/irq.h> 18 19 19 20 /* We don't need no stinkin' I/O port allocation crap. */ ··· 50 49 51 50 /* You'll only ever find one controller on a SparcStation anyways. */ 52 51 static struct sun_flpy_controller *sun_fdc = NULL; 53 - extern volatile unsigned char *fdc_status; 54 52 55 53 struct sun_floppy_ops { 56 54 unsigned char (*fd_inb)(int port); ··· 212 212 * underruns. If non-zero, doing_pdma encodes the direction of 213 213 * the transfer for debugging. 1=read 2=write 214 214 */ 215 - extern char *pdma_vaddr; 216 - extern unsigned long pdma_size; 217 - extern volatile int doing_pdma; 218 - 219 - /* This is software state */ 220 - extern char *pdma_base; 221 - extern unsigned long pdma_areasize; 222 215 223 216 /* Common routines to all controller types on the Sparc. */ 224 217 static inline void virtual_dma_init(void) ··· 256 263 pdma_areasize = pdma_size; 257 264 } 258 265 259 - extern int sparc_floppy_request_irq(unsigned int irq, 260 - irq_handler_t irq_handler); 266 + int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler); 261 267 262 268 static int sun_fd_request_irq(void) 263 269 {
+1 -1
arch/sparc/include/asm/floppy_64.h
··· 296 296 static struct sun_pci_dma_op sun_pci_dma_current = { -1U, 0, 0, NULL}; 297 297 static struct sun_pci_dma_op sun_pci_dma_pending = { -1U, 0, 0, NULL}; 298 298 299 - extern irqreturn_t floppy_interrupt(int irq, void *dev_id); 299 + irqreturn_t floppy_interrupt(int irq, void *dev_id); 300 300 301 301 static unsigned char sun_pci_fd_inb(unsigned long port) 302 302 {
+5 -1
arch/sparc/include/asm/ftrace.h
··· 6 6 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 7 7 8 8 #ifndef __ASSEMBLY__ 9 - extern void _mcount(void); 9 + void _mcount(void); 10 10 #endif 11 11 12 12 #endif ··· 21 21 struct dyn_arch_ftrace { 22 22 }; 23 23 #endif /* CONFIG_DYNAMIC_FTRACE */ 24 + 25 + unsigned long prepare_ftrace_return(unsigned long parent, 26 + unsigned long self_addr, 27 + unsigned long frame_pointer); 24 28 25 29 #endif /* _ASM_SPARC64_FTRACE */
+5 -5
arch/sparc/include/asm/highmem.h
··· 31 31 extern pgprot_t kmap_prot; 32 32 extern pte_t *pkmap_page_table; 33 33 34 - extern void kmap_init(void) __init; 34 + void kmap_init(void) __init; 35 35 36 36 /* 37 37 * Right now we initialize only a single pte table. It can be extended ··· 49 49 50 50 #define PKMAP_END (PKMAP_ADDR(LAST_PKMAP)) 51 51 52 - extern void *kmap_high(struct page *page); 53 - extern void kunmap_high(struct page *page); 52 + void *kmap_high(struct page *page); 53 + void kunmap_high(struct page *page); 54 54 55 55 static inline void *kmap(struct page *page) 56 56 { ··· 68 68 kunmap_high(page); 69 69 } 70 70 71 - extern void *kmap_atomic(struct page *page); 72 - extern void __kunmap_atomic(void *kvaddr); 71 + void *kmap_atomic(struct page *page); 72 + void __kunmap_atomic(void *kvaddr); 73 73 74 74 #define flush_cache_kmaps() flush_cache_all() 75 75
+1 -1
arch/sparc/include/asm/hvtramp.h
··· 19 19 struct hvtramp_mapping maps[1]; 20 20 }; 21 21 22 - extern void hv_cpu_startup(unsigned long hvdescr_pa); 22 + void hv_cpu_startup(unsigned long hvdescr_pa); 23 23 24 24 #endif 25 25
+163 -160
arch/sparc/include/asm/hypervisor.h
··· 98 98 #define HV_FAST_MACH_EXIT 0x00 99 99 100 100 #ifndef __ASSEMBLY__ 101 - extern void sun4v_mach_exit(unsigned long exit_code); 101 + void sun4v_mach_exit(unsigned long exit_code); 102 102 #endif 103 103 104 104 /* Domain services. */ ··· 127 127 #define HV_FAST_MACH_DESC 0x01 128 128 129 129 #ifndef __ASSEMBLY__ 130 - extern unsigned long sun4v_mach_desc(unsigned long buffer_pa, 131 - unsigned long buf_len, 132 - unsigned long *real_buf_len); 130 + unsigned long sun4v_mach_desc(unsigned long buffer_pa, 131 + unsigned long buf_len, 132 + unsigned long *real_buf_len); 133 133 #endif 134 134 135 135 /* mach_sir() ··· 148 148 #define HV_FAST_MACH_SIR 0x02 149 149 150 150 #ifndef __ASSEMBLY__ 151 - extern void sun4v_mach_sir(void); 151 + void sun4v_mach_sir(void); 152 152 #endif 153 153 154 154 /* mach_set_watchdog() ··· 204 204 #define HV_FAST_MACH_SET_WATCHDOG 0x05 205 205 206 206 #ifndef __ASSEMBLY__ 207 - extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout, 208 - unsigned long *orig_timeout); 207 + unsigned long sun4v_mach_set_watchdog(unsigned long timeout, 208 + unsigned long *orig_timeout); 209 209 #endif 210 210 211 211 /* CPU services. ··· 250 250 #define HV_FAST_CPU_START 0x10 251 251 252 252 #ifndef __ASSEMBLY__ 253 - extern unsigned long sun4v_cpu_start(unsigned long cpuid, 254 - unsigned long pc, 255 - unsigned long rtba, 256 - unsigned long arg0); 253 + unsigned long sun4v_cpu_start(unsigned long cpuid, 254 + unsigned long pc, 255 + unsigned long rtba, 256 + unsigned long arg0); 257 257 #endif 258 258 259 259 /* cpu_stop() ··· 278 278 #define HV_FAST_CPU_STOP 0x11 279 279 280 280 #ifndef __ASSEMBLY__ 281 - extern unsigned long sun4v_cpu_stop(unsigned long cpuid); 281 + unsigned long sun4v_cpu_stop(unsigned long cpuid); 282 282 #endif 283 283 284 284 /* cpu_yield() ··· 295 295 #define HV_FAST_CPU_YIELD 0x12 296 296 297 297 #ifndef __ASSEMBLY__ 298 - extern unsigned long sun4v_cpu_yield(void); 298 + unsigned long sun4v_cpu_yield(void); 299 299 #endif 300 300 301 301 /* cpu_qconf() ··· 341 341 #define HV_CPU_QUEUE_NONRES_ERROR 0x3f 342 342 343 343 #ifndef __ASSEMBLY__ 344 - extern unsigned long sun4v_cpu_qconf(unsigned long type, 345 - unsigned long queue_paddr, 346 - unsigned long num_queue_entries); 344 + unsigned long sun4v_cpu_qconf(unsigned long type, 345 + unsigned long queue_paddr, 346 + unsigned long num_queue_entries); 347 347 #endif 348 348 349 349 /* cpu_qinfo() ··· 394 394 #define HV_FAST_CPU_MONDO_SEND 0x42 395 395 396 396 #ifndef __ASSEMBLY__ 397 - extern unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count, unsigned long cpu_list_pa, unsigned long mondo_block_pa); 397 + unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count, 398 + unsigned long cpu_list_pa, 399 + unsigned long mondo_block_pa); 398 400 #endif 399 401 400 402 /* cpu_myid() ··· 427 425 #define HV_CPU_STATE_ERROR 0x03 428 426 429 427 #ifndef __ASSEMBLY__ 430 - extern long sun4v_cpu_state(unsigned long cpuid); 428 + long sun4v_cpu_state(unsigned long cpuid); 431 429 #endif 432 430 433 431 /* cpu_set_rtba() ··· 627 625 #define HV_FAST_MMU_TSB_CTX0 0x20 628 626 629 627 #ifndef __ASSEMBLY__ 630 - extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, 631 - unsigned long tsb_desc_ra); 628 + unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, 629 + unsigned long tsb_desc_ra); 632 630 #endif 633 631 634 632 /* mmu_tsb_ctxnon0() ··· 712 710 #define HV_FAST_MMU_DEMAP_ALL 0x24 713 711 714 712 #ifndef __ASSEMBLY__ 715 - extern void sun4v_mmu_demap_all(void); 713 + void sun4v_mmu_demap_all(void); 716 714 #endif 717 715 718 716 /* mmu_map_perm_addr() ··· 742 740 #define HV_FAST_MMU_MAP_PERM_ADDR 0x25 743 741 744 742 #ifndef __ASSEMBLY__ 745 - extern unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr, 746 - unsigned long set_to_zero, 747 - unsigned long tte, 748 - unsigned long flags); 743 + unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr, 744 + unsigned long set_to_zero, 745 + unsigned long tte, 746 + unsigned long flags); 749 747 #endif 750 748 751 749 /* mmu_fault_area_conf() ··· 947 945 #define HV_FAST_TOD_GET 0x50 948 946 949 947 #ifndef __ASSEMBLY__ 950 - extern unsigned long sun4v_tod_get(unsigned long *time); 948 + unsigned long sun4v_tod_get(unsigned long *time); 951 949 #endif 952 950 953 951 /* tod_set() ··· 964 962 #define HV_FAST_TOD_SET 0x51 965 963 966 964 #ifndef __ASSEMBLY__ 967 - extern unsigned long sun4v_tod_set(unsigned long time); 965 + unsigned long sun4v_tod_set(unsigned long time); 968 966 #endif 969 967 970 968 /* Console services */ ··· 1040 1038 #define HV_FAST_CONS_WRITE 0x63 1041 1039 1042 1040 #ifndef __ASSEMBLY__ 1043 - extern long sun4v_con_getchar(long *status); 1044 - extern long sun4v_con_putchar(long c); 1045 - extern long sun4v_con_read(unsigned long buffer, 1046 - unsigned long size, 1047 - unsigned long *bytes_read); 1048 - extern unsigned long sun4v_con_write(unsigned long buffer, 1049 - unsigned long size, 1050 - unsigned long *bytes_written); 1041 + long sun4v_con_getchar(long *status); 1042 + long sun4v_con_putchar(long c); 1043 + long sun4v_con_read(unsigned long buffer, 1044 + unsigned long size, 1045 + unsigned long *bytes_read); 1046 + unsigned long sun4v_con_write(unsigned long buffer, 1047 + unsigned long size, 1048 + unsigned long *bytes_written); 1051 1049 #endif 1052 1050 1053 1051 /* mach_set_soft_state() ··· 1082 1080 #define HV_SOFT_STATE_TRANSITION 0x02 1083 1081 1084 1082 #ifndef __ASSEMBLY__ 1085 - extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state, 1086 - unsigned long msg_string_ra); 1083 + unsigned long sun4v_mach_set_soft_state(unsigned long soft_state, 1084 + unsigned long msg_string_ra); 1087 1085 #endif 1088 1086 1089 1087 /* mach_get_soft_state() ··· 1161 1159 #define HV_FAST_SVC_CLRSTATUS 0x84 1162 1160 1163 1161 #ifndef __ASSEMBLY__ 1164 - extern unsigned long sun4v_svc_send(unsigned long svc_id, 1165 - unsigned long buffer, 1166 - unsigned long buffer_size, 1167 - unsigned long *sent_bytes); 1168 - extern unsigned long sun4v_svc_recv(unsigned long svc_id, 1169 - unsigned long buffer, 1170 - unsigned long buffer_size, 1171 - unsigned long *recv_bytes); 1172 - extern unsigned long sun4v_svc_getstatus(unsigned long svc_id, 1173 - unsigned long *status_bits); 1174 - extern unsigned long sun4v_svc_setstatus(unsigned long svc_id, 1175 - unsigned long status_bits); 1176 - extern unsigned long sun4v_svc_clrstatus(unsigned long svc_id, 1177 - unsigned long status_bits); 1162 + unsigned long sun4v_svc_send(unsigned long svc_id, 1163 + unsigned long buffer, 1164 + unsigned long buffer_size, 1165 + unsigned long *sent_bytes); 1166 + unsigned long sun4v_svc_recv(unsigned long svc_id, 1167 + unsigned long buffer, 1168 + unsigned long buffer_size, 1169 + unsigned long *recv_bytes); 1170 + unsigned long sun4v_svc_getstatus(unsigned long svc_id, 1171 + unsigned long *status_bits); 1172 + unsigned long sun4v_svc_setstatus(unsigned long svc_id, 1173 + unsigned long status_bits); 1174 + unsigned long sun4v_svc_clrstatus(unsigned long svc_id, 1175 + unsigned long status_bits); 1178 1176 #endif 1179 1177 1180 1178 /* Trap trace services. ··· 1460 1458 #define HV_FAST_INTR_DEVINO2SYSINO 0xa0 1461 1459 1462 1460 #ifndef __ASSEMBLY__ 1463 - extern unsigned long sun4v_devino_to_sysino(unsigned long devhandle, 1464 - unsigned long devino); 1461 + unsigned long sun4v_devino_to_sysino(unsigned long devhandle, 1462 + unsigned long devino); 1465 1463 #endif 1466 1464 1467 1465 /* intr_getenabled() ··· 1478 1476 #define HV_FAST_INTR_GETENABLED 0xa1 1479 1477 1480 1478 #ifndef __ASSEMBLY__ 1481 - extern unsigned long sun4v_intr_getenabled(unsigned long sysino); 1479 + unsigned long sun4v_intr_getenabled(unsigned long sysino); 1482 1480 #endif 1483 1481 1484 1482 /* intr_setenabled() ··· 1494 1492 #define HV_FAST_INTR_SETENABLED 0xa2 1495 1493 1496 1494 #ifndef __ASSEMBLY__ 1497 - extern unsigned long sun4v_intr_setenabled(unsigned long sysino, unsigned long intr_enabled); 1495 + unsigned long sun4v_intr_setenabled(unsigned long sysino, 1496 + unsigned long intr_enabled); 1498 1497 #endif 1499 1498 1500 1499 /* intr_getstate() ··· 1511 1508 #define HV_FAST_INTR_GETSTATE 0xa3 1512 1509 1513 1510 #ifndef __ASSEMBLY__ 1514 - extern unsigned long sun4v_intr_getstate(unsigned long sysino); 1511 + unsigned long sun4v_intr_getstate(unsigned long sysino); 1515 1512 #endif 1516 1513 1517 1514 /* intr_setstate() ··· 1531 1528 #define HV_FAST_INTR_SETSTATE 0xa4 1532 1529 1533 1530 #ifndef __ASSEMBLY__ 1534 - extern unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state); 1531 + unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state); 1535 1532 #endif 1536 1533 1537 1534 /* intr_gettarget() ··· 1549 1546 #define HV_FAST_INTR_GETTARGET 0xa5 1550 1547 1551 1548 #ifndef __ASSEMBLY__ 1552 - extern unsigned long sun4v_intr_gettarget(unsigned long sysino); 1549 + unsigned long sun4v_intr_gettarget(unsigned long sysino); 1553 1550 #endif 1554 1551 1555 1552 /* intr_settarget() ··· 1566 1563 #define HV_FAST_INTR_SETTARGET 0xa6 1567 1564 1568 1565 #ifndef __ASSEMBLY__ 1569 - extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); 1566 + unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); 1570 1567 #endif 1571 1568 1572 1569 /* vintr_get_cookie() ··· 1650 1647 #define HV_FAST_VINTR_SET_TARGET 0xae 1651 1648 1652 1649 #ifndef __ASSEMBLY__ 1653 - extern unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle, 1654 - unsigned long dev_ino, 1655 - unsigned long *cookie); 1656 - extern unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle, 1657 - unsigned long dev_ino, 1658 - unsigned long cookie); 1659 - extern unsigned long sun4v_vintr_get_valid(unsigned long dev_handle, 1660 - unsigned long dev_ino, 1661 - unsigned long *valid); 1662 - extern unsigned long sun4v_vintr_set_valid(unsigned long dev_handle, 1663 - unsigned long dev_ino, 1664 - unsigned long valid); 1665 - extern unsigned long sun4v_vintr_get_state(unsigned long dev_handle, 1666 - unsigned long dev_ino, 1667 - unsigned long *state); 1668 - extern unsigned long sun4v_vintr_set_state(unsigned long dev_handle, 1669 - unsigned long dev_ino, 1670 - unsigned long state); 1671 - extern unsigned long sun4v_vintr_get_target(unsigned long dev_handle, 1672 - unsigned long dev_ino, 1673 - unsigned long *cpuid); 1674 - extern unsigned long sun4v_vintr_set_target(unsigned long dev_handle, 1675 - unsigned long dev_ino, 1676 - unsigned long cpuid); 1650 + unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle, 1651 + unsigned long dev_ino, 1652 + unsigned long *cookie); 1653 + unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle, 1654 + unsigned long dev_ino, 1655 + unsigned long cookie); 1656 + unsigned long sun4v_vintr_get_valid(unsigned long dev_handle, 1657 + unsigned long dev_ino, 1658 + unsigned long *valid); 1659 + unsigned long sun4v_vintr_set_valid(unsigned long dev_handle, 1660 + unsigned long dev_ino, 1661 + unsigned long valid); 1662 + unsigned long sun4v_vintr_get_state(unsigned long dev_handle, 1663 + unsigned long dev_ino, 1664 + unsigned long *state); 1665 + unsigned long sun4v_vintr_set_state(unsigned long dev_handle, 1666 + unsigned long dev_ino, 1667 + unsigned long state); 1668 + unsigned long sun4v_vintr_get_target(unsigned long dev_handle, 1669 + unsigned long dev_ino, 1670 + unsigned long *cpuid); 1671 + unsigned long sun4v_vintr_set_target(unsigned long dev_handle, 1672 + unsigned long dev_ino, 1673 + unsigned long cpuid); 1677 1674 #endif 1678 1675 1679 1676 /* PCI IO services. ··· 2630 2627 #define HV_FAST_LDC_REVOKE 0xef 2631 2628 2632 2629 #ifndef __ASSEMBLY__ 2633 - extern unsigned long sun4v_ldc_tx_qconf(unsigned long channel, 2634 - unsigned long ra, 2635 - unsigned long num_entries); 2636 - extern unsigned long sun4v_ldc_tx_qinfo(unsigned long channel, 2637 - unsigned long *ra, 2638 - unsigned long *num_entries); 2639 - extern unsigned long sun4v_ldc_tx_get_state(unsigned long channel, 2640 - unsigned long *head_off, 2641 - unsigned long *tail_off, 2642 - unsigned long *chan_state); 2643 - extern unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel, 2644 - unsigned long tail_off); 2645 - extern unsigned long sun4v_ldc_rx_qconf(unsigned long channel, 2646 - unsigned long ra, 2647 - unsigned long num_entries); 2648 - extern unsigned long sun4v_ldc_rx_qinfo(unsigned long channel, 2649 - unsigned long *ra, 2650 - unsigned long *num_entries); 2651 - extern unsigned long sun4v_ldc_rx_get_state(unsigned long channel, 2652 - unsigned long *head_off, 2653 - unsigned long *tail_off, 2654 - unsigned long *chan_state); 2655 - extern unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel, 2656 - unsigned long head_off); 2657 - extern unsigned long sun4v_ldc_set_map_table(unsigned long channel, 2658 - unsigned long ra, 2659 - unsigned long num_entries); 2660 - extern unsigned long sun4v_ldc_get_map_table(unsigned long channel, 2661 - unsigned long *ra, 2662 - unsigned long *num_entries); 2663 - extern unsigned long sun4v_ldc_copy(unsigned long channel, 2664 - unsigned long dir_code, 2665 - unsigned long tgt_raddr, 2666 - unsigned long lcl_raddr, 2667 - unsigned long len, 2668 - unsigned long *actual_len); 2669 - extern unsigned long sun4v_ldc_mapin(unsigned long channel, 2670 - unsigned long cookie, 2671 - unsigned long *ra, 2672 - unsigned long *perm); 2673 - extern unsigned long sun4v_ldc_unmap(unsigned long ra); 2674 - extern unsigned long sun4v_ldc_revoke(unsigned long channel, 2675 - unsigned long cookie, 2676 - unsigned long mte_cookie); 2630 + unsigned long sun4v_ldc_tx_qconf(unsigned long channel, 2631 + unsigned long ra, 2632 + unsigned long num_entries); 2633 + unsigned long sun4v_ldc_tx_qinfo(unsigned long channel, 2634 + unsigned long *ra, 2635 + unsigned long *num_entries); 2636 + unsigned long sun4v_ldc_tx_get_state(unsigned long channel, 2637 + unsigned long *head_off, 2638 + unsigned long *tail_off, 2639 + unsigned long *chan_state); 2640 + unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel, 2641 + unsigned long tail_off); 2642 + unsigned long sun4v_ldc_rx_qconf(unsigned long channel, 2643 + unsigned long ra, 2644 + unsigned long num_entries); 2645 + unsigned long sun4v_ldc_rx_qinfo(unsigned long channel, 2646 + unsigned long *ra, 2647 + unsigned long *num_entries); 2648 + unsigned long sun4v_ldc_rx_get_state(unsigned long channel, 2649 + unsigned long *head_off, 2650 + unsigned long *tail_off, 2651 + unsigned long *chan_state); 2652 + unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel, 2653 + unsigned long head_off); 2654 + unsigned long sun4v_ldc_set_map_table(unsigned long channel, 2655 + unsigned long ra, 2656 + unsigned long num_entries); 2657 + unsigned long sun4v_ldc_get_map_table(unsigned long channel, 2658 + unsigned long *ra, 2659 + unsigned long *num_entries); 2660 + unsigned long sun4v_ldc_copy(unsigned long channel, 2661 + unsigned long dir_code, 2662 + unsigned long tgt_raddr, 2663 + unsigned long lcl_raddr, 2664 + unsigned long len, 2665 + unsigned long *actual_len); 2666 + unsigned long sun4v_ldc_mapin(unsigned long channel, 2667 + unsigned long cookie, 2668 + unsigned long *ra, 2669 + unsigned long *perm); 2670 + unsigned long sun4v_ldc_unmap(unsigned long ra); 2671 + unsigned long sun4v_ldc_revoke(unsigned long channel, 2672 + unsigned long cookie, 2673 + unsigned long mte_cookie); 2677 2674 #endif 2678 2675 2679 2676 /* Performance counter services. */ ··· 2730 2727 #define HV_FAST_N2_SET_PERFREG 0x105 2731 2728 2732 2729 #ifndef __ASSEMBLY__ 2733 - extern unsigned long sun4v_niagara_getperf(unsigned long reg, 2734 - unsigned long *val); 2735 - extern unsigned long sun4v_niagara_setperf(unsigned long reg, 2736 - unsigned long val); 2737 - extern unsigned long sun4v_niagara2_getperf(unsigned long reg, 2738 - unsigned long *val); 2739 - extern unsigned long sun4v_niagara2_setperf(unsigned long reg, 2740 - unsigned long val); 2730 + unsigned long sun4v_niagara_getperf(unsigned long reg, 2731 + unsigned long *val); 2732 + unsigned long sun4v_niagara_setperf(unsigned long reg, 2733 + unsigned long val); 2734 + unsigned long sun4v_niagara2_getperf(unsigned long reg, 2735 + unsigned long *val); 2736 + unsigned long sun4v_niagara2_setperf(unsigned long reg, 2737 + unsigned long val); 2741 2738 #endif 2742 2739 2743 2740 /* MMU statistics services. ··· 2832 2829 #define HV_FAST_MMUSTAT_INFO 0x103 2833 2830 2834 2831 #ifndef __ASSEMBLY__ 2835 - extern unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra); 2836 - extern unsigned long sun4v_mmustat_info(unsigned long *ra); 2832 + unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra); 2833 + unsigned long sun4v_mmustat_info(unsigned long *ra); 2837 2834 #endif 2838 2835 2839 2836 /* NCS crypto services */ ··· 2922 2919 #define HV_FAST_NCS_REQUEST 0x110 2923 2920 2924 2921 #ifndef __ASSEMBLY__ 2925 - extern unsigned long sun4v_ncs_request(unsigned long request, 2926 - unsigned long arg_ra, 2927 - unsigned long arg_size); 2922 + unsigned long sun4v_ncs_request(unsigned long request, 2923 + unsigned long arg_ra, 2924 + unsigned long arg_size); 2928 2925 #endif 2929 2926 2930 2927 #define HV_FAST_FIRE_GET_PERFREG 0x120 ··· 2933 2930 #define HV_FAST_REBOOT_DATA_SET 0x172 2934 2931 2935 2932 #ifndef __ASSEMBLY__ 2936 - extern unsigned long sun4v_reboot_data_set(unsigned long ra, 2937 - unsigned long len); 2933 + unsigned long sun4v_reboot_data_set(unsigned long ra, 2934 + unsigned long len); 2938 2935 #endif 2939 2936 2940 2937 #define HV_FAST_VT_GET_PERFREG 0x184 2941 2938 #define HV_FAST_VT_SET_PERFREG 0x185 2942 2939 2943 2940 #ifndef __ASSEMBLY__ 2944 - extern unsigned long sun4v_vt_get_perfreg(unsigned long reg_num, 2945 - unsigned long *reg_val); 2946 - extern unsigned long sun4v_vt_set_perfreg(unsigned long reg_num, 2947 - unsigned long reg_val); 2941 + unsigned long sun4v_vt_get_perfreg(unsigned long reg_num, 2942 + unsigned long *reg_val); 2943 + unsigned long sun4v_vt_set_perfreg(unsigned long reg_num, 2944 + unsigned long reg_val); 2948 2945 #endif 2949 2946 2950 2947 /* Function numbers for HV_CORE_TRAP. */ ··· 2981 2978 #define HV_GRP_DIAG 0x0300 2982 2979 2983 2980 #ifndef __ASSEMBLY__ 2984 - extern unsigned long sun4v_get_version(unsigned long group, 2985 - unsigned long *major, 2986 - unsigned long *minor); 2987 - extern unsigned long sun4v_set_version(unsigned long group, 2988 - unsigned long major, 2989 - unsigned long minor, 2990 - unsigned long *actual_minor); 2981 + unsigned long sun4v_get_version(unsigned long group, 2982 + unsigned long *major, 2983 + unsigned long *minor); 2984 + unsigned long sun4v_set_version(unsigned long group, 2985 + unsigned long major, 2986 + unsigned long minor, 2987 + unsigned long *actual_minor); 2991 2988 2992 - extern int sun4v_hvapi_register(unsigned long group, unsigned long major, 2993 - unsigned long *minor); 2994 - extern void sun4v_hvapi_unregister(unsigned long group); 2995 - extern int sun4v_hvapi_get(unsigned long group, 2996 - unsigned long *major, 2997 - unsigned long *minor); 2998 - extern void sun4v_hvapi_init(void); 2989 + int sun4v_hvapi_register(unsigned long group, unsigned long major, 2990 + unsigned long *minor); 2991 + void sun4v_hvapi_unregister(unsigned long group); 2992 + int sun4v_hvapi_get(unsigned long group, 2993 + unsigned long *major, 2994 + unsigned long *minor); 2995 + void sun4v_hvapi_init(void); 2999 2996 #endif 3000 2997 3001 2998 #endif /* !(_SPARC64_HYPERVISOR_H) */
+1 -1
arch/sparc/include/asm/idprom.h
··· 20 20 }; 21 21 22 22 extern struct idprom *idprom; 23 - extern void idprom_init(void); 23 + void idprom_init(void); 24 24 25 25 #endif /* !(_SPARC_IDPROM_H) */
+1 -1
arch/sparc/include/asm/io-unit.h
··· 43 43 struct iounit_struct { 44 44 unsigned long bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)]; 45 45 spinlock_t lock; 46 - iopte_t *page_table; 46 + iopte_t __iomem *page_table; 47 47 unsigned long rotor[3]; 48 48 unsigned long limit[4]; 49 49 };
+89 -280
arch/sparc/include/asm/io_32.h
··· 2 2 #define __SPARC_IO_H 3 3 4 4 #include <linux/kernel.h> 5 - #include <linux/types.h> 6 5 #include <linux/ioport.h> /* struct resource */ 7 6 8 - #include <asm/page.h> /* IO address mapping routines need this */ 9 - #include <asm-generic/pci_iomap.h> 10 - 11 - #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 12 - 13 - static inline u32 flip_dword (u32 l) 14 - { 15 - return ((l&0xff)<<24) | (((l>>8)&0xff)<<16) | (((l>>16)&0xff)<<8)| ((l>>24)&0xff); 16 - } 17 - 18 - static inline u16 flip_word (u16 w) 19 - { 20 - return ((w&0xff) << 8) | ((w>>8)&0xff); 21 - } 22 - 23 - #define mmiowb() 24 - 25 - /* 26 - * Memory mapped I/O to PCI 27 - */ 28 - 29 - static inline u8 __raw_readb(const volatile void __iomem *addr) 30 - { 31 - return *(__force volatile u8 *)addr; 32 - } 33 - 34 - static inline u16 __raw_readw(const volatile void __iomem *addr) 35 - { 36 - return *(__force volatile u16 *)addr; 37 - } 38 - 39 - static inline u32 __raw_readl(const volatile void __iomem *addr) 40 - { 41 - return *(__force volatile u32 *)addr; 42 - } 43 - 44 - static inline void __raw_writeb(u8 b, volatile void __iomem *addr) 45 - { 46 - *(__force volatile u8 *)addr = b; 47 - } 48 - 49 - static inline void __raw_writew(u16 w, volatile void __iomem *addr) 50 - { 51 - *(__force volatile u16 *)addr = w; 52 - } 53 - 54 - static inline void __raw_writel(u32 l, volatile void __iomem *addr) 55 - { 56 - *(__force volatile u32 *)addr = l; 57 - } 58 - 59 - static inline u8 __readb(const volatile void __iomem *addr) 60 - { 61 - return *(__force volatile u8 *)addr; 62 - } 63 - 64 - static inline u16 __readw(const volatile void __iomem *addr) 65 - { 66 - return flip_word(*(__force volatile u16 *)addr); 67 - } 68 - 69 - static inline u32 __readl(const volatile void __iomem *addr) 70 - { 71 - return flip_dword(*(__force volatile u32 *)addr); 72 - } 73 - 74 - static inline void __writeb(u8 b, volatile void __iomem *addr) 75 - { 76 - *(__force volatile u8 *)addr = b; 77 - } 78 - 79 - static inline void __writew(u16 w, volatile void __iomem *addr) 80 - { 81 - *(__force volatile u16 *)addr = flip_word(w); 82 - } 83 - 84 - static inline void __writel(u32 l, volatile void __iomem *addr) 85 - { 86 - *(__force volatile u32 *)addr = flip_dword(l); 87 - } 88 - 89 - #define readb(__addr) __readb(__addr) 90 - #define readw(__addr) __readw(__addr) 91 - #define readl(__addr) __readl(__addr) 92 7 #define readb_relaxed(__addr) readb(__addr) 93 8 #define readw_relaxed(__addr) readw(__addr) 94 9 #define readl_relaxed(__addr) readl(__addr) 95 10 96 - #define writeb(__b, __addr) __writeb((__b),(__addr)) 97 - #define writew(__w, __addr) __writew((__w),(__addr)) 98 - #define writel(__l, __addr) __writel((__l),(__addr)) 99 - 100 - /* 101 - * I/O space operations 102 - * 103 - * Arrangement on a Sun is somewhat complicated. 104 - * 105 - * First of all, we want to use standard Linux drivers 106 - * for keyboard, PC serial, etc. These drivers think 107 - * they access I/O space and use inb/outb. 108 - * On the other hand, EBus bridge accepts PCI *memory* 109 - * cycles and converts them into ISA *I/O* cycles. 110 - * Ergo, we want inb & outb to generate PCI memory cycles. 111 - * 112 - * If we want to issue PCI *I/O* cycles, we do this 113 - * with a low 64K fixed window in PCIC. This window gets 114 - * mapped somewhere into virtual kernel space and we 115 - * can use inb/outb again. 116 - */ 117 - #define inb_local(__addr) __readb((void __iomem *)(unsigned long)(__addr)) 118 - #define inb(__addr) __readb((void __iomem *)(unsigned long)(__addr)) 119 - #define inw(__addr) __readw((void __iomem *)(unsigned long)(__addr)) 120 - #define inl(__addr) __readl((void __iomem *)(unsigned long)(__addr)) 121 - 122 - #define outb_local(__b, __addr) __writeb(__b, (void __iomem *)(unsigned long)(__addr)) 123 - #define outb(__b, __addr) __writeb(__b, (void __iomem *)(unsigned long)(__addr)) 124 - #define outw(__w, __addr) __writew(__w, (void __iomem *)(unsigned long)(__addr)) 125 - #define outl(__l, __addr) __writel(__l, (void __iomem *)(unsigned long)(__addr)) 126 - 127 - #define inb_p(__addr) inb(__addr) 128 - #define outb_p(__b, __addr) outb(__b, __addr) 129 - #define inw_p(__addr) inw(__addr) 130 - #define outw_p(__w, __addr) outw(__w, __addr) 131 - #define inl_p(__addr) inl(__addr) 132 - #define outl_p(__l, __addr) outl(__l, __addr) 133 - 134 - void outsb(unsigned long addr, const void *src, unsigned long cnt); 135 - void outsw(unsigned long addr, const void *src, unsigned long cnt); 136 - void outsl(unsigned long addr, const void *src, unsigned long cnt); 137 - void insb(unsigned long addr, void *dst, unsigned long count); 138 - void insw(unsigned long addr, void *dst, unsigned long count); 139 - void insl(unsigned long addr, void *dst, unsigned long count); 140 - 141 11 #define IO_SPACE_LIMIT 0xffffffff 142 12 143 - /* 144 - * SBus accessors. 145 - * 146 - * SBus has only one, memory mapped, I/O space. 147 - * We do not need to flip bytes for SBus of course. 148 - */ 149 - static inline u8 _sbus_readb(const volatile void __iomem *addr) 150 - { 151 - return *(__force volatile u8 *)addr; 152 - } 13 + #define memset_io(d,c,sz) _memset_io(d,c,sz) 14 + #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) 15 + #define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz) 153 16 154 - static inline u16 _sbus_readw(const volatile void __iomem *addr) 155 - { 156 - return *(__force volatile u16 *)addr; 157 - } 17 + #include <asm-generic/io.h> 158 18 159 - static inline u32 _sbus_readl(const volatile void __iomem *addr) 160 - { 161 - return *(__force volatile u32 *)addr; 162 - } 163 - 164 - static inline void _sbus_writeb(u8 b, volatile void __iomem *addr) 165 - { 166 - *(__force volatile u8 *)addr = b; 167 - } 168 - 169 - static inline void _sbus_writew(u16 w, volatile void __iomem *addr) 170 - { 171 - *(__force volatile u16 *)addr = w; 172 - } 173 - 174 - static inline void _sbus_writel(u32 l, volatile void __iomem *addr) 175 - { 176 - *(__force volatile u32 *)addr = l; 177 - } 178 - 179 - /* 180 - * The only reason for #define's is to hide casts to unsigned long. 181 - */ 182 - #define sbus_readb(__addr) _sbus_readb(__addr) 183 - #define sbus_readw(__addr) _sbus_readw(__addr) 184 - #define sbus_readl(__addr) _sbus_readl(__addr) 185 - #define sbus_writeb(__b, __addr) _sbus_writeb(__b, __addr) 186 - #define sbus_writew(__w, __addr) _sbus_writew(__w, __addr) 187 - #define sbus_writel(__l, __addr) _sbus_writel(__l, __addr) 188 - 189 - static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_size_t n) 190 - { 191 - while(n--) { 192 - sbus_writeb(c, __dst); 193 - __dst++; 194 - } 195 - } 196 - 197 - static inline void 198 - _memset_io(volatile void __iomem *dst, int c, __kernel_size_t n) 19 + static inline void _memset_io(volatile void __iomem *dst, 20 + int c, __kernel_size_t n) 199 21 { 200 22 volatile void __iomem *d = dst; 201 23 ··· 27 205 } 28 206 } 29 207 30 - #define memset_io(d,c,sz) _memset_io(d,c,sz) 31 - 32 - static inline void 33 - _sbus_memcpy_fromio(void *dst, const volatile void __iomem *src, 34 - __kernel_size_t n) 35 - { 36 - char *d = dst; 37 - 38 - while (n--) { 39 - char tmp = sbus_readb(src); 40 - *d++ = tmp; 41 - src++; 42 - } 43 - } 44 - 45 - #define sbus_memcpy_fromio(d, s, sz) _sbus_memcpy_fromio(d, s, sz) 46 - 47 - static inline void 48 - _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) 208 + static inline void _memcpy_fromio(void *dst, const volatile void __iomem *src, 209 + __kernel_size_t n) 49 210 { 50 211 char *d = dst; 51 212 ··· 39 234 } 40 235 } 41 236 42 - #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) 43 - 44 - static inline void 45 - _sbus_memcpy_toio(volatile void __iomem *dst, const void *src, 46 - __kernel_size_t n) 47 - { 48 - const char *s = src; 49 - volatile void __iomem *d = dst; 50 - 51 - while (n--) { 52 - char tmp = *s++; 53 - sbus_writeb(tmp, d); 54 - d++; 55 - } 56 - } 57 - 58 - #define sbus_memcpy_toio(d, s, sz) _sbus_memcpy_toio(d, s, sz) 59 - 60 - static inline void 61 - _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n) 237 + static inline void _memcpy_toio(volatile void __iomem *dst, const void *src, 238 + __kernel_size_t n) 62 239 { 63 240 const char *s = src; 64 241 volatile void __iomem *d = dst; ··· 52 265 } 53 266 } 54 267 55 - #define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz) 268 + /* 269 + * SBus accessors. 270 + * 271 + * SBus has only one, memory mapped, I/O space. 272 + * We do not need to flip bytes for SBus of course. 273 + */ 274 + static inline u8 sbus_readb(const volatile void __iomem *addr) 275 + { 276 + return *(__force volatile u8 *)addr; 277 + } 278 + 279 + static inline u16 sbus_readw(const volatile void __iomem *addr) 280 + { 281 + return *(__force volatile u16 *)addr; 282 + } 283 + 284 + static inline u32 sbus_readl(const volatile void __iomem *addr) 285 + { 286 + return *(__force volatile u32 *)addr; 287 + } 288 + 289 + static inline void sbus_writeb(u8 b, volatile void __iomem *addr) 290 + { 291 + *(__force volatile u8 *)addr = b; 292 + } 293 + 294 + static inline void sbus_writew(u16 w, volatile void __iomem *addr) 295 + { 296 + *(__force volatile u16 *)addr = w; 297 + } 298 + 299 + static inline void sbus_writel(u32 l, volatile void __iomem *addr) 300 + { 301 + *(__force volatile u32 *)addr = l; 302 + } 303 + 304 + static inline void sbus_memset_io(volatile void __iomem *__dst, int c, 305 + __kernel_size_t n) 306 + { 307 + while(n--) { 308 + sbus_writeb(c, __dst); 309 + __dst++; 310 + } 311 + } 312 + 313 + static inline void sbus_memcpy_fromio(void *dst, 314 + const volatile void __iomem *src, 315 + __kernel_size_t n) 316 + { 317 + char *d = dst; 318 + 319 + while (n--) { 320 + char tmp = sbus_readb(src); 321 + *d++ = tmp; 322 + src++; 323 + } 324 + } 325 + 326 + static inline void sbus_memcpy_toio(volatile void __iomem *dst, 327 + const void *src, 328 + __kernel_size_t n) 329 + { 330 + const char *s = src; 331 + volatile void __iomem *d = dst; 332 + 333 + while (n--) { 334 + char tmp = *s++; 335 + sbus_writeb(tmp, d); 336 + d++; 337 + } 338 + } 56 339 57 340 #ifdef __KERNEL__ 58 341 ··· 130 273 * Bus number may be embedded in the higher bits of the physical address. 131 274 * This is why we have no bus number argument to ioremap(). 132 275 */ 133 - extern void __iomem *ioremap(unsigned long offset, unsigned long size); 276 + void __iomem *ioremap(unsigned long offset, unsigned long size); 134 277 #define ioremap_nocache(X,Y) ioremap((X),(Y)) 135 278 #define ioremap_wc(X,Y) ioremap((X),(Y)) 136 - extern void iounmap(volatile void __iomem *addr); 137 - 138 - #define ioread8(X) readb(X) 139 - #define ioread16(X) readw(X) 140 - #define ioread16be(X) __raw_readw(X) 141 - #define ioread32(X) readl(X) 142 - #define ioread32be(X) __raw_readl(X) 143 - #define iowrite8(val,X) writeb(val,X) 144 - #define iowrite16(val,X) writew(val,X) 145 - #define iowrite16be(val,X) __raw_writew(val,X) 146 - #define iowrite32(val,X) writel(val,X) 147 - #define iowrite32be(val,X) __raw_writel(val,X) 148 - 149 - static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count) 150 - { 151 - insb((unsigned long __force)port, buf, count); 152 - } 153 - static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count) 154 - { 155 - insw((unsigned long __force)port, buf, count); 156 - } 157 - 158 - static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count) 159 - { 160 - insl((unsigned long __force)port, buf, count); 161 - } 162 - 163 - static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count) 164 - { 165 - outsb((unsigned long __force)port, buf, count); 166 - } 167 - 168 - static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count) 169 - { 170 - outsw((unsigned long __force)port, buf, count); 171 - } 172 - 173 - static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count) 174 - { 175 - outsl((unsigned long __force)port, buf, count); 176 - } 279 + void iounmap(volatile void __iomem *addr); 177 280 178 281 /* Create a virtual mapping cookie for an IO port range */ 179 - extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 180 - extern void ioport_unmap(void __iomem *); 282 + void __iomem *ioport_map(unsigned long port, unsigned int nr); 283 + void ioport_unmap(void __iomem *); 181 284 182 285 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 183 286 struct pci_dev; 184 - extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 287 + void pci_iounmap(struct pci_dev *dev, void __iomem *); 288 + 289 + 185 290 186 291 /* 187 292 * At the moment, we do not use CMOS_READ anywhere outside of rtc.c, ··· 162 343 return 0; /* actually, sparc_cpu_model==sun4d */ 163 344 } 164 345 struct device; 165 - extern void sbus_set_sbus64(struct device *, int); 346 + void sbus_set_sbus64(struct device *, int); 166 347 167 348 #endif 168 349 169 350 #define __ARCH_HAS_NO_PAGE_ZERO_MAPPED 1 170 351 171 - /* 172 - * Convert a physical pointer to a virtual kernel pointer for /dev/mem 173 - * access 174 - */ 175 - #define xlate_dev_mem_ptr(p) __va(p) 176 - 177 - /* 178 - * Convert a virtual cached pointer to an uncached pointer 179 - */ 180 - #define xlate_dev_kmem_ptr(p) p 181 352 182 353 #endif /* !(__SPARC_IO_H) */
+10 -11
arch/sparc/include/asm/io_64.h
··· 15 15 16 16 /* BIO layer definitions. */ 17 17 extern unsigned long kern_base, kern_size; 18 - #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 19 18 20 19 static inline u8 _inb(unsigned long addr) 21 20 { ··· 90 91 #define inl_p(__addr) inl(__addr) 91 92 #define outl_p(__l, __addr) outl(__l, __addr) 92 93 93 - extern void outsb(unsigned long, const void *, unsigned long); 94 - extern void outsw(unsigned long, const void *, unsigned long); 95 - extern void outsl(unsigned long, const void *, unsigned long); 96 - extern void insb(unsigned long, void *, unsigned long); 97 - extern void insw(unsigned long, void *, unsigned long); 98 - extern void insl(unsigned long, void *, unsigned long); 94 + void outsb(unsigned long, const void *, unsigned long); 95 + void outsw(unsigned long, const void *, unsigned long); 96 + void outsl(unsigned long, const void *, unsigned long); 97 + void insb(unsigned long, void *, unsigned long); 98 + void insw(unsigned long, void *, unsigned long); 99 + void insl(unsigned long, void *, unsigned long); 99 100 100 101 static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count) 101 102 { ··· 508 509 #define iowrite32be(val,X) __raw_writel(val,X) 509 510 510 511 /* Create a virtual mapping cookie for an IO port range */ 511 - extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 512 - extern void ioport_unmap(void __iomem *); 512 + void __iomem *ioport_map(unsigned long port, unsigned int nr); 513 + void ioport_unmap(void __iomem *); 513 514 514 515 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 515 516 struct pci_dev; 516 - extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 517 + void pci_iounmap(struct pci_dev *dev, void __iomem *); 517 518 518 519 static inline int sbus_can_dma_64bit(void) 519 520 { ··· 524 525 return 1; 525 526 } 526 527 struct device; 527 - extern void sbus_set_sbus64(struct device *, int); 528 + void sbus_set_sbus64(struct device *, int); 528 529 529 530 /* 530 531 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
+5 -5
arch/sparc/include/asm/iommu_32.h
··· 99 99 #define IOPTE_WAZ 0x00000001 /* Write as zeros */ 100 100 101 101 struct iommu_struct { 102 - struct iommu_regs *regs; 102 + struct iommu_regs __iomem *regs; 103 103 iopte_t *page_table; 104 104 /* For convenience */ 105 105 unsigned long start; /* First managed virtual address */ ··· 108 108 struct bit_map usemap; 109 109 }; 110 110 111 - static inline void iommu_invalidate(struct iommu_regs *regs) 111 + static inline void iommu_invalidate(struct iommu_regs __iomem *regs) 112 112 { 113 - regs->tlbflush = 0; 113 + sbus_writel(0, &regs->tlbflush); 114 114 } 115 115 116 - static inline void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba) 116 + static inline void iommu_invalidate_page(struct iommu_regs __iomem *regs, unsigned long ba) 117 117 { 118 - regs->pageflush = (ba & PAGE_MASK); 118 + sbus_writel(ba & PAGE_MASK, &regs->pageflush); 119 119 } 120 120 121 121 #endif /* !(_SPARC_IOMMU_H) */
+3 -3
arch/sparc/include/asm/iommu_64.h
··· 58 58 volatile unsigned long __flushflag_buf[(64+(64-1)) / sizeof(long)]; 59 59 }; 60 60 61 - extern int iommu_table_init(struct iommu *iommu, int tsbsize, 62 - u32 dma_offset, u32 dma_addr_mask, 63 - int numa_node); 61 + int iommu_table_init(struct iommu *iommu, int tsbsize, 62 + u32 dma_offset, u32 dma_addr_mask, 63 + int numa_node); 64 64 65 65 #endif /* !(_SPARC64_IOMMU_H) */
+2 -1
arch/sparc/include/asm/irq_32.h
··· 16 16 17 17 #define irq_canonicalize(irq) (irq) 18 18 19 - extern void __init init_IRQ(void); 19 + void __init init_IRQ(void); 20 + void __init sun4d_init_sbi_irq(void); 20 21 21 22 #define NO_IRQ 0xffffffff 22 23
+21 -21
arch/sparc/include/asm/irq_64.h
··· 39 39 */ 40 40 #define NR_IRQS 255 41 41 42 - extern void irq_install_pre_handler(int irq, 43 - void (*func)(unsigned int, void *, void *), 44 - void *arg1, void *arg2); 42 + void irq_install_pre_handler(int irq, 43 + void (*func)(unsigned int, void *, void *), 44 + void *arg1, void *arg2); 45 45 #define irq_canonicalize(irq) (irq) 46 - extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); 47 - extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); 48 - extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); 49 - extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p, 50 - unsigned int msi_devino_start, 51 - unsigned int msi_devino_end); 52 - extern void sun4v_destroy_msi(unsigned int irq); 53 - extern unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p, 54 - unsigned int msi_devino_start, 55 - unsigned int msi_devino_end, 56 - unsigned long imap_base, 57 - unsigned long iclr_base); 58 - extern void sun4u_destroy_msi(unsigned int irq); 46 + unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); 47 + unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); 48 + unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); 49 + unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p, 50 + unsigned int msi_devino_start, 51 + unsigned int msi_devino_end); 52 + void sun4v_destroy_msi(unsigned int irq); 53 + unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p, 54 + unsigned int msi_devino_start, 55 + unsigned int msi_devino_end, 56 + unsigned long imap_base, 57 + unsigned long iclr_base); 58 + void sun4u_destroy_msi(unsigned int irq); 59 59 60 - extern unsigned char irq_alloc(unsigned int dev_handle, 61 - unsigned int dev_ino); 60 + unsigned char irq_alloc(unsigned int dev_handle, 61 + unsigned int dev_ino); 62 62 #ifdef CONFIG_PCI_MSI 63 - extern void irq_free(unsigned int irq); 63 + void irq_free(unsigned int irq); 64 64 #endif 65 65 66 - extern void __init init_IRQ(void); 67 - extern void fixup_irqs(void); 66 + void __init init_IRQ(void); 67 + void fixup_irqs(void); 68 68 69 69 static inline void set_softint(unsigned long bits) 70 70 {
+3 -3
arch/sparc/include/asm/irqflags_32.h
··· 15 15 #include <linux/types.h> 16 16 #include <asm/psr.h> 17 17 18 - extern void arch_local_irq_restore(unsigned long); 19 - extern unsigned long arch_local_irq_save(void); 20 - extern void arch_local_irq_enable(void); 18 + void arch_local_irq_restore(unsigned long); 19 + unsigned long arch_local_irq_save(void); 20 + void arch_local_irq_enable(void); 21 21 22 22 static inline notrace unsigned long arch_local_save_flags(void) 23 23 {
+1 -1
arch/sparc/include/asm/kdebug_64.h
··· 3 3 4 4 struct pt_regs; 5 5 6 - extern void bad_trap(struct pt_regs *, long); 6 + void bad_trap(struct pt_regs *, long); 7 7 8 8 /* Grossly misnamed. */ 9 9 enum die_val {
+4 -1
arch/sparc/include/asm/kgdb.h
··· 28 28 #define NUMREGBYTES ((GDB_CSR + 1) * 4) 29 29 #else 30 30 #define NUMREGBYTES ((GDB_Y + 1) * 8) 31 + 32 + struct pt_regs; 33 + asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs); 31 34 #endif 32 35 33 - extern void arch_kgdb_breakpoint(void); 36 + void arch_kgdb_breakpoint(void); 34 37 35 38 #define BREAK_INSTR_SIZE 4 36 39 #define CACHE_FLUSH_IS_SAFE 1
+5 -3
arch/sparc/include/asm/kprobes.h
··· 43 43 struct prev_kprobe prev_kprobe; 44 44 }; 45 45 46 - extern int kprobe_exceptions_notify(struct notifier_block *self, 47 - unsigned long val, void *data); 48 - extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 46 + int kprobe_exceptions_notify(struct notifier_block *self, 47 + unsigned long val, void *data); 48 + int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 49 + asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, 50 + struct pt_regs *regs); 49 51 #endif /* _SPARC64_KPROBES_H */
+33 -33
arch/sparc/include/asm/ldc.h
··· 4 4 #include <asm/hypervisor.h> 5 5 6 6 extern int ldom_domaining_enabled; 7 - extern void ldom_set_var(const char *var, const char *value); 8 - extern void ldom_reboot(const char *boot_command); 9 - extern void ldom_power_off(void); 7 + void ldom_set_var(const char *var, const char *value); 8 + void ldom_reboot(const char *boot_command); 9 + void ldom_power_off(void); 10 10 11 11 /* The event handler will be evoked when link state changes 12 12 * or data becomes available on the receive side. ··· 51 51 struct ldc_channel; 52 52 53 53 /* Allocate state for a channel. */ 54 - extern struct ldc_channel *ldc_alloc(unsigned long id, 55 - const struct ldc_channel_config *cfgp, 56 - void *event_arg); 54 + struct ldc_channel *ldc_alloc(unsigned long id, 55 + const struct ldc_channel_config *cfgp, 56 + void *event_arg); 57 57 58 58 /* Shut down and free state for a channel. */ 59 - extern void ldc_free(struct ldc_channel *lp); 59 + void ldc_free(struct ldc_channel *lp); 60 60 61 61 /* Register TX and RX queues of the link with the hypervisor. */ 62 - extern int ldc_bind(struct ldc_channel *lp, const char *name); 62 + int ldc_bind(struct ldc_channel *lp, const char *name); 63 63 64 64 /* For non-RAW protocols we need to complete a handshake before 65 65 * communication can proceed. ldc_connect() does that, if the 66 66 * handshake completes successfully, an LDC_EVENT_UP event will 67 67 * be sent up to the driver. 68 68 */ 69 - extern int ldc_connect(struct ldc_channel *lp); 70 - extern int ldc_disconnect(struct ldc_channel *lp); 69 + int ldc_connect(struct ldc_channel *lp); 70 + int ldc_disconnect(struct ldc_channel *lp); 71 71 72 - extern int ldc_state(struct ldc_channel *lp); 72 + int ldc_state(struct ldc_channel *lp); 73 73 74 74 /* Read and write operations. Only valid when the link is up. */ 75 - extern int ldc_write(struct ldc_channel *lp, const void *buf, 76 - unsigned int size); 77 - extern int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size); 75 + int ldc_write(struct ldc_channel *lp, const void *buf, 76 + unsigned int size); 77 + int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size); 78 78 79 79 #define LDC_MAP_SHADOW 0x01 80 80 #define LDC_MAP_DIRECT 0x02 ··· 92 92 }; 93 93 94 94 struct scatterlist; 95 - extern int ldc_map_sg(struct ldc_channel *lp, 96 - struct scatterlist *sg, int num_sg, 97 - struct ldc_trans_cookie *cookies, int ncookies, 98 - unsigned int map_perm); 95 + int ldc_map_sg(struct ldc_channel *lp, 96 + struct scatterlist *sg, int num_sg, 97 + struct ldc_trans_cookie *cookies, int ncookies, 98 + unsigned int map_perm); 99 99 100 - extern int ldc_map_single(struct ldc_channel *lp, 101 - void *buf, unsigned int len, 102 - struct ldc_trans_cookie *cookies, int ncookies, 103 - unsigned int map_perm); 100 + int ldc_map_single(struct ldc_channel *lp, 101 + void *buf, unsigned int len, 102 + struct ldc_trans_cookie *cookies, int ncookies, 103 + unsigned int map_perm); 104 104 105 - extern void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, 106 - int ncookies); 105 + void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, 106 + int ncookies); 107 107 108 - extern int ldc_copy(struct ldc_channel *lp, int copy_dir, 109 - void *buf, unsigned int len, unsigned long offset, 110 - struct ldc_trans_cookie *cookies, int ncookies); 108 + int ldc_copy(struct ldc_channel *lp, int copy_dir, 109 + void *buf, unsigned int len, unsigned long offset, 110 + struct ldc_trans_cookie *cookies, int ncookies); 111 111 112 112 static inline int ldc_get_dring_entry(struct ldc_channel *lp, 113 113 void *buf, unsigned int len, ··· 127 127 return ldc_copy(lp, LDC_COPY_OUT, buf, len, offset, cookies, ncookies); 128 128 } 129 129 130 - extern void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, 131 - struct ldc_trans_cookie *cookies, 132 - int *ncookies, unsigned int map_perm); 130 + void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, 131 + struct ldc_trans_cookie *cookies, 132 + int *ncookies, unsigned int map_perm); 133 133 134 - extern void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, 135 - unsigned int len, 136 - struct ldc_trans_cookie *cookies, int ncookies); 134 + void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, 135 + unsigned int len, 136 + struct ldc_trans_cookie *cookies, int ncookies); 137 137 138 138 #endif /* _SPARC64_LDC_H */
+27 -27
arch/sparc/include/asm/leon.h
··· 82 82 #define LEON_BYPASS_LOAD_PA(x) leon_load_reg((unsigned long)(x)) 83 83 #define LEON_BYPASS_STORE_PA(x, v) leon_store_reg((unsigned long)(x), (unsigned long)(v)) 84 84 85 - extern void leon_switch_mm(void); 86 - extern void leon_init_IRQ(void); 85 + void leon_switch_mm(void); 86 + void leon_init_IRQ(void); 87 87 88 88 static inline unsigned long sparc_leon3_get_dcachecfg(void) 89 89 { ··· 196 196 #ifndef __ASSEMBLY__ 197 197 struct vm_area_struct; 198 198 199 - extern unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr); 200 - extern void leon_flush_icache_all(void); 201 - extern void leon_flush_dcache_all(void); 202 - extern void leon_flush_cache_all(void); 203 - extern void leon_flush_tlb_all(void); 199 + unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr); 200 + void leon_flush_icache_all(void); 201 + void leon_flush_dcache_all(void); 202 + void leon_flush_cache_all(void); 203 + void leon_flush_tlb_all(void); 204 204 extern int leon_flush_during_switch; 205 - extern int leon_flush_needed(void); 206 - extern void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page); 205 + int leon_flush_needed(void); 206 + void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page); 207 207 208 208 /* struct that hold LEON3 cache configuration registers */ 209 209 struct leon3_cacheregs { ··· 217 217 218 218 struct device_node; 219 219 struct task_struct; 220 - extern unsigned int leon_build_device_irq(unsigned int real_irq, 221 - irq_flow_handler_t flow_handler, 222 - const char *name, int do_ack); 223 - extern void leon_update_virq_handling(unsigned int virq, 224 - irq_flow_handler_t flow_handler, 225 - const char *name, int do_ack); 226 - extern void leon_init_timers(void); 227 - extern void leon_trans_init(struct device_node *dp); 228 - extern void leon_node_init(struct device_node *dp, struct device_node ***nextp); 229 - extern void init_leon(void); 230 - extern void poke_leonsparc(void); 231 - extern void leon3_getCacheRegs(struct leon3_cacheregs *regs); 220 + unsigned int leon_build_device_irq(unsigned int real_irq, 221 + irq_flow_handler_t flow_handler, 222 + const char *name, int do_ack); 223 + void leon_update_virq_handling(unsigned int virq, 224 + irq_flow_handler_t flow_handler, 225 + const char *name, int do_ack); 226 + void leon_init_timers(void); 227 + void leon_trans_init(struct device_node *dp); 228 + void leon_node_init(struct device_node *dp, struct device_node ***nextp); 229 + void init_leon(void); 230 + void poke_leonsparc(void); 231 + void leon3_getCacheRegs(struct leon3_cacheregs *regs); 232 232 extern int leon3_ticker_irq; 233 233 234 234 #ifdef CONFIG_SMP 235 - extern int leon_smp_nrcpus(void); 236 - extern void leon_clear_profile_irq(int cpu); 237 - extern void leon_smp_done(void); 238 - extern void leon_boot_cpus(void); 239 - extern int leon_boot_one_cpu(int i, struct task_struct *); 235 + int leon_smp_nrcpus(void); 236 + void leon_clear_profile_irq(int cpu); 237 + void leon_smp_done(void); 238 + void leon_boot_cpus(void); 239 + int leon_boot_one_cpu(int i, struct task_struct *); 240 240 void leon_init_smp(void); 241 241 void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu); 242 - extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); 242 + irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused); 243 243 244 244 extern unsigned int smpleon_ipi[]; 245 245 extern unsigned int linux_trap_ipi15_leon[];
+2 -2
arch/sparc/include/asm/leon_pci.h
··· 16 16 int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); 17 17 }; 18 18 19 - extern void leon_pci_init(struct platform_device *ofdev, 20 - struct leon_pci_info *info); 19 + void leon_pci_init(struct platform_device *ofdev, 20 + struct leon_pci_info *info); 21 21 22 22 #endif /* _ASM_LEON_PCI_H_ */
+5
arch/sparc/include/asm/mc146818rtc.h
··· 1 1 #ifndef ___ASM_SPARC_MC146818RTC_H 2 2 #define ___ASM_SPARC_MC146818RTC_H 3 + 4 + #include <linux/spinlock.h> 5 + 6 + extern spinlock_t rtc_lock; 7 + 3 8 #if defined(__sparc__) && defined(__arch64__) 4 9 #include <asm/mc146818rtc_64.h> 5 10 #else
+16 -16
arch/sparc/include/asm/mdesc.h
··· 12 12 * the first argument to all of the operational calls that work 13 13 * on mdescs. 14 14 */ 15 - extern struct mdesc_handle *mdesc_grab(void); 16 - extern void mdesc_release(struct mdesc_handle *); 15 + struct mdesc_handle *mdesc_grab(void); 16 + void mdesc_release(struct mdesc_handle *); 17 17 18 18 #define MDESC_NODE_NULL (~(u64)0) 19 19 20 - extern u64 mdesc_node_by_name(struct mdesc_handle *handle, 21 - u64 from_node, const char *name); 20 + u64 mdesc_node_by_name(struct mdesc_handle *handle, 21 + u64 from_node, const char *name); 22 22 #define mdesc_for_each_node_by_name(__hdl, __node, __name) \ 23 23 for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \ 24 24 (__node) != MDESC_NODE_NULL; \ ··· 34 34 * 35 35 * These same rules apply to mdesc_node_name(). 36 36 */ 37 - extern const void *mdesc_get_property(struct mdesc_handle *handle, 38 - u64 node, const char *name, int *lenp); 39 - extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); 37 + const void *mdesc_get_property(struct mdesc_handle *handle, 38 + u64 node, const char *name, int *lenp); 39 + const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); 40 40 41 41 /* MD arc iteration, the standard sequence is: 42 42 * ··· 50 50 #define MDESC_ARC_TYPE_FWD "fwd" 51 51 #define MDESC_ARC_TYPE_BACK "back" 52 52 53 - extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, 54 - const char *arc_type); 53 + u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, 54 + const char *arc_type); 55 55 #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \ 56 56 for (__arc = mdesc_next_arc(__hdl, __node, __type); \ 57 57 (__arc) != MDESC_NODE_NULL; \ 58 58 __arc = mdesc_next_arc(__hdl, __arc, __type)) 59 59 60 - extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); 60 + u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); 61 61 62 - extern void mdesc_update(void); 62 + void mdesc_update(void); 63 63 64 64 struct mdesc_notifier_client { 65 65 void (*add)(struct mdesc_handle *handle, u64 node); ··· 69 69 struct mdesc_notifier_client *next; 70 70 }; 71 71 72 - extern void mdesc_register_notifier(struct mdesc_notifier_client *client); 72 + void mdesc_register_notifier(struct mdesc_notifier_client *client); 73 73 74 - extern void mdesc_fill_in_cpu_data(cpumask_t *mask); 75 - extern void mdesc_populate_present_mask(cpumask_t *mask); 76 - extern void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask); 74 + void mdesc_fill_in_cpu_data(cpumask_t *mask); 75 + void mdesc_populate_present_mask(cpumask_t *mask); 76 + void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask); 77 77 78 - extern void sun4v_mdesc_init(void); 78 + void sun4v_mdesc_init(void); 79 79 80 80 #endif
+3 -3
arch/sparc/include/asm/mmu_64.h
··· 67 67 unsigned long pte; 68 68 } __attribute__((aligned(TSB_ENTRY_ALIGNMENT))); 69 69 70 - extern void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); 71 - extern void tsb_flush(unsigned long ent, unsigned long tag); 72 - extern void tsb_init(struct tsb *tsb, unsigned long size); 70 + void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); 71 + void tsb_flush(unsigned long ent, unsigned long tag); 72 + void tsb_init(struct tsb *tsb, unsigned long size); 73 73 74 74 struct tsb_config { 75 75 struct tsb *tsb;
+13 -11
arch/sparc/include/asm/mmu_context_64.h
··· 17 17 extern unsigned long tlb_context_cache; 18 18 extern unsigned long mmu_context_bmap[]; 19 19 20 - extern void get_new_mmu_context(struct mm_struct *mm); 20 + void get_new_mmu_context(struct mm_struct *mm); 21 21 #ifdef CONFIG_SMP 22 - extern void smp_new_mmu_context_version(void); 22 + void smp_new_mmu_context_version(void); 23 23 #else 24 24 #define smp_new_mmu_context_version() do { } while (0) 25 25 #endif 26 26 27 - extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 28 - extern void destroy_context(struct mm_struct *mm); 27 + int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 28 + void destroy_context(struct mm_struct *mm); 29 29 30 - extern void __tsb_context_switch(unsigned long pgd_pa, 31 - struct tsb_config *tsb_base, 32 - struct tsb_config *tsb_huge, 33 - unsigned long tsb_descr_pa); 30 + void __tsb_context_switch(unsigned long pgd_pa, 31 + struct tsb_config *tsb_base, 32 + struct tsb_config *tsb_huge, 33 + unsigned long tsb_descr_pa); 34 34 35 35 static inline void tsb_context_switch(struct mm_struct *mm) 36 36 { ··· 46 46 , __pa(&mm->context.tsb_descr[0])); 47 47 } 48 48 49 - extern void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long mm_rss); 49 + void tsb_grow(struct mm_struct *mm, 50 + unsigned long tsb_index, 51 + unsigned long mm_rss); 50 52 #ifdef CONFIG_SMP 51 - extern void smp_tsb_sync(struct mm_struct *mm); 53 + void smp_tsb_sync(struct mm_struct *mm); 52 54 #else 53 55 #define smp_tsb_sync(__mm) do { } while (0) 54 56 #endif ··· 68 66 : "r" (CTX_HWBITS((__mm)->context)), \ 69 67 "r" (SECONDARY_CONTEXT), "i" (ASI_DMMU), "i" (ASI_MMU)) 70 68 71 - extern void __flush_tlb_mm(unsigned long, unsigned long); 69 + void __flush_tlb_mm(unsigned long, unsigned long); 72 70 73 71 /* Switch the current MM context. */ 74 72 static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
+5 -5
arch/sparc/include/asm/nmi.h
··· 1 1 #ifndef __NMI_H 2 2 #define __NMI_H 3 3 4 - extern int __init nmi_init(void); 5 - extern void perfctr_irq(int irq, struct pt_regs *regs); 6 - extern void nmi_adjust_hz(unsigned int new_hz); 4 + int __init nmi_init(void); 5 + void perfctr_irq(int irq, struct pt_regs *regs); 6 + void nmi_adjust_hz(unsigned int new_hz); 7 7 8 8 extern atomic_t nmi_active; 9 9 10 - extern void start_nmi_watchdog(void *unused); 11 - extern void stop_nmi_watchdog(void *unused); 10 + void start_nmi_watchdog(void *unused); 11 + void stop_nmi_watchdog(void *unused); 12 12 13 13 #endif /* __NMI_H */
+34 -34
arch/sparc/include/asm/oplib_32.h
··· 43 43 /* You must call prom_init() before using any of the library services, 44 44 * preferably as early as possible. Pass it the romvec pointer. 45 45 */ 46 - extern void prom_init(struct linux_romvec *rom_ptr); 46 + void prom_init(struct linux_romvec *rom_ptr); 47 47 48 48 /* Boot argument acquisition, returns the boot command line string. */ 49 - extern char *prom_getbootargs(void); 49 + char *prom_getbootargs(void); 50 50 51 51 /* Miscellaneous routines, don't really fit in any category per se. */ 52 52 53 53 /* Reboot the machine with the command line passed. */ 54 - extern void prom_reboot(char *boot_command); 54 + void prom_reboot(char *boot_command); 55 55 56 56 /* Evaluate the forth string passed. */ 57 - extern void prom_feval(char *forth_string); 57 + void prom_feval(char *forth_string); 58 58 59 59 /* Enter the prom, with possibility of continuation with the 'go' 60 60 * command in newer proms. 61 61 */ 62 - extern void prom_cmdline(void); 62 + void prom_cmdline(void); 63 63 64 64 /* Enter the prom, with no chance of continuation for the stand-alone 65 65 * which calls this. 66 66 */ 67 - extern void __noreturn prom_halt(void); 67 + void __noreturn prom_halt(void); 68 68 69 69 /* Set the PROM 'sync' callback function to the passed function pointer. 70 70 * When the user gives the 'sync' command at the prom prompt while the ··· 73 73 * XXX The arguments are different on V0 vs. V2->higher proms, grrr! XXX 74 74 */ 75 75 typedef void (*sync_func_t)(void); 76 - extern void prom_setsync(sync_func_t func_ptr); 76 + void prom_setsync(sync_func_t func_ptr); 77 77 78 78 /* Acquire the IDPROM of the root node in the prom device tree. This 79 79 * gets passed a buffer where you would like it stuffed. The return value 80 80 * is the format type of this idprom or 0xff on error. 81 81 */ 82 - extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); 82 + unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); 83 83 84 84 /* Get the prom major version. */ 85 - extern int prom_version(void); 85 + int prom_version(void); 86 86 87 87 /* Get the prom plugin revision. */ 88 - extern int prom_getrev(void); 88 + int prom_getrev(void); 89 89 90 90 /* Get the prom firmware revision. */ 91 - extern int prom_getprev(void); 91 + int prom_getprev(void); 92 92 93 93 /* Write a buffer of characters to the console. */ 94 - extern void prom_console_write_buf(const char *buf, int len); 94 + void prom_console_write_buf(const char *buf, int len); 95 95 96 96 /* Prom's internal routines, don't use in kernel/boot code. */ 97 - extern __printf(1, 2) void prom_printf(const char *fmt, ...); 98 - extern void prom_write(const char *buf, unsigned int len); 97 + __printf(1, 2) void prom_printf(const char *fmt, ...); 98 + void prom_write(const char *buf, unsigned int len); 99 99 100 100 /* Multiprocessor operations... */ 101 101 102 102 /* Start the CPU with the given device tree node, context table, and context 103 103 * at the passed program counter. 104 104 */ 105 - extern int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, 106 - int context, char *program_counter); 105 + int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, 106 + int context, char *program_counter); 107 107 108 108 /* Initialize the memory lists based upon the prom version. */ 109 109 void prom_meminit(void); ··· 111 111 /* PROM device tree traversal functions... */ 112 112 113 113 /* Get the child node of the given node, or zero if no child exists. */ 114 - extern phandle prom_getchild(phandle parent_node); 114 + phandle prom_getchild(phandle parent_node); 115 115 116 116 /* Get the next sibling node of the given node, or zero if no further 117 117 * siblings exist. 118 118 */ 119 - extern phandle prom_getsibling(phandle node); 119 + phandle prom_getsibling(phandle node); 120 120 121 121 /* Get the length, at the passed node, of the given property type. 122 122 * Returns -1 on error (ie. no such property at this node). 123 123 */ 124 - extern int prom_getproplen(phandle thisnode, const char *property); 124 + int prom_getproplen(phandle thisnode, const char *property); 125 125 126 126 /* Fetch the requested property using the given buffer. Returns 127 127 * the number of bytes the prom put into your buffer or -1 on error. 128 128 */ 129 - extern int __must_check prom_getproperty(phandle thisnode, const char *property, 130 - char *prop_buffer, int propbuf_size); 129 + int __must_check prom_getproperty(phandle thisnode, const char *property, 130 + char *prop_buffer, int propbuf_size); 131 131 132 132 /* Acquire an integer property. */ 133 - extern int prom_getint(phandle node, char *property); 133 + int prom_getint(phandle node, char *property); 134 134 135 135 /* Acquire an integer property, with a default value. */ 136 - extern int prom_getintdefault(phandle node, char *property, int defval); 136 + int prom_getintdefault(phandle node, char *property, int defval); 137 137 138 138 /* Acquire a boolean property, 0=FALSE 1=TRUE. */ 139 - extern int prom_getbool(phandle node, char *prop); 139 + int prom_getbool(phandle node, char *prop); 140 140 141 141 /* Acquire a string property, null string on error. */ 142 - extern void prom_getstring(phandle node, char *prop, char *buf, int bufsize); 142 + void prom_getstring(phandle node, char *prop, char *buf, int bufsize); 143 143 144 144 /* Search all siblings starting at the passed node for "name" matching 145 145 * the given string. Returns the node on success, zero on failure. 146 146 */ 147 - extern phandle prom_searchsiblings(phandle node_start, char *name); 147 + phandle prom_searchsiblings(phandle node_start, char *name); 148 148 149 149 /* Returns the next property after the passed property for the given 150 150 * node. Returns null string on failure. 151 151 */ 152 - extern char *prom_nextprop(phandle node, char *prev_property, char *buffer); 152 + char *prom_nextprop(phandle node, char *prev_property, char *buffer); 153 153 154 154 /* Returns phandle of the path specified */ 155 - extern phandle prom_finddevice(char *name); 155 + phandle prom_finddevice(char *name); 156 156 157 157 /* Set the indicated property at the given node with the passed value. 158 158 * Returns the number of bytes of your value that the prom took. 159 159 */ 160 - extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, 161 - int value_size); 160 + int prom_setprop(phandle node, const char *prop_name, char *prop_value, 161 + int value_size); 162 162 163 - extern phandle prom_inst2pkg(int); 163 + phandle prom_inst2pkg(int); 164 164 165 165 /* Dorking with Bus ranges... */ 166 166 167 167 /* Apply promlib probes OBIO ranges to registers. */ 168 - extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs); 168 + void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs); 169 169 170 170 /* Apply ranges of any prom node (and optionally parent node as well) to registers. */ 171 - extern void prom_apply_generic_ranges(phandle node, phandle parent, 172 - struct linux_prom_registers *sbusregs, int nregs); 171 + void prom_apply_generic_ranges(phandle node, phandle parent, 172 + struct linux_prom_registers *sbusregs, int nregs); 173 173 174 174 void prom_ranges_init(void); 175 175
+56 -56
arch/sparc/include/asm/oplib_64.h
··· 62 62 /* You must call prom_init() before using any of the library services, 63 63 * preferably as early as possible. Pass it the romvec pointer. 64 64 */ 65 - extern void prom_init(void *cif_handler, void *cif_stack); 65 + void prom_init(void *cif_handler, void *cif_stack); 66 66 67 67 /* Boot argument acquisition, returns the boot command line string. */ 68 - extern char *prom_getbootargs(void); 68 + char *prom_getbootargs(void); 69 69 70 70 /* Miscellaneous routines, don't really fit in any category per se. */ 71 71 72 72 /* Reboot the machine with the command line passed. */ 73 - extern void prom_reboot(const char *boot_command); 73 + void prom_reboot(const char *boot_command); 74 74 75 75 /* Evaluate the forth string passed. */ 76 - extern void prom_feval(const char *forth_string); 76 + void prom_feval(const char *forth_string); 77 77 78 78 /* Enter the prom, with possibility of continuation with the 'go' 79 79 * command in newer proms. 80 80 */ 81 - extern void prom_cmdline(void); 81 + void prom_cmdline(void); 82 82 83 83 /* Enter the prom, with no chance of continuation for the stand-alone 84 84 * which calls this. 85 85 */ 86 - extern void prom_halt(void) __attribute__ ((noreturn)); 86 + void prom_halt(void) __attribute__ ((noreturn)); 87 87 88 88 /* Halt and power-off the machine. */ 89 - extern void prom_halt_power_off(void) __attribute__ ((noreturn)); 89 + void prom_halt_power_off(void) __attribute__ ((noreturn)); 90 90 91 91 /* Acquire the IDPROM of the root node in the prom device tree. This 92 92 * gets passed a buffer where you would like it stuffed. The return value 93 93 * is the format type of this idprom or 0xff on error. 94 94 */ 95 - extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); 95 + unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); 96 96 97 97 /* Write a buffer of characters to the console. */ 98 - extern void prom_console_write_buf(const char *buf, int len); 98 + void prom_console_write_buf(const char *buf, int len); 99 99 100 100 /* Prom's internal routines, don't use in kernel/boot code. */ 101 - extern __printf(1, 2) void prom_printf(const char *fmt, ...); 102 - extern void prom_write(const char *buf, unsigned int len); 101 + __printf(1, 2) void prom_printf(const char *fmt, ...); 102 + void prom_write(const char *buf, unsigned int len); 103 103 104 104 /* Multiprocessor operations... */ 105 105 #ifdef CONFIG_SMP 106 106 /* Start the CPU with the given device tree node at the passed program 107 107 * counter with the given arg passed in via register %o0. 108 108 */ 109 - extern void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg); 109 + void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg); 110 110 111 111 /* Start the CPU with the given cpu ID at the passed program 112 112 * counter with the given arg passed in via register %o0. 113 113 */ 114 - extern void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg); 114 + void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg); 115 115 116 116 /* Stop the CPU with the given cpu ID. */ 117 - extern void prom_stopcpu_cpuid(int cpuid); 117 + void prom_stopcpu_cpuid(int cpuid); 118 118 119 119 /* Stop the current CPU. */ 120 - extern void prom_stopself(void); 120 + void prom_stopself(void); 121 121 122 122 /* Idle the current CPU. */ 123 - extern void prom_idleself(void); 123 + void prom_idleself(void); 124 124 125 125 /* Resume the CPU with the passed device tree node. */ 126 - extern void prom_resumecpu(int cpunode); 126 + void prom_resumecpu(int cpunode); 127 127 #endif 128 128 129 129 /* Power management interfaces. */ 130 130 131 131 /* Put the current CPU to sleep. */ 132 - extern void prom_sleepself(void); 132 + void prom_sleepself(void); 133 133 134 134 /* Put the entire system to sleep. */ 135 - extern int prom_sleepsystem(void); 135 + int prom_sleepsystem(void); 136 136 137 137 /* Initiate a wakeup event. */ 138 - extern int prom_wakeupsystem(void); 138 + int prom_wakeupsystem(void); 139 139 140 140 /* MMU and memory related OBP interfaces. */ 141 141 142 142 /* Get unique string identifying SIMM at given physical address. */ 143 - extern int prom_getunumber(int syndrome_code, 144 - unsigned long phys_addr, 145 - char *buf, int buflen); 143 + int prom_getunumber(int syndrome_code, 144 + unsigned long phys_addr, 145 + char *buf, int buflen); 146 146 147 147 /* Retain physical memory to the caller across soft resets. */ 148 - extern int prom_retain(const char *name, unsigned long size, 149 - unsigned long align, unsigned long *paddr); 148 + int prom_retain(const char *name, unsigned long size, 149 + unsigned long align, unsigned long *paddr); 150 150 151 151 /* Load explicit I/D TLB entries into the calling processor. */ 152 - extern long prom_itlb_load(unsigned long index, 153 - unsigned long tte_data, 154 - unsigned long vaddr); 152 + long prom_itlb_load(unsigned long index, 153 + unsigned long tte_data, 154 + unsigned long vaddr); 155 155 156 - extern long prom_dtlb_load(unsigned long index, 157 - unsigned long tte_data, 158 - unsigned long vaddr); 156 + long prom_dtlb_load(unsigned long index, 157 + unsigned long tte_data, 158 + unsigned long vaddr); 159 159 160 160 /* Map/Unmap client program address ranges. First the format of 161 161 * the mapping mode argument. ··· 170 170 #define PROM_MAP_IE 0x0100 /* Invert-Endianness */ 171 171 #define PROM_MAP_DEFAULT (PROM_MAP_WRITE | PROM_MAP_READ | PROM_MAP_EXEC | PROM_MAP_CACHED) 172 172 173 - extern int prom_map(int mode, unsigned long size, 174 - unsigned long vaddr, unsigned long paddr); 175 - extern void prom_unmap(unsigned long size, unsigned long vaddr); 173 + int prom_map(int mode, unsigned long size, 174 + unsigned long vaddr, unsigned long paddr); 175 + void prom_unmap(unsigned long size, unsigned long vaddr); 176 176 177 177 178 178 /* PROM device tree traversal functions... */ 179 179 180 180 /* Get the child node of the given node, or zero if no child exists. */ 181 - extern phandle prom_getchild(phandle parent_node); 181 + phandle prom_getchild(phandle parent_node); 182 182 183 183 /* Get the next sibling node of the given node, or zero if no further 184 184 * siblings exist. 185 185 */ 186 - extern phandle prom_getsibling(phandle node); 186 + phandle prom_getsibling(phandle node); 187 187 188 188 /* Get the length, at the passed node, of the given property type. 189 189 * Returns -1 on error (ie. no such property at this node). 190 190 */ 191 - extern int prom_getproplen(phandle thisnode, const char *property); 191 + int prom_getproplen(phandle thisnode, const char *property); 192 192 193 193 /* Fetch the requested property using the given buffer. Returns 194 194 * the number of bytes the prom put into your buffer or -1 on error. 195 195 */ 196 - extern int prom_getproperty(phandle thisnode, const char *property, 197 - char *prop_buffer, int propbuf_size); 196 + int prom_getproperty(phandle thisnode, const char *property, 197 + char *prop_buffer, int propbuf_size); 198 198 199 199 /* Acquire an integer property. */ 200 - extern int prom_getint(phandle node, const char *property); 200 + int prom_getint(phandle node, const char *property); 201 201 202 202 /* Acquire an integer property, with a default value. */ 203 - extern int prom_getintdefault(phandle node, const char *property, int defval); 203 + int prom_getintdefault(phandle node, const char *property, int defval); 204 204 205 205 /* Acquire a boolean property, 0=FALSE 1=TRUE. */ 206 - extern int prom_getbool(phandle node, const char *prop); 206 + int prom_getbool(phandle node, const char *prop); 207 207 208 208 /* Acquire a string property, null string on error. */ 209 - extern void prom_getstring(phandle node, const char *prop, char *buf, 210 - int bufsize); 209 + void prom_getstring(phandle node, const char *prop, char *buf, 210 + int bufsize); 211 211 212 212 /* Does the passed node have the given "name"? YES=1 NO=0 */ 213 - extern int prom_nodematch(phandle thisnode, const char *name); 213 + int prom_nodematch(phandle thisnode, const char *name); 214 214 215 215 /* Search all siblings starting at the passed node for "name" matching 216 216 * the given string. Returns the node on success, zero on failure. 217 217 */ 218 - extern phandle prom_searchsiblings(phandle node_start, const char *name); 218 + phandle prom_searchsiblings(phandle node_start, const char *name); 219 219 220 220 /* Return the first property type, as a string, for the given node. 221 221 * Returns a null string on error. Buffer should be at least 32B long. 222 222 */ 223 - extern char *prom_firstprop(phandle node, char *buffer); 223 + char *prom_firstprop(phandle node, char *buffer); 224 224 225 225 /* Returns the next property after the passed property for the given 226 226 * node. Returns null string on failure. Buffer should be at least 32B long. 227 227 */ 228 - extern char *prom_nextprop(phandle node, const char *prev_property, char *buf); 228 + char *prom_nextprop(phandle node, const char *prev_property, char *buf); 229 229 230 230 /* Returns 1 if the specified node has given property. */ 231 - extern int prom_node_has_property(phandle node, const char *property); 231 + int prom_node_has_property(phandle node, const char *property); 232 232 233 233 /* Returns phandle of the path specified */ 234 - extern phandle prom_finddevice(const char *name); 234 + phandle prom_finddevice(const char *name); 235 235 236 236 /* Set the indicated property at the given node with the passed value. 237 237 * Returns the number of bytes of your value that the prom took. 238 238 */ 239 - extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, 240 - int value_size); 239 + int prom_setprop(phandle node, const char *prop_name, char *prop_value, 240 + int value_size); 241 241 242 - extern phandle prom_inst2pkg(int); 243 - extern void prom_sun4v_guest_soft_state(void); 242 + phandle prom_inst2pkg(int); 243 + void prom_sun4v_guest_soft_state(void); 244 244 245 - extern int prom_ihandle2path(int handle, char *buffer, int bufsize); 245 + int prom_ihandle2path(int handle, char *buffer, int bufsize); 246 246 247 247 /* Client interface level routines. */ 248 - extern void p1275_cmd_direct(unsigned long *); 248 + void p1275_cmd_direct(unsigned long *); 249 249 250 250 #endif /* !(__SPARC64_OPLIB_H) */
+3
arch/sparc/include/asm/page.h
··· 1 1 #ifndef ___ASM_SPARC_PAGE_H 2 2 #define ___ASM_SPARC_PAGE_H 3 + 4 + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 5 + 3 6 #if defined(__sparc__) && defined(__arch64__) 4 7 #include <asm/page_64.h> 5 8 #else
+4 -4
arch/sparc/include/asm/page_64.h
··· 31 31 32 32 #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) 33 33 struct pt_regs; 34 - extern void hugetlb_setup(struct pt_regs *regs); 34 + void hugetlb_setup(struct pt_regs *regs); 35 35 #endif 36 36 37 37 #define WANT_PAGE_VIRTUAL 38 38 39 - extern void _clear_page(void *page); 39 + void _clear_page(void *page); 40 40 #define clear_page(X) _clear_page((void *)(X)) 41 41 struct page; 42 - extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page); 42 + void clear_user_page(void *addr, unsigned long vaddr, struct page *page); 43 43 #define copy_page(X,Y) memcpy((void *)(X), (void *)(Y), PAGE_SIZE) 44 - extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage); 44 + void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage); 45 45 46 46 /* Unlike sparc32, sparc64's parameter passing API is more 47 47 * sane in that structures which as small enough are passed
+7 -7
arch/sparc/include/asm/pci_64.h
··· 52 52 53 53 /* Return the index of the PCI controller for device PDEV. */ 54 54 55 - extern int pci_domain_nr(struct pci_bus *bus); 55 + int pci_domain_nr(struct pci_bus *bus); 56 56 static inline int pci_proc_domain(struct pci_bus *bus) 57 57 { 58 58 return 1; ··· 64 64 #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA 65 65 #define get_pci_unmapped_area get_fb_unmapped_area 66 66 67 - extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 68 - enum pci_mmap_state mmap_state, 69 - int write_combine); 67 + int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 68 + enum pci_mmap_state mmap_state, 69 + int write_combine); 70 70 71 71 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 72 72 { ··· 74 74 } 75 75 76 76 #define HAVE_ARCH_PCI_RESOURCE_TO_USER 77 - extern void pci_resource_to_user(const struct pci_dev *dev, int bar, 78 - const struct resource *rsrc, 79 - resource_size_t *start, resource_size_t *end); 77 + void pci_resource_to_user(const struct pci_dev *dev, int bar, 78 + const struct resource *rsrc, 79 + resource_size_t *start, resource_size_t *end); 80 80 #endif /* __KERNEL__ */ 81 81 82 82 #endif /* __SPARC64_PCI_H */
+4 -4
arch/sparc/include/asm/pcic.h
··· 30 30 }; 31 31 32 32 #ifdef CONFIG_PCIC_PCI 33 - extern int pcic_present(void); 34 - extern int pcic_probe(void); 35 - extern void pci_time_init(void); 36 - extern void sun4m_pci_init_IRQ(void); 33 + int pcic_present(void); 34 + int pcic_probe(void); 35 + void pci_time_init(void); 36 + void sun4m_pci_init_IRQ(void); 37 37 #else 38 38 static inline int pcic_present(void) { return 0; } 39 39 static inline int pcic_probe(void) { return 0; }
+3 -3
arch/sparc/include/asm/pcr.h
··· 12 12 }; 13 13 extern const struct pcr_ops *pcr_ops; 14 14 15 - extern void deferred_pcr_work_irq(int irq, struct pt_regs *regs); 16 - extern void schedule_deferred_pcr_work(void); 15 + void deferred_pcr_work_irq(int irq, struct pt_regs *regs); 16 + void schedule_deferred_pcr_work(void); 17 17 18 18 #define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */ 19 19 #define PCR_STRACE 0x00000002 /* Trace supervisor events */ ··· 45 45 #define PCR_N4_PICNHT 0x00020000 /* PIC non-hypervisor trap */ 46 46 #define PCR_N4_NTC 0x00040000 /* Next-To-Commit wrap */ 47 47 48 - extern int pcr_arch_init(void); 48 + int pcr_arch_init(void); 49 49 50 50 #endif /* __PCR_H */
+2
arch/sparc/include/asm/pgalloc_32.h
··· 14 14 void *srmmu_get_nocache(int size, int align); 15 15 void srmmu_free_nocache(void *addr, int size); 16 16 17 + extern struct resource sparc_iomap; 18 + 17 19 #define check_pgt_cache() do { } while (0) 18 20 19 21 pgd_t *get_pgd_fast(void);
+8 -8
arch/sparc/include/asm/pgalloc_64.h
··· 38 38 kmem_cache_free(pgtable_cache, pmd); 39 39 } 40 40 41 - extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 42 - unsigned long address); 43 - extern pgtable_t pte_alloc_one(struct mm_struct *mm, 44 - unsigned long address); 45 - extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); 46 - extern void pte_free(struct mm_struct *mm, pgtable_t ptepage); 41 + pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 42 + unsigned long address); 43 + pgtable_t pte_alloc_one(struct mm_struct *mm, 44 + unsigned long address); 45 + void pte_free_kernel(struct mm_struct *mm, pte_t *pte); 46 + void pte_free(struct mm_struct *mm, pgtable_t ptepage); 47 47 48 48 #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(MM, PMD, PTE) 49 49 #define pmd_populate(MM, PMD, PTE) pmd_set(MM, PMD, PTE) ··· 51 51 52 52 #define check_pgt_cache() do { } while (0) 53 53 54 - extern void pgtable_free(void *table, bool is_page); 54 + void pgtable_free(void *table, bool is_page); 55 55 56 56 #ifdef CONFIG_SMP 57 57 58 58 struct mmu_gather; 59 - extern void tlb_remove_table(struct mmu_gather *, void *); 59 + void tlb_remove_table(struct mmu_gather *, void *); 60 60 61 61 static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, bool is_page) 62 62 {
+6 -5
arch/sparc/include/asm/pgtable_32.h
··· 25 25 struct vm_area_struct; 26 26 struct page; 27 27 28 - extern void load_mmu(void); 29 - extern unsigned long calc_highpages(void); 28 + void load_mmu(void); 29 + unsigned long calc_highpages(void); 30 + unsigned long __init bootmem_init(unsigned long *pages_avail); 30 31 31 32 #define pte_ERROR(e) __builtin_trap() 32 33 #define pmd_ERROR(e) __builtin_trap() ··· 57 56 * srmmu.c will assign the real one (which is dynamically sized) */ 58 57 #define swapper_pg_dir NULL 59 58 60 - extern void paging_init(void); 59 + void paging_init(void); 61 60 62 61 extern unsigned long ptr_in_current_pgd; 63 62 ··· 429 428 #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 430 429 #define GET_PFN(pfn) (pfn & 0x0fffffffUL) 431 430 432 - extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, 433 - unsigned long, pgprot_t); 431 + int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, 432 + unsigned long, pgprot_t); 434 433 435 434 static inline int io_remap_pfn_range(struct vm_area_struct *vma, 436 435 unsigned long from, unsigned long pfn,
+29 -29
arch/sparc/include/asm/pgtable_64.h
··· 210 210 211 211 #ifndef __ASSEMBLY__ 212 212 213 - extern pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long); 213 + pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long); 214 214 215 - extern unsigned long pte_sz_bits(unsigned long size); 215 + unsigned long pte_sz_bits(unsigned long size); 216 216 217 217 extern pgprot_t PAGE_KERNEL; 218 218 extern pgprot_t PAGE_KERNEL_LOCKED; ··· 780 780 !__kern_addr_valid(pud_val(pud))) 781 781 782 782 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 783 - extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, 784 - pmd_t *pmdp, pmd_t pmd); 783 + void set_pmd_at(struct mm_struct *mm, unsigned long addr, 784 + pmd_t *pmdp, pmd_t pmd); 785 785 #else 786 786 static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, 787 787 pmd_t *pmdp, pmd_t pmd) ··· 840 840 #define pte_unmap(pte) do { } while (0) 841 841 842 842 /* Actual page table PTE updates. */ 843 - extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, 844 - pte_t *ptep, pte_t orig, int fullmm); 843 + void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, 844 + pte_t *ptep, pte_t orig, int fullmm); 845 845 846 846 #define __HAVE_ARCH_PMDP_GET_AND_CLEAR 847 847 static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, ··· 900 900 extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 901 901 extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD]; 902 902 903 - extern void paging_init(void); 904 - extern unsigned long find_ecache_flush_span(unsigned long size); 903 + void paging_init(void); 904 + unsigned long find_ecache_flush_span(unsigned long size); 905 905 906 906 struct seq_file; 907 - extern void mmu_info(struct seq_file *); 907 + void mmu_info(struct seq_file *); 908 908 909 909 struct vm_area_struct; 910 - extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); 910 + void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); 911 911 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 912 - extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, 913 - pmd_t *pmd); 912 + void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, 913 + pmd_t *pmd); 914 914 915 915 #define __HAVE_ARCH_PMDP_INVALIDATE 916 916 extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, 917 917 pmd_t *pmdp); 918 918 919 919 #define __HAVE_ARCH_PGTABLE_DEPOSIT 920 - extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, 921 - pgtable_t pgtable); 920 + void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, 921 + pgtable_t pgtable); 922 922 923 923 #define __HAVE_ARCH_PGTABLE_WITHDRAW 924 - extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); 924 + pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); 925 925 #endif 926 926 927 927 /* Encode and de-code a swap entry */ ··· 937 937 #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 938 938 939 939 /* File offset in PTE support. */ 940 - extern unsigned long pte_file(pte_t); 940 + unsigned long pte_file(pte_t); 941 941 #define pte_to_pgoff(pte) (pte_val(pte) >> PAGE_SHIFT) 942 - extern pte_t pgoff_to_pte(unsigned long); 942 + pte_t pgoff_to_pte(unsigned long); 943 943 #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) 944 944 945 - extern int page_in_phys_avail(unsigned long paddr); 945 + int page_in_phys_avail(unsigned long paddr); 946 946 947 947 /* 948 948 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in ··· 952 952 #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 953 953 #define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL) 954 954 955 - extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, 956 - unsigned long, pgprot_t); 955 + int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long, 956 + unsigned long, pgprot_t); 957 957 958 958 static inline int io_remap_pfn_range(struct vm_area_struct *vma, 959 959 unsigned long from, unsigned long pfn, ··· 981 981 /* We provide a special get_unmapped_area for framebuffer mmaps to try and use 982 982 * the largest alignment possible such that larget PTEs can be used. 983 983 */ 984 - extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, 985 - unsigned long, unsigned long, 986 - unsigned long); 984 + unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, 985 + unsigned long, unsigned long, 986 + unsigned long); 987 987 #define HAVE_ARCH_FB_UNMAPPED_AREA 988 988 989 - extern void pgtable_cache_init(void); 990 - extern void sun4v_register_fault_status(void); 991 - extern void sun4v_ktsb_register(void); 992 - extern void __init cheetah_ecache_flush_init(void); 993 - extern void sun4v_patch_tlb_handlers(void); 989 + void pgtable_cache_init(void); 990 + void sun4v_register_fault_status(void); 991 + void sun4v_ktsb_register(void); 992 + void __init cheetah_ecache_flush_init(void); 993 + void sun4v_patch_tlb_handlers(void); 994 994 995 995 extern unsigned long cmdline_memory_size; 996 996 997 - extern asmlinkage void do_sparc64_fault(struct pt_regs *regs); 997 + asmlinkage void do_sparc64_fault(struct pt_regs *regs); 998 998 999 999 #endif /* !(__ASSEMBLY__) */ 1000 1000
+3 -2
arch/sparc/include/asm/processor_32.h
··· 74 74 } 75 75 76 76 /* Return saved PC of a blocked thread. */ 77 - extern unsigned long thread_saved_pc(struct task_struct *t); 77 + unsigned long thread_saved_pc(struct task_struct *t); 78 78 79 79 /* Do necessary setup to start up a newly executed thread. */ 80 80 static inline void start_thread(struct pt_regs * regs, unsigned long pc, ··· 107 107 /* Free all resources held by a thread. */ 108 108 #define release_thread(tsk) do { } while(0) 109 109 110 - extern unsigned long get_wchan(struct task_struct *); 110 + unsigned long get_wchan(struct task_struct *); 111 111 112 112 #define task_pt_regs(tsk) ((tsk)->thread.kregs) 113 113 #define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc) ··· 116 116 #ifdef __KERNEL__ 117 117 118 118 extern struct task_struct *last_task_used_math; 119 + int do_mathemu(struct pt_regs *regs, struct task_struct *fpt); 119 120 120 121 #define cpu_relax() barrier() 121 122 extern void (*sparc_idle)(void);
+4 -2
arch/sparc/include/asm/processor_64.h
··· 95 95 96 96 /* Return saved PC of a blocked thread. */ 97 97 struct task_struct; 98 - extern unsigned long thread_saved_pc(struct task_struct *); 98 + unsigned long thread_saved_pc(struct task_struct *); 99 99 100 100 /* On Uniprocessor, even in RMO processes see TSO semantics */ 101 101 #ifdef CONFIG_SMP ··· 194 194 /* Free all resources held by a thread. */ 195 195 #define release_thread(tsk) do { } while (0) 196 196 197 - extern unsigned long get_wchan(struct task_struct *task); 197 + unsigned long get_wchan(struct task_struct *task); 198 198 199 199 #define task_pt_regs(tsk) (task_thread_info(tsk)->kregs) 200 200 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) ··· 252 252 #define spin_lock_prefetch(x) prefetchw(x) 253 253 254 254 #define HAVE_ARCH_PICK_MMAP_LAYOUT 255 + 256 + int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap); 255 257 256 258 #endif /* !(__ASSEMBLY__) */ 257 259
+12 -12
arch/sparc/include/asm/prom.h
··· 36 36 void *data; 37 37 }; 38 38 39 - extern struct device_node *of_find_node_by_cpuid(int cpuid); 40 - extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 39 + struct device_node *of_find_node_by_cpuid(int cpuid); 40 + int of_set_property(struct device_node *node, const char *name, void *val, int len); 41 41 extern struct mutex of_set_property_mutex; 42 - extern int of_getintprop_default(struct device_node *np, 43 - const char *name, 42 + int of_getintprop_default(struct device_node *np, 43 + const char *name, 44 44 int def); 45 - extern int of_find_in_proplist(const char *list, const char *match, int len); 45 + int of_find_in_proplist(const char *list, const char *match, int len); 46 46 47 - extern void prom_build_devicetree(void); 48 - extern void of_populate_present_mask(void); 49 - extern void of_fill_in_cpu_data(void); 47 + void prom_build_devicetree(void); 48 + void of_populate_present_mask(void); 49 + void of_fill_in_cpu_data(void); 50 50 51 51 struct resource; 52 - extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 53 - extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 52 + void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 53 + void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 54 54 55 55 extern struct device_node *of_console_device; 56 56 extern char *of_console_path; 57 57 extern char *of_console_options; 58 58 59 - extern void irq_trans_init(struct device_node *dp); 60 - extern char *build_path_component(struct device_node *dp); 59 + void irq_trans_init(struct device_node *dp); 60 + char *build_path_component(struct device_node *dp); 61 61 62 62 #endif /* __KERNEL__ */ 63 63 #endif /* _SPARC_PROM_H */
+1 -1
arch/sparc/include/asm/ptrace.h
··· 73 73 return regs->u_regs[UREG_I0]; 74 74 } 75 75 #ifdef CONFIG_SMP 76 - extern unsigned long profile_pc(struct pt_regs *); 76 + unsigned long profile_pc(struct pt_regs *); 77 77 #else 78 78 #define profile_pc(regs) instruction_pointer(regs) 79 79 #endif
+37 -2
arch/sparc/include/asm/setup.h
··· 4 4 #ifndef _SPARC_SETUP_H 5 5 #define _SPARC_SETUP_H 6 6 7 - #include <uapi/asm/setup.h> 7 + #include <linux/interrupt.h> 8 8 9 + #include <uapi/asm/setup.h> 9 10 10 11 extern char reboot_command[]; 11 12 ··· 23 22 { 24 23 return serial_console ? 0 : 1; 25 24 } 25 + 26 + /* from irq_32.c */ 27 + extern volatile unsigned char *fdc_status; 28 + extern char *pdma_vaddr; 29 + extern unsigned long pdma_size; 30 + extern volatile int doing_pdma; 31 + 32 + /* This is software state */ 33 + extern char *pdma_base; 34 + extern unsigned long pdma_areasize; 35 + 36 + int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler); 37 + 38 + /* setup_32.c */ 39 + extern unsigned long cmdline_memory_size; 40 + 41 + /* devices.c */ 42 + void __init device_scan(void); 43 + 44 + /* unaligned_32.c */ 45 + unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int); 46 + 26 47 #endif 27 48 28 - extern void sun_do_break(void); 49 + #ifdef CONFIG_SPARC64 50 + /* unaligned_64.c */ 51 + int handle_ldf_stq(u32 insn, struct pt_regs *regs); 52 + void handle_ld_nf(u32 insn, struct pt_regs *regs); 53 + 54 + /* init_64.c */ 55 + extern atomic_t dcpage_flushes; 56 + extern atomic_t dcpage_flushes_xcall; 57 + 58 + extern int sysctl_tsb_ratio; 59 + #endif 60 + 61 + void sun_do_break(void); 29 62 extern int stop_a_enabled; 30 63 extern int scons_pwroff; 31 64
+14 -14
arch/sparc/include/asm/sfp-machine_32.h
··· 79 79 __asm__ ("addcc %r7,%8,%2\n\t" \ 80 80 "addxcc %r5,%6,%1\n\t" \ 81 81 "addx %r3,%4,%0\n" \ 82 - : "=r" ((USItype)(r2)), \ 83 - "=&r" ((USItype)(r1)), \ 84 - "=&r" ((USItype)(r0)) \ 82 + : "=r" (r2), \ 83 + "=&r" (r1), \ 84 + "=&r" (r0) \ 85 85 : "%rJ" ((USItype)(x2)), \ 86 86 "rI" ((USItype)(y2)), \ 87 87 "%rJ" ((USItype)(x1)), \ ··· 94 94 __asm__ ("subcc %r7,%8,%2\n\t" \ 95 95 "subxcc %r5,%6,%1\n\t" \ 96 96 "subx %r3,%4,%0\n" \ 97 - : "=r" ((USItype)(r2)), \ 98 - "=&r" ((USItype)(r1)), \ 99 - "=&r" ((USItype)(r0)) \ 97 + : "=r" (r2), \ 98 + "=&r" (r1), \ 99 + "=&r" (r0) \ 100 100 : "%rJ" ((USItype)(x2)), \ 101 101 "rI" ((USItype)(y2)), \ 102 102 "%rJ" ((USItype)(x1)), \ ··· 115 115 "addxcc %r6,%7,%0\n\t" \ 116 116 "addxcc %r4,%5,%%g2\n\t" \ 117 117 "addx %r2,%3,%%g1\n\t" \ 118 - : "=&r" ((USItype)(r1)), \ 119 - "=&r" ((USItype)(r0)) \ 118 + : "=&r" (r1), \ 119 + "=&r" (r0) \ 120 120 : "%rJ" ((USItype)(x3)), \ 121 121 "rI" ((USItype)(y3)), \ 122 122 "%rJ" ((USItype)(x2)), \ ··· 140 140 "subxcc %r6,%7,%0\n\t" \ 141 141 "subxcc %r4,%5,%%g2\n\t" \ 142 142 "subx %r2,%3,%%g1\n\t" \ 143 - : "=&r" ((USItype)(r1)), \ 144 - "=&r" ((USItype)(r0)) \ 143 + : "=&r" (r1), \ 144 + "=&r" (r0) \ 145 145 : "%rJ" ((USItype)(x3)), \ 146 146 "rI" ((USItype)(y3)), \ 147 147 "%rJ" ((USItype)(x2)), \ ··· 164 164 "addxcc %2,%%g0,%2\n\t" \ 165 165 "addxcc %1,%%g0,%1\n\t" \ 166 166 "addx %0,%%g0,%0\n\t" \ 167 - : "=&r" ((USItype)(x3)), \ 168 - "=&r" ((USItype)(x2)), \ 169 - "=&r" ((USItype)(x1)), \ 170 - "=&r" ((USItype)(x0)) \ 167 + : "=&r" (x3), \ 168 + "=&r" (x2), \ 169 + "=&r" (x1), \ 170 + "=&r" (x0) \ 171 171 : "rI" ((USItype)(i)), \ 172 172 "0" ((USItype)(x3)), \ 173 173 "1" ((USItype)(x2)), \
+3 -3
arch/sparc/include/asm/smp_32.h
··· 93 93 arg1, arg2, arg3, arg4); 94 94 } 95 95 96 - extern void arch_send_call_function_single_ipi(int cpu); 97 - extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 96 + void arch_send_call_function_single_ipi(int cpu); 97 + void arch_send_call_function_ipi_mask(const struct cpumask *mask); 98 98 99 99 static inline int cpu_logical_map(int cpu) 100 100 { 101 101 return cpu; 102 102 } 103 103 104 - extern int hard_smp_processor_id(void); 104 + int hard_smp_processor_id(void); 105 105 106 106 #define raw_smp_processor_id() (current_thread_info()->cpu) 107 107
+15 -9
arch/sparc/include/asm/smp_64.h
··· 33 33 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 34 34 extern cpumask_t cpu_core_map[NR_CPUS]; 35 35 36 - extern void arch_send_call_function_single_ipi(int cpu); 37 - extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 36 + void arch_send_call_function_single_ipi(int cpu); 37 + void arch_send_call_function_ipi_mask(const struct cpumask *mask); 38 38 39 39 /* 40 40 * General functions that each host system must provide. 41 41 */ 42 42 43 - extern int hard_smp_processor_id(void); 43 + int hard_smp_processor_id(void); 44 44 #define raw_smp_processor_id() (current_thread_info()->cpu) 45 45 46 - extern void smp_fill_in_sib_core_maps(void); 47 - extern void cpu_play_dead(void); 46 + void smp_fill_in_sib_core_maps(void); 47 + void cpu_play_dead(void); 48 48 49 - extern void smp_fetch_global_regs(void); 50 - extern void smp_fetch_global_pmu(void); 49 + void smp_fetch_global_regs(void); 50 + void smp_fetch_global_pmu(void); 51 51 52 52 struct seq_file; 53 53 void smp_bogo(struct seq_file *); 54 54 void smp_info(struct seq_file *); 55 55 56 + void smp_callin(void); 57 + void cpu_panic(void); 58 + void smp_synchronize_tick_client(void); 59 + void smp_capture(void); 60 + void smp_release(void); 61 + 56 62 #ifdef CONFIG_HOTPLUG_CPU 57 - extern int __cpu_disable(void); 58 - extern void __cpu_die(unsigned int cpu); 63 + int __cpu_disable(void); 64 + void __cpu_die(unsigned int cpu); 59 65 #endif 60 66 61 67 #endif /* !(__ASSEMBLY__) */
+1 -1
arch/sparc/include/asm/spitfire.h
··· 62 62 extern int sun4v_chip_type; 63 63 64 64 extern int cheetah_pcache_forced_on; 65 - extern void cheetah_enable_pcache(void); 65 + void cheetah_enable_pcache(void); 66 66 67 67 #define sparc64_highest_locked_tlbent() \ 68 68 (tlb_type == spitfire ? \
+1 -1
arch/sparc/include/asm/stacktrace.h
··· 1 1 #ifndef _SPARC64_STACKTRACE_H 2 2 #define _SPARC64_STACKTRACE_H 3 3 4 - extern void stack_trace_flush(void); 4 + void stack_trace_flush(void); 5 5 6 6 #endif /* _SPARC64_STACKTRACE_H */
+4 -4
arch/sparc/include/asm/starfire.h
··· 11 11 12 12 extern int this_is_starfire; 13 13 14 - extern void check_if_starfire(void); 15 - extern int starfire_hard_smp_processor_id(void); 16 - extern void starfire_hookup(int); 17 - extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); 14 + void check_if_starfire(void); 15 + int starfire_hard_smp_processor_id(void); 16 + void starfire_hookup(int); 17 + unsigned int starfire_translate(unsigned long imap, unsigned int upaid); 18 18 19 19 #endif 20 20 #endif
+6 -6
arch/sparc/include/asm/string_32.h
··· 15 15 16 16 #ifdef __KERNEL__ 17 17 18 - extern void __memmove(void *,const void *,__kernel_size_t); 18 + void __memmove(void *,const void *,__kernel_size_t); 19 19 20 20 #ifndef EXPORT_SYMTAB_STROPS 21 21 ··· 40 40 #undef memscan 41 41 #define memscan(__arg0, __char, __arg2) \ 42 42 ({ \ 43 - extern void *__memscan_zero(void *, size_t); \ 44 - extern void *__memscan_generic(void *, int, size_t); \ 43 + void *__memscan_zero(void *, size_t); \ 44 + void *__memscan_generic(void *, int, size_t); \ 45 45 void *__retval, *__addr = (__arg0); \ 46 46 size_t __size = (__arg2); \ 47 47 \ ··· 54 54 }) 55 55 56 56 #define __HAVE_ARCH_MEMCMP 57 - extern int memcmp(const void *,const void *,__kernel_size_t); 57 + int memcmp(const void *,const void *,__kernel_size_t); 58 58 59 59 /* Now the str*() stuff... */ 60 60 #define __HAVE_ARCH_STRLEN 61 - extern __kernel_size_t strlen(const char *); 61 + __kernel_size_t strlen(const char *); 62 62 63 63 #define __HAVE_ARCH_STRNCMP 64 - extern int strncmp(const char *, const char *, __kernel_size_t); 64 + int strncmp(const char *, const char *, __kernel_size_t); 65 65 66 66 #endif /* !EXPORT_SYMTAB_STROPS */ 67 67
+6 -6
arch/sparc/include/asm/string_64.h
··· 19 19 20 20 /* First the mem*() things. */ 21 21 #define __HAVE_ARCH_MEMMOVE 22 - extern void *memmove(void *, const void *, __kernel_size_t); 22 + void *memmove(void *, const void *, __kernel_size_t); 23 23 24 24 #define __HAVE_ARCH_MEMCPY 25 25 #define memcpy(t, f, n) __builtin_memcpy(t, f, n) ··· 32 32 #undef memscan 33 33 #define memscan(__arg0, __char, __arg2) \ 34 34 ({ \ 35 - extern void *__memscan_zero(void *, size_t); \ 36 - extern void *__memscan_generic(void *, int, size_t); \ 35 + void *__memscan_zero(void *, size_t); \ 36 + void *__memscan_generic(void *, int, size_t); \ 37 37 void *__retval, *__addr = (__arg0); \ 38 38 size_t __size = (__arg2); \ 39 39 \ ··· 46 46 }) 47 47 48 48 #define __HAVE_ARCH_MEMCMP 49 - extern int memcmp(const void *,const void *,__kernel_size_t); 49 + int memcmp(const void *,const void *,__kernel_size_t); 50 50 51 51 /* Now the str*() stuff... */ 52 52 #define __HAVE_ARCH_STRLEN 53 - extern __kernel_size_t strlen(const char *); 53 + __kernel_size_t strlen(const char *); 54 54 55 55 #define __HAVE_ARCH_STRNCMP 56 - extern int strncmp(const char *, const char *, __kernel_size_t); 56 + int strncmp(const char *, const char *, __kernel_size_t); 57 57 58 58 #endif /* !EXPORT_SYMTAB_STROPS */ 59 59
+3 -3
arch/sparc/include/asm/switch_to_32.h
··· 99 99 "o0", "o1", "o2", "o3", "o7"); \ 100 100 } while(0) 101 101 102 - extern void fpsave(unsigned long *fpregs, unsigned long *fsr, 103 - void *fpqueue, unsigned long *fpqdepth); 104 - extern void synchronize_user_stack(void); 102 + void fpsave(unsigned long *fpregs, unsigned long *fsr, 103 + void *fpqueue, unsigned long *fpqdepth); 104 + void synchronize_user_stack(void); 105 105 106 106 #endif /* __SPARC_SWITCH_TO_H */
+2 -2
arch/sparc/include/asm/switch_to_64.h
··· 65 65 "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \ 66 66 } while(0) 67 67 68 - extern void synchronize_user_stack(void); 69 - extern void fault_in_user_windows(void); 68 + void synchronize_user_stack(void); 69 + void fault_in_user_windows(void); 70 70 71 71 #endif /* __SPARC64_SWITCH_TO_64_H */
+4 -4
arch/sparc/include/asm/syscalls.h
··· 3 3 4 4 struct pt_regs; 5 5 6 - extern asmlinkage long sparc_do_fork(unsigned long clone_flags, 7 - unsigned long stack_start, 8 - struct pt_regs *regs, 9 - unsigned long stack_size); 6 + asmlinkage long sparc_do_fork(unsigned long clone_flags, 7 + unsigned long stack_start, 8 + struct pt_regs *regs, 9 + unsigned long stack_size); 10 10 11 11 #endif /* _SPARC64_SYSCALLS_H */
+3 -3
arch/sparc/include/asm/timer_32.h
··· 32 32 return (value + 1) << TIMER_VALUE_SHIFT; 33 33 } 34 34 35 - extern __volatile__ unsigned int *master_l10_counter; 35 + extern volatile u32 __iomem *master_l10_counter; 36 36 37 - extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); 37 + irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); 38 38 39 39 #ifdef CONFIG_SMP 40 40 DECLARE_PER_CPU(struct clock_event_device, sparc32_clockevent); 41 - extern void register_percpu_ce(int cpu); 41 + void register_percpu_ce(int cpu); 42 42 #endif 43 43 44 44 #endif /* !(_SPARC_TIMER_H) */
+3 -3
arch/sparc/include/asm/timer_64.h
··· 23 23 24 24 extern struct sparc64_tick_ops *tick_ops; 25 25 26 - extern unsigned long sparc64_get_clock_tick(unsigned int cpu); 27 - extern void setup_sparc64_timer(void); 28 - extern void __init time_init(void); 26 + unsigned long sparc64_get_clock_tick(unsigned int cpu); 27 + void setup_sparc64_timer(void); 28 + void __init time_init(void); 29 29 30 30 #endif /* _SPARC64_TIMER_H */
+4 -4
arch/sparc/include/asm/tlb_64.h
··· 8 8 #include <asm/mmu_context.h> 9 9 10 10 #ifdef CONFIG_SMP 11 - extern void smp_flush_tlb_pending(struct mm_struct *, 11 + void smp_flush_tlb_pending(struct mm_struct *, 12 12 unsigned long, unsigned long *); 13 13 #endif 14 14 15 15 #ifdef CONFIG_SMP 16 - extern void smp_flush_tlb_mm(struct mm_struct *mm); 16 + void smp_flush_tlb_mm(struct mm_struct *mm); 17 17 #define do_flush_tlb_mm(mm) smp_flush_tlb_mm(mm) 18 18 #else 19 19 #define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT) 20 20 #endif 21 21 22 - extern void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *); 23 - extern void flush_tlb_pending(void); 22 + void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *); 23 + void flush_tlb_pending(void); 24 24 25 25 #define tlb_start_vma(tlb, vma) do { } while (0) 26 26 #define tlb_end_vma(tlb, vma) do { } while (0)
+11 -11
arch/sparc/include/asm/tlbflush_64.h
··· 14 14 unsigned long vaddrs[TLB_BATCH_NR]; 15 15 }; 16 16 17 - extern void flush_tsb_kernel_range(unsigned long start, unsigned long end); 18 - extern void flush_tsb_user(struct tlb_batch *tb); 19 - extern void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr); 17 + void flush_tsb_kernel_range(unsigned long start, unsigned long end); 18 + void flush_tsb_user(struct tlb_batch *tb); 19 + void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr); 20 20 21 21 /* TLB flush operations. */ 22 22 ··· 36 36 37 37 #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE 38 38 39 - extern void flush_tlb_pending(void); 40 - extern void arch_enter_lazy_mmu_mode(void); 41 - extern void arch_leave_lazy_mmu_mode(void); 39 + void flush_tlb_pending(void); 40 + void arch_enter_lazy_mmu_mode(void); 41 + void arch_leave_lazy_mmu_mode(void); 42 42 #define arch_flush_lazy_mmu_mode() do {} while (0) 43 43 44 44 /* Local cpu only. */ 45 - extern void __flush_tlb_all(void); 46 - extern void __flush_tlb_page(unsigned long context, unsigned long vaddr); 47 - extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); 45 + void __flush_tlb_all(void); 46 + void __flush_tlb_page(unsigned long context, unsigned long vaddr); 47 + void __flush_tlb_kernel_range(unsigned long start, unsigned long end); 48 48 49 49 #ifndef CONFIG_SMP 50 50 ··· 60 60 61 61 #else /* CONFIG_SMP */ 62 62 63 - extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); 64 - extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr); 63 + void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); 64 + void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr); 65 65 66 66 #define flush_tlb_kernel_range(start, end) \ 67 67 do { flush_tsb_kernel_range(start,end); \
+1 -1
arch/sparc/include/asm/topology_64.h
··· 18 18 19 19 struct pci_bus; 20 20 #ifdef CONFIG_PCI 21 - extern int pcibus_to_node(struct pci_bus *pbus); 21 + int pcibus_to_node(struct pci_bus *pbus); 22 22 #else 23 23 static inline int pcibus_to_node(struct pci_bus *pbus) 24 24 {
+3 -3
arch/sparc/include/asm/trap_block.h
··· 51 51 unsigned long __per_cpu_base; 52 52 } __attribute__((aligned(64))); 53 53 extern struct trap_per_cpu trap_block[NR_CPUS]; 54 - extern void init_cur_cpu_trap(struct thread_info *); 55 - extern void setup_tba(void); 54 + void init_cur_cpu_trap(struct thread_info *); 55 + void setup_tba(void); 56 56 extern int ncpus_probed; 57 57 58 - extern unsigned long real_hard_smp_processor_id(void); 58 + unsigned long real_hard_smp_processor_id(void); 59 59 60 60 struct cpuid_patch_entry { 61 61 unsigned int addr;
+1 -1
arch/sparc/include/asm/uaccess.h
··· 9 9 #define user_addr_max() \ 10 10 (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) 11 11 12 - extern long strncpy_from_user(char *dest, const char __user *src, long count); 12 + long strncpy_from_user(char *dest, const char __user *src, long count); 13 13 14 14 #endif
+7 -7
arch/sparc/include/asm/uaccess_32.h
··· 78 78 }; 79 79 80 80 /* Returns 0 if exception not found and fixup otherwise. */ 81 - extern unsigned long search_extables_range(unsigned long addr, unsigned long *g2); 81 + unsigned long search_extables_range(unsigned long addr, unsigned long *g2); 82 82 83 - extern void __ret_efault(void); 83 + void __ret_efault(void); 84 84 85 85 /* Uh, these should become the main single-value transfer routines.. 86 86 * They automatically use the right size if we just have the right ··· 152 152 : "=&r" (ret) : "r" (x), "m" (*__m(addr)), \ 153 153 "i" (-EFAULT)) 154 154 155 - extern int __put_user_bad(void); 155 + int __put_user_bad(void); 156 156 157 157 #define __get_user_check(x,addr,size,type) ({ \ 158 158 register int __gu_ret; \ ··· 244 244 ".previous\n\t" \ 245 245 : "=&r" (x) : "m" (*__m(addr)), "i" (retval)) 246 246 247 - extern int __get_user_bad(void); 247 + int __get_user_bad(void); 248 248 249 - extern unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size); 249 + unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size); 250 250 251 251 static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) 252 252 { ··· 306 306 return n; 307 307 } 308 308 309 - extern __must_check long strlen_user(const char __user *str); 310 - extern __must_check long strnlen_user(const char __user *str, long n); 309 + __must_check long strlen_user(const char __user *str); 310 + __must_check long strnlen_user(const char __user *str, long n); 311 311 312 312 #endif /* __ASSEMBLY__ */ 313 313
+25 -25
arch/sparc/include/asm/uaccess_64.h
··· 76 76 unsigned int insn, fixup; 77 77 }; 78 78 79 - extern void __ret_efault(void); 80 - extern void __retl_efault(void); 79 + void __ret_efault(void); 80 + void __retl_efault(void); 81 81 82 82 /* Uh, these should become the main single-value transfer routines.. 83 83 * They automatically use the right size if we just have the right ··· 134 134 : "=r" (ret) : "r" (x), "r" (__m(addr)), \ 135 135 "i" (-EFAULT)) 136 136 137 - extern int __put_user_bad(void); 137 + int __put_user_bad(void); 138 138 139 139 #define __get_user_nocheck(data,addr,size,type) ({ \ 140 140 register int __gu_ret; \ ··· 204 204 ".previous\n\t" \ 205 205 : "=r" (x) : "r" (__m(addr)), "i" (retval)) 206 206 207 - extern int __get_user_bad(void); 207 + int __get_user_bad(void); 208 208 209 - extern unsigned long __must_check ___copy_from_user(void *to, 210 - const void __user *from, 211 - unsigned long size); 212 - extern unsigned long copy_from_user_fixup(void *to, const void __user *from, 213 - unsigned long size); 209 + unsigned long __must_check ___copy_from_user(void *to, 210 + const void __user *from, 211 + unsigned long size); 212 + unsigned long copy_from_user_fixup(void *to, const void __user *from, 213 + unsigned long size); 214 214 static inline unsigned long __must_check 215 215 copy_from_user(void *to, const void __user *from, unsigned long size) 216 216 { ··· 223 223 } 224 224 #define __copy_from_user copy_from_user 225 225 226 - extern unsigned long __must_check ___copy_to_user(void __user *to, 227 - const void *from, 228 - unsigned long size); 229 - extern unsigned long copy_to_user_fixup(void __user *to, const void *from, 230 - unsigned long size); 226 + unsigned long __must_check ___copy_to_user(void __user *to, 227 + const void *from, 228 + unsigned long size); 229 + unsigned long copy_to_user_fixup(void __user *to, const void *from, 230 + unsigned long size); 231 231 static inline unsigned long __must_check 232 232 copy_to_user(void __user *to, const void *from, unsigned long size) 233 233 { ··· 239 239 } 240 240 #define __copy_to_user copy_to_user 241 241 242 - extern unsigned long __must_check ___copy_in_user(void __user *to, 243 - const void __user *from, 244 - unsigned long size); 245 - extern unsigned long copy_in_user_fixup(void __user *to, void __user *from, 246 - unsigned long size); 242 + unsigned long __must_check ___copy_in_user(void __user *to, 243 + const void __user *from, 244 + unsigned long size); 245 + unsigned long copy_in_user_fixup(void __user *to, void __user *from, 246 + unsigned long size); 247 247 static inline unsigned long __must_check 248 248 copy_in_user(void __user *to, void __user *from, unsigned long size) 249 249 { ··· 255 255 } 256 256 #define __copy_in_user copy_in_user 257 257 258 - extern unsigned long __must_check __clear_user(void __user *, unsigned long); 258 + unsigned long __must_check __clear_user(void __user *, unsigned long); 259 259 260 260 #define clear_user __clear_user 261 261 262 - extern __must_check long strlen_user(const char __user *str); 263 - extern __must_check long strnlen_user(const char __user *str, long n); 262 + __must_check long strlen_user(const char __user *str); 263 + __must_check long strnlen_user(const char __user *str, long n); 264 264 265 265 #define __copy_to_user_inatomic __copy_to_user 266 266 #define __copy_from_user_inatomic __copy_from_user 267 267 268 268 struct pt_regs; 269 - extern unsigned long compute_effective_address(struct pt_regs *, 270 - unsigned int insn, 271 - unsigned int rd); 269 + unsigned long compute_effective_address(struct pt_regs *, 270 + unsigned int insn, 271 + unsigned int rd); 272 272 273 273 #endif /* __ASSEMBLY__ */ 274 274
+17 -17
arch/sparc/include/asm/vio.h
··· 372 372 vio->vdev->channel_id, ## a); \ 373 373 } while (0) 374 374 375 - extern int __vio_register_driver(struct vio_driver *drv, struct module *owner, 375 + int __vio_register_driver(struct vio_driver *drv, struct module *owner, 376 376 const char *mod_name); 377 377 /* 378 378 * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded 379 379 */ 380 380 #define vio_register_driver(driver) \ 381 381 __vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) 382 - extern void vio_unregister_driver(struct vio_driver *drv); 382 + void vio_unregister_driver(struct vio_driver *drv); 383 383 384 384 static inline struct vio_driver *to_vio_driver(struct device_driver *drv) 385 385 { ··· 391 391 return container_of(dev, struct vio_dev, dev); 392 392 } 393 393 394 - extern int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); 395 - extern void vio_link_state_change(struct vio_driver_state *vio, int event); 396 - extern void vio_conn_reset(struct vio_driver_state *vio); 397 - extern int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); 398 - extern int vio_validate_sid(struct vio_driver_state *vio, 399 - struct vio_msg_tag *tp); 400 - extern u32 vio_send_sid(struct vio_driver_state *vio); 401 - extern int vio_ldc_alloc(struct vio_driver_state *vio, 402 - struct ldc_channel_config *base_cfg, void *event_arg); 403 - extern void vio_ldc_free(struct vio_driver_state *vio); 404 - extern int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, 405 - u8 dev_class, struct vio_version *ver_table, 406 - int ver_table_size, struct vio_driver_ops *ops, 407 - char *name); 394 + int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); 395 + void vio_link_state_change(struct vio_driver_state *vio, int event); 396 + void vio_conn_reset(struct vio_driver_state *vio); 397 + int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); 398 + int vio_validate_sid(struct vio_driver_state *vio, 399 + struct vio_msg_tag *tp); 400 + u32 vio_send_sid(struct vio_driver_state *vio); 401 + int vio_ldc_alloc(struct vio_driver_state *vio, 402 + struct ldc_channel_config *base_cfg, void *event_arg); 403 + void vio_ldc_free(struct vio_driver_state *vio); 404 + int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, 405 + u8 dev_class, struct vio_version *ver_table, 406 + int ver_table_size, struct vio_driver_ops *ops, 407 + char *name); 408 408 409 - extern void vio_port_up(struct vio_driver_state *vio); 409 + void vio_port_up(struct vio_driver_state *vio); 410 410 411 411 #endif /* _SPARC64_VIO_H */
+2 -1
arch/sparc/include/asm/visasm.h
··· 57 57 " " : : "i" (FPRS_FEF|FPRS_DU) : 58 58 "o5", "g1", "g2", "g3", "g7", "cc"); 59 59 } 60 - extern int vis_emul(struct pt_regs *, unsigned int); 60 + 61 + int vis_emul(struct pt_regs *, unsigned int); 61 62 #endif 62 63 63 64 #endif /* _SPARC64_ASI_H */
+14 -14
arch/sparc/include/asm/xor_64.h
··· 20 20 21 21 #include <asm/spitfire.h> 22 22 23 - extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); 24 - extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, 25 - unsigned long *); 26 - extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *, 27 - unsigned long *, unsigned long *); 28 - extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, 29 - unsigned long *, unsigned long *, unsigned long *); 23 + void xor_vis_2(unsigned long, unsigned long *, unsigned long *); 24 + void xor_vis_3(unsigned long, unsigned long *, unsigned long *, 25 + unsigned long *); 26 + void xor_vis_4(unsigned long, unsigned long *, unsigned long *, 27 + unsigned long *, unsigned long *); 28 + void xor_vis_5(unsigned long, unsigned long *, unsigned long *, 29 + unsigned long *, unsigned long *, unsigned long *); 30 30 31 31 /* XXX Ugh, write cheetah versions... -DaveM */ 32 32 ··· 38 38 .do_5 = xor_vis_5, 39 39 }; 40 40 41 - extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); 42 - extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, 43 - unsigned long *); 44 - extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, 45 - unsigned long *, unsigned long *); 46 - extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, 47 - unsigned long *, unsigned long *, unsigned long *); 41 + void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); 42 + void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, 43 + unsigned long *); 44 + void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, 45 + unsigned long *, unsigned long *); 46 + void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, 47 + unsigned long *, unsigned long *, unsigned long *); 48 48 49 49 static struct xor_block_template xor_block_niagara = { 50 50 .name = "Niagara",
-1
arch/sparc/kernel/Makefile
··· 42 42 obj-$(CONFIG_SPARC32) += windows.o 43 43 obj-y += cpu.o 44 44 obj-$(CONFIG_SPARC32) += devices.o 45 - obj-$(CONFIG_SPARC32) += tadpole.o 46 45 obj-y += ptrace_$(BITS).o 47 46 obj-y += unaligned_$(BITS).o 48 47 obj-y += una_asm_$(BITS).o
+2 -6
arch/sparc/kernel/audit.c
··· 3 3 #include <linux/audit.h> 4 4 #include <asm/unistd.h> 5 5 6 + #include "kernel.h" 7 + 6 8 static unsigned dir_class[] = { 7 9 #include <asm-generic/audit_dir_write.h> 8 10 ~0U ··· 42 40 int audit_classify_syscall(int abi, unsigned syscall) 43 41 { 44 42 #ifdef CONFIG_COMPAT 45 - extern int sparc32_classify_syscall(unsigned); 46 43 if (abi == AUDIT_ARCH_SPARC) 47 44 return sparc32_classify_syscall(syscall); 48 45 #endif ··· 62 61 static int __init audit_classes_init(void) 63 62 { 64 63 #ifdef CONFIG_COMPAT 65 - extern __u32 sparc32_dir_class[]; 66 - extern __u32 sparc32_write_class[]; 67 - extern __u32 sparc32_read_class[]; 68 - extern __u32 sparc32_chattr_class[]; 69 - extern __u32 sparc32_signal_class[]; 70 64 audit_register_class(AUDIT_CLASS_WRITE_32, sparc32_write_class); 71 65 audit_register_class(AUDIT_CLASS_READ_32, sparc32_read_class); 72 66 audit_register_class(AUDIT_CLASS_DIR_WRITE_32, sparc32_dir_class);
+6 -3
arch/sparc/kernel/auxio_32.c
··· 9 9 #include <linux/of.h> 10 10 #include <linux/of_device.h> 11 11 #include <linux/export.h> 12 + 12 13 #include <asm/oplib.h> 13 14 #include <asm/io.h> 14 15 #include <asm/auxio.h> 15 16 #include <asm/string.h> /* memset(), Linux has no bzero() */ 16 17 #include <asm/cpu_type.h> 18 + 19 + #include "kernel.h" 17 20 18 21 /* Probe and map in the Auxiliary I/O register */ 19 22 ··· 106 103 107 104 /* sun4m power control register (AUXIO2) */ 108 105 109 - volatile unsigned char * auxio_power_register = NULL; 106 + volatile u8 __iomem *auxio_power_register = NULL; 110 107 111 108 void __init auxio_power_probe(void) 112 109 { ··· 130 127 r.flags = regs.which_io & 0xF; 131 128 r.start = regs.phys_addr; 132 129 r.end = regs.phys_addr + regs.reg_size - 1; 133 - auxio_power_register = (unsigned char *) of_ioremap(&r, 0, 134 - regs.reg_size, "auxpower"); 130 + auxio_power_register = 131 + (u8 __iomem *)of_ioremap(&r, 0, regs.reg_size, "auxpower"); 135 132 136 133 /* Display a quick message on the console. */ 137 134 if (auxio_power_register)
+1 -1
arch/sparc/kernel/btext.c
··· 137 137 } 138 138 #endif /* ndef NO_SCROLL */ 139 139 140 - void btext_drawchar(char c) 140 + static void btext_drawchar(char c) 141 141 { 142 142 int cline = 0; 143 143 #ifdef NO_SCROLL
+1
arch/sparc/kernel/compat_audit.c
··· 1 1 #define __32bit_syscall_numbers__ 2 2 #include <asm/unistd.h> 3 + #include "kernel.h" 3 4 4 5 unsigned sparc32_dir_class[] = { 5 6 #include <asm-generic/audit_dir_write.h>
+1
arch/sparc/kernel/cpu.c
··· 22 22 #include <asm/cpudata.h> 23 23 24 24 #include "kernel.h" 25 + #include "entry.h" 25 26 26 27 DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; 27 28 EXPORT_PER_CPU_SYMBOL(__cpu_data);
+2 -2
arch/sparc/kernel/cpumap.h
··· 2 2 #define _CPUMAP_H 3 3 4 4 #ifdef CONFIG_SMP 5 - extern void cpu_map_rebuild(void); 6 - extern int map_to_cpu(unsigned int index); 5 + void cpu_map_rebuild(void); 6 + int map_to_cpu(unsigned int index); 7 7 #define cpu_map_init() cpu_map_rebuild() 8 8 #else 9 9 #define cpu_map_init() do {} while (0)
+4 -8
arch/sparc/kernel/devices.c
··· 19 19 #include <asm/smp.h> 20 20 #include <asm/cpudata.h> 21 21 #include <asm/cpu_type.h> 22 + #include <asm/setup.h> 22 23 23 - extern void clock_stop_probe(void); /* tadpole.c */ 24 + #include "kernel.h" 24 25 25 26 static char *cpu_mid_prop(void) 26 27 { ··· 132 131 } 133 132 #endif /* !CONFIG_SMP */ 134 133 135 - { 136 - extern void auxio_probe(void); 137 - extern void auxio_power_probe(void); 138 - auxio_probe(); 139 - auxio_power_probe(); 140 - } 141 - clock_stop_probe(); 134 + auxio_probe(); 135 + auxio_power_probe(); 142 136 }
+121 -122
arch/sparc/kernel/entry.h
··· 6 6 #include <linux/init.h> 7 7 8 8 /* irq */ 9 - extern void handler_irq(int irq, struct pt_regs *regs); 9 + void handler_irq(int irq, struct pt_regs *regs); 10 10 11 11 #ifdef CONFIG_SPARC32 12 12 /* traps */ 13 - extern void do_hw_interrupt(struct pt_regs *regs, unsigned long type); 14 - extern void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, 15 - unsigned long npc, unsigned long psr); 13 + void do_hw_interrupt(struct pt_regs *regs, unsigned long type); 14 + void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, 15 + unsigned long npc, unsigned long psr); 16 16 17 - extern void do_priv_instruction(struct pt_regs *regs, unsigned long pc, 18 - unsigned long npc, unsigned long psr); 19 - extern void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, 20 - unsigned long npc, 21 - unsigned long psr); 22 - extern void do_fpd_trap(struct pt_regs *regs, unsigned long pc, 17 + void do_priv_instruction(struct pt_regs *regs, unsigned long pc, 18 + unsigned long npc, unsigned long psr); 19 + void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, 20 + unsigned long npc, unsigned long psr); 21 + void do_fpd_trap(struct pt_regs *regs, unsigned long pc, 22 + unsigned long npc, unsigned long psr); 23 + void do_fpe_trap(struct pt_regs *regs, unsigned long pc, 24 + unsigned long npc, unsigned long psr); 25 + void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, 26 + unsigned long npc, unsigned long psr); 27 + void handle_watchpoint(struct pt_regs *regs, unsigned long pc, 28 + unsigned long npc, unsigned long psr); 29 + void handle_reg_access(struct pt_regs *regs, unsigned long pc, 30 + unsigned long npc, unsigned long psr); 31 + void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, 23 32 unsigned long npc, unsigned long psr); 24 - extern void do_fpe_trap(struct pt_regs *regs, unsigned long pc, 25 - unsigned long npc, unsigned long psr); 26 - extern void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, 27 - unsigned long npc, unsigned long psr); 28 - extern void handle_watchpoint(struct pt_regs *regs, unsigned long pc, 29 - unsigned long npc, unsigned long psr); 30 - extern void handle_reg_access(struct pt_regs *regs, unsigned long pc, 31 - unsigned long npc, unsigned long psr); 32 - extern void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, 33 - unsigned long npc, unsigned long psr); 34 - extern void handle_cp_exception(struct pt_regs *regs, unsigned long pc, 35 - unsigned long npc, unsigned long psr); 33 + void handle_cp_exception(struct pt_regs *regs, unsigned long pc, 34 + unsigned long npc, unsigned long psr); 36 35 37 36 38 37 39 38 /* entry.S */ 40 - extern void fpsave(unsigned long *fpregs, unsigned long *fsr, 41 - void *fpqueue, unsigned long *fpqdepth); 42 - extern void fpload(unsigned long *fpregs, unsigned long *fsr); 39 + void fpsave(unsigned long *fpregs, unsigned long *fsr, 40 + void *fpqueue, unsigned long *fpqdepth); 41 + void fpload(unsigned long *fpregs, unsigned long *fsr); 43 42 44 43 #else /* CONFIG_SPARC32 */ 45 44 ··· 65 66 extern struct pause_patch_entry __pause_3insn_patch, 66 67 __pause_3insn_patch_end; 67 68 68 - extern void __init per_cpu_patch(void); 69 - extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, 70 - struct sun4v_1insn_patch_entry *); 71 - extern void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *, 72 - struct sun4v_2insn_patch_entry *); 73 - extern void __init sun4v_patch(void); 74 - extern void __init boot_cpu_id_too_large(int cpu); 69 + void __init per_cpu_patch(void); 70 + void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, 71 + struct sun4v_1insn_patch_entry *); 72 + void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *, 73 + struct sun4v_2insn_patch_entry *); 74 + void __init sun4v_patch(void); 75 + void __init boot_cpu_id_too_large(int cpu); 75 76 extern unsigned int dcache_parity_tl1_occurred; 76 77 extern unsigned int icache_parity_tl1_occurred; 77 78 78 - extern asmlinkage void sparc_breakpoint(struct pt_regs *regs); 79 - extern void timer_interrupt(int irq, struct pt_regs *regs); 79 + asmlinkage void sparc_breakpoint(struct pt_regs *regs); 80 + void timer_interrupt(int irq, struct pt_regs *regs); 80 81 81 - extern void do_notify_resume(struct pt_regs *regs, 82 - unsigned long orig_i0, 83 - unsigned long thread_info_flags); 82 + void do_notify_resume(struct pt_regs *regs, 83 + unsigned long orig_i0, 84 + unsigned long thread_info_flags); 84 85 85 - extern asmlinkage int syscall_trace_enter(struct pt_regs *regs); 86 - extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); 86 + asmlinkage int syscall_trace_enter(struct pt_regs *regs); 87 + asmlinkage void syscall_trace_leave(struct pt_regs *regs); 87 88 88 - extern void bad_trap_tl1(struct pt_regs *regs, long lvl); 89 + void bad_trap_tl1(struct pt_regs *regs, long lvl); 89 90 90 - extern void do_fpieee(struct pt_regs *regs); 91 - extern void do_fpother(struct pt_regs *regs); 92 - extern void do_tof(struct pt_regs *regs); 93 - extern void do_div0(struct pt_regs *regs); 94 - extern void do_illegal_instruction(struct pt_regs *regs); 95 - extern void mem_address_unaligned(struct pt_regs *regs, 96 - unsigned long sfar, 97 - unsigned long sfsr); 98 - extern void sun4v_do_mna(struct pt_regs *regs, 99 - unsigned long addr, 100 - unsigned long type_ctx); 101 - extern void do_privop(struct pt_regs *regs); 102 - extern void do_privact(struct pt_regs *regs); 103 - extern void do_cee(struct pt_regs *regs); 104 - extern void do_cee_tl1(struct pt_regs *regs); 105 - extern void do_dae_tl1(struct pt_regs *regs); 106 - extern void do_iae_tl1(struct pt_regs *regs); 107 - extern void do_div0_tl1(struct pt_regs *regs); 108 - extern void do_fpdis_tl1(struct pt_regs *regs); 109 - extern void do_fpieee_tl1(struct pt_regs *regs); 110 - extern void do_fpother_tl1(struct pt_regs *regs); 111 - extern void do_ill_tl1(struct pt_regs *regs); 112 - extern void do_irq_tl1(struct pt_regs *regs); 113 - extern void do_lddfmna_tl1(struct pt_regs *regs); 114 - extern void do_stdfmna_tl1(struct pt_regs *regs); 115 - extern void do_paw(struct pt_regs *regs); 116 - extern void do_paw_tl1(struct pt_regs *regs); 117 - extern void do_vaw(struct pt_regs *regs); 118 - extern void do_vaw_tl1(struct pt_regs *regs); 119 - extern void do_tof_tl1(struct pt_regs *regs); 120 - extern void do_getpsr(struct pt_regs *regs); 91 + void do_fpieee(struct pt_regs *regs); 92 + void do_fpother(struct pt_regs *regs); 93 + void do_tof(struct pt_regs *regs); 94 + void do_div0(struct pt_regs *regs); 95 + void do_illegal_instruction(struct pt_regs *regs); 96 + void mem_address_unaligned(struct pt_regs *regs, 97 + unsigned long sfar, 98 + unsigned long sfsr); 99 + void sun4v_do_mna(struct pt_regs *regs, 100 + unsigned long addr, 101 + unsigned long type_ctx); 102 + void do_privop(struct pt_regs *regs); 103 + void do_privact(struct pt_regs *regs); 104 + void do_cee(struct pt_regs *regs); 105 + void do_cee_tl1(struct pt_regs *regs); 106 + void do_dae_tl1(struct pt_regs *regs); 107 + void do_iae_tl1(struct pt_regs *regs); 108 + void do_div0_tl1(struct pt_regs *regs); 109 + void do_fpdis_tl1(struct pt_regs *regs); 110 + void do_fpieee_tl1(struct pt_regs *regs); 111 + void do_fpother_tl1(struct pt_regs *regs); 112 + void do_ill_tl1(struct pt_regs *regs); 113 + void do_irq_tl1(struct pt_regs *regs); 114 + void do_lddfmna_tl1(struct pt_regs *regs); 115 + void do_stdfmna_tl1(struct pt_regs *regs); 116 + void do_paw(struct pt_regs *regs); 117 + void do_paw_tl1(struct pt_regs *regs); 118 + void do_vaw(struct pt_regs *regs); 119 + void do_vaw_tl1(struct pt_regs *regs); 120 + void do_tof_tl1(struct pt_regs *regs); 121 + void do_getpsr(struct pt_regs *regs); 121 122 122 - extern void spitfire_insn_access_exception(struct pt_regs *regs, 123 - unsigned long sfsr, 124 - unsigned long sfar); 125 - extern void spitfire_insn_access_exception_tl1(struct pt_regs *regs, 126 - unsigned long sfsr, 127 - unsigned long sfar); 128 - extern void spitfire_data_access_exception(struct pt_regs *regs, 129 - unsigned long sfsr, 130 - unsigned long sfar); 131 - extern void spitfire_data_access_exception_tl1(struct pt_regs *regs, 132 - unsigned long sfsr, 133 - unsigned long sfar); 134 - extern void spitfire_access_error(struct pt_regs *regs, 135 - unsigned long status_encoded, 136 - unsigned long afar); 123 + void spitfire_insn_access_exception(struct pt_regs *regs, 124 + unsigned long sfsr, 125 + unsigned long sfar); 126 + void spitfire_insn_access_exception_tl1(struct pt_regs *regs, 127 + unsigned long sfsr, 128 + unsigned long sfar); 129 + void spitfire_data_access_exception(struct pt_regs *regs, 130 + unsigned long sfsr, 131 + unsigned long sfar); 132 + void spitfire_data_access_exception_tl1(struct pt_regs *regs, 133 + unsigned long sfsr, 134 + unsigned long sfar); 135 + void spitfire_access_error(struct pt_regs *regs, 136 + unsigned long status_encoded, 137 + unsigned long afar); 137 138 138 - extern void cheetah_fecc_handler(struct pt_regs *regs, 139 - unsigned long afsr, 140 - unsigned long afar); 141 - extern void cheetah_cee_handler(struct pt_regs *regs, 142 - unsigned long afsr, 143 - unsigned long afar); 144 - extern void cheetah_deferred_handler(struct pt_regs *regs, 145 - unsigned long afsr, 146 - unsigned long afar); 147 - extern void cheetah_plus_parity_error(int type, struct pt_regs *regs); 139 + void cheetah_fecc_handler(struct pt_regs *regs, 140 + unsigned long afsr, 141 + unsigned long afar); 142 + void cheetah_cee_handler(struct pt_regs *regs, 143 + unsigned long afsr, 144 + unsigned long afar); 145 + void cheetah_deferred_handler(struct pt_regs *regs, 146 + unsigned long afsr, 147 + unsigned long afar); 148 + void cheetah_plus_parity_error(int type, struct pt_regs *regs); 148 149 149 - extern void sun4v_insn_access_exception(struct pt_regs *regs, 150 - unsigned long addr, 151 - unsigned long type_ctx); 152 - extern void sun4v_insn_access_exception_tl1(struct pt_regs *regs, 153 - unsigned long addr, 154 - unsigned long type_ctx); 155 - extern void sun4v_data_access_exception(struct pt_regs *regs, 156 - unsigned long addr, 157 - unsigned long type_ctx); 158 - extern void sun4v_data_access_exception_tl1(struct pt_regs *regs, 159 - unsigned long addr, 160 - unsigned long type_ctx); 161 - extern void sun4v_resum_error(struct pt_regs *regs, 162 - unsigned long offset); 163 - extern void sun4v_resum_overflow(struct pt_regs *regs); 164 - extern void sun4v_nonresum_error(struct pt_regs *regs, 165 - unsigned long offset); 166 - extern void sun4v_nonresum_overflow(struct pt_regs *regs); 150 + void sun4v_insn_access_exception(struct pt_regs *regs, 151 + unsigned long addr, 152 + unsigned long type_ctx); 153 + void sun4v_insn_access_exception_tl1(struct pt_regs *regs, 154 + unsigned long addr, 155 + unsigned long type_ctx); 156 + void sun4v_data_access_exception(struct pt_regs *regs, 157 + unsigned long addr, 158 + unsigned long type_ctx); 159 + void sun4v_data_access_exception_tl1(struct pt_regs *regs, 160 + unsigned long addr, 161 + unsigned long type_ctx); 162 + void sun4v_resum_error(struct pt_regs *regs, 163 + unsigned long offset); 164 + void sun4v_resum_overflow(struct pt_regs *regs); 165 + void sun4v_nonresum_error(struct pt_regs *regs, 166 + unsigned long offset); 167 + void sun4v_nonresum_overflow(struct pt_regs *regs); 167 168 168 169 extern unsigned long sun4v_err_itlb_vaddr; 169 170 extern unsigned long sun4v_err_itlb_ctx; 170 171 extern unsigned long sun4v_err_itlb_pte; 171 172 extern unsigned long sun4v_err_itlb_error; 172 173 173 - extern void sun4v_itlb_error_report(struct pt_regs *regs, int tl); 174 + void sun4v_itlb_error_report(struct pt_regs *regs, int tl); 174 175 175 176 extern unsigned long sun4v_err_dtlb_vaddr; 176 177 extern unsigned long sun4v_err_dtlb_ctx; 177 178 extern unsigned long sun4v_err_dtlb_pte; 178 179 extern unsigned long sun4v_err_dtlb_error; 179 180 180 - extern void sun4v_dtlb_error_report(struct pt_regs *regs, int tl); 181 - extern void hypervisor_tlbop_error(unsigned long err, 182 - unsigned long op); 183 - extern void hypervisor_tlbop_error_xcall(unsigned long err, 184 - unsigned long op); 181 + void sun4v_dtlb_error_report(struct pt_regs *regs, int tl); 182 + void hypervisor_tlbop_error(unsigned long err, 183 + unsigned long op); 184 + void hypervisor_tlbop_error_xcall(unsigned long err, 185 + unsigned long op); 185 186 186 187 /* WARNING: The error trap handlers in assembly know the precise 187 188 * layout of the following structure. ··· 247 248 extern struct ino_bucket *ivector_table; 248 249 extern unsigned long ivector_table_pa; 249 250 250 - extern void init_irqwork_curcpu(void); 251 - extern void sun4v_register_mondo_queues(int this_cpu); 251 + void init_irqwork_curcpu(void); 252 + void sun4v_register_mondo_queues(int this_cpu); 252 253 253 254 #endif /* CONFIG_SPARC32 */ 254 255 #endif /* _ENTRY_H */
+1 -2
arch/sparc/kernel/iommu.c
··· 21 21 #include <asm/iommu.h> 22 22 23 23 #include "iommu_common.h" 24 + #include "kernel.h" 24 25 25 26 #define STC_CTXMATCH_ADDR(STC, CTX) \ 26 27 ((STC)->strbuf_ctxmatch_base + ((CTX) << 3)) ··· 840 839 841 840 struct dma_map_ops *dma_ops = &sun4u_dma_ops; 842 841 EXPORT_SYMBOL(dma_ops); 843 - 844 - extern int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask); 845 842 846 843 int dma_supported(struct device *dev, u64 device_mask) 847 844 {
+7 -7
arch/sparc/kernel/iommu_common.h
··· 48 48 return iommu_is_span_boundary(entry, nr, shift, boundary_size); 49 49 } 50 50 51 - extern unsigned long iommu_range_alloc(struct device *dev, 52 - struct iommu *iommu, 53 - unsigned long npages, 54 - unsigned long *handle); 55 - extern void iommu_range_free(struct iommu *iommu, 56 - dma_addr_t dma_addr, 57 - unsigned long npages); 51 + unsigned long iommu_range_alloc(struct device *dev, 52 + struct iommu *iommu, 53 + unsigned long npages, 54 + unsigned long *handle); 55 + void iommu_range_free(struct iommu *iommu, 56 + dma_addr_t dma_addr, 57 + unsigned long npages); 58 58 59 59 #endif /* _IOMMU_COMMON_H */
+3 -3
arch/sparc/kernel/ioport.c
··· 186 186 187 187 if (name == NULL) name = "???"; 188 188 189 - if ((xres = xres_alloc()) != 0) { 189 + if ((xres = xres_alloc()) != NULL) { 190 190 tack = xres->xname; 191 191 res = &xres->xres; 192 192 } else { ··· 400 400 BUG(); 401 401 } 402 402 403 - struct dma_map_ops sbus_dma_ops = { 403 + static struct dma_map_ops sbus_dma_ops = { 404 404 .alloc = sbus_alloc_coherent, 405 405 .free = sbus_free_coherent, 406 406 .map_page = sbus_map_page, ··· 681 681 const char *nm; 682 682 683 683 for (r = root->child; r != NULL; r = r->sibling) { 684 - if ((nm = r->name) == 0) nm = "???"; 684 + if ((nm = r->name) == NULL) nm = "???"; 685 685 seq_printf(m, "%016llx-%016llx: %s\n", 686 686 (unsigned long long)r->start, 687 687 (unsigned long long)r->end, nm);
+10 -1
arch/sparc/kernel/irq.h
··· 82 82 83 83 unsigned long leon_get_irqmask(unsigned int irq); 84 84 85 + /* irq_32.c */ 86 + void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs); 87 + 88 + /* sun4m_irq.c */ 89 + void sun4m_nmi(struct pt_regs *regs); 90 + 91 + /* sun4d_irq.c */ 92 + void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs); 93 + 85 94 #ifdef CONFIG_SMP 86 95 87 96 /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ 88 97 #define SUN4D_IPI_IRQ 13 89 98 90 - extern void sun4d_ipi_interrupt(void); 99 + void sun4d_ipi_interrupt(void); 91 100 92 101 #endif
+1
arch/sparc/kernel/irq_32.c
··· 17 17 18 18 #include <asm/cacheflush.h> 19 19 #include <asm/cpudata.h> 20 + #include <asm/setup.h> 20 21 #include <asm/pcic.h> 21 22 #include <asm/leon.h> 22 23
+105 -19
arch/sparc/kernel/kernel.h
··· 2 2 #define __SPARC_KERNEL_H 3 3 4 4 #include <linux/interrupt.h> 5 + #include <linux/ftrace.h> 5 6 6 7 #include <asm/traps.h> 7 8 #include <asm/head.h> ··· 16 15 #ifdef CONFIG_SPARC64 17 16 /* setup_64.c */ 18 17 struct seq_file; 19 - extern void cpucap_info(struct seq_file *); 18 + void cpucap_info(struct seq_file *); 20 19 21 - static inline unsigned long kimage_addr_to_ra(const char *p) 20 + static inline unsigned long kimage_addr_to_ra(const void *p) 22 21 { 23 22 unsigned long val = (unsigned long) p; 24 23 25 24 return kern_base + (val - KERNBASE); 26 25 } 26 + 27 + /* sys_sparc_64.c */ 28 + asmlinkage long sys_kern_features(void); 29 + 30 + /* unaligned_64.c */ 31 + asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 32 + int handle_popc(u32 insn, struct pt_regs *regs); 33 + void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 34 + void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 35 + 36 + /* smp_64.c */ 37 + void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs); 38 + void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs); 39 + void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs); 40 + void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs); 41 + void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs); 42 + 43 + /* kgdb_64.c */ 44 + void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs); 45 + 46 + /* pci.c */ 47 + int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask); 48 + 49 + /* signal32.c */ 50 + void do_sigreturn32(struct pt_regs *regs); 51 + asmlinkage void do_rt_sigreturn32(struct pt_regs *regs); 52 + void do_signal32(struct pt_regs * regs); 53 + asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp); 54 + 55 + /* compat_audit.c */ 56 + extern unsigned sparc32_dir_class[]; 57 + extern unsigned sparc32_chattr_class[]; 58 + extern unsigned sparc32_write_class[]; 59 + extern unsigned sparc32_read_class[]; 60 + extern unsigned sparc32_signal_class[]; 61 + int sparc32_classify_syscall(unsigned syscall); 27 62 #endif 28 63 29 64 #ifdef CONFIG_SPARC32 30 65 /* setup_32.c */ 66 + struct linux_romvec; 31 67 void sparc32_start_kernel(struct linux_romvec *rp); 32 68 33 69 /* cpu.c */ 34 - extern void cpu_probe(void); 70 + void cpu_probe(void); 35 71 36 72 /* traps_32.c */ 37 - extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, 38 - unsigned long npc, unsigned long psr); 73 + void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, 74 + unsigned long npc, unsigned long psr); 39 75 /* irq_32.c */ 40 76 extern struct irqaction static_irqaction[]; 41 77 extern int static_irq_count; 42 78 extern spinlock_t irq_action_lock; 43 79 44 - extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); 45 - extern void init_IRQ(void); 80 + void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); 81 + void init_IRQ(void); 46 82 47 83 /* sun4m_irq.c */ 48 - extern void sun4m_init_IRQ(void); 49 - extern void sun4m_unmask_profile_irq(void); 50 - extern void sun4m_clear_profile_irq(int cpu); 84 + void sun4m_init_IRQ(void); 85 + void sun4m_unmask_profile_irq(void); 86 + void sun4m_clear_profile_irq(int cpu); 51 87 52 88 /* sun4m_smp.c */ 53 89 void sun4m_cpu_pre_starting(void *arg); 54 90 void sun4m_cpu_pre_online(void *arg); 91 + void __init smp4m_boot_cpus(void); 92 + int smp4m_boot_one_cpu(int i, struct task_struct *idle); 93 + void __init smp4m_smp_done(void); 94 + void smp4m_cross_call_irq(void); 95 + void smp4m_percpu_timer_interrupt(struct pt_regs *regs); 55 96 56 97 /* sun4d_irq.c */ 57 98 extern spinlock_t sun4d_imsk_lock; 58 99 59 - extern void sun4d_init_IRQ(void); 60 - extern int sun4d_request_irq(unsigned int irq, 61 - irq_handler_t handler, 62 - unsigned long irqflags, 63 - const char *devname, void *dev_id); 64 - extern int show_sun4d_interrupts(struct seq_file *, void *); 65 - extern void sun4d_distribute_irqs(void); 66 - extern void sun4d_free_irq(unsigned int irq, void *dev_id); 100 + void sun4d_init_IRQ(void); 101 + int sun4d_request_irq(unsigned int irq, 102 + irq_handler_t handler, 103 + unsigned long irqflags, 104 + const char *devname, void *dev_id); 105 + int show_sun4d_interrupts(struct seq_file *, void *); 106 + void sun4d_distribute_irqs(void); 107 + void sun4d_free_irq(unsigned int irq, void *dev_id); 67 108 68 109 /* sun4d_smp.c */ 69 110 void sun4d_cpu_pre_starting(void *arg); 70 111 void sun4d_cpu_pre_online(void *arg); 112 + void __init smp4d_boot_cpus(void); 113 + int smp4d_boot_one_cpu(int i, struct task_struct *idle); 114 + void __init smp4d_smp_done(void); 115 + void smp4d_cross_call_irq(void); 116 + void smp4d_percpu_timer_interrupt(struct pt_regs *regs); 71 117 72 118 /* leon_smp.c */ 73 119 void leon_cpu_pre_starting(void *arg); 74 120 void leon_cpu_pre_online(void *arg); 121 + void leonsmp_ipi_interrupt(void); 122 + void leon_cross_call_irq(void); 75 123 76 124 /* head_32.S */ 77 125 extern unsigned int t_nmi[]; ··· 139 89 extern unsigned int smp4d_ticker[]; 140 90 extern unsigned int patchme_maybe_smp_msg[]; 141 91 142 - extern void floppy_hardint(void); 92 + void floppy_hardint(void); 143 93 144 94 /* trampoline_32.S */ 145 95 extern unsigned long sun4m_cpu_startup; 146 96 extern unsigned long sun4d_cpu_startup; 97 + 98 + /* process_32.c */ 99 + asmlinkage int sparc_do_fork(unsigned long clone_flags, 100 + unsigned long stack_start, 101 + struct pt_regs *regs, 102 + unsigned long stack_size); 103 + 104 + /* signal_32.c */ 105 + asmlinkage void do_sigreturn(struct pt_regs *regs); 106 + asmlinkage void do_rt_sigreturn(struct pt_regs *regs); 107 + void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, 108 + unsigned long thread_info_flags); 109 + asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, 110 + struct sigstack __user *ossptr, 111 + unsigned long sp); 112 + 113 + /* ptrace_32.c */ 114 + asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); 115 + 116 + /* unaligned_32.c */ 117 + asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 118 + asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); 119 + 120 + /* windows.c */ 121 + void try_to_clear_window_buffer(struct pt_regs *regs, int who); 122 + 123 + /* auxio_32.c */ 124 + void __init auxio_probe(void); 125 + void __init auxio_power_probe(void); 126 + 127 + /* pcic.c */ 128 + extern void __iomem *pcic_regs; 129 + void pcic_nmi(unsigned int pend, struct pt_regs *regs); 130 + 131 + /* time_32.c */ 132 + void __init time_init(void); 147 133 148 134 #else /* CONFIG_SPARC32 */ 149 135 #endif /* CONFIG_SPARC32 */
+2
arch/sparc/kernel/kgdb_64.c
··· 13 13 #include <asm/ptrace.h> 14 14 #include <asm/irq.h> 15 15 16 + #include "kernel.h" 17 + 16 18 void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) 17 19 { 18 20 struct reg_window *win;
+3 -2
arch/sparc/kernel/kprobes.c
··· 512 512 /* 513 513 * Called when the probe at kretprobe trampoline is hit 514 514 */ 515 - int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 515 + static int __kprobes trampoline_probe_handler(struct kprobe *p, 516 + struct pt_regs *regs) 516 517 { 517 518 struct kretprobe_instance *ri = NULL; 518 519 struct hlist_head *head, empty_rp; ··· 577 576 return 1; 578 577 } 579 578 580 - void kretprobe_trampoline_holder(void) 579 + static void __used kretprobe_trampoline_holder(void) 581 580 { 582 581 asm volatile(".global kretprobe_trampoline\n" 583 582 "kretprobe_trampoline:\n"
+5 -5
arch/sparc/kernel/leon_kernel.c
··· 32 32 33 33 int leondebug_irq_disable; 34 34 int leon_debug_irqout; 35 - static int dummy_master_l10_counter; 35 + static volatile u32 dummy_master_l10_counter; 36 36 unsigned long amba_system_id; 37 37 static DEFINE_SPINLOCK(leon_irq_lock); 38 38 39 + static unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */ 39 40 unsigned long leon3_gptimer_irq; /* interrupt controller irq number */ 40 - unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */ 41 41 unsigned int sparc_leon_eirq; 42 42 #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu]) 43 43 #define LEON_IACK (&leon3_irqctrl_regs->iclear) ··· 65 65 } 66 66 67 67 /* The extended IRQ controller has been found, this function registers it */ 68 - void leon_eirq_setup(unsigned int eirq) 68 + static void leon_eirq_setup(unsigned int eirq) 69 69 { 70 70 unsigned long mask, oldmask; 71 71 unsigned int veirq; ··· 270 270 #ifdef CONFIG_SMP 271 271 272 272 /* smp clockevent irq */ 273 - irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused) 273 + static irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused) 274 274 { 275 275 struct clock_event_device *ce; 276 276 int cpu = smp_processor_id(); ··· 313 313 314 314 leondebug_irq_disable = 0; 315 315 leon_debug_irqout = 0; 316 - master_l10_counter = (unsigned int *)&dummy_master_l10_counter; 316 + master_l10_counter = (u32 __iomem *)&dummy_master_l10_counter; 317 317 dummy_master_l10_counter = 0; 318 318 319 319 rootnp = of_find_node_by_path("/ambapp0");
-79
arch/sparc/kernel/leon_pci.c
··· 98 98 { 99 99 return res->start; 100 100 } 101 - 102 - /* in/out routines taken from pcic.c 103 - * 104 - * This probably belongs here rather than ioport.c because 105 - * we do not want this crud linked into SBus kernels. 106 - * Also, think for a moment about likes of floppy.c that 107 - * include architecture specific parts. They may want to redefine ins/outs. 108 - * 109 - * We do not use horrible macros here because we want to 110 - * advance pointer by sizeof(size). 111 - */ 112 - void outsb(unsigned long addr, const void *src, unsigned long count) 113 - { 114 - while (count) { 115 - count -= 1; 116 - outb(*(const char *)src, addr); 117 - src += 1; 118 - /* addr += 1; */ 119 - } 120 - } 121 - EXPORT_SYMBOL(outsb); 122 - 123 - void outsw(unsigned long addr, const void *src, unsigned long count) 124 - { 125 - while (count) { 126 - count -= 2; 127 - outw(*(const short *)src, addr); 128 - src += 2; 129 - /* addr += 2; */ 130 - } 131 - } 132 - EXPORT_SYMBOL(outsw); 133 - 134 - void outsl(unsigned long addr, const void *src, unsigned long count) 135 - { 136 - while (count) { 137 - count -= 4; 138 - outl(*(const long *)src, addr); 139 - src += 4; 140 - /* addr += 4; */ 141 - } 142 - } 143 - EXPORT_SYMBOL(outsl); 144 - 145 - void insb(unsigned long addr, void *dst, unsigned long count) 146 - { 147 - while (count) { 148 - count -= 1; 149 - *(unsigned char *)dst = inb(addr); 150 - dst += 1; 151 - /* addr += 1; */ 152 - } 153 - } 154 - EXPORT_SYMBOL(insb); 155 - 156 - void insw(unsigned long addr, void *dst, unsigned long count) 157 - { 158 - while (count) { 159 - count -= 2; 160 - *(unsigned short *)dst = inw(addr); 161 - dst += 2; 162 - /* addr += 2; */ 163 - } 164 - } 165 - EXPORT_SYMBOL(insw); 166 - 167 - void insl(unsigned long addr, void *dst, unsigned long count) 168 - { 169 - while (count) { 170 - count -= 4; 171 - /* 172 - * XXX I am sure we are in for an unaligned trap here. 173 - */ 174 - *(unsigned long *)dst = inl(addr); 175 - dst += 4; 176 - /* addr += 4; */ 177 - } 178 - } 179 - EXPORT_SYMBOL(insl);
+8 -8
arch/sparc/kernel/leon_pci_grpci1.c
··· 80 80 81 81 struct grpci1_priv { 82 82 struct leon_pci_info info; /* must be on top of this structure */ 83 - struct grpci1_regs *regs; /* GRPCI register map */ 83 + struct grpci1_regs __iomem *regs; /* GRPCI register map */ 84 84 struct device *dev; 85 85 int pci_err_mask; /* STATUS register error mask */ 86 86 int irq; /* LEON irqctrl GRPCI IRQ */ ··· 101 101 static int grpci1_cfg_w32(struct grpci1_priv *priv, unsigned int bus, 102 102 unsigned int devfn, int where, u32 val); 103 103 104 - int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 104 + static int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 105 105 { 106 106 struct grpci1_priv *priv = dev->bus->sysdata; 107 107 int irq_group; ··· 144 144 grpci1_cfg_w32(priv, TGT, 0, PCI_COMMAND, tmp); 145 145 } else { 146 146 /* Bus always little endian (unaffected by byte-swapping) */ 147 - *val = flip_dword(tmp); 147 + *val = swab32(tmp); 148 148 } 149 149 150 150 return 0; ··· 197 197 198 198 pci_conf = (unsigned int *) (priv->pci_conf | 199 199 (devfn << 8) | (where & 0xfc)); 200 - LEON3_BYPASS_STORE_PA(pci_conf, flip_dword(val)); 200 + LEON3_BYPASS_STORE_PA(pci_conf, swab32(val)); 201 201 202 202 return 0; 203 203 } ··· 417 417 * BAR1: peripheral DMA to host's memory (size at least 256MByte) 418 418 * BAR2..BAR5: not implemented in hardware 419 419 */ 420 - void grpci1_hw_init(struct grpci1_priv *priv) 420 + static void grpci1_hw_init(struct grpci1_priv *priv) 421 421 { 422 422 u32 ahbadr, bar_sz, data, pciadr; 423 - struct grpci1_regs *regs = priv->regs; 423 + struct grpci1_regs __iomem *regs = priv->regs; 424 424 425 425 /* set 1:1 mapping between AHB -> PCI memory space */ 426 426 REGSTORE(regs->cfg_stat, priv->pci_area & 0xf0000000); ··· 509 509 510 510 static int grpci1_of_probe(struct platform_device *ofdev) 511 511 { 512 - struct grpci1_regs *regs; 512 + struct grpci1_regs __iomem *regs; 513 513 struct grpci1_priv *priv; 514 514 int err, len; 515 515 const int *tmp; ··· 690 690 err2: 691 691 release_resource(&priv->info.mem_space); 692 692 err1: 693 - iounmap((void *)priv->pci_io_va); 693 + iounmap((void __iomem *)priv->pci_io_va); 694 694 grpci1priv = NULL; 695 695 return err; 696 696 }
+11 -11
arch/sparc/kernel/leon_pci_grpci2.c
··· 191 191 192 192 struct grpci2_priv { 193 193 struct leon_pci_info info; /* must be on top of this structure */ 194 - struct grpci2_regs *regs; 194 + struct grpci2_regs __iomem *regs; 195 195 char irq; 196 196 char irq_mode; /* IRQ Mode from CAPSTS REG */ 197 197 char bt_enabled; ··· 215 215 struct grpci2_barcfg tgtbars[6]; 216 216 }; 217 217 218 - DEFINE_SPINLOCK(grpci2_dev_lock); 219 - struct grpci2_priv *grpci2priv; 218 + static DEFINE_SPINLOCK(grpci2_dev_lock); 219 + static struct grpci2_priv *grpci2priv; 220 220 221 - int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 221 + static int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 222 222 { 223 223 struct grpci2_priv *priv = dev->bus->sysdata; 224 224 int irq_group; ··· 270 270 *val = 0xffffffff; 271 271 } else { 272 272 /* Bus always little endian (unaffected by byte-swapping) */ 273 - *val = flip_dword(tmp); 273 + *val = swab32(tmp); 274 274 } 275 275 276 276 return 0; ··· 328 328 329 329 pci_conf = (unsigned int *) (priv->pci_conf | 330 330 (devfn << 8) | (where & 0xfc)); 331 - LEON3_BYPASS_STORE_PA(pci_conf, flip_dword(val)); 331 + LEON3_BYPASS_STORE_PA(pci_conf, swab32(val)); 332 332 333 333 /* Wait until GRPCI2 signals that CFG access is done, it should be 334 334 * done instantaneously unless a DMA operation is ongoing... ··· 561 561 return virq; 562 562 } 563 563 564 - void grpci2_hw_init(struct grpci2_priv *priv) 564 + static void grpci2_hw_init(struct grpci2_priv *priv) 565 565 { 566 566 u32 ahbadr, pciadr, bar_sz, capptr, io_map, data; 567 - struct grpci2_regs *regs = priv->regs; 567 + struct grpci2_regs __iomem *regs = priv->regs; 568 568 int i; 569 569 struct grpci2_barcfg *barcfg = priv->tgtbars; 570 570 ··· 655 655 static irqreturn_t grpci2_err_interrupt(int irq, void *arg) 656 656 { 657 657 struct grpci2_priv *priv = arg; 658 - struct grpci2_regs *regs = priv->regs; 658 + struct grpci2_regs __iomem *regs = priv->regs; 659 659 unsigned int status; 660 660 661 661 status = REGLOAD(regs->sts_cap); ··· 682 682 683 683 static int grpci2_of_probe(struct platform_device *ofdev) 684 684 { 685 - struct grpci2_regs *regs; 685 + struct grpci2_regs __iomem *regs; 686 686 struct grpci2_priv *priv; 687 687 int err, i, len; 688 688 const int *tmp; ··· 878 878 release_resource(&priv->info.mem_space); 879 879 err3: 880 880 err = -ENOMEM; 881 - iounmap((void *)priv->pci_io_va); 881 + iounmap((void __iomem *)priv->pci_io_va); 882 882 err2: 883 883 kfree(priv); 884 884 err1:
+4 -4
arch/sparc/kernel/leon_pmc.c
··· 12 12 #include <asm/processor.h> 13 13 14 14 /* List of Systems that need fixup instructions around power-down instruction */ 15 - unsigned int pmc_leon_fixup_ids[] = { 15 + static unsigned int pmc_leon_fixup_ids[] = { 16 16 AEROFLEX_UT699, 17 17 GAISLER_GR712RC, 18 18 LEON4_NEXTREME1, 19 19 0 20 20 }; 21 21 22 - int pmc_leon_need_fixup(void) 22 + static int pmc_leon_need_fixup(void) 23 23 { 24 24 unsigned int systemid = amba_system_id >> 16; 25 25 unsigned int *id; ··· 38 38 * CPU idle callback function for systems that need some extra handling 39 39 * See .../arch/sparc/kernel/process.c 40 40 */ 41 - void pmc_leon_idle_fixup(void) 41 + static void pmc_leon_idle_fixup(void) 42 42 { 43 43 /* Prepare an address to a non-cachable region. APB is always 44 44 * none-cachable. One instruction is executed after the Sleep ··· 62 62 * CPU idle callback function 63 63 * See .../arch/sparc/kernel/process.c 64 64 */ 65 - void pmc_leon_idle(void) 65 + static void pmc_leon_idle(void) 66 66 { 67 67 /* Interrupts need to be enabled to not hang the CPU */ 68 68 local_irq_enable();
+1 -12
arch/sparc/kernel/leon_smp.c
··· 130 130 local_ops->tlb_all(); 131 131 } 132 132 133 - void leon_smp_setbroadcast(unsigned int mask) 133 + static void leon_smp_setbroadcast(unsigned int mask) 134 134 { 135 135 int broadcast = 136 136 ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> ··· 146 146 } 147 147 } 148 148 LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask); 149 - } 150 - 151 - unsigned int leon_smp_getbroadcast(void) 152 - { 153 - unsigned int mask; 154 - mask = LEON_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpbroadcast)); 155 - return mask; 156 149 } 157 150 158 151 int leon_smp_nrcpus(void) ··· 257 264 /* Ok, they are spinning and ready to go. */ 258 265 smp_processors_ready = 1; 259 266 260 - } 261 - 262 - void leon_irq_rotate(int cpu) 263 - { 264 267 } 265 268 266 269 struct leon_ipi_work {
+3 -1
arch/sparc/kernel/of_device_common.c
··· 5 5 #include <linux/mod_devicetable.h> 6 6 #include <linux/errno.h> 7 7 #include <linux/irq.h> 8 - #include <linux/of_device.h> 9 8 #include <linux/of_platform.h> 9 + #include <linux/of_address.h> 10 + #include <linux/of_device.h> 11 + #include <linux/of_irq.h> 10 12 11 13 #include "of_device_common.h" 12 14
+1
arch/sparc/kernel/pci.c
··· 28 28 #include <asm/apb.h> 29 29 30 30 #include "pci_impl.h" 31 + #include "kernel.h" 31 32 32 33 /* List of all PCI controllers found in the system. */ 33 34 struct pci_pbm_info *pci_pbm_root = NULL;
+15 -15
arch/sparc/kernel/pci_impl.h
··· 48 48 unsigned long devino); 49 49 }; 50 50 51 - extern void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, 52 - const struct sparc64_msiq_ops *ops); 51 + void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, 52 + const struct sparc64_msiq_ops *ops); 53 53 54 54 struct sparc64_msiq_cookie { 55 55 struct pci_pbm_info *pbm; ··· 158 158 extern int pci_num_pbms; 159 159 160 160 /* PCI bus scanning and fixup support. */ 161 - extern void pci_get_pbm_props(struct pci_pbm_info *pbm); 162 - extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, 163 - struct device *parent); 164 - extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm); 161 + void pci_get_pbm_props(struct pci_pbm_info *pbm); 162 + struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, 163 + struct device *parent); 164 + void pci_determine_mem_io_space(struct pci_pbm_info *pbm); 165 165 166 166 /* Error reporting support. */ 167 - extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *); 168 - extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *); 169 - extern void pci_scan_for_parity_error(struct pci_pbm_info *, struct pci_bus *); 167 + void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *); 168 + void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *); 169 + void pci_scan_for_parity_error(struct pci_pbm_info *, struct pci_bus *); 170 170 171 171 /* Configuration space access. */ 172 - extern void pci_config_read8(u8 *addr, u8 *ret); 173 - extern void pci_config_read16(u16 *addr, u16 *ret); 174 - extern void pci_config_read32(u32 *addr, u32 *ret); 175 - extern void pci_config_write8(u8 *addr, u8 val); 176 - extern void pci_config_write16(u16 *addr, u16 val); 177 - extern void pci_config_write32(u32 *addr, u32 val); 172 + void pci_config_read8(u8 *addr, u8 *ret); 173 + void pci_config_read16(u16 *addr, u16 *ret); 174 + void pci_config_read32(u32 *addr, u32 *ret); 175 + void pci_config_write8(u8 *addr, u8 val); 176 + void pci_config_write16(u16 *addr, u16 val); 177 + void pci_config_write32(u32 *addr, u32 val); 178 178 179 179 extern struct pci_ops sun4u_pci_ops; 180 180 extern struct pci_ops sun4v_pci_ops;
+78 -78
arch/sparc/kernel/pci_sun4v.h
··· 6 6 #ifndef _PCI_SUN4V_H 7 7 #define _PCI_SUN4V_H 8 8 9 - extern long pci_sun4v_iommu_map(unsigned long devhandle, 10 - unsigned long tsbid, 11 - unsigned long num_ttes, 12 - unsigned long io_attributes, 13 - unsigned long io_page_list_pa); 14 - extern unsigned long pci_sun4v_iommu_demap(unsigned long devhandle, 15 - unsigned long tsbid, 16 - unsigned long num_ttes); 17 - extern unsigned long pci_sun4v_iommu_getmap(unsigned long devhandle, 18 - unsigned long tsbid, 19 - unsigned long *io_attributes, 20 - unsigned long *real_address); 21 - extern unsigned long pci_sun4v_config_get(unsigned long devhandle, 22 - unsigned long pci_device, 23 - unsigned long config_offset, 24 - unsigned long size); 25 - extern int pci_sun4v_config_put(unsigned long devhandle, 26 - unsigned long pci_device, 27 - unsigned long config_offset, 28 - unsigned long size, 29 - unsigned long data); 9 + long pci_sun4v_iommu_map(unsigned long devhandle, 10 + unsigned long tsbid, 11 + unsigned long num_ttes, 12 + unsigned long io_attributes, 13 + unsigned long io_page_list_pa); 14 + unsigned long pci_sun4v_iommu_demap(unsigned long devhandle, 15 + unsigned long tsbid, 16 + unsigned long num_ttes); 17 + unsigned long pci_sun4v_iommu_getmap(unsigned long devhandle, 18 + unsigned long tsbid, 19 + unsigned long *io_attributes, 20 + unsigned long *real_address); 21 + unsigned long pci_sun4v_config_get(unsigned long devhandle, 22 + unsigned long pci_device, 23 + unsigned long config_offset, 24 + unsigned long size); 25 + int pci_sun4v_config_put(unsigned long devhandle, 26 + unsigned long pci_device, 27 + unsigned long config_offset, 28 + unsigned long size, 29 + unsigned long data); 30 30 31 - extern unsigned long pci_sun4v_msiq_conf(unsigned long devhandle, 31 + unsigned long pci_sun4v_msiq_conf(unsigned long devhandle, 32 32 unsigned long msiqid, 33 33 unsigned long msiq_paddr, 34 34 unsigned long num_entries); 35 - extern unsigned long pci_sun4v_msiq_info(unsigned long devhandle, 36 - unsigned long msiqid, 37 - unsigned long *msiq_paddr, 38 - unsigned long *num_entries); 39 - extern unsigned long pci_sun4v_msiq_getvalid(unsigned long devhandle, 40 - unsigned long msiqid, 41 - unsigned long *valid); 42 - extern unsigned long pci_sun4v_msiq_setvalid(unsigned long devhandle, 43 - unsigned long msiqid, 44 - unsigned long valid); 45 - extern unsigned long pci_sun4v_msiq_getstate(unsigned long devhandle, 46 - unsigned long msiqid, 47 - unsigned long *state); 48 - extern unsigned long pci_sun4v_msiq_setstate(unsigned long devhandle, 49 - unsigned long msiqid, 50 - unsigned long state); 51 - extern unsigned long pci_sun4v_msiq_gethead(unsigned long devhandle, 52 - unsigned long msiqid, 53 - unsigned long *head); 54 - extern unsigned long pci_sun4v_msiq_sethead(unsigned long devhandle, 55 - unsigned long msiqid, 56 - unsigned long head); 57 - extern unsigned long pci_sun4v_msiq_gettail(unsigned long devhandle, 58 - unsigned long msiqid, 59 - unsigned long *head); 60 - extern unsigned long pci_sun4v_msi_getvalid(unsigned long devhandle, 61 - unsigned long msinum, 62 - unsigned long *valid); 63 - extern unsigned long pci_sun4v_msi_setvalid(unsigned long devhandle, 64 - unsigned long msinum, 65 - unsigned long valid); 66 - extern unsigned long pci_sun4v_msi_getmsiq(unsigned long devhandle, 67 - unsigned long msinum, 68 - unsigned long *msiq); 69 - extern unsigned long pci_sun4v_msi_setmsiq(unsigned long devhandle, 70 - unsigned long msinum, 71 - unsigned long msiq, 72 - unsigned long msitype); 73 - extern unsigned long pci_sun4v_msi_getstate(unsigned long devhandle, 74 - unsigned long msinum, 75 - unsigned long *state); 76 - extern unsigned long pci_sun4v_msi_setstate(unsigned long devhandle, 77 - unsigned long msinum, 78 - unsigned long state); 79 - extern unsigned long pci_sun4v_msg_getmsiq(unsigned long devhandle, 80 - unsigned long msinum, 81 - unsigned long *msiq); 82 - extern unsigned long pci_sun4v_msg_setmsiq(unsigned long devhandle, 83 - unsigned long msinum, 84 - unsigned long msiq); 85 - extern unsigned long pci_sun4v_msg_getvalid(unsigned long devhandle, 86 - unsigned long msinum, 87 - unsigned long *valid); 88 - extern unsigned long pci_sun4v_msg_setvalid(unsigned long devhandle, 89 - unsigned long msinum, 90 - unsigned long valid); 35 + unsigned long pci_sun4v_msiq_info(unsigned long devhandle, 36 + unsigned long msiqid, 37 + unsigned long *msiq_paddr, 38 + unsigned long *num_entries); 39 + unsigned long pci_sun4v_msiq_getvalid(unsigned long devhandle, 40 + unsigned long msiqid, 41 + unsigned long *valid); 42 + unsigned long pci_sun4v_msiq_setvalid(unsigned long devhandle, 43 + unsigned long msiqid, 44 + unsigned long valid); 45 + unsigned long pci_sun4v_msiq_getstate(unsigned long devhandle, 46 + unsigned long msiqid, 47 + unsigned long *state); 48 + unsigned long pci_sun4v_msiq_setstate(unsigned long devhandle, 49 + unsigned long msiqid, 50 + unsigned long state); 51 + unsigned long pci_sun4v_msiq_gethead(unsigned long devhandle, 52 + unsigned long msiqid, 53 + unsigned long *head); 54 + unsigned long pci_sun4v_msiq_sethead(unsigned long devhandle, 55 + unsigned long msiqid, 56 + unsigned long head); 57 + unsigned long pci_sun4v_msiq_gettail(unsigned long devhandle, 58 + unsigned long msiqid, 59 + unsigned long *head); 60 + unsigned long pci_sun4v_msi_getvalid(unsigned long devhandle, 61 + unsigned long msinum, 62 + unsigned long *valid); 63 + unsigned long pci_sun4v_msi_setvalid(unsigned long devhandle, 64 + unsigned long msinum, 65 + unsigned long valid); 66 + unsigned long pci_sun4v_msi_getmsiq(unsigned long devhandle, 67 + unsigned long msinum, 68 + unsigned long *msiq); 69 + unsigned long pci_sun4v_msi_setmsiq(unsigned long devhandle, 70 + unsigned long msinum, 71 + unsigned long msiq, 72 + unsigned long msitype); 73 + unsigned long pci_sun4v_msi_getstate(unsigned long devhandle, 74 + unsigned long msinum, 75 + unsigned long *state); 76 + unsigned long pci_sun4v_msi_setstate(unsigned long devhandle, 77 + unsigned long msinum, 78 + unsigned long state); 79 + unsigned long pci_sun4v_msg_getmsiq(unsigned long devhandle, 80 + unsigned long msinum, 81 + unsigned long *msiq); 82 + unsigned long pci_sun4v_msg_setmsiq(unsigned long devhandle, 83 + unsigned long msinum, 84 + unsigned long msiq); 85 + unsigned long pci_sun4v_msg_getvalid(unsigned long devhandle, 86 + unsigned long msinum, 87 + unsigned long *valid); 88 + unsigned long pci_sun4v_msg_setvalid(unsigned long devhandle, 89 + unsigned long msinum, 90 + unsigned long valid); 91 91 92 92 #endif /* !(_PCI_SUN4V_H) */
+7 -109
arch/sparc/kernel/pcic.c
··· 36 36 #include <asm/uaccess.h> 37 37 #include <asm/irq_regs.h> 38 38 39 + #include "kernel.h" 39 40 #include "irq.h" 40 41 41 42 /* ··· 163 162 static struct linux_pcic pcic0; 164 163 165 164 void __iomem *pcic_regs; 166 - volatile int pcic_speculative; 167 - volatile int pcic_trapped; 165 + static volatile int pcic_speculative; 166 + static volatile int pcic_trapped; 168 167 169 168 /* forward */ 170 169 unsigned int pcic_build_device_irq(struct platform_device *op, ··· 330 329 331 330 pcic->pcic_res_cfg_addr.name = "pcic_cfg_addr"; 332 331 if ((pcic->pcic_config_space_addr = 333 - ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == 0) { 332 + ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == NULL) { 334 333 prom_printf("PCIC: Error, cannot map " 335 334 "PCI Configuration Space Address.\n"); 336 335 prom_halt(); ··· 342 341 */ 343 342 pcic->pcic_res_cfg_data.name = "pcic_cfg_data"; 344 343 if ((pcic->pcic_config_space_data = 345 - ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == 0) { 344 + ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == NULL) { 346 345 prom_printf("PCIC: Error, cannot map " 347 346 "PCI Configuration Space Data.\n"); 348 347 prom_halt(); ··· 354 353 strcpy(pbm->prom_name, namebuf); 355 354 356 355 { 357 - extern volatile int t_nmi[4]; 358 356 extern int pcic_nmi_trap_patch[4]; 359 357 360 358 t_nmi[0] = pcic_nmi_trap_patch[0]; ··· 536 536 prom_getstring(node, "name", namebuf, sizeof(namebuf)); 537 537 } 538 538 539 - if ((p = pcic->pcic_imap) == 0) { 539 + if ((p = pcic->pcic_imap) == NULL) { 540 540 dev->irq = 0; 541 541 return; 542 542 } ··· 670 670 } 671 671 } 672 672 673 - /* 674 - * pcic_pin_to_irq() is exported to bus probing code 675 - */ 676 - unsigned int 677 - pcic_pin_to_irq(unsigned int pin, const char *name) 678 - { 679 - struct linux_pcic *pcic = &pcic0; 680 - unsigned int irq; 681 - unsigned int ivec; 682 - 683 - if (pin < 4) { 684 - ivec = readw(pcic->pcic_regs+PCI_INT_SELECT_LO); 685 - irq = ivec >> (pin << 2) & 0xF; 686 - } else if (pin < 8) { 687 - ivec = readw(pcic->pcic_regs+PCI_INT_SELECT_HI); 688 - irq = ivec >> ((pin-4) << 2) & 0xF; 689 - } else { /* Corrupted map */ 690 - printk("PCIC: BAD PIN %d FOR %s\n", pin, name); 691 - for (;;) {} /* XXX Cannot panic properly in case of PROLL */ 692 - } 693 - /* P3 */ /* printk("PCIC: dev %s pin %d ivec 0x%x irq %x\n", name, pin, ivec, irq); */ 694 - return irq; 695 - } 696 - 697 673 /* Makes compiler happy */ 698 674 static volatile int pcic_timer_dummy; 699 675 ··· 759 783 void pcic_nmi(unsigned int pend, struct pt_regs *regs) 760 784 { 761 785 762 - pend = flip_dword(pend); 786 + pend = swab32(pend); 763 787 764 788 if (!pcic_speculative || (pend & PCI_SYS_INT_PENDING_PIO) == 0) { 765 789 /* ··· 850 874 sparc_config.clear_clock_irq = pcic_clear_clock_irq; 851 875 sparc_config.load_profile_irq = pcic_load_profile_irq; 852 876 } 853 - 854 - /* 855 - * This probably belongs here rather than ioport.c because 856 - * we do not want this crud linked into SBus kernels. 857 - * Also, think for a moment about likes of floppy.c that 858 - * include architecture specific parts. They may want to redefine ins/outs. 859 - * 860 - * We do not use horrible macros here because we want to 861 - * advance pointer by sizeof(size). 862 - */ 863 - void outsb(unsigned long addr, const void *src, unsigned long count) 864 - { 865 - while (count) { 866 - count -= 1; 867 - outb(*(const char *)src, addr); 868 - src += 1; 869 - /* addr += 1; */ 870 - } 871 - } 872 - EXPORT_SYMBOL(outsb); 873 - 874 - void outsw(unsigned long addr, const void *src, unsigned long count) 875 - { 876 - while (count) { 877 - count -= 2; 878 - outw(*(const short *)src, addr); 879 - src += 2; 880 - /* addr += 2; */ 881 - } 882 - } 883 - EXPORT_SYMBOL(outsw); 884 - 885 - void outsl(unsigned long addr, const void *src, unsigned long count) 886 - { 887 - while (count) { 888 - count -= 4; 889 - outl(*(const long *)src, addr); 890 - src += 4; 891 - /* addr += 4; */ 892 - } 893 - } 894 - EXPORT_SYMBOL(outsl); 895 - 896 - void insb(unsigned long addr, void *dst, unsigned long count) 897 - { 898 - while (count) { 899 - count -= 1; 900 - *(unsigned char *)dst = inb(addr); 901 - dst += 1; 902 - /* addr += 1; */ 903 - } 904 - } 905 - EXPORT_SYMBOL(insb); 906 - 907 - void insw(unsigned long addr, void *dst, unsigned long count) 908 - { 909 - while (count) { 910 - count -= 2; 911 - *(unsigned short *)dst = inw(addr); 912 - dst += 2; 913 - /* addr += 2; */ 914 - } 915 - } 916 - EXPORT_SYMBOL(insw); 917 - 918 - void insl(unsigned long addr, void *dst, unsigned long count) 919 - { 920 - while (count) { 921 - count -= 4; 922 - /* 923 - * XXX I am sure we are in for an unaligned trap here. 924 - */ 925 - *(unsigned long *)dst = inl(addr); 926 - dst += 4; 927 - /* addr += 4; */ 928 - } 929 - } 930 - EXPORT_SYMBOL(insl); 931 877 932 878 subsys_initcall(pcic_init);
+13 -10
arch/sparc/kernel/perf_event.c
··· 110 110 111 111 unsigned int group_flag; 112 112 }; 113 - DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; 113 + static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; 114 114 115 115 /* An event map describes the characteristics of a performance 116 116 * counter event. In particular it gives the encoding as well as ··· 1153 1153 cpuc->pcr[i] = pcr_ops->read_pcr(i); 1154 1154 } 1155 1155 1156 - void perf_event_grab_pmc(void) 1156 + static void perf_event_grab_pmc(void) 1157 1157 { 1158 1158 if (atomic_inc_not_zero(&active_events)) 1159 1159 return; ··· 1169 1169 mutex_unlock(&pmc_grab_mutex); 1170 1170 } 1171 1171 1172 - void perf_event_release_pmc(void) 1172 + static void perf_event_release_pmc(void) 1173 1173 { 1174 1174 if (atomic_dec_and_mutex_lock(&active_events, &pmc_grab_mutex)) { 1175 1175 if (atomic_read(&nmi_active) == 0) ··· 1669 1669 return false; 1670 1670 } 1671 1671 1672 - int __init init_hw_perf_events(void) 1672 + static int __init init_hw_perf_events(void) 1673 1673 { 1674 1674 pr_info("Performance events: "); 1675 1675 ··· 1742 1742 1743 1743 ufp = regs->u_regs[UREG_I6] + STACK_BIAS; 1744 1744 do { 1745 - struct sparc_stackf *usf, sf; 1745 + struct sparc_stackf __user *usf; 1746 + struct sparc_stackf sf; 1746 1747 unsigned long pc; 1747 1748 1748 - usf = (struct sparc_stackf *) ufp; 1749 + usf = (struct sparc_stackf __user *)ufp; 1749 1750 if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) 1750 1751 break; 1751 1752 ··· 1766 1765 unsigned long pc; 1767 1766 1768 1767 if (thread32_stack_is_64bit(ufp)) { 1769 - struct sparc_stackf *usf, sf; 1768 + struct sparc_stackf __user *usf; 1769 + struct sparc_stackf sf; 1770 1770 1771 1771 ufp += STACK_BIAS; 1772 - usf = (struct sparc_stackf *) ufp; 1772 + usf = (struct sparc_stackf __user *)ufp; 1773 1773 if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) 1774 1774 break; 1775 1775 pc = sf.callers_pc & 0xffffffff; 1776 1776 ufp = ((unsigned long) sf.fp) & 0xffffffff; 1777 1777 } else { 1778 - struct sparc_stackf32 *usf, sf; 1779 - usf = (struct sparc_stackf32 *) ufp; 1778 + struct sparc_stackf32 __user *usf; 1779 + struct sparc_stackf32 sf; 1780 + usf = (struct sparc_stackf32 __user *)ufp; 1780 1781 if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) 1781 1782 break; 1782 1783 pc = sf.callers_pc;
+10 -2
arch/sparc/kernel/process_32.c
··· 10 10 11 11 #include <stdarg.h> 12 12 13 + #include <linux/elfcore.h> 13 14 #include <linux/errno.h> 14 15 #include <linux/module.h> 15 16 #include <linux/sched.h> ··· 24 23 #include <linux/delay.h> 25 24 #include <linux/pm.h> 26 25 #include <linux/slab.h> 26 + #include <linux/cpu.h> 27 27 28 28 #include <asm/auxio.h> 29 29 #include <asm/oplib.h> ··· 39 37 #include <asm/prom.h> 40 38 #include <asm/unistd.h> 41 39 #include <asm/setup.h> 40 + 41 + #include "kernel.h" 42 42 43 43 /* 44 44 * Power management idle function ··· 106 102 void machine_power_off(void) 107 103 { 108 104 if (auxio_power_register && 109 - (strcmp(of_console_device->type, "serial") || scons_pwroff)) 110 - *auxio_power_register |= AUXIO_POWER_OFF; 105 + (strcmp(of_console_device->type, "serial") || scons_pwroff)) { 106 + u8 power_register = sbus_readb(auxio_power_register); 107 + power_register |= AUXIO_POWER_OFF; 108 + sbus_writeb(power_register, auxio_power_register); 109 + } 110 + 111 111 machine_halt(); 112 112 } 113 113
+1 -1
arch/sparc/kernel/process_64.c
··· 88 88 } 89 89 90 90 #ifdef CONFIG_HOTPLUG_CPU 91 - void arch_cpu_idle_dead() 91 + void arch_cpu_idle_dead(void) 92 92 { 93 93 sched_preempt_enable_no_resched(); 94 94 cpu_play_dead();
+1 -1
arch/sparc/kernel/prom.h
··· 4 4 #include <linux/spinlock.h> 5 5 #include <asm/prom.h> 6 6 7 - extern void of_console_init(void); 7 + void of_console_init(void); 8 8 9 9 extern unsigned int prom_early_allocated; 10 10
+5 -4
arch/sparc/kernel/prom_64.c
··· 15 15 * 2 of the License, or (at your option) any later version. 16 16 */ 17 17 18 - #include <linux/kernel.h> 19 - #include <linux/types.h> 20 - #include <linux/string.h> 21 - #include <linux/mm.h> 22 18 #include <linux/memblock.h> 19 + #include <linux/kernel.h> 20 + #include <linux/string.h> 21 + #include <linux/types.h> 22 + #include <linux/cpu.h> 23 + #include <linux/mm.h> 23 24 #include <linux/of.h> 24 25 25 26 #include <asm/prom.h>
+11 -11
arch/sparc/kernel/psycho_common.h
··· 30 30 UE_ERR, CE_ERR, PCI_ERR 31 31 }; 32 32 33 - extern void psycho_check_iommu_error(struct pci_pbm_info *pbm, 34 - unsigned long afsr, 35 - unsigned long afar, 36 - enum psycho_error_type type); 33 + void psycho_check_iommu_error(struct pci_pbm_info *pbm, 34 + unsigned long afsr, 35 + unsigned long afar, 36 + enum psycho_error_type type); 37 37 38 - extern irqreturn_t psycho_pcierr_intr(int irq, void *dev_id); 38 + irqreturn_t psycho_pcierr_intr(int irq, void *dev_id); 39 39 40 - extern int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, 41 - u32 dvma_offset, u32 dma_mask, 42 - unsigned long write_complete_offset); 40 + int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, 41 + u32 dvma_offset, u32 dma_mask, 42 + unsigned long write_complete_offset); 43 43 44 - extern void psycho_pbm_init_common(struct pci_pbm_info *pbm, 45 - struct platform_device *op, 46 - const char *chip_name, int chip_type); 44 + void psycho_pbm_init_common(struct pci_pbm_info *pbm, 45 + struct platform_device *op, 46 + const char *chip_name, int chip_type); 47 47 48 48 #endif /* _PSYCHO_COMMON_H */
+2
arch/sparc/kernel/ptrace_32.c
··· 26 26 #include <asm/uaccess.h> 27 27 #include <asm/cacheflush.h> 28 28 29 + #include "kernel.h" 30 + 29 31 /* #define ALLOW_INIT_TRACING */ 30 32 31 33 /*
+2 -2
arch/sparc/kernel/setup_32.c
··· 267 267 } 268 268 269 269 struct tt_entry *sparc_ttable; 270 - struct pt_regs fake_swapper_regs; 270 + static struct pt_regs fake_swapper_regs; 271 271 272 272 /* Called from head_32.S - before we have setup anything 273 273 * in the kernel. Be very careful with what you do here. ··· 365 365 366 366 prom_setsync(prom_sync_me); 367 367 368 - if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) && 368 + if((boot_flags & BOOTME_DEBUG) && (linux_dbvec != NULL) && 369 369 ((*(short *)linux_dbvec) != -1)) { 370 370 printk("Booted under KADB. Syncing trap table.\n"); 371 371 (*(linux_dbvec->teach_debugger))();
+18 -38
arch/sparc/kernel/signal32.c
··· 31 31 #include <asm/switch_to.h> 32 32 33 33 #include "sigutil.h" 34 + #include "kernel.h" 34 35 35 36 /* This magic should be in g_upper[0] for all upper parts 36 37 * to be valid. ··· 146 145 unsigned int psr; 147 146 unsigned pc, npc; 148 147 sigset_t set; 149 - unsigned seta[_COMPAT_NSIG_WORDS]; 148 + compat_sigset_t seta; 150 149 int err, i; 151 150 152 151 /* Always make any pending restarted system calls return -EINTR */ ··· 210 209 if (restore_rwin_state(compat_ptr(rwin_save))) 211 210 goto segv; 212 211 } 213 - err |= __get_user(seta[0], &sf->info.si_mask); 214 - err |= copy_from_user(seta+1, &sf->extramask, 212 + err |= __get_user(seta.sig[0], &sf->info.si_mask); 213 + err |= copy_from_user(&seta.sig[1], &sf->extramask, 215 214 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); 216 215 if (err) 217 216 goto segv; 218 - switch (_NSIG_WORDS) { 219 - case 4: set.sig[3] = seta[6] + (((long)seta[7]) << 32); 220 - case 3: set.sig[2] = seta[4] + (((long)seta[5]) << 32); 221 - case 2: set.sig[1] = seta[2] + (((long)seta[3]) << 32); 222 - case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); 223 - } 217 + 218 + set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); 224 219 set_current_blocked(&set); 225 220 return; 226 221 ··· 300 303 goto segv; 301 304 } 302 305 303 - switch (_NSIG_WORDS) { 304 - case 4: set.sig[3] = seta.sig[6] + (((long)seta.sig[7]) << 32); 305 - case 3: set.sig[2] = seta.sig[4] + (((long)seta.sig[5]) << 32); 306 - case 2: set.sig[1] = seta.sig[2] + (((long)seta.sig[3]) << 32); 307 - case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); 308 - } 306 + set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); 309 307 set_current_blocked(&set); 310 308 return; 311 309 segv: ··· 409 417 void __user *tail; 410 418 int sigframe_size; 411 419 u32 psr; 412 - unsigned int seta[_COMPAT_NSIG_WORDS]; 420 + compat_sigset_t seta; 413 421 414 422 /* 1. Make sure everything is clean */ 415 423 synchronize_user_stack(); ··· 473 481 err |= __put_user(0, &sf->rwin_save); 474 482 } 475 483 476 - switch (_NSIG_WORDS) { 477 - case 4: seta[7] = (oldset->sig[3] >> 32); 478 - seta[6] = oldset->sig[3]; 479 - case 3: seta[5] = (oldset->sig[2] >> 32); 480 - seta[4] = oldset->sig[2]; 481 - case 2: seta[3] = (oldset->sig[1] >> 32); 482 - seta[2] = oldset->sig[1]; 483 - case 1: seta[1] = (oldset->sig[0] >> 32); 484 - seta[0] = oldset->sig[0]; 485 - } 486 - err |= __put_user(seta[0], &sf->info.si_mask); 487 - err |= __copy_to_user(sf->extramask, seta + 1, 484 + /* If these change we need to know - assignments to seta relies on these sizes */ 485 + BUILD_BUG_ON(_NSIG_WORDS != 1); 486 + BUILD_BUG_ON(_COMPAT_NSIG_WORDS != 2); 487 + seta.sig[1] = (oldset->sig[0] >> 32); 488 + seta.sig[0] = oldset->sig[0]; 489 + 490 + err |= __put_user(seta.sig[0], &sf->info.si_mask); 491 + err |= __copy_to_user(sf->extramask, &seta.sig[1], 488 492 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); 489 493 490 494 if (!wsaved) { ··· 610 622 /* Setup sigaltstack */ 611 623 err |= __compat_save_altstack(&sf->stack, regs->u_regs[UREG_FP]); 612 624 613 - switch (_NSIG_WORDS) { 614 - case 4: seta.sig[7] = (oldset->sig[3] >> 32); 615 - seta.sig[6] = oldset->sig[3]; 616 - case 3: seta.sig[5] = (oldset->sig[2] >> 32); 617 - seta.sig[4] = oldset->sig[2]; 618 - case 2: seta.sig[3] = (oldset->sig[1] >> 32); 619 - seta.sig[2] = oldset->sig[1]; 620 - case 1: seta.sig[1] = (oldset->sig[0] >> 32); 621 - seta.sig[0] = oldset->sig[0]; 622 - } 625 + seta.sig[1] = (oldset->sig[0] >> 32); 626 + seta.sig[0] = oldset->sig[0]; 623 627 err |= __copy_to_user(&sf->mask, &seta, sizeof(compat_sigset_t)); 624 628 625 629 if (!wsaved) {
+6 -5
arch/sparc/kernel/signal_32.c
··· 28 28 #include <asm/switch_to.h> 29 29 30 30 #include "sigutil.h" 31 + #include "kernel.h" 31 32 32 33 extern void fpsave(unsigned long *fpregs, unsigned long *fsr, 33 34 void *fpqueue, unsigned long *fpqdepth); ··· 342 341 err |= __put_user(0, &sf->extra_size); 343 342 344 343 if (psr & PSR_EF) { 345 - __siginfo_fpu_t *fp = tail; 344 + __siginfo_fpu_t __user *fp = tail; 346 345 tail += sizeof(*fp); 347 346 err |= save_fpu_state(regs, fp); 348 347 err |= __put_user(fp, &sf->fpu_save); ··· 350 349 err |= __put_user(0, &sf->fpu_save); 351 350 } 352 351 if (wsaved) { 353 - __siginfo_rwin_t *rwp = tail; 352 + __siginfo_rwin_t __user *rwp = tail; 354 353 tail += sizeof(*rwp); 355 354 err |= save_rwin_state(wsaved, rwp); 356 355 err |= __put_user(rwp, &sf->rwin_save); ··· 518 517 } 519 518 } 520 519 521 - asmlinkage int 522 - do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, 523 - unsigned long sp) 520 + asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, 521 + struct sigstack __user *ossptr, 522 + unsigned long sp) 524 523 { 525 524 int ret = -EFAULT; 526 525
+3 -3
arch/sparc/kernel/signal_64.c
··· 35 35 #include <asm/switch_to.h> 36 36 #include <asm/cacheflush.h> 37 37 38 - #include "entry.h" 39 - #include "systbls.h" 40 38 #include "sigutil.h" 39 + #include "systbls.h" 40 + #include "kernel.h" 41 + #include "entry.h" 41 42 42 43 /* {set, get}context() needed for 64-bit SparcLinux userland. */ 43 44 asmlinkage void sparc64_set_context(struct pt_regs *regs) ··· 493 492 494 493 #ifdef CONFIG_COMPAT 495 494 if (test_thread_flag(TIF_32BIT)) { 496 - extern void do_signal32(struct pt_regs *); 497 495 do_signal32(regs); 498 496 return; 499 497 }
+4 -9
arch/sparc/kernel/smp_32.c
··· 20 20 #include <linux/seq_file.h> 21 21 #include <linux/cache.h> 22 22 #include <linux/delay.h> 23 + #include <linux/profile.h> 23 24 #include <linux/cpu.h> 24 25 25 26 #include <asm/ptrace.h> ··· 76 75 77 76 void __init smp_cpus_done(unsigned int max_cpus) 78 77 { 79 - extern void smp4m_smp_done(void); 80 - extern void smp4d_smp_done(void); 81 78 unsigned long bogosum = 0; 82 79 int cpu, num = 0; 83 80 ··· 182 183 183 184 void __init smp_prepare_cpus(unsigned int max_cpus) 184 185 { 185 - extern void __init smp4m_boot_cpus(void); 186 - extern void __init smp4d_boot_cpus(void); 187 186 int i, cpuid, extra; 188 187 189 188 printk("Entering SMP Mode...\n"); ··· 258 261 259 262 int __cpu_up(unsigned int cpu, struct task_struct *tidle) 260 263 { 261 - extern int smp4m_boot_one_cpu(int, struct task_struct *); 262 - extern int smp4d_boot_one_cpu(int, struct task_struct *); 263 264 int ret=0; 264 265 265 266 switch(sparc_cpu_model) { ··· 292 297 return ret; 293 298 } 294 299 295 - void arch_cpu_pre_starting(void *arg) 300 + static void arch_cpu_pre_starting(void *arg) 296 301 { 297 302 local_ops->cache_all(); 298 303 local_ops->tlb_all(); ··· 312 317 } 313 318 } 314 319 315 - void arch_cpu_pre_online(void *arg) 320 + static void arch_cpu_pre_online(void *arg) 316 321 { 317 322 unsigned int cpuid = hard_smp_processor_id(); 318 323 ··· 339 344 } 340 345 } 341 346 342 - void sparc_start_secondary(void *arg) 347 + static void sparc_start_secondary(void *arg) 343 348 { 344 349 unsigned int cpu; 345 350
+3 -13
arch/sparc/kernel/smp_64.c
··· 25 25 #include <linux/ftrace.h> 26 26 #include <linux/cpu.h> 27 27 #include <linux/slab.h> 28 + #include <linux/kgdb.h> 28 29 29 30 #include <asm/head.h> 30 31 #include <asm/ptrace.h> ··· 36 35 #include <asm/hvtramp.h> 37 36 #include <asm/io.h> 38 37 #include <asm/timer.h> 38 + #include <asm/setup.h> 39 39 40 40 #include <asm/irq.h> 41 41 #include <asm/irq_regs.h> ··· 54 52 #include <asm/pcr.h> 55 53 56 54 #include "cpumap.h" 55 + #include "kernel.h" 57 56 58 57 DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; 59 58 cpumask_t cpu_core_map[NR_CPUS] __read_mostly = ··· 275 272 } 276 273 277 274 #if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) 278 - /* XXX Put this in some common place. XXX */ 279 - static unsigned long kimage_addr_to_ra(void *p) 280 - { 281 - unsigned long val = (unsigned long) p; 282 - 283 - return kern_base + (val - KERNBASE); 284 - } 285 - 286 275 static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, 287 276 void **descrp) 288 277 { ··· 861 866 extern unsigned long xcall_flush_dcache_page_cheetah; 862 867 #endif 863 868 extern unsigned long xcall_flush_dcache_page_spitfire; 864 - 865 - #ifdef CONFIG_DEBUG_DCFLUSH 866 - extern atomic_t dcpage_flushes; 867 - extern atomic_t dcpage_flushes_xcall; 868 - #endif 869 869 870 870 static inline void __local_flush_dcache_page(struct page *page) 871 871 {
+9 -8
arch/sparc/kernel/sun4d_irq.c
··· 143 143 } 144 144 } 145 145 146 - void sun4d_handler_irq(int pil, struct pt_regs *regs) 146 + void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs) 147 147 { 148 148 struct pt_regs *old_regs; 149 149 /* SBUS IRQ level (1 - 7) */ ··· 236 236 irq_unlink(data->irq); 237 237 } 238 238 239 - struct irq_chip sun4d_irq = { 239 + static struct irq_chip sun4d_irq = { 240 240 .name = "sun4d", 241 241 .irq_startup = sun4d_startup_irq, 242 242 .irq_shutdown = sun4d_shutdown_irq, ··· 285 285 } 286 286 } 287 287 288 - unsigned int _sun4d_build_device_irq(unsigned int real_irq, 289 - unsigned int pil, 290 - unsigned int board) 288 + static unsigned int _sun4d_build_device_irq(unsigned int real_irq, 289 + unsigned int pil, 290 + unsigned int board) 291 291 { 292 292 struct sun4d_handler_data *handler_data; 293 293 unsigned int irq; ··· 320 320 321 321 322 322 323 - unsigned int sun4d_build_device_irq(struct platform_device *op, 324 - unsigned int real_irq) 323 + static unsigned int sun4d_build_device_irq(struct platform_device *op, 324 + unsigned int real_irq) 325 325 { 326 326 struct device_node *dp = op->dev.of_node; 327 327 struct device_node *board_parent, *bus = dp->parent; ··· 383 383 return irq; 384 384 } 385 385 386 - unsigned int sun4d_build_timer_irq(unsigned int board, unsigned int real_irq) 386 + static unsigned int sun4d_build_timer_irq(unsigned int board, 387 + unsigned int real_irq) 387 388 { 388 389 return _sun4d_build_device_irq(real_irq, real_irq, board); 389 390 }
+2
arch/sparc/kernel/sys_sparc32.c
··· 49 49 #include <asm/mmu_context.h> 50 50 #include <asm/compat_signal.h> 51 51 52 + #include "systbls.h" 53 + 52 54 asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) 53 55 { 54 56 if ((int)high < 0)
+6 -4
arch/sparc/kernel/sys_sparc_32.c
··· 24 24 #include <asm/uaccess.h> 25 25 #include <asm/unistd.h> 26 26 27 + #include "systbls.h" 28 + 27 29 /* #define DEBUG_UNIMP_SYSCALL */ 28 30 29 31 /* XXX Make this per-binary type, this way we can detect the type of ··· 70 68 * sys_pipe() is the normal C calling standard for creating 71 69 * a pipe. It's not the way unix traditionally does this, though. 72 70 */ 73 - asmlinkage int sparc_pipe(struct pt_regs *regs) 71 + asmlinkage long sparc_pipe(struct pt_regs *regs) 74 72 { 75 73 int fd[2]; 76 74 int error; ··· 95 93 96 94 /* Linux version of mmap */ 97 95 98 - asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, 96 + asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 99 97 unsigned long prot, unsigned long flags, unsigned long fd, 100 98 unsigned long pgoff) 101 99 { ··· 105 103 pgoff >> (PAGE_SHIFT - 12)); 106 104 } 107 105 108 - asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, 106 + asmlinkage long sys_mmap(unsigned long addr, unsigned long len, 109 107 unsigned long prot, unsigned long flags, unsigned long fd, 110 108 unsigned long off) 111 109 { ··· 199 197 return ret; 200 198 } 201 199 202 - asmlinkage int sys_getdomainname(char __user *name, int len) 200 + asmlinkage long sys_getdomainname(char __user *name, int len) 203 201 { 204 202 int nlen, err; 205 203
+1
arch/sparc/kernel/sys_sparc_64.c
··· 31 31 #include <asm/unistd.h> 32 32 33 33 #include "entry.h" 34 + #include "kernel.h" 34 35 #include "systbls.h" 35 36 36 37 /* #define DEBUG_UNIMP_SYSCALL */
+94 -32
arch/sparc/kernel/systbls.h
··· 1 1 #ifndef _SYSTBLS_H 2 2 #define _SYSTBLS_H 3 3 4 - #include <linux/kernel.h> 5 - #include <linux/types.h> 6 4 #include <linux/signal.h> 5 + #include <linux/kernel.h> 6 + #include <linux/compat.h> 7 + #include <linux/types.h> 8 + 7 9 #include <asm/utrap.h> 8 10 9 - extern asmlinkage unsigned long sys_getpagesize(void); 10 - extern asmlinkage long sparc_pipe(struct pt_regs *regs); 11 - extern asmlinkage long sys_sparc_ipc(unsigned int call, int first, 12 - unsigned long second, 13 - unsigned long third, 14 - void __user *ptr, long fifth); 15 - extern asmlinkage long sparc64_personality(unsigned long personality); 16 - extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); 17 - extern asmlinkage unsigned long sys64_mremap(unsigned long addr, 18 - unsigned long old_len, 19 - unsigned long new_len, 20 - unsigned long flags, 21 - unsigned long new_addr); 22 - extern asmlinkage unsigned long c_sys_nis_syscall(struct pt_regs *regs); 23 - extern asmlinkage long sys_getdomainname(char __user *name, int len); 24 - extern asmlinkage long sys_utrap_install(utrap_entry_t type, 25 - utrap_handler_t new_p, 26 - utrap_handler_t new_d, 27 - utrap_handler_t __user *old_p, 28 - utrap_handler_t __user *old_d); 29 - extern asmlinkage long sparc_memory_ordering(unsigned long model, 30 - struct pt_regs *regs); 31 - extern asmlinkage long sys_rt_sigaction(int sig, 32 - const struct sigaction __user *act, 33 - struct sigaction __user *oact, 34 - void __user *restorer, 35 - size_t sigsetsize); 11 + asmlinkage unsigned long sys_getpagesize(void); 12 + asmlinkage long sparc_pipe(struct pt_regs *regs); 13 + asmlinkage unsigned long c_sys_nis_syscall(struct pt_regs *regs); 14 + asmlinkage long sys_getdomainname(char __user *name, int len); 15 + void do_rt_sigreturn(struct pt_regs *regs); 16 + asmlinkage long sys_mmap(unsigned long addr, unsigned long len, 17 + unsigned long prot, unsigned long flags, 18 + unsigned long fd, unsigned long off); 19 + asmlinkage void sparc_breakpoint(struct pt_regs *regs); 36 20 37 - extern asmlinkage void sparc64_set_context(struct pt_regs *regs); 38 - extern asmlinkage void sparc64_get_context(struct pt_regs *regs); 39 - extern void do_rt_sigreturn(struct pt_regs *regs); 21 + #ifdef CONFIG_SPARC32 22 + asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 23 + unsigned long prot, unsigned long flags, 24 + unsigned long fd, unsigned long pgoff); 25 + long sparc_remap_file_pages(unsigned long start, unsigned long size, 26 + unsigned long prot, unsigned long pgoff, 27 + unsigned long flags); 40 28 29 + #endif /* CONFIG_SPARC32 */ 30 + 31 + #ifdef CONFIG_SPARC64 32 + asmlinkage long sys_sparc_ipc(unsigned int call, int first, 33 + unsigned long second, 34 + unsigned long third, 35 + void __user *ptr, long fifth); 36 + asmlinkage long sparc64_personality(unsigned long personality); 37 + asmlinkage long sys64_munmap(unsigned long addr, size_t len); 38 + asmlinkage unsigned long sys64_mremap(unsigned long addr, 39 + unsigned long old_len, 40 + unsigned long new_len, 41 + unsigned long flags, 42 + unsigned long new_addr); 43 + asmlinkage long sys_utrap_install(utrap_entry_t type, 44 + utrap_handler_t new_p, 45 + utrap_handler_t new_d, 46 + utrap_handler_t __user *old_p, 47 + utrap_handler_t __user *old_d); 48 + asmlinkage long sparc_memory_ordering(unsigned long model, 49 + struct pt_regs *regs); 50 + asmlinkage void sparc64_set_context(struct pt_regs *regs); 51 + asmlinkage void sparc64_get_context(struct pt_regs *regs); 52 + asmlinkage long sys32_truncate64(const char __user * path, 53 + unsigned long high, 54 + unsigned long low); 55 + asmlinkage long sys32_ftruncate64(unsigned int fd, 56 + unsigned long high, 57 + unsigned long low); 58 + struct compat_stat64; 59 + asmlinkage long compat_sys_stat64(const char __user * filename, 60 + struct compat_stat64 __user *statbuf); 61 + asmlinkage long compat_sys_lstat64(const char __user * filename, 62 + struct compat_stat64 __user *statbuf); 63 + asmlinkage long compat_sys_fstat64(unsigned int fd, 64 + struct compat_stat64 __user * statbuf); 65 + asmlinkage long compat_sys_fstatat64(unsigned int dfd, 66 + const char __user *filename, 67 + struct compat_stat64 __user * statbuf, int flag); 68 + asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, 69 + char __user *ubuf, 70 + compat_size_t count, 71 + unsigned long poshi, 72 + unsigned long poslo); 73 + asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, 74 + char __user *ubuf, 75 + compat_size_t count, 76 + unsigned long poshi, 77 + unsigned long poslo); 78 + asmlinkage long compat_sys_readahead(int fd, 79 + unsigned long offhi, 80 + unsigned long offlo, 81 + compat_size_t count); 82 + long compat_sys_fadvise64(int fd, 83 + unsigned long offhi, 84 + unsigned long offlo, 85 + compat_size_t len, int advice); 86 + long compat_sys_fadvise64_64(int fd, 87 + unsigned long offhi, unsigned long offlo, 88 + unsigned long lenhi, unsigned long lenlo, 89 + int advice); 90 + long sys32_sync_file_range(unsigned int fd, 91 + unsigned long off_high, unsigned long off_low, 92 + unsigned long nb_high, unsigned long nb_low, 93 + unsigned int flags); 94 + asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, 95 + u32 lenhi, u32 lenlo); 96 + asmlinkage long compat_sys_fstat64(unsigned int fd, 97 + struct compat_stat64 __user * statbuf); 98 + asmlinkage long compat_sys_fstatat64(unsigned int dfd, 99 + const char __user *filename, 100 + struct compat_stat64 __user * statbuf, 101 + int flag); 102 + #endif /* CONFIG_SPARC64 */ 41 103 #endif /* _SYSTBLS_H */
-126
arch/sparc/kernel/tadpole.c
··· 1 - /* tadpole.c: Probing for the tadpole clock stopping h/w at boot time. 2 - * 3 - * Copyright (C) 1996 David Redman (djhr@tadpole.co.uk) 4 - */ 5 - 6 - #include <linux/string.h> 7 - #include <linux/kernel.h> 8 - #include <linux/sched.h> 9 - #include <linux/init.h> 10 - 11 - #include <asm/asi.h> 12 - #include <asm/oplib.h> 13 - #include <asm/io.h> 14 - 15 - #define MACIO_SCSI_CSR_ADDR 0x78400000 16 - #define MACIO_EN_DMA 0x00000200 17 - #define CLOCK_INIT_DONE 1 18 - 19 - static int clk_state; 20 - static volatile unsigned char *clk_ctrl; 21 - void (*cpu_pwr_save)(void); 22 - 23 - static inline unsigned int ldphys(unsigned int addr) 24 - { 25 - unsigned long data; 26 - 27 - __asm__ __volatile__("\n\tlda [%1] %2, %0\n\t" : 28 - "=r" (data) : 29 - "r" (addr), "i" (ASI_M_BYPASS)); 30 - return data; 31 - } 32 - 33 - static void clk_init(void) 34 - { 35 - __asm__ __volatile__("mov 0x6c, %%g1\n\t" 36 - "mov 0x4c, %%g2\n\t" 37 - "mov 0xdf, %%g3\n\t" 38 - "stb %%g1, [%0+3]\n\t" 39 - "stb %%g2, [%0+3]\n\t" 40 - "stb %%g3, [%0+3]\n\t" : : 41 - "r" (clk_ctrl) : 42 - "g1", "g2", "g3"); 43 - } 44 - 45 - static void clk_slow(void) 46 - { 47 - __asm__ __volatile__("mov 0xcc, %%g2\n\t" 48 - "mov 0x4c, %%g3\n\t" 49 - "mov 0xcf, %%g4\n\t" 50 - "mov 0xdf, %%g5\n\t" 51 - "stb %%g2, [%0+3]\n\t" 52 - "stb %%g3, [%0+3]\n\t" 53 - "stb %%g4, [%0+3]\n\t" 54 - "stb %%g5, [%0+3]\n\t" : : 55 - "r" (clk_ctrl) : 56 - "g2", "g3", "g4", "g5"); 57 - } 58 - 59 - /* 60 - * Tadpole is guaranteed to be UP, using local_irq_save. 61 - */ 62 - static void tsu_clockstop(void) 63 - { 64 - unsigned int mcsr; 65 - unsigned long flags; 66 - 67 - if (!clk_ctrl) 68 - return; 69 - if (!(clk_state & CLOCK_INIT_DONE)) { 70 - local_irq_save(flags); 71 - clk_init(); 72 - clk_state |= CLOCK_INIT_DONE; /* all done */ 73 - local_irq_restore(flags); 74 - return; 75 - } 76 - if (!(clk_ctrl[2] & 1)) 77 - return; /* no speed up yet */ 78 - 79 - local_irq_save(flags); 80 - 81 - /* if SCSI DMA in progress, don't slow clock */ 82 - mcsr = ldphys(MACIO_SCSI_CSR_ADDR); 83 - if ((mcsr&MACIO_EN_DMA) != 0) { 84 - local_irq_restore(flags); 85 - return; 86 - } 87 - /* TODO... the minimum clock setting ought to increase the 88 - * memory refresh interval.. 89 - */ 90 - clk_slow(); 91 - local_irq_restore(flags); 92 - } 93 - 94 - static void swift_clockstop(void) 95 - { 96 - if (!clk_ctrl) 97 - return; 98 - clk_ctrl[0] = 0; 99 - } 100 - 101 - void __init clock_stop_probe(void) 102 - { 103 - phandle node, clk_nd; 104 - char name[20]; 105 - 106 - prom_getstring(prom_root_node, "name", name, sizeof(name)); 107 - if (strncmp(name, "Tadpole", 7)) 108 - return; 109 - node = prom_getchild(prom_root_node); 110 - node = prom_searchsiblings(node, "obio"); 111 - node = prom_getchild(node); 112 - clk_nd = prom_searchsiblings(node, "clk-ctrl"); 113 - if (!clk_nd) 114 - return; 115 - printk("Clock Stopping h/w detected... "); 116 - clk_ctrl = (char *) prom_getint(clk_nd, "address"); 117 - clk_state = 0; 118 - if (name[10] == '\0') { 119 - cpu_pwr_save = tsu_clockstop; 120 - printk("enabled (S3)\n"); 121 - } else if ((name[10] == 'X') || (name[10] == 'G')) { 122 - cpu_pwr_save = swift_clockstop; 123 - printk("enabled (%s)\n",name+7); 124 - } else 125 - printk("disabled %s\n",name+7); 126 - }
+5 -3
arch/sparc/kernel/time_32.c
··· 36 36 #include <linux/of_device.h> 37 37 #include <linux/platform_device.h> 38 38 39 + #include <asm/mc146818rtc.h> 39 40 #include <asm/oplib.h> 40 41 #include <asm/timex.h> 41 42 #include <asm/timer.h> ··· 48 47 #include <asm/irq_regs.h> 49 48 #include <asm/setup.h> 50 49 50 + #include "kernel.h" 51 51 #include "irq.h" 52 52 53 53 static __cacheline_aligned_in_smp DEFINE_SEQLOCK(timer_cs_lock); ··· 85 83 86 84 EXPORT_SYMBOL(profile_pc); 87 85 88 - __volatile__ unsigned int *master_l10_counter; 86 + volatile u32 __iomem *master_l10_counter; 89 87 90 88 int update_persistent_clock(struct timespec now) 91 89 { ··· 145 143 146 144 static unsigned int sbus_cycles_offset(void) 147 145 { 148 - unsigned int val, offset; 146 + u32 val, offset; 149 147 150 - val = *master_l10_counter; 148 + val = sbus_readl(master_l10_counter); 151 149 offset = (val >> TIMER_VALUE_SHIFT) & TIMER_VALUE_MASK; 152 150 153 151 /* Limit hit? */
+1 -3
arch/sparc/kernel/traps_32.c
··· 44 44 #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t") 45 45 #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t") 46 46 47 - void die_if_kernel(char *str, struct pt_regs *regs) 47 + void __noreturn die_if_kernel(char *str, struct pt_regs *regs) 48 48 { 49 49 static int die_counter; 50 50 int count = 0; ··· 218 218 static unsigned long fake_fsr; 219 219 static unsigned long fake_queue[32] __attribute__ ((aligned (8))); 220 220 static unsigned long fake_depth; 221 - 222 - extern int do_mathemu(struct pt_regs *, struct task_struct *); 223 221 224 222 void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, 225 223 unsigned long psr)
+3 -8
arch/sparc/kernel/traps_64.c
··· 43 43 #include <asm/prom.h> 44 44 #include <asm/memctrl.h> 45 45 #include <asm/cacheflush.h> 46 + #include <asm/setup.h> 46 47 47 48 #include "entry.h" 49 + #include "kernel.h" 48 50 #include "kstack.h" 49 51 50 52 /* When an irrecoverable trap occurs at tl > 0, the trap entry ··· 2211 2209 exception_exit(prev_state); 2212 2210 } 2213 2211 2214 - extern int do_mathemu(struct pt_regs *, struct fpustate *, bool); 2215 - 2216 2212 void do_fpother(struct pt_regs *regs) 2217 2213 { 2218 2214 enum ctx_state prev_state = exception_enter(); ··· 2383 2383 return (struct reg_window *) (fp + STACK_BIAS); 2384 2384 } 2385 2385 2386 - void die_if_kernel(char *str, struct pt_regs *regs) 2386 + void __noreturn die_if_kernel(char *str, struct pt_regs *regs) 2387 2387 { 2388 2388 static int die_counter; 2389 2389 int count = 0; ··· 2432 2432 2433 2433 #define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) 2434 2434 #define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19)) 2435 - 2436 - extern int handle_popc(u32 insn, struct pt_regs *regs); 2437 - extern int handle_ldf_stq(u32 insn, struct pt_regs *regs); 2438 2435 2439 2436 void do_illegal_instruction(struct pt_regs *regs) 2440 2437 { ··· 2482 2485 out: 2483 2486 exception_exit(prev_state); 2484 2487 } 2485 - 2486 - extern void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 2487 2488 2488 2489 void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 2489 2490 {
+4
arch/sparc/kernel/unaligned_32.c
··· 16 16 #include <linux/smp.h> 17 17 #include <linux/perf_event.h> 18 18 19 + #include <asm/setup.h> 20 + 21 + #include "kernel.h" 22 + 19 23 enum direction { 20 24 load, /* ld, ldd, ldh, ldsh */ 21 25 store, /* st, std, sth, stsh */
+2
arch/sparc/kernel/unaligned_64.c
··· 24 24 #include <linux/context_tracking.h> 25 25 #include <asm/fpumacro.h> 26 26 #include <asm/cacheflush.h> 27 + #include <asm/setup.h> 27 28 28 29 #include "entry.h" 30 + #include "kernel.h" 29 31 30 32 enum direction { 31 33 load, /* ld, ldd, ldh, ldsh */
+3
arch/sparc/kernel/windows.c
··· 10 10 #include <linux/mm.h> 11 11 #include <linux/smp.h> 12 12 13 + #include <asm/cacheflush.h> 13 14 #include <asm/uaccess.h> 15 + 16 + #include "kernel.h" 14 17 15 18 /* Do save's until all user register windows are out of the cpu. */ 16 19 void flush_user_windows(void)
+1 -1
arch/sparc/lib/Makefile
··· 41 41 lib-$(CONFIG_SPARC64) += copy_in_user.o user_fixup.o memmove.o 42 42 lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o 43 43 44 - obj-y += iomap.o 44 + obj-$(CONFIG_SPARC64) += iomap.o 45 45 obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o 46 46 obj-y += ksyms.o 47 47 obj-$(CONFIG_SPARC64) += PeeCeeI.o
+10 -10
arch/sparc/math-emu/sfp-util_32.h
··· 4 4 #include <asm/byteorder.h> 5 5 6 6 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 7 - __asm__ ("addcc %r4,%5,%1\n\t" \ 7 + __asm__ ("addcc %r4,%5,%1\n\t" \ 8 8 "addx %r2,%3,%0\n" \ 9 - : "=r" ((USItype)(sh)), \ 10 - "=&r" ((USItype)(sl)) \ 9 + : "=r" (sh), \ 10 + "=&r" (sl) \ 11 11 : "%rJ" ((USItype)(ah)), \ 12 12 "rI" ((USItype)(bh)), \ 13 13 "%rJ" ((USItype)(al)), \ 14 14 "rI" ((USItype)(bl)) \ 15 15 : "cc") 16 16 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 17 - __asm__ ("subcc %r4,%5,%1\n\t" \ 17 + __asm__ ("subcc %r4,%5,%1\n\t" \ 18 18 "subx %r2,%3,%0\n" \ 19 - : "=r" ((USItype)(sh)), \ 20 - "=&r" ((USItype)(sl)) \ 19 + : "=r" (sh), \ 20 + "=&r" (sl) \ 21 21 : "rJ" ((USItype)(ah)), \ 22 22 "rI" ((USItype)(bh)), \ 23 23 "rJ" ((USItype)(al)), \ ··· 65 65 "mulscc %%g1,0,%%g1\n\t" \ 66 66 "add %%g1,%%g2,%0\n\t" \ 67 67 "rd %%y,%1\n" \ 68 - : "=r" ((USItype)(w1)), \ 69 - "=r" ((USItype)(w0)) \ 68 + : "=r" (w1), \ 69 + "=r" (w0) \ 70 70 : "%rI" ((USItype)(u)), \ 71 71 "r" ((USItype)(v)) \ 72 72 : "%g1", "%g2", "cc") ··· 98 98 "sub %1,%2,%1\n\t" \ 99 99 "3: xnor %0,0,%0\n\t" \ 100 100 "! End of inline udiv_qrnnd\n" \ 101 - : "=&r" ((USItype)(q)), \ 102 - "=&r" ((USItype)(r)) \ 101 + : "=&r" (q), \ 102 + "=&r" (r) \ 103 103 : "r" ((USItype)(d)), \ 104 104 "1" ((USItype)(n1)), \ 105 105 "0" ((USItype)(n0)) : "%g1", "cc")
+6 -6
arch/sparc/math-emu/sfp-util_64.h
··· 17 17 "bcs,a,pn %%xcc, 1f\n\t" \ 18 18 "add %0, 1, %0\n" \ 19 19 "1:" \ 20 - : "=r" ((UDItype)(sh)), \ 21 - "=&r" ((UDItype)(sl)) \ 20 + : "=r" (sh), \ 21 + "=&r" (sl) \ 22 22 : "r" ((UDItype)(ah)), \ 23 23 "r" ((UDItype)(bh)), \ 24 24 "r" ((UDItype)(al)), \ ··· 31 31 "bcs,a,pn %%xcc, 1f\n\t" \ 32 32 "sub %0, 1, %0\n" \ 33 33 "1:" \ 34 - : "=r" ((UDItype)(sh)), \ 35 - "=&r" ((UDItype)(sl)) \ 34 + : "=r" (sh), \ 35 + "=&r" (sl) \ 36 36 : "r" ((UDItype)(ah)), \ 37 37 "r" ((UDItype)(bh)), \ 38 38 "r" ((UDItype)(al)), \ ··· 64 64 "sllx %3,32,%3\n\t" \ 65 65 "add %1,%3,%1\n\t" \ 66 66 "add %5,%2,%0" \ 67 - : "=r" ((UDItype)(wh)), \ 68 - "=&r" ((UDItype)(wl)), \ 67 + : "=r" (wh), \ 68 + "=&r" (wl), \ 69 69 "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ 70 70 : "r" ((UDItype)(u)), \ 71 71 "r" ((UDItype)(v)) \
+3 -6
arch/sparc/mm/fault_32.c
··· 26 26 #include <asm/pgtable.h> 27 27 #include <asm/openprom.h> 28 28 #include <asm/oplib.h> 29 + #include <asm/setup.h> 29 30 #include <asm/smp.h> 30 31 #include <asm/traps.h> 31 32 #include <asm/uaccess.h> 32 33 33 - int show_unhandled_signals = 1; 34 + #include "mm_32.h" 34 35 35 - static void unhandled_fault(unsigned long, struct task_struct *, 36 - struct pt_regs *) __attribute__ ((noreturn)); 36 + int show_unhandled_signals = 1; 37 37 38 38 static void __noreturn unhandled_fault(unsigned long address, 39 39 struct task_struct *tsk, ··· 140 140 141 141 force_sig_info (sig, &info, current); 142 142 } 143 - 144 - extern unsigned long safe_compute_effective_address(struct pt_regs *, 145 - unsigned int); 146 143 147 144 static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) 148 145 {
+1 -3
arch/sparc/mm/fault_64.c
··· 32 32 #include <asm/lsu.h> 33 33 #include <asm/sections.h> 34 34 #include <asm/mmu_context.h> 35 + #include <asm/setup.h> 35 36 36 37 int show_unhandled_signals = 1; 37 38 ··· 196 195 197 196 force_sig_info(sig, &info, current); 198 197 } 199 - 200 - extern int handle_ldf_stq(u32, struct pt_regs *); 201 - extern int handle_ld_nf(u32, struct pt_regs *); 202 198 203 199 static unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn) 204 200 {
+3 -4
arch/sparc/mm/init_32.c
··· 31 31 #include <asm/pgtable.h> 32 32 #include <asm/vaddrs.h> 33 33 #include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ 34 + #include <asm/setup.h> 34 35 #include <asm/tlb.h> 35 36 #include <asm/prom.h> 36 37 #include <asm/leon.h> 38 + 39 + #include "mm_32.h" 37 40 38 41 unsigned long *sparc_valid_addr_bitmap; 39 42 EXPORT_SYMBOL(sparc_valid_addr_bitmap); ··· 66 63 } 67 64 68 65 69 - extern unsigned long cmdline_memory_size; 70 66 unsigned long last_valid_pfn; 71 67 72 68 unsigned long calc_highpages(void) ··· 248 246 * init routine based upon the Sun model type on the Sparc. 249 247 * 250 248 */ 251 - extern void srmmu_paging_init(void); 252 - extern void device_scan(void); 253 - 254 249 void __init paging_init(void) 255 250 { 256 251 srmmu_paging_init();
+7 -2
arch/sparc/mm/init_64.c
··· 47 47 #include <asm/prom.h> 48 48 #include <asm/mdesc.h> 49 49 #include <asm/cpudata.h> 50 + #include <asm/setup.h> 50 51 #include <asm/irq.h> 51 52 52 53 #include "init_64.h" ··· 795 794 static struct node_mem_mask node_masks[MAX_NUMNODES]; 796 795 static int num_node_masks; 797 796 797 + #ifdef CONFIG_NEED_MULTIPLE_NODES 798 + 798 799 int numa_cpu_lookup_table[NR_CPUS]; 799 800 cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES]; 800 - 801 - #ifdef CONFIG_NEED_MULTIPLE_NODES 802 801 803 802 struct mdesc_mblock { 804 803 u64 base; ··· 888 887 889 888 static void init_node_masks_nonnuma(void) 890 889 { 890 + #ifdef CONFIG_NEED_MULTIPLE_NODES 891 891 int i; 892 + #endif 892 893 893 894 numadbg("Initializing tables for non-numa.\n"); 894 895 895 896 node_masks[0].mask = node_masks[0].val = 0; 896 897 num_node_masks = 1; 897 898 899 + #ifdef CONFIG_NEED_MULTIPLE_NODES 898 900 for (i = 0; i < NR_CPUS; i++) 899 901 numa_cpu_lookup_table[i] = 0; 900 902 901 903 cpumask_setall(&numa_cpumask_lookup_table[0]); 904 + #endif 902 905 } 903 906 904 907 #ifdef CONFIG_NEED_MULTIPLE_NODES
+2 -2
arch/sparc/mm/init_64.h
··· 21 21 extern unsigned long sparc64_kern_pri_context; 22 22 extern unsigned long sparc64_kern_pri_nuc_bits; 23 23 extern unsigned long sparc64_kern_sec_context; 24 - extern void mmu_info(struct seq_file *m); 24 + void mmu_info(struct seq_file *m); 25 25 26 26 struct linux_prom_translation { 27 27 unsigned long virt; ··· 36 36 /* Exported for SMP bootup purposes. */ 37 37 extern unsigned long kern_locked_tte_data; 38 38 39 - extern void prom_world(int enter); 39 + void prom_world(int enter); 40 40 41 41 #ifdef CONFIG_SPARSEMEM_VMEMMAP 42 42 #define VMEMMAP_CHUNK_SHIFT 22
+12 -9
arch/sparc/mm/io-unit.c
··· 25 25 #include <asm/dma.h> 26 26 #include <asm/oplib.h> 27 27 28 + #include "mm_32.h" 29 + 28 30 /* #define IOUNIT_DEBUG */ 29 31 #ifdef IOUNIT_DEBUG 30 32 #define IOD(x) printk(x) ··· 40 38 static void __init iounit_iommu_init(struct platform_device *op) 41 39 { 42 40 struct iounit_struct *iounit; 43 - iopte_t *xpt, *xptend; 41 + iopte_t __iomem *xpt; 42 + iopte_t __iomem *xptend; 44 43 45 44 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); 46 45 if (!iounit) { ··· 65 62 op->dev.archdata.iommu = iounit; 66 63 iounit->page_table = xpt; 67 64 spin_lock_init(&iounit->lock); 68 - 69 - for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t); 70 - xpt < xptend;) 71 - iopte_val(*xpt++) = 0; 65 + 66 + xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t); 67 + for (; xpt < xptend; xpt++) 68 + sbus_writel(0, xpt); 72 69 } 73 70 74 71 static int __init iounit_init(void) ··· 133 130 vaddr = IOUNIT_DMA_BASE + (scan << PAGE_SHIFT) + (vaddr & ~PAGE_MASK); 134 131 for (k = 0; k < npages; k++, iopte = __iopte(iopte_val(iopte) + 0x100), scan++) { 135 132 set_bit(scan, iounit->bmap); 136 - iounit->page_table[scan] = iopte; 133 + sbus_writel(iopte, &iounit->page_table[scan]); 137 134 } 138 135 IOD(("%08lx\n", vaddr)); 139 136 return vaddr; ··· 205 202 struct iounit_struct *iounit = dev->archdata.iommu; 206 203 unsigned long page, end; 207 204 pgprot_t dvma_prot; 208 - iopte_t *iopte; 205 + iopte_t __iomem *iopte; 209 206 210 207 *pba = addr; 211 208 ··· 227 224 228 225 i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT); 229 226 230 - iopte = (iopte_t *)(iounit->page_table + i); 231 - *iopte = MKIOPTE(__pa(page)); 227 + iopte = iounit->page_table + i; 228 + sbus_writel(MKIOPTE(__pa(page)), iopte); 232 229 } 233 230 addr += PAGE_SIZE; 234 231 va += PAGE_SIZE;
+15 -10
arch/sparc/mm/iommu.c
··· 27 27 #include <asm/iommu.h> 28 28 #include <asm/dma.h> 29 29 30 + #include "mm_32.h" 31 + 30 32 /* 31 33 * This can be sized dynamically, but we will do this 32 34 * only when we have a guidance about actual I/O pressures. ··· 39 37 #define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */ 40 38 #define IOMMU_ORDER 6 /* 4096 * (1<<6) */ 41 39 42 - /* srmmu.c */ 43 - extern int viking_mxcc_present; 44 - extern int flush_page_for_dma_global; 45 40 static int viking_flush; 46 41 /* viking.S */ 47 42 extern void viking_flush_page(unsigned long page); ··· 58 59 struct iommu_struct *iommu; 59 60 unsigned int impl, vers; 60 61 unsigned long *bitmap; 62 + unsigned long control; 63 + unsigned long base; 61 64 unsigned long tmp; 62 65 63 66 iommu = kmalloc(sizeof(struct iommu_struct), GFP_KERNEL); ··· 74 73 prom_printf("Cannot map IOMMU registers\n"); 75 74 prom_halt(); 76 75 } 77 - impl = (iommu->regs->control & IOMMU_CTRL_IMPL) >> 28; 78 - vers = (iommu->regs->control & IOMMU_CTRL_VERS) >> 24; 79 - tmp = iommu->regs->control; 80 - tmp &= ~(IOMMU_CTRL_RNGE); 81 - tmp |= (IOMMU_RNGE_256MB | IOMMU_CTRL_ENAB); 82 - iommu->regs->control = tmp; 76 + 77 + control = sbus_readl(&iommu->regs->control); 78 + impl = (control & IOMMU_CTRL_IMPL) >> 28; 79 + vers = (control & IOMMU_CTRL_VERS) >> 24; 80 + control &= ~(IOMMU_CTRL_RNGE); 81 + control |= (IOMMU_RNGE_256MB | IOMMU_CTRL_ENAB); 82 + sbus_writel(control, &iommu->regs->control); 83 + 83 84 iommu_invalidate(iommu->regs); 84 85 iommu->start = IOMMU_START; 85 86 iommu->end = 0xffffffff; ··· 103 100 memset(iommu->page_table, 0, IOMMU_NPTES*sizeof(iopte_t)); 104 101 flush_cache_all(); 105 102 flush_tlb_all(); 106 - iommu->regs->base = __pa((unsigned long) iommu->page_table) >> 4; 103 + 104 + base = __pa((unsigned long)iommu->page_table) >> 4; 105 + sbus_writel(base, &iommu->regs->base); 107 106 iommu_invalidate(iommu->regs); 108 107 109 108 bitmap = kmalloc(IOMMU_NPTES>>3, GFP_KERNEL);
+2 -2
arch/sparc/mm/leon_mm.c
··· 15 15 #include <asm/leon.h> 16 16 #include <asm/tlbflush.h> 17 17 18 - #include "srmmu.h" 18 + #include "mm_32.h" 19 19 20 20 int leon_flush_during_switch = 1; 21 - int srmmu_swprobe_trace; 21 + static int srmmu_swprobe_trace; 22 22 23 23 static inline unsigned long leon_get_ctable_ptr(void) 24 24 {
+24
arch/sparc/mm/mm_32.h
··· 1 + /* fault_32.c - visible as they are called from assembler */ 2 + asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, 3 + unsigned long address); 4 + asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, 5 + unsigned long address); 6 + 7 + void window_overflow_fault(void); 8 + void window_underflow_fault(unsigned long sp); 9 + void window_ret_fault(struct pt_regs *regs); 10 + 11 + /* srmmu.c */ 12 + extern char *srmmu_name; 13 + extern int viking_mxcc_present; 14 + extern int flush_page_for_dma_global; 15 + 16 + extern void (*poke_srmmu)(void); 17 + 18 + void __init srmmu_paging_init(void); 19 + 20 + /* iommu.c */ 21 + void ld_mmu_iommu(void); 22 + 23 + /* io-unit.c */ 24 + void ld_mmu_iounit(void);
+4 -9
arch/sparc/mm/srmmu.c
··· 49 49 #include <asm/mxcc.h> 50 50 #include <asm/ross.h> 51 51 52 - #include "srmmu.h" 52 + #include "mm_32.h" 53 53 54 54 enum mbus_module srmmu_modtype; 55 55 static unsigned int hwbug_bitmask; ··· 100 100 #define SRMMU_NOCACHE_ALIGN_MAX (sizeof(ctxd_t)*SRMMU_MAX_CONTEXTS) 101 101 102 102 void *srmmu_nocache_pool; 103 - void *srmmu_nocache_bitmap; 104 103 static struct bit_map srmmu_nocache_map; 105 104 106 105 static inline int srmmu_pmd_none(pmd_t pmd) ··· 172 173 printk(KERN_ERR "srmmu: out of nocache %d: %d/%d\n", 173 174 size, (int) srmmu_nocache_size, 174 175 srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT); 175 - return 0; 176 + return NULL; 176 177 } 177 178 178 179 addr = SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT); ··· 268 269 269 270 static void __init srmmu_nocache_init(void) 270 271 { 272 + void *srmmu_nocache_bitmap; 271 273 unsigned int bitmap_bits; 272 274 pgd_t *pgd; 273 275 pmd_t *pmd; ··· 728 728 "=r" (retval) : 729 729 "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); 730 730 } else { 731 - retval = leon_swprobe(vaddr, 0); 731 + retval = leon_swprobe(vaddr, NULL); 732 732 } 733 733 return retval; 734 734 } ··· 864 864 } 865 865 866 866 void (*poke_srmmu)(void) = NULL; 867 - 868 - extern unsigned long bootmem_init(unsigned long *pages_avail); 869 867 870 868 void __init srmmu_paging_init(void) 871 869 { ··· 1769 1771 /* Load up routines and constants for sun4m and sun4d mmu */ 1770 1772 void __init load_mmu(void) 1771 1773 { 1772 - extern void ld_mmu_iommu(void); 1773 - extern void ld_mmu_iounit(void); 1774 - 1775 1774 /* Functions */ 1776 1775 get_srmmu_type(); 1777 1776
-4
arch/sparc/mm/srmmu.h
··· 1 - /* srmmu.c */ 2 - extern char *srmmu_name; 3 - 4 - extern void (*poke_srmmu)(void);
+1
arch/sparc/mm/tsb.c
··· 9 9 #include <asm/page.h> 10 10 #include <asm/pgtable.h> 11 11 #include <asm/mmu_context.h> 12 + #include <asm/setup.h> 12 13 #include <asm/tsb.h> 13 14 #include <asm/tlb.h> 14 15 #include <asm/oplib.h>
-5
arch/sparc/prom/misc_64.c
··· 81 81 } 82 82 EXPORT_SYMBOL(prom_feval); 83 83 84 - #ifdef CONFIG_SMP 85 - extern void smp_capture(void); 86 - extern void smp_release(void); 87 - #endif 88 - 89 84 /* Drop into the prom, with the chance to continue with the 'go' 90 85 * prom command. 91 86 */
-6
arch/unicore32/Kconfig
··· 51 51 config ARCH_HAS_ILOG2_U64 52 52 bool 53 53 54 - config ARCH_HAS_CPUFREQ 55 - bool 56 - 57 54 config GENERIC_HWEIGHT 58 55 def_bool y 59 56 ··· 84 87 select GENERIC_CLOCKEVENTS 85 88 select HAVE_CLK 86 89 select ARCH_REQUIRE_GPIOLIB 87 - select ARCH_HAS_CPUFREQ 88 90 89 91 # CONFIGs for ARCH_PUV3 90 92 ··· 194 198 195 199 source "kernel/power/Kconfig" 196 200 197 - if ARCH_HAS_CPUFREQ 198 201 source "drivers/cpufreq/Kconfig" 199 - endif 200 202 201 203 config ARCH_SUSPEND_POSSIBLE 202 204 def_bool y if !ARCH_FPGA
+27
arch/unicore32/include/asm/io.h
··· 39 39 #define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size) 40 40 #define iounmap(cookie) __uc32_iounmap(cookie) 41 41 42 + #define readb_relaxed readb 43 + #define readw_relaxed readw 44 + #define readl_relaxed readl 45 + 42 46 #define HAVE_ARCH_PIO_SIZE 43 47 #define PIO_OFFSET (unsigned int)(PCI_IOBASE) 44 48 #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) 45 49 #define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1) 50 + 51 + #ifdef CONFIG_STRICT_DEVMEM 52 + 53 + #include <linux/ioport.h> 54 + #include <linux/mm.h> 55 + 56 + /* 57 + * devmem_is_allowed() checks to see if /dev/mem access to a certain 58 + * address is valid. The argument is a physical page number. 59 + * We mimic x86 here by disallowing access to system RAM as well as 60 + * device-exclusive MMIO regions. This effectively disable read()/write() 61 + * on /dev/mem. 62 + */ 63 + static inline int devmem_is_allowed(unsigned long pfn) 64 + { 65 + if (iomem_is_exclusive(pfn << PAGE_SHIFT)) 66 + return 0; 67 + if (!page_is_ram(pfn)) 68 + return 1; 69 + return 0; 70 + } 71 + 72 + #endif /* CONFIG_STRICT_DEVMEM */ 46 73 47 74 #endif /* __KERNEL__ */ 48 75 #endif /* __UNICORE_IO_H__ */
+5 -5
arch/unicore32/include/asm/pgtable.h
··· 87 87 88 88 #define PAGE_NONE pgprot_user 89 89 #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user | PTE_READ \ 90 - | PTE_WRITE) 90 + | PTE_WRITE)) 91 91 #define PAGE_SHARED_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ 92 92 | PTE_WRITE \ 93 - | PTE_EXEC) 93 + | PTE_EXEC)) 94 94 #define PAGE_COPY __pgprot(pgprot_val(pgprot_user | PTE_READ) 95 95 #define PAGE_COPY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ 96 - | PTE_EXEC) 97 - #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ) 96 + | PTE_EXEC)) 97 + #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ)) 98 98 #define PAGE_READONLY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ 99 - | PTE_EXEC) 99 + | PTE_EXEC)) 100 100 #define PAGE_KERNEL pgprot_kernel 101 101 #define PAGE_KERNEL_EXEC __pgprot(pgprot_val(pgprot_kernel | PTE_EXEC)) 102 102
+1
arch/unicore32/include/asm/ptrace.h
··· 55 55 56 56 #define instruction_pointer(regs) ((regs)->UCreg_pc) 57 57 #define user_stack_pointer(regs) ((regs)->UCreg_sp) 58 + #define profile_pc(regs) instruction_pointer(regs) 58 59 59 60 #endif /* __ASSEMBLY__ */ 60 61 #endif
+4 -4
arch/unicore32/kernel/clock.c
··· 179 179 } 180 180 #ifdef CONFIG_CPU_FREQ 181 181 if (clk == &clk_mclk_clk) { 182 - u32 pll_rate, divstatus = PM_DIVSTATUS; 182 + u32 pll_rate, divstatus = readl(PM_DIVSTATUS); 183 183 int ret, i; 184 184 185 185 /* lookup mclk_clk_table */ ··· 201 201 / (((divstatus & 0x0000f000) >> 12) + 1); 202 202 203 203 /* set pll sys cfg reg. */ 204 - PM_PLLSYSCFG = pll_rate; 204 + writel(pll_rate, PM_PLLSYSCFG); 205 205 206 - PM_PMCR = PM_PMCR_CFBSYS; 207 - while ((PM_PLLDFCDONE & PM_PLLDFCDONE_SYSDFC) 206 + writel(PM_PMCR_CFBSYS, PM_PMCR); 207 + while ((readl(PM_PLLDFCDONE) & PM_PLLDFCDONE_SYSDFC) 208 208 != PM_PLLDFCDONE_SYSDFC) 209 209 udelay(100); 210 210 /* about 1ms */
+2 -39
arch/unicore32/kernel/ksyms.c
··· 23 23 24 24 #include "ksyms.h" 25 25 26 + EXPORT_SYMBOL(find_first_bit); 27 + EXPORT_SYMBOL(find_first_zero_bit); 26 28 EXPORT_SYMBOL(find_next_zero_bit); 27 29 EXPORT_SYMBOL(find_next_bit); 28 - 29 - EXPORT_SYMBOL(__backtrace); 30 30 31 31 /* platform dependent support */ 32 32 EXPORT_SYMBOL(__udelay); 33 33 EXPORT_SYMBOL(__const_udelay); 34 - 35 - /* networking */ 36 - EXPORT_SYMBOL(csum_partial); 37 - EXPORT_SYMBOL(csum_partial_copy_from_user); 38 - EXPORT_SYMBOL(csum_partial_copy_nocheck); 39 - EXPORT_SYMBOL(__csum_ipv6_magic); 40 - 41 - /* io */ 42 - #ifndef __raw_readsb 43 - EXPORT_SYMBOL(__raw_readsb); 44 - #endif 45 - #ifndef __raw_readsw 46 - EXPORT_SYMBOL(__raw_readsw); 47 - #endif 48 - #ifndef __raw_readsl 49 - EXPORT_SYMBOL(__raw_readsl); 50 - #endif 51 - #ifndef __raw_writesb 52 - EXPORT_SYMBOL(__raw_writesb); 53 - #endif 54 - #ifndef __raw_writesw 55 - EXPORT_SYMBOL(__raw_writesw); 56 - #endif 57 - #ifndef __raw_writesl 58 - EXPORT_SYMBOL(__raw_writesl); 59 - #endif 60 34 61 35 /* string / mem functions */ 62 36 EXPORT_SYMBOL(strchr); ··· 50 76 EXPORT_SYMBOL(__copy_to_user); 51 77 EXPORT_SYMBOL(__clear_user); 52 78 53 - EXPORT_SYMBOL(__get_user_1); 54 - EXPORT_SYMBOL(__get_user_2); 55 - EXPORT_SYMBOL(__get_user_4); 56 - 57 - EXPORT_SYMBOL(__put_user_1); 58 - EXPORT_SYMBOL(__put_user_2); 59 - EXPORT_SYMBOL(__put_user_4); 60 - EXPORT_SYMBOL(__put_user_8); 61 - 62 79 EXPORT_SYMBOL(__ashldi3); 63 80 EXPORT_SYMBOL(__ashrdi3); 64 81 EXPORT_SYMBOL(__divsi3); 65 82 EXPORT_SYMBOL(__lshrdi3); 66 83 EXPORT_SYMBOL(__modsi3); 67 - EXPORT_SYMBOL(__muldi3); 68 84 EXPORT_SYMBOL(__ucmpdi2); 69 85 EXPORT_SYMBOL(__udivsi3); 70 86 EXPORT_SYMBOL(__umodsi3); 71 - EXPORT_SYMBOL(__bswapsi2); 72 87
-2
arch/unicore32/kernel/ksyms.h
··· 8 8 extern void __divsi3(void); 9 9 extern void __lshrdi3(void); 10 10 extern void __modsi3(void); 11 - extern void __muldi3(void); 12 11 extern void __ucmpdi2(void); 13 12 extern void __udivsi3(void); 14 13 extern void __umodsi3(void); 15 - extern void __bswapsi2(void);
+3 -8
arch/unicore32/kernel/module.c
··· 24 24 25 25 void *module_alloc(unsigned long size) 26 26 { 27 - struct vm_struct *area; 28 - 29 - size = PAGE_ALIGN(size); 30 - area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); 31 - if (!area) 32 - return NULL; 33 - 34 - return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC); 27 + return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, 28 + GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE, 29 + __builtin_return_address(0)); 35 30 } 36 31 37 32 int
+1
arch/unicore32/kernel/process.c
··· 60 60 * Function pointers to optional machine specific functions 61 61 */ 62 62 void (*pm_power_off)(void) = NULL; 63 + EXPORT_SYMBOL(pm_power_off); 63 64 64 65 void machine_power_off(void) 65 66 {
+4
arch/unicore32/kernel/setup.c
··· 53 53 54 54 static struct stack stacks[NR_CPUS]; 55 55 56 + #ifdef CONFIG_VGA_CONSOLE 57 + struct screen_info screen_info; 58 + #endif 59 + 56 60 char elf_platform[ELF_PLATFORM_SIZE]; 57 61 EXPORT_SYMBOL(elf_platform); 58 62
+1
arch/unicore32/mm/alignment.c
··· 21 21 #include <linux/sched.h> 22 22 #include <linux/uaccess.h> 23 23 24 + #include <asm/pgtable.h> 24 25 #include <asm/tlbflush.h> 25 26 #include <asm/unaligned.h> 26 27
+2
arch/unicore32/mm/proc-syms.c
··· 19 19 EXPORT_SYMBOL(cpu_dcache_clean_area); 20 20 EXPORT_SYMBOL(cpu_set_pte); 21 21 22 + EXPORT_SYMBOL(__cpuc_coherent_kern_range); 23 + 22 24 EXPORT_SYMBOL(__cpuc_dma_flush_range); 23 25 EXPORT_SYMBOL(__cpuc_dma_clean_range);
-1
arch/x86/Kconfig
··· 1672 1672 config RANDOMIZE_BASE 1673 1673 bool "Randomize the address of the kernel image" 1674 1674 depends on RELOCATABLE 1675 - depends on !HIBERNATION 1676 1675 default n 1677 1676 ---help--- 1678 1677 Randomizes the physical and virtual address at which the
+9 -2
arch/x86/boot/compressed/aslr.c
··· 289 289 unsigned long choice = (unsigned long)output; 290 290 unsigned long random; 291 291 292 - if (cmdline_find_option_bool("nokaslr")) { 293 - debug_putstr("KASLR disabled...\n"); 292 + #ifdef CONFIG_HIBERNATION 293 + if (!cmdline_find_option_bool("kaslr")) { 294 + debug_putstr("KASLR disabled by default...\n"); 294 295 goto out; 295 296 } 297 + #else 298 + if (cmdline_find_option_bool("nokaslr")) { 299 + debug_putstr("KASLR disabled by cmdline...\n"); 300 + goto out; 301 + } 302 + #endif 296 303 297 304 /* Record the various known unsafe memory ranges. */ 298 305 mem_avoid_init((unsigned long)input, input_size,
+4 -3
arch/x86/kernel/traps.c
··· 343 343 if (poke_int3_handler(regs)) 344 344 return; 345 345 346 + prev_state = exception_enter(); 346 347 #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP 347 348 if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, X86_TRAP_BP, 348 349 SIGTRAP) == NOTIFY_STOP) ··· 352 351 353 352 #ifdef CONFIG_KPROBES 354 353 if (kprobe_int3_handler(regs)) 355 - return; 354 + goto exit; 356 355 #endif 357 - prev_state = exception_enter(); 358 356 359 357 if (notify_die(DIE_INT3, "int3", regs, error_code, X86_TRAP_BP, 360 358 SIGTRAP) == NOTIFY_STOP) ··· 433 433 unsigned long dr6; 434 434 int si_code; 435 435 436 + prev_state = exception_enter(); 437 + 436 438 get_debugreg(dr6, 6); 437 439 438 440 /* Filter out all the reserved bits which are preset to 1 */ ··· 467 465 if (kprobe_debug_handler(regs)) 468 466 goto exit; 469 467 #endif 470 - prev_state = exception_enter(); 471 468 472 469 if (notify_die(DIE_DEBUG, "debug", regs, (long)&dr6, error_code, 473 470 SIGTRAP) == NOTIFY_STOP)
+4 -1
arch/x86/xen/enlighten.c
··· 1537 1537 if (!xen_pvh_domain()) 1538 1538 pv_cpu_ops = xen_cpu_ops; 1539 1539 1540 - x86_init.resources.memory_setup = xen_memory_setup; 1540 + if (xen_feature(XENFEAT_auto_translated_physmap)) 1541 + x86_init.resources.memory_setup = xen_auto_xlated_memory_setup; 1542 + else 1543 + x86_init.resources.memory_setup = xen_memory_setup; 1541 1544 x86_init.oem.arch_setup = xen_arch_setup; 1542 1545 x86_init.oem.banner = xen_banner; 1543 1546
+32 -28
arch/x86/xen/setup.c
··· 27 27 #include <xen/interface/memory.h> 28 28 #include <xen/interface/physdev.h> 29 29 #include <xen/features.h> 30 - #include "mmu.h" 31 30 #include "xen-ops.h" 32 31 #include "vdso.h" 33 32 ··· 81 82 82 83 memblock_reserve(start, size); 83 84 84 - if (xen_feature(XENFEAT_auto_translated_physmap)) 85 - return; 86 - 87 85 xen_max_p2m_pfn = PFN_DOWN(start + size); 88 86 for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) { 89 87 unsigned long mfn = pfn_to_mfn(pfn); ··· 103 107 .domid = DOMID_SELF 104 108 }; 105 109 unsigned long len = 0; 106 - int xlated_phys = xen_feature(XENFEAT_auto_translated_physmap); 107 110 unsigned long pfn; 108 111 int ret; 109 112 ··· 116 121 continue; 117 122 frame = mfn; 118 123 } else { 119 - if (!xlated_phys && mfn != INVALID_P2M_ENTRY) 124 + if (mfn != INVALID_P2M_ENTRY) 120 125 continue; 121 126 frame = pfn; 122 127 } ··· 154 159 static unsigned long __init xen_release_chunk(unsigned long start, 155 160 unsigned long end) 156 161 { 157 - /* 158 - * Xen already ballooned out the E820 non RAM regions for us 159 - * and set them up properly in EPT. 160 - */ 161 - if (xen_feature(XENFEAT_auto_translated_physmap)) 162 - return end - start; 163 - 164 162 return xen_do_chunk(start, end, true); 165 163 } 166 164 ··· 222 234 * (except for the ISA region which must be 1:1 mapped) to 223 235 * release the refcounts (in Xen) on the original frames. 224 236 */ 225 - 226 - /* 227 - * PVH E820 matches the hypervisor's P2M which means we need to 228 - * account for the proper values of *release and *identity. 229 - */ 230 - for (pfn = start_pfn; !xen_feature(XENFEAT_auto_translated_physmap) && 231 - pfn <= max_pfn_mapped && pfn < end_pfn; pfn++) { 237 + for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++) { 232 238 pte_t pte = __pte_ma(0); 233 239 234 240 if (pfn < PFN_UP(ISA_END_ADDRESS)) ··· 500 518 } 501 519 502 520 /* 521 + * Machine specific memory setup for auto-translated guests. 522 + */ 523 + char * __init xen_auto_xlated_memory_setup(void) 524 + { 525 + static struct e820entry map[E820MAX] __initdata; 526 + 527 + struct xen_memory_map memmap; 528 + int i; 529 + int rc; 530 + 531 + memmap.nr_entries = E820MAX; 532 + set_xen_guest_handle(memmap.buffer, map); 533 + 534 + rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); 535 + if (rc < 0) 536 + panic("No memory map (%d)\n", rc); 537 + 538 + sanitize_e820_map(map, ARRAY_SIZE(map), &memmap.nr_entries); 539 + 540 + for (i = 0; i < memmap.nr_entries; i++) 541 + e820_add_region(map[i].addr, map[i].size, map[i].type); 542 + 543 + memblock_reserve(__pa(xen_start_info->mfn_list), 544 + xen_start_info->pt_base - xen_start_info->mfn_list); 545 + 546 + return "Xen"; 547 + } 548 + 549 + /* 503 550 * Set the bit indicating "nosegneg" library variants should be used. 504 551 * We only need to bother in pure 32-bit mode; compat 32-bit processes 505 552 * can have un-truncated segments, so wrapping around is allowed. ··· 601 590 } 602 591 #endif /* CONFIG_X86_64 */ 603 592 } 604 - void xen_enable_nmi(void) 605 - { 606 - #ifdef CONFIG_X86_64 607 - if (register_callback(CALLBACKTYPE_nmi, (char *)nmi)) 608 - BUG(); 609 - #endif 610 - } 593 + 611 594 void __init xen_pvmmu_arch_setup(void) 612 595 { 613 596 HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments); ··· 616 611 617 612 xen_enable_sysenter(); 618 613 xen_enable_syscall(); 619 - xen_enable_nmi(); 620 614 } 621 615 622 616 /* This function is not called for HVM domains */
+1
arch/x86/xen/xen-ops.h
··· 36 36 void xen_set_pat(u64); 37 37 38 38 char * __init xen_memory_setup(void); 39 + char * xen_auto_xlated_memory_setup(void); 39 40 void __init xen_arch_setup(void); 40 41 void xen_enable_sysenter(void); 41 42 void xen_enable_syscall(void);
+1 -2
block/blk-core.c
··· 3312 3312 3313 3313 /* used for unplugging and affects IO latency/throughput - HIGHPRI */ 3314 3314 kblockd_workqueue = alloc_workqueue("kblockd", 3315 - WQ_MEM_RECLAIM | WQ_HIGHPRI | 3316 - WQ_POWER_EFFICIENT, 0); 3315 + WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); 3317 3316 if (!kblockd_workqueue) 3318 3317 panic("Failed to create kblockd\n"); 3319 3318
-38
block/blk-flush.c
··· 422 422 } 423 423 424 424 /** 425 - * blk_abort_flushes - @q is being aborted, abort flush requests 426 - * @q: request_queue being aborted 427 - * 428 - * To be called from elv_abort_queue(). @q is being aborted. Prepare all 429 - * FLUSH/FUA requests for abortion. 430 - * 431 - * CONTEXT: 432 - * spin_lock_irq(q->queue_lock) 433 - */ 434 - void blk_abort_flushes(struct request_queue *q) 435 - { 436 - struct request *rq, *n; 437 - int i; 438 - 439 - /* 440 - * Requests in flight for data are already owned by the dispatch 441 - * queue or the device driver. Just restore for normal completion. 442 - */ 443 - list_for_each_entry_safe(rq, n, &q->flush_data_in_flight, flush.list) { 444 - list_del_init(&rq->flush.list); 445 - blk_flush_restore_request(rq); 446 - } 447 - 448 - /* 449 - * We need to give away requests on flush queues. Restore for 450 - * normal completion and put them on the dispatch queue. 451 - */ 452 - for (i = 0; i < ARRAY_SIZE(q->flush_queue); i++) { 453 - list_for_each_entry_safe(rq, n, &q->flush_queue[i], 454 - flush.list) { 455 - list_del_init(&rq->flush.list); 456 - blk_flush_restore_request(rq); 457 - list_add_tail(&rq->queuelist, &q->queue_head); 458 - } 459 - } 460 - } 461 - 462 - /** 463 425 * blkdev_issue_flush - queue a flush 464 426 * @bdev: blockdev to issue flush for 465 427 * @gfp_mask: memory allocation flags (for bio_alloc)
+39 -22
block/blk-mq-tag.c
··· 43 43 return bt_has_free_tags(&tags->bitmap_tags); 44 44 } 45 45 46 - static inline void bt_index_inc(unsigned int *index) 46 + static inline int bt_index_inc(int index) 47 47 { 48 - *index = (*index + 1) & (BT_WAIT_QUEUES - 1); 48 + return (index + 1) & (BT_WAIT_QUEUES - 1); 49 + } 50 + 51 + static inline void bt_index_atomic_inc(atomic_t *index) 52 + { 53 + int old = atomic_read(index); 54 + int new = bt_index_inc(old); 55 + atomic_cmpxchg(index, old, new); 49 56 } 50 57 51 58 /* ··· 76 69 int i, wake_index; 77 70 78 71 bt = &tags->bitmap_tags; 79 - wake_index = bt->wake_index; 72 + wake_index = atomic_read(&bt->wake_index); 80 73 for (i = 0; i < BT_WAIT_QUEUES; i++) { 81 74 struct bt_wait_state *bs = &bt->bs[wake_index]; 82 75 83 76 if (waitqueue_active(&bs->wait)) 84 77 wake_up(&bs->wait); 85 78 86 - bt_index_inc(&wake_index); 79 + wake_index = bt_index_inc(wake_index); 87 80 } 88 81 } 89 82 ··· 219 212 struct blk_mq_hw_ctx *hctx) 220 213 { 221 214 struct bt_wait_state *bs; 215 + int wait_index; 222 216 223 217 if (!hctx) 224 218 return &bt->bs[0]; 225 219 226 - bs = &bt->bs[hctx->wait_index]; 227 - bt_index_inc(&hctx->wait_index); 220 + wait_index = atomic_read(&hctx->wait_index); 221 + bs = &bt->bs[wait_index]; 222 + bt_index_atomic_inc(&hctx->wait_index); 228 223 return bs; 229 224 } 230 225 ··· 248 239 249 240 bs = bt_wait_ptr(bt, hctx); 250 241 do { 251 - bool was_empty; 252 - 253 - was_empty = list_empty(&wait.task_list); 254 242 prepare_to_wait(&bs->wait, &wait, TASK_UNINTERRUPTIBLE); 255 243 256 244 tag = __bt_get(hctx, bt, last_tag); 257 245 if (tag != -1) 258 246 break; 259 - 260 - if (was_empty) 261 - atomic_set(&bs->wait_cnt, bt->wake_cnt); 262 247 263 248 blk_mq_put_ctx(data->ctx); 264 249 ··· 316 313 { 317 314 int i, wake_index; 318 315 319 - wake_index = bt->wake_index; 316 + wake_index = atomic_read(&bt->wake_index); 320 317 for (i = 0; i < BT_WAIT_QUEUES; i++) { 321 318 struct bt_wait_state *bs = &bt->bs[wake_index]; 322 319 323 320 if (waitqueue_active(&bs->wait)) { 324 - if (wake_index != bt->wake_index) 325 - bt->wake_index = wake_index; 321 + int o = atomic_read(&bt->wake_index); 322 + if (wake_index != o) 323 + atomic_cmpxchg(&bt->wake_index, o, wake_index); 326 324 327 325 return bs; 328 326 } 329 327 330 - bt_index_inc(&wake_index); 328 + wake_index = bt_index_inc(wake_index); 331 329 } 332 330 333 331 return NULL; ··· 338 334 { 339 335 const int index = TAG_TO_INDEX(bt, tag); 340 336 struct bt_wait_state *bs; 337 + int wait_cnt; 341 338 342 339 /* 343 340 * The unlock memory barrier need to order access to req in free ··· 347 342 clear_bit_unlock(TAG_TO_BIT(bt, tag), &bt->map[index].word); 348 343 349 344 bs = bt_wake_ptr(bt); 350 - if (bs && atomic_dec_and_test(&bs->wait_cnt)) { 351 - atomic_set(&bs->wait_cnt, bt->wake_cnt); 352 - bt_index_inc(&bt->wake_index); 345 + if (!bs) 346 + return; 347 + 348 + wait_cnt = atomic_dec_return(&bs->wait_cnt); 349 + if (wait_cnt == 0) { 350 + wake: 351 + atomic_add(bt->wake_cnt, &bs->wait_cnt); 352 + bt_index_atomic_inc(&bt->wake_index); 353 353 wake_up(&bs->wait); 354 + } else if (wait_cnt < 0) { 355 + wait_cnt = atomic_inc_return(&bs->wait_cnt); 356 + if (!wait_cnt) 357 + goto wake; 354 358 } 355 359 } 356 360 ··· 513 499 return -ENOMEM; 514 500 } 515 501 516 - for (i = 0; i < BT_WAIT_QUEUES; i++) 517 - init_waitqueue_head(&bt->bs[i].wait); 518 - 519 502 bt_update_count(bt, depth); 503 + 504 + for (i = 0; i < BT_WAIT_QUEUES; i++) { 505 + init_waitqueue_head(&bt->bs[i].wait); 506 + atomic_set(&bt->bs[i].wait_cnt, bt->wake_cnt); 507 + } 508 + 520 509 return 0; 521 510 } 522 511
+1 -1
block/blk-mq-tag.h
··· 24 24 unsigned int map_nr; 25 25 struct blk_align_bitmap *map; 26 26 27 - unsigned int wake_index; 27 + atomic_t wake_index; 28 28 struct bt_wait_state *bs; 29 29 }; 30 30
+3 -8
block/blk-mq.c
··· 109 109 __percpu_counter_add(&q->mq_usage_counter, -1, 1000000); 110 110 } 111 111 112 - static void __blk_mq_drain_queue(struct request_queue *q) 112 + void blk_mq_drain_queue(struct request_queue *q) 113 113 { 114 114 while (true) { 115 115 s64 count; ··· 120 120 121 121 if (count == 0) 122 122 break; 123 - blk_mq_run_queues(q, false); 123 + blk_mq_start_hw_queues(q); 124 124 msleep(10); 125 125 } 126 126 } ··· 139 139 spin_unlock_irq(q->queue_lock); 140 140 141 141 if (drain) 142 - __blk_mq_drain_queue(q); 143 - } 144 - 145 - void blk_mq_drain_queue(struct request_queue *q) 146 - { 147 - __blk_mq_drain_queue(q); 142 + blk_mq_drain_queue(q); 148 143 } 149 144 150 145 static void blk_mq_unfreeze_queue(struct request_queue *q)
-1
block/blk.h
··· 84 84 #define ELV_ON_HASH(rq) ((rq)->cmd_flags & REQ_HASHED) 85 85 86 86 void blk_insert_flush(struct request *rq); 87 - void blk_abort_flushes(struct request_queue *q); 88 87 89 88 static inline struct request *__elv_next_request(struct request_queue *q) 90 89 {
-20
block/elevator.c
··· 729 729 return ELV_MQUEUE_MAY; 730 730 } 731 731 732 - void elv_abort_queue(struct request_queue *q) 733 - { 734 - struct request *rq; 735 - 736 - blk_abort_flushes(q); 737 - 738 - while (!list_empty(&q->queue_head)) { 739 - rq = list_entry_rq(q->queue_head.next); 740 - rq->cmd_flags |= REQ_QUIET; 741 - trace_block_rq_abort(q, rq); 742 - /* 743 - * Mark this request as started so we don't trigger 744 - * any debug logic in the end I/O path. 745 - */ 746 - blk_start_request(rq); 747 - __blk_end_request_all(rq, -EIO); 748 - } 749 - } 750 - EXPORT_SYMBOL(elv_abort_queue); 751 - 752 732 void elv_completed_request(struct request_queue *q, struct request *rq) 753 733 { 754 734 struct elevator_queue *e = q->elevator;
+15
drivers/acpi/acpi_lpss.c
··· 34 34 35 35 /* Offsets relative to LPSS_PRIVATE_OFFSET */ 36 36 #define LPSS_CLK_DIVIDER_DEF_MASK (BIT(1) | BIT(16)) 37 + #define LPSS_RESETS 0x04 38 + #define LPSS_RESETS_RESET_FUNC BIT(0) 39 + #define LPSS_RESETS_RESET_APB BIT(1) 37 40 #define LPSS_GENERAL 0x08 38 41 #define LPSS_GENERAL_LTR_MODE_SW BIT(2) 39 42 #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) ··· 100 97 offset = pdata->dev_desc->prv_offset + LPSS_GENERAL; 101 98 reg = readl(pdata->mmio_base + offset); 102 99 writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); 100 + } 101 + 102 + static void lpss_i2c_setup(struct lpss_private_data *pdata) 103 + { 104 + unsigned int offset; 105 + u32 val; 106 + 107 + offset = pdata->dev_desc->prv_offset + LPSS_RESETS; 108 + val = readl(pdata->mmio_base + offset); 109 + val |= LPSS_RESETS_RESET_APB | LPSS_RESETS_RESET_FUNC; 110 + writel(val, pdata->mmio_base + offset); 103 111 } 104 112 105 113 static struct lpss_device_desc lpt_dev_desc = { ··· 185 171 .prv_offset = 0x800, 186 172 .save_ctx = true, 187 173 .shared_clock = &i2c_clock, 174 + .setup = lpss_i2c_setup, 188 175 }; 189 176 190 177 #else
+36 -3
drivers/acpi/battery.c
··· 32 32 #include <linux/jiffies.h> 33 33 #include <linux/async.h> 34 34 #include <linux/dmi.h> 35 + #include <linux/delay.h> 35 36 #include <linux/slab.h> 36 37 #include <linux/suspend.h> 37 38 #include <asm/unaligned.h> ··· 71 70 MODULE_LICENSE("GPL"); 72 71 73 72 static int battery_bix_broken_package; 73 + static int battery_notification_delay_ms; 74 74 static unsigned int cache_time = 1000; 75 75 module_param(cache_time, uint, 0644); 76 76 MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); ··· 932 930 goto end; 933 931 } 934 932 alarm_string[count] = '\0'; 935 - battery->alarm = simple_strtol(alarm_string, NULL, 0); 933 + if (kstrtoint(alarm_string, 0, &battery->alarm)) { 934 + result = -EINVAL; 935 + goto end; 936 + } 936 937 result = acpi_battery_set_alarm(battery); 937 938 end: 938 939 if (!result) ··· 1067 1062 if (!battery) 1068 1063 return; 1069 1064 old = battery->bat.dev; 1065 + /* 1066 + * On Acer Aspire V5-573G notifications are sometimes triggered too 1067 + * early. For example, when AC is unplugged and notification is 1068 + * triggered, battery state is still reported as "Full", and changes to 1069 + * "Discharging" only after short delay, without any notification. 1070 + */ 1071 + if (battery_notification_delay_ms > 0) 1072 + msleep(battery_notification_delay_ms); 1070 1073 if (event == ACPI_BATTERY_NOTIFY_INFO) 1071 1074 acpi_battery_refresh(battery); 1072 1075 acpi_battery_update(battery, false); ··· 1119 1106 return 0; 1120 1107 } 1121 1108 1109 + static int battery_bix_broken_package_quirk(const struct dmi_system_id *d) 1110 + { 1111 + battery_bix_broken_package = 1; 1112 + return 0; 1113 + } 1114 + 1115 + static int battery_notification_delay_quirk(const struct dmi_system_id *d) 1116 + { 1117 + battery_notification_delay_ms = 1000; 1118 + return 0; 1119 + } 1120 + 1122 1121 static struct dmi_system_id bat_dmi_table[] = { 1123 1122 { 1123 + .callback = battery_bix_broken_package_quirk, 1124 1124 .ident = "NEC LZ750/LS", 1125 1125 .matches = { 1126 1126 DMI_MATCH(DMI_SYS_VENDOR, "NEC"), 1127 1127 DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"), 1128 + }, 1129 + }, 1130 + { 1131 + .callback = battery_notification_delay_quirk, 1132 + .ident = "Acer Aspire V5-573G", 1133 + .matches = { 1134 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1135 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"), 1128 1136 }, 1129 1137 }, 1130 1138 {}, ··· 1261 1227 if (acpi_disabled) 1262 1228 return; 1263 1229 1264 - if (dmi_check_system(bat_dmi_table)) 1265 - battery_bix_broken_package = 1; 1230 + dmi_check_system(bat_dmi_table); 1266 1231 1267 1232 #ifdef CONFIG_ACPI_PROCFS_POWER 1268 1233 acpi_battery_dir = acpi_lock_battery_dir();
+2 -1
drivers/acpi/osl.c
··· 235 235 static unsigned long acpi_rsdp; 236 236 static int __init setup_acpi_rsdp(char *arg) 237 237 { 238 - acpi_rsdp = simple_strtoul(arg, NULL, 16); 238 + if (kstrtoul(arg, 16, &acpi_rsdp)) 239 + return -EINVAL; 239 240 return 0; 240 241 } 241 242 early_param("acpi_rsdp", setup_acpi_rsdp);
+2 -1
drivers/acpi/tables.c
··· 360 360 if (!str) 361 361 return -EINVAL; 362 362 363 - acpi_apic_instance = simple_strtoul(str, NULL, 0); 363 + if (kstrtoint(str, 0, &acpi_apic_instance)) 364 + return -EINVAL; 364 365 365 366 pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); 366 367
+5 -2
drivers/block/null_blk.c
··· 79 79 80 80 static int queue_mode = NULL_Q_MQ; 81 81 module_param(queue_mode, int, S_IRUGO); 82 - MODULE_PARM_DESC(use_mq, "Use blk-mq interface (0=bio,1=rq,2=multiqueue)"); 82 + MODULE_PARM_DESC(queue_mode, "Block interface to use (0=bio,1=rq,2=multiqueue)"); 83 83 84 84 static int gb = 250; 85 85 module_param(gb, int, S_IRUGO); ··· 227 227 228 228 static void null_softirq_done_fn(struct request *rq) 229 229 { 230 - end_cmd(blk_mq_rq_to_pdu(rq)); 230 + if (queue_mode == NULL_Q_MQ) 231 + end_cmd(blk_mq_rq_to_pdu(rq)); 232 + else 233 + end_cmd(rq->special); 231 234 } 232 235 233 236 static inline void null_handle_cmd(struct nullb_cmd *cmd)
+1 -1
drivers/bus/Kconfig
··· 45 45 46 46 config ARM_CCI 47 47 bool "ARM CCI driver support" 48 - depends on ARM 48 + depends on ARM && OF && CPU_V7 49 49 help 50 50 Driver supporting the CCI cache coherent interconnect for ARM 51 51 platforms.
+9 -8
drivers/char/random.c
··· 980 980 static size_t account(struct entropy_store *r, size_t nbytes, int min, 981 981 int reserved) 982 982 { 983 - int have_bytes; 984 983 int entropy_count, orig; 985 984 size_t ibytes; 986 985 ··· 988 989 /* Can we pull enough? */ 989 990 retry: 990 991 entropy_count = orig = ACCESS_ONCE(r->entropy_count); 991 - have_bytes = entropy_count >> (ENTROPY_SHIFT + 3); 992 992 ibytes = nbytes; 993 993 /* If limited, never pull more than available */ 994 - if (r->limit) 995 - ibytes = min_t(size_t, ibytes, have_bytes - reserved); 994 + if (r->limit) { 995 + int have_bytes = entropy_count >> (ENTROPY_SHIFT + 3); 996 + 997 + if ((have_bytes -= reserved) < 0) 998 + have_bytes = 0; 999 + ibytes = min_t(size_t, ibytes, have_bytes); 1000 + } 996 1001 if (ibytes < min) 997 1002 ibytes = 0; 998 - if (have_bytes >= ibytes + reserved) 999 - entropy_count -= ibytes << (ENTROPY_SHIFT + 3); 1000 - else 1001 - entropy_count = reserved << (ENTROPY_SHIFT + 3); 1003 + if ((entropy_count -= ibytes << (ENTROPY_SHIFT + 3)) < 0) 1004 + entropy_count = 0; 1002 1005 1003 1006 if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) 1004 1007 goto retry;
+2
drivers/cpufreq/Kconfig
··· 186 186 config GENERIC_CPUFREQ_CPU0 187 187 tristate "Generic CPU0 cpufreq driver" 188 188 depends on HAVE_CLK && OF 189 + # if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y: 190 + depends on !CPU_THERMAL || THERMAL 189 191 select PM_OPP 190 192 help 191 193 This adds a generic cpufreq driver for CPU0 frequency management.
+4 -6
drivers/cpufreq/cpufreq.c
··· 2242 2242 struct cpufreq_policy new_policy; 2243 2243 int ret; 2244 2244 2245 - if (!policy) { 2246 - ret = -ENODEV; 2247 - goto no_policy; 2248 - } 2245 + if (!policy) 2246 + return -ENODEV; 2249 2247 2250 2248 down_write(&policy->rwsem); 2251 2249 ··· 2262 2264 new_policy.cur = cpufreq_driver->get(cpu); 2263 2265 if (WARN_ON(!new_policy.cur)) { 2264 2266 ret = -EIO; 2265 - goto no_policy; 2267 + goto unlock; 2266 2268 } 2267 2269 2268 2270 if (!policy->cur) { ··· 2277 2279 2278 2280 ret = cpufreq_set_policy(policy, &new_policy); 2279 2281 2282 + unlock: 2280 2283 up_write(&policy->rwsem); 2281 2284 2282 2285 cpufreq_cpu_put(policy); 2283 - no_policy: 2284 2286 return ret; 2285 2287 } 2286 2288 EXPORT_SYMBOL(cpufreq_update_policy);
+1 -4
drivers/cpufreq/intel_pstate.c
··· 196 196 pid->last_err = fp_error; 197 197 198 198 result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; 199 - if (result >= 0) 200 - result = result + (1 << (FRAC_BITS-1)); 201 - else 202 - result = result - (1 << (FRAC_BITS-1)); 199 + result = result + (1 << (FRAC_BITS-1)); 203 200 return (signed int)fp_toint(result); 204 201 } 205 202
+2 -2
drivers/cpuidle/cpuidle-armada-370-xp.c
··· 55 55 .power_usage = 50, 56 56 .target_residency = 100, 57 57 .flags = CPUIDLE_FLAG_TIME_VALID, 58 - .name = "MV CPU IDLE", 58 + .name = "Idle", 59 59 .desc = "CPU power down", 60 60 }, 61 61 .states[2] = { ··· 65 65 .target_residency = 1000, 66 66 .flags = CPUIDLE_FLAG_TIME_VALID | 67 67 ARMADA_370_XP_FLAG_DEEP_IDLE, 68 - .name = "MV CPU DEEP IDLE", 68 + .name = "Deep idle", 69 69 .desc = "CPU and L2 Fabric power down", 70 70 }, 71 71 .state_count = ARMADA_370_XP_MAX_STATES,
+1
drivers/gpu/drm/drm_modeset_lock.c
··· 64 64 void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *ctx, 65 65 uint32_t flags) 66 66 { 67 + memset(ctx, 0, sizeof(*ctx)); 67 68 ww_acquire_init(&ctx->ww_ctx, &crtc_ww_class); 68 69 INIT_LIST_HEAD(&ctx->locked); 69 70 }
+42 -5
drivers/gpu/drm/i915/i915_dma.c
··· 36 36 #include "i915_drv.h" 37 37 #include "i915_trace.h" 38 38 #include <linux/pci.h> 39 + #include <linux/console.h> 40 + #include <linux/vt.h> 39 41 #include <linux/vgaarb.h> 40 42 #include <linux/acpi.h> 41 43 #include <linux/pnp.h> ··· 1388 1386 i915_gem_context_fini(dev); 1389 1387 mutex_unlock(&dev->struct_mutex); 1390 1388 WARN_ON(dev_priv->mm.aliasing_ppgtt); 1391 - drm_mm_takedown(&dev_priv->gtt.base.mm); 1392 1389 cleanup_irq: 1393 1390 drm_irq_uninstall(dev); 1394 1391 cleanup_gem_stolen: ··· 1448 1447 #else 1449 1448 static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) 1450 1449 { 1450 + } 1451 + #endif 1452 + 1453 + #if !defined(CONFIG_VGA_CONSOLE) 1454 + static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) 1455 + { 1456 + return 0; 1457 + } 1458 + #elif !defined(CONFIG_DUMMY_CONSOLE) 1459 + static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) 1460 + { 1461 + return -ENODEV; 1462 + } 1463 + #else 1464 + static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) 1465 + { 1466 + int ret; 1467 + 1468 + DRM_INFO("Replacing VGA console driver\n"); 1469 + 1470 + console_lock(); 1471 + ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1); 1472 + if (ret == 0) { 1473 + ret = do_unregister_con_driver(&vga_con); 1474 + 1475 + /* Ignore "already unregistered". */ 1476 + if (ret == -ENODEV) 1477 + ret = 0; 1478 + } 1479 + console_unlock(); 1480 + 1481 + return ret; 1451 1482 } 1452 1483 #endif 1453 1484 ··· 1656 1623 if (ret) 1657 1624 goto out_regs; 1658 1625 1659 - if (drm_core_check_feature(dev, DRIVER_MODESET)) 1626 + if (drm_core_check_feature(dev, DRIVER_MODESET)) { 1627 + ret = i915_kick_out_vgacon(dev_priv); 1628 + if (ret) { 1629 + DRM_ERROR("failed to remove conflicting VGA console\n"); 1630 + goto out_gtt; 1631 + } 1632 + 1660 1633 i915_kick_out_firmware_fb(dev_priv); 1634 + } 1661 1635 1662 1636 pci_set_master(dev->pdev); 1663 1637 ··· 1796 1756 arch_phys_wc_del(dev_priv->gtt.mtrr); 1797 1757 io_mapping_free(dev_priv->gtt.mappable); 1798 1758 out_gtt: 1799 - list_del(&dev_priv->gtt.base.global_link); 1800 - drm_mm_takedown(&dev_priv->gtt.base.mm); 1801 1759 dev_priv->gtt.base.cleanup(&dev_priv->gtt.base); 1802 1760 out_regs: 1803 1761 intel_uncore_fini(dev); ··· 1884 1846 i915_free_hws(dev); 1885 1847 } 1886 1848 1887 - list_del(&dev_priv->gtt.base.global_link); 1888 1849 WARN_ON(!list_empty(&dev_priv->vm_list)); 1889 1850 1890 1851 drm_vblank_cleanup(dev);
+8 -1
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 1992 1992 1993 1993 struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base); 1994 1994 1995 - drm_mm_takedown(&vm->mm); 1995 + if (drm_mm_initialized(&vm->mm)) { 1996 + drm_mm_takedown(&vm->mm); 1997 + list_del(&vm->global_link); 1998 + } 1996 1999 iounmap(gtt->gsm); 1997 2000 teardown_scratch_page(vm->dev); 1998 2001 } ··· 2028 2025 2029 2026 static void i915_gmch_remove(struct i915_address_space *vm) 2030 2027 { 2028 + if (drm_mm_initialized(&vm->mm)) { 2029 + drm_mm_takedown(&vm->mm); 2030 + list_del(&vm->global_link); 2031 + } 2031 2032 intel_gmch_remove(); 2032 2033 } 2033 2034
+2 -1
drivers/gpu/drm/i915/i915_gpu_error.c
··· 888 888 for (i = 0; i < I915_NUM_RINGS; i++) { 889 889 struct intel_engine_cs *ring = &dev_priv->ring[i]; 890 890 891 + error->ring[i].pid = -1; 892 + 891 893 if (ring->dev == NULL) 892 894 continue; 893 895 ··· 897 895 898 896 i915_record_ring_state(dev, ring, &error->ring[i]); 899 897 900 - error->ring[i].pid = -1; 901 898 request = i915_gem_find_active_request(ring); 902 899 if (request) { 903 900 /* We need to copy these to an anonymous buffer
+14 -4
drivers/gpu/drm/i915/i915_irq.c
··· 2847 2847 struct intel_engine_cs *signaller; 2848 2848 u32 seqno, ctl; 2849 2849 2850 - ring->hangcheck.deadlock = true; 2850 + ring->hangcheck.deadlock++; 2851 2851 2852 2852 signaller = semaphore_waits_for(ring, &seqno); 2853 - if (signaller == NULL || signaller->hangcheck.deadlock) 2853 + if (signaller == NULL) 2854 + return -1; 2855 + 2856 + /* Prevent pathological recursion due to driver bugs */ 2857 + if (signaller->hangcheck.deadlock >= I915_NUM_RINGS) 2854 2858 return -1; 2855 2859 2856 2860 /* cursory check for an unkickable deadlock */ ··· 2862 2858 if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0) 2863 2859 return -1; 2864 2860 2865 - return i915_seqno_passed(signaller->get_seqno(signaller, false), seqno); 2861 + if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno)) 2862 + return 1; 2863 + 2864 + if (signaller->hangcheck.deadlock) 2865 + return -1; 2866 + 2867 + return 0; 2866 2868 } 2867 2869 2868 2870 static void semaphore_clear_deadlocks(struct drm_i915_private *dev_priv) ··· 2877 2867 int i; 2878 2868 2879 2869 for_each_ring(ring, dev_priv, i) 2880 - ring->hangcheck.deadlock = false; 2870 + ring->hangcheck.deadlock = 0; 2881 2871 } 2882 2872 2883 2873 static enum intel_ring_hangcheck_action
+2 -3
drivers/gpu/drm/i915/intel_panel.c
··· 798 798 ctl = freq << 16; 799 799 I915_WRITE(BLC_PWM_CTL, ctl); 800 800 801 - /* XXX: combine this into above write? */ 802 - intel_panel_actually_set_backlight(connector, panel->backlight.level); 803 - 804 801 ctl2 = BLM_PIPE(pipe); 805 802 if (panel->backlight.combination_mode) 806 803 ctl2 |= BLM_COMBINATION_MODE; ··· 806 809 I915_WRITE(BLC_PWM_CTL2, ctl2); 807 810 POSTING_READ(BLC_PWM_CTL2); 808 811 I915_WRITE(BLC_PWM_CTL2, ctl2 | BLM_PWM_ENABLE); 812 + 813 + intel_panel_actually_set_backlight(connector, panel->backlight.level); 809 814 } 810 815 811 816 static void vlv_enable_backlight(struct intel_connector *connector)
+10 -13
drivers/gpu/drm/i915/intel_pm.c
··· 511 511 obj = intel_fb->obj; 512 512 adjusted_mode = &intel_crtc->config.adjusted_mode; 513 513 514 - if (i915.enable_fbc < 0 && 515 - INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) { 514 + if (i915.enable_fbc < 0) { 516 515 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT)) 517 516 DRM_DEBUG_KMS("disabled per chip default\n"); 518 517 goto out_disable; ··· 3505 3506 3506 3507 I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); 3507 3508 3508 - /* WaDisablePwrmtrEvent:chv (pre-production hw) */ 3509 - I915_WRITE(0xA80C, I915_READ(0xA80C) & 0x00ffffff); 3510 - I915_WRITE(0xA810, I915_READ(0xA810) & 0xffffff00); 3511 - 3512 3509 /* 5: Enable RPS */ 3513 3510 I915_WRITE(GEN6_RP_CONTROL, 3514 3511 GEN6_RP_MEDIA_TURBO | 3515 3512 GEN6_RP_MEDIA_HW_NORMAL_MODE | 3516 - GEN6_RP_MEDIA_IS_GFX | /* WaSetMaskForGfxBusyness:chv (pre-production hw ?) */ 3513 + GEN6_RP_MEDIA_IS_GFX | 3517 3514 GEN6_RP_ENABLE | 3518 3515 GEN6_RP_UP_BUSY_AVG | 3519 3516 GEN6_RP_DOWN_IDLE_AVG); ··· 6019 6024 static struct i915_power_domains *hsw_pwr; 6020 6025 6021 6026 /* Display audio driver power well request */ 6022 - void i915_request_power_well(void) 6027 + int i915_request_power_well(void) 6023 6028 { 6024 6029 struct drm_i915_private *dev_priv; 6025 6030 6026 - if (WARN_ON(!hsw_pwr)) 6027 - return; 6031 + if (!hsw_pwr) 6032 + return -ENODEV; 6028 6033 6029 6034 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6030 6035 power_domains); 6031 6036 intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); 6037 + return 0; 6032 6038 } 6033 6039 EXPORT_SYMBOL_GPL(i915_request_power_well); 6034 6040 6035 6041 /* Display audio driver power well release */ 6036 - void i915_release_power_well(void) 6042 + int i915_release_power_well(void) 6037 6043 { 6038 6044 struct drm_i915_private *dev_priv; 6039 6045 6040 - if (WARN_ON(!hsw_pwr)) 6041 - return; 6046 + if (!hsw_pwr) 6047 + return -ENODEV; 6042 6048 6043 6049 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6044 6050 power_domains); 6045 6051 intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); 6052 + return 0; 6046 6053 } 6047 6054 EXPORT_SYMBOL_GPL(i915_release_power_well); 6048 6055
+1 -1
drivers/gpu/drm/i915/intel_ringbuffer.h
··· 55 55 u32 seqno; 56 56 int score; 57 57 enum intel_ring_hangcheck_action action; 58 - bool deadlock; 58 + int deadlock; 59 59 }; 60 60 61 61 struct intel_ringbuffer {
+3 -1
drivers/gpu/drm/i915/intel_sdvo.c
··· 1385 1385 >> SDVO_PORT_MULTIPLY_SHIFT) + 1; 1386 1386 } 1387 1387 1388 - dotclock = pipe_config->port_clock / pipe_config->pixel_multiplier; 1388 + dotclock = pipe_config->port_clock; 1389 + if (pipe_config->pixel_multiplier) 1390 + dotclock /= pipe_config->pixel_multiplier; 1389 1391 1390 1392 if (HAS_PCH_SPLIT(dev)) 1391 1393 ironlake_check_encoder_dotclock(pipe_config, dotclock);
+2 -1
drivers/gpu/drm/i915/intel_uncore.c
··· 320 320 struct drm_i915_private *dev_priv = dev->dev_private; 321 321 unsigned long irqflags; 322 322 323 - del_timer_sync(&dev_priv->uncore.force_wake_timer); 323 + if (del_timer_sync(&dev_priv->uncore.force_wake_timer)) 324 + gen6_force_wake_timer((unsigned long)dev_priv); 324 325 325 326 /* Hold uncore.lock across reset to prevent any register access 326 327 * with forcewake not set correctly
+1
drivers/gpu/drm/nouveau/Makefile
··· 140 140 nouveau-y += core/subdev/i2c/nv50.o 141 141 nouveau-y += core/subdev/i2c/nv94.o 142 142 nouveau-y += core/subdev/i2c/nvd0.o 143 + nouveau-y += core/subdev/i2c/gf117.o 143 144 nouveau-y += core/subdev/i2c/nve0.o 144 145 nouveau-y += core/subdev/ibus/nvc0.o 145 146 nouveau-y += core/subdev/ibus/nve0.o
+1 -1
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
··· 314 314 device->cname = "GF117"; 315 315 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; 316 316 device->oclass[NVDEV_SUBDEV_GPIO ] = nvd0_gpio_oclass; 317 - device->oclass[NVDEV_SUBDEV_I2C ] = nvd0_i2c_oclass; 317 + device->oclass[NVDEV_SUBDEV_I2C ] = gf117_i2c_oclass; 318 318 device->oclass[NVDEV_SUBDEV_CLOCK ] = &nvc0_clock_oclass; 319 319 device->oclass[NVDEV_SUBDEV_THERM ] = &nvd0_therm_oclass; 320 320 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
+4 -2
drivers/gpu/drm/nouveau/core/engine/disp/base.c
··· 99 99 100 100 nouveau_event_destroy(&disp->vblank); 101 101 102 - list_for_each_entry_safe(outp, outt, &disp->outp, head) { 103 - nouveau_object_ref(NULL, (struct nouveau_object **)&outp); 102 + if (disp->outp.next) { 103 + list_for_each_entry_safe(outp, outt, &disp->outp, head) { 104 + nouveau_object_ref(NULL, (struct nouveau_object **)&outp); 105 + } 104 106 } 105 107 106 108 nouveau_engine_destroy(&disp->base);
+3 -4
drivers/gpu/drm/nouveau/core/engine/disp/dport.c
··· 241 241 dp_set_training_pattern(dp, 2); 242 242 243 243 do { 244 - if (dp_link_train_update(dp, dp->pc2, 400)) 244 + if ((tries && 245 + dp_link_train_commit(dp, dp->pc2)) || 246 + dp_link_train_update(dp, dp->pc2, 400)) 245 247 break; 246 248 247 249 eq_done = !!(dp->stat[2] & DPCD_LS04_INTERLANE_ALIGN_DONE); ··· 255 253 !(lane & DPCD_LS02_LANE0_SYMBOL_LOCKED)) 256 254 eq_done = false; 257 255 } 258 - 259 - if (dp_link_train_commit(dp, dp->pc2)) 260 - break; 261 256 } while (!eq_done && cr_done && ++tries <= 5); 262 257 263 258 return eq_done ? 0 : -1;
+1 -1
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
··· 1270 1270 i--; 1271 1271 1272 1272 outp = exec_lookup(priv, head, i, ctrl, &data, &ver, &hdr, &cnt, &len, &info1); 1273 - if (!data) 1273 + if (!outp) 1274 1274 return NULL; 1275 1275 1276 1276 if (outp->info.location == 0) {
+1 -1
drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
··· 54 54 #ifdef INCLUDE_CODE 55 55 // reports an exception to the host 56 56 // 57 - // In: $r15 error code (see nvc0.fuc) 57 + // In: $r15 error code (see os.h) 58 58 // 59 59 error: 60 60 push $r14
+15 -3
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc
··· 49 49 #ifdef INCLUDE_CODE 50 50 // reports an exception to the host 51 51 // 52 - // In: $r15 error code (see nvc0.fuc) 52 + // In: $r15 error code (see os.h) 53 53 // 54 54 error: 55 55 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(5), 0, $r15) ··· 343 343 ih_no_ctxsw: 344 344 and $r11 $r10 NV_PGRAPH_FECS_INTR_FWMTHD 345 345 bra e #ih_no_fwmthd 346 - // none we handle, ack, and fall-through to unhandled 346 + // none we handle; report to host and ack 347 + nv_rd32($r15, NV_PGRAPH_TRAPPED_DATA_LO) 348 + nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(4), 0, $r15) 349 + nv_rd32($r15, NV_PGRAPH_TRAPPED_ADDR) 350 + nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(3), 0, $r15) 351 + extr $r14 $r15 16:18 352 + shl b32 $r14 $r14 2 353 + imm32($r15, NV_PGRAPH_FE_OBJECT_TABLE(0)) 354 + add b32 $r14 $r15 355 + call(nv_rd32) 356 + nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(2), 0, $r15) 357 + mov $r15 E_BAD_FWMTHD 358 + call(error) 347 359 mov $r11 0x100 348 360 nv_wr32(0x400144, $r11) 349 361 350 362 // anything we didn't handle, bring it to the host's attention 351 363 ih_no_fwmthd: 352 - mov $r11 0x104 // FIFO | CHSW 364 + mov $r11 0x504 // FIFO | CHSW | FWMTHD 353 365 not b32 $r11 354 366 and $r11 $r10 $r11 355 367 bra e #ih_no_other
+233 -233
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h
··· 478 478 0x01040080, 479 479 0xbd0001f6, 480 480 0x01004104, 481 - 0x627e020f, 482 - 0x717e0006, 481 + 0xa87e020f, 482 + 0xb77e0006, 483 483 0x100f0006, 484 - 0x0006b37e, 484 + 0x0006f97e, 485 485 0x98000e98, 486 486 0x207e010f, 487 487 0x14950001, ··· 523 523 0x800040b7, 524 524 0xf40132b6, 525 525 0x000fb41b, 526 - 0x0006b37e, 527 - 0x627e000f, 526 + 0x0006f97e, 527 + 0xa87e000f, 528 528 0x00800006, 529 529 0x01f60201, 530 530 0xbd04bd00, ··· 554 554 0x0009f602, 555 555 0x32f404bd, 556 556 0x0231f401, 557 - 0x0008367e, 557 + 0x00087c7e, 558 558 0x99f094bd, 559 559 0x17008007, 560 560 0x0009f602, ··· 563 563 0x37008006, 564 564 0x0009f602, 565 565 0x31f404bd, 566 - 0x08367e01, 566 + 0x087c7e01, 567 567 0xf094bd00, 568 568 0x00800699, 569 569 0x09f60217, ··· 572 572 0x20f92f0e, 573 573 0x32f412b2, 574 574 0x0232f401, 575 - 0x0008367e, 575 + 0x00087c7e, 576 576 0x008020fc, 577 577 0x02f602c0, 578 578 0xf404bd00, ··· 580 580 0x23c8130e, 581 581 0x0d0bf41f, 582 582 0xf40131f4, 583 - 0x367e0232, 583 + 0x7c7e0232, 584 584 /* 0x054e: chsw_done */ 585 585 0x01020008, 586 586 0x02c30080, ··· 593 593 0xb0ff2a0e, 594 594 0x1bf401e4, 595 595 0x7ef2b20c, 596 - 0xf40007d6, 596 + 0xf400081c, 597 597 /* 0x057a: main_not_ctx_chan */ 598 598 0xe4b0400e, 599 599 0x2c1bf402, ··· 602 602 0x0009f602, 603 603 0x32f404bd, 604 604 0x0232f401, 605 - 0x0008367e, 605 + 0x00087c7e, 606 606 0x99f094bd, 607 607 0x17008007, 608 608 0x0009f602, ··· 642 642 /* 0x061a: ih_no_ctxsw */ 643 643 0xabe40000, 644 644 0x0bf40400, 645 - 0x01004b10, 646 - 0x448ebfb2, 647 - 0x8f7e4001, 648 - /* 0x062e: ih_no_fwmthd */ 649 - 0x044b0000, 650 - 0xffb0bd01, 651 - 0x0bf4b4ab, 652 - 0x0700800c, 653 - 0x000bf603, 654 - /* 0x0642: ih_no_other */ 655 - 0x004004bd, 656 - 0x000af601, 657 - 0xf0fc04bd, 658 - 0xd0fce0fc, 659 - 0xa0fcb0fc, 660 - 0x80fc90fc, 661 - 0xfc0088fe, 662 - 0x0032f480, 663 - /* 0x0662: ctx_4170s */ 664 - 0xf5f001f8, 665 - 0x8effb210, 666 - 0x7e404170, 667 - 0xf800008f, 668 - /* 0x0671: ctx_4170w */ 669 - 0x41708e00, 645 + 0x07088e56, 670 646 0x00657e40, 671 - 0xf0ffb200, 672 - 0x1bf410f4, 673 - /* 0x0683: ctx_redswitch */ 674 - 0x4e00f8f3, 675 - 0xe5f00200, 676 - 0x20e5f040, 677 - 0x8010e5f0, 678 - 0xf6018500, 679 - 0x04bd000e, 680 - /* 0x069a: ctx_redswitch_delay */ 681 - 0xf2b6080f, 682 - 0xfd1bf401, 683 - 0x0400e5f1, 684 - 0x0100e5f1, 685 - 0x01850080, 686 - 0xbd000ef6, 687 - /* 0x06b3: ctx_86c */ 688 - 0x8000f804, 689 - 0xf6022300, 647 + 0x80ffb200, 648 + 0xf6020400, 690 649 0x04bd000f, 691 - 0x148effb2, 692 - 0x8f7e408a, 693 - 0xffb20000, 694 - 0x41a88c8e, 695 - 0x00008f7e, 696 - /* 0x06d2: ctx_mem */ 697 - 0x008000f8, 698 - 0x0ff60284, 699 - /* 0x06db: ctx_mem_wait */ 700 - 0x8f04bd00, 701 - 0xcf028400, 702 - 0xfffd00ff, 703 - 0xf61bf405, 704 - /* 0x06ea: ctx_load */ 705 - 0x94bd00f8, 706 - 0x800599f0, 707 - 0xf6023700, 708 - 0x04bd0009, 709 - 0xb87e0c0a, 710 - 0xf4bd0000, 711 - 0x02890080, 650 + 0x4007048e, 651 + 0x0000657e, 652 + 0x0080ffb2, 653 + 0x0ff60203, 654 + 0xc704bd00, 655 + 0xee9450fe, 656 + 0x07008f02, 657 + 0x00efbb40, 658 + 0x0000657e, 659 + 0x02020080, 712 660 0xbd000ff6, 713 - 0xc1008004, 714 - 0x0002f602, 715 - 0x008004bd, 716 - 0x02f60283, 717 - 0x0f04bd00, 718 - 0x06d27e07, 719 - 0xc0008000, 720 - 0x0002f602, 721 - 0x0bfe04bd, 722 - 0x1f2af000, 723 - 0xb60424b6, 724 - 0x94bd0220, 725 - 0x800899f0, 726 - 0xf6023700, 727 - 0x04bd0009, 728 - 0x02810080, 729 - 0xbd0002f6, 730 - 0x0000d204, 731 - 0x25f08000, 732 - 0x88008002, 733 - 0x0002f602, 734 - 0x100104bd, 735 - 0xf0020042, 736 - 0x12fa0223, 737 - 0xbd03f805, 738 - 0x0899f094, 739 - 0x02170080, 740 - 0xbd0009f6, 741 - 0x81019804, 742 - 0x981814b6, 743 - 0x25b68002, 744 - 0x0512fd08, 745 - 0xbd1601b5, 746 - 0x0999f094, 747 - 0x02370080, 748 - 0xbd0009f6, 749 - 0x81008004, 750 - 0x0001f602, 751 - 0x010204bd, 752 - 0x02880080, 753 - 0xbd0002f6, 754 - 0x01004104, 755 - 0xfa0613f0, 756 - 0x03f80501, 661 + 0x7e030f04, 662 + 0x4b0002f8, 663 + 0xbfb20100, 664 + 0x4001448e, 665 + 0x00008f7e, 666 + /* 0x0674: ih_no_fwmthd */ 667 + 0xbd05044b, 668 + 0xb4abffb0, 669 + 0x800c0bf4, 670 + 0xf6030700, 671 + 0x04bd000b, 672 + /* 0x0688: ih_no_other */ 673 + 0xf6010040, 674 + 0x04bd000a, 675 + 0xe0fcf0fc, 676 + 0xb0fcd0fc, 677 + 0x90fca0fc, 678 + 0x88fe80fc, 679 + 0xf480fc00, 680 + 0x01f80032, 681 + /* 0x06a8: ctx_4170s */ 682 + 0xb210f5f0, 683 + 0x41708eff, 684 + 0x008f7e40, 685 + /* 0x06b7: ctx_4170w */ 686 + 0x8e00f800, 687 + 0x7e404170, 688 + 0xb2000065, 689 + 0x10f4f0ff, 690 + 0xf8f31bf4, 691 + /* 0x06c9: ctx_redswitch */ 692 + 0x02004e00, 693 + 0xf040e5f0, 694 + 0xe5f020e5, 695 + 0x85008010, 696 + 0x000ef601, 697 + 0x080f04bd, 698 + /* 0x06e0: ctx_redswitch_delay */ 699 + 0xf401f2b6, 700 + 0xe5f1fd1b, 701 + 0xe5f10400, 702 + 0x00800100, 703 + 0x0ef60185, 704 + 0xf804bd00, 705 + /* 0x06f9: ctx_86c */ 706 + 0x23008000, 707 + 0x000ff602, 708 + 0xffb204bd, 709 + 0x408a148e, 710 + 0x00008f7e, 711 + 0x8c8effb2, 712 + 0x8f7e41a8, 713 + 0x00f80000, 714 + /* 0x0718: ctx_mem */ 715 + 0x02840080, 716 + 0xbd000ff6, 717 + /* 0x0721: ctx_mem_wait */ 718 + 0x84008f04, 719 + 0x00ffcf02, 720 + 0xf405fffd, 721 + 0x00f8f61b, 722 + /* 0x0730: ctx_load */ 757 723 0x99f094bd, 758 - 0x17008009, 724 + 0x37008005, 759 725 0x0009f602, 760 - 0x94bd04bd, 761 - 0x800599f0, 726 + 0x0c0a04bd, 727 + 0x0000b87e, 728 + 0x0080f4bd, 729 + 0x0ff60289, 730 + 0x8004bd00, 731 + 0xf602c100, 732 + 0x04bd0002, 733 + 0x02830080, 734 + 0xbd0002f6, 735 + 0x7e070f04, 736 + 0x80000718, 737 + 0xf602c000, 738 + 0x04bd0002, 739 + 0xf0000bfe, 740 + 0x24b61f2a, 741 + 0x0220b604, 742 + 0x99f094bd, 743 + 0x37008008, 744 + 0x0009f602, 745 + 0x008004bd, 746 + 0x02f60281, 747 + 0xd204bd00, 748 + 0x80000000, 749 + 0x800225f0, 750 + 0xf6028800, 751 + 0x04bd0002, 752 + 0x00421001, 753 + 0x0223f002, 754 + 0xf80512fa, 755 + 0xf094bd03, 756 + 0x00800899, 757 + 0x09f60217, 758 + 0x9804bd00, 759 + 0x14b68101, 760 + 0x80029818, 761 + 0xfd0825b6, 762 + 0x01b50512, 763 + 0xf094bd16, 764 + 0x00800999, 765 + 0x09f60237, 766 + 0x8004bd00, 767 + 0xf6028100, 768 + 0x04bd0001, 769 + 0x00800102, 770 + 0x02f60288, 771 + 0x4104bd00, 772 + 0x13f00100, 773 + 0x0501fa06, 774 + 0x94bd03f8, 775 + 0x800999f0, 762 776 0xf6021700, 763 777 0x04bd0009, 764 - /* 0x07d6: ctx_chan */ 765 - 0xea7e00f8, 766 - 0x0c0a0006, 767 - 0x0000b87e, 768 - 0xd27e050f, 769 - 0x00f80006, 770 - /* 0x07e8: ctx_mmio_exec */ 771 - 0x80410398, 778 + 0x99f094bd, 779 + 0x17008005, 780 + 0x0009f602, 781 + 0x00f804bd, 782 + /* 0x081c: ctx_chan */ 783 + 0x0007307e, 784 + 0xb87e0c0a, 785 + 0x050f0000, 786 + 0x0007187e, 787 + /* 0x082e: ctx_mmio_exec */ 788 + 0x039800f8, 789 + 0x81008041, 790 + 0x0003f602, 791 + 0x34bd04bd, 792 + /* 0x083c: ctx_mmio_loop */ 793 + 0xf4ff34c4, 794 + 0x00450e1b, 795 + 0x0653f002, 796 + 0xf80535fa, 797 + /* 0x084d: ctx_mmio_pull */ 798 + 0x804e9803, 799 + 0x7e814f98, 800 + 0xb600008f, 801 + 0x12b60830, 802 + 0xdf1bf401, 803 + /* 0x0860: ctx_mmio_done */ 804 + 0x80160398, 772 805 0xf6028100, 773 806 0x04bd0003, 774 - /* 0x07f6: ctx_mmio_loop */ 775 - 0x34c434bd, 776 - 0x0e1bf4ff, 777 - 0xf0020045, 778 - 0x35fa0653, 779 - /* 0x0807: ctx_mmio_pull */ 780 - 0x9803f805, 781 - 0x4f98804e, 782 - 0x008f7e81, 783 - 0x0830b600, 784 - 0xf40112b6, 785 - /* 0x081a: ctx_mmio_done */ 786 - 0x0398df1b, 787 - 0x81008016, 788 - 0x0003f602, 789 - 0x00b504bd, 790 - 0x01004140, 791 - 0xfa0613f0, 792 - 0x03f80601, 793 - /* 0x0836: ctx_xfer */ 794 - 0x040e00f8, 795 - 0x03020080, 796 - 0xbd000ef6, 797 - /* 0x0841: ctx_xfer_idle */ 798 - 0x00008e04, 799 - 0x00eecf03, 800 - 0x2000e4f1, 801 - 0xf4f51bf4, 802 - 0x02f40611, 803 - /* 0x0855: ctx_xfer_pre */ 804 - 0x7e100f0c, 805 - 0xf40006b3, 806 - /* 0x085e: ctx_xfer_pre_load */ 807 - 0x020f1b11, 808 - 0x0006627e, 809 - 0x0006717e, 810 - 0x0006837e, 811 - 0x627ef4bd, 812 - 0xea7e0006, 813 - /* 0x0876: ctx_xfer_exec */ 814 - 0x01980006, 815 - 0x8024bd16, 816 - 0xf6010500, 817 - 0x04bd0002, 818 - 0x008e1fb2, 819 - 0x8f7e41a5, 820 - 0xfcf00000, 821 - 0x022cf001, 822 - 0xfd0124b6, 823 - 0xffb205f2, 824 - 0x41a5048e, 825 - 0x00008f7e, 826 - 0x0002167e, 827 - 0xfc8024bd, 828 - 0x02f60247, 829 - 0xf004bd00, 830 - 0x20b6012c, 831 - 0x4afc8003, 832 - 0x0002f602, 833 - 0xacf004bd, 834 - 0x06a5f001, 835 - 0x0c98000b, 836 - 0x010d9800, 837 - 0x3d7e000e, 838 - 0x080a0001, 839 - 0x0000ec7e, 840 - 0x00020a7e, 841 - 0x0a1201f4, 842 - 0x00b87e0c, 843 - 0x7e050f00, 844 - 0xf40006d2, 845 - /* 0x08f2: ctx_xfer_post */ 846 - 0x020f2d02, 847 - 0x0006627e, 848 - 0xb37ef4bd, 849 - 0x277e0006, 850 - 0x717e0002, 807 + 0x414000b5, 808 + 0x13f00100, 809 + 0x0601fa06, 810 + 0x00f803f8, 811 + /* 0x087c: ctx_xfer */ 812 + 0x0080040e, 813 + 0x0ef60302, 814 + /* 0x0887: ctx_xfer_idle */ 815 + 0x8e04bd00, 816 + 0xcf030000, 817 + 0xe4f100ee, 818 + 0x1bf42000, 819 + 0x0611f4f5, 820 + /* 0x089b: ctx_xfer_pre */ 821 + 0x0f0c02f4, 822 + 0x06f97e10, 823 + 0x1b11f400, 824 + /* 0x08a4: ctx_xfer_pre_load */ 825 + 0xa87e020f, 826 + 0xb77e0006, 827 + 0xc97e0006, 851 828 0xf4bd0006, 852 - 0x0006627e, 853 - 0x981011f4, 854 - 0x11fd4001, 855 - 0x070bf405, 856 - 0x0007e87e, 857 - /* 0x091c: ctx_xfer_no_post_mmio */ 858 - /* 0x091c: ctx_xfer_done */ 859 - 0x000000f8, 860 - 0x00000000, 861 - 0x00000000, 862 - 0x00000000, 863 - 0x00000000, 864 - 0x00000000, 865 - 0x00000000, 866 - 0x00000000, 867 - 0x00000000, 868 - 0x00000000, 869 - 0x00000000, 870 - 0x00000000, 871 - 0x00000000, 872 - 0x00000000, 873 - 0x00000000, 874 - 0x00000000, 875 - 0x00000000, 876 - 0x00000000, 829 + 0x0006a87e, 830 + 0x0007307e, 831 + /* 0x08bc: ctx_xfer_exec */ 832 + 0xbd160198, 833 + 0x05008024, 834 + 0x0002f601, 835 + 0x1fb204bd, 836 + 0x41a5008e, 837 + 0x00008f7e, 838 + 0xf001fcf0, 839 + 0x24b6022c, 840 + 0x05f2fd01, 841 + 0x048effb2, 842 + 0x8f7e41a5, 843 + 0x167e0000, 844 + 0x24bd0002, 845 + 0x0247fc80, 846 + 0xbd0002f6, 847 + 0x012cf004, 848 + 0x800320b6, 849 + 0xf6024afc, 850 + 0x04bd0002, 851 + 0xf001acf0, 852 + 0x000b06a5, 853 + 0x98000c98, 854 + 0x000e010d, 855 + 0x00013d7e, 856 + 0xec7e080a, 857 + 0x0a7e0000, 858 + 0x01f40002, 859 + 0x7e0c0a12, 860 + 0x0f0000b8, 861 + 0x07187e05, 862 + 0x2d02f400, 863 + /* 0x0938: ctx_xfer_post */ 864 + 0xa87e020f, 865 + 0xf4bd0006, 866 + 0x0006f97e, 867 + 0x0002277e, 868 + 0x0006b77e, 869 + 0xa87ef4bd, 870 + 0x11f40006, 871 + 0x40019810, 872 + 0xf40511fd, 873 + 0x2e7e070b, 874 + /* 0x0962: ctx_xfer_no_post_mmio */ 875 + /* 0x0962: ctx_xfer_done */ 876 + 0x00f80008, 877 877 0x00000000, 878 878 0x00000000, 879 879 0x00000000,
+233 -233
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h
··· 478 478 0x01040080, 479 479 0xbd0001f6, 480 480 0x01004104, 481 - 0x627e020f, 482 - 0x717e0006, 481 + 0xa87e020f, 482 + 0xb77e0006, 483 483 0x100f0006, 484 - 0x0006b37e, 484 + 0x0006f97e, 485 485 0x98000e98, 486 486 0x207e010f, 487 487 0x14950001, ··· 523 523 0x800040b7, 524 524 0xf40132b6, 525 525 0x000fb41b, 526 - 0x0006b37e, 527 - 0x627e000f, 526 + 0x0006f97e, 527 + 0xa87e000f, 528 528 0x00800006, 529 529 0x01f60201, 530 530 0xbd04bd00, ··· 554 554 0x0009f602, 555 555 0x32f404bd, 556 556 0x0231f401, 557 - 0x0008367e, 557 + 0x00087c7e, 558 558 0x99f094bd, 559 559 0x17008007, 560 560 0x0009f602, ··· 563 563 0x37008006, 564 564 0x0009f602, 565 565 0x31f404bd, 566 - 0x08367e01, 566 + 0x087c7e01, 567 567 0xf094bd00, 568 568 0x00800699, 569 569 0x09f60217, ··· 572 572 0x20f92f0e, 573 573 0x32f412b2, 574 574 0x0232f401, 575 - 0x0008367e, 575 + 0x00087c7e, 576 576 0x008020fc, 577 577 0x02f602c0, 578 578 0xf404bd00, ··· 580 580 0x23c8130e, 581 581 0x0d0bf41f, 582 582 0xf40131f4, 583 - 0x367e0232, 583 + 0x7c7e0232, 584 584 /* 0x054e: chsw_done */ 585 585 0x01020008, 586 586 0x02c30080, ··· 593 593 0xb0ff2a0e, 594 594 0x1bf401e4, 595 595 0x7ef2b20c, 596 - 0xf40007d6, 596 + 0xf400081c, 597 597 /* 0x057a: main_not_ctx_chan */ 598 598 0xe4b0400e, 599 599 0x2c1bf402, ··· 602 602 0x0009f602, 603 603 0x32f404bd, 604 604 0x0232f401, 605 - 0x0008367e, 605 + 0x00087c7e, 606 606 0x99f094bd, 607 607 0x17008007, 608 608 0x0009f602, ··· 642 642 /* 0x061a: ih_no_ctxsw */ 643 643 0xabe40000, 644 644 0x0bf40400, 645 - 0x01004b10, 646 - 0x448ebfb2, 647 - 0x8f7e4001, 648 - /* 0x062e: ih_no_fwmthd */ 649 - 0x044b0000, 650 - 0xffb0bd01, 651 - 0x0bf4b4ab, 652 - 0x0700800c, 653 - 0x000bf603, 654 - /* 0x0642: ih_no_other */ 655 - 0x004004bd, 656 - 0x000af601, 657 - 0xf0fc04bd, 658 - 0xd0fce0fc, 659 - 0xa0fcb0fc, 660 - 0x80fc90fc, 661 - 0xfc0088fe, 662 - 0x0032f480, 663 - /* 0x0662: ctx_4170s */ 664 - 0xf5f001f8, 665 - 0x8effb210, 666 - 0x7e404170, 667 - 0xf800008f, 668 - /* 0x0671: ctx_4170w */ 669 - 0x41708e00, 645 + 0x07088e56, 670 646 0x00657e40, 671 - 0xf0ffb200, 672 - 0x1bf410f4, 673 - /* 0x0683: ctx_redswitch */ 674 - 0x4e00f8f3, 675 - 0xe5f00200, 676 - 0x20e5f040, 677 - 0x8010e5f0, 678 - 0xf6018500, 679 - 0x04bd000e, 680 - /* 0x069a: ctx_redswitch_delay */ 681 - 0xf2b6080f, 682 - 0xfd1bf401, 683 - 0x0400e5f1, 684 - 0x0100e5f1, 685 - 0x01850080, 686 - 0xbd000ef6, 687 - /* 0x06b3: ctx_86c */ 688 - 0x8000f804, 689 - 0xf6022300, 647 + 0x80ffb200, 648 + 0xf6020400, 690 649 0x04bd000f, 691 - 0x148effb2, 692 - 0x8f7e408a, 693 - 0xffb20000, 694 - 0x41a88c8e, 695 - 0x00008f7e, 696 - /* 0x06d2: ctx_mem */ 697 - 0x008000f8, 698 - 0x0ff60284, 699 - /* 0x06db: ctx_mem_wait */ 700 - 0x8f04bd00, 701 - 0xcf028400, 702 - 0xfffd00ff, 703 - 0xf61bf405, 704 - /* 0x06ea: ctx_load */ 705 - 0x94bd00f8, 706 - 0x800599f0, 707 - 0xf6023700, 708 - 0x04bd0009, 709 - 0xb87e0c0a, 710 - 0xf4bd0000, 711 - 0x02890080, 650 + 0x4007048e, 651 + 0x0000657e, 652 + 0x0080ffb2, 653 + 0x0ff60203, 654 + 0xc704bd00, 655 + 0xee9450fe, 656 + 0x07008f02, 657 + 0x00efbb40, 658 + 0x0000657e, 659 + 0x02020080, 712 660 0xbd000ff6, 713 - 0xc1008004, 714 - 0x0002f602, 715 - 0x008004bd, 716 - 0x02f60283, 717 - 0x0f04bd00, 718 - 0x06d27e07, 719 - 0xc0008000, 720 - 0x0002f602, 721 - 0x0bfe04bd, 722 - 0x1f2af000, 723 - 0xb60424b6, 724 - 0x94bd0220, 725 - 0x800899f0, 726 - 0xf6023700, 727 - 0x04bd0009, 728 - 0x02810080, 729 - 0xbd0002f6, 730 - 0x0000d204, 731 - 0x25f08000, 732 - 0x88008002, 733 - 0x0002f602, 734 - 0x100104bd, 735 - 0xf0020042, 736 - 0x12fa0223, 737 - 0xbd03f805, 738 - 0x0899f094, 739 - 0x02170080, 740 - 0xbd0009f6, 741 - 0x81019804, 742 - 0x981814b6, 743 - 0x25b68002, 744 - 0x0512fd08, 745 - 0xbd1601b5, 746 - 0x0999f094, 747 - 0x02370080, 748 - 0xbd0009f6, 749 - 0x81008004, 750 - 0x0001f602, 751 - 0x010204bd, 752 - 0x02880080, 753 - 0xbd0002f6, 754 - 0x01004104, 755 - 0xfa0613f0, 756 - 0x03f80501, 661 + 0x7e030f04, 662 + 0x4b0002f8, 663 + 0xbfb20100, 664 + 0x4001448e, 665 + 0x00008f7e, 666 + /* 0x0674: ih_no_fwmthd */ 667 + 0xbd05044b, 668 + 0xb4abffb0, 669 + 0x800c0bf4, 670 + 0xf6030700, 671 + 0x04bd000b, 672 + /* 0x0688: ih_no_other */ 673 + 0xf6010040, 674 + 0x04bd000a, 675 + 0xe0fcf0fc, 676 + 0xb0fcd0fc, 677 + 0x90fca0fc, 678 + 0x88fe80fc, 679 + 0xf480fc00, 680 + 0x01f80032, 681 + /* 0x06a8: ctx_4170s */ 682 + 0xb210f5f0, 683 + 0x41708eff, 684 + 0x008f7e40, 685 + /* 0x06b7: ctx_4170w */ 686 + 0x8e00f800, 687 + 0x7e404170, 688 + 0xb2000065, 689 + 0x10f4f0ff, 690 + 0xf8f31bf4, 691 + /* 0x06c9: ctx_redswitch */ 692 + 0x02004e00, 693 + 0xf040e5f0, 694 + 0xe5f020e5, 695 + 0x85008010, 696 + 0x000ef601, 697 + 0x080f04bd, 698 + /* 0x06e0: ctx_redswitch_delay */ 699 + 0xf401f2b6, 700 + 0xe5f1fd1b, 701 + 0xe5f10400, 702 + 0x00800100, 703 + 0x0ef60185, 704 + 0xf804bd00, 705 + /* 0x06f9: ctx_86c */ 706 + 0x23008000, 707 + 0x000ff602, 708 + 0xffb204bd, 709 + 0x408a148e, 710 + 0x00008f7e, 711 + 0x8c8effb2, 712 + 0x8f7e41a8, 713 + 0x00f80000, 714 + /* 0x0718: ctx_mem */ 715 + 0x02840080, 716 + 0xbd000ff6, 717 + /* 0x0721: ctx_mem_wait */ 718 + 0x84008f04, 719 + 0x00ffcf02, 720 + 0xf405fffd, 721 + 0x00f8f61b, 722 + /* 0x0730: ctx_load */ 757 723 0x99f094bd, 758 - 0x17008009, 724 + 0x37008005, 759 725 0x0009f602, 760 - 0x94bd04bd, 761 - 0x800599f0, 726 + 0x0c0a04bd, 727 + 0x0000b87e, 728 + 0x0080f4bd, 729 + 0x0ff60289, 730 + 0x8004bd00, 731 + 0xf602c100, 732 + 0x04bd0002, 733 + 0x02830080, 734 + 0xbd0002f6, 735 + 0x7e070f04, 736 + 0x80000718, 737 + 0xf602c000, 738 + 0x04bd0002, 739 + 0xf0000bfe, 740 + 0x24b61f2a, 741 + 0x0220b604, 742 + 0x99f094bd, 743 + 0x37008008, 744 + 0x0009f602, 745 + 0x008004bd, 746 + 0x02f60281, 747 + 0xd204bd00, 748 + 0x80000000, 749 + 0x800225f0, 750 + 0xf6028800, 751 + 0x04bd0002, 752 + 0x00421001, 753 + 0x0223f002, 754 + 0xf80512fa, 755 + 0xf094bd03, 756 + 0x00800899, 757 + 0x09f60217, 758 + 0x9804bd00, 759 + 0x14b68101, 760 + 0x80029818, 761 + 0xfd0825b6, 762 + 0x01b50512, 763 + 0xf094bd16, 764 + 0x00800999, 765 + 0x09f60237, 766 + 0x8004bd00, 767 + 0xf6028100, 768 + 0x04bd0001, 769 + 0x00800102, 770 + 0x02f60288, 771 + 0x4104bd00, 772 + 0x13f00100, 773 + 0x0501fa06, 774 + 0x94bd03f8, 775 + 0x800999f0, 762 776 0xf6021700, 763 777 0x04bd0009, 764 - /* 0x07d6: ctx_chan */ 765 - 0xea7e00f8, 766 - 0x0c0a0006, 767 - 0x0000b87e, 768 - 0xd27e050f, 769 - 0x00f80006, 770 - /* 0x07e8: ctx_mmio_exec */ 771 - 0x80410398, 778 + 0x99f094bd, 779 + 0x17008005, 780 + 0x0009f602, 781 + 0x00f804bd, 782 + /* 0x081c: ctx_chan */ 783 + 0x0007307e, 784 + 0xb87e0c0a, 785 + 0x050f0000, 786 + 0x0007187e, 787 + /* 0x082e: ctx_mmio_exec */ 788 + 0x039800f8, 789 + 0x81008041, 790 + 0x0003f602, 791 + 0x34bd04bd, 792 + /* 0x083c: ctx_mmio_loop */ 793 + 0xf4ff34c4, 794 + 0x00450e1b, 795 + 0x0653f002, 796 + 0xf80535fa, 797 + /* 0x084d: ctx_mmio_pull */ 798 + 0x804e9803, 799 + 0x7e814f98, 800 + 0xb600008f, 801 + 0x12b60830, 802 + 0xdf1bf401, 803 + /* 0x0860: ctx_mmio_done */ 804 + 0x80160398, 772 805 0xf6028100, 773 806 0x04bd0003, 774 - /* 0x07f6: ctx_mmio_loop */ 775 - 0x34c434bd, 776 - 0x0e1bf4ff, 777 - 0xf0020045, 778 - 0x35fa0653, 779 - /* 0x0807: ctx_mmio_pull */ 780 - 0x9803f805, 781 - 0x4f98804e, 782 - 0x008f7e81, 783 - 0x0830b600, 784 - 0xf40112b6, 785 - /* 0x081a: ctx_mmio_done */ 786 - 0x0398df1b, 787 - 0x81008016, 788 - 0x0003f602, 789 - 0x00b504bd, 790 - 0x01004140, 791 - 0xfa0613f0, 792 - 0x03f80601, 793 - /* 0x0836: ctx_xfer */ 794 - 0x040e00f8, 795 - 0x03020080, 796 - 0xbd000ef6, 797 - /* 0x0841: ctx_xfer_idle */ 798 - 0x00008e04, 799 - 0x00eecf03, 800 - 0x2000e4f1, 801 - 0xf4f51bf4, 802 - 0x02f40611, 803 - /* 0x0855: ctx_xfer_pre */ 804 - 0x7e100f0c, 805 - 0xf40006b3, 806 - /* 0x085e: ctx_xfer_pre_load */ 807 - 0x020f1b11, 808 - 0x0006627e, 809 - 0x0006717e, 810 - 0x0006837e, 811 - 0x627ef4bd, 812 - 0xea7e0006, 813 - /* 0x0876: ctx_xfer_exec */ 814 - 0x01980006, 815 - 0x8024bd16, 816 - 0xf6010500, 817 - 0x04bd0002, 818 - 0x008e1fb2, 819 - 0x8f7e41a5, 820 - 0xfcf00000, 821 - 0x022cf001, 822 - 0xfd0124b6, 823 - 0xffb205f2, 824 - 0x41a5048e, 825 - 0x00008f7e, 826 - 0x0002167e, 827 - 0xfc8024bd, 828 - 0x02f60247, 829 - 0xf004bd00, 830 - 0x20b6012c, 831 - 0x4afc8003, 832 - 0x0002f602, 833 - 0xacf004bd, 834 - 0x06a5f001, 835 - 0x0c98000b, 836 - 0x010d9800, 837 - 0x3d7e000e, 838 - 0x080a0001, 839 - 0x0000ec7e, 840 - 0x00020a7e, 841 - 0x0a1201f4, 842 - 0x00b87e0c, 843 - 0x7e050f00, 844 - 0xf40006d2, 845 - /* 0x08f2: ctx_xfer_post */ 846 - 0x020f2d02, 847 - 0x0006627e, 848 - 0xb37ef4bd, 849 - 0x277e0006, 850 - 0x717e0002, 807 + 0x414000b5, 808 + 0x13f00100, 809 + 0x0601fa06, 810 + 0x00f803f8, 811 + /* 0x087c: ctx_xfer */ 812 + 0x0080040e, 813 + 0x0ef60302, 814 + /* 0x0887: ctx_xfer_idle */ 815 + 0x8e04bd00, 816 + 0xcf030000, 817 + 0xe4f100ee, 818 + 0x1bf42000, 819 + 0x0611f4f5, 820 + /* 0x089b: ctx_xfer_pre */ 821 + 0x0f0c02f4, 822 + 0x06f97e10, 823 + 0x1b11f400, 824 + /* 0x08a4: ctx_xfer_pre_load */ 825 + 0xa87e020f, 826 + 0xb77e0006, 827 + 0xc97e0006, 851 828 0xf4bd0006, 852 - 0x0006627e, 853 - 0x981011f4, 854 - 0x11fd4001, 855 - 0x070bf405, 856 - 0x0007e87e, 857 - /* 0x091c: ctx_xfer_no_post_mmio */ 858 - /* 0x091c: ctx_xfer_done */ 859 - 0x000000f8, 860 - 0x00000000, 861 - 0x00000000, 862 - 0x00000000, 863 - 0x00000000, 864 - 0x00000000, 865 - 0x00000000, 866 - 0x00000000, 867 - 0x00000000, 868 - 0x00000000, 869 - 0x00000000, 870 - 0x00000000, 871 - 0x00000000, 872 - 0x00000000, 873 - 0x00000000, 874 - 0x00000000, 875 - 0x00000000, 876 - 0x00000000, 829 + 0x0006a87e, 830 + 0x0007307e, 831 + /* 0x08bc: ctx_xfer_exec */ 832 + 0xbd160198, 833 + 0x05008024, 834 + 0x0002f601, 835 + 0x1fb204bd, 836 + 0x41a5008e, 837 + 0x00008f7e, 838 + 0xf001fcf0, 839 + 0x24b6022c, 840 + 0x05f2fd01, 841 + 0x048effb2, 842 + 0x8f7e41a5, 843 + 0x167e0000, 844 + 0x24bd0002, 845 + 0x0247fc80, 846 + 0xbd0002f6, 847 + 0x012cf004, 848 + 0x800320b6, 849 + 0xf6024afc, 850 + 0x04bd0002, 851 + 0xf001acf0, 852 + 0x000b06a5, 853 + 0x98000c98, 854 + 0x000e010d, 855 + 0x00013d7e, 856 + 0xec7e080a, 857 + 0x0a7e0000, 858 + 0x01f40002, 859 + 0x7e0c0a12, 860 + 0x0f0000b8, 861 + 0x07187e05, 862 + 0x2d02f400, 863 + /* 0x0938: ctx_xfer_post */ 864 + 0xa87e020f, 865 + 0xf4bd0006, 866 + 0x0006f97e, 867 + 0x0002277e, 868 + 0x0006b77e, 869 + 0xa87ef4bd, 870 + 0x11f40006, 871 + 0x40019810, 872 + 0xf40511fd, 873 + 0x2e7e070b, 874 + /* 0x0962: ctx_xfer_no_post_mmio */ 875 + /* 0x0962: ctx_xfer_done */ 876 + 0x00f80008, 877 877 0x00000000, 878 878 0x00000000, 879 879 0x00000000,
+126 -62
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h
··· 528 528 0x0001d001, 529 529 0x17f104bd, 530 530 0xf7f00100, 531 - 0xb521f502, 532 - 0xc721f507, 533 - 0x10f7f007, 534 - 0x081421f5, 531 + 0x0d21f502, 532 + 0x1f21f508, 533 + 0x10f7f008, 534 + 0x086c21f5, 535 535 0x98000e98, 536 536 0x21f5010f, 537 537 0x14950150, ··· 574 574 0xb6800040, 575 575 0x1bf40132, 576 576 0x00f7f0be, 577 - 0x081421f5, 577 + 0x086c21f5, 578 578 0xf500f7f0, 579 - 0xf107b521, 579 + 0xf1080d21, 580 580 0xf0010007, 581 581 0x01d00203, 582 582 0xbd04bd00, ··· 610 610 0x09d00203, 611 611 0xf404bd00, 612 612 0x31f40132, 613 - 0xe821f502, 614 - 0xf094bd09, 613 + 0x4021f502, 614 + 0xf094bd0a, 615 615 0x07f10799, 616 616 0x03f01700, 617 617 0x0009d002, ··· 621 621 0x0203f00f, 622 622 0xbd0009d0, 623 623 0x0131f404, 624 - 0x09e821f5, 624 + 0x0a4021f5, 625 625 0x99f094bd, 626 626 0x0007f106, 627 627 0x0203f017, ··· 631 631 0x12b920f9, 632 632 0x0132f402, 633 633 0xf50232f4, 634 - 0xfc09e821, 634 + 0xfc0a4021, 635 635 0x0007f120, 636 636 0x0203f0c0, 637 637 0xbd0002d0, ··· 640 640 0xf41f23c8, 641 641 0x31f40d0b, 642 642 0x0232f401, 643 - 0x09e821f5, 643 + 0x0a4021f5, 644 644 /* 0x063c: chsw_done */ 645 645 0xf10127f0, 646 646 0xf0c30007, ··· 654 654 /* 0x0660: main_not_ctx_switch */ 655 655 0xf401e4b0, 656 656 0xf2b90d1b, 657 - 0x7821f502, 657 + 0xd021f502, 658 658 0x460ef409, 659 659 /* 0x0670: main_not_ctx_chan */ 660 660 0xf402e4b0, ··· 664 664 0x09d00203, 665 665 0xf404bd00, 666 666 0x32f40132, 667 - 0xe821f502, 668 - 0xf094bd09, 667 + 0x4021f502, 668 + 0xf094bd0a, 669 669 0x07f10799, 670 670 0x03f01700, 671 671 0x0009d002, ··· 710 710 /* 0x072b: ih_no_ctxsw */ 711 711 0xe40421f4, 712 712 0xf40400ab, 713 - 0xb7f1140b, 713 + 0xe7f16c0b, 714 + 0xe3f00708, 715 + 0x6821f440, 716 + 0xf102ffb9, 717 + 0xf0040007, 718 + 0x0fd00203, 719 + 0xf104bd00, 720 + 0xf00704e7, 721 + 0x21f440e3, 722 + 0x02ffb968, 723 + 0x030007f1, 724 + 0xd00203f0, 725 + 0x04bd000f, 726 + 0x9450fec7, 727 + 0xf7f102ee, 728 + 0xf3f00700, 729 + 0x00efbb40, 730 + 0xf16821f4, 731 + 0xf0020007, 732 + 0x0fd00203, 733 + 0xf004bd00, 734 + 0x21f503f7, 735 + 0xb7f1037e, 714 736 0xbfb90100, 715 737 0x44e7f102, 716 738 0x40e3f001, 717 - /* 0x0743: ih_no_fwmthd */ 739 + /* 0x079b: ih_no_fwmthd */ 718 740 0xf19d21f4, 719 - 0xbd0104b7, 741 + 0xbd0504b7, 720 742 0xb4abffb0, 721 743 0xf10f0bf4, 722 744 0xf0070007, 723 745 0x0bd00303, 724 - /* 0x075b: ih_no_other */ 746 + /* 0x07b3: ih_no_other */ 725 747 0xf104bd00, 726 748 0xf0010007, 727 749 0x0ad00003, ··· 753 731 0xfc90fca0, 754 732 0x0088fe80, 755 733 0x32f480fc, 756 - /* 0x077f: ctx_4160s */ 734 + /* 0x07d7: ctx_4160s */ 757 735 0xf001f800, 758 736 0xffb901f7, 759 737 0x60e7f102, 760 738 0x40e3f041, 761 - /* 0x078f: ctx_4160s_wait */ 739 + /* 0x07e7: ctx_4160s_wait */ 762 740 0xf19d21f4, 763 741 0xf04160e7, 764 742 0x21f440e3, 765 743 0x02ffb968, 766 744 0xf404ffc8, 767 745 0x00f8f00b, 768 - /* 0x07a4: ctx_4160c */ 746 + /* 0x07fc: ctx_4160c */ 769 747 0xffb9f4bd, 770 748 0x60e7f102, 771 749 0x40e3f041, 772 750 0xf89d21f4, 773 - /* 0x07b5: ctx_4170s */ 751 + /* 0x080d: ctx_4170s */ 774 752 0x10f5f000, 775 753 0xf102ffb9, 776 754 0xf04170e7, 777 755 0x21f440e3, 778 - /* 0x07c7: ctx_4170w */ 756 + /* 0x081f: ctx_4170w */ 779 757 0xf100f89d, 780 758 0xf04170e7, 781 759 0x21f440e3, 782 760 0x02ffb968, 783 761 0xf410f4f0, 784 762 0x00f8f01b, 785 - /* 0x07dc: ctx_redswitch */ 763 + /* 0x0834: ctx_redswitch */ 786 764 0x0200e7f1, 787 765 0xf040e5f0, 788 766 0xe5f020e5, ··· 790 768 0x0103f085, 791 769 0xbd000ed0, 792 770 0x08f7f004, 793 - /* 0x07f8: ctx_redswitch_delay */ 771 + /* 0x0850: ctx_redswitch_delay */ 794 772 0xf401f2b6, 795 773 0xe5f1fd1b, 796 774 0xe5f10400, ··· 798 776 0x03f08500, 799 777 0x000ed001, 800 778 0x00f804bd, 801 - /* 0x0814: ctx_86c */ 779 + /* 0x086c: ctx_86c */ 802 780 0x1b0007f1, 803 781 0xd00203f0, 804 782 0x04bd000f, ··· 809 787 0xa86ce7f1, 810 788 0xf441e3f0, 811 789 0x00f89d21, 812 - /* 0x083c: ctx_mem */ 790 + /* 0x0894: ctx_mem */ 813 791 0x840007f1, 814 792 0xd00203f0, 815 793 0x04bd000f, 816 - /* 0x0848: ctx_mem_wait */ 794 + /* 0x08a0: ctx_mem_wait */ 817 795 0x8400f7f1, 818 796 0xcf02f3f0, 819 797 0xfffd00ff, 820 798 0xf31bf405, 821 - /* 0x085a: ctx_load */ 799 + /* 0x08b2: ctx_load */ 822 800 0x94bd00f8, 823 801 0xf10599f0, 824 802 0xf00f0007, ··· 836 814 0x02d00203, 837 815 0xf004bd00, 838 816 0x21f507f7, 839 - 0x07f1083c, 817 + 0x07f10894, 840 818 0x03f0c000, 841 819 0x0002d002, 842 820 0x0bfe04bd, ··· 891 869 0x03f01700, 892 870 0x0009d002, 893 871 0x00f804bd, 894 - /* 0x0978: ctx_chan */ 895 - 0x077f21f5, 896 - 0x085a21f5, 872 + /* 0x09d0: ctx_chan */ 873 + 0x07d721f5, 874 + 0x08b221f5, 897 875 0xf40ca7f0, 898 876 0xf7f0d021, 899 - 0x3c21f505, 900 - 0xa421f508, 901 - /* 0x0993: ctx_mmio_exec */ 877 + 0x9421f505, 878 + 0xfc21f508, 879 + /* 0x09eb: ctx_mmio_exec */ 902 880 0x9800f807, 903 881 0x07f14103, 904 882 0x03f08100, 905 883 0x0003d002, 906 884 0x34bd04bd, 907 - /* 0x09a4: ctx_mmio_loop */ 885 + /* 0x09fc: ctx_mmio_loop */ 908 886 0xf4ff34c4, 909 887 0x57f10f1b, 910 888 0x53f00200, 911 889 0x0535fa06, 912 - /* 0x09b6: ctx_mmio_pull */ 890 + /* 0x0a0e: ctx_mmio_pull */ 913 891 0x4e9803f8, 914 892 0x814f9880, 915 893 0xb69d21f4, 916 894 0x12b60830, 917 895 0xdf1bf401, 918 - /* 0x09c8: ctx_mmio_done */ 896 + /* 0x0a20: ctx_mmio_done */ 919 897 0xf1160398, 920 898 0xf0810007, 921 899 0x03d00203, ··· 924 902 0x13f00100, 925 903 0x0601fa06, 926 904 0x00f803f8, 927 - /* 0x09e8: ctx_xfer */ 905 + /* 0x0a40: ctx_xfer */ 928 906 0xf104e7f0, 929 907 0xf0020007, 930 908 0x0ed00303, 931 - /* 0x09f7: ctx_xfer_idle */ 909 + /* 0x0a4f: ctx_xfer_idle */ 932 910 0xf104bd00, 933 911 0xf00000e7, 934 912 0xeecf03e3, 935 913 0x00e4f100, 936 914 0xf21bf420, 937 915 0xf40611f4, 938 - /* 0x0a0e: ctx_xfer_pre */ 916 + /* 0x0a66: ctx_xfer_pre */ 939 917 0xf7f01102, 940 - 0x1421f510, 941 - 0x7f21f508, 918 + 0x6c21f510, 919 + 0xd721f508, 942 920 0x1c11f407, 943 - /* 0x0a1c: ctx_xfer_pre_load */ 921 + /* 0x0a74: ctx_xfer_pre_load */ 944 922 0xf502f7f0, 945 - 0xf507b521, 946 - 0xf507c721, 947 - 0xbd07dc21, 948 - 0xb521f5f4, 949 - 0x5a21f507, 950 - /* 0x0a35: ctx_xfer_exec */ 923 + 0xf5080d21, 924 + 0xf5081f21, 925 + 0xbd083421, 926 + 0x0d21f5f4, 927 + 0xb221f508, 928 + /* 0x0a8d: ctx_xfer_exec */ 951 929 0x16019808, 952 930 0x07f124bd, 953 931 0x03f00500, ··· 982 960 0x1301f402, 983 961 0xf40ca7f0, 984 962 0xf7f0d021, 985 - 0x3c21f505, 963 + 0x9421f505, 986 964 0x3202f408, 987 - /* 0x0ac4: ctx_xfer_post */ 965 + /* 0x0b1c: ctx_xfer_post */ 988 966 0xf502f7f0, 989 - 0xbd07b521, 990 - 0x1421f5f4, 967 + 0xbd080d21, 968 + 0x6c21f5f4, 991 969 0x7f21f508, 992 - 0xc721f502, 993 - 0xf5f4bd07, 994 - 0xf407b521, 970 + 0x1f21f502, 971 + 0xf5f4bd08, 972 + 0xf4080d21, 995 973 0x01981011, 996 974 0x0511fd40, 997 975 0xf5070bf4, 998 - /* 0x0aef: ctx_xfer_no_post_mmio */ 999 - 0xf5099321, 1000 - /* 0x0af3: ctx_xfer_done */ 1001 - 0xf807a421, 976 + /* 0x0b47: ctx_xfer_no_post_mmio */ 977 + 0xf509eb21, 978 + /* 0x0b4b: ctx_xfer_done */ 979 + 0xf807fc21, 980 + 0x00000000, 981 + 0x00000000, 982 + 0x00000000, 983 + 0x00000000, 984 + 0x00000000, 985 + 0x00000000, 986 + 0x00000000, 987 + 0x00000000, 988 + 0x00000000, 989 + 0x00000000, 990 + 0x00000000, 991 + 0x00000000, 992 + 0x00000000, 993 + 0x00000000, 994 + 0x00000000, 995 + 0x00000000, 996 + 0x00000000, 997 + 0x00000000, 998 + 0x00000000, 999 + 0x00000000, 1000 + 0x00000000, 1001 + 0x00000000, 1002 + 0x00000000, 1003 + 0x00000000, 1004 + 0x00000000, 1005 + 0x00000000, 1006 + 0x00000000, 1007 + 0x00000000, 1008 + 0x00000000, 1009 + 0x00000000, 1010 + 0x00000000, 1011 + 0x00000000, 1012 + 0x00000000, 1013 + 0x00000000, 1014 + 0x00000000, 1015 + 0x00000000, 1016 + 0x00000000, 1017 + 0x00000000, 1018 + 0x00000000, 1019 + 0x00000000, 1020 + 0x00000000, 1021 + 0x00000000, 1002 1022 0x00000000, 1003 1023 0x00000000, 1004 1024 0x00000000,
+126 -62
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h
··· 528 528 0x0001d001, 529 529 0x17f104bd, 530 530 0xf7f00100, 531 - 0xb521f502, 532 - 0xc721f507, 533 - 0x10f7f007, 534 - 0x081421f5, 531 + 0x0d21f502, 532 + 0x1f21f508, 533 + 0x10f7f008, 534 + 0x086c21f5, 535 535 0x98000e98, 536 536 0x21f5010f, 537 537 0x14950150, ··· 574 574 0xb6800040, 575 575 0x1bf40132, 576 576 0x00f7f0be, 577 - 0x081421f5, 577 + 0x086c21f5, 578 578 0xf500f7f0, 579 - 0xf107b521, 579 + 0xf1080d21, 580 580 0xf0010007, 581 581 0x01d00203, 582 582 0xbd04bd00, ··· 610 610 0x09d00203, 611 611 0xf404bd00, 612 612 0x31f40132, 613 - 0xe821f502, 614 - 0xf094bd09, 613 + 0x4021f502, 614 + 0xf094bd0a, 615 615 0x07f10799, 616 616 0x03f01700, 617 617 0x0009d002, ··· 621 621 0x0203f00f, 622 622 0xbd0009d0, 623 623 0x0131f404, 624 - 0x09e821f5, 624 + 0x0a4021f5, 625 625 0x99f094bd, 626 626 0x0007f106, 627 627 0x0203f017, ··· 631 631 0x12b920f9, 632 632 0x0132f402, 633 633 0xf50232f4, 634 - 0xfc09e821, 634 + 0xfc0a4021, 635 635 0x0007f120, 636 636 0x0203f0c0, 637 637 0xbd0002d0, ··· 640 640 0xf41f23c8, 641 641 0x31f40d0b, 642 642 0x0232f401, 643 - 0x09e821f5, 643 + 0x0a4021f5, 644 644 /* 0x063c: chsw_done */ 645 645 0xf10127f0, 646 646 0xf0c30007, ··· 654 654 /* 0x0660: main_not_ctx_switch */ 655 655 0xf401e4b0, 656 656 0xf2b90d1b, 657 - 0x7821f502, 657 + 0xd021f502, 658 658 0x460ef409, 659 659 /* 0x0670: main_not_ctx_chan */ 660 660 0xf402e4b0, ··· 664 664 0x09d00203, 665 665 0xf404bd00, 666 666 0x32f40132, 667 - 0xe821f502, 668 - 0xf094bd09, 667 + 0x4021f502, 668 + 0xf094bd0a, 669 669 0x07f10799, 670 670 0x03f01700, 671 671 0x0009d002, ··· 710 710 /* 0x072b: ih_no_ctxsw */ 711 711 0xe40421f4, 712 712 0xf40400ab, 713 - 0xb7f1140b, 713 + 0xe7f16c0b, 714 + 0xe3f00708, 715 + 0x6821f440, 716 + 0xf102ffb9, 717 + 0xf0040007, 718 + 0x0fd00203, 719 + 0xf104bd00, 720 + 0xf00704e7, 721 + 0x21f440e3, 722 + 0x02ffb968, 723 + 0x030007f1, 724 + 0xd00203f0, 725 + 0x04bd000f, 726 + 0x9450fec7, 727 + 0xf7f102ee, 728 + 0xf3f00700, 729 + 0x00efbb40, 730 + 0xf16821f4, 731 + 0xf0020007, 732 + 0x0fd00203, 733 + 0xf004bd00, 734 + 0x21f503f7, 735 + 0xb7f1037e, 714 736 0xbfb90100, 715 737 0x44e7f102, 716 738 0x40e3f001, 717 - /* 0x0743: ih_no_fwmthd */ 739 + /* 0x079b: ih_no_fwmthd */ 718 740 0xf19d21f4, 719 - 0xbd0104b7, 741 + 0xbd0504b7, 720 742 0xb4abffb0, 721 743 0xf10f0bf4, 722 744 0xf0070007, 723 745 0x0bd00303, 724 - /* 0x075b: ih_no_other */ 746 + /* 0x07b3: ih_no_other */ 725 747 0xf104bd00, 726 748 0xf0010007, 727 749 0x0ad00003, ··· 753 731 0xfc90fca0, 754 732 0x0088fe80, 755 733 0x32f480fc, 756 - /* 0x077f: ctx_4160s */ 734 + /* 0x07d7: ctx_4160s */ 757 735 0xf001f800, 758 736 0xffb901f7, 759 737 0x60e7f102, 760 738 0x40e3f041, 761 - /* 0x078f: ctx_4160s_wait */ 739 + /* 0x07e7: ctx_4160s_wait */ 762 740 0xf19d21f4, 763 741 0xf04160e7, 764 742 0x21f440e3, 765 743 0x02ffb968, 766 744 0xf404ffc8, 767 745 0x00f8f00b, 768 - /* 0x07a4: ctx_4160c */ 746 + /* 0x07fc: ctx_4160c */ 769 747 0xffb9f4bd, 770 748 0x60e7f102, 771 749 0x40e3f041, 772 750 0xf89d21f4, 773 - /* 0x07b5: ctx_4170s */ 751 + /* 0x080d: ctx_4170s */ 774 752 0x10f5f000, 775 753 0xf102ffb9, 776 754 0xf04170e7, 777 755 0x21f440e3, 778 - /* 0x07c7: ctx_4170w */ 756 + /* 0x081f: ctx_4170w */ 779 757 0xf100f89d, 780 758 0xf04170e7, 781 759 0x21f440e3, 782 760 0x02ffb968, 783 761 0xf410f4f0, 784 762 0x00f8f01b, 785 - /* 0x07dc: ctx_redswitch */ 763 + /* 0x0834: ctx_redswitch */ 786 764 0x0200e7f1, 787 765 0xf040e5f0, 788 766 0xe5f020e5, ··· 790 768 0x0103f085, 791 769 0xbd000ed0, 792 770 0x08f7f004, 793 - /* 0x07f8: ctx_redswitch_delay */ 771 + /* 0x0850: ctx_redswitch_delay */ 794 772 0xf401f2b6, 795 773 0xe5f1fd1b, 796 774 0xe5f10400, ··· 798 776 0x03f08500, 799 777 0x000ed001, 800 778 0x00f804bd, 801 - /* 0x0814: ctx_86c */ 779 + /* 0x086c: ctx_86c */ 802 780 0x1b0007f1, 803 781 0xd00203f0, 804 782 0x04bd000f, ··· 809 787 0xa86ce7f1, 810 788 0xf441e3f0, 811 789 0x00f89d21, 812 - /* 0x083c: ctx_mem */ 790 + /* 0x0894: ctx_mem */ 813 791 0x840007f1, 814 792 0xd00203f0, 815 793 0x04bd000f, 816 - /* 0x0848: ctx_mem_wait */ 794 + /* 0x08a0: ctx_mem_wait */ 817 795 0x8400f7f1, 818 796 0xcf02f3f0, 819 797 0xfffd00ff, 820 798 0xf31bf405, 821 - /* 0x085a: ctx_load */ 799 + /* 0x08b2: ctx_load */ 822 800 0x94bd00f8, 823 801 0xf10599f0, 824 802 0xf00f0007, ··· 836 814 0x02d00203, 837 815 0xf004bd00, 838 816 0x21f507f7, 839 - 0x07f1083c, 817 + 0x07f10894, 840 818 0x03f0c000, 841 819 0x0002d002, 842 820 0x0bfe04bd, ··· 891 869 0x03f01700, 892 870 0x0009d002, 893 871 0x00f804bd, 894 - /* 0x0978: ctx_chan */ 895 - 0x077f21f5, 896 - 0x085a21f5, 872 + /* 0x09d0: ctx_chan */ 873 + 0x07d721f5, 874 + 0x08b221f5, 897 875 0xf40ca7f0, 898 876 0xf7f0d021, 899 - 0x3c21f505, 900 - 0xa421f508, 901 - /* 0x0993: ctx_mmio_exec */ 877 + 0x9421f505, 878 + 0xfc21f508, 879 + /* 0x09eb: ctx_mmio_exec */ 902 880 0x9800f807, 903 881 0x07f14103, 904 882 0x03f08100, 905 883 0x0003d002, 906 884 0x34bd04bd, 907 - /* 0x09a4: ctx_mmio_loop */ 885 + /* 0x09fc: ctx_mmio_loop */ 908 886 0xf4ff34c4, 909 887 0x57f10f1b, 910 888 0x53f00200, 911 889 0x0535fa06, 912 - /* 0x09b6: ctx_mmio_pull */ 890 + /* 0x0a0e: ctx_mmio_pull */ 913 891 0x4e9803f8, 914 892 0x814f9880, 915 893 0xb69d21f4, 916 894 0x12b60830, 917 895 0xdf1bf401, 918 - /* 0x09c8: ctx_mmio_done */ 896 + /* 0x0a20: ctx_mmio_done */ 919 897 0xf1160398, 920 898 0xf0810007, 921 899 0x03d00203, ··· 924 902 0x13f00100, 925 903 0x0601fa06, 926 904 0x00f803f8, 927 - /* 0x09e8: ctx_xfer */ 905 + /* 0x0a40: ctx_xfer */ 928 906 0xf104e7f0, 929 907 0xf0020007, 930 908 0x0ed00303, 931 - /* 0x09f7: ctx_xfer_idle */ 909 + /* 0x0a4f: ctx_xfer_idle */ 932 910 0xf104bd00, 933 911 0xf00000e7, 934 912 0xeecf03e3, 935 913 0x00e4f100, 936 914 0xf21bf420, 937 915 0xf40611f4, 938 - /* 0x0a0e: ctx_xfer_pre */ 916 + /* 0x0a66: ctx_xfer_pre */ 939 917 0xf7f01102, 940 - 0x1421f510, 941 - 0x7f21f508, 918 + 0x6c21f510, 919 + 0xd721f508, 942 920 0x1c11f407, 943 - /* 0x0a1c: ctx_xfer_pre_load */ 921 + /* 0x0a74: ctx_xfer_pre_load */ 944 922 0xf502f7f0, 945 - 0xf507b521, 946 - 0xf507c721, 947 - 0xbd07dc21, 948 - 0xb521f5f4, 949 - 0x5a21f507, 950 - /* 0x0a35: ctx_xfer_exec */ 923 + 0xf5080d21, 924 + 0xf5081f21, 925 + 0xbd083421, 926 + 0x0d21f5f4, 927 + 0xb221f508, 928 + /* 0x0a8d: ctx_xfer_exec */ 951 929 0x16019808, 952 930 0x07f124bd, 953 931 0x03f00500, ··· 982 960 0x1301f402, 983 961 0xf40ca7f0, 984 962 0xf7f0d021, 985 - 0x3c21f505, 963 + 0x9421f505, 986 964 0x3202f408, 987 - /* 0x0ac4: ctx_xfer_post */ 965 + /* 0x0b1c: ctx_xfer_post */ 988 966 0xf502f7f0, 989 - 0xbd07b521, 990 - 0x1421f5f4, 967 + 0xbd080d21, 968 + 0x6c21f5f4, 991 969 0x7f21f508, 992 - 0xc721f502, 993 - 0xf5f4bd07, 994 - 0xf407b521, 970 + 0x1f21f502, 971 + 0xf5f4bd08, 972 + 0xf4080d21, 995 973 0x01981011, 996 974 0x0511fd40, 997 975 0xf5070bf4, 998 - /* 0x0aef: ctx_xfer_no_post_mmio */ 999 - 0xf5099321, 1000 - /* 0x0af3: ctx_xfer_done */ 1001 - 0xf807a421, 976 + /* 0x0b47: ctx_xfer_no_post_mmio */ 977 + 0xf509eb21, 978 + /* 0x0b4b: ctx_xfer_done */ 979 + 0xf807fc21, 980 + 0x00000000, 981 + 0x00000000, 982 + 0x00000000, 983 + 0x00000000, 984 + 0x00000000, 985 + 0x00000000, 986 + 0x00000000, 987 + 0x00000000, 988 + 0x00000000, 989 + 0x00000000, 990 + 0x00000000, 991 + 0x00000000, 992 + 0x00000000, 993 + 0x00000000, 994 + 0x00000000, 995 + 0x00000000, 996 + 0x00000000, 997 + 0x00000000, 998 + 0x00000000, 999 + 0x00000000, 1000 + 0x00000000, 1001 + 0x00000000, 1002 + 0x00000000, 1003 + 0x00000000, 1004 + 0x00000000, 1005 + 0x00000000, 1006 + 0x00000000, 1007 + 0x00000000, 1008 + 0x00000000, 1009 + 0x00000000, 1010 + 0x00000000, 1011 + 0x00000000, 1012 + 0x00000000, 1013 + 0x00000000, 1014 + 0x00000000, 1015 + 0x00000000, 1016 + 0x00000000, 1017 + 0x00000000, 1018 + 0x00000000, 1019 + 0x00000000, 1020 + 0x00000000, 1021 + 0x00000000, 1002 1022 0x00000000, 1003 1023 0x00000000, 1004 1024 0x00000000,
+117 -53
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h
··· 528 528 0x0001d001, 529 529 0x17f104bd, 530 530 0xf7f00100, 531 - 0x7f21f502, 532 - 0x9121f507, 531 + 0xd721f502, 532 + 0xe921f507, 533 533 0x10f7f007, 534 - 0x07de21f5, 534 + 0x083621f5, 535 535 0x98000e98, 536 536 0x21f5010f, 537 537 0x14950150, ··· 574 574 0xb6800040, 575 575 0x1bf40132, 576 576 0x00f7f0be, 577 - 0x07de21f5, 577 + 0x083621f5, 578 578 0xf500f7f0, 579 - 0xf1077f21, 579 + 0xf107d721, 580 580 0xf0010007, 581 581 0x01d00203, 582 582 0xbd04bd00, ··· 610 610 0x09d00203, 611 611 0xf404bd00, 612 612 0x31f40132, 613 - 0xaa21f502, 614 - 0xf094bd09, 613 + 0x0221f502, 614 + 0xf094bd0a, 615 615 0x07f10799, 616 616 0x03f01700, 617 617 0x0009d002, ··· 621 621 0x0203f00f, 622 622 0xbd0009d0, 623 623 0x0131f404, 624 - 0x09aa21f5, 624 + 0x0a0221f5, 625 625 0x99f094bd, 626 626 0x0007f106, 627 627 0x0203f017, ··· 631 631 0x12b920f9, 632 632 0x0132f402, 633 633 0xf50232f4, 634 - 0xfc09aa21, 634 + 0xfc0a0221, 635 635 0x0007f120, 636 636 0x0203f0c0, 637 637 0xbd0002d0, ··· 640 640 0xf41f23c8, 641 641 0x31f40d0b, 642 642 0x0232f401, 643 - 0x09aa21f5, 643 + 0x0a0221f5, 644 644 /* 0x063c: chsw_done */ 645 645 0xf10127f0, 646 646 0xf0c30007, ··· 654 654 /* 0x0660: main_not_ctx_switch */ 655 655 0xf401e4b0, 656 656 0xf2b90d1b, 657 - 0x4221f502, 657 + 0x9a21f502, 658 658 0x460ef409, 659 659 /* 0x0670: main_not_ctx_chan */ 660 660 0xf402e4b0, ··· 664 664 0x09d00203, 665 665 0xf404bd00, 666 666 0x32f40132, 667 - 0xaa21f502, 668 - 0xf094bd09, 667 + 0x0221f502, 668 + 0xf094bd0a, 669 669 0x07f10799, 670 670 0x03f01700, 671 671 0x0009d002, ··· 710 710 /* 0x072b: ih_no_ctxsw */ 711 711 0xe40421f4, 712 712 0xf40400ab, 713 - 0xb7f1140b, 713 + 0xe7f16c0b, 714 + 0xe3f00708, 715 + 0x6821f440, 716 + 0xf102ffb9, 717 + 0xf0040007, 718 + 0x0fd00203, 719 + 0xf104bd00, 720 + 0xf00704e7, 721 + 0x21f440e3, 722 + 0x02ffb968, 723 + 0x030007f1, 724 + 0xd00203f0, 725 + 0x04bd000f, 726 + 0x9450fec7, 727 + 0xf7f102ee, 728 + 0xf3f00700, 729 + 0x00efbb40, 730 + 0xf16821f4, 731 + 0xf0020007, 732 + 0x0fd00203, 733 + 0xf004bd00, 734 + 0x21f503f7, 735 + 0xb7f1037e, 714 736 0xbfb90100, 715 737 0x44e7f102, 716 738 0x40e3f001, 717 - /* 0x0743: ih_no_fwmthd */ 739 + /* 0x079b: ih_no_fwmthd */ 718 740 0xf19d21f4, 719 - 0xbd0104b7, 741 + 0xbd0504b7, 720 742 0xb4abffb0, 721 743 0xf10f0bf4, 722 744 0xf0070007, 723 745 0x0bd00303, 724 - /* 0x075b: ih_no_other */ 746 + /* 0x07b3: ih_no_other */ 725 747 0xf104bd00, 726 748 0xf0010007, 727 749 0x0ad00003, ··· 753 731 0xfc90fca0, 754 732 0x0088fe80, 755 733 0x32f480fc, 756 - /* 0x077f: ctx_4170s */ 734 + /* 0x07d7: ctx_4170s */ 757 735 0xf001f800, 758 736 0xffb910f5, 759 737 0x70e7f102, 760 738 0x40e3f041, 761 739 0xf89d21f4, 762 - /* 0x0791: ctx_4170w */ 740 + /* 0x07e9: ctx_4170w */ 763 741 0x70e7f100, 764 742 0x40e3f041, 765 743 0xb96821f4, 766 744 0xf4f002ff, 767 745 0xf01bf410, 768 - /* 0x07a6: ctx_redswitch */ 746 + /* 0x07fe: ctx_redswitch */ 769 747 0xe7f100f8, 770 748 0xe5f00200, 771 749 0x20e5f040, ··· 773 751 0xf0850007, 774 752 0x0ed00103, 775 753 0xf004bd00, 776 - /* 0x07c2: ctx_redswitch_delay */ 754 + /* 0x081a: ctx_redswitch_delay */ 777 755 0xf2b608f7, 778 756 0xfd1bf401, 779 757 0x0400e5f1, ··· 781 759 0x850007f1, 782 760 0xd00103f0, 783 761 0x04bd000e, 784 - /* 0x07de: ctx_86c */ 762 + /* 0x0836: ctx_86c */ 785 763 0x07f100f8, 786 764 0x03f01b00, 787 765 0x000fd002, ··· 792 770 0xe7f102ff, 793 771 0xe3f0a86c, 794 772 0x9d21f441, 795 - /* 0x0806: ctx_mem */ 773 + /* 0x085e: ctx_mem */ 796 774 0x07f100f8, 797 775 0x03f08400, 798 776 0x000fd002, 799 - /* 0x0812: ctx_mem_wait */ 777 + /* 0x086a: ctx_mem_wait */ 800 778 0xf7f104bd, 801 779 0xf3f08400, 802 780 0x00ffcf02, 803 781 0xf405fffd, 804 782 0x00f8f31b, 805 - /* 0x0824: ctx_load */ 783 + /* 0x087c: ctx_load */ 806 784 0x99f094bd, 807 785 0x0007f105, 808 786 0x0203f00f, ··· 819 797 0x0203f083, 820 798 0xbd0002d0, 821 799 0x07f7f004, 822 - 0x080621f5, 800 + 0x085e21f5, 823 801 0xc00007f1, 824 802 0xd00203f0, 825 803 0x04bd0002, ··· 874 852 0x170007f1, 875 853 0xd00203f0, 876 854 0x04bd0009, 877 - /* 0x0942: ctx_chan */ 855 + /* 0x099a: ctx_chan */ 878 856 0x21f500f8, 879 - 0xa7f00824, 857 + 0xa7f0087c, 880 858 0xd021f40c, 881 859 0xf505f7f0, 882 - 0xf8080621, 883 - /* 0x0955: ctx_mmio_exec */ 860 + 0xf8085e21, 861 + /* 0x09ad: ctx_mmio_exec */ 884 862 0x41039800, 885 863 0x810007f1, 886 864 0xd00203f0, 887 865 0x04bd0003, 888 - /* 0x0966: ctx_mmio_loop */ 866 + /* 0x09be: ctx_mmio_loop */ 889 867 0x34c434bd, 890 868 0x0f1bf4ff, 891 869 0x020057f1, 892 870 0xfa0653f0, 893 871 0x03f80535, 894 - /* 0x0978: ctx_mmio_pull */ 872 + /* 0x09d0: ctx_mmio_pull */ 895 873 0x98804e98, 896 874 0x21f4814f, 897 875 0x0830b69d, 898 876 0xf40112b6, 899 - /* 0x098a: ctx_mmio_done */ 877 + /* 0x09e2: ctx_mmio_done */ 900 878 0x0398df1b, 901 879 0x0007f116, 902 880 0x0203f081, ··· 905 883 0x010017f1, 906 884 0xfa0613f0, 907 885 0x03f80601, 908 - /* 0x09aa: ctx_xfer */ 886 + /* 0x0a02: ctx_xfer */ 909 887 0xe7f000f8, 910 888 0x0007f104, 911 889 0x0303f002, 912 890 0xbd000ed0, 913 - /* 0x09b9: ctx_xfer_idle */ 891 + /* 0x0a11: ctx_xfer_idle */ 914 892 0x00e7f104, 915 893 0x03e3f000, 916 894 0xf100eecf, 917 895 0xf42000e4, 918 896 0x11f4f21b, 919 897 0x0d02f406, 920 - /* 0x09d0: ctx_xfer_pre */ 898 + /* 0x0a28: ctx_xfer_pre */ 921 899 0xf510f7f0, 922 - 0xf407de21, 923 - /* 0x09da: ctx_xfer_pre_load */ 900 + 0xf4083621, 901 + /* 0x0a32: ctx_xfer_pre_load */ 924 902 0xf7f01c11, 925 - 0x7f21f502, 926 - 0x9121f507, 927 - 0xa621f507, 903 + 0xd721f502, 904 + 0xe921f507, 905 + 0xfe21f507, 928 906 0xf5f4bd07, 929 - 0xf5077f21, 930 - /* 0x09f3: ctx_xfer_exec */ 931 - 0x98082421, 907 + 0xf507d721, 908 + /* 0x0a4b: ctx_xfer_exec */ 909 + 0x98087c21, 932 910 0x24bd1601, 933 911 0x050007f1, 934 912 0xd00103f0, ··· 963 941 0xa7f01301, 964 942 0xd021f40c, 965 943 0xf505f7f0, 966 - 0xf4080621, 967 - /* 0x0a82: ctx_xfer_post */ 944 + 0xf4085e21, 945 + /* 0x0ada: ctx_xfer_post */ 968 946 0xf7f02e02, 969 - 0x7f21f502, 947 + 0xd721f502, 970 948 0xf5f4bd07, 971 - 0xf507de21, 949 + 0xf5083621, 972 950 0xf5027f21, 973 - 0xbd079121, 974 - 0x7f21f5f4, 951 + 0xbd07e921, 952 + 0xd721f5f4, 975 953 0x1011f407, 976 954 0xfd400198, 977 955 0x0bf40511, 978 - 0x5521f507, 979 - /* 0x0aad: ctx_xfer_no_post_mmio */ 980 - /* 0x0aad: ctx_xfer_done */ 956 + 0xad21f507, 957 + /* 0x0b05: ctx_xfer_no_post_mmio */ 958 + /* 0x0b05: ctx_xfer_done */ 981 959 0x0000f809, 960 + 0x00000000, 961 + 0x00000000, 962 + 0x00000000, 963 + 0x00000000, 964 + 0x00000000, 965 + 0x00000000, 966 + 0x00000000, 967 + 0x00000000, 968 + 0x00000000, 969 + 0x00000000, 970 + 0x00000000, 971 + 0x00000000, 972 + 0x00000000, 973 + 0x00000000, 974 + 0x00000000, 975 + 0x00000000, 976 + 0x00000000, 977 + 0x00000000, 978 + 0x00000000, 979 + 0x00000000, 980 + 0x00000000, 981 + 0x00000000, 982 + 0x00000000, 983 + 0x00000000, 984 + 0x00000000, 985 + 0x00000000, 986 + 0x00000000, 987 + 0x00000000, 988 + 0x00000000, 989 + 0x00000000, 990 + 0x00000000, 991 + 0x00000000, 992 + 0x00000000, 993 + 0x00000000, 994 + 0x00000000, 995 + 0x00000000, 996 + 0x00000000, 997 + 0x00000000, 998 + 0x00000000, 999 + 0x00000000, 1000 + 0x00000000, 1001 + 0x00000000, 982 1002 0x00000000, 983 1003 0x00000000, 984 1004 0x00000000,
+117 -53
drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h
··· 528 528 0x0001d001, 529 529 0x17f104bd, 530 530 0xf7f00100, 531 - 0x7f21f502, 532 - 0x9121f507, 531 + 0xd721f502, 532 + 0xe921f507, 533 533 0x10f7f007, 534 - 0x07de21f5, 534 + 0x083621f5, 535 535 0x98000e98, 536 536 0x21f5010f, 537 537 0x14950150, ··· 574 574 0xb6800040, 575 575 0x1bf40132, 576 576 0x00f7f0be, 577 - 0x07de21f5, 577 + 0x083621f5, 578 578 0xf500f7f0, 579 - 0xf1077f21, 579 + 0xf107d721, 580 580 0xf0010007, 581 581 0x01d00203, 582 582 0xbd04bd00, ··· 610 610 0x09d00203, 611 611 0xf404bd00, 612 612 0x31f40132, 613 - 0xaa21f502, 614 - 0xf094bd09, 613 + 0x0221f502, 614 + 0xf094bd0a, 615 615 0x07f10799, 616 616 0x03f01700, 617 617 0x0009d002, ··· 621 621 0x0203f037, 622 622 0xbd0009d0, 623 623 0x0131f404, 624 - 0x09aa21f5, 624 + 0x0a0221f5, 625 625 0x99f094bd, 626 626 0x0007f106, 627 627 0x0203f017, ··· 631 631 0x12b920f9, 632 632 0x0132f402, 633 633 0xf50232f4, 634 - 0xfc09aa21, 634 + 0xfc0a0221, 635 635 0x0007f120, 636 636 0x0203f0c0, 637 637 0xbd0002d0, ··· 640 640 0xf41f23c8, 641 641 0x31f40d0b, 642 642 0x0232f401, 643 - 0x09aa21f5, 643 + 0x0a0221f5, 644 644 /* 0x063c: chsw_done */ 645 645 0xf10127f0, 646 646 0xf0c30007, ··· 654 654 /* 0x0660: main_not_ctx_switch */ 655 655 0xf401e4b0, 656 656 0xf2b90d1b, 657 - 0x4221f502, 657 + 0x9a21f502, 658 658 0x460ef409, 659 659 /* 0x0670: main_not_ctx_chan */ 660 660 0xf402e4b0, ··· 664 664 0x09d00203, 665 665 0xf404bd00, 666 666 0x32f40132, 667 - 0xaa21f502, 668 - 0xf094bd09, 667 + 0x0221f502, 668 + 0xf094bd0a, 669 669 0x07f10799, 670 670 0x03f01700, 671 671 0x0009d002, ··· 710 710 /* 0x072b: ih_no_ctxsw */ 711 711 0xe40421f4, 712 712 0xf40400ab, 713 - 0xb7f1140b, 713 + 0xe7f16c0b, 714 + 0xe3f00708, 715 + 0x6821f440, 716 + 0xf102ffb9, 717 + 0xf0040007, 718 + 0x0fd00203, 719 + 0xf104bd00, 720 + 0xf00704e7, 721 + 0x21f440e3, 722 + 0x02ffb968, 723 + 0x030007f1, 724 + 0xd00203f0, 725 + 0x04bd000f, 726 + 0x9450fec7, 727 + 0xf7f102ee, 728 + 0xf3f00700, 729 + 0x00efbb40, 730 + 0xf16821f4, 731 + 0xf0020007, 732 + 0x0fd00203, 733 + 0xf004bd00, 734 + 0x21f503f7, 735 + 0xb7f1037e, 714 736 0xbfb90100, 715 737 0x44e7f102, 716 738 0x40e3f001, 717 - /* 0x0743: ih_no_fwmthd */ 739 + /* 0x079b: ih_no_fwmthd */ 718 740 0xf19d21f4, 719 - 0xbd0104b7, 741 + 0xbd0504b7, 720 742 0xb4abffb0, 721 743 0xf10f0bf4, 722 744 0xf0070007, 723 745 0x0bd00303, 724 - /* 0x075b: ih_no_other */ 746 + /* 0x07b3: ih_no_other */ 725 747 0xf104bd00, 726 748 0xf0010007, 727 749 0x0ad00003, ··· 753 731 0xfc90fca0, 754 732 0x0088fe80, 755 733 0x32f480fc, 756 - /* 0x077f: ctx_4170s */ 734 + /* 0x07d7: ctx_4170s */ 757 735 0xf001f800, 758 736 0xffb910f5, 759 737 0x70e7f102, 760 738 0x40e3f041, 761 739 0xf89d21f4, 762 - /* 0x0791: ctx_4170w */ 740 + /* 0x07e9: ctx_4170w */ 763 741 0x70e7f100, 764 742 0x40e3f041, 765 743 0xb96821f4, 766 744 0xf4f002ff, 767 745 0xf01bf410, 768 - /* 0x07a6: ctx_redswitch */ 746 + /* 0x07fe: ctx_redswitch */ 769 747 0xe7f100f8, 770 748 0xe5f00200, 771 749 0x20e5f040, ··· 773 751 0xf0850007, 774 752 0x0ed00103, 775 753 0xf004bd00, 776 - /* 0x07c2: ctx_redswitch_delay */ 754 + /* 0x081a: ctx_redswitch_delay */ 777 755 0xf2b608f7, 778 756 0xfd1bf401, 779 757 0x0400e5f1, ··· 781 759 0x850007f1, 782 760 0xd00103f0, 783 761 0x04bd000e, 784 - /* 0x07de: ctx_86c */ 762 + /* 0x0836: ctx_86c */ 785 763 0x07f100f8, 786 764 0x03f02300, 787 765 0x000fd002, ··· 792 770 0xe7f102ff, 793 771 0xe3f0a88c, 794 772 0x9d21f441, 795 - /* 0x0806: ctx_mem */ 773 + /* 0x085e: ctx_mem */ 796 774 0x07f100f8, 797 775 0x03f08400, 798 776 0x000fd002, 799 - /* 0x0812: ctx_mem_wait */ 777 + /* 0x086a: ctx_mem_wait */ 800 778 0xf7f104bd, 801 779 0xf3f08400, 802 780 0x00ffcf02, 803 781 0xf405fffd, 804 782 0x00f8f31b, 805 - /* 0x0824: ctx_load */ 783 + /* 0x087c: ctx_load */ 806 784 0x99f094bd, 807 785 0x0007f105, 808 786 0x0203f037, ··· 819 797 0x0203f083, 820 798 0xbd0002d0, 821 799 0x07f7f004, 822 - 0x080621f5, 800 + 0x085e21f5, 823 801 0xc00007f1, 824 802 0xd00203f0, 825 803 0x04bd0002, ··· 874 852 0x170007f1, 875 853 0xd00203f0, 876 854 0x04bd0009, 877 - /* 0x0942: ctx_chan */ 855 + /* 0x099a: ctx_chan */ 878 856 0x21f500f8, 879 - 0xa7f00824, 857 + 0xa7f0087c, 880 858 0xd021f40c, 881 859 0xf505f7f0, 882 - 0xf8080621, 883 - /* 0x0955: ctx_mmio_exec */ 860 + 0xf8085e21, 861 + /* 0x09ad: ctx_mmio_exec */ 884 862 0x41039800, 885 863 0x810007f1, 886 864 0xd00203f0, 887 865 0x04bd0003, 888 - /* 0x0966: ctx_mmio_loop */ 866 + /* 0x09be: ctx_mmio_loop */ 889 867 0x34c434bd, 890 868 0x0f1bf4ff, 891 869 0x020057f1, 892 870 0xfa0653f0, 893 871 0x03f80535, 894 - /* 0x0978: ctx_mmio_pull */ 872 + /* 0x09d0: ctx_mmio_pull */ 895 873 0x98804e98, 896 874 0x21f4814f, 897 875 0x0830b69d, 898 876 0xf40112b6, 899 - /* 0x098a: ctx_mmio_done */ 877 + /* 0x09e2: ctx_mmio_done */ 900 878 0x0398df1b, 901 879 0x0007f116, 902 880 0x0203f081, ··· 905 883 0x010017f1, 906 884 0xfa0613f0, 907 885 0x03f80601, 908 - /* 0x09aa: ctx_xfer */ 886 + /* 0x0a02: ctx_xfer */ 909 887 0xe7f000f8, 910 888 0x0007f104, 911 889 0x0303f002, 912 890 0xbd000ed0, 913 - /* 0x09b9: ctx_xfer_idle */ 891 + /* 0x0a11: ctx_xfer_idle */ 914 892 0x00e7f104, 915 893 0x03e3f000, 916 894 0xf100eecf, 917 895 0xf42000e4, 918 896 0x11f4f21b, 919 897 0x0d02f406, 920 - /* 0x09d0: ctx_xfer_pre */ 898 + /* 0x0a28: ctx_xfer_pre */ 921 899 0xf510f7f0, 922 - 0xf407de21, 923 - /* 0x09da: ctx_xfer_pre_load */ 900 + 0xf4083621, 901 + /* 0x0a32: ctx_xfer_pre_load */ 924 902 0xf7f01c11, 925 - 0x7f21f502, 926 - 0x9121f507, 927 - 0xa621f507, 903 + 0xd721f502, 904 + 0xe921f507, 905 + 0xfe21f507, 928 906 0xf5f4bd07, 929 - 0xf5077f21, 930 - /* 0x09f3: ctx_xfer_exec */ 931 - 0x98082421, 907 + 0xf507d721, 908 + /* 0x0a4b: ctx_xfer_exec */ 909 + 0x98087c21, 932 910 0x24bd1601, 933 911 0x050007f1, 934 912 0xd00103f0, ··· 963 941 0xa7f01301, 964 942 0xd021f40c, 965 943 0xf505f7f0, 966 - 0xf4080621, 967 - /* 0x0a82: ctx_xfer_post */ 944 + 0xf4085e21, 945 + /* 0x0ada: ctx_xfer_post */ 968 946 0xf7f02e02, 969 - 0x7f21f502, 947 + 0xd721f502, 970 948 0xf5f4bd07, 971 - 0xf507de21, 949 + 0xf5083621, 972 950 0xf5027f21, 973 - 0xbd079121, 974 - 0x7f21f5f4, 951 + 0xbd07e921, 952 + 0xd721f5f4, 975 953 0x1011f407, 976 954 0xfd400198, 977 955 0x0bf40511, 978 - 0x5521f507, 979 - /* 0x0aad: ctx_xfer_no_post_mmio */ 980 - /* 0x0aad: ctx_xfer_done */ 956 + 0xad21f507, 957 + /* 0x0b05: ctx_xfer_no_post_mmio */ 958 + /* 0x0b05: ctx_xfer_done */ 981 959 0x0000f809, 960 + 0x00000000, 961 + 0x00000000, 962 + 0x00000000, 963 + 0x00000000, 964 + 0x00000000, 965 + 0x00000000, 966 + 0x00000000, 967 + 0x00000000, 968 + 0x00000000, 969 + 0x00000000, 970 + 0x00000000, 971 + 0x00000000, 972 + 0x00000000, 973 + 0x00000000, 974 + 0x00000000, 975 + 0x00000000, 976 + 0x00000000, 977 + 0x00000000, 978 + 0x00000000, 979 + 0x00000000, 980 + 0x00000000, 981 + 0x00000000, 982 + 0x00000000, 983 + 0x00000000, 984 + 0x00000000, 985 + 0x00000000, 986 + 0x00000000, 987 + 0x00000000, 988 + 0x00000000, 989 + 0x00000000, 990 + 0x00000000, 991 + 0x00000000, 992 + 0x00000000, 993 + 0x00000000, 994 + 0x00000000, 995 + 0x00000000, 996 + 0x00000000, 997 + 0x00000000, 998 + 0x00000000, 999 + 0x00000000, 1000 + 0x00000000, 1001 + 0x00000000, 982 1002 0x00000000, 983 1003 0x00000000, 984 1004 0x00000000,
+6
drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc
··· 30 30 #define GK110 0xf0 31 31 #define GK208 0x108 32 32 33 + #define NV_PGRAPH_TRAPPED_ADDR 0x400704 34 + #define NV_PGRAPH_TRAPPED_DATA_LO 0x400708 35 + #define NV_PGRAPH_TRAPPED_DATA_HI 0x40070c 36 + 37 + #define NV_PGRAPH_FE_OBJECT_TABLE(n) ((n) * 4 + 0x400700) 38 + 33 39 #define NV_PGRAPH_FECS_INTR_ACK 0x409004 34 40 #define NV_PGRAPH_FECS_INTR 0x409008 35 41 #define NV_PGRAPH_FECS_INTR_FWMTHD 0x00000400
+1
drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h
··· 3 3 4 4 #define E_BAD_COMMAND 0x00000001 5 5 #define E_CMD_OVERFLOW 0x00000002 6 + #define E_BAD_FWMTHD 0x00000003 6 7 7 8 #endif
+4 -5
drivers/gpu/drm/nouveau/core/engine/graph/nv50.c
··· 976 976 break; 977 977 case 0xa0: 978 978 default: 979 - nv_wr32(priv, 0x402cc0, 0x00000000); 980 979 if (nv_device(priv)->chipset == 0xa0 || 981 980 nv_device(priv)->chipset == 0xaa || 982 981 nv_device(priv)->chipset == 0xac) { ··· 990 991 991 992 /* zero out zcull regions */ 992 993 for (i = 0; i < 8; i++) { 993 - nv_wr32(priv, 0x402c20 + (i * 8), 0x00000000); 994 - nv_wr32(priv, 0x402c24 + (i * 8), 0x00000000); 995 - nv_wr32(priv, 0x402c28 + (i * 8), 0x00000000); 996 - nv_wr32(priv, 0x402c2c + (i * 8), 0x00000000); 994 + nv_wr32(priv, 0x402c20 + (i * 0x10), 0x00000000); 995 + nv_wr32(priv, 0x402c24 + (i * 0x10), 0x00000000); 996 + nv_wr32(priv, 0x402c28 + (i * 0x10), 0x00000000); 997 + nv_wr32(priv, 0x402c2c + (i * 0x10), 0x00000000); 997 998 } 998 999 return 0; 999 1000 }
+32 -9
drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
··· 789 789 static void 790 790 nvc0_graph_ctxctl_isr(struct nvc0_graph_priv *priv) 791 791 { 792 - u32 ustat = nv_rd32(priv, 0x409c18); 792 + u32 stat = nv_rd32(priv, 0x409c18); 793 793 794 - if (ustat & 0x00000001) 795 - nv_error(priv, "CTXCTL ucode error\n"); 796 - if (ustat & 0x00080000) 797 - nv_error(priv, "CTXCTL watchdog timeout\n"); 798 - if (ustat & ~0x00080001) 799 - nv_error(priv, "CTXCTL 0x%08x\n", ustat); 794 + if (stat & 0x00000001) { 795 + u32 code = nv_rd32(priv, 0x409814); 796 + if (code == E_BAD_FWMTHD) { 797 + u32 class = nv_rd32(priv, 0x409808); 798 + u32 addr = nv_rd32(priv, 0x40980c); 799 + u32 subc = (addr & 0x00070000) >> 16; 800 + u32 mthd = (addr & 0x00003ffc); 801 + u32 data = nv_rd32(priv, 0x409810); 800 802 801 - nvc0_graph_ctxctl_debug(priv); 802 - nv_wr32(priv, 0x409c20, ustat); 803 + nv_error(priv, "FECS MTHD subc %d class 0x%04x " 804 + "mthd 0x%04x data 0x%08x\n", 805 + subc, class, mthd, data); 806 + 807 + nv_wr32(priv, 0x409c20, 0x00000001); 808 + stat &= ~0x00000001; 809 + } else { 810 + nv_error(priv, "FECS ucode error %d\n", code); 811 + } 812 + } 813 + 814 + if (stat & 0x00080000) { 815 + nv_error(priv, "FECS watchdog timeout\n"); 816 + nvc0_graph_ctxctl_debug(priv); 817 + nv_wr32(priv, 0x409c20, 0x00080000); 818 + stat &= ~0x00080000; 819 + } 820 + 821 + if (stat) { 822 + nv_error(priv, "FECS 0x%08x\n", stat); 823 + nvc0_graph_ctxctl_debug(priv); 824 + nv_wr32(priv, 0x409c20, stat); 825 + } 803 826 } 804 827 805 828 static void
+2
drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h
··· 38 38 #include <engine/fifo.h> 39 39 #include <engine/graph.h> 40 40 41 + #include "fuc/os.h" 42 + 41 43 #define GPC_MAX 32 42 44 #define TPC_MAX (GPC_MAX * 8) 43 45
+1
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
··· 84 84 extern struct nouveau_oclass *nv50_i2c_oclass; 85 85 extern struct nouveau_oclass *nv94_i2c_oclass; 86 86 extern struct nouveau_oclass *nvd0_i2c_oclass; 87 + extern struct nouveau_oclass *gf117_i2c_oclass; 87 88 extern struct nouveau_oclass *nve0_i2c_oclass; 88 89 89 90 static inline int
+5 -3
drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c
··· 307 307 info->dsrc = src0; 308 308 if (div0) { 309 309 info->ddiv |= 0x80000000; 310 - info->ddiv |= div0 << 8; 311 310 info->ddiv |= div0; 312 311 } 313 312 if (div1D) { ··· 351 352 { 352 353 struct nve0_clock_info *info = &priv->eng[clk]; 353 354 if (!info->ssel) { 354 - nv_mask(priv, 0x1371d0 + (clk * 0x04), 0x80003f3f, info->ddiv); 355 + nv_mask(priv, 0x1371d0 + (clk * 0x04), 0x8000003f, info->ddiv); 355 356 nv_wr32(priv, 0x137160 + (clk * 0x04), info->dsrc); 356 357 } 357 358 } ··· 388 389 nve0_clock_prog_3(struct nve0_clock_priv *priv, int clk) 389 390 { 390 391 struct nve0_clock_info *info = &priv->eng[clk]; 391 - nv_mask(priv, 0x137250 + (clk * 0x04), 0x00003f3f, info->mdiv); 392 + if (info->ssel) 393 + nv_mask(priv, 0x137250 + (clk * 0x04), 0x00003f00, info->mdiv); 394 + else 395 + nv_mask(priv, 0x137250 + (clk * 0x04), 0x0000003f, info->mdiv); 392 396 } 393 397 394 398 static void
+38 -38
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
··· 262 262 struct nve0_ram *ram = (void *)pfb->ram; 263 263 struct nve0_ramfuc *fuc = &ram->fuc; 264 264 struct nouveau_ram_data *next = ram->base.next; 265 - int vc = !(next->bios.ramcfg_11_02_08); 266 - int mv = !(next->bios.ramcfg_11_02_04); 265 + int vc = !next->bios.ramcfg_11_02_08; 266 + int mv = !next->bios.ramcfg_11_02_04; 267 267 u32 mask, data; 268 268 269 269 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ··· 370 370 } 371 371 } 372 372 373 - if ( (next->bios.ramcfg_11_02_40) || 374 - (next->bios.ramcfg_11_07_10)) { 373 + if (next->bios.ramcfg_11_02_40 || 374 + next->bios.ramcfg_11_07_10) { 375 375 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); 376 376 ram_nsec(fuc, 20000); 377 377 } ··· 417 417 ram_mask(fuc, 0x10f694, 0xff00ff00, data); 418 418 } 419 419 420 - if (ram->mode == 2 && (next->bios.ramcfg_11_08_10)) 420 + if (ram->mode == 2 && next->bios.ramcfg_11_08_10) 421 421 data = 0x00000080; 422 422 else 423 423 data = 0x00000000; ··· 425 425 426 426 mask = 0x00070000; 427 427 data = 0x00000000; 428 - if (!(next->bios.ramcfg_11_02_80)) 428 + if (!next->bios.ramcfg_11_02_80) 429 429 data |= 0x03000000; 430 - if (!(next->bios.ramcfg_11_02_40)) 430 + if (!next->bios.ramcfg_11_02_40) 431 431 data |= 0x00002000; 432 - if (!(next->bios.ramcfg_11_07_10)) 432 + if (!next->bios.ramcfg_11_07_10) 433 433 data |= 0x00004000; 434 - if (!(next->bios.ramcfg_11_07_08)) 434 + if (!next->bios.ramcfg_11_07_08) 435 435 data |= 0x00000003; 436 436 else 437 437 data |= 0x74000000; ··· 486 486 487 487 data = mask = 0x00000000; 488 488 if (NOTE00(ramcfg_02_03 != 0)) { 489 - data |= (next->bios.ramcfg_11_02_03) << 8; 489 + data |= next->bios.ramcfg_11_02_03 << 8; 490 490 mask |= 0x00000300; 491 491 } 492 492 if (NOTE00(ramcfg_01_10)) { ··· 498 498 499 499 data = mask = 0x00000000; 500 500 if (NOTE00(timing_30_07 != 0)) { 501 - data |= (next->bios.timing_20_30_07) << 28; 501 + data |= next->bios.timing_20_30_07 << 28; 502 502 mask |= 0x70000000; 503 503 } 504 504 if (NOTE00(ramcfg_01_01)) { ··· 510 510 511 511 data = mask = 0x00000000; 512 512 if (NOTE00(timing_30_07 != 0)) { 513 - data |= (next->bios.timing_20_30_07) << 28; 513 + data |= next->bios.timing_20_30_07 << 28; 514 514 mask |= 0x70000000; 515 515 } 516 516 if (NOTE00(ramcfg_01_02)) { ··· 522 522 523 523 mask = 0x33f00000; 524 524 data = 0x00000000; 525 - if (!(next->bios.ramcfg_11_01_04)) 525 + if (!next->bios.ramcfg_11_01_04) 526 526 data |= 0x20200000; 527 - if (!(next->bios.ramcfg_11_07_80)) 527 + if (!next->bios.ramcfg_11_07_80) 528 528 data |= 0x12800000; 529 529 /*XXX: see note above about there probably being some condition 530 530 * for the 10f824 stuff that uses ramcfg 3... 531 531 */ 532 - if ( (next->bios.ramcfg_11_03_f0)) { 532 + if (next->bios.ramcfg_11_03_f0) { 533 533 if (next->bios.rammap_11_08_0c) { 534 - if (!(next->bios.ramcfg_11_07_80)) 534 + if (!next->bios.ramcfg_11_07_80) 535 535 mask |= 0x00000020; 536 536 else 537 537 data |= 0x00000020; ··· 563 563 ram_wait(fuc, 0x100710, 0x80000000, 0x80000000, 200000); 564 564 } 565 565 566 - data = (next->bios.timing_20_30_07) << 8; 566 + data = next->bios.timing_20_30_07 << 8; 567 567 if (next->bios.ramcfg_11_01_01) 568 568 data |= 0x80000000; 569 569 ram_mask(fuc, 0x100778, 0x00000700, data); ··· 588 588 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ 589 589 ram_wr32(fuc, 0x10f210, 0x80000000); /* REFRESH_AUTO = 1 */ 590 590 591 - if ((next->bios.ramcfg_11_08_10) && (ram->mode == 2) /*XXX*/) { 591 + if (next->bios.ramcfg_11_08_10 && (ram->mode == 2) /*XXX*/) { 592 592 u32 temp = ram_mask(fuc, 0x10f294, 0xff000000, 0x24000000); 593 593 nve0_ram_train(fuc, 0xbc0e0000, 0xa4010000); /*XXX*/ 594 594 ram_nsec(fuc, 1000); ··· 621 621 data = ram_rd32(fuc, 0x10f978); 622 622 data &= ~0x00046144; 623 623 data |= 0x0000000b; 624 - if (!(next->bios.ramcfg_11_07_08)) { 625 - if (!(next->bios.ramcfg_11_07_04)) 624 + if (!next->bios.ramcfg_11_07_08) { 625 + if (!next->bios.ramcfg_11_07_04) 626 626 data |= 0x0000200c; 627 627 else 628 628 data |= 0x00000000; ··· 636 636 ram_wr32(fuc, 0x10f830, data); 637 637 } 638 638 639 - if (!(next->bios.ramcfg_11_07_08)) { 639 + if (!next->bios.ramcfg_11_07_08) { 640 640 data = 0x88020000; 641 - if ( (next->bios.ramcfg_11_07_04)) 641 + if ( next->bios.ramcfg_11_07_04) 642 642 data |= 0x10000000; 643 - if (!(next->bios.rammap_11_08_10)) 643 + if (!next->bios.rammap_11_08_10) 644 644 data |= 0x00080000; 645 645 } else { 646 646 data = 0xa40e0000; ··· 689 689 const u32 runk0 = ram->fN1 << 16; 690 690 const u32 runk1 = ram->fN1; 691 691 struct nouveau_ram_data *next = ram->base.next; 692 - int vc = !(next->bios.ramcfg_11_02_08); 693 - int mv = !(next->bios.ramcfg_11_02_04); 692 + int vc = !next->bios.ramcfg_11_02_08; 693 + int mv = !next->bios.ramcfg_11_02_04; 694 694 u32 mask, data; 695 695 696 696 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ··· 705 705 } 706 706 707 707 ram_mask(fuc, 0x10f200, 0x00000800, 0x00000000); 708 - if ((next->bios.ramcfg_11_03_f0)) 708 + if (next->bios.ramcfg_11_03_f0) 709 709 ram_mask(fuc, 0x10f808, 0x04000000, 0x04000000); 710 710 711 711 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ ··· 761 761 762 762 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010010); 763 763 data = ram_rd32(fuc, 0x1373ec) & ~0x00030000; 764 - data |= (next->bios.ramcfg_11_03_30) << 12; 764 + data |= next->bios.ramcfg_11_03_30 << 16; 765 765 ram_wr32(fuc, 0x1373ec, data); 766 766 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000000); 767 767 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000000); ··· 793 793 } 794 794 } 795 795 796 - if ( (next->bios.ramcfg_11_02_40) || 797 - (next->bios.ramcfg_11_07_10)) { 796 + if (next->bios.ramcfg_11_02_40 || 797 + next->bios.ramcfg_11_07_10) { 798 798 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); 799 799 ram_nsec(fuc, 20000); 800 800 } ··· 810 810 811 811 mask = 0x00010000; 812 812 data = 0x00000000; 813 - if (!(next->bios.ramcfg_11_02_80)) 813 + if (!next->bios.ramcfg_11_02_80) 814 814 data |= 0x03000000; 815 - if (!(next->bios.ramcfg_11_02_40)) 815 + if (!next->bios.ramcfg_11_02_40) 816 816 data |= 0x00002000; 817 - if (!(next->bios.ramcfg_11_07_10)) 817 + if (!next->bios.ramcfg_11_07_10) 818 818 data |= 0x00004000; 819 - if (!(next->bios.ramcfg_11_07_08)) 819 + if (!next->bios.ramcfg_11_07_08) 820 820 data |= 0x00000003; 821 821 else 822 822 data |= 0x14000000; ··· 844 844 845 845 mask = 0x33f00000; 846 846 data = 0x00000000; 847 - if (!(next->bios.ramcfg_11_01_04)) 847 + if (!next->bios.ramcfg_11_01_04) 848 848 data |= 0x20200000; 849 - if (!(next->bios.ramcfg_11_07_80)) 849 + if (!next->bios.ramcfg_11_07_80) 850 850 data |= 0x12800000; 851 851 /*XXX: see note above about there probably being some condition 852 852 * for the 10f824 stuff that uses ramcfg 3... 853 853 */ 854 - if ( (next->bios.ramcfg_11_03_f0)) { 854 + if (next->bios.ramcfg_11_03_f0) { 855 855 if (next->bios.rammap_11_08_0c) { 856 - if (!(next->bios.ramcfg_11_07_80)) 856 + if (!next->bios.ramcfg_11_07_80) 857 857 mask |= 0x00000020; 858 858 else 859 859 data |= 0x00000020; ··· 876 876 data = next->bios.timing_20_2c_1fc0; 877 877 ram_mask(fuc, 0x10f24c, 0x7f000000, data << 24); 878 878 879 - ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8); 879 + ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8 << 16); 880 880 881 881 ram_wr32(fuc, 0x10f090, 0x4000007f); 882 882 ram_nsec(fuc, 1000);
+39
drivers/gpu/drm/nouveau/core/subdev/i2c/gf117.c
··· 1 + /* 2 + * Copyright 2012 Red Hat Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + * Authors: Ben Skeggs 23 + */ 24 + 25 + #include "nv50.h" 26 + 27 + struct nouveau_oclass * 28 + gf117_i2c_oclass = &(struct nouveau_i2c_impl) { 29 + .base.handle = NV_SUBDEV(I2C, 0xd7), 30 + .base.ofuncs = &(struct nouveau_ofuncs) { 31 + .ctor = _nouveau_i2c_ctor, 32 + .dtor = _nouveau_i2c_dtor, 33 + .init = _nouveau_i2c_init, 34 + .fini = _nouveau_i2c_fini, 35 + }, 36 + .sclass = nvd0_i2c_sclass, 37 + .pad_x = &nv04_i2c_pad_oclass, 38 + .pad_s = &nv04_i2c_pad_oclass, 39 + }.base;
+18 -1
drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c
··· 95 95 } 96 96 97 97 static int 98 + nve0_ibus_init(struct nouveau_object *object) 99 + { 100 + struct nve0_ibus_priv *priv = (void *)object; 101 + int ret = nouveau_ibus_init(&priv->base); 102 + if (ret == 0) { 103 + nv_mask(priv, 0x122318, 0x0003ffff, 0x00001000); 104 + nv_mask(priv, 0x12231c, 0x0003ffff, 0x00000200); 105 + nv_mask(priv, 0x122310, 0x0003ffff, 0x00000800); 106 + nv_mask(priv, 0x122348, 0x0003ffff, 0x00000100); 107 + nv_mask(priv, 0x1223b0, 0x0003ffff, 0x00000fff); 108 + nv_mask(priv, 0x122348, 0x0003ffff, 0x00000200); 109 + nv_mask(priv, 0x122358, 0x0003ffff, 0x00002880); 110 + } 111 + return ret; 112 + } 113 + 114 + static int 98 115 nve0_ibus_ctor(struct nouveau_object *parent, struct nouveau_object *engine, 99 116 struct nouveau_oclass *oclass, void *data, u32 size, 100 117 struct nouveau_object **pobject) ··· 134 117 .ofuncs = &(struct nouveau_ofuncs) { 135 118 .ctor = nve0_ibus_ctor, 136 119 .dtor = _nouveau_ibus_dtor, 137 - .init = _nouveau_ibus_init, 120 + .init = nve0_ibus_init, 138 121 .fini = _nouveau_ibus_fini, 139 122 }, 140 123 };
+1 -1
drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc
··· 83 83 // increment GET 84 84 add b32 $r1 0x1 85 85 and $r14 $r1 #fifo_qmaskf 86 - nv_iowr(NV_PPWR_FIFO_GET(0), $r1) 86 + nv_iowr(NV_PPWR_FIFO_GET(0), $r14) 87 87 bra #host_send 88 88 host_send_done: 89 89 ret
+1 -1
drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h
··· 1018 1018 0xb600023f, 1019 1019 0x1ec40110, 1020 1020 0x04b0400f, 1021 - 0xbd0001f6, 1021 + 0xbd000ef6, 1022 1022 0xc70ef404, 1023 1023 /* 0x0328: host_send_done */ 1024 1024 /* 0x032a: host_recv */
+1 -1
drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h
··· 1124 1124 0x0f1ec401, 1125 1125 0x04b007f1, 1126 1126 0xd00604b6, 1127 - 0x04bd0001, 1127 + 0x04bd000e, 1128 1128 /* 0x03cb: host_send_done */ 1129 1129 0xf8ba0ef4, 1130 1130 /* 0x03cd: host_recv */
+1 -1
drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h
··· 1124 1124 0x0f1ec401, 1125 1125 0x04b007f1, 1126 1126 0xd00604b6, 1127 - 0x04bd0001, 1127 + 0x04bd000e, 1128 1128 /* 0x03cb: host_send_done */ 1129 1129 0xf8ba0ef4, 1130 1130 /* 0x03cd: host_recv */
+1 -1
drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h
··· 1033 1033 0xb6026b21, 1034 1034 0x1ec40110, 1035 1035 0xb007f10f, 1036 - 0x0001d004, 1036 + 0x000ed004, 1037 1037 0x0ef404bd, 1038 1038 /* 0x0365: host_send_done */ 1039 1039 /* 0x0367: host_recv */
+7
drivers/gpu/drm/nouveau/nouveau_display.c
··· 736 736 fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, 737 737 new_bo->bo.offset }; 738 738 739 + /* Keep vblanks on during flip, for the target crtc of this flip */ 740 + drm_vblank_get(dev, nouveau_crtc(crtc)->index); 741 + 739 742 /* Emit a page flip */ 740 743 if (nv_device(drm->device)->card_type >= NV_50) { 741 744 ret = nv50_display_flip_next(crtc, fb, chan, swap_interval); ··· 782 779 return 0; 783 780 784 781 fail_unreserve: 782 + drm_vblank_put(dev, nouveau_crtc(crtc)->index); 785 783 ttm_bo_unreserve(&old_bo->bo); 786 784 fail_unpin: 787 785 mutex_unlock(&chan->cli->mutex); ··· 820 816 821 817 drm_send_vblank_event(dev, crtcid, s->event); 822 818 } 819 + 820 + /* Give up ownership of vblank for page-flipped crtc */ 821 + drm_vblank_put(dev, s->crtc); 823 822 824 823 list_del(&s->head); 825 824 if (ps)
+101 -17
drivers/gpu/drm/radeon/atombios_crtc.c
··· 1052 1052 int encoder_mode = atombios_get_encoder_mode(radeon_crtc->encoder); 1053 1053 1054 1054 /* pass the actual clock to atombios_crtc_program_pll for DCE5,6 for HDMI */ 1055 - if (ASIC_IS_DCE5(rdev) && !ASIC_IS_DCE8(rdev) && 1055 + if (ASIC_IS_DCE5(rdev) && 1056 1056 (encoder_mode == ATOM_ENCODER_MODE_HDMI) && 1057 1057 (radeon_crtc->bpc > 8)) 1058 1058 clock = radeon_crtc->adjusted_clock; ··· 1136 1136 u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE); 1137 1137 u32 tmp, viewport_w, viewport_h; 1138 1138 int r; 1139 + bool bypass_lut = false; 1139 1140 1140 1141 /* no fb bound */ 1141 1142 if (!atomic && !crtc->primary->fb) { ··· 1175 1174 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL); 1176 1175 radeon_bo_unreserve(rbo); 1177 1176 1178 - switch (target_fb->bits_per_pixel) { 1179 - case 8: 1177 + switch (target_fb->pixel_format) { 1178 + case DRM_FORMAT_C8: 1180 1179 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_8BPP) | 1181 1180 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_INDEXED)); 1182 1181 break; 1183 - case 15: 1182 + case DRM_FORMAT_XRGB4444: 1183 + case DRM_FORMAT_ARGB4444: 1184 + fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1185 + EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB4444)); 1186 + #ifdef __BIG_ENDIAN 1187 + fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); 1188 + #endif 1189 + break; 1190 + case DRM_FORMAT_XRGB1555: 1191 + case DRM_FORMAT_ARGB1555: 1184 1192 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1185 1193 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB1555)); 1194 + #ifdef __BIG_ENDIAN 1195 + fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); 1196 + #endif 1186 1197 break; 1187 - case 16: 1198 + case DRM_FORMAT_BGRX5551: 1199 + case DRM_FORMAT_BGRA5551: 1200 + fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1201 + EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_BGRA5551)); 1202 + #ifdef __BIG_ENDIAN 1203 + fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); 1204 + #endif 1205 + break; 1206 + case DRM_FORMAT_RGB565: 1188 1207 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1189 1208 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB565)); 1190 1209 #ifdef __BIG_ENDIAN 1191 1210 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); 1192 1211 #endif 1193 1212 break; 1194 - case 24: 1195 - case 32: 1213 + case DRM_FORMAT_XRGB8888: 1214 + case DRM_FORMAT_ARGB8888: 1196 1215 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | 1197 1216 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888)); 1198 1217 #ifdef __BIG_ENDIAN 1199 1218 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); 1200 1219 #endif 1201 1220 break; 1221 + case DRM_FORMAT_XRGB2101010: 1222 + case DRM_FORMAT_ARGB2101010: 1223 + fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | 1224 + EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB2101010)); 1225 + #ifdef __BIG_ENDIAN 1226 + fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); 1227 + #endif 1228 + /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */ 1229 + bypass_lut = true; 1230 + break; 1231 + case DRM_FORMAT_BGRX1010102: 1232 + case DRM_FORMAT_BGRA1010102: 1233 + fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | 1234 + EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_BGRA1010102)); 1235 + #ifdef __BIG_ENDIAN 1236 + fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); 1237 + #endif 1238 + /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */ 1239 + bypass_lut = true; 1240 + break; 1202 1241 default: 1203 - DRM_ERROR("Unsupported screen depth %d\n", 1204 - target_fb->bits_per_pixel); 1242 + DRM_ERROR("Unsupported screen format %s\n", 1243 + drm_get_format_name(target_fb->pixel_format)); 1205 1244 return -EINVAL; 1206 1245 } 1207 1246 ··· 1370 1329 WREG32(EVERGREEN_GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); 1371 1330 WREG32(EVERGREEN_GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); 1372 1331 1332 + /* 1333 + * The LUT only has 256 slots for indexing by a 8 bpc fb. Bypass the LUT 1334 + * for > 8 bpc scanout to avoid truncation of fb indices to 8 msb's, to 1335 + * retain the full precision throughout the pipeline. 1336 + */ 1337 + WREG32_P(EVERGREEN_GRPH_LUT_10BIT_BYPASS_CONTROL + radeon_crtc->crtc_offset, 1338 + (bypass_lut ? EVERGREEN_LUT_10BIT_BYPASS_EN : 0), 1339 + ~EVERGREEN_LUT_10BIT_BYPASS_EN); 1340 + 1341 + if (bypass_lut) 1342 + DRM_DEBUG_KMS("Bypassing hardware LUT due to 10 bit fb scanout.\n"); 1343 + 1373 1344 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); 1374 1345 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); 1375 1346 WREG32(EVERGREEN_GRPH_X_START + radeon_crtc->crtc_offset, 0); ··· 1449 1396 u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE; 1450 1397 u32 tmp, viewport_w, viewport_h; 1451 1398 int r; 1399 + bool bypass_lut = false; 1452 1400 1453 1401 /* no fb bound */ 1454 1402 if (!atomic && !crtc->primary->fb) { ··· 1487 1433 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL); 1488 1434 radeon_bo_unreserve(rbo); 1489 1435 1490 - switch (target_fb->bits_per_pixel) { 1491 - case 8: 1436 + switch (target_fb->pixel_format) { 1437 + case DRM_FORMAT_C8: 1492 1438 fb_format = 1493 1439 AVIVO_D1GRPH_CONTROL_DEPTH_8BPP | 1494 1440 AVIVO_D1GRPH_CONTROL_8BPP_INDEXED; 1495 1441 break; 1496 - case 15: 1442 + case DRM_FORMAT_XRGB4444: 1443 + case DRM_FORMAT_ARGB4444: 1444 + fb_format = 1445 + AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | 1446 + AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444; 1447 + #ifdef __BIG_ENDIAN 1448 + fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT; 1449 + #endif 1450 + break; 1451 + case DRM_FORMAT_XRGB1555: 1497 1452 fb_format = 1498 1453 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | 1499 1454 AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555; 1455 + #ifdef __BIG_ENDIAN 1456 + fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT; 1457 + #endif 1500 1458 break; 1501 - case 16: 1459 + case DRM_FORMAT_RGB565: 1502 1460 fb_format = 1503 1461 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | 1504 1462 AVIVO_D1GRPH_CONTROL_16BPP_RGB565; ··· 1518 1452 fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT; 1519 1453 #endif 1520 1454 break; 1521 - case 24: 1522 - case 32: 1455 + case DRM_FORMAT_XRGB8888: 1456 + case DRM_FORMAT_ARGB8888: 1523 1457 fb_format = 1524 1458 AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | 1525 1459 AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888; ··· 1527 1461 fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT; 1528 1462 #endif 1529 1463 break; 1464 + case DRM_FORMAT_XRGB2101010: 1465 + case DRM_FORMAT_ARGB2101010: 1466 + fb_format = 1467 + AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | 1468 + AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010; 1469 + #ifdef __BIG_ENDIAN 1470 + fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT; 1471 + #endif 1472 + /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */ 1473 + bypass_lut = true; 1474 + break; 1530 1475 default: 1531 - DRM_ERROR("Unsupported screen depth %d\n", 1532 - target_fb->bits_per_pixel); 1476 + DRM_ERROR("Unsupported screen format %s\n", 1477 + drm_get_format_name(target_fb->pixel_format)); 1533 1478 return -EINVAL; 1534 1479 } 1535 1480 ··· 1578 1501 WREG32(AVIVO_D1GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); 1579 1502 if (rdev->family >= CHIP_R600) 1580 1503 WREG32(R600_D1GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); 1504 + 1505 + /* LUT only has 256 slots for 8 bpc fb. Bypass for > 8 bpc scanout for precision */ 1506 + WREG32_P(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, 1507 + (bypass_lut ? AVIVO_LUT_10BIT_BYPASS_EN : 0), ~AVIVO_LUT_10BIT_BYPASS_EN); 1508 + 1509 + if (bypass_lut) 1510 + DRM_DEBUG_KMS("Bypassing hardware LUT due to 10 bit fb scanout.\n"); 1581 1511 1582 1512 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); 1583 1513 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0);
+2
drivers/gpu/drm/radeon/evergreen_reg.h
··· 116 116 # define EVERGREEN_GRPH_ARRAY_LINEAR_ALIGNED 1 117 117 # define EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1 2 118 118 # define EVERGREEN_GRPH_ARRAY_2D_TILED_THIN1 4 119 + #define EVERGREEN_GRPH_LUT_10BIT_BYPASS_CONTROL 0x6808 120 + # define EVERGREEN_LUT_10BIT_BYPASS_EN (1 << 8) 119 121 #define EVERGREEN_GRPH_SWAP_CONTROL 0x680c 120 122 # define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0) 121 123 # define EVERGREEN_GRPH_ENDIAN_NONE 0
+1
drivers/gpu/drm/radeon/r500_reg.h
··· 402 402 * block and vice versa. This applies to GRPH, CUR, etc. 403 403 */ 404 404 #define AVIVO_D1GRPH_LUT_SEL 0x6108 405 + # define AVIVO_LUT_10BIT_BYPASS_EN (1 << 8) 405 406 #define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 406 407 #define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 407 408 #define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114
+22 -13
drivers/gpu/drm/radeon/radeon_connectors.c
··· 1288 1288 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || 1289 1289 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) 1290 1290 return MODE_OK; 1291 - else if (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_A) { 1292 - if (ASIC_IS_DCE6(rdev)) { 1293 - /* HDMI 1.3+ supports max clock of 340 Mhz */ 1294 - if (mode->clock > 340000) 1295 - return MODE_CLOCK_HIGH; 1296 - else 1297 - return MODE_OK; 1298 - } else 1291 + else if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector->edid)) { 1292 + /* HDMI 1.3+ supports max clock of 340 Mhz */ 1293 + if (mode->clock > 340000) 1299 1294 return MODE_CLOCK_HIGH; 1300 - } else 1295 + else 1296 + return MODE_OK; 1297 + } else { 1301 1298 return MODE_CLOCK_HIGH; 1299 + } 1302 1300 } 1303 1301 1304 1302 /* check against the max pixel clock */ ··· 1547 1549 static int radeon_dp_mode_valid(struct drm_connector *connector, 1548 1550 struct drm_display_mode *mode) 1549 1551 { 1552 + struct drm_device *dev = connector->dev; 1553 + struct radeon_device *rdev = dev->dev_private; 1550 1554 struct radeon_connector *radeon_connector = to_radeon_connector(connector); 1551 1555 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; 1552 1556 ··· 1579 1579 return MODE_PANEL; 1580 1580 } 1581 1581 } 1582 - return MODE_OK; 1583 1582 } else { 1584 1583 if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || 1585 - (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) 1584 + (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { 1586 1585 return radeon_dp_mode_valid_helper(connector, mode); 1587 - else 1588 - return MODE_OK; 1586 + } else { 1587 + if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector->edid)) { 1588 + /* HDMI 1.3+ supports max clock of 340 Mhz */ 1589 + if (mode->clock > 340000) 1590 + return MODE_CLOCK_HIGH; 1591 + } else { 1592 + if (mode->clock > 165000) 1593 + return MODE_CLOCK_HIGH; 1594 + } 1595 + } 1589 1596 } 1597 + 1598 + return MODE_OK; 1590 1599 } 1591 1600 1592 1601 static const struct drm_connector_helper_funcs radeon_dp_connector_helper_funcs = {
+20 -2
drivers/gpu/drm/radeon/radeon_display.c
··· 66 66 (radeon_crtc->lut_b[i] << 0)); 67 67 } 68 68 69 - WREG32(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id); 69 + /* Only change bit 0 of LUT_SEL, other bits are set elsewhere */ 70 + WREG32_P(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id, ~1); 70 71 } 71 72 72 73 static void dce4_crtc_load_lut(struct drm_crtc *crtc) ··· 358 357 359 358 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 360 359 360 + drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); 361 361 radeon_fence_unref(&work->fence); 362 - radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id); 362 + radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); 363 363 queue_work(radeon_crtc->flip_queue, &work->unpin_work); 364 364 } 365 365 ··· 461 459 base &= ~7; 462 460 } 463 461 462 + r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); 463 + if (r) { 464 + DRM_ERROR("failed to get vblank before flip\n"); 465 + goto pflip_cleanup; 466 + } 467 + 464 468 /* We borrow the event spin lock for protecting flip_work */ 465 469 spin_lock_irqsave(&crtc->dev->event_lock, flags); 466 470 ··· 480 472 up_read(&rdev->exclusive_lock); 481 473 482 474 return; 475 + 476 + pflip_cleanup: 477 + if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) { 478 + DRM_ERROR("failed to reserve new rbo in error path\n"); 479 + goto cleanup; 480 + } 481 + if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) { 482 + DRM_ERROR("failed to unpin new rbo in error path\n"); 483 + } 484 + radeon_bo_unreserve(work->new_rbo); 483 485 484 486 cleanup: 485 487 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
+23
drivers/i2c/busses/Kconfig
··· 676 676 This driver can also be built as a module. If so, the module 677 677 will be called i2c-riic. 678 678 679 + config I2C_RK3X 680 + tristate "Rockchip RK3xxx I2C adapter" 681 + depends on OF 682 + help 683 + Say Y here to include support for the I2C adapter in Rockchip RK3xxx 684 + SoCs. 685 + 686 + This driver can also be built as a module. If so, the module will 687 + be called i2c-rk3x. 688 + 679 689 config HAVE_S3C2410_I2C 680 690 bool 681 691 help ··· 773 763 774 764 This driver can also be built as a module. If so, the module 775 765 will be called i2c-stu300. 766 + 767 + config I2C_SUN6I_P2WI 768 + tristate "Allwinner sun6i internal P2WI controller" 769 + depends on RESET_CONTROLLER 770 + depends on MACH_SUN6I || COMPILE_TEST 771 + help 772 + If you say yes to this option, support will be included for the 773 + P2WI (Push/Pull 2 Wire Interface) controller embedded in some sunxi 774 + SOCs. 775 + The P2WI looks like an SMBus controller (which supports only byte 776 + accesses), except that it only supports one slave device. 777 + This interface is used to connect to specific PMIC devices (like the 778 + AXP221). 776 779 777 780 config I2C_TEGRA 778 781 tristate "NVIDIA Tegra internal I2C controller"
+2
drivers/i2c/busses/Makefile
··· 66 66 obj-$(CONFIG_I2C_PXA_PCI) += i2c-pxa-pci.o 67 67 obj-$(CONFIG_I2C_QUP) += i2c-qup.o 68 68 obj-$(CONFIG_I2C_RIIC) += i2c-riic.o 69 + obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o 69 70 obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o 70 71 obj-$(CONFIG_I2C_S6000) += i2c-s6000.o 71 72 obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o ··· 75 74 obj-$(CONFIG_I2C_SIRF) += i2c-sirf.o 76 75 obj-$(CONFIG_I2C_ST) += i2c-st.o 77 76 obj-$(CONFIG_I2C_STU300) += i2c-stu300.o 77 + obj-$(CONFIG_I2C_SUN6I_P2WI) += i2c-sun6i-p2wi.o 78 78 obj-$(CONFIG_I2C_TEGRA) += i2c-tegra.o 79 79 obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o 80 80 obj-$(CONFIG_I2C_WMT) += i2c-wmt.o
+763
drivers/i2c/busses/i2c-rk3x.c
··· 1 + /* 2 + * Driver for I2C adapter in Rockchip RK3xxx SoC 3 + * 4 + * Max Schwarz <max.schwarz@online.de> 5 + * based on the patches by Rockchip Inc. 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + 12 + #include <linux/kernel.h> 13 + #include <linux/module.h> 14 + #include <linux/i2c.h> 15 + #include <linux/interrupt.h> 16 + #include <linux/errno.h> 17 + #include <linux/err.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/io.h> 20 + #include <linux/of_address.h> 21 + #include <linux/of_irq.h> 22 + #include <linux/spinlock.h> 23 + #include <linux/clk.h> 24 + #include <linux/wait.h> 25 + #include <linux/mfd/syscon.h> 26 + #include <linux/regmap.h> 27 + 28 + 29 + /* Register Map */ 30 + #define REG_CON 0x00 /* control register */ 31 + #define REG_CLKDIV 0x04 /* clock divisor register */ 32 + #define REG_MRXADDR 0x08 /* slave address for REGISTER_TX */ 33 + #define REG_MRXRADDR 0x0c /* slave register address for REGISTER_TX */ 34 + #define REG_MTXCNT 0x10 /* number of bytes to be transmitted */ 35 + #define REG_MRXCNT 0x14 /* number of bytes to be received */ 36 + #define REG_IEN 0x18 /* interrupt enable */ 37 + #define REG_IPD 0x1c /* interrupt pending */ 38 + #define REG_FCNT 0x20 /* finished count */ 39 + 40 + /* Data buffer offsets */ 41 + #define TXBUFFER_BASE 0x100 42 + #define RXBUFFER_BASE 0x200 43 + 44 + /* REG_CON bits */ 45 + #define REG_CON_EN BIT(0) 46 + enum { 47 + REG_CON_MOD_TX = 0, /* transmit data */ 48 + REG_CON_MOD_REGISTER_TX, /* select register and restart */ 49 + REG_CON_MOD_RX, /* receive data */ 50 + REG_CON_MOD_REGISTER_RX, /* broken: transmits read addr AND writes 51 + * register addr */ 52 + }; 53 + #define REG_CON_MOD(mod) ((mod) << 1) 54 + #define REG_CON_MOD_MASK (BIT(1) | BIT(2)) 55 + #define REG_CON_START BIT(3) 56 + #define REG_CON_STOP BIT(4) 57 + #define REG_CON_LASTACK BIT(5) /* 1: send NACK after last received byte */ 58 + #define REG_CON_ACTACK BIT(6) /* 1: stop if NACK is received */ 59 + 60 + /* REG_MRXADDR bits */ 61 + #define REG_MRXADDR_VALID(x) BIT(24 + (x)) /* [x*8+7:x*8] of MRX[R]ADDR valid */ 62 + 63 + /* REG_IEN/REG_IPD bits */ 64 + #define REG_INT_BTF BIT(0) /* a byte was transmitted */ 65 + #define REG_INT_BRF BIT(1) /* a byte was received */ 66 + #define REG_INT_MBTF BIT(2) /* master data transmit finished */ 67 + #define REG_INT_MBRF BIT(3) /* master data receive finished */ 68 + #define REG_INT_START BIT(4) /* START condition generated */ 69 + #define REG_INT_STOP BIT(5) /* STOP condition generated */ 70 + #define REG_INT_NAKRCV BIT(6) /* NACK received */ 71 + #define REG_INT_ALL 0x7f 72 + 73 + /* Constants */ 74 + #define WAIT_TIMEOUT 200 /* ms */ 75 + #define DEFAULT_SCL_RATE (100 * 1000) /* Hz */ 76 + 77 + enum rk3x_i2c_state { 78 + STATE_IDLE, 79 + STATE_START, 80 + STATE_READ, 81 + STATE_WRITE, 82 + STATE_STOP 83 + }; 84 + 85 + /** 86 + * @grf_offset: offset inside the grf regmap for setting the i2c type 87 + */ 88 + struct rk3x_i2c_soc_data { 89 + int grf_offset; 90 + }; 91 + 92 + struct rk3x_i2c { 93 + struct i2c_adapter adap; 94 + struct device *dev; 95 + struct rk3x_i2c_soc_data *soc_data; 96 + 97 + /* Hardware resources */ 98 + void __iomem *regs; 99 + struct clk *clk; 100 + 101 + /* Settings */ 102 + unsigned int scl_frequency; 103 + 104 + /* Synchronization & notification */ 105 + spinlock_t lock; 106 + wait_queue_head_t wait; 107 + bool busy; 108 + 109 + /* Current message */ 110 + struct i2c_msg *msg; 111 + u8 addr; 112 + unsigned int mode; 113 + bool is_last_msg; 114 + 115 + /* I2C state machine */ 116 + enum rk3x_i2c_state state; 117 + unsigned int processed; /* sent/received bytes */ 118 + int error; 119 + }; 120 + 121 + static inline void i2c_writel(struct rk3x_i2c *i2c, u32 value, 122 + unsigned int offset) 123 + { 124 + writel(value, i2c->regs + offset); 125 + } 126 + 127 + static inline u32 i2c_readl(struct rk3x_i2c *i2c, unsigned int offset) 128 + { 129 + return readl(i2c->regs + offset); 130 + } 131 + 132 + /* Reset all interrupt pending bits */ 133 + static inline void rk3x_i2c_clean_ipd(struct rk3x_i2c *i2c) 134 + { 135 + i2c_writel(i2c, REG_INT_ALL, REG_IPD); 136 + } 137 + 138 + /** 139 + * Generate a START condition, which triggers a REG_INT_START interrupt. 140 + */ 141 + static void rk3x_i2c_start(struct rk3x_i2c *i2c) 142 + { 143 + u32 val; 144 + 145 + rk3x_i2c_clean_ipd(i2c); 146 + i2c_writel(i2c, REG_INT_START, REG_IEN); 147 + 148 + /* enable adapter with correct mode, send START condition */ 149 + val = REG_CON_EN | REG_CON_MOD(i2c->mode) | REG_CON_START; 150 + 151 + /* if we want to react to NACK, set ACTACK bit */ 152 + if (!(i2c->msg->flags & I2C_M_IGNORE_NAK)) 153 + val |= REG_CON_ACTACK; 154 + 155 + i2c_writel(i2c, val, REG_CON); 156 + } 157 + 158 + /** 159 + * Generate a STOP condition, which triggers a REG_INT_STOP interrupt. 160 + * 161 + * @error: Error code to return in rk3x_i2c_xfer 162 + */ 163 + static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error) 164 + { 165 + unsigned int ctrl; 166 + 167 + i2c->processed = 0; 168 + i2c->msg = NULL; 169 + i2c->error = error; 170 + 171 + if (i2c->is_last_msg) { 172 + /* Enable stop interrupt */ 173 + i2c_writel(i2c, REG_INT_STOP, REG_IEN); 174 + 175 + i2c->state = STATE_STOP; 176 + 177 + ctrl = i2c_readl(i2c, REG_CON); 178 + ctrl |= REG_CON_STOP; 179 + i2c_writel(i2c, ctrl, REG_CON); 180 + } else { 181 + /* Signal rk3x_i2c_xfer to start the next message. */ 182 + i2c->busy = false; 183 + i2c->state = STATE_IDLE; 184 + 185 + /* 186 + * The HW is actually not capable of REPEATED START. But we can 187 + * get the intended effect by resetting its internal state 188 + * and issuing an ordinary START. 189 + */ 190 + i2c_writel(i2c, 0, REG_CON); 191 + 192 + /* signal that we are finished with the current msg */ 193 + wake_up(&i2c->wait); 194 + } 195 + } 196 + 197 + /** 198 + * Setup a read according to i2c->msg 199 + */ 200 + static void rk3x_i2c_prepare_read(struct rk3x_i2c *i2c) 201 + { 202 + unsigned int len = i2c->msg->len - i2c->processed; 203 + u32 con; 204 + 205 + con = i2c_readl(i2c, REG_CON); 206 + 207 + /* 208 + * The hw can read up to 32 bytes at a time. If we need more than one 209 + * chunk, send an ACK after the last byte of the current chunk. 210 + */ 211 + if (unlikely(len > 32)) { 212 + len = 32; 213 + con &= ~REG_CON_LASTACK; 214 + } else { 215 + con |= REG_CON_LASTACK; 216 + } 217 + 218 + /* make sure we are in plain RX mode if we read a second chunk */ 219 + if (i2c->processed != 0) { 220 + con &= ~REG_CON_MOD_MASK; 221 + con |= REG_CON_MOD(REG_CON_MOD_RX); 222 + } 223 + 224 + i2c_writel(i2c, con, REG_CON); 225 + i2c_writel(i2c, len, REG_MRXCNT); 226 + } 227 + 228 + /** 229 + * Fill the transmit buffer with data from i2c->msg 230 + */ 231 + static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c) 232 + { 233 + unsigned int i, j; 234 + u32 cnt = 0; 235 + u32 val; 236 + u8 byte; 237 + 238 + for (i = 0; i < 8; ++i) { 239 + val = 0; 240 + for (j = 0; j < 4; ++j) { 241 + if (i2c->processed == i2c->msg->len) 242 + break; 243 + 244 + if (i2c->processed == 0 && cnt == 0) 245 + byte = (i2c->addr & 0x7f) << 1; 246 + else 247 + byte = i2c->msg->buf[i2c->processed++]; 248 + 249 + val |= byte << (j * 8); 250 + cnt++; 251 + } 252 + 253 + i2c_writel(i2c, val, TXBUFFER_BASE + 4 * i); 254 + 255 + if (i2c->processed == i2c->msg->len) 256 + break; 257 + } 258 + 259 + i2c_writel(i2c, cnt, REG_MTXCNT); 260 + } 261 + 262 + 263 + /* IRQ handlers for individual states */ 264 + 265 + static void rk3x_i2c_handle_start(struct rk3x_i2c *i2c, unsigned int ipd) 266 + { 267 + if (!(ipd & REG_INT_START)) { 268 + rk3x_i2c_stop(i2c, -EIO); 269 + dev_warn(i2c->dev, "unexpected irq in START: 0x%x\n", ipd); 270 + rk3x_i2c_clean_ipd(i2c); 271 + return; 272 + } 273 + 274 + /* ack interrupt */ 275 + i2c_writel(i2c, REG_INT_START, REG_IPD); 276 + 277 + /* disable start bit */ 278 + i2c_writel(i2c, i2c_readl(i2c, REG_CON) & ~REG_CON_START, REG_CON); 279 + 280 + /* enable appropriate interrupts and transition */ 281 + if (i2c->mode == REG_CON_MOD_TX) { 282 + i2c_writel(i2c, REG_INT_MBTF | REG_INT_NAKRCV, REG_IEN); 283 + i2c->state = STATE_WRITE; 284 + rk3x_i2c_fill_transmit_buf(i2c); 285 + } else { 286 + /* in any other case, we are going to be reading. */ 287 + i2c_writel(i2c, REG_INT_MBRF | REG_INT_NAKRCV, REG_IEN); 288 + i2c->state = STATE_READ; 289 + rk3x_i2c_prepare_read(i2c); 290 + } 291 + } 292 + 293 + static void rk3x_i2c_handle_write(struct rk3x_i2c *i2c, unsigned int ipd) 294 + { 295 + if (!(ipd & REG_INT_MBTF)) { 296 + rk3x_i2c_stop(i2c, -EIO); 297 + dev_err(i2c->dev, "unexpected irq in WRITE: 0x%x\n", ipd); 298 + rk3x_i2c_clean_ipd(i2c); 299 + return; 300 + } 301 + 302 + /* ack interrupt */ 303 + i2c_writel(i2c, REG_INT_MBTF, REG_IPD); 304 + 305 + /* are we finished? */ 306 + if (i2c->processed == i2c->msg->len) 307 + rk3x_i2c_stop(i2c, i2c->error); 308 + else 309 + rk3x_i2c_fill_transmit_buf(i2c); 310 + } 311 + 312 + static void rk3x_i2c_handle_read(struct rk3x_i2c *i2c, unsigned int ipd) 313 + { 314 + unsigned int i; 315 + unsigned int len = i2c->msg->len - i2c->processed; 316 + u32 uninitialized_var(val); 317 + u8 byte; 318 + 319 + /* we only care for MBRF here. */ 320 + if (!(ipd & REG_INT_MBRF)) 321 + return; 322 + 323 + /* ack interrupt */ 324 + i2c_writel(i2c, REG_INT_MBRF, REG_IPD); 325 + 326 + /* read the data from receive buffer */ 327 + for (i = 0; i < len; ++i) { 328 + if (i % 4 == 0) 329 + val = i2c_readl(i2c, RXBUFFER_BASE + (i / 4) * 4); 330 + 331 + byte = (val >> ((i % 4) * 8)) & 0xff; 332 + i2c->msg->buf[i2c->processed++] = byte; 333 + } 334 + 335 + /* are we finished? */ 336 + if (i2c->processed == i2c->msg->len) 337 + rk3x_i2c_stop(i2c, i2c->error); 338 + else 339 + rk3x_i2c_prepare_read(i2c); 340 + } 341 + 342 + static void rk3x_i2c_handle_stop(struct rk3x_i2c *i2c, unsigned int ipd) 343 + { 344 + unsigned int con; 345 + 346 + if (!(ipd & REG_INT_STOP)) { 347 + rk3x_i2c_stop(i2c, -EIO); 348 + dev_err(i2c->dev, "unexpected irq in STOP: 0x%x\n", ipd); 349 + rk3x_i2c_clean_ipd(i2c); 350 + return; 351 + } 352 + 353 + /* ack interrupt */ 354 + i2c_writel(i2c, REG_INT_STOP, REG_IPD); 355 + 356 + /* disable STOP bit */ 357 + con = i2c_readl(i2c, REG_CON); 358 + con &= ~REG_CON_STOP; 359 + i2c_writel(i2c, con, REG_CON); 360 + 361 + i2c->busy = false; 362 + i2c->state = STATE_IDLE; 363 + 364 + /* signal rk3x_i2c_xfer that we are finished */ 365 + wake_up(&i2c->wait); 366 + } 367 + 368 + static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id) 369 + { 370 + struct rk3x_i2c *i2c = dev_id; 371 + unsigned int ipd; 372 + 373 + spin_lock(&i2c->lock); 374 + 375 + ipd = i2c_readl(i2c, REG_IPD); 376 + if (i2c->state == STATE_IDLE) { 377 + dev_warn(i2c->dev, "irq in STATE_IDLE, ipd = 0x%x\n", ipd); 378 + rk3x_i2c_clean_ipd(i2c); 379 + goto out; 380 + } 381 + 382 + dev_dbg(i2c->dev, "IRQ: state %d, ipd: %x\n", i2c->state, ipd); 383 + 384 + /* Clean interrupt bits we don't care about */ 385 + ipd &= ~(REG_INT_BRF | REG_INT_BTF); 386 + 387 + if (ipd & REG_INT_NAKRCV) { 388 + /* 389 + * We got a NACK in the last operation. Depending on whether 390 + * IGNORE_NAK is set, we have to stop the operation and report 391 + * an error. 392 + */ 393 + i2c_writel(i2c, REG_INT_NAKRCV, REG_IPD); 394 + 395 + ipd &= ~REG_INT_NAKRCV; 396 + 397 + if (!(i2c->msg->flags & I2C_M_IGNORE_NAK)) 398 + rk3x_i2c_stop(i2c, -ENXIO); 399 + } 400 + 401 + /* is there anything left to handle? */ 402 + if (unlikely(ipd == 0)) 403 + goto out; 404 + 405 + switch (i2c->state) { 406 + case STATE_START: 407 + rk3x_i2c_handle_start(i2c, ipd); 408 + break; 409 + case STATE_WRITE: 410 + rk3x_i2c_handle_write(i2c, ipd); 411 + break; 412 + case STATE_READ: 413 + rk3x_i2c_handle_read(i2c, ipd); 414 + break; 415 + case STATE_STOP: 416 + rk3x_i2c_handle_stop(i2c, ipd); 417 + break; 418 + case STATE_IDLE: 419 + break; 420 + } 421 + 422 + out: 423 + spin_unlock(&i2c->lock); 424 + return IRQ_HANDLED; 425 + } 426 + 427 + static void rk3x_i2c_set_scl_rate(struct rk3x_i2c *i2c, unsigned long scl_rate) 428 + { 429 + unsigned long i2c_rate = clk_get_rate(i2c->clk); 430 + unsigned int div; 431 + 432 + /* SCL rate = (clk rate) / (8 * DIV) */ 433 + div = DIV_ROUND_UP(i2c_rate, scl_rate * 8); 434 + 435 + /* The lower and upper half of the CLKDIV reg describe the length of 436 + * SCL low & high periods. */ 437 + div = DIV_ROUND_UP(div, 2); 438 + 439 + i2c_writel(i2c, (div << 16) | (div & 0xffff), REG_CLKDIV); 440 + } 441 + 442 + /** 443 + * Setup I2C registers for an I2C operation specified by msgs, num. 444 + * 445 + * Must be called with i2c->lock held. 446 + * 447 + * @msgs: I2C msgs to process 448 + * @num: Number of msgs 449 + * 450 + * returns: Number of I2C msgs processed or negative in case of error 451 + */ 452 + static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num) 453 + { 454 + u32 addr = (msgs[0].addr & 0x7f) << 1; 455 + int ret = 0; 456 + 457 + /* 458 + * The I2C adapter can issue a small (len < 4) write packet before 459 + * reading. This speeds up SMBus-style register reads. 460 + * The MRXADDR/MRXRADDR hold the slave address and the slave register 461 + * address in this case. 462 + */ 463 + 464 + if (num >= 2 && msgs[0].len < 4 && 465 + !(msgs[0].flags & I2C_M_RD) && (msgs[1].flags & I2C_M_RD)) { 466 + u32 reg_addr = 0; 467 + int i; 468 + 469 + dev_dbg(i2c->dev, "Combined write/read from addr 0x%x\n", 470 + addr >> 1); 471 + 472 + /* Fill MRXRADDR with the register address(es) */ 473 + for (i = 0; i < msgs[0].len; ++i) { 474 + reg_addr |= msgs[0].buf[i] << (i * 8); 475 + reg_addr |= REG_MRXADDR_VALID(i); 476 + } 477 + 478 + /* msgs[0] is handled by hw. */ 479 + i2c->msg = &msgs[1]; 480 + 481 + i2c->mode = REG_CON_MOD_REGISTER_TX; 482 + 483 + i2c_writel(i2c, addr | REG_MRXADDR_VALID(0), REG_MRXADDR); 484 + i2c_writel(i2c, reg_addr, REG_MRXRADDR); 485 + 486 + ret = 2; 487 + } else { 488 + /* 489 + * We'll have to do it the boring way and process the msgs 490 + * one-by-one. 491 + */ 492 + 493 + if (msgs[0].flags & I2C_M_RD) { 494 + addr |= 1; /* set read bit */ 495 + 496 + /* 497 + * We have to transmit the slave addr first. Use 498 + * MOD_REGISTER_TX for that purpose. 499 + */ 500 + i2c->mode = REG_CON_MOD_REGISTER_TX; 501 + i2c_writel(i2c, addr | REG_MRXADDR_VALID(0), 502 + REG_MRXADDR); 503 + i2c_writel(i2c, 0, REG_MRXRADDR); 504 + } else { 505 + i2c->mode = REG_CON_MOD_TX; 506 + } 507 + 508 + i2c->msg = &msgs[0]; 509 + 510 + ret = 1; 511 + } 512 + 513 + i2c->addr = msgs[0].addr; 514 + i2c->busy = true; 515 + i2c->state = STATE_START; 516 + i2c->processed = 0; 517 + i2c->error = 0; 518 + 519 + rk3x_i2c_clean_ipd(i2c); 520 + 521 + return ret; 522 + } 523 + 524 + static int rk3x_i2c_xfer(struct i2c_adapter *adap, 525 + struct i2c_msg *msgs, int num) 526 + { 527 + struct rk3x_i2c *i2c = (struct rk3x_i2c *)adap->algo_data; 528 + unsigned long timeout, flags; 529 + int ret = 0; 530 + int i; 531 + 532 + spin_lock_irqsave(&i2c->lock, flags); 533 + 534 + clk_enable(i2c->clk); 535 + 536 + /* The clock rate might have changed, so setup the divider again */ 537 + rk3x_i2c_set_scl_rate(i2c, i2c->scl_frequency); 538 + 539 + i2c->is_last_msg = false; 540 + 541 + /* 542 + * Process msgs. We can handle more than one message at once (see 543 + * rk3x_i2c_setup()). 544 + */ 545 + for (i = 0; i < num; i += ret) { 546 + ret = rk3x_i2c_setup(i2c, msgs + i, num - i); 547 + 548 + if (ret < 0) { 549 + dev_err(i2c->dev, "rk3x_i2c_setup() failed\n"); 550 + break; 551 + } 552 + 553 + if (i + ret >= num) 554 + i2c->is_last_msg = true; 555 + 556 + spin_unlock_irqrestore(&i2c->lock, flags); 557 + 558 + rk3x_i2c_start(i2c); 559 + 560 + timeout = wait_event_timeout(i2c->wait, !i2c->busy, 561 + msecs_to_jiffies(WAIT_TIMEOUT)); 562 + 563 + spin_lock_irqsave(&i2c->lock, flags); 564 + 565 + if (timeout == 0) { 566 + dev_err(i2c->dev, "timeout, ipd: 0x%02x, state: %d\n", 567 + i2c_readl(i2c, REG_IPD), i2c->state); 568 + 569 + /* Force a STOP condition without interrupt */ 570 + i2c_writel(i2c, 0, REG_IEN); 571 + i2c_writel(i2c, REG_CON_EN | REG_CON_STOP, REG_CON); 572 + 573 + i2c->state = STATE_IDLE; 574 + 575 + ret = -ETIMEDOUT; 576 + break; 577 + } 578 + 579 + if (i2c->error) { 580 + ret = i2c->error; 581 + break; 582 + } 583 + } 584 + 585 + clk_disable(i2c->clk); 586 + spin_unlock_irqrestore(&i2c->lock, flags); 587 + 588 + return ret; 589 + } 590 + 591 + static u32 rk3x_i2c_func(struct i2c_adapter *adap) 592 + { 593 + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING; 594 + } 595 + 596 + static const struct i2c_algorithm rk3x_i2c_algorithm = { 597 + .master_xfer = rk3x_i2c_xfer, 598 + .functionality = rk3x_i2c_func, 599 + }; 600 + 601 + static struct rk3x_i2c_soc_data soc_data[3] = { 602 + { .grf_offset = 0x154 }, /* rk3066 */ 603 + { .grf_offset = 0x0a4 }, /* rk3188 */ 604 + { .grf_offset = -1 }, /* no I2C switching needed */ 605 + }; 606 + 607 + static const struct of_device_id rk3x_i2c_match[] = { 608 + { .compatible = "rockchip,rk3066-i2c", .data = (void *)&soc_data[0] }, 609 + { .compatible = "rockchip,rk3188-i2c", .data = (void *)&soc_data[1] }, 610 + { .compatible = "rockchip,rk3288-i2c", .data = (void *)&soc_data[2] }, 611 + {}, 612 + }; 613 + 614 + static int rk3x_i2c_probe(struct platform_device *pdev) 615 + { 616 + struct device_node *np = pdev->dev.of_node; 617 + const struct of_device_id *match; 618 + struct rk3x_i2c *i2c; 619 + struct resource *mem; 620 + int ret = 0; 621 + int bus_nr; 622 + u32 value; 623 + int irq; 624 + 625 + i2c = devm_kzalloc(&pdev->dev, sizeof(struct rk3x_i2c), GFP_KERNEL); 626 + if (!i2c) 627 + return -ENOMEM; 628 + 629 + match = of_match_node(rk3x_i2c_match, np); 630 + i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data; 631 + 632 + if (of_property_read_u32(pdev->dev.of_node, "clock-frequency", 633 + &i2c->scl_frequency)) { 634 + dev_info(&pdev->dev, "using default SCL frequency: %d\n", 635 + DEFAULT_SCL_RATE); 636 + i2c->scl_frequency = DEFAULT_SCL_RATE; 637 + } 638 + 639 + if (i2c->scl_frequency == 0 || i2c->scl_frequency > 400 * 1000) { 640 + dev_warn(&pdev->dev, "invalid SCL frequency specified.\n"); 641 + dev_warn(&pdev->dev, "using default SCL frequency: %d\n", 642 + DEFAULT_SCL_RATE); 643 + i2c->scl_frequency = DEFAULT_SCL_RATE; 644 + } 645 + 646 + strlcpy(i2c->adap.name, "rk3x-i2c", sizeof(i2c->adap.name)); 647 + i2c->adap.owner = THIS_MODULE; 648 + i2c->adap.algo = &rk3x_i2c_algorithm; 649 + i2c->adap.retries = 3; 650 + i2c->adap.dev.of_node = np; 651 + i2c->adap.algo_data = i2c; 652 + i2c->adap.dev.parent = &pdev->dev; 653 + 654 + i2c->dev = &pdev->dev; 655 + 656 + spin_lock_init(&i2c->lock); 657 + init_waitqueue_head(&i2c->wait); 658 + 659 + i2c->clk = devm_clk_get(&pdev->dev, NULL); 660 + if (IS_ERR(i2c->clk)) { 661 + dev_err(&pdev->dev, "cannot get clock\n"); 662 + return PTR_ERR(i2c->clk); 663 + } 664 + 665 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 666 + i2c->regs = devm_ioremap_resource(&pdev->dev, mem); 667 + if (IS_ERR(i2c->regs)) 668 + return PTR_ERR(i2c->regs); 669 + 670 + /* Try to set the I2C adapter number from dt */ 671 + bus_nr = of_alias_get_id(np, "i2c"); 672 + 673 + /* 674 + * Switch to new interface if the SoC also offers the old one. 675 + * The control bit is located in the GRF register space. 676 + */ 677 + if (i2c->soc_data->grf_offset >= 0) { 678 + struct regmap *grf; 679 + 680 + grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 681 + if (IS_ERR(grf)) { 682 + dev_err(&pdev->dev, 683 + "rk3x-i2c needs 'rockchip,grf' property\n"); 684 + return PTR_ERR(grf); 685 + } 686 + 687 + if (bus_nr < 0) { 688 + dev_err(&pdev->dev, "rk3x-i2c needs i2cX alias"); 689 + return -EINVAL; 690 + } 691 + 692 + /* 27+i: write mask, 11+i: value */ 693 + value = BIT(27 + bus_nr) | BIT(11 + bus_nr); 694 + 695 + ret = regmap_write(grf, i2c->soc_data->grf_offset, value); 696 + if (ret != 0) { 697 + dev_err(i2c->dev, "Could not write to GRF: %d\n", ret); 698 + return ret; 699 + } 700 + } 701 + 702 + /* IRQ setup */ 703 + irq = platform_get_irq(pdev, 0); 704 + if (irq < 0) { 705 + dev_err(&pdev->dev, "cannot find rk3x IRQ\n"); 706 + return irq; 707 + } 708 + 709 + ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq, 710 + 0, dev_name(&pdev->dev), i2c); 711 + if (ret < 0) { 712 + dev_err(&pdev->dev, "cannot request IRQ\n"); 713 + return ret; 714 + } 715 + 716 + platform_set_drvdata(pdev, i2c); 717 + 718 + ret = clk_prepare(i2c->clk); 719 + if (ret < 0) { 720 + dev_err(&pdev->dev, "Could not prepare clock\n"); 721 + return ret; 722 + } 723 + 724 + ret = i2c_add_adapter(&i2c->adap); 725 + if (ret < 0) { 726 + dev_err(&pdev->dev, "Could not register adapter\n"); 727 + goto err_clk; 728 + } 729 + 730 + dev_info(&pdev->dev, "Initialized RK3xxx I2C bus at %p\n", i2c->regs); 731 + 732 + return 0; 733 + 734 + err_clk: 735 + clk_unprepare(i2c->clk); 736 + return ret; 737 + } 738 + 739 + static int rk3x_i2c_remove(struct platform_device *pdev) 740 + { 741 + struct rk3x_i2c *i2c = platform_get_drvdata(pdev); 742 + 743 + i2c_del_adapter(&i2c->adap); 744 + clk_unprepare(i2c->clk); 745 + 746 + return 0; 747 + } 748 + 749 + static struct platform_driver rk3x_i2c_driver = { 750 + .probe = rk3x_i2c_probe, 751 + .remove = rk3x_i2c_remove, 752 + .driver = { 753 + .owner = THIS_MODULE, 754 + .name = "rk3x-i2c", 755 + .of_match_table = rk3x_i2c_match, 756 + }, 757 + }; 758 + 759 + module_platform_driver(rk3x_i2c_driver); 760 + 761 + MODULE_DESCRIPTION("Rockchip RK3xxx I2C Bus driver"); 762 + MODULE_AUTHOR("Max Schwarz <max.schwarz@online.de>"); 763 + MODULE_LICENSE("GPL v2");
+345
drivers/i2c/busses/i2c-sun6i-p2wi.c
··· 1 + /* 2 + * P2WI (Push-Pull Two Wire Interface) bus driver. 3 + * 4 + * Author: Boris BREZILLON <boris.brezillon@free-electrons.com> 5 + * 6 + * This file is licensed under the terms of the GNU General Public License 7 + * version 2. This program is licensed "as is" without any warranty of any 8 + * kind, whether express or implied. 9 + * 10 + * The P2WI controller looks like an SMBus controller which only supports byte 11 + * data transfers. But, it differs from standard SMBus protocol on several 12 + * aspects: 13 + * - it supports only one slave device, and thus drop the address field 14 + * - it adds a parity bit every 8bits of data 15 + * - only one read access is required to read a byte (instead of a write 16 + * followed by a read access in standard SMBus protocol) 17 + * - there's no Ack bit after each byte transfer 18 + * 19 + * This means this bus cannot be used to interface with standard SMBus 20 + * devices (the only known device to support this interface is the AXP221 21 + * PMIC). 22 + * 23 + */ 24 + #include <linux/clk.h> 25 + #include <linux/module.h> 26 + #include <linux/i2c.h> 27 + #include <linux/io.h> 28 + #include <linux/interrupt.h> 29 + #include <linux/module.h> 30 + #include <linux/of.h> 31 + #include <linux/platform_device.h> 32 + #include <linux/reset.h> 33 + 34 + 35 + /* P2WI registers */ 36 + #define P2WI_CTRL 0x0 37 + #define P2WI_CCR 0x4 38 + #define P2WI_INTE 0x8 39 + #define P2WI_INTS 0xc 40 + #define P2WI_DADDR0 0x10 41 + #define P2WI_DADDR1 0x14 42 + #define P2WI_DLEN 0x18 43 + #define P2WI_DATA0 0x1c 44 + #define P2WI_DATA1 0x20 45 + #define P2WI_LCR 0x24 46 + #define P2WI_PMCR 0x28 47 + 48 + /* CTRL fields */ 49 + #define P2WI_CTRL_START_TRANS BIT(7) 50 + #define P2WI_CTRL_ABORT_TRANS BIT(6) 51 + #define P2WI_CTRL_GLOBAL_INT_ENB BIT(1) 52 + #define P2WI_CTRL_SOFT_RST BIT(0) 53 + 54 + /* CLK CTRL fields */ 55 + #define P2WI_CCR_SDA_OUT_DELAY(v) (((v) & 0x7) << 8) 56 + #define P2WI_CCR_MAX_CLK_DIV 0xff 57 + #define P2WI_CCR_CLK_DIV(v) ((v) & P2WI_CCR_MAX_CLK_DIV) 58 + 59 + /* STATUS fields */ 60 + #define P2WI_INTS_TRANS_ERR_ID(v) (((v) >> 8) & 0xff) 61 + #define P2WI_INTS_LOAD_BSY BIT(2) 62 + #define P2WI_INTS_TRANS_ERR BIT(1) 63 + #define P2WI_INTS_TRANS_OVER BIT(0) 64 + 65 + /* DATA LENGTH fields*/ 66 + #define P2WI_DLEN_READ BIT(4) 67 + #define P2WI_DLEN_DATA_LENGTH(v) ((v - 1) & 0x7) 68 + 69 + /* LINE CTRL fields*/ 70 + #define P2WI_LCR_SCL_STATE BIT(5) 71 + #define P2WI_LCR_SDA_STATE BIT(4) 72 + #define P2WI_LCR_SCL_CTL BIT(3) 73 + #define P2WI_LCR_SCL_CTL_EN BIT(2) 74 + #define P2WI_LCR_SDA_CTL BIT(1) 75 + #define P2WI_LCR_SDA_CTL_EN BIT(0) 76 + 77 + /* PMU MODE CTRL fields */ 78 + #define P2WI_PMCR_PMU_INIT_SEND BIT(31) 79 + #define P2WI_PMCR_PMU_INIT_DATA(v) (((v) & 0xff) << 16) 80 + #define P2WI_PMCR_PMU_MODE_REG(v) (((v) & 0xff) << 8) 81 + #define P2WI_PMCR_PMU_DEV_ADDR(v) ((v) & 0xff) 82 + 83 + #define P2WI_MAX_FREQ 6000000 84 + 85 + struct p2wi { 86 + struct i2c_adapter adapter; 87 + struct completion complete; 88 + unsigned int status; 89 + void __iomem *regs; 90 + struct clk *clk; 91 + struct reset_control *rstc; 92 + int slave_addr; 93 + }; 94 + 95 + static irqreturn_t p2wi_interrupt(int irq, void *dev_id) 96 + { 97 + struct p2wi *p2wi = dev_id; 98 + unsigned long status; 99 + 100 + status = readl(p2wi->regs + P2WI_INTS); 101 + p2wi->status = status; 102 + 103 + /* Clear interrupts */ 104 + status &= (P2WI_INTS_LOAD_BSY | P2WI_INTS_TRANS_ERR | 105 + P2WI_INTS_TRANS_OVER); 106 + writel(status, p2wi->regs + P2WI_INTS); 107 + 108 + complete(&p2wi->complete); 109 + 110 + return IRQ_HANDLED; 111 + } 112 + 113 + static u32 p2wi_functionality(struct i2c_adapter *adap) 114 + { 115 + return I2C_FUNC_SMBUS_BYTE_DATA; 116 + } 117 + 118 + static int p2wi_smbus_xfer(struct i2c_adapter *adap, u16 addr, 119 + unsigned short flags, char read_write, 120 + u8 command, int size, union i2c_smbus_data *data) 121 + { 122 + struct p2wi *p2wi = i2c_get_adapdata(adap); 123 + unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1); 124 + 125 + if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) { 126 + dev_err(&adap->dev, "invalid P2WI address\n"); 127 + return -EINVAL; 128 + } 129 + 130 + if (!data) 131 + return -EINVAL; 132 + 133 + writel(command, p2wi->regs + P2WI_DADDR0); 134 + 135 + if (read_write == I2C_SMBUS_READ) 136 + dlen |= P2WI_DLEN_READ; 137 + else 138 + writel(data->byte, p2wi->regs + P2WI_DATA0); 139 + 140 + writel(dlen, p2wi->regs + P2WI_DLEN); 141 + 142 + if (readl(p2wi->regs + P2WI_CTRL) & P2WI_CTRL_START_TRANS) { 143 + dev_err(&adap->dev, "P2WI bus busy\n"); 144 + return -EBUSY; 145 + } 146 + 147 + reinit_completion(&p2wi->complete); 148 + 149 + writel(P2WI_INTS_LOAD_BSY | P2WI_INTS_TRANS_ERR | P2WI_INTS_TRANS_OVER, 150 + p2wi->regs + P2WI_INTE); 151 + 152 + writel(P2WI_CTRL_START_TRANS | P2WI_CTRL_GLOBAL_INT_ENB, 153 + p2wi->regs + P2WI_CTRL); 154 + 155 + wait_for_completion(&p2wi->complete); 156 + 157 + if (p2wi->status & P2WI_INTS_LOAD_BSY) { 158 + dev_err(&adap->dev, "P2WI bus busy\n"); 159 + return -EBUSY; 160 + } 161 + 162 + if (p2wi->status & P2WI_INTS_TRANS_ERR) { 163 + dev_err(&adap->dev, "P2WI bus xfer error\n"); 164 + return -ENXIO; 165 + } 166 + 167 + if (read_write == I2C_SMBUS_READ) 168 + data->byte = readl(p2wi->regs + P2WI_DATA0); 169 + 170 + return 0; 171 + } 172 + 173 + static const struct i2c_algorithm p2wi_algo = { 174 + .smbus_xfer = p2wi_smbus_xfer, 175 + .functionality = p2wi_functionality, 176 + }; 177 + 178 + static const struct of_device_id p2wi_of_match_table[] = { 179 + { .compatible = "allwinner,sun6i-a31-p2wi" }, 180 + {} 181 + }; 182 + MODULE_DEVICE_TABLE(of, p2wi_of_match_table); 183 + 184 + static int p2wi_probe(struct platform_device *pdev) 185 + { 186 + struct device *dev = &pdev->dev; 187 + struct device_node *np = dev->of_node; 188 + struct device_node *childnp; 189 + unsigned long parent_clk_freq; 190 + u32 clk_freq = 100000; 191 + struct resource *r; 192 + struct p2wi *p2wi; 193 + u32 slave_addr; 194 + int clk_div; 195 + int irq; 196 + int ret; 197 + 198 + of_property_read_u32(np, "clock-frequency", &clk_freq); 199 + if (clk_freq > P2WI_MAX_FREQ) { 200 + dev_err(dev, 201 + "required clock-frequency (%u Hz) is too high (max = 6MHz)", 202 + clk_freq); 203 + return -EINVAL; 204 + } 205 + 206 + if (of_get_child_count(np) > 1) { 207 + dev_err(dev, "P2WI only supports one slave device\n"); 208 + return -EINVAL; 209 + } 210 + 211 + p2wi = devm_kzalloc(dev, sizeof(struct p2wi), GFP_KERNEL); 212 + if (!p2wi) 213 + return -ENOMEM; 214 + 215 + p2wi->slave_addr = -1; 216 + 217 + /* 218 + * Authorize a p2wi node without any children to be able to use an 219 + * i2c-dev from userpace. 220 + * In this case the slave_addr is set to -1 and won't be checked when 221 + * launching a P2WI transfer. 222 + */ 223 + childnp = of_get_next_available_child(np, NULL); 224 + if (childnp) { 225 + ret = of_property_read_u32(childnp, "reg", &slave_addr); 226 + if (ret) { 227 + dev_err(dev, "invalid slave address on node %s\n", 228 + childnp->full_name); 229 + return -EINVAL; 230 + } 231 + 232 + p2wi->slave_addr = slave_addr; 233 + } 234 + 235 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 236 + p2wi->regs = devm_ioremap_resource(dev, r); 237 + if (IS_ERR(p2wi->regs)) 238 + return PTR_ERR(p2wi->regs); 239 + 240 + strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name)); 241 + irq = platform_get_irq(pdev, 0); 242 + if (irq < 0) { 243 + dev_err(dev, "failed to retrieve irq: %d\n", irq); 244 + return irq; 245 + } 246 + 247 + p2wi->clk = devm_clk_get(dev, NULL); 248 + if (IS_ERR(p2wi->clk)) { 249 + ret = PTR_ERR(p2wi->clk); 250 + dev_err(dev, "failed to retrieve clk: %d\n", ret); 251 + return ret; 252 + } 253 + 254 + ret = clk_prepare_enable(p2wi->clk); 255 + if (ret) { 256 + dev_err(dev, "failed to enable clk: %d\n", ret); 257 + return ret; 258 + } 259 + 260 + parent_clk_freq = clk_get_rate(p2wi->clk); 261 + 262 + p2wi->rstc = devm_reset_control_get(dev, NULL); 263 + if (IS_ERR(p2wi->rstc)) { 264 + ret = PTR_ERR(p2wi->rstc); 265 + dev_err(dev, "failed to retrieve reset controller: %d\n", ret); 266 + goto err_clk_disable; 267 + } 268 + 269 + ret = reset_control_deassert(p2wi->rstc); 270 + if (ret) { 271 + dev_err(dev, "failed to deassert reset line: %d\n", ret); 272 + goto err_clk_disable; 273 + } 274 + 275 + init_completion(&p2wi->complete); 276 + p2wi->adapter.dev.parent = dev; 277 + p2wi->adapter.algo = &p2wi_algo; 278 + p2wi->adapter.owner = THIS_MODULE; 279 + p2wi->adapter.dev.of_node = pdev->dev.of_node; 280 + platform_set_drvdata(pdev, p2wi); 281 + i2c_set_adapdata(&p2wi->adapter, p2wi); 282 + 283 + ret = devm_request_irq(dev, irq, p2wi_interrupt, 0, pdev->name, p2wi); 284 + if (ret) { 285 + dev_err(dev, "can't register interrupt handler irq%d: %d\n", 286 + irq, ret); 287 + goto err_reset_assert; 288 + } 289 + 290 + writel(P2WI_CTRL_SOFT_RST, p2wi->regs + P2WI_CTRL); 291 + 292 + clk_div = parent_clk_freq / clk_freq; 293 + if (!clk_div) { 294 + dev_warn(dev, 295 + "clock-frequency is too high, setting it to %lu Hz\n", 296 + parent_clk_freq); 297 + clk_div = 1; 298 + } else if (clk_div > P2WI_CCR_MAX_CLK_DIV) { 299 + dev_warn(dev, 300 + "clock-frequency is too low, setting it to %lu Hz\n", 301 + parent_clk_freq / P2WI_CCR_MAX_CLK_DIV); 302 + clk_div = P2WI_CCR_MAX_CLK_DIV; 303 + } 304 + 305 + writel(P2WI_CCR_SDA_OUT_DELAY(1) | P2WI_CCR_CLK_DIV(clk_div), 306 + p2wi->regs + P2WI_CCR); 307 + 308 + ret = i2c_add_adapter(&p2wi->adapter); 309 + if (!ret) 310 + return 0; 311 + 312 + err_reset_assert: 313 + reset_control_assert(p2wi->rstc); 314 + 315 + err_clk_disable: 316 + clk_disable_unprepare(p2wi->clk); 317 + 318 + return ret; 319 + } 320 + 321 + static int p2wi_remove(struct platform_device *dev) 322 + { 323 + struct p2wi *p2wi = platform_get_drvdata(dev); 324 + 325 + reset_control_assert(p2wi->rstc); 326 + clk_disable_unprepare(p2wi->clk); 327 + i2c_del_adapter(&p2wi->adapter); 328 + 329 + return 0; 330 + } 331 + 332 + static struct platform_driver p2wi_driver = { 333 + .probe = p2wi_probe, 334 + .remove = p2wi_remove, 335 + .driver = { 336 + .owner = THIS_MODULE, 337 + .name = "i2c-sunxi-p2wi", 338 + .of_match_table = p2wi_of_match_table, 339 + }, 340 + }; 341 + module_platform_driver(p2wi_driver); 342 + 343 + MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>"); 344 + MODULE_DESCRIPTION("Allwinner P2WI driver"); 345 + MODULE_LICENSE("GPL v2");
+8 -8
drivers/iio/adc/at91_adc.c
··· 510 510 return idev->num_channels; 511 511 } 512 512 513 - static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev, 513 + static int at91_adc_get_trigger_value_by_name(struct iio_dev *idev, 514 514 struct at91_adc_trigger *triggers, 515 515 const char *trigger_name) 516 516 { 517 517 struct at91_adc_state *st = iio_priv(idev); 518 - u8 value = 0; 519 518 int i; 520 519 521 520 for (i = 0; i < st->trigger_number; i++) { ··· 527 528 return -ENOMEM; 528 529 529 530 if (strcmp(trigger_name, name) == 0) { 530 - value = triggers[i].value; 531 531 kfree(name); 532 - break; 532 + if (triggers[i].value == 0) 533 + return -EINVAL; 534 + return triggers[i].value; 533 535 } 534 536 535 537 kfree(name); 536 538 } 537 539 538 - return value; 540 + return -EINVAL; 539 541 } 540 542 541 543 static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) ··· 546 546 struct iio_buffer *buffer = idev->buffer; 547 547 struct at91_adc_reg_desc *reg = st->registers; 548 548 u32 status = at91_adc_readl(st, reg->trigger_register); 549 - u8 value; 549 + int value; 550 550 u8 bit; 551 551 552 552 value = at91_adc_get_trigger_value_by_name(idev, 553 553 st->trigger_list, 554 554 idev->trig->name); 555 - if (value == 0) 556 - return -EINVAL; 555 + if (value < 0) 556 + return value; 557 557 558 558 if (state) { 559 559 st->buffer = kmalloc(idev->scan_bytes, GFP_KERNEL);
+2 -2
drivers/iio/adc/men_z188_adc.c
··· 121 121 indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); 122 122 123 123 mem = mcb_request_mem(dev, "z188-adc"); 124 - if (!mem) 125 - return -ENOMEM; 124 + if (IS_ERR(mem)) 125 + return PTR_ERR(mem); 126 126 127 127 adc->base = ioremap(mem->start, resource_size(mem)); 128 128 if (adc->base == NULL)
+1
drivers/iio/adc/twl4030-madc.c
··· 645 645 req.channels = (1 << channel_no); 646 646 req.method = TWL4030_MADC_SW2; 647 647 req.active = 0; 648 + req.raw = 0; 648 649 req.func_cb = NULL; 649 650 ret = twl4030_madc_conversion(&req); 650 651 if (ret < 0)
+3
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
··· 75 75 (s32)report_val); 76 76 } 77 77 78 + sensor_hub_get_feature(st->hsdev, st->power_state.report_id, 79 + st->power_state.index, 80 + &state_val); 78 81 return 0; 79 82 } 80 83 EXPORT_SYMBOL(hid_sensor_power_state);
+1 -8
drivers/iio/magnetometer/ak8975.c
··· 373 373 { 374 374 struct ak8975_data *data = iio_priv(indio_dev); 375 375 struct i2c_client *client = data->client; 376 - u16 meas_reg; 377 - s16 raw; 378 376 int ret; 379 377 380 378 mutex_lock(&data->lock); ··· 420 422 dev_err(&client->dev, "Read axis data fails\n"); 421 423 goto exit; 422 424 } 423 - meas_reg = ret; 424 425 425 426 mutex_unlock(&data->lock); 426 427 427 - /* Endian conversion of the measured values. */ 428 - raw = (s16) (le16_to_cpu(meas_reg)); 429 - 430 428 /* Clamp to valid range. */ 431 - raw = clamp_t(s16, raw, -4096, 4095); 432 - *val = raw; 429 + *val = clamp_t(s16, ret, -4096, 4095); 433 430 return IIO_VAL_INT; 434 431 435 432 exit:
+3 -3
drivers/iio/pressure/mpl3115.c
··· 98 98 mutex_unlock(&data->lock); 99 99 if (ret < 0) 100 100 return ret; 101 - *val = sign_extend32(be32_to_cpu(tmp) >> 12, 23); 101 + *val = be32_to_cpu(tmp) >> 12; 102 102 return IIO_VAL_INT; 103 103 case IIO_TEMP: /* in 0.0625 celsius / LSB */ 104 104 mutex_lock(&data->lock); ··· 112 112 mutex_unlock(&data->lock); 113 113 if (ret < 0) 114 114 return ret; 115 - *val = sign_extend32(be32_to_cpu(tmp) >> 20, 15); 115 + *val = sign_extend32(be32_to_cpu(tmp) >> 20, 11); 116 116 return IIO_VAL_INT; 117 117 default: 118 118 return -EINVAL; ··· 185 185 BIT(IIO_CHAN_INFO_SCALE), 186 186 .scan_index = 0, 187 187 .scan_type = { 188 - .sign = 's', 188 + .sign = 'u', 189 189 .realbits = 20, 190 190 .storagebits = 32, 191 191 .shift = 12,
+8 -4
drivers/misc/vexpress-syscfg.c
··· 199 199 func = kzalloc(sizeof(*func) + sizeof(*func->template) * num, 200 200 GFP_KERNEL); 201 201 if (!func) 202 - return NULL; 202 + return ERR_PTR(-ENOMEM); 203 203 204 204 func->syscfg = syscfg; 205 205 func->num_templates = num; ··· 231 231 func->regmap = regmap_init(dev, NULL, func, 232 232 &vexpress_syscfg_regmap_config); 233 233 234 - if (IS_ERR(func->regmap)) 234 + if (IS_ERR(func->regmap)) { 235 + void *err = func->regmap; 236 + 235 237 kfree(func); 236 - else 237 - list_add(&func->list, &syscfg->funcs); 238 + return err; 239 + } 240 + 241 + list_add(&func->list, &syscfg->funcs); 238 242 239 243 return func->regmap; 240 244 }
+2 -1
drivers/misc/vmw_balloon.c
··· 17 17 * along with this program; if not, write to the Free Software 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 19 * 20 - * Maintained by: Dmitry Torokhov <dtor@vmware.com> 20 + * Maintained by: Xavier Deguillard <xdeguillard@vmware.com> 21 + * Philip Moltmann <moltmann@vmware.com> 21 22 */ 22 23 23 24 /*
+4 -3
drivers/of/base.c
··· 227 227 np->kobj.kset = of_kset; 228 228 if (!np->parent) { 229 229 /* Nodes without parents are new top level trees */ 230 - rc = kobject_add(&np->kobj, NULL, safe_name(&of_kset->kobj, "base")); 230 + rc = kobject_add(&np->kobj, NULL, "%s", 231 + safe_name(&of_kset->kobj, "base")); 231 232 } else { 232 233 name = safe_name(&np->parent->kobj, kbasename(np->full_name)); 233 234 if (!name || !name[0]) ··· 1961 1960 1962 1961 raw_spin_lock_irqsave(&devtree_lock, flags); 1963 1962 np->sibling = np->parent->child; 1964 - np->allnext = of_allnodes; 1963 + np->allnext = np->parent->allnext; 1964 + np->parent->allnext = np; 1965 1965 np->parent->child = np; 1966 - of_allnodes = np; 1967 1966 of_node_clear_flag(np, OF_DETACHED); 1968 1967 raw_spin_unlock_irqrestore(&devtree_lock, flags); 1969 1968
-4
drivers/of/platform.c
··· 166 166 int ret; 167 167 struct device *dev = &pdev->dev; 168 168 169 - #if defined(CONFIG_MICROBLAZE) 170 - pdev->archdata.dma_mask = 0xffffffffUL; 171 - #endif 172 - 173 169 /* 174 170 * Set default dma-mask to 32 bit. Drivers are expected to setup 175 171 * the correct supported dma_mask.
+2
drivers/regulator/as3722-regulator.c
··· 433 433 }; 434 434 435 435 static const struct regulator_linear_range as3722_ldo_ranges[] = { 436 + REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0), 436 437 REGULATOR_LINEAR_RANGE(825000, 0x01, 0x24, 25000), 437 438 REGULATOR_LINEAR_RANGE(1725000, 0x40, 0x7F, 25000), 438 439 }; ··· 610 609 } 611 610 612 611 static const struct regulator_linear_range as3722_sd2345_ranges[] = { 612 + REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0), 613 613 REGULATOR_LINEAR_RANGE(612500, 0x01, 0x40, 12500), 614 614 REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000), 615 615 REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7F, 50000),
+1 -1
drivers/regulator/ltc3589.c
··· 255 255 struct device_node *node; 256 256 int i, ret; 257 257 258 - node = of_find_node_by_name(dev->of_node, "regulators"); 258 + node = of_get_child_by_name(dev->of_node, "regulators"); 259 259 if (!node) { 260 260 dev_err(dev, "regulators node not found\n"); 261 261 return -EINVAL;
+2
drivers/regulator/palmas-regulator.c
··· 37 37 }; 38 38 39 39 static const struct regulator_linear_range smps_low_ranges[] = { 40 + REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), 40 41 REGULATOR_LINEAR_RANGE(500000, 0x1, 0x6, 0), 41 42 REGULATOR_LINEAR_RANGE(510000, 0x7, 0x79, 10000), 42 43 REGULATOR_LINEAR_RANGE(1650000, 0x7A, 0x7f, 0), 43 44 }; 44 45 45 46 static const struct regulator_linear_range smps_high_ranges[] = { 47 + REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), 46 48 REGULATOR_LINEAR_RANGE(1000000, 0x1, 0x6, 0), 47 49 REGULATOR_LINEAR_RANGE(1020000, 0x7, 0x79, 20000), 48 50 REGULATOR_LINEAR_RANGE(3300000, 0x7A, 0x7f, 0),
+1 -1
drivers/remoteproc/Kconfig
··· 44 44 config DA8XX_REMOTEPROC 45 45 tristate "DA8xx/OMAP-L13x remoteproc support" 46 46 depends on ARCH_DAVINCI_DA8XX 47 - select CMA 47 + select CMA if MMU 48 48 select REMOTEPROC 49 49 select RPMSG 50 50 help
+2 -2
drivers/rtc/rtc-puv3.c
··· 71 71 { 72 72 unsigned int tmp; 73 73 74 - dev_debug(dev, "%s: pie=%d\n", __func__, enabled); 74 + dev_dbg(dev, "%s: pie=%d\n", __func__, enabled); 75 75 76 76 spin_lock_irq(&puv3_rtc_pie_lock); 77 77 tmp = readl(RTC_RTSR) & ~RTC_RTSR_HZE; ··· 140 140 rtc_tm_to_time(tm, &rtcalarm_count); 141 141 writel(rtcalarm_count, RTC_RTAR); 142 142 143 - puv3_rtc_setaie(&dev->dev, alrm->enabled); 143 + puv3_rtc_setaie(dev, alrm->enabled); 144 144 145 145 if (alrm->enabled) 146 146 enable_irq_wake(puv3_rtc_alarmno);
+1 -1
drivers/s390/block/dcssblk.c
··· 593 593 dev_info->start = dcssblk_find_lowest_addr(dev_info); 594 594 dev_info->end = dcssblk_find_highest_addr(dev_info); 595 595 596 - dev_set_name(&dev_info->dev, dev_info->segment_name); 596 + dev_set_name(&dev_info->dev, "%s", dev_info->segment_name); 597 597 dev_info->dev.release = dcssblk_release_segment; 598 598 dev_info->dev.groups = dcssblk_dev_attr_groups; 599 599 INIT_LIST_HEAD(&dev_info->lh);
-1
drivers/s390/char/Makefile
··· 19 19 obj-$(CONFIG_SCLP_CPI) += sclp_cpi.o 20 20 obj-$(CONFIG_SCLP_ASYNC) += sclp_async.o 21 21 22 - obj-$(CONFIG_ZVM_WATCHDOG) += vmwatchdog.o 23 22 obj-$(CONFIG_VMLOGRDR) += vmlogrdr.o 24 23 obj-$(CONFIG_VMCP) += vmcp.o 25 24
-2
drivers/s390/char/sclp_vt220.c
··· 838 838 { 839 839 int rc; 840 840 841 - if (!CONSOLE_IS_SCLP) 842 - return 0; 843 841 rc = __sclp_vt220_init(sclp_console_pages); 844 842 if (rc) 845 843 return rc;
+1 -1
drivers/s390/char/vmlogrdr.c
··· 761 761 762 762 dev = kzalloc(sizeof(struct device), GFP_KERNEL); 763 763 if (dev) { 764 - dev_set_name(dev, priv->internal_name); 764 + dev_set_name(dev, "%s", priv->internal_name); 765 765 dev->bus = &iucv_bus; 766 766 dev->parent = iucv_root; 767 767 dev->driver = &vmlogrdr_driver;
-338
drivers/s390/char/vmwatchdog.c
··· 1 - /* 2 - * Watchdog implementation based on z/VM Watchdog Timer API 3 - * 4 - * Copyright IBM Corp. 2004, 2009 5 - * 6 - * The user space watchdog daemon can use this driver as 7 - * /dev/vmwatchdog to have z/VM execute the specified CP 8 - * command when the timeout expires. The default command is 9 - * "IPL", which which cause an immediate reboot. 10 - */ 11 - #define KMSG_COMPONENT "vmwatchdog" 12 - #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 13 - 14 - #include <linux/init.h> 15 - #include <linux/fs.h> 16 - #include <linux/kernel.h> 17 - #include <linux/miscdevice.h> 18 - #include <linux/module.h> 19 - #include <linux/moduleparam.h> 20 - #include <linux/slab.h> 21 - #include <linux/suspend.h> 22 - #include <linux/watchdog.h> 23 - 24 - #include <asm/ebcdic.h> 25 - #include <asm/io.h> 26 - #include <asm/uaccess.h> 27 - 28 - #define MAX_CMDLEN 240 29 - #define MIN_INTERVAL 15 30 - static char vmwdt_cmd[MAX_CMDLEN] = "IPL"; 31 - static bool vmwdt_conceal; 32 - 33 - static bool vmwdt_nowayout = WATCHDOG_NOWAYOUT; 34 - 35 - MODULE_LICENSE("GPL"); 36 - MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>"); 37 - MODULE_DESCRIPTION("z/VM Watchdog Timer"); 38 - module_param_string(cmd, vmwdt_cmd, MAX_CMDLEN, 0644); 39 - MODULE_PARM_DESC(cmd, "CP command that is run when the watchdog triggers"); 40 - module_param_named(conceal, vmwdt_conceal, bool, 0644); 41 - MODULE_PARM_DESC(conceal, "Enable the CONCEAL CP option while the watchdog " 42 - " is active"); 43 - module_param_named(nowayout, vmwdt_nowayout, bool, 0); 44 - MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started" 45 - " (default=CONFIG_WATCHDOG_NOWAYOUT)"); 46 - MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 47 - 48 - static unsigned int vmwdt_interval = 60; 49 - static unsigned long vmwdt_is_open; 50 - static int vmwdt_expect_close; 51 - 52 - static DEFINE_MUTEX(vmwdt_mutex); 53 - 54 - #define VMWDT_OPEN 0 /* devnode is open or suspend in progress */ 55 - #define VMWDT_RUNNING 1 /* The watchdog is armed */ 56 - 57 - enum vmwdt_func { 58 - /* function codes */ 59 - wdt_init = 0, 60 - wdt_change = 1, 61 - wdt_cancel = 2, 62 - /* flags */ 63 - wdt_conceal = 0x80000000, 64 - }; 65 - 66 - static int __diag288(enum vmwdt_func func, unsigned int timeout, 67 - char *cmd, size_t len) 68 - { 69 - register unsigned long __func asm("2") = func; 70 - register unsigned long __timeout asm("3") = timeout; 71 - register unsigned long __cmdp asm("4") = virt_to_phys(cmd); 72 - register unsigned long __cmdl asm("5") = len; 73 - int err; 74 - 75 - err = -EINVAL; 76 - asm volatile( 77 - " diag %1,%3,0x288\n" 78 - "0: la %0,0\n" 79 - "1:\n" 80 - EX_TABLE(0b,1b) 81 - : "+d" (err) : "d"(__func), "d"(__timeout), 82 - "d"(__cmdp), "d"(__cmdl) : "1", "cc"); 83 - return err; 84 - } 85 - 86 - static int vmwdt_keepalive(void) 87 - { 88 - /* we allocate new memory every time to avoid having 89 - * to track the state. static allocation is not an 90 - * option since that might not be contiguous in real 91 - * storage in case of a modular build */ 92 - static char *ebc_cmd; 93 - size_t len; 94 - int ret; 95 - unsigned int func; 96 - 97 - ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL); 98 - if (!ebc_cmd) 99 - return -ENOMEM; 100 - 101 - len = strlcpy(ebc_cmd, vmwdt_cmd, MAX_CMDLEN); 102 - ASCEBC(ebc_cmd, MAX_CMDLEN); 103 - EBC_TOUPPER(ebc_cmd, MAX_CMDLEN); 104 - 105 - func = vmwdt_conceal ? (wdt_init | wdt_conceal) : wdt_init; 106 - set_bit(VMWDT_RUNNING, &vmwdt_is_open); 107 - ret = __diag288(func, vmwdt_interval, ebc_cmd, len); 108 - WARN_ON(ret != 0); 109 - kfree(ebc_cmd); 110 - return ret; 111 - } 112 - 113 - static int vmwdt_disable(void) 114 - { 115 - char cmd[] = {'\0'}; 116 - int ret = __diag288(wdt_cancel, 0, cmd, 0); 117 - WARN_ON(ret != 0); 118 - clear_bit(VMWDT_RUNNING, &vmwdt_is_open); 119 - return ret; 120 - } 121 - 122 - static int __init vmwdt_probe(void) 123 - { 124 - /* there is no real way to see if the watchdog is supported, 125 - * so we try initializing it with a NOP command ("BEGIN") 126 - * that won't cause any harm even if the following disable 127 - * fails for some reason */ 128 - char ebc_begin[] = { 129 - 194, 197, 199, 201, 213 130 - }; 131 - if (__diag288(wdt_init, 15, ebc_begin, sizeof(ebc_begin)) != 0) 132 - return -EINVAL; 133 - return vmwdt_disable(); 134 - } 135 - 136 - static int vmwdt_open(struct inode *i, struct file *f) 137 - { 138 - int ret; 139 - if (test_and_set_bit(VMWDT_OPEN, &vmwdt_is_open)) 140 - return -EBUSY; 141 - ret = vmwdt_keepalive(); 142 - if (ret) 143 - clear_bit(VMWDT_OPEN, &vmwdt_is_open); 144 - return ret ? ret : nonseekable_open(i, f); 145 - } 146 - 147 - static int vmwdt_close(struct inode *i, struct file *f) 148 - { 149 - if (vmwdt_expect_close == 42) 150 - vmwdt_disable(); 151 - vmwdt_expect_close = 0; 152 - clear_bit(VMWDT_OPEN, &vmwdt_is_open); 153 - return 0; 154 - } 155 - 156 - static struct watchdog_info vmwdt_info = { 157 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, 158 - .firmware_version = 0, 159 - .identity = "z/VM Watchdog Timer", 160 - }; 161 - 162 - static int __vmwdt_ioctl(unsigned int cmd, unsigned long arg) 163 - { 164 - switch (cmd) { 165 - case WDIOC_GETSUPPORT: 166 - if (copy_to_user((void __user *)arg, &vmwdt_info, 167 - sizeof(vmwdt_info))) 168 - return -EFAULT; 169 - return 0; 170 - case WDIOC_GETSTATUS: 171 - case WDIOC_GETBOOTSTATUS: 172 - return put_user(0, (int __user *)arg); 173 - case WDIOC_GETTEMP: 174 - return -EINVAL; 175 - case WDIOC_SETOPTIONS: 176 - { 177 - int options, ret; 178 - if (get_user(options, (int __user *)arg)) 179 - return -EFAULT; 180 - ret = -EINVAL; 181 - if (options & WDIOS_DISABLECARD) { 182 - ret = vmwdt_disable(); 183 - if (ret) 184 - return ret; 185 - } 186 - if (options & WDIOS_ENABLECARD) { 187 - ret = vmwdt_keepalive(); 188 - } 189 - return ret; 190 - } 191 - case WDIOC_GETTIMEOUT: 192 - return put_user(vmwdt_interval, (int __user *)arg); 193 - case WDIOC_SETTIMEOUT: 194 - { 195 - int interval; 196 - if (get_user(interval, (int __user *)arg)) 197 - return -EFAULT; 198 - if (interval < MIN_INTERVAL) 199 - return -EINVAL; 200 - vmwdt_interval = interval; 201 - } 202 - return vmwdt_keepalive(); 203 - case WDIOC_KEEPALIVE: 204 - return vmwdt_keepalive(); 205 - } 206 - return -EINVAL; 207 - } 208 - 209 - static long vmwdt_ioctl(struct file *f, unsigned int cmd, unsigned long arg) 210 - { 211 - int rc; 212 - 213 - mutex_lock(&vmwdt_mutex); 214 - rc = __vmwdt_ioctl(cmd, arg); 215 - mutex_unlock(&vmwdt_mutex); 216 - return (long) rc; 217 - } 218 - 219 - static ssize_t vmwdt_write(struct file *f, const char __user *buf, 220 - size_t count, loff_t *ppos) 221 - { 222 - if(count) { 223 - if (!vmwdt_nowayout) { 224 - size_t i; 225 - 226 - /* note: just in case someone wrote the magic character 227 - * five months ago... */ 228 - vmwdt_expect_close = 0; 229 - 230 - for (i = 0; i != count; i++) { 231 - char c; 232 - if (get_user(c, buf+i)) 233 - return -EFAULT; 234 - if (c == 'V') 235 - vmwdt_expect_close = 42; 236 - } 237 - } 238 - /* someone wrote to us, we should restart timer */ 239 - vmwdt_keepalive(); 240 - } 241 - return count; 242 - } 243 - 244 - static int vmwdt_resume(void) 245 - { 246 - clear_bit(VMWDT_OPEN, &vmwdt_is_open); 247 - return NOTIFY_DONE; 248 - } 249 - 250 - /* 251 - * It makes no sense to go into suspend while the watchdog is running. 252 - * Depending on the memory size, the watchdog might trigger, while we 253 - * are still saving the memory. 254 - * We reuse the open flag to ensure that suspend and watchdog open are 255 - * exclusive operations 256 - */ 257 - static int vmwdt_suspend(void) 258 - { 259 - if (test_and_set_bit(VMWDT_OPEN, &vmwdt_is_open)) { 260 - pr_err("The system cannot be suspended while the watchdog" 261 - " is in use\n"); 262 - return notifier_from_errno(-EBUSY); 263 - } 264 - if (test_bit(VMWDT_RUNNING, &vmwdt_is_open)) { 265 - clear_bit(VMWDT_OPEN, &vmwdt_is_open); 266 - pr_err("The system cannot be suspended while the watchdog" 267 - " is running\n"); 268 - return notifier_from_errno(-EBUSY); 269 - } 270 - return NOTIFY_DONE; 271 - } 272 - 273 - /* 274 - * This function is called for suspend and resume. 275 - */ 276 - static int vmwdt_power_event(struct notifier_block *this, unsigned long event, 277 - void *ptr) 278 - { 279 - switch (event) { 280 - case PM_POST_HIBERNATION: 281 - case PM_POST_SUSPEND: 282 - return vmwdt_resume(); 283 - case PM_HIBERNATION_PREPARE: 284 - case PM_SUSPEND_PREPARE: 285 - return vmwdt_suspend(); 286 - default: 287 - return NOTIFY_DONE; 288 - } 289 - } 290 - 291 - static struct notifier_block vmwdt_power_notifier = { 292 - .notifier_call = vmwdt_power_event, 293 - }; 294 - 295 - static const struct file_operations vmwdt_fops = { 296 - .open = &vmwdt_open, 297 - .release = &vmwdt_close, 298 - .unlocked_ioctl = &vmwdt_ioctl, 299 - .write = &vmwdt_write, 300 - .owner = THIS_MODULE, 301 - .llseek = noop_llseek, 302 - }; 303 - 304 - static struct miscdevice vmwdt_dev = { 305 - .minor = WATCHDOG_MINOR, 306 - .name = "watchdog", 307 - .fops = &vmwdt_fops, 308 - }; 309 - 310 - static int __init vmwdt_init(void) 311 - { 312 - int ret; 313 - 314 - ret = vmwdt_probe(); 315 - if (ret) 316 - return ret; 317 - ret = register_pm_notifier(&vmwdt_power_notifier); 318 - if (ret) 319 - return ret; 320 - /* 321 - * misc_register() has to be the last action in module_init(), because 322 - * file operations will be available right after this. 323 - */ 324 - ret = misc_register(&vmwdt_dev); 325 - if (ret) { 326 - unregister_pm_notifier(&vmwdt_power_notifier); 327 - return ret; 328 - } 329 - return 0; 330 - } 331 - module_init(vmwdt_init); 332 - 333 - static void __exit vmwdt_exit(void) 334 - { 335 - unregister_pm_notifier(&vmwdt_power_notifier); 336 - misc_deregister(&vmwdt_dev); 337 - } 338 - module_exit(vmwdt_exit);
+6 -7
drivers/s390/cio/airq.c
··· 196 196 */ 197 197 unsigned long airq_iv_alloc(struct airq_iv *iv, unsigned long num) 198 198 { 199 - unsigned long bit, i; 199 + unsigned long bit, i, flags; 200 200 201 201 if (!iv->avail || num == 0) 202 202 return -1UL; 203 - spin_lock(&iv->lock); 203 + spin_lock_irqsave(&iv->lock, flags); 204 204 bit = find_first_bit_inv(iv->avail, iv->bits); 205 205 while (bit + num <= iv->bits) { 206 206 for (i = 1; i < num; i++) ··· 218 218 } 219 219 if (bit + num > iv->bits) 220 220 bit = -1UL; 221 - spin_unlock(&iv->lock); 221 + spin_unlock_irqrestore(&iv->lock, flags); 222 222 return bit; 223 - 224 223 } 225 224 EXPORT_SYMBOL(airq_iv_alloc); 226 225 ··· 231 232 */ 232 233 void airq_iv_free(struct airq_iv *iv, unsigned long bit, unsigned long num) 233 234 { 234 - unsigned long i; 235 + unsigned long i, flags; 235 236 236 237 if (!iv->avail || num == 0) 237 238 return; 238 - spin_lock(&iv->lock); 239 + spin_lock_irqsave(&iv->lock, flags); 239 240 for (i = 0; i < num; i++) { 240 241 /* Clear (possibly left over) interrupt bit */ 241 242 clear_bit_inv(bit + i, iv->vector); ··· 247 248 while (iv->end > 0 && !test_bit_inv(iv->end - 1, iv->avail)) 248 249 iv->end--; 249 250 } 250 - spin_unlock(&iv->lock); 251 + spin_unlock_irqrestore(&iv->lock, flags); 251 252 } 252 253 EXPORT_SYMBOL(airq_iv_free); 253 254
+11 -17
drivers/s390/cio/ccwgroup.c
··· 184 184 const char *buf, size_t count) 185 185 { 186 186 struct ccwgroup_device *gdev = to_ccwgroupdev(dev); 187 - int rc; 187 + int rc = 0; 188 188 189 189 /* Prevent concurrent online/offline processing and ungrouping. */ 190 190 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) ··· 196 196 197 197 if (device_remove_file_self(dev, attr)) 198 198 ccwgroup_ungroup(gdev); 199 + else 200 + rc = -ENODEV; 199 201 out: 200 202 if (rc) { 201 - if (rc != -EAGAIN) 202 - /* Release onoff "lock" when ungrouping failed. */ 203 - atomic_set(&gdev->onoff, 0); 203 + /* Release onoff "lock" when ungrouping failed. */ 204 + atomic_set(&gdev->onoff, 0); 204 205 return rc; 205 206 } 206 207 return count; ··· 228 227 container_of(work, struct ccwgroup_device, ungroup_work); 229 228 230 229 ccwgroup_ungroup(gdev); 230 + put_device(&gdev->dev); 231 231 } 232 232 233 233 static void ccwgroup_release(struct device *dev) ··· 414 412 { 415 413 struct ccwgroup_device *gdev = to_ccwgroupdev(data); 416 414 417 - if (action == BUS_NOTIFY_UNBIND_DRIVER) 415 + if (action == BUS_NOTIFY_UNBIND_DRIVER) { 416 + get_device(&gdev->dev); 418 417 schedule_work(&gdev->ungroup_work); 418 + } 419 419 420 420 return NOTIFY_OK; 421 421 } ··· 586 582 __ccwgroup_match_all))) { 587 583 struct ccwgroup_device *gdev = to_ccwgroupdev(dev); 588 584 589 - mutex_lock(&gdev->reg_mutex); 590 - __ccwgroup_remove_symlinks(gdev); 591 - device_unregister(dev); 592 - __ccwgroup_remove_cdev_refs(gdev); 593 - mutex_unlock(&gdev->reg_mutex); 585 + ccwgroup_ungroup(gdev); 594 586 put_device(dev); 595 587 } 596 588 driver_unregister(&cdriver->driver); ··· 633 633 get_device(&gdev->dev); 634 634 spin_unlock_irq(cdev->ccwlock); 635 635 /* Unregister group device. */ 636 - mutex_lock(&gdev->reg_mutex); 637 - if (device_is_registered(&gdev->dev)) { 638 - __ccwgroup_remove_symlinks(gdev); 639 - device_unregister(&gdev->dev); 640 - __ccwgroup_remove_cdev_refs(gdev); 641 - } 642 - mutex_unlock(&gdev->reg_mutex); 636 + ccwgroup_ungroup(gdev); 643 637 /* Release ccwgroup device reference for local processing. */ 644 638 put_device(&gdev->dev); 645 639 }
+2
drivers/s390/cio/cio.c
··· 602 602 603 603 #ifdef CONFIG_CCW_CONSOLE 604 604 static struct subchannel *console_sch; 605 + static struct lock_class_key console_sch_key; 605 606 606 607 /* 607 608 * Use cio_tsch to update the subchannel status and call the interrupt handler ··· 687 686 if (IS_ERR(sch)) 688 687 return sch; 689 688 689 + lockdep_set_class(sch->lock, &console_sch_key); 690 690 isc_register(CONSOLE_ISC); 691 691 sch->config.isc = CONSOLE_ISC; 692 692 sch->config.intparm = (u32)(addr_t)sch;
+36 -35
drivers/s390/cio/device.c
··· 678 678 NULL, 679 679 }; 680 680 681 - /* this is a simple abstraction for device_register that sets the 682 - * correct bus type and adds the bus specific files */ 683 - static int ccw_device_register(struct ccw_device *cdev) 681 + static int ccw_device_add(struct ccw_device *cdev) 684 682 { 685 683 struct device *dev = &cdev->dev; 686 - int ret; 687 684 688 685 dev->bus = &ccw_bus_type; 689 - ret = dev_set_name(&cdev->dev, "0.%x.%04x", cdev->private->dev_id.ssid, 690 - cdev->private->dev_id.devno); 691 - if (ret) 692 - return ret; 693 686 return device_add(dev); 694 687 } 695 688 ··· 757 764 static int io_subchannel_initialize_dev(struct subchannel *sch, 758 765 struct ccw_device *cdev) 759 766 { 760 - cdev->private->cdev = cdev; 761 - cdev->private->int_class = IRQIO_CIO; 762 - atomic_set(&cdev->private->onoff, 0); 767 + struct ccw_device_private *priv = cdev->private; 768 + int ret; 769 + 770 + priv->cdev = cdev; 771 + priv->int_class = IRQIO_CIO; 772 + priv->state = DEV_STATE_NOT_OPER; 773 + priv->dev_id.devno = sch->schib.pmcw.dev; 774 + priv->dev_id.ssid = sch->schid.ssid; 775 + priv->schid = sch->schid; 776 + 777 + INIT_WORK(&priv->todo_work, ccw_device_todo); 778 + INIT_LIST_HEAD(&priv->cmb_list); 779 + init_waitqueue_head(&priv->wait_q); 780 + init_timer(&priv->timer); 781 + 782 + atomic_set(&priv->onoff, 0); 783 + cdev->ccwlock = sch->lock; 763 784 cdev->dev.parent = &sch->dev; 764 785 cdev->dev.release = ccw_device_release; 765 - INIT_WORK(&cdev->private->todo_work, ccw_device_todo); 766 786 cdev->dev.groups = ccwdev_attr_groups; 767 787 /* Do first half of device_register. */ 768 788 device_initialize(&cdev->dev); 789 + ret = dev_set_name(&cdev->dev, "0.%x.%04x", cdev->private->dev_id.ssid, 790 + cdev->private->dev_id.devno); 791 + if (ret) 792 + goto out_put; 769 793 if (!get_device(&sch->dev)) { 770 - /* Release reference from device_initialize(). */ 771 - put_device(&cdev->dev); 772 - return -ENODEV; 794 + ret = -ENODEV; 795 + goto out_put; 773 796 } 774 - cdev->private->flags.initialized = 1; 797 + priv->flags.initialized = 1; 798 + spin_lock_irq(sch->lock); 799 + sch_set_cdev(sch, cdev); 800 + spin_unlock_irq(sch->lock); 775 801 return 0; 802 + 803 + out_put: 804 + /* Release reference from device_initialize(). */ 805 + put_device(&cdev->dev); 806 + return ret; 776 807 } 777 808 778 809 static struct ccw_device * io_subchannel_create_ccwdev(struct subchannel *sch) ··· 875 858 dev_set_uevent_suppress(&sch->dev, 0); 876 859 kobject_uevent(&sch->dev.kobj, KOBJ_ADD); 877 860 /* make it known to the system */ 878 - ret = ccw_device_register(cdev); 861 + ret = ccw_device_add(cdev); 879 862 if (ret) { 880 863 CIO_MSG_EVENT(0, "Could not register ccw dev 0.%x.%04x: %d\n", 881 864 cdev->private->dev_id.ssid, ··· 940 923 941 924 static void io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) 942 925 { 943 - struct ccw_device_private *priv; 944 - 945 - cdev->ccwlock = sch->lock; 946 - 947 - /* Init private data. */ 948 - priv = cdev->private; 949 - priv->dev_id.devno = sch->schib.pmcw.dev; 950 - priv->dev_id.ssid = sch->schid.ssid; 951 - priv->schid = sch->schid; 952 - priv->state = DEV_STATE_NOT_OPER; 953 - INIT_LIST_HEAD(&priv->cmb_list); 954 - init_waitqueue_head(&priv->wait_q); 955 - init_timer(&priv->timer); 956 - 957 926 /* Increase counter of devices currently in recognition. */ 958 927 atomic_inc(&ccw_device_init_count); 959 928 960 929 /* Start async. device sensing. */ 961 930 spin_lock_irq(sch->lock); 962 - sch_set_cdev(sch, cdev); 963 931 ccw_device_recognition(cdev); 964 932 spin_unlock_irq(sch->lock); 965 933 } ··· 1085 1083 dev_set_uevent_suppress(&sch->dev, 0); 1086 1084 kobject_uevent(&sch->dev.kobj, KOBJ_ADD); 1087 1085 cdev = sch_get_cdev(sch); 1088 - rc = ccw_device_register(cdev); 1086 + rc = ccw_device_add(cdev); 1089 1087 if (rc) { 1090 1088 /* Release online reference. */ 1091 1089 put_device(&cdev->dev); ··· 1599 1597 if (rc) 1600 1598 return rc; 1601 1599 sch->driver = &io_subchannel_driver; 1602 - sch_set_cdev(sch, cdev); 1603 1600 io_subchannel_recog(cdev, sch); 1604 1601 /* Now wait for the async. recognition to come to an end. */ 1605 1602 spin_lock_irq(cdev->ccwlock); ··· 1640 1639 put_device(&sch->dev); 1641 1640 return ERR_PTR(-ENOMEM); 1642 1641 } 1642 + set_io_private(sch, io_priv); 1643 1643 cdev = io_subchannel_create_ccwdev(sch); 1644 1644 if (IS_ERR(cdev)) { 1645 1645 put_device(&sch->dev); ··· 1648 1646 return cdev; 1649 1647 } 1650 1648 cdev->drv = drv; 1651 - set_io_private(sch, io_priv); 1652 1649 ccw_device_set_int_class(cdev); 1653 1650 return cdev; 1654 1651 }
+72 -7
drivers/s390/cio/qdio_debug.c
··· 7 7 #include <linux/debugfs.h> 8 8 #include <linux/uaccess.h> 9 9 #include <linux/export.h> 10 + #include <linux/slab.h> 10 11 #include <asm/debug.h> 11 12 #include "qdio_debug.h" 12 13 #include "qdio.h" ··· 17 16 18 17 static struct dentry *debugfs_root; 19 18 #define QDIO_DEBUGFS_NAME_LEN 10 19 + #define QDIO_DBF_NAME_LEN 20 20 20 21 - void qdio_allocate_dbf(struct qdio_initialize *init_data, 21 + struct qdio_dbf_entry { 22 + char dbf_name[QDIO_DBF_NAME_LEN]; 23 + debug_info_t *dbf_info; 24 + struct list_head dbf_list; 25 + }; 26 + 27 + static LIST_HEAD(qdio_dbf_list); 28 + static DEFINE_MUTEX(qdio_dbf_list_mutex); 29 + 30 + static debug_info_t *qdio_get_dbf_entry(char *name) 31 + { 32 + struct qdio_dbf_entry *entry; 33 + debug_info_t *rc = NULL; 34 + 35 + mutex_lock(&qdio_dbf_list_mutex); 36 + list_for_each_entry(entry, &qdio_dbf_list, dbf_list) { 37 + if (strcmp(entry->dbf_name, name) == 0) { 38 + rc = entry->dbf_info; 39 + break; 40 + } 41 + } 42 + mutex_unlock(&qdio_dbf_list_mutex); 43 + return rc; 44 + } 45 + 46 + static void qdio_clear_dbf_list(void) 47 + { 48 + struct qdio_dbf_entry *entry, *tmp; 49 + 50 + mutex_lock(&qdio_dbf_list_mutex); 51 + list_for_each_entry_safe(entry, tmp, &qdio_dbf_list, dbf_list) { 52 + list_del(&entry->dbf_list); 53 + debug_unregister(entry->dbf_info); 54 + kfree(entry); 55 + } 56 + mutex_unlock(&qdio_dbf_list_mutex); 57 + } 58 + 59 + int qdio_allocate_dbf(struct qdio_initialize *init_data, 22 60 struct qdio_irq *irq_ptr) 23 61 { 24 - char text[20]; 62 + char text[QDIO_DBF_NAME_LEN]; 63 + struct qdio_dbf_entry *new_entry; 25 64 26 65 DBF_EVENT("qfmt:%1d", init_data->q_format); 27 66 DBF_HEX(init_data->adapter_name, 8); ··· 79 38 DBF_EVENT("irq:%8lx", (unsigned long)irq_ptr); 80 39 81 40 /* allocate trace view for the interface */ 82 - snprintf(text, 20, "qdio_%s", dev_name(&init_data->cdev->dev)); 83 - irq_ptr->debug_area = debug_register(text, 2, 1, 16); 84 - debug_register_view(irq_ptr->debug_area, &debug_hex_ascii_view); 85 - debug_set_level(irq_ptr->debug_area, DBF_WARN); 86 - DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created"); 41 + snprintf(text, QDIO_DBF_NAME_LEN, "qdio_%s", 42 + dev_name(&init_data->cdev->dev)); 43 + irq_ptr->debug_area = qdio_get_dbf_entry(text); 44 + if (irq_ptr->debug_area) 45 + DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf reused"); 46 + else { 47 + irq_ptr->debug_area = debug_register(text, 2, 1, 16); 48 + if (!irq_ptr->debug_area) 49 + return -ENOMEM; 50 + if (debug_register_view(irq_ptr->debug_area, 51 + &debug_hex_ascii_view)) { 52 + debug_unregister(irq_ptr->debug_area); 53 + return -ENOMEM; 54 + } 55 + debug_set_level(irq_ptr->debug_area, DBF_WARN); 56 + DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created"); 57 + new_entry = kzalloc(sizeof(struct qdio_dbf_entry), GFP_KERNEL); 58 + if (!new_entry) { 59 + debug_unregister(irq_ptr->debug_area); 60 + return -ENOMEM; 61 + } 62 + strlcpy(new_entry->dbf_name, text, QDIO_DBF_NAME_LEN); 63 + new_entry->dbf_info = irq_ptr->debug_area; 64 + mutex_lock(&qdio_dbf_list_mutex); 65 + list_add(&new_entry->dbf_list, &qdio_dbf_list); 66 + mutex_unlock(&qdio_dbf_list_mutex); 67 + } 68 + return 0; 87 69 } 88 70 89 71 static int qstat_show(struct seq_file *m, void *v) ··· 364 300 365 301 void qdio_debug_exit(void) 366 302 { 303 + qdio_clear_dbf_list(); 367 304 debugfs_remove(debugfs_root); 368 305 if (qdio_dbf_setup) 369 306 debug_unregister(qdio_dbf_setup);
+1 -1
drivers/s390/cio/qdio_debug.h
··· 75 75 } 76 76 } 77 77 78 - void qdio_allocate_dbf(struct qdio_initialize *init_data, 78 + int qdio_allocate_dbf(struct qdio_initialize *init_data, 79 79 struct qdio_irq *irq_ptr); 80 80 void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, 81 81 struct ccw_device *cdev);
+7 -9
drivers/s390/cio/qdio_main.c
··· 409 409 set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT); 410 410 } 411 411 412 - static inline void account_sbals(struct qdio_q *q, int count) 412 + static inline void account_sbals(struct qdio_q *q, unsigned int count) 413 413 { 414 - int pos = 0; 414 + int pos; 415 415 416 416 q->q_stats.nr_sbal_total += count; 417 417 if (count == QDIO_MAX_BUFFERS_MASK) { 418 418 q->q_stats.nr_sbals[7]++; 419 419 return; 420 420 } 421 - while (count >>= 1) 422 - pos++; 421 + pos = ilog2(count); 423 422 q->q_stats.nr_sbals[pos]++; 424 423 } 425 424 ··· 1233 1234 return -ENODEV; 1234 1235 1235 1236 DBF_EVENT("qfree:%4x", cdev->private->schid.sch_no); 1237 + DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf abandoned"); 1236 1238 mutex_lock(&irq_ptr->setup_mutex); 1237 1239 1238 - if (irq_ptr->debug_area != NULL) { 1239 - debug_unregister(irq_ptr->debug_area); 1240 - irq_ptr->debug_area = NULL; 1241 - } 1240 + irq_ptr->debug_area = NULL; 1242 1241 cdev->private->qdio_data = NULL; 1243 1242 mutex_unlock(&irq_ptr->setup_mutex); 1244 1243 ··· 1273 1276 goto out_err; 1274 1277 1275 1278 mutex_init(&irq_ptr->setup_mutex); 1276 - qdio_allocate_dbf(init_data, irq_ptr); 1279 + if (qdio_allocate_dbf(init_data, irq_ptr)) 1280 + goto out_rel; 1277 1281 1278 1282 /* 1279 1283 * Allocate a page for the chsc calls in qdio_establish.
+2 -2
drivers/s390/crypto/ap_bus.c
··· 77 77 * Module parameter 78 78 */ 79 79 int ap_domain_index = -1; /* Adjunct Processor Domain Index */ 80 - module_param_named(domain, ap_domain_index, int, 0000); 80 + module_param_named(domain, ap_domain_index, int, S_IRUSR|S_IRGRP); 81 81 MODULE_PARM_DESC(domain, "domain index for ap devices"); 82 82 EXPORT_SYMBOL(ap_domain_index); 83 83 84 84 static int ap_thread_flag = 0; 85 - module_param_named(poll_thread, ap_thread_flag, int, 0000); 85 + module_param_named(poll_thread, ap_thread_flag, int, S_IRUSR|S_IRGRP); 86 86 MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 0 (off)."); 87 87 88 88 static struct device *ap_root_device = NULL;
+1 -1
drivers/s390/crypto/zcrypt_api.c
··· 356 356 357 357 zops = __ops_lookup(name, variant); 358 358 if (!zops) { 359 - request_module(name); 359 + request_module("%s", name); 360 360 zops = __ops_lookup(name, variant); 361 361 } 362 362 if ((!zops) || (!try_module_get(zops->owner)))
+5 -5
drivers/scsi/mvsas/mv_94xx.c
··· 564 564 u32 tmp; 565 565 566 566 tmp = mr32(MVS_GBL_CTL); 567 - tmp |= (IRQ_SAS_A | IRQ_SAS_B); 567 + tmp |= (MVS_IRQ_SAS_A | MVS_IRQ_SAS_B); 568 568 mw32(MVS_GBL_INT_STAT, tmp); 569 569 writel(tmp, regs + 0x0C); 570 570 writel(tmp, regs + 0x10); ··· 580 580 581 581 tmp = mr32(MVS_GBL_CTL); 582 582 583 - tmp &= ~(IRQ_SAS_A | IRQ_SAS_B); 583 + tmp &= ~(MVS_IRQ_SAS_A | MVS_IRQ_SAS_B); 584 584 mw32(MVS_GBL_INT_STAT, tmp); 585 585 writel(tmp, regs + 0x0C); 586 586 writel(tmp, regs + 0x10); ··· 596 596 if (!(mvi->flags & MVF_FLAG_SOC)) { 597 597 stat = mr32(MVS_GBL_INT_STAT); 598 598 599 - if (!(stat & (IRQ_SAS_A | IRQ_SAS_B))) 599 + if (!(stat & (MVS_IRQ_SAS_A | MVS_IRQ_SAS_B))) 600 600 return 0; 601 601 } 602 602 return stat; ··· 606 606 { 607 607 void __iomem *regs = mvi->regs; 608 608 609 - if (((stat & IRQ_SAS_A) && mvi->id == 0) || 610 - ((stat & IRQ_SAS_B) && mvi->id == 1)) { 609 + if (((stat & MVS_IRQ_SAS_A) && mvi->id == 0) || 610 + ((stat & MVS_IRQ_SAS_B) && mvi->id == 1)) { 611 611 mw32_f(MVS_INT_STAT, CINT_DONE); 612 612 613 613 spin_lock(&mvi->lock);
+29 -29
drivers/scsi/mvsas/mv_94xx.h
··· 150 150 151 151 enum pci_interrupt_cause { 152 152 /* MAIN_IRQ_CAUSE (R10200) Bits*/ 153 - IRQ_COM_IN_I2O_IOP0 = (1 << 0), 154 - IRQ_COM_IN_I2O_IOP1 = (1 << 1), 155 - IRQ_COM_IN_I2O_IOP2 = (1 << 2), 156 - IRQ_COM_IN_I2O_IOP3 = (1 << 3), 157 - IRQ_COM_OUT_I2O_HOS0 = (1 << 4), 158 - IRQ_COM_OUT_I2O_HOS1 = (1 << 5), 159 - IRQ_COM_OUT_I2O_HOS2 = (1 << 6), 160 - IRQ_COM_OUT_I2O_HOS3 = (1 << 7), 161 - IRQ_PCIF_TO_CPU_DRBL0 = (1 << 8), 162 - IRQ_PCIF_TO_CPU_DRBL1 = (1 << 9), 163 - IRQ_PCIF_TO_CPU_DRBL2 = (1 << 10), 164 - IRQ_PCIF_TO_CPU_DRBL3 = (1 << 11), 165 - IRQ_PCIF_DRBL0 = (1 << 12), 166 - IRQ_PCIF_DRBL1 = (1 << 13), 167 - IRQ_PCIF_DRBL2 = (1 << 14), 168 - IRQ_PCIF_DRBL3 = (1 << 15), 169 - IRQ_XOR_A = (1 << 16), 170 - IRQ_XOR_B = (1 << 17), 171 - IRQ_SAS_A = (1 << 18), 172 - IRQ_SAS_B = (1 << 19), 173 - IRQ_CPU_CNTRL = (1 << 20), 174 - IRQ_GPIO = (1 << 21), 175 - IRQ_UART = (1 << 22), 176 - IRQ_SPI = (1 << 23), 177 - IRQ_I2C = (1 << 24), 178 - IRQ_SGPIO = (1 << 25), 179 - IRQ_COM_ERR = (1 << 29), 180 - IRQ_I2O_ERR = (1 << 30), 181 - IRQ_PCIE_ERR = (1 << 31), 153 + MVS_IRQ_COM_IN_I2O_IOP0 = (1 << 0), 154 + MVS_IRQ_COM_IN_I2O_IOP1 = (1 << 1), 155 + MVS_IRQ_COM_IN_I2O_IOP2 = (1 << 2), 156 + MVS_IRQ_COM_IN_I2O_IOP3 = (1 << 3), 157 + MVS_IRQ_COM_OUT_I2O_HOS0 = (1 << 4), 158 + MVS_IRQ_COM_OUT_I2O_HOS1 = (1 << 5), 159 + MVS_IRQ_COM_OUT_I2O_HOS2 = (1 << 6), 160 + MVS_IRQ_COM_OUT_I2O_HOS3 = (1 << 7), 161 + MVS_IRQ_PCIF_TO_CPU_DRBL0 = (1 << 8), 162 + MVS_IRQ_PCIF_TO_CPU_DRBL1 = (1 << 9), 163 + MVS_IRQ_PCIF_TO_CPU_DRBL2 = (1 << 10), 164 + MVS_IRQ_PCIF_TO_CPU_DRBL3 = (1 << 11), 165 + MVS_IRQ_PCIF_DRBL0 = (1 << 12), 166 + MVS_IRQ_PCIF_DRBL1 = (1 << 13), 167 + MVS_IRQ_PCIF_DRBL2 = (1 << 14), 168 + MVS_IRQ_PCIF_DRBL3 = (1 << 15), 169 + MVS_IRQ_XOR_A = (1 << 16), 170 + MVS_IRQ_XOR_B = (1 << 17), 171 + MVS_IRQ_SAS_A = (1 << 18), 172 + MVS_IRQ_SAS_B = (1 << 19), 173 + MVS_IRQ_CPU_CNTRL = (1 << 20), 174 + MVS_IRQ_GPIO = (1 << 21), 175 + MVS_IRQ_UART = (1 << 22), 176 + MVS_IRQ_SPI = (1 << 23), 177 + MVS_IRQ_I2C = (1 << 24), 178 + MVS_IRQ_SGPIO = (1 << 25), 179 + MVS_IRQ_COM_ERR = (1 << 29), 180 + MVS_IRQ_I2O_ERR = (1 << 30), 181 + MVS_IRQ_PCIE_ERR = (1 << 31), 182 182 }; 183 183 184 184 union reg_phy_cfg {
+1 -1
drivers/spi/spi-pxa2xx-dma.c
··· 368 368 * otherwise we use the default. Also we use the default FIFO 369 369 * thresholds for now. 370 370 */ 371 - *burst_code = chip_info ? chip_info->dma_burst_size : 16; 371 + *burst_code = chip_info ? chip_info->dma_burst_size : 1; 372 372 *threshold = SSCR1_RxTresh(RX_THRESH_DFLT) 373 373 | SSCR1_TxTresh(TX_THRESH_DFLT); 374 374
-1
drivers/staging/android/timed_output.c
··· 97 97 { 98 98 tdev->enable(tdev, 0); 99 99 device_destroy(timed_output_class, MKDEV(0, tdev->index)); 100 - dev_set_drvdata(tdev->dev, NULL); 101 100 } 102 101 EXPORT_SYMBOL_GPL(timed_output_dev_unregister); 103 102
+1
drivers/staging/comedi/Kconfig
··· 653 653 654 654 config COMEDI_ADDI_APCI_1564 655 655 tristate "ADDI-DATA APCI_1564 support" 656 + select COMEDI_ADDI_WATCHDOG 656 657 ---help--- 657 658 Enable support for ADDI-DATA APCI_1564 cards 658 659
+5 -4
drivers/staging/iio/Kconfig
··· 36 36 Add some dummy events to the simple dummy driver. 37 37 38 38 config IIO_SIMPLE_DUMMY_BUFFER 39 - boolean "Buffered capture support" 40 - select IIO_KFIFO_BUF 41 - help 42 - Add buffered data capture to the simple dummy driver. 39 + boolean "Buffered capture support" 40 + select IIO_BUFFER 41 + select IIO_KFIFO_BUF 42 + help 43 + Add buffered data capture to the simple dummy driver. 43 44 44 45 endif # IIO_SIMPLE_DUMMY 45 46
+8 -4
drivers/staging/iio/adc/mxs-lradc.c
··· 846 846 LRADC_CTRL1); 847 847 mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0); 848 848 849 + /* Enable / disable the divider per requirement */ 850 + if (test_bit(chan, &lradc->is_divided)) 851 + mxs_lradc_reg_set(lradc, 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, 852 + LRADC_CTRL2); 853 + else 854 + mxs_lradc_reg_clear(lradc, 855 + 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, LRADC_CTRL2); 856 + 849 857 /* Clean the slot's previous content, then set new one. */ 850 858 mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), 851 859 LRADC_CTRL4); ··· 969 961 if (val == scale_avail[MXS_LRADC_DIV_DISABLED].integer && 970 962 val2 == scale_avail[MXS_LRADC_DIV_DISABLED].nano) { 971 963 /* divider by two disabled */ 972 - writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, 973 - lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_CLR); 974 964 clear_bit(chan->channel, &lradc->is_divided); 975 965 ret = 0; 976 966 } else if (val == scale_avail[MXS_LRADC_DIV_ENABLED].integer && 977 967 val2 == scale_avail[MXS_LRADC_DIV_ENABLED].nano) { 978 968 /* divider by two enabled */ 979 - writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, 980 - lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_SET); 981 969 set_bit(chan->channel, &lradc->is_divided); 982 970 ret = 0; 983 971 }
+6 -2
drivers/staging/iio/light/tsl2x7x_core.c
··· 667 667 chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] = 668 668 chip->tsl2x7x_settings.prox_pulse_count; 669 669 chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] = 670 - chip->tsl2x7x_settings.prox_thres_low; 670 + (chip->tsl2x7x_settings.prox_thres_low) & 0xFF; 671 + chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHHI] = 672 + (chip->tsl2x7x_settings.prox_thres_low >> 8) & 0xFF; 671 673 chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] = 672 - chip->tsl2x7x_settings.prox_thres_high; 674 + (chip->tsl2x7x_settings.prox_thres_high) & 0xFF; 675 + chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHHI] = 676 + (chip->tsl2x7x_settings.prox_thres_high >> 8) & 0xFF; 673 677 674 678 /* and make sure we're not already on */ 675 679 if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {
+7
drivers/staging/imx-drm/parallel-display.c
··· 173 173 if (ret) 174 174 return ret; 175 175 176 + /* set the connector's dpms to OFF so that 177 + * drm_helper_connector_dpms() won't return 178 + * immediately since the current state is ON 179 + * at this point. 180 + */ 181 + imxpd->connector.dpms = DRM_MODE_DPMS_OFF; 182 + 176 183 drm_encoder_helper_add(&imxpd->encoder, &imx_pd_encoder_helper_funcs); 177 184 drm_encoder_init(drm, &imxpd->encoder, &imx_pd_encoder_funcs, 178 185 DRM_MODE_ENCODER_NONE);
+10 -9
drivers/tty/n_tty.c
··· 1214 1214 { 1215 1215 struct n_tty_data *ldata = tty->disc_data; 1216 1216 1217 - if (I_IGNPAR(tty)) 1218 - return; 1219 - if (I_PARMRK(tty)) { 1220 - put_tty_queue('\377', ldata); 1221 - put_tty_queue('\0', ldata); 1222 - put_tty_queue(c, ldata); 1223 - } else if (I_INPCK(tty)) 1224 - put_tty_queue('\0', ldata); 1225 - else 1217 + if (I_INPCK(tty)) { 1218 + if (I_IGNPAR(tty)) 1219 + return; 1220 + if (I_PARMRK(tty)) { 1221 + put_tty_queue('\377', ldata); 1222 + put_tty_queue('\0', ldata); 1223 + put_tty_queue(c, ldata); 1224 + } else 1225 + put_tty_queue('\0', ldata); 1226 + } else 1226 1227 put_tty_queue(c, ldata); 1227 1228 if (waitqueue_active(&tty->read_wait)) 1228 1229 wake_up_interruptible(&tty->read_wait);
+1 -1
drivers/tty/serial/8250/8250_core.c
··· 2357 2357 port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 2358 2358 if (termios->c_iflag & INPCK) 2359 2359 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; 2360 - if (termios->c_iflag & (BRKINT | PARMRK)) 2360 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 2361 2361 port->read_status_mask |= UART_LSR_BI; 2362 2362 2363 2363 /*
+4 -1
drivers/tty/serial/8250/8250_early.c
··· 144 144 if (!(device->port.membase || device->port.iobase)) 145 145 return 0; 146 146 147 - if (!device->baud) 147 + if (!device->baud) { 148 148 device->baud = probe_baud(&device->port); 149 + snprintf(device->options, sizeof(device->options), "%u", 150 + device->baud); 151 + } 149 152 150 153 init_port(device); 151 154
+6
drivers/tty/serial/altera_uart.c
··· 185 185 uart_update_timeout(port, termios->c_cflag, baud); 186 186 altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG); 187 187 spin_unlock_irqrestore(&port->lock, flags); 188 + 189 + /* 190 + * FIXME: port->read_status_mask and port->ignore_status_mask 191 + * need to be initialized based on termios settings for 192 + * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT 193 + */ 188 194 } 189 195 190 196 static void altera_uart_rx_chars(struct altera_uart *pp)
+1 -1
drivers/tty/serial/amba-pl010.c
··· 420 420 uap->port.read_status_mask = UART01x_RSR_OE; 421 421 if (termios->c_iflag & INPCK) 422 422 uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE; 423 - if (termios->c_iflag & (BRKINT | PARMRK)) 423 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 424 424 uap->port.read_status_mask |= UART01x_RSR_BE; 425 425 426 426 /*
+1 -1
drivers/tty/serial/amba-pl011.c
··· 1744 1744 port->read_status_mask = UART011_DR_OE | 255; 1745 1745 if (termios->c_iflag & INPCK) 1746 1746 port->read_status_mask |= UART011_DR_FE | UART011_DR_PE; 1747 - if (termios->c_iflag & (BRKINT | PARMRK)) 1747 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 1748 1748 port->read_status_mask |= UART011_DR_BE; 1749 1749 1750 1750 /*
+1 -1
drivers/tty/serial/atmel_serial.c
··· 1932 1932 port->read_status_mask = ATMEL_US_OVRE; 1933 1933 if (termios->c_iflag & INPCK) 1934 1934 port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE); 1935 - if (termios->c_iflag & (BRKINT | PARMRK)) 1935 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 1936 1936 port->read_status_mask |= ATMEL_US_RXBRK; 1937 1937 1938 1938 if (atmel_use_pdc_rx(port))
+1 -1
drivers/tty/serial/bcm63xx_uart.c
··· 567 567 port->read_status_mask |= UART_FIFO_FRAMEERR_MASK; 568 568 port->read_status_mask |= UART_FIFO_PARERR_MASK; 569 569 } 570 - if (new->c_iflag & (BRKINT)) 570 + if (new->c_iflag & (IGNBRK | BRKINT)) 571 571 port->read_status_mask |= UART_FIFO_BRKDET_MASK; 572 572 573 573 port->ignore_status_mask = 0;
+1 -1
drivers/tty/serial/bfin_uart.c
··· 833 833 port->read_status_mask = OE; 834 834 if (termios->c_iflag & INPCK) 835 835 port->read_status_mask |= (FE | PE); 836 - if (termios->c_iflag & (BRKINT | PARMRK)) 836 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 837 837 port->read_status_mask |= BI; 838 838 839 839 /*
+1 -1
drivers/tty/serial/dz.c
··· 625 625 dport->port.read_status_mask = DZ_OERR; 626 626 if (termios->c_iflag & INPCK) 627 627 dport->port.read_status_mask |= DZ_FERR | DZ_PERR; 628 - if (termios->c_iflag & (BRKINT | PARMRK)) 628 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 629 629 dport->port.read_status_mask |= DZ_BREAK; 630 630 631 631 /* characters to ignore */
+1 -1
drivers/tty/serial/earlycon.c
··· 25 25 #include <asm/serial.h> 26 26 27 27 static struct console early_con = { 28 - .name = "earlycon", 28 + .name = "uart", /* 8250 console switch requires this name */ 29 29 .flags = CON_PRINTBUFFER | CON_BOOT, 30 30 .index = -1, 31 31 };
+1 -1
drivers/tty/serial/efm32-uart.c
··· 407 407 if (new->c_iflag & INPCK) 408 408 port->read_status_mask |= 409 409 UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR; 410 - if (new->c_iflag & (BRKINT | PARMRK)) 410 + if (new->c_iflag & (IGNBRK | BRKINT | PARMRK)) 411 411 port->read_status_mask |= SW_UARTn_RXDATAX_BERR; 412 412 413 413 port->ignore_status_mask = 0;
+1 -1
drivers/tty/serial/fsl_lpuart.c
··· 902 902 sport->port.read_status_mask = 0; 903 903 if (termios->c_iflag & INPCK) 904 904 sport->port.read_status_mask |= (UARTSR1_FE | UARTSR1_PE); 905 - if (termios->c_iflag & (BRKINT | PARMRK)) 905 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 906 906 sport->port.read_status_mask |= UARTSR1_FE; 907 907 908 908 /* characters to ignore */
+1 -1
drivers/tty/serial/ip22zilog.c
··· 850 850 up->port.read_status_mask = Rx_OVR; 851 851 if (iflag & INPCK) 852 852 up->port.read_status_mask |= CRC_ERR | PAR_ERR; 853 - if (iflag & (BRKINT | PARMRK)) 853 + if (iflag & (IGNBRK | BRKINT | PARMRK)) 854 854 up->port.read_status_mask |= BRK_ABRT; 855 855 856 856 up->port.ignore_status_mask = 0;
+1 -1
drivers/tty/serial/m32r_sio.c
··· 737 737 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 738 738 if (termios->c_iflag & INPCK) 739 739 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 740 - if (termios->c_iflag & (BRKINT | PARMRK)) 740 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 741 741 up->port.read_status_mask |= UART_LSR_BI; 742 742 743 743 /*
+1 -1
drivers/tty/serial/max310x.c
··· 835 835 if (termios->c_iflag & INPCK) 836 836 port->read_status_mask |= MAX310X_LSR_RXPAR_BIT | 837 837 MAX310X_LSR_FRERR_BIT; 838 - if (termios->c_iflag & (BRKINT | PARMRK)) 838 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 839 839 port->read_status_mask |= MAX310X_LSR_RXBRK_BIT; 840 840 841 841 /* Set status ignore mask */
+6
drivers/tty/serial/mcf.c
··· 248 248 mr1 |= MCFUART_MR1_PARITYNONE; 249 249 } 250 250 251 + /* 252 + * FIXME: port->read_status_mask and port->ignore_status_mask 253 + * need to be initialized based on termios settings for 254 + * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT 255 + */ 256 + 251 257 if (termios->c_cflag & CSTOPB) 252 258 mr2 |= MCFUART_MR2_STOP2; 253 259 else
+1 -1
drivers/tty/serial/mfd.c
··· 977 977 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 978 978 if (termios->c_iflag & INPCK) 979 979 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 980 - if (termios->c_iflag & (BRKINT | PARMRK)) 980 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 981 981 up->port.read_status_mask |= UART_LSR_BI; 982 982 983 983 /* Characters to ignore */
+1 -1
drivers/tty/serial/mpsc.c
··· 1458 1458 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE 1459 1459 | SDMA_DESC_CMDSTAT_FR; 1460 1460 1461 - if (termios->c_iflag & (BRKINT | PARMRK)) 1461 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 1462 1462 pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR; 1463 1463 1464 1464 /* Characters/events to ignore */
+1 -1
drivers/tty/serial/msm_serial.c
··· 582 582 port->read_status_mask = 0; 583 583 if (termios->c_iflag & INPCK) 584 584 port->read_status_mask |= UART_SR_PAR_FRAME_ERR; 585 - if (termios->c_iflag & (BRKINT | PARMRK)) 585 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 586 586 port->read_status_mask |= UART_SR_RX_BREAK; 587 587 588 588 uart_update_timeout(port, termios->c_cflag, baud);
+1 -1
drivers/tty/serial/mxs-auart.c
··· 604 604 605 605 if (termios->c_iflag & INPCK) 606 606 u->read_status_mask |= AUART_STAT_PERR; 607 - if (termios->c_iflag & (BRKINT | PARMRK)) 607 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 608 608 u->read_status_mask |= AUART_STAT_BERR; 609 609 610 610 /*
+1 -1
drivers/tty/serial/netx-serial.c
··· 419 419 } 420 420 421 421 port->read_status_mask = 0; 422 - if (termios->c_iflag & (BRKINT | PARMRK)) 422 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 423 423 port->read_status_mask |= SR_BE; 424 424 if (termios->c_iflag & INPCK) 425 425 port->read_status_mask |= SR_PE | SR_FE;
+1 -1
drivers/tty/serial/pmac_zilog.c
··· 1092 1092 uap->port.read_status_mask = Rx_OVR; 1093 1093 if (iflag & INPCK) 1094 1094 uap->port.read_status_mask |= CRC_ERR | PAR_ERR; 1095 - if (iflag & (BRKINT | PARMRK)) 1095 + if (iflag & (IGNBRK | BRKINT | PARMRK)) 1096 1096 uap->port.read_status_mask |= BRK_ABRT; 1097 1097 1098 1098 uap->port.ignore_status_mask = 0;
+1 -1
drivers/tty/serial/pnx8xxx_uart.c
··· 477 477 sport->port.read_status_mask |= 478 478 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) | 479 479 FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR); 480 - if (termios->c_iflag & (BRKINT | PARMRK)) 480 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 481 481 sport->port.read_status_mask |= 482 482 ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK); 483 483
+1 -1
drivers/tty/serial/pxa.c
··· 492 492 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 493 493 if (termios->c_iflag & INPCK) 494 494 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 495 - if (termios->c_iflag & (BRKINT | PARMRK)) 495 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 496 496 up->port.read_status_mask |= UART_LSR_BI; 497 497 498 498 /*
+1 -1
drivers/tty/serial/samsung.c
··· 66 66 char buff[256]; 67 67 68 68 va_start(va, fmt); 69 - vscnprintf(buff, sizeof(buf), fmt, va); 69 + vscnprintf(buff, sizeof(buff), fmt, va); 70 70 va_end(va); 71 71 72 72 printascii(buff);
+1 -1
drivers/tty/serial/sb1250-duart.c
··· 596 596 if (termios->c_iflag & INPCK) 597 597 uport->read_status_mask |= M_DUART_FRM_ERR | 598 598 M_DUART_PARITY_ERR; 599 - if (termios->c_iflag & (BRKINT | PARMRK)) 599 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 600 600 uport->read_status_mask |= M_DUART_RCVD_BRK; 601 601 602 602 uport->ignore_status_mask = 0;
+1 -1
drivers/tty/serial/sccnxp.c
··· 665 665 port->read_status_mask = SR_OVR; 666 666 if (termios->c_iflag & INPCK) 667 667 port->read_status_mask |= SR_PE | SR_FE; 668 - if (termios->c_iflag & (BRKINT | PARMRK)) 668 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 669 669 port->read_status_mask |= SR_BRK; 670 670 671 671 /* Set status ignore mask */
+1 -1
drivers/tty/serial/serial_ks8695.c
··· 437 437 port->read_status_mask = URLS_URROE; 438 438 if (termios->c_iflag & INPCK) 439 439 port->read_status_mask |= (URLS_URFE | URLS_URPE); 440 - if (termios->c_iflag & (BRKINT | PARMRK)) 440 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 441 441 port->read_status_mask |= URLS_URBI; 442 442 443 443 /*
+1 -1
drivers/tty/serial/serial_txx9.c
··· 697 697 TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS; 698 698 if (termios->c_iflag & INPCK) 699 699 up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER; 700 - if (termios->c_iflag & (BRKINT | PARMRK)) 700 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 701 701 up->port.read_status_mask |= TXX9_SIDISR_UBRK; 702 702 703 703 /*
+1 -1
drivers/tty/serial/sirfsoc_uart.c
··· 896 896 if (termios->c_iflag & INPCK) 897 897 port->read_status_mask |= uint_en->sirfsoc_frm_err_en; 898 898 } 899 - if (termios->c_iflag & (BRKINT | PARMRK)) 899 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 900 900 port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en; 901 901 if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) { 902 902 if (termios->c_iflag & IGNPAR)
+1 -1
drivers/tty/serial/st-asc.c
··· 547 547 ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE; 548 548 if (termios->c_iflag & INPCK) 549 549 ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE; 550 - if (termios->c_iflag & (BRKINT | PARMRK)) 550 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 551 551 ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE; 552 552 553 553 /*
+1 -1
drivers/tty/serial/sunsab.c
··· 719 719 if (iflag & INPCK) 720 720 up->port.read_status_mask |= (SAB82532_ISR0_PERR | 721 721 SAB82532_ISR0_FERR); 722 - if (iflag & (BRKINT | PARMRK)) 722 + if (iflag & (IGNBRK | BRKINT | PARMRK)) 723 723 up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8); 724 724 725 725 /*
+1 -1
drivers/tty/serial/sunsu.c
··· 834 834 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 835 835 if (iflag & INPCK) 836 836 up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; 837 - if (iflag & (BRKINT | PARMRK)) 837 + if (iflag & (IGNBRK | BRKINT | PARMRK)) 838 838 up->port.read_status_mask |= UART_LSR_BI; 839 839 840 840 /*
+1 -1
drivers/tty/serial/sunzilog.c
··· 915 915 up->port.read_status_mask = Rx_OVR; 916 916 if (iflag & INPCK) 917 917 up->port.read_status_mask |= CRC_ERR | PAR_ERR; 918 - if (iflag & (BRKINT | PARMRK)) 918 + if (iflag & (IGNBRK | BRKINT | PARMRK)) 919 919 up->port.read_status_mask |= BRK_ABRT; 920 920 921 921 up->port.ignore_status_mask = 0;
+1 -1
drivers/tty/serial/ucc_uart.c
··· 936 936 port->read_status_mask = BD_SC_EMPTY | BD_SC_OV; 937 937 if (termios->c_iflag & INPCK) 938 938 port->read_status_mask |= BD_SC_FR | BD_SC_PR; 939 - if (termios->c_iflag & (BRKINT | PARMRK)) 939 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 940 940 port->read_status_mask |= BD_SC_BR; 941 941 942 942 /*
+1 -1
drivers/tty/serial/vr41xx_siu.c
··· 559 559 port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR; 560 560 if (c_iflag & INPCK) 561 561 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; 562 - if (c_iflag & (BRKINT | PARMRK)) 562 + if (c_iflag & (IGNBRK | BRKINT | PARMRK)) 563 563 port->read_status_mask |= UART_LSR_BI; 564 564 565 565 port->ignore_status_mask = 0;
+1 -1
drivers/tty/serial/zs.c
··· 923 923 uport->read_status_mask = Rx_OVR; 924 924 if (termios->c_iflag & INPCK) 925 925 uport->read_status_mask |= FRM_ERR | PAR_ERR; 926 - if (termios->c_iflag & (BRKINT | PARMRK)) 926 + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) 927 927 uport->read_status_mask |= Rx_BRK; 928 928 929 929 uport->ignore_status_mask = 0;
+14 -10
drivers/tty/vt/vt.c
··· 3226 3226 for (i = 0; i < MAX_NR_CON_DRIVER; i++) { 3227 3227 con_back = &registered_con_driver[i]; 3228 3228 3229 - if (con_back->con && 3230 - !(con_back->flag & CON_DRIVER_FLAG_MODULE)) { 3229 + if (con_back->con && con_back->con != csw) { 3231 3230 defcsw = con_back->con; 3232 3231 retval = 0; 3233 3232 break; ··· 3331 3332 { 3332 3333 const struct consw *csw = NULL; 3333 3334 int i, more = 1, first = -1, last = -1, deflt = 0; 3335 + int ret; 3334 3336 3335 3337 if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || 3336 3338 con_is_graphics(con->con, con->first, con->last)) ··· 3357 3357 3358 3358 if (first != -1) { 3359 3359 console_lock(); 3360 - do_unbind_con_driver(csw, first, last, deflt); 3360 + ret = do_unbind_con_driver(csw, first, last, deflt); 3361 3361 console_unlock(); 3362 + if (ret != 0) 3363 + return ret; 3362 3364 } 3363 3365 3364 3366 first = -1; ··· 3647 3645 */ 3648 3646 int do_unregister_con_driver(const struct consw *csw) 3649 3647 { 3650 - int i, retval = -ENODEV; 3648 + int i; 3651 3649 3652 3650 /* cannot unregister a bound driver */ 3653 3651 if (con_is_bound(csw)) 3654 - goto err; 3652 + return -EBUSY; 3653 + 3654 + if (csw == conswitchp) 3655 + return -EINVAL; 3655 3656 3656 3657 for (i = 0; i < MAX_NR_CON_DRIVER; i++) { 3657 3658 struct con_driver *con_driver = &registered_con_driver[i]; 3658 3659 3659 3660 if (con_driver->con == csw && 3660 - con_driver->flag & CON_DRIVER_FLAG_MODULE) { 3661 + con_driver->flag & CON_DRIVER_FLAG_INIT) { 3661 3662 vtconsole_deinit_device(con_driver); 3662 3663 device_destroy(vtconsole_class, 3663 3664 MKDEV(0, con_driver->node)); ··· 3671 3666 con_driver->flag = 0; 3672 3667 con_driver->first = 0; 3673 3668 con_driver->last = 0; 3674 - retval = 0; 3675 - break; 3669 + return 0; 3676 3670 } 3677 3671 } 3678 - err: 3679 - return retval; 3672 + 3673 + return -ENODEV; 3680 3674 } 3681 3675 EXPORT_SYMBOL_GPL(do_unregister_con_driver); 3682 3676
+1 -1
drivers/uio/uio.c
··· 655 655 656 656 if (mem->addr & ~PAGE_MASK) 657 657 return -ENODEV; 658 - if (vma->vm_end - vma->vm_start > PAGE_ALIGN(mem->size)) 658 + if (vma->vm_end - vma->vm_start > mem->size) 659 659 return -EINVAL; 660 660 661 661 vma->vm_ops = &uio_physical_vm_ops;
+20 -13
drivers/usb/core/hub.c
··· 1526 1526 dev_dbg(hub_dev, "%umA bus power budget for each child\n", 1527 1527 hub->mA_per_port); 1528 1528 1529 - /* Update the HCD's internal representation of this hub before khubd 1530 - * starts getting port status changes for devices under the hub. 1531 - */ 1532 - if (hcd->driver->update_hub_device) { 1533 - ret = hcd->driver->update_hub_device(hcd, hdev, 1534 - &hub->tt, GFP_KERNEL); 1535 - if (ret < 0) { 1536 - message = "can't update HCD hub info"; 1537 - goto fail; 1538 - } 1539 - } 1540 - 1541 1529 ret = hub_hub_status(hub, &hubstatus, &hubchange); 1542 1530 if (ret < 0) { 1543 1531 message = "can't get hub status"; ··· 1577 1589 } 1578 1590 } 1579 1591 hdev->maxchild = i; 1592 + for (i = 0; i < hdev->maxchild; i++) { 1593 + struct usb_port *port_dev = hub->ports[i]; 1594 + 1595 + pm_runtime_put(&port_dev->dev); 1596 + } 1597 + 1580 1598 mutex_unlock(&usb_port_peer_mutex); 1581 1599 if (ret < 0) 1582 1600 goto fail; 1601 + 1602 + /* Update the HCD's internal representation of this hub before khubd 1603 + * starts getting port status changes for devices under the hub. 1604 + */ 1605 + if (hcd->driver->update_hub_device) { 1606 + ret = hcd->driver->update_hub_device(hcd, hdev, 1607 + &hub->tt, GFP_KERNEL); 1608 + if (ret < 0) { 1609 + message = "can't update HCD hub info"; 1610 + goto fail; 1611 + } 1612 + } 1583 1613 1584 1614 usb_hub_adjust_deviceremovable(hdev, hub->descriptor); 1585 1615 ··· 3464 3458 struct usb_device *udev = port_dev->child; 3465 3459 3466 3460 if (udev && udev->can_submit) { 3467 - dev_warn(&port_dev->dev, "not suspended yet\n"); 3461 + dev_warn(&port_dev->dev, "device %s not suspended yet\n", 3462 + dev_name(&udev->dev)); 3468 3463 if (PMSG_IS_AUTO(msg)) 3469 3464 return -EBUSY; 3470 3465 }
+2
drivers/usb/core/hub.h
··· 84 84 * @dev: generic device interface 85 85 * @port_owner: port's owner 86 86 * @peer: related usb2 and usb3 ports (share the same connector) 87 + * @req: default pm qos request for hubs without port power control 87 88 * @connect_type: port's connect type 88 89 * @location: opaque representation of platform connector location 89 90 * @status_lock: synchronize port_event() vs usb_port_{suspend|resume} ··· 96 95 struct device dev; 97 96 struct usb_dev_state *port_owner; 98 97 struct usb_port *peer; 98 + struct dev_pm_qos_request *req; 99 99 enum usb_port_connect_type connect_type; 100 100 usb_port_location_t location; 101 101 struct mutex status_lock;
+64 -23
drivers/usb/core/port.c
··· 21 21 22 22 #include "hub.h" 23 23 24 + static int usb_port_block_power_off; 25 + 24 26 static const struct attribute_group *port_dev_group[]; 25 27 26 28 static ssize_t connect_type_show(struct device *dev, ··· 68 66 { 69 67 struct usb_port *port_dev = to_usb_port(dev); 70 68 69 + kfree(port_dev->req); 71 70 kfree(port_dev); 72 71 } 73 72 ··· 145 142 == PM_QOS_FLAGS_ALL) 146 143 return -EAGAIN; 147 144 145 + if (usb_port_block_power_off) 146 + return -EBUSY; 147 + 148 148 usb_autopm_get_interface(intf); 149 149 retval = usb_hub_set_port_power(hdev, hub, port1, false); 150 150 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION); ··· 196 190 if (left->peer || right->peer) { 197 191 struct usb_port *lpeer = left->peer; 198 192 struct usb_port *rpeer = right->peer; 193 + char *method; 199 194 200 - WARN(1, "failed to peer %s and %s (%s -> %p) (%s -> %p)\n", 201 - dev_name(&left->dev), dev_name(&right->dev), 202 - dev_name(&left->dev), lpeer, 203 - dev_name(&right->dev), rpeer); 195 + if (left->location && left->location == right->location) 196 + method = "location"; 197 + else 198 + method = "default"; 199 + 200 + pr_warn("usb: failed to peer %s and %s by %s (%s:%s) (%s:%s)\n", 201 + dev_name(&left->dev), dev_name(&right->dev), method, 202 + dev_name(&left->dev), 203 + lpeer ? dev_name(&lpeer->dev) : "none", 204 + dev_name(&right->dev), 205 + rpeer ? dev_name(&rpeer->dev) : "none"); 204 206 return -EBUSY; 205 207 } 206 208 ··· 265 251 dev_warn(&left->dev, "failed to peer to %s (%d)\n", 266 252 dev_name(&right->dev), rc); 267 253 pr_warn_once("usb: port power management may be unreliable\n"); 254 + usb_port_block_power_off = 1; 268 255 } 269 256 } 270 257 ··· 401 386 int retval; 402 387 403 388 port_dev = kzalloc(sizeof(*port_dev), GFP_KERNEL); 404 - if (!port_dev) { 405 - retval = -ENOMEM; 406 - goto exit; 389 + if (!port_dev) 390 + return -ENOMEM; 391 + 392 + port_dev->req = kzalloc(sizeof(*(port_dev->req)), GFP_KERNEL); 393 + if (!port_dev->req) { 394 + kfree(port_dev); 395 + return -ENOMEM; 407 396 } 408 397 409 398 hub->ports[port1 - 1] = port_dev; ··· 423 404 port1); 424 405 mutex_init(&port_dev->status_lock); 425 406 retval = device_register(&port_dev->dev); 426 - if (retval) 427 - goto error_register; 407 + if (retval) { 408 + put_device(&port_dev->dev); 409 + return retval; 410 + } 411 + 412 + /* Set default policy of port-poweroff disabled. */ 413 + retval = dev_pm_qos_add_request(&port_dev->dev, port_dev->req, 414 + DEV_PM_QOS_FLAGS, PM_QOS_FLAG_NO_POWER_OFF); 415 + if (retval < 0) { 416 + device_unregister(&port_dev->dev); 417 + return retval; 418 + } 428 419 429 420 find_and_link_peer(hub, port1); 430 421 422 + /* 423 + * Enable runtime pm and hold a refernce that hub_configure() 424 + * will drop once the PM_QOS_NO_POWER_OFF flag state has been set 425 + * and the hub has been fully registered (hdev->maxchild set). 426 + */ 431 427 pm_runtime_set_active(&port_dev->dev); 428 + pm_runtime_get_noresume(&port_dev->dev); 429 + pm_runtime_enable(&port_dev->dev); 430 + device_enable_async_suspend(&port_dev->dev); 432 431 433 432 /* 434 - * Do not enable port runtime pm if the hub does not support 435 - * power switching. Also, userspace must have final say of 436 - * whether a port is permitted to power-off. Do not enable 437 - * runtime pm if we fail to expose pm_qos_no_power_off. 433 + * Keep hidden the ability to enable port-poweroff if the hub 434 + * does not support power switching. 438 435 */ 439 - if (hub_is_port_power_switchable(hub) 440 - && dev_pm_qos_expose_flags(&port_dev->dev, 441 - PM_QOS_FLAG_NO_POWER_OFF) == 0) 442 - pm_runtime_enable(&port_dev->dev); 436 + if (!hub_is_port_power_switchable(hub)) 437 + return 0; 443 438 444 - device_enable_async_suspend(&port_dev->dev); 439 + /* Attempt to let userspace take over the policy. */ 440 + retval = dev_pm_qos_expose_flags(&port_dev->dev, 441 + PM_QOS_FLAG_NO_POWER_OFF); 442 + if (retval < 0) { 443 + dev_warn(&port_dev->dev, "failed to expose pm_qos_no_poweroff\n"); 444 + return 0; 445 + } 446 + 447 + /* Userspace owns the policy, drop the kernel 'no_poweroff' request. */ 448 + retval = dev_pm_qos_remove_request(port_dev->req); 449 + if (retval >= 0) { 450 + kfree(port_dev->req); 451 + port_dev->req = NULL; 452 + } 445 453 return 0; 446 - 447 - error_register: 448 - put_device(&port_dev->dev); 449 - exit: 450 - return retval; 451 454 } 452 455 453 456 void usb_hub_remove_port_device(struct usb_hub *hub, int port1)
+16 -3
drivers/usb/host/pci-quirks.c
··· 656 656 DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), 657 657 }, 658 658 }, 659 + { 660 + /* HASEE E200 */ 661 + .matches = { 662 + DMI_MATCH(DMI_BOARD_VENDOR, "HASEE"), 663 + DMI_MATCH(DMI_BOARD_NAME, "E210"), 664 + DMI_MATCH(DMI_BIOS_VERSION, "6.00"), 665 + }, 666 + }, 659 667 { } 660 668 }; 661 669 ··· 673 665 { 674 666 int try_handoff = 1, tried_handoff = 0; 675 667 676 - /* The Pegatron Lucid tablet sporadically waits for 98 seconds trying 677 - * the handoff on its unused controller. Skip it. */ 678 - if (pdev->vendor == 0x8086 && pdev->device == 0x283a) { 668 + /* 669 + * The Pegatron Lucid tablet sporadically waits for 98 seconds trying 670 + * the handoff on its unused controller. Skip it. 671 + * 672 + * The HASEE E200 hangs when the semaphore is set (bugzilla #77021). 673 + */ 674 + if (pdev->vendor == 0x8086 && (pdev->device == 0x283a || 675 + pdev->device == 0x27cc)) { 679 676 if (dmi_check_system(ehci_dmi_nohandoff_table)) 680 677 try_handoff = 0; 681 678 }
+1 -1
drivers/usb/host/xhci-hub.c
··· 287 287 if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue) { 288 288 struct xhci_command *command; 289 289 command = xhci_alloc_command(xhci, false, false, 290 - GFP_NOIO); 290 + GFP_NOWAIT); 291 291 if (!command) { 292 292 spin_unlock_irqrestore(&xhci->lock, flags); 293 293 xhci_free_command(xhci, cmd);
+15 -1
drivers/usb/misc/usbtest.c
··· 7 7 #include <linux/moduleparam.h> 8 8 #include <linux/scatterlist.h> 9 9 #include <linux/mutex.h> 10 - 10 + #include <linux/timer.h> 11 11 #include <linux/usb.h> 12 12 13 13 #define SIMPLE_IO_TIMEOUT 10000 /* in milliseconds */ ··· 484 484 return sg; 485 485 } 486 486 487 + static void sg_timeout(unsigned long _req) 488 + { 489 + struct usb_sg_request *req = (struct usb_sg_request *) _req; 490 + 491 + req->status = -ETIMEDOUT; 492 + usb_sg_cancel(req); 493 + } 494 + 487 495 static int perform_sglist( 488 496 struct usbtest_dev *tdev, 489 497 unsigned iterations, ··· 503 495 { 504 496 struct usb_device *udev = testdev_to_usbdev(tdev); 505 497 int retval = 0; 498 + struct timer_list sg_timer; 499 + 500 + setup_timer_on_stack(&sg_timer, sg_timeout, (unsigned long) req); 506 501 507 502 while (retval == 0 && iterations-- > 0) { 508 503 retval = usb_sg_init(req, udev, pipe, ··· 516 505 517 506 if (retval) 518 507 break; 508 + mod_timer(&sg_timer, jiffies + 509 + msecs_to_jiffies(SIMPLE_IO_TIMEOUT)); 519 510 usb_sg_wait(req); 511 + del_timer_sync(&sg_timer); 520 512 retval = req->status; 521 513 522 514 /* FIXME check resulting data pattern */
+1
drivers/video/console/dummycon.c
··· 77 77 .con_set_palette = DUMMY, 78 78 .con_scrolldelta = DUMMY, 79 79 }; 80 + EXPORT_SYMBOL_GPL(dummy_con);
+1
drivers/video/console/vgacon.c
··· 1441 1441 .con_build_attr = vgacon_build_attr, 1442 1442 .con_invert_region = vgacon_invert_region, 1443 1443 }; 1444 + EXPORT_SYMBOL(vga_con); 1444 1445 1445 1446 MODULE_LICENSE("GPL");
+1 -10
drivers/video/fbdev/offb.c
··· 91 91 #define AVIVO_DC_LUTB_WHITE_OFFSET_GREEN 0x6cd4 92 92 #define AVIVO_DC_LUTB_WHITE_OFFSET_RED 0x6cd8 93 93 94 - #define FB_RIGHT_POS(p, bpp) (fb_be_math(p) ? 0 : (32 - (bpp))) 95 - 96 - static inline u32 offb_cmap_byteswap(struct fb_info *info, u32 value) 97 - { 98 - u32 bpp = info->var.bits_per_pixel; 99 - 100 - return cpu_to_be32(value) >> FB_RIGHT_POS(info, bpp); 101 - } 102 - 103 94 /* 104 95 * Set a single color register. The values supplied are already 105 96 * rounded down to the hardware's capabilities (according to the ··· 120 129 mask <<= info->var.transp.offset; 121 130 value |= mask; 122 131 } 123 - pal[regno] = offb_cmap_byteswap(info, value); 132 + pal[regno] = value; 124 133 return 0; 125 134 } 126 135
+1 -1
drivers/w1/masters/mxc_w1.c
··· 66 66 67 67 udelay(100); 68 68 } 69 - return !!(reg_val & MXC_W1_CONTROL_PST); 69 + return !(reg_val & MXC_W1_CONTROL_PST); 70 70 } 71 71 72 72 /*
+5 -2
drivers/watchdog/Kconfig
··· 1280 1280 1281 1281 # S390 Architecture 1282 1282 1283 - config ZVM_WATCHDOG 1284 - tristate "z/VM Watchdog Timer" 1283 + config DIAG288_WATCHDOG 1284 + tristate "System z diag288 Watchdog" 1285 1285 depends on S390 1286 + select WATCHDOG_CORE 1286 1287 help 1287 1288 IBM s/390 and zSeries machines running under z/VM 5.1 or later 1288 1289 provide a virtual watchdog timer to their guest that cause a 1289 1290 user define Control Program command to be executed after a 1290 1291 timeout. 1292 + LPAR provides a very similar interface. This driver handles 1293 + both. 1291 1294 1292 1295 To compile this driver as a module, choose M here. The module 1293 1296 will be called vmwatchdog.
+1
drivers/watchdog/Makefile
··· 153 153 obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o 154 154 155 155 # S390 Architecture 156 + obj-$(CONFIG_DIAG288_WATCHDOG) += diag288_wdt.o 156 157 157 158 # SUPERH (sh + sh64) Architecture 158 159 obj-$(CONFIG_SH_WDT) += shwdt.o
+316
drivers/watchdog/diag288_wdt.c
··· 1 + /* 2 + * Watchdog driver for z/VM and LPAR using the diag 288 interface. 3 + * 4 + * Under z/VM, expiration of the watchdog will send a "system restart" command 5 + * to CP. 6 + * 7 + * The command can be altered using the module parameter "cmd". This is 8 + * not recommended because it's only supported on z/VM but not whith LPAR. 9 + * 10 + * On LPAR, the watchdog will always trigger a system restart. the module 11 + * paramter cmd is meaningless here. 12 + * 13 + * 14 + * Copyright IBM Corp. 2004, 2013 15 + * Author(s): Arnd Bergmann (arndb@de.ibm.com) 16 + * Philipp Hachtmann (phacht@de.ibm.com) 17 + * 18 + */ 19 + 20 + #define KMSG_COMPONENT "diag288_wdt" 21 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 22 + 23 + #include <linux/init.h> 24 + #include <linux/kernel.h> 25 + #include <linux/module.h> 26 + #include <linux/moduleparam.h> 27 + #include <linux/slab.h> 28 + #include <linux/miscdevice.h> 29 + #include <linux/watchdog.h> 30 + #include <linux/suspend.h> 31 + #include <asm/ebcdic.h> 32 + #include <linux/io.h> 33 + #include <linux/uaccess.h> 34 + 35 + #define MAX_CMDLEN 240 36 + #define DEFAULT_CMD "SYSTEM RESTART" 37 + 38 + #define MIN_INTERVAL 15 /* Minimal time supported by diag88 */ 39 + #define MAX_INTERVAL 3600 /* One hour should be enough - pure estimation */ 40 + 41 + #define WDT_DEFAULT_TIMEOUT 30 42 + 43 + /* Function codes - init, change, cancel */ 44 + #define WDT_FUNC_INIT 0 45 + #define WDT_FUNC_CHANGE 1 46 + #define WDT_FUNC_CANCEL 2 47 + #define WDT_FUNC_CONCEAL 0x80000000 48 + 49 + /* Action codes for LPAR watchdog */ 50 + #define LPARWDT_RESTART 0 51 + 52 + static char wdt_cmd[MAX_CMDLEN] = DEFAULT_CMD; 53 + static bool conceal_on; 54 + static bool nowayout_info = WATCHDOG_NOWAYOUT; 55 + 56 + MODULE_LICENSE("GPL"); 57 + MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>"); 58 + MODULE_AUTHOR("Philipp Hachtmann <phacht@de.ibm.com>"); 59 + 60 + MODULE_DESCRIPTION("System z diag288 Watchdog Timer"); 61 + 62 + module_param_string(cmd, wdt_cmd, MAX_CMDLEN, 0644); 63 + MODULE_PARM_DESC(cmd, "CP command that is run when the watchdog triggers (z/VM only)"); 64 + 65 + module_param_named(conceal, conceal_on, bool, 0644); 66 + MODULE_PARM_DESC(conceal, "Enable the CONCEAL CP option while the watchdog is active (z/VM only)"); 67 + 68 + module_param_named(nowayout, nowayout_info, bool, 0444); 69 + MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default = CONFIG_WATCHDOG_NOWAYOUT)"); 70 + 71 + MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 72 + MODULE_ALIAS("vmwatchdog"); 73 + 74 + static int __diag288(unsigned int func, unsigned int timeout, 75 + unsigned long action, unsigned int len) 76 + { 77 + register unsigned long __func asm("2") = func; 78 + register unsigned long __timeout asm("3") = timeout; 79 + register unsigned long __action asm("4") = action; 80 + register unsigned long __len asm("5") = len; 81 + int err; 82 + 83 + err = -EINVAL; 84 + asm volatile( 85 + " diag %1, %3, 0x288\n" 86 + "0: la %0, 0\n" 87 + "1:\n" 88 + EX_TABLE(0b, 1b) 89 + : "+d" (err) : "d"(__func), "d"(__timeout), 90 + "d"(__action), "d"(__len) : "1", "cc"); 91 + return err; 92 + } 93 + 94 + static int __diag288_vm(unsigned int func, unsigned int timeout, 95 + char *cmd, size_t len) 96 + { 97 + return __diag288(func, timeout, virt_to_phys(cmd), len); 98 + } 99 + 100 + static int __diag288_lpar(unsigned int func, unsigned int timeout, 101 + unsigned long action) 102 + { 103 + return __diag288(func, timeout, action, 0); 104 + } 105 + 106 + static int wdt_start(struct watchdog_device *dev) 107 + { 108 + char *ebc_cmd; 109 + size_t len; 110 + int ret; 111 + unsigned int func; 112 + 113 + ret = -ENODEV; 114 + 115 + if (MACHINE_IS_VM) { 116 + ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL); 117 + if (!ebc_cmd) 118 + return -ENOMEM; 119 + len = strlcpy(ebc_cmd, wdt_cmd, MAX_CMDLEN); 120 + ASCEBC(ebc_cmd, MAX_CMDLEN); 121 + EBC_TOUPPER(ebc_cmd, MAX_CMDLEN); 122 + 123 + func = conceal_on ? (WDT_FUNC_INIT | WDT_FUNC_CONCEAL) 124 + : WDT_FUNC_INIT; 125 + ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); 126 + WARN_ON(ret != 0); 127 + kfree(ebc_cmd); 128 + } 129 + 130 + if (MACHINE_IS_LPAR) { 131 + ret = __diag288_lpar(WDT_FUNC_INIT, 132 + dev->timeout, LPARWDT_RESTART); 133 + } 134 + 135 + if (ret) { 136 + pr_err("The watchdog cannot be activated\n"); 137 + return ret; 138 + } 139 + pr_info("The watchdog was activated\n"); 140 + return 0; 141 + } 142 + 143 + static int wdt_stop(struct watchdog_device *dev) 144 + { 145 + int ret; 146 + 147 + ret = __diag288(WDT_FUNC_CANCEL, 0, 0, 0); 148 + pr_info("The watchdog was deactivated\n"); 149 + return ret; 150 + } 151 + 152 + static int wdt_ping(struct watchdog_device *dev) 153 + { 154 + char *ebc_cmd; 155 + size_t len; 156 + int ret; 157 + unsigned int func; 158 + 159 + ret = -ENODEV; 160 + 161 + if (MACHINE_IS_VM) { 162 + ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL); 163 + if (!ebc_cmd) 164 + return -ENOMEM; 165 + len = strlcpy(ebc_cmd, wdt_cmd, MAX_CMDLEN); 166 + ASCEBC(ebc_cmd, MAX_CMDLEN); 167 + EBC_TOUPPER(ebc_cmd, MAX_CMDLEN); 168 + 169 + /* 170 + * It seems to be ok to z/VM to use the init function to 171 + * retrigger the watchdog. On LPAR WDT_FUNC_CHANGE must 172 + * be used when the watchdog is running. 173 + */ 174 + func = conceal_on ? (WDT_FUNC_INIT | WDT_FUNC_CONCEAL) 175 + : WDT_FUNC_INIT; 176 + 177 + ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); 178 + WARN_ON(ret != 0); 179 + kfree(ebc_cmd); 180 + } 181 + 182 + if (MACHINE_IS_LPAR) 183 + ret = __diag288_lpar(WDT_FUNC_CHANGE, dev->timeout, 0); 184 + 185 + if (ret) 186 + pr_err("The watchdog timer cannot be started or reset\n"); 187 + return ret; 188 + } 189 + 190 + static int wdt_set_timeout(struct watchdog_device * dev, unsigned int new_to) 191 + { 192 + dev->timeout = new_to; 193 + return wdt_ping(dev); 194 + } 195 + 196 + static struct watchdog_ops wdt_ops = { 197 + .owner = THIS_MODULE, 198 + .start = wdt_start, 199 + .stop = wdt_stop, 200 + .ping = wdt_ping, 201 + .set_timeout = wdt_set_timeout, 202 + }; 203 + 204 + static struct watchdog_info wdt_info = { 205 + .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, 206 + .firmware_version = 0, 207 + .identity = "z Watchdog", 208 + }; 209 + 210 + static struct watchdog_device wdt_dev = { 211 + .parent = NULL, 212 + .info = &wdt_info, 213 + .ops = &wdt_ops, 214 + .bootstatus = 0, 215 + .timeout = WDT_DEFAULT_TIMEOUT, 216 + .min_timeout = MIN_INTERVAL, 217 + .max_timeout = MAX_INTERVAL, 218 + }; 219 + 220 + /* 221 + * It makes no sense to go into suspend while the watchdog is running. 222 + * Depending on the memory size, the watchdog might trigger, while we 223 + * are still saving the memory. 224 + * We reuse the open flag to ensure that suspend and watchdog open are 225 + * exclusive operations 226 + */ 227 + static int wdt_suspend(void) 228 + { 229 + if (test_and_set_bit(WDOG_DEV_OPEN, &wdt_dev.status)) { 230 + pr_err("Linux cannot be suspended while the watchdog is in use\n"); 231 + return notifier_from_errno(-EBUSY); 232 + } 233 + if (test_bit(WDOG_ACTIVE, &wdt_dev.status)) { 234 + clear_bit(WDOG_DEV_OPEN, &wdt_dev.status); 235 + pr_err("Linux cannot be suspended while the watchdog is in use\n"); 236 + return notifier_from_errno(-EBUSY); 237 + } 238 + return NOTIFY_DONE; 239 + } 240 + 241 + static int wdt_resume(void) 242 + { 243 + clear_bit(WDOG_DEV_OPEN, &wdt_dev.status); 244 + return NOTIFY_DONE; 245 + } 246 + 247 + static int wdt_power_event(struct notifier_block *this, unsigned long event, 248 + void *ptr) 249 + { 250 + switch (event) { 251 + case PM_POST_HIBERNATION: 252 + case PM_POST_SUSPEND: 253 + return wdt_resume(); 254 + case PM_HIBERNATION_PREPARE: 255 + case PM_SUSPEND_PREPARE: 256 + return wdt_suspend(); 257 + default: 258 + return NOTIFY_DONE; 259 + } 260 + } 261 + 262 + static struct notifier_block wdt_power_notifier = { 263 + .notifier_call = wdt_power_event, 264 + }; 265 + 266 + static int __init diag288_init(void) 267 + { 268 + int ret; 269 + char ebc_begin[] = { 270 + 194, 197, 199, 201, 213 271 + }; 272 + 273 + watchdog_set_nowayout(&wdt_dev, nowayout_info); 274 + 275 + if (MACHINE_IS_VM) { 276 + pr_info("The watchdog device driver detected a z/VM environment\n"); 277 + if (__diag288_vm(WDT_FUNC_INIT, 15, 278 + ebc_begin, sizeof(ebc_begin)) != 0) { 279 + pr_err("The watchdog cannot be initialized\n"); 280 + return -EINVAL; 281 + } 282 + } else if (MACHINE_IS_LPAR) { 283 + pr_info("The watchdog device driver detected an LPAR environment\n"); 284 + if (__diag288_lpar(WDT_FUNC_INIT, 30, LPARWDT_RESTART)) { 285 + pr_err("The watchdog cannot be initialized\n"); 286 + return -EINVAL; 287 + } 288 + } else { 289 + pr_err("Linux runs in an environment that does not support the diag288 watchdog\n"); 290 + return -ENODEV; 291 + } 292 + 293 + if (__diag288_lpar(WDT_FUNC_CANCEL, 0, 0)) { 294 + pr_err("The watchdog cannot be deactivated\n"); 295 + return -EINVAL; 296 + } 297 + 298 + ret = register_pm_notifier(&wdt_power_notifier); 299 + if (ret) 300 + return ret; 301 + 302 + ret = watchdog_register_device(&wdt_dev); 303 + if (ret) 304 + unregister_pm_notifier(&wdt_power_notifier); 305 + 306 + return ret; 307 + } 308 + 309 + static void __exit diag288_exit(void) 310 + { 311 + watchdog_unregister_device(&wdt_dev); 312 + unregister_pm_notifier(&wdt_power_notifier); 313 + } 314 + 315 + module_init(diag288_init); 316 + module_exit(diag288_exit);
+2 -1
drivers/xen/grant-table.c
··· 1168 1168 1169 1169 int gnttab_suspend(void) 1170 1170 { 1171 - gnttab_interface->unmap_frames(); 1171 + if (!xen_feature(XENFEAT_auto_translated_physmap)) 1172 + gnttab_interface->unmap_frames(); 1172 1173 return 0; 1173 1174 } 1174 1175
+11 -2
fs/btrfs/ctree.h
··· 1259 1259 spinlock_t lock; 1260 1260 u64 pinned; 1261 1261 u64 reserved; 1262 + u64 delalloc_bytes; 1262 1263 u64 bytes_super; 1263 1264 u64 flags; 1264 1265 u64 sectorsize; 1265 1266 u64 cache_generation; 1267 + 1268 + /* 1269 + * It is just used for the delayed data space allocation because 1270 + * only the data space allocation and the relative metadata update 1271 + * can be done cross the transaction. 1272 + */ 1273 + struct rw_semaphore data_rwsem; 1266 1274 1267 1275 /* for raid56, this is a full stripe, without parity */ 1268 1276 unsigned long full_stripe_len; ··· 3324 3316 struct btrfs_key *ins); 3325 3317 int btrfs_reserve_extent(struct btrfs_root *root, u64 num_bytes, 3326 3318 u64 min_alloc_size, u64 empty_size, u64 hint_byte, 3327 - struct btrfs_key *ins, int is_data); 3319 + struct btrfs_key *ins, int is_data, int delalloc); 3328 3320 int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, 3329 3321 struct extent_buffer *buf, int full_backref, int no_quota); 3330 3322 int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, ··· 3338 3330 u64 bytenr, u64 num_bytes, u64 parent, u64 root_objectid, 3339 3331 u64 owner, u64 offset, int no_quota); 3340 3332 3341 - int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); 3333 + int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len, 3334 + int delalloc); 3342 3335 int btrfs_free_and_pin_reserved_extent(struct btrfs_root *root, 3343 3336 u64 start, u64 len); 3344 3337 void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
+112 -31
fs/btrfs/extent-tree.c
··· 105 105 static void dump_space_info(struct btrfs_space_info *info, u64 bytes, 106 106 int dump_block_groups); 107 107 static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, 108 - u64 num_bytes, int reserve); 108 + u64 num_bytes, int reserve, 109 + int delalloc); 109 110 static int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv, 110 111 u64 num_bytes); 111 112 int btrfs_pin_extent(struct btrfs_root *root, ··· 3261 3260 3262 3261 spin_lock(&block_group->lock); 3263 3262 if (block_group->cached != BTRFS_CACHE_FINISHED || 3264 - !btrfs_test_opt(root, SPACE_CACHE)) { 3263 + !btrfs_test_opt(root, SPACE_CACHE) || 3264 + block_group->delalloc_bytes) { 3265 3265 /* 3266 3266 * don't bother trying to write stuff out _if_ 3267 3267 * a) we're not cached, ··· 5615 5613 * @cache: The cache we are manipulating 5616 5614 * @num_bytes: The number of bytes in question 5617 5615 * @reserve: One of the reservation enums 5616 + * @delalloc: The blocks are allocated for the delalloc write 5618 5617 * 5619 5618 * This is called by the allocator when it reserves space, or by somebody who is 5620 5619 * freeing space that was never actually used on disk. For example if you ··· 5634 5631 * succeeds. 5635 5632 */ 5636 5633 static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, 5637 - u64 num_bytes, int reserve) 5634 + u64 num_bytes, int reserve, int delalloc) 5638 5635 { 5639 5636 struct btrfs_space_info *space_info = cache->space_info; 5640 5637 int ret = 0; ··· 5653 5650 num_bytes, 0); 5654 5651 space_info->bytes_may_use -= num_bytes; 5655 5652 } 5653 + 5654 + if (delalloc) 5655 + cache->delalloc_bytes += num_bytes; 5656 5656 } 5657 5657 } else { 5658 5658 if (cache->ro) 5659 5659 space_info->bytes_readonly += num_bytes; 5660 5660 cache->reserved -= num_bytes; 5661 5661 space_info->bytes_reserved -= num_bytes; 5662 + 5663 + if (delalloc) 5664 + cache->delalloc_bytes -= num_bytes; 5662 5665 } 5663 5666 spin_unlock(&cache->lock); 5664 5667 spin_unlock(&space_info->lock); ··· 6215 6206 WARN_ON(test_bit(EXTENT_BUFFER_DIRTY, &buf->bflags)); 6216 6207 6217 6208 btrfs_add_free_space(cache, buf->start, buf->len); 6218 - btrfs_update_reserved_bytes(cache, buf->len, RESERVE_FREE); 6209 + btrfs_update_reserved_bytes(cache, buf->len, RESERVE_FREE, 0); 6219 6210 trace_btrfs_reserved_extent_free(root, buf->start, buf->len); 6220 6211 pin = 0; 6221 6212 } ··· 6374 6365 LOOP_NO_EMPTY_SIZE = 3, 6375 6366 }; 6376 6367 6368 + static inline void 6369 + btrfs_lock_block_group(struct btrfs_block_group_cache *cache, 6370 + int delalloc) 6371 + { 6372 + if (delalloc) 6373 + down_read(&cache->data_rwsem); 6374 + } 6375 + 6376 + static inline void 6377 + btrfs_grab_block_group(struct btrfs_block_group_cache *cache, 6378 + int delalloc) 6379 + { 6380 + btrfs_get_block_group(cache); 6381 + if (delalloc) 6382 + down_read(&cache->data_rwsem); 6383 + } 6384 + 6385 + static struct btrfs_block_group_cache * 6386 + btrfs_lock_cluster(struct btrfs_block_group_cache *block_group, 6387 + struct btrfs_free_cluster *cluster, 6388 + int delalloc) 6389 + { 6390 + struct btrfs_block_group_cache *used_bg; 6391 + bool locked = false; 6392 + again: 6393 + spin_lock(&cluster->refill_lock); 6394 + if (locked) { 6395 + if (used_bg == cluster->block_group) 6396 + return used_bg; 6397 + 6398 + up_read(&used_bg->data_rwsem); 6399 + btrfs_put_block_group(used_bg); 6400 + } 6401 + 6402 + used_bg = cluster->block_group; 6403 + if (!used_bg) 6404 + return NULL; 6405 + 6406 + if (used_bg == block_group) 6407 + return used_bg; 6408 + 6409 + btrfs_get_block_group(used_bg); 6410 + 6411 + if (!delalloc) 6412 + return used_bg; 6413 + 6414 + if (down_read_trylock(&used_bg->data_rwsem)) 6415 + return used_bg; 6416 + 6417 + spin_unlock(&cluster->refill_lock); 6418 + down_read(&used_bg->data_rwsem); 6419 + locked = true; 6420 + goto again; 6421 + } 6422 + 6423 + static inline void 6424 + btrfs_release_block_group(struct btrfs_block_group_cache *cache, 6425 + int delalloc) 6426 + { 6427 + if (delalloc) 6428 + up_read(&cache->data_rwsem); 6429 + btrfs_put_block_group(cache); 6430 + } 6431 + 6377 6432 /* 6378 6433 * walks the btree of allocated extents and find a hole of a given size. 6379 6434 * The key ins is changed to record the hole: ··· 6452 6379 static noinline int find_free_extent(struct btrfs_root *orig_root, 6453 6380 u64 num_bytes, u64 empty_size, 6454 6381 u64 hint_byte, struct btrfs_key *ins, 6455 - u64 flags) 6382 + u64 flags, int delalloc) 6456 6383 { 6457 6384 int ret = 0; 6458 6385 struct btrfs_root *root = orig_root->fs_info->extent_root; ··· 6540 6467 up_read(&space_info->groups_sem); 6541 6468 } else { 6542 6469 index = get_block_group_index(block_group); 6470 + btrfs_lock_block_group(block_group, delalloc); 6543 6471 goto have_block_group; 6544 6472 } 6545 6473 } else if (block_group) { ··· 6555 6481 u64 offset; 6556 6482 int cached; 6557 6483 6558 - btrfs_get_block_group(block_group); 6484 + btrfs_grab_block_group(block_group, delalloc); 6559 6485 search_start = block_group->key.objectid; 6560 6486 6561 6487 /* ··· 6603 6529 * the refill lock keeps out other 6604 6530 * people trying to start a new cluster 6605 6531 */ 6606 - spin_lock(&last_ptr->refill_lock); 6607 - used_block_group = last_ptr->block_group; 6608 - if (used_block_group != block_group && 6609 - (!used_block_group || 6610 - used_block_group->ro || 6611 - !block_group_bits(used_block_group, flags))) 6532 + used_block_group = btrfs_lock_cluster(block_group, 6533 + last_ptr, 6534 + delalloc); 6535 + if (!used_block_group) 6612 6536 goto refill_cluster; 6613 6537 6614 - if (used_block_group != block_group) 6615 - btrfs_get_block_group(used_block_group); 6538 + if (used_block_group != block_group && 6539 + (used_block_group->ro || 6540 + !block_group_bits(used_block_group, flags))) 6541 + goto release_cluster; 6616 6542 6617 6543 offset = btrfs_alloc_from_cluster(used_block_group, 6618 6544 last_ptr, ··· 6626 6552 used_block_group, 6627 6553 search_start, num_bytes); 6628 6554 if (used_block_group != block_group) { 6629 - btrfs_put_block_group(block_group); 6555 + btrfs_release_block_group(block_group, 6556 + delalloc); 6630 6557 block_group = used_block_group; 6631 6558 } 6632 6559 goto checks; 6633 6560 } 6634 6561 6635 6562 WARN_ON(last_ptr->block_group != used_block_group); 6636 - if (used_block_group != block_group) 6637 - btrfs_put_block_group(used_block_group); 6638 - refill_cluster: 6563 + release_cluster: 6639 6564 /* If we are on LOOP_NO_EMPTY_SIZE, we can't 6640 6565 * set up a new clusters, so lets just skip it 6641 6566 * and let the allocator find whatever block ··· 6651 6578 * succeeding in the unclustered 6652 6579 * allocation. */ 6653 6580 if (loop >= LOOP_NO_EMPTY_SIZE && 6654 - last_ptr->block_group != block_group) { 6581 + used_block_group != block_group) { 6655 6582 spin_unlock(&last_ptr->refill_lock); 6583 + btrfs_release_block_group(used_block_group, 6584 + delalloc); 6656 6585 goto unclustered_alloc; 6657 6586 } 6658 6587 ··· 6664 6589 */ 6665 6590 btrfs_return_cluster_to_free_space(NULL, last_ptr); 6666 6591 6592 + if (used_block_group != block_group) 6593 + btrfs_release_block_group(used_block_group, 6594 + delalloc); 6595 + refill_cluster: 6667 6596 if (loop >= LOOP_NO_EMPTY_SIZE) { 6668 6597 spin_unlock(&last_ptr->refill_lock); 6669 6598 goto unclustered_alloc; ··· 6775 6696 BUG_ON(offset > search_start); 6776 6697 6777 6698 ret = btrfs_update_reserved_bytes(block_group, num_bytes, 6778 - alloc_type); 6699 + alloc_type, delalloc); 6779 6700 if (ret == -EAGAIN) { 6780 6701 btrfs_add_free_space(block_group, offset, num_bytes); 6781 6702 goto loop; ··· 6787 6708 6788 6709 trace_btrfs_reserve_extent(orig_root, block_group, 6789 6710 search_start, num_bytes); 6790 - btrfs_put_block_group(block_group); 6711 + btrfs_release_block_group(block_group, delalloc); 6791 6712 break; 6792 6713 loop: 6793 6714 failed_cluster_refill = false; 6794 6715 failed_alloc = false; 6795 6716 BUG_ON(index != get_block_group_index(block_group)); 6796 - btrfs_put_block_group(block_group); 6717 + btrfs_release_block_group(block_group, delalloc); 6797 6718 } 6798 6719 up_read(&space_info->groups_sem); 6799 6720 ··· 6906 6827 int btrfs_reserve_extent(struct btrfs_root *root, 6907 6828 u64 num_bytes, u64 min_alloc_size, 6908 6829 u64 empty_size, u64 hint_byte, 6909 - struct btrfs_key *ins, int is_data) 6830 + struct btrfs_key *ins, int is_data, int delalloc) 6910 6831 { 6911 6832 bool final_tried = false; 6912 6833 u64 flags; ··· 6916 6837 again: 6917 6838 WARN_ON(num_bytes < root->sectorsize); 6918 6839 ret = find_free_extent(root, num_bytes, empty_size, hint_byte, ins, 6919 - flags); 6840 + flags, delalloc); 6920 6841 6921 6842 if (ret == -ENOSPC) { 6922 6843 if (!final_tried && ins->offset) { ··· 6941 6862 } 6942 6863 6943 6864 static int __btrfs_free_reserved_extent(struct btrfs_root *root, 6944 - u64 start, u64 len, int pin) 6865 + u64 start, u64 len, 6866 + int pin, int delalloc) 6945 6867 { 6946 6868 struct btrfs_block_group_cache *cache; 6947 6869 int ret = 0; ··· 6961 6881 pin_down_extent(root, cache, start, len, 1); 6962 6882 else { 6963 6883 btrfs_add_free_space(cache, start, len); 6964 - btrfs_update_reserved_bytes(cache, len, RESERVE_FREE); 6884 + btrfs_update_reserved_bytes(cache, len, RESERVE_FREE, delalloc); 6965 6885 } 6966 6886 btrfs_put_block_group(cache); 6967 6887 ··· 6971 6891 } 6972 6892 6973 6893 int btrfs_free_reserved_extent(struct btrfs_root *root, 6974 - u64 start, u64 len) 6894 + u64 start, u64 len, int delalloc) 6975 6895 { 6976 - return __btrfs_free_reserved_extent(root, start, len, 0); 6896 + return __btrfs_free_reserved_extent(root, start, len, 0, delalloc); 6977 6897 } 6978 6898 6979 6899 int btrfs_free_and_pin_reserved_extent(struct btrfs_root *root, 6980 6900 u64 start, u64 len) 6981 6901 { 6982 - return __btrfs_free_reserved_extent(root, start, len, 1); 6902 + return __btrfs_free_reserved_extent(root, start, len, 1, 0); 6983 6903 } 6984 6904 6985 6905 static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans, ··· 7194 7114 return -EINVAL; 7195 7115 7196 7116 ret = btrfs_update_reserved_bytes(block_group, ins->offset, 7197 - RESERVE_ALLOC_NO_ACCOUNT); 7117 + RESERVE_ALLOC_NO_ACCOUNT, 0); 7198 7118 BUG_ON(ret); /* logic error */ 7199 7119 ret = alloc_reserved_file_extent(trans, root, 0, root_objectid, 7200 7120 0, owner, offset, ins, 1); ··· 7336 7256 return ERR_CAST(block_rsv); 7337 7257 7338 7258 ret = btrfs_reserve_extent(root, blocksize, blocksize, 7339 - empty_size, hint, &ins, 0); 7259 + empty_size, hint, &ins, 0, 0); 7340 7260 if (ret) { 7341 7261 unuse_block_rsv(root->fs_info, block_rsv, blocksize); 7342 7262 return ERR_PTR(ret); ··· 8739 8659 start); 8740 8660 atomic_set(&cache->count, 1); 8741 8661 spin_lock_init(&cache->lock); 8662 + init_rwsem(&cache->data_rwsem); 8742 8663 INIT_LIST_HEAD(&cache->list); 8743 8664 INIT_LIST_HEAD(&cache->cluster_list); 8744 8665 INIT_LIST_HEAD(&cache->new_bg_list);
-1
fs/btrfs/extent_io.h
··· 158 158 * to unlock 159 159 */ 160 160 wait_queue_head_t read_lock_wq; 161 - wait_queue_head_t lock_wq; 162 161 struct page *pages[INLINE_EXTENT_BUFFER_PAGES]; 163 162 #ifdef CONFIG_BTRFS_DEBUG 164 163 struct list_head leak_list;
+2
fs/btrfs/extent_map.c
··· 75 75 if (atomic_dec_and_test(&em->refs)) { 76 76 WARN_ON(extent_map_in_tree(em)); 77 77 WARN_ON(!list_empty(&em->list)); 78 + if (test_bit(EXTENT_FLAG_FS_MAPPING, &em->flags)) 79 + kfree(em->bdev); 78 80 kmem_cache_free(extent_map_cache, em); 79 81 } 80 82 }
+1
fs/btrfs/extent_map.h
··· 15 15 #define EXTENT_FLAG_PREALLOC 3 /* pre-allocated extent */ 16 16 #define EXTENT_FLAG_LOGGING 4 /* Logging this extent */ 17 17 #define EXTENT_FLAG_FILLING 5 /* Filling in a preallocated extent */ 18 + #define EXTENT_FLAG_FS_MAPPING 6 /* filesystem extent mapping type */ 18 19 19 20 struct extent_map { 20 21 struct rb_node rb_node;
+127 -67
fs/btrfs/free-space-cache.c
··· 274 274 }; 275 275 276 276 static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode, 277 - struct btrfs_root *root) 277 + struct btrfs_root *root, int write) 278 278 { 279 + int num_pages; 280 + int check_crcs = 0; 281 + 282 + num_pages = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> 283 + PAGE_CACHE_SHIFT; 284 + 285 + if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) 286 + check_crcs = 1; 287 + 288 + /* Make sure we can fit our crcs into the first page */ 289 + if (write && check_crcs && 290 + (num_pages * sizeof(u32)) >= PAGE_CACHE_SIZE) 291 + return -ENOSPC; 292 + 279 293 memset(io_ctl, 0, sizeof(struct io_ctl)); 280 - io_ctl->num_pages = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> 281 - PAGE_CACHE_SHIFT; 282 - io_ctl->pages = kzalloc(sizeof(struct page *) * io_ctl->num_pages, 283 - GFP_NOFS); 294 + 295 + io_ctl->pages = kzalloc(sizeof(struct page *) * num_pages, GFP_NOFS); 284 296 if (!io_ctl->pages) 285 297 return -ENOMEM; 298 + 299 + io_ctl->num_pages = num_pages; 286 300 io_ctl->root = root; 287 - if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) 288 - io_ctl->check_crcs = 1; 301 + io_ctl->check_crcs = check_crcs; 302 + 289 303 return 0; 290 304 } 291 305 ··· 680 666 generation = btrfs_free_space_generation(leaf, header); 681 667 btrfs_release_path(path); 682 668 669 + if (!BTRFS_I(inode)->generation) { 670 + btrfs_info(root->fs_info, 671 + "The free space cache file (%llu) is invalid. skip it\n", 672 + offset); 673 + return 0; 674 + } 675 + 683 676 if (BTRFS_I(inode)->generation != generation) { 684 677 btrfs_err(root->fs_info, 685 678 "free space inode generation (%llu) " ··· 698 677 if (!num_entries) 699 678 return 0; 700 679 701 - ret = io_ctl_init(&io_ctl, inode, root); 680 + ret = io_ctl_init(&io_ctl, inode, root, 0); 702 681 if (ret) 703 682 return ret; 704 683 ··· 978 957 } 979 958 980 959 static noinline_for_stack int 981 - add_ioctl_entries(struct btrfs_root *root, 982 - struct inode *inode, 983 - struct btrfs_block_group_cache *block_group, 984 - struct io_ctl *io_ctl, 985 - struct extent_state **cached_state, 986 - struct list_head *bitmap_list, 987 - int *entries) 960 + write_pinned_extent_entries(struct btrfs_root *root, 961 + struct btrfs_block_group_cache *block_group, 962 + struct io_ctl *io_ctl, 963 + int *entries) 988 964 { 989 965 u64 start, extent_start, extent_end, len; 990 - struct list_head *pos, *n; 991 966 struct extent_io_tree *unpin = NULL; 992 967 int ret; 968 + 969 + if (!block_group) 970 + return 0; 993 971 994 972 /* 995 973 * We want to add any pinned extents to our free space cache ··· 999 979 */ 1000 980 unpin = root->fs_info->pinned_extents; 1001 981 1002 - if (block_group) 1003 - start = block_group->key.objectid; 982 + start = block_group->key.objectid; 1004 983 1005 - while (block_group && (start < block_group->key.objectid + 1006 - block_group->key.offset)) { 984 + while (start < block_group->key.objectid + block_group->key.offset) { 1007 985 ret = find_first_extent_bit(unpin, start, 1008 986 &extent_start, &extent_end, 1009 987 EXTENT_DIRTY, NULL); 1010 - if (ret) { 1011 - ret = 0; 1012 - break; 1013 - } 988 + if (ret) 989 + return 0; 1014 990 1015 991 /* This pinned extent is out of our range */ 1016 992 if (extent_start >= block_group->key.objectid + 1017 993 block_group->key.offset) 1018 - break; 994 + return 0; 1019 995 1020 996 extent_start = max(extent_start, start); 1021 997 extent_end = min(block_group->key.objectid + ··· 1021 1005 *entries += 1; 1022 1006 ret = io_ctl_add_entry(io_ctl, extent_start, len, NULL); 1023 1007 if (ret) 1024 - goto out_nospc; 1008 + return -ENOSPC; 1025 1009 1026 1010 start = extent_end; 1027 1011 } 1012 + 1013 + return 0; 1014 + } 1015 + 1016 + static noinline_for_stack int 1017 + write_bitmap_entries(struct io_ctl *io_ctl, struct list_head *bitmap_list) 1018 + { 1019 + struct list_head *pos, *n; 1020 + int ret; 1028 1021 1029 1022 /* Write out the bitmaps */ 1030 1023 list_for_each_safe(pos, n, bitmap_list) { ··· 1042 1017 1043 1018 ret = io_ctl_add_bitmap(io_ctl, entry->bitmap); 1044 1019 if (ret) 1045 - goto out_nospc; 1020 + return -ENOSPC; 1046 1021 list_del_init(&entry->list); 1047 1022 } 1048 1023 1049 - /* Zero out the rest of the pages just to make sure */ 1050 - io_ctl_zero_remaining_pages(io_ctl); 1024 + return 0; 1025 + } 1051 1026 1052 - ret = btrfs_dirty_pages(root, inode, io_ctl->pages, io_ctl->num_pages, 1053 - 0, i_size_read(inode), cached_state); 1054 - io_ctl_drop_pages(io_ctl); 1055 - unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0, 1056 - i_size_read(inode) - 1, cached_state, GFP_NOFS); 1057 - 1058 - if (ret) 1059 - goto fail; 1027 + static int flush_dirty_cache(struct inode *inode) 1028 + { 1029 + int ret; 1060 1030 1061 1031 ret = btrfs_wait_ordered_range(inode, 0, (u64)-1); 1062 - if (ret) { 1032 + if (ret) 1063 1033 clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, inode->i_size - 1, 1064 1034 EXTENT_DIRTY | EXTENT_DELALLOC, 0, 0, NULL, 1065 1035 GFP_NOFS); 1066 - goto fail; 1067 - } 1068 - return 0; 1069 1036 1070 - fail: 1071 - return -1; 1072 - 1073 - out_nospc: 1074 - return -ENOSPC; 1037 + return ret; 1075 1038 } 1076 1039 1077 1040 static void noinline_for_stack ··· 1069 1056 struct list_head *bitmap_list) 1070 1057 { 1071 1058 struct list_head *pos, *n; 1059 + 1072 1060 list_for_each_safe(pos, n, bitmap_list) { 1073 1061 struct btrfs_free_space *entry = 1074 1062 list_entry(pos, struct btrfs_free_space, list); ··· 1102 1088 { 1103 1089 struct extent_state *cached_state = NULL; 1104 1090 struct io_ctl io_ctl; 1105 - struct list_head bitmap_list; 1091 + LIST_HEAD(bitmap_list); 1106 1092 int entries = 0; 1107 1093 int bitmaps = 0; 1108 1094 int ret; 1109 - int err = -1; 1110 - 1111 - INIT_LIST_HEAD(&bitmap_list); 1112 1095 1113 1096 if (!i_size_read(inode)) 1114 1097 return -1; 1115 1098 1116 - ret = io_ctl_init(&io_ctl, inode, root); 1099 + ret = io_ctl_init(&io_ctl, inode, root, 1); 1117 1100 if (ret) 1118 1101 return -1; 1102 + 1103 + if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) { 1104 + down_write(&block_group->data_rwsem); 1105 + spin_lock(&block_group->lock); 1106 + if (block_group->delalloc_bytes) { 1107 + block_group->disk_cache_state = BTRFS_DC_WRITTEN; 1108 + spin_unlock(&block_group->lock); 1109 + up_write(&block_group->data_rwsem); 1110 + BTRFS_I(inode)->generation = 0; 1111 + ret = 0; 1112 + goto out; 1113 + } 1114 + spin_unlock(&block_group->lock); 1115 + } 1119 1116 1120 1117 /* Lock all pages first so we can lock the extent safely. */ 1121 1118 io_ctl_prepare_pages(&io_ctl, inode, 0); ··· 1134 1109 lock_extent_bits(&BTRFS_I(inode)->io_tree, 0, i_size_read(inode) - 1, 1135 1110 0, &cached_state); 1136 1111 1137 - 1138 - /* Make sure we can fit our crcs into the first page */ 1139 - if (io_ctl.check_crcs && 1140 - (io_ctl.num_pages * sizeof(u32)) >= PAGE_CACHE_SIZE) 1141 - goto out_nospc; 1142 - 1143 1112 io_ctl_set_generation(&io_ctl, trans->transid); 1144 1113 1114 + /* Write out the extent entries in the free space cache */ 1145 1115 ret = write_cache_extent_entries(&io_ctl, ctl, 1146 1116 block_group, &entries, &bitmaps, 1147 1117 &bitmap_list); 1148 1118 if (ret) 1149 1119 goto out_nospc; 1150 1120 1151 - ret = add_ioctl_entries(root, inode, block_group, &io_ctl, 1152 - &cached_state, &bitmap_list, &entries); 1153 - 1154 - if (ret == -ENOSPC) 1121 + /* 1122 + * Some spaces that are freed in the current transaction are pinned, 1123 + * they will be added into free space cache after the transaction is 1124 + * committed, we shouldn't lose them. 1125 + */ 1126 + ret = write_pinned_extent_entries(root, block_group, &io_ctl, &entries); 1127 + if (ret) 1155 1128 goto out_nospc; 1156 - else if (ret) 1129 + 1130 + /* At last, we write out all the bitmaps. */ 1131 + ret = write_bitmap_entries(&io_ctl, &bitmap_list); 1132 + if (ret) 1133 + goto out_nospc; 1134 + 1135 + /* Zero out the rest of the pages just to make sure */ 1136 + io_ctl_zero_remaining_pages(&io_ctl); 1137 + 1138 + /* Everything is written out, now we dirty the pages in the file. */ 1139 + ret = btrfs_dirty_pages(root, inode, io_ctl.pages, io_ctl.num_pages, 1140 + 0, i_size_read(inode), &cached_state); 1141 + if (ret) 1142 + goto out_nospc; 1143 + 1144 + if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) 1145 + up_write(&block_group->data_rwsem); 1146 + /* 1147 + * Release the pages and unlock the extent, we will flush 1148 + * them out later 1149 + */ 1150 + io_ctl_drop_pages(&io_ctl); 1151 + 1152 + unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0, 1153 + i_size_read(inode) - 1, &cached_state, GFP_NOFS); 1154 + 1155 + /* Flush the dirty pages in the cache file. */ 1156 + ret = flush_dirty_cache(inode); 1157 + if (ret) 1157 1158 goto out; 1158 1159 1159 - err = update_cache_item(trans, root, inode, path, offset, 1160 + /* Update the cache item to tell everyone this cache file is valid. */ 1161 + ret = update_cache_item(trans, root, inode, path, offset, 1160 1162 entries, bitmaps); 1161 - 1162 1163 out: 1163 1164 io_ctl_free(&io_ctl); 1164 - if (err) { 1165 + if (ret) { 1165 1166 invalidate_inode_pages2(inode->i_mapping); 1166 1167 BTRFS_I(inode)->generation = 0; 1167 1168 } 1168 1169 btrfs_update_inode(trans, root, inode); 1169 - return err; 1170 + return ret; 1170 1171 1171 1172 out_nospc: 1172 - 1173 1173 cleanup_write_cache_enospc(inode, &io_ctl, &cached_state, &bitmap_list); 1174 + 1175 + if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) 1176 + up_write(&block_group->data_rwsem); 1177 + 1174 1178 goto out; 1175 1179 } 1176 1180 ··· 1216 1162 1217 1163 spin_lock(&block_group->lock); 1218 1164 if (block_group->disk_cache_state < BTRFS_DC_SETUP) { 1165 + spin_unlock(&block_group->lock); 1166 + return 0; 1167 + } 1168 + 1169 + if (block_group->delalloc_bytes) { 1170 + block_group->disk_cache_state = BTRFS_DC_WRITTEN; 1219 1171 spin_unlock(&block_group->lock); 1220 1172 return 0; 1221 1173 }
+30 -11
fs/btrfs/inode.c
··· 693 693 ret = btrfs_reserve_extent(root, 694 694 async_extent->compressed_size, 695 695 async_extent->compressed_size, 696 - 0, alloc_hint, &ins, 1); 696 + 0, alloc_hint, &ins, 1, 1); 697 697 if (ret) { 698 698 int i; 699 699 ··· 794 794 out: 795 795 return ret; 796 796 out_free_reserve: 797 - btrfs_free_reserved_extent(root, ins.objectid, ins.offset); 797 + btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1); 798 798 out_free: 799 799 extent_clear_unlock_delalloc(inode, async_extent->start, 800 800 async_extent->start + ··· 917 917 cur_alloc_size = disk_num_bytes; 918 918 ret = btrfs_reserve_extent(root, cur_alloc_size, 919 919 root->sectorsize, 0, alloc_hint, 920 - &ins, 1); 920 + &ins, 1, 1); 921 921 if (ret < 0) 922 922 goto out_unlock; 923 923 ··· 995 995 return ret; 996 996 997 997 out_reserve: 998 - btrfs_free_reserved_extent(root, ins.objectid, ins.offset); 998 + btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1); 999 999 out_unlock: 1000 1000 extent_clear_unlock_delalloc(inode, start, end, locked_page, 1001 1001 EXTENT_LOCKED | EXTENT_DO_ACCOUNTING | ··· 2599 2599 return NULL; 2600 2600 } 2601 2601 2602 + static void btrfs_release_delalloc_bytes(struct btrfs_root *root, 2603 + u64 start, u64 len) 2604 + { 2605 + struct btrfs_block_group_cache *cache; 2606 + 2607 + cache = btrfs_lookup_block_group(root->fs_info, start); 2608 + ASSERT(cache); 2609 + 2610 + spin_lock(&cache->lock); 2611 + cache->delalloc_bytes -= len; 2612 + spin_unlock(&cache->lock); 2613 + 2614 + btrfs_put_block_group(cache); 2615 + } 2616 + 2602 2617 /* as ordered data IO finishes, this gets called so we can finish 2603 2618 * an ordered extent if the range of bytes in the file it covers are 2604 2619 * fully written. ··· 2713 2698 logical_len, logical_len, 2714 2699 compress_type, 0, 0, 2715 2700 BTRFS_FILE_EXTENT_REG); 2701 + if (!ret) 2702 + btrfs_release_delalloc_bytes(root, 2703 + ordered_extent->start, 2704 + ordered_extent->disk_len); 2716 2705 } 2717 2706 unpin_extent_cache(&BTRFS_I(inode)->extent_tree, 2718 2707 ordered_extent->file_offset, ordered_extent->len, ··· 2769 2750 !test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags) && 2770 2751 !test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags)) 2771 2752 btrfs_free_reserved_extent(root, ordered_extent->start, 2772 - ordered_extent->disk_len); 2753 + ordered_extent->disk_len, 1); 2773 2754 } 2774 2755 2775 2756 ··· 6554 6535 6555 6536 alloc_hint = get_extent_allocation_hint(inode, start, len); 6556 6537 ret = btrfs_reserve_extent(root, len, root->sectorsize, 0, 6557 - alloc_hint, &ins, 1); 6538 + alloc_hint, &ins, 1, 1); 6558 6539 if (ret) 6559 6540 return ERR_PTR(ret); 6560 6541 6561 6542 em = create_pinned_em(inode, start, ins.offset, start, ins.objectid, 6562 6543 ins.offset, ins.offset, ins.offset, 0); 6563 6544 if (IS_ERR(em)) { 6564 - btrfs_free_reserved_extent(root, ins.objectid, ins.offset); 6545 + btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1); 6565 6546 return em; 6566 6547 } 6567 6548 6568 6549 ret = btrfs_add_ordered_extent_dio(inode, start, ins.objectid, 6569 6550 ins.offset, ins.offset, 0); 6570 6551 if (ret) { 6571 - btrfs_free_reserved_extent(root, ins.objectid, ins.offset); 6552 + btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1); 6572 6553 free_extent_map(em); 6573 6554 return ERR_PTR(ret); 6574 6555 } ··· 7456 7437 if (!test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags) && 7457 7438 !test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) 7458 7439 btrfs_free_reserved_extent(root, ordered->start, 7459 - ordered->disk_len); 7440 + ordered->disk_len, 1); 7460 7441 btrfs_put_ordered_extent(ordered); 7461 7442 btrfs_put_ordered_extent(ordered); 7462 7443 } ··· 8827 8808 cur_bytes = min(num_bytes, 256ULL * 1024 * 1024); 8828 8809 cur_bytes = max(cur_bytes, min_size); 8829 8810 ret = btrfs_reserve_extent(root, cur_bytes, min_size, 0, 8830 - *alloc_hint, &ins, 1); 8811 + *alloc_hint, &ins, 1, 0); 8831 8812 if (ret) { 8832 8813 if (own_trans) 8833 8814 btrfs_end_transaction(trans, root); ··· 8841 8822 BTRFS_FILE_EXTENT_PREALLOC); 8842 8823 if (ret) { 8843 8824 btrfs_free_reserved_extent(root, ins.objectid, 8844 - ins.offset); 8825 + ins.offset, 0); 8845 8826 btrfs_abort_transaction(trans, root, ret); 8846 8827 if (own_trans) 8847 8828 btrfs_end_transaction(trans, root);
+46 -34
fs/btrfs/locking.c
··· 33 33 */ 34 34 void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw) 35 35 { 36 - if (eb->lock_nested) { 37 - read_lock(&eb->lock); 38 - if (eb->lock_nested && current->pid == eb->lock_owner) { 39 - read_unlock(&eb->lock); 40 - return; 41 - } 42 - read_unlock(&eb->lock); 43 - } 36 + /* 37 + * no lock is required. The lock owner may change if 38 + * we have a read lock, but it won't change to or away 39 + * from us. If we have the write lock, we are the owner 40 + * and it'll never change. 41 + */ 42 + if (eb->lock_nested && current->pid == eb->lock_owner) 43 + return; 44 44 if (rw == BTRFS_WRITE_LOCK) { 45 45 if (atomic_read(&eb->blocking_writers) == 0) { 46 46 WARN_ON(atomic_read(&eb->spinning_writers) != 1); ··· 65 65 */ 66 66 void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw) 67 67 { 68 - if (eb->lock_nested) { 69 - read_lock(&eb->lock); 70 - if (eb->lock_nested && current->pid == eb->lock_owner) { 71 - read_unlock(&eb->lock); 72 - return; 73 - } 74 - read_unlock(&eb->lock); 75 - } 68 + /* 69 + * no lock is required. The lock owner may change if 70 + * we have a read lock, but it won't change to or away 71 + * from us. If we have the write lock, we are the owner 72 + * and it'll never change. 73 + */ 74 + if (eb->lock_nested && current->pid == eb->lock_owner) 75 + return; 76 + 76 77 if (rw == BTRFS_WRITE_LOCK_BLOCKING) { 77 78 BUG_ON(atomic_read(&eb->blocking_writers) != 1); 78 79 write_lock(&eb->lock); ··· 100 99 void btrfs_tree_read_lock(struct extent_buffer *eb) 101 100 { 102 101 again: 102 + BUG_ON(!atomic_read(&eb->blocking_writers) && 103 + current->pid == eb->lock_owner); 104 + 103 105 read_lock(&eb->lock); 104 106 if (atomic_read(&eb->blocking_writers) && 105 107 current->pid == eb->lock_owner) { ··· 136 132 if (atomic_read(&eb->blocking_writers)) 137 133 return 0; 138 134 139 - read_lock(&eb->lock); 135 + if (!read_trylock(&eb->lock)) 136 + return 0; 137 + 140 138 if (atomic_read(&eb->blocking_writers)) { 141 139 read_unlock(&eb->lock); 142 140 return 0; ··· 157 151 if (atomic_read(&eb->blocking_writers) || 158 152 atomic_read(&eb->blocking_readers)) 159 153 return 0; 160 - write_lock(&eb->lock); 154 + 155 + if (!write_trylock(&eb->lock)) 156 + return 0; 157 + 161 158 if (atomic_read(&eb->blocking_writers) || 162 159 atomic_read(&eb->blocking_readers)) { 163 160 write_unlock(&eb->lock); ··· 177 168 */ 178 169 void btrfs_tree_read_unlock(struct extent_buffer *eb) 179 170 { 180 - if (eb->lock_nested) { 181 - read_lock(&eb->lock); 182 - if (eb->lock_nested && current->pid == eb->lock_owner) { 183 - eb->lock_nested = 0; 184 - read_unlock(&eb->lock); 185 - return; 186 - } 187 - read_unlock(&eb->lock); 171 + /* 172 + * if we're nested, we have the write lock. No new locking 173 + * is needed as long as we are the lock owner. 174 + * The write unlock will do a barrier for us, and the lock_nested 175 + * field only matters to the lock owner. 176 + */ 177 + if (eb->lock_nested && current->pid == eb->lock_owner) { 178 + eb->lock_nested = 0; 179 + return; 188 180 } 189 181 btrfs_assert_tree_read_locked(eb); 190 182 WARN_ON(atomic_read(&eb->spinning_readers) == 0); ··· 199 189 */ 200 190 void btrfs_tree_read_unlock_blocking(struct extent_buffer *eb) 201 191 { 202 - if (eb->lock_nested) { 203 - read_lock(&eb->lock); 204 - if (eb->lock_nested && current->pid == eb->lock_owner) { 205 - eb->lock_nested = 0; 206 - read_unlock(&eb->lock); 207 - return; 208 - } 209 - read_unlock(&eb->lock); 192 + /* 193 + * if we're nested, we have the write lock. No new locking 194 + * is needed as long as we are the lock owner. 195 + * The write unlock will do a barrier for us, and the lock_nested 196 + * field only matters to the lock owner. 197 + */ 198 + if (eb->lock_nested && current->pid == eb->lock_owner) { 199 + eb->lock_nested = 0; 200 + return; 210 201 } 211 202 btrfs_assert_tree_read_locked(eb); 212 203 WARN_ON(atomic_read(&eb->blocking_readers) == 0); ··· 255 244 BUG_ON(blockers > 1); 256 245 257 246 btrfs_assert_tree_locked(eb); 247 + eb->lock_owner = 0; 258 248 atomic_dec(&eb->write_locks); 259 249 260 250 if (blockers) {
+9 -10
fs/btrfs/scrub.c
··· 2725 2725 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent); 2726 2726 length = btrfs_dev_extent_length(l, dev_extent); 2727 2727 2728 - if (found_key.offset + length <= start) { 2729 - key.offset = found_key.offset + length; 2730 - btrfs_release_path(path); 2731 - continue; 2732 - } 2728 + if (found_key.offset + length <= start) 2729 + goto skip; 2733 2730 2734 2731 chunk_tree = btrfs_dev_extent_chunk_tree(l, dev_extent); 2735 2732 chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent); ··· 2737 2740 * the chunk from going away while we scrub it 2738 2741 */ 2739 2742 cache = btrfs_lookup_block_group(fs_info, chunk_offset); 2740 - if (!cache) { 2741 - ret = -ENOENT; 2742 - break; 2743 - } 2743 + 2744 + /* some chunks are removed but not committed to disk yet, 2745 + * continue scrubbing */ 2746 + if (!cache) 2747 + goto skip; 2748 + 2744 2749 dev_replace->cursor_right = found_key.offset + length; 2745 2750 dev_replace->cursor_left = found_key.offset; 2746 2751 dev_replace->item_needs_writeback = 1; ··· 2801 2802 2802 2803 dev_replace->cursor_left = dev_replace->cursor_right; 2803 2804 dev_replace->item_needs_writeback = 1; 2804 - 2805 + skip: 2805 2806 key.offset = found_key.offset + length; 2806 2807 btrfs_release_path(path); 2807 2808 }
+19 -17
fs/btrfs/volumes.c
··· 2543 2543 remove_extent_mapping(em_tree, em); 2544 2544 write_unlock(&em_tree->lock); 2545 2545 2546 - kfree(map); 2547 - em->bdev = NULL; 2548 - 2549 2546 /* once for the tree */ 2550 2547 free_extent_map(em); 2551 2548 /* once for us */ ··· 4298 4301 4299 4302 em = alloc_extent_map(); 4300 4303 if (!em) { 4304 + kfree(map); 4301 4305 ret = -ENOMEM; 4302 4306 goto error; 4303 4307 } 4308 + set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags); 4304 4309 em->bdev = (struct block_device *)map; 4305 4310 em->start = start; 4306 4311 em->len = num_bytes; ··· 4345 4346 /* One for the tree reference */ 4346 4347 free_extent_map(em); 4347 4348 error: 4348 - kfree(map); 4349 4349 kfree(devices_info); 4350 4350 return ret; 4351 4351 } ··· 4556 4558 write_unlock(&tree->map_tree.lock); 4557 4559 if (!em) 4558 4560 break; 4559 - kfree(em->bdev); 4560 4561 /* once for us */ 4561 4562 free_extent_map(em); 4562 4563 /* once for the tree */ ··· 5359 5362 return 0; 5360 5363 } 5361 5364 5365 + static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio, int err) 5366 + { 5367 + if (likely(bbio->flags & BTRFS_BIO_ORIG_BIO_SUBMITTED)) 5368 + bio_endio_nodec(bio, err); 5369 + else 5370 + bio_endio(bio, err); 5371 + kfree(bbio); 5372 + } 5373 + 5362 5374 static void btrfs_end_bio(struct bio *bio, int err) 5363 5375 { 5364 5376 struct btrfs_bio *bbio = bio->bi_private; ··· 5408 5402 bio = bbio->orig_bio; 5409 5403 } 5410 5404 5411 - /* 5412 - * We have original bio now. So increment bi_remaining to 5413 - * account for it in endio 5414 - */ 5415 - atomic_inc(&bio->bi_remaining); 5416 - 5417 5405 bio->bi_private = bbio->private; 5418 5406 bio->bi_end_io = bbio->end_io; 5419 5407 btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; ··· 5424 5424 set_bit(BIO_UPTODATE, &bio->bi_flags); 5425 5425 err = 0; 5426 5426 } 5427 - kfree(bbio); 5428 5427 5429 - bio_endio(bio, err); 5428 + btrfs_end_bbio(bbio, bio, err); 5430 5429 } else if (!is_orig_bio) { 5431 5430 bio_put(bio); 5432 5431 } ··· 5588 5589 { 5589 5590 atomic_inc(&bbio->error); 5590 5591 if (atomic_dec_and_test(&bbio->stripes_pending)) { 5592 + /* Shoud be the original bio. */ 5593 + WARN_ON(bio != bbio->orig_bio); 5594 + 5591 5595 bio->bi_private = bbio->private; 5592 5596 bio->bi_end_io = bbio->end_io; 5593 5597 btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; 5594 5598 bio->bi_iter.bi_sector = logical >> 9; 5595 - kfree(bbio); 5596 - bio_endio(bio, -EIO); 5599 + 5600 + btrfs_end_bbio(bbio, bio, -EIO); 5597 5601 } 5598 5602 } 5599 5603 ··· 5683 5681 BUG_ON(!bio); /* -ENOMEM */ 5684 5682 } else { 5685 5683 bio = first_bio; 5684 + bbio->flags |= BTRFS_BIO_ORIG_BIO_SUBMITTED; 5686 5685 } 5687 5686 5688 5687 submit_stripe_bio(root, bbio, bio, ··· 5825 5822 return -ENOMEM; 5826 5823 } 5827 5824 5825 + set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags); 5828 5826 em->bdev = (struct block_device *)map; 5829 5827 em->start = logical; 5830 5828 em->len = length; ··· 5850 5846 map->stripes[i].dev = btrfs_find_device(root->fs_info, devid, 5851 5847 uuid, NULL); 5852 5848 if (!map->stripes[i].dev && !btrfs_test_opt(root, DEGRADED)) { 5853 - kfree(map); 5854 5849 free_extent_map(em); 5855 5850 return -EIO; 5856 5851 } ··· 5857 5854 map->stripes[i].dev = 5858 5855 add_missing_dev(root, devid, uuid); 5859 5856 if (!map->stripes[i].dev) { 5860 - kfree(map); 5861 5857 free_extent_map(em); 5862 5858 return -EIO; 5863 5859 }
+3
fs/btrfs/volumes.h
··· 190 190 struct btrfs_bio; 191 191 typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); 192 192 193 + #define BTRFS_BIO_ORIG_BIO_SUBMITTED 0x1 194 + 193 195 struct btrfs_bio { 194 196 atomic_t stripes_pending; 195 197 struct btrfs_fs_info *fs_info; 196 198 bio_end_io_t *end_io; 197 199 struct bio *orig_bio; 200 + unsigned long flags; 198 201 void *private; 199 202 atomic_t error; 200 203 int max_errors;
+2 -2
fs/eventpoll.c
··· 910 910 void eventpoll_release_file(struct file *file) 911 911 { 912 912 struct eventpoll *ep; 913 - struct epitem *epi; 913 + struct epitem *epi, *next; 914 914 915 915 /* 916 916 * We don't want to get "file->f_lock" because it is not ··· 926 926 * Besides, ep_remove() acquires the lock, so we can't hold it here. 927 927 */ 928 928 mutex_lock(&epmutex); 929 - list_for_each_entry_rcu(epi, &file->f_ep_links, fllink) { 929 + list_for_each_entry_safe(epi, next, &file->f_ep_links, fllink) { 930 930 ep = epi->ep; 931 931 mutex_lock_nested(&ep->mtx, 0); 932 932 ep_remove(ep, epi);
+1 -1
fs/locks.c
··· 431 431 if (assign_type(fl, type) != 0) 432 432 return -EINVAL; 433 433 434 - fl->fl_owner = (fl_owner_t)filp; 434 + fl->fl_owner = (fl_owner_t)current->files; 435 435 fl->fl_pid = current->tgid; 436 436 437 437 fl->fl_file = filp;
+78
fs/nfsd/nfs4state.c
··· 41 41 #include <linux/ratelimit.h> 42 42 #include <linux/sunrpc/svcauth_gss.h> 43 43 #include <linux/sunrpc/addr.h> 44 + #include <linux/hash.h> 44 45 #include "xdr4.h" 45 46 #include "xdr4cb.h" 46 47 #include "vfs.h" ··· 365 364 return openlockstateid(nfs4_alloc_stid(clp, stateid_slab)); 366 365 } 367 366 367 + /* 368 + * When we recall a delegation, we should be careful not to hand it 369 + * out again straight away. 370 + * To ensure this we keep a pair of bloom filters ('new' and 'old') 371 + * in which the filehandles of recalled delegations are "stored". 372 + * If a filehandle appear in either filter, a delegation is blocked. 373 + * When a delegation is recalled, the filehandle is stored in the "new" 374 + * filter. 375 + * Every 30 seconds we swap the filters and clear the "new" one, 376 + * unless both are empty of course. 377 + * 378 + * Each filter is 256 bits. We hash the filehandle to 32bit and use the 379 + * low 3 bytes as hash-table indices. 380 + * 381 + * 'state_lock', which is always held when block_delegations() is called, 382 + * is used to manage concurrent access. Testing does not need the lock 383 + * except when swapping the two filters. 384 + */ 385 + static struct bloom_pair { 386 + int entries, old_entries; 387 + time_t swap_time; 388 + int new; /* index into 'set' */ 389 + DECLARE_BITMAP(set[2], 256); 390 + } blocked_delegations; 391 + 392 + static int delegation_blocked(struct knfsd_fh *fh) 393 + { 394 + u32 hash; 395 + struct bloom_pair *bd = &blocked_delegations; 396 + 397 + if (bd->entries == 0) 398 + return 0; 399 + if (seconds_since_boot() - bd->swap_time > 30) { 400 + spin_lock(&state_lock); 401 + if (seconds_since_boot() - bd->swap_time > 30) { 402 + bd->entries -= bd->old_entries; 403 + bd->old_entries = bd->entries; 404 + memset(bd->set[bd->new], 0, 405 + sizeof(bd->set[0])); 406 + bd->new = 1-bd->new; 407 + bd->swap_time = seconds_since_boot(); 408 + } 409 + spin_unlock(&state_lock); 410 + } 411 + hash = arch_fast_hash(&fh->fh_base, fh->fh_size, 0); 412 + if (test_bit(hash&255, bd->set[0]) && 413 + test_bit((hash>>8)&255, bd->set[0]) && 414 + test_bit((hash>>16)&255, bd->set[0])) 415 + return 1; 416 + 417 + if (test_bit(hash&255, bd->set[1]) && 418 + test_bit((hash>>8)&255, bd->set[1]) && 419 + test_bit((hash>>16)&255, bd->set[1])) 420 + return 1; 421 + 422 + return 0; 423 + } 424 + 425 + static void block_delegations(struct knfsd_fh *fh) 426 + { 427 + u32 hash; 428 + struct bloom_pair *bd = &blocked_delegations; 429 + 430 + hash = arch_fast_hash(&fh->fh_base, fh->fh_size, 0); 431 + 432 + __set_bit(hash&255, bd->set[bd->new]); 433 + __set_bit((hash>>8)&255, bd->set[bd->new]); 434 + __set_bit((hash>>16)&255, bd->set[bd->new]); 435 + if (bd->entries == 0) 436 + bd->swap_time = seconds_since_boot(); 437 + bd->entries += 1; 438 + } 439 + 368 440 static struct nfs4_delegation * 369 441 alloc_init_deleg(struct nfs4_client *clp, struct nfs4_ol_stateid *stp, struct svc_fh *current_fh) 370 442 { ··· 445 371 446 372 dprintk("NFSD alloc_init_deleg\n"); 447 373 if (num_delegations > max_delegations) 374 + return NULL; 375 + if (delegation_blocked(&current_fh->fh_handle)) 448 376 return NULL; 449 377 dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab)); 450 378 if (dp == NULL) ··· 2845 2769 2846 2770 /* Only place dl_time is set; protected by i_lock: */ 2847 2771 dp->dl_time = get_seconds(); 2772 + 2773 + block_delegations(&dp->dl_fh); 2848 2774 2849 2775 nfsd4_cb_recall(dp); 2850 2776 }
+1
fs/nfsd/nfs4xdr.c
··· 2687 2687 nfserr = nfserr_toosmall; 2688 2688 goto fail; 2689 2689 case nfserr_noent: 2690 + xdr_truncate_encode(xdr, start_offset); 2690 2691 goto skip_entry; 2691 2692 default: 2692 2693 /*
+5 -5
include/acpi/processor.h
··· 53 53 u8 bit_offset; 54 54 u8 access_size; 55 55 u64 address; 56 - } __attribute__ ((packed)); 56 + } __packed; 57 57 58 58 struct acpi_processor_cx { 59 59 u8 valid; ··· 83 83 u64 domain; 84 84 u64 coord_type; 85 85 u64 num_processors; 86 - } __attribute__ ((packed)); 86 + } __packed; 87 87 88 88 struct acpi_pct_register { 89 89 u8 descriptor; ··· 93 93 u8 bit_offset; 94 94 u8 reserved; 95 95 u64 address; 96 - } __attribute__ ((packed)); 96 + } __packed; 97 97 98 98 struct acpi_processor_px { 99 99 u64 core_frequency; /* megahertz */ ··· 124 124 u64 domain; 125 125 u64 coord_type; 126 126 u64 num_processors; 127 - } __attribute__ ((packed)); 127 + } __packed; 128 128 129 129 struct acpi_ptc_register { 130 130 u8 descriptor; ··· 134 134 u8 bit_offset; 135 135 u8 reserved; 136 136 u64 address; 137 - } __attribute__ ((packed)); 137 + } __packed; 138 138 139 139 struct acpi_processor_tx_tss { 140 140 u64 freqpercentage; /* */
+2 -2
include/drm/i915_powerwell.h
··· 30 30 #define _I915_POWERWELL_H_ 31 31 32 32 /* For use by hda_i915 driver */ 33 - extern void i915_request_power_well(void); 34 - extern void i915_release_power_well(void); 33 + extern int i915_request_power_well(void); 34 + extern int i915_release_power_well(void); 35 35 36 36 #endif /* _I915_POWERWELL_H_ */
+1 -1
include/linux/blk-mq.h
··· 42 42 unsigned int nr_ctx; 43 43 struct blk_mq_ctx **ctxs; 44 44 45 - unsigned int wait_index; 45 + atomic_t wait_index; 46 46 47 47 struct blk_mq_tags *tags; 48 48
+1 -1
include/linux/blkdev.h
··· 920 920 sector_t offset) 921 921 { 922 922 if (!q->limits.chunk_sectors) 923 - return q->limits.max_hw_sectors; 923 + return q->limits.max_sectors; 924 924 925 925 return q->limits.chunk_sectors - 926 926 (offset & (q->limits.chunk_sectors - 1));
-1
include/linux/elevator.h
··· 133 133 extern int elv_register_queue(struct request_queue *q); 134 134 extern void elv_unregister_queue(struct request_queue *q); 135 135 extern int elv_may_queue(struct request_queue *, int); 136 - extern void elv_abort_queue(struct request_queue *); 137 136 extern void elv_completed_request(struct request_queue *, struct request *); 138 137 extern int elv_set_request(struct request_queue *q, struct request *rq, 139 138 struct bio *bio, gfp_t gfp_mask);
+6
include/linux/fs.h
··· 1921 1921 1922 1922 static inline int break_deleg(struct inode *inode, unsigned int mode) 1923 1923 { 1924 + /* 1925 + * Since this check is lockless, we must ensure that any refcounts 1926 + * taken are done before checking inode->i_flock. Otherwise, we could 1927 + * end up racing with tasks trying to set a new lease on this file. 1928 + */ 1929 + smp_mb(); 1924 1930 if (inode->i_flock) 1925 1931 return __break_lease(inode, mode, FL_DELEG); 1926 1932 return 0;
+1
include/linux/profile.h
··· 44 44 int profile_init(void); 45 45 int profile_setup(char *str); 46 46 void profile_tick(int type); 47 + int setup_profiling_timer(unsigned int multiplier); 47 48 48 49 /* 49 50 * Add multiple profiler hits to a given address:
+5
include/linux/regulator/consumer.h
··· 395 395 { 396 396 } 397 397 398 + static inline int regulator_can_change_voltage(struct regulator *regulator) 399 + { 400 + return 0; 401 + } 402 + 398 403 static inline int regulator_set_voltage(struct regulator *regulator, 399 404 int min_uV, int max_uV) 400 405 {
+2
include/linux/suspend.h
··· 327 327 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); 328 328 extern int hibernate(void); 329 329 extern bool system_entering_hibernation(void); 330 + extern bool hibernation_available(void); 330 331 asmlinkage int swsusp_save(void); 331 332 extern struct pbe *restore_pblist; 332 333 #else /* CONFIG_HIBERNATION */ ··· 340 339 static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {} 341 340 static inline int hibernate(void) { return -ENOSYS; } 342 341 static inline bool system_entering_hibernation(void) { return false; } 342 + static inline bool hibernation_available(void) { return false; } 343 343 #endif /* CONFIG_HIBERNATION */ 344 344 345 345 /* Hibernation and suspend events */
+2
include/sound/core.h
··· 116 116 int user_ctl_count; /* count of all user controls */ 117 117 struct list_head controls; /* all controls for this card */ 118 118 struct list_head ctl_files; /* active control files */ 119 + struct mutex user_ctl_lock; /* protects user controls against 120 + concurrent access */ 119 121 120 122 struct snd_info_entry *proc_root; /* root for soundcard specific files */ 121 123 struct snd_info_entry *proc_id; /* the card id */
+1
include/uapi/linux/perf_event.h
··· 705 705 * u32 min; 706 706 * u64 ino; 707 707 * u64 ino_generation; 708 + * u32 prot, flags; 708 709 * char filename[]; 709 710 * struct sample_id sample_id; 710 711 * };
+3
kernel/context_tracking.c
··· 19 19 #include <linux/sched.h> 20 20 #include <linux/hardirq.h> 21 21 #include <linux/export.h> 22 + #include <linux/kprobes.h> 22 23 23 24 #define CREATE_TRACE_POINTS 24 25 #include <trace/events/context_tracking.h> ··· 105 104 } 106 105 local_irq_restore(flags); 107 106 } 107 + NOKPROBE_SYMBOL(context_tracking_user_enter); 108 108 109 109 #ifdef CONFIG_PREEMPT 110 110 /** ··· 183 181 } 184 182 local_irq_restore(flags); 185 183 } 184 + NOKPROBE_SYMBOL(context_tracking_user_exit); 186 185 187 186 /** 188 187 * __context_tracking_task_switch - context switch the syscall callbacks
+33 -4
kernel/events/core.c
··· 40 40 #include <linux/mm_types.h> 41 41 #include <linux/cgroup.h> 42 42 #include <linux/module.h> 43 + #include <linux/mman.h> 43 44 44 45 #include "internal.h" 45 46 ··· 5129 5128 int maj, min; 5130 5129 u64 ino; 5131 5130 u64 ino_generation; 5131 + u32 prot, flags; 5132 5132 5133 5133 struct { 5134 5134 struct perf_event_header header; ··· 5171 5169 mmap_event->event_id.header.size += sizeof(mmap_event->min); 5172 5170 mmap_event->event_id.header.size += sizeof(mmap_event->ino); 5173 5171 mmap_event->event_id.header.size += sizeof(mmap_event->ino_generation); 5172 + mmap_event->event_id.header.size += sizeof(mmap_event->prot); 5173 + mmap_event->event_id.header.size += sizeof(mmap_event->flags); 5174 5174 } 5175 5175 5176 5176 perf_event_header__init_id(&mmap_event->event_id.header, &sample, event); ··· 5191 5187 perf_output_put(&handle, mmap_event->min); 5192 5188 perf_output_put(&handle, mmap_event->ino); 5193 5189 perf_output_put(&handle, mmap_event->ino_generation); 5190 + perf_output_put(&handle, mmap_event->prot); 5191 + perf_output_put(&handle, mmap_event->flags); 5194 5192 } 5195 5193 5196 5194 __output_copy(&handle, mmap_event->file_name, ··· 5211 5205 struct file *file = vma->vm_file; 5212 5206 int maj = 0, min = 0; 5213 5207 u64 ino = 0, gen = 0; 5208 + u32 prot = 0, flags = 0; 5214 5209 unsigned int size; 5215 5210 char tmp[16]; 5216 5211 char *buf = NULL; ··· 5242 5235 gen = inode->i_generation; 5243 5236 maj = MAJOR(dev); 5244 5237 min = MINOR(dev); 5238 + 5239 + if (vma->vm_flags & VM_READ) 5240 + prot |= PROT_READ; 5241 + if (vma->vm_flags & VM_WRITE) 5242 + prot |= PROT_WRITE; 5243 + if (vma->vm_flags & VM_EXEC) 5244 + prot |= PROT_EXEC; 5245 + 5246 + if (vma->vm_flags & VM_MAYSHARE) 5247 + flags = MAP_SHARED; 5248 + else 5249 + flags = MAP_PRIVATE; 5250 + 5251 + if (vma->vm_flags & VM_DENYWRITE) 5252 + flags |= MAP_DENYWRITE; 5253 + if (vma->vm_flags & VM_MAYEXEC) 5254 + flags |= MAP_EXECUTABLE; 5255 + if (vma->vm_flags & VM_LOCKED) 5256 + flags |= MAP_LOCKED; 5257 + if (vma->vm_flags & VM_HUGETLB) 5258 + flags |= MAP_HUGETLB; 5259 + 5245 5260 goto got_name; 5246 5261 } else { 5247 5262 name = (char *)arch_vma_name(vma); ··· 5304 5275 mmap_event->min = min; 5305 5276 mmap_event->ino = ino; 5306 5277 mmap_event->ino_generation = gen; 5278 + mmap_event->prot = prot; 5279 + mmap_event->flags = flags; 5307 5280 5308 5281 if (!(vma->vm_flags & VM_EXEC)) 5309 5282 mmap_event->event_id.header.misc |= PERF_RECORD_MISC_MMAP_DATA; ··· 5346 5315 /* .min (attr_mmap2 only) */ 5347 5316 /* .ino (attr_mmap2 only) */ 5348 5317 /* .ino_generation (attr_mmap2 only) */ 5318 + /* .prot (attr_mmap2 only) */ 5319 + /* .flags (attr_mmap2 only) */ 5349 5320 }; 5350 5321 5351 5322 perf_event_mmap_event(&mmap_event); ··· 6929 6896 ret = copy_from_user(attr, uattr, size); 6930 6897 if (ret) 6931 6898 return -EFAULT; 6932 - 6933 - /* disabled for now */ 6934 - if (attr->mmap2) 6935 - return -EINVAL; 6936 6899 6937 6900 if (attr->__reserved_1) 6938 6901 return -EINVAL;
+5
kernel/locking/rtmutex-debug.h
··· 31 31 { 32 32 return (waiter != NULL); 33 33 } 34 + 35 + static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w) 36 + { 37 + debug_rt_mutex_print_deadlock(w); 38 + }
+208 -35
kernel/locking/rtmutex.c
··· 83 83 owner = *p; 84 84 } while (cmpxchg(p, owner, owner | RT_MUTEX_HAS_WAITERS) != owner); 85 85 } 86 + 87 + /* 88 + * Safe fastpath aware unlock: 89 + * 1) Clear the waiters bit 90 + * 2) Drop lock->wait_lock 91 + * 3) Try to unlock the lock with cmpxchg 92 + */ 93 + static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) 94 + __releases(lock->wait_lock) 95 + { 96 + struct task_struct *owner = rt_mutex_owner(lock); 97 + 98 + clear_rt_mutex_waiters(lock); 99 + raw_spin_unlock(&lock->wait_lock); 100 + /* 101 + * If a new waiter comes in between the unlock and the cmpxchg 102 + * we have two situations: 103 + * 104 + * unlock(wait_lock); 105 + * lock(wait_lock); 106 + * cmpxchg(p, owner, 0) == owner 107 + * mark_rt_mutex_waiters(lock); 108 + * acquire(lock); 109 + * or: 110 + * 111 + * unlock(wait_lock); 112 + * lock(wait_lock); 113 + * mark_rt_mutex_waiters(lock); 114 + * 115 + * cmpxchg(p, owner, 0) != owner 116 + * enqueue_waiter(); 117 + * unlock(wait_lock); 118 + * lock(wait_lock); 119 + * wake waiter(); 120 + * unlock(wait_lock); 121 + * lock(wait_lock); 122 + * acquire(lock); 123 + */ 124 + return rt_mutex_cmpxchg(lock, owner, NULL); 125 + } 126 + 86 127 #else 87 128 # define rt_mutex_cmpxchg(l,c,n) (0) 88 129 static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) 89 130 { 90 131 lock->owner = (struct task_struct *) 91 132 ((unsigned long)lock->owner | RT_MUTEX_HAS_WAITERS); 133 + } 134 + 135 + /* 136 + * Simple slow path only version: lock->owner is protected by lock->wait_lock. 137 + */ 138 + static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) 139 + __releases(lock->wait_lock) 140 + { 141 + lock->owner = NULL; 142 + raw_spin_unlock(&lock->wait_lock); 143 + return true; 92 144 } 93 145 #endif 94 146 ··· 312 260 */ 313 261 int max_lock_depth = 1024; 314 262 263 + static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) 264 + { 265 + return p->pi_blocked_on ? p->pi_blocked_on->lock : NULL; 266 + } 267 + 315 268 /* 316 269 * Adjust the priority chain. Also used for deadlock detection. 317 270 * Decreases task's usage by one - may thus free the task. 318 271 * 319 - * @task: the task owning the mutex (owner) for which a chain walk is probably 320 - * needed 272 + * @task: the task owning the mutex (owner) for which a chain walk is 273 + * probably needed 321 274 * @deadlock_detect: do we have to carry out deadlock detection? 322 - * @orig_lock: the mutex (can be NULL if we are walking the chain to recheck 323 - * things for a task that has just got its priority adjusted, and 324 - * is waiting on a mutex) 275 + * @orig_lock: the mutex (can be NULL if we are walking the chain to recheck 276 + * things for a task that has just got its priority adjusted, and 277 + * is waiting on a mutex) 278 + * @next_lock: the mutex on which the owner of @orig_lock was blocked before 279 + * we dropped its pi_lock. Is never dereferenced, only used for 280 + * comparison to detect lock chain changes. 325 281 * @orig_waiter: rt_mutex_waiter struct for the task that has just donated 326 - * its priority to the mutex owner (can be NULL in the case 327 - * depicted above or if the top waiter is gone away and we are 328 - * actually deboosting the owner) 329 - * @top_task: the current top waiter 282 + * its priority to the mutex owner (can be NULL in the case 283 + * depicted above or if the top waiter is gone away and we are 284 + * actually deboosting the owner) 285 + * @top_task: the current top waiter 330 286 * 331 287 * Returns 0 or -EDEADLK. 332 288 */ 333 289 static int rt_mutex_adjust_prio_chain(struct task_struct *task, 334 290 int deadlock_detect, 335 291 struct rt_mutex *orig_lock, 292 + struct rt_mutex *next_lock, 336 293 struct rt_mutex_waiter *orig_waiter, 337 294 struct task_struct *top_task) 338 295 { ··· 375 314 } 376 315 put_task_struct(task); 377 316 378 - return deadlock_detect ? -EDEADLK : 0; 317 + return -EDEADLK; 379 318 } 380 319 retry: 381 320 /* ··· 397 336 * the previous owner of the lock might have released the lock. 398 337 */ 399 338 if (orig_waiter && !rt_mutex_owner(orig_lock)) 339 + goto out_unlock_pi; 340 + 341 + /* 342 + * We dropped all locks after taking a refcount on @task, so 343 + * the task might have moved on in the lock chain or even left 344 + * the chain completely and blocks now on an unrelated lock or 345 + * on @orig_lock. 346 + * 347 + * We stored the lock on which @task was blocked in @next_lock, 348 + * so we can detect the chain change. 349 + */ 350 + if (next_lock != waiter->lock) 400 351 goto out_unlock_pi; 401 352 402 353 /* ··· 450 377 if (lock == orig_lock || rt_mutex_owner(lock) == top_task) { 451 378 debug_rt_mutex_deadlock(deadlock_detect, orig_waiter, lock); 452 379 raw_spin_unlock(&lock->wait_lock); 453 - ret = deadlock_detect ? -EDEADLK : 0; 380 + ret = -EDEADLK; 454 381 goto out_unlock_pi; 455 382 } 456 383 ··· 495 422 __rt_mutex_adjust_prio(task); 496 423 } 497 424 425 + /* 426 + * Check whether the task which owns the current lock is pi 427 + * blocked itself. If yes we store a pointer to the lock for 428 + * the lock chain change detection above. After we dropped 429 + * task->pi_lock next_lock cannot be dereferenced anymore. 430 + */ 431 + next_lock = task_blocked_on_lock(task); 432 + 498 433 raw_spin_unlock_irqrestore(&task->pi_lock, flags); 499 434 500 435 top_waiter = rt_mutex_top_waiter(lock); 501 436 raw_spin_unlock(&lock->wait_lock); 437 + 438 + /* 439 + * We reached the end of the lock chain. Stop right here. No 440 + * point to go back just to figure that out. 441 + */ 442 + if (!next_lock) 443 + goto out_put_task; 502 444 503 445 if (!detect_deadlock && waiter != top_waiter) 504 446 goto out_put_task; ··· 624 536 { 625 537 struct task_struct *owner = rt_mutex_owner(lock); 626 538 struct rt_mutex_waiter *top_waiter = waiter; 627 - unsigned long flags; 539 + struct rt_mutex *next_lock; 628 540 int chain_walk = 0, res; 541 + unsigned long flags; 629 542 630 543 /* 631 544 * Early deadlock detection. We really don't want the task to ··· 637 548 * which is wrong, as the other waiter is not in a deadlock 638 549 * situation. 639 550 */ 640 - if (detect_deadlock && owner == task) 551 + if (owner == task) 641 552 return -EDEADLK; 642 553 643 554 raw_spin_lock_irqsave(&task->pi_lock, flags); ··· 658 569 if (!owner) 659 570 return 0; 660 571 572 + raw_spin_lock_irqsave(&owner->pi_lock, flags); 661 573 if (waiter == rt_mutex_top_waiter(lock)) { 662 - raw_spin_lock_irqsave(&owner->pi_lock, flags); 663 574 rt_mutex_dequeue_pi(owner, top_waiter); 664 575 rt_mutex_enqueue_pi(owner, waiter); 665 576 666 577 __rt_mutex_adjust_prio(owner); 667 578 if (owner->pi_blocked_on) 668 579 chain_walk = 1; 669 - raw_spin_unlock_irqrestore(&owner->pi_lock, flags); 670 - } 671 - else if (debug_rt_mutex_detect_deadlock(waiter, detect_deadlock)) 580 + } else if (debug_rt_mutex_detect_deadlock(waiter, detect_deadlock)) { 672 581 chain_walk = 1; 582 + } 673 583 674 - if (!chain_walk) 584 + /* Store the lock on which owner is blocked or NULL */ 585 + next_lock = task_blocked_on_lock(owner); 586 + 587 + raw_spin_unlock_irqrestore(&owner->pi_lock, flags); 588 + /* 589 + * Even if full deadlock detection is on, if the owner is not 590 + * blocked itself, we can avoid finding this out in the chain 591 + * walk. 592 + */ 593 + if (!chain_walk || !next_lock) 675 594 return 0; 676 595 677 596 /* ··· 691 594 692 595 raw_spin_unlock(&lock->wait_lock); 693 596 694 - res = rt_mutex_adjust_prio_chain(owner, detect_deadlock, lock, waiter, 695 - task); 597 + res = rt_mutex_adjust_prio_chain(owner, detect_deadlock, lock, 598 + next_lock, waiter, task); 696 599 697 600 raw_spin_lock(&lock->wait_lock); 698 601 ··· 702 605 /* 703 606 * Wake up the next waiter on the lock. 704 607 * 705 - * Remove the top waiter from the current tasks waiter list and wake it up. 608 + * Remove the top waiter from the current tasks pi waiter list and 609 + * wake it up. 706 610 * 707 611 * Called with lock->wait_lock held. 708 612 */ ··· 724 626 */ 725 627 rt_mutex_dequeue_pi(current, waiter); 726 628 727 - rt_mutex_set_owner(lock, NULL); 629 + /* 630 + * As we are waking up the top waiter, and the waiter stays 631 + * queued on the lock until it gets the lock, this lock 632 + * obviously has waiters. Just set the bit here and this has 633 + * the added benefit of forcing all new tasks into the 634 + * slow path making sure no task of lower priority than 635 + * the top waiter can steal this lock. 636 + */ 637 + lock->owner = (void *) RT_MUTEX_HAS_WAITERS; 728 638 729 639 raw_spin_unlock_irqrestore(&current->pi_lock, flags); 730 640 641 + /* 642 + * It's safe to dereference waiter as it cannot go away as 643 + * long as we hold lock->wait_lock. The waiter task needs to 644 + * acquire it in order to dequeue the waiter. 645 + */ 731 646 wake_up_process(waiter->task); 732 647 } 733 648 ··· 755 644 { 756 645 int first = (waiter == rt_mutex_top_waiter(lock)); 757 646 struct task_struct *owner = rt_mutex_owner(lock); 647 + struct rt_mutex *next_lock = NULL; 758 648 unsigned long flags; 759 - int chain_walk = 0; 760 649 761 650 raw_spin_lock_irqsave(&current->pi_lock, flags); 762 651 rt_mutex_dequeue(lock, waiter); ··· 780 669 } 781 670 __rt_mutex_adjust_prio(owner); 782 671 783 - if (owner->pi_blocked_on) 784 - chain_walk = 1; 672 + /* Store the lock on which owner is blocked or NULL */ 673 + next_lock = task_blocked_on_lock(owner); 785 674 786 675 raw_spin_unlock_irqrestore(&owner->pi_lock, flags); 787 676 } 788 677 789 - if (!chain_walk) 678 + if (!next_lock) 790 679 return; 791 680 792 681 /* gets dropped in rt_mutex_adjust_prio_chain()! */ ··· 794 683 795 684 raw_spin_unlock(&lock->wait_lock); 796 685 797 - rt_mutex_adjust_prio_chain(owner, 0, lock, NULL, current); 686 + rt_mutex_adjust_prio_chain(owner, 0, lock, next_lock, NULL, current); 798 687 799 688 raw_spin_lock(&lock->wait_lock); 800 689 } ··· 807 696 void rt_mutex_adjust_pi(struct task_struct *task) 808 697 { 809 698 struct rt_mutex_waiter *waiter; 699 + struct rt_mutex *next_lock; 810 700 unsigned long flags; 811 701 812 702 raw_spin_lock_irqsave(&task->pi_lock, flags); ··· 818 706 raw_spin_unlock_irqrestore(&task->pi_lock, flags); 819 707 return; 820 708 } 821 - 709 + next_lock = waiter->lock; 822 710 raw_spin_unlock_irqrestore(&task->pi_lock, flags); 823 711 824 712 /* gets dropped in rt_mutex_adjust_prio_chain()! */ 825 713 get_task_struct(task); 826 - rt_mutex_adjust_prio_chain(task, 0, NULL, NULL, task); 714 + 715 + rt_mutex_adjust_prio_chain(task, 0, NULL, next_lock, NULL, task); 827 716 } 828 717 829 718 /** ··· 876 763 return ret; 877 764 } 878 765 766 + static void rt_mutex_handle_deadlock(int res, int detect_deadlock, 767 + struct rt_mutex_waiter *w) 768 + { 769 + /* 770 + * If the result is not -EDEADLOCK or the caller requested 771 + * deadlock detection, nothing to do here. 772 + */ 773 + if (res != -EDEADLOCK || detect_deadlock) 774 + return; 775 + 776 + /* 777 + * Yell lowdly and stop the task right here. 778 + */ 779 + rt_mutex_print_deadlock(w); 780 + while (1) { 781 + set_current_state(TASK_INTERRUPTIBLE); 782 + schedule(); 783 + } 784 + } 785 + 879 786 /* 880 787 * Slow path lock function: 881 788 */ ··· 935 802 936 803 set_current_state(TASK_RUNNING); 937 804 938 - if (unlikely(ret)) 805 + if (unlikely(ret)) { 939 806 remove_waiter(lock, &waiter); 807 + rt_mutex_handle_deadlock(ret, detect_deadlock, &waiter); 808 + } 940 809 941 810 /* 942 811 * try_to_take_rt_mutex() sets the waiter bit ··· 994 859 995 860 rt_mutex_deadlock_account_unlock(current); 996 861 997 - if (!rt_mutex_has_waiters(lock)) { 998 - lock->owner = NULL; 999 - raw_spin_unlock(&lock->wait_lock); 1000 - return; 862 + /* 863 + * We must be careful here if the fast path is enabled. If we 864 + * have no waiters queued we cannot set owner to NULL here 865 + * because of: 866 + * 867 + * foo->lock->owner = NULL; 868 + * rtmutex_lock(foo->lock); <- fast path 869 + * free = atomic_dec_and_test(foo->refcnt); 870 + * rtmutex_unlock(foo->lock); <- fast path 871 + * if (free) 872 + * kfree(foo); 873 + * raw_spin_unlock(foo->lock->wait_lock); 874 + * 875 + * So for the fastpath enabled kernel: 876 + * 877 + * Nothing can set the waiters bit as long as we hold 878 + * lock->wait_lock. So we do the following sequence: 879 + * 880 + * owner = rt_mutex_owner(lock); 881 + * clear_rt_mutex_waiters(lock); 882 + * raw_spin_unlock(&lock->wait_lock); 883 + * if (cmpxchg(&lock->owner, owner, 0) == owner) 884 + * return; 885 + * goto retry; 886 + * 887 + * The fastpath disabled variant is simple as all access to 888 + * lock->owner is serialized by lock->wait_lock: 889 + * 890 + * lock->owner = NULL; 891 + * raw_spin_unlock(&lock->wait_lock); 892 + */ 893 + while (!rt_mutex_has_waiters(lock)) { 894 + /* Drops lock->wait_lock ! */ 895 + if (unlock_rt_mutex_safe(lock) == true) 896 + return; 897 + /* Relock the rtmutex and try again */ 898 + raw_spin_lock(&lock->wait_lock); 1001 899 } 1002 900 901 + /* 902 + * The wakeup next waiter path does not suffer from the above 903 + * race. See the comments there. 904 + */ 1003 905 wakeup_next_waiter(lock); 1004 906 1005 907 raw_spin_unlock(&lock->wait_lock); ··· 1284 1112 return 1; 1285 1113 } 1286 1114 1287 - ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock); 1115 + /* We enforce deadlock detection for futexes */ 1116 + ret = task_blocks_on_rt_mutex(lock, waiter, task, 1); 1288 1117 1289 1118 if (ret && !rt_mutex_owner(lock)) { 1290 1119 /*
+5
kernel/locking/rtmutex.h
··· 24 24 #define debug_rt_mutex_print_deadlock(w) do { } while (0) 25 25 #define debug_rt_mutex_detect_deadlock(w,d) (d) 26 26 #define debug_rt_mutex_reset_waiter(w) do { } while (0) 27 + 28 + static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w) 29 + { 30 + WARN(1, "rtmutex deadlock detected\n"); 31 + }
+36 -1
kernel/power/hibernate.c
··· 35 35 36 36 static int nocompress; 37 37 static int noresume; 38 + static int nohibernate; 38 39 static int resume_wait; 39 40 static unsigned int resume_delay; 40 41 static char resume_file[256] = CONFIG_PM_STD_PARTITION; ··· 62 61 bool freezer_test_done; 63 62 64 63 static const struct platform_hibernation_ops *hibernation_ops; 64 + 65 + bool hibernation_available(void) 66 + { 67 + return (nohibernate == 0); 68 + } 65 69 66 70 /** 67 71 * hibernation_set_ops - Set the global hibernate operations. ··· 648 642 { 649 643 int error; 650 644 645 + if (!hibernation_available()) { 646 + pr_debug("PM: Hibernation not available.\n"); 647 + return -EPERM; 648 + } 649 + 651 650 lock_system_sleep(); 652 651 /* The snapshot device should not be opened while we're running */ 653 652 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { ··· 745 734 /* 746 735 * If the user said "noresume".. bail out early. 747 736 */ 748 - if (noresume) 737 + if (noresume || !hibernation_available()) 749 738 return 0; 750 739 751 740 /* ··· 911 900 int i; 912 901 char *start = buf; 913 902 903 + if (!hibernation_available()) 904 + return sprintf(buf, "[disabled]\n"); 905 + 914 906 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { 915 907 if (!hibernation_modes[i]) 916 908 continue; ··· 947 933 int len; 948 934 char *p; 949 935 int mode = HIBERNATION_INVALID; 936 + 937 + if (!hibernation_available()) 938 + return -EPERM; 950 939 951 940 p = memchr(buf, '\n', n); 952 941 len = p ? p - buf : n; ··· 1118 1101 noresume = 1; 1119 1102 else if (!strncmp(str, "nocompress", 10)) 1120 1103 nocompress = 1; 1104 + else if (!strncmp(str, "no", 2)) { 1105 + noresume = 1; 1106 + nohibernate = 1; 1107 + } 1121 1108 return 1; 1122 1109 } 1123 1110 ··· 1146 1125 return 1; 1147 1126 } 1148 1127 1128 + static int __init nohibernate_setup(char *str) 1129 + { 1130 + noresume = 1; 1131 + nohibernate = 1; 1132 + return 1; 1133 + } 1134 + 1135 + static int __init kaslr_nohibernate_setup(char *str) 1136 + { 1137 + return nohibernate_setup(str); 1138 + } 1139 + 1149 1140 __setup("noresume", noresume_setup); 1150 1141 __setup("resume_offset=", resume_offset_setup); 1151 1142 __setup("resume=", resume_setup); 1152 1143 __setup("hibernate=", hibernate_setup); 1153 1144 __setup("resumewait", resumewait_setup); 1154 1145 __setup("resumedelay=", resumedelay_setup); 1146 + __setup("nohibernate", nohibernate_setup); 1147 + __setup("kaslr", kaslr_nohibernate_setup);
+2 -4
kernel/power/main.c
··· 300 300 s += sprintf(s,"%s ", pm_states[i].label); 301 301 302 302 #endif 303 - #ifdef CONFIG_HIBERNATION 304 - s += sprintf(s, "%s\n", "disk"); 305 - #else 303 + if (hibernation_available()) 304 + s += sprintf(s, "disk "); 306 305 if (s != buf) 307 306 /* convert the last space to a newline */ 308 307 *(s-1) = '\n'; 309 - #endif 310 308 return (s - buf); 311 309 } 312 310
+3
kernel/power/user.c
··· 49 49 struct snapshot_data *data; 50 50 int error; 51 51 52 + if (!hibernation_available()) 53 + return -EPERM; 54 + 52 55 lock_system_sleep(); 53 56 54 57 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
-4
kernel/sysctl.c
··· 152 152 #ifdef CONFIG_SPARC 153 153 #endif 154 154 155 - #ifdef CONFIG_SPARC64 156 - extern int sysctl_tsb_ratio; 157 - #endif 158 - 159 155 #ifdef __hppa__ 160 156 extern int pwrsw_enabled; 161 157 #endif
+8 -6
scripts/package/builddeb
··· 289 289 290 290 fi 291 291 292 - # Build header package 293 - (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") 294 - (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") 295 - (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") 292 + # Build kernel header package 293 + (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles" 294 + (cd $srctree; find arch/$SRCARCH/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles" 295 + (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles" 296 + (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles" 297 + (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" 296 298 destdir=$kernel_headers_dir/usr/src/linux-headers-$version 297 299 mkdir -p "$destdir" 298 - (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) 299 - (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) 300 + (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -) 301 + (cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -) 300 302 (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be 301 303 ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" 302 304 rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
+1 -2
scripts/package/buildtar
··· 125 125 # Create the tarball 126 126 # 127 127 ( 128 - cd "${tmpdir}" 129 128 opts= 130 129 if tar --owner=root --group=root --help >/dev/null 2>&1; then 131 130 opts="--owner=root --group=root" 132 131 fi 133 - tar cf - boot/* lib/* $opts | ${compress} > "${tarball}${file_ext}" 132 + tar cf - -C "$tmpdir" boot/ lib/ $opts | ${compress} > "${tarball}${file_ext}" 134 133 ) 135 134 136 135 echo "Tarball successfully created in ${tarball}${file_ext}"
+51 -27
sound/core/control.c
··· 288 288 { 289 289 struct snd_kcontrol *kctl; 290 290 291 + /* Make sure that the ids assigned to the control do not wrap around */ 292 + if (card->last_numid >= UINT_MAX - count) 293 + card->last_numid = 0; 294 + 291 295 list_for_each_entry(kctl, &card->controls, list) { 292 296 if (kctl->id.numid < card->last_numid + 1 + count && 293 297 kctl->id.numid + kctl->count > card->last_numid + 1) { ··· 334 330 { 335 331 struct snd_ctl_elem_id id; 336 332 unsigned int idx; 333 + unsigned int count; 337 334 int err = -EINVAL; 338 335 339 336 if (! kcontrol) ··· 342 337 if (snd_BUG_ON(!card || !kcontrol->info)) 343 338 goto error; 344 339 id = kcontrol->id; 340 + if (id.index > UINT_MAX - kcontrol->count) 341 + goto error; 342 + 345 343 down_write(&card->controls_rwsem); 346 344 if (snd_ctl_find_id(card, &id)) { 347 345 up_write(&card->controls_rwsem); ··· 366 358 card->controls_count += kcontrol->count; 367 359 kcontrol->id.numid = card->last_numid + 1; 368 360 card->last_numid += kcontrol->count; 361 + count = kcontrol->count; 369 362 up_write(&card->controls_rwsem); 370 - for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++) 363 + for (idx = 0; idx < count; idx++, id.index++, id.numid++) 371 364 snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); 372 365 return 0; 373 366 ··· 397 388 bool add_on_replace) 398 389 { 399 390 struct snd_ctl_elem_id id; 391 + unsigned int count; 400 392 unsigned int idx; 401 393 struct snd_kcontrol *old; 402 394 int ret; ··· 433 423 card->controls_count += kcontrol->count; 434 424 kcontrol->id.numid = card->last_numid + 1; 435 425 card->last_numid += kcontrol->count; 426 + count = kcontrol->count; 436 427 up_write(&card->controls_rwsem); 437 - for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++) 428 + for (idx = 0; idx < count; idx++, id.index++, id.numid++) 438 429 snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); 439 430 return 0; 440 431 ··· 908 897 result = kctl->put(kctl, control); 909 898 } 910 899 if (result > 0) { 900 + struct snd_ctl_elem_id id = control->id; 911 901 up_read(&card->controls_rwsem); 912 - snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, 913 - &control->id); 902 + snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &id); 914 903 return 0; 915 904 } 916 905 } ··· 1002 991 1003 992 struct user_element { 1004 993 struct snd_ctl_elem_info info; 994 + struct snd_card *card; 1005 995 void *elem_data; /* element data */ 1006 996 unsigned long elem_data_size; /* size of element data in bytes */ 1007 997 void *tlv_data; /* TLV data */ ··· 1046 1034 { 1047 1035 struct user_element *ue = kcontrol->private_data; 1048 1036 1037 + mutex_lock(&ue->card->user_ctl_lock); 1049 1038 memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_size); 1039 + mutex_unlock(&ue->card->user_ctl_lock); 1050 1040 return 0; 1051 1041 } 1052 1042 ··· 1057 1043 { 1058 1044 int change; 1059 1045 struct user_element *ue = kcontrol->private_data; 1060 - 1046 + 1047 + mutex_lock(&ue->card->user_ctl_lock); 1061 1048 change = memcmp(&ucontrol->value, ue->elem_data, ue->elem_data_size) != 0; 1062 1049 if (change) 1063 1050 memcpy(ue->elem_data, &ucontrol->value, ue->elem_data_size); 1051 + mutex_unlock(&ue->card->user_ctl_lock); 1064 1052 return change; 1065 1053 } 1066 1054 ··· 1082 1066 new_data = memdup_user(tlv, size); 1083 1067 if (IS_ERR(new_data)) 1084 1068 return PTR_ERR(new_data); 1069 + mutex_lock(&ue->card->user_ctl_lock); 1085 1070 change = ue->tlv_data_size != size; 1086 1071 if (!change) 1087 1072 change = memcmp(ue->tlv_data, new_data, size); 1088 1073 kfree(ue->tlv_data); 1089 1074 ue->tlv_data = new_data; 1090 1075 ue->tlv_data_size = size; 1076 + mutex_unlock(&ue->card->user_ctl_lock); 1091 1077 } else { 1092 - if (! ue->tlv_data_size || ! ue->tlv_data) 1093 - return -ENXIO; 1094 - if (size < ue->tlv_data_size) 1095 - return -ENOSPC; 1078 + int ret = 0; 1079 + 1080 + mutex_lock(&ue->card->user_ctl_lock); 1081 + if (!ue->tlv_data_size || !ue->tlv_data) { 1082 + ret = -ENXIO; 1083 + goto err_unlock; 1084 + } 1085 + if (size < ue->tlv_data_size) { 1086 + ret = -ENOSPC; 1087 + goto err_unlock; 1088 + } 1096 1089 if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size)) 1097 - return -EFAULT; 1090 + ret = -EFAULT; 1091 + err_unlock: 1092 + mutex_unlock(&ue->card->user_ctl_lock); 1093 + if (ret) 1094 + return ret; 1098 1095 } 1099 1096 return change; 1100 1097 } ··· 1165 1136 struct user_element *ue; 1166 1137 int idx, err; 1167 1138 1168 - if (!replace && card->user_ctl_count >= MAX_USER_CONTROLS) 1169 - return -ENOMEM; 1170 1139 if (info->count < 1) 1171 1140 return -EINVAL; 1172 1141 access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : ··· 1173 1146 SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)); 1174 1147 info->id.numid = 0; 1175 1148 memset(&kctl, 0, sizeof(kctl)); 1176 - down_write(&card->controls_rwsem); 1177 - _kctl = snd_ctl_find_id(card, &info->id); 1178 - err = 0; 1179 - if (_kctl) { 1180 - if (replace) 1181 - err = snd_ctl_remove(card, _kctl); 1182 - else 1183 - err = -EBUSY; 1184 - } else { 1185 - if (replace) 1186 - err = -ENOENT; 1149 + 1150 + if (replace) { 1151 + err = snd_ctl_remove_user_ctl(file, &info->id); 1152 + if (err) 1153 + return err; 1187 1154 } 1188 - up_write(&card->controls_rwsem); 1189 - if (err < 0) 1190 - return err; 1155 + 1156 + if (card->user_ctl_count >= MAX_USER_CONTROLS) 1157 + return -ENOMEM; 1158 + 1191 1159 memcpy(&kctl.id, &info->id, sizeof(info->id)); 1192 1160 kctl.count = info->owner ? info->owner : 1; 1193 1161 access |= SNDRV_CTL_ELEM_ACCESS_USER; ··· 1232 1210 ue = kzalloc(sizeof(struct user_element) + private_size, GFP_KERNEL); 1233 1211 if (ue == NULL) 1234 1212 return -ENOMEM; 1213 + ue->card = card; 1235 1214 ue->info = *info; 1236 1215 ue->info.access = 0; 1237 1216 ue->elem_data = (char *)ue + sizeof(*ue); ··· 1344 1321 } 1345 1322 err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); 1346 1323 if (err > 0) { 1324 + struct snd_ctl_elem_id id = kctl->id; 1347 1325 up_read(&card->controls_rwsem); 1348 - snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &kctl->id); 1326 + snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &id); 1349 1327 return 0; 1350 1328 } 1351 1329 } else {
+1
sound/core/init.c
··· 232 232 INIT_LIST_HEAD(&card->devices); 233 233 init_rwsem(&card->controls_rwsem); 234 234 rwlock_init(&card->ctl_files_rwlock); 235 + mutex_init(&card->user_ctl_lock); 235 236 INIT_LIST_HEAD(&card->controls); 236 237 INIT_LIST_HEAD(&card->ctl_files); 237 238 spin_lock_init(&card->files_lock);
+6 -6
sound/pci/hda/hda_i915.c
··· 22 22 #include <drm/i915_powerwell.h> 23 23 #include "hda_i915.h" 24 24 25 - static void (*get_power)(void); 26 - static void (*put_power)(void); 25 + static int (*get_power)(void); 26 + static int (*put_power)(void); 27 27 28 - void hda_display_power(bool enable) 28 + int hda_display_power(bool enable) 29 29 { 30 30 if (!get_power || !put_power) 31 - return; 31 + return -ENODEV; 32 32 33 33 pr_debug("HDA display power %s \n", 34 34 enable ? "Enable" : "Disable"); 35 35 if (enable) 36 - get_power(); 36 + return get_power(); 37 37 else 38 - put_power(); 38 + return put_power(); 39 39 } 40 40 41 41 int hda_i915_init(void)
+2 -2
sound/pci/hda/hda_i915.h
··· 17 17 #define __SOUND_HDA_I915_H 18 18 19 19 #ifdef CONFIG_SND_HDA_I915 20 - void hda_display_power(bool enable); 20 + int hda_display_power(bool enable); 21 21 int hda_i915_init(void); 22 22 int hda_i915_exit(void); 23 23 #else 24 - static inline void hda_display_power(bool enable) {} 24 + static inline int hda_display_power(bool enable) { return 0; } 25 25 static inline int hda_i915_init(void) 26 26 { 27 27 return -ENODEV;
+6 -1
sound/pci/hda/hda_intel.c
··· 1656 1656 "Error request power-well from i915\n"); 1657 1657 goto out_free; 1658 1658 } 1659 + err = hda_display_power(true); 1660 + if (err < 0) { 1661 + dev_err(chip->card->dev, 1662 + "Cannot turn on display power on i915\n"); 1663 + goto out_free; 1664 + } 1659 1665 #endif 1660 - hda_display_power(true); 1661 1666 } 1662 1667 1663 1668 err = azx_first_init(chip);
+10 -2
sound/soc/codecs/Kconfig
··· 225 225 config SND_SOC_ADAU1701 226 226 tristate "Analog Devices ADAU1701 CODEC" 227 227 depends on I2C 228 - select SND_SOC_SIGMADSP 228 + select SND_SOC_SIGMADSP_I2C 229 229 230 230 config SND_SOC_ADAU17X1 231 231 tristate 232 - select SND_SOC_SIGMADSP 232 + select SND_SOC_SIGMADSP_REGMAP 233 233 234 234 config SND_SOC_ADAU1761 235 235 tristate ··· 475 475 config SND_SOC_SIGMADSP 476 476 tristate 477 477 select CRC32 478 + 479 + config SND_SOC_SIGMADSP_I2C 480 + tristate 481 + select SND_SOC_SIGMADSP 482 + 483 + config SND_SOC_SIGMADSP_REGMAP 484 + tristate 485 + select SND_SOC_SIGMADSP 478 486 479 487 config SND_SOC_SIRF_AUDIO_CODEC 480 488 tristate "SiRF SoC internal audio codec"
+4
sound/soc/codecs/Makefile
··· 77 77 snd-soc-alc5623-objs := alc5623.o 78 78 snd-soc-alc5632-objs := alc5632.o 79 79 snd-soc-sigmadsp-objs := sigmadsp.o 80 + snd-soc-sigmadsp-i2c-objs := sigmadsp-i2c.o 81 + snd-soc-sigmadsp-regmap-objs := sigmadsp-regmap.o 80 82 snd-soc-si476x-objs := si476x.o 81 83 snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o 82 84 snd-soc-sn95031-objs := sn95031.o ··· 242 240 obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o 243 241 obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o 244 242 obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o 243 + obj-$(CONFIG_SND_SOC_SIGMADSP_I2C) += snd-soc-sigmadsp-i2c.o 244 + obj-$(CONFIG_SND_SOC_SIGMADSP_REGMAP) += snd-soc-sigmadsp-regmap.o 245 245 obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o 246 246 obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o 247 247 obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o
+35
sound/soc/codecs/sigmadsp-i2c.c
··· 1 + /* 2 + * Load Analog Devices SigmaStudio firmware files 3 + * 4 + * Copyright 2009-2011 Analog Devices Inc. 5 + * 6 + * Licensed under the GPL-2 or later. 7 + */ 8 + 9 + #include <linux/i2c.h> 10 + #include <linux/export.h> 11 + #include <linux/module.h> 12 + 13 + #include "sigmadsp.h" 14 + 15 + static int sigma_action_write_i2c(void *control_data, 16 + const struct sigma_action *sa, size_t len) 17 + { 18 + return i2c_master_send(control_data, (const unsigned char *)&sa->addr, 19 + len); 20 + } 21 + 22 + int process_sigma_firmware(struct i2c_client *client, const char *name) 23 + { 24 + struct sigma_firmware ssfw; 25 + 26 + ssfw.control_data = client; 27 + ssfw.write = sigma_action_write_i2c; 28 + 29 + return _process_sigma_firmware(&client->dev, &ssfw, name); 30 + } 31 + EXPORT_SYMBOL(process_sigma_firmware); 32 + 33 + MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 34 + MODULE_DESCRIPTION("SigmaDSP I2C firmware loader"); 35 + MODULE_LICENSE("GPL");
+36
sound/soc/codecs/sigmadsp-regmap.c
··· 1 + /* 2 + * Load Analog Devices SigmaStudio firmware files 3 + * 4 + * Copyright 2009-2011 Analog Devices Inc. 5 + * 6 + * Licensed under the GPL-2 or later. 7 + */ 8 + 9 + #include <linux/regmap.h> 10 + #include <linux/export.h> 11 + #include <linux/module.h> 12 + 13 + #include "sigmadsp.h" 14 + 15 + static int sigma_action_write_regmap(void *control_data, 16 + const struct sigma_action *sa, size_t len) 17 + { 18 + return regmap_raw_write(control_data, be16_to_cpu(sa->addr), 19 + sa->payload, len - 2); 20 + } 21 + 22 + int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, 23 + const char *name) 24 + { 25 + struct sigma_firmware ssfw; 26 + 27 + ssfw.control_data = regmap; 28 + ssfw.write = sigma_action_write_regmap; 29 + 30 + return _process_sigma_firmware(dev, &ssfw, name); 31 + } 32 + EXPORT_SYMBOL(process_sigma_firmware_regmap); 33 + 34 + MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 35 + MODULE_DESCRIPTION("SigmaDSP regmap firmware loader"); 36 + MODULE_LICENSE("GPL");
+2 -63
sound/soc/codecs/sigmadsp.c
··· 34 34 SIGMA_ACTION_END, 35 35 }; 36 36 37 - struct sigma_action { 38 - u8 instr; 39 - u8 len_hi; 40 - __le16 len; 41 - __be16 addr; 42 - unsigned char payload[]; 43 - } __packed; 44 - 45 - struct sigma_firmware { 46 - const struct firmware *fw; 47 - size_t pos; 48 - 49 - void *control_data; 50 - int (*write)(void *control_data, const struct sigma_action *sa, 51 - size_t len); 52 - }; 53 - 54 37 static inline u32 sigma_action_len(struct sigma_action *sa) 55 38 { 56 39 return (sa->len_hi << 16) | le16_to_cpu(sa->len); ··· 121 138 return 0; 122 139 } 123 140 124 - static int _process_sigma_firmware(struct device *dev, 141 + int _process_sigma_firmware(struct device *dev, 125 142 struct sigma_firmware *ssfw, const char *name) 126 143 { 127 144 int ret; ··· 180 197 181 198 return ret; 182 199 } 183 - 184 - #if IS_ENABLED(CONFIG_I2C) 185 - 186 - static int sigma_action_write_i2c(void *control_data, 187 - const struct sigma_action *sa, size_t len) 188 - { 189 - return i2c_master_send(control_data, (const unsigned char *)&sa->addr, 190 - len); 191 - } 192 - 193 - int process_sigma_firmware(struct i2c_client *client, const char *name) 194 - { 195 - struct sigma_firmware ssfw; 196 - 197 - ssfw.control_data = client; 198 - ssfw.write = sigma_action_write_i2c; 199 - 200 - return _process_sigma_firmware(&client->dev, &ssfw, name); 201 - } 202 - EXPORT_SYMBOL(process_sigma_firmware); 203 - 204 - #endif 205 - 206 - #if IS_ENABLED(CONFIG_REGMAP) 207 - 208 - static int sigma_action_write_regmap(void *control_data, 209 - const struct sigma_action *sa, size_t len) 210 - { 211 - return regmap_raw_write(control_data, be16_to_cpu(sa->addr), 212 - sa->payload, len - 2); 213 - } 214 - 215 - int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, 216 - const char *name) 217 - { 218 - struct sigma_firmware ssfw; 219 - 220 - ssfw.control_data = regmap; 221 - ssfw.write = sigma_action_write_regmap; 222 - 223 - return _process_sigma_firmware(dev, &ssfw, name); 224 - } 225 - EXPORT_SYMBOL(process_sigma_firmware_regmap); 226 - 227 - #endif 200 + EXPORT_SYMBOL_GPL(_process_sigma_firmware); 228 201 229 202 MODULE_LICENSE("GPL");
+20
sound/soc/codecs/sigmadsp.h
··· 12 12 #include <linux/device.h> 13 13 #include <linux/regmap.h> 14 14 15 + struct sigma_action { 16 + u8 instr; 17 + u8 len_hi; 18 + __le16 len; 19 + __be16 addr; 20 + unsigned char payload[]; 21 + } __packed; 22 + 23 + struct sigma_firmware { 24 + const struct firmware *fw; 25 + size_t pos; 26 + 27 + void *control_data; 28 + int (*write)(void *control_data, const struct sigma_action *sa, 29 + size_t len); 30 + }; 31 + 32 + int _process_sigma_firmware(struct device *dev, 33 + struct sigma_firmware *ssfw, const char *name); 34 + 15 35 struct i2c_client; 16 36 17 37 extern int process_sigma_firmware(struct i2c_client *client, const char *name);
+2 -2
sound/soc/fsl/fsl_dma.c
··· 923 923 dma->dai.pcm_free = fsl_dma_free_dma_buffers; 924 924 925 925 /* Store the SSI-specific information that we need */ 926 - dma->ssi_stx_phys = res.start + offsetof(struct ccsr_ssi, stx0); 927 - dma->ssi_srx_phys = res.start + offsetof(struct ccsr_ssi, srx0); 926 + dma->ssi_stx_phys = res.start + CCSR_SSI_STX0; 927 + dma->ssi_srx_phys = res.start + CCSR_SSI_SRX0; 928 928 929 929 iprop = of_get_property(ssi_np, "fsl,fifo-depth", NULL); 930 930 if (iprop)
+3 -3
sound/soc/fsl/fsl_spdif.c
··· 762 762 struct regmap *regmap = spdif_priv->regmap; 763 763 u32 val; 764 764 765 - val = regmap_read(regmap, REG_SPDIF_SIS, &val); 765 + regmap_read(regmap, REG_SPDIF_SIS, &val); 766 766 ucontrol->value.integer.value[0] = (val & INT_VAL_NOGOOD) != 0; 767 767 regmap_write(regmap, REG_SPDIF_SIC, INT_VAL_NOGOOD); 768 768 ··· 1076 1076 goto out; 1077 1077 } else if (arate / rate[index] == 1) { 1078 1078 /* A little bigger than expect */ 1079 - sub = (arate - rate[index]) * 100000; 1079 + sub = (u64)(arate - rate[index]) * 100000; 1080 1080 do_div(sub, rate[index]); 1081 1081 if (sub >= savesub) 1082 1082 continue; ··· 1086 1086 spdif_priv->txrate[index] = arate; 1087 1087 } else if (rate[index] / arate == 1) { 1088 1088 /* A little smaller than expect */ 1089 - sub = (rate[index] - arate) * 100000; 1089 + sub = (u64)(rate[index] - arate) * 100000; 1090 1090 do_div(sub, rate[index]); 1091 1091 if (sub >= savesub) 1092 1092 continue;
+6 -5
sound/soc/pxa/Kconfig
··· 11 11 config SND_MMP_SOC 12 12 bool "Soc Audio for Marvell MMP chips" 13 13 depends on ARCH_MMP 14 + select MMP_SRAM 14 15 select SND_SOC_GENERIC_DMAENGINE_PCM 15 16 select SND_ARM 16 17 help ··· 41 40 42 41 config SND_PXA2XX_SOC_CORGI 43 42 tristate "SoC Audio support for Sharp Zaurus SL-C7x0" 44 - depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx 43 + depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx && I2C 45 44 select SND_PXA2XX_SOC_I2S 46 45 select SND_SOC_WM8731 47 46 help ··· 50 49 51 50 config SND_PXA2XX_SOC_SPITZ 52 51 tristate "SoC Audio support for Sharp Zaurus SL-Cxx00" 53 - depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 52 + depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 && I2C 54 53 select SND_PXA2XX_SOC_I2S 55 54 select SND_SOC_WM8750 56 55 help ··· 59 58 60 59 config SND_PXA2XX_SOC_Z2 61 60 tristate "SoC Audio support for Zipit Z2" 62 - depends on SND_PXA2XX_SOC && MACH_ZIPIT2 61 + depends on SND_PXA2XX_SOC && MACH_ZIPIT2 && I2C 63 62 select SND_PXA2XX_SOC_I2S 64 63 select SND_SOC_WM8750 65 64 help ··· 67 66 68 67 config SND_PXA2XX_SOC_POODLE 69 68 tristate "SoC Audio support for Poodle" 70 - depends on SND_PXA2XX_SOC && MACH_POODLE 69 + depends on SND_PXA2XX_SOC && MACH_POODLE && I2C 71 70 select SND_PXA2XX_SOC_I2S 72 71 select SND_SOC_WM8731 73 72 help ··· 182 181 183 182 config SND_PXA2XX_SOC_MAGICIAN 184 183 tristate "SoC Audio support for HTC Magician" 185 - depends on SND_PXA2XX_SOC && MACH_MAGICIAN 184 + depends on SND_PXA2XX_SOC && MACH_MAGICIAN && I2C 186 185 select SND_PXA2XX_SOC_I2S 187 186 select SND_PXA_SOC_SSP 188 187 select SND_SOC_UDA1380
+1 -1
sound/soc/sh/rcar/core.c
··· 315 315 dst_mod = mod[index]; 316 316 } else { 317 317 src_mod = mod[index]; 318 - dst_mod = mod[index + 1]; 318 + dst_mod = mod[index - 1]; 319 319 } 320 320 321 321 index = 0;
+15 -12
sound/soc/soc-dapm.c
··· 2755 2755 unsigned int mask = (1 << fls(max)) - 1; 2756 2756 unsigned int invert = mc->invert; 2757 2757 unsigned int val; 2758 - int connect, change; 2758 + int connect, change, reg_change = 0; 2759 2759 struct snd_soc_dapm_update update; 2760 2760 int ret = 0; 2761 2761 ··· 2773 2773 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 2774 2774 2775 2775 change = dapm_kcontrol_set_value(kcontrol, val); 2776 - if (change) { 2777 - if (reg != SND_SOC_NOPM) { 2778 - mask = mask << shift; 2779 - val = val << shift; 2780 2776 2781 - if (snd_soc_test_bits(codec, reg, mask, val)) { 2782 - update.kcontrol = kcontrol; 2783 - update.reg = reg; 2784 - update.mask = mask; 2785 - update.val = val; 2786 - card->update = &update; 2787 - } 2777 + if (reg != SND_SOC_NOPM) { 2778 + mask = mask << shift; 2779 + val = val << shift; 2788 2780 2781 + reg_change = snd_soc_test_bits(codec, reg, mask, val); 2782 + } 2783 + 2784 + if (change || reg_change) { 2785 + if (reg_change) { 2786 + update.kcontrol = kcontrol; 2787 + update.reg = reg; 2788 + update.mask = mask; 2789 + update.val = val; 2790 + card->update = &update; 2789 2791 } 2792 + change |= reg_change; 2790 2793 2791 2794 ret = soc_dapm_mixer_update_power(card, kcontrol, connect); 2792 2795
+113
tools/lib/traceevent/event-parse.c
··· 765 765 case PRINT_BSTRING: 766 766 free(arg->string.string); 767 767 break; 768 + case PRINT_BITMASK: 769 + free(arg->bitmask.bitmask); 770 + break; 768 771 case PRINT_DYNAMIC_ARRAY: 769 772 free(arg->dynarray.index); 770 773 break; ··· 2271 2268 case PRINT_FIELD ... PRINT_SYMBOL: 2272 2269 case PRINT_STRING: 2273 2270 case PRINT_BSTRING: 2271 + case PRINT_BITMASK: 2274 2272 default: 2275 2273 do_warning("invalid eval type %d", arg->type); 2276 2274 ret = 0; ··· 2300 2296 case PRINT_FIELD ... PRINT_SYMBOL: 2301 2297 case PRINT_STRING: 2302 2298 case PRINT_BSTRING: 2299 + case PRINT_BITMASK: 2303 2300 default: 2304 2301 do_warning("invalid eval type %d", arg->type); 2305 2302 break; ··· 2688 2683 return EVENT_ERROR; 2689 2684 } 2690 2685 2686 + static enum event_type 2687 + process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg, 2688 + char **tok) 2689 + { 2690 + enum event_type type; 2691 + char *token; 2692 + 2693 + if (read_expect_type(EVENT_ITEM, &token) < 0) 2694 + goto out_free; 2695 + 2696 + arg->type = PRINT_BITMASK; 2697 + arg->bitmask.bitmask = token; 2698 + arg->bitmask.offset = -1; 2699 + 2700 + if (read_expected(EVENT_DELIM, ")") < 0) 2701 + goto out_err; 2702 + 2703 + type = read_token(&token); 2704 + *tok = token; 2705 + 2706 + return type; 2707 + 2708 + out_free: 2709 + free_token(token); 2710 + out_err: 2711 + *tok = NULL; 2712 + return EVENT_ERROR; 2713 + } 2714 + 2691 2715 static struct pevent_function_handler * 2692 2716 find_func_handler(struct pevent *pevent, char *func_name) 2693 2717 { ··· 2830 2796 if (strcmp(token, "__get_str") == 0) { 2831 2797 free_token(token); 2832 2798 return process_str(event, arg, tok); 2799 + } 2800 + if (strcmp(token, "__get_bitmask") == 0) { 2801 + free_token(token); 2802 + return process_bitmask(event, arg, tok); 2833 2803 } 2834 2804 if (strcmp(token, "__get_dynamic_array") == 0) { 2835 2805 free_token(token); ··· 3362 3324 return eval_type(val, arg, 0); 3363 3325 case PRINT_STRING: 3364 3326 case PRINT_BSTRING: 3327 + case PRINT_BITMASK: 3365 3328 return 0; 3366 3329 case PRINT_FUNC: { 3367 3330 struct trace_seq s; ··· 3595 3556 trace_seq_printf(s, format, str); 3596 3557 } 3597 3558 3559 + static void print_bitmask_to_seq(struct pevent *pevent, 3560 + struct trace_seq *s, const char *format, 3561 + int len_arg, const void *data, int size) 3562 + { 3563 + int nr_bits = size * 8; 3564 + int str_size = (nr_bits + 3) / 4; 3565 + int len = 0; 3566 + char buf[3]; 3567 + char *str; 3568 + int index; 3569 + int i; 3570 + 3571 + /* 3572 + * The kernel likes to put in commas every 32 bits, we 3573 + * can do the same. 3574 + */ 3575 + str_size += (nr_bits - 1) / 32; 3576 + 3577 + str = malloc(str_size + 1); 3578 + if (!str) { 3579 + do_warning("%s: not enough memory!", __func__); 3580 + return; 3581 + } 3582 + str[str_size] = 0; 3583 + 3584 + /* Start out with -2 for the two chars per byte */ 3585 + for (i = str_size - 2; i >= 0; i -= 2) { 3586 + /* 3587 + * data points to a bit mask of size bytes. 3588 + * In the kernel, this is an array of long words, thus 3589 + * endianess is very important. 3590 + */ 3591 + if (pevent->file_bigendian) 3592 + index = size - (len + 1); 3593 + else 3594 + index = len; 3595 + 3596 + snprintf(buf, 3, "%02x", *((unsigned char *)data + index)); 3597 + memcpy(str + i, buf, 2); 3598 + len++; 3599 + if (!(len & 3) && i > 0) { 3600 + i--; 3601 + str[i] = ','; 3602 + } 3603 + } 3604 + 3605 + if (len_arg >= 0) 3606 + trace_seq_printf(s, format, len_arg, str); 3607 + else 3608 + trace_seq_printf(s, format, str); 3609 + 3610 + free(str); 3611 + } 3612 + 3598 3613 static void print_str_arg(struct trace_seq *s, void *data, int size, 3599 3614 struct event_format *event, const char *format, 3600 3615 int len_arg, struct print_arg *arg) ··· 3784 3691 case PRINT_BSTRING: 3785 3692 print_str_to_seq(s, format, len_arg, arg->string.string); 3786 3693 break; 3694 + case PRINT_BITMASK: { 3695 + int bitmask_offset; 3696 + int bitmask_size; 3697 + 3698 + if (arg->bitmask.offset == -1) { 3699 + struct format_field *f; 3700 + 3701 + f = pevent_find_any_field(event, arg->bitmask.bitmask); 3702 + arg->bitmask.offset = f->offset; 3703 + } 3704 + bitmask_offset = data2host4(pevent, data + arg->bitmask.offset); 3705 + bitmask_size = bitmask_offset >> 16; 3706 + bitmask_offset &= 0xffff; 3707 + print_bitmask_to_seq(pevent, s, format, len_arg, 3708 + data + bitmask_offset, bitmask_size); 3709 + break; 3710 + } 3787 3711 case PRINT_OP: 3788 3712 /* 3789 3713 * The only op for string should be ? : ··· 4931 4821 case PRINT_STRING: 4932 4822 case PRINT_BSTRING: 4933 4823 printf("__get_str(%s)", args->string.string); 4824 + break; 4825 + case PRINT_BITMASK: 4826 + printf("__get_bitmask(%s)", args->bitmask.bitmask); 4934 4827 break; 4935 4828 case PRINT_TYPE: 4936 4829 printf("(%s)", args->typecast.type);
+22 -3
tools/lib/traceevent/event-parse.h
··· 107 107 typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 108 108 typedef int (*pevent_plugin_unload_func)(struct pevent *pevent); 109 109 110 - struct plugin_option { 111 - struct plugin_option *next; 110 + struct pevent_plugin_option { 111 + struct pevent_plugin_option *next; 112 112 void *handle; 113 113 char *file; 114 114 char *name; ··· 135 135 * PEVENT_PLUGIN_OPTIONS: (optional) 136 136 * Plugin options that can be set before loading 137 137 * 138 - * struct plugin_option PEVENT_PLUGIN_OPTIONS[] = { 138 + * struct pevent_plugin_option PEVENT_PLUGIN_OPTIONS[] = { 139 139 * { 140 140 * .name = "option-name", 141 141 * .plugin_alias = "overide-file-name", (optional) ··· 208 208 int offset; 209 209 }; 210 210 211 + struct print_arg_bitmask { 212 + char *bitmask; 213 + int offset; 214 + }; 215 + 211 216 struct print_arg_field { 212 217 char *name; 213 218 struct format_field *field; ··· 279 274 PRINT_DYNAMIC_ARRAY, 280 275 PRINT_OP, 281 276 PRINT_FUNC, 277 + PRINT_BITMASK, 282 278 }; 283 279 284 280 struct print_arg { ··· 294 288 struct print_arg_hex hex; 295 289 struct print_arg_func func; 296 290 struct print_arg_string string; 291 + struct print_arg_bitmask bitmask; 297 292 struct print_arg_op op; 298 293 struct print_arg_dynarray dynarray; 299 294 }; ··· 361 354 362 355 enum pevent_flag { 363 356 PEVENT_NSEC_OUTPUT = 1, /* output in NSECS */ 357 + PEVENT_DISABLE_SYS_PLUGINS = 1 << 1, 358 + PEVENT_DISABLE_PLUGINS = 1 << 2, 364 359 }; 365 360 366 361 #define PEVENT_ERRORS \ ··· 419 410 420 411 struct plugin_list; 421 412 413 + #define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) 414 + 422 415 struct plugin_list *traceevent_load_plugins(struct pevent *pevent); 423 416 void traceevent_unload_plugins(struct plugin_list *plugin_list, 424 417 struct pevent *pevent); 418 + char **traceevent_plugin_list_options(void); 419 + void traceevent_plugin_free_options_list(char **list); 420 + int traceevent_plugin_add_options(const char *name, 421 + struct pevent_plugin_option *options); 422 + void traceevent_plugin_remove_options(struct pevent_plugin_option *options); 423 + void traceevent_print_plugins(struct trace_seq *s, 424 + const char *prefix, const char *suffix, 425 + const struct plugin_list *list); 425 426 426 427 struct cmdline; 427 428 struct cmdline_list;
+202 -1
tools/lib/traceevent/event-plugin.c
··· 18 18 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 19 */ 20 20 21 + #include <stdio.h> 21 22 #include <string.h> 22 23 #include <dlfcn.h> 23 24 #include <stdlib.h> ··· 31 30 32 31 #define LOCAL_PLUGIN_DIR ".traceevent/plugins" 33 32 33 + static struct registered_plugin_options { 34 + struct registered_plugin_options *next; 35 + struct pevent_plugin_option *options; 36 + } *registered_options; 37 + 38 + static struct trace_plugin_options { 39 + struct trace_plugin_options *next; 40 + char *plugin; 41 + char *option; 42 + char *value; 43 + } *trace_plugin_options; 44 + 34 45 struct plugin_list { 35 46 struct plugin_list *next; 36 47 char *name; 37 48 void *handle; 38 49 }; 50 + 51 + /** 52 + * traceevent_plugin_list_options - get list of plugin options 53 + * 54 + * Returns an array of char strings that list the currently registered 55 + * plugin options in the format of <plugin>:<option>. This list can be 56 + * used by toggling the option. 57 + * 58 + * Returns NULL if there's no options registered. On error it returns 59 + * INVALID_PLUGIN_LIST_OPTION 60 + * 61 + * Must be freed with traceevent_plugin_free_options_list(). 62 + */ 63 + char **traceevent_plugin_list_options(void) 64 + { 65 + struct registered_plugin_options *reg; 66 + struct pevent_plugin_option *op; 67 + char **list = NULL; 68 + char *name; 69 + int count = 0; 70 + 71 + for (reg = registered_options; reg; reg = reg->next) { 72 + for (op = reg->options; op->name; op++) { 73 + char *alias = op->plugin_alias ? op->plugin_alias : op->file; 74 + char **temp = list; 75 + 76 + name = malloc(strlen(op->name) + strlen(alias) + 2); 77 + if (!name) 78 + goto err; 79 + 80 + sprintf(name, "%s:%s", alias, op->name); 81 + list = realloc(list, count + 2); 82 + if (!list) { 83 + list = temp; 84 + free(name); 85 + goto err; 86 + } 87 + list[count++] = name; 88 + list[count] = NULL; 89 + } 90 + } 91 + return list; 92 + 93 + err: 94 + while (--count >= 0) 95 + free(list[count]); 96 + free(list); 97 + 98 + return INVALID_PLUGIN_LIST_OPTION; 99 + } 100 + 101 + void traceevent_plugin_free_options_list(char **list) 102 + { 103 + int i; 104 + 105 + if (!list) 106 + return; 107 + 108 + if (list == INVALID_PLUGIN_LIST_OPTION) 109 + return; 110 + 111 + for (i = 0; list[i]; i++) 112 + free(list[i]); 113 + 114 + free(list); 115 + } 116 + 117 + static int 118 + update_option(const char *file, struct pevent_plugin_option *option) 119 + { 120 + struct trace_plugin_options *op; 121 + char *plugin; 122 + 123 + if (option->plugin_alias) { 124 + plugin = strdup(option->plugin_alias); 125 + if (!plugin) 126 + return -1; 127 + } else { 128 + char *p; 129 + plugin = strdup(file); 130 + if (!plugin) 131 + return -1; 132 + p = strstr(plugin, "."); 133 + if (p) 134 + *p = '\0'; 135 + } 136 + 137 + /* first look for named options */ 138 + for (op = trace_plugin_options; op; op = op->next) { 139 + if (!op->plugin) 140 + continue; 141 + if (strcmp(op->plugin, plugin) != 0) 142 + continue; 143 + if (strcmp(op->option, option->name) != 0) 144 + continue; 145 + 146 + option->value = op->value; 147 + option->set ^= 1; 148 + goto out; 149 + } 150 + 151 + /* first look for unnamed options */ 152 + for (op = trace_plugin_options; op; op = op->next) { 153 + if (op->plugin) 154 + continue; 155 + if (strcmp(op->option, option->name) != 0) 156 + continue; 157 + 158 + option->value = op->value; 159 + option->set ^= 1; 160 + break; 161 + } 162 + 163 + out: 164 + free(plugin); 165 + return 0; 166 + } 167 + 168 + /** 169 + * traceevent_plugin_add_options - Add a set of options by a plugin 170 + * @name: The name of the plugin adding the options 171 + * @options: The set of options being loaded 172 + * 173 + * Sets the options with the values that have been added by user. 174 + */ 175 + int traceevent_plugin_add_options(const char *name, 176 + struct pevent_plugin_option *options) 177 + { 178 + struct registered_plugin_options *reg; 179 + 180 + reg = malloc(sizeof(*reg)); 181 + if (!reg) 182 + return -1; 183 + reg->next = registered_options; 184 + reg->options = options; 185 + registered_options = reg; 186 + 187 + while (options->name) { 188 + update_option(name, options); 189 + options++; 190 + } 191 + return 0; 192 + } 193 + 194 + /** 195 + * traceevent_plugin_remove_options - remove plugin options that were registered 196 + * @options: Options to removed that were registered with traceevent_plugin_add_options 197 + */ 198 + void traceevent_plugin_remove_options(struct pevent_plugin_option *options) 199 + { 200 + struct registered_plugin_options **last; 201 + struct registered_plugin_options *reg; 202 + 203 + for (last = &registered_options; *last; last = &(*last)->next) { 204 + if ((*last)->options == options) { 205 + reg = *last; 206 + *last = reg->next; 207 + free(reg); 208 + return; 209 + } 210 + } 211 + } 212 + 213 + /** 214 + * traceevent_print_plugins - print out the list of plugins loaded 215 + * @s: the trace_seq descripter to write to 216 + * @prefix: The prefix string to add before listing the option name 217 + * @suffix: The suffix string ot append after the option name 218 + * @list: The list of plugins (usually returned by traceevent_load_plugins() 219 + * 220 + * Writes to the trace_seq @s the list of plugins (files) that is 221 + * returned by traceevent_load_plugins(). Use @prefix and @suffix for formating: 222 + * @prefix = " ", @suffix = "\n". 223 + */ 224 + void traceevent_print_plugins(struct trace_seq *s, 225 + const char *prefix, const char *suffix, 226 + const struct plugin_list *list) 227 + { 228 + while (list) { 229 + trace_seq_printf(s, "%s%s%s", prefix, list->name, suffix); 230 + list = list->next; 231 + } 232 + } 39 233 40 234 static void 41 235 load_plugin(struct pevent *pevent, const char *path, ··· 344 148 char *path; 345 149 char *envdir; 346 150 151 + if (pevent->flags & PEVENT_DISABLE_PLUGINS) 152 + return; 153 + 347 154 /* 348 155 * If a system plugin directory was defined, 349 156 * check that first. 350 157 */ 351 158 #ifdef PLUGIN_DIR 352 - load_plugins_dir(pevent, suffix, PLUGIN_DIR, load_plugin, data); 159 + if (!(pevent->flags & PEVENT_DISABLE_SYS_PLUGINS)) 160 + load_plugins_dir(pevent, suffix, PLUGIN_DIR, 161 + load_plugin, data); 353 162 #endif 354 163 355 164 /*
+37 -6
tools/lib/traceevent/plugin_function.c
··· 33 33 34 34 #define STK_BLK 10 35 35 36 + struct pevent_plugin_option plugin_options[] = 37 + { 38 + { 39 + .name = "parent", 40 + .plugin_alias = "ftrace", 41 + .description = 42 + "Print parent of functions for function events", 43 + }, 44 + { 45 + .name = "indent", 46 + .plugin_alias = "ftrace", 47 + .description = 48 + "Try to show function call indents, based on parents", 49 + .set = 1, 50 + }, 51 + { 52 + .name = NULL, 53 + } 54 + }; 55 + 56 + static struct pevent_plugin_option *ftrace_parent = &plugin_options[0]; 57 + static struct pevent_plugin_option *ftrace_indent = &plugin_options[1]; 58 + 36 59 static void add_child(struct func_stack *stack, const char *child, int pos) 37 60 { 38 61 int i; ··· 142 119 143 120 parent = pevent_find_function(pevent, pfunction); 144 121 145 - index = add_and_get_index(parent, func, record->cpu); 122 + if (parent && ftrace_indent->set) 123 + index = add_and_get_index(parent, func, record->cpu); 146 124 147 125 trace_seq_printf(s, "%*s", index*3, ""); 148 126 ··· 152 128 else 153 129 trace_seq_printf(s, "0x%llx", function); 154 130 155 - trace_seq_printf(s, " <-- "); 156 - if (parent) 157 - trace_seq_printf(s, "%s", parent); 158 - else 159 - trace_seq_printf(s, "0x%llx", pfunction); 131 + if (ftrace_parent->set) { 132 + trace_seq_printf(s, " <-- "); 133 + if (parent) 134 + trace_seq_printf(s, "%s", parent); 135 + else 136 + trace_seq_printf(s, "0x%llx", pfunction); 137 + } 160 138 161 139 return 0; 162 140 } ··· 167 141 { 168 142 pevent_register_event_handler(pevent, -1, "ftrace", "function", 169 143 function_handler, NULL); 144 + 145 + traceevent_plugin_add_options("ftrace", plugin_options); 146 + 170 147 return 0; 171 148 } 172 149 ··· 185 156 free(fstack[i].stack[x]); 186 157 free(fstack[i].stack); 187 158 } 159 + 160 + traceevent_plugin_remove_options(plugin_options); 188 161 189 162 free(fstack); 190 163 fstack = NULL;
+23
tools/perf/Documentation/perf-report.txt
··· 117 117 By default, every sort keys not specified in -F will be appended 118 118 automatically. 119 119 120 + If --mem-mode option is used, following sort keys are also available 121 + (incompatible with --branch-stack): 122 + symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline. 123 + 124 + - symbol_daddr: name of data symbol being executed on at the time of sample 125 + - dso_daddr: name of library or module containing the data being executed 126 + on at the time of sample 127 + - locked: whether the bus was locked at the time of sample 128 + - tlb: type of tlb access for the data at the time of sample 129 + - mem: type of memory access for the data at the time of sample 130 + - snoop: type of snoop (if any) for the data at the time of sample 131 + - dcacheline: the cacheline the data address is on at the time of sample 132 + 133 + And default sort keys are changed to local_weight, mem, sym, dso, 134 + symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'. 135 + 120 136 -p:: 121 137 --parent=<regex>:: 122 138 A regex filter to identify parent. The parent is a caller of this ··· 275 259 --demangle:: 276 260 Demangle symbol names to human readable form. It's enabled by default, 277 261 disable with --no-demangle. 262 + 263 + --mem-mode:: 264 + Use the data addresses of samples in addition to instruction addresses 265 + to build the histograms. To generate meaningful output, the perf.data 266 + file must have been obtained using perf record -d -W and using a 267 + special event -e cpu/mem-loads/ or -e cpu/mem-stores/. See 268 + 'perf mem' for simpler access. 278 269 279 270 --percent-limit:: 280 271 Do not show entries which have an overhead under that percent.
+20 -21
tools/perf/Documentation/perf-timechart.txt
··· 43 43 44 44 --symfs=<directory>:: 45 45 Look for files with symbols relative to this directory. 46 - 47 - EXAMPLES 48 - -------- 49 - 50 - $ perf timechart record git pull 51 - 52 - [ perf record: Woken up 13 times to write data ] 53 - [ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ] 54 - 55 - $ perf timechart 56 - 57 - Written 10.2 seconds of trace to output.svg. 58 - 59 - Record system-wide timechart: 60 - 61 - $ perf timechart record 62 - 63 - then generate timechart and highlight 'gcc' tasks: 64 - 65 - $ perf timechart --highlight gcc 66 - 67 46 -n:: 68 47 --proc-num:: 69 48 Print task info for at least given number of tasks. ··· 66 87 -g:: 67 88 --callchain:: 68 89 Do call-graph (stack chain/backtrace) recording 90 + 91 + EXAMPLES 92 + -------- 93 + 94 + $ perf timechart record git pull 95 + 96 + [ perf record: Woken up 13 times to write data ] 97 + [ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ] 98 + 99 + $ perf timechart 100 + 101 + Written 10.2 seconds of trace to output.svg. 102 + 103 + Record system-wide timechart: 104 + 105 + $ perf timechart record 106 + 107 + then generate timechart and highlight 'gcc' tasks: 108 + 109 + $ perf timechart --highlight gcc 69 110 70 111 SEE ALSO 71 112 --------
+3 -3
tools/perf/Makefile.perf
··· 819 819 TAG_FILES= ../../include/uapi/linux/perf_event.h 820 820 821 821 TAGS: 822 - $(RM) TAGS 822 + $(QUIET_GEN)$(RM) TAGS; \ 823 823 $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs etags -a $(TAG_FILES) 824 824 825 825 tags: 826 - $(RM) tags 826 + $(QUIET_GEN)$(RM) tags; \ 827 827 $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs ctags -a $(TAG_FILES) 828 828 829 829 cscope: 830 - $(RM) cscope* 830 + $(QUIET_GEN)$(RM) cscope*; \ 831 831 $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs cscope -b $(TAG_FILES) 832 832 833 833 ### Detect prefix changes
+1 -1
tools/perf/builtin-inject.c
··· 72 72 if (ret) 73 73 return ret; 74 74 75 - if (&inject->output.is_pipe) 75 + if (!inject->output.is_pipe) 76 76 return 0; 77 77 78 78 return perf_event__repipe_synth(tool, event);
+14 -9
tools/perf/builtin-probe.c
··· 288 288 memset(&params, 0, sizeof(params)); 289 289 } 290 290 291 + static void pr_err_with_code(const char *msg, int err) 292 + { 293 + pr_err("%s", msg); 294 + pr_debug(" Reason: %s (Code: %d)", strerror(-err), err); 295 + pr_err("\n"); 296 + } 297 + 291 298 static int 292 299 __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) 293 300 { ··· 386 379 } 387 380 ret = parse_probe_event_argv(argc, argv); 388 381 if (ret < 0) { 389 - pr_err(" Error: Parse Error. (%d)\n", ret); 382 + pr_err_with_code(" Error: Command Parse Error.", ret); 390 383 return ret; 391 384 } 392 385 } ··· 426 419 } 427 420 ret = show_perf_probe_events(); 428 421 if (ret < 0) 429 - pr_err(" Error: Failed to show event list. (%d)\n", 430 - ret); 422 + pr_err_with_code(" Error: Failed to show event list.", ret); 431 423 return ret; 432 424 } 433 425 if (params.show_funcs) { ··· 451 445 strfilter__delete(params.filter); 452 446 params.filter = NULL; 453 447 if (ret < 0) 454 - pr_err(" Error: Failed to show functions." 455 - " (%d)\n", ret); 448 + pr_err_with_code(" Error: Failed to show functions.", ret); 456 449 return ret; 457 450 } 458 451 ··· 469 464 470 465 ret = show_line_range(&params.line_range, params.target); 471 466 if (ret < 0) 472 - pr_err(" Error: Failed to show lines. (%d)\n", ret); 467 + pr_err_with_code(" Error: Failed to show lines.", ret); 473 468 return ret; 474 469 } 475 470 if (params.show_vars) { ··· 490 485 strfilter__delete(params.filter); 491 486 params.filter = NULL; 492 487 if (ret < 0) 493 - pr_err(" Error: Failed to show vars. (%d)\n", ret); 488 + pr_err_with_code(" Error: Failed to show vars.", ret); 494 489 return ret; 495 490 } 496 491 #endif ··· 498 493 if (params.dellist) { 499 494 ret = del_perf_probe_events(params.dellist); 500 495 if (ret < 0) { 501 - pr_err(" Error: Failed to delete events. (%d)\n", ret); 496 + pr_err_with_code(" Error: Failed to delete events.", ret); 502 497 return ret; 503 498 } 504 499 } ··· 509 504 params.target, 510 505 params.force_add); 511 506 if (ret < 0) { 512 - pr_err(" Error: Failed to add events. (%d)\n", ret); 507 + pr_err_with_code(" Error: Failed to add events.", ret); 513 508 return ret; 514 509 } 515 510 }
+5 -1
tools/perf/config/Makefile
··· 299 299 NO_LIBUNWIND := 1 300 300 NO_LIBDW_DWARF_UNWIND := 1 301 301 else 302 - msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); 302 + ifneq ($(filter s% -static%,$(LDFLAGS),),) 303 + msg := $(error No static glibc found, please install glibc-static); 304 + else 305 + msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]); 306 + endif 303 307 endif 304 308 else 305 309 ifndef NO_LIBDW_DWARF_UNWIND
+1
tools/perf/perf.c
··· 458 458 459 459 /* The page_size is placed in util object. */ 460 460 page_size = sysconf(_SC_PAGE_SIZE); 461 + cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); 461 462 462 463 cmd = perf_extract_argv0_path(argv[0]); 463 464 if (!cmd)
+40 -2
tools/perf/tests/builtin-test.c
··· 3 3 * 4 4 * Builtin regression testing command: ever growing number of sanity tests 5 5 */ 6 + #include <unistd.h> 7 + #include <string.h> 6 8 #include "builtin.h" 7 9 #include "intlist.h" 8 10 #include "tests.h" ··· 52 50 .func = test__pmu, 53 51 }, 54 52 { 55 - .desc = "Test dso data interface", 53 + .desc = "Test dso data read", 56 54 .func = test__dso_data, 55 + }, 56 + { 57 + .desc = "Test dso data cache", 58 + .func = test__dso_data_cache, 59 + }, 60 + { 61 + .desc = "Test dso data reopen", 62 + .func = test__dso_data_reopen, 57 63 }, 58 64 { 59 65 .desc = "roundtrip evsel->name check", ··· 182 172 return false; 183 173 } 184 174 175 + static int run_test(struct test *test) 176 + { 177 + int status, err = -1, child = fork(); 178 + 179 + if (child < 0) { 180 + pr_err("failed to fork test: %s\n", strerror(errno)); 181 + return -1; 182 + } 183 + 184 + if (!child) { 185 + pr_debug("test child forked, pid %d\n", getpid()); 186 + err = test->func(); 187 + exit(err); 188 + } 189 + 190 + wait(&status); 191 + 192 + if (WIFEXITED(status)) { 193 + err = WEXITSTATUS(status); 194 + pr_debug("test child finished with %d\n", err); 195 + } else if (WIFSIGNALED(status)) { 196 + err = -1; 197 + pr_debug("test child interrupted\n"); 198 + } 199 + 200 + return err; 201 + } 202 + 185 203 static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) 186 204 { 187 205 int i = 0; ··· 238 200 } 239 201 240 202 pr_debug("\n--- start ---\n"); 241 - err = tests[curr].func(); 203 + err = run_test(&tests[curr]); 242 204 pr_debug("---- end ----\n%s:", tests[curr].desc); 243 205 244 206 switch (err) {
+210 -4
tools/perf/tests/dso-data.c
··· 1 - #include "util.h" 2 - 3 1 #include <stdlib.h> 4 2 #include <linux/types.h> 5 3 #include <sys/stat.h> 6 4 #include <fcntl.h> 7 5 #include <string.h> 8 - 6 + #include <sys/time.h> 7 + #include <sys/resource.h> 8 + #include <api/fs/fs.h> 9 + #include "util.h" 9 10 #include "machine.h" 10 11 #include "symbol.h" 11 12 #include "tests.h" 12 13 13 14 static char *test_file(int size) 14 15 { 15 - static char buf_templ[] = "/tmp/test-XXXXXX"; 16 + #define TEMPL "/tmp/perf-test-XXXXXX" 17 + static char buf_templ[sizeof(TEMPL)]; 16 18 char *templ = buf_templ; 17 19 int fd, i; 18 20 unsigned char *buf; 21 + 22 + strcpy(buf_templ, TEMPL); 23 + #undef TEMPL 19 24 20 25 fd = mkstemp(templ); 21 26 if (fd < 0) { ··· 153 148 154 149 dso__delete(dso); 155 150 unlink(file); 151 + return 0; 152 + } 153 + 154 + static long open_files_cnt(void) 155 + { 156 + char path[PATH_MAX]; 157 + struct dirent *dent; 158 + DIR *dir; 159 + long nr = 0; 160 + 161 + scnprintf(path, PATH_MAX, "%s/self/fd", procfs__mountpoint()); 162 + pr_debug("fd path: %s\n", path); 163 + 164 + dir = opendir(path); 165 + TEST_ASSERT_VAL("failed to open fd directory", dir); 166 + 167 + while ((dent = readdir(dir)) != NULL) { 168 + if (!strcmp(dent->d_name, ".") || 169 + !strcmp(dent->d_name, "..")) 170 + continue; 171 + 172 + nr++; 173 + } 174 + 175 + closedir(dir); 176 + return nr - 1; 177 + } 178 + 179 + static struct dso **dsos; 180 + 181 + static int dsos__create(int cnt, int size) 182 + { 183 + int i; 184 + 185 + dsos = malloc(sizeof(dsos) * cnt); 186 + TEST_ASSERT_VAL("failed to alloc dsos array", dsos); 187 + 188 + for (i = 0; i < cnt; i++) { 189 + char *file; 190 + 191 + file = test_file(size); 192 + TEST_ASSERT_VAL("failed to get dso file", file); 193 + 194 + dsos[i] = dso__new(file); 195 + TEST_ASSERT_VAL("failed to get dso", dsos[i]); 196 + } 197 + 198 + return 0; 199 + } 200 + 201 + static void dsos__delete(int cnt) 202 + { 203 + int i; 204 + 205 + for (i = 0; i < cnt; i++) { 206 + struct dso *dso = dsos[i]; 207 + 208 + unlink(dso->name); 209 + dso__delete(dso); 210 + } 211 + 212 + free(dsos); 213 + } 214 + 215 + static int set_fd_limit(int n) 216 + { 217 + struct rlimit rlim; 218 + 219 + if (getrlimit(RLIMIT_NOFILE, &rlim)) 220 + return -1; 221 + 222 + pr_debug("file limit %ld, new %d\n", (long) rlim.rlim_cur, n); 223 + 224 + rlim.rlim_cur = n; 225 + return setrlimit(RLIMIT_NOFILE, &rlim); 226 + } 227 + 228 + int test__dso_data_cache(void) 229 + { 230 + struct machine machine; 231 + long nr_end, nr = open_files_cnt(); 232 + int dso_cnt, limit, i, fd; 233 + 234 + memset(&machine, 0, sizeof(machine)); 235 + 236 + /* set as system limit */ 237 + limit = nr * 4; 238 + TEST_ASSERT_VAL("failed to set file limit", !set_fd_limit(limit)); 239 + 240 + /* and this is now our dso open FDs limit + 1 extra */ 241 + dso_cnt = limit / 2 + 1; 242 + TEST_ASSERT_VAL("failed to create dsos\n", 243 + !dsos__create(dso_cnt, TEST_FILE_SIZE)); 244 + 245 + for (i = 0; i < (dso_cnt - 1); i++) { 246 + struct dso *dso = dsos[i]; 247 + 248 + /* 249 + * Open dsos via dso__data_fd or dso__data_read_offset. 250 + * Both opens the data file and keep it open. 251 + */ 252 + if (i % 2) { 253 + fd = dso__data_fd(dso, &machine); 254 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 255 + } else { 256 + #define BUFSIZE 10 257 + u8 buf[BUFSIZE]; 258 + ssize_t n; 259 + 260 + n = dso__data_read_offset(dso, &machine, 0, buf, BUFSIZE); 261 + TEST_ASSERT_VAL("failed to read dso", n == BUFSIZE); 262 + } 263 + } 264 + 265 + /* open +1 dso over the allowed limit */ 266 + fd = dso__data_fd(dsos[i], &machine); 267 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 268 + 269 + /* should force the first one to be closed */ 270 + TEST_ASSERT_VAL("failed to close dsos[0]", dsos[0]->data.fd == -1); 271 + 272 + /* cleanup everything */ 273 + dsos__delete(dso_cnt); 274 + 275 + /* Make sure we did not leak any file descriptor. */ 276 + nr_end = open_files_cnt(); 277 + pr_debug("nr start %ld, nr stop %ld\n", nr, nr_end); 278 + TEST_ASSERT_VAL("failed leadking files", nr == nr_end); 279 + return 0; 280 + } 281 + 282 + int test__dso_data_reopen(void) 283 + { 284 + struct machine machine; 285 + long nr_end, nr = open_files_cnt(); 286 + int fd, fd_extra; 287 + 288 + #define dso_0 (dsos[0]) 289 + #define dso_1 (dsos[1]) 290 + #define dso_2 (dsos[2]) 291 + 292 + memset(&machine, 0, sizeof(machine)); 293 + 294 + /* 295 + * Test scenario: 296 + * - create 3 dso objects 297 + * - set process file descriptor limit to current 298 + * files count + 3 299 + * - test that the first dso gets closed when we 300 + * reach the files count limit 301 + */ 302 + 303 + /* Make sure we are able to open 3 fds anyway */ 304 + TEST_ASSERT_VAL("failed to set file limit", 305 + !set_fd_limit((nr + 3))); 306 + 307 + TEST_ASSERT_VAL("failed to create dsos\n", !dsos__create(3, TEST_FILE_SIZE)); 308 + 309 + /* open dso_0 */ 310 + fd = dso__data_fd(dso_0, &machine); 311 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 312 + 313 + /* open dso_1 */ 314 + fd = dso__data_fd(dso_1, &machine); 315 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 316 + 317 + /* 318 + * open extra file descriptor and we just 319 + * reached the files count limit 320 + */ 321 + fd_extra = open("/dev/null", O_RDONLY); 322 + TEST_ASSERT_VAL("failed to open extra fd", fd_extra > 0); 323 + 324 + /* open dso_2 */ 325 + fd = dso__data_fd(dso_2, &machine); 326 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 327 + 328 + /* 329 + * dso_0 should get closed, because we reached 330 + * the file descriptor limit 331 + */ 332 + TEST_ASSERT_VAL("failed to close dso_0", dso_0->data.fd == -1); 333 + 334 + /* open dso_0 */ 335 + fd = dso__data_fd(dso_0, &machine); 336 + TEST_ASSERT_VAL("failed to get fd", fd > 0); 337 + 338 + /* 339 + * dso_1 should get closed, because we reached 340 + * the file descriptor limit 341 + */ 342 + TEST_ASSERT_VAL("failed to close dso_1", dso_1->data.fd == -1); 343 + 344 + /* cleanup everything */ 345 + close(fd_extra); 346 + dsos__delete(3); 347 + 348 + /* Make sure we did not leak any file descriptor. */ 349 + nr_end = open_files_cnt(); 350 + pr_debug("nr start %ld, nr stop %ld\n", nr, nr_end); 351 + TEST_ASSERT_VAL("failed leadking files", nr == nr_end); 156 352 return 0; 157 353 }
+1 -1
tools/perf/tests/dwarf-unwind.c
··· 15 15 struct perf_sample *sample __maybe_unused, 16 16 struct machine *machine) 17 17 { 18 - return machine__process_mmap_event(machine, event, NULL); 18 + return machine__process_mmap2_event(machine, event, NULL); 19 19 } 20 20 21 21 static int init_live_machine(struct machine *machine)
+2 -5
tools/perf/tests/make
··· 205 205 ( eval $$cmd ) >> $@ 2>&1; \ 206 206 echo " test: $(call test,$@)" >> $@ 2>&1; \ 207 207 $(call test,$@) && \ 208 - rm -f $@ \ 209 - rm -rf $$TMP_DEST 208 + rm -rf $@ $$TMP_DEST || (cat $@ ; false) 210 209 211 210 $(run_O): 212 211 $(call clean) ··· 216 217 ( eval $$cmd ) >> $@ 2>&1 && \ 217 218 echo " test: $(call test_O,$@)" >> $@ 2>&1; \ 218 219 $(call test_O,$@) && \ 219 - rm -f $@ && \ 220 - rm -rf $$TMP_O \ 221 - rm -rf $$TMP_DEST 220 + rm -rf $@ $$TMP_O $$TMP_DEST || (cat $@ ; false) 222 221 223 222 tarpkg: 224 223 @cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \
+2
tools/perf/tests/tests.h
··· 28 28 int test__pmu(void); 29 29 int test__attr(void); 30 30 int test__dso_data(void); 31 + int test__dso_data_cache(void); 32 + int test__dso_data_reopen(void); 31 33 int test__parse_events(void); 32 34 int test__hists_link(void); 33 35 int test__python_use(void);
+254 -25
tools/perf/util/dso.c
··· 1 + #include <asm/bug.h> 2 + #include <sys/time.h> 3 + #include <sys/resource.h> 1 4 #include "symbol.h" 2 5 #include "dso.h" 3 6 #include "machine.h" ··· 139 136 return ret; 140 137 } 141 138 142 - static int open_dso(struct dso *dso, struct machine *machine) 139 + /* 140 + * Global list of open DSOs and the counter. 141 + */ 142 + static LIST_HEAD(dso__data_open); 143 + static long dso__data_open_cnt; 144 + 145 + static void dso__list_add(struct dso *dso) 146 + { 147 + list_add_tail(&dso->data.open_entry, &dso__data_open); 148 + dso__data_open_cnt++; 149 + } 150 + 151 + static void dso__list_del(struct dso *dso) 152 + { 153 + list_del(&dso->data.open_entry); 154 + WARN_ONCE(dso__data_open_cnt <= 0, 155 + "DSO data fd counter out of bounds."); 156 + dso__data_open_cnt--; 157 + } 158 + 159 + static void close_first_dso(void); 160 + 161 + static int do_open(char *name) 162 + { 163 + int fd; 164 + 165 + do { 166 + fd = open(name, O_RDONLY); 167 + if (fd >= 0) 168 + return fd; 169 + 170 + pr_debug("dso open failed, mmap: %s\n", strerror(errno)); 171 + if (!dso__data_open_cnt || errno != EMFILE) 172 + break; 173 + 174 + close_first_dso(); 175 + } while (1); 176 + 177 + return -1; 178 + } 179 + 180 + static int __open_dso(struct dso *dso, struct machine *machine) 143 181 { 144 182 int fd; 145 183 char *root_dir = (char *)""; ··· 198 154 return -EINVAL; 199 155 } 200 156 201 - fd = open(name, O_RDONLY); 157 + fd = do_open(name); 202 158 free(name); 203 159 return fd; 204 160 } 205 161 162 + static void check_data_close(void); 163 + 164 + /** 165 + * dso_close - Open DSO data file 166 + * @dso: dso object 167 + * 168 + * Open @dso's data file descriptor and updates 169 + * list/count of open DSO objects. 170 + */ 171 + static int open_dso(struct dso *dso, struct machine *machine) 172 + { 173 + int fd = __open_dso(dso, machine); 174 + 175 + if (fd > 0) { 176 + dso__list_add(dso); 177 + /* 178 + * Check if we crossed the allowed number 179 + * of opened DSOs and close one if needed. 180 + */ 181 + check_data_close(); 182 + } 183 + 184 + return fd; 185 + } 186 + 187 + static void close_data_fd(struct dso *dso) 188 + { 189 + if (dso->data.fd >= 0) { 190 + close(dso->data.fd); 191 + dso->data.fd = -1; 192 + dso->data.file_size = 0; 193 + dso__list_del(dso); 194 + } 195 + } 196 + 197 + /** 198 + * dso_close - Close DSO data file 199 + * @dso: dso object 200 + * 201 + * Close @dso's data file descriptor and updates 202 + * list/count of open DSO objects. 203 + */ 204 + static void close_dso(struct dso *dso) 205 + { 206 + close_data_fd(dso); 207 + } 208 + 209 + static void close_first_dso(void) 210 + { 211 + struct dso *dso; 212 + 213 + dso = list_first_entry(&dso__data_open, struct dso, data.open_entry); 214 + close_dso(dso); 215 + } 216 + 217 + static rlim_t get_fd_limit(void) 218 + { 219 + struct rlimit l; 220 + rlim_t limit = 0; 221 + 222 + /* Allow half of the current open fd limit. */ 223 + if (getrlimit(RLIMIT_NOFILE, &l) == 0) { 224 + if (l.rlim_cur == RLIM_INFINITY) 225 + limit = l.rlim_cur; 226 + else 227 + limit = l.rlim_cur / 2; 228 + } else { 229 + pr_err("failed to get fd limit\n"); 230 + limit = 1; 231 + } 232 + 233 + return limit; 234 + } 235 + 236 + static bool may_cache_fd(void) 237 + { 238 + static rlim_t limit; 239 + 240 + if (!limit) 241 + limit = get_fd_limit(); 242 + 243 + if (limit == RLIM_INFINITY) 244 + return true; 245 + 246 + return limit > (rlim_t) dso__data_open_cnt; 247 + } 248 + 249 + /* 250 + * Check and close LRU dso if we crossed allowed limit 251 + * for opened dso file descriptors. The limit is half 252 + * of the RLIMIT_NOFILE files opened. 253 + */ 254 + static void check_data_close(void) 255 + { 256 + bool cache_fd = may_cache_fd(); 257 + 258 + if (!cache_fd) 259 + close_first_dso(); 260 + } 261 + 262 + /** 263 + * dso__data_close - Close DSO data file 264 + * @dso: dso object 265 + * 266 + * External interface to close @dso's data file descriptor. 267 + */ 268 + void dso__data_close(struct dso *dso) 269 + { 270 + close_dso(dso); 271 + } 272 + 273 + /** 274 + * dso__data_fd - Get dso's data file descriptor 275 + * @dso: dso object 276 + * @machine: machine object 277 + * 278 + * External interface to find dso's file, open it and 279 + * returns file descriptor. 280 + */ 206 281 int dso__data_fd(struct dso *dso, struct machine *machine) 207 282 { 208 283 enum dso_binary_type binary_type_data[] = { ··· 331 168 }; 332 169 int i = 0; 333 170 334 - if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND) 335 - return open_dso(dso, machine); 171 + if (dso->data.fd >= 0) 172 + return dso->data.fd; 173 + 174 + if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND) { 175 + dso->data.fd = open_dso(dso, machine); 176 + return dso->data.fd; 177 + } 336 178 337 179 do { 338 180 int fd; ··· 346 178 347 179 fd = open_dso(dso, machine); 348 180 if (fd >= 0) 349 - return fd; 181 + return dso->data.fd = fd; 350 182 351 183 } while (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND); 352 184 ··· 428 260 } 429 261 430 262 static ssize_t 431 - dso_cache__read(struct dso *dso, struct machine *machine, 432 - u64 offset, u8 *data, ssize_t size) 263 + dso_cache__read(struct dso *dso, u64 offset, u8 *data, ssize_t size) 433 264 { 434 265 struct dso_cache *cache; 435 266 ssize_t ret; 436 - int fd; 437 - 438 - fd = dso__data_fd(dso, machine); 439 - if (fd < 0) 440 - return -1; 441 267 442 268 do { 443 269 u64 cache_offset; ··· 445 283 cache_offset = offset & DSO__DATA_CACHE_MASK; 446 284 ret = -EINVAL; 447 285 448 - if (-1 == lseek(fd, cache_offset, SEEK_SET)) 286 + if (-1 == lseek(dso->data.fd, cache_offset, SEEK_SET)) 449 287 break; 450 288 451 - ret = read(fd, cache->data, DSO__DATA_CACHE_SIZE); 289 + ret = read(dso->data.fd, cache->data, DSO__DATA_CACHE_SIZE); 452 290 if (ret <= 0) 453 291 break; 454 292 455 293 cache->offset = cache_offset; 456 294 cache->size = ret; 457 - dso_cache__insert(&dso->cache, cache); 295 + dso_cache__insert(&dso->data.cache, cache); 458 296 459 297 ret = dso_cache__memcpy(cache, offset, data, size); 460 298 ··· 463 301 if (ret <= 0) 464 302 free(cache); 465 303 466 - close(fd); 467 304 return ret; 468 305 } 469 306 470 - static ssize_t dso_cache_read(struct dso *dso, struct machine *machine, 471 - u64 offset, u8 *data, ssize_t size) 307 + static ssize_t dso_cache_read(struct dso *dso, u64 offset, 308 + u8 *data, ssize_t size) 472 309 { 473 310 struct dso_cache *cache; 474 311 475 - cache = dso_cache__find(&dso->cache, offset); 312 + cache = dso_cache__find(&dso->data.cache, offset); 476 313 if (cache) 477 314 return dso_cache__memcpy(cache, offset, data, size); 478 315 else 479 - return dso_cache__read(dso, machine, offset, data, size); 316 + return dso_cache__read(dso, offset, data, size); 480 317 } 481 318 482 - ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, 483 - u64 offset, u8 *data, ssize_t size) 319 + /* 320 + * Reads and caches dso data DSO__DATA_CACHE_SIZE size chunks 321 + * in the rb_tree. Any read to already cached data is served 322 + * by cached data. 323 + */ 324 + static ssize_t cached_read(struct dso *dso, u64 offset, u8 *data, ssize_t size) 484 325 { 485 326 ssize_t r = 0; 486 327 u8 *p = data; ··· 491 326 do { 492 327 ssize_t ret; 493 328 494 - ret = dso_cache_read(dso, machine, offset, p, size); 329 + ret = dso_cache_read(dso, offset, p, size); 495 330 if (ret < 0) 496 331 return ret; 497 332 ··· 511 346 return r; 512 347 } 513 348 349 + static int data_file_size(struct dso *dso) 350 + { 351 + struct stat st; 352 + 353 + if (!dso->data.file_size) { 354 + if (fstat(dso->data.fd, &st)) { 355 + pr_err("dso mmap failed, fstat: %s\n", strerror(errno)); 356 + return -1; 357 + } 358 + dso->data.file_size = st.st_size; 359 + } 360 + 361 + return 0; 362 + } 363 + 364 + static ssize_t data_read_offset(struct dso *dso, u64 offset, 365 + u8 *data, ssize_t size) 366 + { 367 + if (data_file_size(dso)) 368 + return -1; 369 + 370 + /* Check the offset sanity. */ 371 + if (offset > dso->data.file_size) 372 + return -1; 373 + 374 + if (offset + size < offset) 375 + return -1; 376 + 377 + return cached_read(dso, offset, data, size); 378 + } 379 + 380 + /** 381 + * dso__data_read_offset - Read data from dso file offset 382 + * @dso: dso object 383 + * @machine: machine object 384 + * @offset: file offset 385 + * @data: buffer to store data 386 + * @size: size of the @data buffer 387 + * 388 + * External interface to read data from dso file offset. Open 389 + * dso data file and use cached_read to get the data. 390 + */ 391 + ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, 392 + u64 offset, u8 *data, ssize_t size) 393 + { 394 + if (dso__data_fd(dso, machine) < 0) 395 + return -1; 396 + 397 + return data_read_offset(dso, offset, data, size); 398 + } 399 + 400 + /** 401 + * dso__data_read_addr - Read data from dso address 402 + * @dso: dso object 403 + * @machine: machine object 404 + * @add: virtual memory address 405 + * @data: buffer to store data 406 + * @size: size of the @data buffer 407 + * 408 + * External interface to read data from dso address. 409 + */ 514 410 ssize_t dso__data_read_addr(struct dso *dso, struct map *map, 515 411 struct machine *machine, u64 addr, 516 412 u8 *data, ssize_t size) ··· 699 473 dso__set_short_name(dso, dso->name, false); 700 474 for (i = 0; i < MAP__NR_TYPES; ++i) 701 475 dso->symbols[i] = dso->symbol_names[i] = RB_ROOT; 702 - dso->cache = RB_ROOT; 476 + dso->data.cache = RB_ROOT; 477 + dso->data.fd = -1; 703 478 dso->symtab_type = DSO_BINARY_TYPE__NOT_FOUND; 704 479 dso->binary_type = DSO_BINARY_TYPE__NOT_FOUND; 705 480 dso->loaded = 0; ··· 712 485 dso->kernel = DSO_TYPE_USER; 713 486 dso->needs_swap = DSO_SWAP__UNSET; 714 487 INIT_LIST_HEAD(&dso->node); 488 + INIT_LIST_HEAD(&dso->data.open_entry); 715 489 } 716 490 717 491 return dso; ··· 734 506 dso->long_name_allocated = false; 735 507 } 736 508 737 - dso_cache__free(&dso->cache); 509 + dso__data_close(dso); 510 + dso_cache__free(&dso->data.cache); 738 511 dso__free_a2l(dso); 739 512 zfree(&dso->symsrc_filename); 740 513 free(dso);
+49 -1
tools/perf/util/dso.h
··· 76 76 struct list_head node; 77 77 struct rb_root symbols[MAP__NR_TYPES]; 78 78 struct rb_root symbol_names[MAP__NR_TYPES]; 79 - struct rb_root cache; 80 79 void *a2l; 81 80 char *symsrc_filename; 82 81 unsigned int a2l_fails; ··· 98 99 const char *long_name; 99 100 u16 long_name_len; 100 101 u16 short_name_len; 102 + 103 + /* dso data file */ 104 + struct { 105 + struct rb_root cache; 106 + int fd; 107 + size_t file_size; 108 + struct list_head open_entry; 109 + } data; 110 + 101 111 char name[0]; 102 112 }; 103 113 ··· 149 141 int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type type, 150 142 char *root_dir, char *filename, size_t size); 151 143 144 + /* 145 + * The dso__data_* external interface provides following functions: 146 + * dso__data_fd 147 + * dso__data_close 148 + * dso__data_read_offset 149 + * dso__data_read_addr 150 + * 151 + * Please refer to the dso.c object code for each function and 152 + * arguments documentation. Following text tries to explain the 153 + * dso file descriptor caching. 154 + * 155 + * The dso__data* interface allows caching of opened file descriptors 156 + * to speed up the dso data accesses. The idea is to leave the file 157 + * descriptor opened ideally for the whole life of the dso object. 158 + * 159 + * The current usage of the dso__data_* interface is as follows: 160 + * 161 + * Get DSO's fd: 162 + * int fd = dso__data_fd(dso, machine); 163 + * USE 'fd' SOMEHOW 164 + * 165 + * Read DSO's data: 166 + * n = dso__data_read_offset(dso_0, &machine, 0, buf, BUFSIZE); 167 + * n = dso__data_read_addr(dso_0, &machine, 0, buf, BUFSIZE); 168 + * 169 + * Eventually close DSO's fd: 170 + * dso__data_close(dso); 171 + * 172 + * It is not necessary to close the DSO object data file. Each time new 173 + * DSO data file is opened, the limit (RLIMIT_NOFILE/2) is checked. Once 174 + * it is crossed, the oldest opened DSO object is closed. 175 + * 176 + * The dso__delete function calls close_dso function to ensure the 177 + * data file descriptor gets closed/unmapped before the dso object 178 + * is freed. 179 + * 180 + * TODO 181 + */ 152 182 int dso__data_fd(struct dso *dso, struct machine *machine); 183 + void dso__data_close(struct dso *dso); 184 + 153 185 ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, 154 186 u64 offset, u8 *data, ssize_t size); 155 187 ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
+41 -16
tools/perf/util/event.c
··· 1 1 #include <linux/types.h> 2 + #include <sys/mman.h> 2 3 #include "event.h" 3 4 #include "debug.h" 4 5 #include "hist.h" ··· 179 178 return -1; 180 179 } 181 180 182 - event->header.type = PERF_RECORD_MMAP; 181 + event->header.type = PERF_RECORD_MMAP2; 183 182 184 183 while (1) { 185 184 char bf[BUFSIZ]; 186 185 char prot[5]; 187 186 char execname[PATH_MAX]; 188 187 char anonstr[] = "//anon"; 188 + unsigned int ino; 189 189 size_t size; 190 190 ssize_t n; 191 191 ··· 197 195 strcpy(execname, ""); 198 196 199 197 /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ 200 - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n", 201 - &event->mmap.start, &event->mmap.len, prot, 202 - &event->mmap.pgoff, 203 - execname); 198 + n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", 199 + &event->mmap2.start, &event->mmap2.len, prot, 200 + &event->mmap2.pgoff, &event->mmap2.maj, 201 + &event->mmap2.min, 202 + &ino, execname); 203 + 204 204 /* 205 205 * Anon maps don't have the execname. 206 206 */ 207 - if (n < 4) 207 + if (n < 7) 208 208 continue; 209 + 210 + event->mmap2.ino = (u64)ino; 211 + 209 212 /* 210 213 * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c 211 214 */ ··· 218 211 event->header.misc = PERF_RECORD_MISC_USER; 219 212 else 220 213 event->header.misc = PERF_RECORD_MISC_GUEST_USER; 214 + 215 + /* map protection and flags bits */ 216 + event->mmap2.prot = 0; 217 + event->mmap2.flags = 0; 218 + if (prot[0] == 'r') 219 + event->mmap2.prot |= PROT_READ; 220 + if (prot[1] == 'w') 221 + event->mmap2.prot |= PROT_WRITE; 222 + if (prot[2] == 'x') 223 + event->mmap2.prot |= PROT_EXEC; 224 + 225 + if (prot[3] == 's') 226 + event->mmap2.flags |= MAP_SHARED; 227 + else 228 + event->mmap2.flags |= MAP_PRIVATE; 221 229 222 230 if (prot[2] != 'x') { 223 231 if (!mmap_data || prot[0] != 'r') ··· 245 223 strcpy(execname, anonstr); 246 224 247 225 size = strlen(execname) + 1; 248 - memcpy(event->mmap.filename, execname, size); 226 + memcpy(event->mmap2.filename, execname, size); 249 227 size = PERF_ALIGN(size, sizeof(u64)); 250 - event->mmap.len -= event->mmap.start; 251 - event->mmap.header.size = (sizeof(event->mmap) - 252 - (sizeof(event->mmap.filename) - size)); 253 - memset(event->mmap.filename + size, 0, machine->id_hdr_size); 254 - event->mmap.header.size += machine->id_hdr_size; 255 - event->mmap.pid = tgid; 256 - event->mmap.tid = pid; 228 + event->mmap2.len -= event->mmap.start; 229 + event->mmap2.header.size = (sizeof(event->mmap2) - 230 + (sizeof(event->mmap2.filename) - size)); 231 + memset(event->mmap2.filename + size, 0, machine->id_hdr_size); 232 + event->mmap2.header.size += machine->id_hdr_size; 233 + event->mmap2.pid = tgid; 234 + event->mmap2.tid = pid; 257 235 258 236 if (process(tool, event, &synth_sample, machine) != 0) { 259 237 rc = -1; ··· 634 612 size_t perf_event__fprintf_mmap2(union perf_event *event, FILE *fp) 635 613 { 636 614 return fprintf(fp, " %d/%d: [%#" PRIx64 "(%#" PRIx64 ") @ %#" PRIx64 637 - " %02x:%02x %"PRIu64" %"PRIu64"]: %c %s\n", 615 + " %02x:%02x %"PRIu64" %"PRIu64"]: %c%c%c%c %s\n", 638 616 event->mmap2.pid, event->mmap2.tid, event->mmap2.start, 639 617 event->mmap2.len, event->mmap2.pgoff, event->mmap2.maj, 640 618 event->mmap2.min, event->mmap2.ino, 641 619 event->mmap2.ino_generation, 642 - (event->header.misc & PERF_RECORD_MISC_MMAP_DATA) ? 'r' : 'x', 620 + (event->mmap2.prot & PROT_READ) ? 'r' : '-', 621 + (event->mmap2.prot & PROT_WRITE) ? 'w' : '-', 622 + (event->mmap2.prot & PROT_EXEC) ? 'x' : '-', 623 + (event->mmap2.flags & MAP_SHARED) ? 's' : 'p', 643 624 event->mmap2.filename); 644 625 } 645 626
+7
tools/perf/util/event.h
··· 7 7 #include "../perf.h" 8 8 #include "map.h" 9 9 #include "build-id.h" 10 + #include "perf_regs.h" 10 11 11 12 struct mmap_event { 12 13 struct perf_event_header header; ··· 28 27 u32 min; 29 28 u64 ino; 30 29 u64 ino_generation; 30 + u32 prot; 31 + u32 flags; 31 32 char filename[PATH_MAX]; 32 33 }; 33 34 ··· 90 87 u64 abi; 91 88 u64 mask; 92 89 u64 *regs; 90 + 91 + /* Cached values/mask filled by first register access. */ 92 + u64 cache_regs[PERF_REGS_MAX]; 93 + u64 cache_mask; 93 94 }; 94 95 95 96 struct stack_dump {
+3 -2
tools/perf/util/evsel.c
··· 589 589 } 590 590 591 591 /* 592 - * We default some events to a 1 default interval. But keep 592 + * We default some events to have a default interval. But keep 593 593 * it a weak assumption overridable by the user. 594 594 */ 595 - if (!attr->sample_period || (opts->user_freq != UINT_MAX && 595 + if (!attr->sample_period || (opts->user_freq != UINT_MAX || 596 596 opts->user_interval != ULLONG_MAX)) { 597 597 if (opts->freq) { 598 598 perf_evsel__set_sample_bit(evsel, PERIOD); ··· 659 659 perf_evsel__set_sample_bit(evsel, WEIGHT); 660 660 661 661 attr->mmap = track; 662 + attr->mmap2 = track && !perf_missing_features.mmap2; 662 663 attr->comm = track; 663 664 664 665 if (opts->sample_transaction)
+6 -3
tools/perf/util/hist.c
··· 128 128 + unresolved_col_width + 2; 129 129 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, 130 130 symlen); 131 + hists__new_col_len(hists, HISTC_MEM_DCACHELINE, 132 + symlen + 1); 131 133 } else { 132 134 symlen = unresolved_col_width + 4 + 2; 133 135 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, ··· 441 439 .map = al->map, 442 440 .sym = al->sym, 443 441 }, 444 - .cpu = al->cpu, 445 - .ip = al->addr, 446 - .level = al->level, 442 + .cpu = al->cpu, 443 + .cpumode = al->cpumode, 444 + .ip = al->addr, 445 + .level = al->level, 447 446 .stat = { 448 447 .nr_events = 1, 449 448 .period = period,
+1
tools/perf/util/hist.h
··· 72 72 HISTC_MEM_TLB, 73 73 HISTC_MEM_LVL, 74 74 HISTC_MEM_SNOOP, 75 + HISTC_MEM_DCACHELINE, 75 76 HISTC_TRANSACTION, 76 77 HISTC_NR_COLS, /* Last entry */ 77 78 };
+3 -1
tools/perf/util/machine.c
··· 1060 1060 event->mmap2.pid, event->mmap2.maj, 1061 1061 event->mmap2.min, event->mmap2.ino, 1062 1062 event->mmap2.ino_generation, 1063 + event->mmap2.prot, 1064 + event->mmap2.flags, 1063 1065 event->mmap2.filename, type); 1064 1066 1065 1067 if (map == NULL) ··· 1107 1105 1108 1106 map = map__new(&machine->user_dsos, event->mmap.start, 1109 1107 event->mmap.len, event->mmap.pgoff, 1110 - event->mmap.pid, 0, 0, 0, 0, 1108 + event->mmap.pid, 0, 0, 0, 0, 0, 0, 1111 1109 event->mmap.filename, 1112 1110 type); 1113 1111
+3 -1
tools/perf/util/map.c
··· 138 138 139 139 struct map *map__new(struct list_head *dsos__list, u64 start, u64 len, 140 140 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino, 141 - u64 ino_gen, char *filename, 141 + u64 ino_gen, u32 prot, u32 flags, char *filename, 142 142 enum map_type type) 143 143 { 144 144 struct map *map = malloc(sizeof(*map)); ··· 157 157 map->min = d_min; 158 158 map->ino = ino; 159 159 map->ino_generation = ino_gen; 160 + map->prot = prot; 161 + map->flags = flags; 160 162 161 163 if ((anon || no_dso) && type == MAP__FUNCTION) { 162 164 snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
+3 -1
tools/perf/util/map.h
··· 35 35 bool referenced; 36 36 bool erange_warned; 37 37 u32 priv; 38 + u32 prot; 39 + u32 flags; 38 40 u64 pgoff; 39 41 u64 reloc; 40 42 u32 maj, min; /* only valid for MMAP2 record */ ··· 120 118 u64 start, u64 end, u64 pgoff, struct dso *dso); 121 119 struct map *map__new(struct list_head *dsos__list, u64 start, u64 len, 122 120 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino, 123 - u64 ino_gen, 121 + u64 ino_gen, u32 prot, u32 flags, 124 122 char *filename, enum map_type type); 125 123 struct map *map__new2(u64 start, struct dso *dso, enum map_type type); 126 124 void map__delete(struct map *map);
+9 -1
tools/perf/util/perf_regs.c
··· 1 1 #include <errno.h> 2 2 #include "perf_regs.h" 3 + #include "event.h" 3 4 4 5 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id) 5 6 { 6 7 int i, idx = 0; 7 8 u64 mask = regs->mask; 9 + 10 + if (regs->cache_mask & (1 << id)) 11 + goto out; 8 12 9 13 if (!(mask & (1 << id))) 10 14 return -EINVAL; ··· 18 14 idx++; 19 15 } 20 16 21 - *valp = regs->regs[idx]; 17 + regs->cache_mask |= (1 << id); 18 + regs->cache_regs[id] = regs->regs[idx]; 19 + 20 + out: 21 + *valp = regs->cache_regs[id]; 22 22 return 0; 23 23 }
+3 -1
tools/perf/util/perf_regs.h
··· 2 2 #define __PERF_REGS_H 3 3 4 4 #include <linux/types.h> 5 - #include "event.h" 5 + 6 + struct regs_dump; 6 7 7 8 #ifdef HAVE_PERF_REGS_SUPPORT 8 9 #include <perf_regs.h> ··· 12 11 13 12 #else 14 13 #define PERF_REGS_MASK 0 14 + #define PERF_REGS_MAX 0 15 15 16 16 static inline const char *perf_reg_name(int id __maybe_unused) 17 17 {
+9 -4
tools/perf/util/probe-event.c
··· 628 628 629 629 ret = debuginfo__find_line_range(dinfo, lr); 630 630 debuginfo__delete(dinfo); 631 - if (ret == 0) { 631 + if (ret == 0 || ret == -ENOENT) { 632 632 pr_warning("Specified source line is not found.\n"); 633 633 return -ENOENT; 634 634 } else if (ret < 0) { 635 - pr_warning("Debuginfo analysis failed. (%d)\n", ret); 635 + pr_warning("Debuginfo analysis failed.\n"); 636 636 return ret; 637 637 } 638 638 ··· 641 641 ret = get_real_path(tmp, lr->comp_dir, &lr->path); 642 642 free(tmp); /* Free old path */ 643 643 if (ret < 0) { 644 - pr_warning("Failed to find source file. (%d)\n", ret); 644 + pr_warning("Failed to find source file path.\n"); 645 645 return ret; 646 646 } 647 647 ··· 721 721 ret = debuginfo__find_available_vars_at(dinfo, pev, &vls, 722 722 max_vls, externs); 723 723 if (ret <= 0) { 724 - pr_err("Failed to find variables at %s (%d)\n", buf, ret); 724 + if (ret == 0 || ret == -ENOENT) { 725 + pr_err("Failed to find the address of %s\n", buf); 726 + ret = -ENOENT; 727 + } else 728 + pr_warning("Debuginfo analysis failed.\n"); 725 729 goto end; 726 730 } 731 + 727 732 /* Some variables are found */ 728 733 fprintf(stdout, "Available variables at %s\n", buf); 729 734 for (i = 0; i < ret; i++) {
+7 -4
tools/perf/util/probe-finder.c
··· 573 573 if (!die_find_variable_at(sc_die, pf->pvar->var, pf->addr, &vr_die)) { 574 574 /* Search again in global variables */ 575 575 if (!die_find_variable_at(&pf->cu_die, pf->pvar->var, 0, &vr_die)) 576 + pr_warning("Failed to find '%s' in this function.\n", 577 + pf->pvar->var); 576 578 ret = -ENOENT; 577 579 } 578 580 if (ret >= 0) 579 581 ret = convert_variable(&vr_die, pf); 580 582 581 - if (ret < 0) 582 - pr_warning("Failed to find '%s' in this function.\n", 583 - pf->pvar->var); 584 583 return ret; 585 584 } 586 585 ··· 1280 1281 return ret; 1281 1282 } 1282 1283 1283 - /* Find available variables at given probe point */ 1284 + /* 1285 + * Find available variables at given probe point 1286 + * Return the number of found probe points. Return 0 if there is no 1287 + * matched probe point. Return <0 if an error occurs. 1288 + */ 1284 1289 int debuginfo__find_available_vars_at(struct debuginfo *dbg, 1285 1290 struct perf_probe_event *pev, 1286 1291 struct variable_list **vls,
+1
tools/perf/util/scripting-engines/trace-event-perl.c
··· 215 215 case PRINT_BSTRING: 216 216 case PRINT_DYNAMIC_ARRAY: 217 217 case PRINT_STRING: 218 + case PRINT_BITMASK: 218 219 break; 219 220 case PRINT_TYPE: 220 221 define_event_symbols(event, ev_name, args->typecast.item);
+2
tools/perf/util/scripting-engines/trace-event-python.c
··· 197 197 case PRINT_BSTRING: 198 198 case PRINT_DYNAMIC_ARRAY: 199 199 case PRINT_FUNC: 200 + case PRINT_BITMASK: 200 201 /* we should warn... */ 201 202 return; 202 203 } ··· 623 622 fprintf(ofp, "%s=", f->name); 624 623 if (f->flags & FIELD_IS_STRING || 625 624 f->flags & FIELD_IS_FLAG || 625 + f->flags & FIELD_IS_ARRAY || 626 626 f->flags & FIELD_IS_SYMBOLIC) 627 627 fprintf(ofp, "%%s"); 628 628 else if (f->flags & FIELD_IS_SIGNED)
+107
tools/perf/util/sort.c
··· 1 + #include <sys/mman.h> 1 2 #include "sort.h" 2 3 #include "hist.h" 3 4 #include "comm.h" ··· 785 784 return repsep_snprintf(bf, size, "%-*s", width, out); 786 785 } 787 786 787 + static inline u64 cl_address(u64 address) 788 + { 789 + /* return the cacheline of the address */ 790 + return (address & ~(cacheline_size - 1)); 791 + } 792 + 793 + static int64_t 794 + sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right) 795 + { 796 + u64 l, r; 797 + struct map *l_map, *r_map; 798 + 799 + if (!left->mem_info) return -1; 800 + if (!right->mem_info) return 1; 801 + 802 + /* group event types together */ 803 + if (left->cpumode > right->cpumode) return -1; 804 + if (left->cpumode < right->cpumode) return 1; 805 + 806 + l_map = left->mem_info->daddr.map; 807 + r_map = right->mem_info->daddr.map; 808 + 809 + /* if both are NULL, jump to sort on al_addr instead */ 810 + if (!l_map && !r_map) 811 + goto addr; 812 + 813 + if (!l_map) return -1; 814 + if (!r_map) return 1; 815 + 816 + if (l_map->maj > r_map->maj) return -1; 817 + if (l_map->maj < r_map->maj) return 1; 818 + 819 + if (l_map->min > r_map->min) return -1; 820 + if (l_map->min < r_map->min) return 1; 821 + 822 + if (l_map->ino > r_map->ino) return -1; 823 + if (l_map->ino < r_map->ino) return 1; 824 + 825 + if (l_map->ino_generation > r_map->ino_generation) return -1; 826 + if (l_map->ino_generation < r_map->ino_generation) return 1; 827 + 828 + /* 829 + * Addresses with no major/minor numbers are assumed to be 830 + * anonymous in userspace. Sort those on pid then address. 831 + * 832 + * The kernel and non-zero major/minor mapped areas are 833 + * assumed to be unity mapped. Sort those on address. 834 + */ 835 + 836 + if ((left->cpumode != PERF_RECORD_MISC_KERNEL) && 837 + (!(l_map->flags & MAP_SHARED)) && 838 + !l_map->maj && !l_map->min && !l_map->ino && 839 + !l_map->ino_generation) { 840 + /* userspace anonymous */ 841 + 842 + if (left->thread->pid_ > right->thread->pid_) return -1; 843 + if (left->thread->pid_ < right->thread->pid_) return 1; 844 + } 845 + 846 + addr: 847 + /* al_addr does all the right addr - start + offset calculations */ 848 + l = cl_address(left->mem_info->daddr.al_addr); 849 + r = cl_address(right->mem_info->daddr.al_addr); 850 + 851 + if (l > r) return -1; 852 + if (l < r) return 1; 853 + 854 + return 0; 855 + } 856 + 857 + static int hist_entry__dcacheline_snprintf(struct hist_entry *he, char *bf, 858 + size_t size, unsigned int width) 859 + { 860 + 861 + uint64_t addr = 0; 862 + struct map *map = NULL; 863 + struct symbol *sym = NULL; 864 + char level = he->level; 865 + 866 + if (he->mem_info) { 867 + addr = cl_address(he->mem_info->daddr.al_addr); 868 + map = he->mem_info->daddr.map; 869 + sym = he->mem_info->daddr.sym; 870 + 871 + /* print [s] for shared data mmaps */ 872 + if ((he->cpumode != PERF_RECORD_MISC_KERNEL) && 873 + map && (map->type == MAP__VARIABLE) && 874 + (map->flags & MAP_SHARED) && 875 + (map->maj || map->min || map->ino || 876 + map->ino_generation)) 877 + level = 's'; 878 + else if (!map) 879 + level = 'X'; 880 + } 881 + return _hist_entry__sym_snprintf(map, sym, addr, level, bf, size, 882 + width); 883 + } 884 + 788 885 struct sort_entry sort_mispredict = { 789 886 .se_header = "Branch Mispredicted", 790 887 .se_cmp = sort__mispredict_cmp, ··· 973 874 .se_cmp = sort__snoop_cmp, 974 875 .se_snprintf = hist_entry__snoop_snprintf, 975 876 .se_width_idx = HISTC_MEM_SNOOP, 877 + }; 878 + 879 + struct sort_entry sort_mem_dcacheline = { 880 + .se_header = "Data Cacheline", 881 + .se_cmp = sort__dcacheline_cmp, 882 + .se_snprintf = hist_entry__dcacheline_snprintf, 883 + .se_width_idx = HISTC_MEM_DCACHELINE, 976 884 }; 977 885 978 886 static int64_t ··· 1149 1043 DIM(SORT_MEM_TLB, "tlb", sort_mem_tlb), 1150 1044 DIM(SORT_MEM_LVL, "mem", sort_mem_lvl), 1151 1045 DIM(SORT_MEM_SNOOP, "snoop", sort_mem_snoop), 1046 + DIM(SORT_MEM_DCACHELINE, "dcacheline", sort_mem_dcacheline), 1152 1047 }; 1153 1048 1154 1049 #undef DIM
+2
tools/perf/util/sort.h
··· 89 89 u64 ip; 90 90 u64 transaction; 91 91 s32 cpu; 92 + u8 cpumode; 92 93 93 94 struct hist_entry_diff diff; 94 95 ··· 186 185 SORT_MEM_TLB, 187 186 SORT_MEM_LVL, 188 187 SORT_MEM_SNOOP, 188 + SORT_MEM_DCACHELINE, 189 189 }; 190 190 191 191 /*
-2
tools/perf/util/unwind-libunwind.c
··· 250 250 251 251 /* Check the .eh_frame section for unwinding info */ 252 252 offset = elf_section_offset(fd, ".eh_frame_hdr"); 253 - close(fd); 254 253 255 254 if (offset) 256 255 ret = unwind_spec_ehframe(dso, machine, offset, ··· 270 271 271 272 /* Check the .debug_frame section for unwinding info */ 272 273 *offset = elf_section_offset(fd, ".debug_frame"); 273 - close(fd); 274 274 275 275 if (*offset) 276 276 return 0;
+1
tools/perf/util/util.c
··· 17 17 * XXX We need to find a better place for these things... 18 18 */ 19 19 unsigned int page_size; 20 + int cacheline_size; 20 21 21 22 bool test_attr__enabled; 22 23
+1
tools/perf/util/util.h
··· 304 304 void dump_stack(void); 305 305 306 306 extern unsigned int page_size; 307 + extern int cacheline_size; 307 308 308 309 void get_term_dimensions(struct winsize *ws); 309 310