Linux 4.9-rc6

-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYMhsfAAoJEHm+PkMAQRiGbZMH/AnSgpvWgJQGr/NsovAJsDM9
 aJZPNQnjVD+6dBZLudCJOeKoZ8hd0vI/FNPxDrAJxt0L4PCX6Hxnmt+qsLAhodiU
 uGOpLK7dwgE5OH3xEKzbEHJBitEZ5nmKBG1oEZNurL9kTFxyL78j7YnlMz/DpjsH
 RwDfV4tD5vyVv8vcmHzo6OBWja+78Njo6+OVaMq/fw8+LqS2uq1ajsLWlkUMGo4b
 3CDziy6lMLjHy5LlrWkxYvIK2ldB8o+3EDnp/KOwrQ/L9qNaBillUxwDI8qodqHV
 NTUjBi51oqG06YwplJa7Qr9SVFD28SlNjVIv/PRgHm6kPfzNUvlp97WnWUn8R/8=
 =SoWG
 -----END PGP SIGNATURE-----

Merge tag 'v4.9-rc6' into patchwork

Linux 4.9-rc6

* tag 'v4.9-rc6': (305 commits)
  Linux 4.9-rc6
  ext4: sanity check the block and cluster size at mount time
  fscrypto: don't use on-stack buffer for key derivation
  fscrypto: don't use on-stack buffer for filename encryption
  i2c: i2c-mux-pca954x: fix deselect enabling for device-tree
  kvm: x86: merge kvm_arch_set_irq and kvm_arch_set_irq_inatomic
  KVM: x86: fix missed SRCU usage in kvm_lapic_set_vapic_addr
  KVM: async_pf: avoid recursive flushing of work items
  kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use
  KVM: Disable irq while unregistering user notifier
  KVM: x86: do not go through vcpu in __get_kvmclock_ns
  MAINTAINERS: Add LED subsystem co-maintainer
  crypto: algif_hash - Fix NULL hash crash with shash
  powerpc/mm: Fix missing update of HID register on secondary CPUs
  KVM: arm64: Fix the issues when guest PMCCFILTR is configured
  arm64: KVM: pmu: Fix AArch32 cycle counter access
  powerpc/mm/radix: Invalidate ERAT on tlbiel for POWER9 DD1
  i2c: digicolor: use clk_disable_unprepare instead of clk_unprepare
  ipmi/bt-bmc: change compatible node to 'aspeed, ast2400-ibt-bmc'
  Revert "drm/mediatek: set vblank_disable_allowed to true"
  ...
This commit is contained in:
Mauro Carvalho Chehab 2016-11-22 05:20:06 -02:00
commit 820b1a93f4
300 changed files with 3019 additions and 1707 deletions

View file

@ -6,7 +6,7 @@ perform in-band IPMI communication with their host.
Required properties: Required properties:
- compatible : should be "aspeed,ast2400-bt-bmc" - compatible : should be "aspeed,ast2400-ibt-bmc"
- reg: physical address and size of the registers - reg: physical address and size of the registers
Optional properties: Optional properties:
@ -17,7 +17,7 @@ Optional properties:
Example: Example:
ibt@1e789140 { ibt@1e789140 {
compatible = "aspeed,ast2400-bt-bmc"; compatible = "aspeed,ast2400-ibt-bmc";
reg = <0x1e789140 0x18>; reg = <0x1e789140 0x18>;
interrupts = <8>; interrupts = <8>;
}; };

View file

@ -12,7 +12,7 @@ Required properties:
Optional properties: Optional properties:
- ti,dmic: phandle for the OMAP dmic node if the machine have it connected - ti,dmic: phandle for the OMAP dmic node if the machine have it connected
- ti,jack_detection: Need to be present if the board capable to detect jack - ti,jack-detection: Need to be present if the board capable to detect jack
insertion, removal. insertion, removal.
Available audio endpoints for the audio-routing table: Available audio endpoints for the audio-routing table:

View file

@ -326,7 +326,7 @@ Two parent-locked sibling muxes
This is a good topology. This is a good topology.
.--------. .--------.
.----------. .--| dev D1 | .----------. .--| dev D1 |
| parent- |--' '--------' | parent- |--' '--------'
.--| locked | .--------. .--| locked | .--------.
@ -350,7 +350,7 @@ Mux-locked and parent-locked sibling muxes
This is a good topology. This is a good topology.
.--------. .--------.
.----------. .--| dev D1 | .----------. .--| dev D1 |
| mux- |--' '--------' | mux- |--' '--------'
.--| locked | .--------. .--| locked | .--------.

View file

@ -67,13 +67,14 @@ Note that DSA does not currently create network interfaces for the "cpu" and
Switch tagging protocols Switch tagging protocols
------------------------ ------------------------
DSA currently supports 4 different tagging protocols, and a tag-less mode as DSA currently supports 5 different tagging protocols, and a tag-less mode as
well. The different protocols are implemented in: well. The different protocols are implemented in:
net/dsa/tag_trailer.c: Marvell's 4 trailer tag mode (legacy) net/dsa/tag_trailer.c: Marvell's 4 trailer tag mode (legacy)
net/dsa/tag_dsa.c: Marvell's original DSA tag net/dsa/tag_dsa.c: Marvell's original DSA tag
net/dsa/tag_edsa.c: Marvell's enhanced DSA tag net/dsa/tag_edsa.c: Marvell's enhanced DSA tag
net/dsa/tag_brcm.c: Broadcom's 4 bytes tag net/dsa/tag_brcm.c: Broadcom's 4 bytes tag
net/dsa/tag_qca.c: Qualcomm's 2 bytes tag
The exact format of the tag protocol is vendor specific, but in general, they The exact format of the tag protocol is vendor specific, but in general, they
all contain something which: all contain something which:

View file

@ -777,6 +777,17 @@ Gets the current timestamp of kvmclock as seen by the current guest. In
conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios
such as migration. such as migration.
When KVM_CAP_ADJUST_CLOCK is passed to KVM_CHECK_EXTENSION, it returns the
set of bits that KVM can return in struct kvm_clock_data's flag member.
The only flag defined now is KVM_CLOCK_TSC_STABLE. If set, the returned
value is the exact kvmclock value seen by all VCPUs at the instant
when KVM_GET_CLOCK was called. If clear, the returned value is simply
CLOCK_MONOTONIC plus a constant offset; the offset can be modified
with KVM_SET_CLOCK. KVM will try to make all VCPUs follow this clock,
but the exact value read by each VCPU could differ, because the host
TSC is not stable.
struct kvm_clock_data { struct kvm_clock_data {
__u64 clock; /* kvmclock current value */ __u64 clock; /* kvmclock current value */
__u32 flags; __u32 flags;

View file

@ -7084,6 +7084,7 @@ F: drivers/scsi/53c700*
LED SUBSYSTEM LED SUBSYSTEM
M: Richard Purdie <rpurdie@rpsys.net> M: Richard Purdie <rpurdie@rpsys.net>
M: Jacek Anaszewski <j.anaszewski@samsung.com> M: Jacek Anaszewski <j.anaszewski@samsung.com>
M: Pavel Machek <pavel@ucw.cz>
L: linux-leds@vger.kernel.org L: linux-leds@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
S: Maintained S: Maintained
@ -8084,6 +8085,7 @@ F: drivers/infiniband/hw/mlx4/
F: include/linux/mlx4/ F: include/linux/mlx4/
MELLANOX MLX5 core VPI driver MELLANOX MLX5 core VPI driver
M: Saeed Mahameed <saeedm@mellanox.com>
M: Matan Barak <matanb@mellanox.com> M: Matan Barak <matanb@mellanox.com>
M: Leon Romanovsky <leonro@mellanox.com> M: Leon Romanovsky <leonro@mellanox.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org

View file

@ -1,7 +1,7 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 9 PATCHLEVEL = 9
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc5 EXTRAVERSION = -rc6
NAME = Psychotic Stoned Sheep NAME = Psychotic Stoned Sheep
# *DOCUMENTATION* # *DOCUMENTATION*
@ -399,11 +399,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \ -fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \ -Werror-implicit-function-declaration \
-Wno-format-security \ -Wno-format-security \
-std=gnu89 -std=gnu89 $(call cc-option,-fno-PIE)
KBUILD_AFLAGS_KERNEL := KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__ KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds

View file

@ -64,8 +64,8 @@
}; };
ldo3_reg: ldo3 { ldo3_reg: ldo3 {
regulator-min-microvolt = <600000>; regulator-min-microvolt = <1725000>;
regulator-max-microvolt = <1800000>; regulator-max-microvolt = <3300000>;
regulator-always-on; regulator-always-on;
}; };
@ -76,8 +76,8 @@
}; };
ldo5_reg: ldo5 { ldo5_reg: ldo5 {
regulator-min-microvolt = <1725000>; regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3300000>; regulator-max-microvolt = <3600000>;
regulator-always-on; regulator-always-on;
}; };
@ -100,14 +100,14 @@
}; };
ldo9_reg: ldo9 { ldo9_reg: ldo9 {
regulator-min-microvolt = <1200000>; regulator-min-microvolt = <1250000>;
regulator-max-microvolt = <3600000>; regulator-max-microvolt = <3600000>;
regulator-always-on; regulator-always-on;
}; };
ldo10_reg: ldo10 { ldo10_reg: ldo10 {
regulator-min-microvolt = <1250000>; regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3650000>; regulator-max-microvolt = <3600000>;
regulator-always-on; regulator-always-on;
}; };
}; };

View file

@ -13,6 +13,11 @@
}; };
}; };
memory@80000000 {
device_type = "memory";
reg = <0x80000000 0>;
};
wl12xx_vmmc: wl12xx_vmmc { wl12xx_vmmc: wl12xx_vmmc {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "vwl1271"; regulator-name = "vwl1271";

View file

@ -13,9 +13,9 @@
}; };
}; };
memory@0 { memory@80000000 {
device_type = "memory"; device_type = "memory";
reg = <0 0>; reg = <0x80000000 0>;
}; };
leds { leds {

View file

@ -124,6 +124,7 @@
compatible = "ti,abe-twl6040"; compatible = "ti,abe-twl6040";
ti,model = "omap5-uevm"; ti,model = "omap5-uevm";
ti,jack-detection;
ti,mclk-freq = <19200000>; ti,mclk-freq = <19200000>;
ti,mcpdm = <&mcpdm>; ti,mcpdm = <&mcpdm>;
@ -415,7 +416,7 @@
ti,backup-battery-charge-high-current; ti,backup-battery-charge-high-current;
}; };
gpadc { gpadc: gpadc {
compatible = "ti,palmas-gpadc"; compatible = "ti,palmas-gpadc";
interrupts = <18 0 interrupts = <18 0
16 0 16 0
@ -475,8 +476,8 @@
smps6_reg: smps6 { smps6_reg: smps6 {
/* VDD_DDR3 - over VDD_SMPS6 */ /* VDD_DDR3 - over VDD_SMPS6 */
regulator-name = "smps6"; regulator-name = "smps6";
regulator-min-microvolt = <1200000>; regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1200000>; regulator-max-microvolt = <1350000>;
regulator-always-on; regulator-always-on;
regulator-boot-on; regulator-boot-on;
}; };

View file

@ -74,7 +74,7 @@
/* Low speed expansion connector */ /* Low speed expansion connector */
spi0: spi@9844000 { spi0: spi@9844000 {
label = "LS-SPI0"; label = "LS-SPI0";
cs-gpio = <&pio30 3 0>; cs-gpios = <&pio30 3 0>;
status = "okay"; status = "okay";
}; };

View file

@ -282,11 +282,15 @@
uart1_pins_a: uart1@0 { uart1_pins_a: uart1@0 {
allwinner,pins = "PG6", "PG7"; allwinner,pins = "PG6", "PG7";
allwinner,function = "uart1"; allwinner,function = "uart1";
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
}; };
uart1_pins_cts_rts_a: uart1-cts-rts@0 { uart1_pins_cts_rts_a: uart1-cts-rts@0 {
allwinner,pins = "PG8", "PG9"; allwinner,pins = "PG8", "PG9";
allwinner,function = "uart1"; allwinner,function = "uart1";
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
}; };
mmc0_pins_a: mmc0@0 { mmc0_pins_a: mmc0@0 {

View file

@ -74,6 +74,26 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long
dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
} }
void dump_backtrace_stm(u32 *stack, u32 instruction)
{
char str[80], *p;
unsigned int x;
int reg;
for (reg = 10, x = 0, p = str; reg >= 0; reg--) {
if (instruction & BIT(reg)) {
p += sprintf(p, " r%d:%08x", reg, *stack--);
if (++x == 6) {
x = 0;
p = str;
printk("%s\n", str);
}
}
}
if (p != str)
printk("%s\n", str);
}
#ifndef CONFIG_ARM_UNWIND #ifndef CONFIG_ARM_UNWIND
/* /*
* Stack pointers should always be within the kernels view of * Stack pointers should always be within the kernels view of

View file

@ -3,6 +3,9 @@
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/ */
/* No __ro_after_init data in the .rodata section - which will always be ro */
#define RO_AFTER_INIT_DATA
#include <asm-generic/vmlinux.lds.h> #include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h> #include <asm/cache.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
@ -223,6 +226,8 @@ SECTIONS
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__init_end = .; __init_end = .;
*(.data..ro_after_init)
NOSAVE_DATA NOSAVE_DATA
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
READ_MOSTLY_DATA(L1_CACHE_BYTES) READ_MOSTLY_DATA(L1_CACHE_BYTES)

View file

@ -10,6 +10,7 @@
* 27/03/03 Ian Molton Clean up CONFIG_CPU * 27/03/03 Ian Molton Clean up CONFIG_CPU
* *
*/ */
#include <linux/kern_levels.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/assembler.h> #include <asm/assembler.h>
.text .text
@ -83,13 +84,13 @@ for_each_frame: tst frame, mask @ Check for address exceptions
teq r3, r1, lsr #11 teq r3, r1, lsr #11
ldreq r0, [frame, #-8] @ get sp ldreq r0, [frame, #-8] @ get sp
subeq r0, r0, #4 @ point at the last arg subeq r0, r0, #4 @ point at the last arg
bleq .Ldumpstm @ dump saved registers bleq dump_backtrace_stm @ dump saved registers
1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc} 1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
ldr r3, .Ldsi @ instruction exists, ldr r3, .Ldsi @ instruction exists,
teq r3, r1, lsr #11 teq r3, r1, lsr #11
subeq r0, frame, #16 subeq r0, frame, #16
bleq .Ldumpstm @ dump saved registers bleq dump_backtrace_stm @ dump saved registers
teq sv_fp, #0 @ zero saved fp means teq sv_fp, #0 @ zero saved fp means
beq no_frame @ no further frames beq no_frame @ no further frames
@ -112,38 +113,6 @@ ENDPROC(c_backtrace)
.long 1004b, 1006b .long 1004b, 1006b
.popsection .popsection
#define instr r4
#define reg r5
#define stack r6
.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr}
mov stack, r0
mov instr, r1
mov reg, #10
mov r7, #0
1: mov r3, #1
ARM( tst instr, r3, lsl reg )
THUMB( lsl r3, reg )
THUMB( tst instr, r3 )
beq 2f
add r7, r7, #1
teq r7, #6
moveq r7, #0
adr r3, .Lcr
addne r3, r3, #1 @ skip newline
ldr r2, [stack], #-4
mov r1, reg
adr r0, .Lfp
bl printk
2: subs reg, reg, #1
bpl 1b
teq r7, #0
adrne r0, .Lcr
blne printk
ldmfd sp!, {instr, reg, stack, r7, pc}
.Lfp: .asciz " r%d:%08x%s"
.Lcr: .asciz "\n"
.Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n" .Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
.align .align
.Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc} .Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc}

View file

@ -71,6 +71,7 @@ config SOC_AM43XX
select HAVE_ARM_TWD select HAVE_ARM_TWD
select ARM_ERRATA_754322 select ARM_ERRATA_754322
select ARM_ERRATA_775420 select ARM_ERRATA_775420
select OMAP_INTERCONNECT
config SOC_DRA7XX config SOC_DRA7XX
bool "TI DRA7XX" bool "TI DRA7XX"

View file

@ -205,11 +205,15 @@ void __init omap2xxx_check_revision(void)
#define OMAP3_SHOW_FEATURE(feat) \ #define OMAP3_SHOW_FEATURE(feat) \
if (omap3_has_ ##feat()) \ if (omap3_has_ ##feat()) \
printk(#feat" "); n += scnprintf(buf + n, sizeof(buf) - n, #feat " ");
static void __init omap3_cpuinfo(void) static void __init omap3_cpuinfo(void)
{ {
const char *cpu_name; const char *cpu_name;
char buf[64];
int n = 0;
memset(buf, 0, sizeof(buf));
/* /*
* OMAP3430 and OMAP3530 are assumed to be same. * OMAP3430 and OMAP3530 are assumed to be same.
@ -241,10 +245,10 @@ static void __init omap3_cpuinfo(void)
cpu_name = "OMAP3503"; cpu_name = "OMAP3503";
} }
sprintf(soc_name, "%s", cpu_name); scnprintf(soc_name, sizeof(soc_name), "%s", cpu_name);
/* Print verbose information */ /* Print verbose information */
pr_info("%s %s (", soc_name, soc_rev); n += scnprintf(buf, sizeof(buf) - n, "%s %s (", soc_name, soc_rev);
OMAP3_SHOW_FEATURE(l2cache); OMAP3_SHOW_FEATURE(l2cache);
OMAP3_SHOW_FEATURE(iva); OMAP3_SHOW_FEATURE(iva);
@ -252,8 +256,10 @@ static void __init omap3_cpuinfo(void)
OMAP3_SHOW_FEATURE(neon); OMAP3_SHOW_FEATURE(neon);
OMAP3_SHOW_FEATURE(isp); OMAP3_SHOW_FEATURE(isp);
OMAP3_SHOW_FEATURE(192mhz_clk); OMAP3_SHOW_FEATURE(192mhz_clk);
if (*(buf + n - 1) == ' ')
printk(")\n"); n--;
n += scnprintf(buf + n, sizeof(buf) - n, ")\n");
pr_info("%s", buf);
} }
#define OMAP3_CHECK_FEATURE(status,feat) \ #define OMAP3_CHECK_FEATURE(status,feat) \

View file

@ -319,6 +319,9 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
if (has_uart4) { if (has_uart4) {
en_uart4_mask = OMAP3630_EN_UART4_MASK; en_uart4_mask = OMAP3630_EN_UART4_MASK;
grpsel_uart4_mask = OMAP3630_GRPSEL_UART4_MASK; grpsel_uart4_mask = OMAP3630_GRPSEL_UART4_MASK;
} else {
en_uart4_mask = 0;
grpsel_uart4_mask = 0;
} }
/* Enable wakeups in PER */ /* Enable wakeups in PER */

View file

@ -87,6 +87,12 @@ int voltdm_scale(struct voltagedomain *voltdm,
return -ENODATA; return -ENODATA;
} }
if (!voltdm->volt_data) {
pr_err("%s: No voltage data defined for vdd_%s\n",
__func__, voltdm->name);
return -ENODATA;
}
/* Adjust voltage to the exact voltage from the OPP table */ /* Adjust voltage to the exact voltage from the OPP table */
for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) { for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) {
if (voltdm->volt_data[i].volt_nominal >= target_volt) { if (voltdm->volt_data[i].volt_nominal >= target_volt) {

View file

@ -1167,7 +1167,7 @@ static int __init dma_debug_do_init(void)
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
return 0; return 0;
} }
fs_initcall(dma_debug_do_init); core_initcall(dma_debug_do_init);
#ifdef CONFIG_ARM_DMA_USE_IOMMU #ifdef CONFIG_ARM_DMA_USE_IOMMU

View file

@ -96,7 +96,7 @@ ENTRY(cpu_cm7_proc_fin)
ret lr ret lr
ENDPROC(cpu_cm7_proc_fin) ENDPROC(cpu_cm7_proc_fin)
.section ".text.init", #alloc, #execinstr .section ".init.text", #alloc, #execinstr
__v7m_cm7_setup: __v7m_cm7_setup:
mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP) mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP)

View file

@ -105,7 +105,7 @@
status = "disabled"; status = "disabled";
}; };
nb_perih_clk: nb-periph-clk@13000{ nb_periph_clk: nb-periph-clk@13000 {
compatible = "marvell,armada-3700-periph-clock-nb"; compatible = "marvell,armada-3700-periph-clock-nb";
reg = <0x13000 0x100>; reg = <0x13000 0x100>;
clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>, clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,
@ -113,7 +113,7 @@
#clock-cells = <1>; #clock-cells = <1>;
}; };
sb_perih_clk: sb-periph-clk@18000{ sb_periph_clk: sb-periph-clk@18000 {
compatible = "marvell,armada-3700-periph-clock-sb"; compatible = "marvell,armada-3700-periph-clock-sb";
reg = <0x18000 0x100>; reg = <0x18000 0x100>;
clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>, clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,

View file

@ -130,8 +130,8 @@
reg = <0x700600 0x50>; reg = <0x700600 0x50>;
#address-cells = <0x1>; #address-cells = <0x1>;
#size-cells = <0x0>; #size-cells = <0x0>;
cell-index = <1>; cell-index = <3>;
clocks = <&cps_syscon0 0 3>; clocks = <&cps_syscon0 1 21>;
status = "disabled"; status = "disabled";
}; };
@ -140,7 +140,7 @@
reg = <0x700680 0x50>; reg = <0x700680 0x50>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
cell-index = <2>; cell-index = <4>;
clocks = <&cps_syscon0 1 21>; clocks = <&cps_syscon0 1 21>;
status = "disabled"; status = "disabled";
}; };

View file

@ -46,7 +46,15 @@
#define ARMV8_PMU_EVTYPE_MASK 0xc800ffff /* Mask for writable bits */ #define ARMV8_PMU_EVTYPE_MASK 0xc800ffff /* Mask for writable bits */
#define ARMV8_PMU_EVTYPE_EVENT 0xffff /* Mask for EVENT bits */ #define ARMV8_PMU_EVTYPE_EVENT 0xffff /* Mask for EVENT bits */
#define ARMV8_PMU_EVTYPE_EVENT_SW_INCR 0 /* Software increment event */ /*
* PMUv3 event types: required events
*/
#define ARMV8_PMUV3_PERFCTR_SW_INCR 0x00
#define ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL 0x03
#define ARMV8_PMUV3_PERFCTR_L1D_CACHE 0x04
#define ARMV8_PMUV3_PERFCTR_BR_MIS_PRED 0x10
#define ARMV8_PMUV3_PERFCTR_CPU_CYCLES 0x11
#define ARMV8_PMUV3_PERFCTR_BR_PRED 0x12
/* /*
* Event filters for PMUv3 * Event filters for PMUv3

View file

@ -31,17 +31,9 @@
/* /*
* ARMv8 PMUv3 Performance Events handling code. * ARMv8 PMUv3 Performance Events handling code.
* Common event types. * Common event types (some are defined in asm/perf_event.h).
*/ */
/* Required events. */
#define ARMV8_PMUV3_PERFCTR_SW_INCR 0x00
#define ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL 0x03
#define ARMV8_PMUV3_PERFCTR_L1D_CACHE 0x04
#define ARMV8_PMUV3_PERFCTR_BR_MIS_PRED 0x10
#define ARMV8_PMUV3_PERFCTR_CPU_CYCLES 0x11
#define ARMV8_PMUV3_PERFCTR_BR_PRED 0x12
/* At least one of the following is required. */ /* At least one of the following is required. */
#define ARMV8_PMUV3_PERFCTR_INST_RETIRED 0x08 #define ARMV8_PMUV3_PERFCTR_INST_RETIRED 0x08
#define ARMV8_PMUV3_PERFCTR_INST_SPEC 0x1B #define ARMV8_PMUV3_PERFCTR_INST_SPEC 0x1B

View file

@ -597,8 +597,14 @@ static bool access_pmu_evcntr(struct kvm_vcpu *vcpu,
idx = ARMV8_PMU_CYCLE_IDX; idx = ARMV8_PMU_CYCLE_IDX;
} else { } else {
BUG(); return false;
} }
} else if (r->CRn == 0 && r->CRm == 9) {
/* PMCCNTR */
if (pmu_access_event_counter_el0_disabled(vcpu))
return false;
idx = ARMV8_PMU_CYCLE_IDX;
} else if (r->CRn == 14 && (r->CRm & 12) == 8) { } else if (r->CRn == 14 && (r->CRm & 12) == 8) {
/* PMEVCNTRn_EL0 */ /* PMEVCNTRn_EL0 */
if (pmu_access_event_counter_el0_disabled(vcpu)) if (pmu_access_event_counter_el0_disabled(vcpu))
@ -606,7 +612,7 @@ static bool access_pmu_evcntr(struct kvm_vcpu *vcpu,
idx = ((r->CRm & 3) << 3) | (r->Op2 & 7); idx = ((r->CRm & 3) << 3) | (r->Op2 & 7);
} else { } else {
BUG(); return false;
} }
if (!pmu_counter_idx_valid(vcpu, idx)) if (!pmu_counter_idx_valid(vcpu, idx))

View file

@ -91,7 +91,7 @@
*/ */
#define LOAD_HANDLER(reg, label) \ #define LOAD_HANDLER(reg, label) \
ld reg,PACAKBASE(r13); /* get high part of &label */ \ ld reg,PACAKBASE(r13); /* get high part of &label */ \
ori reg,reg,(FIXED_SYMBOL_ABS_ADDR(label))@l; ori reg,reg,FIXED_SYMBOL_ABS_ADDR(label);
#define __LOAD_HANDLER(reg, label) \ #define __LOAD_HANDLER(reg, label) \
ld reg,PACAKBASE(r13); \ ld reg,PACAKBASE(r13); \
@ -158,14 +158,17 @@ BEGIN_FTR_SECTION_NESTED(943) \
std ra,offset(r13); \ std ra,offset(r13); \
END_FTR_SECTION_NESTED(ftr,ftr,943) END_FTR_SECTION_NESTED(ftr,ftr,943)
#define EXCEPTION_PROLOG_0(area) \ #define EXCEPTION_PROLOG_0_PACA(area) \
GET_PACA(r13); \
std r9,area+EX_R9(r13); /* save r9 */ \ std r9,area+EX_R9(r13); /* save r9 */ \
OPT_GET_SPR(r9, SPRN_PPR, CPU_FTR_HAS_PPR); \ OPT_GET_SPR(r9, SPRN_PPR, CPU_FTR_HAS_PPR); \
HMT_MEDIUM; \ HMT_MEDIUM; \
std r10,area+EX_R10(r13); /* save r10 - r12 */ \ std r10,area+EX_R10(r13); /* save r10 - r12 */ \
OPT_GET_SPR(r10, SPRN_CFAR, CPU_FTR_CFAR) OPT_GET_SPR(r10, SPRN_CFAR, CPU_FTR_CFAR)
#define EXCEPTION_PROLOG_0(area) \
GET_PACA(r13); \
EXCEPTION_PROLOG_0_PACA(area)
#define __EXCEPTION_PROLOG_1(area, extra, vec) \ #define __EXCEPTION_PROLOG_1(area, extra, vec) \
OPT_SAVE_REG_TO_PACA(area+EX_PPR, r9, CPU_FTR_HAS_PPR); \ OPT_SAVE_REG_TO_PACA(area+EX_PPR, r9, CPU_FTR_HAS_PPR); \
OPT_SAVE_REG_TO_PACA(area+EX_CFAR, r10, CPU_FTR_CFAR); \ OPT_SAVE_REG_TO_PACA(area+EX_CFAR, r10, CPU_FTR_CFAR); \
@ -196,6 +199,12 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
EXCEPTION_PROLOG_1(area, extra, vec); \ EXCEPTION_PROLOG_1(area, extra, vec); \
EXCEPTION_PROLOG_PSERIES_1(label, h); EXCEPTION_PROLOG_PSERIES_1(label, h);
/* Have the PACA in r13 already */
#define EXCEPTION_PROLOG_PSERIES_PACA(area, label, h, extra, vec) \
EXCEPTION_PROLOG_0_PACA(area); \
EXCEPTION_PROLOG_1(area, extra, vec); \
EXCEPTION_PROLOG_PSERIES_1(label, h);
#define __KVMTEST(h, n) \ #define __KVMTEST(h, n) \
lbz r10,HSTATE_IN_GUEST(r13); \ lbz r10,HSTATE_IN_GUEST(r13); \
cmpwi r10,0; \ cmpwi r10,0; \

View file

@ -460,5 +460,6 @@
#define PPC_SLBIA(IH) stringify_in_c(.long PPC_INST_SLBIA | \ #define PPC_SLBIA(IH) stringify_in_c(.long PPC_INST_SLBIA | \
((IH & 0x7) << 21)) ((IH & 0x7) << 21))
#define PPC_INVALIDATE_ERAT PPC_SLBIA(7)
#endif /* _ASM_POWERPC_PPC_OPCODE_H */ #endif /* _ASM_POWERPC_PPC_OPCODE_H */

View file

@ -116,7 +116,9 @@ EXC_VIRT_NONE(0x4000, 0x4100)
EXC_REAL_BEGIN(system_reset, 0x100, 0x200) EXC_REAL_BEGIN(system_reset, 0x100, 0x200)
SET_SCRATCH0(r13) SET_SCRATCH0(r13)
EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD, GET_PACA(r13)
clrrdi r13,r13,1 /* Last bit of HSPRG0 is set if waking from winkle */
EXCEPTION_PROLOG_PSERIES_PACA(PACA_EXGEN, system_reset_common, EXC_STD,
IDLETEST, 0x100) IDLETEST, 0x100)
EXC_REAL_END(system_reset, 0x100, 0x200) EXC_REAL_END(system_reset, 0x100, 0x200)
@ -124,6 +126,9 @@ EXC_VIRT_NONE(0x4100, 0x4200)
#ifdef CONFIG_PPC_P7_NAP #ifdef CONFIG_PPC_P7_NAP
EXC_COMMON_BEGIN(system_reset_idle_common) EXC_COMMON_BEGIN(system_reset_idle_common)
BEGIN_FTR_SECTION
GET_PACA(r13) /* Restore HSPRG0 to get the winkle bit in r13 */
END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_300)
bl pnv_restore_hyp_resource bl pnv_restore_hyp_resource
li r0,PNV_THREAD_RUNNING li r0,PNV_THREAD_RUNNING
@ -169,7 +174,7 @@ EXC_REAL_BEGIN(machine_check, 0x200, 0x300)
SET_SCRATCH0(r13) /* save r13 */ SET_SCRATCH0(r13) /* save r13 */
/* /*
* Running native on arch 2.06 or later, we may wakeup from winkle * Running native on arch 2.06 or later, we may wakeup from winkle
* inside machine check. If yes, then last bit of HSPGR0 would be set * inside machine check. If yes, then last bit of HSPRG0 would be set
* to 1. Hence clear it unconditionally. * to 1. Hence clear it unconditionally.
*/ */
GET_PACA(r13) GET_PACA(r13)
@ -388,7 +393,7 @@ EXC_COMMON_BEGIN(machine_check_handle_early)
/* /*
* Go back to winkle. Please note that this thread was woken up in * Go back to winkle. Please note that this thread was woken up in
* machine check from winkle and have not restored the per-subcore * machine check from winkle and have not restored the per-subcore
* state. Hence before going back to winkle, set last bit of HSPGR0 * state. Hence before going back to winkle, set last bit of HSPRG0
* to 1. This will make sure that if this thread gets woken up * to 1. This will make sure that if this thread gets woken up
* again at reset vector 0x100 then it will get chance to restore * again at reset vector 0x100 then it will get chance to restore
* the subcore state. * the subcore state.

View file

@ -1215,7 +1215,7 @@ static void show_instructions(struct pt_regs *regs)
int instr; int instr;
if (!(i % 8)) if (!(i % 8))
printk("\n"); pr_cont("\n");
#if !defined(CONFIG_BOOKE) #if !defined(CONFIG_BOOKE)
/* If executing with the IMMU off, adjust pc rather /* If executing with the IMMU off, adjust pc rather
@ -1227,18 +1227,18 @@ static void show_instructions(struct pt_regs *regs)
if (!__kernel_text_address(pc) || if (!__kernel_text_address(pc) ||
probe_kernel_address((unsigned int __user *)pc, instr)) { probe_kernel_address((unsigned int __user *)pc, instr)) {
printk(KERN_CONT "XXXXXXXX "); pr_cont("XXXXXXXX ");
} else { } else {
if (regs->nip == pc) if (regs->nip == pc)
printk(KERN_CONT "<%08x> ", instr); pr_cont("<%08x> ", instr);
else else
printk(KERN_CONT "%08x ", instr); pr_cont("%08x ", instr);
} }
pc += sizeof(int); pc += sizeof(int);
} }
printk("\n"); pr_cont("\n");
} }
struct regbit { struct regbit {
@ -1282,7 +1282,7 @@ static void print_bits(unsigned long val, struct regbit *bits, const char *sep)
for (; bits->bit; ++bits) for (; bits->bit; ++bits)
if (val & bits->bit) { if (val & bits->bit) {
printk("%s%s", s, bits->name); pr_cont("%s%s", s, bits->name);
s = sep; s = sep;
} }
} }
@ -1305,9 +1305,9 @@ static void print_tm_bits(unsigned long val)
* T: Transactional (bit 34) * T: Transactional (bit 34)
*/ */
if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) { if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) {
printk(",TM["); pr_cont(",TM[");
print_bits(val, msr_tm_bits, ""); print_bits(val, msr_tm_bits, "");
printk("]"); pr_cont("]");
} }
} }
#else #else
@ -1316,10 +1316,10 @@ static void print_tm_bits(unsigned long val) {}
static void print_msr_bits(unsigned long val) static void print_msr_bits(unsigned long val)
{ {
printk("<"); pr_cont("<");
print_bits(val, msr_bits, ","); print_bits(val, msr_bits, ",");
print_tm_bits(val); print_tm_bits(val);
printk(">"); pr_cont(">");
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
@ -1347,29 +1347,29 @@ void show_regs(struct pt_regs * regs)
printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
trap = TRAP(regs); trap = TRAP(regs);
if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR)) if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
printk("CFAR: "REG" ", regs->orig_gpr3); pr_cont("CFAR: "REG" ", regs->orig_gpr3);
if (trap == 0x200 || trap == 0x300 || trap == 0x600) if (trap == 0x200 || trap == 0x300 || trap == 0x600)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
printk("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr); pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
#else #else
printk("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr); pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
#endif #endif
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
printk("SOFTE: %ld ", regs->softe); pr_cont("SOFTE: %ld ", regs->softe);
#endif #endif
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
if (MSR_TM_ACTIVE(regs->msr)) if (MSR_TM_ACTIVE(regs->msr))
printk("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch); pr_cont("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
#endif #endif
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
if ((i % REGS_PER_LINE) == 0) if ((i % REGS_PER_LINE) == 0)
printk("\nGPR%02d: ", i); pr_cont("\nGPR%02d: ", i);
printk(REG " ", regs->gpr[i]); pr_cont(REG " ", regs->gpr[i]);
if (i == LAST_VOLATILE && !FULL_REGS(regs)) if (i == LAST_VOLATILE && !FULL_REGS(regs))
break; break;
} }
printk("\n"); pr_cont("\n");
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
/* /*
* Lookup NIP late so we have the best change of getting the * Lookup NIP late so we have the best change of getting the
@ -1900,14 +1900,14 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip); printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
if ((ip == rth) && curr_frame >= 0) { if ((ip == rth) && curr_frame >= 0) {
printk(" (%pS)", pr_cont(" (%pS)",
(void *)current->ret_stack[curr_frame].ret); (void *)current->ret_stack[curr_frame].ret);
curr_frame--; curr_frame--;
} }
#endif #endif
if (firstframe) if (firstframe)
printk(" (unreliable)"); pr_cont(" (unreliable)");
printk("\n"); pr_cont("\n");
} }
firstframe = 0; firstframe = 0;

View file

@ -226,17 +226,25 @@ static void __init configure_exceptions(void)
if (firmware_has_feature(FW_FEATURE_OPAL)) if (firmware_has_feature(FW_FEATURE_OPAL))
opal_configure_cores(); opal_configure_cores();
/* Enable AIL if supported, and we are in hypervisor mode */ /* AIL on native is done in cpu_ready_for_interrupts() */
if (early_cpu_has_feature(CPU_FTR_HVMODE) &&
early_cpu_has_feature(CPU_FTR_ARCH_207S)) {
unsigned long lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
}
} }
} }
static void cpu_ready_for_interrupts(void) static void cpu_ready_for_interrupts(void)
{ {
/*
* Enable AIL if supported, and we are in hypervisor mode. This
* is called once for every processor.
*
* If we are not in hypervisor mode the job is done once for
* the whole partition in configure_exceptions().
*/
if (early_cpu_has_feature(CPU_FTR_HVMODE) &&
early_cpu_has_feature(CPU_FTR_ARCH_207S)) {
unsigned long lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
}
/* Set IR and DR in PACA MSR */ /* Set IR and DR in PACA MSR */
get_paca()->kernel_msr = MSR_KERNEL; get_paca()->kernel_msr = MSR_KERNEL;
} }

View file

@ -1029,6 +1029,10 @@ void hash__early_init_mmu_secondary(void)
{ {
/* Initialize hash table for that CPU */ /* Initialize hash table for that CPU */
if (!firmware_has_feature(FW_FEATURE_LPAR)) { if (!firmware_has_feature(FW_FEATURE_LPAR)) {
if (cpu_has_feature(CPU_FTR_POWER9_DD1))
update_hid_for_hash();
if (!cpu_has_feature(CPU_FTR_ARCH_300)) if (!cpu_has_feature(CPU_FTR_ARCH_300))
mtspr(SPRN_SDR1, _SDR1); mtspr(SPRN_SDR1, _SDR1);
else else

View file

@ -388,6 +388,10 @@ void radix__early_init_mmu_secondary(void)
* update partition table control register and UPRT * update partition table control register and UPRT
*/ */
if (!firmware_has_feature(FW_FEATURE_LPAR)) { if (!firmware_has_feature(FW_FEATURE_LPAR)) {
if (cpu_has_feature(CPU_FTR_POWER9_DD1))
update_hid_for_radix();
lpcr = mfspr(SPRN_LPCR); lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR); mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR);

View file

@ -50,6 +50,8 @@ static inline void _tlbiel_pid(unsigned long pid, unsigned long ric)
for (set = 0; set < POWER9_TLB_SETS_RADIX ; set++) { for (set = 0; set < POWER9_TLB_SETS_RADIX ; set++) {
__tlbiel_pid(pid, set, ric); __tlbiel_pid(pid, set, ric);
} }
if (cpu_has_feature(CPU_FTR_POWER9_DD1))
asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
return; return;
} }
@ -83,6 +85,8 @@ static inline void _tlbiel_va(unsigned long va, unsigned long pid,
asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1) asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1)
: : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(rs) : "memory"); : : "r"(rb), "i"(r), "i"(prs), "i"(ric), "r"(rs) : "memory");
asm volatile("ptesync": : :"memory"); asm volatile("ptesync": : :"memory");
if (cpu_has_feature(CPU_FTR_POWER9_DD1))
asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
} }
static inline void _tlbie_va(unsigned long va, unsigned long pid, static inline void _tlbie_va(unsigned long va, unsigned long pid,

View file

@ -61,4 +61,7 @@
*/ */
#define __write_once __read_mostly #define __write_once __read_mostly
/* __ro_after_init is the generic name for the tile arch __write_once. */
#define __ro_after_init __read_mostly
#endif /* _ASM_TILE_CACHE_H */ #endif /* _ASM_TILE_CACHE_H */

View file

@ -8,8 +8,12 @@
#define PCI_DEVICE_ID_INTEL_HSW_IMC 0x0c00 #define PCI_DEVICE_ID_INTEL_HSW_IMC 0x0c00
#define PCI_DEVICE_ID_INTEL_HSW_U_IMC 0x0a04 #define PCI_DEVICE_ID_INTEL_HSW_U_IMC 0x0a04
#define PCI_DEVICE_ID_INTEL_BDW_IMC 0x1604 #define PCI_DEVICE_ID_INTEL_BDW_IMC 0x1604
#define PCI_DEVICE_ID_INTEL_SKL_IMC 0x191f #define PCI_DEVICE_ID_INTEL_SKL_U_IMC 0x1904
#define PCI_DEVICE_ID_INTEL_SKL_U_IMC 0x190c #define PCI_DEVICE_ID_INTEL_SKL_Y_IMC 0x190c
#define PCI_DEVICE_ID_INTEL_SKL_HD_IMC 0x1900
#define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910
#define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f
#define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f
/* SNB event control */ /* SNB event control */
#define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff #define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff
@ -616,13 +620,29 @@ static const struct pci_device_id bdw_uncore_pci_ids[] = {
static const struct pci_device_id skl_uncore_pci_ids[] = { static const struct pci_device_id skl_uncore_pci_ids[] = {
{ /* IMC */ { /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_IMC), PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_Y_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
}, },
{ /* IMC */ { /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_U_IMC), PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_U_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
}, },
{ /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_HD_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
{ /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_HQ_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
{ /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SD_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
{ /* IMC */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
{ /* end: all zeroes */ }, { /* end: all zeroes */ },
}; };
@ -666,8 +686,12 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = {
IMC_DEV(HSW_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core Processor */ IMC_DEV(HSW_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core Processor */
IMC_DEV(HSW_U_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core ULT Mobile Processor */ IMC_DEV(HSW_U_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core ULT Mobile Processor */
IMC_DEV(BDW_IMC, &bdw_uncore_pci_driver), /* 5th Gen Core U */ IMC_DEV(BDW_IMC, &bdw_uncore_pci_driver), /* 5th Gen Core U */
IMC_DEV(SKL_IMC, &skl_uncore_pci_driver), /* 6th Gen Core */ IMC_DEV(SKL_Y_IMC, &skl_uncore_pci_driver), /* 6th Gen Core Y */
IMC_DEV(SKL_U_IMC, &skl_uncore_pci_driver), /* 6th Gen Core U */ IMC_DEV(SKL_U_IMC, &skl_uncore_pci_driver), /* 6th Gen Core U */
IMC_DEV(SKL_HD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Dual Core */
IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */
IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */
IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */
{ /* end marker */ } { /* end marker */ }
}; };

View file

@ -17,6 +17,7 @@
extern int intel_mid_pci_init(void); extern int intel_mid_pci_init(void);
extern int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state); extern int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state);
extern pci_power_t intel_mid_pci_get_power_state(struct pci_dev *pdev);
extern void intel_mid_pwr_power_off(void); extern void intel_mid_pwr_power_off(void);

View file

@ -347,7 +347,6 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned bits; unsigned bits;
int cpu = smp_processor_id(); int cpu = smp_processor_id();
unsigned int socket_id, core_complex_id;
bits = c->x86_coreid_bits; bits = c->x86_coreid_bits;
/* Low order bits define the core id (index of core in socket) */ /* Low order bits define the core id (index of core in socket) */
@ -365,10 +364,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
if (c->x86 != 0x17 || !cpuid_edx(0x80000006)) if (c->x86 != 0x17 || !cpuid_edx(0x80000006))
return; return;
socket_id = (c->apicid >> bits) - 1; per_cpu(cpu_llc_id, cpu) = c->apicid >> 3;
core_complex_id = (c->apicid & ((1 << bits) - 1)) >> 3;
per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id;
#endif #endif
} }

View file

@ -978,6 +978,35 @@ static void x86_init_cache_qos(struct cpuinfo_x86 *c)
} }
} }
/*
* The physical to logical package id mapping is initialized from the
* acpi/mptables information. Make sure that CPUID actually agrees with
* that.
*/
static void sanitize_package_id(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_SMP
unsigned int pkg, apicid, cpu = smp_processor_id();
apicid = apic->cpu_present_to_apicid(cpu);
pkg = apicid >> boot_cpu_data.x86_coreid_bits;
if (apicid != c->initial_apicid) {
pr_err(FW_BUG "CPU%u: APIC id mismatch. Firmware: %x CPUID: %x\n",
cpu, apicid, c->initial_apicid);
c->initial_apicid = apicid;
}
if (pkg != c->phys_proc_id) {
pr_err(FW_BUG "CPU%u: Using firmware package id %u instead of %u\n",
cpu, pkg, c->phys_proc_id);
c->phys_proc_id = pkg;
}
c->logical_proc_id = topology_phys_to_logical_pkg(pkg);
#else
c->logical_proc_id = 0;
#endif
}
/* /*
* This does the hard work of actually picking apart the CPU stuff... * This does the hard work of actually picking apart the CPU stuff...
*/ */
@ -1103,8 +1132,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
numa_add_cpu(smp_processor_id()); numa_add_cpu(smp_processor_id());
#endif #endif
/* The boot/hotplug time assigment got cleared, restore it */ sanitize_package_id(c);
c->logical_proc_id = topology_phys_to_logical_pkg(c->phys_proc_id);
} }
/* /*

View file

@ -156,6 +156,16 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
} }
static int kvm_hv_set_sint(struct kvm_kernel_irq_routing_entry *e,
struct kvm *kvm, int irq_source_id, int level,
bool line_status)
{
if (!level)
return -1;
return kvm_hv_synic_set_irq(kvm, e->hv_sint.vcpu, e->hv_sint.sint);
}
int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e, int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e,
struct kvm *kvm, int irq_source_id, int level, struct kvm *kvm, int irq_source_id, int level,
bool line_status) bool line_status)
@ -163,18 +173,26 @@ int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e,
struct kvm_lapic_irq irq; struct kvm_lapic_irq irq;
int r; int r;
if (unlikely(e->type != KVM_IRQ_ROUTING_MSI)) switch (e->type) {
return -EWOULDBLOCK; case KVM_IRQ_ROUTING_HV_SINT:
return kvm_hv_set_sint(e, kvm, irq_source_id, level,
line_status);
if (kvm_msi_route_invalid(kvm, e)) case KVM_IRQ_ROUTING_MSI:
return -EINVAL; if (kvm_msi_route_invalid(kvm, e))
return -EINVAL;
kvm_set_msi_irq(kvm, e, &irq); kvm_set_msi_irq(kvm, e, &irq);
if (kvm_irq_delivery_to_apic_fast(kvm, NULL, &irq, &r, NULL)) if (kvm_irq_delivery_to_apic_fast(kvm, NULL, &irq, &r, NULL))
return r; return r;
else break;
return -EWOULDBLOCK;
default:
break;
}
return -EWOULDBLOCK;
} }
int kvm_request_irq_source_id(struct kvm *kvm) int kvm_request_irq_source_id(struct kvm *kvm)
@ -254,16 +272,6 @@ void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
srcu_read_unlock(&kvm->irq_srcu, idx); srcu_read_unlock(&kvm->irq_srcu, idx);
} }
static int kvm_hv_set_sint(struct kvm_kernel_irq_routing_entry *e,
struct kvm *kvm, int irq_source_id, int level,
bool line_status)
{
if (!level)
return -1;
return kvm_hv_synic_set_irq(kvm, e->hv_sint.vcpu, e->hv_sint.sint);
}
int kvm_set_routing_entry(struct kvm *kvm, int kvm_set_routing_entry(struct kvm *kvm,
struct kvm_kernel_irq_routing_entry *e, struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue) const struct kvm_irq_routing_entry *ue)
@ -423,18 +431,6 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu,
srcu_read_unlock(&kvm->irq_srcu, idx); srcu_read_unlock(&kvm->irq_srcu, idx);
} }
int kvm_arch_set_irq(struct kvm_kernel_irq_routing_entry *irq, struct kvm *kvm,
int irq_source_id, int level, bool line_status)
{
switch (irq->type) {
case KVM_IRQ_ROUTING_HV_SINT:
return kvm_hv_set_sint(irq, kvm, irq_source_id, level,
line_status);
default:
return -EWOULDBLOCK;
}
}
void kvm_arch_irq_routing_update(struct kvm *kvm) void kvm_arch_irq_routing_update(struct kvm *kvm)
{ {
kvm_hv_irq_routing_update(kvm); kvm_hv_irq_routing_update(kvm);

View file

@ -210,7 +210,18 @@ static void kvm_on_user_return(struct user_return_notifier *urn)
struct kvm_shared_msrs *locals struct kvm_shared_msrs *locals
= container_of(urn, struct kvm_shared_msrs, urn); = container_of(urn, struct kvm_shared_msrs, urn);
struct kvm_shared_msr_values *values; struct kvm_shared_msr_values *values;
unsigned long flags;
/*
* Disabling irqs at this point since the following code could be
* interrupted and executed through kvm_arch_hardware_disable()
*/
local_irq_save(flags);
if (locals->registered) {
locals->registered = false;
user_return_notifier_unregister(urn);
}
local_irq_restore(flags);
for (slot = 0; slot < shared_msrs_global.nr; ++slot) { for (slot = 0; slot < shared_msrs_global.nr; ++slot) {
values = &locals->values[slot]; values = &locals->values[slot];
if (values->host != values->curr) { if (values->host != values->curr) {
@ -218,8 +229,6 @@ static void kvm_on_user_return(struct user_return_notifier *urn)
values->curr = values->host; values->curr = values->host;
} }
} }
locals->registered = false;
user_return_notifier_unregister(urn);
} }
static void shared_msr_update(unsigned slot, u32 msr) static void shared_msr_update(unsigned slot, u32 msr)
@ -1724,18 +1733,23 @@ static void kvm_gen_update_masterclock(struct kvm *kvm)
static u64 __get_kvmclock_ns(struct kvm *kvm) static u64 __get_kvmclock_ns(struct kvm *kvm)
{ {
struct kvm_vcpu *vcpu = kvm_get_vcpu(kvm, 0);
struct kvm_arch *ka = &kvm->arch; struct kvm_arch *ka = &kvm->arch;
s64 ns; struct pvclock_vcpu_time_info hv_clock;
if (vcpu->arch.hv_clock.flags & PVCLOCK_TSC_STABLE_BIT) { spin_lock(&ka->pvclock_gtod_sync_lock);
u64 tsc = kvm_read_l1_tsc(vcpu, rdtsc()); if (!ka->use_master_clock) {
ns = __pvclock_read_cycles(&vcpu->arch.hv_clock, tsc); spin_unlock(&ka->pvclock_gtod_sync_lock);
} else { return ktime_get_boot_ns() + ka->kvmclock_offset;
ns = ktime_get_boot_ns() + ka->kvmclock_offset;
} }
return ns; hv_clock.tsc_timestamp = ka->master_cycle_now;
hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
spin_unlock(&ka->pvclock_gtod_sync_lock);
kvm_get_time_scale(NSEC_PER_SEC, __this_cpu_read(cpu_tsc_khz) * 1000LL,
&hv_clock.tsc_shift,
&hv_clock.tsc_to_system_mul);
return __pvclock_read_cycles(&hv_clock, rdtsc());
} }
u64 get_kvmclock_ns(struct kvm *kvm) u64 get_kvmclock_ns(struct kvm *kvm)
@ -2596,7 +2610,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_PIT_STATE2: case KVM_CAP_PIT_STATE2:
case KVM_CAP_SET_IDENTITY_MAP_ADDR: case KVM_CAP_SET_IDENTITY_MAP_ADDR:
case KVM_CAP_XEN_HVM: case KVM_CAP_XEN_HVM:
case KVM_CAP_ADJUST_CLOCK:
case KVM_CAP_VCPU_EVENTS: case KVM_CAP_VCPU_EVENTS:
case KVM_CAP_HYPERV: case KVM_CAP_HYPERV:
case KVM_CAP_HYPERV_VAPIC: case KVM_CAP_HYPERV_VAPIC:
@ -2623,6 +2636,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
#endif #endif
r = 1; r = 1;
break; break;
case KVM_CAP_ADJUST_CLOCK:
r = KVM_CLOCK_TSC_STABLE;
break;
case KVM_CAP_X86_SMM: case KVM_CAP_X86_SMM:
/* SMBASE is usually relocated above 1M on modern chipsets, /* SMBASE is usually relocated above 1M on modern chipsets,
* and SMM handlers might indeed rely on 4G segment limits, * and SMM handlers might indeed rely on 4G segment limits,
@ -3415,6 +3431,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
}; };
case KVM_SET_VAPIC_ADDR: { case KVM_SET_VAPIC_ADDR: {
struct kvm_vapic_addr va; struct kvm_vapic_addr va;
int idx;
r = -EINVAL; r = -EINVAL;
if (!lapic_in_kernel(vcpu)) if (!lapic_in_kernel(vcpu))
@ -3422,7 +3439,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&va, argp, sizeof va)) if (copy_from_user(&va, argp, sizeof va))
goto out; goto out;
idx = srcu_read_lock(&vcpu->kvm->srcu);
r = kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr); r = kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr);
srcu_read_unlock(&vcpu->kvm->srcu, idx);
break; break;
} }
case KVM_X86_SETUP_MCE: { case KVM_X86_SETUP_MCE: {
@ -4103,9 +4122,11 @@ long kvm_arch_vm_ioctl(struct file *filp,
struct kvm_clock_data user_ns; struct kvm_clock_data user_ns;
u64 now_ns; u64 now_ns;
now_ns = get_kvmclock_ns(kvm); local_irq_disable();
now_ns = __get_kvmclock_ns(kvm);
user_ns.clock = now_ns; user_ns.clock = now_ns;
user_ns.flags = 0; user_ns.flags = kvm->arch.use_master_clock ? KVM_CLOCK_TSC_STABLE : 0;
local_irq_enable();
memset(&user_ns.pad, 0, sizeof(user_ns.pad)); memset(&user_ns.pad, 0, sizeof(user_ns.pad));
r = -EFAULT; r = -EFAULT;

View file

@ -861,7 +861,7 @@ static void __init __efi_enter_virtual_mode(void)
int count = 0, pg_shift = 0; int count = 0, pg_shift = 0;
void *new_memmap = NULL; void *new_memmap = NULL;
efi_status_t status; efi_status_t status;
phys_addr_t pa; unsigned long pa;
efi.systab = NULL; efi.systab = NULL;

View file

@ -31,6 +31,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ucs2_string.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/page.h> #include <asm/page.h>
@ -211,6 +212,35 @@ void efi_sync_low_kernel_mappings(void)
memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries); memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries);
} }
/*
* Wrapper for slow_virt_to_phys() that handles NULL addresses.
*/
static inline phys_addr_t
virt_to_phys_or_null_size(void *va, unsigned long size)
{
bool bad_size;
if (!va)
return 0;
if (virt_addr_valid(va))
return virt_to_phys(va);
/*
* A fully aligned variable on the stack is guaranteed not to
* cross a page bounary. Try to catch strings on the stack by
* checking that 'size' is a power of two.
*/
bad_size = size > PAGE_SIZE || !is_power_of_2(size);
WARN_ON(!IS_ALIGNED((unsigned long)va, size) || bad_size);
return slow_virt_to_phys(va);
}
#define virt_to_phys_or_null(addr) \
virt_to_phys_or_null_size((addr), sizeof(*(addr)))
int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
{ {
unsigned long pfn, text; unsigned long pfn, text;
@ -494,8 +524,8 @@ static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
spin_lock(&rtc_lock); spin_lock(&rtc_lock);
phys_tm = virt_to_phys(tm); phys_tm = virt_to_phys_or_null(tm);
phys_tc = virt_to_phys(tc); phys_tc = virt_to_phys_or_null(tc);
status = efi_thunk(get_time, phys_tm, phys_tc); status = efi_thunk(get_time, phys_tm, phys_tc);
@ -511,7 +541,7 @@ static efi_status_t efi_thunk_set_time(efi_time_t *tm)
spin_lock(&rtc_lock); spin_lock(&rtc_lock);
phys_tm = virt_to_phys(tm); phys_tm = virt_to_phys_or_null(tm);
status = efi_thunk(set_time, phys_tm); status = efi_thunk(set_time, phys_tm);
@ -529,9 +559,9 @@ efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
spin_lock(&rtc_lock); spin_lock(&rtc_lock);
phys_enabled = virt_to_phys(enabled); phys_enabled = virt_to_phys_or_null(enabled);
phys_pending = virt_to_phys(pending); phys_pending = virt_to_phys_or_null(pending);
phys_tm = virt_to_phys(tm); phys_tm = virt_to_phys_or_null(tm);
status = efi_thunk(get_wakeup_time, phys_enabled, status = efi_thunk(get_wakeup_time, phys_enabled,
phys_pending, phys_tm); phys_pending, phys_tm);
@ -549,7 +579,7 @@ efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
spin_lock(&rtc_lock); spin_lock(&rtc_lock);
phys_tm = virt_to_phys(tm); phys_tm = virt_to_phys_or_null(tm);
status = efi_thunk(set_wakeup_time, enabled, phys_tm); status = efi_thunk(set_wakeup_time, enabled, phys_tm);
@ -558,6 +588,10 @@ efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
return status; return status;
} }
static unsigned long efi_name_size(efi_char16_t *name)
{
return ucs2_strsize(name, EFI_VAR_NAME_LEN) + 1;
}
static efi_status_t static efi_status_t
efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor, efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
@ -567,11 +601,11 @@ efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
u32 phys_name, phys_vendor, phys_attr; u32 phys_name, phys_vendor, phys_attr;
u32 phys_data_size, phys_data; u32 phys_data_size, phys_data;
phys_data_size = virt_to_phys(data_size); phys_data_size = virt_to_phys_or_null(data_size);
phys_vendor = virt_to_phys(vendor); phys_vendor = virt_to_phys_or_null(vendor);
phys_name = virt_to_phys(name); phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
phys_attr = virt_to_phys(attr); phys_attr = virt_to_phys_or_null(attr);
phys_data = virt_to_phys(data); phys_data = virt_to_phys_or_null_size(data, *data_size);
status = efi_thunk(get_variable, phys_name, phys_vendor, status = efi_thunk(get_variable, phys_name, phys_vendor,
phys_attr, phys_data_size, phys_data); phys_attr, phys_data_size, phys_data);
@ -586,9 +620,9 @@ efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
u32 phys_name, phys_vendor, phys_data; u32 phys_name, phys_vendor, phys_data;
efi_status_t status; efi_status_t status;
phys_name = virt_to_phys(name); phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
phys_vendor = virt_to_phys(vendor); phys_vendor = virt_to_phys_or_null(vendor);
phys_data = virt_to_phys(data); phys_data = virt_to_phys_or_null_size(data, data_size);
/* If data_size is > sizeof(u32) we've got problems */ /* If data_size is > sizeof(u32) we've got problems */
status = efi_thunk(set_variable, phys_name, phys_vendor, status = efi_thunk(set_variable, phys_name, phys_vendor,
@ -605,9 +639,9 @@ efi_thunk_get_next_variable(unsigned long *name_size,
efi_status_t status; efi_status_t status;
u32 phys_name_size, phys_name, phys_vendor; u32 phys_name_size, phys_name, phys_vendor;
phys_name_size = virt_to_phys(name_size); phys_name_size = virt_to_phys_or_null(name_size);
phys_vendor = virt_to_phys(vendor); phys_vendor = virt_to_phys_or_null(vendor);
phys_name = virt_to_phys(name); phys_name = virt_to_phys_or_null_size(name, *name_size);
status = efi_thunk(get_next_variable, phys_name_size, status = efi_thunk(get_next_variable, phys_name_size,
phys_name, phys_vendor); phys_name, phys_vendor);
@ -621,7 +655,7 @@ efi_thunk_get_next_high_mono_count(u32 *count)
efi_status_t status; efi_status_t status;
u32 phys_count; u32 phys_count;
phys_count = virt_to_phys(count); phys_count = virt_to_phys_or_null(count);
status = efi_thunk(get_next_high_mono_count, phys_count); status = efi_thunk(get_next_high_mono_count, phys_count);
return status; return status;
@ -633,7 +667,7 @@ efi_thunk_reset_system(int reset_type, efi_status_t status,
{ {
u32 phys_data; u32 phys_data;
phys_data = virt_to_phys(data); phys_data = virt_to_phys_or_null_size(data, data_size);
efi_thunk(reset_system, reset_type, status, data_size, phys_data); efi_thunk(reset_system, reset_type, status, data_size, phys_data);
} }
@ -661,9 +695,9 @@ efi_thunk_query_variable_info(u32 attr, u64 *storage_space,
if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION)
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
phys_storage = virt_to_phys(storage_space); phys_storage = virt_to_phys_or_null(storage_space);
phys_remaining = virt_to_phys(remaining_space); phys_remaining = virt_to_phys_or_null(remaining_space);
phys_max = virt_to_phys(max_variable_size); phys_max = virt_to_phys_or_null(max_variable_size);
status = efi_thunk(query_variable_info, attr, phys_storage, status = efi_thunk(query_variable_info, attr, phys_storage,
phys_remaining, phys_max); phys_remaining, phys_max);

View file

@ -272,6 +272,25 @@ int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state)
} }
EXPORT_SYMBOL_GPL(intel_mid_pci_set_power_state); EXPORT_SYMBOL_GPL(intel_mid_pci_set_power_state);
pci_power_t intel_mid_pci_get_power_state(struct pci_dev *pdev)
{
struct mid_pwr *pwr = midpwr;
int id, reg, bit;
u32 power;
if (!pwr || !pwr->available)
return PCI_UNKNOWN;
id = intel_mid_pwr_get_lss_id(pdev);
if (id < 0)
return PCI_UNKNOWN;
reg = (id * LSS_PWS_BITS) / 32;
bit = (id * LSS_PWS_BITS) % 32;
power = mid_pwr_get_state(pwr, reg);
return (__force pci_power_t)((power >> bit) & 3);
}
void intel_mid_pwr_power_off(void) void intel_mid_pwr_power_off(void)
{ {
struct mid_pwr *pwr = midpwr; struct mid_pwr *pwr = midpwr;

View file

@ -16,6 +16,7 @@ KCOV_INSTRUMENT := n
KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large
KBUILD_CFLAGS += -m$(BITS) KBUILD_CFLAGS += -m$(BITS)
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
$(call if_changed,ld) $(call if_changed,ld)

View file

@ -767,7 +767,14 @@ __SYSCALL(346, sys_preadv2, 6)
#define __NR_pwritev2 347 #define __NR_pwritev2 347
__SYSCALL(347, sys_pwritev2, 6) __SYSCALL(347, sys_pwritev2, 6)
#define __NR_syscall_count 348 #define __NR_pkey_mprotect 348
__SYSCALL(348, sys_pkey_mprotect, 4)
#define __NR_pkey_alloc 349
__SYSCALL(349, sys_pkey_alloc, 2)
#define __NR_pkey_free 350
__SYSCALL(350, sys_pkey_free, 1)
#define __NR_syscall_count 351
/* /*
* sysxtensa syscall handler * sysxtensa syscall handler

View file

@ -172,10 +172,11 @@ void __init time_init(void)
{ {
of_clk_init(NULL); of_clk_init(NULL);
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
printk("Calibrating CPU frequency "); pr_info("Calibrating CPU frequency ");
calibrate_ccount(); calibrate_ccount();
printk("%d.%02d MHz\n", (int)ccount_freq/1000000, pr_cont("%d.%02d MHz\n",
(int)(ccount_freq/10000)%100); (int)ccount_freq / 1000000,
(int)(ccount_freq / 10000) % 100);
#else #else
ccount_freq = CONFIG_XTENSA_CPU_CLOCK*1000000UL; ccount_freq = CONFIG_XTENSA_CPU_CLOCK*1000000UL;
#endif #endif
@ -210,9 +211,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
void calibrate_delay(void) void calibrate_delay(void)
{ {
loops_per_jiffy = ccount_freq / HZ; loops_per_jiffy = ccount_freq / HZ;
printk("Calibrating delay loop (skipped)... " pr_info("Calibrating delay loop (skipped)... %lu.%02lu BogoMIPS preset\n",
"%lu.%02lu BogoMIPS preset\n", loops_per_jiffy / (1000000 / HZ),
loops_per_jiffy/(1000000/HZ), (loops_per_jiffy / (10000 / HZ)) % 100);
(loops_per_jiffy/(10000/HZ)) % 100);
} }
#endif #endif

View file

@ -465,26 +465,25 @@ void show_regs(struct pt_regs * regs)
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
if ((i % 8) == 0) if ((i % 8) == 0)
printk(KERN_INFO "a%02d:", i); pr_info("a%02d:", i);
printk(KERN_CONT " %08lx", regs->areg[i]); pr_cont(" %08lx", regs->areg[i]);
} }
printk(KERN_CONT "\n"); pr_cont("\n");
pr_info("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n",
printk("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n", regs->pc, regs->ps, regs->depc, regs->excvaddr);
regs->pc, regs->ps, regs->depc, regs->excvaddr); pr_info("lbeg: %08lx, lend: %08lx lcount: %08lx, sar: %08lx\n",
printk("lbeg: %08lx, lend: %08lx lcount: %08lx, sar: %08lx\n", regs->lbeg, regs->lend, regs->lcount, regs->sar);
regs->lbeg, regs->lend, regs->lcount, regs->sar);
if (user_mode(regs)) if (user_mode(regs))
printk("wb: %08lx, ws: %08lx, wmask: %08lx, syscall: %ld\n", pr_cont("wb: %08lx, ws: %08lx, wmask: %08lx, syscall: %ld\n",
regs->windowbase, regs->windowstart, regs->wmask, regs->windowbase, regs->windowstart, regs->wmask,
regs->syscall); regs->syscall);
} }
static int show_trace_cb(struct stackframe *frame, void *data) static int show_trace_cb(struct stackframe *frame, void *data)
{ {
if (kernel_text_address(frame->pc)) { if (kernel_text_address(frame->pc)) {
printk(" [<%08lx>] ", frame->pc); pr_cont(" [<%08lx>]", frame->pc);
print_symbol("%s\n", frame->pc); print_symbol(" %s\n", frame->pc);
} }
return 0; return 0;
} }
@ -494,19 +493,13 @@ void show_trace(struct task_struct *task, unsigned long *sp)
if (!sp) if (!sp)
sp = stack_pointer(task); sp = stack_pointer(task);
printk("Call Trace:"); pr_info("Call Trace:\n");
#ifdef CONFIG_KALLSYMS
printk("\n");
#endif
walk_stackframe(sp, show_trace_cb, NULL); walk_stackframe(sp, show_trace_cb, NULL);
printk("\n"); #ifndef CONFIG_KALLSYMS
pr_cont("\n");
#endif
} }
/*
* This routine abuses get_user()/put_user() to reference pointers
* with at least a bit of error checking ...
*/
static int kstack_depth_to_print = 24; static int kstack_depth_to_print = 24;
void show_stack(struct task_struct *task, unsigned long *sp) void show_stack(struct task_struct *task, unsigned long *sp)
@ -518,52 +511,29 @@ void show_stack(struct task_struct *task, unsigned long *sp)
sp = stack_pointer(task); sp = stack_pointer(task);
stack = sp; stack = sp;
printk("\nStack: "); pr_info("Stack:\n");
for (i = 0; i < kstack_depth_to_print; i++) { for (i = 0; i < kstack_depth_to_print; i++) {
if (kstack_end(sp)) if (kstack_end(sp))
break; break;
if (i && ((i % 8) == 0)) pr_cont(" %08lx", *sp++);
printk("\n "); if (i % 8 == 7)
printk("%08lx ", *sp++); pr_cont("\n");
} }
printk("\n");
show_trace(task, stack); show_trace(task, stack);
} }
void show_code(unsigned int *pc)
{
long i;
printk("\nCode:");
for(i = -3 ; i < 6 ; i++) {
unsigned long insn;
if (__get_user(insn, pc + i)) {
printk(" (Bad address in pc)\n");
break;
}
printk("%c%08lx%c",(i?' ':'<'),insn,(i?' ':'>'));
}
}
DEFINE_SPINLOCK(die_lock); DEFINE_SPINLOCK(die_lock);
void die(const char * str, struct pt_regs * regs, long err) void die(const char * str, struct pt_regs * regs, long err)
{ {
static int die_counter; static int die_counter;
int nl = 0;
console_verbose(); console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
printk("%s: sig: %ld [#%d]\n", str, err, ++die_counter); pr_info("%s: sig: %ld [#%d]%s\n", str, err, ++die_counter,
#ifdef CONFIG_PREEMPT IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "");
printk("PREEMPT ");
nl = 1;
#endif
if (nl)
printk("\n");
show_regs(regs); show_regs(regs);
if (!user_mode(regs)) if (!user_mode(regs))
show_stack(NULL, (unsigned long*)regs->areg[1]); show_stack(NULL, (unsigned long*)regs->areg[1]);

View file

@ -214,23 +214,26 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0);
if (ctx->more) { if (!result) {
err = af_alg_wait_for_completion(
crypto_ahash_init(&ctx->req),
&ctx->completion);
if (err)
goto unlock;
}
if (!result || ctx->more) {
ctx->more = 0; ctx->more = 0;
err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req), err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req),
&ctx->completion); &ctx->completion);
if (err) if (err)
goto unlock; goto unlock;
} else if (!result) {
err = af_alg_wait_for_completion(
crypto_ahash_digest(&ctx->req),
&ctx->completion);
} }
err = memcpy_to_msg(msg, ctx->result, len); err = memcpy_to_msg(msg, ctx->result, len);
hash_free_result(sk, ctx);
unlock: unlock:
hash_free_result(sk, ctx);
release_sock(sk); release_sock(sk);
return err ?: len; return err ?: len;

View file

@ -480,19 +480,17 @@ static void acpi_tb_convert_fadt(void)
u32 i; u32 i;
/* /*
* For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that * should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields. * inadvertently place values in these fields.
* *
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located * The ACPI 1.0 reserved fields that will be zeroed are the bytes located
* at offset 45, 55, 95, and the word located at offset 109, 110. * at offset 45, 55, 95, and the word located at offset 109, 110.
* *
* Note: The FADT revision value is unreliable because of BIOS errors. * Note: The FADT revision value is unreliable. Only the length can be
* The table length is instead used as the final word on the version. * trusted.
*
* Note: FADT revision 3 is the ACPI 2.0 version of the FADT.
*/ */
if (acpi_gbl_FADT.header.length <= ACPI_FADT_V3_SIZE) { if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {
acpi_gbl_FADT.preferred_profile = 0; acpi_gbl_FADT.preferred_profile = 0;
acpi_gbl_FADT.pstate_control = 0; acpi_gbl_FADT.pstate_control = 0;
acpi_gbl_FADT.cst_control = 0; acpi_gbl_FADT.cst_control = 0;

View file

@ -484,7 +484,7 @@ static int bt_bmc_remove(struct platform_device *pdev)
} }
static const struct of_device_id bt_bmc_match[] = { static const struct of_device_id bt_bmc_match[] = {
{ .compatible = "aspeed,ast2400-bt-bmc" }, { .compatible = "aspeed,ast2400-ibt-bmc" },
{ }, { },
}; };
@ -502,4 +502,4 @@ module_platform_driver(bt_bmc_driver);
MODULE_DEVICE_TABLE(of, bt_bmc_match); MODULE_DEVICE_TABLE(of, bt_bmc_match);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alistair Popple <alistair@popple.id.au>"); MODULE_AUTHOR("Alistair Popple <alistair@popple.id.au>");
MODULE_DESCRIPTION("Linux device interface to the BT interface"); MODULE_DESCRIPTION("Linux device interface to the IPMI BT interface");

View file

@ -137,7 +137,7 @@ static void dbg_dump_sg(const char *level, const char *prefix_str,
} }
buf = it_page + it->offset; buf = it_page + it->offset;
len = min(tlen, it->length); len = min_t(size_t, tlen, it->length);
print_hex_dump(level, prefix_str, prefix_type, rowsize, print_hex_dump(level, prefix_str, prefix_type, rowsize,
groupsize, buf, len, ascii); groupsize, buf, len, ascii);
tlen -= len; tlen -= len;
@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void)
if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES)) if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
continue; continue;
/*
* Check support for AES modes not available
* on LP devices.
*/
if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
OP_ALG_AAI_XTS)
continue;
t_alg = caam_alg_alloc(alg); t_alg = caam_alg_alloc(alg);
if (IS_ERR(t_alg)) { if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg); err = PTR_ERR(t_alg);

View file

@ -306,6 +306,7 @@ config MMP_TDMA
depends on ARCH_MMP || COMPILE_TEST depends on ARCH_MMP || COMPILE_TEST
select DMA_ENGINE select DMA_ENGINE
select MMP_SRAM if ARCH_MMP select MMP_SRAM if ARCH_MMP
select GENERIC_ALLOCATOR
help help
Support the MMP Two-Channel DMA engine. Support the MMP Two-Channel DMA engine.
This engine used for MMP Audio DMA and pxa910 SQU. This engine used for MMP Audio DMA and pxa910 SQU.

View file

@ -317,6 +317,12 @@ static irqreturn_t cppi41_irq(int irq, void *data)
while (val) { while (val) {
u32 desc, len; u32 desc, len;
int error;
error = pm_runtime_get(cdd->ddev.dev);
if (error < 0)
dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n",
__func__, error);
q_num = __fls(val); q_num = __fls(val);
val &= ~(1 << q_num); val &= ~(1 << q_num);
@ -338,7 +344,6 @@ static irqreturn_t cppi41_irq(int irq, void *data)
dma_cookie_complete(&c->txd); dma_cookie_complete(&c->txd);
dmaengine_desc_get_callback_invoke(&c->txd, NULL); dmaengine_desc_get_callback_invoke(&c->txd, NULL);
/* Paired with cppi41_dma_issue_pending */
pm_runtime_mark_last_busy(cdd->ddev.dev); pm_runtime_mark_last_busy(cdd->ddev.dev);
pm_runtime_put_autosuspend(cdd->ddev.dev); pm_runtime_put_autosuspend(cdd->ddev.dev);
} }
@ -362,8 +367,13 @@ static int cppi41_dma_alloc_chan_resources(struct dma_chan *chan)
int error; int error;
error = pm_runtime_get_sync(cdd->ddev.dev); error = pm_runtime_get_sync(cdd->ddev.dev);
if (error < 0) if (error < 0) {
dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n",
__func__, error);
pm_runtime_put_noidle(cdd->ddev.dev);
return error; return error;
}
dma_cookie_init(chan); dma_cookie_init(chan);
dma_async_tx_descriptor_init(&c->txd, chan); dma_async_tx_descriptor_init(&c->txd, chan);
@ -385,8 +395,11 @@ static void cppi41_dma_free_chan_resources(struct dma_chan *chan)
int error; int error;
error = pm_runtime_get_sync(cdd->ddev.dev); error = pm_runtime_get_sync(cdd->ddev.dev);
if (error < 0) if (error < 0) {
pm_runtime_put_noidle(cdd->ddev.dev);
return; return;
}
WARN_ON(!list_empty(&cdd->pending)); WARN_ON(!list_empty(&cdd->pending));
@ -460,9 +473,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan)
struct cppi41_dd *cdd = c->cdd; struct cppi41_dd *cdd = c->cdd;
int error; int error;
/* PM runtime paired with dmaengine_desc_get_callback_invoke */
error = pm_runtime_get(cdd->ddev.dev); error = pm_runtime_get(cdd->ddev.dev);
if ((error != -EINPROGRESS) && error < 0) { if ((error != -EINPROGRESS) && error < 0) {
pm_runtime_put_noidle(cdd->ddev.dev);
dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n", dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n",
error); error);
@ -473,6 +486,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan)
push_desc_queue(c); push_desc_queue(c);
else else
pending_desc(c); pending_desc(c);
pm_runtime_mark_last_busy(cdd->ddev.dev);
pm_runtime_put_autosuspend(cdd->ddev.dev);
} }
static u32 get_host_pd0(u32 length) static u32 get_host_pd0(u32 length)
@ -1059,8 +1075,8 @@ err_chans:
deinit_cppi41(dev, cdd); deinit_cppi41(dev, cdd);
err_init_cppi: err_init_cppi:
pm_runtime_dont_use_autosuspend(dev); pm_runtime_dont_use_autosuspend(dev);
pm_runtime_put_sync(dev);
err_get_sync: err_get_sync:
pm_runtime_put_sync(dev);
pm_runtime_disable(dev); pm_runtime_disable(dev);
iounmap(cdd->usbss_mem); iounmap(cdd->usbss_mem);
iounmap(cdd->ctrl_mem); iounmap(cdd->ctrl_mem);
@ -1072,7 +1088,12 @@ err_get_sync:
static int cppi41_dma_remove(struct platform_device *pdev) static int cppi41_dma_remove(struct platform_device *pdev)
{ {
struct cppi41_dd *cdd = platform_get_drvdata(pdev); struct cppi41_dd *cdd = platform_get_drvdata(pdev);
int error;
error = pm_runtime_get_sync(&pdev->dev);
if (error < 0)
dev_err(&pdev->dev, "%s could not pm_runtime_get: %i\n",
__func__, error);
of_dma_controller_free(pdev->dev.of_node); of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&cdd->ddev); dma_async_device_unregister(&cdd->ddev);

View file

@ -1628,6 +1628,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)
if (echan->slot[0] < 0) { if (echan->slot[0] < 0) {
dev_err(dev, "Entry slot allocation failed for channel %u\n", dev_err(dev, "Entry slot allocation failed for channel %u\n",
EDMA_CHAN_SLOT(echan->ch_num)); EDMA_CHAN_SLOT(echan->ch_num));
ret = echan->slot[0];
goto err_slot; goto err_slot;
} }

View file

@ -578,7 +578,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_dma_memcpy(
burst = convert_burst(8); burst = convert_burst(8);
width = convert_buswidth(DMA_SLAVE_BUSWIDTH_4_BYTES); width = convert_buswidth(DMA_SLAVE_BUSWIDTH_4_BYTES);
v_lli->cfg |= DMA_CHAN_CFG_SRC_DRQ(DRQ_SDRAM) | v_lli->cfg = DMA_CHAN_CFG_SRC_DRQ(DRQ_SDRAM) |
DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) | DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) |
DMA_CHAN_CFG_DST_LINEAR_MODE | DMA_CHAN_CFG_DST_LINEAR_MODE |
DMA_CHAN_CFG_SRC_LINEAR_MODE | DMA_CHAN_CFG_SRC_LINEAR_MODE |

View file

@ -22,10 +22,6 @@ menuconfig GPIOLIB
if GPIOLIB if GPIOLIB
config GPIO_DEVRES
def_bool y
depends on HAS_IOMEM
config OF_GPIO config OF_GPIO
def_bool y def_bool y
depends on OF depends on OF

View file

@ -2,7 +2,7 @@
ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG
obj-$(CONFIG_GPIO_DEVRES) += devres.o obj-$(CONFIG_GPIOLIB) += devres.o
obj-$(CONFIG_GPIOLIB) += gpiolib.o obj-$(CONFIG_GPIOLIB) += gpiolib.o
obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o
obj-$(CONFIG_OF_GPIO) += gpiolib-of.o obj-$(CONFIG_OF_GPIO) += gpiolib-of.o

View file

@ -372,14 +372,15 @@ static void pca953x_gpio_set_multiple(struct gpio_chip *gc,
bank_shift = fls((chip->gpio_chip.ngpio - 1) / BANK_SZ); bank_shift = fls((chip->gpio_chip.ngpio - 1) / BANK_SZ);
memcpy(reg_val, chip->reg_output, NBANK(chip));
mutex_lock(&chip->i2c_lock); mutex_lock(&chip->i2c_lock);
memcpy(reg_val, chip->reg_output, NBANK(chip));
for (bank = 0; bank < NBANK(chip); bank++) { for (bank = 0; bank < NBANK(chip); bank++) {
bank_mask = mask[bank / sizeof(*mask)] >> bank_mask = mask[bank / sizeof(*mask)] >>
((bank % sizeof(*mask)) * 8); ((bank % sizeof(*mask)) * 8);
if (bank_mask) { if (bank_mask) {
bank_val = bits[bank / sizeof(*bits)] >> bank_val = bits[bank / sizeof(*bits)] >>
((bank % sizeof(*bits)) * 8); ((bank % sizeof(*bits)) * 8);
bank_val &= bank_mask;
reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val; reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val;
} }
} }
@ -607,7 +608,6 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
if (client->irq && irq_base != -1 if (client->irq && irq_base != -1
&& (chip->driver_data & PCA_INT)) { && (chip->driver_data & PCA_INT)) {
ret = pca953x_read_regs(chip, ret = pca953x_read_regs(chip,
chip->regs->input, chip->irq_stat); chip->regs->input, chip->irq_stat);
if (ret) if (ret)

View file

@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip,
if (ret < 0) if (ret < 0)
return ret; return ret;
return !!(ret & BIT(pos)); return !(ret & BIT(pos));
} }
static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip, static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip,

View file

@ -2737,8 +2737,11 @@ int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset)
if (IS_ERR(desc)) if (IS_ERR(desc))
return PTR_ERR(desc); return PTR_ERR(desc);
/* Flush direction if something changed behind our back */ /*
if (chip->get_direction) { * If it's fast: flush the direction setting if something changed
* behind our back
*/
if (!chip->can_sleep && chip->get_direction) {
int dir = chip->get_direction(chip, offset); int dir = chip->get_direction(chip, offset);
if (dir) if (dir)

View file

@ -459,6 +459,7 @@ struct amdgpu_bo {
u64 metadata_flags; u64 metadata_flags;
void *metadata; void *metadata;
u32 metadata_size; u32 metadata_size;
unsigned prime_shared_count;
/* list of all virtual address to which this bo /* list of all virtual address to which this bo
* is associated to * is associated to
*/ */

View file

@ -132,7 +132,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
entry->priority = min(info[i].bo_priority, entry->priority = min(info[i].bo_priority,
AMDGPU_BO_LIST_MAX_PRIORITY); AMDGPU_BO_LIST_MAX_PRIORITY);
entry->tv.bo = &entry->robj->tbo; entry->tv.bo = &entry->robj->tbo;
entry->tv.shared = true; entry->tv.shared = !entry->robj->prime_shared_count;
if (entry->robj->prefered_domains == AMDGPU_GEM_DOMAIN_GDS) if (entry->robj->prefered_domains == AMDGPU_GEM_DOMAIN_GDS)
gds_obj = entry->robj; gds_obj = entry->robj;

View file

@ -658,12 +658,10 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
return false; return false;
if (amdgpu_passthrough(adev)) { if (amdgpu_passthrough(adev)) {
/* for FIJI: In whole GPU pass-through virtualization case /* for FIJI: In whole GPU pass-through virtualization case, after VM reboot
* old smc fw won't clear some registers (e.g. MEM_SIZE, BIOS_SCRATCH) * some old smc fw still need driver do vPost otherwise gpu hang, while
* so amdgpu_card_posted return false and driver will incorrectly skip vPost. * those smc fw version above 22.15 doesn't have this flaw, so we force
* but if we force vPost do in pass-through case, the driver reload will hang. * vpost executed for smc version below 22.15
* whether doing vPost depends on amdgpu_card_posted if smc version is above
* 00160e00 for FIJI.
*/ */
if (adev->asic_type == CHIP_FIJI) { if (adev->asic_type == CHIP_FIJI) {
int err; int err;
@ -674,22 +672,11 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
return true; return true;
fw_ver = *((uint32_t *)adev->pm.fw->data + 69); fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
if (fw_ver >= 0x00160e00) if (fw_ver < 0x00160e00)
return !amdgpu_card_posted(adev); return true;
} }
} else {
/* in bare-metal case, amdgpu_card_posted return false
* after system reboot/boot, and return true if driver
* reloaded.
* we shouldn't do vPost after driver reload otherwise GPU
* could hang.
*/
if (amdgpu_card_posted(adev))
return false;
} }
return !amdgpu_card_posted(adev);
/* we assume vPost is neede for all other cases */
return true;
} }
/** /**

View file

@ -74,20 +74,36 @@ amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
bo->prime_shared_count = 1;
return &bo->gem_base; return &bo->gem_base;
} }
int amdgpu_gem_prime_pin(struct drm_gem_object *obj) int amdgpu_gem_prime_pin(struct drm_gem_object *obj)
{ {
struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj); struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
int ret = 0; long ret = 0;
ret = amdgpu_bo_reserve(bo, false); ret = amdgpu_bo_reserve(bo, false);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
return ret; return ret;
/*
* Wait for all shared fences to complete before we switch to future
* use of exclusive fence on this prime shared bo.
*/
ret = reservation_object_wait_timeout_rcu(bo->tbo.resv, true, false,
MAX_SCHEDULE_TIMEOUT);
if (unlikely(ret < 0)) {
DRM_DEBUG_PRIME("Fence wait failed: %li\n", ret);
amdgpu_bo_unreserve(bo);
return ret;
}
/* pin buffer into GTT */ /* pin buffer into GTT */
ret = amdgpu_bo_pin(bo, AMDGPU_GEM_DOMAIN_GTT, NULL); ret = amdgpu_bo_pin(bo, AMDGPU_GEM_DOMAIN_GTT, NULL);
if (likely(ret == 0))
bo->prime_shared_count++;
amdgpu_bo_unreserve(bo); amdgpu_bo_unreserve(bo);
return ret; return ret;
} }
@ -102,6 +118,8 @@ void amdgpu_gem_prime_unpin(struct drm_gem_object *obj)
return; return;
amdgpu_bo_unpin(bo); amdgpu_bo_unpin(bo);
if (bo->prime_shared_count)
bo->prime_shared_count--;
amdgpu_bo_unreserve(bo); amdgpu_bo_unreserve(bo);
} }

View file

@ -1469,8 +1469,6 @@ static int smu7_get_evv_voltages(struct pp_hwmgr *hwmgr)
table_info->vddgfx_lookup_table, vv_id, &sclk)) { table_info->vddgfx_lookup_table, vv_id, &sclk)) {
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_ClockStretcher)) { PHM_PlatformCaps_ClockStretcher)) {
if (table_info == NULL)
return -EINVAL;
sclk_table = table_info->vdd_dep_on_sclk; sclk_table = table_info->vdd_dep_on_sclk;
for (j = 1; j < sclk_table->count; j++) { for (j = 1; j < sclk_table->count; j++) {

View file

@ -14,170 +14,45 @@
* *
*/ */
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc.h>
#include <drm/drm_encoder_slave.h> #include <drm/drm_encoder_slave.h>
#include <drm/drm_atomic_helper.h>
#include "arcpgu.h" #include "arcpgu.h"
struct arcpgu_drm_connector {
struct drm_connector connector;
struct drm_encoder_slave *encoder_slave;
};
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
{
const struct drm_encoder_slave_funcs *sfuncs;
struct drm_encoder_slave *slave;
struct arcpgu_drm_connector *con =
container_of(connector, struct arcpgu_drm_connector, connector);
slave = con->encoder_slave;
if (slave == NULL) {
dev_err(connector->dev->dev,
"connector_get_modes: cannot find slave encoder for connector\n");
return 0;
}
sfuncs = slave->slave_funcs;
if (sfuncs->get_modes == NULL)
return 0;
return sfuncs->get_modes(&slave->base, connector);
}
static enum drm_connector_status
arcpgu_drm_connector_detect(struct drm_connector *connector, bool force)
{
enum drm_connector_status status = connector_status_unknown;
const struct drm_encoder_slave_funcs *sfuncs;
struct drm_encoder_slave *slave;
struct arcpgu_drm_connector *con =
container_of(connector, struct arcpgu_drm_connector, connector);
slave = con->encoder_slave;
if (slave == NULL) {
dev_err(connector->dev->dev,
"connector_detect: cannot find slave encoder for connector\n");
return status;
}
sfuncs = slave->slave_funcs;
if (sfuncs && sfuncs->detect)
return sfuncs->detect(&slave->base, connector);
dev_err(connector->dev->dev, "connector_detect: could not detect slave funcs\n");
return status;
}
static void arcpgu_drm_connector_destroy(struct drm_connector *connector)
{
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
}
static const struct drm_connector_helper_funcs
arcpgu_drm_connector_helper_funcs = {
.get_modes = arcpgu_drm_connector_get_modes,
};
static const struct drm_connector_funcs arcpgu_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.reset = drm_atomic_helper_connector_reset,
.detect = arcpgu_drm_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = arcpgu_drm_connector_destroy,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
};
static struct drm_encoder_helper_funcs arcpgu_drm_encoder_helper_funcs = {
.dpms = drm_i2c_encoder_dpms,
.mode_fixup = drm_i2c_encoder_mode_fixup,
.mode_set = drm_i2c_encoder_mode_set,
.prepare = drm_i2c_encoder_prepare,
.commit = drm_i2c_encoder_commit,
.detect = drm_i2c_encoder_detect,
};
static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
.destroy = drm_encoder_cleanup, .destroy = drm_encoder_cleanup,
}; };
int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np) int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
{ {
struct arcpgu_drm_connector *arcpgu_connector; struct drm_encoder *encoder;
struct drm_i2c_encoder_driver *driver; struct drm_bridge *bridge;
struct drm_encoder_slave *encoder;
struct drm_connector *connector; int ret = 0;
struct i2c_client *i2c_slave;
int ret;
encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL); encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
if (encoder == NULL) if (encoder == NULL)
return -ENOMEM; return -ENOMEM;
i2c_slave = of_find_i2c_device_by_node(np); /* Locate drm bridge from the hdmi encoder DT node */
if (!i2c_slave || !i2c_get_clientdata(i2c_slave)) { bridge = of_drm_find_bridge(np);
dev_err(drm->dev, "failed to find i2c slave encoder\n"); if (!bridge)
return -EPROBE_DEFER; return -EPROBE_DEFER;
}
if (i2c_slave->dev.driver == NULL) { encoder->possible_crtcs = 1;
dev_err(drm->dev, "failed to find i2c slave driver\n"); encoder->possible_clones = 0;
return -EPROBE_DEFER; ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs,
}
driver =
to_drm_i2c_encoder_driver(to_i2c_driver(i2c_slave->dev.driver));
ret = driver->encoder_init(i2c_slave, drm, encoder);
if (ret) {
dev_err(drm->dev, "failed to initialize i2c encoder slave\n");
return ret;
}
encoder->base.possible_crtcs = 1;
encoder->base.possible_clones = 0;
ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL); DRM_MODE_ENCODER_TMDS, NULL);
if (ret) if (ret)
return ret; return ret;
drm_encoder_helper_add(&encoder->base, /* Link drm_bridge to encoder */
&arcpgu_drm_encoder_helper_funcs); bridge->encoder = encoder;
encoder->bridge = bridge;
arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector), ret = drm_bridge_attach(drm, bridge);
GFP_KERNEL); if (ret)
if (!arcpgu_connector) { drm_encoder_cleanup(encoder);
ret = -ENOMEM;
goto error_encoder_cleanup;
}
connector = &arcpgu_connector->connector;
drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,
DRM_MODE_CONNECTOR_HDMIA);
if (ret < 0) {
dev_err(drm->dev, "failed to initialize drm connector\n");
goto error_encoder_cleanup;
}
ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
if (ret < 0) {
dev_err(drm->dev, "could not attach connector to encoder\n");
drm_connector_unregister(connector);
goto error_connector_cleanup;
}
arcpgu_connector->encoder_slave = encoder;
return 0;
error_connector_cleanup:
drm_connector_cleanup(connector);
error_encoder_cleanup:
drm_encoder_cleanup(&encoder->base);
return ret; return ret;
} }

View file

@ -25,8 +25,13 @@
static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc, static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state) struct drm_crtc_state *old_crtc_state)
{ {
struct drm_device *dev = crtc->dev;
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
struct drm_pending_vblank_event *event = crtc->state->event; struct drm_pending_vblank_event *event = crtc->state->event;
regmap_write(fsl_dev->regmap,
DCU_UPDATE_MODE, DCU_UPDATE_MODE_READREG);
if (event) { if (event) {
crtc->state->event = NULL; crtc->state->event = NULL;
@ -39,11 +44,15 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc,
} }
} }
static void fsl_dcu_drm_disable_crtc(struct drm_crtc *crtc) static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
/* always disable planes on the CRTC */
drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true);
drm_crtc_vblank_off(crtc); drm_crtc_vblank_off(crtc);
regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE, regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,
@ -122,8 +131,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
} }
static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = { static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = {
.atomic_disable = fsl_dcu_drm_crtc_atomic_disable,
.atomic_flush = fsl_dcu_drm_crtc_atomic_flush, .atomic_flush = fsl_dcu_drm_crtc_atomic_flush,
.disable = fsl_dcu_drm_disable_crtc,
.enable = fsl_dcu_drm_crtc_enable, .enable = fsl_dcu_drm_crtc_enable,
.mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
}; };

View file

@ -59,8 +59,6 @@ static int fsl_dcu_drm_irq_init(struct drm_device *dev)
regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0); regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0);
regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0); regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0);
regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
DCU_UPDATE_MODE_READREG);
return ret; return ret;
} }
@ -139,8 +137,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
drm_handle_vblank(dev, 0); drm_handle_vblank(dev, 0);
regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status); regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status);
regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
DCU_UPDATE_MODE_READREG);
return IRQ_HANDLED; return IRQ_HANDLED;
} }

View file

@ -160,11 +160,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
DCU_LAYER_POST_SKIP(0) | DCU_LAYER_POST_SKIP(0) |
DCU_LAYER_PRE_SKIP(0)); DCU_LAYER_PRE_SKIP(0));
} }
regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,
DCU_MODE_DCU_MODE_MASK,
DCU_MODE_DCU_MODE(DCU_MODE_NORMAL));
regmap_write(fsl_dev->regmap,
DCU_UPDATE_MODE, DCU_UPDATE_MODE_READREG);
return; return;
} }

View file

@ -1281,6 +1281,12 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file,
return ctx; return ctx;
} }
static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj)
{
return !(obj->cache_level == I915_CACHE_NONE ||
obj->cache_level == I915_CACHE_WT);
}
void i915_vma_move_to_active(struct i915_vma *vma, void i915_vma_move_to_active(struct i915_vma *vma,
struct drm_i915_gem_request *req, struct drm_i915_gem_request *req,
unsigned int flags) unsigned int flags)
@ -1311,6 +1317,8 @@ void i915_vma_move_to_active(struct i915_vma *vma,
/* update for the implicit flush after a batch */ /* update for the implicit flush after a batch */
obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS; obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS;
if (!obj->cache_dirty && gpu_write_needs_clflush(obj))
obj->cache_dirty = true;
} }
if (flags & EXEC_OBJECT_NEEDS_FENCE) if (flags & EXEC_OBJECT_NEEDS_FENCE)

View file

@ -1143,7 +1143,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
if (!child) if (!child)
return; return;
aux_channel = child->raw[25]; aux_channel = child->common.aux_channel;
ddc_pin = child->common.ddc_pin; ddc_pin = child->common.ddc_pin;
is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING; is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
@ -1673,7 +1673,8 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
return false; return false;
} }
bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum port port) static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child,
enum port port)
{ {
static const struct { static const struct {
u16 dp, hdmi; u16 dp, hdmi;
@ -1687,22 +1688,35 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
[PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, }, [PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, },
[PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, }, [PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, },
}; };
int i;
if (port == PORT_A || port >= ARRAY_SIZE(port_mapping)) if (port == PORT_A || port >= ARRAY_SIZE(port_mapping))
return false; return false;
if (!dev_priv->vbt.child_dev_num) if ((p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) !=
(DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
return false; return false;
if (p_child->common.dvo_port == port_mapping[port].dp)
return true;
/* Only accept a HDMI dvo_port as DP++ if it has an AUX channel */
if (p_child->common.dvo_port == port_mapping[port].hdmi &&
p_child->common.aux_channel != 0)
return true;
return false;
}
bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv,
enum port port)
{
int i;
for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
const union child_device_config *p_child = const union child_device_config *p_child =
&dev_priv->vbt.child_dev[i]; &dev_priv->vbt.child_dev[i];
if ((p_child->common.dvo_port == port_mapping[port].dp || if (child_dev_is_dp_dual_mode(p_child, port))
p_child->common.dvo_port == port_mapping[port].hdmi) &&
(p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) ==
(DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
return true; return true;
} }

View file

@ -4463,21 +4463,11 @@ static enum drm_connector_status
intel_dp_detect(struct drm_connector *connector, bool force) intel_dp_detect(struct drm_connector *connector, bool force)
{ {
struct intel_dp *intel_dp = intel_attached_dp(connector); struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct intel_encoder *intel_encoder = &intel_dig_port->base;
enum drm_connector_status status = connector->status; enum drm_connector_status status = connector->status;
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
connector->base.id, connector->name); connector->base.id, connector->name);
if (intel_dp->is_mst) {
/* MST devices are disconnected from a monitor POV */
intel_dp_unset_edid(intel_dp);
if (intel_encoder->type != INTEL_OUTPUT_EDP)
intel_encoder->type = INTEL_OUTPUT_DP;
return connector_status_disconnected;
}
/* If full detect is not performed yet, do a full detect */ /* If full detect is not performed yet, do a full detect */
if (!intel_dp->detect_done) if (!intel_dp->detect_done)
status = intel_dp_long_pulse(intel_dp->attached_connector); status = intel_dp_long_pulse(intel_dp->attached_connector);

View file

@ -358,7 +358,7 @@ vlv_update_plane(struct drm_plane *dplane,
int plane = intel_plane->plane; int plane = intel_plane->plane;
u32 sprctl; u32 sprctl;
u32 sprsurf_offset, linear_offset; u32 sprsurf_offset, linear_offset;
unsigned int rotation = dplane->state->rotation; unsigned int rotation = plane_state->base.rotation;
const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
int crtc_x = plane_state->base.dst.x1; int crtc_x = plane_state->base.dst.x1;
int crtc_y = plane_state->base.dst.y1; int crtc_y = plane_state->base.dst.y1;

View file

@ -280,7 +280,8 @@ struct common_child_dev_config {
u8 dp_support:1; u8 dp_support:1;
u8 tmds_support:1; u8 tmds_support:1;
u8 support_reserved:5; u8 support_reserved:5;
u8 not_common3[12]; u8 aux_channel;
u8 not_common3[11];
u8 iboost_level; u8 iboost_level;
} __packed; } __packed;

View file

@ -80,6 +80,7 @@ static void mtk_ovl_enable_vblank(struct mtk_ddp_comp *comp,
ddp_comp); ddp_comp);
priv->crtc = crtc; priv->crtc = crtc;
writel(0x0, comp->regs + DISP_REG_OVL_INTSTA);
writel_relaxed(OVL_FME_CPL_INT, comp->regs + DISP_REG_OVL_INTEN); writel_relaxed(OVL_FME_CPL_INT, comp->regs + DISP_REG_OVL_INTEN);
} }

View file

@ -432,11 +432,16 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi,
unsigned long pll_rate; unsigned long pll_rate;
unsigned int factor; unsigned int factor;
/* let pll_rate can fix the valid range of tvdpll (1G~2GHz) */
pix_rate = 1000UL * mode->clock; pix_rate = 1000UL * mode->clock;
if (mode->clock <= 74000) if (mode->clock <= 27000)
factor = 16 * 3;
else if (mode->clock <= 84000)
factor = 8 * 3; factor = 8 * 3;
else else if (mode->clock <= 167000)
factor = 4 * 3; factor = 4 * 3;
else
factor = 2 * 3;
pll_rate = pix_rate * factor; pll_rate = pix_rate * factor;
dev_dbg(dpi->dev, "Want PLL %lu Hz, pixel clock %lu Hz\n", dev_dbg(dpi->dev, "Want PLL %lu Hz, pixel clock %lu Hz\n",

View file

@ -1133,12 +1133,6 @@ static int mtk_hdmi_output_set_display_mode(struct mtk_hdmi *hdmi,
phy_power_on(hdmi->phy); phy_power_on(hdmi->phy);
mtk_hdmi_aud_output_config(hdmi, mode); mtk_hdmi_aud_output_config(hdmi, mode);
mtk_hdmi_setup_audio_infoframe(hdmi);
mtk_hdmi_setup_avi_infoframe(hdmi, mode);
mtk_hdmi_setup_spd_infoframe(hdmi, "mediatek", "On-chip HDMI");
if (mode->flags & DRM_MODE_FLAG_3D_MASK)
mtk_hdmi_setup_vendor_specific_infoframe(hdmi, mode);
mtk_hdmi_hw_vid_black(hdmi, false); mtk_hdmi_hw_vid_black(hdmi, false);
mtk_hdmi_hw_aud_unmute(hdmi); mtk_hdmi_hw_aud_unmute(hdmi);
mtk_hdmi_hw_send_av_unmute(hdmi); mtk_hdmi_hw_send_av_unmute(hdmi);
@ -1401,6 +1395,16 @@ static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
hdmi->powered = true; hdmi->powered = true;
} }
static void mtk_hdmi_send_infoframe(struct mtk_hdmi *hdmi,
struct drm_display_mode *mode)
{
mtk_hdmi_setup_audio_infoframe(hdmi);
mtk_hdmi_setup_avi_infoframe(hdmi, mode);
mtk_hdmi_setup_spd_infoframe(hdmi, "mediatek", "On-chip HDMI");
if (mode->flags & DRM_MODE_FLAG_3D_MASK)
mtk_hdmi_setup_vendor_specific_infoframe(hdmi, mode);
}
static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge) static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge)
{ {
struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
@ -1409,6 +1413,7 @@ static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge)
clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL]); clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL]);
clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]); clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]);
phy_power_on(hdmi->phy); phy_power_on(hdmi->phy);
mtk_hdmi_send_infoframe(hdmi, &hdmi->mode);
hdmi->enabled = true; hdmi->enabled = true;
} }

View file

@ -265,6 +265,9 @@ static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate,
struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
unsigned int pre_div; unsigned int pre_div;
unsigned int div; unsigned int div;
unsigned int pre_ibias;
unsigned int hdmi_ibias;
unsigned int imp_en;
dev_dbg(hdmi_phy->dev, "%s: %lu Hz, parent: %lu Hz\n", __func__, dev_dbg(hdmi_phy->dev, "%s: %lu Hz, parent: %lu Hz\n", __func__,
rate, parent_rate); rate, parent_rate);
@ -298,18 +301,31 @@ static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate,
(0x1 << PLL_BR_SHIFT), (0x1 << PLL_BR_SHIFT),
RG_HDMITX_PLL_BP | RG_HDMITX_PLL_BC | RG_HDMITX_PLL_BP | RG_HDMITX_PLL_BC |
RG_HDMITX_PLL_BR); RG_HDMITX_PLL_BR);
mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON3, RG_HDMITX_PRD_IMP_EN); if (rate < 165000000) {
mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON3,
RG_HDMITX_PRD_IMP_EN);
pre_ibias = 0x3;
imp_en = 0x0;
hdmi_ibias = hdmi_phy->ibias;
} else {
mtk_hdmi_phy_set_bits(hdmi_phy, HDMI_CON3,
RG_HDMITX_PRD_IMP_EN);
pre_ibias = 0x6;
imp_en = 0xf;
hdmi_ibias = hdmi_phy->ibias_up;
}
mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON4, mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON4,
(0x3 << PRD_IBIAS_CLK_SHIFT) | (pre_ibias << PRD_IBIAS_CLK_SHIFT) |
(0x3 << PRD_IBIAS_D2_SHIFT) | (pre_ibias << PRD_IBIAS_D2_SHIFT) |
(0x3 << PRD_IBIAS_D1_SHIFT) | (pre_ibias << PRD_IBIAS_D1_SHIFT) |
(0x3 << PRD_IBIAS_D0_SHIFT), (pre_ibias << PRD_IBIAS_D0_SHIFT),
RG_HDMITX_PRD_IBIAS_CLK | RG_HDMITX_PRD_IBIAS_CLK |
RG_HDMITX_PRD_IBIAS_D2 | RG_HDMITX_PRD_IBIAS_D2 |
RG_HDMITX_PRD_IBIAS_D1 | RG_HDMITX_PRD_IBIAS_D1 |
RG_HDMITX_PRD_IBIAS_D0); RG_HDMITX_PRD_IBIAS_D0);
mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON3, mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON3,
(0x0 << DRV_IMP_EN_SHIFT), RG_HDMITX_DRV_IMP_EN); (imp_en << DRV_IMP_EN_SHIFT),
RG_HDMITX_DRV_IMP_EN);
mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON6, mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON6,
(hdmi_phy->drv_imp_clk << DRV_IMP_CLK_SHIFT) | (hdmi_phy->drv_imp_clk << DRV_IMP_CLK_SHIFT) |
(hdmi_phy->drv_imp_d2 << DRV_IMP_D2_SHIFT) | (hdmi_phy->drv_imp_d2 << DRV_IMP_D2_SHIFT) |
@ -318,12 +334,14 @@ static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate,
RG_HDMITX_DRV_IMP_CLK | RG_HDMITX_DRV_IMP_D2 | RG_HDMITX_DRV_IMP_CLK | RG_HDMITX_DRV_IMP_D2 |
RG_HDMITX_DRV_IMP_D1 | RG_HDMITX_DRV_IMP_D0); RG_HDMITX_DRV_IMP_D1 | RG_HDMITX_DRV_IMP_D0);
mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON5, mtk_hdmi_phy_mask(hdmi_phy, HDMI_CON5,
(hdmi_phy->ibias << DRV_IBIAS_CLK_SHIFT) | (hdmi_ibias << DRV_IBIAS_CLK_SHIFT) |
(hdmi_phy->ibias << DRV_IBIAS_D2_SHIFT) | (hdmi_ibias << DRV_IBIAS_D2_SHIFT) |
(hdmi_phy->ibias << DRV_IBIAS_D1_SHIFT) | (hdmi_ibias << DRV_IBIAS_D1_SHIFT) |
(hdmi_phy->ibias << DRV_IBIAS_D0_SHIFT), (hdmi_ibias << DRV_IBIAS_D0_SHIFT),
RG_HDMITX_DRV_IBIAS_CLK | RG_HDMITX_DRV_IBIAS_D2 | RG_HDMITX_DRV_IBIAS_CLK |
RG_HDMITX_DRV_IBIAS_D1 | RG_HDMITX_DRV_IBIAS_D0); RG_HDMITX_DRV_IBIAS_D2 |
RG_HDMITX_DRV_IBIAS_D1 |
RG_HDMITX_DRV_IBIAS_D0);
return 0; return 0;
} }

View file

@ -142,9 +142,9 @@ static int sun4i_drv_bind(struct device *dev)
/* Create our layers */ /* Create our layers */
drv->layers = sun4i_layers_init(drm); drv->layers = sun4i_layers_init(drm);
if (!drv->layers) { if (IS_ERR(drv->layers)) {
dev_err(drm->dev, "Couldn't create the planes\n"); dev_err(drm->dev, "Couldn't create the planes\n");
ret = -EINVAL; ret = PTR_ERR(drv->layers);
goto free_drm; goto free_drm;
} }

View file

@ -152,15 +152,13 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
DRM_DEBUG_DRIVER("Enabling RGB output\n"); DRM_DEBUG_DRIVER("Enabling RGB output\n");
if (!IS_ERR(tcon->panel)) { if (!IS_ERR(tcon->panel))
drm_panel_prepare(tcon->panel); drm_panel_prepare(tcon->panel);
drm_panel_enable(tcon->panel);
}
/* encoder->bridge can be NULL; drm_bridge_enable checks for it */
drm_bridge_enable(encoder->bridge);
sun4i_tcon_channel_enable(tcon, 0); sun4i_tcon_channel_enable(tcon, 0);
if (!IS_ERR(tcon->panel))
drm_panel_enable(tcon->panel);
} }
static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder) static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
@ -171,15 +169,13 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
DRM_DEBUG_DRIVER("Disabling RGB output\n"); DRM_DEBUG_DRIVER("Disabling RGB output\n");
if (!IS_ERR(tcon->panel))
drm_panel_disable(tcon->panel);
sun4i_tcon_channel_disable(tcon, 0); sun4i_tcon_channel_disable(tcon, 0);
/* encoder->bridge can be NULL; drm_bridge_disable checks for it */ if (!IS_ERR(tcon->panel))
drm_bridge_disable(encoder->bridge);
if (!IS_ERR(tcon->panel)) {
drm_panel_disable(tcon->panel);
drm_panel_unprepare(tcon->panel); drm_panel_unprepare(tcon->panel);
}
} }
static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder, static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder,

View file

@ -59,7 +59,6 @@ config I2C_CHARDEV
config I2C_MUX config I2C_MUX
tristate "I2C bus multiplexing support" tristate "I2C bus multiplexing support"
depends on HAS_IOMEM
help help
Say Y here if you want the I2C core to support the ability to Say Y here if you want the I2C core to support the ability to
handle multiplexed I2C bus topologies, by presenting each handle multiplexed I2C bus topologies, by presenting each

View file

@ -347,7 +347,7 @@ static int dc_i2c_probe(struct platform_device *pdev)
ret = i2c_add_adapter(&i2c->adap); ret = i2c_add_adapter(&i2c->adap);
if (ret < 0) { if (ret < 0) {
clk_unprepare(i2c->clk); clk_disable_unprepare(i2c->clk);
return ret; return ret;
} }

View file

@ -63,6 +63,7 @@ config I2C_MUX_PINCTRL
config I2C_MUX_REG config I2C_MUX_REG
tristate "Register-based I2C multiplexer" tristate "Register-based I2C multiplexer"
depends on HAS_IOMEM
help help
If you say yes to this option, support will be included for a If you say yes to this option, support will be included for a
register based I2C multiplexer. This driver provides access to register based I2C multiplexer. This driver provides access to

View file

@ -69,10 +69,28 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
goto err_with_revert; goto err_with_revert;
} }
p = devm_pinctrl_get_select(adap->dev.parent, priv->bus_name); /*
* Check if there are pinctrl states at all. Note: we cant' use
* devm_pinctrl_get_select() because we need to distinguish between
* the -ENODEV from devm_pinctrl_get() and pinctrl_lookup_state().
*/
p = devm_pinctrl_get(adap->dev.parent);
if (IS_ERR(p)) { if (IS_ERR(p)) {
ret = PTR_ERR(p); ret = PTR_ERR(p);
goto err_with_put; /* continue if just no pinctrl states (e.g. i2c-gpio), otherwise exit */
if (ret != -ENODEV)
goto err_with_put;
} else {
/* there are states. check and use them */
struct pinctrl_state *s = pinctrl_lookup_state(p, priv->bus_name);
if (IS_ERR(s)) {
ret = PTR_ERR(s);
goto err_with_put;
}
ret = pinctrl_select_state(p, s);
if (ret < 0)
goto err_with_put;
} }
priv->chan[new_chan].parent_adap = adap; priv->chan[new_chan].parent_adap = adap;

View file

@ -268,9 +268,9 @@ static int pca954x_probe(struct i2c_client *client,
/* discard unconfigured channels */ /* discard unconfigured channels */
break; break;
idle_disconnect_pd = pdata->modes[num].deselect_on_exit; idle_disconnect_pd = pdata->modes[num].deselect_on_exit;
data->deselect |= (idle_disconnect_pd
|| idle_disconnect_dt) << num;
} }
data->deselect |= (idle_disconnect_pd ||
idle_disconnect_dt) << num;
ret = i2c_mux_add_adapter(muxc, force, num, class); ret = i2c_mux_add_adapter(muxc, force, num, class);

View file

@ -699,13 +699,16 @@ EXPORT_SYMBOL(rdma_addr_cancel);
struct resolve_cb_context { struct resolve_cb_context {
struct rdma_dev_addr *addr; struct rdma_dev_addr *addr;
struct completion comp; struct completion comp;
int status;
}; };
static void resolve_cb(int status, struct sockaddr *src_addr, static void resolve_cb(int status, struct sockaddr *src_addr,
struct rdma_dev_addr *addr, void *context) struct rdma_dev_addr *addr, void *context)
{ {
memcpy(((struct resolve_cb_context *)context)->addr, addr, sizeof(struct if (!status)
rdma_dev_addr)); memcpy(((struct resolve_cb_context *)context)->addr,
addr, sizeof(struct rdma_dev_addr));
((struct resolve_cb_context *)context)->status = status;
complete(&((struct resolve_cb_context *)context)->comp); complete(&((struct resolve_cb_context *)context)->comp);
} }
@ -743,6 +746,10 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
wait_for_completion(&ctx.comp); wait_for_completion(&ctx.comp);
ret = ctx.status;
if (ret)
return ret;
memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN); memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN);
dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if); dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if);
if (!dev) if (!dev)

View file

@ -80,6 +80,8 @@ static struct ib_cm {
__be32 random_id_operand; __be32 random_id_operand;
struct list_head timewait_list; struct list_head timewait_list;
struct workqueue_struct *wq; struct workqueue_struct *wq;
/* Sync on cm change port state */
spinlock_t state_lock;
} cm; } cm;
/* Counter indexes ordered by attribute ID */ /* Counter indexes ordered by attribute ID */
@ -161,6 +163,8 @@ struct cm_port {
struct ib_mad_agent *mad_agent; struct ib_mad_agent *mad_agent;
struct kobject port_obj; struct kobject port_obj;
u8 port_num; u8 port_num;
struct list_head cm_priv_prim_list;
struct list_head cm_priv_altr_list;
struct cm_counter_group counter_group[CM_COUNTER_GROUPS]; struct cm_counter_group counter_group[CM_COUNTER_GROUPS];
}; };
@ -241,6 +245,12 @@ struct cm_id_private {
u8 service_timeout; u8 service_timeout;
u8 target_ack_delay; u8 target_ack_delay;
struct list_head prim_list;
struct list_head altr_list;
/* Indicates that the send port mad is registered and av is set */
int prim_send_port_not_ready;
int altr_send_port_not_ready;
struct list_head work_list; struct list_head work_list;
atomic_t work_count; atomic_t work_count;
}; };
@ -259,20 +269,47 @@ static int cm_alloc_msg(struct cm_id_private *cm_id_priv,
struct ib_mad_agent *mad_agent; struct ib_mad_agent *mad_agent;
struct ib_mad_send_buf *m; struct ib_mad_send_buf *m;
struct ib_ah *ah; struct ib_ah *ah;
struct cm_av *av;
unsigned long flags, flags2;
int ret = 0;
/* don't let the port to be released till the agent is down */
spin_lock_irqsave(&cm.state_lock, flags2);
spin_lock_irqsave(&cm.lock, flags);
if (!cm_id_priv->prim_send_port_not_ready)
av = &cm_id_priv->av;
else if (!cm_id_priv->altr_send_port_not_ready &&
(cm_id_priv->alt_av.port))
av = &cm_id_priv->alt_av;
else {
pr_info("%s: not valid CM id\n", __func__);
ret = -ENODEV;
spin_unlock_irqrestore(&cm.lock, flags);
goto out;
}
spin_unlock_irqrestore(&cm.lock, flags);
/* Make sure the port haven't released the mad yet */
mad_agent = cm_id_priv->av.port->mad_agent; mad_agent = cm_id_priv->av.port->mad_agent;
ah = ib_create_ah(mad_agent->qp->pd, &cm_id_priv->av.ah_attr); if (!mad_agent) {
if (IS_ERR(ah)) pr_info("%s: not a valid MAD agent\n", __func__);
return PTR_ERR(ah); ret = -ENODEV;
goto out;
}
ah = ib_create_ah(mad_agent->qp->pd, &av->ah_attr);
if (IS_ERR(ah)) {
ret = PTR_ERR(ah);
goto out;
}
m = ib_create_send_mad(mad_agent, cm_id_priv->id.remote_cm_qpn, m = ib_create_send_mad(mad_agent, cm_id_priv->id.remote_cm_qpn,
cm_id_priv->av.pkey_index, av->pkey_index,
0, IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, 0, IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA,
GFP_ATOMIC, GFP_ATOMIC,
IB_MGMT_BASE_VERSION); IB_MGMT_BASE_VERSION);
if (IS_ERR(m)) { if (IS_ERR(m)) {
ib_destroy_ah(ah); ib_destroy_ah(ah);
return PTR_ERR(m); ret = PTR_ERR(m);
goto out;
} }
/* Timeout set by caller if response is expected. */ /* Timeout set by caller if response is expected. */
@ -282,7 +319,10 @@ static int cm_alloc_msg(struct cm_id_private *cm_id_priv,
atomic_inc(&cm_id_priv->refcount); atomic_inc(&cm_id_priv->refcount);
m->context[0] = cm_id_priv; m->context[0] = cm_id_priv;
*msg = m; *msg = m;
return 0;
out:
spin_unlock_irqrestore(&cm.state_lock, flags2);
return ret;
} }
static int cm_alloc_response_msg(struct cm_port *port, static int cm_alloc_response_msg(struct cm_port *port,
@ -352,7 +392,8 @@ static void cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
grh, &av->ah_attr); grh, &av->ah_attr);
} }
static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av) static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av,
struct cm_id_private *cm_id_priv)
{ {
struct cm_device *cm_dev; struct cm_device *cm_dev;
struct cm_port *port = NULL; struct cm_port *port = NULL;
@ -387,7 +428,17 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
&av->ah_attr); &av->ah_attr);
av->timeout = path->packet_life_time + 1; av->timeout = path->packet_life_time + 1;
return 0; spin_lock_irqsave(&cm.lock, flags);
if (&cm_id_priv->av == av)
list_add_tail(&cm_id_priv->prim_list, &port->cm_priv_prim_list);
else if (&cm_id_priv->alt_av == av)
list_add_tail(&cm_id_priv->altr_list, &port->cm_priv_altr_list);
else
ret = -EINVAL;
spin_unlock_irqrestore(&cm.lock, flags);
return ret;
} }
static int cm_alloc_id(struct cm_id_private *cm_id_priv) static int cm_alloc_id(struct cm_id_private *cm_id_priv)
@ -677,6 +728,8 @@ struct ib_cm_id *ib_create_cm_id(struct ib_device *device,
spin_lock_init(&cm_id_priv->lock); spin_lock_init(&cm_id_priv->lock);
init_completion(&cm_id_priv->comp); init_completion(&cm_id_priv->comp);
INIT_LIST_HEAD(&cm_id_priv->work_list); INIT_LIST_HEAD(&cm_id_priv->work_list);
INIT_LIST_HEAD(&cm_id_priv->prim_list);
INIT_LIST_HEAD(&cm_id_priv->altr_list);
atomic_set(&cm_id_priv->work_count, -1); atomic_set(&cm_id_priv->work_count, -1);
atomic_set(&cm_id_priv->refcount, 1); atomic_set(&cm_id_priv->refcount, 1);
return &cm_id_priv->id; return &cm_id_priv->id;
@ -892,6 +945,15 @@ retest:
break; break;
} }
spin_lock_irq(&cm.lock);
if (!list_empty(&cm_id_priv->altr_list) &&
(!cm_id_priv->altr_send_port_not_ready))
list_del(&cm_id_priv->altr_list);
if (!list_empty(&cm_id_priv->prim_list) &&
(!cm_id_priv->prim_send_port_not_ready))
list_del(&cm_id_priv->prim_list);
spin_unlock_irq(&cm.lock);
cm_free_id(cm_id->local_id); cm_free_id(cm_id->local_id);
cm_deref_id(cm_id_priv); cm_deref_id(cm_id_priv);
wait_for_completion(&cm_id_priv->comp); wait_for_completion(&cm_id_priv->comp);
@ -1192,12 +1254,13 @@ int ib_send_cm_req(struct ib_cm_id *cm_id,
goto out; goto out;
} }
ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av); ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av,
cm_id_priv);
if (ret) if (ret)
goto error1; goto error1;
if (param->alternate_path) { if (param->alternate_path) {
ret = cm_init_av_by_path(param->alternate_path, ret = cm_init_av_by_path(param->alternate_path,
&cm_id_priv->alt_av); &cm_id_priv->alt_av, cm_id_priv);
if (ret) if (ret)
goto error1; goto error1;
} }
@ -1653,7 +1716,8 @@ static int cm_req_handler(struct cm_work *work)
dev_put(gid_attr.ndev); dev_put(gid_attr.ndev);
} }
work->path[0].gid_type = gid_attr.gid_type; work->path[0].gid_type = gid_attr.gid_type;
ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av); ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av,
cm_id_priv);
} }
if (ret) { if (ret) {
int err = ib_get_cached_gid(work->port->cm_dev->ib_device, int err = ib_get_cached_gid(work->port->cm_dev->ib_device,
@ -1672,7 +1736,8 @@ static int cm_req_handler(struct cm_work *work)
goto rejected; goto rejected;
} }
if (req_msg->alt_local_lid) { if (req_msg->alt_local_lid) {
ret = cm_init_av_by_path(&work->path[1], &cm_id_priv->alt_av); ret = cm_init_av_by_path(&work->path[1], &cm_id_priv->alt_av,
cm_id_priv);
if (ret) { if (ret) {
ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_ALT_GID, ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_ALT_GID,
&work->path[0].sgid, &work->path[0].sgid,
@ -2727,7 +2792,8 @@ int ib_send_cm_lap(struct ib_cm_id *cm_id,
goto out; goto out;
} }
ret = cm_init_av_by_path(alternate_path, &cm_id_priv->alt_av); ret = cm_init_av_by_path(alternate_path, &cm_id_priv->alt_av,
cm_id_priv);
if (ret) if (ret)
goto out; goto out;
cm_id_priv->alt_av.timeout = cm_id_priv->alt_av.timeout =
@ -2839,7 +2905,8 @@ static int cm_lap_handler(struct cm_work *work)
cm_init_av_for_response(work->port, work->mad_recv_wc->wc, cm_init_av_for_response(work->port, work->mad_recv_wc->wc,
work->mad_recv_wc->recv_buf.grh, work->mad_recv_wc->recv_buf.grh,
&cm_id_priv->av); &cm_id_priv->av);
cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av); cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av,
cm_id_priv);
ret = atomic_inc_and_test(&cm_id_priv->work_count); ret = atomic_inc_and_test(&cm_id_priv->work_count);
if (!ret) if (!ret)
list_add_tail(&work->list, &cm_id_priv->work_list); list_add_tail(&work->list, &cm_id_priv->work_list);
@ -3031,7 +3098,7 @@ int ib_send_cm_sidr_req(struct ib_cm_id *cm_id,
return -EINVAL; return -EINVAL;
cm_id_priv = container_of(cm_id, struct cm_id_private, id); cm_id_priv = container_of(cm_id, struct cm_id_private, id);
ret = cm_init_av_by_path(param->path, &cm_id_priv->av); ret = cm_init_av_by_path(param->path, &cm_id_priv->av, cm_id_priv);
if (ret) if (ret)
goto out; goto out;
@ -3468,7 +3535,9 @@ out:
static int cm_migrate(struct ib_cm_id *cm_id) static int cm_migrate(struct ib_cm_id *cm_id)
{ {
struct cm_id_private *cm_id_priv; struct cm_id_private *cm_id_priv;
struct cm_av tmp_av;
unsigned long flags; unsigned long flags;
int tmp_send_port_not_ready;
int ret = 0; int ret = 0;
cm_id_priv = container_of(cm_id, struct cm_id_private, id); cm_id_priv = container_of(cm_id, struct cm_id_private, id);
@ -3477,7 +3546,14 @@ static int cm_migrate(struct ib_cm_id *cm_id)
(cm_id->lap_state == IB_CM_LAP_UNINIT || (cm_id->lap_state == IB_CM_LAP_UNINIT ||
cm_id->lap_state == IB_CM_LAP_IDLE)) { cm_id->lap_state == IB_CM_LAP_IDLE)) {
cm_id->lap_state = IB_CM_LAP_IDLE; cm_id->lap_state = IB_CM_LAP_IDLE;
/* Swap address vector */
tmp_av = cm_id_priv->av;
cm_id_priv->av = cm_id_priv->alt_av; cm_id_priv->av = cm_id_priv->alt_av;
cm_id_priv->alt_av = tmp_av;
/* Swap port send ready state */
tmp_send_port_not_ready = cm_id_priv->prim_send_port_not_ready;
cm_id_priv->prim_send_port_not_ready = cm_id_priv->altr_send_port_not_ready;
cm_id_priv->altr_send_port_not_ready = tmp_send_port_not_ready;
} else } else
ret = -EINVAL; ret = -EINVAL;
spin_unlock_irqrestore(&cm_id_priv->lock, flags); spin_unlock_irqrestore(&cm_id_priv->lock, flags);
@ -3888,6 +3964,9 @@ static void cm_add_one(struct ib_device *ib_device)
port->cm_dev = cm_dev; port->cm_dev = cm_dev;
port->port_num = i; port->port_num = i;
INIT_LIST_HEAD(&port->cm_priv_prim_list);
INIT_LIST_HEAD(&port->cm_priv_altr_list);
ret = cm_create_port_fs(port); ret = cm_create_port_fs(port);
if (ret) if (ret)
goto error1; goto error1;
@ -3945,6 +4024,8 @@ static void cm_remove_one(struct ib_device *ib_device, void *client_data)
{ {
struct cm_device *cm_dev = client_data; struct cm_device *cm_dev = client_data;
struct cm_port *port; struct cm_port *port;
struct cm_id_private *cm_id_priv;
struct ib_mad_agent *cur_mad_agent;
struct ib_port_modify port_modify = { struct ib_port_modify port_modify = {
.clr_port_cap_mask = IB_PORT_CM_SUP .clr_port_cap_mask = IB_PORT_CM_SUP
}; };
@ -3968,15 +4049,27 @@ static void cm_remove_one(struct ib_device *ib_device, void *client_data)
port = cm_dev->port[i-1]; port = cm_dev->port[i-1];
ib_modify_port(ib_device, port->port_num, 0, &port_modify); ib_modify_port(ib_device, port->port_num, 0, &port_modify);
/* Mark all the cm_id's as not valid */
spin_lock_irq(&cm.lock);
list_for_each_entry(cm_id_priv, &port->cm_priv_altr_list, altr_list)
cm_id_priv->altr_send_port_not_ready = 1;
list_for_each_entry(cm_id_priv, &port->cm_priv_prim_list, prim_list)
cm_id_priv->prim_send_port_not_ready = 1;
spin_unlock_irq(&cm.lock);
/* /*
* We flush the queue here after the going_down set, this * We flush the queue here after the going_down set, this
* verify that no new works will be queued in the recv handler, * verify that no new works will be queued in the recv handler,
* after that we can call the unregister_mad_agent * after that we can call the unregister_mad_agent
*/ */
flush_workqueue(cm.wq); flush_workqueue(cm.wq);
ib_unregister_mad_agent(port->mad_agent); spin_lock_irq(&cm.state_lock);
cur_mad_agent = port->mad_agent;
port->mad_agent = NULL;
spin_unlock_irq(&cm.state_lock);
ib_unregister_mad_agent(cur_mad_agent);
cm_remove_port_fs(port); cm_remove_port_fs(port);
} }
device_unregister(cm_dev->device); device_unregister(cm_dev->device);
kfree(cm_dev); kfree(cm_dev);
} }
@ -3989,6 +4082,7 @@ static int __init ib_cm_init(void)
INIT_LIST_HEAD(&cm.device_list); INIT_LIST_HEAD(&cm.device_list);
rwlock_init(&cm.device_lock); rwlock_init(&cm.device_lock);
spin_lock_init(&cm.lock); spin_lock_init(&cm.lock);
spin_lock_init(&cm.state_lock);
cm.listen_service_table = RB_ROOT; cm.listen_service_table = RB_ROOT;
cm.listen_service_id = be64_to_cpu(IB_CM_ASSIGN_SERVICE_ID); cm.listen_service_id = be64_to_cpu(IB_CM_ASSIGN_SERVICE_ID);
cm.remote_id_table = RB_ROOT; cm.remote_id_table = RB_ROOT;

View file

@ -2438,6 +2438,18 @@ static int iboe_tos_to_sl(struct net_device *ndev, int tos)
return 0; return 0;
} }
static enum ib_gid_type cma_route_gid_type(enum rdma_network_type network_type,
unsigned long supported_gids,
enum ib_gid_type default_gid)
{
if ((network_type == RDMA_NETWORK_IPV4 ||
network_type == RDMA_NETWORK_IPV6) &&
test_bit(IB_GID_TYPE_ROCE_UDP_ENCAP, &supported_gids))
return IB_GID_TYPE_ROCE_UDP_ENCAP;
return default_gid;
}
static int cma_resolve_iboe_route(struct rdma_id_private *id_priv) static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
{ {
struct rdma_route *route = &id_priv->id.route; struct rdma_route *route = &id_priv->id.route;
@ -2463,6 +2475,8 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
route->num_paths = 1; route->num_paths = 1;
if (addr->dev_addr.bound_dev_if) { if (addr->dev_addr.bound_dev_if) {
unsigned long supported_gids;
ndev = dev_get_by_index(&init_net, addr->dev_addr.bound_dev_if); ndev = dev_get_by_index(&init_net, addr->dev_addr.bound_dev_if);
if (!ndev) { if (!ndev) {
ret = -ENODEV; ret = -ENODEV;
@ -2486,7 +2500,12 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
route->path_rec->net = &init_net; route->path_rec->net = &init_net;
route->path_rec->ifindex = ndev->ifindex; route->path_rec->ifindex = ndev->ifindex;
route->path_rec->gid_type = id_priv->gid_type; supported_gids = roce_gid_type_mask_support(id_priv->id.device,
id_priv->id.port_num);
route->path_rec->gid_type =
cma_route_gid_type(addr->dev_addr.network,
supported_gids,
id_priv->gid_type);
} }
if (!ndev) { if (!ndev) {
ret = -ENODEV; ret = -ENODEV;

View file

@ -175,7 +175,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
cur_base = addr & PAGE_MASK; cur_base = addr & PAGE_MASK;
if (npages == 0) { if (npages == 0 || npages > UINT_MAX) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }

View file

@ -262,12 +262,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
container_of(uobj, struct ib_uqp_object, uevent.uobject); container_of(uobj, struct ib_uqp_object, uevent.uobject);
idr_remove_uobj(&ib_uverbs_qp_idr, uobj); idr_remove_uobj(&ib_uverbs_qp_idr, uobj);
if (qp != qp->real_qp) { if (qp == qp->real_qp)
ib_close_qp(qp);
} else {
ib_uverbs_detach_umcast(qp, uqp); ib_uverbs_detach_umcast(qp, uqp);
ib_destroy_qp(qp); ib_destroy_qp(qp);
}
ib_uverbs_release_uevent(file, &uqp->uevent); ib_uverbs_release_uevent(file, &uqp->uevent);
kfree(uqp); kfree(uqp);
} }

View file

@ -666,18 +666,6 @@ skip_cqe:
return ret; return ret;
} }
static void invalidate_mr(struct c4iw_dev *rhp, u32 rkey)
{
struct c4iw_mr *mhp;
unsigned long flags;
spin_lock_irqsave(&rhp->lock, flags);
mhp = get_mhp(rhp, rkey >> 8);
if (mhp)
mhp->attr.state = 0;
spin_unlock_irqrestore(&rhp->lock, flags);
}
/* /*
* Get one cq entry from c4iw and map it to openib. * Get one cq entry from c4iw and map it to openib.
* *
@ -733,7 +721,7 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
CQE_OPCODE(&cqe) == FW_RI_SEND_WITH_SE_INV) { CQE_OPCODE(&cqe) == FW_RI_SEND_WITH_SE_INV) {
wc->ex.invalidate_rkey = CQE_WRID_STAG(&cqe); wc->ex.invalidate_rkey = CQE_WRID_STAG(&cqe);
wc->wc_flags |= IB_WC_WITH_INVALIDATE; wc->wc_flags |= IB_WC_WITH_INVALIDATE;
invalidate_mr(qhp->rhp, wc->ex.invalidate_rkey); c4iw_invalidate_mr(qhp->rhp, wc->ex.invalidate_rkey);
} }
} else { } else {
switch (CQE_OPCODE(&cqe)) { switch (CQE_OPCODE(&cqe)) {
@ -762,7 +750,8 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
/* Invalidate the MR if the fastreg failed */ /* Invalidate the MR if the fastreg failed */
if (CQE_STATUS(&cqe) != T4_ERR_SUCCESS) if (CQE_STATUS(&cqe) != T4_ERR_SUCCESS)
invalidate_mr(qhp->rhp, CQE_WRID_FR_STAG(&cqe)); c4iw_invalidate_mr(qhp->rhp,
CQE_WRID_FR_STAG(&cqe));
break; break;
default: default:
printk(KERN_ERR MOD "Unexpected opcode %d " printk(KERN_ERR MOD "Unexpected opcode %d "

View file

@ -999,6 +999,6 @@ extern int db_coalescing_threshold;
extern int use_dsgl; extern int use_dsgl;
void c4iw_drain_rq(struct ib_qp *qp); void c4iw_drain_rq(struct ib_qp *qp);
void c4iw_drain_sq(struct ib_qp *qp); void c4iw_drain_sq(struct ib_qp *qp);
void c4iw_invalidate_mr(struct c4iw_dev *rhp, u32 rkey);
#endif #endif

View file

@ -770,3 +770,15 @@ int c4iw_dereg_mr(struct ib_mr *ib_mr)
kfree(mhp); kfree(mhp);
return 0; return 0;
} }
void c4iw_invalidate_mr(struct c4iw_dev *rhp, u32 rkey)
{
struct c4iw_mr *mhp;
unsigned long flags;
spin_lock_irqsave(&rhp->lock, flags);
mhp = get_mhp(rhp, rkey >> 8);
if (mhp)
mhp->attr.state = 0;
spin_unlock_irqrestore(&rhp->lock, flags);
}

View file

@ -706,12 +706,8 @@ static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
return 0; return 0;
} }
static int build_inv_stag(struct c4iw_dev *dev, union t4_wr *wqe, static int build_inv_stag(union t4_wr *wqe, struct ib_send_wr *wr, u8 *len16)
struct ib_send_wr *wr, u8 *len16)
{ {
struct c4iw_mr *mhp = get_mhp(dev, wr->ex.invalidate_rkey >> 8);
mhp->attr.state = 0;
wqe->inv.stag_inv = cpu_to_be32(wr->ex.invalidate_rkey); wqe->inv.stag_inv = cpu_to_be32(wr->ex.invalidate_rkey);
wqe->inv.r2 = 0; wqe->inv.r2 = 0;
*len16 = DIV_ROUND_UP(sizeof wqe->inv, 16); *len16 = DIV_ROUND_UP(sizeof wqe->inv, 16);
@ -797,11 +793,13 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
spin_lock_irqsave(&qhp->lock, flag); spin_lock_irqsave(&qhp->lock, flag);
if (t4_wq_in_error(&qhp->wq)) { if (t4_wq_in_error(&qhp->wq)) {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
*bad_wr = wr;
return -EINVAL; return -EINVAL;
} }
num_wrs = t4_sq_avail(&qhp->wq); num_wrs = t4_sq_avail(&qhp->wq);
if (num_wrs == 0) { if (num_wrs == 0) {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
*bad_wr = wr;
return -ENOMEM; return -ENOMEM;
} }
while (wr) { while (wr) {
@ -840,10 +838,13 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
case IB_WR_RDMA_READ_WITH_INV: case IB_WR_RDMA_READ_WITH_INV:
fw_opcode = FW_RI_RDMA_READ_WR; fw_opcode = FW_RI_RDMA_READ_WR;
swsqe->opcode = FW_RI_READ_REQ; swsqe->opcode = FW_RI_READ_REQ;
if (wr->opcode == IB_WR_RDMA_READ_WITH_INV) if (wr->opcode == IB_WR_RDMA_READ_WITH_INV) {
c4iw_invalidate_mr(qhp->rhp,
wr->sg_list[0].lkey);
fw_flags = FW_RI_RDMA_READ_INVALIDATE; fw_flags = FW_RI_RDMA_READ_INVALIDATE;
else } else {
fw_flags = 0; fw_flags = 0;
}
err = build_rdma_read(wqe, wr, &len16); err = build_rdma_read(wqe, wr, &len16);
if (err) if (err)
break; break;
@ -876,7 +877,8 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
fw_flags |= FW_RI_LOCAL_FENCE_FLAG; fw_flags |= FW_RI_LOCAL_FENCE_FLAG;
fw_opcode = FW_RI_INV_LSTAG_WR; fw_opcode = FW_RI_INV_LSTAG_WR;
swsqe->opcode = FW_RI_LOCAL_INV; swsqe->opcode = FW_RI_LOCAL_INV;
err = build_inv_stag(qhp->rhp, wqe, wr, &len16); err = build_inv_stag(wqe, wr, &len16);
c4iw_invalidate_mr(qhp->rhp, wr->ex.invalidate_rkey);
break; break;
default: default:
PDBG("%s post of type=%d TBD!\n", __func__, PDBG("%s post of type=%d TBD!\n", __func__,
@ -934,11 +936,13 @@ int c4iw_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
spin_lock_irqsave(&qhp->lock, flag); spin_lock_irqsave(&qhp->lock, flag);
if (t4_wq_in_error(&qhp->wq)) { if (t4_wq_in_error(&qhp->wq)) {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
*bad_wr = wr;
return -EINVAL; return -EINVAL;
} }
num_wrs = t4_rq_avail(&qhp->wq); num_wrs = t4_rq_avail(&qhp->wq);
if (num_wrs == 0) { if (num_wrs == 0) {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
*bad_wr = wr;
return -ENOMEM; return -ENOMEM;
} }
while (wr) { while (wr) {

View file

@ -775,75 +775,3 @@ void hfi1_put_proc_affinity(int cpu)
} }
mutex_unlock(&affinity->lock); mutex_unlock(&affinity->lock);
} }
int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf,
size_t count)
{
struct hfi1_affinity_node *entry;
cpumask_var_t mask;
int ret, i;
mutex_lock(&node_affinity.lock);
entry = node_affinity_lookup(dd->node);
if (!entry) {
ret = -EINVAL;
goto unlock;
}
ret = zalloc_cpumask_var(&mask, GFP_KERNEL);
if (!ret) {
ret = -ENOMEM;
goto unlock;
}
ret = cpulist_parse(buf, mask);
if (ret)
goto out;
if (!cpumask_subset(mask, cpu_online_mask) || cpumask_empty(mask)) {
dd_dev_warn(dd, "Invalid CPU mask\n");
ret = -EINVAL;
goto out;
}
/* reset the SDMA interrupt affinity details */
init_cpu_mask_set(&entry->def_intr);
cpumask_copy(&entry->def_intr.mask, mask);
/* Reassign the affinity for each SDMA interrupt. */
for (i = 0; i < dd->num_msix_entries; i++) {
struct hfi1_msix_entry *msix;
msix = &dd->msix_entries[i];
if (msix->type != IRQ_SDMA)
continue;
ret = get_irq_affinity(dd, msix);
if (ret)
break;
}
out:
free_cpumask_var(mask);
unlock:
mutex_unlock(&node_affinity.lock);
return ret ? ret : strnlen(buf, PAGE_SIZE);
}
int hfi1_get_sdma_affinity(struct hfi1_devdata *dd, char *buf)
{
struct hfi1_affinity_node *entry;
mutex_lock(&node_affinity.lock);
entry = node_affinity_lookup(dd->node);
if (!entry) {
mutex_unlock(&node_affinity.lock);
return -EINVAL;
}
cpumap_print_to_pagebuf(true, buf, &entry->def_intr.mask);
mutex_unlock(&node_affinity.lock);
return strnlen(buf, PAGE_SIZE);
}

View file

@ -102,10 +102,6 @@ int hfi1_get_proc_affinity(int);
/* Release a CPU used by a user process. */ /* Release a CPU used by a user process. */
void hfi1_put_proc_affinity(int); void hfi1_put_proc_affinity(int);
int hfi1_get_sdma_affinity(struct hfi1_devdata *dd, char *buf);
int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf,
size_t count);
struct hfi1_affinity_node { struct hfi1_affinity_node {
int node; int node;
struct cpu_mask_set def_intr; struct cpu_mask_set def_intr;

View file

@ -6301,19 +6301,8 @@ void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf)
/* leave shared count at zero for both global and VL15 */ /* leave shared count at zero for both global and VL15 */
write_global_credit(dd, vau, vl15buf, 0); write_global_credit(dd, vau, vl15buf, 0);
/* We may need some credits for another VL when sending packets write_csr(dd, SEND_CM_CREDIT_VL15, (u64)vl15buf
* with the snoop interface. Dividing it down the middle for VL15 << SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);
* and VL0 should suffice.
*/
if (unlikely(dd->hfi1_snoop.mode_flag == HFI1_PORT_SNOOP_MODE)) {
write_csr(dd, SEND_CM_CREDIT_VL15, (u64)(vl15buf >> 1)
<< SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);
write_csr(dd, SEND_CM_CREDIT_VL, (u64)(vl15buf >> 1)
<< SEND_CM_CREDIT_VL_DEDICATED_LIMIT_VL_SHIFT);
} else {
write_csr(dd, SEND_CM_CREDIT_VL15, (u64)vl15buf
<< SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);
}
} }
/* /*
@ -9915,9 +9904,6 @@ static void set_lidlmc(struct hfi1_pportdata *ppd)
u32 mask = ~((1U << ppd->lmc) - 1); u32 mask = ~((1U << ppd->lmc) - 1);
u64 c1 = read_csr(ppd->dd, DCC_CFG_PORT_CONFIG1); u64 c1 = read_csr(ppd->dd, DCC_CFG_PORT_CONFIG1);
if (dd->hfi1_snoop.mode_flag)
dd_dev_info(dd, "Set lid/lmc while snooping");
c1 &= ~(DCC_CFG_PORT_CONFIG1_TARGET_DLID_SMASK c1 &= ~(DCC_CFG_PORT_CONFIG1_TARGET_DLID_SMASK
| DCC_CFG_PORT_CONFIG1_DLID_MASK_SMASK); | DCC_CFG_PORT_CONFIG1_DLID_MASK_SMASK);
c1 |= ((ppd->lid & DCC_CFG_PORT_CONFIG1_TARGET_DLID_MASK) c1 |= ((ppd->lid & DCC_CFG_PORT_CONFIG1_TARGET_DLID_MASK)
@ -12112,7 +12098,7 @@ static void update_synth_timer(unsigned long opaque)
mod_timer(&dd->synth_stats_timer, jiffies + HZ * SYNTH_CNT_TIME); mod_timer(&dd->synth_stats_timer, jiffies + HZ * SYNTH_CNT_TIME);
} }
#define C_MAX_NAME 13 /* 12 chars + one for /0 */ #define C_MAX_NAME 16 /* 15 chars + one for /0 */
static int init_cntrs(struct hfi1_devdata *dd) static int init_cntrs(struct hfi1_devdata *dd)
{ {
int i, rcv_ctxts, j; int i, rcv_ctxts, j;
@ -14463,7 +14449,7 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
* Any error printing is already done by the init code. * Any error printing is already done by the init code.
* On return, we have the chip mapped. * On return, we have the chip mapped.
*/ */
ret = hfi1_pcie_ddinit(dd, pdev, ent); ret = hfi1_pcie_ddinit(dd, pdev);
if (ret < 0) if (ret < 0)
goto bail_free; goto bail_free;
@ -14691,6 +14677,11 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
if (ret) if (ret)
goto bail_free_cntrs; goto bail_free_cntrs;
init_completion(&dd->user_comp);
/* The user refcount starts with one to inidicate an active device */
atomic_set(&dd->user_refcount, 1);
goto bail; goto bail;
bail_free_rcverr: bail_free_rcverr:

View file

@ -320,6 +320,9 @@
/* DC_DC8051_CFG_MODE.GENERAL bits */ /* DC_DC8051_CFG_MODE.GENERAL bits */
#define DISABLE_SELF_GUID_CHECK 0x2 #define DISABLE_SELF_GUID_CHECK 0x2
/* Bad L2 frame error code */
#define BAD_L2_ERR 0x6
/* /*
* Eager buffer minimum and maximum sizes supported by the hardware. * Eager buffer minimum and maximum sizes supported by the hardware.
* All power-of-two sizes in between are supported as well. * All power-of-two sizes in between are supported as well.

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