diff options
170 files changed, 2254 insertions, 907 deletions
diff --git a/Documentation/devicetree/bindings/phy/phy-stih407-usb.txt b/Documentation/devicetree/bindings/phy/phy-stih407-usb.txt new file mode 100644 index 000000000000..1ef8228db73b --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-stih407-usb.txt | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | ST STiH407 USB PHY controller | ||
| 2 | |||
| 3 | This file documents the dt bindings for the usb picoPHY driver which is the PHY for both USB2 and USB3 | ||
| 4 | host controllers (when controlling usb2/1.1 devices) available on STiH407 SoC family from STMicroelectronics. | ||
| 5 | |||
| 6 | Required properties: | ||
| 7 | - compatible : should be "st,stih407-usb2-phy" | ||
| 8 | - reg : contain the offset and length of the system configuration registers | ||
| 9 | used as glue logic to control & parameter phy | ||
| 10 | - reg-names : the names of the system configuration registers in "reg", should be "param" and "reg" | ||
| 11 | - st,syscfg : sysconfig register to manage phy parameter at driver level | ||
| 12 | - resets : list of phandle and reset specifier pairs. There should be two entries, one | ||
| 13 | for the whole phy and one for the port | ||
| 14 | - reset-names : list of reset signal names. Should be "global" and "port" | ||
| 15 | See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt | ||
| 16 | See: Documentation/devicetree/bindings/reset/reset.txt | ||
| 17 | |||
| 18 | Example: | ||
| 19 | |||
| 20 | usb2_picophy0: usbpicophy@f8 { | ||
| 21 | compatible = "st,stih407-usb2-phy"; | ||
| 22 | reg = <0xf8 0x04>, /* syscfg 5062 */ | ||
| 23 | <0xf4 0x04>; /* syscfg 5061 */ | ||
| 24 | reg-names = "param", "ctrl"; | ||
| 25 | #phy-cells = <0>; | ||
| 26 | st,syscfg = <&syscfg_core>; | ||
| 27 | resets = <&softreset STIH407_PICOPHY_SOFTRESET>, | ||
| 28 | <&picophyreset STIH407_PICOPHY0_RESET>; | ||
| 29 | reset-names = "global", "port"; | ||
| 30 | }; | ||
diff --git a/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt b/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt new file mode 100644 index 000000000000..00944a05ee6b --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | STMicroelectronics STiH41x USB PHY binding | ||
| 2 | ------------------------------------------ | ||
| 3 | |||
| 4 | This file contains documentation for the usb phy found in STiH415/6 SoCs from | ||
| 5 | STMicroelectronics. | ||
| 6 | |||
| 7 | Required properties: | ||
| 8 | - compatible : should be "st,stih416-usb-phy" or "st,stih415-usb-phy" | ||
| 9 | - st,syscfg : should be a phandle of the syscfg node | ||
| 10 | - clock-names : must contain "osc_phy" | ||
| 11 | - clocks : must contain an entry for each name in clock-names. | ||
| 12 | See: Documentation/devicetree/bindings/clock/clock-bindings.txt | ||
| 13 | - #phy-cells : must be 0 for this phy | ||
| 14 | See: Documentation/devicetree/bindings/phy/phy-bindings.txt | ||
| 15 | |||
| 16 | Example: | ||
| 17 | |||
| 18 | usb2_phy: usb2phy@0 { | ||
| 19 | compatible = "st,stih416-usb-phy"; | ||
| 20 | #phy-cell = <0>; | ||
| 21 | st,syscfg = <&syscfg_rear>; | ||
| 22 | clocks = <&clk_sysin>; | ||
| 23 | clock-names = "osc_phy"; | ||
| 24 | }; | ||
diff --git a/Documentation/devicetree/bindings/phy/rcar-gen2-phy.txt b/Documentation/devicetree/bindings/phy/rcar-gen2-phy.txt new file mode 100644 index 000000000000..00fc52a034b7 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/rcar-gen2-phy.txt | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | * Renesas R-Car generation 2 USB PHY | ||
| 2 | |||
| 3 | This file provides information on what the device node for the R-Car generation | ||
| 4 | 2 USB PHY contains. | ||
| 5 | |||
| 6 | Required properties: | ||
| 7 | - compatible: "renesas,usb-phy-r8a7790" if the device is a part of R8A7790 SoC. | ||
| 8 | "renesas,usb-phy-r8a7791" if the device is a part of R8A7791 SoC. | ||
| 9 | - reg: offset and length of the register block. | ||
| 10 | - #address-cells: number of address cells for the USB channel subnodes, must | ||
| 11 | be <1>. | ||
| 12 | - #size-cells: number of size cells for the USB channel subnodes, must be <0>. | ||
| 13 | - clocks: clock phandle and specifier pair. | ||
| 14 | - clock-names: string, clock input name, must be "usbhs". | ||
| 15 | |||
| 16 | The USB PHY device tree node should have the subnodes corresponding to the USB | ||
| 17 | channels. These subnodes must contain the following properties: | ||
| 18 | - reg: the USB controller selector; see the table below for the values. | ||
| 19 | - #phy-cells: see phy-bindings.txt in the same directory, must be <1>. | ||
| 20 | |||
| 21 | The phandle's argument in the PHY specifier is the USB controller selector for | ||
| 22 | the USB channel; see the selector meanings below: | ||
| 23 | |||
| 24 | +-----------+---------------+---------------+ | ||
| 25 | |\ Selector | | | | ||
| 26 | + --------- + 0 | 1 | | ||
| 27 | | Channel \| | | | ||
| 28 | +-----------+---------------+---------------+ | ||
| 29 | | 0 | PCI EHCI/OHCI | HS-USB | | ||
| 30 | | 2 | PCI EHCI/OHCI | xHCI | | ||
| 31 | +-----------+---------------+---------------+ | ||
| 32 | |||
| 33 | Example (Lager board): | ||
| 34 | |||
| 35 | usb-phy@e6590100 { | ||
| 36 | compatible = "renesas,usb-phy-r8a7790"; | ||
| 37 | reg = <0 0xe6590100 0 0x100>; | ||
| 38 | #address-cells = <1>; | ||
| 39 | #size-cells = <0>; | ||
| 40 | clocks = <&mstp7_clks R8A7790_CLK_HSUSB>; | ||
| 41 | clock-names = "usbhs"; | ||
| 42 | |||
| 43 | usb-channel@0 { | ||
| 44 | reg = <0>; | ||
| 45 | #phy-cells = <1>; | ||
| 46 | }; | ||
| 47 | usb-channel@2 { | ||
| 48 | reg = <2>; | ||
| 49 | #phy-cells = <1>; | ||
| 50 | }; | ||
| 51 | }; | ||
diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt index 7a6feea2a48b..15e0f2c7130f 100644 --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt | |||
| @@ -17,8 +17,11 @@ Samsung EXYNOS SoC series Display Port PHY | |||
| 17 | ------------------------------------------------- | 17 | ------------------------------------------------- |
| 18 | 18 | ||
| 19 | Required properties: | 19 | Required properties: |
| 20 | - compatible : should be "samsung,exynos5250-dp-video-phy"; | 20 | - compatible : should be one of the following supported values: |
| 21 | - reg : offset and length of the Display Port PHY register set; | 21 | - "samsung,exynos5250-dp-video-phy" |
| 22 | - "samsung,exynos5420-dp-video-phy" | ||
| 23 | - samsung,pmu-syscon: phandle for PMU system controller interface, used to | ||
| 24 | control pmu registers for power isolation. | ||
| 22 | - #phy-cells : from the generic PHY bindings, must be 0; | 25 | - #phy-cells : from the generic PHY bindings, must be 0; |
| 23 | 26 | ||
| 24 | Samsung S5P/EXYNOS SoC series USB PHY | 27 | Samsung S5P/EXYNOS SoC series USB PHY |
diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt index c48a9704bda8..d16f424c5e8d 100644 --- a/Documentation/networking/filter.txt +++ b/Documentation/networking/filter.txt | |||
| @@ -462,9 +462,9 @@ JIT compiler | |||
| 462 | ------------ | 462 | ------------ |
| 463 | 463 | ||
| 464 | The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC, | 464 | The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC, |
| 465 | ARM and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler is | 465 | ARM, MIPS and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler |
| 466 | transparently invoked for each attached filter from user space or for internal | 466 | is transparently invoked for each attached filter from user space or for |
| 467 | kernel users if it has been previously enabled by root: | 467 | internal kernel users if it has been previously enabled by root: |
| 468 | 468 | ||
| 469 | echo 1 > /proc/sys/net/core/bpf_jit_enable | 469 | echo 1 > /proc/sys/net/core/bpf_jit_enable |
| 470 | 470 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 51ecce8b785a..df0d0a858826 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -1392,12 +1392,14 @@ S: Maintained | |||
| 1392 | F: arch/arm/mach-sti/ | 1392 | F: arch/arm/mach-sti/ |
| 1393 | F: arch/arm/boot/dts/sti* | 1393 | F: arch/arm/boot/dts/sti* |
| 1394 | F: drivers/clocksource/arm_global_timer.c | 1394 | F: drivers/clocksource/arm_global_timer.c |
| 1395 | F: drivers/reset/sti/ | ||
| 1396 | F: drivers/pinctrl/pinctrl-st.c | ||
| 1397 | F: drivers/media/rc/st_rc.c | ||
| 1398 | F: drivers/i2c/busses/i2c-st.c | 1395 | F: drivers/i2c/busses/i2c-st.c |
| 1399 | F: drivers/tty/serial/st-asc.c | 1396 | F: drivers/media/rc/st_rc.c |
| 1400 | F: drivers/mmc/host/sdhci-st.c | 1397 | F: drivers/mmc/host/sdhci-st.c |
| 1398 | F: drivers/phy/phy-stih407-usb.c | ||
| 1399 | F: drivers/phy/phy-stih41x-usb.c | ||
| 1400 | F: drivers/pinctrl/pinctrl-st.c | ||
| 1401 | F: drivers/reset/sti/ | ||
| 1402 | F: drivers/tty/serial/st-asc.c | ||
| 1401 | F: drivers/usb/dwc3/dwc3-st.c | 1403 | F: drivers/usb/dwc3/dwc3-st.c |
| 1402 | F: drivers/usb/host/ehci-st.c | 1404 | F: drivers/usb/host/ehci-st.c |
| 1403 | F: drivers/usb/host/ohci-st.c | 1405 | F: drivers/usb/host/ohci-st.c |
diff --git a/arch/ia64/configs/bigsur_defconfig b/arch/ia64/configs/bigsur_defconfig index 4c4ac163c600..b6bda1838629 100644 --- a/arch/ia64/configs/bigsur_defconfig +++ b/arch/ia64/configs/bigsur_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
| 4 | CONFIG_LOG_BUF_SHIFT=16 | 3 | CONFIG_LOG_BUF_SHIFT=16 |
| @@ -6,6 +5,8 @@ CONFIG_PROFILING=y | |||
| 6 | CONFIG_OPROFILE=y | 5 | CONFIG_OPROFILE=y |
| 7 | CONFIG_MODULES=y | 6 | CONFIG_MODULES=y |
| 8 | CONFIG_MODULE_UNLOAD=y | 7 | CONFIG_MODULE_UNLOAD=y |
| 8 | CONFIG_PARTITION_ADVANCED=y | ||
| 9 | CONFIG_SGI_PARTITION=y | ||
| 9 | CONFIG_IA64_DIG=y | 10 | CONFIG_IA64_DIG=y |
| 10 | CONFIG_SMP=y | 11 | CONFIG_SMP=y |
| 11 | CONFIG_NR_CPUS=2 | 12 | CONFIG_NR_CPUS=2 |
| @@ -51,9 +52,6 @@ CONFIG_DM_MIRROR=m | |||
| 51 | CONFIG_DM_ZERO=m | 52 | CONFIG_DM_ZERO=m |
| 52 | CONFIG_NETDEVICES=y | 53 | CONFIG_NETDEVICES=y |
| 53 | CONFIG_DUMMY=y | 54 | CONFIG_DUMMY=y |
| 54 | CONFIG_NET_ETHERNET=y | ||
| 55 | CONFIG_MII=y | ||
| 56 | CONFIG_NET_PCI=y | ||
| 57 | CONFIG_INPUT_EVDEV=y | 55 | CONFIG_INPUT_EVDEV=y |
| 58 | CONFIG_SERIAL_8250=y | 56 | CONFIG_SERIAL_8250=y |
| 59 | CONFIG_SERIAL_8250_CONSOLE=y | 57 | CONFIG_SERIAL_8250_CONSOLE=y |
| @@ -85,7 +83,6 @@ CONFIG_EXT3_FS=y | |||
| 85 | CONFIG_XFS_FS=y | 83 | CONFIG_XFS_FS=y |
| 86 | CONFIG_XFS_QUOTA=y | 84 | CONFIG_XFS_QUOTA=y |
| 87 | CONFIG_XFS_POSIX_ACL=y | 85 | CONFIG_XFS_POSIX_ACL=y |
| 88 | CONFIG_AUTOFS_FS=m | ||
| 89 | CONFIG_AUTOFS4_FS=m | 86 | CONFIG_AUTOFS4_FS=m |
| 90 | CONFIG_ISO9660_FS=m | 87 | CONFIG_ISO9660_FS=m |
| 91 | CONFIG_JOLIET=y | 88 | CONFIG_JOLIET=y |
| @@ -95,17 +92,13 @@ CONFIG_PROC_KCORE=y | |||
| 95 | CONFIG_TMPFS=y | 92 | CONFIG_TMPFS=y |
| 96 | CONFIG_HUGETLBFS=y | 93 | CONFIG_HUGETLBFS=y |
| 97 | CONFIG_NFS_FS=m | 94 | CONFIG_NFS_FS=m |
| 98 | CONFIG_NFS_V3=y | 95 | CONFIG_NFS_V4=m |
| 99 | CONFIG_NFS_V4=y | ||
| 100 | CONFIG_NFSD=m | 96 | CONFIG_NFSD=m |
| 101 | CONFIG_NFSD_V4=y | 97 | CONFIG_NFSD_V4=y |
| 102 | CONFIG_CIFS=m | 98 | CONFIG_CIFS=m |
| 103 | CONFIG_CIFS_STATS=y | 99 | CONFIG_CIFS_STATS=y |
| 104 | CONFIG_CIFS_XATTR=y | 100 | CONFIG_CIFS_XATTR=y |
| 105 | CONFIG_CIFS_POSIX=y | 101 | CONFIG_CIFS_POSIX=y |
| 106 | CONFIG_PARTITION_ADVANCED=y | ||
| 107 | CONFIG_SGI_PARTITION=y | ||
| 108 | CONFIG_EFI_PARTITION=y | ||
| 109 | CONFIG_NLS_CODEPAGE_437=y | 102 | CONFIG_NLS_CODEPAGE_437=y |
| 110 | CONFIG_NLS_ISO8859_1=y | 103 | CONFIG_NLS_ISO8859_1=y |
| 111 | CONFIG_NLS_UTF8=m | 104 | CONFIG_NLS_UTF8=m |
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index e8ed3ae70aae..81f686dee53c 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
| 4 | CONFIG_IKCONFIG=y | 3 | CONFIG_IKCONFIG=y |
| @@ -6,13 +5,13 @@ CONFIG_IKCONFIG_PROC=y | |||
| 6 | CONFIG_LOG_BUF_SHIFT=20 | 5 | CONFIG_LOG_BUF_SHIFT=20 |
| 7 | CONFIG_CGROUPS=y | 6 | CONFIG_CGROUPS=y |
| 8 | CONFIG_CPUSETS=y | 7 | CONFIG_CPUSETS=y |
| 9 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 10 | CONFIG_BLK_DEV_INITRD=y | 8 | CONFIG_BLK_DEV_INITRD=y |
| 11 | CONFIG_KALLSYMS_ALL=y | 9 | CONFIG_KALLSYMS_ALL=y |
| 12 | CONFIG_MODULES=y | 10 | CONFIG_MODULES=y |
| 13 | CONFIG_MODULE_UNLOAD=y | 11 | CONFIG_MODULE_UNLOAD=y |
| 14 | CONFIG_MODVERSIONS=y | 12 | CONFIG_MODVERSIONS=y |
| 15 | # CONFIG_BLK_DEV_BSG is not set | 13 | CONFIG_PARTITION_ADVANCED=y |
| 14 | CONFIG_SGI_PARTITION=y | ||
| 16 | CONFIG_MCKINLEY=y | 15 | CONFIG_MCKINLEY=y |
| 17 | CONFIG_IA64_PAGE_SIZE_64KB=y | 16 | CONFIG_IA64_PAGE_SIZE_64KB=y |
| 18 | CONFIG_IA64_CYCLONE=y | 17 | CONFIG_IA64_CYCLONE=y |
| @@ -29,14 +28,13 @@ CONFIG_ACPI_BUTTON=m | |||
| 29 | CONFIG_ACPI_FAN=m | 28 | CONFIG_ACPI_FAN=m |
| 30 | CONFIG_ACPI_DOCK=y | 29 | CONFIG_ACPI_DOCK=y |
| 31 | CONFIG_ACPI_PROCESSOR=m | 30 | CONFIG_ACPI_PROCESSOR=m |
| 32 | CONFIG_ACPI_CONTAINER=y | ||
| 33 | CONFIG_HOTPLUG_PCI=y | 31 | CONFIG_HOTPLUG_PCI=y |
| 34 | CONFIG_HOTPLUG_PCI_ACPI=y | 32 | CONFIG_HOTPLUG_PCI_ACPI=y |
| 33 | CONFIG_NET=y | ||
| 35 | CONFIG_PACKET=y | 34 | CONFIG_PACKET=y |
| 36 | CONFIG_UNIX=y | 35 | CONFIG_UNIX=y |
| 37 | CONFIG_INET=y | 36 | CONFIG_INET=y |
| 38 | CONFIG_IP_MULTICAST=y | 37 | CONFIG_IP_MULTICAST=y |
| 39 | CONFIG_ARPD=y | ||
| 40 | CONFIG_SYN_COOKIES=y | 38 | CONFIG_SYN_COOKIES=y |
| 41 | # CONFIG_IPV6 is not set | 39 | # CONFIG_IPV6 is not set |
| 42 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 40 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
| @@ -82,16 +80,13 @@ CONFIG_FUSION_FC=m | |||
| 82 | CONFIG_FUSION_SAS=y | 80 | CONFIG_FUSION_SAS=y |
| 83 | CONFIG_NETDEVICES=y | 81 | CONFIG_NETDEVICES=y |
| 84 | CONFIG_DUMMY=m | 82 | CONFIG_DUMMY=m |
| 85 | CONFIG_NET_ETHERNET=y | 83 | CONFIG_NETCONSOLE=y |
| 84 | CONFIG_TIGON3=y | ||
| 86 | CONFIG_NET_TULIP=y | 85 | CONFIG_NET_TULIP=y |
| 87 | CONFIG_TULIP=m | 86 | CONFIG_TULIP=m |
| 88 | CONFIG_NET_PCI=y | ||
| 89 | CONFIG_NET_VENDOR_INTEL=y | ||
| 90 | CONFIG_E100=m | 87 | CONFIG_E100=m |
| 91 | CONFIG_E1000=y | 88 | CONFIG_E1000=y |
| 92 | CONFIG_IGB=y | 89 | CONFIG_IGB=y |
| 93 | CONFIG_TIGON3=y | ||
| 94 | CONFIG_NETCONSOLE=y | ||
| 95 | # CONFIG_SERIO_SERPORT is not set | 90 | # CONFIG_SERIO_SERPORT is not set |
| 96 | CONFIG_GAMEPORT=m | 91 | CONFIG_GAMEPORT=m |
| 97 | CONFIG_SERIAL_NONSTANDARD=y | 92 | CONFIG_SERIAL_NONSTANDARD=y |
| @@ -151,6 +146,7 @@ CONFIG_USB_STORAGE=m | |||
| 151 | CONFIG_INFINIBAND=m | 146 | CONFIG_INFINIBAND=m |
| 152 | CONFIG_INFINIBAND_MTHCA=m | 147 | CONFIG_INFINIBAND_MTHCA=m |
| 153 | CONFIG_INFINIBAND_IPOIB=m | 148 | CONFIG_INFINIBAND_IPOIB=m |
| 149 | CONFIG_INTEL_IOMMU=y | ||
| 154 | CONFIG_MSPEC=m | 150 | CONFIG_MSPEC=m |
| 155 | CONFIG_EXT2_FS=y | 151 | CONFIG_EXT2_FS=y |
| 156 | CONFIG_EXT2_FS_XATTR=y | 152 | CONFIG_EXT2_FS_XATTR=y |
| @@ -164,7 +160,6 @@ CONFIG_REISERFS_FS_XATTR=y | |||
| 164 | CONFIG_REISERFS_FS_POSIX_ACL=y | 160 | CONFIG_REISERFS_FS_POSIX_ACL=y |
| 165 | CONFIG_REISERFS_FS_SECURITY=y | 161 | CONFIG_REISERFS_FS_SECURITY=y |
| 166 | CONFIG_XFS_FS=y | 162 | CONFIG_XFS_FS=y |
| 167 | CONFIG_AUTOFS_FS=m | ||
| 168 | CONFIG_AUTOFS4_FS=m | 163 | CONFIG_AUTOFS4_FS=m |
| 169 | CONFIG_ISO9660_FS=m | 164 | CONFIG_ISO9660_FS=m |
| 170 | CONFIG_JOLIET=y | 165 | CONFIG_JOLIET=y |
| @@ -175,16 +170,10 @@ CONFIG_PROC_KCORE=y | |||
| 175 | CONFIG_TMPFS=y | 170 | CONFIG_TMPFS=y |
| 176 | CONFIG_HUGETLBFS=y | 171 | CONFIG_HUGETLBFS=y |
| 177 | CONFIG_NFS_FS=m | 172 | CONFIG_NFS_FS=m |
| 178 | CONFIG_NFS_V3=y | 173 | CONFIG_NFS_V4=m |
| 179 | CONFIG_NFS_V4=y | ||
| 180 | CONFIG_NFSD=m | 174 | CONFIG_NFSD=m |
| 181 | CONFIG_NFSD_V4=y | 175 | CONFIG_NFSD_V4=y |
| 182 | CONFIG_SMB_FS=m | ||
| 183 | CONFIG_SMB_NLS_DEFAULT=y | ||
| 184 | CONFIG_CIFS=m | 176 | CONFIG_CIFS=m |
| 185 | CONFIG_PARTITION_ADVANCED=y | ||
| 186 | CONFIG_SGI_PARTITION=y | ||
| 187 | CONFIG_EFI_PARTITION=y | ||
| 188 | CONFIG_NLS_CODEPAGE_437=y | 177 | CONFIG_NLS_CODEPAGE_437=y |
| 189 | CONFIG_NLS_CODEPAGE_737=m | 178 | CONFIG_NLS_CODEPAGE_737=m |
| 190 | CONFIG_NLS_CODEPAGE_775=m | 179 | CONFIG_NLS_CODEPAGE_775=m |
| @@ -225,11 +214,7 @@ CONFIG_NLS_UTF8=m | |||
| 225 | CONFIG_MAGIC_SYSRQ=y | 214 | CONFIG_MAGIC_SYSRQ=y |
| 226 | CONFIG_DEBUG_KERNEL=y | 215 | CONFIG_DEBUG_KERNEL=y |
| 227 | CONFIG_DEBUG_MUTEXES=y | 216 | CONFIG_DEBUG_MUTEXES=y |
| 228 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 229 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
| 230 | CONFIG_CRYPTO_ECB=m | ||
| 231 | CONFIG_CRYPTO_PCBC=m | 217 | CONFIG_CRYPTO_PCBC=m |
| 232 | CONFIG_CRYPTO_MD5=y | 218 | CONFIG_CRYPTO_MD5=y |
| 233 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 219 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
| 234 | CONFIG_CRC_T10DIF=y | 220 | CONFIG_CRC_T10DIF=y |
| 235 | CONFIG_INTEL_IOMMU=y | ||
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig index d663efd1e4db..5b4fcdd51457 100644 --- a/arch/ia64/configs/gensparse_defconfig +++ b/arch/ia64/configs/gensparse_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
| 4 | CONFIG_IKCONFIG=y | 3 | CONFIG_IKCONFIG=y |
| @@ -9,6 +8,8 @@ CONFIG_KALLSYMS_ALL=y | |||
| 9 | CONFIG_MODULES=y | 8 | CONFIG_MODULES=y |
| 10 | CONFIG_MODULE_UNLOAD=y | 9 | CONFIG_MODULE_UNLOAD=y |
| 11 | CONFIG_MODVERSIONS=y | 10 | CONFIG_MODVERSIONS=y |
| 11 | CONFIG_PARTITION_ADVANCED=y | ||
| 12 | CONFIG_SGI_PARTITION=y | ||
| 12 | CONFIG_MCKINLEY=y | 13 | CONFIG_MCKINLEY=y |
| 13 | CONFIG_IA64_CYCLONE=y | 14 | CONFIG_IA64_CYCLONE=y |
| 14 | CONFIG_SMP=y | 15 | CONFIG_SMP=y |
| @@ -24,14 +25,12 @@ CONFIG_BINFMT_MISC=m | |||
| 24 | CONFIG_ACPI_BUTTON=m | 25 | CONFIG_ACPI_BUTTON=m |
| 25 | CONFIG_ACPI_FAN=m | 26 | CONFIG_ACPI_FAN=m |
| 26 | CONFIG_ACPI_PROCESSOR=m | 27 | CONFIG_ACPI_PROCESSOR=m |
| 27 | CONFIG_ACPI_CONTAINER=m | ||
| 28 | CONFIG_HOTPLUG_PCI=y | 28 | CONFIG_HOTPLUG_PCI=y |
| 29 | CONFIG_HOTPLUG_PCI_ACPI=m | 29 | CONFIG_NET=y |
| 30 | CONFIG_PACKET=y | 30 | CONFIG_PACKET=y |
| 31 | CONFIG_UNIX=y | 31 | CONFIG_UNIX=y |
| 32 | CONFIG_INET=y | 32 | CONFIG_INET=y |
| 33 | CONFIG_IP_MULTICAST=y | 33 | CONFIG_IP_MULTICAST=y |
| 34 | CONFIG_ARPD=y | ||
| 35 | CONFIG_SYN_COOKIES=y | 34 | CONFIG_SYN_COOKIES=y |
| 36 | # CONFIG_IPV6 is not set | 35 | # CONFIG_IPV6 is not set |
| 37 | CONFIG_BLK_DEV_LOOP=m | 36 | CONFIG_BLK_DEV_LOOP=m |
| @@ -71,15 +70,12 @@ CONFIG_FUSION_SPI=y | |||
| 71 | CONFIG_FUSION_FC=m | 70 | CONFIG_FUSION_FC=m |
| 72 | CONFIG_NETDEVICES=y | 71 | CONFIG_NETDEVICES=y |
| 73 | CONFIG_DUMMY=m | 72 | CONFIG_DUMMY=m |
| 74 | CONFIG_NET_ETHERNET=y | 73 | CONFIG_NETCONSOLE=y |
| 74 | CONFIG_TIGON3=y | ||
| 75 | CONFIG_NET_TULIP=y | 75 | CONFIG_NET_TULIP=y |
| 76 | CONFIG_TULIP=m | 76 | CONFIG_TULIP=m |
| 77 | CONFIG_NET_PCI=y | ||
| 78 | CONFIG_NET_VENDOR_INTEL=y | ||
| 79 | CONFIG_E100=m | 77 | CONFIG_E100=m |
| 80 | CONFIG_E1000=y | 78 | CONFIG_E1000=y |
| 81 | CONFIG_TIGON3=y | ||
| 82 | CONFIG_NETCONSOLE=y | ||
| 83 | # CONFIG_SERIO_SERPORT is not set | 79 | # CONFIG_SERIO_SERPORT is not set |
| 84 | CONFIG_GAMEPORT=m | 80 | CONFIG_GAMEPORT=m |
| 85 | CONFIG_SERIAL_NONSTANDARD=y | 81 | CONFIG_SERIAL_NONSTANDARD=y |
| @@ -146,7 +142,6 @@ CONFIG_REISERFS_FS_XATTR=y | |||
| 146 | CONFIG_REISERFS_FS_POSIX_ACL=y | 142 | CONFIG_REISERFS_FS_POSIX_ACL=y |
| 147 | CONFIG_REISERFS_FS_SECURITY=y | 143 | CONFIG_REISERFS_FS_SECURITY=y |
| 148 | CONFIG_XFS_FS=y | 144 | CONFIG_XFS_FS=y |
| 149 | CONFIG_AUTOFS_FS=y | ||
| 150 | CONFIG_AUTOFS4_FS=y | 145 | CONFIG_AUTOFS4_FS=y |
| 151 | CONFIG_ISO9660_FS=m | 146 | CONFIG_ISO9660_FS=m |
| 152 | CONFIG_JOLIET=y | 147 | CONFIG_JOLIET=y |
| @@ -157,16 +152,10 @@ CONFIG_PROC_KCORE=y | |||
| 157 | CONFIG_TMPFS=y | 152 | CONFIG_TMPFS=y |
| 158 | CONFIG_HUGETLBFS=y | 153 | CONFIG_HUGETLBFS=y |
| 159 | CONFIG_NFS_FS=m | 154 | CONFIG_NFS_FS=m |
| 160 | CONFIG_NFS_V3=y | 155 | CONFIG_NFS_V4=m |
| 161 | CONFIG_NFS_V4=y | ||
| 162 | CONFIG_NFSD=m | 156 | CONFIG_NFSD=m |
| 163 | CONFIG_NFSD_V4=y | 157 | CONFIG_NFSD_V4=y |
| 164 | CONFIG_SMB_FS=m | ||
| 165 | CONFIG_SMB_NLS_DEFAULT=y | ||
| 166 | CONFIG_CIFS=m | 158 | CONFIG_CIFS=m |
| 167 | CONFIG_PARTITION_ADVANCED=y | ||
| 168 | CONFIG_SGI_PARTITION=y | ||
| 169 | CONFIG_EFI_PARTITION=y | ||
| 170 | CONFIG_NLS_CODEPAGE_437=y | 159 | CONFIG_NLS_CODEPAGE_437=y |
| 171 | CONFIG_NLS_CODEPAGE_737=m | 160 | CONFIG_NLS_CODEPAGE_737=m |
| 172 | CONFIG_NLS_CODEPAGE_775=m | 161 | CONFIG_NLS_CODEPAGE_775=m |
diff --git a/arch/ia64/configs/sim_defconfig b/arch/ia64/configs/sim_defconfig index b4548a3e82d5..f0f69fdbddae 100644 --- a/arch/ia64/configs/sim_defconfig +++ b/arch/ia64/configs/sim_defconfig | |||
| @@ -1,13 +1,12 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_IKCONFIG=y | 2 | CONFIG_IKCONFIG=y |
| 4 | CONFIG_IKCONFIG_PROC=y | 3 | CONFIG_IKCONFIG_PROC=y |
| 5 | CONFIG_LOG_BUF_SHIFT=16 | 4 | CONFIG_LOG_BUF_SHIFT=16 |
| 6 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
| 7 | CONFIG_MODULES=y | 5 | CONFIG_MODULES=y |
| 8 | CONFIG_MODULE_UNLOAD=y | 6 | CONFIG_MODULE_UNLOAD=y |
| 9 | CONFIG_MODULE_FORCE_UNLOAD=y | 7 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 10 | CONFIG_MODVERSIONS=y | 8 | CONFIG_MODVERSIONS=y |
| 9 | CONFIG_PARTITION_ADVANCED=y | ||
| 11 | CONFIG_IA64_HP_SIM=y | 10 | CONFIG_IA64_HP_SIM=y |
| 12 | CONFIG_MCKINLEY=y | 11 | CONFIG_MCKINLEY=y |
| 13 | CONFIG_IA64_PAGE_SIZE_64KB=y | 12 | CONFIG_IA64_PAGE_SIZE_64KB=y |
| @@ -27,7 +26,6 @@ CONFIG_BLK_DEV_LOOP=y | |||
| 27 | CONFIG_BLK_DEV_RAM=y | 26 | CONFIG_BLK_DEV_RAM=y |
| 28 | CONFIG_SCSI=y | 27 | CONFIG_SCSI=y |
| 29 | CONFIG_BLK_DEV_SD=y | 28 | CONFIG_BLK_DEV_SD=y |
| 30 | CONFIG_SCSI_MULTI_LUN=y | ||
| 31 | CONFIG_SCSI_CONSTANTS=y | 29 | CONFIG_SCSI_CONSTANTS=y |
| 32 | CONFIG_SCSI_LOGGING=y | 30 | CONFIG_SCSI_LOGGING=y |
| 33 | CONFIG_SCSI_SPI_ATTRS=y | 31 | CONFIG_SCSI_SPI_ATTRS=y |
| @@ -49,8 +47,6 @@ CONFIG_HUGETLBFS=y | |||
| 49 | CONFIG_NFS_FS=y | 47 | CONFIG_NFS_FS=y |
| 50 | CONFIG_NFSD=y | 48 | CONFIG_NFSD=y |
| 51 | CONFIG_NFSD_V3=y | 49 | CONFIG_NFSD_V3=y |
| 52 | CONFIG_PARTITION_ADVANCED=y | 50 | CONFIG_DEBUG_INFO=y |
| 53 | CONFIG_EFI_PARTITION=y | ||
| 54 | CONFIG_DEBUG_KERNEL=y | 51 | CONFIG_DEBUG_KERNEL=y |
| 55 | CONFIG_DEBUG_MUTEXES=y | 52 | CONFIG_DEBUG_MUTEXES=y |
| 56 | CONFIG_DEBUG_INFO=y | ||
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig index c8a3f40e77f6..192ed157c9ce 100644 --- a/arch/ia64/configs/tiger_defconfig +++ b/arch/ia64/configs/tiger_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
| 4 | CONFIG_IKCONFIG=y | 3 | CONFIG_IKCONFIG=y |
| @@ -11,6 +10,8 @@ CONFIG_MODULE_UNLOAD=y | |||
| 11 | CONFIG_MODVERSIONS=y | 10 | CONFIG_MODVERSIONS=y |
| 12 | CONFIG_MODULE_SRCVERSION_ALL=y | 11 | CONFIG_MODULE_SRCVERSION_ALL=y |
| 13 | # CONFIG_BLK_DEV_BSG is not set | 12 | # CONFIG_BLK_DEV_BSG is not set |
| 13 | CONFIG_PARTITION_ADVANCED=y | ||
| 14 | CONFIG_SGI_PARTITION=y | ||
| 14 | CONFIG_IA64_DIG=y | 15 | CONFIG_IA64_DIG=y |
| 15 | CONFIG_MCKINLEY=y | 16 | CONFIG_MCKINLEY=y |
| 16 | CONFIG_IA64_PAGE_SIZE_64KB=y | 17 | CONFIG_IA64_PAGE_SIZE_64KB=y |
| @@ -29,14 +30,12 @@ CONFIG_BINFMT_MISC=m | |||
| 29 | CONFIG_ACPI_BUTTON=m | 30 | CONFIG_ACPI_BUTTON=m |
| 30 | CONFIG_ACPI_FAN=m | 31 | CONFIG_ACPI_FAN=m |
| 31 | CONFIG_ACPI_PROCESSOR=m | 32 | CONFIG_ACPI_PROCESSOR=m |
| 32 | CONFIG_ACPI_CONTAINER=m | ||
| 33 | CONFIG_HOTPLUG_PCI=y | 33 | CONFIG_HOTPLUG_PCI=y |
| 34 | CONFIG_HOTPLUG_PCI_ACPI=m | 34 | CONFIG_NET=y |
| 35 | CONFIG_PACKET=y | 35 | CONFIG_PACKET=y |
| 36 | CONFIG_UNIX=y | 36 | CONFIG_UNIX=y |
| 37 | CONFIG_INET=y | 37 | CONFIG_INET=y |
| 38 | CONFIG_IP_MULTICAST=y | 38 | CONFIG_IP_MULTICAST=y |
| 39 | CONFIG_ARPD=y | ||
| 40 | CONFIG_SYN_COOKIES=y | 39 | CONFIG_SYN_COOKIES=y |
| 41 | # CONFIG_IPV6 is not set | 40 | # CONFIG_IPV6 is not set |
| 42 | CONFIG_BLK_DEV_LOOP=m | 41 | CONFIG_BLK_DEV_LOOP=m |
| @@ -53,6 +52,7 @@ CONFIG_BLK_DEV_SD=y | |||
| 53 | CONFIG_CHR_DEV_ST=m | 52 | CONFIG_CHR_DEV_ST=m |
| 54 | CONFIG_BLK_DEV_SR=m | 53 | CONFIG_BLK_DEV_SR=m |
| 55 | CONFIG_CHR_DEV_SG=m | 54 | CONFIG_CHR_DEV_SG=m |
| 55 | CONFIG_SCSI_FC_ATTRS=y | ||
| 56 | CONFIG_SCSI_SYM53C8XX_2=y | 56 | CONFIG_SCSI_SYM53C8XX_2=y |
| 57 | CONFIG_SCSI_QLOGIC_1280=y | 57 | CONFIG_SCSI_QLOGIC_1280=y |
| 58 | CONFIG_MD=y | 58 | CONFIG_MD=y |
| @@ -72,15 +72,12 @@ CONFIG_FUSION_FC=y | |||
| 72 | CONFIG_FUSION_CTL=y | 72 | CONFIG_FUSION_CTL=y |
| 73 | CONFIG_NETDEVICES=y | 73 | CONFIG_NETDEVICES=y |
| 74 | CONFIG_DUMMY=m | 74 | CONFIG_DUMMY=m |
| 75 | CONFIG_NET_ETHERNET=y | 75 | CONFIG_NETCONSOLE=y |
| 76 | CONFIG_TIGON3=y | ||
| 76 | CONFIG_NET_TULIP=y | 77 | CONFIG_NET_TULIP=y |
| 77 | CONFIG_TULIP=m | 78 | CONFIG_TULIP=m |
| 78 | CONFIG_NET_PCI=y | ||
| 79 | CONFIG_NET_VENDOR_INTEL=y | ||
| 80 | CONFIG_E100=m | 79 | CONFIG_E100=m |
| 81 | CONFIG_E1000=y | 80 | CONFIG_E1000=y |
| 82 | CONFIG_TIGON3=y | ||
| 83 | CONFIG_NETCONSOLE=y | ||
| 84 | # CONFIG_SERIO_SERPORT is not set | 81 | # CONFIG_SERIO_SERPORT is not set |
| 85 | CONFIG_GAMEPORT=m | 82 | CONFIG_GAMEPORT=m |
| 86 | CONFIG_SERIAL_NONSTANDARD=y | 83 | CONFIG_SERIAL_NONSTANDARD=y |
| @@ -118,7 +115,6 @@ CONFIG_REISERFS_FS_XATTR=y | |||
| 118 | CONFIG_REISERFS_FS_POSIX_ACL=y | 115 | CONFIG_REISERFS_FS_POSIX_ACL=y |
| 119 | CONFIG_REISERFS_FS_SECURITY=y | 116 | CONFIG_REISERFS_FS_SECURITY=y |
| 120 | CONFIG_XFS_FS=y | 117 | CONFIG_XFS_FS=y |
| 121 | CONFIG_AUTOFS_FS=y | ||
| 122 | CONFIG_AUTOFS4_FS=y | 118 | CONFIG_AUTOFS4_FS=y |
| 123 | CONFIG_ISO9660_FS=m | 119 | CONFIG_ISO9660_FS=m |
| 124 | CONFIG_JOLIET=y | 120 | CONFIG_JOLIET=y |
| @@ -129,16 +125,10 @@ CONFIG_PROC_KCORE=y | |||
| 129 | CONFIG_TMPFS=y | 125 | CONFIG_TMPFS=y |
| 130 | CONFIG_HUGETLBFS=y | 126 | CONFIG_HUGETLBFS=y |
| 131 | CONFIG_NFS_FS=m | 127 | CONFIG_NFS_FS=m |
| 132 | CONFIG_NFS_V3=y | 128 | CONFIG_NFS_V4=m |
| 133 | CONFIG_NFS_V4=y | ||
| 134 | CONFIG_NFSD=m | 129 | CONFIG_NFSD=m |
| 135 | CONFIG_NFSD_V4=y | 130 | CONFIG_NFSD_V4=y |
| 136 | CONFIG_SMB_FS=m | ||
| 137 | CONFIG_SMB_NLS_DEFAULT=y | ||
| 138 | CONFIG_CIFS=m | 131 | CONFIG_CIFS=m |
| 139 | CONFIG_PARTITION_ADVANCED=y | ||
| 140 | CONFIG_SGI_PARTITION=y | ||
| 141 | CONFIG_EFI_PARTITION=y | ||
| 142 | CONFIG_NLS_CODEPAGE_437=y | 132 | CONFIG_NLS_CODEPAGE_437=y |
| 143 | CONFIG_NLS_CODEPAGE_737=m | 133 | CONFIG_NLS_CODEPAGE_737=m |
| 144 | CONFIG_NLS_CODEPAGE_775=m | 134 | CONFIG_NLS_CODEPAGE_775=m |
| @@ -180,6 +170,5 @@ CONFIG_MAGIC_SYSRQ=y | |||
| 180 | CONFIG_DEBUG_KERNEL=y | 170 | CONFIG_DEBUG_KERNEL=y |
| 181 | CONFIG_DEBUG_MUTEXES=y | 171 | CONFIG_DEBUG_MUTEXES=y |
| 182 | CONFIG_IA64_GRANULE_16MB=y | 172 | CONFIG_IA64_GRANULE_16MB=y |
| 183 | CONFIG_CRYPTO_ECB=m | ||
| 184 | CONFIG_CRYPTO_PCBC=m | 173 | CONFIG_CRYPTO_PCBC=m |
| 185 | CONFIG_CRYPTO_MD5=y | 174 | CONFIG_CRYPTO_MD5=y |
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig index 54bc72eda30d..b504c8e2fd52 100644 --- a/arch/ia64/configs/zx1_defconfig +++ b/arch/ia64/configs/zx1_defconfig | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_BSD_PROCESS_ACCT=y | 2 | CONFIG_BSD_PROCESS_ACCT=y |
| 4 | CONFIG_BLK_DEV_INITRD=y | 3 | CONFIG_BLK_DEV_INITRD=y |
| 5 | CONFIG_KPROBES=y | 4 | CONFIG_KPROBES=y |
| 6 | CONFIG_MODULES=y | 5 | CONFIG_MODULES=y |
| 6 | CONFIG_PARTITION_ADVANCED=y | ||
| 7 | CONFIG_IA64_HP_ZX1=y | 7 | CONFIG_IA64_HP_ZX1=y |
| 8 | CONFIG_MCKINLEY=y | 8 | CONFIG_MCKINLEY=y |
| 9 | CONFIG_SMP=y | 9 | CONFIG_SMP=y |
| @@ -18,6 +18,7 @@ CONFIG_EFI_VARS=y | |||
| 18 | CONFIG_BINFMT_MISC=y | 18 | CONFIG_BINFMT_MISC=y |
| 19 | CONFIG_HOTPLUG_PCI=y | 19 | CONFIG_HOTPLUG_PCI=y |
| 20 | CONFIG_HOTPLUG_PCI_ACPI=y | 20 | CONFIG_HOTPLUG_PCI_ACPI=y |
| 21 | CONFIG_NET=y | ||
| 21 | CONFIG_PACKET=y | 22 | CONFIG_PACKET=y |
| 22 | CONFIG_UNIX=y | 23 | CONFIG_UNIX=y |
| 23 | CONFIG_INET=y | 24 | CONFIG_INET=y |
| @@ -37,9 +38,9 @@ CONFIG_CHR_DEV_OSST=y | |||
| 37 | CONFIG_BLK_DEV_SR=y | 38 | CONFIG_BLK_DEV_SR=y |
| 38 | CONFIG_BLK_DEV_SR_VENDOR=y | 39 | CONFIG_BLK_DEV_SR_VENDOR=y |
| 39 | CONFIG_CHR_DEV_SG=y | 40 | CONFIG_CHR_DEV_SG=y |
| 40 | CONFIG_SCSI_MULTI_LUN=y | ||
| 41 | CONFIG_SCSI_CONSTANTS=y | 41 | CONFIG_SCSI_CONSTANTS=y |
| 42 | CONFIG_SCSI_LOGGING=y | 42 | CONFIG_SCSI_LOGGING=y |
| 43 | CONFIG_SCSI_FC_ATTRS=y | ||
| 43 | CONFIG_SCSI_SYM53C8XX_2=y | 44 | CONFIG_SCSI_SYM53C8XX_2=y |
| 44 | CONFIG_SCSI_QLOGIC_1280=y | 45 | CONFIG_SCSI_QLOGIC_1280=y |
| 45 | CONFIG_FUSION=y | 46 | CONFIG_FUSION=y |
| @@ -48,18 +49,15 @@ CONFIG_FUSION_FC=y | |||
| 48 | CONFIG_FUSION_CTL=m | 49 | CONFIG_FUSION_CTL=m |
| 49 | CONFIG_NETDEVICES=y | 50 | CONFIG_NETDEVICES=y |
| 50 | CONFIG_DUMMY=y | 51 | CONFIG_DUMMY=y |
| 51 | CONFIG_NET_ETHERNET=y | 52 | CONFIG_TIGON3=y |
| 52 | CONFIG_NET_TULIP=y | 53 | CONFIG_NET_TULIP=y |
| 53 | CONFIG_TULIP=y | 54 | CONFIG_TULIP=y |
| 54 | CONFIG_TULIP_MWI=y | 55 | CONFIG_TULIP_MWI=y |
| 55 | CONFIG_TULIP_MMIO=y | 56 | CONFIG_TULIP_MMIO=y |
| 56 | CONFIG_TULIP_NAPI=y | 57 | CONFIG_TULIP_NAPI=y |
| 57 | CONFIG_TULIP_NAPI_HW_MITIGATION=y | 58 | CONFIG_TULIP_NAPI_HW_MITIGATION=y |
| 58 | CONFIG_NET_PCI=y | ||
| 59 | CONFIG_NET_VENDOR_INTEL=y | ||
| 60 | CONFIG_E100=y | 59 | CONFIG_E100=y |
| 61 | CONFIG_E1000=y | 60 | CONFIG_E1000=y |
| 62 | CONFIG_TIGON3=y | ||
| 63 | CONFIG_INPUT_JOYDEV=y | 61 | CONFIG_INPUT_JOYDEV=y |
| 64 | CONFIG_INPUT_EVDEV=y | 62 | CONFIG_INPUT_EVDEV=y |
| 65 | # CONFIG_INPUT_KEYBOARD is not set | 63 | # CONFIG_INPUT_KEYBOARD is not set |
| @@ -100,7 +98,6 @@ CONFIG_USB_STORAGE=y | |||
| 100 | CONFIG_EXT2_FS=y | 98 | CONFIG_EXT2_FS=y |
| 101 | CONFIG_EXT2_FS_XATTR=y | 99 | CONFIG_EXT2_FS_XATTR=y |
| 102 | CONFIG_EXT3_FS=y | 100 | CONFIG_EXT3_FS=y |
| 103 | CONFIG_AUTOFS_FS=y | ||
| 104 | CONFIG_ISO9660_FS=y | 101 | CONFIG_ISO9660_FS=y |
| 105 | CONFIG_JOLIET=y | 102 | CONFIG_JOLIET=y |
| 106 | CONFIG_UDF_FS=y | 103 | CONFIG_UDF_FS=y |
| @@ -110,12 +107,9 @@ CONFIG_PROC_KCORE=y | |||
| 110 | CONFIG_TMPFS=y | 107 | CONFIG_TMPFS=y |
| 111 | CONFIG_HUGETLBFS=y | 108 | CONFIG_HUGETLBFS=y |
| 112 | CONFIG_NFS_FS=y | 109 | CONFIG_NFS_FS=y |
| 113 | CONFIG_NFS_V3=y | ||
| 114 | CONFIG_NFS_V4=y | 110 | CONFIG_NFS_V4=y |
| 115 | CONFIG_NFSD=y | 111 | CONFIG_NFSD=y |
| 116 | CONFIG_NFSD_V3=y | 112 | CONFIG_NFSD_V3=y |
| 117 | CONFIG_PARTITION_ADVANCED=y | ||
| 118 | CONFIG_EFI_PARTITION=y | ||
| 119 | CONFIG_NLS_CODEPAGE_437=y | 113 | CONFIG_NLS_CODEPAGE_437=y |
| 120 | CONFIG_NLS_CODEPAGE_737=y | 114 | CONFIG_NLS_CODEPAGE_737=y |
| 121 | CONFIG_NLS_CODEPAGE_775=y | 115 | CONFIG_NLS_CODEPAGE_775=y |
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 571aab064936..f42e35e42790 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | */ | 53 | */ |
| 54 | unsigned long empty_zero_page, zero_page_mask; | 54 | unsigned long empty_zero_page, zero_page_mask; |
| 55 | EXPORT_SYMBOL_GPL(empty_zero_page); | 55 | EXPORT_SYMBOL_GPL(empty_zero_page); |
| 56 | EXPORT_SYMBOL(zero_page_mask); | ||
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| 58 | * Not static inline because used by IP27 special magic initialization code | 59 | * Not static inline because used by IP27 special magic initialization code |
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 7187664034c3..5db8882f732c 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile | |||
| @@ -48,7 +48,12 @@ cflags-y := -pipe | |||
| 48 | 48 | ||
| 49 | # These flags should be implied by an hppa-linux configuration, but they | 49 | # These flags should be implied by an hppa-linux configuration, but they |
| 50 | # are not in gcc 3.2. | 50 | # are not in gcc 3.2. |
| 51 | cflags-y += -mno-space-regs -mfast-indirect-calls | 51 | cflags-y += -mno-space-regs |
| 52 | |||
| 53 | # -mfast-indirect-calls is only relevant for 32-bit kernels. | ||
| 54 | ifndef CONFIG_64BIT | ||
| 55 | cflags-y += -mfast-indirect-calls | ||
| 56 | endif | ||
| 52 | 57 | ||
| 53 | # Currently we save and restore fpregs on all kernel entry/interruption paths. | 58 | # Currently we save and restore fpregs on all kernel entry/interruption paths. |
| 54 | # If that gets optimized, we might need to disable the use of fpregs in the | 59 | # If that gets optimized, we might need to disable the use of fpregs in the |
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 3bab72462ab5..92438c21d453 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/user.h> | 17 | #include <linux/user.h> |
| 18 | #include <linux/personality.h> | 18 | #include <linux/personality.h> |
| 19 | #include <linux/security.h> | 19 | #include <linux/security.h> |
| 20 | #include <linux/seccomp.h> | ||
| 20 | #include <linux/compat.h> | 21 | #include <linux/compat.h> |
| 21 | #include <linux/signal.h> | 22 | #include <linux/signal.h> |
| 22 | #include <linux/audit.h> | 23 | #include <linux/audit.h> |
| @@ -271,10 +272,7 @@ long do_syscall_trace_enter(struct pt_regs *regs) | |||
| 271 | long ret = 0; | 272 | long ret = 0; |
| 272 | 273 | ||
| 273 | /* Do the secure computing check first. */ | 274 | /* Do the secure computing check first. */ |
| 274 | if (secure_computing(regs->gr[20])) { | 275 | secure_computing_strict(regs->gr[20]); |
| 275 | /* seccomp failures shouldn't expose any additional code. */ | ||
| 276 | return -1; | ||
| 277 | } | ||
| 278 | 276 | ||
| 279 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | 277 | if (test_thread_flag(TIF_SYSCALL_TRACE) && |
| 280 | tracehook_report_syscall_entry(regs)) | 278 | tracehook_report_syscall_entry(regs)) |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 0c1073ed1e84..c7235e01fd67 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
| @@ -43,6 +43,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); | |||
| 43 | 43 | ||
| 44 | unsigned long empty_zero_page, zero_page_mask; | 44 | unsigned long empty_zero_page, zero_page_mask; |
| 45 | EXPORT_SYMBOL(empty_zero_page); | 45 | EXPORT_SYMBOL(empty_zero_page); |
| 46 | EXPORT_SYMBOL(zero_page_mask); | ||
| 46 | 47 | ||
| 47 | static void __init setup_zero_pages(void) | 48 | static void __init setup_zero_pages(void) |
| 48 | { | 49 | { |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 1f76c22a6a75..51ae87b483e0 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
| @@ -234,12 +234,18 @@ do { BUILD_BUG_ON(FIELD_SIZEOF(STRUCT, FIELD) != sizeof(u8)); \ | |||
| 234 | __emit_load8(BASE, STRUCT, FIELD, DEST); \ | 234 | __emit_load8(BASE, STRUCT, FIELD, DEST); \ |
| 235 | } while (0) | 235 | } while (0) |
| 236 | 236 | ||
| 237 | #define emit_ldmem(OFF, DEST) \ | 237 | #ifdef CONFIG_SPARC64 |
| 238 | do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(DEST); \ | 238 | #define BIAS (STACK_BIAS - 4) |
| 239 | #else | ||
| 240 | #define BIAS (-4) | ||
| 241 | #endif | ||
| 242 | |||
| 243 | #define emit_ldmem(OFF, DEST) \ | ||
| 244 | do { *prog++ = LD32I | RS1(SP) | S13(BIAS - (OFF)) | RD(DEST); \ | ||
| 239 | } while (0) | 245 | } while (0) |
| 240 | 246 | ||
| 241 | #define emit_stmem(OFF, SRC) \ | 247 | #define emit_stmem(OFF, SRC) \ |
| 242 | do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(SRC); \ | 248 | do { *prog++ = ST32I | RS1(SP) | S13(BIAS - (OFF)) | RD(SRC); \ |
| 243 | } while (0) | 249 | } while (0) |
| 244 | 250 | ||
| 245 | #ifdef CONFIG_SMP | 251 | #ifdef CONFIG_SMP |
| @@ -615,10 +621,11 @@ void bpf_jit_compile(struct bpf_prog *fp) | |||
| 615 | case BPF_ANC | SKF_AD_VLAN_TAG: | 621 | case BPF_ANC | SKF_AD_VLAN_TAG: |
| 616 | case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT: | 622 | case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT: |
| 617 | emit_skb_load16(vlan_tci, r_A); | 623 | emit_skb_load16(vlan_tci, r_A); |
| 618 | if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) { | 624 | if (code != (BPF_ANC | SKF_AD_VLAN_TAG)) { |
| 619 | emit_andi(r_A, VLAN_VID_MASK, r_A); | 625 | emit_alu_K(SRL, 12); |
| 626 | emit_andi(r_A, 1, r_A); | ||
| 620 | } else { | 627 | } else { |
| 621 | emit_loadimm(VLAN_TAG_PRESENT, r_TMP); | 628 | emit_loadimm(~VLAN_TAG_PRESENT, r_TMP); |
| 622 | emit_and(r_A, r_TMP, r_A); | 629 | emit_and(r_A, r_TMP, r_A); |
| 623 | } | 630 | } |
| 624 | break; | 631 | break; |
| @@ -630,15 +637,19 @@ void bpf_jit_compile(struct bpf_prog *fp) | |||
| 630 | emit_loadimm(K, r_X); | 637 | emit_loadimm(K, r_X); |
| 631 | break; | 638 | break; |
| 632 | case BPF_LD | BPF_MEM: | 639 | case BPF_LD | BPF_MEM: |
| 640 | seen |= SEEN_MEM; | ||
| 633 | emit_ldmem(K * 4, r_A); | 641 | emit_ldmem(K * 4, r_A); |
| 634 | break; | 642 | break; |
| 635 | case BPF_LDX | BPF_MEM: | 643 | case BPF_LDX | BPF_MEM: |
| 644 | seen |= SEEN_MEM | SEEN_XREG; | ||
| 636 | emit_ldmem(K * 4, r_X); | 645 | emit_ldmem(K * 4, r_X); |
| 637 | break; | 646 | break; |
| 638 | case BPF_ST: | 647 | case BPF_ST: |
| 648 | seen |= SEEN_MEM; | ||
| 639 | emit_stmem(K * 4, r_A); | 649 | emit_stmem(K * 4, r_A); |
| 640 | break; | 650 | break; |
| 641 | case BPF_STX: | 651 | case BPF_STX: |
| 652 | seen |= SEEN_MEM | SEEN_XREG; | ||
| 642 | emit_stmem(K * 4, r_X); | 653 | emit_stmem(K * 4, r_X); |
| 643 | break; | 654 | break; |
| 644 | 655 | ||
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index d6b8aa4c986c..cbed1407a5cd 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
| @@ -30,33 +30,6 @@ | |||
| 30 | #include <asm/boot.h> | 30 | #include <asm/boot.h> |
| 31 | #include <asm/asm-offsets.h> | 31 | #include <asm/asm-offsets.h> |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * Adjust our own GOT | ||
| 35 | * | ||
| 36 | * The relocation base must be in %ebx | ||
| 37 | * | ||
| 38 | * It is safe to call this macro more than once, because in some of the | ||
| 39 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
| 40 | * entry points. | ||
| 41 | * | ||
| 42 | * Relocation is only performed the first time. | ||
| 43 | */ | ||
| 44 | .macro FIXUP_GOT | ||
| 45 | cmpb $1, got_fixed(%ebx) | ||
| 46 | je 2f | ||
| 47 | |||
| 48 | leal _got(%ebx), %edx | ||
| 49 | leal _egot(%ebx), %ecx | ||
| 50 | 1: | ||
| 51 | cmpl %ecx, %edx | ||
| 52 | jae 2f | ||
| 53 | addl %ebx, (%edx) | ||
| 54 | addl $4, %edx | ||
| 55 | jmp 1b | ||
| 56 | 2: | ||
| 57 | movb $1, got_fixed(%ebx) | ||
| 58 | .endm | ||
| 59 | |||
| 60 | __HEAD | 33 | __HEAD |
| 61 | ENTRY(startup_32) | 34 | ENTRY(startup_32) |
| 62 | #ifdef CONFIG_EFI_STUB | 35 | #ifdef CONFIG_EFI_STUB |
| @@ -83,9 +56,6 @@ ENTRY(efi_pe_entry) | |||
| 83 | add %esi, 88(%eax) | 56 | add %esi, 88(%eax) |
| 84 | pushl %eax | 57 | pushl %eax |
| 85 | 58 | ||
| 86 | movl %esi, %ebx | ||
| 87 | FIXUP_GOT | ||
| 88 | |||
| 89 | call make_boot_params | 59 | call make_boot_params |
| 90 | cmpl $0, %eax | 60 | cmpl $0, %eax |
| 91 | je fail | 61 | je fail |
| @@ -111,10 +81,6 @@ ENTRY(efi32_stub_entry) | |||
| 111 | leal efi32_config(%esi), %eax | 81 | leal efi32_config(%esi), %eax |
| 112 | add %esi, 88(%eax) | 82 | add %esi, 88(%eax) |
| 113 | pushl %eax | 83 | pushl %eax |
| 114 | |||
| 115 | movl %esi, %ebx | ||
| 116 | FIXUP_GOT | ||
| 117 | |||
| 118 | 2: | 84 | 2: |
| 119 | call efi_main | 85 | call efi_main |
| 120 | cmpl $0, %eax | 86 | cmpl $0, %eax |
| @@ -224,7 +190,19 @@ relocated: | |||
| 224 | shrl $2, %ecx | 190 | shrl $2, %ecx |
| 225 | rep stosl | 191 | rep stosl |
| 226 | 192 | ||
| 227 | FIXUP_GOT | 193 | /* |
| 194 | * Adjust our own GOT | ||
| 195 | */ | ||
| 196 | leal _got(%ebx), %edx | ||
| 197 | leal _egot(%ebx), %ecx | ||
| 198 | 1: | ||
| 199 | cmpl %ecx, %edx | ||
| 200 | jae 2f | ||
| 201 | addl %ebx, (%edx) | ||
| 202 | addl $4, %edx | ||
| 203 | jmp 1b | ||
| 204 | 2: | ||
| 205 | |||
| 228 | /* | 206 | /* |
| 229 | * Do the decompression, and jump to the new kernel.. | 207 | * Do the decompression, and jump to the new kernel.. |
| 230 | */ | 208 | */ |
| @@ -247,12 +225,8 @@ relocated: | |||
| 247 | xorl %ebx, %ebx | 225 | xorl %ebx, %ebx |
| 248 | jmp *%eax | 226 | jmp *%eax |
| 249 | 227 | ||
| 250 | .data | ||
| 251 | /* Have we relocated the GOT? */ | ||
| 252 | got_fixed: | ||
| 253 | .byte 0 | ||
| 254 | |||
| 255 | #ifdef CONFIG_EFI_STUB | 228 | #ifdef CONFIG_EFI_STUB |
| 229 | .data | ||
| 256 | efi32_config: | 230 | efi32_config: |
| 257 | .fill 11,8,0 | 231 | .fill 11,8,0 |
| 258 | .long efi_call_phys | 232 | .long efi_call_phys |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 50f69c7eaaf4..2884e0c3e8a5 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
| @@ -32,33 +32,6 @@ | |||
| 32 | #include <asm/processor-flags.h> | 32 | #include <asm/processor-flags.h> |
| 33 | #include <asm/asm-offsets.h> | 33 | #include <asm/asm-offsets.h> |
| 34 | 34 | ||
| 35 | /* | ||
| 36 | * Adjust our own GOT | ||
| 37 | * | ||
| 38 | * The relocation base must be in %rbx | ||
| 39 | * | ||
| 40 | * It is safe to call this macro more than once, because in some of the | ||
| 41 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
| 42 | * entry points. | ||
| 43 | * | ||
| 44 | * Relocation is only performed the first time. | ||
| 45 | */ | ||
| 46 | .macro FIXUP_GOT | ||
| 47 | cmpb $1, got_fixed(%rip) | ||
| 48 | je 2f | ||
| 49 | |||
| 50 | leaq _got(%rip), %rdx | ||
| 51 | leaq _egot(%rip), %rcx | ||
| 52 | 1: | ||
| 53 | cmpq %rcx, %rdx | ||
| 54 | jae 2f | ||
| 55 | addq %rbx, (%rdx) | ||
| 56 | addq $8, %rdx | ||
| 57 | jmp 1b | ||
| 58 | 2: | ||
| 59 | movb $1, got_fixed(%rip) | ||
| 60 | .endm | ||
| 61 | |||
| 62 | __HEAD | 35 | __HEAD |
| 63 | .code32 | 36 | .code32 |
| 64 | ENTRY(startup_32) | 37 | ENTRY(startup_32) |
| @@ -279,13 +252,10 @@ ENTRY(efi_pe_entry) | |||
| 279 | subq $1b, %rbp | 252 | subq $1b, %rbp |
| 280 | 253 | ||
| 281 | /* | 254 | /* |
| 282 | * Relocate efi_config->call() and the GOT entries. | 255 | * Relocate efi_config->call(). |
| 283 | */ | 256 | */ |
| 284 | addq %rbp, efi64_config+88(%rip) | 257 | addq %rbp, efi64_config+88(%rip) |
| 285 | 258 | ||
| 286 | movq %rbp, %rbx | ||
| 287 | FIXUP_GOT | ||
| 288 | |||
| 289 | movq %rax, %rdi | 259 | movq %rax, %rdi |
| 290 | call make_boot_params | 260 | call make_boot_params |
| 291 | cmpq $0,%rax | 261 | cmpq $0,%rax |
| @@ -301,13 +271,10 @@ handover_entry: | |||
| 301 | subq $1b, %rbp | 271 | subq $1b, %rbp |
| 302 | 272 | ||
| 303 | /* | 273 | /* |
| 304 | * Relocate efi_config->call() and the GOT entries. | 274 | * Relocate efi_config->call(). |
| 305 | */ | 275 | */ |
| 306 | movq efi_config(%rip), %rax | 276 | movq efi_config(%rip), %rax |
| 307 | addq %rbp, 88(%rax) | 277 | addq %rbp, 88(%rax) |
| 308 | |||
| 309 | movq %rbp, %rbx | ||
| 310 | FIXUP_GOT | ||
| 311 | 2: | 278 | 2: |
| 312 | movq efi_config(%rip), %rdi | 279 | movq efi_config(%rip), %rdi |
| 313 | call efi_main | 280 | call efi_main |
| @@ -418,8 +385,19 @@ relocated: | |||
| 418 | shrq $3, %rcx | 385 | shrq $3, %rcx |
| 419 | rep stosq | 386 | rep stosq |
| 420 | 387 | ||
| 421 | FIXUP_GOT | 388 | /* |
| 422 | 389 | * Adjust our own GOT | |
| 390 | */ | ||
| 391 | leaq _got(%rip), %rdx | ||
| 392 | leaq _egot(%rip), %rcx | ||
| 393 | 1: | ||
| 394 | cmpq %rcx, %rdx | ||
| 395 | jae 2f | ||
| 396 | addq %rbx, (%rdx) | ||
| 397 | addq $8, %rdx | ||
| 398 | jmp 1b | ||
| 399 | 2: | ||
| 400 | |||
| 423 | /* | 401 | /* |
| 424 | * Do the decompression, and jump to the new kernel.. | 402 | * Do the decompression, and jump to the new kernel.. |
| 425 | */ | 403 | */ |
| @@ -459,10 +437,6 @@ gdt: | |||
| 459 | .quad 0x0000000000000000 /* TS continued */ | 437 | .quad 0x0000000000000000 /* TS continued */ |
| 460 | gdt_end: | 438 | gdt_end: |
| 461 | 439 | ||
| 462 | /* Have we relocated the GOT? */ | ||
| 463 | got_fixed: | ||
| 464 | .byte 0 | ||
| 465 | |||
| 466 | #ifdef CONFIG_EFI_STUB | 440 | #ifdef CONFIG_EFI_STUB |
| 467 | efi_config: | 441 | efi_config: |
| 468 | .quad 0 | 442 | .quad 0 |
diff --git a/block/blk-exec.c b/block/blk-exec.c index f4d27b12c90b..9924725fa50d 100644 --- a/block/blk-exec.c +++ b/block/blk-exec.c | |||
| @@ -56,6 +56,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, | |||
| 56 | bool is_pm_resume; | 56 | bool is_pm_resume; |
| 57 | 57 | ||
| 58 | WARN_ON(irqs_disabled()); | 58 | WARN_ON(irqs_disabled()); |
| 59 | WARN_ON(rq->cmd_type == REQ_TYPE_FS); | ||
| 59 | 60 | ||
| 60 | rq->rq_disk = bd_disk; | 61 | rq->rq_disk = bd_disk; |
| 61 | rq->end_io = done; | 62 | rq->end_io = done; |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 383ea0cb1f0a..c88e6089746d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -203,7 +203,6 @@ __blk_mq_alloc_request(struct blk_mq_alloc_data *data, int rw) | |||
| 203 | if (tag != BLK_MQ_TAG_FAIL) { | 203 | if (tag != BLK_MQ_TAG_FAIL) { |
| 204 | rq = data->hctx->tags->rqs[tag]; | 204 | rq = data->hctx->tags->rqs[tag]; |
| 205 | 205 | ||
| 206 | rq->cmd_flags = 0; | ||
| 207 | if (blk_mq_tag_busy(data->hctx)) { | 206 | if (blk_mq_tag_busy(data->hctx)) { |
| 208 | rq->cmd_flags = REQ_MQ_INFLIGHT; | 207 | rq->cmd_flags = REQ_MQ_INFLIGHT; |
| 209 | atomic_inc(&data->hctx->nr_active); | 208 | atomic_inc(&data->hctx->nr_active); |
| @@ -258,6 +257,7 @@ static void __blk_mq_free_request(struct blk_mq_hw_ctx *hctx, | |||
| 258 | 257 | ||
| 259 | if (rq->cmd_flags & REQ_MQ_INFLIGHT) | 258 | if (rq->cmd_flags & REQ_MQ_INFLIGHT) |
| 260 | atomic_dec(&hctx->nr_active); | 259 | atomic_dec(&hctx->nr_active); |
| 260 | rq->cmd_flags = 0; | ||
| 261 | 261 | ||
| 262 | clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags); | 262 | clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags); |
| 263 | blk_mq_put_tag(hctx, tag, &ctx->last_tag); | 263 | blk_mq_put_tag(hctx, tag, &ctx->last_tag); |
| @@ -393,6 +393,12 @@ static void blk_mq_start_request(struct request *rq, bool last) | |||
| 393 | blk_add_timer(rq); | 393 | blk_add_timer(rq); |
| 394 | 394 | ||
| 395 | /* | 395 | /* |
| 396 | * Ensure that ->deadline is visible before set the started | ||
| 397 | * flag and clear the completed flag. | ||
| 398 | */ | ||
| 399 | smp_mb__before_atomic(); | ||
| 400 | |||
| 401 | /* | ||
| 396 | * Mark us as started and clear complete. Complete might have been | 402 | * Mark us as started and clear complete. Complete might have been |
| 397 | * set if requeue raced with timeout, which then marked it as | 403 | * set if requeue raced with timeout, which then marked it as |
| 398 | * complete. So be sure to clear complete again when we start | 404 | * complete. So be sure to clear complete again when we start |
| @@ -473,7 +479,11 @@ static void blk_mq_requeue_work(struct work_struct *work) | |||
| 473 | blk_mq_insert_request(rq, false, false, false); | 479 | blk_mq_insert_request(rq, false, false, false); |
| 474 | } | 480 | } |
| 475 | 481 | ||
| 476 | blk_mq_run_queues(q, false); | 482 | /* |
| 483 | * Use the start variant of queue running here, so that running | ||
| 484 | * the requeue work will kick stopped queues. | ||
| 485 | */ | ||
| 486 | blk_mq_start_hw_queues(q); | ||
| 477 | } | 487 | } |
| 478 | 488 | ||
| 479 | void blk_mq_add_to_requeue_list(struct request *rq, bool at_head) | 489 | void blk_mq_add_to_requeue_list(struct request *rq, bool at_head) |
| @@ -957,14 +967,9 @@ void blk_mq_insert_request(struct request *rq, bool at_head, bool run_queue, | |||
| 957 | 967 | ||
| 958 | hctx = q->mq_ops->map_queue(q, ctx->cpu); | 968 | hctx = q->mq_ops->map_queue(q, ctx->cpu); |
| 959 | 969 | ||
| 960 | if (rq->cmd_flags & (REQ_FLUSH | REQ_FUA) && | 970 | spin_lock(&ctx->lock); |
| 961 | !(rq->cmd_flags & (REQ_FLUSH_SEQ))) { | 971 | __blk_mq_insert_request(hctx, rq, at_head); |
| 962 | blk_insert_flush(rq); | 972 | spin_unlock(&ctx->lock); |
| 963 | } else { | ||
| 964 | spin_lock(&ctx->lock); | ||
| 965 | __blk_mq_insert_request(hctx, rq, at_head); | ||
| 966 | spin_unlock(&ctx->lock); | ||
| 967 | } | ||
| 968 | 973 | ||
| 969 | if (run_queue) | 974 | if (run_queue) |
| 970 | blk_mq_run_hw_queue(hctx, async); | 975 | blk_mq_run_hw_queue(hctx, async); |
| @@ -1404,6 +1409,8 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set, | |||
| 1404 | left -= to_do * rq_size; | 1409 | left -= to_do * rq_size; |
| 1405 | for (j = 0; j < to_do; j++) { | 1410 | for (j = 0; j < to_do; j++) { |
| 1406 | tags->rqs[i] = p; | 1411 | tags->rqs[i] = p; |
| 1412 | tags->rqs[i]->atomic_flags = 0; | ||
| 1413 | tags->rqs[i]->cmd_flags = 0; | ||
| 1407 | if (set->ops->init_request) { | 1414 | if (set->ops->init_request) { |
| 1408 | if (set->ops->init_request(set->driver_data, | 1415 | if (set->ops->init_request(set->driver_data, |
| 1409 | tags->rqs[i], hctx_idx, i, | 1416 | tags->rqs[i], hctx_idx, i, |
| @@ -1956,7 +1963,6 @@ out_unwind: | |||
| 1956 | while (--i >= 0) | 1963 | while (--i >= 0) |
| 1957 | blk_mq_free_rq_map(set, set->tags[i], i); | 1964 | blk_mq_free_rq_map(set, set->tags[i], i); |
| 1958 | 1965 | ||
| 1959 | set->tags = NULL; | ||
| 1960 | return -ENOMEM; | 1966 | return -ENOMEM; |
| 1961 | } | 1967 | } |
| 1962 | 1968 | ||
diff --git a/block/genhd.c b/block/genhd.c index 09da5e4a8e03..e6723bd4d7a1 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -445,8 +445,6 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt) | |||
| 445 | */ | 445 | */ |
| 446 | void blk_free_devt(dev_t devt) | 446 | void blk_free_devt(dev_t devt) |
| 447 | { | 447 | { |
| 448 | might_sleep(); | ||
| 449 | |||
| 450 | if (devt == MKDEV(0, 0)) | 448 | if (devt == MKDEV(0, 0)) |
| 451 | return; | 449 | return; |
| 452 | 450 | ||
diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index 0300c46ee247..32f7c1b36204 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c | |||
| @@ -447,7 +447,7 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np, | |||
| 447 | int i; | 447 | int i; |
| 448 | 448 | ||
| 449 | num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells"); | 449 | num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells"); |
| 450 | if (num_parents <= 0 || num_parents > 1) | 450 | if (num_parents != 2) |
| 451 | return; | 451 | return; |
| 452 | 452 | ||
| 453 | for (i = 0; i < num_parents; ++i) { | 453 | for (i = 0; i < num_parents; ++i) { |
diff --git a/drivers/clk/clk-efm32gg.c b/drivers/clk/clk-efm32gg.c index bac2ddf49d02..73a8d0ff530c 100644 --- a/drivers/clk/clk-efm32gg.c +++ b/drivers/clk/clk-efm32gg.c | |||
| @@ -22,7 +22,7 @@ static struct clk_onecell_data clk_data = { | |||
| 22 | .clk_num = ARRAY_SIZE(clk), | 22 | .clk_num = ARRAY_SIZE(clk), |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | static int __init efm32gg_cmu_init(struct device_node *np) | 25 | static void __init efm32gg_cmu_init(struct device_node *np) |
| 26 | { | 26 | { |
| 27 | int i; | 27 | int i; |
| 28 | void __iomem *base; | 28 | void __iomem *base; |
| @@ -33,7 +33,7 @@ static int __init efm32gg_cmu_init(struct device_node *np) | |||
| 33 | base = of_iomap(np, 0); | 33 | base = of_iomap(np, 0); |
| 34 | if (!base) { | 34 | if (!base) { |
| 35 | pr_warn("Failed to map address range for efm32gg,cmu node\n"); | 35 | pr_warn("Failed to map address range for efm32gg,cmu node\n"); |
| 36 | return -EADDRNOTAVAIL; | 36 | return; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | clk[clk_HFXO] = clk_register_fixed_rate(NULL, "HFXO", NULL, | 39 | clk[clk_HFXO] = clk_register_fixed_rate(NULL, "HFXO", NULL, |
| @@ -76,6 +76,6 @@ static int __init efm32gg_cmu_init(struct device_node *np) | |||
| 76 | clk[clk_HFPERCLKDAC0] = clk_register_gate(NULL, "HFPERCLK.DAC0", | 76 | clk[clk_HFPERCLKDAC0] = clk_register_gate(NULL, "HFPERCLK.DAC0", |
| 77 | "HFXO", 0, base + CMU_HFPERCLKEN0, 17, 0, NULL); | 77 | "HFXO", 0, base + CMU_HFPERCLKEN0, 17, 0, NULL); |
| 78 | 78 | ||
| 79 | return of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); | 79 | of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); |
| 80 | } | 80 | } |
| 81 | CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init); | 81 | CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init); |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b76fa69b44cb..bacc06ff939b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
| @@ -1467,6 +1467,7 @@ static struct clk *clk_propagate_rate_change(struct clk *clk, unsigned long even | |||
| 1467 | static void clk_change_rate(struct clk *clk) | 1467 | static void clk_change_rate(struct clk *clk) |
| 1468 | { | 1468 | { |
| 1469 | struct clk *child; | 1469 | struct clk *child; |
| 1470 | struct hlist_node *tmp; | ||
| 1470 | unsigned long old_rate; | 1471 | unsigned long old_rate; |
| 1471 | unsigned long best_parent_rate = 0; | 1472 | unsigned long best_parent_rate = 0; |
| 1472 | bool skip_set_rate = false; | 1473 | bool skip_set_rate = false; |
| @@ -1502,7 +1503,11 @@ static void clk_change_rate(struct clk *clk) | |||
| 1502 | if (clk->notifier_count && old_rate != clk->rate) | 1503 | if (clk->notifier_count && old_rate != clk->rate) |
| 1503 | __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); | 1504 | __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); |
| 1504 | 1505 | ||
| 1505 | hlist_for_each_entry(child, &clk->children, child_node) { | 1506 | /* |
| 1507 | * Use safe iteration, as change_rate can actually swap parents | ||
| 1508 | * for certain clock types. | ||
| 1509 | */ | ||
| 1510 | hlist_for_each_entry_safe(child, tmp, &clk->children, child_node) { | ||
| 1506 | /* Skip children who will be reparented to another clock */ | 1511 | /* Skip children who will be reparented to another clock */ |
| 1507 | if (child->new_parent && child->new_parent != clk) | 1512 | if (child->new_parent && child->new_parent != clk) |
| 1508 | continue; | 1513 | continue; |
diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c index 4032e510d9aa..3b83b7dd78c7 100644 --- a/drivers/clk/qcom/gcc-ipq806x.c +++ b/drivers/clk/qcom/gcc-ipq806x.c | |||
| @@ -1095,7 +1095,7 @@ static struct clk_branch prng_clk = { | |||
| 1095 | }; | 1095 | }; |
| 1096 | 1096 | ||
| 1097 | static const struct freq_tbl clk_tbl_sdc[] = { | 1097 | static const struct freq_tbl clk_tbl_sdc[] = { |
| 1098 | { 144000, P_PXO, 5, 18,625 }, | 1098 | { 200000, P_PXO, 2, 2, 125 }, |
| 1099 | { 400000, P_PLL8, 4, 1, 240 }, | 1099 | { 400000, P_PLL8, 4, 1, 240 }, |
| 1100 | { 16000000, P_PLL8, 4, 1, 6 }, | 1100 | { 16000000, P_PLL8, 4, 1, 6 }, |
| 1101 | { 17070000, P_PLL8, 1, 2, 45 }, | 1101 | { 17070000, P_PLL8, 1, 2, 45 }, |
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c index 0d8c6c59a75e..b22a2d2f21e9 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c | |||
| @@ -545,7 +545,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
| 545 | GATE(PCLK_PWM, "pclk_pwm", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 0, GFLAGS), | 545 | GATE(PCLK_PWM, "pclk_pwm", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 0, GFLAGS), |
| 546 | GATE(PCLK_TIMER, "pclk_timer", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 1, GFLAGS), | 546 | GATE(PCLK_TIMER, "pclk_timer", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 1, GFLAGS), |
| 547 | GATE(PCLK_I2C0, "pclk_i2c0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 2, GFLAGS), | 547 | GATE(PCLK_I2C0, "pclk_i2c0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 2, GFLAGS), |
| 548 | GATE(PCLK_I2C1, "pclk_i2c1", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 3, GFLAGS), | 548 | GATE(PCLK_I2C2, "pclk_i2c2", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 3, GFLAGS), |
| 549 | GATE(0, "pclk_ddrupctl0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 14, GFLAGS), | 549 | GATE(0, "pclk_ddrupctl0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 14, GFLAGS), |
| 550 | GATE(0, "pclk_publ0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 15, GFLAGS), | 550 | GATE(0, "pclk_publ0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 15, GFLAGS), |
| 551 | GATE(0, "pclk_ddrupctl1", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 0, GFLAGS), | 551 | GATE(0, "pclk_ddrupctl1", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 0, GFLAGS), |
| @@ -603,7 +603,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
| 603 | GATE(PCLK_I2C4, "pclk_i2c4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 15, GFLAGS), | 603 | GATE(PCLK_I2C4, "pclk_i2c4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 15, GFLAGS), |
| 604 | GATE(PCLK_UART3, "pclk_uart3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 11, GFLAGS), | 604 | GATE(PCLK_UART3, "pclk_uart3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 11, GFLAGS), |
| 605 | GATE(PCLK_UART4, "pclk_uart4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 12, GFLAGS), | 605 | GATE(PCLK_UART4, "pclk_uart4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 12, GFLAGS), |
| 606 | GATE(PCLK_I2C2, "pclk_i2c2", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 13, GFLAGS), | 606 | GATE(PCLK_I2C1, "pclk_i2c1", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 13, GFLAGS), |
| 607 | GATE(PCLK_I2C3, "pclk_i2c3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 14, GFLAGS), | 607 | GATE(PCLK_I2C3, "pclk_i2c3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 14, GFLAGS), |
| 608 | GATE(PCLK_SARADC, "pclk_saradc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 1, GFLAGS), | 608 | GATE(PCLK_SARADC, "pclk_saradc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 1, GFLAGS), |
| 609 | GATE(PCLK_TSADC, "pclk_tsadc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 2, GFLAGS), | 609 | GATE(PCLK_TSADC, "pclk_tsadc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 2, GFLAGS), |
diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index 4a65b410e4d5..af29359677da 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c | |||
| @@ -139,9 +139,13 @@ static long atl_clk_round_rate(struct clk_hw *hw, unsigned long rate, | |||
| 139 | static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate, | 139 | static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate, |
| 140 | unsigned long parent_rate) | 140 | unsigned long parent_rate) |
| 141 | { | 141 | { |
| 142 | struct dra7_atl_desc *cdesc = to_atl_desc(hw); | 142 | struct dra7_atl_desc *cdesc; |
| 143 | u32 divider; | 143 | u32 divider; |
| 144 | 144 | ||
| 145 | if (!hw || !rate) | ||
| 146 | return -EINVAL; | ||
| 147 | |||
| 148 | cdesc = to_atl_desc(hw); | ||
| 145 | divider = ((parent_rate + rate / 2) / rate) - 1; | 149 | divider = ((parent_rate + rate / 2) / rate) - 1; |
| 146 | if (divider > DRA7_ATL_DIVIDER_MASK) | 150 | if (divider > DRA7_ATL_DIVIDER_MASK) |
| 147 | divider = DRA7_ATL_DIVIDER_MASK; | 151 | divider = DRA7_ATL_DIVIDER_MASK; |
diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c index e6aa10db7bba..a837f703be65 100644 --- a/drivers/clk/ti/divider.c +++ b/drivers/clk/ti/divider.c | |||
| @@ -211,11 +211,16 @@ static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, | |||
| 211 | static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, | 211 | static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, |
| 212 | unsigned long parent_rate) | 212 | unsigned long parent_rate) |
| 213 | { | 213 | { |
| 214 | struct clk_divider *divider = to_clk_divider(hw); | 214 | struct clk_divider *divider; |
| 215 | unsigned int div, value; | 215 | unsigned int div, value; |
| 216 | unsigned long flags = 0; | 216 | unsigned long flags = 0; |
| 217 | u32 val; | 217 | u32 val; |
| 218 | 218 | ||
| 219 | if (!hw || !rate) | ||
| 220 | return -EINVAL; | ||
| 221 | |||
| 222 | divider = to_clk_divider(hw); | ||
| 223 | |||
| 219 | div = DIV_ROUND_UP(parent_rate, rate); | 224 | div = DIV_ROUND_UP(parent_rate, rate); |
| 220 | value = _get_val(divider, div); | 225 | value = _get_val(divider, div); |
| 221 | 226 | ||
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 4a7cbfad1d74..fcdbde4ec692 100644 --- a/drivers/hwmon/fam15h_power.c +++ b/drivers/hwmon/fam15h_power.c | |||
| @@ -93,13 +93,29 @@ static ssize_t show_power_crit(struct device *dev, | |||
| 93 | } | 93 | } |
| 94 | static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL); | 94 | static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL); |
| 95 | 95 | ||
| 96 | static umode_t fam15h_power_is_visible(struct kobject *kobj, | ||
| 97 | struct attribute *attr, | ||
| 98 | int index) | ||
| 99 | { | ||
| 100 | /* power1_input is only reported for Fam15h, Models 00h-0fh */ | ||
| 101 | if (attr == &dev_attr_power1_input.attr && | ||
| 102 | (boot_cpu_data.x86 != 0x15 || boot_cpu_data.x86_model > 0xf)) | ||
| 103 | return 0; | ||
| 104 | |||
| 105 | return attr->mode; | ||
| 106 | } | ||
| 107 | |||
| 96 | static struct attribute *fam15h_power_attrs[] = { | 108 | static struct attribute *fam15h_power_attrs[] = { |
| 97 | &dev_attr_power1_input.attr, | 109 | &dev_attr_power1_input.attr, |
| 98 | &dev_attr_power1_crit.attr, | 110 | &dev_attr_power1_crit.attr, |
| 99 | NULL | 111 | NULL |
| 100 | }; | 112 | }; |
| 101 | 113 | ||
| 102 | ATTRIBUTE_GROUPS(fam15h_power); | 114 | static const struct attribute_group fam15h_power_group = { |
| 115 | .attrs = fam15h_power_attrs, | ||
| 116 | .is_visible = fam15h_power_is_visible, | ||
| 117 | }; | ||
| 118 | __ATTRIBUTE_GROUPS(fam15h_power); | ||
| 103 | 119 | ||
| 104 | static bool fam15h_power_is_internal_node0(struct pci_dev *f4) | 120 | static bool fam15h_power_is_internal_node0(struct pci_dev *f4) |
| 105 | { | 121 | { |
| @@ -216,7 +232,9 @@ static int fam15h_power_probe(struct pci_dev *pdev, | |||
| 216 | 232 | ||
| 217 | static const struct pci_device_id fam15h_power_id_table[] = { | 233 | static const struct pci_device_id fam15h_power_id_table[] = { |
| 218 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, | 234 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, |
| 235 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) }, | ||
| 219 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, | 236 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, |
| 237 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, | ||
| 220 | {} | 238 | {} |
| 221 | }; | 239 | }; |
| 222 | MODULE_DEVICE_TABLE(pci, fam15h_power_id_table); | 240 | MODULE_DEVICE_TABLE(pci, fam15h_power_id_table); |
diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c index e42964f07f67..ad571ec795a3 100644 --- a/drivers/hwmon/tmp103.c +++ b/drivers/hwmon/tmp103.c | |||
| @@ -145,7 +145,7 @@ static int tmp103_probe(struct i2c_client *client, | |||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | i2c_set_clientdata(client, regmap); | 147 | i2c_set_clientdata(client, regmap); |
| 148 | hwmon_dev = hwmon_device_register_with_groups(dev, client->name, | 148 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, |
| 149 | regmap, tmp103_groups); | 149 | regmap, tmp103_groups); |
| 150 | return PTR_ERR_OR_ZERO(hwmon_dev); | 150 | return PTR_ERR_OR_ZERO(hwmon_dev); |
| 151 | } | 151 | } |
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index a3a2e9c1639b..df0c4f605a21 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c | |||
| @@ -105,6 +105,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, | |||
| 105 | umem->length = size; | 105 | umem->length = size; |
| 106 | umem->offset = addr & ~PAGE_MASK; | 106 | umem->offset = addr & ~PAGE_MASK; |
| 107 | umem->page_size = PAGE_SIZE; | 107 | umem->page_size = PAGE_SIZE; |
| 108 | umem->pid = get_task_pid(current, PIDTYPE_PID); | ||
| 108 | /* | 109 | /* |
| 109 | * We ask for writable memory if any access flags other than | 110 | * We ask for writable memory if any access flags other than |
| 110 | * "remote read" are set. "Local write" and "remote write" | 111 | * "remote read" are set. "Local write" and "remote write" |
| @@ -198,6 +199,7 @@ out: | |||
| 198 | if (ret < 0) { | 199 | if (ret < 0) { |
| 199 | if (need_release) | 200 | if (need_release) |
| 200 | __ib_umem_release(context->device, umem, 0); | 201 | __ib_umem_release(context->device, umem, 0); |
| 202 | put_pid(umem->pid); | ||
| 201 | kfree(umem); | 203 | kfree(umem); |
| 202 | } else | 204 | } else |
| 203 | current->mm->pinned_vm = locked; | 205 | current->mm->pinned_vm = locked; |
| @@ -230,15 +232,19 @@ void ib_umem_release(struct ib_umem *umem) | |||
| 230 | { | 232 | { |
| 231 | struct ib_ucontext *context = umem->context; | 233 | struct ib_ucontext *context = umem->context; |
| 232 | struct mm_struct *mm; | 234 | struct mm_struct *mm; |
| 235 | struct task_struct *task; | ||
| 233 | unsigned long diff; | 236 | unsigned long diff; |
| 234 | 237 | ||
| 235 | __ib_umem_release(umem->context->device, umem, 1); | 238 | __ib_umem_release(umem->context->device, umem, 1); |
| 236 | 239 | ||
| 237 | mm = get_task_mm(current); | 240 | task = get_pid_task(umem->pid, PIDTYPE_PID); |
| 238 | if (!mm) { | 241 | put_pid(umem->pid); |
| 239 | kfree(umem); | 242 | if (!task) |
| 240 | return; | 243 | goto out; |
| 241 | } | 244 | mm = get_task_mm(task); |
| 245 | put_task_struct(task); | ||
| 246 | if (!mm) | ||
| 247 | goto out; | ||
| 242 | 248 | ||
| 243 | diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; | 249 | diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; |
| 244 | 250 | ||
| @@ -262,9 +268,10 @@ void ib_umem_release(struct ib_umem *umem) | |||
| 262 | } else | 268 | } else |
| 263 | down_write(&mm->mmap_sem); | 269 | down_write(&mm->mmap_sem); |
| 264 | 270 | ||
| 265 | current->mm->pinned_vm -= diff; | 271 | mm->pinned_vm -= diff; |
| 266 | up_write(&mm->mmap_sem); | 272 | up_write(&mm->mmap_sem); |
| 267 | mmput(mm); | 273 | mmput(mm); |
| 274 | out: | ||
| 268 | kfree(umem); | 275 | kfree(umem); |
| 269 | } | 276 | } |
| 270 | EXPORT_SYMBOL(ib_umem_release); | 277 | EXPORT_SYMBOL(ib_umem_release); |
diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c index e7bee46868d1..abd97247443e 100644 --- a/drivers/infiniband/core/uverbs_marshall.c +++ b/drivers/infiniband/core/uverbs_marshall.c | |||
| @@ -140,5 +140,9 @@ void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst, | |||
| 140 | dst->packet_life_time = src->packet_life_time; | 140 | dst->packet_life_time = src->packet_life_time; |
| 141 | dst->preference = src->preference; | 141 | dst->preference = src->preference; |
| 142 | dst->packet_life_time_selector = src->packet_life_time_selector; | 142 | dst->packet_life_time_selector = src->packet_life_time_selector; |
| 143 | |||
| 144 | memset(dst->smac, 0, sizeof(dst->smac)); | ||
| 145 | memset(dst->dmac, 0, sizeof(dst->dmac)); | ||
| 146 | dst->vlan_id = 0xffff; | ||
| 143 | } | 147 | } |
| 144 | EXPORT_SYMBOL(ib_copy_path_rec_from_user); | 148 | EXPORT_SYMBOL(ib_copy_path_rec_from_user); |
diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c index dc66c4506916..1da1252dcdb3 100644 --- a/drivers/infiniband/hw/ipath/ipath_user_pages.c +++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c | |||
| @@ -54,7 +54,7 @@ static void __ipath_release_user_pages(struct page **p, size_t num_pages, | |||
| 54 | 54 | ||
| 55 | /* call with current->mm->mmap_sem held */ | 55 | /* call with current->mm->mmap_sem held */ |
| 56 | static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, | 56 | static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, |
| 57 | struct page **p, struct vm_area_struct **vma) | 57 | struct page **p) |
| 58 | { | 58 | { |
| 59 | unsigned long lock_limit; | 59 | unsigned long lock_limit; |
| 60 | size_t got; | 60 | size_t got; |
| @@ -74,7 +74,7 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, | |||
| 74 | ret = get_user_pages(current, current->mm, | 74 | ret = get_user_pages(current, current->mm, |
| 75 | start_page + got * PAGE_SIZE, | 75 | start_page + got * PAGE_SIZE, |
| 76 | num_pages - got, 1, 1, | 76 | num_pages - got, 1, 1, |
| 77 | p + got, vma); | 77 | p + got, NULL); |
| 78 | if (ret < 0) | 78 | if (ret < 0) |
| 79 | goto bail_release; | 79 | goto bail_release; |
| 80 | } | 80 | } |
| @@ -165,7 +165,7 @@ int ipath_get_user_pages(unsigned long start_page, size_t num_pages, | |||
| 165 | 165 | ||
| 166 | down_write(¤t->mm->mmap_sem); | 166 | down_write(¤t->mm->mmap_sem); |
| 167 | 167 | ||
| 168 | ret = __ipath_get_user_pages(start_page, num_pages, p, NULL); | 168 | ret = __ipath_get_user_pages(start_page, num_pages, p); |
| 169 | 169 | ||
| 170 | up_write(¤t->mm->mmap_sem); | 170 | up_write(¤t->mm->mmap_sem); |
| 171 | 171 | ||
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index af8256353c7d..bda5994ceb68 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | 59 | ||
| 60 | #define MLX4_IB_FLOW_MAX_PRIO 0xFFF | 60 | #define MLX4_IB_FLOW_MAX_PRIO 0xFFF |
| 61 | #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF | 61 | #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF |
| 62 | #define MLX4_IB_CARD_REV_A0 0xA0 | ||
| 62 | 63 | ||
| 63 | MODULE_AUTHOR("Roland Dreier"); | 64 | MODULE_AUTHOR("Roland Dreier"); |
| 64 | MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver"); | 65 | MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver"); |
| @@ -119,6 +120,17 @@ static int check_flow_steering_support(struct mlx4_dev *dev) | |||
| 119 | return dmfs; | 120 | return dmfs; |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 123 | static int num_ib_ports(struct mlx4_dev *dev) | ||
| 124 | { | ||
| 125 | int ib_ports = 0; | ||
| 126 | int i; | ||
| 127 | |||
| 128 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
| 129 | ib_ports++; | ||
| 130 | |||
| 131 | return ib_ports; | ||
| 132 | } | ||
| 133 | |||
| 122 | static int mlx4_ib_query_device(struct ib_device *ibdev, | 134 | static int mlx4_ib_query_device(struct ib_device *ibdev, |
| 123 | struct ib_device_attr *props) | 135 | struct ib_device_attr *props) |
| 124 | { | 136 | { |
| @@ -126,6 +138,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, | |||
| 126 | struct ib_smp *in_mad = NULL; | 138 | struct ib_smp *in_mad = NULL; |
| 127 | struct ib_smp *out_mad = NULL; | 139 | struct ib_smp *out_mad = NULL; |
| 128 | int err = -ENOMEM; | 140 | int err = -ENOMEM; |
| 141 | int have_ib_ports; | ||
| 129 | 142 | ||
| 130 | in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); | 143 | in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); |
| 131 | out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); | 144 | out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); |
| @@ -142,6 +155,8 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, | |||
| 142 | 155 | ||
| 143 | memset(props, 0, sizeof *props); | 156 | memset(props, 0, sizeof *props); |
| 144 | 157 | ||
| 158 | have_ib_ports = num_ib_ports(dev->dev); | ||
| 159 | |||
| 145 | props->fw_ver = dev->dev->caps.fw_ver; | 160 | props->fw_ver = dev->dev->caps.fw_ver; |
| 146 | props->device_cap_flags = IB_DEVICE_CHANGE_PHY_PORT | | 161 | props->device_cap_flags = IB_DEVICE_CHANGE_PHY_PORT | |
| 147 | IB_DEVICE_PORT_ACTIVE_EVENT | | 162 | IB_DEVICE_PORT_ACTIVE_EVENT | |
| @@ -152,13 +167,15 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, | |||
| 152 | props->device_cap_flags |= IB_DEVICE_BAD_PKEY_CNTR; | 167 | props->device_cap_flags |= IB_DEVICE_BAD_PKEY_CNTR; |
| 153 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR) | 168 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR) |
| 154 | props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR; | 169 | props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR; |
| 155 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_APM) | 170 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_APM && have_ib_ports) |
| 156 | props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG; | 171 | props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG; |
| 157 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UD_AV_PORT) | 172 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UD_AV_PORT) |
| 158 | props->device_cap_flags |= IB_DEVICE_UD_AV_PORT_ENFORCE; | 173 | props->device_cap_flags |= IB_DEVICE_UD_AV_PORT_ENFORCE; |
| 159 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IPOIB_CSUM) | 174 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IPOIB_CSUM) |
| 160 | props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM; | 175 | props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM; |
| 161 | if (dev->dev->caps.max_gso_sz && dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BLH) | 176 | if (dev->dev->caps.max_gso_sz && |
| 177 | (dev->dev->rev_id != MLX4_IB_CARD_REV_A0) && | ||
| 178 | (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BLH)) | ||
| 162 | props->device_cap_flags |= IB_DEVICE_UD_TSO; | 179 | props->device_cap_flags |= IB_DEVICE_UD_TSO; |
| 163 | if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_RESERVED_LKEY) | 180 | if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_RESERVED_LKEY) |
| 164 | props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY; | 181 | props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY; |
| @@ -357,7 +374,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, | |||
| 357 | props->state = IB_PORT_DOWN; | 374 | props->state = IB_PORT_DOWN; |
| 358 | props->phys_state = state_to_phys_state(props->state); | 375 | props->phys_state = state_to_phys_state(props->state); |
| 359 | props->active_mtu = IB_MTU_256; | 376 | props->active_mtu = IB_MTU_256; |
| 360 | spin_lock(&iboe->lock); | 377 | spin_lock_bh(&iboe->lock); |
| 361 | ndev = iboe->netdevs[port - 1]; | 378 | ndev = iboe->netdevs[port - 1]; |
| 362 | if (!ndev) | 379 | if (!ndev) |
| 363 | goto out_unlock; | 380 | goto out_unlock; |
| @@ -369,7 +386,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, | |||
| 369 | IB_PORT_ACTIVE : IB_PORT_DOWN; | 386 | IB_PORT_ACTIVE : IB_PORT_DOWN; |
| 370 | props->phys_state = state_to_phys_state(props->state); | 387 | props->phys_state = state_to_phys_state(props->state); |
| 371 | out_unlock: | 388 | out_unlock: |
| 372 | spin_unlock(&iboe->lock); | 389 | spin_unlock_bh(&iboe->lock); |
| 373 | out: | 390 | out: |
| 374 | mlx4_free_cmd_mailbox(mdev->dev, mailbox); | 391 | mlx4_free_cmd_mailbox(mdev->dev, mailbox); |
| 375 | return err; | 392 | return err; |
| @@ -811,11 +828,11 @@ int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp, | |||
| 811 | if (!mqp->port) | 828 | if (!mqp->port) |
| 812 | return 0; | 829 | return 0; |
| 813 | 830 | ||
| 814 | spin_lock(&mdev->iboe.lock); | 831 | spin_lock_bh(&mdev->iboe.lock); |
| 815 | ndev = mdev->iboe.netdevs[mqp->port - 1]; | 832 | ndev = mdev->iboe.netdevs[mqp->port - 1]; |
| 816 | if (ndev) | 833 | if (ndev) |
| 817 | dev_hold(ndev); | 834 | dev_hold(ndev); |
| 818 | spin_unlock(&mdev->iboe.lock); | 835 | spin_unlock_bh(&mdev->iboe.lock); |
| 819 | 836 | ||
| 820 | if (ndev) { | 837 | if (ndev) { |
| 821 | ret = 1; | 838 | ret = 1; |
| @@ -1292,11 +1309,11 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) | |||
| 1292 | mutex_lock(&mqp->mutex); | 1309 | mutex_lock(&mqp->mutex); |
| 1293 | ge = find_gid_entry(mqp, gid->raw); | 1310 | ge = find_gid_entry(mqp, gid->raw); |
| 1294 | if (ge) { | 1311 | if (ge) { |
| 1295 | spin_lock(&mdev->iboe.lock); | 1312 | spin_lock_bh(&mdev->iboe.lock); |
| 1296 | ndev = ge->added ? mdev->iboe.netdevs[ge->port - 1] : NULL; | 1313 | ndev = ge->added ? mdev->iboe.netdevs[ge->port - 1] : NULL; |
| 1297 | if (ndev) | 1314 | if (ndev) |
| 1298 | dev_hold(ndev); | 1315 | dev_hold(ndev); |
| 1299 | spin_unlock(&mdev->iboe.lock); | 1316 | spin_unlock_bh(&mdev->iboe.lock); |
| 1300 | if (ndev) | 1317 | if (ndev) |
| 1301 | dev_put(ndev); | 1318 | dev_put(ndev); |
| 1302 | list_del(&ge->list); | 1319 | list_del(&ge->list); |
| @@ -1417,6 +1434,9 @@ static void update_gids_task(struct work_struct *work) | |||
| 1417 | int err; | 1434 | int err; |
| 1418 | struct mlx4_dev *dev = gw->dev->dev; | 1435 | struct mlx4_dev *dev = gw->dev->dev; |
| 1419 | 1436 | ||
| 1437 | if (!gw->dev->ib_active) | ||
| 1438 | return; | ||
| 1439 | |||
| 1420 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 1440 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
| 1421 | if (IS_ERR(mailbox)) { | 1441 | if (IS_ERR(mailbox)) { |
| 1422 | pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox)); | 1442 | pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox)); |
| @@ -1447,6 +1467,9 @@ static void reset_gids_task(struct work_struct *work) | |||
| 1447 | int err; | 1467 | int err; |
| 1448 | struct mlx4_dev *dev = gw->dev->dev; | 1468 | struct mlx4_dev *dev = gw->dev->dev; |
| 1449 | 1469 | ||
| 1470 | if (!gw->dev->ib_active) | ||
| 1471 | return; | ||
| 1472 | |||
| 1450 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 1473 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
| 1451 | if (IS_ERR(mailbox)) { | 1474 | if (IS_ERR(mailbox)) { |
| 1452 | pr_warn("reset gid table failed\n"); | 1475 | pr_warn("reset gid table failed\n"); |
| @@ -1581,7 +1604,7 @@ static int mlx4_ib_addr_event(int event, struct net_device *event_netdev, | |||
| 1581 | return 0; | 1604 | return 0; |
| 1582 | 1605 | ||
| 1583 | iboe = &ibdev->iboe; | 1606 | iboe = &ibdev->iboe; |
| 1584 | spin_lock(&iboe->lock); | 1607 | spin_lock_bh(&iboe->lock); |
| 1585 | 1608 | ||
| 1586 | for (port = 1; port <= ibdev->dev->caps.num_ports; ++port) | 1609 | for (port = 1; port <= ibdev->dev->caps.num_ports; ++port) |
| 1587 | if ((netif_is_bond_master(real_dev) && | 1610 | if ((netif_is_bond_master(real_dev) && |
| @@ -1591,7 +1614,7 @@ static int mlx4_ib_addr_event(int event, struct net_device *event_netdev, | |||
| 1591 | update_gid_table(ibdev, port, gid, | 1614 | update_gid_table(ibdev, port, gid, |
| 1592 | event == NETDEV_DOWN, 0); | 1615 | event == NETDEV_DOWN, 0); |
| 1593 | 1616 | ||
| 1594 | spin_unlock(&iboe->lock); | 1617 | spin_unlock_bh(&iboe->lock); |
| 1595 | return 0; | 1618 | return 0; |
| 1596 | 1619 | ||
| 1597 | } | 1620 | } |
| @@ -1664,13 +1687,21 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev, | |||
| 1664 | new_smac = mlx4_mac_to_u64(dev->dev_addr); | 1687 | new_smac = mlx4_mac_to_u64(dev->dev_addr); |
| 1665 | read_unlock(&dev_base_lock); | 1688 | read_unlock(&dev_base_lock); |
| 1666 | 1689 | ||
| 1690 | atomic64_set(&ibdev->iboe.mac[port - 1], new_smac); | ||
| 1691 | |||
| 1692 | /* no need for update QP1 and mac registration in non-SRIOV */ | ||
| 1693 | if (!mlx4_is_mfunc(ibdev->dev)) | ||
| 1694 | return; | ||
| 1695 | |||
| 1667 | mutex_lock(&ibdev->qp1_proxy_lock[port - 1]); | 1696 | mutex_lock(&ibdev->qp1_proxy_lock[port - 1]); |
| 1668 | qp = ibdev->qp1_proxy[port - 1]; | 1697 | qp = ibdev->qp1_proxy[port - 1]; |
| 1669 | if (qp) { | 1698 | if (qp) { |
| 1670 | int new_smac_index; | 1699 | int new_smac_index; |
| 1671 | u64 old_smac = qp->pri.smac; | 1700 | u64 old_smac; |
| 1672 | struct mlx4_update_qp_params update_params; | 1701 | struct mlx4_update_qp_params update_params; |
| 1673 | 1702 | ||
| 1703 | mutex_lock(&qp->mutex); | ||
| 1704 | old_smac = qp->pri.smac; | ||
| 1674 | if (new_smac == old_smac) | 1705 | if (new_smac == old_smac) |
| 1675 | goto unlock; | 1706 | goto unlock; |
| 1676 | 1707 | ||
| @@ -1680,22 +1711,25 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev, | |||
| 1680 | goto unlock; | 1711 | goto unlock; |
| 1681 | 1712 | ||
| 1682 | update_params.smac_index = new_smac_index; | 1713 | update_params.smac_index = new_smac_index; |
| 1683 | if (mlx4_update_qp(ibdev->dev, &qp->mqp, MLX4_UPDATE_QP_SMAC, | 1714 | if (mlx4_update_qp(ibdev->dev, qp->mqp.qpn, MLX4_UPDATE_QP_SMAC, |
| 1684 | &update_params)) { | 1715 | &update_params)) { |
| 1685 | release_mac = new_smac; | 1716 | release_mac = new_smac; |
| 1686 | goto unlock; | 1717 | goto unlock; |
| 1687 | } | 1718 | } |
| 1688 | 1719 | /* if old port was zero, no mac was yet registered for this QP */ | |
| 1720 | if (qp->pri.smac_port) | ||
| 1721 | release_mac = old_smac; | ||
| 1689 | qp->pri.smac = new_smac; | 1722 | qp->pri.smac = new_smac; |
| 1723 | qp->pri.smac_port = port; | ||
| 1690 | qp->pri.smac_index = new_smac_index; | 1724 | qp->pri.smac_index = new_smac_index; |
| 1691 | |||
| 1692 | release_mac = old_smac; | ||
| 1693 | } | 1725 | } |
| 1694 | 1726 | ||
| 1695 | unlock: | 1727 | unlock: |
| 1696 | mutex_unlock(&ibdev->qp1_proxy_lock[port - 1]); | ||
| 1697 | if (release_mac != MLX4_IB_INVALID_MAC) | 1728 | if (release_mac != MLX4_IB_INVALID_MAC) |
| 1698 | mlx4_unregister_mac(ibdev->dev, port, release_mac); | 1729 | mlx4_unregister_mac(ibdev->dev, port, release_mac); |
| 1730 | if (qp) | ||
| 1731 | mutex_unlock(&qp->mutex); | ||
| 1732 | mutex_unlock(&ibdev->qp1_proxy_lock[port - 1]); | ||
| 1699 | } | 1733 | } |
| 1700 | 1734 | ||
| 1701 | static void mlx4_ib_get_dev_addr(struct net_device *dev, | 1735 | static void mlx4_ib_get_dev_addr(struct net_device *dev, |
| @@ -1706,6 +1740,7 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev, | |||
| 1706 | struct inet6_dev *in6_dev; | 1740 | struct inet6_dev *in6_dev; |
| 1707 | union ib_gid *pgid; | 1741 | union ib_gid *pgid; |
| 1708 | struct inet6_ifaddr *ifp; | 1742 | struct inet6_ifaddr *ifp; |
| 1743 | union ib_gid default_gid; | ||
| 1709 | #endif | 1744 | #endif |
| 1710 | union ib_gid gid; | 1745 | union ib_gid gid; |
| 1711 | 1746 | ||
| @@ -1726,12 +1761,15 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev, | |||
| 1726 | in_dev_put(in_dev); | 1761 | in_dev_put(in_dev); |
| 1727 | } | 1762 | } |
| 1728 | #if IS_ENABLED(CONFIG_IPV6) | 1763 | #if IS_ENABLED(CONFIG_IPV6) |
| 1764 | mlx4_make_default_gid(dev, &default_gid); | ||
| 1729 | /* IPv6 gids */ | 1765 | /* IPv6 gids */ |
| 1730 | in6_dev = in6_dev_get(dev); | 1766 | in6_dev = in6_dev_get(dev); |
| 1731 | if (in6_dev) { | 1767 | if (in6_dev) { |
| 1732 | read_lock_bh(&in6_dev->lock); | 1768 | read_lock_bh(&in6_dev->lock); |
| 1733 | list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { | 1769 | list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { |
| 1734 | pgid = (union ib_gid *)&ifp->addr; | 1770 | pgid = (union ib_gid *)&ifp->addr; |
| 1771 | if (!memcmp(pgid, &default_gid, sizeof(*pgid))) | ||
| 1772 | continue; | ||
| 1735 | update_gid_table(ibdev, port, pgid, 0, 0); | 1773 | update_gid_table(ibdev, port, pgid, 0, 0); |
| 1736 | } | 1774 | } |
| 1737 | read_unlock_bh(&in6_dev->lock); | 1775 | read_unlock_bh(&in6_dev->lock); |
| @@ -1753,24 +1791,33 @@ static int mlx4_ib_init_gid_table(struct mlx4_ib_dev *ibdev) | |||
| 1753 | struct net_device *dev; | 1791 | struct net_device *dev; |
| 1754 | struct mlx4_ib_iboe *iboe = &ibdev->iboe; | 1792 | struct mlx4_ib_iboe *iboe = &ibdev->iboe; |
| 1755 | int i; | 1793 | int i; |
| 1794 | int err = 0; | ||
| 1756 | 1795 | ||
| 1757 | for (i = 1; i <= ibdev->num_ports; ++i) | 1796 | for (i = 1; i <= ibdev->num_ports; ++i) { |
| 1758 | if (reset_gid_table(ibdev, i)) | 1797 | if (rdma_port_get_link_layer(&ibdev->ib_dev, i) == |
| 1759 | return -1; | 1798 | IB_LINK_LAYER_ETHERNET) { |
| 1799 | err = reset_gid_table(ibdev, i); | ||
| 1800 | if (err) | ||
| 1801 | goto out; | ||
| 1802 | } | ||
| 1803 | } | ||
| 1760 | 1804 | ||
| 1761 | read_lock(&dev_base_lock); | 1805 | read_lock(&dev_base_lock); |
| 1762 | spin_lock(&iboe->lock); | 1806 | spin_lock_bh(&iboe->lock); |
| 1763 | 1807 | ||
| 1764 | for_each_netdev(&init_net, dev) { | 1808 | for_each_netdev(&init_net, dev) { |
| 1765 | u8 port = mlx4_ib_get_dev_port(dev, ibdev); | 1809 | u8 port = mlx4_ib_get_dev_port(dev, ibdev); |
| 1766 | if (port) | 1810 | /* port will be non-zero only for ETH ports */ |
| 1811 | if (port) { | ||
| 1812 | mlx4_ib_set_default_gid(ibdev, dev, port); | ||
| 1767 | mlx4_ib_get_dev_addr(dev, ibdev, port); | 1813 | mlx4_ib_get_dev_addr(dev, ibdev, port); |
| 1814 | } | ||
| 1768 | } | 1815 | } |
| 1769 | 1816 | ||
| 1770 | spin_unlock(&iboe->lock); | 1817 | spin_unlock_bh(&iboe->lock); |
| 1771 | read_unlock(&dev_base_lock); | 1818 | read_unlock(&dev_base_lock); |
| 1772 | 1819 | out: | |
| 1773 | return 0; | 1820 | return err; |
| 1774 | } | 1821 | } |
| 1775 | 1822 | ||
| 1776 | static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, | 1823 | static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, |
| @@ -1784,7 +1831,7 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, | |||
| 1784 | 1831 | ||
| 1785 | iboe = &ibdev->iboe; | 1832 | iboe = &ibdev->iboe; |
| 1786 | 1833 | ||
| 1787 | spin_lock(&iboe->lock); | 1834 | spin_lock_bh(&iboe->lock); |
| 1788 | mlx4_foreach_ib_transport_port(port, ibdev->dev) { | 1835 | mlx4_foreach_ib_transport_port(port, ibdev->dev) { |
| 1789 | enum ib_port_state port_state = IB_PORT_NOP; | 1836 | enum ib_port_state port_state = IB_PORT_NOP; |
| 1790 | struct net_device *old_master = iboe->masters[port - 1]; | 1837 | struct net_device *old_master = iboe->masters[port - 1]; |
| @@ -1816,35 +1863,47 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, | |||
| 1816 | port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ? | 1863 | port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ? |
| 1817 | IB_PORT_ACTIVE : IB_PORT_DOWN; | 1864 | IB_PORT_ACTIVE : IB_PORT_DOWN; |
| 1818 | mlx4_ib_set_default_gid(ibdev, curr_netdev, port); | 1865 | mlx4_ib_set_default_gid(ibdev, curr_netdev, port); |
| 1819 | } else { | 1866 | if (curr_master) { |
| 1820 | reset_gid_table(ibdev, port); | 1867 | /* if using bonding/team and a slave port is down, we |
| 1821 | } | 1868 | * don't want the bond IP based gids in the table since |
| 1822 | /* if using bonding/team and a slave port is down, we don't the bond IP | 1869 | * flows that select port by gid may get the down port. |
| 1823 | * based gids in the table since flows that select port by gid may get | 1870 | */ |
| 1824 | * the down port. | 1871 | if (port_state == IB_PORT_DOWN) { |
| 1825 | */ | 1872 | reset_gid_table(ibdev, port); |
| 1826 | if (curr_master && (port_state == IB_PORT_DOWN)) { | 1873 | mlx4_ib_set_default_gid(ibdev, |
| 1827 | reset_gid_table(ibdev, port); | 1874 | curr_netdev, |
| 1828 | mlx4_ib_set_default_gid(ibdev, curr_netdev, port); | 1875 | port); |
| 1829 | } | 1876 | } else { |
| 1830 | /* if bonding is used it is possible that we add it to masters | 1877 | /* gids from the upper dev (bond/team) |
| 1831 | * only after IP address is assigned to the net bonding | 1878 | * should appear in port's gid table |
| 1832 | * interface. | 1879 | */ |
| 1833 | */ | 1880 | mlx4_ib_get_dev_addr(curr_master, |
| 1834 | if (curr_master && (old_master != curr_master)) { | 1881 | ibdev, port); |
| 1835 | reset_gid_table(ibdev, port); | 1882 | } |
| 1836 | mlx4_ib_set_default_gid(ibdev, curr_netdev, port); | 1883 | } |
| 1837 | mlx4_ib_get_dev_addr(curr_master, ibdev, port); | 1884 | /* if bonding is used it is possible that we add it to |
| 1838 | } | 1885 | * masters only after IP address is assigned to the |
| 1886 | * net bonding interface. | ||
| 1887 | */ | ||
| 1888 | if (curr_master && (old_master != curr_master)) { | ||
| 1889 | reset_gid_table(ibdev, port); | ||
| 1890 | mlx4_ib_set_default_gid(ibdev, | ||
| 1891 | curr_netdev, port); | ||
| 1892 | mlx4_ib_get_dev_addr(curr_master, ibdev, port); | ||
| 1893 | } | ||
| 1839 | 1894 | ||
| 1840 | if (!curr_master && (old_master != curr_master)) { | 1895 | if (!curr_master && (old_master != curr_master)) { |
| 1896 | reset_gid_table(ibdev, port); | ||
| 1897 | mlx4_ib_set_default_gid(ibdev, | ||
| 1898 | curr_netdev, port); | ||
| 1899 | mlx4_ib_get_dev_addr(curr_netdev, ibdev, port); | ||
| 1900 | } | ||
| 1901 | } else { | ||
| 1841 | reset_gid_table(ibdev, port); | 1902 | reset_gid_table(ibdev, port); |
| 1842 | mlx4_ib_set_default_gid(ibdev, curr_netdev, port); | ||
| 1843 | mlx4_ib_get_dev_addr(curr_netdev, ibdev, port); | ||
| 1844 | } | 1903 | } |
| 1845 | } | 1904 | } |
| 1846 | 1905 | ||
| 1847 | spin_unlock(&iboe->lock); | 1906 | spin_unlock_bh(&iboe->lock); |
| 1848 | 1907 | ||
| 1849 | if (update_qps_port > 0) | 1908 | if (update_qps_port > 0) |
| 1850 | mlx4_ib_update_qps(ibdev, dev, update_qps_port); | 1909 | mlx4_ib_update_qps(ibdev, dev, update_qps_port); |
| @@ -2186,6 +2245,9 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
| 2186 | goto err_steer_free_bitmap; | 2245 | goto err_steer_free_bitmap; |
| 2187 | } | 2246 | } |
| 2188 | 2247 | ||
| 2248 | for (j = 1; j <= ibdev->dev->caps.num_ports; j++) | ||
| 2249 | atomic64_set(&iboe->mac[j - 1], ibdev->dev->caps.def_mac[j]); | ||
| 2250 | |||
| 2189 | if (ib_register_device(&ibdev->ib_dev, NULL)) | 2251 | if (ib_register_device(&ibdev->ib_dev, NULL)) |
| 2190 | goto err_steer_free_bitmap; | 2252 | goto err_steer_free_bitmap; |
| 2191 | 2253 | ||
| @@ -2222,12 +2284,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
| 2222 | } | 2284 | } |
| 2223 | } | 2285 | } |
| 2224 | #endif | 2286 | #endif |
| 2225 | for (i = 1 ; i <= ibdev->num_ports ; ++i) | 2287 | if (mlx4_ib_init_gid_table(ibdev)) |
| 2226 | reset_gid_table(ibdev, i); | 2288 | goto err_notif; |
| 2227 | rtnl_lock(); | ||
| 2228 | mlx4_ib_scan_netdevs(ibdev, NULL, 0); | ||
| 2229 | rtnl_unlock(); | ||
| 2230 | mlx4_ib_init_gid_table(ibdev); | ||
| 2231 | } | 2289 | } |
| 2232 | 2290 | ||
| 2233 | for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) { | 2291 | for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) { |
| @@ -2375,6 +2433,9 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr) | |||
| 2375 | struct mlx4_ib_dev *ibdev = ibdev_ptr; | 2433 | struct mlx4_ib_dev *ibdev = ibdev_ptr; |
| 2376 | int p; | 2434 | int p; |
| 2377 | 2435 | ||
| 2436 | ibdev->ib_active = false; | ||
| 2437 | flush_workqueue(wq); | ||
| 2438 | |||
| 2378 | mlx4_ib_close_sriov(ibdev); | 2439 | mlx4_ib_close_sriov(ibdev); |
| 2379 | mlx4_ib_mad_cleanup(ibdev); | 2440 | mlx4_ib_mad_cleanup(ibdev); |
| 2380 | ib_unregister_device(&ibdev->ib_dev); | 2441 | ib_unregister_device(&ibdev->ib_dev); |
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h index e8cad3926bfc..6eb743f65f6f 100644 --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h | |||
| @@ -451,6 +451,7 @@ struct mlx4_ib_iboe { | |||
| 451 | spinlock_t lock; | 451 | spinlock_t lock; |
| 452 | struct net_device *netdevs[MLX4_MAX_PORTS]; | 452 | struct net_device *netdevs[MLX4_MAX_PORTS]; |
| 453 | struct net_device *masters[MLX4_MAX_PORTS]; | 453 | struct net_device *masters[MLX4_MAX_PORTS]; |
| 454 | atomic64_t mac[MLX4_MAX_PORTS]; | ||
| 454 | struct notifier_block nb; | 455 | struct notifier_block nb; |
| 455 | struct notifier_block nb_inet; | 456 | struct notifier_block nb_inet; |
| 456 | struct notifier_block nb_inet6; | 457 | struct notifier_block nb_inet6; |
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 9b0e80e59b08..8f9325cfc85d 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c | |||
| @@ -234,14 +234,13 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags, | |||
| 234 | 0); | 234 | 0); |
| 235 | if (IS_ERR(mmr->umem)) { | 235 | if (IS_ERR(mmr->umem)) { |
| 236 | err = PTR_ERR(mmr->umem); | 236 | err = PTR_ERR(mmr->umem); |
| 237 | /* Prevent mlx4_ib_dereg_mr from free'ing invalid pointer */ | ||
| 237 | mmr->umem = NULL; | 238 | mmr->umem = NULL; |
| 238 | goto release_mpt_entry; | 239 | goto release_mpt_entry; |
| 239 | } | 240 | } |
| 240 | n = ib_umem_page_count(mmr->umem); | 241 | n = ib_umem_page_count(mmr->umem); |
| 241 | shift = ilog2(mmr->umem->page_size); | 242 | shift = ilog2(mmr->umem->page_size); |
| 242 | 243 | ||
| 243 | mmr->mmr.iova = virt_addr; | ||
| 244 | mmr->mmr.size = length; | ||
| 245 | err = mlx4_mr_rereg_mem_write(dev->dev, &mmr->mmr, | 244 | err = mlx4_mr_rereg_mem_write(dev->dev, &mmr->mmr, |
| 246 | virt_addr, length, n, shift, | 245 | virt_addr, length, n, shift, |
| 247 | *pmpt_entry); | 246 | *pmpt_entry); |
| @@ -249,6 +248,8 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags, | |||
| 249 | ib_umem_release(mmr->umem); | 248 | ib_umem_release(mmr->umem); |
| 250 | goto release_mpt_entry; | 249 | goto release_mpt_entry; |
| 251 | } | 250 | } |
| 251 | mmr->mmr.iova = virt_addr; | ||
| 252 | mmr->mmr.size = length; | ||
| 252 | 253 | ||
| 253 | err = mlx4_ib_umem_write_mtt(dev, &mmr->mmr.mtt, mmr->umem); | 254 | err = mlx4_ib_umem_write_mtt(dev, &mmr->mmr.mtt, mmr->umem); |
| 254 | if (err) { | 255 | if (err) { |
| @@ -262,6 +263,8 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags, | |||
| 262 | * return a failure. But dereg_mr will free the resources. | 263 | * return a failure. But dereg_mr will free the resources. |
| 263 | */ | 264 | */ |
| 264 | err = mlx4_mr_hw_write_mpt(dev->dev, &mmr->mmr, pmpt_entry); | 265 | err = mlx4_mr_hw_write_mpt(dev->dev, &mmr->mmr, pmpt_entry); |
| 266 | if (!err && flags & IB_MR_REREG_ACCESS) | ||
| 267 | mmr->mmr.access = mr_access_flags; | ||
| 265 | 268 | ||
| 266 | release_mpt_entry: | 269 | release_mpt_entry: |
| 267 | mlx4_mr_hw_put_mpt(dev->dev, pmpt_entry); | 270 | mlx4_mr_hw_put_mpt(dev->dev, pmpt_entry); |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index efb9eff8906c..9c5150c3cb31 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
| @@ -964,9 +964,10 @@ static void destroy_qp_common(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, | |||
| 964 | MLX4_QP_STATE_RST, NULL, 0, 0, &qp->mqp)) | 964 | MLX4_QP_STATE_RST, NULL, 0, 0, &qp->mqp)) |
| 965 | pr_warn("modify QP %06x to RESET failed.\n", | 965 | pr_warn("modify QP %06x to RESET failed.\n", |
| 966 | qp->mqp.qpn); | 966 | qp->mqp.qpn); |
| 967 | if (qp->pri.smac) { | 967 | if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port)) { |
| 968 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); | 968 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); |
| 969 | qp->pri.smac = 0; | 969 | qp->pri.smac = 0; |
| 970 | qp->pri.smac_port = 0; | ||
| 970 | } | 971 | } |
| 971 | if (qp->alt.smac) { | 972 | if (qp->alt.smac) { |
| 972 | mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); | 973 | mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); |
| @@ -1325,7 +1326,8 @@ static int _mlx4_set_path(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah, | |||
| 1325 | * If one was already assigned, but the new mac differs, | 1326 | * If one was already assigned, but the new mac differs, |
| 1326 | * unregister the old one and register the new one. | 1327 | * unregister the old one and register the new one. |
| 1327 | */ | 1328 | */ |
| 1328 | if (!smac_info->smac || smac_info->smac != smac) { | 1329 | if ((!smac_info->smac && !smac_info->smac_port) || |
| 1330 | smac_info->smac != smac) { | ||
| 1329 | /* register candidate now, unreg if needed, after success */ | 1331 | /* register candidate now, unreg if needed, after success */ |
| 1330 | smac_index = mlx4_register_mac(dev->dev, port, smac); | 1332 | smac_index = mlx4_register_mac(dev->dev, port, smac); |
| 1331 | if (smac_index >= 0) { | 1333 | if (smac_index >= 0) { |
| @@ -1390,21 +1392,13 @@ static void update_mcg_macs(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp) | |||
| 1390 | static int handle_eth_ud_smac_index(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, u8 *smac, | 1392 | static int handle_eth_ud_smac_index(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, u8 *smac, |
| 1391 | struct mlx4_qp_context *context) | 1393 | struct mlx4_qp_context *context) |
| 1392 | { | 1394 | { |
| 1393 | struct net_device *ndev; | ||
| 1394 | u64 u64_mac; | 1395 | u64 u64_mac; |
| 1395 | int smac_index; | 1396 | int smac_index; |
| 1396 | 1397 | ||
| 1397 | 1398 | u64_mac = atomic64_read(&dev->iboe.mac[qp->port - 1]); | |
| 1398 | ndev = dev->iboe.netdevs[qp->port - 1]; | ||
| 1399 | if (ndev) { | ||
| 1400 | smac = ndev->dev_addr; | ||
| 1401 | u64_mac = mlx4_mac_to_u64(smac); | ||
| 1402 | } else { | ||
| 1403 | u64_mac = dev->dev->caps.def_mac[qp->port]; | ||
| 1404 | } | ||
| 1405 | 1399 | ||
| 1406 | context->pri_path.sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | ((qp->port - 1) << 6); | 1400 | context->pri_path.sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | ((qp->port - 1) << 6); |
| 1407 | if (!qp->pri.smac) { | 1401 | if (!qp->pri.smac && !qp->pri.smac_port) { |
| 1408 | smac_index = mlx4_register_mac(dev->dev, qp->port, u64_mac); | 1402 | smac_index = mlx4_register_mac(dev->dev, qp->port, u64_mac); |
| 1409 | if (smac_index >= 0) { | 1403 | if (smac_index >= 0) { |
| 1410 | qp->pri.candidate_smac_index = smac_index; | 1404 | qp->pri.candidate_smac_index = smac_index; |
| @@ -1432,6 +1426,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
| 1432 | int steer_qp = 0; | 1426 | int steer_qp = 0; |
| 1433 | int err = -EINVAL; | 1427 | int err = -EINVAL; |
| 1434 | 1428 | ||
| 1429 | /* APM is not supported under RoCE */ | ||
| 1430 | if (attr_mask & IB_QP_ALT_PATH && | ||
| 1431 | rdma_port_get_link_layer(&dev->ib_dev, qp->port) == | ||
| 1432 | IB_LINK_LAYER_ETHERNET) | ||
| 1433 | return -ENOTSUPP; | ||
| 1434 | |||
| 1435 | context = kzalloc(sizeof *context, GFP_KERNEL); | 1435 | context = kzalloc(sizeof *context, GFP_KERNEL); |
| 1436 | if (!context) | 1436 | if (!context) |
| 1437 | return -ENOMEM; | 1437 | return -ENOMEM; |
| @@ -1682,7 +1682,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
| 1682 | MLX4_IB_LINK_TYPE_ETH; | 1682 | MLX4_IB_LINK_TYPE_ETH; |
| 1683 | if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { | 1683 | if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { |
| 1684 | /* set QP to receive both tunneled & non-tunneled packets */ | 1684 | /* set QP to receive both tunneled & non-tunneled packets */ |
| 1685 | if (!(context->flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET))) | 1685 | if (!(context->flags & cpu_to_be32(1 << MLX4_RSS_QPC_FLAG_OFFSET))) |
| 1686 | context->srqn = cpu_to_be32(7 << 28); | 1686 | context->srqn = cpu_to_be32(7 << 28); |
| 1687 | } | 1687 | } |
| 1688 | } | 1688 | } |
| @@ -1786,9 +1786,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
| 1786 | if (qp->flags & MLX4_IB_QP_NETIF) | 1786 | if (qp->flags & MLX4_IB_QP_NETIF) |
| 1787 | mlx4_ib_steer_qp_reg(dev, qp, 0); | 1787 | mlx4_ib_steer_qp_reg(dev, qp, 0); |
| 1788 | } | 1788 | } |
| 1789 | if (qp->pri.smac) { | 1789 | if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port)) { |
| 1790 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); | 1790 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); |
| 1791 | qp->pri.smac = 0; | 1791 | qp->pri.smac = 0; |
| 1792 | qp->pri.smac_port = 0; | ||
| 1792 | } | 1793 | } |
| 1793 | if (qp->alt.smac) { | 1794 | if (qp->alt.smac) { |
| 1794 | mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); | 1795 | mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); |
| @@ -1812,11 +1813,12 @@ out: | |||
| 1812 | if (err && steer_qp) | 1813 | if (err && steer_qp) |
| 1813 | mlx4_ib_steer_qp_reg(dev, qp, 0); | 1814 | mlx4_ib_steer_qp_reg(dev, qp, 0); |
| 1814 | kfree(context); | 1815 | kfree(context); |
| 1815 | if (qp->pri.candidate_smac) { | 1816 | if (qp->pri.candidate_smac || |
| 1817 | (!qp->pri.candidate_smac && qp->pri.candidate_smac_port)) { | ||
| 1816 | if (err) { | 1818 | if (err) { |
| 1817 | mlx4_unregister_mac(dev->dev, qp->pri.candidate_smac_port, qp->pri.candidate_smac); | 1819 | mlx4_unregister_mac(dev->dev, qp->pri.candidate_smac_port, qp->pri.candidate_smac); |
| 1818 | } else { | 1820 | } else { |
| 1819 | if (qp->pri.smac) | 1821 | if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port)) |
| 1820 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); | 1822 | mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); |
| 1821 | qp->pri.smac = qp->pri.candidate_smac; | 1823 | qp->pri.smac = qp->pri.candidate_smac; |
| 1822 | qp->pri.smac_index = qp->pri.candidate_smac_index; | 1824 | qp->pri.smac_index = qp->pri.candidate_smac_index; |
| @@ -2089,6 +2091,16 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp, | |||
| 2089 | return 0; | 2091 | return 0; |
| 2090 | } | 2092 | } |
| 2091 | 2093 | ||
| 2094 | static void mlx4_u64_to_smac(u8 *dst_mac, u64 src_mac) | ||
| 2095 | { | ||
| 2096 | int i; | ||
| 2097 | |||
| 2098 | for (i = ETH_ALEN; i; i--) { | ||
| 2099 | dst_mac[i - 1] = src_mac & 0xff; | ||
| 2100 | src_mac >>= 8; | ||
| 2101 | } | ||
| 2102 | } | ||
| 2103 | |||
| 2092 | static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, | 2104 | static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, |
| 2093 | void *wqe, unsigned *mlx_seg_len) | 2105 | void *wqe, unsigned *mlx_seg_len) |
| 2094 | { | 2106 | { |
| @@ -2203,7 +2215,6 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, | |||
| 2203 | } | 2215 | } |
| 2204 | 2216 | ||
| 2205 | if (is_eth) { | 2217 | if (is_eth) { |
| 2206 | u8 *smac; | ||
| 2207 | struct in6_addr in6; | 2218 | struct in6_addr in6; |
| 2208 | 2219 | ||
| 2209 | u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13; | 2220 | u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13; |
| @@ -2216,12 +2227,17 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, | |||
| 2216 | memcpy(&ctrl->imm, ah->av.eth.mac + 2, 4); | 2227 | memcpy(&ctrl->imm, ah->av.eth.mac + 2, 4); |
| 2217 | memcpy(&in6, sgid.raw, sizeof(in6)); | 2228 | memcpy(&in6, sgid.raw, sizeof(in6)); |
| 2218 | 2229 | ||
| 2219 | if (!mlx4_is_mfunc(to_mdev(ib_dev)->dev)) | 2230 | if (!mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { |
| 2220 | smac = to_mdev(sqp->qp.ibqp.device)-> | 2231 | u64 mac = atomic64_read(&to_mdev(ib_dev)->iboe.mac[sqp->qp.port - 1]); |
| 2221 | iboe.netdevs[sqp->qp.port - 1]->dev_addr; | 2232 | u8 smac[ETH_ALEN]; |
| 2222 | else /* use the src mac of the tunnel */ | 2233 | |
| 2223 | smac = ah->av.eth.s_mac; | 2234 | mlx4_u64_to_smac(smac, mac); |
| 2224 | memcpy(sqp->ud_header.eth.smac_h, smac, 6); | 2235 | memcpy(sqp->ud_header.eth.smac_h, smac, ETH_ALEN); |
| 2236 | } else { | ||
| 2237 | /* use the src mac of the tunnel */ | ||
| 2238 | memcpy(sqp->ud_header.eth.smac_h, ah->av.eth.s_mac, ETH_ALEN); | ||
| 2239 | } | ||
| 2240 | |||
| 2225 | if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6)) | 2241 | if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6)) |
| 2226 | mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK); | 2242 | mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK); |
| 2227 | if (!is_vlan) { | 2243 | if (!is_vlan) { |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c index 40f8536c10b0..ac02ce4e8040 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | #define OCRDMA_VID_PCP_SHIFT 0xD | 38 | #define OCRDMA_VID_PCP_SHIFT 0xD |
| 39 | 39 | ||
| 40 | static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | 40 | static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, |
| 41 | struct ib_ah_attr *attr, int pdid) | 41 | struct ib_ah_attr *attr, union ib_gid *sgid, int pdid) |
| 42 | { | 42 | { |
| 43 | int status = 0; | 43 | int status = 0; |
| 44 | u16 vlan_tag; bool vlan_enabled = false; | 44 | u16 vlan_tag; bool vlan_enabled = false; |
| @@ -49,8 +49,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | |||
| 49 | memset(ð, 0, sizeof(eth)); | 49 | memset(ð, 0, sizeof(eth)); |
| 50 | memset(&grh, 0, sizeof(grh)); | 50 | memset(&grh, 0, sizeof(grh)); |
| 51 | 51 | ||
| 52 | ah->sgid_index = attr->grh.sgid_index; | 52 | /* VLAN */ |
| 53 | |||
| 54 | vlan_tag = attr->vlan_id; | 53 | vlan_tag = attr->vlan_id; |
| 55 | if (!vlan_tag || (vlan_tag > 0xFFF)) | 54 | if (!vlan_tag || (vlan_tag > 0xFFF)) |
| 56 | vlan_tag = dev->pvid; | 55 | vlan_tag = dev->pvid; |
| @@ -65,15 +64,14 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | |||
| 65 | eth.eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); | 64 | eth.eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); |
| 66 | eth_sz = sizeof(struct ocrdma_eth_basic); | 65 | eth_sz = sizeof(struct ocrdma_eth_basic); |
| 67 | } | 66 | } |
| 67 | /* MAC */ | ||
| 68 | memcpy(ð.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN); | 68 | memcpy(ð.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN); |
| 69 | memcpy(ð.dmac[0], attr->dmac, ETH_ALEN); | ||
| 70 | status = ocrdma_resolve_dmac(dev, attr, ð.dmac[0]); | 69 | status = ocrdma_resolve_dmac(dev, attr, ð.dmac[0]); |
| 71 | if (status) | 70 | if (status) |
| 72 | return status; | 71 | return status; |
| 73 | status = ocrdma_query_gid(&dev->ibdev, 1, attr->grh.sgid_index, | 72 | ah->sgid_index = attr->grh.sgid_index; |
| 74 | (union ib_gid *)&grh.sgid[0]); | 73 | memcpy(&grh.sgid[0], sgid->raw, sizeof(union ib_gid)); |
| 75 | if (status) | 74 | memcpy(&grh.dgid[0], attr->grh.dgid.raw, sizeof(attr->grh.dgid.raw)); |
| 76 | return status; | ||
| 77 | 75 | ||
| 78 | grh.tclass_flow = cpu_to_be32((6 << 28) | | 76 | grh.tclass_flow = cpu_to_be32((6 << 28) | |
| 79 | (attr->grh.traffic_class << 24) | | 77 | (attr->grh.traffic_class << 24) | |
| @@ -81,8 +79,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | |||
| 81 | /* 0x1b is next header value in GRH */ | 79 | /* 0x1b is next header value in GRH */ |
| 82 | grh.pdid_hoplimit = cpu_to_be32((pdid << 16) | | 80 | grh.pdid_hoplimit = cpu_to_be32((pdid << 16) | |
| 83 | (0x1b << 8) | attr->grh.hop_limit); | 81 | (0x1b << 8) | attr->grh.hop_limit); |
| 84 | 82 | /* Eth HDR */ | |
| 85 | memcpy(&grh.dgid[0], attr->grh.dgid.raw, sizeof(attr->grh.dgid.raw)); | ||
| 86 | memcpy(&ah->av->eth_hdr, ð, eth_sz); | 83 | memcpy(&ah->av->eth_hdr, ð, eth_sz); |
| 87 | memcpy((u8 *)ah->av + eth_sz, &grh, sizeof(struct ocrdma_grh)); | 84 | memcpy((u8 *)ah->av + eth_sz, &grh, sizeof(struct ocrdma_grh)); |
| 88 | if (vlan_enabled) | 85 | if (vlan_enabled) |
| @@ -98,6 +95,8 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) | |||
| 98 | struct ocrdma_ah *ah; | 95 | struct ocrdma_ah *ah; |
| 99 | struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); | 96 | struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); |
| 100 | struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); | 97 | struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); |
| 98 | union ib_gid sgid; | ||
| 99 | u8 zmac[ETH_ALEN]; | ||
| 101 | 100 | ||
| 102 | if (!(attr->ah_flags & IB_AH_GRH)) | 101 | if (!(attr->ah_flags & IB_AH_GRH)) |
| 103 | return ERR_PTR(-EINVAL); | 102 | return ERR_PTR(-EINVAL); |
| @@ -111,7 +110,27 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) | |||
| 111 | status = ocrdma_alloc_av(dev, ah); | 110 | status = ocrdma_alloc_av(dev, ah); |
| 112 | if (status) | 111 | if (status) |
| 113 | goto av_err; | 112 | goto av_err; |
| 114 | status = set_av_attr(dev, ah, attr, pd->id); | 113 | |
| 114 | status = ocrdma_query_gid(&dev->ibdev, 1, attr->grh.sgid_index, &sgid); | ||
| 115 | if (status) { | ||
| 116 | pr_err("%s(): Failed to query sgid, status = %d\n", | ||
| 117 | __func__, status); | ||
| 118 | goto av_conf_err; | ||
| 119 | } | ||
| 120 | |||
| 121 | memset(&zmac, 0, ETH_ALEN); | ||
| 122 | if (pd->uctx && | ||
| 123 | memcmp(attr->dmac, &zmac, ETH_ALEN)) { | ||
| 124 | status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid, | ||
| 125 | attr->dmac, &attr->vlan_id); | ||
| 126 | if (status) { | ||
| 127 | pr_err("%s(): Failed to resolve dmac from gid." | ||
| 128 | "status = %d\n", __func__, status); | ||
| 129 | goto av_conf_err; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | status = set_av_attr(dev, ah, attr, &sgid, pd->id); | ||
| 115 | if (status) | 134 | if (status) |
| 116 | goto av_conf_err; | 135 | goto av_conf_err; |
| 117 | 136 | ||
| @@ -145,7 +164,7 @@ int ocrdma_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr) | |||
| 145 | struct ocrdma_av *av = ah->av; | 164 | struct ocrdma_av *av = ah->av; |
| 146 | struct ocrdma_grh *grh; | 165 | struct ocrdma_grh *grh; |
| 147 | attr->ah_flags |= IB_AH_GRH; | 166 | attr->ah_flags |= IB_AH_GRH; |
| 148 | if (ah->av->valid & Bit(1)) { | 167 | if (ah->av->valid & OCRDMA_AV_VALID) { |
| 149 | grh = (struct ocrdma_grh *)((u8 *)ah->av + | 168 | grh = (struct ocrdma_grh *)((u8 *)ah->av + |
| 150 | sizeof(struct ocrdma_eth_vlan)); | 169 | sizeof(struct ocrdma_eth_vlan)); |
| 151 | attr->sl = be16_to_cpu(av->eth_hdr.vlan_tag) >> 13; | 170 | attr->sl = be16_to_cpu(av->eth_hdr.vlan_tag) >> 13; |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index acb434d16903..8f5f2577f288 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
| @@ -101,7 +101,7 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr) | |||
| 101 | attr->max_srq_sge = dev->attr.max_srq_sge; | 101 | attr->max_srq_sge = dev->attr.max_srq_sge; |
| 102 | attr->max_srq_wr = dev->attr.max_rqe; | 102 | attr->max_srq_wr = dev->attr.max_rqe; |
| 103 | attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay; | 103 | attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay; |
| 104 | attr->max_fast_reg_page_list_len = 0; | 104 | attr->max_fast_reg_page_list_len = dev->attr.max_pages_per_frmr; |
| 105 | attr->max_pkeys = 1; | 105 | attr->max_pkeys = 1; |
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| @@ -2846,11 +2846,9 @@ int ocrdma_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags cq_flags) | |||
| 2846 | if (cq->first_arm) { | 2846 | if (cq->first_arm) { |
| 2847 | ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0); | 2847 | ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0); |
| 2848 | cq->first_arm = false; | 2848 | cq->first_arm = false; |
| 2849 | goto skip_defer; | ||
| 2850 | } | 2849 | } |
| 2851 | cq->deferred_arm = true; | ||
| 2852 | 2850 | ||
| 2853 | skip_defer: | 2851 | cq->deferred_arm = true; |
| 2854 | cq->deferred_sol = sol_needed; | 2852 | cq->deferred_sol = sol_needed; |
| 2855 | spin_unlock_irqrestore(&cq->cq_lock, flags); | 2853 | spin_unlock_irqrestore(&cq->cq_lock, flags); |
| 2856 | 2854 | ||
diff --git a/drivers/infiniband/hw/qib/qib_debugfs.c b/drivers/infiniband/hw/qib/qib_debugfs.c index 799a0c3bffc4..6abd3ed3cd51 100644 --- a/drivers/infiniband/hw/qib/qib_debugfs.c +++ b/drivers/infiniband/hw/qib/qib_debugfs.c | |||
| @@ -193,6 +193,7 @@ static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos) | |||
| 193 | struct qib_qp_iter *iter; | 193 | struct qib_qp_iter *iter; |
| 194 | loff_t n = *pos; | 194 | loff_t n = *pos; |
| 195 | 195 | ||
| 196 | rcu_read_lock(); | ||
| 196 | iter = qib_qp_iter_init(s->private); | 197 | iter = qib_qp_iter_init(s->private); |
| 197 | if (!iter) | 198 | if (!iter) |
| 198 | return NULL; | 199 | return NULL; |
| @@ -224,7 +225,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr, | |||
| 224 | 225 | ||
| 225 | static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr) | 226 | static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr) |
| 226 | { | 227 | { |
| 227 | /* nothing for now */ | 228 | rcu_read_unlock(); |
| 228 | } | 229 | } |
| 229 | 230 | ||
| 230 | static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr) | 231 | static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr) |
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index 7fcc150d603c..6ddc0264aad2 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c | |||
| @@ -1325,7 +1325,6 @@ int qib_qp_iter_next(struct qib_qp_iter *iter) | |||
| 1325 | struct qib_qp *pqp = iter->qp; | 1325 | struct qib_qp *pqp = iter->qp; |
| 1326 | struct qib_qp *qp; | 1326 | struct qib_qp *qp; |
| 1327 | 1327 | ||
| 1328 | rcu_read_lock(); | ||
| 1329 | for (; n < dev->qp_table_size; n++) { | 1328 | for (; n < dev->qp_table_size; n++) { |
| 1330 | if (pqp) | 1329 | if (pqp) |
| 1331 | qp = rcu_dereference(pqp->next); | 1330 | qp = rcu_dereference(pqp->next); |
| @@ -1333,18 +1332,11 @@ int qib_qp_iter_next(struct qib_qp_iter *iter) | |||
| 1333 | qp = rcu_dereference(dev->qp_table[n]); | 1332 | qp = rcu_dereference(dev->qp_table[n]); |
| 1334 | pqp = qp; | 1333 | pqp = qp; |
| 1335 | if (qp) { | 1334 | if (qp) { |
| 1336 | if (iter->qp) | ||
| 1337 | atomic_dec(&iter->qp->refcount); | ||
| 1338 | atomic_inc(&qp->refcount); | ||
| 1339 | rcu_read_unlock(); | ||
| 1340 | iter->qp = qp; | 1335 | iter->qp = qp; |
| 1341 | iter->n = n; | 1336 | iter->n = n; |
| 1342 | return 0; | 1337 | return 0; |
| 1343 | } | 1338 | } |
| 1344 | } | 1339 | } |
| 1345 | rcu_read_unlock(); | ||
| 1346 | if (iter->qp) | ||
| 1347 | atomic_dec(&iter->qp->refcount); | ||
| 1348 | return ret; | 1340 | return ret; |
| 1349 | } | 1341 | } |
| 1350 | 1342 | ||
diff --git a/drivers/infiniband/hw/qib/qib_user_pages.c b/drivers/infiniband/hw/qib/qib_user_pages.c index 2bc1d2b96298..74f90b2619f6 100644 --- a/drivers/infiniband/hw/qib/qib_user_pages.c +++ b/drivers/infiniband/hw/qib/qib_user_pages.c | |||
| @@ -52,7 +52,7 @@ static void __qib_release_user_pages(struct page **p, size_t num_pages, | |||
| 52 | * Call with current->mm->mmap_sem held. | 52 | * Call with current->mm->mmap_sem held. |
| 53 | */ | 53 | */ |
| 54 | static int __qib_get_user_pages(unsigned long start_page, size_t num_pages, | 54 | static int __qib_get_user_pages(unsigned long start_page, size_t num_pages, |
| 55 | struct page **p, struct vm_area_struct **vma) | 55 | struct page **p) |
| 56 | { | 56 | { |
| 57 | unsigned long lock_limit; | 57 | unsigned long lock_limit; |
| 58 | size_t got; | 58 | size_t got; |
| @@ -69,7 +69,7 @@ static int __qib_get_user_pages(unsigned long start_page, size_t num_pages, | |||
| 69 | ret = get_user_pages(current, current->mm, | 69 | ret = get_user_pages(current, current->mm, |
| 70 | start_page + got * PAGE_SIZE, | 70 | start_page + got * PAGE_SIZE, |
| 71 | num_pages - got, 1, 1, | 71 | num_pages - got, 1, 1, |
| 72 | p + got, vma); | 72 | p + got, NULL); |
| 73 | if (ret < 0) | 73 | if (ret < 0) |
| 74 | goto bail_release; | 74 | goto bail_release; |
| 75 | } | 75 | } |
| @@ -136,7 +136,7 @@ int qib_get_user_pages(unsigned long start_page, size_t num_pages, | |||
| 136 | 136 | ||
| 137 | down_write(¤t->mm->mmap_sem); | 137 | down_write(¤t->mm->mmap_sem); |
| 138 | 138 | ||
| 139 | ret = __qib_get_user_pages(start_page, num_pages, p, NULL); | 139 | ret = __qib_get_user_pages(start_page, num_pages, p); |
| 140 | 140 | ||
| 141 | up_write(¤t->mm->mmap_sem); | 141 | up_write(¤t->mm->mmap_sem); |
| 142 | 142 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 3edce617c31b..d7562beb5423 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
| @@ -131,6 +131,12 @@ struct ipoib_cb { | |||
| 131 | u8 hwaddr[INFINIBAND_ALEN]; | 131 | u8 hwaddr[INFINIBAND_ALEN]; |
| 132 | }; | 132 | }; |
| 133 | 133 | ||
| 134 | static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb) | ||
| 135 | { | ||
| 136 | BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb)); | ||
| 137 | return (struct ipoib_cb *)skb->cb; | ||
| 138 | } | ||
| 139 | |||
| 134 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ | 140 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ |
| 135 | struct ipoib_mcast { | 141 | struct ipoib_mcast { |
| 136 | struct ib_sa_mcmember_rec mcmember; | 142 | struct ib_sa_mcmember_rec mcmember; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 1310acf6bf92..13e6e0431592 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -716,7 +716,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 716 | { | 716 | { |
| 717 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 717 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 718 | struct ipoib_neigh *neigh; | 718 | struct ipoib_neigh *neigh; |
| 719 | struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb; | 719 | struct ipoib_cb *cb = ipoib_skb_cb(skb); |
| 720 | struct ipoib_header *header; | 720 | struct ipoib_header *header; |
| 721 | unsigned long flags; | 721 | unsigned long flags; |
| 722 | 722 | ||
| @@ -813,7 +813,7 @@ static int ipoib_hard_header(struct sk_buff *skb, | |||
| 813 | const void *daddr, const void *saddr, unsigned len) | 813 | const void *daddr, const void *saddr, unsigned len) |
| 814 | { | 814 | { |
| 815 | struct ipoib_header *header; | 815 | struct ipoib_header *header; |
| 816 | struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb; | 816 | struct ipoib_cb *cb = ipoib_skb_cb(skb); |
| 817 | 817 | ||
| 818 | header = (struct ipoib_header *) skb_push(skb, sizeof *header); | 818 | header = (struct ipoib_header *) skb_push(skb, sizeof *header); |
| 819 | 819 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index d4e005720d01..ffb83b5f7e80 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
| @@ -529,21 +529,13 @@ void ipoib_mcast_join_task(struct work_struct *work) | |||
| 529 | port_attr.state); | 529 | port_attr.state); |
| 530 | return; | 530 | return; |
| 531 | } | 531 | } |
| 532 | priv->local_lid = port_attr.lid; | ||
| 532 | 533 | ||
| 533 | if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid)) | 534 | if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid)) |
| 534 | ipoib_warn(priv, "ib_query_gid() failed\n"); | 535 | ipoib_warn(priv, "ib_query_gid() failed\n"); |
| 535 | else | 536 | else |
| 536 | memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid)); | 537 | memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid)); |
| 537 | 538 | ||
| 538 | { | ||
| 539 | struct ib_port_attr attr; | ||
| 540 | |||
| 541 | if (!ib_query_port(priv->ca, priv->port, &attr)) | ||
| 542 | priv->local_lid = attr.lid; | ||
| 543 | else | ||
| 544 | ipoib_warn(priv, "ib_query_port failed\n"); | ||
| 545 | } | ||
| 546 | |||
| 547 | if (!priv->broadcast) { | 539 | if (!priv->broadcast) { |
| 548 | struct ipoib_mcast *broadcast; | 540 | struct ipoib_mcast *broadcast; |
| 549 | 541 | ||
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 61ee91d88380..93ce62fe1594 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
| @@ -344,7 +344,6 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, | |||
| 344 | int is_leading) | 344 | int is_leading) |
| 345 | { | 345 | { |
| 346 | struct iscsi_conn *conn = cls_conn->dd_data; | 346 | struct iscsi_conn *conn = cls_conn->dd_data; |
| 347 | struct iscsi_session *session; | ||
| 348 | struct iser_conn *ib_conn; | 347 | struct iser_conn *ib_conn; |
| 349 | struct iscsi_endpoint *ep; | 348 | struct iscsi_endpoint *ep; |
| 350 | int error; | 349 | int error; |
| @@ -363,9 +362,17 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, | |||
| 363 | } | 362 | } |
| 364 | ib_conn = ep->dd_data; | 363 | ib_conn = ep->dd_data; |
| 365 | 364 | ||
| 366 | session = conn->session; | 365 | mutex_lock(&ib_conn->state_mutex); |
| 367 | if (iser_alloc_rx_descriptors(ib_conn, session)) | 366 | if (ib_conn->state != ISER_CONN_UP) { |
| 368 | return -ENOMEM; | 367 | error = -EINVAL; |
| 368 | iser_err("iser_conn %p state is %d, teardown started\n", | ||
| 369 | ib_conn, ib_conn->state); | ||
| 370 | goto out; | ||
| 371 | } | ||
| 372 | |||
| 373 | error = iser_alloc_rx_descriptors(ib_conn, conn->session); | ||
| 374 | if (error) | ||
| 375 | goto out; | ||
| 369 | 376 | ||
| 370 | /* binds the iSER connection retrieved from the previously | 377 | /* binds the iSER connection retrieved from the previously |
| 371 | * connected ep_handle to the iSCSI layer connection. exchanges | 378 | * connected ep_handle to the iSCSI layer connection. exchanges |
| @@ -375,7 +382,9 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, | |||
| 375 | conn->dd_data = ib_conn; | 382 | conn->dd_data = ib_conn; |
| 376 | ib_conn->iscsi_conn = conn; | 383 | ib_conn->iscsi_conn = conn; |
| 377 | 384 | ||
| 378 | return 0; | 385 | out: |
| 386 | mutex_unlock(&ib_conn->state_mutex); | ||
| 387 | return error; | ||
| 379 | } | 388 | } |
| 380 | 389 | ||
| 381 | static int | 390 | static int |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index c877dad381cb..9f0e0e34d6ca 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | 69 | ||
| 70 | #define DRV_NAME "iser" | 70 | #define DRV_NAME "iser" |
| 71 | #define PFX DRV_NAME ": " | 71 | #define PFX DRV_NAME ": " |
| 72 | #define DRV_VER "1.4" | 72 | #define DRV_VER "1.4.1" |
| 73 | 73 | ||
| 74 | #define iser_dbg(fmt, arg...) \ | 74 | #define iser_dbg(fmt, arg...) \ |
| 75 | do { \ | 75 | do { \ |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 3ef167f97d6f..3bfec4bbda52 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
| @@ -73,7 +73,7 @@ static int iser_create_device_ib_res(struct iser_device *device) | |||
| 73 | { | 73 | { |
| 74 | struct iser_cq_desc *cq_desc; | 74 | struct iser_cq_desc *cq_desc; |
| 75 | struct ib_device_attr *dev_attr = &device->dev_attr; | 75 | struct ib_device_attr *dev_attr = &device->dev_attr; |
| 76 | int ret, i, j; | 76 | int ret, i; |
| 77 | 77 | ||
| 78 | ret = ib_query_device(device->ib_device, dev_attr); | 78 | ret = ib_query_device(device->ib_device, dev_attr); |
| 79 | if (ret) { | 79 | if (ret) { |
| @@ -125,16 +125,20 @@ static int iser_create_device_ib_res(struct iser_device *device) | |||
| 125 | iser_cq_event_callback, | 125 | iser_cq_event_callback, |
| 126 | (void *)&cq_desc[i], | 126 | (void *)&cq_desc[i], |
| 127 | ISER_MAX_RX_CQ_LEN, i); | 127 | ISER_MAX_RX_CQ_LEN, i); |
| 128 | if (IS_ERR(device->rx_cq[i])) | 128 | if (IS_ERR(device->rx_cq[i])) { |
| 129 | device->rx_cq[i] = NULL; | ||
| 129 | goto cq_err; | 130 | goto cq_err; |
| 131 | } | ||
| 130 | 132 | ||
| 131 | device->tx_cq[i] = ib_create_cq(device->ib_device, | 133 | device->tx_cq[i] = ib_create_cq(device->ib_device, |
| 132 | NULL, iser_cq_event_callback, | 134 | NULL, iser_cq_event_callback, |
| 133 | (void *)&cq_desc[i], | 135 | (void *)&cq_desc[i], |
| 134 | ISER_MAX_TX_CQ_LEN, i); | 136 | ISER_MAX_TX_CQ_LEN, i); |
| 135 | 137 | ||
| 136 | if (IS_ERR(device->tx_cq[i])) | 138 | if (IS_ERR(device->tx_cq[i])) { |
| 139 | device->tx_cq[i] = NULL; | ||
| 137 | goto cq_err; | 140 | goto cq_err; |
| 141 | } | ||
| 138 | 142 | ||
| 139 | if (ib_req_notify_cq(device->rx_cq[i], IB_CQ_NEXT_COMP)) | 143 | if (ib_req_notify_cq(device->rx_cq[i], IB_CQ_NEXT_COMP)) |
| 140 | goto cq_err; | 144 | goto cq_err; |
| @@ -160,14 +164,14 @@ static int iser_create_device_ib_res(struct iser_device *device) | |||
| 160 | handler_err: | 164 | handler_err: |
| 161 | ib_dereg_mr(device->mr); | 165 | ib_dereg_mr(device->mr); |
| 162 | dma_mr_err: | 166 | dma_mr_err: |
| 163 | for (j = 0; j < device->cqs_used; j++) | 167 | for (i = 0; i < device->cqs_used; i++) |
| 164 | tasklet_kill(&device->cq_tasklet[j]); | 168 | tasklet_kill(&device->cq_tasklet[i]); |
| 165 | cq_err: | 169 | cq_err: |
| 166 | for (j = 0; j < i; j++) { | 170 | for (i = 0; i < device->cqs_used; i++) { |
| 167 | if (device->tx_cq[j]) | 171 | if (device->tx_cq[i]) |
| 168 | ib_destroy_cq(device->tx_cq[j]); | 172 | ib_destroy_cq(device->tx_cq[i]); |
| 169 | if (device->rx_cq[j]) | 173 | if (device->rx_cq[i]) |
| 170 | ib_destroy_cq(device->rx_cq[j]); | 174 | ib_destroy_cq(device->rx_cq[i]); |
| 171 | } | 175 | } |
| 172 | ib_dealloc_pd(device->pd); | 176 | ib_dealloc_pd(device->pd); |
| 173 | pd_err: | 177 | pd_err: |
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig index a34a11d2fef2..63ca9841db10 100644 --- a/drivers/message/fusion/Kconfig +++ b/drivers/message/fusion/Kconfig | |||
| @@ -29,7 +29,7 @@ config FUSION_SPI | |||
| 29 | config FUSION_FC | 29 | config FUSION_FC |
| 30 | tristate "Fusion MPT ScsiHost drivers for FC" | 30 | tristate "Fusion MPT ScsiHost drivers for FC" |
| 31 | depends on PCI && SCSI | 31 | depends on PCI && SCSI |
| 32 | select SCSI_FC_ATTRS | 32 | depends on SCSI_FC_ATTRS |
| 33 | ---help--- | 33 | ---help--- |
| 34 | SCSI HOST support for a Fiber Channel host adapters. | 34 | SCSI HOST support for a Fiber Channel host adapters. |
| 35 | 35 | ||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f0f5eab0fab1..798ae69fb63c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -175,7 +175,7 @@ MODULE_PARM_DESC(fail_over_mac, "For active-backup, do not set all slaves to " | |||
| 175 | "the same MAC; 0 for none (default), " | 175 | "the same MAC; 0 for none (default), " |
| 176 | "1 for active, 2 for follow"); | 176 | "1 for active, 2 for follow"); |
| 177 | module_param(all_slaves_active, int, 0); | 177 | module_param(all_slaves_active, int, 0); |
| 178 | MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface" | 178 | MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface " |
| 179 | "by setting active flag for all slaves; " | 179 | "by setting active flag for all slaves; " |
| 180 | "0 for never (default), 1 for always."); | 180 | "0 for never (default), 1 for always."); |
| 181 | module_param(resend_igmp, int, 0); | 181 | module_param(resend_igmp, int, 0); |
| @@ -3659,8 +3659,14 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev | |||
| 3659 | else | 3659 | else |
| 3660 | bond_xmit_slave_id(bond, skb, 0); | 3660 | bond_xmit_slave_id(bond, skb, 0); |
| 3661 | } else { | 3661 | } else { |
| 3662 | slave_id = bond_rr_gen_slave_id(bond); | 3662 | int slave_cnt = ACCESS_ONCE(bond->slave_cnt); |
| 3663 | bond_xmit_slave_id(bond, skb, slave_id % bond->slave_cnt); | 3663 | |
| 3664 | if (likely(slave_cnt)) { | ||
| 3665 | slave_id = bond_rr_gen_slave_id(bond); | ||
| 3666 | bond_xmit_slave_id(bond, skb, slave_id % slave_cnt); | ||
| 3667 | } else { | ||
| 3668 | dev_kfree_skb_any(skb); | ||
| 3669 | } | ||
| 3664 | } | 3670 | } |
| 3665 | 3671 | ||
| 3666 | return NETDEV_TX_OK; | 3672 | return NETDEV_TX_OK; |
| @@ -3691,8 +3697,13 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d | |||
| 3691 | static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) | 3697 | static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) |
| 3692 | { | 3698 | { |
| 3693 | struct bonding *bond = netdev_priv(bond_dev); | 3699 | struct bonding *bond = netdev_priv(bond_dev); |
| 3700 | int slave_cnt = ACCESS_ONCE(bond->slave_cnt); | ||
| 3694 | 3701 | ||
| 3695 | bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb) % bond->slave_cnt); | 3702 | if (likely(slave_cnt)) |
| 3703 | bond_xmit_slave_id(bond, skb, | ||
| 3704 | bond_xmit_hash(bond, skb) % slave_cnt); | ||
| 3705 | else | ||
| 3706 | dev_kfree_skb_any(skb); | ||
| 3696 | 3707 | ||
| 3697 | return NETDEV_TX_OK; | 3708 | return NETDEV_TX_OK; |
| 3698 | } | 3709 | } |
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index f07fa89b5fd5..05e1aa090add 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
| @@ -1123,7 +1123,9 @@ static int at91_open(struct net_device *dev) | |||
| 1123 | struct at91_priv *priv = netdev_priv(dev); | 1123 | struct at91_priv *priv = netdev_priv(dev); |
| 1124 | int err; | 1124 | int err; |
| 1125 | 1125 | ||
| 1126 | clk_enable(priv->clk); | 1126 | err = clk_prepare_enable(priv->clk); |
| 1127 | if (err) | ||
| 1128 | return err; | ||
| 1127 | 1129 | ||
| 1128 | /* check or determine and set bittime */ | 1130 | /* check or determine and set bittime */ |
| 1129 | err = open_candev(dev); | 1131 | err = open_candev(dev); |
| @@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev) | |||
| 1149 | out_close: | 1151 | out_close: |
| 1150 | close_candev(dev); | 1152 | close_candev(dev); |
| 1151 | out: | 1153 | out: |
| 1152 | clk_disable(priv->clk); | 1154 | clk_disable_unprepare(priv->clk); |
| 1153 | 1155 | ||
| 1154 | return err; | 1156 | return err; |
| 1155 | } | 1157 | } |
| @@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev) | |||
| 1166 | at91_chip_stop(dev, CAN_STATE_STOPPED); | 1168 | at91_chip_stop(dev, CAN_STATE_STOPPED); |
| 1167 | 1169 | ||
| 1168 | free_irq(dev->irq, dev); | 1170 | free_irq(dev->irq, dev); |
| 1169 | clk_disable(priv->clk); | 1171 | clk_disable_unprepare(priv->clk); |
| 1170 | 1172 | ||
| 1171 | close_candev(dev); | 1173 | close_candev(dev); |
| 1172 | 1174 | ||
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 109cb44291f5..fb279d6ae484 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
| @@ -97,14 +97,14 @@ static void c_can_hw_raminit_ti(const struct c_can_priv *priv, bool enable) | |||
| 97 | ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance); | 97 | ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance); |
| 98 | writel(ctrl, priv->raminit_ctrlreg); | 98 | writel(ctrl, priv->raminit_ctrlreg); |
| 99 | ctrl &= ~CAN_RAMINIT_DONE_MASK(priv->instance); | 99 | ctrl &= ~CAN_RAMINIT_DONE_MASK(priv->instance); |
| 100 | c_can_hw_raminit_wait_ti(priv, ctrl, mask); | 100 | c_can_hw_raminit_wait_ti(priv, mask, ctrl); |
| 101 | 101 | ||
| 102 | if (enable) { | 102 | if (enable) { |
| 103 | /* Set start bit and wait for the done bit. */ | 103 | /* Set start bit and wait for the done bit. */ |
| 104 | ctrl |= CAN_RAMINIT_START_MASK(priv->instance); | 104 | ctrl |= CAN_RAMINIT_START_MASK(priv->instance); |
| 105 | writel(ctrl, priv->raminit_ctrlreg); | 105 | writel(ctrl, priv->raminit_ctrlreg); |
| 106 | ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance); | 106 | ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance); |
| 107 | c_can_hw_raminit_wait_ti(priv, ctrl, mask); | 107 | c_can_hw_raminit_wait_ti(priv, mask, ctrl); |
| 108 | } | 108 | } |
| 109 | spin_unlock(&raminit_lock); | 109 | spin_unlock(&raminit_lock); |
| 110 | } | 110 | } |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 944aa5d3af6e..6586309329e6 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | #define FLEXCAN_MCR_BCC BIT(16) | 62 | #define FLEXCAN_MCR_BCC BIT(16) |
| 63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) | 63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) |
| 64 | #define FLEXCAN_MCR_AEN BIT(12) | 64 | #define FLEXCAN_MCR_AEN BIT(12) |
| 65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f) | 65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x7f) |
| 66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) | 66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) |
| 67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) | 67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) |
| 68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) | 68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) |
| @@ -125,7 +125,9 @@ | |||
| 125 | FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT) | 125 | FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT) |
| 126 | 126 | ||
| 127 | /* FLEXCAN interrupt flag register (IFLAG) bits */ | 127 | /* FLEXCAN interrupt flag register (IFLAG) bits */ |
| 128 | #define FLEXCAN_TX_BUF_ID 8 | 128 | /* Errata ERR005829 step7: Reserve first valid MB */ |
| 129 | #define FLEXCAN_TX_BUF_RESERVED 8 | ||
| 130 | #define FLEXCAN_TX_BUF_ID 9 | ||
| 129 | #define FLEXCAN_IFLAG_BUF(x) BIT(x) | 131 | #define FLEXCAN_IFLAG_BUF(x) BIT(x) |
| 130 | #define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7) | 132 | #define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7) |
| 131 | #define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6) | 133 | #define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6) |
| @@ -136,6 +138,17 @@ | |||
| 136 | 138 | ||
| 137 | /* FLEXCAN message buffers */ | 139 | /* FLEXCAN message buffers */ |
| 138 | #define FLEXCAN_MB_CNT_CODE(x) (((x) & 0xf) << 24) | 140 | #define FLEXCAN_MB_CNT_CODE(x) (((x) & 0xf) << 24) |
| 141 | #define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24) | ||
| 142 | #define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24) | ||
| 143 | #define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24) | ||
| 144 | #define FLEXCAN_MB_CODE_RX_OVERRRUN (0x6 << 24) | ||
| 145 | #define FLEXCAN_MB_CODE_RX_RANSWER (0xa << 24) | ||
| 146 | |||
| 147 | #define FLEXCAN_MB_CODE_TX_INACTIVE (0x8 << 24) | ||
| 148 | #define FLEXCAN_MB_CODE_TX_ABORT (0x9 << 24) | ||
| 149 | #define FLEXCAN_MB_CODE_TX_DATA (0xc << 24) | ||
| 150 | #define FLEXCAN_MB_CODE_TX_TANSWER (0xe << 24) | ||
| 151 | |||
| 139 | #define FLEXCAN_MB_CNT_SRR BIT(22) | 152 | #define FLEXCAN_MB_CNT_SRR BIT(22) |
| 140 | #define FLEXCAN_MB_CNT_IDE BIT(21) | 153 | #define FLEXCAN_MB_CNT_IDE BIT(21) |
| 141 | #define FLEXCAN_MB_CNT_RTR BIT(20) | 154 | #define FLEXCAN_MB_CNT_RTR BIT(20) |
| @@ -298,7 +311,7 @@ static int flexcan_chip_enable(struct flexcan_priv *priv) | |||
| 298 | flexcan_write(reg, ®s->mcr); | 311 | flexcan_write(reg, ®s->mcr); |
| 299 | 312 | ||
| 300 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) | 313 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) |
| 301 | usleep_range(10, 20); | 314 | udelay(10); |
| 302 | 315 | ||
| 303 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK) | 316 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK) |
| 304 | return -ETIMEDOUT; | 317 | return -ETIMEDOUT; |
| @@ -317,7 +330,7 @@ static int flexcan_chip_disable(struct flexcan_priv *priv) | |||
| 317 | flexcan_write(reg, ®s->mcr); | 330 | flexcan_write(reg, ®s->mcr); |
| 318 | 331 | ||
| 319 | while (timeout-- && !(flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) | 332 | while (timeout-- && !(flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) |
| 320 | usleep_range(10, 20); | 333 | udelay(10); |
| 321 | 334 | ||
| 322 | if (!(flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) | 335 | if (!(flexcan_read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) |
| 323 | return -ETIMEDOUT; | 336 | return -ETIMEDOUT; |
| @@ -336,7 +349,7 @@ static int flexcan_chip_freeze(struct flexcan_priv *priv) | |||
| 336 | flexcan_write(reg, ®s->mcr); | 349 | flexcan_write(reg, ®s->mcr); |
| 337 | 350 | ||
| 338 | while (timeout-- && !(flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) | 351 | while (timeout-- && !(flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) |
| 339 | usleep_range(100, 200); | 352 | udelay(100); |
| 340 | 353 | ||
| 341 | if (!(flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) | 354 | if (!(flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) |
| 342 | return -ETIMEDOUT; | 355 | return -ETIMEDOUT; |
| @@ -355,7 +368,7 @@ static int flexcan_chip_unfreeze(struct flexcan_priv *priv) | |||
| 355 | flexcan_write(reg, ®s->mcr); | 368 | flexcan_write(reg, ®s->mcr); |
| 356 | 369 | ||
| 357 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) | 370 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) |
| 358 | usleep_range(10, 20); | 371 | udelay(10); |
| 359 | 372 | ||
| 360 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK) | 373 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK) |
| 361 | return -ETIMEDOUT; | 374 | return -ETIMEDOUT; |
| @@ -370,7 +383,7 @@ static int flexcan_chip_softreset(struct flexcan_priv *priv) | |||
| 370 | 383 | ||
| 371 | flexcan_write(FLEXCAN_MCR_SOFTRST, ®s->mcr); | 384 | flexcan_write(FLEXCAN_MCR_SOFTRST, ®s->mcr); |
| 372 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_SOFTRST)) | 385 | while (timeout-- && (flexcan_read(®s->mcr) & FLEXCAN_MCR_SOFTRST)) |
| 373 | usleep_range(10, 20); | 386 | udelay(10); |
| 374 | 387 | ||
| 375 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_SOFTRST) | 388 | if (flexcan_read(®s->mcr) & FLEXCAN_MCR_SOFTRST) |
| 376 | return -ETIMEDOUT; | 389 | return -ETIMEDOUT; |
| @@ -428,6 +441,14 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 428 | flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id); | 441 | flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id); |
| 429 | flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | 442 | flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); |
| 430 | 443 | ||
| 444 | /* Errata ERR005829 step8: | ||
| 445 | * Write twice INACTIVE(0x8) code to first MB. | ||
| 446 | */ | ||
| 447 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | ||
| 448 | ®s->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl); | ||
| 449 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | ||
| 450 | ®s->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl); | ||
| 451 | |||
| 431 | return NETDEV_TX_OK; | 452 | return NETDEV_TX_OK; |
| 432 | } | 453 | } |
| 433 | 454 | ||
| @@ -744,6 +765,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
| 744 | stats->tx_bytes += can_get_echo_skb(dev, 0); | 765 | stats->tx_bytes += can_get_echo_skb(dev, 0); |
| 745 | stats->tx_packets++; | 766 | stats->tx_packets++; |
| 746 | can_led_event(dev, CAN_LED_EVENT_TX); | 767 | can_led_event(dev, CAN_LED_EVENT_TX); |
| 768 | /* after sending a RTR frame mailbox is in RX mode */ | ||
| 769 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | ||
| 770 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | ||
| 747 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); | 771 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); |
| 748 | netif_wake_queue(dev); | 772 | netif_wake_queue(dev); |
| 749 | } | 773 | } |
| @@ -801,6 +825,7 @@ static int flexcan_chip_start(struct net_device *dev) | |||
| 801 | struct flexcan_regs __iomem *regs = priv->base; | 825 | struct flexcan_regs __iomem *regs = priv->base; |
| 802 | int err; | 826 | int err; |
| 803 | u32 reg_mcr, reg_ctrl; | 827 | u32 reg_mcr, reg_ctrl; |
| 828 | int i; | ||
| 804 | 829 | ||
| 805 | /* enable module */ | 830 | /* enable module */ |
| 806 | err = flexcan_chip_enable(priv); | 831 | err = flexcan_chip_enable(priv); |
| @@ -867,8 +892,18 @@ static int flexcan_chip_start(struct net_device *dev) | |||
| 867 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); | 892 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); |
| 868 | flexcan_write(reg_ctrl, ®s->ctrl); | 893 | flexcan_write(reg_ctrl, ®s->ctrl); |
| 869 | 894 | ||
| 870 | /* Abort any pending TX, mark Mailbox as INACTIVE */ | 895 | /* clear and invalidate all mailboxes first */ |
| 871 | flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), | 896 | for (i = FLEXCAN_TX_BUF_ID; i < ARRAY_SIZE(regs->cantxfg); i++) { |
| 897 | flexcan_write(FLEXCAN_MB_CODE_RX_INACTIVE, | ||
| 898 | ®s->cantxfg[i].can_ctrl); | ||
| 899 | } | ||
| 900 | |||
| 901 | /* Errata ERR005829: mark first TX mailbox as INACTIVE */ | ||
| 902 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | ||
| 903 | ®s->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl); | ||
| 904 | |||
| 905 | /* mark TX mailbox as INACTIVE */ | ||
| 906 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | ||
| 872 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | 907 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); |
| 873 | 908 | ||
| 874 | /* acceptance mask/acceptance code (accept everything) */ | 909 | /* acceptance mask/acceptance code (accept everything) */ |
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index 7a85590fefb9..e5fac368068a 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c | |||
| @@ -70,6 +70,8 @@ struct peak_pci_chan { | |||
| 70 | #define PEAK_PC_104P_DEVICE_ID 0x0006 /* PCAN-PC/104+ cards */ | 70 | #define PEAK_PC_104P_DEVICE_ID 0x0006 /* PCAN-PC/104+ cards */ |
| 71 | #define PEAK_PCI_104E_DEVICE_ID 0x0007 /* PCAN-PCI/104 Express cards */ | 71 | #define PEAK_PCI_104E_DEVICE_ID 0x0007 /* PCAN-PCI/104 Express cards */ |
| 72 | #define PEAK_MPCIE_DEVICE_ID 0x0008 /* The miniPCIe slot cards */ | 72 | #define PEAK_MPCIE_DEVICE_ID 0x0008 /* The miniPCIe slot cards */ |
| 73 | #define PEAK_PCIE_OEM_ID 0x0009 /* PCAN-PCI Express OEM */ | ||
| 74 | #define PEAK_PCIEC34_DEVICE_ID 0x000A /* PCAN-PCI Express 34 (one channel) */ | ||
| 73 | 75 | ||
| 74 | #define PEAK_PCI_CHAN_MAX 4 | 76 | #define PEAK_PCI_CHAN_MAX 4 |
| 75 | 77 | ||
| @@ -87,6 +89,7 @@ static const struct pci_device_id peak_pci_tbl[] = { | |||
| 87 | {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, | 89 | {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, |
| 88 | #ifdef CONFIG_CAN_PEAK_PCIEC | 90 | #ifdef CONFIG_CAN_PEAK_PCIEC |
| 89 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, | 91 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, |
| 92 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 90 | #endif | 93 | #endif |
| 91 | {0,} | 94 | {0,} |
| 92 | }; | 95 | }; |
| @@ -653,7 +656,8 @@ static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 653 | * This must be done *before* register_sja1000dev() but | 656 | * This must be done *before* register_sja1000dev() but |
| 654 | * *after* devices linkage | 657 | * *after* devices linkage |
| 655 | */ | 658 | */ |
| 656 | if (pdev->device == PEAK_PCIEC_DEVICE_ID) { | 659 | if (pdev->device == PEAK_PCIEC_DEVICE_ID || |
| 660 | pdev->device == PEAK_PCIEC34_DEVICE_ID) { | ||
| 657 | err = peak_pciec_probe(pdev, dev); | 661 | err = peak_pciec_probe(pdev, dev); |
| 658 | if (err) { | 662 | if (err) { |
| 659 | dev_err(&pdev->dev, | 663 | dev_err(&pdev->dev, |
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 3fe45c705933..8ca49f04acec 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c | |||
| @@ -2129,6 +2129,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2129 | int entry = vp->cur_tx % TX_RING_SIZE; | 2129 | int entry = vp->cur_tx % TX_RING_SIZE; |
| 2130 | struct boom_tx_desc *prev_entry = &vp->tx_ring[(vp->cur_tx-1) % TX_RING_SIZE]; | 2130 | struct boom_tx_desc *prev_entry = &vp->tx_ring[(vp->cur_tx-1) % TX_RING_SIZE]; |
| 2131 | unsigned long flags; | 2131 | unsigned long flags; |
| 2132 | dma_addr_t dma_addr; | ||
| 2132 | 2133 | ||
| 2133 | if (vortex_debug > 6) { | 2134 | if (vortex_debug > 6) { |
| 2134 | pr_debug("boomerang_start_xmit()\n"); | 2135 | pr_debug("boomerang_start_xmit()\n"); |
| @@ -2163,24 +2164,48 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2163 | vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum); | 2164 | vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum); |
| 2164 | 2165 | ||
| 2165 | if (!skb_shinfo(skb)->nr_frags) { | 2166 | if (!skb_shinfo(skb)->nr_frags) { |
| 2166 | vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, | 2167 | dma_addr = pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, |
| 2167 | skb->len, PCI_DMA_TODEVICE)); | 2168 | PCI_DMA_TODEVICE); |
| 2169 | if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr)) | ||
| 2170 | goto out_dma_err; | ||
| 2171 | |||
| 2172 | vp->tx_ring[entry].frag[0].addr = cpu_to_le32(dma_addr); | ||
| 2168 | vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len | LAST_FRAG); | 2173 | vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len | LAST_FRAG); |
| 2169 | } else { | 2174 | } else { |
| 2170 | int i; | 2175 | int i; |
| 2171 | 2176 | ||
| 2172 | vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, | 2177 | dma_addr = pci_map_single(VORTEX_PCI(vp), skb->data, |
| 2173 | skb_headlen(skb), PCI_DMA_TODEVICE)); | 2178 | skb_headlen(skb), PCI_DMA_TODEVICE); |
| 2179 | if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr)) | ||
| 2180 | goto out_dma_err; | ||
| 2181 | |||
| 2182 | vp->tx_ring[entry].frag[0].addr = cpu_to_le32(dma_addr); | ||
| 2174 | vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb_headlen(skb)); | 2183 | vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb_headlen(skb)); |
| 2175 | 2184 | ||
| 2176 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 2185 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
| 2177 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 2186 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
| 2178 | 2187 | ||
| 2188 | dma_addr = skb_frag_dma_map(&VORTEX_PCI(vp)->dev, frag, | ||
| 2189 | 0, | ||
| 2190 | frag->size, | ||
| 2191 | DMA_TO_DEVICE); | ||
| 2192 | if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr)) { | ||
| 2193 | for(i = i-1; i >= 0; i--) | ||
| 2194 | dma_unmap_page(&VORTEX_PCI(vp)->dev, | ||
| 2195 | le32_to_cpu(vp->tx_ring[entry].frag[i+1].addr), | ||
| 2196 | le32_to_cpu(vp->tx_ring[entry].frag[i+1].length), | ||
| 2197 | DMA_TO_DEVICE); | ||
| 2198 | |||
| 2199 | pci_unmap_single(VORTEX_PCI(vp), | ||
| 2200 | le32_to_cpu(vp->tx_ring[entry].frag[0].addr), | ||
| 2201 | le32_to_cpu(vp->tx_ring[entry].frag[0].length), | ||
| 2202 | PCI_DMA_TODEVICE); | ||
| 2203 | |||
| 2204 | goto out_dma_err; | ||
| 2205 | } | ||
| 2206 | |||
| 2179 | vp->tx_ring[entry].frag[i+1].addr = | 2207 | vp->tx_ring[entry].frag[i+1].addr = |
| 2180 | cpu_to_le32(skb_frag_dma_map( | 2208 | cpu_to_le32(dma_addr); |
| 2181 | &VORTEX_PCI(vp)->dev, | ||
| 2182 | frag, | ||
| 2183 | frag->page_offset, frag->size, DMA_TO_DEVICE)); | ||
| 2184 | 2209 | ||
| 2185 | if (i == skb_shinfo(skb)->nr_frags-1) | 2210 | if (i == skb_shinfo(skb)->nr_frags-1) |
| 2186 | vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG); | 2211 | vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG); |
| @@ -2189,7 +2214,10 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2189 | } | 2214 | } |
| 2190 | } | 2215 | } |
| 2191 | #else | 2216 | #else |
| 2192 | vp->tx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, PCI_DMA_TODEVICE)); | 2217 | dma_addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, PCI_DMA_TODEVICE)); |
| 2218 | if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr)) | ||
| 2219 | goto out_dma_err; | ||
| 2220 | vp->tx_ring[entry].addr = cpu_to_le32(dma_addr); | ||
| 2193 | vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG); | 2221 | vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG); |
| 2194 | vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded); | 2222 | vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded); |
| 2195 | #endif | 2223 | #endif |
| @@ -2217,7 +2245,11 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2217 | skb_tx_timestamp(skb); | 2245 | skb_tx_timestamp(skb); |
| 2218 | iowrite16(DownUnstall, ioaddr + EL3_CMD); | 2246 | iowrite16(DownUnstall, ioaddr + EL3_CMD); |
| 2219 | spin_unlock_irqrestore(&vp->lock, flags); | 2247 | spin_unlock_irqrestore(&vp->lock, flags); |
| 2248 | out: | ||
| 2220 | return NETDEV_TX_OK; | 2249 | return NETDEV_TX_OK; |
| 2250 | out_dma_err: | ||
| 2251 | dev_err(&VORTEX_PCI(vp)->dev, "Error mapping dma buffer\n"); | ||
| 2252 | goto out; | ||
| 2221 | } | 2253 | } |
| 2222 | 2254 | ||
| 2223 | /* The interrupt handler does all of the Rx thread work and cleans up | 2255 | /* The interrupt handler does all of the Rx thread work and cleans up |
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c index fe5cfeace6e3..5919394d9f58 100644 --- a/drivers/net/ethernet/arc/emac_main.c +++ b/drivers/net/ethernet/arc/emac_main.c | |||
| @@ -30,6 +30,17 @@ | |||
| 30 | #define DRV_VERSION "1.0" | 30 | #define DRV_VERSION "1.0" |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * arc_emac_tx_avail - Return the number of available slots in the tx ring. | ||
| 34 | * @priv: Pointer to ARC EMAC private data structure. | ||
| 35 | * | ||
| 36 | * returns: the number of slots available for transmission in tx the ring. | ||
| 37 | */ | ||
| 38 | static inline int arc_emac_tx_avail(struct arc_emac_priv *priv) | ||
| 39 | { | ||
| 40 | return (priv->txbd_dirty + TX_BD_NUM - priv->txbd_curr - 1) % TX_BD_NUM; | ||
| 41 | } | ||
| 42 | |||
| 43 | /** | ||
| 33 | * arc_emac_adjust_link - Adjust the PHY link duplex. | 44 | * arc_emac_adjust_link - Adjust the PHY link duplex. |
| 34 | * @ndev: Pointer to the net_device structure. | 45 | * @ndev: Pointer to the net_device structure. |
| 35 | * | 46 | * |
| @@ -180,10 +191,15 @@ static void arc_emac_tx_clean(struct net_device *ndev) | |||
| 180 | txbd->info = 0; | 191 | txbd->info = 0; |
| 181 | 192 | ||
| 182 | *txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM; | 193 | *txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM; |
| 183 | |||
| 184 | if (netif_queue_stopped(ndev)) | ||
| 185 | netif_wake_queue(ndev); | ||
| 186 | } | 194 | } |
| 195 | |||
| 196 | /* Ensure that txbd_dirty is visible to tx() before checking | ||
| 197 | * for queue stopped. | ||
| 198 | */ | ||
| 199 | smp_mb(); | ||
| 200 | |||
| 201 | if (netif_queue_stopped(ndev) && arc_emac_tx_avail(priv)) | ||
| 202 | netif_wake_queue(ndev); | ||
| 187 | } | 203 | } |
| 188 | 204 | ||
| 189 | /** | 205 | /** |
| @@ -298,7 +314,7 @@ static int arc_emac_poll(struct napi_struct *napi, int budget) | |||
| 298 | work_done = arc_emac_rx(ndev, budget); | 314 | work_done = arc_emac_rx(ndev, budget); |
| 299 | if (work_done < budget) { | 315 | if (work_done < budget) { |
| 300 | napi_complete(napi); | 316 | napi_complete(napi); |
| 301 | arc_reg_or(priv, R_ENABLE, RXINT_MASK); | 317 | arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK); |
| 302 | } | 318 | } |
| 303 | 319 | ||
| 304 | return work_done; | 320 | return work_done; |
| @@ -327,9 +343,9 @@ static irqreturn_t arc_emac_intr(int irq, void *dev_instance) | |||
| 327 | /* Reset all flags except "MDIO complete" */ | 343 | /* Reset all flags except "MDIO complete" */ |
| 328 | arc_reg_set(priv, R_STATUS, status); | 344 | arc_reg_set(priv, R_STATUS, status); |
| 329 | 345 | ||
| 330 | if (status & RXINT_MASK) { | 346 | if (status & (RXINT_MASK | TXINT_MASK)) { |
| 331 | if (likely(napi_schedule_prep(&priv->napi))) { | 347 | if (likely(napi_schedule_prep(&priv->napi))) { |
| 332 | arc_reg_clr(priv, R_ENABLE, RXINT_MASK); | 348 | arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK); |
| 333 | __napi_schedule(&priv->napi); | 349 | __napi_schedule(&priv->napi); |
| 334 | } | 350 | } |
| 335 | } | 351 | } |
| @@ -440,7 +456,7 @@ static int arc_emac_open(struct net_device *ndev) | |||
| 440 | arc_reg_set(priv, R_TX_RING, (unsigned int)priv->txbd_dma); | 456 | arc_reg_set(priv, R_TX_RING, (unsigned int)priv->txbd_dma); |
| 441 | 457 | ||
| 442 | /* Enable interrupts */ | 458 | /* Enable interrupts */ |
| 443 | arc_reg_set(priv, R_ENABLE, RXINT_MASK | ERR_MASK); | 459 | arc_reg_set(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK); |
| 444 | 460 | ||
| 445 | /* Set CONTROL */ | 461 | /* Set CONTROL */ |
| 446 | arc_reg_set(priv, R_CTRL, | 462 | arc_reg_set(priv, R_CTRL, |
| @@ -511,7 +527,7 @@ static int arc_emac_stop(struct net_device *ndev) | |||
| 511 | netif_stop_queue(ndev); | 527 | netif_stop_queue(ndev); |
| 512 | 528 | ||
| 513 | /* Disable interrupts */ | 529 | /* Disable interrupts */ |
| 514 | arc_reg_clr(priv, R_ENABLE, RXINT_MASK | ERR_MASK); | 530 | arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK); |
| 515 | 531 | ||
| 516 | /* Disable EMAC */ | 532 | /* Disable EMAC */ |
| 517 | arc_reg_clr(priv, R_CTRL, EN_MASK); | 533 | arc_reg_clr(priv, R_CTRL, EN_MASK); |
| @@ -574,11 +590,9 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) | |||
| 574 | 590 | ||
| 575 | len = max_t(unsigned int, ETH_ZLEN, skb->len); | 591 | len = max_t(unsigned int, ETH_ZLEN, skb->len); |
| 576 | 592 | ||
| 577 | /* EMAC still holds this buffer in its possession. | 593 | if (unlikely(!arc_emac_tx_avail(priv))) { |
| 578 | * CPU must not modify this buffer descriptor | ||
| 579 | */ | ||
| 580 | if (unlikely((le32_to_cpu(*info) & OWN_MASK) == FOR_EMAC)) { | ||
| 581 | netif_stop_queue(ndev); | 594 | netif_stop_queue(ndev); |
| 595 | netdev_err(ndev, "BUG! Tx Ring full when queue awake!\n"); | ||
| 582 | return NETDEV_TX_BUSY; | 596 | return NETDEV_TX_BUSY; |
| 583 | } | 597 | } |
| 584 | 598 | ||
| @@ -607,12 +621,19 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) | |||
| 607 | /* Increment index to point to the next BD */ | 621 | /* Increment index to point to the next BD */ |
| 608 | *txbd_curr = (*txbd_curr + 1) % TX_BD_NUM; | 622 | *txbd_curr = (*txbd_curr + 1) % TX_BD_NUM; |
| 609 | 623 | ||
| 610 | /* Get "info" of the next BD */ | 624 | /* Ensure that tx_clean() sees the new txbd_curr before |
| 611 | info = &priv->txbd[*txbd_curr].info; | 625 | * checking the queue status. This prevents an unneeded wake |
| 626 | * of the queue in tx_clean(). | ||
| 627 | */ | ||
| 628 | smp_mb(); | ||
| 612 | 629 | ||
| 613 | /* Check if if Tx BD ring is full - next BD is still owned by EMAC */ | 630 | if (!arc_emac_tx_avail(priv)) { |
| 614 | if (unlikely((le32_to_cpu(*info) & OWN_MASK) == FOR_EMAC)) | ||
| 615 | netif_stop_queue(ndev); | 631 | netif_stop_queue(ndev); |
| 632 | /* Refresh tx_dirty */ | ||
| 633 | smp_mb(); | ||
| 634 | if (arc_emac_tx_avail(priv)) | ||
| 635 | netif_start_queue(ndev); | ||
| 636 | } | ||
| 616 | 637 | ||
| 617 | arc_reg_set(priv, R_STATUS, TXPL_MASK); | 638 | arc_reg_set(priv, R_STATUS, TXPL_MASK); |
| 618 | 639 | ||
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 4a7028d65912..d588136b23b9 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
| @@ -1697,7 +1697,7 @@ static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev, | |||
| 1697 | hwstat->tx_underruns + | 1697 | hwstat->tx_underruns + |
| 1698 | hwstat->tx_excessive_cols + | 1698 | hwstat->tx_excessive_cols + |
| 1699 | hwstat->tx_late_cols); | 1699 | hwstat->tx_late_cols); |
| 1700 | nstat->multicast = hwstat->tx_multicast_pkts; | 1700 | nstat->multicast = hwstat->rx_multicast_pkts; |
| 1701 | nstat->collisions = hwstat->tx_total_cols; | 1701 | nstat->collisions = hwstat->tx_total_cols; |
| 1702 | 1702 | ||
| 1703 | nstat->rx_length_errors = (hwstat->rx_oversize_pkts + | 1703 | nstat->rx_length_errors = (hwstat->rx_oversize_pkts + |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 6f4e18644bd4..d9b9170ed2fc 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
| @@ -534,6 +534,25 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv, | |||
| 534 | while ((processed < to_process) && (processed < budget)) { | 534 | while ((processed < to_process) && (processed < budget)) { |
| 535 | cb = &priv->rx_cbs[priv->rx_read_ptr]; | 535 | cb = &priv->rx_cbs[priv->rx_read_ptr]; |
| 536 | skb = cb->skb; | 536 | skb = cb->skb; |
| 537 | |||
| 538 | processed++; | ||
| 539 | priv->rx_read_ptr++; | ||
| 540 | |||
| 541 | if (priv->rx_read_ptr == priv->num_rx_bds) | ||
| 542 | priv->rx_read_ptr = 0; | ||
| 543 | |||
| 544 | /* We do not have a backing SKB, so we do not a corresponding | ||
| 545 | * DMA mapping for this incoming packet since | ||
| 546 | * bcm_sysport_rx_refill always either has both skb and mapping | ||
| 547 | * or none. | ||
| 548 | */ | ||
| 549 | if (unlikely(!skb)) { | ||
| 550 | netif_err(priv, rx_err, ndev, "out of memory!\n"); | ||
| 551 | ndev->stats.rx_dropped++; | ||
| 552 | ndev->stats.rx_errors++; | ||
| 553 | goto refill; | ||
| 554 | } | ||
| 555 | |||
| 537 | dma_unmap_single(kdev, dma_unmap_addr(cb, dma_addr), | 556 | dma_unmap_single(kdev, dma_unmap_addr(cb, dma_addr), |
| 538 | RX_BUF_LENGTH, DMA_FROM_DEVICE); | 557 | RX_BUF_LENGTH, DMA_FROM_DEVICE); |
| 539 | 558 | ||
| @@ -543,23 +562,11 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv, | |||
| 543 | status = (rsb->rx_status_len >> DESC_STATUS_SHIFT) & | 562 | status = (rsb->rx_status_len >> DESC_STATUS_SHIFT) & |
| 544 | DESC_STATUS_MASK; | 563 | DESC_STATUS_MASK; |
| 545 | 564 | ||
| 546 | processed++; | ||
| 547 | priv->rx_read_ptr++; | ||
| 548 | if (priv->rx_read_ptr == priv->num_rx_bds) | ||
| 549 | priv->rx_read_ptr = 0; | ||
| 550 | |||
| 551 | netif_dbg(priv, rx_status, ndev, | 565 | netif_dbg(priv, rx_status, ndev, |
| 552 | "p=%d, c=%d, rd_ptr=%d, len=%d, flag=0x%04x\n", | 566 | "p=%d, c=%d, rd_ptr=%d, len=%d, flag=0x%04x\n", |
| 553 | p_index, priv->rx_c_index, priv->rx_read_ptr, | 567 | p_index, priv->rx_c_index, priv->rx_read_ptr, |
| 554 | len, status); | 568 | len, status); |
| 555 | 569 | ||
| 556 | if (unlikely(!skb)) { | ||
| 557 | netif_err(priv, rx_err, ndev, "out of memory!\n"); | ||
| 558 | ndev->stats.rx_dropped++; | ||
| 559 | ndev->stats.rx_errors++; | ||
| 560 | goto refill; | ||
| 561 | } | ||
| 562 | |||
| 563 | if (unlikely(!(status & DESC_EOP) || !(status & DESC_SOP))) { | 570 | if (unlikely(!(status & DESC_EOP) || !(status & DESC_SOP))) { |
| 564 | netif_err(priv, rx_status, ndev, "fragmented packet!\n"); | 571 | netif_err(priv, rx_status, ndev, "fragmented packet!\n"); |
| 565 | ndev->stats.rx_dropped++; | 572 | ndev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 3f9d4de8173c..5cc9cae21ed5 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
| @@ -875,6 +875,7 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev, | |||
| 875 | int last_tx_cn, last_c_index, num_tx_bds; | 875 | int last_tx_cn, last_c_index, num_tx_bds; |
| 876 | struct enet_cb *tx_cb_ptr; | 876 | struct enet_cb *tx_cb_ptr; |
| 877 | struct netdev_queue *txq; | 877 | struct netdev_queue *txq; |
| 878 | unsigned int bds_compl; | ||
| 878 | unsigned int c_index; | 879 | unsigned int c_index; |
| 879 | 880 | ||
| 880 | /* Compute how many buffers are transmitted since last xmit call */ | 881 | /* Compute how many buffers are transmitted since last xmit call */ |
| @@ -899,7 +900,9 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev, | |||
| 899 | /* Reclaim transmitted buffers */ | 900 | /* Reclaim transmitted buffers */ |
| 900 | while (last_tx_cn-- > 0) { | 901 | while (last_tx_cn-- > 0) { |
| 901 | tx_cb_ptr = ring->cbs + last_c_index; | 902 | tx_cb_ptr = ring->cbs + last_c_index; |
| 903 | bds_compl = 0; | ||
| 902 | if (tx_cb_ptr->skb) { | 904 | if (tx_cb_ptr->skb) { |
| 905 | bds_compl = skb_shinfo(tx_cb_ptr->skb)->nr_frags + 1; | ||
| 903 | dev->stats.tx_bytes += tx_cb_ptr->skb->len; | 906 | dev->stats.tx_bytes += tx_cb_ptr->skb->len; |
| 904 | dma_unmap_single(&dev->dev, | 907 | dma_unmap_single(&dev->dev, |
| 905 | dma_unmap_addr(tx_cb_ptr, dma_addr), | 908 | dma_unmap_addr(tx_cb_ptr, dma_addr), |
| @@ -916,7 +919,7 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev, | |||
| 916 | dma_unmap_addr_set(tx_cb_ptr, dma_addr, 0); | 919 | dma_unmap_addr_set(tx_cb_ptr, dma_addr, 0); |
| 917 | } | 920 | } |
| 918 | dev->stats.tx_packets++; | 921 | dev->stats.tx_packets++; |
| 919 | ring->free_bds += 1; | 922 | ring->free_bds += bds_compl; |
| 920 | 923 | ||
| 921 | last_c_index++; | 924 | last_c_index++; |
| 922 | last_c_index &= (num_tx_bds - 1); | 925 | last_c_index &= (num_tx_bds - 1); |
| @@ -1274,12 +1277,29 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv, | |||
| 1274 | 1277 | ||
| 1275 | while ((rxpktprocessed < rxpkttoprocess) && | 1278 | while ((rxpktprocessed < rxpkttoprocess) && |
| 1276 | (rxpktprocessed < budget)) { | 1279 | (rxpktprocessed < budget)) { |
| 1280 | cb = &priv->rx_cbs[priv->rx_read_ptr]; | ||
| 1281 | skb = cb->skb; | ||
| 1282 | |||
| 1283 | rxpktprocessed++; | ||
| 1284 | |||
| 1285 | priv->rx_read_ptr++; | ||
| 1286 | priv->rx_read_ptr &= (priv->num_rx_bds - 1); | ||
| 1287 | |||
| 1288 | /* We do not have a backing SKB, so we do not have a | ||
| 1289 | * corresponding DMA mapping for this incoming packet since | ||
| 1290 | * bcmgenet_rx_refill always either has both skb and mapping or | ||
| 1291 | * none. | ||
| 1292 | */ | ||
| 1293 | if (unlikely(!skb)) { | ||
| 1294 | dev->stats.rx_dropped++; | ||
| 1295 | dev->stats.rx_errors++; | ||
| 1296 | goto refill; | ||
| 1297 | } | ||
| 1298 | |||
| 1277 | /* Unmap the packet contents such that we can use the | 1299 | /* Unmap the packet contents such that we can use the |
| 1278 | * RSV from the 64 bytes descriptor when enabled and save | 1300 | * RSV from the 64 bytes descriptor when enabled and save |
| 1279 | * a 32-bits register read | 1301 | * a 32-bits register read |
| 1280 | */ | 1302 | */ |
| 1281 | cb = &priv->rx_cbs[priv->rx_read_ptr]; | ||
| 1282 | skb = cb->skb; | ||
| 1283 | dma_unmap_single(&dev->dev, dma_unmap_addr(cb, dma_addr), | 1303 | dma_unmap_single(&dev->dev, dma_unmap_addr(cb, dma_addr), |
| 1284 | priv->rx_buf_len, DMA_FROM_DEVICE); | 1304 | priv->rx_buf_len, DMA_FROM_DEVICE); |
| 1285 | 1305 | ||
| @@ -1307,18 +1327,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv, | |||
| 1307 | __func__, p_index, priv->rx_c_index, | 1327 | __func__, p_index, priv->rx_c_index, |
| 1308 | priv->rx_read_ptr, dma_length_status); | 1328 | priv->rx_read_ptr, dma_length_status); |
| 1309 | 1329 | ||
| 1310 | rxpktprocessed++; | ||
| 1311 | |||
| 1312 | priv->rx_read_ptr++; | ||
| 1313 | priv->rx_read_ptr &= (priv->num_rx_bds - 1); | ||
| 1314 | |||
| 1315 | /* out of memory, just drop packets at the hardware level */ | ||
| 1316 | if (unlikely(!skb)) { | ||
| 1317 | dev->stats.rx_dropped++; | ||
| 1318 | dev->stats.rx_errors++; | ||
| 1319 | goto refill; | ||
| 1320 | } | ||
| 1321 | |||
| 1322 | if (unlikely(!(dma_flag & DMA_EOP) || !(dma_flag & DMA_SOP))) { | 1330 | if (unlikely(!(dma_flag & DMA_EOP) || !(dma_flag & DMA_SOP))) { |
| 1323 | netif_err(priv, rx_status, dev, | 1331 | netif_err(priv, rx_status, dev, |
| 1324 | "dropping fragmented packet!\n"); | 1332 | "dropping fragmented packet!\n"); |
| @@ -1736,13 +1744,63 @@ static void bcmgenet_init_multiq(struct net_device *dev) | |||
| 1736 | bcmgenet_tdma_writel(priv, reg, DMA_CTRL); | 1744 | bcmgenet_tdma_writel(priv, reg, DMA_CTRL); |
| 1737 | } | 1745 | } |
| 1738 | 1746 | ||
| 1747 | static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) | ||
| 1748 | { | ||
| 1749 | int ret = 0; | ||
| 1750 | int timeout = 0; | ||
| 1751 | u32 reg; | ||
| 1752 | |||
| 1753 | /* Disable TDMA to stop add more frames in TX DMA */ | ||
| 1754 | reg = bcmgenet_tdma_readl(priv, DMA_CTRL); | ||
| 1755 | reg &= ~DMA_EN; | ||
| 1756 | bcmgenet_tdma_writel(priv, reg, DMA_CTRL); | ||
| 1757 | |||
| 1758 | /* Check TDMA status register to confirm TDMA is disabled */ | ||
| 1759 | while (timeout++ < DMA_TIMEOUT_VAL) { | ||
| 1760 | reg = bcmgenet_tdma_readl(priv, DMA_STATUS); | ||
| 1761 | if (reg & DMA_DISABLED) | ||
| 1762 | break; | ||
| 1763 | |||
| 1764 | udelay(1); | ||
| 1765 | } | ||
| 1766 | |||
| 1767 | if (timeout == DMA_TIMEOUT_VAL) { | ||
| 1768 | netdev_warn(priv->dev, "Timed out while disabling TX DMA\n"); | ||
| 1769 | ret = -ETIMEDOUT; | ||
| 1770 | } | ||
| 1771 | |||
| 1772 | /* Wait 10ms for packet drain in both tx and rx dma */ | ||
| 1773 | usleep_range(10000, 20000); | ||
| 1774 | |||
| 1775 | /* Disable RDMA */ | ||
| 1776 | reg = bcmgenet_rdma_readl(priv, DMA_CTRL); | ||
| 1777 | reg &= ~DMA_EN; | ||
| 1778 | bcmgenet_rdma_writel(priv, reg, DMA_CTRL); | ||
| 1779 | |||
| 1780 | timeout = 0; | ||
| 1781 | /* Check RDMA status register to confirm RDMA is disabled */ | ||
| 1782 | while (timeout++ < DMA_TIMEOUT_VAL) { | ||
| 1783 | reg = bcmgenet_rdma_readl(priv, DMA_STATUS); | ||
| 1784 | if (reg & DMA_DISABLED) | ||
| 1785 | break; | ||
| 1786 | |||
| 1787 | udelay(1); | ||
| 1788 | } | ||
| 1789 | |||
| 1790 | if (timeout == DMA_TIMEOUT_VAL) { | ||
| 1791 | netdev_warn(priv->dev, "Timed out while disabling RX DMA\n"); | ||
| 1792 | ret = -ETIMEDOUT; | ||
| 1793 | } | ||
| 1794 | |||
| 1795 | return ret; | ||
| 1796 | } | ||
| 1797 | |||
| 1739 | static void bcmgenet_fini_dma(struct bcmgenet_priv *priv) | 1798 | static void bcmgenet_fini_dma(struct bcmgenet_priv *priv) |
| 1740 | { | 1799 | { |
| 1741 | int i; | 1800 | int i; |
| 1742 | 1801 | ||
| 1743 | /* disable DMA */ | 1802 | /* disable DMA */ |
| 1744 | bcmgenet_rdma_writel(priv, 0, DMA_CTRL); | 1803 | bcmgenet_dma_teardown(priv); |
| 1745 | bcmgenet_tdma_writel(priv, 0, DMA_CTRL); | ||
| 1746 | 1804 | ||
| 1747 | for (i = 0; i < priv->num_tx_bds; i++) { | 1805 | for (i = 0; i < priv->num_tx_bds; i++) { |
| 1748 | if (priv->tx_cbs[i].skb != NULL) { | 1806 | if (priv->tx_cbs[i].skb != NULL) { |
| @@ -2101,57 +2159,6 @@ err_clk_disable: | |||
| 2101 | return ret; | 2159 | return ret; |
| 2102 | } | 2160 | } |
| 2103 | 2161 | ||
| 2104 | static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) | ||
| 2105 | { | ||
| 2106 | int ret = 0; | ||
| 2107 | int timeout = 0; | ||
| 2108 | u32 reg; | ||
| 2109 | |||
| 2110 | /* Disable TDMA to stop add more frames in TX DMA */ | ||
| 2111 | reg = bcmgenet_tdma_readl(priv, DMA_CTRL); | ||
| 2112 | reg &= ~DMA_EN; | ||
| 2113 | bcmgenet_tdma_writel(priv, reg, DMA_CTRL); | ||
| 2114 | |||
| 2115 | /* Check TDMA status register to confirm TDMA is disabled */ | ||
| 2116 | while (timeout++ < DMA_TIMEOUT_VAL) { | ||
| 2117 | reg = bcmgenet_tdma_readl(priv, DMA_STATUS); | ||
| 2118 | if (reg & DMA_DISABLED) | ||
| 2119 | break; | ||
| 2120 | |||
| 2121 | udelay(1); | ||
| 2122 | } | ||
| 2123 | |||
| 2124 | if (timeout == DMA_TIMEOUT_VAL) { | ||
| 2125 | netdev_warn(priv->dev, "Timed out while disabling TX DMA\n"); | ||
| 2126 | ret = -ETIMEDOUT; | ||
| 2127 | } | ||
| 2128 | |||
| 2129 | /* Wait 10ms for packet drain in both tx and rx dma */ | ||
| 2130 | usleep_range(10000, 20000); | ||
| 2131 | |||
| 2132 | /* Disable RDMA */ | ||
| 2133 | reg = bcmgenet_rdma_readl(priv, DMA_CTRL); | ||
| 2134 | reg &= ~DMA_EN; | ||
| 2135 | bcmgenet_rdma_writel(priv, reg, DMA_CTRL); | ||
| 2136 | |||
| 2137 | timeout = 0; | ||
| 2138 | /* Check RDMA status register to confirm RDMA is disabled */ | ||
| 2139 | while (timeout++ < DMA_TIMEOUT_VAL) { | ||
| 2140 | reg = bcmgenet_rdma_readl(priv, DMA_STATUS); | ||
| 2141 | if (reg & DMA_DISABLED) | ||
| 2142 | break; | ||
| 2143 | |||
| 2144 | udelay(1); | ||
| 2145 | } | ||
| 2146 | |||
| 2147 | if (timeout == DMA_TIMEOUT_VAL) { | ||
| 2148 | netdev_warn(priv->dev, "Timed out while disabling RX DMA\n"); | ||
| 2149 | ret = -ETIMEDOUT; | ||
| 2150 | } | ||
| 2151 | |||
| 2152 | return ret; | ||
| 2153 | } | ||
| 2154 | |||
| 2155 | static void bcmgenet_netif_stop(struct net_device *dev) | 2162 | static void bcmgenet_netif_stop(struct net_device *dev) |
| 2156 | { | 2163 | { |
| 2157 | struct bcmgenet_priv *priv = netdev_priv(dev); | 2164 | struct bcmgenet_priv *priv = netdev_priv(dev); |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index cb77ae93d89a..e7d3a620d96a 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
| @@ -7914,8 +7914,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 7914 | 7914 | ||
| 7915 | entry = tnapi->tx_prod; | 7915 | entry = tnapi->tx_prod; |
| 7916 | base_flags = 0; | 7916 | base_flags = 0; |
| 7917 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
| 7918 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | ||
| 7919 | 7917 | ||
| 7920 | mss = skb_shinfo(skb)->gso_size; | 7918 | mss = skb_shinfo(skb)->gso_size; |
| 7921 | if (mss) { | 7919 | if (mss) { |
| @@ -7929,6 +7927,13 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 7929 | 7927 | ||
| 7930 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb) - ETH_HLEN; | 7928 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb) - ETH_HLEN; |
| 7931 | 7929 | ||
| 7930 | /* HW/FW can not correctly segment packets that have been | ||
| 7931 | * vlan encapsulated. | ||
| 7932 | */ | ||
| 7933 | if (skb->protocol == htons(ETH_P_8021Q) || | ||
| 7934 | skb->protocol == htons(ETH_P_8021AD)) | ||
| 7935 | return tg3_tso_bug(tp, tnapi, txq, skb); | ||
| 7936 | |||
| 7932 | if (!skb_is_gso_v6(skb)) { | 7937 | if (!skb_is_gso_v6(skb)) { |
| 7933 | if (unlikely((ETH_HLEN + hdr_len) > 80) && | 7938 | if (unlikely((ETH_HLEN + hdr_len) > 80) && |
| 7934 | tg3_flag(tp, TSO_BUG)) | 7939 | tg3_flag(tp, TSO_BUG)) |
| @@ -7979,6 +7984,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 7979 | base_flags |= tsflags << 12; | 7984 | base_flags |= tsflags << 12; |
| 7980 | } | 7985 | } |
| 7981 | } | 7986 | } |
| 7987 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
| 7988 | /* HW/FW can not correctly checksum packets that have been | ||
| 7989 | * vlan encapsulated. | ||
| 7990 | */ | ||
| 7991 | if (skb->protocol == htons(ETH_P_8021Q) || | ||
| 7992 | skb->protocol == htons(ETH_P_8021AD)) { | ||
| 7993 | if (skb_checksum_help(skb)) | ||
| 7994 | goto drop; | ||
| 7995 | } else { | ||
| 7996 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | ||
| 7997 | } | ||
| 7982 | } | 7998 | } |
| 7983 | 7999 | ||
| 7984 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && | 8000 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 8c34811a1128..e5be511a3c38 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
| @@ -6478,6 +6478,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6478 | struct port_info *pi; | 6478 | struct port_info *pi; |
| 6479 | bool highdma = false; | 6479 | bool highdma = false; |
| 6480 | struct adapter *adapter = NULL; | 6480 | struct adapter *adapter = NULL; |
| 6481 | void __iomem *regs; | ||
| 6481 | 6482 | ||
| 6482 | printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION); | 6483 | printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION); |
| 6483 | 6484 | ||
| @@ -6494,19 +6495,35 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6494 | goto out_release_regions; | 6495 | goto out_release_regions; |
| 6495 | } | 6496 | } |
| 6496 | 6497 | ||
| 6498 | regs = pci_ioremap_bar(pdev, 0); | ||
| 6499 | if (!regs) { | ||
| 6500 | dev_err(&pdev->dev, "cannot map device registers\n"); | ||
| 6501 | err = -ENOMEM; | ||
| 6502 | goto out_disable_device; | ||
| 6503 | } | ||
| 6504 | |||
| 6505 | /* We control everything through one PF */ | ||
| 6506 | func = SOURCEPF_GET(readl(regs + PL_WHOAMI)); | ||
| 6507 | if (func != ent->driver_data) { | ||
| 6508 | iounmap(regs); | ||
| 6509 | pci_disable_device(pdev); | ||
| 6510 | pci_save_state(pdev); /* to restore SR-IOV later */ | ||
| 6511 | goto sriov; | ||
| 6512 | } | ||
| 6513 | |||
| 6497 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 6514 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
| 6498 | highdma = true; | 6515 | highdma = true; |
| 6499 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 6516 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
| 6500 | if (err) { | 6517 | if (err) { |
| 6501 | dev_err(&pdev->dev, "unable to obtain 64-bit DMA for " | 6518 | dev_err(&pdev->dev, "unable to obtain 64-bit DMA for " |
| 6502 | "coherent allocations\n"); | 6519 | "coherent allocations\n"); |
| 6503 | goto out_disable_device; | 6520 | goto out_unmap_bar0; |
| 6504 | } | 6521 | } |
| 6505 | } else { | 6522 | } else { |
| 6506 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | 6523 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |
| 6507 | if (err) { | 6524 | if (err) { |
| 6508 | dev_err(&pdev->dev, "no usable DMA configuration\n"); | 6525 | dev_err(&pdev->dev, "no usable DMA configuration\n"); |
| 6509 | goto out_disable_device; | 6526 | goto out_unmap_bar0; |
| 6510 | } | 6527 | } |
| 6511 | } | 6528 | } |
| 6512 | 6529 | ||
| @@ -6518,7 +6535,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6518 | adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); | 6535 | adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); |
| 6519 | if (!adapter) { | 6536 | if (!adapter) { |
| 6520 | err = -ENOMEM; | 6537 | err = -ENOMEM; |
| 6521 | goto out_disable_device; | 6538 | goto out_unmap_bar0; |
| 6522 | } | 6539 | } |
| 6523 | 6540 | ||
| 6524 | adapter->workq = create_singlethread_workqueue("cxgb4"); | 6541 | adapter->workq = create_singlethread_workqueue("cxgb4"); |
| @@ -6530,20 +6547,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6530 | /* PCI device has been enabled */ | 6547 | /* PCI device has been enabled */ |
| 6531 | adapter->flags |= DEV_ENABLED; | 6548 | adapter->flags |= DEV_ENABLED; |
| 6532 | 6549 | ||
| 6533 | adapter->regs = pci_ioremap_bar(pdev, 0); | 6550 | adapter->regs = regs; |
| 6534 | if (!adapter->regs) { | ||
| 6535 | dev_err(&pdev->dev, "cannot map device registers\n"); | ||
| 6536 | err = -ENOMEM; | ||
| 6537 | goto out_free_adapter; | ||
| 6538 | } | ||
| 6539 | |||
| 6540 | /* We control everything through one PF */ | ||
| 6541 | func = SOURCEPF_GET(readl(adapter->regs + PL_WHOAMI)); | ||
| 6542 | if (func != ent->driver_data) { | ||
| 6543 | pci_save_state(pdev); /* to restore SR-IOV later */ | ||
| 6544 | goto sriov; | ||
| 6545 | } | ||
| 6546 | |||
| 6547 | adapter->pdev = pdev; | 6551 | adapter->pdev = pdev; |
| 6548 | adapter->pdev_dev = &pdev->dev; | 6552 | adapter->pdev_dev = &pdev->dev; |
| 6549 | adapter->mbox = func; | 6553 | adapter->mbox = func; |
| @@ -6560,7 +6564,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6560 | 6564 | ||
| 6561 | err = t4_prep_adapter(adapter); | 6565 | err = t4_prep_adapter(adapter); |
| 6562 | if (err) | 6566 | if (err) |
| 6563 | goto out_unmap_bar0; | 6567 | goto out_free_adapter; |
| 6568 | |||
| 6564 | 6569 | ||
| 6565 | if (!is_t4(adapter->params.chip)) { | 6570 | if (!is_t4(adapter->params.chip)) { |
| 6566 | s_qpp = QUEUESPERPAGEPF1 * adapter->fn; | 6571 | s_qpp = QUEUESPERPAGEPF1 * adapter->fn; |
| @@ -6577,14 +6582,14 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6577 | dev_err(&pdev->dev, | 6582 | dev_err(&pdev->dev, |
| 6578 | "Incorrect number of egress queues per page\n"); | 6583 | "Incorrect number of egress queues per page\n"); |
| 6579 | err = -EINVAL; | 6584 | err = -EINVAL; |
| 6580 | goto out_unmap_bar0; | 6585 | goto out_free_adapter; |
| 6581 | } | 6586 | } |
| 6582 | adapter->bar2 = ioremap_wc(pci_resource_start(pdev, 2), | 6587 | adapter->bar2 = ioremap_wc(pci_resource_start(pdev, 2), |
| 6583 | pci_resource_len(pdev, 2)); | 6588 | pci_resource_len(pdev, 2)); |
| 6584 | if (!adapter->bar2) { | 6589 | if (!adapter->bar2) { |
| 6585 | dev_err(&pdev->dev, "cannot map device bar2 region\n"); | 6590 | dev_err(&pdev->dev, "cannot map device bar2 region\n"); |
| 6586 | err = -ENOMEM; | 6591 | err = -ENOMEM; |
| 6587 | goto out_unmap_bar0; | 6592 | goto out_free_adapter; |
| 6588 | } | 6593 | } |
| 6589 | } | 6594 | } |
| 6590 | 6595 | ||
| @@ -6722,13 +6727,13 @@ sriov: | |||
| 6722 | out_unmap_bar: | 6727 | out_unmap_bar: |
| 6723 | if (!is_t4(adapter->params.chip)) | 6728 | if (!is_t4(adapter->params.chip)) |
| 6724 | iounmap(adapter->bar2); | 6729 | iounmap(adapter->bar2); |
| 6725 | out_unmap_bar0: | ||
| 6726 | iounmap(adapter->regs); | ||
| 6727 | out_free_adapter: | 6730 | out_free_adapter: |
| 6728 | if (adapter->workq) | 6731 | if (adapter->workq) |
| 6729 | destroy_workqueue(adapter->workq); | 6732 | destroy_workqueue(adapter->workq); |
| 6730 | 6733 | ||
| 6731 | kfree(adapter); | 6734 | kfree(adapter); |
| 6735 | out_unmap_bar0: | ||
| 6736 | iounmap(regs); | ||
| 6732 | out_disable_device: | 6737 | out_disable_device: |
| 6733 | pci_disable_pcie_error_reporting(pdev); | 6738 | pci_disable_pcie_error_reporting(pdev); |
| 6734 | pci_disable_device(pdev); | 6739 | pci_disable_device(pdev); |
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 9b33057a9477..70089c29d307 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
| @@ -1399,7 +1399,7 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev) | |||
| 1399 | const void *mac_addr; | 1399 | const void *mac_addr; |
| 1400 | 1400 | ||
| 1401 | if (!IS_ENABLED(CONFIG_OF) || !np) | 1401 | if (!IS_ENABLED(CONFIG_OF) || !np) |
| 1402 | return NULL; | 1402 | return ERR_PTR(-ENXIO); |
| 1403 | 1403 | ||
| 1404 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); | 1404 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); |
| 1405 | if (!pdata) | 1405 | if (!pdata) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 65a4a0f88ea0..02a2e90d581a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
| @@ -2389,6 +2389,22 @@ struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv( | |||
| 2389 | } | 2389 | } |
| 2390 | EXPORT_SYMBOL_GPL(mlx4_phys_to_slaves_pport_actv); | 2390 | EXPORT_SYMBOL_GPL(mlx4_phys_to_slaves_pport_actv); |
| 2391 | 2391 | ||
| 2392 | static int mlx4_slaves_closest_port(struct mlx4_dev *dev, int slave, int port) | ||
| 2393 | { | ||
| 2394 | struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); | ||
| 2395 | int min_port = find_first_bit(actv_ports.ports, dev->caps.num_ports) | ||
| 2396 | + 1; | ||
| 2397 | int max_port = min_port + | ||
| 2398 | bitmap_weight(actv_ports.ports, dev->caps.num_ports); | ||
| 2399 | |||
| 2400 | if (port < min_port) | ||
| 2401 | port = min_port; | ||
| 2402 | else if (port >= max_port) | ||
| 2403 | port = max_port - 1; | ||
| 2404 | |||
| 2405 | return port; | ||
| 2406 | } | ||
| 2407 | |||
| 2392 | int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac) | 2408 | int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac) |
| 2393 | { | 2409 | { |
| 2394 | struct mlx4_priv *priv = mlx4_priv(dev); | 2410 | struct mlx4_priv *priv = mlx4_priv(dev); |
| @@ -2402,6 +2418,7 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac) | |||
| 2402 | if (slave < 0) | 2418 | if (slave < 0) |
| 2403 | return -EINVAL; | 2419 | return -EINVAL; |
| 2404 | 2420 | ||
| 2421 | port = mlx4_slaves_closest_port(dev, slave, port); | ||
| 2405 | s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; | 2422 | s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; |
| 2406 | s_info->mac = mac; | 2423 | s_info->mac = mac; |
| 2407 | mlx4_info(dev, "default mac on vf %d port %d to %llX will take afect only after vf restart\n", | 2424 | mlx4_info(dev, "default mac on vf %d port %d to %llX will take afect only after vf restart\n", |
| @@ -2428,6 +2445,7 @@ int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos) | |||
| 2428 | if (slave < 0) | 2445 | if (slave < 0) |
| 2429 | return -EINVAL; | 2446 | return -EINVAL; |
| 2430 | 2447 | ||
| 2448 | port = mlx4_slaves_closest_port(dev, slave, port); | ||
| 2431 | vf_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; | 2449 | vf_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; |
| 2432 | 2450 | ||
| 2433 | if ((0 == vlan) && (0 == qos)) | 2451 | if ((0 == vlan) && (0 == qos)) |
| @@ -2455,6 +2473,7 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, | |||
| 2455 | struct mlx4_priv *priv; | 2473 | struct mlx4_priv *priv; |
| 2456 | 2474 | ||
| 2457 | priv = mlx4_priv(dev); | 2475 | priv = mlx4_priv(dev); |
| 2476 | port = mlx4_slaves_closest_port(dev, slave, port); | ||
| 2458 | vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; | 2477 | vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; |
| 2459 | 2478 | ||
| 2460 | if (MLX4_VGT != vp_oper->state.default_vlan) { | 2479 | if (MLX4_VGT != vp_oper->state.default_vlan) { |
| @@ -2482,6 +2501,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting) | |||
| 2482 | if (slave < 0) | 2501 | if (slave < 0) |
| 2483 | return -EINVAL; | 2502 | return -EINVAL; |
| 2484 | 2503 | ||
| 2504 | port = mlx4_slaves_closest_port(dev, slave, port); | ||
| 2485 | s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; | 2505 | s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; |
| 2486 | s_info->spoofchk = setting; | 2506 | s_info->spoofchk = setting; |
| 2487 | 2507 | ||
| @@ -2535,6 +2555,7 @@ int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_stat | |||
| 2535 | if (slave < 0) | 2555 | if (slave < 0) |
| 2536 | return -EINVAL; | 2556 | return -EINVAL; |
| 2537 | 2557 | ||
| 2558 | port = mlx4_slaves_closest_port(dev, slave, port); | ||
| 2538 | switch (link_state) { | 2559 | switch (link_state) { |
| 2539 | case IFLA_VF_LINK_STATE_AUTO: | 2560 | case IFLA_VF_LINK_STATE_AUTO: |
| 2540 | /* get current link state */ | 2561 | /* get current link state */ |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index e22f24f784fc..35ff2925110a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
| @@ -487,6 +487,9 @@ static int mlx4_en_set_pauseparam(struct net_device *dev, | |||
| 487 | struct mlx4_en_dev *mdev = priv->mdev; | 487 | struct mlx4_en_dev *mdev = priv->mdev; |
| 488 | int err; | 488 | int err; |
| 489 | 489 | ||
| 490 | if (pause->autoneg) | ||
| 491 | return -EINVAL; | ||
| 492 | |||
| 490 | priv->prof->tx_pause = pause->tx_pause != 0; | 493 | priv->prof->tx_pause = pause->tx_pause != 0; |
| 491 | priv->prof->rx_pause = pause->rx_pause != 0; | 494 | priv->prof->rx_pause = pause->rx_pause != 0; |
| 492 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, | 495 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index 7d717eccb7b0..193a6adb5d04 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
| @@ -298,6 +298,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox | |||
| 298 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); | 298 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | /* Must protect against concurrent access */ | ||
| 301 | int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, | 302 | int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, |
| 302 | struct mlx4_mpt_entry ***mpt_entry) | 303 | struct mlx4_mpt_entry ***mpt_entry) |
| 303 | { | 304 | { |
| @@ -305,13 +306,10 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, | |||
| 305 | int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1); | 306 | int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1); |
| 306 | struct mlx4_cmd_mailbox *mailbox = NULL; | 307 | struct mlx4_cmd_mailbox *mailbox = NULL; |
| 307 | 308 | ||
| 308 | /* Make sure that at this point we have single-threaded access only */ | ||
| 309 | |||
| 310 | if (mmr->enabled != MLX4_MPT_EN_HW) | 309 | if (mmr->enabled != MLX4_MPT_EN_HW) |
| 311 | return -EINVAL; | 310 | return -EINVAL; |
| 312 | 311 | ||
| 313 | err = mlx4_HW2SW_MPT(dev, NULL, key); | 312 | err = mlx4_HW2SW_MPT(dev, NULL, key); |
| 314 | |||
| 315 | if (err) { | 313 | if (err) { |
| 316 | mlx4_warn(dev, "HW2SW_MPT failed (%d).", err); | 314 | mlx4_warn(dev, "HW2SW_MPT failed (%d).", err); |
| 317 | mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n"); | 315 | mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n"); |
| @@ -333,7 +331,6 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, | |||
| 333 | 0, MLX4_CMD_QUERY_MPT, | 331 | 0, MLX4_CMD_QUERY_MPT, |
| 334 | MLX4_CMD_TIME_CLASS_B, | 332 | MLX4_CMD_TIME_CLASS_B, |
| 335 | MLX4_CMD_WRAPPED); | 333 | MLX4_CMD_WRAPPED); |
| 336 | |||
| 337 | if (err) | 334 | if (err) |
| 338 | goto free_mailbox; | 335 | goto free_mailbox; |
| 339 | 336 | ||
| @@ -378,9 +375,10 @@ int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, | |||
| 378 | err = mlx4_SW2HW_MPT(dev, mailbox, key); | 375 | err = mlx4_SW2HW_MPT(dev, mailbox, key); |
| 379 | } | 376 | } |
| 380 | 377 | ||
| 381 | mmr->pd = be32_to_cpu((*mpt_entry)->pd_flags) & MLX4_MPT_PD_MASK; | 378 | if (!err) { |
| 382 | if (!err) | 379 | mmr->pd = be32_to_cpu((*mpt_entry)->pd_flags) & MLX4_MPT_PD_MASK; |
| 383 | mmr->enabled = MLX4_MPT_EN_HW; | 380 | mmr->enabled = MLX4_MPT_EN_HW; |
| 381 | } | ||
| 384 | return err; | 382 | return err; |
| 385 | } | 383 | } |
| 386 | EXPORT_SYMBOL_GPL(mlx4_mr_hw_write_mpt); | 384 | EXPORT_SYMBOL_GPL(mlx4_mr_hw_write_mpt); |
| @@ -400,11 +398,12 @@ EXPORT_SYMBOL_GPL(mlx4_mr_hw_put_mpt); | |||
| 400 | int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry, | 398 | int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry, |
| 401 | u32 pdn) | 399 | u32 pdn) |
| 402 | { | 400 | { |
| 403 | u32 pd_flags = be32_to_cpu(mpt_entry->pd_flags); | 401 | u32 pd_flags = be32_to_cpu(mpt_entry->pd_flags) & ~MLX4_MPT_PD_MASK; |
| 404 | /* The wrapper function will put the slave's id here */ | 402 | /* The wrapper function will put the slave's id here */ |
| 405 | if (mlx4_is_mfunc(dev)) | 403 | if (mlx4_is_mfunc(dev)) |
| 406 | pd_flags &= ~MLX4_MPT_PD_VF_MASK; | 404 | pd_flags &= ~MLX4_MPT_PD_VF_MASK; |
| 407 | mpt_entry->pd_flags = cpu_to_be32((pd_flags & ~MLX4_MPT_PD_MASK) | | 405 | |
| 406 | mpt_entry->pd_flags = cpu_to_be32(pd_flags | | ||
| 408 | (pdn & MLX4_MPT_PD_MASK) | 407 | (pdn & MLX4_MPT_PD_MASK) |
| 409 | | MLX4_MPT_PD_FLAG_EN_INV); | 408 | | MLX4_MPT_PD_FLAG_EN_INV); |
| 410 | return 0; | 409 | return 0; |
| @@ -600,14 +599,18 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, | |||
| 600 | { | 599 | { |
| 601 | int err; | 600 | int err; |
| 602 | 601 | ||
| 603 | mpt_entry->start = cpu_to_be64(mr->iova); | 602 | mpt_entry->start = cpu_to_be64(iova); |
| 604 | mpt_entry->length = cpu_to_be64(mr->size); | 603 | mpt_entry->length = cpu_to_be64(size); |
| 605 | mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); | 604 | mpt_entry->entity_size = cpu_to_be32(page_shift); |
| 606 | 605 | ||
| 607 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); | 606 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); |
| 608 | if (err) | 607 | if (err) |
| 609 | return err; | 608 | return err; |
| 610 | 609 | ||
| 610 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | | ||
| 611 | MLX4_MPT_PD_FLAG_EN_INV); | ||
| 612 | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | | ||
| 613 | MLX4_MPT_FLAG_SW_OWNS); | ||
| 611 | if (mr->mtt.order < 0) { | 614 | if (mr->mtt.order < 0) { |
| 612 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL); | 615 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL); |
| 613 | mpt_entry->mtt_addr = 0; | 616 | mpt_entry->mtt_addr = 0; |
| @@ -617,6 +620,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, | |||
| 617 | if (mr->mtt.page_shift == 0) | 620 | if (mr->mtt.page_shift == 0) |
| 618 | mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); | 621 | mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); |
| 619 | } | 622 | } |
| 623 | if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { | ||
| 624 | /* fast register MR in free state */ | ||
| 625 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); | ||
| 626 | mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | | ||
| 627 | MLX4_MPT_PD_FLAG_RAE); | ||
| 628 | } else { | ||
| 629 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); | ||
| 630 | } | ||
| 620 | mr->enabled = MLX4_MPT_EN_SW; | 631 | mr->enabled = MLX4_MPT_EN_SW; |
| 621 | 632 | ||
| 622 | return 0; | 633 | return 0; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 9ba0c1ca10d5..94eeb2c7d7e4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c | |||
| @@ -103,7 +103,8 @@ static int find_index(struct mlx4_dev *dev, | |||
| 103 | int i; | 103 | int i; |
| 104 | 104 | ||
| 105 | for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { | 105 | for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { |
| 106 | if ((mac & MLX4_MAC_MASK) == | 106 | if (table->refs[i] && |
| 107 | (MLX4_MAC_MASK & mac) == | ||
| 107 | (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) | 108 | (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) |
| 108 | return i; | 109 | return i; |
| 109 | } | 110 | } |
| @@ -165,12 +166,14 @@ int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac) | |||
| 165 | 166 | ||
| 166 | mutex_lock(&table->mutex); | 167 | mutex_lock(&table->mutex); |
| 167 | for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { | 168 | for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { |
| 168 | if (free < 0 && !table->entries[i]) { | 169 | if (!table->refs[i]) { |
| 169 | free = i; | 170 | if (free < 0) |
| 171 | free = i; | ||
| 170 | continue; | 172 | continue; |
| 171 | } | 173 | } |
| 172 | 174 | ||
| 173 | if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { | 175 | if ((MLX4_MAC_MASK & mac) == |
| 176 | (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { | ||
| 174 | /* MAC already registered, increment ref count */ | 177 | /* MAC already registered, increment ref count */ |
| 175 | err = i; | 178 | err = i; |
| 176 | ++table->refs[i]; | 179 | ++table->refs[i]; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 0dc31d85fc3b..2301365c79c7 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c | |||
| @@ -390,13 +390,14 @@ err_icm: | |||
| 390 | EXPORT_SYMBOL_GPL(mlx4_qp_alloc); | 390 | EXPORT_SYMBOL_GPL(mlx4_qp_alloc); |
| 391 | 391 | ||
| 392 | #define MLX4_UPDATE_QP_SUPPORTED_ATTRS MLX4_UPDATE_QP_SMAC | 392 | #define MLX4_UPDATE_QP_SUPPORTED_ATTRS MLX4_UPDATE_QP_SMAC |
| 393 | int mlx4_update_qp(struct mlx4_dev *dev, struct mlx4_qp *qp, | 393 | int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, |
| 394 | enum mlx4_update_qp_attr attr, | 394 | enum mlx4_update_qp_attr attr, |
| 395 | struct mlx4_update_qp_params *params) | 395 | struct mlx4_update_qp_params *params) |
| 396 | { | 396 | { |
| 397 | struct mlx4_cmd_mailbox *mailbox; | 397 | struct mlx4_cmd_mailbox *mailbox; |
| 398 | struct mlx4_update_qp_context *cmd; | 398 | struct mlx4_update_qp_context *cmd; |
| 399 | u64 pri_addr_path_mask = 0; | 399 | u64 pri_addr_path_mask = 0; |
| 400 | u64 qp_mask = 0; | ||
| 400 | int err = 0; | 401 | int err = 0; |
| 401 | 402 | ||
| 402 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 403 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
| @@ -413,9 +414,16 @@ int mlx4_update_qp(struct mlx4_dev *dev, struct mlx4_qp *qp, | |||
| 413 | cmd->qp_context.pri_path.grh_mylmc = params->smac_index; | 414 | cmd->qp_context.pri_path.grh_mylmc = params->smac_index; |
| 414 | } | 415 | } |
| 415 | 416 | ||
| 417 | if (attr & MLX4_UPDATE_QP_VSD) { | ||
| 418 | qp_mask |= 1ULL << MLX4_UPD_QP_MASK_VSD; | ||
| 419 | if (params->flags & MLX4_UPDATE_QP_PARAMS_FLAGS_VSD_ENABLE) | ||
| 420 | cmd->qp_context.param3 |= cpu_to_be32(MLX4_STRIP_VLAN); | ||
| 421 | } | ||
| 422 | |||
| 416 | cmd->primary_addr_path_mask = cpu_to_be64(pri_addr_path_mask); | 423 | cmd->primary_addr_path_mask = cpu_to_be64(pri_addr_path_mask); |
| 424 | cmd->qp_mask = cpu_to_be64(qp_mask); | ||
| 417 | 425 | ||
| 418 | err = mlx4_cmd(dev, mailbox->dma, qp->qpn & 0xffffff, 0, | 426 | err = mlx4_cmd(dev, mailbox->dma, qpn & 0xffffff, 0, |
| 419 | MLX4_CMD_UPDATE_QP, MLX4_CMD_TIME_CLASS_A, | 427 | MLX4_CMD_UPDATE_QP, MLX4_CMD_TIME_CLASS_A, |
| 420 | MLX4_CMD_NATIVE); | 428 | MLX4_CMD_NATIVE); |
| 421 | 429 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 1089367fed22..5d2498dcf536 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
| @@ -702,11 +702,13 @@ static int update_vport_qp_param(struct mlx4_dev *dev, | |||
| 702 | struct mlx4_qp_context *qpc = inbox->buf + 8; | 702 | struct mlx4_qp_context *qpc = inbox->buf + 8; |
| 703 | struct mlx4_vport_oper_state *vp_oper; | 703 | struct mlx4_vport_oper_state *vp_oper; |
| 704 | struct mlx4_priv *priv; | 704 | struct mlx4_priv *priv; |
| 705 | u32 qp_type; | ||
| 705 | int port; | 706 | int port; |
| 706 | 707 | ||
| 707 | port = (qpc->pri_path.sched_queue & 0x40) ? 2 : 1; | 708 | port = (qpc->pri_path.sched_queue & 0x40) ? 2 : 1; |
| 708 | priv = mlx4_priv(dev); | 709 | priv = mlx4_priv(dev); |
| 709 | vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; | 710 | vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; |
| 711 | qp_type = (be32_to_cpu(qpc->flags) >> 16) & 0xff; | ||
| 710 | 712 | ||
| 711 | if (MLX4_VGT != vp_oper->state.default_vlan) { | 713 | if (MLX4_VGT != vp_oper->state.default_vlan) { |
| 712 | /* the reserved QPs (special, proxy, tunnel) | 714 | /* the reserved QPs (special, proxy, tunnel) |
| @@ -715,8 +717,20 @@ static int update_vport_qp_param(struct mlx4_dev *dev, | |||
| 715 | if (mlx4_is_qp_reserved(dev, qpn)) | 717 | if (mlx4_is_qp_reserved(dev, qpn)) |
| 716 | return 0; | 718 | return 0; |
| 717 | 719 | ||
| 718 | /* force strip vlan by clear vsd */ | 720 | /* force strip vlan by clear vsd, MLX QP refers to Raw Ethernet */ |
| 719 | qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN); | 721 | if (qp_type == MLX4_QP_ST_UD || |
| 722 | (qp_type == MLX4_QP_ST_MLX && mlx4_is_eth(dev, port))) { | ||
| 723 | if (dev->caps.bmme_flags & MLX4_BMME_FLAG_VSD_INIT2RTR) { | ||
| 724 | *(__be32 *)inbox->buf = | ||
| 725 | cpu_to_be32(be32_to_cpu(*(__be32 *)inbox->buf) | | ||
| 726 | MLX4_QP_OPTPAR_VLAN_STRIPPING); | ||
| 727 | qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN); | ||
| 728 | } else { | ||
| 729 | struct mlx4_update_qp_params params = {.flags = 0}; | ||
| 730 | |||
| 731 | mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, ¶ms); | ||
| 732 | } | ||
| 733 | } | ||
| 720 | 734 | ||
| 721 | if (vp_oper->state.link_state == IFLA_VF_LINK_STATE_DISABLE && | 735 | if (vp_oper->state.link_state == IFLA_VF_LINK_STATE_DISABLE && |
| 722 | dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP) { | 736 | dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP) { |
| @@ -3998,13 +4012,17 @@ int mlx4_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, | |||
| 3998 | } | 4012 | } |
| 3999 | 4013 | ||
| 4000 | port = (rqp->sched_queue >> 6 & 1) + 1; | 4014 | port = (rqp->sched_queue >> 6 & 1) + 1; |
| 4001 | smac_index = cmd->qp_context.pri_path.grh_mylmc; | 4015 | |
| 4002 | err = mac_find_smac_ix_in_slave(dev, slave, port, | 4016 | if (pri_addr_path_mask & (1ULL << MLX4_UPD_QP_PATH_MASK_MAC_INDEX)) { |
| 4003 | smac_index, &mac); | 4017 | smac_index = cmd->qp_context.pri_path.grh_mylmc; |
| 4004 | if (err) { | 4018 | err = mac_find_smac_ix_in_slave(dev, slave, port, |
| 4005 | mlx4_err(dev, "Failed to update qpn 0x%x, MAC is invalid. smac_ix: %d\n", | 4019 | smac_index, &mac); |
| 4006 | qpn, smac_index); | 4020 | |
| 4007 | goto err_mac; | 4021 | if (err) { |
| 4022 | mlx4_err(dev, "Failed to update qpn 0x%x, MAC is invalid. smac_ix: %d\n", | ||
| 4023 | qpn, smac_index); | ||
| 4024 | goto err_mac; | ||
| 4025 | } | ||
| 4008 | } | 4026 | } |
| 4009 | 4027 | ||
| 4010 | err = mlx4_cmd(dev, inbox->dma, | 4028 | err = mlx4_cmd(dev, inbox->dma, |
| @@ -4818,7 +4836,7 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) | |||
| 4818 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; | 4836 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; |
| 4819 | 4837 | ||
| 4820 | upd_context = mailbox->buf; | 4838 | upd_context = mailbox->buf; |
| 4821 | upd_context->qp_mask = cpu_to_be64(MLX4_UPD_QP_MASK_VSD); | 4839 | upd_context->qp_mask = cpu_to_be64(1ULL << MLX4_UPD_QP_MASK_VSD); |
| 4822 | 4840 | ||
| 4823 | spin_lock_irq(mlx4_tlock(dev)); | 4841 | spin_lock_irq(mlx4_tlock(dev)); |
| 4824 | list_for_each_entry_safe(qp, tmp, qp_list, com.list) { | 4842 | list_for_each_entry_safe(qp, tmp, qp_list, com.list) { |
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index 979c6980639f..a42293092ea4 100644 --- a/drivers/net/ethernet/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c | |||
| @@ -290,9 +290,11 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p) | |||
| 290 | /* Read the hardware TX timestamp if one was recorded */ | 290 | /* Read the hardware TX timestamp if one was recorded */ |
| 291 | if (unlikely(re.s.tstamp)) { | 291 | if (unlikely(re.s.tstamp)) { |
| 292 | struct skb_shared_hwtstamps ts; | 292 | struct skb_shared_hwtstamps ts; |
| 293 | u64 ns; | ||
| 294 | |||
| 293 | memset(&ts, 0, sizeof(ts)); | 295 | memset(&ts, 0, sizeof(ts)); |
| 294 | /* Read the timestamp */ | 296 | /* Read the timestamp */ |
| 295 | u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port)); | 297 | ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port)); |
| 296 | /* Remove the timestamp from the FIFO */ | 298 | /* Remove the timestamp from the FIFO */ |
| 297 | cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0); | 299 | cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0); |
| 298 | /* Tell the kernel about the timestamp */ | 300 | /* Tell the kernel about the timestamp */ |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig index 44c8be1c6805..5f7a35212796 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | |||
| @@ -7,6 +7,7 @@ config PCH_GBE | |||
| 7 | depends on PCI && (X86_32 || COMPILE_TEST) | 7 | depends on PCI && (X86_32 || COMPILE_TEST) |
| 8 | select MII | 8 | select MII |
| 9 | select PTP_1588_CLOCK_PCH | 9 | select PTP_1588_CLOCK_PCH |
| 10 | select NET_PTP_CLASSIFY | ||
| 10 | ---help--- | 11 | ---help--- |
| 11 | This is a gigabit ethernet driver for EG20T PCH. | 12 | This is a gigabit ethernet driver for EG20T PCH. |
| 12 | EG20T PCH is the platform controller hub that is used in Intel's | 13 | EG20T PCH is the platform controller hub that is used in Intel's |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 91652e7235e4..0921302553c6 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
| @@ -1783,33 +1783,31 @@ static void __rtl8169_set_features(struct net_device *dev, | |||
| 1783 | netdev_features_t features) | 1783 | netdev_features_t features) |
| 1784 | { | 1784 | { |
| 1785 | struct rtl8169_private *tp = netdev_priv(dev); | 1785 | struct rtl8169_private *tp = netdev_priv(dev); |
| 1786 | netdev_features_t changed = features ^ dev->features; | ||
| 1787 | void __iomem *ioaddr = tp->mmio_addr; | 1786 | void __iomem *ioaddr = tp->mmio_addr; |
| 1787 | u32 rx_config; | ||
| 1788 | 1788 | ||
| 1789 | if (!(changed & (NETIF_F_RXALL | NETIF_F_RXCSUM | | 1789 | rx_config = RTL_R32(RxConfig); |
| 1790 | NETIF_F_HW_VLAN_CTAG_RX))) | 1790 | if (features & NETIF_F_RXALL) |
| 1791 | return; | 1791 | rx_config |= (AcceptErr | AcceptRunt); |
| 1792 | else | ||
| 1793 | rx_config &= ~(AcceptErr | AcceptRunt); | ||
| 1792 | 1794 | ||
| 1793 | if (changed & (NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX)) { | 1795 | RTL_W32(RxConfig, rx_config); |
| 1794 | if (features & NETIF_F_RXCSUM) | ||
| 1795 | tp->cp_cmd |= RxChkSum; | ||
| 1796 | else | ||
| 1797 | tp->cp_cmd &= ~RxChkSum; | ||
| 1798 | 1796 | ||
| 1799 | if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) | 1797 | if (features & NETIF_F_RXCSUM) |
| 1800 | tp->cp_cmd |= RxVlan; | 1798 | tp->cp_cmd |= RxChkSum; |
| 1801 | else | 1799 | else |
| 1802 | tp->cp_cmd &= ~RxVlan; | 1800 | tp->cp_cmd &= ~RxChkSum; |
| 1803 | 1801 | ||
| 1804 | RTL_W16(CPlusCmd, tp->cp_cmd); | 1802 | if (features & NETIF_F_HW_VLAN_CTAG_RX) |
| 1805 | RTL_R16(CPlusCmd); | 1803 | tp->cp_cmd |= RxVlan; |
| 1806 | } | 1804 | else |
| 1807 | if (changed & NETIF_F_RXALL) { | 1805 | tp->cp_cmd &= ~RxVlan; |
| 1808 | int tmp = (RTL_R32(RxConfig) & ~(AcceptErr | AcceptRunt)); | 1806 | |
| 1809 | if (features & NETIF_F_RXALL) | 1807 | tp->cp_cmd |= RTL_R16(CPlusCmd) & ~(RxVlan | RxChkSum); |
| 1810 | tmp |= (AcceptErr | AcceptRunt); | 1808 | |
| 1811 | RTL_W32(RxConfig, tmp); | 1809 | RTL_W16(CPlusCmd, tp->cp_cmd); |
| 1812 | } | 1810 | RTL_R16(CPlusCmd); |
| 1813 | } | 1811 | } |
| 1814 | 1812 | ||
| 1815 | static int rtl8169_set_features(struct net_device *dev, | 1813 | static int rtl8169_set_features(struct net_device *dev, |
| @@ -1817,8 +1815,11 @@ static int rtl8169_set_features(struct net_device *dev, | |||
| 1817 | { | 1815 | { |
| 1818 | struct rtl8169_private *tp = netdev_priv(dev); | 1816 | struct rtl8169_private *tp = netdev_priv(dev); |
| 1819 | 1817 | ||
| 1818 | features &= NETIF_F_RXALL | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX; | ||
| 1819 | |||
| 1820 | rtl_lock_work(tp); | 1820 | rtl_lock_work(tp); |
| 1821 | __rtl8169_set_features(dev, features); | 1821 | if (features ^ dev->features) |
| 1822 | __rtl8169_set_features(dev, features); | ||
| 1822 | rtl_unlock_work(tp); | 1823 | rtl_unlock_work(tp); |
| 1823 | 1824 | ||
| 1824 | return 0; | 1825 | return 0; |
| @@ -7118,8 +7119,7 @@ static void rtl_hw_initialize(struct rtl8169_private *tp) | |||
| 7118 | } | 7119 | } |
| 7119 | } | 7120 | } |
| 7120 | 7121 | ||
| 7121 | static int | 7122 | static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
| 7122 | rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | ||
| 7123 | { | 7123 | { |
| 7124 | const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data; | 7124 | const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data; |
| 7125 | const unsigned int region = cfg->region; | 7125 | const unsigned int region = cfg->region; |
| @@ -7194,7 +7194,7 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 7194 | goto err_out_mwi_2; | 7194 | goto err_out_mwi_2; |
| 7195 | } | 7195 | } |
| 7196 | 7196 | ||
| 7197 | tp->cp_cmd = RxChkSum; | 7197 | tp->cp_cmd = 0; |
| 7198 | 7198 | ||
| 7199 | if ((sizeof(dma_addr_t) > 4) && | 7199 | if ((sizeof(dma_addr_t) > 4) && |
| 7200 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { | 7200 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { |
| @@ -7235,13 +7235,6 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 7235 | 7235 | ||
| 7236 | pci_set_master(pdev); | 7236 | pci_set_master(pdev); |
| 7237 | 7237 | ||
| 7238 | /* | ||
| 7239 | * Pretend we are using VLANs; This bypasses a nasty bug where | ||
| 7240 | * Interrupts stop flowing on high load on 8110SCd controllers. | ||
| 7241 | */ | ||
| 7242 | if (tp->mac_version == RTL_GIGA_MAC_VER_05) | ||
| 7243 | tp->cp_cmd |= RxVlan; | ||
| 7244 | |||
| 7245 | rtl_init_mdio_ops(tp); | 7238 | rtl_init_mdio_ops(tp); |
| 7246 | rtl_init_pll_power_ops(tp); | 7239 | rtl_init_pll_power_ops(tp); |
| 7247 | rtl_init_jumbo_ops(tp); | 7240 | rtl_init_jumbo_ops(tp); |
| @@ -7302,8 +7295,14 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 7302 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | | 7295 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | |
| 7303 | NETIF_F_HIGHDMA; | 7296 | NETIF_F_HIGHDMA; |
| 7304 | 7297 | ||
| 7298 | tp->cp_cmd |= RxChkSum | RxVlan; | ||
| 7299 | |||
| 7300 | /* | ||
| 7301 | * Pretend we are using VLANs; This bypasses a nasty bug where | ||
| 7302 | * Interrupts stop flowing on high load on 8110SCd controllers. | ||
| 7303 | */ | ||
| 7305 | if (tp->mac_version == RTL_GIGA_MAC_VER_05) | 7304 | if (tp->mac_version == RTL_GIGA_MAC_VER_05) |
| 7306 | /* 8110SCd requires hardware Rx VLAN - disallow toggling */ | 7305 | /* Disallow toggling */ |
| 7307 | dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX; | 7306 | dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX; |
| 7308 | 7307 | ||
| 7309 | if (tp->txd_version == RTL_TD_0) | 7308 | if (tp->txd_version == RTL_TD_0) |
diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c index 0537381cd2f6..6859437b59fb 100644 --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c | |||
| @@ -2933,6 +2933,9 @@ void efx_farch_filter_sync_rx_mode(struct efx_nic *efx) | |||
| 2933 | u32 crc; | 2933 | u32 crc; |
| 2934 | int bit; | 2934 | int bit; |
| 2935 | 2935 | ||
| 2936 | if (!efx_dev_registered(efx)) | ||
| 2937 | return; | ||
| 2938 | |||
| 2936 | netif_addr_lock_bh(net_dev); | 2939 | netif_addr_lock_bh(net_dev); |
| 2937 | 2940 | ||
| 2938 | efx->unicast_filter = !(net_dev->flags & IFF_PROMISC); | 2941 | efx->unicast_filter = !(net_dev->flags & IFF_PROMISC); |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 23c89ab5a6ad..f67539650c38 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
| @@ -350,14 +350,17 @@ static int vnet_walk_rx_one(struct vnet_port *port, | |||
| 350 | if (IS_ERR(desc)) | 350 | if (IS_ERR(desc)) |
| 351 | return PTR_ERR(desc); | 351 | return PTR_ERR(desc); |
| 352 | 352 | ||
| 353 | if (desc->hdr.state != VIO_DESC_READY) | ||
| 354 | return 1; | ||
| 355 | |||
| 356 | rmb(); | ||
| 357 | |||
| 353 | viodbg(DATA, "vio_walk_rx_one desc[%02x:%02x:%08x:%08x:%llx:%llx]\n", | 358 | viodbg(DATA, "vio_walk_rx_one desc[%02x:%02x:%08x:%08x:%llx:%llx]\n", |
| 354 | desc->hdr.state, desc->hdr.ack, | 359 | desc->hdr.state, desc->hdr.ack, |
| 355 | desc->size, desc->ncookies, | 360 | desc->size, desc->ncookies, |
| 356 | desc->cookies[0].cookie_addr, | 361 | desc->cookies[0].cookie_addr, |
| 357 | desc->cookies[0].cookie_size); | 362 | desc->cookies[0].cookie_size); |
| 358 | 363 | ||
| 359 | if (desc->hdr.state != VIO_DESC_READY) | ||
| 360 | return 1; | ||
| 361 | err = vnet_rx_one(port, desc->size, desc->cookies, desc->ncookies); | 364 | err = vnet_rx_one(port, desc->size, desc->cookies, desc->ncookies); |
| 362 | if (err == -ECONNRESET) | 365 | if (err == -ECONNRESET) |
| 363 | return err; | 366 | return err; |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 999fb72688d2..e2a00287f8eb 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
| @@ -699,6 +699,28 @@ static void cpsw_rx_handler(void *token, int len, int status) | |||
| 699 | cpsw_dual_emac_src_port_detect(status, priv, ndev, skb); | 699 | cpsw_dual_emac_src_port_detect(status, priv, ndev, skb); |
| 700 | 700 | ||
| 701 | if (unlikely(status < 0) || unlikely(!netif_running(ndev))) { | 701 | if (unlikely(status < 0) || unlikely(!netif_running(ndev))) { |
| 702 | bool ndev_status = false; | ||
| 703 | struct cpsw_slave *slave = priv->slaves; | ||
| 704 | int n; | ||
| 705 | |||
| 706 | if (priv->data.dual_emac) { | ||
| 707 | /* In dual emac mode check for all interfaces */ | ||
| 708 | for (n = priv->data.slaves; n; n--, slave++) | ||
| 709 | if (netif_running(slave->ndev)) | ||
| 710 | ndev_status = true; | ||
| 711 | } | ||
| 712 | |||
| 713 | if (ndev_status && (status >= 0)) { | ||
| 714 | /* The packet received is for the interface which | ||
| 715 | * is already down and the other interface is up | ||
| 716 | * and running, intead of freeing which results | ||
| 717 | * in reducing of the number of rx descriptor in | ||
| 718 | * DMA engine, requeue skb back to cpdma. | ||
| 719 | */ | ||
| 720 | new_skb = skb; | ||
| 721 | goto requeue; | ||
| 722 | } | ||
| 723 | |||
| 702 | /* the interface is going down, skbs are purged */ | 724 | /* the interface is going down, skbs are purged */ |
| 703 | dev_kfree_skb_any(skb); | 725 | dev_kfree_skb_any(skb); |
| 704 | return; | 726 | return; |
| @@ -717,6 +739,7 @@ static void cpsw_rx_handler(void *token, int len, int status) | |||
| 717 | new_skb = skb; | 739 | new_skb = skb; |
| 718 | } | 740 | } |
| 719 | 741 | ||
| 742 | requeue: | ||
| 720 | ret = cpdma_chan_submit(priv->rxch, new_skb, new_skb->data, | 743 | ret = cpdma_chan_submit(priv->rxch, new_skb, new_skb->data, |
| 721 | skb_tailroom(new_skb), 0); | 744 | skb_tailroom(new_skb), 0); |
| 722 | if (WARN_ON(ret < 0)) | 745 | if (WARN_ON(ret < 0)) |
| @@ -2311,10 +2334,19 @@ static int cpsw_suspend(struct device *dev) | |||
| 2311 | struct net_device *ndev = platform_get_drvdata(pdev); | 2334 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 2312 | struct cpsw_priv *priv = netdev_priv(ndev); | 2335 | struct cpsw_priv *priv = netdev_priv(ndev); |
| 2313 | 2336 | ||
| 2314 | if (netif_running(ndev)) | 2337 | if (priv->data.dual_emac) { |
| 2315 | cpsw_ndo_stop(ndev); | 2338 | int i; |
| 2316 | 2339 | ||
| 2317 | for_each_slave(priv, soft_reset_slave); | 2340 | for (i = 0; i < priv->data.slaves; i++) { |
| 2341 | if (netif_running(priv->slaves[i].ndev)) | ||
| 2342 | cpsw_ndo_stop(priv->slaves[i].ndev); | ||
| 2343 | soft_reset_slave(priv->slaves + i); | ||
| 2344 | } | ||
| 2345 | } else { | ||
| 2346 | if (netif_running(ndev)) | ||
| 2347 | cpsw_ndo_stop(ndev); | ||
| 2348 | for_each_slave(priv, soft_reset_slave); | ||
| 2349 | } | ||
| 2318 | 2350 | ||
| 2319 | pm_runtime_put_sync(&pdev->dev); | 2351 | pm_runtime_put_sync(&pdev->dev); |
| 2320 | 2352 | ||
| @@ -2328,14 +2360,24 @@ static int cpsw_resume(struct device *dev) | |||
| 2328 | { | 2360 | { |
| 2329 | struct platform_device *pdev = to_platform_device(dev); | 2361 | struct platform_device *pdev = to_platform_device(dev); |
| 2330 | struct net_device *ndev = platform_get_drvdata(pdev); | 2362 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 2363 | struct cpsw_priv *priv = netdev_priv(ndev); | ||
| 2331 | 2364 | ||
| 2332 | pm_runtime_get_sync(&pdev->dev); | 2365 | pm_runtime_get_sync(&pdev->dev); |
| 2333 | 2366 | ||
| 2334 | /* Select default pin state */ | 2367 | /* Select default pin state */ |
| 2335 | pinctrl_pm_select_default_state(&pdev->dev); | 2368 | pinctrl_pm_select_default_state(&pdev->dev); |
| 2336 | 2369 | ||
| 2337 | if (netif_running(ndev)) | 2370 | if (priv->data.dual_emac) { |
| 2338 | cpsw_ndo_open(ndev); | 2371 | int i; |
| 2372 | |||
| 2373 | for (i = 0; i < priv->data.slaves; i++) { | ||
| 2374 | if (netif_running(priv->slaves[i].ndev)) | ||
| 2375 | cpsw_ndo_open(priv->slaves[i].ndev); | ||
| 2376 | } | ||
| 2377 | } else { | ||
| 2378 | if (netif_running(ndev)) | ||
| 2379 | cpsw_ndo_open(ndev); | ||
| 2380 | } | ||
| 2339 | return 0; | 2381 | return 0; |
| 2340 | } | 2382 | } |
| 2341 | 2383 | ||
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index a96955597755..726edabff26b 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/netpoll.h> | 36 | #include <linux/netpoll.h> |
| 37 | 37 | ||
| 38 | #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) | 38 | #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) |
| 39 | #define MACVLAN_BC_QUEUE_LEN 1000 | ||
| 39 | 40 | ||
| 40 | struct macvlan_port { | 41 | struct macvlan_port { |
| 41 | struct net_device *dev; | 42 | struct net_device *dev; |
| @@ -248,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, | |||
| 248 | goto err; | 249 | goto err; |
| 249 | 250 | ||
| 250 | spin_lock(&port->bc_queue.lock); | 251 | spin_lock(&port->bc_queue.lock); |
| 251 | if (skb_queue_len(&port->bc_queue) < skb->dev->tx_queue_len) { | 252 | if (skb_queue_len(&port->bc_queue) < MACVLAN_BC_QUEUE_LEN) { |
| 252 | __skb_queue_tail(&port->bc_queue, nskb); | 253 | __skb_queue_tail(&port->bc_queue, nskb); |
| 253 | err = 0; | 254 | err = 0; |
| 254 | } | 255 | } |
| @@ -806,6 +807,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev, | |||
| 806 | features, | 807 | features, |
| 807 | mask); | 808 | mask); |
| 808 | features |= ALWAYS_ON_FEATURES; | 809 | features |= ALWAYS_ON_FEATURES; |
| 810 | features &= ~NETIF_F_NETNS_LOCAL; | ||
| 809 | 811 | ||
| 810 | return features; | 812 | return features; |
| 811 | } | 813 | } |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index fd0ea7c50ee6..011dbda2b2f1 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
| @@ -592,8 +592,7 @@ static struct phy_driver ksphy_driver[] = { | |||
| 592 | .phy_id = PHY_ID_KSZ9031, | 592 | .phy_id = PHY_ID_KSZ9031, |
| 593 | .phy_id_mask = 0x00fffff0, | 593 | .phy_id_mask = 0x00fffff0, |
| 594 | .name = "Micrel KSZ9031 Gigabit PHY", | 594 | .name = "Micrel KSZ9031 Gigabit PHY", |
| 595 | .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 595 | .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause), |
| 596 | | SUPPORTED_Asym_Pause), | ||
| 597 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | 596 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, |
| 598 | .config_init = ksz9031_config_init, | 597 | .config_init = ksz9031_config_init, |
| 599 | .config_aneg = genphy_config_aneg, | 598 | .config_aneg = genphy_config_aneg, |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 87f710476217..74760e8143e3 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
| @@ -2019,7 +2019,7 @@ static int rtl8153_enable(struct r8152 *tp) | |||
| 2019 | return rtl_enable(tp); | 2019 | return rtl_enable(tp); |
| 2020 | } | 2020 | } |
| 2021 | 2021 | ||
| 2022 | static void rtl8152_disable(struct r8152 *tp) | 2022 | static void rtl_disable(struct r8152 *tp) |
| 2023 | { | 2023 | { |
| 2024 | u32 ocp_data; | 2024 | u32 ocp_data; |
| 2025 | int i; | 2025 | int i; |
| @@ -2232,6 +2232,13 @@ static inline void r8152b_enable_aldps(struct r8152 *tp) | |||
| 2232 | LINKENA | DIS_SDSAVE); | 2232 | LINKENA | DIS_SDSAVE); |
| 2233 | } | 2233 | } |
| 2234 | 2234 | ||
| 2235 | static void rtl8152_disable(struct r8152 *tp) | ||
| 2236 | { | ||
| 2237 | r8152b_disable_aldps(tp); | ||
| 2238 | rtl_disable(tp); | ||
| 2239 | r8152b_enable_aldps(tp); | ||
| 2240 | } | ||
| 2241 | |||
| 2235 | static void r8152b_hw_phy_cfg(struct r8152 *tp) | 2242 | static void r8152b_hw_phy_cfg(struct r8152 *tp) |
| 2236 | { | 2243 | { |
| 2237 | u16 data; | 2244 | u16 data; |
| @@ -2242,11 +2249,8 @@ static void r8152b_hw_phy_cfg(struct r8152 *tp) | |||
| 2242 | r8152_mdio_write(tp, MII_BMCR, data); | 2249 | r8152_mdio_write(tp, MII_BMCR, data); |
| 2243 | } | 2250 | } |
| 2244 | 2251 | ||
| 2245 | r8152b_disable_aldps(tp); | ||
| 2246 | |||
| 2247 | rtl_clear_bp(tp); | 2252 | rtl_clear_bp(tp); |
| 2248 | 2253 | ||
| 2249 | r8152b_enable_aldps(tp); | ||
| 2250 | set_bit(PHY_RESET, &tp->flags); | 2254 | set_bit(PHY_RESET, &tp->flags); |
| 2251 | } | 2255 | } |
| 2252 | 2256 | ||
| @@ -2255,9 +2259,6 @@ static void r8152b_exit_oob(struct r8152 *tp) | |||
| 2255 | u32 ocp_data; | 2259 | u32 ocp_data; |
| 2256 | int i; | 2260 | int i; |
| 2257 | 2261 | ||
| 2258 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
| 2259 | return; | ||
| 2260 | |||
| 2261 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); | 2262 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); |
| 2262 | ocp_data &= ~RCR_ACPT_ALL; | 2263 | ocp_data &= ~RCR_ACPT_ALL; |
| 2263 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); | 2264 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); |
| @@ -2347,7 +2348,7 @@ static void r8152b_enter_oob(struct r8152 *tp) | |||
| 2347 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_OOB); | 2348 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_OOB); |
| 2348 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_OOB); | 2349 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_OOB); |
| 2349 | 2350 | ||
| 2350 | rtl8152_disable(tp); | 2351 | rtl_disable(tp); |
| 2351 | 2352 | ||
| 2352 | for (i = 0; i < 1000; i++) { | 2353 | for (i = 0; i < 1000; i++) { |
| 2353 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); | 2354 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); |
| @@ -2485,9 +2486,6 @@ static void r8153_first_init(struct r8152 *tp) | |||
| 2485 | u32 ocp_data; | 2486 | u32 ocp_data; |
| 2486 | int i; | 2487 | int i; |
| 2487 | 2488 | ||
| 2488 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
| 2489 | return; | ||
| 2490 | |||
| 2491 | rxdy_gated_en(tp, true); | 2489 | rxdy_gated_en(tp, true); |
| 2492 | r8153_teredo_off(tp); | 2490 | r8153_teredo_off(tp); |
| 2493 | 2491 | ||
| @@ -2560,7 +2558,7 @@ static void r8153_enter_oob(struct r8152 *tp) | |||
| 2560 | ocp_data &= ~NOW_IS_OOB; | 2558 | ocp_data &= ~NOW_IS_OOB; |
| 2561 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data); | 2559 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data); |
| 2562 | 2560 | ||
| 2563 | rtl8152_disable(tp); | 2561 | rtl_disable(tp); |
| 2564 | 2562 | ||
| 2565 | for (i = 0; i < 1000; i++) { | 2563 | for (i = 0; i < 1000; i++) { |
| 2566 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); | 2564 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); |
| @@ -2624,6 +2622,13 @@ static void r8153_enable_aldps(struct r8152 *tp) | |||
| 2624 | ocp_reg_write(tp, OCP_POWER_CFG, data); | 2622 | ocp_reg_write(tp, OCP_POWER_CFG, data); |
| 2625 | } | 2623 | } |
| 2626 | 2624 | ||
| 2625 | static void rtl8153_disable(struct r8152 *tp) | ||
| 2626 | { | ||
| 2627 | r8153_disable_aldps(tp); | ||
| 2628 | rtl_disable(tp); | ||
| 2629 | r8153_enable_aldps(tp); | ||
| 2630 | } | ||
| 2631 | |||
| 2627 | static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex) | 2632 | static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex) |
| 2628 | { | 2633 | { |
| 2629 | u16 bmcr, anar, gbcr; | 2634 | u16 bmcr, anar, gbcr; |
| @@ -2714,6 +2719,16 @@ out: | |||
| 2714 | return ret; | 2719 | return ret; |
| 2715 | } | 2720 | } |
| 2716 | 2721 | ||
| 2722 | static void rtl8152_up(struct r8152 *tp) | ||
| 2723 | { | ||
| 2724 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
| 2725 | return; | ||
| 2726 | |||
| 2727 | r8152b_disable_aldps(tp); | ||
| 2728 | r8152b_exit_oob(tp); | ||
| 2729 | r8152b_enable_aldps(tp); | ||
| 2730 | } | ||
| 2731 | |||
| 2717 | static void rtl8152_down(struct r8152 *tp) | 2732 | static void rtl8152_down(struct r8152 *tp) |
| 2718 | { | 2733 | { |
| 2719 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { | 2734 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { |
| @@ -2727,6 +2742,16 @@ static void rtl8152_down(struct r8152 *tp) | |||
| 2727 | r8152b_enable_aldps(tp); | 2742 | r8152b_enable_aldps(tp); |
| 2728 | } | 2743 | } |
| 2729 | 2744 | ||
| 2745 | static void rtl8153_up(struct r8152 *tp) | ||
| 2746 | { | ||
| 2747 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
| 2748 | return; | ||
| 2749 | |||
| 2750 | r8153_disable_aldps(tp); | ||
| 2751 | r8153_first_init(tp); | ||
| 2752 | r8153_enable_aldps(tp); | ||
| 2753 | } | ||
| 2754 | |||
| 2730 | static void rtl8153_down(struct r8152 *tp) | 2755 | static void rtl8153_down(struct r8152 *tp) |
| 2731 | { | 2756 | { |
| 2732 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { | 2757 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { |
| @@ -2946,6 +2971,8 @@ static void r8152b_init(struct r8152 *tp) | |||
| 2946 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | 2971 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) |
| 2947 | return; | 2972 | return; |
| 2948 | 2973 | ||
| 2974 | r8152b_disable_aldps(tp); | ||
| 2975 | |||
| 2949 | if (tp->version == RTL_VER_01) { | 2976 | if (tp->version == RTL_VER_01) { |
| 2950 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE); | 2977 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE); |
| 2951 | ocp_data &= ~LED_MODE_MASK; | 2978 | ocp_data &= ~LED_MODE_MASK; |
| @@ -2984,6 +3011,7 @@ static void r8153_init(struct r8152 *tp) | |||
| 2984 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | 3011 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) |
| 2985 | return; | 3012 | return; |
| 2986 | 3013 | ||
| 3014 | r8153_disable_aldps(tp); | ||
| 2987 | r8153_u1u2en(tp, false); | 3015 | r8153_u1u2en(tp, false); |
| 2988 | 3016 | ||
| 2989 | for (i = 0; i < 500; i++) { | 3017 | for (i = 0; i < 500; i++) { |
| @@ -3392,7 +3420,7 @@ static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) | |||
| 3392 | ops->init = r8152b_init; | 3420 | ops->init = r8152b_init; |
| 3393 | ops->enable = rtl8152_enable; | 3421 | ops->enable = rtl8152_enable; |
| 3394 | ops->disable = rtl8152_disable; | 3422 | ops->disable = rtl8152_disable; |
| 3395 | ops->up = r8152b_exit_oob; | 3423 | ops->up = rtl8152_up; |
| 3396 | ops->down = rtl8152_down; | 3424 | ops->down = rtl8152_down; |
| 3397 | ops->unload = rtl8152_unload; | 3425 | ops->unload = rtl8152_unload; |
| 3398 | ret = 0; | 3426 | ret = 0; |
| @@ -3400,8 +3428,8 @@ static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) | |||
| 3400 | case PRODUCT_ID_RTL8153: | 3428 | case PRODUCT_ID_RTL8153: |
| 3401 | ops->init = r8153_init; | 3429 | ops->init = r8153_init; |
| 3402 | ops->enable = rtl8153_enable; | 3430 | ops->enable = rtl8153_enable; |
| 3403 | ops->disable = rtl8152_disable; | 3431 | ops->disable = rtl8153_disable; |
| 3404 | ops->up = r8153_first_init; | 3432 | ops->up = rtl8153_up; |
| 3405 | ops->down = rtl8153_down; | 3433 | ops->down = rtl8153_down; |
| 3406 | ops->unload = rtl8153_unload; | 3434 | ops->unload = rtl8153_unload; |
| 3407 | ret = 0; | 3435 | ret = 0; |
| @@ -3416,8 +3444,8 @@ static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) | |||
| 3416 | case PRODUCT_ID_SAMSUNG: | 3444 | case PRODUCT_ID_SAMSUNG: |
| 3417 | ops->init = r8153_init; | 3445 | ops->init = r8153_init; |
| 3418 | ops->enable = rtl8153_enable; | 3446 | ops->enable = rtl8153_enable; |
| 3419 | ops->disable = rtl8152_disable; | 3447 | ops->disable = rtl8153_disable; |
| 3420 | ops->up = r8153_first_init; | 3448 | ops->up = rtl8153_up; |
| 3421 | ops->down = rtl8153_down; | 3449 | ops->down = rtl8153_down; |
| 3422 | ops->unload = rtl8153_unload; | 3450 | ops->unload = rtl8153_unload; |
| 3423 | ret = 0; | 3451 | ret = 0; |
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.c b/drivers/net/wireless/ath/ath9k/common-beacon.c index 733be5178481..6ad44470d0f2 100644 --- a/drivers/net/wireless/ath/ath9k/common-beacon.c +++ b/drivers/net/wireless/ath/ath9k/common-beacon.c | |||
| @@ -57,7 +57,7 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, | |||
| 57 | struct ath9k_beacon_state *bs) | 57 | struct ath9k_beacon_state *bs) |
| 58 | { | 58 | { |
| 59 | struct ath_common *common = ath9k_hw_common(ah); | 59 | struct ath_common *common = ath9k_hw_common(ah); |
| 60 | int dtim_intval, sleepduration; | 60 | int dtim_intval; |
| 61 | u64 tsf; | 61 | u64 tsf; |
| 62 | 62 | ||
| 63 | /* No need to configure beacon if we are not associated */ | 63 | /* No need to configure beacon if we are not associated */ |
| @@ -75,7 +75,6 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, | |||
| 75 | * last beacon we received (which may be none). | 75 | * last beacon we received (which may be none). |
| 76 | */ | 76 | */ |
| 77 | dtim_intval = conf->intval * conf->dtim_period; | 77 | dtim_intval = conf->intval * conf->dtim_period; |
| 78 | sleepduration = ah->hw->conf.listen_interval * conf->intval; | ||
| 79 | 78 | ||
| 80 | /* | 79 | /* |
| 81 | * Pull nexttbtt forward to reflect the current | 80 | * Pull nexttbtt forward to reflect the current |
| @@ -113,7 +112,7 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, | |||
| 113 | */ | 112 | */ |
| 114 | 113 | ||
| 115 | bs->bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100), | 114 | bs->bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100), |
| 116 | sleepduration)); | 115 | conf->intval)); |
| 117 | if (bs->bs_sleepduration > bs->bs_dtimperiod) | 116 | if (bs->bs_sleepduration > bs->bs_dtimperiod) |
| 118 | bs->bs_sleepduration = bs->bs_dtimperiod; | 117 | bs->bs_sleepduration = bs->bs_dtimperiod; |
| 119 | 118 | ||
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index bb86eb2ffc95..f0484b1b617e 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
| @@ -978,7 +978,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
| 978 | struct ath_hw *ah = common->ah; | 978 | struct ath_hw *ah = common->ah; |
| 979 | struct ath_htc_rx_status *rxstatus; | 979 | struct ath_htc_rx_status *rxstatus; |
| 980 | struct ath_rx_status rx_stats; | 980 | struct ath_rx_status rx_stats; |
| 981 | bool decrypt_error; | 981 | bool decrypt_error = false; |
| 982 | 982 | ||
| 983 | if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { | 983 | if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { |
| 984 | ath_err(common, "Corrupted RX frame, dropping (len: %d)\n", | 984 | ath_err(common, "Corrupted RX frame, dropping (len: %d)\n", |
diff --git a/drivers/net/wireless/brcm80211/Kconfig b/drivers/net/wireless/brcm80211/Kconfig index b8e2561ea645..fe3dc126b149 100644 --- a/drivers/net/wireless/brcm80211/Kconfig +++ b/drivers/net/wireless/brcm80211/Kconfig | |||
| @@ -27,10 +27,17 @@ config BRCMFMAC | |||
| 27 | one of the bus interface support. If you choose to build a module, | 27 | one of the bus interface support. If you choose to build a module, |
| 28 | it'll be called brcmfmac.ko. | 28 | it'll be called brcmfmac.ko. |
| 29 | 29 | ||
| 30 | config BRCMFMAC_PROTO_BCDC | ||
| 31 | bool | ||
| 32 | |||
| 33 | config BRCMFMAC_PROTO_MSGBUF | ||
| 34 | bool | ||
| 35 | |||
| 30 | config BRCMFMAC_SDIO | 36 | config BRCMFMAC_SDIO |
| 31 | bool "SDIO bus interface support for FullMAC driver" | 37 | bool "SDIO bus interface support for FullMAC driver" |
| 32 | depends on (MMC = y || MMC = BRCMFMAC) | 38 | depends on (MMC = y || MMC = BRCMFMAC) |
| 33 | depends on BRCMFMAC | 39 | depends on BRCMFMAC |
| 40 | select BRCMFMAC_PROTO_BCDC | ||
| 34 | select FW_LOADER | 41 | select FW_LOADER |
| 35 | default y | 42 | default y |
| 36 | ---help--- | 43 | ---help--- |
| @@ -42,6 +49,7 @@ config BRCMFMAC_USB | |||
| 42 | bool "USB bus interface support for FullMAC driver" | 49 | bool "USB bus interface support for FullMAC driver" |
| 43 | depends on (USB = y || USB = BRCMFMAC) | 50 | depends on (USB = y || USB = BRCMFMAC) |
| 44 | depends on BRCMFMAC | 51 | depends on BRCMFMAC |
| 52 | select BRCMFMAC_PROTO_BCDC | ||
| 45 | select FW_LOADER | 53 | select FW_LOADER |
| 46 | ---help--- | 54 | ---help--- |
| 47 | This option enables the USB bus interface support for Broadcom | 55 | This option enables the USB bus interface support for Broadcom |
| @@ -52,6 +60,8 @@ config BRCMFMAC_PCIE | |||
| 52 | bool "PCIE bus interface support for FullMAC driver" | 60 | bool "PCIE bus interface support for FullMAC driver" |
| 53 | depends on BRCMFMAC | 61 | depends on BRCMFMAC |
| 54 | depends on PCI | 62 | depends on PCI |
| 63 | depends on HAS_DMA | ||
| 64 | select BRCMFMAC_PROTO_MSGBUF | ||
| 55 | select FW_LOADER | 65 | select FW_LOADER |
| 56 | ---help--- | 66 | ---help--- |
| 57 | This option enables the PCIE bus interface support for Broadcom | 67 | This option enables the PCIE bus interface support for Broadcom |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/Makefile b/drivers/net/wireless/brcm80211/brcmfmac/Makefile index c35adf4bc70b..90a977fe9a64 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/Makefile +++ b/drivers/net/wireless/brcm80211/brcmfmac/Makefile | |||
| @@ -30,16 +30,18 @@ brcmfmac-objs += \ | |||
| 30 | fwsignal.o \ | 30 | fwsignal.o \ |
| 31 | p2p.o \ | 31 | p2p.o \ |
| 32 | proto.o \ | 32 | proto.o \ |
| 33 | bcdc.o \ | ||
| 34 | commonring.o \ | ||
| 35 | flowring.o \ | ||
| 36 | msgbuf.o \ | ||
| 37 | dhd_common.o \ | 33 | dhd_common.o \ |
| 38 | dhd_linux.o \ | 34 | dhd_linux.o \ |
| 39 | firmware.o \ | 35 | firmware.o \ |
| 40 | feature.o \ | 36 | feature.o \ |
| 41 | btcoex.o \ | 37 | btcoex.o \ |
| 42 | vendor.o | 38 | vendor.o |
| 39 | brcmfmac-$(CONFIG_BRCMFMAC_PROTO_BCDC) += \ | ||
| 40 | bcdc.o | ||
| 41 | brcmfmac-$(CONFIG_BRCMFMAC_PROTO_MSGBUF) += \ | ||
| 42 | commonring.o \ | ||
| 43 | flowring.o \ | ||
| 44 | msgbuf.o | ||
| 43 | brcmfmac-$(CONFIG_BRCMFMAC_SDIO) += \ | 45 | brcmfmac-$(CONFIG_BRCMFMAC_SDIO) += \ |
| 44 | dhd_sdio.o \ | 46 | dhd_sdio.o \ |
| 45 | bcmsdh.o | 47 | bcmsdh.o |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.h b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.h index 17e8c039ff32..6003179c0ceb 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.h | |||
| @@ -16,9 +16,12 @@ | |||
| 16 | #ifndef BRCMFMAC_BCDC_H | 16 | #ifndef BRCMFMAC_BCDC_H |
| 17 | #define BRCMFMAC_BCDC_H | 17 | #define BRCMFMAC_BCDC_H |
| 18 | 18 | ||
| 19 | 19 | #ifdef CONFIG_BRCMFMAC_PROTO_BCDC | |
| 20 | int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr); | 20 | int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr); |
| 21 | void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr); | 21 | void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr); |
| 22 | 22 | #else | |
| 23 | static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; } | ||
| 24 | static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {} | ||
| 25 | #endif | ||
| 23 | 26 | ||
| 24 | #endif /* BRCMFMAC_BCDC_H */ | 27 | #endif /* BRCMFMAC_BCDC_H */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c index 4f1daabc551b..44fc85f68f7a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c | |||
| @@ -185,7 +185,13 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, | |||
| 185 | ifevent->action, ifevent->ifidx, ifevent->bssidx, | 185 | ifevent->action, ifevent->ifidx, ifevent->bssidx, |
| 186 | ifevent->flags, ifevent->role); | 186 | ifevent->flags, ifevent->role); |
| 187 | 187 | ||
| 188 | if (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) { | 188 | /* The P2P Device interface event must not be ignored |
| 189 | * contrary to what firmware tells us. The only way to | ||
| 190 | * distinguish the P2P Device is by looking at the ifidx | ||
| 191 | * and bssidx received. | ||
| 192 | */ | ||
| 193 | if (!(ifevent->ifidx == 0 && ifevent->bssidx == 1) && | ||
| 194 | (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { | ||
| 189 | brcmf_dbg(EVENT, "event can be ignored\n"); | 195 | brcmf_dbg(EVENT, "event can be ignored\n"); |
| 190 | return; | 196 | return; |
| 191 | } | 197 | } |
| @@ -210,12 +216,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, | |||
| 210 | return; | 216 | return; |
| 211 | } | 217 | } |
| 212 | 218 | ||
| 213 | if (ifevent->action == BRCMF_E_IF_CHANGE) | 219 | if (ifp && ifevent->action == BRCMF_E_IF_CHANGE) |
| 214 | brcmf_fws_reset_interface(ifp); | 220 | brcmf_fws_reset_interface(ifp); |
| 215 | 221 | ||
| 216 | err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); | 222 | err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); |
| 217 | 223 | ||
| 218 | if (ifevent->action == BRCMF_E_IF_DEL) { | 224 | if (ifp && ifevent->action == BRCMF_E_IF_DEL) { |
| 219 | brcmf_fws_del_interface(ifp); | 225 | brcmf_fws_del_interface(ifp); |
| 220 | brcmf_del_if(drvr, ifevent->bssidx); | 226 | brcmf_del_if(drvr, ifevent->bssidx); |
| 221 | } | 227 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h index dd20b1862d44..cbf033f59109 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h | |||
| @@ -172,6 +172,8 @@ enum brcmf_fweh_event_code { | |||
| 172 | #define BRCMF_E_IF_ROLE_STA 0 | 172 | #define BRCMF_E_IF_ROLE_STA 0 |
| 173 | #define BRCMF_E_IF_ROLE_AP 1 | 173 | #define BRCMF_E_IF_ROLE_AP 1 |
| 174 | #define BRCMF_E_IF_ROLE_WDS 2 | 174 | #define BRCMF_E_IF_ROLE_WDS 2 |
| 175 | #define BRCMF_E_IF_ROLE_P2P_GO 3 | ||
| 176 | #define BRCMF_E_IF_ROLE_P2P_CLIENT 4 | ||
| 175 | 177 | ||
| 176 | /** | 178 | /** |
| 177 | * definitions for event packet validation. | 179 | * definitions for event packet validation. |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h index f901ae52bf2b..77a51b8c1e12 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #ifndef BRCMFMAC_MSGBUF_H | 15 | #ifndef BRCMFMAC_MSGBUF_H |
| 16 | #define BRCMFMAC_MSGBUF_H | 16 | #define BRCMFMAC_MSGBUF_H |
| 17 | 17 | ||
| 18 | #ifdef CONFIG_BRCMFMAC_PROTO_MSGBUF | ||
| 18 | 19 | ||
| 19 | #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 | 20 | #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 20 |
| 20 | #define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 | 21 | #define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 256 |
| @@ -32,9 +33,15 @@ | |||
| 32 | 33 | ||
| 33 | 34 | ||
| 34 | int brcmf_proto_msgbuf_rx_trigger(struct device *dev); | 35 | int brcmf_proto_msgbuf_rx_trigger(struct device *dev); |
| 36 | void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u8 flowid); | ||
| 35 | int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr); | 37 | int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr); |
| 36 | void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr); | 38 | void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr); |
| 37 | void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u8 flowid); | 39 | #else |
| 38 | 40 | static inline int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr) | |
| 41 | { | ||
| 42 | return 0; | ||
| 43 | } | ||
| 44 | static inline void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr) {} | ||
| 45 | #endif | ||
| 39 | 46 | ||
| 40 | #endif /* BRCMFMAC_MSGBUF_H */ | 47 | #endif /* BRCMFMAC_MSGBUF_H */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 02fe706fc9ec..f3a9804988a6 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
| @@ -497,8 +497,11 @@ brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable) | |||
| 497 | static void | 497 | static void |
| 498 | brcmf_cfg80211_update_proto_addr_mode(struct wireless_dev *wdev) | 498 | brcmf_cfg80211_update_proto_addr_mode(struct wireless_dev *wdev) |
| 499 | { | 499 | { |
| 500 | struct net_device *ndev = wdev->netdev; | 500 | struct brcmf_cfg80211_vif *vif; |
| 501 | struct brcmf_if *ifp = netdev_priv(ndev); | 501 | struct brcmf_if *ifp; |
| 502 | |||
| 503 | vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev); | ||
| 504 | ifp = vif->ifp; | ||
| 502 | 505 | ||
| 503 | if ((wdev->iftype == NL80211_IFTYPE_ADHOC) || | 506 | if ((wdev->iftype == NL80211_IFTYPE_ADHOC) || |
| 504 | (wdev->iftype == NL80211_IFTYPE_AP) || | 507 | (wdev->iftype == NL80211_IFTYPE_AP) || |
| @@ -5143,6 +5146,7 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg) | |||
| 5143 | 5146 | ||
| 5144 | ch.band = BRCMU_CHAN_BAND_2G; | 5147 | ch.band = BRCMU_CHAN_BAND_2G; |
| 5145 | ch.bw = BRCMU_CHAN_BW_40; | 5148 | ch.bw = BRCMU_CHAN_BW_40; |
| 5149 | ch.sb = BRCMU_CHAN_SB_NONE; | ||
| 5146 | ch.chnum = 0; | 5150 | ch.chnum = 0; |
| 5147 | cfg->d11inf.encchspec(&ch); | 5151 | cfg->d11inf.encchspec(&ch); |
| 5148 | 5152 | ||
| @@ -5176,6 +5180,7 @@ static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg) | |||
| 5176 | 5180 | ||
| 5177 | brcmf_update_bw40_channel_flag(&band->channels[j], &ch); | 5181 | brcmf_update_bw40_channel_flag(&band->channels[j], &ch); |
| 5178 | } | 5182 | } |
| 5183 | kfree(pbuf); | ||
| 5179 | } | 5184 | } |
| 5180 | return err; | 5185 | return err; |
| 5181 | } | 5186 | } |
diff --git a/drivers/net/wireless/iwlwifi/dvm/power.c b/drivers/net/wireless/iwlwifi/dvm/power.c index 760c45c34ef3..1513dbc79c14 100644 --- a/drivers/net/wireless/iwlwifi/dvm/power.c +++ b/drivers/net/wireless/iwlwifi/dvm/power.c | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | #include "commands.h" | 40 | #include "commands.h" |
| 41 | #include "power.h" | 41 | #include "power.h" |
| 42 | 42 | ||
| 43 | static bool force_cam; | 43 | static bool force_cam = true; |
| 44 | module_param(force_cam, bool, 0644); | 44 | module_param(force_cam, bool, 0644); |
| 45 | MODULE_PARM_DESC(force_cam, "force continuously aware mode (no power saving at all)"); | 45 | MODULE_PARM_DESC(force_cam, "force continuously aware mode (no power saving at all)"); |
| 46 | 46 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c index d67a37a786aa..d53adc245497 100644 --- a/drivers/net/wireless/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/iwlwifi/iwl-7000.c | |||
| @@ -83,6 +83,8 @@ | |||
| 83 | #define IWL7260_TX_POWER_VERSION 0xffff /* meaningless */ | 83 | #define IWL7260_TX_POWER_VERSION 0xffff /* meaningless */ |
| 84 | #define IWL3160_NVM_VERSION 0x709 | 84 | #define IWL3160_NVM_VERSION 0x709 |
| 85 | #define IWL3160_TX_POWER_VERSION 0xffff /* meaningless */ | 85 | #define IWL3160_TX_POWER_VERSION 0xffff /* meaningless */ |
| 86 | #define IWL3165_NVM_VERSION 0x709 | ||
| 87 | #define IWL3165_TX_POWER_VERSION 0xffff /* meaningless */ | ||
| 86 | #define IWL7265_NVM_VERSION 0x0a1d | 88 | #define IWL7265_NVM_VERSION 0x0a1d |
| 87 | #define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */ | 89 | #define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */ |
| 88 | 90 | ||
| @@ -92,6 +94,9 @@ | |||
| 92 | #define IWL3160_FW_PRE "iwlwifi-3160-" | 94 | #define IWL3160_FW_PRE "iwlwifi-3160-" |
| 93 | #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode" | 95 | #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode" |
| 94 | 96 | ||
| 97 | #define IWL3165_FW_PRE "iwlwifi-3165-" | ||
| 98 | #define IWL3165_MODULE_FIRMWARE(api) IWL3165_FW_PRE __stringify(api) ".ucode" | ||
| 99 | |||
| 95 | #define IWL7265_FW_PRE "iwlwifi-7265-" | 100 | #define IWL7265_FW_PRE "iwlwifi-7265-" |
| 96 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" | 101 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" |
| 97 | 102 | ||
| @@ -213,6 +218,16 @@ static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = { | |||
| 213 | {0}, | 218 | {0}, |
| 214 | }; | 219 | }; |
| 215 | 220 | ||
| 221 | const struct iwl_cfg iwl3165_2ac_cfg = { | ||
| 222 | .name = "Intel(R) Dual Band Wireless AC 3165", | ||
| 223 | .fw_name_pre = IWL3165_FW_PRE, | ||
| 224 | IWL_DEVICE_7000, | ||
| 225 | .ht_params = &iwl7000_ht_params, | ||
| 226 | .nvm_ver = IWL3165_NVM_VERSION, | ||
| 227 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, | ||
| 228 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | ||
| 229 | }; | ||
| 230 | |||
| 216 | const struct iwl_cfg iwl7265_2ac_cfg = { | 231 | const struct iwl_cfg iwl7265_2ac_cfg = { |
| 217 | .name = "Intel(R) Dual Band Wireless AC 7265", | 232 | .name = "Intel(R) Dual Band Wireless AC 7265", |
| 218 | .fw_name_pre = IWL7265_FW_PRE, | 233 | .fw_name_pre = IWL7265_FW_PRE, |
| @@ -245,4 +260,5 @@ const struct iwl_cfg iwl7265_n_cfg = { | |||
| 245 | 260 | ||
| 246 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 261 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
| 247 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); | 262 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); |
| 263 | MODULE_FIRMWARE(IWL3165_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); | ||
| 248 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 264 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index 8da596db9abe..3d7cc37420ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
| @@ -120,6 +120,8 @@ enum iwl_led_mode { | |||
| 120 | #define IWL_LONG_WD_TIMEOUT 10000 | 120 | #define IWL_LONG_WD_TIMEOUT 10000 |
| 121 | #define IWL_MAX_WD_TIMEOUT 120000 | 121 | #define IWL_MAX_WD_TIMEOUT 120000 |
| 122 | 122 | ||
| 123 | #define IWL_DEFAULT_MAX_TX_POWER 22 | ||
| 124 | |||
| 123 | /* Antenna presence definitions */ | 125 | /* Antenna presence definitions */ |
| 124 | #define ANT_NONE 0x0 | 126 | #define ANT_NONE 0x0 |
| 125 | #define ANT_A BIT(0) | 127 | #define ANT_A BIT(0) |
| @@ -335,6 +337,7 @@ extern const struct iwl_cfg iwl7260_n_cfg; | |||
| 335 | extern const struct iwl_cfg iwl3160_2ac_cfg; | 337 | extern const struct iwl_cfg iwl3160_2ac_cfg; |
| 336 | extern const struct iwl_cfg iwl3160_2n_cfg; | 338 | extern const struct iwl_cfg iwl3160_2n_cfg; |
| 337 | extern const struct iwl_cfg iwl3160_n_cfg; | 339 | extern const struct iwl_cfg iwl3160_n_cfg; |
| 340 | extern const struct iwl_cfg iwl3165_2ac_cfg; | ||
| 338 | extern const struct iwl_cfg iwl7265_2ac_cfg; | 341 | extern const struct iwl_cfg iwl7265_2ac_cfg; |
| 339 | extern const struct iwl_cfg iwl7265_2n_cfg; | 342 | extern const struct iwl_cfg iwl7265_2n_cfg; |
| 340 | extern const struct iwl_cfg iwl7265_n_cfg; | 343 | extern const struct iwl_cfg iwl7265_n_cfg; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c index 018af2957d3b..354255f08754 100644 --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | |||
| @@ -146,8 +146,6 @@ static const u8 iwl_nvm_channels_family_8000[] = { | |||
| 146 | #define LAST_2GHZ_HT_PLUS 9 | 146 | #define LAST_2GHZ_HT_PLUS 9 |
| 147 | #define LAST_5GHZ_HT 161 | 147 | #define LAST_5GHZ_HT 161 |
| 148 | 148 | ||
| 149 | #define DEFAULT_MAX_TX_POWER 16 | ||
| 150 | |||
| 151 | /* rate data (static) */ | 149 | /* rate data (static) */ |
| 152 | static struct ieee80211_rate iwl_cfg80211_rates[] = { | 150 | static struct ieee80211_rate iwl_cfg80211_rates[] = { |
| 153 | { .bitrate = 1 * 10, .hw_value = 0, .hw_value_short = 0, }, | 151 | { .bitrate = 1 * 10, .hw_value = 0, .hw_value_short = 0, }, |
| @@ -295,7 +293,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
| 295 | * Default value - highest tx power value. max_power | 293 | * Default value - highest tx power value. max_power |
| 296 | * is not used in mvm, and is used for backwards compatibility | 294 | * is not used in mvm, and is used for backwards compatibility |
| 297 | */ | 295 | */ |
| 298 | channel->max_power = DEFAULT_MAX_TX_POWER; | 296 | channel->max_power = IWL_DEFAULT_MAX_TX_POWER; |
| 299 | is_5ghz = channel->band == IEEE80211_BAND_5GHZ; | 297 | is_5ghz = channel->band == IEEE80211_BAND_5GHZ; |
| 300 | IWL_DEBUG_EEPROM(dev, | 298 | IWL_DEBUG_EEPROM(dev, |
| 301 | "Ch. %d [%sGHz] %s%s%s%s%s%s%s(0x%02x %ddBm): Ad-Hoc %ssupported\n", | 299 | "Ch. %d [%sGHz] %s%s%s%s%s%s%s(0x%02x %ddBm): Ad-Hoc %ssupported\n", |
diff --git a/drivers/net/wireless/iwlwifi/mvm/coex.c b/drivers/net/wireless/iwlwifi/mvm/coex.c index 2291bbcaaeab..ce71625f497f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/coex.c +++ b/drivers/net/wireless/iwlwifi/mvm/coex.c | |||
| @@ -585,8 +585,6 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm) | |||
| 585 | lockdep_assert_held(&mvm->mutex); | 585 | lockdep_assert_held(&mvm->mutex); |
| 586 | 586 | ||
| 587 | if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) { | 587 | if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) { |
| 588 | u32 mode; | ||
| 589 | |||
| 590 | switch (mvm->bt_force_ant_mode) { | 588 | switch (mvm->bt_force_ant_mode) { |
| 591 | case BT_FORCE_ANT_BT: | 589 | case BT_FORCE_ANT_BT: |
| 592 | mode = BT_COEX_BT; | 590 | mode = BT_COEX_BT; |
| @@ -756,7 +754,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, | |||
| 756 | struct iwl_bt_iterator_data *data = _data; | 754 | struct iwl_bt_iterator_data *data = _data; |
| 757 | struct iwl_mvm *mvm = data->mvm; | 755 | struct iwl_mvm *mvm = data->mvm; |
| 758 | struct ieee80211_chanctx_conf *chanctx_conf; | 756 | struct ieee80211_chanctx_conf *chanctx_conf; |
| 759 | enum ieee80211_smps_mode smps_mode; | 757 | /* default smps_mode is AUTOMATIC - only used for client modes */ |
| 758 | enum ieee80211_smps_mode smps_mode = IEEE80211_SMPS_AUTOMATIC; | ||
| 760 | u32 bt_activity_grading; | 759 | u32 bt_activity_grading; |
| 761 | int ave_rssi; | 760 | int ave_rssi; |
| 762 | 761 | ||
| @@ -764,8 +763,6 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, | |||
| 764 | 763 | ||
| 765 | switch (vif->type) { | 764 | switch (vif->type) { |
| 766 | case NL80211_IFTYPE_STATION: | 765 | case NL80211_IFTYPE_STATION: |
| 767 | /* default smps_mode for BSS / P2P client is AUTOMATIC */ | ||
| 768 | smps_mode = IEEE80211_SMPS_AUTOMATIC; | ||
| 769 | break; | 766 | break; |
| 770 | case NL80211_IFTYPE_AP: | 767 | case NL80211_IFTYPE_AP: |
| 771 | if (!mvmvif->ap_ibss_active) | 768 | if (!mvmvif->ap_ibss_active) |
| @@ -797,7 +794,7 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, | |||
| 797 | else if (bt_activity_grading >= BT_LOW_TRAFFIC) | 794 | else if (bt_activity_grading >= BT_LOW_TRAFFIC) |
| 798 | smps_mode = IEEE80211_SMPS_DYNAMIC; | 795 | smps_mode = IEEE80211_SMPS_DYNAMIC; |
| 799 | 796 | ||
| 800 | /* relax SMPS contraints for next association */ | 797 | /* relax SMPS constraints for next association */ |
| 801 | if (!vif->bss_conf.assoc) | 798 | if (!vif->bss_conf.assoc) |
| 802 | smps_mode = IEEE80211_SMPS_AUTOMATIC; | 799 | smps_mode = IEEE80211_SMPS_AUTOMATIC; |
| 803 | 800 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index 2e90ff795c13..87e517bffedc 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | |||
| @@ -74,8 +74,7 @@ static void iwl_dbgfs_update_pm(struct iwl_mvm *mvm, | |||
| 74 | 74 | ||
| 75 | switch (param) { | 75 | switch (param) { |
| 76 | case MVM_DEBUGFS_PM_KEEP_ALIVE: { | 76 | case MVM_DEBUGFS_PM_KEEP_ALIVE: { |
| 77 | struct ieee80211_hw *hw = mvm->hw; | 77 | int dtimper = vif->bss_conf.dtim_period ?: 1; |
| 78 | int dtimper = hw->conf.ps_dtim_period ?: 1; | ||
| 79 | int dtimper_msec = dtimper * vif->bss_conf.beacon_int; | 78 | int dtimper_msec = dtimper * vif->bss_conf.beacon_int; |
| 80 | 79 | ||
| 81 | IWL_DEBUG_POWER(mvm, "debugfs: set keep_alive= %d sec\n", val); | 80 | IWL_DEBUG_POWER(mvm, "debugfs: set keep_alive= %d sec\n", val); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h index 95f5b3274efb..9a922f3bd16b 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h | |||
| @@ -1563,14 +1563,14 @@ enum iwl_sf_scenario { | |||
| 1563 | 1563 | ||
| 1564 | /** | 1564 | /** |
| 1565 | * Smart Fifo configuration command. | 1565 | * Smart Fifo configuration command. |
| 1566 | * @state: smart fifo state, types listed in iwl_sf_sate. | 1566 | * @state: smart fifo state, types listed in enum %iwl_sf_sate. |
| 1567 | * @watermark: Minimum allowed availabe free space in RXF for transient state. | 1567 | * @watermark: Minimum allowed availabe free space in RXF for transient state. |
| 1568 | * @long_delay_timeouts: aging and idle timer values for each scenario | 1568 | * @long_delay_timeouts: aging and idle timer values for each scenario |
| 1569 | * in long delay state. | 1569 | * in long delay state. |
| 1570 | * @full_on_timeouts: timer values for each scenario in full on state. | 1570 | * @full_on_timeouts: timer values for each scenario in full on state. |
| 1571 | */ | 1571 | */ |
| 1572 | struct iwl_sf_cfg_cmd { | 1572 | struct iwl_sf_cfg_cmd { |
| 1573 | enum iwl_sf_state state; | 1573 | __le32 state; |
| 1574 | __le32 watermark[SF_TRANSIENT_STATES_NUMBER]; | 1574 | __le32 watermark[SF_TRANSIENT_STATES_NUMBER]; |
| 1575 | __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; | 1575 | __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; |
| 1576 | __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; | 1576 | __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index 0e523e28cabf..8242e689ddb1 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | |||
| @@ -721,11 +721,6 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, | |||
| 721 | !force_assoc_off) { | 721 | !force_assoc_off) { |
| 722 | u32 dtim_offs; | 722 | u32 dtim_offs; |
| 723 | 723 | ||
| 724 | /* Allow beacons to pass through as long as we are not | ||
| 725 | * associated, or we do not have dtim period information. | ||
| 726 | */ | ||
| 727 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_BEACON); | ||
| 728 | |||
| 729 | /* | 724 | /* |
| 730 | * The DTIM count counts down, so when it is N that means N | 725 | * The DTIM count counts down, so when it is N that means N |
| 731 | * more beacon intervals happen until the DTIM TBTT. Therefore | 726 | * more beacon intervals happen until the DTIM TBTT. Therefore |
| @@ -759,6 +754,11 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, | |||
| 759 | ctxt_sta->is_assoc = cpu_to_le32(1); | 754 | ctxt_sta->is_assoc = cpu_to_le32(1); |
| 760 | } else { | 755 | } else { |
| 761 | ctxt_sta->is_assoc = cpu_to_le32(0); | 756 | ctxt_sta->is_assoc = cpu_to_le32(0); |
| 757 | |||
| 758 | /* Allow beacons to pass through as long as we are not | ||
| 759 | * associated, or we do not have dtim period information. | ||
| 760 | */ | ||
| 761 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_BEACON); | ||
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | ctxt_sta->bi = cpu_to_le32(vif->bss_conf.beacon_int); | 764 | ctxt_sta->bi = cpu_to_le32(vif->bss_conf.beacon_int); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 7c8796584c25..cdc272d776e7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
| @@ -396,12 +396,14 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
| 396 | else | 396 | else |
| 397 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; | 397 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; |
| 398 | 398 | ||
| 399 | /* TODO: enable that only for firmwares that don't crash */ | 399 | if (IWL_UCODE_API(mvm->fw->ucode_ver) >= 10) { |
| 400 | /* hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; */ | 400 | hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; |
| 401 | hw->wiphy->max_sched_scan_ssids = PROBE_OPTION_MAX; | 401 | hw->wiphy->max_sched_scan_ssids = PROBE_OPTION_MAX; |
| 402 | hw->wiphy->max_match_sets = IWL_SCAN_MAX_PROFILES; | 402 | hw->wiphy->max_match_sets = IWL_SCAN_MAX_PROFILES; |
| 403 | /* we create the 802.11 header and zero length SSID IE. */ | 403 | /* we create the 802.11 header and zero length SSID IE. */ |
| 404 | hw->wiphy->max_sched_scan_ie_len = SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; | 404 | hw->wiphy->max_sched_scan_ie_len = |
| 405 | SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; | ||
| 406 | } | ||
| 405 | 407 | ||
| 406 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | | 408 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | |
| 407 | NL80211_FEATURE_LOW_PRIORITY_SCAN | | 409 | NL80211_FEATURE_LOW_PRIORITY_SCAN | |
| @@ -1524,11 +1526,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, | |||
| 1524 | */ | 1526 | */ |
| 1525 | iwl_mvm_remove_time_event(mvm, mvmvif, | 1527 | iwl_mvm_remove_time_event(mvm, mvmvif, |
| 1526 | &mvmvif->time_event_data); | 1528 | &mvmvif->time_event_data); |
| 1527 | } else if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | | ||
| 1528 | BSS_CHANGED_QOS)) { | ||
| 1529 | ret = iwl_mvm_power_update_mac(mvm); | ||
| 1530 | if (ret) | ||
| 1531 | IWL_ERR(mvm, "failed to update power mode\n"); | ||
| 1532 | } | 1529 | } |
| 1533 | 1530 | ||
| 1534 | if (changes & BSS_CHANGED_BEACON_INFO) { | 1531 | if (changes & BSS_CHANGED_BEACON_INFO) { |
| @@ -1536,6 +1533,12 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, | |||
| 1536 | WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); | 1533 | WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); |
| 1537 | } | 1534 | } |
| 1538 | 1535 | ||
| 1536 | if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | BSS_CHANGED_QOS)) { | ||
| 1537 | ret = iwl_mvm_power_update_mac(mvm); | ||
| 1538 | if (ret) | ||
| 1539 | IWL_ERR(mvm, "failed to update power mode\n"); | ||
| 1540 | } | ||
| 1541 | |||
| 1539 | if (changes & BSS_CHANGED_TXPOWER) { | 1542 | if (changes & BSS_CHANGED_TXPOWER) { |
| 1540 | IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", | 1543 | IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", |
| 1541 | bss_conf->txpower); | 1544 | bss_conf->txpower); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 2b2d10800a55..d9769a23c68b 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c | |||
| @@ -281,7 +281,6 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
| 281 | struct ieee80211_vif *vif, | 281 | struct ieee80211_vif *vif, |
| 282 | struct iwl_mac_power_cmd *cmd) | 282 | struct iwl_mac_power_cmd *cmd) |
| 283 | { | 283 | { |
| 284 | struct ieee80211_hw *hw = mvm->hw; | ||
| 285 | struct ieee80211_chanctx_conf *chanctx_conf; | 284 | struct ieee80211_chanctx_conf *chanctx_conf; |
| 286 | struct ieee80211_channel *chan; | 285 | struct ieee80211_channel *chan; |
| 287 | int dtimper, dtimper_msec; | 286 | int dtimper, dtimper_msec; |
| @@ -292,7 +291,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
| 292 | 291 | ||
| 293 | cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, | 292 | cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, |
| 294 | mvmvif->color)); | 293 | mvmvif->color)); |
| 295 | dtimper = hw->conf.ps_dtim_period ?: 1; | 294 | dtimper = vif->bss_conf.dtim_period; |
| 296 | 295 | ||
| 297 | /* | 296 | /* |
| 298 | * Regardless of power management state the driver must set | 297 | * Regardless of power management state the driver must set |
| @@ -885,7 +884,7 @@ int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm, | |||
| 885 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); | 884 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); |
| 886 | if (enable) { | 885 | if (enable) { |
| 887 | /* configure skip over dtim up to 300 msec */ | 886 | /* configure skip over dtim up to 300 msec */ |
| 888 | int dtimper = mvm->hw->conf.ps_dtim_period ?: 1; | 887 | int dtimper = vif->bss_conf.dtim_period ?: 1; |
| 889 | int dtimper_msec = dtimper * vif->bss_conf.beacon_int; | 888 | int dtimper_msec = dtimper * vif->bss_conf.beacon_int; |
| 890 | 889 | ||
| 891 | if (WARN_ON(!dtimper_msec)) | 890 | if (WARN_ON(!dtimper_msec)) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c index 4b98987fc413..bf5cd8c8b0f7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/iwlwifi/mvm/rx.c | |||
| @@ -149,13 +149,13 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm, | |||
| 149 | le32_to_cpu(phy_info->non_cfg_phy[IWL_RX_INFO_ENERGY_ANT_ABC_IDX]); | 149 | le32_to_cpu(phy_info->non_cfg_phy[IWL_RX_INFO_ENERGY_ANT_ABC_IDX]); |
| 150 | energy_a = (val & IWL_RX_INFO_ENERGY_ANT_A_MSK) >> | 150 | energy_a = (val & IWL_RX_INFO_ENERGY_ANT_A_MSK) >> |
| 151 | IWL_RX_INFO_ENERGY_ANT_A_POS; | 151 | IWL_RX_INFO_ENERGY_ANT_A_POS; |
| 152 | energy_a = energy_a ? -energy_a : -256; | 152 | energy_a = energy_a ? -energy_a : S8_MIN; |
| 153 | energy_b = (val & IWL_RX_INFO_ENERGY_ANT_B_MSK) >> | 153 | energy_b = (val & IWL_RX_INFO_ENERGY_ANT_B_MSK) >> |
| 154 | IWL_RX_INFO_ENERGY_ANT_B_POS; | 154 | IWL_RX_INFO_ENERGY_ANT_B_POS; |
| 155 | energy_b = energy_b ? -energy_b : -256; | 155 | energy_b = energy_b ? -energy_b : S8_MIN; |
| 156 | energy_c = (val & IWL_RX_INFO_ENERGY_ANT_C_MSK) >> | 156 | energy_c = (val & IWL_RX_INFO_ENERGY_ANT_C_MSK) >> |
| 157 | IWL_RX_INFO_ENERGY_ANT_C_POS; | 157 | IWL_RX_INFO_ENERGY_ANT_C_POS; |
| 158 | energy_c = energy_c ? -energy_c : -256; | 158 | energy_c = energy_c ? -energy_c : S8_MIN; |
| 159 | max_energy = max(energy_a, energy_b); | 159 | max_energy = max(energy_a, energy_b); |
| 160 | max_energy = max(max_energy, energy_c); | 160 | max_energy = max(max_energy, energy_c); |
| 161 | 161 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/sf.c b/drivers/net/wireless/iwlwifi/mvm/sf.c index 7edfd15efc9d..e843b67f2201 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sf.c +++ b/drivers/net/wireless/iwlwifi/mvm/sf.c | |||
| @@ -172,7 +172,7 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, u8 sta_id, | |||
| 172 | enum iwl_sf_state new_state) | 172 | enum iwl_sf_state new_state) |
| 173 | { | 173 | { |
| 174 | struct iwl_sf_cfg_cmd sf_cmd = { | 174 | struct iwl_sf_cfg_cmd sf_cmd = { |
| 175 | .state = new_state, | 175 | .state = cpu_to_le32(new_state), |
| 176 | }; | 176 | }; |
| 177 | struct ieee80211_sta *sta; | 177 | struct ieee80211_sta *sta; |
| 178 | int ret = 0; | 178 | int ret = 0; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index dbc870713882..9ee410bf6da2 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c | |||
| @@ -168,10 +168,14 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, | |||
| 168 | 168 | ||
| 169 | /* | 169 | /* |
| 170 | * for data packets, rate info comes from the table inside the fw. This | 170 | * for data packets, rate info comes from the table inside the fw. This |
| 171 | * table is controlled by LINK_QUALITY commands | 171 | * table is controlled by LINK_QUALITY commands. Exclude ctrl port |
| 172 | * frames like EAPOLs which should be treated as mgmt frames. This | ||
| 173 | * avoids them being sent initially in high rates which increases the | ||
| 174 | * chances for completion of the 4-Way handshake. | ||
| 172 | */ | 175 | */ |
| 173 | 176 | ||
| 174 | if (ieee80211_is_data(fc) && sta) { | 177 | if (ieee80211_is_data(fc) && sta && |
| 178 | !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) { | ||
| 175 | tx_cmd->initial_rate_index = 0; | 179 | tx_cmd->initial_rate_index = 0; |
| 176 | tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); | 180 | tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); |
| 177 | return; | 181 | return; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index f0e722ced080..073a68b97a72 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
| @@ -352,11 +352,17 @@ static const struct pci_device_id iwl_hw_card_ids[] = { | |||
| 352 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, | 352 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, |
| 353 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, | 353 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, |
| 354 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, | 354 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, |
| 355 | {IWL_PCI_DEVICE(0x08B4, 0x8370, iwl3160_2ac_cfg)}, | ||
| 356 | {IWL_PCI_DEVICE(0x08B4, 0x8272, iwl3160_2ac_cfg)}, | ||
| 355 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, | 357 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, |
| 356 | {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)}, | 358 | {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)}, |
| 357 | {IWL_PCI_DEVICE(0x08B3, 0x1070, iwl3160_2ac_cfg)}, | 359 | {IWL_PCI_DEVICE(0x08B3, 0x1070, iwl3160_2ac_cfg)}, |
| 358 | {IWL_PCI_DEVICE(0x08B3, 0x1170, iwl3160_2ac_cfg)}, | 360 | {IWL_PCI_DEVICE(0x08B3, 0x1170, iwl3160_2ac_cfg)}, |
| 359 | 361 | ||
| 362 | /* 3165 Series */ | ||
| 363 | {IWL_PCI_DEVICE(0x3165, 0x4010, iwl3165_2ac_cfg)}, | ||
| 364 | {IWL_PCI_DEVICE(0x3165, 0x4210, iwl3165_2ac_cfg)}, | ||
| 365 | |||
| 360 | /* 7265 Series */ | 366 | /* 7265 Series */ |
| 361 | {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)}, | 367 | {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)}, |
| 362 | {IWL_PCI_DEVICE(0x095A, 0x5110, iwl7265_2ac_cfg)}, | 368 | {IWL_PCI_DEVICE(0x095A, 0x5110, iwl7265_2ac_cfg)}, |
| @@ -378,6 +384,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = { | |||
| 378 | {IWL_PCI_DEVICE(0x095B, 0x5202, iwl7265_n_cfg)}, | 384 | {IWL_PCI_DEVICE(0x095B, 0x5202, iwl7265_n_cfg)}, |
| 379 | {IWL_PCI_DEVICE(0x095A, 0x9010, iwl7265_2ac_cfg)}, | 385 | {IWL_PCI_DEVICE(0x095A, 0x9010, iwl7265_2ac_cfg)}, |
| 380 | {IWL_PCI_DEVICE(0x095A, 0x9012, iwl7265_2ac_cfg)}, | 386 | {IWL_PCI_DEVICE(0x095A, 0x9012, iwl7265_2ac_cfg)}, |
| 387 | {IWL_PCI_DEVICE(0x095A, 0x900A, iwl7265_2ac_cfg)}, | ||
| 381 | {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, | 388 | {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, |
| 382 | {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, | 389 | {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, |
| 383 | {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, | 390 | {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, |
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index 0f54ab6260df..3651c3871d5b 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c | |||
| @@ -278,7 +278,7 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun | |||
| 278 | { | 278 | { |
| 279 | struct hardware_path hwpath; | 279 | struct hardware_path hwpath; |
| 280 | unsigned short i; | 280 | unsigned short i; |
| 281 | char in[count+1], *temp; | 281 | char in[64], *temp; |
| 282 | struct device *dev; | 282 | struct device *dev; |
| 283 | int ret; | 283 | int ret; |
| 284 | 284 | ||
| @@ -286,8 +286,9 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun | |||
| 286 | return -EINVAL; | 286 | return -EINVAL; |
| 287 | 287 | ||
| 288 | /* We'll use a local copy of buf */ | 288 | /* We'll use a local copy of buf */ |
| 289 | memset(in, 0, count+1); | 289 | count = min_t(size_t, count, sizeof(in)-1); |
| 290 | strncpy(in, buf, count); | 290 | strncpy(in, buf, count); |
| 291 | in[count] = '\0'; | ||
| 291 | 292 | ||
| 292 | /* Let's clean up the target. 0xff is a blank pattern */ | 293 | /* Let's clean up the target. 0xff is a blank pattern */ |
| 293 | memset(&hwpath, 0xff, sizeof(hwpath)); | 294 | memset(&hwpath, 0xff, sizeof(hwpath)); |
| @@ -393,14 +394,15 @@ pdcspath_layer_write(struct pdcspath_entry *entry, const char *buf, size_t count | |||
| 393 | { | 394 | { |
| 394 | unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */ | 395 | unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */ |
| 395 | unsigned short i; | 396 | unsigned short i; |
| 396 | char in[count+1], *temp; | 397 | char in[64], *temp; |
| 397 | 398 | ||
| 398 | if (!entry || !buf || !count) | 399 | if (!entry || !buf || !count) |
| 399 | return -EINVAL; | 400 | return -EINVAL; |
| 400 | 401 | ||
| 401 | /* We'll use a local copy of buf */ | 402 | /* We'll use a local copy of buf */ |
| 402 | memset(in, 0, count+1); | 403 | count = min_t(size_t, count, sizeof(in)-1); |
| 403 | strncpy(in, buf, count); | 404 | strncpy(in, buf, count); |
| 405 | in[count] = '\0'; | ||
| 404 | 406 | ||
| 405 | /* Let's clean up the target. 0 is a blank pattern */ | 407 | /* Let's clean up the target. 0 is a blank pattern */ |
| 406 | memset(&layers, 0, sizeof(layers)); | 408 | memset(&layers, 0, sizeof(layers)); |
| @@ -755,7 +757,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj, | |||
| 755 | { | 757 | { |
| 756 | struct pdcspath_entry *pathentry; | 758 | struct pdcspath_entry *pathentry; |
| 757 | unsigned char flags; | 759 | unsigned char flags; |
| 758 | char in[count+1], *temp; | 760 | char in[8], *temp; |
| 759 | char c; | 761 | char c; |
| 760 | 762 | ||
| 761 | if (!capable(CAP_SYS_ADMIN)) | 763 | if (!capable(CAP_SYS_ADMIN)) |
| @@ -765,8 +767,9 @@ static ssize_t pdcs_auto_write(struct kobject *kobj, | |||
| 765 | return -EINVAL; | 767 | return -EINVAL; |
| 766 | 768 | ||
| 767 | /* We'll use a local copy of buf */ | 769 | /* We'll use a local copy of buf */ |
| 768 | memset(in, 0, count+1); | 770 | count = min_t(size_t, count, sizeof(in)-1); |
| 769 | strncpy(in, buf, count); | 771 | strncpy(in, buf, count); |
| 772 | in[count] = '\0'; | ||
| 770 | 773 | ||
| 771 | /* Current flags are stored in primary boot path entry */ | 774 | /* Current flags are stored in primary boot path entry */ |
| 772 | pathentry = &pdcspath_entry_primary; | 775 | pathentry = &pdcspath_entry_primary; |
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index f833aa271a2e..2a436e607f99 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig | |||
| @@ -48,6 +48,13 @@ config PHY_MIPHY365X | |||
| 48 | Enable this to support the miphy transceiver (for SATA/PCIE) | 48 | Enable this to support the miphy transceiver (for SATA/PCIE) |
| 49 | that is part of STMicroelectronics STiH41x SoC series. | 49 | that is part of STMicroelectronics STiH41x SoC series. |
| 50 | 50 | ||
| 51 | config PHY_RCAR_GEN2 | ||
| 52 | tristate "Renesas R-Car generation 2 USB PHY driver" | ||
| 53 | depends on ARCH_SHMOBILE | ||
| 54 | depends on GENERIC_PHY | ||
| 55 | help | ||
| 56 | Support for USB PHY found on Renesas R-Car generation 2 SoCs. | ||
| 57 | |||
| 51 | config OMAP_CONTROL_PHY | 58 | config OMAP_CONTROL_PHY |
| 52 | tristate "OMAP CONTROL PHY Driver" | 59 | tristate "OMAP CONTROL PHY Driver" |
| 53 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | 60 | depends on ARCH_OMAP2PLUS || COMPILE_TEST |
| @@ -232,4 +239,21 @@ config PHY_XGENE | |||
| 232 | help | 239 | help |
| 233 | This option enables support for APM X-Gene SoC multi-purpose PHY. | 240 | This option enables support for APM X-Gene SoC multi-purpose PHY. |
| 234 | 241 | ||
| 242 | config PHY_STIH407_USB | ||
| 243 | tristate "STMicroelectronics USB2 picoPHY driver for STiH407 family" | ||
| 244 | depends on RESET_CONTROLLER | ||
| 245 | depends on ARCH_STI || COMPILE_TEST | ||
| 246 | select GENERIC_PHY | ||
| 247 | help | ||
| 248 | Enable this support to enable the picoPHY device used by USB2 | ||
| 249 | and USB3 controllers on STMicroelectronics STiH407 SoC families. | ||
| 250 | |||
| 251 | config PHY_STIH41X_USB | ||
| 252 | tristate "STMicroelectronics USB2 PHY driver for STiH41x series" | ||
| 253 | depends on ARCH_STI | ||
| 254 | select GENERIC_PHY | ||
| 255 | help | ||
| 256 | Enable this to support the USB transceiver that is part of | ||
| 257 | STMicroelectronics STiH41x SoC series. | ||
| 258 | |||
| 235 | endmenu | 259 | endmenu |
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 95c69ed5ed45..c4590fce082f 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile | |||
| @@ -9,6 +9,7 @@ obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o | |||
| 9 | obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o | 9 | obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o |
| 10 | obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o | 10 | obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o |
| 11 | obj-$(CONFIG_PHY_MIPHY365X) += phy-miphy365x.o | 11 | obj-$(CONFIG_PHY_MIPHY365X) += phy-miphy365x.o |
| 12 | obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o | ||
| 12 | obj-$(CONFIG_OMAP_CONTROL_PHY) += phy-omap-control.o | 13 | obj-$(CONFIG_OMAP_CONTROL_PHY) += phy-omap-control.o |
| 13 | obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o | 14 | obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o |
| 14 | obj-$(CONFIG_TI_PIPE3) += phy-ti-pipe3.o | 15 | obj-$(CONFIG_TI_PIPE3) += phy-ti-pipe3.o |
| @@ -28,3 +29,5 @@ obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA) += phy-qcom-ipq806x-sata.o | |||
| 28 | obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o | 29 | obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o |
| 29 | obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o | 30 | obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o |
| 30 | obj-$(CONFIG_PHY_XGENE) += phy-xgene.o | 31 | obj-$(CONFIG_PHY_XGENE) += phy-xgene.o |
| 32 | obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o | ||
| 33 | obj-$(CONFIG_PHY_STIH41X_USB) += phy-stih41x-usb.o | ||
diff --git a/drivers/phy/phy-bcm-kona-usb2.c b/drivers/phy/phy-bcm-kona-usb2.c index 894fe74c1e44..c1e0ca335c0e 100644 --- a/drivers/phy/phy-bcm-kona-usb2.c +++ b/drivers/phy/phy-bcm-kona-usb2.c | |||
| @@ -143,7 +143,6 @@ static struct platform_driver bcm_kona_usb2_driver = { | |||
| 143 | .probe = bcm_kona_usb2_probe, | 143 | .probe = bcm_kona_usb2_probe, |
| 144 | .driver = { | 144 | .driver = { |
| 145 | .name = "bcm-kona-usb2", | 145 | .name = "bcm-kona-usb2", |
| 146 | .owner = THIS_MODULE, | ||
| 147 | .of_match_table = bcm_kona_usb2_dt_ids, | 146 | .of_match_table = bcm_kona_usb2_dt_ids, |
| 148 | }, | 147 | }, |
| 149 | }; | 148 | }; |
diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c index 5c3a0424aeb4..69ced52d72aa 100644 --- a/drivers/phy/phy-berlin-sata.c +++ b/drivers/phy/phy-berlin-sata.c | |||
| @@ -273,7 +273,6 @@ static struct platform_driver phy_berlin_sata_driver = { | |||
| 273 | .probe = phy_berlin_sata_probe, | 273 | .probe = phy_berlin_sata_probe, |
| 274 | .driver = { | 274 | .driver = { |
| 275 | .name = "phy-berlin-sata", | 275 | .name = "phy-berlin-sata", |
| 276 | .owner = THIS_MODULE, | ||
| 277 | .of_match_table = phy_berlin_sata_of_match, | 276 | .of_match_table = phy_berlin_sata_of_match, |
| 278 | }, | 277 | }, |
| 279 | }; | 278 | }; |
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c index 8b3026e2af7f..84f49e5a3f24 100644 --- a/drivers/phy/phy-exynos-dp-video.c +++ b/drivers/phy/phy-exynos-dp-video.c | |||
| @@ -13,44 +13,55 @@ | |||
| 13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/mfd/syscon.h> | ||
| 17 | #include <linux/mfd/syscon/exynos5-pmu.h> | ||
| 16 | #include <linux/of.h> | 18 | #include <linux/of.h> |
| 17 | #include <linux/of_address.h> | 19 | #include <linux/of_address.h> |
| 18 | #include <linux/phy/phy.h> | 20 | #include <linux/phy/phy.h> |
| 19 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/regmap.h> | ||
| 20 | 23 | ||
| 21 | /* DPTX_PHY_CONTROL register */ | 24 | struct exynos_dp_video_phy_drvdata { |
| 22 | #define EXYNOS_DPTX_PHY_ENABLE (1 << 0) | 25 | u32 phy_ctrl_offset; |
| 26 | }; | ||
| 23 | 27 | ||
| 24 | struct exynos_dp_video_phy { | 28 | struct exynos_dp_video_phy { |
| 25 | void __iomem *regs; | 29 | struct regmap *regs; |
| 30 | const struct exynos_dp_video_phy_drvdata *drvdata; | ||
| 26 | }; | 31 | }; |
| 27 | 32 | ||
| 28 | static int __set_phy_state(struct exynos_dp_video_phy *state, unsigned int on) | 33 | static void exynos_dp_video_phy_pwr_isol(struct exynos_dp_video_phy *state, |
| 34 | unsigned int on) | ||
| 29 | { | 35 | { |
| 30 | u32 reg; | 36 | unsigned int val; |
| 37 | |||
| 38 | if (IS_ERR(state->regs)) | ||
| 39 | return; | ||
| 31 | 40 | ||
| 32 | reg = readl(state->regs); | 41 | val = on ? 0 : EXYNOS5_PHY_ENABLE; |
| 33 | if (on) | ||
| 34 | reg |= EXYNOS_DPTX_PHY_ENABLE; | ||
| 35 | else | ||
| 36 | reg &= ~EXYNOS_DPTX_PHY_ENABLE; | ||
| 37 | writel(reg, state->regs); | ||
| 38 | 42 | ||
| 39 | return 0; | 43 | regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, |
| 44 | EXYNOS5_PHY_ENABLE, val); | ||
| 40 | } | 45 | } |
| 41 | 46 | ||
| 42 | static int exynos_dp_video_phy_power_on(struct phy *phy) | 47 | static int exynos_dp_video_phy_power_on(struct phy *phy) |
| 43 | { | 48 | { |
| 44 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); | 49 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); |
| 45 | 50 | ||
| 46 | return __set_phy_state(state, 1); | 51 | /* Disable power isolation on DP-PHY */ |
| 52 | exynos_dp_video_phy_pwr_isol(state, 0); | ||
| 53 | |||
| 54 | return 0; | ||
| 47 | } | 55 | } |
| 48 | 56 | ||
| 49 | static int exynos_dp_video_phy_power_off(struct phy *phy) | 57 | static int exynos_dp_video_phy_power_off(struct phy *phy) |
| 50 | { | 58 | { |
| 51 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); | 59 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); |
| 52 | 60 | ||
| 53 | return __set_phy_state(state, 0); | 61 | /* Enable power isolation on DP-PHY */ |
| 62 | exynos_dp_video_phy_pwr_isol(state, 1); | ||
| 63 | |||
| 64 | return 0; | ||
| 54 | } | 65 | } |
| 55 | 66 | ||
| 56 | static struct phy_ops exynos_dp_video_phy_ops = { | 67 | static struct phy_ops exynos_dp_video_phy_ops = { |
| @@ -59,11 +70,31 @@ static struct phy_ops exynos_dp_video_phy_ops = { | |||
| 59 | .owner = THIS_MODULE, | 70 | .owner = THIS_MODULE, |
| 60 | }; | 71 | }; |
| 61 | 72 | ||
| 73 | static const struct exynos_dp_video_phy_drvdata exynos5250_dp_video_phy = { | ||
| 74 | .phy_ctrl_offset = EXYNOS5_DPTX_PHY_CONTROL, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static const struct exynos_dp_video_phy_drvdata exynos5420_dp_video_phy = { | ||
| 78 | .phy_ctrl_offset = EXYNOS5420_DPTX_PHY_CONTROL, | ||
| 79 | }; | ||
| 80 | |||
| 81 | static const struct of_device_id exynos_dp_video_phy_of_match[] = { | ||
| 82 | { | ||
| 83 | .compatible = "samsung,exynos5250-dp-video-phy", | ||
| 84 | .data = &exynos5250_dp_video_phy, | ||
| 85 | }, { | ||
| 86 | .compatible = "samsung,exynos5420-dp-video-phy", | ||
| 87 | .data = &exynos5420_dp_video_phy, | ||
| 88 | }, | ||
| 89 | { }, | ||
| 90 | }; | ||
| 91 | MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match); | ||
| 92 | |||
| 62 | static int exynos_dp_video_phy_probe(struct platform_device *pdev) | 93 | static int exynos_dp_video_phy_probe(struct platform_device *pdev) |
| 63 | { | 94 | { |
| 64 | struct exynos_dp_video_phy *state; | 95 | struct exynos_dp_video_phy *state; |
| 65 | struct device *dev = &pdev->dev; | 96 | struct device *dev = &pdev->dev; |
| 66 | struct resource *res; | 97 | const struct of_device_id *match; |
| 67 | struct phy_provider *phy_provider; | 98 | struct phy_provider *phy_provider; |
| 68 | struct phy *phy; | 99 | struct phy *phy; |
| 69 | 100 | ||
| @@ -71,11 +102,15 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) | |||
| 71 | if (!state) | 102 | if (!state) |
| 72 | return -ENOMEM; | 103 | return -ENOMEM; |
| 73 | 104 | ||
| 74 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 105 | state->regs = syscon_regmap_lookup_by_phandle(dev->of_node, |
| 75 | 106 | "samsung,pmu-syscon"); | |
| 76 | state->regs = devm_ioremap_resource(dev, res); | 107 | if (IS_ERR(state->regs)) { |
| 77 | if (IS_ERR(state->regs)) | 108 | dev_err(dev, "Failed to lookup PMU regmap\n"); |
| 78 | return PTR_ERR(state->regs); | 109 | return PTR_ERR(state->regs); |
| 110 | } | ||
| 111 | |||
| 112 | match = of_match_node(exynos_dp_video_phy_of_match, dev->of_node); | ||
| 113 | state->drvdata = match->data; | ||
| 79 | 114 | ||
| 80 | phy = devm_phy_create(dev, NULL, &exynos_dp_video_phy_ops, NULL); | 115 | phy = devm_phy_create(dev, NULL, &exynos_dp_video_phy_ops, NULL); |
| 81 | if (IS_ERR(phy)) { | 116 | if (IS_ERR(phy)) { |
| @@ -89,17 +124,10 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) | |||
| 89 | return PTR_ERR_OR_ZERO(phy_provider); | 124 | return PTR_ERR_OR_ZERO(phy_provider); |
| 90 | } | 125 | } |
| 91 | 126 | ||
| 92 | static const struct of_device_id exynos_dp_video_phy_of_match[] = { | ||
| 93 | { .compatible = "samsung,exynos5250-dp-video-phy" }, | ||
| 94 | { }, | ||
| 95 | }; | ||
| 96 | MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match); | ||
| 97 | |||
| 98 | static struct platform_driver exynos_dp_video_phy_driver = { | 127 | static struct platform_driver exynos_dp_video_phy_driver = { |
| 99 | .probe = exynos_dp_video_phy_probe, | 128 | .probe = exynos_dp_video_phy_probe, |
| 100 | .driver = { | 129 | .driver = { |
| 101 | .name = "exynos-dp-video-phy", | 130 | .name = "exynos-dp-video-phy", |
| 102 | .owner = THIS_MODULE, | ||
| 103 | .of_match_table = exynos_dp_video_phy_of_match, | 131 | .of_match_table = exynos_dp_video_phy_of_match, |
| 104 | } | 132 | } |
| 105 | }; | 133 | }; |
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index b55a92e12496..6a9bef138617 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c | |||
| @@ -165,7 +165,6 @@ static struct platform_driver exynos_mipi_video_phy_driver = { | |||
| 165 | .driver = { | 165 | .driver = { |
| 166 | .of_match_table = exynos_mipi_video_phy_of_match, | 166 | .of_match_table = exynos_mipi_video_phy_of_match, |
| 167 | .name = "exynos-mipi-video-phy", | 167 | .name = "exynos-mipi-video-phy", |
| 168 | .owner = THIS_MODULE, | ||
| 169 | } | 168 | } |
| 170 | }; | 169 | }; |
| 171 | module_platform_driver(exynos_mipi_video_phy_driver); | 170 | module_platform_driver(exynos_mipi_video_phy_driver); |
diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c index 392101c8d6b0..f756aca871db 100644 --- a/drivers/phy/phy-exynos5-usbdrd.c +++ b/drivers/phy/phy-exynos5-usbdrd.c | |||
| @@ -667,7 +667,6 @@ static struct platform_driver exynos5_usb3drd_phy = { | |||
| 667 | .driver = { | 667 | .driver = { |
| 668 | .of_match_table = exynos5_usbdrd_phy_of_match, | 668 | .of_match_table = exynos5_usbdrd_phy_of_match, |
| 669 | .name = "exynos5_usb3drd_phy", | 669 | .name = "exynos5_usb3drd_phy", |
| 670 | .owner = THIS_MODULE, | ||
| 671 | } | 670 | } |
| 672 | }; | 671 | }; |
| 673 | 672 | ||
diff --git a/drivers/phy/phy-exynos5250-sata.c b/drivers/phy/phy-exynos5250-sata.c index 19a679aca4ac..54cf4ae60d29 100644 --- a/drivers/phy/phy-exynos5250-sata.c +++ b/drivers/phy/phy-exynos5250-sata.c | |||
| @@ -240,7 +240,6 @@ static struct platform_driver exynos_sata_phy_driver = { | |||
| 240 | .driver = { | 240 | .driver = { |
| 241 | .of_match_table = exynos_sata_phy_of_match, | 241 | .of_match_table = exynos_sata_phy_of_match, |
| 242 | .name = "samsung,sata-phy", | 242 | .name = "samsung,sata-phy", |
| 243 | .owner = THIS_MODULE, | ||
| 244 | } | 243 | } |
| 245 | }; | 244 | }; |
| 246 | module_platform_driver(exynos_sata_phy_driver); | 245 | module_platform_driver(exynos_sata_phy_driver); |
diff --git a/drivers/phy/phy-hix5hd2-sata.c b/drivers/phy/phy-hix5hd2-sata.c index 6a08fa5f81eb..d5d978085c6d 100644 --- a/drivers/phy/phy-hix5hd2-sata.c +++ b/drivers/phy/phy-hix5hd2-sata.c | |||
| @@ -180,7 +180,6 @@ static struct platform_driver hix5hd2_sata_phy_driver = { | |||
| 180 | .probe = hix5hd2_sata_phy_probe, | 180 | .probe = hix5hd2_sata_phy_probe, |
| 181 | .driver = { | 181 | .driver = { |
| 182 | .name = "hix5hd2-sata-phy", | 182 | .name = "hix5hd2-sata-phy", |
| 183 | .owner = THIS_MODULE, | ||
| 184 | .of_match_table = hix5hd2_sata_phy_of_match, | 183 | .of_match_table = hix5hd2_sata_phy_of_match, |
| 185 | } | 184 | } |
| 186 | }; | 185 | }; |
diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c index e0fb7a1e5a5a..801afaf2d449 100644 --- a/drivers/phy/phy-miphy365x.c +++ b/drivers/phy/phy-miphy365x.c | |||
| @@ -626,7 +626,6 @@ static struct platform_driver miphy365x_driver = { | |||
| 626 | .probe = miphy365x_probe, | 626 | .probe = miphy365x_probe, |
| 627 | .driver = { | 627 | .driver = { |
| 628 | .name = "miphy365x-phy", | 628 | .name = "miphy365x-phy", |
| 629 | .owner = THIS_MODULE, | ||
| 630 | .of_match_table = miphy365x_of_match, | 629 | .of_match_table = miphy365x_of_match, |
| 631 | } | 630 | } |
| 632 | }; | 631 | }; |
diff --git a/drivers/phy/phy-mvebu-sata.c b/drivers/phy/phy-mvebu-sata.c index cc3c0e166daf..d395558cb12e 100644 --- a/drivers/phy/phy-mvebu-sata.c +++ b/drivers/phy/phy-mvebu-sata.c | |||
| @@ -89,6 +89,8 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev) | |||
| 89 | struct phy *phy; | 89 | struct phy *phy; |
| 90 | 90 | ||
| 91 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); | 91 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); |
| 92 | if (!priv) | ||
| 93 | return -ENOMEM; | ||
| 92 | 94 | ||
| 93 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 95 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 94 | priv->base = devm_ioremap_resource(&pdev->dev, res); | 96 | priv->base = devm_ioremap_resource(&pdev->dev, res); |
| @@ -126,7 +128,6 @@ static struct platform_driver phy_mvebu_sata_driver = { | |||
| 126 | .probe = phy_mvebu_sata_probe, | 128 | .probe = phy_mvebu_sata_probe, |
| 127 | .driver = { | 129 | .driver = { |
| 128 | .name = "phy-mvebu-sata", | 130 | .name = "phy-mvebu-sata", |
| 129 | .owner = THIS_MODULE, | ||
| 130 | .of_match_table = phy_mvebu_sata_of_match, | 131 | .of_match_table = phy_mvebu_sata_of_match, |
| 131 | } | 132 | } |
| 132 | }; | 133 | }; |
diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c index 9487bf112267..c96e8183a8ff 100644 --- a/drivers/phy/phy-omap-control.c +++ b/drivers/phy/phy-omap-control.c | |||
| @@ -295,10 +295,8 @@ static int omap_control_phy_probe(struct platform_device *pdev) | |||
| 295 | 295 | ||
| 296 | control_phy = devm_kzalloc(&pdev->dev, sizeof(*control_phy), | 296 | control_phy = devm_kzalloc(&pdev->dev, sizeof(*control_phy), |
| 297 | GFP_KERNEL); | 297 | GFP_KERNEL); |
| 298 | if (!control_phy) { | 298 | if (!control_phy) |
| 299 | dev_err(&pdev->dev, "unable to alloc memory for control phy\n"); | ||
| 300 | return -ENOMEM; | 299 | return -ENOMEM; |
| 301 | } | ||
| 302 | 300 | ||
| 303 | control_phy->dev = &pdev->dev; | 301 | control_phy->dev = &pdev->dev; |
| 304 | control_phy->type = *(enum omap_control_phy_type *)of_id->data; | 302 | control_phy->type = *(enum omap_control_phy_type *)of_id->data; |
| @@ -347,7 +345,6 @@ static struct platform_driver omap_control_phy_driver = { | |||
| 347 | .probe = omap_control_phy_probe, | 345 | .probe = omap_control_phy_probe, |
| 348 | .driver = { | 346 | .driver = { |
| 349 | .name = "omap-control-phy", | 347 | .name = "omap-control-phy", |
| 350 | .owner = THIS_MODULE, | ||
| 351 | .of_match_table = of_match_ptr(omap_control_phy_id_table), | 348 | .of_match_table = of_match_ptr(omap_control_phy_id_table), |
| 352 | }, | 349 | }, |
| 353 | }; | 350 | }; |
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 93d78359246c..8c842980834a 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
| @@ -212,16 +212,12 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 212 | phy_data = (struct usb_phy_data *)of_id->data; | 212 | phy_data = (struct usb_phy_data *)of_id->data; |
| 213 | 213 | ||
| 214 | phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); | 214 | phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); |
| 215 | if (!phy) { | 215 | if (!phy) |
| 216 | dev_err(&pdev->dev, "unable to allocate memory for USB2 PHY\n"); | ||
| 217 | return -ENOMEM; | 216 | return -ENOMEM; |
| 218 | } | ||
| 219 | 217 | ||
| 220 | otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); | 218 | otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); |
| 221 | if (!otg) { | 219 | if (!otg) |
| 222 | dev_err(&pdev->dev, "unable to allocate memory for USB OTG\n"); | ||
| 223 | return -ENOMEM; | 220 | return -ENOMEM; |
| 224 | } | ||
| 225 | 221 | ||
| 226 | phy->dev = &pdev->dev; | 222 | phy->dev = &pdev->dev; |
| 227 | 223 | ||
| @@ -382,7 +378,6 @@ static struct platform_driver omap_usb2_driver = { | |||
| 382 | .remove = omap_usb2_remove, | 378 | .remove = omap_usb2_remove, |
| 383 | .driver = { | 379 | .driver = { |
| 384 | .name = "omap-usb2", | 380 | .name = "omap-usb2", |
| 385 | .owner = THIS_MODULE, | ||
| 386 | .pm = DEV_PM_OPS, | 381 | .pm = DEV_PM_OPS, |
| 387 | .of_match_table = of_match_ptr(omap_usb2_id_table), | 382 | .of_match_table = of_match_ptr(omap_usb2_id_table), |
| 388 | }, | 383 | }, |
diff --git a/drivers/phy/phy-qcom-apq8064-sata.c b/drivers/phy/phy-qcom-apq8064-sata.c index b3ef7d805765..7b3ddfb65898 100644 --- a/drivers/phy/phy-qcom-apq8064-sata.c +++ b/drivers/phy/phy-qcom-apq8064-sata.c | |||
| @@ -279,7 +279,6 @@ static struct platform_driver qcom_apq8064_sata_phy_driver = { | |||
| 279 | .remove = qcom_apq8064_sata_phy_remove, | 279 | .remove = qcom_apq8064_sata_phy_remove, |
| 280 | .driver = { | 280 | .driver = { |
| 281 | .name = "qcom-apq8064-sata-phy", | 281 | .name = "qcom-apq8064-sata-phy", |
| 282 | .owner = THIS_MODULE, | ||
| 283 | .of_match_table = qcom_apq8064_sata_phy_of_match, | 282 | .of_match_table = qcom_apq8064_sata_phy_of_match, |
| 284 | } | 283 | } |
| 285 | }; | 284 | }; |
diff --git a/drivers/phy/phy-qcom-ipq806x-sata.c b/drivers/phy/phy-qcom-ipq806x-sata.c index 909b5a87fc6a..759b0bf5b6b3 100644 --- a/drivers/phy/phy-qcom-ipq806x-sata.c +++ b/drivers/phy/phy-qcom-ipq806x-sata.c | |||
| @@ -201,7 +201,6 @@ static struct platform_driver qcom_ipq806x_sata_phy_driver = { | |||
| 201 | .remove = qcom_ipq806x_sata_phy_remove, | 201 | .remove = qcom_ipq806x_sata_phy_remove, |
| 202 | .driver = { | 202 | .driver = { |
| 203 | .name = "qcom-ipq806x-sata-phy", | 203 | .name = "qcom-ipq806x-sata-phy", |
| 204 | .owner = THIS_MODULE, | ||
| 205 | .of_match_table = qcom_ipq806x_sata_phy_of_match, | 204 | .of_match_table = qcom_ipq806x_sata_phy_of_match, |
| 206 | } | 205 | } |
| 207 | }; | 206 | }; |
diff --git a/drivers/phy/phy-rcar-gen2.c b/drivers/phy/phy-rcar-gen2.c new file mode 100644 index 000000000000..2793af17799f --- /dev/null +++ b/drivers/phy/phy-rcar-gen2.c | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | /* | ||
| 2 | * Renesas R-Car Gen2 PHY driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Renesas Solutions Corp. | ||
| 5 | * Copyright (C) 2014 Cogent Embedded, 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/clk.h> | ||
| 13 | #include <linux/delay.h> | ||
| 14 | #include <linux/io.h> | ||
| 15 | #include <linux/module.h> | ||
| 16 | #include <linux/of.h> | ||
| 17 | #include <linux/phy/phy.h> | ||
| 18 | #include <linux/platform_device.h> | ||
| 19 | #include <linux/spinlock.h> | ||
| 20 | |||
| 21 | #include <asm/cmpxchg.h> | ||
| 22 | |||
| 23 | #define USBHS_LPSTS 0x02 | ||
| 24 | #define USBHS_UGCTRL 0x80 | ||
| 25 | #define USBHS_UGCTRL2 0x84 | ||
| 26 | #define USBHS_UGSTS 0x88 /* The manuals have 0x90 */ | ||
| 27 | |||
| 28 | /* Low Power Status register (LPSTS) */ | ||
| 29 | #define USBHS_LPSTS_SUSPM 0x4000 | ||
| 30 | |||
| 31 | /* USB General control register (UGCTRL) */ | ||
| 32 | #define USBHS_UGCTRL_CONNECT 0x00000004 | ||
| 33 | #define USBHS_UGCTRL_PLLRESET 0x00000001 | ||
| 34 | |||
| 35 | /* USB General control register 2 (UGCTRL2) */ | ||
| 36 | #define USBHS_UGCTRL2_USB2SEL 0x80000000 | ||
| 37 | #define USBHS_UGCTRL2_USB2SEL_PCI 0x00000000 | ||
| 38 | #define USBHS_UGCTRL2_USB2SEL_USB30 0x80000000 | ||
| 39 | #define USBHS_UGCTRL2_USB0SEL 0x00000030 | ||
| 40 | #define USBHS_UGCTRL2_USB0SEL_PCI 0x00000010 | ||
| 41 | #define USBHS_UGCTRL2_USB0SEL_HS_USB 0x00000030 | ||
| 42 | |||
| 43 | /* USB General status register (UGSTS) */ | ||
| 44 | #define USBHS_UGSTS_LOCK 0x00000300 /* The manuals have 0x3 */ | ||
| 45 | |||
| 46 | #define PHYS_PER_CHANNEL 2 | ||
| 47 | |||
| 48 | struct rcar_gen2_phy { | ||
| 49 | struct phy *phy; | ||
| 50 | struct rcar_gen2_channel *channel; | ||
| 51 | int number; | ||
| 52 | u32 select_value; | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct rcar_gen2_channel { | ||
| 56 | struct device_node *of_node; | ||
| 57 | struct rcar_gen2_phy_driver *drv; | ||
| 58 | struct rcar_gen2_phy phys[PHYS_PER_CHANNEL]; | ||
| 59 | int selected_phy; | ||
| 60 | u32 select_mask; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct rcar_gen2_phy_driver { | ||
| 64 | void __iomem *base; | ||
| 65 | struct clk *clk; | ||
| 66 | spinlock_t lock; | ||
| 67 | int num_channels; | ||
| 68 | struct rcar_gen2_channel *channels; | ||
| 69 | }; | ||
| 70 | |||
| 71 | static int rcar_gen2_phy_init(struct phy *p) | ||
| 72 | { | ||
| 73 | struct rcar_gen2_phy *phy = phy_get_drvdata(p); | ||
| 74 | struct rcar_gen2_channel *channel = phy->channel; | ||
| 75 | struct rcar_gen2_phy_driver *drv = channel->drv; | ||
| 76 | unsigned long flags; | ||
| 77 | u32 ugctrl2; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * Try to acquire exclusive access to PHY. The first driver calling | ||
| 81 | * phy_init() on a given channel wins, and all attempts to use another | ||
| 82 | * PHY on this channel will fail until phy_exit() is called by the first | ||
| 83 | * driver. Achieving this with cmpxcgh() should be SMP-safe. | ||
| 84 | */ | ||
| 85 | if (cmpxchg(&channel->selected_phy, -1, phy->number) != -1) | ||
| 86 | return -EBUSY; | ||
| 87 | |||
| 88 | clk_prepare_enable(drv->clk); | ||
| 89 | |||
| 90 | spin_lock_irqsave(&drv->lock, flags); | ||
| 91 | ugctrl2 = readl(drv->base + USBHS_UGCTRL2); | ||
| 92 | ugctrl2 &= ~channel->select_mask; | ||
| 93 | ugctrl2 |= phy->select_value; | ||
| 94 | writel(ugctrl2, drv->base + USBHS_UGCTRL2); | ||
| 95 | spin_unlock_irqrestore(&drv->lock, flags); | ||
| 96 | return 0; | ||
| 97 | } | ||
| 98 | |||
| 99 | static int rcar_gen2_phy_exit(struct phy *p) | ||
| 100 | { | ||
| 101 | struct rcar_gen2_phy *phy = phy_get_drvdata(p); | ||
| 102 | struct rcar_gen2_channel *channel = phy->channel; | ||
| 103 | |||
| 104 | clk_disable_unprepare(channel->drv->clk); | ||
| 105 | |||
| 106 | channel->selected_phy = -1; | ||
| 107 | |||
| 108 | return 0; | ||
| 109 | } | ||
| 110 | |||
| 111 | static int rcar_gen2_phy_power_on(struct phy *p) | ||
| 112 | { | ||
| 113 | struct rcar_gen2_phy *phy = phy_get_drvdata(p); | ||
| 114 | struct rcar_gen2_phy_driver *drv = phy->channel->drv; | ||
| 115 | void __iomem *base = drv->base; | ||
| 116 | unsigned long flags; | ||
| 117 | u32 value; | ||
| 118 | int err = 0, i; | ||
| 119 | |||
| 120 | /* Skip if it's not USBHS */ | ||
| 121 | if (phy->select_value != USBHS_UGCTRL2_USB0SEL_HS_USB) | ||
| 122 | return 0; | ||
| 123 | |||
| 124 | spin_lock_irqsave(&drv->lock, flags); | ||
| 125 | |||
| 126 | /* Power on USBHS PHY */ | ||
| 127 | value = readl(base + USBHS_UGCTRL); | ||
| 128 | value &= ~USBHS_UGCTRL_PLLRESET; | ||
| 129 | writel(value, base + USBHS_UGCTRL); | ||
| 130 | |||
| 131 | value = readw(base + USBHS_LPSTS); | ||
| 132 | value |= USBHS_LPSTS_SUSPM; | ||
| 133 | writew(value, base + USBHS_LPSTS); | ||
| 134 | |||
| 135 | for (i = 0; i < 20; i++) { | ||
| 136 | value = readl(base + USBHS_UGSTS); | ||
| 137 | if ((value & USBHS_UGSTS_LOCK) == USBHS_UGSTS_LOCK) { | ||
| 138 | value = readl(base + USBHS_UGCTRL); | ||
| 139 | value |= USBHS_UGCTRL_CONNECT; | ||
| 140 | writel(value, base + USBHS_UGCTRL); | ||
| 141 | goto out; | ||
| 142 | } | ||
| 143 | udelay(1); | ||
| 144 | } | ||
| 145 | |||
| 146 | /* Timed out waiting for the PLL lock */ | ||
| 147 | err = -ETIMEDOUT; | ||
| 148 | |||
| 149 | out: | ||
| 150 | spin_unlock_irqrestore(&drv->lock, flags); | ||
| 151 | |||
| 152 | return err; | ||
| 153 | } | ||
| 154 | |||
| 155 | static int rcar_gen2_phy_power_off(struct phy *p) | ||
| 156 | { | ||
| 157 | struct rcar_gen2_phy *phy = phy_get_drvdata(p); | ||
| 158 | struct rcar_gen2_phy_driver *drv = phy->channel->drv; | ||
| 159 | void __iomem *base = drv->base; | ||
| 160 | unsigned long flags; | ||
| 161 | u32 value; | ||
| 162 | |||
| 163 | /* Skip if it's not USBHS */ | ||
| 164 | if (phy->select_value != USBHS_UGCTRL2_USB0SEL_HS_USB) | ||
| 165 | return 0; | ||
| 166 | |||
| 167 | spin_lock_irqsave(&drv->lock, flags); | ||
| 168 | |||
| 169 | /* Power off USBHS PHY */ | ||
| 170 | value = readl(base + USBHS_UGCTRL); | ||
| 171 | value &= ~USBHS_UGCTRL_CONNECT; | ||
| 172 | writel(value, base + USBHS_UGCTRL); | ||
| 173 | |||
| 174 | value = readw(base + USBHS_LPSTS); | ||
| 175 | value &= ~USBHS_LPSTS_SUSPM; | ||
| 176 | writew(value, base + USBHS_LPSTS); | ||
| 177 | |||
| 178 | value = readl(base + USBHS_UGCTRL); | ||
| 179 | value |= USBHS_UGCTRL_PLLRESET; | ||
| 180 | writel(value, base + USBHS_UGCTRL); | ||
| 181 | |||
| 182 | spin_unlock_irqrestore(&drv->lock, flags); | ||
| 183 | |||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | |||
| 187 | static struct phy_ops rcar_gen2_phy_ops = { | ||
| 188 | .init = rcar_gen2_phy_init, | ||
| 189 | .exit = rcar_gen2_phy_exit, | ||
| 190 | .power_on = rcar_gen2_phy_power_on, | ||
| 191 | .power_off = rcar_gen2_phy_power_off, | ||
| 192 | .owner = THIS_MODULE, | ||
| 193 | }; | ||
| 194 | |||
| 195 | static const struct of_device_id rcar_gen2_phy_match_table[] = { | ||
| 196 | { .compatible = "renesas,usb-phy-r8a7790" }, | ||
| 197 | { .compatible = "renesas,usb-phy-r8a7791" }, | ||
| 198 | { } | ||
| 199 | }; | ||
| 200 | MODULE_DEVICE_TABLE(of, rcar_gen2_phy_match_table); | ||
| 201 | |||
| 202 | static struct phy *rcar_gen2_phy_xlate(struct device *dev, | ||
| 203 | struct of_phandle_args *args) | ||
| 204 | { | ||
| 205 | struct rcar_gen2_phy_driver *drv; | ||
| 206 | struct device_node *np = args->np; | ||
| 207 | int i; | ||
| 208 | |||
| 209 | if (!of_device_is_available(np)) { | ||
| 210 | dev_warn(dev, "Requested PHY is disabled\n"); | ||
| 211 | return ERR_PTR(-ENODEV); | ||
| 212 | } | ||
| 213 | |||
| 214 | drv = dev_get_drvdata(dev); | ||
| 215 | if (!drv) | ||
| 216 | return ERR_PTR(-EINVAL); | ||
| 217 | |||
| 218 | for (i = 0; i < drv->num_channels; i++) { | ||
| 219 | if (np == drv->channels[i].of_node) | ||
| 220 | break; | ||
| 221 | } | ||
| 222 | |||
| 223 | if (i >= drv->num_channels || args->args[0] >= 2) | ||
| 224 | return ERR_PTR(-ENODEV); | ||
| 225 | |||
| 226 | return drv->channels[i].phys[args->args[0]].phy; | ||
| 227 | } | ||
| 228 | |||
| 229 | static const u32 select_mask[] = { | ||
| 230 | [0] = USBHS_UGCTRL2_USB0SEL, | ||
| 231 | [2] = USBHS_UGCTRL2_USB2SEL, | ||
| 232 | }; | ||
| 233 | |||
| 234 | static const u32 select_value[][PHYS_PER_CHANNEL] = { | ||
| 235 | [0] = { USBHS_UGCTRL2_USB0SEL_PCI, USBHS_UGCTRL2_USB0SEL_HS_USB }, | ||
| 236 | [2] = { USBHS_UGCTRL2_USB2SEL_PCI, USBHS_UGCTRL2_USB2SEL_USB30 }, | ||
| 237 | }; | ||
| 238 | |||
| 239 | static int rcar_gen2_phy_probe(struct platform_device *pdev) | ||
| 240 | { | ||
| 241 | struct device *dev = &pdev->dev; | ||
| 242 | struct rcar_gen2_phy_driver *drv; | ||
| 243 | struct phy_provider *provider; | ||
| 244 | struct device_node *np; | ||
| 245 | struct resource *res; | ||
| 246 | void __iomem *base; | ||
| 247 | struct clk *clk; | ||
| 248 | int i = 0; | ||
| 249 | |||
| 250 | if (!dev->of_node) { | ||
| 251 | dev_err(dev, | ||
| 252 | "This driver is required to be instantiated from device tree\n"); | ||
| 253 | return -EINVAL; | ||
| 254 | } | ||
| 255 | |||
| 256 | clk = devm_clk_get(dev, "usbhs"); | ||
| 257 | if (IS_ERR(clk)) { | ||
| 258 | dev_err(dev, "Can't get USBHS clock\n"); | ||
| 259 | return PTR_ERR(clk); | ||
| 260 | } | ||
| 261 | |||
| 262 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 263 | base = devm_ioremap_resource(dev, res); | ||
| 264 | if (IS_ERR(base)) | ||
| 265 | return PTR_ERR(base); | ||
| 266 | |||
| 267 | drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL); | ||
| 268 | if (!drv) | ||
| 269 | return -ENOMEM; | ||
| 270 | |||
| 271 | spin_lock_init(&drv->lock); | ||
| 272 | |||
| 273 | drv->clk = clk; | ||
| 274 | drv->base = base; | ||
| 275 | |||
| 276 | drv->num_channels = of_get_child_count(dev->of_node); | ||
| 277 | drv->channels = devm_kcalloc(dev, drv->num_channels, | ||
| 278 | sizeof(struct rcar_gen2_channel), | ||
| 279 | GFP_KERNEL); | ||
| 280 | if (!drv->channels) | ||
| 281 | return -ENOMEM; | ||
| 282 | |||
| 283 | for_each_child_of_node(dev->of_node, np) { | ||
| 284 | struct rcar_gen2_channel *channel = drv->channels + i; | ||
| 285 | u32 channel_num; | ||
| 286 | int error, n; | ||
| 287 | |||
| 288 | channel->of_node = np; | ||
| 289 | channel->drv = drv; | ||
| 290 | channel->selected_phy = -1; | ||
| 291 | |||
| 292 | error = of_property_read_u32(np, "reg", &channel_num); | ||
| 293 | if (error || channel_num > 2) { | ||
| 294 | dev_err(dev, "Invalid \"reg\" property\n"); | ||
| 295 | return error; | ||
| 296 | } | ||
| 297 | channel->select_mask = select_mask[channel_num]; | ||
| 298 | |||
| 299 | for (n = 0; n < PHYS_PER_CHANNEL; n++) { | ||
| 300 | struct rcar_gen2_phy *phy = &channel->phys[n]; | ||
| 301 | |||
| 302 | phy->channel = channel; | ||
| 303 | phy->number = n; | ||
| 304 | phy->select_value = select_value[channel_num][n]; | ||
| 305 | |||
| 306 | phy->phy = devm_phy_create(dev, NULL, | ||
| 307 | &rcar_gen2_phy_ops, NULL); | ||
| 308 | if (IS_ERR(phy->phy)) { | ||
| 309 | dev_err(dev, "Failed to create PHY\n"); | ||
| 310 | return PTR_ERR(phy->phy); | ||
| 311 | } | ||
| 312 | phy_set_drvdata(phy->phy, phy); | ||
| 313 | } | ||
| 314 | |||
| 315 | i++; | ||
| 316 | } | ||
| 317 | |||
| 318 | provider = devm_of_phy_provider_register(dev, rcar_gen2_phy_xlate); | ||
| 319 | if (IS_ERR(provider)) { | ||
| 320 | dev_err(dev, "Failed to register PHY provider\n"); | ||
| 321 | return PTR_ERR(provider); | ||
| 322 | } | ||
| 323 | |||
| 324 | dev_set_drvdata(dev, drv); | ||
| 325 | |||
| 326 | return 0; | ||
| 327 | } | ||
| 328 | |||
| 329 | static struct platform_driver rcar_gen2_phy_driver = { | ||
| 330 | .driver = { | ||
| 331 | .name = "phy_rcar_gen2", | ||
| 332 | .of_match_table = rcar_gen2_phy_match_table, | ||
| 333 | }, | ||
| 334 | .probe = rcar_gen2_phy_probe, | ||
| 335 | }; | ||
| 336 | |||
| 337 | module_platform_driver(rcar_gen2_phy_driver); | ||
| 338 | |||
| 339 | MODULE_LICENSE("GPL v2"); | ||
| 340 | MODULE_DESCRIPTION("Renesas R-Car Gen2 PHY"); | ||
| 341 | MODULE_AUTHOR("Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>"); | ||
diff --git a/drivers/phy/phy-samsung-usb2.c b/drivers/phy/phy-samsung-usb2.c index 3732ca25e09f..908949dfb4db 100644 --- a/drivers/phy/phy-samsung-usb2.c +++ b/drivers/phy/phy-samsung-usb2.c | |||
| @@ -231,7 +231,6 @@ static struct platform_driver samsung_usb2_phy_driver = { | |||
| 231 | .driver = { | 231 | .driver = { |
| 232 | .of_match_table = samsung_usb2_phy_of_match, | 232 | .of_match_table = samsung_usb2_phy_of_match, |
| 233 | .name = "samsung-usb2-phy", | 233 | .name = "samsung-usb2-phy", |
| 234 | .owner = THIS_MODULE, | ||
| 235 | } | 234 | } |
| 236 | }; | 235 | }; |
| 237 | 236 | ||
diff --git a/drivers/phy/phy-spear1310-miphy.c b/drivers/phy/phy-spear1310-miphy.c index 6dcbfcddb372..5f4c586ee951 100644 --- a/drivers/phy/phy-spear1310-miphy.c +++ b/drivers/phy/phy-spear1310-miphy.c | |||
| @@ -212,10 +212,8 @@ static int spear1310_miphy_probe(struct platform_device *pdev) | |||
| 212 | struct phy_provider *phy_provider; | 212 | struct phy_provider *phy_provider; |
| 213 | 213 | ||
| 214 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); | 214 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); |
| 215 | if (!priv) { | 215 | if (!priv) |
| 216 | dev_err(dev, "can't alloc spear1310_miphy private date memory\n"); | ||
| 217 | return -ENOMEM; | 216 | return -ENOMEM; |
| 218 | } | ||
| 219 | 217 | ||
| 220 | priv->misc = | 218 | priv->misc = |
| 221 | syscon_regmap_lookup_by_phandle(dev->of_node, "misc"); | 219 | syscon_regmap_lookup_by_phandle(dev->of_node, "misc"); |
| @@ -252,22 +250,11 @@ static struct platform_driver spear1310_miphy_driver = { | |||
| 252 | .probe = spear1310_miphy_probe, | 250 | .probe = spear1310_miphy_probe, |
| 253 | .driver = { | 251 | .driver = { |
| 254 | .name = "spear1310-miphy", | 252 | .name = "spear1310-miphy", |
| 255 | .owner = THIS_MODULE, | ||
| 256 | .of_match_table = of_match_ptr(spear1310_miphy_of_match), | 253 | .of_match_table = of_match_ptr(spear1310_miphy_of_match), |
| 257 | }, | 254 | }, |
| 258 | }; | 255 | }; |
| 259 | 256 | ||
| 260 | static int __init spear1310_miphy_phy_init(void) | 257 | module_platform_driver(spear1310_miphy_driver); |
| 261 | { | ||
| 262 | return platform_driver_register(&spear1310_miphy_driver); | ||
| 263 | } | ||
| 264 | module_init(spear1310_miphy_phy_init); | ||
| 265 | |||
| 266 | static void __exit spear1310_miphy_phy_exit(void) | ||
| 267 | { | ||
| 268 | platform_driver_unregister(&spear1310_miphy_driver); | ||
| 269 | } | ||
| 270 | module_exit(spear1310_miphy_phy_exit); | ||
| 271 | 258 | ||
| 272 | MODULE_DESCRIPTION("ST SPEAR1310-MIPHY driver"); | 259 | MODULE_DESCRIPTION("ST SPEAR1310-MIPHY driver"); |
| 273 | MODULE_AUTHOR("Pratyush Anand <pratyush.anand@st.com>"); | 260 | MODULE_AUTHOR("Pratyush Anand <pratyush.anand@st.com>"); |
diff --git a/drivers/phy/phy-spear1340-miphy.c b/drivers/phy/phy-spear1340-miphy.c index 7135ba2603b6..1ecd0945bad3 100644 --- a/drivers/phy/phy-spear1340-miphy.c +++ b/drivers/phy/phy-spear1340-miphy.c | |||
| @@ -249,10 +249,8 @@ static int spear1340_miphy_probe(struct platform_device *pdev) | |||
| 249 | struct phy_provider *phy_provider; | 249 | struct phy_provider *phy_provider; |
| 250 | 250 | ||
| 251 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); | 251 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); |
| 252 | if (!priv) { | 252 | if (!priv) |
| 253 | dev_err(dev, "can't alloc spear1340_miphy private date memory\n"); | ||
| 254 | return -ENOMEM; | 253 | return -ENOMEM; |
| 255 | } | ||
| 256 | 254 | ||
| 257 | priv->misc = | 255 | priv->misc = |
| 258 | syscon_regmap_lookup_by_phandle(dev->of_node, "misc"); | 256 | syscon_regmap_lookup_by_phandle(dev->of_node, "misc"); |
| @@ -284,23 +282,12 @@ static struct platform_driver spear1340_miphy_driver = { | |||
| 284 | .probe = spear1340_miphy_probe, | 282 | .probe = spear1340_miphy_probe, |
| 285 | .driver = { | 283 | .driver = { |
| 286 | .name = "spear1340-miphy", | 284 | .name = "spear1340-miphy", |
| 287 | .owner = THIS_MODULE, | ||
| 288 | .pm = &spear1340_miphy_pm_ops, | 285 | .pm = &spear1340_miphy_pm_ops, |
| 289 | .of_match_table = of_match_ptr(spear1340_miphy_of_match), | 286 | .of_match_table = of_match_ptr(spear1340_miphy_of_match), |
| 290 | }, | 287 | }, |
| 291 | }; | 288 | }; |
| 292 | 289 | ||
| 293 | static int __init spear1340_miphy_phy_init(void) | 290 | module_platform_driver(spear1340_miphy_driver); |
| 294 | { | ||
| 295 | return platform_driver_register(&spear1340_miphy_driver); | ||
| 296 | } | ||
| 297 | module_init(spear1340_miphy_phy_init); | ||
| 298 | |||
| 299 | static void __exit spear1340_miphy_phy_exit(void) | ||
| 300 | { | ||
| 301 | platform_driver_unregister(&spear1340_miphy_driver); | ||
| 302 | } | ||
| 303 | module_exit(spear1340_miphy_phy_exit); | ||
| 304 | 291 | ||
| 305 | MODULE_DESCRIPTION("ST SPEAR1340-MIPHY driver"); | 292 | MODULE_DESCRIPTION("ST SPEAR1340-MIPHY driver"); |
| 306 | MODULE_AUTHOR("Pratyush Anand <pratyush.anand@st.com>"); | 293 | MODULE_AUTHOR("Pratyush Anand <pratyush.anand@st.com>"); |
diff --git a/drivers/phy/phy-stih407-usb.c b/drivers/phy/phy-stih407-usb.c new file mode 100644 index 000000000000..42428d4181ea --- /dev/null +++ b/drivers/phy/phy-stih407-usb.c | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 STMicroelectronics | ||
| 3 | * | ||
| 4 | * STMicroelectronics Generic PHY driver for STiH407 USB2. | ||
| 5 | * | ||
| 6 | * Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2, as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | #include <linux/platform_device.h> | ||
| 14 | #include <linux/io.h> | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/of.h> | ||
| 18 | #include <linux/of_platform.h> | ||
| 19 | #include <linux/clk.h> | ||
| 20 | #include <linux/regmap.h> | ||
| 21 | #include <linux/reset.h> | ||
| 22 | #include <linux/mfd/syscon.h> | ||
| 23 | #include <linux/phy/phy.h> | ||
| 24 | |||
| 25 | /* Default PHY_SEL and REFCLKSEL configuration */ | ||
| 26 | #define STIH407_USB_PICOPHY_CTRL_PORT_CONF 0x6 | ||
| 27 | #define STIH407_USB_PICOPHY_CTRL_PORT_MASK 0x1f | ||
| 28 | |||
| 29 | /* ports parameters overriding */ | ||
| 30 | #define STIH407_USB_PICOPHY_PARAM_DEF 0x39a4dc | ||
| 31 | #define STIH407_USB_PICOPHY_PARAM_MASK 0xffffffff | ||
| 32 | |||
| 33 | struct stih407_usb2_picophy { | ||
| 34 | struct phy *phy; | ||
| 35 | struct regmap *regmap; | ||
| 36 | struct device *dev; | ||
| 37 | struct reset_control *rstc; | ||
| 38 | struct reset_control *rstport; | ||
| 39 | int ctrl; | ||
| 40 | int param; | ||
| 41 | }; | ||
| 42 | |||
| 43 | static int stih407_usb2_pico_ctrl(struct stih407_usb2_picophy *phy_dev) | ||
| 44 | { | ||
| 45 | reset_control_deassert(phy_dev->rstc); | ||
| 46 | |||
| 47 | return regmap_update_bits(phy_dev->regmap, phy_dev->ctrl, | ||
| 48 | STIH407_USB_PICOPHY_CTRL_PORT_MASK, | ||
| 49 | STIH407_USB_PICOPHY_CTRL_PORT_CONF); | ||
| 50 | } | ||
| 51 | |||
| 52 | static int stih407_usb2_init_port(struct phy *phy) | ||
| 53 | { | ||
| 54 | int ret; | ||
| 55 | struct stih407_usb2_picophy *phy_dev = phy_get_drvdata(phy); | ||
| 56 | |||
| 57 | stih407_usb2_pico_ctrl(phy_dev); | ||
| 58 | |||
| 59 | ret = regmap_update_bits(phy_dev->regmap, | ||
| 60 | phy_dev->param, | ||
| 61 | STIH407_USB_PICOPHY_PARAM_MASK, | ||
| 62 | STIH407_USB_PICOPHY_PARAM_DEF); | ||
| 63 | if (ret) | ||
| 64 | return ret; | ||
| 65 | |||
| 66 | return reset_control_deassert(phy_dev->rstport); | ||
| 67 | } | ||
| 68 | |||
| 69 | static int stih407_usb2_exit_port(struct phy *phy) | ||
| 70 | { | ||
| 71 | struct stih407_usb2_picophy *phy_dev = phy_get_drvdata(phy); | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Only port reset is asserted, phy global reset is kept untouched | ||
| 75 | * as other ports may still be active. When all ports are in reset | ||
| 76 | * state, assumption is made that power will be cut off on the phy, in | ||
| 77 | * case of suspend for instance. Theoretically, asserting individual | ||
| 78 | * reset (like here) or global reset should be equivalent. | ||
| 79 | */ | ||
| 80 | return reset_control_assert(phy_dev->rstport); | ||
| 81 | } | ||
| 82 | |||
| 83 | static const struct phy_ops stih407_usb2_picophy_data = { | ||
| 84 | .init = stih407_usb2_init_port, | ||
| 85 | .exit = stih407_usb2_exit_port, | ||
| 86 | .owner = THIS_MODULE, | ||
| 87 | }; | ||
| 88 | |||
| 89 | static int stih407_usb2_picophy_probe(struct platform_device *pdev) | ||
| 90 | { | ||
| 91 | struct stih407_usb2_picophy *phy_dev; | ||
| 92 | struct device *dev = &pdev->dev; | ||
| 93 | struct device_node *np = dev->of_node; | ||
| 94 | struct phy_provider *phy_provider; | ||
| 95 | struct phy *phy; | ||
| 96 | struct resource *res; | ||
| 97 | |||
| 98 | phy_dev = devm_kzalloc(dev, sizeof(*phy_dev), GFP_KERNEL); | ||
| 99 | if (!phy_dev) | ||
| 100 | return -ENOMEM; | ||
| 101 | |||
| 102 | phy_dev->dev = dev; | ||
| 103 | dev_set_drvdata(dev, phy_dev); | ||
| 104 | |||
| 105 | phy_dev->rstc = devm_reset_control_get(dev, "global"); | ||
| 106 | if (IS_ERR(phy_dev->rstc)) { | ||
| 107 | dev_err(dev, "failed to ctrl picoPHY reset\n"); | ||
| 108 | return PTR_ERR(phy_dev->rstc); | ||
| 109 | } | ||
| 110 | |||
| 111 | phy_dev->rstport = devm_reset_control_get(dev, "port"); | ||
| 112 | if (IS_ERR(phy_dev->rstport)) { | ||
| 113 | dev_err(dev, "failed to ctrl picoPHY reset\n"); | ||
| 114 | return PTR_ERR(phy_dev->rstport); | ||
| 115 | } | ||
| 116 | |||
| 117 | /* Reset port by default: only deassert it in phy init */ | ||
| 118 | reset_control_assert(phy_dev->rstport); | ||
| 119 | |||
| 120 | phy_dev->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); | ||
| 121 | if (IS_ERR(phy_dev->regmap)) { | ||
| 122 | dev_err(dev, "No syscfg phandle specified\n"); | ||
| 123 | return PTR_ERR(phy_dev->regmap); | ||
| 124 | } | ||
| 125 | |||
| 126 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl"); | ||
| 127 | if (!res) { | ||
| 128 | dev_err(dev, "No ctrl reg found\n"); | ||
| 129 | return -ENXIO; | ||
| 130 | } | ||
| 131 | phy_dev->ctrl = res->start; | ||
| 132 | |||
| 133 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "param"); | ||
| 134 | if (!res) { | ||
| 135 | dev_err(dev, "No param reg found\n"); | ||
| 136 | return -ENXIO; | ||
| 137 | } | ||
| 138 | phy_dev->param = res->start; | ||
| 139 | |||
| 140 | phy = devm_phy_create(dev, NULL, &stih407_usb2_picophy_data, NULL); | ||
| 141 | if (IS_ERR(phy)) { | ||
| 142 | dev_err(dev, "failed to create Display Port PHY\n"); | ||
| 143 | return PTR_ERR(phy); | ||
| 144 | } | ||
| 145 | |||
| 146 | phy_dev->phy = phy; | ||
| 147 | phy_set_drvdata(phy, phy_dev); | ||
| 148 | |||
| 149 | phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); | ||
| 150 | if (IS_ERR(phy_provider)) | ||
| 151 | return PTR_ERR(phy_provider); | ||
| 152 | |||
| 153 | dev_info(dev, "STiH407 USB Generic picoPHY driver probed!"); | ||
| 154 | |||
| 155 | return 0; | ||
| 156 | } | ||
| 157 | |||
| 158 | static const struct of_device_id stih407_usb2_picophy_of_match[] = { | ||
| 159 | { .compatible = "st,stih407-usb2-phy" }, | ||
| 160 | { /*sentinel */ }, | ||
| 161 | }; | ||
| 162 | |||
| 163 | MODULE_DEVICE_TABLE(of, stih407_usb2_picophy_of_match); | ||
| 164 | |||
| 165 | static struct platform_driver stih407_usb2_picophy_driver = { | ||
| 166 | .probe = stih407_usb2_picophy_probe, | ||
| 167 | .driver = { | ||
| 168 | .name = "stih407-usb-genphy", | ||
| 169 | .of_match_table = stih407_usb2_picophy_of_match, | ||
| 170 | } | ||
| 171 | }; | ||
| 172 | |||
| 173 | module_platform_driver(stih407_usb2_picophy_driver); | ||
| 174 | |||
| 175 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); | ||
| 176 | MODULE_DESCRIPTION("STMicroelectronics Generic picoPHY driver for STiH407"); | ||
| 177 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/phy/phy-stih41x-usb.c b/drivers/phy/phy-stih41x-usb.c new file mode 100644 index 000000000000..9f16cb8e01f4 --- /dev/null +++ b/drivers/phy/phy-stih41x-usb.c | |||
| @@ -0,0 +1,187 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 STMicroelectronics | ||
| 3 | * | ||
| 4 | * STMicroelectronics PHY driver for STiH41x USB. | ||
| 5 | * | ||
| 6 | * Author: Maxime Coquelin <maxime.coquelin@st.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2, as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/platform_device.h> | ||
| 15 | #include <linux/io.h> | ||
| 16 | #include <linux/kernel.h> | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/of.h> | ||
| 19 | #include <linux/of_platform.h> | ||
| 20 | #include <linux/clk.h> | ||
| 21 | #include <linux/phy/phy.h> | ||
| 22 | #include <linux/regmap.h> | ||
| 23 | #include <linux/mfd/syscon.h> | ||
| 24 | |||
| 25 | #define SYSCFG332 0x80 | ||
| 26 | #define SYSCFG2520 0x820 | ||
| 27 | |||
| 28 | /** | ||
| 29 | * struct stih41x_usb_cfg - SoC specific PHY register mapping | ||
| 30 | * @syscfg: Offset in syscfg registers bank | ||
| 31 | * @cfg_mask: Bits mask for PHY configuration | ||
| 32 | * @cfg: Static configuration value for PHY | ||
| 33 | * @oscok: Notify the PHY oscillator clock is ready | ||
| 34 | * Setting this bit enable the PHY | ||
| 35 | */ | ||
| 36 | struct stih41x_usb_cfg { | ||
| 37 | u32 syscfg; | ||
| 38 | u32 cfg_mask; | ||
| 39 | u32 cfg; | ||
| 40 | u32 oscok; | ||
| 41 | }; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * struct stih41x_usb_phy - Private data for the PHY | ||
| 45 | * @dev: device for this controller | ||
| 46 | * @regmap: Syscfg registers bank in which PHY is configured | ||
| 47 | * @cfg: SoC specific PHY register mapping | ||
| 48 | * @clk: Oscillator used by the PHY | ||
| 49 | */ | ||
| 50 | struct stih41x_usb_phy { | ||
| 51 | struct device *dev; | ||
| 52 | struct regmap *regmap; | ||
| 53 | const struct stih41x_usb_cfg *cfg; | ||
| 54 | struct clk *clk; | ||
| 55 | }; | ||
| 56 | |||
| 57 | static struct stih41x_usb_cfg stih415_usb_phy_cfg = { | ||
| 58 | .syscfg = SYSCFG332, | ||
| 59 | .cfg_mask = 0x3f, | ||
| 60 | .cfg = 0x38, | ||
| 61 | .oscok = BIT(6), | ||
| 62 | }; | ||
| 63 | |||
| 64 | static struct stih41x_usb_cfg stih416_usb_phy_cfg = { | ||
| 65 | .syscfg = SYSCFG2520, | ||
| 66 | .cfg_mask = 0x33f, | ||
| 67 | .cfg = 0x238, | ||
| 68 | .oscok = BIT(6), | ||
| 69 | }; | ||
| 70 | |||
| 71 | static int stih41x_usb_phy_init(struct phy *phy) | ||
| 72 | { | ||
| 73 | struct stih41x_usb_phy *phy_dev = phy_get_drvdata(phy); | ||
| 74 | |||
| 75 | return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg, | ||
| 76 | phy_dev->cfg->cfg_mask, phy_dev->cfg->cfg); | ||
| 77 | } | ||
| 78 | |||
| 79 | static int stih41x_usb_phy_power_on(struct phy *phy) | ||
| 80 | { | ||
| 81 | struct stih41x_usb_phy *phy_dev = phy_get_drvdata(phy); | ||
| 82 | int ret; | ||
| 83 | |||
| 84 | ret = clk_prepare_enable(phy_dev->clk); | ||
| 85 | if (ret) { | ||
| 86 | dev_err(phy_dev->dev, "Failed to enable osc_phy clock\n"); | ||
| 87 | return ret; | ||
| 88 | } | ||
| 89 | |||
| 90 | return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg, | ||
| 91 | phy_dev->cfg->oscok, phy_dev->cfg->oscok); | ||
| 92 | } | ||
| 93 | |||
| 94 | static int stih41x_usb_phy_power_off(struct phy *phy) | ||
| 95 | { | ||
| 96 | struct stih41x_usb_phy *phy_dev = phy_get_drvdata(phy); | ||
| 97 | int ret; | ||
| 98 | |||
| 99 | ret = regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg, | ||
| 100 | phy_dev->cfg->oscok, 0); | ||
| 101 | if (ret) { | ||
| 102 | dev_err(phy_dev->dev, "Failed to clear oscok bit\n"); | ||
| 103 | return ret; | ||
| 104 | } | ||
| 105 | |||
| 106 | clk_disable_unprepare(phy_dev->clk); | ||
| 107 | |||
| 108 | return 0; | ||
| 109 | } | ||
| 110 | |||
| 111 | static struct phy_ops stih41x_usb_phy_ops = { | ||
| 112 | .init = stih41x_usb_phy_init, | ||
| 113 | .power_on = stih41x_usb_phy_power_on, | ||
| 114 | .power_off = stih41x_usb_phy_power_off, | ||
| 115 | .owner = THIS_MODULE, | ||
| 116 | }; | ||
| 117 | |||
| 118 | static const struct of_device_id stih41x_usb_phy_of_match[]; | ||
| 119 | |||
| 120 | static int stih41x_usb_phy_probe(struct platform_device *pdev) | ||
| 121 | { | ||
| 122 | struct device_node *np = pdev->dev.of_node; | ||
| 123 | const struct of_device_id *match; | ||
| 124 | struct stih41x_usb_phy *phy_dev; | ||
| 125 | struct device *dev = &pdev->dev; | ||
| 126 | struct phy_provider *phy_provider; | ||
| 127 | struct phy *phy; | ||
| 128 | |||
| 129 | phy_dev = devm_kzalloc(dev, sizeof(*phy_dev), GFP_KERNEL); | ||
| 130 | if (!phy_dev) | ||
| 131 | return -ENOMEM; | ||
| 132 | |||
| 133 | match = of_match_device(stih41x_usb_phy_of_match, &pdev->dev); | ||
| 134 | if (!match) | ||
| 135 | return -ENODEV; | ||
| 136 | |||
| 137 | phy_dev->cfg = match->data; | ||
| 138 | |||
| 139 | phy_dev->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); | ||
| 140 | if (IS_ERR(phy_dev->regmap)) { | ||
| 141 | dev_err(dev, "No syscfg phandle specified\n"); | ||
| 142 | return PTR_ERR(phy_dev->regmap); | ||
| 143 | } | ||
| 144 | |||
| 145 | phy_dev->clk = devm_clk_get(dev, "osc_phy"); | ||
| 146 | if (IS_ERR(phy_dev->clk)) { | ||
| 147 | dev_err(dev, "osc_phy clk not found\n"); | ||
| 148 | return PTR_ERR(phy_dev->clk); | ||
| 149 | } | ||
| 150 | |||
| 151 | phy = devm_phy_create(dev, NULL, &stih41x_usb_phy_ops, NULL); | ||
| 152 | |||
| 153 | if (IS_ERR(phy)) { | ||
| 154 | dev_err(dev, "failed to create phy\n"); | ||
| 155 | return PTR_ERR(phy); | ||
| 156 | } | ||
| 157 | |||
| 158 | phy_dev->dev = dev; | ||
| 159 | |||
| 160 | phy_set_drvdata(phy, phy_dev); | ||
| 161 | |||
| 162 | phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); | ||
| 163 | if (IS_ERR(phy_provider)) | ||
| 164 | return PTR_ERR(phy_provider); | ||
| 165 | |||
| 166 | return 0; | ||
| 167 | } | ||
| 168 | |||
| 169 | static const struct of_device_id stih41x_usb_phy_of_match[] = { | ||
| 170 | { .compatible = "st,stih415-usb-phy", .data = &stih415_usb_phy_cfg }, | ||
| 171 | { .compatible = "st,stih416-usb-phy", .data = &stih416_usb_phy_cfg }, | ||
| 172 | { /* sentinel */ }, | ||
| 173 | }; | ||
| 174 | MODULE_DEVICE_TABLE(of, stih41x_usb_phy_of_match); | ||
| 175 | |||
| 176 | static struct platform_driver stih41x_usb_phy_driver = { | ||
| 177 | .probe = stih41x_usb_phy_probe, | ||
| 178 | .driver = { | ||
| 179 | .name = "stih41x-usb-phy", | ||
| 180 | .of_match_table = stih41x_usb_phy_of_match, | ||
| 181 | } | ||
| 182 | }; | ||
| 183 | module_platform_driver(stih41x_usb_phy_driver); | ||
| 184 | |||
| 185 | MODULE_AUTHOR("Maxime Coquelin <maxime.coquelin@st.com>"); | ||
| 186 | MODULE_DESCRIPTION("STMicroelectronics USB PHY driver for STiH41x series"); | ||
| 187 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index 61ebea49709b..0baf5efc8a40 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c | |||
| @@ -325,7 +325,6 @@ static struct platform_driver sun4i_usb_phy_driver = { | |||
| 325 | .driver = { | 325 | .driver = { |
| 326 | .of_match_table = sun4i_usb_phy_of_match, | 326 | .of_match_table = sun4i_usb_phy_of_match, |
| 327 | .name = "sun4i-usb-phy", | 327 | .name = "sun4i-usb-phy", |
| 328 | .owner = THIS_MODULE, | ||
| 329 | } | 328 | } |
| 330 | }; | 329 | }; |
| 331 | module_platform_driver(sun4i_usb_phy_driver); | 330 | module_platform_driver(sun4i_usb_phy_driver); |
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index b964aa967b46..ab1e22d9a1e8 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c | |||
| @@ -299,10 +299,9 @@ static int ti_pipe3_probe(struct platform_device *pdev) | |||
| 299 | struct clk *clk; | 299 | struct clk *clk; |
| 300 | 300 | ||
| 301 | phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); | 301 | phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); |
| 302 | if (!phy) { | 302 | if (!phy) |
| 303 | dev_err(&pdev->dev, "unable to alloc mem for TI PIPE3 PHY\n"); | ||
| 304 | return -ENOMEM; | 303 | return -ENOMEM; |
| 305 | } | 304 | |
| 306 | phy->dev = &pdev->dev; | 305 | phy->dev = &pdev->dev; |
| 307 | 306 | ||
| 308 | if (!of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { | 307 | if (!of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { |
| @@ -519,7 +518,6 @@ static struct platform_driver ti_pipe3_driver = { | |||
| 519 | .remove = ti_pipe3_remove, | 518 | .remove = ti_pipe3_remove, |
| 520 | .driver = { | 519 | .driver = { |
| 521 | .name = "ti-pipe3", | 520 | .name = "ti-pipe3", |
| 522 | .owner = THIS_MODULE, | ||
| 523 | .pm = DEV_PM_OPS, | 521 | .pm = DEV_PM_OPS, |
| 524 | .of_match_table = of_match_ptr(ti_pipe3_id_table), | 522 | .of_match_table = of_match_ptr(ti_pipe3_id_table), |
| 525 | }, | 523 | }, |
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 9cd33a4bcfb1..7b04befd5271 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
| 30 | #include <linux/platform_device.h> | 30 | #include <linux/platform_device.h> |
| 31 | #include <linux/spinlock.h> | ||
| 32 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
| 33 | #include <linux/io.h> | 32 | #include <linux/io.h> |
| 34 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
| @@ -155,7 +154,7 @@ struct twl4030_usb { | |||
| 155 | struct regulator *usb3v1; | 154 | struct regulator *usb3v1; |
| 156 | 155 | ||
| 157 | /* for vbus reporting with irqs disabled */ | 156 | /* for vbus reporting with irqs disabled */ |
| 158 | spinlock_t lock; | 157 | struct mutex lock; |
| 159 | 158 | ||
| 160 | /* pin configuration */ | 159 | /* pin configuration */ |
| 161 | enum twl4030_usb_mode usb_mode; | 160 | enum twl4030_usb_mode usb_mode; |
| @@ -163,8 +162,6 @@ struct twl4030_usb { | |||
| 163 | int irq; | 162 | int irq; |
| 164 | enum omap_musb_vbus_id_status linkstat; | 163 | enum omap_musb_vbus_id_status linkstat; |
| 165 | bool vbus_supplied; | 164 | bool vbus_supplied; |
| 166 | u8 asleep; | ||
| 167 | bool irq_enabled; | ||
| 168 | 165 | ||
| 169 | struct delayed_work id_workaround_work; | 166 | struct delayed_work id_workaround_work; |
| 170 | }; | 167 | }; |
| @@ -384,55 +381,18 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on) | |||
| 384 | WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); | 381 | WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); |
| 385 | } | 382 | } |
| 386 | 383 | ||
| 387 | static void twl4030_phy_power(struct twl4030_usb *twl, int on) | ||
| 388 | { | ||
| 389 | int ret; | ||
| 390 | |||
| 391 | if (on) { | ||
| 392 | ret = regulator_enable(twl->usb3v1); | ||
| 393 | if (ret) | ||
| 394 | dev_err(twl->dev, "Failed to enable usb3v1\n"); | ||
| 395 | |||
| 396 | ret = regulator_enable(twl->usb1v8); | ||
| 397 | if (ret) | ||
| 398 | dev_err(twl->dev, "Failed to enable usb1v8\n"); | ||
| 399 | |||
| 400 | /* | ||
| 401 | * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP | ||
| 402 | * in twl4030) resets the VUSB_DEDICATED2 register. This reset | ||
| 403 | * enables VUSB3V1_SLEEP bit that remaps usb3v1 ACTIVE state to | ||
| 404 | * SLEEP. We work around this by clearing the bit after usv3v1 | ||
| 405 | * is re-activated. This ensures that VUSB3V1 is really active. | ||
| 406 | */ | ||
| 407 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); | ||
| 408 | |||
| 409 | ret = regulator_enable(twl->usb1v5); | ||
| 410 | if (ret) | ||
| 411 | dev_err(twl->dev, "Failed to enable usb1v5\n"); | ||
| 412 | |||
| 413 | __twl4030_phy_power(twl, 1); | ||
| 414 | twl4030_usb_write(twl, PHY_CLK_CTRL, | ||
| 415 | twl4030_usb_read(twl, PHY_CLK_CTRL) | | ||
| 416 | (PHY_CLK_CTRL_CLOCKGATING_EN | | ||
| 417 | PHY_CLK_CTRL_CLK32K_EN)); | ||
| 418 | } else { | ||
| 419 | __twl4030_phy_power(twl, 0); | ||
| 420 | regulator_disable(twl->usb1v5); | ||
| 421 | regulator_disable(twl->usb1v8); | ||
| 422 | regulator_disable(twl->usb3v1); | ||
| 423 | } | ||
| 424 | } | ||
| 425 | |||
| 426 | static int twl4030_usb_runtime_suspend(struct device *dev) | 384 | static int twl4030_usb_runtime_suspend(struct device *dev) |
| 427 | { | 385 | { |
| 428 | struct twl4030_usb *twl = dev_get_drvdata(dev); | 386 | struct twl4030_usb *twl = dev_get_drvdata(dev); |
| 429 | 387 | ||
| 430 | dev_dbg(twl->dev, "%s\n", __func__); | 388 | dev_dbg(twl->dev, "%s\n", __func__); |
| 431 | if (twl->asleep) | 389 | if (pm_runtime_suspended(dev)) |
| 432 | return 0; | 390 | return 0; |
| 433 | 391 | ||
| 434 | twl4030_phy_power(twl, 0); | 392 | __twl4030_phy_power(twl, 0); |
| 435 | twl->asleep = 1; | 393 | regulator_disable(twl->usb1v5); |
| 394 | regulator_disable(twl->usb1v8); | ||
| 395 | regulator_disable(twl->usb3v1); | ||
| 436 | 396 | ||
| 437 | return 0; | 397 | return 0; |
| 438 | } | 398 | } |
| @@ -440,13 +400,38 @@ static int twl4030_usb_runtime_suspend(struct device *dev) | |||
| 440 | static int twl4030_usb_runtime_resume(struct device *dev) | 400 | static int twl4030_usb_runtime_resume(struct device *dev) |
| 441 | { | 401 | { |
| 442 | struct twl4030_usb *twl = dev_get_drvdata(dev); | 402 | struct twl4030_usb *twl = dev_get_drvdata(dev); |
| 403 | int res; | ||
| 443 | 404 | ||
| 444 | dev_dbg(twl->dev, "%s\n", __func__); | 405 | dev_dbg(twl->dev, "%s\n", __func__); |
| 445 | if (!twl->asleep) | 406 | if (pm_runtime_active(dev)) |
| 446 | return 0; | 407 | return 0; |
| 447 | 408 | ||
| 448 | twl4030_phy_power(twl, 1); | 409 | res = regulator_enable(twl->usb3v1); |
| 449 | twl->asleep = 0; | 410 | if (res) |
| 411 | dev_err(twl->dev, "Failed to enable usb3v1\n"); | ||
| 412 | |||
| 413 | res = regulator_enable(twl->usb1v8); | ||
| 414 | if (res) | ||
| 415 | dev_err(twl->dev, "Failed to enable usb1v8\n"); | ||
| 416 | |||
| 417 | /* | ||
| 418 | * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP | ||
| 419 | * in twl4030) resets the VUSB_DEDICATED2 register. This reset | ||
| 420 | * enables VUSB3V1_SLEEP bit that remaps usb3v1 ACTIVE state to | ||
| 421 | * SLEEP. We work around this by clearing the bit after usv3v1 | ||
| 422 | * is re-activated. This ensures that VUSB3V1 is really active. | ||
| 423 | */ | ||
| 424 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); | ||
| 425 | |||
| 426 | res = regulator_enable(twl->usb1v5); | ||
| 427 | if (res) | ||
| 428 | dev_err(twl->dev, "Failed to enable usb1v5\n"); | ||
| 429 | |||
| 430 | __twl4030_phy_power(twl, 1); | ||
| 431 | twl4030_usb_write(twl, PHY_CLK_CTRL, | ||
| 432 | twl4030_usb_read(twl, PHY_CLK_CTRL) | | ||
| 433 | (PHY_CLK_CTRL_CLOCKGATING_EN | | ||
| 434 | PHY_CLK_CTRL_CLK32K_EN)); | ||
| 450 | 435 | ||
| 451 | return 0; | 436 | return 0; |
| 452 | } | 437 | } |
| @@ -472,16 +457,8 @@ static int twl4030_phy_power_on(struct phy *phy) | |||
| 472 | twl4030_usb_set_mode(twl, twl->usb_mode); | 457 | twl4030_usb_set_mode(twl, twl->usb_mode); |
| 473 | if (twl->usb_mode == T2_USB_MODE_ULPI) | 458 | if (twl->usb_mode == T2_USB_MODE_ULPI) |
| 474 | twl4030_i2c_access(twl, 0); | 459 | twl4030_i2c_access(twl, 0); |
| 460 | schedule_delayed_work(&twl->id_workaround_work, 0); | ||
| 475 | 461 | ||
| 476 | /* | ||
| 477 | * XXX When VBUS gets driven after musb goes to A mode, | ||
| 478 | * ID_PRES related interrupts no longer arrive, why? | ||
| 479 | * Register itself is updated fine though, so we must poll. | ||
| 480 | */ | ||
| 481 | if (twl->linkstat == OMAP_MUSB_ID_GROUND) { | ||
| 482 | cancel_delayed_work(&twl->id_workaround_work); | ||
| 483 | schedule_delayed_work(&twl->id_workaround_work, HZ); | ||
| 484 | } | ||
| 485 | return 0; | 462 | return 0; |
| 486 | } | 463 | } |
| 487 | 464 | ||
| @@ -538,13 +515,12 @@ static ssize_t twl4030_usb_vbus_show(struct device *dev, | |||
| 538 | struct device_attribute *attr, char *buf) | 515 | struct device_attribute *attr, char *buf) |
| 539 | { | 516 | { |
| 540 | struct twl4030_usb *twl = dev_get_drvdata(dev); | 517 | struct twl4030_usb *twl = dev_get_drvdata(dev); |
| 541 | unsigned long flags; | ||
| 542 | int ret = -EINVAL; | 518 | int ret = -EINVAL; |
| 543 | 519 | ||
| 544 | spin_lock_irqsave(&twl->lock, flags); | 520 | mutex_lock(&twl->lock); |
| 545 | ret = sprintf(buf, "%s\n", | 521 | ret = sprintf(buf, "%s\n", |
| 546 | twl->vbus_supplied ? "on" : "off"); | 522 | twl->vbus_supplied ? "on" : "off"); |
| 547 | spin_unlock_irqrestore(&twl->lock, flags); | 523 | mutex_unlock(&twl->lock); |
| 548 | 524 | ||
| 549 | return ret; | 525 | return ret; |
| 550 | } | 526 | } |
| @@ -558,12 +534,12 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) | |||
| 558 | 534 | ||
| 559 | status = twl4030_usb_linkstat(twl); | 535 | status = twl4030_usb_linkstat(twl); |
| 560 | 536 | ||
| 561 | spin_lock_irq(&twl->lock); | 537 | mutex_lock(&twl->lock); |
| 562 | if (status >= 0 && status != twl->linkstat) { | 538 | if (status >= 0 && status != twl->linkstat) { |
| 563 | twl->linkstat = status; | 539 | twl->linkstat = status; |
| 564 | status_changed = true; | 540 | status_changed = true; |
| 565 | } | 541 | } |
| 566 | spin_unlock_irq(&twl->lock); | 542 | mutex_unlock(&twl->lock); |
| 567 | 543 | ||
| 568 | if (status_changed) { | 544 | if (status_changed) { |
| 569 | /* FIXME add a set_power() method so that B-devices can | 545 | /* FIXME add a set_power() method so that B-devices can |
| @@ -579,10 +555,10 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) | |||
| 579 | */ | 555 | */ |
| 580 | if ((status == OMAP_MUSB_VBUS_VALID) || | 556 | if ((status == OMAP_MUSB_VBUS_VALID) || |
| 581 | (status == OMAP_MUSB_ID_GROUND)) { | 557 | (status == OMAP_MUSB_ID_GROUND)) { |
| 582 | if (twl->asleep) | 558 | if (pm_runtime_suspended(twl->dev)) |
| 583 | pm_runtime_get_sync(twl->dev); | 559 | pm_runtime_get_sync(twl->dev); |
| 584 | } else { | 560 | } else { |
| 585 | if (!twl->asleep) { | 561 | if (pm_runtime_active(twl->dev)) { |
| 586 | pm_runtime_mark_last_busy(twl->dev); | 562 | pm_runtime_mark_last_busy(twl->dev); |
| 587 | pm_runtime_put_autosuspend(twl->dev); | 563 | pm_runtime_put_autosuspend(twl->dev); |
| 588 | } | 564 | } |
| @@ -591,7 +567,7 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) | |||
| 591 | } | 567 | } |
| 592 | 568 | ||
| 593 | /* don't schedule during sleep - irq works right then */ | 569 | /* don't schedule during sleep - irq works right then */ |
| 594 | if (status == OMAP_MUSB_ID_GROUND && !twl->asleep) { | 570 | if (status == OMAP_MUSB_ID_GROUND && pm_runtime_active(twl->dev)) { |
| 595 | cancel_delayed_work(&twl->id_workaround_work); | 571 | cancel_delayed_work(&twl->id_workaround_work); |
| 596 | schedule_delayed_work(&twl->id_workaround_work, HZ); | 572 | schedule_delayed_work(&twl->id_workaround_work, HZ); |
| 597 | } | 573 | } |
| @@ -613,16 +589,9 @@ static void twl4030_id_workaround_work(struct work_struct *work) | |||
| 613 | static int twl4030_phy_init(struct phy *phy) | 589 | static int twl4030_phy_init(struct phy *phy) |
| 614 | { | 590 | { |
| 615 | struct twl4030_usb *twl = phy_get_drvdata(phy); | 591 | struct twl4030_usb *twl = phy_get_drvdata(phy); |
| 616 | enum omap_musb_vbus_id_status status; | ||
| 617 | 592 | ||
| 618 | pm_runtime_get_sync(twl->dev); | 593 | pm_runtime_get_sync(twl->dev); |
| 619 | status = twl4030_usb_linkstat(twl); | 594 | schedule_delayed_work(&twl->id_workaround_work, 0); |
| 620 | twl->linkstat = status; | ||
| 621 | |||
| 622 | if (status == OMAP_MUSB_ID_GROUND || status == OMAP_MUSB_VBUS_VALID) | ||
| 623 | omap_musb_mailbox(twl->linkstat); | ||
| 624 | |||
| 625 | sysfs_notify(&twl->dev->kobj, NULL, "vbus"); | ||
| 626 | pm_runtime_mark_last_busy(twl->dev); | 595 | pm_runtime_mark_last_busy(twl->dev); |
| 627 | pm_runtime_put_autosuspend(twl->dev); | 596 | pm_runtime_put_autosuspend(twl->dev); |
| 628 | 597 | ||
| @@ -699,7 +668,7 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
| 699 | twl->dev = &pdev->dev; | 668 | twl->dev = &pdev->dev; |
| 700 | twl->irq = platform_get_irq(pdev, 0); | 669 | twl->irq = platform_get_irq(pdev, 0); |
| 701 | twl->vbus_supplied = false; | 670 | twl->vbus_supplied = false; |
| 702 | twl->asleep = 1; | 671 | twl->linkstat = -EINVAL; |
| 703 | twl->linkstat = OMAP_MUSB_UNKNOWN; | 672 | twl->linkstat = OMAP_MUSB_UNKNOWN; |
| 704 | 673 | ||
| 705 | twl->phy.dev = twl->dev; | 674 | twl->phy.dev = twl->dev; |
| @@ -724,8 +693,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
| 724 | if (IS_ERR(phy_provider)) | 693 | if (IS_ERR(phy_provider)) |
| 725 | return PTR_ERR(phy_provider); | 694 | return PTR_ERR(phy_provider); |
| 726 | 695 | ||
| 727 | /* init spinlock for workqueue */ | 696 | /* init mutex for workqueue */ |
| 728 | spin_lock_init(&twl->lock); | 697 | mutex_init(&twl->lock); |
| 729 | 698 | ||
| 730 | INIT_DELAYED_WORK(&twl->id_workaround_work, twl4030_id_workaround_work); | 699 | INIT_DELAYED_WORK(&twl->id_workaround_work, twl4030_id_workaround_work); |
| 731 | 700 | ||
| @@ -755,7 +724,6 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
| 755 | * set_host() and/or set_peripheral() ... OTG_capable boards | 724 | * set_host() and/or set_peripheral() ... OTG_capable boards |
| 756 | * need both handles, otherwise just one suffices. | 725 | * need both handles, otherwise just one suffices. |
| 757 | */ | 726 | */ |
| 758 | twl->irq_enabled = true; | ||
| 759 | status = devm_request_threaded_irq(twl->dev, twl->irq, NULL, | 727 | status = devm_request_threaded_irq(twl->dev, twl->irq, NULL, |
| 760 | twl4030_usb_irq, IRQF_TRIGGER_FALLING | | 728 | twl4030_usb_irq, IRQF_TRIGGER_FALLING | |
| 761 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, "twl4030_usb", twl); | 729 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, "twl4030_usb", twl); |
| @@ -817,7 +785,6 @@ static struct platform_driver twl4030_usb_driver = { | |||
| 817 | .driver = { | 785 | .driver = { |
| 818 | .name = "twl4030_usb", | 786 | .name = "twl4030_usb", |
| 819 | .pm = &twl4030_usb_pm_ops, | 787 | .pm = &twl4030_usb_pm_ops, |
| 820 | .owner = THIS_MODULE, | ||
| 821 | .of_match_table = of_match_ptr(twl4030_usb_id_table), | 788 | .of_match_table = of_match_ptr(twl4030_usb_id_table), |
| 822 | }, | 789 | }, |
| 823 | }; | 790 | }; |
diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index db809b97219e..f8a51b16ade8 100644 --- a/drivers/phy/phy-xgene.c +++ b/drivers/phy/phy-xgene.c | |||
| @@ -1738,7 +1738,6 @@ static struct platform_driver xgene_phy_driver = { | |||
| 1738 | .probe = xgene_phy_probe, | 1738 | .probe = xgene_phy_probe, |
| 1739 | .driver = { | 1739 | .driver = { |
| 1740 | .name = "xgene-phy", | 1740 | .name = "xgene-phy", |
| 1741 | .owner = THIS_MODULE, | ||
| 1742 | .of_match_table = xgene_phy_of_match, | 1741 | .of_match_table = xgene_phy_of_match, |
| 1743 | }, | 1742 | }, |
| 1744 | }; | 1743 | }; |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 18a3358eb1d4..bd85fb4978e0 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
| @@ -43,7 +43,7 @@ config SCSI_DMA | |||
| 43 | config SCSI_NETLINK | 43 | config SCSI_NETLINK |
| 44 | bool | 44 | bool |
| 45 | default n | 45 | default n |
| 46 | select NET | 46 | depends on NET |
| 47 | 47 | ||
| 48 | config SCSI_PROC_FS | 48 | config SCSI_PROC_FS |
| 49 | bool "legacy /proc/scsi/ support" | 49 | bool "legacy /proc/scsi/ support" |
| @@ -257,7 +257,7 @@ config SCSI_SPI_ATTRS | |||
| 257 | 257 | ||
| 258 | config SCSI_FC_ATTRS | 258 | config SCSI_FC_ATTRS |
| 259 | tristate "FiberChannel Transport Attributes" | 259 | tristate "FiberChannel Transport Attributes" |
| 260 | depends on SCSI | 260 | depends on SCSI && NET |
| 261 | select SCSI_NETLINK | 261 | select SCSI_NETLINK |
| 262 | help | 262 | help |
| 263 | If you wish to export transport-specific information about | 263 | If you wish to export transport-specific information about |
| @@ -585,28 +585,28 @@ config HYPERV_STORAGE | |||
| 585 | 585 | ||
| 586 | config LIBFC | 586 | config LIBFC |
| 587 | tristate "LibFC module" | 587 | tristate "LibFC module" |
| 588 | select SCSI_FC_ATTRS | 588 | depends on SCSI_FC_ATTRS |
| 589 | select CRC32 | 589 | select CRC32 |
| 590 | ---help--- | 590 | ---help--- |
| 591 | Fibre Channel library module | 591 | Fibre Channel library module |
| 592 | 592 | ||
| 593 | config LIBFCOE | 593 | config LIBFCOE |
| 594 | tristate "LibFCoE module" | 594 | tristate "LibFCoE module" |
| 595 | select LIBFC | 595 | depends on LIBFC |
| 596 | ---help--- | 596 | ---help--- |
| 597 | Library for Fibre Channel over Ethernet module | 597 | Library for Fibre Channel over Ethernet module |
| 598 | 598 | ||
| 599 | config FCOE | 599 | config FCOE |
| 600 | tristate "FCoE module" | 600 | tristate "FCoE module" |
| 601 | depends on PCI | 601 | depends on PCI |
| 602 | select LIBFCOE | 602 | depends on LIBFCOE |
| 603 | ---help--- | 603 | ---help--- |
| 604 | Fibre Channel over Ethernet module | 604 | Fibre Channel over Ethernet module |
| 605 | 605 | ||
| 606 | config FCOE_FNIC | 606 | config FCOE_FNIC |
| 607 | tristate "Cisco FNIC Driver" | 607 | tristate "Cisco FNIC Driver" |
| 608 | depends on PCI && X86 | 608 | depends on PCI && X86 |
| 609 | select LIBFCOE | 609 | depends on LIBFCOE |
| 610 | help | 610 | help |
| 611 | This is support for the Cisco PCI-Express FCoE HBA. | 611 | This is support for the Cisco PCI-Express FCoE HBA. |
| 612 | 612 | ||
| @@ -816,7 +816,7 @@ config SCSI_IBMVSCSI | |||
| 816 | config SCSI_IBMVFC | 816 | config SCSI_IBMVFC |
| 817 | tristate "IBM Virtual FC support" | 817 | tristate "IBM Virtual FC support" |
| 818 | depends on PPC_PSERIES && SCSI | 818 | depends on PPC_PSERIES && SCSI |
| 819 | select SCSI_FC_ATTRS | 819 | depends on SCSI_FC_ATTRS |
| 820 | help | 820 | help |
| 821 | This is the IBM POWER Virtual FC Client | 821 | This is the IBM POWER Virtual FC Client |
| 822 | 822 | ||
| @@ -1266,7 +1266,7 @@ source "drivers/scsi/qla4xxx/Kconfig" | |||
| 1266 | config SCSI_LPFC | 1266 | config SCSI_LPFC |
| 1267 | tristate "Emulex LightPulse Fibre Channel Support" | 1267 | tristate "Emulex LightPulse Fibre Channel Support" |
| 1268 | depends on PCI && SCSI | 1268 | depends on PCI && SCSI |
| 1269 | select SCSI_FC_ATTRS | 1269 | depends on SCSI_FC_ATTRS |
| 1270 | select CRC_T10DIF | 1270 | select CRC_T10DIF |
| 1271 | help | 1271 | help |
| 1272 | This lpfc driver supports the Emulex LightPulse | 1272 | This lpfc driver supports the Emulex LightPulse |
| @@ -1676,7 +1676,7 @@ config SCSI_SUNESP | |||
| 1676 | config ZFCP | 1676 | config ZFCP |
| 1677 | tristate "FCP host bus adapter driver for IBM eServer zSeries" | 1677 | tristate "FCP host bus adapter driver for IBM eServer zSeries" |
| 1678 | depends on S390 && QDIO && SCSI | 1678 | depends on S390 && QDIO && SCSI |
| 1679 | select SCSI_FC_ATTRS | 1679 | depends on SCSI_FC_ATTRS |
| 1680 | help | 1680 | help |
| 1681 | If you want to access SCSI devices attached to your IBM eServer | 1681 | If you want to access SCSI devices attached to your IBM eServer |
| 1682 | zSeries by means of Fibre Channel interfaces say Y. | 1682 | zSeries by means of Fibre Channel interfaces say Y. |
| @@ -1704,7 +1704,7 @@ config SCSI_PM8001 | |||
| 1704 | config SCSI_BFA_FC | 1704 | config SCSI_BFA_FC |
| 1705 | tristate "Brocade BFA Fibre Channel Support" | 1705 | tristate "Brocade BFA Fibre Channel Support" |
| 1706 | depends on PCI && SCSI | 1706 | depends on PCI && SCSI |
| 1707 | select SCSI_FC_ATTRS | 1707 | depends on SCSI_FC_ATTRS |
| 1708 | help | 1708 | help |
| 1709 | This bfa driver supports all Brocade PCIe FC/FCOE host adapters. | 1709 | This bfa driver supports all Brocade PCIe FC/FCOE host adapters. |
| 1710 | 1710 | ||
diff --git a/drivers/scsi/bnx2fc/Kconfig b/drivers/scsi/bnx2fc/Kconfig index f245d543d7b1..097882882649 100644 --- a/drivers/scsi/bnx2fc/Kconfig +++ b/drivers/scsi/bnx2fc/Kconfig | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | config SCSI_BNX2X_FCOE | 1 | config SCSI_BNX2X_FCOE |
| 2 | tristate "QLogic NetXtreme II FCoE support" | 2 | tristate "QLogic NetXtreme II FCoE support" |
| 3 | depends on PCI | 3 | depends on PCI |
| 4 | depends on (IPV6 || IPV6=n) | ||
| 5 | depends on LIBFC | ||
| 6 | depends on LIBFCOE | ||
| 4 | select NETDEVICES | 7 | select NETDEVICES |
| 5 | select ETHERNET | 8 | select ETHERNET |
| 6 | select NET_VENDOR_BROADCOM | 9 | select NET_VENDOR_BROADCOM |
| 7 | select LIBFC | ||
| 8 | select LIBFCOE | ||
| 9 | select CNIC | 10 | select CNIC |
| 10 | ---help--- | 11 | ---help--- |
| 11 | This driver supports FCoE offload for the QLogic NetXtreme II | 12 | This driver supports FCoE offload for the QLogic NetXtreme II |
diff --git a/drivers/scsi/bnx2i/Kconfig b/drivers/scsi/bnx2i/Kconfig index 44ce54e536e5..ba30ff86d581 100644 --- a/drivers/scsi/bnx2i/Kconfig +++ b/drivers/scsi/bnx2i/Kconfig | |||
| @@ -2,6 +2,7 @@ config SCSI_BNX2_ISCSI | |||
| 2 | tristate "QLogic NetXtreme II iSCSI support" | 2 | tristate "QLogic NetXtreme II iSCSI support" |
| 3 | depends on NET | 3 | depends on NET |
| 4 | depends on PCI | 4 | depends on PCI |
| 5 | depends on (IPV6 || IPV6=n) | ||
| 5 | select SCSI_ISCSI_ATTRS | 6 | select SCSI_ISCSI_ATTRS |
| 6 | select NETDEVICES | 7 | select NETDEVICES |
| 7 | select ETHERNET | 8 | select ETHERNET |
diff --git a/drivers/scsi/csiostor/Kconfig b/drivers/scsi/csiostor/Kconfig index 4d03b032aa10..7c7e5085968b 100644 --- a/drivers/scsi/csiostor/Kconfig +++ b/drivers/scsi/csiostor/Kconfig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | config SCSI_CHELSIO_FCOE | 1 | config SCSI_CHELSIO_FCOE |
| 2 | tristate "Chelsio Communications FCoE support" | 2 | tristate "Chelsio Communications FCoE support" |
| 3 | depends on PCI && SCSI | 3 | depends on PCI && SCSI |
| 4 | select SCSI_FC_ATTRS | 4 | depends on SCSI_FC_ATTRS |
| 5 | select FW_LOADER | 5 | select FW_LOADER |
| 6 | help | 6 | help |
| 7 | This driver supports FCoE Offload functionality over | 7 | This driver supports FCoE Offload functionality over |
diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig index 23d607218ae8..113e6c9826a1 100644 --- a/drivers/scsi/qla2xxx/Kconfig +++ b/drivers/scsi/qla2xxx/Kconfig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | config SCSI_QLA_FC | 1 | config SCSI_QLA_FC |
| 2 | tristate "QLogic QLA2XXX Fibre Channel Support" | 2 | tristate "QLogic QLA2XXX Fibre Channel Support" |
| 3 | depends on PCI && SCSI | 3 | depends on PCI && SCSI |
| 4 | select SCSI_FC_ATTRS | 4 | depends on SCSI_FC_ATTRS |
| 5 | select FW_LOADER | 5 | select FW_LOADER |
| 6 | ---help--- | 6 | ---help--- |
| 7 | This qla2xxx driver supports all QLogic Fibre Channel | 7 | This qla2xxx driver supports all QLogic Fibre Channel |
| @@ -31,7 +31,7 @@ config SCSI_QLA_FC | |||
| 31 | config TCM_QLA2XXX | 31 | config TCM_QLA2XXX |
| 32 | tristate "TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode HBAs" | 32 | tristate "TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode HBAs" |
| 33 | depends on SCSI_QLA_FC && TARGET_CORE | 33 | depends on SCSI_QLA_FC && TARGET_CORE |
| 34 | select LIBFC | 34 | depends on LIBFC |
| 35 | select BTREE | 35 | select BTREE |
| 36 | default n | 36 | default n |
| 37 | ---help--- | 37 | ---help--- |
diff --git a/fs/buffer.c b/fs/buffer.c index 8f05111bbb8b..3588a80854b2 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -1022,7 +1022,8 @@ grow_dev_page(struct block_device *bdev, sector_t block, | |||
| 1022 | bh = page_buffers(page); | 1022 | bh = page_buffers(page); |
| 1023 | if (bh->b_size == size) { | 1023 | if (bh->b_size == size) { |
| 1024 | end_block = init_page_buffers(page, bdev, | 1024 | end_block = init_page_buffers(page, bdev, |
| 1025 | index << sizebits, size); | 1025 | (sector_t)index << sizebits, |
| 1026 | size); | ||
| 1026 | goto done; | 1027 | goto done; |
| 1027 | } | 1028 | } |
| 1028 | if (!try_to_free_buffers(page)) | 1029 | if (!try_to_free_buffers(page)) |
| @@ -1043,7 +1044,8 @@ grow_dev_page(struct block_device *bdev, sector_t block, | |||
| 1043 | */ | 1044 | */ |
| 1044 | spin_lock(&inode->i_mapping->private_lock); | 1045 | spin_lock(&inode->i_mapping->private_lock); |
| 1045 | link_dev_buffers(page, bh); | 1046 | link_dev_buffers(page, bh); |
| 1046 | end_block = init_page_buffers(page, bdev, index << sizebits, size); | 1047 | end_block = init_page_buffers(page, bdev, (sector_t)index << sizebits, |
| 1048 | size); | ||
| 1047 | spin_unlock(&inode->i_mapping->private_lock); | 1049 | spin_unlock(&inode->i_mapping->private_lock); |
| 1048 | done: | 1050 | done: |
| 1049 | ret = (block < end_block) ? 1 : -ENXIO; | 1051 | ret = (block < end_block) ? 1 : -ENXIO; |
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 5bf2b41e66d3..83e9c94ca2cf 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c | |||
| @@ -779,7 +779,8 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache, | |||
| 779 | !subdir->d_inode->i_op->lookup || | 779 | !subdir->d_inode->i_op->lookup || |
| 780 | !subdir->d_inode->i_op->mkdir || | 780 | !subdir->d_inode->i_op->mkdir || |
| 781 | !subdir->d_inode->i_op->create || | 781 | !subdir->d_inode->i_op->create || |
| 782 | !subdir->d_inode->i_op->rename || | 782 | (!subdir->d_inode->i_op->rename && |
| 783 | !subdir->d_inode->i_op->rename2) || | ||
| 783 | !subdir->d_inode->i_op->rmdir || | 784 | !subdir->d_inode->i_op->rmdir || |
| 784 | !subdir->d_inode->i_op->unlink) | 785 | !subdir->d_inode->i_op->unlink) |
| 785 | goto check_error; | 786 | goto check_error; |
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c index 4b1fb5ca65b8..25e745b8eb1b 100644 --- a/fs/cachefiles/rdwr.c +++ b/fs/cachefiles/rdwr.c | |||
| @@ -151,7 +151,6 @@ static void cachefiles_read_copier(struct fscache_operation *_op) | |||
| 151 | struct cachefiles_one_read *monitor; | 151 | struct cachefiles_one_read *monitor; |
| 152 | struct cachefiles_object *object; | 152 | struct cachefiles_object *object; |
| 153 | struct fscache_retrieval *op; | 153 | struct fscache_retrieval *op; |
| 154 | struct pagevec pagevec; | ||
| 155 | int error, max; | 154 | int error, max; |
| 156 | 155 | ||
| 157 | op = container_of(_op, struct fscache_retrieval, op); | 156 | op = container_of(_op, struct fscache_retrieval, op); |
| @@ -160,8 +159,6 @@ static void cachefiles_read_copier(struct fscache_operation *_op) | |||
| 160 | 159 | ||
| 161 | _enter("{ino=%lu}", object->backer->d_inode->i_ino); | 160 | _enter("{ino=%lu}", object->backer->d_inode->i_ino); |
| 162 | 161 | ||
| 163 | pagevec_init(&pagevec, 0); | ||
| 164 | |||
| 165 | max = 8; | 162 | max = 8; |
| 166 | spin_lock_irq(&object->work_lock); | 163 | spin_lock_irq(&object->work_lock); |
| 167 | 164 | ||
| @@ -396,7 +393,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op, | |||
| 396 | { | 393 | { |
| 397 | struct cachefiles_object *object; | 394 | struct cachefiles_object *object; |
| 398 | struct cachefiles_cache *cache; | 395 | struct cachefiles_cache *cache; |
| 399 | struct pagevec pagevec; | ||
| 400 | struct inode *inode; | 396 | struct inode *inode; |
| 401 | sector_t block0, block; | 397 | sector_t block0, block; |
| 402 | unsigned shift; | 398 | unsigned shift; |
| @@ -427,8 +423,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op, | |||
| 427 | op->op.flags |= FSCACHE_OP_ASYNC; | 423 | op->op.flags |= FSCACHE_OP_ASYNC; |
| 428 | op->op.processor = cachefiles_read_copier; | 424 | op->op.processor = cachefiles_read_copier; |
| 429 | 425 | ||
| 430 | pagevec_init(&pagevec, 0); | ||
| 431 | |||
| 432 | /* we assume the absence or presence of the first block is a good | 426 | /* we assume the absence or presence of the first block is a good |
| 433 | * enough indication for the page as a whole | 427 | * enough indication for the page as a whole |
| 434 | * - TODO: don't use bmap() for this as it is _not_ actually good | 428 | * - TODO: don't use bmap() for this as it is _not_ actually good |
diff --git a/fs/fscache/object.c b/fs/fscache/object.c index d3b4539f1651..da032daf0e0d 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c | |||
| @@ -982,6 +982,7 @@ nomem: | |||
| 982 | submit_op_failed: | 982 | submit_op_failed: |
| 983 | clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags); | 983 | clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags); |
| 984 | spin_unlock(&cookie->lock); | 984 | spin_unlock(&cookie->lock); |
| 985 | fscache_unuse_cookie(object); | ||
| 985 | kfree(op); | 986 | kfree(op); |
| 986 | _leave(" [EIO]"); | 987 | _leave(" [EIO]"); |
| 987 | return transit_to(KILL_OBJECT); | 988 | return transit_to(KILL_OBJECT); |
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 85332b9d19d1..de33b3fccca6 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
| @@ -44,6 +44,19 @@ void __fscache_wait_on_page_write(struct fscache_cookie *cookie, struct page *pa | |||
| 44 | EXPORT_SYMBOL(__fscache_wait_on_page_write); | 44 | EXPORT_SYMBOL(__fscache_wait_on_page_write); |
| 45 | 45 | ||
| 46 | /* | 46 | /* |
| 47 | * wait for a page to finish being written to the cache. Put a timeout here | ||
| 48 | * since we might be called recursively via parent fs. | ||
| 49 | */ | ||
| 50 | static | ||
| 51 | bool release_page_wait_timeout(struct fscache_cookie *cookie, struct page *page) | ||
| 52 | { | ||
| 53 | wait_queue_head_t *wq = bit_waitqueue(&cookie->flags, 0); | ||
| 54 | |||
| 55 | return wait_event_timeout(*wq, !__fscache_check_page_write(cookie, page), | ||
| 56 | HZ); | ||
| 57 | } | ||
| 58 | |||
| 59 | /* | ||
| 47 | * decide whether a page can be released, possibly by cancelling a store to it | 60 | * decide whether a page can be released, possibly by cancelling a store to it |
| 48 | * - we're allowed to sleep if __GFP_WAIT is flagged | 61 | * - we're allowed to sleep if __GFP_WAIT is flagged |
| 49 | */ | 62 | */ |
| @@ -115,7 +128,10 @@ page_busy: | |||
| 115 | } | 128 | } |
| 116 | 129 | ||
| 117 | fscache_stat(&fscache_n_store_vmscan_wait); | 130 | fscache_stat(&fscache_n_store_vmscan_wait); |
| 118 | __fscache_wait_on_page_write(cookie, page); | 131 | if (!release_page_wait_timeout(cookie, page)) |
| 132 | _debug("fscache writeout timeout page: %p{%lx}", | ||
| 133 | page, page->index); | ||
| 134 | |||
| 119 | gfp &= ~__GFP_WAIT; | 135 | gfp &= ~__GFP_WAIT; |
| 120 | goto try_again; | 136 | goto try_again; |
| 121 | } | 137 | } |
| @@ -182,7 +198,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) | |||
| 182 | { | 198 | { |
| 183 | struct fscache_operation *op; | 199 | struct fscache_operation *op; |
| 184 | struct fscache_object *object; | 200 | struct fscache_object *object; |
| 185 | bool wake_cookie; | 201 | bool wake_cookie = false; |
| 186 | 202 | ||
| 187 | _enter("%p", cookie); | 203 | _enter("%p", cookie); |
| 188 | 204 | ||
| @@ -212,15 +228,16 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) | |||
| 212 | 228 | ||
| 213 | __fscache_use_cookie(cookie); | 229 | __fscache_use_cookie(cookie); |
| 214 | if (fscache_submit_exclusive_op(object, op) < 0) | 230 | if (fscache_submit_exclusive_op(object, op) < 0) |
| 215 | goto nobufs; | 231 | goto nobufs_dec; |
| 216 | spin_unlock(&cookie->lock); | 232 | spin_unlock(&cookie->lock); |
| 217 | fscache_stat(&fscache_n_attr_changed_ok); | 233 | fscache_stat(&fscache_n_attr_changed_ok); |
| 218 | fscache_put_operation(op); | 234 | fscache_put_operation(op); |
| 219 | _leave(" = 0"); | 235 | _leave(" = 0"); |
| 220 | return 0; | 236 | return 0; |
| 221 | 237 | ||
| 222 | nobufs: | 238 | nobufs_dec: |
| 223 | wake_cookie = __fscache_unuse_cookie(cookie); | 239 | wake_cookie = __fscache_unuse_cookie(cookie); |
| 240 | nobufs: | ||
| 224 | spin_unlock(&cookie->lock); | 241 | spin_unlock(&cookie->lock); |
| 225 | kfree(op); | 242 | kfree(op); |
| 226 | if (wake_cookie) | 243 | if (wake_cookie) |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 511c6e0d21a9..a5b7d7cfcedf 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -209,6 +209,7 @@ enum { | |||
| 209 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 209 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
| 210 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, | 210 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, |
| 211 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, | 211 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, |
| 212 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, | ||
| 212 | }; | 213 | }; |
| 213 | 214 | ||
| 214 | enum mlx4_event { | 215 | enum mlx4_event { |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 7040dc98ff8b..5f4e36cf0091 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -56,7 +56,8 @@ enum mlx4_qp_optpar { | |||
| 56 | MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, | 56 | MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, |
| 57 | MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, | 57 | MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, |
| 58 | MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16, | 58 | MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16, |
| 59 | MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20 | 59 | MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20, |
| 60 | MLX4_QP_OPTPAR_VLAN_STRIPPING = 1 << 21, | ||
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | enum mlx4_qp_state { | 63 | enum mlx4_qp_state { |
| @@ -423,13 +424,20 @@ struct mlx4_wqe_inline_seg { | |||
| 423 | 424 | ||
| 424 | enum mlx4_update_qp_attr { | 425 | enum mlx4_update_qp_attr { |
| 425 | MLX4_UPDATE_QP_SMAC = 1 << 0, | 426 | MLX4_UPDATE_QP_SMAC = 1 << 0, |
| 427 | MLX4_UPDATE_QP_VSD = 1 << 2, | ||
| 428 | MLX4_UPDATE_QP_SUPPORTED_ATTRS = (1 << 2) - 1 | ||
| 429 | }; | ||
| 430 | |||
| 431 | enum mlx4_update_qp_params_flags { | ||
| 432 | MLX4_UPDATE_QP_PARAMS_FLAGS_VSD_ENABLE = 1 << 0, | ||
| 426 | }; | 433 | }; |
| 427 | 434 | ||
| 428 | struct mlx4_update_qp_params { | 435 | struct mlx4_update_qp_params { |
| 429 | u8 smac_index; | 436 | u8 smac_index; |
| 437 | u32 flags; | ||
| 430 | }; | 438 | }; |
| 431 | 439 | ||
| 432 | int mlx4_update_qp(struct mlx4_dev *dev, struct mlx4_qp *qp, | 440 | int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, |
| 433 | enum mlx4_update_qp_attr attr, | 441 | enum mlx4_update_qp_attr attr, |
| 434 | struct mlx4_update_qp_params *params); | 442 | struct mlx4_update_qp_params *params); |
| 435 | int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 443 | int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index a0cc2e95ed1b..b996e6cde6bb 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -419,7 +419,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
| 419 | alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \ | 419 | alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \ |
| 420 | 1, (name)) | 420 | 1, (name)) |
| 421 | #define create_singlethread_workqueue(name) \ | 421 | #define create_singlethread_workqueue(name) \ |
| 422 | alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, (name)) | 422 | alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name) |
| 423 | 423 | ||
| 424 | extern void destroy_workqueue(struct workqueue_struct *wq); | 424 | extern void destroy_workqueue(struct workqueue_struct *wq); |
| 425 | 425 | ||
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index f679877bb601..ec51e673b4b6 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -204,6 +204,7 @@ void ipv6_sock_ac_close(struct sock *sk); | |||
| 204 | 204 | ||
| 205 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); | 205 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); |
| 206 | int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 206 | int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
| 207 | void ipv6_ac_destroy_dev(struct inet6_dev *idev); | ||
| 207 | bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | 208 | bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, |
| 208 | const struct in6_addr *addr); | 209 | const struct in6_addr *addr); |
| 209 | bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev, | 210 | bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev, |
diff --git a/include/net/dst.h b/include/net/dst.h index 71c60f42be48..a8ae4e760778 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -480,6 +480,7 @@ void dst_init(void); | |||
| 480 | /* Flags for xfrm_lookup flags argument. */ | 480 | /* Flags for xfrm_lookup flags argument. */ |
| 481 | enum { | 481 | enum { |
| 482 | XFRM_LOOKUP_ICMP = 1 << 0, | 482 | XFRM_LOOKUP_ICMP = 1 << 0, |
| 483 | XFRM_LOOKUP_QUEUE = 1 << 1, | ||
| 483 | }; | 484 | }; |
| 484 | 485 | ||
| 485 | struct flowi; | 486 | struct flowi; |
| @@ -490,7 +491,16 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, | |||
| 490 | int flags) | 491 | int flags) |
| 491 | { | 492 | { |
| 492 | return dst_orig; | 493 | return dst_orig; |
| 493 | } | 494 | } |
| 495 | |||
| 496 | static inline struct dst_entry *xfrm_lookup_route(struct net *net, | ||
| 497 | struct dst_entry *dst_orig, | ||
| 498 | const struct flowi *fl, | ||
| 499 | struct sock *sk, | ||
| 500 | int flags) | ||
| 501 | { | ||
| 502 | return dst_orig; | ||
| 503 | } | ||
| 494 | 504 | ||
| 495 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | 505 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) |
| 496 | { | 506 | { |
| @@ -502,6 +512,10 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | |||
| 502 | const struct flowi *fl, struct sock *sk, | 512 | const struct flowi *fl, struct sock *sk, |
| 503 | int flags); | 513 | int flags); |
| 504 | 514 | ||
| 515 | struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig, | ||
| 516 | const struct flowi *fl, struct sock *sk, | ||
| 517 | int flags); | ||
| 518 | |||
| 505 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ | 519 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ |
| 506 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | 520 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) |
| 507 | { | 521 | { |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 93695f0e22a5..af10c2cf8a1d 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -394,4 +394,12 @@ static inline int genl_set_err(struct genl_family *family, struct net *net, | |||
| 394 | return netlink_set_err(net->genl_sock, portid, group, code); | 394 | return netlink_set_err(net->genl_sock, portid, group, code); |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | static inline int genl_has_listeners(struct genl_family *family, | ||
| 398 | struct sock *sk, unsigned int group) | ||
| 399 | { | ||
| 400 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
| 401 | return -EINVAL; | ||
| 402 | group = family->mcgrp_offset + group; | ||
| 403 | return netlink_has_listeners(sk, group); | ||
| 404 | } | ||
| 397 | #endif /* __NET_GENERIC_NETLINK_H */ | 405 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a3cfb8ebeb53..620e086c0cbe 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -231,7 +231,8 @@ struct qdisc_skb_cb { | |||
| 231 | unsigned int pkt_len; | 231 | unsigned int pkt_len; |
| 232 | u16 slave_dev_queue_mapping; | 232 | u16 slave_dev_queue_mapping; |
| 233 | u16 _pad; | 233 | u16 _pad; |
| 234 | unsigned char data[24]; | 234 | #define QDISC_CB_PRIV_LEN 20 |
| 235 | unsigned char data[QDISC_CB_PRIV_LEN]; | ||
| 235 | }; | 236 | }; |
| 236 | 237 | ||
| 237 | static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) | 238 | static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) |
diff --git a/include/rdma/ib_umem.h b/include/rdma/ib_umem.h index 1ea0b65c4cfb..a2bf41e0bde9 100644 --- a/include/rdma/ib_umem.h +++ b/include/rdma/ib_umem.h | |||
| @@ -47,6 +47,7 @@ struct ib_umem { | |||
| 47 | int writable; | 47 | int writable; |
| 48 | int hugetlb; | 48 | int hugetlb; |
| 49 | struct work_struct work; | 49 | struct work_struct work; |
| 50 | struct pid *pid; | ||
| 50 | struct mm_struct *mm; | 51 | struct mm_struct *mm; |
| 51 | unsigned long diff; | 52 | unsigned long diff; |
| 52 | struct sg_table sg_head; | 53 | struct sg_table sg_head; |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 940aced4ed00..3a73f995a81e 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -3985,7 +3985,6 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, | |||
| 3985 | 3985 | ||
| 3986 | l = cgroup_pidlist_find_create(cgrp, type); | 3986 | l = cgroup_pidlist_find_create(cgrp, type); |
| 3987 | if (!l) { | 3987 | if (!l) { |
| 3988 | mutex_unlock(&cgrp->pidlist_mutex); | ||
| 3989 | pidlist_free(array); | 3988 | pidlist_free(array); |
| 3990 | return -ENOMEM; | 3989 | return -ENOMEM; |
| 3991 | } | 3990 | } |
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index a2c78810ebc1..7b36e4d40ed7 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <linux/hash.h> | 23 | #include <linux/hash.h> |
| 24 | #include <linux/random.h> | 24 | #include <linux/random.h> |
| 25 | #include <linux/rhashtable.h> | 25 | #include <linux/rhashtable.h> |
| 26 | #include <linux/log2.h> | ||
| 27 | 26 | ||
| 28 | #define HASH_DEFAULT_SIZE 64UL | 27 | #define HASH_DEFAULT_SIZE 64UL |
| 29 | #define HASH_MIN_SIZE 4UL | 28 | #define HASH_MIN_SIZE 4UL |
diff --git a/mm/memory.c b/mm/memory.c index adeac306610f..d17f1bcd2a91 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -118,6 +118,8 @@ __setup("norandmaps", disable_randmaps); | |||
| 118 | unsigned long zero_pfn __read_mostly; | 118 | unsigned long zero_pfn __read_mostly; |
| 119 | unsigned long highest_memmap_pfn __read_mostly; | 119 | unsigned long highest_memmap_pfn __read_mostly; |
| 120 | 120 | ||
| 121 | EXPORT_SYMBOL(zero_pfn); | ||
| 122 | |||
| 121 | /* | 123 | /* |
| 122 | * CONFIG_MMU architectures set up ZERO_PAGE in their paging_init() | 124 | * CONFIG_MMU architectures set up ZERO_PAGE in their paging_init() |
| 123 | */ | 125 | */ |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 62a7fa2e3569..b6c04cbcfdc5 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
| @@ -309,6 +309,9 @@ struct br_input_skb_cb { | |||
| 309 | int igmp; | 309 | int igmp; |
| 310 | int mrouters_only; | 310 | int mrouters_only; |
| 311 | #endif | 311 | #endif |
| 312 | #ifdef CONFIG_BRIDGE_VLAN_FILTERING | ||
| 313 | bool vlan_filtered; | ||
| 314 | #endif | ||
| 312 | }; | 315 | }; |
| 313 | 316 | ||
| 314 | #define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb) | 317 | #define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb) |
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index e1bcd653899b..3ba57fcdcd13 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c | |||
| @@ -27,9 +27,13 @@ static void __vlan_add_flags(struct net_port_vlans *v, u16 vid, u16 flags) | |||
| 27 | { | 27 | { |
| 28 | if (flags & BRIDGE_VLAN_INFO_PVID) | 28 | if (flags & BRIDGE_VLAN_INFO_PVID) |
| 29 | __vlan_add_pvid(v, vid); | 29 | __vlan_add_pvid(v, vid); |
| 30 | else | ||
| 31 | __vlan_delete_pvid(v, vid); | ||
| 30 | 32 | ||
| 31 | if (flags & BRIDGE_VLAN_INFO_UNTAGGED) | 33 | if (flags & BRIDGE_VLAN_INFO_UNTAGGED) |
| 32 | set_bit(vid, v->untagged_bitmap); | 34 | set_bit(vid, v->untagged_bitmap); |
| 35 | else | ||
| 36 | clear_bit(vid, v->untagged_bitmap); | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) | 39 | static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) |
| @@ -125,7 +129,8 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br, | |||
| 125 | { | 129 | { |
| 126 | u16 vid; | 130 | u16 vid; |
| 127 | 131 | ||
| 128 | if (!br->vlan_enabled) | 132 | /* If this packet was not filtered at input, let it pass */ |
| 133 | if (!BR_INPUT_SKB_CB(skb)->vlan_filtered) | ||
| 129 | goto out; | 134 | goto out; |
| 130 | 135 | ||
| 131 | /* Vlan filter table must be configured at this point. The | 136 | /* Vlan filter table must be configured at this point. The |
| @@ -164,8 +169,10 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, | |||
| 164 | /* If VLAN filtering is disabled on the bridge, all packets are | 169 | /* If VLAN filtering is disabled on the bridge, all packets are |
| 165 | * permitted. | 170 | * permitted. |
| 166 | */ | 171 | */ |
| 167 | if (!br->vlan_enabled) | 172 | if (!br->vlan_enabled) { |
| 173 | BR_INPUT_SKB_CB(skb)->vlan_filtered = false; | ||
| 168 | return true; | 174 | return true; |
| 175 | } | ||
| 169 | 176 | ||
| 170 | /* If there are no vlan in the permitted list, all packets are | 177 | /* If there are no vlan in the permitted list, all packets are |
| 171 | * rejected. | 178 | * rejected. |
| @@ -173,6 +180,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, | |||
| 173 | if (!v) | 180 | if (!v) |
| 174 | goto drop; | 181 | goto drop; |
| 175 | 182 | ||
| 183 | BR_INPUT_SKB_CB(skb)->vlan_filtered = true; | ||
| 176 | proto = br->vlan_proto; | 184 | proto = br->vlan_proto; |
| 177 | 185 | ||
| 178 | /* If vlan tx offload is disabled on bridge device and frame was | 186 | /* If vlan tx offload is disabled on bridge device and frame was |
| @@ -251,7 +259,8 @@ bool br_allowed_egress(struct net_bridge *br, | |||
| 251 | { | 259 | { |
| 252 | u16 vid; | 260 | u16 vid; |
| 253 | 261 | ||
| 254 | if (!br->vlan_enabled) | 262 | /* If this packet was not filtered at input, let it pass */ |
| 263 | if (!BR_INPUT_SKB_CB(skb)->vlan_filtered) | ||
| 255 | return true; | 264 | return true; |
| 256 | 265 | ||
| 257 | if (!v) | 266 | if (!v) |
| @@ -270,6 +279,7 @@ bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid) | |||
| 270 | struct net_bridge *br = p->br; | 279 | struct net_bridge *br = p->br; |
| 271 | struct net_port_vlans *v; | 280 | struct net_port_vlans *v; |
| 272 | 281 | ||
| 282 | /* If filtering was disabled at input, let it pass. */ | ||
| 273 | if (!br->vlan_enabled) | 283 | if (!br->vlan_enabled) |
| 274 | return true; | 284 | return true; |
| 275 | 285 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index ab9a16530c36..cf8a95f48cff 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -4809,9 +4809,14 @@ static void netdev_adjacent_sysfs_del(struct net_device *dev, | |||
| 4809 | sysfs_remove_link(&(dev->dev.kobj), linkname); | 4809 | sysfs_remove_link(&(dev->dev.kobj), linkname); |
| 4810 | } | 4810 | } |
| 4811 | 4811 | ||
| 4812 | #define netdev_adjacent_is_neigh_list(dev, dev_list) \ | 4812 | static inline bool netdev_adjacent_is_neigh_list(struct net_device *dev, |
| 4813 | (dev_list == &dev->adj_list.upper || \ | 4813 | struct net_device *adj_dev, |
| 4814 | dev_list == &dev->adj_list.lower) | 4814 | struct list_head *dev_list) |
| 4815 | { | ||
| 4816 | return (dev_list == &dev->adj_list.upper || | ||
| 4817 | dev_list == &dev->adj_list.lower) && | ||
| 4818 | net_eq(dev_net(dev), dev_net(adj_dev)); | ||
| 4819 | } | ||
| 4815 | 4820 | ||
| 4816 | static int __netdev_adjacent_dev_insert(struct net_device *dev, | 4821 | static int __netdev_adjacent_dev_insert(struct net_device *dev, |
| 4817 | struct net_device *adj_dev, | 4822 | struct net_device *adj_dev, |
| @@ -4841,7 +4846,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev, | |||
| 4841 | pr_debug("dev_hold for %s, because of link added from %s to %s\n", | 4846 | pr_debug("dev_hold for %s, because of link added from %s to %s\n", |
| 4842 | adj_dev->name, dev->name, adj_dev->name); | 4847 | adj_dev->name, dev->name, adj_dev->name); |
| 4843 | 4848 | ||
| 4844 | if (netdev_adjacent_is_neigh_list(dev, dev_list)) { | 4849 | if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list)) { |
| 4845 | ret = netdev_adjacent_sysfs_add(dev, adj_dev, dev_list); | 4850 | ret = netdev_adjacent_sysfs_add(dev, adj_dev, dev_list); |
| 4846 | if (ret) | 4851 | if (ret) |
| 4847 | goto free_adj; | 4852 | goto free_adj; |
| @@ -4862,7 +4867,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev, | |||
| 4862 | return 0; | 4867 | return 0; |
| 4863 | 4868 | ||
| 4864 | remove_symlinks: | 4869 | remove_symlinks: |
| 4865 | if (netdev_adjacent_is_neigh_list(dev, dev_list)) | 4870 | if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list)) |
| 4866 | netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list); | 4871 | netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list); |
| 4867 | free_adj: | 4872 | free_adj: |
| 4868 | kfree(adj); | 4873 | kfree(adj); |
| @@ -4895,8 +4900,7 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev, | |||
| 4895 | if (adj->master) | 4900 | if (adj->master) |
| 4896 | sysfs_remove_link(&(dev->dev.kobj), "master"); | 4901 | sysfs_remove_link(&(dev->dev.kobj), "master"); |
| 4897 | 4902 | ||
| 4898 | if (netdev_adjacent_is_neigh_list(dev, dev_list) && | 4903 | if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list)) |
| 4899 | net_eq(dev_net(dev),dev_net(adj_dev))) | ||
| 4900 | netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list); | 4904 | netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list); |
| 4901 | 4905 | ||
| 4902 | list_del_rcu(&adj->list); | 4906 | list_del_rcu(&adj->list); |
diff --git a/net/core/sock.c b/net/core/sock.c index d372b4bd3f99..9c3f823e76a9 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -1866,7 +1866,7 @@ EXPORT_SYMBOL(sock_alloc_send_skb); | |||
| 1866 | * skb_page_frag_refill - check that a page_frag contains enough room | 1866 | * skb_page_frag_refill - check that a page_frag contains enough room |
| 1867 | * @sz: minimum size of the fragment we want to get | 1867 | * @sz: minimum size of the fragment we want to get |
| 1868 | * @pfrag: pointer to page_frag | 1868 | * @pfrag: pointer to page_frag |
| 1869 | * @prio: priority for memory allocation | 1869 | * @gfp: priority for memory allocation |
| 1870 | * | 1870 | * |
| 1871 | * Note: While this allocator tries to use high order pages, there is | 1871 | * Note: While this allocator tries to use high order pages, there is |
| 1872 | * no guarantee that allocations succeed. Therefore, @sz MUST be | 1872 | * no guarantee that allocations succeed. Therefore, @sz MUST be |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index afed1aac2638..bd41dd1948b6 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
| @@ -79,10 +79,10 @@ static void __tunnel_dst_set(struct ip_tunnel_dst *idst, | |||
| 79 | idst->saddr = saddr; | 79 | idst->saddr = saddr; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static void tunnel_dst_set(struct ip_tunnel *t, | 82 | static noinline void tunnel_dst_set(struct ip_tunnel *t, |
| 83 | struct dst_entry *dst, __be32 saddr) | 83 | struct dst_entry *dst, __be32 saddr) |
| 84 | { | 84 | { |
| 85 | __tunnel_dst_set(this_cpu_ptr(t->dst_cache), dst, saddr); | 85 | __tunnel_dst_set(raw_cpu_ptr(t->dst_cache), dst, saddr); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static void tunnel_dst_reset(struct ip_tunnel *t) | 88 | static void tunnel_dst_reset(struct ip_tunnel *t) |
| @@ -106,7 +106,7 @@ static struct rtable *tunnel_rtable_get(struct ip_tunnel *t, | |||
| 106 | struct dst_entry *dst; | 106 | struct dst_entry *dst; |
| 107 | 107 | ||
| 108 | rcu_read_lock(); | 108 | rcu_read_lock(); |
| 109 | idst = this_cpu_ptr(t->dst_cache); | 109 | idst = raw_cpu_ptr(t->dst_cache); |
| 110 | dst = rcu_dereference(idst->dst); | 110 | dst = rcu_dereference(idst->dst); |
| 111 | if (dst && !atomic_inc_not_zero(&dst->__refcnt)) | 111 | if (dst && !atomic_inc_not_zero(&dst->__refcnt)) |
| 112 | dst = NULL; | 112 | dst = NULL; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index eaa4b000c7b4..173e7ea54c70 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -2265,9 +2265,9 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4, | |||
| 2265 | return rt; | 2265 | return rt; |
| 2266 | 2266 | ||
| 2267 | if (flp4->flowi4_proto) | 2267 | if (flp4->flowi4_proto) |
| 2268 | rt = (struct rtable *) xfrm_lookup(net, &rt->dst, | 2268 | rt = (struct rtable *)xfrm_lookup_route(net, &rt->dst, |
| 2269 | flowi4_to_flowi(flp4), | 2269 | flowi4_to_flowi(flp4), |
| 2270 | sk, 0); | 2270 | sk, 0); |
| 2271 | 2271 | ||
| 2272 | return rt; | 2272 | return rt; |
| 2273 | } | 2273 | } |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index fc1fac2a0528..3342ee64f2e3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -3094,11 +3094,13 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
| 3094 | 3094 | ||
| 3095 | write_unlock_bh(&idev->lock); | 3095 | write_unlock_bh(&idev->lock); |
| 3096 | 3096 | ||
| 3097 | /* Step 5: Discard multicast list */ | 3097 | /* Step 5: Discard anycast and multicast list */ |
| 3098 | if (how) | 3098 | if (how) { |
| 3099 | ipv6_ac_destroy_dev(idev); | ||
| 3099 | ipv6_mc_destroy_dev(idev); | 3100 | ipv6_mc_destroy_dev(idev); |
| 3100 | else | 3101 | } else { |
| 3101 | ipv6_mc_down(idev); | 3102 | ipv6_mc_down(idev); |
| 3103 | } | ||
| 3102 | 3104 | ||
| 3103 | idev->tstamp = jiffies; | 3105 | idev->tstamp = jiffies; |
| 3104 | 3106 | ||
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index ff2de7d9d8e6..9a386842fd62 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
| @@ -351,6 +351,27 @@ static int ipv6_dev_ac_dec(struct net_device *dev, const struct in6_addr *addr) | |||
| 351 | return __ipv6_dev_ac_dec(idev, addr); | 351 | return __ipv6_dev_ac_dec(idev, addr); |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | void ipv6_ac_destroy_dev(struct inet6_dev *idev) | ||
| 355 | { | ||
| 356 | struct ifacaddr6 *aca; | ||
| 357 | |||
| 358 | write_lock_bh(&idev->lock); | ||
| 359 | while ((aca = idev->ac_list) != NULL) { | ||
| 360 | idev->ac_list = aca->aca_next; | ||
| 361 | write_unlock_bh(&idev->lock); | ||
| 362 | |||
| 363 | addrconf_leave_solict(idev, &aca->aca_addr); | ||
| 364 | |||
| 365 | dst_hold(&aca->aca_rt->dst); | ||
| 366 | ip6_del_rt(aca->aca_rt); | ||
| 367 | |||
| 368 | aca_put(aca); | ||
| 369 | |||
| 370 | write_lock_bh(&idev->lock); | ||
| 371 | } | ||
| 372 | write_unlock_bh(&idev->lock); | ||
| 373 | } | ||
| 374 | |||
| 354 | /* | 375 | /* |
| 355 | * check if the interface has this anycast address | 376 | * check if the interface has this anycast address |
| 356 | * called with rcu_read_lock() | 377 | * called with rcu_read_lock() |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 315a55d66079..0a3448b2888f 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -1009,7 +1009,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
| 1009 | if (final_dst) | 1009 | if (final_dst) |
| 1010 | fl6->daddr = *final_dst; | 1010 | fl6->daddr = *final_dst; |
| 1011 | 1011 | ||
| 1012 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 1012 | return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
| 1013 | } | 1013 | } |
| 1014 | EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); | 1014 | EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); |
| 1015 | 1015 | ||
| @@ -1041,7 +1041,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
| 1041 | if (final_dst) | 1041 | if (final_dst) |
| 1042 | fl6->daddr = *final_dst; | 1042 | fl6->daddr = *final_dst; |
| 1043 | 1043 | ||
| 1044 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 1044 | return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
| 1045 | } | 1045 | } |
| 1046 | EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow); | 1046 | EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow); |
| 1047 | 1047 | ||
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 441875f03750..a1e433b88c66 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
| @@ -1822,7 +1822,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
| 1822 | sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; | 1822 | sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; |
| 1823 | if (sdata->vif.bss_conf.use_short_slot) | 1823 | if (sdata->vif.bss_conf.use_short_slot) |
| 1824 | sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; | 1824 | sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; |
| 1825 | sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period; | 1825 | sinfo->bss_param.dtim_period = sdata->vif.bss_conf.dtim_period; |
| 1826 | sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int; | 1826 | sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int; |
| 1827 | 1827 | ||
| 1828 | sinfo->sta_flags.set = 0; | 1828 | sinfo->sta_flags.set = 0; |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 91d66b7e64ac..64dc864a417f 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
| @@ -78,11 +78,12 @@ static const struct genl_multicast_group ovs_dp_vport_multicast_group = { | |||
| 78 | 78 | ||
| 79 | /* Check if need to build a reply message. | 79 | /* Check if need to build a reply message. |
| 80 | * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */ | 80 | * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */ |
| 81 | static bool ovs_must_notify(struct genl_info *info, | 81 | static bool ovs_must_notify(struct genl_family *family, struct genl_info *info, |
| 82 | const struct genl_multicast_group *grp) | 82 | unsigned int group) |
| 83 | { | 83 | { |
| 84 | return info->nlhdr->nlmsg_flags & NLM_F_ECHO || | 84 | return info->nlhdr->nlmsg_flags & NLM_F_ECHO || |
| 85 | netlink_has_listeners(genl_info_net(info)->genl_sock, 0); | 85 | genl_has_listeners(family, genl_info_net(info)->genl_sock, |
| 86 | group); | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | static void ovs_notify(struct genl_family *family, | 89 | static void ovs_notify(struct genl_family *family, |
| @@ -763,7 +764,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *act | |||
| 763 | { | 764 | { |
| 764 | struct sk_buff *skb; | 765 | struct sk_buff *skb; |
| 765 | 766 | ||
| 766 | if (!always && !ovs_must_notify(info, &ovs_dp_flow_multicast_group)) | 767 | if (!always && !ovs_must_notify(&dp_flow_genl_family, info, 0)) |
| 767 | return NULL; | 768 | return NULL; |
| 768 | 769 | ||
| 769 | skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL); | 770 | skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL); |
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 02a86a27fd84..5fa54dd78e25 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c | |||
| @@ -163,6 +163,7 @@ static const struct acpi_device_id rfkill_acpi_match[] = { | |||
| 163 | { "LNV4752", RFKILL_TYPE_GPS }, | 163 | { "LNV4752", RFKILL_TYPE_GPS }, |
| 164 | { }, | 164 | { }, |
| 165 | }; | 165 | }; |
| 166 | MODULE_DEVICE_TABLE(acpi, rfkill_acpi_match); | ||
| 166 | #endif | 167 | #endif |
| 167 | 168 | ||
| 168 | static struct platform_driver rfkill_gpio_driver = { | 169 | static struct platform_driver rfkill_gpio_driver = { |
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index b45d080e64a7..1b24191167f1 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c | |||
| @@ -1143,7 +1143,7 @@ static long rxrpc_read(const struct key *key, | |||
| 1143 | if (copy_to_user(xdr, (s), _l) != 0) \ | 1143 | if (copy_to_user(xdr, (s), _l) != 0) \ |
| 1144 | goto fault; \ | 1144 | goto fault; \ |
| 1145 | if (_l & 3 && \ | 1145 | if (_l & 3 && \ |
| 1146 | copy_to_user((u8 *)xdr + _l, &zero, 4 - (_l & 3)) != 0) \ | 1146 | copy_to_user((u8 __user *)xdr + _l, &zero, 4 - (_l & 3)) != 0) \ |
| 1147 | goto fault; \ | 1147 | goto fault; \ |
| 1148 | xdr += (_l + 3) >> 2; \ | 1148 | xdr += (_l + 3) >> 2; \ |
| 1149 | } while(0) | 1149 | } while(0) |
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index ed30e436128b..fb666d1e4de3 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c | |||
| @@ -133,10 +133,16 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx) | |||
| 133 | --sch->q.qlen; | 133 | --sch->q.qlen; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | /* private part of skb->cb[] that a qdisc is allowed to use | ||
| 137 | * is limited to QDISC_CB_PRIV_LEN bytes. | ||
| 138 | * As a flow key might be too large, we store a part of it only. | ||
| 139 | */ | ||
| 140 | #define CHOKE_K_LEN min_t(u32, sizeof(struct flow_keys), QDISC_CB_PRIV_LEN - 3) | ||
| 141 | |||
| 136 | struct choke_skb_cb { | 142 | struct choke_skb_cb { |
| 137 | u16 classid; | 143 | u16 classid; |
| 138 | u8 keys_valid; | 144 | u8 keys_valid; |
| 139 | struct flow_keys keys; | 145 | u8 keys[QDISC_CB_PRIV_LEN - 3]; |
| 140 | }; | 146 | }; |
| 141 | 147 | ||
| 142 | static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb) | 148 | static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb) |
| @@ -163,22 +169,26 @@ static u16 choke_get_classid(const struct sk_buff *skb) | |||
| 163 | static bool choke_match_flow(struct sk_buff *skb1, | 169 | static bool choke_match_flow(struct sk_buff *skb1, |
| 164 | struct sk_buff *skb2) | 170 | struct sk_buff *skb2) |
| 165 | { | 171 | { |
| 172 | struct flow_keys temp; | ||
| 173 | |||
| 166 | if (skb1->protocol != skb2->protocol) | 174 | if (skb1->protocol != skb2->protocol) |
| 167 | return false; | 175 | return false; |
| 168 | 176 | ||
| 169 | if (!choke_skb_cb(skb1)->keys_valid) { | 177 | if (!choke_skb_cb(skb1)->keys_valid) { |
| 170 | choke_skb_cb(skb1)->keys_valid = 1; | 178 | choke_skb_cb(skb1)->keys_valid = 1; |
| 171 | skb_flow_dissect(skb1, &choke_skb_cb(skb1)->keys); | 179 | skb_flow_dissect(skb1, &temp); |
| 180 | memcpy(&choke_skb_cb(skb1)->keys, &temp, CHOKE_K_LEN); | ||
| 172 | } | 181 | } |
| 173 | 182 | ||
| 174 | if (!choke_skb_cb(skb2)->keys_valid) { | 183 | if (!choke_skb_cb(skb2)->keys_valid) { |
| 175 | choke_skb_cb(skb2)->keys_valid = 1; | 184 | choke_skb_cb(skb2)->keys_valid = 1; |
| 176 | skb_flow_dissect(skb2, &choke_skb_cb(skb2)->keys); | 185 | skb_flow_dissect(skb2, &temp); |
| 186 | memcpy(&choke_skb_cb(skb2)->keys, &temp, CHOKE_K_LEN); | ||
| 177 | } | 187 | } |
| 178 | 188 | ||
| 179 | return !memcmp(&choke_skb_cb(skb1)->keys, | 189 | return !memcmp(&choke_skb_cb(skb1)->keys, |
| 180 | &choke_skb_cb(skb2)->keys, | 190 | &choke_skb_cb(skb2)->keys, |
| 181 | sizeof(struct flow_keys)); | 191 | CHOKE_K_LEN); |
| 182 | } | 192 | } |
| 183 | 193 | ||
| 184 | /* | 194 | /* |
diff --git a/net/socket.c b/net/socket.c index 2e2586e2dee1..4cdbc107606f 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -1996,6 +1996,9 @@ static int copy_msghdr_from_user(struct msghdr *kmsg, | |||
| 1996 | if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) | 1996 | if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) |
| 1997 | return -EFAULT; | 1997 | return -EFAULT; |
| 1998 | 1998 | ||
| 1999 | if (kmsg->msg_name == NULL) | ||
| 2000 | kmsg->msg_namelen = 0; | ||
| 2001 | |||
| 1999 | if (kmsg->msg_namelen < 0) | 2002 | if (kmsg->msg_namelen < 0) |
| 2000 | return -EINVAL; | 2003 | return -EINVAL; |
| 2001 | 2004 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index df7b1332a1ec..7257164af91b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -6969,6 +6969,9 @@ void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp) | |||
| 6969 | struct nlattr *data = ((void **)skb->cb)[2]; | 6969 | struct nlattr *data = ((void **)skb->cb)[2]; |
| 6970 | enum nl80211_multicast_groups mcgrp = NL80211_MCGRP_TESTMODE; | 6970 | enum nl80211_multicast_groups mcgrp = NL80211_MCGRP_TESTMODE; |
| 6971 | 6971 | ||
| 6972 | /* clear CB data for netlink core to own from now on */ | ||
| 6973 | memset(skb->cb, 0, sizeof(skb->cb)); | ||
| 6974 | |||
| 6972 | nla_nest_end(skb, data); | 6975 | nla_nest_end(skb, data); |
| 6973 | genlmsg_end(skb, hdr); | 6976 | genlmsg_end(skb, hdr); |
| 6974 | 6977 | ||
| @@ -9294,6 +9297,9 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb) | |||
| 9294 | void *hdr = ((void **)skb->cb)[1]; | 9297 | void *hdr = ((void **)skb->cb)[1]; |
| 9295 | struct nlattr *data = ((void **)skb->cb)[2]; | 9298 | struct nlattr *data = ((void **)skb->cb)[2]; |
| 9296 | 9299 | ||
| 9300 | /* clear CB data for netlink core to own from now on */ | ||
| 9301 | memset(skb->cb, 0, sizeof(skb->cb)); | ||
| 9302 | |||
| 9297 | if (WARN_ON(!rdev->cur_cmd_info)) { | 9303 | if (WARN_ON(!rdev->cur_cmd_info)) { |
| 9298 | kfree_skb(skb); | 9304 | kfree_skb(skb); |
| 9299 | return -EINVAL; | 9305 | return -EINVAL; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index beeed602aeb3..fdde51f4271a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -39,6 +39,11 @@ | |||
| 39 | #define XFRM_QUEUE_TMO_MAX ((unsigned)(60*HZ)) | 39 | #define XFRM_QUEUE_TMO_MAX ((unsigned)(60*HZ)) |
| 40 | #define XFRM_MAX_QUEUE_LEN 100 | 40 | #define XFRM_MAX_QUEUE_LEN 100 |
| 41 | 41 | ||
| 42 | struct xfrm_flo { | ||
| 43 | struct dst_entry *dst_orig; | ||
| 44 | u8 flags; | ||
| 45 | }; | ||
| 46 | |||
| 42 | static DEFINE_SPINLOCK(xfrm_policy_afinfo_lock); | 47 | static DEFINE_SPINLOCK(xfrm_policy_afinfo_lock); |
| 43 | static struct xfrm_policy_afinfo __rcu *xfrm_policy_afinfo[NPROTO] | 48 | static struct xfrm_policy_afinfo __rcu *xfrm_policy_afinfo[NPROTO] |
| 44 | __read_mostly; | 49 | __read_mostly; |
| @@ -1877,13 +1882,14 @@ static int xdst_queue_output(struct sock *sk, struct sk_buff *skb) | |||
| 1877 | } | 1882 | } |
| 1878 | 1883 | ||
| 1879 | static struct xfrm_dst *xfrm_create_dummy_bundle(struct net *net, | 1884 | static struct xfrm_dst *xfrm_create_dummy_bundle(struct net *net, |
| 1880 | struct dst_entry *dst, | 1885 | struct xfrm_flo *xflo, |
| 1881 | const struct flowi *fl, | 1886 | const struct flowi *fl, |
| 1882 | int num_xfrms, | 1887 | int num_xfrms, |
| 1883 | u16 family) | 1888 | u16 family) |
| 1884 | { | 1889 | { |
| 1885 | int err; | 1890 | int err; |
| 1886 | struct net_device *dev; | 1891 | struct net_device *dev; |
| 1892 | struct dst_entry *dst; | ||
| 1887 | struct dst_entry *dst1; | 1893 | struct dst_entry *dst1; |
| 1888 | struct xfrm_dst *xdst; | 1894 | struct xfrm_dst *xdst; |
| 1889 | 1895 | ||
| @@ -1891,9 +1897,12 @@ static struct xfrm_dst *xfrm_create_dummy_bundle(struct net *net, | |||
| 1891 | if (IS_ERR(xdst)) | 1897 | if (IS_ERR(xdst)) |
| 1892 | return xdst; | 1898 | return xdst; |
| 1893 | 1899 | ||
| 1894 | if (net->xfrm.sysctl_larval_drop || num_xfrms <= 0) | 1900 | if (!(xflo->flags & XFRM_LOOKUP_QUEUE) || |
| 1901 | net->xfrm.sysctl_larval_drop || | ||
| 1902 | num_xfrms <= 0) | ||
| 1895 | return xdst; | 1903 | return xdst; |
| 1896 | 1904 | ||
| 1905 | dst = xflo->dst_orig; | ||
| 1897 | dst1 = &xdst->u.dst; | 1906 | dst1 = &xdst->u.dst; |
| 1898 | dst_hold(dst); | 1907 | dst_hold(dst); |
| 1899 | xdst->route = dst; | 1908 | xdst->route = dst; |
| @@ -1935,7 +1944,7 @@ static struct flow_cache_object * | |||
| 1935 | xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, | 1944 | xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, |
| 1936 | struct flow_cache_object *oldflo, void *ctx) | 1945 | struct flow_cache_object *oldflo, void *ctx) |
| 1937 | { | 1946 | { |
| 1938 | struct dst_entry *dst_orig = (struct dst_entry *)ctx; | 1947 | struct xfrm_flo *xflo = (struct xfrm_flo *)ctx; |
| 1939 | struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; | 1948 | struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; |
| 1940 | struct xfrm_dst *xdst, *new_xdst; | 1949 | struct xfrm_dst *xdst, *new_xdst; |
| 1941 | int num_pols = 0, num_xfrms = 0, i, err, pol_dead; | 1950 | int num_pols = 0, num_xfrms = 0, i, err, pol_dead; |
| @@ -1976,7 +1985,8 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, | |||
| 1976 | goto make_dummy_bundle; | 1985 | goto make_dummy_bundle; |
| 1977 | } | 1986 | } |
| 1978 | 1987 | ||
| 1979 | new_xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, dst_orig); | 1988 | new_xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, |
| 1989 | xflo->dst_orig); | ||
| 1980 | if (IS_ERR(new_xdst)) { | 1990 | if (IS_ERR(new_xdst)) { |
| 1981 | err = PTR_ERR(new_xdst); | 1991 | err = PTR_ERR(new_xdst); |
| 1982 | if (err != -EAGAIN) | 1992 | if (err != -EAGAIN) |
| @@ -2010,7 +2020,7 @@ make_dummy_bundle: | |||
| 2010 | /* We found policies, but there's no bundles to instantiate: | 2020 | /* We found policies, but there's no bundles to instantiate: |
| 2011 | * either because the policy blocks, has no transformations or | 2021 | * either because the policy blocks, has no transformations or |
| 2012 | * we could not build template (no xfrm_states).*/ | 2022 | * we could not build template (no xfrm_states).*/ |
| 2013 | xdst = xfrm_create_dummy_bundle(net, dst_orig, fl, num_xfrms, family); | 2023 | xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); |
| 2014 | if (IS_ERR(xdst)) { | 2024 | if (IS_ERR(xdst)) { |
| 2015 | xfrm_pols_put(pols, num_pols); | 2025 | xfrm_pols_put(pols, num_pols); |
| 2016 | return ERR_CAST(xdst); | 2026 | return ERR_CAST(xdst); |
| @@ -2104,13 +2114,18 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | |||
| 2104 | } | 2114 | } |
| 2105 | 2115 | ||
| 2106 | if (xdst == NULL) { | 2116 | if (xdst == NULL) { |
| 2117 | struct xfrm_flo xflo; | ||
| 2118 | |||
| 2119 | xflo.dst_orig = dst_orig; | ||
| 2120 | xflo.flags = flags; | ||
| 2121 | |||
| 2107 | /* To accelerate a bit... */ | 2122 | /* To accelerate a bit... */ |
| 2108 | if ((dst_orig->flags & DST_NOXFRM) || | 2123 | if ((dst_orig->flags & DST_NOXFRM) || |
| 2109 | !net->xfrm.policy_count[XFRM_POLICY_OUT]) | 2124 | !net->xfrm.policy_count[XFRM_POLICY_OUT]) |
| 2110 | goto nopol; | 2125 | goto nopol; |
| 2111 | 2126 | ||
| 2112 | flo = flow_cache_lookup(net, fl, family, dir, | 2127 | flo = flow_cache_lookup(net, fl, family, dir, |
| 2113 | xfrm_bundle_lookup, dst_orig); | 2128 | xfrm_bundle_lookup, &xflo); |
| 2114 | if (flo == NULL) | 2129 | if (flo == NULL) |
| 2115 | goto nopol; | 2130 | goto nopol; |
| 2116 | if (IS_ERR(flo)) { | 2131 | if (IS_ERR(flo)) { |
| @@ -2138,7 +2153,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | |||
| 2138 | xfrm_pols_put(pols, drop_pols); | 2153 | xfrm_pols_put(pols, drop_pols); |
| 2139 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); | 2154 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); |
| 2140 | 2155 | ||
| 2141 | return make_blackhole(net, family, dst_orig); | 2156 | return ERR_PTR(-EREMOTE); |
| 2142 | } | 2157 | } |
| 2143 | 2158 | ||
| 2144 | err = -EAGAIN; | 2159 | err = -EAGAIN; |
| @@ -2195,6 +2210,23 @@ dropdst: | |||
| 2195 | } | 2210 | } |
| 2196 | EXPORT_SYMBOL(xfrm_lookup); | 2211 | EXPORT_SYMBOL(xfrm_lookup); |
| 2197 | 2212 | ||
| 2213 | /* Callers of xfrm_lookup_route() must ensure a call to dst_output(). | ||
| 2214 | * Otherwise we may send out blackholed packets. | ||
| 2215 | */ | ||
| 2216 | struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig, | ||
| 2217 | const struct flowi *fl, | ||
| 2218 | struct sock *sk, int flags) | ||
| 2219 | { | ||
| 2220 | struct dst_entry *dst = xfrm_lookup(net, dst_orig, fl, sk, | ||
| 2221 | flags | XFRM_LOOKUP_QUEUE); | ||
| 2222 | |||
| 2223 | if (IS_ERR(dst) && PTR_ERR(dst) == -EREMOTE) | ||
| 2224 | return make_blackhole(net, dst_orig->ops->family, dst_orig); | ||
| 2225 | |||
| 2226 | return dst; | ||
| 2227 | } | ||
| 2228 | EXPORT_SYMBOL(xfrm_lookup_route); | ||
| 2229 | |||
| 2198 | static inline int | 2230 | static inline int |
| 2199 | xfrm_secpath_reject(int idx, struct sk_buff *skb, const struct flowi *fl) | 2231 | xfrm_secpath_reject(int idx, struct sk_buff *skb, const struct flowi *fl) |
| 2200 | { | 2232 | { |
| @@ -2460,7 +2492,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
| 2460 | 2492 | ||
| 2461 | skb_dst_force(skb); | 2493 | skb_dst_force(skb); |
| 2462 | 2494 | ||
| 2463 | dst = xfrm_lookup(net, skb_dst(skb), &fl, NULL, 0); | 2495 | dst = xfrm_lookup(net, skb_dst(skb), &fl, NULL, XFRM_LOOKUP_QUEUE); |
| 2464 | if (IS_ERR(dst)) { | 2496 | if (IS_ERR(dst)) { |
| 2465 | res = 0; | 2497 | res = 0; |
| 2466 | dst = NULL; | 2498 | dst = NULL; |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 9acc77eae487..0032278567ad 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
| @@ -1782,14 +1782,16 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, | |||
| 1782 | { | 1782 | { |
| 1783 | struct snd_pcm_hw_params *params = arg; | 1783 | struct snd_pcm_hw_params *params = arg; |
| 1784 | snd_pcm_format_t format; | 1784 | snd_pcm_format_t format; |
| 1785 | int channels, width; | 1785 | int channels; |
| 1786 | ssize_t frame_size; | ||
| 1786 | 1787 | ||
| 1787 | params->fifo_size = substream->runtime->hw.fifo_size; | 1788 | params->fifo_size = substream->runtime->hw.fifo_size; |
| 1788 | if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { | 1789 | if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { |
| 1789 | format = params_format(params); | 1790 | format = params_format(params); |
| 1790 | channels = params_channels(params); | 1791 | channels = params_channels(params); |
| 1791 | width = snd_pcm_format_physical_width(format); | 1792 | frame_size = snd_pcm_format_size(format, channels); |
| 1792 | params->fifo_size /= width * channels; | 1793 | if (frame_size > 0) |
| 1794 | params->fifo_size /= (unsigned)frame_size; | ||
| 1793 | } | 1795 | } |
| 1794 | return 0; | 1796 | return 0; |
| 1795 | } | 1797 | } |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 6e5d0cb4e3d7..47ccb8f44adb 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
| @@ -777,6 +777,7 @@ static const struct hda_model_fixup cxt5066_fixup_models[] = { | |||
| 777 | { .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" }, | 777 | { .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" }, |
| 778 | { .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" }, | 778 | { .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" }, |
| 779 | { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" }, | 779 | { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" }, |
| 780 | { .id = CXT_PINCFG_LEMOTE_A1205, .name = "lemote-a1205" }, | ||
| 780 | { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" }, | 781 | { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" }, |
| 781 | {} | 782 | {} |
| 782 | }; | 783 | }; |
diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c index f65fc0987cfb..b7a7c805d63f 100644 --- a/sound/usb/caiaq/control.c +++ b/sound/usb/caiaq/control.c | |||
| @@ -100,15 +100,19 @@ static int control_put(struct snd_kcontrol *kcontrol, | |||
| 100 | struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); | 100 | struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); |
| 101 | int pos = kcontrol->private_value; | 101 | int pos = kcontrol->private_value; |
| 102 | int v = ucontrol->value.integer.value[0]; | 102 | int v = ucontrol->value.integer.value[0]; |
| 103 | unsigned char cmd = EP1_CMD_WRITE_IO; | 103 | unsigned char cmd; |
| 104 | 104 | ||
| 105 | if (cdev->chip.usb_id == | 105 | switch (cdev->chip.usb_id) { |
| 106 | USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1)) | 106 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER): |
| 107 | cmd = EP1_CMD_DIMM_LEDS; | 107 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): |
| 108 | 108 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): | |
| 109 | if (cdev->chip.usb_id == | 109 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): |
| 110 | USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) | ||
| 111 | cmd = EP1_CMD_DIMM_LEDS; | 110 | cmd = EP1_CMD_DIMM_LEDS; |
| 111 | break; | ||
| 112 | default: | ||
| 113 | cmd = EP1_CMD_WRITE_IO; | ||
| 114 | break; | ||
| 115 | } | ||
| 112 | 116 | ||
| 113 | if (pos & CNT_INTVAL) { | 117 | if (pos & CNT_INTVAL) { |
| 114 | int i = pos & ~CNT_INTVAL; | 118 | int i = pos & ~CNT_INTVAL; |
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c index 01124ef3690a..416baedfc89f 100644 --- a/virt/kvm/arm/vgic-v2.c +++ b/virt/kvm/arm/vgic-v2.c | |||
| @@ -71,7 +71,7 @@ static void vgic_v2_sync_lr_elrsr(struct kvm_vcpu *vcpu, int lr, | |||
| 71 | struct vgic_lr lr_desc) | 71 | struct vgic_lr lr_desc) |
| 72 | { | 72 | { |
| 73 | if (!(lr_desc.state & LR_STATE_MASK)) | 73 | if (!(lr_desc.state & LR_STATE_MASK)) |
| 74 | set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr); | 74 | __set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu) | 77 | static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu) |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 33712fb26eb1..95519bc959ed 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
| @@ -110,7 +110,7 @@ static bool largepages_enabled = true; | |||
| 110 | bool kvm_is_mmio_pfn(pfn_t pfn) | 110 | bool kvm_is_mmio_pfn(pfn_t pfn) |
| 111 | { | 111 | { |
| 112 | if (pfn_valid(pfn)) | 112 | if (pfn_valid(pfn)) |
| 113 | return PageReserved(pfn_to_page(pfn)); | 113 | return !is_zero_pfn(pfn) && PageReserved(pfn_to_page(pfn)); |
| 114 | 114 | ||
| 115 | return true; | 115 | return true; |
| 116 | } | 116 | } |
| @@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target) | |||
| 1725 | rcu_read_lock(); | 1725 | rcu_read_lock(); |
| 1726 | pid = rcu_dereference(target->pid); | 1726 | pid = rcu_dereference(target->pid); |
| 1727 | if (pid) | 1727 | if (pid) |
| 1728 | task = get_pid_task(target->pid, PIDTYPE_PID); | 1728 | task = get_pid_task(pid, PIDTYPE_PID); |
| 1729 | rcu_read_unlock(); | 1729 | rcu_read_unlock(); |
| 1730 | if (!task) | 1730 | if (!task) |
| 1731 | return ret; | 1731 | return ret; |
