This is the 5.4.134 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmD22Z0ACgkQONu9yGCS
 aT7fWQ//TgR/TwyqFf3jFQ75gA4/9keirtaZaFd42CUWJQQeyUTc3YcoFV6yQ/fi
 letGckFWKxAK/ftqcla9yJemLmXzt7Hx4wpsF+5r97YLN7Yv5M9CznqdATgrg+pY
 dfRnJJZhAs1gnDVzSiBfHlgxCCHw/7UEOs7o+slBSU/KKgGaF+H542i2v+n2XIWV
 kS3J/K2fZN8GF6o0L6Wzpvd5/8xjqs4Nm883ZTQ8B/dR0Cxz9sLW0EAjK4THcmFM
 7riUT4GewvsohddsaGyQ2akieHiZLbGyxtola72wSpoNwiy/tYLpBpKlJNFwyeIr
 DTBgreoB9NGikQfEZrHjzvUvK6KHXkz0h3pprjXOKFUnu7uVm9OFUw5scAq/Wh0Q
 qe9nB4xCiZqxJJTEVCa499ZiBDvS6J0kbs5fge3reIEfno5I4LdlJJTkpWgV9Flh
 dIninifXmGYtaLrTkWJzAydSntt0Z+Zk/y9aS08jwHVpgs1HXVXr0xEqlxr1/5su
 K5fiSGXXhYSbFuAvW8tYIJickXvM8xBVpOkkiqLuhxts2kiZp8TJn2H/DiQBekJt
 CQeUvNQiEbwI/NFPiJQrtzQHC4Gq2Ibv9+MpnQvOW/RxHH7NSJ4vOp8FgaHBxIZE
 Jwa3NPHG8bzCo/n+vRn00Re1+OGYzsphxO2hRp+EjhNxKzpxwkc=
 =3pL6
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdQaENiSDAlGTDEbB7G51OISzHs0FAmD3ITMACgkQ7G51OISz
 Hs2u9w/+LaT+Iko2MBP8bc0yqq9HYxObAHLWdC0oAYnygO+7MQSldaDlAtLDvfr8
 d6IdCjPfFPHLWFb/Ggjx7dH6PhYwj+sarlljeXSFriEro2994ig0C75J83hOkks6
 d9OeONg2PHivigrXLt+00Zdd4Y9Ubbo3qStBeWaaezCfZtMulcgrCBIqQ0CPi3l4
 iocX7sgmGY51fypoh75+7SpfZOTDKGigzTWcTN/chMVGu4Jy+hUpnNMYWSw2sOvD
 VdY460C6mMmH/UPiccwM01Mo7z75Psudn1K6Ic/c+FzOH1hCydvNIebfBuo3nJP7
 DEIAR4wz6AXoOgcU1hnlsvoBR9x5CNR871sAA9HwJj36XwLaJ5RfOIqESS+odwbl
 Xr8MuE/F3wu8gtz/4LqSjuFDWruMu/YH9gEqH/lbMl9g54MkZMAIQEUeGpMN6Los
 sZMJufotIc9VPrTnVwVNvH5r40I9FZRcBx0ctG0ht2JmfIY9cV6+P6ENnKzMV+NU
 lIt5rMfv38pul2H7ZpFXizqLIU74p2NyfVspJOneD9j5UmN42GkLs77fREXi5Eox
 K3jCi7z13eBZNG8v1O+I7p7Ei7RZkx+1tTviJh2RipxK27Ujl/Z3sYYV8zcPvzBo
 sJfyGXfJevJAH+adHm+L8VbHT4EHzrbSaUb8lqq74ls9PKr5y+g=
 =75SM
 -----END PGP SIGNATURE-----

Merge tag 'v5.4.134' into 5.4-2.3.x-imx

This is the 5.4.134 stable release

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
This commit is contained in:
Andrey Zhizhikin 2021-07-20 19:17:04 +00:00
commit af4a69fcb7
155 changed files with 978 additions and 498 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 5 VERSION = 5
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 133 SUBLEVEL = 134
EXTRAVERSION = EXTRAVERSION =
NAME = Kleptomaniac Octopus NAME = Kleptomaniac Octopus

View File

@ -516,7 +516,7 @@ status = "okay";
status = "okay"; status = "okay";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>; pinctrl-0 = <&spi0_pins>;
ti,pindir-d0-out-d1-in = <1>; ti,pindir-d0-out-d1-in;
/* WLS1271 WiFi */ /* WLS1271 WiFi */
wlcore: wlcore@1 { wlcore: wlcore@1 {
compatible = "ti,wl1271"; compatible = "ti,wl1271";

View File

@ -848,7 +848,7 @@
pinctrl-names = "default", "sleep"; pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi0_pins_default>; pinctrl-0 = <&spi0_pins_default>;
pinctrl-1 = <&spi0_pins_sleep>; pinctrl-1 = <&spi0_pins_sleep>;
ti,pindir-d0-out-d1-in = <1>; ti,pindir-d0-out-d1-in;
}; };
&spi1 { &spi1 {
@ -856,7 +856,7 @@
pinctrl-names = "default", "sleep"; pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi1_pins_default>; pinctrl-0 = <&spi1_pins_default>;
pinctrl-1 = <&spi1_pins_sleep>; pinctrl-1 = <&spi1_pins_sleep>;
ti,pindir-d0-out-d1-in = <1>; ti,pindir-d0-out-d1-in;
}; };
&usb2_phy1 { &usb2_phy1 {

View File

@ -494,27 +494,27 @@
<0x1811b408 0x004>, <0x1811b408 0x004>,
<0x180293a0 0x01c>; <0x180293a0 0x01c>;
reg-names = "mspi", "bspi", "intr_regs", "intr_status_reg"; reg-names = "mspi", "bspi", "intr_regs", "intr_status_reg";
interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
<GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>, interrupt-names = "mspi_done",
<GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; "mspi_halted",
interrupt-names = "spi_lr_fullness_reached", "spi_lr_fullness_reached",
"spi_lr_session_aborted", "spi_lr_session_aborted",
"spi_lr_impatient", "spi_lr_impatient",
"spi_lr_session_done", "spi_lr_session_done",
"spi_lr_overhead", "spi_lr_overread";
"mspi_done",
"mspi_halted";
clocks = <&iprocmed>; clocks = <&iprocmed>;
clock-names = "iprocmed"; clock-names = "iprocmed";
num-cs = <2>; num-cs = <2>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
spi_nor: spi-nor@0 { spi_nor: flash@0 {
compatible = "jedec,spi-nor"; compatible = "jedec,spi-nor";
reg = <0>; reg = <0>;
spi-max-frequency = <20000000>; spi-max-frequency = <20000000>;

View File

@ -22,7 +22,7 @@
label = "blue:heartbeat"; label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>; pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2"; pwm-names = "pwm2";
max_brightness = <255>; max-brightness = <255>;
linux,default-trigger = "heartbeat"; linux,default-trigger = "heartbeat";
}; };
}; };

View File

@ -24,7 +24,7 @@
label = "blue:heartbeat"; label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>; pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2"; pwm-names = "pwm2";
max_brightness = <255>; max-brightness = <255>;
linux,default-trigger = "heartbeat"; linux,default-trigger = "heartbeat";
}; };
}; };

View File

@ -22,7 +22,7 @@
* Green LED is much brighter than the others * Green LED is much brighter than the others
* so limit its max brightness * so limit its max brightness
*/ */
max_brightness = <127>; max-brightness = <127>;
linux,default-trigger = "mmc0"; linux,default-trigger = "mmc0";
}; };
@ -30,7 +30,7 @@
label = "blue:heartbeat"; label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>; pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2"; pwm-names = "pwm2";
max_brightness = <255>; max-brightness = <255>;
linux,default-trigger = "heartbeat"; linux,default-trigger = "heartbeat";
}; };
}; };

View File

@ -125,18 +125,6 @@
}; };
}; };
ethernet@60000000 {
status = "okay";
ethernet-port@0 {
phy-mode = "rgmii";
phy-handle = <&phy0>;
};
ethernet-port@1 {
/* Not used in this platform */
};
};
usb@68000000 { usb@68000000 {
status = "okay"; status = "okay";
}; };

View File

@ -98,30 +98,40 @@
reg = <0>; reg = <0>;
max-speed = <100>; max-speed = <100>;
reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
reset-delay-us = <1000>; reset-assert-us = <1000>;
reset-post-delay-us = <1000>; reset-deassert-us = <1000>;
smsc,disable-energy-detect; /* Make plugin detection reliable */
}; };
}; };
}; };
&i2c1 { &i2c1 {
clock-frequency = <100000>; clock-frequency = <100000>;
pinctrl-names = "default"; pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c1>; pinctrl-0 = <&pinctrl_i2c1>;
pinctrl-1 = <&pinctrl_i2c1_gpio>;
scl-gpios = <&gpio3 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
sda-gpios = <&gpio3 28 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay"; status = "okay";
}; };
&i2c2 { &i2c2 {
clock-frequency = <100000>; clock-frequency = <100000>;
pinctrl-names = "default"; pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c2>; pinctrl-0 = <&pinctrl_i2c2>;
pinctrl-1 = <&pinctrl_i2c2_gpio>;
scl-gpios = <&gpio4 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
sda-gpios = <&gpio4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay"; status = "okay";
}; };
&i2c3 { &i2c3 {
clock-frequency = <100000>; clock-frequency = <100000>;
pinctrl-names = "default"; pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c3>; pinctrl-0 = <&pinctrl_i2c3>;
pinctrl-1 = <&pinctrl_i2c3_gpio>;
scl-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay"; status = "okay";
ltc3676: pmic@3c { ltc3676: pmic@3c {
@ -287,6 +297,13 @@
>; >;
}; };
pinctrl_i2c1_gpio: i2c1-gpio-grp {
fsl,pins = <
MX6QDL_PAD_EIM_D21__GPIO3_IO21 0x4001b8b1
MX6QDL_PAD_EIM_D28__GPIO3_IO28 0x4001b8b1
>;
};
pinctrl_i2c2: i2c2-grp { pinctrl_i2c2: i2c2-grp {
fsl,pins = < fsl,pins = <
MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
@ -294,6 +311,13 @@
>; >;
}; };
pinctrl_i2c2_gpio: i2c2-gpio-grp {
fsl,pins = <
MX6QDL_PAD_KEY_COL3__GPIO4_IO12 0x4001b8b1
MX6QDL_PAD_KEY_ROW3__GPIO4_IO13 0x4001b8b1
>;
};
pinctrl_i2c3: i2c3-grp { pinctrl_i2c3: i2c3-grp {
fsl,pins = < fsl,pins = <
MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
@ -301,6 +325,13 @@
>; >;
}; };
pinctrl_i2c3_gpio: i2c3-gpio-grp {
fsl,pins = <
MX6QDL_PAD_GPIO_3__GPIO1_IO03 0x4001b8b1
MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x4001b8b1
>;
};
pinctrl_pmic_hw300: pmic-hw300-grp { pinctrl_pmic_hw300: pmic-hw300-grp {
fsl,pins = < fsl,pins = <
MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x1B0B0 MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x1B0B0

View File

@ -146,7 +146,7 @@
status = "okay"; status = "okay";
clocks = <&mstp1_clks R8A7779_CLK_DU>, <&x3_clk>; clocks = <&mstp1_clks R8A7779_CLK_DU>, <&x3_clk>;
clock-names = "du", "dclkin.0"; clock-names = "du.0", "dclkin.0";
ports { ports {
port@0 { port@0 {

View File

@ -463,6 +463,7 @@
reg = <0xfff80000 0x40000>; reg = <0xfff80000 0x40000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp1_clks R8A7779_CLK_DU>; clocks = <&mstp1_clks R8A7779_CLK_DU>;
clock-names = "du.0";
power-domains = <&sysc R8A7779_PD_ALWAYS_ON>; power-domains = <&sysc R8A7779_PD_ALWAYS_ON>;
status = "disabled"; status = "disabled";

View File

@ -46,6 +46,7 @@ void __init exynos_sysram_init(void)
sysram_base_addr = of_iomap(node, 0); sysram_base_addr = of_iomap(node, 0);
sysram_base_phys = of_translate_address(node, sysram_base_phys = of_translate_address(node,
of_get_address(node, 0, NULL, NULL)); of_get_address(node, 0, NULL, NULL));
of_node_put(node);
break; break;
} }
@ -53,6 +54,7 @@ void __init exynos_sysram_init(void)
if (!of_device_is_available(node)) if (!of_device_is_available(node))
continue; continue;
sysram_ns_base_addr = of_iomap(node, 0); sysram_ns_base_addr = of_iomap(node, 0);
of_node_put(node);
break; break;
} }
} }

View File

@ -441,21 +441,21 @@ void kprobe_thumb32_test_cases(void)
"3: mvn r0, r0 \n\t" "3: mvn r0, r0 \n\t"
"2: nop \n\t") "2: nop \n\t")
TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,"]", TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
"9: \n\t" "9: \n\t"
".short (2f-1b-4)>>1 \n\t" ".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t" ".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t" "3: mvn r0, r0 \n\t"
"2: nop \n\t") "2: nop \n\t")
TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,"]", TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,", lsl #1]",
"9: \n\t" "9: \n\t"
".short (2f-1b-4)>>1 \n\t" ".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t" ".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t" "3: mvn r0, r0 \n\t"
"2: nop \n\t") "2: nop \n\t")
TEST_RRX("tbh [r",1,9f, ", r",14,1,"]", TEST_RRX("tbh [r",1,9f, ", r",14,1,", lsl #1]",
"9: \n\t" "9: \n\t"
".short (2f-1b-4)>>1 \n\t" ".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t" ".short (3f-1b-4)>>1 \n\t"
@ -468,10 +468,10 @@ void kprobe_thumb32_test_cases(void)
TEST_UNSUPPORTED("strexb r0, r1, [r2]") TEST_UNSUPPORTED("strexb r0, r1, [r2]")
TEST_UNSUPPORTED("strexh r0, r1, [r2]") TEST_UNSUPPORTED("strexh r0, r1, [r2]")
TEST_UNSUPPORTED("strexd r0, r1, [r2]") TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
TEST_UNSUPPORTED("ldrexb r0, [r1]") TEST_UNSUPPORTED("ldrexb r0, [r1]")
TEST_UNSUPPORTED("ldrexh r0, [r1]") TEST_UNSUPPORTED("ldrexh r0, [r1]")
TEST_UNSUPPORTED("ldrexd r0, [r1]") TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")
TEST_GROUP("Data-processing (shifted register) and (modified immediate)") TEST_GROUP("Data-processing (shifted register) and (modified immediate)")

View File

@ -59,7 +59,7 @@
memory@48000000 { memory@48000000 {
device_type = "memory"; device_type = "memory";
/* first 128MB is reserved for secure area. */ /* first 128MB is reserved for secure area. */
reg = <0x0 0x48000000 0x0 0x38000000>; reg = <0x0 0x48000000 0x0 0x78000000>;
}; };
osc5_clk: osc5-clock { osc5_clk: osc5-clock {

View File

@ -60,13 +60,8 @@ SECTIONS
_end = .; _end = .;
/DISCARD/ : {
EXIT_TEXT
EXIT_DATA
EXIT_CALL
}
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
DISCARDS
} }

View File

@ -33,7 +33,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
KCOV_INSTRUMENT := n KCOV_INSTRUMENT := n
# decompressor objects (linked with vmlinuz) # decompressor objects (linked with vmlinuz)
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
ifdef CONFIG_DEBUG_ZBOOT ifdef CONFIG_DEBUG_ZBOOT
vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o
@ -47,7 +47,7 @@ extra-y += uart-ath79.c
$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
$(call cmd,shipped) $(call cmd,shipped)
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
extra-y += ashldi3.c extra-y += ashldi3.c
$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE $(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE

View File

@ -7,6 +7,8 @@
* Author: Wu Zhangjin <wuzhangjin@gmail.com> * Author: Wu Zhangjin <wuzhangjin@gmail.com>
*/ */
#define DISABLE_BRANCH_PROFILING
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>

View File

@ -67,7 +67,7 @@ static inline const struct vdso_data *get_vdso_data(void)
static inline void __iomem *get_gic(const struct vdso_data *data) static inline void __iomem *get_gic(const struct vdso_data *data)
{ {
return (void __iomem *)data - PAGE_SIZE; return (void __iomem *)((unsigned long)data & PAGE_MASK) - PAGE_SIZE;
} }
#endif /* CONFIG_CLKSRC_MIPS_GIC */ #endif /* CONFIG_CLKSRC_MIPS_GIC */

View File

@ -13,6 +13,7 @@
#include "string.h" #include "string.h"
#include "stdio.h" #include "stdio.h"
#include "ops.h" #include "ops.h"
#include "of.h"
void dt_fixup_memory(u64 start, u64 size) void dt_fixup_memory(u64 start, u64 size)
{ {
@ -23,21 +24,25 @@ void dt_fixup_memory(u64 start, u64 size)
root = finddevice("/"); root = finddevice("/");
if (getprop(root, "#address-cells", &naddr, sizeof(naddr)) < 0) if (getprop(root, "#address-cells", &naddr, sizeof(naddr)) < 0)
naddr = 2; naddr = 2;
else
naddr = be32_to_cpu(naddr);
if (naddr < 1 || naddr > 2) if (naddr < 1 || naddr > 2)
fatal("Can't cope with #address-cells == %d in /\n\r", naddr); fatal("Can't cope with #address-cells == %d in /\n\r", naddr);
if (getprop(root, "#size-cells", &nsize, sizeof(nsize)) < 0) if (getprop(root, "#size-cells", &nsize, sizeof(nsize)) < 0)
nsize = 1; nsize = 1;
else
nsize = be32_to_cpu(nsize);
if (nsize < 1 || nsize > 2) if (nsize < 1 || nsize > 2)
fatal("Can't cope with #size-cells == %d in /\n\r", nsize); fatal("Can't cope with #size-cells == %d in /\n\r", nsize);
i = 0; i = 0;
if (naddr == 2) if (naddr == 2)
memreg[i++] = start >> 32; memreg[i++] = cpu_to_be32(start >> 32);
memreg[i++] = start & 0xffffffff; memreg[i++] = cpu_to_be32(start & 0xffffffff);
if (nsize == 2) if (nsize == 2)
memreg[i++] = size >> 32; memreg[i++] = cpu_to_be32(size >> 32);
memreg[i++] = size & 0xffffffff; memreg[i++] = cpu_to_be32(size & 0xffffffff);
memory = finddevice("/memory"); memory = finddevice("/memory");
if (! memory) { if (! memory) {
@ -45,9 +50,9 @@ void dt_fixup_memory(u64 start, u64 size)
setprop_str(memory, "device_type", "memory"); setprop_str(memory, "device_type", "memory");
} }
printf("Memory <- <0x%x", memreg[0]); printf("Memory <- <0x%x", be32_to_cpu(memreg[0]));
for (i = 1; i < (naddr + nsize); i++) for (i = 1; i < (naddr + nsize); i++)
printf(" 0x%x", memreg[i]); printf(" 0x%x", be32_to_cpu(memreg[i]));
printf("> (%ldMB)\n\r", (unsigned long)(size >> 20)); printf("> (%ldMB)\n\r", (unsigned long)(size >> 20));
setprop(memory, "reg", memreg, (naddr + nsize)*sizeof(u32)); setprop(memory, "reg", memreg, (naddr + nsize)*sizeof(u32));
@ -65,10 +70,10 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
printf("CPU bus-frequency <- 0x%x (%dMHz)\n\r", bus, MHZ(bus)); printf("CPU bus-frequency <- 0x%x (%dMHz)\n\r", bus, MHZ(bus));
while ((devp = find_node_by_devtype(devp, "cpu"))) { while ((devp = find_node_by_devtype(devp, "cpu"))) {
setprop_val(devp, "clock-frequency", cpu); setprop_val(devp, "clock-frequency", cpu_to_be32(cpu));
setprop_val(devp, "timebase-frequency", tb); setprop_val(devp, "timebase-frequency", cpu_to_be32(tb));
if (bus > 0) if (bus > 0)
setprop_val(devp, "bus-frequency", bus); setprop_val(devp, "bus-frequency", cpu_to_be32(bus));
} }
timebase_period_ns = 1000000000 / tb; timebase_period_ns = 1000000000 / tb;
@ -80,7 +85,7 @@ void dt_fixup_clock(const char *path, u32 freq)
if (devp) { if (devp) {
printf("%s: clock-frequency <- %x (%dMHz)\n\r", path, freq, MHZ(freq)); printf("%s: clock-frequency <- %x (%dMHz)\n\r", path, freq, MHZ(freq));
setprop_val(devp, "clock-frequency", freq); setprop_val(devp, "clock-frequency", cpu_to_be32(freq));
} }
} }
@ -133,8 +138,12 @@ void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize)
{ {
if (getprop(node, "#address-cells", naddr, 4) != 4) if (getprop(node, "#address-cells", naddr, 4) != 4)
*naddr = 2; *naddr = 2;
else
*naddr = be32_to_cpu(*naddr);
if (getprop(node, "#size-cells", nsize, 4) != 4) if (getprop(node, "#size-cells", nsize, 4) != 4)
*nsize = 1; *nsize = 1;
else
*nsize = be32_to_cpu(*nsize);
} }
static void copy_val(u32 *dest, u32 *src, int naddr) static void copy_val(u32 *dest, u32 *src, int naddr)
@ -163,9 +172,9 @@ static int add_reg(u32 *reg, u32 *add, int naddr)
int i, carry = 0; int i, carry = 0;
for (i = MAX_ADDR_CELLS - 1; i >= MAX_ADDR_CELLS - naddr; i--) { for (i = MAX_ADDR_CELLS - 1; i >= MAX_ADDR_CELLS - naddr; i--) {
u64 tmp = (u64)reg[i] + add[i] + carry; u64 tmp = (u64)be32_to_cpu(reg[i]) + be32_to_cpu(add[i]) + carry;
carry = tmp >> 32; carry = tmp >> 32;
reg[i] = (u32)tmp; reg[i] = cpu_to_be32((u32)tmp);
} }
return !carry; return !carry;
@ -180,18 +189,18 @@ static int compare_reg(u32 *reg, u32 *range, u32 *rangesize)
u32 end; u32 end;
for (i = 0; i < MAX_ADDR_CELLS; i++) { for (i = 0; i < MAX_ADDR_CELLS; i++) {
if (reg[i] < range[i]) if (be32_to_cpu(reg[i]) < be32_to_cpu(range[i]))
return 0; return 0;
if (reg[i] > range[i]) if (be32_to_cpu(reg[i]) > be32_to_cpu(range[i]))
break; break;
} }
for (i = 0; i < MAX_ADDR_CELLS; i++) { for (i = 0; i < MAX_ADDR_CELLS; i++) {
end = range[i] + rangesize[i]; end = be32_to_cpu(range[i]) + be32_to_cpu(rangesize[i]);
if (reg[i] < end) if (be32_to_cpu(reg[i]) < end)
break; break;
if (reg[i] > end) if (be32_to_cpu(reg[i]) > end)
return 0; return 0;
} }
@ -240,7 +249,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
return 0; return 0;
dt_get_reg_format(parent, &naddr, &nsize); dt_get_reg_format(parent, &naddr, &nsize);
if (nsize > 2) if (nsize > 2)
return 0; return 0;
@ -252,10 +260,10 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
copy_val(last_addr, prop_buf + offset, naddr); copy_val(last_addr, prop_buf + offset, naddr);
ret_size = prop_buf[offset + naddr]; ret_size = be32_to_cpu(prop_buf[offset + naddr]);
if (nsize == 2) { if (nsize == 2) {
ret_size <<= 32; ret_size <<= 32;
ret_size |= prop_buf[offset + naddr + 1]; ret_size |= be32_to_cpu(prop_buf[offset + naddr + 1]);
} }
for (;;) { for (;;) {
@ -278,7 +286,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
offset = find_range(last_addr, prop_buf, prev_naddr, offset = find_range(last_addr, prop_buf, prev_naddr,
naddr, prev_nsize, buflen / 4); naddr, prev_nsize, buflen / 4);
if (offset < 0) if (offset < 0)
return 0; return 0;
@ -296,8 +303,7 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
if (naddr > 2) if (naddr > 2)
return 0; return 0;
ret_addr = ((u64)last_addr[2] << 32) | last_addr[3]; ret_addr = ((u64)be32_to_cpu(last_addr[2]) << 32) | be32_to_cpu(last_addr[3]);
if (sizeof(void *) == 4 && if (sizeof(void *) == 4 &&
(ret_addr >= 0x100000000ULL || ret_size > 0x100000000ULL || (ret_addr >= 0x100000000ULL || ret_size > 0x100000000ULL ||
ret_addr + ret_size > 0x100000000ULL)) ret_addr + ret_size > 0x100000000ULL))
@ -350,11 +356,14 @@ int dt_is_compatible(void *node, const char *compat)
int dt_get_virtual_reg(void *node, void **addr, int nres) int dt_get_virtual_reg(void *node, void **addr, int nres)
{ {
unsigned long xaddr; unsigned long xaddr;
int n; int n, i;
n = getprop(node, "virtual-reg", addr, nres * 4); n = getprop(node, "virtual-reg", addr, nres * 4);
if (n > 0) if (n > 0) {
for (i = 0; i < n/4; i ++)
((u32 *)addr)[i] = be32_to_cpu(((u32 *)addr)[i]);
return n / 4; return n / 4;
}
for (n = 0; n < nres; n++) { for (n = 0; n < nres; n++) {
if (!dt_xlate_reg(node, n, &xaddr, NULL)) if (!dt_xlate_reg(node, n, &xaddr, NULL))

View File

@ -15,6 +15,7 @@
#include "stdio.h" #include "stdio.h"
#include "io.h" #include "io.h"
#include "ops.h" #include "ops.h"
#include "of.h"
#define UART_DLL 0 /* Out: Divisor Latch Low */ #define UART_DLL 0 /* Out: Divisor Latch Low */
#define UART_DLM 1 /* Out: Divisor Latch High */ #define UART_DLM 1 /* Out: Divisor Latch High */
@ -58,16 +59,20 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
int n; int n;
u32 reg_offset; u32 reg_offset;
if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1) if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1) {
printf("virt reg parse fail...\r\n");
return -1; return -1;
}
n = getprop(devp, "reg-offset", &reg_offset, sizeof(reg_offset)); n = getprop(devp, "reg-offset", &reg_offset, sizeof(reg_offset));
if (n == sizeof(reg_offset)) if (n == sizeof(reg_offset))
reg_base += reg_offset; reg_base += be32_to_cpu(reg_offset);
n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift)); n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift)) if (n != sizeof(reg_shift))
reg_shift = 0; reg_shift = 0;
else
reg_shift = be32_to_cpu(reg_shift);
scdp->open = ns16550_open; scdp->open = ns16550_open;
scdp->putc = ns16550_putc; scdp->putc = ns16550_putc;

View File

@ -71,6 +71,7 @@ struct ps3_dma_region_ops;
* @bus_addr: The 'translated' bus address of the region. * @bus_addr: The 'translated' bus address of the region.
* @len: The length in bytes of the region. * @len: The length in bytes of the region.
* @offset: The offset from the start of memory of the region. * @offset: The offset from the start of memory of the region.
* @dma_mask: Device dma_mask.
* @ioid: The IOID of the device who owns this region * @ioid: The IOID of the device who owns this region
* @chunk_list: Opaque variable used by the ioc page manager. * @chunk_list: Opaque variable used by the ioc page manager.
* @region_ops: struct ps3_dma_region_ops - dma region operations * @region_ops: struct ps3_dma_region_ops - dma region operations
@ -85,6 +86,7 @@ struct ps3_dma_region {
enum ps3_dma_region_type region_type; enum ps3_dma_region_type region_type;
unsigned long len; unsigned long len;
unsigned long offset; unsigned long offset;
u64 dma_mask;
/* driver variables (set by ps3_dma_region_create) */ /* driver variables (set by ps3_dma_region_create) */
unsigned long bus_addr; unsigned long bus_addr;

View File

@ -6,6 +6,7 @@
* Copyright 2006 Sony Corp. * Copyright 2006 Sony Corp.
*/ */
#include <linux/dma-mapping.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/memblock.h> #include <linux/memblock.h>
@ -1118,6 +1119,7 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
enum ps3_dma_region_type region_type, void *addr, unsigned long len) enum ps3_dma_region_type region_type, void *addr, unsigned long len)
{ {
unsigned long lpar_addr; unsigned long lpar_addr;
int result;
lpar_addr = addr ? ps3_mm_phys_to_lpar(__pa(addr)) : 0; lpar_addr = addr ? ps3_mm_phys_to_lpar(__pa(addr)) : 0;
@ -1129,6 +1131,16 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
r->offset -= map.r1.offset; r->offset -= map.r1.offset;
r->len = len ? len : _ALIGN_UP(map.total, 1 << r->page_size); r->len = len ? len : _ALIGN_UP(map.total, 1 << r->page_size);
dev->core.dma_mask = &r->dma_mask;
result = dma_set_mask_and_coherent(&dev->core, DMA_BIT_MASK(32));
if (result < 0) {
dev_err(&dev->core, "%s:%d: dma_set_mask_and_coherent failed: %d\n",
__func__, __LINE__, result);
return result;
}
switch (dev->dev_type) { switch (dev->dev_type) {
case PS3_DEVICE_TYPE_SB: case PS3_DEVICE_TYPE_SB:
r->region_ops = (USE_DYNAMIC_DMA) r->region_ops = (USE_DYNAMIC_DMA)

View File

@ -27,22 +27,25 @@ static inline int __diag308(unsigned long subcode, void *addr)
register unsigned long _addr asm("0") = (unsigned long)addr; register unsigned long _addr asm("0") = (unsigned long)addr;
register unsigned long _rc asm("1") = 0; register unsigned long _rc asm("1") = 0;
unsigned long reg1, reg2; unsigned long reg1, reg2;
psw_t old = S390_lowcore.program_new_psw; psw_t old;
asm volatile( asm volatile(
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
" epsw %0,%1\n" " epsw %0,%1\n"
" st %0,%[psw_pgm]\n" " st %0,0(%[psw_pgm])\n"
" st %1,%[psw_pgm]+4\n" " st %1,4(%[psw_pgm])\n"
" larl %0,1f\n" " larl %0,1f\n"
" stg %0,%[psw_pgm]+8\n" " stg %0,8(%[psw_pgm])\n"
" diag %[addr],%[subcode],0x308\n" " diag %[addr],%[subcode],0x308\n"
"1: nopr %%r7\n" "1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
: "=&d" (reg1), "=&a" (reg2), : "=&d" (reg1), "=&a" (reg2),
[psw_pgm] "=Q" (S390_lowcore.program_new_psw), "+Q" (S390_lowcore.program_new_psw),
"=Q" (old),
[addr] "+d" (_addr), "+d" (_rc) [addr] "+d" (_addr), "+d" (_rc)
: [subcode] "d" (subcode) : [subcode] "d" (subcode),
[psw_old] "a" (&old),
[psw_pgm] "a" (&S390_lowcore.program_new_psw)
: "cc", "memory"); : "cc", "memory");
S390_lowcore.program_new_psw = old;
return _rc; return _rc;
} }

View File

@ -70,24 +70,27 @@ static int __diag260(unsigned long rx1, unsigned long rx2)
register unsigned long _ry asm("4") = 0x10; /* storage configuration */ register unsigned long _ry asm("4") = 0x10; /* storage configuration */
int rc = -1; /* fail */ int rc = -1; /* fail */
unsigned long reg1, reg2; unsigned long reg1, reg2;
psw_t old = S390_lowcore.program_new_psw; psw_t old;
asm volatile( asm volatile(
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
" epsw %0,%1\n" " epsw %0,%1\n"
" st %0,%[psw_pgm]\n" " st %0,0(%[psw_pgm])\n"
" st %1,%[psw_pgm]+4\n" " st %1,4(%[psw_pgm])\n"
" larl %0,1f\n" " larl %0,1f\n"
" stg %0,%[psw_pgm]+8\n" " stg %0,8(%[psw_pgm])\n"
" diag %[rx],%[ry],0x260\n" " diag %[rx],%[ry],0x260\n"
" ipm %[rc]\n" " ipm %[rc]\n"
" srl %[rc],28\n" " srl %[rc],28\n"
"1:\n" "1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
: "=&d" (reg1), "=&a" (reg2), : "=&d" (reg1), "=&a" (reg2),
[psw_pgm] "=Q" (S390_lowcore.program_new_psw), "+Q" (S390_lowcore.program_new_psw),
"=Q" (old),
[rc] "+&d" (rc), [ry] "+d" (_ry) [rc] "+&d" (rc), [ry] "+d" (_ry)
: [rx] "d" (_rx1), "d" (_rx2) : [rx] "d" (_rx1), "d" (_rx2),
[psw_old] "a" (&old),
[psw_pgm] "a" (&S390_lowcore.program_new_psw)
: "cc", "memory"); : "cc", "memory");
S390_lowcore.program_new_psw = old;
return rc == 0 ? _ry : -1; return rc == 0 ? _ry : -1;
} }
@ -112,24 +115,30 @@ static int diag260(void)
static int tprot(unsigned long addr) static int tprot(unsigned long addr)
{ {
unsigned long pgm_addr; unsigned long reg1, reg2;
int rc = -EFAULT; int rc = -EFAULT;
psw_t old = S390_lowcore.program_new_psw; psw_t old;
S390_lowcore.program_new_psw.mask = __extract_psw();
asm volatile( asm volatile(
" larl %[pgm_addr],1f\n" " mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
" stg %[pgm_addr],%[psw_pgm_addr]\n" " epsw %[reg1],%[reg2]\n"
" st %[reg1],0(%[psw_pgm])\n"
" st %[reg2],4(%[psw_pgm])\n"
" larl %[reg1],1f\n"
" stg %[reg1],8(%[psw_pgm])\n"
" tprot 0(%[addr]),0\n" " tprot 0(%[addr]),0\n"
" ipm %[rc]\n" " ipm %[rc]\n"
" srl %[rc],28\n" " srl %[rc],28\n"
"1:\n" "1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
: [pgm_addr] "=&d"(pgm_addr), : [reg1] "=&d" (reg1),
[psw_pgm_addr] "=Q"(S390_lowcore.program_new_psw.addr), [reg2] "=&a" (reg2),
[rc] "+&d"(rc) [rc] "+&d" (rc),
: [addr] "a"(addr) "=Q" (S390_lowcore.program_new_psw.addr),
"=Q" (old)
: [psw_old] "a" (&old),
[psw_pgm] "a" (&S390_lowcore.program_new_psw),
[addr] "a" (addr)
: "cc", "memory"); : "cc", "memory");
S390_lowcore.program_new_psw = old;
return rc; return rc;
} }

View File

@ -215,7 +215,7 @@ static inline unsigned long current_stack_pointer(void)
return sp; return sp;
} }
static __no_kasan_or_inline unsigned short stap(void) static __always_inline unsigned short stap(void)
{ {
unsigned short cpu_address; unsigned short cpu_address;
@ -254,7 +254,7 @@ static inline void __load_psw(psw_t psw)
* Set PSW mask to specified value, while leaving the * Set PSW mask to specified value, while leaving the
* PSW addr pointing to the next instruction. * PSW addr pointing to the next instruction.
*/ */
static __no_kasan_or_inline void __load_psw_mask(unsigned long mask) static __always_inline void __load_psw_mask(unsigned long mask)
{ {
unsigned long addr; unsigned long addr;
psw_t psw; psw_t psw;

View File

@ -162,7 +162,7 @@ static void __init set_preferred_console(void)
else if (CONSOLE_IS_3270) else if (CONSOLE_IS_3270)
add_preferred_console("tty3270", 0, NULL); add_preferred_console("tty3270", 0, NULL);
else if (CONSOLE_IS_VT220) else if (CONSOLE_IS_VT220)
add_preferred_console("ttyS", 1, NULL); add_preferred_console("ttysclp", 0, NULL);
else if (CONSOLE_IS_HVC) else if (CONSOLE_IS_HVC)
add_preferred_console("hvc", 0, NULL); add_preferred_console("hvc", 0, NULL);
} }

View File

@ -256,7 +256,8 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out,
goto out_close; goto out_close;
} }
if (os_set_fd_block(*fd_out, 0)) { err = os_set_fd_block(*fd_out, 0);
if (err) {
printk(UM_KERN_ERR "winch_tramp: failed to set thread_fd " printk(UM_KERN_ERR "winch_tramp: failed to set thread_fd "
"non-blocking.\n"); "non-blocking.\n");
goto out_close; goto out_close;

View File

@ -145,7 +145,8 @@ static int slip_open(void *data)
} }
sfd = err; sfd = err;
if (set_up_tty(sfd)) err = set_up_tty(sfd);
if (err)
goto out_close2; goto out_close2;
pri->slave = sfd; pri->slave = sfd;

View File

@ -102,6 +102,7 @@ static inline void fpstate_init_fxstate(struct fxregs_state *fx)
} }
extern void fpstate_sanitize_xstate(struct fpu *fpu); extern void fpstate_sanitize_xstate(struct fpu *fpu);
/* Returns 0 or the negated trap number, which results in -EFAULT for #PF */
#define user_insn(insn, output, input...) \ #define user_insn(insn, output, input...) \
({ \ ({ \
int err; \ int err; \
@ -109,14 +110,14 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu);
might_fault(); \ might_fault(); \
\ \
asm volatile(ASM_STAC "\n" \ asm volatile(ASM_STAC "\n" \
"1:" #insn "\n\t" \ "1: " #insn "\n" \
"2: " ASM_CLAC "\n" \ "2: " ASM_CLAC "\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
"3: movl $-1,%[err]\n" \ "3: negl %%eax\n" \
" jmp 2b\n" \ " jmp 2b\n" \
".previous\n" \ ".previous\n" \
_ASM_EXTABLE(1b, 3b) \ _ASM_EXTABLE_FAULT(1b, 3b) \
: [err] "=r" (err), output \ : [err] "=a" (err), output \
: "0"(0), input); \ : "0"(0), input); \
err; \ err; \
}) })
@ -210,16 +211,20 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
#define XRSTOR ".byte " REX_PREFIX "0x0f,0xae,0x2f" #define XRSTOR ".byte " REX_PREFIX "0x0f,0xae,0x2f"
#define XRSTORS ".byte " REX_PREFIX "0x0f,0xc7,0x1f" #define XRSTORS ".byte " REX_PREFIX "0x0f,0xc7,0x1f"
/*
* After this @err contains 0 on success or the negated trap number when
* the operation raises an exception. For faults this results in -EFAULT.
*/
#define XSTATE_OP(op, st, lmask, hmask, err) \ #define XSTATE_OP(op, st, lmask, hmask, err) \
asm volatile("1:" op "\n\t" \ asm volatile("1:" op "\n\t" \
"xor %[err], %[err]\n" \ "xor %[err], %[err]\n" \
"2:\n\t" \ "2:\n\t" \
".pushsection .fixup,\"ax\"\n\t" \ ".pushsection .fixup,\"ax\"\n\t" \
"3: movl $-2,%[err]\n\t" \ "3: negl %%eax\n\t" \
"jmp 2b\n\t" \ "jmp 2b\n\t" \
".popsection\n\t" \ ".popsection\n\t" \
_ASM_EXTABLE(1b, 3b) \ _ASM_EXTABLE_FAULT(1b, 3b) \
: [err] "=r" (err) \ : [err] "=a" (err) \
: "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \ : "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \
: "memory") : "memory")

View File

@ -124,7 +124,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
/* /*
* A whole standard-format XSAVE buffer is needed: * A whole standard-format XSAVE buffer is needed:
*/ */
if ((pos != 0) || (count < fpu_user_xstate_size)) if (pos != 0 || count != fpu_user_xstate_size)
return -EFAULT; return -EFAULT;
xsave = &fpu->state.xsave; xsave = &fpu->state.xsave;

View File

@ -241,10 +241,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
void __user **fpstate) void __user **fpstate)
{ {
/* Default to using normal stack */ /* Default to using normal stack */
bool nested_altstack = on_sig_stack(regs->sp);
bool entering_altstack = false;
unsigned long math_size = 0; unsigned long math_size = 0;
unsigned long sp = regs->sp; unsigned long sp = regs->sp;
unsigned long buf_fx = 0; unsigned long buf_fx = 0;
int onsigstack = on_sig_stack(sp);
int ret; int ret;
/* redzone */ /* redzone */
@ -253,15 +254,23 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
/* This is the X/Open sanctioned signal stack switching. */ /* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) { if (ka->sa.sa_flags & SA_ONSTACK) {
if (sas_ss_flags(sp) == 0) /*
* This checks nested_altstack via sas_ss_flags(). Sensible
* programs use SS_AUTODISARM, which disables that check, and
* programs that don't use SS_AUTODISARM get compatible.
*/
if (sas_ss_flags(sp) == 0) {
sp = current->sas_ss_sp + current->sas_ss_size; sp = current->sas_ss_sp + current->sas_ss_size;
entering_altstack = true;
}
} else if (IS_ENABLED(CONFIG_X86_32) && } else if (IS_ENABLED(CONFIG_X86_32) &&
!onsigstack && !nested_altstack &&
regs->ss != __USER_DS && regs->ss != __USER_DS &&
!(ka->sa.sa_flags & SA_RESTORER) && !(ka->sa.sa_flags & SA_RESTORER) &&
ka->sa.sa_restorer) { ka->sa.sa_restorer) {
/* This is the legacy signal stack switching. */ /* This is the legacy signal stack switching. */
sp = (unsigned long) ka->sa.sa_restorer; sp = (unsigned long) ka->sa.sa_restorer;
entering_altstack = true;
} }
sp = fpu__alloc_mathframe(sp, IS_ENABLED(CONFIG_X86_32), sp = fpu__alloc_mathframe(sp, IS_ENABLED(CONFIG_X86_32),
@ -274,8 +283,15 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
* If we are on the alternate signal stack and would overflow it, don't. * If we are on the alternate signal stack and would overflow it, don't.
* Return an always-bogus address instead so we will die with SIGSEGV. * Return an always-bogus address instead so we will die with SIGSEGV.
*/ */
if (onsigstack && !likely(on_sig_stack(sp))) if (unlikely((nested_altstack || entering_altstack) &&
!__on_sig_stack(sp))) {
if (show_unhandled_signals && printk_ratelimit())
pr_info("%s[%d] overflowed sigaltstack\n",
current->comm, task_pid_nr(current));
return (void __user *)-1L; return (void __user *)-1L;
}
/* save i387 and extended state */ /* save i387 and extended state */
ret = copy_fpstate_to_sigframe(*fpstate, (void __user *)buf_fx, math_size); ret = copy_fpstate_to_sigframe(*fpstate, (void __user *)buf_fx, math_size);

View File

@ -745,8 +745,14 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
unsigned virt_as = max((entry->eax >> 8) & 0xff, 48U); unsigned virt_as = max((entry->eax >> 8) & 0xff, 48U);
unsigned phys_as = entry->eax & 0xff; unsigned phys_as = entry->eax & 0xff;
if (!g_phys_as) /*
* Use bare metal's MAXPHADDR if the CPU doesn't report guest
* MAXPHYADDR separately, or if TDP (NPT) is disabled, as the
* guest version "applies only to guests using nested paging".
*/
if (!g_phys_as || !tdp_enabled)
g_phys_as = phys_as; g_phys_as = phys_as;
entry->eax = g_phys_as | (virt_as << 8); entry->eax = g_phys_as | (virt_as << 8);
entry->edx = 0; entry->edx = 0;
entry->ebx &= kvm_cpuid_8000_0008_ebx_x86_features; entry->ebx &= kvm_cpuid_8000_0008_ebx_x86_features;

View File

@ -8271,6 +8271,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
set_debugreg(vcpu->arch.eff_db[3], 3); set_debugreg(vcpu->arch.eff_db[3], 3);
set_debugreg(vcpu->arch.dr6, 6); set_debugreg(vcpu->arch.dr6, 6);
vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_RELOAD; vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_RELOAD;
} else if (unlikely(hw_breakpoint_active())) {
set_debugreg(0, 7);
} }
kvm_x86_ops->run(vcpu); kvm_x86_ops->run(vcpu);

View File

@ -76,6 +76,7 @@ static int amba_handler_attach(struct acpi_device *adev,
case IORESOURCE_MEM: case IORESOURCE_MEM:
if (!address_found) { if (!address_found) {
dev->res = *rentry->res; dev->res = *rentry->res;
dev->res.name = dev_name(&dev->dev);
address_found = true; address_found = true;
} }
break; break;

View File

@ -543,6 +543,15 @@ static const struct dmi_system_id video_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"), DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"),
}, },
}, },
{
.callback = video_set_report_key_events,
.driver_data = (void *)((uintptr_t)REPORT_BRIGHTNESS_KEY_EVENTS),
.ident = "Dell Vostro 3350",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3350"),
},
},
/* /*
* Some machines change the brightness themselves when a brightness * Some machines change the brightness themselves when a brightness
* hotkey gets pressed, despite us telling them not to. In this case * hotkey gets pressed, despite us telling them not to. In this case

View File

@ -1057,6 +1057,8 @@ static int virtblk_freeze(struct virtio_device *vdev)
blk_mq_quiesce_queue(vblk->disk->queue); blk_mq_quiesce_queue(vblk->disk->queue);
vdev->config->del_vqs(vdev); vdev->config->del_vqs(vdev);
kfree(vblk->vqs);
return 0; return 0;
} }

View File

@ -475,7 +475,7 @@ static struct port_buffer *get_inbuf(struct port *port)
buf = virtqueue_get_buf(port->in_vq, &len); buf = virtqueue_get_buf(port->in_vq, &len);
if (buf) { if (buf) {
buf->len = len; buf->len = min_t(size_t, len, buf->size);
buf->offset = 0; buf->offset = 0;
port->stats.bytes_received += len; port->stats.bytes_received += len;
} }
@ -1714,7 +1714,7 @@ static void control_work_handler(struct work_struct *work)
while ((buf = virtqueue_get_buf(vq, &len))) { while ((buf = virtqueue_get_buf(vq, &len))) {
spin_unlock(&portdev->c_ivq_lock); spin_unlock(&portdev->c_ivq_lock);
buf->len = len; buf->len = min_t(size_t, len, buf->size);
buf->offset = 0; buf->offset = 0;
handle_control_message(vq->vdev, portdev, buf); handle_control_message(vq->vdev, portdev, buf);

View File

@ -1184,7 +1184,11 @@ static int fsl_qdma_probe(struct platform_device *pdev)
fsl_qdma->dma_dev.device_synchronize = fsl_qdma_synchronize; fsl_qdma->dma_dev.device_synchronize = fsl_qdma_synchronize;
fsl_qdma->dma_dev.device_terminate_all = fsl_qdma_terminate_all; fsl_qdma->dma_dev.device_terminate_all = fsl_qdma_terminate_all;
dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)); ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
if (ret) {
dev_err(&pdev->dev, "dma_set_mask failure.\n");
return ret;
}
platform_set_drvdata(pdev, fsl_qdma); platform_set_drvdata(pdev, fsl_qdma);

View File

@ -370,6 +370,10 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
xfer = &minfo->xfer_block[xfer_id]; xfer = &minfo->xfer_block[xfer_id];
/* rx.len could be shrunk in the sync do_xfer, so reset to maxsz */
if (msg_type == MSG_TYPE_DELAYED_RESP)
xfer->rx.len = info->desc->max_msg_size;
scmi_dump_header_dbg(dev, &xfer->hdr); scmi_dump_header_dbg(dev, &xfer->hdr);
scmi_fetch_response(xfer, mem); scmi_fetch_response(xfer, mem);

View File

@ -210,7 +210,7 @@ static int tegra210_bpmp_init(struct tegra_bpmp *bpmp)
priv->tx_irq_data = irq_get_irq_data(err); priv->tx_irq_data = irq_get_irq_data(err);
if (!priv->tx_irq_data) { if (!priv->tx_irq_data) {
dev_err(&pdev->dev, "failed to get IRQ data for TX IRQ\n"); dev_err(&pdev->dev, "failed to get IRQ data for TX IRQ\n");
return err; return -ENOENT;
} }
err = platform_get_irq_byname(pdev, "rx"); err = platform_get_irq_byname(pdev, "rx");

View File

@ -134,11 +134,14 @@ MOX_ATTR_RO(pubkey, "%s\n", pubkey);
static int mox_get_status(enum mbox_cmd cmd, u32 retval) static int mox_get_status(enum mbox_cmd cmd, u32 retval)
{ {
if (MBOX_STS_CMD(retval) != cmd || if (MBOX_STS_CMD(retval) != cmd)
MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS)
return -EIO; return -EIO;
else if (MBOX_STS_ERROR(retval) == MBOX_STS_FAIL) else if (MBOX_STS_ERROR(retval) == MBOX_STS_FAIL)
return -(int)MBOX_STS_VALUE(retval); return -(int)MBOX_STS_VALUE(retval);
else if (MBOX_STS_ERROR(retval) == MBOX_STS_BADCMD)
return -ENOSYS;
else if (MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS)
return -EIO;
else else
return MBOX_STS_VALUE(retval); return MBOX_STS_VALUE(retval);
} }
@ -188,11 +191,14 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
return ret; return ret;
ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval); ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval);
if (ret < 0 && ret != -ENODATA) { if (ret == -ENODATA) {
return ret;
} else if (ret == -ENODATA) {
dev_warn(rwtm->dev, dev_warn(rwtm->dev,
"Board does not have manufacturing information burned!\n"); "Board does not have manufacturing information burned!\n");
} else if (ret == -ENOSYS) {
dev_notice(rwtm->dev,
"Firmware does not support the BOARD_INFO command\n");
} else if (ret < 0) {
return ret;
} else { } else {
rwtm->serial_number = reply->status[1]; rwtm->serial_number = reply->status[1];
rwtm->serial_number <<= 32; rwtm->serial_number <<= 32;
@ -221,10 +227,13 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
return ret; return ret;
ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval); ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval);
if (ret < 0 && ret != -ENODATA) { if (ret == -ENODATA) {
return ret;
} else if (ret == -ENODATA) {
dev_warn(rwtm->dev, "Board has no public key burned!\n"); dev_warn(rwtm->dev, "Board has no public key burned!\n");
} else if (ret == -ENOSYS) {
dev_notice(rwtm->dev,
"Firmware does not support the ECDSA_PUB_KEY command\n");
} else if (ret < 0) {
return ret;
} else { } else {
u32 *s = reply->status; u32 *s = reply->status;
@ -238,6 +247,27 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
return 0; return 0;
} }
static int check_get_random_support(struct mox_rwtm *rwtm)
{
struct armada_37xx_rwtm_tx_msg msg;
int ret;
msg.command = MBOX_CMD_GET_RANDOM;
msg.args[0] = 1;
msg.args[1] = rwtm->buf_phys;
msg.args[2] = 4;
ret = mbox_send_message(rwtm->mbox, &msg);
if (ret < 0)
return ret;
ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2);
if (ret < 0)
return ret;
return mox_get_status(MBOX_CMD_GET_RANDOM, rwtm->reply.retval);
}
static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait) static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{ {
struct mox_rwtm *rwtm = (struct mox_rwtm *) rng->priv; struct mox_rwtm *rwtm = (struct mox_rwtm *) rng->priv;
@ -329,6 +359,13 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
dev_warn(dev, "Cannot read board information: %i\n", ret); dev_warn(dev, "Cannot read board information: %i\n", ret);
ret = check_get_random_support(rwtm);
if (ret < 0) {
dev_notice(dev,
"Firmware does not support the GET_RANDOM command\n");
goto free_channel;
}
rwtm->hwrng.name = DRIVER_NAME "_hwrng"; rwtm->hwrng.name = DRIVER_NAME "_hwrng";
rwtm->hwrng.read = mox_hwrng_read; rwtm->hwrng.read = mox_hwrng_read;
rwtm->hwrng.priv = (unsigned long) rwtm; rwtm->hwrng.priv = (unsigned long) rwtm;

View File

@ -1289,6 +1289,7 @@ static const struct of_device_id pca953x_dt_ids[] = {
{ .compatible = "onnn,cat9554", .data = OF_953X( 8, PCA_INT), }, { .compatible = "onnn,cat9554", .data = OF_953X( 8, PCA_INT), },
{ .compatible = "onnn,pca9654", .data = OF_953X( 8, PCA_INT), }, { .compatible = "onnn,pca9654", .data = OF_953X( 8, PCA_INT), },
{ .compatible = "onnn,pca9655", .data = OF_953X(16, PCA_INT), },
{ .compatible = "exar,xra1202", .data = OF_953X( 8, 0), }, { .compatible = "exar,xra1202", .data = OF_953X( 8, 0), },
{ } { }

View File

@ -938,8 +938,11 @@ err_pm_dis:
static int zynq_gpio_remove(struct platform_device *pdev) static int zynq_gpio_remove(struct platform_device *pdev)
{ {
struct zynq_gpio *gpio = platform_get_drvdata(pdev); struct zynq_gpio *gpio = platform_get_drvdata(pdev);
int ret;
pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
dev_warn(&pdev->dev, "pm_runtime_get_sync() Failed\n");
gpiochip_remove(&gpio->chip); gpiochip_remove(&gpio->chip);
clk_disable_unprepare(gpio->clk); clk_disable_unprepare(gpio->clk);
device_set_wakeup_capable(&pdev->dev, 0); device_set_wakeup_capable(&pdev->dev, 0);

View File

@ -215,6 +215,22 @@ static ssize_t port_show(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR_RO(port); static DEVICE_ATTR_RO(port);
static void intel_th_trace_prepare(struct intel_th_device *thdev)
{
struct intel_th_device *hub = to_intel_th_hub(thdev);
struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
if (hub->type != INTEL_TH_SWITCH)
return;
if (thdev->type != INTEL_TH_OUTPUT)
return;
pm_runtime_get_sync(&thdev->dev);
hubdrv->prepare(hub, &thdev->output);
pm_runtime_put(&thdev->dev);
}
static int intel_th_output_activate(struct intel_th_device *thdev) static int intel_th_output_activate(struct intel_th_device *thdev)
{ {
struct intel_th_driver *thdrv = struct intel_th_driver *thdrv =
@ -235,6 +251,7 @@ static int intel_th_output_activate(struct intel_th_device *thdev)
if (ret) if (ret)
goto fail_put; goto fail_put;
intel_th_trace_prepare(thdev);
if (thdrv->activate) if (thdrv->activate)
ret = thdrv->activate(thdev); ret = thdrv->activate(thdev);
else else

View File

@ -564,6 +564,21 @@ static void gth_tscu_resync(struct gth_device *gth)
iowrite32(reg, gth->base + REG_TSCU_TSUCTRL); iowrite32(reg, gth->base + REG_TSCU_TSUCTRL);
} }
static void intel_th_gth_prepare(struct intel_th_device *thdev,
struct intel_th_output *output)
{
struct gth_device *gth = dev_get_drvdata(&thdev->dev);
int count;
/*
* Wait until the output port is in reset before we start
* programming it.
*/
for (count = GTH_PLE_WAITLOOP_DEPTH;
count && !(gth_output_get(gth, output->port) & BIT(5)); count--)
cpu_relax();
}
/** /**
* intel_th_gth_enable() - enable tracing to an output device * intel_th_gth_enable() - enable tracing to an output device
* @thdev: GTH device * @thdev: GTH device
@ -815,6 +830,7 @@ static struct intel_th_driver intel_th_gth_driver = {
.assign = intel_th_gth_assign, .assign = intel_th_gth_assign,
.unassign = intel_th_gth_unassign, .unassign = intel_th_gth_unassign,
.set_output = intel_th_gth_set_output, .set_output = intel_th_gth_set_output,
.prepare = intel_th_gth_prepare,
.enable = intel_th_gth_enable, .enable = intel_th_gth_enable,
.trig_switch = intel_th_gth_switch, .trig_switch = intel_th_gth_switch,
.disable = intel_th_gth_disable, .disable = intel_th_gth_disable,

View File

@ -143,6 +143,7 @@ intel_th_output_assigned(struct intel_th_device *thdev)
* @remove: remove method * @remove: remove method
* @assign: match a given output type device against available outputs * @assign: match a given output type device against available outputs
* @unassign: deassociate an output type device from an output port * @unassign: deassociate an output type device from an output port
* @prepare: prepare output port for tracing
* @enable: enable tracing for a given output device * @enable: enable tracing for a given output device
* @disable: disable tracing for a given output device * @disable: disable tracing for a given output device
* @irq: interrupt callback * @irq: interrupt callback
@ -164,6 +165,8 @@ struct intel_th_driver {
struct intel_th_device *othdev); struct intel_th_device *othdev);
void (*unassign)(struct intel_th_device *thdev, void (*unassign)(struct intel_th_device *thdev,
struct intel_th_device *othdev); struct intel_th_device *othdev);
void (*prepare)(struct intel_th_device *thdev,
struct intel_th_output *output);
void (*enable)(struct intel_th_device *thdev, void (*enable)(struct intel_th_device *thdev,
struct intel_th_output *output); struct intel_th_output *output);
void (*trig_switch)(struct intel_th_device *thdev, void (*trig_switch)(struct intel_th_device *thdev,

View File

@ -24,6 +24,7 @@
#include <linux/i2c-smbus.h> #include <linux/i2c-smbus.h>
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/jump_label.h> #include <linux/jump_label.h>
#include <linux/kernel.h> #include <linux/kernel.h>
@ -459,6 +460,8 @@ static void i2c_device_shutdown(struct device *dev)
driver = to_i2c_driver(dev->driver); driver = to_i2c_driver(dev->driver);
if (driver->shutdown) if (driver->shutdown)
driver->shutdown(client); driver->shutdown(client);
else if (client->irq > 0)
disable_irq(client->irq);
} }
static void i2c_client_dev_release(struct device *dev) static void i2c_client_dev_release(struct device *dev)

View File

@ -300,14 +300,7 @@ out_unlock:
static int fxas21002c_pm_get(struct fxas21002c_data *data) static int fxas21002c_pm_get(struct fxas21002c_data *data)
{ {
struct device *dev = regmap_get_device(data->regmap); return pm_runtime_resume_and_get(regmap_get_device(data->regmap));
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0)
pm_runtime_put_noidle(dev);
return ret;
} }
static int fxas21002c_pm_put(struct fxas21002c_data *data) static int fxas21002c_pm_put(struct fxas21002c_data *data)
@ -940,7 +933,6 @@ int fxas21002c_core_probe(struct device *dev, struct regmap *regmap, int irq,
pm_disable: pm_disable:
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_suspended(dev); pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
return ret; return ret;
} }
@ -954,7 +946,6 @@ void fxas21002c_core_remove(struct device *dev)
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_suspended(dev); pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
} }
EXPORT_SYMBOL_GPL(fxas21002c_core_remove); EXPORT_SYMBOL_GPL(fxas21002c_core_remove);

View File

@ -263,7 +263,7 @@ static int bmc150_magn_set_power_state(struct bmc150_magn_data *data, bool on)
int ret; int ret;
if (on) { if (on) {
ret = pm_runtime_get_sync(data->dev); ret = pm_runtime_resume_and_get(data->dev);
} else { } else {
pm_runtime_mark_last_busy(data->dev); pm_runtime_mark_last_busy(data->dev);
ret = pm_runtime_put_autosuspend(data->dev); ret = pm_runtime_put_autosuspend(data->dev);
@ -272,9 +272,6 @@ static int bmc150_magn_set_power_state(struct bmc150_magn_data *data, bool on)
if (ret < 0) { if (ret < 0) {
dev_err(data->dev, dev_err(data->dev,
"failed to change power state to %d\n", on); "failed to change power state to %d\n", on);
if (on)
pm_runtime_put_noidle(data->dev);
return ret; return ret;
} }
#endif #endif
@ -947,12 +944,14 @@ int bmc150_magn_probe(struct device *dev, struct regmap *regmap,
ret = iio_device_register(indio_dev); ret = iio_device_register(indio_dev);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "unable to register iio device\n"); dev_err(dev, "unable to register iio device\n");
goto err_buffer_cleanup; goto err_disable_runtime_pm;
} }
dev_dbg(dev, "Registered device %s\n", name); dev_dbg(dev, "Registered device %s\n", name);
return 0; return 0;
err_disable_runtime_pm:
pm_runtime_disable(dev);
err_buffer_cleanup: err_buffer_cleanup:
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);
err_free_irq: err_free_irq:
@ -976,7 +975,6 @@ int bmc150_magn_remove(struct device *dev)
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_suspended(dev); pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);

View File

@ -361,13 +361,16 @@ static int hideep_enter_pgm(struct hideep_ts *ts)
return -EIO; return -EIO;
} }
static void hideep_nvm_unlock(struct hideep_ts *ts) static int hideep_nvm_unlock(struct hideep_ts *ts)
{ {
u32 unmask_code; u32 unmask_code;
int error;
hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_SFR_RPAGE); hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_SFR_RPAGE);
hideep_pgm_r_reg(ts, 0x0000000C, &unmask_code); error = hideep_pgm_r_reg(ts, 0x0000000C, &unmask_code);
hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_DEFAULT_PAGE); hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_DEFAULT_PAGE);
if (error)
return error;
/* make it unprotected code */ /* make it unprotected code */
unmask_code &= ~HIDEEP_PROT_MODE; unmask_code &= ~HIDEEP_PROT_MODE;
@ -384,6 +387,8 @@ static void hideep_nvm_unlock(struct hideep_ts *ts)
NVM_W_SFR(HIDEEP_NVM_MASK_OFS, ts->nvm_mask); NVM_W_SFR(HIDEEP_NVM_MASK_OFS, ts->nvm_mask);
SET_FLASH_HWCONTROL(); SET_FLASH_HWCONTROL();
hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_DEFAULT_PAGE); hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_DEFAULT_PAGE);
return 0;
} }
static int hideep_check_status(struct hideep_ts *ts) static int hideep_check_status(struct hideep_ts *ts)
@ -462,7 +467,9 @@ static int hideep_program_nvm(struct hideep_ts *ts,
u32 addr = 0; u32 addr = 0;
int error; int error;
hideep_nvm_unlock(ts); error = hideep_nvm_unlock(ts);
if (error)
return error;
while (ucode_len > 0) { while (ucode_len > 0) {
xfer_len = min_t(size_t, ucode_len, HIDEEP_NVM_PAGE_SIZE); xfer_len = min_t(size_t, ucode_len, HIDEEP_NVM_PAGE_SIZE);

View File

@ -114,7 +114,7 @@ static bool using_legacy_binding, using_generic_binding;
static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu) static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu)
{ {
if (pm_runtime_enabled(smmu->dev)) if (pm_runtime_enabled(smmu->dev))
return pm_runtime_get_sync(smmu->dev); return pm_runtime_resume_and_get(smmu->dev);
return 0; return 0;
} }
@ -1231,6 +1231,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
u64 phys; u64 phys;
unsigned long va, flags; unsigned long va, flags;
int ret, idx = cfg->cbndx; int ret, idx = cfg->cbndx;
phys_addr_t addr = 0;
ret = arm_smmu_rpm_get(smmu); ret = arm_smmu_rpm_get(smmu);
if (ret < 0) if (ret < 0)
@ -1249,6 +1250,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
dev_err(dev, dev_err(dev,
"iova to phys timed out on %pad. Falling back to software table walk.\n", "iova to phys timed out on %pad. Falling back to software table walk.\n",
&iova); &iova);
arm_smmu_rpm_put(smmu);
return ops->iova_to_phys(ops, iova); return ops->iova_to_phys(ops, iova);
} }
@ -1257,12 +1259,14 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
if (phys & CB_PAR_F) { if (phys & CB_PAR_F) {
dev_err(dev, "translation fault!\n"); dev_err(dev, "translation fault!\n");
dev_err(dev, "PAR = 0x%llx\n", phys); dev_err(dev, "PAR = 0x%llx\n", phys);
return 0; goto out;
} }
addr = (phys & GENMASK_ULL(39, 12)) | (iova & 0xfff);
out:
arm_smmu_rpm_put(smmu); arm_smmu_rpm_put(smmu);
return (phys & GENMASK_ULL(39, 12)) | (iova & 0xfff); return addr;
} }
static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain, static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain,

View File

@ -601,8 +601,10 @@ static int atmel_ebi_probe(struct platform_device *pdev)
child); child);
ret = atmel_ebi_dev_disable(ebi, child); ret = atmel_ebi_dev_disable(ebi, child);
if (ret) if (ret) {
of_node_put(child);
return ret; return ret;
}
} }
} }

View File

@ -99,7 +99,6 @@ static int fsl_ifc_ctrl_remove(struct platform_device *dev)
iounmap(ctrl->gregs); iounmap(ctrl->gregs);
dev_set_drvdata(&dev->dev, NULL); dev_set_drvdata(&dev->dev, NULL);
kfree(ctrl);
return 0; return 0;
} }
@ -211,7 +210,8 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
dev_info(&dev->dev, "Freescale Integrated Flash Controller\n"); dev_info(&dev->dev, "Freescale Integrated Flash Controller\n");
fsl_ifc_ctrl_dev = kzalloc(sizeof(*fsl_ifc_ctrl_dev), GFP_KERNEL); fsl_ifc_ctrl_dev = devm_kzalloc(&dev->dev, sizeof(*fsl_ifc_ctrl_dev),
GFP_KERNEL);
if (!fsl_ifc_ctrl_dev) if (!fsl_ifc_ctrl_dev)
return -ENOMEM; return -ENOMEM;
@ -221,8 +221,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
fsl_ifc_ctrl_dev->gregs = of_iomap(dev->dev.of_node, 0); fsl_ifc_ctrl_dev->gregs = of_iomap(dev->dev.of_node, 0);
if (!fsl_ifc_ctrl_dev->gregs) { if (!fsl_ifc_ctrl_dev->gregs) {
dev_err(&dev->dev, "failed to get memory region\n"); dev_err(&dev->dev, "failed to get memory region\n");
ret = -ENODEV; return -ENODEV;
goto err;
} }
if (of_property_read_bool(dev->dev.of_node, "little-endian")) { if (of_property_read_bool(dev->dev.of_node, "little-endian")) {
@ -298,6 +297,7 @@ err_irq:
free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev); free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
irq_dispose_mapping(fsl_ifc_ctrl_dev->irq); irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
err: err:
iounmap(fsl_ifc_ctrl_dev->gregs);
return ret; return ret;
} }

View File

@ -407,6 +407,7 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
break; break;
} }
if (!match) { if (!match) {
err = -ENODEV;
dev_err(&adev->dev, "no matching children\n"); dev_err(&adev->dev, "no matching children\n");
goto out_clk_disable; goto out_clk_disable;
} }

View File

@ -113,6 +113,7 @@ static const struct i2c_device_id da9052_i2c_id[] = {
{"da9053-bc", DA9053_BC}, {"da9053-bc", DA9053_BC},
{} {}
}; };
MODULE_DEVICE_TABLE(i2c, da9052_i2c_id);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id dialog_dt_ids[] = { static const struct of_device_id dialog_dt_ids[] = {

View File

@ -305,6 +305,10 @@ static int cpcap_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
/* Parent SPI controller uses DMA, CPCAP and child devices do not */
spi->dev.coherent_dma_mask = 0;
spi->dev.dma_mask = &spi->dev.coherent_dma_mask;
return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices, return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL); ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
} }

View File

@ -109,7 +109,7 @@ static const struct i2c_device_id stmpe_i2c_id[] = {
{ "stmpe2403", STMPE2403 }, { "stmpe2403", STMPE2403 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, stmpe_id); MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
static struct i2c_driver stmpe_i2c_driver = { static struct i2c_driver stmpe_i2c_driver = {
.driver = { .driver = {

View File

@ -133,7 +133,13 @@ static void alcor_pci_init_check_aspm(struct alcor_pci_priv *priv)
u32 val32; u32 val32;
priv->pdev_cap_off = alcor_pci_find_cap_offset(priv, priv->pdev); priv->pdev_cap_off = alcor_pci_find_cap_offset(priv, priv->pdev);
priv->parent_cap_off = alcor_pci_find_cap_offset(priv, /*
* A device might be attached to root complex directly and
* priv->parent_pdev will be NULL. In this case we don't check its
* capability and disable ASPM completely.
*/
if (priv->parent_pdev)
priv->parent_cap_off = alcor_pci_find_cap_offset(priv,
priv->parent_pdev); priv->parent_pdev);
if ((priv->pdev_cap_off == 0) || (priv->parent_cap_off == 0)) { if ((priv->pdev_cap_off == 0) || (priv->parent_cap_off == 0)) {

View File

@ -111,7 +111,7 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
result = ibmasm_init_remote_input_dev(sp); result = ibmasm_init_remote_input_dev(sp);
if (result) { if (result) {
dev_err(sp->dev, "Failed to initialize remote queue\n"); dev_err(sp->dev, "Failed to initialize remote queue\n");
goto error_send_message; goto error_init_remote;
} }
result = ibmasm_send_driver_vpd(sp); result = ibmasm_send_driver_vpd(sp);
@ -131,8 +131,9 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
return 0; return 0;
error_send_message: error_send_message:
disable_sp_interrupts(sp->base_address);
ibmasm_free_remote_input_dev(sp); ibmasm_free_remote_input_dev(sp);
error_init_remote:
disable_sp_interrupts(sp->base_address);
free_irq(sp->irq, (void *)sp); free_irq(sp->irq, (void *)sp);
error_request_irq: error_request_irq:
iounmap(sp->base_address); iounmap(sp->base_address);

View File

@ -481,6 +481,10 @@ static int moxart_mac_probe(struct platform_device *pdev)
priv->pdev = pdev; priv->pdev = pdev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
ret = -EINVAL;
goto init_fail;
}
ndev->base_addr = res->start; ndev->base_addr = res->start;
priv->base = devm_ioremap_resource(p_dev, res); priv->base = devm_ioremap_resource(p_dev, res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {

View File

@ -1504,6 +1504,8 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget)
struct virtnet_info *vi = sq->vq->vdev->priv; struct virtnet_info *vi = sq->vq->vdev->priv;
unsigned int index = vq2txq(sq->vq); unsigned int index = vq2txq(sq->vq);
struct netdev_queue *txq; struct netdev_queue *txq;
int opaque;
bool done;
if (unlikely(is_xdp_raw_buffer_queue(vi, index))) { if (unlikely(is_xdp_raw_buffer_queue(vi, index))) {
/* We don't need to enable cb for XDP */ /* We don't need to enable cb for XDP */
@ -1513,10 +1515,28 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget)
txq = netdev_get_tx_queue(vi->dev, index); txq = netdev_get_tx_queue(vi->dev, index);
__netif_tx_lock(txq, raw_smp_processor_id()); __netif_tx_lock(txq, raw_smp_processor_id());
virtqueue_disable_cb(sq->vq);
free_old_xmit_skbs(sq, true); free_old_xmit_skbs(sq, true);
opaque = virtqueue_enable_cb_prepare(sq->vq);
done = napi_complete_done(napi, 0);
if (!done)
virtqueue_disable_cb(sq->vq);
__netif_tx_unlock(txq); __netif_tx_unlock(txq);
virtqueue_napi_complete(napi, sq->vq, 0); if (done) {
if (unlikely(virtqueue_poll(sq->vq, opaque))) {
if (napi_schedule_prep(napi)) {
__netif_tx_lock(txq, raw_smp_processor_id());
virtqueue_disable_cb(sq->vq);
__netif_tx_unlock(txq);
__napi_schedule(napi);
}
}
}
if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS) if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS)
netif_tx_wake_queue(txq); netif_tx_wake_queue(txq);
@ -3282,8 +3302,11 @@ static __maybe_unused int virtnet_restore(struct virtio_device *vdev)
virtnet_set_queues(vi, vi->curr_queue_pairs); virtnet_set_queues(vi, vi->curr_queue_pairs);
err = virtnet_cpu_notif_add(vi); err = virtnet_cpu_notif_add(vi);
if (err) if (err) {
virtnet_freeze_down(vdev);
remove_vq_common(vi);
return err; return err;
}
return 0; return 0;
} }

View File

@ -1412,7 +1412,6 @@ static void nvmet_tcp_state_change(struct sock *sk)
case TCP_CLOSE_WAIT: case TCP_CLOSE_WAIT:
case TCP_CLOSE: case TCP_CLOSE:
/* FALLTHRU */ /* FALLTHRU */
sk->sk_user_data = NULL;
nvmet_tcp_schedule_release_queue(queue); nvmet_tcp_schedule_release_queue(queue);
break; break;
default: default:

View File

@ -2613,6 +2613,7 @@ static const struct of_device_id tegra_pcie_of_match[] = {
{ .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie }, { .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, tegra_pcie_of_match);
static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos) static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
{ {

View File

@ -171,7 +171,7 @@ static struct irq_chip iproc_msi_irq_chip = {
static struct msi_domain_info iproc_msi_domain_info = { static struct msi_domain_info iproc_msi_domain_info = {
.flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX, MSI_FLAG_PCI_MSIX,
.chip = &iproc_msi_irq_chip, .chip = &iproc_msi_irq_chip,
}; };
@ -250,20 +250,23 @@ static int iproc_msi_irq_domain_alloc(struct irq_domain *domain,
struct iproc_msi *msi = domain->host_data; struct iproc_msi *msi = domain->host_data;
int hwirq, i; int hwirq, i;
if (msi->nr_cpus > 1 && nr_irqs > 1)
return -EINVAL;
mutex_lock(&msi->bitmap_lock); mutex_lock(&msi->bitmap_lock);
/* Allocate 'nr_cpus' number of MSI vectors each time */ /*
hwirq = bitmap_find_next_zero_area(msi->bitmap, msi->nr_msi_vecs, 0, * Allocate 'nr_irqs' multiplied by 'nr_cpus' number of MSI vectors
msi->nr_cpus, 0); * each time
if (hwirq < msi->nr_msi_vecs) { */
bitmap_set(msi->bitmap, hwirq, msi->nr_cpus); hwirq = bitmap_find_free_region(msi->bitmap, msi->nr_msi_vecs,
} else { order_base_2(msi->nr_cpus * nr_irqs));
mutex_unlock(&msi->bitmap_lock);
return -ENOSPC;
}
mutex_unlock(&msi->bitmap_lock); mutex_unlock(&msi->bitmap_lock);
if (hwirq < 0)
return -ENOSPC;
for (i = 0; i < nr_irqs; i++) { for (i = 0; i < nr_irqs; i++) {
irq_domain_set_info(domain, virq + i, hwirq + i, irq_domain_set_info(domain, virq + i, hwirq + i,
&iproc_msi_bottom_irq_chip, &iproc_msi_bottom_irq_chip,
@ -284,7 +287,8 @@ static void iproc_msi_irq_domain_free(struct irq_domain *domain,
mutex_lock(&msi->bitmap_lock); mutex_lock(&msi->bitmap_lock);
hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq); hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq);
bitmap_clear(msi->bitmap, hwirq, msi->nr_cpus); bitmap_release_region(msi->bitmap, hwirq,
order_base_2(msi->nr_cpus * nr_irqs));
mutex_unlock(&msi->bitmap_lock); mutex_unlock(&msi->bitmap_lock);
@ -538,6 +542,9 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node)
mutex_init(&msi->bitmap_lock); mutex_init(&msi->bitmap_lock);
msi->nr_cpus = num_possible_cpus(); msi->nr_cpus = num_possible_cpus();
if (msi->nr_cpus == 1)
iproc_msi_domain_info.flags |= MSI_FLAG_MULTI_PCI_MSI;
msi->nr_irqs = of_irq_count(node); msi->nr_irqs = of_irq_count(node);
if (!msi->nr_irqs) { if (!msi->nr_irqs) {
dev_err(pcie->dev, "found no MSI GIC interrupt\n"); dev_err(pcie->dev, "found no MSI GIC interrupt\n");

View File

@ -292,10 +292,41 @@ static const struct pci_p2pdma_whitelist_entry {
{} {}
}; };
/*
* This lookup function tries to find the PCI device corresponding to a given
* host bridge.
*
* It assumes the host bridge device is the first PCI device in the
* bus->devices list and that the devfn is 00.0. These assumptions should hold
* for all the devices in the whitelist above.
*
* This function is equivalent to pci_get_slot(host->bus, 0), however it does
* not take the pci_bus_sem lock seeing __host_bridge_whitelist() must not
* sleep.
*
* For this to be safe, the caller should hold a reference to a device on the
* bridge, which should ensure the host_bridge device will not be freed
* or removed from the head of the devices list.
*/
static struct pci_dev *pci_host_bridge_dev(struct pci_host_bridge *host)
{
struct pci_dev *root;
root = list_first_entry_or_null(&host->bus->devices,
struct pci_dev, bus_list);
if (!root)
return NULL;
if (root->devfn != PCI_DEVFN(0, 0))
return NULL;
return root;
}
static bool __host_bridge_whitelist(struct pci_host_bridge *host, static bool __host_bridge_whitelist(struct pci_host_bridge *host,
bool same_host_bridge) bool same_host_bridge)
{ {
struct pci_dev *root = pci_get_slot(host->bus, PCI_DEVFN(0, 0)); struct pci_dev *root = pci_host_bridge_dev(host);
const struct pci_p2pdma_whitelist_entry *entry; const struct pci_p2pdma_whitelist_entry *entry;
unsigned short vendor, device; unsigned short vendor, device;
@ -304,7 +335,6 @@ static bool __host_bridge_whitelist(struct pci_host_bridge *host,
vendor = root->vendor; vendor = root->vendor;
device = root->device; device = root->device;
pci_dev_put(root);
for (entry = pci_p2pdma_whitelist; entry->vendor; entry++) { for (entry = pci_p2pdma_whitelist; entry->vendor; entry++) {
if (vendor != entry->vendor || device != entry->device) if (vendor != entry->vendor || device != entry->device)

View File

@ -162,7 +162,7 @@ static void dsm_label_utf16s_to_utf8s(union acpi_object *obj, char *buf)
len = utf16s_to_utf8s((const wchar_t *)obj->buffer.pointer, len = utf16s_to_utf8s((const wchar_t *)obj->buffer.pointer,
obj->buffer.length, obj->buffer.length,
UTF16_LITTLE_ENDIAN, UTF16_LITTLE_ENDIAN,
buf, PAGE_SIZE); buf, PAGE_SIZE - 1);
buf[len] = '\n'; buf[len] = '\n';
} }

View File

@ -90,6 +90,7 @@ static const struct of_device_id of_gpio_poweroff_match[] = {
{ .compatible = "gpio-poweroff", }, { .compatible = "gpio-poweroff", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, of_gpio_poweroff_match);
static struct platform_driver gpio_poweroff_driver = { static struct platform_driver gpio_poweroff_driver = {
.probe = gpio_poweroff_probe, .probe = gpio_poweroff_probe,

View File

@ -651,7 +651,8 @@ config BATTERY_GOLDFISH
config BATTERY_RT5033 config BATTERY_RT5033
tristate "RT5033 fuel gauge support" tristate "RT5033 fuel gauge support"
depends on MFD_RT5033 depends on I2C
select REGMAP_I2C
help help
This adds support for battery fuel gauge in Richtek RT5033 PMIC. This adds support for battery fuel gauge in Richtek RT5033 PMIC.
The fuelgauge calculates and determines the battery state of charge The fuelgauge calculates and determines the battery state of charge

View File

@ -1120,6 +1120,7 @@ static const struct of_device_id ab8500_btemp_match[] = {
{ .compatible = "stericsson,ab8500-btemp", }, { .compatible = "stericsson,ab8500-btemp", },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, ab8500_btemp_match);
static struct platform_driver ab8500_btemp_driver = { static struct platform_driver ab8500_btemp_driver = {
.probe = ab8500_btemp_probe, .probe = ab8500_btemp_probe,

View File

@ -407,6 +407,14 @@ disable_otp:
static void ab8500_power_supply_changed(struct ab8500_charger *di, static void ab8500_power_supply_changed(struct ab8500_charger *di,
struct power_supply *psy) struct power_supply *psy)
{ {
/*
* This happens if we get notifications or interrupts and
* the platform has been configured not to support one or
* other type of charging.
*/
if (!psy)
return;
if (di->autopower_cfg) { if (di->autopower_cfg) {
if (!di->usb.charger_connected && if (!di->usb.charger_connected &&
!di->ac.charger_connected && !di->ac.charger_connected &&
@ -433,7 +441,15 @@ static void ab8500_charger_set_usb_connected(struct ab8500_charger *di,
if (!connected) if (!connected)
di->flags.vbus_drop_end = false; di->flags.vbus_drop_end = false;
sysfs_notify(&di->usb_chg.psy->dev.kobj, NULL, "present"); /*
* Sometimes the platform is configured not to support
* USB charging and no psy has been created, but we still
* will get these notifications.
*/
if (di->usb_chg.psy) {
sysfs_notify(&di->usb_chg.psy->dev.kobj, NULL,
"present");
}
if (connected) { if (connected) {
mutex_lock(&di->charger_attached_mutex); mutex_lock(&di->charger_attached_mutex);
@ -3617,6 +3633,7 @@ static const struct of_device_id ab8500_charger_match[] = {
{ .compatible = "stericsson,ab8500-charger", }, { .compatible = "stericsson,ab8500-charger", },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, ab8500_charger_match);
static struct platform_driver ab8500_charger_driver = { static struct platform_driver ab8500_charger_driver = {
.probe = ab8500_charger_probe, .probe = ab8500_charger_probe,

View File

@ -3230,6 +3230,7 @@ static const struct of_device_id ab8500_fg_match[] = {
{ .compatible = "stericsson,ab8500-fg", }, { .compatible = "stericsson,ab8500-fg", },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, ab8500_fg_match);
static struct platform_driver ab8500_fg_driver = { static struct platform_driver ab8500_fg_driver = {
.probe = ab8500_fg_probe, .probe = ab8500_fg_probe,

View File

@ -1470,6 +1470,7 @@ static const struct of_device_id charger_manager_match[] = {
}, },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, charger_manager_match);
static struct charger_desc *of_cm_parse_desc(struct device *dev) static struct charger_desc *of_cm_parse_desc(struct device *dev)
{ {

View File

@ -1076,7 +1076,7 @@ static int max17042_probe(struct i2c_client *client,
} }
if (client->irq) { if (client->irq) {
unsigned int flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; unsigned int flags = IRQF_ONESHOT;
/* /*
* On ACPI systems the IRQ may be handled by ACPI-event code, * On ACPI systems the IRQ may be handled by ACPI-event code,

View File

@ -164,9 +164,16 @@ static const struct i2c_device_id rt5033_battery_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, rt5033_battery_id); MODULE_DEVICE_TABLE(i2c, rt5033_battery_id);
static const struct of_device_id rt5033_battery_of_match[] = {
{ .compatible = "richtek,rt5033-battery", },
{ }
};
MODULE_DEVICE_TABLE(of, rt5033_battery_of_match);
static struct i2c_driver rt5033_battery_driver = { static struct i2c_driver rt5033_battery_driver = {
.driver = { .driver = {
.name = "rt5033-battery", .name = "rt5033-battery",
.of_match_table = rt5033_battery_of_match,
}, },
.probe = rt5033_battery_probe, .probe = rt5033_battery_probe,
.remove = rt5033_battery_remove, .remove = rt5033_battery_remove,

View File

@ -524,6 +524,7 @@ static const struct of_device_id sc2731_charger_of_match[] = {
{ .compatible = "sprd,sc2731-charger", }, { .compatible = "sprd,sc2731-charger", },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, sc2731_charger_of_match);
static struct platform_driver sc2731_charger_driver = { static struct platform_driver sc2731_charger_driver = {
.driver = { .driver = {

View File

@ -1215,6 +1215,7 @@ static const struct of_device_id sc27xx_fgu_of_match[] = {
{ .compatible = "sprd,sc2731-fgu", }, { .compatible = "sprd,sc2731-fgu", },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, sc27xx_fgu_of_match);
static struct platform_driver sc27xx_fgu_driver = { static struct platform_driver sc27xx_fgu_driver = {
.probe = sc27xx_fgu_probe, .probe = sc27xx_fgu_probe,

View File

@ -156,7 +156,7 @@ static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
struct img_pwm_chip *pwm_chip = to_img_pwm_chip(chip); struct img_pwm_chip *pwm_chip = to_img_pwm_chip(chip);
int ret; int ret;
ret = pm_runtime_get_sync(chip->dev); ret = pm_runtime_resume_and_get(chip->dev);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -180,8 +180,6 @@ static int pwm_imx1_remove(struct platform_device *pdev)
{ {
struct pwm_imx1_chip *imx = platform_get_drvdata(pdev); struct pwm_imx1_chip *imx = platform_get_drvdata(pdev);
pwm_imx1_clk_disable_unprepare(&imx->chip);
return pwmchip_remove(&imx->chip); return pwmchip_remove(&imx->chip);
} }

View File

@ -231,10 +231,6 @@ static int spear_pwm_probe(struct platform_device *pdev)
static int spear_pwm_remove(struct platform_device *pdev) static int spear_pwm_remove(struct platform_device *pdev)
{ {
struct spear_pwm_chip *pc = platform_get_drvdata(pdev); struct spear_pwm_chip *pc = platform_get_drvdata(pdev);
int i;
for (i = 0; i < NUM_PWM; i++)
pwm_disable(&pc->chip.pwms[i]);
/* clk was prepared in probe, hence unprepare it here */ /* clk was prepared in probe, hence unprepare it here */
clk_unprepare(pc->clk); clk_unprepare(pc->clk);

View File

@ -232,7 +232,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
static int tegra_pwm_remove(struct platform_device *pdev) static int tegra_pwm_remove(struct platform_device *pdev)
{ {
struct tegra_pwm_chip *pc = platform_get_drvdata(pdev); struct tegra_pwm_chip *pc = platform_get_drvdata(pdev);
unsigned int i;
int err; int err;
if (WARN_ON(!pc)) if (WARN_ON(!pc))
@ -242,18 +241,6 @@ static int tegra_pwm_remove(struct platform_device *pdev)
if (err < 0) if (err < 0)
return err; return err;
for (i = 0; i < pc->chip.npwm; i++) {
struct pwm_device *pwm = &pc->chip.pwms[i];
if (!pwm_is_enabled(pwm))
if (clk_prepare_enable(pc->clk) < 0)
continue;
pwm_writel(pc, i, 0);
clk_disable_unprepare(pc->clk);
}
reset_control_assert(pc->rst); reset_control_assert(pc->rst);
clk_disable_unprepare(pc->clk); clk_disable_unprepare(pc->clk);

View File

@ -565,7 +565,10 @@ static struct reset_control *__reset_control_get_internal(
if (!rstc) if (!rstc)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
try_module_get(rcdev->owner); if (!try_module_get(rcdev->owner)) {
kfree(rstc);
return ERR_PTR(-ENODEV);
}
rstc->rcdev = rcdev; rstc->rcdev = rcdev;
list_add(&rstc->list, &rcdev->reset_control_head); list_add(&rstc->list, &rcdev->reset_control_head);

View File

@ -118,6 +118,7 @@ static struct platform_driver a10sr_reset_driver = {
.probe = a10sr_reset_probe, .probe = a10sr_reset_probe,
.driver = { .driver = {
.name = "altr_a10sr_reset", .name = "altr_a10sr_reset",
.of_match_table = a10sr_reset_of_match,
}, },
}; };
module_platform_driver(a10sr_reset_driver); module_platform_driver(a10sr_reset_driver);

View File

@ -111,6 +111,7 @@ static const struct of_device_id brcmstb_reset_of_match[] = {
{ .compatible = "brcm,brcmstb-reset" }, { .compatible = "brcm,brcmstb-reset" },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, brcmstb_reset_of_match);
static struct platform_driver brcmstb_reset_driver = { static struct platform_driver brcmstb_reset_driver = {
.probe = brcmstb_reset_probe, .probe = brcmstb_reset_probe,

View File

@ -23,8 +23,8 @@ static bool is_rtc_hctosys(struct rtc_device *rtc)
int size; int size;
char name[NAME_SIZE]; char name[NAME_SIZE];
size = scnprintf(name, NAME_SIZE, "rtc%d", rtc->id); size = snprintf(name, NAME_SIZE, "rtc%d", rtc->id);
if (size > NAME_SIZE) if (size >= NAME_SIZE)
return false; return false;
return !strncmp(name, CONFIG_RTC_HCTOSYS_DEVICE, NAME_SIZE); return !strncmp(name, CONFIG_RTC_HCTOSYS_DEVICE, NAME_SIZE);

View File

@ -35,8 +35,8 @@
#define SCLP_VT220_MINOR 65 #define SCLP_VT220_MINOR 65
#define SCLP_VT220_DRIVER_NAME "sclp_vt220" #define SCLP_VT220_DRIVER_NAME "sclp_vt220"
#define SCLP_VT220_DEVICE_NAME "ttysclp" #define SCLP_VT220_DEVICE_NAME "ttysclp"
#define SCLP_VT220_CONSOLE_NAME "ttyS" #define SCLP_VT220_CONSOLE_NAME "ttysclp"
#define SCLP_VT220_CONSOLE_INDEX 1 /* console=ttyS1 */ #define SCLP_VT220_CONSOLE_INDEX 0 /* console=ttysclp0 */
/* Representation of a single write request */ /* Representation of a single write request */
struct sclp_vt220_request { struct sclp_vt220_request {

View File

@ -416,7 +416,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
"beiscsi_hba_alloc - iscsi_host_alloc failed\n"); "beiscsi_hba_alloc - iscsi_host_alloc failed\n");
return NULL; return NULL;
} }
shost->max_id = BE2_MAX_SESSIONS; shost->max_id = BE2_MAX_SESSIONS - 1;
shost->max_channel = 0; shost->max_channel = 0;
shost->max_cmd_len = BEISCSI_MAX_CMD_LEN; shost->max_cmd_len = BEISCSI_MAX_CMD_LEN;
shost->max_lun = BEISCSI_NUM_MAX_LUN; shost->max_lun = BEISCSI_NUM_MAX_LUN;
@ -5318,7 +5318,7 @@ static int beiscsi_enable_port(struct beiscsi_hba *phba)
/* Re-enable UER. If different TPE occurs then it is recoverable. */ /* Re-enable UER. If different TPE occurs then it is recoverable. */
beiscsi_set_uer_feature(phba); beiscsi_set_uer_feature(phba);
phba->shost->max_id = phba->params.cxns_per_ctrl; phba->shost->max_id = phba->params.cxns_per_ctrl - 1;
phba->shost->can_queue = phba->params.ios_per_ctrl; phba->shost->can_queue = phba->params.ios_per_ctrl;
ret = beiscsi_init_port(phba); ret = beiscsi_init_port(phba);
if (ret < 0) { if (ret < 0) {
@ -5745,6 +5745,7 @@ free_hba:
pci_disable_msix(phba->pcidev); pci_disable_msix(phba->pcidev);
pci_dev_put(phba->pcidev); pci_dev_put(phba->pcidev);
iscsi_host_free(phba->shost); iscsi_host_free(phba->shost);
pci_disable_pcie_error_reporting(pcidev);
pci_set_drvdata(pcidev, NULL); pci_set_drvdata(pcidev, NULL);
disable_pci: disable_pci:
pci_release_regions(pcidev); pci_release_regions(pcidev);

View File

@ -793,7 +793,7 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
return NULL; return NULL;
shost->dma_boundary = cnic->pcidev->dma_mask; shost->dma_boundary = cnic->pcidev->dma_mask;
shost->transportt = bnx2i_scsi_xport_template; shost->transportt = bnx2i_scsi_xport_template;
shost->max_id = ISCSI_MAX_CONNS_PER_HBA; shost->max_id = ISCSI_MAX_CONNS_PER_HBA - 1;
shost->max_channel = 0; shost->max_channel = 0;
shost->max_lun = 512; shost->max_lun = 512;
shost->max_cmd_len = 16; shost->max_cmd_len = 16;

View File

@ -337,7 +337,7 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
EXPORT_SYMBOL_GPL(cxgbi_hbas_remove); EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun, int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
unsigned int max_id, struct scsi_host_template *sht, unsigned int max_conns, struct scsi_host_template *sht,
struct scsi_transport_template *stt) struct scsi_transport_template *stt)
{ {
struct cxgbi_hba *chba; struct cxgbi_hba *chba;
@ -357,7 +357,7 @@ int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
shost->transportt = stt; shost->transportt = stt;
shost->max_lun = max_lun; shost->max_lun = max_lun;
shost->max_id = max_id; shost->max_id = max_conns - 1;
shost->max_channel = 0; shost->max_channel = 0;
shost->max_cmd_len = 16; shost->max_cmd_len = 16;

View File

@ -508,7 +508,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
struct alua_port_group *tmp_pg; struct alua_port_group *tmp_pg;
int len, k, off, bufflen = ALUA_RTPG_SIZE; int len, k, off, bufflen = ALUA_RTPG_SIZE;
unsigned char *desc, *buff; unsigned char *desc, *buff;
unsigned err, retval; unsigned err;
int retval;
unsigned int tpg_desc_tbl_off; unsigned int tpg_desc_tbl_off;
unsigned char orig_transition_tmo; unsigned char orig_transition_tmo;
unsigned long flags; unsigned long flags;
@ -548,12 +549,12 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
kfree(buff); kfree(buff);
return SCSI_DH_OK; return SCSI_DH_OK;
} }
if (!scsi_sense_valid(&sense_hdr)) { if (retval < 0 || !scsi_sense_valid(&sense_hdr)) {
sdev_printk(KERN_INFO, sdev, sdev_printk(KERN_INFO, sdev,
"%s: rtpg failed, result %d\n", "%s: rtpg failed, result %d\n",
ALUA_DH_NAME, retval); ALUA_DH_NAME, retval);
kfree(buff); kfree(buff);
if (driver_byte(retval) == DRIVER_ERROR) if (retval < 0)
return SCSI_DH_DEV_TEMP_BUSY; return SCSI_DH_DEV_TEMP_BUSY;
return SCSI_DH_IO; return SCSI_DH_IO;
} }
@ -775,11 +776,11 @@ static unsigned alua_stpg(struct scsi_device *sdev, struct alua_port_group *pg)
retval = submit_stpg(sdev, pg->group_id, &sense_hdr); retval = submit_stpg(sdev, pg->group_id, &sense_hdr);
if (retval) { if (retval) {
if (!scsi_sense_valid(&sense_hdr)) { if (retval < 0 || !scsi_sense_valid(&sense_hdr)) {
sdev_printk(KERN_INFO, sdev, sdev_printk(KERN_INFO, sdev,
"%s: stpg failed, result %d", "%s: stpg failed, result %d",
ALUA_DH_NAME, retval); ALUA_DH_NAME, retval);
if (driver_byte(retval) == DRIVER_ERROR) if (retval < 0)
return SCSI_DH_DEV_TEMP_BUSY; return SCSI_DH_DEV_TEMP_BUSY;
} else { } else {
sdev_printk(KERN_INFO, sdev, "%s: stpg failed\n", sdev_printk(KERN_INFO, sdev, "%s: stpg failed\n",

View File

@ -1648,7 +1648,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (irq < 0) { if (irq < 0) {
dev_err(dev, "irq init: fail map phy interrupt %d\n", dev_err(dev, "irq init: fail map phy interrupt %d\n",
idx); idx);
return -ENOENT; return irq;
} }
rc = devm_request_irq(dev, irq, phy_interrupts[j], 0, rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
@ -1656,7 +1656,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (rc) { if (rc) {
dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n", dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
irq, rc); irq, rc);
return -ENOENT; return rc;
} }
} }
} }
@ -1667,7 +1667,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (irq < 0) { if (irq < 0) {
dev_err(dev, "irq init: could not map cq interrupt %d\n", dev_err(dev, "irq init: could not map cq interrupt %d\n",
idx); idx);
return -ENOENT; return irq;
} }
rc = devm_request_irq(dev, irq, cq_interrupt_v1_hw, 0, rc = devm_request_irq(dev, irq, cq_interrupt_v1_hw, 0,
@ -1675,7 +1675,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (rc) { if (rc) {
dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n", dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
irq, rc); irq, rc);
return -ENOENT; return rc;
} }
} }
@ -1685,7 +1685,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (irq < 0) { if (irq < 0) {
dev_err(dev, "irq init: could not map fatal interrupt %d\n", dev_err(dev, "irq init: could not map fatal interrupt %d\n",
idx); idx);
return -ENOENT; return irq;
} }
rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0, rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
@ -1693,7 +1693,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
if (rc) { if (rc) {
dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n", dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
irq, rc); irq, rc);
return -ENOENT; return rc;
} }
} }

View File

@ -219,6 +219,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
goto fail; goto fail;
} }
shost->cmd_per_lun = min_t(short, shost->cmd_per_lun,
shost->can_queue);
error = scsi_init_sense_cache(shost); error = scsi_init_sense_cache(shost);
if (error) if (error)
goto fail; goto fail;
@ -486,6 +489,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
shost_printk(KERN_WARNING, shost, shost_printk(KERN_WARNING, shost,
"error handler thread failed to spawn, error = %ld\n", "error handler thread failed to spawn, error = %ld\n",
PTR_ERR(shost->ehandler)); PTR_ERR(shost->ehandler));
shost->ehandler = NULL;
goto fail; goto fail;
} }

View File

@ -230,11 +230,11 @@ static int iscsi_prep_ecdb_ahs(struct iscsi_task *task)
*/ */
static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode) static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
{ {
struct iscsi_conn *conn = task->conn; struct iscsi_session *session = task->conn->session;
struct iscsi_tm *tmf = &conn->tmhdr; struct iscsi_tm *tmf = &session->tmhdr;
u64 hdr_lun; u64 hdr_lun;
if (conn->tmf_state == TMF_INITIAL) if (session->tmf_state == TMF_INITIAL)
return 0; return 0;
if ((tmf->opcode & ISCSI_OPCODE_MASK) != ISCSI_OP_SCSI_TMFUNC) if ((tmf->opcode & ISCSI_OPCODE_MASK) != ISCSI_OP_SCSI_TMFUNC)
@ -254,24 +254,19 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
* Fail all SCSI cmd PDUs * Fail all SCSI cmd PDUs
*/ */
if (opcode != ISCSI_OP_SCSI_DATA_OUT) { if (opcode != ISCSI_OP_SCSI_DATA_OUT) {
iscsi_conn_printk(KERN_INFO, conn, iscsi_session_printk(KERN_INFO, session,
"task [op %x itt " "task [op %x itt 0x%x/0x%x] rejected.\n",
"0x%x/0x%x] " opcode, task->itt, task->hdr_itt);
"rejected.\n",
opcode, task->itt,
task->hdr_itt);
return -EACCES; return -EACCES;
} }
/* /*
* And also all data-out PDUs in response to R2T * And also all data-out PDUs in response to R2T
* if fast_abort is set. * if fast_abort is set.
*/ */
if (conn->session->fast_abort) { if (session->fast_abort) {
iscsi_conn_printk(KERN_INFO, conn, iscsi_session_printk(KERN_INFO, session,
"task [op %x itt " "task [op %x itt 0x%x/0x%x] fast abort.\n",
"0x%x/0x%x] fast abort.\n", opcode, task->itt, task->hdr_itt);
opcode, task->itt,
task->hdr_itt);
return -EACCES; return -EACCES;
} }
break; break;
@ -284,7 +279,7 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
*/ */
if (opcode == ISCSI_OP_SCSI_DATA_OUT && if (opcode == ISCSI_OP_SCSI_DATA_OUT &&
task->hdr_itt == tmf->rtt) { task->hdr_itt == tmf->rtt) {
ISCSI_DBG_SESSION(conn->session, ISCSI_DBG_SESSION(session,
"Preventing task %x/%x from sending " "Preventing task %x/%x from sending "
"data-out due to abort task in " "data-out due to abort task in "
"progress\n", task->itt, "progress\n", task->itt,
@ -923,20 +918,21 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
static void iscsi_tmf_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr) static void iscsi_tmf_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
{ {
struct iscsi_tm_rsp *tmf = (struct iscsi_tm_rsp *)hdr; struct iscsi_tm_rsp *tmf = (struct iscsi_tm_rsp *)hdr;
struct iscsi_session *session = conn->session;
conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1; conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1;
conn->tmfrsp_pdus_cnt++; conn->tmfrsp_pdus_cnt++;
if (conn->tmf_state != TMF_QUEUED) if (session->tmf_state != TMF_QUEUED)
return; return;
if (tmf->response == ISCSI_TMF_RSP_COMPLETE) if (tmf->response == ISCSI_TMF_RSP_COMPLETE)
conn->tmf_state = TMF_SUCCESS; session->tmf_state = TMF_SUCCESS;
else if (tmf->response == ISCSI_TMF_RSP_NO_TASK) else if (tmf->response == ISCSI_TMF_RSP_NO_TASK)
conn->tmf_state = TMF_NOT_FOUND; session->tmf_state = TMF_NOT_FOUND;
else else
conn->tmf_state = TMF_FAILED; session->tmf_state = TMF_FAILED;
wake_up(&conn->ehwait); wake_up(&session->ehwait);
} }
static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr) static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
@ -1348,7 +1344,6 @@ void iscsi_session_failure(struct iscsi_session *session,
enum iscsi_err err) enum iscsi_err err)
{ {
struct iscsi_conn *conn; struct iscsi_conn *conn;
struct device *dev;
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
conn = session->leadconn; conn = session->leadconn;
@ -1357,10 +1352,8 @@ void iscsi_session_failure(struct iscsi_session *session,
return; return;
} }
dev = get_device(&conn->cls_conn->dev); iscsi_get_conn(conn->cls_conn);
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
if (!dev)
return;
/* /*
* if the host is being removed bypass the connection * if the host is being removed bypass the connection
* recovery initialization because we are going to kill * recovery initialization because we are going to kill
@ -1370,7 +1363,7 @@ void iscsi_session_failure(struct iscsi_session *session,
iscsi_conn_error_event(conn->cls_conn, err); iscsi_conn_error_event(conn->cls_conn, err);
else else
iscsi_conn_failure(conn, err); iscsi_conn_failure(conn, err);
put_device(dev); iscsi_put_conn(conn->cls_conn);
} }
EXPORT_SYMBOL_GPL(iscsi_session_failure); EXPORT_SYMBOL_GPL(iscsi_session_failure);
@ -1787,15 +1780,14 @@ EXPORT_SYMBOL_GPL(iscsi_target_alloc);
static void iscsi_tmf_timedout(struct timer_list *t) static void iscsi_tmf_timedout(struct timer_list *t)
{ {
struct iscsi_conn *conn = from_timer(conn, t, tmf_timer); struct iscsi_session *session = from_timer(session, t, tmf_timer);
struct iscsi_session *session = conn->session;
spin_lock(&session->frwd_lock); spin_lock(&session->frwd_lock);
if (conn->tmf_state == TMF_QUEUED) { if (session->tmf_state == TMF_QUEUED) {
conn->tmf_state = TMF_TIMEDOUT; session->tmf_state = TMF_TIMEDOUT;
ISCSI_DBG_EH(session, "tmf timedout\n"); ISCSI_DBG_EH(session, "tmf timedout\n");
/* unblock eh_abort() */ /* unblock eh_abort() */
wake_up(&conn->ehwait); wake_up(&session->ehwait);
} }
spin_unlock(&session->frwd_lock); spin_unlock(&session->frwd_lock);
} }
@ -1818,8 +1810,8 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
return -EPERM; return -EPERM;
} }
conn->tmfcmd_pdus_cnt++; conn->tmfcmd_pdus_cnt++;
conn->tmf_timer.expires = timeout * HZ + jiffies; session->tmf_timer.expires = timeout * HZ + jiffies;
add_timer(&conn->tmf_timer); add_timer(&session->tmf_timer);
ISCSI_DBG_EH(session, "tmf set timeout\n"); ISCSI_DBG_EH(session, "tmf set timeout\n");
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
@ -1833,12 +1825,12 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
* 3) session is terminated or restarted or userspace has * 3) session is terminated or restarted or userspace has
* given up on recovery * given up on recovery
*/ */
wait_event_interruptible(conn->ehwait, age != session->age || wait_event_interruptible(session->ehwait, age != session->age ||
session->state != ISCSI_STATE_LOGGED_IN || session->state != ISCSI_STATE_LOGGED_IN ||
conn->tmf_state != TMF_QUEUED); session->tmf_state != TMF_QUEUED);
if (signal_pending(current)) if (signal_pending(current))
flush_signals(current); flush_signals(current);
del_timer_sync(&conn->tmf_timer); del_timer_sync(&session->tmf_timer);
mutex_lock(&session->eh_mutex); mutex_lock(&session->eh_mutex);
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
@ -2198,17 +2190,17 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
} }
/* only have one tmf outstanding at a time */ /* only have one tmf outstanding at a time */
if (conn->tmf_state != TMF_INITIAL) if (session->tmf_state != TMF_INITIAL)
goto failed; goto failed;
conn->tmf_state = TMF_QUEUED; session->tmf_state = TMF_QUEUED;
hdr = &conn->tmhdr; hdr = &session->tmhdr;
iscsi_prep_abort_task_pdu(task, hdr); iscsi_prep_abort_task_pdu(task, hdr);
if (iscsi_exec_task_mgmt_fn(conn, hdr, age, session->abort_timeout)) if (iscsi_exec_task_mgmt_fn(conn, hdr, age, session->abort_timeout))
goto failed; goto failed;
switch (conn->tmf_state) { switch (session->tmf_state) {
case TMF_SUCCESS: case TMF_SUCCESS:
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
/* /*
@ -2223,7 +2215,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
*/ */
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
fail_scsi_task(task, DID_ABORT); fail_scsi_task(task, DID_ABORT);
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
iscsi_start_tx(conn); iscsi_start_tx(conn);
@ -2234,7 +2226,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
goto failed_unlocked; goto failed_unlocked;
case TMF_NOT_FOUND: case TMF_NOT_FOUND:
if (!sc->SCp.ptr) { if (!sc->SCp.ptr) {
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
/* task completed before tmf abort response */ /* task completed before tmf abort response */
ISCSI_DBG_EH(session, "sc completed while abort in " ISCSI_DBG_EH(session, "sc completed while abort in "
@ -2243,7 +2235,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
} }
/* fall through */ /* fall through */
default: default:
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
goto failed; goto failed;
} }
@ -2300,11 +2292,11 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
conn = session->leadconn; conn = session->leadconn;
/* only have one tmf outstanding at a time */ /* only have one tmf outstanding at a time */
if (conn->tmf_state != TMF_INITIAL) if (session->tmf_state != TMF_INITIAL)
goto unlock; goto unlock;
conn->tmf_state = TMF_QUEUED; session->tmf_state = TMF_QUEUED;
hdr = &conn->tmhdr; hdr = &session->tmhdr;
iscsi_prep_lun_reset_pdu(sc, hdr); iscsi_prep_lun_reset_pdu(sc, hdr);
if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age, if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age,
@ -2313,7 +2305,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
goto unlock; goto unlock;
} }
switch (conn->tmf_state) { switch (session->tmf_state) {
case TMF_SUCCESS: case TMF_SUCCESS:
break; break;
case TMF_TIMEDOUT: case TMF_TIMEDOUT:
@ -2321,7 +2313,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto done; goto done;
default: default:
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
goto unlock; goto unlock;
} }
@ -2333,7 +2325,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
fail_scsi_tasks(conn, sc->device->lun, DID_ERROR); fail_scsi_tasks(conn, sc->device->lun, DID_ERROR);
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
iscsi_start_tx(conn); iscsi_start_tx(conn);
@ -2356,8 +2348,7 @@ void iscsi_session_recovery_timedout(struct iscsi_cls_session *cls_session)
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
if (session->state != ISCSI_STATE_LOGGED_IN) { if (session->state != ISCSI_STATE_LOGGED_IN) {
session->state = ISCSI_STATE_RECOVERY_FAILED; session->state = ISCSI_STATE_RECOVERY_FAILED;
if (session->leadconn) wake_up(&session->ehwait);
wake_up(&session->leadconn->ehwait);
} }
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
} }
@ -2402,7 +2393,7 @@ failed:
iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
ISCSI_DBG_EH(session, "wait for relogin\n"); ISCSI_DBG_EH(session, "wait for relogin\n");
wait_event_interruptible(conn->ehwait, wait_event_interruptible(session->ehwait,
session->state == ISCSI_STATE_TERMINATE || session->state == ISCSI_STATE_TERMINATE ||
session->state == ISCSI_STATE_LOGGED_IN || session->state == ISCSI_STATE_LOGGED_IN ||
session->state == ISCSI_STATE_RECOVERY_FAILED); session->state == ISCSI_STATE_RECOVERY_FAILED);
@ -2463,11 +2454,11 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
conn = session->leadconn; conn = session->leadconn;
/* only have one tmf outstanding at a time */ /* only have one tmf outstanding at a time */
if (conn->tmf_state != TMF_INITIAL) if (session->tmf_state != TMF_INITIAL)
goto unlock; goto unlock;
conn->tmf_state = TMF_QUEUED; session->tmf_state = TMF_QUEUED;
hdr = &conn->tmhdr; hdr = &session->tmhdr;
iscsi_prep_tgt_reset_pdu(sc, hdr); iscsi_prep_tgt_reset_pdu(sc, hdr);
if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age, if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age,
@ -2476,7 +2467,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
goto unlock; goto unlock;
} }
switch (conn->tmf_state) { switch (session->tmf_state) {
case TMF_SUCCESS: case TMF_SUCCESS:
break; break;
case TMF_TIMEDOUT: case TMF_TIMEDOUT:
@ -2484,7 +2475,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto done; goto done;
default: default:
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
goto unlock; goto unlock;
} }
@ -2496,7 +2487,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
fail_scsi_tasks(conn, -1, DID_ERROR); fail_scsi_tasks(conn, -1, DID_ERROR);
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
iscsi_start_tx(conn); iscsi_start_tx(conn);
@ -2801,7 +2792,10 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost,
session->tt = iscsit; session->tt = iscsit;
session->dd_data = cls_session->dd_data + sizeof(*session); session->dd_data = cls_session->dd_data + sizeof(*session);
session->tmf_state = TMF_INITIAL;
timer_setup(&session->tmf_timer, iscsi_tmf_timedout, 0);
mutex_init(&session->eh_mutex); mutex_init(&session->eh_mutex);
spin_lock_init(&session->frwd_lock); spin_lock_init(&session->frwd_lock);
spin_lock_init(&session->back_lock); spin_lock_init(&session->back_lock);
@ -2905,7 +2899,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
conn->c_stage = ISCSI_CONN_INITIAL_STAGE; conn->c_stage = ISCSI_CONN_INITIAL_STAGE;
conn->id = conn_idx; conn->id = conn_idx;
conn->exp_statsn = 0; conn->exp_statsn = 0;
conn->tmf_state = TMF_INITIAL;
timer_setup(&conn->transport_timer, iscsi_check_transport_timeouts, 0); timer_setup(&conn->transport_timer, iscsi_check_transport_timeouts, 0);
@ -2931,8 +2924,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
goto login_task_data_alloc_fail; goto login_task_data_alloc_fail;
conn->login_task->data = conn->data = data; conn->login_task->data = conn->data = data;
timer_setup(&conn->tmf_timer, iscsi_tmf_timedout, 0); init_waitqueue_head(&session->ehwait);
init_waitqueue_head(&conn->ehwait);
return cls_conn; return cls_conn;
@ -2967,7 +2959,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
* leading connection? then give up on recovery. * leading connection? then give up on recovery.
*/ */
session->state = ISCSI_STATE_TERMINATE; session->state = ISCSI_STATE_TERMINATE;
wake_up(&conn->ehwait); wake_up(&session->ehwait);
} }
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
@ -3042,7 +3034,7 @@ int iscsi_conn_start(struct iscsi_cls_conn *cls_conn)
* commands after successful recovery * commands after successful recovery
*/ */
conn->stop_stage = 0; conn->stop_stage = 0;
conn->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
session->age++; session->age++;
if (session->age == 16) if (session->age == 16)
session->age = 0; session->age = 0;
@ -3056,7 +3048,7 @@ int iscsi_conn_start(struct iscsi_cls_conn *cls_conn)
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
iscsi_unblock_session(session->cls_session); iscsi_unblock_session(session->cls_session);
wake_up(&conn->ehwait); wake_up(&session->ehwait);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(iscsi_conn_start); EXPORT_SYMBOL_GPL(iscsi_conn_start);
@ -3143,7 +3135,7 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
spin_lock_bh(&session->frwd_lock); spin_lock_bh(&session->frwd_lock);
fail_scsi_tasks(conn, -1, DID_TRANSPORT_DISRUPTED); fail_scsi_tasks(conn, -1, DID_TRANSPORT_DISRUPTED);
fail_mgmt_tasks(session, conn); fail_mgmt_tasks(session, conn);
memset(&conn->tmhdr, 0, sizeof(conn->tmhdr)); memset(&session->tmhdr, 0, sizeof(session->tmhdr));
spin_unlock_bh(&session->frwd_lock); spin_unlock_bh(&session->frwd_lock);
mutex_unlock(&session->eh_mutex); mutex_unlock(&session->eh_mutex);
} }

View File

@ -1179,6 +1179,15 @@ stop_rr_fcf_flogi:
phba->fcf.fcf_redisc_attempted = 0; /* reset */ phba->fcf.fcf_redisc_attempted = 0; /* reset */
goto out; goto out;
} }
} else if (vport->port_state > LPFC_FLOGI &&
vport->fc_flag & FC_PT2PT) {
/*
* In a p2p topology, it is possible that discovery has
* already progressed, and this completion can be ignored.
* Recheck the indicated topology.
*/
if (!sp->cmn.fPort)
goto out;
} }
flogifail: flogifail:

View File

@ -7602,7 +7602,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
"0393 Error %d during rpi post operation\n", "0393 Error %d during rpi post operation\n",
rc); rc);
rc = -ENODEV; rc = -ENODEV;
goto out_destroy_queue; goto out_free_iocblist;
} }
lpfc_sli4_node_prep(phba); lpfc_sli4_node_prep(phba);
@ -7765,8 +7765,9 @@ out_io_buff_free:
out_unset_queue: out_unset_queue:
/* Unset all the queues set up in this routine when error out */ /* Unset all the queues set up in this routine when error out */
lpfc_sli4_queue_unset(phba); lpfc_sli4_queue_unset(phba);
out_destroy_queue: out_free_iocblist:
lpfc_free_iocb_list(phba); lpfc_free_iocb_list(phba);
out_destroy_queue:
lpfc_sli4_queue_destroy(phba); lpfc_sli4_queue_destroy(phba);
out_stop_timers: out_stop_timers:
lpfc_stop_hba_timers(phba); lpfc_stop_hba_timers(phba);

View File

@ -2256,6 +2256,15 @@ enum MR_PERF_MODE {
(mode) == MR_LATENCY_PERF_MODE ? "Latency" : \ (mode) == MR_LATENCY_PERF_MODE ? "Latency" : \
"Unknown") "Unknown")
enum MEGASAS_LD_TARGET_ID_STATUS {
LD_TARGET_ID_INITIAL,
LD_TARGET_ID_ACTIVE,
LD_TARGET_ID_DELETED,
};
#define MEGASAS_TARGET_ID(sdev) \
(((sdev->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id)
struct megasas_instance { struct megasas_instance {
unsigned int *reply_map; unsigned int *reply_map;
@ -2320,6 +2329,9 @@ struct megasas_instance {
struct megasas_pd_list pd_list[MEGASAS_MAX_PD]; struct megasas_pd_list pd_list[MEGASAS_MAX_PD];
struct megasas_pd_list local_pd_list[MEGASAS_MAX_PD]; struct megasas_pd_list local_pd_list[MEGASAS_MAX_PD];
u8 ld_ids[MEGASAS_MAX_LD_IDS]; u8 ld_ids[MEGASAS_MAX_LD_IDS];
u8 ld_tgtid_status[MEGASAS_MAX_LD_IDS];
u8 ld_ids_prev[MEGASAS_MAX_LD_IDS];
u8 ld_ids_from_raidmap[MEGASAS_MAX_LD_IDS];
s8 init_id; s8 init_id;
u16 max_num_sge; u16 max_num_sge;

View File

@ -127,6 +127,8 @@ static int megasas_register_aen(struct megasas_instance *instance,
u32 seq_num, u32 class_locale_word); u32 seq_num, u32 class_locale_word);
static void megasas_get_pd_info(struct megasas_instance *instance, static void megasas_get_pd_info(struct megasas_instance *instance,
struct scsi_device *sdev); struct scsi_device *sdev);
static void
megasas_set_ld_removed_by_fw(struct megasas_instance *instance);
/* /*
* PCI ID table for all supported controllers * PCI ID table for all supported controllers
@ -425,6 +427,12 @@ megasas_decode_evt(struct megasas_instance *instance)
(class_locale.members.locale), (class_locale.members.locale),
format_class(class_locale.members.class), format_class(class_locale.members.class),
evt_detail->description); evt_detail->description);
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"evt_detail.args.ld.target_id/index %d/%d\n",
evt_detail->args.ld.target_id, evt_detail->args.ld.ld_index);
} }
/** /**
@ -1759,6 +1767,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
{ {
struct megasas_instance *instance; struct megasas_instance *instance;
struct MR_PRIV_DEVICE *mr_device_priv_data; struct MR_PRIV_DEVICE *mr_device_priv_data;
u32 ld_tgt_id;
instance = (struct megasas_instance *) instance = (struct megasas_instance *)
scmd->device->host->hostdata; scmd->device->host->hostdata;
@ -1785,17 +1794,21 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
} }
} }
if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) { mr_device_priv_data = scmd->device->hostdata;
if (!mr_device_priv_data ||
(atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)) {
scmd->result = DID_NO_CONNECT << 16; scmd->result = DID_NO_CONNECT << 16;
scmd->scsi_done(scmd); scmd->scsi_done(scmd);
return 0; return 0;
} }
mr_device_priv_data = scmd->device->hostdata; if (MEGASAS_IS_LOGICAL(scmd->device)) {
if (!mr_device_priv_data) { ld_tgt_id = MEGASAS_TARGET_ID(scmd->device);
scmd->result = DID_NO_CONNECT << 16; if (instance->ld_tgtid_status[ld_tgt_id] == LD_TARGET_ID_DELETED) {
scmd->scsi_done(scmd); scmd->result = DID_NO_CONNECT << 16;
return 0; scmd->scsi_done(scmd);
return 0;
}
} }
if (atomic_read(&instance->adprecovery) != MEGASAS_HBA_OPERATIONAL) if (atomic_read(&instance->adprecovery) != MEGASAS_HBA_OPERATIONAL)
@ -2071,7 +2084,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
static int megasas_slave_alloc(struct scsi_device *sdev) static int megasas_slave_alloc(struct scsi_device *sdev)
{ {
u16 pd_index = 0; u16 pd_index = 0, ld_tgt_id;
struct megasas_instance *instance ; struct megasas_instance *instance ;
struct MR_PRIV_DEVICE *mr_device_priv_data; struct MR_PRIV_DEVICE *mr_device_priv_data;
@ -2096,6 +2109,14 @@ scan_target:
GFP_KERNEL); GFP_KERNEL);
if (!mr_device_priv_data) if (!mr_device_priv_data)
return -ENOMEM; return -ENOMEM;
if (MEGASAS_IS_LOGICAL(sdev)) {
ld_tgt_id = MEGASAS_TARGET_ID(sdev);
instance->ld_tgtid_status[ld_tgt_id] = LD_TARGET_ID_ACTIVE;
if (megasas_dbg_lvl & LD_PD_DEBUG)
sdev_printk(KERN_INFO, sdev, "LD target ID %d created.\n", ld_tgt_id);
}
sdev->hostdata = mr_device_priv_data; sdev->hostdata = mr_device_priv_data;
atomic_set(&mr_device_priv_data->r1_ldio_hint, atomic_set(&mr_device_priv_data->r1_ldio_hint,
@ -2105,6 +2126,19 @@ scan_target:
static void megasas_slave_destroy(struct scsi_device *sdev) static void megasas_slave_destroy(struct scsi_device *sdev)
{ {
u16 ld_tgt_id;
struct megasas_instance *instance;
instance = megasas_lookup_instance(sdev->host->host_no);
if (MEGASAS_IS_LOGICAL(sdev)) {
ld_tgt_id = MEGASAS_TARGET_ID(sdev);
instance->ld_tgtid_status[ld_tgt_id] = LD_TARGET_ID_DELETED;
if (megasas_dbg_lvl & LD_PD_DEBUG)
sdev_printk(KERN_INFO, sdev,
"LD target ID %d removed from OS stack\n", ld_tgt_id);
}
kfree(sdev->hostdata); kfree(sdev->hostdata);
sdev->hostdata = NULL; sdev->hostdata = NULL;
} }
@ -3456,6 +3490,22 @@ megasas_complete_abort(struct megasas_instance *instance,
} }
} }
static void
megasas_set_ld_removed_by_fw(struct megasas_instance *instance)
{
uint i;
for (i = 0; (i < MEGASAS_MAX_LD_IDS); i++) {
if (instance->ld_ids_prev[i] != 0xff &&
instance->ld_ids_from_raidmap[i] == 0xff) {
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"LD target ID %d removed from RAID map\n", i);
instance->ld_tgtid_status[i] = LD_TARGET_ID_DELETED;
}
}
}
/** /**
* megasas_complete_cmd - Completes a command * megasas_complete_cmd - Completes a command
* @instance: Adapter soft state * @instance: Adapter soft state
@ -3618,9 +3668,13 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
fusion->fast_path_io = 0; fusion->fast_path_io = 0;
} }
if (instance->adapter_type >= INVADER_SERIES)
megasas_set_ld_removed_by_fw(instance);
megasas_sync_map_info(instance); megasas_sync_map_info(instance);
spin_unlock_irqrestore(instance->host->host_lock, spin_unlock_irqrestore(instance->host->host_lock,
flags); flags);
break; break;
} }
if (opcode == MR_DCMD_CTRL_EVENT_GET_INFO || if (opcode == MR_DCMD_CTRL_EVENT_GET_INFO ||
@ -7415,11 +7469,16 @@ static int megasas_probe_one(struct pci_dev *pdev,
return 0; return 0;
fail_start_aen: fail_start_aen:
instance->unload = 1;
scsi_remove_host(instance->host);
fail_io_attach: fail_io_attach:
megasas_mgmt_info.count--; megasas_mgmt_info.count--;
megasas_mgmt_info.max_index--; megasas_mgmt_info.max_index--;
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL; megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
if (instance->requestorId && !instance->skip_heartbeat_timer_del)
del_timer_sync(&instance->sriov_heartbeat_timer);
instance->instancet->disable_intr(instance); instance->instancet->disable_intr(instance);
megasas_destroy_irqs(instance); megasas_destroy_irqs(instance);
@ -7427,8 +7486,16 @@ fail_io_attach:
megasas_release_fusion(instance); megasas_release_fusion(instance);
else else
megasas_release_mfi(instance); megasas_release_mfi(instance);
if (instance->msix_vectors) if (instance->msix_vectors)
pci_free_irq_vectors(instance->pdev); pci_free_irq_vectors(instance->pdev);
instance->msix_vectors = 0;
if (instance->fw_crash_state != UNAVAILABLE)
megasas_free_host_crash_buffer(instance);
if (instance->adapter_type != MFI_SERIES)
megasas_fusion_stop_watchdog(instance);
fail_init_mfi: fail_init_mfi:
scsi_host_put(host); scsi_host_put(host);
fail_alloc_instance: fail_alloc_instance:
@ -8698,8 +8765,10 @@ megasas_aen_polling(struct work_struct *work)
union megasas_evt_class_locale class_locale; union megasas_evt_class_locale class_locale;
int event_type = 0; int event_type = 0;
u32 seq_num; u32 seq_num;
u16 ld_target_id;
int error; int error;
u8 dcmd_ret = DCMD_SUCCESS; u8 dcmd_ret = DCMD_SUCCESS;
struct scsi_device *sdev1;
if (!instance) { if (!instance) {
printk(KERN_ERR "invalid instance!\n"); printk(KERN_ERR "invalid instance!\n");
@ -8722,12 +8791,23 @@ megasas_aen_polling(struct work_struct *work)
break; break;
case MR_EVT_LD_OFFLINE: case MR_EVT_LD_OFFLINE:
case MR_EVT_CFG_CLEARED:
case MR_EVT_LD_DELETED: case MR_EVT_LD_DELETED:
ld_target_id = instance->evt_detail->args.ld.target_id;
sdev1 = scsi_device_lookup(instance->host,
MEGASAS_MAX_PD_CHANNELS +
(ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
(ld_target_id - MEGASAS_MAX_DEV_PER_CHANNEL),
0);
if (sdev1)
megasas_remove_scsi_device(sdev1);
event_type = SCAN_VD_CHANNEL;
break;
case MR_EVT_LD_CREATED: case MR_EVT_LD_CREATED:
event_type = SCAN_VD_CHANNEL; event_type = SCAN_VD_CHANNEL;
break; break;
case MR_EVT_CFG_CLEARED:
case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED: case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED:
case MR_EVT_FOREIGN_CFG_IMPORTED: case MR_EVT_FOREIGN_CFG_IMPORTED:
case MR_EVT_LD_STATE_CHANGE: case MR_EVT_LD_STATE_CHANGE:

View File

@ -350,6 +350,10 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id)
num_lds = le16_to_cpu(drv_map->raidMap.ldCount); num_lds = le16_to_cpu(drv_map->raidMap.ldCount);
memcpy(instance->ld_ids_prev,
instance->ld_ids_from_raidmap,
sizeof(instance->ld_ids_from_raidmap));
memset(instance->ld_ids_from_raidmap, 0xff, MEGASAS_MAX_LD_IDS);
/*Convert Raid capability values to CPU arch */ /*Convert Raid capability values to CPU arch */
for (i = 0; (num_lds > 0) && (i < MAX_LOGICAL_DRIVES_EXT); i++) { for (i = 0; (num_lds > 0) && (i < MAX_LOGICAL_DRIVES_EXT); i++) {
ld = MR_TargetIdToLdGet(i, drv_map); ld = MR_TargetIdToLdGet(i, drv_map);
@ -360,7 +364,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id)
raid = MR_LdRaidGet(ld, drv_map); raid = MR_LdRaidGet(ld, drv_map);
le32_to_cpus((u32 *)&raid->capability); le32_to_cpus((u32 *)&raid->capability);
instance->ld_ids_from_raidmap[i] = i;
num_lds--; num_lds--;
} }

View File

@ -3716,6 +3716,7 @@ static void megasas_sync_irqs(unsigned long instance_addr)
if (irq_ctx->irq_poll_scheduled) { if (irq_ctx->irq_poll_scheduled) {
irq_ctx->irq_poll_scheduled = false; irq_ctx->irq_poll_scheduled = false;
enable_irq(irq_ctx->os_irq); enable_irq(irq_ctx->os_irq);
complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
} }
} }
} }
@ -3747,6 +3748,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget)
irq_poll_complete(irqpoll); irq_poll_complete(irqpoll);
irq_ctx->irq_poll_scheduled = false; irq_ctx->irq_poll_scheduled = false;
enable_irq(irq_ctx->os_irq); enable_irq(irq_ctx->os_irq);
complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
} }
return num_entries; return num_entries;
@ -3763,6 +3765,7 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
{ {
struct megasas_instance *instance = struct megasas_instance *instance =
(struct megasas_instance *)instance_addr; (struct megasas_instance *)instance_addr;
struct megasas_irq_context *irq_ctx = NULL;
u32 count, MSIxIndex; u32 count, MSIxIndex;
count = instance->msix_vectors > 0 ? instance->msix_vectors : 1; count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
@ -3771,8 +3774,10 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
return; return;
for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) {
complete_cmd_fusion(instance, MSIxIndex, NULL); irq_ctx = &instance->irq_context[MSIxIndex];
complete_cmd_fusion(instance, MSIxIndex, irq_ctx);
}
} }
/** /**
@ -5177,6 +5182,7 @@ megasas_alloc_fusion_context(struct megasas_instance *instance)
if (!fusion->log_to_span) { if (!fusion->log_to_span) {
dev_err(&instance->pdev->dev, "Failed from %s %d\n", dev_err(&instance->pdev->dev, "Failed from %s %d\n",
__func__, __LINE__); __func__, __LINE__);
kfree(instance->ctrl_context);
return -ENOMEM; return -ENOMEM;
} }
} }

View File

@ -1451,7 +1451,7 @@ abort_ret:
ldel_exit: ldel_exit:
spin_lock_bh(&qedi_conn->tmf_work_lock); spin_lock_bh(&qedi_conn->tmf_work_lock);
if (!qedi_cmd->list_tmf_work) { if (qedi_cmd->list_tmf_work) {
list_del_init(&list_work->list); list_del_init(&list_work->list);
qedi_cmd->list_tmf_work = NULL; qedi_cmd->list_tmf_work = NULL;
kfree(list_work); kfree(list_work);

View File

@ -631,7 +631,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev)
goto exit_setup_shost; goto exit_setup_shost;
} }
shost->max_id = QEDI_MAX_ISCSI_CONNS_PER_HBA; shost->max_id = QEDI_MAX_ISCSI_CONNS_PER_HBA - 1;
shost->max_channel = 0; shost->max_channel = 0;
shost->max_lun = ~0; shost->max_lun = ~0;
shost->max_cmd_len = 16; shost->max_cmd_len = 16;

Some files were not shown because too many files have changed in this diff Show More