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

Minor comment conflict in mac80211.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2020-03-29 21:25:29 -07:00
commit f0b5989745
123 changed files with 840 additions and 433 deletions

View file

@ -23,6 +23,8 @@ properties:
- items: - items:
- const: allwinner,sun7i-a20-crypto - const: allwinner,sun7i-a20-crypto
- const: allwinner,sun4i-a10-crypto - const: allwinner,sun4i-a10-crypto
- items:
- const: allwinner,sun8i-a33-crypto
reg: reg:
maxItems: 1 maxItems: 1

View file

@ -5,6 +5,7 @@ Required properties:
* "cypress,tm2-touchkey" - for the touchkey found on the tm2 board * "cypress,tm2-touchkey" - for the touchkey found on the tm2 board
* "cypress,midas-touchkey" - for the touchkey found on midas boards * "cypress,midas-touchkey" - for the touchkey found on midas boards
* "cypress,aries-touchkey" - for the touchkey found on aries boards * "cypress,aries-touchkey" - for the touchkey found on aries boards
* "coreriver,tc360-touchkey" - for the Coreriver TouchCore 360 touchkey
- reg: I2C address of the chip. - reg: I2C address of the chip.
- interrupts: interrupt to which the chip is connected (see interrupt - interrupts: interrupt to which the chip is connected (see interrupt
binding[0]). binding[0]).

View file

@ -205,6 +205,8 @@ patternProperties:
description: Colorful GRP, Shenzhen Xueyushi Technology Ltd. description: Colorful GRP, Shenzhen Xueyushi Technology Ltd.
"^compulab,.*": "^compulab,.*":
description: CompuLab Ltd. description: CompuLab Ltd.
"^coreriver,.*":
description: CORERIVER Semiconductor Co.,Ltd.
"^corpro,.*": "^corpro,.*":
description: Chengdu Corpro Technology Co., Ltd. description: Chengdu Corpro Technology Co., Ltd.
"^cortina,.*": "^cortina,.*":

View file

@ -53,6 +53,29 @@ key management interface to perform common hypervisor activities such as
encrypting bootstrap code, snapshot, migrating and debugging the guest. For more encrypting bootstrap code, snapshot, migrating and debugging the guest. For more
information, see the SEV Key Management spec [api-spec]_ information, see the SEV Key Management spec [api-spec]_
The main ioctl to access SEV is KVM_MEM_ENCRYPT_OP. If the argument
to KVM_MEM_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
and ``ENOTTY` if it is disabled (on some older versions of Linux,
the ioctl runs normally even with a NULL argument, and therefore will
likely return ``EFAULT``). If non-NULL, the argument to KVM_MEM_ENCRYPT_OP
must be a struct kvm_sev_cmd::
struct kvm_sev_cmd {
__u32 id;
__u64 data;
__u32 error;
__u32 sev_fd;
};
The ``id`` field contains the subcommand, and the ``data`` field points to
another struct containing arguments specific to command. The ``sev_fd``
should point to a file descriptor that is opened on the ``/dev/sev``
device, if needed (see individual commands).
On output, ``error`` is zero on success, or an error code. Error codes
are defined in ``<linux/psp-dev.h>`.
KVM implements the following commands to support common lifecycle events of SEV KVM implements the following commands to support common lifecycle events of SEV
guests, such as launching, running, snapshotting, migrating and decommissioning. guests, such as launching, running, snapshotting, migrating and decommissioning.
@ -90,6 +113,8 @@ Returns: 0 on success, -negative on error
On success, the 'handle' field contains a new handle and on error, a negative value. On success, the 'handle' field contains a new handle and on error, a negative value.
KVM_SEV_LAUNCH_START requires the ``sev_fd`` field to be valid.
For more details, see SEV spec Section 6.2. For more details, see SEV spec Section 6.2.
3. KVM_SEV_LAUNCH_UPDATE_DATA 3. KVM_SEV_LAUNCH_UPDATE_DATA

View file

@ -7590,7 +7590,8 @@ F: Documentation/admin-guide/perf/hisi-pmu.rst
HISILICON ROCE DRIVER HISILICON ROCE DRIVER
M: Lijun Ou <oulijun@huawei.com> M: Lijun Ou <oulijun@huawei.com>
M: Wei Hu(Xavier) <xavier.huwei@huawei.com> M: Wei Hu(Xavier) <huwei87@hisilicon.com>
M: Weihang Li <liweihang@huawei.com>
L: linux-rdma@vger.kernel.org L: linux-rdma@vger.kernel.org
S: Maintained S: Maintained
F: drivers/infiniband/hw/hns/ F: drivers/infiniband/hw/hns/
@ -15448,11 +15449,9 @@ F: drivers/infiniband/sw/siw/
F: include/uapi/rdma/siw-abi.h F: include/uapi/rdma/siw-abi.h
SOFT-ROCE DRIVER (rxe) SOFT-ROCE DRIVER (rxe)
M: Moni Shoua <monis@mellanox.com> M: Zhu Yanjun <yanjunz@mellanox.com>
L: linux-rdma@vger.kernel.org L: linux-rdma@vger.kernel.org
S: Supported S: Supported
W: https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home
Q: http://patchwork.kernel.org/project/linux-rdma/list/
F: drivers/infiniband/sw/rxe/ F: drivers/infiniband/sw/rxe/
F: include/uapi/rdma/rdma_user_rxe.h F: include/uapi/rdma/rdma_user_rxe.h
@ -16789,7 +16788,7 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/
S: Maintained S: Maintained
F: drivers/media/platform/ti-vpe/ F: drivers/media/platform/ti-vpe/
F: Documentation/devicetree/bindings/media/ti,vpe.yaml F: Documentation/devicetree/bindings/media/ti,vpe.yaml
Documentation/devicetree/bindings/media/ti,cal.yaml F: Documentation/devicetree/bindings/media/ti,cal.yaml
TI WILINK WIRELESS DRIVERS TI WILINK WIRELESS DRIVERS
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org

View file

@ -2,7 +2,7 @@
VERSION = 5 VERSION = 5
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc7 EXTRAVERSION =
NAME = Kleptomaniac Octopus NAME = Kleptomaniac Octopus
# *DOCUMENTATION* # *DOCUMENTATION*

View file

@ -112,6 +112,7 @@
&sdhci { &sdhci {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>; pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
bus-width = <4>; bus-width = <4>;
mmc-pwrseq = <&wifi_pwrseq>; mmc-pwrseq = <&wifi_pwrseq>;

View file

@ -15,6 +15,7 @@
firmware: firmware { firmware: firmware {
compatible = "raspberrypi,bcm2835-firmware", "simple-bus"; compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
mboxes = <&mailbox>; mboxes = <&mailbox>;
dma-ranges;
}; };
power: power { power: power {

View file

@ -24,12 +24,12 @@
&cpsw_emac0 { &cpsw_emac0 {
phy-handle = <&ethphy0>; phy-handle = <&ethphy0>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&cpsw_emac1 { &cpsw_emac1 {
phy-handle = <&ethphy1>; phy-handle = <&ethphy1>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&davinci_mdio { &davinci_mdio {

View file

@ -33,12 +33,12 @@
&cpsw_emac0 { &cpsw_emac0 {
phy-handle = <&ethphy0>; phy-handle = <&ethphy0>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&cpsw_emac1 { &cpsw_emac1 {
phy-handle = <&ethphy1>; phy-handle = <&ethphy1>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&davinci_mdio { &davinci_mdio {

View file

@ -24,12 +24,12 @@
&cpsw_emac0 { &cpsw_emac0 {
phy-handle = <&ethphy0>; phy-handle = <&ethphy0>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&cpsw_emac1 { &cpsw_emac1 {
phy-handle = <&ethphy1>; phy-handle = <&ethphy1>;
phy-mode = "rgmii"; phy-mode = "rgmii-id";
}; };
&davinci_mdio { &davinci_mdio {

View file

@ -148,6 +148,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
ranges = <0x0 0x0 0x0 0xc0000000>; ranges = <0x0 0x0 0x0 0xc0000000>;
dma-ranges = <0x80000000 0x0 0x80000000 0x80000000>;
ti,hwmods = "l3_main_1", "l3_main_2"; ti,hwmods = "l3_main_1", "l3_main_2";
reg = <0x0 0x44000000 0x0 0x1000000>, reg = <0x0 0x44000000 0x0 0x1000000>,
<0x0 0x45000000 0x0 0x1000>; <0x0 0x45000000 0x0 0x1000>;

View file

@ -33,7 +33,7 @@
}; };
}; };
lcd_vdd3_reg: voltage-regulator-6 { lcd_vdd3_reg: voltage-regulator-7 {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "LCD_VDD_2.2V"; regulator-name = "LCD_VDD_2.2V";
regulator-min-microvolt = <2200000>; regulator-min-microvolt = <2200000>;
@ -42,7 +42,7 @@
enable-active-high; enable-active-high;
}; };
ps_als_reg: voltage-regulator-7 { ps_als_reg: voltage-regulator-8 {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "LED_A_3.0V"; regulator-name = "LED_A_3.0V";
regulator-min-microvolt = <3000000>; regulator-min-microvolt = <3000000>;

View file

@ -13,7 +13,7 @@
/* bootargs are passed in by bootloader */ /* bootargs are passed in by bootloader */
cam_vdda_reg: voltage-regulator-6 { cam_vdda_reg: voltage-regulator-7 {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "CAM_SENSOR_CORE_1.2V"; regulator-name = "CAM_SENSOR_CORE_1.2V";
regulator-min-microvolt = <1200000>; regulator-min-microvolt = <1200000>;

View file

@ -112,7 +112,7 @@
regulators { regulators {
vdd_arm: buck1 { vdd_arm: buck1 {
regulator-name = "vdd_arm"; regulator-name = "vdd_arm";
regulator-min-microvolt = <730000>; regulator-min-microvolt = <925000>;
regulator-max-microvolt = <1380000>; regulator-max-microvolt = <1380000>;
regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>; regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
regulator-always-on; regulator-always-on;
@ -120,7 +120,7 @@
vdd_soc: buck2 { vdd_soc: buck2 {
regulator-name = "vdd_soc"; regulator-name = "vdd_soc";
regulator-min-microvolt = <730000>; regulator-min-microvolt = <1150000>;
regulator-max-microvolt = <1380000>; regulator-max-microvolt = <1380000>;
regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>; regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
regulator-always-on; regulator-always-on;

View file

@ -429,7 +429,7 @@
reset-gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>; /* gpio173 */ reset-gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>; /* gpio173 */
/* gpio_183 with sys_nirq2 pad as wakeup */ /* gpio_183 with sys_nirq2 pad as wakeup */
interrupts-extended = <&gpio6 23 IRQ_TYPE_EDGE_FALLING>, interrupts-extended = <&gpio6 23 IRQ_TYPE_LEVEL_LOW>,
<&omap4_pmx_core 0x160>; <&omap4_pmx_core 0x160>;
interrupt-names = "irq", "wakeup"; interrupt-names = "irq", "wakeup";
wakeup-source; wakeup-source;

View file

@ -854,34 +854,46 @@
compatible = "ti,omap2-onenand"; compatible = "ti,omap2-onenand";
reg = <0 0 0x20000>; /* CS0, offset 0, IO size 128K */ reg = <0 0 0x20000>; /* CS0, offset 0, IO size 128K */
/*
* These timings are based on CONFIG_OMAP_GPMC_DEBUG=y reported
* bootloader set values when booted with v5.1
* (OneNAND Manufacturer: Samsung):
*
* cs0 GPMC_CS_CONFIG1: 0xfb001202
* cs0 GPMC_CS_CONFIG2: 0x00111100
* cs0 GPMC_CS_CONFIG3: 0x00020200
* cs0 GPMC_CS_CONFIG4: 0x11001102
* cs0 GPMC_CS_CONFIG5: 0x03101616
* cs0 GPMC_CS_CONFIG6: 0x90060000
*/
gpmc,sync-read; gpmc,sync-read;
gpmc,sync-write; gpmc,sync-write;
gpmc,burst-length = <16>; gpmc,burst-length = <16>;
gpmc,burst-read; gpmc,burst-read;
gpmc,burst-wrap; gpmc,burst-wrap;
gpmc,burst-write; gpmc,burst-write;
gpmc,device-width = <2>; /* GPMC_DEVWIDTH_16BIT */ gpmc,device-width = <2>;
gpmc,mux-add-data = <2>; /* GPMC_MUX_AD */ gpmc,mux-add-data = <2>;
gpmc,cs-on-ns = <0>; gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <87>; gpmc,cs-rd-off-ns = <102>;
gpmc,cs-wr-off-ns = <87>; gpmc,cs-wr-off-ns = <102>;
gpmc,adv-on-ns = <0>; gpmc,adv-on-ns = <0>;
gpmc,adv-rd-off-ns = <10>; gpmc,adv-rd-off-ns = <12>;
gpmc,adv-wr-off-ns = <10>; gpmc,adv-wr-off-ns = <12>;
gpmc,oe-on-ns = <15>; gpmc,oe-on-ns = <12>;
gpmc,oe-off-ns = <87>; gpmc,oe-off-ns = <102>;
gpmc,we-on-ns = <0>; gpmc,we-on-ns = <0>;
gpmc,we-off-ns = <87>; gpmc,we-off-ns = <102>;
gpmc,rd-cycle-ns = <112>; gpmc,rd-cycle-ns = <132>;
gpmc,wr-cycle-ns = <112>; gpmc,wr-cycle-ns = <132>;
gpmc,access-ns = <81>; gpmc,access-ns = <96>;
gpmc,page-burst-access-ns = <15>; gpmc,page-burst-access-ns = <18>;
gpmc,bus-turnaround-ns = <0>; gpmc,bus-turnaround-ns = <0>;
gpmc,cycle2cycle-delay-ns = <0>; gpmc,cycle2cycle-delay-ns = <0>;
gpmc,wait-monitoring-ns = <0>; gpmc,wait-monitoring-ns = <0>;
gpmc,clk-activation-ns = <5>; gpmc,clk-activation-ns = <6>;
gpmc,wr-data-mux-bus-ns = <30>; gpmc,wr-data-mux-bus-ns = <36>;
gpmc,wr-access-ns = <81>; gpmc,wr-access-ns = <96>;
gpmc,sync-clk-ps = <15000>; gpmc,sync-clk-ps = <15000>;
/* /*

View file

@ -143,6 +143,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
ranges = <0 0 0 0xc0000000>; ranges = <0 0 0 0xc0000000>;
dma-ranges = <0x80000000 0x0 0x80000000 0x80000000>;
ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
reg = <0 0x44000000 0 0x2000>, reg = <0 0x44000000 0 0x2000>,
<0 0x44800000 0 0x3000>, <0 0x44800000 0 0x3000>,

View file

@ -323,8 +323,8 @@
interrupt-controller; interrupt-controller;
reg = <0 0x200>; reg = <0 0x200>;
#interrupt-cells = <1>; #interrupt-cells = <1>;
valid-mask = <0xFFFFFFFF>; valid-mask = <0xffffffff>;
clear-mask = <0>; clear-mask = <0xffffffff>;
}; };
timer0: timer@200 { timer0: timer@200 {

View file

@ -240,8 +240,8 @@
reg = <0 0x200>; reg = <0 0x200>;
interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <1>; #interrupt-cells = <1>;
valid-mask = <0xFFFFFFFF>; valid-mask = <0xffffffff>;
clear-mask = <0>; clear-mask = <0xffffffff>;
}; };
timer0: timer@200 { timer0: timer@200 {

View file

@ -215,7 +215,7 @@
}; };
crypto: crypto-engine@1c15000 { crypto: crypto-engine@1c15000 {
compatible = "allwinner,sun4i-a10-crypto"; compatible = "allwinner,sun8i-a33-crypto";
reg = <0x01c15000 0x1000>; reg = <0x01c15000 0x1000>;
interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SS>, <&ccu CLK_SS>; clocks = <&ccu CLK_BUS_SS>, <&ccu CLK_SS>;

View file

@ -374,8 +374,8 @@
}; };
&reg_dldo3 { &reg_dldo3 {
regulator-min-microvolt = <2800000>; regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2800000>; regulator-max-microvolt = <1800000>;
regulator-name = "vdd-csi"; regulator-name = "vdd-csi";
}; };
@ -498,7 +498,8 @@
}; };
&usbphy { &usbphy {
usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ usb0_id_det-gpios = <&pio 7 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH11 */
usb0_vbus_power-supply = <&usb_power_supply>;
usb0_vbus-supply = <&reg_drivevbus>; usb0_vbus-supply = <&reg_drivevbus>;
usb1_vbus-supply = <&reg_vmain>; usb1_vbus-supply = <&reg_vmain>;
usb2_vbus-supply = <&reg_vmain>; usb2_vbus-supply = <&reg_vmain>;

View file

@ -1006,10 +1006,10 @@
reg = <0x01c30000 0x104>; reg = <0x01c30000 0x104>;
interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq"; interrupt-names = "macirq";
resets = <&ccu CLK_BUS_EMAC>; clocks = <&ccu CLK_BUS_EMAC>;
reset-names = "stmmaceth";
clocks = <&ccu RST_BUS_EMAC>;
clock-names = "stmmaceth"; clock-names = "stmmaceth";
resets = <&ccu RST_BUS_EMAC>;
reset-names = "stmmaceth";
status = "disabled"; status = "disabled";
mdio: mdio { mdio: mdio {

View file

@ -181,6 +181,32 @@
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
}; };
spi0: spi@1c05000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c05000 0x1000>;
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@1c06000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c06000 0x1000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI1>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
csi0: csi@1c09000 { csi0: csi@1c09000 {
compatible = "allwinner,sun8i-r40-csi0", compatible = "allwinner,sun8i-r40-csi0",
"allwinner,sun7i-a20-csi0"; "allwinner,sun7i-a20-csi0";
@ -290,6 +316,29 @@
resets = <&ccu RST_BUS_CE>; resets = <&ccu RST_BUS_CE>;
}; };
spi2: spi@1c17000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c17000 0x1000>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI2>, <&ccu CLK_SPI2>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI2>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
ahci: sata@1c18000 {
compatible = "allwinner,sun8i-r40-ahci";
reg = <0x01c18000 0x1000>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>;
resets = <&ccu RST_BUS_SATA>;
reset-names = "ahci";
status = "disabled";
};
ehci1: usb@1c19000 { ehci1: usb@1c19000 {
compatible = "allwinner,sun8i-r40-ehci", "generic-ehci"; compatible = "allwinner,sun8i-r40-ehci", "generic-ehci";
reg = <0x01c19000 0x100>; reg = <0x01c19000 0x100>;
@ -336,6 +385,19 @@
status = "disabled"; status = "disabled";
}; };
spi3: spi@1c1f000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c1f000 0x1000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI3>, <&ccu CLK_SPI3>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI3>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
ccu: clock@1c20000 { ccu: clock@1c20000 {
compatible = "allwinner,sun8i-r40-ccu"; compatible = "allwinner,sun8i-r40-ccu";
reg = <0x01c20000 0x400>; reg = <0x01c20000 0x400>;
@ -653,69 +715,6 @@
#size-cells = <0>; #size-cells = <0>;
}; };
spi0: spi@1c05000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c05000 0x1000>;
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@1c06000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c06000 0x1000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI1>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi2: spi@1c07000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c07000 0x1000>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI2>, <&ccu CLK_SPI2>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI2>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi3: spi@1c0f000 {
compatible = "allwinner,sun8i-r40-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c0f000 0x1000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI3>, <&ccu CLK_SPI3>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI3>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
ahci: sata@1c18000 {
compatible = "allwinner,sun8i-r40-ahci";
reg = <0x01c18000 0x1000>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>;
resets = <&ccu RST_BUS_SATA>;
reset-names = "ahci";
status = "disabled";
};
gmac: ethernet@1c50000 { gmac: ethernet@1c50000 {
compatible = "allwinner,sun8i-r40-gmac"; compatible = "allwinner,sun8i-r40-gmac";
syscon = <&ccu>; syscon = <&ccu>;

View file

@ -53,7 +53,7 @@
* PSCI node is not added default, U-boot will add missing * PSCI node is not added default, U-boot will add missing
* parts if it determines to use PSCI. * parts if it determines to use PSCI.
*/ */
entry-method = "arm,psci"; entry-method = "psci";
CPU_PW20: cpu-pw20 { CPU_PW20: cpu-pw20 {
compatible = "arm,idle-state"; compatible = "arm,idle-state";

View file

@ -108,7 +108,7 @@
}; };
idle-states { idle-states {
entry-method = "arm,psci"; entry-method = "psci";
CORE_PD: core-pd { CORE_PD: core-pd {
compatible = "arm,idle-state"; compatible = "arm,idle-state";
entry-latency-us = <4000>; entry-latency-us = <4000>;

View file

@ -221,7 +221,7 @@ alternative_endif
.macro user_alt, label, oldinstr, newinstr, cond .macro user_alt, label, oldinstr, newinstr, cond
9999: alternative_insn "\oldinstr", "\newinstr", \cond 9999: alternative_insn "\oldinstr", "\newinstr", \cond
_ASM_EXTABLE 9999b, \label _asm_extable 9999b, \label
.endm .endm
/* /*

View file

@ -79,6 +79,11 @@ config MMU
config STACK_GROWSUP config STACK_GROWSUP
def_bool y def_bool y
config ARCH_DEFCONFIG
string
default "arch/parisc/configs/generic-32bit_defconfig" if !64BIT
default "arch/parisc/configs/generic-64bit_defconfig" if 64BIT
config GENERIC_LOCKBREAK config GENERIC_LOCKBREAK
bool bool
default y default y

View file

@ -34,6 +34,13 @@ CC_ARCHES = hppa hppa2.0 hppa1.1
LD_BFD := elf32-hppa-linux LD_BFD := elf32-hppa-linux
endif endif
# select defconfig based on actual architecture
ifeq ($(shell uname -m),parisc64)
KBUILD_DEFCONFIG := generic-64bit_defconfig
else
KBUILD_DEFCONFIG := generic-32bit_defconfig
endif
export LD_BFD export LD_BFD
ifneq ($(SUBARCH),$(UTS_MACHINE)) ifneq ($(SUBARCH),$(UTS_MACHINE))

View file

@ -50,7 +50,6 @@ config RISCV
select PCI_DOMAINS_GENERIC if PCI select PCI_DOMAINS_GENERIC if PCI
select PCI_MSI if PCI select PCI_MSI if PCI
select RISCV_TIMER select RISCV_TIMER
select UACCESS_MEMCPY if !MMU
select GENERIC_IRQ_MULTI_HANDLER select GENERIC_IRQ_MULTI_HANDLER
select GENERIC_ARCH_TOPOLOGY if SMP select GENERIC_ARCH_TOPOLOGY if SMP
select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_PTE_SPECIAL

View file

@ -12,20 +12,6 @@ config SOC_SIFIVE
config SOC_VIRT config SOC_VIRT
bool "QEMU Virt Machine" bool "QEMU Virt Machine"
select VIRTIO_PCI
select VIRTIO_BALLOON
select VIRTIO_MMIO
select VIRTIO_CONSOLE
select VIRTIO_NET
select NET_9P_VIRTIO
select VIRTIO_BLK
select SCSI_VIRTIO
select DRM_VIRTIO_GPU
select HW_RANDOM_VIRTIO
select RPMSG_CHAR
select RPMSG_VIRTIO
select CRYPTO_DEV_VIRTIO
select VIRTIO_INPUT
select POWER_RESET_SYSCON select POWER_RESET_SYSCON
select POWER_RESET_SYSCON_POWEROFF select POWER_RESET_SYSCON_POWEROFF
select GOLDFISH select GOLDFISH

View file

@ -31,6 +31,7 @@ CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y CONFIG_IP_PNP_RARP=y
CONFIG_NETLINK_DIAG=y CONFIG_NETLINK_DIAG=y
CONFIG_NET_9P=y CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y CONFIG_PCIEPORTBUS=y
CONFIG_PCI_HOST_GENERIC=y CONFIG_PCI_HOST_GENERIC=y
@ -38,12 +39,15 @@ CONFIG_PCIE_XILINX=y
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y CONFIG_DEVTMPFS_MOUNT=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR=y
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y CONFIG_ATA=y
CONFIG_SATA_AHCI=y CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_VIRTIO_NET=y
CONFIG_MACB=y CONFIG_MACB=y
CONFIG_E1000E=y CONFIG_E1000E=y
CONFIG_R8169=y CONFIG_R8169=y
@ -54,13 +58,16 @@ CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
CONFIG_HVC_RISCV_SBI=y CONFIG_HVC_RISCV_SBI=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_SPI=y CONFIG_SPI=y
CONFIG_SPI_SIFIVE=y CONFIG_SPI_SIFIVE=y
# CONFIG_PTP_1588_CLOCK is not set # CONFIG_PTP_1588_CLOCK is not set
CONFIG_POWER_RESET=y CONFIG_POWER_RESET=y
CONFIG_DRM=y CONFIG_DRM=y
CONFIG_DRM_RADEON=y CONFIG_DRM_RADEON=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_USB=y CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_HCD=y
@ -74,6 +81,12 @@ CONFIG_USB_UAS=y
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_SPI=y CONFIG_MMC_SPI=y
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y CONFIG_AUTOFS4_FS=y
@ -88,16 +101,17 @@ CONFIG_NFS_V4_2=y
CONFIG_ROOT_NFS=y CONFIG_ROOT_NFS=y
CONFIG_9P_FS=y CONFIG_9P_FS=y
CONFIG_CRYPTO_USER_API_HASH=y CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_FS=y CONFIG_DEBUG_FS=y
CONFIG_DEBUG_PAGEALLOC=y CONFIG_DEBUG_PAGEALLOC=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_DEBUG_VM=y CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_PGFLAGS=y CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_MEMORY_INIT=y CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_SOFTLOCKUP_DETECTOR=y CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_WQ_WATCHDOG=y CONFIG_WQ_WATCHDOG=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_DEBUG_TIMEKEEPING=y CONFIG_DEBUG_TIMEKEEPING=y
CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK=y

View file

@ -31,6 +31,7 @@ CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y CONFIG_IP_PNP_RARP=y
CONFIG_NETLINK_DIAG=y CONFIG_NETLINK_DIAG=y
CONFIG_NET_9P=y CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y CONFIG_PCIEPORTBUS=y
CONFIG_PCI_HOST_GENERIC=y CONFIG_PCI_HOST_GENERIC=y
@ -38,12 +39,15 @@ CONFIG_PCIE_XILINX=y
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y CONFIG_DEVTMPFS_MOUNT=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR=y
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y CONFIG_ATA=y
CONFIG_SATA_AHCI=y CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_VIRTIO_NET=y
CONFIG_MACB=y CONFIG_MACB=y
CONFIG_E1000E=y CONFIG_E1000E=y
CONFIG_R8169=y CONFIG_R8169=y
@ -54,11 +58,14 @@ CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
CONFIG_HVC_RISCV_SBI=y CONFIG_HVC_RISCV_SBI=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_PTP_1588_CLOCK is not set # CONFIG_PTP_1588_CLOCK is not set
CONFIG_POWER_RESET=y CONFIG_POWER_RESET=y
CONFIG_DRM=y CONFIG_DRM=y
CONFIG_DRM_RADEON=y CONFIG_DRM_RADEON=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_USB=y CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_HCD=y
@ -70,6 +77,12 @@ CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y CONFIG_USB_UAS=y
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y CONFIG_AUTOFS4_FS=y
@ -84,16 +97,17 @@ CONFIG_NFS_V4_2=y
CONFIG_ROOT_NFS=y CONFIG_ROOT_NFS=y
CONFIG_9P_FS=y CONFIG_9P_FS=y
CONFIG_CRYPTO_USER_API_HASH=y CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_FS=y CONFIG_DEBUG_FS=y
CONFIG_DEBUG_PAGEALLOC=y CONFIG_DEBUG_PAGEALLOC=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_DEBUG_VM=y CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_PGFLAGS=y CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_MEMORY_INIT=y CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_SOFTLOCKUP_DETECTOR=y CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_WQ_WATCHDOG=y CONFIG_WQ_WATCHDOG=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_DEBUG_TIMEKEEPING=y CONFIG_DEBUG_TIMEKEEPING=y
CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK=y

View file

@ -15,12 +15,12 @@ static inline void clint_send_ipi_single(unsigned long hartid)
writel(1, clint_ipi_base + hartid); writel(1, clint_ipi_base + hartid);
} }
static inline void clint_send_ipi_mask(const struct cpumask *hartid_mask) static inline void clint_send_ipi_mask(const struct cpumask *mask)
{ {
int hartid; int cpu;
for_each_cpu(hartid, hartid_mask) for_each_cpu(cpu, mask)
clint_send_ipi_single(hartid); clint_send_ipi_single(cpuid_to_hartid_map(cpu));
} }
static inline void clint_clear_ipi(unsigned long hartid) static inline void clint_clear_ipi(unsigned long hartid)

View file

@ -19,6 +19,47 @@
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <linux/mm_types.h> #include <linux/mm_types.h>
#ifdef CONFIG_MMU
#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
#define VMALLOC_END (PAGE_OFFSET - 1)
#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
#define BPF_JIT_REGION_SIZE (SZ_128M)
#define BPF_JIT_REGION_START (PAGE_OFFSET - BPF_JIT_REGION_SIZE)
#define BPF_JIT_REGION_END (VMALLOC_END)
/*
* Roughly size the vmemmap space to be large enough to fit enough
* struct pages to map half the virtual address space. Then
* position vmemmap directly below the VMALLOC region.
*/
#define VMEMMAP_SHIFT \
(CONFIG_VA_BITS - PAGE_SHIFT - 1 + STRUCT_PAGE_MAX_SHIFT)
#define VMEMMAP_SIZE BIT(VMEMMAP_SHIFT)
#define VMEMMAP_END (VMALLOC_START - 1)
#define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE)
/*
* Define vmemmap for pfn_to_page & page_to_pfn calls. Needed if kernel
* is configured with CONFIG_SPARSEMEM_VMEMMAP enabled.
*/
#define vmemmap ((struct page *)VMEMMAP_START)
#define PCI_IO_SIZE SZ_16M
#define PCI_IO_END VMEMMAP_START
#define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE)
#define FIXADDR_TOP PCI_IO_START
#ifdef CONFIG_64BIT
#define FIXADDR_SIZE PMD_SIZE
#else
#define FIXADDR_SIZE PGDIR_SIZE
#endif
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
#endif
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
#include <asm/pgtable-64.h> #include <asm/pgtable-64.h>
#else #else
@ -90,31 +131,6 @@ extern pgd_t swapper_pg_dir[];
#define __S110 PAGE_SHARED_EXEC #define __S110 PAGE_SHARED_EXEC
#define __S111 PAGE_SHARED_EXEC #define __S111 PAGE_SHARED_EXEC
#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
#define VMALLOC_END (PAGE_OFFSET - 1)
#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
#define BPF_JIT_REGION_SIZE (SZ_128M)
#define BPF_JIT_REGION_START (PAGE_OFFSET - BPF_JIT_REGION_SIZE)
#define BPF_JIT_REGION_END (VMALLOC_END)
/*
* Roughly size the vmemmap space to be large enough to fit enough
* struct pages to map half the virtual address space. Then
* position vmemmap directly below the VMALLOC region.
*/
#define VMEMMAP_SHIFT \
(CONFIG_VA_BITS - PAGE_SHIFT - 1 + STRUCT_PAGE_MAX_SHIFT)
#define VMEMMAP_SIZE BIT(VMEMMAP_SHIFT)
#define VMEMMAP_END (VMALLOC_START - 1)
#define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE)
/*
* Define vmemmap for pfn_to_page & page_to_pfn calls. Needed if kernel
* is configured with CONFIG_SPARSEMEM_VMEMMAP enabled.
*/
#define vmemmap ((struct page *)VMEMMAP_START)
static inline int pmd_present(pmd_t pmd) static inline int pmd_present(pmd_t pmd)
{ {
return (pmd_val(pmd) & (_PAGE_PRESENT | _PAGE_PROT_NONE)); return (pmd_val(pmd) & (_PAGE_PRESENT | _PAGE_PROT_NONE));
@ -432,18 +448,6 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
#define PCI_IO_SIZE SZ_16M
#define PCI_IO_END VMEMMAP_START
#define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE)
#define FIXADDR_TOP PCI_IO_START
#ifdef CONFIG_64BIT
#define FIXADDR_SIZE PMD_SIZE
#else
#define FIXADDR_SIZE PGDIR_SIZE
#endif
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
/* /*
* Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32. * Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32.
* Note that PGDIR_SIZE must evenly divide TASK_SIZE. * Note that PGDIR_SIZE must evenly divide TASK_SIZE.

View file

@ -11,6 +11,24 @@
/* /*
* User space memory access functions * User space memory access functions
*/ */
extern unsigned long __must_check __asm_copy_to_user(void __user *to,
const void *from, unsigned long n);
extern unsigned long __must_check __asm_copy_from_user(void *to,
const void __user *from, unsigned long n);
static inline unsigned long
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
return __asm_copy_from_user(to, from, n);
}
static inline unsigned long
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
return __asm_copy_to_user(to, from, n);
}
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/compiler.h> #include <linux/compiler.h>
@ -367,24 +385,6 @@ do { \
-EFAULT; \ -EFAULT; \
}) })
extern unsigned long __must_check __asm_copy_to_user(void __user *to,
const void *from, unsigned long n);
extern unsigned long __must_check __asm_copy_from_user(void *to,
const void __user *from, unsigned long n);
static inline unsigned long
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
return __asm_copy_from_user(to, from, n);
}
static inline unsigned long
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
return __asm_copy_to_user(to, from, n);
}
extern long strncpy_from_user(char *dest, const char __user *src, long count); extern long strncpy_from_user(char *dest, const char __user *src, long count);
extern long __must_check strlen_user(const char __user *str); extern long __must_check strlen_user(const char __user *str);

View file

@ -96,7 +96,7 @@ static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_type op)
if (IS_ENABLED(CONFIG_RISCV_SBI)) if (IS_ENABLED(CONFIG_RISCV_SBI))
sbi_send_ipi(cpumask_bits(&hartid_mask)); sbi_send_ipi(cpumask_bits(&hartid_mask));
else else
clint_send_ipi_mask(&hartid_mask); clint_send_ipi_mask(mask);
} }
static void send_ipi_single(int cpu, enum ipi_message_type op) static void send_ipi_single(int cpu, enum ipi_message_type op)

View file

@ -2,5 +2,5 @@
lib-y += delay.o lib-y += delay.o
lib-y += memcpy.o lib-y += memcpy.o
lib-y += memset.o lib-y += memset.o
lib-$(CONFIG_MMU) += uaccess.o lib-y += uaccess.o
lib-$(CONFIG_64BIT) += tishift.o lib-$(CONFIG_64BIT) += tishift.o

View file

@ -1445,6 +1445,8 @@ static void limit_periodic_timer_frequency(struct kvm_lapic *apic)
} }
} }
static void cancel_hv_timer(struct kvm_lapic *apic);
static void apic_update_lvtt(struct kvm_lapic *apic) static void apic_update_lvtt(struct kvm_lapic *apic)
{ {
u32 timer_mode = kvm_lapic_get_reg(apic, APIC_LVTT) & u32 timer_mode = kvm_lapic_get_reg(apic, APIC_LVTT) &
@ -1454,6 +1456,10 @@ static void apic_update_lvtt(struct kvm_lapic *apic)
if (apic_lvtt_tscdeadline(apic) != (timer_mode == if (apic_lvtt_tscdeadline(apic) != (timer_mode ==
APIC_LVT_TIMER_TSCDEADLINE)) { APIC_LVT_TIMER_TSCDEADLINE)) {
hrtimer_cancel(&apic->lapic_timer.timer); hrtimer_cancel(&apic->lapic_timer.timer);
preempt_disable();
if (apic->lapic_timer.hv_timer_in_use)
cancel_hv_timer(apic);
preempt_enable();
kvm_lapic_set_reg(apic, APIC_TMICT, 0); kvm_lapic_set_reg(apic, APIC_TMICT, 0);
apic->lapic_timer.period = 0; apic->lapic_timer.period = 0;
apic->lapic_timer.tscdeadline = 0; apic->lapic_timer.tscdeadline = 0;
@ -1715,7 +1721,7 @@ static void start_sw_period(struct kvm_lapic *apic)
hrtimer_start(&apic->lapic_timer.timer, hrtimer_start(&apic->lapic_timer.timer,
apic->lapic_timer.target_expiration, apic->lapic_timer.target_expiration,
HRTIMER_MODE_ABS); HRTIMER_MODE_ABS_HARD);
} }
bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu) bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)

View file

@ -1933,14 +1933,6 @@ static void sev_clflush_pages(struct page *pages[], unsigned long npages)
static void __unregister_enc_region_locked(struct kvm *kvm, static void __unregister_enc_region_locked(struct kvm *kvm,
struct enc_region *region) struct enc_region *region)
{ {
/*
* The guest may change the memory encryption attribute from C=0 -> C=1
* or vice versa for this memory range. Lets make sure caches are
* flushed to ensure that guest data gets written into memory with
* correct C-bit.
*/
sev_clflush_pages(region->pages, region->npages);
sev_unpin_memory(kvm, region->pages, region->npages); sev_unpin_memory(kvm, region->pages, region->npages);
list_del(&region->list); list_del(&region->list);
kfree(region); kfree(region);
@ -1970,6 +1962,13 @@ static void sev_vm_destroy(struct kvm *kvm)
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
/*
* Ensure that all guest tagged cache entries are flushed before
* releasing the pages back to the system for use. CLFLUSH will
* not do this, so issue a WBINVD.
*/
wbinvd_on_all_cpus();
/* /*
* if userspace was terminated before unregistering the memory regions * if userspace was terminated before unregistering the memory regions
* then lets unpin all the registered memory. * then lets unpin all the registered memory.
@ -7158,6 +7157,9 @@ static int svm_mem_enc_op(struct kvm *kvm, void __user *argp)
if (!svm_sev_enabled()) if (!svm_sev_enabled())
return -ENOTTY; return -ENOTTY;
if (!argp)
return 0;
if (copy_from_user(&sev_cmd, argp, sizeof(struct kvm_sev_cmd))) if (copy_from_user(&sev_cmd, argp, sizeof(struct kvm_sev_cmd)))
return -EFAULT; return -EFAULT;
@ -7285,6 +7287,13 @@ static int svm_unregister_enc_region(struct kvm *kvm,
goto failed; goto failed;
} }
/*
* Ensure that all guest tagged cache entries are flushed before
* releasing the pages back to the system for use. CLFLUSH will
* not do this, so issue a WBINVD.
*/
wbinvd_on_all_cpus();
__unregister_enc_region_locked(kvm, region); __unregister_enc_region_locked(kvm, region);
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);

View file

@ -6287,7 +6287,7 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
#endif #endif
ASM_CALL_CONSTRAINT ASM_CALL_CONSTRAINT
: :
THUNK_TARGET(entry), [thunk_target]"r"(entry),
[ss]"i"(__KERNEL_DS), [ss]"i"(__KERNEL_DS),
[cs]"i"(__KERNEL_CS) [cs]"i"(__KERNEL_CS)
); );

View file

@ -1554,7 +1554,10 @@ EXPORT_SYMBOL_GPL(kvm_emulate_wrmsr);
*/ */
static int handle_fastpath_set_x2apic_icr_irqoff(struct kvm_vcpu *vcpu, u64 data) static int handle_fastpath_set_x2apic_icr_irqoff(struct kvm_vcpu *vcpu, u64 data)
{ {
if (lapic_in_kernel(vcpu) && apic_x2apic_mode(vcpu->arch.apic) && if (!lapic_in_kernel(vcpu) || !apic_x2apic_mode(vcpu->arch.apic))
return 1;
if (((data & APIC_SHORT_MASK) == APIC_DEST_NOSHORT) &&
((data & APIC_DEST_MASK) == APIC_DEST_PHYSICAL) && ((data & APIC_DEST_MASK) == APIC_DEST_PHYSICAL) &&
((data & APIC_MODE_MASK) == APIC_DM_FIXED)) { ((data & APIC_MODE_MASK) == APIC_DM_FIXED)) {
@ -2444,7 +2447,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
vcpu->hv_clock.tsc_timestamp = tsc_timestamp; vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset; vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
vcpu->last_guest_tsc = tsc_timestamp; vcpu->last_guest_tsc = tsc_timestamp;
WARN_ON((s64)vcpu->hv_clock.system_time < 0);
/* If the host uses TSC clocksource, then it is stable */ /* If the host uses TSC clocksource, then it is stable */
pvclock_flags = 0; pvclock_flags = 0;

View file

@ -97,30 +97,13 @@ static ssize_t phys_index_show(struct device *dev,
} }
/* /*
* Show whether the memory block is likely to be offlineable (or is already * Legacy interface that we cannot remove. Always indicate "removable"
* offline). Once offline, the memory block could be removed. The return * with CONFIG_MEMORY_HOTREMOVE - bad heuristic.
* value does, however, not indicate that there is a way to remove the
* memory block.
*/ */
static ssize_t removable_show(struct device *dev, struct device_attribute *attr, static ssize_t removable_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct memory_block *mem = to_memory_block(dev); return sprintf(buf, "%d\n", (int)IS_ENABLED(CONFIG_MEMORY_HOTREMOVE));
unsigned long pfn;
int ret = 1, i;
if (mem->state != MEM_ONLINE)
goto out;
for (i = 0; i < sections_per_block; i++) {
if (!present_section_nr(mem->start_section_nr + i))
continue;
pfn = section_nr_to_pfn(mem->start_section_nr + i);
ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
}
out:
return sprintf(buf, "%d\n", ret);
} }
/* /*

View file

@ -345,7 +345,7 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
if (ret) if (ret)
goto unlock; goto unlock;
*buf = readl(rsb->regs + RSB_DATA); *buf = readl(rsb->regs + RSB_DATA) & GENMASK(len * 8 - 1, 0);
unlock: unlock:
mutex_unlock(&rsb->lock); mutex_unlock(&rsb->lock);

View file

@ -1266,6 +1266,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0), SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0),
SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff,
SYSC_MODULE_QUIRK_SGX), SYSC_MODULE_QUIRK_SGX),
SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff,
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,
0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -1, 0x4ea2080d, 0xffffffff, SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -1, 0x4ea2080d, 0xffffffff,
@ -1294,7 +1296,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0), SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0),
SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0), SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0),
SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0), SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0),
SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff, 0),
SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44306302, 0xffffffff, 0), SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44306302, 0xffffffff, 0),
SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44307b02, 0xffffffff, 0), SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44307b02, 0xffffffff, 0),
SYSC_QUIRK("mcbsp", 0, -1, 0x8c, -1, 0, 0, 0), SYSC_QUIRK("mcbsp", 0, -1, 0x8c, -1, 0, 0, 0),

View file

@ -560,7 +560,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
hws[IMX8MP_CLK_MEDIA_AXI] = imx8m_clk_hw_composite("media_axi", imx8mp_media_axi_sels, ccm_base + 0x8a00); hws[IMX8MP_CLK_MEDIA_AXI] = imx8m_clk_hw_composite("media_axi", imx8mp_media_axi_sels, ccm_base + 0x8a00);
hws[IMX8MP_CLK_MEDIA_APB] = imx8m_clk_hw_composite("media_apb", imx8mp_media_apb_sels, ccm_base + 0x8a80); hws[IMX8MP_CLK_MEDIA_APB] = imx8m_clk_hw_composite("media_apb", imx8mp_media_apb_sels, ccm_base + 0x8a80);
hws[IMX8MP_CLK_HDMI_APB] = imx8m_clk_hw_composite("hdmi_apb", imx8mp_media_apb_sels, ccm_base + 0x8b00); hws[IMX8MP_CLK_HDMI_APB] = imx8m_clk_hw_composite("hdmi_apb", imx8mp_media_apb_sels, ccm_base + 0x8b00);
hws[IMX8MP_CLK_HDMI_AXI] = imx8m_clk_hw_composite("hdmi_axi", imx8mp_media_apb_sels, ccm_base + 0x8b80); hws[IMX8MP_CLK_HDMI_AXI] = imx8m_clk_hw_composite("hdmi_axi", imx8mp_media_axi_sels, ccm_base + 0x8b80);
hws[IMX8MP_CLK_GPU_AXI] = imx8m_clk_hw_composite("gpu_axi", imx8mp_gpu_axi_sels, ccm_base + 0x8c00); hws[IMX8MP_CLK_GPU_AXI] = imx8m_clk_hw_composite("gpu_axi", imx8mp_gpu_axi_sels, ccm_base + 0x8c00);
hws[IMX8MP_CLK_GPU_AHB] = imx8m_clk_hw_composite("gpu_ahb", imx8mp_gpu_ahb_sels, ccm_base + 0x8c80); hws[IMX8MP_CLK_GPU_AHB] = imx8m_clk_hw_composite("gpu_ahb", imx8mp_gpu_ahb_sels, ccm_base + 0x8c80);
hws[IMX8MP_CLK_NOC] = imx8m_clk_hw_composite_critical("noc", imx8mp_noc_sels, ccm_base + 0x8d00); hws[IMX8MP_CLK_NOC] = imx8m_clk_hw_composite_critical("noc", imx8mp_noc_sels, ccm_base + 0x8d00);
@ -686,7 +686,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
hws[IMX8MP_CLK_CAN1_ROOT] = imx_clk_hw_gate2("can1_root_clk", "can1", ccm_base + 0x4350, 0); hws[IMX8MP_CLK_CAN1_ROOT] = imx_clk_hw_gate2("can1_root_clk", "can1", ccm_base + 0x4350, 0);
hws[IMX8MP_CLK_CAN2_ROOT] = imx_clk_hw_gate2("can2_root_clk", "can2", ccm_base + 0x4360, 0); hws[IMX8MP_CLK_CAN2_ROOT] = imx_clk_hw_gate2("can2_root_clk", "can2", ccm_base + 0x4360, 0);
hws[IMX8MP_CLK_SDMA1_ROOT] = imx_clk_hw_gate4("sdma1_root_clk", "ipg_root", ccm_base + 0x43a0, 0); hws[IMX8MP_CLK_SDMA1_ROOT] = imx_clk_hw_gate4("sdma1_root_clk", "ipg_root", ccm_base + 0x43a0, 0);
hws[IMX8MP_CLK_ENET_QOS_ROOT] = imx_clk_hw_gate4("enet_qos_root_clk", "enet_axi", ccm_base + 0x43b0, 0); hws[IMX8MP_CLK_ENET_QOS_ROOT] = imx_clk_hw_gate4("enet_qos_root_clk", "sim_enet_root_clk", ccm_base + 0x43b0, 0);
hws[IMX8MP_CLK_SIM_ENET_ROOT] = imx_clk_hw_gate4("sim_enet_root_clk", "enet_axi", ccm_base + 0x4400, 0); hws[IMX8MP_CLK_SIM_ENET_ROOT] = imx_clk_hw_gate4("sim_enet_root_clk", "enet_axi", ccm_base + 0x4400, 0);
hws[IMX8MP_CLK_GPU2D_ROOT] = imx_clk_hw_gate4("gpu2d_root_clk", "gpu2d_div", ccm_base + 0x4450, 0); hws[IMX8MP_CLK_GPU2D_ROOT] = imx_clk_hw_gate4("gpu2d_root_clk", "gpu2d_div", ccm_base + 0x4450, 0);
hws[IMX8MP_CLK_GPU3D_ROOT] = imx_clk_hw_gate4("gpu3d_root_clk", "gpu3d_core_div", ccm_base + 0x4460, 0); hws[IMX8MP_CLK_GPU3D_ROOT] = imx_clk_hw_gate4("gpu3d_root_clk", "gpu3d_core_div", ccm_base + 0x4460, 0);

View file

@ -43,12 +43,12 @@ struct imx_sc_msg_req_set_clock_rate {
__le32 rate; __le32 rate;
__le16 resource; __le16 resource;
u8 clk; u8 clk;
} __packed; } __packed __aligned(4);
struct req_get_clock_rate { struct req_get_clock_rate {
__le16 resource; __le16 resource;
u8 clk; u8 clk;
} __packed; } __packed __aligned(4);
struct resp_get_clock_rate { struct resp_get_clock_rate {
__le32 rate; __le32 rate;
@ -84,7 +84,7 @@ struct imx_sc_msg_get_clock_parent {
struct req_get_clock_parent { struct req_get_clock_parent {
__le16 resource; __le16 resource;
u8 clk; u8 clk;
} __packed req; } __packed __aligned(4) req;
struct resp_get_clock_parent { struct resp_get_clock_parent {
u8 parent; u8 parent;
} resp; } resp;
@ -121,7 +121,7 @@ struct imx_sc_msg_req_clock_enable {
u8 clk; u8 clk;
u8 enable; u8 enable;
u8 autog; u8 autog;
} __packed; } __packed __aligned(4);
static inline struct clk_scu *to_clk_scu(struct clk_hw *hw) static inline struct clk_scu *to_clk_scu(struct clk_hw *hw)
{ {

View file

@ -78,7 +78,7 @@ static const struct omap_clkctrl_reg_data am4_gfx_l3_clkctrl_regs[] __initconst
}; };
static const struct omap_clkctrl_reg_data am4_l4_rtc_clkctrl_regs[] __initconst = { static const struct omap_clkctrl_reg_data am4_l4_rtc_clkctrl_regs[] __initconst = {
{ AM4_L4_RTC_RTC_CLKCTRL, NULL, CLKF_SW_SUP, "clk_32768_ck" }, { AM4_L4_RTC_RTC_CLKCTRL, NULL, CLKF_SW_SUP, "clkdiv32k_ick" },
{ 0 }, { 0 },
}; };

View file

@ -343,7 +343,8 @@ static u64 notrace read_hv_clock_tsc_cs(struct clocksource *arg)
static u64 read_hv_sched_clock_tsc(void) static u64 read_hv_sched_clock_tsc(void)
{ {
return read_hv_clock_tsc() - hv_sched_clock_offset; return (read_hv_clock_tsc() - hv_sched_clock_offset) *
(NSEC_PER_SEC / HV_CLOCK_HZ);
} }
static void suspend_hv_clock_tsc(struct clocksource *arg) static void suspend_hv_clock_tsc(struct clocksource *arg)
@ -398,7 +399,8 @@ static u64 notrace read_hv_clock_msr_cs(struct clocksource *arg)
static u64 read_hv_sched_clock_msr(void) static u64 read_hv_sched_clock_msr(void)
{ {
return read_hv_clock_msr() - hv_sched_clock_offset; return (read_hv_clock_msr() - hv_sched_clock_offset) *
(NSEC_PER_SEC / HV_CLOCK_HZ);
} }
static struct clocksource hyperv_cs_msr = { static struct clocksource hyperv_cs_msr = {

View file

@ -974,7 +974,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
/* Map SG to device */ /* Map SG to device */
r = -ENOMEM; r = -ENOMEM;
nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, direction); nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
if (nents != ttm->sg->nents) if (nents == 0)
goto release_sg; goto release_sg;
/* convert SG to linear array of pages and dma addresses */ /* convert SG to linear array of pages and dma addresses */

View file

@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
index = 0; index = 0;
for_each_sg(sgt->sgl, sg, sgt->nents, count) { for_each_sg(sgt->sgl, sg, sgt->nents, count) {
len = sg->length; len = sg_dma_len(sg);
page = sg_page(sg); page = sg_page(sg);
addr = sg_dma_address(sg); addr = sg_dma_address(sg);

View file

@ -528,7 +528,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)
r = -ENOMEM; r = -ENOMEM;
nents = dma_map_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction); nents = dma_map_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
if (nents != ttm->sg->nents) if (nents == 0)
goto release_sg; goto release_sg;
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,

View file

@ -661,7 +661,9 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb)
trace_drm_sched_process_job(s_fence); trace_drm_sched_process_job(s_fence);
dma_fence_get(&s_fence->finished);
drm_sched_fence_finished(s_fence); drm_sched_fence_finished(s_fence);
dma_fence_put(&s_fence->finished);
wake_up_interruptible(&sched->wake_up_worker); wake_up_interruptible(&sched->wake_up_worker);
} }

View file

@ -477,6 +477,7 @@ static int hix5hd2_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&priv->adap); i2c_del_adapter(&priv->adap);
pm_runtime_disable(priv->dev); pm_runtime_disable(priv->dev);
pm_runtime_set_suspended(priv->dev); pm_runtime_set_suspended(priv->dev);
clk_disable_unprepare(priv->clk);
return 0; return 0;
} }

View file

@ -8,6 +8,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@ -75,20 +76,15 @@ static void gpu_enable_i2c_bus(struct gpu_i2c_dev *i2cd)
static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd) static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd)
{ {
unsigned long target = jiffies + msecs_to_jiffies(1000);
u32 val; u32 val;
int ret;
do { ret = readl_poll_timeout(i2cd->regs + I2C_MST_CNTL, val,
val = readl(i2cd->regs + I2C_MST_CNTL); !(val & I2C_MST_CNTL_CYCLE_TRIGGER) ||
if (!(val & I2C_MST_CNTL_CYCLE_TRIGGER)) (val & I2C_MST_CNTL_STATUS) != I2C_MST_CNTL_STATUS_BUS_BUSY,
break; 500, 1000 * USEC_PER_MSEC);
if ((val & I2C_MST_CNTL_STATUS) !=
I2C_MST_CNTL_STATUS_BUS_BUSY)
break;
usleep_range(500, 600);
} while (time_is_after_jiffies(target));
if (time_is_before_jiffies(target)) { if (ret) {
dev_err(i2cd->dev, "i2c timeout error %x\n", val); dev_err(i2cd->dev, "i2c timeout error %x\n", val);
return -ETIMEDOUT; return -ETIMEDOUT;
} }

View file

@ -140,7 +140,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
int ret = 0; int ret = 0;
int irq; int irq;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq_optional(pdev, 0);
/* If irq is 0, we do polling. */ /* If irq is 0, we do polling. */
if (irq < 0) if (irq < 0)
irq = 0; irq = 0;

View file

@ -434,6 +434,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev)
/** /**
* st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode
* @i2c_dev: Controller's private data * @i2c_dev: Controller's private data
* @max: Maximum amount of data to fill into the Tx FIFO
* *
* This functions fills the Tx FIFO with fixed pattern when * This functions fills the Tx FIFO with fixed pattern when
* in read mode to trigger clock. * in read mode to trigger clock.

View file

@ -896,7 +896,9 @@ static int add_one_compat_dev(struct ib_device *device,
cdev->dev.parent = device->dev.parent; cdev->dev.parent = device->dev.parent;
rdma_init_coredev(cdev, device, read_pnet(&rnet->net)); rdma_init_coredev(cdev, device, read_pnet(&rnet->net));
cdev->dev.release = compatdev_release; cdev->dev.release = compatdev_release;
dev_set_name(&cdev->dev, "%s", dev_name(&device->dev)); ret = dev_set_name(&cdev->dev, "%s", dev_name(&device->dev));
if (ret)
goto add_err;
ret = device_add(&cdev->dev); ret = device_add(&cdev->dev);
if (ret) if (ret)

View file

@ -918,6 +918,10 @@ static int nldev_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
nla_strlcpy(name, tb[RDMA_NLDEV_ATTR_DEV_NAME], nla_strlcpy(name, tb[RDMA_NLDEV_ATTR_DEV_NAME],
IB_DEVICE_NAME_MAX); IB_DEVICE_NAME_MAX);
if (strlen(name) == 0) {
err = -EINVAL;
goto done;
}
err = ib_device_rename(device, name); err = ib_device_rename(device, name);
goto done; goto done;
} }
@ -1514,7 +1518,7 @@ static int nldev_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
nla_strlcpy(ibdev_name, tb[RDMA_NLDEV_ATTR_DEV_NAME], nla_strlcpy(ibdev_name, tb[RDMA_NLDEV_ATTR_DEV_NAME],
sizeof(ibdev_name)); sizeof(ibdev_name));
if (strchr(ibdev_name, '%')) if (strchr(ibdev_name, '%') || strlen(ibdev_name) == 0)
return -EINVAL; return -EINVAL;
nla_strlcpy(type, tb[RDMA_NLDEV_ATTR_LINK_TYPE], sizeof(type)); nla_strlcpy(type, tb[RDMA_NLDEV_ATTR_LINK_TYPE], sizeof(type));

View file

@ -349,16 +349,11 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp,
else if (qp_pps) else if (qp_pps)
new_pps->main.pkey_index = qp_pps->main.pkey_index; new_pps->main.pkey_index = qp_pps->main.pkey_index;
if ((qp_attr_mask & IB_QP_PKEY_INDEX) && (qp_attr_mask & IB_QP_PORT)) if (((qp_attr_mask & IB_QP_PKEY_INDEX) &&
(qp_attr_mask & IB_QP_PORT)) ||
(qp_pps && qp_pps->main.state != IB_PORT_PKEY_NOT_VALID))
new_pps->main.state = IB_PORT_PKEY_VALID; new_pps->main.state = IB_PORT_PKEY_VALID;
if (!(qp_attr_mask & (IB_QP_PKEY_INDEX | IB_QP_PORT)) && qp_pps) {
new_pps->main.port_num = qp_pps->main.port_num;
new_pps->main.pkey_index = qp_pps->main.pkey_index;
if (qp_pps->main.state != IB_PORT_PKEY_NOT_VALID)
new_pps->main.state = IB_PORT_PKEY_VALID;
}
if (qp_attr_mask & IB_QP_ALT_PATH) { if (qp_attr_mask & IB_QP_ALT_PATH) {
new_pps->alt.port_num = qp_attr->alt_port_num; new_pps->alt.port_num = qp_attr->alt_port_num;
new_pps->alt.pkey_index = qp_attr->alt_pkey_index; new_pps->alt.pkey_index = qp_attr->alt_pkey_index;

View file

@ -275,8 +275,8 @@ void ib_umem_odp_release(struct ib_umem_odp *umem_odp)
mmu_interval_notifier_remove(&umem_odp->notifier); mmu_interval_notifier_remove(&umem_odp->notifier);
kvfree(umem_odp->dma_list); kvfree(umem_odp->dma_list);
kvfree(umem_odp->page_list); kvfree(umem_odp->page_list);
put_pid(umem_odp->tgid);
} }
put_pid(umem_odp->tgid);
kfree(umem_odp); kfree(umem_odp);
} }
EXPORT_SYMBOL(ib_umem_odp_release); EXPORT_SYMBOL(ib_umem_odp_release);

View file

@ -1129,17 +1129,30 @@ static const struct file_operations umad_sm_fops = {
.llseek = no_llseek, .llseek = no_llseek,
}; };
static struct ib_umad_port *get_port(struct ib_device *ibdev,
struct ib_umad_device *umad_dev,
unsigned int port)
{
if (!umad_dev)
return ERR_PTR(-EOPNOTSUPP);
if (!rdma_is_port_valid(ibdev, port))
return ERR_PTR(-EINVAL);
if (!rdma_cap_ib_mad(ibdev, port))
return ERR_PTR(-EOPNOTSUPP);
return &umad_dev->ports[port - rdma_start_port(ibdev)];
}
static int ib_umad_get_nl_info(struct ib_device *ibdev, void *client_data, static int ib_umad_get_nl_info(struct ib_device *ibdev, void *client_data,
struct ib_client_nl_info *res) struct ib_client_nl_info *res)
{ {
struct ib_umad_device *umad_dev = client_data; struct ib_umad_port *port = get_port(ibdev, client_data, res->port);
if (!rdma_is_port_valid(ibdev, res->port)) if (IS_ERR(port))
return -EINVAL; return PTR_ERR(port);
res->abi = IB_USER_MAD_ABI_VERSION; res->abi = IB_USER_MAD_ABI_VERSION;
res->cdev = &umad_dev->ports[res->port - rdma_start_port(ibdev)].dev; res->cdev = &port->dev;
return 0; return 0;
} }
@ -1154,15 +1167,13 @@ MODULE_ALIAS_RDMA_CLIENT("umad");
static int ib_issm_get_nl_info(struct ib_device *ibdev, void *client_data, static int ib_issm_get_nl_info(struct ib_device *ibdev, void *client_data,
struct ib_client_nl_info *res) struct ib_client_nl_info *res)
{ {
struct ib_umad_device *umad_dev = struct ib_umad_port *port = get_port(ibdev, client_data, res->port);
ib_get_client_data(ibdev, &umad_client);
if (!rdma_is_port_valid(ibdev, res->port)) if (IS_ERR(port))
return -EINVAL; return PTR_ERR(port);
res->abi = IB_USER_MAD_ABI_VERSION; res->abi = IB_USER_MAD_ABI_VERSION;
res->cdev = &umad_dev->ports[res->port - rdma_start_port(ibdev)].sm_dev; res->cdev = &port->sm_dev;
return 0; return 0;
} }

View file

@ -141,6 +141,7 @@ static int defer_packet_queue(
*/ */
xchg(&pq->state, SDMA_PKT_Q_DEFERRED); xchg(&pq->state, SDMA_PKT_Q_DEFERRED);
if (list_empty(&pq->busy.list)) { if (list_empty(&pq->busy.list)) {
pq->busy.lock = &sde->waitlock;
iowait_get_priority(&pq->busy); iowait_get_priority(&pq->busy);
iowait_queue(pkts_sent, &pq->busy, &sde->dmawait); iowait_queue(pkts_sent, &pq->busy, &sde->dmawait);
} }
@ -155,6 +156,7 @@ static void activate_packet_queue(struct iowait *wait, int reason)
{ {
struct hfi1_user_sdma_pkt_q *pq = struct hfi1_user_sdma_pkt_q *pq =
container_of(wait, struct hfi1_user_sdma_pkt_q, busy); container_of(wait, struct hfi1_user_sdma_pkt_q, busy);
pq->busy.lock = NULL;
xchg(&pq->state, SDMA_PKT_Q_ACTIVE); xchg(&pq->state, SDMA_PKT_Q_ACTIVE);
wake_up(&wait->wait_dma); wake_up(&wait->wait_dma);
}; };
@ -256,6 +258,21 @@ pq_reqs_nomem:
return ret; return ret;
} }
static void flush_pq_iowait(struct hfi1_user_sdma_pkt_q *pq)
{
unsigned long flags;
seqlock_t *lock = pq->busy.lock;
if (!lock)
return;
write_seqlock_irqsave(lock, flags);
if (!list_empty(&pq->busy.list)) {
list_del_init(&pq->busy.list);
pq->busy.lock = NULL;
}
write_sequnlock_irqrestore(lock, flags);
}
int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd, int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd,
struct hfi1_ctxtdata *uctxt) struct hfi1_ctxtdata *uctxt)
{ {
@ -281,6 +298,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd,
kfree(pq->reqs); kfree(pq->reqs);
kfree(pq->req_in_use); kfree(pq->req_in_use);
kmem_cache_destroy(pq->txreq_cache); kmem_cache_destroy(pq->txreq_cache);
flush_pq_iowait(pq);
kfree(pq); kfree(pq);
} else { } else {
spin_unlock(&fd->pq_rcu_lock); spin_unlock(&fd->pq_rcu_lock);
@ -587,11 +605,12 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
if (ret < 0) { if (ret < 0) {
if (ret != -EBUSY) if (ret != -EBUSY)
goto free_req; goto free_req;
wait_event_interruptible_timeout( if (wait_event_interruptible_timeout(
pq->busy.wait_dma, pq->busy.wait_dma,
(pq->state == SDMA_PKT_Q_ACTIVE), pq->state == SDMA_PKT_Q_ACTIVE,
msecs_to_jiffies( msecs_to_jiffies(
SDMA_IOWAIT_TIMEOUT)); SDMA_IOWAIT_TIMEOUT)) <= 0)
flush_pq_iowait(pq);
} }
} }
*count += idx; *count += idx;

View file

@ -330,6 +330,22 @@ static void mlx5_handle_error_cqe(struct mlx5_ib_dev *dev,
dump_cqe(dev, cqe); dump_cqe(dev, cqe);
} }
static void handle_atomics(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64,
u16 tail, u16 head)
{
u16 idx;
do {
idx = tail & (qp->sq.wqe_cnt - 1);
if (idx == head)
break;
tail = qp->sq.w_list[idx].next;
} while (1);
tail = qp->sq.w_list[idx].next;
qp->sq.last_poll = tail;
}
static void free_cq_buf(struct mlx5_ib_dev *dev, struct mlx5_ib_cq_buf *buf) static void free_cq_buf(struct mlx5_ib_dev *dev, struct mlx5_ib_cq_buf *buf)
{ {
mlx5_frag_buf_free(dev->mdev, &buf->frag_buf); mlx5_frag_buf_free(dev->mdev, &buf->frag_buf);
@ -368,7 +384,7 @@ static void get_sig_err_item(struct mlx5_sig_err_cqe *cqe,
} }
static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc, static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc,
int *npolled, int is_send) int *npolled, bool is_send)
{ {
struct mlx5_ib_wq *wq; struct mlx5_ib_wq *wq;
unsigned int cur; unsigned int cur;
@ -383,10 +399,16 @@ static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc,
return; return;
for (i = 0; i < cur && np < num_entries; i++) { for (i = 0; i < cur && np < num_entries; i++) {
wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; unsigned int idx;
idx = (is_send) ? wq->last_poll : wq->tail;
idx &= (wq->wqe_cnt - 1);
wc->wr_id = wq->wrid[idx];
wc->status = IB_WC_WR_FLUSH_ERR; wc->status = IB_WC_WR_FLUSH_ERR;
wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR;
wq->tail++; wq->tail++;
if (is_send)
wq->last_poll = wq->w_list[idx].next;
np++; np++;
wc->qp = &qp->ibqp; wc->qp = &qp->ibqp;
wc++; wc++;
@ -473,6 +495,7 @@ repoll:
wqe_ctr = be16_to_cpu(cqe64->wqe_counter); wqe_ctr = be16_to_cpu(cqe64->wqe_counter);
idx = wqe_ctr & (wq->wqe_cnt - 1); idx = wqe_ctr & (wq->wqe_cnt - 1);
handle_good_req(wc, cqe64, wq, idx); handle_good_req(wc, cqe64, wq, idx);
handle_atomics(*cur_qp, cqe64, wq->last_poll, idx);
wc->wr_id = wq->wrid[idx]; wc->wr_id = wq->wrid[idx];
wq->tail = wq->wqe_head[idx] + 1; wq->tail = wq->wqe_head[idx] + 1;
wc->status = IB_WC_SUCCESS; wc->status = IB_WC_SUCCESS;

View file

@ -5723,9 +5723,10 @@ mlx5_ib_counter_alloc_stats(struct rdma_counter *counter)
const struct mlx5_ib_counters *cnts = const struct mlx5_ib_counters *cnts =
get_counters(dev, counter->port - 1); get_counters(dev, counter->port - 1);
/* Q counters are in the beginning of all counters */
return rdma_alloc_hw_stats_struct(cnts->names, return rdma_alloc_hw_stats_struct(cnts->names,
cnts->num_q_counters, cnts->num_q_counters +
cnts->num_cong_counters +
cnts->num_ext_ppcnt_counters,
RDMA_HW_STATS_DEFAULT_LIFESPAN); RDMA_HW_STATS_DEFAULT_LIFESPAN);
} }

View file

@ -288,6 +288,7 @@ struct mlx5_ib_wq {
unsigned head; unsigned head;
unsigned tail; unsigned tail;
u16 cur_post; u16 cur_post;
u16 last_poll;
void *cur_edge; void *cur_edge;
}; };

View file

@ -3775,6 +3775,7 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
qp->sq.cur_post = 0; qp->sq.cur_post = 0;
if (qp->sq.wqe_cnt) if (qp->sq.wqe_cnt)
qp->sq.cur_edge = get_sq_edge(&qp->sq, 0); qp->sq.cur_edge = get_sq_edge(&qp->sq, 0);
qp->sq.last_poll = 0;
qp->db.db[MLX5_RCV_DBR] = 0; qp->db.db[MLX5_RCV_DBR] = 0;
qp->db.db[MLX5_SND_DBR] = 0; qp->db.db[MLX5_SND_DBR] = 0;
} }
@ -6204,6 +6205,10 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
if (udata->outlen && udata->outlen < min_resp_len) if (udata->outlen && udata->outlen < min_resp_len)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
if (!capable(CAP_SYS_RAWIO) &&
init_attr->create_flags & IB_WQ_FLAGS_DELAY_DROP)
return ERR_PTR(-EPERM);
dev = to_mdev(pd->device); dev = to_mdev(pd->device);
switch (init_attr->wq_type) { switch (init_attr->wq_type) {
case IB_WQT_RQ: case IB_WQT_RQ:

View file

@ -327,7 +327,7 @@ void rvt_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata)
if (cq->ip) if (cq->ip)
kref_put(&cq->ip->ref, rvt_release_mmap_info); kref_put(&cq->ip->ref, rvt_release_mmap_info);
else else
vfree(cq->queue); vfree(cq->kqueue);
} }
/** /**

View file

@ -190,6 +190,7 @@ static void input_repeat_key(struct timer_list *t)
input_value_sync input_value_sync
}; };
input_set_timestamp(dev, ktime_get());
input_pass_values(dev, vals, ARRAY_SIZE(vals)); input_pass_values(dev, vals, ARRAY_SIZE(vals));
if (dev->rep[REP_PERIOD]) if (dev->rep[REP_PERIOD])

View file

@ -75,6 +75,14 @@ static struct touchkey_variant aries_touchkey_variant = {
.cmd_led_off = ARIES_TOUCHKEY_CMD_LED_OFF, .cmd_led_off = ARIES_TOUCHKEY_CMD_LED_OFF,
}; };
static const struct touchkey_variant tc360_touchkey_variant = {
.keycode_reg = 0x00,
.base_reg = 0x00,
.fixed_regulator = true,
.cmd_led_on = TM2_TOUCHKEY_CMD_LED_ON,
.cmd_led_off = TM2_TOUCHKEY_CMD_LED_OFF,
};
static int tm2_touchkey_led_brightness_set(struct led_classdev *led_dev, static int tm2_touchkey_led_brightness_set(struct led_classdev *led_dev,
enum led_brightness brightness) enum led_brightness brightness)
{ {
@ -327,6 +335,9 @@ static const struct of_device_id tm2_touchkey_of_match[] = {
}, { }, {
.compatible = "cypress,aries-touchkey", .compatible = "cypress,aries-touchkey",
.data = &aries_touchkey_variant, .data = &aries_touchkey_variant,
}, {
.compatible = "coreriver,tc360-touchkey",
.data = &tc360_touchkey_variant,
}, },
{ }, { },
}; };

View file

@ -186,6 +186,7 @@ static const char * const smbus_pnp_ids[] = {
"SYN3052", /* HP EliteBook 840 G4 */ "SYN3052", /* HP EliteBook 840 G4 */
"SYN3221", /* HP 15-ay000 */ "SYN3221", /* HP 15-ay000 */
"SYN323d", /* HP Spectre X360 13-w013dx */ "SYN323d", /* HP Spectre X360 13-w013dx */
"SYN3257", /* HP Envy 13-ad105ng */
NULL NULL
}; };

View file

@ -1203,8 +1203,8 @@ static int rmi_f11_initialize(struct rmi_function *fn)
* If distance threshold values are set, switch to reduced reporting * If distance threshold values are set, switch to reduced reporting
* mode so they actually get used by the controller. * mode so they actually get used by the controller.
*/ */
if (ctrl->ctrl0_11[RMI_F11_DELTA_X_THRESHOLD] || if (sensor->axis_align.delta_x_threshold ||
ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD]) { sensor->axis_align.delta_y_threshold) {
ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK; ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK;
ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED; ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED;
} }

View file

@ -432,7 +432,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
return 0; return 0;
} }
static bool raydium_i2c_boot_trigger(struct i2c_client *client) static int raydium_i2c_boot_trigger(struct i2c_client *client)
{ {
static const u8 cmd[7][6] = { static const u8 cmd[7][6] = {
{ 0x08, 0x0C, 0x09, 0x00, 0x50, 0xD7 }, { 0x08, 0x0C, 0x09, 0x00, 0x50, 0xD7 },
@ -457,10 +457,10 @@ static bool raydium_i2c_boot_trigger(struct i2c_client *client)
} }
} }
return false; return 0;
} }
static bool raydium_i2c_fw_trigger(struct i2c_client *client) static int raydium_i2c_fw_trigger(struct i2c_client *client)
{ {
static const u8 cmd[5][11] = { static const u8 cmd[5][11] = {
{ 0, 0x09, 0x71, 0x0C, 0x09, 0x00, 0x50, 0xD7, 0, 0, 0 }, { 0, 0x09, 0x71, 0x0C, 0x09, 0x00, 0x50, 0xD7, 0, 0, 0 },
@ -483,7 +483,7 @@ static bool raydium_i2c_fw_trigger(struct i2c_client *client)
} }
} }
return false; return 0;
} }
static int raydium_i2c_check_path(struct i2c_client *client) static int raydium_i2c_check_path(struct i2c_client *client)

View file

@ -648,11 +648,11 @@ static int mlxsw_sp_mr_vif_resolve(struct mlxsw_sp_mr_table *mr_table,
return 0; return 0;
err_erif_unresolve: err_erif_unresolve:
list_for_each_entry_from_reverse(erve, &mr_vif->route_evif_list, list_for_each_entry_continue_reverse(erve, &mr_vif->route_evif_list,
vif_node) vif_node)
mlxsw_sp_mr_route_evif_unresolve(mr_table, erve); mlxsw_sp_mr_route_evif_unresolve(mr_table, erve);
err_irif_unresolve: err_irif_unresolve:
list_for_each_entry_from_reverse(irve, &mr_vif->route_ivif_list, list_for_each_entry_continue_reverse(irve, &mr_vif->route_ivif_list,
vif_node) vif_node)
mlxsw_sp_mr_route_ivif_unresolve(mr_table, irve); mlxsw_sp_mr_route_ivif_unresolve(mr_table, irve);
mr_vif->rif = NULL; mr_vif->rif = NULL;

View file

@ -156,6 +156,50 @@ static int msg_enable;
* chip is busy transferring packet data (RX/TX FIFO accesses). * chip is busy transferring packet data (RX/TX FIFO accesses).
*/ */
/**
* ks_check_endian - Check whether endianness of the bus is correct
* @ks : The chip information
*
* The KS8851-16MLL EESK pin allows selecting the endianness of the 16bit
* bus. To maintain optimum performance, the bus endianness should be set
* such that it matches the endianness of the CPU.
*/
static int ks_check_endian(struct ks_net *ks)
{
u16 cider;
/*
* Read CIDER register first, however read it the "wrong" way around.
* If the endian strap on the KS8851-16MLL in incorrect and the chip
* is operating in different endianness than the CPU, then the meaning
* of BE[3:0] byte-enable bits is also swapped such that:
* BE[3,2,1,0] becomes BE[1,0,3,2]
*
* Luckily for us, the byte-enable bits are the top four MSbits of
* the address register and the CIDER register is at offset 0xc0.
* Hence, by reading address 0xc0c0, which is not impacted by endian
* swapping, we assert either BE[3:2] or BE[1:0] while reading the
* CIDER register.
*
* If the bus configuration is correct, reading 0xc0c0 asserts
* BE[3:2] and this read returns 0x0000, because to read register
* with bottom two LSbits of address set to 0, BE[1:0] must be
* asserted.
*
* If the bus configuration is NOT correct, reading 0xc0c0 asserts
* BE[1:0] and this read returns non-zero 0x8872 value.
*/
iowrite16(BE3 | BE2 | KS_CIDER, ks->hw_addr_cmd);
cider = ioread16(ks->hw_addr);
if (!cider)
return 0;
netdev_err(ks->netdev, "incorrect EESK endian strap setting\n");
return -EINVAL;
}
/** /**
* ks_rdreg16 - read 16 bit register from device * ks_rdreg16 - read 16 bit register from device
* @ks : The chip information * @ks : The chip information
@ -166,7 +210,7 @@ static int msg_enable;
static u16 ks_rdreg16(struct ks_net *ks, int offset) static u16 ks_rdreg16(struct ks_net *ks, int offset)
{ {
ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02)); ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
return ioread16(ks->hw_addr); return ioread16(ks->hw_addr);
} }
@ -181,7 +225,7 @@ static u16 ks_rdreg16(struct ks_net *ks, int offset)
static void ks_wrreg16(struct ks_net *ks, int offset, u16 value) static void ks_wrreg16(struct ks_net *ks, int offset, u16 value)
{ {
ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02)); ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
iowrite16(value, ks->hw_addr); iowrite16(value, ks->hw_addr);
} }
@ -197,7 +241,7 @@ static inline void ks_inblk(struct ks_net *ks, u16 *wptr, u32 len)
{ {
len >>= 1; len >>= 1;
while (len--) while (len--)
*wptr++ = be16_to_cpu(ioread16(ks->hw_addr)); *wptr++ = (u16)ioread16(ks->hw_addr);
} }
/** /**
@ -211,7 +255,7 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len)
{ {
len >>= 1; len >>= 1;
while (len--) while (len--)
iowrite16(cpu_to_be16(*wptr++), ks->hw_addr); iowrite16(*wptr++, ks->hw_addr);
} }
static void ks_disable_int(struct ks_net *ks) static void ks_disable_int(struct ks_net *ks)
@ -1218,6 +1262,10 @@ static int ks8851_probe(struct platform_device *pdev)
goto err_free; goto err_free;
} }
err = ks_check_endian(ks);
if (err)
goto err_free;
netdev->irq = platform_get_irq(pdev, 0); netdev->irq = platform_get_irq(pdev, 0);
if ((int)netdev->irq < 0) { if ((int)netdev->irq < 0) {

View file

@ -1720,7 +1720,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d
ahw->reset.seq_error = 0; ahw->reset.seq_error = 0;
ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL); ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL);
if (p_dev->ahw->reset.buff == NULL) if (ahw->reset.buff == NULL)
return -ENOMEM; return -ENOMEM;
p_buff = p_dev->ahw->reset.buff; p_buff = p_dev->ahw->reset.buff;

View file

@ -5182,6 +5182,13 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
if (!tp->phydev) { if (!tp->phydev) {
mdiobus_unregister(new_bus); mdiobus_unregister(new_bus);
return -ENODEV; return -ENODEV;
} else if (!tp->phydev->drv) {
/* Most chip versions fail with the genphy driver.
* Therefore ensure that the dedicated PHY driver is loaded.
*/
dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
mdiobus_unregister(new_bus);
return -EUNATCH;
} }
/* PHY will be woken up in rtl_open() */ /* PHY will be woken up in rtl_open() */
@ -5344,15 +5351,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct net_device *dev; struct net_device *dev;
u16 xid; u16 xid;
/* Some tools for creating an initramfs don't consider softdeps, then
* r8169.ko may be in initramfs, but realtek.ko not. Then the generic
* PHY driver is used that doesn't work with most chip versions.
*/
if (!driver_find("RTL8201CP Ethernet", &mdio_bus_type)) {
dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
return -ENOENT;
}
dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp)); dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;

View file

@ -864,7 +864,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
goto qc24_fail_command; goto qc24_fail_command;
} }
if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&base_vha->loop_state) == LOOP_DEAD) { atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
ql_dbg(ql_dbg_io, vha, 0x3005, ql_dbg(ql_dbg_io, vha, 0x3005,
@ -946,7 +946,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
goto qc24_fail_command; goto qc24_fail_command;
} }
if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&base_vha->loop_state) == LOOP_DEAD) { atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
ql_dbg(ql_dbg_io, vha, 0x3077, ql_dbg(ql_dbg_io, vha, 0x3077,

View file

@ -3169,9 +3169,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
if (sd_validate_opt_xfer_size(sdkp, dev_max)) { if (sd_validate_opt_xfer_size(sdkp, dev_max)) {
q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
} else } else {
q->limits.io_opt = 0;
rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
(sector_t)BLK_DEF_MAX_SECTORS); (sector_t)BLK_DEF_MAX_SECTORS);
}
/* Do not exceed controller limit */ /* Do not exceed controller limit */
rw_max = min(rw_max, queue_max_hw_sectors(q)); rw_max = min(rw_max, queue_max_hw_sectors(q));

View file

@ -233,10 +233,6 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
goto err_allocate_irqs; goto err_allocate_irqs;
} }
err = register_dpio_irq_handlers(dpio_dev, desc.cpu);
if (err)
goto err_register_dpio_irq;
priv->io = dpaa2_io_create(&desc, dev); priv->io = dpaa2_io_create(&desc, dev);
if (!priv->io) { if (!priv->io) {
dev_err(dev, "dpaa2_io_create failed\n"); dev_err(dev, "dpaa2_io_create failed\n");
@ -244,6 +240,10 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
goto err_dpaa2_io_create; goto err_dpaa2_io_create;
} }
err = register_dpio_irq_handlers(dpio_dev, desc.cpu);
if (err)
goto err_register_dpio_irq;
dev_info(dev, "probed\n"); dev_info(dev, "probed\n");
dev_dbg(dev, " receives_notifications = %d\n", dev_dbg(dev, " receives_notifications = %d\n",
desc.receives_notifications); desc.receives_notifications);

View file

@ -59,7 +59,7 @@ static int __init exynos_chipid_early_init(void)
syscon = of_find_compatible_node(NULL, NULL, syscon = of_find_compatible_node(NULL, NULL,
"samsung,exynos4210-chipid"); "samsung,exynos4210-chipid");
if (!syscon) if (!syscon)
return ENODEV; return -ENODEV;
regmap = device_node_to_regmap(syscon); regmap = device_node_to_regmap(syscon);
of_node_put(syscon); of_node_put(syscon);

View file

@ -139,6 +139,9 @@ static struct amdtee_session *find_session(struct amdtee_context_data *ctxdata,
u32 index = get_session_index(session); u32 index = get_session_index(session);
struct amdtee_session *sess; struct amdtee_session *sess;
if (index >= TEE_NUM_SESSIONS)
return NULL;
list_for_each_entry(sess, &ctxdata->sess_list, list_node) list_for_each_entry(sess, &ctxdata->sess_list, list_node)
if (ta_handle == sess->ta_handle && if (ta_handle == sess->ta_handle &&
test_bit(index, sess->sess_mask)) test_bit(index, sess->sess_mask))

View file

@ -145,6 +145,7 @@ static int afs_do_probe_fileserver(struct afs_net *net,
read_lock(&server->fs_lock); read_lock(&server->fs_lock);
ac.alist = rcu_dereference_protected(server->addresses, ac.alist = rcu_dereference_protected(server->addresses,
lockdep_is_held(&server->fs_lock)); lockdep_is_held(&server->fs_lock));
afs_get_addrlist(ac.alist);
read_unlock(&server->fs_lock); read_unlock(&server->fs_lock);
atomic_set(&server->probe_outstanding, ac.alist->nr_addrs); atomic_set(&server->probe_outstanding, ac.alist->nr_addrs);
@ -163,6 +164,7 @@ static int afs_do_probe_fileserver(struct afs_net *net,
if (!in_progress) if (!in_progress)
afs_fs_probe_done(server); afs_fs_probe_done(server);
afs_put_addrlist(ac.alist);
return in_progress; return in_progress;
} }

View file

@ -1415,10 +1415,13 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_fs_client *fsc = ceph_inode_to_client(inode); struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
struct ceph_osd_client *osdc = &fsc->client->osdc;
struct ceph_cap_flush *prealloc_cf; struct ceph_cap_flush *prealloc_cf;
ssize_t count, written = 0; ssize_t count, written = 0;
int err, want, got; int err, want, got;
bool direct_lock = false; bool direct_lock = false;
u32 map_flags;
u64 pool_flags;
loff_t pos; loff_t pos;
loff_t limit = max(i_size_read(inode), fsc->max_file_size); loff_t limit = max(i_size_read(inode), fsc->max_file_size);
@ -1481,8 +1484,12 @@ retry_snap:
goto out; goto out;
} }
/* FIXME: not complete since it doesn't account for being at quota */ down_read(&osdc->lock);
if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_FULL)) { map_flags = osdc->osdmap->flags;
pool_flags = ceph_pg_pool_flags(osdc->osdmap, ci->i_layout.pool_id);
up_read(&osdc->lock);
if ((map_flags & CEPH_OSDMAP_FULL) ||
(pool_flags & CEPH_POOL_FLAG_FULL)) {
err = -ENOSPC; err = -ENOSPC;
goto out; goto out;
} }
@ -1575,7 +1582,8 @@ retry_snap:
} }
if (written >= 0) { if (written >= 0) {
if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_NEARFULL)) if ((map_flags & CEPH_OSDMAP_NEARFULL) ||
(pool_flags & CEPH_POOL_FLAG_NEARFULL))
iocb->ki_flags |= IOCB_DSYNC; iocb->ki_flags |= IOCB_DSYNC;
written = generic_write_sync(iocb, written); written = generic_write_sync(iocb, written);
} }

View file

@ -1155,5 +1155,6 @@ void ceph_cleanup_snapid_map(struct ceph_mds_client *mdsc)
pr_err("snapid map %llx -> %x still in use\n", pr_err("snapid map %llx -> %x still in use\n",
sm->snap, sm->dev); sm->snap, sm->dev);
} }
kfree(sm);
} }
} }

View file

@ -161,6 +161,7 @@ static inline void copy_map_value(struct bpf_map *map, void *dst, void *src)
} }
void copy_map_value_locked(struct bpf_map *map, void *dst, void *src, void copy_map_value_locked(struct bpf_map *map, void *dst, void *src,
bool lock_src); bool lock_src);
int bpf_obj_name_cpy(char *dst, const char *src, unsigned int size);
struct bpf_offload_dev; struct bpf_offload_dev;
struct bpf_offloaded_map; struct bpf_offloaded_map;

View file

@ -175,9 +175,10 @@ struct ceph_msg_data {
#endif /* CONFIG_BLOCK */ #endif /* CONFIG_BLOCK */
struct ceph_bvec_iter bvec_pos; struct ceph_bvec_iter bvec_pos;
struct { struct {
struct page **pages; /* NOT OWNER. */ struct page **pages;
size_t length; /* total # bytes */ size_t length; /* total # bytes */
unsigned int alignment; /* first page */ unsigned int alignment; /* first page */
bool own_pages;
}; };
struct ceph_pagelist *pagelist; struct ceph_pagelist *pagelist;
}; };
@ -356,8 +357,8 @@ extern void ceph_con_keepalive(struct ceph_connection *con);
extern bool ceph_con_keepalive_expired(struct ceph_connection *con, extern bool ceph_con_keepalive_expired(struct ceph_connection *con,
unsigned long interval); unsigned long interval);
extern void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages,
size_t length, size_t alignment); size_t length, size_t alignment, bool own_pages);
extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg, extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist); struct ceph_pagelist *pagelist);
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK

View file

@ -37,6 +37,9 @@ int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs);
#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
together */ together */
#define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */ #define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */
#define CEPH_POOL_FLAG_FULL_QUOTA (1ULL << 10) /* pool ran out of quota,
will set FULL too */
#define CEPH_POOL_FLAG_NEARFULL (1ULL << 11) /* pool is nearfull */
struct ceph_pg_pool_info { struct ceph_pg_pool_info {
struct rb_node node; struct rb_node node;
@ -304,5 +307,6 @@ extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id);
#endif #endif

View file

@ -143,8 +143,10 @@ extern const char *ceph_osd_state_name(int s);
/* /*
* osd map flag bits * osd map flag bits
*/ */
#define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC) */ #define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC),
#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC) */ not set since ~luminous */
#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC),
not set since ~luminous */
#define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */
#define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */
#define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */

View file

@ -522,9 +522,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
* @clk_gate_flags: gate-specific flags for this clock * @clk_gate_flags: gate-specific flags for this clock
* @lock: shared register lock for this clock * @lock: shared register lock for this clock
*/ */
#define clk_hw_register_gate_parent_hw(dev, name, parent_name, flags, reg, \ #define clk_hw_register_gate_parent_hw(dev, name, parent_hw, flags, reg, \
bit_idx, clk_gate_flags, lock) \ bit_idx, clk_gate_flags, lock) \
__clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \ __clk_hw_register_gate((dev), NULL, (name), NULL, (parent_hw), \
NULL, (flags), (reg), (bit_idx), \ NULL, (flags), (reg), (bit_idx), \
(clk_gate_flags), (lock)) (clk_gate_flags), (lock))
/** /**
@ -539,10 +539,10 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
* @clk_gate_flags: gate-specific flags for this clock * @clk_gate_flags: gate-specific flags for this clock
* @lock: shared register lock for this clock * @lock: shared register lock for this clock
*/ */
#define clk_hw_register_gate_parent_data(dev, name, parent_name, flags, reg, \ #define clk_hw_register_gate_parent_data(dev, name, parent_data, flags, reg, \
bit_idx, clk_gate_flags, lock) \ bit_idx, clk_gate_flags, lock) \
__clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \ __clk_hw_register_gate((dev), NULL, (name), NULL, NULL, (parent_data), \
NULL, (flags), (reg), (bit_idx), \ (flags), (reg), (bit_idx), \
(clk_gate_flags), (lock)) (clk_gate_flags), (lock))
void clk_unregister_gate(struct clk *clk); void clk_unregister_gate(struct clk *clk);
void clk_hw_unregister_gate(struct clk_hw *hw); void clk_hw_unregister_gate(struct clk_hw *hw);

View file

@ -506,7 +506,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
* @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context
* so e.g. PMICs can be accessed very late before shutdown. Optional. * so e.g. PMICs can be accessed very late before shutdown. Optional.
* @functionality: Return the flags that this algorithm/adapter pair supports * @functionality: Return the flags that this algorithm/adapter pair supports
* from the I2C_FUNC_* flags. * from the ``I2C_FUNC_*`` flags.
* @reg_slave: Register given client to I2C slave mode of this adapter * @reg_slave: Register given client to I2C slave mode of this adapter
* @unreg_slave: Unregister given client from I2C slave mode of this adapter * @unreg_slave: Unregister given client from I2C slave mode of this adapter
* *
@ -515,7 +515,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
* be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
* to name two of the most common. * to name two of the most common.
* *
* The return codes from the @master_xfer{_atomic} fields should indicate the * The return codes from the ``master_xfer{_atomic}`` fields should indicate the
* type of error code that occurred during the transfer, as documented in the * type of error code that occurred during the transfer, as documented in the
* Kernel Documentation file Documentation/i2c/fault-codes.rst. * Kernel Documentation file Documentation/i2c/fault-codes.rst.
*/ */

View file

@ -2111,14 +2111,14 @@ ieee80211_he_spr_size(const u8 *he_spr_ie)
{ {
struct ieee80211_he_spr *he_spr = (void *)he_spr_ie; struct ieee80211_he_spr *he_spr = (void *)he_spr_ie;
u8 spr_len = sizeof(struct ieee80211_he_spr); u8 spr_len = sizeof(struct ieee80211_he_spr);
u32 he_spr_params; u8 he_spr_params;
/* Make sure the input is not NULL */ /* Make sure the input is not NULL */
if (!he_spr_ie) if (!he_spr_ie)
return 0; return 0;
/* Calc required length */ /* Calc required length */
he_spr_params = le32_to_cpu(he_spr->he_sr_control); he_spr_params = he_spr->he_sr_control;
if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
spr_len++; spr_len++;
if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT)

View file

@ -695,6 +695,7 @@ static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec,
void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
int val); int val);
void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val); void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val);
void mod_memcg_obj_state(void *p, int idx, int val);
static inline void mod_lruvec_state(struct lruvec *lruvec, static inline void mod_lruvec_state(struct lruvec *lruvec,
enum node_stat_item idx, int val) enum node_stat_item idx, int val)
@ -1123,6 +1124,10 @@ static inline void __mod_lruvec_slab_state(void *p, enum node_stat_item idx,
__mod_node_page_state(page_pgdat(page), idx, val); __mod_node_page_state(page_pgdat(page), idx, val);
} }
static inline void mod_memcg_obj_state(void *p, int idx, int val)
{
}
static inline static inline
unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
gfp_t gfp_mask, gfp_t gfp_mask,
@ -1427,6 +1432,8 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg)
return memcg ? memcg->kmemcg_id : -1; return memcg ? memcg->kmemcg_id : -1;
} }
struct mem_cgroup *mem_cgroup_from_obj(void *p);
#else #else
static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order) static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
@ -1468,6 +1475,11 @@ static inline void memcg_put_cache_ids(void)
{ {
} }
static inline struct mem_cgroup *mem_cgroup_from_obj(void *p)
{
return NULL;
}
#endif /* CONFIG_MEMCG_KMEM */ #endif /* CONFIG_MEMCG_KMEM */
#endif /* _LINUX_MEMCONTROL_H */ #endif /* _LINUX_MEMCONTROL_H */

View file

@ -652,6 +652,9 @@
/* Electronic privacy screen control */ /* Electronic privacy screen control */
#define KEY_PRIVACY_SCREEN_TOGGLE 0x279 #define KEY_PRIVACY_SCREEN_TOGGLE 0x279
/* Select an area of screen to be copied */
#define KEY_SELECTIVE_SCREENSHOT 0x27a
/* /*
* Some keyboards have keys which do not have a defined meaning, these keys * Some keyboards have keys which do not have a defined meaning, these keys
* are intended to be programmed / bound to macros by the user. For most * are intended to be programmed / bound to macros by the user. For most

View file

@ -9,7 +9,7 @@
#ifndef _UAPI_SERIO_H #ifndef _UAPI_SERIO_H
#define _UAPI_SERIO_H #define _UAPI_SERIO_H
#include <linux/const.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
#define SPIOCSTYPE _IOW('q', 0x01, unsigned long) #define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
@ -18,10 +18,10 @@
/* /*
* bit masks for use in "interrupt" flags (3rd argument) * bit masks for use in "interrupt" flags (3rd argument)
*/ */
#define SERIO_TIMEOUT BIT(0) #define SERIO_TIMEOUT _BITUL(0)
#define SERIO_PARITY BIT(1) #define SERIO_PARITY _BITUL(1)
#define SERIO_FRAME BIT(2) #define SERIO_FRAME _BITUL(2)
#define SERIO_OOB_DATA BIT(3) #define SERIO_OOB_DATA _BITUL(3)
/* /*
* Serio types * Serio types

View file

@ -4577,7 +4577,7 @@ int btf_get_info_by_fd(const struct btf *btf,
union bpf_attr __user *uattr) union bpf_attr __user *uattr)
{ {
struct bpf_btf_info __user *uinfo; struct bpf_btf_info __user *uinfo;
struct bpf_btf_info info = {}; struct bpf_btf_info info;
u32 info_copy, btf_copy; u32 info_copy, btf_copy;
void __user *ubtf; void __user *ubtf;
u32 uinfo_len; u32 uinfo_len;
@ -4586,6 +4586,7 @@ int btf_get_info_by_fd(const struct btf *btf,
uinfo_len = attr->info.info_len; uinfo_len = attr->info.info_len;
info_copy = min_t(u32, uinfo_len, sizeof(info)); info_copy = min_t(u32, uinfo_len, sizeof(info));
memset(&info, 0, sizeof(info));
if (copy_from_user(&info, uinfo, info_copy)) if (copy_from_user(&info, uinfo, info_copy))
return -EFAULT; return -EFAULT;

View file

@ -689,14 +689,15 @@ int bpf_get_file_flag(int flags)
offsetof(union bpf_attr, CMD##_LAST_FIELD) - \ offsetof(union bpf_attr, CMD##_LAST_FIELD) - \
sizeof(attr->CMD##_LAST_FIELD)) != NULL sizeof(attr->CMD##_LAST_FIELD)) != NULL
/* dst and src must have at least BPF_OBJ_NAME_LEN number of bytes. /* dst and src must have at least "size" number of bytes.
* Return 0 on success and < 0 on error. * Return strlen on success and < 0 on error.
*/ */
static int bpf_obj_name_cpy(char *dst, const char *src) int bpf_obj_name_cpy(char *dst, const char *src, unsigned int size)
{ {
const char *end = src + BPF_OBJ_NAME_LEN; const char *end = src + size;
const char *orig_src = src;
memset(dst, 0, BPF_OBJ_NAME_LEN); memset(dst, 0, size);
/* Copy all isalnum(), '_' and '.' chars. */ /* Copy all isalnum(), '_' and '.' chars. */
while (src < end && *src) { while (src < end && *src) {
if (!isalnum(*src) && if (!isalnum(*src) &&
@ -705,11 +706,11 @@ static int bpf_obj_name_cpy(char *dst, const char *src)
*dst++ = *src++; *dst++ = *src++;
} }
/* No '\0' found in BPF_OBJ_NAME_LEN number of bytes */ /* No '\0' found in "size" number of bytes */
if (src == end) if (src == end)
return -EINVAL; return -EINVAL;
return 0; return src - orig_src;
} }
int map_check_no_btf(const struct bpf_map *map, int map_check_no_btf(const struct bpf_map *map,
@ -803,8 +804,9 @@ static int map_create(union bpf_attr *attr)
if (IS_ERR(map)) if (IS_ERR(map))
return PTR_ERR(map); return PTR_ERR(map);
err = bpf_obj_name_cpy(map->name, attr->map_name); err = bpf_obj_name_cpy(map->name, attr->map_name,
if (err) sizeof(attr->map_name));
if (err < 0)
goto free_map; goto free_map;
atomic64_set(&map->refcnt, 1); atomic64_set(&map->refcnt, 1);
@ -2102,8 +2104,9 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
goto free_prog; goto free_prog;
prog->aux->load_time = ktime_get_boottime_ns(); prog->aux->load_time = ktime_get_boottime_ns();
err = bpf_obj_name_cpy(prog->aux->name, attr->prog_name); err = bpf_obj_name_cpy(prog->aux->name, attr->prog_name,
if (err) sizeof(attr->prog_name));
if (err < 0)
goto free_prog; goto free_prog;
/* run eBPF verifier */ /* run eBPF verifier */
@ -2987,7 +2990,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
union bpf_attr __user *uattr) union bpf_attr __user *uattr)
{ {
struct bpf_prog_info __user *uinfo = u64_to_user_ptr(attr->info.info); struct bpf_prog_info __user *uinfo = u64_to_user_ptr(attr->info.info);
struct bpf_prog_info info = {}; struct bpf_prog_info info;
u32 info_len = attr->info.info_len; u32 info_len = attr->info.info_len;
struct bpf_prog_stats stats; struct bpf_prog_stats stats;
char __user *uinsns; char __user *uinsns;
@ -2999,6 +3002,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
return err; return err;
info_len = min_t(u32, sizeof(info), info_len); info_len = min_t(u32, sizeof(info), info_len);
memset(&info, 0, sizeof(info));
if (copy_from_user(&info, uinfo, info_len)) if (copy_from_user(&info, uinfo, info_len))
return -EFAULT; return -EFAULT;
@ -3262,7 +3266,7 @@ static int bpf_map_get_info_by_fd(struct bpf_map *map,
union bpf_attr __user *uattr) union bpf_attr __user *uattr)
{ {
struct bpf_map_info __user *uinfo = u64_to_user_ptr(attr->info.info); struct bpf_map_info __user *uinfo = u64_to_user_ptr(attr->info.info);
struct bpf_map_info info = {}; struct bpf_map_info info;
u32 info_len = attr->info.info_len; u32 info_len = attr->info.info_len;
int err; int err;
@ -3271,6 +3275,7 @@ static int bpf_map_get_info_by_fd(struct bpf_map *map,
return err; return err;
info_len = min_t(u32, sizeof(info), info_len); info_len = min_t(u32, sizeof(info), info_len);
memset(&info, 0, sizeof(info));
info.type = map->map_type; info.type = map->map_type;
info.id = map->id; info.id = map->id;
info.key_size = map->key_size; info.key_size = map->key_size;
@ -3561,7 +3566,7 @@ err_put:
SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size) SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
{ {
union bpf_attr attr = {}; union bpf_attr attr;
int err; int err;
if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN)) if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN))
@ -3573,6 +3578,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
size = min_t(u32, size, sizeof(attr)); size = min_t(u32, size, sizeof(attr));
/* copy attributes from user space, may be less than sizeof(bpf_attr) */ /* copy attributes from user space, may be less than sizeof(bpf_attr) */
memset(&attr, 0, sizeof(attr));
if (copy_from_user(&attr, uattr, size) != 0) if (copy_from_user(&attr, uattr, size) != 0)
return -EFAULT; return -EFAULT;

View file

@ -397,7 +397,7 @@ static void account_kernel_stack(struct task_struct *tsk, int account)
mod_zone_page_state(page_zone(first_page), NR_KERNEL_STACK_KB, mod_zone_page_state(page_zone(first_page), NR_KERNEL_STACK_KB,
THREAD_SIZE / 1024 * account); THREAD_SIZE / 1024 * account);
mod_memcg_page_state(first_page, MEMCG_KERNEL_STACK_KB, mod_memcg_obj_state(stack, MEMCG_KERNEL_STACK_KB,
account * (THREAD_SIZE / 1024)); account * (THREAD_SIZE / 1024));
} }
} }

View file

@ -323,7 +323,11 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
if (desc->affinity_notify) { if (desc->affinity_notify) {
kref_get(&desc->affinity_notify->kref); kref_get(&desc->affinity_notify->kref);
schedule_work(&desc->affinity_notify->work); if (!schedule_work(&desc->affinity_notify->work)) {
/* Work was already scheduled, drop our extra ref */
kref_put(&desc->affinity_notify->kref,
desc->affinity_notify->release);
}
} }
irqd_set(data, IRQD_AFFINITY_SET); irqd_set(data, IRQD_AFFINITY_SET);
@ -423,7 +427,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
raw_spin_unlock_irqrestore(&desc->lock, flags); raw_spin_unlock_irqrestore(&desc->lock, flags);
if (old_notify) { if (old_notify) {
cancel_work_sync(&old_notify->work); if (cancel_work_sync(&old_notify->work)) {
/* Pending work had a ref, put that one too */
kref_put(&old_notify->kref, old_notify->release);
}
kref_put(&old_notify->kref, old_notify->release); kref_put(&old_notify->kref, old_notify->release);
} }

View file

@ -240,8 +240,7 @@ again:
if (!page_counter_try_charge(&h_cg->hugepage[idx], nr_pages, if (!page_counter_try_charge(&h_cg->hugepage[idx], nr_pages,
&counter)) { &counter)) {
ret = -ENOMEM; ret = -ENOMEM;
hugetlb_event(hugetlb_cgroup_from_counter(counter, idx), idx, hugetlb_event(h_cg, idx, HUGETLB_MAX);
HUGETLB_MAX);
} }
css_put(&h_cg->css); css_put(&h_cg->css);
done: done:

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