Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

This commit is contained in:
David S. Miller 2015-11-01 00:15:30 -04:00
commit b75ec3af27
201 changed files with 1370 additions and 799 deletions

View file

@ -59,6 +59,7 @@ James Bottomley <jejb@mulgrave.(none)>
James Bottomley <jejb@titanic.il.steeleye.com> James Bottomley <jejb@titanic.il.steeleye.com>
James E Wilson <wilson@specifix.com> James E Wilson <wilson@specifix.com>
James Ketrenos <jketreno@io.(none)> James Ketrenos <jketreno@io.(none)>
<javier@osg.samsung.com> <javier.martinez@collabora.co.uk>
Jean Tourrilhes <jt@hpl.hp.com> Jean Tourrilhes <jt@hpl.hp.com>
Jeff Garzik <jgarzik@pretzel.yyz.us> Jeff Garzik <jgarzik@pretzel.yyz.us>
Jens Axboe <axboe@suse.de> Jens Axboe <axboe@suse.de>

View file

@ -0,0 +1,7 @@
This file contains documentation for running mainline
kernel on omaps.
KERNEL NEW DEPENDENCIES
v4.3+ Update is needed for custom .config files to make sure
CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work
properly.

View file

@ -894,11 +894,12 @@ M: Lennert Buytenhek <kernel@wantstofly.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
ARM/Allwinner A1X SoC support ARM/Allwinner sunXi SoC support
M: Maxime Ripard <maxime.ripard@free-electrons.com> M: Maxime Ripard <maxime.ripard@free-electrons.com>
M: Chen-Yu Tsai <wens@csie.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
N: sun[x4567]i N: sun[x456789]i
ARM/Allwinner SoC Clock Support ARM/Allwinner SoC Clock Support
M: Emilio López <emilio@elopez.com.ar> M: Emilio López <emilio@elopez.com.ar>
@ -4427,6 +4428,14 @@ L: linuxppc-dev@lists.ozlabs.org
S: Maintained S: Maintained
F: drivers/net/ethernet/freescale/ucc_geth* F: drivers/net/ethernet/freescale/ucc_geth*
FREESCALE eTSEC ETHERNET DRIVER (GIANFAR)
M: Claudiu Manoil <claudiu.manoil@freescale.com>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/ethernet/freescale/gianfar*
X: drivers/net/ethernet/freescale/gianfar_ptp.c
F: Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
FREESCALE QUICC ENGINE UCC UART DRIVER FREESCALE QUICC ENGINE UCC UART DRIVER
M: Timur Tabi <timur@tabi.org> M: Timur Tabi <timur@tabi.org>
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
@ -11697,6 +11706,7 @@ F: drivers/tty/serial/zs.*
ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR
M: Minchan Kim <minchan@kernel.org> M: Minchan Kim <minchan@kernel.org>
M: Nitin Gupta <ngupta@vflare.org> M: Nitin Gupta <ngupta@vflare.org>
R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
L: linux-mm@kvack.org L: linux-mm@kvack.org
S: Maintained S: Maintained
F: mm/zsmalloc.c F: mm/zsmalloc.c

View file

@ -1,7 +1,7 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc6 EXTRAVERSION = -rc7
NAME = Blurry Fish Butt NAME = Blurry Fish Butt
# *DOCUMENTATION* # *DOCUMENTATION*

View file

@ -645,6 +645,7 @@ config ARCH_SHMOBILE_LEGACY
config ARCH_RPC config ARCH_RPC
bool "RiscPC" bool "RiscPC"
depends on MMU
select ARCH_ACORN select ARCH_ACORN
select ARCH_MAY_HAVE_PC_FDC select ARCH_MAY_HAVE_PC_FDC
select ARCH_SPARSEMEM_ENABLE select ARCH_SPARSEMEM_ENABLE

View file

@ -402,11 +402,12 @@
/* SMPS9 unused */ /* SMPS9 unused */
ldo1_reg: ldo1 { ldo1_reg: ldo1 {
/* VDD_SD */ /* VDD_SD / VDDSHV8 */
regulator-name = "ldo1"; regulator-name = "ldo1";
regulator-min-microvolt = <1800000>; regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>; regulator-max-microvolt = <3300000>;
regulator-boot-on; regulator-boot-on;
regulator-always-on;
}; };
ldo2_reg: ldo2 { ldo2_reg: ldo2 {

View file

@ -46,7 +46,7 @@
/ { / {
model = "Marvell Armada 385 Access Point Development Board"; model = "Marvell Armada 385 Access Point Development Board";
compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada38x"; compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada380";
chosen { chosen {
stdout-path = "serial1:115200n8"; stdout-path = "serial1:115200n8";

View file

@ -152,7 +152,7 @@
}; };
usb_phy2: phy@a2f400 { usb_phy2: phy@a2f400 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2cd-usb-phy";
reg = <0xa2f400 0x128>; reg = <0xa2f400 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip_rst 0x104 14>; resets = <&chip_rst 0x104 14>;
@ -170,7 +170,7 @@
}; };
usb_phy0: phy@b74000 { usb_phy0: phy@b74000 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2cd-usb-phy";
reg = <0xb74000 0x128>; reg = <0xb74000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip_rst 0x104 12>; resets = <&chip_rst 0x104 12>;
@ -178,7 +178,7 @@
}; };
usb_phy1: phy@b78000 { usb_phy1: phy@b78000 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2cd-usb-phy";
reg = <0xb78000 0x128>; reg = <0xb78000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip_rst 0x104 13>; resets = <&chip_rst 0x104 13>;

View file

@ -915,6 +915,11 @@
}; };
}; };
&pmu_system_controller {
assigned-clocks = <&pmu_system_controller 0>;
assigned-clock-parents = <&clock CLK_FIN_PLL>;
};
&rtc { &rtc {
status = "okay"; status = "okay";
clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>; clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;

View file

@ -878,6 +878,11 @@
}; };
}; };
&pmu_system_controller {
assigned-clocks = <&pmu_system_controller 0>;
assigned-clock-parents = <&clock CLK_FIN_PLL>;
};
&rtc { &rtc {
status = "okay"; status = "okay";
clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>; clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;

View file

@ -588,10 +588,10 @@
status = "disabled"; status = "disabled";
}; };
uart2: serial@30870000 { uart2: serial@30890000 {
compatible = "fsl,imx7d-uart", compatible = "fsl,imx7d-uart",
"fsl,imx6q-uart"; "fsl,imx6q-uart";
reg = <0x30870000 0x10000>; reg = <0x30890000 0x10000>;
interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX7D_UART2_ROOT_CLK>, clocks = <&clks IMX7D_UART2_ROOT_CLK>,
<&clks IMX7D_UART2_ROOT_CLK>; <&clks IMX7D_UART2_ROOT_CLK>;

View file

@ -12,7 +12,7 @@
/ { / {
model = "LogicPD Zoom DM3730 Torpedo Development Kit"; model = "LogicPD Zoom DM3730 Torpedo Development Kit";
compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap36xx"; compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap3630", "ti,omap3";
gpio_keys { gpio_keys {
compatible = "gpio-keys"; compatible = "gpio-keys";

View file

@ -67,7 +67,7 @@
timer@c1109940 { timer@c1109940 {
compatible = "amlogic,meson6-timer"; compatible = "amlogic,meson6-timer";
reg = <0xc1109940 0x14>; reg = <0xc1109940 0x18>;
interrupts = <0 10 1>; interrupts = <0 10 1>;
}; };
@ -80,36 +80,37 @@
wdt: watchdog@c1109900 { wdt: watchdog@c1109900 {
compatible = "amlogic,meson6-wdt"; compatible = "amlogic,meson6-wdt";
reg = <0xc1109900 0x8>; reg = <0xc1109900 0x8>;
interrupts = <0 0 1>;
}; };
uart_AO: serial@c81004c0 { uart_AO: serial@c81004c0 {
compatible = "amlogic,meson-uart"; compatible = "amlogic,meson-uart";
reg = <0xc81004c0 0x14>; reg = <0xc81004c0 0x18>;
interrupts = <0 90 1>; interrupts = <0 90 1>;
clocks = <&clk81>; clocks = <&clk81>;
status = "disabled"; status = "disabled";
}; };
uart_A: serial@c81084c0 { uart_A: serial@c11084c0 {
compatible = "amlogic,meson-uart"; compatible = "amlogic,meson-uart";
reg = <0xc81084c0 0x14>; reg = <0xc11084c0 0x18>;
interrupts = <0 90 1>; interrupts = <0 26 1>;
clocks = <&clk81>; clocks = <&clk81>;
status = "disabled"; status = "disabled";
}; };
uart_B: serial@c81084dc { uart_B: serial@c11084dc {
compatible = "amlogic,meson-uart"; compatible = "amlogic,meson-uart";
reg = <0xc81084dc 0x14>; reg = <0xc11084dc 0x18>;
interrupts = <0 90 1>; interrupts = <0 75 1>;
clocks = <&clk81>; clocks = <&clk81>;
status = "disabled"; status = "disabled";
}; };
uart_C: serial@c8108700 { uart_C: serial@c1108700 {
compatible = "amlogic,meson-uart"; compatible = "amlogic,meson-uart";
reg = <0xc8108700 0x14>; reg = <0xc1108700 0x18>;
interrupts = <0 90 1>; interrupts = <0 93 1>;
clocks = <&clk81>; clocks = <&clk81>;
status = "disabled"; status = "disabled";
}; };

View file

@ -13,7 +13,7 @@
/ { / {
model = "TI OMAP37XX EVM (TMDSEVM3730)"; model = "TI OMAP37XX EVM (TMDSEVM3730)";
compatible = "ti,omap3-evm-37xx", "ti,omap36xx"; compatible = "ti,omap3-evm-37xx", "ti,omap3630", "ti,omap3";
memory { memory {
device_type = "memory"; device_type = "memory";

View file

@ -56,7 +56,7 @@
/* VMMCI level-shifter enable */ /* VMMCI level-shifter enable */
default_hrefv60_cfg2 { default_hrefv60_cfg2 {
pins = "GPIO169_D22"; pins = "GPIO169_D22";
ste,config = <&gpio_out_lo>; ste,config = <&gpio_out_hi>;
}; };
/* VMMCI level-shifter voltage select */ /* VMMCI level-shifter voltage select */
default_hrefv60_cfg3 { default_hrefv60_cfg3 {

View file

@ -234,7 +234,9 @@
gpio-controller; gpio-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupt-controller; interrupt-controller;
/*
gpio-ranges = <&pinmux 0 0 246>; gpio-ranges = <&pinmux 0 0 246>;
*/
}; };
apbmisc@70000800 { apbmisc@70000800 {

View file

@ -258,7 +258,9 @@
gpio-controller; gpio-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupt-controller; interrupt-controller;
/*
gpio-ranges = <&pinmux 0 0 251>; gpio-ranges = <&pinmux 0 0 251>;
*/
}; };
apbdma: dma@0,60020000 { apbdma: dma@0,60020000 {

View file

@ -244,7 +244,9 @@
gpio-controller; gpio-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupt-controller; interrupt-controller;
/*
gpio-ranges = <&pinmux 0 0 224>; gpio-ranges = <&pinmux 0 0 224>;
*/
}; };
apbmisc@70000800 { apbmisc@70000800 {

View file

@ -349,7 +349,9 @@
gpio-controller; gpio-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupt-controller; interrupt-controller;
/*
gpio-ranges = <&pinmux 0 0 248>; gpio-ranges = <&pinmux 0 0 248>;
*/
}; };
apbmisc@70000800 { apbmisc@70000800 {

View file

@ -85,7 +85,7 @@
}; };
&ethsc { &ethsc {
interrupts = <0 50 4>; interrupts = <0 52 4>;
}; };
&serial0 { &serial0 {

View file

@ -21,6 +21,7 @@ config KVM
depends on MMU && OF depends on MMU && OF
select PREEMPT_NOTIFIERS select PREEMPT_NOTIFIERS
select ANON_INODES select ANON_INODES
select ARM_GIC
select HAVE_KVM_CPU_RELAX_INTERCEPT select HAVE_KVM_CPU_RELAX_INTERCEPT
select HAVE_KVM_ARCH_TLB_FLUSH_ALL select HAVE_KVM_ARCH_TLB_FLUSH_ALL
select KVM_MMIO select KVM_MMIO

View file

@ -1080,7 +1080,7 @@ static int init_hyp_mode(void)
*/ */
err = kvm_timer_hyp_init(); err = kvm_timer_hyp_init();
if (err) if (err)
goto out_free_mappings; goto out_free_context;
#ifndef CONFIG_HOTPLUG_CPU #ifndef CONFIG_HOTPLUG_CPU
free_boot_hyp_pgd(); free_boot_hyp_pgd();

View file

@ -200,15 +200,15 @@ no_clk:
args.args_count = 0; args.args_count = 0;
child_domain = of_genpd_get_from_provider(&args); child_domain = of_genpd_get_from_provider(&args);
if (IS_ERR(child_domain)) if (IS_ERR(child_domain))
goto next_pd; continue;
if (of_parse_phandle_with_args(np, "power-domains", if (of_parse_phandle_with_args(np, "power-domains",
"#power-domain-cells", 0, &args) != 0) "#power-domain-cells", 0, &args) != 0)
goto next_pd; continue;
parent_domain = of_genpd_get_from_provider(&args); parent_domain = of_genpd_get_from_provider(&args);
if (IS_ERR(parent_domain)) if (IS_ERR(parent_domain))
goto next_pd; continue;
if (pm_genpd_add_subdomain(parent_domain, child_domain)) if (pm_genpd_add_subdomain(parent_domain, child_domain))
pr_warn("%s failed to add subdomain: %s\n", pr_warn("%s failed to add subdomain: %s\n",
@ -216,8 +216,6 @@ no_clk:
else else
pr_info("%s has as child subdomain: %s.\n", pr_info("%s has as child subdomain: %s.\n",
parent_domain->name, child_domain->name); parent_domain->name, child_domain->name);
next_pd:
of_node_put(np);
} }
return 0; return 0;

View file

@ -49,6 +49,7 @@ config SOC_OMAP5
select OMAP_INTERCONNECT select OMAP_INTERCONNECT
select OMAP_INTERCONNECT_BARRIER select OMAP_INTERCONNECT_BARRIER
select PM_OPP if PM select PM_OPP if PM
select ZONE_DMA if ARM_LPAE
config SOC_AM33XX config SOC_AM33XX
bool "TI AM33XX" bool "TI AM33XX"
@ -78,6 +79,7 @@ config SOC_DRA7XX
select OMAP_INTERCONNECT select OMAP_INTERCONNECT
select OMAP_INTERCONNECT_BARRIER select OMAP_INTERCONNECT_BARRIER
select PM_OPP if PM select PM_OPP if PM
select ZONE_DMA if ARM_LPAE
config ARCH_OMAP2PLUS config ARCH_OMAP2PLUS
bool bool

View file

@ -106,6 +106,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
MACHINE_END MACHINE_END
static const char *const omap36xx_boards_compat[] __initconst = { static const char *const omap36xx_boards_compat[] __initconst = {
"ti,omap3630",
"ti,omap36xx", "ti,omap36xx",
NULL, NULL,
}; };
@ -243,6 +244,9 @@ static const char *const omap5_boards_compat[] __initconst = {
}; };
DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
.dma_zone_size = SZ_2G,
#endif
.reserve = omap_reserve, .reserve = omap_reserve,
.smp = smp_ops(omap4_smp_ops), .smp = smp_ops(omap4_smp_ops),
.map_io = omap5_map_io, .map_io = omap5_map_io,
@ -288,6 +292,9 @@ static const char *const dra74x_boards_compat[] __initconst = {
}; };
DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
.dma_zone_size = SZ_2G,
#endif
.reserve = omap_reserve, .reserve = omap_reserve,
.smp = smp_ops(omap4_smp_ops), .smp = smp_ops(omap4_smp_ops),
.map_io = dra7xx_map_io, .map_io = dra7xx_map_io,
@ -308,6 +315,9 @@ static const char *const dra72x_boards_compat[] __initconst = {
}; };
DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
.dma_zone_size = SZ_2G,
#endif
.reserve = omap_reserve, .reserve = omap_reserve,
.map_io = dra7xx_map_io, .map_io = dra7xx_map_io,
.init_early = dra7xx_init_early, .init_early = dra7xx_init_early,

View file

@ -559,7 +559,14 @@ static void pdata_quirks_check(struct pdata_init *quirks)
void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table) void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
{ {
omap_sdrc_init(NULL, NULL); /*
* We still need this for omap2420 and omap3 PM to work, others are
* using drivers/misc/sram.c already.
*/
if (of_machine_is_compatible("ti,omap2420") ||
of_machine_is_compatible("ti,omap3"))
omap_sdrc_init(NULL, NULL);
pdata_quirks_check(auxdata_quirks); pdata_quirks_check(auxdata_quirks);
of_platform_populate(NULL, omap_dt_match_table, of_platform_populate(NULL, omap_dt_match_table,
omap_auxdata_lookup, NULL); omap_auxdata_lookup, NULL);

View file

@ -42,10 +42,6 @@
#define PECR_IS(n) ((1 << ((n) * 2)) << 29) #define PECR_IS(n) ((1 << ((n) * 2)) << 29)
extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)); extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));
#ifdef CONFIG_PM
#define ISRAM_START 0x5c000000
#define ISRAM_SIZE SZ_256K
/* /*
* NAND NFC: DFI bus arbitration subset * NAND NFC: DFI bus arbitration subset
@ -54,6 +50,11 @@ extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));
#define NDCR_ND_ARB_EN (1 << 12) #define NDCR_ND_ARB_EN (1 << 12)
#define NDCR_ND_ARB_CNTL (1 << 19) #define NDCR_ND_ARB_CNTL (1 << 19)
#ifdef CONFIG_PM
#define ISRAM_START 0x5c000000
#define ISRAM_SIZE SZ_256K
static void __iomem *sram; static void __iomem *sram;
static unsigned long wakeup_src; static unsigned long wakeup_src;

View file

@ -495,7 +495,7 @@ void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
d->netdev = &orion_ge00.dev; d->netdev = &orion_ge00.dev;
for (i = 0; i < d->nr_chips; i++) for (i = 0; i < d->nr_chips; i++)
d->chip[i].host_dev = &orion_ge00_shared.dev; d->chip[i].host_dev = &orion_ge_mvmdio.dev;
orion_switch_device.dev.platform_data = d; orion_switch_device.dev.platform_data = d;
platform_device_register(&orion_switch_device); platform_device_register(&orion_switch_device);

View file

@ -45,7 +45,6 @@
* it does. * it does.
*/ */
#include <byteswap.h>
#include <elf.h> #include <elf.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -59,6 +58,16 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#define swab16(x) \
((((x) & 0x00ff) << 8) | \
(((x) & 0xff00) >> 8))
#define swab32(x) \
((((x) & 0x000000ff) << 24) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0xff000000) << 24))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define HOST_ORDER ELFDATA2LSB #define HOST_ORDER ELFDATA2LSB
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
@ -104,17 +113,17 @@ static void cleanup(void)
static Elf32_Word read_elf_word(Elf32_Word word, bool swap) static Elf32_Word read_elf_word(Elf32_Word word, bool swap)
{ {
return swap ? bswap_32(word) : word; return swap ? swab32(word) : word;
} }
static Elf32_Half read_elf_half(Elf32_Half half, bool swap) static Elf32_Half read_elf_half(Elf32_Half half, bool swap)
{ {
return swap ? bswap_16(half) : half; return swap ? swab16(half) : half;
} }
static void write_elf_word(Elf32_Word val, Elf32_Word *dst, bool swap) static void write_elf_word(Elf32_Word val, Elf32_Word *dst, bool swap)
{ {
*dst = swap ? bswap_32(val) : val; *dst = swap ? swab32(val) : val;
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View file

@ -284,21 +284,23 @@ static void register_insn_emulation_sysctl(struct ctl_table *table)
__asm__ __volatile__( \ __asm__ __volatile__( \
ALTERNATIVE("nop", SET_PSTATE_PAN(0), ARM64_HAS_PAN, \ ALTERNATIVE("nop", SET_PSTATE_PAN(0), ARM64_HAS_PAN, \
CONFIG_ARM64_PAN) \ CONFIG_ARM64_PAN) \
" mov %w2, %w1\n" \ "0: ldxr"B" %w2, [%3]\n" \
"0: ldxr"B" %w1, [%3]\n" \ "1: stxr"B" %w0, %w1, [%3]\n" \
"1: stxr"B" %w0, %w2, [%3]\n" \
" cbz %w0, 2f\n" \ " cbz %w0, 2f\n" \
" mov %w0, %w4\n" \ " mov %w0, %w4\n" \
" b 3f\n" \
"2:\n" \ "2:\n" \
" mov %w1, %w2\n" \
"3:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %w0, %w5\n" \ "4: mov %w0, %w5\n" \
" b 2b\n" \ " b 3b\n" \
" .popsection" \ " .popsection" \
" .pushsection __ex_table,\"a\"\n" \ " .pushsection __ex_table,\"a\"\n" \
" .align 3\n" \ " .align 3\n" \
" .quad 0b, 3b\n" \ " .quad 0b, 4b\n" \
" .quad 1b, 3b\n" \ " .quad 1b, 4b\n" \
" .popsection\n" \ " .popsection\n" \
ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, \ ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, \
CONFIG_ARM64_PAN) \ CONFIG_ARM64_PAN) \

View file

@ -25,10 +25,20 @@ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg,
unsigned long kernel_size, kernel_memsize = 0; unsigned long kernel_size, kernel_memsize = 0;
unsigned long nr_pages; unsigned long nr_pages;
void *old_image_addr = (void *)*image_addr; void *old_image_addr = (void *)*image_addr;
unsigned long preferred_offset;
/*
* The preferred offset of the kernel Image is TEXT_OFFSET bytes beyond
* a 2 MB aligned base, which itself may be lower than dram_base, as
* long as the resulting offset equals or exceeds it.
*/
preferred_offset = round_down(dram_base, SZ_2M) + TEXT_OFFSET;
if (preferred_offset < dram_base)
preferred_offset += SZ_2M;
/* Relocate the image, if required. */ /* Relocate the image, if required. */
kernel_size = _edata - _text; kernel_size = _edata - _text;
if (*image_addr != (dram_base + TEXT_OFFSET)) { if (*image_addr != preferred_offset) {
kernel_memsize = kernel_size + (_end - _edata); kernel_memsize = kernel_size + (_end - _edata);
/* /*
@ -42,7 +52,7 @@ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg,
* Mustang), we can still place the kernel at the address * Mustang), we can still place the kernel at the address
* 'dram_base + TEXT_OFFSET'. * 'dram_base + TEXT_OFFSET'.
*/ */
*image_addr = *reserve_addr = dram_base + TEXT_OFFSET; *image_addr = *reserve_addr = preferred_offset;
nr_pages = round_up(kernel_memsize, EFI_ALLOC_ALIGN) / nr_pages = round_up(kernel_memsize, EFI_ALLOC_ALIGN) /
EFI_PAGE_SIZE; EFI_PAGE_SIZE;
status = efi_call_early(allocate_pages, EFI_ALLOCATE_ADDRESS, status = efi_call_early(allocate_pages, EFI_ALLOCATE_ADDRESS,

View file

@ -48,11 +48,7 @@ int notrace unwind_frame(struct stackframe *frame)
frame->sp = fp + 0x10; frame->sp = fp + 0x10;
frame->fp = *(unsigned long *)(fp); frame->fp = *(unsigned long *)(fp);
/* frame->pc = *(unsigned long *)(fp + 8);
* -4 here because we care about the PC at time of bl,
* not where the return will go.
*/
frame->pc = *(unsigned long *)(fp + 8) - 4;
return 0; return 0;
} }

View file

@ -80,17 +80,21 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
if (ret == 0) { if (ret == 0) {
/* /*
* We are resuming from reset with TTBR0_EL1 set to the * We are resuming from reset with TTBR0_EL1 set to the
* idmap to enable the MMU; restore the active_mm mappings in * idmap to enable the MMU; set the TTBR0 to the reserved
* TTBR0_EL1 unless the active_mm == &init_mm, in which case * page tables to prevent speculative TLB allocations, flush
* the thread entered cpu_suspend with TTBR0_EL1 set to * the local tlb and set the default tcr_el1.t0sz so that
* reserved TTBR0 page tables and should be restored as such. * the TTBR0 address space set-up is properly restored.
* If the current active_mm != &init_mm we entered cpu_suspend
* with mappings in TTBR0 that must be restored, so we switch
* them back to complete the address space configuration
* restoration before returning.
*/ */
if (mm == &init_mm) cpu_set_reserved_ttbr0();
cpu_set_reserved_ttbr0();
else
cpu_switch_mm(mm->pgd, mm);
flush_tlb_all(); flush_tlb_all();
cpu_set_default_tcr_t0sz();
if (mm != &init_mm)
cpu_switch_mm(mm->pgd, mm);
/* /*
* Restore per-cpu offset before any kernel * Restore per-cpu offset before any kernel

View file

@ -11,7 +11,7 @@
#define NR_syscalls 321 /* length of syscall table */ #define NR_syscalls 322 /* length of syscall table */
/* /*
* The following defines stop scripts/checksyscalls.sh from complaining about * The following defines stop scripts/checksyscalls.sh from complaining about

View file

@ -334,5 +334,6 @@
#define __NR_execveat 1342 #define __NR_execveat 1342
#define __NR_userfaultfd 1343 #define __NR_userfaultfd 1343
#define __NR_membarrier 1344 #define __NR_membarrier 1344
#define __NR_kcmp 1345
#endif /* _UAPI_ASM_IA64_UNISTD_H */ #endif /* _UAPI_ASM_IA64_UNISTD_H */

View file

@ -1770,5 +1770,6 @@ sys_call_table:
data8 sys_execveat data8 sys_execveat
data8 sys_userfaultfd data8 sys_userfaultfd
data8 sys_membarrier data8 sys_membarrier
data8 sys_kcmp // 1345
.org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls

View file

@ -3,7 +3,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/reg.h>
/* bytes per L1 cache line */ /* bytes per L1 cache line */
#if defined(CONFIG_8xx) || defined(CONFIG_403GCX) #if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
@ -40,12 +39,6 @@ struct ppc64_caches {
}; };
extern struct ppc64_caches ppc64_caches; extern struct ppc64_caches ppc64_caches;
static inline void logmpp(u64 x)
{
asm volatile(PPC_LOGMPP(R1) : : "r" (x));
}
#endif /* __powerpc64__ && ! __ASSEMBLY__ */ #endif /* __powerpc64__ && ! __ASSEMBLY__ */
#if defined(__ASSEMBLY__) #if defined(__ASSEMBLY__)

View file

@ -297,8 +297,6 @@ struct kvmppc_vcore {
u32 arch_compat; u32 arch_compat;
ulong pcr; ulong pcr;
ulong dpdes; /* doorbell state (POWER8) */ ulong dpdes; /* doorbell state (POWER8) */
void *mpp_buffer; /* Micro Partition Prefetch buffer */
bool mpp_buffer_is_valid;
ulong conferring_threads; ulong conferring_threads;
}; };

View file

@ -141,7 +141,6 @@
#define PPC_INST_ISEL 0x7c00001e #define PPC_INST_ISEL 0x7c00001e
#define PPC_INST_ISEL_MASK 0xfc00003e #define PPC_INST_ISEL_MASK 0xfc00003e
#define PPC_INST_LDARX 0x7c0000a8 #define PPC_INST_LDARX 0x7c0000a8
#define PPC_INST_LOGMPP 0x7c0007e4
#define PPC_INST_LSWI 0x7c0004aa #define PPC_INST_LSWI 0x7c0004aa
#define PPC_INST_LSWX 0x7c00042a #define PPC_INST_LSWX 0x7c00042a
#define PPC_INST_LWARX 0x7c000028 #define PPC_INST_LWARX 0x7c000028
@ -285,20 +284,6 @@
#define __PPC_EH(eh) 0 #define __PPC_EH(eh) 0
#endif #endif
/* POWER8 Micro Partition Prefetch (MPP) parameters */
/* Address mask is common for LOGMPP instruction and MPPR SPR */
#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL
/* Bits 60 and 61 of MPP SPR should be set to one of the following */
/* Aborting the fetch is indeed setting 00 in the table size bits */
#define PPC_MPPR_FETCH_ABORT (0x0ULL << 60)
#define PPC_MPPR_FETCH_WHOLE_TABLE (0x2ULL << 60)
/* Bits 54 and 55 of register for LOGMPP instruction should be set to: */
#define PPC_LOGMPP_LOG_L2 (0x02ULL << 54)
#define PPC_LOGMPP_LOG_L2L3 (0x01ULL << 54)
#define PPC_LOGMPP_LOG_ABORT (0x03ULL << 54)
/* Deal with instructions that older assemblers aren't aware of */ /* Deal with instructions that older assemblers aren't aware of */
#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ #define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
__PPC_RA(a) | __PPC_RB(b)) __PPC_RA(a) | __PPC_RB(b))
@ -307,8 +292,6 @@
#define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \ #define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \
___PPC_RT(t) | ___PPC_RA(a) | \ ___PPC_RT(t) | ___PPC_RA(a) | \
___PPC_RB(b) | __PPC_EH(eh)) ___PPC_RB(b) | __PPC_EH(eh))
#define PPC_LOGMPP(b) stringify_in_c(.long PPC_INST_LOGMPP | \
__PPC_RB(b))
#define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \ #define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \
___PPC_RT(t) | ___PPC_RA(a) | \ ___PPC_RT(t) | ___PPC_RA(a) | \
___PPC_RB(b) | __PPC_EH(eh)) ___PPC_RB(b) | __PPC_EH(eh))

View file

@ -226,7 +226,6 @@
#define CTRL_TE 0x00c00000 /* thread enable */ #define CTRL_TE 0x00c00000 /* thread enable */
#define CTRL_RUNLATCH 0x1 #define CTRL_RUNLATCH 0x1
#define SPRN_DAWR 0xB4 #define SPRN_DAWR 0xB4
#define SPRN_MPPR 0xB8 /* Micro Partition Prefetch Register */
#define SPRN_RPR 0xBA /* Relative Priority Register */ #define SPRN_RPR 0xBA /* Relative Priority Register */
#define SPRN_CIABR 0xBB #define SPRN_CIABR 0xBB
#define CIABR_PRIV 0x3 #define CIABR_PRIV 0x3

View file

@ -303,7 +303,7 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
dev->coherent_dma_mask = mask; dev->coherent_dma_mask = mask;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(dma_set_coherent_mask); EXPORT_SYMBOL(dma_set_coherent_mask);
#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16) #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)

View file

@ -1043,6 +1043,9 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (!rtas.entry)
return -EINVAL;
if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0) if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
return -EFAULT; return -EFAULT;

View file

@ -36,7 +36,6 @@
#include <asm/reg.h> #include <asm/reg.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/cache.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
@ -75,12 +74,6 @@
static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1); static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1);
#if defined(CONFIG_PPC_64K_PAGES)
#define MPP_BUFFER_ORDER 0
#elif defined(CONFIG_PPC_4K_PAGES)
#define MPP_BUFFER_ORDER 3
#endif
static int dynamic_mt_modes = 6; static int dynamic_mt_modes = 6;
module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR); module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(dynamic_mt_modes, "Set of allowed dynamic micro-threading modes: 0 (= none), 2, 4, or 6 (= 2 or 4)"); MODULE_PARM_DESC(dynamic_mt_modes, "Set of allowed dynamic micro-threading modes: 0 (= none), 2, 4, or 6 (= 2 or 4)");
@ -1455,13 +1448,6 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int core)
vcore->kvm = kvm; vcore->kvm = kvm;
INIT_LIST_HEAD(&vcore->preempt_list); INIT_LIST_HEAD(&vcore->preempt_list);
vcore->mpp_buffer_is_valid = false;
if (cpu_has_feature(CPU_FTR_ARCH_207S))
vcore->mpp_buffer = (void *)__get_free_pages(
GFP_KERNEL|__GFP_ZERO,
MPP_BUFFER_ORDER);
return vcore; return vcore;
} }
@ -1894,33 +1880,6 @@ static int on_primary_thread(void)
return 1; return 1;
} }
static void kvmppc_start_saving_l2_cache(struct kvmppc_vcore *vc)
{
phys_addr_t phy_addr, mpp_addr;
phy_addr = (phys_addr_t)virt_to_phys(vc->mpp_buffer);
mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;
mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_ABORT);
logmpp(mpp_addr | PPC_LOGMPP_LOG_L2);
vc->mpp_buffer_is_valid = true;
}
static void kvmppc_start_restoring_l2_cache(const struct kvmppc_vcore *vc)
{
phys_addr_t phy_addr, mpp_addr;
phy_addr = virt_to_phys(vc->mpp_buffer);
mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;
/* We must abort any in-progress save operations to ensure
* the table is valid so that prefetch engine knows when to
* stop prefetching. */
logmpp(mpp_addr | PPC_LOGMPP_LOG_ABORT);
mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_WHOLE_TABLE);
}
/* /*
* A list of virtual cores for each physical CPU. * A list of virtual cores for each physical CPU.
* These are vcores that could run but their runner VCPU tasks are * These are vcores that could run but their runner VCPU tasks are
@ -2471,14 +2430,8 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc)
srcu_idx = srcu_read_lock(&vc->kvm->srcu); srcu_idx = srcu_read_lock(&vc->kvm->srcu);
if (vc->mpp_buffer_is_valid)
kvmppc_start_restoring_l2_cache(vc);
__kvmppc_vcore_entry(); __kvmppc_vcore_entry();
if (vc->mpp_buffer)
kvmppc_start_saving_l2_cache(vc);
srcu_read_unlock(&vc->kvm->srcu, srcu_idx); srcu_read_unlock(&vc->kvm->srcu, srcu_idx);
spin_lock(&vc->lock); spin_lock(&vc->lock);
@ -3073,14 +3026,8 @@ static void kvmppc_free_vcores(struct kvm *kvm)
{ {
long int i; long int i;
for (i = 0; i < KVM_MAX_VCORES; ++i) { for (i = 0; i < KVM_MAX_VCORES; ++i)
if (kvm->arch.vcores[i] && kvm->arch.vcores[i]->mpp_buffer) {
struct kvmppc_vcore *vc = kvm->arch.vcores[i];
free_pages((unsigned long)vc->mpp_buffer,
MPP_BUFFER_ORDER);
}
kfree(kvm->arch.vcores[i]); kfree(kvm->arch.vcores[i]);
}
kvm->arch.online_vcores = 0; kvm->arch.online_vcores = 0;
} }

View file

@ -171,7 +171,26 @@ static void pnv_smp_cpu_kill_self(void)
* so clear LPCR:PECE1. We keep PECE2 enabled. * so clear LPCR:PECE1. We keep PECE2 enabled.
*/ */
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
/*
* Hard-disable interrupts, and then clear irq_happened flags
* that we can safely ignore while off-line, since they
* are for things for which we do no processing when off-line
* (or in the case of HMI, all the processing we need to do
* is done in lower-level real-mode code).
*/
hard_irq_disable();
local_paca->irq_happened &= ~(PACA_IRQ_DEC | PACA_IRQ_HMI);
while (!generic_check_cpu_restart(cpu)) { while (!generic_check_cpu_restart(cpu)) {
/*
* Clear IPI flag, since we don't handle IPIs while
* offline, except for those when changing micro-threading
* mode, which are handled explicitly below, and those
* for coming online, which are handled via
* generic_check_cpu_restart() calls.
*/
kvmppc_set_host_ipi(cpu, 0);
ppc64_runlatch_off(); ppc64_runlatch_off();
@ -196,20 +215,20 @@ static void pnv_smp_cpu_kill_self(void)
* having finished executing in a KVM guest, then srr1 * having finished executing in a KVM guest, then srr1
* contains 0. * contains 0.
*/ */
if ((srr1 & wmask) == SRR1_WAKEEE) { if (((srr1 & wmask) == SRR1_WAKEEE) ||
(local_paca->irq_happened & PACA_IRQ_EE)) {
icp_native_flush_interrupt(); icp_native_flush_interrupt();
local_paca->irq_happened &= PACA_IRQ_HARD_DIS;
smp_mb();
} else if ((srr1 & wmask) == SRR1_WAKEHDBELL) { } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) {
unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER); unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER);
asm volatile(PPC_MSGCLR(%0) : : "r" (msg)); asm volatile(PPC_MSGCLR(%0) : : "r" (msg));
kvmppc_set_host_ipi(cpu, 0);
} }
local_paca->irq_happened &= ~(PACA_IRQ_EE | PACA_IRQ_DBELL);
smp_mb();
if (cpu_core_split_required()) if (cpu_core_split_required())
continue; continue;
if (!generic_check_cpu_restart(cpu)) if (srr1 && !generic_check_cpu_restart(cpu))
DBG("CPU%d Unexpected exit while offline !\n", cpu); DBG("CPU%d Unexpected exit while offline !\n", cpu);
} }
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1); mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1);

View file

@ -70,8 +70,8 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \ $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
-D_FILE_OFFSET_BITS=64 -idirafter include \ -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
-D__KERNEL__ -D__UM_HOST__ -idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__
#This will adjust *FLAGS accordingly to the platform. #This will adjust *FLAGS accordingly to the platform.
include $(ARCH_DIR)/Makefile-os-$(OS) include $(ARCH_DIR)/Makefile-os-$(OS)

View file

@ -220,7 +220,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
show_regs(container_of(regs, struct pt_regs, regs)); show_regs(container_of(regs, struct pt_regs, regs));
panic("Segfault with no mm"); panic("Segfault with no mm");
} }
else if (!is_user && address < TASK_SIZE) { else if (!is_user && address > PAGE_SIZE && address < TASK_SIZE) {
show_regs(container_of(regs, struct pt_regs, regs)); show_regs(container_of(regs, struct pt_regs, regs));
panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx", panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx",
address, ip); address, ip);

View file

@ -96,7 +96,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
"ret = %d\n", -n); "ret = %d\n", -n);
ret = n; ret = n;
} }
CATCH_EINTR(waitpid(pid, NULL, __WCLONE)); CATCH_EINTR(waitpid(pid, NULL, __WALL));
} }
out_free2: out_free2:
@ -129,7 +129,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
return err; return err;
} }
if (stack_out == NULL) { if (stack_out == NULL) {
CATCH_EINTR(pid = waitpid(pid, &status, __WCLONE)); CATCH_EINTR(pid = waitpid(pid, &status, __WALL));
if (pid < 0) { if (pid < 0) {
err = -errno; err = -errno;
printk(UM_KERN_ERR "run_helper_thread - wait failed, " printk(UM_KERN_ERR "run_helper_thread - wait failed, "
@ -148,7 +148,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
int helper_wait(int pid) int helper_wait(int pid)
{ {
int ret, status; int ret, status;
int wflags = __WCLONE; int wflags = __WALL;
CATCH_EINTR(ret = waitpid(pid, &status, wflags)); CATCH_EINTR(ret = waitpid(pid, &status, wflags));
if (ret < 0) { if (ret < 0) {

View file

@ -667,6 +667,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
bool conout_found = false; bool conout_found = false;
void *dummy = NULL; void *dummy = NULL;
u32 h = handles[i]; u32 h = handles[i];
u32 current_fb_base;
status = efi_call_early(handle_protocol, h, status = efi_call_early(handle_protocol, h,
proto, (void **)&gop32); proto, (void **)&gop32);
@ -678,7 +679,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
if (status == EFI_SUCCESS) if (status == EFI_SUCCESS)
conout_found = true; conout_found = true;
status = __gop_query32(gop32, &info, &size, &fb_base); status = __gop_query32(gop32, &info, &size, &current_fb_base);
if (status == EFI_SUCCESS && (!first_gop || conout_found)) { if (status == EFI_SUCCESS && (!first_gop || conout_found)) {
/* /*
* Systems that use the UEFI Console Splitter may * Systems that use the UEFI Console Splitter may
@ -692,6 +693,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
pixel_format = info->pixel_format; pixel_format = info->pixel_format;
pixel_info = info->pixel_information; pixel_info = info->pixel_information;
pixels_per_scan_line = info->pixels_per_scan_line; pixels_per_scan_line = info->pixels_per_scan_line;
fb_base = current_fb_base;
/* /*
* Once we've found a GOP supporting ConOut, * Once we've found a GOP supporting ConOut,
@ -770,6 +772,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
bool conout_found = false; bool conout_found = false;
void *dummy = NULL; void *dummy = NULL;
u64 h = handles[i]; u64 h = handles[i];
u32 current_fb_base;
status = efi_call_early(handle_protocol, h, status = efi_call_early(handle_protocol, h,
proto, (void **)&gop64); proto, (void **)&gop64);
@ -781,7 +784,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
if (status == EFI_SUCCESS) if (status == EFI_SUCCESS)
conout_found = true; conout_found = true;
status = __gop_query64(gop64, &info, &size, &fb_base); status = __gop_query64(gop64, &info, &size, &current_fb_base);
if (status == EFI_SUCCESS && (!first_gop || conout_found)) { if (status == EFI_SUCCESS && (!first_gop || conout_found)) {
/* /*
* Systems that use the UEFI Console Splitter may * Systems that use the UEFI Console Splitter may
@ -795,6 +798,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
pixel_format = info->pixel_format; pixel_format = info->pixel_format;
pixel_info = info->pixel_information; pixel_info = info->pixel_information;
pixels_per_scan_line = info->pixels_per_scan_line; pixels_per_scan_line = info->pixels_per_scan_line;
fb_base = current_fb_base;
/* /*
* Once we've found a GOP supporting ConOut, * Once we've found a GOP supporting ConOut,

View file

@ -27,12 +27,11 @@ static __always_inline void *__inline_memcpy(void *to, const void *from, size_t
function. */ function. */
#define __HAVE_ARCH_MEMCPY 1 #define __HAVE_ARCH_MEMCPY 1
extern void *memcpy(void *to, const void *from, size_t len);
extern void *__memcpy(void *to, const void *from, size_t len); extern void *__memcpy(void *to, const void *from, size_t len);
#ifndef CONFIG_KMEMCHECK #ifndef CONFIG_KMEMCHECK
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 #if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4
extern void *memcpy(void *to, const void *from, size_t len);
#else
#define memcpy(dst, src, len) \ #define memcpy(dst, src, len) \
({ \ ({ \
size_t __len = (len); \ size_t __len = (len); \

View file

@ -2907,6 +2907,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
struct irq_data *irq_data; struct irq_data *irq_data;
struct mp_chip_data *data; struct mp_chip_data *data;
struct irq_alloc_info *info = arg; struct irq_alloc_info *info = arg;
unsigned long flags;
if (!info || nr_irqs > 1) if (!info || nr_irqs > 1)
return -EINVAL; return -EINVAL;
@ -2939,11 +2940,14 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
cfg = irqd_cfg(irq_data); cfg = irqd_cfg(irq_data);
add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin); add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin);
local_irq_save(flags);
if (info->ioapic_entry) if (info->ioapic_entry)
mp_setup_entry(cfg, data, info->ioapic_entry); mp_setup_entry(cfg, data, info->ioapic_entry);
mp_register_handler(virq, data->trigger); mp_register_handler(virq, data->trigger);
if (virq < nr_legacy_irqs()) if (virq < nr_legacy_irqs())
legacy_pic->mask(virq); legacy_pic->mask(virq);
local_irq_restore(flags);
apic_printk(APIC_VERBOSE, KERN_DEBUG apic_printk(APIC_VERBOSE, KERN_DEBUG
"IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n", "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n",

View file

@ -550,14 +550,14 @@ unsigned long get_wchan(struct task_struct *p)
if (sp < bottom || sp > top) if (sp < bottom || sp > top)
return 0; return 0;
fp = READ_ONCE(*(unsigned long *)sp); fp = READ_ONCE_NOCHECK(*(unsigned long *)sp);
do { do {
if (fp < bottom || fp > top) if (fp < bottom || fp > top)
return 0; return 0;
ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long))); ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long)));
if (!in_sched_functions(ip)) if (!in_sched_functions(ip))
return ip; return ip;
fp = READ_ONCE(*(unsigned long *)fp); fp = READ_ONCE_NOCHECK(*(unsigned long *)fp);
} while (count++ < 16 && p->state != TASK_RUNNING); } while (count++ < 16 && p->state != TASK_RUNNING);
return 0; return 0;
} }

View file

@ -1173,6 +1173,14 @@ void __init setup_arch(char **cmdline_p)
clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
swapper_pg_dir + KERNEL_PGD_BOUNDARY, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
KERNEL_PGD_PTRS); KERNEL_PGD_PTRS);
/*
* sync back low identity map too. It is used for example
* in the 32-bit EFI stub.
*/
clone_pgd_range(initial_page_table,
swapper_pg_dir + KERNEL_PGD_BOUNDARY,
KERNEL_PGD_PTRS);
#endif #endif
tboot_probe(); tboot_probe();

View file

@ -509,7 +509,7 @@ void __inquire_remote_apic(int apicid)
*/ */
#define UDELAY_10MS_DEFAULT 10000 #define UDELAY_10MS_DEFAULT 10000
static unsigned int init_udelay = UDELAY_10MS_DEFAULT; static unsigned int init_udelay = INT_MAX;
static int __init cpu_init_udelay(char *str) static int __init cpu_init_udelay(char *str)
{ {
@ -522,13 +522,16 @@ early_param("cpu_init_udelay", cpu_init_udelay);
static void __init smp_quirk_init_udelay(void) static void __init smp_quirk_init_udelay(void)
{ {
/* if cmdline changed it from default, leave it alone */ /* if cmdline changed it from default, leave it alone */
if (init_udelay != UDELAY_10MS_DEFAULT) if (init_udelay != INT_MAX)
return; return;
/* if modern processor, use no delay */ /* if modern processor, use no delay */
if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) || if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||
((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF)))
init_udelay = 0; init_udelay = 0;
/* else, use legacy delay */
init_udelay = UDELAY_10MS_DEFAULT;
} }
/* /*
@ -657,7 +660,9 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
/* /*
* Give the other CPU some time to accept the IPI. * Give the other CPU some time to accept the IPI.
*/ */
if (init_udelay) if (init_udelay == 0)
udelay(10);
else
udelay(300); udelay(300);
pr_debug("Startup point 1\n"); pr_debug("Startup point 1\n");
@ -668,7 +673,9 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
/* /*
* Give the other CPU some time to accept the IPI. * Give the other CPU some time to accept the IPI.
*/ */
if (init_udelay) if (init_udelay == 0)
udelay(10);
else
udelay(200); udelay(200);
if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */

View file

@ -12,7 +12,10 @@
#include <skas.h> #include <skas.h>
#include <sysdep/tls.h> #include <sysdep/tls.h>
extern int modify_ldt(int func, void *ptr, unsigned long bytecount); static inline int modify_ldt (int func, void *ptr, unsigned long bytecount)
{
return syscall(__NR_modify_ldt, func, ptr, bytecount);
}
static long write_ldt_entry(struct mm_id *mm_idp, int func, static long write_ldt_entry(struct mm_id *mm_idp, int func,
struct user_desc *desc, void **addr, int done) struct user_desc *desc, void **addr, int done)

View file

@ -576,7 +576,7 @@ void blk_cleanup_queue(struct request_queue *q)
q->queue_lock = &q->__queue_lock; q->queue_lock = &q->__queue_lock;
spin_unlock_irq(lock); spin_unlock_irq(lock);
bdi_destroy(&q->backing_dev_info); bdi_unregister(&q->backing_dev_info);
/* @q is and will stay empty, shutdown and put */ /* @q is and will stay empty, shutdown and put */
blk_put_queue(q); blk_put_queue(q);

View file

@ -26,13 +26,6 @@ static void bio_batch_end_io(struct bio *bio)
bio_put(bio); bio_put(bio);
} }
/*
* Ensure that max discard sectors doesn't overflow bi_size and hopefully
* it is of the proper granularity as long as the granularity is a power
* of two.
*/
#define MAX_BIO_SECTORS ((1U << 31) >> 9)
/** /**
* blkdev_issue_discard - queue a discard * blkdev_issue_discard - queue a discard
* @bdev: blockdev to issue discard for * @bdev: blockdev to issue discard for
@ -50,6 +43,8 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
DECLARE_COMPLETION_ONSTACK(wait); DECLARE_COMPLETION_ONSTACK(wait);
struct request_queue *q = bdev_get_queue(bdev); struct request_queue *q = bdev_get_queue(bdev);
int type = REQ_WRITE | REQ_DISCARD; int type = REQ_WRITE | REQ_DISCARD;
unsigned int granularity;
int alignment;
struct bio_batch bb; struct bio_batch bb;
struct bio *bio; struct bio *bio;
int ret = 0; int ret = 0;
@ -61,6 +56,10 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
if (!blk_queue_discard(q)) if (!blk_queue_discard(q))
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Zero-sector (unknown) and one-sector granularities are the same. */
granularity = max(q->limits.discard_granularity >> 9, 1U);
alignment = (bdev_discard_alignment(bdev) >> 9) % granularity;
if (flags & BLKDEV_DISCARD_SECURE) { if (flags & BLKDEV_DISCARD_SECURE) {
if (!blk_queue_secdiscard(q)) if (!blk_queue_secdiscard(q))
return -EOPNOTSUPP; return -EOPNOTSUPP;
@ -74,7 +73,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
blk_start_plug(&plug); blk_start_plug(&plug);
while (nr_sects) { while (nr_sects) {
unsigned int req_sects; unsigned int req_sects;
sector_t end_sect; sector_t end_sect, tmp;
bio = bio_alloc(gfp_mask, 1); bio = bio_alloc(gfp_mask, 1);
if (!bio) { if (!bio) {
@ -82,8 +81,22 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
break; break;
} }
req_sects = min_t(sector_t, nr_sects, MAX_BIO_SECTORS); /* Make sure bi_size doesn't overflow */
req_sects = min_t(sector_t, nr_sects, UINT_MAX >> 9);
/*
* If splitting a request, and the next starting sector would be
* misaligned, stop the discard at the previous aligned sector.
*/
end_sect = sector + req_sects; end_sect = sector + req_sects;
tmp = end_sect;
if (req_sects < nr_sects &&
sector_div(tmp, granularity) != alignment) {
end_sect = end_sect - alignment;
sector_div(end_sect, granularity);
end_sect = end_sect * granularity + alignment;
req_sects = end_sect - sector;
}
bio->bi_iter.bi_sector = sector; bio->bi_iter.bi_sector = sector;
bio->bi_end_io = bio_batch_end_io; bio->bi_end_io = bio_batch_end_io;

View file

@ -641,6 +641,7 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
{ {
bt_free(&tags->bitmap_tags); bt_free(&tags->bitmap_tags);
bt_free(&tags->breserved_tags); bt_free(&tags->breserved_tags);
free_cpumask_var(tags->cpumask);
kfree(tags); kfree(tags);
} }

View file

@ -2296,10 +2296,8 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set)
int i; int i;
for (i = 0; i < set->nr_hw_queues; i++) { for (i = 0; i < set->nr_hw_queues; i++) {
if (set->tags[i]) { if (set->tags[i])
blk_mq_free_rq_map(set, set->tags[i], i); blk_mq_free_rq_map(set, set->tags[i], i);
free_cpumask_var(set->tags[i]->cpumask);
}
} }
kfree(set->tags); kfree(set->tags);

View file

@ -540,6 +540,7 @@ static void blk_release_queue(struct kobject *kobj)
struct request_queue *q = struct request_queue *q =
container_of(kobj, struct request_queue, kobj); container_of(kobj, struct request_queue, kobj);
bdi_exit(&q->backing_dev_info);
blkcg_exit_queue(q); blkcg_exit_queue(q);
if (q->elevator) { if (q->elevator) {

View file

@ -706,7 +706,7 @@ struct crypto_ablkcipher *crypto_alloc_ablkcipher(const char *alg_name,
err: err:
if (err != -EAGAIN) if (err != -EAGAIN)
break; break;
if (signal_pending(current)) { if (fatal_signal_pending(current)) {
err = -EINTR; err = -EINTR;
break; break;
} }

View file

@ -345,7 +345,7 @@ static void crypto_wait_for_test(struct crypto_larval *larval)
crypto_alg_tested(larval->alg.cra_driver_name, 0); crypto_alg_tested(larval->alg.cra_driver_name, 0);
} }
err = wait_for_completion_interruptible(&larval->completion); err = wait_for_completion_killable(&larval->completion);
WARN_ON(err); WARN_ON(err);
out: out:

View file

@ -172,7 +172,7 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
struct crypto_larval *larval = (void *)alg; struct crypto_larval *larval = (void *)alg;
long timeout; long timeout;
timeout = wait_for_completion_interruptible_timeout( timeout = wait_for_completion_killable_timeout(
&larval->completion, 60 * HZ); &larval->completion, 60 * HZ);
alg = larval->adult; alg = larval->adult;
@ -445,7 +445,7 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask)
err: err:
if (err != -EAGAIN) if (err != -EAGAIN)
break; break;
if (signal_pending(current)) { if (fatal_signal_pending(current)) {
err = -EINTR; err = -EINTR;
break; break;
} }
@ -562,7 +562,7 @@ void *crypto_alloc_tfm(const char *alg_name,
err: err:
if (err != -EAGAIN) if (err != -EAGAIN)
break; break;
if (signal_pending(current)) { if (fatal_signal_pending(current)) {
err = -EINTR; err = -EINTR;
break; break;
} }

View file

@ -375,7 +375,7 @@ static struct crypto_alg *crypto_user_skcipher_alg(const char *name, u32 type,
err = PTR_ERR(alg); err = PTR_ERR(alg);
if (err != -EAGAIN) if (err != -EAGAIN)
break; break;
if (signal_pending(current)) { if (fatal_signal_pending(current)) {
err = -EINTR; err = -EINTR;
break; break;
} }

View file

@ -187,7 +187,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
* global one. Requires architecture specific dev_get_cma_area() helper * global one. Requires architecture specific dev_get_cma_area() helper
* function. * function.
*/ */
struct page *dma_alloc_from_contiguous(struct device *dev, int count, struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
unsigned int align) unsigned int align)
{ {
if (align > CONFIG_CMA_ALIGNMENT) if (align > CONFIG_CMA_ALIGNMENT)

View file

@ -60,6 +60,7 @@ struct nbd_device {
bool disconnect; /* a disconnect has been requested by user */ bool disconnect; /* a disconnect has been requested by user */
struct timer_list timeout_timer; struct timer_list timeout_timer;
spinlock_t tasks_lock;
struct task_struct *task_recv; struct task_struct *task_recv;
struct task_struct *task_send; struct task_struct *task_send;
@ -140,21 +141,23 @@ static void sock_shutdown(struct nbd_device *nbd)
static void nbd_xmit_timeout(unsigned long arg) static void nbd_xmit_timeout(unsigned long arg)
{ {
struct nbd_device *nbd = (struct nbd_device *)arg; struct nbd_device *nbd = (struct nbd_device *)arg;
struct task_struct *task; unsigned long flags;
if (list_empty(&nbd->queue_head)) if (list_empty(&nbd->queue_head))
return; return;
nbd->disconnect = true; nbd->disconnect = true;
task = READ_ONCE(nbd->task_recv); spin_lock_irqsave(&nbd->tasks_lock, flags);
if (task)
force_sig(SIGKILL, task);
task = READ_ONCE(nbd->task_send); if (nbd->task_recv)
if (task) force_sig(SIGKILL, nbd->task_recv);
if (nbd->task_send)
force_sig(SIGKILL, nbd->task_send); force_sig(SIGKILL, nbd->task_send);
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
dev_err(nbd_to_dev(nbd), "Connection timed out, killed receiver and sender, shutting down connection\n"); dev_err(nbd_to_dev(nbd), "Connection timed out, killed receiver and sender, shutting down connection\n");
} }
@ -403,17 +406,24 @@ static int nbd_thread_recv(struct nbd_device *nbd)
{ {
struct request *req; struct request *req;
int ret; int ret;
unsigned long flags;
BUG_ON(nbd->magic != NBD_MAGIC); BUG_ON(nbd->magic != NBD_MAGIC);
sk_set_memalloc(nbd->sock->sk); sk_set_memalloc(nbd->sock->sk);
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_recv = current; nbd->task_recv = current;
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr); ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr);
if (ret) { if (ret) {
dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n"); dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n");
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_recv = NULL; nbd->task_recv = NULL;
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
return ret; return ret;
} }
@ -429,7 +439,9 @@ static int nbd_thread_recv(struct nbd_device *nbd)
device_remove_file(disk_to_dev(nbd->disk), &pid_attr); device_remove_file(disk_to_dev(nbd->disk), &pid_attr);
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_recv = NULL; nbd->task_recv = NULL;
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
if (signal_pending(current)) { if (signal_pending(current)) {
siginfo_t info; siginfo_t info;
@ -534,8 +546,11 @@ static int nbd_thread_send(void *data)
{ {
struct nbd_device *nbd = data; struct nbd_device *nbd = data;
struct request *req; struct request *req;
unsigned long flags;
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_send = current; nbd->task_send = current;
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
set_user_nice(current, MIN_NICE); set_user_nice(current, MIN_NICE);
while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) { while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {
@ -572,7 +587,15 @@ static int nbd_thread_send(void *data)
nbd_handle_req(nbd, req); nbd_handle_req(nbd, req);
} }
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_send = NULL; nbd->task_send = NULL;
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
/* Clear maybe pending signals */
if (signal_pending(current)) {
siginfo_t info;
dequeue_signal_lock(current, &current->blocked, &info);
}
return 0; return 0;
} }
@ -1052,6 +1075,7 @@ static int __init nbd_init(void)
nbd_dev[i].magic = NBD_MAGIC; nbd_dev[i].magic = NBD_MAGIC;
INIT_LIST_HEAD(&nbd_dev[i].waiting_queue); INIT_LIST_HEAD(&nbd_dev[i].waiting_queue);
spin_lock_init(&nbd_dev[i].queue_lock); spin_lock_init(&nbd_dev[i].queue_lock);
spin_lock_init(&nbd_dev[i].tasks_lock);
INIT_LIST_HEAD(&nbd_dev[i].queue_head); INIT_LIST_HEAD(&nbd_dev[i].queue_head);
mutex_init(&nbd_dev[i].tx_lock); mutex_init(&nbd_dev[i].tx_lock);
init_timer(&nbd_dev[i].timeout_timer); init_timer(&nbd_dev[i].timeout_timer);

View file

@ -603,27 +603,31 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx,
struct nvme_iod *iod = ctx; struct nvme_iod *iod = ctx;
struct request *req = iod_get_private(iod); struct request *req = iod_get_private(iod);
struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req); struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req);
u16 status = le16_to_cpup(&cqe->status) >> 1; u16 status = le16_to_cpup(&cqe->status) >> 1;
bool requeue = false;
int error = 0;
if (unlikely(status)) { if (unlikely(status)) {
if (!(status & NVME_SC_DNR || blk_noretry_request(req)) if (!(status & NVME_SC_DNR || blk_noretry_request(req))
&& (jiffies - req->start_time) < req->timeout) { && (jiffies - req->start_time) < req->timeout) {
unsigned long flags; unsigned long flags;
requeue = true;
blk_mq_requeue_request(req); blk_mq_requeue_request(req);
spin_lock_irqsave(req->q->queue_lock, flags); spin_lock_irqsave(req->q->queue_lock, flags);
if (!blk_queue_stopped(req->q)) if (!blk_queue_stopped(req->q))
blk_mq_kick_requeue_list(req->q); blk_mq_kick_requeue_list(req->q);
spin_unlock_irqrestore(req->q->queue_lock, flags); spin_unlock_irqrestore(req->q->queue_lock, flags);
return; goto release_iod;
} }
if (req->cmd_type == REQ_TYPE_DRV_PRIV) { if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
if (cmd_rq->ctx == CMD_CTX_CANCELLED) if (cmd_rq->ctx == CMD_CTX_CANCELLED)
status = -EINTR; error = -EINTR;
else
error = status;
} else { } else {
status = nvme_error_status(status); error = nvme_error_status(status);
} }
} }
@ -635,8 +639,9 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx,
if (cmd_rq->aborted) if (cmd_rq->aborted)
dev_warn(nvmeq->dev->dev, dev_warn(nvmeq->dev->dev,
"completing aborted command with status:%04x\n", "completing aborted command with status:%04x\n",
status); error);
release_iod:
if (iod->nents) { if (iod->nents) {
dma_unmap_sg(nvmeq->dev->dev, iod->sg, iod->nents, dma_unmap_sg(nvmeq->dev->dev, iod->sg, iod->nents,
rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
@ -649,7 +654,8 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx,
} }
nvme_free_iod(nvmeq->dev, iod); nvme_free_iod(nvmeq->dev, iod);
blk_mq_complete_request(req, status); if (likely(!requeue))
blk_mq_complete_request(req, error);
} }
/* length is in bytes. gfp flags indicates whether we may sleep. */ /* length is in bytes. gfp flags indicates whether we may sleep. */
@ -1804,7 +1810,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
length = (io.nblocks + 1) << ns->lba_shift; length = (io.nblocks + 1) << ns->lba_shift;
meta_len = (io.nblocks + 1) * ns->ms; meta_len = (io.nblocks + 1) * ns->ms;
metadata = (void __user *)(unsigned long)io.metadata; metadata = (void __user *)(uintptr_t)io.metadata;
write = io.opcode & 1; write = io.opcode & 1;
if (ns->ext) { if (ns->ext) {
@ -1844,7 +1850,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
c.rw.metadata = cpu_to_le64(meta_dma); c.rw.metadata = cpu_to_le64(meta_dma);
status = __nvme_submit_sync_cmd(ns->queue, &c, NULL, status = __nvme_submit_sync_cmd(ns->queue, &c, NULL,
(void __user *)io.addr, length, NULL, 0); (void __user *)(uintptr_t)io.addr, length, NULL, 0);
unmap: unmap:
if (meta) { if (meta) {
if (status == NVME_SC_SUCCESS && !write) { if (status == NVME_SC_SUCCESS && !write) {
@ -1886,7 +1892,7 @@ static int nvme_user_cmd(struct nvme_dev *dev, struct nvme_ns *ns,
timeout = msecs_to_jiffies(cmd.timeout_ms); timeout = msecs_to_jiffies(cmd.timeout_ms);
status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c, status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c,
NULL, (void __user *)cmd.addr, cmd.data_len, NULL, (void __user *)(uintptr_t)cmd.addr, cmd.data_len,
&cmd.result, timeout); &cmd.result, timeout);
if (status >= 0) { if (status >= 0) {
if (put_user(cmd.result, &ucmd->result)) if (put_user(cmd.result, &ucmd->result))

View file

@ -96,6 +96,8 @@ static int atomic_dec_return_safe(atomic_t *v)
#define RBD_MINORS_PER_MAJOR 256 #define RBD_MINORS_PER_MAJOR 256
#define RBD_SINGLE_MAJOR_PART_SHIFT 4 #define RBD_SINGLE_MAJOR_PART_SHIFT 4
#define RBD_MAX_PARENT_CHAIN_LEN 16
#define RBD_SNAP_DEV_NAME_PREFIX "snap_" #define RBD_SNAP_DEV_NAME_PREFIX "snap_"
#define RBD_MAX_SNAP_NAME_LEN \ #define RBD_MAX_SNAP_NAME_LEN \
(NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1)) (NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1))
@ -426,7 +428,7 @@ static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf,
size_t count); size_t count);
static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf, static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,
size_t count); size_t count);
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);
static void rbd_spec_put(struct rbd_spec *spec); static void rbd_spec_put(struct rbd_spec *spec);
static int rbd_dev_id_to_minor(int dev_id) static int rbd_dev_id_to_minor(int dev_id)
@ -3778,6 +3780,9 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE); blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE);
q->limits.discard_zeroes_data = 1; q->limits.discard_zeroes_data = 1;
if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))
q->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES;
disk->queue = q; disk->queue = q;
q->queuedata = rbd_dev; q->queuedata = rbd_dev;
@ -5131,44 +5136,51 @@ out_err:
return ret; return ret;
} }
static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) /*
* @depth is rbd_dev_image_probe() -> rbd_dev_probe_parent() ->
* rbd_dev_image_probe() recursion depth, which means it's also the
* length of the already discovered part of the parent chain.
*/
static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
{ {
struct rbd_device *parent = NULL; struct rbd_device *parent = NULL;
struct rbd_spec *parent_spec;
struct rbd_client *rbdc;
int ret; int ret;
if (!rbd_dev->parent_spec) if (!rbd_dev->parent_spec)
return 0; return 0;
/*
* We need to pass a reference to the client and the parent
* spec when creating the parent rbd_dev. Images related by
* parent/child relationships always share both.
*/
parent_spec = rbd_spec_get(rbd_dev->parent_spec);
rbdc = __rbd_get_client(rbd_dev->rbd_client);
ret = -ENOMEM; if (++depth > RBD_MAX_PARENT_CHAIN_LEN) {
parent = rbd_dev_create(rbdc, parent_spec, NULL); pr_info("parent chain is too long (%d)\n", depth);
if (!parent) ret = -EINVAL;
goto out_err; goto out_err;
ret = rbd_dev_image_probe(parent, false);
if (ret < 0)
goto out_err;
rbd_dev->parent = parent;
atomic_set(&rbd_dev->parent_ref, 1);
return 0;
out_err:
if (parent) {
rbd_dev_unparent(rbd_dev);
rbd_dev_destroy(parent);
} else {
rbd_put_client(rbdc);
rbd_spec_put(parent_spec);
} }
parent = rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec,
NULL);
if (!parent) {
ret = -ENOMEM;
goto out_err;
}
/*
* Images related by parent/child relationships always share
* rbd_client and spec/parent_spec, so bump their refcounts.
*/
__rbd_get_client(rbd_dev->rbd_client);
rbd_spec_get(rbd_dev->parent_spec);
ret = rbd_dev_image_probe(parent, depth);
if (ret < 0)
goto out_err;
rbd_dev->parent = parent;
atomic_set(&rbd_dev->parent_ref, 1);
return 0;
out_err:
rbd_dev_unparent(rbd_dev);
if (parent)
rbd_dev_destroy(parent);
return ret; return ret;
} }
@ -5286,7 +5298,7 @@ static void rbd_dev_image_release(struct rbd_device *rbd_dev)
* parent), initiate a watch on its header object before using that * parent), initiate a watch on its header object before using that
* object to get detailed information about the rbd image. * object to get detailed information about the rbd image.
*/ */
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
{ {
int ret; int ret;
@ -5304,7 +5316,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
if (ret) if (ret)
goto err_out_format; goto err_out_format;
if (mapping) { if (!depth) {
ret = rbd_dev_header_watch_sync(rbd_dev); ret = rbd_dev_header_watch_sync(rbd_dev);
if (ret) { if (ret) {
if (ret == -ENOENT) if (ret == -ENOENT)
@ -5325,7 +5337,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
* Otherwise this is a parent image, identified by pool, image * Otherwise this is a parent image, identified by pool, image
* and snap ids - need to fill in names for those ids. * and snap ids - need to fill in names for those ids.
*/ */
if (mapping) if (!depth)
ret = rbd_spec_fill_snap_id(rbd_dev); ret = rbd_spec_fill_snap_id(rbd_dev);
else else
ret = rbd_spec_fill_names(rbd_dev); ret = rbd_spec_fill_names(rbd_dev);
@ -5347,12 +5359,12 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
* Need to warn users if this image is the one being * Need to warn users if this image is the one being
* mapped and has a parent. * mapped and has a parent.
*/ */
if (mapping && rbd_dev->parent_spec) if (!depth && rbd_dev->parent_spec)
rbd_warn(rbd_dev, rbd_warn(rbd_dev,
"WARNING: kernel layering is EXPERIMENTAL!"); "WARNING: kernel layering is EXPERIMENTAL!");
} }
ret = rbd_dev_probe_parent(rbd_dev); ret = rbd_dev_probe_parent(rbd_dev, depth);
if (ret) if (ret)
goto err_out_probe; goto err_out_probe;
@ -5363,7 +5375,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
err_out_probe: err_out_probe:
rbd_dev_unprobe(rbd_dev); rbd_dev_unprobe(rbd_dev);
err_out_watch: err_out_watch:
if (mapping) if (!depth)
rbd_dev_header_unwatch_sync(rbd_dev); rbd_dev_header_unwatch_sync(rbd_dev);
out_header_name: out_header_name:
kfree(rbd_dev->header_name); kfree(rbd_dev->header_name);
@ -5426,7 +5438,7 @@ static ssize_t do_rbd_add(struct bus_type *bus,
spec = NULL; /* rbd_dev now owns this */ spec = NULL; /* rbd_dev now owns this */
rbd_opts = NULL; /* rbd_dev now owns this */ rbd_opts = NULL; /* rbd_dev now owns this */
rc = rbd_dev_image_probe(rbd_dev, true); rc = rbd_dev_image_probe(rbd_dev, 0);
if (rc < 0) if (rc < 0)
goto err_out_rbd_dev; goto err_out_rbd_dev;

View file

@ -1956,7 +1956,8 @@ static void blkback_changed(struct xenbus_device *dev,
break; break;
/* Missed the backend's Closing state -- fallthrough */ /* Missed the backend's Closing state -- fallthrough */
case XenbusStateClosing: case XenbusStateClosing:
blkfront_closing(info); if (info)
blkfront_closing(info);
break; break;
} }
} }

View file

@ -1184,11 +1184,12 @@ static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb,
if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu)) if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
break; break;
target = cpumask_any_but(cpu_online_mask, cpu); target = cpumask_any_but(cpu_online_mask, cpu);
if (target < 0) if (target >= nr_cpu_ids)
break; break;
perf_pmu_migrate_context(&dt->pmu, cpu, target); perf_pmu_migrate_context(&dt->pmu, cpu, target);
cpumask_set_cpu(target, &dt->cpu); cpumask_set_cpu(target, &dt->cpu);
WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0); if (ccn->irq)
WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0);
default: default:
break; break;
} }

View file

@ -333,7 +333,8 @@ int clk_add_alias(const char *alias, const char *alias_dev_name,
if (IS_ERR(r)) if (IS_ERR(r))
return PTR_ERR(r); return PTR_ERR(r);
l = clkdev_create(r, alias, "%s", alias_dev_name); l = clkdev_create(r, alias, alias_dev_name ? "%s" : NULL,
alias_dev_name);
clk_put(r); clk_put(r);
return l ? 0 : -ENODEV; return l ? 0 : -ENODEV;

View file

@ -1654,6 +1654,7 @@ struct amdgpu_pm {
u8 fan_max_rpm; u8 fan_max_rpm;
/* dpm */ /* dpm */
bool dpm_enabled; bool dpm_enabled;
bool sysfs_initialized;
struct amdgpu_dpm dpm; struct amdgpu_dpm dpm;
const struct firmware *fw; /* SMC firmware */ const struct firmware *fw; /* SMC firmware */
uint32_t fw_version; uint32_t fw_version;

View file

@ -184,10 +184,6 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
goto cleanup; goto cleanup;
} }
fence_get(work->excl);
for (i = 0; i < work->shared_count; ++i)
fence_get(work->shared[i]);
amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags); amdgpu_bo_get_tiling_flags(new_rbo, &tiling_flags);
amdgpu_bo_unreserve(new_rbo); amdgpu_bo_unreserve(new_rbo);

View file

@ -294,10 +294,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
struct amdgpu_device *adev = dev_get_drvdata(dev); struct amdgpu_device *adev = dev_get_drvdata(dev);
umode_t effective_mode = attr->mode; umode_t effective_mode = attr->mode;
/* Skip limit attributes if DPM is not enabled */ /* Skip attributes if DPM is not enabled */
if (!adev->pm.dpm_enabled && if (!adev->pm.dpm_enabled &&
(attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr)) attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))
return 0; return 0;
/* Skip fan attributes if fan is not present */ /* Skip fan attributes if fan is not present */
@ -691,6 +695,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
{ {
int ret; int ret;
if (adev->pm.sysfs_initialized)
return 0;
if (adev->pm.funcs->get_temperature == NULL) if (adev->pm.funcs->get_temperature == NULL)
return 0; return 0;
adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev, adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev,
@ -719,6 +726,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
return ret; return ret;
} }
adev->pm.sysfs_initialized = true;
return 0; return 0;
} }

View file

@ -2997,6 +2997,9 @@ static int kv_dpm_late_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
int ret; int ret;
if (!amdgpu_dpm)
return 0;
/* init the sysfs and debugfs files late */ /* init the sysfs and debugfs files late */
ret = amdgpu_pm_sysfs_init(adev); ret = amdgpu_pm_sysfs_init(adev);
if (ret) if (ret)

View file

@ -1194,17 +1194,18 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
list_for_each_entry(port, &mstb->ports, next) { list_for_each_entry(port, &mstb->ports, next) {
if (port->port_num == port_num) { if (port->port_num == port_num) {
if (!port->mstb) { mstb = port->mstb;
if (!mstb) {
DRM_ERROR("failed to lookup MSTB with lct %d, rad %02x\n", lct, rad[0]); DRM_ERROR("failed to lookup MSTB with lct %d, rad %02x\n", lct, rad[0]);
return NULL; goto out;
} }
mstb = port->mstb;
break; break;
} }
} }
} }
kref_get(&mstb->kref); kref_get(&mstb->kref);
out:
mutex_unlock(&mgr->lock); mutex_unlock(&mgr->lock);
return mstb; return mstb;
} }

View file

@ -143,7 +143,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
} }
/** /**
* i915_gem_shrink - Shrink buffer object caches completely * i915_gem_shrink_all - Shrink buffer object caches completely
* @dev_priv: i915 device * @dev_priv: i915 device
* *
* This is a simple wraper around i915_gem_shrink() to aggressively shrink all * This is a simple wraper around i915_gem_shrink() to aggressively shrink all

View file

@ -804,7 +804,10 @@ static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = {
* Also note, that the object created here is not currently a "first class" * Also note, that the object created here is not currently a "first class"
* object, in that several ioctls are banned. These are the CPU access * object, in that several ioctls are banned. These are the CPU access
* ioctls: mmap(), pwrite and pread. In practice, you are expected to use * ioctls: mmap(), pwrite and pread. In practice, you are expected to use
* direct access via your pointer rather than use those ioctls. * direct access via your pointer rather than use those ioctls. Another
* restriction is that we do not allow userptr surfaces to be pinned to the
* hardware and so we reject any attempt to create a framebuffer out of a
* userptr.
* *
* If you think this is a good interface to use to pass GPU memory between * If you think this is a good interface to use to pass GPU memory between
* drivers, please use dma-buf instead. In fact, wherever possible use * drivers, please use dma-buf instead. In fact, wherever possible use

View file

@ -1724,6 +1724,15 @@ static void i9xx_enable_pll(struct intel_crtc *crtc)
I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE); I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE);
} }
/*
* Apparently we need to have VGA mode enabled prior to changing
* the P1/P2 dividers. Otherwise the DPLL will keep using the old
* dividers, even though the register value does change.
*/
I915_WRITE(reg, 0);
I915_WRITE(reg, dpll);
/* Wait for the clocks to stabilize. */ /* Wait for the clocks to stabilize. */
POSTING_READ(reg); POSTING_READ(reg);
udelay(150); udelay(150);
@ -14107,6 +14116,11 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
struct drm_i915_gem_object *obj = intel_fb->obj; struct drm_i915_gem_object *obj = intel_fb->obj;
if (obj->userptr.mm) {
DRM_DEBUG("attempting to use a userptr for a framebuffer, denied\n");
return -EINVAL;
}
return drm_gem_handle_create(file, &obj->base, handle); return drm_gem_handle_create(file, &obj->base, handle);
} }
@ -14897,9 +14911,19 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
/* restore vblank interrupts to correct state */ /* restore vblank interrupts to correct state */
drm_crtc_vblank_reset(&crtc->base); drm_crtc_vblank_reset(&crtc->base);
if (crtc->active) { if (crtc->active) {
struct intel_plane *plane;
drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode); drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
update_scanline_offset(crtc); update_scanline_offset(crtc);
drm_crtc_vblank_on(&crtc->base); drm_crtc_vblank_on(&crtc->base);
/* Disable everything but the primary plane */
for_each_intel_plane_on_crtc(dev, crtc, plane) {
if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)
continue;
plane->disable_plane(&plane->base, &crtc->base);
}
} }
/* We need to sanitize the plane -> pipe mapping first because this will /* We need to sanitize the plane -> pipe mapping first because this will
@ -15067,38 +15091,25 @@ void i915_redisable_vga(struct drm_device *dev)
i915_redisable_vga_power_on(dev); i915_redisable_vga_power_on(dev);
} }
static bool primary_get_hw_state(struct intel_crtc *crtc) static bool primary_get_hw_state(struct intel_plane *plane)
{ {
struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
return !!(I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE); return I915_READ(DSPCNTR(plane->plane)) & DISPLAY_PLANE_ENABLE;
} }
static void readout_plane_state(struct intel_crtc *crtc, /* FIXME read out full plane state for all planes */
struct intel_crtc_state *crtc_state) static void readout_plane_state(struct intel_crtc *crtc)
{ {
struct intel_plane *p; struct drm_plane *primary = crtc->base.primary;
struct intel_plane_state *plane_state; struct intel_plane_state *plane_state =
bool active = crtc_state->base.active; to_intel_plane_state(primary->state);
for_each_intel_plane(crtc->base.dev, p) { plane_state->visible =
if (crtc->pipe != p->pipe) primary_get_hw_state(to_intel_plane(primary));
continue;
plane_state = to_intel_plane_state(p->base.state); if (plane_state->visible)
crtc->base.state->plane_mask |= 1 << drm_plane_index(primary);
if (p->base.type == DRM_PLANE_TYPE_PRIMARY) {
plane_state->visible = primary_get_hw_state(crtc);
if (plane_state->visible)
crtc->base.state->plane_mask |=
1 << drm_plane_index(&p->base);
} else {
if (active)
p->disable_plane(&p->base, &crtc->base);
plane_state->visible = false;
}
}
} }
static void intel_modeset_readout_hw_state(struct drm_device *dev) static void intel_modeset_readout_hw_state(struct drm_device *dev)
@ -15121,34 +15132,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
crtc->base.state->active = crtc->active; crtc->base.state->active = crtc->active;
crtc->base.enabled = crtc->active; crtc->base.enabled = crtc->active;
memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); readout_plane_state(crtc);
if (crtc->base.state->active) {
intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
/*
* The initial mode needs to be set in order to keep
* the atomic core happy. It wants a valid mode if the
* crtc's enabled, so we do the above call.
*
* At this point some state updated by the connectors
* in their ->detect() callback has not run yet, so
* no recalculation can be done yet.
*
* Even if we could do a recalculation and modeset
* right now it would cause a double modeset if
* fbdev or userspace chooses a different initial mode.
*
* If that happens, someone indicated they wanted a
* mode change, which means it's safe to do a full
* recalculation.
*/
crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
}
crtc->base.hwmode = crtc->config->base.adjusted_mode;
readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state));
DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n", DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",
crtc->base.base.id, crtc->base.base.id,
@ -15207,6 +15191,36 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
connector->base.name, connector->base.name,
connector->base.encoder ? "enabled" : "disabled"); connector->base.encoder ? "enabled" : "disabled");
} }
for_each_intel_crtc(dev, crtc) {
crtc->base.hwmode = crtc->config->base.adjusted_mode;
memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
if (crtc->base.state->active) {
intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
/*
* The initial mode needs to be set in order to keep
* the atomic core happy. It wants a valid mode if the
* crtc's enabled, so we do the above call.
*
* At this point some state updated by the connectors
* in their ->detect() callback has not run yet, so
* no recalculation can be done yet.
*
* Even if we could do a recalculation and modeset
* right now it would cause a double modeset if
* fbdev or userspace chooses a different initial mode.
*
* If that happens, someone indicated they wanted a
* mode change, which means it's safe to do a full
* recalculation.
*/
crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
}
}
} }
/* Scan out the current hw modeset state, /* Scan out the current hw modeset state,

View file

@ -1659,6 +1659,7 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request,
if (flush_domains) { if (flush_domains) {
flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
flags |= PIPE_CONTROL_FLUSH_ENABLE;
} }
if (invalidate_domains) { if (invalidate_domains) {

View file

@ -347,6 +347,7 @@ gen7_render_ring_flush(struct drm_i915_gem_request *req,
if (flush_domains) { if (flush_domains) {
flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
flags |= PIPE_CONTROL_FLUSH_ENABLE;
} }
if (invalidate_domains) { if (invalidate_domains) {
flags |= PIPE_CONTROL_TLB_INVALIDATE; flags |= PIPE_CONTROL_TLB_INVALIDATE;
@ -418,6 +419,7 @@ gen8_render_ring_flush(struct drm_i915_gem_request *req,
if (flush_domains) { if (flush_domains) {
flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
flags |= PIPE_CONTROL_FLUSH_ENABLE;
} }
if (invalidate_domains) { if (invalidate_domains) {
flags |= PIPE_CONTROL_TLB_INVALIDATE; flags |= PIPE_CONTROL_TLB_INVALIDATE;

View file

@ -227,11 +227,12 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem,
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nvkm_vma *vma; struct nvkm_vma *vma;
if (nvbo->bo.mem.mem_type == TTM_PL_TT) if (is_power_of_2(nvbo->valid_domains))
rep->domain = nvbo->valid_domains;
else if (nvbo->bo.mem.mem_type == TTM_PL_TT)
rep->domain = NOUVEAU_GEM_DOMAIN_GART; rep->domain = NOUVEAU_GEM_DOMAIN_GART;
else else
rep->domain = NOUVEAU_GEM_DOMAIN_VRAM; rep->domain = NOUVEAU_GEM_DOMAIN_VRAM;
rep->offset = nvbo->bo.offset; rep->offset = nvbo->bo.offset;
if (cli->vm) { if (cli->vm) {
vma = nouveau_bo_vma_find(nvbo, cli->vm); vma = nouveau_bo_vma_find(nvbo, cli->vm);

View file

@ -1658,6 +1658,7 @@ struct radeon_pm {
u8 fan_max_rpm; u8 fan_max_rpm;
/* dpm */ /* dpm */
bool dpm_enabled; bool dpm_enabled;
bool sysfs_initialized;
struct radeon_dpm dpm; struct radeon_dpm dpm;
}; };

View file

@ -717,10 +717,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
struct radeon_device *rdev = dev_get_drvdata(dev); struct radeon_device *rdev = dev_get_drvdata(dev);
umode_t effective_mode = attr->mode; umode_t effective_mode = attr->mode;
/* Skip limit attributes if DPM is not enabled */ /* Skip attributes if DPM is not enabled */
if (rdev->pm.pm_method != PM_METHOD_DPM && if (rdev->pm.pm_method != PM_METHOD_DPM &&
(attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr)) attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))
return 0; return 0;
/* Skip fan attributes if fan is not present */ /* Skip fan attributes if fan is not present */
@ -1524,19 +1528,23 @@ int radeon_pm_late_init(struct radeon_device *rdev)
if (rdev->pm.pm_method == PM_METHOD_DPM) { if (rdev->pm.pm_method == PM_METHOD_DPM) {
if (rdev->pm.dpm_enabled) { if (rdev->pm.dpm_enabled) {
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state); if (!rdev->pm.sysfs_initialized) {
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
DRM_ERROR("failed to create device file for dpm state\n"); if (ret)
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level); DRM_ERROR("failed to create device file for dpm state\n");
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
DRM_ERROR("failed to create device file for dpm state\n"); if (ret)
/* XXX: these are noops for dpm but are here for backwards compat */ DRM_ERROR("failed to create device file for dpm state\n");
ret = device_create_file(rdev->dev, &dev_attr_power_profile); /* XXX: these are noops for dpm but are here for backwards compat */
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_profile);
DRM_ERROR("failed to create device file for power profile\n"); if (ret)
ret = device_create_file(rdev->dev, &dev_attr_power_method); DRM_ERROR("failed to create device file for power profile\n");
if (ret) ret = device_create_file(rdev->dev, &dev_attr_power_method);
DRM_ERROR("failed to create device file for power method\n"); if (ret)
DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
}
mutex_lock(&rdev->pm.mutex); mutex_lock(&rdev->pm.mutex);
ret = radeon_dpm_late_enable(rdev); ret = radeon_dpm_late_enable(rdev);
@ -1552,7 +1560,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
} }
} }
} else { } else {
if (rdev->pm.num_power_states > 1) { if ((rdev->pm.num_power_states > 1) &&
(!rdev->pm.sysfs_initialized)) {
/* where's the best place to put these? */ /* where's the best place to put these? */
ret = device_create_file(rdev->dev, &dev_attr_power_profile); ret = device_create_file(rdev->dev, &dev_attr_power_profile);
if (ret) if (ret)
@ -1560,6 +1569,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
ret = device_create_file(rdev->dev, &dev_attr_power_method); ret = device_create_file(rdev->dev, &dev_attr_power_method);
if (ret) if (ret)
DRM_ERROR("failed to create device file for power method\n"); DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
} }
} }
return ret; return ret;

View file

@ -415,16 +415,16 @@ static void vmw_cmdbuf_ctx_process(struct vmw_cmdbuf_man *man,
* *
* Calls vmw_cmdbuf_ctx_process() on all contexts. If any context has * Calls vmw_cmdbuf_ctx_process() on all contexts. If any context has
* command buffers left that are not submitted to hardware, Make sure * command buffers left that are not submitted to hardware, Make sure
* IRQ handling is turned on. Otherwise, make sure it's turned off. This * IRQ handling is turned on. Otherwise, make sure it's turned off.
* function may return -EAGAIN to indicate it should be rerun due to
* possibly missed IRQs if IRQs has just been turned on.
*/ */
static int vmw_cmdbuf_man_process(struct vmw_cmdbuf_man *man) static void vmw_cmdbuf_man_process(struct vmw_cmdbuf_man *man)
{ {
int notempty = 0; int notempty;
struct vmw_cmdbuf_context *ctx; struct vmw_cmdbuf_context *ctx;
int i; int i;
retry:
notempty = 0;
for_each_cmdbuf_ctx(man, i, ctx) for_each_cmdbuf_ctx(man, i, ctx)
vmw_cmdbuf_ctx_process(man, ctx, &notempty); vmw_cmdbuf_ctx_process(man, ctx, &notempty);
@ -440,10 +440,8 @@ static int vmw_cmdbuf_man_process(struct vmw_cmdbuf_man *man)
man->irq_on = true; man->irq_on = true;
/* Rerun in case we just missed an irq. */ /* Rerun in case we just missed an irq. */
return -EAGAIN; goto retry;
} }
return 0;
} }
/** /**
@ -468,8 +466,7 @@ static void vmw_cmdbuf_ctx_add(struct vmw_cmdbuf_man *man,
header->cb_context = cb_context; header->cb_context = cb_context;
list_add_tail(&header->list, &man->ctx[cb_context].submitted); list_add_tail(&header->list, &man->ctx[cb_context].submitted);
if (vmw_cmdbuf_man_process(man) == -EAGAIN) vmw_cmdbuf_man_process(man);
vmw_cmdbuf_man_process(man);
} }
/** /**
@ -488,8 +485,7 @@ static void vmw_cmdbuf_man_tasklet(unsigned long data)
struct vmw_cmdbuf_man *man = (struct vmw_cmdbuf_man *) data; struct vmw_cmdbuf_man *man = (struct vmw_cmdbuf_man *) data;
spin_lock(&man->lock); spin_lock(&man->lock);
if (vmw_cmdbuf_man_process(man) == -EAGAIN) vmw_cmdbuf_man_process(man);
(void) vmw_cmdbuf_man_process(man);
spin_unlock(&man->lock); spin_unlock(&man->lock);
} }
@ -507,6 +503,7 @@ static void vmw_cmdbuf_work_func(struct work_struct *work)
struct vmw_cmdbuf_man *man = struct vmw_cmdbuf_man *man =
container_of(work, struct vmw_cmdbuf_man, work); container_of(work, struct vmw_cmdbuf_man, work);
struct vmw_cmdbuf_header *entry, *next; struct vmw_cmdbuf_header *entry, *next;
uint32_t dummy;
bool restart = false; bool restart = false;
spin_lock_bh(&man->lock); spin_lock_bh(&man->lock);
@ -523,6 +520,8 @@ static void vmw_cmdbuf_work_func(struct work_struct *work)
if (restart && vmw_cmdbuf_startstop(man, true)) if (restart && vmw_cmdbuf_startstop(man, true))
DRM_ERROR("Failed restarting command buffer context 0.\n"); DRM_ERROR("Failed restarting command buffer context 0.\n");
/* Send a new fence in case one was removed */
vmw_fifo_send_fence(man->dev_priv, &dummy);
} }
/** /**
@ -682,7 +681,7 @@ static bool vmw_cmdbuf_try_alloc(struct vmw_cmdbuf_man *man,
DRM_MM_SEARCH_DEFAULT, DRM_MM_SEARCH_DEFAULT,
DRM_MM_CREATE_DEFAULT); DRM_MM_CREATE_DEFAULT);
if (ret) { if (ret) {
(void) vmw_cmdbuf_man_process(man); vmw_cmdbuf_man_process(man);
ret = drm_mm_insert_node_generic(&man->mm, info->node, ret = drm_mm_insert_node_generic(&man->mm, info->node,
info->page_size, 0, 0, info->page_size, 0, 0,
DRM_MM_SEARCH_DEFAULT, DRM_MM_SEARCH_DEFAULT,
@ -1168,7 +1167,14 @@ int vmw_cmdbuf_set_pool_size(struct vmw_cmdbuf_man *man,
drm_mm_init(&man->mm, 0, size >> PAGE_SHIFT); drm_mm_init(&man->mm, 0, size >> PAGE_SHIFT);
man->has_pool = true; man->has_pool = true;
man->default_size = default_size;
/*
* For now, set the default size to VMW_CMDBUF_INLINE_SIZE to
* prevent deadlocks from happening when vmw_cmdbuf_space_pool()
* needs to wait for space and we block on further command
* submissions to be able to free up space.
*/
man->default_size = VMW_CMDBUF_INLINE_SIZE;
DRM_INFO("Using command buffers with %s pool.\n", DRM_INFO("Using command buffers with %s pool.\n",
(man->using_mob) ? "MOB" : "DMA"); (man->using_mob) ? "MOB" : "DMA");

View file

@ -669,8 +669,6 @@ mv64xxx_i2c_can_offload(struct mv64xxx_i2c_data *drv_data)
struct i2c_msg *msgs = drv_data->msgs; struct i2c_msg *msgs = drv_data->msgs;
int num = drv_data->num_msgs; int num = drv_data->num_msgs;
return false;
if (!drv_data->offload_enabled) if (!drv_data->offload_enabled)
return false; return false;

View file

@ -600,7 +600,7 @@ static int i2c_pnx_controller_suspend(struct device *dev)
{ {
struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev); struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev);
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return 0; return 0;
} }
@ -609,7 +609,7 @@ static int i2c_pnx_controller_resume(struct device *dev)
{ {
struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev); struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev);
return clk_enable(alg_data->clk); return clk_prepare_enable(alg_data->clk);
} }
static SIMPLE_DEV_PM_OPS(i2c_pnx_pm, static SIMPLE_DEV_PM_OPS(i2c_pnx_pm,
@ -672,7 +672,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
if (IS_ERR(alg_data->ioaddr)) if (IS_ERR(alg_data->ioaddr))
return PTR_ERR(alg_data->ioaddr); return PTR_ERR(alg_data->ioaddr);
ret = clk_enable(alg_data->clk); ret = clk_prepare_enable(alg_data->clk);
if (ret) if (ret)
return ret; return ret;
@ -726,7 +726,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
return 0; return 0;
out_clock: out_clock:
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return ret; return ret;
} }
@ -735,7 +735,7 @@ static int i2c_pnx_remove(struct platform_device *pdev)
struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev); struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev);
i2c_del_adapter(&alg_data->adapter); i2c_del_adapter(&alg_data->adapter);
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return 0; return 0;
} }

View file

@ -149,8 +149,6 @@
#define ST_ACCEL_4_BDU_MASK 0x40 #define ST_ACCEL_4_BDU_MASK 0x40
#define ST_ACCEL_4_DRDY_IRQ_ADDR 0x21 #define ST_ACCEL_4_DRDY_IRQ_ADDR 0x21
#define ST_ACCEL_4_DRDY_IRQ_INT1_MASK 0x04 #define ST_ACCEL_4_DRDY_IRQ_INT1_MASK 0x04
#define ST_ACCEL_4_IG1_EN_ADDR 0x21
#define ST_ACCEL_4_IG1_EN_MASK 0x08
#define ST_ACCEL_4_MULTIREAD_BIT true #define ST_ACCEL_4_MULTIREAD_BIT true
/* CUSTOM VALUES FOR SENSOR 5 */ /* CUSTOM VALUES FOR SENSOR 5 */
@ -489,10 +487,6 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
.drdy_irq = { .drdy_irq = {
.addr = ST_ACCEL_4_DRDY_IRQ_ADDR, .addr = ST_ACCEL_4_DRDY_IRQ_ADDR,
.mask_int1 = ST_ACCEL_4_DRDY_IRQ_INT1_MASK, .mask_int1 = ST_ACCEL_4_DRDY_IRQ_INT1_MASK,
.ig1 = {
.en_addr = ST_ACCEL_4_IG1_EN_ADDR,
.en_mask = ST_ACCEL_4_IG1_EN_MASK,
},
}, },
.multi_read_bit = ST_ACCEL_4_MULTIREAD_BIT, .multi_read_bit = ST_ACCEL_4_MULTIREAD_BIT,
.bootime = 2, /* guess */ .bootime = 2, /* guess */

View file

@ -45,13 +45,18 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#define TWL4030_USB_SEL_MADC_MCPC (1<<3)
#define TWL4030_USB_CARKIT_ANA_CTRL 0xBB
/** /**
* struct twl4030_madc_data - a container for madc info * struct twl4030_madc_data - a container for madc info
* @dev: Pointer to device structure for madc * @dev: Pointer to device structure for madc
* @lock: Mutex protecting this data structure * @lock: Mutex protecting this data structure
* @regulator: Pointer to bias regulator for madc
* @requests: Array of request struct corresponding to SW1, SW2 and RT * @requests: Array of request struct corresponding to SW1, SW2 and RT
* @use_second_irq: IRQ selection (main or co-processor) * @use_second_irq: IRQ selection (main or co-processor)
* @imr: Interrupt mask register of MADC * @imr: Interrupt mask register of MADC
@ -60,6 +65,7 @@
struct twl4030_madc_data { struct twl4030_madc_data {
struct device *dev; struct device *dev;
struct mutex lock; /* mutex protecting this data structure */ struct mutex lock; /* mutex protecting this data structure */
struct regulator *usb3v1;
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS]; struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq; bool use_second_irq;
u8 imr; u8 imr;
@ -841,6 +847,32 @@ static int twl4030_madc_probe(struct platform_device *pdev)
} }
twl4030_madc = madc; twl4030_madc = madc;
/* Configure MADC[3:6] */
ret = twl_i2c_read_u8(TWL_MODULE_USB, &regval,
TWL4030_USB_CARKIT_ANA_CTRL);
if (ret) {
dev_err(&pdev->dev, "unable to read reg CARKIT_ANA_CTRL 0x%X\n",
TWL4030_USB_CARKIT_ANA_CTRL);
goto err_i2c;
}
regval |= TWL4030_USB_SEL_MADC_MCPC;
ret = twl_i2c_write_u8(TWL_MODULE_USB, regval,
TWL4030_USB_CARKIT_ANA_CTRL);
if (ret) {
dev_err(&pdev->dev, "unable to write reg CARKIT_ANA_CTRL 0x%X\n",
TWL4030_USB_CARKIT_ANA_CTRL);
goto err_i2c;
}
/* Enable 3v1 bias regulator for MADC[3:6] */
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
if (IS_ERR(madc->usb3v1))
return -ENODEV;
ret = regulator_enable(madc->usb3v1);
if (ret)
dev_err(madc->dev, "could not enable 3v1 bias regulator\n");
ret = iio_device_register(iio_dev); ret = iio_device_register(iio_dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "could not register iio device\n"); dev_err(&pdev->dev, "could not register iio device\n");
@ -866,6 +898,8 @@ static int twl4030_madc_remove(struct platform_device *pdev)
twl4030_madc_set_current_generator(madc, 0, 0); twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0); twl4030_madc_set_power(madc, 0);
regulator_disable(madc->usb3v1);
return 0; return 0;
} }

View file

@ -508,12 +508,12 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port,
memset(&gid_attr, 0, sizeof(gid_attr)); memset(&gid_attr, 0, sizeof(gid_attr));
gid_attr.ndev = ndev; gid_attr.ndev = ndev;
mutex_lock(&table->lock);
ix = find_gid(table, NULL, NULL, true, GID_ATTR_FIND_MASK_DEFAULT); ix = find_gid(table, NULL, NULL, true, GID_ATTR_FIND_MASK_DEFAULT);
/* Coudn't find default GID location */ /* Coudn't find default GID location */
WARN_ON(ix < 0); WARN_ON(ix < 0);
mutex_lock(&table->lock);
if (!__ib_cache_gid_get(ib_dev, port, ix, if (!__ib_cache_gid_get(ib_dev, port, ix,
&current_gid, &current_gid_attr) && &current_gid, &current_gid_attr) &&
mode == IB_CACHE_GID_DEFAULT_MODE_SET && mode == IB_CACHE_GID_DEFAULT_MODE_SET &&

View file

@ -835,6 +835,11 @@ retest:
case IB_CM_SIDR_REQ_RCVD: case IB_CM_SIDR_REQ_RCVD:
spin_unlock_irq(&cm_id_priv->lock); spin_unlock_irq(&cm_id_priv->lock);
cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
spin_lock_irq(&cm.lock);
if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node))
rb_erase(&cm_id_priv->sidr_id_node,
&cm.remote_sidr_table);
spin_unlock_irq(&cm.lock);
break; break;
case IB_CM_REQ_SENT: case IB_CM_REQ_SENT:
case IB_CM_MRA_REQ_RCVD: case IB_CM_MRA_REQ_RCVD:
@ -3172,7 +3177,10 @@ int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id,
spin_unlock_irqrestore(&cm_id_priv->lock, flags); spin_unlock_irqrestore(&cm_id_priv->lock, flags);
spin_lock_irqsave(&cm.lock, flags); spin_lock_irqsave(&cm.lock, flags);
rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table); if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) {
rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
RB_CLEAR_NODE(&cm_id_priv->sidr_id_node);
}
spin_unlock_irqrestore(&cm.lock, flags); spin_unlock_irqrestore(&cm.lock, flags);
return 0; return 0;

View file

@ -1067,14 +1067,14 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event,
sizeof(req->local_gid)); sizeof(req->local_gid));
req->has_gid = true; req->has_gid = true;
req->service_id = req_param->primary_path->service_id; req->service_id = req_param->primary_path->service_id;
req->pkey = req_param->bth_pkey; req->pkey = be16_to_cpu(req_param->primary_path->pkey);
break; break;
case IB_CM_SIDR_REQ_RECEIVED: case IB_CM_SIDR_REQ_RECEIVED:
req->device = sidr_param->listen_id->device; req->device = sidr_param->listen_id->device;
req->port = sidr_param->port; req->port = sidr_param->port;
req->has_gid = false; req->has_gid = false;
req->service_id = sidr_param->service_id; req->service_id = sidr_param->service_id;
req->pkey = sidr_param->bth_pkey; req->pkey = sidr_param->pkey;
break; break;
default: default:
return -EINVAL; return -EINVAL;
@ -1324,7 +1324,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id), bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id),
cma_port_from_service_id(req.service_id)); cma_port_from_service_id(req.service_id));
id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
if (IS_ERR(id_priv)) { if (IS_ERR(id_priv) && *net_dev) {
dev_put(*net_dev); dev_put(*net_dev);
*net_dev = NULL; *net_dev = NULL;
} }

View file

@ -250,25 +250,44 @@ static void enum_netdev_ipv4_ips(struct ib_device *ib_dev,
u8 port, struct net_device *ndev) u8 port, struct net_device *ndev)
{ {
struct in_device *in_dev; struct in_device *in_dev;
struct sin_list {
struct list_head list;
struct sockaddr_in ip;
};
struct sin_list *sin_iter;
struct sin_list *sin_temp;
LIST_HEAD(sin_list);
if (ndev->reg_state >= NETREG_UNREGISTERING) if (ndev->reg_state >= NETREG_UNREGISTERING)
return; return;
in_dev = in_dev_get(ndev); rcu_read_lock();
if (!in_dev) in_dev = __in_dev_get_rcu(ndev);
if (!in_dev) {
rcu_read_unlock();
return; return;
}
for_ifa(in_dev) { for_ifa(in_dev) {
struct sockaddr_in ip; struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
ip.sin_family = AF_INET; if (!entry) {
ip.sin_addr.s_addr = ifa->ifa_address; pr_warn("roce_gid_mgmt: couldn't allocate entry for IPv4 update\n");
update_gid_ip(GID_ADD, ib_dev, port, ndev, continue;
(struct sockaddr *)&ip); }
entry->ip.sin_family = AF_INET;
entry->ip.sin_addr.s_addr = ifa->ifa_address;
list_add_tail(&entry->list, &sin_list);
} }
endfor_ifa(in_dev); endfor_ifa(in_dev);
rcu_read_unlock();
in_dev_put(in_dev); list_for_each_entry_safe(sin_iter, sin_temp, &sin_list, list) {
update_gid_ip(GID_ADD, ib_dev, port, ndev,
(struct sockaddr *)&sin_iter->ip);
list_del(&sin_iter->list);
kfree(sin_iter);
}
} }
static void enum_netdev_ipv6_ips(struct ib_device *ib_dev, static void enum_netdev_ipv6_ips(struct ib_device *ib_dev,

View file

@ -1624,11 +1624,16 @@ static int ucma_open(struct inode *inode, struct file *filp)
if (!file) if (!file)
return -ENOMEM; return -ENOMEM;
file->close_wq = create_singlethread_workqueue("ucma_close_id");
if (!file->close_wq) {
kfree(file);
return -ENOMEM;
}
INIT_LIST_HEAD(&file->event_list); INIT_LIST_HEAD(&file->event_list);
INIT_LIST_HEAD(&file->ctx_list); INIT_LIST_HEAD(&file->ctx_list);
init_waitqueue_head(&file->poll_wait); init_waitqueue_head(&file->poll_wait);
mutex_init(&file->mut); mutex_init(&file->mut);
file->close_wq = create_singlethread_workqueue("ucma_close_id");
filp->private_data = file; filp->private_data = file;
file->filp = filp; file->filp = filp;

View file

@ -100,7 +100,7 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
#define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */ #define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */
#define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with #define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
6-byte ALPS packet */ 6-byte ALPS packet */
#define ALPS_DELL 0x100 /* device is a Dell laptop */ #define ALPS_STICK_BITS 0x100 /* separate stick button bits */
#define ALPS_BUTTONPAD 0x200 /* device is a clickpad */ #define ALPS_BUTTONPAD 0x200 /* device is a clickpad */
static const struct alps_model_info alps_model_data[] = { static const struct alps_model_info alps_model_data[] = {
@ -159,6 +159,43 @@ static const struct alps_protocol_info alps_v8_protocol_data = {
ALPS_PROTO_V8, 0x18, 0x18, 0 ALPS_PROTO_V8, 0x18, 0x18, 0
}; };
/*
* Some v2 models report the stick buttons in separate bits
*/
static const struct dmi_system_id alps_dmi_has_separate_stick_buttons[] = {
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
{
/* Extrapolated from other entries */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D420"),
},
},
{
/* Reported-by: Hans de Bruin <jmdebruin@xmsnet.nl> */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D430"),
},
},
{
/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D620"),
},
},
{
/* Extrapolated from other entries */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D630"),
},
},
#endif
{ }
};
static void alps_set_abs_params_st(struct alps_data *priv, static void alps_set_abs_params_st(struct alps_data *priv,
struct input_dev *dev1); struct input_dev *dev1);
static void alps_set_abs_params_semi_mt(struct alps_data *priv, static void alps_set_abs_params_semi_mt(struct alps_data *priv,
@ -253,9 +290,8 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
return; return;
} }
/* Dell non interleaved V2 dualpoint has separate stick button bits */ /* Some models have separate stick button bits */
if (priv->proto_version == ALPS_PROTO_V2 && if (priv->flags & ALPS_STICK_BITS) {
priv->flags == (ALPS_DELL | ALPS_PASS | ALPS_DUALPOINT)) {
left |= packet[0] & 1; left |= packet[0] & 1;
right |= packet[0] & 2; right |= packet[0] & 2;
middle |= packet[0] & 4; middle |= packet[0] & 4;
@ -2552,8 +2588,6 @@ static int alps_set_protocol(struct psmouse *psmouse,
priv->byte0 = protocol->byte0; priv->byte0 = protocol->byte0;
priv->mask0 = protocol->mask0; priv->mask0 = protocol->mask0;
priv->flags = protocol->flags; priv->flags = protocol->flags;
if (dmi_name_in_vendors("Dell"))
priv->flags |= ALPS_DELL;
priv->x_max = 2000; priv->x_max = 2000;
priv->y_max = 1400; priv->y_max = 1400;
@ -2568,6 +2602,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
priv->set_abs_params = alps_set_abs_params_st; priv->set_abs_params = alps_set_abs_params_st;
priv->x_max = 1023; priv->x_max = 1023;
priv->y_max = 767; priv->y_max = 767;
if (dmi_check_system(alps_dmi_has_separate_stick_buttons))
priv->flags |= ALPS_STICK_BITS;
break; break;
case ALPS_PROTO_V3: case ALPS_PROTO_V3:

View file

@ -1006,6 +1006,7 @@ config TOUCHSCREEN_SUN4I
config TOUCHSCREEN_SUR40 config TOUCHSCREEN_SUR40
tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen" tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen"
depends on USB && MEDIA_USB_SUPPORT && HAS_DMA depends on USB && MEDIA_USB_SUPPORT && HAS_DMA
depends on VIDEO_V4L2
select INPUT_POLLDEV select INPUT_POLLDEV
select VIDEOBUF2_DMA_SG select VIDEOBUF2_DMA_SG
help help

View file

@ -139,14 +139,14 @@ static void lpc32xx_stop_tsc(struct lpc32xx_tsc *tsc)
tsc_readl(tsc, LPC32XX_TSC_CON) & tsc_readl(tsc, LPC32XX_TSC_CON) &
~LPC32XX_TSC_ADCCON_AUTO_EN); ~LPC32XX_TSC_ADCCON_AUTO_EN);
clk_disable(tsc->clk); clk_disable_unprepare(tsc->clk);
} }
static void lpc32xx_setup_tsc(struct lpc32xx_tsc *tsc) static void lpc32xx_setup_tsc(struct lpc32xx_tsc *tsc)
{ {
u32 tmp; u32 tmp;
clk_enable(tsc->clk); clk_prepare_enable(tsc->clk);
tmp = tsc_readl(tsc, LPC32XX_TSC_CON) & ~LPC32XX_TSC_ADCCON_POWER_UP; tmp = tsc_readl(tsc, LPC32XX_TSC_CON) & ~LPC32XX_TSC_ADCCON_POWER_UP;

View file

@ -1974,8 +1974,8 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain, bool ats)
static void clear_dte_entry(u16 devid) static void clear_dte_entry(u16 devid)
{ {
/* remove entry from the device table seen by the hardware */ /* remove entry from the device table seen by the hardware */
amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV; amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
amd_iommu_dev_table[devid].data[1] = 0; amd_iommu_dev_table[devid].data[1] &= DTE_FLAG_MASK;
amd_iommu_apply_erratum_63(devid); amd_iommu_apply_erratum_63(devid);
} }

View file

@ -295,6 +295,7 @@
#define IOMMU_PTE_IR (1ULL << 61) #define IOMMU_PTE_IR (1ULL << 61)
#define IOMMU_PTE_IW (1ULL << 62) #define IOMMU_PTE_IW (1ULL << 62)
#define DTE_FLAG_MASK (0x3ffULL << 32)
#define DTE_FLAG_IOTLB (0x01UL << 32) #define DTE_FLAG_IOTLB (0x01UL << 32)
#define DTE_FLAG_GV (0x01ULL << 55) #define DTE_FLAG_GV (0x01ULL << 55)
#define DTE_GLX_SHIFT (56) #define DTE_GLX_SHIFT (56)

View file

@ -516,6 +516,13 @@ static void do_fault(struct work_struct *work)
goto out; goto out;
} }
if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))) {
/* handle_mm_fault would BUG_ON() */
up_read(&mm->mmap_sem);
handle_fault_error(fault);
goto out;
}
ret = handle_mm_fault(mm, vma, address, write); ret = handle_mm_fault(mm, vma, address, write);
if (ret & VM_FAULT_ERROR) { if (ret & VM_FAULT_ERROR) {
/* failed to service fault */ /* failed to service fault */

View file

@ -2115,15 +2115,19 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
return -ENOMEM; return -ENOMEM;
/* It is large page*/ /* It is large page*/
if (largepage_lvl > 1) { if (largepage_lvl > 1) {
unsigned long nr_superpages, end_pfn;
pteval |= DMA_PTE_LARGE_PAGE; pteval |= DMA_PTE_LARGE_PAGE;
lvl_pages = lvl_to_nr_pages(largepage_lvl); lvl_pages = lvl_to_nr_pages(largepage_lvl);
nr_superpages = sg_res / lvl_pages;
end_pfn = iov_pfn + nr_superpages * lvl_pages - 1;
/* /*
* Ensure that old small page tables are * Ensure that old small page tables are
* removed to make room for superpage, * removed to make room for superpage(s).
* if they exist.
*/ */
dma_pte_free_pagetable(domain, iov_pfn, dma_pte_free_pagetable(domain, iov_pfn, end_pfn);
iov_pfn + lvl_pages - 1);
} else { } else {
pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE; pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE;
} }

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